From d727d11d8ac2317411ba159f0a5d65bc71e8d005 Mon Sep 17 00:00:00 2001 From: seven Date: Fri, 13 Dec 2024 00:42:41 +0800 Subject: [PATCH] feat: setup terraform for huaweicloud stack Signed-off-by: seven --- cdktf.json | 9 + eslint.config.mjs | 2 +- package-lock.json | 1315 ++- package.json | 1 + src/constructs/constraints.json | 6 + .../huaweicloud/aad-forward-rule/README.md | 3 + .../huaweicloud/aad-forward-rule/index.ts | 281 + .../access-analyzer-archive-rule/README.md | 3 + .../access-analyzer-archive-rule/index.ts | 609 ++ .../huaweicloud/access-analyzer/README.md | 3 + .../huaweicloud/access-analyzer/index.ts | 247 + .../huaweicloud/antiddos-basic/README.md | 3 + .../huaweicloud/antiddos-basic/index.ts | 389 + .../README.md | 3 + .../index.ts | 173 + .../aom-alarm-action-rule/README.md | 3 + .../aom-alarm-action-rule/index.ts | 442 + .../aom-alarm-group-rule/README.md | 3 + .../huaweicloud/aom-alarm-group-rule/index.ts | 683 ++ .../huaweicloud/aom-alarm-policy/README.md | 3 + .../huaweicloud/aom-alarm-policy/index.ts | 2780 ++++++ .../huaweicloud/aom-alarm-rule/README.md | 3 + .../huaweicloud/aom-alarm-rule/index.ts | 912 ++ .../aom-alarm-rules-template/README.md | 3 + .../aom-alarm-rules-template/index.ts | 3398 ++++++++ .../aom-alarm-silence-rule/README.md | 3 + .../aom-alarm-silence-rule/index.ts | 774 ++ .../huaweicloud/aom-application/README.md | 3 + .../huaweicloud/aom-application/index.ts | 524 ++ .../aom-cloud-service-access/README.md | 3 + .../aom-cloud-service-access/index.ts | 247 + .../aom-cmdb-application/README.md | 3 + .../huaweicloud/aom-cmdb-application/index.ts | 235 + .../huaweicloud/aom-cmdb-component/README.md | 3 + .../huaweicloud/aom-cmdb-component/index.ts | 239 + .../aom-cmdb-environment/README.md | 3 + .../huaweicloud/aom-cmdb-environment/index.ts | 287 + .../aom-cmdb-resource-relationships/README.md | 3 + .../aom-cmdb-resource-relationships/index.ts | 627 ++ .../huaweicloud/aom-component/README.md | 3 + .../huaweicloud/aom-component/index.ts | 569 ++ .../huaweicloud/aom-dashboard/README.md | 3 + .../huaweicloud/aom-dashboard/index.ts | 331 + .../aom-dashboards-folder/README.md | 3 + .../aom-dashboards-folder/index.ts | 240 + .../huaweicloud/aom-environment/README.md | 3 + .../huaweicloud/aom-environment/index.ts | 779 ++ .../aom-event-alarm-rule/README.md | 3 + .../huaweicloud/aom-event-alarm-rule/index.ts | 499 ++ .../aom-message-template/README.md | 3 + .../huaweicloud/aom-message-template/index.ts | 524 ++ .../README.md | 3 + .../index.ts | 642 ++ .../huaweicloud/aom-prom-instance/README.md | 3 + .../huaweicloud/aom-prom-instance/index.ts | 270 + .../aom-prometheus-instance/README.md | 3 + .../aom-prometheus-instance/index.ts | 474 + .../aom-service-discovery-rule/README.md | 3 + .../aom-service-discovery-rule/index.ts | 1456 ++++ .../huaweicloud/aomv4-alarm-rule/README.md | 3 + .../huaweicloud/aomv4-alarm-rule/index.ts | 2617 ++++++ .../huaweicloud/api-gateway-api/README.md | 3 + .../huaweicloud/api-gateway-api/index.ts | 1899 ++++ .../api-gateway-environment/README.md | 3 + .../api-gateway-environment/index.ts | 202 + .../huaweicloud/api-gateway-group/README.md | 3 + .../huaweicloud/api-gateway-group/index.ts | 359 + .../apig-acl-policy-associate/README.md | 3 + .../apig-acl-policy-associate/index.ts | 417 + .../huaweicloud/apig-acl-policy/README.md | 3 + .../huaweicloud/apig-acl-policy/index.ts | 286 + .../apig-api-publishment/README.md | 3 + .../huaweicloud/apig-api-publishment/index.ts | 388 + .../providers/huaweicloud/apig-api/README.md | 3 + .../providers/huaweicloud/apig-api/index.ts | 5765 +++++++++++++ .../huaweicloud/apig-appcode/README.md | 3 + .../huaweicloud/apig-appcode/index.ts | 235 + .../apig-application-acl/README.md | 3 + .../huaweicloud/apig-application-acl/index.ts | 254 + .../apig-application-authorization/README.md | 3 + .../apig-application-authorization/index.ts | 444 + .../README.md | 3 + .../apig-application-quota-associate/index.ts | 540 ++ .../apig-application-quota/README.md | 3 + .../apig-application-quota/index.ts | 319 + .../huaweicloud/apig-application/README.md | 3 + .../huaweicloud/apig-application/index.ts | 310 + .../huaweicloud/apig-certificate/README.md | 3 + .../huaweicloud/apig-certificate/index.ts | 337 + .../huaweicloud/apig-channel/README.md | 3 + .../huaweicloud/apig-channel/index.ts | 2009 +++++ .../apig-custom-authorizer/README.md | 3 + .../apig-custom-authorizer/index.ts | 654 ++ .../README.md | 3 + .../index.ts | 387 + .../apig-endpoint-whitelist/README.md | 3 + .../apig-endpoint-whitelist/index.ts | 200 + .../apig-environment-variable/README.md | 3 + .../apig-environment-variable/index.ts | 281 + .../huaweicloud/apig-environment/README.md | 3 + .../huaweicloud/apig-environment/index.ts | 240 + .../huaweicloud/apig-group/README.md | 3 + .../providers/huaweicloud/apig-group/index.ts | 853 ++ .../apig-instance-feature/README.md | 3 + .../apig-instance-feature/index.ts | 382 + .../apig-instance-routes/README.md | 3 + .../huaweicloud/apig-instance-routes/index.ts | 200 + .../huaweicloud/apig-instance/README.md | 3 + .../huaweicloud/apig-instance/index.ts | 1087 +++ .../apig-plugin-associate/README.md | 3 + .../apig-plugin-associate/index.ts | 254 + .../huaweicloud/apig-plugin/README.md | 3 + .../huaweicloud/apig-plugin/index.ts | 294 + .../huaweicloud/apig-response/README.md | 3 + .../huaweicloud/apig-response/index.ts | 449 + .../apig-signature-associate/README.md | 3 + .../apig-signature-associate/index.ts | 417 + .../huaweicloud/apig-signature/README.md | 3 + .../huaweicloud/apig-signature/index.ts | 327 + .../README.md | 3 + .../apig-throttling-policy-associate/index.ts | 417 + .../apig-throttling-policy/README.md | 3 + .../apig-throttling-policy/index.ts | 813 ++ .../huaweicloud/apig-vpc-channel/README.md | 3 + .../huaweicloud/apig-vpc-channel/index.ts | 725 ++ .../providers/huaweicloud/apm-aksk/README.md | 3 + .../providers/huaweicloud/apm-aksk/index.ts | 344 + .../huaweicloud/as-bandwidth-policy/README.md | 3 + .../huaweicloud/as-bandwidth-policy/index.ts | 764 ++ .../huaweicloud/as-configuration-v1/README.md | 3 + .../huaweicloud/as-configuration-v1/index.ts | 1681 ++++ .../huaweicloud/as-configuration/README.md | 3 + .../huaweicloud/as-configuration/index.ts | 1681 ++++ .../huaweicloud/as-group-v1/README.md | 3 + .../huaweicloud/as-group-v1/index.ts | 1653 ++++ .../providers/huaweicloud/as-group/README.md | 3 + .../providers/huaweicloud/as-group/index.ts | 1653 ++++ .../huaweicloud/as-instance-attach/README.md | 3 + .../huaweicloud/as-instance-attach/index.ts | 483 ++ .../as-lifecycle-hook-callback/README.md | 3 + .../as-lifecycle-hook-callback/index.ts | 278 + .../huaweicloud/as-lifecycle-hook/README.md | 3 + .../huaweicloud/as-lifecycle-hook/index.ts | 338 + .../huaweicloud/as-notification/README.md | 3 + .../huaweicloud/as-notification/index.ts | 230 + .../huaweicloud/as-planned-task/README.md | 3 + .../huaweicloud/as-planned-task/index.ts | 638 ++ .../huaweicloud/as-policy-v1/README.md | 3 + .../huaweicloud/as-policy-v1/index.ts | 731 ++ .../providers/huaweicloud/as-policy/README.md | 3 + .../providers/huaweicloud/as-policy/index.ts | 731 ++ .../providers/huaweicloud/asm-mesh/README.md | 3 + .../providers/huaweicloud/asm-mesh/index.ts | 1428 +++ .../huaweicloud/bcs-instance/README.md | 3 + .../huaweicloud/bcs-instance/index.ts | 1975 +++++ .../blockstorage-volume-v2/README.md | 3 + .../blockstorage-volume-v2/index.ts | 725 ++ .../huaweicloud/bms-instance/README.md | 3 + .../huaweicloud/bms-instance/index.ts | 1430 ++++ .../cae-component-configurations/README.md | 3 + .../cae-component-configurations/index.ts | 401 + .../cae-component-deployment/README.md | 3 + .../cae-component-deployment/index.ts | 559 ++ .../huaweicloud/cae-component/README.md | 3 + .../huaweicloud/cae-component/index.ts | 1204 +++ .../cbh-asset-agency-authorization/README.md | 3 + .../cbh-asset-agency-authorization/index.ts | 194 + .../huaweicloud/cbh-ha-instance/README.md | 3 + .../huaweicloud/cbh-ha-instance/index.ts | 961 +++ .../huaweicloud/cbh-instance/README.md | 3 + .../huaweicloud/cbh-instance/index.ts | 892 ++ .../cbr-backup-share-accepter/README.md | 3 + .../cbr-backup-share-accepter/index.ts | 205 + .../huaweicloud/cbr-backup-share/README.md | 3 + .../huaweicloud/cbr-backup-share/index.ts | 345 + .../huaweicloud/cbr-checkpoint/README.md | 3 + .../huaweicloud/cbr-checkpoint/index.ts | 626 ++ .../huaweicloud/cbr-policy/README.md | 3 + .../providers/huaweicloud/cbr-policy/index.ts | 846 ++ .../providers/huaweicloud/cbr-vault/README.md | 3 + .../providers/huaweicloud/cbr-vault/index.ts | 1245 +++ .../huaweicloud/cc-authorization/README.md | 3 + .../huaweicloud/cc-authorization/index.ts | 312 + .../cc-bandwidth-package/README.md | 3 + .../huaweicloud/cc-bandwidth-package/index.ts | 551 ++ .../cc-central-network-attachment/README.md | 3 + .../cc-central-network-attachment/index.ts | 613 ++ .../README.md | 3 + .../index.ts | 442 + .../cc-central-network-policy-apply/README.md | 3 + .../cc-central-network-policy-apply/index.ts | 388 + .../cc-central-network-policy/README.md | 3 + .../cc-central-network-policy/index.ts | 1050 +++ .../huaweicloud/cc-central-network/README.md | 3 + .../huaweicloud/cc-central-network/index.ts | 456 + .../huaweicloud/cc-connection/README.md | 3 + .../huaweicloud/cc-connection/index.ts | 289 + .../README.md | 3 + .../index.ts | 415 + .../cc-global-connection-bandwidth/README.md | 3 + .../cc-global-connection-bandwidth/index.ts | 576 ++ .../cc-inter-region-bandwidth/README.md | 3 + .../cc-inter-region-bandwidth/index.ts | 348 + .../huaweicloud/cc-network-instance/README.md | 3 + .../huaweicloud/cc-network-instance/index.ts | 406 + .../providers/huaweicloud/cce-addon/README.md | 3 + .../providers/huaweicloud/cce-addon/index.ts | 701 ++ .../huaweicloud/cce-autopilot-addon/README.md | 3 + .../huaweicloud/cce-autopilot-addon/index.ts | 503 ++ .../cce-autopilot-cluster/README.md | 3 + .../cce-autopilot-cluster/index.ts | 2298 +++++ .../providers/huaweicloud/cce-chart/README.md | 3 + .../providers/huaweicloud/cce-chart/index.ts | 252 + .../cce-cluster-log-config/README.md | 3 + .../cce-cluster-log-config/index.ts | 376 + .../huaweicloud/cce-cluster-upgrade/README.md | 3 + .../huaweicloud/cce-cluster-upgrade/index.ts | 1017 +++ .../huaweicloud/cce-cluster-v3/README.md | 3 + .../huaweicloud/cce-cluster-v3/index.ts | 2455 ++++++ .../huaweicloud/cce-cluster/README.md | 3 + .../huaweicloud/cce-cluster/index.ts | 2455 ++++++ .../huaweicloud/cce-namespace/README.md | 3 + .../huaweicloud/cce-namespace/index.ts | 415 + .../huaweicloud/cce-node-attach/README.md | 3 + .../huaweicloud/cce-node-attach/index.ts | 2380 +++++ .../cce-node-pool-nodes-add/README.md | 3 + .../cce-node-pool-nodes-add/index.ts | 486 ++ .../huaweicloud/cce-node-pool/README.md | 3 + .../huaweicloud/cce-node-pool/index.ts | 4391 ++++++++++ .../huaweicloud/cce-node-v3/README.md | 3 + .../huaweicloud/cce-node-v3/index.ts | 4001 +++++++++ .../providers/huaweicloud/cce-node/README.md | 3 + .../providers/huaweicloud/cce-node/index.ts | 4001 +++++++++ .../huaweicloud/cce-partition/README.md | 3 + .../huaweicloud/cce-partition/index.ts | 393 + .../providers/huaweicloud/cce-pvc/README.md | 3 + .../providers/huaweicloud/cce-pvc/index.ts | 517 ++ .../huaweicloud/cci-namespace/README.md | 3 + .../huaweicloud/cci-namespace/index.ts | 529 ++ .../huaweicloud/cci-network/README.md | 3 + .../huaweicloud/cci-network/index.ts | 449 + .../providers/huaweicloud/cci-pvc/README.md | 3 + .../providers/huaweicloud/cci-pvc/index.ts | 452 + .../ccm-certificate-apply/README.md | 3 + .../ccm-certificate-apply/index.ts | 698 ++ .../ccm-certificate-deploy/README.md | 3 + .../ccm-certificate-deploy/index.ts | 483 ++ .../ccm-certificate-import/README.md | 3 + .../ccm-certificate-import/index.ts | 633 ++ .../ccm-certificate-push/README.md | 3 + .../huaweicloud/ccm-certificate-push/index.ts | 344 + .../huaweicloud/ccm-certificate/README.md | 3 + .../huaweicloud/ccm-certificate/index.ts | 755 ++ .../ccm-private-ca-restore/README.md | 3 + .../ccm-private-ca-restore/index.ts | 173 + .../ccm-private-ca-revoke/README.md | 3 + .../ccm-private-ca-revoke/index.ts | 197 + .../huaweicloud/ccm-private-ca/README.md | 3 + .../huaweicloud/ccm-private-ca/index.ts | 1248 +++ .../ccm-private-certificate-revoke/README.md | 3 + .../ccm-private-certificate-revoke/index.ts | 197 + .../ccm-private-certificate/README.md | 3 + .../ccm-private-certificate/index.ts | 1214 +++ .../huaweicloud/cdm-cluster-action/README.md | 3 + .../huaweicloud/cdm-cluster-action/index.ts | 502 ++ .../huaweicloud/cdm-cluster-v1/README.md | 3 + .../huaweicloud/cdm-cluster-v1/index.ts | 788 ++ .../huaweicloud/cdm-cluster/README.md | 3 + .../huaweicloud/cdm-cluster/index.ts | 788 ++ .../providers/huaweicloud/cdm-job/README.md | 3 + .../providers/huaweicloud/cdm-job/index.ts | 1173 +++ .../providers/huaweicloud/cdm-link/README.md | 3 + .../providers/huaweicloud/cdm-link/index.ts | 356 + .../huaweicloud/cdn-billing-option/README.md | 3 + .../huaweicloud/cdn-billing-option/index.ts | 217 + .../huaweicloud/cdn-cache-preheat/README.md | 3 + .../huaweicloud/cdn-cache-preheat/index.ts | 233 + .../huaweicloud/cdn-cache-refresh/README.md | 3 + .../huaweicloud/cdn-cache-refresh/index.ts | 293 + .../huaweicloud/cdn-domain-v1/README.md | 3 + .../huaweicloud/cdn-domain-v1/index.ts | 7618 +++++++++++++++++ .../huaweicloud/cdn-domain/README.md | 3 + .../providers/huaweicloud/cdn-domain/index.ts | 7618 +++++++++++++++++ .../huaweicloud/ces-alarm-template/README.md | 3 + .../huaweicloud/ces-alarm-template/index.ts | 737 ++ .../huaweicloud/ces-alarmrule/README.md | 3 + .../huaweicloud/ces-alarmrule/index.ts | 2156 +++++ .../ces-dashboard-widget/README.md | 3 + .../huaweicloud/ces-dashboard-widget/index.ts | 1067 +++ .../huaweicloud/ces-dashboard/README.md | 3 + .../huaweicloud/ces-dashboard/index.ts | 298 + .../huaweicloud/ces-event-report/README.md | 3 + .../huaweicloud/ces-event-report/index.ts | 759 ++ .../huaweicloud/ces-one-click-alarm/README.md | 3 + .../huaweicloud/ces-one-click-alarm/index.ts | 775 ++ .../huaweicloud/ces-resource-group/README.md | 3 + .../huaweicloud/ces-resource-group/index.ts | 620 ++ .../huaweicloud/cfw-acl-rule/README.md | 3 + .../huaweicloud/cfw-acl-rule/index.ts | 2077 +++++ .../cfw-address-group-member/README.md | 3 + .../cfw-address-group-member/index.ts | 288 + .../huaweicloud/cfw-address-group/README.md | 3 + .../huaweicloud/cfw-address-group/index.ts | 258 + .../cfw-black-white-list/README.md | 3 + .../huaweicloud/cfw-black-white-list/index.ts | 366 + .../huaweicloud/cfw-capture-task/README.md | 3 + .../huaweicloud/cfw-capture-task/index.ts | 923 ++ .../huaweicloud/cfw-dns-resolution/README.md | 3 + .../huaweicloud/cfw-dns-resolution/index.ts | 261 + .../cfw-domain-name-group/README.md | 3 + .../cfw-domain-name-group/index.ts | 487 ++ .../huaweicloud/cfw-eip-protection/README.md | 3 + .../huaweicloud/cfw-eip-protection/index.ts | 576 ++ .../huaweicloud/cfw-firewall/README.md | 3 + .../huaweicloud/cfw-firewall/index.ts | 1078 +++ .../huaweicloud/cfw-lts-log/README.md | 3 + .../huaweicloud/cfw-lts-log/index.ts | 369 + .../huaweicloud/cfw-protection-rule/README.md | 3 + .../huaweicloud/cfw-protection-rule/index.ts | 2703 ++++++ .../cfw-service-group-member/README.md | 3 + .../cfw-service-group-member/index.ts | 312 + .../huaweicloud/cfw-service-group/README.md | 3 + .../huaweicloud/cfw-service-group/index.ts | 228 + .../huaweicloud/cloudtable-cluster/README.md | 3 + .../huaweicloud/cloudtable-cluster/index.ts | 600 ++ .../cnad-advanced-black-white-list/README.md | 3 + .../cnad-advanced-black-white-list/index.ts | 203 + .../cnad-advanced-policy-associate/README.md | 3 + .../cnad-advanced-policy-associate/index.ts | 334 + .../cnad-advanced-policy/README.md | 3 + .../huaweicloud/cnad-advanced-policy/index.ts | 265 + .../cnad-advanced-protected-object/README.md | 3 + .../cnad-advanced-protected-object/index.ts | 398 + .../huaweicloud/coc-script-execute/README.md | 3 + .../huaweicloud/coc-script-execute/index.ts | 566 ++ .../huaweicloud/coc-script/README.md | 3 + .../providers/huaweicloud/coc-script/index.ts | 517 ++ .../codearts-deploy-application/README.md | 3 + .../codearts-deploy-application/index.ts | 853 ++ .../codearts-deploy-group/README.md | 3 + .../codearts-deploy-group/index.ts | 512 ++ .../codearts-deploy-host/README.md | 3 + .../huaweicloud/codearts-deploy-host/index.ts | 609 ++ .../codearts-inspector-website-scan/README.md | 3 + .../codearts-inspector-website-scan/index.ts | 590 ++ .../codearts-inspector-website/README.md | 3 + .../codearts-inspector-website/index.ts | 407 + .../huaweicloud/codearts-project/README.md | 3 + .../huaweicloud/codearts-project/index.ts | 333 + .../huaweicloud/codearts-repository/README.md | 3 + .../huaweicloud/codearts-repository/index.ts | 572 ++ .../huaweicloud/codehub-repository/README.md | 3 + .../huaweicloud/codehub-repository/index.ts | 572 ++ .../compute-auto-launch-group/README.md | 3 + .../compute-auto-launch-group/index.ts | 942 ++ .../compute-eip-associate/README.md | 3 + .../compute-eip-associate/index.ts | 382 + .../compute-floatingip-associate-v2/README.md | 3 + .../compute-floatingip-associate-v2/index.ts | 382 + .../compute-floatingip-v2/README.md | 3 + .../compute-floatingip-v2/index.ts | 187 + .../huaweicloud/compute-instance-v2/README.md | 3 + .../huaweicloud/compute-instance-v2/index.ts | 2814 ++++++ .../huaweicloud/compute-instance/README.md | 3 + .../huaweicloud/compute-instance/index.ts | 2814 ++++++ .../compute-interface-attach-v2/README.md | 3 + .../compute-interface-attach-v2/index.ts | 532 ++ .../compute-interface-attach/README.md | 3 + .../compute-interface-attach/index.ts | 532 ++ .../huaweicloud/compute-keypair-v2/README.md | 3 + .../huaweicloud/compute-keypair-v2/index.ts | 225 + .../huaweicloud/compute-keypair/README.md | 3 + .../huaweicloud/compute-keypair/index.ts | 225 + .../huaweicloud/compute-secgroup-v2/README.md | 3 + .../huaweicloud/compute-secgroup-v2/index.ts | 625 ++ .../compute-servergroup-v2/README.md | 3 + .../compute-servergroup-v2/index.ts | 232 + .../huaweicloud/compute-servergroup/README.md | 3 + .../huaweicloud/compute-servergroup/index.ts | 232 + .../compute-volume-attach-v2/README.md | 3 + .../compute-volume-attach-v2/index.ts | 384 + .../compute-volume-attach/README.md | 3 + .../compute-volume-attach/index.ts | 384 + .../huaweicloud/cph-adb-command/README.md | 3 + .../huaweicloud/cph-adb-command/index.ts | 410 + .../huaweicloud/cph-phone-property/README.md | 3 + .../huaweicloud/cph-phone-property/index.ts | 438 + .../huaweicloud/cph-phone-reset/README.md | 3 + .../huaweicloud/cph-phone-reset/index.ts | 471 + .../huaweicloud/cph-phone-restart/README.md | 3 + .../huaweicloud/cph-phone-restart/index.ts | 471 + .../huaweicloud/cph-phone-stop/README.md | 3 + .../huaweicloud/cph-phone-stop/index.ts | 323 + .../huaweicloud/cph-server-restart/README.md | 3 + .../huaweicloud/cph-server-restart/index.ts | 326 + .../huaweicloud/cph-server/README.md | 3 + .../providers/huaweicloud/cph-server/index.ts | 1580 ++++ .../huaweicloud/cph-share-app/README.md | 3 + .../huaweicloud/cph-share-app/index.ts | 467 + .../huaweicloud/cpts-project/README.md | 3 + .../huaweicloud/cpts-project/index.ts | 207 + .../providers/huaweicloud/cpts-task/README.md | 3 + .../providers/huaweicloud/cpts-task/index.ts | 407 + .../huaweicloud/cs-cluster-v1/README.md | 3 + .../huaweicloud/cs-cluster-v1/index.ts | 481 ++ .../huaweicloud/cs-cluster/README.md | 3 + .../providers/huaweicloud/cs-cluster/index.ts | 481 ++ .../cs-peering-connect-v1/README.md | 3 + .../cs-peering-connect-v1/index.ts | 495 ++ .../huaweicloud/cs-peering-connect/README.md | 3 + .../huaweicloud/cs-peering-connect/index.ts | 495 ++ .../huaweicloud/cs-route-v1/README.md | 3 + .../huaweicloud/cs-route-v1/index.ts | 219 + .../providers/huaweicloud/cs-route/README.md | 3 + .../providers/huaweicloud/cs-route/index.ts | 219 + .../csbs-backup-policy-v1/README.md | 3 + .../csbs-backup-policy-v1/index.ts | 979 +++ .../huaweicloud/csbs-backup-policy/README.md | 3 + .../huaweicloud/csbs-backup-policy/index.ts | 979 +++ .../huaweicloud/csbs-backup-v1/README.md | 3 + .../huaweicloud/csbs-backup-v1/index.ts | 687 ++ .../huaweicloud/csbs-backup/README.md | 3 + .../huaweicloud/csbs-backup/index.ts | 687 ++ .../README.md | 3 + .../index.ts | 391 + .../cse-microservice-engine/README.md | 3 + .../cse-microservice-engine/index.ts | 779 ++ .../cse-microservice-instance/README.md | 3 + .../cse-microservice-instance/index.ts | 744 ++ .../huaweicloud/cse-microservice/README.md | 3 + .../huaweicloud/cse-microservice/index.ts | 397 + .../huaweicloud/csms-event/README.md | 3 + .../providers/huaweicloud/csms-event/index.ts | 311 + .../csms-secret-version-state/README.md | 3 + .../csms-secret-version-state/index.ts | 224 + .../huaweicloud/csms-secret/README.md | 3 + .../huaweicloud/csms-secret/index.ts | 446 + .../css-cluster-az-migrate/README.md | 3 + .../css-cluster-az-migrate/index.ts | 474 + .../css-cluster-node-replace/README.md | 3 + .../css-cluster-node-replace/index.ts | 402 + .../huaweicloud/css-cluster-restart/README.md | 3 + .../huaweicloud/css-cluster-restart/index.ts | 371 + .../huaweicloud/css-cluster-v1/README.md | 3 + .../huaweicloud/css-cluster-v1/index.ts | 3520 ++++++++ .../huaweicloud/css-cluster/README.md | 3 + .../huaweicloud/css-cluster/index.ts | 3520 ++++++++ .../huaweicloud/css-configuration/README.md | 3 + .../huaweicloud/css-configuration/index.ts | 598 ++ .../huaweicloud/css-es-core-upgrade/README.md | 3 + .../huaweicloud/css-es-core-upgrade/index.ts | 646 ++ .../css-es-loadbalancer-config/README.md | 3 + .../css-es-loadbalancer-config/index.ts | 846 ++ .../huaweicloud/css-log-setting/README.md | 3 + .../huaweicloud/css-log-setting/index.ts | 287 + .../css-logstash-cluster-restart/README.md | 3 + .../css-logstash-cluster-restart/index.ts | 293 + .../css-logstash-cluster/README.md | 3 + .../huaweicloud/css-logstash-cluster/index.ts | 1255 +++ .../css-logstash-configuration/README.md | 3 + .../css-logstash-configuration/index.ts | 687 ++ .../css-logstash-connectivity/README.md | 3 + .../css-logstash-connectivity/index.ts | 582 ++ .../css-logstash-custom-certificate/README.md | 3 + .../css-logstash-custom-certificate/index.ts | 239 + .../css-logstash-custom-template/README.md | 3 + .../css-logstash-custom-template/index.ts | 257 + .../css-logstash-pipeline/README.md | 3 + .../css-logstash-pipeline/index.ts | 566 ++ .../css-manual-log-backup/README.md | 3 + .../css-manual-log-backup/index.ts | 332 + .../huaweicloud/css-scan-task/README.md | 3 + .../huaweicloud/css-scan-task/index.ts | 694 ++ .../huaweicloud/css-snapshot/README.md | 3 + .../huaweicloud/css-snapshot/index.ts | 394 + .../huaweicloud/css-thesaurus/README.md | 3 + .../huaweicloud/css-thesaurus/index.ts | 478 ++ .../huaweicloud/cts-data-tracker/README.md | 3 + .../huaweicloud/cts-data-tracker/index.ts | 651 ++ .../huaweicloud/cts-notification/README.md | 3 + .../huaweicloud/cts-notification/index.ts | 995 +++ .../huaweicloud/cts-tracker/README.md | 3 + .../huaweicloud/cts-tracker/index.ts | 662 ++ .../data-huaweicloud-account/README.md | 3 + .../data-huaweicloud-account/index.ts | 121 + .../README.md | 3 + .../index.ts | 520 ++ .../README.md | 3 + .../index.ts | 322 + .../data-huaweicloud-antiddos-v1/README.md | 3 + .../data-huaweicloud-antiddos-v1/index.ts | 298 + .../README.md | 3 + .../index.ts | 368 + .../data-huaweicloud-antiddos/README.md | 3 + .../data-huaweicloud-antiddos/index.ts | 298 + .../README.md | 3 + .../index.ts | 230 + .../README.md | 3 + .../index.ts | 363 + .../README.md | 3 + .../index.ts | 465 + .../README.md | 3 + .../index.ts | 1526 ++++ .../README.md | 3 + .../data-huaweicloud-aom-alarm-rules/index.ts | 1374 +++ .../README.md | 3 + .../index.ts | 508 ++ .../README.md | 3 + .../index.ts | 298 + .../data-huaweicloud-aom-dashboards/README.md | 3 + .../data-huaweicloud-aom-dashboards/index.ts | 352 + .../README.md | 3 + .../index.ts | 379 + .../README.md | 3 + .../index.ts | 445 + .../README.md | 3 + .../index.ts | 245 + .../README.md | 3 + .../index.ts | 425 + .../README.md | 3 + .../index.ts | 738 ++ .../README.md | 3 + .../index.ts | 402 + .../README.md | 3 + .../index.ts | 499 ++ .../README.md | 3 + .../index.ts | 429 + .../README.md | 3 + .../index.ts | 469 + .../README.md | 3 + .../index.ts | 469 + .../README.md | 3 + .../index.ts | 686 ++ .../README.md | 3 + .../index.ts | 752 ++ .../data-huaweicloud-apig-api/README.md | 3 + .../data-huaweicloud-apig-api/index.ts | 2032 +++++ .../data-huaweicloud-apig-appcodes/README.md | 3 + .../data-huaweicloud-apig-appcodes/index.ts | 294 + .../README.md | 3 + .../index.ts | 210 + .../README.md | 3 + .../index.ts | 349 + .../README.md | 3 + .../index.ts | 424 + .../data-huaweicloud-apig-channels/README.md | 3 + .../data-huaweicloud-apig-channels/index.ts | 624 ++ .../README.md | 3 + .../index.ts | 488 ++ .../README.md | 3 + .../index.ts | 369 + .../README.md | 3 + .../index.ts | 361 + .../README.md | 3 + .../index.ts | 293 + .../data-huaweicloud-apig-groups/README.md | 3 + .../data-huaweicloud-apig-groups/index.ts | 639 ++ .../README.md | 3 + .../index.ts | 302 + .../README.md | 3 + .../index.ts | 176 + .../data-huaweicloud-apig-instances/README.md | 3 + .../data-huaweicloud-apig-instances/index.ts | 387 + .../README.md | 3 + .../data-huaweicloud-apig-signatures/index.ts | 412 + .../README.md | 3 + .../index.ts | 589 ++ .../README.md | 3 + .../index.ts | 384 + .../README.md | 3 + .../index.ts | 849 ++ .../README.md | 3 + .../data-huaweicloud-as-group-quotas/index.ts | 350 + .../data-huaweicloud-as-groups/README.md | 3 + .../data-huaweicloud-as-groups/index.ts | 751 ++ .../README.md | 3 + .../index.ts | 374 + .../data-huaweicloud-as-instances/README.md | 3 + .../data-huaweicloud-as-instances/index.ts | 387 + .../README.md | 3 + .../index.ts | 369 + .../README.md | 3 + .../index.ts | 294 + .../README.md | 3 + .../index.ts | 521 ++ .../data-huaweicloud-as-policies/README.md | 3 + .../data-huaweicloud-as-policies/index.ts | 561 ++ .../README.md | 3 + .../index.ts | 623 ++ .../data-huaweicloud-as-quotas/README.md | 3 + .../data-huaweicloud-as-quotas/index.ts | 323 + .../README.md | 3 + .../index.ts | 177 + .../data-huaweicloud-bms-flavors/README.md | 3 + .../data-huaweicloud-bms-flavors/index.ts | 357 + .../data-huaweicloud-bms-instances/README.md | 3 + .../data-huaweicloud-bms-instances/index.ts | 693 ++ .../README.md | 3 + .../index.ts | 321 + .../README.md | 3 + .../index.ts | 371 + .../README.md | 3 + .../index.ts | 301 + .../data-huaweicloud-cbh-flavors/README.md | 3 + .../data-huaweicloud-cbh-flavors/index.ts | 484 ++ .../data-huaweicloud-cbh-instances/README.md | 3 + .../data-huaweicloud-cbh-instances/index.ts | 460 + .../data-huaweicloud-cbr-backup/README.md | 3 + .../data-huaweicloud-cbr-backup/index.ts | 1117 +++ .../data-huaweicloud-cbr-policies/README.md | 3 + .../data-huaweicloud-cbr-policies/index.ts | 700 ++ .../data-huaweicloud-cbr-vaults/README.md | 3 + .../data-huaweicloud-cbr-vaults/index.ts | 670 ++ .../README.md | 3 + .../index.ts | 467 + .../README.md | 3 + .../index.ts | 568 ++ .../README.md | 3 + .../index.ts | 620 ++ .../README.md | 3 + .../index.ts | 267 + .../README.md | 3 + .../index.ts | 605 ++ .../README.md | 3 + .../index.ts | 282 + .../README.md | 3 + .../index.ts | 890 ++ .../README.md | 3 + .../index.ts | 272 + .../README.md | 3 + .../index.ts | 416 + .../README.md | 3 + .../index.ts | 377 + .../README.md | 3 + .../index.ts | 152 + .../data-huaweicloud-cc-connections/README.md | 3 + .../data-huaweicloud-cc-connections/index.ts | 498 ++ .../README.md | 3 + .../index.ts | 372 + .../README.md | 3 + .../index.ts | 523 ++ .../README.md | 3 + .../index.ts | 392 + .../README.md | 3 + .../index.ts | 757 ++ .../README.md | 3 + .../index.ts | 478 ++ .../README.md | 3 + .../index.ts | 532 ++ .../data-huaweicloud-cc-permissions/README.md | 3 + .../data-huaweicloud-cc-permissions/index.ts | 432 + .../README.md | 3 + .../index.ts | 654 ++ .../README.md | 3 + .../index.ts | 320 + .../README.md | 3 + .../index.ts | 482 ++ .../README.md | 3 + .../index.ts | 275 + .../data-huaweicloud-cce-cluster-v3/README.md | 3 + .../data-huaweicloud-cce-cluster-v3/index.ts | 680 ++ .../data-huaweicloud-cce-cluster/README.md | 3 + .../data-huaweicloud-cce-cluster/index.ts | 680 ++ .../data-huaweicloud-cce-clusters/README.md | 3 + .../data-huaweicloud-cce-clusters/index.ts | 837 ++ .../data-huaweicloud-cce-node-pool/README.md | 3 + .../data-huaweicloud-cce-node-pool/index.ts | 611 ++ .../data-huaweicloud-cce-node-v3/README.md | 3 + .../data-huaweicloud-cce-node-v3/index.ts | 579 ++ .../data-huaweicloud-cce-node/README.md | 3 + .../data-huaweicloud-cce-node/index.ts | 579 ++ .../data-huaweicloud-cce-nodes/README.md | 3 + .../data-huaweicloud-cce-nodes/index.ts | 703 ++ .../data-huaweicloud-cci-namespaces/README.md | 3 + .../data-huaweicloud-cci-namespaces/index.ts | 541 ++ .../README.md | 3 + .../index.ts | 203 + .../README.md | 3 + .../index.ts | 412 + .../README.md | 3 + .../index.ts | 183 + .../README.md | 3 + .../data-huaweicloud-ccm-private-cas/index.ts | 659 ++ .../README.md | 3 + .../index.ts | 300 + .../README.md | 3 + .../index.ts | 503 ++ .../data-huaweicloud-cdm-clusters/README.md | 3 + .../data-huaweicloud-cdm-clusters/index.ts | 486 ++ .../data-huaweicloud-cdm-flavors-v1/README.md | 3 + .../data-huaweicloud-cdm-flavors-v1/index.ts | 245 + .../data-huaweicloud-cdm-flavors/README.md | 3 + .../data-huaweicloud-cdm-flavors/index.ts | 245 + .../README.md | 3 + .../index.ts | 490 ++ .../data-huaweicloud-cdn-analytics/README.md | 3 + .../data-huaweicloud-cdn-analytics/index.ts | 376 + .../README.md | 3 + .../index.ts | 218 + .../README.md | 3 + .../index.ts | 477 ++ .../README.md | 3 + .../index.ts | 417 + .../README.md | 3 + .../index.ts | 293 + .../README.md | 3 + .../index.ts | 436 + .../data-huaweicloud-cdn-domains/README.md | 3 + .../data-huaweicloud-cdn-domains/index.ts | 558 ++ .../data-huaweicloud-cdn-logs/README.md | 3 + .../data-huaweicloud-cdn-logs/index.ts | 339 + .../README.md | 3 + .../index.ts | 321 + .../README.md | 3 + .../index.ts | 367 + .../data-huaweicloud-ces-alarmrules/README.md | 3 + .../data-huaweicloud-ces-alarmrules/index.ts | 857 ++ .../README.md | 3 + .../index.ts | 658 ++ .../data-huaweicloud-ces-dashboards/README.md | 3 + .../data-huaweicloud-ces-dashboards/index.ts | 377 + .../README.md | 3 + .../index.ts | 678 ++ .../data-huaweicloud-ces-events/README.md | 3 + .../data-huaweicloud-ces-events/index.ts | 367 + .../data-huaweicloud-ces-metrics/README.md | 3 + .../data-huaweicloud-ces-metrics/index.ts | 473 + .../README.md | 3 + .../index.ts | 769 ++ .../README.md | 3 + .../index.ts | 242 + .../README.md | 3 + .../index.ts | 457 + .../README.md | 3 + .../index.ts | 367 + .../README.md | 3 + .../index.ts | 843 ++ .../README.md | 3 + .../index.ts | 419 + .../README.md | 3 + .../index.ts | 494 ++ .../README.md | 3 + .../data-huaweicloud-cfw-attack-logs/index.ts | 1049 +++ .../README.md | 3 + .../index.ts | 551 ++ .../README.md | 3 + .../index.ts | 447 + .../README.md | 3 + .../index.ts | 334 + .../README.md | 3 + .../index.ts | 698 ++ .../data-huaweicloud-cfw-firewalls/README.md | 3 + .../data-huaweicloud-cfw-firewalls/index.ts | 633 ++ .../data-huaweicloud-cfw-flow-logs/README.md | 3 + .../data-huaweicloud-cfw-flow-logs/index.ts | 818 ++ .../README.md | 3 + .../index.ts | 1296 +++ .../README.md | 3 + .../index.ts | 484 ++ .../README.md | 3 + .../index.ts | 399 + .../README.md | 3 + .../index.ts | 325 + .../README.md | 3 + .../index.ts | 363 + .../README.md | 3 + .../index.ts | 433 + .../README.md | 3 + .../index.ts | 149 + .../README.md | 3 + .../data-huaweicloud-compute-flavors/index.ts | 423 + .../README.md | 3 + .../index.ts | 184 + .../README.md | 3 + .../index.ts | 665 ++ .../README.md | 3 + .../index.ts | 902 ++ .../README.md | 3 + .../index.ts | 268 + .../README.md | 3 + .../index.ts | 458 + .../README.md | 3 + .../index.ts | 487 ++ .../README.md | 3 + .../index.ts | 430 + .../README.md | 3 + .../index.ts | 310 + .../data-huaweicloud-cph-phones/README.md | 3 + .../data-huaweicloud-cph-phones/index.ts | 503 ++ .../README.md | 3 + .../index.ts | 257 + .../README.md | 3 + .../index.ts | 446 + .../data-huaweicloud-cph-servers/README.md | 3 + .../data-huaweicloud-cph-servers/index.ts | 689 ++ .../README.md | 3 + .../index.ts | 443 + .../README.md | 3 + .../index.ts | 443 + .../data-huaweicloud-csbs-backup-v1/README.md | 3 + .../data-huaweicloud-csbs-backup-v1/index.ts | 645 ++ .../data-huaweicloud-csbs-backup/README.md | 3 + .../data-huaweicloud-csbs-backup/index.ts | 645 ++ .../README.md | 3 + .../index.ts | 348 + .../README.md | 3 + .../index.ts | 470 + .../data-huaweicloud-csms-events/README.md | 3 + .../data-huaweicloud-csms-events/index.ts | 425 + .../README.md | 3 + .../index.ts | 217 + .../README.md | 3 + .../index.ts | 279 + .../data-huaweicloud-csms-secrets/README.md | 3 + .../data-huaweicloud-csms-secrets/index.ts | 440 + .../README.md | 3 + .../index.ts | 179 + .../data-huaweicloud-css-clusters/README.md | 3 + .../data-huaweicloud-css-clusters/index.ts | 983 +++ .../README.md | 3 + .../index.ts | 389 + .../data-huaweicloud-css-flavors/README.md | 3 + .../data-huaweicloud-css-flavors/index.ts | 405 + .../README.md | 3 + .../index.ts | 379 + .../README.md | 3 + .../index.ts | 364 + .../README.md | 3 + .../index.ts | 435 + .../README.md | 3 + .../index.ts | 374 + .../README.md | 3 + .../index.ts | 305 + .../README.md | 3 + .../index.ts | 398 + .../data-huaweicloud-css-scan-tasks/README.md | 3 + .../data-huaweicloud-css-scan-tasks/index.ts | 471 + .../data-huaweicloud-css-snapshots/README.md | 3 + .../data-huaweicloud-css-snapshots/index.ts | 440 + .../README.md | 3 + .../index.ts | 396 + .../README.md | 3 + .../index.ts | 692 ++ .../data-huaweicloud-cts-traces/README.md | 3 + .../data-huaweicloud-cts-traces/index.ts | 845 ++ .../data-huaweicloud-cts-tracker/README.md | 3 + .../data-huaweicloud-cts-tracker/index.ts | 281 + .../data-huaweicloud-cts-trackers/README.md | 3 + .../data-huaweicloud-cts-trackers/index.ts | 821 ++ .../README.md | 3 + .../index.ts | 362 + .../README.md | 3 + .../index.ts | 1835 ++++ .../README.md | 3 + .../index.ts | 830 ++ .../README.md | 3 + .../index.ts | 1352 +++ .../README.md | 3 + .../index.ts | 359 + .../README.md | 3 + .../index.ts | 427 + .../README.md | 3 + .../index.ts | 641 ++ .../README.md | 3 + .../index.ts | 344 + .../README.md | 3 + .../index.ts | 385 + .../README.md | 3 + .../index.ts | 444 + .../README.md | 3 + .../index.ts | 372 + .../README.md | 3 + .../index.ts | 417 + .../README.md | 3 + .../index.ts | 284 + .../README.md | 3 + .../index.ts | 344 + .../README.md | 3 + .../index.ts | 304 + .../README.md | 3 + .../index.ts | 319 + .../README.md | 3 + .../index.ts | 247 + .../data-huaweicloud-dbss-databases/README.md | 3 + .../data-huaweicloud-dbss-databases/index.ts | 344 + .../data-huaweicloud-dbss-flavors/README.md | 3 + .../data-huaweicloud-dbss-flavors/index.ts | 430 + .../data-huaweicloud-dbss-instances/README.md | 3 + .../data-huaweicloud-dbss-instances/index.ts | 367 + .../README.md | 3 + .../index.ts | 469 + .../README.md | 3 + .../index.ts | 299 + .../data-huaweicloud-dc-connections/README.md | 3 + .../data-huaweicloud-dc-connections/index.ts | 588 ++ .../data-huaweicloud-dc-quotas/README.md | 3 + .../data-huaweicloud-dc-quotas/index.ts | 267 + .../README.md | 3 + .../index.ts | 385 + .../README.md | 3 + .../index.ts | 691 ++ .../data-huaweicloud-dcs-accounts/README.md | 3 + .../data-huaweicloud-dcs-accounts/index.ts | 429 + .../data-huaweicloud-dcs-az-v1/README.md | 3 + .../data-huaweicloud-dcs-az-v1/index.ts | 228 + .../data-huaweicloud-dcs-az/README.md | 3 + .../data-huaweicloud-dcs-az/index.ts | 228 + .../data-huaweicloud-dcs-backups/README.md | 3 + .../data-huaweicloud-dcs-backups/index.ts | 552 ++ .../README.md | 3 + .../index.ts | 369 + .../README.md | 3 + .../index.ts | 439 + .../data-huaweicloud-dcs-flavors/README.md | 3 + .../data-huaweicloud-dcs-flavors/index.ts | 433 + .../README.md | 3 + .../index.ts | 369 + .../data-huaweicloud-dcs-instances/README.md | 3 + .../data-huaweicloud-dcs-instances/index.ts | 476 + .../README.md | 3 + .../index.ts | 256 + .../README.md | 3 + .../index.ts | 256 + .../data-huaweicloud-dcs-product-v1/README.md | 3 + .../data-huaweicloud-dcs-product-v1/index.ts | 192 + .../data-huaweicloud-dcs-product/README.md | 3 + .../data-huaweicloud-dcs-product/index.ts | 192 + .../README.md | 3 + .../index.ts | 411 + .../data-huaweicloud-dcs-templates/README.md | 3 + .../data-huaweicloud-dcs-templates/index.ts | 502 ++ .../data-huaweicloud-ddm-accounts/README.md | 3 + .../data-huaweicloud-ddm-accounts/index.ts | 413 + .../data-huaweicloud-ddm-engines/README.md | 3 + .../data-huaweicloud-ddm-engines/index.ts | 260 + .../data-huaweicloud-ddm-flavors/README.md | 3 + .../data-huaweicloud-ddm-flavors/index.ts | 392 + .../README.md | 3 + .../index.ts | 198 + .../README.md | 3 + .../index.ts | 386 + .../README.md | 3 + .../index.ts | 267 + .../data-huaweicloud-ddm-instances/README.md | 3 + .../data-huaweicloud-ddm-instances/index.ts | 395 + .../README.md | 3 + .../index.ts | 328 + .../README.md | 3 + .../index.ts | 319 + .../README.md | 3 + .../index.ts | 324 + .../data-huaweicloud-ddm-schemas/README.md | 3 + .../data-huaweicloud-ddm-schemas/index.ts | 448 + .../README.md | 3 + .../index.ts | 205 + .../data-huaweicloud-dds-audit-logs/README.md | 3 + .../data-huaweicloud-dds-audit-logs/index.ts | 363 + .../README.md | 3 + .../index.ts | 301 + .../data-huaweicloud-dds-backups/README.md | 3 + .../data-huaweicloud-dds-backups/index.ts | 636 ++ .../README.md | 3 + .../index.ts | 731 ++ .../README.md | 3 + .../index.ts | 731 ++ .../README.md | 3 + .../index.ts | 178 + .../data-huaweicloud-dds-databases/README.md | 3 + .../data-huaweicloud-dds-databases/index.ts | 269 + .../README.md | 3 + .../index.ts | 461 + .../data-huaweicloud-dds-error-logs/README.md | 3 + .../data-huaweicloud-dds-error-logs/index.ts | 418 + .../data-huaweicloud-dds-flavors-v3/README.md | 3 + .../data-huaweicloud-dds-flavors-v3/index.ts | 393 + .../data-huaweicloud-dds-flavors/README.md | 3 + .../data-huaweicloud-dds-flavors/index.ts | 393 + .../data-huaweicloud-dds-instances/README.md | 3 + .../data-huaweicloud-dds-instances/index.ts | 911 ++ .../README.md | 3 + .../index.ts | 381 + .../README.md | 3 + .../index.ts | 174 + .../README.md | 3 + .../index.ts | 357 + .../README.md | 3 + .../index.ts | 345 + .../README.md | 3 + .../index.ts | 274 + .../README.md | 3 + .../index.ts | 269 + .../data-huaweicloud-dds-quotas/README.md | 3 + .../data-huaweicloud-dds-quotas/index.ts | 242 + .../README.md | 3 + .../index.ts | 353 + .../README.md | 3 + .../index.ts | 232 + .../README.md | 3 + .../index.ts | 205 + .../README.md | 3 + .../index.ts | 286 + .../README.md | 3 + .../index.ts | 417 + .../README.md | 3 + .../index.ts | 461 + .../data-huaweicloud-dds-slow-logs/README.md | 3 + .../data-huaweicloud-dds-slow-logs/index.ts | 568 ++ .../README.md | 3 + .../index.ts | 259 + .../README.md | 3 + .../index.ts | 259 + .../README.md | 3 + .../index.ts | 303 + .../README.md | 3 + .../index.ts | 690 ++ .../README.md | 3 + .../index.ts | 392 + .../README.md | 3 + .../index.ts | 347 + .../README.md | 3 + .../index.ts | 574 ++ .../README.md | 3 + .../index.ts | 594 ++ .../data-huaweicloud-dli-quotas/README.md | 3 + .../data-huaweicloud-dli-quotas/index.ts | 277 + .../README.md | 3 + .../index.ts | 757 ++ .../data-huaweicloud-dli-sql-jobs/README.md | 3 + .../data-huaweicloud-dli-sql-jobs/index.ts | 458 + .../README.md | 3 + .../index.ts | 372 + .../data-huaweicloud-dms-az-v1/README.md | 3 + .../data-huaweicloud-dms-az-v1/index.ts | 233 + .../data-huaweicloud-dms-az/README.md | 3 + .../data-huaweicloud-dms-az/index.ts | 233 + .../README.md | 3 + .../index.ts | 349 + .../README.md | 3 + .../index.ts | 712 ++ .../README.md | 3 + .../index.ts | 713 ++ .../README.md | 3 + .../index.ts | 812 ++ .../README.md | 3 + .../index.ts | 675 ++ .../README.md | 3 + .../index.ts | 284 + .../README.md | 3 + .../index.ts | 506 ++ .../README.md | 3 + .../index.ts | 397 + .../README.md | 3 + .../index.ts | 301 + .../README.md | 3 + .../index.ts | 291 + .../README.md | 3 + .../index.ts | 430 + .../README.md | 3 + .../index.ts | 339 + .../README.md | 3 + .../data-huaweicloud-dms-kafka-users/index.ts | 334 + .../README.md | 3 + .../index.ts | 601 ++ .../README.md | 3 + .../index.ts | 256 + .../README.md | 3 + .../index.ts | 256 + .../data-huaweicloud-dms-product-v1/README.md | 3 + .../data-huaweicloud-dms-product-v1/index.ts | 451 + .../data-huaweicloud-dms-product/README.md | 3 + .../data-huaweicloud-dms-product/index.ts | 451 + .../README.md | 3 + .../index.ts | 349 + .../README.md | 3 + .../index.ts | 300 + .../README.md | 3 + .../index.ts | 698 ++ .../README.md | 3 + .../index.ts | 812 ++ .../README.md | 3 + .../index.ts | 631 ++ .../README.md | 3 + .../index.ts | 387 + .../README.md | 3 + .../index.ts | 320 + .../README.md | 3 + .../index.ts | 350 + .../README.md | 3 + .../index.ts | 255 + .../README.md | 3 + .../index.ts | 174 + .../README.md | 3 + .../index.ts | 296 + .../README.md | 3 + .../index.ts | 387 + .../README.md | 3 + .../index.ts | 427 + .../README.md | 3 + .../index.ts | 713 ++ .../README.md | 3 + .../index.ts | 824 ++ .../README.md | 3 + .../index.ts | 597 ++ .../README.md | 3 + .../index.ts | 376 + .../README.md | 3 + .../index.ts | 537 ++ .../README.md | 3 + .../index.ts | 364 + .../README.md | 3 + .../index.ts | 296 + .../README.md | 3 + .../index.ts | 205 + .../README.md | 3 + .../index.ts | 468 + .../README.md | 3 + .../index.ts | 582 ++ .../README.md | 3 + .../index.ts | 347 + .../README.md | 3 + .../index.ts | 443 + .../README.md | 3 + .../data-huaweicloud-dns-line-groups/index.ts | 317 + .../README.md | 3 + .../data-huaweicloud-dns-nameservers/index.ts | 383 + .../data-huaweicloud-dns-quotas/README.md | 3 + .../data-huaweicloud-dns-quotas/index.ts | 299 + .../data-huaweicloud-dns-recordsets/README.md | 3 + .../data-huaweicloud-dns-recordsets/index.ts | 517 ++ .../data-huaweicloud-dns-zones/README.md | 3 + .../data-huaweicloud-dns-zones/index.ts | 539 ++ .../README.md | 3 + .../index.ts | 277 + .../data-huaweicloud-drs-node-types/README.md | 3 + .../data-huaweicloud-drs-node-types/index.ts | 252 + .../README.md | 3 + .../index.ts | 267 + .../README.md | 3 + .../index.ts | 242 + .../README.md | 3 + .../data-huaweicloud-dws-cluster-cns/index.ts | 274 + .../README.md | 3 + .../index.ts | 274 + .../README.md | 3 + .../index.ts | 379 + .../README.md | 3 + .../index.ts | 373 + .../README.md | 3 + .../index.ts | 264 + .../README.md | 3 + .../index.ts | 375 + .../data-huaweicloud-dws-clusters/README.md | 3 + .../data-huaweicloud-dws-clusters/index.ts | 662 ++ .../README.md | 3 + .../index.ts | 511 ++ .../README.md | 3 + .../index.ts | 470 + .../data-huaweicloud-dws-flavors/README.md | 3 + .../data-huaweicloud-dws-flavors/index.ts | 471 + .../README.md | 3 + .../index.ts | 353 + .../README.md | 3 + .../index.ts | 269 + .../README.md | 3 + .../index.ts | 466 + .../README.md | 3 + .../index.ts | 181 + .../data-huaweicloud-dws-quotas/README.md | 3 + .../data-huaweicloud-dws-quotas/index.ts | 242 + .../README.md | 3 + .../index.ts | 299 + .../data-huaweicloud-dws-snapshots/README.md | 3 + .../data-huaweicloud-dws-snapshots/index.ts | 267 + .../data-huaweicloud-dws-statistics/README.md | 3 + .../data-huaweicloud-dws-statistics/index.ts | 237 + .../README.md | 3 + .../index.ts | 304 + .../README.md | 3 + .../index.ts | 372 + .../README.md | 3 + .../index.ts | 418 + .../README.md | 3 + .../index.ts | 352 + .../README.md | 3 + .../index.ts | 357 + .../README.md | 3 + .../index.ts | 352 + .../README.md | 3 + .../index.ts | 458 + .../README.md | 3 + .../index.ts | 997 +++ .../README.md | 3 + .../data-huaweicloud-elb-certificate/index.ts | 189 + .../data-huaweicloud-elb-flavors/README.md | 3 + .../data-huaweicloud-elb-flavors/index.ts | 428 + .../data-huaweicloud-elb-ipgroups/README.md | 3 + .../data-huaweicloud-elb-ipgroups/index.ts | 529 ++ .../data-huaweicloud-elb-l7policies/README.md | 3 + .../data-huaweicloud-elb-l7policies/index.ts | 972 +++ .../data-huaweicloud-elb-l7rules/README.md | 3 + .../data-huaweicloud-elb-l7rules/index.ts | 501 ++ .../data-huaweicloud-elb-listeners/README.md | 3 + .../data-huaweicloud-elb-listeners/index.ts | 526 ++ .../README.md | 3 + .../index.ts | 610 ++ .../data-huaweicloud-elb-logtanks/README.md | 3 + .../data-huaweicloud-elb-logtanks/index.ts | 380 + .../data-huaweicloud-elb-members/README.md | 3 + .../data-huaweicloud-elb-members/index.ts | 504 ++ .../data-huaweicloud-elb-monitors/README.md | 3 + .../data-huaweicloud-elb-monitors/index.ts | 644 ++ .../data-huaweicloud-elb-pools/README.md | 3 + .../data-huaweicloud-elb-pools/index.ts | 964 +++ .../README.md | 3 + .../index.ts | 509 ++ .../README.md | 3 + .../index.ts | 187 + .../README.md | 3 + .../index.ts | 339 + .../README.md | 3 + .../data-huaweicloud-er-associations/index.ts | 399 + .../data-huaweicloud-er-attachments/README.md | 3 + .../data-huaweicloud-er-attachments/index.ts | 485 ++ .../README.md | 3 + .../index.ts | 149 + .../README.md | 3 + .../index.ts | 420 + .../data-huaweicloud-er-flow-logs/README.md | 3 + .../data-huaweicloud-er-flow-logs/index.ts | 549 ++ .../data-huaweicloud-er-instances/README.md | 3 + .../data-huaweicloud-er-instances/index.ts | 478 ++ .../README.md | 3 + .../data-huaweicloud-er-propagations/index.ts | 404 + .../data-huaweicloud-er-quotas/README.md | 3 + .../data-huaweicloud-er-quotas/index.ts | 332 + .../README.md | 3 + .../data-huaweicloud-er-route-tables/index.ts | 752 ++ .../README.md | 3 + .../index.ts | 232 + .../data-huaweicloud-evs-snapshots/README.md | 3 + .../data-huaweicloud-evs-snapshots/index.ts | 523 ++ .../README.md | 3 + .../index.ts | 237 + .../README.md | 3 + .../index.ts | 323 + .../data-huaweicloud-evs-volumes/README.md | 3 + .../data-huaweicloud-evs-volumes/index.ts | 659 ++ .../README.md | 3 + .../index.ts | 306 + .../README.md | 3 + .../index.ts | 357 + .../README.md | 3 + .../index.ts | 430 + .../README.md | 3 + .../index.ts | 387 + .../README.md | 3 + .../index.ts | 264 + .../README.md | 3 + .../index.ts | 427 + .../data-huaweicloud-fgs-functions/README.md | 3 + .../data-huaweicloud-fgs-functions/index.ts | 485 ++ .../data-huaweicloud-fgs-quotas/README.md | 3 + .../data-huaweicloud-fgs-quotas/index.ts | 242 + .../README.md | 3 + .../data-huaweicloud-ga-accelerators/index.ts | 449 + .../README.md | 3 + .../index.ts | 519 ++ .../README.md | 3 + .../index.ts | 237 + .../README.md | 3 + .../index.ts | 357 + .../data-huaweicloud-ga-endpoints/README.md | 3 + .../data-huaweicloud-ga-endpoints/index.ts | 449 + .../README.md | 3 + .../index.ts | 397 + .../data-huaweicloud-ga-listeners/README.md | 3 + .../data-huaweicloud-ga-listeners/index.ts | 479 ++ .../README.md | 3 + .../index.ts | 202 + .../README.md | 3 + .../index.ts | 330 + .../README.md | 3 + .../index.ts | 572 ++ .../README.md | 3 + .../index.ts | 673 ++ .../README.md | 3 + .../index.ts | 945 ++ .../README.md | 3 + .../index.ts | 363 + .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 603 ++ .../README.md | 3 + .../index.ts | 187 + .../README.md | 3 + .../index.ts | 262 + .../README.md | 3 + .../index.ts | 178 + .../README.md | 3 + .../index.ts | 415 + .../README.md | 3 + .../index.ts | 202 + .../README.md | 3 + .../index.ts | 257 + .../README.md | 3 + .../index.ts | 232 + .../README.md | 3 + .../index.ts | 269 + .../README.md | 3 + .../index.ts | 380 + .../README.md | 3 + .../index.ts | 340 + .../README.md | 3 + .../index.ts | 339 + .../README.md | 3 + .../index.ts | 571 ++ .../README.md | 3 + .../index.ts | 707 ++ .../README.md | 3 + .../index.ts | 427 + .../README.md | 3 + .../index.ts | 343 + .../README.md | 3 + .../index.ts | 647 ++ .../README.md | 3 + .../index.ts | 361 + .../README.md | 3 + .../index.ts | 259 + .../README.md | 3 + .../index.ts | 274 + .../README.md | 3 + .../index.ts | 284 + .../README.md | 3 + .../index.ts | 307 + .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 454 + .../README.md | 3 + .../index.ts | 359 + .../README.md | 3 + .../index.ts | 450 + .../README.md | 3 + .../index.ts | 390 + .../README.md | 3 + .../index.ts | 748 ++ .../README.md | 3 + .../index.ts | 849 ++ .../README.md | 3 + .../index.ts | 251 + .../README.md | 3 + .../index.ts | 572 ++ .../README.md | 3 + .../index.ts | 316 + .../README.md | 3 + .../index.ts | 473 + .../data-huaweicloud-global-eips/README.md | 3 + .../data-huaweicloud-global-eips/index.ts | 555 ++ .../README.md | 3 + .../index.ts | 497 ++ .../README.md | 3 + .../data-huaweicloud-hss-host-groups/index.ts | 418 + .../data-huaweicloud-hss-hosts/README.md | 3 + .../data-huaweicloud-hss-hosts/index.ts | 694 ++ .../data-huaweicloud-hss-quotas/README.md | 3 + .../data-huaweicloud-hss-quotas/index.ts | 505 ++ .../README.md | 3 + .../index.ts | 478 ++ .../README.md | 3 + .../index.ts | 527 ++ .../README.md | 3 + .../index.ts | 288 + .../README.md | 3 + .../index.ts | 266 + .../data-huaweicloud-identity-group/README.md | 3 + .../data-huaweicloud-identity-group/index.ts | 288 + .../README.md | 3 + .../index.ts | 306 + .../README.md | 3 + .../index.ts | 235 + .../README.md | 3 + .../index.ts | 393 + .../README.md | 3 + .../index.ts | 192 + .../data-huaweicloud-identity-role/README.md | 3 + .../data-huaweicloud-identity-role/index.ts | 192 + .../data-huaweicloud-identity-users/README.md | 3 + .../data-huaweicloud-identity-users/index.ts | 283 + .../README.md | 3 + .../index.ts | 232 + .../README.md | 3 + .../index.ts | 302 + .../README.md | 3 + .../index.ts | 131 + .../README.md | 3 + .../index.ts | 427 + .../data-huaweicloud-iec-bandwidths/README.md | 3 + .../data-huaweicloud-iec-bandwidths/index.ts | 257 + .../data-huaweicloud-iec-eips/README.md | 3 + .../data-huaweicloud-iec-eips/index.ts | 300 + .../data-huaweicloud-iec-flavors/README.md | 3 + .../data-huaweicloud-iec-flavors/index.ts | 408 + .../data-huaweicloud-iec-images/README.md | 3 + .../data-huaweicloud-iec-images/index.ts | 296 + .../data-huaweicloud-iec-keypair/README.md | 3 + .../data-huaweicloud-iec-keypair/index.ts | 151 + .../README.md | 3 + .../data-huaweicloud-iec-network-acl/index.ts | 250 + .../data-huaweicloud-iec-port/README.md | 3 + .../data-huaweicloud-iec-port/index.ts | 243 + .../README.md | 3 + .../index.ts | 272 + .../data-huaweicloud-iec-server/README.md | 3 + .../data-huaweicloud-iec-server/index.ts | 535 ++ .../data-huaweicloud-iec-sites/README.md | 3 + .../data-huaweicloud-iec-sites/index.ts | 402 + .../README.md | 3 + .../data-huaweicloud-iec-vpc-subnets/index.ts | 313 + .../data-huaweicloud-iec-vpc/README.md | 3 + .../data-huaweicloud-iec-vpc/index.ts | 187 + .../README.md | 3 + .../data-huaweicloud-images-image-v2/index.ts | 741 ++ .../data-huaweicloud-images-image/README.md | 3 + .../data-huaweicloud-images-image/index.ts | 741 ++ .../data-huaweicloud-images-images/README.md | 3 + .../data-huaweicloud-images-images/index.ts | 767 ++ .../README.md | 3 + .../data-huaweicloud-ims-os-versions/index.ts | 354 + .../data-huaweicloud-ims-quotas/README.md | 3 + .../data-huaweicloud-ims-quotas/index.ts | 323 + .../data-huaweicloud-iotda-amqps/README.md | 3 + .../data-huaweicloud-iotda-amqps/index.ts | 296 + .../README.md | 3 + .../index.ts | 549 ++ .../README.md | 3 + .../index.ts | 273 + .../README.md | 3 + .../index.ts | 334 + .../README.md | 3 + .../index.ts | 466 + .../README.md | 3 + .../index.ts | 270 + .../README.md | 3 + .../index.ts | 372 + .../README.md | 3 + .../index.ts | 385 + .../README.md | 3 + .../index.ts | 1365 +++ .../README.md | 3 + .../index.ts | 548 ++ .../README.md | 3 + .../index.ts | 377 + .../data-huaweicloud-iotda-devices/README.md | 3 + .../data-huaweicloud-iotda-devices/index.ts | 548 ++ .../data-huaweicloud-iotda-products/README.md | 3 + .../data-huaweicloud-iotda-products/index.ts | 415 + .../data-huaweicloud-iotda-spaces/README.md | 3 + .../data-huaweicloud-iotda-spaces/index.ts | 324 + .../README.md | 3 + .../index.ts | 384 + .../README.md | 3 + .../data-huaweicloud-kms-data-key-v1/index.ts | 232 + .../data-huaweicloud-kms-data-key/README.md | 3 + .../data-huaweicloud-kms-data-key/index.ts | 232 + .../data-huaweicloud-kms-grants/README.md | 3 + .../data-huaweicloud-kms-grants/index.ts | 289 + .../data-huaweicloud-kms-key-v1/README.md | 3 + .../data-huaweicloud-kms-key-v1/index.ts | 376 + .../data-huaweicloud-kms-key/README.md | 3 + .../data-huaweicloud-kms-key/index.ts | 376 + .../data-huaweicloud-kms-keys/README.md | 3 + .../data-huaweicloud-kms-keys/index.ts | 387 + .../README.md | 3 + .../index.ts | 515 ++ .../README.md | 3 + .../index.ts | 262 + .../data-huaweicloud-kps-keypairs/README.md | 3 + .../data-huaweicloud-kps-keypairs/index.ts | 357 + .../README.md | 3 + .../index.ts | 252 + .../data-huaweicloud-lb-certificate/README.md | 3 + .../data-huaweicloud-lb-certificate/index.ts | 212 + .../data-huaweicloud-lb-listeners/README.md | 3 + .../data-huaweicloud-lb-listeners/index.ts | 441 + .../README.md | 3 + .../data-huaweicloud-lb-loadbalancer/index.ts | 328 + .../data-huaweicloud-lb-pools/README.md | 3 + .../data-huaweicloud-lb-pools/index.ts | 789 ++ .../data-huaweicloud-live-domains/README.md | 3 + .../data-huaweicloud-live-domains/index.ts | 342 + .../README.md | 3 + .../index.ts | 416 + .../README.md | 3 + .../index.ts | 844 ++ .../data-huaweicloud-lts-groups/README.md | 3 + .../data-huaweicloud-lts-groups/index.ts | 253 + .../README.md | 3 + .../data-huaweicloud-lts-host-groups/index.ts | 378 + .../README.md | 3 + .../index.ts | 365 + .../README.md | 3 + .../index.ts | 355 + .../data-huaweicloud-lts-streams/README.md | 3 + .../data-huaweicloud-lts-streams/index.ts | 303 + .../README.md | 3 + .../index.ts | 330 + .../data-huaweicloud-lts-transfers/README.md | 3 + .../data-huaweicloud-lts-transfers/index.ts | 731 ++ .../README.md | 3 + .../index.ts | 1024 +++ .../README.md | 3 + .../index.ts | 149 + .../README.md | 3 + .../index.ts | 351 + .../README.md | 3 + .../index.ts | 589 ++ .../README.md | 3 + .../index.ts | 557 ++ .../README.md | 3 + .../index.ts | 641 ++ .../README.md | 3 + .../index.ts | 507 ++ .../README.md | 3 + .../index.ts | 390 + .../README.md | 3 + .../index.ts | 585 ++ .../README.md | 3 + .../index.ts | 415 + .../README.md | 3 + .../index.ts | 799 ++ .../README.md | 3 + .../index.ts | 350 + .../data-huaweicloud-nat-dnat-rules/README.md | 3 + .../data-huaweicloud-nat-dnat-rules/index.ts | 662 ++ .../data-huaweicloud-nat-gateway/README.md | 3 + .../data-huaweicloud-nat-gateway/index.ts | 414 + .../data-huaweicloud-nat-gateways/README.md | 3 + .../data-huaweicloud-nat-gateways/index.ts | 477 ++ .../README.md | 3 + .../index.ts | 592 ++ .../README.md | 3 + .../index.ts | 518 ++ .../README.md | 3 + .../index.ts | 487 ++ .../README.md | 3 + .../index.ts | 478 ++ .../data-huaweicloud-nat-snat-rules/README.md | 3 + .../data-huaweicloud-nat-snat-rules/index.ts | 587 ++ .../README.md | 3 + .../index.ts | 294 + .../README.md | 3 + .../index.ts | 501 ++ .../README.md | 3 + .../data-huaweicloud-networking-port/index.ts | 501 ++ .../README.md | 3 + .../index.ts | 483 ++ .../README.md | 3 + .../index.ts | 384 + .../README.md | 3 + .../index.ts | 384 + .../README.md | 3 + .../index.ts | 334 + .../README.md | 3 + .../index.ts | 634 ++ .../README.md | 3 + .../index.ts | 224 + .../data-huaweicloud-obs-buckets/README.md | 3 + .../data-huaweicloud-obs-buckets/index.ts | 301 + .../README.md | 3 + .../index.ts | 287 + .../README.md | 3 + .../index.ts | 210 + .../README.md | 3 + .../index.ts | 162 + .../README.md | 3 + .../index.ts | 239 + .../README.md | 3 + .../index.ts | 312 + .../README.md | 3 + .../index.ts | 353 + .../README.md | 3 + .../index.ts | 687 ++ .../README.md | 3 + .../index.ts | 259 + .../README.md | 3 + .../index.ts | 353 + .../README.md | 3 + .../index.ts | 151 + .../README.md | 3 + .../index.ts | 237 + .../README.md | 3 + .../index.ts | 232 + .../README.md | 3 + .../index.ts | 337 + .../README.md | 3 + .../index.ts | 309 + .../README.md | 3 + .../index.ts | 444 + .../README.md | 3 + .../index.ts | 316 + .../README.md | 3 + .../index.ts | 595 ++ .../README.md | 3 + .../index.ts | 321 + .../README.md | 3 + .../index.ts | 415 + .../data-huaweicloud-rds-backups/README.md | 3 + .../data-huaweicloud-rds-backups/index.ts | 609 ++ .../README.md | 3 + .../index.ts | 553 ++ .../README.md | 3 + .../index.ts | 638 ++ .../README.md | 3 + .../index.ts | 258 + .../README.md | 3 + .../index.ts | 315 + .../data-huaweicloud-rds-error-logs/README.md | 3 + .../data-huaweicloud-rds-error-logs/index.ts | 348 + .../README.md | 3 + .../index.ts | 259 + .../README.md | 3 + .../index.ts | 428 + .../data-huaweicloud-rds-flavors-v3/README.md | 3 + .../data-huaweicloud-rds-flavors-v3/index.ts | 458 + .../data-huaweicloud-rds-flavors/README.md | 3 + .../data-huaweicloud-rds-flavors/index.ts | 458 + .../data-huaweicloud-rds-instances/README.md | 3 + .../data-huaweicloud-rds-instances/index.ts | 858 ++ .../README.md | 3 + .../index.ts | 322 + .../README.md | 3 + .../index.ts | 174 + .../README.md | 3 + .../index.ts | 336 + .../README.md | 3 + .../index.ts | 316 + .../README.md | 3 + .../index.ts | 829 ++ .../README.md | 3 + .../index.ts | 357 + .../README.md | 3 + .../index.ts | 372 + .../README.md | 3 + .../data-huaweicloud-rds-pg-accounts/index.ts | 404 + .../README.md | 3 + .../index.ts | 415 + .../README.md | 3 + .../index.ts | 215 + .../README.md | 3 + .../index.ts | 205 + .../data-huaweicloud-rds-pg-plugins/README.md | 3 + .../data-huaweicloud-rds-pg-plugins/index.ts | 389 + .../data-huaweicloud-rds-pg-roles/README.md | 3 + .../data-huaweicloud-rds-pg-roles/index.ts | 208 + .../README.md | 3 + .../index.ts | 521 ++ .../README.md | 3 + .../index.ts | 692 ++ .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 462 + .../README.md | 3 + .../index.ts | 652 ++ .../README.md | 3 + .../index.ts | 259 + .../README.md | 3 + .../index.ts | 340 + .../data-huaweicloud-rds-slow-logs/README.md | 3 + .../data-huaweicloud-rds-slow-logs/index.ts | 448 + .../README.md | 3 + .../index.ts | 205 + .../README.md | 3 + .../index.ts | 328 + .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 311 + .../README.md | 3 + .../index.ts | 149 + .../README.md | 3 + .../index.ts | 336 + .../README.md | 3 + .../index.ts | 344 + .../README.md | 3 + .../index.ts | 320 + .../README.md | 3 + .../index.ts | 282 + .../README.md | 3 + .../index.ts | 233 + .../README.md | 3 + .../index.ts | 228 + .../README.md | 3 + .../index.ts | 274 + .../README.md | 3 + .../index.ts | 237 + .../README.md | 3 + .../index.ts | 368 + .../README.md | 3 + .../index.ts | 418 + .../README.md | 3 + .../index.ts | 400 + .../README.md | 3 + .../index.ts | 471 + .../README.md | 3 + .../index.ts | 566 ++ .../README.md | 3 + .../index.ts | 388 + .../README.md | 3 + .../index.ts | 364 + .../data-huaweicloud-rms-regions/README.md | 3 + .../data-huaweicloud-rms-regions/index.ts | 262 + .../README.md | 3 + .../index.ts | 227 + .../README.md | 3 + .../index.ts | 255 + .../README.md | 3 + .../index.ts | 518 ++ .../README.md | 3 + .../index.ts | 586 ++ .../README.md | 3 + .../index.ts | 419 + .../README.md | 3 + .../index.ts | 284 + .../README.md | 3 + .../index.ts | 317 + .../README.md | 3 + .../index.ts | 587 ++ .../README.md | 3 + .../index.ts | 301 + .../README.md | 3 + .../index.ts | 588 ++ .../data-huaweicloud-rms-resources/README.md | 3 + .../data-huaweicloud-rms-resources/index.ts | 498 ++ .../data-huaweicloud-rms-services/README.md | 3 + .../data-huaweicloud-rms-services/index.ts | 383 + .../README.md | 3 + .../index.ts | 412 + .../data-huaweicloud-sdrs-domain/README.md | 3 + .../data-huaweicloud-sdrs-domain/index.ts | 177 + .../README.md | 3 + .../index.ts | 537 ++ .../README.md | 3 + .../index.ts | 682 ++ .../README.md | 3 + .../index.ts | 1985 +++++ .../README.md | 3 + .../index.ts | 268 + .../README.md | 3 + .../index.ts | 536 ++ .../README.md | 3 + .../index.ts | 459 + .../README.md | 3 + .../index.ts | 920 ++ .../README.md | 3 + .../index.ts | 1031 +++ .../README.md | 3 + .../index.ts | 517 ++ .../README.md | 3 + .../index.ts | 528 ++ .../README.md | 3 + .../index.ts | 704 ++ .../README.md | 3 + .../index.ts | 757 ++ .../README.md | 3 + .../index.ts | 584 ++ .../README.md | 3 + .../index.ts | 264 + .../README.md | 3 + .../index.ts | 476 + .../README.md | 3 + .../index.ts | 459 + .../README.md | 3 + .../index.ts | 529 ++ .../README.md | 3 + .../index.ts | 542 ++ .../README.md | 3 + .../index.ts | 291 + .../README.md | 3 + .../index.ts | 263 + .../README.md | 3 + .../index.ts | 368 + .../README.md | 3 + .../index.ts | 252 + .../README.md | 3 + .../index.ts | 276 + .../README.md | 3 + .../data-huaweicloud-sfs-file-system/index.ts | 276 + .../README.md | 3 + .../index.ts | 359 + .../README.md | 3 + .../index.ts | 471 + .../README.md | 3 + .../index.ts | 445 + .../README.md | 3 + .../index.ts | 269 + .../data-huaweicloud-sfs-turbos/README.md | 3 + .../data-huaweicloud-sfs-turbos/index.ts | 435 + .../data-huaweicloud-smn-logtanks/README.md | 3 + .../data-huaweicloud-smn-logtanks/index.ts | 274 + .../README.md | 3 + .../index.ts | 340 + .../README.md | 3 + .../index.ts | 433 + .../README.md | 3 + .../index.ts | 370 + .../data-huaweicloud-smn-topics/README.md | 3 + .../data-huaweicloud-smn-topics/index.ts | 368 + .../README.md | 3 + .../index.ts | 422 + .../README.md | 3 + .../index.ts | 311 + .../README.md | 3 + .../index.ts | 463 + .../data-huaweicloud-swr-image-tags/README.md | 3 + .../data-huaweicloud-swr-image-tags/index.ts | 396 + .../README.md | 3 + .../index.ts | 543 ++ .../README.md | 3 + .../index.ts | 278 + .../README.md | 3 + .../index.ts | 407 + .../README.md | 3 + .../index.ts | 325 + .../README.md | 3 + .../index.ts | 404 + .../README.md | 3 + .../index.ts | 272 + .../README.md | 3 + .../index.ts | 507 ++ .../README.md | 3 + .../index.ts | 507 ++ .../data-huaweicloud-vbs-backup-v2/README.md | 3 + .../data-huaweicloud-vbs-backup-v2/index.ts | 281 + .../data-huaweicloud-vbs-backup/README.md | 3 + .../data-huaweicloud-vbs-backup/index.ts | 281 + .../README.md | 3 + .../index.ts | 483 ++ .../data-huaweicloud-vpc-bandwidth/README.md | 3 + .../data-huaweicloud-vpc-bandwidth/index.ts | 341 + .../data-huaweicloud-vpc-bandwidths/README.md | 3 + .../data-huaweicloud-vpc-bandwidths/index.ts | 506 ++ .../data-huaweicloud-vpc-eip/README.md | 3 + .../data-huaweicloud-vpc-eip/index.ts | 283 + .../data-huaweicloud-vpc-eips/README.md | 3 + .../data-huaweicloud-vpc-eips/index.ts | 497 ++ .../data-huaweicloud-vpc-flow-logs/README.md | 3 + .../data-huaweicloud-vpc-flow-logs/index.ts | 522 ++ .../data-huaweicloud-vpc-ids-v1/README.md | 3 + .../data-huaweicloud-vpc-ids-v1/index.ts | 149 + .../data-huaweicloud-vpc-ids/README.md | 3 + .../data-huaweicloud-vpc-ids/index.ts | 149 + .../README.md | 3 + .../index.ts | 339 + .../README.md | 3 + .../index.ts | 753 ++ .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 174 + .../data-huaweicloud-vpc-route-ids/README.md | 3 + .../data-huaweicloud-vpc-route-ids/index.ts | 174 + .../README.md | 3 + .../data-huaweicloud-vpc-route-table/index.ts | 308 + .../data-huaweicloud-vpc-route-v2/README.md | 3 + .../data-huaweicloud-vpc-route-v2/index.ts | 261 + .../data-huaweicloud-vpc-route/README.md | 3 + .../data-huaweicloud-vpc-route/index.ts | 261 + .../data-huaweicloud-vpc-routes/README.md | 3 + .../data-huaweicloud-vpc-routes/index.ts | 337 + .../README.md | 3 + .../index.ts | 507 ++ .../README.md | 3 + .../index.ts | 174 + .../data-huaweicloud-vpc-subnet-ids/README.md | 3 + .../data-huaweicloud-vpc-subnet-ids/index.ts | 174 + .../data-huaweicloud-vpc-subnet-v1/README.md | 3 + .../data-huaweicloud-vpc-subnet-v1/index.ts | 413 + .../data-huaweicloud-vpc-subnet/README.md | 3 + .../data-huaweicloud-vpc-subnet/index.ts | 413 + .../data-huaweicloud-vpc-subnets/README.md | 3 + .../data-huaweicloud-vpc-subnets/index.ts | 568 ++ .../README.md | 3 + .../index.ts | 597 ++ .../README.md | 3 + .../index.ts | 614 ++ .../README.md | 3 + .../index.ts | 597 ++ .../data-huaweicloud-vpc-v1/README.md | 3 + .../data-huaweicloud-vpc-v1/index.ts | 358 + .../data-huaweicloud-vpc/README.md | 3 + .../huaweicloud/data-huaweicloud-vpc/index.ts | 358 + .../README.md | 3 + .../data-huaweicloud-vpcep-endpoints/index.ts | 385 + .../README.md | 3 + .../index.ts | 301 + .../data-huaweicloud-vpcep-quotas/README.md | 3 + .../data-huaweicloud-vpcep-quotas/index.ts | 267 + .../README.md | 3 + .../index.ts | 364 + .../README.md | 3 + .../index.ts | 293 + .../README.md | 3 + .../index.ts | 236 + .../data-huaweicloud-vpcep-services/README.md | 3 + .../data-huaweicloud-vpcep-services/index.ts | 436 + .../data-huaweicloud-vpcs/README.md | 3 + .../data-huaweicloud-vpcs/index.ts | 401 + .../README.md | 3 + .../index.ts | 289 + .../README.md | 3 + .../index.ts | 367 + .../README.md | 3 + .../data-huaweicloud-vpn-connections/index.ts | 887 ++ .../README.md | 3 + .../index.ts | 511 ++ .../README.md | 3 + .../index.ts | 206 + .../data-huaweicloud-vpn-gateways/README.md | 3 + .../data-huaweicloud-vpn-gateways/index.ts | 611 ++ .../README.md | 3 + .../index.ts | 181 + .../README.md | 3 + .../index.ts | 299 + .../README.md | 3 + .../index.ts | 509 ++ .../data-huaweicloud-vpn-servers/README.md | 3 + .../data-huaweicloud-vpn-servers/index.ts | 600 ++ .../README.md | 3 + .../data-huaweicloud-vpn-user-groups/index.ts | 284 + .../data-huaweicloud-vpn-users/README.md | 3 + .../data-huaweicloud-vpn-users/index.ts | 284 + .../README.md | 3 + .../index.ts | 448 + .../README.md | 3 + .../data-huaweicloud-waf-certificate/index.ts | 273 + .../README.md | 3 + .../index.ts | 463 + .../README.md | 3 + .../index.ts | 392 + .../README.md | 3 + .../index.ts | 346 + .../data-huaweicloud-waf-domains/README.md | 3 + .../data-huaweicloud-waf-domains/index.ts | 384 + .../README.md | 3 + .../index.ts | 498 ++ .../data-huaweicloud-waf-policies/README.md | 3 + .../data-huaweicloud-waf-policies/index.ts | 588 ++ .../README.md | 3 + .../index.ts | 306 + .../README.md | 3 + .../index.ts | 535 ++ .../README.md | 3 + .../index.ts | 530 ++ .../README.md | 3 + .../index.ts | 712 ++ .../README.md | 3 + .../index.ts | 379 + .../README.md | 3 + .../index.ts | 434 + .../README.md | 3 + .../index.ts | 480 ++ .../README.md | 3 + .../index.ts | 414 + .../README.md | 3 + .../index.ts | 369 + .../README.md | 3 + .../index.ts | 530 ++ .../README.md | 3 + .../index.ts | 374 + .../data-huaweicloud-waf-source-ips/README.md | 3 + .../data-huaweicloud-waf-source-ips/index.ts | 232 + .../README.md | 3 + .../index.ts | 382 + .../README.md | 3 + .../index.ts | 398 + .../README.md | 3 + .../index.ts | 309 + .../README.md | 3 + .../index.ts | 237 + .../README.md | 3 + .../index.ts | 975 +++ .../README.md | 3 + .../index.ts | 387 + .../README.md | 3 + .../index.ts | 459 + .../README.md | 3 + .../index.ts | 459 + .../README.md | 3 + .../index.ts | 429 + .../README.md | 3 + .../index.ts | 779 ++ .../README.md | 3 + .../index.ts | 487 ++ .../README.md | 3 + .../dataarts-architecture-code-table/index.ts | 560 ++ .../README.md | 3 + .../index.ts | 684 ++ .../README.md | 3 + .../index.ts | 566 ++ .../dataarts-architecture-directory/README.md | 3 + .../dataarts-architecture-directory/index.ts | 310 + .../dataarts-architecture-model/README.md | 3 + .../dataarts-architecture-model/index.ts | 348 + .../dataarts-architecture-process/README.md | 3 + .../dataarts-architecture-process/index.ts | 377 + .../dataarts-architecture-reviewer/README.md | 3 + .../dataarts-architecture-reviewer/index.ts | 280 + .../dataarts-architecture-subject/README.md | 3 + .../dataarts-architecture-subject/index.ts | 388 + .../README.md | 3 + .../index.ts | 3626 ++++++++ .../dataarts-dataservice-api-action/README.md | 3 + .../dataarts-dataservice-api-action/index.ts | 254 + .../README.md | 3 + .../index.ts | 311 + .../dataarts-dataservice-api-auth/README.md | 3 + .../dataarts-dataservice-api-auth/index.ts | 284 + .../dataarts-dataservice-api-debug/README.md | 3 + .../dataarts-dataservice-api-debug/index.ts | 436 + .../README.md | 3 + .../dataarts-dataservice-api-publish/index.ts | 471 + .../README.md | 3 + .../index.ts | 476 + .../dataarts-dataservice-api/README.md | 3 + .../dataarts-dataservice-api/index.ts | 2870 +++++++ .../dataarts-dataservice-app/README.md | 3 + .../dataarts-dataservice-app/index.ts | 295 + .../dataarts-dataservice-catalog/README.md | 3 + .../dataarts-dataservice-catalog/index.ts | 325 + .../README.md | 3 + .../index.ts | 260 + .../dataarts-factory-job-action/README.md | 3 + .../dataarts-factory-job-action/index.ts | 417 + .../dataarts-factory-job/README.md | 3 + .../huaweicloud/dataarts-factory-job/index.ts | 3234 +++++++ .../dataarts-factory-resource/README.md | 3 + .../dataarts-factory-resource/index.ts | 470 + .../dataarts-factory-script/README.md | 3 + .../dataarts-factory-script/index.ts | 590 ++ .../README.md | 3 + .../index.ts | 475 + .../README.md | 3 + .../index.ts | 247 + .../README.md | 3 + .../index.ts | 274 + .../README.md | 3 + .../index.ts | 500 ++ .../README.md | 3 + .../dataarts-security-permission-set/index.ts | 363 + .../dataarts-studio-data-connection/README.md | 3 + .../dataarts-studio-data-connection/index.ts | 362 + .../dataarts-studio-instance/README.md | 3 + .../dataarts-studio-instance/index.ts | 605 ++ .../dbss-audit-risk-rule-action/README.md | 3 + .../dbss-audit-risk-rule-action/index.ts | 224 + .../huaweicloud/dbss-ecs-database/README.md | 3 + .../huaweicloud/dbss-ecs-database/index.ts | 446 + .../huaweicloud/dbss-instance/README.md | 3 + .../huaweicloud/dbss-instance/index.ts | 873 ++ .../huaweicloud/dbss-rds-database/README.md | 3 + .../huaweicloud/dbss-rds-database/index.ts | 335 + .../huaweicloud/dc-hosted-connect/README.md | 3 + .../huaweicloud/dc-hosted-connect/index.ts | 537 ++ .../huaweicloud/dc-virtual-gateway/README.md | 3 + .../huaweicloud/dc-virtual-gateway/index.ts | 350 + .../dc-virtual-interface-accepter/README.md | 3 + .../dc-virtual-interface-accepter/index.ts | 322 + .../dc-virtual-interface/README.md | 3 + .../huaweicloud/dc-virtual-interface/index.ts | 991 +++ .../huaweicloud/dcs-account/README.md | 3 + .../huaweicloud/dcs-account/index.ts | 482 ++ .../huaweicloud/dcs-backup/README.md | 3 + .../providers/huaweicloud/dcs-backup/index.ts | 428 + .../huaweicloud/dcs-bigkey-analysis/README.md | 3 + .../huaweicloud/dcs-bigkey-analysis/index.ts | 431 + .../huaweicloud/dcs-custom-template/README.md | 3 + .../huaweicloud/dcs-custom-template/index.ts | 494 ++ .../huaweicloud/dcs-diagnosis-task/README.md | 3 + .../huaweicloud/dcs-diagnosis-task/index.ts | 1140 +++ .../huaweicloud/dcs-hotkey-analysis/README.md | 3 + .../huaweicloud/dcs-hotkey-analysis/index.ts | 436 + .../dcs-instance-restore/README.md | 3 + .../huaweicloud/dcs-instance-restore/index.ts | 367 + .../huaweicloud/dcs-instance-v1/README.md | 3 + .../huaweicloud/dcs-instance-v1/index.ts | 2214 +++++ .../huaweicloud/dcs-instance/README.md | 3 + .../huaweicloud/dcs-instance/index.ts | 2214 +++++ .../dcs-isntance-restore/README.md | 3 + .../huaweicloud/dcs-isntance-restore/index.ts | 367 + .../huaweicloud/ddm-account/README.md | 3 + .../huaweicloud/ddm-account/index.ts | 630 ++ .../ddm-instance-read-strategy/README.md | 3 + .../ddm-instance-read-strategy/index.ts | 345 + .../ddm-instance-restart/README.md | 3 + .../huaweicloud/ddm-instance-restart/index.ts | 321 + .../ddm-instance-rollback/README.md | 3 + .../ddm-instance-rollback/index.ts | 293 + .../ddm-instance-upgrade/README.md | 3 + .../huaweicloud/ddm-instance-upgrade/index.ts | 318 + .../huaweicloud/ddm-instance/README.md | 3 + .../huaweicloud/ddm-instance/index.ts | 1126 +++ .../ddm-logical-sessions-kill/README.md | 3 + .../ddm-logical-sessions-kill/index.ts | 194 + .../ddm-physical-sessions-kill/README.md | 3 + .../ddm-physical-sessions-kill/index.ts | 194 + .../huaweicloud/ddm-schema/README.md | 3 + .../providers/huaweicloud/ddm-schema/index.ts | 764 ++ .../dds-audit-log-delete/README.md | 3 + .../huaweicloud/dds-audit-log-delete/index.ts | 318 + .../dds-audit-log-policy/README.md | 3 + .../huaweicloud/dds-audit-log-policy/index.ts | 478 ++ .../huaweicloud/dds-backup/README.md | 3 + .../providers/huaweicloud/dds-backup/index.ts | 501 ++ .../dds-collection-restore/README.md | 3 + .../dds-collection-restore/index.ts | 677 ++ .../huaweicloud/dds-database-role/README.md | 3 + .../huaweicloud/dds-database-role/index.ts | 883 ++ .../huaweicloud/dds-database-user/README.md | 3 + .../huaweicloud/dds-database-user/index.ts | 938 ++ .../dds-instance-eip-associate/README.md | 3 + .../dds-instance-eip-associate/index.ts | 376 + .../dds-instance-internal-ip-modify/README.md | 3 + .../dds-instance-internal-ip-modify/index.ts | 376 + .../dds-instance-parameters-modify/README.md | 3 + .../dds-instance-parameters-modify/index.ts | 524 ++ .../dds-instance-recovery/README.md | 3 + .../dds-instance-recovery/index.ts | 374 + .../dds-instance-restart/README.md | 3 + .../huaweicloud/dds-instance-restart/index.ts | 349 + .../dds-instance-restore/README.md | 3 + .../huaweicloud/dds-instance-restore/index.ts | 374 + .../huaweicloud/dds-instance-v3/README.md | 3 + .../huaweicloud/dds-instance-v3/index.ts | 2212 +++++ .../huaweicloud/dds-instance/README.md | 3 + .../huaweicloud/dds-instance/index.ts | 2212 +++++ .../huaweicloud/dds-lts-log/README.md | 3 + .../huaweicloud/dds-lts-log/index.ts | 409 + .../dds-parameter-template-apply/README.md | 3 + .../dds-parameter-template-apply/index.ts | 322 + .../dds-parameter-template-compare/README.md | 3 + .../dds-parameter-template-compare/index.ts | 285 + .../dds-parameter-template-copy/README.md | 3 + .../dds-parameter-template-copy/index.ts | 228 + .../dds-parameter-template-reset/README.md | 3 + .../dds-parameter-template-reset/index.ts | 171 + .../dds-parameter-template/README.md | 3 + .../dds-parameter-template/index.ts | 406 + .../dds-primary-standby-switch/README.md | 3 + .../dds-primary-standby-switch/index.ts | 321 + .../huaweicloud/dds-recycle-policy/README.md | 3 + .../huaweicloud/dds-recycle-policy/index.ts | 169 + .../dds-scheduled-task-cancel/README.md | 3 + .../dds-scheduled-task-cancel/index.ts | 211 + .../huaweicloud/dis-stream-v2/README.md | 3 + .../huaweicloud/dis-stream-v2/index.ts | 719 ++ .../huaweicloud/dis-stream/README.md | 3 + .../providers/huaweicloud/dis-stream/index.ts | 719 ++ .../huaweicloud/dli-agency/README.md | 3 + .../providers/huaweicloud/dli-agency/index.ts | 176 + .../dli-database-privilege/README.md | 3 + .../dli-database-privilege/index.ts | 230 + .../huaweicloud/dli-database/README.md | 3 + .../huaweicloud/dli-database/index.ts | 438 + .../huaweicloud/dli-datasource-auth/README.md | 3 + .../huaweicloud/dli-datasource-auth/index.ts | 533 ++ .../README.md | 3 + .../index.ts | 200 + .../README.md | 3 + .../index.ts | 228 + .../dli-datasource-connection/README.md | 3 + .../dli-datasource-connection/index.ts | 674 ++ .../dli-elastic-resource-pool/README.md | 3 + .../dli-elastic-resource-pool/index.ts | 522 ++ .../huaweicloud/dli-flink-template/README.md | 3 + .../huaweicloud/dli-flink-template/index.ts | 291 + .../huaweicloud/dli-flinkjar-job/README.md | 3 + .../huaweicloud/dli-flinkjar-job/index.ts | 1036 +++ .../huaweicloud/dli-flinksql-job/README.md | 3 + .../huaweicloud/dli-flinksql-job/index.ts | 1209 +++ .../huaweicloud/dli-global-variable/README.md | 3 + .../huaweicloud/dli-global-variable/index.ts | 228 + .../huaweicloud/dli-package/README.md | 3 + .../huaweicloud/dli-package/index.ts | 326 + .../huaweicloud/dli-permission/README.md | 3 + .../huaweicloud/dli-permission/index.ts | 224 + .../huaweicloud/dli-queue-v1/README.md | 3 + .../huaweicloud/dli-queue-v1/index.ts | 1080 +++ .../providers/huaweicloud/dli-queue/README.md | 3 + .../providers/huaweicloud/dli-queue/index.ts | 1080 +++ .../huaweicloud/dli-spark-job/README.md | 3 + .../huaweicloud/dli-spark-job/index.ts | 1063 +++ .../huaweicloud/dli-spark-template/README.md | 3 + .../huaweicloud/dli-spark-template/index.ts | 1503 ++++ .../huaweicloud/dli-sql-job/README.md | 3 + .../huaweicloud/dli-sql-job/index.ts | 792 ++ .../huaweicloud/dli-sql-template/README.md | 3 + .../huaweicloud/dli-sql-template/index.ts | 263 + .../providers/huaweicloud/dli-table/README.md | 3 + .../providers/huaweicloud/dli-table/index.ts | 867 ++ .../huaweicloud/dli-template-flink/README.md | 3 + .../huaweicloud/dli-template-flink/index.ts | 291 + .../huaweicloud/dli-template-spark/README.md | 3 + .../huaweicloud/dli-template-spark/index.ts | 1503 ++++ .../huaweicloud/dli-template-sql/README.md | 3 + .../huaweicloud/dli-template-sql/index.ts | 263 + .../huaweicloud/dms-group-v1/README.md | 3 + .../huaweicloud/dms-group-v1/index.ts | 219 + .../providers/huaweicloud/dms-group/README.md | 3 + .../providers/huaweicloud/dms-group/index.ts | 219 + .../huaweicloud/dms-instance-v1/README.md | 3 + .../huaweicloud/dms-instance-v1/index.ts | 681 ++ .../huaweicloud/dms-instance/README.md | 3 + .../huaweicloud/dms-instance/index.ts | 681 ++ .../README.md | 3 + .../dms-kafka-background-task-delete/index.ts | 194 + .../dms-kafka-consumer-group/README.md | 3 + .../dms-kafka-consumer-group/index.ts | 248 + .../dms-kafka-instance-restart/README.md | 3 + .../dms-kafka-instance-restart/index.ts | 295 + .../huaweicloud/dms-kafka-instance/README.md | 3 + .../huaweicloud/dms-kafka-instance/index.ts | 1833 ++++ .../README.md | 3 + .../dms-kafka-message-diagnosis-task/index.ts | 729 ++ .../dms-kafka-message-offset-reset/README.md | 3 + .../dms-kafka-message-offset-reset/index.ts | 441 + .../dms-kafka-message-produce/README.md | 3 + .../dms-kafka-message-produce/index.ts | 392 + .../dms-kafka-partition-reassign/README.md | 3 + .../dms-kafka-partition-reassign/index.ts | 805 ++ .../dms-kafka-permissions/README.md | 3 + .../dms-kafka-permissions/index.ts | 521 ++ .../README.md | 3 + .../index.ts | 382 + .../dms-kafka-smart-connect-task/README.md | 3 + .../dms-kafka-smart-connect-task/index.ts | 698 ++ .../dms-kafka-smart-connect/README.md | 3 + .../dms-kafka-smart-connect/index.ts | 415 + .../huaweicloud/dms-kafka-topic/README.md | 3 + .../huaweicloud/dms-kafka-topic/index.ts | 575 ++ .../dms-kafka-user-client-quota/README.md | 3 + .../dms-kafka-user-client-quota/index.ts | 541 ++ .../huaweicloud/dms-kafka-user/README.md | 3 + .../huaweicloud/dms-kafka-user/index.ts | 262 + .../dms-kafkav2-smart-connect-task/README.md | 3 + .../dms-kafkav2-smart-connect-task/index.ts | 1629 ++++ .../huaweicloud/dms-queue-v1/README.md | 3 + .../huaweicloud/dms-queue-v1/index.ts | 334 + .../providers/huaweicloud/dms-queue/README.md | 3 + .../providers/huaweicloud/dms-queue/index.ts | 334 + .../README.md | 3 + .../index.ts | 194 + .../dms-rabbitmq-exchange-associate/README.md | 3 + .../dms-rabbitmq-exchange-associate/index.ts | 302 + .../dms-rabbitmq-exchange/README.md | 3 + .../dms-rabbitmq-exchange/index.ts | 421 + .../dms-rabbitmq-instance/README.md | 3 + .../dms-rabbitmq-instance/index.ts | 1134 +++ .../huaweicloud/dms-rabbitmq-plugin/README.md | 3 + .../huaweicloud/dms-rabbitmq-plugin/index.ts | 370 + .../README.md | 3 + .../dms-rabbitmq-queue-message-clear/index.ts | 219 + .../huaweicloud/dms-rabbitmq-queue/README.md | 3 + .../huaweicloud/dms-rabbitmq-queue/index.ts | 697 ++ .../huaweicloud/dms-rabbitmq-user/README.md | 3 + .../huaweicloud/dms-rabbitmq-user/index.ts | 449 + .../huaweicloud/dms-rabbitmq-vhost/README.md | 3 + .../huaweicloud/dms-rabbitmq-vhost/index.ts | 199 + .../dms-rocketmq-consumer-group/README.md | 3 + .../dms-rocketmq-consumer-group/index.ts | 375 + .../dms-rocketmq-consumption-verify/README.md | 3 + .../dms-rocketmq-consumption-verify/index.ts | 372 + .../dms-rocketmq-dead-letter-resend/README.md | 3 + .../dms-rocketmq-dead-letter-resend/index.ts | 310 + .../dms-rocketmq-instance/README.md | 3 + .../dms-rocketmq-instance/index.ts | 1331 +++ .../README.md | 3 + .../index.ts | 244 + .../dms-rocketmq-migration-task/README.md | 3 + .../dms-rocketmq-migration-task/index.ts | 2071 +++++ .../huaweicloud/dms-rocketmq-topic/README.md | 3 + .../huaweicloud/dms-rocketmq-topic/index.ts | 687 ++ .../huaweicloud/dms-rocketmq-user/README.md | 3 + .../huaweicloud/dms-rocketmq-user/index.ts | 715 ++ .../huaweicloud/dns-custom-line/README.md | 3 + .../huaweicloud/dns-custom-line/index.ts | 423 + .../huaweicloud/dns-endpoint/README.md | 3 + .../huaweicloud/dns-endpoint/index.ts | 602 ++ .../huaweicloud/dns-line-group/README.md | 3 + .../huaweicloud/dns-line-group/index.ts | 433 + .../huaweicloud/dns-ptrrecord-v2/README.md | 3 + .../huaweicloud/dns-ptrrecord-v2/index.ts | 501 ++ .../huaweicloud/dns-ptrrecord/README.md | 3 + .../huaweicloud/dns-ptrrecord/index.ts | 501 ++ .../huaweicloud/dns-recordset-v2/README.md | 3 + .../huaweicloud/dns-recordset-v2/index.ts | 518 ++ .../huaweicloud/dns-recordset/README.md | 3 + .../huaweicloud/dns-recordset/index.ts | 631 ++ .../dns-resolver-rule-associate/README.md | 3 + .../dns-resolver-rule-associate/index.ts | 356 + .../huaweicloud/dns-resolver-rule/README.md | 3 + .../huaweicloud/dns-resolver-rule/index.ts | 663 ++ .../huaweicloud/dns-zone-v2/README.md | 3 + .../huaweicloud/dns-zone-v2/index.ts | 738 ++ .../providers/huaweicloud/dns-zone/README.md | 3 + .../providers/huaweicloud/dns-zone/index.ts | 738 ++ .../drs-job-primary-standby-switch/README.md | 3 + .../drs-job-primary-standby-switch/index.ts | 293 + .../providers/huaweicloud/drs-job/README.md | 3 + .../providers/huaweicloud/drs-job/index.ts | 4693 ++++++++++ .../dsc-alarm-notification/README.md | 3 + .../dsc-alarm-notification/index.ts | 227 + .../huaweicloud/dsc-asset-obs/README.md | 3 + .../huaweicloud/dsc-asset-obs/index.ts | 225 + .../huaweicloud/dsc-instance/README.md | 3 + .../huaweicloud/dsc-instance/index.ts | 342 + .../dws-alarm-subscription/README.md | 3 + .../dws-alarm-subscription/index.ts | 337 + .../huaweicloud/dws-cluster-restart/README.md | 3 + .../huaweicloud/dws-cluster-restart/index.ts | 295 + .../huaweicloud/dws-cluster/README.md | 3 + .../huaweicloud/dws-cluster/index.ts | 1648 ++++ .../dws-disaster-recovery-task/README.md | 3 + .../dws-disaster-recovery-task/index.ts | 744 ++ .../dws-event-subscription/README.md | 3 + .../dws-event-subscription/index.ts | 429 + .../huaweicloud/dws-ext-data-source/README.md | 3 + .../huaweicloud/dws-ext-data-source/index.ts | 610 ++ .../dws-logical-cluster-restart/README.md | 3 + .../dws-logical-cluster-restart/index.ts | 322 + .../huaweicloud/dws-logical-cluster/README.md | 3 + .../huaweicloud/dws-logical-cluster/index.ts | 765 ++ .../dws-om-account-action/README.md | 3 + .../dws-om-account-action/index.ts | 198 + .../dws-parameter-configurations/README.md | 3 + .../dws-parameter-configurations/index.ts | 534 ++ .../dws-public-domain-associate/README.md | 3 + .../dws-public-domain-associate/index.ts | 228 + .../huaweicloud/dws-snapshot-copy/README.md | 3 + .../huaweicloud/dws-snapshot-copy/index.ts | 228 + .../huaweicloud/dws-snapshot-policy/README.md | 3 + .../huaweicloud/dws-snapshot-policy/index.ts | 252 + .../huaweicloud/dws-snapshot/README.md | 3 + .../huaweicloud/dws-snapshot/index.ts | 377 + .../dws-workload-configuration/README.md | 3 + .../dws-workload-configuration/index.ts | 228 + .../dws-workload-plan-execution/README.md | 3 + .../dws-workload-plan-execution/index.ts | 222 + .../dws-workload-plan-stage/README.md | 3 + .../dws-workload-plan-stage/index.ts | 706 ++ .../huaweicloud/dws-workload-plan/README.md | 3 + .../huaweicloud/dws-workload-plan/index.ts | 318 + .../README.md | 3 + .../index.ts | 225 + .../huaweicloud/dws-workload-queue/README.md | 3 + .../huaweicloud/dws-workload-queue/index.ts | 392 + .../huaweicloud/ecs-instance-v1/README.md | 3 + .../huaweicloud/ecs-instance-v1/index.ts | 1240 +++ .../huaweicloud/eg-connection/README.md | 3 + .../huaweicloud/eg-connection/index.ts | 551 ++ .../eg-custom-event-channel/README.md | 3 + .../eg-custom-event-channel/index.ts | 273 + .../eg-custom-event-source/README.md | 3 + .../eg-custom-event-source/index.ts | 305 + .../huaweicloud/eg-endpoint/README.md | 3 + .../huaweicloud/eg-endpoint/index.ts | 276 + .../huaweicloud/eg-event-stream/README.md | 3 + .../huaweicloud/eg-event-stream/index.ts | 1271 +++ .../eg-event-subscription/README.md | 3 + .../eg-event-subscription/index.ts | 957 +++ .../elb-active-standby-pool/README.md | 3 + .../elb-active-standby-pool/index.ts | 1344 +++ .../README.md | 3 + .../elb-certificate-private-key-echo/index.ts | 144 + .../huaweicloud/elb-certificate/README.md | 3 + .../huaweicloud/elb-certificate/index.ts | 352 + .../huaweicloud/elb-ipgroup/README.md | 3 + .../huaweicloud/elb-ipgroup/index.ts | 413 + .../huaweicloud/elb-l7policy/README.md | 3 + .../huaweicloud/elb-l7policy/index.ts | 3553 ++++++++ .../huaweicloud/elb-l7rule/README.md | 3 + .../providers/huaweicloud/elb-l7rule/index.ts | 590 ++ .../huaweicloud/elb-listener/README.md | 3 + .../huaweicloud/elb-listener/index.ts | 1575 ++++ .../huaweicloud/elb-loadbalancer/README.md | 3 + .../huaweicloud/elb-loadbalancer/index.ts | 1329 +++ .../providers/huaweicloud/elb-log/README.md | 3 + .../providers/huaweicloud/elb-log/index.ts | 219 + .../huaweicloud/elb-logtank/README.md | 3 + .../huaweicloud/elb-logtank/index.ts | 219 + .../huaweicloud/elb-member/README.md | 3 + .../providers/huaweicloud/elb-member/index.ts | 498 ++ .../huaweicloud/elb-monitor/README.md | 3 + .../huaweicloud/elb-monitor/index.ts | 503 ++ .../providers/huaweicloud/elb-pool/README.md | 3 + .../providers/huaweicloud/elb-pool/index.ts | 1024 +++ .../huaweicloud/elb-security-policy/README.md | 3 + .../huaweicloud/elb-security-policy/index.ts | 379 + .../enterprise-project-authority/README.md | 3 + .../enterprise-project-authority/index.ts | 116 + .../huaweicloud/enterprise-project/README.md | 3 + .../huaweicloud/enterprise-project/index.ts | 458 + .../huaweicloud/er-association/README.md | 3 + .../huaweicloud/er-association/index.ts | 404 + .../huaweicloud/er-flow-log/README.md | 3 + .../huaweicloud/er-flow-log/index.ts | 580 ++ .../huaweicloud/er-instance/README.md | 3 + .../huaweicloud/er-instance/index.ts | 668 ++ .../huaweicloud/er-propagation/README.md | 3 + .../huaweicloud/er-propagation/index.ts | 404 + .../huaweicloud/er-route-table/README.md | 3 + .../huaweicloud/er-route-table/index.ts | 473 + .../huaweicloud/er-static-route/README.md | 3 + .../huaweicloud/er-static-route/index.ts | 470 + .../huaweicloud/er-vpc-attachment/README.md | 3 + .../huaweicloud/er-vpc-attachment/index.ts | 547 ++ .../evs-snapshot-rollback/README.md | 3 + .../evs-snapshot-rollback/index.ts | 194 + .../huaweicloud/evs-snapshot/README.md | 3 + .../huaweicloud/evs-snapshot/index.ts | 445 + .../evs-volume-transfer-accepter/README.md | 3 + .../evs-volume-transfer-accepter/index.ts | 194 + .../huaweicloud/evs-volume-transfer/README.md | 3 + .../huaweicloud/evs-volume-transfer/index.ts | 204 + .../huaweicloud/evs-volume/README.md | 3 + .../providers/huaweicloud/evs-volume/index.ts | 1073 +++ .../huaweicloud/fgs-application/README.md | 3 + .../huaweicloud/fgs-application/index.ts | 672 ++ .../fgs-async-invoke-configuration/README.md | 3 + .../fgs-async-invoke-configuration/index.ts | 557 ++ .../fgs-dependency-version/README.md | 3 + .../fgs-dependency-version/index.ts | 287 + .../huaweicloud/fgs-dependency/README.md | 3 + .../huaweicloud/fgs-dependency/index.ts | 267 + .../huaweicloud/fgs-function-event/README.md | 3 + .../huaweicloud/fgs-function-event/index.ts | 232 + .../fgs-function-trigger/README.md | 3 + .../huaweicloud/fgs-function-trigger/index.ts | 424 + .../huaweicloud/fgs-function-v2/README.md | 3 + .../huaweicloud/fgs-function-v2/index.ts | 3025 +++++++ .../huaweicloud/fgs-function/README.md | 3 + .../huaweicloud/fgs-function/index.ts | 3025 +++++++ .../huaweicloud/fgs-trigger/README.md | 3 + .../huaweicloud/fgs-trigger/index.ts | 1813 ++++ .../fw-firewall-group-v2/README.md | 3 + .../huaweicloud/fw-firewall-group-v2/index.ts | 558 ++ .../huaweicloud/fw-policy-v2/README.md | 3 + .../huaweicloud/fw-policy-v2/index.ts | 464 + .../huaweicloud/fw-rule-v2/README.md | 3 + .../providers/huaweicloud/fw-rule-v2/index.ts | 474 + .../huaweicloud/ga-accelerator/README.md | 3 + .../huaweicloud/ga-accelerator/index.ts | 688 ++ .../huaweicloud/ga-address-group/README.md | 3 + .../huaweicloud/ga-address-group/index.ts | 731 ++ .../huaweicloud/ga-endpoint-group/README.md | 3 + .../huaweicloud/ga-endpoint-group/index.ts | 548 ++ .../huaweicloud/ga-endpoint/README.md | 3 + .../huaweicloud/ga-endpoint/index.ts | 467 + .../huaweicloud/ga-health-check/README.md | 3 + .../huaweicloud/ga-health-check/index.ts | 541 ++ .../huaweicloud/ga-listener/README.md | 3 + .../huaweicloud/ga-listener/index.ts | 671 ++ .../gaussdb-cassandra-instance/README.md | 3 + .../gaussdb-cassandra-instance/index.ts | 1324 +++ .../gaussdb-influx-instance/README.md | 3 + .../gaussdb-influx-instance/index.ts | 1324 +++ .../gaussdb-mongo-instance/README.md | 3 + .../gaussdb-mongo-instance/index.ts | 1324 +++ .../gaussdb-mysql-account-privilege/README.md | 3 + .../gaussdb-mysql-account-privilege/index.ts | 557 ++ .../gaussdb-mysql-account/README.md | 3 + .../gaussdb-mysql-account/index.ts | 475 + .../gaussdb-mysql-backup/README.md | 3 + .../huaweicloud/gaussdb-mysql-backup/index.ts | 458 + .../gaussdb-mysql-database/README.md | 3 + .../gaussdb-mysql-database/index.ts | 445 + .../gaussdb-mysql-eip-associate/README.md | 3 + .../gaussdb-mysql-eip-associate/index.ts | 382 + .../README.md | 3 + .../index.ts | 407 + .../gaussdb-mysql-instance-restart/README.md | 3 + .../gaussdb-mysql-instance-restart/index.ts | 349 + .../gaussdb-mysql-instance-upgrade/README.md | 3 + .../gaussdb-mysql-instance-upgrade/index.ts | 321 + .../gaussdb-mysql-instance/README.md | 3 + .../gaussdb-mysql-instance/index.ts | 2591 ++++++ .../README.md | 3 + .../index.ts | 169 + .../gaussdb-mysql-lts-log/README.md | 3 + .../gaussdb-mysql-lts-log/index.ts | 409 + .../README.md | 3 + .../index.ts | 322 + .../README.md | 3 + .../index.ts | 409 + .../README.md | 3 + .../gaussdb-mysql-parameter-template/index.ts | 391 + .../gaussdb-mysql-proxy-restart/README.md | 3 + .../gaussdb-mysql-proxy-restart/index.ts | 318 + .../huaweicloud/gaussdb-mysql-proxy/README.md | 3 + .../huaweicloud/gaussdb-mysql-proxy/index.ts | 1570 ++++ .../huaweicloud/gaussdb-mysql-quota/README.md | 3 + .../huaweicloud/gaussdb-mysql-quota/index.ts | 273 + .../gaussdb-mysql-recycling-policy/README.md | 3 + .../gaussdb-mysql-recycling-policy/index.ts | 169 + .../gaussdb-mysql-restore/README.md | 3 + .../gaussdb-mysql-restore/index.ts | 409 + .../README.md | 3 + .../index.ts | 219 + .../README.md | 3 + .../index.ts | 194 + .../gaussdb-mysql-sql-control-rule/README.md | 3 + .../gaussdb-mysql-sql-control-rule/index.ts | 469 + .../gaussdb-mysql-table-restore/README.md | 3 + .../gaussdb-mysql-table-restore/index.ts | 661 ++ .../gaussdb-opengauss-database/README.md | 3 + .../gaussdb-opengauss-database/index.ts | 515 ++ .../gaussdb-opengauss-instance/README.md | 3 + .../gaussdb-opengauss-instance/index.ts | 1586 ++++ .../gaussdb-redis-eip-associate/README.md | 3 + .../gaussdb-redis-eip-associate/index.ts | 382 + .../gaussdb-redis-instance/README.md | 3 + .../gaussdb-redis-instance/index.ts | 1460 ++++ .../huaweicloud/ges-backup/README.md | 3 + .../providers/huaweicloud/ges-backup/index.ts | 333 + .../providers/huaweicloud/ges-graph/README.md | 3 + .../providers/huaweicloud/ges-graph/index.ts | 1445 ++++ .../huaweicloud/ges-metadata/README.md | 3 + .../huaweicloud/ges-metadata/index.ts | 645 ++ .../global-eip-associate/README.md | 3 + .../huaweicloud/global-eip-associate/index.ts | 902 ++ .../huaweicloud/global-eip/README.md | 3 + .../providers/huaweicloud/global-eip/index.ts | 373 + .../global-internet-bandwidth/README.md | 3 + .../global-internet-bandwidth/index.ts | 409 + .../huaweicloud/hss-cce-protection/README.md | 3 + .../huaweicloud/hss-cce-protection/index.ts | 919 ++ .../huaweicloud/hss-host-group/README.md | 3 + .../huaweicloud/hss-host-group/index.ts | 410 + .../huaweicloud/hss-host-protection/README.md | 3 + .../huaweicloud/hss-host-protection/index.ts | 477 ++ .../providers/huaweicloud/hss-quota/README.md | 3 + .../providers/huaweicloud/hss-quota/index.ts | 505 ++ .../hss-webtamper-protection/README.md | 3 + .../hss-webtamper-protection/index.ts | 303 + .../huaweicloud/iam-agency-v3/README.md | 3 + .../huaweicloud/iam-agency-v3/index.ts | 496 ++ .../huaweicloud/iam-agency/README.md | 3 + .../providers/huaweicloud/iam-agency/index.ts | 496 ++ .../huaweicloud/identity-access-key/README.md | 3 + .../huaweicloud/identity-access-key/index.ts | 278 + .../huaweicloud/identity-acl/README.md | 3 + .../huaweicloud/identity-acl/index.ts | 493 ++ .../huaweicloud/identity-agency/README.md | 3 + .../huaweicloud/identity-agency/index.ts | 496 ++ .../identity-group-membership-v3/README.md | 3 + .../identity-group-membership-v3/index.ts | 166 + .../identity-group-membership/README.md | 3 + .../identity-group-membership/index.ts | 166 + .../identity-group-role-assignment/README.md | 3 + .../identity-group-role-assignment/index.ts | 250 + .../huaweicloud/identity-group-v3/README.md | 3 + .../huaweicloud/identity-group-v3/index.ts | 169 + .../huaweicloud/identity-group/README.md | 3 + .../huaweicloud/identity-group/index.ts | 169 + .../identity-login-policy/README.md | 3 + .../identity-login-policy/index.ts | 312 + .../identity-password-policy/README.md | 3 + .../identity-password-policy/index.ts | 317 + .../huaweicloud/identity-policy/README.md | 3 + .../huaweicloud/identity-policy/index.ts | 285 + .../huaweicloud/identity-project-v3/README.md | 3 + .../huaweicloud/identity-project-v3/index.ts | 207 + .../huaweicloud/identity-project/README.md | 3 + .../huaweicloud/identity-project/index.ts | 207 + .../identity-protection-policy/README.md | 3 + .../identity-protection-policy/index.ts | 415 + .../identity-provider-conversion/README.md | 3 + .../identity-provider-conversion/index.ts | 643 ++ .../huaweicloud/identity-provider/README.md | 3 + .../huaweicloud/identity-provider/index.ts | 869 ++ .../identity-role-assignment-v3/README.md | 3 + .../identity-role-assignment-v3/index.ts | 250 + .../identity-role-assignment/README.md | 3 + .../identity-role-assignment/index.ts | 250 + .../huaweicloud/identity-role/README.md | 3 + .../huaweicloud/identity-role/index.ts | 221 + .../identity-service-agency/README.md | 3 + .../identity-service-agency/index.ts | 318 + .../identity-trust-agency/README.md | 3 + .../identity-trust-agency/index.ts | 313 + .../identity-user-role-assignment/README.md | 3 + .../identity-user-role-assignment/index.ts | 191 + .../huaweicloud/identity-user-token/README.md | 3 + .../huaweicloud/identity-user-token/index.ts | 229 + .../huaweicloud/identity-user-v3/README.md | 3 + .../huaweicloud/identity-user-v3/index.ts | 464 + .../huaweicloud/identity-user/README.md | 3 + .../huaweicloud/identity-user/index.ts | 464 + .../identity-virtual-mfa-device/README.md | 3 + .../identity-virtual-mfa-device/index.ts | 176 + .../README.md | 3 + .../index.ts | 435 + .../README.md | 3 + .../index.ts | 197 + .../README.md | 3 + .../index.ts | 197 + .../identitycenter-group-membership/README.md | 3 + .../identitycenter-group-membership/index.ts | 225 + .../identitycenter-group/README.md | 3 + .../huaweicloud/identitycenter-group/index.ts | 238 + .../identitycenter-permission-set/README.md | 3 + .../identitycenter-permission-set/index.ts | 262 + .../README.md | 3 + .../index.ts | 277 + .../huaweicloud/identitycenter-user/README.md | 3 + .../huaweicloud/identitycenter-user/index.ts | 333 + .../providers/huaweicloud/iec-eip/README.md | 3 + .../providers/huaweicloud/iec-eip/index.ts | 452 + .../huaweicloud/iec-keypair/README.md | 3 + .../huaweicloud/iec-keypair/index.ts | 202 + .../iec-network-acl-rule/README.md | 3 + .../huaweicloud/iec-network-acl-rule/index.ts | 425 + .../huaweicloud/iec-network-acl/README.md | 3 + .../huaweicloud/iec-network-acl/index.ts | 547 ++ .../iec-security-group-rule/README.md | 3 + .../iec-security-group-rule/index.ts | 516 ++ .../huaweicloud/iec-security-group/README.md | 3 + .../huaweicloud/iec-security-group/index.ts | 452 + .../huaweicloud/iec-server/README.md | 3 + .../providers/huaweicloud/iec-server/index.ts | 1249 +++ .../providers/huaweicloud/iec-vip/README.md | 3 + .../providers/huaweicloud/iec-vip/index.ts | 364 + .../huaweicloud/iec-vpc-subnet/README.md | 3 + .../huaweicloud/iec-vpc-subnet/index.ts | 492 ++ .../providers/huaweicloud/iec-vpc/README.md | 3 + .../providers/huaweicloud/iec-vpc/index.ts | 384 + .../huaweicloud/images-image-copy/README.md | 3 + .../huaweicloud/images-image-copy/index.ts | 679 ++ .../images-image-share-accepter/README.md | 3 + .../images-image-share-accepter/index.ts | 358 + .../huaweicloud/images-image-share/README.md | 3 + .../huaweicloud/images-image-share/index.ts | 355 + .../huaweicloud/images-image-v2/README.md | 3 + .../huaweicloud/images-image-v2/index.ts | 613 ++ .../huaweicloud/images-image/README.md | 3 + .../huaweicloud/images-image/index.ts | 776 ++ .../huaweicloud/ims-cbr-whole-image/README.md | 3 + .../huaweicloud/ims-cbr-whole-image/index.ts | 564 ++ .../ims-ecs-system-image/README.md | 3 + .../huaweicloud/ims-ecs-system-image/index.ts | 541 ++ .../huaweicloud/ims-ecs-whole-image/README.md | 3 + .../huaweicloud/ims-ecs-whole-image/index.ts | 594 ++ .../huaweicloud/ims-evs-data-image/README.md | 3 + .../huaweicloud/ims-evs-data-image/index.ts | 485 ++ .../ims-evs-system-image/README.md | 3 + .../huaweicloud/ims-evs-system-image/index.ts | 594 ++ .../huaweicloud/ims-image-export/README.md | 3 + .../huaweicloud/ims-image-export/index.ts | 374 + .../huaweicloud/ims-obs-data-image/README.md | 3 + .../huaweicloud/ims-obs-data-image/index.ts | 556 ++ .../huaweicloud/ims-obs-iso-image/README.md | 3 + .../huaweicloud/ims-obs-iso-image/index.ts | 670 ++ .../ims-obs-system-image/README.md | 3 + .../huaweicloud/ims-obs-system-image/index.ts | 752 ++ src/constructs/providers/huaweicloud/index.ts | 1697 ++++ .../iotda-access-credential/README.md | 3 + .../iotda-access-credential/index.ts | 210 + .../huaweicloud/iotda-amqp/README.md | 3 + .../providers/huaweicloud/iotda-amqp/index.ts | 169 + .../iotda-batchtask-file/README.md | 3 + .../huaweicloud/iotda-batchtask-file/index.ts | 179 + .../huaweicloud/iotda-batchtask/README.md | 3 + .../huaweicloud/iotda-batchtask/index.ts | 828 ++ .../iotda-data-backlog-policy/README.md | 3 + .../iotda-data-backlog-policy/index.ts | 256 + .../iotda-data-flow-control-policy/README.md | 3 + .../iotda-data-flow-control-policy/index.ts | 284 + .../iotda-dataforwarding-rule/README.md | 3 + .../iotda-dataforwarding-rule/index.ts | 1707 ++++ .../iotda-device-async-command/README.md | 3 + .../iotda-device-async-command/index.ts | 337 + .../iotda-device-certificate/README.md | 3 + .../iotda-device-certificate/index.ts | 255 + .../huaweicloud/iotda-device-group/README.md | 3 + .../huaweicloud/iotda-device-group/index.ts | 334 + .../iotda-device-linkage-rule/README.md | 3 + .../iotda-device-linkage-rule/index.ts | 2471 ++++++ .../iotda-device-message/README.md | 3 + .../huaweicloud/iotda-device-message/index.ts | 822 ++ .../huaweicloud/iotda-device-proxy/README.md | 3 + .../huaweicloud/iotda-device-proxy/index.ts | 363 + .../huaweicloud/iotda-device/README.md | 3 + .../huaweicloud/iotda-device/index.ts | 768 ++ .../huaweicloud/iotda-product/README.md | 3 + .../huaweicloud/iotda-product/index.ts | 2229 +++++ .../huaweicloud/iotda-space/README.md | 3 + .../huaweicloud/iotda-space/index.ts | 174 + .../iotda-upgrade-package/README.md | 3 + .../iotda-upgrade-package/index.ts | 652 ++ .../kms-data-encrypt-decrypt/README.md | 3 + .../kms-data-encrypt-decrypt/index.ts | 296 + .../kms-dedicated-keystore/README.md | 3 + .../kms-dedicated-keystore/index.ts | 225 + .../providers/huaweicloud/kms-grant/README.md | 3 + .../providers/huaweicloud/kms-grant/index.ts | 321 + .../huaweicloud/kms-key-material/README.md | 3 + .../huaweicloud/kms-key-material/index.ts | 285 + .../huaweicloud/kms-key-v1/README.md | 3 + .../providers/huaweicloud/kms-key-v1/index.ts | 517 ++ .../providers/huaweicloud/kms-key/README.md | 3 + .../providers/huaweicloud/kms-key/index.ts | 517 ++ .../huaweicloud/kps-keypair/README.md | 3 + .../huaweicloud/kps-keypair/index.ts | 626 ++ .../providers/huaweicloud/lazy-index.ts | 1697 ++++ .../huaweicloud/lb-certificate-v2/README.md | 3 + .../huaweicloud/lb-certificate-v2/index.ts | 542 ++ .../huaweicloud/lb-certificate/README.md | 3 + .../huaweicloud/lb-certificate/index.ts | 542 ++ .../huaweicloud/lb-l7policy-v2/README.md | 3 + .../huaweicloud/lb-l7policy-v2/index.ts | 580 ++ .../huaweicloud/lb-l7policy/README.md | 3 + .../huaweicloud/lb-l7policy/index.ts | 580 ++ .../huaweicloud/lb-l7rule-v2/README.md | 3 + .../huaweicloud/lb-l7rule-v2/index.ts | 523 ++ .../providers/huaweicloud/lb-l7rule/README.md | 3 + .../providers/huaweicloud/lb-l7rule/index.ts | 523 ++ .../huaweicloud/lb-listener-v2/README.md | 3 + .../huaweicloud/lb-listener-v2/index.ts | 689 ++ .../huaweicloud/lb-listener/README.md | 3 + .../huaweicloud/lb-listener/index.ts | 689 ++ .../huaweicloud/lb-loadbalancer-v2/README.md | 3 + .../huaweicloud/lb-loadbalancer-v2/index.ts | 847 ++ .../huaweicloud/lb-loadbalancer/README.md | 3 + .../huaweicloud/lb-loadbalancer/index.ts | 847 ++ .../huaweicloud/lb-member-v2/README.md | 3 + .../huaweicloud/lb-member-v2/index.ts | 560 ++ .../providers/huaweicloud/lb-member/README.md | 3 + .../providers/huaweicloud/lb-member/index.ts | 560 ++ .../huaweicloud/lb-monitor-v2/README.md | 3 + .../huaweicloud/lb-monitor-v2/index.ts | 655 ++ .../huaweicloud/lb-monitor/README.md | 3 + .../providers/huaweicloud/lb-monitor/index.ts | 655 ++ .../huaweicloud/lb-pool-v2/README.md | 3 + .../providers/huaweicloud/lb-pool-v2/index.ts | 822 ++ .../providers/huaweicloud/lb-pool/README.md | 3 + .../providers/huaweicloud/lb-pool/index.ts | 822 ++ .../huaweicloud/lb-whitelist-v2/README.md | 3 + .../huaweicloud/lb-whitelist-v2/index.ts | 443 + .../huaweicloud/lb-whitelist/README.md | 3 + .../huaweicloud/lb-whitelist/index.ts | 443 + .../live-bucket-authorization/README.md | 3 + .../live-bucket-authorization/index.ts | 171 + .../huaweicloud/live-domain/README.md | 3 + .../huaweicloud/live-domain/index.ts | 445 + .../live-record-callback/README.md | 3 + .../huaweicloud/live-record-callback/index.ts | 219 + .../huaweicloud/live-recording/README.md | 3 + .../huaweicloud/live-recording/index.ts | 982 +++ .../huaweicloud/live-snapshot/README.md | 3 + .../huaweicloud/live-snapshot/index.ts | 396 + .../huaweicloud/live-transcoding/README.md | 3 + .../huaweicloud/live-transcoding/index.ts | 510 ++ .../huaweicloud/lts-access-rule/README.md | 3 + .../huaweicloud/lts-access-rule/index.ts | 649 ++ .../huaweicloud/lts-aom-access/README.md | 3 + .../huaweicloud/lts-aom-access/index.ts | 579 ++ .../huaweicloud/lts-cce-access/README.md | 3 + .../huaweicloud/lts-cce-access/index.ts | 1561 ++++ .../lts-cross-account-access/README.md | 3 + .../lts-cross-account-access/index.ts | 506 ++ .../huaweicloud/lts-dashboard/README.md | 3 + .../huaweicloud/lts-dashboard/index.ts | 437 + .../providers/huaweicloud/lts-group/README.md | 3 + .../providers/huaweicloud/lts-group/index.ts | 257 + .../huaweicloud/lts-host-access/README.md | 3 + .../huaweicloud/lts-host-access/index.ts | 932 ++ .../huaweicloud/lts-host-group/README.md | 3 + .../huaweicloud/lts-host-group/index.ts | 326 + .../lts-keywords-alarm-rule/README.md | 3 + .../lts-keywords-alarm-rule/index.ts | 1506 ++++ .../lts-log-converge-switch/README.md | 3 + .../lts-log-converge-switch/index.ts | 144 + .../huaweicloud/lts-log-converge/README.md | 3 + .../huaweicloud/lts-log-converge/index.ts | 918 ++ .../lts-notification-template/README.md | 3 + .../lts-notification-template/index.ts | 429 + .../huaweicloud/lts-search-criteria/README.md | 3 + .../huaweicloud/lts-search-criteria/index.ts | 297 + .../huaweicloud/lts-sql-alarm-rule/README.md | 3 + .../huaweicloud/lts-sql-alarm-rule/index.ts | 1533 ++++ .../huaweicloud/lts-stream/README.md | 3 + .../providers/huaweicloud/lts-stream/index.ts | 288 + .../huaweicloud/lts-struct-template/README.md | 3 + .../huaweicloud/lts-struct-template/index.ts | 892 ++ .../lts-structing-template/README.md | 3 + .../lts-structing-template/index.ts | 677 ++ .../lts-structuring-configuration/README.md | 3 + .../lts-structuring-configuration/index.ts | 677 ++ .../README.md | 3 + .../index.ts | 842 ++ .../huaweicloud/lts-transfer/README.md | 3 + .../huaweicloud/lts-transfer/index.ts | 1416 +++ .../huaweicloud/lts-waf-access/README.md | 3 + .../huaweicloud/lts-waf-access/index.ts | 261 + .../huaweicloud/mapreduce-cluster/README.md | 3 + .../huaweicloud/mapreduce-cluster/index.ts | 4125 +++++++++ .../mapreduce-data-connection/README.md | 3 + .../mapreduce-data-connection/index.ts | 414 + .../huaweicloud/mapreduce-job/README.md | 3 + .../huaweicloud/mapreduce-job/index.ts | 503 ++ .../mapreduce-scaling-policy/README.md | 3 + .../mapreduce-scaling-policy/index.ts | 1387 +++ .../meeting-admin-assignment/README.md | 3 + .../meeting-admin-assignment/index.ts | 253 + .../huaweicloud/meeting-conference/README.md | 3 + .../huaweicloud/meeting-conference/index.ts | 2263 +++++ .../huaweicloud/meeting-user/README.md | 3 + .../huaweicloud/meeting-user/index.ts | 774 ++ .../modelarts-authorization/README.md | 3 + .../modelarts-authorization/index.ts | 230 + .../modelarts-dataset-version/README.md | 3 + .../modelarts-dataset-version/index.ts | 447 + .../huaweicloud/modelarts-dataset/README.md | 3 + .../huaweicloud/modelarts-dataset/index.ts | 1417 +++ .../huaweicloud/modelarts-model/README.md | 3 + .../huaweicloud/modelarts-model/index.ts | 1648 ++++ .../huaweicloud/modelarts-network/README.md | 3 + .../huaweicloud/modelarts-network/index.ts | 600 ++ .../README.md | 3 + .../modelarts-notebook-mount-storage/index.ts | 234 + .../huaweicloud/modelarts-notebook/README.md | 3 + .../huaweicloud/modelarts-notebook/index.ts | 788 ++ .../modelarts-resource-pool/README.md | 3 + .../modelarts-resource-pool/index.ts | 1851 ++++ .../huaweicloud/modelarts-service/README.md | 3 + .../huaweicloud/modelarts-service/index.ts | 1974 +++++ .../huaweicloud/modelarts-workspace/README.md | 3 + .../huaweicloud/modelarts-workspace/index.ts | 578 ++ .../mpc-transcoding-template-group/README.md | 3 + .../mpc-transcoding-template-group/index.ts | 1145 +++ .../mpc-transcoding-template/README.md | 3 + .../mpc-transcoding-template/index.ts | 1027 +++ .../huaweicloud/mrs-cluster-v1/README.md | 3 + .../huaweicloud/mrs-cluster-v1/index.ts | 1571 ++++ .../huaweicloud/mrs-cluster/README.md | 3 + .../huaweicloud/mrs-cluster/index.ts | 1571 ++++ .../huaweicloud/mrs-job-v1/README.md | 3 + .../providers/huaweicloud/mrs-job-v1/index.ts | 635 ++ .../providers/huaweicloud/mrs-job/README.md | 3 + .../providers/huaweicloud/mrs-job/index.ts | 635 ++ .../huaweicloud/nat-dnat-rule-v2/README.md | 3 + .../huaweicloud/nat-dnat-rule-v2/index.ts | 680 ++ .../huaweicloud/nat-dnat-rule/README.md | 3 + .../huaweicloud/nat-dnat-rule/index.ts | 680 ++ .../huaweicloud/nat-gateway-v2/README.md | 3 + .../huaweicloud/nat-gateway-v2/index.ts | 679 ++ .../huaweicloud/nat-gateway/README.md | 3 + .../huaweicloud/nat-gateway/index.ts | 679 ++ .../nat-private-dnat-rule/README.md | 3 + .../nat-private-dnat-rule/index.ts | 400 + .../huaweicloud/nat-private-gateway/README.md | 3 + .../huaweicloud/nat-private-gateway/index.ts | 338 + .../nat-private-snat-rule/README.md | 3 + .../nat-private-snat-rule/index.ts | 310 + .../nat-private-transit-ip/README.md | 3 + .../nat-private-transit-ip/index.ts | 281 + .../huaweicloud/nat-snat-rule-v2/README.md | 3 + .../huaweicloud/nat-snat-rule-v2/index.ts | 586 ++ .../huaweicloud/nat-snat-rule/README.md | 3 + .../huaweicloud/nat-snat-rule/index.ts | 586 ++ .../huaweicloud/network-acl-rule/README.md | 3 + .../huaweicloud/network-acl-rule/index.ts | 418 + .../huaweicloud/network-acl/README.md | 3 + .../huaweicloud/network-acl/index.ts | 491 ++ .../networking-eip-associate/README.md | 3 + .../networking-eip-associate/index.ts | 425 + .../networking-floatingip-v2/README.md | 3 + .../networking-floatingip-v2/index.ts | 446 + .../networking-network-v2/README.md | 3 + .../networking-network-v2/index.ts | 653 ++ .../huaweicloud/networking-port-v2/README.md | 3 + .../huaweicloud/networking-port-v2/index.ts | 1146 +++ .../huaweicloud/networking-port/README.md | 3 + .../huaweicloud/networking-port/index.ts | 1146 +++ .../networking-router-interface-v2/README.md | 3 + .../networking-router-interface-v2/index.ts | 382 + .../networking-router-route-v2/README.md | 3 + .../networking-router-route-v2/index.ts | 219 + .../networking-router-v2/README.md | 3 + .../huaweicloud/networking-router-v2/index.ts | 676 ++ .../networking-secgroup-rule-v2/README.md | 3 + .../networking-secgroup-rule-v2/index.ts | 623 ++ .../networking-secgroup-rule/README.md | 3 + .../networking-secgroup-rule/index.ts | 623 ++ .../networking-secgroup-v2/README.md | 3 + .../networking-secgroup-v2/index.ts | 556 ++ .../huaweicloud/networking-secgroup/README.md | 3 + .../huaweicloud/networking-secgroup/index.ts | 556 ++ .../networking-subnet-v2/README.md | 3 + .../huaweicloud/networking-subnet-v2/index.ts | 977 +++ .../networking-vip-associate-v2/README.md | 3 + .../networking-vip-associate-v2/index.ts | 209 + .../networking-vip-associate/README.md | 3 + .../networking-vip-associate/index.ts | 209 + .../huaweicloud/networking-vip-v2/README.md | 3 + .../huaweicloud/networking-vip-v2/index.ts | 453 + .../huaweicloud/networking-vip/README.md | 3 + .../huaweicloud/networking-vip/index.ts | 453 + .../huaweicloud/obs-bucket-acl/README.md | 3 + .../huaweicloud/obs-bucket-acl/index.ts | 840 ++ .../obs-bucket-object-acl/README.md | 3 + .../obs-bucket-object-acl/index.ts | 651 ++ .../huaweicloud/obs-bucket-object/README.md | 3 + .../huaweicloud/obs-bucket-object/index.ts | 428 + .../huaweicloud/obs-bucket-policy/README.md | 3 + .../huaweicloud/obs-bucket-policy/index.ts | 222 + .../obs-bucket-replication/README.md | 3 + .../obs-bucket-replication/index.ts | 469 + .../huaweicloud/obs-bucket/README.md | 3 + .../providers/huaweicloud/obs-bucket/index.ts | 2415 ++++++ .../oms-migration-sync-task/README.md | 3 + .../oms-migration-sync-task/index.ts | 800 ++ .../oms-migration-task-group/README.md | 3 + .../oms-migration-task-group/index.ts | 1673 ++++ .../huaweicloud/oms-migration-task/README.md | 3 + .../huaweicloud/oms-migration-task/index.ts | 1766 ++++ .../providers/huaweicloud/oms-task/README.md | 3 + .../providers/huaweicloud/oms-task/index.ts | 1019 +++ .../organizations-account-associate/README.md | 3 + .../organizations-account-associate/index.ts | 190 + .../README.md | 3 + .../index.ts | 213 + .../README.md | 3 + .../index.ts | 143 + .../organizations-account-invite/README.md | 3 + .../organizations-account-invite/index.ts | 208 + .../organizations-account/README.md | 3 + .../organizations-account/index.ts | 455 + .../README.md | 3 + .../index.ts | 170 + .../organizations-organization/README.md | 3 + .../organizations-organization/index.ts | 366 + .../README.md | 3 + .../index.ts | 209 + .../organizations-policy-attach/README.md | 3 + .../organizations-policy-attach/index.ts | 180 + .../organizations-policy/README.md | 3 + .../huaweicloud/organizations-policy/index.ts | 260 + .../organizations-trusted-service/README.md | 3 + .../organizations-trusted-service/index.ts | 148 + .../huaweicloud/projectman-project/README.md | 3 + .../huaweicloud/projectman-project/index.ts | 333 + .../providers/huaweicloud/provider/README.md | 3 + .../providers/huaweicloud/provider/index.ts | 1103 +++ .../huaweicloud/ram-organization/README.md | 3 + .../huaweicloud/ram-organization/index.ts | 143 + .../ram-resource-share-accepter/README.md | 3 + .../ram-resource-share-accepter/index.ts | 166 + .../huaweicloud/ram-resource-share/README.md | 3 + .../huaweicloud/ram-resource-share/index.ts | 431 + .../huaweicloud/rds-account/README.md | 3 + .../huaweicloud/rds-account/index.ts | 475 + .../huaweicloud/rds-backup/README.md | 3 + .../providers/huaweicloud/rds-backup/index.ts | 555 ++ .../README.md | 3 + .../rds-cross-region-backup-strategy/index.ts | 469 + .../rds-database-logs-shrinking/README.md | 3 + .../rds-database-logs-shrinking/index.ts | 198 + .../rds-database-privilege/README.md | 3 + .../rds-database-privilege/index.ts | 565 ++ .../huaweicloud/rds-database/README.md | 3 + .../huaweicloud/rds-database/index.ts | 445 + .../huaweicloud/rds-extend-log-link/README.md | 3 + .../huaweicloud/rds-extend-log-link/index.ts | 342 + .../rds-instance-eip-associate/README.md | 3 + .../rds-instance-eip-associate/index.ts | 376 + .../huaweicloud/rds-instance-v3/README.md | 3 + .../huaweicloud/rds-instance-v3/index.ts | 2661 ++++++ .../huaweicloud/rds-instance/README.md | 3 + .../huaweicloud/rds-instance/index.ts | 2661 ++++++ .../huaweicloud/rds-lts-log/README.md | 3 + .../huaweicloud/rds-lts-log/index.ts | 436 + .../huaweicloud/rds-mysql-account/README.md | 3 + .../huaweicloud/rds-mysql-account/index.ts | 475 + .../huaweicloud/rds-mysql-binlog/README.md | 3 + .../huaweicloud/rds-mysql-binlog/index.ts | 194 + .../rds-mysql-database-privilege/README.md | 3 + .../rds-mysql-database-privilege/index.ts | 565 ++ .../README.md | 3 + .../rds-mysql-database-table-restore/index.ts | 853 ++ .../huaweicloud/rds-mysql-database/README.md | 3 + .../huaweicloud/rds-mysql-database/index.ts | 445 + .../rds-mysql-proxy-restart/README.md | 3 + .../rds-mysql-proxy-restart/index.ts | 318 + .../huaweicloud/rds-mysql-proxy/README.md | 3 + .../huaweicloud/rds-mysql-proxy/index.ts | 1042 +++ .../rds-parametergroup-v3/README.md | 3 + .../rds-parametergroup-v3/index.ts | 641 ++ .../huaweicloud/rds-parametergroup/README.md | 3 + .../huaweicloud/rds-parametergroup/index.ts | 641 ++ .../rds-pg-account-privileges/README.md | 3 + .../rds-pg-account-privileges/index.ts | 448 + .../rds-pg-account-roles/README.md | 3 + .../huaweicloud/rds-pg-account-roles/index.ts | 415 + .../huaweicloud/rds-pg-account/README.md | 3 + .../huaweicloud/rds-pg-account/index.ts | 591 ++ .../rds-pg-database-privilege/README.md | 3 + .../rds-pg-database-privilege/index.ts | 561 ++ .../huaweicloud/rds-pg-database/README.md | 3 + .../huaweicloud/rds-pg-database/index.ts | 603 ++ .../huaweicloud/rds-pg-hba/README.md | 3 + .../providers/huaweicloud/rds-pg-hba/index.ts | 476 + .../rds-pg-plugin-parameter/README.md | 3 + .../rds-pg-plugin-parameter/index.ts | 392 + .../rds-pg-plugin-update/README.md | 3 + .../huaweicloud/rds-pg-plugin-update/index.ts | 225 + .../huaweicloud/rds-pg-plugin/README.md | 3 + .../huaweicloud/rds-pg-plugin/index.ts | 391 + .../huaweicloud/rds-pg-sql-limit/README.md | 3 + .../huaweicloud/rds-pg-sql-limit/index.ts | 572 ++ .../rds-primary-standby-switch/README.md | 3 + .../rds-primary-standby-switch/index.ts | 325 + .../rds-read-replica-instance/README.md | 3 + .../rds-read-replica-instance/index.ts | 1344 +++ .../rds-recycling-policy/README.md | 3 + .../huaweicloud/rds-recycling-policy/index.ts | 174 + .../huaweicloud/rds-restore/README.md | 3 + .../huaweicloud/rds-restore/index.ts | 442 + .../huaweicloud/rds-sql-audit/README.md | 3 + .../huaweicloud/rds-sql-audit/index.ts | 449 + .../rds-sqlserver-account/README.md | 3 + .../rds-sqlserver-account/index.ts | 420 + .../README.md | 3 + .../rds-sqlserver-database-privilege/index.ts | 565 ++ .../rds-sqlserver-database/README.md | 3 + .../rds-sqlserver-database/index.ts | 398 + .../providers/huaweicloud/rf-stack/README.md | 3 + .../providers/huaweicloud/rf-stack/index.ts | 801 ++ .../huaweicloud/rfs-execution-plan/README.md | 3 + .../huaweicloud/rfs-execution-plan/index.ts | 378 + .../huaweicloud/rfs-private-hook/README.md | 3 + .../huaweicloud/rfs-private-hook/index.ts | 511 ++ .../providers/huaweicloud/rfs-stack/README.md | 3 + .../providers/huaweicloud/rfs-stack/index.ts | 801 ++ .../huaweicloud/rgc-account/README.md | 3 + .../huaweicloud/rgc-account/index.ts | 679 ++ .../huaweicloud/rms-advanced-query/README.md | 3 + .../huaweicloud/rms-advanced-query/index.ts | 200 + .../rms-assignment-package/README.md | 3 + .../rms-assignment-package/index.ts | 623 ++ .../README.md | 3 + .../index.ts | 650 ++ .../README.md | 3 + .../index.ts | 851 ++ .../rms-policy-assignment-evaluate/README.md | 3 + .../rms-policy-assignment-evaluate/index.ts | 143 + .../rms-policy-assignment/README.md | 3 + .../rms-policy-assignment/index.ts | 964 +++ .../rms-remediation-configuration/README.md | 3 + .../rms-remediation-configuration/index.ts | 685 ++ .../rms-remediation-exception/README.md | 3 + .../rms-remediation-exception/index.ts | 360 + .../rms-remediation-execution/README.md | 3 + .../rms-remediation-execution/index.ts | 470 + .../README.md | 3 + .../index.ts | 153 + .../rms-resource-aggregator/README.md | 3 + .../rms-resource-aggregator/index.ts | 205 + .../rms-resource-recorder/README.md | 3 + .../rms-resource-recorder/index.ts | 616 ++ .../huaweicloud/scm-certificate/README.md | 3 + .../huaweicloud/scm-certificate/index.ts | 633 ++ .../huaweicloud/sdrs-drill/README.md | 3 + .../providers/huaweicloud/sdrs-drill/index.ts | 384 + .../sdrs-protected-instance/README.md | 3 + .../sdrs-protected-instance/index.ts | 577 ++ .../sdrs-protection-group/README.md | 3 + .../sdrs-protection-group/index.ts | 560 ++ .../sdrs-replication-attach/README.md | 3 + .../sdrs-replication-attach/index.ts | 381 + .../sdrs-replication-pair/README.md | 3 + .../sdrs-replication-pair/index.ts | 452 + .../secmaster-alert-rule/README.md | 3 + .../huaweicloud/secmaster-alert-rule/index.ts | 1220 +++ .../huaweicloud/secmaster-alert/README.md | 3 + .../huaweicloud/secmaster-alert/index.ts | 864 ++ .../secmaster-data-object-relations/README.md | 3 + .../secmaster-data-object-relations/index.ts | 307 + .../huaweicloud/secmaster-incident/README.md | 3 + .../huaweicloud/secmaster-incident/index.ts | 907 ++ .../huaweicloud/secmaster-indicator/README.md | 3 + .../huaweicloud/secmaster-indicator/index.ts | 808 ++ .../secmaster-playbook-action/README.md | 3 + .../secmaster-playbook-action/index.ts | 360 + .../secmaster-playbook-approval/README.md | 3 + .../secmaster-playbook-approval/index.ts | 258 + .../secmaster-playbook-enable/README.md | 3 + .../secmaster-playbook-enable/index.ts | 252 + .../README.md | 3 + .../index.ts | 225 + .../secmaster-playbook-rule/README.md | 3 + .../secmaster-playbook-rule/index.ts | 726 ++ .../README.md | 3 + .../index.ts | 353 + .../secmaster-playbook-version/README.md | 3 + .../secmaster-playbook-version/index.ts | 515 ++ .../huaweicloud/secmaster-playbook/README.md | 3 + .../huaweicloud/secmaster-playbook/index.ts | 346 + .../servicestage-application/README.md | 3 + .../servicestage-application/index.ts | 551 ++ .../servicestage-component-instance/README.md | 3 + .../servicestage-component-instance/index.ts | 5470 ++++++++++++ .../servicestage-component/README.md | 3 + .../servicestage-component/index.ts | 1069 +++ .../servicestage-environment/README.md | 3 + .../servicestage-environment/index.ts | 599 ++ .../README.md | 3 + .../index.ts | 244 + .../README.md | 3 + .../index.ts | 244 + .../servicestagev3-application/README.md | 3 + .../servicestagev3-application/index.ts | 278 + .../servicestagev3-component/README.md | 3 + .../servicestagev3-component/index.ts | 4925 +++++++++++ .../README.md | 3 + .../index.ts | 350 + .../servicestagev3-environment/README.md | 3 + .../servicestagev3-environment/index.ts | 335 + .../huaweicloud/sfs-access-rule-v2/README.md | 3 + .../huaweicloud/sfs-access-rule-v2/index.ts | 412 + .../huaweicloud/sfs-access-rule/README.md | 3 + .../huaweicloud/sfs-access-rule/index.ts | 412 + .../huaweicloud/sfs-file-system-v2/README.md | 3 + .../huaweicloud/sfs-file-system-v2/index.ts | 755 ++ .../huaweicloud/sfs-file-system/README.md | 3 + .../huaweicloud/sfs-file-system/index.ts | 755 ++ .../huaweicloud/sfs-turbo-data-task/README.md | 3 + .../huaweicloud/sfs-turbo-data-task/index.ts | 444 + .../huaweicloud/sfs-turbo-dir-quota/README.md | 3 + .../huaweicloud/sfs-turbo-dir-quota/index.ts | 268 + .../huaweicloud/sfs-turbo-dir/README.md | 3 + .../huaweicloud/sfs-turbo-dir/index.ts | 288 + .../huaweicloud/sfs-turbo-du-task/README.md | 3 + .../huaweicloud/sfs-turbo-du-task/index.ts | 411 + .../sfs-turbo-obs-target/README.md | 3 + .../huaweicloud/sfs-turbo-obs-target/index.ts | 527 ++ .../huaweicloud/sfs-turbo-perm-rule/README.md | 3 + .../huaweicloud/sfs-turbo-perm-rule/index.ts | 244 + .../providers/huaweicloud/sfs-turbo/README.md | 3 + .../providers/huaweicloud/sfs-turbo/index.ts | 924 ++ .../huaweicloud/smn-logtank/README.md | 3 + .../huaweicloud/smn-logtank/index.ts | 234 + .../smn-message-detection/README.md | 3 + .../smn-message-detection/index.ts | 412 + .../huaweicloud/smn-message-publish/README.md | 3 + .../huaweicloud/smn-message-publish/index.ts | 626 ++ .../smn-message-template/README.md | 3 + .../huaweicloud/smn-message-template/index.ts | 230 + .../smn-subscription-filter-policy/README.md | 3 + .../smn-subscription-filter-policy/index.ts | 373 + .../huaweicloud/smn-subscription-v2/README.md | 3 + .../huaweicloud/smn-subscription-v2/index.ts | 561 ++ .../huaweicloud/smn-subscription/README.md | 3 + .../huaweicloud/smn-subscription/index.ts | 561 ++ .../huaweicloud/smn-topic-v2/README.md | 3 + .../huaweicloud/smn-topic-v2/index.ts | 387 + .../providers/huaweicloud/smn-topic/README.md | 3 + .../providers/huaweicloud/smn-topic/index.ts | 387 + .../huaweicloud/sms-server-template/README.md | 3 + .../huaweicloud/sms-server-template/index.ts | 613 ++ .../providers/huaweicloud/sms-task/README.md | 3 + .../providers/huaweicloud/sms-task/index.ts | 1288 +++ .../huaweicloud/swr-image-auto-sync/README.md | 3 + .../huaweicloud/swr-image-auto-sync/index.ts | 292 + .../swr-image-permissions/README.md | 3 + .../swr-image-permissions/index.ts | 498 ++ .../swr-image-retention-policy/README.md | 3 + .../swr-image-retention-policy/index.ts | 435 + .../huaweicloud/swr-image-trigger/README.md | 3 + .../huaweicloud/swr-image-trigger/index.ts | 520 ++ .../swr-organization-permissions/README.md | 3 + .../swr-organization-permissions/index.ts | 625 ++ .../huaweicloud/swr-organization/README.md | 3 + .../huaweicloud/swr-organization/index.ts | 341 + .../swr-repository-sharing/README.md | 3 + .../swr-repository-sharing/index.ts | 429 + .../huaweicloud/swr-repository/README.md | 3 + .../huaweicloud/swr-repository/index.ts | 493 ++ .../huaweicloud/tms-resource-tags/README.md | 3 + .../huaweicloud/tms-resource-tags/index.ts | 347 + .../providers/huaweicloud/tms-tags/README.md | 3 + .../providers/huaweicloud/tms-tags/index.ts | 443 + .../huaweicloud/ucs-cluster/README.md | 3 + .../huaweicloud/ucs-cluster/index.ts | 475 + .../providers/huaweicloud/ucs-fleet/README.md | 3 + .../providers/huaweicloud/ucs-fleet/index.ts | 361 + .../huaweicloud/ucs-policy/README.md | 3 + .../providers/huaweicloud/ucs-policy/index.ts | 420 + .../vbs-backup-policy-v2/README.md | 3 + .../huaweicloud/vbs-backup-policy-v2/index.ts | 722 ++ .../huaweicloud/vbs-backup-policy/README.md | 3 + .../huaweicloud/vbs-backup-policy/index.ts | 722 ++ .../huaweicloud/vbs-backup-v2/README.md | 3 + .../huaweicloud/vbs-backup-v2/index.ts | 615 ++ .../huaweicloud/vbs-backup/README.md | 3 + .../providers/huaweicloud/vbs-backup/index.ts | 615 ++ .../huaweicloud/vod-media-asset/README.md | 3 + .../huaweicloud/vod-media-asset/index.ts | 938 ++ .../huaweicloud/vod-media-category/README.md | 3 + .../huaweicloud/vod-media-category/index.ts | 202 + .../vod-transcoding-template-group/README.md | 3 + .../vod-transcoding-template-group/index.ts | 965 +++ .../vod-watermark-template/README.md | 3 + .../vod-watermark-template/index.ts | 577 ++ .../huaweicloud/vpc-address-group/README.md | 3 + .../huaweicloud/vpc-address-group/index.ts | 703 ++ .../vpc-bandwidth-associate/README.md | 3 + .../vpc-bandwidth-associate/index.ts | 264 + .../huaweicloud/vpc-bandwidth-v2/README.md | 3 + .../huaweicloud/vpc-bandwidth-v2/index.ts | 724 ++ .../huaweicloud/vpc-bandwidth/README.md | 3 + .../huaweicloud/vpc-bandwidth/index.ts | 724 ++ .../huaweicloud/vpc-eip-associate/README.md | 3 + .../huaweicloud/vpc-eip-associate/index.ts | 425 + .../huaweicloud/vpc-eip-v1/README.md | 3 + .../providers/huaweicloud/vpc-eip-v1/index.ts | 1090 +++ .../providers/huaweicloud/vpc-eip/README.md | 3 + .../providers/huaweicloud/vpc-eip/index.ts | 1090 +++ .../huaweicloud/vpc-eipv3-associate/README.md | 3 + .../huaweicloud/vpc-eipv3-associate/index.ts | 219 + .../huaweicloud/vpc-flow-log/README.md | 3 + .../huaweicloud/vpc-flow-log/index.ts | 358 + .../vpc-internet-gateway/README.md | 3 + .../huaweicloud/vpc-internet-gateway/index.ts | 291 + .../huaweicloud/vpc-network-acl/README.md | 3 + .../huaweicloud/vpc-network-acl/index.ts | 1380 +++ .../vpc-network-interface/README.md | 3 + .../vpc-network-interface/index.ts | 364 + .../README.md | 3 + .../index.ts | 384 + .../vpc-peering-connection-accepter/README.md | 3 + .../vpc-peering-connection-accepter/index.ts | 384 + .../vpc-peering-connection-v2/README.md | 3 + .../vpc-peering-connection-v2/index.ts | 437 + .../vpc-peering-connection/README.md | 3 + .../vpc-peering-connection/index.ts | 437 + .../huaweicloud/vpc-route-table/README.md | 3 + .../huaweicloud/vpc-route-table/index.ts | 643 ++ .../huaweicloud/vpc-route-v2/README.md | 3 + .../huaweicloud/vpc-route-v2/index.ts | 401 + .../providers/huaweicloud/vpc-route/README.md | 3 + .../providers/huaweicloud/vpc-route/index.ts | 462 + .../vpc-sub-network-interface/README.md | 3 + .../vpc-sub-network-interface/index.ts | 387 + .../huaweicloud/vpc-subnet-v1/README.md | 3 + .../huaweicloud/vpc-subnet-v1/index.ts | 708 ++ .../huaweicloud/vpc-subnet/README.md | 3 + .../providers/huaweicloud/vpc-subnet/index.ts | 708 ++ .../vpc-traffic-mirror-filter-rule/README.md | 3 + .../vpc-traffic-mirror-filter-rule/index.ts | 444 + .../vpc-traffic-mirror-filter/README.md | 3 + .../vpc-traffic-mirror-filter/index.ts | 207 + .../vpc-traffic-mirror-session/README.md | 3 + .../vpc-traffic-mirror-session/index.ts | 444 + .../providers/huaweicloud/vpc-v1/README.md | 3 + .../providers/huaweicloud/vpc-v1/index.ts | 584 ++ .../providers/huaweicloud/vpc/README.md | 3 + .../providers/huaweicloud/vpc/index.ts | 584 ++ .../huaweicloud/vpcep-approval/README.md | 3 + .../huaweicloud/vpcep-approval/index.ts | 452 + .../huaweicloud/vpcep-endpoint/README.md | 3 + .../huaweicloud/vpcep-endpoint/index.ts | 714 ++ .../huaweicloud/vpcep-service/README.md | 3 + .../huaweicloud/vpcep-service/index.ts | 1070 +++ .../huaweicloud/vpn-access-policy/README.md | 3 + .../huaweicloud/vpn-access-policy/index.ts | 297 + .../vpn-client-ca-certificate/README.md | 3 + .../vpn-client-ca-certificate/index.ts | 450 + .../vpn-connection-health-check/README.md | 3 + .../vpn-connection-health-check/index.ts | 186 + .../huaweicloud/vpn-connection/README.md | 3 + .../huaweicloud/vpn-connection/index.ts | 1918 +++++ .../vpn-customer-gateway/README.md | 3 + .../huaweicloud/vpn-customer-gateway/index.ts | 422 + .../huaweicloud/vpn-gateway/README.md | 3 + .../huaweicloud/vpn-gateway/index.ts | 2298 +++++ .../huaweicloud/vpn-user-group/README.md | 3 + .../huaweicloud/vpn-user-group/index.ts | 406 + .../providers/huaweicloud/vpn-user/README.md | 3 + .../providers/huaweicloud/vpn-user/index.ts | 300 + .../vpnaas-endpoint-group-v2/README.md | 3 + .../vpnaas-endpoint-group-v2/index.ts | 502 ++ .../vpnaas-endpoint-group/README.md | 3 + .../vpnaas-endpoint-group/index.ts | 502 ++ .../vpnaas-ike-policy-v2/README.md | 3 + .../huaweicloud/vpnaas-ike-policy-v2/index.ts | 699 ++ .../huaweicloud/vpnaas-ike-policy/README.md | 3 + .../huaweicloud/vpnaas-ike-policy/index.ts | 699 ++ .../vpnaas-ipsec-policy-v2/README.md | 3 + .../vpnaas-ipsec-policy-v2/index.ts | 699 ++ .../huaweicloud/vpnaas-ipsec-policy/README.md | 3 + .../huaweicloud/vpnaas-ipsec-policy/index.ts | 699 ++ .../huaweicloud/vpnaas-service-v2/README.md | 3 + .../huaweicloud/vpnaas-service-v2/index.ts | 542 ++ .../huaweicloud/vpnaas-service/README.md | 3 + .../huaweicloud/vpnaas-service/index.ts | 542 ++ .../vpnaas-site-connection-v2/README.md | 3 + .../vpnaas-site-connection-v2/index.ts | 1032 +++ .../vpnaas-site-connection/README.md | 3 + .../vpnaas-site-connection/index.ts | 1032 +++ .../huaweicloud/waf-address-group/README.md | 3 + .../huaweicloud/waf-address-group/index.ts | 354 + .../huaweicloud/waf-certificate/README.md | 3 + .../huaweicloud/waf-certificate/index.ts | 419 + .../huaweicloud/waf-cloud-instance/README.md | 3 + .../huaweicloud/waf-cloud-instance/index.ts | 890 ++ .../waf-dedicated-domain/README.md | 3 + .../huaweicloud/waf-dedicated-domain/index.ts | 1727 ++++ .../waf-dedicated-instance/README.md | 3 + .../waf-dedicated-instance/index.ts | 646 ++ .../huaweicloud/waf-domain/README.md | 3 + .../providers/huaweicloud/waf-domain/index.ts | 1545 ++++ .../waf-instance-group-associate/README.md | 3 + .../waf-instance-group-associate/index.ts | 194 + .../huaweicloud/waf-instance-group/README.md | 3 + .../huaweicloud/waf-instance-group/index.ts | 252 + .../huaweicloud/waf-policy/README.md | 3 + .../providers/huaweicloud/waf-policy/index.ts | 1358 +++ .../huaweicloud/waf-reference-table/README.md | 3 + .../huaweicloud/waf-reference-table/index.ts | 285 + .../waf-rule-anti-crawler/README.md | 3 + .../waf-rule-anti-crawler/index.ts | 561 ++ .../huaweicloud/waf-rule-blacklist/README.md | 3 + .../huaweicloud/waf-rule-blacklist/index.ts | 534 ++ .../waf-rule-cc-protection/README.md | 3 + .../waf-rule-cc-protection/index.ts | 921 ++ .../waf-rule-data-masking/README.md | 3 + .../waf-rule-data-masking/index.ts | 328 + .../README.md | 3 + .../index.ts | 342 + .../README.md | 3 + .../index.ts | 619 ++ .../README.md | 3 + .../index.ts | 344 + .../waf-rule-known-attack-source/README.md | 3 + .../waf-rule-known-attack-source/index.ts | 285 + .../waf-rule-precise-protection/README.md | 3 + .../waf-rule-precise-protection/index.ts | 714 ++ .../waf-rule-web-tamper-protection/README.md | 3 + .../waf-rule-web-tamper-protection/index.ts | 303 + .../workspace-access-policy/README.md | 3 + .../workspace-access-policy/index.ts | 387 + .../README.md | 3 + .../index.ts | 383 + .../huaweicloud/workspace-app-group/README.md | 3 + .../huaweicloud/workspace-app-group/index.ts | 268 + .../workspace-app-image-server/README.md | 3 + .../workspace-app-image-server/index.ts | 1516 ++++ .../huaweicloud/workspace-app-image/README.md | 3 + .../huaweicloud/workspace-app-image/index.ts | 415 + .../workspace-app-nas-storage/README.md | 3 + .../workspace-app-nas-storage/index.ts | 325 + .../workspace-app-personal-folders/README.md | 3 + .../workspace-app-personal-folders/index.ts | 382 + .../workspace-app-policy-group/README.md | 3 + .../workspace-app-policy-group/index.ts | 473 + .../workspace-app-publishment/README.md | 3 + .../workspace-app-publishment/index.ts | 557 ++ .../workspace-app-server-group/README.md | 3 + .../workspace-app-server-group/index.ts | 1076 +++ .../workspace-app-server/README.md | 3 + .../huaweicloud/workspace-app-server/index.ts | 1051 +++ .../workspace-app-shared-folder/README.md | 3 + .../workspace-app-shared-folder/index.ts | 210 + .../workspace-app-storage-policy/README.md | 3 + .../workspace-app-storage-policy/index.ts | 203 + .../workspace-app-warehouse-app/README.md | 3 + .../workspace-app-warehouse-app/index.ts | 366 + .../workspace-desktop-name-rule/README.md | 3 + .../workspace-desktop-name-rule/index.ts | 302 + .../huaweicloud/workspace-desktop/README.md | 3 + .../huaweicloud/workspace-desktop/index.ts | 1260 +++ .../workspace-eip-associate/README.md | 3 + .../workspace-eip-associate/index.ts | 204 + .../workspace-policy-group/README.md | 3 + .../workspace-policy-group/index.ts | 646 ++ .../huaweicloud/workspace-service/README.md | 3 + .../huaweicloud/workspace-service/index.ts | 1542 ++++ .../workspace-terminal-binding/README.md | 3 + .../workspace-terminal-binding/index.ts | 420 + .../workspace-user-group/README.md | 3 + .../huaweicloud/workspace-user-group/index.ts | 408 + .../huaweicloud/workspace-user/README.md | 3 + .../huaweicloud/workspace-user/index.ts | 372 + src/constructs/versions.json | 3 + src/stack/deploy.ts | 2 +- src/stack/rfsStack/index.ts | 15 + src/stack/rosStack/index.ts | 34 + src/stack/rosStack/rosStack.ts | 34 - 3402 files changed, 966633 insertions(+), 154 deletions(-) create mode 100644 cdktf.json create mode 100644 src/constructs/constraints.json create mode 100644 src/constructs/providers/huaweicloud/aad-forward-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aad-forward-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/access-analyzer-archive-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/access-analyzer-archive-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/access-analyzer/README.md create mode 100644 src/constructs/providers/huaweicloud/access-analyzer/index.ts create mode 100644 src/constructs/providers/huaweicloud/antiddos-basic/README.md create mode 100644 src/constructs/providers/huaweicloud/antiddos-basic/index.ts create mode 100644 src/constructs/providers/huaweicloud/antiddos-default-protection-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/antiddos-default-protection-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-action-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-action-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-group-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-group-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-rules-template/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-rules-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-silence-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-alarm-silence-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-application/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-cloud-service-access/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-cloud-service-access/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-application/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-component/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-component/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-environment/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-environment/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-component/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-component/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-dashboard/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-dashboard/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-dashboards-folder/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-dashboards-folder/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-environment/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-environment/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-event-alarm-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-event-alarm-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-message-template/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-message-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-prom-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-prom-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-prometheus-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-prometheus-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/aom-service-discovery-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aom-service-discovery-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/aomv4-alarm-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/aomv4-alarm-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/api-gateway-api/README.md create mode 100644 src/constructs/providers/huaweicloud/api-gateway-api/index.ts create mode 100644 src/constructs/providers/huaweicloud/api-gateway-environment/README.md create mode 100644 src/constructs/providers/huaweicloud/api-gateway-environment/index.ts create mode 100644 src/constructs/providers/huaweicloud/api-gateway-group/README.md create mode 100644 src/constructs/providers/huaweicloud/api-gateway-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-acl-policy-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-acl-policy-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-acl-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-acl-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-api-publishment/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-api-publishment/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-api/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-api/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-appcode/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-appcode/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-application-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-application-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-application-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-application-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-application-quota-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-application-quota-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-application-quota/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-application-quota/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-application/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-channel/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-channel/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-custom-authorizer/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-custom-authorizer/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-endpoint-connection-management/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-endpoint-connection-management/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-endpoint-whitelist/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-endpoint-whitelist/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-environment-variable/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-environment-variable/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-environment/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-environment/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-group/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-instance-feature/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-instance-feature/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-instance-routes/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-instance-routes/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-plugin-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-plugin-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-plugin/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-plugin/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-response/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-response/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-signature-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-signature-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-signature/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-signature/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-throttling-policy-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-throttling-policy-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-throttling-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-throttling-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/apig-vpc-channel/README.md create mode 100644 src/constructs/providers/huaweicloud/apig-vpc-channel/index.ts create mode 100644 src/constructs/providers/huaweicloud/apm-aksk/README.md create mode 100644 src/constructs/providers/huaweicloud/apm-aksk/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-bandwidth-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/as-bandwidth-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-configuration-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/as-configuration-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/as-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-group-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/as-group-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-group/README.md create mode 100644 src/constructs/providers/huaweicloud/as-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-instance-attach/README.md create mode 100644 src/constructs/providers/huaweicloud/as-instance-attach/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/README.md create mode 100644 src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-lifecycle-hook/README.md create mode 100644 src/constructs/providers/huaweicloud/as-lifecycle-hook/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-notification/README.md create mode 100644 src/constructs/providers/huaweicloud/as-notification/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-planned-task/README.md create mode 100644 src/constructs/providers/huaweicloud/as-planned-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-policy-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/as-policy-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/as-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/as-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/asm-mesh/README.md create mode 100644 src/constructs/providers/huaweicloud/asm-mesh/index.ts create mode 100644 src/constructs/providers/huaweicloud/bcs-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/bcs-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/blockstorage-volume-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/blockstorage-volume-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/bms-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/bms-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/cae-component-configurations/README.md create mode 100644 src/constructs/providers/huaweicloud/cae-component-configurations/index.ts create mode 100644 src/constructs/providers/huaweicloud/cae-component-deployment/README.md create mode 100644 src/constructs/providers/huaweicloud/cae-component-deployment/index.ts create mode 100644 src/constructs/providers/huaweicloud/cae-component/README.md create mode 100644 src/constructs/providers/huaweicloud/cae-component/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbh-ha-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/cbh-ha-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbh-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/cbh-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbr-backup-share-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/cbr-backup-share-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbr-backup-share/README.md create mode 100644 src/constructs/providers/huaweicloud/cbr-backup-share/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbr-checkpoint/README.md create mode 100644 src/constructs/providers/huaweicloud/cbr-checkpoint/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbr-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/cbr-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/cbr-vault/README.md create mode 100644 src/constructs/providers/huaweicloud/cbr-vault/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-bandwidth-package/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-bandwidth-package/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-attachment/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-attachment/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-policy-apply/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-policy-apply/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-central-network-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-central-network/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-central-network/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/index.ts create mode 100644 src/constructs/providers/huaweicloud/cc-network-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/cc-network-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-addon/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-addon/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-autopilot-addon/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-autopilot-addon/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-autopilot-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-autopilot-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-chart/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-chart/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-cluster-log-config/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-cluster-log-config/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-cluster-upgrade/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-cluster-upgrade/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-cluster-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-cluster-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-namespace/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-namespace/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-node-attach/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-node-attach/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-node-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-node-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-node-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-node-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-node/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-node/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-partition/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-partition/index.ts create mode 100644 src/constructs/providers/huaweicloud/cce-pvc/README.md create mode 100644 src/constructs/providers/huaweicloud/cce-pvc/index.ts create mode 100644 src/constructs/providers/huaweicloud/cci-namespace/README.md create mode 100644 src/constructs/providers/huaweicloud/cci-namespace/index.ts create mode 100644 src/constructs/providers/huaweicloud/cci-network/README.md create mode 100644 src/constructs/providers/huaweicloud/cci-network/index.ts create mode 100644 src/constructs/providers/huaweicloud/cci-pvc/README.md create mode 100644 src/constructs/providers/huaweicloud/cci-pvc/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-apply/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-apply/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-deploy/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-deploy/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-import/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-import/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-push/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate-push/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-private-ca-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-private-ca-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-private-ca-revoke/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-private-ca-revoke/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-private-ca/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-private-ca/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/index.ts create mode 100644 src/constructs/providers/huaweicloud/ccm-private-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/ccm-private-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdm-cluster-action/README.md create mode 100644 src/constructs/providers/huaweicloud/cdm-cluster-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdm-cluster-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/cdm-cluster-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdm-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/cdm-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdm-job/README.md create mode 100644 src/constructs/providers/huaweicloud/cdm-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdm-link/README.md create mode 100644 src/constructs/providers/huaweicloud/cdm-link/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdn-billing-option/README.md create mode 100644 src/constructs/providers/huaweicloud/cdn-billing-option/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdn-cache-preheat/README.md create mode 100644 src/constructs/providers/huaweicloud/cdn-cache-preheat/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdn-cache-refresh/README.md create mode 100644 src/constructs/providers/huaweicloud/cdn-cache-refresh/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdn-domain-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/cdn-domain-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/cdn-domain/README.md create mode 100644 src/constructs/providers/huaweicloud/cdn-domain/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-alarm-template/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-alarm-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-alarmrule/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-alarmrule/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-dashboard-widget/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-dashboard-widget/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-dashboard/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-dashboard/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-event-report/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-event-report/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-one-click-alarm/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-one-click-alarm/index.ts create mode 100644 src/constructs/providers/huaweicloud/ces-resource-group/README.md create mode 100644 src/constructs/providers/huaweicloud/ces-resource-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-acl-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-acl-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-address-group-member/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-address-group-member/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-address-group/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-address-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-black-white-list/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-black-white-list/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-capture-task/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-capture-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-dns-resolution/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-dns-resolution/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-domain-name-group/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-domain-name-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-eip-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-eip-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-firewall/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-firewall/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-lts-log/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-lts-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-protection-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-protection-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-service-group-member/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-service-group-member/index.ts create mode 100644 src/constructs/providers/huaweicloud/cfw-service-group/README.md create mode 100644 src/constructs/providers/huaweicloud/cfw-service-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/cloudtable-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/cloudtable-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/README.md create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/index.ts create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-protected-object/README.md create mode 100644 src/constructs/providers/huaweicloud/cnad-advanced-protected-object/index.ts create mode 100644 src/constructs/providers/huaweicloud/coc-script-execute/README.md create mode 100644 src/constructs/providers/huaweicloud/coc-script-execute/index.ts create mode 100644 src/constructs/providers/huaweicloud/coc-script/README.md create mode 100644 src/constructs/providers/huaweicloud/coc-script/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-deploy-application/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-deploy-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-deploy-group/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-deploy-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-deploy-host/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-deploy-host/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-inspector-website-scan/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-inspector-website-scan/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-inspector-website/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-inspector-website/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-project/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-project/index.ts create mode 100644 src/constructs/providers/huaweicloud/codearts-repository/README.md create mode 100644 src/constructs/providers/huaweicloud/codearts-repository/index.ts create mode 100644 src/constructs/providers/huaweicloud/codehub-repository/README.md create mode 100644 src/constructs/providers/huaweicloud/codehub-repository/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-auto-launch-group/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-auto-launch-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-floatingip-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-floatingip-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-instance-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-instance-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-interface-attach-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-interface-attach-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-interface-attach/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-interface-attach/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-keypair-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-keypair-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-keypair/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-keypair/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-secgroup-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-secgroup-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-servergroup-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-servergroup-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-servergroup/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-servergroup/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-volume-attach-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-volume-attach-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/compute-volume-attach/README.md create mode 100644 src/constructs/providers/huaweicloud/compute-volume-attach/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-adb-command/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-adb-command/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-phone-property/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-phone-property/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-phone-reset/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-phone-reset/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-phone-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-phone-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-phone-stop/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-phone-stop/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-server-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-server-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-server/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-server/index.ts create mode 100644 src/constructs/providers/huaweicloud/cph-share-app/README.md create mode 100644 src/constructs/providers/huaweicloud/cph-share-app/index.ts create mode 100644 src/constructs/providers/huaweicloud/cpts-project/README.md create mode 100644 src/constructs/providers/huaweicloud/cpts-project/index.ts create mode 100644 src/constructs/providers/huaweicloud/cpts-task/README.md create mode 100644 src/constructs/providers/huaweicloud/cpts-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/cs-cluster-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/cs-cluster-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/cs-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/cs-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/cs-peering-connect-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/cs-peering-connect-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/cs-peering-connect/README.md create mode 100644 src/constructs/providers/huaweicloud/cs-peering-connect/index.ts create mode 100644 src/constructs/providers/huaweicloud/cs-route-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/cs-route-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/cs-route/README.md create mode 100644 src/constructs/providers/huaweicloud/cs-route/index.ts create mode 100644 src/constructs/providers/huaweicloud/csbs-backup-policy-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/csbs-backup-policy-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/csbs-backup-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/csbs-backup-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/csbs-backup-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/csbs-backup-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/csbs-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/csbs-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/cse-microservice-engine/README.md create mode 100644 src/constructs/providers/huaweicloud/cse-microservice-engine/index.ts create mode 100644 src/constructs/providers/huaweicloud/cse-microservice-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/cse-microservice-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/cse-microservice/README.md create mode 100644 src/constructs/providers/huaweicloud/cse-microservice/index.ts create mode 100644 src/constructs/providers/huaweicloud/csms-event/README.md create mode 100644 src/constructs/providers/huaweicloud/csms-event/index.ts create mode 100644 src/constructs/providers/huaweicloud/csms-secret-version-state/README.md create mode 100644 src/constructs/providers/huaweicloud/csms-secret-version-state/index.ts create mode 100644 src/constructs/providers/huaweicloud/csms-secret/README.md create mode 100644 src/constructs/providers/huaweicloud/csms-secret/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-cluster-az-migrate/README.md create mode 100644 src/constructs/providers/huaweicloud/css-cluster-az-migrate/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-cluster-node-replace/README.md create mode 100644 src/constructs/providers/huaweicloud/css-cluster-node-replace/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-cluster-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/css-cluster-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-cluster-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/css-cluster-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/css-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/css-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-es-core-upgrade/README.md create mode 100644 src/constructs/providers/huaweicloud/css-es-core-upgrade/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-es-loadbalancer-config/README.md create mode 100644 src/constructs/providers/huaweicloud/css-es-loadbalancer-config/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-log-setting/README.md create mode 100644 src/constructs/providers/huaweicloud/css-log-setting/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-cluster-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-cluster-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-connectivity/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-connectivity/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-custom-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-custom-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-custom-template/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-custom-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-logstash-pipeline/README.md create mode 100644 src/constructs/providers/huaweicloud/css-logstash-pipeline/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-manual-log-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/css-manual-log-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-scan-task/README.md create mode 100644 src/constructs/providers/huaweicloud/css-scan-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-snapshot/README.md create mode 100644 src/constructs/providers/huaweicloud/css-snapshot/index.ts create mode 100644 src/constructs/providers/huaweicloud/css-thesaurus/README.md create mode 100644 src/constructs/providers/huaweicloud/css-thesaurus/index.ts create mode 100644 src/constructs/providers/huaweicloud/cts-data-tracker/README.md create mode 100644 src/constructs/providers/huaweicloud/cts-data-tracker/index.ts create mode 100644 src/constructs/providers/huaweicloud/cts-notification/README.md create mode 100644 src/constructs/providers/huaweicloud/cts-notification/index.ts create mode 100644 src/constructs/providers/huaweicloud/cts-tracker/README.md create mode 100644 src/constructs/providers/huaweicloud/cts-tracker/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-account/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-images-image/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-images-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-images-images/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-images-images/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpc/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/index.ts create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/README.md create mode 100644 src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-code-table/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-code-table/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-directory/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-directory/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-model/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-model/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-process/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-process/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-subject/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-subject/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-table-model/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-architecture-table-model/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-api/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-app/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-app/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-job-action/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-job-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-job/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-resource/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-resource/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-script/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-factory-script/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-permission-set/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-security-permission-set/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-studio-data-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-studio-data-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/dataarts-studio-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dataarts-studio-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/README.md create mode 100644 src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/dbss-ecs-database/README.md create mode 100644 src/constructs/providers/huaweicloud/dbss-ecs-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/dbss-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dbss-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dbss-rds-database/README.md create mode 100644 src/constructs/providers/huaweicloud/dbss-rds-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/dc-hosted-connect/README.md create mode 100644 src/constructs/providers/huaweicloud/dc-hosted-connect/index.ts create mode 100644 src/constructs/providers/huaweicloud/dc-virtual-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/dc-virtual-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/dc-virtual-interface/README.md create mode 100644 src/constructs/providers/huaweicloud/dc-virtual-interface/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-account/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-bigkey-analysis/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-bigkey-analysis/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-custom-template/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-custom-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-diagnosis-task/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-diagnosis-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-hotkey-analysis/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-hotkey-analysis/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-instance-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-instance-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-instance-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-instance-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dcs-isntance-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/dcs-isntance-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-account/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-read-strategy/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-read-strategy/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-rollback/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-rollback/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-upgrade/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-instance-upgrade/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/index.ts create mode 100644 src/constructs/providers/huaweicloud/ddm-schema/README.md create mode 100644 src/constructs/providers/huaweicloud/ddm-schema/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-audit-log-delete/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-audit-log-delete/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-audit-log-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-audit-log-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-collection-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-collection-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-database-role/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-database-role/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-database-user/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-database-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-parameters-modify/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-parameters-modify/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-recovery/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-recovery/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-lts-log/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-lts-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-apply/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-apply/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-compare/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-compare/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-copy/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-copy/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-reset/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template-reset/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-parameter-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-primary-standby-switch/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-primary-standby-switch/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-recycle-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-recycle-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/README.md create mode 100644 src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/index.ts create mode 100644 src/constructs/providers/huaweicloud/dis-stream-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/dis-stream-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/dis-stream/README.md create mode 100644 src/constructs/providers/huaweicloud/dis-stream/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-agency/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-agency/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-database-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-database-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-database/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-auth/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-auth/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-connection-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-connection-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-datasource-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-elastic-resource-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-elastic-resource-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-flink-template/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-flink-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-flinkjar-job/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-flinkjar-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-flinksql-job/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-flinksql-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-global-variable/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-global-variable/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-package/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-package/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-permission/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-permission/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-queue-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-queue-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-queue/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-queue/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-spark-job/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-spark-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-spark-template/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-spark-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-sql-job/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-sql-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-sql-template/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-sql-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-table/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-table/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-template-flink/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-template-flink/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-template-spark/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-template-spark/index.ts create mode 100644 src/constructs/providers/huaweicloud/dli-template-sql/README.md create mode 100644 src/constructs/providers/huaweicloud/dli-template-sql/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-group-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-group-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-group/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-instance-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-instance-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-consumer-group/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-consumer-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-instance-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-instance-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-message-produce/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-message-produce/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-smart-connect/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-smart-connect/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-topic/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-topic/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-user/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafka-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-queue-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-queue-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-queue/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-queue/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-queue/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-queue/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-user/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-topic/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-topic/index.ts create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-user/README.md create mode 100644 src/constructs/providers/huaweicloud/dms-rocketmq-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-custom-line/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-custom-line/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-endpoint/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-endpoint/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-line-group/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-line-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-ptrrecord-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-ptrrecord-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-ptrrecord/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-ptrrecord/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-recordset-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-recordset-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-recordset/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-recordset/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-resolver-rule-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-resolver-rule-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-resolver-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-resolver-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-zone-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-zone-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/dns-zone/README.md create mode 100644 src/constructs/providers/huaweicloud/dns-zone/index.ts create mode 100644 src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/README.md create mode 100644 src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/index.ts create mode 100644 src/constructs/providers/huaweicloud/drs-job/README.md create mode 100644 src/constructs/providers/huaweicloud/drs-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/dsc-alarm-notification/README.md create mode 100644 src/constructs/providers/huaweicloud/dsc-alarm-notification/index.ts create mode 100644 src/constructs/providers/huaweicloud/dsc-asset-obs/README.md create mode 100644 src/constructs/providers/huaweicloud/dsc-asset-obs/index.ts create mode 100644 src/constructs/providers/huaweicloud/dsc-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/dsc-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-alarm-subscription/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-alarm-subscription/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-cluster-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-cluster-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-disaster-recovery-task/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-disaster-recovery-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-event-subscription/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-event-subscription/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-ext-data-source/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-ext-data-source/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-logical-cluster-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-logical-cluster-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-logical-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-logical-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-om-account-action/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-om-account-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-parameter-configurations/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-parameter-configurations/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-public-domain-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-public-domain-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-snapshot-copy/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-snapshot-copy/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-snapshot-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-snapshot-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-snapshot/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-snapshot/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-workload-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-workload-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-workload-plan-execution/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-workload-plan-execution/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-workload-plan-stage/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-workload-plan-stage/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-workload-plan/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-workload-plan/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/dws-workload-queue/README.md create mode 100644 src/constructs/providers/huaweicloud/dws-workload-queue/index.ts create mode 100644 src/constructs/providers/huaweicloud/ecs-instance-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/ecs-instance-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/eg-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/eg-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/eg-custom-event-channel/README.md create mode 100644 src/constructs/providers/huaweicloud/eg-custom-event-channel/index.ts create mode 100644 src/constructs/providers/huaweicloud/eg-custom-event-source/README.md create mode 100644 src/constructs/providers/huaweicloud/eg-custom-event-source/index.ts create mode 100644 src/constructs/providers/huaweicloud/eg-endpoint/README.md create mode 100644 src/constructs/providers/huaweicloud/eg-endpoint/index.ts create mode 100644 src/constructs/providers/huaweicloud/eg-event-stream/README.md create mode 100644 src/constructs/providers/huaweicloud/eg-event-stream/index.ts create mode 100644 src/constructs/providers/huaweicloud/eg-event-subscription/README.md create mode 100644 src/constructs/providers/huaweicloud/eg-event-subscription/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-active-standby-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-active-standby-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-ipgroup/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-ipgroup/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-l7policy/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-l7policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-l7rule/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-l7rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-listener/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-listener/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-loadbalancer/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-loadbalancer/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-log/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-logtank/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-logtank/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-member/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-member/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-monitor/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-monitor/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/elb-security-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/elb-security-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/enterprise-project-authority/README.md create mode 100644 src/constructs/providers/huaweicloud/enterprise-project-authority/index.ts create mode 100644 src/constructs/providers/huaweicloud/enterprise-project/README.md create mode 100644 src/constructs/providers/huaweicloud/enterprise-project/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-association/README.md create mode 100644 src/constructs/providers/huaweicloud/er-association/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-flow-log/README.md create mode 100644 src/constructs/providers/huaweicloud/er-flow-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/er-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-propagation/README.md create mode 100644 src/constructs/providers/huaweicloud/er-propagation/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-route-table/README.md create mode 100644 src/constructs/providers/huaweicloud/er-route-table/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-static-route/README.md create mode 100644 src/constructs/providers/huaweicloud/er-static-route/index.ts create mode 100644 src/constructs/providers/huaweicloud/er-vpc-attachment/README.md create mode 100644 src/constructs/providers/huaweicloud/er-vpc-attachment/index.ts create mode 100644 src/constructs/providers/huaweicloud/evs-snapshot-rollback/README.md create mode 100644 src/constructs/providers/huaweicloud/evs-snapshot-rollback/index.ts create mode 100644 src/constructs/providers/huaweicloud/evs-snapshot/README.md create mode 100644 src/constructs/providers/huaweicloud/evs-snapshot/index.ts create mode 100644 src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/evs-volume-transfer/README.md create mode 100644 src/constructs/providers/huaweicloud/evs-volume-transfer/index.ts create mode 100644 src/constructs/providers/huaweicloud/evs-volume/README.md create mode 100644 src/constructs/providers/huaweicloud/evs-volume/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-application/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-dependency-version/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-dependency-version/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-dependency/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-dependency/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-function-event/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-function-event/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-function-trigger/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-function-trigger/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-function-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-function-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-function/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-function/index.ts create mode 100644 src/constructs/providers/huaweicloud/fgs-trigger/README.md create mode 100644 src/constructs/providers/huaweicloud/fgs-trigger/index.ts create mode 100644 src/constructs/providers/huaweicloud/fw-firewall-group-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/fw-firewall-group-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/fw-policy-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/fw-policy-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/fw-rule-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/fw-rule-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/ga-accelerator/README.md create mode 100644 src/constructs/providers/huaweicloud/ga-accelerator/index.ts create mode 100644 src/constructs/providers/huaweicloud/ga-address-group/README.md create mode 100644 src/constructs/providers/huaweicloud/ga-address-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/ga-endpoint-group/README.md create mode 100644 src/constructs/providers/huaweicloud/ga-endpoint-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/ga-endpoint/README.md create mode 100644 src/constructs/providers/huaweicloud/ga-endpoint/index.ts create mode 100644 src/constructs/providers/huaweicloud/ga-health-check/README.md create mode 100644 src/constructs/providers/huaweicloud/ga-health-check/index.ts create mode 100644 src/constructs/providers/huaweicloud/ga-listener/README.md create mode 100644 src/constructs/providers/huaweicloud/ga-listener/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-influx-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-influx-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mongo-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mongo-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-account/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-database/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-quota/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-quota/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-opengauss-database/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-opengauss-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/gaussdb-redis-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/gaussdb-redis-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/ges-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/ges-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/ges-graph/README.md create mode 100644 src/constructs/providers/huaweicloud/ges-graph/index.ts create mode 100644 src/constructs/providers/huaweicloud/ges-metadata/README.md create mode 100644 src/constructs/providers/huaweicloud/ges-metadata/index.ts create mode 100644 src/constructs/providers/huaweicloud/global-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/global-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/global-eip/README.md create mode 100644 src/constructs/providers/huaweicloud/global-eip/index.ts create mode 100644 src/constructs/providers/huaweicloud/global-internet-bandwidth/README.md create mode 100644 src/constructs/providers/huaweicloud/global-internet-bandwidth/index.ts create mode 100644 src/constructs/providers/huaweicloud/hss-cce-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/hss-cce-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/hss-host-group/README.md create mode 100644 src/constructs/providers/huaweicloud/hss-host-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/hss-host-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/hss-host-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/hss-quota/README.md create mode 100644 src/constructs/providers/huaweicloud/hss-quota/index.ts create mode 100644 src/constructs/providers/huaweicloud/hss-webtamper-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/hss-webtamper-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/iam-agency-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/iam-agency-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/iam-agency/README.md create mode 100644 src/constructs/providers/huaweicloud/iam-agency/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-access-key/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-access-key/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-agency/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-agency/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-group-membership-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-group-membership-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-group-membership/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-group-membership/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-group-role-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-group-role-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-group-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-group-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-group/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-login-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-login-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-password-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-password-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-project-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-project-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-project/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-project/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-protection-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-protection-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-provider-conversion/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-provider-conversion/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-provider/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-provider/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-role-assignment-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-role-assignment-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-role-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-role-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-role/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-role/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-service-agency/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-service-agency/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-trust-agency/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-trust-agency/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-user-role-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-user-role-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-user-token/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-user-token/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-user-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-user-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-user/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/identity-virtual-mfa-device/README.md create mode 100644 src/constructs/providers/huaweicloud/identity-virtual-mfa-device/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-account-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-account-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-group-membership/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-group-membership/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-group/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-permission-set/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-permission-set/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/index.ts create mode 100644 src/constructs/providers/huaweicloud/identitycenter-user/README.md create mode 100644 src/constructs/providers/huaweicloud/identitycenter-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-eip/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-eip/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-keypair/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-keypair/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-network-acl-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-network-acl-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-network-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-network-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-security-group-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-security-group-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-security-group/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-security-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-server/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-server/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-vip/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-vip/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-vpc-subnet/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-vpc-subnet/index.ts create mode 100644 src/constructs/providers/huaweicloud/iec-vpc/README.md create mode 100644 src/constructs/providers/huaweicloud/iec-vpc/index.ts create mode 100644 src/constructs/providers/huaweicloud/images-image-copy/README.md create mode 100644 src/constructs/providers/huaweicloud/images-image-copy/index.ts create mode 100644 src/constructs/providers/huaweicloud/images-image-share-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/images-image-share-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/images-image-share/README.md create mode 100644 src/constructs/providers/huaweicloud/images-image-share/index.ts create mode 100644 src/constructs/providers/huaweicloud/images-image-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/images-image-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/images-image/README.md create mode 100644 src/constructs/providers/huaweicloud/images-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-cbr-whole-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-cbr-whole-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-ecs-system-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-ecs-system-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-ecs-whole-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-ecs-whole-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-evs-data-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-evs-data-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-evs-system-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-evs-system-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-image-export/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-image-export/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-obs-data-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-obs-data-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-obs-iso-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-obs-iso-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/ims-obs-system-image/README.md create mode 100644 src/constructs/providers/huaweicloud/ims-obs-system-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-access-credential/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-access-credential/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-amqp/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-amqp/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-batchtask-file/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-batchtask-file/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-batchtask/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-batchtask/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-data-backlog-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-data-backlog-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device-async-command/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device-async-command/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device-group/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device-linkage-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device-linkage-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device-message/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device-message/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device-proxy/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device-proxy/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-device/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-device/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-product/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-product/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-space/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-space/index.ts create mode 100644 src/constructs/providers/huaweicloud/iotda-upgrade-package/README.md create mode 100644 src/constructs/providers/huaweicloud/iotda-upgrade-package/index.ts create mode 100644 src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/README.md create mode 100644 src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/index.ts create mode 100644 src/constructs/providers/huaweicloud/kms-dedicated-keystore/README.md create mode 100644 src/constructs/providers/huaweicloud/kms-dedicated-keystore/index.ts create mode 100644 src/constructs/providers/huaweicloud/kms-grant/README.md create mode 100644 src/constructs/providers/huaweicloud/kms-grant/index.ts create mode 100644 src/constructs/providers/huaweicloud/kms-key-material/README.md create mode 100644 src/constructs/providers/huaweicloud/kms-key-material/index.ts create mode 100644 src/constructs/providers/huaweicloud/kms-key-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/kms-key-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/kms-key/README.md create mode 100644 src/constructs/providers/huaweicloud/kms-key/index.ts create mode 100644 src/constructs/providers/huaweicloud/kps-keypair/README.md create mode 100644 src/constructs/providers/huaweicloud/kps-keypair/index.ts create mode 100644 src/constructs/providers/huaweicloud/lazy-index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-certificate-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-certificate-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-l7policy-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-l7policy-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-l7policy/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-l7policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-l7rule-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-l7rule-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-l7rule/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-l7rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-listener-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-listener-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-listener/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-listener/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-loadbalancer-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-loadbalancer-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-loadbalancer/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-loadbalancer/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-member-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-member-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-member/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-member/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-monitor-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-monitor-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-monitor/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-monitor/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-pool-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-pool-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-whitelist-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-whitelist-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/lb-whitelist/README.md create mode 100644 src/constructs/providers/huaweicloud/lb-whitelist/index.ts create mode 100644 src/constructs/providers/huaweicloud/live-bucket-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/live-bucket-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/live-domain/README.md create mode 100644 src/constructs/providers/huaweicloud/live-domain/index.ts create mode 100644 src/constructs/providers/huaweicloud/live-record-callback/README.md create mode 100644 src/constructs/providers/huaweicloud/live-record-callback/index.ts create mode 100644 src/constructs/providers/huaweicloud/live-recording/README.md create mode 100644 src/constructs/providers/huaweicloud/live-recording/index.ts create mode 100644 src/constructs/providers/huaweicloud/live-snapshot/README.md create mode 100644 src/constructs/providers/huaweicloud/live-snapshot/index.ts create mode 100644 src/constructs/providers/huaweicloud/live-transcoding/README.md create mode 100644 src/constructs/providers/huaweicloud/live-transcoding/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-access-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-access-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-aom-access/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-aom-access/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-cce-access/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-cce-access/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-cross-account-access/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-cross-account-access/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-dashboard/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-dashboard/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-group/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-host-access/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-host-access/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-host-group/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-host-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-log-converge-switch/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-log-converge-switch/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-log-converge/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-log-converge/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-notification-template/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-notification-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-search-criteria/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-search-criteria/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-sql-alarm-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-sql-alarm-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-stream/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-stream/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-struct-template/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-struct-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-structing-template/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-structing-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-structuring-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-structuring-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-transfer/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-transfer/index.ts create mode 100644 src/constructs/providers/huaweicloud/lts-waf-access/README.md create mode 100644 src/constructs/providers/huaweicloud/lts-waf-access/index.ts create mode 100644 src/constructs/providers/huaweicloud/mapreduce-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/mapreduce-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/mapreduce-data-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/mapreduce-data-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/mapreduce-job/README.md create mode 100644 src/constructs/providers/huaweicloud/mapreduce-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/mapreduce-scaling-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/mapreduce-scaling-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/meeting-admin-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/meeting-admin-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/meeting-conference/README.md create mode 100644 src/constructs/providers/huaweicloud/meeting-conference/index.ts create mode 100644 src/constructs/providers/huaweicloud/meeting-user/README.md create mode 100644 src/constructs/providers/huaweicloud/meeting-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-dataset-version/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-dataset-version/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-dataset/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-dataset/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-model/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-model/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-network/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-network/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-notebook/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-notebook/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-resource-pool/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-resource-pool/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-service/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-service/index.ts create mode 100644 src/constructs/providers/huaweicloud/modelarts-workspace/README.md create mode 100644 src/constructs/providers/huaweicloud/modelarts-workspace/index.ts create mode 100644 src/constructs/providers/huaweicloud/mpc-transcoding-template-group/README.md create mode 100644 src/constructs/providers/huaweicloud/mpc-transcoding-template-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/mpc-transcoding-template/README.md create mode 100644 src/constructs/providers/huaweicloud/mpc-transcoding-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/mrs-cluster-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/mrs-cluster-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/mrs-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/mrs-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/mrs-job-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/mrs-job-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/mrs-job/README.md create mode 100644 src/constructs/providers/huaweicloud/mrs-job/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-dnat-rule-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-dnat-rule-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-dnat-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-dnat-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-gateway-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-gateway-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-private-dnat-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-private-dnat-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-private-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-private-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-private-snat-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-private-snat-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-private-transit-ip/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-private-transit-ip/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-snat-rule-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-snat-rule-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/nat-snat-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/nat-snat-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/network-acl-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/network-acl-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/network-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/network-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-floatingip-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-floatingip-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-network-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-network-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-port-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-port-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-port/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-port/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-router-interface-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-router-interface-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-router-route-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-router-route-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-router-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-router-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-secgroup/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-subnet-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-subnet-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-vip-associate-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-vip-associate-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-vip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-vip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-vip-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-vip-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/networking-vip/README.md create mode 100644 src/constructs/providers/huaweicloud/networking-vip/index.ts create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-object-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-object-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-object/README.md create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-object/index.ts create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-replication/README.md create mode 100644 src/constructs/providers/huaweicloud/obs-bucket-replication/index.ts create mode 100644 src/constructs/providers/huaweicloud/obs-bucket/README.md create mode 100644 src/constructs/providers/huaweicloud/obs-bucket/index.ts create mode 100644 src/constructs/providers/huaweicloud/oms-migration-sync-task/README.md create mode 100644 src/constructs/providers/huaweicloud/oms-migration-sync-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/oms-migration-task-group/README.md create mode 100644 src/constructs/providers/huaweicloud/oms-migration-task-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/oms-migration-task/README.md create mode 100644 src/constructs/providers/huaweicloud/oms-migration-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/oms-task/README.md create mode 100644 src/constructs/providers/huaweicloud/oms-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-account-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-account-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-account-invite-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-account-invite-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-account-invite-decliner/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-account-invite-decliner/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-account-invite/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-account-invite/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-account/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-delegated-administrator/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-delegated-administrator/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-organization/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-organization/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-organizational-unit/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-organizational-unit/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-policy-attach/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-policy-attach/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/organizations-trusted-service/README.md create mode 100644 src/constructs/providers/huaweicloud/organizations-trusted-service/index.ts create mode 100644 src/constructs/providers/huaweicloud/projectman-project/README.md create mode 100644 src/constructs/providers/huaweicloud/projectman-project/index.ts create mode 100644 src/constructs/providers/huaweicloud/provider/README.md create mode 100644 src/constructs/providers/huaweicloud/provider/index.ts create mode 100644 src/constructs/providers/huaweicloud/ram-organization/README.md create mode 100644 src/constructs/providers/huaweicloud/ram-organization/index.ts create mode 100644 src/constructs/providers/huaweicloud/ram-resource-share-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/ram-resource-share-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/ram-resource-share/README.md create mode 100644 src/constructs/providers/huaweicloud/ram-resource-share/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-account/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-database-logs-shrinking/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-database-logs-shrinking/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-database-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-database-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-database/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-extend-log-link/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-extend-log-link/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-instance-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-instance-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-instance-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-instance-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-lts-log/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-lts-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-account/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-binlog/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-binlog/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-database-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-database-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-database/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-proxy/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-mysql-proxy/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-parametergroup-v3/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-parametergroup-v3/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-parametergroup/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-parametergroup/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-account-privileges/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-account-privileges/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-account-roles/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-account-roles/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-account/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-database-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-database-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-database/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-hba/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-hba/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-plugin-update/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-plugin-update/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-plugin/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-plugin/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-pg-sql-limit/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-pg-sql-limit/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-primary-standby-switch/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-primary-standby-switch/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-read-replica-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-read-replica-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-recycling-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-recycling-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-restore/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-restore/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-sql-audit/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-sql-audit/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-sqlserver-account/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-sqlserver-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/index.ts create mode 100644 src/constructs/providers/huaweicloud/rds-sqlserver-database/README.md create mode 100644 src/constructs/providers/huaweicloud/rds-sqlserver-database/index.ts create mode 100644 src/constructs/providers/huaweicloud/rf-stack/README.md create mode 100644 src/constructs/providers/huaweicloud/rf-stack/index.ts create mode 100644 src/constructs/providers/huaweicloud/rfs-execution-plan/README.md create mode 100644 src/constructs/providers/huaweicloud/rfs-execution-plan/index.ts create mode 100644 src/constructs/providers/huaweicloud/rfs-private-hook/README.md create mode 100644 src/constructs/providers/huaweicloud/rfs-private-hook/index.ts create mode 100644 src/constructs/providers/huaweicloud/rfs-stack/README.md create mode 100644 src/constructs/providers/huaweicloud/rfs-stack/index.ts create mode 100644 src/constructs/providers/huaweicloud/rgc-account/README.md create mode 100644 src/constructs/providers/huaweicloud/rgc-account/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-advanced-query/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-advanced-query/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-assignment-package/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-assignment-package/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-organizational-assignment-package/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-organizational-assignment-package/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-policy-assignment/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-policy-assignment/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-remediation-configuration/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-remediation-configuration/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-remediation-exception/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-remediation-exception/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-remediation-execution/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-remediation-execution/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-resource-aggregator/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-resource-aggregator/index.ts create mode 100644 src/constructs/providers/huaweicloud/rms-resource-recorder/README.md create mode 100644 src/constructs/providers/huaweicloud/rms-resource-recorder/index.ts create mode 100644 src/constructs/providers/huaweicloud/scm-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/scm-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/sdrs-drill/README.md create mode 100644 src/constructs/providers/huaweicloud/sdrs-drill/index.ts create mode 100644 src/constructs/providers/huaweicloud/sdrs-protected-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/sdrs-protected-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/sdrs-protection-group/README.md create mode 100644 src/constructs/providers/huaweicloud/sdrs-protection-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/sdrs-replication-attach/README.md create mode 100644 src/constructs/providers/huaweicloud/sdrs-replication-attach/index.ts create mode 100644 src/constructs/providers/huaweicloud/sdrs-replication-pair/README.md create mode 100644 src/constructs/providers/huaweicloud/sdrs-replication-pair/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-alert-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-alert-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-alert/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-alert/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-data-object-relations/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-data-object-relations/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-incident/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-incident/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-indicator/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-indicator/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-action/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-approval/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-approval/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-enable/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-enable/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-version-action/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-version-action/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-version/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook-version/index.ts create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook/README.md create mode 100644 src/constructs/providers/huaweicloud/secmaster-playbook/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestage-application/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestage-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestage-component-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestage-component-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestage-component/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestage-component/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestage-environment/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestage-environment/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-application/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-application/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-component/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-component/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-environment-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-environment-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-environment/README.md create mode 100644 src/constructs/providers/huaweicloud/servicestagev3-environment/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-access-rule-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-access-rule-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-access-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-access-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-file-system-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-file-system-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-file-system/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-file-system/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-data-task/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-data-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-dir/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-dir/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-du-task/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-du-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-obs-target/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-obs-target/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo/README.md create mode 100644 src/constructs/providers/huaweicloud/sfs-turbo/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-logtank/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-logtank/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-message-detection/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-message-detection/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-message-publish/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-message-publish/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-message-template/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-message-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-subscription-filter-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-subscription-filter-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-subscription-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-subscription-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-subscription/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-subscription/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-topic-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-topic-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/smn-topic/README.md create mode 100644 src/constructs/providers/huaweicloud/smn-topic/index.ts create mode 100644 src/constructs/providers/huaweicloud/sms-server-template/README.md create mode 100644 src/constructs/providers/huaweicloud/sms-server-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/sms-task/README.md create mode 100644 src/constructs/providers/huaweicloud/sms-task/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-image-auto-sync/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-image-auto-sync/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-image-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-image-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-image-retention-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-image-retention-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-image-trigger/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-image-trigger/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-organization-permissions/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-organization-permissions/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-organization/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-organization/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-repository-sharing/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-repository-sharing/index.ts create mode 100644 src/constructs/providers/huaweicloud/swr-repository/README.md create mode 100644 src/constructs/providers/huaweicloud/swr-repository/index.ts create mode 100644 src/constructs/providers/huaweicloud/tms-resource-tags/README.md create mode 100644 src/constructs/providers/huaweicloud/tms-resource-tags/index.ts create mode 100644 src/constructs/providers/huaweicloud/tms-tags/README.md create mode 100644 src/constructs/providers/huaweicloud/tms-tags/index.ts create mode 100644 src/constructs/providers/huaweicloud/ucs-cluster/README.md create mode 100644 src/constructs/providers/huaweicloud/ucs-cluster/index.ts create mode 100644 src/constructs/providers/huaweicloud/ucs-fleet/README.md create mode 100644 src/constructs/providers/huaweicloud/ucs-fleet/index.ts create mode 100644 src/constructs/providers/huaweicloud/ucs-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/ucs-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/vbs-backup-policy-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vbs-backup-policy-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vbs-backup-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/vbs-backup-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/vbs-backup-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vbs-backup-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vbs-backup/README.md create mode 100644 src/constructs/providers/huaweicloud/vbs-backup/index.ts create mode 100644 src/constructs/providers/huaweicloud/vod-media-asset/README.md create mode 100644 src/constructs/providers/huaweicloud/vod-media-asset/index.ts create mode 100644 src/constructs/providers/huaweicloud/vod-media-category/README.md create mode 100644 src/constructs/providers/huaweicloud/vod-media-category/index.ts create mode 100644 src/constructs/providers/huaweicloud/vod-transcoding-template-group/README.md create mode 100644 src/constructs/providers/huaweicloud/vod-transcoding-template-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/vod-watermark-template/README.md create mode 100644 src/constructs/providers/huaweicloud/vod-watermark-template/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-address-group/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-address-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-bandwidth-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-bandwidth-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-bandwidth-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-bandwidth-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-bandwidth/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-bandwidth/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-eip-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-eip-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-eip/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-eip/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-eipv3-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-eipv3-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-flow-log/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-flow-log/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-internet-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-internet-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-network-acl/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-network-acl/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-network-interface/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-network-interface/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-peering-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-route-table/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-route-table/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-route-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-route-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-route/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-route/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-sub-network-interface/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-sub-network-interface/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-subnet-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-subnet-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-subnet/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-subnet/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc-v1/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc-v1/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpc/README.md create mode 100644 src/constructs/providers/huaweicloud/vpc/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpcep-approval/README.md create mode 100644 src/constructs/providers/huaweicloud/vpcep-approval/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpcep-endpoint/README.md create mode 100644 src/constructs/providers/huaweicloud/vpcep-endpoint/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpcep-service/README.md create mode 100644 src/constructs/providers/huaweicloud/vpcep-service/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-access-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-access-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-client-ca-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-client-ca-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-connection-health-check/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-connection-health-check/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-customer-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-customer-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-gateway/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-gateway/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-user-group/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-user-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpn-user/README.md create mode 100644 src/constructs/providers/huaweicloud/vpn-user/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-endpoint-group/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-endpoint-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ike-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ike-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-service-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-service-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-service/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-service/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/index.ts create mode 100644 src/constructs/providers/huaweicloud/vpnaas-site-connection/README.md create mode 100644 src/constructs/providers/huaweicloud/vpnaas-site-connection/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-address-group/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-address-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-certificate/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-certificate/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-cloud-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-cloud-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-dedicated-domain/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-dedicated-domain/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-dedicated-instance/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-dedicated-instance/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-domain/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-domain/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-instance-group-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-instance-group-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-instance-group/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-instance-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-reference-table/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-reference-table/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-anti-crawler/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-anti-crawler/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-blacklist/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-blacklist/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-cc-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-cc-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-data-masking/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-data-masking/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-known-attack-source/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-known-attack-source/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-precise-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-precise-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/README.md create mode 100644 src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-access-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-access-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-group-authorization/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-group-authorization/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-group/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-image-server/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-image-server/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-image/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-image/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-nas-storage/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-nas-storage/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-personal-folders/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-personal-folders/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-policy-group/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-policy-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-publishment/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-publishment/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-server-group/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-server-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-server/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-server/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-shared-folder/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-shared-folder/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-storage-policy/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-storage-policy/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-app-warehouse-app/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-app-warehouse-app/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-desktop-name-rule/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-desktop-name-rule/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-desktop/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-desktop/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-eip-associate/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-eip-associate/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-policy-group/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-policy-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-service/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-service/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-terminal-binding/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-terminal-binding/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-user-group/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-user-group/index.ts create mode 100644 src/constructs/providers/huaweicloud/workspace-user/README.md create mode 100644 src/constructs/providers/huaweicloud/workspace-user/index.ts create mode 100644 src/constructs/versions.json create mode 100644 src/stack/rfsStack/index.ts create mode 100644 src/stack/rosStack/index.ts diff --git a/cdktf.json b/cdktf.json new file mode 100644 index 00000000..c121af5f --- /dev/null +++ b/cdktf.json @@ -0,0 +1,9 @@ +{ + "language": "typescript", + "app": "npx ts-node main.ts", + "terraformProviders": [ + "huaweicloud/huaweicloud@~> 1.71" + ], + "codeMakerOutput": "src/constructs", + "projectId": "9534d8ed-8057-4a51-9742-0915bf94a60b" +} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs index 74be2512..85e7944f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -17,7 +17,7 @@ const compat = new FlatCompat({ export default [ { - ignores: ['**/dist'], + ignores: ['**/dist', 'src/constructs/**/*'], }, ...compat.extends( 'eslint:recommended', diff --git a/package-lock.json b/package-lock.json index 65fad0d4..fc905193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@alicloud/ros-cdk-ram": "^1.4.0", "@alicloud/ros20190910": "^3.5.2", "ajv": "^8.17.1", + "cdktf": "^0.20.10", "chalk": "^5.3.0", "commander": "^12.1.0", "i18n": "^0.15.1", @@ -124,6 +125,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-apigateway/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-assembly-schema": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-assembly-schema/-/ros-cdk-assembly-schema-1.4.0.tgz", @@ -213,6 +222,14 @@ "inBundle": true, "license": "MIT" }, + "node_modules/@alicloud/ros-cdk-core/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-core/node_modules/fs-extra": { "version": "9.1.0", "inBundle": true, @@ -309,6 +326,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-elasticsearchserverless/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-fc": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-fc/-/ros-cdk-fc-1.4.0.tgz", @@ -326,6 +351,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-fc/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-fc3": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-fc3/-/ros-cdk-fc3-1.4.0.tgz", @@ -339,6 +372,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-fc3/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-oss": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-oss/-/ros-cdk-oss-1.4.0.tgz", @@ -352,6 +393,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-oss/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-ossassets": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-ossassets/-/ros-cdk-ossassets-1.4.0.tgz", @@ -457,6 +506,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/@alicloud/ros-cdk-ossassets/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-ossassets/node_modules/content-type": { "version": "1.0.5", "inBundle": true, @@ -1287,6 +1344,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/@alicloud/ros-cdk-ossdeployment/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-ossdeployment/node_modules/content-type": { "version": "1.0.5", "inBundle": true, @@ -2020,6 +2085,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-ram/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-ros": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-ros/-/ros-cdk-ros-1.4.0.tgz", @@ -2033,6 +2106,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-ros/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros-cdk-sls": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@alicloud/ros-cdk-sls/-/ros-cdk-sls-1.4.0.tgz", @@ -2046,6 +2127,14 @@ "constructs": "^3.0.4" } }, + "node_modules/@alicloud/ros-cdk-sls/node_modules/constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "engines": { + "node": ">= 16.14.0" + } + }, "node_modules/@alicloud/ros20190910": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/@alicloud/ros20190910/-/ros20190910-3.5.2.tgz", @@ -4409,151 +4498,703 @@ } ] }, - "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node_modules/cdktf": { + "version": "0.20.10", + "resolved": "https://registry.npmjs.org/cdktf/-/cdktf-0.20.10.tgz", + "integrity": "sha512-I8c838lNDHUeOIFCeZ6NsLHivAaYVoc+3a8k84hYP+BkQtoqCiOhcYjrm7lH42CwqfBBR+BoD7lB5AFeHekd5A==", + "bundleDependencies": [ + "archiver", + "json-stable-stringify", + "semver" + ], + "dependencies": { + "archiver": "6.0.2", + "json-stable-stringify": "1.1.1", + "semver": "7.6.3" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "constructs": "^10.3.0" } }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true, + "node_modules/cdktf/node_modules/archiver": { + "version": "6.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "archiver-utils": "^4.0.1", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^5.0.1" + }, "engines": { - "node": ">=10" + "node": ">= 12.0.0" } }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], + "node_modules/cdktf/node_modules/archiver-utils": { + "version": "4.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "glob": "^8.0.0", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, "engines": { - "node": ">=8" + "node": ">= 12.0.0" } }, - "node_modules/cjs-module-lexer": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", - "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", - "dev": true + "node_modules/cdktf/node_modules/async": { + "version": "3.2.5", + "inBundle": true, + "license": "MIT" }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, + "node_modules/cdktf/node_modules/b4a": { + "version": "1.6.6", + "inBundle": true, + "license": "Apache-2.0" + }, + "node_modules/cdktf/node_modules/balanced-match": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/bare-events": { + "version": "2.2.1", + "inBundle": true, + "license": "Apache-2.0", + "optional": true + }, + "node_modules/cdktf/node_modules/brace-expansion": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" + "balanced-match": "^1.0.0" } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true, + "node_modules/cdktf/node_modules/buffer-crc32": { + "version": "0.2.13", + "inBundle": true, + "license": "MIT", "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" + "node": "*" } }, - "node_modules/collect-v8-coverage": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", - "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "node_modules/cdktf/node_modules/call-bind": { + "version": "1.0.7", + "inBundle": true, + "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" }, "engines": { - "node": ">=7.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" - }, - "node_modules/commander": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", - "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "node_modules/cdktf/node_modules/compress-commons": { + "version": "5.0.3", + "inBundle": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^5.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, "engines": { - "node": ">=18" + "node": ">= 12.0.0" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "node_modules/cdktf/node_modules/core-util-is": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT" }, - "node_modules/constructs": { - "version": "3.4.344", - "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", - "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==", + "node_modules/cdktf/node_modules/crc-32": { + "version": "1.2.2", + "inBundle": true, + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, "engines": { - "node": ">= 16.14.0" + "node": ">=0.8" } }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, + "node_modules/cdktf/node_modules/crc32-stream": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 12.0.0" } }, - "node_modules/create-jest/node_modules/chalk": { - "version": "4.1.2", + "node_modules/cdktf/node_modules/define-data-property": { + "version": "1.1.4", + "inBundle": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/es-define-property": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/es-errors": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/fast-fifo": { + "version": "1.3.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/fs.realpath": { + "version": "1.0.0", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/function-bind": { + "version": "1.1.2", + "inBundle": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/get-intrinsic": { + "version": "1.2.4", + "inBundle": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/glob": { + "version": "8.1.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cdktf/node_modules/gopd": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/graceful-fs": { + "version": "4.2.11", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/has-property-descriptors": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/has-proto": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/has-symbols": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/hasown": { + "version": "2.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/inflight": { + "version": "1.0.6", + "inBundle": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/cdktf/node_modules/inherits": { + "version": "2.0.4", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/isarray": { + "version": "2.0.5", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/json-stable-stringify": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/jsonify": { + "version": "0.0.1", + "inBundle": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/lazystream": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/isarray": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "inBundle": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/cdktf/node_modules/lodash": { + "version": "4.17.21", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/minimatch": { + "version": "5.1.6", + "inBundle": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/normalize-path": { + "version": "3.0.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cdktf/node_modules/object-keys": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/once": { + "version": "1.4.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/cdktf/node_modules/process-nextick-args": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/queue-tick": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/readable-stream": { + "version": "3.6.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/cdktf/node_modules/readdir-glob": { + "version": "1.1.3", + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/cdktf/node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/semver": { + "version": "7.6.3", + "inBundle": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/set-function-length": { + "version": "1.2.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/streamx": { + "version": "2.16.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/cdktf/node_modules/string_decoder": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/cdktf/node_modules/tar-stream": { + "version": "3.1.7", + "inBundle": true, + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/cdktf/node_modules/util-deprecate": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/wrappy": { + "version": "1.0.2", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/zip-stream": { + "version": "5.0.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "archiver-utils": "^4.0.1", + "compress-commons": "^5.0.1", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" + }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "engines": { + "node": ">=18" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/constructs": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.4.2.tgz", + "integrity": "sha512-wsNxBlAott2qg8Zv87q3eYZYgheb9lchtBfjHzzLHtXbttwSrHPs1NNQbBrmbb1YZvYg2+Vh0Dor76w4mFxJkA==", + "peer": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, @@ -7407,7 +8048,6 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -8103,6 +8743,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-assembly-schema": { @@ -8162,6 +8809,11 @@ "version": "0.0.1", "bundled": true }, + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + }, "fs-extra": { "version": "9.1.0", "bundled": true, @@ -8223,6 +8875,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-fc": { @@ -8234,6 +8893,13 @@ "@alicloud/ros-cdk-oss": "^1.0.25", "@alicloud/ros-cdk-ossassets": "^1.0.25", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-fc3": { @@ -8243,6 +8909,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-oss": { @@ -8252,6 +8925,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-ossassets": { @@ -8330,6 +9010,11 @@ "set-function-length": "^1.2.1" } }, + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + }, "content-type": { "version": "1.0.5", "bundled": true @@ -8879,6 +9564,11 @@ "set-function-length": "^1.2.1" } }, + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + }, "content-type": { "version": "1.0.5", "bundled": true @@ -9354,6 +10044,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-ros": { @@ -9363,6 +10060,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros-cdk-sls": { @@ -9372,6 +10076,13 @@ "requires": { "@alicloud/ros-cdk-core": "^1.0.27", "constructs": "^3.0.4" + }, + "dependencies": { + "constructs": { + "version": "3.4.344", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", + "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + } } }, "@alicloud/ros20190910": { @@ -11174,6 +11885,374 @@ "integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==", "dev": true }, + "cdktf": { + "version": "0.20.10", + "resolved": "https://registry.npmjs.org/cdktf/-/cdktf-0.20.10.tgz", + "integrity": "sha512-I8c838lNDHUeOIFCeZ6NsLHivAaYVoc+3a8k84hYP+BkQtoqCiOhcYjrm7lH42CwqfBBR+BoD7lB5AFeHekd5A==", + "requires": { + "archiver": "6.0.2", + "json-stable-stringify": "1.1.1", + "semver": "7.6.3" + }, + "dependencies": { + "archiver": { + "version": "6.0.2", + "bundled": true, + "requires": { + "archiver-utils": "^4.0.1", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^5.0.1" + } + }, + "archiver-utils": { + "version": "4.0.1", + "bundled": true, + "requires": { + "glob": "^8.0.0", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + } + }, + "async": { + "version": "3.2.5", + "bundled": true + }, + "b4a": { + "version": "1.6.6", + "bundled": true + }, + "balanced-match": { + "version": "1.0.2", + "bundled": true + }, + "bare-events": { + "version": "2.2.1", + "bundled": true, + "optional": true + }, + "brace-expansion": { + "version": "2.0.1", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "bundled": true + }, + "call-bind": { + "version": "1.0.7", + "bundled": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "compress-commons": { + "version": "5.0.3", + "bundled": true, + "requires": { + "crc-32": "^1.2.0", + "crc32-stream": "^5.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + } + }, + "core-util-is": { + "version": "1.0.3", + "bundled": true + }, + "crc-32": { + "version": "1.2.2", + "bundled": true + }, + "crc32-stream": { + "version": "5.0.1", + "bundled": true, + "requires": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + } + }, + "define-data-property": { + "version": "1.1.4", + "bundled": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "es-define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "bundled": true + }, + "fast-fifo": { + "version": "1.3.2", + "bundled": true + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "function-bind": { + "version": "1.1.2", + "bundled": true + }, + "get-intrinsic": { + "version": "1.2.4", + "bundled": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "glob": { + "version": "8.1.0", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "gopd": { + "version": "1.0.1", + "bundled": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "bundled": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "bundled": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "bundled": true + }, + "has-symbols": { + "version": "1.0.3", + "bundled": true + }, + "hasown": { + "version": "2.0.2", + "bundled": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true + }, + "isarray": { + "version": "2.0.5", + "bundled": true + }, + "json-stable-stringify": { + "version": "1.1.1", + "bundled": true, + "requires": { + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + } + }, + "jsonify": { + "version": "0.0.1", + "bundled": true + }, + "lazystream": { + "version": "1.0.1", + "bundled": true, + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "readable-stream": { + "version": "2.3.8", + "bundled": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "lodash": { + "version": "4.17.21", + "bundled": true + }, + "minimatch": { + "version": "5.1.6", + "bundled": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "bundled": true + }, + "object-keys": { + "version": "1.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "process-nextick-args": { + "version": "2.0.1", + "bundled": true + }, + "queue-tick": { + "version": "1.0.1", + "bundled": true + }, + "readable-stream": { + "version": "3.6.2", + "bundled": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdir-glob": { + "version": "1.1.3", + "bundled": true, + "requires": { + "minimatch": "^5.1.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "bundled": true + }, + "semver": { + "version": "7.6.3", + "bundled": true + }, + "set-function-length": { + "version": "1.2.2", + "bundled": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "streamx": { + "version": "2.16.1", + "bundled": true, + "requires": { + "bare-events": "^2.2.0", + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "bundled": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "tar-stream": { + "version": "3.1.7", + "bundled": true, + "requires": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "zip-stream": { + "version": "5.0.2", + "bundled": true, + "requires": { + "archiver-utils": "^4.0.1", + "compress-commons": "^5.0.1", + "readable-stream": "^3.6.0" + } + } + } + }, "chalk": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", @@ -11252,9 +12331,10 @@ "dev": true }, "constructs": { - "version": "3.4.344", - "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.4.344.tgz", - "integrity": "sha512-Qq3upn44oGdvgasHUKWVFsrynyYrtVRd9fd8ko9cJOrFzx9eCm3iI4bhBryQqaISdausbTYUOXmoEe/YSJ16Nw==" + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.4.2.tgz", + "integrity": "sha512-wsNxBlAott2qg8Zv87q3eYZYgheb9lchtBfjHzzLHtXbttwSrHPs1NNQbBrmbb1YZvYg2+Vh0Dor76w4mFxJkA==", + "peer": true }, "convert-source-map": { "version": "2.0.0", @@ -13380,8 +14460,7 @@ "semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" }, "shebang-command": { "version": "2.0.0", diff --git a/package.json b/package.json index b9f089b9..7f94a690 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@alicloud/ros-cdk-ram": "^1.4.0", "@alicloud/ros20190910": "^3.5.2", "ajv": "^8.17.1", + "cdktf": "^0.20.10", "chalk": "^5.3.0", "commander": "^12.1.0", "i18n": "^0.15.1", diff --git a/src/constructs/constraints.json b/src/constructs/constraints.json new file mode 100644 index 00000000..57b13eaf --- /dev/null +++ b/src/constructs/constraints.json @@ -0,0 +1,6 @@ +{ + "cdktf": "0.20.10", + "providers": { + "huaweicloud": "~> 1.71" + } +} diff --git a/src/constructs/providers/huaweicloud/aad-forward-rule/README.md b/src/constructs/providers/huaweicloud/aad-forward-rule/README.md new file mode 100644 index 00000000..50e3d949 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aad-forward-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aad_forward_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aad_forward_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule). diff --git a/src/constructs/providers/huaweicloud/aad-forward-rule/index.ts b/src/constructs/providers/huaweicloud/aad-forward-rule/index.ts new file mode 100644 index 00000000..b3554c88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aad-forward-rule/index.ts @@ -0,0 +1,281 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AadForwardRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#forward_port AadForwardRule#forward_port} + */ + readonly forwardPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#forward_protocol AadForwardRule#forward_protocol} + */ + readonly forwardProtocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#id AadForwardRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#instance_id AadForwardRule#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#ip AadForwardRule#ip} + */ + readonly ip: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#source_ip AadForwardRule#source_ip} + */ + readonly sourceIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#source_port AadForwardRule#source_port} + */ + readonly sourcePort: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule huaweicloud_aad_forward_rule} +*/ +export class AadForwardRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aad_forward_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AadForwardRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AadForwardRule to import + * @param importFromId The id of the existing AadForwardRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AadForwardRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aad_forward_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aad_forward_rule huaweicloud_aad_forward_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AadForwardRuleConfig + */ + public constructor(scope: Construct, id: string, config: AadForwardRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aad_forward_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._forwardPort = config.forwardPort; + this._forwardProtocol = config.forwardProtocol; + this._id = config.id; + this._instanceId = config.instanceId; + this._ip = config.ip; + this._sourceIp = config.sourceIp; + this._sourcePort = config.sourcePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // forward_port - computed: false, optional: false, required: true + private _forwardPort?: number; + public get forwardPort() { + return this.getNumberAttribute('forward_port'); + } + public set forwardPort(value: number) { + this._forwardPort = value; + } + // Temporarily expose input value. Use with caution. + public get forwardPortInput() { + return this._forwardPort; + } + + // forward_protocol - computed: false, optional: false, required: true + private _forwardProtocol?: string; + public get forwardProtocol() { + return this.getStringAttribute('forward_protocol'); + } + public set forwardProtocol(value: string) { + this._forwardProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get forwardProtocolInput() { + return this._forwardProtocol; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // lb_method - computed: true, optional: false, required: false + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // source_ip - computed: false, optional: false, required: true + private _sourceIp?: string; + public get sourceIp() { + return this.getStringAttribute('source_ip'); + } + public set sourceIp(value: string) { + this._sourceIp = value; + } + // Temporarily expose input value. Use with caution. + public get sourceIpInput() { + return this._sourceIp; + } + + // source_port - computed: false, optional: false, required: true + private _sourcePort?: number; + public get sourcePort() { + return this.getNumberAttribute('source_port'); + } + public set sourcePort(value: number) { + this._sourcePort = value; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + forward_port: cdktf.numberToTerraform(this._forwardPort), + forward_protocol: cdktf.stringToTerraform(this._forwardProtocol), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + ip: cdktf.stringToTerraform(this._ip), + source_ip: cdktf.stringToTerraform(this._sourceIp), + source_port: cdktf.numberToTerraform(this._sourcePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + forward_port: { + value: cdktf.numberToHclTerraform(this._forwardPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + forward_protocol: { + value: cdktf.stringToHclTerraform(this._forwardProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(this._ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip: { + value: cdktf.stringToHclTerraform(this._sourceIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.numberToHclTerraform(this._sourcePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/access-analyzer-archive-rule/README.md b/src/constructs/providers/huaweicloud/access-analyzer-archive-rule/README.md new file mode 100644 index 00000000..e1451ea6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/access-analyzer-archive-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_access_analyzer_archive_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_access_analyzer_archive_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule). diff --git a/src/constructs/providers/huaweicloud/access-analyzer-archive-rule/index.ts b/src/constructs/providers/huaweicloud/access-analyzer-archive-rule/index.ts new file mode 100644 index 00000000..24489c7c --- /dev/null +++ b/src/constructs/providers/huaweicloud/access-analyzer-archive-rule/index.ts @@ -0,0 +1,609 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AccessAnalyzerArchiveRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#analyzer_id AccessAnalyzerArchiveRule#analyzer_id} + */ + readonly analyzerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#enable_force_new AccessAnalyzerArchiveRule#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#id AccessAnalyzerArchiveRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#name AccessAnalyzerArchiveRule#name} + */ + readonly name: string; + /** + * filters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#filters AccessAnalyzerArchiveRule#filters} + */ + readonly filters: AccessAnalyzerArchiveRuleFilters[] | cdktf.IResolvable; +} +export interface AccessAnalyzerArchiveRuleFiltersCriterion { + /** + * Specifies the cluster informations in the mesh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#contains AccessAnalyzerArchiveRule#contains} + */ + readonly contains?: string[]; + /** + * Specifies the cluster informations in the mesh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#eq AccessAnalyzerArchiveRule#eq} + */ + readonly eq?: string[]; + /** + * Specifies the cluster informations in the mesh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#exists AccessAnalyzerArchiveRule#exists} + */ + readonly exists?: string; + /** + * Specifies the cluster informations in the mesh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#neq AccessAnalyzerArchiveRule#neq} + */ + readonly neq?: string[]; +} + +export function accessAnalyzerArchiveRuleFiltersCriterionToTerraform(struct?: AccessAnalyzerArchiveRuleFiltersCriterionOutputReference | AccessAnalyzerArchiveRuleFiltersCriterion): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + contains: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.contains), + eq: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.eq), + exists: cdktf.stringToTerraform(struct!.exists), + neq: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.neq), + } +} + + +export function accessAnalyzerArchiveRuleFiltersCriterionToHclTerraform(struct?: AccessAnalyzerArchiveRuleFiltersCriterionOutputReference | AccessAnalyzerArchiveRuleFiltersCriterion): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + contains: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.contains), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + eq: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.eq), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + exists: { + value: cdktf.stringToHclTerraform(struct!.exists), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + neq: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.neq), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AccessAnalyzerArchiveRuleFiltersCriterionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AccessAnalyzerArchiveRuleFiltersCriterion | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._contains !== undefined) { + hasAnyValues = true; + internalValueResult.contains = this._contains; + } + if (this._eq !== undefined) { + hasAnyValues = true; + internalValueResult.eq = this._eq; + } + if (this._exists !== undefined) { + hasAnyValues = true; + internalValueResult.exists = this._exists; + } + if (this._neq !== undefined) { + hasAnyValues = true; + internalValueResult.neq = this._neq; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AccessAnalyzerArchiveRuleFiltersCriterion | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._contains = undefined; + this._eq = undefined; + this._exists = undefined; + this._neq = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._contains = value.contains; + this._eq = value.eq; + this._exists = value.exists; + this._neq = value.neq; + } + } + + // contains - computed: false, optional: true, required: false + private _contains?: string[]; + public get contains() { + return this.getListAttribute('contains'); + } + public set contains(value: string[]) { + this._contains = value; + } + public resetContains() { + this._contains = undefined; + } + // Temporarily expose input value. Use with caution. + public get containsInput() { + return this._contains; + } + + // eq - computed: false, optional: true, required: false + private _eq?: string[]; + public get eq() { + return this.getListAttribute('eq'); + } + public set eq(value: string[]) { + this._eq = value; + } + public resetEq() { + this._eq = undefined; + } + // Temporarily expose input value. Use with caution. + public get eqInput() { + return this._eq; + } + + // exists - computed: false, optional: true, required: false + private _exists?: string; + public get exists() { + return this.getStringAttribute('exists'); + } + public set exists(value: string) { + this._exists = value; + } + public resetExists() { + this._exists = undefined; + } + // Temporarily expose input value. Use with caution. + public get existsInput() { + return this._exists; + } + + // neq - computed: false, optional: true, required: false + private _neq?: string[]; + public get neq() { + return this.getListAttribute('neq'); + } + public set neq(value: string[]) { + this._neq = value; + } + public resetNeq() { + this._neq = undefined; + } + // Temporarily expose input value. Use with caution. + public get neqInput() { + return this._neq; + } +} +export interface AccessAnalyzerArchiveRuleFilters { + /** + * Specifies the cluster informations in the mesh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#key AccessAnalyzerArchiveRule#key} + */ + readonly key: string; + /** + * Specifies the cluster informations in the mesh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#organization_id AccessAnalyzerArchiveRule#organization_id} + */ + readonly organizationId?: string; + /** + * criterion block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#criterion AccessAnalyzerArchiveRule#criterion} + */ + readonly criterion: AccessAnalyzerArchiveRuleFiltersCriterion; +} + +export function accessAnalyzerArchiveRuleFiltersToTerraform(struct?: AccessAnalyzerArchiveRuleFilters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + organization_id: cdktf.stringToTerraform(struct!.organizationId), + criterion: accessAnalyzerArchiveRuleFiltersCriterionToTerraform(struct!.criterion), + } +} + + +export function accessAnalyzerArchiveRuleFiltersToHclTerraform(struct?: AccessAnalyzerArchiveRuleFilters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_id: { + value: cdktf.stringToHclTerraform(struct!.organizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + criterion: { + value: accessAnalyzerArchiveRuleFiltersCriterionToHclTerraform(struct!.criterion), + isBlock: true, + type: "list", + storageClassType: "AccessAnalyzerArchiveRuleFiltersCriterionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AccessAnalyzerArchiveRuleFiltersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AccessAnalyzerArchiveRuleFilters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._organizationId !== undefined) { + hasAnyValues = true; + internalValueResult.organizationId = this._organizationId; + } + if (this._criterion?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.criterion = this._criterion?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AccessAnalyzerArchiveRuleFilters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._organizationId = undefined; + this._criterion.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._organizationId = value.organizationId; + this._criterion.internalValue = value.criterion; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // organization_id - computed: false, optional: true, required: false + private _organizationId?: string; + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + public set organizationId(value: string) { + this._organizationId = value; + } + public resetOrganizationId() { + this._organizationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationIdInput() { + return this._organizationId; + } + + // criterion - computed: false, optional: false, required: true + private _criterion = new AccessAnalyzerArchiveRuleFiltersCriterionOutputReference(this, "criterion"); + public get criterion() { + return this._criterion; + } + public putCriterion(value: AccessAnalyzerArchiveRuleFiltersCriterion) { + this._criterion.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get criterionInput() { + return this._criterion.internalValue; + } +} + +export class AccessAnalyzerArchiveRuleFiltersList extends cdktf.ComplexList { + public internalValue? : AccessAnalyzerArchiveRuleFilters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AccessAnalyzerArchiveRuleFiltersOutputReference { + return new AccessAnalyzerArchiveRuleFiltersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule huaweicloud_access_analyzer_archive_rule} +*/ +export class AccessAnalyzerArchiveRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_access_analyzer_archive_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AccessAnalyzerArchiveRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AccessAnalyzerArchiveRule to import + * @param importFromId The id of the existing AccessAnalyzerArchiveRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AccessAnalyzerArchiveRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_access_analyzer_archive_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer_archive_rule huaweicloud_access_analyzer_archive_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AccessAnalyzerArchiveRuleConfig + */ + public constructor(scope: Construct, id: string, config: AccessAnalyzerArchiveRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_access_analyzer_archive_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._analyzerId = config.analyzerId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._name = config.name; + this._filters.internalValue = config.filters; + } + + // ========== + // ATTRIBUTES + // ========== + + // analyzer_id - computed: false, optional: false, required: true + private _analyzerId?: string; + public get analyzerId() { + return this.getStringAttribute('analyzer_id'); + } + public set analyzerId(value: string) { + this._analyzerId = value; + } + // Temporarily expose input value. Use with caution. + public get analyzerIdInput() { + return this._analyzerId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // filters - computed: false, optional: false, required: true + private _filters = new AccessAnalyzerArchiveRuleFiltersList(this, "filters", false); + public get filters() { + return this._filters; + } + public putFilters(value: AccessAnalyzerArchiveRuleFilters[] | cdktf.IResolvable) { + this._filters.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get filtersInput() { + return this._filters.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + analyzer_id: cdktf.stringToTerraform(this._analyzerId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + filters: cdktf.listMapper(accessAnalyzerArchiveRuleFiltersToTerraform, true)(this._filters.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + analyzer_id: { + value: cdktf.stringToHclTerraform(this._analyzerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filters: { + value: cdktf.listMapperHcl(accessAnalyzerArchiveRuleFiltersToHclTerraform, true)(this._filters.internalValue), + isBlock: true, + type: "list", + storageClassType: "AccessAnalyzerArchiveRuleFiltersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/access-analyzer/README.md b/src/constructs/providers/huaweicloud/access-analyzer/README.md new file mode 100644 index 00000000..fb36014a --- /dev/null +++ b/src/constructs/providers/huaweicloud/access-analyzer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_access_analyzer` + +Refer to the Terraform Registry for docs: [`huaweicloud_access_analyzer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer). diff --git a/src/constructs/providers/huaweicloud/access-analyzer/index.ts b/src/constructs/providers/huaweicloud/access-analyzer/index.ts new file mode 100644 index 00000000..7172083c --- /dev/null +++ b/src/constructs/providers/huaweicloud/access-analyzer/index.ts @@ -0,0 +1,247 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AccessAnalyzerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer#enable_force_new AccessAnalyzer#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer#id AccessAnalyzer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer#name AccessAnalyzer#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer#tags AccessAnalyzer#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer#type AccessAnalyzer#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer huaweicloud_access_analyzer} +*/ +export class AccessAnalyzer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_access_analyzer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AccessAnalyzer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AccessAnalyzer to import + * @param importFromId The id of the existing AccessAnalyzer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AccessAnalyzer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_access_analyzer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/access_analyzer huaweicloud_access_analyzer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AccessAnalyzerConfig + */ + public constructor(scope: Construct, id: string, config: AccessAnalyzerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_access_analyzer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._name = config.name; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // last_analyzed_resource - computed: true, optional: false, required: false + public get lastAnalyzedResource() { + return this.getStringAttribute('last_analyzed_resource'); + } + + // last_resource_analyzed_at - computed: true, optional: false, required: false + public get lastResourceAnalyzedAt() { + return this.getStringAttribute('last_resource_analyzed_at'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/antiddos-basic/README.md b/src/constructs/providers/huaweicloud/antiddos-basic/README.md new file mode 100644 index 00000000..713371ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/antiddos-basic/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_antiddos_basic` + +Refer to the Terraform Registry for docs: [`huaweicloud_antiddos_basic`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic). diff --git a/src/constructs/providers/huaweicloud/antiddos-basic/index.ts b/src/constructs/providers/huaweicloud/antiddos-basic/index.ts new file mode 100644 index 00000000..a85cc91b --- /dev/null +++ b/src/constructs/providers/huaweicloud/antiddos-basic/index.ts @@ -0,0 +1,389 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AntiddosBasicConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#eip_id AntiddosBasic#eip_id} + */ + readonly eipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#id AntiddosBasic#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#region AntiddosBasic#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#topic_urn AntiddosBasic#topic_urn} + */ + readonly topicUrn?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#traffic_threshold AntiddosBasic#traffic_threshold} + */ + readonly trafficThreshold: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#timeouts AntiddosBasic#timeouts} + */ + readonly timeouts?: AntiddosBasicTimeouts; +} +export interface AntiddosBasicTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#delete AntiddosBasic#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#update AntiddosBasic#update} + */ + readonly update?: string; +} + +export function antiddosBasicTimeoutsToTerraform(struct?: AntiddosBasicTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function antiddosBasicTimeoutsToHclTerraform(struct?: AntiddosBasicTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AntiddosBasicTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AntiddosBasicTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AntiddosBasicTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + this._update = value.update; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic huaweicloud_antiddos_basic} +*/ +export class AntiddosBasic extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos_basic"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AntiddosBasic resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AntiddosBasic to import + * @param importFromId The id of the existing AntiddosBasic that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AntiddosBasic to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos_basic", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_basic huaweicloud_antiddos_basic} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AntiddosBasicConfig + */ + public constructor(scope: Construct, id: string, config: AntiddosBasicConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos_basic', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._eipId = config.eipId; + this._id = config.id; + this._region = config.region; + this._topicUrn = config.topicUrn; + this._trafficThreshold = config.trafficThreshold; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // eip_id - computed: false, optional: false, required: true + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // topic_urn - computed: false, optional: true, required: false + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + public resetTopicUrn() { + this._topicUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // traffic_threshold - computed: false, optional: false, required: true + private _trafficThreshold?: number; + public get trafficThreshold() { + return this.getNumberAttribute('traffic_threshold'); + } + public set trafficThreshold(value: number) { + this._trafficThreshold = value; + } + // Temporarily expose input value. Use with caution. + public get trafficThresholdInput() { + return this._trafficThreshold; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AntiddosBasicTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AntiddosBasicTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + eip_id: cdktf.stringToTerraform(this._eipId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + traffic_threshold: cdktf.numberToTerraform(this._trafficThreshold), + timeouts: antiddosBasicTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_threshold: { + value: cdktf.numberToHclTerraform(this._trafficThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: antiddosBasicTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AntiddosBasicTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/antiddos-default-protection-policy/README.md b/src/constructs/providers/huaweicloud/antiddos-default-protection-policy/README.md new file mode 100644 index 00000000..f2f1a6bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/antiddos-default-protection-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_antiddos_default_protection_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_antiddos_default_protection_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy). diff --git a/src/constructs/providers/huaweicloud/antiddos-default-protection-policy/index.ts b/src/constructs/providers/huaweicloud/antiddos-default-protection-policy/index.ts new file mode 100644 index 00000000..459125d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/antiddos-default-protection-policy/index.ts @@ -0,0 +1,173 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AntiddosDefaultProtectionPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy#id AntiddosDefaultProtectionPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy#region AntiddosDefaultProtectionPolicy#region} + */ + readonly region?: string; + /** + * The traffic cleaning threshold in Mbps. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy#traffic_threshold AntiddosDefaultProtectionPolicy#traffic_threshold} + */ + readonly trafficThreshold: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy huaweicloud_antiddos_default_protection_policy} +*/ +export class AntiddosDefaultProtectionPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos_default_protection_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AntiddosDefaultProtectionPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AntiddosDefaultProtectionPolicy to import + * @param importFromId The id of the existing AntiddosDefaultProtectionPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AntiddosDefaultProtectionPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos_default_protection_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/antiddos_default_protection_policy huaweicloud_antiddos_default_protection_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AntiddosDefaultProtectionPolicyConfig + */ + public constructor(scope: Construct, id: string, config: AntiddosDefaultProtectionPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos_default_protection_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._trafficThreshold = config.trafficThreshold; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // traffic_threshold - computed: false, optional: false, required: true + private _trafficThreshold?: number; + public get trafficThreshold() { + return this.getNumberAttribute('traffic_threshold'); + } + public set trafficThreshold(value: number) { + this._trafficThreshold = value; + } + // Temporarily expose input value. Use with caution. + public get trafficThresholdInput() { + return this._trafficThreshold; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + traffic_threshold: cdktf.numberToTerraform(this._trafficThreshold), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_threshold: { + value: cdktf.numberToHclTerraform(this._trafficThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-alarm-action-rule/README.md b/src/constructs/providers/huaweicloud/aom-alarm-action-rule/README.md new file mode 100644 index 00000000..119cf3ad --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-action-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_alarm_action_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_alarm_action_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule). diff --git a/src/constructs/providers/huaweicloud/aom-alarm-action-rule/index.ts b/src/constructs/providers/huaweicloud/aom-alarm-action-rule/index.ts new file mode 100644 index 00000000..0512a295 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-action-rule/index.ts @@ -0,0 +1,442 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomAlarmActionRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action rule description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#description AomAlarmActionRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#id AomAlarmActionRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the action rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#name AomAlarmActionRule#name} + */ + readonly name: string; + /** + * Specifies the notification template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#notification_template AomAlarmActionRule#notification_template} + */ + readonly notificationTemplate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#region AomAlarmActionRule#region} + */ + readonly region?: string; + /** + * Specifies the action rule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#type AomAlarmActionRule#type} + */ + readonly type: string; + /** + * smn_topics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#smn_topics AomAlarmActionRule#smn_topics} + */ + readonly smnTopics: AomAlarmActionRuleSmnTopics[] | cdktf.IResolvable; +} +export interface AomAlarmActionRuleSmnTopics { + /** + * Specifies the SMN topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#name AomAlarmActionRule#name} + */ + readonly name?: string; + /** + * Specifies the SMN topic URN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#topic_urn AomAlarmActionRule#topic_urn} + */ + readonly topicUrn: string; +} + +export function aomAlarmActionRuleSmnTopicsToTerraform(struct?: AomAlarmActionRuleSmnTopics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function aomAlarmActionRuleSmnTopicsToHclTerraform(struct?: AomAlarmActionRuleSmnTopics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmActionRuleSmnTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmActionRuleSmnTopics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmActionRuleSmnTopics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._topicUrn = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._topicUrn = value.topicUrn; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} + +export class AomAlarmActionRuleSmnTopicsList extends cdktf.ComplexList { + public internalValue? : AomAlarmActionRuleSmnTopics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmActionRuleSmnTopicsOutputReference { + return new AomAlarmActionRuleSmnTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule huaweicloud_aom_alarm_action_rule} +*/ +export class AomAlarmActionRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_action_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomAlarmActionRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomAlarmActionRule to import + * @param importFromId The id of the existing AomAlarmActionRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomAlarmActionRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_action_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_action_rule huaweicloud_aom_alarm_action_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomAlarmActionRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomAlarmActionRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_action_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._notificationTemplate = config.notificationTemplate; + this._region = config.region; + this._type = config.type; + this._smnTopics.internalValue = config.smnTopics; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getNumberAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_template - computed: false, optional: false, required: true + private _notificationTemplate?: string; + public get notificationTemplate() { + return this.getStringAttribute('notification_template'); + } + public set notificationTemplate(value: string) { + this._notificationTemplate = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTemplateInput() { + return this._notificationTemplate; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getNumberAttribute('updated_at'); + } + + // smn_topics - computed: false, optional: false, required: true + private _smnTopics = new AomAlarmActionRuleSmnTopicsList(this, "smn_topics", false); + public get smnTopics() { + return this._smnTopics; + } + public putSmnTopics(value: AomAlarmActionRuleSmnTopics[] | cdktf.IResolvable) { + this._smnTopics.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get smnTopicsInput() { + return this._smnTopics.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_template: cdktf.stringToTerraform(this._notificationTemplate), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + smn_topics: cdktf.listMapper(aomAlarmActionRuleSmnTopicsToTerraform, true)(this._smnTopics.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_template: { + value: cdktf.stringToHclTerraform(this._notificationTemplate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + smn_topics: { + value: cdktf.listMapperHcl(aomAlarmActionRuleSmnTopicsToHclTerraform, true)(this._smnTopics.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmActionRuleSmnTopicsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-alarm-group-rule/README.md b/src/constructs/providers/huaweicloud/aom-alarm-group-rule/README.md new file mode 100644 index 00000000..ac8973ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-group-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_alarm_group_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_alarm_group_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule). diff --git a/src/constructs/providers/huaweicloud/aom-alarm-group-rule/index.ts b/src/constructs/providers/huaweicloud/aom-alarm-group-rule/index.ts new file mode 100644 index 00000000..eab82a8d --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-group-rule/index.ts @@ -0,0 +1,683 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomAlarmGroupRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#description AomAlarmGroupRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#enterprise_project_id AomAlarmGroupRule#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#group_by AomAlarmGroupRule#group_by} + */ + readonly groupBy: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#group_interval AomAlarmGroupRule#group_interval} + */ + readonly groupInterval: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#group_repeat_waiting AomAlarmGroupRule#group_repeat_waiting} + */ + readonly groupRepeatWaiting: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#group_wait AomAlarmGroupRule#group_wait} + */ + readonly groupWait: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#id AomAlarmGroupRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#name AomAlarmGroupRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#region AomAlarmGroupRule#region} + */ + readonly region?: string; + /** + * detail block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#detail AomAlarmGroupRule#detail} + */ + readonly detail: AomAlarmGroupRuleDetail[] | cdktf.IResolvable; +} +export interface AomAlarmGroupRuleDetailMatch { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#key AomAlarmGroupRule#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#operate AomAlarmGroupRule#operate} + */ + readonly operate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#value AomAlarmGroupRule#value} + */ + readonly value?: string[]; +} + +export function aomAlarmGroupRuleDetailMatchToTerraform(struct?: AomAlarmGroupRuleDetailMatch | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + operate: cdktf.stringToTerraform(struct!.operate), + value: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.value), + } +} + + +export function aomAlarmGroupRuleDetailMatchToHclTerraform(struct?: AomAlarmGroupRuleDetailMatch | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operate: { + value: cdktf.stringToHclTerraform(struct!.operate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.value), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmGroupRuleDetailMatchOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmGroupRuleDetailMatch | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._operate !== undefined) { + hasAnyValues = true; + internalValueResult.operate = this._operate; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmGroupRuleDetailMatch | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._operate = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._operate = value.operate; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // operate - computed: false, optional: false, required: true + private _operate?: string; + public get operate() { + return this.getStringAttribute('operate'); + } + public set operate(value: string) { + this._operate = value; + } + // Temporarily expose input value. Use with caution. + public get operateInput() { + return this._operate; + } + + // value - computed: false, optional: true, required: false + private _value?: string[]; + public get value() { + return cdktf.Fn.tolist(this.getListAttribute('value')); + } + public set value(value: string[]) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class AomAlarmGroupRuleDetailMatchList extends cdktf.ComplexList { + public internalValue? : AomAlarmGroupRuleDetailMatch[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmGroupRuleDetailMatchOutputReference { + return new AomAlarmGroupRuleDetailMatchOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmGroupRuleDetail { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#bind_notification_rule_ids AomAlarmGroupRule#bind_notification_rule_ids} + */ + readonly bindNotificationRuleIds: string[]; + /** + * match block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#match AomAlarmGroupRule#match} + */ + readonly match: AomAlarmGroupRuleDetailMatch[] | cdktf.IResolvable; +} + +export function aomAlarmGroupRuleDetailToTerraform(struct?: AomAlarmGroupRuleDetail | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bind_notification_rule_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.bindNotificationRuleIds), + match: cdktf.listMapper(aomAlarmGroupRuleDetailMatchToTerraform, true)(struct!.match), + } +} + + +export function aomAlarmGroupRuleDetailToHclTerraform(struct?: AomAlarmGroupRuleDetail | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bind_notification_rule_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.bindNotificationRuleIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + match: { + value: cdktf.listMapperHcl(aomAlarmGroupRuleDetailMatchToHclTerraform, true)(struct!.match), + isBlock: true, + type: "set", + storageClassType: "AomAlarmGroupRuleDetailMatchList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmGroupRuleDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmGroupRuleDetail | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bindNotificationRuleIds !== undefined) { + hasAnyValues = true; + internalValueResult.bindNotificationRuleIds = this._bindNotificationRuleIds; + } + if (this._match?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.match = this._match?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmGroupRuleDetail | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bindNotificationRuleIds = undefined; + this._match.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bindNotificationRuleIds = value.bindNotificationRuleIds; + this._match.internalValue = value.match; + } + } + + // bind_notification_rule_ids - computed: false, optional: false, required: true + private _bindNotificationRuleIds?: string[]; + public get bindNotificationRuleIds() { + return cdktf.Fn.tolist(this.getListAttribute('bind_notification_rule_ids')); + } + public set bindNotificationRuleIds(value: string[]) { + this._bindNotificationRuleIds = value; + } + // Temporarily expose input value. Use with caution. + public get bindNotificationRuleIdsInput() { + return this._bindNotificationRuleIds; + } + + // match - computed: false, optional: false, required: true + private _match = new AomAlarmGroupRuleDetailMatchList(this, "match", true); + public get match() { + return this._match; + } + public putMatch(value: AomAlarmGroupRuleDetailMatch[] | cdktf.IResolvable) { + this._match.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get matchInput() { + return this._match.internalValue; + } +} + +export class AomAlarmGroupRuleDetailList extends cdktf.ComplexList { + public internalValue? : AomAlarmGroupRuleDetail[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmGroupRuleDetailOutputReference { + return new AomAlarmGroupRuleDetailOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule huaweicloud_aom_alarm_group_rule} +*/ +export class AomAlarmGroupRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_group_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomAlarmGroupRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomAlarmGroupRule to import + * @param importFromId The id of the existing AomAlarmGroupRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomAlarmGroupRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_group_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_group_rule huaweicloud_aom_alarm_group_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomAlarmGroupRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomAlarmGroupRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_group_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupBy = config.groupBy; + this._groupInterval = config.groupInterval; + this._groupRepeatWaiting = config.groupRepeatWaiting; + this._groupWait = config.groupWait; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._detail.internalValue = config.detail; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_by - computed: false, optional: false, required: true + private _groupBy?: string[]; + public get groupBy() { + return cdktf.Fn.tolist(this.getListAttribute('group_by')); + } + public set groupBy(value: string[]) { + this._groupBy = value; + } + // Temporarily expose input value. Use with caution. + public get groupByInput() { + return this._groupBy; + } + + // group_interval - computed: false, optional: false, required: true + private _groupInterval?: number; + public get groupInterval() { + return this.getNumberAttribute('group_interval'); + } + public set groupInterval(value: number) { + this._groupInterval = value; + } + // Temporarily expose input value. Use with caution. + public get groupIntervalInput() { + return this._groupInterval; + } + + // group_repeat_waiting - computed: false, optional: false, required: true + private _groupRepeatWaiting?: number; + public get groupRepeatWaiting() { + return this.getNumberAttribute('group_repeat_waiting'); + } + public set groupRepeatWaiting(value: number) { + this._groupRepeatWaiting = value; + } + // Temporarily expose input value. Use with caution. + public get groupRepeatWaitingInput() { + return this._groupRepeatWaiting; + } + + // group_wait - computed: false, optional: false, required: true + private _groupWait?: number; + public get groupWait() { + return this.getNumberAttribute('group_wait'); + } + public set groupWait(value: number) { + this._groupWait = value; + } + // Temporarily expose input value. Use with caution. + public get groupWaitInput() { + return this._groupWait; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // detail - computed: false, optional: false, required: true + private _detail = new AomAlarmGroupRuleDetailList(this, "detail", true); + public get detail() { + return this._detail; + } + public putDetail(value: AomAlarmGroupRuleDetail[] | cdktf.IResolvable) { + this._detail.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get detailInput() { + return this._detail.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_by: cdktf.listMapper(cdktf.stringToTerraform, false)(this._groupBy), + group_interval: cdktf.numberToTerraform(this._groupInterval), + group_repeat_waiting: cdktf.numberToTerraform(this._groupRepeatWaiting), + group_wait: cdktf.numberToTerraform(this._groupWait), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + detail: cdktf.listMapper(aomAlarmGroupRuleDetailToTerraform, true)(this._detail.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_by: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._groupBy), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + group_interval: { + value: cdktf.numberToHclTerraform(this._groupInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + group_repeat_waiting: { + value: cdktf.numberToHclTerraform(this._groupRepeatWaiting), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + group_wait: { + value: cdktf.numberToHclTerraform(this._groupWait), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detail: { + value: cdktf.listMapperHcl(aomAlarmGroupRuleDetailToHclTerraform, true)(this._detail.internalValue), + isBlock: true, + type: "set", + storageClassType: "AomAlarmGroupRuleDetailList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-alarm-policy/README.md b/src/constructs/providers/huaweicloud/aom-alarm-policy/README.md new file mode 100644 index 00000000..39d7829e --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_alarm_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_alarm_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy). diff --git a/src/constructs/providers/huaweicloud/aom-alarm-policy/index.ts b/src/constructs/providers/huaweicloud/aom-alarm-policy/index.ts new file mode 100644 index 00000000..af7005c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-policy/index.ts @@ -0,0 +1,2780 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomAlarmPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_description AomAlarmPolicy#alarm_rule_description} + */ + readonly alarmRuleDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_enable AomAlarmPolicy#alarm_rule_enable} + */ + readonly alarmRuleEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_name AomAlarmPolicy#alarm_rule_name} + */ + readonly alarmRuleName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_status AomAlarmPolicy#alarm_rule_status} + */ + readonly alarmRuleStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_type AomAlarmPolicy#alarm_rule_type} + */ + readonly alarmRuleType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#id AomAlarmPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#region AomAlarmPolicy#region} + */ + readonly region?: string; + /** + * alarm_notifications block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_notifications AomAlarmPolicy#alarm_notifications} + */ + readonly alarmNotifications?: AomAlarmPolicyAlarmNotifications[] | cdktf.IResolvable; + /** + * event_alarm_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#event_alarm_spec AomAlarmPolicy#event_alarm_spec} + */ + readonly eventAlarmSpec?: AomAlarmPolicyEventAlarmSpec[] | cdktf.IResolvable; + /** + * metric_alarm_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_alarm_spec AomAlarmPolicy#metric_alarm_spec} + */ + readonly metricAlarmSpec?: AomAlarmPolicyMetricAlarmSpec[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#timeouts AomAlarmPolicy#timeouts} + */ + readonly timeouts?: AomAlarmPolicyTimeouts; +} +export interface AomAlarmPolicyAlarmNotifications { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#bind_notification_rule_id AomAlarmPolicy#bind_notification_rule_id} + */ + readonly bindNotificationRuleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#inhibit_enable AomAlarmPolicy#inhibit_enable} + */ + readonly inhibitEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#inhibit_rule AomAlarmPolicy#inhibit_rule} + */ + readonly inhibitRule?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#notification_enable AomAlarmPolicy#notification_enable} + */ + readonly notificationEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#notification_type AomAlarmPolicy#notification_type} + */ + readonly notificationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#notify_resolved AomAlarmPolicy#notify_resolved} + */ + readonly notifyResolved?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#route_group_enable AomAlarmPolicy#route_group_enable} + */ + readonly routeGroupEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#route_group_rule AomAlarmPolicy#route_group_rule} + */ + readonly routeGroupRule?: string; +} + +export function aomAlarmPolicyAlarmNotificationsToTerraform(struct?: AomAlarmPolicyAlarmNotifications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bind_notification_rule_id: cdktf.stringToTerraform(struct!.bindNotificationRuleId), + inhibit_enable: cdktf.booleanToTerraform(struct!.inhibitEnable), + inhibit_rule: cdktf.stringToTerraform(struct!.inhibitRule), + notification_enable: cdktf.booleanToTerraform(struct!.notificationEnable), + notification_type: cdktf.stringToTerraform(struct!.notificationType), + notify_resolved: cdktf.booleanToTerraform(struct!.notifyResolved), + route_group_enable: cdktf.booleanToTerraform(struct!.routeGroupEnable), + route_group_rule: cdktf.stringToTerraform(struct!.routeGroupRule), + } +} + + +export function aomAlarmPolicyAlarmNotificationsToHclTerraform(struct?: AomAlarmPolicyAlarmNotifications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bind_notification_rule_id: { + value: cdktf.stringToHclTerraform(struct!.bindNotificationRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inhibit_enable: { + value: cdktf.booleanToHclTerraform(struct!.inhibitEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + inhibit_rule: { + value: cdktf.stringToHclTerraform(struct!.inhibitRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_enable: { + value: cdktf.booleanToHclTerraform(struct!.notificationEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + notification_type: { + value: cdktf.stringToHclTerraform(struct!.notificationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notify_resolved: { + value: cdktf.booleanToHclTerraform(struct!.notifyResolved), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + route_group_enable: { + value: cdktf.booleanToHclTerraform(struct!.routeGroupEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + route_group_rule: { + value: cdktf.stringToHclTerraform(struct!.routeGroupRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyAlarmNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyAlarmNotifications | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bindNotificationRuleId !== undefined) { + hasAnyValues = true; + internalValueResult.bindNotificationRuleId = this._bindNotificationRuleId; + } + if (this._inhibitEnable !== undefined) { + hasAnyValues = true; + internalValueResult.inhibitEnable = this._inhibitEnable; + } + if (this._inhibitRule !== undefined) { + hasAnyValues = true; + internalValueResult.inhibitRule = this._inhibitRule; + } + if (this._notificationEnable !== undefined) { + hasAnyValues = true; + internalValueResult.notificationEnable = this._notificationEnable; + } + if (this._notificationType !== undefined) { + hasAnyValues = true; + internalValueResult.notificationType = this._notificationType; + } + if (this._notifyResolved !== undefined) { + hasAnyValues = true; + internalValueResult.notifyResolved = this._notifyResolved; + } + if (this._routeGroupEnable !== undefined) { + hasAnyValues = true; + internalValueResult.routeGroupEnable = this._routeGroupEnable; + } + if (this._routeGroupRule !== undefined) { + hasAnyValues = true; + internalValueResult.routeGroupRule = this._routeGroupRule; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyAlarmNotifications | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bindNotificationRuleId = undefined; + this._inhibitEnable = undefined; + this._inhibitRule = undefined; + this._notificationEnable = undefined; + this._notificationType = undefined; + this._notifyResolved = undefined; + this._routeGroupEnable = undefined; + this._routeGroupRule = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bindNotificationRuleId = value.bindNotificationRuleId; + this._inhibitEnable = value.inhibitEnable; + this._inhibitRule = value.inhibitRule; + this._notificationEnable = value.notificationEnable; + this._notificationType = value.notificationType; + this._notifyResolved = value.notifyResolved; + this._routeGroupEnable = value.routeGroupEnable; + this._routeGroupRule = value.routeGroupRule; + } + } + + // bind_notification_rule_id - computed: true, optional: true, required: false + private _bindNotificationRuleId?: string; + public get bindNotificationRuleId() { + return this.getStringAttribute('bind_notification_rule_id'); + } + public set bindNotificationRuleId(value: string) { + this._bindNotificationRuleId = value; + } + public resetBindNotificationRuleId() { + this._bindNotificationRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindNotificationRuleIdInput() { + return this._bindNotificationRuleId; + } + + // inhibit_enable - computed: true, optional: true, required: false + private _inhibitEnable?: boolean | cdktf.IResolvable; + public get inhibitEnable() { + return this.getBooleanAttribute('inhibit_enable'); + } + public set inhibitEnable(value: boolean | cdktf.IResolvable) { + this._inhibitEnable = value; + } + public resetInhibitEnable() { + this._inhibitEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get inhibitEnableInput() { + return this._inhibitEnable; + } + + // inhibit_rule - computed: true, optional: true, required: false + private _inhibitRule?: string; + public get inhibitRule() { + return this.getStringAttribute('inhibit_rule'); + } + public set inhibitRule(value: string) { + this._inhibitRule = value; + } + public resetInhibitRule() { + this._inhibitRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get inhibitRuleInput() { + return this._inhibitRule; + } + + // notification_enable - computed: true, optional: true, required: false + private _notificationEnable?: boolean | cdktf.IResolvable; + public get notificationEnable() { + return this.getBooleanAttribute('notification_enable'); + } + public set notificationEnable(value: boolean | cdktf.IResolvable) { + this._notificationEnable = value; + } + public resetNotificationEnable() { + this._notificationEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationEnableInput() { + return this._notificationEnable; + } + + // notification_type - computed: true, optional: true, required: false + private _notificationType?: string; + public get notificationType() { + return this.getStringAttribute('notification_type'); + } + public set notificationType(value: string) { + this._notificationType = value; + } + public resetNotificationType() { + this._notificationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationTypeInput() { + return this._notificationType; + } + + // notify_resolved - computed: true, optional: true, required: false + private _notifyResolved?: boolean | cdktf.IResolvable; + public get notifyResolved() { + return this.getBooleanAttribute('notify_resolved'); + } + public set notifyResolved(value: boolean | cdktf.IResolvable) { + this._notifyResolved = value; + } + public resetNotifyResolved() { + this._notifyResolved = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyResolvedInput() { + return this._notifyResolved; + } + + // route_group_enable - computed: true, optional: true, required: false + private _routeGroupEnable?: boolean | cdktf.IResolvable; + public get routeGroupEnable() { + return this.getBooleanAttribute('route_group_enable'); + } + public set routeGroupEnable(value: boolean | cdktf.IResolvable) { + this._routeGroupEnable = value; + } + public resetRouteGroupEnable() { + this._routeGroupEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeGroupEnableInput() { + return this._routeGroupEnable; + } + + // route_group_rule - computed: true, optional: true, required: false + private _routeGroupRule?: string; + public get routeGroupRule() { + return this.getStringAttribute('route_group_rule'); + } + public set routeGroupRule(value: string) { + this._routeGroupRule = value; + } + public resetRouteGroupRule() { + this._routeGroupRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeGroupRuleInput() { + return this._routeGroupRule; + } +} + +export class AomAlarmPolicyAlarmNotificationsList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyAlarmNotifications[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyAlarmNotificationsOutputReference { + return new AomAlarmPolicyAlarmNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyEventAlarmSpecAlarmTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#auto_tags AomAlarmPolicy#auto_tags} + */ + readonly autoTags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#custom_annotations AomAlarmPolicy#custom_annotations} + */ + readonly customAnnotations?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#custom_tags AomAlarmPolicy#custom_tags} + */ + readonly customTags?: string[]; +} + +export function aomAlarmPolicyEventAlarmSpecAlarmTagsToTerraform(struct?: AomAlarmPolicyEventAlarmSpecAlarmTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auto_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.autoTags), + custom_annotations: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customAnnotations), + custom_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customTags), + } +} + + +export function aomAlarmPolicyEventAlarmSpecAlarmTagsToHclTerraform(struct?: AomAlarmPolicyEventAlarmSpecAlarmTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auto_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.autoTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + custom_annotations: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customAnnotations), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + custom_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyEventAlarmSpecAlarmTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyEventAlarmSpecAlarmTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._autoTags !== undefined) { + hasAnyValues = true; + internalValueResult.autoTags = this._autoTags; + } + if (this._customAnnotations !== undefined) { + hasAnyValues = true; + internalValueResult.customAnnotations = this._customAnnotations; + } + if (this._customTags !== undefined) { + hasAnyValues = true; + internalValueResult.customTags = this._customTags; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyEventAlarmSpecAlarmTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._autoTags = undefined; + this._customAnnotations = undefined; + this._customTags = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._autoTags = value.autoTags; + this._customAnnotations = value.customAnnotations; + this._customTags = value.customTags; + } + } + + // auto_tags - computed: true, optional: true, required: false + private _autoTags?: string[]; + public get autoTags() { + return this.getListAttribute('auto_tags'); + } + public set autoTags(value: string[]) { + this._autoTags = value; + } + public resetAutoTags() { + this._autoTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoTagsInput() { + return this._autoTags; + } + + // custom_annotations - computed: true, optional: true, required: false + private _customAnnotations?: string[]; + public get customAnnotations() { + return this.getListAttribute('custom_annotations'); + } + public set customAnnotations(value: string[]) { + this._customAnnotations = value; + } + public resetCustomAnnotations() { + this._customAnnotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get customAnnotationsInput() { + return this._customAnnotations; + } + + // custom_tags - computed: true, optional: true, required: false + private _customTags?: string[]; + public get customTags() { + return this.getListAttribute('custom_tags'); + } + public set customTags(value: string[]) { + this._customTags = value; + } + public resetCustomTags() { + this._customTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get customTagsInput() { + return this._customTags; + } +} + +export class AomAlarmPolicyEventAlarmSpecAlarmTagsList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyEventAlarmSpecAlarmTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyEventAlarmSpecAlarmTagsOutputReference { + return new AomAlarmPolicyEventAlarmSpecAlarmTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyEventAlarmSpecNoDataConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#no_data_alert_state AomAlarmPolicy#no_data_alert_state} + */ + readonly noDataAlertState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#no_data_timeframe AomAlarmPolicy#no_data_timeframe} + */ + readonly noDataTimeframe?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#notify_no_data AomAlarmPolicy#notify_no_data} + */ + readonly notifyNoData?: boolean | cdktf.IResolvable; +} + +export function aomAlarmPolicyEventAlarmSpecNoDataConditionsToTerraform(struct?: AomAlarmPolicyEventAlarmSpecNoDataConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + no_data_alert_state: cdktf.stringToTerraform(struct!.noDataAlertState), + no_data_timeframe: cdktf.numberToTerraform(struct!.noDataTimeframe), + notify_no_data: cdktf.booleanToTerraform(struct!.notifyNoData), + } +} + + +export function aomAlarmPolicyEventAlarmSpecNoDataConditionsToHclTerraform(struct?: AomAlarmPolicyEventAlarmSpecNoDataConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + no_data_alert_state: { + value: cdktf.stringToHclTerraform(struct!.noDataAlertState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_data_timeframe: { + value: cdktf.numberToHclTerraform(struct!.noDataTimeframe), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + notify_no_data: { + value: cdktf.booleanToHclTerraform(struct!.notifyNoData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyEventAlarmSpecNoDataConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyEventAlarmSpecNoDataConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._noDataAlertState !== undefined) { + hasAnyValues = true; + internalValueResult.noDataAlertState = this._noDataAlertState; + } + if (this._noDataTimeframe !== undefined) { + hasAnyValues = true; + internalValueResult.noDataTimeframe = this._noDataTimeframe; + } + if (this._notifyNoData !== undefined) { + hasAnyValues = true; + internalValueResult.notifyNoData = this._notifyNoData; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyEventAlarmSpecNoDataConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._noDataAlertState = undefined; + this._noDataTimeframe = undefined; + this._notifyNoData = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._noDataAlertState = value.noDataAlertState; + this._noDataTimeframe = value.noDataTimeframe; + this._notifyNoData = value.notifyNoData; + } + } + + // no_data_alert_state - computed: true, optional: true, required: false + private _noDataAlertState?: string; + public get noDataAlertState() { + return this.getStringAttribute('no_data_alert_state'); + } + public set noDataAlertState(value: string) { + this._noDataAlertState = value; + } + public resetNoDataAlertState() { + this._noDataAlertState = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataAlertStateInput() { + return this._noDataAlertState; + } + + // no_data_timeframe - computed: true, optional: true, required: false + private _noDataTimeframe?: number; + public get noDataTimeframe() { + return this.getNumberAttribute('no_data_timeframe'); + } + public set noDataTimeframe(value: number) { + this._noDataTimeframe = value; + } + public resetNoDataTimeframe() { + this._noDataTimeframe = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataTimeframeInput() { + return this._noDataTimeframe; + } + + // notify_no_data - computed: true, optional: true, required: false + private _notifyNoData?: boolean | cdktf.IResolvable; + public get notifyNoData() { + return this.getBooleanAttribute('notify_no_data'); + } + public set notifyNoData(value: boolean | cdktf.IResolvable) { + this._notifyNoData = value; + } + public resetNotifyNoData() { + this._notifyNoData = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyNoDataInput() { + return this._notifyNoData; + } +} + +export class AomAlarmPolicyEventAlarmSpecNoDataConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyEventAlarmSpecNoDataConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyEventAlarmSpecNoDataConditionsOutputReference { + return new AomAlarmPolicyEventAlarmSpecNoDataConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyEventAlarmSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#event_source AomAlarmPolicy#event_source} + */ + readonly eventSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#monitor_objects AomAlarmPolicy#monitor_objects} + */ + readonly monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * alarm_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_tags AomAlarmPolicy#alarm_tags} + */ + readonly alarmTags?: AomAlarmPolicyEventAlarmSpecAlarmTags[] | cdktf.IResolvable; + /** + * no_data_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#no_data_conditions AomAlarmPolicy#no_data_conditions} + */ + readonly noDataConditions?: AomAlarmPolicyEventAlarmSpecNoDataConditions[] | cdktf.IResolvable; +} + +export function aomAlarmPolicyEventAlarmSpecToTerraform(struct?: AomAlarmPolicyEventAlarmSpec | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + event_source: cdktf.stringToTerraform(struct!.eventSource), + monitor_objects: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(struct!.monitorObjects), + alarm_tags: cdktf.listMapper(aomAlarmPolicyEventAlarmSpecAlarmTagsToTerraform, true)(struct!.alarmTags), + no_data_conditions: cdktf.listMapper(aomAlarmPolicyEventAlarmSpecNoDataConditionsToTerraform, true)(struct!.noDataConditions), + } +} + + +export function aomAlarmPolicyEventAlarmSpecToHclTerraform(struct?: AomAlarmPolicyEventAlarmSpec | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + event_source: { + value: cdktf.stringToHclTerraform(struct!.eventSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + monitor_objects: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(struct!.monitorObjects), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + alarm_tags: { + value: cdktf.listMapperHcl(aomAlarmPolicyEventAlarmSpecAlarmTagsToHclTerraform, true)(struct!.alarmTags), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyEventAlarmSpecAlarmTagsList", + }, + no_data_conditions: { + value: cdktf.listMapperHcl(aomAlarmPolicyEventAlarmSpecNoDataConditionsToHclTerraform, true)(struct!.noDataConditions), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyEventAlarmSpecNoDataConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyEventAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyEventAlarmSpec | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._eventSource !== undefined) { + hasAnyValues = true; + internalValueResult.eventSource = this._eventSource; + } + if (this._monitorObjects !== undefined) { + hasAnyValues = true; + internalValueResult.monitorObjects = this._monitorObjects; + } + if (this._alarmTags?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.alarmTags = this._alarmTags?.internalValue; + } + if (this._noDataConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.noDataConditions = this._noDataConditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyEventAlarmSpec | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._eventSource = undefined; + this._monitorObjects = undefined; + this._alarmTags.internalValue = undefined; + this._noDataConditions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._eventSource = value.eventSource; + this._monitorObjects = value.monitorObjects; + this._alarmTags.internalValue = value.alarmTags; + this._noDataConditions.internalValue = value.noDataConditions; + } + } + + // event_source - computed: false, optional: true, required: false + private _eventSource?: string; + public get eventSource() { + return this.getStringAttribute('event_source'); + } + public set eventSource(value: string) { + this._eventSource = value; + } + public resetEventSource() { + this._eventSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventSourceInput() { + return this._eventSource; + } + + // monitor_objects - computed: true, optional: true, required: false + private _monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + public get monitorObjects() { + return this.interpolationForAttribute('monitor_objects'); + } + public set monitorObjects(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._monitorObjects = value; + } + public resetMonitorObjects() { + this._monitorObjects = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorObjectsInput() { + return this._monitorObjects; + } + + // alarm_tags - computed: false, optional: true, required: false + private _alarmTags = new AomAlarmPolicyEventAlarmSpecAlarmTagsList(this, "alarm_tags", false); + public get alarmTags() { + return this._alarmTags; + } + public putAlarmTags(value: AomAlarmPolicyEventAlarmSpecAlarmTags[] | cdktf.IResolvable) { + this._alarmTags.internalValue = value; + } + public resetAlarmTags() { + this._alarmTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmTagsInput() { + return this._alarmTags.internalValue; + } + + // no_data_conditions - computed: false, optional: true, required: false + private _noDataConditions = new AomAlarmPolicyEventAlarmSpecNoDataConditionsList(this, "no_data_conditions", false); + public get noDataConditions() { + return this._noDataConditions; + } + public putNoDataConditions(value: AomAlarmPolicyEventAlarmSpecNoDataConditions[] | cdktf.IResolvable) { + this._noDataConditions.internalValue = value; + } + public resetNoDataConditions() { + this._noDataConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataConditionsInput() { + return this._noDataConditions.internalValue; + } +} + +export class AomAlarmPolicyEventAlarmSpecList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyEventAlarmSpec[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyEventAlarmSpecOutputReference { + return new AomAlarmPolicyEventAlarmSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyMetricAlarmSpecAlarmTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#auto_tags AomAlarmPolicy#auto_tags} + */ + readonly autoTags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#custom_annotations AomAlarmPolicy#custom_annotations} + */ + readonly customAnnotations?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#custom_tags AomAlarmPolicy#custom_tags} + */ + readonly customTags?: string[]; +} + +export function aomAlarmPolicyMetricAlarmSpecAlarmTagsToTerraform(struct?: AomAlarmPolicyMetricAlarmSpecAlarmTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auto_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.autoTags), + custom_annotations: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customAnnotations), + custom_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customTags), + } +} + + +export function aomAlarmPolicyMetricAlarmSpecAlarmTagsToHclTerraform(struct?: AomAlarmPolicyMetricAlarmSpecAlarmTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auto_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.autoTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + custom_annotations: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customAnnotations), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + custom_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyMetricAlarmSpecAlarmTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyMetricAlarmSpecAlarmTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._autoTags !== undefined) { + hasAnyValues = true; + internalValueResult.autoTags = this._autoTags; + } + if (this._customAnnotations !== undefined) { + hasAnyValues = true; + internalValueResult.customAnnotations = this._customAnnotations; + } + if (this._customTags !== undefined) { + hasAnyValues = true; + internalValueResult.customTags = this._customTags; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyMetricAlarmSpecAlarmTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._autoTags = undefined; + this._customAnnotations = undefined; + this._customTags = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._autoTags = value.autoTags; + this._customAnnotations = value.customAnnotations; + this._customTags = value.customTags; + } + } + + // auto_tags - computed: true, optional: true, required: false + private _autoTags?: string[]; + public get autoTags() { + return this.getListAttribute('auto_tags'); + } + public set autoTags(value: string[]) { + this._autoTags = value; + } + public resetAutoTags() { + this._autoTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoTagsInput() { + return this._autoTags; + } + + // custom_annotations - computed: true, optional: true, required: false + private _customAnnotations?: string[]; + public get customAnnotations() { + return this.getListAttribute('custom_annotations'); + } + public set customAnnotations(value: string[]) { + this._customAnnotations = value; + } + public resetCustomAnnotations() { + this._customAnnotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get customAnnotationsInput() { + return this._customAnnotations; + } + + // custom_tags - computed: true, optional: true, required: false + private _customTags?: string[]; + public get customTags() { + return this.getListAttribute('custom_tags'); + } + public set customTags(value: string[]) { + this._customTags = value; + } + public resetCustomTags() { + this._customTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get customTagsInput() { + return this._customTags; + } +} + +export class AomAlarmPolicyMetricAlarmSpecAlarmTagsList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyMetricAlarmSpecAlarmTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyMetricAlarmSpecAlarmTagsOutputReference { + return new AomAlarmPolicyMetricAlarmSpecAlarmTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyMetricAlarmSpecNoDataConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#no_data_alert_state AomAlarmPolicy#no_data_alert_state} + */ + readonly noDataAlertState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#no_data_timeframe AomAlarmPolicy#no_data_timeframe} + */ + readonly noDataTimeframe?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#notify_no_data AomAlarmPolicy#notify_no_data} + */ + readonly notifyNoData?: boolean | cdktf.IResolvable; +} + +export function aomAlarmPolicyMetricAlarmSpecNoDataConditionsToTerraform(struct?: AomAlarmPolicyMetricAlarmSpecNoDataConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + no_data_alert_state: cdktf.stringToTerraform(struct!.noDataAlertState), + no_data_timeframe: cdktf.numberToTerraform(struct!.noDataTimeframe), + notify_no_data: cdktf.booleanToTerraform(struct!.notifyNoData), + } +} + + +export function aomAlarmPolicyMetricAlarmSpecNoDataConditionsToHclTerraform(struct?: AomAlarmPolicyMetricAlarmSpecNoDataConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + no_data_alert_state: { + value: cdktf.stringToHclTerraform(struct!.noDataAlertState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_data_timeframe: { + value: cdktf.numberToHclTerraform(struct!.noDataTimeframe), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + notify_no_data: { + value: cdktf.booleanToHclTerraform(struct!.notifyNoData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyMetricAlarmSpecNoDataConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyMetricAlarmSpecNoDataConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._noDataAlertState !== undefined) { + hasAnyValues = true; + internalValueResult.noDataAlertState = this._noDataAlertState; + } + if (this._noDataTimeframe !== undefined) { + hasAnyValues = true; + internalValueResult.noDataTimeframe = this._noDataTimeframe; + } + if (this._notifyNoData !== undefined) { + hasAnyValues = true; + internalValueResult.notifyNoData = this._notifyNoData; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyMetricAlarmSpecNoDataConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._noDataAlertState = undefined; + this._noDataTimeframe = undefined; + this._notifyNoData = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._noDataAlertState = value.noDataAlertState; + this._noDataTimeframe = value.noDataTimeframe; + this._notifyNoData = value.notifyNoData; + } + } + + // no_data_alert_state - computed: true, optional: true, required: false + private _noDataAlertState?: string; + public get noDataAlertState() { + return this.getStringAttribute('no_data_alert_state'); + } + public set noDataAlertState(value: string) { + this._noDataAlertState = value; + } + public resetNoDataAlertState() { + this._noDataAlertState = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataAlertStateInput() { + return this._noDataAlertState; + } + + // no_data_timeframe - computed: true, optional: true, required: false + private _noDataTimeframe?: number; + public get noDataTimeframe() { + return this.getNumberAttribute('no_data_timeframe'); + } + public set noDataTimeframe(value: number) { + this._noDataTimeframe = value; + } + public resetNoDataTimeframe() { + this._noDataTimeframe = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataTimeframeInput() { + return this._noDataTimeframe; + } + + // notify_no_data - computed: true, optional: true, required: false + private _notifyNoData?: boolean | cdktf.IResolvable; + public get notifyNoData() { + return this.getBooleanAttribute('notify_no_data'); + } + public set notifyNoData(value: boolean | cdktf.IResolvable) { + this._notifyNoData = value; + } + public resetNotifyNoData() { + this._notifyNoData = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyNoDataInput() { + return this._notifyNoData; + } +} + +export class AomAlarmPolicyMetricAlarmSpecNoDataConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyMetricAlarmSpecNoDataConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyMetricAlarmSpecNoDataConditionsOutputReference { + return new AomAlarmPolicyMetricAlarmSpecNoDataConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyMetricAlarmSpecTriggerConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#aggregation_type AomAlarmPolicy#aggregation_type} + */ + readonly aggregationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#aggregation_window AomAlarmPolicy#aggregation_window} + */ + readonly aggregationWindow?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_labels AomAlarmPolicy#metric_labels} + */ + readonly metricLabels?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_name AomAlarmPolicy#metric_name} + */ + readonly metricName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_namespace AomAlarmPolicy#metric_namespace} + */ + readonly metricNamespace?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_query_mode AomAlarmPolicy#metric_query_mode} + */ + readonly metricQueryMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_unit AomAlarmPolicy#metric_unit} + */ + readonly metricUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#operator AomAlarmPolicy#operator} + */ + readonly operator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#promql AomAlarmPolicy#promql} + */ + readonly promql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#thresholds AomAlarmPolicy#thresholds} + */ + readonly thresholds?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#trigger_interval AomAlarmPolicy#trigger_interval} + */ + readonly triggerInterval?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#trigger_times AomAlarmPolicy#trigger_times} + */ + readonly triggerTimes?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#trigger_type AomAlarmPolicy#trigger_type} + */ + readonly triggerType?: string; +} + +export function aomAlarmPolicyMetricAlarmSpecTriggerConditionsToTerraform(struct?: AomAlarmPolicyMetricAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aggregation_type: cdktf.stringToTerraform(struct!.aggregationType), + aggregation_window: cdktf.stringToTerraform(struct!.aggregationWindow), + metric_labels: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.metricLabels), + metric_name: cdktf.stringToTerraform(struct!.metricName), + metric_namespace: cdktf.stringToTerraform(struct!.metricNamespace), + metric_query_mode: cdktf.stringToTerraform(struct!.metricQueryMode), + metric_unit: cdktf.stringToTerraform(struct!.metricUnit), + operator: cdktf.stringToTerraform(struct!.operator), + promql: cdktf.stringToTerraform(struct!.promql), + thresholds: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.thresholds), + trigger_interval: cdktf.stringToTerraform(struct!.triggerInterval), + trigger_times: cdktf.numberToTerraform(struct!.triggerTimes), + trigger_type: cdktf.stringToTerraform(struct!.triggerType), + } +} + + +export function aomAlarmPolicyMetricAlarmSpecTriggerConditionsToHclTerraform(struct?: AomAlarmPolicyMetricAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aggregation_type: { + value: cdktf.stringToHclTerraform(struct!.aggregationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aggregation_window: { + value: cdktf.stringToHclTerraform(struct!.aggregationWindow), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_labels: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.metricLabels), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_namespace: { + value: cdktf.stringToHclTerraform(struct!.metricNamespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_query_mode: { + value: cdktf.stringToHclTerraform(struct!.metricQueryMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_unit: { + value: cdktf.stringToHclTerraform(struct!.metricUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + promql: { + value: cdktf.stringToHclTerraform(struct!.promql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thresholds: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.thresholds), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + trigger_interval: { + value: cdktf.stringToHclTerraform(struct!.triggerInterval), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_times: { + value: cdktf.numberToHclTerraform(struct!.triggerTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(struct!.triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyMetricAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyMetricAlarmSpecTriggerConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._aggregationType !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationType = this._aggregationType; + } + if (this._aggregationWindow !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationWindow = this._aggregationWindow; + } + if (this._metricLabels !== undefined) { + hasAnyValues = true; + internalValueResult.metricLabels = this._metricLabels; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._metricNamespace !== undefined) { + hasAnyValues = true; + internalValueResult.metricNamespace = this._metricNamespace; + } + if (this._metricQueryMode !== undefined) { + hasAnyValues = true; + internalValueResult.metricQueryMode = this._metricQueryMode; + } + if (this._metricUnit !== undefined) { + hasAnyValues = true; + internalValueResult.metricUnit = this._metricUnit; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._promql !== undefined) { + hasAnyValues = true; + internalValueResult.promql = this._promql; + } + if (this._thresholds !== undefined) { + hasAnyValues = true; + internalValueResult.thresholds = this._thresholds; + } + if (this._triggerInterval !== undefined) { + hasAnyValues = true; + internalValueResult.triggerInterval = this._triggerInterval; + } + if (this._triggerTimes !== undefined) { + hasAnyValues = true; + internalValueResult.triggerTimes = this._triggerTimes; + } + if (this._triggerType !== undefined) { + hasAnyValues = true; + internalValueResult.triggerType = this._triggerType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyMetricAlarmSpecTriggerConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._aggregationType = undefined; + this._aggregationWindow = undefined; + this._metricLabels = undefined; + this._metricName = undefined; + this._metricNamespace = undefined; + this._metricQueryMode = undefined; + this._metricUnit = undefined; + this._operator = undefined; + this._promql = undefined; + this._thresholds = undefined; + this._triggerInterval = undefined; + this._triggerTimes = undefined; + this._triggerType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._aggregationType = value.aggregationType; + this._aggregationWindow = value.aggregationWindow; + this._metricLabels = value.metricLabels; + this._metricName = value.metricName; + this._metricNamespace = value.metricNamespace; + this._metricQueryMode = value.metricQueryMode; + this._metricUnit = value.metricUnit; + this._operator = value.operator; + this._promql = value.promql; + this._thresholds = value.thresholds; + this._triggerInterval = value.triggerInterval; + this._triggerTimes = value.triggerTimes; + this._triggerType = value.triggerType; + } + } + + // aggregation_type - computed: true, optional: true, required: false + private _aggregationType?: string; + public get aggregationType() { + return this.getStringAttribute('aggregation_type'); + } + public set aggregationType(value: string) { + this._aggregationType = value; + } + public resetAggregationType() { + this._aggregationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationTypeInput() { + return this._aggregationType; + } + + // aggregation_window - computed: true, optional: true, required: false + private _aggregationWindow?: string; + public get aggregationWindow() { + return this.getStringAttribute('aggregation_window'); + } + public set aggregationWindow(value: string) { + this._aggregationWindow = value; + } + public resetAggregationWindow() { + this._aggregationWindow = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationWindowInput() { + return this._aggregationWindow; + } + + // metric_labels - computed: true, optional: true, required: false + private _metricLabels?: string[]; + public get metricLabels() { + return this.getListAttribute('metric_labels'); + } + public set metricLabels(value: string[]) { + this._metricLabels = value; + } + public resetMetricLabels() { + this._metricLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricLabelsInput() { + return this._metricLabels; + } + + // metric_name - computed: true, optional: true, required: false + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + public resetMetricName() { + this._metricName = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // metric_namespace - computed: true, optional: true, required: false + private _metricNamespace?: string; + public get metricNamespace() { + return this.getStringAttribute('metric_namespace'); + } + public set metricNamespace(value: string) { + this._metricNamespace = value; + } + public resetMetricNamespace() { + this._metricNamespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNamespaceInput() { + return this._metricNamespace; + } + + // metric_query_mode - computed: true, optional: true, required: false + private _metricQueryMode?: string; + public get metricQueryMode() { + return this.getStringAttribute('metric_query_mode'); + } + public set metricQueryMode(value: string) { + this._metricQueryMode = value; + } + public resetMetricQueryMode() { + this._metricQueryMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricQueryModeInput() { + return this._metricQueryMode; + } + + // metric_unit - computed: true, optional: true, required: false + private _metricUnit?: string; + public get metricUnit() { + return this.getStringAttribute('metric_unit'); + } + public set metricUnit(value: string) { + this._metricUnit = value; + } + public resetMetricUnit() { + this._metricUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricUnitInput() { + return this._metricUnit; + } + + // operator - computed: true, optional: true, required: false + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + public resetOperator() { + this._operator = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // promql - computed: true, optional: true, required: false + private _promql?: string; + public get promql() { + return this.getStringAttribute('promql'); + } + public set promql(value: string) { + this._promql = value; + } + public resetPromql() { + this._promql = undefined; + } + // Temporarily expose input value. Use with caution. + public get promqlInput() { + return this._promql; + } + + // thresholds - computed: true, optional: true, required: false + private _thresholds?: { [key: string]: string }; + public get thresholds() { + return this.getStringMapAttribute('thresholds'); + } + public set thresholds(value: { [key: string]: string }) { + this._thresholds = value; + } + public resetThresholds() { + this._thresholds = undefined; + } + // Temporarily expose input value. Use with caution. + public get thresholdsInput() { + return this._thresholds; + } + + // trigger_interval - computed: true, optional: true, required: false + private _triggerInterval?: string; + public get triggerInterval() { + return this.getStringAttribute('trigger_interval'); + } + public set triggerInterval(value: string) { + this._triggerInterval = value; + } + public resetTriggerInterval() { + this._triggerInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerIntervalInput() { + return this._triggerInterval; + } + + // trigger_times - computed: true, optional: true, required: false + private _triggerTimes?: number; + public get triggerTimes() { + return this.getNumberAttribute('trigger_times'); + } + public set triggerTimes(value: number) { + this._triggerTimes = value; + } + public resetTriggerTimes() { + this._triggerTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTimesInput() { + return this._triggerTimes; + } + + // trigger_type - computed: true, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } +} + +export class AomAlarmPolicyMetricAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyMetricAlarmSpecTriggerConditionsOutputReference { + return new AomAlarmPolicyMetricAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyMetricAlarmSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_template_bind_enable AomAlarmPolicy#alarm_rule_template_bind_enable} + */ + readonly alarmRuleTemplateBindEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_rule_template_id AomAlarmPolicy#alarm_rule_template_id} + */ + readonly alarmRuleTemplateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#metric_kind AomAlarmPolicy#metric_kind} + */ + readonly metricKind?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#monitor_objects AomAlarmPolicy#monitor_objects} + */ + readonly monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#monitor_type AomAlarmPolicy#monitor_type} + */ + readonly monitorType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#recovery_conditions AomAlarmPolicy#recovery_conditions} + */ + readonly recoveryConditions?: { [key: string]: number }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#resource_kind AomAlarmPolicy#resource_kind} + */ + readonly resourceKind?: string; + /** + * alarm_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#alarm_tags AomAlarmPolicy#alarm_tags} + */ + readonly alarmTags?: AomAlarmPolicyMetricAlarmSpecAlarmTags[] | cdktf.IResolvable; + /** + * no_data_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#no_data_conditions AomAlarmPolicy#no_data_conditions} + */ + readonly noDataConditions?: AomAlarmPolicyMetricAlarmSpecNoDataConditions[] | cdktf.IResolvable; + /** + * trigger_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#trigger_conditions AomAlarmPolicy#trigger_conditions} + */ + readonly triggerConditions?: AomAlarmPolicyMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable; +} + +export function aomAlarmPolicyMetricAlarmSpecToTerraform(struct?: AomAlarmPolicyMetricAlarmSpec | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_rule_template_bind_enable: cdktf.booleanToTerraform(struct!.alarmRuleTemplateBindEnable), + alarm_rule_template_id: cdktf.stringToTerraform(struct!.alarmRuleTemplateId), + metric_kind: cdktf.stringToTerraform(struct!.metricKind), + monitor_objects: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(struct!.monitorObjects), + monitor_type: cdktf.stringToTerraform(struct!.monitorType), + recovery_conditions: cdktf.hashMapper(cdktf.numberToTerraform)(struct!.recoveryConditions), + resource_kind: cdktf.stringToTerraform(struct!.resourceKind), + alarm_tags: cdktf.listMapper(aomAlarmPolicyMetricAlarmSpecAlarmTagsToTerraform, true)(struct!.alarmTags), + no_data_conditions: cdktf.listMapper(aomAlarmPolicyMetricAlarmSpecNoDataConditionsToTerraform, true)(struct!.noDataConditions), + trigger_conditions: cdktf.listMapper(aomAlarmPolicyMetricAlarmSpecTriggerConditionsToTerraform, true)(struct!.triggerConditions), + } +} + + +export function aomAlarmPolicyMetricAlarmSpecToHclTerraform(struct?: AomAlarmPolicyMetricAlarmSpec | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_rule_template_bind_enable: { + value: cdktf.booleanToHclTerraform(struct!.alarmRuleTemplateBindEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + alarm_rule_template_id: { + value: cdktf.stringToHclTerraform(struct!.alarmRuleTemplateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_kind: { + value: cdktf.stringToHclTerraform(struct!.metricKind), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + monitor_objects: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(struct!.monitorObjects), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + monitor_type: { + value: cdktf.stringToHclTerraform(struct!.monitorType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recovery_conditions: { + value: cdktf.hashMapperHcl(cdktf.numberToHclTerraform)(struct!.recoveryConditions), + isBlock: false, + type: "map", + storageClassType: "numberMap", + }, + resource_kind: { + value: cdktf.stringToHclTerraform(struct!.resourceKind), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_tags: { + value: cdktf.listMapperHcl(aomAlarmPolicyMetricAlarmSpecAlarmTagsToHclTerraform, true)(struct!.alarmTags), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyMetricAlarmSpecAlarmTagsList", + }, + no_data_conditions: { + value: cdktf.listMapperHcl(aomAlarmPolicyMetricAlarmSpecNoDataConditionsToHclTerraform, true)(struct!.noDataConditions), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyMetricAlarmSpecNoDataConditionsList", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(aomAlarmPolicyMetricAlarmSpecTriggerConditionsToHclTerraform, true)(struct!.triggerConditions), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyMetricAlarmSpecTriggerConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyMetricAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmPolicyMetricAlarmSpec | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmRuleTemplateBindEnable !== undefined) { + hasAnyValues = true; + internalValueResult.alarmRuleTemplateBindEnable = this._alarmRuleTemplateBindEnable; + } + if (this._alarmRuleTemplateId !== undefined) { + hasAnyValues = true; + internalValueResult.alarmRuleTemplateId = this._alarmRuleTemplateId; + } + if (this._metricKind !== undefined) { + hasAnyValues = true; + internalValueResult.metricKind = this._metricKind; + } + if (this._monitorObjects !== undefined) { + hasAnyValues = true; + internalValueResult.monitorObjects = this._monitorObjects; + } + if (this._monitorType !== undefined) { + hasAnyValues = true; + internalValueResult.monitorType = this._monitorType; + } + if (this._recoveryConditions !== undefined) { + hasAnyValues = true; + internalValueResult.recoveryConditions = this._recoveryConditions; + } + if (this._resourceKind !== undefined) { + hasAnyValues = true; + internalValueResult.resourceKind = this._resourceKind; + } + if (this._alarmTags?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.alarmTags = this._alarmTags?.internalValue; + } + if (this._noDataConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.noDataConditions = this._noDataConditions?.internalValue; + } + if (this._triggerConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyMetricAlarmSpec | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._alarmRuleTemplateBindEnable = undefined; + this._alarmRuleTemplateId = undefined; + this._metricKind = undefined; + this._monitorObjects = undefined; + this._monitorType = undefined; + this._recoveryConditions = undefined; + this._resourceKind = undefined; + this._alarmTags.internalValue = undefined; + this._noDataConditions.internalValue = undefined; + this._triggerConditions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._alarmRuleTemplateBindEnable = value.alarmRuleTemplateBindEnable; + this._alarmRuleTemplateId = value.alarmRuleTemplateId; + this._metricKind = value.metricKind; + this._monitorObjects = value.monitorObjects; + this._monitorType = value.monitorType; + this._recoveryConditions = value.recoveryConditions; + this._resourceKind = value.resourceKind; + this._alarmTags.internalValue = value.alarmTags; + this._noDataConditions.internalValue = value.noDataConditions; + this._triggerConditions.internalValue = value.triggerConditions; + } + } + + // alarm_rule_template_bind_enable - computed: true, optional: true, required: false + private _alarmRuleTemplateBindEnable?: boolean | cdktf.IResolvable; + public get alarmRuleTemplateBindEnable() { + return this.getBooleanAttribute('alarm_rule_template_bind_enable'); + } + public set alarmRuleTemplateBindEnable(value: boolean | cdktf.IResolvable) { + this._alarmRuleTemplateBindEnable = value; + } + public resetAlarmRuleTemplateBindEnable() { + this._alarmRuleTemplateBindEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleTemplateBindEnableInput() { + return this._alarmRuleTemplateBindEnable; + } + + // alarm_rule_template_id - computed: true, optional: true, required: false + private _alarmRuleTemplateId?: string; + public get alarmRuleTemplateId() { + return this.getStringAttribute('alarm_rule_template_id'); + } + public set alarmRuleTemplateId(value: string) { + this._alarmRuleTemplateId = value; + } + public resetAlarmRuleTemplateId() { + this._alarmRuleTemplateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleTemplateIdInput() { + return this._alarmRuleTemplateId; + } + + // metric_kind - computed: true, optional: true, required: false + private _metricKind?: string; + public get metricKind() { + return this.getStringAttribute('metric_kind'); + } + public set metricKind(value: string) { + this._metricKind = value; + } + public resetMetricKind() { + this._metricKind = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricKindInput() { + return this._metricKind; + } + + // monitor_objects - computed: true, optional: true, required: false + private _monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + public get monitorObjects() { + return this.interpolationForAttribute('monitor_objects'); + } + public set monitorObjects(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._monitorObjects = value; + } + public resetMonitorObjects() { + this._monitorObjects = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorObjectsInput() { + return this._monitorObjects; + } + + // monitor_type - computed: false, optional: false, required: true + private _monitorType?: string; + public get monitorType() { + return this.getStringAttribute('monitor_type'); + } + public set monitorType(value: string) { + this._monitorType = value; + } + // Temporarily expose input value. Use with caution. + public get monitorTypeInput() { + return this._monitorType; + } + + // recovery_conditions - computed: true, optional: true, required: false + private _recoveryConditions?: { [key: string]: number }; + public get recoveryConditions() { + return this.getNumberMapAttribute('recovery_conditions'); + } + public set recoveryConditions(value: { [key: string]: number }) { + this._recoveryConditions = value; + } + public resetRecoveryConditions() { + this._recoveryConditions = undefined; + } + // Temporarily expose input value. Use with caution. + public get recoveryConditionsInput() { + return this._recoveryConditions; + } + + // resource_kind - computed: true, optional: true, required: false + private _resourceKind?: string; + public get resourceKind() { + return this.getStringAttribute('resource_kind'); + } + public set resourceKind(value: string) { + this._resourceKind = value; + } + public resetResourceKind() { + this._resourceKind = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceKindInput() { + return this._resourceKind; + } + + // alarm_tags - computed: false, optional: true, required: false + private _alarmTags = new AomAlarmPolicyMetricAlarmSpecAlarmTagsList(this, "alarm_tags", false); + public get alarmTags() { + return this._alarmTags; + } + public putAlarmTags(value: AomAlarmPolicyMetricAlarmSpecAlarmTags[] | cdktf.IResolvable) { + this._alarmTags.internalValue = value; + } + public resetAlarmTags() { + this._alarmTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmTagsInput() { + return this._alarmTags.internalValue; + } + + // no_data_conditions - computed: false, optional: true, required: false + private _noDataConditions = new AomAlarmPolicyMetricAlarmSpecNoDataConditionsList(this, "no_data_conditions", false); + public get noDataConditions() { + return this._noDataConditions; + } + public putNoDataConditions(value: AomAlarmPolicyMetricAlarmSpecNoDataConditions[] | cdktf.IResolvable) { + this._noDataConditions.internalValue = value; + } + public resetNoDataConditions() { + this._noDataConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataConditionsInput() { + return this._noDataConditions.internalValue; + } + + // trigger_conditions - computed: false, optional: true, required: false + private _triggerConditions = new AomAlarmPolicyMetricAlarmSpecTriggerConditionsList(this, "trigger_conditions", false); + public get triggerConditions() { + return this._triggerConditions; + } + public putTriggerConditions(value: AomAlarmPolicyMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable) { + this._triggerConditions.internalValue = value; + } + public resetTriggerConditions() { + this._triggerConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions.internalValue; + } +} + +export class AomAlarmPolicyMetricAlarmSpecList extends cdktf.ComplexList { + public internalValue? : AomAlarmPolicyMetricAlarmSpec[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmPolicyMetricAlarmSpecOutputReference { + return new AomAlarmPolicyMetricAlarmSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmPolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#create AomAlarmPolicy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#delete AomAlarmPolicy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#update AomAlarmPolicy#update} + */ + readonly update?: string; +} + +export function aomAlarmPolicyTimeoutsToTerraform(struct?: AomAlarmPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomAlarmPolicyTimeoutsToHclTerraform(struct?: AomAlarmPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmPolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomAlarmPolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmPolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy huaweicloud_aom_alarm_policy} +*/ +export class AomAlarmPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomAlarmPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomAlarmPolicy to import + * @param importFromId The id of the existing AomAlarmPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomAlarmPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_policy huaweicloud_aom_alarm_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomAlarmPolicyConfig + */ + public constructor(scope: Construct, id: string, config: AomAlarmPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmRuleDescription = config.alarmRuleDescription; + this._alarmRuleEnable = config.alarmRuleEnable; + this._alarmRuleName = config.alarmRuleName; + this._alarmRuleStatus = config.alarmRuleStatus; + this._alarmRuleType = config.alarmRuleType; + this._id = config.id; + this._region = config.region; + this._alarmNotifications.internalValue = config.alarmNotifications; + this._eventAlarmSpec.internalValue = config.eventAlarmSpec; + this._metricAlarmSpec.internalValue = config.metricAlarmSpec; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_rule_description - computed: true, optional: true, required: false + private _alarmRuleDescription?: string; + public get alarmRuleDescription() { + return this.getStringAttribute('alarm_rule_description'); + } + public set alarmRuleDescription(value: string) { + this._alarmRuleDescription = value; + } + public resetAlarmRuleDescription() { + this._alarmRuleDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleDescriptionInput() { + return this._alarmRuleDescription; + } + + // alarm_rule_enable - computed: true, optional: true, required: false + private _alarmRuleEnable?: boolean | cdktf.IResolvable; + public get alarmRuleEnable() { + return this.getBooleanAttribute('alarm_rule_enable'); + } + public set alarmRuleEnable(value: boolean | cdktf.IResolvable) { + this._alarmRuleEnable = value; + } + public resetAlarmRuleEnable() { + this._alarmRuleEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleEnableInput() { + return this._alarmRuleEnable; + } + + // alarm_rule_name - computed: false, optional: false, required: true + private _alarmRuleName?: string; + public get alarmRuleName() { + return this.getStringAttribute('alarm_rule_name'); + } + public set alarmRuleName(value: string) { + this._alarmRuleName = value; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleNameInput() { + return this._alarmRuleName; + } + + // alarm_rule_status - computed: true, optional: true, required: false + private _alarmRuleStatus?: string; + public get alarmRuleStatus() { + return this.getStringAttribute('alarm_rule_status'); + } + public set alarmRuleStatus(value: string) { + this._alarmRuleStatus = value; + } + public resetAlarmRuleStatus() { + this._alarmRuleStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleStatusInput() { + return this._alarmRuleStatus; + } + + // alarm_rule_type - computed: false, optional: false, required: true + private _alarmRuleType?: string; + public get alarmRuleType() { + return this.getStringAttribute('alarm_rule_type'); + } + public set alarmRuleType(value: string) { + this._alarmRuleType = value; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleTypeInput() { + return this._alarmRuleType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // alarm_notifications - computed: false, optional: true, required: false + private _alarmNotifications = new AomAlarmPolicyAlarmNotificationsList(this, "alarm_notifications", false); + public get alarmNotifications() { + return this._alarmNotifications; + } + public putAlarmNotifications(value: AomAlarmPolicyAlarmNotifications[] | cdktf.IResolvable) { + this._alarmNotifications.internalValue = value; + } + public resetAlarmNotifications() { + this._alarmNotifications.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmNotificationsInput() { + return this._alarmNotifications.internalValue; + } + + // event_alarm_spec - computed: false, optional: true, required: false + private _eventAlarmSpec = new AomAlarmPolicyEventAlarmSpecList(this, "event_alarm_spec", false); + public get eventAlarmSpec() { + return this._eventAlarmSpec; + } + public putEventAlarmSpec(value: AomAlarmPolicyEventAlarmSpec[] | cdktf.IResolvable) { + this._eventAlarmSpec.internalValue = value; + } + public resetEventAlarmSpec() { + this._eventAlarmSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventAlarmSpecInput() { + return this._eventAlarmSpec.internalValue; + } + + // metric_alarm_spec - computed: false, optional: true, required: false + private _metricAlarmSpec = new AomAlarmPolicyMetricAlarmSpecList(this, "metric_alarm_spec", false); + public get metricAlarmSpec() { + return this._metricAlarmSpec; + } + public putMetricAlarmSpec(value: AomAlarmPolicyMetricAlarmSpec[] | cdktf.IResolvable) { + this._metricAlarmSpec.internalValue = value; + } + public resetMetricAlarmSpec() { + this._metricAlarmSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricAlarmSpecInput() { + return this._metricAlarmSpec.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomAlarmPolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomAlarmPolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_rule_description: cdktf.stringToTerraform(this._alarmRuleDescription), + alarm_rule_enable: cdktf.booleanToTerraform(this._alarmRuleEnable), + alarm_rule_name: cdktf.stringToTerraform(this._alarmRuleName), + alarm_rule_status: cdktf.stringToTerraform(this._alarmRuleStatus), + alarm_rule_type: cdktf.stringToTerraform(this._alarmRuleType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + alarm_notifications: cdktf.listMapper(aomAlarmPolicyAlarmNotificationsToTerraform, true)(this._alarmNotifications.internalValue), + event_alarm_spec: cdktf.listMapper(aomAlarmPolicyEventAlarmSpecToTerraform, true)(this._eventAlarmSpec.internalValue), + metric_alarm_spec: cdktf.listMapper(aomAlarmPolicyMetricAlarmSpecToTerraform, true)(this._metricAlarmSpec.internalValue), + timeouts: aomAlarmPolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_rule_description: { + value: cdktf.stringToHclTerraform(this._alarmRuleDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_enable: { + value: cdktf.booleanToHclTerraform(this._alarmRuleEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + alarm_rule_name: { + value: cdktf.stringToHclTerraform(this._alarmRuleName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_status: { + value: cdktf.stringToHclTerraform(this._alarmRuleStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_type: { + value: cdktf.stringToHclTerraform(this._alarmRuleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_notifications: { + value: cdktf.listMapperHcl(aomAlarmPolicyAlarmNotificationsToHclTerraform, true)(this._alarmNotifications.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyAlarmNotificationsList", + }, + event_alarm_spec: { + value: cdktf.listMapperHcl(aomAlarmPolicyEventAlarmSpecToHclTerraform, true)(this._eventAlarmSpec.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyEventAlarmSpecList", + }, + metric_alarm_spec: { + value: cdktf.listMapperHcl(aomAlarmPolicyMetricAlarmSpecToHclTerraform, true)(this._metricAlarmSpec.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmPolicyMetricAlarmSpecList", + }, + timeouts: { + value: aomAlarmPolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomAlarmPolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-alarm-rule/README.md b/src/constructs/providers/huaweicloud/aom-alarm-rule/README.md new file mode 100644 index 00000000..a30a21d9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_alarm_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_alarm_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule). diff --git a/src/constructs/providers/huaweicloud/aom-alarm-rule/index.ts b/src/constructs/providers/huaweicloud/aom-alarm-rule/index.ts new file mode 100644 index 00000000..bfdcbae5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-rule/index.ts @@ -0,0 +1,912 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomAlarmRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#alarm_action_enabled AomAlarmRule#alarm_action_enabled} + */ + readonly alarmActionEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#alarm_actions AomAlarmRule#alarm_actions} + */ + readonly alarmActions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#alarm_level AomAlarmRule#alarm_level} + */ + readonly alarmLevel?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#comparison_operator AomAlarmRule#comparison_operator} + */ + readonly comparisonOperator: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#description AomAlarmRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#evaluation_periods AomAlarmRule#evaluation_periods} + */ + readonly evaluationPeriods: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#id AomAlarmRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#insufficient_data_actions AomAlarmRule#insufficient_data_actions} + */ + readonly insufficientDataActions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#metric_name AomAlarmRule#metric_name} + */ + readonly metricName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#name AomAlarmRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#namespace AomAlarmRule#namespace} + */ + readonly namespace: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#ok_actions AomAlarmRule#ok_actions} + */ + readonly okActions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#period AomAlarmRule#period} + */ + readonly period: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#region AomAlarmRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#statistic AomAlarmRule#statistic} + */ + readonly statistic: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#threshold AomAlarmRule#threshold} + */ + readonly threshold: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#unit AomAlarmRule#unit} + */ + readonly unit: string; + /** + * dimensions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#dimensions AomAlarmRule#dimensions} + */ + readonly dimensions: AomAlarmRuleDimensions[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#timeouts AomAlarmRule#timeouts} + */ + readonly timeouts?: AomAlarmRuleTimeouts; +} +export interface AomAlarmRuleDimensions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#name AomAlarmRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#value AomAlarmRule#value} + */ + readonly value: string; +} + +export function aomAlarmRuleDimensionsToTerraform(struct?: AomAlarmRuleDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function aomAlarmRuleDimensionsToHclTerraform(struct?: AomAlarmRuleDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRuleDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmRuleDimensions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRuleDimensions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class AomAlarmRuleDimensionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmRuleDimensions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmRuleDimensionsOutputReference { + return new AomAlarmRuleDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#create AomAlarmRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#delete AomAlarmRule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#update AomAlarmRule#update} + */ + readonly update?: string; +} + +export function aomAlarmRuleTimeoutsToTerraform(struct?: AomAlarmRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomAlarmRuleTimeoutsToHclTerraform(struct?: AomAlarmRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomAlarmRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule huaweicloud_aom_alarm_rule} +*/ +export class AomAlarmRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomAlarmRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomAlarmRule to import + * @param importFromId The id of the existing AomAlarmRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomAlarmRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rule huaweicloud_aom_alarm_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomAlarmRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomAlarmRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmActionEnabled = config.alarmActionEnabled; + this._alarmActions = config.alarmActions; + this._alarmLevel = config.alarmLevel; + this._comparisonOperator = config.comparisonOperator; + this._description = config.description; + this._evaluationPeriods = config.evaluationPeriods; + this._id = config.id; + this._insufficientDataActions = config.insufficientDataActions; + this._metricName = config.metricName; + this._name = config.name; + this._namespace = config.namespace; + this._okActions = config.okActions; + this._period = config.period; + this._region = config.region; + this._statistic = config.statistic; + this._threshold = config.threshold; + this._unit = config.unit; + this._dimensions.internalValue = config.dimensions; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_action_enabled - computed: false, optional: true, required: false + private _alarmActionEnabled?: boolean | cdktf.IResolvable; + public get alarmActionEnabled() { + return this.getBooleanAttribute('alarm_action_enabled'); + } + public set alarmActionEnabled(value: boolean | cdktf.IResolvable) { + this._alarmActionEnabled = value; + } + public resetAlarmActionEnabled() { + this._alarmActionEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmActionEnabledInput() { + return this._alarmActionEnabled; + } + + // alarm_actions - computed: false, optional: true, required: false + private _alarmActions?: string[]; + public get alarmActions() { + return this.getListAttribute('alarm_actions'); + } + public set alarmActions(value: string[]) { + this._alarmActions = value; + } + public resetAlarmActions() { + this._alarmActions = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmActionsInput() { + return this._alarmActions; + } + + // alarm_enabled - computed: true, optional: false, required: false + public get alarmEnabled() { + return this.getBooleanAttribute('alarm_enabled'); + } + + // alarm_level - computed: false, optional: true, required: false + private _alarmLevel?: number; + public get alarmLevel() { + return this.getNumberAttribute('alarm_level'); + } + public set alarmLevel(value: number) { + this._alarmLevel = value; + } + public resetAlarmLevel() { + this._alarmLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // comparison_operator - computed: false, optional: false, required: true + private _comparisonOperator?: string; + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + public set comparisonOperator(value: string) { + this._comparisonOperator = value; + } + // Temporarily expose input value. Use with caution. + public get comparisonOperatorInput() { + return this._comparisonOperator; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // evaluation_periods - computed: false, optional: false, required: true + private _evaluationPeriods?: number; + public get evaluationPeriods() { + return this.getNumberAttribute('evaluation_periods'); + } + public set evaluationPeriods(value: number) { + this._evaluationPeriods = value; + } + // Temporarily expose input value. Use with caution. + public get evaluationPeriodsInput() { + return this._evaluationPeriods; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // insufficient_data_actions - computed: false, optional: true, required: false + private _insufficientDataActions?: string[]; + public get insufficientDataActions() { + return this.getListAttribute('insufficient_data_actions'); + } + public set insufficientDataActions(value: string[]) { + this._insufficientDataActions = value; + } + public resetInsufficientDataActions() { + this._insufficientDataActions = undefined; + } + // Temporarily expose input value. Use with caution. + public get insufficientDataActionsInput() { + return this._insufficientDataActions; + } + + // metric_name - computed: false, optional: false, required: true + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // ok_actions - computed: false, optional: true, required: false + private _okActions?: string[]; + public get okActions() { + return this.getListAttribute('ok_actions'); + } + public set okActions(value: string[]) { + this._okActions = value; + } + public resetOkActions() { + this._okActions = undefined; + } + // Temporarily expose input value. Use with caution. + public get okActionsInput() { + return this._okActions; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state_reason - computed: true, optional: false, required: false + public get stateReason() { + return this.getStringAttribute('state_reason'); + } + + // state_value - computed: true, optional: false, required: false + public get stateValue() { + return this.getStringAttribute('state_value'); + } + + // statistic - computed: false, optional: false, required: true + private _statistic?: string; + public get statistic() { + return this.getStringAttribute('statistic'); + } + public set statistic(value: string) { + this._statistic = value; + } + // Temporarily expose input value. Use with caution. + public get statisticInput() { + return this._statistic; + } + + // threshold - computed: false, optional: false, required: true + private _threshold?: string; + public get threshold() { + return this.getStringAttribute('threshold'); + } + public set threshold(value: string) { + this._threshold = value; + } + // Temporarily expose input value. Use with caution. + public get thresholdInput() { + return this._threshold; + } + + // unit - computed: false, optional: false, required: true + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } + + // dimensions - computed: false, optional: false, required: true + private _dimensions = new AomAlarmRuleDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + public putDimensions(value: AomAlarmRuleDimensions[] | cdktf.IResolvable) { + this._dimensions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomAlarmRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomAlarmRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_action_enabled: cdktf.booleanToTerraform(this._alarmActionEnabled), + alarm_actions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._alarmActions), + alarm_level: cdktf.numberToTerraform(this._alarmLevel), + comparison_operator: cdktf.stringToTerraform(this._comparisonOperator), + description: cdktf.stringToTerraform(this._description), + evaluation_periods: cdktf.numberToTerraform(this._evaluationPeriods), + id: cdktf.stringToTerraform(this._id), + insufficient_data_actions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._insufficientDataActions), + metric_name: cdktf.stringToTerraform(this._metricName), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + ok_actions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._okActions), + period: cdktf.numberToTerraform(this._period), + region: cdktf.stringToTerraform(this._region), + statistic: cdktf.stringToTerraform(this._statistic), + threshold: cdktf.stringToTerraform(this._threshold), + unit: cdktf.stringToTerraform(this._unit), + dimensions: cdktf.listMapper(aomAlarmRuleDimensionsToTerraform, true)(this._dimensions.internalValue), + timeouts: aomAlarmRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_action_enabled: { + value: cdktf.booleanToHclTerraform(this._alarmActionEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + alarm_actions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._alarmActions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + alarm_level: { + value: cdktf.numberToHclTerraform(this._alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + comparison_operator: { + value: cdktf.stringToHclTerraform(this._comparisonOperator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + evaluation_periods: { + value: cdktf.numberToHclTerraform(this._evaluationPeriods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + insufficient_data_actions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._insufficientDataActions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + metric_name: { + value: cdktf.stringToHclTerraform(this._metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ok_actions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._okActions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + statistic: { + value: cdktf.stringToHclTerraform(this._statistic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + threshold: { + value: cdktf.stringToHclTerraform(this._threshold), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unit: { + value: cdktf.stringToHclTerraform(this._unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimensions: { + value: cdktf.listMapperHcl(aomAlarmRuleDimensionsToHclTerraform, true)(this._dimensions.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRuleDimensionsList", + }, + timeouts: { + value: aomAlarmRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomAlarmRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-alarm-rules-template/README.md b/src/constructs/providers/huaweicloud/aom-alarm-rules-template/README.md new file mode 100644 index 00000000..644abfa4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-rules-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_alarm_rules_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_alarm_rules_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template). diff --git a/src/constructs/providers/huaweicloud/aom-alarm-rules-template/index.ts b/src/constructs/providers/huaweicloud/aom-alarm-rules-template/index.ts new file mode 100644 index 00000000..6acdc2ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-rules-template/index.ts @@ -0,0 +1,3398 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomAlarmRulesTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#description AomAlarmRulesTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#enterprise_project_id AomAlarmRulesTemplate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#id AomAlarmRulesTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#name AomAlarmRulesTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#region AomAlarmRulesTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#type AomAlarmRulesTemplate#type} + */ + readonly type: string; + /** + * alarm_template_spec_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_template_spec_list AomAlarmRulesTemplate#alarm_template_spec_list} + */ + readonly alarmTemplateSpecList: AomAlarmRulesTemplateAlarmTemplateSpecListStruct[] | cdktf.IResolvable; + /** + * templating block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#templating AomAlarmRulesTemplate#templating} + */ + readonly templating?: AomAlarmRulesTemplateTemplating; +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#bind_notification_rule_id AomAlarmRulesTemplate#bind_notification_rule_id} + */ + readonly bindNotificationRuleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#notification_enable AomAlarmRulesTemplate#notification_enable} + */ + readonly notificationEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#notification_type AomAlarmRulesTemplate#notification_type} + */ + readonly notificationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#notify_frequency AomAlarmRulesTemplate#notify_frequency} + */ + readonly notifyFrequency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#notify_resolved AomAlarmRulesTemplate#notify_resolved} + */ + readonly notifyResolved?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#notify_triggered AomAlarmRulesTemplate#notify_triggered} + */ + readonly notifyTriggered?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#route_group_enable AomAlarmRulesTemplate#route_group_enable} + */ + readonly routeGroupEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#route_group_rule AomAlarmRulesTemplate#route_group_rule} + */ + readonly routeGroupRule?: string; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bind_notification_rule_id: cdktf.stringToTerraform(struct!.bindNotificationRuleId), + notification_enable: cdktf.booleanToTerraform(struct!.notificationEnable), + notification_type: cdktf.stringToTerraform(struct!.notificationType), + notify_frequency: cdktf.stringToTerraform(struct!.notifyFrequency), + notify_resolved: cdktf.booleanToTerraform(struct!.notifyResolved), + notify_triggered: cdktf.booleanToTerraform(struct!.notifyTriggered), + route_group_enable: cdktf.booleanToTerraform(struct!.routeGroupEnable), + route_group_rule: cdktf.stringToTerraform(struct!.routeGroupRule), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bind_notification_rule_id: { + value: cdktf.stringToHclTerraform(struct!.bindNotificationRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_enable: { + value: cdktf.booleanToHclTerraform(struct!.notificationEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + notification_type: { + value: cdktf.stringToHclTerraform(struct!.notificationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notify_frequency: { + value: cdktf.stringToHclTerraform(struct!.notifyFrequency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notify_resolved: { + value: cdktf.booleanToHclTerraform(struct!.notifyResolved), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + notify_triggered: { + value: cdktf.booleanToHclTerraform(struct!.notifyTriggered), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + route_group_enable: { + value: cdktf.booleanToHclTerraform(struct!.routeGroupEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + route_group_rule: { + value: cdktf.stringToHclTerraform(struct!.routeGroupRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bindNotificationRuleId !== undefined) { + hasAnyValues = true; + internalValueResult.bindNotificationRuleId = this._bindNotificationRuleId; + } + if (this._notificationEnable !== undefined) { + hasAnyValues = true; + internalValueResult.notificationEnable = this._notificationEnable; + } + if (this._notificationType !== undefined) { + hasAnyValues = true; + internalValueResult.notificationType = this._notificationType; + } + if (this._notifyFrequency !== undefined) { + hasAnyValues = true; + internalValueResult.notifyFrequency = this._notifyFrequency; + } + if (this._notifyResolved !== undefined) { + hasAnyValues = true; + internalValueResult.notifyResolved = this._notifyResolved; + } + if (this._notifyTriggered !== undefined) { + hasAnyValues = true; + internalValueResult.notifyTriggered = this._notifyTriggered; + } + if (this._routeGroupEnable !== undefined) { + hasAnyValues = true; + internalValueResult.routeGroupEnable = this._routeGroupEnable; + } + if (this._routeGroupRule !== undefined) { + hasAnyValues = true; + internalValueResult.routeGroupRule = this._routeGroupRule; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bindNotificationRuleId = undefined; + this._notificationEnable = undefined; + this._notificationType = undefined; + this._notifyFrequency = undefined; + this._notifyResolved = undefined; + this._notifyTriggered = undefined; + this._routeGroupEnable = undefined; + this._routeGroupRule = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bindNotificationRuleId = value.bindNotificationRuleId; + this._notificationEnable = value.notificationEnable; + this._notificationType = value.notificationType; + this._notifyFrequency = value.notifyFrequency; + this._notifyResolved = value.notifyResolved; + this._notifyTriggered = value.notifyTriggered; + this._routeGroupEnable = value.routeGroupEnable; + this._routeGroupRule = value.routeGroupRule; + } + } + + // bind_notification_rule_id - computed: false, optional: true, required: false + private _bindNotificationRuleId?: string; + public get bindNotificationRuleId() { + return this.getStringAttribute('bind_notification_rule_id'); + } + public set bindNotificationRuleId(value: string) { + this._bindNotificationRuleId = value; + } + public resetBindNotificationRuleId() { + this._bindNotificationRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindNotificationRuleIdInput() { + return this._bindNotificationRuleId; + } + + // notification_enable - computed: true, optional: true, required: false + private _notificationEnable?: boolean | cdktf.IResolvable; + public get notificationEnable() { + return this.getBooleanAttribute('notification_enable'); + } + public set notificationEnable(value: boolean | cdktf.IResolvable) { + this._notificationEnable = value; + } + public resetNotificationEnable() { + this._notificationEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationEnableInput() { + return this._notificationEnable; + } + + // notification_type - computed: false, optional: false, required: true + private _notificationType?: string; + public get notificationType() { + return this.getStringAttribute('notification_type'); + } + public set notificationType(value: string) { + this._notificationType = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTypeInput() { + return this._notificationType; + } + + // notify_frequency - computed: true, optional: true, required: false + private _notifyFrequency?: string; + public get notifyFrequency() { + return this.getStringAttribute('notify_frequency'); + } + public set notifyFrequency(value: string) { + this._notifyFrequency = value; + } + public resetNotifyFrequency() { + this._notifyFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyFrequencyInput() { + return this._notifyFrequency; + } + + // notify_resolved - computed: true, optional: true, required: false + private _notifyResolved?: boolean | cdktf.IResolvable; + public get notifyResolved() { + return this.getBooleanAttribute('notify_resolved'); + } + public set notifyResolved(value: boolean | cdktf.IResolvable) { + this._notifyResolved = value; + } + public resetNotifyResolved() { + this._notifyResolved = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyResolvedInput() { + return this._notifyResolved; + } + + // notify_triggered - computed: true, optional: true, required: false + private _notifyTriggered?: boolean | cdktf.IResolvable; + public get notifyTriggered() { + return this.getBooleanAttribute('notify_triggered'); + } + public set notifyTriggered(value: boolean | cdktf.IResolvable) { + this._notifyTriggered = value; + } + public resetNotifyTriggered() { + this._notifyTriggered = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyTriggeredInput() { + return this._notifyTriggered; + } + + // route_group_enable - computed: true, optional: true, required: false + private _routeGroupEnable?: boolean | cdktf.IResolvable; + public get routeGroupEnable() { + return this.getBooleanAttribute('route_group_enable'); + } + public set routeGroupEnable(value: boolean | cdktf.IResolvable) { + this._routeGroupEnable = value; + } + public resetRouteGroupEnable() { + this._routeGroupEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeGroupEnableInput() { + return this._routeGroupEnable; + } + + // route_group_rule - computed: false, optional: true, required: false + private _routeGroupRule?: string; + public get routeGroupRule() { + return this.getStringAttribute('route_group_rule'); + } + public set routeGroupRule(value: string) { + this._routeGroupRule = value; + } + public resetRouteGroupRule() { + this._routeGroupRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeGroupRuleInput() { + return this._routeGroupRule; + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#aggregation_window AomAlarmRulesTemplate#aggregation_window} + */ + readonly aggregationWindow?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#event_name AomAlarmRulesTemplate#event_name} + */ + readonly eventName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#frequency AomAlarmRulesTemplate#frequency} + */ + readonly frequency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#operator AomAlarmRulesTemplate#operator} + */ + readonly operator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#thresholds AomAlarmRulesTemplate#thresholds} + */ + readonly thresholds?: { [key: string]: number }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#trigger_type AomAlarmRulesTemplate#trigger_type} + */ + readonly triggerType: string; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aggregation_window: cdktf.numberToTerraform(struct!.aggregationWindow), + event_name: cdktf.stringToTerraform(struct!.eventName), + frequency: cdktf.stringToTerraform(struct!.frequency), + operator: cdktf.stringToTerraform(struct!.operator), + thresholds: cdktf.hashMapper(cdktf.numberToTerraform)(struct!.thresholds), + trigger_type: cdktf.stringToTerraform(struct!.triggerType), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aggregation_window: { + value: cdktf.numberToHclTerraform(struct!.aggregationWindow), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + event_name: { + value: cdktf.stringToHclTerraform(struct!.eventName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + frequency: { + value: cdktf.stringToHclTerraform(struct!.frequency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thresholds: { + value: cdktf.hashMapperHcl(cdktf.numberToHclTerraform)(struct!.thresholds), + isBlock: false, + type: "map", + storageClassType: "numberMap", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(struct!.triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._aggregationWindow !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationWindow = this._aggregationWindow; + } + if (this._eventName !== undefined) { + hasAnyValues = true; + internalValueResult.eventName = this._eventName; + } + if (this._frequency !== undefined) { + hasAnyValues = true; + internalValueResult.frequency = this._frequency; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._thresholds !== undefined) { + hasAnyValues = true; + internalValueResult.thresholds = this._thresholds; + } + if (this._triggerType !== undefined) { + hasAnyValues = true; + internalValueResult.triggerType = this._triggerType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._aggregationWindow = undefined; + this._eventName = undefined; + this._frequency = undefined; + this._operator = undefined; + this._thresholds = undefined; + this._triggerType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._aggregationWindow = value.aggregationWindow; + this._eventName = value.eventName; + this._frequency = value.frequency; + this._operator = value.operator; + this._thresholds = value.thresholds; + this._triggerType = value.triggerType; + } + } + + // aggregation_window - computed: false, optional: true, required: false + private _aggregationWindow?: number; + public get aggregationWindow() { + return this.getNumberAttribute('aggregation_window'); + } + public set aggregationWindow(value: number) { + this._aggregationWindow = value; + } + public resetAggregationWindow() { + this._aggregationWindow = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationWindowInput() { + return this._aggregationWindow; + } + + // event_name - computed: false, optional: true, required: false + private _eventName?: string; + public get eventName() { + return this.getStringAttribute('event_name'); + } + public set eventName(value: string) { + this._eventName = value; + } + public resetEventName() { + this._eventName = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventNameInput() { + return this._eventName; + } + + // frequency - computed: false, optional: true, required: false + private _frequency?: string; + public get frequency() { + return this.getStringAttribute('frequency'); + } + public set frequency(value: string) { + this._frequency = value; + } + public resetFrequency() { + this._frequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency; + } + + // operator - computed: false, optional: true, required: false + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + public resetOperator() { + this._operator = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // thresholds - computed: false, optional: true, required: false + private _thresholds?: { [key: string]: number }; + public get thresholds() { + return this.getNumberMapAttribute('thresholds'); + } + public set thresholds(value: { [key: string]: number }) { + this._thresholds = value; + } + public resetThresholds() { + this._thresholds = undefined; + } + // Temporarily expose input value. Use with caution. + public get thresholdsInput() { + return this._thresholds; + } + + // trigger_type - computed: false, optional: false, required: true + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsOutputReference { + return new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_source AomAlarmRulesTemplate#alarm_source} + */ + readonly alarmSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_subtype AomAlarmRulesTemplate#alarm_subtype} + */ + readonly alarmSubtype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#event_source AomAlarmRulesTemplate#event_source} + */ + readonly eventSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#monitor_object_templates AomAlarmRulesTemplate#monitor_object_templates} + */ + readonly monitorObjectTemplates?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#monitor_objects AomAlarmRulesTemplate#monitor_objects} + */ + readonly monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * trigger_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#trigger_conditions AomAlarmRulesTemplate#trigger_conditions} + */ + readonly triggerConditions?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions[] | cdktf.IResolvable; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_source: cdktf.stringToTerraform(struct!.alarmSource), + alarm_subtype: cdktf.stringToTerraform(struct!.alarmSubtype), + event_source: cdktf.stringToTerraform(struct!.eventSource), + monitor_object_templates: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.monitorObjectTemplates), + monitor_objects: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(struct!.monitorObjects), + trigger_conditions: cdktf.listMapper(aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsToTerraform, true)(struct!.triggerConditions), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_source: { + value: cdktf.stringToHclTerraform(struct!.alarmSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_subtype: { + value: cdktf.stringToHclTerraform(struct!.alarmSubtype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_source: { + value: cdktf.stringToHclTerraform(struct!.eventSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + monitor_object_templates: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.monitorObjectTemplates), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + monitor_objects: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(struct!.monitorObjects), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsToHclTerraform, true)(struct!.triggerConditions), + isBlock: true, + type: "set", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmSource !== undefined) { + hasAnyValues = true; + internalValueResult.alarmSource = this._alarmSource; + } + if (this._alarmSubtype !== undefined) { + hasAnyValues = true; + internalValueResult.alarmSubtype = this._alarmSubtype; + } + if (this._eventSource !== undefined) { + hasAnyValues = true; + internalValueResult.eventSource = this._eventSource; + } + if (this._monitorObjectTemplates !== undefined) { + hasAnyValues = true; + internalValueResult.monitorObjectTemplates = this._monitorObjectTemplates; + } + if (this._monitorObjects !== undefined) { + hasAnyValues = true; + internalValueResult.monitorObjects = this._monitorObjects; + } + if (this._triggerConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._alarmSource = undefined; + this._alarmSubtype = undefined; + this._eventSource = undefined; + this._monitorObjectTemplates = undefined; + this._monitorObjects = undefined; + this._triggerConditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._alarmSource = value.alarmSource; + this._alarmSubtype = value.alarmSubtype; + this._eventSource = value.eventSource; + this._monitorObjectTemplates = value.monitorObjectTemplates; + this._monitorObjects = value.monitorObjects; + this._triggerConditions.internalValue = value.triggerConditions; + } + } + + // alarm_source - computed: false, optional: true, required: false + private _alarmSource?: string; + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + public set alarmSource(value: string) { + this._alarmSource = value; + } + public resetAlarmSource() { + this._alarmSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmSourceInput() { + return this._alarmSource; + } + + // alarm_subtype - computed: false, optional: true, required: false + private _alarmSubtype?: string; + public get alarmSubtype() { + return this.getStringAttribute('alarm_subtype'); + } + public set alarmSubtype(value: string) { + this._alarmSubtype = value; + } + public resetAlarmSubtype() { + this._alarmSubtype = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmSubtypeInput() { + return this._alarmSubtype; + } + + // event_source - computed: false, optional: true, required: false + private _eventSource?: string; + public get eventSource() { + return this.getStringAttribute('event_source'); + } + public set eventSource(value: string) { + this._eventSource = value; + } + public resetEventSource() { + this._eventSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventSourceInput() { + return this._eventSource; + } + + // monitor_object_templates - computed: false, optional: true, required: false + private _monitorObjectTemplates?: string[]; + public get monitorObjectTemplates() { + return cdktf.Fn.tolist(this.getListAttribute('monitor_object_templates')); + } + public set monitorObjectTemplates(value: string[]) { + this._monitorObjectTemplates = value; + } + public resetMonitorObjectTemplates() { + this._monitorObjectTemplates = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorObjectTemplatesInput() { + return this._monitorObjectTemplates; + } + + // monitor_objects - computed: false, optional: true, required: false + private _monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + public get monitorObjects() { + return this.interpolationForAttribute('monitor_objects'); + } + public set monitorObjects(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._monitorObjects = value; + } + public resetMonitorObjects() { + this._monitorObjects = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorObjectsInput() { + return this._monitorObjects; + } + + // trigger_conditions - computed: false, optional: true, required: false + private _triggerConditions = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsList(this, "trigger_conditions", true); + public get triggerConditions() { + return this._triggerConditions; + } + public putTriggerConditions(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions[] | cdktf.IResolvable) { + this._triggerConditions.internalValue = value; + } + public resetTriggerConditions() { + this._triggerConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions.internalValue; + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#auto_tags AomAlarmRulesTemplate#auto_tags} + */ + readonly autoTags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#custom_annotations AomAlarmRulesTemplate#custom_annotations} + */ + readonly customAnnotations?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#custom_tags AomAlarmRulesTemplate#custom_tags} + */ + readonly customTags?: string[]; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auto_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.autoTags), + custom_annotations: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customAnnotations), + custom_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customTags), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auto_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.autoTags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + custom_annotations: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customAnnotations), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + custom_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customTags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._autoTags !== undefined) { + hasAnyValues = true; + internalValueResult.autoTags = this._autoTags; + } + if (this._customAnnotations !== undefined) { + hasAnyValues = true; + internalValueResult.customAnnotations = this._customAnnotations; + } + if (this._customTags !== undefined) { + hasAnyValues = true; + internalValueResult.customTags = this._customTags; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._autoTags = undefined; + this._customAnnotations = undefined; + this._customTags = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._autoTags = value.autoTags; + this._customAnnotations = value.customAnnotations; + this._customTags = value.customTags; + } + } + + // auto_tags - computed: false, optional: true, required: false + private _autoTags?: string[]; + public get autoTags() { + return cdktf.Fn.tolist(this.getListAttribute('auto_tags')); + } + public set autoTags(value: string[]) { + this._autoTags = value; + } + public resetAutoTags() { + this._autoTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoTagsInput() { + return this._autoTags; + } + + // custom_annotations - computed: false, optional: true, required: false + private _customAnnotations?: string[]; + public get customAnnotations() { + return cdktf.Fn.tolist(this.getListAttribute('custom_annotations')); + } + public set customAnnotations(value: string[]) { + this._customAnnotations = value; + } + public resetCustomAnnotations() { + this._customAnnotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get customAnnotationsInput() { + return this._customAnnotations; + } + + // custom_tags - computed: false, optional: true, required: false + private _customTags?: string[]; + public get customTags() { + return cdktf.Fn.tolist(this.getListAttribute('custom_tags')); + } + public set customTags(value: string[]) { + this._customTags = value; + } + public resetCustomTags() { + this._customTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get customTagsInput() { + return this._customTags; + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#no_data_alert_state AomAlarmRulesTemplate#no_data_alert_state} + */ + readonly noDataAlertState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#no_data_timeframe AomAlarmRulesTemplate#no_data_timeframe} + */ + readonly noDataTimeframe?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#notify_no_data AomAlarmRulesTemplate#notify_no_data} + */ + readonly notifyNoData?: boolean | cdktf.IResolvable; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + no_data_alert_state: cdktf.stringToTerraform(struct!.noDataAlertState), + no_data_timeframe: cdktf.numberToTerraform(struct!.noDataTimeframe), + notify_no_data: cdktf.booleanToTerraform(struct!.notifyNoData), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + no_data_alert_state: { + value: cdktf.stringToHclTerraform(struct!.noDataAlertState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_data_timeframe: { + value: cdktf.numberToHclTerraform(struct!.noDataTimeframe), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + notify_no_data: { + value: cdktf.booleanToHclTerraform(struct!.notifyNoData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._noDataAlertState !== undefined) { + hasAnyValues = true; + internalValueResult.noDataAlertState = this._noDataAlertState; + } + if (this._noDataTimeframe !== undefined) { + hasAnyValues = true; + internalValueResult.noDataTimeframe = this._noDataTimeframe; + } + if (this._notifyNoData !== undefined) { + hasAnyValues = true; + internalValueResult.notifyNoData = this._notifyNoData; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._noDataAlertState = undefined; + this._noDataTimeframe = undefined; + this._notifyNoData = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._noDataAlertState = value.noDataAlertState; + this._noDataTimeframe = value.noDataTimeframe; + this._notifyNoData = value.notifyNoData; + } + } + + // no_data_alert_state - computed: false, optional: true, required: false + private _noDataAlertState?: string; + public get noDataAlertState() { + return this.getStringAttribute('no_data_alert_state'); + } + public set noDataAlertState(value: string) { + this._noDataAlertState = value; + } + public resetNoDataAlertState() { + this._noDataAlertState = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataAlertStateInput() { + return this._noDataAlertState; + } + + // no_data_timeframe - computed: false, optional: true, required: false + private _noDataTimeframe?: number; + public get noDataTimeframe() { + return this.getNumberAttribute('no_data_timeframe'); + } + public set noDataTimeframe(value: number) { + this._noDataTimeframe = value; + } + public resetNoDataTimeframe() { + this._noDataTimeframe = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataTimeframeInput() { + return this._noDataTimeframe; + } + + // notify_no_data - computed: false, optional: true, required: false + private _notifyNoData?: boolean | cdktf.IResolvable; + public get notifyNoData() { + return this.getBooleanAttribute('notify_no_data'); + } + public set notifyNoData(value: boolean | cdktf.IResolvable) { + this._notifyNoData = value; + } + public resetNotifyNoData() { + this._notifyNoData = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyNoDataInput() { + return this._notifyNoData; + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#recovery_timeframe AomAlarmRulesTemplate#recovery_timeframe} + */ + readonly recoveryTimeframe?: number; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + recovery_timeframe: cdktf.numberToTerraform(struct!.recoveryTimeframe), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + recovery_timeframe: { + value: cdktf.numberToHclTerraform(struct!.recoveryTimeframe), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._recoveryTimeframe !== undefined) { + hasAnyValues = true; + internalValueResult.recoveryTimeframe = this._recoveryTimeframe; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._recoveryTimeframe = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._recoveryTimeframe = value.recoveryTimeframe; + } + } + + // recovery_timeframe - computed: false, optional: true, required: false + private _recoveryTimeframe?: number; + public get recoveryTimeframe() { + return this.getNumberAttribute('recovery_timeframe'); + } + public set recoveryTimeframe(value: number) { + this._recoveryTimeframe = value; + } + public resetRecoveryTimeframe() { + this._recoveryTimeframe = undefined; + } + // Temporarily expose input value. Use with caution. + public get recoveryTimeframeInput() { + return this._recoveryTimeframe; + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#aggregate_type AomAlarmRulesTemplate#aggregate_type} + */ + readonly aggregateType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#aggregation_type AomAlarmRulesTemplate#aggregation_type} + */ + readonly aggregationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#aggregation_window AomAlarmRulesTemplate#aggregation_window} + */ + readonly aggregationWindow?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#aom_monitor_level AomAlarmRulesTemplate#aom_monitor_level} + */ + readonly aomMonitorLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#expression AomAlarmRulesTemplate#expression} + */ + readonly expression?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_labels AomAlarmRulesTemplate#metric_labels} + */ + readonly metricLabels?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_name AomAlarmRulesTemplate#metric_name} + */ + readonly metricName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_namespace AomAlarmRulesTemplate#metric_namespace} + */ + readonly metricNamespace?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_query_mode AomAlarmRulesTemplate#metric_query_mode} + */ + readonly metricQueryMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_statistic_method AomAlarmRulesTemplate#metric_statistic_method} + */ + readonly metricStatisticMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_unit AomAlarmRulesTemplate#metric_unit} + */ + readonly metricUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#mix_promql AomAlarmRulesTemplate#mix_promql} + */ + readonly mixPromql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#operator AomAlarmRulesTemplate#operator} + */ + readonly operator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#promql AomAlarmRulesTemplate#promql} + */ + readonly promql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#promql_expr AomAlarmRulesTemplate#promql_expr} + */ + readonly promqlExpr?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#promql_for AomAlarmRulesTemplate#promql_for} + */ + readonly promqlFor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#query_match AomAlarmRulesTemplate#query_match} + */ + readonly queryMatch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#thresholds AomAlarmRulesTemplate#thresholds} + */ + readonly thresholds?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#trigger_interval AomAlarmRulesTemplate#trigger_interval} + */ + readonly triggerInterval?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#trigger_times AomAlarmRulesTemplate#trigger_times} + */ + readonly triggerTimes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#trigger_type AomAlarmRulesTemplate#trigger_type} + */ + readonly triggerType?: string; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aggregate_type: cdktf.stringToTerraform(struct!.aggregateType), + aggregation_type: cdktf.stringToTerraform(struct!.aggregationType), + aggregation_window: cdktf.stringToTerraform(struct!.aggregationWindow), + aom_monitor_level: cdktf.stringToTerraform(struct!.aomMonitorLevel), + expression: cdktf.stringToTerraform(struct!.expression), + metric_labels: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.metricLabels), + metric_name: cdktf.stringToTerraform(struct!.metricName), + metric_namespace: cdktf.stringToTerraform(struct!.metricNamespace), + metric_query_mode: cdktf.stringToTerraform(struct!.metricQueryMode), + metric_statistic_method: cdktf.stringToTerraform(struct!.metricStatisticMethod), + metric_unit: cdktf.stringToTerraform(struct!.metricUnit), + mix_promql: cdktf.stringToTerraform(struct!.mixPromql), + operator: cdktf.stringToTerraform(struct!.operator), + promql: cdktf.stringToTerraform(struct!.promql), + promql_expr: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.promqlExpr), + promql_for: cdktf.stringToTerraform(struct!.promqlFor), + query_match: cdktf.stringToTerraform(struct!.queryMatch), + thresholds: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.thresholds), + trigger_interval: cdktf.stringToTerraform(struct!.triggerInterval), + trigger_times: cdktf.stringToTerraform(struct!.triggerTimes), + trigger_type: cdktf.stringToTerraform(struct!.triggerType), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aggregate_type: { + value: cdktf.stringToHclTerraform(struct!.aggregateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aggregation_type: { + value: cdktf.stringToHclTerraform(struct!.aggregationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aggregation_window: { + value: cdktf.stringToHclTerraform(struct!.aggregationWindow), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aom_monitor_level: { + value: cdktf.stringToHclTerraform(struct!.aomMonitorLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(struct!.expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_labels: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.metricLabels), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_namespace: { + value: cdktf.stringToHclTerraform(struct!.metricNamespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_query_mode: { + value: cdktf.stringToHclTerraform(struct!.metricQueryMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_statistic_method: { + value: cdktf.stringToHclTerraform(struct!.metricStatisticMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_unit: { + value: cdktf.stringToHclTerraform(struct!.metricUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mix_promql: { + value: cdktf.stringToHclTerraform(struct!.mixPromql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + promql: { + value: cdktf.stringToHclTerraform(struct!.promql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + promql_expr: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.promqlExpr), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + promql_for: { + value: cdktf.stringToHclTerraform(struct!.promqlFor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_match: { + value: cdktf.stringToHclTerraform(struct!.queryMatch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thresholds: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.thresholds), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + trigger_interval: { + value: cdktf.stringToHclTerraform(struct!.triggerInterval), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_times: { + value: cdktf.stringToHclTerraform(struct!.triggerTimes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(struct!.triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._aggregateType !== undefined) { + hasAnyValues = true; + internalValueResult.aggregateType = this._aggregateType; + } + if (this._aggregationType !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationType = this._aggregationType; + } + if (this._aggregationWindow !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationWindow = this._aggregationWindow; + } + if (this._aomMonitorLevel !== undefined) { + hasAnyValues = true; + internalValueResult.aomMonitorLevel = this._aomMonitorLevel; + } + if (this._expression !== undefined) { + hasAnyValues = true; + internalValueResult.expression = this._expression; + } + if (this._metricLabels !== undefined) { + hasAnyValues = true; + internalValueResult.metricLabels = this._metricLabels; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._metricNamespace !== undefined) { + hasAnyValues = true; + internalValueResult.metricNamespace = this._metricNamespace; + } + if (this._metricQueryMode !== undefined) { + hasAnyValues = true; + internalValueResult.metricQueryMode = this._metricQueryMode; + } + if (this._metricStatisticMethod !== undefined) { + hasAnyValues = true; + internalValueResult.metricStatisticMethod = this._metricStatisticMethod; + } + if (this._metricUnit !== undefined) { + hasAnyValues = true; + internalValueResult.metricUnit = this._metricUnit; + } + if (this._mixPromql !== undefined) { + hasAnyValues = true; + internalValueResult.mixPromql = this._mixPromql; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._promql !== undefined) { + hasAnyValues = true; + internalValueResult.promql = this._promql; + } + if (this._promqlExpr !== undefined) { + hasAnyValues = true; + internalValueResult.promqlExpr = this._promqlExpr; + } + if (this._promqlFor !== undefined) { + hasAnyValues = true; + internalValueResult.promqlFor = this._promqlFor; + } + if (this._queryMatch !== undefined) { + hasAnyValues = true; + internalValueResult.queryMatch = this._queryMatch; + } + if (this._thresholds !== undefined) { + hasAnyValues = true; + internalValueResult.thresholds = this._thresholds; + } + if (this._triggerInterval !== undefined) { + hasAnyValues = true; + internalValueResult.triggerInterval = this._triggerInterval; + } + if (this._triggerTimes !== undefined) { + hasAnyValues = true; + internalValueResult.triggerTimes = this._triggerTimes; + } + if (this._triggerType !== undefined) { + hasAnyValues = true; + internalValueResult.triggerType = this._triggerType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._aggregateType = undefined; + this._aggregationType = undefined; + this._aggregationWindow = undefined; + this._aomMonitorLevel = undefined; + this._expression = undefined; + this._metricLabels = undefined; + this._metricName = undefined; + this._metricNamespace = undefined; + this._metricQueryMode = undefined; + this._metricStatisticMethod = undefined; + this._metricUnit = undefined; + this._mixPromql = undefined; + this._operator = undefined; + this._promql = undefined; + this._promqlExpr = undefined; + this._promqlFor = undefined; + this._queryMatch = undefined; + this._thresholds = undefined; + this._triggerInterval = undefined; + this._triggerTimes = undefined; + this._triggerType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._aggregateType = value.aggregateType; + this._aggregationType = value.aggregationType; + this._aggregationWindow = value.aggregationWindow; + this._aomMonitorLevel = value.aomMonitorLevel; + this._expression = value.expression; + this._metricLabels = value.metricLabels; + this._metricName = value.metricName; + this._metricNamespace = value.metricNamespace; + this._metricQueryMode = value.metricQueryMode; + this._metricStatisticMethod = value.metricStatisticMethod; + this._metricUnit = value.metricUnit; + this._mixPromql = value.mixPromql; + this._operator = value.operator; + this._promql = value.promql; + this._promqlExpr = value.promqlExpr; + this._promqlFor = value.promqlFor; + this._queryMatch = value.queryMatch; + this._thresholds = value.thresholds; + this._triggerInterval = value.triggerInterval; + this._triggerTimes = value.triggerTimes; + this._triggerType = value.triggerType; + } + } + + // aggregate_type - computed: false, optional: true, required: false + private _aggregateType?: string; + public get aggregateType() { + return this.getStringAttribute('aggregate_type'); + } + public set aggregateType(value: string) { + this._aggregateType = value; + } + public resetAggregateType() { + this._aggregateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregateTypeInput() { + return this._aggregateType; + } + + // aggregation_type - computed: false, optional: true, required: false + private _aggregationType?: string; + public get aggregationType() { + return this.getStringAttribute('aggregation_type'); + } + public set aggregationType(value: string) { + this._aggregationType = value; + } + public resetAggregationType() { + this._aggregationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationTypeInput() { + return this._aggregationType; + } + + // aggregation_window - computed: false, optional: true, required: false + private _aggregationWindow?: string; + public get aggregationWindow() { + return this.getStringAttribute('aggregation_window'); + } + public set aggregationWindow(value: string) { + this._aggregationWindow = value; + } + public resetAggregationWindow() { + this._aggregationWindow = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationWindowInput() { + return this._aggregationWindow; + } + + // aom_monitor_level - computed: false, optional: true, required: false + private _aomMonitorLevel?: string; + public get aomMonitorLevel() { + return this.getStringAttribute('aom_monitor_level'); + } + public set aomMonitorLevel(value: string) { + this._aomMonitorLevel = value; + } + public resetAomMonitorLevel() { + this._aomMonitorLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get aomMonitorLevelInput() { + return this._aomMonitorLevel; + } + + // expression - computed: false, optional: true, required: false + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + public resetExpression() { + this._expression = undefined; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // metric_labels - computed: false, optional: true, required: false + private _metricLabels?: string[]; + public get metricLabels() { + return cdktf.Fn.tolist(this.getListAttribute('metric_labels')); + } + public set metricLabels(value: string[]) { + this._metricLabels = value; + } + public resetMetricLabels() { + this._metricLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricLabelsInput() { + return this._metricLabels; + } + + // metric_name - computed: false, optional: true, required: false + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + public resetMetricName() { + this._metricName = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // metric_namespace - computed: false, optional: true, required: false + private _metricNamespace?: string; + public get metricNamespace() { + return this.getStringAttribute('metric_namespace'); + } + public set metricNamespace(value: string) { + this._metricNamespace = value; + } + public resetMetricNamespace() { + this._metricNamespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNamespaceInput() { + return this._metricNamespace; + } + + // metric_query_mode - computed: false, optional: false, required: true + private _metricQueryMode?: string; + public get metricQueryMode() { + return this.getStringAttribute('metric_query_mode'); + } + public set metricQueryMode(value: string) { + this._metricQueryMode = value; + } + // Temporarily expose input value. Use with caution. + public get metricQueryModeInput() { + return this._metricQueryMode; + } + + // metric_statistic_method - computed: false, optional: true, required: false + private _metricStatisticMethod?: string; + public get metricStatisticMethod() { + return this.getStringAttribute('metric_statistic_method'); + } + public set metricStatisticMethod(value: string) { + this._metricStatisticMethod = value; + } + public resetMetricStatisticMethod() { + this._metricStatisticMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricStatisticMethodInput() { + return this._metricStatisticMethod; + } + + // metric_unit - computed: false, optional: true, required: false + private _metricUnit?: string; + public get metricUnit() { + return this.getStringAttribute('metric_unit'); + } + public set metricUnit(value: string) { + this._metricUnit = value; + } + public resetMetricUnit() { + this._metricUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricUnitInput() { + return this._metricUnit; + } + + // mix_promql - computed: false, optional: true, required: false + private _mixPromql?: string; + public get mixPromql() { + return this.getStringAttribute('mix_promql'); + } + public set mixPromql(value: string) { + this._mixPromql = value; + } + public resetMixPromql() { + this._mixPromql = undefined; + } + // Temporarily expose input value. Use with caution. + public get mixPromqlInput() { + return this._mixPromql; + } + + // operator - computed: false, optional: true, required: false + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + public resetOperator() { + this._operator = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // promql - computed: false, optional: true, required: false + private _promql?: string; + public get promql() { + return this.getStringAttribute('promql'); + } + public set promql(value: string) { + this._promql = value; + } + public resetPromql() { + this._promql = undefined; + } + // Temporarily expose input value. Use with caution. + public get promqlInput() { + return this._promql; + } + + // promql_expr - computed: false, optional: true, required: false + private _promqlExpr?: string[]; + public get promqlExpr() { + return cdktf.Fn.tolist(this.getListAttribute('promql_expr')); + } + public set promqlExpr(value: string[]) { + this._promqlExpr = value; + } + public resetPromqlExpr() { + this._promqlExpr = undefined; + } + // Temporarily expose input value. Use with caution. + public get promqlExprInput() { + return this._promqlExpr; + } + + // promql_for - computed: false, optional: true, required: false + private _promqlFor?: string; + public get promqlFor() { + return this.getStringAttribute('promql_for'); + } + public set promqlFor(value: string) { + this._promqlFor = value; + } + public resetPromqlFor() { + this._promqlFor = undefined; + } + // Temporarily expose input value. Use with caution. + public get promqlForInput() { + return this._promqlFor; + } + + // query_match - computed: false, optional: true, required: false + private _queryMatch?: string; + public get queryMatch() { + return this.getStringAttribute('query_match'); + } + public set queryMatch(value: string) { + this._queryMatch = value; + } + public resetQueryMatch() { + this._queryMatch = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryMatchInput() { + return this._queryMatch; + } + + // thresholds - computed: false, optional: true, required: false + private _thresholds?: { [key: string]: string }; + public get thresholds() { + return this.getStringMapAttribute('thresholds'); + } + public set thresholds(value: { [key: string]: string }) { + this._thresholds = value; + } + public resetThresholds() { + this._thresholds = undefined; + } + // Temporarily expose input value. Use with caution. + public get thresholdsInput() { + return this._thresholds; + } + + // trigger_interval - computed: false, optional: true, required: false + private _triggerInterval?: string; + public get triggerInterval() { + return this.getStringAttribute('trigger_interval'); + } + public set triggerInterval(value: string) { + this._triggerInterval = value; + } + public resetTriggerInterval() { + this._triggerInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerIntervalInput() { + return this._triggerInterval; + } + + // trigger_times - computed: false, optional: true, required: false + private _triggerTimes?: string; + public get triggerTimes() { + return this.getStringAttribute('trigger_times'); + } + public set triggerTimes(value: string) { + this._triggerTimes = value; + } + public resetTriggerTimes() { + this._triggerTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTimesInput() { + return this._triggerTimes; + } + + // trigger_type - computed: false, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsOutputReference { + return new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_source AomAlarmRulesTemplate#alarm_source} + */ + readonly alarmSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_subtype AomAlarmRulesTemplate#alarm_subtype} + */ + readonly alarmSubtype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#monitor_type AomAlarmRulesTemplate#monitor_type} + */ + readonly monitorType?: string; + /** + * alarm_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_tags AomAlarmRulesTemplate#alarm_tags} + */ + readonly alarmTags?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags; + /** + * no_data_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#no_data_conditions AomAlarmRulesTemplate#no_data_conditions} + */ + readonly noDataConditions?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions; + /** + * recovery_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#recovery_conditions AomAlarmRulesTemplate#recovery_conditions} + */ + readonly recoveryConditions?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions; + /** + * trigger_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#trigger_conditions AomAlarmRulesTemplate#trigger_conditions} + */ + readonly triggerConditions?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_source: cdktf.stringToTerraform(struct!.alarmSource), + alarm_subtype: cdktf.stringToTerraform(struct!.alarmSubtype), + monitor_type: cdktf.stringToTerraform(struct!.monitorType), + alarm_tags: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsToTerraform(struct!.alarmTags), + no_data_conditions: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsToTerraform(struct!.noDataConditions), + recovery_conditions: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsToTerraform(struct!.recoveryConditions), + trigger_conditions: cdktf.listMapper(aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsToTerraform, true)(struct!.triggerConditions), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference | AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_source: { + value: cdktf.stringToHclTerraform(struct!.alarmSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_subtype: { + value: cdktf.stringToHclTerraform(struct!.alarmSubtype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + monitor_type: { + value: cdktf.stringToHclTerraform(struct!.monitorType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_tags: { + value: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsToHclTerraform(struct!.alarmTags), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsList", + }, + no_data_conditions: { + value: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsToHclTerraform(struct!.noDataConditions), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsList", + }, + recovery_conditions: { + value: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsToHclTerraform(struct!.recoveryConditions), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsList", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsToHclTerraform, true)(struct!.triggerConditions), + isBlock: true, + type: "set", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmSource !== undefined) { + hasAnyValues = true; + internalValueResult.alarmSource = this._alarmSource; + } + if (this._alarmSubtype !== undefined) { + hasAnyValues = true; + internalValueResult.alarmSubtype = this._alarmSubtype; + } + if (this._monitorType !== undefined) { + hasAnyValues = true; + internalValueResult.monitorType = this._monitorType; + } + if (this._alarmTags?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.alarmTags = this._alarmTags?.internalValue; + } + if (this._noDataConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.noDataConditions = this._noDataConditions?.internalValue; + } + if (this._recoveryConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.recoveryConditions = this._recoveryConditions?.internalValue; + } + if (this._triggerConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._alarmSource = undefined; + this._alarmSubtype = undefined; + this._monitorType = undefined; + this._alarmTags.internalValue = undefined; + this._noDataConditions.internalValue = undefined; + this._recoveryConditions.internalValue = undefined; + this._triggerConditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._alarmSource = value.alarmSource; + this._alarmSubtype = value.alarmSubtype; + this._monitorType = value.monitorType; + this._alarmTags.internalValue = value.alarmTags; + this._noDataConditions.internalValue = value.noDataConditions; + this._recoveryConditions.internalValue = value.recoveryConditions; + this._triggerConditions.internalValue = value.triggerConditions; + } + } + + // alarm_source - computed: false, optional: true, required: false + private _alarmSource?: string; + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + public set alarmSource(value: string) { + this._alarmSource = value; + } + public resetAlarmSource() { + this._alarmSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmSourceInput() { + return this._alarmSource; + } + + // alarm_subtype - computed: false, optional: true, required: false + private _alarmSubtype?: string; + public get alarmSubtype() { + return this.getStringAttribute('alarm_subtype'); + } + public set alarmSubtype(value: string) { + this._alarmSubtype = value; + } + public resetAlarmSubtype() { + this._alarmSubtype = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmSubtypeInput() { + return this._alarmSubtype; + } + + // monitor_type - computed: false, optional: true, required: false + private _monitorType?: string; + public get monitorType() { + return this.getStringAttribute('monitor_type'); + } + public set monitorType(value: string) { + this._monitorType = value; + } + public resetMonitorType() { + this._monitorType = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorTypeInput() { + return this._monitorType; + } + + // alarm_tags - computed: false, optional: true, required: false + private _alarmTags = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference(this, "alarm_tags"); + public get alarmTags() { + return this._alarmTags; + } + public putAlarmTags(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags) { + this._alarmTags.internalValue = value; + } + public resetAlarmTags() { + this._alarmTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmTagsInput() { + return this._alarmTags.internalValue; + } + + // no_data_conditions - computed: false, optional: true, required: false + private _noDataConditions = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference(this, "no_data_conditions"); + public get noDataConditions() { + return this._noDataConditions; + } + public putNoDataConditions(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions) { + this._noDataConditions.internalValue = value; + } + public resetNoDataConditions() { + this._noDataConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataConditionsInput() { + return this._noDataConditions.internalValue; + } + + // recovery_conditions - computed: false, optional: true, required: false + private _recoveryConditions = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference(this, "recovery_conditions"); + public get recoveryConditions() { + return this._recoveryConditions; + } + public putRecoveryConditions(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions) { + this._recoveryConditions.internalValue = value; + } + public resetRecoveryConditions() { + this._recoveryConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get recoveryConditionsInput() { + return this._recoveryConditions.internalValue; + } + + // trigger_conditions - computed: false, optional: true, required: false + private _triggerConditions = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsList(this, "trigger_conditions", true); + public get triggerConditions() { + return this._triggerConditions; + } + public putTriggerConditions(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable) { + this._triggerConditions.internalValue = value; + } + public resetTriggerConditions() { + this._triggerConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions.internalValue; + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_rule_description AomAlarmRulesTemplate#alarm_rule_description} + */ + readonly alarmRuleDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_rule_name AomAlarmRulesTemplate#alarm_rule_name} + */ + readonly alarmRuleName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_rule_type AomAlarmRulesTemplate#alarm_rule_type} + */ + readonly alarmRuleType: string; + /** + * event_alarm_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#event_alarm_spec AomAlarmRulesTemplate#event_alarm_spec} + */ + readonly eventAlarmSpec?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec; + /** + * metric_alarm_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#metric_alarm_spec AomAlarmRulesTemplate#metric_alarm_spec} + */ + readonly metricAlarmSpec?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_rule_description: cdktf.stringToTerraform(struct!.alarmRuleDescription), + alarm_rule_name: cdktf.stringToTerraform(struct!.alarmRuleName), + alarm_rule_type: cdktf.stringToTerraform(struct!.alarmRuleType), + event_alarm_spec: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecToTerraform(struct!.eventAlarmSpec), + metric_alarm_spec: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecToTerraform(struct!.metricAlarmSpec), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_rule_description: { + value: cdktf.stringToHclTerraform(struct!.alarmRuleDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_name: { + value: cdktf.stringToHclTerraform(struct!.alarmRuleName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_type: { + value: cdktf.stringToHclTerraform(struct!.alarmRuleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_alarm_spec: { + value: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecToHclTerraform(struct!.eventAlarmSpec), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecList", + }, + metric_alarm_spec: { + value: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecToHclTerraform(struct!.metricAlarmSpec), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmRuleDescription !== undefined) { + hasAnyValues = true; + internalValueResult.alarmRuleDescription = this._alarmRuleDescription; + } + if (this._alarmRuleName !== undefined) { + hasAnyValues = true; + internalValueResult.alarmRuleName = this._alarmRuleName; + } + if (this._alarmRuleType !== undefined) { + hasAnyValues = true; + internalValueResult.alarmRuleType = this._alarmRuleType; + } + if (this._eventAlarmSpec?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.eventAlarmSpec = this._eventAlarmSpec?.internalValue; + } + if (this._metricAlarmSpec?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.metricAlarmSpec = this._metricAlarmSpec?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._alarmRuleDescription = undefined; + this._alarmRuleName = undefined; + this._alarmRuleType = undefined; + this._eventAlarmSpec.internalValue = undefined; + this._metricAlarmSpec.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._alarmRuleDescription = value.alarmRuleDescription; + this._alarmRuleName = value.alarmRuleName; + this._alarmRuleType = value.alarmRuleType; + this._eventAlarmSpec.internalValue = value.eventAlarmSpec; + this._metricAlarmSpec.internalValue = value.metricAlarmSpec; + } + } + + // alarm_rule_description - computed: false, optional: true, required: false + private _alarmRuleDescription?: string; + public get alarmRuleDescription() { + return this.getStringAttribute('alarm_rule_description'); + } + public set alarmRuleDescription(value: string) { + this._alarmRuleDescription = value; + } + public resetAlarmRuleDescription() { + this._alarmRuleDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleDescriptionInput() { + return this._alarmRuleDescription; + } + + // alarm_rule_name - computed: false, optional: false, required: true + private _alarmRuleName?: string; + public get alarmRuleName() { + return this.getStringAttribute('alarm_rule_name'); + } + public set alarmRuleName(value: string) { + this._alarmRuleName = value; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleNameInput() { + return this._alarmRuleName; + } + + // alarm_rule_type - computed: false, optional: false, required: true + private _alarmRuleType?: string; + public get alarmRuleType() { + return this.getStringAttribute('alarm_rule_type'); + } + public set alarmRuleType(value: string) { + this._alarmRuleType = value; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleTypeInput() { + return this._alarmRuleType; + } + + // event_alarm_spec - computed: false, optional: true, required: false + private _eventAlarmSpec = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference(this, "event_alarm_spec"); + public get eventAlarmSpec() { + return this._eventAlarmSpec; + } + public putEventAlarmSpec(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec) { + this._eventAlarmSpec.internalValue = value; + } + public resetEventAlarmSpec() { + this._eventAlarmSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventAlarmSpecInput() { + return this._eventAlarmSpec.internalValue; + } + + // metric_alarm_spec - computed: false, optional: true, required: false + private _metricAlarmSpec = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference(this, "metric_alarm_spec"); + public get metricAlarmSpec() { + return this._metricAlarmSpec; + } + public putMetricAlarmSpec(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec) { + this._metricAlarmSpec.internalValue = value; + } + public resetMetricAlarmSpec() { + this._metricAlarmSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricAlarmSpecInput() { + return this._metricAlarmSpec.internalValue; + } +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsList extends cdktf.ComplexList { + public internalValue? : AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsOutputReference { + return new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmRulesTemplateAlarmTemplateSpecListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#related_cce_clusters AomAlarmRulesTemplate#related_cce_clusters} + */ + readonly relatedCceClusters?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#related_cloud_service AomAlarmRulesTemplate#related_cloud_service} + */ + readonly relatedCloudService?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#related_prometheus_instances AomAlarmRulesTemplate#related_prometheus_instances} + */ + readonly relatedPrometheusInstances?: string[]; + /** + * alarm_notification block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_notification AomAlarmRulesTemplate#alarm_notification} + */ + readonly alarmNotification?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification; + /** + * alarm_template_spec_items block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#alarm_template_spec_items AomAlarmRulesTemplate#alarm_template_spec_items} + */ + readonly alarmTemplateSpecItems?: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems[] | cdktf.IResolvable; +} + +export function aomAlarmRulesTemplateAlarmTemplateSpecListStructToTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + related_cce_clusters: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.relatedCceClusters), + related_cloud_service: cdktf.stringToTerraform(struct!.relatedCloudService), + related_prometheus_instances: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.relatedPrometheusInstances), + alarm_notification: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationToTerraform(struct!.alarmNotification), + alarm_template_spec_items: cdktf.listMapper(aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsToTerraform, true)(struct!.alarmTemplateSpecItems), + } +} + + +export function aomAlarmRulesTemplateAlarmTemplateSpecListStructToHclTerraform(struct?: AomAlarmRulesTemplateAlarmTemplateSpecListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + related_cce_clusters: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.relatedCceClusters), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + related_cloud_service: { + value: cdktf.stringToHclTerraform(struct!.relatedCloudService), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_prometheus_instances: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.relatedPrometheusInstances), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + alarm_notification: { + value: aomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationToHclTerraform(struct!.alarmNotification), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationList", + }, + alarm_template_spec_items: { + value: cdktf.listMapperHcl(aomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsToHclTerraform, true)(struct!.alarmTemplateSpecItems), + isBlock: true, + type: "set", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmRulesTemplateAlarmTemplateSpecListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._relatedCceClusters !== undefined) { + hasAnyValues = true; + internalValueResult.relatedCceClusters = this._relatedCceClusters; + } + if (this._relatedCloudService !== undefined) { + hasAnyValues = true; + internalValueResult.relatedCloudService = this._relatedCloudService; + } + if (this._relatedPrometheusInstances !== undefined) { + hasAnyValues = true; + internalValueResult.relatedPrometheusInstances = this._relatedPrometheusInstances; + } + if (this._alarmNotification?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.alarmNotification = this._alarmNotification?.internalValue; + } + if (this._alarmTemplateSpecItems?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.alarmTemplateSpecItems = this._alarmTemplateSpecItems?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateAlarmTemplateSpecListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._relatedCceClusters = undefined; + this._relatedCloudService = undefined; + this._relatedPrometheusInstances = undefined; + this._alarmNotification.internalValue = undefined; + this._alarmTemplateSpecItems.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._relatedCceClusters = value.relatedCceClusters; + this._relatedCloudService = value.relatedCloudService; + this._relatedPrometheusInstances = value.relatedPrometheusInstances; + this._alarmNotification.internalValue = value.alarmNotification; + this._alarmTemplateSpecItems.internalValue = value.alarmTemplateSpecItems; + } + } + + // related_cce_clusters - computed: false, optional: true, required: false + private _relatedCceClusters?: string[]; + public get relatedCceClusters() { + return cdktf.Fn.tolist(this.getListAttribute('related_cce_clusters')); + } + public set relatedCceClusters(value: string[]) { + this._relatedCceClusters = value; + } + public resetRelatedCceClusters() { + this._relatedCceClusters = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedCceClustersInput() { + return this._relatedCceClusters; + } + + // related_cloud_service - computed: false, optional: true, required: false + private _relatedCloudService?: string; + public get relatedCloudService() { + return this.getStringAttribute('related_cloud_service'); + } + public set relatedCloudService(value: string) { + this._relatedCloudService = value; + } + public resetRelatedCloudService() { + this._relatedCloudService = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedCloudServiceInput() { + return this._relatedCloudService; + } + + // related_prometheus_instances - computed: false, optional: true, required: false + private _relatedPrometheusInstances?: string[]; + public get relatedPrometheusInstances() { + return cdktf.Fn.tolist(this.getListAttribute('related_prometheus_instances')); + } + public set relatedPrometheusInstances(value: string[]) { + this._relatedPrometheusInstances = value; + } + public resetRelatedPrometheusInstances() { + this._relatedPrometheusInstances = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedPrometheusInstancesInput() { + return this._relatedPrometheusInstances; + } + + // alarm_notification - computed: false, optional: true, required: false + private _alarmNotification = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotificationOutputReference(this, "alarm_notification"); + public get alarmNotification() { + return this._alarmNotification; + } + public putAlarmNotification(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmNotification) { + this._alarmNotification.internalValue = value; + } + public resetAlarmNotification() { + this._alarmNotification.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmNotificationInput() { + return this._alarmNotification.internalValue; + } + + // alarm_template_spec_items - computed: false, optional: true, required: false + private _alarmTemplateSpecItems = new AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItemsList(this, "alarm_template_spec_items", true); + public get alarmTemplateSpecItems() { + return this._alarmTemplateSpecItems; + } + public putAlarmTemplateSpecItems(value: AomAlarmRulesTemplateAlarmTemplateSpecListAlarmTemplateSpecItems[] | cdktf.IResolvable) { + this._alarmTemplateSpecItems.internalValue = value; + } + public resetAlarmTemplateSpecItems() { + this._alarmTemplateSpecItems.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmTemplateSpecItemsInput() { + return this._alarmTemplateSpecItems.internalValue; + } +} + +export class AomAlarmRulesTemplateAlarmTemplateSpecListStructList extends cdktf.ComplexList { + public internalValue? : AomAlarmRulesTemplateAlarmTemplateSpecListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmRulesTemplateAlarmTemplateSpecListStructOutputReference { + return new AomAlarmRulesTemplateAlarmTemplateSpecListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmRulesTemplateTemplatingListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#description AomAlarmRulesTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#name AomAlarmRulesTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#query AomAlarmRulesTemplate#query} + */ + readonly query?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#type AomAlarmRulesTemplate#type} + */ + readonly type?: string; +} + +export function aomAlarmRulesTemplateTemplatingListStructToTerraform(struct?: AomAlarmRulesTemplateTemplatingListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + query: cdktf.stringToTerraform(struct!.query), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function aomAlarmRulesTemplateTemplatingListStructToHclTerraform(struct?: AomAlarmRulesTemplateTemplatingListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query: { + value: cdktf.stringToHclTerraform(struct!.query), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateTemplatingListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmRulesTemplateTemplatingListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._query !== undefined) { + hasAnyValues = true; + internalValueResult.query = this._query; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateTemplatingListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._name = undefined; + this._query = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._name = value.name; + this._query = value.query; + this._type = value.type; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // query - computed: false, optional: true, required: false + private _query?: string; + public get query() { + return this.getStringAttribute('query'); + } + public set query(value: string) { + this._query = value; + } + public resetQuery() { + this._query = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryInput() { + return this._query; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class AomAlarmRulesTemplateTemplatingListStructList extends cdktf.ComplexList { + public internalValue? : AomAlarmRulesTemplateTemplatingListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmRulesTemplateTemplatingListStructOutputReference { + return new AomAlarmRulesTemplateTemplatingListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmRulesTemplateTemplating { + /** + * list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#list AomAlarmRulesTemplate#list} + */ + readonly list: AomAlarmRulesTemplateTemplatingListStruct[] | cdktf.IResolvable; +} + +export function aomAlarmRulesTemplateTemplatingToTerraform(struct?: AomAlarmRulesTemplateTemplatingOutputReference | AomAlarmRulesTemplateTemplating): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + list: cdktf.listMapper(aomAlarmRulesTemplateTemplatingListStructToTerraform, true)(struct!.list), + } +} + + +export function aomAlarmRulesTemplateTemplatingToHclTerraform(struct?: AomAlarmRulesTemplateTemplatingOutputReference | AomAlarmRulesTemplateTemplating): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + list: { + value: cdktf.listMapperHcl(aomAlarmRulesTemplateTemplatingListStructToHclTerraform, true)(struct!.list), + isBlock: true, + type: "set", + storageClassType: "AomAlarmRulesTemplateTemplatingListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmRulesTemplateTemplatingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmRulesTemplateTemplating | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._list?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.list = this._list?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmRulesTemplateTemplating | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._list.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._list.internalValue = value.list; + } + } + + // list - computed: false, optional: false, required: true + private _list = new AomAlarmRulesTemplateTemplatingListStructList(this, "list", true); + public get list() { + return this._list; + } + public putList(value: AomAlarmRulesTemplateTemplatingListStruct[] | cdktf.IResolvable) { + this._list.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get listInput() { + return this._list.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template huaweicloud_aom_alarm_rules_template} +*/ +export class AomAlarmRulesTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_rules_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomAlarmRulesTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomAlarmRulesTemplate to import + * @param importFromId The id of the existing AomAlarmRulesTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomAlarmRulesTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_rules_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_rules_template huaweicloud_aom_alarm_rules_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomAlarmRulesTemplateConfig + */ + public constructor(scope: Construct, id: string, config: AomAlarmRulesTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_rules_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._alarmTemplateSpecList.internalValue = config.alarmTemplateSpecList; + this._templating.internalValue = config.templating; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // alarm_template_spec_list - computed: false, optional: false, required: true + private _alarmTemplateSpecList = new AomAlarmRulesTemplateAlarmTemplateSpecListStructList(this, "alarm_template_spec_list", false); + public get alarmTemplateSpecList() { + return this._alarmTemplateSpecList; + } + public putAlarmTemplateSpecList(value: AomAlarmRulesTemplateAlarmTemplateSpecListStruct[] | cdktf.IResolvable) { + this._alarmTemplateSpecList.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get alarmTemplateSpecListInput() { + return this._alarmTemplateSpecList.internalValue; + } + + // templating - computed: false, optional: true, required: false + private _templating = new AomAlarmRulesTemplateTemplatingOutputReference(this, "templating"); + public get templating() { + return this._templating; + } + public putTemplating(value: AomAlarmRulesTemplateTemplating) { + this._templating.internalValue = value; + } + public resetTemplating() { + this._templating.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get templatingInput() { + return this._templating.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + alarm_template_spec_list: cdktf.listMapper(aomAlarmRulesTemplateAlarmTemplateSpecListStructToTerraform, true)(this._alarmTemplateSpecList.internalValue), + templating: aomAlarmRulesTemplateTemplatingToTerraform(this._templating.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_template_spec_list: { + value: cdktf.listMapperHcl(aomAlarmRulesTemplateAlarmTemplateSpecListStructToHclTerraform, true)(this._alarmTemplateSpecList.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateAlarmTemplateSpecListStructList", + }, + templating: { + value: aomAlarmRulesTemplateTemplatingToHclTerraform(this._templating.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmRulesTemplateTemplatingList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-alarm-silence-rule/README.md b/src/constructs/providers/huaweicloud/aom-alarm-silence-rule/README.md new file mode 100644 index 00000000..d8d53f6e --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-silence-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_alarm_silence_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_alarm_silence_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule). diff --git a/src/constructs/providers/huaweicloud/aom-alarm-silence-rule/index.ts b/src/constructs/providers/huaweicloud/aom-alarm-silence-rule/index.ts new file mode 100644 index 00000000..a8b15615 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-alarm-silence-rule/index.ts @@ -0,0 +1,774 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomAlarmSilenceRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#description AomAlarmSilenceRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#id AomAlarmSilenceRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#name AomAlarmSilenceRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#region AomAlarmSilenceRule#region} + */ + readonly region?: string; + /** + * Specifies the time zone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#time_zone AomAlarmSilenceRule#time_zone} + */ + readonly timeZone: string; + /** + * silence_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#silence_conditions AomAlarmSilenceRule#silence_conditions} + */ + readonly silenceConditions: AomAlarmSilenceRuleSilenceConditions[] | cdktf.IResolvable; + /** + * silence_time block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#silence_time AomAlarmSilenceRule#silence_time} + */ + readonly silenceTime: AomAlarmSilenceRuleSilenceTime; +} +export interface AomAlarmSilenceRuleSilenceConditionsConditions { + /** + * Specifies the key of the match condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#key AomAlarmSilenceRule#key} + */ + readonly key: string; + /** + * Specifies the operate of the match condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#operate AomAlarmSilenceRule#operate} + */ + readonly operate: string; + /** + * Specifies the value list of the match condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#value AomAlarmSilenceRule#value} + */ + readonly value?: string[]; +} + +export function aomAlarmSilenceRuleSilenceConditionsConditionsToTerraform(struct?: AomAlarmSilenceRuleSilenceConditionsConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + operate: cdktf.stringToTerraform(struct!.operate), + value: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.value), + } +} + + +export function aomAlarmSilenceRuleSilenceConditionsConditionsToHclTerraform(struct?: AomAlarmSilenceRuleSilenceConditionsConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operate: { + value: cdktf.stringToHclTerraform(struct!.operate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.value), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmSilenceRuleSilenceConditionsConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmSilenceRuleSilenceConditionsConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._operate !== undefined) { + hasAnyValues = true; + internalValueResult.operate = this._operate; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmSilenceRuleSilenceConditionsConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._operate = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._operate = value.operate; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // operate - computed: false, optional: false, required: true + private _operate?: string; + public get operate() { + return this.getStringAttribute('operate'); + } + public set operate(value: string) { + this._operate = value; + } + // Temporarily expose input value. Use with caution. + public get operateInput() { + return this._operate; + } + + // value - computed: true, optional: true, required: false + private _value?: string[]; + public get value() { + return this.getListAttribute('value'); + } + public set value(value: string[]) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class AomAlarmSilenceRuleSilenceConditionsConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmSilenceRuleSilenceConditionsConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmSilenceRuleSilenceConditionsConditionsOutputReference { + return new AomAlarmSilenceRuleSilenceConditionsConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmSilenceRuleSilenceConditions { + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#conditions AomAlarmSilenceRule#conditions} + */ + readonly conditions: AomAlarmSilenceRuleSilenceConditionsConditions[] | cdktf.IResolvable; +} + +export function aomAlarmSilenceRuleSilenceConditionsToTerraform(struct?: AomAlarmSilenceRuleSilenceConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + conditions: cdktf.listMapper(aomAlarmSilenceRuleSilenceConditionsConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function aomAlarmSilenceRuleSilenceConditionsToHclTerraform(struct?: AomAlarmSilenceRuleSilenceConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + conditions: { + value: cdktf.listMapperHcl(aomAlarmSilenceRuleSilenceConditionsConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "list", + storageClassType: "AomAlarmSilenceRuleSilenceConditionsConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmSilenceRuleSilenceConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomAlarmSilenceRuleSilenceConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmSilenceRuleSilenceConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._conditions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._conditions.internalValue = value.conditions; + } + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new AomAlarmSilenceRuleSilenceConditionsConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: AomAlarmSilenceRuleSilenceConditionsConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +export class AomAlarmSilenceRuleSilenceConditionsList extends cdktf.ComplexList { + public internalValue? : AomAlarmSilenceRuleSilenceConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomAlarmSilenceRuleSilenceConditionsOutputReference { + return new AomAlarmSilenceRuleSilenceConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomAlarmSilenceRuleSilenceTime { + /** + * Specifies the end time of the silence rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#ends_at AomAlarmSilenceRule#ends_at} + */ + readonly endsAt?: number; + /** + * Specifies the silence time of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#scope AomAlarmSilenceRule#scope} + */ + readonly scope?: number[]; + /** + * Specifies the start time of the silence rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#starts_at AomAlarmSilenceRule#starts_at} + */ + readonly startsAt: number; + /** + * Specifies the effective time type of the silence rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#type AomAlarmSilenceRule#type} + */ + readonly type: string; +} + +export function aomAlarmSilenceRuleSilenceTimeToTerraform(struct?: AomAlarmSilenceRuleSilenceTimeOutputReference | AomAlarmSilenceRuleSilenceTime): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ends_at: cdktf.numberToTerraform(struct!.endsAt), + scope: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.scope), + starts_at: cdktf.numberToTerraform(struct!.startsAt), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function aomAlarmSilenceRuleSilenceTimeToHclTerraform(struct?: AomAlarmSilenceRuleSilenceTimeOutputReference | AomAlarmSilenceRuleSilenceTime): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ends_at: { + value: cdktf.numberToHclTerraform(struct!.endsAt), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scope: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.scope), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + starts_at: { + value: cdktf.numberToHclTerraform(struct!.startsAt), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomAlarmSilenceRuleSilenceTimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomAlarmSilenceRuleSilenceTime | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endsAt !== undefined) { + hasAnyValues = true; + internalValueResult.endsAt = this._endsAt; + } + if (this._scope !== undefined) { + hasAnyValues = true; + internalValueResult.scope = this._scope; + } + if (this._startsAt !== undefined) { + hasAnyValues = true; + internalValueResult.startsAt = this._startsAt; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomAlarmSilenceRuleSilenceTime | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endsAt = undefined; + this._scope = undefined; + this._startsAt = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endsAt = value.endsAt; + this._scope = value.scope; + this._startsAt = value.startsAt; + this._type = value.type; + } + } + + // ends_at - computed: true, optional: true, required: false + private _endsAt?: number; + public get endsAt() { + return this.getNumberAttribute('ends_at'); + } + public set endsAt(value: number) { + this._endsAt = value; + } + public resetEndsAt() { + this._endsAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get endsAtInput() { + return this._endsAt; + } + + // scope - computed: true, optional: true, required: false + private _scope?: number[]; + public get scope() { + return this.getNumberListAttribute('scope'); + } + public set scope(value: number[]) { + this._scope = value; + } + public resetScope() { + this._scope = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeInput() { + return this._scope; + } + + // starts_at - computed: false, optional: false, required: true + private _startsAt?: number; + public get startsAt() { + return this.getNumberAttribute('starts_at'); + } + public set startsAt(value: number) { + this._startsAt = value; + } + // Temporarily expose input value. Use with caution. + public get startsAtInput() { + return this._startsAt; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule huaweicloud_aom_alarm_silence_rule} +*/ +export class AomAlarmSilenceRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_silence_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomAlarmSilenceRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomAlarmSilenceRule to import + * @param importFromId The id of the existing AomAlarmSilenceRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomAlarmSilenceRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_silence_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_alarm_silence_rule huaweicloud_aom_alarm_silence_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomAlarmSilenceRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomAlarmSilenceRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_silence_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeZone = config.timeZone; + this._silenceConditions.internalValue = config.silenceConditions; + this._silenceTime.internalValue = config.silenceTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getNumberAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // time_zone - computed: false, optional: false, required: true + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getNumberAttribute('updated_at'); + } + + // silence_conditions - computed: false, optional: false, required: true + private _silenceConditions = new AomAlarmSilenceRuleSilenceConditionsList(this, "silence_conditions", false); + public get silenceConditions() { + return this._silenceConditions; + } + public putSilenceConditions(value: AomAlarmSilenceRuleSilenceConditions[] | cdktf.IResolvable) { + this._silenceConditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get silenceConditionsInput() { + return this._silenceConditions.internalValue; + } + + // silence_time - computed: false, optional: false, required: true + private _silenceTime = new AomAlarmSilenceRuleSilenceTimeOutputReference(this, "silence_time"); + public get silenceTime() { + return this._silenceTime; + } + public putSilenceTime(value: AomAlarmSilenceRuleSilenceTime) { + this._silenceTime.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get silenceTimeInput() { + return this._silenceTime.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + time_zone: cdktf.stringToTerraform(this._timeZone), + silence_conditions: cdktf.listMapper(aomAlarmSilenceRuleSilenceConditionsToTerraform, true)(this._silenceConditions.internalValue), + silence_time: aomAlarmSilenceRuleSilenceTimeToTerraform(this._silenceTime.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + silence_conditions: { + value: cdktf.listMapperHcl(aomAlarmSilenceRuleSilenceConditionsToHclTerraform, true)(this._silenceConditions.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmSilenceRuleSilenceConditionsList", + }, + silence_time: { + value: aomAlarmSilenceRuleSilenceTimeToHclTerraform(this._silenceTime.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomAlarmSilenceRuleSilenceTimeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-application/README.md b/src/constructs/providers/huaweicloud/aom-application/README.md new file mode 100644 index 00000000..7dab5b78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application). diff --git a/src/constructs/providers/huaweicloud/aom-application/index.ts b/src/constructs/providers/huaweicloud/aom-application/index.ts new file mode 100644 index 00000000..1834588a --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-application/index.ts @@ -0,0 +1,524 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#aom_id AomApplication#aom_id} + */ + readonly aomId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#app_id AomApplication#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#description AomApplication#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#display_name AomApplication#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#enterprise_project_id AomApplication#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#id AomApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#name AomApplication#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#register_type AomApplication#register_type} + */ + readonly registerType?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#timeouts AomApplication#timeouts} + */ + readonly timeouts?: AomApplicationTimeouts; +} +export interface AomApplicationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#create AomApplication#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#delete AomApplication#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#update AomApplication#update} + */ + readonly update?: string; +} + +export function aomApplicationTimeoutsToTerraform(struct?: AomApplicationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomApplicationTimeoutsToHclTerraform(struct?: AomApplicationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomApplicationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomApplicationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomApplicationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application huaweicloud_aom_application} +*/ +export class AomApplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomApplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomApplication to import + * @param importFromId The id of the existing AomApplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomApplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_application huaweicloud_aom_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomApplicationConfig + */ + public constructor(scope: Construct, id: string, config: AomApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aomId = config.aomId; + this._appId = config.appId; + this._description = config.description; + this._displayName = config.displayName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._registerType = config.registerType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // aom_id - computed: true, optional: true, required: false + private _aomId?: string; + public get aomId() { + return this.getStringAttribute('aom_id'); + } + public set aomId(value: string) { + this._aomId = value; + } + public resetAomId() { + this._aomId = undefined; + } + // Temporarily expose input value. Use with caution. + public get aomIdInput() { + return this._aomId; + } + + // app_id - computed: true, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // display_name - computed: true, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // modified_time - computed: true, optional: false, required: false + public get modifiedTime() { + return this.getStringAttribute('modified_time'); + } + + // modifier - computed: true, optional: false, required: false + public get modifier() { + return this.getStringAttribute('modifier'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // register_type - computed: true, optional: true, required: false + private _registerType?: string; + public get registerType() { + return this.getStringAttribute('register_type'); + } + public set registerType(value: string) { + this._registerType = value; + } + public resetRegisterType() { + this._registerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get registerTypeInput() { + return this._registerType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomApplicationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomApplicationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aom_id: cdktf.stringToTerraform(this._aomId), + app_id: cdktf.stringToTerraform(this._appId), + description: cdktf.stringToTerraform(this._description), + display_name: cdktf.stringToTerraform(this._displayName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + register_type: cdktf.stringToTerraform(this._registerType), + timeouts: aomApplicationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aom_id: { + value: cdktf.stringToHclTerraform(this._aomId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + register_type: { + value: cdktf.stringToHclTerraform(this._registerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: aomApplicationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomApplicationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-cloud-service-access/README.md b/src/constructs/providers/huaweicloud/aom-cloud-service-access/README.md new file mode 100644 index 00000000..868fa665 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cloud-service-access/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_cloud_service_access` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_cloud_service_access`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access). diff --git a/src/constructs/providers/huaweicloud/aom-cloud-service-access/index.ts b/src/constructs/providers/huaweicloud/aom-cloud-service-access/index.ts new file mode 100644 index 00000000..0eef4f83 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cloud-service-access/index.ts @@ -0,0 +1,247 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomCloudServiceAccessConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#enterprise_project_id AomCloudServiceAccess#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#id AomCloudServiceAccess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#instance_id AomCloudServiceAccess#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#region AomCloudServiceAccess#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#service AomCloudServiceAccess#service} + */ + readonly service: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#tag_sync AomCloudServiceAccess#tag_sync} + */ + readonly tagSync: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access huaweicloud_aom_cloud_service_access} +*/ +export class AomCloudServiceAccess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_cloud_service_access"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomCloudServiceAccess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomCloudServiceAccess to import + * @param importFromId The id of the existing AomCloudServiceAccess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomCloudServiceAccess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_cloud_service_access", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cloud_service_access huaweicloud_aom_cloud_service_access} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomCloudServiceAccessConfig + */ + public constructor(scope: Construct, id: string, config: AomCloudServiceAccessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_cloud_service_access', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._service = config.service; + this._tagSync = config.tagSync; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } + + // tag_sync - computed: false, optional: false, required: true + private _tagSync?: string; + public get tagSync() { + return this.getStringAttribute('tag_sync'); + } + public set tagSync(value: string) { + this._tagSync = value; + } + // Temporarily expose input value. Use with caution. + public get tagSyncInput() { + return this._tagSync; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + service: cdktf.stringToTerraform(this._service), + tag_sync: cdktf.stringToTerraform(this._tagSync), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service: { + value: cdktf.stringToHclTerraform(this._service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_sync: { + value: cdktf.stringToHclTerraform(this._tagSync), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-application/README.md b/src/constructs/providers/huaweicloud/aom-cmdb-application/README.md new file mode 100644 index 00000000..0157923f --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_cmdb_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_cmdb_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application). diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-application/index.ts b/src/constructs/providers/huaweicloud/aom-cmdb-application/index.ts new file mode 100644 index 00000000..6a663a1c --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-application/index.ts @@ -0,0 +1,235 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomCmdbApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application#description AomCmdbApplication#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application#display_name AomCmdbApplication#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application#enterprise_project_id AomCmdbApplication#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application#id AomCmdbApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application#name AomCmdbApplication#name} + */ + readonly name: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application huaweicloud_aom_cmdb_application} +*/ +export class AomCmdbApplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_cmdb_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomCmdbApplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomCmdbApplication to import + * @param importFromId The id of the existing AomCmdbApplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomCmdbApplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_cmdb_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_application huaweicloud_aom_cmdb_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomCmdbApplicationConfig + */ + public constructor(scope: Construct, id: string, config: AomCmdbApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_cmdb_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._displayName = config.displayName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // display_name - computed: true, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // register_type - computed: true, optional: false, required: false + public get registerType() { + return this.getStringAttribute('register_type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + display_name: cdktf.stringToTerraform(this._displayName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-component/README.md b/src/constructs/providers/huaweicloud/aom-cmdb-component/README.md new file mode 100644 index 00000000..a51d440c --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-component/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_cmdb_component` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_cmdb_component`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component). diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-component/index.ts b/src/constructs/providers/huaweicloud/aom-cmdb-component/index.ts new file mode 100644 index 00000000..8958ad1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-component/index.ts @@ -0,0 +1,239 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomCmdbComponentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component#description AomCmdbComponent#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component#id AomCmdbComponent#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component#model_id AomCmdbComponent#model_id} + */ + readonly modelId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component#model_type AomCmdbComponent#model_type} + */ + readonly modelType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component#name AomCmdbComponent#name} + */ + readonly name: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component huaweicloud_aom_cmdb_component} +*/ +export class AomCmdbComponent extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_cmdb_component"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomCmdbComponent resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomCmdbComponent to import + * @param importFromId The id of the existing AomCmdbComponent that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomCmdbComponent to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_cmdb_component", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_component huaweicloud_aom_cmdb_component} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomCmdbComponentConfig + */ + public constructor(scope: Construct, id: string, config: AomCmdbComponentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_cmdb_component', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._modelId = config.modelId; + this._modelType = config.modelType; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_id - computed: true, optional: false, required: false + public get appId() { + return this.getStringAttribute('app_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // model_id - computed: false, optional: false, required: true + private _modelId?: string; + public get modelId() { + return this.getStringAttribute('model_id'); + } + public set modelId(value: string) { + this._modelId = value; + } + // Temporarily expose input value. Use with caution. + public get modelIdInput() { + return this._modelId; + } + + // model_type - computed: false, optional: false, required: true + private _modelType?: string; + public get modelType() { + return this.getStringAttribute('model_type'); + } + public set modelType(value: string) { + this._modelType = value; + } + // Temporarily expose input value. Use with caution. + public get modelTypeInput() { + return this._modelType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // register_type - computed: true, optional: false, required: false + public get registerType() { + return this.getStringAttribute('register_type'); + } + + // sub_app_id - computed: true, optional: false, required: false + public get subAppId() { + return this.getStringAttribute('sub_app_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + model_id: cdktf.stringToTerraform(this._modelId), + model_type: cdktf.stringToTerraform(this._modelType), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_id: { + value: cdktf.stringToHclTerraform(this._modelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_type: { + value: cdktf.stringToHclTerraform(this._modelType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-environment/README.md b/src/constructs/providers/huaweicloud/aom-cmdb-environment/README.md new file mode 100644 index 00000000..1729b2cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-environment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_cmdb_environment` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_cmdb_environment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment). diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-environment/index.ts b/src/constructs/providers/huaweicloud/aom-cmdb-environment/index.ts new file mode 100644 index 00000000..b7bb9c74 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-environment/index.ts @@ -0,0 +1,287 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomCmdbEnvironmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#component_id AomCmdbEnvironment#component_id} + */ + readonly componentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#description AomCmdbEnvironment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#id AomCmdbEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#name AomCmdbEnvironment#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#os_type AomCmdbEnvironment#os_type} + */ + readonly osType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#region AomCmdbEnvironment#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#type AomCmdbEnvironment#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment huaweicloud_aom_cmdb_environment} +*/ +export class AomCmdbEnvironment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_cmdb_environment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomCmdbEnvironment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomCmdbEnvironment to import + * @param importFromId The id of the existing AomCmdbEnvironment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomCmdbEnvironment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_cmdb_environment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_environment huaweicloud_aom_cmdb_environment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomCmdbEnvironmentConfig + */ + public constructor(scope: Construct, id: string, config: AomCmdbEnvironmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_cmdb_environment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._componentId = config.componentId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._osType = config.osType; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // component_id - computed: false, optional: false, required: true + private _componentId?: string; + public get componentId() { + return this.getStringAttribute('component_id'); + } + public set componentId(value: string) { + this._componentId = value; + } + // Temporarily expose input value. Use with caution. + public get componentIdInput() { + return this._componentId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: false, required: true + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // register_type - computed: true, optional: false, required: false + public get registerType() { + return this.getStringAttribute('register_type'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + component_id: cdktf.stringToTerraform(this._componentId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + component_id: { + value: cdktf.stringToHclTerraform(this._componentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/README.md b/src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/README.md new file mode 100644 index 00000000..10e7ec06 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_cmdb_resource_relationships` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_cmdb_resource_relationships`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships). diff --git a/src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/index.ts b/src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/index.ts new file mode 100644 index 00000000..481f1c25 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-cmdb-resource-relationships/index.ts @@ -0,0 +1,627 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomCmdbResourceRelationshipsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#ci_relationships AomCmdbResourceRelationships#ci_relationships} + */ + readonly ciRelationships?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#cmdb_id AomCmdbResourceRelationships#cmdb_id} + */ + readonly cmdbId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#enterprise_project_id AomCmdbResourceRelationships#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#enterprise_project_name AomCmdbResourceRelationships#enterprise_project_name} + */ + readonly enterpriseProjectName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#env_id AomCmdbResourceRelationships#env_id} + */ + readonly envId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#id AomCmdbResourceRelationships#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#project_id AomCmdbResourceRelationships#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#region AomCmdbResourceRelationships#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#resource_id AomCmdbResourceRelationships#resource_id} + */ + readonly resourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#resource_name AomCmdbResourceRelationships#resource_name} + */ + readonly resourceName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#resource_region AomCmdbResourceRelationships#resource_region} + */ + readonly resourceRegion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#rf_resource_type AomCmdbResourceRelationships#rf_resource_type} + */ + readonly rfResourceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#type AomCmdbResourceRelationships#type} + */ + readonly type: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#timeouts AomCmdbResourceRelationships#timeouts} + */ + readonly timeouts?: AomCmdbResourceRelationshipsTimeouts; +} +export interface AomCmdbResourceRelationshipsTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#create AomCmdbResourceRelationships#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#delete AomCmdbResourceRelationships#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#update AomCmdbResourceRelationships#update} + */ + readonly update?: string; +} + +export function aomCmdbResourceRelationshipsTimeoutsToTerraform(struct?: AomCmdbResourceRelationshipsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomCmdbResourceRelationshipsTimeoutsToHclTerraform(struct?: AomCmdbResourceRelationshipsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomCmdbResourceRelationshipsTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomCmdbResourceRelationshipsTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomCmdbResourceRelationshipsTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships huaweicloud_aom_cmdb_resource_relationships} +*/ +export class AomCmdbResourceRelationships extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_cmdb_resource_relationships"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomCmdbResourceRelationships resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomCmdbResourceRelationships to import + * @param importFromId The id of the existing AomCmdbResourceRelationships that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomCmdbResourceRelationships to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_cmdb_resource_relationships", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_cmdb_resource_relationships huaweicloud_aom_cmdb_resource_relationships} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomCmdbResourceRelationshipsConfig + */ + public constructor(scope: Construct, id: string, config: AomCmdbResourceRelationshipsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_cmdb_resource_relationships', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._ciRelationships = config.ciRelationships; + this._cmdbId = config.cmdbId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._enterpriseProjectName = config.enterpriseProjectName; + this._envId = config.envId; + this._id = config.id; + this._projectId = config.projectId; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceName = config.resourceName; + this._resourceRegion = config.resourceRegion; + this._rfResourceType = config.rfResourceType; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // ci_relationships - computed: false, optional: true, required: false + private _ciRelationships?: boolean | cdktf.IResolvable; + public get ciRelationships() { + return this.getBooleanAttribute('ci_relationships'); + } + public set ciRelationships(value: boolean | cdktf.IResolvable) { + this._ciRelationships = value; + } + public resetCiRelationships() { + this._ciRelationships = undefined; + } + // Temporarily expose input value. Use with caution. + public get ciRelationshipsInput() { + return this._ciRelationships; + } + + // cmdb_id - computed: true, optional: true, required: false + private _cmdbId?: string; + public get cmdbId() { + return this.getStringAttribute('cmdb_id'); + } + public set cmdbId(value: string) { + this._cmdbId = value; + } + public resetCmdbId() { + this._cmdbId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cmdbIdInput() { + return this._cmdbId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // enterprise_project_name - computed: false, optional: true, required: false + private _enterpriseProjectName?: string; + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + public set enterpriseProjectName(value: string) { + this._enterpriseProjectName = value; + } + public resetEnterpriseProjectName() { + this._enterpriseProjectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectNameInput() { + return this._enterpriseProjectName; + } + + // env_id - computed: false, optional: false, required: true + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: false, optional: false, required: true + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // resource_region - computed: false, optional: true, required: false + private _resourceRegion?: string; + public get resourceRegion() { + return this.getStringAttribute('resource_region'); + } + public set resourceRegion(value: string) { + this._resourceRegion = value; + } + public resetResourceRegion() { + this._resourceRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceRegionInput() { + return this._resourceRegion; + } + + // rf_resource_type - computed: false, optional: false, required: true + private _rfResourceType?: string; + public get rfResourceType() { + return this.getStringAttribute('rf_resource_type'); + } + public set rfResourceType(value: string) { + this._rfResourceType = value; + } + // Temporarily expose input value. Use with caution. + public get rfResourceTypeInput() { + return this._rfResourceType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomCmdbResourceRelationshipsTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomCmdbResourceRelationshipsTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + ci_relationships: cdktf.booleanToTerraform(this._ciRelationships), + cmdb_id: cdktf.stringToTerraform(this._cmdbId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + enterprise_project_name: cdktf.stringToTerraform(this._enterpriseProjectName), + env_id: cdktf.stringToTerraform(this._envId), + id: cdktf.stringToTerraform(this._id), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_name: cdktf.stringToTerraform(this._resourceName), + resource_region: cdktf.stringToTerraform(this._resourceRegion), + rf_resource_type: cdktf.stringToTerraform(this._rfResourceType), + type: cdktf.stringToTerraform(this._type), + timeouts: aomCmdbResourceRelationshipsTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + ci_relationships: { + value: cdktf.booleanToHclTerraform(this._ciRelationships), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + cmdb_id: { + value: cdktf.stringToHclTerraform(this._cmdbId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_name: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_region: { + value: cdktf.stringToHclTerraform(this._resourceRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rf_resource_type: { + value: cdktf.stringToHclTerraform(this._rfResourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: aomCmdbResourceRelationshipsTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomCmdbResourceRelationshipsTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-component/README.md b/src/constructs/providers/huaweicloud/aom-component/README.md new file mode 100644 index 00000000..9b0a453f --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-component/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_component` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_component`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component). diff --git a/src/constructs/providers/huaweicloud/aom-component/index.ts b/src/constructs/providers/huaweicloud/aom-component/index.ts new file mode 100644 index 00000000..6cb6e584 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-component/index.ts @@ -0,0 +1,569 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomComponentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#aom_id AomComponent#aom_id} + */ + readonly aomId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#app_id AomComponent#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#description AomComponent#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#id AomComponent#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#model_id AomComponent#model_id} + */ + readonly modelId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#model_type AomComponent#model_type} + */ + readonly modelType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#name AomComponent#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#region AomComponent#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#register_type AomComponent#register_type} + */ + readonly registerType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#sub_app_id AomComponent#sub_app_id} + */ + readonly subAppId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#timeouts AomComponent#timeouts} + */ + readonly timeouts?: AomComponentTimeouts; +} +export interface AomComponentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#create AomComponent#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#delete AomComponent#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#update AomComponent#update} + */ + readonly update?: string; +} + +export function aomComponentTimeoutsToTerraform(struct?: AomComponentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomComponentTimeoutsToHclTerraform(struct?: AomComponentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomComponentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomComponentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomComponentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component huaweicloud_aom_component} +*/ +export class AomComponent extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_component"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomComponent resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomComponent to import + * @param importFromId The id of the existing AomComponent that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomComponent to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_component", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_component huaweicloud_aom_component} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomComponentConfig + */ + public constructor(scope: Construct, id: string, config: AomComponentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_component', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aomId = config.aomId; + this._appId = config.appId; + this._description = config.description; + this._id = config.id; + this._modelId = config.modelId; + this._modelType = config.modelType; + this._name = config.name; + this._region = config.region; + this._registerType = config.registerType; + this._subAppId = config.subAppId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // aom_id - computed: true, optional: true, required: false + private _aomId?: string; + public get aomId() { + return this.getStringAttribute('aom_id'); + } + public set aomId(value: string) { + this._aomId = value; + } + public resetAomId() { + this._aomId = undefined; + } + // Temporarily expose input value. Use with caution. + public get aomIdInput() { + return this._aomId; + } + + // app_id - computed: true, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // model_id - computed: false, optional: false, required: true + private _modelId?: string; + public get modelId() { + return this.getStringAttribute('model_id'); + } + public set modelId(value: string) { + this._modelId = value; + } + // Temporarily expose input value. Use with caution. + public get modelIdInput() { + return this._modelId; + } + + // model_type - computed: false, optional: false, required: true + private _modelType?: string; + public get modelType() { + return this.getStringAttribute('model_type'); + } + public set modelType(value: string) { + this._modelType = value; + } + // Temporarily expose input value. Use with caution. + public get modelTypeInput() { + return this._modelType; + } + + // modified_time - computed: true, optional: false, required: false + public get modifiedTime() { + return this.getStringAttribute('modified_time'); + } + + // modifier - computed: true, optional: false, required: false + public get modifier() { + return this.getStringAttribute('modifier'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // register_type - computed: true, optional: true, required: false + private _registerType?: string; + public get registerType() { + return this.getStringAttribute('register_type'); + } + public set registerType(value: string) { + this._registerType = value; + } + public resetRegisterType() { + this._registerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get registerTypeInput() { + return this._registerType; + } + + // sub_app_id - computed: true, optional: true, required: false + private _subAppId?: string; + public get subAppId() { + return this.getStringAttribute('sub_app_id'); + } + public set subAppId(value: string) { + this._subAppId = value; + } + public resetSubAppId() { + this._subAppId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subAppIdInput() { + return this._subAppId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomComponentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomComponentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aom_id: cdktf.stringToTerraform(this._aomId), + app_id: cdktf.stringToTerraform(this._appId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + model_id: cdktf.stringToTerraform(this._modelId), + model_type: cdktf.stringToTerraform(this._modelType), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + register_type: cdktf.stringToTerraform(this._registerType), + sub_app_id: cdktf.stringToTerraform(this._subAppId), + timeouts: aomComponentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aom_id: { + value: cdktf.stringToHclTerraform(this._aomId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_id: { + value: cdktf.stringToHclTerraform(this._modelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_type: { + value: cdktf.stringToHclTerraform(this._modelType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + register_type: { + value: cdktf.stringToHclTerraform(this._registerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sub_app_id: { + value: cdktf.stringToHclTerraform(this._subAppId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: aomComponentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomComponentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-dashboard/README.md b/src/constructs/providers/huaweicloud/aom-dashboard/README.md new file mode 100644 index 00000000..f0c928ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-dashboard/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_dashboard` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_dashboard`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard). diff --git a/src/constructs/providers/huaweicloud/aom-dashboard/index.ts b/src/constructs/providers/huaweicloud/aom-dashboard/index.ts new file mode 100644 index 00000000..bd947957 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-dashboard/index.ts @@ -0,0 +1,331 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomDashboardConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#charts AomDashboard#charts} + */ + readonly charts?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#dashboard_tags AomDashboard#dashboard_tags} + */ + readonly dashboardTags?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#dashboard_title AomDashboard#dashboard_title} + */ + readonly dashboardTitle: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#dashboard_type AomDashboard#dashboard_type} + */ + readonly dashboardType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#enterprise_project_id AomDashboard#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#folder_title AomDashboard#folder_title} + */ + readonly folderTitle: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#id AomDashboard#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#is_favorite AomDashboard#is_favorite} + */ + readonly isFavorite?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#region AomDashboard#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard huaweicloud_aom_dashboard} +*/ +export class AomDashboard extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_dashboard"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomDashboard resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomDashboard to import + * @param importFromId The id of the existing AomDashboard that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomDashboard to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_dashboard", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboard huaweicloud_aom_dashboard} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomDashboardConfig + */ + public constructor(scope: Construct, id: string, config: AomDashboardConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_dashboard', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._charts = config.charts; + this._dashboardTags = config.dashboardTags; + this._dashboardTitle = config.dashboardTitle; + this._dashboardType = config.dashboardType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._folderTitle = config.folderTitle; + this._id = config.id; + this._isFavorite = config.isFavorite; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // charts - computed: false, optional: true, required: false + private _charts?: string; + public get charts() { + return this.getStringAttribute('charts'); + } + public set charts(value: string) { + this._charts = value; + } + public resetCharts() { + this._charts = undefined; + } + // Temporarily expose input value. Use with caution. + public get chartsInput() { + return this._charts; + } + + // dashboard_tags - computed: false, optional: true, required: false + private _dashboardTags?: { [key: string]: string }[] | cdktf.IResolvable; + public get dashboardTags() { + return this.interpolationForAttribute('dashboard_tags'); + } + public set dashboardTags(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._dashboardTags = value; + } + public resetDashboardTags() { + this._dashboardTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get dashboardTagsInput() { + return this._dashboardTags; + } + + // dashboard_title - computed: false, optional: false, required: true + private _dashboardTitle?: string; + public get dashboardTitle() { + return this.getStringAttribute('dashboard_title'); + } + public set dashboardTitle(value: string) { + this._dashboardTitle = value; + } + // Temporarily expose input value. Use with caution. + public get dashboardTitleInput() { + return this._dashboardTitle; + } + + // dashboard_type - computed: false, optional: false, required: true + private _dashboardType?: string; + public get dashboardType() { + return this.getStringAttribute('dashboard_type'); + } + public set dashboardType(value: string) { + this._dashboardType = value; + } + // Temporarily expose input value. Use with caution. + public get dashboardTypeInput() { + return this._dashboardType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // folder_title - computed: false, optional: false, required: true + private _folderTitle?: string; + public get folderTitle() { + return this.getStringAttribute('folder_title'); + } + public set folderTitle(value: string) { + this._folderTitle = value; + } + // Temporarily expose input value. Use with caution. + public get folderTitleInput() { + return this._folderTitle; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_favorite - computed: true, optional: true, required: false + private _isFavorite?: boolean | cdktf.IResolvable; + public get isFavorite() { + return this.getBooleanAttribute('is_favorite'); + } + public set isFavorite(value: boolean | cdktf.IResolvable) { + this._isFavorite = value; + } + public resetIsFavorite() { + this._isFavorite = undefined; + } + // Temporarily expose input value. Use with caution. + public get isFavoriteInput() { + return this._isFavorite; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + charts: cdktf.stringToTerraform(this._charts), + dashboard_tags: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(this._dashboardTags), + dashboard_title: cdktf.stringToTerraform(this._dashboardTitle), + dashboard_type: cdktf.stringToTerraform(this._dashboardType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + folder_title: cdktf.stringToTerraform(this._folderTitle), + id: cdktf.stringToTerraform(this._id), + is_favorite: cdktf.booleanToTerraform(this._isFavorite), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + charts: { + value: cdktf.stringToHclTerraform(this._charts), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dashboard_tags: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(this._dashboardTags), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + dashboard_title: { + value: cdktf.stringToHclTerraform(this._dashboardTitle), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dashboard_type: { + value: cdktf.stringToHclTerraform(this._dashboardType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + folder_title: { + value: cdktf.stringToHclTerraform(this._folderTitle), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_favorite: { + value: cdktf.booleanToHclTerraform(this._isFavorite), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-dashboards-folder/README.md b/src/constructs/providers/huaweicloud/aom-dashboards-folder/README.md new file mode 100644 index 00000000..75560e09 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-dashboards-folder/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_dashboards_folder` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_dashboards_folder`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder). diff --git a/src/constructs/providers/huaweicloud/aom-dashboards-folder/index.ts b/src/constructs/providers/huaweicloud/aom-dashboards-folder/index.ts new file mode 100644 index 00000000..b6c19513 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-dashboards-folder/index.ts @@ -0,0 +1,240 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomDashboardsFolderConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder#delete_all AomDashboardsFolder#delete_all} + */ + readonly deleteAll?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder#enterprise_project_id AomDashboardsFolder#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder#folder_title AomDashboardsFolder#folder_title} + */ + readonly folderTitle: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder#id AomDashboardsFolder#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder#region AomDashboardsFolder#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder huaweicloud_aom_dashboards_folder} +*/ +export class AomDashboardsFolder extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_dashboards_folder"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomDashboardsFolder resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomDashboardsFolder to import + * @param importFromId The id of the existing AomDashboardsFolder that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomDashboardsFolder to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_dashboards_folder", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_dashboards_folder huaweicloud_aom_dashboards_folder} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomDashboardsFolderConfig + */ + public constructor(scope: Construct, id: string, config: AomDashboardsFolderConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_dashboards_folder', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteAll = config.deleteAll; + this._enterpriseProjectId = config.enterpriseProjectId; + this._folderTitle = config.folderTitle; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // dashboard_ids - computed: true, optional: false, required: false + public get dashboardIds() { + return this.getListAttribute('dashboard_ids'); + } + + // delete_all - computed: false, optional: true, required: false + private _deleteAll?: boolean | cdktf.IResolvable; + public get deleteAll() { + return this.getBooleanAttribute('delete_all'); + } + public set deleteAll(value: boolean | cdktf.IResolvable) { + this._deleteAll = value; + } + public resetDeleteAll() { + this._deleteAll = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteAllInput() { + return this._deleteAll; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // folder_title - computed: false, optional: false, required: true + private _folderTitle?: string; + public get folderTitle() { + return this.getStringAttribute('folder_title'); + } + public set folderTitle(value: string) { + this._folderTitle = value; + } + // Temporarily expose input value. Use with caution. + public get folderTitleInput() { + return this._folderTitle; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_template - computed: true, optional: false, required: false + public get isTemplate() { + return this.getBooleanAttribute('is_template'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_all: cdktf.booleanToTerraform(this._deleteAll), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + folder_title: cdktf.stringToTerraform(this._folderTitle), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_all: { + value: cdktf.booleanToHclTerraform(this._deleteAll), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + folder_title: { + value: cdktf.stringToHclTerraform(this._folderTitle), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-environment/README.md b/src/constructs/providers/huaweicloud/aom-environment/README.md new file mode 100644 index 00000000..97580847 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-environment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_environment` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_environment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment). diff --git a/src/constructs/providers/huaweicloud/aom-environment/index.ts b/src/constructs/providers/huaweicloud/aom-environment/index.ts new file mode 100644 index 00000000..57ad8649 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-environment/index.ts @@ -0,0 +1,779 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomEnvironmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#aom_id AomEnvironment#aom_id} + */ + readonly aomId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#component_id AomEnvironment#component_id} + */ + readonly componentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#description AomEnvironment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#enterprise_project_id AomEnvironment#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#env_id AomEnvironment#env_id} + */ + readonly envId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#env_name AomEnvironment#env_name} + */ + readonly envName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#env_type AomEnvironment#env_type} + */ + readonly envType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#id AomEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#os_type AomEnvironment#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#region AomEnvironment#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#register_type AomEnvironment#register_type} + */ + readonly registerType?: string; + /** + * env_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#env_tags AomEnvironment#env_tags} + */ + readonly envTags?: AomEnvironmentEnvTags[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#timeouts AomEnvironment#timeouts} + */ + readonly timeouts?: AomEnvironmentTimeouts; +} +export interface AomEnvironmentEnvTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#tag_id AomEnvironment#tag_id} + */ + readonly tagId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#tag_name AomEnvironment#tag_name} + */ + readonly tagName?: string; +} + +export function aomEnvironmentEnvTagsToTerraform(struct?: AomEnvironmentEnvTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + tag_id: cdktf.stringToTerraform(struct!.tagId), + tag_name: cdktf.stringToTerraform(struct!.tagName), + } +} + + +export function aomEnvironmentEnvTagsToHclTerraform(struct?: AomEnvironmentEnvTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + tag_id: { + value: cdktf.stringToHclTerraform(struct!.tagId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_name: { + value: cdktf.stringToHclTerraform(struct!.tagName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomEnvironmentEnvTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomEnvironmentEnvTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._tagId !== undefined) { + hasAnyValues = true; + internalValueResult.tagId = this._tagId; + } + if (this._tagName !== undefined) { + hasAnyValues = true; + internalValueResult.tagName = this._tagName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomEnvironmentEnvTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._tagId = undefined; + this._tagName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._tagId = value.tagId; + this._tagName = value.tagName; + } + } + + // tag_id - computed: true, optional: true, required: false + private _tagId?: string; + public get tagId() { + return this.getStringAttribute('tag_id'); + } + public set tagId(value: string) { + this._tagId = value; + } + public resetTagId() { + this._tagId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagIdInput() { + return this._tagId; + } + + // tag_name - computed: true, optional: true, required: false + private _tagName?: string; + public get tagName() { + return this.getStringAttribute('tag_name'); + } + public set tagName(value: string) { + this._tagName = value; + } + public resetTagName() { + this._tagName = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagNameInput() { + return this._tagName; + } +} + +export class AomEnvironmentEnvTagsList extends cdktf.ComplexList { + public internalValue? : AomEnvironmentEnvTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomEnvironmentEnvTagsOutputReference { + return new AomEnvironmentEnvTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomEnvironmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#create AomEnvironment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#delete AomEnvironment#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#update AomEnvironment#update} + */ + readonly update?: string; +} + +export function aomEnvironmentTimeoutsToTerraform(struct?: AomEnvironmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomEnvironmentTimeoutsToHclTerraform(struct?: AomEnvironmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomEnvironmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomEnvironmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomEnvironmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment huaweicloud_aom_environment} +*/ +export class AomEnvironment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_environment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomEnvironment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomEnvironment to import + * @param importFromId The id of the existing AomEnvironment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomEnvironment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_environment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_environment huaweicloud_aom_environment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomEnvironmentConfig + */ + public constructor(scope: Construct, id: string, config: AomEnvironmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_environment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aomId = config.aomId; + this._componentId = config.componentId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._envId = config.envId; + this._envName = config.envName; + this._envType = config.envType; + this._id = config.id; + this._osType = config.osType; + this._region = config.region; + this._registerType = config.registerType; + this._envTags.internalValue = config.envTags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // aom_id - computed: true, optional: true, required: false + private _aomId?: string; + public get aomId() { + return this.getStringAttribute('aom_id'); + } + public set aomId(value: string) { + this._aomId = value; + } + public resetAomId() { + this._aomId = undefined; + } + // Temporarily expose input value. Use with caution. + public get aomIdInput() { + return this._aomId; + } + + // component_id - computed: true, optional: true, required: false + private _componentId?: string; + public get componentId() { + return this.getStringAttribute('component_id'); + } + public set componentId(value: string) { + this._componentId = value; + } + public resetComponentId() { + this._componentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get componentIdInput() { + return this._componentId; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // env_id - computed: true, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: false, optional: false, required: true + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // env_type - computed: false, optional: false, required: true + private _envType?: string; + public get envType() { + return this.getStringAttribute('env_type'); + } + public set envType(value: string) { + this._envType = value; + } + // Temporarily expose input value. Use with caution. + public get envTypeInput() { + return this._envType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // modified_time - computed: true, optional: false, required: false + public get modifiedTime() { + return this.getStringAttribute('modified_time'); + } + + // modifier - computed: true, optional: false, required: false + public get modifier() { + return this.getStringAttribute('modifier'); + } + + // os_type - computed: true, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // register_type - computed: true, optional: true, required: false + private _registerType?: string; + public get registerType() { + return this.getStringAttribute('register_type'); + } + public set registerType(value: string) { + this._registerType = value; + } + public resetRegisterType() { + this._registerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get registerTypeInput() { + return this._registerType; + } + + // env_tags - computed: false, optional: true, required: false + private _envTags = new AomEnvironmentEnvTagsList(this, "env_tags", true); + public get envTags() { + return this._envTags; + } + public putEnvTags(value: AomEnvironmentEnvTags[] | cdktf.IResolvable) { + this._envTags.internalValue = value; + } + public resetEnvTags() { + this._envTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get envTagsInput() { + return this._envTags.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomEnvironmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomEnvironmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aom_id: cdktf.stringToTerraform(this._aomId), + component_id: cdktf.stringToTerraform(this._componentId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + env_id: cdktf.stringToTerraform(this._envId), + env_name: cdktf.stringToTerraform(this._envName), + env_type: cdktf.stringToTerraform(this._envType), + id: cdktf.stringToTerraform(this._id), + os_type: cdktf.stringToTerraform(this._osType), + region: cdktf.stringToTerraform(this._region), + register_type: cdktf.stringToTerraform(this._registerType), + env_tags: cdktf.listMapper(aomEnvironmentEnvTagsToTerraform, true)(this._envTags.internalValue), + timeouts: aomEnvironmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aom_id: { + value: cdktf.stringToHclTerraform(this._aomId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_id: { + value: cdktf.stringToHclTerraform(this._componentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_type: { + value: cdktf.stringToHclTerraform(this._envType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + register_type: { + value: cdktf.stringToHclTerraform(this._registerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_tags: { + value: cdktf.listMapperHcl(aomEnvironmentEnvTagsToHclTerraform, true)(this._envTags.internalValue), + isBlock: true, + type: "set", + storageClassType: "AomEnvironmentEnvTagsList", + }, + timeouts: { + value: aomEnvironmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomEnvironmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-event-alarm-rule/README.md b/src/constructs/providers/huaweicloud/aom-event-alarm-rule/README.md new file mode 100644 index 00000000..43cdf0d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-event-alarm-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_event_alarm_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_event_alarm_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule). diff --git a/src/constructs/providers/huaweicloud/aom-event-alarm-rule/index.ts b/src/constructs/providers/huaweicloud/aom-event-alarm-rule/index.ts new file mode 100644 index 00000000..1219c972 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-event-alarm-rule/index.ts @@ -0,0 +1,499 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomEventAlarmRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#action_rule AomEventAlarmRule#action_rule} + */ + readonly actionRule?: string; + /** + * Specifies the alarm source of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#alarm_source AomEventAlarmRule#alarm_source} + */ + readonly alarmSource: string; + /** + * Specifies the alarm type of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#alarm_type AomEventAlarmRule#alarm_type} + */ + readonly alarmType: string; + /** + * Specifies the comparison condition of alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#comparison_operator AomEventAlarmRule#comparison_operator} + */ + readonly comparisonOperator?: string; + /** + * Specifies the description of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#description AomEventAlarmRule#description} + */ + readonly description?: string; + /** + * Specifies whether the rule is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#enabled AomEventAlarmRule#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Specifies the route grouping rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#grouping_rule AomEventAlarmRule#grouping_rule} + */ + readonly groupingRule?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#id AomEventAlarmRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#name AomEventAlarmRule#name} + */ + readonly name: string; + /** + * Specifies the monitoring period in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#period AomEventAlarmRule#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#region AomEventAlarmRule#region} + */ + readonly region?: string; + /** + * Specifies the select object of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#select_object AomEventAlarmRule#select_object} + */ + readonly selectObject: { [key: string]: string }; + /** + * Specifies the accumulated times to trigger the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#trigger_count AomEventAlarmRule#trigger_count} + */ + readonly triggerCount?: number; + /** + * Specifies the trigger type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#trigger_type AomEventAlarmRule#trigger_type} + */ + readonly triggerType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule huaweicloud_aom_event_alarm_rule} +*/ +export class AomEventAlarmRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_event_alarm_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomEventAlarmRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomEventAlarmRule to import + * @param importFromId The id of the existing AomEventAlarmRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomEventAlarmRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_event_alarm_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_event_alarm_rule huaweicloud_aom_event_alarm_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomEventAlarmRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomEventAlarmRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_event_alarm_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionRule = config.actionRule; + this._alarmSource = config.alarmSource; + this._alarmType = config.alarmType; + this._comparisonOperator = config.comparisonOperator; + this._description = config.description; + this._enabled = config.enabled; + this._groupingRule = config.groupingRule; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._region = config.region; + this._selectObject = config.selectObject; + this._triggerCount = config.triggerCount; + this._triggerType = config.triggerType; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_rule - computed: true, optional: true, required: false + private _actionRule?: string; + public get actionRule() { + return this.getStringAttribute('action_rule'); + } + public set actionRule(value: string) { + this._actionRule = value; + } + public resetActionRule() { + this._actionRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionRuleInput() { + return this._actionRule; + } + + // alarm_source - computed: false, optional: false, required: true + private _alarmSource?: string; + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + public set alarmSource(value: string) { + this._alarmSource = value; + } + // Temporarily expose input value. Use with caution. + public get alarmSourceInput() { + return this._alarmSource; + } + + // alarm_type - computed: false, optional: false, required: true + private _alarmType?: string; + public get alarmType() { + return this.getStringAttribute('alarm_type'); + } + public set alarmType(value: string) { + this._alarmType = value; + } + // Temporarily expose input value. Use with caution. + public get alarmTypeInput() { + return this._alarmType; + } + + // comparison_operator - computed: true, optional: true, required: false + private _comparisonOperator?: string; + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + public set comparisonOperator(value: string) { + this._comparisonOperator = value; + } + public resetComparisonOperator() { + this._comparisonOperator = undefined; + } + // Temporarily expose input value. Use with caution. + public get comparisonOperatorInput() { + return this._comparisonOperator; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getNumberAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // grouping_rule - computed: true, optional: true, required: false + private _groupingRule?: string; + public get groupingRule() { + return this.getStringAttribute('grouping_rule'); + } + public set groupingRule(value: string) { + this._groupingRule = value; + } + public resetGroupingRule() { + this._groupingRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupingRuleInput() { + return this._groupingRule; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // select_object - computed: false, optional: false, required: true + private _selectObject?: { [key: string]: string }; + public get selectObject() { + return this.getStringMapAttribute('select_object'); + } + public set selectObject(value: { [key: string]: string }) { + this._selectObject = value; + } + // Temporarily expose input value. Use with caution. + public get selectObjectInput() { + return this._selectObject; + } + + // trigger_count - computed: false, optional: true, required: false + private _triggerCount?: number; + public get triggerCount() { + return this.getNumberAttribute('trigger_count'); + } + public set triggerCount(value: number) { + this._triggerCount = value; + } + public resetTriggerCount() { + this._triggerCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerCountInput() { + return this._triggerCount; + } + + // trigger_type - computed: false, optional: false, required: true + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getNumberAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_rule: cdktf.stringToTerraform(this._actionRule), + alarm_source: cdktf.stringToTerraform(this._alarmSource), + alarm_type: cdktf.stringToTerraform(this._alarmType), + comparison_operator: cdktf.stringToTerraform(this._comparisonOperator), + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + grouping_rule: cdktf.stringToTerraform(this._groupingRule), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + region: cdktf.stringToTerraform(this._region), + select_object: cdktf.hashMapper(cdktf.stringToTerraform)(this._selectObject), + trigger_count: cdktf.numberToTerraform(this._triggerCount), + trigger_type: cdktf.stringToTerraform(this._triggerType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_rule: { + value: cdktf.stringToHclTerraform(this._actionRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_source: { + value: cdktf.stringToHclTerraform(this._alarmSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_type: { + value: cdktf.stringToHclTerraform(this._alarmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + comparison_operator: { + value: cdktf.stringToHclTerraform(this._comparisonOperator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + grouping_rule: { + value: cdktf.stringToHclTerraform(this._groupingRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + select_object: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._selectObject), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + trigger_count: { + value: cdktf.numberToHclTerraform(this._triggerCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(this._triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-message-template/README.md b/src/constructs/providers/huaweicloud/aom-message-template/README.md new file mode 100644 index 00000000..3b0f4ca7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-message-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_message_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_message_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template). diff --git a/src/constructs/providers/huaweicloud/aom-message-template/index.ts b/src/constructs/providers/huaweicloud/aom-message-template/index.ts new file mode 100644 index 00000000..e16e2ad4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-message-template/index.ts @@ -0,0 +1,524 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomMessageTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#description AomMessageTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#enterprise_project_id AomMessageTemplate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#id AomMessageTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#locale AomMessageTemplate#locale} + */ + readonly locale: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#name AomMessageTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#region AomMessageTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#source AomMessageTemplate#source} + */ + readonly source?: string; + /** + * templates block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#templates AomMessageTemplate#templates} + */ + readonly templates: AomMessageTemplateTemplates[] | cdktf.IResolvable; +} +export interface AomMessageTemplateTemplates { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#content AomMessageTemplate#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#sub_type AomMessageTemplate#sub_type} + */ + readonly subType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#topic AomMessageTemplate#topic} + */ + readonly topic?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#version AomMessageTemplate#version} + */ + readonly version?: string; +} + +export function aomMessageTemplateTemplatesToTerraform(struct?: AomMessageTemplateTemplates | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + sub_type: cdktf.stringToTerraform(struct!.subType), + topic: cdktf.stringToTerraform(struct!.topic), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function aomMessageTemplateTemplatesToHclTerraform(struct?: AomMessageTemplateTemplates | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sub_type: { + value: cdktf.stringToHclTerraform(struct!.subType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(struct!.topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomMessageTemplateTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomMessageTemplateTemplates | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._subType !== undefined) { + hasAnyValues = true; + internalValueResult.subType = this._subType; + } + if (this._topic !== undefined) { + hasAnyValues = true; + internalValueResult.topic = this._topic; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomMessageTemplateTemplates | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._subType = undefined; + this._topic = undefined; + this._version = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._subType = value.subType; + this._topic = value.topic; + this._version = value.version; + } + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // sub_type - computed: false, optional: false, required: true + private _subType?: string; + public get subType() { + return this.getStringAttribute('sub_type'); + } + public set subType(value: string) { + this._subType = value; + } + // Temporarily expose input value. Use with caution. + public get subTypeInput() { + return this._subType; + } + + // topic - computed: false, optional: true, required: false + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + public resetTopic() { + this._topic = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} + +export class AomMessageTemplateTemplatesList extends cdktf.ComplexList { + public internalValue? : AomMessageTemplateTemplates[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomMessageTemplateTemplatesOutputReference { + return new AomMessageTemplateTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template huaweicloud_aom_message_template} +*/ +export class AomMessageTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_message_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomMessageTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomMessageTemplate to import + * @param importFromId The id of the existing AomMessageTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomMessageTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_message_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_message_template huaweicloud_aom_message_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomMessageTemplateConfig + */ + public constructor(scope: Construct, id: string, config: AomMessageTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_message_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._locale = config.locale; + this._name = config.name; + this._region = config.region; + this._source = config.source; + this._templates.internalValue = config.templates; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // locale - computed: false, optional: false, required: true + private _locale?: string; + public get locale() { + return this.getStringAttribute('locale'); + } + public set locale(value: string) { + this._locale = value; + } + // Temporarily expose input value. Use with caution. + public get localeInput() { + return this._locale; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // templates - computed: false, optional: false, required: true + private _templates = new AomMessageTemplateTemplatesList(this, "templates", true); + public get templates() { + return this._templates; + } + public putTemplates(value: AomMessageTemplateTemplates[] | cdktf.IResolvable) { + this._templates.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get templatesInput() { + return this._templates.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + locale: cdktf.stringToTerraform(this._locale), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + templates: cdktf.listMapper(aomMessageTemplateTemplatesToTerraform, true)(this._templates.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + locale: { + value: cdktf.stringToHclTerraform(this._locale), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + templates: { + value: cdktf.listMapperHcl(aomMessageTemplateTemplatesToHclTerraform, true)(this._templates.internalValue), + isBlock: true, + type: "set", + storageClassType: "AomMessageTemplateTemplatesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/README.md b/src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/README.md new file mode 100644 index 00000000..af8ff425 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_multi_account_aggregation_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_multi_account_aggregation_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule). diff --git a/src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/index.ts b/src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/index.ts new file mode 100644 index 00000000..efe48f72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-multi-account-aggregation-rule/index.ts @@ -0,0 +1,642 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomMultiAccountAggregationRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#id AomMultiAccountAggregationRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#instance_id AomMultiAccountAggregationRule#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#region AomMultiAccountAggregationRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#send_to_source_account AomMultiAccountAggregationRule#send_to_source_account} + */ + readonly sendToSourceAccount?: boolean | cdktf.IResolvable; + /** + * accounts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#accounts AomMultiAccountAggregationRule#accounts} + */ + readonly accounts: AomMultiAccountAggregationRuleAccounts[] | cdktf.IResolvable; + /** + * services block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#services AomMultiAccountAggregationRule#services} + */ + readonly services?: AomMultiAccountAggregationRuleServices[] | cdktf.IResolvable; +} +export interface AomMultiAccountAggregationRuleAccounts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#id AomMultiAccountAggregationRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#join_method AomMultiAccountAggregationRule#join_method} + */ + readonly joinMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#joined_at AomMultiAccountAggregationRule#joined_at} + */ + readonly joinedAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#name AomMultiAccountAggregationRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#urn AomMultiAccountAggregationRule#urn} + */ + readonly urn?: string; +} + +export function aomMultiAccountAggregationRuleAccountsToTerraform(struct?: AomMultiAccountAggregationRuleAccounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + join_method: cdktf.stringToTerraform(struct!.joinMethod), + joined_at: cdktf.stringToTerraform(struct!.joinedAt), + name: cdktf.stringToTerraform(struct!.name), + urn: cdktf.stringToTerraform(struct!.urn), + } +} + + +export function aomMultiAccountAggregationRuleAccountsToHclTerraform(struct?: AomMultiAccountAggregationRuleAccounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + join_method: { + value: cdktf.stringToHclTerraform(struct!.joinMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + joined_at: { + value: cdktf.stringToHclTerraform(struct!.joinedAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + urn: { + value: cdktf.stringToHclTerraform(struct!.urn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomMultiAccountAggregationRuleAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomMultiAccountAggregationRuleAccounts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._joinMethod !== undefined) { + hasAnyValues = true; + internalValueResult.joinMethod = this._joinMethod; + } + if (this._joinedAt !== undefined) { + hasAnyValues = true; + internalValueResult.joinedAt = this._joinedAt; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._urn !== undefined) { + hasAnyValues = true; + internalValueResult.urn = this._urn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomMultiAccountAggregationRuleAccounts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._joinMethod = undefined; + this._joinedAt = undefined; + this._name = undefined; + this._urn = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._joinMethod = value.joinMethod; + this._joinedAt = value.joinedAt; + this._name = value.name; + this._urn = value.urn; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // join_method - computed: false, optional: true, required: false + private _joinMethod?: string; + public get joinMethod() { + return this.getStringAttribute('join_method'); + } + public set joinMethod(value: string) { + this._joinMethod = value; + } + public resetJoinMethod() { + this._joinMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get joinMethodInput() { + return this._joinMethod; + } + + // joined_at - computed: false, optional: true, required: false + private _joinedAt?: string; + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + public set joinedAt(value: string) { + this._joinedAt = value; + } + public resetJoinedAt() { + this._joinedAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get joinedAtInput() { + return this._joinedAt; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // urn - computed: false, optional: true, required: false + private _urn?: string; + public get urn() { + return this.getStringAttribute('urn'); + } + public set urn(value: string) { + this._urn = value; + } + public resetUrn() { + this._urn = undefined; + } + // Temporarily expose input value. Use with caution. + public get urnInput() { + return this._urn; + } +} + +export class AomMultiAccountAggregationRuleAccountsList extends cdktf.ComplexList { + public internalValue? : AomMultiAccountAggregationRuleAccounts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomMultiAccountAggregationRuleAccountsOutputReference { + return new AomMultiAccountAggregationRuleAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomMultiAccountAggregationRuleServices { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#metrics AomMultiAccountAggregationRule#metrics} + */ + readonly metrics: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#service AomMultiAccountAggregationRule#service} + */ + readonly service: string; +} + +export function aomMultiAccountAggregationRuleServicesToTerraform(struct?: AomMultiAccountAggregationRuleServices | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + metrics: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.metrics), + service: cdktf.stringToTerraform(struct!.service), + } +} + + +export function aomMultiAccountAggregationRuleServicesToHclTerraform(struct?: AomMultiAccountAggregationRuleServices | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + metrics: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.metrics), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + service: { + value: cdktf.stringToHclTerraform(struct!.service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomMultiAccountAggregationRuleServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomMultiAccountAggregationRuleServices | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._metrics !== undefined) { + hasAnyValues = true; + internalValueResult.metrics = this._metrics; + } + if (this._service !== undefined) { + hasAnyValues = true; + internalValueResult.service = this._service; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomMultiAccountAggregationRuleServices | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._metrics = undefined; + this._service = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._metrics = value.metrics; + this._service = value.service; + } + } + + // metrics - computed: false, optional: false, required: true + private _metrics?: string[]; + public get metrics() { + return cdktf.Fn.tolist(this.getListAttribute('metrics')); + } + public set metrics(value: string[]) { + this._metrics = value; + } + // Temporarily expose input value. Use with caution. + public get metricsInput() { + return this._metrics; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } +} + +export class AomMultiAccountAggregationRuleServicesList extends cdktf.ComplexList { + public internalValue? : AomMultiAccountAggregationRuleServices[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomMultiAccountAggregationRuleServicesOutputReference { + return new AomMultiAccountAggregationRuleServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule huaweicloud_aom_multi_account_aggregation_rule} +*/ +export class AomMultiAccountAggregationRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_multi_account_aggregation_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomMultiAccountAggregationRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomMultiAccountAggregationRule to import + * @param importFromId The id of the existing AomMultiAccountAggregationRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomMultiAccountAggregationRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_multi_account_aggregation_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_multi_account_aggregation_rule huaweicloud_aom_multi_account_aggregation_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomMultiAccountAggregationRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomMultiAccountAggregationRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_multi_account_aggregation_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._sendToSourceAccount = config.sendToSourceAccount; + this._accounts.internalValue = config.accounts; + this._services.internalValue = config.services; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // send_to_source_account - computed: true, optional: true, required: false + private _sendToSourceAccount?: boolean | cdktf.IResolvable; + public get sendToSourceAccount() { + return this.getBooleanAttribute('send_to_source_account'); + } + public set sendToSourceAccount(value: boolean | cdktf.IResolvable) { + this._sendToSourceAccount = value; + } + public resetSendToSourceAccount() { + this._sendToSourceAccount = undefined; + } + // Temporarily expose input value. Use with caution. + public get sendToSourceAccountInput() { + return this._sendToSourceAccount; + } + + // accounts - computed: false, optional: false, required: true + private _accounts = new AomMultiAccountAggregationRuleAccountsList(this, "accounts", true); + public get accounts() { + return this._accounts; + } + public putAccounts(value: AomMultiAccountAggregationRuleAccounts[] | cdktf.IResolvable) { + this._accounts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get accountsInput() { + return this._accounts.internalValue; + } + + // services - computed: false, optional: true, required: false + private _services = new AomMultiAccountAggregationRuleServicesList(this, "services", true); + public get services() { + return this._services; + } + public putServices(value: AomMultiAccountAggregationRuleServices[] | cdktf.IResolvable) { + this._services.internalValue = value; + } + public resetServices() { + this._services.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get servicesInput() { + return this._services.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + send_to_source_account: cdktf.booleanToTerraform(this._sendToSourceAccount), + accounts: cdktf.listMapper(aomMultiAccountAggregationRuleAccountsToTerraform, true)(this._accounts.internalValue), + services: cdktf.listMapper(aomMultiAccountAggregationRuleServicesToTerraform, true)(this._services.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + send_to_source_account: { + value: cdktf.booleanToHclTerraform(this._sendToSourceAccount), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + accounts: { + value: cdktf.listMapperHcl(aomMultiAccountAggregationRuleAccountsToHclTerraform, true)(this._accounts.internalValue), + isBlock: true, + type: "set", + storageClassType: "AomMultiAccountAggregationRuleAccountsList", + }, + services: { + value: cdktf.listMapperHcl(aomMultiAccountAggregationRuleServicesToHclTerraform, true)(this._services.internalValue), + isBlock: true, + type: "set", + storageClassType: "AomMultiAccountAggregationRuleServicesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-prom-instance/README.md b/src/constructs/providers/huaweicloud/aom-prom-instance/README.md new file mode 100644 index 00000000..c2ac4d11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-prom-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_prom_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_prom_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance). diff --git a/src/constructs/providers/huaweicloud/aom-prom-instance/index.ts b/src/constructs/providers/huaweicloud/aom-prom-instance/index.ts new file mode 100644 index 00000000..6db5ddce --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-prom-instance/index.ts @@ -0,0 +1,270 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomPromInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#enterprise_project_id AomPromInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#id AomPromInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#prom_name AomPromInstance#prom_name} + */ + readonly promName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#prom_type AomPromInstance#prom_type} + */ + readonly promType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#prom_version AomPromInstance#prom_version} + */ + readonly promVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#region AomPromInstance#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance huaweicloud_aom_prom_instance} +*/ +export class AomPromInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_prom_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomPromInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomPromInstance to import + * @param importFromId The id of the existing AomPromInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomPromInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_prom_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prom_instance huaweicloud_aom_prom_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomPromInstanceConfig + */ + public constructor(scope: Construct, id: string, config: AomPromInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_prom_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._promName = config.promName; + this._promType = config.promType; + this._promVersion = config.promVersion; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // prom_http_api_endpoint - computed: true, optional: false, required: false + public get promHttpApiEndpoint() { + return this.getStringAttribute('prom_http_api_endpoint'); + } + + // prom_name - computed: false, optional: false, required: true + private _promName?: string; + public get promName() { + return this.getStringAttribute('prom_name'); + } + public set promName(value: string) { + this._promName = value; + } + // Temporarily expose input value. Use with caution. + public get promNameInput() { + return this._promName; + } + + // prom_type - computed: false, optional: false, required: true + private _promType?: string; + public get promType() { + return this.getStringAttribute('prom_type'); + } + public set promType(value: string) { + this._promType = value; + } + // Temporarily expose input value. Use with caution. + public get promTypeInput() { + return this._promType; + } + + // prom_version - computed: false, optional: true, required: false + private _promVersion?: string; + public get promVersion() { + return this.getStringAttribute('prom_version'); + } + public set promVersion(value: string) { + this._promVersion = value; + } + public resetPromVersion() { + this._promVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get promVersionInput() { + return this._promVersion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_read_url - computed: true, optional: false, required: false + public get remoteReadUrl() { + return this.getStringAttribute('remote_read_url'); + } + + // remote_write_url - computed: true, optional: false, required: false + public get remoteWriteUrl() { + return this.getStringAttribute('remote_write_url'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + prom_name: cdktf.stringToTerraform(this._promName), + prom_type: cdktf.stringToTerraform(this._promType), + prom_version: cdktf.stringToTerraform(this._promVersion), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_name: { + value: cdktf.stringToHclTerraform(this._promName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_type: { + value: cdktf.stringToHclTerraform(this._promType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_version: { + value: cdktf.stringToHclTerraform(this._promVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-prometheus-instance/README.md b/src/constructs/providers/huaweicloud/aom-prometheus-instance/README.md new file mode 100644 index 00000000..f2f3378e --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-prometheus-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_prometheus_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_prometheus_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance). diff --git a/src/constructs/providers/huaweicloud/aom-prometheus-instance/index.ts b/src/constructs/providers/huaweicloud/aom-prometheus-instance/index.ts new file mode 100644 index 00000000..325cb0a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-prometheus-instance/index.ts @@ -0,0 +1,474 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomPrometheusInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#id AomPrometheusInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#region AomPrometheusInstance#region} + */ + readonly region?: string; + /** + * prom_for_cloud_service block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#prom_for_cloud_service AomPrometheusInstance#prom_for_cloud_service} + */ + readonly promForCloudService: AomPrometheusInstancePromForCloudService[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#timeouts AomPrometheusInstance#timeouts} + */ + readonly timeouts?: AomPrometheusInstanceTimeouts; +} +export interface AomPrometheusInstancePromForCloudService { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#ces_metric_namespaces AomPrometheusInstance#ces_metric_namespaces} + */ + readonly cesMetricNamespaces: string[]; +} + +export function aomPrometheusInstancePromForCloudServiceToTerraform(struct?: AomPrometheusInstancePromForCloudService | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ces_metric_namespaces: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.cesMetricNamespaces), + } +} + + +export function aomPrometheusInstancePromForCloudServiceToHclTerraform(struct?: AomPrometheusInstancePromForCloudService | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ces_metric_namespaces: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.cesMetricNamespaces), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomPrometheusInstancePromForCloudServiceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomPrometheusInstancePromForCloudService | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cesMetricNamespaces !== undefined) { + hasAnyValues = true; + internalValueResult.cesMetricNamespaces = this._cesMetricNamespaces; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomPrometheusInstancePromForCloudService | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cesMetricNamespaces = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cesMetricNamespaces = value.cesMetricNamespaces; + } + } + + // ces_metric_namespaces - computed: false, optional: false, required: true + private _cesMetricNamespaces?: string[]; + public get cesMetricNamespaces() { + return this.getListAttribute('ces_metric_namespaces'); + } + public set cesMetricNamespaces(value: string[]) { + this._cesMetricNamespaces = value; + } + // Temporarily expose input value. Use with caution. + public get cesMetricNamespacesInput() { + return this._cesMetricNamespaces; + } +} + +export class AomPrometheusInstancePromForCloudServiceList extends cdktf.ComplexList { + public internalValue? : AomPrometheusInstancePromForCloudService[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomPrometheusInstancePromForCloudServiceOutputReference { + return new AomPrometheusInstancePromForCloudServiceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomPrometheusInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#create AomPrometheusInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#delete AomPrometheusInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#update AomPrometheusInstance#update} + */ + readonly update?: string; +} + +export function aomPrometheusInstanceTimeoutsToTerraform(struct?: AomPrometheusInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomPrometheusInstanceTimeoutsToHclTerraform(struct?: AomPrometheusInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomPrometheusInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomPrometheusInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomPrometheusInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance huaweicloud_aom_prometheus_instance} +*/ +export class AomPrometheusInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_prometheus_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomPrometheusInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomPrometheusInstance to import + * @param importFromId The id of the existing AomPrometheusInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomPrometheusInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_prometheus_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_prometheus_instance huaweicloud_aom_prometheus_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomPrometheusInstanceConfig + */ + public constructor(scope: Construct, id: string, config: AomPrometheusInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_prometheus_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._promForCloudService.internalValue = config.promForCloudService; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // prom_for_cloud_service - computed: false, optional: false, required: true + private _promForCloudService = new AomPrometheusInstancePromForCloudServiceList(this, "prom_for_cloud_service", false); + public get promForCloudService() { + return this._promForCloudService; + } + public putPromForCloudService(value: AomPrometheusInstancePromForCloudService[] | cdktf.IResolvable) { + this._promForCloudService.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get promForCloudServiceInput() { + return this._promForCloudService.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomPrometheusInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomPrometheusInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + prom_for_cloud_service: cdktf.listMapper(aomPrometheusInstancePromForCloudServiceToTerraform, true)(this._promForCloudService.internalValue), + timeouts: aomPrometheusInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_for_cloud_service: { + value: cdktf.listMapperHcl(aomPrometheusInstancePromForCloudServiceToHclTerraform, true)(this._promForCloudService.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomPrometheusInstancePromForCloudServiceList", + }, + timeouts: { + value: aomPrometheusInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomPrometheusInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aom-service-discovery-rule/README.md b/src/constructs/providers/huaweicloud/aom-service-discovery-rule/README.md new file mode 100644 index 00000000..78334a17 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-service-discovery-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aom_service_discovery_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aom_service_discovery_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule). diff --git a/src/constructs/providers/huaweicloud/aom-service-discovery-rule/index.ts b/src/constructs/providers/huaweicloud/aom-service-discovery-rule/index.ts new file mode 100644 index 00000000..4fc28a78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aom-service-discovery-rule/index.ts @@ -0,0 +1,1456 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AomServiceDiscoveryRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#description AomServiceDiscoveryRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#detect_log_enabled AomServiceDiscoveryRule#detect_log_enabled} + */ + readonly detectLogEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#discovery_rule_enabled AomServiceDiscoveryRule#discovery_rule_enabled} + */ + readonly discoveryRuleEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#id AomServiceDiscoveryRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#is_default_rule AomServiceDiscoveryRule#is_default_rule} + */ + readonly isDefaultRule?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#log_file_suffix AomServiceDiscoveryRule#log_file_suffix} + */ + readonly logFileSuffix: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#name AomServiceDiscoveryRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#priority AomServiceDiscoveryRule#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#region AomServiceDiscoveryRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#service_type AomServiceDiscoveryRule#service_type} + */ + readonly serviceType: string; + /** + * discovery_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#discovery_rules AomServiceDiscoveryRule#discovery_rules} + */ + readonly discoveryRules: AomServiceDiscoveryRuleDiscoveryRules[] | cdktf.IResolvable; + /** + * log_path_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#log_path_rules AomServiceDiscoveryRule#log_path_rules} + */ + readonly logPathRules?: AomServiceDiscoveryRuleLogPathRules[] | cdktf.IResolvable; + /** + * name_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#name_rules AomServiceDiscoveryRule#name_rules} + */ + readonly nameRules: AomServiceDiscoveryRuleNameRules; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#timeouts AomServiceDiscoveryRule#timeouts} + */ + readonly timeouts?: AomServiceDiscoveryRuleTimeouts; +} +export interface AomServiceDiscoveryRuleDiscoveryRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#check_content AomServiceDiscoveryRule#check_content} + */ + readonly checkContent: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#check_mode AomServiceDiscoveryRule#check_mode} + */ + readonly checkMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#check_type AomServiceDiscoveryRule#check_type} + */ + readonly checkType: string; +} + +export function aomServiceDiscoveryRuleDiscoveryRulesToTerraform(struct?: AomServiceDiscoveryRuleDiscoveryRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + check_content: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.checkContent), + check_mode: cdktf.stringToTerraform(struct!.checkMode), + check_type: cdktf.stringToTerraform(struct!.checkType), + } +} + + +export function aomServiceDiscoveryRuleDiscoveryRulesToHclTerraform(struct?: AomServiceDiscoveryRuleDiscoveryRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + check_content: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.checkContent), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + check_mode: { + value: cdktf.stringToHclTerraform(struct!.checkMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + check_type: { + value: cdktf.stringToHclTerraform(struct!.checkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomServiceDiscoveryRuleDiscoveryRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomServiceDiscoveryRuleDiscoveryRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._checkContent !== undefined) { + hasAnyValues = true; + internalValueResult.checkContent = this._checkContent; + } + if (this._checkMode !== undefined) { + hasAnyValues = true; + internalValueResult.checkMode = this._checkMode; + } + if (this._checkType !== undefined) { + hasAnyValues = true; + internalValueResult.checkType = this._checkType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomServiceDiscoveryRuleDiscoveryRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._checkContent = undefined; + this._checkMode = undefined; + this._checkType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._checkContent = value.checkContent; + this._checkMode = value.checkMode; + this._checkType = value.checkType; + } + } + + // check_content - computed: false, optional: false, required: true + private _checkContent?: string[]; + public get checkContent() { + return this.getListAttribute('check_content'); + } + public set checkContent(value: string[]) { + this._checkContent = value; + } + // Temporarily expose input value. Use with caution. + public get checkContentInput() { + return this._checkContent; + } + + // check_mode - computed: false, optional: false, required: true + private _checkMode?: string; + public get checkMode() { + return this.getStringAttribute('check_mode'); + } + public set checkMode(value: string) { + this._checkMode = value; + } + // Temporarily expose input value. Use with caution. + public get checkModeInput() { + return this._checkMode; + } + + // check_type - computed: false, optional: false, required: true + private _checkType?: string; + public get checkType() { + return this.getStringAttribute('check_type'); + } + public set checkType(value: string) { + this._checkType = value; + } + // Temporarily expose input value. Use with caution. + public get checkTypeInput() { + return this._checkType; + } +} + +export class AomServiceDiscoveryRuleDiscoveryRulesList extends cdktf.ComplexList { + public internalValue? : AomServiceDiscoveryRuleDiscoveryRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomServiceDiscoveryRuleDiscoveryRulesOutputReference { + return new AomServiceDiscoveryRuleDiscoveryRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomServiceDiscoveryRuleLogPathRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#args AomServiceDiscoveryRule#args} + */ + readonly args: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#name_type AomServiceDiscoveryRule#name_type} + */ + readonly nameType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#value AomServiceDiscoveryRule#value} + */ + readonly value: string[]; +} + +export function aomServiceDiscoveryRuleLogPathRulesToTerraform(struct?: AomServiceDiscoveryRuleLogPathRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + args: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.args), + name_type: cdktf.stringToTerraform(struct!.nameType), + value: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.value), + } +} + + +export function aomServiceDiscoveryRuleLogPathRulesToHclTerraform(struct?: AomServiceDiscoveryRuleLogPathRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + args: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.args), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name_type: { + value: cdktf.stringToHclTerraform(struct!.nameType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.value), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomServiceDiscoveryRuleLogPathRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomServiceDiscoveryRuleLogPathRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._args !== undefined) { + hasAnyValues = true; + internalValueResult.args = this._args; + } + if (this._nameType !== undefined) { + hasAnyValues = true; + internalValueResult.nameType = this._nameType; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomServiceDiscoveryRuleLogPathRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._args = undefined; + this._nameType = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._args = value.args; + this._nameType = value.nameType; + this._value = value.value; + } + } + + // args - computed: false, optional: false, required: true + private _args?: string[]; + public get args() { + return this.getListAttribute('args'); + } + public set args(value: string[]) { + this._args = value; + } + // Temporarily expose input value. Use with caution. + public get argsInput() { + return this._args; + } + + // name_type - computed: false, optional: false, required: true + private _nameType?: string; + public get nameType() { + return this.getStringAttribute('name_type'); + } + public set nameType(value: string) { + this._nameType = value; + } + // Temporarily expose input value. Use with caution. + public get nameTypeInput() { + return this._nameType; + } + + // value - computed: false, optional: false, required: true + private _value?: string[]; + public get value() { + return this.getListAttribute('value'); + } + public set value(value: string[]) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class AomServiceDiscoveryRuleLogPathRulesList extends cdktf.ComplexList { + public internalValue? : AomServiceDiscoveryRuleLogPathRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomServiceDiscoveryRuleLogPathRulesOutputReference { + return new AomServiceDiscoveryRuleLogPathRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomServiceDiscoveryRuleNameRulesApplicationNameRule { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#args AomServiceDiscoveryRule#args} + */ + readonly args: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#name_type AomServiceDiscoveryRule#name_type} + */ + readonly nameType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#value AomServiceDiscoveryRule#value} + */ + readonly value?: string[]; +} + +export function aomServiceDiscoveryRuleNameRulesApplicationNameRuleToTerraform(struct?: AomServiceDiscoveryRuleNameRulesApplicationNameRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + args: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.args), + name_type: cdktf.stringToTerraform(struct!.nameType), + value: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.value), + } +} + + +export function aomServiceDiscoveryRuleNameRulesApplicationNameRuleToHclTerraform(struct?: AomServiceDiscoveryRuleNameRulesApplicationNameRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + args: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.args), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name_type: { + value: cdktf.stringToHclTerraform(struct!.nameType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.value), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomServiceDiscoveryRuleNameRulesApplicationNameRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomServiceDiscoveryRuleNameRulesApplicationNameRule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._args !== undefined) { + hasAnyValues = true; + internalValueResult.args = this._args; + } + if (this._nameType !== undefined) { + hasAnyValues = true; + internalValueResult.nameType = this._nameType; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomServiceDiscoveryRuleNameRulesApplicationNameRule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._args = undefined; + this._nameType = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._args = value.args; + this._nameType = value.nameType; + this._value = value.value; + } + } + + // args - computed: false, optional: false, required: true + private _args?: string[]; + public get args() { + return this.getListAttribute('args'); + } + public set args(value: string[]) { + this._args = value; + } + // Temporarily expose input value. Use with caution. + public get argsInput() { + return this._args; + } + + // name_type - computed: false, optional: false, required: true + private _nameType?: string; + public get nameType() { + return this.getStringAttribute('name_type'); + } + public set nameType(value: string) { + this._nameType = value; + } + // Temporarily expose input value. Use with caution. + public get nameTypeInput() { + return this._nameType; + } + + // value - computed: false, optional: true, required: false + private _value?: string[]; + public get value() { + return this.getListAttribute('value'); + } + public set value(value: string[]) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class AomServiceDiscoveryRuleNameRulesApplicationNameRuleList extends cdktf.ComplexList { + public internalValue? : AomServiceDiscoveryRuleNameRulesApplicationNameRule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomServiceDiscoveryRuleNameRulesApplicationNameRuleOutputReference { + return new AomServiceDiscoveryRuleNameRulesApplicationNameRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomServiceDiscoveryRuleNameRulesServiceNameRule { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#args AomServiceDiscoveryRule#args} + */ + readonly args: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#name_type AomServiceDiscoveryRule#name_type} + */ + readonly nameType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#value AomServiceDiscoveryRule#value} + */ + readonly value?: string[]; +} + +export function aomServiceDiscoveryRuleNameRulesServiceNameRuleToTerraform(struct?: AomServiceDiscoveryRuleNameRulesServiceNameRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + args: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.args), + name_type: cdktf.stringToTerraform(struct!.nameType), + value: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.value), + } +} + + +export function aomServiceDiscoveryRuleNameRulesServiceNameRuleToHclTerraform(struct?: AomServiceDiscoveryRuleNameRulesServiceNameRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + args: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.args), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name_type: { + value: cdktf.stringToHclTerraform(struct!.nameType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.value), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomServiceDiscoveryRuleNameRulesServiceNameRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AomServiceDiscoveryRuleNameRulesServiceNameRule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._args !== undefined) { + hasAnyValues = true; + internalValueResult.args = this._args; + } + if (this._nameType !== undefined) { + hasAnyValues = true; + internalValueResult.nameType = this._nameType; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomServiceDiscoveryRuleNameRulesServiceNameRule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._args = undefined; + this._nameType = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._args = value.args; + this._nameType = value.nameType; + this._value = value.value; + } + } + + // args - computed: false, optional: false, required: true + private _args?: string[]; + public get args() { + return this.getListAttribute('args'); + } + public set args(value: string[]) { + this._args = value; + } + // Temporarily expose input value. Use with caution. + public get argsInput() { + return this._args; + } + + // name_type - computed: false, optional: false, required: true + private _nameType?: string; + public get nameType() { + return this.getStringAttribute('name_type'); + } + public set nameType(value: string) { + this._nameType = value; + } + // Temporarily expose input value. Use with caution. + public get nameTypeInput() { + return this._nameType; + } + + // value - computed: false, optional: true, required: false + private _value?: string[]; + public get value() { + return this.getListAttribute('value'); + } + public set value(value: string[]) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class AomServiceDiscoveryRuleNameRulesServiceNameRuleList extends cdktf.ComplexList { + public internalValue? : AomServiceDiscoveryRuleNameRulesServiceNameRule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AomServiceDiscoveryRuleNameRulesServiceNameRuleOutputReference { + return new AomServiceDiscoveryRuleNameRulesServiceNameRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AomServiceDiscoveryRuleNameRules { + /** + * application_name_rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#application_name_rule AomServiceDiscoveryRule#application_name_rule} + */ + readonly applicationNameRule: AomServiceDiscoveryRuleNameRulesApplicationNameRule[] | cdktf.IResolvable; + /** + * service_name_rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#service_name_rule AomServiceDiscoveryRule#service_name_rule} + */ + readonly serviceNameRule: AomServiceDiscoveryRuleNameRulesServiceNameRule[] | cdktf.IResolvable; +} + +export function aomServiceDiscoveryRuleNameRulesToTerraform(struct?: AomServiceDiscoveryRuleNameRulesOutputReference | AomServiceDiscoveryRuleNameRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + application_name_rule: cdktf.listMapper(aomServiceDiscoveryRuleNameRulesApplicationNameRuleToTerraform, true)(struct!.applicationNameRule), + service_name_rule: cdktf.listMapper(aomServiceDiscoveryRuleNameRulesServiceNameRuleToTerraform, true)(struct!.serviceNameRule), + } +} + + +export function aomServiceDiscoveryRuleNameRulesToHclTerraform(struct?: AomServiceDiscoveryRuleNameRulesOutputReference | AomServiceDiscoveryRuleNameRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + application_name_rule: { + value: cdktf.listMapperHcl(aomServiceDiscoveryRuleNameRulesApplicationNameRuleToHclTerraform, true)(struct!.applicationNameRule), + isBlock: true, + type: "list", + storageClassType: "AomServiceDiscoveryRuleNameRulesApplicationNameRuleList", + }, + service_name_rule: { + value: cdktf.listMapperHcl(aomServiceDiscoveryRuleNameRulesServiceNameRuleToHclTerraform, true)(struct!.serviceNameRule), + isBlock: true, + type: "list", + storageClassType: "AomServiceDiscoveryRuleNameRulesServiceNameRuleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomServiceDiscoveryRuleNameRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AomServiceDiscoveryRuleNameRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._applicationNameRule?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.applicationNameRule = this._applicationNameRule?.internalValue; + } + if (this._serviceNameRule?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.serviceNameRule = this._serviceNameRule?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomServiceDiscoveryRuleNameRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._applicationNameRule.internalValue = undefined; + this._serviceNameRule.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._applicationNameRule.internalValue = value.applicationNameRule; + this._serviceNameRule.internalValue = value.serviceNameRule; + } + } + + // application_name_rule - computed: false, optional: false, required: true + private _applicationNameRule = new AomServiceDiscoveryRuleNameRulesApplicationNameRuleList(this, "application_name_rule", false); + public get applicationNameRule() { + return this._applicationNameRule; + } + public putApplicationNameRule(value: AomServiceDiscoveryRuleNameRulesApplicationNameRule[] | cdktf.IResolvable) { + this._applicationNameRule.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get applicationNameRuleInput() { + return this._applicationNameRule.internalValue; + } + + // service_name_rule - computed: false, optional: false, required: true + private _serviceNameRule = new AomServiceDiscoveryRuleNameRulesServiceNameRuleList(this, "service_name_rule", false); + public get serviceNameRule() { + return this._serviceNameRule; + } + public putServiceNameRule(value: AomServiceDiscoveryRuleNameRulesServiceNameRule[] | cdktf.IResolvable) { + this._serviceNameRule.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get serviceNameRuleInput() { + return this._serviceNameRule.internalValue; + } +} +export interface AomServiceDiscoveryRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#create AomServiceDiscoveryRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#delete AomServiceDiscoveryRule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#update AomServiceDiscoveryRule#update} + */ + readonly update?: string; +} + +export function aomServiceDiscoveryRuleTimeoutsToTerraform(struct?: AomServiceDiscoveryRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function aomServiceDiscoveryRuleTimeoutsToHclTerraform(struct?: AomServiceDiscoveryRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AomServiceDiscoveryRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AomServiceDiscoveryRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AomServiceDiscoveryRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule huaweicloud_aom_service_discovery_rule} +*/ +export class AomServiceDiscoveryRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_service_discovery_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AomServiceDiscoveryRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AomServiceDiscoveryRule to import + * @param importFromId The id of the existing AomServiceDiscoveryRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AomServiceDiscoveryRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_service_discovery_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aom_service_discovery_rule huaweicloud_aom_service_discovery_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AomServiceDiscoveryRuleConfig + */ + public constructor(scope: Construct, id: string, config: AomServiceDiscoveryRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_service_discovery_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._detectLogEnabled = config.detectLogEnabled; + this._discoveryRuleEnabled = config.discoveryRuleEnabled; + this._id = config.id; + this._isDefaultRule = config.isDefaultRule; + this._logFileSuffix = config.logFileSuffix; + this._name = config.name; + this._priority = config.priority; + this._region = config.region; + this._serviceType = config.serviceType; + this._discoveryRules.internalValue = config.discoveryRules; + this._logPathRules.internalValue = config.logPathRules; + this._nameRules.internalValue = config.nameRules; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // detect_log_enabled - computed: false, optional: true, required: false + private _detectLogEnabled?: boolean | cdktf.IResolvable; + public get detectLogEnabled() { + return this.getBooleanAttribute('detect_log_enabled'); + } + public set detectLogEnabled(value: boolean | cdktf.IResolvable) { + this._detectLogEnabled = value; + } + public resetDetectLogEnabled() { + this._detectLogEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get detectLogEnabledInput() { + return this._detectLogEnabled; + } + + // discovery_rule_enabled - computed: false, optional: true, required: false + private _discoveryRuleEnabled?: boolean | cdktf.IResolvable; + public get discoveryRuleEnabled() { + return this.getBooleanAttribute('discovery_rule_enabled'); + } + public set discoveryRuleEnabled(value: boolean | cdktf.IResolvable) { + this._discoveryRuleEnabled = value; + } + public resetDiscoveryRuleEnabled() { + this._discoveryRuleEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get discoveryRuleEnabledInput() { + return this._discoveryRuleEnabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_default_rule - computed: false, optional: true, required: false + private _isDefaultRule?: boolean | cdktf.IResolvable; + public get isDefaultRule() { + return this.getBooleanAttribute('is_default_rule'); + } + public set isDefaultRule(value: boolean | cdktf.IResolvable) { + this._isDefaultRule = value; + } + public resetIsDefaultRule() { + this._isDefaultRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDefaultRuleInput() { + return this._isDefaultRule; + } + + // log_file_suffix - computed: false, optional: false, required: true + private _logFileSuffix?: string[]; + public get logFileSuffix() { + return this.getListAttribute('log_file_suffix'); + } + public set logFileSuffix(value: string[]) { + this._logFileSuffix = value; + } + // Temporarily expose input value. Use with caution. + public get logFileSuffixInput() { + return this._logFileSuffix; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // priority - computed: false, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // service_type - computed: false, optional: false, required: true + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // discovery_rules - computed: false, optional: false, required: true + private _discoveryRules = new AomServiceDiscoveryRuleDiscoveryRulesList(this, "discovery_rules", false); + public get discoveryRules() { + return this._discoveryRules; + } + public putDiscoveryRules(value: AomServiceDiscoveryRuleDiscoveryRules[] | cdktf.IResolvable) { + this._discoveryRules.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get discoveryRulesInput() { + return this._discoveryRules.internalValue; + } + + // log_path_rules - computed: false, optional: true, required: false + private _logPathRules = new AomServiceDiscoveryRuleLogPathRulesList(this, "log_path_rules", false); + public get logPathRules() { + return this._logPathRules; + } + public putLogPathRules(value: AomServiceDiscoveryRuleLogPathRules[] | cdktf.IResolvable) { + this._logPathRules.internalValue = value; + } + public resetLogPathRules() { + this._logPathRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logPathRulesInput() { + return this._logPathRules.internalValue; + } + + // name_rules - computed: false, optional: false, required: true + private _nameRules = new AomServiceDiscoveryRuleNameRulesOutputReference(this, "name_rules"); + public get nameRules() { + return this._nameRules; + } + public putNameRules(value: AomServiceDiscoveryRuleNameRules) { + this._nameRules.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nameRulesInput() { + return this._nameRules.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AomServiceDiscoveryRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AomServiceDiscoveryRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + detect_log_enabled: cdktf.booleanToTerraform(this._detectLogEnabled), + discovery_rule_enabled: cdktf.booleanToTerraform(this._discoveryRuleEnabled), + id: cdktf.stringToTerraform(this._id), + is_default_rule: cdktf.booleanToTerraform(this._isDefaultRule), + log_file_suffix: cdktf.listMapper(cdktf.stringToTerraform, false)(this._logFileSuffix), + name: cdktf.stringToTerraform(this._name), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + service_type: cdktf.stringToTerraform(this._serviceType), + discovery_rules: cdktf.listMapper(aomServiceDiscoveryRuleDiscoveryRulesToTerraform, true)(this._discoveryRules.internalValue), + log_path_rules: cdktf.listMapper(aomServiceDiscoveryRuleLogPathRulesToTerraform, true)(this._logPathRules.internalValue), + name_rules: aomServiceDiscoveryRuleNameRulesToTerraform(this._nameRules.internalValue), + timeouts: aomServiceDiscoveryRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detect_log_enabled: { + value: cdktf.booleanToHclTerraform(this._detectLogEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + discovery_rule_enabled: { + value: cdktf.booleanToHclTerraform(this._discoveryRuleEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_default_rule: { + value: cdktf.booleanToHclTerraform(this._isDefaultRule), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + log_file_suffix: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._logFileSuffix), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + discovery_rules: { + value: cdktf.listMapperHcl(aomServiceDiscoveryRuleDiscoveryRulesToHclTerraform, true)(this._discoveryRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomServiceDiscoveryRuleDiscoveryRulesList", + }, + log_path_rules: { + value: cdktf.listMapperHcl(aomServiceDiscoveryRuleLogPathRulesToHclTerraform, true)(this._logPathRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomServiceDiscoveryRuleLogPathRulesList", + }, + name_rules: { + value: aomServiceDiscoveryRuleNameRulesToHclTerraform(this._nameRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "AomServiceDiscoveryRuleNameRulesList", + }, + timeouts: { + value: aomServiceDiscoveryRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AomServiceDiscoveryRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/aomv4-alarm-rule/README.md b/src/constructs/providers/huaweicloud/aomv4-alarm-rule/README.md new file mode 100644 index 00000000..a032f166 --- /dev/null +++ b/src/constructs/providers/huaweicloud/aomv4-alarm-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_aomv4_alarm_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_aomv4_alarm_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule). diff --git a/src/constructs/providers/huaweicloud/aomv4-alarm-rule/index.ts b/src/constructs/providers/huaweicloud/aomv4-alarm-rule/index.ts new file mode 100644 index 00000000..404504ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/aomv4-alarm-rule/index.ts @@ -0,0 +1,2617 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface Aomv4AlarmRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#description Aomv4AlarmRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#enable Aomv4AlarmRule#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#enterprise_project_id Aomv4AlarmRule#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#id Aomv4AlarmRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#name Aomv4AlarmRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#prom_instance_id Aomv4AlarmRule#prom_instance_id} + */ + readonly promInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#region Aomv4AlarmRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#type Aomv4AlarmRule#type} + */ + readonly type: string; + /** + * alarm_notifications block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#alarm_notifications Aomv4AlarmRule#alarm_notifications} + */ + readonly alarmNotifications: Aomv4AlarmRuleAlarmNotifications; + /** + * event_alarm_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#event_alarm_spec Aomv4AlarmRule#event_alarm_spec} + */ + readonly eventAlarmSpec?: Aomv4AlarmRuleEventAlarmSpec; + /** + * metric_alarm_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_alarm_spec Aomv4AlarmRule#metric_alarm_spec} + */ + readonly metricAlarmSpec?: Aomv4AlarmRuleMetricAlarmSpec; +} +export interface Aomv4AlarmRuleAlarmNotifications { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#bind_notification_rule_id Aomv4AlarmRule#bind_notification_rule_id} + */ + readonly bindNotificationRuleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#notification_enable Aomv4AlarmRule#notification_enable} + */ + readonly notificationEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#notification_type Aomv4AlarmRule#notification_type} + */ + readonly notificationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#notify_frequency Aomv4AlarmRule#notify_frequency} + */ + readonly notifyFrequency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#notify_resolved Aomv4AlarmRule#notify_resolved} + */ + readonly notifyResolved?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#notify_triggered Aomv4AlarmRule#notify_triggered} + */ + readonly notifyTriggered?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#route_group_enable Aomv4AlarmRule#route_group_enable} + */ + readonly routeGroupEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#route_group_rule Aomv4AlarmRule#route_group_rule} + */ + readonly routeGroupRule?: string; +} + +export function aomv4AlarmRuleAlarmNotificationsToTerraform(struct?: Aomv4AlarmRuleAlarmNotificationsOutputReference | Aomv4AlarmRuleAlarmNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bind_notification_rule_id: cdktf.stringToTerraform(struct!.bindNotificationRuleId), + notification_enable: cdktf.booleanToTerraform(struct!.notificationEnable), + notification_type: cdktf.stringToTerraform(struct!.notificationType), + notify_frequency: cdktf.stringToTerraform(struct!.notifyFrequency), + notify_resolved: cdktf.booleanToTerraform(struct!.notifyResolved), + notify_triggered: cdktf.booleanToTerraform(struct!.notifyTriggered), + route_group_enable: cdktf.booleanToTerraform(struct!.routeGroupEnable), + route_group_rule: cdktf.stringToTerraform(struct!.routeGroupRule), + } +} + + +export function aomv4AlarmRuleAlarmNotificationsToHclTerraform(struct?: Aomv4AlarmRuleAlarmNotificationsOutputReference | Aomv4AlarmRuleAlarmNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bind_notification_rule_id: { + value: cdktf.stringToHclTerraform(struct!.bindNotificationRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_enable: { + value: cdktf.booleanToHclTerraform(struct!.notificationEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + notification_type: { + value: cdktf.stringToHclTerraform(struct!.notificationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notify_frequency: { + value: cdktf.stringToHclTerraform(struct!.notifyFrequency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notify_resolved: { + value: cdktf.booleanToHclTerraform(struct!.notifyResolved), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + notify_triggered: { + value: cdktf.booleanToHclTerraform(struct!.notifyTriggered), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + route_group_enable: { + value: cdktf.booleanToHclTerraform(struct!.routeGroupEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + route_group_rule: { + value: cdktf.stringToHclTerraform(struct!.routeGroupRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleAlarmNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Aomv4AlarmRuleAlarmNotifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bindNotificationRuleId !== undefined) { + hasAnyValues = true; + internalValueResult.bindNotificationRuleId = this._bindNotificationRuleId; + } + if (this._notificationEnable !== undefined) { + hasAnyValues = true; + internalValueResult.notificationEnable = this._notificationEnable; + } + if (this._notificationType !== undefined) { + hasAnyValues = true; + internalValueResult.notificationType = this._notificationType; + } + if (this._notifyFrequency !== undefined) { + hasAnyValues = true; + internalValueResult.notifyFrequency = this._notifyFrequency; + } + if (this._notifyResolved !== undefined) { + hasAnyValues = true; + internalValueResult.notifyResolved = this._notifyResolved; + } + if (this._notifyTriggered !== undefined) { + hasAnyValues = true; + internalValueResult.notifyTriggered = this._notifyTriggered; + } + if (this._routeGroupEnable !== undefined) { + hasAnyValues = true; + internalValueResult.routeGroupEnable = this._routeGroupEnable; + } + if (this._routeGroupRule !== undefined) { + hasAnyValues = true; + internalValueResult.routeGroupRule = this._routeGroupRule; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleAlarmNotifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bindNotificationRuleId = undefined; + this._notificationEnable = undefined; + this._notificationType = undefined; + this._notifyFrequency = undefined; + this._notifyResolved = undefined; + this._notifyTriggered = undefined; + this._routeGroupEnable = undefined; + this._routeGroupRule = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bindNotificationRuleId = value.bindNotificationRuleId; + this._notificationEnable = value.notificationEnable; + this._notificationType = value.notificationType; + this._notifyFrequency = value.notifyFrequency; + this._notifyResolved = value.notifyResolved; + this._notifyTriggered = value.notifyTriggered; + this._routeGroupEnable = value.routeGroupEnable; + this._routeGroupRule = value.routeGroupRule; + } + } + + // bind_notification_rule_id - computed: false, optional: true, required: false + private _bindNotificationRuleId?: string; + public get bindNotificationRuleId() { + return this.getStringAttribute('bind_notification_rule_id'); + } + public set bindNotificationRuleId(value: string) { + this._bindNotificationRuleId = value; + } + public resetBindNotificationRuleId() { + this._bindNotificationRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindNotificationRuleIdInput() { + return this._bindNotificationRuleId; + } + + // notification_enable - computed: true, optional: true, required: false + private _notificationEnable?: boolean | cdktf.IResolvable; + public get notificationEnable() { + return this.getBooleanAttribute('notification_enable'); + } + public set notificationEnable(value: boolean | cdktf.IResolvable) { + this._notificationEnable = value; + } + public resetNotificationEnable() { + this._notificationEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationEnableInput() { + return this._notificationEnable; + } + + // notification_type - computed: false, optional: false, required: true + private _notificationType?: string; + public get notificationType() { + return this.getStringAttribute('notification_type'); + } + public set notificationType(value: string) { + this._notificationType = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTypeInput() { + return this._notificationType; + } + + // notify_frequency - computed: true, optional: true, required: false + private _notifyFrequency?: string; + public get notifyFrequency() { + return this.getStringAttribute('notify_frequency'); + } + public set notifyFrequency(value: string) { + this._notifyFrequency = value; + } + public resetNotifyFrequency() { + this._notifyFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyFrequencyInput() { + return this._notifyFrequency; + } + + // notify_resolved - computed: true, optional: true, required: false + private _notifyResolved?: boolean | cdktf.IResolvable; + public get notifyResolved() { + return this.getBooleanAttribute('notify_resolved'); + } + public set notifyResolved(value: boolean | cdktf.IResolvable) { + this._notifyResolved = value; + } + public resetNotifyResolved() { + this._notifyResolved = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyResolvedInput() { + return this._notifyResolved; + } + + // notify_triggered - computed: true, optional: true, required: false + private _notifyTriggered?: boolean | cdktf.IResolvable; + public get notifyTriggered() { + return this.getBooleanAttribute('notify_triggered'); + } + public set notifyTriggered(value: boolean | cdktf.IResolvable) { + this._notifyTriggered = value; + } + public resetNotifyTriggered() { + this._notifyTriggered = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyTriggeredInput() { + return this._notifyTriggered; + } + + // route_group_enable - computed: true, optional: true, required: false + private _routeGroupEnable?: boolean | cdktf.IResolvable; + public get routeGroupEnable() { + return this.getBooleanAttribute('route_group_enable'); + } + public set routeGroupEnable(value: boolean | cdktf.IResolvable) { + this._routeGroupEnable = value; + } + public resetRouteGroupEnable() { + this._routeGroupEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeGroupEnableInput() { + return this._routeGroupEnable; + } + + // route_group_rule - computed: false, optional: true, required: false + private _routeGroupRule?: string; + public get routeGroupRule() { + return this.getStringAttribute('route_group_rule'); + } + public set routeGroupRule(value: string) { + this._routeGroupRule = value; + } + public resetRouteGroupRule() { + this._routeGroupRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeGroupRuleInput() { + return this._routeGroupRule; + } +} +export interface Aomv4AlarmRuleEventAlarmSpecTriggerConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#aggregation_window Aomv4AlarmRule#aggregation_window} + */ + readonly aggregationWindow?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#event_name Aomv4AlarmRule#event_name} + */ + readonly eventName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#frequency Aomv4AlarmRule#frequency} + */ + readonly frequency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#operator Aomv4AlarmRule#operator} + */ + readonly operator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#thresholds Aomv4AlarmRule#thresholds} + */ + readonly thresholds?: { [key: string]: number }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#trigger_type Aomv4AlarmRule#trigger_type} + */ + readonly triggerType: string; +} + +export function aomv4AlarmRuleEventAlarmSpecTriggerConditionsToTerraform(struct?: Aomv4AlarmRuleEventAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aggregation_window: cdktf.numberToTerraform(struct!.aggregationWindow), + event_name: cdktf.stringToTerraform(struct!.eventName), + frequency: cdktf.stringToTerraform(struct!.frequency), + operator: cdktf.stringToTerraform(struct!.operator), + thresholds: cdktf.hashMapper(cdktf.numberToTerraform)(struct!.thresholds), + trigger_type: cdktf.stringToTerraform(struct!.triggerType), + } +} + + +export function aomv4AlarmRuleEventAlarmSpecTriggerConditionsToHclTerraform(struct?: Aomv4AlarmRuleEventAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aggregation_window: { + value: cdktf.numberToHclTerraform(struct!.aggregationWindow), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + event_name: { + value: cdktf.stringToHclTerraform(struct!.eventName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + frequency: { + value: cdktf.stringToHclTerraform(struct!.frequency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thresholds: { + value: cdktf.hashMapperHcl(cdktf.numberToHclTerraform)(struct!.thresholds), + isBlock: false, + type: "map", + storageClassType: "numberMap", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(struct!.triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleEventAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Aomv4AlarmRuleEventAlarmSpecTriggerConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._aggregationWindow !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationWindow = this._aggregationWindow; + } + if (this._eventName !== undefined) { + hasAnyValues = true; + internalValueResult.eventName = this._eventName; + } + if (this._frequency !== undefined) { + hasAnyValues = true; + internalValueResult.frequency = this._frequency; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._thresholds !== undefined) { + hasAnyValues = true; + internalValueResult.thresholds = this._thresholds; + } + if (this._triggerType !== undefined) { + hasAnyValues = true; + internalValueResult.triggerType = this._triggerType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleEventAlarmSpecTriggerConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._aggregationWindow = undefined; + this._eventName = undefined; + this._frequency = undefined; + this._operator = undefined; + this._thresholds = undefined; + this._triggerType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._aggregationWindow = value.aggregationWindow; + this._eventName = value.eventName; + this._frequency = value.frequency; + this._operator = value.operator; + this._thresholds = value.thresholds; + this._triggerType = value.triggerType; + } + } + + // aggregation_window - computed: false, optional: true, required: false + private _aggregationWindow?: number; + public get aggregationWindow() { + return this.getNumberAttribute('aggregation_window'); + } + public set aggregationWindow(value: number) { + this._aggregationWindow = value; + } + public resetAggregationWindow() { + this._aggregationWindow = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationWindowInput() { + return this._aggregationWindow; + } + + // event_name - computed: false, optional: true, required: false + private _eventName?: string; + public get eventName() { + return this.getStringAttribute('event_name'); + } + public set eventName(value: string) { + this._eventName = value; + } + public resetEventName() { + this._eventName = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventNameInput() { + return this._eventName; + } + + // frequency - computed: true, optional: true, required: false + private _frequency?: string; + public get frequency() { + return this.getStringAttribute('frequency'); + } + public set frequency(value: string) { + this._frequency = value; + } + public resetFrequency() { + this._frequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency; + } + + // operator - computed: false, optional: true, required: false + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + public resetOperator() { + this._operator = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // thresholds - computed: false, optional: true, required: false + private _thresholds?: { [key: string]: number }; + public get thresholds() { + return this.getNumberMapAttribute('thresholds'); + } + public set thresholds(value: { [key: string]: number }) { + this._thresholds = value; + } + public resetThresholds() { + this._thresholds = undefined; + } + // Temporarily expose input value. Use with caution. + public get thresholdsInput() { + return this._thresholds; + } + + // trigger_type - computed: false, optional: false, required: true + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } +} + +export class Aomv4AlarmRuleEventAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + public internalValue? : Aomv4AlarmRuleEventAlarmSpecTriggerConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Aomv4AlarmRuleEventAlarmSpecTriggerConditionsOutputReference { + return new Aomv4AlarmRuleEventAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Aomv4AlarmRuleEventAlarmSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#alarm_source Aomv4AlarmRule#alarm_source} + */ + readonly alarmSource: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#event_source Aomv4AlarmRule#event_source} + */ + readonly eventSource: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#monitor_objects Aomv4AlarmRule#monitor_objects} + */ + readonly monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * trigger_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#trigger_conditions Aomv4AlarmRule#trigger_conditions} + */ + readonly triggerConditions?: Aomv4AlarmRuleEventAlarmSpecTriggerConditions[] | cdktf.IResolvable; +} + +export function aomv4AlarmRuleEventAlarmSpecToTerraform(struct?: Aomv4AlarmRuleEventAlarmSpecOutputReference | Aomv4AlarmRuleEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_source: cdktf.stringToTerraform(struct!.alarmSource), + event_source: cdktf.stringToTerraform(struct!.eventSource), + monitor_objects: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(struct!.monitorObjects), + trigger_conditions: cdktf.listMapper(aomv4AlarmRuleEventAlarmSpecTriggerConditionsToTerraform, true)(struct!.triggerConditions), + } +} + + +export function aomv4AlarmRuleEventAlarmSpecToHclTerraform(struct?: Aomv4AlarmRuleEventAlarmSpecOutputReference | Aomv4AlarmRuleEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_source: { + value: cdktf.stringToHclTerraform(struct!.alarmSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_source: { + value: cdktf.stringToHclTerraform(struct!.eventSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + monitor_objects: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(struct!.monitorObjects), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(aomv4AlarmRuleEventAlarmSpecTriggerConditionsToHclTerraform, true)(struct!.triggerConditions), + isBlock: true, + type: "set", + storageClassType: "Aomv4AlarmRuleEventAlarmSpecTriggerConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleEventAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Aomv4AlarmRuleEventAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmSource !== undefined) { + hasAnyValues = true; + internalValueResult.alarmSource = this._alarmSource; + } + if (this._eventSource !== undefined) { + hasAnyValues = true; + internalValueResult.eventSource = this._eventSource; + } + if (this._monitorObjects !== undefined) { + hasAnyValues = true; + internalValueResult.monitorObjects = this._monitorObjects; + } + if (this._triggerConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleEventAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._alarmSource = undefined; + this._eventSource = undefined; + this._monitorObjects = undefined; + this._triggerConditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._alarmSource = value.alarmSource; + this._eventSource = value.eventSource; + this._monitorObjects = value.monitorObjects; + this._triggerConditions.internalValue = value.triggerConditions; + } + } + + // alarm_source - computed: false, optional: false, required: true + private _alarmSource?: string; + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + public set alarmSource(value: string) { + this._alarmSource = value; + } + // Temporarily expose input value. Use with caution. + public get alarmSourceInput() { + return this._alarmSource; + } + + // event_source - computed: false, optional: false, required: true + private _eventSource?: string; + public get eventSource() { + return this.getStringAttribute('event_source'); + } + public set eventSource(value: string) { + this._eventSource = value; + } + // Temporarily expose input value. Use with caution. + public get eventSourceInput() { + return this._eventSource; + } + + // monitor_objects - computed: false, optional: true, required: false + private _monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + public get monitorObjects() { + return this.interpolationForAttribute('monitor_objects'); + } + public set monitorObjects(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._monitorObjects = value; + } + public resetMonitorObjects() { + this._monitorObjects = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorObjectsInput() { + return this._monitorObjects; + } + + // trigger_conditions - computed: false, optional: true, required: false + private _triggerConditions = new Aomv4AlarmRuleEventAlarmSpecTriggerConditionsList(this, "trigger_conditions", true); + public get triggerConditions() { + return this._triggerConditions; + } + public putTriggerConditions(value: Aomv4AlarmRuleEventAlarmSpecTriggerConditions[] | cdktf.IResolvable) { + this._triggerConditions.internalValue = value; + } + public resetTriggerConditions() { + this._triggerConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions.internalValue; + } +} +export interface Aomv4AlarmRuleMetricAlarmSpecAlarmTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#auto_tags Aomv4AlarmRule#auto_tags} + */ + readonly autoTags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#custom_annotations Aomv4AlarmRule#custom_annotations} + */ + readonly customAnnotations?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#custom_tags Aomv4AlarmRule#custom_tags} + */ + readonly customTags?: string[]; +} + +export function aomv4AlarmRuleMetricAlarmSpecAlarmTagsToTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecAlarmTagsOutputReference | Aomv4AlarmRuleMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auto_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.autoTags), + custom_annotations: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customAnnotations), + custom_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.customTags), + } +} + + +export function aomv4AlarmRuleMetricAlarmSpecAlarmTagsToHclTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecAlarmTagsOutputReference | Aomv4AlarmRuleMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auto_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.autoTags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + custom_annotations: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customAnnotations), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + custom_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.customTags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleMetricAlarmSpecAlarmTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Aomv4AlarmRuleMetricAlarmSpecAlarmTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._autoTags !== undefined) { + hasAnyValues = true; + internalValueResult.autoTags = this._autoTags; + } + if (this._customAnnotations !== undefined) { + hasAnyValues = true; + internalValueResult.customAnnotations = this._customAnnotations; + } + if (this._customTags !== undefined) { + hasAnyValues = true; + internalValueResult.customTags = this._customTags; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleMetricAlarmSpecAlarmTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._autoTags = undefined; + this._customAnnotations = undefined; + this._customTags = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._autoTags = value.autoTags; + this._customAnnotations = value.customAnnotations; + this._customTags = value.customTags; + } + } + + // auto_tags - computed: false, optional: true, required: false + private _autoTags?: string[]; + public get autoTags() { + return cdktf.Fn.tolist(this.getListAttribute('auto_tags')); + } + public set autoTags(value: string[]) { + this._autoTags = value; + } + public resetAutoTags() { + this._autoTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoTagsInput() { + return this._autoTags; + } + + // custom_annotations - computed: false, optional: true, required: false + private _customAnnotations?: string[]; + public get customAnnotations() { + return cdktf.Fn.tolist(this.getListAttribute('custom_annotations')); + } + public set customAnnotations(value: string[]) { + this._customAnnotations = value; + } + public resetCustomAnnotations() { + this._customAnnotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get customAnnotationsInput() { + return this._customAnnotations; + } + + // custom_tags - computed: false, optional: true, required: false + private _customTags?: string[]; + public get customTags() { + return cdktf.Fn.tolist(this.getListAttribute('custom_tags')); + } + public set customTags(value: string[]) { + this._customTags = value; + } + public resetCustomTags() { + this._customTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get customTagsInput() { + return this._customTags; + } +} +export interface Aomv4AlarmRuleMetricAlarmSpecNoDataConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#no_data_alert_state Aomv4AlarmRule#no_data_alert_state} + */ + readonly noDataAlertState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#no_data_timeframe Aomv4AlarmRule#no_data_timeframe} + */ + readonly noDataTimeframe?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#notify_no_data Aomv4AlarmRule#notify_no_data} + */ + readonly notifyNoData?: boolean | cdktf.IResolvable; +} + +export function aomv4AlarmRuleMetricAlarmSpecNoDataConditionsToTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecNoDataConditionsOutputReference | Aomv4AlarmRuleMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + no_data_alert_state: cdktf.stringToTerraform(struct!.noDataAlertState), + no_data_timeframe: cdktf.numberToTerraform(struct!.noDataTimeframe), + notify_no_data: cdktf.booleanToTerraform(struct!.notifyNoData), + } +} + + +export function aomv4AlarmRuleMetricAlarmSpecNoDataConditionsToHclTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecNoDataConditionsOutputReference | Aomv4AlarmRuleMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + no_data_alert_state: { + value: cdktf.stringToHclTerraform(struct!.noDataAlertState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_data_timeframe: { + value: cdktf.numberToHclTerraform(struct!.noDataTimeframe), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + notify_no_data: { + value: cdktf.booleanToHclTerraform(struct!.notifyNoData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleMetricAlarmSpecNoDataConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Aomv4AlarmRuleMetricAlarmSpecNoDataConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._noDataAlertState !== undefined) { + hasAnyValues = true; + internalValueResult.noDataAlertState = this._noDataAlertState; + } + if (this._noDataTimeframe !== undefined) { + hasAnyValues = true; + internalValueResult.noDataTimeframe = this._noDataTimeframe; + } + if (this._notifyNoData !== undefined) { + hasAnyValues = true; + internalValueResult.notifyNoData = this._notifyNoData; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleMetricAlarmSpecNoDataConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._noDataAlertState = undefined; + this._noDataTimeframe = undefined; + this._notifyNoData = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._noDataAlertState = value.noDataAlertState; + this._noDataTimeframe = value.noDataTimeframe; + this._notifyNoData = value.notifyNoData; + } + } + + // no_data_alert_state - computed: false, optional: true, required: false + private _noDataAlertState?: string; + public get noDataAlertState() { + return this.getStringAttribute('no_data_alert_state'); + } + public set noDataAlertState(value: string) { + this._noDataAlertState = value; + } + public resetNoDataAlertState() { + this._noDataAlertState = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataAlertStateInput() { + return this._noDataAlertState; + } + + // no_data_timeframe - computed: false, optional: true, required: false + private _noDataTimeframe?: number; + public get noDataTimeframe() { + return this.getNumberAttribute('no_data_timeframe'); + } + public set noDataTimeframe(value: number) { + this._noDataTimeframe = value; + } + public resetNoDataTimeframe() { + this._noDataTimeframe = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataTimeframeInput() { + return this._noDataTimeframe; + } + + // notify_no_data - computed: true, optional: true, required: false + private _notifyNoData?: boolean | cdktf.IResolvable; + public get notifyNoData() { + return this.getBooleanAttribute('notify_no_data'); + } + public set notifyNoData(value: boolean | cdktf.IResolvable) { + this._notifyNoData = value; + } + public resetNotifyNoData() { + this._notifyNoData = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyNoDataInput() { + return this._notifyNoData; + } +} +export interface Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#recovery_timeframe Aomv4AlarmRule#recovery_timeframe} + */ + readonly recoveryTimeframe?: number; +} + +export function aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsToTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsOutputReference | Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + recovery_timeframe: cdktf.numberToTerraform(struct!.recoveryTimeframe), + } +} + + +export function aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsToHclTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsOutputReference | Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + recovery_timeframe: { + value: cdktf.numberToHclTerraform(struct!.recoveryTimeframe), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._recoveryTimeframe !== undefined) { + hasAnyValues = true; + internalValueResult.recoveryTimeframe = this._recoveryTimeframe; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._recoveryTimeframe = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._recoveryTimeframe = value.recoveryTimeframe; + } + } + + // recovery_timeframe - computed: false, optional: true, required: false + private _recoveryTimeframe?: number; + public get recoveryTimeframe() { + return this.getNumberAttribute('recovery_timeframe'); + } + public set recoveryTimeframe(value: number) { + this._recoveryTimeframe = value; + } + public resetRecoveryTimeframe() { + this._recoveryTimeframe = undefined; + } + // Temporarily expose input value. Use with caution. + public get recoveryTimeframeInput() { + return this._recoveryTimeframe; + } +} +export interface Aomv4AlarmRuleMetricAlarmSpecTriggerConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#aggregate_type Aomv4AlarmRule#aggregate_type} + */ + readonly aggregateType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#aggregation_type Aomv4AlarmRule#aggregation_type} + */ + readonly aggregationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#aggregation_window Aomv4AlarmRule#aggregation_window} + */ + readonly aggregationWindow?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#aom_monitor_level Aomv4AlarmRule#aom_monitor_level} + */ + readonly aomMonitorLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#expression Aomv4AlarmRule#expression} + */ + readonly expression?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_labels Aomv4AlarmRule#metric_labels} + */ + readonly metricLabels?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_name Aomv4AlarmRule#metric_name} + */ + readonly metricName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_namespace Aomv4AlarmRule#metric_namespace} + */ + readonly metricNamespace?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_query_mode Aomv4AlarmRule#metric_query_mode} + */ + readonly metricQueryMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_statistic_method Aomv4AlarmRule#metric_statistic_method} + */ + readonly metricStatisticMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#metric_unit Aomv4AlarmRule#metric_unit} + */ + readonly metricUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#mix_promql Aomv4AlarmRule#mix_promql} + */ + readonly mixPromql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#operator Aomv4AlarmRule#operator} + */ + readonly operator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#promql Aomv4AlarmRule#promql} + */ + readonly promql: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#promql_expr Aomv4AlarmRule#promql_expr} + */ + readonly promqlExpr?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#promql_for Aomv4AlarmRule#promql_for} + */ + readonly promqlFor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#query_match Aomv4AlarmRule#query_match} + */ + readonly queryMatch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#query_param Aomv4AlarmRule#query_param} + */ + readonly queryParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#thresholds Aomv4AlarmRule#thresholds} + */ + readonly thresholds?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#trigger_interval Aomv4AlarmRule#trigger_interval} + */ + readonly triggerInterval?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#trigger_times Aomv4AlarmRule#trigger_times} + */ + readonly triggerTimes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#trigger_type Aomv4AlarmRule#trigger_type} + */ + readonly triggerType?: string; +} + +export function aomv4AlarmRuleMetricAlarmSpecTriggerConditionsToTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aggregate_type: cdktf.stringToTerraform(struct!.aggregateType), + aggregation_type: cdktf.stringToTerraform(struct!.aggregationType), + aggregation_window: cdktf.stringToTerraform(struct!.aggregationWindow), + aom_monitor_level: cdktf.stringToTerraform(struct!.aomMonitorLevel), + expression: cdktf.stringToTerraform(struct!.expression), + metric_labels: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.metricLabels), + metric_name: cdktf.stringToTerraform(struct!.metricName), + metric_namespace: cdktf.stringToTerraform(struct!.metricNamespace), + metric_query_mode: cdktf.stringToTerraform(struct!.metricQueryMode), + metric_statistic_method: cdktf.stringToTerraform(struct!.metricStatisticMethod), + metric_unit: cdktf.stringToTerraform(struct!.metricUnit), + mix_promql: cdktf.stringToTerraform(struct!.mixPromql), + operator: cdktf.stringToTerraform(struct!.operator), + promql: cdktf.stringToTerraform(struct!.promql), + promql_expr: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.promqlExpr), + promql_for: cdktf.stringToTerraform(struct!.promqlFor), + query_match: cdktf.stringToTerraform(struct!.queryMatch), + query_param: cdktf.stringToTerraform(struct!.queryParam), + thresholds: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.thresholds), + trigger_interval: cdktf.stringToTerraform(struct!.triggerInterval), + trigger_times: cdktf.stringToTerraform(struct!.triggerTimes), + trigger_type: cdktf.stringToTerraform(struct!.triggerType), + } +} + + +export function aomv4AlarmRuleMetricAlarmSpecTriggerConditionsToHclTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecTriggerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aggregate_type: { + value: cdktf.stringToHclTerraform(struct!.aggregateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aggregation_type: { + value: cdktf.stringToHclTerraform(struct!.aggregationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aggregation_window: { + value: cdktf.stringToHclTerraform(struct!.aggregationWindow), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aom_monitor_level: { + value: cdktf.stringToHclTerraform(struct!.aomMonitorLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(struct!.expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_labels: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.metricLabels), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_namespace: { + value: cdktf.stringToHclTerraform(struct!.metricNamespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_query_mode: { + value: cdktf.stringToHclTerraform(struct!.metricQueryMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_statistic_method: { + value: cdktf.stringToHclTerraform(struct!.metricStatisticMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_unit: { + value: cdktf.stringToHclTerraform(struct!.metricUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mix_promql: { + value: cdktf.stringToHclTerraform(struct!.mixPromql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + promql: { + value: cdktf.stringToHclTerraform(struct!.promql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + promql_expr: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.promqlExpr), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + promql_for: { + value: cdktf.stringToHclTerraform(struct!.promqlFor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_match: { + value: cdktf.stringToHclTerraform(struct!.queryMatch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_param: { + value: cdktf.stringToHclTerraform(struct!.queryParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thresholds: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.thresholds), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + trigger_interval: { + value: cdktf.stringToHclTerraform(struct!.triggerInterval), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_times: { + value: cdktf.stringToHclTerraform(struct!.triggerTimes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(struct!.triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleMetricAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Aomv4AlarmRuleMetricAlarmSpecTriggerConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._aggregateType !== undefined) { + hasAnyValues = true; + internalValueResult.aggregateType = this._aggregateType; + } + if (this._aggregationType !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationType = this._aggregationType; + } + if (this._aggregationWindow !== undefined) { + hasAnyValues = true; + internalValueResult.aggregationWindow = this._aggregationWindow; + } + if (this._aomMonitorLevel !== undefined) { + hasAnyValues = true; + internalValueResult.aomMonitorLevel = this._aomMonitorLevel; + } + if (this._expression !== undefined) { + hasAnyValues = true; + internalValueResult.expression = this._expression; + } + if (this._metricLabels !== undefined) { + hasAnyValues = true; + internalValueResult.metricLabels = this._metricLabels; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._metricNamespace !== undefined) { + hasAnyValues = true; + internalValueResult.metricNamespace = this._metricNamespace; + } + if (this._metricQueryMode !== undefined) { + hasAnyValues = true; + internalValueResult.metricQueryMode = this._metricQueryMode; + } + if (this._metricStatisticMethod !== undefined) { + hasAnyValues = true; + internalValueResult.metricStatisticMethod = this._metricStatisticMethod; + } + if (this._metricUnit !== undefined) { + hasAnyValues = true; + internalValueResult.metricUnit = this._metricUnit; + } + if (this._mixPromql !== undefined) { + hasAnyValues = true; + internalValueResult.mixPromql = this._mixPromql; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._promql !== undefined) { + hasAnyValues = true; + internalValueResult.promql = this._promql; + } + if (this._promqlExpr !== undefined) { + hasAnyValues = true; + internalValueResult.promqlExpr = this._promqlExpr; + } + if (this._promqlFor !== undefined) { + hasAnyValues = true; + internalValueResult.promqlFor = this._promqlFor; + } + if (this._queryMatch !== undefined) { + hasAnyValues = true; + internalValueResult.queryMatch = this._queryMatch; + } + if (this._queryParam !== undefined) { + hasAnyValues = true; + internalValueResult.queryParam = this._queryParam; + } + if (this._thresholds !== undefined) { + hasAnyValues = true; + internalValueResult.thresholds = this._thresholds; + } + if (this._triggerInterval !== undefined) { + hasAnyValues = true; + internalValueResult.triggerInterval = this._triggerInterval; + } + if (this._triggerTimes !== undefined) { + hasAnyValues = true; + internalValueResult.triggerTimes = this._triggerTimes; + } + if (this._triggerType !== undefined) { + hasAnyValues = true; + internalValueResult.triggerType = this._triggerType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleMetricAlarmSpecTriggerConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._aggregateType = undefined; + this._aggregationType = undefined; + this._aggregationWindow = undefined; + this._aomMonitorLevel = undefined; + this._expression = undefined; + this._metricLabels = undefined; + this._metricName = undefined; + this._metricNamespace = undefined; + this._metricQueryMode = undefined; + this._metricStatisticMethod = undefined; + this._metricUnit = undefined; + this._mixPromql = undefined; + this._operator = undefined; + this._promql = undefined; + this._promqlExpr = undefined; + this._promqlFor = undefined; + this._queryMatch = undefined; + this._queryParam = undefined; + this._thresholds = undefined; + this._triggerInterval = undefined; + this._triggerTimes = undefined; + this._triggerType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._aggregateType = value.aggregateType; + this._aggregationType = value.aggregationType; + this._aggregationWindow = value.aggregationWindow; + this._aomMonitorLevel = value.aomMonitorLevel; + this._expression = value.expression; + this._metricLabels = value.metricLabels; + this._metricName = value.metricName; + this._metricNamespace = value.metricNamespace; + this._metricQueryMode = value.metricQueryMode; + this._metricStatisticMethod = value.metricStatisticMethod; + this._metricUnit = value.metricUnit; + this._mixPromql = value.mixPromql; + this._operator = value.operator; + this._promql = value.promql; + this._promqlExpr = value.promqlExpr; + this._promqlFor = value.promqlFor; + this._queryMatch = value.queryMatch; + this._queryParam = value.queryParam; + this._thresholds = value.thresholds; + this._triggerInterval = value.triggerInterval; + this._triggerTimes = value.triggerTimes; + this._triggerType = value.triggerType; + } + } + + // aggregate_type - computed: false, optional: true, required: false + private _aggregateType?: string; + public get aggregateType() { + return this.getStringAttribute('aggregate_type'); + } + public set aggregateType(value: string) { + this._aggregateType = value; + } + public resetAggregateType() { + this._aggregateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregateTypeInput() { + return this._aggregateType; + } + + // aggregation_type - computed: false, optional: true, required: false + private _aggregationType?: string; + public get aggregationType() { + return this.getStringAttribute('aggregation_type'); + } + public set aggregationType(value: string) { + this._aggregationType = value; + } + public resetAggregationType() { + this._aggregationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationTypeInput() { + return this._aggregationType; + } + + // aggregation_window - computed: false, optional: true, required: false + private _aggregationWindow?: string; + public get aggregationWindow() { + return this.getStringAttribute('aggregation_window'); + } + public set aggregationWindow(value: string) { + this._aggregationWindow = value; + } + public resetAggregationWindow() { + this._aggregationWindow = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregationWindowInput() { + return this._aggregationWindow; + } + + // aom_monitor_level - computed: false, optional: true, required: false + private _aomMonitorLevel?: string; + public get aomMonitorLevel() { + return this.getStringAttribute('aom_monitor_level'); + } + public set aomMonitorLevel(value: string) { + this._aomMonitorLevel = value; + } + public resetAomMonitorLevel() { + this._aomMonitorLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get aomMonitorLevelInput() { + return this._aomMonitorLevel; + } + + // expression - computed: false, optional: true, required: false + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + public resetExpression() { + this._expression = undefined; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // metric_labels - computed: false, optional: true, required: false + private _metricLabels?: string[]; + public get metricLabels() { + return cdktf.Fn.tolist(this.getListAttribute('metric_labels')); + } + public set metricLabels(value: string[]) { + this._metricLabels = value; + } + public resetMetricLabels() { + this._metricLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricLabelsInput() { + return this._metricLabels; + } + + // metric_name - computed: false, optional: false, required: true + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // metric_namespace - computed: false, optional: true, required: false + private _metricNamespace?: string; + public get metricNamespace() { + return this.getStringAttribute('metric_namespace'); + } + public set metricNamespace(value: string) { + this._metricNamespace = value; + } + public resetMetricNamespace() { + this._metricNamespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNamespaceInput() { + return this._metricNamespace; + } + + // metric_query_mode - computed: false, optional: false, required: true + private _metricQueryMode?: string; + public get metricQueryMode() { + return this.getStringAttribute('metric_query_mode'); + } + public set metricQueryMode(value: string) { + this._metricQueryMode = value; + } + // Temporarily expose input value. Use with caution. + public get metricQueryModeInput() { + return this._metricQueryMode; + } + + // metric_statistic_method - computed: false, optional: true, required: false + private _metricStatisticMethod?: string; + public get metricStatisticMethod() { + return this.getStringAttribute('metric_statistic_method'); + } + public set metricStatisticMethod(value: string) { + this._metricStatisticMethod = value; + } + public resetMetricStatisticMethod() { + this._metricStatisticMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricStatisticMethodInput() { + return this._metricStatisticMethod; + } + + // metric_unit - computed: false, optional: true, required: false + private _metricUnit?: string; + public get metricUnit() { + return this.getStringAttribute('metric_unit'); + } + public set metricUnit(value: string) { + this._metricUnit = value; + } + public resetMetricUnit() { + this._metricUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricUnitInput() { + return this._metricUnit; + } + + // mix_promql - computed: false, optional: true, required: false + private _mixPromql?: string; + public get mixPromql() { + return this.getStringAttribute('mix_promql'); + } + public set mixPromql(value: string) { + this._mixPromql = value; + } + public resetMixPromql() { + this._mixPromql = undefined; + } + // Temporarily expose input value. Use with caution. + public get mixPromqlInput() { + return this._mixPromql; + } + + // operator - computed: false, optional: true, required: false + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + public resetOperator() { + this._operator = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // promql - computed: false, optional: false, required: true + private _promql?: string; + public get promql() { + return this.getStringAttribute('promql'); + } + public set promql(value: string) { + this._promql = value; + } + // Temporarily expose input value. Use with caution. + public get promqlInput() { + return this._promql; + } + + // promql_expr - computed: false, optional: true, required: false + private _promqlExpr?: string[]; + public get promqlExpr() { + return cdktf.Fn.tolist(this.getListAttribute('promql_expr')); + } + public set promqlExpr(value: string[]) { + this._promqlExpr = value; + } + public resetPromqlExpr() { + this._promqlExpr = undefined; + } + // Temporarily expose input value. Use with caution. + public get promqlExprInput() { + return this._promqlExpr; + } + + // promql_for - computed: true, optional: true, required: false + private _promqlFor?: string; + public get promqlFor() { + return this.getStringAttribute('promql_for'); + } + public set promqlFor(value: string) { + this._promqlFor = value; + } + public resetPromqlFor() { + this._promqlFor = undefined; + } + // Temporarily expose input value. Use with caution. + public get promqlForInput() { + return this._promqlFor; + } + + // query_match - computed: false, optional: true, required: false + private _queryMatch?: string; + public get queryMatch() { + return this.getStringAttribute('query_match'); + } + public set queryMatch(value: string) { + this._queryMatch = value; + } + public resetQueryMatch() { + this._queryMatch = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryMatchInput() { + return this._queryMatch; + } + + // query_param - computed: false, optional: true, required: false + private _queryParam?: string; + public get queryParam() { + return this.getStringAttribute('query_param'); + } + public set queryParam(value: string) { + this._queryParam = value; + } + public resetQueryParam() { + this._queryParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryParamInput() { + return this._queryParam; + } + + // thresholds - computed: false, optional: true, required: false + private _thresholds?: { [key: string]: string }; + public get thresholds() { + return this.getStringMapAttribute('thresholds'); + } + public set thresholds(value: { [key: string]: string }) { + this._thresholds = value; + } + public resetThresholds() { + this._thresholds = undefined; + } + // Temporarily expose input value. Use with caution. + public get thresholdsInput() { + return this._thresholds; + } + + // trigger_interval - computed: false, optional: true, required: false + private _triggerInterval?: string; + public get triggerInterval() { + return this.getStringAttribute('trigger_interval'); + } + public set triggerInterval(value: string) { + this._triggerInterval = value; + } + public resetTriggerInterval() { + this._triggerInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerIntervalInput() { + return this._triggerInterval; + } + + // trigger_times - computed: false, optional: true, required: false + private _triggerTimes?: string; + public get triggerTimes() { + return this.getStringAttribute('trigger_times'); + } + public set triggerTimes(value: string) { + this._triggerTimes = value; + } + public resetTriggerTimes() { + this._triggerTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTimesInput() { + return this._triggerTimes; + } + + // trigger_type - computed: false, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } +} + +export class Aomv4AlarmRuleMetricAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + public internalValue? : Aomv4AlarmRuleMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Aomv4AlarmRuleMetricAlarmSpecTriggerConditionsOutputReference { + return new Aomv4AlarmRuleMetricAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Aomv4AlarmRuleMetricAlarmSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#monitor_objects Aomv4AlarmRule#monitor_objects} + */ + readonly monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#monitor_type Aomv4AlarmRule#monitor_type} + */ + readonly monitorType: string; + /** + * alarm_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#alarm_tags Aomv4AlarmRule#alarm_tags} + */ + readonly alarmTags?: Aomv4AlarmRuleMetricAlarmSpecAlarmTags; + /** + * no_data_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#no_data_conditions Aomv4AlarmRule#no_data_conditions} + */ + readonly noDataConditions?: Aomv4AlarmRuleMetricAlarmSpecNoDataConditions; + /** + * recovery_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#recovery_conditions Aomv4AlarmRule#recovery_conditions} + */ + readonly recoveryConditions: Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions; + /** + * trigger_conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#trigger_conditions Aomv4AlarmRule#trigger_conditions} + */ + readonly triggerConditions?: Aomv4AlarmRuleMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable; +} + +export function aomv4AlarmRuleMetricAlarmSpecToTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecOutputReference | Aomv4AlarmRuleMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + monitor_objects: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(struct!.monitorObjects), + monitor_type: cdktf.stringToTerraform(struct!.monitorType), + alarm_tags: aomv4AlarmRuleMetricAlarmSpecAlarmTagsToTerraform(struct!.alarmTags), + no_data_conditions: aomv4AlarmRuleMetricAlarmSpecNoDataConditionsToTerraform(struct!.noDataConditions), + recovery_conditions: aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsToTerraform(struct!.recoveryConditions), + trigger_conditions: cdktf.listMapper(aomv4AlarmRuleMetricAlarmSpecTriggerConditionsToTerraform, true)(struct!.triggerConditions), + } +} + + +export function aomv4AlarmRuleMetricAlarmSpecToHclTerraform(struct?: Aomv4AlarmRuleMetricAlarmSpecOutputReference | Aomv4AlarmRuleMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + monitor_objects: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(struct!.monitorObjects), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + monitor_type: { + value: cdktf.stringToHclTerraform(struct!.monitorType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_tags: { + value: aomv4AlarmRuleMetricAlarmSpecAlarmTagsToHclTerraform(struct!.alarmTags), + isBlock: true, + type: "list", + storageClassType: "Aomv4AlarmRuleMetricAlarmSpecAlarmTagsList", + }, + no_data_conditions: { + value: aomv4AlarmRuleMetricAlarmSpecNoDataConditionsToHclTerraform(struct!.noDataConditions), + isBlock: true, + type: "list", + storageClassType: "Aomv4AlarmRuleMetricAlarmSpecNoDataConditionsList", + }, + recovery_conditions: { + value: aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsToHclTerraform(struct!.recoveryConditions), + isBlock: true, + type: "list", + storageClassType: "Aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsList", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(aomv4AlarmRuleMetricAlarmSpecTriggerConditionsToHclTerraform, true)(struct!.triggerConditions), + isBlock: true, + type: "set", + storageClassType: "Aomv4AlarmRuleMetricAlarmSpecTriggerConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Aomv4AlarmRuleMetricAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Aomv4AlarmRuleMetricAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._monitorObjects !== undefined) { + hasAnyValues = true; + internalValueResult.monitorObjects = this._monitorObjects; + } + if (this._monitorType !== undefined) { + hasAnyValues = true; + internalValueResult.monitorType = this._monitorType; + } + if (this._alarmTags?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.alarmTags = this._alarmTags?.internalValue; + } + if (this._noDataConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.noDataConditions = this._noDataConditions?.internalValue; + } + if (this._recoveryConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.recoveryConditions = this._recoveryConditions?.internalValue; + } + if (this._triggerConditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Aomv4AlarmRuleMetricAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._monitorObjects = undefined; + this._monitorType = undefined; + this._alarmTags.internalValue = undefined; + this._noDataConditions.internalValue = undefined; + this._recoveryConditions.internalValue = undefined; + this._triggerConditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._monitorObjects = value.monitorObjects; + this._monitorType = value.monitorType; + this._alarmTags.internalValue = value.alarmTags; + this._noDataConditions.internalValue = value.noDataConditions; + this._recoveryConditions.internalValue = value.recoveryConditions; + this._triggerConditions.internalValue = value.triggerConditions; + } + } + + // monitor_objects - computed: false, optional: true, required: false + private _monitorObjects?: { [key: string]: string }[] | cdktf.IResolvable; + public get monitorObjects() { + return this.interpolationForAttribute('monitor_objects'); + } + public set monitorObjects(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._monitorObjects = value; + } + public resetMonitorObjects() { + this._monitorObjects = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorObjectsInput() { + return this._monitorObjects; + } + + // monitor_type - computed: false, optional: false, required: true + private _monitorType?: string; + public get monitorType() { + return this.getStringAttribute('monitor_type'); + } + public set monitorType(value: string) { + this._monitorType = value; + } + // Temporarily expose input value. Use with caution. + public get monitorTypeInput() { + return this._monitorType; + } + + // alarm_tags - computed: false, optional: true, required: false + private _alarmTags = new Aomv4AlarmRuleMetricAlarmSpecAlarmTagsOutputReference(this, "alarm_tags"); + public get alarmTags() { + return this._alarmTags; + } + public putAlarmTags(value: Aomv4AlarmRuleMetricAlarmSpecAlarmTags) { + this._alarmTags.internalValue = value; + } + public resetAlarmTags() { + this._alarmTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmTagsInput() { + return this._alarmTags.internalValue; + } + + // no_data_conditions - computed: false, optional: true, required: false + private _noDataConditions = new Aomv4AlarmRuleMetricAlarmSpecNoDataConditionsOutputReference(this, "no_data_conditions"); + public get noDataConditions() { + return this._noDataConditions; + } + public putNoDataConditions(value: Aomv4AlarmRuleMetricAlarmSpecNoDataConditions) { + this._noDataConditions.internalValue = value; + } + public resetNoDataConditions() { + this._noDataConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get noDataConditionsInput() { + return this._noDataConditions.internalValue; + } + + // recovery_conditions - computed: false, optional: false, required: true + private _recoveryConditions = new Aomv4AlarmRuleMetricAlarmSpecRecoveryConditionsOutputReference(this, "recovery_conditions"); + public get recoveryConditions() { + return this._recoveryConditions; + } + public putRecoveryConditions(value: Aomv4AlarmRuleMetricAlarmSpecRecoveryConditions) { + this._recoveryConditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get recoveryConditionsInput() { + return this._recoveryConditions.internalValue; + } + + // trigger_conditions - computed: false, optional: true, required: false + private _triggerConditions = new Aomv4AlarmRuleMetricAlarmSpecTriggerConditionsList(this, "trigger_conditions", true); + public get triggerConditions() { + return this._triggerConditions; + } + public putTriggerConditions(value: Aomv4AlarmRuleMetricAlarmSpecTriggerConditions[] | cdktf.IResolvable) { + this._triggerConditions.internalValue = value; + } + public resetTriggerConditions() { + this._triggerConditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule huaweicloud_aomv4_alarm_rule} +*/ +export class Aomv4AlarmRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aomv4_alarm_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a Aomv4AlarmRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the Aomv4AlarmRule to import + * @param importFromId The id of the existing Aomv4AlarmRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the Aomv4AlarmRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aomv4_alarm_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/aomv4_alarm_rule huaweicloud_aomv4_alarm_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options Aomv4AlarmRuleConfig + */ + public constructor(scope: Construct, id: string, config: Aomv4AlarmRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aomv4_alarm_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enable = config.enable; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._promInstanceId = config.promInstanceId; + this._region = config.region; + this._type = config.type; + this._alarmNotifications.internalValue = config.alarmNotifications; + this._eventAlarmSpec.internalValue = config.eventAlarmSpec; + this._metricAlarmSpec.internalValue = config.metricAlarmSpec; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_rule_id - computed: true, optional: false, required: false + public get alarmRuleId() { + return this.getStringAttribute('alarm_rule_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable - computed: true, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // prom_instance_id - computed: false, optional: true, required: false + private _promInstanceId?: string; + public get promInstanceId() { + return this.getStringAttribute('prom_instance_id'); + } + public set promInstanceId(value: string) { + this._promInstanceId = value; + } + public resetPromInstanceId() { + this._promInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get promInstanceIdInput() { + return this._promInstanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // alarm_notifications - computed: false, optional: false, required: true + private _alarmNotifications = new Aomv4AlarmRuleAlarmNotificationsOutputReference(this, "alarm_notifications"); + public get alarmNotifications() { + return this._alarmNotifications; + } + public putAlarmNotifications(value: Aomv4AlarmRuleAlarmNotifications) { + this._alarmNotifications.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get alarmNotificationsInput() { + return this._alarmNotifications.internalValue; + } + + // event_alarm_spec - computed: false, optional: true, required: false + private _eventAlarmSpec = new Aomv4AlarmRuleEventAlarmSpecOutputReference(this, "event_alarm_spec"); + public get eventAlarmSpec() { + return this._eventAlarmSpec; + } + public putEventAlarmSpec(value: Aomv4AlarmRuleEventAlarmSpec) { + this._eventAlarmSpec.internalValue = value; + } + public resetEventAlarmSpec() { + this._eventAlarmSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventAlarmSpecInput() { + return this._eventAlarmSpec.internalValue; + } + + // metric_alarm_spec - computed: false, optional: true, required: false + private _metricAlarmSpec = new Aomv4AlarmRuleMetricAlarmSpecOutputReference(this, "metric_alarm_spec"); + public get metricAlarmSpec() { + return this._metricAlarmSpec; + } + public putMetricAlarmSpec(value: Aomv4AlarmRuleMetricAlarmSpec) { + this._metricAlarmSpec.internalValue = value; + } + public resetMetricAlarmSpec() { + this._metricAlarmSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricAlarmSpecInput() { + return this._metricAlarmSpec.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable: cdktf.booleanToTerraform(this._enable), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + prom_instance_id: cdktf.stringToTerraform(this._promInstanceId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + alarm_notifications: aomv4AlarmRuleAlarmNotificationsToTerraform(this._alarmNotifications.internalValue), + event_alarm_spec: aomv4AlarmRuleEventAlarmSpecToTerraform(this._eventAlarmSpec.internalValue), + metric_alarm_spec: aomv4AlarmRuleMetricAlarmSpecToTerraform(this._metricAlarmSpec.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.booleanToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_instance_id: { + value: cdktf.stringToHclTerraform(this._promInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_notifications: { + value: aomv4AlarmRuleAlarmNotificationsToHclTerraform(this._alarmNotifications.internalValue), + isBlock: true, + type: "list", + storageClassType: "Aomv4AlarmRuleAlarmNotificationsList", + }, + event_alarm_spec: { + value: aomv4AlarmRuleEventAlarmSpecToHclTerraform(this._eventAlarmSpec.internalValue), + isBlock: true, + type: "list", + storageClassType: "Aomv4AlarmRuleEventAlarmSpecList", + }, + metric_alarm_spec: { + value: aomv4AlarmRuleMetricAlarmSpecToHclTerraform(this._metricAlarmSpec.internalValue), + isBlock: true, + type: "list", + storageClassType: "Aomv4AlarmRuleMetricAlarmSpecList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/api-gateway-api/README.md b/src/constructs/providers/huaweicloud/api-gateway-api/README.md new file mode 100644 index 00000000..ad31a98d --- /dev/null +++ b/src/constructs/providers/huaweicloud/api-gateway-api/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_api_gateway_api` + +Refer to the Terraform Registry for docs: [`huaweicloud_api_gateway_api`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api). diff --git a/src/constructs/providers/huaweicloud/api-gateway-api/index.ts b/src/constructs/providers/huaweicloud/api-gateway-api/index.ts new file mode 100644 index 00000000..5c68909b --- /dev/null +++ b/src/constructs/providers/huaweicloud/api-gateway-api/index.ts @@ -0,0 +1,1899 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApiGatewayApiConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#auth_type ApiGatewayApi#auth_type} + */ + readonly authType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#backend_type ApiGatewayApi#backend_type} + */ + readonly backendType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#cors ApiGatewayApi#cors} + */ + readonly cors?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#description ApiGatewayApi#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#example_failure_response ApiGatewayApi#example_failure_response} + */ + readonly exampleFailureResponse?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#example_success_response ApiGatewayApi#example_success_response} + */ + readonly exampleSuccessResponse: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#group_id ApiGatewayApi#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#id ApiGatewayApi#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#name ApiGatewayApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#region ApiGatewayApi#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#request_method ApiGatewayApi#request_method} + */ + readonly requestMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#request_protocol ApiGatewayApi#request_protocol} + */ + readonly requestProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#request_uri ApiGatewayApi#request_uri} + */ + readonly requestUri: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#tags ApiGatewayApi#tags} + */ + readonly tags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#version ApiGatewayApi#version} + */ + readonly version?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#visibility ApiGatewayApi#visibility} + */ + readonly visibility?: number; + /** + * backend_parameter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#backend_parameter ApiGatewayApi#backend_parameter} + */ + readonly backendParameter?: ApiGatewayApiBackendParameter[] | cdktf.IResolvable; + /** + * function_backend block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#function_backend ApiGatewayApi#function_backend} + */ + readonly functionBackend?: ApiGatewayApiFunctionBackend; + /** + * http_backend block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#http_backend ApiGatewayApi#http_backend} + */ + readonly httpBackend?: ApiGatewayApiHttpBackend; + /** + * mock_backend block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#mock_backend ApiGatewayApi#mock_backend} + */ + readonly mockBackend?: ApiGatewayApiMockBackend; + /** + * request_parameter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#request_parameter ApiGatewayApi#request_parameter} + */ + readonly requestParameter?: ApiGatewayApiRequestParameter[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#timeouts ApiGatewayApi#timeouts} + */ + readonly timeouts?: ApiGatewayApiTimeouts; +} +export interface ApiGatewayApiBackendParameter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#description ApiGatewayApi#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#location ApiGatewayApi#location} + */ + readonly location: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#name ApiGatewayApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#type ApiGatewayApi#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#value ApiGatewayApi#value} + */ + readonly value: string; +} + +export function apiGatewayApiBackendParameterToTerraform(struct?: ApiGatewayApiBackendParameter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apiGatewayApiBackendParameterToHclTerraform(struct?: ApiGatewayApiBackendParameter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayApiBackendParameterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApiGatewayApiBackendParameter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayApiBackendParameter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._location = undefined; + this._name = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._location = value.location; + this._name = value.name; + this._type = value.type; + this._value = value.value; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApiGatewayApiBackendParameterList extends cdktf.ComplexList { + public internalValue? : ApiGatewayApiBackendParameter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApiGatewayApiBackendParameterOutputReference { + return new ApiGatewayApiBackendParameterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApiGatewayApiFunctionBackend { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#function_urn ApiGatewayApi#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#invocation_type ApiGatewayApi#invocation_type} + */ + readonly invocationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#timeout ApiGatewayApi#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#version ApiGatewayApi#version} + */ + readonly version: string; +} + +export function apiGatewayApiFunctionBackendToTerraform(struct?: ApiGatewayApiFunctionBackendOutputReference | ApiGatewayApiFunctionBackend): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + function_urn: cdktf.stringToTerraform(struct!.functionUrn), + invocation_type: cdktf.stringToTerraform(struct!.invocationType), + timeout: cdktf.numberToTerraform(struct!.timeout), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function apiGatewayApiFunctionBackendToHclTerraform(struct?: ApiGatewayApiFunctionBackendOutputReference | ApiGatewayApiFunctionBackend): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + function_urn: { + value: cdktf.stringToHclTerraform(struct!.functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invocation_type: { + value: cdktf.stringToHclTerraform(struct!.invocationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayApiFunctionBackendOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApiGatewayApiFunctionBackend | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._functionUrn !== undefined) { + hasAnyValues = true; + internalValueResult.functionUrn = this._functionUrn; + } + if (this._invocationType !== undefined) { + hasAnyValues = true; + internalValueResult.invocationType = this._invocationType; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayApiFunctionBackend | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._functionUrn = undefined; + this._invocationType = undefined; + this._timeout = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._functionUrn = value.functionUrn; + this._invocationType = value.invocationType; + this._timeout = value.timeout; + this._version = value.version; + } + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // invocation_type - computed: false, optional: false, required: true + private _invocationType?: string; + public get invocationType() { + return this.getStringAttribute('invocation_type'); + } + public set invocationType(value: string) { + this._invocationType = value; + } + // Temporarily expose input value. Use with caution. + public get invocationTypeInput() { + return this._invocationType; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface ApiGatewayApiHttpBackend { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#method ApiGatewayApi#method} + */ + readonly method: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#protocol ApiGatewayApi#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#timeout ApiGatewayApi#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#uri ApiGatewayApi#uri} + */ + readonly uri: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#url_domain ApiGatewayApi#url_domain} + */ + readonly urlDomain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#vpc_channel ApiGatewayApi#vpc_channel} + */ + readonly vpcChannel?: string; +} + +export function apiGatewayApiHttpBackendToTerraform(struct?: ApiGatewayApiHttpBackendOutputReference | ApiGatewayApiHttpBackend): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + method: cdktf.stringToTerraform(struct!.method), + protocol: cdktf.stringToTerraform(struct!.protocol), + timeout: cdktf.numberToTerraform(struct!.timeout), + uri: cdktf.stringToTerraform(struct!.uri), + url_domain: cdktf.stringToTerraform(struct!.urlDomain), + vpc_channel: cdktf.stringToTerraform(struct!.vpcChannel), + } +} + + +export function apiGatewayApiHttpBackendToHclTerraform(struct?: ApiGatewayApiHttpBackendOutputReference | ApiGatewayApiHttpBackend): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + method: { + value: cdktf.stringToHclTerraform(struct!.method), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + uri: { + value: cdktf.stringToHclTerraform(struct!.uri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_domain: { + value: cdktf.stringToHclTerraform(struct!.urlDomain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_channel: { + value: cdktf.stringToHclTerraform(struct!.vpcChannel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayApiHttpBackendOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApiGatewayApiHttpBackend | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._method !== undefined) { + hasAnyValues = true; + internalValueResult.method = this._method; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._uri !== undefined) { + hasAnyValues = true; + internalValueResult.uri = this._uri; + } + if (this._urlDomain !== undefined) { + hasAnyValues = true; + internalValueResult.urlDomain = this._urlDomain; + } + if (this._vpcChannel !== undefined) { + hasAnyValues = true; + internalValueResult.vpcChannel = this._vpcChannel; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayApiHttpBackend | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._method = undefined; + this._protocol = undefined; + this._timeout = undefined; + this._uri = undefined; + this._urlDomain = undefined; + this._vpcChannel = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._method = value.method; + this._protocol = value.protocol; + this._timeout = value.timeout; + this._uri = value.uri; + this._urlDomain = value.urlDomain; + this._vpcChannel = value.vpcChannel; + } + } + + // method - computed: false, optional: false, required: true + private _method?: string; + public get method() { + return this.getStringAttribute('method'); + } + public set method(value: string) { + this._method = value; + } + // Temporarily expose input value. Use with caution. + public get methodInput() { + return this._method; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // uri - computed: false, optional: false, required: true + private _uri?: string; + public get uri() { + return this.getStringAttribute('uri'); + } + public set uri(value: string) { + this._uri = value; + } + // Temporarily expose input value. Use with caution. + public get uriInput() { + return this._uri; + } + + // url_domain - computed: false, optional: true, required: false + private _urlDomain?: string; + public get urlDomain() { + return this.getStringAttribute('url_domain'); + } + public set urlDomain(value: string) { + this._urlDomain = value; + } + public resetUrlDomain() { + this._urlDomain = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlDomainInput() { + return this._urlDomain; + } + + // vpc_channel - computed: false, optional: true, required: false + private _vpcChannel?: string; + public get vpcChannel() { + return this.getStringAttribute('vpc_channel'); + } + public set vpcChannel(value: string) { + this._vpcChannel = value; + } + public resetVpcChannel() { + this._vpcChannel = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcChannelInput() { + return this._vpcChannel; + } +} +export interface ApiGatewayApiMockBackend { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#description ApiGatewayApi#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#result_content ApiGatewayApi#result_content} + */ + readonly resultContent?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#version ApiGatewayApi#version} + */ + readonly version?: string; +} + +export function apiGatewayApiMockBackendToTerraform(struct?: ApiGatewayApiMockBackendOutputReference | ApiGatewayApiMockBackend): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + result_content: cdktf.stringToTerraform(struct!.resultContent), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function apiGatewayApiMockBackendToHclTerraform(struct?: ApiGatewayApiMockBackendOutputReference | ApiGatewayApiMockBackend): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + result_content: { + value: cdktf.stringToHclTerraform(struct!.resultContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayApiMockBackendOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApiGatewayApiMockBackend | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._resultContent !== undefined) { + hasAnyValues = true; + internalValueResult.resultContent = this._resultContent; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayApiMockBackend | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._resultContent = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._resultContent = value.resultContent; + this._version = value.version; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // result_content - computed: false, optional: true, required: false + private _resultContent?: string; + public get resultContent() { + return this.getStringAttribute('result_content'); + } + public set resultContent(value: string) { + this._resultContent = value; + } + public resetResultContent() { + this._resultContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get resultContentInput() { + return this._resultContent; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface ApiGatewayApiRequestParameter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#default ApiGatewayApi#default} + */ + readonly default?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#description ApiGatewayApi#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#location ApiGatewayApi#location} + */ + readonly location: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#name ApiGatewayApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#required ApiGatewayApi#required} + */ + readonly required: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#type ApiGatewayApi#type} + */ + readonly type: string; +} + +export function apiGatewayApiRequestParameterToTerraform(struct?: ApiGatewayApiRequestParameter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default: cdktf.stringToTerraform(struct!.default), + description: cdktf.stringToTerraform(struct!.description), + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + required: cdktf.booleanToTerraform(struct!.required), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function apiGatewayApiRequestParameterToHclTerraform(struct?: ApiGatewayApiRequestParameter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default: { + value: cdktf.stringToHclTerraform(struct!.default), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayApiRequestParameterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApiGatewayApiRequestParameter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._default !== undefined) { + hasAnyValues = true; + internalValueResult.default = this._default; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayApiRequestParameter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._default = undefined; + this._description = undefined; + this._location = undefined; + this._name = undefined; + this._required = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._default = value.default; + this._description = value.description; + this._location = value.location; + this._name = value.name; + this._required = value.required; + this._type = value.type; + } + } + + // default - computed: false, optional: true, required: false + private _default?: string; + public get default() { + return this.getStringAttribute('default'); + } + public set default(value: string) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // required - computed: false, optional: false, required: true + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ApiGatewayApiRequestParameterList extends cdktf.ComplexList { + public internalValue? : ApiGatewayApiRequestParameter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApiGatewayApiRequestParameterOutputReference { + return new ApiGatewayApiRequestParameterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApiGatewayApiTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#create ApiGatewayApi#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#delete ApiGatewayApi#delete} + */ + readonly delete?: string; +} + +export function apiGatewayApiTimeoutsToTerraform(struct?: ApiGatewayApiTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function apiGatewayApiTimeoutsToHclTerraform(struct?: ApiGatewayApiTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayApiTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApiGatewayApiTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayApiTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api huaweicloud_api_gateway_api} +*/ +export class ApiGatewayApi extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_api_gateway_api"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApiGatewayApi resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApiGatewayApi to import + * @param importFromId The id of the existing ApiGatewayApi that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApiGatewayApi to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_api_gateway_api", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_api huaweicloud_api_gateway_api} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApiGatewayApiConfig + */ + public constructor(scope: Construct, id: string, config: ApiGatewayApiConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_api_gateway_api', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authType = config.authType; + this._backendType = config.backendType; + this._cors = config.cors; + this._description = config.description; + this._exampleFailureResponse = config.exampleFailureResponse; + this._exampleSuccessResponse = config.exampleSuccessResponse; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._requestMethod = config.requestMethod; + this._requestProtocol = config.requestProtocol; + this._requestUri = config.requestUri; + this._tags = config.tags; + this._version = config.version; + this._visibility = config.visibility; + this._backendParameter.internalValue = config.backendParameter; + this._functionBackend.internalValue = config.functionBackend; + this._httpBackend.internalValue = config.httpBackend; + this._mockBackend.internalValue = config.mockBackend; + this._requestParameter.internalValue = config.requestParameter; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_type - computed: false, optional: false, required: true + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // backend_type - computed: false, optional: false, required: true + private _backendType?: string; + public get backendType() { + return this.getStringAttribute('backend_type'); + } + public set backendType(value: string) { + this._backendType = value; + } + // Temporarily expose input value. Use with caution. + public get backendTypeInput() { + return this._backendType; + } + + // cors - computed: false, optional: true, required: false + private _cors?: boolean | cdktf.IResolvable; + public get cors() { + return this.getBooleanAttribute('cors'); + } + public set cors(value: boolean | cdktf.IResolvable) { + this._cors = value; + } + public resetCors() { + this._cors = undefined; + } + // Temporarily expose input value. Use with caution. + public get corsInput() { + return this._cors; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // example_failure_response - computed: false, optional: true, required: false + private _exampleFailureResponse?: string; + public get exampleFailureResponse() { + return this.getStringAttribute('example_failure_response'); + } + public set exampleFailureResponse(value: string) { + this._exampleFailureResponse = value; + } + public resetExampleFailureResponse() { + this._exampleFailureResponse = undefined; + } + // Temporarily expose input value. Use with caution. + public get exampleFailureResponseInput() { + return this._exampleFailureResponse; + } + + // example_success_response - computed: false, optional: false, required: true + private _exampleSuccessResponse?: string; + public get exampleSuccessResponse() { + return this.getStringAttribute('example_success_response'); + } + public set exampleSuccessResponse(value: string) { + this._exampleSuccessResponse = value; + } + // Temporarily expose input value. Use with caution. + public get exampleSuccessResponseInput() { + return this._exampleSuccessResponse; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_method - computed: false, optional: false, required: true + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // request_uri - computed: false, optional: false, required: true + private _requestUri?: string; + public get requestUri() { + return this.getStringAttribute('request_uri'); + } + public set requestUri(value: string) { + this._requestUri = value; + } + // Temporarily expose input value. Use with caution. + public get requestUriInput() { + return this._requestUri; + } + + // tags - computed: false, optional: true, required: false + private _tags?: string[]; + public get tags() { + return cdktf.Fn.tolist(this.getListAttribute('tags')); + } + public set tags(value: string[]) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // visibility - computed: false, optional: true, required: false + private _visibility?: number; + public get visibility() { + return this.getNumberAttribute('visibility'); + } + public set visibility(value: number) { + this._visibility = value; + } + public resetVisibility() { + this._visibility = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityInput() { + return this._visibility; + } + + // backend_parameter - computed: false, optional: true, required: false + private _backendParameter = new ApiGatewayApiBackendParameterList(this, "backend_parameter", false); + public get backendParameter() { + return this._backendParameter; + } + public putBackendParameter(value: ApiGatewayApiBackendParameter[] | cdktf.IResolvable) { + this._backendParameter.internalValue = value; + } + public resetBackendParameter() { + this._backendParameter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParameterInput() { + return this._backendParameter.internalValue; + } + + // function_backend - computed: false, optional: true, required: false + private _functionBackend = new ApiGatewayApiFunctionBackendOutputReference(this, "function_backend"); + public get functionBackend() { + return this._functionBackend; + } + public putFunctionBackend(value: ApiGatewayApiFunctionBackend) { + this._functionBackend.internalValue = value; + } + public resetFunctionBackend() { + this._functionBackend.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get functionBackendInput() { + return this._functionBackend.internalValue; + } + + // http_backend - computed: false, optional: true, required: false + private _httpBackend = new ApiGatewayApiHttpBackendOutputReference(this, "http_backend"); + public get httpBackend() { + return this._httpBackend; + } + public putHttpBackend(value: ApiGatewayApiHttpBackend) { + this._httpBackend.internalValue = value; + } + public resetHttpBackend() { + this._httpBackend.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpBackendInput() { + return this._httpBackend.internalValue; + } + + // mock_backend - computed: false, optional: true, required: false + private _mockBackend = new ApiGatewayApiMockBackendOutputReference(this, "mock_backend"); + public get mockBackend() { + return this._mockBackend; + } + public putMockBackend(value: ApiGatewayApiMockBackend) { + this._mockBackend.internalValue = value; + } + public resetMockBackend() { + this._mockBackend.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mockBackendInput() { + return this._mockBackend.internalValue; + } + + // request_parameter - computed: false, optional: true, required: false + private _requestParameter = new ApiGatewayApiRequestParameterList(this, "request_parameter", false); + public get requestParameter() { + return this._requestParameter; + } + public putRequestParameter(value: ApiGatewayApiRequestParameter[] | cdktf.IResolvable) { + this._requestParameter.internalValue = value; + } + public resetRequestParameter() { + this._requestParameter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestParameterInput() { + return this._requestParameter.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApiGatewayApiTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApiGatewayApiTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_type: cdktf.stringToTerraform(this._authType), + backend_type: cdktf.stringToTerraform(this._backendType), + cors: cdktf.booleanToTerraform(this._cors), + description: cdktf.stringToTerraform(this._description), + example_failure_response: cdktf.stringToTerraform(this._exampleFailureResponse), + example_success_response: cdktf.stringToTerraform(this._exampleSuccessResponse), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + request_method: cdktf.stringToTerraform(this._requestMethod), + request_protocol: cdktf.stringToTerraform(this._requestProtocol), + request_uri: cdktf.stringToTerraform(this._requestUri), + tags: cdktf.listMapper(cdktf.stringToTerraform, false)(this._tags), + version: cdktf.stringToTerraform(this._version), + visibility: cdktf.numberToTerraform(this._visibility), + backend_parameter: cdktf.listMapper(apiGatewayApiBackendParameterToTerraform, true)(this._backendParameter.internalValue), + function_backend: apiGatewayApiFunctionBackendToTerraform(this._functionBackend.internalValue), + http_backend: apiGatewayApiHttpBackendToTerraform(this._httpBackend.internalValue), + mock_backend: apiGatewayApiMockBackendToTerraform(this._mockBackend.internalValue), + request_parameter: cdktf.listMapper(apiGatewayApiRequestParameterToTerraform, true)(this._requestParameter.internalValue), + timeouts: apiGatewayApiTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_type: { + value: cdktf.stringToHclTerraform(this._backendType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cors: { + value: cdktf.booleanToHclTerraform(this._cors), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + example_failure_response: { + value: cdktf.stringToHclTerraform(this._exampleFailureResponse), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + example_success_response: { + value: cdktf.stringToHclTerraform(this._exampleSuccessResponse), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(this._requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(this._requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_uri: { + value: cdktf.stringToHclTerraform(this._requestUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._tags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility: { + value: cdktf.numberToHclTerraform(this._visibility), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + backend_parameter: { + value: cdktf.listMapperHcl(apiGatewayApiBackendParameterToHclTerraform, true)(this._backendParameter.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApiGatewayApiBackendParameterList", + }, + function_backend: { + value: apiGatewayApiFunctionBackendToHclTerraform(this._functionBackend.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApiGatewayApiFunctionBackendList", + }, + http_backend: { + value: apiGatewayApiHttpBackendToHclTerraform(this._httpBackend.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApiGatewayApiHttpBackendList", + }, + mock_backend: { + value: apiGatewayApiMockBackendToHclTerraform(this._mockBackend.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApiGatewayApiMockBackendList", + }, + request_parameter: { + value: cdktf.listMapperHcl(apiGatewayApiRequestParameterToHclTerraform, true)(this._requestParameter.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApiGatewayApiRequestParameterList", + }, + timeouts: { + value: apiGatewayApiTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApiGatewayApiTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/api-gateway-environment/README.md b/src/constructs/providers/huaweicloud/api-gateway-environment/README.md new file mode 100644 index 00000000..1673b0db --- /dev/null +++ b/src/constructs/providers/huaweicloud/api-gateway-environment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_api_gateway_environment` + +Refer to the Terraform Registry for docs: [`huaweicloud_api_gateway_environment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment). diff --git a/src/constructs/providers/huaweicloud/api-gateway-environment/index.ts b/src/constructs/providers/huaweicloud/api-gateway-environment/index.ts new file mode 100644 index 00000000..fe9523ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/api-gateway-environment/index.ts @@ -0,0 +1,202 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApiGatewayEnvironmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment#description ApiGatewayEnvironment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment#id ApiGatewayEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment#name ApiGatewayEnvironment#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment#region ApiGatewayEnvironment#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment huaweicloud_api_gateway_environment} +*/ +export class ApiGatewayEnvironment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_api_gateway_environment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApiGatewayEnvironment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApiGatewayEnvironment to import + * @param importFromId The id of the existing ApiGatewayEnvironment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApiGatewayEnvironment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_api_gateway_environment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_environment huaweicloud_api_gateway_environment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApiGatewayEnvironmentConfig + */ + public constructor(scope: Construct, id: string, config: ApiGatewayEnvironmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_api_gateway_environment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/api-gateway-group/README.md b/src/constructs/providers/huaweicloud/api-gateway-group/README.md new file mode 100644 index 00000000..804a610b --- /dev/null +++ b/src/constructs/providers/huaweicloud/api-gateway-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_api_gateway_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_api_gateway_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group). diff --git a/src/constructs/providers/huaweicloud/api-gateway-group/index.ts b/src/constructs/providers/huaweicloud/api-gateway-group/index.ts new file mode 100644 index 00000000..5f4568de --- /dev/null +++ b/src/constructs/providers/huaweicloud/api-gateway-group/index.ts @@ -0,0 +1,359 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApiGatewayGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#description ApiGatewayGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#id ApiGatewayGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#name ApiGatewayGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#region ApiGatewayGroup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#timeouts ApiGatewayGroup#timeouts} + */ + readonly timeouts?: ApiGatewayGroupTimeouts; +} +export interface ApiGatewayGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#create ApiGatewayGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#delete ApiGatewayGroup#delete} + */ + readonly delete?: string; +} + +export function apiGatewayGroupTimeoutsToTerraform(struct?: ApiGatewayGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function apiGatewayGroupTimeoutsToHclTerraform(struct?: ApiGatewayGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApiGatewayGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApiGatewayGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApiGatewayGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group huaweicloud_api_gateway_group} +*/ +export class ApiGatewayGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_api_gateway_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApiGatewayGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApiGatewayGroup to import + * @param importFromId The id of the existing ApiGatewayGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApiGatewayGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_api_gateway_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/api_gateway_group huaweicloud_api_gateway_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApiGatewayGroupConfig + */ + public constructor(scope: Construct, id: string, config: ApiGatewayGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_api_gateway_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApiGatewayGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApiGatewayGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: apiGatewayGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apiGatewayGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApiGatewayGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-acl-policy-associate/README.md b/src/constructs/providers/huaweicloud/apig-acl-policy-associate/README.md new file mode 100644 index 00000000..e4981073 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-acl-policy-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_acl_policy_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_acl_policy_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate). diff --git a/src/constructs/providers/huaweicloud/apig-acl-policy-associate/index.ts b/src/constructs/providers/huaweicloud/apig-acl-policy-associate/index.ts new file mode 100644 index 00000000..9b06bf0b --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-acl-policy-associate/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigAclPolicyAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#id ApigAclPolicyAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the APIs and the ACL policy belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#instance_id ApigAclPolicyAssociate#instance_id} + */ + readonly instanceId: string; + /** + * The ACL Policy ID for APIs binding. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#policy_id ApigAclPolicyAssociate#policy_id} + */ + readonly policyId: string; + /** + * The publish IDs corresponding to the APIs bound by the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#publish_ids ApigAclPolicyAssociate#publish_ids} + */ + readonly publishIds: string[]; + /** + * The region where the ACL policy and the APIs are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#region ApigAclPolicyAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#timeouts ApigAclPolicyAssociate#timeouts} + */ + readonly timeouts?: ApigAclPolicyAssociateTimeouts; +} +export interface ApigAclPolicyAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#create ApigAclPolicyAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#delete ApigAclPolicyAssociate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#update ApigAclPolicyAssociate#update} + */ + readonly update?: string; +} + +export function apigAclPolicyAssociateTimeoutsToTerraform(struct?: ApigAclPolicyAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigAclPolicyAssociateTimeoutsToHclTerraform(struct?: ApigAclPolicyAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigAclPolicyAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigAclPolicyAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigAclPolicyAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate huaweicloud_apig_acl_policy_associate} +*/ +export class ApigAclPolicyAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_acl_policy_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigAclPolicyAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigAclPolicyAssociate to import + * @param importFromId The id of the existing ApigAclPolicyAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigAclPolicyAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_acl_policy_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy_associate huaweicloud_apig_acl_policy_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigAclPolicyAssociateConfig + */ + public constructor(scope: Construct, id: string, config: ApigAclPolicyAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_acl_policy_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._policyId = config.policyId; + this._publishIds = config.publishIds; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // publish_ids - computed: false, optional: false, required: true + private _publishIds?: string[]; + public get publishIds() { + return cdktf.Fn.tolist(this.getListAttribute('publish_ids')); + } + public set publishIds(value: string[]) { + this._publishIds = value; + } + // Temporarily expose input value. Use with caution. + public get publishIdsInput() { + return this._publishIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigAclPolicyAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigAclPolicyAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + policy_id: cdktf.stringToTerraform(this._policyId), + publish_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._publishIds), + region: cdktf.stringToTerraform(this._region), + timeouts: apigAclPolicyAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publish_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._publishIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apigAclPolicyAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigAclPolicyAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-acl-policy/README.md b/src/constructs/providers/huaweicloud/apig-acl-policy/README.md new file mode 100644 index 00000000..bf82f176 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-acl-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_acl_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_acl_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy). diff --git a/src/constructs/providers/huaweicloud/apig-acl-policy/index.ts b/src/constructs/providers/huaweicloud/apig-acl-policy/index.ts new file mode 100644 index 00000000..984cefd5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-acl-policy/index.ts @@ -0,0 +1,286 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigAclPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The entity type of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#entity_type ApigAclPolicy#entity_type} + */ + readonly entityType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#id ApigAclPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the ACL policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#instance_id ApigAclPolicy#instance_id} + */ + readonly instanceId: string; + /** + * The name of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#name ApigAclPolicy#name} + */ + readonly name: string; + /** + * The region where the ACL policy is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#region ApigAclPolicy#region} + */ + readonly region?: string; + /** + * The type of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#type ApigAclPolicy#type} + */ + readonly type: string; + /** + * One or more objects from which the access will be controlled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#value ApigAclPolicy#value} + */ + readonly value: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy huaweicloud_apig_acl_policy} +*/ +export class ApigAclPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_acl_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigAclPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigAclPolicy to import + * @param importFromId The id of the existing ApigAclPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigAclPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_acl_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_acl_policy huaweicloud_apig_acl_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigAclPolicyConfig + */ + public constructor(scope: Construct, id: string, config: ApigAclPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_acl_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._entityType = config.entityType; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._value = config.value; + } + + // ========== + // ATTRIBUTES + // ========== + + // entity_type - computed: false, optional: false, required: true + private _entityType?: string; + public get entityType() { + return this.getStringAttribute('entity_type'); + } + public set entityType(value: string) { + this._entityType = value; + } + // Temporarily expose input value. Use with caution. + public get entityTypeInput() { + return this._entityType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + entity_type: cdktf.stringToTerraform(this._entityType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + value: cdktf.stringToTerraform(this._value), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + entity_type: { + value: cdktf.stringToHclTerraform(this._entityType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-api-publishment/README.md b/src/constructs/providers/huaweicloud/apig-api-publishment/README.md new file mode 100644 index 00000000..7cc26613 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-api-publishment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_api_publishment` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_api_publishment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment). diff --git a/src/constructs/providers/huaweicloud/apig-api-publishment/index.ts b/src/constructs/providers/huaweicloud/apig-api-publishment/index.ts new file mode 100644 index 00000000..8a86b47b --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-api-publishment/index.ts @@ -0,0 +1,388 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApiPublishmentConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API to be published or already published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#api_id ApigApiPublishment#api_id} + */ + readonly apiId: string; + /** + * The description of the current publishment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#description ApigApiPublishment#description} + */ + readonly description?: string; + /** + * The ID of the environment to which the current version of the API will be published or has been published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#env_id ApigApiPublishment#env_id} + */ + readonly envId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#id ApigApiPublishment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the API and the environment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#instance_id ApigApiPublishment#instance_id} + */ + readonly instanceId: string; + /** + * The region in which to publish API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#region ApigApiPublishment#region} + */ + readonly region?: string; + /** + * The version ID of the current publishment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#version_id ApigApiPublishment#version_id} + */ + readonly versionId?: string; +} +export interface ApigApiPublishmentHistories { +} + +export function apigApiPublishmentHistoriesToTerraform(struct?: ApigApiPublishmentHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function apigApiPublishmentHistoriesToHclTerraform(struct?: ApigApiPublishmentHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ApigApiPublishmentHistoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiPublishmentHistories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiPublishmentHistories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } +} + +export class ApigApiPublishmentHistoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiPublishmentHistoriesOutputReference { + return new ApigApiPublishmentHistoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment huaweicloud_apig_api_publishment} +*/ +export class ApigApiPublishment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_publishment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApiPublishment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApiPublishment to import + * @param importFromId The id of the existing ApigApiPublishment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApiPublishment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_publishment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api_publishment huaweicloud_apig_api_publishment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApiPublishmentConfig + */ + public constructor(scope: Construct, id: string, config: ApigApiPublishmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_publishment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._description = config.description; + this._envId = config.envId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._versionId = config.versionId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // env_id - computed: false, optional: false, required: true + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // histories - computed: true, optional: false, required: false + private _histories = new ApigApiPublishmentHistoriesList(this, "histories", false); + public get histories() { + return this._histories; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // publish_id - computed: true, optional: false, required: false + public get publishId() { + return this.getStringAttribute('publish_id'); + } + + // published_at - computed: true, optional: false, required: false + public get publishedAt() { + return this.getStringAttribute('published_at'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version_id - computed: false, optional: true, required: false + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + public resetVersionId() { + this._versionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + description: cdktf.stringToTerraform(this._description), + env_id: cdktf.stringToTerraform(this._envId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + version_id: cdktf.stringToTerraform(this._versionId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-api/README.md b/src/constructs/providers/huaweicloud/apig-api/README.md new file mode 100644 index 00000000..9fbc7785 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-api/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_api` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_api`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api). diff --git a/src/constructs/providers/huaweicloud/apig-api/index.ts b/src/constructs/providers/huaweicloud/apig-api/index.ts new file mode 100644 index 00000000..77848e09 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-api/index.ts @@ -0,0 +1,5765 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApiConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the authorizer to which the API request used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The description of the API request body, which can be an example request body, media type or parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#body_description ApigApi#body_description} + */ + readonly bodyDescription?: string; + /** + * Whether CORS is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#cors ApigApi#cors} + */ + readonly cors?: boolean | cdktf.IResolvable; + /** + * The API description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#description ApigApi#description} + */ + readonly description?: string; + /** + * The example response for a failure request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#failure_response ApigApi#failure_response} + */ + readonly failureResponse?: string; + /** + * The ID of the API group to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#group_id ApigApi#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#id ApigApi#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the instance to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#instance_id ApigApi#instance_id} + */ + readonly instanceId: string; + /** + * The matching mode of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#matching ApigApi#matching} + */ + readonly matching?: string; + /** + * The API name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * The region where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#region ApigApi#region} + */ + readonly region?: string; + /** + * The request method of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_method ApigApi#request_method} + */ + readonly requestMethod: string; + /** + * The request address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_path ApigApi#request_path} + */ + readonly requestPath: string; + /** + * The request protocol of the API request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_protocol ApigApi#request_protocol} + */ + readonly requestProtocol: string; + /** + * The ID of the custom response that API used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#response_id ApigApi#response_id} + */ + readonly responseId?: string; + /** + * The security authentication mode of the API request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#security_authentication ApigApi#security_authentication} + */ + readonly securityAuthentication?: string; + /** + * Whether the authentication of the application code is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#simple_authentication ApigApi#simple_authentication} + */ + readonly simpleAuthentication?: boolean | cdktf.IResolvable; + /** + * The example response for a successful request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#success_response ApigApi#success_response} + */ + readonly successResponse?: string; + /** + * The list of tags configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#tags ApigApi#tags} + */ + readonly tags?: string[]; + /** + * The API type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type: string; + /** + * backend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#backend_params ApigApi#backend_params} + */ + readonly backendParams?: ApigApiBackendParams[] | cdktf.IResolvable; + /** + * func_graph block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#func_graph ApigApi#func_graph} + */ + readonly funcGraph?: ApigApiFuncGraph; + /** + * func_graph_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#func_graph_policy ApigApi#func_graph_policy} + */ + readonly funcGraphPolicy?: ApigApiFuncGraphPolicy[] | cdktf.IResolvable; + /** + * mock block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#mock ApigApi#mock} + */ + readonly mock?: ApigApiMock; + /** + * mock_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#mock_policy ApigApi#mock_policy} + */ + readonly mockPolicy?: ApigApiMockPolicy[] | cdktf.IResolvable; + /** + * request_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_params ApigApi#request_params} + */ + readonly requestParams?: ApigApiRequestParams[] | cdktf.IResolvable; + /** + * web block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#web ApigApi#web} + */ + readonly web?: ApigApiWeb; + /** + * web_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#web_policy ApigApi#web_policy} + */ + readonly webPolicy?: ApigApiWebPolicy[] | cdktf.IResolvable; +} +export interface ApigApiBackendParams { + /** + * The description of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#description ApigApi#description} + */ + readonly description?: string; + /** + * Where the parameter is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#location ApigApi#location} + */ + readonly location: string; + /** + * The parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#system_param_type ApigApi#system_param_type} + */ + readonly systemParamType?: string; + /** + * The parameter type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type: string; + /** + * The value of the parameter + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiBackendParamsToTerraform(struct?: ApigApiBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + system_param_type: cdktf.stringToTerraform(struct!.systemParamType), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiBackendParamsToHclTerraform(struct?: ApigApiBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_param_type: { + value: cdktf.stringToHclTerraform(struct!.systemParamType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiBackendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._systemParamType !== undefined) { + hasAnyValues = true; + internalValueResult.systemParamType = this._systemParamType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiBackendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._location = undefined; + this._name = undefined; + this._systemParamType = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._location = value.location; + this._name = value.name; + this._systemParamType = value.systemParamType; + this._type = value.type; + this._value = value.value; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // system_param_type - computed: false, optional: true, required: false + private _systemParamType?: string; + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + public set systemParamType(value: string) { + this._systemParamType = value; + } + public resetSystemParamType() { + this._systemParamType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemParamTypeInput() { + return this._systemParamType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiBackendParamsList extends cdktf.ComplexList { + public internalValue? : ApigApiBackendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiBackendParamsOutputReference { + return new ApigApiBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiFuncGraph { + /** + * The ID of the backend custom authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The alias URN of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#function_alias_urn ApigApi#function_alias_urn} + */ + readonly functionAliasUrn?: string; + /** + * The URN of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#function_urn ApigApi#function_urn} + */ + readonly functionUrn: string; + /** + * The invocation type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#invocation_type ApigApi#invocation_type} + */ + readonly invocationType?: string; + /** + * The network architecture (framework) type of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#network_type ApigApi#network_type} + */ + readonly networkType?: string; + /** + * The request protocol of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_protocol ApigApi#request_protocol} + */ + readonly requestProtocol?: string; + /** + * The timeout for API requests to backend service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#timeout ApigApi#timeout} + */ + readonly timeout?: number; + /** + * The version of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#version ApigApi#version} + */ + readonly version?: string; +} + +export function apigApiFuncGraphToTerraform(struct?: ApigApiFuncGraphOutputReference | ApigApiFuncGraph): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorizer_id: cdktf.stringToTerraform(struct!.authorizerId), + function_alias_urn: cdktf.stringToTerraform(struct!.functionAliasUrn), + function_urn: cdktf.stringToTerraform(struct!.functionUrn), + invocation_type: cdktf.stringToTerraform(struct!.invocationType), + network_type: cdktf.stringToTerraform(struct!.networkType), + request_protocol: cdktf.stringToTerraform(struct!.requestProtocol), + timeout: cdktf.numberToTerraform(struct!.timeout), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function apigApiFuncGraphToHclTerraform(struct?: ApigApiFuncGraphOutputReference | ApigApiFuncGraph): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(struct!.authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_alias_urn: { + value: cdktf.stringToHclTerraform(struct!.functionAliasUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_urn: { + value: cdktf.stringToHclTerraform(struct!.functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invocation_type: { + value: cdktf.stringToHclTerraform(struct!.invocationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_type: { + value: cdktf.stringToHclTerraform(struct!.networkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(struct!.requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiFuncGraphOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigApiFuncGraph | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorizerId !== undefined) { + hasAnyValues = true; + internalValueResult.authorizerId = this._authorizerId; + } + if (this._functionAliasUrn !== undefined) { + hasAnyValues = true; + internalValueResult.functionAliasUrn = this._functionAliasUrn; + } + if (this._functionUrn !== undefined) { + hasAnyValues = true; + internalValueResult.functionUrn = this._functionUrn; + } + if (this._invocationType !== undefined) { + hasAnyValues = true; + internalValueResult.invocationType = this._invocationType; + } + if (this._networkType !== undefined) { + hasAnyValues = true; + internalValueResult.networkType = this._networkType; + } + if (this._requestProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.requestProtocol = this._requestProtocol; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiFuncGraph | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authorizerId = undefined; + this._functionAliasUrn = undefined; + this._functionUrn = undefined; + this._invocationType = undefined; + this._networkType = undefined; + this._requestProtocol = undefined; + this._timeout = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authorizerId = value.authorizerId; + this._functionAliasUrn = value.functionAliasUrn; + this._functionUrn = value.functionUrn; + this._invocationType = value.invocationType; + this._networkType = value.networkType; + this._requestProtocol = value.requestProtocol; + this._timeout = value.timeout; + this._version = value.version; + } + } + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // function_alias_urn - computed: false, optional: true, required: false + private _functionAliasUrn?: string; + public get functionAliasUrn() { + return this.getStringAttribute('function_alias_urn'); + } + public set functionAliasUrn(value: string) { + this._functionAliasUrn = value; + } + public resetFunctionAliasUrn() { + this._functionAliasUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get functionAliasUrnInput() { + return this._functionAliasUrn; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // invocation_type - computed: false, optional: true, required: false + private _invocationType?: string; + public get invocationType() { + return this.getStringAttribute('invocation_type'); + } + public set invocationType(value: string) { + this._invocationType = value; + } + public resetInvocationType() { + this._invocationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get invocationTypeInput() { + return this._invocationType; + } + + // network_type - computed: false, optional: true, required: false + private _networkType?: string; + public get networkType() { + return this.getStringAttribute('network_type'); + } + public set networkType(value: string) { + this._networkType = value; + } + public resetNetworkType() { + this._networkType = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkTypeInput() { + return this._networkType; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface ApigApiFuncGraphPolicyBackendParams { + /** + * The description of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#description ApigApi#description} + */ + readonly description?: string; + /** + * Where the parameter is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#location ApigApi#location} + */ + readonly location: string; + /** + * The parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#system_param_type ApigApi#system_param_type} + */ + readonly systemParamType?: string; + /** + * The parameter type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type: string; + /** + * The value of the parameter + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiFuncGraphPolicyBackendParamsToTerraform(struct?: ApigApiFuncGraphPolicyBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + system_param_type: cdktf.stringToTerraform(struct!.systemParamType), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiFuncGraphPolicyBackendParamsToHclTerraform(struct?: ApigApiFuncGraphPolicyBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_param_type: { + value: cdktf.stringToHclTerraform(struct!.systemParamType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiFuncGraphPolicyBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiFuncGraphPolicyBackendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._systemParamType !== undefined) { + hasAnyValues = true; + internalValueResult.systemParamType = this._systemParamType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiFuncGraphPolicyBackendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._location = undefined; + this._name = undefined; + this._systemParamType = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._location = value.location; + this._name = value.name; + this._systemParamType = value.systemParamType; + this._type = value.type; + this._value = value.value; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // system_param_type - computed: false, optional: true, required: false + private _systemParamType?: string; + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + public set systemParamType(value: string) { + this._systemParamType = value; + } + public resetSystemParamType() { + this._systemParamType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemParamTypeInput() { + return this._systemParamType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiFuncGraphPolicyBackendParamsList extends cdktf.ComplexList { + public internalValue? : ApigApiFuncGraphPolicyBackendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiFuncGraphPolicyBackendParamsOutputReference { + return new ApigApiFuncGraphPolicyBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiFuncGraphPolicyConditions { + /** + * The cookie parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#cookie_name ApigApi#cookie_name} + */ + readonly cookieName?: string; + /** + * The frontend authentication parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#frontend_authorizer_name ApigApi#frontend_authorizer_name} + */ + readonly frontendAuthorizerName?: string; + /** + * The request parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#param_name ApigApi#param_name} + */ + readonly paramName?: string; + /** + * The type of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#source ApigApi#source} + */ + readonly source?: string; + /** + * The gateway built-in parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#sys_name ApigApi#sys_name} + */ + readonly sysName?: string; + /** + * The condition type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type?: string; + /** + * The value of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiFuncGraphPolicyConditionsToTerraform(struct?: ApigApiFuncGraphPolicyConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cookie_name: cdktf.stringToTerraform(struct!.cookieName), + frontend_authorizer_name: cdktf.stringToTerraform(struct!.frontendAuthorizerName), + param_name: cdktf.stringToTerraform(struct!.paramName), + source: cdktf.stringToTerraform(struct!.source), + sys_name: cdktf.stringToTerraform(struct!.sysName), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiFuncGraphPolicyConditionsToHclTerraform(struct?: ApigApiFuncGraphPolicyConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cookie_name: { + value: cdktf.stringToHclTerraform(struct!.cookieName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + frontend_authorizer_name: { + value: cdktf.stringToHclTerraform(struct!.frontendAuthorizerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param_name: { + value: cdktf.stringToHclTerraform(struct!.paramName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(struct!.source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sys_name: { + value: cdktf.stringToHclTerraform(struct!.sysName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiFuncGraphPolicyConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiFuncGraphPolicyConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cookieName !== undefined) { + hasAnyValues = true; + internalValueResult.cookieName = this._cookieName; + } + if (this._frontendAuthorizerName !== undefined) { + hasAnyValues = true; + internalValueResult.frontendAuthorizerName = this._frontendAuthorizerName; + } + if (this._paramName !== undefined) { + hasAnyValues = true; + internalValueResult.paramName = this._paramName; + } + if (this._source !== undefined) { + hasAnyValues = true; + internalValueResult.source = this._source; + } + if (this._sysName !== undefined) { + hasAnyValues = true; + internalValueResult.sysName = this._sysName; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiFuncGraphPolicyConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cookieName = undefined; + this._frontendAuthorizerName = undefined; + this._paramName = undefined; + this._source = undefined; + this._sysName = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cookieName = value.cookieName; + this._frontendAuthorizerName = value.frontendAuthorizerName; + this._paramName = value.paramName; + this._source = value.source; + this._sysName = value.sysName; + this._type = value.type; + this._value = value.value; + } + } + + // cookie_name - computed: false, optional: true, required: false + private _cookieName?: string; + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + public set cookieName(value: string) { + this._cookieName = value; + } + public resetCookieName() { + this._cookieName = undefined; + } + // Temporarily expose input value. Use with caution. + public get cookieNameInput() { + return this._cookieName; + } + + // frontend_authorizer_name - computed: false, optional: true, required: false + private _frontendAuthorizerName?: string; + public get frontendAuthorizerName() { + return this.getStringAttribute('frontend_authorizer_name'); + } + public set frontendAuthorizerName(value: string) { + this._frontendAuthorizerName = value; + } + public resetFrontendAuthorizerName() { + this._frontendAuthorizerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get frontendAuthorizerNameInput() { + return this._frontendAuthorizerName; + } + + // param_name - computed: false, optional: true, required: false + private _paramName?: string; + public get paramName() { + return this.getStringAttribute('param_name'); + } + public set paramName(value: string) { + this._paramName = value; + } + public resetParamName() { + this._paramName = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramNameInput() { + return this._paramName; + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // sys_name - computed: false, optional: true, required: false + private _sysName?: string; + public get sysName() { + return this.getStringAttribute('sys_name'); + } + public set sysName(value: string) { + this._sysName = value; + } + public resetSysName() { + this._sysName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sysNameInput() { + return this._sysName; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiFuncGraphPolicyConditionsList extends cdktf.ComplexList { + public internalValue? : ApigApiFuncGraphPolicyConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiFuncGraphPolicyConditionsOutputReference { + return new ApigApiFuncGraphPolicyConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiFuncGraphPolicy { + /** + * The ID of the backend custom authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The effective mode of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#effective_mode ApigApi#effective_mode} + */ + readonly effectiveMode?: string; + /** + * The alias URN of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#function_alias_urn ApigApi#function_alias_urn} + */ + readonly functionAliasUrn?: string; + /** + * The URN of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#function_urn ApigApi#function_urn} + */ + readonly functionUrn: string; + /** + * The invocation mode of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#invocation_mode ApigApi#invocation_mode} + */ + readonly invocationMode?: string; + /** + * The invocation mode of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#invocation_type ApigApi#invocation_type} + */ + readonly invocationType?: string; + /** + * The name of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * The network (framework) type of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#network_type ApigApi#network_type} + */ + readonly networkType?: string; + /** + * The request protocol of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_protocol ApigApi#request_protocol} + */ + readonly requestProtocol?: string; + /** + * The timeout for API requests to backend service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#timeout ApigApi#timeout} + */ + readonly timeout?: number; + /** + * The version of the FunctionGraph function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#version ApigApi#version} + */ + readonly version?: string; + /** + * backend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#backend_params ApigApi#backend_params} + */ + readonly backendParams?: ApigApiFuncGraphPolicyBackendParams[] | cdktf.IResolvable; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#conditions ApigApi#conditions} + */ + readonly conditions: ApigApiFuncGraphPolicyConditions[] | cdktf.IResolvable; +} + +export function apigApiFuncGraphPolicyToTerraform(struct?: ApigApiFuncGraphPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorizer_id: cdktf.stringToTerraform(struct!.authorizerId), + effective_mode: cdktf.stringToTerraform(struct!.effectiveMode), + function_alias_urn: cdktf.stringToTerraform(struct!.functionAliasUrn), + function_urn: cdktf.stringToTerraform(struct!.functionUrn), + invocation_mode: cdktf.stringToTerraform(struct!.invocationMode), + invocation_type: cdktf.stringToTerraform(struct!.invocationType), + name: cdktf.stringToTerraform(struct!.name), + network_type: cdktf.stringToTerraform(struct!.networkType), + request_protocol: cdktf.stringToTerraform(struct!.requestProtocol), + timeout: cdktf.numberToTerraform(struct!.timeout), + version: cdktf.stringToTerraform(struct!.version), + backend_params: cdktf.listMapper(apigApiFuncGraphPolicyBackendParamsToTerraform, true)(struct!.backendParams), + conditions: cdktf.listMapper(apigApiFuncGraphPolicyConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function apigApiFuncGraphPolicyToHclTerraform(struct?: ApigApiFuncGraphPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(struct!.authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + effective_mode: { + value: cdktf.stringToHclTerraform(struct!.effectiveMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_alias_urn: { + value: cdktf.stringToHclTerraform(struct!.functionAliasUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_urn: { + value: cdktf.stringToHclTerraform(struct!.functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invocation_mode: { + value: cdktf.stringToHclTerraform(struct!.invocationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invocation_type: { + value: cdktf.stringToHclTerraform(struct!.invocationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_type: { + value: cdktf.stringToHclTerraform(struct!.networkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(struct!.requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_params: { + value: cdktf.listMapperHcl(apigApiFuncGraphPolicyBackendParamsToHclTerraform, true)(struct!.backendParams), + isBlock: true, + type: "set", + storageClassType: "ApigApiFuncGraphPolicyBackendParamsList", + }, + conditions: { + value: cdktf.listMapperHcl(apigApiFuncGraphPolicyConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "set", + storageClassType: "ApigApiFuncGraphPolicyConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiFuncGraphPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiFuncGraphPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorizerId !== undefined) { + hasAnyValues = true; + internalValueResult.authorizerId = this._authorizerId; + } + if (this._effectiveMode !== undefined) { + hasAnyValues = true; + internalValueResult.effectiveMode = this._effectiveMode; + } + if (this._functionAliasUrn !== undefined) { + hasAnyValues = true; + internalValueResult.functionAliasUrn = this._functionAliasUrn; + } + if (this._functionUrn !== undefined) { + hasAnyValues = true; + internalValueResult.functionUrn = this._functionUrn; + } + if (this._invocationMode !== undefined) { + hasAnyValues = true; + internalValueResult.invocationMode = this._invocationMode; + } + if (this._invocationType !== undefined) { + hasAnyValues = true; + internalValueResult.invocationType = this._invocationType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._networkType !== undefined) { + hasAnyValues = true; + internalValueResult.networkType = this._networkType; + } + if (this._requestProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.requestProtocol = this._requestProtocol; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + if (this._backendParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backendParams = this._backendParams?.internalValue; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiFuncGraphPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._authorizerId = undefined; + this._effectiveMode = undefined; + this._functionAliasUrn = undefined; + this._functionUrn = undefined; + this._invocationMode = undefined; + this._invocationType = undefined; + this._name = undefined; + this._networkType = undefined; + this._requestProtocol = undefined; + this._timeout = undefined; + this._version = undefined; + this._backendParams.internalValue = undefined; + this._conditions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._authorizerId = value.authorizerId; + this._effectiveMode = value.effectiveMode; + this._functionAliasUrn = value.functionAliasUrn; + this._functionUrn = value.functionUrn; + this._invocationMode = value.invocationMode; + this._invocationType = value.invocationType; + this._name = value.name; + this._networkType = value.networkType; + this._requestProtocol = value.requestProtocol; + this._timeout = value.timeout; + this._version = value.version; + this._backendParams.internalValue = value.backendParams; + this._conditions.internalValue = value.conditions; + } + } + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // effective_mode - computed: false, optional: true, required: false + private _effectiveMode?: string; + public get effectiveMode() { + return this.getStringAttribute('effective_mode'); + } + public set effectiveMode(value: string) { + this._effectiveMode = value; + } + public resetEffectiveMode() { + this._effectiveMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get effectiveModeInput() { + return this._effectiveMode; + } + + // function_alias_urn - computed: false, optional: true, required: false + private _functionAliasUrn?: string; + public get functionAliasUrn() { + return this.getStringAttribute('function_alias_urn'); + } + public set functionAliasUrn(value: string) { + this._functionAliasUrn = value; + } + public resetFunctionAliasUrn() { + this._functionAliasUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get functionAliasUrnInput() { + return this._functionAliasUrn; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // invocation_mode - computed: false, optional: true, required: false + private _invocationMode?: string; + public get invocationMode() { + return this.getStringAttribute('invocation_mode'); + } + public set invocationMode(value: string) { + this._invocationMode = value; + } + public resetInvocationMode() { + this._invocationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get invocationModeInput() { + return this._invocationMode; + } + + // invocation_type - computed: false, optional: true, required: false + private _invocationType?: string; + public get invocationType() { + return this.getStringAttribute('invocation_type'); + } + public set invocationType(value: string) { + this._invocationType = value; + } + public resetInvocationType() { + this._invocationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get invocationTypeInput() { + return this._invocationType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_type - computed: false, optional: true, required: false + private _networkType?: string; + public get networkType() { + return this.getStringAttribute('network_type'); + } + public set networkType(value: string) { + this._networkType = value; + } + public resetNetworkType() { + this._networkType = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkTypeInput() { + return this._networkType; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // backend_params - computed: false, optional: true, required: false + private _backendParams = new ApigApiFuncGraphPolicyBackendParamsList(this, "backend_params", true); + public get backendParams() { + return this._backendParams; + } + public putBackendParams(value: ApigApiFuncGraphPolicyBackendParams[] | cdktf.IResolvable) { + this._backendParams.internalValue = value; + } + public resetBackendParams() { + this._backendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParamsInput() { + return this._backendParams.internalValue; + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new ApigApiFuncGraphPolicyConditionsList(this, "conditions", true); + public get conditions() { + return this._conditions; + } + public putConditions(value: ApigApiFuncGraphPolicyConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +export class ApigApiFuncGraphPolicyList extends cdktf.ComplexList { + public internalValue? : ApigApiFuncGraphPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiFuncGraphPolicyOutputReference { + return new ApigApiFuncGraphPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiMock { + /** + * The ID of the backend custom authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The response content of the mock. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#response ApigApi#response} + */ + readonly response?: string; + /** + * The custom status code of the mock response. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#status_code ApigApi#status_code} + */ + readonly statusCode?: number; +} + +export function apigApiMockToTerraform(struct?: ApigApiMockOutputReference | ApigApiMock): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorizer_id: cdktf.stringToTerraform(struct!.authorizerId), + response: cdktf.stringToTerraform(struct!.response), + status_code: cdktf.numberToTerraform(struct!.statusCode), + } +} + + +export function apigApiMockToHclTerraform(struct?: ApigApiMockOutputReference | ApigApiMock): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(struct!.authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response: { + value: cdktf.stringToHclTerraform(struct!.response), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.numberToHclTerraform(struct!.statusCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiMockOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigApiMock | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorizerId !== undefined) { + hasAnyValues = true; + internalValueResult.authorizerId = this._authorizerId; + } + if (this._response !== undefined) { + hasAnyValues = true; + internalValueResult.response = this._response; + } + if (this._statusCode !== undefined) { + hasAnyValues = true; + internalValueResult.statusCode = this._statusCode; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiMock | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authorizerId = undefined; + this._response = undefined; + this._statusCode = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authorizerId = value.authorizerId; + this._response = value.response; + this._statusCode = value.statusCode; + } + } + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // response - computed: false, optional: true, required: false + private _response?: string; + public get response() { + return this.getStringAttribute('response'); + } + public set response(value: string) { + this._response = value; + } + public resetResponse() { + this._response = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseInput() { + return this._response; + } + + // status_code - computed: true, optional: true, required: false + private _statusCode?: number; + public get statusCode() { + return this.getNumberAttribute('status_code'); + } + public set statusCode(value: number) { + this._statusCode = value; + } + public resetStatusCode() { + this._statusCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } +} +export interface ApigApiMockPolicyBackendParams { + /** + * The description of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#description ApigApi#description} + */ + readonly description?: string; + /** + * Where the parameter is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#location ApigApi#location} + */ + readonly location: string; + /** + * The parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#system_param_type ApigApi#system_param_type} + */ + readonly systemParamType?: string; + /** + * The parameter type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type: string; + /** + * The value of the parameter + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiMockPolicyBackendParamsToTerraform(struct?: ApigApiMockPolicyBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + system_param_type: cdktf.stringToTerraform(struct!.systemParamType), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiMockPolicyBackendParamsToHclTerraform(struct?: ApigApiMockPolicyBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_param_type: { + value: cdktf.stringToHclTerraform(struct!.systemParamType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiMockPolicyBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiMockPolicyBackendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._systemParamType !== undefined) { + hasAnyValues = true; + internalValueResult.systemParamType = this._systemParamType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiMockPolicyBackendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._location = undefined; + this._name = undefined; + this._systemParamType = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._location = value.location; + this._name = value.name; + this._systemParamType = value.systemParamType; + this._type = value.type; + this._value = value.value; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // system_param_type - computed: false, optional: true, required: false + private _systemParamType?: string; + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + public set systemParamType(value: string) { + this._systemParamType = value; + } + public resetSystemParamType() { + this._systemParamType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemParamTypeInput() { + return this._systemParamType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiMockPolicyBackendParamsList extends cdktf.ComplexList { + public internalValue? : ApigApiMockPolicyBackendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiMockPolicyBackendParamsOutputReference { + return new ApigApiMockPolicyBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiMockPolicyConditions { + /** + * The cookie parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#cookie_name ApigApi#cookie_name} + */ + readonly cookieName?: string; + /** + * The frontend authentication parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#frontend_authorizer_name ApigApi#frontend_authorizer_name} + */ + readonly frontendAuthorizerName?: string; + /** + * The request parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#param_name ApigApi#param_name} + */ + readonly paramName?: string; + /** + * The type of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#source ApigApi#source} + */ + readonly source?: string; + /** + * The gateway built-in parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#sys_name ApigApi#sys_name} + */ + readonly sysName?: string; + /** + * The condition type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type?: string; + /** + * The value of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiMockPolicyConditionsToTerraform(struct?: ApigApiMockPolicyConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cookie_name: cdktf.stringToTerraform(struct!.cookieName), + frontend_authorizer_name: cdktf.stringToTerraform(struct!.frontendAuthorizerName), + param_name: cdktf.stringToTerraform(struct!.paramName), + source: cdktf.stringToTerraform(struct!.source), + sys_name: cdktf.stringToTerraform(struct!.sysName), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiMockPolicyConditionsToHclTerraform(struct?: ApigApiMockPolicyConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cookie_name: { + value: cdktf.stringToHclTerraform(struct!.cookieName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + frontend_authorizer_name: { + value: cdktf.stringToHclTerraform(struct!.frontendAuthorizerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param_name: { + value: cdktf.stringToHclTerraform(struct!.paramName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(struct!.source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sys_name: { + value: cdktf.stringToHclTerraform(struct!.sysName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiMockPolicyConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiMockPolicyConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cookieName !== undefined) { + hasAnyValues = true; + internalValueResult.cookieName = this._cookieName; + } + if (this._frontendAuthorizerName !== undefined) { + hasAnyValues = true; + internalValueResult.frontendAuthorizerName = this._frontendAuthorizerName; + } + if (this._paramName !== undefined) { + hasAnyValues = true; + internalValueResult.paramName = this._paramName; + } + if (this._source !== undefined) { + hasAnyValues = true; + internalValueResult.source = this._source; + } + if (this._sysName !== undefined) { + hasAnyValues = true; + internalValueResult.sysName = this._sysName; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiMockPolicyConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cookieName = undefined; + this._frontendAuthorizerName = undefined; + this._paramName = undefined; + this._source = undefined; + this._sysName = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cookieName = value.cookieName; + this._frontendAuthorizerName = value.frontendAuthorizerName; + this._paramName = value.paramName; + this._source = value.source; + this._sysName = value.sysName; + this._type = value.type; + this._value = value.value; + } + } + + // cookie_name - computed: false, optional: true, required: false + private _cookieName?: string; + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + public set cookieName(value: string) { + this._cookieName = value; + } + public resetCookieName() { + this._cookieName = undefined; + } + // Temporarily expose input value. Use with caution. + public get cookieNameInput() { + return this._cookieName; + } + + // frontend_authorizer_name - computed: false, optional: true, required: false + private _frontendAuthorizerName?: string; + public get frontendAuthorizerName() { + return this.getStringAttribute('frontend_authorizer_name'); + } + public set frontendAuthorizerName(value: string) { + this._frontendAuthorizerName = value; + } + public resetFrontendAuthorizerName() { + this._frontendAuthorizerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get frontendAuthorizerNameInput() { + return this._frontendAuthorizerName; + } + + // param_name - computed: false, optional: true, required: false + private _paramName?: string; + public get paramName() { + return this.getStringAttribute('param_name'); + } + public set paramName(value: string) { + this._paramName = value; + } + public resetParamName() { + this._paramName = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramNameInput() { + return this._paramName; + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // sys_name - computed: false, optional: true, required: false + private _sysName?: string; + public get sysName() { + return this.getStringAttribute('sys_name'); + } + public set sysName(value: string) { + this._sysName = value; + } + public resetSysName() { + this._sysName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sysNameInput() { + return this._sysName; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiMockPolicyConditionsList extends cdktf.ComplexList { + public internalValue? : ApigApiMockPolicyConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiMockPolicyConditionsOutputReference { + return new ApigApiMockPolicyConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiMockPolicy { + /** + * The ID of the backend custom authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The effective mode of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#effective_mode ApigApi#effective_mode} + */ + readonly effectiveMode?: string; + /** + * The backend policy name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * The response content of the mock. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#response ApigApi#response} + */ + readonly response?: string; + /** + * The custom status code of the mock response. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#status_code ApigApi#status_code} + */ + readonly statusCode?: number; + /** + * backend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#backend_params ApigApi#backend_params} + */ + readonly backendParams?: ApigApiMockPolicyBackendParams[] | cdktf.IResolvable; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#conditions ApigApi#conditions} + */ + readonly conditions: ApigApiMockPolicyConditions[] | cdktf.IResolvable; +} + +export function apigApiMockPolicyToTerraform(struct?: ApigApiMockPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorizer_id: cdktf.stringToTerraform(struct!.authorizerId), + effective_mode: cdktf.stringToTerraform(struct!.effectiveMode), + name: cdktf.stringToTerraform(struct!.name), + response: cdktf.stringToTerraform(struct!.response), + status_code: cdktf.numberToTerraform(struct!.statusCode), + backend_params: cdktf.listMapper(apigApiMockPolicyBackendParamsToTerraform, true)(struct!.backendParams), + conditions: cdktf.listMapper(apigApiMockPolicyConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function apigApiMockPolicyToHclTerraform(struct?: ApigApiMockPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(struct!.authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + effective_mode: { + value: cdktf.stringToHclTerraform(struct!.effectiveMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response: { + value: cdktf.stringToHclTerraform(struct!.response), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.numberToHclTerraform(struct!.statusCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + backend_params: { + value: cdktf.listMapperHcl(apigApiMockPolicyBackendParamsToHclTerraform, true)(struct!.backendParams), + isBlock: true, + type: "set", + storageClassType: "ApigApiMockPolicyBackendParamsList", + }, + conditions: { + value: cdktf.listMapperHcl(apigApiMockPolicyConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "set", + storageClassType: "ApigApiMockPolicyConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiMockPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiMockPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorizerId !== undefined) { + hasAnyValues = true; + internalValueResult.authorizerId = this._authorizerId; + } + if (this._effectiveMode !== undefined) { + hasAnyValues = true; + internalValueResult.effectiveMode = this._effectiveMode; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._response !== undefined) { + hasAnyValues = true; + internalValueResult.response = this._response; + } + if (this._statusCode !== undefined) { + hasAnyValues = true; + internalValueResult.statusCode = this._statusCode; + } + if (this._backendParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backendParams = this._backendParams?.internalValue; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiMockPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._authorizerId = undefined; + this._effectiveMode = undefined; + this._name = undefined; + this._response = undefined; + this._statusCode = undefined; + this._backendParams.internalValue = undefined; + this._conditions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._authorizerId = value.authorizerId; + this._effectiveMode = value.effectiveMode; + this._name = value.name; + this._response = value.response; + this._statusCode = value.statusCode; + this._backendParams.internalValue = value.backendParams; + this._conditions.internalValue = value.conditions; + } + } + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // effective_mode - computed: false, optional: true, required: false + private _effectiveMode?: string; + public get effectiveMode() { + return this.getStringAttribute('effective_mode'); + } + public set effectiveMode(value: string) { + this._effectiveMode = value; + } + public resetEffectiveMode() { + this._effectiveMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get effectiveModeInput() { + return this._effectiveMode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // response - computed: false, optional: true, required: false + private _response?: string; + public get response() { + return this.getStringAttribute('response'); + } + public set response(value: string) { + this._response = value; + } + public resetResponse() { + this._response = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseInput() { + return this._response; + } + + // status_code - computed: true, optional: true, required: false + private _statusCode?: number; + public get statusCode() { + return this.getNumberAttribute('status_code'); + } + public set statusCode(value: number) { + this._statusCode = value; + } + public resetStatusCode() { + this._statusCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } + + // backend_params - computed: false, optional: true, required: false + private _backendParams = new ApigApiMockPolicyBackendParamsList(this, "backend_params", true); + public get backendParams() { + return this._backendParams; + } + public putBackendParams(value: ApigApiMockPolicyBackendParams[] | cdktf.IResolvable) { + this._backendParams.internalValue = value; + } + public resetBackendParams() { + this._backendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParamsInput() { + return this._backendParams.internalValue; + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new ApigApiMockPolicyConditionsList(this, "conditions", true); + public get conditions() { + return this._conditions; + } + public putConditions(value: ApigApiMockPolicyConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +export class ApigApiMockPolicyList extends cdktf.ComplexList { + public internalValue? : ApigApiMockPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiMockPolicyOutputReference { + return new ApigApiMockPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiRequestParams { + /** + * The default value of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#default ApigApi#default} + */ + readonly default?: string; + /** + * The parameter description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#description ApigApi#description} + */ + readonly description?: string; + /** + * The enumerated value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#enumeration ApigApi#enumeration} + */ + readonly enumeration?: string; + /** + * The parameter example. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#example ApigApi#example} + */ + readonly example?: string; + /** + * Where this parameter is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#location ApigApi#location} + */ + readonly location?: string; + /** + * The maximum value or length (string parameter) for parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#maximum ApigApi#maximum} + */ + readonly maximum?: number; + /** + * The minimum value or length (string parameter) for parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#minimum ApigApi#minimum} + */ + readonly minimum?: number; + /** + * The name of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * Whether to transparently transfer the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#passthrough ApigApi#passthrough} + */ + readonly passthrough?: boolean | cdktf.IResolvable; + /** + * Whether this parameter is required. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#required ApigApi#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * The parameter type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type?: string; + /** + * Whether to enable the parameter validation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#valid_enable ApigApi#valid_enable} + */ + readonly validEnable?: number; +} + +export function apigApiRequestParamsToTerraform(struct?: ApigApiRequestParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default: cdktf.stringToTerraform(struct!.default), + description: cdktf.stringToTerraform(struct!.description), + enumeration: cdktf.stringToTerraform(struct!.enumeration), + example: cdktf.stringToTerraform(struct!.example), + location: cdktf.stringToTerraform(struct!.location), + maximum: cdktf.numberToTerraform(struct!.maximum), + minimum: cdktf.numberToTerraform(struct!.minimum), + name: cdktf.stringToTerraform(struct!.name), + passthrough: cdktf.booleanToTerraform(struct!.passthrough), + required: cdktf.booleanToTerraform(struct!.required), + type: cdktf.stringToTerraform(struct!.type), + valid_enable: cdktf.numberToTerraform(struct!.validEnable), + } +} + + +export function apigApiRequestParamsToHclTerraform(struct?: ApigApiRequestParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default: { + value: cdktf.stringToHclTerraform(struct!.default), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enumeration: { + value: cdktf.stringToHclTerraform(struct!.enumeration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + example: { + value: cdktf.stringToHclTerraform(struct!.example), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maximum: { + value: cdktf.numberToHclTerraform(struct!.maximum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + minimum: { + value: cdktf.numberToHclTerraform(struct!.minimum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + passthrough: { + value: cdktf.booleanToHclTerraform(struct!.passthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + valid_enable: { + value: cdktf.numberToHclTerraform(struct!.validEnable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiRequestParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiRequestParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._default !== undefined) { + hasAnyValues = true; + internalValueResult.default = this._default; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enumeration !== undefined) { + hasAnyValues = true; + internalValueResult.enumeration = this._enumeration; + } + if (this._example !== undefined) { + hasAnyValues = true; + internalValueResult.example = this._example; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._maximum !== undefined) { + hasAnyValues = true; + internalValueResult.maximum = this._maximum; + } + if (this._minimum !== undefined) { + hasAnyValues = true; + internalValueResult.minimum = this._minimum; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._passthrough !== undefined) { + hasAnyValues = true; + internalValueResult.passthrough = this._passthrough; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._validEnable !== undefined) { + hasAnyValues = true; + internalValueResult.validEnable = this._validEnable; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiRequestParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._default = undefined; + this._description = undefined; + this._enumeration = undefined; + this._example = undefined; + this._location = undefined; + this._maximum = undefined; + this._minimum = undefined; + this._name = undefined; + this._passthrough = undefined; + this._required = undefined; + this._type = undefined; + this._validEnable = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._default = value.default; + this._description = value.description; + this._enumeration = value.enumeration; + this._example = value.example; + this._location = value.location; + this._maximum = value.maximum; + this._minimum = value.minimum; + this._name = value.name; + this._passthrough = value.passthrough; + this._required = value.required; + this._type = value.type; + this._validEnable = value.validEnable; + } + } + + // default - computed: true, optional: true, required: false + private _default?: string; + public get default() { + return this.getStringAttribute('default'); + } + public set default(value: string) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enumeration - computed: true, optional: true, required: false + private _enumeration?: string; + public get enumeration() { + return this.getStringAttribute('enumeration'); + } + public set enumeration(value: string) { + this._enumeration = value; + } + public resetEnumeration() { + this._enumeration = undefined; + } + // Temporarily expose input value. Use with caution. + public get enumerationInput() { + return this._enumeration; + } + + // example - computed: true, optional: true, required: false + private _example?: string; + public get example() { + return this.getStringAttribute('example'); + } + public set example(value: string) { + this._example = value; + } + public resetExample() { + this._example = undefined; + } + // Temporarily expose input value. Use with caution. + public get exampleInput() { + return this._example; + } + + // location - computed: false, optional: true, required: false + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + public resetLocation() { + this._location = undefined; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // maximum - computed: true, optional: true, required: false + private _maximum?: number; + public get maximum() { + return this.getNumberAttribute('maximum'); + } + public set maximum(value: number) { + this._maximum = value; + } + public resetMaximum() { + this._maximum = undefined; + } + // Temporarily expose input value. Use with caution. + public get maximumInput() { + return this._maximum; + } + + // minimum - computed: true, optional: true, required: false + private _minimum?: number; + public get minimum() { + return this.getNumberAttribute('minimum'); + } + public set minimum(value: number) { + this._minimum = value; + } + public resetMinimum() { + this._minimum = undefined; + } + // Temporarily expose input value. Use with caution. + public get minimumInput() { + return this._minimum; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // passthrough - computed: true, optional: true, required: false + private _passthrough?: boolean | cdktf.IResolvable; + public get passthrough() { + return this.getBooleanAttribute('passthrough'); + } + public set passthrough(value: boolean | cdktf.IResolvable) { + this._passthrough = value; + } + public resetPassthrough() { + this._passthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get passthroughInput() { + return this._passthrough; + } + + // required - computed: true, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // valid_enable - computed: true, optional: true, required: false + private _validEnable?: number; + public get validEnable() { + return this.getNumberAttribute('valid_enable'); + } + public set validEnable(value: number) { + this._validEnable = value; + } + public resetValidEnable() { + this._validEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get validEnableInput() { + return this._validEnable; + } +} + +export class ApigApiRequestParamsList extends cdktf.ComplexList { + public internalValue? : ApigApiRequestParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiRequestParamsOutputReference { + return new ApigApiRequestParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiWeb { + /** + * The ID of the backend custom authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The backend service address, which consists of a domain name or IP address, and a port number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#backend_address ApigApi#backend_address} + */ + readonly backendAddress?: string; + /** + * The proxy host header. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#host_header ApigApi#host_header} + */ + readonly hostHeader?: string; + /** + * The backend request path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#path ApigApi#path} + */ + readonly path: string; + /** + * The backend request method of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_method ApigApi#request_method} + */ + readonly requestMethod?: string; + /** + * The web protocol type of the API request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_protocol ApigApi#request_protocol} + */ + readonly requestProtocol?: string; + /** + * The number of retry attempts to request the backend service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#retry_count ApigApi#retry_count} + */ + readonly retryCount?: number; + /** + * Whether to enable two-way authentication. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#ssl_enable ApigApi#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * The timeout for API requests to backend service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#timeout ApigApi#timeout} + */ + readonly timeout?: number; + /** + * The VPC channel ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#vpc_channel_id ApigApi#vpc_channel_id} + */ + readonly vpcChannelId?: string; +} + +export function apigApiWebToTerraform(struct?: ApigApiWebOutputReference | ApigApiWeb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorizer_id: cdktf.stringToTerraform(struct!.authorizerId), + backend_address: cdktf.stringToTerraform(struct!.backendAddress), + host_header: cdktf.stringToTerraform(struct!.hostHeader), + path: cdktf.stringToTerraform(struct!.path), + request_method: cdktf.stringToTerraform(struct!.requestMethod), + request_protocol: cdktf.stringToTerraform(struct!.requestProtocol), + retry_count: cdktf.numberToTerraform(struct!.retryCount), + ssl_enable: cdktf.booleanToTerraform(struct!.sslEnable), + timeout: cdktf.numberToTerraform(struct!.timeout), + vpc_channel_id: cdktf.stringToTerraform(struct!.vpcChannelId), + } +} + + +export function apigApiWebToHclTerraform(struct?: ApigApiWebOutputReference | ApigApiWeb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(struct!.authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_address: { + value: cdktf.stringToHclTerraform(struct!.backendAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_header: { + value: cdktf.stringToHclTerraform(struct!.hostHeader), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(struct!.requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(struct!.requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retry_count: { + value: cdktf.numberToHclTerraform(struct!.retryCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(struct!.sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_channel_id: { + value: cdktf.stringToHclTerraform(struct!.vpcChannelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiWebOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigApiWeb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorizerId !== undefined) { + hasAnyValues = true; + internalValueResult.authorizerId = this._authorizerId; + } + if (this._backendAddress !== undefined) { + hasAnyValues = true; + internalValueResult.backendAddress = this._backendAddress; + } + if (this._hostHeader !== undefined) { + hasAnyValues = true; + internalValueResult.hostHeader = this._hostHeader; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._requestMethod !== undefined) { + hasAnyValues = true; + internalValueResult.requestMethod = this._requestMethod; + } + if (this._requestProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.requestProtocol = this._requestProtocol; + } + if (this._retryCount !== undefined) { + hasAnyValues = true; + internalValueResult.retryCount = this._retryCount; + } + if (this._sslEnable !== undefined) { + hasAnyValues = true; + internalValueResult.sslEnable = this._sslEnable; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._vpcChannelId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcChannelId = this._vpcChannelId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiWeb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authorizerId = undefined; + this._backendAddress = undefined; + this._hostHeader = undefined; + this._path = undefined; + this._requestMethod = undefined; + this._requestProtocol = undefined; + this._retryCount = undefined; + this._sslEnable = undefined; + this._timeout = undefined; + this._vpcChannelId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authorizerId = value.authorizerId; + this._backendAddress = value.backendAddress; + this._hostHeader = value.hostHeader; + this._path = value.path; + this._requestMethod = value.requestMethod; + this._requestProtocol = value.requestProtocol; + this._retryCount = value.retryCount; + this._sslEnable = value.sslEnable; + this._timeout = value.timeout; + this._vpcChannelId = value.vpcChannelId; + } + } + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // backend_address - computed: false, optional: true, required: false + private _backendAddress?: string; + public get backendAddress() { + return this.getStringAttribute('backend_address'); + } + public set backendAddress(value: string) { + this._backendAddress = value; + } + public resetBackendAddress() { + this._backendAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendAddressInput() { + return this._backendAddress; + } + + // host_header - computed: false, optional: true, required: false + private _hostHeader?: string; + public get hostHeader() { + return this.getStringAttribute('host_header'); + } + public set hostHeader(value: string) { + this._hostHeader = value; + } + public resetHostHeader() { + this._hostHeader = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostHeaderInput() { + return this._hostHeader; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // request_method - computed: false, optional: true, required: false + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + public resetRequestMethod() { + this._requestMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // retry_count - computed: false, optional: true, required: false + private _retryCount?: number; + public get retryCount() { + return this.getNumberAttribute('retry_count'); + } + public set retryCount(value: number) { + this._retryCount = value; + } + public resetRetryCount() { + this._retryCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryCountInput() { + return this._retryCount; + } + + // ssl_enable - computed: false, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // vpc_channel_id - computed: false, optional: true, required: false + private _vpcChannelId?: string; + public get vpcChannelId() { + return this.getStringAttribute('vpc_channel_id'); + } + public set vpcChannelId(value: string) { + this._vpcChannelId = value; + } + public resetVpcChannelId() { + this._vpcChannelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcChannelIdInput() { + return this._vpcChannelId; + } +} +export interface ApigApiWebPolicyBackendParams { + /** + * The description of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#description ApigApi#description} + */ + readonly description?: string; + /** + * Where the parameter is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#location ApigApi#location} + */ + readonly location: string; + /** + * The parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#system_param_type ApigApi#system_param_type} + */ + readonly systemParamType?: string; + /** + * The parameter type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type: string; + /** + * The value of the parameter + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiWebPolicyBackendParamsToTerraform(struct?: ApigApiWebPolicyBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + system_param_type: cdktf.stringToTerraform(struct!.systemParamType), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiWebPolicyBackendParamsToHclTerraform(struct?: ApigApiWebPolicyBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_param_type: { + value: cdktf.stringToHclTerraform(struct!.systemParamType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiWebPolicyBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiWebPolicyBackendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._systemParamType !== undefined) { + hasAnyValues = true; + internalValueResult.systemParamType = this._systemParamType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiWebPolicyBackendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._location = undefined; + this._name = undefined; + this._systemParamType = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._location = value.location; + this._name = value.name; + this._systemParamType = value.systemParamType; + this._type = value.type; + this._value = value.value; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // system_param_type - computed: false, optional: true, required: false + private _systemParamType?: string; + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + public set systemParamType(value: string) { + this._systemParamType = value; + } + public resetSystemParamType() { + this._systemParamType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemParamTypeInput() { + return this._systemParamType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiWebPolicyBackendParamsList extends cdktf.ComplexList { + public internalValue? : ApigApiWebPolicyBackendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiWebPolicyBackendParamsOutputReference { + return new ApigApiWebPolicyBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiWebPolicyConditions { + /** + * The cookie parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#cookie_name ApigApi#cookie_name} + */ + readonly cookieName?: string; + /** + * The frontend authentication parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#frontend_authorizer_name ApigApi#frontend_authorizer_name} + */ + readonly frontendAuthorizerName?: string; + /** + * The request parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#param_name ApigApi#param_name} + */ + readonly paramName?: string; + /** + * The type of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#source ApigApi#source} + */ + readonly source?: string; + /** + * The gateway built-in parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#sys_name ApigApi#sys_name} + */ + readonly sysName?: string; + /** + * The condition type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#type ApigApi#type} + */ + readonly type?: string; + /** + * The value of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#value ApigApi#value} + */ + readonly value: string; +} + +export function apigApiWebPolicyConditionsToTerraform(struct?: ApigApiWebPolicyConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cookie_name: cdktf.stringToTerraform(struct!.cookieName), + frontend_authorizer_name: cdktf.stringToTerraform(struct!.frontendAuthorizerName), + param_name: cdktf.stringToTerraform(struct!.paramName), + source: cdktf.stringToTerraform(struct!.source), + sys_name: cdktf.stringToTerraform(struct!.sysName), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigApiWebPolicyConditionsToHclTerraform(struct?: ApigApiWebPolicyConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cookie_name: { + value: cdktf.stringToHclTerraform(struct!.cookieName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + frontend_authorizer_name: { + value: cdktf.stringToHclTerraform(struct!.frontendAuthorizerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param_name: { + value: cdktf.stringToHclTerraform(struct!.paramName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(struct!.source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sys_name: { + value: cdktf.stringToHclTerraform(struct!.sysName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiWebPolicyConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiWebPolicyConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cookieName !== undefined) { + hasAnyValues = true; + internalValueResult.cookieName = this._cookieName; + } + if (this._frontendAuthorizerName !== undefined) { + hasAnyValues = true; + internalValueResult.frontendAuthorizerName = this._frontendAuthorizerName; + } + if (this._paramName !== undefined) { + hasAnyValues = true; + internalValueResult.paramName = this._paramName; + } + if (this._source !== undefined) { + hasAnyValues = true; + internalValueResult.source = this._source; + } + if (this._sysName !== undefined) { + hasAnyValues = true; + internalValueResult.sysName = this._sysName; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiWebPolicyConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cookieName = undefined; + this._frontendAuthorizerName = undefined; + this._paramName = undefined; + this._source = undefined; + this._sysName = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cookieName = value.cookieName; + this._frontendAuthorizerName = value.frontendAuthorizerName; + this._paramName = value.paramName; + this._source = value.source; + this._sysName = value.sysName; + this._type = value.type; + this._value = value.value; + } + } + + // cookie_name - computed: false, optional: true, required: false + private _cookieName?: string; + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + public set cookieName(value: string) { + this._cookieName = value; + } + public resetCookieName() { + this._cookieName = undefined; + } + // Temporarily expose input value. Use with caution. + public get cookieNameInput() { + return this._cookieName; + } + + // frontend_authorizer_name - computed: false, optional: true, required: false + private _frontendAuthorizerName?: string; + public get frontendAuthorizerName() { + return this.getStringAttribute('frontend_authorizer_name'); + } + public set frontendAuthorizerName(value: string) { + this._frontendAuthorizerName = value; + } + public resetFrontendAuthorizerName() { + this._frontendAuthorizerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get frontendAuthorizerNameInput() { + return this._frontendAuthorizerName; + } + + // param_name - computed: false, optional: true, required: false + private _paramName?: string; + public get paramName() { + return this.getStringAttribute('param_name'); + } + public set paramName(value: string) { + this._paramName = value; + } + public resetParamName() { + this._paramName = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramNameInput() { + return this._paramName; + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // sys_name - computed: false, optional: true, required: false + private _sysName?: string; + public get sysName() { + return this.getStringAttribute('sys_name'); + } + public set sysName(value: string) { + this._sysName = value; + } + public resetSysName() { + this._sysName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sysNameInput() { + return this._sysName; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ApigApiWebPolicyConditionsList extends cdktf.ComplexList { + public internalValue? : ApigApiWebPolicyConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiWebPolicyConditionsOutputReference { + return new ApigApiWebPolicyConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApiWebPolicy { + /** + * The ID of the backend custom authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#authorizer_id ApigApi#authorizer_id} + */ + readonly authorizerId?: string; + /** + * The backend service address + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#backend_address ApigApi#backend_address} + */ + readonly backendAddress?: string; + /** + * The effective mode of the backend policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#effective_mode ApigApi#effective_mode} + */ + readonly effectiveMode?: string; + /** + * The proxy host header. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#host_header ApigApi#host_header} + */ + readonly hostHeader?: string; + /** + * The name of the web policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#name ApigApi#name} + */ + readonly name: string; + /** + * The backend request address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#path ApigApi#path} + */ + readonly path: string; + /** + * The backend request method of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_method ApigApi#request_method} + */ + readonly requestMethod: string; + /** + * The backend request protocol. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#request_protocol ApigApi#request_protocol} + */ + readonly requestProtocol?: string; + /** + * The number of retry attempts to request the backend service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#retry_count ApigApi#retry_count} + */ + readonly retryCount?: number; + /** + * The timeout for API requests to backend service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#timeout ApigApi#timeout} + */ + readonly timeout?: number; + /** + * The VPC channel ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#vpc_channel_id ApigApi#vpc_channel_id} + */ + readonly vpcChannelId?: string; + /** + * backend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#backend_params ApigApi#backend_params} + */ + readonly backendParams?: ApigApiWebPolicyBackendParams[] | cdktf.IResolvable; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#conditions ApigApi#conditions} + */ + readonly conditions: ApigApiWebPolicyConditions[] | cdktf.IResolvable; +} + +export function apigApiWebPolicyToTerraform(struct?: ApigApiWebPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorizer_id: cdktf.stringToTerraform(struct!.authorizerId), + backend_address: cdktf.stringToTerraform(struct!.backendAddress), + effective_mode: cdktf.stringToTerraform(struct!.effectiveMode), + host_header: cdktf.stringToTerraform(struct!.hostHeader), + name: cdktf.stringToTerraform(struct!.name), + path: cdktf.stringToTerraform(struct!.path), + request_method: cdktf.stringToTerraform(struct!.requestMethod), + request_protocol: cdktf.stringToTerraform(struct!.requestProtocol), + retry_count: cdktf.numberToTerraform(struct!.retryCount), + timeout: cdktf.numberToTerraform(struct!.timeout), + vpc_channel_id: cdktf.stringToTerraform(struct!.vpcChannelId), + backend_params: cdktf.listMapper(apigApiWebPolicyBackendParamsToTerraform, true)(struct!.backendParams), + conditions: cdktf.listMapper(apigApiWebPolicyConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function apigApiWebPolicyToHclTerraform(struct?: ApigApiWebPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(struct!.authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_address: { + value: cdktf.stringToHclTerraform(struct!.backendAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + effective_mode: { + value: cdktf.stringToHclTerraform(struct!.effectiveMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_header: { + value: cdktf.stringToHclTerraform(struct!.hostHeader), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(struct!.requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(struct!.requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retry_count: { + value: cdktf.numberToHclTerraform(struct!.retryCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_channel_id: { + value: cdktf.stringToHclTerraform(struct!.vpcChannelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_params: { + value: cdktf.listMapperHcl(apigApiWebPolicyBackendParamsToHclTerraform, true)(struct!.backendParams), + isBlock: true, + type: "set", + storageClassType: "ApigApiWebPolicyBackendParamsList", + }, + conditions: { + value: cdktf.listMapperHcl(apigApiWebPolicyConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "set", + storageClassType: "ApigApiWebPolicyConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApiWebPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApiWebPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorizerId !== undefined) { + hasAnyValues = true; + internalValueResult.authorizerId = this._authorizerId; + } + if (this._backendAddress !== undefined) { + hasAnyValues = true; + internalValueResult.backendAddress = this._backendAddress; + } + if (this._effectiveMode !== undefined) { + hasAnyValues = true; + internalValueResult.effectiveMode = this._effectiveMode; + } + if (this._hostHeader !== undefined) { + hasAnyValues = true; + internalValueResult.hostHeader = this._hostHeader; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._requestMethod !== undefined) { + hasAnyValues = true; + internalValueResult.requestMethod = this._requestMethod; + } + if (this._requestProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.requestProtocol = this._requestProtocol; + } + if (this._retryCount !== undefined) { + hasAnyValues = true; + internalValueResult.retryCount = this._retryCount; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._vpcChannelId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcChannelId = this._vpcChannelId; + } + if (this._backendParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backendParams = this._backendParams?.internalValue; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApiWebPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._authorizerId = undefined; + this._backendAddress = undefined; + this._effectiveMode = undefined; + this._hostHeader = undefined; + this._name = undefined; + this._path = undefined; + this._requestMethod = undefined; + this._requestProtocol = undefined; + this._retryCount = undefined; + this._timeout = undefined; + this._vpcChannelId = undefined; + this._backendParams.internalValue = undefined; + this._conditions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._authorizerId = value.authorizerId; + this._backendAddress = value.backendAddress; + this._effectiveMode = value.effectiveMode; + this._hostHeader = value.hostHeader; + this._name = value.name; + this._path = value.path; + this._requestMethod = value.requestMethod; + this._requestProtocol = value.requestProtocol; + this._retryCount = value.retryCount; + this._timeout = value.timeout; + this._vpcChannelId = value.vpcChannelId; + this._backendParams.internalValue = value.backendParams; + this._conditions.internalValue = value.conditions; + } + } + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // backend_address - computed: false, optional: true, required: false + private _backendAddress?: string; + public get backendAddress() { + return this.getStringAttribute('backend_address'); + } + public set backendAddress(value: string) { + this._backendAddress = value; + } + public resetBackendAddress() { + this._backendAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendAddressInput() { + return this._backendAddress; + } + + // effective_mode - computed: false, optional: true, required: false + private _effectiveMode?: string; + public get effectiveMode() { + return this.getStringAttribute('effective_mode'); + } + public set effectiveMode(value: string) { + this._effectiveMode = value; + } + public resetEffectiveMode() { + this._effectiveMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get effectiveModeInput() { + return this._effectiveMode; + } + + // host_header - computed: false, optional: true, required: false + private _hostHeader?: string; + public get hostHeader() { + return this.getStringAttribute('host_header'); + } + public set hostHeader(value: string) { + this._hostHeader = value; + } + public resetHostHeader() { + this._hostHeader = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostHeaderInput() { + return this._hostHeader; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // request_method - computed: false, optional: false, required: true + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // retry_count - computed: false, optional: true, required: false + private _retryCount?: number; + public get retryCount() { + return this.getNumberAttribute('retry_count'); + } + public set retryCount(value: number) { + this._retryCount = value; + } + public resetRetryCount() { + this._retryCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryCountInput() { + return this._retryCount; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // vpc_channel_id - computed: false, optional: true, required: false + private _vpcChannelId?: string; + public get vpcChannelId() { + return this.getStringAttribute('vpc_channel_id'); + } + public set vpcChannelId(value: string) { + this._vpcChannelId = value; + } + public resetVpcChannelId() { + this._vpcChannelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcChannelIdInput() { + return this._vpcChannelId; + } + + // backend_params - computed: false, optional: true, required: false + private _backendParams = new ApigApiWebPolicyBackendParamsList(this, "backend_params", true); + public get backendParams() { + return this._backendParams; + } + public putBackendParams(value: ApigApiWebPolicyBackendParams[] | cdktf.IResolvable) { + this._backendParams.internalValue = value; + } + public resetBackendParams() { + this._backendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParamsInput() { + return this._backendParams.internalValue; + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new ApigApiWebPolicyConditionsList(this, "conditions", true); + public get conditions() { + return this._conditions; + } + public putConditions(value: ApigApiWebPolicyConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +export class ApigApiWebPolicyList extends cdktf.ComplexList { + public internalValue? : ApigApiWebPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApiWebPolicyOutputReference { + return new ApigApiWebPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api huaweicloud_apig_api} +*/ +export class ApigApi extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApi resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApi to import + * @param importFromId The id of the existing ApigApi that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApi to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_api huaweicloud_apig_api} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApiConfig + */ + public constructor(scope: Construct, id: string, config: ApigApiConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authorizerId = config.authorizerId; + this._bodyDescription = config.bodyDescription; + this._cors = config.cors; + this._description = config.description; + this._failureResponse = config.failureResponse; + this._groupId = config.groupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._matching = config.matching; + this._name = config.name; + this._region = config.region; + this._requestMethod = config.requestMethod; + this._requestPath = config.requestPath; + this._requestProtocol = config.requestProtocol; + this._responseId = config.responseId; + this._securityAuthentication = config.securityAuthentication; + this._simpleAuthentication = config.simpleAuthentication; + this._successResponse = config.successResponse; + this._tags = config.tags; + this._type = config.type; + this._backendParams.internalValue = config.backendParams; + this._funcGraph.internalValue = config.funcGraph; + this._funcGraphPolicy.internalValue = config.funcGraphPolicy; + this._mock.internalValue = config.mock; + this._mockPolicy.internalValue = config.mockPolicy; + this._requestParams.internalValue = config.requestParams; + this._web.internalValue = config.web; + this._webPolicy.internalValue = config.webPolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // body_description - computed: false, optional: true, required: false + private _bodyDescription?: string; + public get bodyDescription() { + return this.getStringAttribute('body_description'); + } + public set bodyDescription(value: string) { + this._bodyDescription = value; + } + public resetBodyDescription() { + this._bodyDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get bodyDescriptionInput() { + return this._bodyDescription; + } + + // cors - computed: false, optional: true, required: false + private _cors?: boolean | cdktf.IResolvable; + public get cors() { + return this.getBooleanAttribute('cors'); + } + public set cors(value: boolean | cdktf.IResolvable) { + this._cors = value; + } + public resetCors() { + this._cors = undefined; + } + // Temporarily expose input value. Use with caution. + public get corsInput() { + return this._cors; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // failure_response - computed: false, optional: true, required: false + private _failureResponse?: string; + public get failureResponse() { + return this.getStringAttribute('failure_response'); + } + public set failureResponse(value: string) { + this._failureResponse = value; + } + public resetFailureResponse() { + this._failureResponse = undefined; + } + // Temporarily expose input value. Use with caution. + public get failureResponseInput() { + return this._failureResponse; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // matching - computed: false, optional: true, required: false + private _matching?: string; + public get matching() { + return this.getStringAttribute('matching'); + } + public set matching(value: string) { + this._matching = value; + } + public resetMatching() { + this._matching = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchingInput() { + return this._matching; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // registered_at - computed: true, optional: false, required: false + public get registeredAt() { + return this.getStringAttribute('registered_at'); + } + + // request_method - computed: false, optional: false, required: true + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // request_path - computed: false, optional: false, required: true + private _requestPath?: string; + public get requestPath() { + return this.getStringAttribute('request_path'); + } + public set requestPath(value: string) { + this._requestPath = value; + } + // Temporarily expose input value. Use with caution. + public get requestPathInput() { + return this._requestPath; + } + + // request_protocol - computed: false, optional: false, required: true + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // response_id - computed: false, optional: true, required: false + private _responseId?: string; + public get responseId() { + return this.getStringAttribute('response_id'); + } + public set responseId(value: string) { + this._responseId = value; + } + public resetResponseId() { + this._responseId = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseIdInput() { + return this._responseId; + } + + // security_authentication - computed: false, optional: true, required: false + private _securityAuthentication?: string; + public get securityAuthentication() { + return this.getStringAttribute('security_authentication'); + } + public set securityAuthentication(value: string) { + this._securityAuthentication = value; + } + public resetSecurityAuthentication() { + this._securityAuthentication = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityAuthenticationInput() { + return this._securityAuthentication; + } + + // simple_authentication - computed: true, optional: true, required: false + private _simpleAuthentication?: boolean | cdktf.IResolvable; + public get simpleAuthentication() { + return this.getBooleanAttribute('simple_authentication'); + } + public set simpleAuthentication(value: boolean | cdktf.IResolvable) { + this._simpleAuthentication = value; + } + public resetSimpleAuthentication() { + this._simpleAuthentication = undefined; + } + // Temporarily expose input value. Use with caution. + public get simpleAuthenticationInput() { + return this._simpleAuthentication; + } + + // success_response - computed: false, optional: true, required: false + private _successResponse?: string; + public get successResponse() { + return this.getStringAttribute('success_response'); + } + public set successResponse(value: string) { + this._successResponse = value; + } + public resetSuccessResponse() { + this._successResponse = undefined; + } + // Temporarily expose input value. Use with caution. + public get successResponseInput() { + return this._successResponse; + } + + // tags - computed: false, optional: true, required: false + private _tags?: string[]; + public get tags() { + return cdktf.Fn.tolist(this.getListAttribute('tags')); + } + public set tags(value: string[]) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // backend_params - computed: false, optional: true, required: false + private _backendParams = new ApigApiBackendParamsList(this, "backend_params", true); + public get backendParams() { + return this._backendParams; + } + public putBackendParams(value: ApigApiBackendParams[] | cdktf.IResolvable) { + this._backendParams.internalValue = value; + } + public resetBackendParams() { + this._backendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParamsInput() { + return this._backendParams.internalValue; + } + + // func_graph - computed: false, optional: true, required: false + private _funcGraph = new ApigApiFuncGraphOutputReference(this, "func_graph"); + public get funcGraph() { + return this._funcGraph; + } + public putFuncGraph(value: ApigApiFuncGraph) { + this._funcGraph.internalValue = value; + } + public resetFuncGraph() { + this._funcGraph.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get funcGraphInput() { + return this._funcGraph.internalValue; + } + + // func_graph_policy - computed: false, optional: true, required: false + private _funcGraphPolicy = new ApigApiFuncGraphPolicyList(this, "func_graph_policy", true); + public get funcGraphPolicy() { + return this._funcGraphPolicy; + } + public putFuncGraphPolicy(value: ApigApiFuncGraphPolicy[] | cdktf.IResolvable) { + this._funcGraphPolicy.internalValue = value; + } + public resetFuncGraphPolicy() { + this._funcGraphPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get funcGraphPolicyInput() { + return this._funcGraphPolicy.internalValue; + } + + // mock - computed: false, optional: true, required: false + private _mock = new ApigApiMockOutputReference(this, "mock"); + public get mock() { + return this._mock; + } + public putMock(value: ApigApiMock) { + this._mock.internalValue = value; + } + public resetMock() { + this._mock.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mockInput() { + return this._mock.internalValue; + } + + // mock_policy - computed: false, optional: true, required: false + private _mockPolicy = new ApigApiMockPolicyList(this, "mock_policy", true); + public get mockPolicy() { + return this._mockPolicy; + } + public putMockPolicy(value: ApigApiMockPolicy[] | cdktf.IResolvable) { + this._mockPolicy.internalValue = value; + } + public resetMockPolicy() { + this._mockPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mockPolicyInput() { + return this._mockPolicy.internalValue; + } + + // request_params - computed: false, optional: true, required: false + private _requestParams = new ApigApiRequestParamsList(this, "request_params", true); + public get requestParams() { + return this._requestParams; + } + public putRequestParams(value: ApigApiRequestParams[] | cdktf.IResolvable) { + this._requestParams.internalValue = value; + } + public resetRequestParams() { + this._requestParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestParamsInput() { + return this._requestParams.internalValue; + } + + // web - computed: false, optional: true, required: false + private _web = new ApigApiWebOutputReference(this, "web"); + public get web() { + return this._web; + } + public putWeb(value: ApigApiWeb) { + this._web.internalValue = value; + } + public resetWeb() { + this._web.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get webInput() { + return this._web.internalValue; + } + + // web_policy - computed: false, optional: true, required: false + private _webPolicy = new ApigApiWebPolicyList(this, "web_policy", true); + public get webPolicy() { + return this._webPolicy; + } + public putWebPolicy(value: ApigApiWebPolicy[] | cdktf.IResolvable) { + this._webPolicy.internalValue = value; + } + public resetWebPolicy() { + this._webPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get webPolicyInput() { + return this._webPolicy.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + authorizer_id: cdktf.stringToTerraform(this._authorizerId), + body_description: cdktf.stringToTerraform(this._bodyDescription), + cors: cdktf.booleanToTerraform(this._cors), + description: cdktf.stringToTerraform(this._description), + failure_response: cdktf.stringToTerraform(this._failureResponse), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + matching: cdktf.stringToTerraform(this._matching), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + request_method: cdktf.stringToTerraform(this._requestMethod), + request_path: cdktf.stringToTerraform(this._requestPath), + request_protocol: cdktf.stringToTerraform(this._requestProtocol), + response_id: cdktf.stringToTerraform(this._responseId), + security_authentication: cdktf.stringToTerraform(this._securityAuthentication), + simple_authentication: cdktf.booleanToTerraform(this._simpleAuthentication), + success_response: cdktf.stringToTerraform(this._successResponse), + tags: cdktf.listMapper(cdktf.stringToTerraform, false)(this._tags), + type: cdktf.stringToTerraform(this._type), + backend_params: cdktf.listMapper(apigApiBackendParamsToTerraform, true)(this._backendParams.internalValue), + func_graph: apigApiFuncGraphToTerraform(this._funcGraph.internalValue), + func_graph_policy: cdktf.listMapper(apigApiFuncGraphPolicyToTerraform, true)(this._funcGraphPolicy.internalValue), + mock: apigApiMockToTerraform(this._mock.internalValue), + mock_policy: cdktf.listMapper(apigApiMockPolicyToTerraform, true)(this._mockPolicy.internalValue), + request_params: cdktf.listMapper(apigApiRequestParamsToTerraform, true)(this._requestParams.internalValue), + web: apigApiWebToTerraform(this._web.internalValue), + web_policy: cdktf.listMapper(apigApiWebPolicyToTerraform, true)(this._webPolicy.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(this._authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + body_description: { + value: cdktf.stringToHclTerraform(this._bodyDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cors: { + value: cdktf.booleanToHclTerraform(this._cors), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + failure_response: { + value: cdktf.stringToHclTerraform(this._failureResponse), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + matching: { + value: cdktf.stringToHclTerraform(this._matching), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(this._requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_path: { + value: cdktf.stringToHclTerraform(this._requestPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(this._requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_id: { + value: cdktf.stringToHclTerraform(this._responseId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_authentication: { + value: cdktf.stringToHclTerraform(this._securityAuthentication), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + simple_authentication: { + value: cdktf.booleanToHclTerraform(this._simpleAuthentication), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + success_response: { + value: cdktf.stringToHclTerraform(this._successResponse), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._tags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_params: { + value: cdktf.listMapperHcl(apigApiBackendParamsToHclTerraform, true)(this._backendParams.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigApiBackendParamsList", + }, + func_graph: { + value: apigApiFuncGraphToHclTerraform(this._funcGraph.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApigApiFuncGraphList", + }, + func_graph_policy: { + value: cdktf.listMapperHcl(apigApiFuncGraphPolicyToHclTerraform, true)(this._funcGraphPolicy.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigApiFuncGraphPolicyList", + }, + mock: { + value: apigApiMockToHclTerraform(this._mock.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApigApiMockList", + }, + mock_policy: { + value: cdktf.listMapperHcl(apigApiMockPolicyToHclTerraform, true)(this._mockPolicy.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigApiMockPolicyList", + }, + request_params: { + value: cdktf.listMapperHcl(apigApiRequestParamsToHclTerraform, true)(this._requestParams.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigApiRequestParamsList", + }, + web: { + value: apigApiWebToHclTerraform(this._web.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApigApiWebList", + }, + web_policy: { + value: cdktf.listMapperHcl(apigApiWebPolicyToHclTerraform, true)(this._webPolicy.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigApiWebPolicyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-appcode/README.md b/src/constructs/providers/huaweicloud/apig-appcode/README.md new file mode 100644 index 00000000..7a8e3b88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-appcode/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_appcode` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_appcode`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode). diff --git a/src/constructs/providers/huaweicloud/apig-appcode/index.ts b/src/constructs/providers/huaweicloud/apig-appcode/index.ts new file mode 100644 index 00000000..3503f1c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-appcode/index.ts @@ -0,0 +1,235 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigAppcodeConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application to which the APPCODE belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode#application_id ApigAppcode#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode#id ApigAppcode#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application and APPCODE belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode#instance_id ApigAppcode#instance_id} + */ + readonly instanceId: string; + /** + * The region where the application and APPCODE are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode#region ApigAppcode#region} + */ + readonly region?: string; + /** + * The APPCODE value (content). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode#value ApigAppcode#value} + */ + readonly value?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode huaweicloud_apig_appcode} +*/ +export class ApigAppcode extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_appcode"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigAppcode resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigAppcode to import + * @param importFromId The id of the existing ApigAppcode that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigAppcode to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_appcode", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_appcode huaweicloud_apig_appcode} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigAppcodeConfig + */ + public constructor(scope: Construct, id: string, config: ApigAppcodeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_appcode', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._value = config.value; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + value: cdktf.stringToTerraform(this._value), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-application-acl/README.md b/src/constructs/providers/huaweicloud/apig-application-acl/README.md new file mode 100644 index 00000000..accf2865 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_application_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_application_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl). diff --git a/src/constructs/providers/huaweicloud/apig-application-acl/index.ts b/src/constructs/providers/huaweicloud/apig-application-acl/index.ts new file mode 100644 index 00000000..694fa708 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-acl/index.ts @@ -0,0 +1,254 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApplicationAclConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application to which the ACL rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#application_id ApigApplicationAcl#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#id ApigApplicationAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#instance_id ApigApplicationAcl#instance_id} + */ + readonly instanceId: string; + /** + * The region where the application and ACL rules are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#region ApigApplicationAcl#region} + */ + readonly region?: string; + /** + * The ACL type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#type ApigApplicationAcl#type} + */ + readonly type: string; + /** + * The ACL values. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#values ApigApplicationAcl#values} + */ + readonly values: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl huaweicloud_apig_application_acl} +*/ +export class ApigApplicationAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApplicationAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApplicationAcl to import + * @param importFromId The id of the existing ApigApplicationAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApplicationAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_acl huaweicloud_apig_application_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApplicationAclConfig + */ + public constructor(scope: Construct, id: string, config: ApigApplicationAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._type = config.type; + this._values = config.values; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(this._values), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-application-authorization/README.md b/src/constructs/providers/huaweicloud/apig-application-authorization/README.md new file mode 100644 index 00000000..26613b62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_application_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_application_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization). diff --git a/src/constructs/providers/huaweicloud/apig-application-authorization/index.ts b/src/constructs/providers/huaweicloud/apig-application-authorization/index.ts new file mode 100644 index 00000000..f4c2742e --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-authorization/index.ts @@ -0,0 +1,444 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApplicationAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * The authorized API IDs + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#api_ids ApigApplicationAuthorization#api_ids} + */ + readonly apiIds: string[]; + /** + * The ID of the application authorized to access the APIs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#application_id ApigApplicationAuthorization#application_id} + */ + readonly applicationId: string; + /** + * The environment ID where the APIs were published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#env_id ApigApplicationAuthorization#env_id} + */ + readonly envId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#id ApigApplicationAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application and APIs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#instance_id ApigApplicationAuthorization#instance_id} + */ + readonly instanceId: string; + /** + * The region where the application and APPCODEs are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#region ApigApplicationAuthorization#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#timeouts ApigApplicationAuthorization#timeouts} + */ + readonly timeouts?: ApigApplicationAuthorizationTimeouts; +} +export interface ApigApplicationAuthorizationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#create ApigApplicationAuthorization#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#delete ApigApplicationAuthorization#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#update ApigApplicationAuthorization#update} + */ + readonly update?: string; +} + +export function apigApplicationAuthorizationTimeoutsToTerraform(struct?: ApigApplicationAuthorizationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigApplicationAuthorizationTimeoutsToHclTerraform(struct?: ApigApplicationAuthorizationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApplicationAuthorizationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigApplicationAuthorizationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApplicationAuthorizationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization huaweicloud_apig_application_authorization} +*/ +export class ApigApplicationAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApplicationAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApplicationAuthorization to import + * @param importFromId The id of the existing ApigApplicationAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApplicationAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_authorization huaweicloud_apig_application_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApplicationAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: ApigApplicationAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiIds = config.apiIds; + this._applicationId = config.applicationId; + this._envId = config.envId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_ids - computed: false, optional: false, required: true + private _apiIds?: string[]; + public get apiIds() { + return cdktf.Fn.tolist(this.getListAttribute('api_ids')); + } + public set apiIds(value: string[]) { + this._apiIds = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdsInput() { + return this._apiIds; + } + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // env_id - computed: false, optional: false, required: true + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigApplicationAuthorizationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigApplicationAuthorizationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._apiIds), + application_id: cdktf.stringToTerraform(this._applicationId), + env_id: cdktf.stringToTerraform(this._envId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: apigApplicationAuthorizationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._apiIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apigApplicationAuthorizationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigApplicationAuthorizationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-application-quota-associate/README.md b/src/constructs/providers/huaweicloud/apig-application-quota-associate/README.md new file mode 100644 index 00000000..b6cf8284 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-quota-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_application_quota_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_application_quota_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate). diff --git a/src/constructs/providers/huaweicloud/apig-application-quota-associate/index.ts b/src/constructs/providers/huaweicloud/apig-application-quota-associate/index.ts new file mode 100644 index 00000000..f9fcee9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-quota-associate/index.ts @@ -0,0 +1,540 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApplicationQuotaAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#id ApigApplicationQuotaAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application quota (policy) belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#instance_id ApigApplicationQuotaAssociate#instance_id} + */ + readonly instanceId: string; + /** + * The ID of the application quota (policy). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#quota_id ApigApplicationQuotaAssociate#quota_id} + */ + readonly quotaId: string; + /** + * The region where the application quota (policy) is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#region ApigApplicationQuotaAssociate#region} + */ + readonly region?: string; + /** + * applications block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#applications ApigApplicationQuotaAssociate#applications} + */ + readonly applications: ApigApplicationQuotaAssociateApplications[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#timeouts ApigApplicationQuotaAssociate#timeouts} + */ + readonly timeouts?: ApigApplicationQuotaAssociateTimeouts; +} +export interface ApigApplicationQuotaAssociateApplications { + /** + * The application ID bound to the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#id ApigApplicationQuotaAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function apigApplicationQuotaAssociateApplicationsToTerraform(struct?: ApigApplicationQuotaAssociateApplications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function apigApplicationQuotaAssociateApplicationsToHclTerraform(struct?: ApigApplicationQuotaAssociateApplications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApplicationQuotaAssociateApplicationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigApplicationQuotaAssociateApplications | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApplicationQuotaAssociateApplications | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + } + } + + // bind_time - computed: true, optional: false, required: false + public get bindTime() { + return this.getStringAttribute('bind_time'); + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } +} + +export class ApigApplicationQuotaAssociateApplicationsList extends cdktf.ComplexList { + public internalValue? : ApigApplicationQuotaAssociateApplications[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigApplicationQuotaAssociateApplicationsOutputReference { + return new ApigApplicationQuotaAssociateApplicationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigApplicationQuotaAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#create ApigApplicationQuotaAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#delete ApigApplicationQuotaAssociate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#update ApigApplicationQuotaAssociate#update} + */ + readonly update?: string; +} + +export function apigApplicationQuotaAssociateTimeoutsToTerraform(struct?: ApigApplicationQuotaAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigApplicationQuotaAssociateTimeoutsToHclTerraform(struct?: ApigApplicationQuotaAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigApplicationQuotaAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigApplicationQuotaAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigApplicationQuotaAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate huaweicloud_apig_application_quota_associate} +*/ +export class ApigApplicationQuotaAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application_quota_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApplicationQuotaAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApplicationQuotaAssociate to import + * @param importFromId The id of the existing ApigApplicationQuotaAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApplicationQuotaAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application_quota_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota_associate huaweicloud_apig_application_quota_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApplicationQuotaAssociateConfig + */ + public constructor(scope: Construct, id: string, config: ApigApplicationQuotaAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application_quota_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._quotaId = config.quotaId; + this._region = config.region; + this._applications.internalValue = config.applications; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // quota_id - computed: false, optional: false, required: true + private _quotaId?: string; + public get quotaId() { + return this.getStringAttribute('quota_id'); + } + public set quotaId(value: string) { + this._quotaId = value; + } + // Temporarily expose input value. Use with caution. + public get quotaIdInput() { + return this._quotaId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // applications - computed: false, optional: false, required: true + private _applications = new ApigApplicationQuotaAssociateApplicationsList(this, "applications", true); + public get applications() { + return this._applications; + } + public putApplications(value: ApigApplicationQuotaAssociateApplications[] | cdktf.IResolvable) { + this._applications.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get applicationsInput() { + return this._applications.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigApplicationQuotaAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigApplicationQuotaAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + quota_id: cdktf.stringToTerraform(this._quotaId), + region: cdktf.stringToTerraform(this._region), + applications: cdktf.listMapper(apigApplicationQuotaAssociateApplicationsToTerraform, true)(this._applications.internalValue), + timeouts: apigApplicationQuotaAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quota_id: { + value: cdktf.stringToHclTerraform(this._quotaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + applications: { + value: cdktf.listMapperHcl(apigApplicationQuotaAssociateApplicationsToHclTerraform, true)(this._applications.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigApplicationQuotaAssociateApplicationsList", + }, + timeouts: { + value: apigApplicationQuotaAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigApplicationQuotaAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-application-quota/README.md b/src/constructs/providers/huaweicloud/apig-application-quota/README.md new file mode 100644 index 00000000..9410472b --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-quota/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_application_quota` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_application_quota`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota). diff --git a/src/constructs/providers/huaweicloud/apig-application-quota/index.ts b/src/constructs/providers/huaweicloud/apig-application-quota/index.ts new file mode 100644 index 00000000..7234ba48 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application-quota/index.ts @@ -0,0 +1,319 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApplicationQuotaConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the access limit of the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#call_limits ApigApplicationQuota#call_limits} + */ + readonly callLimits: number; + /** + * Specifies the description of the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#description ApigApplicationQuota#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#id ApigApplicationQuota#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the application quota belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#instance_id ApigApplicationQuota#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#name ApigApplicationQuota#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#region ApigApplicationQuota#region} + */ + readonly region?: string; + /** + * Specifies the limited time value for flow control of the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#time_interval ApigApplicationQuota#time_interval} + */ + readonly timeInterval: number; + /** + * Specifies the limited time unit of the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#time_unit ApigApplicationQuota#time_unit} + */ + readonly timeUnit: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota huaweicloud_apig_application_quota} +*/ +export class ApigApplicationQuota extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application_quota"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApplicationQuota resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApplicationQuota to import + * @param importFromId The id of the existing ApigApplicationQuota that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApplicationQuota to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application_quota", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application_quota huaweicloud_apig_application_quota} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApplicationQuotaConfig + */ + public constructor(scope: Construct, id: string, config: ApigApplicationQuotaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application_quota', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._callLimits = config.callLimits; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeInterval = config.timeInterval; + this._timeUnit = config.timeUnit; + } + + // ========== + // ATTRIBUTES + // ========== + + // bind_num - computed: true, optional: false, required: false + public get bindNum() { + return this.getNumberAttribute('bind_num'); + } + + // call_limits - computed: false, optional: false, required: true + private _callLimits?: number; + public get callLimits() { + return this.getNumberAttribute('call_limits'); + } + public set callLimits(value: number) { + this._callLimits = value; + } + // Temporarily expose input value. Use with caution. + public get callLimitsInput() { + return this._callLimits; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // time_interval - computed: false, optional: false, required: true + private _timeInterval?: number; + public get timeInterval() { + return this.getNumberAttribute('time_interval'); + } + public set timeInterval(value: number) { + this._timeInterval = value; + } + // Temporarily expose input value. Use with caution. + public get timeIntervalInput() { + return this._timeInterval; + } + + // time_unit - computed: false, optional: false, required: true + private _timeUnit?: string; + public get timeUnit() { + return this.getStringAttribute('time_unit'); + } + public set timeUnit(value: string) { + this._timeUnit = value; + } + // Temporarily expose input value. Use with caution. + public get timeUnitInput() { + return this._timeUnit; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + call_limits: cdktf.numberToTerraform(this._callLimits), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + time_interval: cdktf.numberToTerraform(this._timeInterval), + time_unit: cdktf.stringToTerraform(this._timeUnit), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + call_limits: { + value: cdktf.numberToHclTerraform(this._callLimits), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_interval: { + value: cdktf.numberToHclTerraform(this._timeInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_unit: { + value: cdktf.stringToHclTerraform(this._timeUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-application/README.md b/src/constructs/providers/huaweicloud/apig-application/README.md new file mode 100644 index 00000000..4c792890 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application). diff --git a/src/constructs/providers/huaweicloud/apig-application/index.ts b/src/constructs/providers/huaweicloud/apig-application/index.ts new file mode 100644 index 00000000..1e9e9363 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-application/index.ts @@ -0,0 +1,310 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * The array of one or more application codes that the application has. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#app_codes ApigApplication#app_codes} + */ + readonly appCodes?: string[]; + /** + * The application description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#description ApigApplication#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#id ApigApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#instance_id ApigApplication#instance_id} + */ + readonly instanceId: string; + /** + * The application name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#name ApigApplication#name} + */ + readonly name: string; + /** + * The region where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#region ApigApplication#region} + */ + readonly region?: string; + /** + * The secret action to be done for the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#secret_action ApigApplication#secret_action} + */ + readonly secretAction?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application huaweicloud_apig_application} +*/ +export class ApigApplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigApplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigApplication to import + * @param importFromId The id of the existing ApigApplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigApplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_application huaweicloud_apig_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigApplicationConfig + */ + public constructor(scope: Construct, id: string, config: ApigApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appCodes = config.appCodes; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._secretAction = config.secretAction; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_codes - computed: true, optional: true, required: false + private _appCodes?: string[]; + public get appCodes() { + return cdktf.Fn.tolist(this.getListAttribute('app_codes')); + } + public set appCodes(value: string[]) { + this._appCodes = value; + } + public resetAppCodes() { + this._appCodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get appCodesInput() { + return this._appCodes; + } + + // app_key - computed: true, optional: false, required: false + public get appKey() { + return this.getStringAttribute('app_key'); + } + + // app_secret - computed: true, optional: false, required: false + public get appSecret() { + return this.getStringAttribute('app_secret'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // registration_time - computed: true, optional: false, required: false + public get registrationTime() { + return this.getStringAttribute('registration_time'); + } + + // secret_action - computed: false, optional: true, required: false + private _secretAction?: string; + public get secretAction() { + return this.getStringAttribute('secret_action'); + } + public set secretAction(value: string) { + this._secretAction = value; + } + public resetSecretAction() { + this._secretAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretActionInput() { + return this._secretAction; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_codes: cdktf.listMapper(cdktf.stringToTerraform, false)(this._appCodes), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secret_action: cdktf.stringToTerraform(this._secretAction), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_codes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._appCodes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_action: { + value: cdktf.stringToHclTerraform(this._secretAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-certificate/README.md b/src/constructs/providers/huaweicloud/apig-certificate/README.md new file mode 100644 index 00000000..a5bf8ef0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate). diff --git a/src/constructs/providers/huaweicloud/apig-certificate/index.ts b/src/constructs/providers/huaweicloud/apig-certificate/index.ts new file mode 100644 index 00000000..0c9e5894 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-certificate/index.ts @@ -0,0 +1,337 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * The certificate content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#content ApigCertificate#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#id ApigCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The dedicated instance ID to which the certificate belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#instance_id ApigCertificate#instance_id} + */ + readonly instanceId?: string; + /** + * The certificate name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#name ApigCertificate#name} + */ + readonly name: string; + /** + * The private key of the certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#private_key ApigCertificate#private_key} + */ + readonly privateKey: string; + /** + * The region where the certificate is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#region ApigCertificate#region} + */ + readonly region?: string; + /** + * The trusted root CA certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#trusted_root_ca ApigCertificate#trusted_root_ca} + */ + readonly trustedRootCa?: string; + /** + * The certificate type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#type ApigCertificate#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate huaweicloud_apig_certificate} +*/ +export class ApigCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigCertificate to import + * @param importFromId The id of the existing ApigCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_certificate huaweicloud_apig_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigCertificateConfig + */ + public constructor(scope: Construct, id: string, config: ApigCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._trustedRootCa = config.trustedRootCa; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // effected_at - computed: true, optional: false, required: false + public get effectedAt() { + return this.getStringAttribute('effected_at'); + } + + // expires_at - computed: true, optional: false, required: false + public get expiresAt() { + return this.getStringAttribute('expires_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: false, required: true + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sans - computed: true, optional: false, required: false + public get sans() { + return this.getListAttribute('sans'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // trusted_root_ca - computed: false, optional: true, required: false + private _trustedRootCa?: string; + public get trustedRootCa() { + return this.getStringAttribute('trusted_root_ca'); + } + public set trustedRootCa(value: string) { + this._trustedRootCa = value; + } + public resetTrustedRootCa() { + this._trustedRootCa = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustedRootCaInput() { + return this._trustedRootCa; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + trusted_root_ca: cdktf.stringToTerraform(this._trustedRootCa), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trusted_root_ca: { + value: cdktf.stringToHclTerraform(this._trustedRootCa), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-channel/README.md b/src/constructs/providers/huaweicloud/apig-channel/README.md new file mode 100644 index 00000000..d13c43cb --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-channel/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_channel` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_channel`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel). diff --git a/src/constructs/providers/huaweicloud/apig-channel/index.ts b/src/constructs/providers/huaweicloud/apig-channel/index.ts new file mode 100644 index 00000000..724a82d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-channel/index.ts @@ -0,0 +1,2009 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigChannelConfig extends cdktf.TerraformMetaArguments { + /** + * The distribution algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#balance_strategy ApigChannel#balance_strategy} + */ + readonly balanceStrategy: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#id ApigChannel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the channel belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#instance_id ApigChannel#instance_id} + */ + readonly instanceId: string; + /** + * The member type of the channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#member_type ApigChannel#member_type} + */ + readonly memberType?: string; + /** + * The channel name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#name ApigChannel#name} + */ + readonly name: string; + /** + * The default port for health check in channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#port ApigChannel#port} + */ + readonly port: number; + /** + * The region where the dedicated instance is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#region ApigChannel#region} + */ + readonly region?: string; + /** + * The type of the channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#type ApigChannel#type} + */ + readonly type?: number; + /** + * health_check block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#health_check ApigChannel#health_check} + */ + readonly healthCheck?: ApigChannelHealthCheck; + /** + * member block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#member ApigChannel#member} + */ + readonly member?: ApigChannelMember[] | cdktf.IResolvable; + /** + * member_group block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#member_group ApigChannel#member_group} + */ + readonly memberGroup?: ApigChannelMemberGroup[] | cdktf.IResolvable; + /** + * microservice block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#microservice ApigChannel#microservice} + */ + readonly microservice?: ApigChannelMicroservice; +} +export interface ApigChannelHealthCheck { + /** + * Whether to enable two-way authentication. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#enable_client_ssl ApigChannel#enable_client_ssl} + */ + readonly enableClientSsl?: boolean | cdktf.IResolvable; + /** + * The response codes for determining a successful HTTP response. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#http_codes ApigChannel#http_codes} + */ + readonly httpCodes?: string; + /** + * The interval between consecutive check, in second. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#interval ApigChannel#interval} + */ + readonly interval: number; + /** + * The request method for health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#method ApigChannel#method} + */ + readonly method?: string; + /** + * The destination path for health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#path ApigChannel#path} + */ + readonly path?: string; + /** + * The destination host port for health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#port ApigChannel#port} + */ + readonly port?: number; + /** + * The rotocol for performing health check on backend servers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#protocol ApigChannel#protocol} + */ + readonly protocol: string; + /** + * The status of health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#status ApigChannel#status} + */ + readonly status?: number; + /** + * The unhealthy threshold, which refers to the number of consecutive failed check required for a backend server to be considered unhealthy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#threshold_abnormal ApigChannel#threshold_abnormal} + */ + readonly thresholdAbnormal: number; + /** + * The the healthy threshold, which refers to the number of consecutive successful checks required for a backend server to be considered healthy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#threshold_normal ApigChannel#threshold_normal} + */ + readonly thresholdNormal: number; + /** + * The timeout for determining whether a health check fails, in second. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#timeout ApigChannel#timeout} + */ + readonly timeout: number; +} + +export function apigChannelHealthCheckToTerraform(struct?: ApigChannelHealthCheckOutputReference | ApigChannelHealthCheck): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable_client_ssl: cdktf.booleanToTerraform(struct!.enableClientSsl), + http_codes: cdktf.stringToTerraform(struct!.httpCodes), + interval: cdktf.numberToTerraform(struct!.interval), + method: cdktf.stringToTerraform(struct!.method), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + protocol: cdktf.stringToTerraform(struct!.protocol), + status: cdktf.numberToTerraform(struct!.status), + threshold_abnormal: cdktf.numberToTerraform(struct!.thresholdAbnormal), + threshold_normal: cdktf.numberToTerraform(struct!.thresholdNormal), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function apigChannelHealthCheckToHclTerraform(struct?: ApigChannelHealthCheckOutputReference | ApigChannelHealthCheck): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable_client_ssl: { + value: cdktf.booleanToHclTerraform(struct!.enableClientSsl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + http_codes: { + value: cdktf.stringToHclTerraform(struct!.httpCodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + method: { + value: cdktf.stringToHclTerraform(struct!.method), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(struct!.status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + threshold_abnormal: { + value: cdktf.numberToHclTerraform(struct!.thresholdAbnormal), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + threshold_normal: { + value: cdktf.numberToHclTerraform(struct!.thresholdNormal), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigChannelHealthCheckOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigChannelHealthCheck | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enableClientSsl !== undefined) { + hasAnyValues = true; + internalValueResult.enableClientSsl = this._enableClientSsl; + } + if (this._httpCodes !== undefined) { + hasAnyValues = true; + internalValueResult.httpCodes = this._httpCodes; + } + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._method !== undefined) { + hasAnyValues = true; + internalValueResult.method = this._method; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._status !== undefined) { + hasAnyValues = true; + internalValueResult.status = this._status; + } + if (this._thresholdAbnormal !== undefined) { + hasAnyValues = true; + internalValueResult.thresholdAbnormal = this._thresholdAbnormal; + } + if (this._thresholdNormal !== undefined) { + hasAnyValues = true; + internalValueResult.thresholdNormal = this._thresholdNormal; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigChannelHealthCheck | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enableClientSsl = undefined; + this._httpCodes = undefined; + this._interval = undefined; + this._method = undefined; + this._path = undefined; + this._port = undefined; + this._protocol = undefined; + this._status = undefined; + this._thresholdAbnormal = undefined; + this._thresholdNormal = undefined; + this._timeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enableClientSsl = value.enableClientSsl; + this._httpCodes = value.httpCodes; + this._interval = value.interval; + this._method = value.method; + this._path = value.path; + this._port = value.port; + this._protocol = value.protocol; + this._status = value.status; + this._thresholdAbnormal = value.thresholdAbnormal; + this._thresholdNormal = value.thresholdNormal; + this._timeout = value.timeout; + } + } + + // enable_client_ssl - computed: true, optional: true, required: false + private _enableClientSsl?: boolean | cdktf.IResolvable; + public get enableClientSsl() { + return this.getBooleanAttribute('enable_client_ssl'); + } + public set enableClientSsl(value: boolean | cdktf.IResolvable) { + this._enableClientSsl = value; + } + public resetEnableClientSsl() { + this._enableClientSsl = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableClientSslInput() { + return this._enableClientSsl; + } + + // http_codes - computed: true, optional: true, required: false + private _httpCodes?: string; + public get httpCodes() { + return this.getStringAttribute('http_codes'); + } + public set httpCodes(value: string) { + this._httpCodes = value; + } + public resetHttpCodes() { + this._httpCodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCodesInput() { + return this._httpCodes; + } + + // interval - computed: false, optional: false, required: true + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // method - computed: true, optional: true, required: false + private _method?: string; + public get method() { + return this.getStringAttribute('method'); + } + public set method(value: string) { + this._method = value; + } + public resetMethod() { + this._method = undefined; + } + // Temporarily expose input value. Use with caution. + public get methodInput() { + return this._method; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // status - computed: true, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // threshold_abnormal - computed: false, optional: false, required: true + private _thresholdAbnormal?: number; + public get thresholdAbnormal() { + return this.getNumberAttribute('threshold_abnormal'); + } + public set thresholdAbnormal(value: number) { + this._thresholdAbnormal = value; + } + // Temporarily expose input value. Use with caution. + public get thresholdAbnormalInput() { + return this._thresholdAbnormal; + } + + // threshold_normal - computed: false, optional: false, required: true + private _thresholdNormal?: number; + public get thresholdNormal() { + return this.getNumberAttribute('threshold_normal'); + } + public set thresholdNormal(value: number) { + this._thresholdNormal = value; + } + // Temporarily expose input value. Use with caution. + public get thresholdNormalInput() { + return this._thresholdNormal; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} +export interface ApigChannelMember { + /** + * The group name of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#group_name ApigChannel#group_name} + */ + readonly groupName?: string; + /** + * The IP address of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#host ApigChannel#host} + */ + readonly host?: string; + /** + * The ID of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#id ApigChannel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether this member is the backup member. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#is_backup ApigChannel#is_backup} + */ + readonly isBackup?: boolean | cdktf.IResolvable; + /** + * The name of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#name ApigChannel#name} + */ + readonly name?: string; + /** + * The port of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#port ApigChannel#port} + */ + readonly port?: number; + /** + * The status of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#status ApigChannel#status} + */ + readonly status?: number; + /** + * The weight of current backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#weight ApigChannel#weight} + */ + readonly weight?: number; +} + +export function apigChannelMemberToTerraform(struct?: ApigChannelMember | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_name: cdktf.stringToTerraform(struct!.groupName), + host: cdktf.stringToTerraform(struct!.host), + id: cdktf.stringToTerraform(struct!.id), + is_backup: cdktf.booleanToTerraform(struct!.isBackup), + name: cdktf.stringToTerraform(struct!.name), + port: cdktf.numberToTerraform(struct!.port), + status: cdktf.numberToTerraform(struct!.status), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function apigChannelMemberToHclTerraform(struct?: ApigChannelMember | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_backup: { + value: cdktf.booleanToHclTerraform(struct!.isBackup), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.numberToHclTerraform(struct!.status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigChannelMemberOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigChannelMember | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._isBackup !== undefined) { + hasAnyValues = true; + internalValueResult.isBackup = this._isBackup; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._status !== undefined) { + hasAnyValues = true; + internalValueResult.status = this._status; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigChannelMember | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._groupName = undefined; + this._host = undefined; + this._id = undefined; + this._isBackup = undefined; + this._name = undefined; + this._port = undefined; + this._status = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._groupName = value.groupName; + this._host = value.host; + this._id = value.id; + this._isBackup = value.isBackup; + this._name = value.name; + this._port = value.port; + this._status = value.status; + this._weight = value.weight; + } + } + + // group_name - computed: true, optional: true, required: false + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + public resetGroupName() { + this._groupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_backup - computed: true, optional: true, required: false + private _isBackup?: boolean | cdktf.IResolvable; + public get isBackup() { + return this.getBooleanAttribute('is_backup'); + } + public set isBackup(value: boolean | cdktf.IResolvable) { + this._isBackup = value; + } + public resetIsBackup() { + this._isBackup = undefined; + } + // Temporarily expose input value. Use with caution. + public get isBackupInput() { + return this._isBackup; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // status - computed: true, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class ApigChannelMemberList extends cdktf.ComplexList { + public internalValue? : ApigChannelMember[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigChannelMemberOutputReference { + return new ApigChannelMemberOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigChannelMemberGroup { + /** + * The description of the member group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#description ApigChannel#description} + */ + readonly description?: string; + /** + * The microservice tags of the backend server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#microservice_labels ApigChannel#microservice_labels} + */ + readonly microserviceLabels?: { [key: string]: string }; + /** + * The microservice port of the backend server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#microservice_port ApigChannel#microservice_port} + */ + readonly microservicePort?: number; + /** + * The microservice version of the backend server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#microservice_version ApigChannel#microservice_version} + */ + readonly microserviceVersion?: string; + /** + * The name of the member group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#name ApigChannel#name} + */ + readonly name: string; + /** + * The weight of the current member group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#weight ApigChannel#weight} + */ + readonly weight?: number; +} + +export function apigChannelMemberGroupToTerraform(struct?: ApigChannelMemberGroup | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + microservice_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.microserviceLabels), + microservice_port: cdktf.numberToTerraform(struct!.microservicePort), + microservice_version: cdktf.stringToTerraform(struct!.microserviceVersion), + name: cdktf.stringToTerraform(struct!.name), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function apigChannelMemberGroupToHclTerraform(struct?: ApigChannelMemberGroup | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + microservice_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.microserviceLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + microservice_port: { + value: cdktf.numberToHclTerraform(struct!.microservicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + microservice_version: { + value: cdktf.stringToHclTerraform(struct!.microserviceVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigChannelMemberGroupOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigChannelMemberGroup | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._microserviceLabels !== undefined) { + hasAnyValues = true; + internalValueResult.microserviceLabels = this._microserviceLabels; + } + if (this._microservicePort !== undefined) { + hasAnyValues = true; + internalValueResult.microservicePort = this._microservicePort; + } + if (this._microserviceVersion !== undefined) { + hasAnyValues = true; + internalValueResult.microserviceVersion = this._microserviceVersion; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigChannelMemberGroup | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._microserviceLabels = undefined; + this._microservicePort = undefined; + this._microserviceVersion = undefined; + this._name = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._microserviceLabels = value.microserviceLabels; + this._microservicePort = value.microservicePort; + this._microserviceVersion = value.microserviceVersion; + this._name = value.name; + this._weight = value.weight; + } + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // microservice_labels - computed: true, optional: true, required: false + private _microserviceLabels?: { [key: string]: string }; + public get microserviceLabels() { + return this.getStringMapAttribute('microservice_labels'); + } + public set microserviceLabels(value: { [key: string]: string }) { + this._microserviceLabels = value; + } + public resetMicroserviceLabels() { + this._microserviceLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get microserviceLabelsInput() { + return this._microserviceLabels; + } + + // microservice_port - computed: true, optional: true, required: false + private _microservicePort?: number; + public get microservicePort() { + return this.getNumberAttribute('microservice_port'); + } + public set microservicePort(value: number) { + this._microservicePort = value; + } + public resetMicroservicePort() { + this._microservicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get microservicePortInput() { + return this._microservicePort; + } + + // microservice_version - computed: true, optional: true, required: false + private _microserviceVersion?: string; + public get microserviceVersion() { + return this.getStringAttribute('microservice_version'); + } + public set microserviceVersion(value: string) { + this._microserviceVersion = value; + } + public resetMicroserviceVersion() { + this._microserviceVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get microserviceVersionInput() { + return this._microserviceVersion; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class ApigChannelMemberGroupList extends cdktf.ComplexList { + public internalValue? : ApigChannelMemberGroup[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigChannelMemberGroupOutputReference { + return new ApigChannelMemberGroupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigChannelMicroserviceCceConfig { + /** + * The ID of the CCE cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#cluster_id ApigChannel#cluster_id} + */ + readonly clusterId: string; + /** + * The service label key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#label_key ApigChannel#label_key} + */ + readonly labelKey?: string; + /** + * The service label value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#label_value ApigChannel#label_value} + */ + readonly labelValue?: string; + /** + * The name of the CCE namespace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#namespace ApigChannel#namespace} + */ + readonly namespace: string; + /** + * The workload name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#workload_name ApigChannel#workload_name} + */ + readonly workloadName?: string; + /** + * The workload type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#workload_type ApigChannel#workload_type} + */ + readonly workloadType: string; +} + +export function apigChannelMicroserviceCceConfigToTerraform(struct?: ApigChannelMicroserviceCceConfigOutputReference | ApigChannelMicroserviceCceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cluster_id: cdktf.stringToTerraform(struct!.clusterId), + label_key: cdktf.stringToTerraform(struct!.labelKey), + label_value: cdktf.stringToTerraform(struct!.labelValue), + namespace: cdktf.stringToTerraform(struct!.namespace), + workload_name: cdktf.stringToTerraform(struct!.workloadName), + workload_type: cdktf.stringToTerraform(struct!.workloadType), + } +} + + +export function apigChannelMicroserviceCceConfigToHclTerraform(struct?: ApigChannelMicroserviceCceConfigOutputReference | ApigChannelMicroserviceCceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(struct!.clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + label_key: { + value: cdktf.stringToHclTerraform(struct!.labelKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + label_value: { + value: cdktf.stringToHclTerraform(struct!.labelValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(struct!.namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workload_name: { + value: cdktf.stringToHclTerraform(struct!.workloadName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workload_type: { + value: cdktf.stringToHclTerraform(struct!.workloadType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigChannelMicroserviceCceConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigChannelMicroserviceCceConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusterId !== undefined) { + hasAnyValues = true; + internalValueResult.clusterId = this._clusterId; + } + if (this._labelKey !== undefined) { + hasAnyValues = true; + internalValueResult.labelKey = this._labelKey; + } + if (this._labelValue !== undefined) { + hasAnyValues = true; + internalValueResult.labelValue = this._labelValue; + } + if (this._namespace !== undefined) { + hasAnyValues = true; + internalValueResult.namespace = this._namespace; + } + if (this._workloadName !== undefined) { + hasAnyValues = true; + internalValueResult.workloadName = this._workloadName; + } + if (this._workloadType !== undefined) { + hasAnyValues = true; + internalValueResult.workloadType = this._workloadType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigChannelMicroserviceCceConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._clusterId = undefined; + this._labelKey = undefined; + this._labelValue = undefined; + this._namespace = undefined; + this._workloadName = undefined; + this._workloadType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._clusterId = value.clusterId; + this._labelKey = value.labelKey; + this._labelValue = value.labelValue; + this._namespace = value.namespace; + this._workloadName = value.workloadName; + this._workloadType = value.workloadType; + } + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // label_key - computed: false, optional: true, required: false + private _labelKey?: string; + public get labelKey() { + return this.getStringAttribute('label_key'); + } + public set labelKey(value: string) { + this._labelKey = value; + } + public resetLabelKey() { + this._labelKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelKeyInput() { + return this._labelKey; + } + + // label_value - computed: false, optional: true, required: false + private _labelValue?: string; + public get labelValue() { + return this.getStringAttribute('label_value'); + } + public set labelValue(value: string) { + this._labelValue = value; + } + public resetLabelValue() { + this._labelValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelValueInput() { + return this._labelValue; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // workload_name - computed: false, optional: true, required: false + private _workloadName?: string; + public get workloadName() { + return this.getStringAttribute('workload_name'); + } + public set workloadName(value: string) { + this._workloadName = value; + } + public resetWorkloadName() { + this._workloadName = undefined; + } + // Temporarily expose input value. Use with caution. + public get workloadNameInput() { + return this._workloadName; + } + + // workload_type - computed: false, optional: false, required: true + private _workloadType?: string; + public get workloadType() { + return this.getStringAttribute('workload_type'); + } + public set workloadType(value: string) { + this._workloadType = value; + } + // Temporarily expose input value. Use with caution. + public get workloadTypeInput() { + return this._workloadType; + } +} +export interface ApigChannelMicroserviceCseConfig { + /** + * schema:Internal; The microservice engine ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#engine_id ApigChannel#engine_id} + */ + readonly engineId: string; + /** + * schema:Internal; The microservice ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#service_id ApigChannel#service_id} + */ + readonly serviceId: string; +} + +export function apigChannelMicroserviceCseConfigToTerraform(struct?: ApigChannelMicroserviceCseConfigOutputReference | ApigChannelMicroserviceCseConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine_id: cdktf.stringToTerraform(struct!.engineId), + service_id: cdktf.stringToTerraform(struct!.serviceId), + } +} + + +export function apigChannelMicroserviceCseConfigToHclTerraform(struct?: ApigChannelMicroserviceCseConfigOutputReference | ApigChannelMicroserviceCseConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine_id: { + value: cdktf.stringToHclTerraform(struct!.engineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(struct!.serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigChannelMicroserviceCseConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigChannelMicroserviceCseConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engineId !== undefined) { + hasAnyValues = true; + internalValueResult.engineId = this._engineId; + } + if (this._serviceId !== undefined) { + hasAnyValues = true; + internalValueResult.serviceId = this._serviceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigChannelMicroserviceCseConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engineId = undefined; + this._serviceId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engineId = value.engineId; + this._serviceId = value.serviceId; + } + } + + // engine_id - computed: false, optional: false, required: true + private _engineId?: string; + public get engineId() { + return this.getStringAttribute('engine_id'); + } + public set engineId(value: string) { + this._engineId = value; + } + // Temporarily expose input value. Use with caution. + public get engineIdInput() { + return this._engineId; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } +} +export interface ApigChannelMicroservice { + /** + * cce_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#cce_config ApigChannel#cce_config} + */ + readonly cceConfig?: ApigChannelMicroserviceCceConfig; + /** + * cse_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#cse_config ApigChannel#cse_config} + */ + readonly cseConfig?: ApigChannelMicroserviceCseConfig; +} + +export function apigChannelMicroserviceToTerraform(struct?: ApigChannelMicroserviceOutputReference | ApigChannelMicroservice): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cce_config: apigChannelMicroserviceCceConfigToTerraform(struct!.cceConfig), + cse_config: apigChannelMicroserviceCseConfigToTerraform(struct!.cseConfig), + } +} + + +export function apigChannelMicroserviceToHclTerraform(struct?: ApigChannelMicroserviceOutputReference | ApigChannelMicroservice): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cce_config: { + value: apigChannelMicroserviceCceConfigToHclTerraform(struct!.cceConfig), + isBlock: true, + type: "list", + storageClassType: "ApigChannelMicroserviceCceConfigList", + }, + cse_config: { + value: apigChannelMicroserviceCseConfigToHclTerraform(struct!.cseConfig), + isBlock: true, + type: "list", + storageClassType: "ApigChannelMicroserviceCseConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigChannelMicroserviceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ApigChannelMicroservice | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cceConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cceConfig = this._cceConfig?.internalValue; + } + if (this._cseConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cseConfig = this._cseConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigChannelMicroservice | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cceConfig.internalValue = undefined; + this._cseConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cceConfig.internalValue = value.cceConfig; + this._cseConfig.internalValue = value.cseConfig; + } + } + + // cce_config - computed: false, optional: true, required: false + private _cceConfig = new ApigChannelMicroserviceCceConfigOutputReference(this, "cce_config"); + public get cceConfig() { + return this._cceConfig; + } + public putCceConfig(value: ApigChannelMicroserviceCceConfig) { + this._cceConfig.internalValue = value; + } + public resetCceConfig() { + this._cceConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cceConfigInput() { + return this._cceConfig.internalValue; + } + + // cse_config - computed: false, optional: true, required: false + private _cseConfig = new ApigChannelMicroserviceCseConfigOutputReference(this, "cse_config"); + public get cseConfig() { + return this._cseConfig; + } + public putCseConfig(value: ApigChannelMicroserviceCseConfig) { + this._cseConfig.internalValue = value; + } + public resetCseConfig() { + this._cseConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cseConfigInput() { + return this._cseConfig.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel huaweicloud_apig_channel} +*/ +export class ApigChannel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_channel"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigChannel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigChannel to import + * @param importFromId The id of the existing ApigChannel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigChannel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_channel", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_channel huaweicloud_apig_channel} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigChannelConfig + */ + public constructor(scope: Construct, id: string, config: ApigChannelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_channel', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._balanceStrategy = config.balanceStrategy; + this._id = config.id; + this._instanceId = config.instanceId; + this._memberType = config.memberType; + this._name = config.name; + this._port = config.port; + this._region = config.region; + this._type = config.type; + this._healthCheck.internalValue = config.healthCheck; + this._member.internalValue = config.member; + this._memberGroup.internalValue = config.memberGroup; + this._microservice.internalValue = config.microservice; + } + + // ========== + // ATTRIBUTES + // ========== + + // balance_strategy - computed: false, optional: false, required: true + private _balanceStrategy?: number; + public get balanceStrategy() { + return this.getNumberAttribute('balance_strategy'); + } + public set balanceStrategy(value: number) { + this._balanceStrategy = value; + } + // Temporarily expose input value. Use with caution. + public get balanceStrategyInput() { + return this._balanceStrategy; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // member_type - computed: true, optional: true, required: false + private _memberType?: string; + public get memberType() { + return this.getStringAttribute('member_type'); + } + public set memberType(value: string) { + this._memberType = value; + } + public resetMemberType() { + this._memberType = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberTypeInput() { + return this._memberType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // health_check - computed: false, optional: true, required: false + private _healthCheck = new ApigChannelHealthCheckOutputReference(this, "health_check"); + public get healthCheck() { + return this._healthCheck; + } + public putHealthCheck(value: ApigChannelHealthCheck) { + this._healthCheck.internalValue = value; + } + public resetHealthCheck() { + this._healthCheck.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthCheckInput() { + return this._healthCheck.internalValue; + } + + // member - computed: false, optional: true, required: false + private _member = new ApigChannelMemberList(this, "member", true); + public get member() { + return this._member; + } + public putMember(value: ApigChannelMember[] | cdktf.IResolvable) { + this._member.internalValue = value; + } + public resetMember() { + this._member.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberInput() { + return this._member.internalValue; + } + + // member_group - computed: false, optional: true, required: false + private _memberGroup = new ApigChannelMemberGroupList(this, "member_group", false); + public get memberGroup() { + return this._memberGroup; + } + public putMemberGroup(value: ApigChannelMemberGroup[] | cdktf.IResolvable) { + this._memberGroup.internalValue = value; + } + public resetMemberGroup() { + this._memberGroup.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberGroupInput() { + return this._memberGroup.internalValue; + } + + // microservice - computed: false, optional: true, required: false + private _microservice = new ApigChannelMicroserviceOutputReference(this, "microservice"); + public get microservice() { + return this._microservice; + } + public putMicroservice(value: ApigChannelMicroservice) { + this._microservice.internalValue = value; + } + public resetMicroservice() { + this._microservice.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get microserviceInput() { + return this._microservice.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + balance_strategy: cdktf.numberToTerraform(this._balanceStrategy), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + member_type: cdktf.stringToTerraform(this._memberType), + name: cdktf.stringToTerraform(this._name), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + type: cdktf.numberToTerraform(this._type), + health_check: apigChannelHealthCheckToTerraform(this._healthCheck.internalValue), + member: cdktf.listMapper(apigChannelMemberToTerraform, true)(this._member.internalValue), + member_group: cdktf.listMapper(apigChannelMemberGroupToTerraform, true)(this._memberGroup.internalValue), + microservice: apigChannelMicroserviceToTerraform(this._microservice.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + balance_strategy: { + value: cdktf.numberToHclTerraform(this._balanceStrategy), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_type: { + value: cdktf.stringToHclTerraform(this._memberType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + health_check: { + value: apigChannelHealthCheckToHclTerraform(this._healthCheck.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApigChannelHealthCheckList", + }, + member: { + value: cdktf.listMapperHcl(apigChannelMemberToHclTerraform, true)(this._member.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigChannelMemberList", + }, + member_group: { + value: cdktf.listMapperHcl(apigChannelMemberGroupToHclTerraform, true)(this._memberGroup.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApigChannelMemberGroupList", + }, + microservice: { + value: apigChannelMicroserviceToHclTerraform(this._microservice.internalValue), + isBlock: true, + type: "list", + storageClassType: "ApigChannelMicroserviceList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-custom-authorizer/README.md b/src/constructs/providers/huaweicloud/apig-custom-authorizer/README.md new file mode 100644 index 00000000..bc64fbb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-custom-authorizer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_custom_authorizer` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_custom_authorizer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer). diff --git a/src/constructs/providers/huaweicloud/apig-custom-authorizer/index.ts b/src/constructs/providers/huaweicloud/apig-custom-authorizer/index.ts new file mode 100644 index 00000000..2e7ddfe9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-custom-authorizer/index.ts @@ -0,0 +1,654 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigCustomAuthorizerConfig extends cdktf.TerraformMetaArguments { + /** + * The maximum cache age. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#cache_age ApigCustomAuthorizer#cache_age} + */ + readonly cacheAge?: number; + /** + * The version alias URI of the FGS function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#function_alias_uri ApigCustomAuthorizer#function_alias_uri} + */ + readonly functionAliasUri?: string; + /** + * The URN of the FGS function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#function_urn ApigCustomAuthorizer#function_urn} + */ + readonly functionUrn: string; + /** + * The version of the FGS function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#function_version ApigCustomAuthorizer#function_version} + */ + readonly functionVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#id ApigCustomAuthorizer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the custom authorizer belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#instance_id ApigCustomAuthorizer#instance_id} + */ + readonly instanceId: string; + /** + * Whether to send the body. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#is_body_send ApigCustomAuthorizer#is_body_send} + */ + readonly isBodySend?: boolean | cdktf.IResolvable; + /** + * The name of the custom authorizer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#name ApigCustomAuthorizer#name} + */ + readonly name: string; + /** + * The framework type of the function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#network_type ApigCustomAuthorizer#network_type} + */ + readonly networkType?: string; + /** + * The region where the custom authorizer is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#region ApigCustomAuthorizer#region} + */ + readonly region?: string; + /** + * The custom authorization type + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#type ApigCustomAuthorizer#type} + */ + readonly type?: string; + /** + * The user data for custom authorizer function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#user_data ApigCustomAuthorizer#user_data} + */ + readonly userData?: string; + /** + * identity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#identity ApigCustomAuthorizer#identity} + */ + readonly identity?: ApigCustomAuthorizerIdentity[] | cdktf.IResolvable; +} +export interface ApigCustomAuthorizerIdentity { + /** + * The parameter location. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#location ApigCustomAuthorizer#location} + */ + readonly location: string; + /** + * The name of the parameter to be verified. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#name ApigCustomAuthorizer#name} + */ + readonly name: string; + /** + * The parameter verification expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#validation ApigCustomAuthorizer#validation} + */ + readonly validation?: string; +} + +export function apigCustomAuthorizerIdentityToTerraform(struct?: ApigCustomAuthorizerIdentity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + location: cdktf.stringToTerraform(struct!.location), + name: cdktf.stringToTerraform(struct!.name), + validation: cdktf.stringToTerraform(struct!.validation), + } +} + + +export function apigCustomAuthorizerIdentityToHclTerraform(struct?: ApigCustomAuthorizerIdentity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + validation: { + value: cdktf.stringToHclTerraform(struct!.validation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigCustomAuthorizerIdentityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigCustomAuthorizerIdentity | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._validation !== undefined) { + hasAnyValues = true; + internalValueResult.validation = this._validation; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigCustomAuthorizerIdentity | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._location = undefined; + this._name = undefined; + this._validation = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._location = value.location; + this._name = value.name; + this._validation = value.validation; + } + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // validation - computed: false, optional: true, required: false + private _validation?: string; + public get validation() { + return this.getStringAttribute('validation'); + } + public set validation(value: string) { + this._validation = value; + } + public resetValidation() { + this._validation = undefined; + } + // Temporarily expose input value. Use with caution. + public get validationInput() { + return this._validation; + } +} + +export class ApigCustomAuthorizerIdentityList extends cdktf.ComplexList { + public internalValue? : ApigCustomAuthorizerIdentity[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigCustomAuthorizerIdentityOutputReference { + return new ApigCustomAuthorizerIdentityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer huaweicloud_apig_custom_authorizer} +*/ +export class ApigCustomAuthorizer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_custom_authorizer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigCustomAuthorizer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigCustomAuthorizer to import + * @param importFromId The id of the existing ApigCustomAuthorizer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigCustomAuthorizer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_custom_authorizer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_custom_authorizer huaweicloud_apig_custom_authorizer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigCustomAuthorizerConfig + */ + public constructor(scope: Construct, id: string, config: ApigCustomAuthorizerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_custom_authorizer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cacheAge = config.cacheAge; + this._functionAliasUri = config.functionAliasUri; + this._functionUrn = config.functionUrn; + this._functionVersion = config.functionVersion; + this._id = config.id; + this._instanceId = config.instanceId; + this._isBodySend = config.isBodySend; + this._name = config.name; + this._networkType = config.networkType; + this._region = config.region; + this._type = config.type; + this._userData = config.userData; + this._identity.internalValue = config.identity; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_age - computed: false, optional: true, required: false + private _cacheAge?: number; + public get cacheAge() { + return this.getNumberAttribute('cache_age'); + } + public set cacheAge(value: number) { + this._cacheAge = value; + } + public resetCacheAge() { + this._cacheAge = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheAgeInput() { + return this._cacheAge; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // function_alias_uri - computed: true, optional: true, required: false + private _functionAliasUri?: string; + public get functionAliasUri() { + return this.getStringAttribute('function_alias_uri'); + } + public set functionAliasUri(value: string) { + this._functionAliasUri = value; + } + public resetFunctionAliasUri() { + this._functionAliasUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get functionAliasUriInput() { + return this._functionAliasUri; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // function_version - computed: true, optional: true, required: false + private _functionVersion?: string; + public get functionVersion() { + return this.getStringAttribute('function_version'); + } + public set functionVersion(value: string) { + this._functionVersion = value; + } + public resetFunctionVersion() { + this._functionVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get functionVersionInput() { + return this._functionVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_body_send - computed: false, optional: true, required: false + private _isBodySend?: boolean | cdktf.IResolvable; + public get isBodySend() { + return this.getBooleanAttribute('is_body_send'); + } + public set isBodySend(value: boolean | cdktf.IResolvable) { + this._isBodySend = value; + } + public resetIsBodySend() { + this._isBodySend = undefined; + } + // Temporarily expose input value. Use with caution. + public get isBodySendInput() { + return this._isBodySend; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_type - computed: true, optional: true, required: false + private _networkType?: string; + public get networkType() { + return this.getStringAttribute('network_type'); + } + public set networkType(value: string) { + this._networkType = value; + } + public resetNetworkType() { + this._networkType = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkTypeInput() { + return this._networkType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // identity - computed: false, optional: true, required: false + private _identity = new ApigCustomAuthorizerIdentityList(this, "identity", true); + public get identity() { + return this._identity; + } + public putIdentity(value: ApigCustomAuthorizerIdentity[] | cdktf.IResolvable) { + this._identity.internalValue = value; + } + public resetIdentity() { + this._identity.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get identityInput() { + return this._identity.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cache_age: cdktf.numberToTerraform(this._cacheAge), + function_alias_uri: cdktf.stringToTerraform(this._functionAliasUri), + function_urn: cdktf.stringToTerraform(this._functionUrn), + function_version: cdktf.stringToTerraform(this._functionVersion), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_body_send: cdktf.booleanToTerraform(this._isBodySend), + name: cdktf.stringToTerraform(this._name), + network_type: cdktf.stringToTerraform(this._networkType), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + user_data: cdktf.stringToTerraform(this._userData), + identity: cdktf.listMapper(apigCustomAuthorizerIdentityToTerraform, true)(this._identity.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cache_age: { + value: cdktf.numberToHclTerraform(this._cacheAge), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + function_alias_uri: { + value: cdktf.stringToHclTerraform(this._functionAliasUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_version: { + value: cdktf.stringToHclTerraform(this._functionVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_body_send: { + value: cdktf.booleanToHclTerraform(this._isBodySend), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_type: { + value: cdktf.stringToHclTerraform(this._networkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity: { + value: cdktf.listMapperHcl(apigCustomAuthorizerIdentityToHclTerraform, true)(this._identity.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigCustomAuthorizerIdentityList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-endpoint-connection-management/README.md b/src/constructs/providers/huaweicloud/apig-endpoint-connection-management/README.md new file mode 100644 index 00000000..752a835f --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-endpoint-connection-management/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_endpoint_connection_management` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_endpoint_connection_management`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management). diff --git a/src/constructs/providers/huaweicloud/apig-endpoint-connection-management/index.ts b/src/constructs/providers/huaweicloud/apig-endpoint-connection-management/index.ts new file mode 100644 index 00000000..9eca1bb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-endpoint-connection-management/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigEndpointConnectionManagementConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the operation type endpoint connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#action ApigEndpointConnectionManagement#action} + */ + readonly action: string; + /** + * Specifies the ID of the endpoint connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#endpoint_id ApigEndpointConnectionManagement#endpoint_id} + */ + readonly endpointId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#id ApigEndpointConnectionManagement#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the endpoint connection belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#instance_id ApigEndpointConnectionManagement#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#region ApigEndpointConnectionManagement#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#timeouts ApigEndpointConnectionManagement#timeouts} + */ + readonly timeouts?: ApigEndpointConnectionManagementTimeouts; +} +export interface ApigEndpointConnectionManagementTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#create ApigEndpointConnectionManagement#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#update ApigEndpointConnectionManagement#update} + */ + readonly update?: string; +} + +export function apigEndpointConnectionManagementTimeoutsToTerraform(struct?: ApigEndpointConnectionManagementTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigEndpointConnectionManagementTimeoutsToHclTerraform(struct?: ApigEndpointConnectionManagementTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigEndpointConnectionManagementTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigEndpointConnectionManagementTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigEndpointConnectionManagementTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management huaweicloud_apig_endpoint_connection_management} +*/ +export class ApigEndpointConnectionManagement extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_endpoint_connection_management"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigEndpointConnectionManagement resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigEndpointConnectionManagement to import + * @param importFromId The id of the existing ApigEndpointConnectionManagement that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigEndpointConnectionManagement to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_endpoint_connection_management", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_connection_management huaweicloud_apig_endpoint_connection_management} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigEndpointConnectionManagementConfig + */ + public constructor(scope: Construct, id: string, config: ApigEndpointConnectionManagementConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_endpoint_connection_management', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._endpointId = config.endpointId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // endpoint_id - computed: false, optional: false, required: true + private _endpointId?: string; + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + public set endpointId(value: string) { + this._endpointId = value; + } + // Temporarily expose input value. Use with caution. + public get endpointIdInput() { + return this._endpointId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigEndpointConnectionManagementTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigEndpointConnectionManagementTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + endpoint_id: cdktf.stringToTerraform(this._endpointId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: apigEndpointConnectionManagementTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint_id: { + value: cdktf.stringToHclTerraform(this._endpointId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apigEndpointConnectionManagementTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigEndpointConnectionManagementTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-endpoint-whitelist/README.md b/src/constructs/providers/huaweicloud/apig-endpoint-whitelist/README.md new file mode 100644 index 00000000..4d83a8d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-endpoint-whitelist/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_endpoint_whitelist` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_endpoint_whitelist`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist). diff --git a/src/constructs/providers/huaweicloud/apig-endpoint-whitelist/index.ts b/src/constructs/providers/huaweicloud/apig-endpoint-whitelist/index.ts new file mode 100644 index 00000000..d56e077e --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-endpoint-whitelist/index.ts @@ -0,0 +1,200 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigEndpointWhitelistConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist#id ApigEndpointWhitelist#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the endpoint service belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist#instance_id ApigEndpointWhitelist#instance_id} + */ + readonly instanceId: string; + /** + * The region where the endpoint service is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist#region ApigEndpointWhitelist#region} + */ + readonly region?: string; + /** + * The whitelist records of the endpoint service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist#whitelists ApigEndpointWhitelist#whitelists} + */ + readonly whitelists: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist huaweicloud_apig_endpoint_whitelist} +*/ +export class ApigEndpointWhitelist extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_endpoint_whitelist"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigEndpointWhitelist resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigEndpointWhitelist to import + * @param importFromId The id of the existing ApigEndpointWhitelist that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigEndpointWhitelist to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_endpoint_whitelist", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_endpoint_whitelist huaweicloud_apig_endpoint_whitelist} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigEndpointWhitelistConfig + */ + public constructor(scope: Construct, id: string, config: ApigEndpointWhitelistConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_endpoint_whitelist', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._whitelists = config.whitelists; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // whitelists - computed: false, optional: false, required: true + private _whitelists?: string[]; + public get whitelists() { + return cdktf.Fn.tolist(this.getListAttribute('whitelists')); + } + public set whitelists(value: string[]) { + this._whitelists = value; + } + // Temporarily expose input value. Use with caution. + public get whitelistsInput() { + return this._whitelists; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + whitelists: cdktf.listMapper(cdktf.stringToTerraform, false)(this._whitelists), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelists: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._whitelists), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-environment-variable/README.md b/src/constructs/providers/huaweicloud/apig-environment-variable/README.md new file mode 100644 index 00000000..156b01bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-environment-variable/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_environment_variable` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_environment_variable`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable). diff --git a/src/constructs/providers/huaweicloud/apig-environment-variable/index.ts b/src/constructs/providers/huaweicloud/apig-environment-variable/index.ts new file mode 100644 index 00000000..b1b8fcb3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-environment-variable/index.ts @@ -0,0 +1,281 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigEnvironmentVariableConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the environment to which the environment variable belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#env_id ApigEnvironmentVariable#env_id} + */ + readonly envId: string; + /** + * Specifies the ID of the group to which the environment variable belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#group_id ApigEnvironmentVariable#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#id ApigEnvironmentVariable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the environment variable belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#instance_id ApigEnvironmentVariable#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the environment variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#name ApigEnvironmentVariable#name} + */ + readonly name: string; + /** + * Specifies the region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#region ApigEnvironmentVariable#region} + */ + readonly region?: string; + /** + * Specifies the value of the environment variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#value ApigEnvironmentVariable#value} + */ + readonly value: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable huaweicloud_apig_environment_variable} +*/ +export class ApigEnvironmentVariable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_environment_variable"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigEnvironmentVariable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigEnvironmentVariable to import + * @param importFromId The id of the existing ApigEnvironmentVariable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigEnvironmentVariable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_environment_variable", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment_variable huaweicloud_apig_environment_variable} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigEnvironmentVariableConfig + */ + public constructor(scope: Construct, id: string, config: ApigEnvironmentVariableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_environment_variable', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._envId = config.envId; + this._groupId = config.groupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._value = config.value; + } + + // ========== + // ATTRIBUTES + // ========== + + // env_id - computed: false, optional: false, required: true + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + env_id: cdktf.stringToTerraform(this._envId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + value: cdktf.stringToTerraform(this._value), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-environment/README.md b/src/constructs/providers/huaweicloud/apig-environment/README.md new file mode 100644 index 00000000..b5b5e6f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-environment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_environment` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_environment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment). diff --git a/src/constructs/providers/huaweicloud/apig-environment/index.ts b/src/constructs/providers/huaweicloud/apig-environment/index.ts new file mode 100644 index 00000000..69d593e9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-environment/index.ts @@ -0,0 +1,240 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigEnvironmentConfig extends cdktf.TerraformMetaArguments { + /** + * The environment description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment#description ApigEnvironment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment#id ApigEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the environment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment#instance_id ApigEnvironment#instance_id} + */ + readonly instanceId: string; + /** + * The environment name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment#name ApigEnvironment#name} + */ + readonly name: string; + /** + * The region where the dedicated instance is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment#region ApigEnvironment#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment huaweicloud_apig_environment} +*/ +export class ApigEnvironment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_environment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigEnvironment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigEnvironment to import + * @param importFromId The id of the existing ApigEnvironment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigEnvironment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_environment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_environment huaweicloud_apig_environment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigEnvironmentConfig + */ + public constructor(scope: Construct, id: string, config: ApigEnvironmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_environment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-group/README.md b/src/constructs/providers/huaweicloud/apig-group/README.md new file mode 100644 index 00000000..9db4a3e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group). diff --git a/src/constructs/providers/huaweicloud/apig-group/index.ts b/src/constructs/providers/huaweicloud/apig-group/index.ts new file mode 100644 index 00000000..956e8d05 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-group/index.ts @@ -0,0 +1,853 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The group description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#description ApigGroup#description} + */ + readonly description?: string; + /** + * Specifies whether to use the debugging domain name to access the APIs within the group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#domain_access_enabled ApigGroup#domain_access_enabled} + */ + readonly domainAccessEnabled?: boolean | cdktf.IResolvable; + /** + * Whether to delete all sub-resources (for API) from this group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#force_destroy ApigGroup#force_destroy} + */ + readonly forceDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#id ApigGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#instance_id ApigGroup#instance_id} + */ + readonly instanceId: string; + /** + * The group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#name ApigGroup#name} + */ + readonly name: string; + /** + * The region where the dedicated instance is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#region ApigGroup#region} + */ + readonly region?: string; + /** + * environment block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#environment ApigGroup#environment} + */ + readonly environment?: ApigGroupEnvironment[] | cdktf.IResolvable; + /** + * url_domains block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#url_domains ApigGroup#url_domains} + */ + readonly urlDomains?: ApigGroupUrlDomains[] | cdktf.IResolvable; +} +export interface ApigGroupEnvironmentVariable { + /** + * The variable name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#name ApigGroup#name} + */ + readonly name: string; + /** + * The variable value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#value ApigGroup#value} + */ + readonly value: string; +} + +export function apigGroupEnvironmentVariableToTerraform(struct?: ApigGroupEnvironmentVariable | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function apigGroupEnvironmentVariableToHclTerraform(struct?: ApigGroupEnvironmentVariable | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigGroupEnvironmentVariableOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigGroupEnvironmentVariable | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigGroupEnvironmentVariable | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // variable_id - computed: true, optional: false, required: false + public get variableId() { + return this.getStringAttribute('variable_id'); + } +} + +export class ApigGroupEnvironmentVariableList extends cdktf.ComplexList { + public internalValue? : ApigGroupEnvironmentVariable[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigGroupEnvironmentVariableOutputReference { + return new ApigGroupEnvironmentVariableOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigGroupEnvironment { + /** + * The ID of the environment to which the variables belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#environment_id ApigGroup#environment_id} + */ + readonly environmentId: string; + /** + * variable block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#variable ApigGroup#variable} + */ + readonly variable: ApigGroupEnvironmentVariable[] | cdktf.IResolvable; +} + +export function apigGroupEnvironmentToTerraform(struct?: ApigGroupEnvironment | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + environment_id: cdktf.stringToTerraform(struct!.environmentId), + variable: cdktf.listMapper(apigGroupEnvironmentVariableToTerraform, true)(struct!.variable), + } +} + + +export function apigGroupEnvironmentToHclTerraform(struct?: ApigGroupEnvironment | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + environment_id: { + value: cdktf.stringToHclTerraform(struct!.environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + variable: { + value: cdktf.listMapperHcl(apigGroupEnvironmentVariableToHclTerraform, true)(struct!.variable), + isBlock: true, + type: "set", + storageClassType: "ApigGroupEnvironmentVariableList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigGroupEnvironmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigGroupEnvironment | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._environmentId !== undefined) { + hasAnyValues = true; + internalValueResult.environmentId = this._environmentId; + } + if (this._variable?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.variable = this._variable?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigGroupEnvironment | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._environmentId = undefined; + this._variable.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._environmentId = value.environmentId; + this._variable.internalValue = value.variable; + } + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // variable - computed: false, optional: false, required: true + private _variable = new ApigGroupEnvironmentVariableList(this, "variable", true); + public get variable() { + return this._variable; + } + public putVariable(value: ApigGroupEnvironmentVariable[] | cdktf.IResolvable) { + this._variable.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get variableInput() { + return this._variable.internalValue; + } +} + +export class ApigGroupEnvironmentList extends cdktf.ComplexList { + public internalValue? : ApigGroupEnvironment[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigGroupEnvironmentOutputReference { + return new ApigGroupEnvironmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigGroupUrlDomains { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#is_http_redirect_to_https ApigGroup#is_http_redirect_to_https} + */ + readonly isHttpRedirectToHttps?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#min_ssl_version ApigGroup#min_ssl_version} + */ + readonly minSslVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#name ApigGroup#name} + */ + readonly name: string; +} + +export function apigGroupUrlDomainsToTerraform(struct?: ApigGroupUrlDomains | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + is_http_redirect_to_https: cdktf.booleanToTerraform(struct!.isHttpRedirectToHttps), + min_ssl_version: cdktf.stringToTerraform(struct!.minSslVersion), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function apigGroupUrlDomainsToHclTerraform(struct?: ApigGroupUrlDomains | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + is_http_redirect_to_https: { + value: cdktf.booleanToHclTerraform(struct!.isHttpRedirectToHttps), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + min_ssl_version: { + value: cdktf.stringToHclTerraform(struct!.minSslVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigGroupUrlDomainsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigGroupUrlDomains | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._isHttpRedirectToHttps !== undefined) { + hasAnyValues = true; + internalValueResult.isHttpRedirectToHttps = this._isHttpRedirectToHttps; + } + if (this._minSslVersion !== undefined) { + hasAnyValues = true; + internalValueResult.minSslVersion = this._minSslVersion; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigGroupUrlDomains | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._isHttpRedirectToHttps = undefined; + this._minSslVersion = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._isHttpRedirectToHttps = value.isHttpRedirectToHttps; + this._minSslVersion = value.minSslVersion; + this._name = value.name; + } + } + + // is_http_redirect_to_https - computed: true, optional: true, required: false + private _isHttpRedirectToHttps?: boolean | cdktf.IResolvable; + public get isHttpRedirectToHttps() { + return this.getBooleanAttribute('is_http_redirect_to_https'); + } + public set isHttpRedirectToHttps(value: boolean | cdktf.IResolvable) { + this._isHttpRedirectToHttps = value; + } + public resetIsHttpRedirectToHttps() { + this._isHttpRedirectToHttps = undefined; + } + // Temporarily expose input value. Use with caution. + public get isHttpRedirectToHttpsInput() { + return this._isHttpRedirectToHttps; + } + + // min_ssl_version - computed: true, optional: true, required: false + private _minSslVersion?: string; + public get minSslVersion() { + return this.getStringAttribute('min_ssl_version'); + } + public set minSslVersion(value: string) { + this._minSslVersion = value; + } + public resetMinSslVersion() { + this._minSslVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get minSslVersionInput() { + return this._minSslVersion; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class ApigGroupUrlDomainsList extends cdktf.ComplexList { + public internalValue? : ApigGroupUrlDomains[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigGroupUrlDomainsOutputReference { + return new ApigGroupUrlDomainsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group huaweicloud_apig_group} +*/ +export class ApigGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigGroup to import + * @param importFromId The id of the existing ApigGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_group huaweicloud_apig_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigGroupConfig + */ + public constructor(scope: Construct, id: string, config: ApigGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._domainAccessEnabled = config.domainAccessEnabled; + this._forceDestroy = config.forceDestroy; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._environment.internalValue = config.environment; + this._urlDomains.internalValue = config.urlDomains; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_access_enabled - computed: true, optional: true, required: false + private _domainAccessEnabled?: boolean | cdktf.IResolvable; + public get domainAccessEnabled() { + return this.getBooleanAttribute('domain_access_enabled'); + } + public set domainAccessEnabled(value: boolean | cdktf.IResolvable) { + this._domainAccessEnabled = value; + } + public resetDomainAccessEnabled() { + this._domainAccessEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainAccessEnabledInput() { + return this._domainAccessEnabled; + } + + // force_destroy - computed: true, optional: true, required: false + private _forceDestroy?: boolean | cdktf.IResolvable; + public get forceDestroy() { + return this.getBooleanAttribute('force_destroy'); + } + public set forceDestroy(value: boolean | cdktf.IResolvable) { + this._forceDestroy = value; + } + public resetForceDestroy() { + this._forceDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDestroyInput() { + return this._forceDestroy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // registration_time - computed: true, optional: false, required: false + public get registrationTime() { + return this.getStringAttribute('registration_time'); + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // environment - computed: false, optional: true, required: false + private _environment = new ApigGroupEnvironmentList(this, "environment", true); + public get environment() { + return this._environment; + } + public putEnvironment(value: ApigGroupEnvironment[] | cdktf.IResolvable) { + this._environment.internalValue = value; + } + public resetEnvironment() { + this._environment.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get environmentInput() { + return this._environment.internalValue; + } + + // url_domains - computed: false, optional: true, required: false + private _urlDomains = new ApigGroupUrlDomainsList(this, "url_domains", true); + public get urlDomains() { + return this._urlDomains; + } + public putUrlDomains(value: ApigGroupUrlDomains[] | cdktf.IResolvable) { + this._urlDomains.internalValue = value; + } + public resetUrlDomains() { + this._urlDomains.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlDomainsInput() { + return this._urlDomains.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + domain_access_enabled: cdktf.booleanToTerraform(this._domainAccessEnabled), + force_destroy: cdktf.booleanToTerraform(this._forceDestroy), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + environment: cdktf.listMapper(apigGroupEnvironmentToTerraform, true)(this._environment.internalValue), + url_domains: cdktf.listMapper(apigGroupUrlDomainsToTerraform, true)(this._urlDomains.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_access_enabled: { + value: cdktf.booleanToHclTerraform(this._domainAccessEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + force_destroy: { + value: cdktf.booleanToHclTerraform(this._forceDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment: { + value: cdktf.listMapperHcl(apigGroupEnvironmentToHclTerraform, true)(this._environment.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigGroupEnvironmentList", + }, + url_domains: { + value: cdktf.listMapperHcl(apigGroupUrlDomainsToHclTerraform, true)(this._urlDomains.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigGroupUrlDomainsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-instance-feature/README.md b/src/constructs/providers/huaweicloud/apig-instance-feature/README.md new file mode 100644 index 00000000..d5b04e16 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-instance-feature/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_instance_feature` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_instance_feature`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature). diff --git a/src/constructs/providers/huaweicloud/apig-instance-feature/index.ts b/src/constructs/providers/huaweicloud/apig-instance-feature/index.ts new file mode 100644 index 00000000..f731703c --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-instance-feature/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigInstanceFeatureConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the detailed configuration of the feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#config ApigInstanceFeature#config} + */ + readonly config?: string; + /** + * Specified whether to enable the feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#enabled ApigInstanceFeature#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#id ApigInstanceFeature#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specified the ID of the dedicated instance to which the feature belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#instance_id ApigInstanceFeature#instance_id} + */ + readonly instanceId: string; + /** + * Specified the name of the feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#name ApigInstanceFeature#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#region ApigInstanceFeature#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#timeouts ApigInstanceFeature#timeouts} + */ + readonly timeouts?: ApigInstanceFeatureTimeouts; +} +export interface ApigInstanceFeatureTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#create ApigInstanceFeature#create} + */ + readonly create?: string; +} + +export function apigInstanceFeatureTimeoutsToTerraform(struct?: ApigInstanceFeatureTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function apigInstanceFeatureTimeoutsToHclTerraform(struct?: ApigInstanceFeatureTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigInstanceFeatureTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigInstanceFeatureTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigInstanceFeatureTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature huaweicloud_apig_instance_feature} +*/ +export class ApigInstanceFeature extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_instance_feature"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigInstanceFeature resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigInstanceFeature to import + * @param importFromId The id of the existing ApigInstanceFeature that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigInstanceFeature to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_instance_feature", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_feature huaweicloud_apig_instance_feature} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigInstanceFeatureConfig + */ + public constructor(scope: Construct, id: string, config: ApigInstanceFeatureConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_instance_feature', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._config = config.config; + this._enabled = config.enabled; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // config - computed: false, optional: true, required: false + private _config?: string; + public get config() { + return this.getStringAttribute('config'); + } + public set config(value: string) { + this._config = value; + } + public resetConfig() { + this._config = undefined; + } + // Temporarily expose input value. Use with caution. + public get configInput() { + return this._config; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigInstanceFeatureTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigInstanceFeatureTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + config: cdktf.stringToTerraform(this._config), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: apigInstanceFeatureTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + config: { + value: cdktf.stringToHclTerraform(this._config), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apigInstanceFeatureTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigInstanceFeatureTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-instance-routes/README.md b/src/constructs/providers/huaweicloud/apig-instance-routes/README.md new file mode 100644 index 00000000..7a0f4a81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-instance-routes/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_instance_routes` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_instance_routes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes). diff --git a/src/constructs/providers/huaweicloud/apig-instance-routes/index.ts b/src/constructs/providers/huaweicloud/apig-instance-routes/index.ts new file mode 100644 index 00000000..2f19853d --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-instance-routes/index.ts @@ -0,0 +1,200 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigInstanceRoutesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes#id ApigInstanceRoutes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the routes belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes#instance_id ApigInstanceRoutes#instance_id} + */ + readonly instanceId: string; + /** + * The configuration of the next hop routes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes#nexthops ApigInstanceRoutes#nexthops} + */ + readonly nexthops: string[]; + /** + * The region where the dedicated instance and routes are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes#region ApigInstanceRoutes#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes huaweicloud_apig_instance_routes} +*/ +export class ApigInstanceRoutes extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_instance_routes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigInstanceRoutes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigInstanceRoutes to import + * @param importFromId The id of the existing ApigInstanceRoutes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigInstanceRoutes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_instance_routes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance_routes huaweicloud_apig_instance_routes} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigInstanceRoutesConfig + */ + public constructor(scope: Construct, id: string, config: ApigInstanceRoutesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_instance_routes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._nexthops = config.nexthops; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // nexthops - computed: false, optional: false, required: true + private _nexthops?: string[]; + public get nexthops() { + return cdktf.Fn.tolist(this.getListAttribute('nexthops')); + } + public set nexthops(value: string[]) { + this._nexthops = value; + } + // Temporarily expose input value. Use with caution. + public get nexthopsInput() { + return this._nexthops; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + nexthops: cdktf.listMapper(cdktf.stringToTerraform, false)(this._nexthops), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nexthops: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._nexthops), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-instance/README.md b/src/constructs/providers/huaweicloud/apig-instance/README.md new file mode 100644 index 00000000..ce1dd250 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance). diff --git a/src/constructs/providers/huaweicloud/apig-instance/index.ts b/src/constructs/providers/huaweicloud/apig-instance/index.ts new file mode 100644 index 00000000..79c31d24 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-instance/index.ts @@ -0,0 +1,1087 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Required; The name list of availability zones for the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#availability_zones ApigInstance#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * schema: Deprecated; The name list of availability zones for the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#available_zones ApigInstance#available_zones} + */ + readonly availableZones?: string[]; + /** + * The egress bandwidth size of the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#bandwidth_size ApigInstance#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * The description of the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#description ApigInstance#description} + */ + readonly description?: string; + /** + * The edition of the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#edition ApigInstance#edition} + */ + readonly edition: string; + /** + * The EIP ID associated with the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#eip_id ApigInstance#eip_id} + */ + readonly eipId?: string; + /** + * The enterprise project ID to which the dedicated instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#enterprise_project_id ApigInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#id ApigInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#ingress_bandwidth_charging_mode ApigInstance#ingress_bandwidth_charging_mode} + */ + readonly ingressBandwidthChargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#ingress_bandwidth_size ApigInstance#ingress_bandwidth_size} + */ + readonly ingressBandwidthSize?: number; + /** + * Whether public access with an IPv6 address is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#ipv6_enable ApigInstance#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * The type of loadbalancer provider used by the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#loadbalancer_provider ApigInstance#loadbalancer_provider} + */ + readonly loadbalancerProvider?: string; + /** + * The start time of the maintenance time window. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#maintain_begin ApigInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * The name of the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#name ApigInstance#name} + */ + readonly name: string; + /** + * The region in which to create the dedicated instance resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#region ApigInstance#region} + */ + readonly region?: string; + /** + * The ID of the security group to which the dedicated instance belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#security_group_id ApigInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * The ID of the VPC subnet used to create the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#subnet_id ApigInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#tags ApigInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC used to create the dedicated instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#vpc_id ApigInstance#vpc_id} + */ + readonly vpcId: string; + /** + * Name of the VPC endpoint service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#vpcep_service_name ApigInstance#vpcep_service_name} + */ + readonly vpcepServiceName?: string; + /** + * custom_ingress_ports block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#custom_ingress_ports ApigInstance#custom_ingress_ports} + */ + readonly customIngressPorts?: ApigInstanceCustomIngressPorts[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#timeouts ApigInstance#timeouts} + */ + readonly timeouts?: ApigInstanceTimeouts; +} +export interface ApigInstanceCustomIngressPorts { + /** + * Specified port of the custom ingress port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#port ApigInstance#port} + */ + readonly port: number; + /** + * Specified protocol of the custom ingress port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#protocol ApigInstance#protocol} + */ + readonly protocol: string; +} + +export function apigInstanceCustomIngressPortsToTerraform(struct?: ApigInstanceCustomIngressPorts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + port: cdktf.numberToTerraform(struct!.port), + protocol: cdktf.stringToTerraform(struct!.protocol), + } +} + + +export function apigInstanceCustomIngressPortsToHclTerraform(struct?: ApigInstanceCustomIngressPorts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigInstanceCustomIngressPortsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigInstanceCustomIngressPorts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigInstanceCustomIngressPorts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._port = undefined; + this._protocol = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._port = value.port; + this._protocol = value.protocol; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class ApigInstanceCustomIngressPortsList extends cdktf.ComplexList { + public internalValue? : ApigInstanceCustomIngressPorts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigInstanceCustomIngressPortsOutputReference { + return new ApigInstanceCustomIngressPortsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#create ApigInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#delete ApigInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#update ApigInstance#update} + */ + readonly update?: string; +} + +export function apigInstanceTimeoutsToTerraform(struct?: ApigInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigInstanceTimeoutsToHclTerraform(struct?: ApigInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance huaweicloud_apig_instance} +*/ +export class ApigInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigInstance to import + * @param importFromId The id of the existing ApigInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_instance huaweicloud_apig_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigInstanceConfig + */ + public constructor(scope: Construct, id: string, config: ApigInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._bandwidthSize = config.bandwidthSize; + this._description = config.description; + this._edition = config.edition; + this._eipId = config.eipId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ingressBandwidthChargingMode = config.ingressBandwidthChargingMode; + this._ingressBandwidthSize = config.ingressBandwidthSize; + this._ipv6Enable = config.ipv6Enable; + this._loadbalancerProvider = config.loadbalancerProvider; + this._maintainBegin = config.maintainBegin; + this._name = config.name; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._vpcepServiceName = config.vpcepServiceName; + this._customIngressPorts.internalValue = config.customIngressPorts; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: false, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // bandwidth_size - computed: false, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // edition - computed: false, optional: false, required: true + private _edition?: string; + public get edition() { + return this.getStringAttribute('edition'); + } + public set edition(value: string) { + this._edition = value; + } + // Temporarily expose input value. Use with caution. + public get editionInput() { + return this._edition; + } + + // egress_address - computed: true, optional: false, required: false + public get egressAddress() { + return this.getStringAttribute('egress_address'); + } + + // eip_id - computed: true, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ingress_address - computed: true, optional: false, required: false + public get ingressAddress() { + return this.getStringAttribute('ingress_address'); + } + + // ingress_bandwidth_charging_mode - computed: false, optional: true, required: false + private _ingressBandwidthChargingMode?: string; + public get ingressBandwidthChargingMode() { + return this.getStringAttribute('ingress_bandwidth_charging_mode'); + } + public set ingressBandwidthChargingMode(value: string) { + this._ingressBandwidthChargingMode = value; + } + public resetIngressBandwidthChargingMode() { + this._ingressBandwidthChargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get ingressBandwidthChargingModeInput() { + return this._ingressBandwidthChargingMode; + } + + // ingress_bandwidth_size - computed: false, optional: true, required: false + private _ingressBandwidthSize?: number; + public get ingressBandwidthSize() { + return this.getNumberAttribute('ingress_bandwidth_size'); + } + public set ingressBandwidthSize(value: number) { + this._ingressBandwidthSize = value; + } + public resetIngressBandwidthSize() { + this._ingressBandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get ingressBandwidthSizeInput() { + return this._ingressBandwidthSize; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // loadbalancer_provider - computed: true, optional: true, required: false + private _loadbalancerProvider?: string; + public get loadbalancerProvider() { + return this.getStringAttribute('loadbalancer_provider'); + } + public set loadbalancerProvider(value: string) { + this._loadbalancerProvider = value; + } + public resetLoadbalancerProvider() { + this._loadbalancerProvider = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerProviderInput() { + return this._loadbalancerProvider; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // supported_features - computed: true, optional: false, required: false + public get supportedFeatures() { + return this.getListAttribute('supported_features'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_ingress_address - computed: true, optional: false, required: false + public get vpcIngressAddress() { + return this.getStringAttribute('vpc_ingress_address'); + } + + // vpcep_service_address - computed: true, optional: false, required: false + public get vpcepServiceAddress() { + return this.getStringAttribute('vpcep_service_address'); + } + + // vpcep_service_name - computed: true, optional: true, required: false + private _vpcepServiceName?: string; + public get vpcepServiceName() { + return this.getStringAttribute('vpcep_service_name'); + } + public set vpcepServiceName(value: string) { + this._vpcepServiceName = value; + } + public resetVpcepServiceName() { + this._vpcepServiceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcepServiceNameInput() { + return this._vpcepServiceName; + } + + // custom_ingress_ports - computed: false, optional: true, required: false + private _customIngressPorts = new ApigInstanceCustomIngressPortsList(this, "custom_ingress_ports", true); + public get customIngressPorts() { + return this._customIngressPorts; + } + public putCustomIngressPorts(value: ApigInstanceCustomIngressPorts[] | cdktf.IResolvable) { + this._customIngressPorts.internalValue = value; + } + public resetCustomIngressPorts() { + this._customIngressPorts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customIngressPortsInput() { + return this._customIngressPorts.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + description: cdktf.stringToTerraform(this._description), + edition: cdktf.stringToTerraform(this._edition), + eip_id: cdktf.stringToTerraform(this._eipId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ingress_bandwidth_charging_mode: cdktf.stringToTerraform(this._ingressBandwidthChargingMode), + ingress_bandwidth_size: cdktf.numberToTerraform(this._ingressBandwidthSize), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + loadbalancer_provider: cdktf.stringToTerraform(this._loadbalancerProvider), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + vpcep_service_name: cdktf.stringToTerraform(this._vpcepServiceName), + custom_ingress_ports: cdktf.listMapper(apigInstanceCustomIngressPortsToTerraform, true)(this._customIngressPorts.internalValue), + timeouts: apigInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + edition: { + value: cdktf.stringToHclTerraform(this._edition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ingress_bandwidth_charging_mode: { + value: cdktf.stringToHclTerraform(this._ingressBandwidthChargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ingress_bandwidth_size: { + value: cdktf.numberToHclTerraform(this._ingressBandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + loadbalancer_provider: { + value: cdktf.stringToHclTerraform(this._loadbalancerProvider), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpcep_service_name: { + value: cdktf.stringToHclTerraform(this._vpcepServiceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_ingress_ports: { + value: cdktf.listMapperHcl(apigInstanceCustomIngressPortsToHclTerraform, true)(this._customIngressPorts.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigInstanceCustomIngressPortsList", + }, + timeouts: { + value: apigInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-plugin-associate/README.md b/src/constructs/providers/huaweicloud/apig-plugin-associate/README.md new file mode 100644 index 00000000..61f4969f --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-plugin-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_plugin_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_plugin_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate). diff --git a/src/constructs/providers/huaweicloud/apig-plugin-associate/index.ts b/src/constructs/providers/huaweicloud/apig-plugin-associate/index.ts new file mode 100644 index 00000000..1cf803ce --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-plugin-associate/index.ts @@ -0,0 +1,254 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigPluginAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * The APIs bound by the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#api_ids ApigPluginAssociate#api_ids} + */ + readonly apiIds: string[]; + /** + * The environment ID where the API was published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#env_id ApigPluginAssociate#env_id} + */ + readonly envId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#id ApigPluginAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the plugin belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#instance_id ApigPluginAssociate#instance_id} + */ + readonly instanceId: string; + /** + * The plugin ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#plugin_id ApigPluginAssociate#plugin_id} + */ + readonly pluginId: string; + /** + * The region where the plugin is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#region ApigPluginAssociate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate huaweicloud_apig_plugin_associate} +*/ +export class ApigPluginAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_plugin_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigPluginAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigPluginAssociate to import + * @param importFromId The id of the existing ApigPluginAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigPluginAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_plugin_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin_associate huaweicloud_apig_plugin_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigPluginAssociateConfig + */ + public constructor(scope: Construct, id: string, config: ApigPluginAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_plugin_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiIds = config.apiIds; + this._envId = config.envId; + this._id = config.id; + this._instanceId = config.instanceId; + this._pluginId = config.pluginId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_ids - computed: false, optional: false, required: true + private _apiIds?: string[]; + public get apiIds() { + return cdktf.Fn.tolist(this.getListAttribute('api_ids')); + } + public set apiIds(value: string[]) { + this._apiIds = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdsInput() { + return this._apiIds; + } + + // env_id - computed: false, optional: false, required: true + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // plugin_id - computed: false, optional: false, required: true + private _pluginId?: string; + public get pluginId() { + return this.getStringAttribute('plugin_id'); + } + public set pluginId(value: string) { + this._pluginId = value; + } + // Temporarily expose input value. Use with caution. + public get pluginIdInput() { + return this._pluginId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._apiIds), + env_id: cdktf.stringToTerraform(this._envId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + plugin_id: cdktf.stringToTerraform(this._pluginId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._apiIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + plugin_id: { + value: cdktf.stringToHclTerraform(this._pluginId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-plugin/README.md b/src/constructs/providers/huaweicloud/apig-plugin/README.md new file mode 100644 index 00000000..497281a8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-plugin/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_plugin` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_plugin`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin). diff --git a/src/constructs/providers/huaweicloud/apig-plugin/index.ts b/src/constructs/providers/huaweicloud/apig-plugin/index.ts new file mode 100644 index 00000000..12e0abe4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-plugin/index.ts @@ -0,0 +1,294 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigPluginConfig extends cdktf.TerraformMetaArguments { + /** + * The configuration details for plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#content ApigPlugin#content} + */ + readonly content: string; + /** + * The plugin description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#description ApigPlugin#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#id ApigPlugin#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the plugin belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#instance_id ApigPlugin#instance_id} + */ + readonly instanceId: string; + /** + * The plugin name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#name ApigPlugin#name} + */ + readonly name: string; + /** + * The region where the plugin is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#region ApigPlugin#region} + */ + readonly region?: string; + /** + * The plugin type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#type ApigPlugin#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin huaweicloud_apig_plugin} +*/ +export class ApigPlugin extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_plugin"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigPlugin resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigPlugin to import + * @param importFromId The id of the existing ApigPlugin that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigPlugin to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_plugin", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_plugin huaweicloud_apig_plugin} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigPluginConfig + */ + public constructor(scope: Construct, id: string, config: ApigPluginConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_plugin', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-response/README.md b/src/constructs/providers/huaweicloud/apig-response/README.md new file mode 100644 index 00000000..3b4deed8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-response/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_response` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_response`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response). diff --git a/src/constructs/providers/huaweicloud/apig-response/index.ts b/src/constructs/providers/huaweicloud/apig-response/index.ts new file mode 100644 index 00000000..e162fd51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-response/index.ts @@ -0,0 +1,449 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigResponseConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API group to which the API custom response belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#group_id ApigResponse#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#id ApigResponse#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the API group and the API custom response belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#instance_id ApigResponse#instance_id} + */ + readonly instanceId: string; + /** + * The name of the API custom response. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#name ApigResponse#name} + */ + readonly name: string; + /** + * The region where the API custom response is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#region ApigResponse#region} + */ + readonly region?: string; + /** + * rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#rule ApigResponse#rule} + */ + readonly rule?: ApigResponseRule[] | cdktf.IResolvable; +} +export interface ApigResponseRule { + /** + * The body template of the API custom response rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#body ApigResponse#body} + */ + readonly body: string; + /** + * The error type of the API custom response rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#error_type ApigResponse#error_type} + */ + readonly errorType: string; + /** + * The HTTP status code of the API custom response rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#status_code ApigResponse#status_code} + */ + readonly statusCode?: number; +} + +export function apigResponseRuleToTerraform(struct?: ApigResponseRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + body: cdktf.stringToTerraform(struct!.body), + error_type: cdktf.stringToTerraform(struct!.errorType), + status_code: cdktf.numberToTerraform(struct!.statusCode), + } +} + + +export function apigResponseRuleToHclTerraform(struct?: ApigResponseRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + body: { + value: cdktf.stringToHclTerraform(struct!.body), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + error_type: { + value: cdktf.stringToHclTerraform(struct!.errorType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.numberToHclTerraform(struct!.statusCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigResponseRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigResponseRule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._body !== undefined) { + hasAnyValues = true; + internalValueResult.body = this._body; + } + if (this._errorType !== undefined) { + hasAnyValues = true; + internalValueResult.errorType = this._errorType; + } + if (this._statusCode !== undefined) { + hasAnyValues = true; + internalValueResult.statusCode = this._statusCode; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigResponseRule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._body = undefined; + this._errorType = undefined; + this._statusCode = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._body = value.body; + this._errorType = value.errorType; + this._statusCode = value.statusCode; + } + } + + // body - computed: false, optional: false, required: true + private _body?: string; + public get body() { + return this.getStringAttribute('body'); + } + public set body(value: string) { + this._body = value; + } + // Temporarily expose input value. Use with caution. + public get bodyInput() { + return this._body; + } + + // error_type - computed: false, optional: false, required: true + private _errorType?: string; + public get errorType() { + return this.getStringAttribute('error_type'); + } + public set errorType(value: string) { + this._errorType = value; + } + // Temporarily expose input value. Use with caution. + public get errorTypeInput() { + return this._errorType; + } + + // status_code - computed: true, optional: true, required: false + private _statusCode?: number; + public get statusCode() { + return this.getNumberAttribute('status_code'); + } + public set statusCode(value: number) { + this._statusCode = value; + } + public resetStatusCode() { + this._statusCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } +} + +export class ApigResponseRuleList extends cdktf.ComplexList { + public internalValue? : ApigResponseRule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigResponseRuleOutputReference { + return new ApigResponseRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response huaweicloud_apig_response} +*/ +export class ApigResponse extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_response"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigResponse resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigResponse to import + * @param importFromId The id of the existing ApigResponse that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigResponse to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_response", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_response huaweicloud_apig_response} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigResponseConfig + */ + public constructor(scope: Construct, id: string, config: ApigResponseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_response', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupId = config.groupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._rule.internalValue = config.rule; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // rule - computed: false, optional: true, required: false + private _rule = new ApigResponseRuleList(this, "rule", true); + public get rule() { + return this._rule; + } + public putRule(value: ApigResponseRule[] | cdktf.IResolvable) { + this._rule.internalValue = value; + } + public resetRule() { + this._rule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleInput() { + return this._rule.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rule: cdktf.listMapper(apigResponseRuleToTerraform, true)(this._rule.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule: { + value: cdktf.listMapperHcl(apigResponseRuleToHclTerraform, true)(this._rule.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigResponseRuleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-signature-associate/README.md b/src/constructs/providers/huaweicloud/apig-signature-associate/README.md new file mode 100644 index 00000000..8a8a4fc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-signature-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_signature_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_signature_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate). diff --git a/src/constructs/providers/huaweicloud/apig-signature-associate/index.ts b/src/constructs/providers/huaweicloud/apig-signature-associate/index.ts new file mode 100644 index 00000000..b9b8f187 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-signature-associate/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigSignatureAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#id ApigSignatureAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the APIs and the signature belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#instance_id ApigSignatureAssociate#instance_id} + */ + readonly instanceId: string; + /** + * The publish IDs corresponding to the APIs bound by the signature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#publish_ids ApigSignatureAssociate#publish_ids} + */ + readonly publishIds: string[]; + /** + * The region where the signature and the APIs are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#region ApigSignatureAssociate#region} + */ + readonly region?: string; + /** + * The signature ID for APIs binding. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#signature_id ApigSignatureAssociate#signature_id} + */ + readonly signatureId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#timeouts ApigSignatureAssociate#timeouts} + */ + readonly timeouts?: ApigSignatureAssociateTimeouts; +} +export interface ApigSignatureAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#create ApigSignatureAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#delete ApigSignatureAssociate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#update ApigSignatureAssociate#update} + */ + readonly update?: string; +} + +export function apigSignatureAssociateTimeoutsToTerraform(struct?: ApigSignatureAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigSignatureAssociateTimeoutsToHclTerraform(struct?: ApigSignatureAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigSignatureAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigSignatureAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigSignatureAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate huaweicloud_apig_signature_associate} +*/ +export class ApigSignatureAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_signature_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigSignatureAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigSignatureAssociate to import + * @param importFromId The id of the existing ApigSignatureAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigSignatureAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_signature_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature_associate huaweicloud_apig_signature_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigSignatureAssociateConfig + */ + public constructor(scope: Construct, id: string, config: ApigSignatureAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_signature_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._publishIds = config.publishIds; + this._region = config.region; + this._signatureId = config.signatureId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // publish_ids - computed: false, optional: false, required: true + private _publishIds?: string[]; + public get publishIds() { + return cdktf.Fn.tolist(this.getListAttribute('publish_ids')); + } + public set publishIds(value: string[]) { + this._publishIds = value; + } + // Temporarily expose input value. Use with caution. + public get publishIdsInput() { + return this._publishIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // signature_id - computed: false, optional: false, required: true + private _signatureId?: string; + public get signatureId() { + return this.getStringAttribute('signature_id'); + } + public set signatureId(value: string) { + this._signatureId = value; + } + // Temporarily expose input value. Use with caution. + public get signatureIdInput() { + return this._signatureId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigSignatureAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigSignatureAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + publish_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._publishIds), + region: cdktf.stringToTerraform(this._region), + signature_id: cdktf.stringToTerraform(this._signatureId), + timeouts: apigSignatureAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publish_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._publishIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + signature_id: { + value: cdktf.stringToHclTerraform(this._signatureId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apigSignatureAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigSignatureAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-signature/README.md b/src/constructs/providers/huaweicloud/apig-signature/README.md new file mode 100644 index 00000000..ee962864 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-signature/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_signature` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_signature`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature). diff --git a/src/constructs/providers/huaweicloud/apig-signature/index.ts b/src/constructs/providers/huaweicloud/apig-signature/index.ts new file mode 100644 index 00000000..790316b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-signature/index.ts @@ -0,0 +1,327 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigSignatureConfig extends cdktf.TerraformMetaArguments { + /** + * The signature algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#algorithm ApigSignature#algorithm} + */ + readonly algorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#id ApigSignature#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the signature belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#instance_id ApigSignature#instance_id} + */ + readonly instanceId: string; + /** + * The signature key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#key ApigSignature#key} + */ + readonly key?: string; + /** + * The signature name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#name ApigSignature#name} + */ + readonly name: string; + /** + * The region where the signature is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#region ApigSignature#region} + */ + readonly region?: string; + /** + * The signature secret. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#secret ApigSignature#secret} + */ + readonly secret?: string; + /** + * The signature type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#type ApigSignature#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature huaweicloud_apig_signature} +*/ +export class ApigSignature extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_signature"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigSignature resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigSignature to import + * @param importFromId The id of the existing ApigSignature that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigSignature to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_signature", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_signature huaweicloud_apig_signature} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigSignatureConfig + */ + public constructor(scope: Construct, id: string, config: ApigSignatureConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_signature', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._algorithm = config.algorithm; + this._id = config.id; + this._instanceId = config.instanceId; + this._key = config.key; + this._name = config.name; + this._region = config.region; + this._secret = config.secret; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // algorithm - computed: true, optional: true, required: false + private _algorithm?: string; + public get algorithm() { + return this.getStringAttribute('algorithm'); + } + public set algorithm(value: string) { + this._algorithm = value; + } + public resetAlgorithm() { + this._algorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get algorithmInput() { + return this._algorithm; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // key - computed: true, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret - computed: true, optional: true, required: false + private _secret?: string; + public get secret() { + return this.getStringAttribute('secret'); + } + public set secret(value: string) { + this._secret = value; + } + public resetSecret() { + this._secret = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretInput() { + return this._secret; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + algorithm: cdktf.stringToTerraform(this._algorithm), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + key: cdktf.stringToTerraform(this._key), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secret: cdktf.stringToTerraform(this._secret), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + algorithm: { + value: cdktf.stringToHclTerraform(this._algorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret: { + value: cdktf.stringToHclTerraform(this._secret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-throttling-policy-associate/README.md b/src/constructs/providers/huaweicloud/apig-throttling-policy-associate/README.md new file mode 100644 index 00000000..e5ac051e --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-throttling-policy-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_throttling_policy_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_throttling_policy_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate). diff --git a/src/constructs/providers/huaweicloud/apig-throttling-policy-associate/index.ts b/src/constructs/providers/huaweicloud/apig-throttling-policy-associate/index.ts new file mode 100644 index 00000000..e6aa2a1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-throttling-policy-associate/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigThrottlingPolicyAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#id ApigThrottlingPolicyAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the APIs and the throttling policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#instance_id ApigThrottlingPolicyAssociate#instance_id} + */ + readonly instanceId: string; + /** + * The ID of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#policy_id ApigThrottlingPolicyAssociate#policy_id} + */ + readonly policyId: string; + /** + * The publish IDs corresponding to the APIs bound by the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#publish_ids ApigThrottlingPolicyAssociate#publish_ids} + */ + readonly publishIds: string[]; + /** + * The region where the dedicated instance and the throttling policy are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#region ApigThrottlingPolicyAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#timeouts ApigThrottlingPolicyAssociate#timeouts} + */ + readonly timeouts?: ApigThrottlingPolicyAssociateTimeouts; +} +export interface ApigThrottlingPolicyAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#create ApigThrottlingPolicyAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#delete ApigThrottlingPolicyAssociate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#update ApigThrottlingPolicyAssociate#update} + */ + readonly update?: string; +} + +export function apigThrottlingPolicyAssociateTimeoutsToTerraform(struct?: ApigThrottlingPolicyAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apigThrottlingPolicyAssociateTimeoutsToHclTerraform(struct?: ApigThrottlingPolicyAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigThrottlingPolicyAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApigThrottlingPolicyAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigThrottlingPolicyAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate huaweicloud_apig_throttling_policy_associate} +*/ +export class ApigThrottlingPolicyAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_throttling_policy_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigThrottlingPolicyAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigThrottlingPolicyAssociate to import + * @param importFromId The id of the existing ApigThrottlingPolicyAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigThrottlingPolicyAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_throttling_policy_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy_associate huaweicloud_apig_throttling_policy_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigThrottlingPolicyAssociateConfig + */ + public constructor(scope: Construct, id: string, config: ApigThrottlingPolicyAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_throttling_policy_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._policyId = config.policyId; + this._publishIds = config.publishIds; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // publish_ids - computed: false, optional: false, required: true + private _publishIds?: string[]; + public get publishIds() { + return cdktf.Fn.tolist(this.getListAttribute('publish_ids')); + } + public set publishIds(value: string[]) { + this._publishIds = value; + } + // Temporarily expose input value. Use with caution. + public get publishIdsInput() { + return this._publishIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApigThrottlingPolicyAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApigThrottlingPolicyAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + policy_id: cdktf.stringToTerraform(this._policyId), + publish_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._publishIds), + region: cdktf.stringToTerraform(this._region), + timeouts: apigThrottlingPolicyAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publish_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._publishIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apigThrottlingPolicyAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApigThrottlingPolicyAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-throttling-policy/README.md b/src/constructs/providers/huaweicloud/apig-throttling-policy/README.md new file mode 100644 index 00000000..a1f0d5b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-throttling-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_throttling_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_throttling_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy). diff --git a/src/constructs/providers/huaweicloud/apig-throttling-policy/index.ts b/src/constructs/providers/huaweicloud/apig-throttling-policy/index.ts new file mode 100644 index 00000000..51bec2ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-throttling-policy/index.ts @@ -0,0 +1,813 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigThrottlingPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The description about the API throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#description ApigThrottlingPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#id ApigThrottlingPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the throttling policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#instance_id ApigThrottlingPolicy#instance_id} + */ + readonly instanceId: string; + /** + * The maximum number of times an API can be accessed within a specified period.. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#max_api_requests ApigThrottlingPolicy#max_api_requests} + */ + readonly maxApiRequests: number; + /** + * The maximum number of times the API can be accessed by an app within the same period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#max_app_requests ApigThrottlingPolicy#max_app_requests} + */ + readonly maxAppRequests?: number; + /** + * The maximum number of times the API can be accessed by an IP address within the same period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#max_ip_requests ApigThrottlingPolicy#max_ip_requests} + */ + readonly maxIpRequests?: number; + /** + * The maximum number of times the API can be accessed by a user within the same period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#max_user_requests ApigThrottlingPolicy#max_user_requests} + */ + readonly maxUserRequests?: number; + /** + * The name of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#name ApigThrottlingPolicy#name} + */ + readonly name: string; + /** + * The period of time for limiting the number of API calls. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#period ApigThrottlingPolicy#period} + */ + readonly period: number; + /** + * The time unit for limiting the number of API calls. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#period_unit ApigThrottlingPolicy#period_unit} + */ + readonly periodUnit?: string; + /** + * The region where the throttling policy is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#region ApigThrottlingPolicy#region} + */ + readonly region?: string; + /** + * The type of the request throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#type ApigThrottlingPolicy#type} + */ + readonly type?: string; + /** + * app_throttles block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#app_throttles ApigThrottlingPolicy#app_throttles} + */ + readonly appThrottles?: ApigThrottlingPolicyAppThrottles[] | cdktf.IResolvable; + /** + * user_throttles block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#user_throttles ApigThrottlingPolicy#user_throttles} + */ + readonly userThrottles?: ApigThrottlingPolicyUserThrottles[] | cdktf.IResolvable; +} +export interface ApigThrottlingPolicyAppThrottles { + /** + * The maximum number of times an API can be accessed within a specified period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#max_api_requests ApigThrottlingPolicy#max_api_requests} + */ + readonly maxApiRequests: number; + /** + * The object ID which the special throttling policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#throttling_object_id ApigThrottlingPolicy#throttling_object_id} + */ + readonly throttlingObjectId: string; +} + +export function apigThrottlingPolicyAppThrottlesToTerraform(struct?: ApigThrottlingPolicyAppThrottles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + max_api_requests: cdktf.numberToTerraform(struct!.maxApiRequests), + throttling_object_id: cdktf.stringToTerraform(struct!.throttlingObjectId), + } +} + + +export function apigThrottlingPolicyAppThrottlesToHclTerraform(struct?: ApigThrottlingPolicyAppThrottles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + max_api_requests: { + value: cdktf.numberToHclTerraform(struct!.maxApiRequests), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + throttling_object_id: { + value: cdktf.stringToHclTerraform(struct!.throttlingObjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigThrottlingPolicyAppThrottlesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigThrottlingPolicyAppThrottles | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._maxApiRequests !== undefined) { + hasAnyValues = true; + internalValueResult.maxApiRequests = this._maxApiRequests; + } + if (this._throttlingObjectId !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingObjectId = this._throttlingObjectId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigThrottlingPolicyAppThrottles | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._maxApiRequests = undefined; + this._throttlingObjectId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._maxApiRequests = value.maxApiRequests; + this._throttlingObjectId = value.throttlingObjectId; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: false, optional: false, required: true + private _maxApiRequests?: number; + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + public set maxApiRequests(value: number) { + this._maxApiRequests = value; + } + // Temporarily expose input value. Use with caution. + public get maxApiRequestsInput() { + return this._maxApiRequests; + } + + // throttling_object_id - computed: false, optional: false, required: true + private _throttlingObjectId?: string; + public get throttlingObjectId() { + return this.getStringAttribute('throttling_object_id'); + } + public set throttlingObjectId(value: string) { + this._throttlingObjectId = value; + } + // Temporarily expose input value. Use with caution. + public get throttlingObjectIdInput() { + return this._throttlingObjectId; + } + + // throttling_object_name - computed: true, optional: false, required: false + public get throttlingObjectName() { + return this.getStringAttribute('throttling_object_name'); + } +} + +export class ApigThrottlingPolicyAppThrottlesList extends cdktf.ComplexList { + public internalValue? : ApigThrottlingPolicyAppThrottles[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigThrottlingPolicyAppThrottlesOutputReference { + return new ApigThrottlingPolicyAppThrottlesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ApigThrottlingPolicyUserThrottles { + /** + * The maximum number of times an API can be accessed within a specified period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#max_api_requests ApigThrottlingPolicy#max_api_requests} + */ + readonly maxApiRequests: number; + /** + * The object ID which the special throttling policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#throttling_object_id ApigThrottlingPolicy#throttling_object_id} + */ + readonly throttlingObjectId: string; +} + +export function apigThrottlingPolicyUserThrottlesToTerraform(struct?: ApigThrottlingPolicyUserThrottles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + max_api_requests: cdktf.numberToTerraform(struct!.maxApiRequests), + throttling_object_id: cdktf.stringToTerraform(struct!.throttlingObjectId), + } +} + + +export function apigThrottlingPolicyUserThrottlesToHclTerraform(struct?: ApigThrottlingPolicyUserThrottles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + max_api_requests: { + value: cdktf.numberToHclTerraform(struct!.maxApiRequests), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + throttling_object_id: { + value: cdktf.stringToHclTerraform(struct!.throttlingObjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigThrottlingPolicyUserThrottlesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigThrottlingPolicyUserThrottles | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._maxApiRequests !== undefined) { + hasAnyValues = true; + internalValueResult.maxApiRequests = this._maxApiRequests; + } + if (this._throttlingObjectId !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingObjectId = this._throttlingObjectId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigThrottlingPolicyUserThrottles | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._maxApiRequests = undefined; + this._throttlingObjectId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._maxApiRequests = value.maxApiRequests; + this._throttlingObjectId = value.throttlingObjectId; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: false, optional: false, required: true + private _maxApiRequests?: number; + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + public set maxApiRequests(value: number) { + this._maxApiRequests = value; + } + // Temporarily expose input value. Use with caution. + public get maxApiRequestsInput() { + return this._maxApiRequests; + } + + // throttling_object_id - computed: false, optional: false, required: true + private _throttlingObjectId?: string; + public get throttlingObjectId() { + return this.getStringAttribute('throttling_object_id'); + } + public set throttlingObjectId(value: string) { + this._throttlingObjectId = value; + } + // Temporarily expose input value. Use with caution. + public get throttlingObjectIdInput() { + return this._throttlingObjectId; + } + + // throttling_object_name - computed: true, optional: false, required: false + public get throttlingObjectName() { + return this.getStringAttribute('throttling_object_name'); + } +} + +export class ApigThrottlingPolicyUserThrottlesList extends cdktf.ComplexList { + public internalValue? : ApigThrottlingPolicyUserThrottles[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigThrottlingPolicyUserThrottlesOutputReference { + return new ApigThrottlingPolicyUserThrottlesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy huaweicloud_apig_throttling_policy} +*/ +export class ApigThrottlingPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_throttling_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigThrottlingPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigThrottlingPolicy to import + * @param importFromId The id of the existing ApigThrottlingPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigThrottlingPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_throttling_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_throttling_policy huaweicloud_apig_throttling_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigThrottlingPolicyConfig + */ + public constructor(scope: Construct, id: string, config: ApigThrottlingPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_throttling_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._maxApiRequests = config.maxApiRequests; + this._maxAppRequests = config.maxAppRequests; + this._maxIpRequests = config.maxIpRequests; + this._maxUserRequests = config.maxUserRequests; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._type = config.type; + this._appThrottles.internalValue = config.appThrottles; + this._userThrottles.internalValue = config.userThrottles; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // max_api_requests - computed: false, optional: false, required: true + private _maxApiRequests?: number; + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + public set maxApiRequests(value: number) { + this._maxApiRequests = value; + } + // Temporarily expose input value. Use with caution. + public get maxApiRequestsInput() { + return this._maxApiRequests; + } + + // max_app_requests - computed: false, optional: true, required: false + private _maxAppRequests?: number; + public get maxAppRequests() { + return this.getNumberAttribute('max_app_requests'); + } + public set maxAppRequests(value: number) { + this._maxAppRequests = value; + } + public resetMaxAppRequests() { + this._maxAppRequests = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxAppRequestsInput() { + return this._maxAppRequests; + } + + // max_ip_requests - computed: false, optional: true, required: false + private _maxIpRequests?: number; + public get maxIpRequests() { + return this.getNumberAttribute('max_ip_requests'); + } + public set maxIpRequests(value: number) { + this._maxIpRequests = value; + } + public resetMaxIpRequests() { + this._maxIpRequests = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxIpRequestsInput() { + return this._maxIpRequests; + } + + // max_user_requests - computed: false, optional: true, required: false + private _maxUserRequests?: number; + public get maxUserRequests() { + return this.getNumberAttribute('max_user_requests'); + } + public set maxUserRequests(value: number) { + this._maxUserRequests = value; + } + public resetMaxUserRequests() { + this._maxUserRequests = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxUserRequestsInput() { + return this._maxUserRequests; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // app_throttles - computed: false, optional: true, required: false + private _appThrottles = new ApigThrottlingPolicyAppThrottlesList(this, "app_throttles", true); + public get appThrottles() { + return this._appThrottles; + } + public putAppThrottles(value: ApigThrottlingPolicyAppThrottles[] | cdktf.IResolvable) { + this._appThrottles.internalValue = value; + } + public resetAppThrottles() { + this._appThrottles.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get appThrottlesInput() { + return this._appThrottles.internalValue; + } + + // user_throttles - computed: false, optional: true, required: false + private _userThrottles = new ApigThrottlingPolicyUserThrottlesList(this, "user_throttles", true); + public get userThrottles() { + return this._userThrottles; + } + public putUserThrottles(value: ApigThrottlingPolicyUserThrottles[] | cdktf.IResolvable) { + this._userThrottles.internalValue = value; + } + public resetUserThrottles() { + this._userThrottles.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get userThrottlesInput() { + return this._userThrottles.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + max_api_requests: cdktf.numberToTerraform(this._maxApiRequests), + max_app_requests: cdktf.numberToTerraform(this._maxAppRequests), + max_ip_requests: cdktf.numberToTerraform(this._maxIpRequests), + max_user_requests: cdktf.numberToTerraform(this._maxUserRequests), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + app_throttles: cdktf.listMapper(apigThrottlingPolicyAppThrottlesToTerraform, true)(this._appThrottles.internalValue), + user_throttles: cdktf.listMapper(apigThrottlingPolicyUserThrottlesToTerraform, true)(this._userThrottles.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_api_requests: { + value: cdktf.numberToHclTerraform(this._maxApiRequests), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_app_requests: { + value: cdktf.numberToHclTerraform(this._maxAppRequests), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_ip_requests: { + value: cdktf.numberToHclTerraform(this._maxIpRequests), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_user_requests: { + value: cdktf.numberToHclTerraform(this._maxUserRequests), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_throttles: { + value: cdktf.listMapperHcl(apigThrottlingPolicyAppThrottlesToHclTerraform, true)(this._appThrottles.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigThrottlingPolicyAppThrottlesList", + }, + user_throttles: { + value: cdktf.listMapperHcl(apigThrottlingPolicyUserThrottlesToHclTerraform, true)(this._userThrottles.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigThrottlingPolicyUserThrottlesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apig-vpc-channel/README.md b/src/constructs/providers/huaweicloud/apig-vpc-channel/README.md new file mode 100644 index 00000000..b3e8bd71 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-vpc-channel/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apig_vpc_channel` + +Refer to the Terraform Registry for docs: [`huaweicloud_apig_vpc_channel`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel). diff --git a/src/constructs/providers/huaweicloud/apig-vpc-channel/index.ts b/src/constructs/providers/huaweicloud/apig-vpc-channel/index.ts new file mode 100644 index 00000000..0d1bf013 --- /dev/null +++ b/src/constructs/providers/huaweicloud/apig-vpc-channel/index.ts @@ -0,0 +1,725 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApigVpcChannelConfig extends cdktf.TerraformMetaArguments { + /** + * The distribution algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#algorithm ApigVpcChannel#algorithm} + */ + readonly algorithm?: string; + /** + * The the healthy threshold, which refers to the number of consecutive successful checks required for a backend server to be considered healthy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#healthy_threshold ApigVpcChannel#healthy_threshold} + */ + readonly healthyThreshold?: number; + /** + * The response codes for determining a successful HTTP response. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#http_code ApigVpcChannel#http_code} + */ + readonly httpCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#id ApigVpcChannel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the VPC channel belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#instance_id ApigVpcChannel#instance_id} + */ + readonly instanceId: string; + /** + * The interval between consecutive checks, in second. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#interval ApigVpcChannel#interval} + */ + readonly interval?: number; + /** + * The member type of the VPC channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#member_type ApigVpcChannel#member_type} + */ + readonly memberType?: string; + /** + * The name of the VPC channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#name ApigVpcChannel#name} + */ + readonly name: string; + /** + * The destination path for health checks. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#path ApigVpcChannel#path} + */ + readonly path?: string; + /** + * The host port of the VPC channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#port ApigVpcChannel#port} + */ + readonly port: number; + /** + * The rotocol for performing health checks on backend servers in the VPC channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#protocol ApigVpcChannel#protocol} + */ + readonly protocol?: string; + /** + * The region where the dedicated instance is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#region ApigVpcChannel#region} + */ + readonly region?: string; + /** + * The timeout for determining whether a health check fails, in second. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#timeout ApigVpcChannel#timeout} + */ + readonly timeout?: number; + /** + * The unhealthy threshold, which refers to the number of consecutive failed checks required for a backend server to be considered unhealthy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#unhealthy_threshold ApigVpcChannel#unhealthy_threshold} + */ + readonly unhealthyThreshold?: number; + /** + * members block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#members ApigVpcChannel#members} + */ + readonly members: ApigVpcChannelMembers[] | cdktf.IResolvable; +} +export interface ApigVpcChannelMembers { + /** + * The ID of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#id ApigVpcChannel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The IP address of the backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#ip_address ApigVpcChannel#ip_address} + */ + readonly ipAddress?: string; + /** + * The weight of current backend server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#weight ApigVpcChannel#weight} + */ + readonly weight?: number; +} + +export function apigVpcChannelMembersToTerraform(struct?: ApigVpcChannelMembers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function apigVpcChannelMembersToHclTerraform(struct?: ApigVpcChannelMembers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApigVpcChannelMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ApigVpcChannelMembers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApigVpcChannelMembers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._ipAddress = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._ipAddress = value.ipAddress; + this._weight = value.weight; + } + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // weight - computed: false, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class ApigVpcChannelMembersList extends cdktf.ComplexList { + public internalValue? : ApigVpcChannelMembers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ApigVpcChannelMembersOutputReference { + return new ApigVpcChannelMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel huaweicloud_apig_vpc_channel} +*/ +export class ApigVpcChannel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_vpc_channel"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApigVpcChannel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApigVpcChannel to import + * @param importFromId The id of the existing ApigVpcChannel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApigVpcChannel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_vpc_channel", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apig_vpc_channel huaweicloud_apig_vpc_channel} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApigVpcChannelConfig + */ + public constructor(scope: Construct, id: string, config: ApigVpcChannelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_vpc_channel', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._algorithm = config.algorithm; + this._healthyThreshold = config.healthyThreshold; + this._httpCode = config.httpCode; + this._id = config.id; + this._instanceId = config.instanceId; + this._interval = config.interval; + this._memberType = config.memberType; + this._name = config.name; + this._path = config.path; + this._port = config.port; + this._protocol = config.protocol; + this._region = config.region; + this._timeout = config.timeout; + this._unhealthyThreshold = config.unhealthyThreshold; + this._members.internalValue = config.members; + } + + // ========== + // ATTRIBUTES + // ========== + + // algorithm - computed: false, optional: true, required: false + private _algorithm?: string; + public get algorithm() { + return this.getStringAttribute('algorithm'); + } + public set algorithm(value: string) { + this._algorithm = value; + } + public resetAlgorithm() { + this._algorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get algorithmInput() { + return this._algorithm; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // healthy_threshold - computed: false, optional: true, required: false + private _healthyThreshold?: number; + public get healthyThreshold() { + return this.getNumberAttribute('healthy_threshold'); + } + public set healthyThreshold(value: number) { + this._healthyThreshold = value; + } + public resetHealthyThreshold() { + this._healthyThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthyThresholdInput() { + return this._healthyThreshold; + } + + // http_code - computed: false, optional: true, required: false + private _httpCode?: string; + public get httpCode() { + return this.getStringAttribute('http_code'); + } + public set httpCode(value: string) { + this._httpCode = value; + } + public resetHttpCode() { + this._httpCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCodeInput() { + return this._httpCode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // interval - computed: false, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // member_type - computed: false, optional: true, required: false + private _memberType?: string; + public get memberType() { + return this.getStringAttribute('member_type'); + } + public set memberType(value: string) { + this._memberType = value; + } + public resetMemberType() { + this._memberType = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberTypeInput() { + return this._memberType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // unhealthy_threshold - computed: false, optional: true, required: false + private _unhealthyThreshold?: number; + public get unhealthyThreshold() { + return this.getNumberAttribute('unhealthy_threshold'); + } + public set unhealthyThreshold(value: number) { + this._unhealthyThreshold = value; + } + public resetUnhealthyThreshold() { + this._unhealthyThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get unhealthyThresholdInput() { + return this._unhealthyThreshold; + } + + // members - computed: false, optional: false, required: true + private _members = new ApigVpcChannelMembersList(this, "members", true); + public get members() { + return this._members; + } + public putMembers(value: ApigVpcChannelMembers[] | cdktf.IResolvable) { + this._members.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get membersInput() { + return this._members.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + algorithm: cdktf.stringToTerraform(this._algorithm), + healthy_threshold: cdktf.numberToTerraform(this._healthyThreshold), + http_code: cdktf.stringToTerraform(this._httpCode), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + interval: cdktf.numberToTerraform(this._interval), + member_type: cdktf.stringToTerraform(this._memberType), + name: cdktf.stringToTerraform(this._name), + path: cdktf.stringToTerraform(this._path), + port: cdktf.numberToTerraform(this._port), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + timeout: cdktf.numberToTerraform(this._timeout), + unhealthy_threshold: cdktf.numberToTerraform(this._unhealthyThreshold), + members: cdktf.listMapper(apigVpcChannelMembersToTerraform, true)(this._members.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + algorithm: { + value: cdktf.stringToHclTerraform(this._algorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + healthy_threshold: { + value: cdktf.numberToHclTerraform(this._healthyThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + http_code: { + value: cdktf.stringToHclTerraform(this._httpCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(this._interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + member_type: { + value: cdktf.stringToHclTerraform(this._memberType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + unhealthy_threshold: { + value: cdktf.numberToHclTerraform(this._unhealthyThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + members: { + value: cdktf.listMapperHcl(apigVpcChannelMembersToHclTerraform, true)(this._members.internalValue), + isBlock: true, + type: "set", + storageClassType: "ApigVpcChannelMembersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/apm-aksk/README.md b/src/constructs/providers/huaweicloud/apm-aksk/README.md new file mode 100644 index 00000000..df1297fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/apm-aksk/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_apm_aksk` + +Refer to the Terraform Registry for docs: [`huaweicloud_apm_aksk`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk). diff --git a/src/constructs/providers/huaweicloud/apm-aksk/index.ts b/src/constructs/providers/huaweicloud/apm-aksk/index.ts new file mode 100644 index 00000000..8ede9a8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/apm-aksk/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ApmAkskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#description ApmAksk#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#id ApmAksk#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#timeouts ApmAksk#timeouts} + */ + readonly timeouts?: ApmAkskTimeouts; +} +export interface ApmAkskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#create ApmAksk#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#delete ApmAksk#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#update ApmAksk#update} + */ + readonly update?: string; +} + +export function apmAkskTimeoutsToTerraform(struct?: ApmAkskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function apmAkskTimeoutsToHclTerraform(struct?: ApmAkskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ApmAkskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ApmAkskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ApmAkskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk huaweicloud_apm_aksk} +*/ +export class ApmAksk extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apm_aksk"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ApmAksk resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ApmAksk to import + * @param importFromId The id of the existing ApmAksk that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ApmAksk to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apm_aksk", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/apm_aksk huaweicloud_apm_aksk} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ApmAkskConfig = {} + */ + public constructor(scope: Construct, id: string, config: ApmAkskConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apm_aksk', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: true, optional: false, required: false + public get accessKey() { + return this.getStringAttribute('access_key'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // secret_key - computed: true, optional: false, required: false + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ApmAkskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ApmAkskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + timeouts: apmAkskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: apmAkskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ApmAkskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-bandwidth-policy/README.md b/src/constructs/providers/huaweicloud/as-bandwidth-policy/README.md new file mode 100644 index 00000000..6970ba8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-bandwidth-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_bandwidth_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_bandwidth_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy). diff --git a/src/constructs/providers/huaweicloud/as-bandwidth-policy/index.ts b/src/constructs/providers/huaweicloud/as-bandwidth-policy/index.ts new file mode 100644 index 00000000..5313751a --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-bandwidth-policy/index.ts @@ -0,0 +1,764 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsBandwidthPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the alarm rule ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#alarm_id AsBandwidthPolicy#alarm_id} + */ + readonly alarmId?: string; + /** + * Specifies the scaling bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#bandwidth_id AsBandwidthPolicy#bandwidth_id} + */ + readonly bandwidthId: string; + /** + * Specifies the cooldown period (in seconds). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#cool_down_time AsBandwidthPolicy#cool_down_time} + */ + readonly coolDownTime?: number; + /** + * Specifies the description of the AS policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#description AsBandwidthPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#id AsBandwidthPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#region AsBandwidthPolicy#region} + */ + readonly region?: string; + /** + * Specifies the AS policy name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#scaling_policy_name AsBandwidthPolicy#scaling_policy_name} + */ + readonly scalingPolicyName: string; + /** + * Specifies the AS policy type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#scaling_policy_type AsBandwidthPolicy#scaling_policy_type} + */ + readonly scalingPolicyType: string; + /** + * scaling_policy_action block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#scaling_policy_action AsBandwidthPolicy#scaling_policy_action} + */ + readonly scalingPolicyAction?: AsBandwidthPolicyScalingPolicyAction; + /** + * scheduled_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#scheduled_policy AsBandwidthPolicy#scheduled_policy} + */ + readonly scheduledPolicy?: AsBandwidthPolicyScheduledPolicy; +} +export interface AsBandwidthPolicyScalingPolicyAction { + /** + * Specifies the operation restrictions. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#limits AsBandwidthPolicy#limits} + */ + readonly limits?: number; + /** + * Specifies the operation to be performed. The default operation is ADD. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#operation AsBandwidthPolicy#operation} + */ + readonly operation?: string; + /** + * Specifies the bandwidth (Mbit/s). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#size AsBandwidthPolicy#size} + */ + readonly size?: number; +} + +export function asBandwidthPolicyScalingPolicyActionToTerraform(struct?: AsBandwidthPolicyScalingPolicyActionOutputReference | AsBandwidthPolicyScalingPolicyAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + limits: cdktf.numberToTerraform(struct!.limits), + operation: cdktf.stringToTerraform(struct!.operation), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function asBandwidthPolicyScalingPolicyActionToHclTerraform(struct?: AsBandwidthPolicyScalingPolicyActionOutputReference | AsBandwidthPolicyScalingPolicyAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + limits: { + value: cdktf.numberToHclTerraform(struct!.limits), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + operation: { + value: cdktf.stringToHclTerraform(struct!.operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsBandwidthPolicyScalingPolicyActionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsBandwidthPolicyScalingPolicyAction | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._limits !== undefined) { + hasAnyValues = true; + internalValueResult.limits = this._limits; + } + if (this._operation !== undefined) { + hasAnyValues = true; + internalValueResult.operation = this._operation; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsBandwidthPolicyScalingPolicyAction | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._limits = undefined; + this._operation = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._limits = value.limits; + this._operation = value.operation; + this._size = value.size; + } + } + + // limits - computed: true, optional: true, required: false + private _limits?: number; + public get limits() { + return this.getNumberAttribute('limits'); + } + public set limits(value: number) { + this._limits = value; + } + public resetLimits() { + this._limits = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitsInput() { + return this._limits; + } + + // operation - computed: true, optional: true, required: false + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + public resetOperation() { + this._operation = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface AsBandwidthPolicyScheduledPolicy { + /** + * Specifies the end time of the scaling action triggered periodically. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#end_time AsBandwidthPolicy#end_time} + */ + readonly endTime?: string; + /** + * Specifies the time when the scaling action is triggered. The time format complies with UTC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#launch_time AsBandwidthPolicy#launch_time} + */ + readonly launchTime: string; + /** + * Specifies the periodic triggering type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#recurrence_type AsBandwidthPolicy#recurrence_type} + */ + readonly recurrenceType?: string; + /** + * Specifies the day when a periodic scaling action is triggered. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#recurrence_value AsBandwidthPolicy#recurrence_value} + */ + readonly recurrenceValue?: string; + /** + * Specifies the start time of the scaling action triggered periodically. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#start_time AsBandwidthPolicy#start_time} + */ + readonly startTime?: string; +} + +export function asBandwidthPolicyScheduledPolicyToTerraform(struct?: AsBandwidthPolicyScheduledPolicyOutputReference | AsBandwidthPolicyScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + launch_time: cdktf.stringToTerraform(struct!.launchTime), + recurrence_type: cdktf.stringToTerraform(struct!.recurrenceType), + recurrence_value: cdktf.stringToTerraform(struct!.recurrenceValue), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function asBandwidthPolicyScheduledPolicyToHclTerraform(struct?: AsBandwidthPolicyScheduledPolicyOutputReference | AsBandwidthPolicyScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + launch_time: { + value: cdktf.stringToHclTerraform(struct!.launchTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_type: { + value: cdktf.stringToHclTerraform(struct!.recurrenceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_value: { + value: cdktf.stringToHclTerraform(struct!.recurrenceValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsBandwidthPolicyScheduledPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsBandwidthPolicyScheduledPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._launchTime !== undefined) { + hasAnyValues = true; + internalValueResult.launchTime = this._launchTime; + } + if (this._recurrenceType !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceType = this._recurrenceType; + } + if (this._recurrenceValue !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceValue = this._recurrenceValue; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsBandwidthPolicyScheduledPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endTime = undefined; + this._launchTime = undefined; + this._recurrenceType = undefined; + this._recurrenceValue = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endTime = value.endTime; + this._launchTime = value.launchTime; + this._recurrenceType = value.recurrenceType; + this._recurrenceValue = value.recurrenceValue; + this._startTime = value.startTime; + } + } + + // end_time - computed: true, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // launch_time - computed: false, optional: false, required: true + private _launchTime?: string; + public get launchTime() { + return this.getStringAttribute('launch_time'); + } + public set launchTime(value: string) { + this._launchTime = value; + } + // Temporarily expose input value. Use with caution. + public get launchTimeInput() { + return this._launchTime; + } + + // recurrence_type - computed: true, optional: true, required: false + private _recurrenceType?: string; + public get recurrenceType() { + return this.getStringAttribute('recurrence_type'); + } + public set recurrenceType(value: string) { + this._recurrenceType = value; + } + public resetRecurrenceType() { + this._recurrenceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceTypeInput() { + return this._recurrenceType; + } + + // recurrence_value - computed: true, optional: true, required: false + private _recurrenceValue?: string; + public get recurrenceValue() { + return this.getStringAttribute('recurrence_value'); + } + public set recurrenceValue(value: string) { + this._recurrenceValue = value; + } + public resetRecurrenceValue() { + this._recurrenceValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceValueInput() { + return this._recurrenceValue; + } + + // start_time - computed: true, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy huaweicloud_as_bandwidth_policy} +*/ +export class AsBandwidthPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_bandwidth_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsBandwidthPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsBandwidthPolicy to import + * @param importFromId The id of the existing AsBandwidthPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsBandwidthPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_bandwidth_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_bandwidth_policy huaweicloud_as_bandwidth_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsBandwidthPolicyConfig + */ + public constructor(scope: Construct, id: string, config: AsBandwidthPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_bandwidth_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmId = config.alarmId; + this._bandwidthId = config.bandwidthId; + this._coolDownTime = config.coolDownTime; + this._description = config.description; + this._id = config.id; + this._region = config.region; + this._scalingPolicyName = config.scalingPolicyName; + this._scalingPolicyType = config.scalingPolicyType; + this._scalingPolicyAction.internalValue = config.scalingPolicyAction; + this._scheduledPolicy.internalValue = config.scheduledPolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_id - computed: true, optional: true, required: false + private _alarmId?: string; + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + public set alarmId(value: string) { + this._alarmId = value; + } + public resetAlarmId() { + this._alarmId = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmIdInput() { + return this._alarmId; + } + + // bandwidth_id - computed: false, optional: false, required: true + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // cool_down_time - computed: true, optional: true, required: false + private _coolDownTime?: number; + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + public set coolDownTime(value: number) { + this._coolDownTime = value; + } + public resetCoolDownTime() { + this._coolDownTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get coolDownTimeInput() { + return this._coolDownTime; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_policy_name - computed: false, optional: false, required: true + private _scalingPolicyName?: string; + public get scalingPolicyName() { + return this.getStringAttribute('scaling_policy_name'); + } + public set scalingPolicyName(value: string) { + this._scalingPolicyName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyNameInput() { + return this._scalingPolicyName; + } + + // scaling_policy_type - computed: false, optional: false, required: true + private _scalingPolicyType?: string; + public get scalingPolicyType() { + return this.getStringAttribute('scaling_policy_type'); + } + public set scalingPolicyType(value: string) { + this._scalingPolicyType = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyTypeInput() { + return this._scalingPolicyType; + } + + // scaling_resource_type - computed: true, optional: false, required: false + public get scalingResourceType() { + return this.getStringAttribute('scaling_resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // scaling_policy_action - computed: false, optional: true, required: false + private _scalingPolicyAction = new AsBandwidthPolicyScalingPolicyActionOutputReference(this, "scaling_policy_action"); + public get scalingPolicyAction() { + return this._scalingPolicyAction; + } + public putScalingPolicyAction(value: AsBandwidthPolicyScalingPolicyAction) { + this._scalingPolicyAction.internalValue = value; + } + public resetScalingPolicyAction() { + this._scalingPolicyAction.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyActionInput() { + return this._scalingPolicyAction.internalValue; + } + + // scheduled_policy - computed: false, optional: true, required: false + private _scheduledPolicy = new AsBandwidthPolicyScheduledPolicyOutputReference(this, "scheduled_policy"); + public get scheduledPolicy() { + return this._scheduledPolicy; + } + public putScheduledPolicy(value: AsBandwidthPolicyScheduledPolicy) { + this._scheduledPolicy.internalValue = value; + } + public resetScheduledPolicy() { + this._scheduledPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduledPolicyInput() { + return this._scheduledPolicy.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_id: cdktf.stringToTerraform(this._alarmId), + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + cool_down_time: cdktf.numberToTerraform(this._coolDownTime), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_policy_name: cdktf.stringToTerraform(this._scalingPolicyName), + scaling_policy_type: cdktf.stringToTerraform(this._scalingPolicyType), + scaling_policy_action: asBandwidthPolicyScalingPolicyActionToTerraform(this._scalingPolicyAction.internalValue), + scheduled_policy: asBandwidthPolicyScheduledPolicyToTerraform(this._scheduledPolicy.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_id: { + value: cdktf.stringToHclTerraform(this._alarmId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cool_down_time: { + value: cdktf.numberToHclTerraform(this._coolDownTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_name: { + value: cdktf.stringToHclTerraform(this._scalingPolicyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_type: { + value: cdktf.stringToHclTerraform(this._scalingPolicyType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_action: { + value: asBandwidthPolicyScalingPolicyActionToHclTerraform(this._scalingPolicyAction.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsBandwidthPolicyScalingPolicyActionList", + }, + scheduled_policy: { + value: asBandwidthPolicyScheduledPolicyToHclTerraform(this._scheduledPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsBandwidthPolicyScheduledPolicyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-configuration-v1/README.md b/src/constructs/providers/huaweicloud/as-configuration-v1/README.md new file mode 100644 index 00000000..6004f27c --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-configuration-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_configuration_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_configuration_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1). diff --git a/src/constructs/providers/huaweicloud/as-configuration-v1/index.ts b/src/constructs/providers/huaweicloud/as-configuration-v1/index.ts new file mode 100644 index 00000000..2d1b94a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-configuration-v1/index.ts @@ -0,0 +1,1681 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsConfigurationV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#id AsConfigurationV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#region AsConfigurationV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#scaling_configuration_name AsConfigurationV1#scaling_configuration_name} + */ + readonly scalingConfigurationName: string; + /** + * instance_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#instance_config AsConfigurationV1#instance_config} + */ + readonly instanceConfig: AsConfigurationV1InstanceConfig; +} +export interface AsConfigurationV1InstanceConfigDisk { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#data_disk_image_id AsConfigurationV1#data_disk_image_id} + */ + readonly dataDiskImageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#dedicated_storage_id AsConfigurationV1#dedicated_storage_id} + */ + readonly dedicatedStorageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#disk_type AsConfigurationV1#disk_type} + */ + readonly diskType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#iops AsConfigurationV1#iops} + */ + readonly iops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#kms_id AsConfigurationV1#kms_id} + */ + readonly kmsId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#size AsConfigurationV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#snapshot_id AsConfigurationV1#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#throughput AsConfigurationV1#throughput} + */ + readonly throughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#volume_type AsConfigurationV1#volume_type} + */ + readonly volumeType: string; +} + +export function asConfigurationV1InstanceConfigDiskToTerraform(struct?: AsConfigurationV1InstanceConfigDisk | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data_disk_image_id: cdktf.stringToTerraform(struct!.dataDiskImageId), + dedicated_storage_id: cdktf.stringToTerraform(struct!.dedicatedStorageId), + disk_type: cdktf.stringToTerraform(struct!.diskType), + iops: cdktf.numberToTerraform(struct!.iops), + kms_id: cdktf.stringToTerraform(struct!.kmsId), + size: cdktf.numberToTerraform(struct!.size), + snapshot_id: cdktf.stringToTerraform(struct!.snapshotId), + throughput: cdktf.numberToTerraform(struct!.throughput), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function asConfigurationV1InstanceConfigDiskToHclTerraform(struct?: AsConfigurationV1InstanceConfigDisk | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data_disk_image_id: { + value: cdktf.stringToHclTerraform(struct!.dataDiskImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_storage_id: { + value: cdktf.stringToHclTerraform(struct!.dedicatedStorageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk_type: { + value: cdktf.stringToHclTerraform(struct!.diskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iops: { + value: cdktf.numberToHclTerraform(struct!.iops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kms_id: { + value: cdktf.stringToHclTerraform(struct!.kmsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(struct!.snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throughput: { + value: cdktf.numberToHclTerraform(struct!.throughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationV1InstanceConfigDiskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsConfigurationV1InstanceConfigDisk | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dataDiskImageId !== undefined) { + hasAnyValues = true; + internalValueResult.dataDiskImageId = this._dataDiskImageId; + } + if (this._dedicatedStorageId !== undefined) { + hasAnyValues = true; + internalValueResult.dedicatedStorageId = this._dedicatedStorageId; + } + if (this._diskType !== undefined) { + hasAnyValues = true; + internalValueResult.diskType = this._diskType; + } + if (this._iops !== undefined) { + hasAnyValues = true; + internalValueResult.iops = this._iops; + } + if (this._kmsId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsId = this._kmsId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._snapshotId !== undefined) { + hasAnyValues = true; + internalValueResult.snapshotId = this._snapshotId; + } + if (this._throughput !== undefined) { + hasAnyValues = true; + internalValueResult.throughput = this._throughput; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationV1InstanceConfigDisk | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dataDiskImageId = undefined; + this._dedicatedStorageId = undefined; + this._diskType = undefined; + this._iops = undefined; + this._kmsId = undefined; + this._size = undefined; + this._snapshotId = undefined; + this._throughput = undefined; + this._volumeType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dataDiskImageId = value.dataDiskImageId; + this._dedicatedStorageId = value.dedicatedStorageId; + this._diskType = value.diskType; + this._iops = value.iops; + this._kmsId = value.kmsId; + this._size = value.size; + this._snapshotId = value.snapshotId; + this._throughput = value.throughput; + this._volumeType = value.volumeType; + } + } + + // data_disk_image_id - computed: true, optional: true, required: false + private _dataDiskImageId?: string; + public get dataDiskImageId() { + return this.getStringAttribute('data_disk_image_id'); + } + public set dataDiskImageId(value: string) { + this._dataDiskImageId = value; + } + public resetDataDiskImageId() { + this._dataDiskImageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDiskImageIdInput() { + return this._dataDiskImageId; + } + + // dedicated_storage_id - computed: true, optional: true, required: false + private _dedicatedStorageId?: string; + public get dedicatedStorageId() { + return this.getStringAttribute('dedicated_storage_id'); + } + public set dedicatedStorageId(value: string) { + this._dedicatedStorageId = value; + } + public resetDedicatedStorageId() { + this._dedicatedStorageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedStorageIdInput() { + return this._dedicatedStorageId; + } + + // disk_type - computed: false, optional: false, required: true + private _diskType?: string; + public get diskType() { + return this.getStringAttribute('disk_type'); + } + public set diskType(value: string) { + this._diskType = value; + } + // Temporarily expose input value. Use with caution. + public get diskTypeInput() { + return this._diskType; + } + + // iops - computed: true, optional: true, required: false + private _iops?: number; + public get iops() { + return this.getNumberAttribute('iops'); + } + public set iops(value: number) { + this._iops = value; + } + public resetIops() { + this._iops = undefined; + } + // Temporarily expose input value. Use with caution. + public get iopsInput() { + return this._iops; + } + + // kms_id - computed: true, optional: true, required: false + private _kmsId?: string; + public get kmsId() { + return this.getStringAttribute('kms_id'); + } + public set kmsId(value: string) { + this._kmsId = value; + } + public resetKmsId() { + this._kmsId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsIdInput() { + return this._kmsId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: true, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // throughput - computed: true, optional: true, required: false + private _throughput?: number; + public get throughput() { + return this.getNumberAttribute('throughput'); + } + public set throughput(value: number) { + this._throughput = value; + } + public resetThroughput() { + this._throughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get throughputInput() { + return this._throughput; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} + +export class AsConfigurationV1InstanceConfigDiskList extends cdktf.ComplexList { + public internalValue? : AsConfigurationV1InstanceConfigDisk[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsConfigurationV1InstanceConfigDiskOutputReference { + return new AsConfigurationV1InstanceConfigDiskOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsConfigurationV1InstanceConfigPersonality { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#content AsConfigurationV1#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#path AsConfigurationV1#path} + */ + readonly path: string; +} + +export function asConfigurationV1InstanceConfigPersonalityToTerraform(struct?: AsConfigurationV1InstanceConfigPersonality | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + path: cdktf.stringToTerraform(struct!.path), + } +} + + +export function asConfigurationV1InstanceConfigPersonalityToHclTerraform(struct?: AsConfigurationV1InstanceConfigPersonality | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationV1InstanceConfigPersonalityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsConfigurationV1InstanceConfigPersonality | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationV1InstanceConfigPersonality | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._path = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._path = value.path; + } + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } +} + +export class AsConfigurationV1InstanceConfigPersonalityList extends cdktf.ComplexList { + public internalValue? : AsConfigurationV1InstanceConfigPersonality[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsConfigurationV1InstanceConfigPersonalityOutputReference { + return new AsConfigurationV1InstanceConfigPersonalityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsConfigurationV1InstanceConfigPublicIpEipBandwidth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#charging_mode AsConfigurationV1#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#id AsConfigurationV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#share_type AsConfigurationV1#share_type} + */ + readonly shareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#size AsConfigurationV1#size} + */ + readonly size?: number; +} + +export function asConfigurationV1InstanceConfigPublicIpEipBandwidthToTerraform(struct?: AsConfigurationV1InstanceConfigPublicIpEipBandwidthOutputReference | AsConfigurationV1InstanceConfigPublicIpEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charging_mode: cdktf.stringToTerraform(struct!.chargingMode), + id: cdktf.stringToTerraform(struct!.id), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function asConfigurationV1InstanceConfigPublicIpEipBandwidthToHclTerraform(struct?: AsConfigurationV1InstanceConfigPublicIpEipBandwidthOutputReference | AsConfigurationV1InstanceConfigPublicIpEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charging_mode: { + value: cdktf.stringToHclTerraform(struct!.chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationV1InstanceConfigPublicIpEipBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationV1InstanceConfigPublicIpEipBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargingMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargingMode = this._chargingMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationV1InstanceConfigPublicIpEipBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargingMode = undefined; + this._id = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargingMode = value.chargingMode; + this._id = value.id; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface AsConfigurationV1InstanceConfigPublicIpEip { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#ip_type AsConfigurationV1#ip_type} + */ + readonly ipType: string; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#bandwidth AsConfigurationV1#bandwidth} + */ + readonly bandwidth: AsConfigurationV1InstanceConfigPublicIpEipBandwidth; +} + +export function asConfigurationV1InstanceConfigPublicIpEipToTerraform(struct?: AsConfigurationV1InstanceConfigPublicIpEipOutputReference | AsConfigurationV1InstanceConfigPublicIpEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_type: cdktf.stringToTerraform(struct!.ipType), + bandwidth: asConfigurationV1InstanceConfigPublicIpEipBandwidthToTerraform(struct!.bandwidth), + } +} + + +export function asConfigurationV1InstanceConfigPublicIpEipToHclTerraform(struct?: AsConfigurationV1InstanceConfigPublicIpEipOutputReference | AsConfigurationV1InstanceConfigPublicIpEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_type: { + value: cdktf.stringToHclTerraform(struct!.ipType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth: { + value: asConfigurationV1InstanceConfigPublicIpEipBandwidthToHclTerraform(struct!.bandwidth), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationV1InstanceConfigPublicIpEipBandwidthList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationV1InstanceConfigPublicIpEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationV1InstanceConfigPublicIpEip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipType !== undefined) { + hasAnyValues = true; + internalValueResult.ipType = this._ipType; + } + if (this._bandwidth?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidth = this._bandwidth?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationV1InstanceConfigPublicIpEip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipType = undefined; + this._bandwidth.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipType = value.ipType; + this._bandwidth.internalValue = value.bandwidth; + } + } + + // ip_type - computed: false, optional: false, required: true + private _ipType?: string; + public get ipType() { + return this.getStringAttribute('ip_type'); + } + public set ipType(value: string) { + this._ipType = value; + } + // Temporarily expose input value. Use with caution. + public get ipTypeInput() { + return this._ipType; + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth = new AsConfigurationV1InstanceConfigPublicIpEipBandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: AsConfigurationV1InstanceConfigPublicIpEipBandwidth) { + this._bandwidth.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } +} +export interface AsConfigurationV1InstanceConfigPublicIp { + /** + * eip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#eip AsConfigurationV1#eip} + */ + readonly eip: AsConfigurationV1InstanceConfigPublicIpEip; +} + +export function asConfigurationV1InstanceConfigPublicIpToTerraform(struct?: AsConfigurationV1InstanceConfigPublicIpOutputReference | AsConfigurationV1InstanceConfigPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + eip: asConfigurationV1InstanceConfigPublicIpEipToTerraform(struct!.eip), + } +} + + +export function asConfigurationV1InstanceConfigPublicIpToHclTerraform(struct?: AsConfigurationV1InstanceConfigPublicIpOutputReference | AsConfigurationV1InstanceConfigPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + eip: { + value: asConfigurationV1InstanceConfigPublicIpEipToHclTerraform(struct!.eip), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationV1InstanceConfigPublicIpEipList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationV1InstanceConfigPublicIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationV1InstanceConfigPublicIp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._eip?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.eip = this._eip?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationV1InstanceConfigPublicIp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._eip.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._eip.internalValue = value.eip; + } + } + + // eip - computed: false, optional: false, required: true + private _eip = new AsConfigurationV1InstanceConfigPublicIpEipOutputReference(this, "eip"); + public get eip() { + return this._eip; + } + public putEip(value: AsConfigurationV1InstanceConfigPublicIpEip) { + this._eip.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get eipInput() { + return this._eip.internalValue; + } +} +export interface AsConfigurationV1InstanceConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#admin_pass AsConfigurationV1#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#charging_mode AsConfigurationV1#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#dedicated_host_id AsConfigurationV1#dedicated_host_id} + */ + readonly dedicatedHostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#ecs_group_id AsConfigurationV1#ecs_group_id} + */ + readonly ecsGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#flavor AsConfigurationV1#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#flavor_priority_policy AsConfigurationV1#flavor_priority_policy} + */ + readonly flavorPriorityPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#image AsConfigurationV1#image} + */ + readonly image?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#instance_id AsConfigurationV1#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#key_name AsConfigurationV1#key_name} + */ + readonly keyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#metadata AsConfigurationV1#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#security_group_ids AsConfigurationV1#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#tenancy AsConfigurationV1#tenancy} + */ + readonly tenancy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#user_data AsConfigurationV1#user_data} + */ + readonly userData?: string; + /** + * disk block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#disk AsConfigurationV1#disk} + */ + readonly disk?: AsConfigurationV1InstanceConfigDisk[] | cdktf.IResolvable; + /** + * personality block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#personality AsConfigurationV1#personality} + */ + readonly personality?: AsConfigurationV1InstanceConfigPersonality[] | cdktf.IResolvable; + /** + * public_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#public_ip AsConfigurationV1#public_ip} + */ + readonly publicIp?: AsConfigurationV1InstanceConfigPublicIp; +} + +export function asConfigurationV1InstanceConfigToTerraform(struct?: AsConfigurationV1InstanceConfigOutputReference | AsConfigurationV1InstanceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + admin_pass: cdktf.stringToTerraform(struct!.adminPass), + charging_mode: cdktf.stringToTerraform(struct!.chargingMode), + dedicated_host_id: cdktf.stringToTerraform(struct!.dedicatedHostId), + ecs_group_id: cdktf.stringToTerraform(struct!.ecsGroupId), + flavor: cdktf.stringToTerraform(struct!.flavor), + flavor_priority_policy: cdktf.stringToTerraform(struct!.flavorPriorityPolicy), + image: cdktf.stringToTerraform(struct!.image), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + key_name: cdktf.stringToTerraform(struct!.keyName), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.metadata), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.securityGroupIds), + tenancy: cdktf.stringToTerraform(struct!.tenancy), + user_data: cdktf.stringToTerraform(struct!.userData), + disk: cdktf.listMapper(asConfigurationV1InstanceConfigDiskToTerraform, true)(struct!.disk), + personality: cdktf.listMapper(asConfigurationV1InstanceConfigPersonalityToTerraform, true)(struct!.personality), + public_ip: asConfigurationV1InstanceConfigPublicIpToTerraform(struct!.publicIp), + } +} + + +export function asConfigurationV1InstanceConfigToHclTerraform(struct?: AsConfigurationV1InstanceConfigOutputReference | AsConfigurationV1InstanceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(struct!.adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(struct!.chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_host_id: { + value: cdktf.stringToHclTerraform(struct!.dedicatedHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_group_id: { + value: cdktf.stringToHclTerraform(struct!.ecsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_priority_policy: { + value: cdktf.stringToHclTerraform(struct!.flavorPriorityPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image: { + value: cdktf.stringToHclTerraform(struct!.image), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_name: { + value: cdktf.stringToHclTerraform(struct!.keyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tenancy: { + value: cdktf.stringToHclTerraform(struct!.tenancy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_data: { + value: cdktf.stringToHclTerraform(struct!.userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk: { + value: cdktf.listMapperHcl(asConfigurationV1InstanceConfigDiskToHclTerraform, true)(struct!.disk), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationV1InstanceConfigDiskList", + }, + personality: { + value: cdktf.listMapperHcl(asConfigurationV1InstanceConfigPersonalityToHclTerraform, true)(struct!.personality), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationV1InstanceConfigPersonalityList", + }, + public_ip: { + value: asConfigurationV1InstanceConfigPublicIpToHclTerraform(struct!.publicIp), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationV1InstanceConfigPublicIpList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationV1InstanceConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationV1InstanceConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._adminPass !== undefined) { + hasAnyValues = true; + internalValueResult.adminPass = this._adminPass; + } + if (this._chargingMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargingMode = this._chargingMode; + } + if (this._dedicatedHostId !== undefined) { + hasAnyValues = true; + internalValueResult.dedicatedHostId = this._dedicatedHostId; + } + if (this._ecsGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.ecsGroupId = this._ecsGroupId; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._flavorPriorityPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.flavorPriorityPolicy = this._flavorPriorityPolicy; + } + if (this._image !== undefined) { + hasAnyValues = true; + internalValueResult.image = this._image; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._keyName !== undefined) { + hasAnyValues = true; + internalValueResult.keyName = this._keyName; + } + if (this._metadata !== undefined) { + hasAnyValues = true; + internalValueResult.metadata = this._metadata; + } + if (this._securityGroupIds !== undefined) { + hasAnyValues = true; + internalValueResult.securityGroupIds = this._securityGroupIds; + } + if (this._tenancy !== undefined) { + hasAnyValues = true; + internalValueResult.tenancy = this._tenancy; + } + if (this._userData !== undefined) { + hasAnyValues = true; + internalValueResult.userData = this._userData; + } + if (this._disk?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.disk = this._disk?.internalValue; + } + if (this._personality?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.personality = this._personality?.internalValue; + } + if (this._publicIp?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.publicIp = this._publicIp?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationV1InstanceConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._adminPass = undefined; + this._chargingMode = undefined; + this._dedicatedHostId = undefined; + this._ecsGroupId = undefined; + this._flavor = undefined; + this._flavorPriorityPolicy = undefined; + this._image = undefined; + this._instanceId = undefined; + this._keyName = undefined; + this._metadata = undefined; + this._securityGroupIds = undefined; + this._tenancy = undefined; + this._userData = undefined; + this._disk.internalValue = undefined; + this._personality.internalValue = undefined; + this._publicIp.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._adminPass = value.adminPass; + this._chargingMode = value.chargingMode; + this._dedicatedHostId = value.dedicatedHostId; + this._ecsGroupId = value.ecsGroupId; + this._flavor = value.flavor; + this._flavorPriorityPolicy = value.flavorPriorityPolicy; + this._image = value.image; + this._instanceId = value.instanceId; + this._keyName = value.keyName; + this._metadata = value.metadata; + this._securityGroupIds = value.securityGroupIds; + this._tenancy = value.tenancy; + this._userData = value.userData; + this._disk.internalValue = value.disk; + this._personality.internalValue = value.personality; + this._publicIp.internalValue = value.publicIp; + } + } + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // dedicated_host_id - computed: true, optional: true, required: false + private _dedicatedHostId?: string; + public get dedicatedHostId() { + return this.getStringAttribute('dedicated_host_id'); + } + public set dedicatedHostId(value: string) { + this._dedicatedHostId = value; + } + public resetDedicatedHostId() { + this._dedicatedHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedHostIdInput() { + return this._dedicatedHostId; + } + + // ecs_group_id - computed: true, optional: true, required: false + private _ecsGroupId?: string; + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + public set ecsGroupId(value: string) { + this._ecsGroupId = value; + } + public resetEcsGroupId() { + this._ecsGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsGroupIdInput() { + return this._ecsGroupId; + } + + // flavor - computed: true, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // flavor_priority_policy - computed: true, optional: true, required: false + private _flavorPriorityPolicy?: string; + public get flavorPriorityPolicy() { + return this.getStringAttribute('flavor_priority_policy'); + } + public set flavorPriorityPolicy(value: string) { + this._flavorPriorityPolicy = value; + } + public resetFlavorPriorityPolicy() { + this._flavorPriorityPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorPriorityPolicyInput() { + return this._flavorPriorityPolicy; + } + + // image - computed: true, optional: true, required: false + private _image?: string; + public get image() { + return this.getStringAttribute('image'); + } + public set image(value: string) { + this._image = value; + } + public resetImage() { + this._image = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageInput() { + return this._image; + } + + // instance_id - computed: true, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // key_name - computed: true, optional: true, required: false + private _keyName?: string; + public get keyName() { + return this.getStringAttribute('key_name'); + } + public set keyName(value: string) { + this._keyName = value; + } + public resetKeyName() { + this._keyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyNameInput() { + return this._keyName; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // tenancy - computed: true, optional: true, required: false + private _tenancy?: string; + public get tenancy() { + return this.getStringAttribute('tenancy'); + } + public set tenancy(value: string) { + this._tenancy = value; + } + public resetTenancy() { + this._tenancy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenancyInput() { + return this._tenancy; + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // disk - computed: false, optional: true, required: false + private _disk = new AsConfigurationV1InstanceConfigDiskList(this, "disk", false); + public get disk() { + return this._disk; + } + public putDisk(value: AsConfigurationV1InstanceConfigDisk[] | cdktf.IResolvable) { + this._disk.internalValue = value; + } + public resetDisk() { + this._disk.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskInput() { + return this._disk.internalValue; + } + + // personality - computed: false, optional: true, required: false + private _personality = new AsConfigurationV1InstanceConfigPersonalityList(this, "personality", false); + public get personality() { + return this._personality; + } + public putPersonality(value: AsConfigurationV1InstanceConfigPersonality[] | cdktf.IResolvable) { + this._personality.internalValue = value; + } + public resetPersonality() { + this._personality.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get personalityInput() { + return this._personality.internalValue; + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp = new AsConfigurationV1InstanceConfigPublicIpOutputReference(this, "public_ip"); + public get publicIp() { + return this._publicIp; + } + public putPublicIp(value: AsConfigurationV1InstanceConfigPublicIp) { + this._publicIp.internalValue = value; + } + public resetPublicIp() { + this._publicIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1 huaweicloud_as_configuration_v1} +*/ +export class AsConfigurationV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_configuration_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsConfigurationV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsConfigurationV1 to import + * @param importFromId The id of the existing AsConfigurationV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsConfigurationV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_configuration_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration_v1 huaweicloud_as_configuration_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsConfigurationV1Config + */ + public constructor(scope: Construct, id: string, config: AsConfigurationV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_configuration_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._scalingConfigurationName = config.scalingConfigurationName; + this._instanceConfig.internalValue = config.instanceConfig; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_configuration_name - computed: false, optional: false, required: true + private _scalingConfigurationName?: string; + public get scalingConfigurationName() { + return this.getStringAttribute('scaling_configuration_name'); + } + public set scalingConfigurationName(value: string) { + this._scalingConfigurationName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingConfigurationNameInput() { + return this._scalingConfigurationName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // instance_config - computed: false, optional: false, required: true + private _instanceConfig = new AsConfigurationV1InstanceConfigOutputReference(this, "instance_config"); + public get instanceConfig() { + return this._instanceConfig; + } + public putInstanceConfig(value: AsConfigurationV1InstanceConfig) { + this._instanceConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get instanceConfigInput() { + return this._instanceConfig.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_configuration_name: cdktf.stringToTerraform(this._scalingConfigurationName), + instance_config: asConfigurationV1InstanceConfigToTerraform(this._instanceConfig.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_configuration_name: { + value: cdktf.stringToHclTerraform(this._scalingConfigurationName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_config: { + value: asConfigurationV1InstanceConfigToHclTerraform(this._instanceConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationV1InstanceConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-configuration/README.md b/src/constructs/providers/huaweicloud/as-configuration/README.md new file mode 100644 index 00000000..8194a83b --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration). diff --git a/src/constructs/providers/huaweicloud/as-configuration/index.ts b/src/constructs/providers/huaweicloud/as-configuration/index.ts new file mode 100644 index 00000000..47b4e6e9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-configuration/index.ts @@ -0,0 +1,1681 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#id AsConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#region AsConfiguration#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#scaling_configuration_name AsConfiguration#scaling_configuration_name} + */ + readonly scalingConfigurationName: string; + /** + * instance_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#instance_config AsConfiguration#instance_config} + */ + readonly instanceConfig: AsConfigurationInstanceConfig; +} +export interface AsConfigurationInstanceConfigDisk { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#data_disk_image_id AsConfiguration#data_disk_image_id} + */ + readonly dataDiskImageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#dedicated_storage_id AsConfiguration#dedicated_storage_id} + */ + readonly dedicatedStorageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#disk_type AsConfiguration#disk_type} + */ + readonly diskType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#iops AsConfiguration#iops} + */ + readonly iops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#kms_id AsConfiguration#kms_id} + */ + readonly kmsId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#size AsConfiguration#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#snapshot_id AsConfiguration#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#throughput AsConfiguration#throughput} + */ + readonly throughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#volume_type AsConfiguration#volume_type} + */ + readonly volumeType: string; +} + +export function asConfigurationInstanceConfigDiskToTerraform(struct?: AsConfigurationInstanceConfigDisk | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data_disk_image_id: cdktf.stringToTerraform(struct!.dataDiskImageId), + dedicated_storage_id: cdktf.stringToTerraform(struct!.dedicatedStorageId), + disk_type: cdktf.stringToTerraform(struct!.diskType), + iops: cdktf.numberToTerraform(struct!.iops), + kms_id: cdktf.stringToTerraform(struct!.kmsId), + size: cdktf.numberToTerraform(struct!.size), + snapshot_id: cdktf.stringToTerraform(struct!.snapshotId), + throughput: cdktf.numberToTerraform(struct!.throughput), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function asConfigurationInstanceConfigDiskToHclTerraform(struct?: AsConfigurationInstanceConfigDisk | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data_disk_image_id: { + value: cdktf.stringToHclTerraform(struct!.dataDiskImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_storage_id: { + value: cdktf.stringToHclTerraform(struct!.dedicatedStorageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk_type: { + value: cdktf.stringToHclTerraform(struct!.diskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iops: { + value: cdktf.numberToHclTerraform(struct!.iops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kms_id: { + value: cdktf.stringToHclTerraform(struct!.kmsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(struct!.snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throughput: { + value: cdktf.numberToHclTerraform(struct!.throughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationInstanceConfigDiskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsConfigurationInstanceConfigDisk | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dataDiskImageId !== undefined) { + hasAnyValues = true; + internalValueResult.dataDiskImageId = this._dataDiskImageId; + } + if (this._dedicatedStorageId !== undefined) { + hasAnyValues = true; + internalValueResult.dedicatedStorageId = this._dedicatedStorageId; + } + if (this._diskType !== undefined) { + hasAnyValues = true; + internalValueResult.diskType = this._diskType; + } + if (this._iops !== undefined) { + hasAnyValues = true; + internalValueResult.iops = this._iops; + } + if (this._kmsId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsId = this._kmsId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._snapshotId !== undefined) { + hasAnyValues = true; + internalValueResult.snapshotId = this._snapshotId; + } + if (this._throughput !== undefined) { + hasAnyValues = true; + internalValueResult.throughput = this._throughput; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationInstanceConfigDisk | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dataDiskImageId = undefined; + this._dedicatedStorageId = undefined; + this._diskType = undefined; + this._iops = undefined; + this._kmsId = undefined; + this._size = undefined; + this._snapshotId = undefined; + this._throughput = undefined; + this._volumeType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dataDiskImageId = value.dataDiskImageId; + this._dedicatedStorageId = value.dedicatedStorageId; + this._diskType = value.diskType; + this._iops = value.iops; + this._kmsId = value.kmsId; + this._size = value.size; + this._snapshotId = value.snapshotId; + this._throughput = value.throughput; + this._volumeType = value.volumeType; + } + } + + // data_disk_image_id - computed: true, optional: true, required: false + private _dataDiskImageId?: string; + public get dataDiskImageId() { + return this.getStringAttribute('data_disk_image_id'); + } + public set dataDiskImageId(value: string) { + this._dataDiskImageId = value; + } + public resetDataDiskImageId() { + this._dataDiskImageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDiskImageIdInput() { + return this._dataDiskImageId; + } + + // dedicated_storage_id - computed: true, optional: true, required: false + private _dedicatedStorageId?: string; + public get dedicatedStorageId() { + return this.getStringAttribute('dedicated_storage_id'); + } + public set dedicatedStorageId(value: string) { + this._dedicatedStorageId = value; + } + public resetDedicatedStorageId() { + this._dedicatedStorageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedStorageIdInput() { + return this._dedicatedStorageId; + } + + // disk_type - computed: false, optional: false, required: true + private _diskType?: string; + public get diskType() { + return this.getStringAttribute('disk_type'); + } + public set diskType(value: string) { + this._diskType = value; + } + // Temporarily expose input value. Use with caution. + public get diskTypeInput() { + return this._diskType; + } + + // iops - computed: true, optional: true, required: false + private _iops?: number; + public get iops() { + return this.getNumberAttribute('iops'); + } + public set iops(value: number) { + this._iops = value; + } + public resetIops() { + this._iops = undefined; + } + // Temporarily expose input value. Use with caution. + public get iopsInput() { + return this._iops; + } + + // kms_id - computed: true, optional: true, required: false + private _kmsId?: string; + public get kmsId() { + return this.getStringAttribute('kms_id'); + } + public set kmsId(value: string) { + this._kmsId = value; + } + public resetKmsId() { + this._kmsId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsIdInput() { + return this._kmsId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: true, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // throughput - computed: true, optional: true, required: false + private _throughput?: number; + public get throughput() { + return this.getNumberAttribute('throughput'); + } + public set throughput(value: number) { + this._throughput = value; + } + public resetThroughput() { + this._throughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get throughputInput() { + return this._throughput; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} + +export class AsConfigurationInstanceConfigDiskList extends cdktf.ComplexList { + public internalValue? : AsConfigurationInstanceConfigDisk[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsConfigurationInstanceConfigDiskOutputReference { + return new AsConfigurationInstanceConfigDiskOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsConfigurationInstanceConfigPersonality { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#content AsConfiguration#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#path AsConfiguration#path} + */ + readonly path: string; +} + +export function asConfigurationInstanceConfigPersonalityToTerraform(struct?: AsConfigurationInstanceConfigPersonality | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + path: cdktf.stringToTerraform(struct!.path), + } +} + + +export function asConfigurationInstanceConfigPersonalityToHclTerraform(struct?: AsConfigurationInstanceConfigPersonality | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationInstanceConfigPersonalityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsConfigurationInstanceConfigPersonality | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationInstanceConfigPersonality | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._path = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._path = value.path; + } + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } +} + +export class AsConfigurationInstanceConfigPersonalityList extends cdktf.ComplexList { + public internalValue? : AsConfigurationInstanceConfigPersonality[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsConfigurationInstanceConfigPersonalityOutputReference { + return new AsConfigurationInstanceConfigPersonalityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsConfigurationInstanceConfigPublicIpEipBandwidth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#charging_mode AsConfiguration#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#id AsConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#share_type AsConfiguration#share_type} + */ + readonly shareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#size AsConfiguration#size} + */ + readonly size?: number; +} + +export function asConfigurationInstanceConfigPublicIpEipBandwidthToTerraform(struct?: AsConfigurationInstanceConfigPublicIpEipBandwidthOutputReference | AsConfigurationInstanceConfigPublicIpEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charging_mode: cdktf.stringToTerraform(struct!.chargingMode), + id: cdktf.stringToTerraform(struct!.id), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function asConfigurationInstanceConfigPublicIpEipBandwidthToHclTerraform(struct?: AsConfigurationInstanceConfigPublicIpEipBandwidthOutputReference | AsConfigurationInstanceConfigPublicIpEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charging_mode: { + value: cdktf.stringToHclTerraform(struct!.chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationInstanceConfigPublicIpEipBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationInstanceConfigPublicIpEipBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargingMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargingMode = this._chargingMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationInstanceConfigPublicIpEipBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargingMode = undefined; + this._id = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargingMode = value.chargingMode; + this._id = value.id; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface AsConfigurationInstanceConfigPublicIpEip { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#ip_type AsConfiguration#ip_type} + */ + readonly ipType: string; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#bandwidth AsConfiguration#bandwidth} + */ + readonly bandwidth: AsConfigurationInstanceConfigPublicIpEipBandwidth; +} + +export function asConfigurationInstanceConfigPublicIpEipToTerraform(struct?: AsConfigurationInstanceConfigPublicIpEipOutputReference | AsConfigurationInstanceConfigPublicIpEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_type: cdktf.stringToTerraform(struct!.ipType), + bandwidth: asConfigurationInstanceConfigPublicIpEipBandwidthToTerraform(struct!.bandwidth), + } +} + + +export function asConfigurationInstanceConfigPublicIpEipToHclTerraform(struct?: AsConfigurationInstanceConfigPublicIpEipOutputReference | AsConfigurationInstanceConfigPublicIpEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_type: { + value: cdktf.stringToHclTerraform(struct!.ipType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth: { + value: asConfigurationInstanceConfigPublicIpEipBandwidthToHclTerraform(struct!.bandwidth), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationInstanceConfigPublicIpEipBandwidthList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationInstanceConfigPublicIpEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationInstanceConfigPublicIpEip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipType !== undefined) { + hasAnyValues = true; + internalValueResult.ipType = this._ipType; + } + if (this._bandwidth?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidth = this._bandwidth?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationInstanceConfigPublicIpEip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipType = undefined; + this._bandwidth.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipType = value.ipType; + this._bandwidth.internalValue = value.bandwidth; + } + } + + // ip_type - computed: false, optional: false, required: true + private _ipType?: string; + public get ipType() { + return this.getStringAttribute('ip_type'); + } + public set ipType(value: string) { + this._ipType = value; + } + // Temporarily expose input value. Use with caution. + public get ipTypeInput() { + return this._ipType; + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth = new AsConfigurationInstanceConfigPublicIpEipBandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: AsConfigurationInstanceConfigPublicIpEipBandwidth) { + this._bandwidth.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } +} +export interface AsConfigurationInstanceConfigPublicIp { + /** + * eip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#eip AsConfiguration#eip} + */ + readonly eip: AsConfigurationInstanceConfigPublicIpEip; +} + +export function asConfigurationInstanceConfigPublicIpToTerraform(struct?: AsConfigurationInstanceConfigPublicIpOutputReference | AsConfigurationInstanceConfigPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + eip: asConfigurationInstanceConfigPublicIpEipToTerraform(struct!.eip), + } +} + + +export function asConfigurationInstanceConfigPublicIpToHclTerraform(struct?: AsConfigurationInstanceConfigPublicIpOutputReference | AsConfigurationInstanceConfigPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + eip: { + value: asConfigurationInstanceConfigPublicIpEipToHclTerraform(struct!.eip), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationInstanceConfigPublicIpEipList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationInstanceConfigPublicIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationInstanceConfigPublicIp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._eip?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.eip = this._eip?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationInstanceConfigPublicIp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._eip.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._eip.internalValue = value.eip; + } + } + + // eip - computed: false, optional: false, required: true + private _eip = new AsConfigurationInstanceConfigPublicIpEipOutputReference(this, "eip"); + public get eip() { + return this._eip; + } + public putEip(value: AsConfigurationInstanceConfigPublicIpEip) { + this._eip.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get eipInput() { + return this._eip.internalValue; + } +} +export interface AsConfigurationInstanceConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#admin_pass AsConfiguration#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#charging_mode AsConfiguration#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#dedicated_host_id AsConfiguration#dedicated_host_id} + */ + readonly dedicatedHostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#ecs_group_id AsConfiguration#ecs_group_id} + */ + readonly ecsGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#flavor AsConfiguration#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#flavor_priority_policy AsConfiguration#flavor_priority_policy} + */ + readonly flavorPriorityPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#image AsConfiguration#image} + */ + readonly image?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#instance_id AsConfiguration#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#key_name AsConfiguration#key_name} + */ + readonly keyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#metadata AsConfiguration#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#security_group_ids AsConfiguration#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#tenancy AsConfiguration#tenancy} + */ + readonly tenancy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#user_data AsConfiguration#user_data} + */ + readonly userData?: string; + /** + * disk block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#disk AsConfiguration#disk} + */ + readonly disk?: AsConfigurationInstanceConfigDisk[] | cdktf.IResolvable; + /** + * personality block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#personality AsConfiguration#personality} + */ + readonly personality?: AsConfigurationInstanceConfigPersonality[] | cdktf.IResolvable; + /** + * public_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#public_ip AsConfiguration#public_ip} + */ + readonly publicIp?: AsConfigurationInstanceConfigPublicIp; +} + +export function asConfigurationInstanceConfigToTerraform(struct?: AsConfigurationInstanceConfigOutputReference | AsConfigurationInstanceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + admin_pass: cdktf.stringToTerraform(struct!.adminPass), + charging_mode: cdktf.stringToTerraform(struct!.chargingMode), + dedicated_host_id: cdktf.stringToTerraform(struct!.dedicatedHostId), + ecs_group_id: cdktf.stringToTerraform(struct!.ecsGroupId), + flavor: cdktf.stringToTerraform(struct!.flavor), + flavor_priority_policy: cdktf.stringToTerraform(struct!.flavorPriorityPolicy), + image: cdktf.stringToTerraform(struct!.image), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + key_name: cdktf.stringToTerraform(struct!.keyName), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.metadata), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.securityGroupIds), + tenancy: cdktf.stringToTerraform(struct!.tenancy), + user_data: cdktf.stringToTerraform(struct!.userData), + disk: cdktf.listMapper(asConfigurationInstanceConfigDiskToTerraform, true)(struct!.disk), + personality: cdktf.listMapper(asConfigurationInstanceConfigPersonalityToTerraform, true)(struct!.personality), + public_ip: asConfigurationInstanceConfigPublicIpToTerraform(struct!.publicIp), + } +} + + +export function asConfigurationInstanceConfigToHclTerraform(struct?: AsConfigurationInstanceConfigOutputReference | AsConfigurationInstanceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(struct!.adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(struct!.chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_host_id: { + value: cdktf.stringToHclTerraform(struct!.dedicatedHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_group_id: { + value: cdktf.stringToHclTerraform(struct!.ecsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_priority_policy: { + value: cdktf.stringToHclTerraform(struct!.flavorPriorityPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image: { + value: cdktf.stringToHclTerraform(struct!.image), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_name: { + value: cdktf.stringToHclTerraform(struct!.keyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tenancy: { + value: cdktf.stringToHclTerraform(struct!.tenancy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_data: { + value: cdktf.stringToHclTerraform(struct!.userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk: { + value: cdktf.listMapperHcl(asConfigurationInstanceConfigDiskToHclTerraform, true)(struct!.disk), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationInstanceConfigDiskList", + }, + personality: { + value: cdktf.listMapperHcl(asConfigurationInstanceConfigPersonalityToHclTerraform, true)(struct!.personality), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationInstanceConfigPersonalityList", + }, + public_ip: { + value: asConfigurationInstanceConfigPublicIpToHclTerraform(struct!.publicIp), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationInstanceConfigPublicIpList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsConfigurationInstanceConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsConfigurationInstanceConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._adminPass !== undefined) { + hasAnyValues = true; + internalValueResult.adminPass = this._adminPass; + } + if (this._chargingMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargingMode = this._chargingMode; + } + if (this._dedicatedHostId !== undefined) { + hasAnyValues = true; + internalValueResult.dedicatedHostId = this._dedicatedHostId; + } + if (this._ecsGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.ecsGroupId = this._ecsGroupId; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._flavorPriorityPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.flavorPriorityPolicy = this._flavorPriorityPolicy; + } + if (this._image !== undefined) { + hasAnyValues = true; + internalValueResult.image = this._image; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._keyName !== undefined) { + hasAnyValues = true; + internalValueResult.keyName = this._keyName; + } + if (this._metadata !== undefined) { + hasAnyValues = true; + internalValueResult.metadata = this._metadata; + } + if (this._securityGroupIds !== undefined) { + hasAnyValues = true; + internalValueResult.securityGroupIds = this._securityGroupIds; + } + if (this._tenancy !== undefined) { + hasAnyValues = true; + internalValueResult.tenancy = this._tenancy; + } + if (this._userData !== undefined) { + hasAnyValues = true; + internalValueResult.userData = this._userData; + } + if (this._disk?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.disk = this._disk?.internalValue; + } + if (this._personality?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.personality = this._personality?.internalValue; + } + if (this._publicIp?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.publicIp = this._publicIp?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsConfigurationInstanceConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._adminPass = undefined; + this._chargingMode = undefined; + this._dedicatedHostId = undefined; + this._ecsGroupId = undefined; + this._flavor = undefined; + this._flavorPriorityPolicy = undefined; + this._image = undefined; + this._instanceId = undefined; + this._keyName = undefined; + this._metadata = undefined; + this._securityGroupIds = undefined; + this._tenancy = undefined; + this._userData = undefined; + this._disk.internalValue = undefined; + this._personality.internalValue = undefined; + this._publicIp.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._adminPass = value.adminPass; + this._chargingMode = value.chargingMode; + this._dedicatedHostId = value.dedicatedHostId; + this._ecsGroupId = value.ecsGroupId; + this._flavor = value.flavor; + this._flavorPriorityPolicy = value.flavorPriorityPolicy; + this._image = value.image; + this._instanceId = value.instanceId; + this._keyName = value.keyName; + this._metadata = value.metadata; + this._securityGroupIds = value.securityGroupIds; + this._tenancy = value.tenancy; + this._userData = value.userData; + this._disk.internalValue = value.disk; + this._personality.internalValue = value.personality; + this._publicIp.internalValue = value.publicIp; + } + } + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // dedicated_host_id - computed: true, optional: true, required: false + private _dedicatedHostId?: string; + public get dedicatedHostId() { + return this.getStringAttribute('dedicated_host_id'); + } + public set dedicatedHostId(value: string) { + this._dedicatedHostId = value; + } + public resetDedicatedHostId() { + this._dedicatedHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedHostIdInput() { + return this._dedicatedHostId; + } + + // ecs_group_id - computed: true, optional: true, required: false + private _ecsGroupId?: string; + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + public set ecsGroupId(value: string) { + this._ecsGroupId = value; + } + public resetEcsGroupId() { + this._ecsGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsGroupIdInput() { + return this._ecsGroupId; + } + + // flavor - computed: true, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // flavor_priority_policy - computed: true, optional: true, required: false + private _flavorPriorityPolicy?: string; + public get flavorPriorityPolicy() { + return this.getStringAttribute('flavor_priority_policy'); + } + public set flavorPriorityPolicy(value: string) { + this._flavorPriorityPolicy = value; + } + public resetFlavorPriorityPolicy() { + this._flavorPriorityPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorPriorityPolicyInput() { + return this._flavorPriorityPolicy; + } + + // image - computed: true, optional: true, required: false + private _image?: string; + public get image() { + return this.getStringAttribute('image'); + } + public set image(value: string) { + this._image = value; + } + public resetImage() { + this._image = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageInput() { + return this._image; + } + + // instance_id - computed: true, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // key_name - computed: true, optional: true, required: false + private _keyName?: string; + public get keyName() { + return this.getStringAttribute('key_name'); + } + public set keyName(value: string) { + this._keyName = value; + } + public resetKeyName() { + this._keyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyNameInput() { + return this._keyName; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // tenancy - computed: true, optional: true, required: false + private _tenancy?: string; + public get tenancy() { + return this.getStringAttribute('tenancy'); + } + public set tenancy(value: string) { + this._tenancy = value; + } + public resetTenancy() { + this._tenancy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenancyInput() { + return this._tenancy; + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // disk - computed: false, optional: true, required: false + private _disk = new AsConfigurationInstanceConfigDiskList(this, "disk", false); + public get disk() { + return this._disk; + } + public putDisk(value: AsConfigurationInstanceConfigDisk[] | cdktf.IResolvable) { + this._disk.internalValue = value; + } + public resetDisk() { + this._disk.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskInput() { + return this._disk.internalValue; + } + + // personality - computed: false, optional: true, required: false + private _personality = new AsConfigurationInstanceConfigPersonalityList(this, "personality", false); + public get personality() { + return this._personality; + } + public putPersonality(value: AsConfigurationInstanceConfigPersonality[] | cdktf.IResolvable) { + this._personality.internalValue = value; + } + public resetPersonality() { + this._personality.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get personalityInput() { + return this._personality.internalValue; + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp = new AsConfigurationInstanceConfigPublicIpOutputReference(this, "public_ip"); + public get publicIp() { + return this._publicIp; + } + public putPublicIp(value: AsConfigurationInstanceConfigPublicIp) { + this._publicIp.internalValue = value; + } + public resetPublicIp() { + this._publicIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration huaweicloud_as_configuration} +*/ +export class AsConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsConfiguration to import + * @param importFromId The id of the existing AsConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_configuration huaweicloud_as_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: AsConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._scalingConfigurationName = config.scalingConfigurationName; + this._instanceConfig.internalValue = config.instanceConfig; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_configuration_name - computed: false, optional: false, required: true + private _scalingConfigurationName?: string; + public get scalingConfigurationName() { + return this.getStringAttribute('scaling_configuration_name'); + } + public set scalingConfigurationName(value: string) { + this._scalingConfigurationName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingConfigurationNameInput() { + return this._scalingConfigurationName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // instance_config - computed: false, optional: false, required: true + private _instanceConfig = new AsConfigurationInstanceConfigOutputReference(this, "instance_config"); + public get instanceConfig() { + return this._instanceConfig; + } + public putInstanceConfig(value: AsConfigurationInstanceConfig) { + this._instanceConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get instanceConfigInput() { + return this._instanceConfig.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_configuration_name: cdktf.stringToTerraform(this._scalingConfigurationName), + instance_config: asConfigurationInstanceConfigToTerraform(this._instanceConfig.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_configuration_name: { + value: cdktf.stringToHclTerraform(this._scalingConfigurationName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_config: { + value: asConfigurationInstanceConfigToHclTerraform(this._instanceConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsConfigurationInstanceConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-group-v1/README.md b/src/constructs/providers/huaweicloud/as-group-v1/README.md new file mode 100644 index 00000000..198e120d --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-group-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_group_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_group_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1). diff --git a/src/constructs/providers/huaweicloud/as-group-v1/index.ts b/src/constructs/providers/huaweicloud/as-group-v1/index.ts new file mode 100644 index 00000000..41b87752 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-group-v1/index.ts @@ -0,0 +1,1653 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsGroupV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#agency_name AsGroupV1#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#availability_zones AsGroupV1#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * schema: Deprecated; use availability_zones instead + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#available_zones AsGroupV1#available_zones} + */ + readonly availableZones?: string[]; + /** + * The cooling duration, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#cool_down_time AsGroupV1#cool_down_time} + */ + readonly coolDownTime?: number; + /** + * Whether to delete instances when they are removed from the AS group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#delete_instances AsGroupV1#delete_instances} + */ + readonly deleteInstances?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#delete_publicip AsGroupV1#delete_publicip} + */ + readonly deletePublicip?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#delete_volume AsGroupV1#delete_volume} + */ + readonly deleteVolume?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#description AsGroupV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#desire_instance_number AsGroupV1#desire_instance_number} + */ + readonly desireInstanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#enable AsGroupV1#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#enterprise_project_id AsGroupV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#force_delete AsGroupV1#force_delete} + */ + readonly forceDelete?: boolean | cdktf.IResolvable; + /** + * The health check grace period for instances, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#health_periodic_audit_grace_period AsGroupV1#health_periodic_audit_grace_period} + */ + readonly healthPeriodicAuditGracePeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#health_periodic_audit_method AsGroupV1#health_periodic_audit_method} + */ + readonly healthPeriodicAuditMethod?: string; + /** + * The health check period for instances, in minutes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#health_periodic_audit_time AsGroupV1#health_periodic_audit_time} + */ + readonly healthPeriodicAuditTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#id AsGroupV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#instance_terminate_policy AsGroupV1#instance_terminate_policy} + */ + readonly instanceTerminatePolicy?: string; + /** + * The system supports the binding of up to six ELB listeners, the IDs of which are separated using a comma. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#lb_listener_id AsGroupV1#lb_listener_id} + */ + readonly lbListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#max_instance_number AsGroupV1#max_instance_number} + */ + readonly maxInstanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#min_instance_number AsGroupV1#min_instance_number} + */ + readonly minInstanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#multi_az_scaling_policy AsGroupV1#multi_az_scaling_policy} + */ + readonly multiAzScalingPolicy?: string; + /** + * schema: Deprecated; The notification mode has been canceled + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#notifications AsGroupV1#notifications} + */ + readonly notifications?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#region AsGroupV1#region} + */ + readonly region?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#scaling_configuration_id AsGroupV1#scaling_configuration_id} + */ + readonly scalingConfigurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#scaling_group_name AsGroupV1#scaling_group_name} + */ + readonly scalingGroupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#tags AsGroupV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#vpc_id AsGroupV1#vpc_id} + */ + readonly vpcId: string; + /** + * lbaas_listeners block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#lbaas_listeners AsGroupV1#lbaas_listeners} + */ + readonly lbaasListeners?: AsGroupV1LbaasListeners[] | cdktf.IResolvable; + /** + * networks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#networks AsGroupV1#networks} + */ + readonly networks: AsGroupV1Networks[] | cdktf.IResolvable; + /** + * security_groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#security_groups AsGroupV1#security_groups} + */ + readonly securityGroups?: AsGroupV1SecurityGroups[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#timeouts AsGroupV1#timeouts} + */ + readonly timeouts?: AsGroupV1Timeouts; +} +export interface AsGroupV1LbaasListeners { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#pool_id AsGroupV1#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#protocol_port AsGroupV1#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#protocol_version AsGroupV1#protocol_version} + */ + readonly protocolVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#weight AsGroupV1#weight} + */ + readonly weight?: number; +} + +export function asGroupV1LbaasListenersToTerraform(struct?: AsGroupV1LbaasListeners | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + pool_id: cdktf.stringToTerraform(struct!.poolId), + protocol_port: cdktf.numberToTerraform(struct!.protocolPort), + protocol_version: cdktf.stringToTerraform(struct!.protocolVersion), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function asGroupV1LbaasListenersToHclTerraform(struct?: AsGroupV1LbaasListeners | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + pool_id: { + value: cdktf.stringToHclTerraform(struct!.poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(struct!.protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol_version: { + value: cdktf.stringToHclTerraform(struct!.protocolVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupV1LbaasListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsGroupV1LbaasListeners | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._poolId !== undefined) { + hasAnyValues = true; + internalValueResult.poolId = this._poolId; + } + if (this._protocolPort !== undefined) { + hasAnyValues = true; + internalValueResult.protocolPort = this._protocolPort; + } + if (this._protocolVersion !== undefined) { + hasAnyValues = true; + internalValueResult.protocolVersion = this._protocolVersion; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupV1LbaasListeners | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._poolId = undefined; + this._protocolPort = undefined; + this._protocolVersion = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._poolId = value.poolId; + this._protocolPort = value.protocolPort; + this._protocolVersion = value.protocolVersion; + this._weight = value.weight; + } + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // protocol_version - computed: true, optional: true, required: false + private _protocolVersion?: string; + public get protocolVersion() { + return this.getStringAttribute('protocol_version'); + } + public set protocolVersion(value: string) { + this._protocolVersion = value; + } + public resetProtocolVersion() { + this._protocolVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolVersionInput() { + return this._protocolVersion; + } + + // weight - computed: false, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class AsGroupV1LbaasListenersList extends cdktf.ComplexList { + public internalValue? : AsGroupV1LbaasListeners[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsGroupV1LbaasListenersOutputReference { + return new AsGroupV1LbaasListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsGroupV1Networks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#id AsGroupV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#ipv6_bandwidth_id AsGroupV1#ipv6_bandwidth_id} + */ + readonly ipv6BandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#ipv6_enable AsGroupV1#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#source_dest_check AsGroupV1#source_dest_check} + */ + readonly sourceDestCheck?: boolean | cdktf.IResolvable; +} + +export function asGroupV1NetworksToTerraform(struct?: AsGroupV1Networks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + ipv6_bandwidth_id: cdktf.stringToTerraform(struct!.ipv6BandwidthId), + ipv6_enable: cdktf.booleanToTerraform(struct!.ipv6Enable), + source_dest_check: cdktf.booleanToTerraform(struct!.sourceDestCheck), + } +} + + +export function asGroupV1NetworksToHclTerraform(struct?: AsGroupV1Networks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_bandwidth_id: { + value: cdktf.stringToHclTerraform(struct!.ipv6BandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(struct!.ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + source_dest_check: { + value: cdktf.booleanToHclTerraform(struct!.sourceDestCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupV1NetworksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsGroupV1Networks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._ipv6BandwidthId !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6BandwidthId = this._ipv6BandwidthId; + } + if (this._ipv6Enable !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6Enable = this._ipv6Enable; + } + if (this._sourceDestCheck !== undefined) { + hasAnyValues = true; + internalValueResult.sourceDestCheck = this._sourceDestCheck; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupV1Networks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._ipv6BandwidthId = undefined; + this._ipv6Enable = undefined; + this._sourceDestCheck = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._ipv6BandwidthId = value.ipv6BandwidthId; + this._ipv6Enable = value.ipv6Enable; + this._sourceDestCheck = value.sourceDestCheck; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_bandwidth_id - computed: false, optional: true, required: false + private _ipv6BandwidthId?: string; + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + public set ipv6BandwidthId(value: string) { + this._ipv6BandwidthId = value; + } + public resetIpv6BandwidthId() { + this._ipv6BandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6BandwidthIdInput() { + return this._ipv6BandwidthId; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // source_dest_check - computed: false, optional: true, required: false + private _sourceDestCheck?: boolean | cdktf.IResolvable; + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } + public set sourceDestCheck(value: boolean | cdktf.IResolvable) { + this._sourceDestCheck = value; + } + public resetSourceDestCheck() { + this._sourceDestCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceDestCheckInput() { + return this._sourceDestCheck; + } +} + +export class AsGroupV1NetworksList extends cdktf.ComplexList { + public internalValue? : AsGroupV1Networks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsGroupV1NetworksOutputReference { + return new AsGroupV1NetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsGroupV1SecurityGroups { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#id AsGroupV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function asGroupV1SecurityGroupsToTerraform(struct?: AsGroupV1SecurityGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function asGroupV1SecurityGroupsToHclTerraform(struct?: AsGroupV1SecurityGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupV1SecurityGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsGroupV1SecurityGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupV1SecurityGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } +} + +export class AsGroupV1SecurityGroupsList extends cdktf.ComplexList { + public internalValue? : AsGroupV1SecurityGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsGroupV1SecurityGroupsOutputReference { + return new AsGroupV1SecurityGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsGroupV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#create AsGroupV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#delete AsGroupV1#delete} + */ + readonly delete?: string; +} + +export function asGroupV1TimeoutsToTerraform(struct?: AsGroupV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function asGroupV1TimeoutsToHclTerraform(struct?: AsGroupV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AsGroupV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1 huaweicloud_as_group_v1} +*/ +export class AsGroupV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_group_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsGroupV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsGroupV1 to import + * @param importFromId The id of the existing AsGroupV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsGroupV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_group_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group_v1 huaweicloud_as_group_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsGroupV1Config + */ + public constructor(scope: Construct, id: string, config: AsGroupV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_group_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._coolDownTime = config.coolDownTime; + this._deleteInstances = config.deleteInstances; + this._deletePublicip = config.deletePublicip; + this._deleteVolume = config.deleteVolume; + this._description = config.description; + this._desireInstanceNumber = config.desireInstanceNumber; + this._enable = config.enable; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forceDelete = config.forceDelete; + this._healthPeriodicAuditGracePeriod = config.healthPeriodicAuditGracePeriod; + this._healthPeriodicAuditMethod = config.healthPeriodicAuditMethod; + this._healthPeriodicAuditTime = config.healthPeriodicAuditTime; + this._id = config.id; + this._instanceTerminatePolicy = config.instanceTerminatePolicy; + this._lbListenerId = config.lbListenerId; + this._maxInstanceNumber = config.maxInstanceNumber; + this._minInstanceNumber = config.minInstanceNumber; + this._multiAzScalingPolicy = config.multiAzScalingPolicy; + this._notifications = config.notifications; + this._region = config.region; + this._scalingConfigurationId = config.scalingConfigurationId; + this._scalingGroupName = config.scalingGroupName; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._lbaasListeners.internalValue = config.lbaasListeners; + this._networks.internalValue = config.networks; + this._securityGroups.internalValue = config.securityGroups; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: false, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // cool_down_time - computed: false, optional: true, required: false + private _coolDownTime?: number; + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + public set coolDownTime(value: number) { + this._coolDownTime = value; + } + public resetCoolDownTime() { + this._coolDownTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get coolDownTimeInput() { + return this._coolDownTime; + } + + // current_instance_number - computed: true, optional: false, required: false + public get currentInstanceNumber() { + return this.getNumberAttribute('current_instance_number'); + } + + // delete_instances - computed: false, optional: true, required: false + private _deleteInstances?: string; + public get deleteInstances() { + return this.getStringAttribute('delete_instances'); + } + public set deleteInstances(value: string) { + this._deleteInstances = value; + } + public resetDeleteInstances() { + this._deleteInstances = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInstancesInput() { + return this._deleteInstances; + } + + // delete_publicip - computed: false, optional: true, required: false + private _deletePublicip?: boolean | cdktf.IResolvable; + public get deletePublicip() { + return this.getBooleanAttribute('delete_publicip'); + } + public set deletePublicip(value: boolean | cdktf.IResolvable) { + this._deletePublicip = value; + } + public resetDeletePublicip() { + this._deletePublicip = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletePublicipInput() { + return this._deletePublicip; + } + + // delete_volume - computed: true, optional: true, required: false + private _deleteVolume?: boolean | cdktf.IResolvable; + public get deleteVolume() { + return this.getBooleanAttribute('delete_volume'); + } + public set deleteVolume(value: boolean | cdktf.IResolvable) { + this._deleteVolume = value; + } + public resetDeleteVolume() { + this._deleteVolume = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteVolumeInput() { + return this._deleteVolume; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // desire_instance_number - computed: true, optional: true, required: false + private _desireInstanceNumber?: number; + public get desireInstanceNumber() { + return this.getNumberAttribute('desire_instance_number'); + } + public set desireInstanceNumber(value: number) { + this._desireInstanceNumber = value; + } + public resetDesireInstanceNumber() { + this._desireInstanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get desireInstanceNumberInput() { + return this._desireInstanceNumber; + } + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // force_delete - computed: false, optional: true, required: false + private _forceDelete?: boolean | cdktf.IResolvable; + public get forceDelete() { + return this.getBooleanAttribute('force_delete'); + } + public set forceDelete(value: boolean | cdktf.IResolvable) { + this._forceDelete = value; + } + public resetForceDelete() { + this._forceDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDeleteInput() { + return this._forceDelete; + } + + // health_periodic_audit_grace_period - computed: true, optional: true, required: false + private _healthPeriodicAuditGracePeriod?: number; + public get healthPeriodicAuditGracePeriod() { + return this.getNumberAttribute('health_periodic_audit_grace_period'); + } + public set healthPeriodicAuditGracePeriod(value: number) { + this._healthPeriodicAuditGracePeriod = value; + } + public resetHealthPeriodicAuditGracePeriod() { + this._healthPeriodicAuditGracePeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthPeriodicAuditGracePeriodInput() { + return this._healthPeriodicAuditGracePeriod; + } + + // health_periodic_audit_method - computed: false, optional: true, required: false + private _healthPeriodicAuditMethod?: string; + public get healthPeriodicAuditMethod() { + return this.getStringAttribute('health_periodic_audit_method'); + } + public set healthPeriodicAuditMethod(value: string) { + this._healthPeriodicAuditMethod = value; + } + public resetHealthPeriodicAuditMethod() { + this._healthPeriodicAuditMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthPeriodicAuditMethodInput() { + return this._healthPeriodicAuditMethod; + } + + // health_periodic_audit_time - computed: false, optional: true, required: false + private _healthPeriodicAuditTime?: number; + public get healthPeriodicAuditTime() { + return this.getNumberAttribute('health_periodic_audit_time'); + } + public set healthPeriodicAuditTime(value: number) { + this._healthPeriodicAuditTime = value; + } + public resetHealthPeriodicAuditTime() { + this._healthPeriodicAuditTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthPeriodicAuditTimeInput() { + return this._healthPeriodicAuditTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_terminate_policy - computed: false, optional: true, required: false + private _instanceTerminatePolicy?: string; + public get instanceTerminatePolicy() { + return this.getStringAttribute('instance_terminate_policy'); + } + public set instanceTerminatePolicy(value: string) { + this._instanceTerminatePolicy = value; + } + public resetInstanceTerminatePolicy() { + this._instanceTerminatePolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceTerminatePolicyInput() { + return this._instanceTerminatePolicy; + } + + // instances - computed: true, optional: false, required: false + public get instances() { + return this.getListAttribute('instances'); + } + + // lb_listener_id - computed: false, optional: true, required: false + private _lbListenerId?: string; + public get lbListenerId() { + return this.getStringAttribute('lb_listener_id'); + } + public set lbListenerId(value: string) { + this._lbListenerId = value; + } + public resetLbListenerId() { + this._lbListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbListenerIdInput() { + return this._lbListenerId; + } + + // max_instance_number - computed: false, optional: true, required: false + private _maxInstanceNumber?: number; + public get maxInstanceNumber() { + return this.getNumberAttribute('max_instance_number'); + } + public set maxInstanceNumber(value: number) { + this._maxInstanceNumber = value; + } + public resetMaxInstanceNumber() { + this._maxInstanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInstanceNumberInput() { + return this._maxInstanceNumber; + } + + // min_instance_number - computed: false, optional: true, required: false + private _minInstanceNumber?: number; + public get minInstanceNumber() { + return this.getNumberAttribute('min_instance_number'); + } + public set minInstanceNumber(value: number) { + this._minInstanceNumber = value; + } + public resetMinInstanceNumber() { + this._minInstanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get minInstanceNumberInput() { + return this._minInstanceNumber; + } + + // multi_az_scaling_policy - computed: true, optional: true, required: false + private _multiAzScalingPolicy?: string; + public get multiAzScalingPolicy() { + return this.getStringAttribute('multi_az_scaling_policy'); + } + public set multiAzScalingPolicy(value: string) { + this._multiAzScalingPolicy = value; + } + public resetMultiAzScalingPolicy() { + this._multiAzScalingPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiAzScalingPolicyInput() { + return this._multiAzScalingPolicy; + } + + // notifications - computed: false, optional: true, required: false + private _notifications?: string[]; + public get notifications() { + return this.getListAttribute('notifications'); + } + public set notifications(value: string[]) { + this._notifications = value; + } + public resetNotifications() { + this._notifications = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationsInput() { + return this._notifications; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_configuration_id - computed: true, optional: true, required: false + private _scalingConfigurationId?: string; + public get scalingConfigurationId() { + return this.getStringAttribute('scaling_configuration_id'); + } + public set scalingConfigurationId(value: string) { + this._scalingConfigurationId = value; + } + public resetScalingConfigurationId() { + this._scalingConfigurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingConfigurationIdInput() { + return this._scalingConfigurationId; + } + + // scaling_group_name - computed: false, optional: false, required: true + private _scalingGroupName?: string; + public get scalingGroupName() { + return this.getStringAttribute('scaling_group_name'); + } + public set scalingGroupName(value: string) { + this._scalingGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupNameInput() { + return this._scalingGroupName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // lbaas_listeners - computed: false, optional: true, required: false + private _lbaasListeners = new AsGroupV1LbaasListenersList(this, "lbaas_listeners", false); + public get lbaasListeners() { + return this._lbaasListeners; + } + public putLbaasListeners(value: AsGroupV1LbaasListeners[] | cdktf.IResolvable) { + this._lbaasListeners.internalValue = value; + } + public resetLbaasListeners() { + this._lbaasListeners.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbaasListenersInput() { + return this._lbaasListeners.internalValue; + } + + // networks - computed: false, optional: false, required: true + private _networks = new AsGroupV1NetworksList(this, "networks", false); + public get networks() { + return this._networks; + } + public putNetworks(value: AsGroupV1Networks[] | cdktf.IResolvable) { + this._networks.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get networksInput() { + return this._networks.internalValue; + } + + // security_groups - computed: false, optional: true, required: false + private _securityGroups = new AsGroupV1SecurityGroupsList(this, "security_groups", false); + public get securityGroups() { + return this._securityGroups; + } + public putSecurityGroups(value: AsGroupV1SecurityGroups[] | cdktf.IResolvable) { + this._securityGroups.internalValue = value; + } + public resetSecurityGroups() { + this._securityGroups.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AsGroupV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AsGroupV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + cool_down_time: cdktf.numberToTerraform(this._coolDownTime), + delete_instances: cdktf.stringToTerraform(this._deleteInstances), + delete_publicip: cdktf.booleanToTerraform(this._deletePublicip), + delete_volume: cdktf.booleanToTerraform(this._deleteVolume), + description: cdktf.stringToTerraform(this._description), + desire_instance_number: cdktf.numberToTerraform(this._desireInstanceNumber), + enable: cdktf.booleanToTerraform(this._enable), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + force_delete: cdktf.booleanToTerraform(this._forceDelete), + health_periodic_audit_grace_period: cdktf.numberToTerraform(this._healthPeriodicAuditGracePeriod), + health_periodic_audit_method: cdktf.stringToTerraform(this._healthPeriodicAuditMethod), + health_periodic_audit_time: cdktf.numberToTerraform(this._healthPeriodicAuditTime), + id: cdktf.stringToTerraform(this._id), + instance_terminate_policy: cdktf.stringToTerraform(this._instanceTerminatePolicy), + lb_listener_id: cdktf.stringToTerraform(this._lbListenerId), + max_instance_number: cdktf.numberToTerraform(this._maxInstanceNumber), + min_instance_number: cdktf.numberToTerraform(this._minInstanceNumber), + multi_az_scaling_policy: cdktf.stringToTerraform(this._multiAzScalingPolicy), + notifications: cdktf.listMapper(cdktf.stringToTerraform, false)(this._notifications), + region: cdktf.stringToTerraform(this._region), + scaling_configuration_id: cdktf.stringToTerraform(this._scalingConfigurationId), + scaling_group_name: cdktf.stringToTerraform(this._scalingGroupName), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + lbaas_listeners: cdktf.listMapper(asGroupV1LbaasListenersToTerraform, true)(this._lbaasListeners.internalValue), + networks: cdktf.listMapper(asGroupV1NetworksToTerraform, true)(this._networks.internalValue), + security_groups: cdktf.listMapper(asGroupV1SecurityGroupsToTerraform, true)(this._securityGroups.internalValue), + timeouts: asGroupV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + cool_down_time: { + value: cdktf.numberToHclTerraform(this._coolDownTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + delete_instances: { + value: cdktf.stringToHclTerraform(this._deleteInstances), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_publicip: { + value: cdktf.booleanToHclTerraform(this._deletePublicip), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delete_volume: { + value: cdktf.booleanToHclTerraform(this._deleteVolume), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + desire_instance_number: { + value: cdktf.numberToHclTerraform(this._desireInstanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enable: { + value: cdktf.booleanToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_delete: { + value: cdktf.booleanToHclTerraform(this._forceDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + health_periodic_audit_grace_period: { + value: cdktf.numberToHclTerraform(this._healthPeriodicAuditGracePeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + health_periodic_audit_method: { + value: cdktf.stringToHclTerraform(this._healthPeriodicAuditMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + health_periodic_audit_time: { + value: cdktf.numberToHclTerraform(this._healthPeriodicAuditTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_terminate_policy: { + value: cdktf.stringToHclTerraform(this._instanceTerminatePolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_listener_id: { + value: cdktf.stringToHclTerraform(this._lbListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_instance_number: { + value: cdktf.numberToHclTerraform(this._maxInstanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_instance_number: { + value: cdktf.numberToHclTerraform(this._minInstanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + multi_az_scaling_policy: { + value: cdktf.stringToHclTerraform(this._multiAzScalingPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notifications: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._notifications), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_configuration_id: { + value: cdktf.stringToHclTerraform(this._scalingConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_name: { + value: cdktf.stringToHclTerraform(this._scalingGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lbaas_listeners: { + value: cdktf.listMapperHcl(asGroupV1LbaasListenersToHclTerraform, true)(this._lbaasListeners.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsGroupV1LbaasListenersList", + }, + networks: { + value: cdktf.listMapperHcl(asGroupV1NetworksToHclTerraform, true)(this._networks.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsGroupV1NetworksList", + }, + security_groups: { + value: cdktf.listMapperHcl(asGroupV1SecurityGroupsToHclTerraform, true)(this._securityGroups.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsGroupV1SecurityGroupsList", + }, + timeouts: { + value: asGroupV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AsGroupV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-group/README.md b/src/constructs/providers/huaweicloud/as-group/README.md new file mode 100644 index 00000000..02abb6db --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group). diff --git a/src/constructs/providers/huaweicloud/as-group/index.ts b/src/constructs/providers/huaweicloud/as-group/index.ts new file mode 100644 index 00000000..196a3b17 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-group/index.ts @@ -0,0 +1,1653 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#agency_name AsGroup#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#availability_zones AsGroup#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * schema: Deprecated; use availability_zones instead + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#available_zones AsGroup#available_zones} + */ + readonly availableZones?: string[]; + /** + * The cooling duration, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#cool_down_time AsGroup#cool_down_time} + */ + readonly coolDownTime?: number; + /** + * Whether to delete instances when they are removed from the AS group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#delete_instances AsGroup#delete_instances} + */ + readonly deleteInstances?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#delete_publicip AsGroup#delete_publicip} + */ + readonly deletePublicip?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#delete_volume AsGroup#delete_volume} + */ + readonly deleteVolume?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#description AsGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#desire_instance_number AsGroup#desire_instance_number} + */ + readonly desireInstanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#enable AsGroup#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#enterprise_project_id AsGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#force_delete AsGroup#force_delete} + */ + readonly forceDelete?: boolean | cdktf.IResolvable; + /** + * The health check grace period for instances, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#health_periodic_audit_grace_period AsGroup#health_periodic_audit_grace_period} + */ + readonly healthPeriodicAuditGracePeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#health_periodic_audit_method AsGroup#health_periodic_audit_method} + */ + readonly healthPeriodicAuditMethod?: string; + /** + * The health check period for instances, in minutes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#health_periodic_audit_time AsGroup#health_periodic_audit_time} + */ + readonly healthPeriodicAuditTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#id AsGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#instance_terminate_policy AsGroup#instance_terminate_policy} + */ + readonly instanceTerminatePolicy?: string; + /** + * The system supports the binding of up to six ELB listeners, the IDs of which are separated using a comma. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#lb_listener_id AsGroup#lb_listener_id} + */ + readonly lbListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#max_instance_number AsGroup#max_instance_number} + */ + readonly maxInstanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#min_instance_number AsGroup#min_instance_number} + */ + readonly minInstanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#multi_az_scaling_policy AsGroup#multi_az_scaling_policy} + */ + readonly multiAzScalingPolicy?: string; + /** + * schema: Deprecated; The notification mode has been canceled + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#notifications AsGroup#notifications} + */ + readonly notifications?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#region AsGroup#region} + */ + readonly region?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#scaling_configuration_id AsGroup#scaling_configuration_id} + */ + readonly scalingConfigurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#scaling_group_name AsGroup#scaling_group_name} + */ + readonly scalingGroupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#tags AsGroup#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#vpc_id AsGroup#vpc_id} + */ + readonly vpcId: string; + /** + * lbaas_listeners block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#lbaas_listeners AsGroup#lbaas_listeners} + */ + readonly lbaasListeners?: AsGroupLbaasListeners[] | cdktf.IResolvable; + /** + * networks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#networks AsGroup#networks} + */ + readonly networks: AsGroupNetworks[] | cdktf.IResolvable; + /** + * security_groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#security_groups AsGroup#security_groups} + */ + readonly securityGroups?: AsGroupSecurityGroups[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#timeouts AsGroup#timeouts} + */ + readonly timeouts?: AsGroupTimeouts; +} +export interface AsGroupLbaasListeners { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#pool_id AsGroup#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#protocol_port AsGroup#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#protocol_version AsGroup#protocol_version} + */ + readonly protocolVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#weight AsGroup#weight} + */ + readonly weight?: number; +} + +export function asGroupLbaasListenersToTerraform(struct?: AsGroupLbaasListeners | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + pool_id: cdktf.stringToTerraform(struct!.poolId), + protocol_port: cdktf.numberToTerraform(struct!.protocolPort), + protocol_version: cdktf.stringToTerraform(struct!.protocolVersion), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function asGroupLbaasListenersToHclTerraform(struct?: AsGroupLbaasListeners | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + pool_id: { + value: cdktf.stringToHclTerraform(struct!.poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(struct!.protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol_version: { + value: cdktf.stringToHclTerraform(struct!.protocolVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupLbaasListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsGroupLbaasListeners | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._poolId !== undefined) { + hasAnyValues = true; + internalValueResult.poolId = this._poolId; + } + if (this._protocolPort !== undefined) { + hasAnyValues = true; + internalValueResult.protocolPort = this._protocolPort; + } + if (this._protocolVersion !== undefined) { + hasAnyValues = true; + internalValueResult.protocolVersion = this._protocolVersion; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupLbaasListeners | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._poolId = undefined; + this._protocolPort = undefined; + this._protocolVersion = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._poolId = value.poolId; + this._protocolPort = value.protocolPort; + this._protocolVersion = value.protocolVersion; + this._weight = value.weight; + } + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // protocol_version - computed: true, optional: true, required: false + private _protocolVersion?: string; + public get protocolVersion() { + return this.getStringAttribute('protocol_version'); + } + public set protocolVersion(value: string) { + this._protocolVersion = value; + } + public resetProtocolVersion() { + this._protocolVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolVersionInput() { + return this._protocolVersion; + } + + // weight - computed: false, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class AsGroupLbaasListenersList extends cdktf.ComplexList { + public internalValue? : AsGroupLbaasListeners[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsGroupLbaasListenersOutputReference { + return new AsGroupLbaasListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsGroupNetworks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#id AsGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#ipv6_bandwidth_id AsGroup#ipv6_bandwidth_id} + */ + readonly ipv6BandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#ipv6_enable AsGroup#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#source_dest_check AsGroup#source_dest_check} + */ + readonly sourceDestCheck?: boolean | cdktf.IResolvable; +} + +export function asGroupNetworksToTerraform(struct?: AsGroupNetworks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + ipv6_bandwidth_id: cdktf.stringToTerraform(struct!.ipv6BandwidthId), + ipv6_enable: cdktf.booleanToTerraform(struct!.ipv6Enable), + source_dest_check: cdktf.booleanToTerraform(struct!.sourceDestCheck), + } +} + + +export function asGroupNetworksToHclTerraform(struct?: AsGroupNetworks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_bandwidth_id: { + value: cdktf.stringToHclTerraform(struct!.ipv6BandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(struct!.ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + source_dest_check: { + value: cdktf.booleanToHclTerraform(struct!.sourceDestCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupNetworksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsGroupNetworks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._ipv6BandwidthId !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6BandwidthId = this._ipv6BandwidthId; + } + if (this._ipv6Enable !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6Enable = this._ipv6Enable; + } + if (this._sourceDestCheck !== undefined) { + hasAnyValues = true; + internalValueResult.sourceDestCheck = this._sourceDestCheck; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupNetworks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._ipv6BandwidthId = undefined; + this._ipv6Enable = undefined; + this._sourceDestCheck = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._ipv6BandwidthId = value.ipv6BandwidthId; + this._ipv6Enable = value.ipv6Enable; + this._sourceDestCheck = value.sourceDestCheck; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_bandwidth_id - computed: false, optional: true, required: false + private _ipv6BandwidthId?: string; + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + public set ipv6BandwidthId(value: string) { + this._ipv6BandwidthId = value; + } + public resetIpv6BandwidthId() { + this._ipv6BandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6BandwidthIdInput() { + return this._ipv6BandwidthId; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // source_dest_check - computed: false, optional: true, required: false + private _sourceDestCheck?: boolean | cdktf.IResolvable; + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } + public set sourceDestCheck(value: boolean | cdktf.IResolvable) { + this._sourceDestCheck = value; + } + public resetSourceDestCheck() { + this._sourceDestCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceDestCheckInput() { + return this._sourceDestCheck; + } +} + +export class AsGroupNetworksList extends cdktf.ComplexList { + public internalValue? : AsGroupNetworks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsGroupNetworksOutputReference { + return new AsGroupNetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsGroupSecurityGroups { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#id AsGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function asGroupSecurityGroupsToTerraform(struct?: AsGroupSecurityGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function asGroupSecurityGroupsToHclTerraform(struct?: AsGroupSecurityGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupSecurityGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsGroupSecurityGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupSecurityGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } +} + +export class AsGroupSecurityGroupsList extends cdktf.ComplexList { + public internalValue? : AsGroupSecurityGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsGroupSecurityGroupsOutputReference { + return new AsGroupSecurityGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#create AsGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#delete AsGroup#delete} + */ + readonly delete?: string; +} + +export function asGroupTimeoutsToTerraform(struct?: AsGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function asGroupTimeoutsToHclTerraform(struct?: AsGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AsGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group huaweicloud_as_group} +*/ +export class AsGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsGroup to import + * @param importFromId The id of the existing AsGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_group huaweicloud_as_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsGroupConfig + */ + public constructor(scope: Construct, id: string, config: AsGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._coolDownTime = config.coolDownTime; + this._deleteInstances = config.deleteInstances; + this._deletePublicip = config.deletePublicip; + this._deleteVolume = config.deleteVolume; + this._description = config.description; + this._desireInstanceNumber = config.desireInstanceNumber; + this._enable = config.enable; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forceDelete = config.forceDelete; + this._healthPeriodicAuditGracePeriod = config.healthPeriodicAuditGracePeriod; + this._healthPeriodicAuditMethod = config.healthPeriodicAuditMethod; + this._healthPeriodicAuditTime = config.healthPeriodicAuditTime; + this._id = config.id; + this._instanceTerminatePolicy = config.instanceTerminatePolicy; + this._lbListenerId = config.lbListenerId; + this._maxInstanceNumber = config.maxInstanceNumber; + this._minInstanceNumber = config.minInstanceNumber; + this._multiAzScalingPolicy = config.multiAzScalingPolicy; + this._notifications = config.notifications; + this._region = config.region; + this._scalingConfigurationId = config.scalingConfigurationId; + this._scalingGroupName = config.scalingGroupName; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._lbaasListeners.internalValue = config.lbaasListeners; + this._networks.internalValue = config.networks; + this._securityGroups.internalValue = config.securityGroups; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: false, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // cool_down_time - computed: false, optional: true, required: false + private _coolDownTime?: number; + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + public set coolDownTime(value: number) { + this._coolDownTime = value; + } + public resetCoolDownTime() { + this._coolDownTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get coolDownTimeInput() { + return this._coolDownTime; + } + + // current_instance_number - computed: true, optional: false, required: false + public get currentInstanceNumber() { + return this.getNumberAttribute('current_instance_number'); + } + + // delete_instances - computed: false, optional: true, required: false + private _deleteInstances?: string; + public get deleteInstances() { + return this.getStringAttribute('delete_instances'); + } + public set deleteInstances(value: string) { + this._deleteInstances = value; + } + public resetDeleteInstances() { + this._deleteInstances = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInstancesInput() { + return this._deleteInstances; + } + + // delete_publicip - computed: false, optional: true, required: false + private _deletePublicip?: boolean | cdktf.IResolvable; + public get deletePublicip() { + return this.getBooleanAttribute('delete_publicip'); + } + public set deletePublicip(value: boolean | cdktf.IResolvable) { + this._deletePublicip = value; + } + public resetDeletePublicip() { + this._deletePublicip = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletePublicipInput() { + return this._deletePublicip; + } + + // delete_volume - computed: true, optional: true, required: false + private _deleteVolume?: boolean | cdktf.IResolvable; + public get deleteVolume() { + return this.getBooleanAttribute('delete_volume'); + } + public set deleteVolume(value: boolean | cdktf.IResolvable) { + this._deleteVolume = value; + } + public resetDeleteVolume() { + this._deleteVolume = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteVolumeInput() { + return this._deleteVolume; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // desire_instance_number - computed: true, optional: true, required: false + private _desireInstanceNumber?: number; + public get desireInstanceNumber() { + return this.getNumberAttribute('desire_instance_number'); + } + public set desireInstanceNumber(value: number) { + this._desireInstanceNumber = value; + } + public resetDesireInstanceNumber() { + this._desireInstanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get desireInstanceNumberInput() { + return this._desireInstanceNumber; + } + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // force_delete - computed: false, optional: true, required: false + private _forceDelete?: boolean | cdktf.IResolvable; + public get forceDelete() { + return this.getBooleanAttribute('force_delete'); + } + public set forceDelete(value: boolean | cdktf.IResolvable) { + this._forceDelete = value; + } + public resetForceDelete() { + this._forceDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDeleteInput() { + return this._forceDelete; + } + + // health_periodic_audit_grace_period - computed: true, optional: true, required: false + private _healthPeriodicAuditGracePeriod?: number; + public get healthPeriodicAuditGracePeriod() { + return this.getNumberAttribute('health_periodic_audit_grace_period'); + } + public set healthPeriodicAuditGracePeriod(value: number) { + this._healthPeriodicAuditGracePeriod = value; + } + public resetHealthPeriodicAuditGracePeriod() { + this._healthPeriodicAuditGracePeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthPeriodicAuditGracePeriodInput() { + return this._healthPeriodicAuditGracePeriod; + } + + // health_periodic_audit_method - computed: false, optional: true, required: false + private _healthPeriodicAuditMethod?: string; + public get healthPeriodicAuditMethod() { + return this.getStringAttribute('health_periodic_audit_method'); + } + public set healthPeriodicAuditMethod(value: string) { + this._healthPeriodicAuditMethod = value; + } + public resetHealthPeriodicAuditMethod() { + this._healthPeriodicAuditMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthPeriodicAuditMethodInput() { + return this._healthPeriodicAuditMethod; + } + + // health_periodic_audit_time - computed: false, optional: true, required: false + private _healthPeriodicAuditTime?: number; + public get healthPeriodicAuditTime() { + return this.getNumberAttribute('health_periodic_audit_time'); + } + public set healthPeriodicAuditTime(value: number) { + this._healthPeriodicAuditTime = value; + } + public resetHealthPeriodicAuditTime() { + this._healthPeriodicAuditTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthPeriodicAuditTimeInput() { + return this._healthPeriodicAuditTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_terminate_policy - computed: false, optional: true, required: false + private _instanceTerminatePolicy?: string; + public get instanceTerminatePolicy() { + return this.getStringAttribute('instance_terminate_policy'); + } + public set instanceTerminatePolicy(value: string) { + this._instanceTerminatePolicy = value; + } + public resetInstanceTerminatePolicy() { + this._instanceTerminatePolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceTerminatePolicyInput() { + return this._instanceTerminatePolicy; + } + + // instances - computed: true, optional: false, required: false + public get instances() { + return this.getListAttribute('instances'); + } + + // lb_listener_id - computed: false, optional: true, required: false + private _lbListenerId?: string; + public get lbListenerId() { + return this.getStringAttribute('lb_listener_id'); + } + public set lbListenerId(value: string) { + this._lbListenerId = value; + } + public resetLbListenerId() { + this._lbListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbListenerIdInput() { + return this._lbListenerId; + } + + // max_instance_number - computed: false, optional: true, required: false + private _maxInstanceNumber?: number; + public get maxInstanceNumber() { + return this.getNumberAttribute('max_instance_number'); + } + public set maxInstanceNumber(value: number) { + this._maxInstanceNumber = value; + } + public resetMaxInstanceNumber() { + this._maxInstanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInstanceNumberInput() { + return this._maxInstanceNumber; + } + + // min_instance_number - computed: false, optional: true, required: false + private _minInstanceNumber?: number; + public get minInstanceNumber() { + return this.getNumberAttribute('min_instance_number'); + } + public set minInstanceNumber(value: number) { + this._minInstanceNumber = value; + } + public resetMinInstanceNumber() { + this._minInstanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get minInstanceNumberInput() { + return this._minInstanceNumber; + } + + // multi_az_scaling_policy - computed: true, optional: true, required: false + private _multiAzScalingPolicy?: string; + public get multiAzScalingPolicy() { + return this.getStringAttribute('multi_az_scaling_policy'); + } + public set multiAzScalingPolicy(value: string) { + this._multiAzScalingPolicy = value; + } + public resetMultiAzScalingPolicy() { + this._multiAzScalingPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiAzScalingPolicyInput() { + return this._multiAzScalingPolicy; + } + + // notifications - computed: false, optional: true, required: false + private _notifications?: string[]; + public get notifications() { + return this.getListAttribute('notifications'); + } + public set notifications(value: string[]) { + this._notifications = value; + } + public resetNotifications() { + this._notifications = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationsInput() { + return this._notifications; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_configuration_id - computed: true, optional: true, required: false + private _scalingConfigurationId?: string; + public get scalingConfigurationId() { + return this.getStringAttribute('scaling_configuration_id'); + } + public set scalingConfigurationId(value: string) { + this._scalingConfigurationId = value; + } + public resetScalingConfigurationId() { + this._scalingConfigurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingConfigurationIdInput() { + return this._scalingConfigurationId; + } + + // scaling_group_name - computed: false, optional: false, required: true + private _scalingGroupName?: string; + public get scalingGroupName() { + return this.getStringAttribute('scaling_group_name'); + } + public set scalingGroupName(value: string) { + this._scalingGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupNameInput() { + return this._scalingGroupName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // lbaas_listeners - computed: false, optional: true, required: false + private _lbaasListeners = new AsGroupLbaasListenersList(this, "lbaas_listeners", false); + public get lbaasListeners() { + return this._lbaasListeners; + } + public putLbaasListeners(value: AsGroupLbaasListeners[] | cdktf.IResolvable) { + this._lbaasListeners.internalValue = value; + } + public resetLbaasListeners() { + this._lbaasListeners.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbaasListenersInput() { + return this._lbaasListeners.internalValue; + } + + // networks - computed: false, optional: false, required: true + private _networks = new AsGroupNetworksList(this, "networks", false); + public get networks() { + return this._networks; + } + public putNetworks(value: AsGroupNetworks[] | cdktf.IResolvable) { + this._networks.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get networksInput() { + return this._networks.internalValue; + } + + // security_groups - computed: false, optional: true, required: false + private _securityGroups = new AsGroupSecurityGroupsList(this, "security_groups", false); + public get securityGroups() { + return this._securityGroups; + } + public putSecurityGroups(value: AsGroupSecurityGroups[] | cdktf.IResolvable) { + this._securityGroups.internalValue = value; + } + public resetSecurityGroups() { + this._securityGroups.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AsGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AsGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + cool_down_time: cdktf.numberToTerraform(this._coolDownTime), + delete_instances: cdktf.stringToTerraform(this._deleteInstances), + delete_publicip: cdktf.booleanToTerraform(this._deletePublicip), + delete_volume: cdktf.booleanToTerraform(this._deleteVolume), + description: cdktf.stringToTerraform(this._description), + desire_instance_number: cdktf.numberToTerraform(this._desireInstanceNumber), + enable: cdktf.booleanToTerraform(this._enable), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + force_delete: cdktf.booleanToTerraform(this._forceDelete), + health_periodic_audit_grace_period: cdktf.numberToTerraform(this._healthPeriodicAuditGracePeriod), + health_periodic_audit_method: cdktf.stringToTerraform(this._healthPeriodicAuditMethod), + health_periodic_audit_time: cdktf.numberToTerraform(this._healthPeriodicAuditTime), + id: cdktf.stringToTerraform(this._id), + instance_terminate_policy: cdktf.stringToTerraform(this._instanceTerminatePolicy), + lb_listener_id: cdktf.stringToTerraform(this._lbListenerId), + max_instance_number: cdktf.numberToTerraform(this._maxInstanceNumber), + min_instance_number: cdktf.numberToTerraform(this._minInstanceNumber), + multi_az_scaling_policy: cdktf.stringToTerraform(this._multiAzScalingPolicy), + notifications: cdktf.listMapper(cdktf.stringToTerraform, false)(this._notifications), + region: cdktf.stringToTerraform(this._region), + scaling_configuration_id: cdktf.stringToTerraform(this._scalingConfigurationId), + scaling_group_name: cdktf.stringToTerraform(this._scalingGroupName), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + lbaas_listeners: cdktf.listMapper(asGroupLbaasListenersToTerraform, true)(this._lbaasListeners.internalValue), + networks: cdktf.listMapper(asGroupNetworksToTerraform, true)(this._networks.internalValue), + security_groups: cdktf.listMapper(asGroupSecurityGroupsToTerraform, true)(this._securityGroups.internalValue), + timeouts: asGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + cool_down_time: { + value: cdktf.numberToHclTerraform(this._coolDownTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + delete_instances: { + value: cdktf.stringToHclTerraform(this._deleteInstances), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_publicip: { + value: cdktf.booleanToHclTerraform(this._deletePublicip), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delete_volume: { + value: cdktf.booleanToHclTerraform(this._deleteVolume), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + desire_instance_number: { + value: cdktf.numberToHclTerraform(this._desireInstanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enable: { + value: cdktf.booleanToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_delete: { + value: cdktf.booleanToHclTerraform(this._forceDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + health_periodic_audit_grace_period: { + value: cdktf.numberToHclTerraform(this._healthPeriodicAuditGracePeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + health_periodic_audit_method: { + value: cdktf.stringToHclTerraform(this._healthPeriodicAuditMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + health_periodic_audit_time: { + value: cdktf.numberToHclTerraform(this._healthPeriodicAuditTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_terminate_policy: { + value: cdktf.stringToHclTerraform(this._instanceTerminatePolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_listener_id: { + value: cdktf.stringToHclTerraform(this._lbListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_instance_number: { + value: cdktf.numberToHclTerraform(this._maxInstanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_instance_number: { + value: cdktf.numberToHclTerraform(this._minInstanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + multi_az_scaling_policy: { + value: cdktf.stringToHclTerraform(this._multiAzScalingPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notifications: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._notifications), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_configuration_id: { + value: cdktf.stringToHclTerraform(this._scalingConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_name: { + value: cdktf.stringToHclTerraform(this._scalingGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lbaas_listeners: { + value: cdktf.listMapperHcl(asGroupLbaasListenersToHclTerraform, true)(this._lbaasListeners.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsGroupLbaasListenersList", + }, + networks: { + value: cdktf.listMapperHcl(asGroupNetworksToHclTerraform, true)(this._networks.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsGroupNetworksList", + }, + security_groups: { + value: cdktf.listMapperHcl(asGroupSecurityGroupsToHclTerraform, true)(this._securityGroups.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsGroupSecurityGroupsList", + }, + timeouts: { + value: asGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AsGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-instance-attach/README.md b/src/constructs/providers/huaweicloud/as-instance-attach/README.md new file mode 100644 index 00000000..03f91ea3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-instance-attach/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_instance_attach` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_instance_attach`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach). diff --git a/src/constructs/providers/huaweicloud/as-instance-attach/index.ts b/src/constructs/providers/huaweicloud/as-instance-attach/index.ts new file mode 100644 index 00000000..6a11c62b --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-instance-attach/index.ts @@ -0,0 +1,483 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsInstanceAttachConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#append_instance AsInstanceAttach#append_instance} + */ + readonly appendInstance?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#id AsInstanceAttach#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#instance_id AsInstanceAttach#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#protected AsInstanceAttach#protected} + */ + readonly protected?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#region AsInstanceAttach#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#scaling_group_id AsInstanceAttach#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#standby AsInstanceAttach#standby} + */ + readonly standby?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#timeouts AsInstanceAttach#timeouts} + */ + readonly timeouts?: AsInstanceAttachTimeouts; +} +export interface AsInstanceAttachTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#create AsInstanceAttach#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#delete AsInstanceAttach#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#update AsInstanceAttach#update} + */ + readonly update?: string; +} + +export function asInstanceAttachTimeoutsToTerraform(struct?: AsInstanceAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function asInstanceAttachTimeoutsToHclTerraform(struct?: AsInstanceAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsInstanceAttachTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AsInstanceAttachTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsInstanceAttachTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach huaweicloud_as_instance_attach} +*/ +export class AsInstanceAttach extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_instance_attach"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsInstanceAttach resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsInstanceAttach to import + * @param importFromId The id of the existing AsInstanceAttach that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsInstanceAttach to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_instance_attach", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_instance_attach huaweicloud_as_instance_attach} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsInstanceAttachConfig + */ + public constructor(scope: Construct, id: string, config: AsInstanceAttachConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_instance_attach', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appendInstance = config.appendInstance; + this._id = config.id; + this._instanceId = config.instanceId; + this._protected = config.protected; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._standby = config.standby; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // append_instance - computed: false, optional: true, required: false + private _appendInstance?: boolean | cdktf.IResolvable; + public get appendInstance() { + return this.getBooleanAttribute('append_instance'); + } + public set appendInstance(value: boolean | cdktf.IResolvable) { + this._appendInstance = value; + } + public resetAppendInstance() { + this._appendInstance = undefined; + } + // Temporarily expose input value. Use with caution. + public get appendInstanceInput() { + return this._appendInstance; + } + + // health_status - computed: true, optional: false, required: false + public get healthStatus() { + return this.getStringAttribute('health_status'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // protected - computed: true, optional: true, required: false + private _protected?: boolean | cdktf.IResolvable; + public get protected() { + return this.getBooleanAttribute('protected'); + } + public set protected(value: boolean | cdktf.IResolvable) { + this._protected = value; + } + public resetProtected() { + this._protected = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectedInput() { + return this._protected; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // standby - computed: true, optional: true, required: false + private _standby?: boolean | cdktf.IResolvable; + public get standby() { + return this.getBooleanAttribute('standby'); + } + public set standby(value: boolean | cdktf.IResolvable) { + this._standby = value; + } + public resetStandby() { + this._standby = undefined; + } + // Temporarily expose input value. Use with caution. + public get standbyInput() { + return this._standby; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AsInstanceAttachTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AsInstanceAttachTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + append_instance: cdktf.booleanToTerraform(this._appendInstance), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + protected: cdktf.booleanToTerraform(this._protected), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + standby: cdktf.booleanToTerraform(this._standby), + timeouts: asInstanceAttachTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + append_instance: { + value: cdktf.booleanToHclTerraform(this._appendInstance), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected: { + value: cdktf.booleanToHclTerraform(this._protected), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby: { + value: cdktf.booleanToHclTerraform(this._standby), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: asInstanceAttachTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AsInstanceAttachTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/README.md b/src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/README.md new file mode 100644 index 00000000..4733b22c --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_lifecycle_hook_callback` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_lifecycle_hook_callback`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback). diff --git a/src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/index.ts b/src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/index.ts new file mode 100644 index 00000000..9d42725a --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-lifecycle-hook-callback/index.ts @@ -0,0 +1,278 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsLifecycleHookCallbackConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#id AsLifecycleHookCallback#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#instance_id AsLifecycleHookCallback#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#lifecycle_action_key AsLifecycleHookCallback#lifecycle_action_key} + */ + readonly lifecycleActionKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#lifecycle_action_result AsLifecycleHookCallback#lifecycle_action_result} + */ + readonly lifecycleActionResult: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#lifecycle_hook_name AsLifecycleHookCallback#lifecycle_hook_name} + */ + readonly lifecycleHookName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#region AsLifecycleHookCallback#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#scaling_group_id AsLifecycleHookCallback#scaling_group_id} + */ + readonly scalingGroupId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback huaweicloud_as_lifecycle_hook_callback} +*/ +export class AsLifecycleHookCallback extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_lifecycle_hook_callback"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsLifecycleHookCallback resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsLifecycleHookCallback to import + * @param importFromId The id of the existing AsLifecycleHookCallback that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsLifecycleHookCallback to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_lifecycle_hook_callback", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook_callback huaweicloud_as_lifecycle_hook_callback} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsLifecycleHookCallbackConfig + */ + public constructor(scope: Construct, id: string, config: AsLifecycleHookCallbackConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_lifecycle_hook_callback', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._lifecycleActionKey = config.lifecycleActionKey; + this._lifecycleActionResult = config.lifecycleActionResult; + this._lifecycleHookName = config.lifecycleHookName; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lifecycle_action_key - computed: false, optional: true, required: false + private _lifecycleActionKey?: string; + public get lifecycleActionKey() { + return this.getStringAttribute('lifecycle_action_key'); + } + public set lifecycleActionKey(value: string) { + this._lifecycleActionKey = value; + } + public resetLifecycleActionKey() { + this._lifecycleActionKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifecycleActionKeyInput() { + return this._lifecycleActionKey; + } + + // lifecycle_action_result - computed: false, optional: false, required: true + private _lifecycleActionResult?: string; + public get lifecycleActionResult() { + return this.getStringAttribute('lifecycle_action_result'); + } + public set lifecycleActionResult(value: string) { + this._lifecycleActionResult = value; + } + // Temporarily expose input value. Use with caution. + public get lifecycleActionResultInput() { + return this._lifecycleActionResult; + } + + // lifecycle_hook_name - computed: false, optional: true, required: false + private _lifecycleHookName?: string; + public get lifecycleHookName() { + return this.getStringAttribute('lifecycle_hook_name'); + } + public set lifecycleHookName(value: string) { + this._lifecycleHookName = value; + } + public resetLifecycleHookName() { + this._lifecycleHookName = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifecycleHookNameInput() { + return this._lifecycleHookName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lifecycle_action_key: cdktf.stringToTerraform(this._lifecycleActionKey), + lifecycle_action_result: cdktf.stringToTerraform(this._lifecycleActionResult), + lifecycle_hook_name: cdktf.stringToTerraform(this._lifecycleHookName), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifecycle_action_key: { + value: cdktf.stringToHclTerraform(this._lifecycleActionKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifecycle_action_result: { + value: cdktf.stringToHclTerraform(this._lifecycleActionResult), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifecycle_hook_name: { + value: cdktf.stringToHclTerraform(this._lifecycleHookName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-lifecycle-hook/README.md b/src/constructs/providers/huaweicloud/as-lifecycle-hook/README.md new file mode 100644 index 00000000..b1c83b85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-lifecycle-hook/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_lifecycle_hook` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_lifecycle_hook`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook). diff --git a/src/constructs/providers/huaweicloud/as-lifecycle-hook/index.ts b/src/constructs/providers/huaweicloud/as-lifecycle-hook/index.ts new file mode 100644 index 00000000..554403ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-lifecycle-hook/index.ts @@ -0,0 +1,338 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsLifecycleHookConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#default_result AsLifecycleHook#default_result} + */ + readonly defaultResult?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#id AsLifecycleHook#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#name AsLifecycleHook#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#notification_message AsLifecycleHook#notification_message} + */ + readonly notificationMessage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#notification_topic_urn AsLifecycleHook#notification_topic_urn} + */ + readonly notificationTopicUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#region AsLifecycleHook#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#scaling_group_id AsLifecycleHook#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#timeout AsLifecycleHook#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#type AsLifecycleHook#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook huaweicloud_as_lifecycle_hook} +*/ +export class AsLifecycleHook extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_lifecycle_hook"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsLifecycleHook resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsLifecycleHook to import + * @param importFromId The id of the existing AsLifecycleHook that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsLifecycleHook to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_lifecycle_hook", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_lifecycle_hook huaweicloud_as_lifecycle_hook} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsLifecycleHookConfig + */ + public constructor(scope: Construct, id: string, config: AsLifecycleHookConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_lifecycle_hook', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._defaultResult = config.defaultResult; + this._id = config.id; + this._name = config.name; + this._notificationMessage = config.notificationMessage; + this._notificationTopicUrn = config.notificationTopicUrn; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._timeout = config.timeout; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // default_result - computed: false, optional: true, required: false + private _defaultResult?: string; + public get defaultResult() { + return this.getStringAttribute('default_result'); + } + public set defaultResult(value: string) { + this._defaultResult = value; + } + public resetDefaultResult() { + this._defaultResult = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultResultInput() { + return this._defaultResult; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_message - computed: false, optional: true, required: false + private _notificationMessage?: string; + public get notificationMessage() { + return this.getStringAttribute('notification_message'); + } + public set notificationMessage(value: string) { + this._notificationMessage = value; + } + public resetNotificationMessage() { + this._notificationMessage = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationMessageInput() { + return this._notificationMessage; + } + + // notification_topic_name - computed: true, optional: false, required: false + public get notificationTopicName() { + return this.getStringAttribute('notification_topic_name'); + } + + // notification_topic_urn - computed: false, optional: false, required: true + private _notificationTopicUrn?: string; + public get notificationTopicUrn() { + return this.getStringAttribute('notification_topic_urn'); + } + public set notificationTopicUrn(value: string) { + this._notificationTopicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTopicUrnInput() { + return this._notificationTopicUrn; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + default_result: cdktf.stringToTerraform(this._defaultResult), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_message: cdktf.stringToTerraform(this._notificationMessage), + notification_topic_urn: cdktf.stringToTerraform(this._notificationTopicUrn), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + timeout: cdktf.numberToTerraform(this._timeout), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + default_result: { + value: cdktf.stringToHclTerraform(this._defaultResult), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_message: { + value: cdktf.stringToHclTerraform(this._notificationMessage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_topic_urn: { + value: cdktf.stringToHclTerraform(this._notificationTopicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-notification/README.md b/src/constructs/providers/huaweicloud/as-notification/README.md new file mode 100644 index 00000000..b9553415 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-notification/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_notification` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_notification`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification). diff --git a/src/constructs/providers/huaweicloud/as-notification/index.ts b/src/constructs/providers/huaweicloud/as-notification/index.ts new file mode 100644 index 00000000..7eb1adb7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-notification/index.ts @@ -0,0 +1,230 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsNotificationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the topic scene of AS group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification#events AsNotification#events} + */ + readonly events: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification#id AsNotification#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification#region AsNotification#region} + */ + readonly region?: string; + /** + * Specifies the AS group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification#scaling_group_id AsNotification#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Specifies the unique topic URN of the SMN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification#topic_urn AsNotification#topic_urn} + */ + readonly topicUrn: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification huaweicloud_as_notification} +*/ +export class AsNotification extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_notification"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsNotification resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsNotification to import + * @param importFromId The id of the existing AsNotification that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsNotification to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_notification", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_notification huaweicloud_as_notification} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsNotificationConfig + */ + public constructor(scope: Construct, id: string, config: AsNotificationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_notification', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._events = config.events; + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._topicUrn = config.topicUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // events - computed: false, optional: false, required: true + private _events?: string[]; + public get events() { + return this.getListAttribute('events'); + } + public set events(value: string[]) { + this._events = value; + } + // Temporarily expose input value. Use with caution. + public get eventsInput() { + return this._events; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // topic_name - computed: true, optional: false, required: false + public get topicName() { + return this.getStringAttribute('topic_name'); + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + events: cdktf.listMapper(cdktf.stringToTerraform, false)(this._events), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + events: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._events), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-planned-task/README.md b/src/constructs/providers/huaweicloud/as-planned-task/README.md new file mode 100644 index 00000000..c77023c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-planned-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_planned_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_planned_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task). diff --git a/src/constructs/providers/huaweicloud/as-planned-task/index.ts b/src/constructs/providers/huaweicloud/as-planned-task/index.ts new file mode 100644 index 00000000..8bfec8ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-planned-task/index.ts @@ -0,0 +1,638 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsPlannedTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#id AsPlannedTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the planned task to create. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#name AsPlannedTask#name} + */ + readonly name: string; + /** + * The region where the planned task resource are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#region AsPlannedTask#region} + */ + readonly region?: string; + /** + * The ID of the scaling group where the planned task to create. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#scaling_group_id AsPlannedTask#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * instance_number block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#instance_number AsPlannedTask#instance_number} + */ + readonly instanceNumber: AsPlannedTaskInstanceNumber; + /** + * scheduled_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#scheduled_policy AsPlannedTask#scheduled_policy} + */ + readonly scheduledPolicy: AsPlannedTaskScheduledPolicy; +} +export interface AsPlannedTaskInstanceNumber { + /** + * The expected number of instances for the scaling group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#desire AsPlannedTask#desire} + */ + readonly desire?: string; + /** + * The maximum number of instances for the scaling group + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#max AsPlannedTask#max} + */ + readonly max?: string; + /** + * The minimum number of instances for the scaling group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#min AsPlannedTask#min} + */ + readonly min?: string; +} + +export function asPlannedTaskInstanceNumberToTerraform(struct?: AsPlannedTaskInstanceNumberOutputReference | AsPlannedTaskInstanceNumber): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + desire: cdktf.stringToTerraform(struct!.desire), + max: cdktf.stringToTerraform(struct!.max), + min: cdktf.stringToTerraform(struct!.min), + } +} + + +export function asPlannedTaskInstanceNumberToHclTerraform(struct?: AsPlannedTaskInstanceNumberOutputReference | AsPlannedTaskInstanceNumber): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + desire: { + value: cdktf.stringToHclTerraform(struct!.desire), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max: { + value: cdktf.stringToHclTerraform(struct!.max), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + min: { + value: cdktf.stringToHclTerraform(struct!.min), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsPlannedTaskInstanceNumberOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsPlannedTaskInstanceNumber | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._desire !== undefined) { + hasAnyValues = true; + internalValueResult.desire = this._desire; + } + if (this._max !== undefined) { + hasAnyValues = true; + internalValueResult.max = this._max; + } + if (this._min !== undefined) { + hasAnyValues = true; + internalValueResult.min = this._min; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsPlannedTaskInstanceNumber | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._desire = undefined; + this._max = undefined; + this._min = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._desire = value.desire; + this._max = value.max; + this._min = value.min; + } + } + + // desire - computed: false, optional: true, required: false + private _desire?: string; + public get desire() { + return this.getStringAttribute('desire'); + } + public set desire(value: string) { + this._desire = value; + } + public resetDesire() { + this._desire = undefined; + } + // Temporarily expose input value. Use with caution. + public get desireInput() { + return this._desire; + } + + // max - computed: false, optional: true, required: false + private _max?: string; + public get max() { + return this.getStringAttribute('max'); + } + public set max(value: string) { + this._max = value; + } + public resetMax() { + this._max = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInput() { + return this._max; + } + + // min - computed: false, optional: true, required: false + private _min?: string; + public get min() { + return this.getStringAttribute('min'); + } + public set min(value: string) { + this._min = value; + } + public resetMin() { + this._min = undefined; + } + // Temporarily expose input value. Use with caution. + public get minInput() { + return this._min; + } +} +export interface AsPlannedTaskScheduledPolicy { + /** + * The effective end time of planned task + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#end_time AsPlannedTask#end_time} + */ + readonly endTime?: string; + /** + * The execution time of planned task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#launch_time AsPlannedTask#launch_time} + */ + readonly launchTime: string; + /** + * The triggering type of planned task + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#recurrence_type AsPlannedTask#recurrence_type} + */ + readonly recurrenceType?: string; + /** + * The frequency at which planned task are triggered + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#recurrence_value AsPlannedTask#recurrence_value} + */ + readonly recurrenceValue?: string; + /** + * The effective start time of planned task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#start_time AsPlannedTask#start_time} + */ + readonly startTime?: string; +} + +export function asPlannedTaskScheduledPolicyToTerraform(struct?: AsPlannedTaskScheduledPolicyOutputReference | AsPlannedTaskScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + launch_time: cdktf.stringToTerraform(struct!.launchTime), + recurrence_type: cdktf.stringToTerraform(struct!.recurrenceType), + recurrence_value: cdktf.stringToTerraform(struct!.recurrenceValue), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function asPlannedTaskScheduledPolicyToHclTerraform(struct?: AsPlannedTaskScheduledPolicyOutputReference | AsPlannedTaskScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + launch_time: { + value: cdktf.stringToHclTerraform(struct!.launchTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_type: { + value: cdktf.stringToHclTerraform(struct!.recurrenceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_value: { + value: cdktf.stringToHclTerraform(struct!.recurrenceValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsPlannedTaskScheduledPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsPlannedTaskScheduledPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._launchTime !== undefined) { + hasAnyValues = true; + internalValueResult.launchTime = this._launchTime; + } + if (this._recurrenceType !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceType = this._recurrenceType; + } + if (this._recurrenceValue !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceValue = this._recurrenceValue; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsPlannedTaskScheduledPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endTime = undefined; + this._launchTime = undefined; + this._recurrenceType = undefined; + this._recurrenceValue = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endTime = value.endTime; + this._launchTime = value.launchTime; + this._recurrenceType = value.recurrenceType; + this._recurrenceValue = value.recurrenceValue; + this._startTime = value.startTime; + } + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // launch_time - computed: false, optional: false, required: true + private _launchTime?: string; + public get launchTime() { + return this.getStringAttribute('launch_time'); + } + public set launchTime(value: string) { + this._launchTime = value; + } + // Temporarily expose input value. Use with caution. + public get launchTimeInput() { + return this._launchTime; + } + + // recurrence_type - computed: false, optional: true, required: false + private _recurrenceType?: string; + public get recurrenceType() { + return this.getStringAttribute('recurrence_type'); + } + public set recurrenceType(value: string) { + this._recurrenceType = value; + } + public resetRecurrenceType() { + this._recurrenceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceTypeInput() { + return this._recurrenceType; + } + + // recurrence_value - computed: false, optional: true, required: false + private _recurrenceValue?: string; + public get recurrenceValue() { + return this.getStringAttribute('recurrence_value'); + } + public set recurrenceValue(value: string) { + this._recurrenceValue = value; + } + public resetRecurrenceValue() { + this._recurrenceValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceValueInput() { + return this._recurrenceValue; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task huaweicloud_as_planned_task} +*/ +export class AsPlannedTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_planned_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsPlannedTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsPlannedTask to import + * @param importFromId The id of the existing AsPlannedTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsPlannedTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_planned_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_planned_task huaweicloud_as_planned_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsPlannedTaskConfig + */ + public constructor(scope: Construct, id: string, config: AsPlannedTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_planned_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._instanceNumber.internalValue = config.instanceNumber; + this._scheduledPolicy.internalValue = config.scheduledPolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber = new AsPlannedTaskInstanceNumberOutputReference(this, "instance_number"); + public get instanceNumber() { + return this._instanceNumber; + } + public putInstanceNumber(value: AsPlannedTaskInstanceNumber) { + this._instanceNumber.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber.internalValue; + } + + // scheduled_policy - computed: false, optional: false, required: true + private _scheduledPolicy = new AsPlannedTaskScheduledPolicyOutputReference(this, "scheduled_policy"); + public get scheduledPolicy() { + return this._scheduledPolicy; + } + public putScheduledPolicy(value: AsPlannedTaskScheduledPolicy) { + this._scheduledPolicy.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get scheduledPolicyInput() { + return this._scheduledPolicy.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + instance_number: asPlannedTaskInstanceNumberToTerraform(this._instanceNumber.internalValue), + scheduled_policy: asPlannedTaskScheduledPolicyToTerraform(this._scheduledPolicy.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: asPlannedTaskInstanceNumberToHclTerraform(this._instanceNumber.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsPlannedTaskInstanceNumberList", + }, + scheduled_policy: { + value: asPlannedTaskScheduledPolicyToHclTerraform(this._scheduledPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsPlannedTaskScheduledPolicyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-policy-v1/README.md b/src/constructs/providers/huaweicloud/as-policy-v1/README.md new file mode 100644 index 00000000..858e7a22 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-policy-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_policy_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_policy_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1). diff --git a/src/constructs/providers/huaweicloud/as-policy-v1/index.ts b/src/constructs/providers/huaweicloud/as-policy-v1/index.ts new file mode 100644 index 00000000..0e9e0ad9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-policy-v1/index.ts @@ -0,0 +1,731 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsPolicyV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#action AsPolicyV1#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#alarm_id AsPolicyV1#alarm_id} + */ + readonly alarmId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#cool_down_time AsPolicyV1#cool_down_time} + */ + readonly coolDownTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#id AsPolicyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#region AsPolicyV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#scaling_group_id AsPolicyV1#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#scaling_policy_name AsPolicyV1#scaling_policy_name} + */ + readonly scalingPolicyName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#scaling_policy_type AsPolicyV1#scaling_policy_type} + */ + readonly scalingPolicyType: string; + /** + * scaling_policy_action block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#scaling_policy_action AsPolicyV1#scaling_policy_action} + */ + readonly scalingPolicyAction?: AsPolicyV1ScalingPolicyAction; + /** + * scheduled_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#scheduled_policy AsPolicyV1#scheduled_policy} + */ + readonly scheduledPolicy?: AsPolicyV1ScheduledPolicy; +} +export interface AsPolicyV1ScalingPolicyAction { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#instance_number AsPolicyV1#instance_number} + */ + readonly instanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#instance_percentage AsPolicyV1#instance_percentage} + */ + readonly instancePercentage?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#operation AsPolicyV1#operation} + */ + readonly operation?: string; +} + +export function asPolicyV1ScalingPolicyActionToTerraform(struct?: AsPolicyV1ScalingPolicyActionOutputReference | AsPolicyV1ScalingPolicyAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + instance_percentage: cdktf.numberToTerraform(struct!.instancePercentage), + operation: cdktf.stringToTerraform(struct!.operation), + } +} + + +export function asPolicyV1ScalingPolicyActionToHclTerraform(struct?: AsPolicyV1ScalingPolicyActionOutputReference | AsPolicyV1ScalingPolicyAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + instance_percentage: { + value: cdktf.numberToHclTerraform(struct!.instancePercentage), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + operation: { + value: cdktf.stringToHclTerraform(struct!.operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsPolicyV1ScalingPolicyActionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsPolicyV1ScalingPolicyAction | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._instancePercentage !== undefined) { + hasAnyValues = true; + internalValueResult.instancePercentage = this._instancePercentage; + } + if (this._operation !== undefined) { + hasAnyValues = true; + internalValueResult.operation = this._operation; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsPolicyV1ScalingPolicyAction | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._instanceNumber = undefined; + this._instancePercentage = undefined; + this._operation = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._instanceNumber = value.instanceNumber; + this._instancePercentage = value.instancePercentage; + this._operation = value.operation; + } + } + + // instance_number - computed: true, optional: true, required: false + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + public resetInstanceNumber() { + this._instanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // instance_percentage - computed: false, optional: true, required: false + private _instancePercentage?: number; + public get instancePercentage() { + return this.getNumberAttribute('instance_percentage'); + } + public set instancePercentage(value: number) { + this._instancePercentage = value; + } + public resetInstancePercentage() { + this._instancePercentage = undefined; + } + // Temporarily expose input value. Use with caution. + public get instancePercentageInput() { + return this._instancePercentage; + } + + // operation - computed: true, optional: true, required: false + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + public resetOperation() { + this._operation = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } +} +export interface AsPolicyV1ScheduledPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#end_time AsPolicyV1#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#launch_time AsPolicyV1#launch_time} + */ + readonly launchTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#recurrence_type AsPolicyV1#recurrence_type} + */ + readonly recurrenceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#recurrence_value AsPolicyV1#recurrence_value} + */ + readonly recurrenceValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#start_time AsPolicyV1#start_time} + */ + readonly startTime?: string; +} + +export function asPolicyV1ScheduledPolicyToTerraform(struct?: AsPolicyV1ScheduledPolicyOutputReference | AsPolicyV1ScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + launch_time: cdktf.stringToTerraform(struct!.launchTime), + recurrence_type: cdktf.stringToTerraform(struct!.recurrenceType), + recurrence_value: cdktf.stringToTerraform(struct!.recurrenceValue), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function asPolicyV1ScheduledPolicyToHclTerraform(struct?: AsPolicyV1ScheduledPolicyOutputReference | AsPolicyV1ScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + launch_time: { + value: cdktf.stringToHclTerraform(struct!.launchTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_type: { + value: cdktf.stringToHclTerraform(struct!.recurrenceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_value: { + value: cdktf.stringToHclTerraform(struct!.recurrenceValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsPolicyV1ScheduledPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsPolicyV1ScheduledPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._launchTime !== undefined) { + hasAnyValues = true; + internalValueResult.launchTime = this._launchTime; + } + if (this._recurrenceType !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceType = this._recurrenceType; + } + if (this._recurrenceValue !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceValue = this._recurrenceValue; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsPolicyV1ScheduledPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endTime = undefined; + this._launchTime = undefined; + this._recurrenceType = undefined; + this._recurrenceValue = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endTime = value.endTime; + this._launchTime = value.launchTime; + this._recurrenceType = value.recurrenceType; + this._recurrenceValue = value.recurrenceValue; + this._startTime = value.startTime; + } + } + + // end_time - computed: true, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // launch_time - computed: false, optional: false, required: true + private _launchTime?: string; + public get launchTime() { + return this.getStringAttribute('launch_time'); + } + public set launchTime(value: string) { + this._launchTime = value; + } + // Temporarily expose input value. Use with caution. + public get launchTimeInput() { + return this._launchTime; + } + + // recurrence_type - computed: true, optional: true, required: false + private _recurrenceType?: string; + public get recurrenceType() { + return this.getStringAttribute('recurrence_type'); + } + public set recurrenceType(value: string) { + this._recurrenceType = value; + } + public resetRecurrenceType() { + this._recurrenceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceTypeInput() { + return this._recurrenceType; + } + + // recurrence_value - computed: true, optional: true, required: false + private _recurrenceValue?: string; + public get recurrenceValue() { + return this.getStringAttribute('recurrence_value'); + } + public set recurrenceValue(value: string) { + this._recurrenceValue = value; + } + public resetRecurrenceValue() { + this._recurrenceValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceValueInput() { + return this._recurrenceValue; + } + + // start_time - computed: true, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1 huaweicloud_as_policy_v1} +*/ +export class AsPolicyV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_policy_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsPolicyV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsPolicyV1 to import + * @param importFromId The id of the existing AsPolicyV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsPolicyV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_policy_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy_v1 huaweicloud_as_policy_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsPolicyV1Config + */ + public constructor(scope: Construct, id: string, config: AsPolicyV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_policy_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._alarmId = config.alarmId; + this._coolDownTime = config.coolDownTime; + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._scalingPolicyName = config.scalingPolicyName; + this._scalingPolicyType = config.scalingPolicyType; + this._scalingPolicyAction.internalValue = config.scalingPolicyAction; + this._scheduledPolicy.internalValue = config.scheduledPolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // alarm_id - computed: false, optional: true, required: false + private _alarmId?: string; + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + public set alarmId(value: string) { + this._alarmId = value; + } + public resetAlarmId() { + this._alarmId = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmIdInput() { + return this._alarmId; + } + + // cool_down_time - computed: true, optional: true, required: false + private _coolDownTime?: number; + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + public set coolDownTime(value: number) { + this._coolDownTime = value; + } + public resetCoolDownTime() { + this._coolDownTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get coolDownTimeInput() { + return this._coolDownTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // scaling_policy_name - computed: false, optional: false, required: true + private _scalingPolicyName?: string; + public get scalingPolicyName() { + return this.getStringAttribute('scaling_policy_name'); + } + public set scalingPolicyName(value: string) { + this._scalingPolicyName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyNameInput() { + return this._scalingPolicyName; + } + + // scaling_policy_type - computed: false, optional: false, required: true + private _scalingPolicyType?: string; + public get scalingPolicyType() { + return this.getStringAttribute('scaling_policy_type'); + } + public set scalingPolicyType(value: string) { + this._scalingPolicyType = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyTypeInput() { + return this._scalingPolicyType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // scaling_policy_action - computed: false, optional: true, required: false + private _scalingPolicyAction = new AsPolicyV1ScalingPolicyActionOutputReference(this, "scaling_policy_action"); + public get scalingPolicyAction() { + return this._scalingPolicyAction; + } + public putScalingPolicyAction(value: AsPolicyV1ScalingPolicyAction) { + this._scalingPolicyAction.internalValue = value; + } + public resetScalingPolicyAction() { + this._scalingPolicyAction.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyActionInput() { + return this._scalingPolicyAction.internalValue; + } + + // scheduled_policy - computed: false, optional: true, required: false + private _scheduledPolicy = new AsPolicyV1ScheduledPolicyOutputReference(this, "scheduled_policy"); + public get scheduledPolicy() { + return this._scheduledPolicy; + } + public putScheduledPolicy(value: AsPolicyV1ScheduledPolicy) { + this._scheduledPolicy.internalValue = value; + } + public resetScheduledPolicy() { + this._scheduledPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduledPolicyInput() { + return this._scheduledPolicy.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + alarm_id: cdktf.stringToTerraform(this._alarmId), + cool_down_time: cdktf.numberToTerraform(this._coolDownTime), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + scaling_policy_name: cdktf.stringToTerraform(this._scalingPolicyName), + scaling_policy_type: cdktf.stringToTerraform(this._scalingPolicyType), + scaling_policy_action: asPolicyV1ScalingPolicyActionToTerraform(this._scalingPolicyAction.internalValue), + scheduled_policy: asPolicyV1ScheduledPolicyToTerraform(this._scheduledPolicy.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_id: { + value: cdktf.stringToHclTerraform(this._alarmId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cool_down_time: { + value: cdktf.numberToHclTerraform(this._coolDownTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_name: { + value: cdktf.stringToHclTerraform(this._scalingPolicyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_type: { + value: cdktf.stringToHclTerraform(this._scalingPolicyType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_action: { + value: asPolicyV1ScalingPolicyActionToHclTerraform(this._scalingPolicyAction.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsPolicyV1ScalingPolicyActionList", + }, + scheduled_policy: { + value: asPolicyV1ScheduledPolicyToHclTerraform(this._scheduledPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsPolicyV1ScheduledPolicyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/as-policy/README.md b/src/constructs/providers/huaweicloud/as-policy/README.md new file mode 100644 index 00000000..aaf7a648 --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_as_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_as_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy). diff --git a/src/constructs/providers/huaweicloud/as-policy/index.ts b/src/constructs/providers/huaweicloud/as-policy/index.ts new file mode 100644 index 00000000..be93474e --- /dev/null +++ b/src/constructs/providers/huaweicloud/as-policy/index.ts @@ -0,0 +1,731 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#action AsPolicy#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#alarm_id AsPolicy#alarm_id} + */ + readonly alarmId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#cool_down_time AsPolicy#cool_down_time} + */ + readonly coolDownTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#id AsPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#region AsPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#scaling_group_id AsPolicy#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#scaling_policy_name AsPolicy#scaling_policy_name} + */ + readonly scalingPolicyName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#scaling_policy_type AsPolicy#scaling_policy_type} + */ + readonly scalingPolicyType: string; + /** + * scaling_policy_action block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#scaling_policy_action AsPolicy#scaling_policy_action} + */ + readonly scalingPolicyAction?: AsPolicyScalingPolicyAction; + /** + * scheduled_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#scheduled_policy AsPolicy#scheduled_policy} + */ + readonly scheduledPolicy?: AsPolicyScheduledPolicy; +} +export interface AsPolicyScalingPolicyAction { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#instance_number AsPolicy#instance_number} + */ + readonly instanceNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#instance_percentage AsPolicy#instance_percentage} + */ + readonly instancePercentage?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#operation AsPolicy#operation} + */ + readonly operation?: string; +} + +export function asPolicyScalingPolicyActionToTerraform(struct?: AsPolicyScalingPolicyActionOutputReference | AsPolicyScalingPolicyAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + instance_percentage: cdktf.numberToTerraform(struct!.instancePercentage), + operation: cdktf.stringToTerraform(struct!.operation), + } +} + + +export function asPolicyScalingPolicyActionToHclTerraform(struct?: AsPolicyScalingPolicyActionOutputReference | AsPolicyScalingPolicyAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + instance_percentage: { + value: cdktf.numberToHclTerraform(struct!.instancePercentage), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + operation: { + value: cdktf.stringToHclTerraform(struct!.operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsPolicyScalingPolicyActionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsPolicyScalingPolicyAction | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._instancePercentage !== undefined) { + hasAnyValues = true; + internalValueResult.instancePercentage = this._instancePercentage; + } + if (this._operation !== undefined) { + hasAnyValues = true; + internalValueResult.operation = this._operation; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsPolicyScalingPolicyAction | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._instanceNumber = undefined; + this._instancePercentage = undefined; + this._operation = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._instanceNumber = value.instanceNumber; + this._instancePercentage = value.instancePercentage; + this._operation = value.operation; + } + } + + // instance_number - computed: true, optional: true, required: false + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + public resetInstanceNumber() { + this._instanceNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // instance_percentage - computed: false, optional: true, required: false + private _instancePercentage?: number; + public get instancePercentage() { + return this.getNumberAttribute('instance_percentage'); + } + public set instancePercentage(value: number) { + this._instancePercentage = value; + } + public resetInstancePercentage() { + this._instancePercentage = undefined; + } + // Temporarily expose input value. Use with caution. + public get instancePercentageInput() { + return this._instancePercentage; + } + + // operation - computed: true, optional: true, required: false + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + public resetOperation() { + this._operation = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } +} +export interface AsPolicyScheduledPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#end_time AsPolicy#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#launch_time AsPolicy#launch_time} + */ + readonly launchTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#recurrence_type AsPolicy#recurrence_type} + */ + readonly recurrenceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#recurrence_value AsPolicy#recurrence_value} + */ + readonly recurrenceValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#start_time AsPolicy#start_time} + */ + readonly startTime?: string; +} + +export function asPolicyScheduledPolicyToTerraform(struct?: AsPolicyScheduledPolicyOutputReference | AsPolicyScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + launch_time: cdktf.stringToTerraform(struct!.launchTime), + recurrence_type: cdktf.stringToTerraform(struct!.recurrenceType), + recurrence_value: cdktf.stringToTerraform(struct!.recurrenceValue), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function asPolicyScheduledPolicyToHclTerraform(struct?: AsPolicyScheduledPolicyOutputReference | AsPolicyScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + launch_time: { + value: cdktf.stringToHclTerraform(struct!.launchTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_type: { + value: cdktf.stringToHclTerraform(struct!.recurrenceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recurrence_value: { + value: cdktf.stringToHclTerraform(struct!.recurrenceValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsPolicyScheduledPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsPolicyScheduledPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._launchTime !== undefined) { + hasAnyValues = true; + internalValueResult.launchTime = this._launchTime; + } + if (this._recurrenceType !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceType = this._recurrenceType; + } + if (this._recurrenceValue !== undefined) { + hasAnyValues = true; + internalValueResult.recurrenceValue = this._recurrenceValue; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsPolicyScheduledPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endTime = undefined; + this._launchTime = undefined; + this._recurrenceType = undefined; + this._recurrenceValue = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endTime = value.endTime; + this._launchTime = value.launchTime; + this._recurrenceType = value.recurrenceType; + this._recurrenceValue = value.recurrenceValue; + this._startTime = value.startTime; + } + } + + // end_time - computed: true, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // launch_time - computed: false, optional: false, required: true + private _launchTime?: string; + public get launchTime() { + return this.getStringAttribute('launch_time'); + } + public set launchTime(value: string) { + this._launchTime = value; + } + // Temporarily expose input value. Use with caution. + public get launchTimeInput() { + return this._launchTime; + } + + // recurrence_type - computed: true, optional: true, required: false + private _recurrenceType?: string; + public get recurrenceType() { + return this.getStringAttribute('recurrence_type'); + } + public set recurrenceType(value: string) { + this._recurrenceType = value; + } + public resetRecurrenceType() { + this._recurrenceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceTypeInput() { + return this._recurrenceType; + } + + // recurrence_value - computed: true, optional: true, required: false + private _recurrenceValue?: string; + public get recurrenceValue() { + return this.getStringAttribute('recurrence_value'); + } + public set recurrenceValue(value: string) { + this._recurrenceValue = value; + } + public resetRecurrenceValue() { + this._recurrenceValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get recurrenceValueInput() { + return this._recurrenceValue; + } + + // start_time - computed: true, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy huaweicloud_as_policy} +*/ +export class AsPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsPolicy to import + * @param importFromId The id of the existing AsPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/as_policy huaweicloud_as_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsPolicyConfig + */ + public constructor(scope: Construct, id: string, config: AsPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._alarmId = config.alarmId; + this._coolDownTime = config.coolDownTime; + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._scalingPolicyName = config.scalingPolicyName; + this._scalingPolicyType = config.scalingPolicyType; + this._scalingPolicyAction.internalValue = config.scalingPolicyAction; + this._scheduledPolicy.internalValue = config.scheduledPolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // alarm_id - computed: false, optional: true, required: false + private _alarmId?: string; + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + public set alarmId(value: string) { + this._alarmId = value; + } + public resetAlarmId() { + this._alarmId = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmIdInput() { + return this._alarmId; + } + + // cool_down_time - computed: true, optional: true, required: false + private _coolDownTime?: number; + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + public set coolDownTime(value: number) { + this._coolDownTime = value; + } + public resetCoolDownTime() { + this._coolDownTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get coolDownTimeInput() { + return this._coolDownTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // scaling_policy_name - computed: false, optional: false, required: true + private _scalingPolicyName?: string; + public get scalingPolicyName() { + return this.getStringAttribute('scaling_policy_name'); + } + public set scalingPolicyName(value: string) { + this._scalingPolicyName = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyNameInput() { + return this._scalingPolicyName; + } + + // scaling_policy_type - computed: false, optional: false, required: true + private _scalingPolicyType?: string; + public get scalingPolicyType() { + return this.getStringAttribute('scaling_policy_type'); + } + public set scalingPolicyType(value: string) { + this._scalingPolicyType = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyTypeInput() { + return this._scalingPolicyType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // scaling_policy_action - computed: false, optional: true, required: false + private _scalingPolicyAction = new AsPolicyScalingPolicyActionOutputReference(this, "scaling_policy_action"); + public get scalingPolicyAction() { + return this._scalingPolicyAction; + } + public putScalingPolicyAction(value: AsPolicyScalingPolicyAction) { + this._scalingPolicyAction.internalValue = value; + } + public resetScalingPolicyAction() { + this._scalingPolicyAction.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyActionInput() { + return this._scalingPolicyAction.internalValue; + } + + // scheduled_policy - computed: false, optional: true, required: false + private _scheduledPolicy = new AsPolicyScheduledPolicyOutputReference(this, "scheduled_policy"); + public get scheduledPolicy() { + return this._scheduledPolicy; + } + public putScheduledPolicy(value: AsPolicyScheduledPolicy) { + this._scheduledPolicy.internalValue = value; + } + public resetScheduledPolicy() { + this._scheduledPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduledPolicyInput() { + return this._scheduledPolicy.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + alarm_id: cdktf.stringToTerraform(this._alarmId), + cool_down_time: cdktf.numberToTerraform(this._coolDownTime), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + scaling_policy_name: cdktf.stringToTerraform(this._scalingPolicyName), + scaling_policy_type: cdktf.stringToTerraform(this._scalingPolicyType), + scaling_policy_action: asPolicyScalingPolicyActionToTerraform(this._scalingPolicyAction.internalValue), + scheduled_policy: asPolicyScheduledPolicyToTerraform(this._scheduledPolicy.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_id: { + value: cdktf.stringToHclTerraform(this._alarmId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cool_down_time: { + value: cdktf.numberToHclTerraform(this._coolDownTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_name: { + value: cdktf.stringToHclTerraform(this._scalingPolicyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_type: { + value: cdktf.stringToHclTerraform(this._scalingPolicyType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_action: { + value: asPolicyScalingPolicyActionToHclTerraform(this._scalingPolicyAction.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsPolicyScalingPolicyActionList", + }, + scheduled_policy: { + value: asPolicyScheduledPolicyToHclTerraform(this._scheduledPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsPolicyScheduledPolicyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/asm-mesh/README.md b/src/constructs/providers/huaweicloud/asm-mesh/README.md new file mode 100644 index 00000000..3787d661 --- /dev/null +++ b/src/constructs/providers/huaweicloud/asm-mesh/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_asm_mesh` + +Refer to the Terraform Registry for docs: [`huaweicloud_asm_mesh`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh). diff --git a/src/constructs/providers/huaweicloud/asm-mesh/index.ts b/src/constructs/providers/huaweicloud/asm-mesh/index.ts new file mode 100644 index 00000000..004b7f44 --- /dev/null +++ b/src/constructs/providers/huaweicloud/asm-mesh/index.ts @@ -0,0 +1,1428 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface AsmMeshConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the mesh annotations in key/value format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#annotations AsmMesh#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#enable_force_new AsmMesh#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#id AsmMesh#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the mesh labels in key/value format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#labels AsmMesh#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Specifies mesh name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#name AsmMesh#name} + */ + readonly name: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#region AsmMesh#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#tags AsmMesh#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the mesh type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#type AsmMesh#type} + */ + readonly type: string; + /** + * Specifies the mesh version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#version AsmMesh#version} + */ + readonly version: string; + /** + * extend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#extend_params AsmMesh#extend_params} + */ + readonly extendParams: AsmMeshExtendParams; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#timeouts AsmMesh#timeouts} + */ + readonly timeouts?: AsmMeshTimeouts; +} +export interface AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector { + /** + * Specifies the key of the selector. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#key AsmMesh#key} + */ + readonly key: string; + /** + * Specifies the operator of the selector. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#operator AsmMesh#operator} + */ + readonly operator: string; + /** + * Specifies the value of the selector. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#values AsmMesh#values} + */ + readonly values: string[]; +} + +export function asmMeshExtendParamsClustersInjectionNamespacesFieldSelectorToTerraform(struct?: AsmMeshExtendParamsClustersInjectionNamespacesFieldSelectorOutputReference | AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + operator: cdktf.stringToTerraform(struct!.operator), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function asmMeshExtendParamsClustersInjectionNamespacesFieldSelectorToHclTerraform(struct?: AsmMeshExtendParamsClustersInjectionNamespacesFieldSelectorOutputReference | AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersInjectionNamespacesFieldSelectorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._key = undefined; + this._operator = undefined; + this._values = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._key = value.key; + this._operator = value.operator; + this._values = value.values; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // operator - computed: false, optional: false, required: true + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} +export interface AsmMeshExtendParamsClustersInjectionNamespaces { + /** + * field_selector block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#field_selector AsmMesh#field_selector} + */ + readonly fieldSelector: AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector; +} + +export function asmMeshExtendParamsClustersInjectionNamespacesToTerraform(struct?: AsmMeshExtendParamsClustersInjectionNamespacesOutputReference | AsmMeshExtendParamsClustersInjectionNamespaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_selector: asmMeshExtendParamsClustersInjectionNamespacesFieldSelectorToTerraform(struct!.fieldSelector), + } +} + + +export function asmMeshExtendParamsClustersInjectionNamespacesToHclTerraform(struct?: AsmMeshExtendParamsClustersInjectionNamespacesOutputReference | AsmMeshExtendParamsClustersInjectionNamespaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_selector: { + value: asmMeshExtendParamsClustersInjectionNamespacesFieldSelectorToHclTerraform(struct!.fieldSelector), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersInjectionNamespacesFieldSelectorList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersInjectionNamespacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParamsClustersInjectionNamespaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldSelector?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.fieldSelector = this._fieldSelector?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClustersInjectionNamespaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._fieldSelector.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._fieldSelector.internalValue = value.fieldSelector; + } + } + + // field_selector - computed: false, optional: false, required: true + private _fieldSelector = new AsmMeshExtendParamsClustersInjectionNamespacesFieldSelectorOutputReference(this, "field_selector"); + public get fieldSelector() { + return this._fieldSelector; + } + public putFieldSelector(value: AsmMeshExtendParamsClustersInjectionNamespacesFieldSelector) { + this._fieldSelector.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get fieldSelectorInput() { + return this._fieldSelector.internalValue; + } +} +export interface AsmMeshExtendParamsClustersInjection { + /** + * namespaces block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#namespaces AsmMesh#namespaces} + */ + readonly namespaces: AsmMeshExtendParamsClustersInjectionNamespaces; +} + +export function asmMeshExtendParamsClustersInjectionToTerraform(struct?: AsmMeshExtendParamsClustersInjectionOutputReference | AsmMeshExtendParamsClustersInjection): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + namespaces: asmMeshExtendParamsClustersInjectionNamespacesToTerraform(struct!.namespaces), + } +} + + +export function asmMeshExtendParamsClustersInjectionToHclTerraform(struct?: AsmMeshExtendParamsClustersInjectionOutputReference | AsmMeshExtendParamsClustersInjection): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + namespaces: { + value: asmMeshExtendParamsClustersInjectionNamespacesToHclTerraform(struct!.namespaces), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersInjectionNamespacesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersInjectionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParamsClustersInjection | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._namespaces?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.namespaces = this._namespaces?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClustersInjection | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._namespaces.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._namespaces.internalValue = value.namespaces; + } + } + + // namespaces - computed: false, optional: false, required: true + private _namespaces = new AsmMeshExtendParamsClustersInjectionNamespacesOutputReference(this, "namespaces"); + public get namespaces() { + return this._namespaces; + } + public putNamespaces(value: AsmMeshExtendParamsClustersInjectionNamespaces) { + this._namespaces.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get namespacesInput() { + return this._namespaces.internalValue; + } +} +export interface AsmMeshExtendParamsClustersInstallationNodesFieldSelector { + /** + * Specifies the key of the selector. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#key AsmMesh#key} + */ + readonly key: string; + /** + * Specifies the operator of the selector. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#operator AsmMesh#operator} + */ + readonly operator: string; + /** + * Specifies the value of the selector. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#values AsmMesh#values} + */ + readonly values: string[]; +} + +export function asmMeshExtendParamsClustersInstallationNodesFieldSelectorToTerraform(struct?: AsmMeshExtendParamsClustersInstallationNodesFieldSelectorOutputReference | AsmMeshExtendParamsClustersInstallationNodesFieldSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + operator: cdktf.stringToTerraform(struct!.operator), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function asmMeshExtendParamsClustersInstallationNodesFieldSelectorToHclTerraform(struct?: AsmMeshExtendParamsClustersInstallationNodesFieldSelectorOutputReference | AsmMeshExtendParamsClustersInstallationNodesFieldSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersInstallationNodesFieldSelectorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParamsClustersInstallationNodesFieldSelector | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClustersInstallationNodesFieldSelector | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._key = undefined; + this._operator = undefined; + this._values = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._key = value.key; + this._operator = value.operator; + this._values = value.values; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // operator - computed: false, optional: false, required: true + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} +export interface AsmMeshExtendParamsClustersInstallationNodes { + /** + * field_selector block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#field_selector AsmMesh#field_selector} + */ + readonly fieldSelector: AsmMeshExtendParamsClustersInstallationNodesFieldSelector; +} + +export function asmMeshExtendParamsClustersInstallationNodesToTerraform(struct?: AsmMeshExtendParamsClustersInstallationNodesOutputReference | AsmMeshExtendParamsClustersInstallationNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_selector: asmMeshExtendParamsClustersInstallationNodesFieldSelectorToTerraform(struct!.fieldSelector), + } +} + + +export function asmMeshExtendParamsClustersInstallationNodesToHclTerraform(struct?: AsmMeshExtendParamsClustersInstallationNodesOutputReference | AsmMeshExtendParamsClustersInstallationNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_selector: { + value: asmMeshExtendParamsClustersInstallationNodesFieldSelectorToHclTerraform(struct!.fieldSelector), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersInstallationNodesFieldSelectorList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersInstallationNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParamsClustersInstallationNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldSelector?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.fieldSelector = this._fieldSelector?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClustersInstallationNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._fieldSelector.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._fieldSelector.internalValue = value.fieldSelector; + } + } + + // field_selector - computed: false, optional: false, required: true + private _fieldSelector = new AsmMeshExtendParamsClustersInstallationNodesFieldSelectorOutputReference(this, "field_selector"); + public get fieldSelector() { + return this._fieldSelector; + } + public putFieldSelector(value: AsmMeshExtendParamsClustersInstallationNodesFieldSelector) { + this._fieldSelector.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get fieldSelectorInput() { + return this._fieldSelector.internalValue; + } +} +export interface AsmMeshExtendParamsClustersInstallation { + /** + * nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#nodes AsmMesh#nodes} + */ + readonly nodes: AsmMeshExtendParamsClustersInstallationNodes; +} + +export function asmMeshExtendParamsClustersInstallationToTerraform(struct?: AsmMeshExtendParamsClustersInstallationOutputReference | AsmMeshExtendParamsClustersInstallation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + nodes: asmMeshExtendParamsClustersInstallationNodesToTerraform(struct!.nodes), + } +} + + +export function asmMeshExtendParamsClustersInstallationToHclTerraform(struct?: AsmMeshExtendParamsClustersInstallationOutputReference | AsmMeshExtendParamsClustersInstallation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + nodes: { + value: asmMeshExtendParamsClustersInstallationNodesToHclTerraform(struct!.nodes), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersInstallationNodesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersInstallationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParamsClustersInstallation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._nodes?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.nodes = this._nodes?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClustersInstallation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._nodes.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._nodes.internalValue = value.nodes; + } + } + + // nodes - computed: false, optional: false, required: true + private _nodes = new AsmMeshExtendParamsClustersInstallationNodesOutputReference(this, "nodes"); + public get nodes() { + return this._nodes; + } + public putNodes(value: AsmMeshExtendParamsClustersInstallationNodes) { + this._nodes.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nodesInput() { + return this._nodes.internalValue; + } +} +export interface AsmMeshExtendParamsClusters { + /** + * Specifies the cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#cluster_id AsmMesh#cluster_id} + */ + readonly clusterId: string; + /** + * injection block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#injection AsmMesh#injection} + */ + readonly injection?: AsmMeshExtendParamsClustersInjection; + /** + * installation block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#installation AsmMesh#installation} + */ + readonly installation: AsmMeshExtendParamsClustersInstallation; +} + +export function asmMeshExtendParamsClustersToTerraform(struct?: AsmMeshExtendParamsClusters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cluster_id: cdktf.stringToTerraform(struct!.clusterId), + injection: asmMeshExtendParamsClustersInjectionToTerraform(struct!.injection), + installation: asmMeshExtendParamsClustersInstallationToTerraform(struct!.installation), + } +} + + +export function asmMeshExtendParamsClustersToHclTerraform(struct?: AsmMeshExtendParamsClusters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(struct!.clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + injection: { + value: asmMeshExtendParamsClustersInjectionToHclTerraform(struct!.injection), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersInjectionList", + }, + installation: { + value: asmMeshExtendParamsClustersInstallationToHclTerraform(struct!.installation), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersInstallationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): AsmMeshExtendParamsClusters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusterId !== undefined) { + hasAnyValues = true; + internalValueResult.clusterId = this._clusterId; + } + if (this._injection?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.injection = this._injection?.internalValue; + } + if (this._installation?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.installation = this._installation?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParamsClusters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._clusterId = undefined; + this._injection.internalValue = undefined; + this._installation.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._clusterId = value.clusterId; + this._injection.internalValue = value.injection; + this._installation.internalValue = value.installation; + } + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // injection - computed: false, optional: true, required: false + private _injection = new AsmMeshExtendParamsClustersInjectionOutputReference(this, "injection"); + public get injection() { + return this._injection; + } + public putInjection(value: AsmMeshExtendParamsClustersInjection) { + this._injection.internalValue = value; + } + public resetInjection() { + this._injection.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get injectionInput() { + return this._injection.internalValue; + } + + // installation - computed: false, optional: false, required: true + private _installation = new AsmMeshExtendParamsClustersInstallationOutputReference(this, "installation"); + public get installation() { + return this._installation; + } + public putInstallation(value: AsmMeshExtendParamsClustersInstallation) { + this._installation.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get installationInput() { + return this._installation.internalValue; + } +} + +export class AsmMeshExtendParamsClustersList extends cdktf.ComplexList { + public internalValue? : AsmMeshExtendParamsClusters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): AsmMeshExtendParamsClustersOutputReference { + return new AsmMeshExtendParamsClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface AsmMeshExtendParams { + /** + * clusters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#clusters AsmMesh#clusters} + */ + readonly clusters: AsmMeshExtendParamsClusters[] | cdktf.IResolvable; +} + +export function asmMeshExtendParamsToTerraform(struct?: AsmMeshExtendParamsOutputReference | AsmMeshExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + clusters: cdktf.listMapper(asmMeshExtendParamsClustersToTerraform, true)(struct!.clusters), + } +} + + +export function asmMeshExtendParamsToHclTerraform(struct?: AsmMeshExtendParamsOutputReference | AsmMeshExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + clusters: { + value: cdktf.listMapperHcl(asmMeshExtendParamsClustersToHclTerraform, true)(struct!.clusters), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsClustersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshExtendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): AsmMeshExtendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusters?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.clusters = this._clusters?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshExtendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._clusters.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._clusters.internalValue = value.clusters; + } + } + + // clusters - computed: false, optional: false, required: true + private _clusters = new AsmMeshExtendParamsClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + public putClusters(value: AsmMeshExtendParamsClusters[] | cdktf.IResolvable) { + this._clusters.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get clustersInput() { + return this._clusters.internalValue; + } +} +export interface AsmMeshTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#create AsmMesh#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#delete AsmMesh#delete} + */ + readonly delete?: string; +} + +export function asmMeshTimeoutsToTerraform(struct?: AsmMeshTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function asmMeshTimeoutsToHclTerraform(struct?: AsmMeshTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class AsmMeshTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): AsmMeshTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: AsmMeshTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh huaweicloud_asm_mesh} +*/ +export class AsmMesh extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_asm_mesh"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a AsmMesh resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the AsmMesh to import + * @param importFromId The id of the existing AsmMesh that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the AsmMesh to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_asm_mesh", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/asm_mesh huaweicloud_asm_mesh} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options AsmMeshConfig + */ + public constructor(scope: Construct, id: string, config: AsmMeshConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_asm_mesh', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._annotations = config.annotations; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._labels = config.labels; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + this._version = config.version; + this._extendParams.internalValue = config.extendParams; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // extend_params - computed: false, optional: false, required: true + private _extendParams = new AsmMeshExtendParamsOutputReference(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + public putExtendParams(value: AsmMeshExtendParams) { + this._extendParams.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new AsmMeshTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: AsmMeshTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + extend_params: asmMeshExtendParamsToTerraform(this._extendParams.internalValue), + timeouts: asmMeshTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: asmMeshExtendParamsToHclTerraform(this._extendParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "AsmMeshExtendParamsList", + }, + timeouts: { + value: asmMeshTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "AsmMeshTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/bcs-instance/README.md b/src/constructs/providers/huaweicloud/bcs-instance/README.md new file mode 100644 index 00000000..e9f7ab9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/bcs-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_bcs_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_bcs_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance). diff --git a/src/constructs/providers/huaweicloud/bcs-instance/index.ts b/src/constructs/providers/huaweicloud/bcs-instance/index.ts new file mode 100644 index 00000000..f5ba144d --- /dev/null +++ b/src/constructs/providers/huaweicloud/bcs-instance/index.ts @@ -0,0 +1,1975 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface BcsInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#blockchain_type BcsInstance#blockchain_type} + */ + readonly blockchainType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#cce_cluster_id BcsInstance#cce_cluster_id} + */ + readonly cceClusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#consensus BcsInstance#consensus} + */ + readonly consensus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#database_type BcsInstance#database_type} + */ + readonly databaseType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#delete_obs BcsInstance#delete_obs} + */ + readonly deleteObs?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#delete_storage BcsInstance#delete_storage} + */ + readonly deleteStorage?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#edition BcsInstance#edition} + */ + readonly edition: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#eip_enable BcsInstance#eip_enable} + */ + readonly eipEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#enterprise_project_id BcsInstance#enterprise_project_id} + */ + readonly enterpriseProjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#fabric_version BcsInstance#fabric_version} + */ + readonly fabricVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#id BcsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#name BcsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#orderer_node_num BcsInstance#orderer_node_num} + */ + readonly ordererNodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#org_disk_size BcsInstance#org_disk_size} + */ + readonly orgDiskSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#password BcsInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#region BcsInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#restful_api_support BcsInstance#restful_api_support} + */ + readonly restfulApiSupport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#security_mechanism BcsInstance#security_mechanism} + */ + readonly securityMechanism?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#tc3_need BcsInstance#tc3_need} + */ + readonly tc3Need?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#volume_type BcsInstance#volume_type} + */ + readonly volumeType: string; + /** + * block_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#block_info BcsInstance#block_info} + */ + readonly blockInfo?: BcsInstanceBlockInfo; + /** + * channels block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#channels BcsInstance#channels} + */ + readonly channels?: BcsInstanceChannels[] | cdktf.IResolvable; + /** + * couchdb block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#couchdb BcsInstance#couchdb} + */ + readonly couchdb?: BcsInstanceCouchdb; + /** + * kafka block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#kafka BcsInstance#kafka} + */ + readonly kafka?: BcsInstanceKafka; + /** + * peer_orgs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#peer_orgs BcsInstance#peer_orgs} + */ + readonly peerOrgs?: BcsInstancePeerOrgs[] | cdktf.IResolvable; + /** + * sfs_turbo block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#sfs_turbo BcsInstance#sfs_turbo} + */ + readonly sfsTurbo?: BcsInstanceSfsTurbo; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#timeouts BcsInstance#timeouts} + */ + readonly timeouts?: BcsInstanceTimeouts; +} +export interface BcsInstanceBlockInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#block_size BcsInstance#block_size} + */ + readonly blockSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#generation_interval BcsInstance#generation_interval} + */ + readonly generationInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#transaction_quantity BcsInstance#transaction_quantity} + */ + readonly transactionQuantity?: number; +} + +export function bcsInstanceBlockInfoToTerraform(struct?: BcsInstanceBlockInfoOutputReference | BcsInstanceBlockInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + block_size: cdktf.numberToTerraform(struct!.blockSize), + generation_interval: cdktf.numberToTerraform(struct!.generationInterval), + transaction_quantity: cdktf.numberToTerraform(struct!.transactionQuantity), + } +} + + +export function bcsInstanceBlockInfoToHclTerraform(struct?: BcsInstanceBlockInfoOutputReference | BcsInstanceBlockInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + block_size: { + value: cdktf.numberToHclTerraform(struct!.blockSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + generation_interval: { + value: cdktf.numberToHclTerraform(struct!.generationInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + transaction_quantity: { + value: cdktf.numberToHclTerraform(struct!.transactionQuantity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstanceBlockInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): BcsInstanceBlockInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blockSize !== undefined) { + hasAnyValues = true; + internalValueResult.blockSize = this._blockSize; + } + if (this._generationInterval !== undefined) { + hasAnyValues = true; + internalValueResult.generationInterval = this._generationInterval; + } + if (this._transactionQuantity !== undefined) { + hasAnyValues = true; + internalValueResult.transactionQuantity = this._transactionQuantity; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstanceBlockInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blockSize = undefined; + this._generationInterval = undefined; + this._transactionQuantity = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blockSize = value.blockSize; + this._generationInterval = value.generationInterval; + this._transactionQuantity = value.transactionQuantity; + } + } + + // block_size - computed: false, optional: true, required: false + private _blockSize?: number; + public get blockSize() { + return this.getNumberAttribute('block_size'); + } + public set blockSize(value: number) { + this._blockSize = value; + } + public resetBlockSize() { + this._blockSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get blockSizeInput() { + return this._blockSize; + } + + // generation_interval - computed: false, optional: true, required: false + private _generationInterval?: number; + public get generationInterval() { + return this.getNumberAttribute('generation_interval'); + } + public set generationInterval(value: number) { + this._generationInterval = value; + } + public resetGenerationInterval() { + this._generationInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get generationIntervalInput() { + return this._generationInterval; + } + + // transaction_quantity - computed: false, optional: true, required: false + private _transactionQuantity?: number; + public get transactionQuantity() { + return this.getNumberAttribute('transaction_quantity'); + } + public set transactionQuantity(value: number) { + this._transactionQuantity = value; + } + public resetTransactionQuantity() { + this._transactionQuantity = undefined; + } + // Temporarily expose input value. Use with caution. + public get transactionQuantityInput() { + return this._transactionQuantity; + } +} +export interface BcsInstanceChannels { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#name BcsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#org_names BcsInstance#org_names} + */ + readonly orgNames?: string[]; +} + +export function bcsInstanceChannelsToTerraform(struct?: BcsInstanceChannels | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + org_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.orgNames), + } +} + + +export function bcsInstanceChannelsToHclTerraform(struct?: BcsInstanceChannels | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + org_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.orgNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstanceChannelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): BcsInstanceChannels | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._orgNames !== undefined) { + hasAnyValues = true; + internalValueResult.orgNames = this._orgNames; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstanceChannels | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._orgNames = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._orgNames = value.orgNames; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // org_names - computed: true, optional: true, required: false + private _orgNames?: string[]; + public get orgNames() { + return this.getListAttribute('org_names'); + } + public set orgNames(value: string[]) { + this._orgNames = value; + } + public resetOrgNames() { + this._orgNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get orgNamesInput() { + return this._orgNames; + } +} + +export class BcsInstanceChannelsList extends cdktf.ComplexList { + public internalValue? : BcsInstanceChannels[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): BcsInstanceChannelsOutputReference { + return new BcsInstanceChannelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface BcsInstanceCouchdb { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#password BcsInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#user_name BcsInstance#user_name} + */ + readonly userName: string; +} + +export function bcsInstanceCouchdbToTerraform(struct?: BcsInstanceCouchdbOutputReference | BcsInstanceCouchdb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + password: cdktf.stringToTerraform(struct!.password), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function bcsInstanceCouchdbToHclTerraform(struct?: BcsInstanceCouchdbOutputReference | BcsInstanceCouchdb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstanceCouchdbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): BcsInstanceCouchdb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstanceCouchdb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._password = undefined; + this._userName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._password = value.password; + this._userName = value.userName; + } + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} +export interface BcsInstanceKafka { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#availability_zone BcsInstance#availability_zone} + */ + readonly availabilityZone: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#flavor BcsInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#storage_size BcsInstance#storage_size} + */ + readonly storageSize: number; +} + +export function bcsInstanceKafkaToTerraform(struct?: BcsInstanceKafkaOutputReference | BcsInstanceKafka): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.availabilityZone), + flavor: cdktf.stringToTerraform(struct!.flavor), + storage_size: cdktf.numberToTerraform(struct!.storageSize), + } +} + + +export function bcsInstanceKafkaToHclTerraform(struct?: BcsInstanceKafkaOutputReference | BcsInstanceKafka): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.availabilityZone), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_size: { + value: cdktf.numberToHclTerraform(struct!.storageSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstanceKafkaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): BcsInstanceKafka | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._storageSize !== undefined) { + hasAnyValues = true; + internalValueResult.storageSize = this._storageSize; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstanceKafka | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZone = undefined; + this._flavor = undefined; + this._storageSize = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZone = value.availabilityZone; + this._flavor = value.flavor; + this._storageSize = value.storageSize; + } + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string[]; + public get availabilityZone() { + return this.getListAttribute('availability_zone'); + } + public set availabilityZone(value: string[]) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // storage_size - computed: false, optional: false, required: true + private _storageSize?: number; + public get storageSize() { + return this.getNumberAttribute('storage_size'); + } + public set storageSize(value: number) { + this._storageSize = value; + } + // Temporarily expose input value. Use with caution. + public get storageSizeInput() { + return this._storageSize; + } +} +export interface BcsInstancePeerOrgsAddress { +} + +export function bcsInstancePeerOrgsAddressToTerraform(struct?: BcsInstancePeerOrgsAddress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function bcsInstancePeerOrgsAddressToHclTerraform(struct?: BcsInstancePeerOrgsAddress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class BcsInstancePeerOrgsAddressOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): BcsInstancePeerOrgsAddress | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstancePeerOrgsAddress | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain_port - computed: true, optional: false, required: false + public get domainPort() { + return this.getStringAttribute('domain_port'); + } + + // ip_port - computed: true, optional: false, required: false + public get ipPort() { + return this.getStringAttribute('ip_port'); + } +} + +export class BcsInstancePeerOrgsAddressList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): BcsInstancePeerOrgsAddressOutputReference { + return new BcsInstancePeerOrgsAddressOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface BcsInstancePeerOrgs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#count BcsInstance#count} + */ + readonly count: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#org_name BcsInstance#org_name} + */ + readonly orgName: string; +} + +export function bcsInstancePeerOrgsToTerraform(struct?: BcsInstancePeerOrgs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + org_name: cdktf.stringToTerraform(struct!.orgName), + } +} + + +export function bcsInstancePeerOrgsToHclTerraform(struct?: BcsInstancePeerOrgs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + org_name: { + value: cdktf.stringToHclTerraform(struct!.orgName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstancePeerOrgsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): BcsInstancePeerOrgs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._orgName !== undefined) { + hasAnyValues = true; + internalValueResult.orgName = this._orgName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstancePeerOrgs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._count = undefined; + this._orgName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._count = value.count; + this._orgName = value.orgName; + } + } + + // address - computed: true, optional: false, required: false + private _address = new BcsInstancePeerOrgsAddressList(this, "address", false); + public get address() { + return this._address; + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // org_name - computed: false, optional: false, required: true + private _orgName?: string; + public get orgName() { + return this.getStringAttribute('org_name'); + } + public set orgName(value: string) { + this._orgName = value; + } + // Temporarily expose input value. Use with caution. + public get orgNameInput() { + return this._orgName; + } + + // pvc_name - computed: true, optional: false, required: false + public get pvcName() { + return this.getStringAttribute('pvc_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_detail - computed: true, optional: false, required: false + public get statusDetail() { + return this.getStringAttribute('status_detail'); + } +} + +export class BcsInstancePeerOrgsList extends cdktf.ComplexList { + public internalValue? : BcsInstancePeerOrgs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): BcsInstancePeerOrgsOutputReference { + return new BcsInstancePeerOrgsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface BcsInstanceSfsTurbo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#availability_zone BcsInstance#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#flavor BcsInstance#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#share_type BcsInstance#share_type} + */ + readonly shareType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#type BcsInstance#type} + */ + readonly type?: string; +} + +export function bcsInstanceSfsTurboToTerraform(struct?: BcsInstanceSfsTurboOutputReference | BcsInstanceSfsTurbo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + flavor: cdktf.stringToTerraform(struct!.flavor), + share_type: cdktf.stringToTerraform(struct!.shareType), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function bcsInstanceSfsTurboToHclTerraform(struct?: BcsInstanceSfsTurboOutputReference | BcsInstanceSfsTurbo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstanceSfsTurboOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): BcsInstanceSfsTurbo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstanceSfsTurbo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZone = undefined; + this._flavor = undefined; + this._shareType = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZone = value.availabilityZone; + this._flavor = value.flavor; + this._shareType = value.shareType; + this._type = value.type; + } + } + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // share_type - computed: true, optional: true, required: false + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + public resetShareType() { + this._shareType = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface BcsInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#create BcsInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#delete BcsInstance#delete} + */ + readonly delete?: string; +} + +export function bcsInstanceTimeoutsToTerraform(struct?: BcsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function bcsInstanceTimeoutsToHclTerraform(struct?: BcsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BcsInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): BcsInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BcsInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance huaweicloud_bcs_instance} +*/ +export class BcsInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_bcs_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a BcsInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the BcsInstance to import + * @param importFromId The id of the existing BcsInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the BcsInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_bcs_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bcs_instance huaweicloud_bcs_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options BcsInstanceConfig + */ + public constructor(scope: Construct, id: string, config: BcsInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_bcs_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._blockchainType = config.blockchainType; + this._cceClusterId = config.cceClusterId; + this._consensus = config.consensus; + this._databaseType = config.databaseType; + this._deleteObs = config.deleteObs; + this._deleteStorage = config.deleteStorage; + this._edition = config.edition; + this._eipEnable = config.eipEnable; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fabricVersion = config.fabricVersion; + this._id = config.id; + this._name = config.name; + this._ordererNodeNum = config.ordererNodeNum; + this._orgDiskSize = config.orgDiskSize; + this._password = config.password; + this._region = config.region; + this._restfulApiSupport = config.restfulApiSupport; + this._securityMechanism = config.securityMechanism; + this._tc3Need = config.tc3Need; + this._volumeType = config.volumeType; + this._blockInfo.internalValue = config.blockInfo; + this._channels.internalValue = config.channels; + this._couchdb.internalValue = config.couchdb; + this._kafka.internalValue = config.kafka; + this._peerOrgs.internalValue = config.peerOrgs; + this._sfsTurbo.internalValue = config.sfsTurbo; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_portal_address - computed: true, optional: false, required: false + public get agentPortalAddress() { + return this.getListAttribute('agent_portal_address'); + } + + // blockchain_type - computed: true, optional: true, required: false + private _blockchainType?: string; + public get blockchainType() { + return this.getStringAttribute('blockchain_type'); + } + public set blockchainType(value: string) { + this._blockchainType = value; + } + public resetBlockchainType() { + this._blockchainType = undefined; + } + // Temporarily expose input value. Use with caution. + public get blockchainTypeInput() { + return this._blockchainType; + } + + // cce_cluster_id - computed: false, optional: false, required: true + private _cceClusterId?: string; + public get cceClusterId() { + return this.getStringAttribute('cce_cluster_id'); + } + public set cceClusterId(value: string) { + this._cceClusterId = value; + } + // Temporarily expose input value. Use with caution. + public get cceClusterIdInput() { + return this._cceClusterId; + } + + // cluster_type - computed: true, optional: false, required: false + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + + // consensus - computed: false, optional: false, required: true + private _consensus?: string; + public get consensus() { + return this.getStringAttribute('consensus'); + } + public set consensus(value: string) { + this._consensus = value; + } + // Temporarily expose input value. Use with caution. + public get consensusInput() { + return this._consensus; + } + + // cross_region_support - computed: true, optional: false, required: false + public get crossRegionSupport() { + return this.getBooleanAttribute('cross_region_support'); + } + + // database_type - computed: true, optional: true, required: false + private _databaseType?: string; + public get databaseType() { + return this.getStringAttribute('database_type'); + } + public set databaseType(value: string) { + this._databaseType = value; + } + public resetDatabaseType() { + this._databaseType = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseTypeInput() { + return this._databaseType; + } + + // delete_obs - computed: false, optional: true, required: false + private _deleteObs?: boolean | cdktf.IResolvable; + public get deleteObs() { + return this.getBooleanAttribute('delete_obs'); + } + public set deleteObs(value: boolean | cdktf.IResolvable) { + this._deleteObs = value; + } + public resetDeleteObs() { + this._deleteObs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteObsInput() { + return this._deleteObs; + } + + // delete_storage - computed: false, optional: true, required: false + private _deleteStorage?: boolean | cdktf.IResolvable; + public get deleteStorage() { + return this.getBooleanAttribute('delete_storage'); + } + public set deleteStorage(value: boolean | cdktf.IResolvable) { + this._deleteStorage = value; + } + public resetDeleteStorage() { + this._deleteStorage = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteStorageInput() { + return this._deleteStorage; + } + + // edition - computed: false, optional: false, required: true + private _edition?: number; + public get edition() { + return this.getNumberAttribute('edition'); + } + public set edition(value: number) { + this._edition = value; + } + // Temporarily expose input value. Use with caution. + public get editionInput() { + return this._edition; + } + + // eip_enable - computed: false, optional: true, required: false + private _eipEnable?: boolean | cdktf.IResolvable; + public get eipEnable() { + return this.getBooleanAttribute('eip_enable'); + } + public set eipEnable(value: boolean | cdktf.IResolvable) { + this._eipEnable = value; + } + public resetEipEnable() { + this._eipEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipEnableInput() { + return this._eipEnable; + } + + // enterprise_project_id - computed: false, optional: false, required: true + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fabric_version - computed: false, optional: false, required: true + private _fabricVersion?: string; + public get fabricVersion() { + return this.getStringAttribute('fabric_version'); + } + public set fabricVersion(value: string) { + this._fabricVersion = value; + } + // Temporarily expose input value. Use with caution. + public get fabricVersionInput() { + return this._fabricVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // old_service_version - computed: true, optional: false, required: false + public get oldServiceVersion() { + return this.getStringAttribute('old_service_version'); + } + + // orderer_node_num - computed: false, optional: false, required: true + private _ordererNodeNum?: number; + public get ordererNodeNum() { + return this.getNumberAttribute('orderer_node_num'); + } + public set ordererNodeNum(value: number) { + this._ordererNodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get ordererNodeNumInput() { + return this._ordererNodeNum; + } + + // org_disk_size - computed: false, optional: false, required: true + private _orgDiskSize?: number; + public get orgDiskSize() { + return this.getNumberAttribute('org_disk_size'); + } + public set orgDiskSize(value: number) { + this._orgDiskSize = value; + } + // Temporarily expose input value. Use with caution. + public get orgDiskSizeInput() { + return this._orgDiskSize; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // purchase_type - computed: true, optional: false, required: false + public get purchaseType() { + return this.getStringAttribute('purchase_type'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restful_api_support - computed: true, optional: true, required: false + private _restfulApiSupport?: boolean | cdktf.IResolvable; + public get restfulApiSupport() { + return this.getBooleanAttribute('restful_api_support'); + } + public set restfulApiSupport(value: boolean | cdktf.IResolvable) { + this._restfulApiSupport = value; + } + public resetRestfulApiSupport() { + this._restfulApiSupport = undefined; + } + // Temporarily expose input value. Use with caution. + public get restfulApiSupportInput() { + return this._restfulApiSupport; + } + + // rollback_support - computed: true, optional: false, required: false + public get rollbackSupport() { + return this.getBooleanAttribute('rollback_support'); + } + + // security_mechanism - computed: true, optional: true, required: false + private _securityMechanism?: string; + public get securityMechanism() { + return this.getStringAttribute('security_mechanism'); + } + public set securityMechanism(value: string) { + this._securityMechanism = value; + } + public resetSecurityMechanism() { + this._securityMechanism = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityMechanismInput() { + return this._securityMechanism; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tc3_need - computed: true, optional: true, required: false + private _tc3Need?: boolean | cdktf.IResolvable; + public get tc3Need() { + return this.getBooleanAttribute('tc3_need'); + } + public set tc3Need(value: boolean | cdktf.IResolvable) { + this._tc3Need = value; + } + public resetTc3Need() { + this._tc3Need = undefined; + } + // Temporarily expose input value. Use with caution. + public get tc3NeedInput() { + return this._tc3Need; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // block_info - computed: false, optional: true, required: false + private _blockInfo = new BcsInstanceBlockInfoOutputReference(this, "block_info"); + public get blockInfo() { + return this._blockInfo; + } + public putBlockInfo(value: BcsInstanceBlockInfo) { + this._blockInfo.internalValue = value; + } + public resetBlockInfo() { + this._blockInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get blockInfoInput() { + return this._blockInfo.internalValue; + } + + // channels - computed: false, optional: true, required: false + private _channels = new BcsInstanceChannelsList(this, "channels", true); + public get channels() { + return this._channels; + } + public putChannels(value: BcsInstanceChannels[] | cdktf.IResolvable) { + this._channels.internalValue = value; + } + public resetChannels() { + this._channels.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get channelsInput() { + return this._channels.internalValue; + } + + // couchdb - computed: false, optional: true, required: false + private _couchdb = new BcsInstanceCouchdbOutputReference(this, "couchdb"); + public get couchdb() { + return this._couchdb; + } + public putCouchdb(value: BcsInstanceCouchdb) { + this._couchdb.internalValue = value; + } + public resetCouchdb() { + this._couchdb.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get couchdbInput() { + return this._couchdb.internalValue; + } + + // kafka - computed: false, optional: true, required: false + private _kafka = new BcsInstanceKafkaOutputReference(this, "kafka"); + public get kafka() { + return this._kafka; + } + public putKafka(value: BcsInstanceKafka) { + this._kafka.internalValue = value; + } + public resetKafka() { + this._kafka.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaInput() { + return this._kafka.internalValue; + } + + // peer_orgs - computed: false, optional: true, required: false + private _peerOrgs = new BcsInstancePeerOrgsList(this, "peer_orgs", true); + public get peerOrgs() { + return this._peerOrgs; + } + public putPeerOrgs(value: BcsInstancePeerOrgs[] | cdktf.IResolvable) { + this._peerOrgs.internalValue = value; + } + public resetPeerOrgs() { + this._peerOrgs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerOrgsInput() { + return this._peerOrgs.internalValue; + } + + // sfs_turbo - computed: false, optional: true, required: false + private _sfsTurbo = new BcsInstanceSfsTurboOutputReference(this, "sfs_turbo"); + public get sfsTurbo() { + return this._sfsTurbo; + } + public putSfsTurbo(value: BcsInstanceSfsTurbo) { + this._sfsTurbo.internalValue = value; + } + public resetSfsTurbo() { + this._sfsTurbo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sfsTurboInput() { + return this._sfsTurbo.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new BcsInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: BcsInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + blockchain_type: cdktf.stringToTerraform(this._blockchainType), + cce_cluster_id: cdktf.stringToTerraform(this._cceClusterId), + consensus: cdktf.stringToTerraform(this._consensus), + database_type: cdktf.stringToTerraform(this._databaseType), + delete_obs: cdktf.booleanToTerraform(this._deleteObs), + delete_storage: cdktf.booleanToTerraform(this._deleteStorage), + edition: cdktf.numberToTerraform(this._edition), + eip_enable: cdktf.booleanToTerraform(this._eipEnable), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fabric_version: cdktf.stringToTerraform(this._fabricVersion), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + orderer_node_num: cdktf.numberToTerraform(this._ordererNodeNum), + org_disk_size: cdktf.numberToTerraform(this._orgDiskSize), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + restful_api_support: cdktf.booleanToTerraform(this._restfulApiSupport), + security_mechanism: cdktf.stringToTerraform(this._securityMechanism), + tc3_need: cdktf.booleanToTerraform(this._tc3Need), + volume_type: cdktf.stringToTerraform(this._volumeType), + block_info: bcsInstanceBlockInfoToTerraform(this._blockInfo.internalValue), + channels: cdktf.listMapper(bcsInstanceChannelsToTerraform, true)(this._channels.internalValue), + couchdb: bcsInstanceCouchdbToTerraform(this._couchdb.internalValue), + kafka: bcsInstanceKafkaToTerraform(this._kafka.internalValue), + peer_orgs: cdktf.listMapper(bcsInstancePeerOrgsToTerraform, true)(this._peerOrgs.internalValue), + sfs_turbo: bcsInstanceSfsTurboToTerraform(this._sfsTurbo.internalValue), + timeouts: bcsInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + blockchain_type: { + value: cdktf.stringToHclTerraform(this._blockchainType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cce_cluster_id: { + value: cdktf.stringToHclTerraform(this._cceClusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consensus: { + value: cdktf.stringToHclTerraform(this._consensus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_type: { + value: cdktf.stringToHclTerraform(this._databaseType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_obs: { + value: cdktf.booleanToHclTerraform(this._deleteObs), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delete_storage: { + value: cdktf.booleanToHclTerraform(this._deleteStorage), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + edition: { + value: cdktf.numberToHclTerraform(this._edition), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + eip_enable: { + value: cdktf.booleanToHclTerraform(this._eipEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fabric_version: { + value: cdktf.stringToHclTerraform(this._fabricVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + orderer_node_num: { + value: cdktf.numberToHclTerraform(this._ordererNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + org_disk_size: { + value: cdktf.numberToHclTerraform(this._orgDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restful_api_support: { + value: cdktf.booleanToHclTerraform(this._restfulApiSupport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_mechanism: { + value: cdktf.stringToHclTerraform(this._securityMechanism), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tc3_need: { + value: cdktf.booleanToHclTerraform(this._tc3Need), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + block_info: { + value: bcsInstanceBlockInfoToHclTerraform(this._blockInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "BcsInstanceBlockInfoList", + }, + channels: { + value: cdktf.listMapperHcl(bcsInstanceChannelsToHclTerraform, true)(this._channels.internalValue), + isBlock: true, + type: "set", + storageClassType: "BcsInstanceChannelsList", + }, + couchdb: { + value: bcsInstanceCouchdbToHclTerraform(this._couchdb.internalValue), + isBlock: true, + type: "list", + storageClassType: "BcsInstanceCouchdbList", + }, + kafka: { + value: bcsInstanceKafkaToHclTerraform(this._kafka.internalValue), + isBlock: true, + type: "list", + storageClassType: "BcsInstanceKafkaList", + }, + peer_orgs: { + value: cdktf.listMapperHcl(bcsInstancePeerOrgsToHclTerraform, true)(this._peerOrgs.internalValue), + isBlock: true, + type: "set", + storageClassType: "BcsInstancePeerOrgsList", + }, + sfs_turbo: { + value: bcsInstanceSfsTurboToHclTerraform(this._sfsTurbo.internalValue), + isBlock: true, + type: "list", + storageClassType: "BcsInstanceSfsTurboList", + }, + timeouts: { + value: bcsInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "BcsInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/blockstorage-volume-v2/README.md b/src/constructs/providers/huaweicloud/blockstorage-volume-v2/README.md new file mode 100644 index 00000000..c0928755 --- /dev/null +++ b/src/constructs/providers/huaweicloud/blockstorage-volume-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_blockstorage_volume_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_blockstorage_volume_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2). diff --git a/src/constructs/providers/huaweicloud/blockstorage-volume-v2/index.ts b/src/constructs/providers/huaweicloud/blockstorage-volume-v2/index.ts new file mode 100644 index 00000000..1f490dc7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/blockstorage-volume-v2/index.ts @@ -0,0 +1,725 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface BlockstorageVolumeV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#availability_zone BlockstorageVolumeV2#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#cascade BlockstorageVolumeV2#cascade} + */ + readonly cascade?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#consistency_group_id BlockstorageVolumeV2#consistency_group_id} + */ + readonly consistencyGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#description BlockstorageVolumeV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#id BlockstorageVolumeV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#image_id BlockstorageVolumeV2#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#metadata BlockstorageVolumeV2#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#name BlockstorageVolumeV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#region BlockstorageVolumeV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#size BlockstorageVolumeV2#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#snapshot_id BlockstorageVolumeV2#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#source_replica BlockstorageVolumeV2#source_replica} + */ + readonly sourceReplica?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#source_vol_id BlockstorageVolumeV2#source_vol_id} + */ + readonly sourceVolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#volume_type BlockstorageVolumeV2#volume_type} + */ + readonly volumeType?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#timeouts BlockstorageVolumeV2#timeouts} + */ + readonly timeouts?: BlockstorageVolumeV2Timeouts; +} +export interface BlockstorageVolumeV2Attachment { +} + +export function blockstorageVolumeV2AttachmentToTerraform(struct?: BlockstorageVolumeV2Attachment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function blockstorageVolumeV2AttachmentToHclTerraform(struct?: BlockstorageVolumeV2Attachment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class BlockstorageVolumeV2AttachmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): BlockstorageVolumeV2Attachment | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BlockstorageVolumeV2Attachment | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } +} + +export class BlockstorageVolumeV2AttachmentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): BlockstorageVolumeV2AttachmentOutputReference { + return new BlockstorageVolumeV2AttachmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface BlockstorageVolumeV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#create BlockstorageVolumeV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#delete BlockstorageVolumeV2#delete} + */ + readonly delete?: string; +} + +export function blockstorageVolumeV2TimeoutsToTerraform(struct?: BlockstorageVolumeV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function blockstorageVolumeV2TimeoutsToHclTerraform(struct?: BlockstorageVolumeV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BlockstorageVolumeV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): BlockstorageVolumeV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BlockstorageVolumeV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2 huaweicloud_blockstorage_volume_v2} +*/ +export class BlockstorageVolumeV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_blockstorage_volume_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a BlockstorageVolumeV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the BlockstorageVolumeV2 to import + * @param importFromId The id of the existing BlockstorageVolumeV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the BlockstorageVolumeV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_blockstorage_volume_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/blockstorage_volume_v2 huaweicloud_blockstorage_volume_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options BlockstorageVolumeV2Config + */ + public constructor(scope: Construct, id: string, config: BlockstorageVolumeV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_blockstorage_volume_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cascade = config.cascade; + this._consistencyGroupId = config.consistencyGroupId; + this._description = config.description; + this._id = config.id; + this._imageId = config.imageId; + this._metadata = config.metadata; + this._name = config.name; + this._region = config.region; + this._size = config.size; + this._snapshotId = config.snapshotId; + this._sourceReplica = config.sourceReplica; + this._sourceVolId = config.sourceVolId; + this._volumeType = config.volumeType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment - computed: true, optional: false, required: false + private _attachment = new BlockstorageVolumeV2AttachmentList(this, "attachment", true); + public get attachment() { + return this._attachment; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cascade - computed: false, optional: true, required: false + private _cascade?: boolean | cdktf.IResolvable; + public get cascade() { + return this.getBooleanAttribute('cascade'); + } + public set cascade(value: boolean | cdktf.IResolvable) { + this._cascade = value; + } + public resetCascade() { + this._cascade = undefined; + } + // Temporarily expose input value. Use with caution. + public get cascadeInput() { + return this._cascade; + } + + // consistency_group_id - computed: false, optional: true, required: false + private _consistencyGroupId?: string; + public get consistencyGroupId() { + return this.getStringAttribute('consistency_group_id'); + } + public set consistencyGroupId(value: string) { + this._consistencyGroupId = value; + } + public resetConsistencyGroupId() { + this._consistencyGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistencyGroupIdInput() { + return this._consistencyGroupId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // metadata - computed: true, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: false, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // source_replica - computed: false, optional: true, required: false + private _sourceReplica?: string; + public get sourceReplica() { + return this.getStringAttribute('source_replica'); + } + public set sourceReplica(value: string) { + this._sourceReplica = value; + } + public resetSourceReplica() { + this._sourceReplica = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceReplicaInput() { + return this._sourceReplica; + } + + // source_vol_id - computed: false, optional: true, required: false + private _sourceVolId?: string; + public get sourceVolId() { + return this.getStringAttribute('source_vol_id'); + } + public set sourceVolId(value: string) { + this._sourceVolId = value; + } + public resetSourceVolId() { + this._sourceVolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceVolIdInput() { + return this._sourceVolId; + } + + // volume_type - computed: true, optional: true, required: false + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + public resetVolumeType() { + this._volumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new BlockstorageVolumeV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: BlockstorageVolumeV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cascade: cdktf.booleanToTerraform(this._cascade), + consistency_group_id: cdktf.stringToTerraform(this._consistencyGroupId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + source_replica: cdktf.stringToTerraform(this._sourceReplica), + source_vol_id: cdktf.stringToTerraform(this._sourceVolId), + volume_type: cdktf.stringToTerraform(this._volumeType), + timeouts: blockstorageVolumeV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cascade: { + value: cdktf.booleanToHclTerraform(this._cascade), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + consistency_group_id: { + value: cdktf.stringToHclTerraform(this._consistencyGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_replica: { + value: cdktf.stringToHclTerraform(this._sourceReplica), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_vol_id: { + value: cdktf.stringToHclTerraform(this._sourceVolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: blockstorageVolumeV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "BlockstorageVolumeV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/bms-instance/README.md b/src/constructs/providers/huaweicloud/bms-instance/README.md new file mode 100644 index 00000000..6ef8a7f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/bms-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_bms_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_bms_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance). diff --git a/src/constructs/providers/huaweicloud/bms-instance/index.ts b/src/constructs/providers/huaweicloud/bms-instance/index.ts new file mode 100644 index 00000000..d65db8d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/bms-instance/index.ts @@ -0,0 +1,1430 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface BmsInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#admin_pass BmsInstance#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#agency_name BmsInstance#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#auto_renew BmsInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#availability_zone BmsInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#bandwidth_charge_mode BmsInstance#bandwidth_charge_mode} + */ + readonly bandwidthChargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#bandwidth_size BmsInstance#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#charging_mode BmsInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#eip_charge_mode BmsInstance#eip_charge_mode} + */ + readonly eipChargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#eip_id BmsInstance#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#enterprise_project_id BmsInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#flavor_id BmsInstance#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#id BmsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#image_id BmsInstance#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#iptype BmsInstance#iptype} + */ + readonly iptype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#key_pair BmsInstance#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#metadata BmsInstance#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#name BmsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#period BmsInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#period_unit BmsInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#region BmsInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#security_groups BmsInstance#security_groups} + */ + readonly securityGroups?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#sharetype BmsInstance#sharetype} + */ + readonly sharetype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#system_disk_size BmsInstance#system_disk_size} + */ + readonly systemDiskSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#system_disk_type BmsInstance#system_disk_type} + */ + readonly systemDiskType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#tags BmsInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#user_data BmsInstance#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#user_id BmsInstance#user_id} + */ + readonly userId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#vpc_id BmsInstance#vpc_id} + */ + readonly vpcId: string; + /** + * data_disks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#data_disks BmsInstance#data_disks} + */ + readonly dataDisks?: BmsInstanceDataDisks[] | cdktf.IResolvable; + /** + * nics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#nics BmsInstance#nics} + */ + readonly nics: BmsInstanceNics[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#timeouts BmsInstance#timeouts} + */ + readonly timeouts?: BmsInstanceTimeouts; +} +export interface BmsInstanceDataDisks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#size BmsInstance#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#type BmsInstance#type} + */ + readonly type: string; +} + +export function bmsInstanceDataDisksToTerraform(struct?: BmsInstanceDataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function bmsInstanceDataDisksToHclTerraform(struct?: BmsInstanceDataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BmsInstanceDataDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): BmsInstanceDataDisks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BmsInstanceDataDisks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._size = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._size = value.size; + this._type = value.type; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class BmsInstanceDataDisksList extends cdktf.ComplexList { + public internalValue? : BmsInstanceDataDisks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): BmsInstanceDataDisksOutputReference { + return new BmsInstanceDataDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface BmsInstanceNics { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#ip_address BmsInstance#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#subnet_id BmsInstance#subnet_id} + */ + readonly subnetId: string; +} + +export function bmsInstanceNicsToTerraform(struct?: BmsInstanceNics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function bmsInstanceNicsToHclTerraform(struct?: BmsInstanceNics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BmsInstanceNicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): BmsInstanceNics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BmsInstanceNics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._subnetId = value.subnetId; + } + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class BmsInstanceNicsList extends cdktf.ComplexList { + public internalValue? : BmsInstanceNics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): BmsInstanceNicsOutputReference { + return new BmsInstanceNicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface BmsInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#create BmsInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#delete BmsInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#update BmsInstance#update} + */ + readonly update?: string; +} + +export function bmsInstanceTimeoutsToTerraform(struct?: BmsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function bmsInstanceTimeoutsToHclTerraform(struct?: BmsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class BmsInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): BmsInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: BmsInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance huaweicloud_bms_instance} +*/ +export class BmsInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_bms_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a BmsInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the BmsInstance to import + * @param importFromId The id of the existing BmsInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the BmsInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_bms_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/bms_instance huaweicloud_bms_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options BmsInstanceConfig + */ + public constructor(scope: Construct, id: string, config: BmsInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_bms_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._agencyName = config.agencyName; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._bandwidthChargeMode = config.bandwidthChargeMode; + this._bandwidthSize = config.bandwidthSize; + this._chargingMode = config.chargingMode; + this._eipChargeMode = config.eipChargeMode; + this._eipId = config.eipId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._iptype = config.iptype; + this._keyPair = config.keyPair; + this._metadata = config.metadata; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroups = config.securityGroups; + this._sharetype = config.sharetype; + this._systemDiskSize = config.systemDiskSize; + this._systemDiskType = config.systemDiskType; + this._tags = config.tags; + this._userData = config.userData; + this._userId = config.userId; + this._vpcId = config.vpcId; + this._dataDisks.internalValue = config.dataDisks; + this._nics.internalValue = config.nics; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // bandwidth_charge_mode - computed: false, optional: true, required: false + private _bandwidthChargeMode?: string; + public get bandwidthChargeMode() { + return this.getStringAttribute('bandwidth_charge_mode'); + } + public set bandwidthChargeMode(value: string) { + this._bandwidthChargeMode = value; + } + public resetBandwidthChargeMode() { + this._bandwidthChargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthChargeModeInput() { + return this._bandwidthChargeMode; + } + + // bandwidth_size - computed: false, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // disk_ids - computed: true, optional: false, required: false + public get diskIds() { + return this.getListAttribute('disk_ids'); + } + + // eip_charge_mode - computed: false, optional: true, required: false + private _eipChargeMode?: string; + public get eipChargeMode() { + return this.getStringAttribute('eip_charge_mode'); + } + public set eipChargeMode(value: string) { + this._eipChargeMode = value; + } + public resetEipChargeMode() { + this._eipChargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipChargeModeInput() { + return this._eipChargeMode; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // host_id - computed: true, optional: false, required: false + public get hostId() { + return this.getStringAttribute('host_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // iptype - computed: false, optional: true, required: false + private _iptype?: string; + public get iptype() { + return this.getStringAttribute('iptype'); + } + public set iptype(value: string) { + this._iptype = value; + } + public resetIptype() { + this._iptype = undefined; + } + // Temporarily expose input value. Use with caution. + public get iptypeInput() { + return this._iptype; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_groups - computed: true, optional: true, required: false + private _securityGroups?: string[]; + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + public resetSecurityGroups() { + this._securityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // sharetype - computed: false, optional: true, required: false + private _sharetype?: string; + public get sharetype() { + return this.getStringAttribute('sharetype'); + } + public set sharetype(value: string) { + this._sharetype = value; + } + public resetSharetype() { + this._sharetype = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharetypeInput() { + return this._sharetype; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // system_disk_size - computed: false, optional: true, required: false + private _systemDiskSize?: number; + public get systemDiskSize() { + return this.getNumberAttribute('system_disk_size'); + } + public set systemDiskSize(value: number) { + this._systemDiskSize = value; + } + public resetSystemDiskSize() { + this._systemDiskSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskSizeInput() { + return this._systemDiskSize; + } + + // system_disk_type - computed: false, optional: true, required: false + private _systemDiskType?: string; + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + public set systemDiskType(value: string) { + this._systemDiskType = value; + } + public resetSystemDiskType() { + this._systemDiskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskTypeInput() { + return this._systemDiskType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // user_data - computed: true, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // data_disks - computed: false, optional: true, required: false + private _dataDisks = new BmsInstanceDataDisksList(this, "data_disks", false); + public get dataDisks() { + return this._dataDisks; + } + public putDataDisks(value: BmsInstanceDataDisks[] | cdktf.IResolvable) { + this._dataDisks.internalValue = value; + } + public resetDataDisks() { + this._dataDisks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDisksInput() { + return this._dataDisks.internalValue; + } + + // nics - computed: false, optional: false, required: true + private _nics = new BmsInstanceNicsList(this, "nics", false); + public get nics() { + return this._nics; + } + public putNics(value: BmsInstanceNics[] | cdktf.IResolvable) { + this._nics.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nicsInput() { + return this._nics.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new BmsInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: BmsInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + agency_name: cdktf.stringToTerraform(this._agencyName), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + bandwidth_charge_mode: cdktf.stringToTerraform(this._bandwidthChargeMode), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + eip_charge_mode: cdktf.stringToTerraform(this._eipChargeMode), + eip_id: cdktf.stringToTerraform(this._eipId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + iptype: cdktf.stringToTerraform(this._iptype), + key_pair: cdktf.stringToTerraform(this._keyPair), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + sharetype: cdktf.stringToTerraform(this._sharetype), + system_disk_size: cdktf.numberToTerraform(this._systemDiskSize), + system_disk_type: cdktf.stringToTerraform(this._systemDiskType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_data: cdktf.stringToTerraform(this._userData), + user_id: cdktf.stringToTerraform(this._userId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + data_disks: cdktf.listMapper(bmsInstanceDataDisksToTerraform, true)(this._dataDisks.internalValue), + nics: cdktf.listMapper(bmsInstanceNicsToTerraform, true)(this._nics.internalValue), + timeouts: bmsInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_charge_mode: { + value: cdktf.stringToHclTerraform(this._bandwidthChargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_charge_mode: { + value: cdktf.stringToHclTerraform(this._eipChargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iptype: { + value: cdktf.stringToHclTerraform(this._iptype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + sharetype: { + value: cdktf.stringToHclTerraform(this._sharetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_size: { + value: cdktf.numberToHclTerraform(this._systemDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_type: { + value: cdktf.stringToHclTerraform(this._systemDiskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_disks: { + value: cdktf.listMapperHcl(bmsInstanceDataDisksToHclTerraform, true)(this._dataDisks.internalValue), + isBlock: true, + type: "list", + storageClassType: "BmsInstanceDataDisksList", + }, + nics: { + value: cdktf.listMapperHcl(bmsInstanceNicsToHclTerraform, true)(this._nics.internalValue), + isBlock: true, + type: "list", + storageClassType: "BmsInstanceNicsList", + }, + timeouts: { + value: bmsInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "BmsInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cae-component-configurations/README.md b/src/constructs/providers/huaweicloud/cae-component-configurations/README.md new file mode 100644 index 00000000..894f9f7e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cae-component-configurations/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cae_component_configurations` + +Refer to the Terraform Registry for docs: [`huaweicloud_cae_component_configurations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations). diff --git a/src/constructs/providers/huaweicloud/cae-component-configurations/index.ts b/src/constructs/providers/huaweicloud/cae-component-configurations/index.ts new file mode 100644 index 00000000..171837ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/cae-component-configurations/index.ts @@ -0,0 +1,401 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CaeComponentConfigurationsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application where the component is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#application_id CaeComponentConfigurations#application_id} + */ + readonly applicationId: string; + /** + * The ID of the component to which the configurations belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#component_id CaeComponentConfigurations#component_id} + */ + readonly componentId: string; + /** + * The ID of the environment where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#environment_id CaeComponentConfigurations#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#id CaeComponentConfigurations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#region CaeComponentConfigurations#region} + */ + readonly region?: string; + /** + * items block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#items CaeComponentConfigurations#items} + */ + readonly items: CaeComponentConfigurationsItems[] | cdktf.IResolvable; +} +export interface CaeComponentConfigurationsItems { + /** + * The configuration detail. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#data CaeComponentConfigurations#data} + */ + readonly data: string; + /** + * The type of the configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#type CaeComponentConfigurations#type} + */ + readonly type: string; +} + +export function caeComponentConfigurationsItemsToTerraform(struct?: CaeComponentConfigurationsItems | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data: cdktf.stringToTerraform(struct!.data), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function caeComponentConfigurationsItemsToHclTerraform(struct?: CaeComponentConfigurationsItems | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data: { + value: cdktf.stringToHclTerraform(struct!.data), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentConfigurationsItemsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CaeComponentConfigurationsItems | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._data !== undefined) { + hasAnyValues = true; + internalValueResult.data = this._data; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentConfigurationsItems | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._data = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._data = value.data; + this._type = value.type; + } + } + + // data - computed: false, optional: false, required: true + private _data?: string; + public get data() { + return this.getStringAttribute('data'); + } + public set data(value: string) { + this._data = value; + } + // Temporarily expose input value. Use with caution. + public get dataInput() { + return this._data; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CaeComponentConfigurationsItemsList extends cdktf.ComplexList { + public internalValue? : CaeComponentConfigurationsItems[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CaeComponentConfigurationsItemsOutputReference { + return new CaeComponentConfigurationsItemsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations huaweicloud_cae_component_configurations} +*/ +export class CaeComponentConfigurations extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cae_component_configurations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CaeComponentConfigurations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CaeComponentConfigurations to import + * @param importFromId The id of the existing CaeComponentConfigurations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CaeComponentConfigurations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cae_component_configurations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_configurations huaweicloud_cae_component_configurations} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CaeComponentConfigurationsConfig + */ + public constructor(scope: Construct, id: string, config: CaeComponentConfigurationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cae_component_configurations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._componentId = config.componentId; + this._environmentId = config.environmentId; + this._id = config.id; + this._region = config.region; + this._items.internalValue = config.items; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // component_id - computed: false, optional: false, required: true + private _componentId?: string; + public get componentId() { + return this.getStringAttribute('component_id'); + } + public set componentId(value: string) { + this._componentId = value; + } + // Temporarily expose input value. Use with caution. + public get componentIdInput() { + return this._componentId; + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // items - computed: false, optional: false, required: true + private _items = new CaeComponentConfigurationsItemsList(this, "items", true); + public get items() { + return this._items; + } + public putItems(value: CaeComponentConfigurationsItems[] | cdktf.IResolvable) { + this._items.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get itemsInput() { + return this._items.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + component_id: cdktf.stringToTerraform(this._componentId), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + items: cdktf.listMapper(caeComponentConfigurationsItemsToTerraform, true)(this._items.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_id: { + value: cdktf.stringToHclTerraform(this._componentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + items: { + value: cdktf.listMapperHcl(caeComponentConfigurationsItemsToHclTerraform, true)(this._items.internalValue), + isBlock: true, + type: "set", + storageClassType: "CaeComponentConfigurationsItemsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cae-component-deployment/README.md b/src/constructs/providers/huaweicloud/cae-component-deployment/README.md new file mode 100644 index 00000000..64c9f22a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cae-component-deployment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cae_component_deployment` + +Refer to the Terraform Registry for docs: [`huaweicloud_cae_component_deployment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment). diff --git a/src/constructs/providers/huaweicloud/cae-component-deployment/index.ts b/src/constructs/providers/huaweicloud/cae-component-deployment/index.ts new file mode 100644 index 00000000..8c06113a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cae-component-deployment/index.ts @@ -0,0 +1,559 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CaeComponentDeploymentConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application where the component is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#application_id CaeComponentDeployment#application_id} + */ + readonly applicationId: string; + /** + * The ID of the component to which the configurations belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#component_id CaeComponentDeployment#component_id} + */ + readonly componentId: string; + /** + * The ID of the environment where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#environment_id CaeComponentDeployment#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#id CaeComponentDeployment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#region CaeComponentDeployment#region} + */ + readonly region?: string; + /** + * The specification detail of the action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#spec CaeComponentDeployment#spec} + */ + readonly spec?: string; + /** + * metadata block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#metadata CaeComponentDeployment#metadata} + */ + readonly metadata: CaeComponentDeploymentMetadata; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#timeouts CaeComponentDeployment#timeouts} + */ + readonly timeouts?: CaeComponentDeploymentTimeouts; +} +export interface CaeComponentDeploymentMetadata { + /** + * The resource configurations. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#annotations CaeComponentDeployment#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * The action name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#name CaeComponentDeployment#name} + */ + readonly name: string; +} + +export function caeComponentDeploymentMetadataToTerraform(struct?: CaeComponentDeploymentMetadataOutputReference | CaeComponentDeploymentMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.annotations), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function caeComponentDeploymentMetadataToHclTerraform(struct?: CaeComponentDeploymentMetadataOutputReference | CaeComponentDeploymentMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentDeploymentMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentDeploymentMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._annotations !== undefined) { + hasAnyValues = true; + internalValueResult.annotations = this._annotations; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentDeploymentMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._annotations = undefined; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._annotations = value.annotations; + this._name = value.name; + } + } + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} +export interface CaeComponentDeploymentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#create CaeComponentDeployment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#update CaeComponentDeployment#update} + */ + readonly update?: string; +} + +export function caeComponentDeploymentTimeoutsToTerraform(struct?: CaeComponentDeploymentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function caeComponentDeploymentTimeoutsToHclTerraform(struct?: CaeComponentDeploymentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentDeploymentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CaeComponentDeploymentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentDeploymentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment huaweicloud_cae_component_deployment} +*/ +export class CaeComponentDeployment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cae_component_deployment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CaeComponentDeployment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CaeComponentDeployment to import + * @param importFromId The id of the existing CaeComponentDeployment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CaeComponentDeployment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cae_component_deployment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component_deployment huaweicloud_cae_component_deployment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CaeComponentDeploymentConfig + */ + public constructor(scope: Construct, id: string, config: CaeComponentDeploymentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cae_component_deployment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._componentId = config.componentId; + this._environmentId = config.environmentId; + this._id = config.id; + this._region = config.region; + this._spec = config.spec; + this._metadata.internalValue = config.metadata; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // component_id - computed: false, optional: false, required: true + private _componentId?: string; + public get componentId() { + return this.getStringAttribute('component_id'); + } + public set componentId(value: string) { + this._componentId = value; + } + // Temporarily expose input value. Use with caution. + public get componentIdInput() { + return this._componentId; + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: false, optional: true, required: false + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + public resetSpec() { + this._spec = undefined; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // metadata - computed: false, optional: false, required: true + private _metadata = new CaeComponentDeploymentMetadataOutputReference(this, "metadata"); + public get metadata() { + return this._metadata; + } + public putMetadata(value: CaeComponentDeploymentMetadata) { + this._metadata.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CaeComponentDeploymentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CaeComponentDeploymentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + component_id: cdktf.stringToTerraform(this._componentId), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + spec: cdktf.stringToTerraform(this._spec), + metadata: caeComponentDeploymentMetadataToTerraform(this._metadata.internalValue), + timeouts: caeComponentDeploymentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_id: { + value: cdktf.stringToHclTerraform(this._componentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: caeComponentDeploymentMetadataToHclTerraform(this._metadata.internalValue), + isBlock: true, + type: "list", + storageClassType: "CaeComponentDeploymentMetadataList", + }, + timeouts: { + value: caeComponentDeploymentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CaeComponentDeploymentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cae-component/README.md b/src/constructs/providers/huaweicloud/cae-component/README.md new file mode 100644 index 00000000..036c953f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cae-component/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cae_component` + +Refer to the Terraform Registry for docs: [`huaweicloud_cae_component`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component). diff --git a/src/constructs/providers/huaweicloud/cae-component/index.ts b/src/constructs/providers/huaweicloud/cae-component/index.ts new file mode 100644 index 00000000..02f60d81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cae-component/index.ts @@ -0,0 +1,1204 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CaeComponentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#application_id CaeComponent#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#environment_id CaeComponent#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#id CaeComponent#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#region CaeComponent#region} + */ + readonly region?: string; + /** + * metadata block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#metadata CaeComponent#metadata} + */ + readonly metadata: CaeComponentMetadata; + /** + * spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#spec CaeComponent#spec} + */ + readonly spec: CaeComponentSpec; +} +export interface CaeComponentMetadata { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#annotations CaeComponent#annotations} + */ + readonly annotations: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#name CaeComponent#name} + */ + readonly name: string; +} + +export function caeComponentMetadataToTerraform(struct?: CaeComponentMetadataOutputReference | CaeComponentMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.annotations), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function caeComponentMetadataToHclTerraform(struct?: CaeComponentMetadataOutputReference | CaeComponentMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._annotations !== undefined) { + hasAnyValues = true; + internalValueResult.annotations = this._annotations; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._annotations = undefined; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._annotations = value.annotations; + this._name = value.name; + } + } + + // annotations - computed: false, optional: false, required: true + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} +export interface CaeComponentSpecBuildArchive { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#artifact_namespace CaeComponent#artifact_namespace} + */ + readonly artifactNamespace: string; +} + +export function caeComponentSpecBuildArchiveToTerraform(struct?: CaeComponentSpecBuildArchiveOutputReference | CaeComponentSpecBuildArchive): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + artifact_namespace: cdktf.stringToTerraform(struct!.artifactNamespace), + } +} + + +export function caeComponentSpecBuildArchiveToHclTerraform(struct?: CaeComponentSpecBuildArchiveOutputReference | CaeComponentSpecBuildArchive): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + artifact_namespace: { + value: cdktf.stringToHclTerraform(struct!.artifactNamespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentSpecBuildArchiveOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentSpecBuildArchive | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._artifactNamespace !== undefined) { + hasAnyValues = true; + internalValueResult.artifactNamespace = this._artifactNamespace; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentSpecBuildArchive | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._artifactNamespace = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._artifactNamespace = value.artifactNamespace; + } + } + + // artifact_namespace - computed: false, optional: false, required: true + private _artifactNamespace?: string; + public get artifactNamespace() { + return this.getStringAttribute('artifact_namespace'); + } + public set artifactNamespace(value: string) { + this._artifactNamespace = value; + } + // Temporarily expose input value. Use with caution. + public get artifactNamespaceInput() { + return this._artifactNamespace; + } +} +export interface CaeComponentSpecBuild { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#parameters CaeComponent#parameters} + */ + readonly parameters: { [key: string]: string }; + /** + * archive block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#archive CaeComponent#archive} + */ + readonly archive: CaeComponentSpecBuildArchive; +} + +export function caeComponentSpecBuildToTerraform(struct?: CaeComponentSpecBuildOutputReference | CaeComponentSpecBuild): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + parameters: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.parameters), + archive: caeComponentSpecBuildArchiveToTerraform(struct!.archive), + } +} + + +export function caeComponentSpecBuildToHclTerraform(struct?: CaeComponentSpecBuildOutputReference | CaeComponentSpecBuild): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + parameters: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.parameters), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + archive: { + value: caeComponentSpecBuildArchiveToHclTerraform(struct!.archive), + isBlock: true, + type: "list", + storageClassType: "CaeComponentSpecBuildArchiveList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentSpecBuildOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentSpecBuild | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._parameters !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters; + } + if (this._archive?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.archive = this._archive?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentSpecBuild | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._parameters = undefined; + this._archive.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._parameters = value.parameters; + this._archive.internalValue = value.archive; + } + } + + // parameters - computed: false, optional: false, required: true + private _parameters?: { [key: string]: string }; + public get parameters() { + return this.getStringMapAttribute('parameters'); + } + public set parameters(value: { [key: string]: string }) { + this._parameters = value; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // archive - computed: false, optional: false, required: true + private _archive = new CaeComponentSpecBuildArchiveOutputReference(this, "archive"); + public get archive() { + return this._archive; + } + public putArchive(value: CaeComponentSpecBuildArchive) { + this._archive.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get archiveInput() { + return this._archive.internalValue; + } +} +export interface CaeComponentSpecResourceLimit { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#cpu CaeComponent#cpu} + */ + readonly cpu: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#memory CaeComponent#memory} + */ + readonly memory: string; +} + +export function caeComponentSpecResourceLimitToTerraform(struct?: CaeComponentSpecResourceLimitOutputReference | CaeComponentSpecResourceLimit): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cpu: cdktf.stringToTerraform(struct!.cpu), + memory: cdktf.stringToTerraform(struct!.memory), + } +} + + +export function caeComponentSpecResourceLimitToHclTerraform(struct?: CaeComponentSpecResourceLimitOutputReference | CaeComponentSpecResourceLimit): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cpu: { + value: cdktf.stringToHclTerraform(struct!.cpu), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.stringToHclTerraform(struct!.memory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentSpecResourceLimitOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentSpecResourceLimit | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cpu !== undefined) { + hasAnyValues = true; + internalValueResult.cpu = this._cpu; + } + if (this._memory !== undefined) { + hasAnyValues = true; + internalValueResult.memory = this._memory; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentSpecResourceLimit | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cpu = undefined; + this._memory = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cpu = value.cpu; + this._memory = value.memory; + } + } + + // cpu - computed: false, optional: false, required: true + private _cpu?: string; + public get cpu() { + return this.getStringAttribute('cpu'); + } + public set cpu(value: string) { + this._cpu = value; + } + // Temporarily expose input value. Use with caution. + public get cpuInput() { + return this._cpu; + } + + // memory - computed: false, optional: false, required: true + private _memory?: string; + public get memory() { + return this.getStringAttribute('memory'); + } + public set memory(value: string) { + this._memory = value; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } +} +export interface CaeComponentSpecSourceCode { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#auth_name CaeComponent#auth_name} + */ + readonly authName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#branch CaeComponent#branch} + */ + readonly branch: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#namespace CaeComponent#namespace} + */ + readonly namespace: string; +} + +export function caeComponentSpecSourceCodeToTerraform(struct?: CaeComponentSpecSourceCodeOutputReference | CaeComponentSpecSourceCode): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auth_name: cdktf.stringToTerraform(struct!.authName), + branch: cdktf.stringToTerraform(struct!.branch), + namespace: cdktf.stringToTerraform(struct!.namespace), + } +} + + +export function caeComponentSpecSourceCodeToHclTerraform(struct?: CaeComponentSpecSourceCodeOutputReference | CaeComponentSpecSourceCode): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auth_name: { + value: cdktf.stringToHclTerraform(struct!.authName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + branch: { + value: cdktf.stringToHclTerraform(struct!.branch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(struct!.namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentSpecSourceCodeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentSpecSourceCode | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authName !== undefined) { + hasAnyValues = true; + internalValueResult.authName = this._authName; + } + if (this._branch !== undefined) { + hasAnyValues = true; + internalValueResult.branch = this._branch; + } + if (this._namespace !== undefined) { + hasAnyValues = true; + internalValueResult.namespace = this._namespace; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentSpecSourceCode | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authName = undefined; + this._branch = undefined; + this._namespace = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authName = value.authName; + this._branch = value.branch; + this._namespace = value.namespace; + } + } + + // auth_name - computed: false, optional: false, required: true + private _authName?: string; + public get authName() { + return this.getStringAttribute('auth_name'); + } + public set authName(value: string) { + this._authName = value; + } + // Temporarily expose input value. Use with caution. + public get authNameInput() { + return this._authName; + } + + // branch - computed: false, optional: false, required: true + private _branch?: string; + public get branch() { + return this.getStringAttribute('branch'); + } + public set branch(value: string) { + this._branch = value; + } + // Temporarily expose input value. Use with caution. + public get branchInput() { + return this._branch; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } +} +export interface CaeComponentSpecSource { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#sub_type CaeComponent#sub_type} + */ + readonly subType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#type CaeComponent#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#url CaeComponent#url} + */ + readonly url: string; + /** + * code block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#code CaeComponent#code} + */ + readonly code?: CaeComponentSpecSourceCode; +} + +export function caeComponentSpecSourceToTerraform(struct?: CaeComponentSpecSourceOutputReference | CaeComponentSpecSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + sub_type: cdktf.stringToTerraform(struct!.subType), + type: cdktf.stringToTerraform(struct!.type), + url: cdktf.stringToTerraform(struct!.url), + code: caeComponentSpecSourceCodeToTerraform(struct!.code), + } +} + + +export function caeComponentSpecSourceToHclTerraform(struct?: CaeComponentSpecSourceOutputReference | CaeComponentSpecSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + sub_type: { + value: cdktf.stringToHclTerraform(struct!.subType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(struct!.url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code: { + value: caeComponentSpecSourceCodeToHclTerraform(struct!.code), + isBlock: true, + type: "list", + storageClassType: "CaeComponentSpecSourceCodeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentSpecSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentSpecSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subType !== undefined) { + hasAnyValues = true; + internalValueResult.subType = this._subType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._url !== undefined) { + hasAnyValues = true; + internalValueResult.url = this._url; + } + if (this._code?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.code = this._code?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentSpecSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._subType = undefined; + this._type = undefined; + this._url = undefined; + this._code.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._subType = value.subType; + this._type = value.type; + this._url = value.url; + this._code.internalValue = value.code; + } + } + + // sub_type - computed: false, optional: true, required: false + private _subType?: string; + public get subType() { + return this.getStringAttribute('sub_type'); + } + public set subType(value: string) { + this._subType = value; + } + public resetSubType() { + this._subType = undefined; + } + // Temporarily expose input value. Use with caution. + public get subTypeInput() { + return this._subType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // code - computed: false, optional: true, required: false + private _code = new CaeComponentSpecSourceCodeOutputReference(this, "code"); + public get code() { + return this._code; + } + public putCode(value: CaeComponentSpecSourceCode) { + this._code.internalValue = value; + } + public resetCode() { + this._code.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code.internalValue; + } +} +export interface CaeComponentSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#replica CaeComponent#replica} + */ + readonly replica: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#runtime CaeComponent#runtime} + */ + readonly runtime: string; + /** + * build block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#build CaeComponent#build} + */ + readonly buildAttribute?: CaeComponentSpecBuild; + /** + * resource_limit block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#resource_limit CaeComponent#resource_limit} + */ + readonly resourceLimit: CaeComponentSpecResourceLimit; + /** + * source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#source CaeComponent#source} + */ + readonly source: CaeComponentSpecSource; +} + +export function caeComponentSpecToTerraform(struct?: CaeComponentSpecOutputReference | CaeComponentSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + replica: cdktf.numberToTerraform(struct!.replica), + runtime: cdktf.stringToTerraform(struct!.runtime), + build: caeComponentSpecBuildToTerraform(struct!.buildAttribute), + resource_limit: caeComponentSpecResourceLimitToTerraform(struct!.resourceLimit), + source: caeComponentSpecSourceToTerraform(struct!.source), + } +} + + +export function caeComponentSpecToHclTerraform(struct?: CaeComponentSpecOutputReference | CaeComponentSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + replica: { + value: cdktf.numberToHclTerraform(struct!.replica), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + runtime: { + value: cdktf.stringToHclTerraform(struct!.runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + build: { + value: caeComponentSpecBuildToHclTerraform(struct!.buildAttribute), + isBlock: true, + type: "list", + storageClassType: "CaeComponentSpecBuildList", + }, + resource_limit: { + value: caeComponentSpecResourceLimitToHclTerraform(struct!.resourceLimit), + isBlock: true, + type: "list", + storageClassType: "CaeComponentSpecResourceLimitList", + }, + source: { + value: caeComponentSpecSourceToHclTerraform(struct!.source), + isBlock: true, + type: "list", + storageClassType: "CaeComponentSpecSourceList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CaeComponentSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CaeComponentSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._replica !== undefined) { + hasAnyValues = true; + internalValueResult.replica = this._replica; + } + if (this._runtime !== undefined) { + hasAnyValues = true; + internalValueResult.runtime = this._runtime; + } + if (this._build?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.buildAttribute = this._build?.internalValue; + } + if (this._resourceLimit?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.resourceLimit = this._resourceLimit?.internalValue; + } + if (this._source?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.source = this._source?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CaeComponentSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._replica = undefined; + this._runtime = undefined; + this._build.internalValue = undefined; + this._resourceLimit.internalValue = undefined; + this._source.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._replica = value.replica; + this._runtime = value.runtime; + this._build.internalValue = value.buildAttribute; + this._resourceLimit.internalValue = value.resourceLimit; + this._source.internalValue = value.source; + } + } + + // replica - computed: false, optional: false, required: true + private _replica?: number; + public get replica() { + return this.getNumberAttribute('replica'); + } + public set replica(value: number) { + this._replica = value; + } + // Temporarily expose input value. Use with caution. + public get replicaInput() { + return this._replica; + } + + // runtime - computed: false, optional: false, required: true + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // build - computed: false, optional: true, required: false + private _build = new CaeComponentSpecBuildOutputReference(this, "build"); + public get buildAttribute() { + return this._build; + } + public putBuildAttribute(value: CaeComponentSpecBuild) { + this._build.internalValue = value; + } + public resetBuildAttribute() { + this._build.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get buildAttributeInput() { + return this._build.internalValue; + } + + // resource_limit - computed: false, optional: false, required: true + private _resourceLimit = new CaeComponentSpecResourceLimitOutputReference(this, "resource_limit"); + public get resourceLimit() { + return this._resourceLimit; + } + public putResourceLimit(value: CaeComponentSpecResourceLimit) { + this._resourceLimit.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourceLimitInput() { + return this._resourceLimit.internalValue; + } + + // source - computed: false, optional: false, required: true + private _source = new CaeComponentSpecSourceOutputReference(this, "source"); + public get source() { + return this._source; + } + public putSource(value: CaeComponentSpecSource) { + this._source.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component huaweicloud_cae_component} +*/ +export class CaeComponent extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cae_component"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CaeComponent resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CaeComponent to import + * @param importFromId The id of the existing CaeComponent that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CaeComponent to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cae_component", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cae_component huaweicloud_cae_component} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CaeComponentConfig + */ + public constructor(scope: Construct, id: string, config: CaeComponentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cae_component', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._environmentId = config.environmentId; + this._id = config.id; + this._region = config.region; + this._metadata.internalValue = config.metadata; + this._spec.internalValue = config.spec; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // metadata - computed: false, optional: false, required: true + private _metadata = new CaeComponentMetadataOutputReference(this, "metadata"); + public get metadata() { + return this._metadata; + } + public putMetadata(value: CaeComponentMetadata) { + this._metadata.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata.internalValue; + } + + // spec - computed: false, optional: false, required: true + private _spec = new CaeComponentSpecOutputReference(this, "spec"); + public get spec() { + return this._spec; + } + public putSpec(value: CaeComponentSpec) { + this._spec.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + metadata: caeComponentMetadataToTerraform(this._metadata.internalValue), + spec: caeComponentSpecToTerraform(this._spec.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: caeComponentMetadataToHclTerraform(this._metadata.internalValue), + isBlock: true, + type: "list", + storageClassType: "CaeComponentMetadataList", + }, + spec: { + value: caeComponentSpecToHclTerraform(this._spec.internalValue), + isBlock: true, + type: "list", + storageClassType: "CaeComponentSpecList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/README.md b/src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/README.md new file mode 100644 index 00000000..9c9e96df --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbh_asset_agency_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbh_asset_agency_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization). diff --git a/src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/index.ts b/src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/index.ts new file mode 100644 index 00000000..ec45a899 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbh-asset-agency-authorization/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbhAssetAgencyAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization#csms CbhAssetAgencyAuthorization#csms} + */ + readonly csms: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization#id CbhAssetAgencyAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization#kms CbhAssetAgencyAuthorization#kms} + */ + readonly kms: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization#region CbhAssetAgencyAuthorization#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization huaweicloud_cbh_asset_agency_authorization} +*/ +export class CbhAssetAgencyAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbh_asset_agency_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbhAssetAgencyAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbhAssetAgencyAuthorization to import + * @param importFromId The id of the existing CbhAssetAgencyAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbhAssetAgencyAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbh_asset_agency_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_asset_agency_authorization huaweicloud_cbh_asset_agency_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbhAssetAgencyAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: CbhAssetAgencyAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbh_asset_agency_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._csms = config.csms; + this._id = config.id; + this._kms = config.kms; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // csms - computed: false, optional: false, required: true + private _csms?: boolean | cdktf.IResolvable; + public get csms() { + return this.getBooleanAttribute('csms'); + } + public set csms(value: boolean | cdktf.IResolvable) { + this._csms = value; + } + // Temporarily expose input value. Use with caution. + public get csmsInput() { + return this._csms; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kms - computed: false, optional: false, required: true + private _kms?: boolean | cdktf.IResolvable; + public get kms() { + return this.getBooleanAttribute('kms'); + } + public set kms(value: boolean | cdktf.IResolvable) { + this._kms = value; + } + // Temporarily expose input value. Use with caution. + public get kmsInput() { + return this._kms; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + csms: cdktf.booleanToTerraform(this._csms), + id: cdktf.stringToTerraform(this._id), + kms: cdktf.booleanToTerraform(this._kms), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + csms: { + value: cdktf.booleanToHclTerraform(this._csms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms: { + value: cdktf.booleanToHclTerraform(this._kms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbh-ha-instance/README.md b/src/constructs/providers/huaweicloud/cbh-ha-instance/README.md new file mode 100644 index 00000000..ce42dd42 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbh-ha-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbh_ha_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbh_ha_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance). diff --git a/src/constructs/providers/huaweicloud/cbh-ha-instance/index.ts b/src/constructs/providers/huaweicloud/cbh-ha-instance/index.ts new file mode 100644 index 00000000..09b19779 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbh-ha-instance/index.ts @@ -0,0 +1,961 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbhHaInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the size of the additional data disk for the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#attach_disk_size CbhHaInstance#attach_disk_size} + */ + readonly attachDiskSize?: number; + /** + * Specifies whether auto renew is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#auto_renew CbhHaInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Specifies the charging mode of the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#charging_mode CbhHaInstance#charging_mode} + */ + readonly chargingMode: string; + /** + * Specifies the enterprise project ID to which the CBH HA instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#enterprise_project_id CbhHaInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the product ID of the CBH server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#flavor_id CbhHaInstance#flavor_id} + */ + readonly flavorId: string; + /** + * Specifies the floating IP address of the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#floating_ip CbhHaInstance#floating_ip} + */ + readonly floatingIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#id CbhHaInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the IPv6 network is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#ipv6_enable CbhHaInstance#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Specifies the availability zone name of the master instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#master_availability_zone CbhHaInstance#master_availability_zone} + */ + readonly masterAvailabilityZone: string; + /** + * Specifies the private IP address of the master instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#master_private_ip CbhHaInstance#master_private_ip} + */ + readonly masterPrivateIp?: string; + /** + * Specifies the name of the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#name CbhHaInstance#name} + */ + readonly name: string; + /** + * Specifies the password for logging in to the management console. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#password CbhHaInstance#password} + */ + readonly password: string; + /** + * Specifies the charging period of the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#period CbhHaInstance#period} + */ + readonly period: number; + /** + * Specifies the charging period unit of the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#period_unit CbhHaInstance#period_unit} + */ + readonly periodUnit: string; + /** + * Specifies the power action after the CBH HA instance is created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#power_action CbhHaInstance#power_action} + */ + readonly powerAction?: string; + /** + * Specifies the ID of the elastic IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#public_ip_id CbhHaInstance#public_ip_id} + */ + readonly publicIpId?: string; + /** + * Specifies the region in which to create the CBH HA instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#region CbhHaInstance#region} + */ + readonly region?: string; + /** + * Specifies the IDs of the security group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#security_group_id CbhHaInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Specifies the availability zone name of the slave instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#slave_availability_zone CbhHaInstance#slave_availability_zone} + */ + readonly slaveAvailabilityZone: string; + /** + * Specifies the private IP address of the slave instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#slave_private_ip CbhHaInstance#slave_private_ip} + */ + readonly slavePrivateIp?: string; + /** + * Specifies the ID of a subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#subnet_id CbhHaInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#tags CbhHaInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the ID of a VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#vpc_id CbhHaInstance#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#timeouts CbhHaInstance#timeouts} + */ + readonly timeouts?: CbhHaInstanceTimeouts; +} +export interface CbhHaInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#create CbhHaInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#delete CbhHaInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#update CbhHaInstance#update} + */ + readonly update?: string; +} + +export function cbhHaInstanceTimeoutsToTerraform(struct?: CbhHaInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cbhHaInstanceTimeoutsToHclTerraform(struct?: CbhHaInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbhHaInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CbhHaInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbhHaInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance huaweicloud_cbh_ha_instance} +*/ +export class CbhHaInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbh_ha_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbhHaInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbhHaInstance to import + * @param importFromId The id of the existing CbhHaInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbhHaInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbh_ha_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_ha_instance huaweicloud_cbh_ha_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbhHaInstanceConfig + */ + public constructor(scope: Construct, id: string, config: CbhHaInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbh_ha_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachDiskSize = config.attachDiskSize; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._floatingIp = config.floatingIp; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._masterAvailabilityZone = config.masterAvailabilityZone; + this._masterPrivateIp = config.masterPrivateIp; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._powerAction = config.powerAction; + this._publicIpId = config.publicIpId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._slaveAvailabilityZone = config.slaveAvailabilityZone; + this._slavePrivateIp = config.slavePrivateIp; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attach_disk_size - computed: false, optional: true, required: false + private _attachDiskSize?: number; + public get attachDiskSize() { + return this.getNumberAttribute('attach_disk_size'); + } + public set attachDiskSize(value: number) { + this._attachDiskSize = value; + } + public resetAttachDiskSize() { + this._attachDiskSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachDiskSizeInput() { + return this._attachDiskSize; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // data_disk_size - computed: true, optional: false, required: false + public get dataDiskSize() { + return this.getNumberAttribute('data_disk_size'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // floating_ip - computed: true, optional: true, required: false + private _floatingIp?: string; + public get floatingIp() { + return this.getStringAttribute('floating_ip'); + } + public set floatingIp(value: string) { + this._floatingIp = value; + } + public resetFloatingIp() { + this._floatingIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpInput() { + return this._floatingIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // master_availability_zone - computed: false, optional: false, required: true + private _masterAvailabilityZone?: string; + public get masterAvailabilityZone() { + return this.getStringAttribute('master_availability_zone'); + } + public set masterAvailabilityZone(value: string) { + this._masterAvailabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get masterAvailabilityZoneInput() { + return this._masterAvailabilityZone; + } + + // master_id - computed: true, optional: false, required: false + public get masterId() { + return this.getStringAttribute('master_id'); + } + + // master_private_ip - computed: true, optional: true, required: false + private _masterPrivateIp?: string; + public get masterPrivateIp() { + return this.getStringAttribute('master_private_ip'); + } + public set masterPrivateIp(value: string) { + this._masterPrivateIp = value; + } + public resetMasterPrivateIp() { + this._masterPrivateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterPrivateIpInput() { + return this._masterPrivateIp; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // power_action - computed: false, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // public_ip_id - computed: false, optional: true, required: false + private _publicIpId?: string; + public get publicIpId() { + return this.getStringAttribute('public_ip_id'); + } + public set publicIpId(value: string) { + this._publicIpId = value; + } + public resetPublicIpId() { + this._publicIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpIdInput() { + return this._publicIpId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // slave_availability_zone - computed: false, optional: false, required: true + private _slaveAvailabilityZone?: string; + public get slaveAvailabilityZone() { + return this.getStringAttribute('slave_availability_zone'); + } + public set slaveAvailabilityZone(value: string) { + this._slaveAvailabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get slaveAvailabilityZoneInput() { + return this._slaveAvailabilityZone; + } + + // slave_id - computed: true, optional: false, required: false + public get slaveId() { + return this.getStringAttribute('slave_id'); + } + + // slave_private_ip - computed: true, optional: true, required: false + private _slavePrivateIp?: string; + public get slavePrivateIp() { + return this.getStringAttribute('slave_private_ip'); + } + public set slavePrivateIp(value: string) { + this._slavePrivateIp = value; + } + public resetSlavePrivateIp() { + this._slavePrivateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get slavePrivateIpInput() { + return this._slavePrivateIp; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CbhHaInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CbhHaInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attach_disk_size: cdktf.numberToTerraform(this._attachDiskSize), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + floating_ip: cdktf.stringToTerraform(this._floatingIp), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + master_availability_zone: cdktf.stringToTerraform(this._masterAvailabilityZone), + master_private_ip: cdktf.stringToTerraform(this._masterPrivateIp), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + power_action: cdktf.stringToTerraform(this._powerAction), + public_ip_id: cdktf.stringToTerraform(this._publicIpId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + slave_availability_zone: cdktf.stringToTerraform(this._slaveAvailabilityZone), + slave_private_ip: cdktf.stringToTerraform(this._slavePrivateIp), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: cbhHaInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attach_disk_size: { + value: cdktf.numberToHclTerraform(this._attachDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip: { + value: cdktf.stringToHclTerraform(this._floatingIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + master_availability_zone: { + value: cdktf.stringToHclTerraform(this._masterAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + master_private_ip: { + value: cdktf.stringToHclTerraform(this._masterPrivateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip_id: { + value: cdktf.stringToHclTerraform(this._publicIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slave_availability_zone: { + value: cdktf.stringToHclTerraform(this._slaveAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slave_private_ip: { + value: cdktf.stringToHclTerraform(this._slavePrivateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cbhHaInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CbhHaInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbh-instance/README.md b/src/constructs/providers/huaweicloud/cbh-instance/README.md new file mode 100644 index 00000000..bfa64a0e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbh-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbh_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbh_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance). diff --git a/src/constructs/providers/huaweicloud/cbh-instance/index.ts b/src/constructs/providers/huaweicloud/cbh-instance/index.ts new file mode 100644 index 00000000..44b96268 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbh-instance/index.ts @@ -0,0 +1,892 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbhInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the size of the additional data disk for the CBH instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#attach_disk_size CbhInstance#attach_disk_size} + */ + readonly attachDiskSize?: number; + /** + * Specifies whether auto renew is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#auto_renew CbhInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Specifies the availability zone name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#availability_zone CbhInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Specifies the charging mode of the CBH instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#charging_mode CbhInstance#charging_mode} + */ + readonly chargingMode: string; + /** + * Specifies the enterprise project ID to which the CBH instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#enterprise_project_id CbhInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the product ID of the CBH server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#flavor_id CbhInstance#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#id CbhInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the IPv6 network is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#ipv6_enable CbhInstance#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Specifies the name of the CBH instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#name CbhInstance#name} + */ + readonly name: string; + /** + * Specifies the password for logging in to the management console. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#password CbhInstance#password} + */ + readonly password: string; + /** + * Specifies the charging period of the CBH instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#period CbhInstance#period} + */ + readonly period: number; + /** + * Specifies the charging period unit of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#period_unit CbhInstance#period_unit} + */ + readonly periodUnit: string; + /** + * Specifies the power action after the CBH instance is created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#power_action CbhInstance#power_action} + */ + readonly powerAction?: string; + /** + * schema: Computed; The elastic IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#public_ip CbhInstance#public_ip} + */ + readonly publicIp?: string; + /** + * Specifies the ID of the elastic IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#public_ip_id CbhInstance#public_ip_id} + */ + readonly publicIpId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#region CbhInstance#region} + */ + readonly region?: string; + /** + * Specifies the IDs of the security group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#security_group_id CbhInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Specifies the IP address of the subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#subnet_address CbhInstance#subnet_address} + */ + readonly subnetAddress?: string; + /** + * Specifies the ID of a subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#subnet_id CbhInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#tags CbhInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the ID of a VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#vpc_id CbhInstance#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#timeouts CbhInstance#timeouts} + */ + readonly timeouts?: CbhInstanceTimeouts; +} +export interface CbhInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#create CbhInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#delete CbhInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#update CbhInstance#update} + */ + readonly update?: string; +} + +export function cbhInstanceTimeoutsToTerraform(struct?: CbhInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cbhInstanceTimeoutsToHclTerraform(struct?: CbhInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbhInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CbhInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbhInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance huaweicloud_cbh_instance} +*/ +export class CbhInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbh_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbhInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbhInstance to import + * @param importFromId The id of the existing CbhInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbhInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbh_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbh_instance huaweicloud_cbh_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbhInstanceConfig + */ + public constructor(scope: Construct, id: string, config: CbhInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbh_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachDiskSize = config.attachDiskSize; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._powerAction = config.powerAction; + this._publicIp = config.publicIp; + this._publicIpId = config.publicIpId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetAddress = config.subnetAddress; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attach_disk_size - computed: false, optional: true, required: false + private _attachDiskSize?: number; + public get attachDiskSize() { + return this.getNumberAttribute('attach_disk_size'); + } + public set attachDiskSize(value: number) { + this._attachDiskSize = value; + } + public resetAttachDiskSize() { + this._attachDiskSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachDiskSizeInput() { + return this._attachDiskSize; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // data_disk_size - computed: true, optional: false, required: false + public get dataDiskSize() { + return this.getNumberAttribute('data_disk_size'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // power_action - computed: false, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // public_ip_id - computed: false, optional: true, required: false + private _publicIpId?: string; + public get publicIpId() { + return this.getStringAttribute('public_ip_id'); + } + public set publicIpId(value: string) { + this._publicIpId = value; + } + public resetPublicIpId() { + this._publicIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpIdInput() { + return this._publicIpId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_address - computed: true, optional: true, required: false + private _subnetAddress?: string; + public get subnetAddress() { + return this.getStringAttribute('subnet_address'); + } + public set subnetAddress(value: string) { + this._subnetAddress = value; + } + public resetSubnetAddress() { + this._subnetAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetAddressInput() { + return this._subnetAddress; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CbhInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CbhInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attach_disk_size: cdktf.numberToTerraform(this._attachDiskSize), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + power_action: cdktf.stringToTerraform(this._powerAction), + public_ip: cdktf.stringToTerraform(this._publicIp), + public_ip_id: cdktf.stringToTerraform(this._publicIpId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_address: cdktf.stringToTerraform(this._subnetAddress), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: cbhInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attach_disk_size: { + value: cdktf.numberToHclTerraform(this._attachDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip_id: { + value: cdktf.stringToHclTerraform(this._publicIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_address: { + value: cdktf.stringToHclTerraform(this._subnetAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cbhInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CbhInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbr-backup-share-accepter/README.md b/src/constructs/providers/huaweicloud/cbr-backup-share-accepter/README.md new file mode 100644 index 00000000..d7ac6039 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-backup-share-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbr_backup_share_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbr_backup_share_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter). diff --git a/src/constructs/providers/huaweicloud/cbr-backup-share-accepter/index.ts b/src/constructs/providers/huaweicloud/cbr-backup-share-accepter/index.ts new file mode 100644 index 00000000..a698b23f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-backup-share-accepter/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbrBackupShareAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the shared source backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter#backup_id CbrBackupShareAccepter#backup_id} + */ + readonly backupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter#id CbrBackupShareAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the backup will be stored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter#region CbrBackupShareAccepter#region} + */ + readonly region?: string; + /** + * The ID of the vault which the backup will be stored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter#vault_id CbrBackupShareAccepter#vault_id} + */ + readonly vaultId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter huaweicloud_cbr_backup_share_accepter} +*/ +export class CbrBackupShareAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_backup_share_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbrBackupShareAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbrBackupShareAccepter to import + * @param importFromId The id of the existing CbrBackupShareAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbrBackupShareAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_backup_share_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share_accepter huaweicloud_cbr_backup_share_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbrBackupShareAccepterConfig + */ + public constructor(scope: Construct, id: string, config: CbrBackupShareAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_backup_share_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._id = config.id; + this._region = config.region; + this._vaultId = config.vaultId; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_project_id - computed: true, optional: false, required: false + public get sourceProjectId() { + return this.getStringAttribute('source_project_id'); + } + + // vault_id - computed: false, optional: false, required: true + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vault_id: cdktf.stringToTerraform(this._vaultId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbr-backup-share/README.md b/src/constructs/providers/huaweicloud/cbr-backup-share/README.md new file mode 100644 index 00000000..4d063929 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-backup-share/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbr_backup_share` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbr_backup_share`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share). diff --git a/src/constructs/providers/huaweicloud/cbr-backup-share/index.ts b/src/constructs/providers/huaweicloud/cbr-backup-share/index.ts new file mode 100644 index 00000000..a38eef2e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-backup-share/index.ts @@ -0,0 +1,345 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbrBackupShareConfig extends cdktf.TerraformMetaArguments { + /** + * The backup ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share#backup_id CbrBackupShare#backup_id} + */ + readonly backupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share#id CbrBackupShare#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the shared backup is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share#region CbrBackupShare#region} + */ + readonly region?: string; + /** + * members block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share#members CbrBackupShare#members} + */ + readonly members: CbrBackupShareMembers[] | cdktf.IResolvable; +} +export interface CbrBackupShareMembers { + /** + * The ID of the project with which the backup is shared. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share#dest_project_id CbrBackupShare#dest_project_id} + */ + readonly destProjectId: string; +} + +export function cbrBackupShareMembersToTerraform(struct?: CbrBackupShareMembers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_project_id: cdktf.stringToTerraform(struct!.destProjectId), + } +} + + +export function cbrBackupShareMembersToHclTerraform(struct?: CbrBackupShareMembers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_project_id: { + value: cdktf.stringToHclTerraform(struct!.destProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrBackupShareMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CbrBackupShareMembers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destProjectId !== undefined) { + hasAnyValues = true; + internalValueResult.destProjectId = this._destProjectId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrBackupShareMembers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destProjectId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destProjectId = value.destProjectId; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dest_project_id - computed: false, optional: false, required: true + private _destProjectId?: string; + public get destProjectId() { + return this.getStringAttribute('dest_project_id'); + } + public set destProjectId(value: string) { + this._destProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get destProjectIdInput() { + return this._destProjectId; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vault_id - computed: true, optional: false, required: false + public get vaultId() { + return this.getStringAttribute('vault_id'); + } +} + +export class CbrBackupShareMembersList extends cdktf.ComplexList { + public internalValue? : CbrBackupShareMembers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CbrBackupShareMembersOutputReference { + return new CbrBackupShareMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share huaweicloud_cbr_backup_share} +*/ +export class CbrBackupShare extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_backup_share"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbrBackupShare resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbrBackupShare to import + * @param importFromId The id of the existing CbrBackupShare that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbrBackupShare to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_backup_share", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_backup_share huaweicloud_cbr_backup_share} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbrBackupShareConfig + */ + public constructor(scope: Construct, id: string, config: CbrBackupShareConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_backup_share', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._id = config.id; + this._region = config.region; + this._members.internalValue = config.members; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // members - computed: false, optional: false, required: true + private _members = new CbrBackupShareMembersList(this, "members", true); + public get members() { + return this._members; + } + public putMembers(value: CbrBackupShareMembers[] | cdktf.IResolvable) { + this._members.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get membersInput() { + return this._members.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + members: cdktf.listMapper(cbrBackupShareMembersToTerraform, true)(this._members.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + members: { + value: cdktf.listMapperHcl(cbrBackupShareMembersToHclTerraform, true)(this._members.internalValue), + isBlock: true, + type: "set", + storageClassType: "CbrBackupShareMembersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbr-checkpoint/README.md b/src/constructs/providers/huaweicloud/cbr-checkpoint/README.md new file mode 100644 index 00000000..3c5fca8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-checkpoint/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbr_checkpoint` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbr_checkpoint`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint). diff --git a/src/constructs/providers/huaweicloud/cbr-checkpoint/index.ts b/src/constructs/providers/huaweicloud/cbr-checkpoint/index.ts new file mode 100644 index 00000000..834d4bee --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-checkpoint/index.ts @@ -0,0 +1,626 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbrCheckpointConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the checkpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#description CbrCheckpoint#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#id CbrCheckpoint#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether the backups are incremental backups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#incremental CbrCheckpoint#incremental} + */ + readonly incremental?: boolean | cdktf.IResolvable; + /** + * The name of the checkpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#name CbrCheckpoint#name} + */ + readonly name: string; + /** + * The region where the vault and backup resources are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#region CbrCheckpoint#region} + */ + readonly region?: string; + /** + * The ID of the vault where the checkpoint to create. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#vault_id CbrCheckpoint#vault_id} + */ + readonly vaultId: string; + /** + * backups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#backups CbrCheckpoint#backups} + */ + readonly backups: CbrCheckpointBackups[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#timeouts CbrCheckpoint#timeouts} + */ + readonly timeouts?: CbrCheckpointTimeouts; +} +export interface CbrCheckpointBackups { + /** + * The ID of backup resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#resource_id CbrCheckpoint#resource_id} + */ + readonly resourceId: string; + /** + * The type of the backup resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#type CbrCheckpoint#type} + */ + readonly type: string; +} + +export function cbrCheckpointBackupsToTerraform(struct?: CbrCheckpointBackups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_id: cdktf.stringToTerraform(struct!.resourceId), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cbrCheckpointBackupsToHclTerraform(struct?: CbrCheckpointBackups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrCheckpointBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CbrCheckpointBackups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrCheckpointBackups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._resourceId = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._resourceId = value.resourceId; + this._type = value.type; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // protected_at - computed: true, optional: false, required: false + public get protectedAt() { + return this.getStringAttribute('protected_at'); + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_size - computed: true, optional: false, required: false + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class CbrCheckpointBackupsList extends cdktf.ComplexList { + public internalValue? : CbrCheckpointBackups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CbrCheckpointBackupsOutputReference { + return new CbrCheckpointBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CbrCheckpointTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#create CbrCheckpoint#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#delete CbrCheckpoint#delete} + */ + readonly delete?: string; +} + +export function cbrCheckpointTimeoutsToTerraform(struct?: CbrCheckpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cbrCheckpointTimeoutsToHclTerraform(struct?: CbrCheckpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrCheckpointTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CbrCheckpointTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrCheckpointTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint huaweicloud_cbr_checkpoint} +*/ +export class CbrCheckpoint extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_checkpoint"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbrCheckpoint resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbrCheckpoint to import + * @param importFromId The id of the existing CbrCheckpoint that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbrCheckpoint to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_checkpoint", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_checkpoint huaweicloud_cbr_checkpoint} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbrCheckpointConfig + */ + public constructor(scope: Construct, id: string, config: CbrCheckpointConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_checkpoint', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._incremental = config.incremental; + this._name = config.name; + this._region = config.region; + this._vaultId = config.vaultId; + this._backups.internalValue = config.backups; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // incremental - computed: false, optional: true, required: false + private _incremental?: boolean | cdktf.IResolvable; + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + public set incremental(value: boolean | cdktf.IResolvable) { + this._incremental = value; + } + public resetIncremental() { + this._incremental = undefined; + } + // Temporarily expose input value. Use with caution. + public get incrementalInput() { + return this._incremental; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vault_id - computed: false, optional: false, required: true + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // backups - computed: false, optional: false, required: true + private _backups = new CbrCheckpointBackupsList(this, "backups", true); + public get backups() { + return this._backups; + } + public putBackups(value: CbrCheckpointBackups[] | cdktf.IResolvable) { + this._backups.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get backupsInput() { + return this._backups.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CbrCheckpointTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CbrCheckpointTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + incremental: cdktf.booleanToTerraform(this._incremental), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vault_id: cdktf.stringToTerraform(this._vaultId), + backups: cdktf.listMapper(cbrCheckpointBackupsToTerraform, true)(this._backups.internalValue), + timeouts: cbrCheckpointTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + incremental: { + value: cdktf.booleanToHclTerraform(this._incremental), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backups: { + value: cdktf.listMapperHcl(cbrCheckpointBackupsToHclTerraform, true)(this._backups.internalValue), + isBlock: true, + type: "set", + storageClassType: "CbrCheckpointBackupsList", + }, + timeouts: { + value: cbrCheckpointTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CbrCheckpointTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbr-policy/README.md b/src/constructs/providers/huaweicloud/cbr-policy/README.md new file mode 100644 index 00000000..faf36da8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbr_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbr_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy). diff --git a/src/constructs/providers/huaweicloud/cbr-policy/index.ts b/src/constructs/providers/huaweicloud/cbr-policy/index.ts new file mode 100644 index 00000000..5039e4ef --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-policy/index.ts @@ -0,0 +1,846 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbrPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The maximum number of retained backups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#backup_quantity CbrPolicy#backup_quantity} + */ + readonly backupQuantity?: number; + /** + * The ID of the replication destination project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#destination_project_id CbrPolicy#destination_project_id} + */ + readonly destinationProjectId?: string; + /** + * The name of the replication destination region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#destination_region CbrPolicy#destination_region} + */ + readonly destinationRegion?: string; + /** + * Whether to enable the acceleration function to shorten the replication time for cross-region + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#enable_acceleration CbrPolicy#enable_acceleration} + */ + readonly enableAcceleration?: boolean | cdktf.IResolvable; + /** + * Whether to enable the CBR policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#enabled CbrPolicy#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#id CbrPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The policy name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#name CbrPolicy#name} + */ + readonly name: string; + /** + * The region where the policy is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#region CbrPolicy#region} + */ + readonly region?: string; + /** + * The duration (in days) for retained backups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#time_period CbrPolicy#time_period} + */ + readonly timePeriod?: number; + /** + * The UTC time zone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#time_zone CbrPolicy#time_zone} + */ + readonly timeZone?: string; + /** + * The protection type of the CBR policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#type CbrPolicy#type} + */ + readonly type: string; + /** + * backup_cycle block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#backup_cycle CbrPolicy#backup_cycle} + */ + readonly backupCycle: CbrPolicyBackupCycle; + /** + * long_term_retention block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#long_term_retention CbrPolicy#long_term_retention} + */ + readonly longTermRetention?: CbrPolicyLongTermRetention; +} +export interface CbrPolicyBackupCycle { + /** + * The weekly backup time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#days CbrPolicy#days} + */ + readonly days?: string; + /** + * The execution time of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#execution_times CbrPolicy#execution_times} + */ + readonly executionTimes: string[]; + /** + * The number of days between each backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#interval CbrPolicy#interval} + */ + readonly interval?: number; +} + +export function cbrPolicyBackupCycleToTerraform(struct?: CbrPolicyBackupCycleOutputReference | CbrPolicyBackupCycle): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days: cdktf.stringToTerraform(struct!.days), + execution_times: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.executionTimes), + interval: cdktf.numberToTerraform(struct!.interval), + } +} + + +export function cbrPolicyBackupCycleToHclTerraform(struct?: CbrPolicyBackupCycleOutputReference | CbrPolicyBackupCycle): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days: { + value: cdktf.stringToHclTerraform(struct!.days), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + execution_times: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.executionTimes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrPolicyBackupCycleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CbrPolicyBackupCycle | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._days !== undefined) { + hasAnyValues = true; + internalValueResult.days = this._days; + } + if (this._executionTimes !== undefined) { + hasAnyValues = true; + internalValueResult.executionTimes = this._executionTimes; + } + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrPolicyBackupCycle | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._days = undefined; + this._executionTimes = undefined; + this._interval = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._days = value.days; + this._executionTimes = value.executionTimes; + this._interval = value.interval; + } + } + + // days - computed: false, optional: true, required: false + private _days?: string; + public get days() { + return this.getStringAttribute('days'); + } + public set days(value: string) { + this._days = value; + } + public resetDays() { + this._days = undefined; + } + // Temporarily expose input value. Use with caution. + public get daysInput() { + return this._days; + } + + // execution_times - computed: false, optional: false, required: true + private _executionTimes?: string[]; + public get executionTimes() { + return this.getListAttribute('execution_times'); + } + public set executionTimes(value: string[]) { + this._executionTimes = value; + } + // Temporarily expose input value. Use with caution. + public get executionTimesInput() { + return this._executionTimes; + } + + // interval - computed: false, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } +} +export interface CbrPolicyLongTermRetention { + /** + * The latest backup of each day is saved in the long term. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#daily CbrPolicy#daily} + */ + readonly daily?: number; + /** + * How often (after how many incremental backups) a full backup is performed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#full_backup_interval CbrPolicy#full_backup_interval} + */ + readonly fullBackupInterval?: number; + /** + * The latest backup of each month is saved in the long term. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#monthly CbrPolicy#monthly} + */ + readonly monthly?: number; + /** + * The latest backup of each week is saved in the long term. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#weekly CbrPolicy#weekly} + */ + readonly weekly?: number; + /** + * The latest backup of each year is saved in the long term. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#yearly CbrPolicy#yearly} + */ + readonly yearly?: number; +} + +export function cbrPolicyLongTermRetentionToTerraform(struct?: CbrPolicyLongTermRetentionOutputReference | CbrPolicyLongTermRetention): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + daily: cdktf.numberToTerraform(struct!.daily), + full_backup_interval: cdktf.numberToTerraform(struct!.fullBackupInterval), + monthly: cdktf.numberToTerraform(struct!.monthly), + weekly: cdktf.numberToTerraform(struct!.weekly), + yearly: cdktf.numberToTerraform(struct!.yearly), + } +} + + +export function cbrPolicyLongTermRetentionToHclTerraform(struct?: CbrPolicyLongTermRetentionOutputReference | CbrPolicyLongTermRetention): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + daily: { + value: cdktf.numberToHclTerraform(struct!.daily), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + full_backup_interval: { + value: cdktf.numberToHclTerraform(struct!.fullBackupInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + monthly: { + value: cdktf.numberToHclTerraform(struct!.monthly), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + weekly: { + value: cdktf.numberToHclTerraform(struct!.weekly), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + yearly: { + value: cdktf.numberToHclTerraform(struct!.yearly), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrPolicyLongTermRetentionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CbrPolicyLongTermRetention | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._daily !== undefined) { + hasAnyValues = true; + internalValueResult.daily = this._daily; + } + if (this._fullBackupInterval !== undefined) { + hasAnyValues = true; + internalValueResult.fullBackupInterval = this._fullBackupInterval; + } + if (this._monthly !== undefined) { + hasAnyValues = true; + internalValueResult.monthly = this._monthly; + } + if (this._weekly !== undefined) { + hasAnyValues = true; + internalValueResult.weekly = this._weekly; + } + if (this._yearly !== undefined) { + hasAnyValues = true; + internalValueResult.yearly = this._yearly; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrPolicyLongTermRetention | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._daily = undefined; + this._fullBackupInterval = undefined; + this._monthly = undefined; + this._weekly = undefined; + this._yearly = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._daily = value.daily; + this._fullBackupInterval = value.fullBackupInterval; + this._monthly = value.monthly; + this._weekly = value.weekly; + this._yearly = value.yearly; + } + } + + // daily - computed: false, optional: true, required: false + private _daily?: number; + public get daily() { + return this.getNumberAttribute('daily'); + } + public set daily(value: number) { + this._daily = value; + } + public resetDaily() { + this._daily = undefined; + } + // Temporarily expose input value. Use with caution. + public get dailyInput() { + return this._daily; + } + + // full_backup_interval - computed: false, optional: true, required: false + private _fullBackupInterval?: number; + public get fullBackupInterval() { + return this.getNumberAttribute('full_backup_interval'); + } + public set fullBackupInterval(value: number) { + this._fullBackupInterval = value; + } + public resetFullBackupInterval() { + this._fullBackupInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get fullBackupIntervalInput() { + return this._fullBackupInterval; + } + + // monthly - computed: false, optional: true, required: false + private _monthly?: number; + public get monthly() { + return this.getNumberAttribute('monthly'); + } + public set monthly(value: number) { + this._monthly = value; + } + public resetMonthly() { + this._monthly = undefined; + } + // Temporarily expose input value. Use with caution. + public get monthlyInput() { + return this._monthly; + } + + // weekly - computed: false, optional: true, required: false + private _weekly?: number; + public get weekly() { + return this.getNumberAttribute('weekly'); + } + public set weekly(value: number) { + this._weekly = value; + } + public resetWeekly() { + this._weekly = undefined; + } + // Temporarily expose input value. Use with caution. + public get weeklyInput() { + return this._weekly; + } + + // yearly - computed: false, optional: true, required: false + private _yearly?: number; + public get yearly() { + return this.getNumberAttribute('yearly'); + } + public set yearly(value: number) { + this._yearly = value; + } + public resetYearly() { + this._yearly = undefined; + } + // Temporarily expose input value. Use with caution. + public get yearlyInput() { + return this._yearly; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy huaweicloud_cbr_policy} +*/ +export class CbrPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbrPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbrPolicy to import + * @param importFromId The id of the existing CbrPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbrPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_policy huaweicloud_cbr_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbrPolicyConfig + */ + public constructor(scope: Construct, id: string, config: CbrPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupQuantity = config.backupQuantity; + this._destinationProjectId = config.destinationProjectId; + this._destinationRegion = config.destinationRegion; + this._enableAcceleration = config.enableAcceleration; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timePeriod = config.timePeriod; + this._timeZone = config.timeZone; + this._type = config.type; + this._backupCycle.internalValue = config.backupCycle; + this._longTermRetention.internalValue = config.longTermRetention; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_quantity - computed: false, optional: true, required: false + private _backupQuantity?: number; + public get backupQuantity() { + return this.getNumberAttribute('backup_quantity'); + } + public set backupQuantity(value: number) { + this._backupQuantity = value; + } + public resetBackupQuantity() { + this._backupQuantity = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupQuantityInput() { + return this._backupQuantity; + } + + // destination_project_id - computed: false, optional: true, required: false + private _destinationProjectId?: string; + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + public set destinationProjectId(value: string) { + this._destinationProjectId = value; + } + public resetDestinationProjectId() { + this._destinationProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationProjectIdInput() { + return this._destinationProjectId; + } + + // destination_region - computed: false, optional: true, required: false + private _destinationRegion?: string; + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + public set destinationRegion(value: string) { + this._destinationRegion = value; + } + public resetDestinationRegion() { + this._destinationRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationRegionInput() { + return this._destinationRegion; + } + + // enable_acceleration - computed: false, optional: true, required: false + private _enableAcceleration?: boolean | cdktf.IResolvable; + public get enableAcceleration() { + return this.getBooleanAttribute('enable_acceleration'); + } + public set enableAcceleration(value: boolean | cdktf.IResolvable) { + this._enableAcceleration = value; + } + public resetEnableAcceleration() { + this._enableAcceleration = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAccelerationInput() { + return this._enableAcceleration; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // time_period - computed: false, optional: true, required: false + private _timePeriod?: number; + public get timePeriod() { + return this.getNumberAttribute('time_period'); + } + public set timePeriod(value: number) { + this._timePeriod = value; + } + public resetTimePeriod() { + this._timePeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get timePeriodInput() { + return this._timePeriod; + } + + // time_zone - computed: true, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // backup_cycle - computed: false, optional: false, required: true + private _backupCycle = new CbrPolicyBackupCycleOutputReference(this, "backup_cycle"); + public get backupCycle() { + return this._backupCycle; + } + public putBackupCycle(value: CbrPolicyBackupCycle) { + this._backupCycle.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get backupCycleInput() { + return this._backupCycle.internalValue; + } + + // long_term_retention - computed: false, optional: true, required: false + private _longTermRetention = new CbrPolicyLongTermRetentionOutputReference(this, "long_term_retention"); + public get longTermRetention() { + return this._longTermRetention; + } + public putLongTermRetention(value: CbrPolicyLongTermRetention) { + this._longTermRetention.internalValue = value; + } + public resetLongTermRetention() { + this._longTermRetention.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get longTermRetentionInput() { + return this._longTermRetention.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_quantity: cdktf.numberToTerraform(this._backupQuantity), + destination_project_id: cdktf.stringToTerraform(this._destinationProjectId), + destination_region: cdktf.stringToTerraform(this._destinationRegion), + enable_acceleration: cdktf.booleanToTerraform(this._enableAcceleration), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + time_period: cdktf.numberToTerraform(this._timePeriod), + time_zone: cdktf.stringToTerraform(this._timeZone), + type: cdktf.stringToTerraform(this._type), + backup_cycle: cbrPolicyBackupCycleToTerraform(this._backupCycle.internalValue), + long_term_retention: cbrPolicyLongTermRetentionToTerraform(this._longTermRetention.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_quantity: { + value: cdktf.numberToHclTerraform(this._backupQuantity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + destination_project_id: { + value: cdktf.stringToHclTerraform(this._destinationProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_region: { + value: cdktf.stringToHclTerraform(this._destinationRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_acceleration: { + value: cdktf.booleanToHclTerraform(this._enableAcceleration), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_period: { + value: cdktf.numberToHclTerraform(this._timePeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_cycle: { + value: cbrPolicyBackupCycleToHclTerraform(this._backupCycle.internalValue), + isBlock: true, + type: "list", + storageClassType: "CbrPolicyBackupCycleList", + }, + long_term_retention: { + value: cbrPolicyLongTermRetentionToHclTerraform(this._longTermRetention.internalValue), + isBlock: true, + type: "list", + storageClassType: "CbrPolicyLongTermRetentionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cbr-vault/README.md b/src/constructs/providers/huaweicloud/cbr-vault/README.md new file mode 100644 index 00000000..7f9ba1f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-vault/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cbr_vault` + +Refer to the Terraform Registry for docs: [`huaweicloud_cbr_vault`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault). diff --git a/src/constructs/providers/huaweicloud/cbr-vault/index.ts b/src/constructs/providers/huaweicloud/cbr-vault/index.ts new file mode 100644 index 00000000..72ad979c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cbr-vault/index.ts @@ -0,0 +1,1245 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CbrVaultConfig extends cdktf.TerraformMetaArguments { + /** + * Whether automatic association is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#auto_bind CbrVault#auto_bind} + */ + readonly autoBind?: boolean | cdktf.IResolvable; + /** + * Whether to enable auto capacity expansion for the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#auto_expand CbrVault#auto_expand} + */ + readonly autoExpand?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#auto_pay CbrVault#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#auto_renew CbrVault#auto_renew} + */ + readonly autoRenew?: string; + /** + * The backup name prefix. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#backup_name_prefix CbrVault#backup_name_prefix} + */ + readonly backupNamePrefix?: string; + /** + * The rules for automatic association. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#bind_rules CbrVault#bind_rules} + */ + readonly bindRules?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#charging_mode CbrVault#charging_mode} + */ + readonly chargingMode?: string; + /** + * The consistent level (specification) of the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#consistent_level CbrVault#consistent_level} + */ + readonly consistentLevel?: string; + /** + * The enterprise project ID to which the vault belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#enterprise_project_id CbrVault#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#id CbrVault#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether multiple availability zones are used for backing up. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#is_multi_az CbrVault#is_multi_az} + */ + readonly isMultiAz?: boolean | cdktf.IResolvable; + /** + * The vault name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#name CbrVault#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#period CbrVault#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#period_unit CbrVault#period_unit} + */ + readonly periodUnit?: string; + /** + * schema:Deprecated; Using parameter 'policy' instead. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#policy_id CbrVault#policy_id} + */ + readonly policyId?: string; + /** + * The protection type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#protection_type CbrVault#protection_type} + */ + readonly protectionType: string; + /** + * The region where the vault is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#region CbrVault#region} + */ + readonly region?: string; + /** + * The capacity of the vault, in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#size CbrVault#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#tags CbrVault#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The vault type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#type CbrVault#type} + */ + readonly type: string; + /** + * policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#policy CbrVault#policy} + */ + readonly policy?: CbrVaultPolicy[] | cdktf.IResolvable; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#resources CbrVault#resources} + */ + readonly resources?: CbrVaultResources[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#timeouts CbrVault#timeouts} + */ + readonly timeouts?: CbrVaultTimeouts; +} +export interface CbrVaultPolicy { + /** + * The ID of destination vault to which the replication policy will associated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#destination_vault_id CbrVault#destination_vault_id} + */ + readonly destinationVaultId?: string; + /** + * The policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#id CbrVault#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function cbrVaultPolicyToTerraform(struct?: CbrVaultPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + destination_vault_id: cdktf.stringToTerraform(struct!.destinationVaultId), + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function cbrVaultPolicyToHclTerraform(struct?: CbrVaultPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + destination_vault_id: { + value: cdktf.stringToHclTerraform(struct!.destinationVaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrVaultPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CbrVaultPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destinationVaultId !== undefined) { + hasAnyValues = true; + internalValueResult.destinationVaultId = this._destinationVaultId; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrVaultPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destinationVaultId = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destinationVaultId = value.destinationVaultId; + this._id = value.id; + } + } + + // destination_vault_id - computed: false, optional: true, required: false + private _destinationVaultId?: string; + public get destinationVaultId() { + return this.getStringAttribute('destination_vault_id'); + } + public set destinationVaultId(value: string) { + this._destinationVaultId = value; + } + public resetDestinationVaultId() { + this._destinationVaultId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationVaultIdInput() { + return this._destinationVaultId; + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } +} + +export class CbrVaultPolicyList extends cdktf.ComplexList { + public internalValue? : CbrVaultPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CbrVaultPolicyOutputReference { + return new CbrVaultPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CbrVaultResources { + /** + * The array of disk IDs which will be excluded in the backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#excludes CbrVault#excludes} + */ + readonly excludes?: string[]; + /** + * The array of disk or SFS file systems which will be included in the backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#includes CbrVault#includes} + */ + readonly includes?: string[]; + /** + * The ID of the ECS instance to be backed up. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#server_id CbrVault#server_id} + */ + readonly serverId?: string; +} + +export function cbrVaultResourcesToTerraform(struct?: CbrVaultResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + excludes: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.excludes), + includes: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.includes), + server_id: cdktf.stringToTerraform(struct!.serverId), + } +} + + +export function cbrVaultResourcesToHclTerraform(struct?: CbrVaultResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + excludes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.excludes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + includes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.includes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + server_id: { + value: cdktf.stringToHclTerraform(struct!.serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrVaultResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CbrVaultResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._excludes !== undefined) { + hasAnyValues = true; + internalValueResult.excludes = this._excludes; + } + if (this._includes !== undefined) { + hasAnyValues = true; + internalValueResult.includes = this._includes; + } + if (this._serverId !== undefined) { + hasAnyValues = true; + internalValueResult.serverId = this._serverId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrVaultResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._excludes = undefined; + this._includes = undefined; + this._serverId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._excludes = value.excludes; + this._includes = value.includes; + this._serverId = value.serverId; + } + } + + // excludes - computed: true, optional: true, required: false + private _excludes?: string[]; + public get excludes() { + return cdktf.Fn.tolist(this.getListAttribute('excludes')); + } + public set excludes(value: string[]) { + this._excludes = value; + } + public resetExcludes() { + this._excludes = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludesInput() { + return this._excludes; + } + + // includes - computed: true, optional: true, required: false + private _includes?: string[]; + public get includes() { + return cdktf.Fn.tolist(this.getListAttribute('includes')); + } + public set includes(value: string[]) { + this._includes = value; + } + public resetIncludes() { + this._includes = undefined; + } + // Temporarily expose input value. Use with caution. + public get includesInput() { + return this._includes; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } +} + +export class CbrVaultResourcesList extends cdktf.ComplexList { + public internalValue? : CbrVaultResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CbrVaultResourcesOutputReference { + return new CbrVaultResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CbrVaultTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#create CbrVault#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#delete CbrVault#delete} + */ + readonly delete?: string; +} + +export function cbrVaultTimeoutsToTerraform(struct?: CbrVaultTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cbrVaultTimeoutsToHclTerraform(struct?: CbrVaultTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CbrVaultTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CbrVaultTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CbrVaultTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault huaweicloud_cbr_vault} +*/ +export class CbrVault extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_vault"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CbrVault resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CbrVault to import + * @param importFromId The id of the existing CbrVault that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CbrVault to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_vault", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cbr_vault huaweicloud_cbr_vault} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CbrVaultConfig + */ + public constructor(scope: Construct, id: string, config: CbrVaultConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_vault', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoBind = config.autoBind; + this._autoExpand = config.autoExpand; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._backupNamePrefix = config.backupNamePrefix; + this._bindRules = config.bindRules; + this._chargingMode = config.chargingMode; + this._consistentLevel = config.consistentLevel; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isMultiAz = config.isMultiAz; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._policyId = config.policyId; + this._protectionType = config.protectionType; + this._region = config.region; + this._size = config.size; + this._tags = config.tags; + this._type = config.type; + this._policy.internalValue = config.policy; + this._resources.internalValue = config.resources; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // allocated - computed: true, optional: false, required: false + public get allocated() { + return this.getNumberAttribute('allocated'); + } + + // auto_bind - computed: true, optional: true, required: false + private _autoBind?: boolean | cdktf.IResolvable; + public get autoBind() { + return this.getBooleanAttribute('auto_bind'); + } + public set autoBind(value: boolean | cdktf.IResolvable) { + this._autoBind = value; + } + public resetAutoBind() { + this._autoBind = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoBindInput() { + return this._autoBind; + } + + // auto_expand - computed: true, optional: true, required: false + private _autoExpand?: boolean | cdktf.IResolvable; + public get autoExpand() { + return this.getBooleanAttribute('auto_expand'); + } + public set autoExpand(value: boolean | cdktf.IResolvable) { + this._autoExpand = value; + } + public resetAutoExpand() { + this._autoExpand = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoExpandInput() { + return this._autoExpand; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // backup_name_prefix - computed: true, optional: true, required: false + private _backupNamePrefix?: string; + public get backupNamePrefix() { + return this.getStringAttribute('backup_name_prefix'); + } + public set backupNamePrefix(value: string) { + this._backupNamePrefix = value; + } + public resetBackupNamePrefix() { + this._backupNamePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupNamePrefixInput() { + return this._backupNamePrefix; + } + + // bind_rules - computed: false, optional: true, required: false + private _bindRules?: { [key: string]: string }; + public get bindRules() { + return this.getStringMapAttribute('bind_rules'); + } + public set bindRules(value: { [key: string]: string }) { + this._bindRules = value; + } + public resetBindRules() { + this._bindRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindRulesInput() { + return this._bindRules; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // consistent_level - computed: false, optional: true, required: false + private _consistentLevel?: string; + public get consistentLevel() { + return this.getStringAttribute('consistent_level'); + } + public set consistentLevel(value: string) { + this._consistentLevel = value; + } + public resetConsistentLevel() { + this._consistentLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistentLevelInput() { + return this._consistentLevel; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_multi_az - computed: true, optional: true, required: false + private _isMultiAz?: boolean | cdktf.IResolvable; + public get isMultiAz() { + return this.getBooleanAttribute('is_multi_az'); + } + public set isMultiAz(value: boolean | cdktf.IResolvable) { + this._isMultiAz = value; + } + public resetIsMultiAz() { + this._isMultiAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get isMultiAzInput() { + return this._isMultiAz; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protection_type - computed: false, optional: false, required: true + private _protectionType?: string; + public get protectionType() { + return this.getStringAttribute('protection_type'); + } + public set protectionType(value: string) { + this._protectionType = value; + } + // Temporarily expose input value. Use with caution. + public get protectionTypeInput() { + return this._protectionType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage - computed: true, optional: false, required: false + public get storage() { + return this.getStringAttribute('storage'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } + + // policy - computed: false, optional: true, required: false + private _policy = new CbrVaultPolicyList(this, "policy", true); + public get policy() { + return this._policy; + } + public putPolicy(value: CbrVaultPolicy[] | cdktf.IResolvable) { + this._policy.internalValue = value; + } + public resetPolicy() { + this._policy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyInput() { + return this._policy.internalValue; + } + + // resources - computed: false, optional: true, required: false + private _resources = new CbrVaultResourcesList(this, "resources", true); + public get resources() { + return this._resources; + } + public putResources(value: CbrVaultResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CbrVaultTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CbrVaultTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_bind: cdktf.booleanToTerraform(this._autoBind), + auto_expand: cdktf.booleanToTerraform(this._autoExpand), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + backup_name_prefix: cdktf.stringToTerraform(this._backupNamePrefix), + bind_rules: cdktf.hashMapper(cdktf.stringToTerraform)(this._bindRules), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + consistent_level: cdktf.stringToTerraform(this._consistentLevel), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_multi_az: cdktf.booleanToTerraform(this._isMultiAz), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + policy_id: cdktf.stringToTerraform(this._policyId), + protection_type: cdktf.stringToTerraform(this._protectionType), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + policy: cdktf.listMapper(cbrVaultPolicyToTerraform, true)(this._policy.internalValue), + resources: cdktf.listMapper(cbrVaultResourcesToTerraform, true)(this._resources.internalValue), + timeouts: cbrVaultTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_bind: { + value: cdktf.booleanToHclTerraform(this._autoBind), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_expand: { + value: cdktf.booleanToHclTerraform(this._autoExpand), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_name_prefix: { + value: cdktf.stringToHclTerraform(this._backupNamePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bind_rules: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._bindRules), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consistent_level: { + value: cdktf.stringToHclTerraform(this._consistentLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_multi_az: { + value: cdktf.booleanToHclTerraform(this._isMultiAz), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_type: { + value: cdktf.stringToHclTerraform(this._protectionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy: { + value: cdktf.listMapperHcl(cbrVaultPolicyToHclTerraform, true)(this._policy.internalValue), + isBlock: true, + type: "set", + storageClassType: "CbrVaultPolicyList", + }, + resources: { + value: cdktf.listMapperHcl(cbrVaultResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "set", + storageClassType: "CbrVaultResourcesList", + }, + timeouts: { + value: cbrVaultTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CbrVaultTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-authorization/README.md b/src/constructs/providers/huaweicloud/cc-authorization/README.md new file mode 100644 index 00000000..04307cc5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization). diff --git a/src/constructs/providers/huaweicloud/cc-authorization/index.ts b/src/constructs/providers/huaweicloud/cc-authorization/index.ts new file mode 100644 index 00000000..6658b176 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-authorization/index.ts @@ -0,0 +1,312 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * The peer account ID that you want to authorize. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#cloud_connection_domain_id CcAuthorization#cloud_connection_domain_id} + */ + readonly cloudConnectionDomainId: string; + /** + * Peer cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#cloud_connection_id CcAuthorization#cloud_connection_id} + */ + readonly cloudConnectionId: string; + /** + * The description of the cross-account authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#description CcAuthorization#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#id CcAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#instance_id CcAuthorization#instance_id} + */ + readonly instanceId: string; + /** + * The instance type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#instance_type CcAuthorization#instance_type} + */ + readonly instanceType: string; + /** + * The name of the cross-account authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#name CcAuthorization#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#region CcAuthorization#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization huaweicloud_cc_authorization} +*/ +export class CcAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcAuthorization to import + * @param importFromId The id of the existing CcAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_authorization huaweicloud_cc_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: CcAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cloudConnectionDomainId = config.cloudConnectionDomainId; + this._cloudConnectionId = config.cloudConnectionId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._instanceType = config.instanceType; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cloud_connection_domain_id - computed: false, optional: false, required: true + private _cloudConnectionDomainId?: string; + public get cloudConnectionDomainId() { + return this.getStringAttribute('cloud_connection_domain_id'); + } + public set cloudConnectionDomainId(value: string) { + this._cloudConnectionDomainId = value; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionDomainIdInput() { + return this._cloudConnectionDomainId; + } + + // cloud_connection_id - computed: false, optional: false, required: true + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_type - computed: false, optional: false, required: true + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cloud_connection_domain_id: cdktf.stringToTerraform(this._cloudConnectionDomainId), + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_type: cdktf.stringToTerraform(this._instanceType), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cloud_connection_domain_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionDomainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-bandwidth-package/README.md b/src/constructs/providers/huaweicloud/cc-bandwidth-package/README.md new file mode 100644 index 00000000..c3fce3a7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-bandwidth-package/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_bandwidth_package` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_bandwidth_package`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package). diff --git a/src/constructs/providers/huaweicloud/cc-bandwidth-package/index.ts b/src/constructs/providers/huaweicloud/cc-bandwidth-package/index.ts new file mode 100644 index 00000000..c0f9bbc4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-bandwidth-package/index.ts @@ -0,0 +1,551 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcBandwidthPackageConfig extends cdktf.TerraformMetaArguments { + /** + * Bandwidth in the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#bandwidth CcBandwidthPackage#bandwidth} + */ + readonly bandwidth: number; + /** + * Billing mode of the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#billing_mode CcBandwidthPackage#billing_mode} + */ + readonly billingMode: string; + /** + * Billing option of the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#charge_mode CcBandwidthPackage#charge_mode} + */ + readonly chargeMode: string; + /** + * The description about the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#description CcBandwidthPackage#description} + */ + readonly description?: string; + /** + * ID of the enterprise project that the bandwidth package belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#enterprise_project_id CcBandwidthPackage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#id CcBandwidthPackage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Interflow mode of the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#interflow_mode CcBandwidthPackage#interflow_mode} + */ + readonly interflowMode?: string; + /** + * The local area ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#local_area_id CcBandwidthPackage#local_area_id} + */ + readonly localAreaId: string; + /** + * The bandwidth package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#name CcBandwidthPackage#name} + */ + readonly name: string; + /** + * Project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#project_id CcBandwidthPackage#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#region CcBandwidthPackage#region} + */ + readonly region?: string; + /** + * The remote area ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#remote_area_id CcBandwidthPackage#remote_area_id} + */ + readonly remoteAreaId: string; + /** + * ID of the resource that the bandwidth package is bound to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#resource_id CcBandwidthPackage#resource_id} + */ + readonly resourceId?: string; + /** + * Type of the resource that the bandwidth package is bound to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#resource_type CcBandwidthPackage#resource_type} + */ + readonly resourceType?: string; + /** + * Specification code of the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#spec_code CcBandwidthPackage#spec_code} + */ + readonly specCode?: string; + /** + * The key/value pairs to associate with the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#tags CcBandwidthPackage#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package huaweicloud_cc_bandwidth_package} +*/ +export class CcBandwidthPackage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_bandwidth_package"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcBandwidthPackage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcBandwidthPackage to import + * @param importFromId The id of the existing CcBandwidthPackage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcBandwidthPackage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_bandwidth_package", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_bandwidth_package huaweicloud_cc_bandwidth_package} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcBandwidthPackageConfig + */ + public constructor(scope: Construct, id: string, config: CcBandwidthPackageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_bandwidth_package', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidth = config.bandwidth; + this._billingMode = config.billingMode; + this._chargeMode = config.chargeMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._interflowMode = config.interflowMode; + this._localAreaId = config.localAreaId; + this._name = config.name; + this._projectId = config.projectId; + this._region = config.region; + this._remoteAreaId = config.remoteAreaId; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._specCode = config.specCode; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // billing_mode - computed: false, optional: false, required: true + private _billingMode?: string; + public get billingMode() { + return this.getStringAttribute('billing_mode'); + } + public set billingMode(value: string) { + this._billingMode = value; + } + // Temporarily expose input value. Use with caution. + public get billingModeInput() { + return this._billingMode; + } + + // charge_mode - computed: false, optional: false, required: true + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interflow_mode - computed: true, optional: true, required: false + private _interflowMode?: string; + public get interflowMode() { + return this.getStringAttribute('interflow_mode'); + } + public set interflowMode(value: string) { + this._interflowMode = value; + } + public resetInterflowMode() { + this._interflowMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get interflowModeInput() { + return this._interflowMode; + } + + // local_area_id - computed: false, optional: false, required: true + private _localAreaId?: string; + public get localAreaId() { + return this.getStringAttribute('local_area_id'); + } + public set localAreaId(value: string) { + this._localAreaId = value; + } + // Temporarily expose input value. Use with caution. + public get localAreaIdInput() { + return this._localAreaId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_area_id - computed: false, optional: false, required: true + private _remoteAreaId?: string; + public get remoteAreaId() { + return this.getStringAttribute('remote_area_id'); + } + public set remoteAreaId(value: string) { + this._remoteAreaId = value; + } + // Temporarily expose input value. Use with caution. + public get remoteAreaIdInput() { + return this._remoteAreaId; + } + + // resource_id - computed: true, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: true, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // spec_code - computed: true, optional: true, required: false + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + public resetSpecCode() { + this._specCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth: cdktf.numberToTerraform(this._bandwidth), + billing_mode: cdktf.stringToTerraform(this._billingMode), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + interflow_mode: cdktf.stringToTerraform(this._interflowMode), + local_area_id: cdktf.stringToTerraform(this._localAreaId), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + remote_area_id: cdktf.stringToTerraform(this._remoteAreaId), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + spec_code: cdktf.stringToTerraform(this._specCode), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + billing_mode: { + value: cdktf.stringToHclTerraform(this._billingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interflow_mode: { + value: cdktf.stringToHclTerraform(this._interflowMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_area_id: { + value: cdktf.stringToHclTerraform(this._localAreaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_area_id: { + value: cdktf.stringToHclTerraform(this._remoteAreaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_code: { + value: cdktf.stringToHclTerraform(this._specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-central-network-attachment/README.md b/src/constructs/providers/huaweicloud/cc-central-network-attachment/README.md new file mode 100644 index 00000000..048c3098 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-attachment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_central_network_attachment` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_central_network_attachment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment). diff --git a/src/constructs/providers/huaweicloud/cc-central-network-attachment/index.ts b/src/constructs/providers/huaweicloud/cc-central-network-attachment/index.ts new file mode 100644 index 00000000..d33cf895 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-attachment/index.ts @@ -0,0 +1,613 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcCentralNetworkAttachmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#central_network_id CcCentralNetworkAttachment#central_network_id} + */ + readonly centralNetworkId: string; + /** + * The central network plane ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#central_network_plane_id CcCentralNetworkAttachment#central_network_plane_id} + */ + readonly centralNetworkPlaneId?: string; + /** + * The description of the attachment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#description CcCentralNetworkAttachment#description} + */ + readonly description?: string; + /** + * The enterprise router ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#enterprise_router_id CcCentralNetworkAttachment#enterprise_router_id} + */ + readonly enterpriseRouterId: string; + /** + * The project ID to which the enterprise router belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#enterprise_router_project_id CcCentralNetworkAttachment#enterprise_router_project_id} + */ + readonly enterpriseRouterProjectId: string; + /** + * The region ID to which the enterprise router belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#enterprise_router_region_id CcCentralNetworkAttachment#enterprise_router_region_id} + */ + readonly enterpriseRouterRegionId: string; + /** + * The global DC gateway ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#global_dc_gateway_id CcCentralNetworkAttachment#global_dc_gateway_id} + */ + readonly globalDcGatewayId: string; + /** + * The project ID to which the global DC gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#global_dc_gateway_project_id CcCentralNetworkAttachment#global_dc_gateway_project_id} + */ + readonly globalDcGatewayProjectId: string; + /** + * The region ID to which the global DC gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#global_dc_gateway_region_id CcCentralNetworkAttachment#global_dc_gateway_region_id} + */ + readonly globalDcGatewayRegionId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#id CcCentralNetworkAttachment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the attachment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#name CcCentralNetworkAttachment#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#region CcCentralNetworkAttachment#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#timeouts CcCentralNetworkAttachment#timeouts} + */ + readonly timeouts?: CcCentralNetworkAttachmentTimeouts; +} +export interface CcCentralNetworkAttachmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#create CcCentralNetworkAttachment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#delete CcCentralNetworkAttachment#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#update CcCentralNetworkAttachment#update} + */ + readonly update?: string; +} + +export function ccCentralNetworkAttachmentTimeoutsToTerraform(struct?: CcCentralNetworkAttachmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ccCentralNetworkAttachmentTimeoutsToHclTerraform(struct?: CcCentralNetworkAttachmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkAttachmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcCentralNetworkAttachmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkAttachmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment huaweicloud_cc_central_network_attachment} +*/ +export class CcCentralNetworkAttachment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_attachment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcCentralNetworkAttachment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcCentralNetworkAttachment to import + * @param importFromId The id of the existing CcCentralNetworkAttachment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcCentralNetworkAttachment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_attachment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_attachment huaweicloud_cc_central_network_attachment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcCentralNetworkAttachmentConfig + */ + public constructor(scope: Construct, id: string, config: CcCentralNetworkAttachmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_attachment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._centralNetworkId = config.centralNetworkId; + this._centralNetworkPlaneId = config.centralNetworkPlaneId; + this._description = config.description; + this._enterpriseRouterId = config.enterpriseRouterId; + this._enterpriseRouterProjectId = config.enterpriseRouterProjectId; + this._enterpriseRouterRegionId = config.enterpriseRouterRegionId; + this._globalDcGatewayId = config.globalDcGatewayId; + this._globalDcGatewayProjectId = config.globalDcGatewayProjectId; + this._globalDcGatewayRegionId = config.globalDcGatewayRegionId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // central_network_plane_id - computed: true, optional: true, required: false + private _centralNetworkPlaneId?: string; + public get centralNetworkPlaneId() { + return this.getStringAttribute('central_network_plane_id'); + } + public set centralNetworkPlaneId(value: string) { + this._centralNetworkPlaneId = value; + } + public resetCentralNetworkPlaneId() { + this._centralNetworkPlaneId = undefined; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkPlaneIdInput() { + return this._centralNetworkPlaneId; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_router_id - computed: false, optional: false, required: true + private _enterpriseRouterId?: string; + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + public set enterpriseRouterId(value: string) { + this._enterpriseRouterId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterIdInput() { + return this._enterpriseRouterId; + } + + // enterprise_router_project_id - computed: false, optional: false, required: true + private _enterpriseRouterProjectId?: string; + public get enterpriseRouterProjectId() { + return this.getStringAttribute('enterprise_router_project_id'); + } + public set enterpriseRouterProjectId(value: string) { + this._enterpriseRouterProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterProjectIdInput() { + return this._enterpriseRouterProjectId; + } + + // enterprise_router_region_id - computed: false, optional: false, required: true + private _enterpriseRouterRegionId?: string; + public get enterpriseRouterRegionId() { + return this.getStringAttribute('enterprise_router_region_id'); + } + public set enterpriseRouterRegionId(value: string) { + this._enterpriseRouterRegionId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterRegionIdInput() { + return this._enterpriseRouterRegionId; + } + + // global_dc_gateway_id - computed: false, optional: false, required: true + private _globalDcGatewayId?: string; + public get globalDcGatewayId() { + return this.getStringAttribute('global_dc_gateway_id'); + } + public set globalDcGatewayId(value: string) { + this._globalDcGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get globalDcGatewayIdInput() { + return this._globalDcGatewayId; + } + + // global_dc_gateway_project_id - computed: false, optional: false, required: true + private _globalDcGatewayProjectId?: string; + public get globalDcGatewayProjectId() { + return this.getStringAttribute('global_dc_gateway_project_id'); + } + public set globalDcGatewayProjectId(value: string) { + this._globalDcGatewayProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get globalDcGatewayProjectIdInput() { + return this._globalDcGatewayProjectId; + } + + // global_dc_gateway_region_id - computed: false, optional: false, required: true + private _globalDcGatewayRegionId?: string; + public get globalDcGatewayRegionId() { + return this.getStringAttribute('global_dc_gateway_region_id'); + } + public set globalDcGatewayRegionId(value: string) { + this._globalDcGatewayRegionId = value; + } + // Temporarily expose input value. Use with caution. + public get globalDcGatewayRegionIdInput() { + return this._globalDcGatewayRegionId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcCentralNetworkAttachmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcCentralNetworkAttachmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + central_network_plane_id: cdktf.stringToTerraform(this._centralNetworkPlaneId), + description: cdktf.stringToTerraform(this._description), + enterprise_router_id: cdktf.stringToTerraform(this._enterpriseRouterId), + enterprise_router_project_id: cdktf.stringToTerraform(this._enterpriseRouterProjectId), + enterprise_router_region_id: cdktf.stringToTerraform(this._enterpriseRouterRegionId), + global_dc_gateway_id: cdktf.stringToTerraform(this._globalDcGatewayId), + global_dc_gateway_project_id: cdktf.stringToTerraform(this._globalDcGatewayProjectId), + global_dc_gateway_region_id: cdktf.stringToTerraform(this._globalDcGatewayRegionId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: ccCentralNetworkAttachmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + central_network_plane_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkPlaneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_router_id: { + value: cdktf.stringToHclTerraform(this._enterpriseRouterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_router_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseRouterProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_router_region_id: { + value: cdktf.stringToHclTerraform(this._enterpriseRouterRegionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_dc_gateway_id: { + value: cdktf.stringToHclTerraform(this._globalDcGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_dc_gateway_project_id: { + value: cdktf.stringToHclTerraform(this._globalDcGatewayProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_dc_gateway_region_id: { + value: cdktf.stringToHclTerraform(this._globalDcGatewayRegionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ccCentralNetworkAttachmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcCentralNetworkAttachmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/README.md b/src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/README.md new file mode 100644 index 00000000..9bd0b40b --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_central_network_connection_bandwidth_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_central_network_connection_bandwidth_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate). diff --git a/src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/index.ts b/src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/index.ts new file mode 100644 index 00000000..1259188a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-connection-bandwidth-associate/index.ts @@ -0,0 +1,442 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcCentralNetworkConnectionBandwidthAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * The bandwidth size of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#bandwidth_size CcCentralNetworkConnectionBandwidthAssociate#bandwidth_size} + */ + readonly bandwidthSize: number; + /** + * The ID of the central network to which the connection belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#central_network_id CcCentralNetworkConnectionBandwidthAssociate#central_network_id} + */ + readonly centralNetworkId: string; + /** + * The ID of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#connection_id CcCentralNetworkConnectionBandwidthAssociate#connection_id} + */ + readonly connectionId: string; + /** + * The ID of the global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#global_connection_bandwidth_id CcCentralNetworkConnectionBandwidthAssociate#global_connection_bandwidth_id} + */ + readonly globalConnectionBandwidthId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#id CcCentralNetworkConnectionBandwidthAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#region CcCentralNetworkConnectionBandwidthAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#timeouts CcCentralNetworkConnectionBandwidthAssociate#timeouts} + */ + readonly timeouts?: CcCentralNetworkConnectionBandwidthAssociateTimeouts; +} +export interface CcCentralNetworkConnectionBandwidthAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#create CcCentralNetworkConnectionBandwidthAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#delete CcCentralNetworkConnectionBandwidthAssociate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#update CcCentralNetworkConnectionBandwidthAssociate#update} + */ + readonly update?: string; +} + +export function ccCentralNetworkConnectionBandwidthAssociateTimeoutsToTerraform(struct?: CcCentralNetworkConnectionBandwidthAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ccCentralNetworkConnectionBandwidthAssociateTimeoutsToHclTerraform(struct?: CcCentralNetworkConnectionBandwidthAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkConnectionBandwidthAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcCentralNetworkConnectionBandwidthAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkConnectionBandwidthAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate huaweicloud_cc_central_network_connection_bandwidth_associate} +*/ +export class CcCentralNetworkConnectionBandwidthAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_connection_bandwidth_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcCentralNetworkConnectionBandwidthAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcCentralNetworkConnectionBandwidthAssociate to import + * @param importFromId The id of the existing CcCentralNetworkConnectionBandwidthAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcCentralNetworkConnectionBandwidthAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_connection_bandwidth_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_connection_bandwidth_associate huaweicloud_cc_central_network_connection_bandwidth_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcCentralNetworkConnectionBandwidthAssociateConfig + */ + public constructor(scope: Construct, id: string, config: CcCentralNetworkConnectionBandwidthAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_connection_bandwidth_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthSize = config.bandwidthSize; + this._centralNetworkId = config.centralNetworkId; + this._connectionId = config.connectionId; + this._globalConnectionBandwidthId = config.globalConnectionBandwidthId; + this._id = config.id; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_size - computed: false, optional: false, required: true + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // connection_id - computed: false, optional: false, required: true + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // global_connection_bandwidth_id - computed: false, optional: false, required: true + private _globalConnectionBandwidthId?: string; + public get globalConnectionBandwidthId() { + return this.getStringAttribute('global_connection_bandwidth_id'); + } + public set globalConnectionBandwidthId(value: string) { + this._globalConnectionBandwidthId = value; + } + // Temporarily expose input value. Use with caution. + public get globalConnectionBandwidthIdInput() { + return this._globalConnectionBandwidthId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcCentralNetworkConnectionBandwidthAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcCentralNetworkConnectionBandwidthAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + connection_id: cdktf.stringToTerraform(this._connectionId), + global_connection_bandwidth_id: cdktf.stringToTerraform(this._globalConnectionBandwidthId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + timeouts: ccCentralNetworkConnectionBandwidthAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_connection_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._globalConnectionBandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ccCentralNetworkConnectionBandwidthAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcCentralNetworkConnectionBandwidthAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-central-network-policy-apply/README.md b/src/constructs/providers/huaweicloud/cc-central-network-policy-apply/README.md new file mode 100644 index 00000000..20bd1bb0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-policy-apply/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_central_network_policy_apply` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_central_network_policy_apply`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply). diff --git a/src/constructs/providers/huaweicloud/cc-central-network-policy-apply/index.ts b/src/constructs/providers/huaweicloud/cc-central-network-policy-apply/index.ts new file mode 100644 index 00000000..e660b2f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-policy-apply/index.ts @@ -0,0 +1,388 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcCentralNetworkPolicyApplyConfig extends cdktf.TerraformMetaArguments { + /** + * Central network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#central_network_id CcCentralNetworkPolicyApply#central_network_id} + */ + readonly centralNetworkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#id CcCentralNetworkPolicyApply#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#policy_id CcCentralNetworkPolicyApply#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#region CcCentralNetworkPolicyApply#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#timeouts CcCentralNetworkPolicyApply#timeouts} + */ + readonly timeouts?: CcCentralNetworkPolicyApplyTimeouts; +} +export interface CcCentralNetworkPolicyApplyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#create CcCentralNetworkPolicyApply#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#delete CcCentralNetworkPolicyApply#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#update CcCentralNetworkPolicyApply#update} + */ + readonly update?: string; +} + +export function ccCentralNetworkPolicyApplyTimeoutsToTerraform(struct?: CcCentralNetworkPolicyApplyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ccCentralNetworkPolicyApplyTimeoutsToHclTerraform(struct?: CcCentralNetworkPolicyApplyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkPolicyApplyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcCentralNetworkPolicyApplyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkPolicyApplyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply huaweicloud_cc_central_network_policy_apply} +*/ +export class CcCentralNetworkPolicyApply extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_policy_apply"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcCentralNetworkPolicyApply resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcCentralNetworkPolicyApply to import + * @param importFromId The id of the existing CcCentralNetworkPolicyApply that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcCentralNetworkPolicyApply to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_policy_apply", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy_apply huaweicloud_cc_central_network_policy_apply} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcCentralNetworkPolicyApplyConfig + */ + public constructor(scope: Construct, id: string, config: CcCentralNetworkPolicyApplyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_policy_apply', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._centralNetworkId = config.centralNetworkId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcCentralNetworkPolicyApplyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcCentralNetworkPolicyApplyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + timeouts: ccCentralNetworkPolicyApplyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ccCentralNetworkPolicyApplyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcCentralNetworkPolicyApplyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-central-network-policy/README.md b/src/constructs/providers/huaweicloud/cc-central-network-policy/README.md new file mode 100644 index 00000000..85b63142 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_central_network_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_central_network_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy). diff --git a/src/constructs/providers/huaweicloud/cc-central-network-policy/index.ts b/src/constructs/providers/huaweicloud/cc-central-network-policy/index.ts new file mode 100644 index 00000000..cf318a72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network-policy/index.ts @@ -0,0 +1,1050 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcCentralNetworkPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Central network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#central_network_id CcCentralNetworkPolicy#central_network_id} + */ + readonly centralNetworkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#id CcCentralNetworkPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#region CcCentralNetworkPolicy#region} + */ + readonly region?: string; + /** + * er_instances block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#er_instances CcCentralNetworkPolicy#er_instances} + */ + readonly erInstances: CcCentralNetworkPolicyErInstances[] | cdktf.IResolvable; + /** + * planes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#planes CcCentralNetworkPolicy#planes} + */ + readonly planes?: CcCentralNetworkPolicyPlanes; +} +export interface CcCentralNetworkPolicyErInstances { + /** + * Enterprise router ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#enterprise_router_id CcCentralNetworkPolicy#enterprise_router_id} + */ + readonly enterpriseRouterId: string; + /** + * Project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#project_id CcCentralNetworkPolicy#project_id} + */ + readonly projectId: string; + /** + * Region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#region_id CcCentralNetworkPolicy#region_id} + */ + readonly regionId: string; +} + +export function ccCentralNetworkPolicyErInstancesToTerraform(struct?: CcCentralNetworkPolicyErInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enterprise_router_id: cdktf.stringToTerraform(struct!.enterpriseRouterId), + project_id: cdktf.stringToTerraform(struct!.projectId), + region_id: cdktf.stringToTerraform(struct!.regionId), + } +} + + +export function ccCentralNetworkPolicyErInstancesToHclTerraform(struct?: CcCentralNetworkPolicyErInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enterprise_router_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseRouterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkPolicyErInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcCentralNetworkPolicyErInstances | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enterpriseRouterId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseRouterId = this._enterpriseRouterId; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkPolicyErInstances | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._enterpriseRouterId = undefined; + this._projectId = undefined; + this._regionId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._enterpriseRouterId = value.enterpriseRouterId; + this._projectId = value.projectId; + this._regionId = value.regionId; + } + } + + // enterprise_router_id - computed: false, optional: false, required: true + private _enterpriseRouterId?: string; + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + public set enterpriseRouterId(value: string) { + this._enterpriseRouterId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterIdInput() { + return this._enterpriseRouterId; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } +} + +export class CcCentralNetworkPolicyErInstancesList extends cdktf.ComplexList { + public internalValue? : CcCentralNetworkPolicyErInstances[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcCentralNetworkPolicyErInstancesOutputReference { + return new CcCentralNetworkPolicyErInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcCentralNetworkPolicyPlanesAssociateErTables { + /** + * Enterprise router ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#enterprise_router_id CcCentralNetworkPolicy#enterprise_router_id} + */ + readonly enterpriseRouterId: string; + /** + * Enterprise router table ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#enterprise_router_table_id CcCentralNetworkPolicy#enterprise_router_table_id} + */ + readonly enterpriseRouterTableId: string; + /** + * Project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#project_id CcCentralNetworkPolicy#project_id} + */ + readonly projectId: string; + /** + * Region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#region_id CcCentralNetworkPolicy#region_id} + */ + readonly regionId: string; +} + +export function ccCentralNetworkPolicyPlanesAssociateErTablesToTerraform(struct?: CcCentralNetworkPolicyPlanesAssociateErTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enterprise_router_id: cdktf.stringToTerraform(struct!.enterpriseRouterId), + enterprise_router_table_id: cdktf.stringToTerraform(struct!.enterpriseRouterTableId), + project_id: cdktf.stringToTerraform(struct!.projectId), + region_id: cdktf.stringToTerraform(struct!.regionId), + } +} + + +export function ccCentralNetworkPolicyPlanesAssociateErTablesToHclTerraform(struct?: CcCentralNetworkPolicyPlanesAssociateErTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enterprise_router_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseRouterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_router_table_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseRouterTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkPolicyPlanesAssociateErTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcCentralNetworkPolicyPlanesAssociateErTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enterpriseRouterId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseRouterId = this._enterpriseRouterId; + } + if (this._enterpriseRouterTableId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseRouterTableId = this._enterpriseRouterTableId; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkPolicyPlanesAssociateErTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._enterpriseRouterId = undefined; + this._enterpriseRouterTableId = undefined; + this._projectId = undefined; + this._regionId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._enterpriseRouterId = value.enterpriseRouterId; + this._enterpriseRouterTableId = value.enterpriseRouterTableId; + this._projectId = value.projectId; + this._regionId = value.regionId; + } + } + + // enterprise_router_id - computed: false, optional: false, required: true + private _enterpriseRouterId?: string; + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + public set enterpriseRouterId(value: string) { + this._enterpriseRouterId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterIdInput() { + return this._enterpriseRouterId; + } + + // enterprise_router_table_id - computed: false, optional: false, required: true + private _enterpriseRouterTableId?: string; + public get enterpriseRouterTableId() { + return this.getStringAttribute('enterprise_router_table_id'); + } + public set enterpriseRouterTableId(value: string) { + this._enterpriseRouterTableId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterTableIdInput() { + return this._enterpriseRouterTableId; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } +} + +export class CcCentralNetworkPolicyPlanesAssociateErTablesList extends cdktf.ComplexList { + public internalValue? : CcCentralNetworkPolicyPlanesAssociateErTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcCentralNetworkPolicyPlanesAssociateErTablesOutputReference { + return new CcCentralNetworkPolicyPlanesAssociateErTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances { + /** + * Enterprise router ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#enterprise_router_id CcCentralNetworkPolicy#enterprise_router_id} + */ + readonly enterpriseRouterId: string; + /** + * Project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#project_id CcCentralNetworkPolicy#project_id} + */ + readonly projectId: string; + /** + * Region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#region_id CcCentralNetworkPolicy#region_id} + */ + readonly regionId: string; +} + +export function ccCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesToTerraform(struct?: CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enterprise_router_id: cdktf.stringToTerraform(struct!.enterpriseRouterId), + project_id: cdktf.stringToTerraform(struct!.projectId), + region_id: cdktf.stringToTerraform(struct!.regionId), + } +} + + +export function ccCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesToHclTerraform(struct?: CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enterprise_router_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseRouterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enterpriseRouterId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseRouterId = this._enterpriseRouterId; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._enterpriseRouterId = undefined; + this._projectId = undefined; + this._regionId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._enterpriseRouterId = value.enterpriseRouterId; + this._projectId = value.projectId; + this._regionId = value.regionId; + } + } + + // enterprise_router_id - computed: false, optional: false, required: true + private _enterpriseRouterId?: string; + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + public set enterpriseRouterId(value: string) { + this._enterpriseRouterId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseRouterIdInput() { + return this._enterpriseRouterId; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } +} + +export class CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesList extends cdktf.ComplexList { + public internalValue? : CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesOutputReference { + return new CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcCentralNetworkPolicyPlanesExcludeErConnections { + /** + * exclude_er_instances block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#exclude_er_instances CcCentralNetworkPolicy#exclude_er_instances} + */ + readonly excludeErInstances: CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances[] | cdktf.IResolvable; +} + +export function ccCentralNetworkPolicyPlanesExcludeErConnectionsToTerraform(struct?: CcCentralNetworkPolicyPlanesExcludeErConnections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + exclude_er_instances: cdktf.listMapper(ccCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesToTerraform, true)(struct!.excludeErInstances), + } +} + + +export function ccCentralNetworkPolicyPlanesExcludeErConnectionsToHclTerraform(struct?: CcCentralNetworkPolicyPlanesExcludeErConnections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + exclude_er_instances: { + value: cdktf.listMapperHcl(ccCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesToHclTerraform, true)(struct!.excludeErInstances), + isBlock: true, + type: "list", + storageClassType: "CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkPolicyPlanesExcludeErConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcCentralNetworkPolicyPlanesExcludeErConnections | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._excludeErInstances?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.excludeErInstances = this._excludeErInstances?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkPolicyPlanesExcludeErConnections | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._excludeErInstances.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._excludeErInstances.internalValue = value.excludeErInstances; + } + } + + // exclude_er_instances - computed: false, optional: false, required: true + private _excludeErInstances = new CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstancesList(this, "exclude_er_instances", false); + public get excludeErInstances() { + return this._excludeErInstances; + } + public putExcludeErInstances(value: CcCentralNetworkPolicyPlanesExcludeErConnectionsExcludeErInstances[] | cdktf.IResolvable) { + this._excludeErInstances.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get excludeErInstancesInput() { + return this._excludeErInstances.internalValue; + } +} + +export class CcCentralNetworkPolicyPlanesExcludeErConnectionsList extends cdktf.ComplexList { + public internalValue? : CcCentralNetworkPolicyPlanesExcludeErConnections[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcCentralNetworkPolicyPlanesExcludeErConnectionsOutputReference { + return new CcCentralNetworkPolicyPlanesExcludeErConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcCentralNetworkPolicyPlanes { + /** + * associate_er_tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#associate_er_tables CcCentralNetworkPolicy#associate_er_tables} + */ + readonly associateErTables: CcCentralNetworkPolicyPlanesAssociateErTables[] | cdktf.IResolvable; + /** + * exclude_er_connections block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#exclude_er_connections CcCentralNetworkPolicy#exclude_er_connections} + */ + readonly excludeErConnections?: CcCentralNetworkPolicyPlanesExcludeErConnections[] | cdktf.IResolvable; +} + +export function ccCentralNetworkPolicyPlanesToTerraform(struct?: CcCentralNetworkPolicyPlanesOutputReference | CcCentralNetworkPolicyPlanes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + associate_er_tables: cdktf.listMapper(ccCentralNetworkPolicyPlanesAssociateErTablesToTerraform, true)(struct!.associateErTables), + exclude_er_connections: cdktf.listMapper(ccCentralNetworkPolicyPlanesExcludeErConnectionsToTerraform, true)(struct!.excludeErConnections), + } +} + + +export function ccCentralNetworkPolicyPlanesToHclTerraform(struct?: CcCentralNetworkPolicyPlanesOutputReference | CcCentralNetworkPolicyPlanes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + associate_er_tables: { + value: cdktf.listMapperHcl(ccCentralNetworkPolicyPlanesAssociateErTablesToHclTerraform, true)(struct!.associateErTables), + isBlock: true, + type: "list", + storageClassType: "CcCentralNetworkPolicyPlanesAssociateErTablesList", + }, + exclude_er_connections: { + value: cdktf.listMapperHcl(ccCentralNetworkPolicyPlanesExcludeErConnectionsToHclTerraform, true)(struct!.excludeErConnections), + isBlock: true, + type: "list", + storageClassType: "CcCentralNetworkPolicyPlanesExcludeErConnectionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkPolicyPlanesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CcCentralNetworkPolicyPlanes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._associateErTables?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.associateErTables = this._associateErTables?.internalValue; + } + if (this._excludeErConnections?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.excludeErConnections = this._excludeErConnections?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkPolicyPlanes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._associateErTables.internalValue = undefined; + this._excludeErConnections.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._associateErTables.internalValue = value.associateErTables; + this._excludeErConnections.internalValue = value.excludeErConnections; + } + } + + // associate_er_tables - computed: false, optional: false, required: true + private _associateErTables = new CcCentralNetworkPolicyPlanesAssociateErTablesList(this, "associate_er_tables", false); + public get associateErTables() { + return this._associateErTables; + } + public putAssociateErTables(value: CcCentralNetworkPolicyPlanesAssociateErTables[] | cdktf.IResolvable) { + this._associateErTables.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get associateErTablesInput() { + return this._associateErTables.internalValue; + } + + // exclude_er_connections - computed: false, optional: true, required: false + private _excludeErConnections = new CcCentralNetworkPolicyPlanesExcludeErConnectionsList(this, "exclude_er_connections", false); + public get excludeErConnections() { + return this._excludeErConnections; + } + public putExcludeErConnections(value: CcCentralNetworkPolicyPlanesExcludeErConnections[] | cdktf.IResolvable) { + this._excludeErConnections.internalValue = value; + } + public resetExcludeErConnections() { + this._excludeErConnections.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludeErConnectionsInput() { + return this._excludeErConnections.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy huaweicloud_cc_central_network_policy} +*/ +export class CcCentralNetworkPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcCentralNetworkPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcCentralNetworkPolicy to import + * @param importFromId The id of the existing CcCentralNetworkPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcCentralNetworkPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network_policy huaweicloud_cc_central_network_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcCentralNetworkPolicyConfig + */ + public constructor(scope: Construct, id: string, config: CcCentralNetworkPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._centralNetworkId = config.centralNetworkId; + this._id = config.id; + this._region = config.region; + this._erInstances.internalValue = config.erInstances; + this._planes.internalValue = config.planes; + } + + // ========== + // ATTRIBUTES + // ========== + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // document_template_version - computed: true, optional: false, required: false + public get documentTemplateVersion() { + return this.getStringAttribute('document_template_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_applied - computed: true, optional: false, required: false + public get isApplied() { + return this.getBooleanAttribute('is_applied'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } + + // er_instances - computed: false, optional: false, required: true + private _erInstances = new CcCentralNetworkPolicyErInstancesList(this, "er_instances", false); + public get erInstances() { + return this._erInstances; + } + public putErInstances(value: CcCentralNetworkPolicyErInstances[] | cdktf.IResolvable) { + this._erInstances.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get erInstancesInput() { + return this._erInstances.internalValue; + } + + // planes - computed: false, optional: true, required: false + private _planes = new CcCentralNetworkPolicyPlanesOutputReference(this, "planes"); + public get planes() { + return this._planes; + } + public putPlanes(value: CcCentralNetworkPolicyPlanes) { + this._planes.internalValue = value; + } + public resetPlanes() { + this._planes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get planesInput() { + return this._planes.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + er_instances: cdktf.listMapper(ccCentralNetworkPolicyErInstancesToTerraform, true)(this._erInstances.internalValue), + planes: ccCentralNetworkPolicyPlanesToTerraform(this._planes.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + er_instances: { + value: cdktf.listMapperHcl(ccCentralNetworkPolicyErInstancesToHclTerraform, true)(this._erInstances.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcCentralNetworkPolicyErInstancesList", + }, + planes: { + value: ccCentralNetworkPolicyPlanesToHclTerraform(this._planes.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcCentralNetworkPolicyPlanesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-central-network/README.md b/src/constructs/providers/huaweicloud/cc-central-network/README.md new file mode 100644 index 00000000..5156140f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_central_network` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_central_network`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network). diff --git a/src/constructs/providers/huaweicloud/cc-central-network/index.ts b/src/constructs/providers/huaweicloud/cc-central-network/index.ts new file mode 100644 index 00000000..b378c0bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-central-network/index.ts @@ -0,0 +1,456 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcCentralNetworkConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#description CcCentralNetwork#description} + */ + readonly description?: string; + /** + * The enterprise project ID to which the central network belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#enterprise_project_id CcCentralNetwork#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#id CcCentralNetwork#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#name CcCentralNetwork#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#region CcCentralNetwork#region} + */ + readonly region?: string; + /** + * The key/value pairs to associate with the central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#tags CcCentralNetwork#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#timeouts CcCentralNetwork#timeouts} + */ + readonly timeouts?: CcCentralNetworkTimeouts; +} +export interface CcCentralNetworkTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#create CcCentralNetwork#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#delete CcCentralNetwork#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#update CcCentralNetwork#update} + */ + readonly update?: string; +} + +export function ccCentralNetworkTimeoutsToTerraform(struct?: CcCentralNetworkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ccCentralNetworkTimeoutsToHclTerraform(struct?: CcCentralNetworkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcCentralNetworkTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcCentralNetworkTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcCentralNetworkTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network huaweicloud_cc_central_network} +*/ +export class CcCentralNetwork extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcCentralNetwork resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcCentralNetwork to import + * @param importFromId The id of the existing CcCentralNetwork that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcCentralNetwork to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_central_network huaweicloud_cc_central_network} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcCentralNetworkConfig + */ + public constructor(scope: Construct, id: string, config: CcCentralNetworkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcCentralNetworkTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcCentralNetworkTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: ccCentralNetworkTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: ccCentralNetworkTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcCentralNetworkTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-connection/README.md b/src/constructs/providers/huaweicloud/cc-connection/README.md new file mode 100644 index 00000000..86e62ce3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection). diff --git a/src/constructs/providers/huaweicloud/cc-connection/index.ts b/src/constructs/providers/huaweicloud/cc-connection/index.ts new file mode 100644 index 00000000..00d03789 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-connection/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * The description about the cloud connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#description CcConnection#description} + */ + readonly description?: string; + /** + * The enterprise project id of the cloud connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#enterprise_project_id CcConnection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#id CcConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The cloud connection name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#name CcConnection#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#region CcConnection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#tags CcConnection#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection huaweicloud_cc_connection} +*/ +export class CcConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcConnection to import + * @param importFromId The id of the existing CcConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_connection huaweicloud_cc_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcConnectionConfig + */ + public constructor(scope: Construct, id: string, config: CcConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_package_number - computed: true, optional: false, required: false + public get bandwidthPackageNumber() { + return this.getNumberAttribute('bandwidth_package_number'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inter_region_bandwidth_number - computed: true, optional: false, required: false + public get interRegionBandwidthNumber() { + return this.getNumberAttribute('inter_region_bandwidth_number'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_instance_number - computed: true, optional: false, required: false + public get networkInstanceNumber() { + return this.getNumberAttribute('network_instance_number'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // used_scene - computed: true, optional: false, required: false + public get usedScene() { + return this.getStringAttribute('used_scene'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/README.md b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/README.md new file mode 100644 index 00000000..bc267ff9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_global_connection_bandwidth_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_global_connection_bandwidth_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate). diff --git a/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/index.ts b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/index.ts new file mode 100644 index 00000000..152acb8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth-associate/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcGlobalConnectionBandwidthAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * The global connection bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#gcb_id CcGlobalConnectionBandwidthAssociate#gcb_id} + */ + readonly gcbId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#id CcGlobalConnectionBandwidthAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#region CcGlobalConnectionBandwidthAssociate#region} + */ + readonly region?: string; + /** + * gcb_binding_resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#gcb_binding_resources CcGlobalConnectionBandwidthAssociate#gcb_binding_resources} + */ + readonly gcbBindingResources: CcGlobalConnectionBandwidthAssociateGcbBindingResources[] | cdktf.IResolvable; +} +export interface CcGlobalConnectionBandwidthAssociateGcbBindingResources { + /** + * The project ID of the resource to associate with the global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#project_id CcGlobalConnectionBandwidthAssociate#project_id} + */ + readonly projectId?: string; + /** + * The region ID of the resource to associate with the global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#region_id CcGlobalConnectionBandwidthAssociate#region_id} + */ + readonly regionId?: string; + /** + * The ID of the resource to associate with the global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#resource_id CcGlobalConnectionBandwidthAssociate#resource_id} + */ + readonly resourceId: string; + /** + * The type of the resource to associate with the global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#resource_type CcGlobalConnectionBandwidthAssociate#resource_type} + */ + readonly resourceType: string; +} + +export function ccGlobalConnectionBandwidthAssociateGcbBindingResourcesToTerraform(struct?: CcGlobalConnectionBandwidthAssociateGcbBindingResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project_id: cdktf.stringToTerraform(struct!.projectId), + region_id: cdktf.stringToTerraform(struct!.regionId), + resource_id: cdktf.stringToTerraform(struct!.resourceId), + resource_type: cdktf.stringToTerraform(struct!.resourceType), + } +} + + +export function ccGlobalConnectionBandwidthAssociateGcbBindingResourcesToHclTerraform(struct?: CcGlobalConnectionBandwidthAssociateGcbBindingResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(struct!.resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcGlobalConnectionBandwidthAssociateGcbBindingResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcGlobalConnectionBandwidthAssociateGcbBindingResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._resourceType !== undefined) { + hasAnyValues = true; + internalValueResult.resourceType = this._resourceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcGlobalConnectionBandwidthAssociateGcbBindingResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._projectId = undefined; + this._regionId = undefined; + this._resourceId = undefined; + this._resourceType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._projectId = value.projectId; + this._regionId = value.regionId; + this._resourceId = value.resourceId; + this._resourceType = value.resourceType; + } + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } +} + +export class CcGlobalConnectionBandwidthAssociateGcbBindingResourcesList extends cdktf.ComplexList { + public internalValue? : CcGlobalConnectionBandwidthAssociateGcbBindingResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcGlobalConnectionBandwidthAssociateGcbBindingResourcesOutputReference { + return new CcGlobalConnectionBandwidthAssociateGcbBindingResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate huaweicloud_cc_global_connection_bandwidth_associate} +*/ +export class CcGlobalConnectionBandwidthAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_global_connection_bandwidth_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcGlobalConnectionBandwidthAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcGlobalConnectionBandwidthAssociate to import + * @param importFromId The id of the existing CcGlobalConnectionBandwidthAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcGlobalConnectionBandwidthAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_global_connection_bandwidth_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth_associate huaweicloud_cc_global_connection_bandwidth_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcGlobalConnectionBandwidthAssociateConfig + */ + public constructor(scope: Construct, id: string, config: CcGlobalConnectionBandwidthAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_global_connection_bandwidth_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._gcbId = config.gcbId; + this._id = config.id; + this._region = config.region; + this._gcbBindingResources.internalValue = config.gcbBindingResources; + } + + // ========== + // ATTRIBUTES + // ========== + + // gcb_id - computed: false, optional: false, required: true + private _gcbId?: string; + public get gcbId() { + return this.getStringAttribute('gcb_id'); + } + public set gcbId(value: string) { + this._gcbId = value; + } + // Temporarily expose input value. Use with caution. + public get gcbIdInput() { + return this._gcbId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // gcb_binding_resources - computed: false, optional: false, required: true + private _gcbBindingResources = new CcGlobalConnectionBandwidthAssociateGcbBindingResourcesList(this, "gcb_binding_resources", true); + public get gcbBindingResources() { + return this._gcbBindingResources; + } + public putGcbBindingResources(value: CcGlobalConnectionBandwidthAssociateGcbBindingResources[] | cdktf.IResolvable) { + this._gcbBindingResources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get gcbBindingResourcesInput() { + return this._gcbBindingResources.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + gcb_id: cdktf.stringToTerraform(this._gcbId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + gcb_binding_resources: cdktf.listMapper(ccGlobalConnectionBandwidthAssociateGcbBindingResourcesToTerraform, true)(this._gcbBindingResources.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + gcb_id: { + value: cdktf.stringToHclTerraform(this._gcbId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gcb_binding_resources: { + value: cdktf.listMapperHcl(ccGlobalConnectionBandwidthAssociateGcbBindingResourcesToHclTerraform, true)(this._gcbBindingResources.internalValue), + isBlock: true, + type: "set", + storageClassType: "CcGlobalConnectionBandwidthAssociateGcbBindingResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/README.md b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/README.md new file mode 100644 index 00000000..c10f7cb4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_global_connection_bandwidth` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_global_connection_bandwidth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth). diff --git a/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/index.ts b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/index.ts new file mode 100644 index 00000000..975cad37 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-global-connection-bandwidth/index.ts @@ -0,0 +1,576 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcGlobalConnectionBandwidthConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#binding_service CcGlobalConnectionBandwidth#binding_service} + */ + readonly bindingService?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#bordercross CcGlobalConnectionBandwidth#bordercross} + */ + readonly bordercross: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#charge_mode CcGlobalConnectionBandwidth#charge_mode} + */ + readonly chargeMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#description CcGlobalConnectionBandwidth#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#enterprise_project_id CcGlobalConnectionBandwidth#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#id CcGlobalConnectionBandwidth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#local_area CcGlobalConnectionBandwidth#local_area} + */ + readonly localArea?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#name CcGlobalConnectionBandwidth#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#remote_area CcGlobalConnectionBandwidth#remote_area} + */ + readonly remoteArea?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#size CcGlobalConnectionBandwidth#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#sla_level CcGlobalConnectionBandwidth#sla_level} + */ + readonly slaLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#spec_code_id CcGlobalConnectionBandwidth#spec_code_id} + */ + readonly specCodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#tags CcGlobalConnectionBandwidth#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#type CcGlobalConnectionBandwidth#type} + */ + readonly type: string; +} +export interface CcGlobalConnectionBandwidthInstances { +} + +export function ccGlobalConnectionBandwidthInstancesToTerraform(struct?: CcGlobalConnectionBandwidthInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ccGlobalConnectionBandwidthInstancesToHclTerraform(struct?: CcGlobalConnectionBandwidthInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CcGlobalConnectionBandwidthInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcGlobalConnectionBandwidthInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcGlobalConnectionBandwidthInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CcGlobalConnectionBandwidthInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcGlobalConnectionBandwidthInstancesOutputReference { + return new CcGlobalConnectionBandwidthInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth huaweicloud_cc_global_connection_bandwidth} +*/ +export class CcGlobalConnectionBandwidth extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_global_connection_bandwidth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcGlobalConnectionBandwidth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcGlobalConnectionBandwidth to import + * @param importFromId The id of the existing CcGlobalConnectionBandwidth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcGlobalConnectionBandwidth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_global_connection_bandwidth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_global_connection_bandwidth huaweicloud_cc_global_connection_bandwidth} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcGlobalConnectionBandwidthConfig + */ + public constructor(scope: Construct, id: string, config: CcGlobalConnectionBandwidthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_global_connection_bandwidth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bindingService = config.bindingService; + this._bordercross = config.bordercross; + this._chargeMode = config.chargeMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._localArea = config.localArea; + this._name = config.name; + this._remoteArea = config.remoteArea; + this._size = config.size; + this._slaLevel = config.slaLevel; + this._specCodeId = config.specCodeId; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // binding_service - computed: true, optional: true, required: false + private _bindingService?: string; + public get bindingService() { + return this.getStringAttribute('binding_service'); + } + public set bindingService(value: string) { + this._bindingService = value; + } + public resetBindingService() { + this._bindingService = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindingServiceInput() { + return this._bindingService; + } + + // bordercross - computed: false, optional: false, required: true + private _bordercross?: boolean | cdktf.IResolvable; + public get bordercross() { + return this.getBooleanAttribute('bordercross'); + } + public set bordercross(value: boolean | cdktf.IResolvable) { + this._bordercross = value; + } + // Temporarily expose input value. Use with caution. + public get bordercrossInput() { + return this._bordercross; + } + + // charge_mode - computed: false, optional: false, required: true + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_share - computed: true, optional: false, required: false + public get enableShare() { + return this.getBooleanAttribute('enable_share'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // frozen - computed: true, optional: false, required: false + public get frozen() { + return this.getBooleanAttribute('frozen'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new CcGlobalConnectionBandwidthInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // local_area - computed: true, optional: true, required: false + private _localArea?: string; + public get localArea() { + return this.getStringAttribute('local_area'); + } + public set localArea(value: string) { + this._localArea = value; + } + public resetLocalArea() { + this._localArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get localAreaInput() { + return this._localArea; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // remote_area - computed: true, optional: true, required: false + private _remoteArea?: string; + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + public set remoteArea(value: string) { + this._remoteArea = value; + } + public resetRemoteArea() { + this._remoteArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAreaInput() { + return this._remoteArea; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // sla_level - computed: true, optional: true, required: false + private _slaLevel?: string; + public get slaLevel() { + return this.getStringAttribute('sla_level'); + } + public set slaLevel(value: string) { + this._slaLevel = value; + } + public resetSlaLevel() { + this._slaLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get slaLevelInput() { + return this._slaLevel; + } + + // spec_code_id - computed: false, optional: true, required: false + private _specCodeId?: string; + public get specCodeId() { + return this.getStringAttribute('spec_code_id'); + } + public set specCodeId(value: string) { + this._specCodeId = value; + } + public resetSpecCodeId() { + this._specCodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get specCodeIdInput() { + return this._specCodeId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + binding_service: cdktf.stringToTerraform(this._bindingService), + bordercross: cdktf.booleanToTerraform(this._bordercross), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + local_area: cdktf.stringToTerraform(this._localArea), + name: cdktf.stringToTerraform(this._name), + remote_area: cdktf.stringToTerraform(this._remoteArea), + size: cdktf.numberToTerraform(this._size), + sla_level: cdktf.stringToTerraform(this._slaLevel), + spec_code_id: cdktf.stringToTerraform(this._specCodeId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + binding_service: { + value: cdktf.stringToHclTerraform(this._bindingService), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bordercross: { + value: cdktf.booleanToHclTerraform(this._bordercross), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_area: { + value: cdktf.stringToHclTerraform(this._localArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_area: { + value: cdktf.stringToHclTerraform(this._remoteArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sla_level: { + value: cdktf.stringToHclTerraform(this._slaLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_code_id: { + value: cdktf.stringToHclTerraform(this._specCodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/README.md b/src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/README.md new file mode 100644 index 00000000..d71681f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_inter_region_bandwidth` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_inter_region_bandwidth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth). diff --git a/src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/index.ts b/src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/index.ts new file mode 100644 index 00000000..2bc061c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-inter-region-bandwidth/index.ts @@ -0,0 +1,348 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcInterRegionBandwidthConfig extends cdktf.TerraformMetaArguments { + /** + * Inter-region bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#bandwidth CcInterRegionBandwidth#bandwidth} + */ + readonly bandwidth: number; + /** + * Bandwidth package ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#bandwidth_package_id CcInterRegionBandwidth#bandwidth_package_id} + */ + readonly bandwidthPackageId: string; + /** + * Cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#cloud_connection_id CcInterRegionBandwidth#cloud_connection_id} + */ + readonly cloudConnectionId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#id CcInterRegionBandwidth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Two regions to which bandwidth is allocated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#inter_region_ids CcInterRegionBandwidth#inter_region_ids} + */ + readonly interRegionIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#region CcInterRegionBandwidth#region} + */ + readonly region?: string; +} +export interface CcInterRegionBandwidthInterRegions { +} + +export function ccInterRegionBandwidthInterRegionsToTerraform(struct?: CcInterRegionBandwidthInterRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ccInterRegionBandwidthInterRegionsToHclTerraform(struct?: CcInterRegionBandwidthInterRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CcInterRegionBandwidthInterRegionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcInterRegionBandwidthInterRegions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcInterRegionBandwidthInterRegions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_region_id - computed: true, optional: false, required: false + public get localRegionId() { + return this.getStringAttribute('local_region_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // remote_region_id - computed: true, optional: false, required: false + public get remoteRegionId() { + return this.getStringAttribute('remote_region_id'); + } +} + +export class CcInterRegionBandwidthInterRegionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcInterRegionBandwidthInterRegionsOutputReference { + return new CcInterRegionBandwidthInterRegionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth huaweicloud_cc_inter_region_bandwidth} +*/ +export class CcInterRegionBandwidth extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_inter_region_bandwidth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcInterRegionBandwidth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcInterRegionBandwidth to import + * @param importFromId The id of the existing CcInterRegionBandwidth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcInterRegionBandwidth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_inter_region_bandwidth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_inter_region_bandwidth huaweicloud_cc_inter_region_bandwidth} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcInterRegionBandwidthConfig + */ + public constructor(scope: Construct, id: string, config: CcInterRegionBandwidthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_inter_region_bandwidth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidth = config.bandwidth; + this._bandwidthPackageId = config.bandwidthPackageId; + this._cloudConnectionId = config.cloudConnectionId; + this._id = config.id; + this._interRegionIds = config.interRegionIds; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // bandwidth_package_id - computed: false, optional: false, required: true + private _bandwidthPackageId?: string; + public get bandwidthPackageId() { + return this.getStringAttribute('bandwidth_package_id'); + } + public set bandwidthPackageId(value: string) { + this._bandwidthPackageId = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthPackageIdInput() { + return this._bandwidthPackageId; + } + + // cloud_connection_id - computed: false, optional: false, required: true + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inter_region_ids - computed: false, optional: false, required: true + private _interRegionIds?: string[]; + public get interRegionIds() { + return this.getListAttribute('inter_region_ids'); + } + public set interRegionIds(value: string[]) { + this._interRegionIds = value; + } + // Temporarily expose input value. Use with caution. + public get interRegionIdsInput() { + return this._interRegionIds; + } + + // inter_regions - computed: true, optional: false, required: false + private _interRegions = new CcInterRegionBandwidthInterRegionsList(this, "inter_regions", false); + public get interRegions() { + return this._interRegions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth: cdktf.numberToTerraform(this._bandwidth), + bandwidth_package_id: cdktf.stringToTerraform(this._bandwidthPackageId), + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + id: cdktf.stringToTerraform(this._id), + inter_region_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._interRegionIds), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + bandwidth_package_id: { + value: cdktf.stringToHclTerraform(this._bandwidthPackageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inter_region_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._interRegionIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cc-network-instance/README.md b/src/constructs/providers/huaweicloud/cc-network-instance/README.md new file mode 100644 index 00000000..03c7d3c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-network-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cc_network_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_cc_network_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance). diff --git a/src/constructs/providers/huaweicloud/cc-network-instance/index.ts b/src/constructs/providers/huaweicloud/cc-network-instance/index.ts new file mode 100644 index 00000000..aee79bab --- /dev/null +++ b/src/constructs/providers/huaweicloud/cc-network-instance/index.ts @@ -0,0 +1,406 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcNetworkInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * List of routes advertised by the VPC or virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#cidrs CcNetworkInstance#cidrs} + */ + readonly cidrs: string[]; + /** + * Cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#cloud_connection_id CcNetworkInstance#cloud_connection_id} + */ + readonly cloudConnectionId: string; + /** + * The description about the network instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#description CcNetworkInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#id CcNetworkInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Account ID of the VPC or virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#instance_domain_id CcNetworkInstance#instance_domain_id} + */ + readonly instanceDomainId?: string; + /** + * ID of the VPC or virtual gateway to be loaded to the cloud connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#instance_id CcNetworkInstance#instance_id} + */ + readonly instanceId: string; + /** + * The network instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#name CcNetworkInstance#name} + */ + readonly name?: string; + /** + * Project ID of the VPC or virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#project_id CcNetworkInstance#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#region CcNetworkInstance#region} + */ + readonly region?: string; + /** + * Region ID of the VPC or virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#region_id CcNetworkInstance#region_id} + */ + readonly regionId: string; + /** + * Type of the network instance to be loaded to the cloud connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#type CcNetworkInstance#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance huaweicloud_cc_network_instance} +*/ +export class CcNetworkInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_network_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcNetworkInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcNetworkInstance to import + * @param importFromId The id of the existing CcNetworkInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcNetworkInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_network_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cc_network_instance huaweicloud_cc_network_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcNetworkInstanceConfig + */ + public constructor(scope: Construct, id: string, config: CcNetworkInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_network_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidrs = config.cidrs; + this._cloudConnectionId = config.cloudConnectionId; + this._description = config.description; + this._id = config.id; + this._instanceDomainId = config.instanceDomainId; + this._instanceId = config.instanceId; + this._name = config.name; + this._projectId = config.projectId; + this._region = config.region; + this._regionId = config.regionId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidrs - computed: false, optional: false, required: true + private _cidrs?: string[]; + public get cidrs() { + return this.getListAttribute('cidrs'); + } + public set cidrs(value: string[]) { + this._cidrs = value; + } + // Temporarily expose input value. Use with caution. + public get cidrsInput() { + return this._cidrs; + } + + // cloud_connection_id - computed: false, optional: false, required: true + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_domain_id - computed: true, optional: true, required: false + private _instanceDomainId?: string; + public get instanceDomainId() { + return this.getStringAttribute('instance_domain_id'); + } + public set instanceDomainId(value: string) { + this._instanceDomainId = value; + } + public resetInstanceDomainId() { + this._instanceDomainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceDomainIdInput() { + return this._instanceDomainId; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidrs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._cidrs), + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_domain_id: cdktf.stringToTerraform(this._instanceDomainId), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + region_id: cdktf.stringToTerraform(this._regionId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidrs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._cidrs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_domain_id: { + value: cdktf.stringToHclTerraform(this._instanceDomainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-addon/README.md b/src/constructs/providers/huaweicloud/cce-addon/README.md new file mode 100644 index 00000000..974afda2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-addon/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_addon` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_addon`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon). diff --git a/src/constructs/providers/huaweicloud/cce-addon/index.ts b/src/constructs/providers/huaweicloud/cce-addon/index.ts new file mode 100644 index 00000000..e930a0db --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-addon/index.ts @@ -0,0 +1,701 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceAddonConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#cluster_id CceAddon#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#id CceAddon#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#region CceAddon#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#template_name CceAddon#template_name} + */ + readonly templateName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#version CceAddon#version} + */ + readonly version?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#timeouts CceAddon#timeouts} + */ + readonly timeouts?: CceAddonTimeouts; + /** + * values block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#values CceAddon#values} + */ + readonly values?: CceAddonValues; +} +export interface CceAddonTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#create CceAddon#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#delete CceAddon#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#update CceAddon#update} + */ + readonly update?: string; +} + +export function cceAddonTimeoutsToTerraform(struct?: CceAddonTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cceAddonTimeoutsToHclTerraform(struct?: CceAddonTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAddonTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceAddonTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAddonTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface CceAddonValues { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#basic CceAddon#basic} + */ + readonly basic?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#basic_json CceAddon#basic_json} + */ + readonly basicJson?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#custom CceAddon#custom} + */ + readonly custom?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#custom_json CceAddon#custom_json} + */ + readonly customJson?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#flavor CceAddon#flavor} + */ + readonly flavor?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#flavor_json CceAddon#flavor_json} + */ + readonly flavorJson?: string; +} + +export function cceAddonValuesToTerraform(struct?: CceAddonValuesOutputReference | CceAddonValues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + basic: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.basic), + basic_json: cdktf.stringToTerraform(struct!.basicJson), + custom: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.custom), + custom_json: cdktf.stringToTerraform(struct!.customJson), + flavor: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.flavor), + flavor_json: cdktf.stringToTerraform(struct!.flavorJson), + } +} + + +export function cceAddonValuesToHclTerraform(struct?: CceAddonValuesOutputReference | CceAddonValues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + basic: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.basic), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + basic_json: { + value: cdktf.stringToHclTerraform(struct!.basicJson), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.custom), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + custom_json: { + value: cdktf.stringToHclTerraform(struct!.customJson), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.flavor), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + flavor_json: { + value: cdktf.stringToHclTerraform(struct!.flavorJson), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAddonValuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAddonValues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._basic !== undefined) { + hasAnyValues = true; + internalValueResult.basic = this._basic; + } + if (this._basicJson !== undefined) { + hasAnyValues = true; + internalValueResult.basicJson = this._basicJson; + } + if (this._custom !== undefined) { + hasAnyValues = true; + internalValueResult.custom = this._custom; + } + if (this._customJson !== undefined) { + hasAnyValues = true; + internalValueResult.customJson = this._customJson; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._flavorJson !== undefined) { + hasAnyValues = true; + internalValueResult.flavorJson = this._flavorJson; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAddonValues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._basic = undefined; + this._basicJson = undefined; + this._custom = undefined; + this._customJson = undefined; + this._flavor = undefined; + this._flavorJson = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._basic = value.basic; + this._basicJson = value.basicJson; + this._custom = value.custom; + this._customJson = value.customJson; + this._flavor = value.flavor; + this._flavorJson = value.flavorJson; + } + } + + // basic - computed: false, optional: true, required: false + private _basic?: { [key: string]: string }; + public get basic() { + return this.getStringMapAttribute('basic'); + } + public set basic(value: { [key: string]: string }) { + this._basic = value; + } + public resetBasic() { + this._basic = undefined; + } + // Temporarily expose input value. Use with caution. + public get basicInput() { + return this._basic; + } + + // basic_json - computed: false, optional: true, required: false + private _basicJson?: string; + public get basicJson() { + return this.getStringAttribute('basic_json'); + } + public set basicJson(value: string) { + this._basicJson = value; + } + public resetBasicJson() { + this._basicJson = undefined; + } + // Temporarily expose input value. Use with caution. + public get basicJsonInput() { + return this._basicJson; + } + + // custom - computed: false, optional: true, required: false + private _custom?: { [key: string]: string }; + public get custom() { + return this.getStringMapAttribute('custom'); + } + public set custom(value: { [key: string]: string }) { + this._custom = value; + } + public resetCustom() { + this._custom = undefined; + } + // Temporarily expose input value. Use with caution. + public get customInput() { + return this._custom; + } + + // custom_json - computed: false, optional: true, required: false + private _customJson?: string; + public get customJson() { + return this.getStringAttribute('custom_json'); + } + public set customJson(value: string) { + this._customJson = value; + } + public resetCustomJson() { + this._customJson = undefined; + } + // Temporarily expose input value. Use with caution. + public get customJsonInput() { + return this._customJson; + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: { [key: string]: string }; + public get flavor() { + return this.getStringMapAttribute('flavor'); + } + public set flavor(value: { [key: string]: string }) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // flavor_json - computed: false, optional: true, required: false + private _flavorJson?: string; + public get flavorJson() { + return this.getStringAttribute('flavor_json'); + } + public set flavorJson(value: string) { + this._flavorJson = value; + } + public resetFlavorJson() { + this._flavorJson = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorJsonInput() { + return this._flavorJson; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon huaweicloud_cce_addon} +*/ +export class CceAddon extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_addon"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceAddon resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceAddon to import + * @param importFromId The id of the existing CceAddon that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceAddon to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_addon", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_addon huaweicloud_cce_addon} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceAddonConfig + */ + public constructor(scope: Construct, id: string, config: CceAddonConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_addon', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._templateName = config.templateName; + this._version = config.version; + this._timeouts.internalValue = config.timeouts; + this._values.internalValue = config.values; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // template_name - computed: false, optional: false, required: true + private _templateName?: string; + public get templateName() { + return this.getStringAttribute('template_name'); + } + public set templateName(value: string) { + this._templateName = value; + } + // Temporarily expose input value. Use with caution. + public get templateNameInput() { + return this._templateName; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceAddonTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceAddonTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // values - computed: false, optional: true, required: false + private _values = new CceAddonValuesOutputReference(this, "values"); + public get values() { + return this._values; + } + public putValues(value: CceAddonValues) { + this._values.internalValue = value; + } + public resetValues() { + this._values.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + template_name: cdktf.stringToTerraform(this._templateName), + version: cdktf.stringToTerraform(this._version), + timeouts: cceAddonTimeoutsToTerraform(this._timeouts.internalValue), + values: cceAddonValuesToTerraform(this._values.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_name: { + value: cdktf.stringToHclTerraform(this._templateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cceAddonTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceAddonTimeouts", + }, + values: { + value: cceAddonValuesToHclTerraform(this._values.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAddonValuesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-autopilot-addon/README.md b/src/constructs/providers/huaweicloud/cce-autopilot-addon/README.md new file mode 100644 index 00000000..60de9cca --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-autopilot-addon/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_autopilot_addon` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_autopilot_addon`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon). diff --git a/src/constructs/providers/huaweicloud/cce-autopilot-addon/index.ts b/src/constructs/providers/huaweicloud/cce-autopilot-addon/index.ts new file mode 100644 index 00000000..3fb277c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-autopilot-addon/index.ts @@ -0,0 +1,503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceAutopilotAddonConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#addon_template_name CceAutopilotAddon#addon_template_name} + */ + readonly addonTemplateName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#alias CceAutopilotAddon#alias} + */ + readonly alias?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#cluster_id CceAutopilotAddon#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#enable_force_new CceAutopilotAddon#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#id CceAutopilotAddon#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#name CceAutopilotAddon#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#region CceAutopilotAddon#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#values CceAutopilotAddon#values} + */ + readonly values: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#version CceAutopilotAddon#version} + */ + readonly version?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#timeouts CceAutopilotAddon#timeouts} + */ + readonly timeouts?: CceAutopilotAddonTimeouts; +} +export interface CceAutopilotAddonTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#create CceAutopilotAddon#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#delete CceAutopilotAddon#delete} + */ + readonly delete?: string; +} + +export function cceAutopilotAddonTimeoutsToTerraform(struct?: CceAutopilotAddonTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cceAutopilotAddonTimeoutsToHclTerraform(struct?: CceAutopilotAddonTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotAddonTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceAutopilotAddonTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotAddonTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon huaweicloud_cce_autopilot_addon} +*/ +export class CceAutopilotAddon extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_autopilot_addon"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceAutopilotAddon resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceAutopilotAddon to import + * @param importFromId The id of the existing CceAutopilotAddon that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceAutopilotAddon to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_autopilot_addon", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_addon huaweicloud_cce_autopilot_addon} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceAutopilotAddonConfig + */ + public constructor(scope: Construct, id: string, config: CceAutopilotAddonConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_autopilot_addon', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._addonTemplateName = config.addonTemplateName; + this._alias = config.alias; + this._clusterId = config.clusterId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._values = config.values; + this._version = config.version; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // addon_template_name - computed: false, optional: false, required: true + private _addonTemplateName?: string; + public get addonTemplateName() { + return this.getStringAttribute('addon_template_name'); + } + public set addonTemplateName(value: string) { + this._addonTemplateName = value; + } + // Temporarily expose input value. Use with caution. + public get addonTemplateNameInput() { + return this._addonTemplateName; + } + + // alias - computed: true, optional: true, required: false + private _alias?: string; + public get alias() { + return this.getStringAttribute('alias'); + } + public set alias(value: string) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // values - computed: false, optional: false, required: true + private _values?: { [key: string]: string }; + public get values() { + return this.getStringMapAttribute('values'); + } + public set values(value: { [key: string]: string }) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceAutopilotAddonTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceAutopilotAddonTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + addon_template_name: cdktf.stringToTerraform(this._addonTemplateName), + alias: cdktf.stringToTerraform(this._alias), + cluster_id: cdktf.stringToTerraform(this._clusterId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + values: cdktf.hashMapper(cdktf.stringToTerraform)(this._values), + version: cdktf.stringToTerraform(this._version), + timeouts: cceAutopilotAddonTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + addon_template_name: { + value: cdktf.stringToHclTerraform(this._addonTemplateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alias: { + value: cdktf.stringToHclTerraform(this._alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._values), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cceAutopilotAddonTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceAutopilotAddonTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-autopilot-cluster/README.md b/src/constructs/providers/huaweicloud/cce-autopilot-cluster/README.md new file mode 100644 index 00000000..ff2b1ee3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-autopilot-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_autopilot_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_autopilot_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster). diff --git a/src/constructs/providers/huaweicloud/cce-autopilot-cluster/index.ts b/src/constructs/providers/huaweicloud/cce-autopilot-cluster/index.ts new file mode 100644 index 00000000..d993d942 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-autopilot-cluster/index.ts @@ -0,0 +1,2298 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceAutopilotClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#alias CceAutopilotCluster#alias} + */ + readonly alias?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#annotations CceAutopilotCluster#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#category CceAutopilotCluster#category} + */ + readonly category?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#custom_san CceAutopilotCluster#custom_san} + */ + readonly customSan?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#delete_efs CceAutopilotCluster#delete_efs} + */ + readonly deleteEfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#delete_eni CceAutopilotCluster#delete_eni} + */ + readonly deleteEni?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#delete_net CceAutopilotCluster#delete_net} + */ + readonly deleteNet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#delete_obs CceAutopilotCluster#delete_obs} + */ + readonly deleteObs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#delete_sfs30 CceAutopilotCluster#delete_sfs30} + */ + readonly deleteSfs30?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#deletion_protection CceAutopilotCluster#deletion_protection} + */ + readonly deletionProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#description CceAutopilotCluster#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#eip_id CceAutopilotCluster#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#enable_autopilot CceAutopilotCluster#enable_autopilot} + */ + readonly enableAutopilot?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#enable_force_new CceAutopilotCluster#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#enable_snat CceAutopilotCluster#enable_snat} + */ + readonly enableSnat?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#enable_swr_image_access CceAutopilotCluster#enable_swr_image_access} + */ + readonly enableSwrImageAccess?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#flavor CceAutopilotCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#id CceAutopilotCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#ipv6_enable CceAutopilotCluster#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#kube_proxy_mode CceAutopilotCluster#kube_proxy_mode} + */ + readonly kubeProxyMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#lts_reclaim_policy CceAutopilotCluster#lts_reclaim_policy} + */ + readonly ltsReclaimPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#name CceAutopilotCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#region CceAutopilotCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#tags CceAutopilotCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#type CceAutopilotCluster#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#version CceAutopilotCluster#version} + */ + readonly version?: string; + /** + * authentication block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#authentication CceAutopilotCluster#authentication} + */ + readonly authentication?: CceAutopilotClusterAuthentication; + /** + * configurations_override block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#configurations_override CceAutopilotCluster#configurations_override} + */ + readonly configurationsOverride?: CceAutopilotClusterConfigurationsOverride[] | cdktf.IResolvable; + /** + * container_network block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#container_network CceAutopilotCluster#container_network} + */ + readonly containerNetwork: CceAutopilotClusterContainerNetwork; + /** + * eni_network block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#eni_network CceAutopilotCluster#eni_network} + */ + readonly eniNetwork?: CceAutopilotClusterEniNetwork; + /** + * extend_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#extend_param CceAutopilotCluster#extend_param} + */ + readonly extendParam?: CceAutopilotClusterExtendParam; + /** + * host_network block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#host_network CceAutopilotCluster#host_network} + */ + readonly hostNetwork: CceAutopilotClusterHostNetwork; + /** + * service_network block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#service_network CceAutopilotCluster#service_network} + */ + readonly serviceNetwork?: CceAutopilotClusterServiceNetwork; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#timeouts CceAutopilotCluster#timeouts} + */ + readonly timeouts?: CceAutopilotClusterTimeouts; +} +export interface CceAutopilotClusterStatusEndpoints { +} + +export function cceAutopilotClusterStatusEndpointsToTerraform(struct?: CceAutopilotClusterStatusEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceAutopilotClusterStatusEndpointsToHclTerraform(struct?: CceAutopilotClusterStatusEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceAutopilotClusterStatusEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceAutopilotClusterStatusEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterStatusEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class CceAutopilotClusterStatusEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceAutopilotClusterStatusEndpointsOutputReference { + return new CceAutopilotClusterStatusEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceAutopilotClusterStatus { +} + +export function cceAutopilotClusterStatusToTerraform(struct?: CceAutopilotClusterStatus): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceAutopilotClusterStatusToHclTerraform(struct?: CceAutopilotClusterStatus): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceAutopilotClusterStatusOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceAutopilotClusterStatus | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterStatus | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new CceAutopilotClusterStatusEndpointsList(this, "endpoints", false); + public get endpoints() { + return this._endpoints; + } + + // phase - computed: true, optional: false, required: false + public get phase() { + return this.getStringAttribute('phase'); + } +} + +export class CceAutopilotClusterStatusList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceAutopilotClusterStatusOutputReference { + return new CceAutopilotClusterStatusOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceAutopilotClusterAuthentication { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#mode CceAutopilotCluster#mode} + */ + readonly mode?: string; +} + +export function cceAutopilotClusterAuthenticationToTerraform(struct?: CceAutopilotClusterAuthenticationOutputReference | CceAutopilotClusterAuthentication): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + mode: cdktf.stringToTerraform(struct!.mode), + } +} + + +export function cceAutopilotClusterAuthenticationToHclTerraform(struct?: CceAutopilotClusterAuthenticationOutputReference | CceAutopilotClusterAuthentication): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterAuthenticationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAutopilotClusterAuthentication | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterAuthentication | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._mode = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._mode = value.mode; + } + } + + // mode - computed: true, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } +} +export interface CceAutopilotClusterConfigurationsOverrideConfigurations { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#name CceAutopilotCluster#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#value CceAutopilotCluster#value} + */ + readonly value?: string; +} + +export function cceAutopilotClusterConfigurationsOverrideConfigurationsToTerraform(struct?: CceAutopilotClusterConfigurationsOverrideConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cceAutopilotClusterConfigurationsOverrideConfigurationsToHclTerraform(struct?: CceAutopilotClusterConfigurationsOverrideConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterConfigurationsOverrideConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceAutopilotClusterConfigurationsOverrideConfigurations | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterConfigurationsOverrideConfigurations | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CceAutopilotClusterConfigurationsOverrideConfigurationsList extends cdktf.ComplexList { + public internalValue? : CceAutopilotClusterConfigurationsOverrideConfigurations[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceAutopilotClusterConfigurationsOverrideConfigurationsOutputReference { + return new CceAutopilotClusterConfigurationsOverrideConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceAutopilotClusterConfigurationsOverride { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#name CceAutopilotCluster#name} + */ + readonly name?: string; + /** + * configurations block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#configurations CceAutopilotCluster#configurations} + */ + readonly configurations?: CceAutopilotClusterConfigurationsOverrideConfigurations[] | cdktf.IResolvable; +} + +export function cceAutopilotClusterConfigurationsOverrideToTerraform(struct?: CceAutopilotClusterConfigurationsOverride | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + configurations: cdktf.listMapper(cceAutopilotClusterConfigurationsOverrideConfigurationsToTerraform, true)(struct!.configurations), + } +} + + +export function cceAutopilotClusterConfigurationsOverrideToHclTerraform(struct?: CceAutopilotClusterConfigurationsOverride | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configurations: { + value: cdktf.listMapperHcl(cceAutopilotClusterConfigurationsOverrideConfigurationsToHclTerraform, true)(struct!.configurations), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterConfigurationsOverrideConfigurationsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterConfigurationsOverrideOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceAutopilotClusterConfigurationsOverride | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._configurations?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configurations = this._configurations?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterConfigurationsOverride | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._configurations.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._configurations.internalValue = value.configurations; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // configurations - computed: false, optional: true, required: false + private _configurations = new CceAutopilotClusterConfigurationsOverrideConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + public putConfigurations(value: CceAutopilotClusterConfigurationsOverrideConfigurations[] | cdktf.IResolvable) { + this._configurations.internalValue = value; + } + public resetConfigurations() { + this._configurations.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations.internalValue; + } +} + +export class CceAutopilotClusterConfigurationsOverrideList extends cdktf.ComplexList { + public internalValue? : CceAutopilotClusterConfigurationsOverride[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceAutopilotClusterConfigurationsOverrideOutputReference { + return new CceAutopilotClusterConfigurationsOverrideOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceAutopilotClusterContainerNetwork { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#mode CceAutopilotCluster#mode} + */ + readonly mode: string; +} + +export function cceAutopilotClusterContainerNetworkToTerraform(struct?: CceAutopilotClusterContainerNetworkOutputReference | CceAutopilotClusterContainerNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + mode: cdktf.stringToTerraform(struct!.mode), + } +} + + +export function cceAutopilotClusterContainerNetworkToHclTerraform(struct?: CceAutopilotClusterContainerNetworkOutputReference | CceAutopilotClusterContainerNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterContainerNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAutopilotClusterContainerNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterContainerNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._mode = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._mode = value.mode; + } + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } +} +export interface CceAutopilotClusterEniNetworkSubnets { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#subnet_id CceAutopilotCluster#subnet_id} + */ + readonly subnetId: string; +} + +export function cceAutopilotClusterEniNetworkSubnetsToTerraform(struct?: CceAutopilotClusterEniNetworkSubnets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function cceAutopilotClusterEniNetworkSubnetsToHclTerraform(struct?: CceAutopilotClusterEniNetworkSubnets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterEniNetworkSubnetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceAutopilotClusterEniNetworkSubnets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterEniNetworkSubnets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._subnetId = value.subnetId; + } + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class CceAutopilotClusterEniNetworkSubnetsList extends cdktf.ComplexList { + public internalValue? : CceAutopilotClusterEniNetworkSubnets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceAutopilotClusterEniNetworkSubnetsOutputReference { + return new CceAutopilotClusterEniNetworkSubnetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceAutopilotClusterEniNetwork { + /** + * subnets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#subnets CceAutopilotCluster#subnets} + */ + readonly subnets: CceAutopilotClusterEniNetworkSubnets[] | cdktf.IResolvable; +} + +export function cceAutopilotClusterEniNetworkToTerraform(struct?: CceAutopilotClusterEniNetworkOutputReference | CceAutopilotClusterEniNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnets: cdktf.listMapper(cceAutopilotClusterEniNetworkSubnetsToTerraform, true)(struct!.subnets), + } +} + + +export function cceAutopilotClusterEniNetworkToHclTerraform(struct?: CceAutopilotClusterEniNetworkOutputReference | CceAutopilotClusterEniNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnets: { + value: cdktf.listMapperHcl(cceAutopilotClusterEniNetworkSubnetsToHclTerraform, true)(struct!.subnets), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterEniNetworkSubnetsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterEniNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAutopilotClusterEniNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnets?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.subnets = this._subnets?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterEniNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._subnets.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._subnets.internalValue = value.subnets; + } + } + + // subnets - computed: false, optional: false, required: true + private _subnets = new CceAutopilotClusterEniNetworkSubnetsList(this, "subnets", false); + public get subnets() { + return this._subnets; + } + public putSubnets(value: CceAutopilotClusterEniNetworkSubnets[] | cdktf.IResolvable) { + this._subnets.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get subnetsInput() { + return this._subnets.internalValue; + } +} +export interface CceAutopilotClusterExtendParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#enterprise_project_id CceAutopilotCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; +} + +export function cceAutopilotClusterExtendParamToTerraform(struct?: CceAutopilotClusterExtendParamOutputReference | CceAutopilotClusterExtendParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enterprise_project_id: cdktf.stringToTerraform(struct!.enterpriseProjectId), + } +} + + +export function cceAutopilotClusterExtendParamToHclTerraform(struct?: CceAutopilotClusterExtendParamOutputReference | CceAutopilotClusterExtendParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterExtendParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAutopilotClusterExtendParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enterpriseProjectId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseProjectId = this._enterpriseProjectId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterExtendParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enterpriseProjectId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enterpriseProjectId = value.enterpriseProjectId; + } + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } +} +export interface CceAutopilotClusterHostNetwork { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#subnet CceAutopilotCluster#subnet} + */ + readonly subnet: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#vpc CceAutopilotCluster#vpc} + */ + readonly vpc: string; +} + +export function cceAutopilotClusterHostNetworkToTerraform(struct?: CceAutopilotClusterHostNetworkOutputReference | CceAutopilotClusterHostNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet: cdktf.stringToTerraform(struct!.subnet), + vpc: cdktf.stringToTerraform(struct!.vpc), + } +} + + +export function cceAutopilotClusterHostNetworkToHclTerraform(struct?: CceAutopilotClusterHostNetworkOutputReference | CceAutopilotClusterHostNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet: { + value: cdktf.stringToHclTerraform(struct!.subnet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc: { + value: cdktf.stringToHclTerraform(struct!.vpc), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterHostNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAutopilotClusterHostNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnet !== undefined) { + hasAnyValues = true; + internalValueResult.subnet = this._subnet; + } + if (this._vpc !== undefined) { + hasAnyValues = true; + internalValueResult.vpc = this._vpc; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterHostNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._subnet = undefined; + this._vpc = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._subnet = value.subnet; + this._vpc = value.vpc; + } + } + + // subnet - computed: false, optional: false, required: true + private _subnet?: string; + public get subnet() { + return this.getStringAttribute('subnet'); + } + public set subnet(value: string) { + this._subnet = value; + } + // Temporarily expose input value. Use with caution. + public get subnetInput() { + return this._subnet; + } + + // vpc - computed: false, optional: false, required: true + private _vpc?: string; + public get vpc() { + return this.getStringAttribute('vpc'); + } + public set vpc(value: string) { + this._vpc = value; + } + // Temporarily expose input value. Use with caution. + public get vpcInput() { + return this._vpc; + } +} +export interface CceAutopilotClusterServiceNetwork { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#ipv4_cidr CceAutopilotCluster#ipv4_cidr} + */ + readonly ipv4Cidr?: string; +} + +export function cceAutopilotClusterServiceNetworkToTerraform(struct?: CceAutopilotClusterServiceNetworkOutputReference | CceAutopilotClusterServiceNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ipv4_cidr: cdktf.stringToTerraform(struct!.ipv4Cidr), + } +} + + +export function cceAutopilotClusterServiceNetworkToHclTerraform(struct?: CceAutopilotClusterServiceNetworkOutputReference | CceAutopilotClusterServiceNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ipv4_cidr: { + value: cdktf.stringToHclTerraform(struct!.ipv4Cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterServiceNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceAutopilotClusterServiceNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipv4Cidr !== undefined) { + hasAnyValues = true; + internalValueResult.ipv4Cidr = this._ipv4Cidr; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterServiceNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipv4Cidr = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipv4Cidr = value.ipv4Cidr; + } + } + + // ipv4_cidr - computed: true, optional: true, required: false + private _ipv4Cidr?: string; + public get ipv4Cidr() { + return this.getStringAttribute('ipv4_cidr'); + } + public set ipv4Cidr(value: string) { + this._ipv4Cidr = value; + } + public resetIpv4Cidr() { + this._ipv4Cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv4CidrInput() { + return this._ipv4Cidr; + } +} +export interface CceAutopilotClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#create CceAutopilotCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#delete CceAutopilotCluster#delete} + */ + readonly delete?: string; +} + +export function cceAutopilotClusterTimeoutsToTerraform(struct?: CceAutopilotClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cceAutopilotClusterTimeoutsToHclTerraform(struct?: CceAutopilotClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceAutopilotClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceAutopilotClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceAutopilotClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster huaweicloud_cce_autopilot_cluster} +*/ +export class CceAutopilotCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_autopilot_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceAutopilotCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceAutopilotCluster to import + * @param importFromId The id of the existing CceAutopilotCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceAutopilotCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_autopilot_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_autopilot_cluster huaweicloud_cce_autopilot_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceAutopilotClusterConfig + */ + public constructor(scope: Construct, id: string, config: CceAutopilotClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_autopilot_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alias = config.alias; + this._annotations = config.annotations; + this._category = config.category; + this._customSan = config.customSan; + this._deleteEfs = config.deleteEfs; + this._deleteEni = config.deleteEni; + this._deleteNet = config.deleteNet; + this._deleteObs = config.deleteObs; + this._deleteSfs30 = config.deleteSfs30; + this._deletionProtection = config.deletionProtection; + this._description = config.description; + this._eipId = config.eipId; + this._enableAutopilot = config.enableAutopilot; + this._enableForceNew = config.enableForceNew; + this._enableSnat = config.enableSnat; + this._enableSwrImageAccess = config.enableSwrImageAccess; + this._flavor = config.flavor; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._kubeProxyMode = config.kubeProxyMode; + this._ltsReclaimPolicy = config.ltsReclaimPolicy; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + this._version = config.version; + this._authentication.internalValue = config.authentication; + this._configurationsOverride.internalValue = config.configurationsOverride; + this._containerNetwork.internalValue = config.containerNetwork; + this._eniNetwork.internalValue = config.eniNetwork; + this._extendParam.internalValue = config.extendParam; + this._hostNetwork.internalValue = config.hostNetwork; + this._serviceNetwork.internalValue = config.serviceNetwork; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // alias - computed: true, optional: true, required: false + private _alias?: string; + public get alias() { + return this.getStringAttribute('alias'); + } + public set alias(value: string) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // annotations - computed: true, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // az - computed: true, optional: false, required: false + public get az() { + return this.getStringAttribute('az'); + } + + // category - computed: true, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // custom_san - computed: true, optional: true, required: false + private _customSan?: string[]; + public get customSan() { + return this.getListAttribute('custom_san'); + } + public set customSan(value: string[]) { + this._customSan = value; + } + public resetCustomSan() { + this._customSan = undefined; + } + // Temporarily expose input value. Use with caution. + public get customSanInput() { + return this._customSan; + } + + // delete_efs - computed: false, optional: true, required: false + private _deleteEfs?: string; + public get deleteEfs() { + return this.getStringAttribute('delete_efs'); + } + public set deleteEfs(value: string) { + this._deleteEfs = value; + } + public resetDeleteEfs() { + this._deleteEfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEfsInput() { + return this._deleteEfs; + } + + // delete_eni - computed: false, optional: true, required: false + private _deleteEni?: string; + public get deleteEni() { + return this.getStringAttribute('delete_eni'); + } + public set deleteEni(value: string) { + this._deleteEni = value; + } + public resetDeleteEni() { + this._deleteEni = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEniInput() { + return this._deleteEni; + } + + // delete_net - computed: false, optional: true, required: false + private _deleteNet?: string; + public get deleteNet() { + return this.getStringAttribute('delete_net'); + } + public set deleteNet(value: string) { + this._deleteNet = value; + } + public resetDeleteNet() { + this._deleteNet = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteNetInput() { + return this._deleteNet; + } + + // delete_obs - computed: false, optional: true, required: false + private _deleteObs?: string; + public get deleteObs() { + return this.getStringAttribute('delete_obs'); + } + public set deleteObs(value: string) { + this._deleteObs = value; + } + public resetDeleteObs() { + this._deleteObs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteObsInput() { + return this._deleteObs; + } + + // delete_sfs30 - computed: false, optional: true, required: false + private _deleteSfs30?: string; + public get deleteSfs30() { + return this.getStringAttribute('delete_sfs30'); + } + public set deleteSfs30(value: string) { + this._deleteSfs30 = value; + } + public resetDeleteSfs30() { + this._deleteSfs30 = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteSfs30Input() { + return this._deleteSfs30; + } + + // deletion_protection - computed: true, optional: true, required: false + private _deletionProtection?: boolean | cdktf.IResolvable; + public get deletionProtection() { + return this.getBooleanAttribute('deletion_protection'); + } + public set deletionProtection(value: boolean | cdktf.IResolvable) { + this._deletionProtection = value; + } + public resetDeletionProtection() { + this._deletionProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletionProtectionInput() { + return this._deletionProtection; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // enable_autopilot - computed: false, optional: true, required: false + private _enableAutopilot?: boolean | cdktf.IResolvable; + public get enableAutopilot() { + return this.getBooleanAttribute('enable_autopilot'); + } + public set enableAutopilot(value: boolean | cdktf.IResolvable) { + this._enableAutopilot = value; + } + public resetEnableAutopilot() { + this._enableAutopilot = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAutopilotInput() { + return this._enableAutopilot; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // enable_snat - computed: true, optional: true, required: false + private _enableSnat?: boolean | cdktf.IResolvable; + public get enableSnat() { + return this.getBooleanAttribute('enable_snat'); + } + public set enableSnat(value: boolean | cdktf.IResolvable) { + this._enableSnat = value; + } + public resetEnableSnat() { + this._enableSnat = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableSnatInput() { + return this._enableSnat; + } + + // enable_swr_image_access - computed: true, optional: true, required: false + private _enableSwrImageAccess?: boolean | cdktf.IResolvable; + public get enableSwrImageAccess() { + return this.getBooleanAttribute('enable_swr_image_access'); + } + public set enableSwrImageAccess(value: boolean | cdktf.IResolvable) { + this._enableSwrImageAccess = value; + } + public resetEnableSwrImageAccess() { + this._enableSwrImageAccess = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableSwrImageAccessInput() { + return this._enableSwrImageAccess; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // kube_proxy_mode - computed: true, optional: true, required: false + private _kubeProxyMode?: string; + public get kubeProxyMode() { + return this.getStringAttribute('kube_proxy_mode'); + } + public set kubeProxyMode(value: string) { + this._kubeProxyMode = value; + } + public resetKubeProxyMode() { + this._kubeProxyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get kubeProxyModeInput() { + return this._kubeProxyMode; + } + + // lts_reclaim_policy - computed: false, optional: true, required: false + private _ltsReclaimPolicy?: string; + public get ltsReclaimPolicy() { + return this.getStringAttribute('lts_reclaim_policy'); + } + public set ltsReclaimPolicy(value: string) { + this._ltsReclaimPolicy = value; + } + public resetLtsReclaimPolicy() { + this._ltsReclaimPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsReclaimPolicyInput() { + return this._ltsReclaimPolicy; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // platform_version - computed: true, optional: false, required: false + public get platformVersion() { + return this.getStringAttribute('platform_version'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + private _status = new CceAutopilotClusterStatusList(this, "status", false); + public get status() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // authentication - computed: false, optional: true, required: false + private _authentication = new CceAutopilotClusterAuthenticationOutputReference(this, "authentication"); + public get authentication() { + return this._authentication; + } + public putAuthentication(value: CceAutopilotClusterAuthentication) { + this._authentication.internalValue = value; + } + public resetAuthentication() { + this._authentication.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationInput() { + return this._authentication.internalValue; + } + + // configurations_override - computed: false, optional: true, required: false + private _configurationsOverride = new CceAutopilotClusterConfigurationsOverrideList(this, "configurations_override", false); + public get configurationsOverride() { + return this._configurationsOverride; + } + public putConfigurationsOverride(value: CceAutopilotClusterConfigurationsOverride[] | cdktf.IResolvable) { + this._configurationsOverride.internalValue = value; + } + public resetConfigurationsOverride() { + this._configurationsOverride.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsOverrideInput() { + return this._configurationsOverride.internalValue; + } + + // container_network - computed: false, optional: false, required: true + private _containerNetwork = new CceAutopilotClusterContainerNetworkOutputReference(this, "container_network"); + public get containerNetwork() { + return this._containerNetwork; + } + public putContainerNetwork(value: CceAutopilotClusterContainerNetwork) { + this._containerNetwork.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get containerNetworkInput() { + return this._containerNetwork.internalValue; + } + + // eni_network - computed: false, optional: true, required: false + private _eniNetwork = new CceAutopilotClusterEniNetworkOutputReference(this, "eni_network"); + public get eniNetwork() { + return this._eniNetwork; + } + public putEniNetwork(value: CceAutopilotClusterEniNetwork) { + this._eniNetwork.internalValue = value; + } + public resetEniNetwork() { + this._eniNetwork.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eniNetworkInput() { + return this._eniNetwork.internalValue; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam = new CceAutopilotClusterExtendParamOutputReference(this, "extend_param"); + public get extendParam() { + return this._extendParam; + } + public putExtendParam(value: CceAutopilotClusterExtendParam) { + this._extendParam.internalValue = value; + } + public resetExtendParam() { + this._extendParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam.internalValue; + } + + // host_network - computed: false, optional: false, required: true + private _hostNetwork = new CceAutopilotClusterHostNetworkOutputReference(this, "host_network"); + public get hostNetwork() { + return this._hostNetwork; + } + public putHostNetwork(value: CceAutopilotClusterHostNetwork) { + this._hostNetwork.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get hostNetworkInput() { + return this._hostNetwork.internalValue; + } + + // service_network - computed: false, optional: true, required: false + private _serviceNetwork = new CceAutopilotClusterServiceNetworkOutputReference(this, "service_network"); + public get serviceNetwork() { + return this._serviceNetwork; + } + public putServiceNetwork(value: CceAutopilotClusterServiceNetwork) { + this._serviceNetwork.internalValue = value; + } + public resetServiceNetwork() { + this._serviceNetwork.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNetworkInput() { + return this._serviceNetwork.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceAutopilotClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceAutopilotClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alias: cdktf.stringToTerraform(this._alias), + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + category: cdktf.stringToTerraform(this._category), + custom_san: cdktf.listMapper(cdktf.stringToTerraform, false)(this._customSan), + delete_efs: cdktf.stringToTerraform(this._deleteEfs), + delete_eni: cdktf.stringToTerraform(this._deleteEni), + delete_net: cdktf.stringToTerraform(this._deleteNet), + delete_obs: cdktf.stringToTerraform(this._deleteObs), + delete_sfs30: cdktf.stringToTerraform(this._deleteSfs30), + deletion_protection: cdktf.booleanToTerraform(this._deletionProtection), + description: cdktf.stringToTerraform(this._description), + eip_id: cdktf.stringToTerraform(this._eipId), + enable_autopilot: cdktf.booleanToTerraform(this._enableAutopilot), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + enable_snat: cdktf.booleanToTerraform(this._enableSnat), + enable_swr_image_access: cdktf.booleanToTerraform(this._enableSwrImageAccess), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + kube_proxy_mode: cdktf.stringToTerraform(this._kubeProxyMode), + lts_reclaim_policy: cdktf.stringToTerraform(this._ltsReclaimPolicy), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + authentication: cceAutopilotClusterAuthenticationToTerraform(this._authentication.internalValue), + configurations_override: cdktf.listMapper(cceAutopilotClusterConfigurationsOverrideToTerraform, true)(this._configurationsOverride.internalValue), + container_network: cceAutopilotClusterContainerNetworkToTerraform(this._containerNetwork.internalValue), + eni_network: cceAutopilotClusterEniNetworkToTerraform(this._eniNetwork.internalValue), + extend_param: cceAutopilotClusterExtendParamToTerraform(this._extendParam.internalValue), + host_network: cceAutopilotClusterHostNetworkToTerraform(this._hostNetwork.internalValue), + service_network: cceAutopilotClusterServiceNetworkToTerraform(this._serviceNetwork.internalValue), + timeouts: cceAutopilotClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alias: { + value: cdktf.stringToHclTerraform(this._alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_san: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._customSan), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + delete_efs: { + value: cdktf.stringToHclTerraform(this._deleteEfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_eni: { + value: cdktf.stringToHclTerraform(this._deleteEni), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_net: { + value: cdktf.stringToHclTerraform(this._deleteNet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_obs: { + value: cdktf.stringToHclTerraform(this._deleteObs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_sfs30: { + value: cdktf.stringToHclTerraform(this._deleteSfs30), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deletion_protection: { + value: cdktf.booleanToHclTerraform(this._deletionProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_autopilot: { + value: cdktf.booleanToHclTerraform(this._enableAutopilot), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_snat: { + value: cdktf.booleanToHclTerraform(this._enableSnat), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_swr_image_access: { + value: cdktf.booleanToHclTerraform(this._enableSwrImageAccess), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kube_proxy_mode: { + value: cdktf.stringToHclTerraform(this._kubeProxyMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_reclaim_policy: { + value: cdktf.stringToHclTerraform(this._ltsReclaimPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication: { + value: cceAutopilotClusterAuthenticationToHclTerraform(this._authentication.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterAuthenticationList", + }, + configurations_override: { + value: cdktf.listMapperHcl(cceAutopilotClusterConfigurationsOverrideToHclTerraform, true)(this._configurationsOverride.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterConfigurationsOverrideList", + }, + container_network: { + value: cceAutopilotClusterContainerNetworkToHclTerraform(this._containerNetwork.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterContainerNetworkList", + }, + eni_network: { + value: cceAutopilotClusterEniNetworkToHclTerraform(this._eniNetwork.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterEniNetworkList", + }, + extend_param: { + value: cceAutopilotClusterExtendParamToHclTerraform(this._extendParam.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterExtendParamList", + }, + host_network: { + value: cceAutopilotClusterHostNetworkToHclTerraform(this._hostNetwork.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterHostNetworkList", + }, + service_network: { + value: cceAutopilotClusterServiceNetworkToHclTerraform(this._serviceNetwork.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceAutopilotClusterServiceNetworkList", + }, + timeouts: { + value: cceAutopilotClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceAutopilotClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-chart/README.md b/src/constructs/providers/huaweicloud/cce-chart/README.md new file mode 100644 index 00000000..2c96a120 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-chart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_chart` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_chart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart). diff --git a/src/constructs/providers/huaweicloud/cce-chart/index.ts b/src/constructs/providers/huaweicloud/cce-chart/index.ts new file mode 100644 index 00000000..3576c657 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-chart/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceChartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart#content CceChart#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart#id CceChart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart#parameters CceChart#parameters} + */ + readonly parameters?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart#region CceChart#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart huaweicloud_cce_chart} +*/ +export class CceChart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_chart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceChart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceChart to import + * @param importFromId The id of the existing CceChart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceChart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_chart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_chart huaweicloud_cce_chart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceChartConfig + */ + public constructor(scope: Construct, id: string, config: CceChartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_chart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._parameters = config.parameters; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // chart_url - computed: true, optional: false, required: false + public get chartUrl() { + return this.getStringAttribute('chart_url'); + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instruction - computed: true, optional: false, required: false + public get instruction() { + return this.getStringAttribute('instruction'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parameters - computed: false, optional: true, required: false + private _parameters?: string; + public get parameters() { + return this.getStringAttribute('parameters'); + } + public set parameters(value: string) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // public - computed: true, optional: false, required: false + public get public() { + return this.getBooleanAttribute('public'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // translate - computed: true, optional: false, required: false + public get translate() { + return this.getStringAttribute('translate'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + parameters: cdktf.stringToTerraform(this._parameters), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.stringToHclTerraform(this._parameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-cluster-log-config/README.md b/src/constructs/providers/huaweicloud/cce-cluster-log-config/README.md new file mode 100644 index 00000000..0cee805b --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster-log-config/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_cluster_log_config` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_cluster_log_config`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config). diff --git a/src/constructs/providers/huaweicloud/cce-cluster-log-config/index.ts b/src/constructs/providers/huaweicloud/cce-cluster-log-config/index.ts new file mode 100644 index 00000000..980fc0f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster-log-config/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceClusterLogConfigConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#cluster_id CceClusterLogConfig#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#id CceClusterLogConfig#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#region CceClusterLogConfig#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#ttl_in_days CceClusterLogConfig#ttl_in_days} + */ + readonly ttlInDays?: number; + /** + * log_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#log_configs CceClusterLogConfig#log_configs} + */ + readonly logConfigs?: CceClusterLogConfigLogConfigs[] | cdktf.IResolvable; +} +export interface CceClusterLogConfigLogConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#enable CceClusterLogConfig#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#name CceClusterLogConfig#name} + */ + readonly name?: string; +} + +export function cceClusterLogConfigLogConfigsToTerraform(struct?: CceClusterLogConfigLogConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable: cdktf.booleanToTerraform(struct!.enable), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function cceClusterLogConfigLogConfigsToHclTerraform(struct?: CceClusterLogConfigLogConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterLogConfigLogConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterLogConfigLogConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterLogConfigLogConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._enable = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._enable = value.enable; + this._name = value.name; + } + } + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class CceClusterLogConfigLogConfigsList extends cdktf.ComplexList { + public internalValue? : CceClusterLogConfigLogConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterLogConfigLogConfigsOutputReference { + return new CceClusterLogConfigLogConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config huaweicloud_cce_cluster_log_config} +*/ +export class CceClusterLogConfig extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster_log_config"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceClusterLogConfig resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceClusterLogConfig to import + * @param importFromId The id of the existing CceClusterLogConfig that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceClusterLogConfig to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster_log_config", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_log_config huaweicloud_cce_cluster_log_config} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceClusterLogConfigConfig + */ + public constructor(scope: Construct, id: string, config: CceClusterLogConfigConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster_log_config', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._ttlInDays = config.ttlInDays; + this._logConfigs.internalValue = config.logConfigs; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ttl_in_days - computed: true, optional: true, required: false + private _ttlInDays?: number; + public get ttlInDays() { + return this.getNumberAttribute('ttl_in_days'); + } + public set ttlInDays(value: number) { + this._ttlInDays = value; + } + public resetTtlInDays() { + this._ttlInDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInDaysInput() { + return this._ttlInDays; + } + + // log_configs - computed: false, optional: true, required: false + private _logConfigs = new CceClusterLogConfigLogConfigsList(this, "log_configs", true); + public get logConfigs() { + return this._logConfigs; + } + public putLogConfigs(value: CceClusterLogConfigLogConfigs[] | cdktf.IResolvable) { + this._logConfigs.internalValue = value; + } + public resetLogConfigs() { + this._logConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logConfigsInput() { + return this._logConfigs.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + ttl_in_days: cdktf.numberToTerraform(this._ttlInDays), + log_configs: cdktf.listMapper(cceClusterLogConfigLogConfigsToTerraform, true)(this._logConfigs.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ttl_in_days: { + value: cdktf.numberToHclTerraform(this._ttlInDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + log_configs: { + value: cdktf.listMapperHcl(cceClusterLogConfigLogConfigsToHclTerraform, true)(this._logConfigs.internalValue), + isBlock: true, + type: "set", + storageClassType: "CceClusterLogConfigLogConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-cluster-upgrade/README.md b/src/constructs/providers/huaweicloud/cce-cluster-upgrade/README.md new file mode 100644 index 00000000..e229e3bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster-upgrade/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_cluster_upgrade` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_cluster_upgrade`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade). diff --git a/src/constructs/providers/huaweicloud/cce-cluster-upgrade/index.ts b/src/constructs/providers/huaweicloud/cce-cluster-upgrade/index.ts new file mode 100644 index 00000000..5de0a6b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster-upgrade/index.ts @@ -0,0 +1,1017 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceClusterUpgradeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#cluster_id CceClusterUpgrade#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#enable_force_new CceClusterUpgrade#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#id CceClusterUpgrade#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#node_order CceClusterUpgrade#node_order} + */ + readonly nodeOrder?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#nodepool_order CceClusterUpgrade#nodepool_order} + */ + readonly nodepoolOrder?: { [key: string]: number }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#region CceClusterUpgrade#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#target_version CceClusterUpgrade#target_version} + */ + readonly targetVersion: string; + /** + * addons block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#addons CceClusterUpgrade#addons} + */ + readonly addons?: CceClusterUpgradeAddons[] | cdktf.IResolvable; + /** + * strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#strategy CceClusterUpgrade#strategy} + */ + readonly strategy: CceClusterUpgradeStrategy; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#timeouts CceClusterUpgrade#timeouts} + */ + readonly timeouts?: CceClusterUpgradeTimeouts; +} +export interface CceClusterUpgradeAddonsValues { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#basic_json CceClusterUpgrade#basic_json} + */ + readonly basicJson?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#custom_json CceClusterUpgrade#custom_json} + */ + readonly customJson?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#flavor_json CceClusterUpgrade#flavor_json} + */ + readonly flavorJson?: string; +} + +export function cceClusterUpgradeAddonsValuesToTerraform(struct?: CceClusterUpgradeAddonsValuesOutputReference | CceClusterUpgradeAddonsValues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + basic_json: cdktf.stringToTerraform(struct!.basicJson), + custom_json: cdktf.stringToTerraform(struct!.customJson), + flavor_json: cdktf.stringToTerraform(struct!.flavorJson), + } +} + + +export function cceClusterUpgradeAddonsValuesToHclTerraform(struct?: CceClusterUpgradeAddonsValuesOutputReference | CceClusterUpgradeAddonsValues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + basic_json: { + value: cdktf.stringToHclTerraform(struct!.basicJson), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_json: { + value: cdktf.stringToHclTerraform(struct!.customJson), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_json: { + value: cdktf.stringToHclTerraform(struct!.flavorJson), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterUpgradeAddonsValuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceClusterUpgradeAddonsValues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._basicJson !== undefined) { + hasAnyValues = true; + internalValueResult.basicJson = this._basicJson; + } + if (this._customJson !== undefined) { + hasAnyValues = true; + internalValueResult.customJson = this._customJson; + } + if (this._flavorJson !== undefined) { + hasAnyValues = true; + internalValueResult.flavorJson = this._flavorJson; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterUpgradeAddonsValues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._basicJson = undefined; + this._customJson = undefined; + this._flavorJson = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._basicJson = value.basicJson; + this._customJson = value.customJson; + this._flavorJson = value.flavorJson; + } + } + + // basic_json - computed: false, optional: true, required: false + private _basicJson?: string; + public get basicJson() { + return this.getStringAttribute('basic_json'); + } + public set basicJson(value: string) { + this._basicJson = value; + } + public resetBasicJson() { + this._basicJson = undefined; + } + // Temporarily expose input value. Use with caution. + public get basicJsonInput() { + return this._basicJson; + } + + // custom_json - computed: false, optional: true, required: false + private _customJson?: string; + public get customJson() { + return this.getStringAttribute('custom_json'); + } + public set customJson(value: string) { + this._customJson = value; + } + public resetCustomJson() { + this._customJson = undefined; + } + // Temporarily expose input value. Use with caution. + public get customJsonInput() { + return this._customJson; + } + + // flavor_json - computed: false, optional: true, required: false + private _flavorJson?: string; + public get flavorJson() { + return this.getStringAttribute('flavor_json'); + } + public set flavorJson(value: string) { + this._flavorJson = value; + } + public resetFlavorJson() { + this._flavorJson = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorJsonInput() { + return this._flavorJson; + } +} +export interface CceClusterUpgradeAddons { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#addon_template_name CceClusterUpgrade#addon_template_name} + */ + readonly addonTemplateName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#operation CceClusterUpgrade#operation} + */ + readonly operation: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#version CceClusterUpgrade#version} + */ + readonly version: string; + /** + * values block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#values CceClusterUpgrade#values} + */ + readonly values?: CceClusterUpgradeAddonsValues; +} + +export function cceClusterUpgradeAddonsToTerraform(struct?: CceClusterUpgradeAddons | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + addon_template_name: cdktf.stringToTerraform(struct!.addonTemplateName), + operation: cdktf.stringToTerraform(struct!.operation), + version: cdktf.stringToTerraform(struct!.version), + values: cceClusterUpgradeAddonsValuesToTerraform(struct!.values), + } +} + + +export function cceClusterUpgradeAddonsToHclTerraform(struct?: CceClusterUpgradeAddons | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + addon_template_name: { + value: cdktf.stringToHclTerraform(struct!.addonTemplateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation: { + value: cdktf.stringToHclTerraform(struct!.operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cceClusterUpgradeAddonsValuesToHclTerraform(struct!.values), + isBlock: true, + type: "list", + storageClassType: "CceClusterUpgradeAddonsValuesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterUpgradeAddonsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterUpgradeAddons | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._addonTemplateName !== undefined) { + hasAnyValues = true; + internalValueResult.addonTemplateName = this._addonTemplateName; + } + if (this._operation !== undefined) { + hasAnyValues = true; + internalValueResult.operation = this._operation; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + if (this._values?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterUpgradeAddons | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._addonTemplateName = undefined; + this._operation = undefined; + this._version = undefined; + this._values.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._addonTemplateName = value.addonTemplateName; + this._operation = value.operation; + this._version = value.version; + this._values.internalValue = value.values; + } + } + + // addon_template_name - computed: false, optional: false, required: true + private _addonTemplateName?: string; + public get addonTemplateName() { + return this.getStringAttribute('addon_template_name'); + } + public set addonTemplateName(value: string) { + this._addonTemplateName = value; + } + // Temporarily expose input value. Use with caution. + public get addonTemplateNameInput() { + return this._addonTemplateName; + } + + // operation - computed: false, optional: false, required: true + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // values - computed: false, optional: true, required: false + private _values = new CceClusterUpgradeAddonsValuesOutputReference(this, "values"); + public get values() { + return this._values; + } + public putValues(value: CceClusterUpgradeAddonsValues) { + this._values.internalValue = value; + } + public resetValues() { + this._values.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values.internalValue; + } +} + +export class CceClusterUpgradeAddonsList extends cdktf.ComplexList { + public internalValue? : CceClusterUpgradeAddons[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterUpgradeAddonsOutputReference { + return new CceClusterUpgradeAddonsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterUpgradeStrategyInPlaceRollingUpdate { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#user_defined_step CceClusterUpgrade#user_defined_step} + */ + readonly userDefinedStep?: number; +} + +export function cceClusterUpgradeStrategyInPlaceRollingUpdateToTerraform(struct?: CceClusterUpgradeStrategyInPlaceRollingUpdateOutputReference | CceClusterUpgradeStrategyInPlaceRollingUpdate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + user_defined_step: cdktf.numberToTerraform(struct!.userDefinedStep), + } +} + + +export function cceClusterUpgradeStrategyInPlaceRollingUpdateToHclTerraform(struct?: CceClusterUpgradeStrategyInPlaceRollingUpdateOutputReference | CceClusterUpgradeStrategyInPlaceRollingUpdate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + user_defined_step: { + value: cdktf.numberToHclTerraform(struct!.userDefinedStep), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterUpgradeStrategyInPlaceRollingUpdateOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceClusterUpgradeStrategyInPlaceRollingUpdate | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._userDefinedStep !== undefined) { + hasAnyValues = true; + internalValueResult.userDefinedStep = this._userDefinedStep; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterUpgradeStrategyInPlaceRollingUpdate | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._userDefinedStep = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._userDefinedStep = value.userDefinedStep; + } + } + + // user_defined_step - computed: false, optional: true, required: false + private _userDefinedStep?: number; + public get userDefinedStep() { + return this.getNumberAttribute('user_defined_step'); + } + public set userDefinedStep(value: number) { + this._userDefinedStep = value; + } + public resetUserDefinedStep() { + this._userDefinedStep = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDefinedStepInput() { + return this._userDefinedStep; + } +} +export interface CceClusterUpgradeStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#type CceClusterUpgrade#type} + */ + readonly type: string; + /** + * in_place_rolling_update block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#in_place_rolling_update CceClusterUpgrade#in_place_rolling_update} + */ + readonly inPlaceRollingUpdate?: CceClusterUpgradeStrategyInPlaceRollingUpdate; +} + +export function cceClusterUpgradeStrategyToTerraform(struct?: CceClusterUpgradeStrategyOutputReference | CceClusterUpgradeStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + in_place_rolling_update: cceClusterUpgradeStrategyInPlaceRollingUpdateToTerraform(struct!.inPlaceRollingUpdate), + } +} + + +export function cceClusterUpgradeStrategyToHclTerraform(struct?: CceClusterUpgradeStrategyOutputReference | CceClusterUpgradeStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + in_place_rolling_update: { + value: cceClusterUpgradeStrategyInPlaceRollingUpdateToHclTerraform(struct!.inPlaceRollingUpdate), + isBlock: true, + type: "list", + storageClassType: "CceClusterUpgradeStrategyInPlaceRollingUpdateList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterUpgradeStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceClusterUpgradeStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._inPlaceRollingUpdate?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.inPlaceRollingUpdate = this._inPlaceRollingUpdate?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterUpgradeStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._inPlaceRollingUpdate.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._inPlaceRollingUpdate.internalValue = value.inPlaceRollingUpdate; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // in_place_rolling_update - computed: false, optional: true, required: false + private _inPlaceRollingUpdate = new CceClusterUpgradeStrategyInPlaceRollingUpdateOutputReference(this, "in_place_rolling_update"); + public get inPlaceRollingUpdate() { + return this._inPlaceRollingUpdate; + } + public putInPlaceRollingUpdate(value: CceClusterUpgradeStrategyInPlaceRollingUpdate) { + this._inPlaceRollingUpdate.internalValue = value; + } + public resetInPlaceRollingUpdate() { + this._inPlaceRollingUpdate.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get inPlaceRollingUpdateInput() { + return this._inPlaceRollingUpdate.internalValue; + } +} +export interface CceClusterUpgradeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#create CceClusterUpgrade#create} + */ + readonly create?: string; +} + +export function cceClusterUpgradeTimeoutsToTerraform(struct?: CceClusterUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cceClusterUpgradeTimeoutsToHclTerraform(struct?: CceClusterUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterUpgradeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceClusterUpgradeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterUpgradeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade huaweicloud_cce_cluster_upgrade} +*/ +export class CceClusterUpgrade extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster_upgrade"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceClusterUpgrade resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceClusterUpgrade to import + * @param importFromId The id of the existing CceClusterUpgrade that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceClusterUpgrade to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster_upgrade", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_upgrade huaweicloud_cce_cluster_upgrade} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceClusterUpgradeConfig + */ + public constructor(scope: Construct, id: string, config: CceClusterUpgradeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster_upgrade', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._nodeOrder = config.nodeOrder; + this._nodepoolOrder = config.nodepoolOrder; + this._region = config.region; + this._targetVersion = config.targetVersion; + this._addons.internalValue = config.addons; + this._strategy.internalValue = config.strategy; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // node_order - computed: false, optional: true, required: false + private _nodeOrder?: { [key: string]: string }; + public get nodeOrder() { + return this.getStringMapAttribute('node_order'); + } + public set nodeOrder(value: { [key: string]: string }) { + this._nodeOrder = value; + } + public resetNodeOrder() { + this._nodeOrder = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeOrderInput() { + return this._nodeOrder; + } + + // nodepool_order - computed: false, optional: true, required: false + private _nodepoolOrder?: { [key: string]: number }; + public get nodepoolOrder() { + return this.getNumberMapAttribute('nodepool_order'); + } + public set nodepoolOrder(value: { [key: string]: number }) { + this._nodepoolOrder = value; + } + public resetNodepoolOrder() { + this._nodepoolOrder = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodepoolOrderInput() { + return this._nodepoolOrder; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_version - computed: false, optional: false, required: true + private _targetVersion?: string; + public get targetVersion() { + return this.getStringAttribute('target_version'); + } + public set targetVersion(value: string) { + this._targetVersion = value; + } + // Temporarily expose input value. Use with caution. + public get targetVersionInput() { + return this._targetVersion; + } + + // addons - computed: false, optional: true, required: false + private _addons = new CceClusterUpgradeAddonsList(this, "addons", false); + public get addons() { + return this._addons; + } + public putAddons(value: CceClusterUpgradeAddons[] | cdktf.IResolvable) { + this._addons.internalValue = value; + } + public resetAddons() { + this._addons.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addonsInput() { + return this._addons.internalValue; + } + + // strategy - computed: false, optional: false, required: true + private _strategy = new CceClusterUpgradeStrategyOutputReference(this, "strategy"); + public get strategy() { + return this._strategy; + } + public putStrategy(value: CceClusterUpgradeStrategy) { + this._strategy.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get strategyInput() { + return this._strategy.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceClusterUpgradeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceClusterUpgradeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + node_order: cdktf.hashMapper(cdktf.stringToTerraform)(this._nodeOrder), + nodepool_order: cdktf.hashMapper(cdktf.numberToTerraform)(this._nodepoolOrder), + region: cdktf.stringToTerraform(this._region), + target_version: cdktf.stringToTerraform(this._targetVersion), + addons: cdktf.listMapper(cceClusterUpgradeAddonsToTerraform, true)(this._addons.internalValue), + strategy: cceClusterUpgradeStrategyToTerraform(this._strategy.internalValue), + timeouts: cceClusterUpgradeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_order: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._nodeOrder), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + nodepool_order: { + value: cdktf.hashMapperHcl(cdktf.numberToHclTerraform)(this._nodepoolOrder), + isBlock: false, + type: "map", + storageClassType: "numberMap", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_version: { + value: cdktf.stringToHclTerraform(this._targetVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + addons: { + value: cdktf.listMapperHcl(cceClusterUpgradeAddonsToHclTerraform, true)(this._addons.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterUpgradeAddonsList", + }, + strategy: { + value: cceClusterUpgradeStrategyToHclTerraform(this._strategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterUpgradeStrategyList", + }, + timeouts: { + value: cceClusterUpgradeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceClusterUpgradeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-cluster-v3/README.md b/src/constructs/providers/huaweicloud/cce-cluster-v3/README.md new file mode 100644 index 00000000..ab25a76d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_cluster_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_cluster_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3). diff --git a/src/constructs/providers/huaweicloud/cce-cluster-v3/index.ts b/src/constructs/providers/huaweicloud/cce-cluster-v3/index.ts new file mode 100644 index 00000000..50bf76f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster-v3/index.ts @@ -0,0 +1,2455 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceClusterV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#alias CceClusterV3#alias} + */ + readonly alias?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#annotations CceClusterV3#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#authenticating_proxy_ca CceClusterV3#authenticating_proxy_ca} + */ + readonly authenticatingProxyCa?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#authenticating_proxy_cert CceClusterV3#authenticating_proxy_cert} + */ + readonly authenticatingProxyCert?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#authenticating_proxy_private_key CceClusterV3#authenticating_proxy_private_key} + */ + readonly authenticatingProxyPrivateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#authentication_mode CceClusterV3#authentication_mode} + */ + readonly authenticationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#auto_pay CceClusterV3#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#auto_renew CceClusterV3#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#billing_mode CceClusterV3#billing_mode} + */ + readonly billingMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#charging_mode CceClusterV3#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#cluster_type CceClusterV3#cluster_type} + */ + readonly clusterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#cluster_version CceClusterV3#cluster_version} + */ + readonly clusterVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#container_network_cidr CceClusterV3#container_network_cidr} + */ + readonly containerNetworkCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#container_network_type CceClusterV3#container_network_type} + */ + readonly containerNetworkType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#custom_san CceClusterV3#custom_san} + */ + readonly customSan?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_all CceClusterV3#delete_all} + */ + readonly deleteAll?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_efs CceClusterV3#delete_efs} + */ + readonly deleteEfs?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_eni CceClusterV3#delete_eni} + */ + readonly deleteEni?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_evs CceClusterV3#delete_evs} + */ + readonly deleteEvs?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_net CceClusterV3#delete_net} + */ + readonly deleteNet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_obs CceClusterV3#delete_obs} + */ + readonly deleteObs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete_sfs CceClusterV3#delete_sfs} + */ + readonly deleteSfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#description CceClusterV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#eip CceClusterV3#eip} + */ + readonly eip?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#enable_distribute_management CceClusterV3#enable_distribute_management} + */ + readonly enableDistributeManagement?: boolean | cdktf.IResolvable; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#eni_subnet_cidr CceClusterV3#eni_subnet_cidr} + */ + readonly eniSubnetCidr?: string; + /** + * the IPv4 subnet ID of the subnet where the ENI resides + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#eni_subnet_id CceClusterV3#eni_subnet_id} + */ + readonly eniSubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#enterprise_project_id CceClusterV3#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#extend_param CceClusterV3#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#flavor_id CceClusterV3#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#hibernate CceClusterV3#hibernate} + */ + readonly hibernate?: boolean | cdktf.IResolvable; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#highway_subnet_id CceClusterV3#highway_subnet_id} + */ + readonly highwaySubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#id CceClusterV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#ipv6_enable CceClusterV3#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#kube_proxy_mode CceClusterV3#kube_proxy_mode} + */ + readonly kubeProxyMode?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#labels CceClusterV3#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#lts_reclaim_policy CceClusterV3#lts_reclaim_policy} + */ + readonly ltsReclaimPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#multi_az CceClusterV3#multi_az} + */ + readonly multiAz?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#name CceClusterV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#period CceClusterV3#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#period_unit CceClusterV3#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#region CceClusterV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#security_group_id CceClusterV3#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#service_network_cidr CceClusterV3#service_network_cidr} + */ + readonly serviceNetworkCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#subnet_id CceClusterV3#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#support_istio CceClusterV3#support_istio} + */ + readonly supportIstio?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#tags CceClusterV3#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#vpc_id CceClusterV3#vpc_id} + */ + readonly vpcId: string; + /** + * component_configurations block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#component_configurations CceClusterV3#component_configurations} + */ + readonly componentConfigurations?: CceClusterV3ComponentConfigurations[] | cdktf.IResolvable; + /** + * extend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#extend_params CceClusterV3#extend_params} + */ + readonly extendParams?: CceClusterV3ExtendParams[] | cdktf.IResolvable; + /** + * masters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#masters CceClusterV3#masters} + */ + readonly masters?: CceClusterV3Masters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#timeouts CceClusterV3#timeouts} + */ + readonly timeouts?: CceClusterV3Timeouts; +} +export interface CceClusterV3CertificateClusters { +} + +export function cceClusterV3CertificateClustersToTerraform(struct?: CceClusterV3CertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceClusterV3CertificateClustersToHclTerraform(struct?: CceClusterV3CertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceClusterV3CertificateClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterV3CertificateClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterV3CertificateClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_authority_data - computed: true, optional: false, required: false + public get certificateAuthorityData() { + return this.getStringAttribute('certificate_authority_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server - computed: true, optional: false, required: false + public get server() { + return this.getStringAttribute('server'); + } +} + +export class CceClusterV3CertificateClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterV3CertificateClustersOutputReference { + return new CceClusterV3CertificateClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterV3CertificateUsers { +} + +export function cceClusterV3CertificateUsersToTerraform(struct?: CceClusterV3CertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceClusterV3CertificateUsersToHclTerraform(struct?: CceClusterV3CertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceClusterV3CertificateUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterV3CertificateUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterV3CertificateUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_certificate_data - computed: true, optional: false, required: false + public get clientCertificateData() { + return this.getStringAttribute('client_certificate_data'); + } + + // client_key_data - computed: true, optional: false, required: false + public get clientKeyData() { + return this.getStringAttribute('client_key_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class CceClusterV3CertificateUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterV3CertificateUsersOutputReference { + return new CceClusterV3CertificateUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterV3ComponentConfigurations { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#configurations CceClusterV3#configurations} + */ + readonly configurations?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#name CceClusterV3#name} + */ + readonly name: string; +} + +export function cceClusterV3ComponentConfigurationsToTerraform(struct?: CceClusterV3ComponentConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configurations: cdktf.stringToTerraform(struct!.configurations), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function cceClusterV3ComponentConfigurationsToHclTerraform(struct?: CceClusterV3ComponentConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configurations: { + value: cdktf.stringToHclTerraform(struct!.configurations), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterV3ComponentConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterV3ComponentConfigurations | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configurations !== undefined) { + hasAnyValues = true; + internalValueResult.configurations = this._configurations; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterV3ComponentConfigurations | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._configurations = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._configurations = value.configurations; + this._name = value.name; + } + } + + // configurations - computed: false, optional: true, required: false + private _configurations?: string; + public get configurations() { + return this.getStringAttribute('configurations'); + } + public set configurations(value: string) { + this._configurations = value; + } + public resetConfigurations() { + this._configurations = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class CceClusterV3ComponentConfigurationsList extends cdktf.ComplexList { + public internalValue? : CceClusterV3ComponentConfigurations[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterV3ComponentConfigurationsOutputReference { + return new CceClusterV3ComponentConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterV3ExtendParams { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#cluster_az CceClusterV3#cluster_az} + */ + readonly clusterAz?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#cpu_manager_policy CceClusterV3#cpu_manager_policy} + */ + readonly cpuManagerPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#dec_master_flavor CceClusterV3#dec_master_flavor} + */ + readonly decMasterFlavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#docker_umask_mode CceClusterV3#docker_umask_mode} + */ + readonly dockerUmaskMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#dss_master_volumes CceClusterV3#dss_master_volumes} + */ + readonly dssMasterVolumes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#fix_pool_mask CceClusterV3#fix_pool_mask} + */ + readonly fixPoolMask?: string; +} + +export function cceClusterV3ExtendParamsToTerraform(struct?: CceClusterV3ExtendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cluster_az: cdktf.stringToTerraform(struct!.clusterAz), + cpu_manager_policy: cdktf.stringToTerraform(struct!.cpuManagerPolicy), + dec_master_flavor: cdktf.stringToTerraform(struct!.decMasterFlavor), + docker_umask_mode: cdktf.stringToTerraform(struct!.dockerUmaskMode), + dss_master_volumes: cdktf.stringToTerraform(struct!.dssMasterVolumes), + fix_pool_mask: cdktf.stringToTerraform(struct!.fixPoolMask), + } +} + + +export function cceClusterV3ExtendParamsToHclTerraform(struct?: CceClusterV3ExtendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cluster_az: { + value: cdktf.stringToHclTerraform(struct!.clusterAz), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_manager_policy: { + value: cdktf.stringToHclTerraform(struct!.cpuManagerPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dec_master_flavor: { + value: cdktf.stringToHclTerraform(struct!.decMasterFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + docker_umask_mode: { + value: cdktf.stringToHclTerraform(struct!.dockerUmaskMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dss_master_volumes: { + value: cdktf.stringToHclTerraform(struct!.dssMasterVolumes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fix_pool_mask: { + value: cdktf.stringToHclTerraform(struct!.fixPoolMask), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterV3ExtendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterV3ExtendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusterAz !== undefined) { + hasAnyValues = true; + internalValueResult.clusterAz = this._clusterAz; + } + if (this._cpuManagerPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.cpuManagerPolicy = this._cpuManagerPolicy; + } + if (this._decMasterFlavor !== undefined) { + hasAnyValues = true; + internalValueResult.decMasterFlavor = this._decMasterFlavor; + } + if (this._dockerUmaskMode !== undefined) { + hasAnyValues = true; + internalValueResult.dockerUmaskMode = this._dockerUmaskMode; + } + if (this._dssMasterVolumes !== undefined) { + hasAnyValues = true; + internalValueResult.dssMasterVolumes = this._dssMasterVolumes; + } + if (this._fixPoolMask !== undefined) { + hasAnyValues = true; + internalValueResult.fixPoolMask = this._fixPoolMask; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterV3ExtendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._clusterAz = undefined; + this._cpuManagerPolicy = undefined; + this._decMasterFlavor = undefined; + this._dockerUmaskMode = undefined; + this._dssMasterVolumes = undefined; + this._fixPoolMask = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._clusterAz = value.clusterAz; + this._cpuManagerPolicy = value.cpuManagerPolicy; + this._decMasterFlavor = value.decMasterFlavor; + this._dockerUmaskMode = value.dockerUmaskMode; + this._dssMasterVolumes = value.dssMasterVolumes; + this._fixPoolMask = value.fixPoolMask; + } + } + + // cluster_az - computed: false, optional: true, required: false + private _clusterAz?: string; + public get clusterAz() { + return this.getStringAttribute('cluster_az'); + } + public set clusterAz(value: string) { + this._clusterAz = value; + } + public resetClusterAz() { + this._clusterAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterAzInput() { + return this._clusterAz; + } + + // cpu_manager_policy - computed: false, optional: true, required: false + private _cpuManagerPolicy?: string; + public get cpuManagerPolicy() { + return this.getStringAttribute('cpu_manager_policy'); + } + public set cpuManagerPolicy(value: string) { + this._cpuManagerPolicy = value; + } + public resetCpuManagerPolicy() { + this._cpuManagerPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuManagerPolicyInput() { + return this._cpuManagerPolicy; + } + + // dec_master_flavor - computed: false, optional: true, required: false + private _decMasterFlavor?: string; + public get decMasterFlavor() { + return this.getStringAttribute('dec_master_flavor'); + } + public set decMasterFlavor(value: string) { + this._decMasterFlavor = value; + } + public resetDecMasterFlavor() { + this._decMasterFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get decMasterFlavorInput() { + return this._decMasterFlavor; + } + + // docker_umask_mode - computed: false, optional: true, required: false + private _dockerUmaskMode?: string; + public get dockerUmaskMode() { + return this.getStringAttribute('docker_umask_mode'); + } + public set dockerUmaskMode(value: string) { + this._dockerUmaskMode = value; + } + public resetDockerUmaskMode() { + this._dockerUmaskMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerUmaskModeInput() { + return this._dockerUmaskMode; + } + + // dss_master_volumes - computed: false, optional: true, required: false + private _dssMasterVolumes?: string; + public get dssMasterVolumes() { + return this.getStringAttribute('dss_master_volumes'); + } + public set dssMasterVolumes(value: string) { + this._dssMasterVolumes = value; + } + public resetDssMasterVolumes() { + this._dssMasterVolumes = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssMasterVolumesInput() { + return this._dssMasterVolumes; + } + + // fix_pool_mask - computed: false, optional: true, required: false + private _fixPoolMask?: string; + public get fixPoolMask() { + return this.getStringAttribute('fix_pool_mask'); + } + public set fixPoolMask(value: string) { + this._fixPoolMask = value; + } + public resetFixPoolMask() { + this._fixPoolMask = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixPoolMaskInput() { + return this._fixPoolMask; + } +} + +export class CceClusterV3ExtendParamsList extends cdktf.ComplexList { + public internalValue? : CceClusterV3ExtendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterV3ExtendParamsOutputReference { + return new CceClusterV3ExtendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterV3Masters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#availability_zone CceClusterV3#availability_zone} + */ + readonly availabilityZone?: string; +} + +export function cceClusterV3MastersToTerraform(struct?: CceClusterV3Masters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + } +} + + +export function cceClusterV3MastersToHclTerraform(struct?: CceClusterV3Masters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterV3MastersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterV3Masters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterV3Masters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._availabilityZone = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._availabilityZone = value.availabilityZone; + } + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } +} + +export class CceClusterV3MastersList extends cdktf.ComplexList { + public internalValue? : CceClusterV3Masters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterV3MastersOutputReference { + return new CceClusterV3MastersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterV3Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#create CceClusterV3#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#delete CceClusterV3#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#update CceClusterV3#update} + */ + readonly update?: string; +} + +export function cceClusterV3TimeoutsToTerraform(struct?: CceClusterV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cceClusterV3TimeoutsToHclTerraform(struct?: CceClusterV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterV3TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceClusterV3Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterV3Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3 huaweicloud_cce_cluster_v3} +*/ +export class CceClusterV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceClusterV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceClusterV3 to import + * @param importFromId The id of the existing CceClusterV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceClusterV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster_v3 huaweicloud_cce_cluster_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceClusterV3Config + */ + public constructor(scope: Construct, id: string, config: CceClusterV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alias = config.alias; + this._annotations = config.annotations; + this._authenticatingProxyCa = config.authenticatingProxyCa; + this._authenticatingProxyCert = config.authenticatingProxyCert; + this._authenticatingProxyPrivateKey = config.authenticatingProxyPrivateKey; + this._authenticationMode = config.authenticationMode; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._billingMode = config.billingMode; + this._chargingMode = config.chargingMode; + this._clusterType = config.clusterType; + this._clusterVersion = config.clusterVersion; + this._containerNetworkCidr = config.containerNetworkCidr; + this._containerNetworkType = config.containerNetworkType; + this._customSan = config.customSan; + this._deleteAll = config.deleteAll; + this._deleteEfs = config.deleteEfs; + this._deleteEni = config.deleteEni; + this._deleteEvs = config.deleteEvs; + this._deleteNet = config.deleteNet; + this._deleteObs = config.deleteObs; + this._deleteSfs = config.deleteSfs; + this._description = config.description; + this._eip = config.eip; + this._enableDistributeManagement = config.enableDistributeManagement; + this._eniSubnetCidr = config.eniSubnetCidr; + this._eniSubnetId = config.eniSubnetId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extendParam = config.extendParam; + this._flavorId = config.flavorId; + this._hibernate = config.hibernate; + this._highwaySubnetId = config.highwaySubnetId; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._kubeProxyMode = config.kubeProxyMode; + this._labels = config.labels; + this._ltsReclaimPolicy = config.ltsReclaimPolicy; + this._multiAz = config.multiAz; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._serviceNetworkCidr = config.serviceNetworkCidr; + this._subnetId = config.subnetId; + this._supportIstio = config.supportIstio; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._componentConfigurations.internalValue = config.componentConfigurations; + this._extendParams.internalValue = config.extendParams; + this._masters.internalValue = config.masters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // alias - computed: true, optional: true, required: false + private _alias?: string; + public get alias() { + return this.getStringAttribute('alias'); + } + public set alias(value: string) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // authenticating_proxy_ca - computed: false, optional: true, required: false + private _authenticatingProxyCa?: string; + public get authenticatingProxyCa() { + return this.getStringAttribute('authenticating_proxy_ca'); + } + public set authenticatingProxyCa(value: string) { + this._authenticatingProxyCa = value; + } + public resetAuthenticatingProxyCa() { + this._authenticatingProxyCa = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticatingProxyCaInput() { + return this._authenticatingProxyCa; + } + + // authenticating_proxy_cert - computed: false, optional: true, required: false + private _authenticatingProxyCert?: string; + public get authenticatingProxyCert() { + return this.getStringAttribute('authenticating_proxy_cert'); + } + public set authenticatingProxyCert(value: string) { + this._authenticatingProxyCert = value; + } + public resetAuthenticatingProxyCert() { + this._authenticatingProxyCert = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticatingProxyCertInput() { + return this._authenticatingProxyCert; + } + + // authenticating_proxy_private_key - computed: false, optional: true, required: false + private _authenticatingProxyPrivateKey?: string; + public get authenticatingProxyPrivateKey() { + return this.getStringAttribute('authenticating_proxy_private_key'); + } + public set authenticatingProxyPrivateKey(value: string) { + this._authenticatingProxyPrivateKey = value; + } + public resetAuthenticatingProxyPrivateKey() { + this._authenticatingProxyPrivateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticatingProxyPrivateKeyInput() { + return this._authenticatingProxyPrivateKey; + } + + // authentication_mode - computed: false, optional: true, required: false + private _authenticationMode?: string; + public get authenticationMode() { + return this.getStringAttribute('authentication_mode'); + } + public set authenticationMode(value: string) { + this._authenticationMode = value; + } + public resetAuthenticationMode() { + this._authenticationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationModeInput() { + return this._authenticationMode; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // billing_mode - computed: true, optional: true, required: false + private _billingMode?: number; + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + public set billingMode(value: number) { + this._billingMode = value; + } + public resetBillingMode() { + this._billingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get billingModeInput() { + return this._billingMode; + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // certificate_clusters - computed: true, optional: false, required: false + private _certificateClusters = new CceClusterV3CertificateClustersList(this, "certificate_clusters", false); + public get certificateClusters() { + return this._certificateClusters; + } + + // certificate_users - computed: true, optional: false, required: false + private _certificateUsers = new CceClusterV3CertificateUsersList(this, "certificate_users", false); + public get certificateUsers() { + return this._certificateUsers; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cluster_type - computed: false, optional: true, required: false + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cluster_version - computed: true, optional: true, required: false + private _clusterVersion?: string; + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + public set clusterVersion(value: string) { + this._clusterVersion = value; + } + public resetClusterVersion() { + this._clusterVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterVersionInput() { + return this._clusterVersion; + } + + // container_network_cidr - computed: true, optional: true, required: false + private _containerNetworkCidr?: string; + public get containerNetworkCidr() { + return this.getStringAttribute('container_network_cidr'); + } + public set containerNetworkCidr(value: string) { + this._containerNetworkCidr = value; + } + public resetContainerNetworkCidr() { + this._containerNetworkCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get containerNetworkCidrInput() { + return this._containerNetworkCidr; + } + + // container_network_type - computed: false, optional: false, required: true + private _containerNetworkType?: string; + public get containerNetworkType() { + return this.getStringAttribute('container_network_type'); + } + public set containerNetworkType(value: string) { + this._containerNetworkType = value; + } + // Temporarily expose input value. Use with caution. + public get containerNetworkTypeInput() { + return this._containerNetworkType; + } + + // custom_san - computed: true, optional: true, required: false + private _customSan?: string[]; + public get customSan() { + return this.getListAttribute('custom_san'); + } + public set customSan(value: string[]) { + this._customSan = value; + } + public resetCustomSan() { + this._customSan = undefined; + } + // Temporarily expose input value. Use with caution. + public get customSanInput() { + return this._customSan; + } + + // delete_all - computed: false, optional: true, required: false + private _deleteAll?: string; + public get deleteAll() { + return this.getStringAttribute('delete_all'); + } + public set deleteAll(value: string) { + this._deleteAll = value; + } + public resetDeleteAll() { + this._deleteAll = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteAllInput() { + return this._deleteAll; + } + + // delete_efs - computed: false, optional: true, required: false + private _deleteEfs?: string; + public get deleteEfs() { + return this.getStringAttribute('delete_efs'); + } + public set deleteEfs(value: string) { + this._deleteEfs = value; + } + public resetDeleteEfs() { + this._deleteEfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEfsInput() { + return this._deleteEfs; + } + + // delete_eni - computed: false, optional: true, required: false + private _deleteEni?: string; + public get deleteEni() { + return this.getStringAttribute('delete_eni'); + } + public set deleteEni(value: string) { + this._deleteEni = value; + } + public resetDeleteEni() { + this._deleteEni = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEniInput() { + return this._deleteEni; + } + + // delete_evs - computed: false, optional: true, required: false + private _deleteEvs?: string; + public get deleteEvs() { + return this.getStringAttribute('delete_evs'); + } + public set deleteEvs(value: string) { + this._deleteEvs = value; + } + public resetDeleteEvs() { + this._deleteEvs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEvsInput() { + return this._deleteEvs; + } + + // delete_net - computed: false, optional: true, required: false + private _deleteNet?: string; + public get deleteNet() { + return this.getStringAttribute('delete_net'); + } + public set deleteNet(value: string) { + this._deleteNet = value; + } + public resetDeleteNet() { + this._deleteNet = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteNetInput() { + return this._deleteNet; + } + + // delete_obs - computed: false, optional: true, required: false + private _deleteObs?: string; + public get deleteObs() { + return this.getStringAttribute('delete_obs'); + } + public set deleteObs(value: string) { + this._deleteObs = value; + } + public resetDeleteObs() { + this._deleteObs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteObsInput() { + return this._deleteObs; + } + + // delete_sfs - computed: false, optional: true, required: false + private _deleteSfs?: string; + public get deleteSfs() { + return this.getStringAttribute('delete_sfs'); + } + public set deleteSfs(value: string) { + this._deleteSfs = value; + } + public resetDeleteSfs() { + this._deleteSfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteSfsInput() { + return this._deleteSfs; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // eip - computed: false, optional: true, required: false + private _eip?: string; + public get eip() { + return this.getStringAttribute('eip'); + } + public set eip(value: string) { + this._eip = value; + } + public resetEip() { + this._eip = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipInput() { + return this._eip; + } + + // enable_distribute_management - computed: false, optional: true, required: false + private _enableDistributeManagement?: boolean | cdktf.IResolvable; + public get enableDistributeManagement() { + return this.getBooleanAttribute('enable_distribute_management'); + } + public set enableDistributeManagement(value: boolean | cdktf.IResolvable) { + this._enableDistributeManagement = value; + } + public resetEnableDistributeManagement() { + this._enableDistributeManagement = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDistributeManagementInput() { + return this._enableDistributeManagement; + } + + // eni_subnet_cidr - computed: true, optional: true, required: false + private _eniSubnetCidr?: string; + public get eniSubnetCidr() { + return this.getStringAttribute('eni_subnet_cidr'); + } + public set eniSubnetCidr(value: string) { + this._eniSubnetCidr = value; + } + public resetEniSubnetCidr() { + this._eniSubnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get eniSubnetCidrInput() { + return this._eniSubnetCidr; + } + + // eni_subnet_id - computed: true, optional: true, required: false + private _eniSubnetId?: string; + public get eniSubnetId() { + return this.getStringAttribute('eni_subnet_id'); + } + public set eniSubnetId(value: string) { + this._eniSubnetId = value; + } + public resetEniSubnetId() { + this._eniSubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eniSubnetIdInput() { + return this._eniSubnetId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // hibernate - computed: false, optional: true, required: false + private _hibernate?: boolean | cdktf.IResolvable; + public get hibernate() { + return this.getBooleanAttribute('hibernate'); + } + public set hibernate(value: boolean | cdktf.IResolvable) { + this._hibernate = value; + } + public resetHibernate() { + this._hibernate = undefined; + } + // Temporarily expose input value. Use with caution. + public get hibernateInput() { + return this._hibernate; + } + + // highway_subnet_id - computed: true, optional: true, required: false + private _highwaySubnetId?: string; + public get highwaySubnetId() { + return this.getStringAttribute('highway_subnet_id'); + } + public set highwaySubnetId(value: string) { + this._highwaySubnetId = value; + } + public resetHighwaySubnetId() { + this._highwaySubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get highwaySubnetIdInput() { + return this._highwaySubnetId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // kube_config_raw - computed: true, optional: false, required: false + public get kubeConfigRaw() { + return this.getStringAttribute('kube_config_raw'); + } + + // kube_proxy_mode - computed: true, optional: true, required: false + private _kubeProxyMode?: string; + public get kubeProxyMode() { + return this.getStringAttribute('kube_proxy_mode'); + } + public set kubeProxyMode(value: string) { + this._kubeProxyMode = value; + } + public resetKubeProxyMode() { + this._kubeProxyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get kubeProxyModeInput() { + return this._kubeProxyMode; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // lts_reclaim_policy - computed: false, optional: true, required: false + private _ltsReclaimPolicy?: string; + public get ltsReclaimPolicy() { + return this.getStringAttribute('lts_reclaim_policy'); + } + public set ltsReclaimPolicy(value: string) { + this._ltsReclaimPolicy = value; + } + public resetLtsReclaimPolicy() { + this._ltsReclaimPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsReclaimPolicyInput() { + return this._ltsReclaimPolicy; + } + + // multi_az - computed: false, optional: true, required: false + private _multiAz?: boolean | cdktf.IResolvable; + public get multiAz() { + return this.getBooleanAttribute('multi_az'); + } + public set multiAz(value: boolean | cdktf.IResolvable) { + this._multiAz = value; + } + public resetMultiAz() { + this._multiAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiAzInput() { + return this._multiAz; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // service_network_cidr - computed: true, optional: true, required: false + private _serviceNetworkCidr?: string; + public get serviceNetworkCidr() { + return this.getStringAttribute('service_network_cidr'); + } + public set serviceNetworkCidr(value: string) { + this._serviceNetworkCidr = value; + } + public resetServiceNetworkCidr() { + this._serviceNetworkCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNetworkCidrInput() { + return this._serviceNetworkCidr; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // support_istio - computed: true, optional: true, required: false + private _supportIstio?: boolean | cdktf.IResolvable; + public get supportIstio() { + return this.getBooleanAttribute('support_istio'); + } + public set supportIstio(value: boolean | cdktf.IResolvable) { + this._supportIstio = value; + } + public resetSupportIstio() { + this._supportIstio = undefined; + } + // Temporarily expose input value. Use with caution. + public get supportIstioInput() { + return this._supportIstio; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // component_configurations - computed: false, optional: true, required: false + private _componentConfigurations = new CceClusterV3ComponentConfigurationsList(this, "component_configurations", false); + public get componentConfigurations() { + return this._componentConfigurations; + } + public putComponentConfigurations(value: CceClusterV3ComponentConfigurations[] | cdktf.IResolvable) { + this._componentConfigurations.internalValue = value; + } + public resetComponentConfigurations() { + this._componentConfigurations.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get componentConfigurationsInput() { + return this._componentConfigurations.internalValue; + } + + // extend_params - computed: false, optional: true, required: false + private _extendParams = new CceClusterV3ExtendParamsList(this, "extend_params", false); + public get extendParams() { + return this._extendParams; + } + public putExtendParams(value: CceClusterV3ExtendParams[] | cdktf.IResolvable) { + this._extendParams.internalValue = value; + } + public resetExtendParams() { + this._extendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams.internalValue; + } + + // masters - computed: false, optional: true, required: false + private _masters = new CceClusterV3MastersList(this, "masters", false); + public get masters() { + return this._masters; + } + public putMasters(value: CceClusterV3Masters[] | cdktf.IResolvable) { + this._masters.internalValue = value; + } + public resetMasters() { + this._masters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mastersInput() { + return this._masters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceClusterV3TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceClusterV3Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alias: cdktf.stringToTerraform(this._alias), + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + authenticating_proxy_ca: cdktf.stringToTerraform(this._authenticatingProxyCa), + authenticating_proxy_cert: cdktf.stringToTerraform(this._authenticatingProxyCert), + authenticating_proxy_private_key: cdktf.stringToTerraform(this._authenticatingProxyPrivateKey), + authentication_mode: cdktf.stringToTerraform(this._authenticationMode), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + billing_mode: cdktf.numberToTerraform(this._billingMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cluster_type: cdktf.stringToTerraform(this._clusterType), + cluster_version: cdktf.stringToTerraform(this._clusterVersion), + container_network_cidr: cdktf.stringToTerraform(this._containerNetworkCidr), + container_network_type: cdktf.stringToTerraform(this._containerNetworkType), + custom_san: cdktf.listMapper(cdktf.stringToTerraform, false)(this._customSan), + delete_all: cdktf.stringToTerraform(this._deleteAll), + delete_efs: cdktf.stringToTerraform(this._deleteEfs), + delete_eni: cdktf.stringToTerraform(this._deleteEni), + delete_evs: cdktf.stringToTerraform(this._deleteEvs), + delete_net: cdktf.stringToTerraform(this._deleteNet), + delete_obs: cdktf.stringToTerraform(this._deleteObs), + delete_sfs: cdktf.stringToTerraform(this._deleteSfs), + description: cdktf.stringToTerraform(this._description), + eip: cdktf.stringToTerraform(this._eip), + enable_distribute_management: cdktf.booleanToTerraform(this._enableDistributeManagement), + eni_subnet_cidr: cdktf.stringToTerraform(this._eniSubnetCidr), + eni_subnet_id: cdktf.stringToTerraform(this._eniSubnetId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(this._extendParam), + flavor_id: cdktf.stringToTerraform(this._flavorId), + hibernate: cdktf.booleanToTerraform(this._hibernate), + highway_subnet_id: cdktf.stringToTerraform(this._highwaySubnetId), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + kube_proxy_mode: cdktf.stringToTerraform(this._kubeProxyMode), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + lts_reclaim_policy: cdktf.stringToTerraform(this._ltsReclaimPolicy), + multi_az: cdktf.booleanToTerraform(this._multiAz), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + service_network_cidr: cdktf.stringToTerraform(this._serviceNetworkCidr), + subnet_id: cdktf.stringToTerraform(this._subnetId), + support_istio: cdktf.booleanToTerraform(this._supportIstio), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + component_configurations: cdktf.listMapper(cceClusterV3ComponentConfigurationsToTerraform, true)(this._componentConfigurations.internalValue), + extend_params: cdktf.listMapper(cceClusterV3ExtendParamsToTerraform, true)(this._extendParams.internalValue), + masters: cdktf.listMapper(cceClusterV3MastersToTerraform, true)(this._masters.internalValue), + timeouts: cceClusterV3TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alias: { + value: cdktf.stringToHclTerraform(this._alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + authenticating_proxy_ca: { + value: cdktf.stringToHclTerraform(this._authenticatingProxyCa), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authenticating_proxy_cert: { + value: cdktf.stringToHclTerraform(this._authenticatingProxyCert), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authenticating_proxy_private_key: { + value: cdktf.stringToHclTerraform(this._authenticatingProxyPrivateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication_mode: { + value: cdktf.stringToHclTerraform(this._authenticationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + billing_mode: { + value: cdktf.numberToHclTerraform(this._billingMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_version: { + value: cdktf.stringToHclTerraform(this._clusterVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_network_cidr: { + value: cdktf.stringToHclTerraform(this._containerNetworkCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_network_type: { + value: cdktf.stringToHclTerraform(this._containerNetworkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_san: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._customSan), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + delete_all: { + value: cdktf.stringToHclTerraform(this._deleteAll), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_efs: { + value: cdktf.stringToHclTerraform(this._deleteEfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_eni: { + value: cdktf.stringToHclTerraform(this._deleteEni), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_evs: { + value: cdktf.stringToHclTerraform(this._deleteEvs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_net: { + value: cdktf.stringToHclTerraform(this._deleteNet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_obs: { + value: cdktf.stringToHclTerraform(this._deleteObs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_sfs: { + value: cdktf.stringToHclTerraform(this._deleteSfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip: { + value: cdktf.stringToHclTerraform(this._eip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_distribute_management: { + value: cdktf.booleanToHclTerraform(this._enableDistributeManagement), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + eni_subnet_cidr: { + value: cdktf.stringToHclTerraform(this._eniSubnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eni_subnet_id: { + value: cdktf.stringToHclTerraform(this._eniSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hibernate: { + value: cdktf.booleanToHclTerraform(this._hibernate), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + highway_subnet_id: { + value: cdktf.stringToHclTerraform(this._highwaySubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kube_proxy_mode: { + value: cdktf.stringToHclTerraform(this._kubeProxyMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lts_reclaim_policy: { + value: cdktf.stringToHclTerraform(this._ltsReclaimPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multi_az: { + value: cdktf.booleanToHclTerraform(this._multiAz), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_network_cidr: { + value: cdktf.stringToHclTerraform(this._serviceNetworkCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + support_istio: { + value: cdktf.booleanToHclTerraform(this._supportIstio), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_configurations: { + value: cdktf.listMapperHcl(cceClusterV3ComponentConfigurationsToHclTerraform, true)(this._componentConfigurations.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterV3ComponentConfigurationsList", + }, + extend_params: { + value: cdktf.listMapperHcl(cceClusterV3ExtendParamsToHclTerraform, true)(this._extendParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterV3ExtendParamsList", + }, + masters: { + value: cdktf.listMapperHcl(cceClusterV3MastersToHclTerraform, true)(this._masters.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterV3MastersList", + }, + timeouts: { + value: cceClusterV3TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceClusterV3Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-cluster/README.md b/src/constructs/providers/huaweicloud/cce-cluster/README.md new file mode 100644 index 00000000..6281ae69 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster). diff --git a/src/constructs/providers/huaweicloud/cce-cluster/index.ts b/src/constructs/providers/huaweicloud/cce-cluster/index.ts new file mode 100644 index 00000000..8f3abc03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-cluster/index.ts @@ -0,0 +1,2455 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#alias CceCluster#alias} + */ + readonly alias?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#annotations CceCluster#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#authenticating_proxy_ca CceCluster#authenticating_proxy_ca} + */ + readonly authenticatingProxyCa?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#authenticating_proxy_cert CceCluster#authenticating_proxy_cert} + */ + readonly authenticatingProxyCert?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#authenticating_proxy_private_key CceCluster#authenticating_proxy_private_key} + */ + readonly authenticatingProxyPrivateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#authentication_mode CceCluster#authentication_mode} + */ + readonly authenticationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#auto_pay CceCluster#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#auto_renew CceCluster#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#billing_mode CceCluster#billing_mode} + */ + readonly billingMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#charging_mode CceCluster#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#cluster_type CceCluster#cluster_type} + */ + readonly clusterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#cluster_version CceCluster#cluster_version} + */ + readonly clusterVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#container_network_cidr CceCluster#container_network_cidr} + */ + readonly containerNetworkCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#container_network_type CceCluster#container_network_type} + */ + readonly containerNetworkType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#custom_san CceCluster#custom_san} + */ + readonly customSan?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_all CceCluster#delete_all} + */ + readonly deleteAll?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_efs CceCluster#delete_efs} + */ + readonly deleteEfs?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_eni CceCluster#delete_eni} + */ + readonly deleteEni?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_evs CceCluster#delete_evs} + */ + readonly deleteEvs?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_net CceCluster#delete_net} + */ + readonly deleteNet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_obs CceCluster#delete_obs} + */ + readonly deleteObs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete_sfs CceCluster#delete_sfs} + */ + readonly deleteSfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#description CceCluster#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#eip CceCluster#eip} + */ + readonly eip?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#enable_distribute_management CceCluster#enable_distribute_management} + */ + readonly enableDistributeManagement?: boolean | cdktf.IResolvable; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#eni_subnet_cidr CceCluster#eni_subnet_cidr} + */ + readonly eniSubnetCidr?: string; + /** + * the IPv4 subnet ID of the subnet where the ENI resides + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#eni_subnet_id CceCluster#eni_subnet_id} + */ + readonly eniSubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#enterprise_project_id CceCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#extend_param CceCluster#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#flavor_id CceCluster#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#hibernate CceCluster#hibernate} + */ + readonly hibernate?: boolean | cdktf.IResolvable; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#highway_subnet_id CceCluster#highway_subnet_id} + */ + readonly highwaySubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#id CceCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#ipv6_enable CceCluster#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#kube_proxy_mode CceCluster#kube_proxy_mode} + */ + readonly kubeProxyMode?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#labels CceCluster#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#lts_reclaim_policy CceCluster#lts_reclaim_policy} + */ + readonly ltsReclaimPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#multi_az CceCluster#multi_az} + */ + readonly multiAz?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#name CceCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#period CceCluster#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#period_unit CceCluster#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#region CceCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#security_group_id CceCluster#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#service_network_cidr CceCluster#service_network_cidr} + */ + readonly serviceNetworkCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#subnet_id CceCluster#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#support_istio CceCluster#support_istio} + */ + readonly supportIstio?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#tags CceCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#vpc_id CceCluster#vpc_id} + */ + readonly vpcId: string; + /** + * component_configurations block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#component_configurations CceCluster#component_configurations} + */ + readonly componentConfigurations?: CceClusterComponentConfigurations[] | cdktf.IResolvable; + /** + * extend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#extend_params CceCluster#extend_params} + */ + readonly extendParams?: CceClusterExtendParams[] | cdktf.IResolvable; + /** + * masters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#masters CceCluster#masters} + */ + readonly masters?: CceClusterMasters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#timeouts CceCluster#timeouts} + */ + readonly timeouts?: CceClusterTimeouts; +} +export interface CceClusterCertificateClusters { +} + +export function cceClusterCertificateClustersToTerraform(struct?: CceClusterCertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceClusterCertificateClustersToHclTerraform(struct?: CceClusterCertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceClusterCertificateClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterCertificateClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterCertificateClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_authority_data - computed: true, optional: false, required: false + public get certificateAuthorityData() { + return this.getStringAttribute('certificate_authority_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server - computed: true, optional: false, required: false + public get server() { + return this.getStringAttribute('server'); + } +} + +export class CceClusterCertificateClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterCertificateClustersOutputReference { + return new CceClusterCertificateClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterCertificateUsers { +} + +export function cceClusterCertificateUsersToTerraform(struct?: CceClusterCertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceClusterCertificateUsersToHclTerraform(struct?: CceClusterCertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceClusterCertificateUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterCertificateUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterCertificateUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_certificate_data - computed: true, optional: false, required: false + public get clientCertificateData() { + return this.getStringAttribute('client_certificate_data'); + } + + // client_key_data - computed: true, optional: false, required: false + public get clientKeyData() { + return this.getStringAttribute('client_key_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class CceClusterCertificateUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterCertificateUsersOutputReference { + return new CceClusterCertificateUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterComponentConfigurations { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#configurations CceCluster#configurations} + */ + readonly configurations?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#name CceCluster#name} + */ + readonly name: string; +} + +export function cceClusterComponentConfigurationsToTerraform(struct?: CceClusterComponentConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configurations: cdktf.stringToTerraform(struct!.configurations), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function cceClusterComponentConfigurationsToHclTerraform(struct?: CceClusterComponentConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configurations: { + value: cdktf.stringToHclTerraform(struct!.configurations), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterComponentConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterComponentConfigurations | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configurations !== undefined) { + hasAnyValues = true; + internalValueResult.configurations = this._configurations; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterComponentConfigurations | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._configurations = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._configurations = value.configurations; + this._name = value.name; + } + } + + // configurations - computed: false, optional: true, required: false + private _configurations?: string; + public get configurations() { + return this.getStringAttribute('configurations'); + } + public set configurations(value: string) { + this._configurations = value; + } + public resetConfigurations() { + this._configurations = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class CceClusterComponentConfigurationsList extends cdktf.ComplexList { + public internalValue? : CceClusterComponentConfigurations[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterComponentConfigurationsOutputReference { + return new CceClusterComponentConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterExtendParams { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#cluster_az CceCluster#cluster_az} + */ + readonly clusterAz?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#cpu_manager_policy CceCluster#cpu_manager_policy} + */ + readonly cpuManagerPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#dec_master_flavor CceCluster#dec_master_flavor} + */ + readonly decMasterFlavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#docker_umask_mode CceCluster#docker_umask_mode} + */ + readonly dockerUmaskMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#dss_master_volumes CceCluster#dss_master_volumes} + */ + readonly dssMasterVolumes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#fix_pool_mask CceCluster#fix_pool_mask} + */ + readonly fixPoolMask?: string; +} + +export function cceClusterExtendParamsToTerraform(struct?: CceClusterExtendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cluster_az: cdktf.stringToTerraform(struct!.clusterAz), + cpu_manager_policy: cdktf.stringToTerraform(struct!.cpuManagerPolicy), + dec_master_flavor: cdktf.stringToTerraform(struct!.decMasterFlavor), + docker_umask_mode: cdktf.stringToTerraform(struct!.dockerUmaskMode), + dss_master_volumes: cdktf.stringToTerraform(struct!.dssMasterVolumes), + fix_pool_mask: cdktf.stringToTerraform(struct!.fixPoolMask), + } +} + + +export function cceClusterExtendParamsToHclTerraform(struct?: CceClusterExtendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cluster_az: { + value: cdktf.stringToHclTerraform(struct!.clusterAz), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_manager_policy: { + value: cdktf.stringToHclTerraform(struct!.cpuManagerPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dec_master_flavor: { + value: cdktf.stringToHclTerraform(struct!.decMasterFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + docker_umask_mode: { + value: cdktf.stringToHclTerraform(struct!.dockerUmaskMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dss_master_volumes: { + value: cdktf.stringToHclTerraform(struct!.dssMasterVolumes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fix_pool_mask: { + value: cdktf.stringToHclTerraform(struct!.fixPoolMask), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterExtendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterExtendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusterAz !== undefined) { + hasAnyValues = true; + internalValueResult.clusterAz = this._clusterAz; + } + if (this._cpuManagerPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.cpuManagerPolicy = this._cpuManagerPolicy; + } + if (this._decMasterFlavor !== undefined) { + hasAnyValues = true; + internalValueResult.decMasterFlavor = this._decMasterFlavor; + } + if (this._dockerUmaskMode !== undefined) { + hasAnyValues = true; + internalValueResult.dockerUmaskMode = this._dockerUmaskMode; + } + if (this._dssMasterVolumes !== undefined) { + hasAnyValues = true; + internalValueResult.dssMasterVolumes = this._dssMasterVolumes; + } + if (this._fixPoolMask !== undefined) { + hasAnyValues = true; + internalValueResult.fixPoolMask = this._fixPoolMask; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterExtendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._clusterAz = undefined; + this._cpuManagerPolicy = undefined; + this._decMasterFlavor = undefined; + this._dockerUmaskMode = undefined; + this._dssMasterVolumes = undefined; + this._fixPoolMask = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._clusterAz = value.clusterAz; + this._cpuManagerPolicy = value.cpuManagerPolicy; + this._decMasterFlavor = value.decMasterFlavor; + this._dockerUmaskMode = value.dockerUmaskMode; + this._dssMasterVolumes = value.dssMasterVolumes; + this._fixPoolMask = value.fixPoolMask; + } + } + + // cluster_az - computed: false, optional: true, required: false + private _clusterAz?: string; + public get clusterAz() { + return this.getStringAttribute('cluster_az'); + } + public set clusterAz(value: string) { + this._clusterAz = value; + } + public resetClusterAz() { + this._clusterAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterAzInput() { + return this._clusterAz; + } + + // cpu_manager_policy - computed: false, optional: true, required: false + private _cpuManagerPolicy?: string; + public get cpuManagerPolicy() { + return this.getStringAttribute('cpu_manager_policy'); + } + public set cpuManagerPolicy(value: string) { + this._cpuManagerPolicy = value; + } + public resetCpuManagerPolicy() { + this._cpuManagerPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuManagerPolicyInput() { + return this._cpuManagerPolicy; + } + + // dec_master_flavor - computed: false, optional: true, required: false + private _decMasterFlavor?: string; + public get decMasterFlavor() { + return this.getStringAttribute('dec_master_flavor'); + } + public set decMasterFlavor(value: string) { + this._decMasterFlavor = value; + } + public resetDecMasterFlavor() { + this._decMasterFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get decMasterFlavorInput() { + return this._decMasterFlavor; + } + + // docker_umask_mode - computed: false, optional: true, required: false + private _dockerUmaskMode?: string; + public get dockerUmaskMode() { + return this.getStringAttribute('docker_umask_mode'); + } + public set dockerUmaskMode(value: string) { + this._dockerUmaskMode = value; + } + public resetDockerUmaskMode() { + this._dockerUmaskMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerUmaskModeInput() { + return this._dockerUmaskMode; + } + + // dss_master_volumes - computed: false, optional: true, required: false + private _dssMasterVolumes?: string; + public get dssMasterVolumes() { + return this.getStringAttribute('dss_master_volumes'); + } + public set dssMasterVolumes(value: string) { + this._dssMasterVolumes = value; + } + public resetDssMasterVolumes() { + this._dssMasterVolumes = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssMasterVolumesInput() { + return this._dssMasterVolumes; + } + + // fix_pool_mask - computed: false, optional: true, required: false + private _fixPoolMask?: string; + public get fixPoolMask() { + return this.getStringAttribute('fix_pool_mask'); + } + public set fixPoolMask(value: string) { + this._fixPoolMask = value; + } + public resetFixPoolMask() { + this._fixPoolMask = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixPoolMaskInput() { + return this._fixPoolMask; + } +} + +export class CceClusterExtendParamsList extends cdktf.ComplexList { + public internalValue? : CceClusterExtendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterExtendParamsOutputReference { + return new CceClusterExtendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterMasters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#availability_zone CceCluster#availability_zone} + */ + readonly availabilityZone?: string; +} + +export function cceClusterMastersToTerraform(struct?: CceClusterMasters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + } +} + + +export function cceClusterMastersToHclTerraform(struct?: CceClusterMasters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterMastersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceClusterMasters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterMasters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._availabilityZone = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._availabilityZone = value.availabilityZone; + } + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } +} + +export class CceClusterMastersList extends cdktf.ComplexList { + public internalValue? : CceClusterMasters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceClusterMastersOutputReference { + return new CceClusterMastersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#create CceCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#delete CceCluster#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#update CceCluster#update} + */ + readonly update?: string; +} + +export function cceClusterTimeoutsToTerraform(struct?: CceClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cceClusterTimeoutsToHclTerraform(struct?: CceClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster huaweicloud_cce_cluster} +*/ +export class CceCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceCluster to import + * @param importFromId The id of the existing CceCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_cluster huaweicloud_cce_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceClusterConfig + */ + public constructor(scope: Construct, id: string, config: CceClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alias = config.alias; + this._annotations = config.annotations; + this._authenticatingProxyCa = config.authenticatingProxyCa; + this._authenticatingProxyCert = config.authenticatingProxyCert; + this._authenticatingProxyPrivateKey = config.authenticatingProxyPrivateKey; + this._authenticationMode = config.authenticationMode; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._billingMode = config.billingMode; + this._chargingMode = config.chargingMode; + this._clusterType = config.clusterType; + this._clusterVersion = config.clusterVersion; + this._containerNetworkCidr = config.containerNetworkCidr; + this._containerNetworkType = config.containerNetworkType; + this._customSan = config.customSan; + this._deleteAll = config.deleteAll; + this._deleteEfs = config.deleteEfs; + this._deleteEni = config.deleteEni; + this._deleteEvs = config.deleteEvs; + this._deleteNet = config.deleteNet; + this._deleteObs = config.deleteObs; + this._deleteSfs = config.deleteSfs; + this._description = config.description; + this._eip = config.eip; + this._enableDistributeManagement = config.enableDistributeManagement; + this._eniSubnetCidr = config.eniSubnetCidr; + this._eniSubnetId = config.eniSubnetId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extendParam = config.extendParam; + this._flavorId = config.flavorId; + this._hibernate = config.hibernate; + this._highwaySubnetId = config.highwaySubnetId; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._kubeProxyMode = config.kubeProxyMode; + this._labels = config.labels; + this._ltsReclaimPolicy = config.ltsReclaimPolicy; + this._multiAz = config.multiAz; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._serviceNetworkCidr = config.serviceNetworkCidr; + this._subnetId = config.subnetId; + this._supportIstio = config.supportIstio; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._componentConfigurations.internalValue = config.componentConfigurations; + this._extendParams.internalValue = config.extendParams; + this._masters.internalValue = config.masters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // alias - computed: true, optional: true, required: false + private _alias?: string; + public get alias() { + return this.getStringAttribute('alias'); + } + public set alias(value: string) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // authenticating_proxy_ca - computed: false, optional: true, required: false + private _authenticatingProxyCa?: string; + public get authenticatingProxyCa() { + return this.getStringAttribute('authenticating_proxy_ca'); + } + public set authenticatingProxyCa(value: string) { + this._authenticatingProxyCa = value; + } + public resetAuthenticatingProxyCa() { + this._authenticatingProxyCa = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticatingProxyCaInput() { + return this._authenticatingProxyCa; + } + + // authenticating_proxy_cert - computed: false, optional: true, required: false + private _authenticatingProxyCert?: string; + public get authenticatingProxyCert() { + return this.getStringAttribute('authenticating_proxy_cert'); + } + public set authenticatingProxyCert(value: string) { + this._authenticatingProxyCert = value; + } + public resetAuthenticatingProxyCert() { + this._authenticatingProxyCert = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticatingProxyCertInput() { + return this._authenticatingProxyCert; + } + + // authenticating_proxy_private_key - computed: false, optional: true, required: false + private _authenticatingProxyPrivateKey?: string; + public get authenticatingProxyPrivateKey() { + return this.getStringAttribute('authenticating_proxy_private_key'); + } + public set authenticatingProxyPrivateKey(value: string) { + this._authenticatingProxyPrivateKey = value; + } + public resetAuthenticatingProxyPrivateKey() { + this._authenticatingProxyPrivateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticatingProxyPrivateKeyInput() { + return this._authenticatingProxyPrivateKey; + } + + // authentication_mode - computed: false, optional: true, required: false + private _authenticationMode?: string; + public get authenticationMode() { + return this.getStringAttribute('authentication_mode'); + } + public set authenticationMode(value: string) { + this._authenticationMode = value; + } + public resetAuthenticationMode() { + this._authenticationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationModeInput() { + return this._authenticationMode; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // billing_mode - computed: true, optional: true, required: false + private _billingMode?: number; + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + public set billingMode(value: number) { + this._billingMode = value; + } + public resetBillingMode() { + this._billingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get billingModeInput() { + return this._billingMode; + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // certificate_clusters - computed: true, optional: false, required: false + private _certificateClusters = new CceClusterCertificateClustersList(this, "certificate_clusters", false); + public get certificateClusters() { + return this._certificateClusters; + } + + // certificate_users - computed: true, optional: false, required: false + private _certificateUsers = new CceClusterCertificateUsersList(this, "certificate_users", false); + public get certificateUsers() { + return this._certificateUsers; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cluster_type - computed: false, optional: true, required: false + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cluster_version - computed: true, optional: true, required: false + private _clusterVersion?: string; + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + public set clusterVersion(value: string) { + this._clusterVersion = value; + } + public resetClusterVersion() { + this._clusterVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterVersionInput() { + return this._clusterVersion; + } + + // container_network_cidr - computed: true, optional: true, required: false + private _containerNetworkCidr?: string; + public get containerNetworkCidr() { + return this.getStringAttribute('container_network_cidr'); + } + public set containerNetworkCidr(value: string) { + this._containerNetworkCidr = value; + } + public resetContainerNetworkCidr() { + this._containerNetworkCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get containerNetworkCidrInput() { + return this._containerNetworkCidr; + } + + // container_network_type - computed: false, optional: false, required: true + private _containerNetworkType?: string; + public get containerNetworkType() { + return this.getStringAttribute('container_network_type'); + } + public set containerNetworkType(value: string) { + this._containerNetworkType = value; + } + // Temporarily expose input value. Use with caution. + public get containerNetworkTypeInput() { + return this._containerNetworkType; + } + + // custom_san - computed: true, optional: true, required: false + private _customSan?: string[]; + public get customSan() { + return this.getListAttribute('custom_san'); + } + public set customSan(value: string[]) { + this._customSan = value; + } + public resetCustomSan() { + this._customSan = undefined; + } + // Temporarily expose input value. Use with caution. + public get customSanInput() { + return this._customSan; + } + + // delete_all - computed: false, optional: true, required: false + private _deleteAll?: string; + public get deleteAll() { + return this.getStringAttribute('delete_all'); + } + public set deleteAll(value: string) { + this._deleteAll = value; + } + public resetDeleteAll() { + this._deleteAll = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteAllInput() { + return this._deleteAll; + } + + // delete_efs - computed: false, optional: true, required: false + private _deleteEfs?: string; + public get deleteEfs() { + return this.getStringAttribute('delete_efs'); + } + public set deleteEfs(value: string) { + this._deleteEfs = value; + } + public resetDeleteEfs() { + this._deleteEfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEfsInput() { + return this._deleteEfs; + } + + // delete_eni - computed: false, optional: true, required: false + private _deleteEni?: string; + public get deleteEni() { + return this.getStringAttribute('delete_eni'); + } + public set deleteEni(value: string) { + this._deleteEni = value; + } + public resetDeleteEni() { + this._deleteEni = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEniInput() { + return this._deleteEni; + } + + // delete_evs - computed: false, optional: true, required: false + private _deleteEvs?: string; + public get deleteEvs() { + return this.getStringAttribute('delete_evs'); + } + public set deleteEvs(value: string) { + this._deleteEvs = value; + } + public resetDeleteEvs() { + this._deleteEvs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEvsInput() { + return this._deleteEvs; + } + + // delete_net - computed: false, optional: true, required: false + private _deleteNet?: string; + public get deleteNet() { + return this.getStringAttribute('delete_net'); + } + public set deleteNet(value: string) { + this._deleteNet = value; + } + public resetDeleteNet() { + this._deleteNet = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteNetInput() { + return this._deleteNet; + } + + // delete_obs - computed: false, optional: true, required: false + private _deleteObs?: string; + public get deleteObs() { + return this.getStringAttribute('delete_obs'); + } + public set deleteObs(value: string) { + this._deleteObs = value; + } + public resetDeleteObs() { + this._deleteObs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteObsInput() { + return this._deleteObs; + } + + // delete_sfs - computed: false, optional: true, required: false + private _deleteSfs?: string; + public get deleteSfs() { + return this.getStringAttribute('delete_sfs'); + } + public set deleteSfs(value: string) { + this._deleteSfs = value; + } + public resetDeleteSfs() { + this._deleteSfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteSfsInput() { + return this._deleteSfs; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // eip - computed: false, optional: true, required: false + private _eip?: string; + public get eip() { + return this.getStringAttribute('eip'); + } + public set eip(value: string) { + this._eip = value; + } + public resetEip() { + this._eip = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipInput() { + return this._eip; + } + + // enable_distribute_management - computed: false, optional: true, required: false + private _enableDistributeManagement?: boolean | cdktf.IResolvable; + public get enableDistributeManagement() { + return this.getBooleanAttribute('enable_distribute_management'); + } + public set enableDistributeManagement(value: boolean | cdktf.IResolvable) { + this._enableDistributeManagement = value; + } + public resetEnableDistributeManagement() { + this._enableDistributeManagement = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDistributeManagementInput() { + return this._enableDistributeManagement; + } + + // eni_subnet_cidr - computed: true, optional: true, required: false + private _eniSubnetCidr?: string; + public get eniSubnetCidr() { + return this.getStringAttribute('eni_subnet_cidr'); + } + public set eniSubnetCidr(value: string) { + this._eniSubnetCidr = value; + } + public resetEniSubnetCidr() { + this._eniSubnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get eniSubnetCidrInput() { + return this._eniSubnetCidr; + } + + // eni_subnet_id - computed: true, optional: true, required: false + private _eniSubnetId?: string; + public get eniSubnetId() { + return this.getStringAttribute('eni_subnet_id'); + } + public set eniSubnetId(value: string) { + this._eniSubnetId = value; + } + public resetEniSubnetId() { + this._eniSubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eniSubnetIdInput() { + return this._eniSubnetId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // hibernate - computed: false, optional: true, required: false + private _hibernate?: boolean | cdktf.IResolvable; + public get hibernate() { + return this.getBooleanAttribute('hibernate'); + } + public set hibernate(value: boolean | cdktf.IResolvable) { + this._hibernate = value; + } + public resetHibernate() { + this._hibernate = undefined; + } + // Temporarily expose input value. Use with caution. + public get hibernateInput() { + return this._hibernate; + } + + // highway_subnet_id - computed: true, optional: true, required: false + private _highwaySubnetId?: string; + public get highwaySubnetId() { + return this.getStringAttribute('highway_subnet_id'); + } + public set highwaySubnetId(value: string) { + this._highwaySubnetId = value; + } + public resetHighwaySubnetId() { + this._highwaySubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get highwaySubnetIdInput() { + return this._highwaySubnetId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // kube_config_raw - computed: true, optional: false, required: false + public get kubeConfigRaw() { + return this.getStringAttribute('kube_config_raw'); + } + + // kube_proxy_mode - computed: true, optional: true, required: false + private _kubeProxyMode?: string; + public get kubeProxyMode() { + return this.getStringAttribute('kube_proxy_mode'); + } + public set kubeProxyMode(value: string) { + this._kubeProxyMode = value; + } + public resetKubeProxyMode() { + this._kubeProxyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get kubeProxyModeInput() { + return this._kubeProxyMode; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // lts_reclaim_policy - computed: false, optional: true, required: false + private _ltsReclaimPolicy?: string; + public get ltsReclaimPolicy() { + return this.getStringAttribute('lts_reclaim_policy'); + } + public set ltsReclaimPolicy(value: string) { + this._ltsReclaimPolicy = value; + } + public resetLtsReclaimPolicy() { + this._ltsReclaimPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsReclaimPolicyInput() { + return this._ltsReclaimPolicy; + } + + // multi_az - computed: false, optional: true, required: false + private _multiAz?: boolean | cdktf.IResolvable; + public get multiAz() { + return this.getBooleanAttribute('multi_az'); + } + public set multiAz(value: boolean | cdktf.IResolvable) { + this._multiAz = value; + } + public resetMultiAz() { + this._multiAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiAzInput() { + return this._multiAz; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // service_network_cidr - computed: true, optional: true, required: false + private _serviceNetworkCidr?: string; + public get serviceNetworkCidr() { + return this.getStringAttribute('service_network_cidr'); + } + public set serviceNetworkCidr(value: string) { + this._serviceNetworkCidr = value; + } + public resetServiceNetworkCidr() { + this._serviceNetworkCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNetworkCidrInput() { + return this._serviceNetworkCidr; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // support_istio - computed: true, optional: true, required: false + private _supportIstio?: boolean | cdktf.IResolvable; + public get supportIstio() { + return this.getBooleanAttribute('support_istio'); + } + public set supportIstio(value: boolean | cdktf.IResolvable) { + this._supportIstio = value; + } + public resetSupportIstio() { + this._supportIstio = undefined; + } + // Temporarily expose input value. Use with caution. + public get supportIstioInput() { + return this._supportIstio; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // component_configurations - computed: false, optional: true, required: false + private _componentConfigurations = new CceClusterComponentConfigurationsList(this, "component_configurations", false); + public get componentConfigurations() { + return this._componentConfigurations; + } + public putComponentConfigurations(value: CceClusterComponentConfigurations[] | cdktf.IResolvable) { + this._componentConfigurations.internalValue = value; + } + public resetComponentConfigurations() { + this._componentConfigurations.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get componentConfigurationsInput() { + return this._componentConfigurations.internalValue; + } + + // extend_params - computed: false, optional: true, required: false + private _extendParams = new CceClusterExtendParamsList(this, "extend_params", false); + public get extendParams() { + return this._extendParams; + } + public putExtendParams(value: CceClusterExtendParams[] | cdktf.IResolvable) { + this._extendParams.internalValue = value; + } + public resetExtendParams() { + this._extendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams.internalValue; + } + + // masters - computed: false, optional: true, required: false + private _masters = new CceClusterMastersList(this, "masters", false); + public get masters() { + return this._masters; + } + public putMasters(value: CceClusterMasters[] | cdktf.IResolvable) { + this._masters.internalValue = value; + } + public resetMasters() { + this._masters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mastersInput() { + return this._masters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alias: cdktf.stringToTerraform(this._alias), + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + authenticating_proxy_ca: cdktf.stringToTerraform(this._authenticatingProxyCa), + authenticating_proxy_cert: cdktf.stringToTerraform(this._authenticatingProxyCert), + authenticating_proxy_private_key: cdktf.stringToTerraform(this._authenticatingProxyPrivateKey), + authentication_mode: cdktf.stringToTerraform(this._authenticationMode), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + billing_mode: cdktf.numberToTerraform(this._billingMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cluster_type: cdktf.stringToTerraform(this._clusterType), + cluster_version: cdktf.stringToTerraform(this._clusterVersion), + container_network_cidr: cdktf.stringToTerraform(this._containerNetworkCidr), + container_network_type: cdktf.stringToTerraform(this._containerNetworkType), + custom_san: cdktf.listMapper(cdktf.stringToTerraform, false)(this._customSan), + delete_all: cdktf.stringToTerraform(this._deleteAll), + delete_efs: cdktf.stringToTerraform(this._deleteEfs), + delete_eni: cdktf.stringToTerraform(this._deleteEni), + delete_evs: cdktf.stringToTerraform(this._deleteEvs), + delete_net: cdktf.stringToTerraform(this._deleteNet), + delete_obs: cdktf.stringToTerraform(this._deleteObs), + delete_sfs: cdktf.stringToTerraform(this._deleteSfs), + description: cdktf.stringToTerraform(this._description), + eip: cdktf.stringToTerraform(this._eip), + enable_distribute_management: cdktf.booleanToTerraform(this._enableDistributeManagement), + eni_subnet_cidr: cdktf.stringToTerraform(this._eniSubnetCidr), + eni_subnet_id: cdktf.stringToTerraform(this._eniSubnetId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(this._extendParam), + flavor_id: cdktf.stringToTerraform(this._flavorId), + hibernate: cdktf.booleanToTerraform(this._hibernate), + highway_subnet_id: cdktf.stringToTerraform(this._highwaySubnetId), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + kube_proxy_mode: cdktf.stringToTerraform(this._kubeProxyMode), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + lts_reclaim_policy: cdktf.stringToTerraform(this._ltsReclaimPolicy), + multi_az: cdktf.booleanToTerraform(this._multiAz), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + service_network_cidr: cdktf.stringToTerraform(this._serviceNetworkCidr), + subnet_id: cdktf.stringToTerraform(this._subnetId), + support_istio: cdktf.booleanToTerraform(this._supportIstio), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + component_configurations: cdktf.listMapper(cceClusterComponentConfigurationsToTerraform, true)(this._componentConfigurations.internalValue), + extend_params: cdktf.listMapper(cceClusterExtendParamsToTerraform, true)(this._extendParams.internalValue), + masters: cdktf.listMapper(cceClusterMastersToTerraform, true)(this._masters.internalValue), + timeouts: cceClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alias: { + value: cdktf.stringToHclTerraform(this._alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + authenticating_proxy_ca: { + value: cdktf.stringToHclTerraform(this._authenticatingProxyCa), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authenticating_proxy_cert: { + value: cdktf.stringToHclTerraform(this._authenticatingProxyCert), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authenticating_proxy_private_key: { + value: cdktf.stringToHclTerraform(this._authenticatingProxyPrivateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication_mode: { + value: cdktf.stringToHclTerraform(this._authenticationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + billing_mode: { + value: cdktf.numberToHclTerraform(this._billingMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_version: { + value: cdktf.stringToHclTerraform(this._clusterVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_network_cidr: { + value: cdktf.stringToHclTerraform(this._containerNetworkCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_network_type: { + value: cdktf.stringToHclTerraform(this._containerNetworkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_san: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._customSan), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + delete_all: { + value: cdktf.stringToHclTerraform(this._deleteAll), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_efs: { + value: cdktf.stringToHclTerraform(this._deleteEfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_eni: { + value: cdktf.stringToHclTerraform(this._deleteEni), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_evs: { + value: cdktf.stringToHclTerraform(this._deleteEvs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_net: { + value: cdktf.stringToHclTerraform(this._deleteNet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_obs: { + value: cdktf.stringToHclTerraform(this._deleteObs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_sfs: { + value: cdktf.stringToHclTerraform(this._deleteSfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip: { + value: cdktf.stringToHclTerraform(this._eip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_distribute_management: { + value: cdktf.booleanToHclTerraform(this._enableDistributeManagement), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + eni_subnet_cidr: { + value: cdktf.stringToHclTerraform(this._eniSubnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eni_subnet_id: { + value: cdktf.stringToHclTerraform(this._eniSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hibernate: { + value: cdktf.booleanToHclTerraform(this._hibernate), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + highway_subnet_id: { + value: cdktf.stringToHclTerraform(this._highwaySubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kube_proxy_mode: { + value: cdktf.stringToHclTerraform(this._kubeProxyMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lts_reclaim_policy: { + value: cdktf.stringToHclTerraform(this._ltsReclaimPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multi_az: { + value: cdktf.booleanToHclTerraform(this._multiAz), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_network_cidr: { + value: cdktf.stringToHclTerraform(this._serviceNetworkCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + support_istio: { + value: cdktf.booleanToHclTerraform(this._supportIstio), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_configurations: { + value: cdktf.listMapperHcl(cceClusterComponentConfigurationsToHclTerraform, true)(this._componentConfigurations.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterComponentConfigurationsList", + }, + extend_params: { + value: cdktf.listMapperHcl(cceClusterExtendParamsToHclTerraform, true)(this._extendParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterExtendParamsList", + }, + masters: { + value: cdktf.listMapperHcl(cceClusterMastersToHclTerraform, true)(this._masters.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceClusterMastersList", + }, + timeouts: { + value: cceClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-namespace/README.md b/src/constructs/providers/huaweicloud/cce-namespace/README.md new file mode 100644 index 00000000..4b23a471 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-namespace/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_namespace` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_namespace`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace). diff --git a/src/constructs/providers/huaweicloud/cce-namespace/index.ts b/src/constructs/providers/huaweicloud/cce-namespace/index.ts new file mode 100644 index 00000000..4f88a996 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-namespace/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceNamespaceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#annotations CceNamespace#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#cluster_id CceNamespace#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#id CceNamespace#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#labels CceNamespace#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#name CceNamespace#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#prefix CceNamespace#prefix} + */ + readonly prefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#region CceNamespace#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#timeouts CceNamespace#timeouts} + */ + readonly timeouts?: CceNamespaceTimeouts; +} +export interface CceNamespaceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#delete CceNamespace#delete} + */ + readonly delete?: string; +} + +export function cceNamespaceTimeoutsToTerraform(struct?: CceNamespaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cceNamespaceTimeoutsToHclTerraform(struct?: CceNamespaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNamespaceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceNamespaceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNamespaceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace huaweicloud_cce_namespace} +*/ +export class CceNamespace extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_namespace"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceNamespace resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceNamespace to import + * @param importFromId The id of the existing CceNamespace that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceNamespace to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_namespace", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_namespace huaweicloud_cce_namespace} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceNamespaceConfig + */ + public constructor(scope: Construct, id: string, config: CceNamespaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_namespace', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._annotations = config.annotations; + this._clusterId = config.clusterId; + this._id = config.id; + this._labels = config.labels; + this._name = config.name; + this._prefix = config.prefix; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // annotations - computed: true, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // creation_timestamp - computed: true, optional: false, required: false + public get creationTimestamp() { + return this.getStringAttribute('creation_timestamp'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // labels - computed: true, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // prefix - computed: false, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceNamespaceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceNamespaceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + name: cdktf.stringToTerraform(this._name), + prefix: cdktf.stringToTerraform(this._prefix), + region: cdktf.stringToTerraform(this._region), + timeouts: cceNamespaceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prefix: { + value: cdktf.stringToHclTerraform(this._prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cceNamespaceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceNamespaceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-node-attach/README.md b/src/constructs/providers/huaweicloud/cce-node-attach/README.md new file mode 100644 index 00000000..0b7edbca --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-attach/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_node_attach` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_node_attach`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach). diff --git a/src/constructs/providers/huaweicloud/cce-node-attach/index.ts b/src/constructs/providers/huaweicloud/cce-node-attach/index.ts new file mode 100644 index 00000000..59989565 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-attach/index.ts @@ -0,0 +1,2380 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceNodeAttachConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#cluster_id CceNodeAttach#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#docker_base_size CceNodeAttach#docker_base_size} + */ + readonly dockerBaseSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#id CceNodeAttach#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#image_id CceNodeAttach#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#initialized_conditions CceNodeAttach#initialized_conditions} + */ + readonly initializedConditions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#key_pair CceNodeAttach#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#labels CceNodeAttach#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#lvm_config CceNodeAttach#lvm_config} + */ + readonly lvmConfig?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#max_pods CceNodeAttach#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#name CceNodeAttach#name} + */ + readonly name?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#nic_multi_queue CceNodeAttach#nic_multi_queue} + */ + readonly nicMultiQueue?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#nic_threshold CceNodeAttach#nic_threshold} + */ + readonly nicThreshold?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#os CceNodeAttach#os} + */ + readonly os: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#password CceNodeAttach#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#postinstall CceNodeAttach#postinstall} + */ + readonly postinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#preinstall CceNodeAttach#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#private_key CceNodeAttach#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#region CceNodeAttach#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#runtime CceNodeAttach#runtime} + */ + readonly runtime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#server_id CceNodeAttach#server_id} + */ + readonly serverId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#system_disk_kms_key_id CceNodeAttach#system_disk_kms_key_id} + */ + readonly systemDiskKmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#tags CceNodeAttach#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * hostname_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#hostname_config CceNodeAttach#hostname_config} + */ + readonly hostnameConfig?: CceNodeAttachHostnameConfig; + /** + * storage block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#storage CceNodeAttach#storage} + */ + readonly storage?: CceNodeAttachStorage; + /** + * taints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#taints CceNodeAttach#taints} + */ + readonly taints?: CceNodeAttachTaints[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#timeouts CceNodeAttach#timeouts} + */ + readonly timeouts?: CceNodeAttachTimeouts; +} +export interface CceNodeAttachDataVolumes { +} + +export function cceNodeAttachDataVolumesToTerraform(struct?: CceNodeAttachDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceNodeAttachDataVolumesToHclTerraform(struct?: CceNodeAttachDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceNodeAttachDataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeAttachDataVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachDataVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dss_pool_id - computed: true, optional: false, required: false + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + + // extend_param - computed: true, optional: false, required: false + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // hw_passthrough - computed: true, optional: false, required: false + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class CceNodeAttachDataVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeAttachDataVolumesOutputReference { + return new CceNodeAttachDataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeAttachRootVolume { +} + +export function cceNodeAttachRootVolumeToTerraform(struct?: CceNodeAttachRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cceNodeAttachRootVolumeToHclTerraform(struct?: CceNodeAttachRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CceNodeAttachRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeAttachRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dss_pool_id - computed: true, optional: false, required: false + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + + // extend_param - computed: true, optional: false, required: false + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // hw_passthrough - computed: true, optional: false, required: false + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class CceNodeAttachRootVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeAttachRootVolumeOutputReference { + return new CceNodeAttachRootVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeAttachHostnameConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#type CceNodeAttach#type} + */ + readonly type: string; +} + +export function cceNodeAttachHostnameConfigToTerraform(struct?: CceNodeAttachHostnameConfigOutputReference | CceNodeAttachHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodeAttachHostnameConfigToHclTerraform(struct?: CceNodeAttachHostnameConfigOutputReference | CceNodeAttachHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachHostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeAttachHostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachHostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CceNodeAttachStorageGroupsVirtualSpaces { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#lvm_lv_type CceNodeAttach#lvm_lv_type} + */ + readonly lvmLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#lvm_path CceNodeAttach#lvm_path} + */ + readonly lvmPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#name CceNodeAttach#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#runtime_lv_type CceNodeAttach#runtime_lv_type} + */ + readonly runtimeLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#size CceNodeAttach#size} + */ + readonly size: string; +} + +export function cceNodeAttachStorageGroupsVirtualSpacesToTerraform(struct?: CceNodeAttachStorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + lvm_lv_type: cdktf.stringToTerraform(struct!.lvmLvType), + lvm_path: cdktf.stringToTerraform(struct!.lvmPath), + name: cdktf.stringToTerraform(struct!.name), + runtime_lv_type: cdktf.stringToTerraform(struct!.runtimeLvType), + size: cdktf.stringToTerraform(struct!.size), + } +} + + +export function cceNodeAttachStorageGroupsVirtualSpacesToHclTerraform(struct?: CceNodeAttachStorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + lvm_lv_type: { + value: cdktf.stringToHclTerraform(struct!.lvmLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lvm_path: { + value: cdktf.stringToHclTerraform(struct!.lvmPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_lv_type: { + value: cdktf.stringToHclTerraform(struct!.runtimeLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.stringToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachStorageGroupsVirtualSpacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeAttachStorageGroupsVirtualSpaces | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._lvmLvType !== undefined) { + hasAnyValues = true; + internalValueResult.lvmLvType = this._lvmLvType; + } + if (this._lvmPath !== undefined) { + hasAnyValues = true; + internalValueResult.lvmPath = this._lvmPath; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._runtimeLvType !== undefined) { + hasAnyValues = true; + internalValueResult.runtimeLvType = this._runtimeLvType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachStorageGroupsVirtualSpaces | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._lvmLvType = undefined; + this._lvmPath = undefined; + this._name = undefined; + this._runtimeLvType = undefined; + this._size = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._lvmLvType = value.lvmLvType; + this._lvmPath = value.lvmPath; + this._name = value.name; + this._runtimeLvType = value.runtimeLvType; + this._size = value.size; + } + } + + // lvm_lv_type - computed: false, optional: true, required: false + private _lvmLvType?: string; + public get lvmLvType() { + return this.getStringAttribute('lvm_lv_type'); + } + public set lvmLvType(value: string) { + this._lvmLvType = value; + } + public resetLvmLvType() { + this._lvmLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmLvTypeInput() { + return this._lvmLvType; + } + + // lvm_path - computed: false, optional: true, required: false + private _lvmPath?: string; + public get lvmPath() { + return this.getStringAttribute('lvm_path'); + } + public set lvmPath(value: string) { + this._lvmPath = value; + } + public resetLvmPath() { + this._lvmPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmPathInput() { + return this._lvmPath; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // runtime_lv_type - computed: false, optional: true, required: false + private _runtimeLvType?: string; + public get runtimeLvType() { + return this.getStringAttribute('runtime_lv_type'); + } + public set runtimeLvType(value: string) { + this._runtimeLvType = value; + } + public resetRuntimeLvType() { + this._runtimeLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeLvTypeInput() { + return this._runtimeLvType; + } + + // size - computed: false, optional: false, required: true + private _size?: string; + public get size() { + return this.getStringAttribute('size'); + } + public set size(value: string) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} + +export class CceNodeAttachStorageGroupsVirtualSpacesList extends cdktf.ComplexList { + public internalValue? : CceNodeAttachStorageGroupsVirtualSpaces[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeAttachStorageGroupsVirtualSpacesOutputReference { + return new CceNodeAttachStorageGroupsVirtualSpacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeAttachStorageGroups { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#cce_managed CceNodeAttach#cce_managed} + */ + readonly cceManaged?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#name CceNodeAttach#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#selector_names CceNodeAttach#selector_names} + */ + readonly selectorNames: string[]; + /** + * virtual_spaces block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#virtual_spaces CceNodeAttach#virtual_spaces} + */ + readonly virtualSpaces: CceNodeAttachStorageGroupsVirtualSpaces[] | cdktf.IResolvable; +} + +export function cceNodeAttachStorageGroupsToTerraform(struct?: CceNodeAttachStorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cce_managed: cdktf.booleanToTerraform(struct!.cceManaged), + name: cdktf.stringToTerraform(struct!.name), + selector_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.selectorNames), + virtual_spaces: cdktf.listMapper(cceNodeAttachStorageGroupsVirtualSpacesToTerraform, true)(struct!.virtualSpaces), + } +} + + +export function cceNodeAttachStorageGroupsToHclTerraform(struct?: CceNodeAttachStorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cce_managed: { + value: cdktf.booleanToHclTerraform(struct!.cceManaged), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + selector_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.selectorNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + virtual_spaces: { + value: cdktf.listMapperHcl(cceNodeAttachStorageGroupsVirtualSpacesToHclTerraform, true)(struct!.virtualSpaces), + isBlock: true, + type: "list", + storageClassType: "CceNodeAttachStorageGroupsVirtualSpacesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachStorageGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeAttachStorageGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cceManaged !== undefined) { + hasAnyValues = true; + internalValueResult.cceManaged = this._cceManaged; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._selectorNames !== undefined) { + hasAnyValues = true; + internalValueResult.selectorNames = this._selectorNames; + } + if (this._virtualSpaces?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.virtualSpaces = this._virtualSpaces?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachStorageGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cceManaged = undefined; + this._name = undefined; + this._selectorNames = undefined; + this._virtualSpaces.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cceManaged = value.cceManaged; + this._name = value.name; + this._selectorNames = value.selectorNames; + this._virtualSpaces.internalValue = value.virtualSpaces; + } + } + + // cce_managed - computed: false, optional: true, required: false + private _cceManaged?: boolean | cdktf.IResolvable; + public get cceManaged() { + return this.getBooleanAttribute('cce_managed'); + } + public set cceManaged(value: boolean | cdktf.IResolvable) { + this._cceManaged = value; + } + public resetCceManaged() { + this._cceManaged = undefined; + } + // Temporarily expose input value. Use with caution. + public get cceManagedInput() { + return this._cceManaged; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // selector_names - computed: false, optional: false, required: true + private _selectorNames?: string[]; + public get selectorNames() { + return this.getListAttribute('selector_names'); + } + public set selectorNames(value: string[]) { + this._selectorNames = value; + } + // Temporarily expose input value. Use with caution. + public get selectorNamesInput() { + return this._selectorNames; + } + + // virtual_spaces - computed: false, optional: false, required: true + private _virtualSpaces = new CceNodeAttachStorageGroupsVirtualSpacesList(this, "virtual_spaces", false); + public get virtualSpaces() { + return this._virtualSpaces; + } + public putVirtualSpaces(value: CceNodeAttachStorageGroupsVirtualSpaces[] | cdktf.IResolvable) { + this._virtualSpaces.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get virtualSpacesInput() { + return this._virtualSpaces.internalValue; + } +} + +export class CceNodeAttachStorageGroupsList extends cdktf.ComplexList { + public internalValue? : CceNodeAttachStorageGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeAttachStorageGroupsOutputReference { + return new CceNodeAttachStorageGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeAttachStorageSelectors { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#match_label_count CceNodeAttach#match_label_count} + */ + readonly matchLabelCount?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#match_label_metadata_cmkid CceNodeAttach#match_label_metadata_cmkid} + */ + readonly matchLabelMetadataCmkid?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#match_label_metadata_encrypted CceNodeAttach#match_label_metadata_encrypted} + */ + readonly matchLabelMetadataEncrypted?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#match_label_size CceNodeAttach#match_label_size} + */ + readonly matchLabelSize?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#match_label_volume_type CceNodeAttach#match_label_volume_type} + */ + readonly matchLabelVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#name CceNodeAttach#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#type CceNodeAttach#type} + */ + readonly type?: string; +} + +export function cceNodeAttachStorageSelectorsToTerraform(struct?: CceNodeAttachStorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_label_count: cdktf.stringToTerraform(struct!.matchLabelCount), + match_label_metadata_cmkid: cdktf.stringToTerraform(struct!.matchLabelMetadataCmkid), + match_label_metadata_encrypted: cdktf.stringToTerraform(struct!.matchLabelMetadataEncrypted), + match_label_size: cdktf.stringToTerraform(struct!.matchLabelSize), + match_label_volume_type: cdktf.stringToTerraform(struct!.matchLabelVolumeType), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodeAttachStorageSelectorsToHclTerraform(struct?: CceNodeAttachStorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_label_count: { + value: cdktf.stringToHclTerraform(struct!.matchLabelCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_cmkid: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataCmkid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_encrypted: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataEncrypted), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_size: { + value: cdktf.stringToHclTerraform(struct!.matchLabelSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_volume_type: { + value: cdktf.stringToHclTerraform(struct!.matchLabelVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachStorageSelectorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeAttachStorageSelectors | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchLabelCount !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelCount = this._matchLabelCount; + } + if (this._matchLabelMetadataCmkid !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataCmkid = this._matchLabelMetadataCmkid; + } + if (this._matchLabelMetadataEncrypted !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataEncrypted = this._matchLabelMetadataEncrypted; + } + if (this._matchLabelSize !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelSize = this._matchLabelSize; + } + if (this._matchLabelVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelVolumeType = this._matchLabelVolumeType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachStorageSelectors | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchLabelCount = undefined; + this._matchLabelMetadataCmkid = undefined; + this._matchLabelMetadataEncrypted = undefined; + this._matchLabelSize = undefined; + this._matchLabelVolumeType = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchLabelCount = value.matchLabelCount; + this._matchLabelMetadataCmkid = value.matchLabelMetadataCmkid; + this._matchLabelMetadataEncrypted = value.matchLabelMetadataEncrypted; + this._matchLabelSize = value.matchLabelSize; + this._matchLabelVolumeType = value.matchLabelVolumeType; + this._name = value.name; + this._type = value.type; + } + } + + // match_label_count - computed: false, optional: true, required: false + private _matchLabelCount?: string; + public get matchLabelCount() { + return this.getStringAttribute('match_label_count'); + } + public set matchLabelCount(value: string) { + this._matchLabelCount = value; + } + public resetMatchLabelCount() { + this._matchLabelCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelCountInput() { + return this._matchLabelCount; + } + + // match_label_metadata_cmkid - computed: false, optional: true, required: false + private _matchLabelMetadataCmkid?: string; + public get matchLabelMetadataCmkid() { + return this.getStringAttribute('match_label_metadata_cmkid'); + } + public set matchLabelMetadataCmkid(value: string) { + this._matchLabelMetadataCmkid = value; + } + public resetMatchLabelMetadataCmkid() { + this._matchLabelMetadataCmkid = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataCmkidInput() { + return this._matchLabelMetadataCmkid; + } + + // match_label_metadata_encrypted - computed: false, optional: true, required: false + private _matchLabelMetadataEncrypted?: string; + public get matchLabelMetadataEncrypted() { + return this.getStringAttribute('match_label_metadata_encrypted'); + } + public set matchLabelMetadataEncrypted(value: string) { + this._matchLabelMetadataEncrypted = value; + } + public resetMatchLabelMetadataEncrypted() { + this._matchLabelMetadataEncrypted = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataEncryptedInput() { + return this._matchLabelMetadataEncrypted; + } + + // match_label_size - computed: false, optional: true, required: false + private _matchLabelSize?: string; + public get matchLabelSize() { + return this.getStringAttribute('match_label_size'); + } + public set matchLabelSize(value: string) { + this._matchLabelSize = value; + } + public resetMatchLabelSize() { + this._matchLabelSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelSizeInput() { + return this._matchLabelSize; + } + + // match_label_volume_type - computed: false, optional: true, required: false + private _matchLabelVolumeType?: string; + public get matchLabelVolumeType() { + return this.getStringAttribute('match_label_volume_type'); + } + public set matchLabelVolumeType(value: string) { + this._matchLabelVolumeType = value; + } + public resetMatchLabelVolumeType() { + this._matchLabelVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelVolumeTypeInput() { + return this._matchLabelVolumeType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CceNodeAttachStorageSelectorsList extends cdktf.ComplexList { + public internalValue? : CceNodeAttachStorageSelectors[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeAttachStorageSelectorsOutputReference { + return new CceNodeAttachStorageSelectorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeAttachStorage { + /** + * groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#groups CceNodeAttach#groups} + */ + readonly groups: CceNodeAttachStorageGroups[] | cdktf.IResolvable; + /** + * selectors block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#selectors CceNodeAttach#selectors} + */ + readonly selectors: CceNodeAttachStorageSelectors[] | cdktf.IResolvable; +} + +export function cceNodeAttachStorageToTerraform(struct?: CceNodeAttachStorageOutputReference | CceNodeAttachStorage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + groups: cdktf.listMapper(cceNodeAttachStorageGroupsToTerraform, true)(struct!.groups), + selectors: cdktf.listMapper(cceNodeAttachStorageSelectorsToTerraform, true)(struct!.selectors), + } +} + + +export function cceNodeAttachStorageToHclTerraform(struct?: CceNodeAttachStorageOutputReference | CceNodeAttachStorage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + groups: { + value: cdktf.listMapperHcl(cceNodeAttachStorageGroupsToHclTerraform, true)(struct!.groups), + isBlock: true, + type: "list", + storageClassType: "CceNodeAttachStorageGroupsList", + }, + selectors: { + value: cdktf.listMapperHcl(cceNodeAttachStorageSelectorsToHclTerraform, true)(struct!.selectors), + isBlock: true, + type: "list", + storageClassType: "CceNodeAttachStorageSelectorsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachStorageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeAttachStorage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groups?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.groups = this._groups?.internalValue; + } + if (this._selectors?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.selectors = this._selectors?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachStorage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groups.internalValue = undefined; + this._selectors.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groups.internalValue = value.groups; + this._selectors.internalValue = value.selectors; + } + } + + // groups - computed: false, optional: false, required: true + private _groups = new CceNodeAttachStorageGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + public putGroups(value: CceNodeAttachStorageGroups[] | cdktf.IResolvable) { + this._groups.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get groupsInput() { + return this._groups.internalValue; + } + + // selectors - computed: false, optional: false, required: true + private _selectors = new CceNodeAttachStorageSelectorsList(this, "selectors", false); + public get selectors() { + return this._selectors; + } + public putSelectors(value: CceNodeAttachStorageSelectors[] | cdktf.IResolvable) { + this._selectors.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get selectorsInput() { + return this._selectors.internalValue; + } +} +export interface CceNodeAttachTaints { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#effect CceNodeAttach#effect} + */ + readonly effect: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#key CceNodeAttach#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#value CceNodeAttach#value} + */ + readonly value: string; +} + +export function cceNodeAttachTaintsToTerraform(struct?: CceNodeAttachTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + effect: cdktf.stringToTerraform(struct!.effect), + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cceNodeAttachTaintsToHclTerraform(struct?: CceNodeAttachTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + effect: { + value: cdktf.stringToHclTerraform(struct!.effect), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachTaintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeAttachTaints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._effect !== undefined) { + hasAnyValues = true; + internalValueResult.effect = this._effect; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachTaints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._effect = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._effect = value.effect; + this._key = value.key; + this._value = value.value; + } + } + + // effect - computed: false, optional: false, required: true + private _effect?: string; + public get effect() { + return this.getStringAttribute('effect'); + } + public set effect(value: string) { + this._effect = value; + } + // Temporarily expose input value. Use with caution. + public get effectInput() { + return this._effect; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CceNodeAttachTaintsList extends cdktf.ComplexList { + public internalValue? : CceNodeAttachTaints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeAttachTaintsOutputReference { + return new CceNodeAttachTaintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeAttachTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#create CceNodeAttach#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#delete CceNodeAttach#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#update CceNodeAttach#update} + */ + readonly update?: string; +} + +export function cceNodeAttachTimeoutsToTerraform(struct?: CceNodeAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cceNodeAttachTimeoutsToHclTerraform(struct?: CceNodeAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeAttachTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceNodeAttachTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeAttachTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach huaweicloud_cce_node_attach} +*/ +export class CceNodeAttach extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node_attach"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceNodeAttach resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceNodeAttach to import + * @param importFromId The id of the existing CceNodeAttach that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceNodeAttach to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node_attach", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_attach huaweicloud_cce_node_attach} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceNodeAttachConfig + */ + public constructor(scope: Construct, id: string, config: CceNodeAttachConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node_attach', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._dockerBaseSize = config.dockerBaseSize; + this._id = config.id; + this._imageId = config.imageId; + this._initializedConditions = config.initializedConditions; + this._keyPair = config.keyPair; + this._labels = config.labels; + this._lvmConfig = config.lvmConfig; + this._maxPods = config.maxPods; + this._name = config.name; + this._nicMultiQueue = config.nicMultiQueue; + this._nicThreshold = config.nicThreshold; + this._os = config.os; + this._password = config.password; + this._postinstall = config.postinstall; + this._preinstall = config.preinstall; + this._privateKey = config.privateKey; + this._region = config.region; + this._runtime = config.runtime; + this._serverId = config.serverId; + this._systemDiskKmsKeyId = config.systemDiskKmsKeyId; + this._tags = config.tags; + this._hostnameConfig.internalValue = config.hostnameConfig; + this._storage.internalValue = config.storage; + this._taints.internalValue = config.taints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // data_volumes - computed: true, optional: false, required: false + private _dataVolumes = new CceNodeAttachDataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + + // docker_base_size - computed: false, optional: true, required: false + private _dockerBaseSize?: number; + public get dockerBaseSize() { + return this.getNumberAttribute('docker_base_size'); + } + public set dockerBaseSize(value: number) { + this._dockerBaseSize = value; + } + public resetDockerBaseSize() { + this._dockerBaseSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerBaseSizeInput() { + return this._dockerBaseSize; + } + + // ecs_group_id - computed: true, optional: false, required: false + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // initialized_conditions - computed: true, optional: true, required: false + private _initializedConditions?: string[]; + public get initializedConditions() { + return this.getListAttribute('initialized_conditions'); + } + public set initializedConditions(value: string[]) { + this._initializedConditions = value; + } + public resetInitializedConditions() { + this._initializedConditions = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializedConditionsInput() { + return this._initializedConditions; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // lvm_config - computed: false, optional: true, required: false + private _lvmConfig?: string; + public get lvmConfig() { + return this.getStringAttribute('lvm_config'); + } + public set lvmConfig(value: string) { + this._lvmConfig = value; + } + public resetLvmConfig() { + this._lvmConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmConfigInput() { + return this._lvmConfig; + } + + // max_pods - computed: false, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nic_multi_queue - computed: false, optional: true, required: false + private _nicMultiQueue?: string; + public get nicMultiQueue() { + return this.getStringAttribute('nic_multi_queue'); + } + public set nicMultiQueue(value: string) { + this._nicMultiQueue = value; + } + public resetNicMultiQueue() { + this._nicMultiQueue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nicMultiQueueInput() { + return this._nicMultiQueue; + } + + // nic_threshold - computed: false, optional: true, required: false + private _nicThreshold?: string; + public get nicThreshold() { + return this.getStringAttribute('nic_threshold'); + } + public set nicThreshold(value: string) { + this._nicThreshold = value; + } + public resetNicThreshold() { + this._nicThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get nicThresholdInput() { + return this._nicThreshold; + } + + // os - computed: false, optional: false, required: true + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // root_volume - computed: true, optional: false, required: false + private _rootVolume = new CceNodeAttachRootVolumeList(this, "root_volume", false); + public get rootVolume() { + return this._rootVolume; + } + + // runtime - computed: true, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // server_id - computed: false, optional: false, required: true + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // system_disk_kms_key_id - computed: false, optional: true, required: false + private _systemDiskKmsKeyId?: string; + public get systemDiskKmsKeyId() { + return this.getStringAttribute('system_disk_kms_key_id'); + } + public set systemDiskKmsKeyId(value: string) { + this._systemDiskKmsKeyId = value; + } + public resetSystemDiskKmsKeyId() { + this._systemDiskKmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskKmsKeyIdInput() { + return this._systemDiskKmsKeyId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // hostname_config - computed: false, optional: true, required: false + private _hostnameConfig = new CceNodeAttachHostnameConfigOutputReference(this, "hostname_config"); + public get hostnameConfig() { + return this._hostnameConfig; + } + public putHostnameConfig(value: CceNodeAttachHostnameConfig) { + this._hostnameConfig.internalValue = value; + } + public resetHostnameConfig() { + this._hostnameConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostnameConfigInput() { + return this._hostnameConfig.internalValue; + } + + // storage - computed: false, optional: true, required: false + private _storage = new CceNodeAttachStorageOutputReference(this, "storage"); + public get storage() { + return this._storage; + } + public putStorage(value: CceNodeAttachStorage) { + this._storage.internalValue = value; + } + public resetStorage() { + this._storage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage.internalValue; + } + + // taints - computed: false, optional: true, required: false + private _taints = new CceNodeAttachTaintsList(this, "taints", false); + public get taints() { + return this._taints; + } + public putTaints(value: CceNodeAttachTaints[] | cdktf.IResolvable) { + this._taints.internalValue = value; + } + public resetTaints() { + this._taints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get taintsInput() { + return this._taints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceNodeAttachTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceNodeAttachTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + docker_base_size: cdktf.numberToTerraform(this._dockerBaseSize), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + initialized_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._initializedConditions), + key_pair: cdktf.stringToTerraform(this._keyPair), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + lvm_config: cdktf.stringToTerraform(this._lvmConfig), + max_pods: cdktf.numberToTerraform(this._maxPods), + name: cdktf.stringToTerraform(this._name), + nic_multi_queue: cdktf.stringToTerraform(this._nicMultiQueue), + nic_threshold: cdktf.stringToTerraform(this._nicThreshold), + os: cdktf.stringToTerraform(this._os), + password: cdktf.stringToTerraform(this._password), + postinstall: cdktf.stringToTerraform(this._postinstall), + preinstall: cdktf.stringToTerraform(this._preinstall), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + server_id: cdktf.stringToTerraform(this._serverId), + system_disk_kms_key_id: cdktf.stringToTerraform(this._systemDiskKmsKeyId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + hostname_config: cceNodeAttachHostnameConfigToTerraform(this._hostnameConfig.internalValue), + storage: cceNodeAttachStorageToTerraform(this._storage.internalValue), + taints: cdktf.listMapper(cceNodeAttachTaintsToTerraform, true)(this._taints.internalValue), + timeouts: cceNodeAttachTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + docker_base_size: { + value: cdktf.numberToHclTerraform(this._dockerBaseSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initialized_conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._initializedConditions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lvm_config: { + value: cdktf.stringToHclTerraform(this._lvmConfig), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_pods: { + value: cdktf.numberToHclTerraform(this._maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nic_multi_queue: { + value: cdktf.stringToHclTerraform(this._nicMultiQueue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nic_threshold: { + value: cdktf.stringToHclTerraform(this._nicThreshold), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + postinstall: { + value: cdktf.stringToHclTerraform(this._postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(this._preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_kms_key_id: { + value: cdktf.stringToHclTerraform(this._systemDiskKmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hostname_config: { + value: cceNodeAttachHostnameConfigToHclTerraform(this._hostnameConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeAttachHostnameConfigList", + }, + storage: { + value: cceNodeAttachStorageToHclTerraform(this._storage.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeAttachStorageList", + }, + taints: { + value: cdktf.listMapperHcl(cceNodeAttachTaintsToHclTerraform, true)(this._taints.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeAttachTaintsList", + }, + timeouts: { + value: cceNodeAttachTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceNodeAttachTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/README.md b/src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/README.md new file mode 100644 index 00000000..58132460 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_node_pool_nodes_add` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_node_pool_nodes_add`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add). diff --git a/src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/index.ts b/src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/index.ts new file mode 100644 index 00000000..5954613a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-pool-nodes-add/index.ts @@ -0,0 +1,486 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceNodePoolNodesAddConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#cluster_id CceNodePoolNodesAdd#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#enable_force_new CceNodePoolNodesAdd#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#id CceNodePoolNodesAdd#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#nodepool_id CceNodePoolNodesAdd#nodepool_id} + */ + readonly nodepoolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#region CceNodePoolNodesAdd#region} + */ + readonly region?: string; + /** + * node_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#node_list CceNodePoolNodesAdd#node_list} + */ + readonly nodeList: CceNodePoolNodesAddNodeListStruct[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#timeouts CceNodePoolNodesAdd#timeouts} + */ + readonly timeouts?: CceNodePoolNodesAddTimeouts; +} +export interface CceNodePoolNodesAddNodeListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#server_id CceNodePoolNodesAdd#server_id} + */ + readonly serverId: string; +} + +export function cceNodePoolNodesAddNodeListStructToTerraform(struct?: CceNodePoolNodesAddNodeListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + server_id: cdktf.stringToTerraform(struct!.serverId), + } +} + + +export function cceNodePoolNodesAddNodeListStructToHclTerraform(struct?: CceNodePoolNodesAddNodeListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + server_id: { + value: cdktf.stringToHclTerraform(struct!.serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolNodesAddNodeListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolNodesAddNodeListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._serverId !== undefined) { + hasAnyValues = true; + internalValueResult.serverId = this._serverId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolNodesAddNodeListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._serverId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._serverId = value.serverId; + } + } + + // server_id - computed: false, optional: false, required: true + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } +} + +export class CceNodePoolNodesAddNodeListStructList extends cdktf.ComplexList { + public internalValue? : CceNodePoolNodesAddNodeListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolNodesAddNodeListStructOutputReference { + return new CceNodePoolNodesAddNodeListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolNodesAddTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#create CceNodePoolNodesAdd#create} + */ + readonly create?: string; +} + +export function cceNodePoolNodesAddTimeoutsToTerraform(struct?: CceNodePoolNodesAddTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cceNodePoolNodesAddTimeoutsToHclTerraform(struct?: CceNodePoolNodesAddTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolNodesAddTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceNodePoolNodesAddTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolNodesAddTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add huaweicloud_cce_node_pool_nodes_add} +*/ +export class CceNodePoolNodesAdd extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node_pool_nodes_add"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceNodePoolNodesAdd resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceNodePoolNodesAdd to import + * @param importFromId The id of the existing CceNodePoolNodesAdd that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceNodePoolNodesAdd to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node_pool_nodes_add", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool_nodes_add huaweicloud_cce_node_pool_nodes_add} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceNodePoolNodesAddConfig + */ + public constructor(scope: Construct, id: string, config: CceNodePoolNodesAddConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node_pool_nodes_add', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._nodepoolId = config.nodepoolId; + this._region = config.region; + this._nodeList.internalValue = config.nodeList; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nodepool_id - computed: false, optional: false, required: true + private _nodepoolId?: string; + public get nodepoolId() { + return this.getStringAttribute('nodepool_id'); + } + public set nodepoolId(value: string) { + this._nodepoolId = value; + } + // Temporarily expose input value. Use with caution. + public get nodepoolIdInput() { + return this._nodepoolId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // node_list - computed: false, optional: false, required: true + private _nodeList = new CceNodePoolNodesAddNodeListStructList(this, "node_list", false); + public get nodeList() { + return this._nodeList; + } + public putNodeList(value: CceNodePoolNodesAddNodeListStruct[] | cdktf.IResolvable) { + this._nodeList.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nodeListInput() { + return this._nodeList.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceNodePoolNodesAddTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceNodePoolNodesAddTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + nodepool_id: cdktf.stringToTerraform(this._nodepoolId), + region: cdktf.stringToTerraform(this._region), + node_list: cdktf.listMapper(cceNodePoolNodesAddNodeListStructToTerraform, true)(this._nodeList.internalValue), + timeouts: cceNodePoolNodesAddTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nodepool_id: { + value: cdktf.stringToHclTerraform(this._nodepoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_list: { + value: cdktf.listMapperHcl(cceNodePoolNodesAddNodeListStructToHclTerraform, true)(this._nodeList.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolNodesAddNodeListStructList", + }, + timeouts: { + value: cceNodePoolNodesAddTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceNodePoolNodesAddTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-node-pool/README.md b/src/constructs/providers/huaweicloud/cce-node-pool/README.md new file mode 100644 index 00000000..09d202b3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-pool/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_node_pool` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_node_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool). diff --git a/src/constructs/providers/huaweicloud/cce-node-pool/index.ts b/src/constructs/providers/huaweicloud/cce-node-pool/index.ts new file mode 100644 index 00000000..bcd70de4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-pool/index.ts @@ -0,0 +1,4391 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceNodePoolConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#auto_renew CceNodePool#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#availability_zone CceNodePool#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#charging_mode CceNodePool#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#cluster_id CceNodePool#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#ecs_group_id CceNodePool#ecs_group_id} + */ + readonly ecsGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#enterprise_project_id CceNodePool#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Deprecated; This parameter has been replaced by the 'extend_params' parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extend_param CceNodePool#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#flavor_id CceNodePool#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#id CceNodePool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#initial_node_count CceNodePool#initial_node_count} + */ + readonly initialNodeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#initialized_conditions CceNodePool#initialized_conditions} + */ + readonly initializedConditions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#key_pair CceNodePool#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#label_policy_on_existing_nodes CceNodePool#label_policy_on_existing_nodes} + */ + readonly labelPolicyOnExistingNodes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#labels CceNodePool#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#max_node_count CceNodePool#max_node_count} + */ + readonly maxNodeCount?: number; + /** + * schema: Deprecated; This parameter can be configured in the 'extend_params' parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#max_pods CceNodePool#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#min_node_count CceNodePool#min_node_count} + */ + readonly minNodeCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#name CceNodePool#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#os CceNodePool#os} + */ + readonly os?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#password CceNodePool#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#period CceNodePool#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#period_unit CceNodePool#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#pod_security_groups CceNodePool#pod_security_groups} + */ + readonly podSecurityGroups?: string[]; + /** + * schema: Deprecated; This parameter can be configured in the 'extend_params' parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#postinstall CceNodePool#postinstall} + */ + readonly postinstall?: string; + /** + * schema: Deprecated; This parameter can be configured in the 'extend_params' parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#preinstall CceNodePool#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#priority CceNodePool#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#region CceNodePool#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#runtime CceNodePool#runtime} + */ + readonly runtime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#scale_down_cooldown_time CceNodePool#scale_down_cooldown_time} + */ + readonly scaleDownCooldownTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#scall_enable CceNodePool#scall_enable} + */ + readonly scallEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#security_groups CceNodePool#security_groups} + */ + readonly securityGroups?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#subnet_id CceNodePool#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#subnet_list CceNodePool#subnet_list} + */ + readonly subnetList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#tag_policy_on_existing_nodes CceNodePool#tag_policy_on_existing_nodes} + */ + readonly tagPolicyOnExistingNodes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#tags CceNodePool#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#taint_policy_on_existing_nodes CceNodePool#taint_policy_on_existing_nodes} + */ + readonly taintPolicyOnExistingNodes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#type CceNodePool#type} + */ + readonly type?: string; + /** + * data_volumes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#data_volumes CceNodePool#data_volumes} + */ + readonly dataVolumes?: CceNodePoolDataVolumes[] | cdktf.IResolvable; + /** + * extend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extend_params CceNodePool#extend_params} + */ + readonly extendParams?: CceNodePoolExtendParams; + /** + * extension_scale_groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extension_scale_groups CceNodePool#extension_scale_groups} + */ + readonly extensionScaleGroups?: CceNodePoolExtensionScaleGroups[] | cdktf.IResolvable; + /** + * hostname_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#hostname_config CceNodePool#hostname_config} + */ + readonly hostnameConfig?: CceNodePoolHostnameConfig; + /** + * root_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#root_volume CceNodePool#root_volume} + */ + readonly rootVolume: CceNodePoolRootVolume; + /** + * storage block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#storage CceNodePool#storage} + */ + readonly storage?: CceNodePoolStorage; + /** + * taints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#taints CceNodePool#taints} + */ + readonly taints?: CceNodePoolTaints[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#timeouts CceNodePool#timeouts} + */ + readonly timeouts?: CceNodePoolTimeouts; +} +export interface CceNodePoolDataVolumes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#dss_pool_id CceNodePool#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extend_param CceNodePool#extend_param} + */ + readonly extendParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extend_params CceNodePool#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#hw_passthrough CceNodePool#hw_passthrough} + */ + readonly hwPassthrough?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#kms_key_id CceNodePool#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#size CceNodePool#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#volumetype CceNodePool#volumetype} + */ + readonly volumetype: string; +} + +export function cceNodePoolDataVolumesToTerraform(struct?: CceNodePoolDataVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + extend_param: cdktf.stringToTerraform(struct!.extendParam), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParams), + hw_passthrough: cdktf.booleanToTerraform(struct!.hwPassthrough), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + volumetype: cdktf.stringToTerraform(struct!.volumetype), + } +} + + +export function cceNodePoolDataVolumesToHclTerraform(struct?: CceNodePoolDataVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.stringToHclTerraform(struct!.extendParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hw_passthrough: { + value: cdktf.booleanToHclTerraform(struct!.hwPassthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volumetype: { + value: cdktf.stringToHclTerraform(struct!.volumetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolDataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolDataVolumes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._extendParams !== undefined) { + hasAnyValues = true; + internalValueResult.extendParams = this._extendParams; + } + if (this._hwPassthrough !== undefined) { + hasAnyValues = true; + internalValueResult.hwPassthrough = this._hwPassthrough; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumetype !== undefined) { + hasAnyValues = true; + internalValueResult.volumetype = this._volumetype; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolDataVolumes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dssPoolId = undefined; + this._extendParam = undefined; + this._extendParams = undefined; + this._hwPassthrough = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._volumetype = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dssPoolId = value.dssPoolId; + this._extendParam = value.extendParam; + this._extendParams = value.extendParams; + this._hwPassthrough = value.hwPassthrough; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._volumetype = value.volumetype; + } + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: string; + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + public set extendParam(value: string) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // hw_passthrough - computed: false, optional: true, required: false + private _hwPassthrough?: boolean | cdktf.IResolvable; + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + public set hwPassthrough(value: boolean | cdktf.IResolvable) { + this._hwPassthrough = value; + } + public resetHwPassthrough() { + this._hwPassthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get hwPassthroughInput() { + return this._hwPassthrough; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volumetype - computed: false, optional: false, required: true + private _volumetype?: string; + public get volumetype() { + return this.getStringAttribute('volumetype'); + } + public set volumetype(value: string) { + this._volumetype = value; + } + // Temporarily expose input value. Use with caution. + public get volumetypeInput() { + return this._volumetype; + } +} + +export class CceNodePoolDataVolumesList extends cdktf.ComplexList { + public internalValue? : CceNodePoolDataVolumes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolDataVolumesOutputReference { + return new CceNodePoolDataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolExtendParams { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#agency_name CceNodePool#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#docker_base_size CceNodePool#docker_base_size} + */ + readonly dockerBaseSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#kube_reserved_mem CceNodePool#kube_reserved_mem} + */ + readonly kubeReservedMem?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#market_type CceNodePool#market_type} + */ + readonly marketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#max_pods CceNodePool#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#nic_threshold CceNodePool#nic_threshold} + */ + readonly nicThreshold?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#node_image_id CceNodePool#node_image_id} + */ + readonly nodeImageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#node_multi_queue CceNodePool#node_multi_queue} + */ + readonly nodeMultiQueue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#postinstall CceNodePool#postinstall} + */ + readonly postinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#preinstall CceNodePool#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#spot_price CceNodePool#spot_price} + */ + readonly spotPrice?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#system_reserved_mem CceNodePool#system_reserved_mem} + */ + readonly systemReservedMem?: number; +} + +export function cceNodePoolExtendParamsToTerraform(struct?: CceNodePoolExtendParamsOutputReference | CceNodePoolExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency_name: cdktf.stringToTerraform(struct!.agencyName), + docker_base_size: cdktf.numberToTerraform(struct!.dockerBaseSize), + kube_reserved_mem: cdktf.numberToTerraform(struct!.kubeReservedMem), + market_type: cdktf.stringToTerraform(struct!.marketType), + max_pods: cdktf.numberToTerraform(struct!.maxPods), + nic_threshold: cdktf.stringToTerraform(struct!.nicThreshold), + node_image_id: cdktf.stringToTerraform(struct!.nodeImageId), + node_multi_queue: cdktf.stringToTerraform(struct!.nodeMultiQueue), + postinstall: cdktf.stringToTerraform(struct!.postinstall), + preinstall: cdktf.stringToTerraform(struct!.preinstall), + spot_price: cdktf.stringToTerraform(struct!.spotPrice), + system_reserved_mem: cdktf.numberToTerraform(struct!.systemReservedMem), + } +} + + +export function cceNodePoolExtendParamsToHclTerraform(struct?: CceNodePoolExtendParamsOutputReference | CceNodePoolExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(struct!.agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + docker_base_size: { + value: cdktf.numberToHclTerraform(struct!.dockerBaseSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kube_reserved_mem: { + value: cdktf.numberToHclTerraform(struct!.kubeReservedMem), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + market_type: { + value: cdktf.stringToHclTerraform(struct!.marketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_pods: { + value: cdktf.numberToHclTerraform(struct!.maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + nic_threshold: { + value: cdktf.stringToHclTerraform(struct!.nicThreshold), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_image_id: { + value: cdktf.stringToHclTerraform(struct!.nodeImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_multi_queue: { + value: cdktf.stringToHclTerraform(struct!.nodeMultiQueue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + postinstall: { + value: cdktf.stringToHclTerraform(struct!.postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(struct!.preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spot_price: { + value: cdktf.stringToHclTerraform(struct!.spotPrice), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_reserved_mem: { + value: cdktf.numberToHclTerraform(struct!.systemReservedMem), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolExtendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolExtendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agencyName !== undefined) { + hasAnyValues = true; + internalValueResult.agencyName = this._agencyName; + } + if (this._dockerBaseSize !== undefined) { + hasAnyValues = true; + internalValueResult.dockerBaseSize = this._dockerBaseSize; + } + if (this._kubeReservedMem !== undefined) { + hasAnyValues = true; + internalValueResult.kubeReservedMem = this._kubeReservedMem; + } + if (this._marketType !== undefined) { + hasAnyValues = true; + internalValueResult.marketType = this._marketType; + } + if (this._maxPods !== undefined) { + hasAnyValues = true; + internalValueResult.maxPods = this._maxPods; + } + if (this._nicThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.nicThreshold = this._nicThreshold; + } + if (this._nodeImageId !== undefined) { + hasAnyValues = true; + internalValueResult.nodeImageId = this._nodeImageId; + } + if (this._nodeMultiQueue !== undefined) { + hasAnyValues = true; + internalValueResult.nodeMultiQueue = this._nodeMultiQueue; + } + if (this._postinstall !== undefined) { + hasAnyValues = true; + internalValueResult.postinstall = this._postinstall; + } + if (this._preinstall !== undefined) { + hasAnyValues = true; + internalValueResult.preinstall = this._preinstall; + } + if (this._spotPrice !== undefined) { + hasAnyValues = true; + internalValueResult.spotPrice = this._spotPrice; + } + if (this._systemReservedMem !== undefined) { + hasAnyValues = true; + internalValueResult.systemReservedMem = this._systemReservedMem; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolExtendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._agencyName = undefined; + this._dockerBaseSize = undefined; + this._kubeReservedMem = undefined; + this._marketType = undefined; + this._maxPods = undefined; + this._nicThreshold = undefined; + this._nodeImageId = undefined; + this._nodeMultiQueue = undefined; + this._postinstall = undefined; + this._preinstall = undefined; + this._spotPrice = undefined; + this._systemReservedMem = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._agencyName = value.agencyName; + this._dockerBaseSize = value.dockerBaseSize; + this._kubeReservedMem = value.kubeReservedMem; + this._marketType = value.marketType; + this._maxPods = value.maxPods; + this._nicThreshold = value.nicThreshold; + this._nodeImageId = value.nodeImageId; + this._nodeMultiQueue = value.nodeMultiQueue; + this._postinstall = value.postinstall; + this._preinstall = value.preinstall; + this._spotPrice = value.spotPrice; + this._systemReservedMem = value.systemReservedMem; + } + } + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // docker_base_size - computed: false, optional: true, required: false + private _dockerBaseSize?: number; + public get dockerBaseSize() { + return this.getNumberAttribute('docker_base_size'); + } + public set dockerBaseSize(value: number) { + this._dockerBaseSize = value; + } + public resetDockerBaseSize() { + this._dockerBaseSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerBaseSizeInput() { + return this._dockerBaseSize; + } + + // kube_reserved_mem - computed: false, optional: true, required: false + private _kubeReservedMem?: number; + public get kubeReservedMem() { + return this.getNumberAttribute('kube_reserved_mem'); + } + public set kubeReservedMem(value: number) { + this._kubeReservedMem = value; + } + public resetKubeReservedMem() { + this._kubeReservedMem = undefined; + } + // Temporarily expose input value. Use with caution. + public get kubeReservedMemInput() { + return this._kubeReservedMem; + } + + // market_type - computed: false, optional: true, required: false + private _marketType?: string; + public get marketType() { + return this.getStringAttribute('market_type'); + } + public set marketType(value: string) { + this._marketType = value; + } + public resetMarketType() { + this._marketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get marketTypeInput() { + return this._marketType; + } + + // max_pods - computed: false, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // nic_threshold - computed: false, optional: true, required: false + private _nicThreshold?: string; + public get nicThreshold() { + return this.getStringAttribute('nic_threshold'); + } + public set nicThreshold(value: string) { + this._nicThreshold = value; + } + public resetNicThreshold() { + this._nicThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get nicThresholdInput() { + return this._nicThreshold; + } + + // node_image_id - computed: false, optional: true, required: false + private _nodeImageId?: string; + public get nodeImageId() { + return this.getStringAttribute('node_image_id'); + } + public set nodeImageId(value: string) { + this._nodeImageId = value; + } + public resetNodeImageId() { + this._nodeImageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeImageIdInput() { + return this._nodeImageId; + } + + // node_multi_queue - computed: false, optional: true, required: false + private _nodeMultiQueue?: string; + public get nodeMultiQueue() { + return this.getStringAttribute('node_multi_queue'); + } + public set nodeMultiQueue(value: string) { + this._nodeMultiQueue = value; + } + public resetNodeMultiQueue() { + this._nodeMultiQueue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeMultiQueueInput() { + return this._nodeMultiQueue; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // spot_price - computed: false, optional: true, required: false + private _spotPrice?: string; + public get spotPrice() { + return this.getStringAttribute('spot_price'); + } + public set spotPrice(value: string) { + this._spotPrice = value; + } + public resetSpotPrice() { + this._spotPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotPriceInput() { + return this._spotPrice; + } + + // system_reserved_mem - computed: false, optional: true, required: false + private _systemReservedMem?: number; + public get systemReservedMem() { + return this.getNumberAttribute('system_reserved_mem'); + } + public set systemReservedMem(value: number) { + this._systemReservedMem = value; + } + public resetSystemReservedMem() { + this._systemReservedMem = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemReservedMemInput() { + return this._systemReservedMem; + } +} +export interface CceNodePoolExtensionScaleGroupsMetadata { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#name CceNodePool#name} + */ + readonly name?: string; +} + +export function cceNodePoolExtensionScaleGroupsMetadataToTerraform(struct?: CceNodePoolExtensionScaleGroupsMetadataOutputReference | CceNodePoolExtensionScaleGroupsMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function cceNodePoolExtensionScaleGroupsMetadataToHclTerraform(struct?: CceNodePoolExtensionScaleGroupsMetadataOutputReference | CceNodePoolExtensionScaleGroupsMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolExtensionScaleGroupsMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolExtensionScaleGroupsMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolExtensionScaleGroupsMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._name = value.name; + } + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} +export interface CceNodePoolExtensionScaleGroupsSpecAutoscaling { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#enable CceNodePool#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extension_priority CceNodePool#extension_priority} + */ + readonly extensionPriority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#max_node_count CceNodePool#max_node_count} + */ + readonly maxNodeCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#min_node_count CceNodePool#min_node_count} + */ + readonly minNodeCount?: number; +} + +export function cceNodePoolExtensionScaleGroupsSpecAutoscalingToTerraform(struct?: CceNodePoolExtensionScaleGroupsSpecAutoscalingOutputReference | CceNodePoolExtensionScaleGroupsSpecAutoscaling): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable: cdktf.booleanToTerraform(struct!.enable), + extension_priority: cdktf.numberToTerraform(struct!.extensionPriority), + max_node_count: cdktf.numberToTerraform(struct!.maxNodeCount), + min_node_count: cdktf.numberToTerraform(struct!.minNodeCount), + } +} + + +export function cceNodePoolExtensionScaleGroupsSpecAutoscalingToHclTerraform(struct?: CceNodePoolExtensionScaleGroupsSpecAutoscalingOutputReference | CceNodePoolExtensionScaleGroupsSpecAutoscaling): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + extension_priority: { + value: cdktf.numberToHclTerraform(struct!.extensionPriority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_node_count: { + value: cdktf.numberToHclTerraform(struct!.maxNodeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_node_count: { + value: cdktf.numberToHclTerraform(struct!.minNodeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolExtensionScaleGroupsSpecAutoscalingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolExtensionScaleGroupsSpecAutoscaling | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + if (this._extensionPriority !== undefined) { + hasAnyValues = true; + internalValueResult.extensionPriority = this._extensionPriority; + } + if (this._maxNodeCount !== undefined) { + hasAnyValues = true; + internalValueResult.maxNodeCount = this._maxNodeCount; + } + if (this._minNodeCount !== undefined) { + hasAnyValues = true; + internalValueResult.minNodeCount = this._minNodeCount; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolExtensionScaleGroupsSpecAutoscaling | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enable = undefined; + this._extensionPriority = undefined; + this._maxNodeCount = undefined; + this._minNodeCount = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enable = value.enable; + this._extensionPriority = value.extensionPriority; + this._maxNodeCount = value.maxNodeCount; + this._minNodeCount = value.minNodeCount; + } + } + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // extension_priority - computed: false, optional: true, required: false + private _extensionPriority?: number; + public get extensionPriority() { + return this.getNumberAttribute('extension_priority'); + } + public set extensionPriority(value: number) { + this._extensionPriority = value; + } + public resetExtensionPriority() { + this._extensionPriority = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionPriorityInput() { + return this._extensionPriority; + } + + // max_node_count - computed: false, optional: true, required: false + private _maxNodeCount?: number; + public get maxNodeCount() { + return this.getNumberAttribute('max_node_count'); + } + public set maxNodeCount(value: number) { + this._maxNodeCount = value; + } + public resetMaxNodeCount() { + this._maxNodeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxNodeCountInput() { + return this._maxNodeCount; + } + + // min_node_count - computed: false, optional: true, required: false + private _minNodeCount?: number; + public get minNodeCount() { + return this.getNumberAttribute('min_node_count'); + } + public set minNodeCount(value: number) { + this._minNodeCount = value; + } + public resetMinNodeCount() { + this._minNodeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get minNodeCountInput() { + return this._minNodeCount; + } +} +export interface CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#id CceNodePool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#preference CceNodePool#preference} + */ + readonly preference?: string; +} + +export function cceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationToTerraform(struct?: CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationOutputReference | CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + preference: cdktf.stringToTerraform(struct!.preference), + } +} + + +export function cceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationToHclTerraform(struct?: CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationOutputReference | CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preference: { + value: cdktf.stringToHclTerraform(struct!.preference), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._preference !== undefined) { + hasAnyValues = true; + internalValueResult.preference = this._preference; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._id = undefined; + this._preference = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._id = value.id; + this._preference = value.preference; + } + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // preference - computed: false, optional: true, required: false + private _preference?: string; + public get preference() { + return this.getStringAttribute('preference'); + } + public set preference(value: string) { + this._preference = value; + } + public resetPreference() { + this._preference = undefined; + } + // Temporarily expose input value. Use with caution. + public get preferenceInput() { + return this._preference; + } +} +export interface CceNodePoolExtensionScaleGroupsSpec { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#az CceNodePool#az} + */ + readonly az?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#flavor CceNodePool#flavor} + */ + readonly flavor?: string; + /** + * autoscaling block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#autoscaling CceNodePool#autoscaling} + */ + readonly autoscaling?: CceNodePoolExtensionScaleGroupsSpecAutoscaling; + /** + * capacity_reservation_specification block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#capacity_reservation_specification CceNodePool#capacity_reservation_specification} + */ + readonly capacityReservationSpecification?: CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification; +} + +export function cceNodePoolExtensionScaleGroupsSpecToTerraform(struct?: CceNodePoolExtensionScaleGroupsSpecOutputReference | CceNodePoolExtensionScaleGroupsSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + az: cdktf.stringToTerraform(struct!.az), + flavor: cdktf.stringToTerraform(struct!.flavor), + autoscaling: cceNodePoolExtensionScaleGroupsSpecAutoscalingToTerraform(struct!.autoscaling), + capacity_reservation_specification: cceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationToTerraform(struct!.capacityReservationSpecification), + } +} + + +export function cceNodePoolExtensionScaleGroupsSpecToHclTerraform(struct?: CceNodePoolExtensionScaleGroupsSpecOutputReference | CceNodePoolExtensionScaleGroupsSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + az: { + value: cdktf.stringToHclTerraform(struct!.az), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + autoscaling: { + value: cceNodePoolExtensionScaleGroupsSpecAutoscalingToHclTerraform(struct!.autoscaling), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolExtensionScaleGroupsSpecAutoscalingList", + }, + capacity_reservation_specification: { + value: cceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationToHclTerraform(struct!.capacityReservationSpecification), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolExtensionScaleGroupsSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolExtensionScaleGroupsSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._az !== undefined) { + hasAnyValues = true; + internalValueResult.az = this._az; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._autoscaling?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.autoscaling = this._autoscaling?.internalValue; + } + if (this._capacityReservationSpecification?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.capacityReservationSpecification = this._capacityReservationSpecification?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolExtensionScaleGroupsSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._az = undefined; + this._flavor = undefined; + this._autoscaling.internalValue = undefined; + this._capacityReservationSpecification.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._az = value.az; + this._flavor = value.flavor; + this._autoscaling.internalValue = value.autoscaling; + this._capacityReservationSpecification.internalValue = value.capacityReservationSpecification; + } + } + + // az - computed: false, optional: true, required: false + private _az?: string; + public get az() { + return this.getStringAttribute('az'); + } + public set az(value: string) { + this._az = value; + } + public resetAz() { + this._az = undefined; + } + // Temporarily expose input value. Use with caution. + public get azInput() { + return this._az; + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // autoscaling - computed: false, optional: true, required: false + private _autoscaling = new CceNodePoolExtensionScaleGroupsSpecAutoscalingOutputReference(this, "autoscaling"); + public get autoscaling() { + return this._autoscaling; + } + public putAutoscaling(value: CceNodePoolExtensionScaleGroupsSpecAutoscaling) { + this._autoscaling.internalValue = value; + } + public resetAutoscaling() { + this._autoscaling.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoscalingInput() { + return this._autoscaling.internalValue; + } + + // capacity_reservation_specification - computed: false, optional: true, required: false + private _capacityReservationSpecification = new CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecificationOutputReference(this, "capacity_reservation_specification"); + public get capacityReservationSpecification() { + return this._capacityReservationSpecification; + } + public putCapacityReservationSpecification(value: CceNodePoolExtensionScaleGroupsSpecCapacityReservationSpecification) { + this._capacityReservationSpecification.internalValue = value; + } + public resetCapacityReservationSpecification() { + this._capacityReservationSpecification.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get capacityReservationSpecificationInput() { + return this._capacityReservationSpecification.internalValue; + } +} +export interface CceNodePoolExtensionScaleGroups { + /** + * metadata block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#metadata CceNodePool#metadata} + */ + readonly metadata?: CceNodePoolExtensionScaleGroupsMetadata; + /** + * spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#spec CceNodePool#spec} + */ + readonly spec?: CceNodePoolExtensionScaleGroupsSpec; +} + +export function cceNodePoolExtensionScaleGroupsToTerraform(struct?: CceNodePoolExtensionScaleGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + metadata: cceNodePoolExtensionScaleGroupsMetadataToTerraform(struct!.metadata), + spec: cceNodePoolExtensionScaleGroupsSpecToTerraform(struct!.spec), + } +} + + +export function cceNodePoolExtensionScaleGroupsToHclTerraform(struct?: CceNodePoolExtensionScaleGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + metadata: { + value: cceNodePoolExtensionScaleGroupsMetadataToHclTerraform(struct!.metadata), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolExtensionScaleGroupsMetadataList", + }, + spec: { + value: cceNodePoolExtensionScaleGroupsSpecToHclTerraform(struct!.spec), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolExtensionScaleGroupsSpecList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolExtensionScaleGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolExtensionScaleGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._metadata?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.metadata = this._metadata?.internalValue; + } + if (this._spec?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.spec = this._spec?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolExtensionScaleGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._metadata.internalValue = undefined; + this._spec.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._metadata.internalValue = value.metadata; + this._spec.internalValue = value.spec; + } + } + + // metadata - computed: false, optional: true, required: false + private _metadata = new CceNodePoolExtensionScaleGroupsMetadataOutputReference(this, "metadata"); + public get metadata() { + return this._metadata; + } + public putMetadata(value: CceNodePoolExtensionScaleGroupsMetadata) { + this._metadata.internalValue = value; + } + public resetMetadata() { + this._metadata.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata.internalValue; + } + + // spec - computed: false, optional: true, required: false + private _spec = new CceNodePoolExtensionScaleGroupsSpecOutputReference(this, "spec"); + public get spec() { + return this._spec; + } + public putSpec(value: CceNodePoolExtensionScaleGroupsSpec) { + this._spec.internalValue = value; + } + public resetSpec() { + this._spec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec.internalValue; + } +} + +export class CceNodePoolExtensionScaleGroupsList extends cdktf.ComplexList { + public internalValue? : CceNodePoolExtensionScaleGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolExtensionScaleGroupsOutputReference { + return new CceNodePoolExtensionScaleGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolHostnameConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#type CceNodePool#type} + */ + readonly type: string; +} + +export function cceNodePoolHostnameConfigToTerraform(struct?: CceNodePoolHostnameConfigOutputReference | CceNodePoolHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodePoolHostnameConfigToHclTerraform(struct?: CceNodePoolHostnameConfigOutputReference | CceNodePoolHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolHostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolHostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolHostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CceNodePoolRootVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#dss_pool_id CceNodePool#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extend_param CceNodePool#extend_param} + */ + readonly extendParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#extend_params CceNodePool#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#hw_passthrough CceNodePool#hw_passthrough} + */ + readonly hwPassthrough?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#kms_key_id CceNodePool#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#size CceNodePool#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#volumetype CceNodePool#volumetype} + */ + readonly volumetype: string; +} + +export function cceNodePoolRootVolumeToTerraform(struct?: CceNodePoolRootVolumeOutputReference | CceNodePoolRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + extend_param: cdktf.stringToTerraform(struct!.extendParam), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParams), + hw_passthrough: cdktf.booleanToTerraform(struct!.hwPassthrough), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + volumetype: cdktf.stringToTerraform(struct!.volumetype), + } +} + + +export function cceNodePoolRootVolumeToHclTerraform(struct?: CceNodePoolRootVolumeOutputReference | CceNodePoolRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.stringToHclTerraform(struct!.extendParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hw_passthrough: { + value: cdktf.booleanToHclTerraform(struct!.hwPassthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volumetype: { + value: cdktf.stringToHclTerraform(struct!.volumetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._extendParams !== undefined) { + hasAnyValues = true; + internalValueResult.extendParams = this._extendParams; + } + if (this._hwPassthrough !== undefined) { + hasAnyValues = true; + internalValueResult.hwPassthrough = this._hwPassthrough; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumetype !== undefined) { + hasAnyValues = true; + internalValueResult.volumetype = this._volumetype; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dssPoolId = undefined; + this._extendParam = undefined; + this._extendParams = undefined; + this._hwPassthrough = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._volumetype = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dssPoolId = value.dssPoolId; + this._extendParam = value.extendParam; + this._extendParams = value.extendParams; + this._hwPassthrough = value.hwPassthrough; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._volumetype = value.volumetype; + } + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: string; + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + public set extendParam(value: string) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // hw_passthrough - computed: false, optional: true, required: false + private _hwPassthrough?: boolean | cdktf.IResolvable; + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + public set hwPassthrough(value: boolean | cdktf.IResolvable) { + this._hwPassthrough = value; + } + public resetHwPassthrough() { + this._hwPassthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get hwPassthroughInput() { + return this._hwPassthrough; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volumetype - computed: false, optional: false, required: true + private _volumetype?: string; + public get volumetype() { + return this.getStringAttribute('volumetype'); + } + public set volumetype(value: string) { + this._volumetype = value; + } + // Temporarily expose input value. Use with caution. + public get volumetypeInput() { + return this._volumetype; + } +} +export interface CceNodePoolStorageGroupsVirtualSpaces { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#lvm_lv_type CceNodePool#lvm_lv_type} + */ + readonly lvmLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#lvm_path CceNodePool#lvm_path} + */ + readonly lvmPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#name CceNodePool#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#runtime_lv_type CceNodePool#runtime_lv_type} + */ + readonly runtimeLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#size CceNodePool#size} + */ + readonly size: string; +} + +export function cceNodePoolStorageGroupsVirtualSpacesToTerraform(struct?: CceNodePoolStorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + lvm_lv_type: cdktf.stringToTerraform(struct!.lvmLvType), + lvm_path: cdktf.stringToTerraform(struct!.lvmPath), + name: cdktf.stringToTerraform(struct!.name), + runtime_lv_type: cdktf.stringToTerraform(struct!.runtimeLvType), + size: cdktf.stringToTerraform(struct!.size), + } +} + + +export function cceNodePoolStorageGroupsVirtualSpacesToHclTerraform(struct?: CceNodePoolStorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + lvm_lv_type: { + value: cdktf.stringToHclTerraform(struct!.lvmLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lvm_path: { + value: cdktf.stringToHclTerraform(struct!.lvmPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_lv_type: { + value: cdktf.stringToHclTerraform(struct!.runtimeLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.stringToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolStorageGroupsVirtualSpacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolStorageGroupsVirtualSpaces | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._lvmLvType !== undefined) { + hasAnyValues = true; + internalValueResult.lvmLvType = this._lvmLvType; + } + if (this._lvmPath !== undefined) { + hasAnyValues = true; + internalValueResult.lvmPath = this._lvmPath; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._runtimeLvType !== undefined) { + hasAnyValues = true; + internalValueResult.runtimeLvType = this._runtimeLvType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolStorageGroupsVirtualSpaces | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._lvmLvType = undefined; + this._lvmPath = undefined; + this._name = undefined; + this._runtimeLvType = undefined; + this._size = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._lvmLvType = value.lvmLvType; + this._lvmPath = value.lvmPath; + this._name = value.name; + this._runtimeLvType = value.runtimeLvType; + this._size = value.size; + } + } + + // lvm_lv_type - computed: false, optional: true, required: false + private _lvmLvType?: string; + public get lvmLvType() { + return this.getStringAttribute('lvm_lv_type'); + } + public set lvmLvType(value: string) { + this._lvmLvType = value; + } + public resetLvmLvType() { + this._lvmLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmLvTypeInput() { + return this._lvmLvType; + } + + // lvm_path - computed: false, optional: true, required: false + private _lvmPath?: string; + public get lvmPath() { + return this.getStringAttribute('lvm_path'); + } + public set lvmPath(value: string) { + this._lvmPath = value; + } + public resetLvmPath() { + this._lvmPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmPathInput() { + return this._lvmPath; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // runtime_lv_type - computed: false, optional: true, required: false + private _runtimeLvType?: string; + public get runtimeLvType() { + return this.getStringAttribute('runtime_lv_type'); + } + public set runtimeLvType(value: string) { + this._runtimeLvType = value; + } + public resetRuntimeLvType() { + this._runtimeLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeLvTypeInput() { + return this._runtimeLvType; + } + + // size - computed: false, optional: false, required: true + private _size?: string; + public get size() { + return this.getStringAttribute('size'); + } + public set size(value: string) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} + +export class CceNodePoolStorageGroupsVirtualSpacesList extends cdktf.ComplexList { + public internalValue? : CceNodePoolStorageGroupsVirtualSpaces[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolStorageGroupsVirtualSpacesOutputReference { + return new CceNodePoolStorageGroupsVirtualSpacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolStorageGroups { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#cce_managed CceNodePool#cce_managed} + */ + readonly cceManaged?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#name CceNodePool#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#selector_names CceNodePool#selector_names} + */ + readonly selectorNames: string[]; + /** + * virtual_spaces block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#virtual_spaces CceNodePool#virtual_spaces} + */ + readonly virtualSpaces: CceNodePoolStorageGroupsVirtualSpaces[] | cdktf.IResolvable; +} + +export function cceNodePoolStorageGroupsToTerraform(struct?: CceNodePoolStorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cce_managed: cdktf.booleanToTerraform(struct!.cceManaged), + name: cdktf.stringToTerraform(struct!.name), + selector_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.selectorNames), + virtual_spaces: cdktf.listMapper(cceNodePoolStorageGroupsVirtualSpacesToTerraform, true)(struct!.virtualSpaces), + } +} + + +export function cceNodePoolStorageGroupsToHclTerraform(struct?: CceNodePoolStorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cce_managed: { + value: cdktf.booleanToHclTerraform(struct!.cceManaged), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + selector_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.selectorNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + virtual_spaces: { + value: cdktf.listMapperHcl(cceNodePoolStorageGroupsVirtualSpacesToHclTerraform, true)(struct!.virtualSpaces), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolStorageGroupsVirtualSpacesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolStorageGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolStorageGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cceManaged !== undefined) { + hasAnyValues = true; + internalValueResult.cceManaged = this._cceManaged; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._selectorNames !== undefined) { + hasAnyValues = true; + internalValueResult.selectorNames = this._selectorNames; + } + if (this._virtualSpaces?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.virtualSpaces = this._virtualSpaces?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolStorageGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cceManaged = undefined; + this._name = undefined; + this._selectorNames = undefined; + this._virtualSpaces.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cceManaged = value.cceManaged; + this._name = value.name; + this._selectorNames = value.selectorNames; + this._virtualSpaces.internalValue = value.virtualSpaces; + } + } + + // cce_managed - computed: false, optional: true, required: false + private _cceManaged?: boolean | cdktf.IResolvable; + public get cceManaged() { + return this.getBooleanAttribute('cce_managed'); + } + public set cceManaged(value: boolean | cdktf.IResolvable) { + this._cceManaged = value; + } + public resetCceManaged() { + this._cceManaged = undefined; + } + // Temporarily expose input value. Use with caution. + public get cceManagedInput() { + return this._cceManaged; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // selector_names - computed: false, optional: false, required: true + private _selectorNames?: string[]; + public get selectorNames() { + return this.getListAttribute('selector_names'); + } + public set selectorNames(value: string[]) { + this._selectorNames = value; + } + // Temporarily expose input value. Use with caution. + public get selectorNamesInput() { + return this._selectorNames; + } + + // virtual_spaces - computed: false, optional: false, required: true + private _virtualSpaces = new CceNodePoolStorageGroupsVirtualSpacesList(this, "virtual_spaces", false); + public get virtualSpaces() { + return this._virtualSpaces; + } + public putVirtualSpaces(value: CceNodePoolStorageGroupsVirtualSpaces[] | cdktf.IResolvable) { + this._virtualSpaces.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get virtualSpacesInput() { + return this._virtualSpaces.internalValue; + } +} + +export class CceNodePoolStorageGroupsList extends cdktf.ComplexList { + public internalValue? : CceNodePoolStorageGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolStorageGroupsOutputReference { + return new CceNodePoolStorageGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolStorageSelectors { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#match_label_count CceNodePool#match_label_count} + */ + readonly matchLabelCount?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#match_label_metadata_cmkid CceNodePool#match_label_metadata_cmkid} + */ + readonly matchLabelMetadataCmkid?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#match_label_metadata_encrypted CceNodePool#match_label_metadata_encrypted} + */ + readonly matchLabelMetadataEncrypted?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#match_label_size CceNodePool#match_label_size} + */ + readonly matchLabelSize?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#match_label_volume_type CceNodePool#match_label_volume_type} + */ + readonly matchLabelVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#name CceNodePool#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#type CceNodePool#type} + */ + readonly type?: string; +} + +export function cceNodePoolStorageSelectorsToTerraform(struct?: CceNodePoolStorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_label_count: cdktf.stringToTerraform(struct!.matchLabelCount), + match_label_metadata_cmkid: cdktf.stringToTerraform(struct!.matchLabelMetadataCmkid), + match_label_metadata_encrypted: cdktf.stringToTerraform(struct!.matchLabelMetadataEncrypted), + match_label_size: cdktf.stringToTerraform(struct!.matchLabelSize), + match_label_volume_type: cdktf.stringToTerraform(struct!.matchLabelVolumeType), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodePoolStorageSelectorsToHclTerraform(struct?: CceNodePoolStorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_label_count: { + value: cdktf.stringToHclTerraform(struct!.matchLabelCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_cmkid: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataCmkid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_encrypted: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataEncrypted), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_size: { + value: cdktf.stringToHclTerraform(struct!.matchLabelSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_volume_type: { + value: cdktf.stringToHclTerraform(struct!.matchLabelVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolStorageSelectorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolStorageSelectors | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchLabelCount !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelCount = this._matchLabelCount; + } + if (this._matchLabelMetadataCmkid !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataCmkid = this._matchLabelMetadataCmkid; + } + if (this._matchLabelMetadataEncrypted !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataEncrypted = this._matchLabelMetadataEncrypted; + } + if (this._matchLabelSize !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelSize = this._matchLabelSize; + } + if (this._matchLabelVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelVolumeType = this._matchLabelVolumeType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolStorageSelectors | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchLabelCount = undefined; + this._matchLabelMetadataCmkid = undefined; + this._matchLabelMetadataEncrypted = undefined; + this._matchLabelSize = undefined; + this._matchLabelVolumeType = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchLabelCount = value.matchLabelCount; + this._matchLabelMetadataCmkid = value.matchLabelMetadataCmkid; + this._matchLabelMetadataEncrypted = value.matchLabelMetadataEncrypted; + this._matchLabelSize = value.matchLabelSize; + this._matchLabelVolumeType = value.matchLabelVolumeType; + this._name = value.name; + this._type = value.type; + } + } + + // match_label_count - computed: false, optional: true, required: false + private _matchLabelCount?: string; + public get matchLabelCount() { + return this.getStringAttribute('match_label_count'); + } + public set matchLabelCount(value: string) { + this._matchLabelCount = value; + } + public resetMatchLabelCount() { + this._matchLabelCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelCountInput() { + return this._matchLabelCount; + } + + // match_label_metadata_cmkid - computed: false, optional: true, required: false + private _matchLabelMetadataCmkid?: string; + public get matchLabelMetadataCmkid() { + return this.getStringAttribute('match_label_metadata_cmkid'); + } + public set matchLabelMetadataCmkid(value: string) { + this._matchLabelMetadataCmkid = value; + } + public resetMatchLabelMetadataCmkid() { + this._matchLabelMetadataCmkid = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataCmkidInput() { + return this._matchLabelMetadataCmkid; + } + + // match_label_metadata_encrypted - computed: false, optional: true, required: false + private _matchLabelMetadataEncrypted?: string; + public get matchLabelMetadataEncrypted() { + return this.getStringAttribute('match_label_metadata_encrypted'); + } + public set matchLabelMetadataEncrypted(value: string) { + this._matchLabelMetadataEncrypted = value; + } + public resetMatchLabelMetadataEncrypted() { + this._matchLabelMetadataEncrypted = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataEncryptedInput() { + return this._matchLabelMetadataEncrypted; + } + + // match_label_size - computed: false, optional: true, required: false + private _matchLabelSize?: string; + public get matchLabelSize() { + return this.getStringAttribute('match_label_size'); + } + public set matchLabelSize(value: string) { + this._matchLabelSize = value; + } + public resetMatchLabelSize() { + this._matchLabelSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelSizeInput() { + return this._matchLabelSize; + } + + // match_label_volume_type - computed: false, optional: true, required: false + private _matchLabelVolumeType?: string; + public get matchLabelVolumeType() { + return this.getStringAttribute('match_label_volume_type'); + } + public set matchLabelVolumeType(value: string) { + this._matchLabelVolumeType = value; + } + public resetMatchLabelVolumeType() { + this._matchLabelVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelVolumeTypeInput() { + return this._matchLabelVolumeType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CceNodePoolStorageSelectorsList extends cdktf.ComplexList { + public internalValue? : CceNodePoolStorageSelectors[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolStorageSelectorsOutputReference { + return new CceNodePoolStorageSelectorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolStorage { + /** + * groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#groups CceNodePool#groups} + */ + readonly groups: CceNodePoolStorageGroups[] | cdktf.IResolvable; + /** + * selectors block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#selectors CceNodePool#selectors} + */ + readonly selectors: CceNodePoolStorageSelectors[] | cdktf.IResolvable; +} + +export function cceNodePoolStorageToTerraform(struct?: CceNodePoolStorageOutputReference | CceNodePoolStorage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + groups: cdktf.listMapper(cceNodePoolStorageGroupsToTerraform, true)(struct!.groups), + selectors: cdktf.listMapper(cceNodePoolStorageSelectorsToTerraform, true)(struct!.selectors), + } +} + + +export function cceNodePoolStorageToHclTerraform(struct?: CceNodePoolStorageOutputReference | CceNodePoolStorage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + groups: { + value: cdktf.listMapperHcl(cceNodePoolStorageGroupsToHclTerraform, true)(struct!.groups), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolStorageGroupsList", + }, + selectors: { + value: cdktf.listMapperHcl(cceNodePoolStorageSelectorsToHclTerraform, true)(struct!.selectors), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolStorageSelectorsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolStorageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodePoolStorage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groups?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.groups = this._groups?.internalValue; + } + if (this._selectors?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.selectors = this._selectors?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolStorage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groups.internalValue = undefined; + this._selectors.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groups.internalValue = value.groups; + this._selectors.internalValue = value.selectors; + } + } + + // groups - computed: false, optional: false, required: true + private _groups = new CceNodePoolStorageGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + public putGroups(value: CceNodePoolStorageGroups[] | cdktf.IResolvable) { + this._groups.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get groupsInput() { + return this._groups.internalValue; + } + + // selectors - computed: false, optional: false, required: true + private _selectors = new CceNodePoolStorageSelectorsList(this, "selectors", false); + public get selectors() { + return this._selectors; + } + public putSelectors(value: CceNodePoolStorageSelectors[] | cdktf.IResolvable) { + this._selectors.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get selectorsInput() { + return this._selectors.internalValue; + } +} +export interface CceNodePoolTaints { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#effect CceNodePool#effect} + */ + readonly effect: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#key CceNodePool#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#value CceNodePool#value} + */ + readonly value: string; +} + +export function cceNodePoolTaintsToTerraform(struct?: CceNodePoolTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + effect: cdktf.stringToTerraform(struct!.effect), + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cceNodePoolTaintsToHclTerraform(struct?: CceNodePoolTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + effect: { + value: cdktf.stringToHclTerraform(struct!.effect), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolTaintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodePoolTaints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._effect !== undefined) { + hasAnyValues = true; + internalValueResult.effect = this._effect; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolTaints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._effect = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._effect = value.effect; + this._key = value.key; + this._value = value.value; + } + } + + // effect - computed: false, optional: false, required: true + private _effect?: string; + public get effect() { + return this.getStringAttribute('effect'); + } + public set effect(value: string) { + this._effect = value; + } + // Temporarily expose input value. Use with caution. + public get effectInput() { + return this._effect; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CceNodePoolTaintsList extends cdktf.ComplexList { + public internalValue? : CceNodePoolTaints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodePoolTaintsOutputReference { + return new CceNodePoolTaintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodePoolTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#create CceNodePool#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#delete CceNodePool#delete} + */ + readonly delete?: string; +} + +export function cceNodePoolTimeoutsToTerraform(struct?: CceNodePoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cceNodePoolTimeoutsToHclTerraform(struct?: CceNodePoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodePoolTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceNodePoolTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodePoolTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool huaweicloud_cce_node_pool} +*/ +export class CceNodePool extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceNodePool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceNodePool to import + * @param importFromId The id of the existing CceNodePool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceNodePool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_pool huaweicloud_cce_node_pool} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceNodePoolConfig + */ + public constructor(scope: Construct, id: string, config: CceNodePoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._clusterId = config.clusterId; + this._ecsGroupId = config.ecsGroupId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extendParam = config.extendParam; + this._flavorId = config.flavorId; + this._id = config.id; + this._initialNodeCount = config.initialNodeCount; + this._initializedConditions = config.initializedConditions; + this._keyPair = config.keyPair; + this._labelPolicyOnExistingNodes = config.labelPolicyOnExistingNodes; + this._labels = config.labels; + this._maxNodeCount = config.maxNodeCount; + this._maxPods = config.maxPods; + this._minNodeCount = config.minNodeCount; + this._name = config.name; + this._os = config.os; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._podSecurityGroups = config.podSecurityGroups; + this._postinstall = config.postinstall; + this._preinstall = config.preinstall; + this._priority = config.priority; + this._region = config.region; + this._runtime = config.runtime; + this._scaleDownCooldownTime = config.scaleDownCooldownTime; + this._scallEnable = config.scallEnable; + this._securityGroups = config.securityGroups; + this._subnetId = config.subnetId; + this._subnetList = config.subnetList; + this._tagPolicyOnExistingNodes = config.tagPolicyOnExistingNodes; + this._tags = config.tags; + this._taintPolicyOnExistingNodes = config.taintPolicyOnExistingNodes; + this._type = config.type; + this._dataVolumes.internalValue = config.dataVolumes; + this._extendParams.internalValue = config.extendParams; + this._extensionScaleGroups.internalValue = config.extensionScaleGroups; + this._hostnameConfig.internalValue = config.hostnameConfig; + this._rootVolume.internalValue = config.rootVolume; + this._storage.internalValue = config.storage; + this._taints.internalValue = config.taints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // current_node_count - computed: true, optional: false, required: false + public get currentNodeCount() { + return this.getNumberAttribute('current_node_count'); + } + + // ecs_group_id - computed: false, optional: true, required: false + private _ecsGroupId?: string; + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + public set ecsGroupId(value: string) { + this._ecsGroupId = value; + } + public resetEcsGroupId() { + this._ecsGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsGroupIdInput() { + return this._ecsGroupId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // initial_node_count - computed: false, optional: false, required: true + private _initialNodeCount?: number; + public get initialNodeCount() { + return this.getNumberAttribute('initial_node_count'); + } + public set initialNodeCount(value: number) { + this._initialNodeCount = value; + } + // Temporarily expose input value. Use with caution. + public get initialNodeCountInput() { + return this._initialNodeCount; + } + + // initialized_conditions - computed: true, optional: true, required: false + private _initializedConditions?: string[]; + public get initializedConditions() { + return this.getListAttribute('initialized_conditions'); + } + public set initializedConditions(value: string[]) { + this._initializedConditions = value; + } + public resetInitializedConditions() { + this._initializedConditions = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializedConditionsInput() { + return this._initializedConditions; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // label_policy_on_existing_nodes - computed: true, optional: true, required: false + private _labelPolicyOnExistingNodes?: string; + public get labelPolicyOnExistingNodes() { + return this.getStringAttribute('label_policy_on_existing_nodes'); + } + public set labelPolicyOnExistingNodes(value: string) { + this._labelPolicyOnExistingNodes = value; + } + public resetLabelPolicyOnExistingNodes() { + this._labelPolicyOnExistingNodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelPolicyOnExistingNodesInput() { + return this._labelPolicyOnExistingNodes; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // max_node_count - computed: false, optional: true, required: false + private _maxNodeCount?: number; + public get maxNodeCount() { + return this.getNumberAttribute('max_node_count'); + } + public set maxNodeCount(value: number) { + this._maxNodeCount = value; + } + public resetMaxNodeCount() { + this._maxNodeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxNodeCountInput() { + return this._maxNodeCount; + } + + // max_pods - computed: true, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // min_node_count - computed: false, optional: true, required: false + private _minNodeCount?: number; + public get minNodeCount() { + return this.getNumberAttribute('min_node_count'); + } + public set minNodeCount(value: number) { + this._minNodeCount = value; + } + public resetMinNodeCount() { + this._minNodeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get minNodeCountInput() { + return this._minNodeCount; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os - computed: true, optional: true, required: false + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + public resetOs() { + this._os = undefined; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // pod_security_groups - computed: false, optional: true, required: false + private _podSecurityGroups?: string[]; + public get podSecurityGroups() { + return this.getListAttribute('pod_security_groups'); + } + public set podSecurityGroups(value: string[]) { + this._podSecurityGroups = value; + } + public resetPodSecurityGroups() { + this._podSecurityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get podSecurityGroupsInput() { + return this._podSecurityGroups; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // priority - computed: false, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: true, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // scale_down_cooldown_time - computed: false, optional: true, required: false + private _scaleDownCooldownTime?: number; + public get scaleDownCooldownTime() { + return this.getNumberAttribute('scale_down_cooldown_time'); + } + public set scaleDownCooldownTime(value: number) { + this._scaleDownCooldownTime = value; + } + public resetScaleDownCooldownTime() { + this._scaleDownCooldownTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scaleDownCooldownTimeInput() { + return this._scaleDownCooldownTime; + } + + // scall_enable - computed: false, optional: true, required: false + private _scallEnable?: boolean | cdktf.IResolvable; + public get scallEnable() { + return this.getBooleanAttribute('scall_enable'); + } + public set scallEnable(value: boolean | cdktf.IResolvable) { + this._scallEnable = value; + } + public resetScallEnable() { + this._scallEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get scallEnableInput() { + return this._scallEnable; + } + + // security_groups - computed: true, optional: true, required: false + private _securityGroups?: string[]; + public get securityGroups() { + return this.getListAttribute('security_groups'); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + public resetSecurityGroups() { + this._securityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // subnet_list - computed: false, optional: true, required: false + private _subnetList?: string[]; + public get subnetList() { + return this.getListAttribute('subnet_list'); + } + public set subnetList(value: string[]) { + this._subnetList = value; + } + public resetSubnetList() { + this._subnetList = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetListInput() { + return this._subnetList; + } + + // tag_policy_on_existing_nodes - computed: true, optional: true, required: false + private _tagPolicyOnExistingNodes?: string; + public get tagPolicyOnExistingNodes() { + return this.getStringAttribute('tag_policy_on_existing_nodes'); + } + public set tagPolicyOnExistingNodes(value: string) { + this._tagPolicyOnExistingNodes = value; + } + public resetTagPolicyOnExistingNodes() { + this._tagPolicyOnExistingNodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagPolicyOnExistingNodesInput() { + return this._tagPolicyOnExistingNodes; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // taint_policy_on_existing_nodes - computed: true, optional: true, required: false + private _taintPolicyOnExistingNodes?: string; + public get taintPolicyOnExistingNodes() { + return this.getStringAttribute('taint_policy_on_existing_nodes'); + } + public set taintPolicyOnExistingNodes(value: string) { + this._taintPolicyOnExistingNodes = value; + } + public resetTaintPolicyOnExistingNodes() { + this._taintPolicyOnExistingNodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get taintPolicyOnExistingNodesInput() { + return this._taintPolicyOnExistingNodes; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // data_volumes - computed: false, optional: true, required: false + private _dataVolumes = new CceNodePoolDataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + public putDataVolumes(value: CceNodePoolDataVolumes[] | cdktf.IResolvable) { + this._dataVolumes.internalValue = value; + } + public resetDataVolumes() { + this._dataVolumes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumesInput() { + return this._dataVolumes.internalValue; + } + + // extend_params - computed: false, optional: true, required: false + private _extendParams = new CceNodePoolExtendParamsOutputReference(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + public putExtendParams(value: CceNodePoolExtendParams) { + this._extendParams.internalValue = value; + } + public resetExtendParams() { + this._extendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams.internalValue; + } + + // extension_scale_groups - computed: false, optional: true, required: false + private _extensionScaleGroups = new CceNodePoolExtensionScaleGroupsList(this, "extension_scale_groups", false); + public get extensionScaleGroups() { + return this._extensionScaleGroups; + } + public putExtensionScaleGroups(value: CceNodePoolExtensionScaleGroups[] | cdktf.IResolvable) { + this._extensionScaleGroups.internalValue = value; + } + public resetExtensionScaleGroups() { + this._extensionScaleGroups.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionScaleGroupsInput() { + return this._extensionScaleGroups.internalValue; + } + + // hostname_config - computed: false, optional: true, required: false + private _hostnameConfig = new CceNodePoolHostnameConfigOutputReference(this, "hostname_config"); + public get hostnameConfig() { + return this._hostnameConfig; + } + public putHostnameConfig(value: CceNodePoolHostnameConfig) { + this._hostnameConfig.internalValue = value; + } + public resetHostnameConfig() { + this._hostnameConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostnameConfigInput() { + return this._hostnameConfig.internalValue; + } + + // root_volume - computed: false, optional: false, required: true + private _rootVolume = new CceNodePoolRootVolumeOutputReference(this, "root_volume"); + public get rootVolume() { + return this._rootVolume; + } + public putRootVolume(value: CceNodePoolRootVolume) { + this._rootVolume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeInput() { + return this._rootVolume.internalValue; + } + + // storage - computed: false, optional: true, required: false + private _storage = new CceNodePoolStorageOutputReference(this, "storage"); + public get storage() { + return this._storage; + } + public putStorage(value: CceNodePoolStorage) { + this._storage.internalValue = value; + } + public resetStorage() { + this._storage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage.internalValue; + } + + // taints - computed: false, optional: true, required: false + private _taints = new CceNodePoolTaintsList(this, "taints", false); + public get taints() { + return this._taints; + } + public putTaints(value: CceNodePoolTaints[] | cdktf.IResolvable) { + this._taints.internalValue = value; + } + public resetTaints() { + this._taints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get taintsInput() { + return this._taints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceNodePoolTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceNodePoolTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cluster_id: cdktf.stringToTerraform(this._clusterId), + ecs_group_id: cdktf.stringToTerraform(this._ecsGroupId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(this._extendParam), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + initial_node_count: cdktf.numberToTerraform(this._initialNodeCount), + initialized_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._initializedConditions), + key_pair: cdktf.stringToTerraform(this._keyPair), + label_policy_on_existing_nodes: cdktf.stringToTerraform(this._labelPolicyOnExistingNodes), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + max_node_count: cdktf.numberToTerraform(this._maxNodeCount), + max_pods: cdktf.numberToTerraform(this._maxPods), + min_node_count: cdktf.numberToTerraform(this._minNodeCount), + name: cdktf.stringToTerraform(this._name), + os: cdktf.stringToTerraform(this._os), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + pod_security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._podSecurityGroups), + postinstall: cdktf.stringToTerraform(this._postinstall), + preinstall: cdktf.stringToTerraform(this._preinstall), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + scale_down_cooldown_time: cdktf.numberToTerraform(this._scaleDownCooldownTime), + scall_enable: cdktf.booleanToTerraform(this._scallEnable), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + subnet_id: cdktf.stringToTerraform(this._subnetId), + subnet_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._subnetList), + tag_policy_on_existing_nodes: cdktf.stringToTerraform(this._tagPolicyOnExistingNodes), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + taint_policy_on_existing_nodes: cdktf.stringToTerraform(this._taintPolicyOnExistingNodes), + type: cdktf.stringToTerraform(this._type), + data_volumes: cdktf.listMapper(cceNodePoolDataVolumesToTerraform, true)(this._dataVolumes.internalValue), + extend_params: cceNodePoolExtendParamsToTerraform(this._extendParams.internalValue), + extension_scale_groups: cdktf.listMapper(cceNodePoolExtensionScaleGroupsToTerraform, true)(this._extensionScaleGroups.internalValue), + hostname_config: cceNodePoolHostnameConfigToTerraform(this._hostnameConfig.internalValue), + root_volume: cceNodePoolRootVolumeToTerraform(this._rootVolume.internalValue), + storage: cceNodePoolStorageToTerraform(this._storage.internalValue), + taints: cdktf.listMapper(cceNodePoolTaintsToTerraform, true)(this._taints.internalValue), + timeouts: cceNodePoolTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_group_id: { + value: cdktf.stringToHclTerraform(this._ecsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initial_node_count: { + value: cdktf.numberToHclTerraform(this._initialNodeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + initialized_conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._initializedConditions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + label_policy_on_existing_nodes: { + value: cdktf.stringToHclTerraform(this._labelPolicyOnExistingNodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + max_node_count: { + value: cdktf.numberToHclTerraform(this._maxNodeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_pods: { + value: cdktf.numberToHclTerraform(this._maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_node_count: { + value: cdktf.numberToHclTerraform(this._minNodeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pod_security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._podSecurityGroups), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + postinstall: { + value: cdktf.stringToHclTerraform(this._postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(this._preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scale_down_cooldown_time: { + value: cdktf.numberToHclTerraform(this._scaleDownCooldownTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scall_enable: { + value: cdktf.booleanToHclTerraform(this._scallEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._subnetList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tag_policy_on_existing_nodes: { + value: cdktf.stringToHclTerraform(this._tagPolicyOnExistingNodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + taint_policy_on_existing_nodes: { + value: cdktf.stringToHclTerraform(this._taintPolicyOnExistingNodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_volumes: { + value: cdktf.listMapperHcl(cceNodePoolDataVolumesToHclTerraform, true)(this._dataVolumes.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolDataVolumesList", + }, + extend_params: { + value: cceNodePoolExtendParamsToHclTerraform(this._extendParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolExtendParamsList", + }, + extension_scale_groups: { + value: cdktf.listMapperHcl(cceNodePoolExtensionScaleGroupsToHclTerraform, true)(this._extensionScaleGroups.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolExtensionScaleGroupsList", + }, + hostname_config: { + value: cceNodePoolHostnameConfigToHclTerraform(this._hostnameConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolHostnameConfigList", + }, + root_volume: { + value: cceNodePoolRootVolumeToHclTerraform(this._rootVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolRootVolumeList", + }, + storage: { + value: cceNodePoolStorageToHclTerraform(this._storage.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolStorageList", + }, + taints: { + value: cdktf.listMapperHcl(cceNodePoolTaintsToHclTerraform, true)(this._taints.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodePoolTaintsList", + }, + timeouts: { + value: cceNodePoolTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceNodePoolTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-node-v3/README.md b/src/constructs/providers/huaweicloud/cce-node-v3/README.md new file mode 100644 index 00000000..f3756dbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_node_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_node_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3). diff --git a/src/constructs/providers/huaweicloud/cce-node-v3/index.ts b/src/constructs/providers/huaweicloud/cce-node-v3/index.ts new file mode 100644 index 00000000..deb2afd7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node-v3/index.ts @@ -0,0 +1,4001 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceNodeV3Config extends cdktf.TerraformMetaArguments { + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#annotations CceNodeV3#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#auto_pay CceNodeV3#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#auto_renew CceNodeV3#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#availability_zone CceNodeV3#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#bandwidth_charge_mode CceNodeV3#bandwidth_charge_mode} + */ + readonly bandwidthChargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#bandwidth_size CceNodeV3#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#billing_mode CceNodeV3#billing_mode} + */ + readonly billingMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#charging_mode CceNodeV3#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#cluster_id CceNodeV3#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#dedicated_host_id CceNodeV3#dedicated_host_id} + */ + readonly dedicatedHostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#ecs_group_id CceNodeV3#ecs_group_id} + */ + readonly ecsGroupId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#ecs_performance_type CceNodeV3#ecs_performance_type} + */ + readonly ecsPerformanceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#eip_id CceNodeV3#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#eip_ids CceNodeV3#eip_ids} + */ + readonly eipIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#enterprise_project_id CceNodeV3#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_param CceNodeV3#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_param_charging_mode CceNodeV3#extend_param_charging_mode} + */ + readonly extendParamChargingMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#fixed_ip CceNodeV3#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#flavor_id CceNodeV3#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#id CceNodeV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#initialized_conditions CceNodeV3#initialized_conditions} + */ + readonly initializedConditions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#iptype CceNodeV3#iptype} + */ + readonly iptype?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#keep_ecs CceNodeV3#keep_ecs} + */ + readonly keepEcs?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#key_pair CceNodeV3#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#labels CceNodeV3#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#max_pods CceNodeV3#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#name CceNodeV3#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#order_id CceNodeV3#order_id} + */ + readonly orderId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#os CceNodeV3#os} + */ + readonly os?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#partition CceNodeV3#partition} + */ + readonly partition?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#password CceNodeV3#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#period CceNodeV3#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#period_unit CceNodeV3#period_unit} + */ + readonly periodUnit?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#postinstall CceNodeV3#postinstall} + */ + readonly postinstall?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#preinstall CceNodeV3#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#private_key CceNodeV3#private_key} + */ + readonly privateKey?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#product_id CceNodeV3#product_id} + */ + readonly productId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#public_key CceNodeV3#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#region CceNodeV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#runtime CceNodeV3#runtime} + */ + readonly runtime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#sharetype CceNodeV3#sharetype} + */ + readonly sharetype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#subnet_id CceNodeV3#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#tags CceNodeV3#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * data_volumes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#data_volumes CceNodeV3#data_volumes} + */ + readonly dataVolumes?: CceNodeV3DataVolumes[] | cdktf.IResolvable; + /** + * extend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_params CceNodeV3#extend_params} + */ + readonly extendParams?: CceNodeV3ExtendParams; + /** + * extension_nics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extension_nics CceNodeV3#extension_nics} + */ + readonly extensionNics?: CceNodeV3ExtensionNics[] | cdktf.IResolvable; + /** + * hostname_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#hostname_config CceNodeV3#hostname_config} + */ + readonly hostnameConfig?: CceNodeV3HostnameConfig; + /** + * root_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#root_volume CceNodeV3#root_volume} + */ + readonly rootVolume: CceNodeV3RootVolume; + /** + * storage block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#storage CceNodeV3#storage} + */ + readonly storage?: CceNodeV3Storage; + /** + * taints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#taints CceNodeV3#taints} + */ + readonly taints?: CceNodeV3Taints[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#timeouts CceNodeV3#timeouts} + */ + readonly timeouts?: CceNodeV3Timeouts; +} +export interface CceNodeV3DataVolumes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#dss_pool_id CceNodeV3#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_param CceNodeV3#extend_param} + */ + readonly extendParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_params CceNodeV3#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#hw_passthrough CceNodeV3#hw_passthrough} + */ + readonly hwPassthrough?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#kms_key_id CceNodeV3#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#size CceNodeV3#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#volumetype CceNodeV3#volumetype} + */ + readonly volumetype: string; +} + +export function cceNodeV3DataVolumesToTerraform(struct?: CceNodeV3DataVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + extend_param: cdktf.stringToTerraform(struct!.extendParam), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParams), + hw_passthrough: cdktf.booleanToTerraform(struct!.hwPassthrough), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + volumetype: cdktf.stringToTerraform(struct!.volumetype), + } +} + + +export function cceNodeV3DataVolumesToHclTerraform(struct?: CceNodeV3DataVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.stringToHclTerraform(struct!.extendParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hw_passthrough: { + value: cdktf.booleanToHclTerraform(struct!.hwPassthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volumetype: { + value: cdktf.stringToHclTerraform(struct!.volumetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3DataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeV3DataVolumes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._extendParams !== undefined) { + hasAnyValues = true; + internalValueResult.extendParams = this._extendParams; + } + if (this._hwPassthrough !== undefined) { + hasAnyValues = true; + internalValueResult.hwPassthrough = this._hwPassthrough; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumetype !== undefined) { + hasAnyValues = true; + internalValueResult.volumetype = this._volumetype; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3DataVolumes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dssPoolId = undefined; + this._extendParam = undefined; + this._extendParams = undefined; + this._hwPassthrough = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._volumetype = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dssPoolId = value.dssPoolId; + this._extendParam = value.extendParam; + this._extendParams = value.extendParams; + this._hwPassthrough = value.hwPassthrough; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._volumetype = value.volumetype; + } + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: string; + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + public set extendParam(value: string) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // hw_passthrough - computed: false, optional: true, required: false + private _hwPassthrough?: boolean | cdktf.IResolvable; + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + public set hwPassthrough(value: boolean | cdktf.IResolvable) { + this._hwPassthrough = value; + } + public resetHwPassthrough() { + this._hwPassthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get hwPassthroughInput() { + return this._hwPassthrough; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volumetype - computed: false, optional: false, required: true + private _volumetype?: string; + public get volumetype() { + return this.getStringAttribute('volumetype'); + } + public set volumetype(value: string) { + this._volumetype = value; + } + // Temporarily expose input value. Use with caution. + public get volumetypeInput() { + return this._volumetype; + } +} + +export class CceNodeV3DataVolumesList extends cdktf.ComplexList { + public internalValue? : CceNodeV3DataVolumes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeV3DataVolumesOutputReference { + return new CceNodeV3DataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeV3ExtendParams { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#agency_name CceNodeV3#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#docker_base_size CceNodeV3#docker_base_size} + */ + readonly dockerBaseSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#kube_reserved_mem CceNodeV3#kube_reserved_mem} + */ + readonly kubeReservedMem?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#market_type CceNodeV3#market_type} + */ + readonly marketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#max_pods CceNodeV3#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#nic_threshold CceNodeV3#nic_threshold} + */ + readonly nicThreshold?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#node_image_id CceNodeV3#node_image_id} + */ + readonly nodeImageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#node_multi_queue CceNodeV3#node_multi_queue} + */ + readonly nodeMultiQueue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#postinstall CceNodeV3#postinstall} + */ + readonly postinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#preinstall CceNodeV3#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#spot_price CceNodeV3#spot_price} + */ + readonly spotPrice?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#system_reserved_mem CceNodeV3#system_reserved_mem} + */ + readonly systemReservedMem?: number; +} + +export function cceNodeV3ExtendParamsToTerraform(struct?: CceNodeV3ExtendParamsOutputReference | CceNodeV3ExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency_name: cdktf.stringToTerraform(struct!.agencyName), + docker_base_size: cdktf.numberToTerraform(struct!.dockerBaseSize), + kube_reserved_mem: cdktf.numberToTerraform(struct!.kubeReservedMem), + market_type: cdktf.stringToTerraform(struct!.marketType), + max_pods: cdktf.numberToTerraform(struct!.maxPods), + nic_threshold: cdktf.stringToTerraform(struct!.nicThreshold), + node_image_id: cdktf.stringToTerraform(struct!.nodeImageId), + node_multi_queue: cdktf.stringToTerraform(struct!.nodeMultiQueue), + postinstall: cdktf.stringToTerraform(struct!.postinstall), + preinstall: cdktf.stringToTerraform(struct!.preinstall), + spot_price: cdktf.stringToTerraform(struct!.spotPrice), + system_reserved_mem: cdktf.numberToTerraform(struct!.systemReservedMem), + } +} + + +export function cceNodeV3ExtendParamsToHclTerraform(struct?: CceNodeV3ExtendParamsOutputReference | CceNodeV3ExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(struct!.agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + docker_base_size: { + value: cdktf.numberToHclTerraform(struct!.dockerBaseSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kube_reserved_mem: { + value: cdktf.numberToHclTerraform(struct!.kubeReservedMem), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + market_type: { + value: cdktf.stringToHclTerraform(struct!.marketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_pods: { + value: cdktf.numberToHclTerraform(struct!.maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + nic_threshold: { + value: cdktf.stringToHclTerraform(struct!.nicThreshold), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_image_id: { + value: cdktf.stringToHclTerraform(struct!.nodeImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_multi_queue: { + value: cdktf.stringToHclTerraform(struct!.nodeMultiQueue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + postinstall: { + value: cdktf.stringToHclTerraform(struct!.postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(struct!.preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spot_price: { + value: cdktf.stringToHclTerraform(struct!.spotPrice), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_reserved_mem: { + value: cdktf.numberToHclTerraform(struct!.systemReservedMem), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3ExtendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeV3ExtendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agencyName !== undefined) { + hasAnyValues = true; + internalValueResult.agencyName = this._agencyName; + } + if (this._dockerBaseSize !== undefined) { + hasAnyValues = true; + internalValueResult.dockerBaseSize = this._dockerBaseSize; + } + if (this._kubeReservedMem !== undefined) { + hasAnyValues = true; + internalValueResult.kubeReservedMem = this._kubeReservedMem; + } + if (this._marketType !== undefined) { + hasAnyValues = true; + internalValueResult.marketType = this._marketType; + } + if (this._maxPods !== undefined) { + hasAnyValues = true; + internalValueResult.maxPods = this._maxPods; + } + if (this._nicThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.nicThreshold = this._nicThreshold; + } + if (this._nodeImageId !== undefined) { + hasAnyValues = true; + internalValueResult.nodeImageId = this._nodeImageId; + } + if (this._nodeMultiQueue !== undefined) { + hasAnyValues = true; + internalValueResult.nodeMultiQueue = this._nodeMultiQueue; + } + if (this._postinstall !== undefined) { + hasAnyValues = true; + internalValueResult.postinstall = this._postinstall; + } + if (this._preinstall !== undefined) { + hasAnyValues = true; + internalValueResult.preinstall = this._preinstall; + } + if (this._spotPrice !== undefined) { + hasAnyValues = true; + internalValueResult.spotPrice = this._spotPrice; + } + if (this._systemReservedMem !== undefined) { + hasAnyValues = true; + internalValueResult.systemReservedMem = this._systemReservedMem; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3ExtendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._agencyName = undefined; + this._dockerBaseSize = undefined; + this._kubeReservedMem = undefined; + this._marketType = undefined; + this._maxPods = undefined; + this._nicThreshold = undefined; + this._nodeImageId = undefined; + this._nodeMultiQueue = undefined; + this._postinstall = undefined; + this._preinstall = undefined; + this._spotPrice = undefined; + this._systemReservedMem = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._agencyName = value.agencyName; + this._dockerBaseSize = value.dockerBaseSize; + this._kubeReservedMem = value.kubeReservedMem; + this._marketType = value.marketType; + this._maxPods = value.maxPods; + this._nicThreshold = value.nicThreshold; + this._nodeImageId = value.nodeImageId; + this._nodeMultiQueue = value.nodeMultiQueue; + this._postinstall = value.postinstall; + this._preinstall = value.preinstall; + this._spotPrice = value.spotPrice; + this._systemReservedMem = value.systemReservedMem; + } + } + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // docker_base_size - computed: false, optional: true, required: false + private _dockerBaseSize?: number; + public get dockerBaseSize() { + return this.getNumberAttribute('docker_base_size'); + } + public set dockerBaseSize(value: number) { + this._dockerBaseSize = value; + } + public resetDockerBaseSize() { + this._dockerBaseSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerBaseSizeInput() { + return this._dockerBaseSize; + } + + // kube_reserved_mem - computed: false, optional: true, required: false + private _kubeReservedMem?: number; + public get kubeReservedMem() { + return this.getNumberAttribute('kube_reserved_mem'); + } + public set kubeReservedMem(value: number) { + this._kubeReservedMem = value; + } + public resetKubeReservedMem() { + this._kubeReservedMem = undefined; + } + // Temporarily expose input value. Use with caution. + public get kubeReservedMemInput() { + return this._kubeReservedMem; + } + + // market_type - computed: false, optional: true, required: false + private _marketType?: string; + public get marketType() { + return this.getStringAttribute('market_type'); + } + public set marketType(value: string) { + this._marketType = value; + } + public resetMarketType() { + this._marketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get marketTypeInput() { + return this._marketType; + } + + // max_pods - computed: false, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // nic_threshold - computed: false, optional: true, required: false + private _nicThreshold?: string; + public get nicThreshold() { + return this.getStringAttribute('nic_threshold'); + } + public set nicThreshold(value: string) { + this._nicThreshold = value; + } + public resetNicThreshold() { + this._nicThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get nicThresholdInput() { + return this._nicThreshold; + } + + // node_image_id - computed: false, optional: true, required: false + private _nodeImageId?: string; + public get nodeImageId() { + return this.getStringAttribute('node_image_id'); + } + public set nodeImageId(value: string) { + this._nodeImageId = value; + } + public resetNodeImageId() { + this._nodeImageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeImageIdInput() { + return this._nodeImageId; + } + + // node_multi_queue - computed: false, optional: true, required: false + private _nodeMultiQueue?: string; + public get nodeMultiQueue() { + return this.getStringAttribute('node_multi_queue'); + } + public set nodeMultiQueue(value: string) { + this._nodeMultiQueue = value; + } + public resetNodeMultiQueue() { + this._nodeMultiQueue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeMultiQueueInput() { + return this._nodeMultiQueue; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // spot_price - computed: false, optional: true, required: false + private _spotPrice?: string; + public get spotPrice() { + return this.getStringAttribute('spot_price'); + } + public set spotPrice(value: string) { + this._spotPrice = value; + } + public resetSpotPrice() { + this._spotPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotPriceInput() { + return this._spotPrice; + } + + // system_reserved_mem - computed: false, optional: true, required: false + private _systemReservedMem?: number; + public get systemReservedMem() { + return this.getNumberAttribute('system_reserved_mem'); + } + public set systemReservedMem(value: number) { + this._systemReservedMem = value; + } + public resetSystemReservedMem() { + this._systemReservedMem = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemReservedMemInput() { + return this._systemReservedMem; + } +} +export interface CceNodeV3ExtensionNics { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#subnet_id CceNodeV3#subnet_id} + */ + readonly subnetId: string; +} + +export function cceNodeV3ExtensionNicsToTerraform(struct?: CceNodeV3ExtensionNics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function cceNodeV3ExtensionNicsToHclTerraform(struct?: CceNodeV3ExtensionNics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3ExtensionNicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeV3ExtensionNics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3ExtensionNics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._subnetId = value.subnetId; + } + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class CceNodeV3ExtensionNicsList extends cdktf.ComplexList { + public internalValue? : CceNodeV3ExtensionNics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeV3ExtensionNicsOutputReference { + return new CceNodeV3ExtensionNicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeV3HostnameConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#type CceNodeV3#type} + */ + readonly type: string; +} + +export function cceNodeV3HostnameConfigToTerraform(struct?: CceNodeV3HostnameConfigOutputReference | CceNodeV3HostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodeV3HostnameConfigToHclTerraform(struct?: CceNodeV3HostnameConfigOutputReference | CceNodeV3HostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3HostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeV3HostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3HostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CceNodeV3RootVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#dss_pool_id CceNodeV3#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_param CceNodeV3#extend_param} + */ + readonly extendParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#extend_params CceNodeV3#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#hw_passthrough CceNodeV3#hw_passthrough} + */ + readonly hwPassthrough?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#kms_key_id CceNodeV3#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#size CceNodeV3#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#volumetype CceNodeV3#volumetype} + */ + readonly volumetype: string; +} + +export function cceNodeV3RootVolumeToTerraform(struct?: CceNodeV3RootVolumeOutputReference | CceNodeV3RootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + extend_param: cdktf.stringToTerraform(struct!.extendParam), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParams), + hw_passthrough: cdktf.booleanToTerraform(struct!.hwPassthrough), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + volumetype: cdktf.stringToTerraform(struct!.volumetype), + } +} + + +export function cceNodeV3RootVolumeToHclTerraform(struct?: CceNodeV3RootVolumeOutputReference | CceNodeV3RootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.stringToHclTerraform(struct!.extendParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hw_passthrough: { + value: cdktf.booleanToHclTerraform(struct!.hwPassthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volumetype: { + value: cdktf.stringToHclTerraform(struct!.volumetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3RootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeV3RootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._extendParams !== undefined) { + hasAnyValues = true; + internalValueResult.extendParams = this._extendParams; + } + if (this._hwPassthrough !== undefined) { + hasAnyValues = true; + internalValueResult.hwPassthrough = this._hwPassthrough; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumetype !== undefined) { + hasAnyValues = true; + internalValueResult.volumetype = this._volumetype; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3RootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dssPoolId = undefined; + this._extendParam = undefined; + this._extendParams = undefined; + this._hwPassthrough = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._volumetype = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dssPoolId = value.dssPoolId; + this._extendParam = value.extendParam; + this._extendParams = value.extendParams; + this._hwPassthrough = value.hwPassthrough; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._volumetype = value.volumetype; + } + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: string; + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + public set extendParam(value: string) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // hw_passthrough - computed: false, optional: true, required: false + private _hwPassthrough?: boolean | cdktf.IResolvable; + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + public set hwPassthrough(value: boolean | cdktf.IResolvable) { + this._hwPassthrough = value; + } + public resetHwPassthrough() { + this._hwPassthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get hwPassthroughInput() { + return this._hwPassthrough; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volumetype - computed: false, optional: false, required: true + private _volumetype?: string; + public get volumetype() { + return this.getStringAttribute('volumetype'); + } + public set volumetype(value: string) { + this._volumetype = value; + } + // Temporarily expose input value. Use with caution. + public get volumetypeInput() { + return this._volumetype; + } +} +export interface CceNodeV3StorageGroupsVirtualSpaces { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#lvm_lv_type CceNodeV3#lvm_lv_type} + */ + readonly lvmLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#lvm_path CceNodeV3#lvm_path} + */ + readonly lvmPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#name CceNodeV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#runtime_lv_type CceNodeV3#runtime_lv_type} + */ + readonly runtimeLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#size CceNodeV3#size} + */ + readonly size: string; +} + +export function cceNodeV3StorageGroupsVirtualSpacesToTerraform(struct?: CceNodeV3StorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + lvm_lv_type: cdktf.stringToTerraform(struct!.lvmLvType), + lvm_path: cdktf.stringToTerraform(struct!.lvmPath), + name: cdktf.stringToTerraform(struct!.name), + runtime_lv_type: cdktf.stringToTerraform(struct!.runtimeLvType), + size: cdktf.stringToTerraform(struct!.size), + } +} + + +export function cceNodeV3StorageGroupsVirtualSpacesToHclTerraform(struct?: CceNodeV3StorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + lvm_lv_type: { + value: cdktf.stringToHclTerraform(struct!.lvmLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lvm_path: { + value: cdktf.stringToHclTerraform(struct!.lvmPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_lv_type: { + value: cdktf.stringToHclTerraform(struct!.runtimeLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.stringToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3StorageGroupsVirtualSpacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeV3StorageGroupsVirtualSpaces | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._lvmLvType !== undefined) { + hasAnyValues = true; + internalValueResult.lvmLvType = this._lvmLvType; + } + if (this._lvmPath !== undefined) { + hasAnyValues = true; + internalValueResult.lvmPath = this._lvmPath; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._runtimeLvType !== undefined) { + hasAnyValues = true; + internalValueResult.runtimeLvType = this._runtimeLvType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3StorageGroupsVirtualSpaces | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._lvmLvType = undefined; + this._lvmPath = undefined; + this._name = undefined; + this._runtimeLvType = undefined; + this._size = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._lvmLvType = value.lvmLvType; + this._lvmPath = value.lvmPath; + this._name = value.name; + this._runtimeLvType = value.runtimeLvType; + this._size = value.size; + } + } + + // lvm_lv_type - computed: false, optional: true, required: false + private _lvmLvType?: string; + public get lvmLvType() { + return this.getStringAttribute('lvm_lv_type'); + } + public set lvmLvType(value: string) { + this._lvmLvType = value; + } + public resetLvmLvType() { + this._lvmLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmLvTypeInput() { + return this._lvmLvType; + } + + // lvm_path - computed: false, optional: true, required: false + private _lvmPath?: string; + public get lvmPath() { + return this.getStringAttribute('lvm_path'); + } + public set lvmPath(value: string) { + this._lvmPath = value; + } + public resetLvmPath() { + this._lvmPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmPathInput() { + return this._lvmPath; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // runtime_lv_type - computed: false, optional: true, required: false + private _runtimeLvType?: string; + public get runtimeLvType() { + return this.getStringAttribute('runtime_lv_type'); + } + public set runtimeLvType(value: string) { + this._runtimeLvType = value; + } + public resetRuntimeLvType() { + this._runtimeLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeLvTypeInput() { + return this._runtimeLvType; + } + + // size - computed: false, optional: false, required: true + private _size?: string; + public get size() { + return this.getStringAttribute('size'); + } + public set size(value: string) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} + +export class CceNodeV3StorageGroupsVirtualSpacesList extends cdktf.ComplexList { + public internalValue? : CceNodeV3StorageGroupsVirtualSpaces[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeV3StorageGroupsVirtualSpacesOutputReference { + return new CceNodeV3StorageGroupsVirtualSpacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeV3StorageGroups { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#cce_managed CceNodeV3#cce_managed} + */ + readonly cceManaged?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#name CceNodeV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#selector_names CceNodeV3#selector_names} + */ + readonly selectorNames: string[]; + /** + * virtual_spaces block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#virtual_spaces CceNodeV3#virtual_spaces} + */ + readonly virtualSpaces: CceNodeV3StorageGroupsVirtualSpaces[] | cdktf.IResolvable; +} + +export function cceNodeV3StorageGroupsToTerraform(struct?: CceNodeV3StorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cce_managed: cdktf.booleanToTerraform(struct!.cceManaged), + name: cdktf.stringToTerraform(struct!.name), + selector_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.selectorNames), + virtual_spaces: cdktf.listMapper(cceNodeV3StorageGroupsVirtualSpacesToTerraform, true)(struct!.virtualSpaces), + } +} + + +export function cceNodeV3StorageGroupsToHclTerraform(struct?: CceNodeV3StorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cce_managed: { + value: cdktf.booleanToHclTerraform(struct!.cceManaged), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + selector_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.selectorNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + virtual_spaces: { + value: cdktf.listMapperHcl(cceNodeV3StorageGroupsVirtualSpacesToHclTerraform, true)(struct!.virtualSpaces), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3StorageGroupsVirtualSpacesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3StorageGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeV3StorageGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cceManaged !== undefined) { + hasAnyValues = true; + internalValueResult.cceManaged = this._cceManaged; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._selectorNames !== undefined) { + hasAnyValues = true; + internalValueResult.selectorNames = this._selectorNames; + } + if (this._virtualSpaces?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.virtualSpaces = this._virtualSpaces?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3StorageGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cceManaged = undefined; + this._name = undefined; + this._selectorNames = undefined; + this._virtualSpaces.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cceManaged = value.cceManaged; + this._name = value.name; + this._selectorNames = value.selectorNames; + this._virtualSpaces.internalValue = value.virtualSpaces; + } + } + + // cce_managed - computed: false, optional: true, required: false + private _cceManaged?: boolean | cdktf.IResolvable; + public get cceManaged() { + return this.getBooleanAttribute('cce_managed'); + } + public set cceManaged(value: boolean | cdktf.IResolvable) { + this._cceManaged = value; + } + public resetCceManaged() { + this._cceManaged = undefined; + } + // Temporarily expose input value. Use with caution. + public get cceManagedInput() { + return this._cceManaged; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // selector_names - computed: false, optional: false, required: true + private _selectorNames?: string[]; + public get selectorNames() { + return this.getListAttribute('selector_names'); + } + public set selectorNames(value: string[]) { + this._selectorNames = value; + } + // Temporarily expose input value. Use with caution. + public get selectorNamesInput() { + return this._selectorNames; + } + + // virtual_spaces - computed: false, optional: false, required: true + private _virtualSpaces = new CceNodeV3StorageGroupsVirtualSpacesList(this, "virtual_spaces", false); + public get virtualSpaces() { + return this._virtualSpaces; + } + public putVirtualSpaces(value: CceNodeV3StorageGroupsVirtualSpaces[] | cdktf.IResolvable) { + this._virtualSpaces.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get virtualSpacesInput() { + return this._virtualSpaces.internalValue; + } +} + +export class CceNodeV3StorageGroupsList extends cdktf.ComplexList { + public internalValue? : CceNodeV3StorageGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeV3StorageGroupsOutputReference { + return new CceNodeV3StorageGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeV3StorageSelectors { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#match_label_count CceNodeV3#match_label_count} + */ + readonly matchLabelCount?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#match_label_metadata_cmkid CceNodeV3#match_label_metadata_cmkid} + */ + readonly matchLabelMetadataCmkid?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#match_label_metadata_encrypted CceNodeV3#match_label_metadata_encrypted} + */ + readonly matchLabelMetadataEncrypted?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#match_label_size CceNodeV3#match_label_size} + */ + readonly matchLabelSize?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#match_label_volume_type CceNodeV3#match_label_volume_type} + */ + readonly matchLabelVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#name CceNodeV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#type CceNodeV3#type} + */ + readonly type?: string; +} + +export function cceNodeV3StorageSelectorsToTerraform(struct?: CceNodeV3StorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_label_count: cdktf.stringToTerraform(struct!.matchLabelCount), + match_label_metadata_cmkid: cdktf.stringToTerraform(struct!.matchLabelMetadataCmkid), + match_label_metadata_encrypted: cdktf.stringToTerraform(struct!.matchLabelMetadataEncrypted), + match_label_size: cdktf.stringToTerraform(struct!.matchLabelSize), + match_label_volume_type: cdktf.stringToTerraform(struct!.matchLabelVolumeType), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodeV3StorageSelectorsToHclTerraform(struct?: CceNodeV3StorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_label_count: { + value: cdktf.stringToHclTerraform(struct!.matchLabelCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_cmkid: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataCmkid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_encrypted: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataEncrypted), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_size: { + value: cdktf.stringToHclTerraform(struct!.matchLabelSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_volume_type: { + value: cdktf.stringToHclTerraform(struct!.matchLabelVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3StorageSelectorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeV3StorageSelectors | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchLabelCount !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelCount = this._matchLabelCount; + } + if (this._matchLabelMetadataCmkid !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataCmkid = this._matchLabelMetadataCmkid; + } + if (this._matchLabelMetadataEncrypted !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataEncrypted = this._matchLabelMetadataEncrypted; + } + if (this._matchLabelSize !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelSize = this._matchLabelSize; + } + if (this._matchLabelVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelVolumeType = this._matchLabelVolumeType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3StorageSelectors | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchLabelCount = undefined; + this._matchLabelMetadataCmkid = undefined; + this._matchLabelMetadataEncrypted = undefined; + this._matchLabelSize = undefined; + this._matchLabelVolumeType = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchLabelCount = value.matchLabelCount; + this._matchLabelMetadataCmkid = value.matchLabelMetadataCmkid; + this._matchLabelMetadataEncrypted = value.matchLabelMetadataEncrypted; + this._matchLabelSize = value.matchLabelSize; + this._matchLabelVolumeType = value.matchLabelVolumeType; + this._name = value.name; + this._type = value.type; + } + } + + // match_label_count - computed: false, optional: true, required: false + private _matchLabelCount?: string; + public get matchLabelCount() { + return this.getStringAttribute('match_label_count'); + } + public set matchLabelCount(value: string) { + this._matchLabelCount = value; + } + public resetMatchLabelCount() { + this._matchLabelCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelCountInput() { + return this._matchLabelCount; + } + + // match_label_metadata_cmkid - computed: false, optional: true, required: false + private _matchLabelMetadataCmkid?: string; + public get matchLabelMetadataCmkid() { + return this.getStringAttribute('match_label_metadata_cmkid'); + } + public set matchLabelMetadataCmkid(value: string) { + this._matchLabelMetadataCmkid = value; + } + public resetMatchLabelMetadataCmkid() { + this._matchLabelMetadataCmkid = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataCmkidInput() { + return this._matchLabelMetadataCmkid; + } + + // match_label_metadata_encrypted - computed: false, optional: true, required: false + private _matchLabelMetadataEncrypted?: string; + public get matchLabelMetadataEncrypted() { + return this.getStringAttribute('match_label_metadata_encrypted'); + } + public set matchLabelMetadataEncrypted(value: string) { + this._matchLabelMetadataEncrypted = value; + } + public resetMatchLabelMetadataEncrypted() { + this._matchLabelMetadataEncrypted = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataEncryptedInput() { + return this._matchLabelMetadataEncrypted; + } + + // match_label_size - computed: false, optional: true, required: false + private _matchLabelSize?: string; + public get matchLabelSize() { + return this.getStringAttribute('match_label_size'); + } + public set matchLabelSize(value: string) { + this._matchLabelSize = value; + } + public resetMatchLabelSize() { + this._matchLabelSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelSizeInput() { + return this._matchLabelSize; + } + + // match_label_volume_type - computed: false, optional: true, required: false + private _matchLabelVolumeType?: string; + public get matchLabelVolumeType() { + return this.getStringAttribute('match_label_volume_type'); + } + public set matchLabelVolumeType(value: string) { + this._matchLabelVolumeType = value; + } + public resetMatchLabelVolumeType() { + this._matchLabelVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelVolumeTypeInput() { + return this._matchLabelVolumeType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CceNodeV3StorageSelectorsList extends cdktf.ComplexList { + public internalValue? : CceNodeV3StorageSelectors[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeV3StorageSelectorsOutputReference { + return new CceNodeV3StorageSelectorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeV3Storage { + /** + * groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#groups CceNodeV3#groups} + */ + readonly groups: CceNodeV3StorageGroups[] | cdktf.IResolvable; + /** + * selectors block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#selectors CceNodeV3#selectors} + */ + readonly selectors: CceNodeV3StorageSelectors[] | cdktf.IResolvable; +} + +export function cceNodeV3StorageToTerraform(struct?: CceNodeV3StorageOutputReference | CceNodeV3Storage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + groups: cdktf.listMapper(cceNodeV3StorageGroupsToTerraform, true)(struct!.groups), + selectors: cdktf.listMapper(cceNodeV3StorageSelectorsToTerraform, true)(struct!.selectors), + } +} + + +export function cceNodeV3StorageToHclTerraform(struct?: CceNodeV3StorageOutputReference | CceNodeV3Storage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + groups: { + value: cdktf.listMapperHcl(cceNodeV3StorageGroupsToHclTerraform, true)(struct!.groups), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3StorageGroupsList", + }, + selectors: { + value: cdktf.listMapperHcl(cceNodeV3StorageSelectorsToHclTerraform, true)(struct!.selectors), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3StorageSelectorsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3StorageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeV3Storage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groups?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.groups = this._groups?.internalValue; + } + if (this._selectors?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.selectors = this._selectors?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3Storage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groups.internalValue = undefined; + this._selectors.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groups.internalValue = value.groups; + this._selectors.internalValue = value.selectors; + } + } + + // groups - computed: false, optional: false, required: true + private _groups = new CceNodeV3StorageGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + public putGroups(value: CceNodeV3StorageGroups[] | cdktf.IResolvable) { + this._groups.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get groupsInput() { + return this._groups.internalValue; + } + + // selectors - computed: false, optional: false, required: true + private _selectors = new CceNodeV3StorageSelectorsList(this, "selectors", false); + public get selectors() { + return this._selectors; + } + public putSelectors(value: CceNodeV3StorageSelectors[] | cdktf.IResolvable) { + this._selectors.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get selectorsInput() { + return this._selectors.internalValue; + } +} +export interface CceNodeV3Taints { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#effect CceNodeV3#effect} + */ + readonly effect: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#key CceNodeV3#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#value CceNodeV3#value} + */ + readonly value?: string; +} + +export function cceNodeV3TaintsToTerraform(struct?: CceNodeV3Taints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + effect: cdktf.stringToTerraform(struct!.effect), + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cceNodeV3TaintsToHclTerraform(struct?: CceNodeV3Taints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + effect: { + value: cdktf.stringToHclTerraform(struct!.effect), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3TaintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeV3Taints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._effect !== undefined) { + hasAnyValues = true; + internalValueResult.effect = this._effect; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3Taints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._effect = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._effect = value.effect; + this._key = value.key; + this._value = value.value; + } + } + + // effect - computed: false, optional: false, required: true + private _effect?: string; + public get effect() { + return this.getStringAttribute('effect'); + } + public set effect(value: string) { + this._effect = value; + } + // Temporarily expose input value. Use with caution. + public get effectInput() { + return this._effect; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CceNodeV3TaintsList extends cdktf.ComplexList { + public internalValue? : CceNodeV3Taints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeV3TaintsOutputReference { + return new CceNodeV3TaintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeV3Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#create CceNodeV3#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#delete CceNodeV3#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#update CceNodeV3#update} + */ + readonly update?: string; +} + +export function cceNodeV3TimeoutsToTerraform(struct?: CceNodeV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cceNodeV3TimeoutsToHclTerraform(struct?: CceNodeV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeV3TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceNodeV3Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeV3Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3 huaweicloud_cce_node_v3} +*/ +export class CceNodeV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceNodeV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceNodeV3 to import + * @param importFromId The id of the existing CceNodeV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceNodeV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node_v3 huaweicloud_cce_node_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceNodeV3Config + */ + public constructor(scope: Construct, id: string, config: CceNodeV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._annotations = config.annotations; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._bandwidthChargeMode = config.bandwidthChargeMode; + this._bandwidthSize = config.bandwidthSize; + this._billingMode = config.billingMode; + this._chargingMode = config.chargingMode; + this._clusterId = config.clusterId; + this._dedicatedHostId = config.dedicatedHostId; + this._ecsGroupId = config.ecsGroupId; + this._ecsPerformanceType = config.ecsPerformanceType; + this._eipId = config.eipId; + this._eipIds = config.eipIds; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extendParam = config.extendParam; + this._extendParamChargingMode = config.extendParamChargingMode; + this._fixedIp = config.fixedIp; + this._flavorId = config.flavorId; + this._id = config.id; + this._initializedConditions = config.initializedConditions; + this._iptype = config.iptype; + this._keepEcs = config.keepEcs; + this._keyPair = config.keyPair; + this._labels = config.labels; + this._maxPods = config.maxPods; + this._name = config.name; + this._orderId = config.orderId; + this._os = config.os; + this._partition = config.partition; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._postinstall = config.postinstall; + this._preinstall = config.preinstall; + this._privateKey = config.privateKey; + this._productId = config.productId; + this._publicKey = config.publicKey; + this._region = config.region; + this._runtime = config.runtime; + this._sharetype = config.sharetype; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._dataVolumes.internalValue = config.dataVolumes; + this._extendParams.internalValue = config.extendParams; + this._extensionNics.internalValue = config.extensionNics; + this._hostnameConfig.internalValue = config.hostnameConfig; + this._rootVolume.internalValue = config.rootVolume; + this._storage.internalValue = config.storage; + this._taints.internalValue = config.taints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // bandwidth_charge_mode - computed: false, optional: true, required: false + private _bandwidthChargeMode?: string; + public get bandwidthChargeMode() { + return this.getStringAttribute('bandwidth_charge_mode'); + } + public set bandwidthChargeMode(value: string) { + this._bandwidthChargeMode = value; + } + public resetBandwidthChargeMode() { + this._bandwidthChargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthChargeModeInput() { + return this._bandwidthChargeMode; + } + + // bandwidth_size - computed: false, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // billing_mode - computed: true, optional: true, required: false + private _billingMode?: number; + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + public set billingMode(value: number) { + this._billingMode = value; + } + public resetBillingMode() { + this._billingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get billingModeInput() { + return this._billingMode; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // dedicated_host_id - computed: false, optional: true, required: false + private _dedicatedHostId?: string; + public get dedicatedHostId() { + return this.getStringAttribute('dedicated_host_id'); + } + public set dedicatedHostId(value: string) { + this._dedicatedHostId = value; + } + public resetDedicatedHostId() { + this._dedicatedHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedHostIdInput() { + return this._dedicatedHostId; + } + + // ecs_group_id - computed: false, optional: true, required: false + private _ecsGroupId?: string; + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + public set ecsGroupId(value: string) { + this._ecsGroupId = value; + } + public resetEcsGroupId() { + this._ecsGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsGroupIdInput() { + return this._ecsGroupId; + } + + // ecs_performance_type - computed: false, optional: true, required: false + private _ecsPerformanceType?: string; + public get ecsPerformanceType() { + return this.getStringAttribute('ecs_performance_type'); + } + public set ecsPerformanceType(value: string) { + this._ecsPerformanceType = value; + } + public resetEcsPerformanceType() { + this._ecsPerformanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsPerformanceTypeInput() { + return this._ecsPerformanceType; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // eip_ids - computed: false, optional: true, required: false + private _eipIds?: string[]; + public get eipIds() { + return cdktf.Fn.tolist(this.getListAttribute('eip_ids')); + } + public set eipIds(value: string[]) { + this._eipIds = value; + } + public resetEipIds() { + this._eipIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdsInput() { + return this._eipIds; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_param_charging_mode - computed: false, optional: true, required: false + private _extendParamChargingMode?: number; + public get extendParamChargingMode() { + return this.getNumberAttribute('extend_param_charging_mode'); + } + public set extendParamChargingMode(value: number) { + this._extendParamChargingMode = value; + } + public resetExtendParamChargingMode() { + this._extendParamChargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamChargingModeInput() { + return this._extendParamChargingMode; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // initialized_conditions - computed: true, optional: true, required: false + private _initializedConditions?: string[]; + public get initializedConditions() { + return this.getListAttribute('initialized_conditions'); + } + public set initializedConditions(value: string[]) { + this._initializedConditions = value; + } + public resetInitializedConditions() { + this._initializedConditions = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializedConditionsInput() { + return this._initializedConditions; + } + + // iptype - computed: false, optional: true, required: false + private _iptype?: string; + public get iptype() { + return this.getStringAttribute('iptype'); + } + public set iptype(value: string) { + this._iptype = value; + } + public resetIptype() { + this._iptype = undefined; + } + // Temporarily expose input value. Use with caution. + public get iptypeInput() { + return this._iptype; + } + + // keep_ecs - computed: false, optional: true, required: false + private _keepEcs?: boolean | cdktf.IResolvable; + public get keepEcs() { + return this.getBooleanAttribute('keep_ecs'); + } + public set keepEcs(value: boolean | cdktf.IResolvable) { + this._keepEcs = value; + } + public resetKeepEcs() { + this._keepEcs = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepEcsInput() { + return this._keepEcs; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // max_pods - computed: false, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: false, optional: true, required: false + private _orderId?: string; + public get orderId() { + return this.getStringAttribute('order_id'); + } + public set orderId(value: string) { + this._orderId = value; + } + public resetOrderId() { + this._orderId = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderIdInput() { + return this._orderId; + } + + // os - computed: true, optional: true, required: false + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + public resetOs() { + this._os = undefined; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // partition - computed: false, optional: true, required: false + private _partition?: string; + public get partition() { + return this.getStringAttribute('partition'); + } + public set partition(value: string) { + this._partition = value; + } + public resetPartition() { + this._partition = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionInput() { + return this._partition; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // public_key - computed: false, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: true, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // sharetype - computed: false, optional: true, required: false + private _sharetype?: string; + public get sharetype() { + return this.getStringAttribute('sharetype'); + } + public set sharetype(value: string) { + this._sharetype = value; + } + public resetSharetype() { + this._sharetype = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharetypeInput() { + return this._sharetype; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // data_volumes - computed: false, optional: true, required: false + private _dataVolumes = new CceNodeV3DataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + public putDataVolumes(value: CceNodeV3DataVolumes[] | cdktf.IResolvable) { + this._dataVolumes.internalValue = value; + } + public resetDataVolumes() { + this._dataVolumes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumesInput() { + return this._dataVolumes.internalValue; + } + + // extend_params - computed: false, optional: true, required: false + private _extendParams = new CceNodeV3ExtendParamsOutputReference(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + public putExtendParams(value: CceNodeV3ExtendParams) { + this._extendParams.internalValue = value; + } + public resetExtendParams() { + this._extendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams.internalValue; + } + + // extension_nics - computed: false, optional: true, required: false + private _extensionNics = new CceNodeV3ExtensionNicsList(this, "extension_nics", false); + public get extensionNics() { + return this._extensionNics; + } + public putExtensionNics(value: CceNodeV3ExtensionNics[] | cdktf.IResolvable) { + this._extensionNics.internalValue = value; + } + public resetExtensionNics() { + this._extensionNics.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionNicsInput() { + return this._extensionNics.internalValue; + } + + // hostname_config - computed: false, optional: true, required: false + private _hostnameConfig = new CceNodeV3HostnameConfigOutputReference(this, "hostname_config"); + public get hostnameConfig() { + return this._hostnameConfig; + } + public putHostnameConfig(value: CceNodeV3HostnameConfig) { + this._hostnameConfig.internalValue = value; + } + public resetHostnameConfig() { + this._hostnameConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostnameConfigInput() { + return this._hostnameConfig.internalValue; + } + + // root_volume - computed: false, optional: false, required: true + private _rootVolume = new CceNodeV3RootVolumeOutputReference(this, "root_volume"); + public get rootVolume() { + return this._rootVolume; + } + public putRootVolume(value: CceNodeV3RootVolume) { + this._rootVolume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeInput() { + return this._rootVolume.internalValue; + } + + // storage - computed: false, optional: true, required: false + private _storage = new CceNodeV3StorageOutputReference(this, "storage"); + public get storage() { + return this._storage; + } + public putStorage(value: CceNodeV3Storage) { + this._storage.internalValue = value; + } + public resetStorage() { + this._storage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage.internalValue; + } + + // taints - computed: false, optional: true, required: false + private _taints = new CceNodeV3TaintsList(this, "taints", false); + public get taints() { + return this._taints; + } + public putTaints(value: CceNodeV3Taints[] | cdktf.IResolvable) { + this._taints.internalValue = value; + } + public resetTaints() { + this._taints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get taintsInput() { + return this._taints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceNodeV3TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceNodeV3Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + bandwidth_charge_mode: cdktf.stringToTerraform(this._bandwidthChargeMode), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + billing_mode: cdktf.numberToTerraform(this._billingMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cluster_id: cdktf.stringToTerraform(this._clusterId), + dedicated_host_id: cdktf.stringToTerraform(this._dedicatedHostId), + ecs_group_id: cdktf.stringToTerraform(this._ecsGroupId), + ecs_performance_type: cdktf.stringToTerraform(this._ecsPerformanceType), + eip_id: cdktf.stringToTerraform(this._eipId), + eip_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._eipIds), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(this._extendParam), + extend_param_charging_mode: cdktf.numberToTerraform(this._extendParamChargingMode), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + initialized_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._initializedConditions), + iptype: cdktf.stringToTerraform(this._iptype), + keep_ecs: cdktf.booleanToTerraform(this._keepEcs), + key_pair: cdktf.stringToTerraform(this._keyPair), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + max_pods: cdktf.numberToTerraform(this._maxPods), + name: cdktf.stringToTerraform(this._name), + order_id: cdktf.stringToTerraform(this._orderId), + os: cdktf.stringToTerraform(this._os), + partition: cdktf.stringToTerraform(this._partition), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + postinstall: cdktf.stringToTerraform(this._postinstall), + preinstall: cdktf.stringToTerraform(this._preinstall), + private_key: cdktf.stringToTerraform(this._privateKey), + product_id: cdktf.stringToTerraform(this._productId), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + sharetype: cdktf.stringToTerraform(this._sharetype), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + data_volumes: cdktf.listMapper(cceNodeV3DataVolumesToTerraform, true)(this._dataVolumes.internalValue), + extend_params: cceNodeV3ExtendParamsToTerraform(this._extendParams.internalValue), + extension_nics: cdktf.listMapper(cceNodeV3ExtensionNicsToTerraform, true)(this._extensionNics.internalValue), + hostname_config: cceNodeV3HostnameConfigToTerraform(this._hostnameConfig.internalValue), + root_volume: cceNodeV3RootVolumeToTerraform(this._rootVolume.internalValue), + storage: cceNodeV3StorageToTerraform(this._storage.internalValue), + taints: cdktf.listMapper(cceNodeV3TaintsToTerraform, true)(this._taints.internalValue), + timeouts: cceNodeV3TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_charge_mode: { + value: cdktf.stringToHclTerraform(this._bandwidthChargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + billing_mode: { + value: cdktf.numberToHclTerraform(this._billingMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_host_id: { + value: cdktf.stringToHclTerraform(this._dedicatedHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_group_id: { + value: cdktf.stringToHclTerraform(this._ecsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_performance_type: { + value: cdktf.stringToHclTerraform(this._ecsPerformanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._eipIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + extend_param_charging_mode: { + value: cdktf.numberToHclTerraform(this._extendParamChargingMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initialized_conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._initializedConditions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + iptype: { + value: cdktf.stringToHclTerraform(this._iptype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_ecs: { + value: cdktf.booleanToHclTerraform(this._keepEcs), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + max_pods: { + value: cdktf.numberToHclTerraform(this._maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + order_id: { + value: cdktf.stringToHclTerraform(this._orderId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition: { + value: cdktf.stringToHclTerraform(this._partition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + postinstall: { + value: cdktf.stringToHclTerraform(this._postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(this._preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sharetype: { + value: cdktf.stringToHclTerraform(this._sharetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + data_volumes: { + value: cdktf.listMapperHcl(cceNodeV3DataVolumesToHclTerraform, true)(this._dataVolumes.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3DataVolumesList", + }, + extend_params: { + value: cceNodeV3ExtendParamsToHclTerraform(this._extendParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3ExtendParamsList", + }, + extension_nics: { + value: cdktf.listMapperHcl(cceNodeV3ExtensionNicsToHclTerraform, true)(this._extensionNics.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3ExtensionNicsList", + }, + hostname_config: { + value: cceNodeV3HostnameConfigToHclTerraform(this._hostnameConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3HostnameConfigList", + }, + root_volume: { + value: cceNodeV3RootVolumeToHclTerraform(this._rootVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3RootVolumeList", + }, + storage: { + value: cceNodeV3StorageToHclTerraform(this._storage.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3StorageList", + }, + taints: { + value: cdktf.listMapperHcl(cceNodeV3TaintsToHclTerraform, true)(this._taints.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeV3TaintsList", + }, + timeouts: { + value: cceNodeV3TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceNodeV3Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-node/README.md b/src/constructs/providers/huaweicloud/cce-node/README.md new file mode 100644 index 00000000..6f5ff30d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_node` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_node`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node). diff --git a/src/constructs/providers/huaweicloud/cce-node/index.ts b/src/constructs/providers/huaweicloud/cce-node/index.ts new file mode 100644 index 00000000..2f2be5a1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-node/index.ts @@ -0,0 +1,4001 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CceNodeConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#annotations CceNode#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#auto_pay CceNode#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#auto_renew CceNode#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#availability_zone CceNode#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#bandwidth_charge_mode CceNode#bandwidth_charge_mode} + */ + readonly bandwidthChargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#bandwidth_size CceNode#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#billing_mode CceNode#billing_mode} + */ + readonly billingMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#charging_mode CceNode#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#cluster_id CceNode#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#dedicated_host_id CceNode#dedicated_host_id} + */ + readonly dedicatedHostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#ecs_group_id CceNode#ecs_group_id} + */ + readonly ecsGroupId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#ecs_performance_type CceNode#ecs_performance_type} + */ + readonly ecsPerformanceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#eip_id CceNode#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#eip_ids CceNode#eip_ids} + */ + readonly eipIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#enterprise_project_id CceNode#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_param CceNode#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_param_charging_mode CceNode#extend_param_charging_mode} + */ + readonly extendParamChargingMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#fixed_ip CceNode#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#flavor_id CceNode#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#id CceNode#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#initialized_conditions CceNode#initialized_conditions} + */ + readonly initializedConditions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#iptype CceNode#iptype} + */ + readonly iptype?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#keep_ecs CceNode#keep_ecs} + */ + readonly keepEcs?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#key_pair CceNode#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#labels CceNode#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#max_pods CceNode#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#name CceNode#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#order_id CceNode#order_id} + */ + readonly orderId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#os CceNode#os} + */ + readonly os?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#partition CceNode#partition} + */ + readonly partition?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#password CceNode#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#period CceNode#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#period_unit CceNode#period_unit} + */ + readonly periodUnit?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#postinstall CceNode#postinstall} + */ + readonly postinstall?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#preinstall CceNode#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#private_key CceNode#private_key} + */ + readonly privateKey?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#product_id CceNode#product_id} + */ + readonly productId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#public_key CceNode#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#region CceNode#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#runtime CceNode#runtime} + */ + readonly runtime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#sharetype CceNode#sharetype} + */ + readonly sharetype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#subnet_id CceNode#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#tags CceNode#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * data_volumes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#data_volumes CceNode#data_volumes} + */ + readonly dataVolumes?: CceNodeDataVolumes[] | cdktf.IResolvable; + /** + * extend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_params CceNode#extend_params} + */ + readonly extendParams?: CceNodeExtendParams; + /** + * extension_nics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extension_nics CceNode#extension_nics} + */ + readonly extensionNics?: CceNodeExtensionNics[] | cdktf.IResolvable; + /** + * hostname_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#hostname_config CceNode#hostname_config} + */ + readonly hostnameConfig?: CceNodeHostnameConfig; + /** + * root_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#root_volume CceNode#root_volume} + */ + readonly rootVolume: CceNodeRootVolume; + /** + * storage block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#storage CceNode#storage} + */ + readonly storage?: CceNodeStorage; + /** + * taints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#taints CceNode#taints} + */ + readonly taints?: CceNodeTaints[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#timeouts CceNode#timeouts} + */ + readonly timeouts?: CceNodeTimeouts; +} +export interface CceNodeDataVolumes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#dss_pool_id CceNode#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_param CceNode#extend_param} + */ + readonly extendParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_params CceNode#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#hw_passthrough CceNode#hw_passthrough} + */ + readonly hwPassthrough?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#kms_key_id CceNode#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#size CceNode#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#volumetype CceNode#volumetype} + */ + readonly volumetype: string; +} + +export function cceNodeDataVolumesToTerraform(struct?: CceNodeDataVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + extend_param: cdktf.stringToTerraform(struct!.extendParam), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParams), + hw_passthrough: cdktf.booleanToTerraform(struct!.hwPassthrough), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + volumetype: cdktf.stringToTerraform(struct!.volumetype), + } +} + + +export function cceNodeDataVolumesToHclTerraform(struct?: CceNodeDataVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.stringToHclTerraform(struct!.extendParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hw_passthrough: { + value: cdktf.booleanToHclTerraform(struct!.hwPassthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volumetype: { + value: cdktf.stringToHclTerraform(struct!.volumetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeDataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeDataVolumes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._extendParams !== undefined) { + hasAnyValues = true; + internalValueResult.extendParams = this._extendParams; + } + if (this._hwPassthrough !== undefined) { + hasAnyValues = true; + internalValueResult.hwPassthrough = this._hwPassthrough; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumetype !== undefined) { + hasAnyValues = true; + internalValueResult.volumetype = this._volumetype; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeDataVolumes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dssPoolId = undefined; + this._extendParam = undefined; + this._extendParams = undefined; + this._hwPassthrough = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._volumetype = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dssPoolId = value.dssPoolId; + this._extendParam = value.extendParam; + this._extendParams = value.extendParams; + this._hwPassthrough = value.hwPassthrough; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._volumetype = value.volumetype; + } + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: string; + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + public set extendParam(value: string) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // hw_passthrough - computed: false, optional: true, required: false + private _hwPassthrough?: boolean | cdktf.IResolvable; + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + public set hwPassthrough(value: boolean | cdktf.IResolvable) { + this._hwPassthrough = value; + } + public resetHwPassthrough() { + this._hwPassthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get hwPassthroughInput() { + return this._hwPassthrough; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volumetype - computed: false, optional: false, required: true + private _volumetype?: string; + public get volumetype() { + return this.getStringAttribute('volumetype'); + } + public set volumetype(value: string) { + this._volumetype = value; + } + // Temporarily expose input value. Use with caution. + public get volumetypeInput() { + return this._volumetype; + } +} + +export class CceNodeDataVolumesList extends cdktf.ComplexList { + public internalValue? : CceNodeDataVolumes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeDataVolumesOutputReference { + return new CceNodeDataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeExtendParams { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#agency_name CceNode#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#docker_base_size CceNode#docker_base_size} + */ + readonly dockerBaseSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#kube_reserved_mem CceNode#kube_reserved_mem} + */ + readonly kubeReservedMem?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#market_type CceNode#market_type} + */ + readonly marketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#max_pods CceNode#max_pods} + */ + readonly maxPods?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#nic_threshold CceNode#nic_threshold} + */ + readonly nicThreshold?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#node_image_id CceNode#node_image_id} + */ + readonly nodeImageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#node_multi_queue CceNode#node_multi_queue} + */ + readonly nodeMultiQueue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#postinstall CceNode#postinstall} + */ + readonly postinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#preinstall CceNode#preinstall} + */ + readonly preinstall?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#spot_price CceNode#spot_price} + */ + readonly spotPrice?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#system_reserved_mem CceNode#system_reserved_mem} + */ + readonly systemReservedMem?: number; +} + +export function cceNodeExtendParamsToTerraform(struct?: CceNodeExtendParamsOutputReference | CceNodeExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency_name: cdktf.stringToTerraform(struct!.agencyName), + docker_base_size: cdktf.numberToTerraform(struct!.dockerBaseSize), + kube_reserved_mem: cdktf.numberToTerraform(struct!.kubeReservedMem), + market_type: cdktf.stringToTerraform(struct!.marketType), + max_pods: cdktf.numberToTerraform(struct!.maxPods), + nic_threshold: cdktf.stringToTerraform(struct!.nicThreshold), + node_image_id: cdktf.stringToTerraform(struct!.nodeImageId), + node_multi_queue: cdktf.stringToTerraform(struct!.nodeMultiQueue), + postinstall: cdktf.stringToTerraform(struct!.postinstall), + preinstall: cdktf.stringToTerraform(struct!.preinstall), + spot_price: cdktf.stringToTerraform(struct!.spotPrice), + system_reserved_mem: cdktf.numberToTerraform(struct!.systemReservedMem), + } +} + + +export function cceNodeExtendParamsToHclTerraform(struct?: CceNodeExtendParamsOutputReference | CceNodeExtendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(struct!.agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + docker_base_size: { + value: cdktf.numberToHclTerraform(struct!.dockerBaseSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kube_reserved_mem: { + value: cdktf.numberToHclTerraform(struct!.kubeReservedMem), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + market_type: { + value: cdktf.stringToHclTerraform(struct!.marketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_pods: { + value: cdktf.numberToHclTerraform(struct!.maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + nic_threshold: { + value: cdktf.stringToHclTerraform(struct!.nicThreshold), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_image_id: { + value: cdktf.stringToHclTerraform(struct!.nodeImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_multi_queue: { + value: cdktf.stringToHclTerraform(struct!.nodeMultiQueue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + postinstall: { + value: cdktf.stringToHclTerraform(struct!.postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(struct!.preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spot_price: { + value: cdktf.stringToHclTerraform(struct!.spotPrice), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_reserved_mem: { + value: cdktf.numberToHclTerraform(struct!.systemReservedMem), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeExtendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeExtendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agencyName !== undefined) { + hasAnyValues = true; + internalValueResult.agencyName = this._agencyName; + } + if (this._dockerBaseSize !== undefined) { + hasAnyValues = true; + internalValueResult.dockerBaseSize = this._dockerBaseSize; + } + if (this._kubeReservedMem !== undefined) { + hasAnyValues = true; + internalValueResult.kubeReservedMem = this._kubeReservedMem; + } + if (this._marketType !== undefined) { + hasAnyValues = true; + internalValueResult.marketType = this._marketType; + } + if (this._maxPods !== undefined) { + hasAnyValues = true; + internalValueResult.maxPods = this._maxPods; + } + if (this._nicThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.nicThreshold = this._nicThreshold; + } + if (this._nodeImageId !== undefined) { + hasAnyValues = true; + internalValueResult.nodeImageId = this._nodeImageId; + } + if (this._nodeMultiQueue !== undefined) { + hasAnyValues = true; + internalValueResult.nodeMultiQueue = this._nodeMultiQueue; + } + if (this._postinstall !== undefined) { + hasAnyValues = true; + internalValueResult.postinstall = this._postinstall; + } + if (this._preinstall !== undefined) { + hasAnyValues = true; + internalValueResult.preinstall = this._preinstall; + } + if (this._spotPrice !== undefined) { + hasAnyValues = true; + internalValueResult.spotPrice = this._spotPrice; + } + if (this._systemReservedMem !== undefined) { + hasAnyValues = true; + internalValueResult.systemReservedMem = this._systemReservedMem; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeExtendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._agencyName = undefined; + this._dockerBaseSize = undefined; + this._kubeReservedMem = undefined; + this._marketType = undefined; + this._maxPods = undefined; + this._nicThreshold = undefined; + this._nodeImageId = undefined; + this._nodeMultiQueue = undefined; + this._postinstall = undefined; + this._preinstall = undefined; + this._spotPrice = undefined; + this._systemReservedMem = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._agencyName = value.agencyName; + this._dockerBaseSize = value.dockerBaseSize; + this._kubeReservedMem = value.kubeReservedMem; + this._marketType = value.marketType; + this._maxPods = value.maxPods; + this._nicThreshold = value.nicThreshold; + this._nodeImageId = value.nodeImageId; + this._nodeMultiQueue = value.nodeMultiQueue; + this._postinstall = value.postinstall; + this._preinstall = value.preinstall; + this._spotPrice = value.spotPrice; + this._systemReservedMem = value.systemReservedMem; + } + } + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // docker_base_size - computed: false, optional: true, required: false + private _dockerBaseSize?: number; + public get dockerBaseSize() { + return this.getNumberAttribute('docker_base_size'); + } + public set dockerBaseSize(value: number) { + this._dockerBaseSize = value; + } + public resetDockerBaseSize() { + this._dockerBaseSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerBaseSizeInput() { + return this._dockerBaseSize; + } + + // kube_reserved_mem - computed: false, optional: true, required: false + private _kubeReservedMem?: number; + public get kubeReservedMem() { + return this.getNumberAttribute('kube_reserved_mem'); + } + public set kubeReservedMem(value: number) { + this._kubeReservedMem = value; + } + public resetKubeReservedMem() { + this._kubeReservedMem = undefined; + } + // Temporarily expose input value. Use with caution. + public get kubeReservedMemInput() { + return this._kubeReservedMem; + } + + // market_type - computed: false, optional: true, required: false + private _marketType?: string; + public get marketType() { + return this.getStringAttribute('market_type'); + } + public set marketType(value: string) { + this._marketType = value; + } + public resetMarketType() { + this._marketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get marketTypeInput() { + return this._marketType; + } + + // max_pods - computed: false, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // nic_threshold - computed: false, optional: true, required: false + private _nicThreshold?: string; + public get nicThreshold() { + return this.getStringAttribute('nic_threshold'); + } + public set nicThreshold(value: string) { + this._nicThreshold = value; + } + public resetNicThreshold() { + this._nicThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get nicThresholdInput() { + return this._nicThreshold; + } + + // node_image_id - computed: false, optional: true, required: false + private _nodeImageId?: string; + public get nodeImageId() { + return this.getStringAttribute('node_image_id'); + } + public set nodeImageId(value: string) { + this._nodeImageId = value; + } + public resetNodeImageId() { + this._nodeImageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeImageIdInput() { + return this._nodeImageId; + } + + // node_multi_queue - computed: false, optional: true, required: false + private _nodeMultiQueue?: string; + public get nodeMultiQueue() { + return this.getStringAttribute('node_multi_queue'); + } + public set nodeMultiQueue(value: string) { + this._nodeMultiQueue = value; + } + public resetNodeMultiQueue() { + this._nodeMultiQueue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeMultiQueueInput() { + return this._nodeMultiQueue; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // spot_price - computed: false, optional: true, required: false + private _spotPrice?: string; + public get spotPrice() { + return this.getStringAttribute('spot_price'); + } + public set spotPrice(value: string) { + this._spotPrice = value; + } + public resetSpotPrice() { + this._spotPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotPriceInput() { + return this._spotPrice; + } + + // system_reserved_mem - computed: false, optional: true, required: false + private _systemReservedMem?: number; + public get systemReservedMem() { + return this.getNumberAttribute('system_reserved_mem'); + } + public set systemReservedMem(value: number) { + this._systemReservedMem = value; + } + public resetSystemReservedMem() { + this._systemReservedMem = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemReservedMemInput() { + return this._systemReservedMem; + } +} +export interface CceNodeExtensionNics { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#subnet_id CceNode#subnet_id} + */ + readonly subnetId: string; +} + +export function cceNodeExtensionNicsToTerraform(struct?: CceNodeExtensionNics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function cceNodeExtensionNicsToHclTerraform(struct?: CceNodeExtensionNics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeExtensionNicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeExtensionNics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeExtensionNics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._subnetId = value.subnetId; + } + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class CceNodeExtensionNicsList extends cdktf.ComplexList { + public internalValue? : CceNodeExtensionNics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeExtensionNicsOutputReference { + return new CceNodeExtensionNicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeHostnameConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#type CceNode#type} + */ + readonly type: string; +} + +export function cceNodeHostnameConfigToTerraform(struct?: CceNodeHostnameConfigOutputReference | CceNodeHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodeHostnameConfigToHclTerraform(struct?: CceNodeHostnameConfigOutputReference | CceNodeHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeHostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeHostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeHostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CceNodeRootVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#dss_pool_id CceNode#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_param CceNode#extend_param} + */ + readonly extendParam?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#extend_params CceNode#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#hw_passthrough CceNode#hw_passthrough} + */ + readonly hwPassthrough?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#kms_key_id CceNode#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#size CceNode#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#volumetype CceNode#volumetype} + */ + readonly volumetype: string; +} + +export function cceNodeRootVolumeToTerraform(struct?: CceNodeRootVolumeOutputReference | CceNodeRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + extend_param: cdktf.stringToTerraform(struct!.extendParam), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParams), + hw_passthrough: cdktf.booleanToTerraform(struct!.hwPassthrough), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + volumetype: cdktf.stringToTerraform(struct!.volumetype), + } +} + + +export function cceNodeRootVolumeToHclTerraform(struct?: CceNodeRootVolumeOutputReference | CceNodeRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.stringToHclTerraform(struct!.extendParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + hw_passthrough: { + value: cdktf.booleanToHclTerraform(struct!.hwPassthrough), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volumetype: { + value: cdktf.stringToHclTerraform(struct!.volumetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._extendParams !== undefined) { + hasAnyValues = true; + internalValueResult.extendParams = this._extendParams; + } + if (this._hwPassthrough !== undefined) { + hasAnyValues = true; + internalValueResult.hwPassthrough = this._hwPassthrough; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumetype !== undefined) { + hasAnyValues = true; + internalValueResult.volumetype = this._volumetype; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dssPoolId = undefined; + this._extendParam = undefined; + this._extendParams = undefined; + this._hwPassthrough = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._volumetype = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dssPoolId = value.dssPoolId; + this._extendParam = value.extendParam; + this._extendParams = value.extendParams; + this._hwPassthrough = value.hwPassthrough; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._volumetype = value.volumetype; + } + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: string; + public get extendParam() { + return this.getStringAttribute('extend_param'); + } + public set extendParam(value: string) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // hw_passthrough - computed: false, optional: true, required: false + private _hwPassthrough?: boolean | cdktf.IResolvable; + public get hwPassthrough() { + return this.getBooleanAttribute('hw_passthrough'); + } + public set hwPassthrough(value: boolean | cdktf.IResolvable) { + this._hwPassthrough = value; + } + public resetHwPassthrough() { + this._hwPassthrough = undefined; + } + // Temporarily expose input value. Use with caution. + public get hwPassthroughInput() { + return this._hwPassthrough; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volumetype - computed: false, optional: false, required: true + private _volumetype?: string; + public get volumetype() { + return this.getStringAttribute('volumetype'); + } + public set volumetype(value: string) { + this._volumetype = value; + } + // Temporarily expose input value. Use with caution. + public get volumetypeInput() { + return this._volumetype; + } +} +export interface CceNodeStorageGroupsVirtualSpaces { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#lvm_lv_type CceNode#lvm_lv_type} + */ + readonly lvmLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#lvm_path CceNode#lvm_path} + */ + readonly lvmPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#name CceNode#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#runtime_lv_type CceNode#runtime_lv_type} + */ + readonly runtimeLvType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#size CceNode#size} + */ + readonly size: string; +} + +export function cceNodeStorageGroupsVirtualSpacesToTerraform(struct?: CceNodeStorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + lvm_lv_type: cdktf.stringToTerraform(struct!.lvmLvType), + lvm_path: cdktf.stringToTerraform(struct!.lvmPath), + name: cdktf.stringToTerraform(struct!.name), + runtime_lv_type: cdktf.stringToTerraform(struct!.runtimeLvType), + size: cdktf.stringToTerraform(struct!.size), + } +} + + +export function cceNodeStorageGroupsVirtualSpacesToHclTerraform(struct?: CceNodeStorageGroupsVirtualSpaces | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + lvm_lv_type: { + value: cdktf.stringToHclTerraform(struct!.lvmLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lvm_path: { + value: cdktf.stringToHclTerraform(struct!.lvmPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_lv_type: { + value: cdktf.stringToHclTerraform(struct!.runtimeLvType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.stringToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeStorageGroupsVirtualSpacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeStorageGroupsVirtualSpaces | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._lvmLvType !== undefined) { + hasAnyValues = true; + internalValueResult.lvmLvType = this._lvmLvType; + } + if (this._lvmPath !== undefined) { + hasAnyValues = true; + internalValueResult.lvmPath = this._lvmPath; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._runtimeLvType !== undefined) { + hasAnyValues = true; + internalValueResult.runtimeLvType = this._runtimeLvType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeStorageGroupsVirtualSpaces | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._lvmLvType = undefined; + this._lvmPath = undefined; + this._name = undefined; + this._runtimeLvType = undefined; + this._size = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._lvmLvType = value.lvmLvType; + this._lvmPath = value.lvmPath; + this._name = value.name; + this._runtimeLvType = value.runtimeLvType; + this._size = value.size; + } + } + + // lvm_lv_type - computed: false, optional: true, required: false + private _lvmLvType?: string; + public get lvmLvType() { + return this.getStringAttribute('lvm_lv_type'); + } + public set lvmLvType(value: string) { + this._lvmLvType = value; + } + public resetLvmLvType() { + this._lvmLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmLvTypeInput() { + return this._lvmLvType; + } + + // lvm_path - computed: false, optional: true, required: false + private _lvmPath?: string; + public get lvmPath() { + return this.getStringAttribute('lvm_path'); + } + public set lvmPath(value: string) { + this._lvmPath = value; + } + public resetLvmPath() { + this._lvmPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get lvmPathInput() { + return this._lvmPath; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // runtime_lv_type - computed: false, optional: true, required: false + private _runtimeLvType?: string; + public get runtimeLvType() { + return this.getStringAttribute('runtime_lv_type'); + } + public set runtimeLvType(value: string) { + this._runtimeLvType = value; + } + public resetRuntimeLvType() { + this._runtimeLvType = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeLvTypeInput() { + return this._runtimeLvType; + } + + // size - computed: false, optional: false, required: true + private _size?: string; + public get size() { + return this.getStringAttribute('size'); + } + public set size(value: string) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} + +export class CceNodeStorageGroupsVirtualSpacesList extends cdktf.ComplexList { + public internalValue? : CceNodeStorageGroupsVirtualSpaces[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeStorageGroupsVirtualSpacesOutputReference { + return new CceNodeStorageGroupsVirtualSpacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeStorageGroups { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#cce_managed CceNode#cce_managed} + */ + readonly cceManaged?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#name CceNode#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#selector_names CceNode#selector_names} + */ + readonly selectorNames: string[]; + /** + * virtual_spaces block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#virtual_spaces CceNode#virtual_spaces} + */ + readonly virtualSpaces: CceNodeStorageGroupsVirtualSpaces[] | cdktf.IResolvable; +} + +export function cceNodeStorageGroupsToTerraform(struct?: CceNodeStorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cce_managed: cdktf.booleanToTerraform(struct!.cceManaged), + name: cdktf.stringToTerraform(struct!.name), + selector_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.selectorNames), + virtual_spaces: cdktf.listMapper(cceNodeStorageGroupsVirtualSpacesToTerraform, true)(struct!.virtualSpaces), + } +} + + +export function cceNodeStorageGroupsToHclTerraform(struct?: CceNodeStorageGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cce_managed: { + value: cdktf.booleanToHclTerraform(struct!.cceManaged), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + selector_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.selectorNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + virtual_spaces: { + value: cdktf.listMapperHcl(cceNodeStorageGroupsVirtualSpacesToHclTerraform, true)(struct!.virtualSpaces), + isBlock: true, + type: "list", + storageClassType: "CceNodeStorageGroupsVirtualSpacesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeStorageGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeStorageGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cceManaged !== undefined) { + hasAnyValues = true; + internalValueResult.cceManaged = this._cceManaged; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._selectorNames !== undefined) { + hasAnyValues = true; + internalValueResult.selectorNames = this._selectorNames; + } + if (this._virtualSpaces?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.virtualSpaces = this._virtualSpaces?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeStorageGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cceManaged = undefined; + this._name = undefined; + this._selectorNames = undefined; + this._virtualSpaces.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cceManaged = value.cceManaged; + this._name = value.name; + this._selectorNames = value.selectorNames; + this._virtualSpaces.internalValue = value.virtualSpaces; + } + } + + // cce_managed - computed: false, optional: true, required: false + private _cceManaged?: boolean | cdktf.IResolvable; + public get cceManaged() { + return this.getBooleanAttribute('cce_managed'); + } + public set cceManaged(value: boolean | cdktf.IResolvable) { + this._cceManaged = value; + } + public resetCceManaged() { + this._cceManaged = undefined; + } + // Temporarily expose input value. Use with caution. + public get cceManagedInput() { + return this._cceManaged; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // selector_names - computed: false, optional: false, required: true + private _selectorNames?: string[]; + public get selectorNames() { + return this.getListAttribute('selector_names'); + } + public set selectorNames(value: string[]) { + this._selectorNames = value; + } + // Temporarily expose input value. Use with caution. + public get selectorNamesInput() { + return this._selectorNames; + } + + // virtual_spaces - computed: false, optional: false, required: true + private _virtualSpaces = new CceNodeStorageGroupsVirtualSpacesList(this, "virtual_spaces", false); + public get virtualSpaces() { + return this._virtualSpaces; + } + public putVirtualSpaces(value: CceNodeStorageGroupsVirtualSpaces[] | cdktf.IResolvable) { + this._virtualSpaces.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get virtualSpacesInput() { + return this._virtualSpaces.internalValue; + } +} + +export class CceNodeStorageGroupsList extends cdktf.ComplexList { + public internalValue? : CceNodeStorageGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeStorageGroupsOutputReference { + return new CceNodeStorageGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeStorageSelectors { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#match_label_count CceNode#match_label_count} + */ + readonly matchLabelCount?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#match_label_metadata_cmkid CceNode#match_label_metadata_cmkid} + */ + readonly matchLabelMetadataCmkid?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#match_label_metadata_encrypted CceNode#match_label_metadata_encrypted} + */ + readonly matchLabelMetadataEncrypted?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#match_label_size CceNode#match_label_size} + */ + readonly matchLabelSize?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#match_label_volume_type CceNode#match_label_volume_type} + */ + readonly matchLabelVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#name CceNode#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#type CceNode#type} + */ + readonly type?: string; +} + +export function cceNodeStorageSelectorsToTerraform(struct?: CceNodeStorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_label_count: cdktf.stringToTerraform(struct!.matchLabelCount), + match_label_metadata_cmkid: cdktf.stringToTerraform(struct!.matchLabelMetadataCmkid), + match_label_metadata_encrypted: cdktf.stringToTerraform(struct!.matchLabelMetadataEncrypted), + match_label_size: cdktf.stringToTerraform(struct!.matchLabelSize), + match_label_volume_type: cdktf.stringToTerraform(struct!.matchLabelVolumeType), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cceNodeStorageSelectorsToHclTerraform(struct?: CceNodeStorageSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_label_count: { + value: cdktf.stringToHclTerraform(struct!.matchLabelCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_cmkid: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataCmkid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_metadata_encrypted: { + value: cdktf.stringToHclTerraform(struct!.matchLabelMetadataEncrypted), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_size: { + value: cdktf.stringToHclTerraform(struct!.matchLabelSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_label_volume_type: { + value: cdktf.stringToHclTerraform(struct!.matchLabelVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeStorageSelectorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeStorageSelectors | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchLabelCount !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelCount = this._matchLabelCount; + } + if (this._matchLabelMetadataCmkid !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataCmkid = this._matchLabelMetadataCmkid; + } + if (this._matchLabelMetadataEncrypted !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelMetadataEncrypted = this._matchLabelMetadataEncrypted; + } + if (this._matchLabelSize !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelSize = this._matchLabelSize; + } + if (this._matchLabelVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.matchLabelVolumeType = this._matchLabelVolumeType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeStorageSelectors | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchLabelCount = undefined; + this._matchLabelMetadataCmkid = undefined; + this._matchLabelMetadataEncrypted = undefined; + this._matchLabelSize = undefined; + this._matchLabelVolumeType = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchLabelCount = value.matchLabelCount; + this._matchLabelMetadataCmkid = value.matchLabelMetadataCmkid; + this._matchLabelMetadataEncrypted = value.matchLabelMetadataEncrypted; + this._matchLabelSize = value.matchLabelSize; + this._matchLabelVolumeType = value.matchLabelVolumeType; + this._name = value.name; + this._type = value.type; + } + } + + // match_label_count - computed: false, optional: true, required: false + private _matchLabelCount?: string; + public get matchLabelCount() { + return this.getStringAttribute('match_label_count'); + } + public set matchLabelCount(value: string) { + this._matchLabelCount = value; + } + public resetMatchLabelCount() { + this._matchLabelCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelCountInput() { + return this._matchLabelCount; + } + + // match_label_metadata_cmkid - computed: false, optional: true, required: false + private _matchLabelMetadataCmkid?: string; + public get matchLabelMetadataCmkid() { + return this.getStringAttribute('match_label_metadata_cmkid'); + } + public set matchLabelMetadataCmkid(value: string) { + this._matchLabelMetadataCmkid = value; + } + public resetMatchLabelMetadataCmkid() { + this._matchLabelMetadataCmkid = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataCmkidInput() { + return this._matchLabelMetadataCmkid; + } + + // match_label_metadata_encrypted - computed: false, optional: true, required: false + private _matchLabelMetadataEncrypted?: string; + public get matchLabelMetadataEncrypted() { + return this.getStringAttribute('match_label_metadata_encrypted'); + } + public set matchLabelMetadataEncrypted(value: string) { + this._matchLabelMetadataEncrypted = value; + } + public resetMatchLabelMetadataEncrypted() { + this._matchLabelMetadataEncrypted = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelMetadataEncryptedInput() { + return this._matchLabelMetadataEncrypted; + } + + // match_label_size - computed: false, optional: true, required: false + private _matchLabelSize?: string; + public get matchLabelSize() { + return this.getStringAttribute('match_label_size'); + } + public set matchLabelSize(value: string) { + this._matchLabelSize = value; + } + public resetMatchLabelSize() { + this._matchLabelSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelSizeInput() { + return this._matchLabelSize; + } + + // match_label_volume_type - computed: false, optional: true, required: false + private _matchLabelVolumeType?: string; + public get matchLabelVolumeType() { + return this.getStringAttribute('match_label_volume_type'); + } + public set matchLabelVolumeType(value: string) { + this._matchLabelVolumeType = value; + } + public resetMatchLabelVolumeType() { + this._matchLabelVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchLabelVolumeTypeInput() { + return this._matchLabelVolumeType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CceNodeStorageSelectorsList extends cdktf.ComplexList { + public internalValue? : CceNodeStorageSelectors[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeStorageSelectorsOutputReference { + return new CceNodeStorageSelectorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeStorage { + /** + * groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#groups CceNode#groups} + */ + readonly groups: CceNodeStorageGroups[] | cdktf.IResolvable; + /** + * selectors block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#selectors CceNode#selectors} + */ + readonly selectors: CceNodeStorageSelectors[] | cdktf.IResolvable; +} + +export function cceNodeStorageToTerraform(struct?: CceNodeStorageOutputReference | CceNodeStorage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + groups: cdktf.listMapper(cceNodeStorageGroupsToTerraform, true)(struct!.groups), + selectors: cdktf.listMapper(cceNodeStorageSelectorsToTerraform, true)(struct!.selectors), + } +} + + +export function cceNodeStorageToHclTerraform(struct?: CceNodeStorageOutputReference | CceNodeStorage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + groups: { + value: cdktf.listMapperHcl(cceNodeStorageGroupsToHclTerraform, true)(struct!.groups), + isBlock: true, + type: "list", + storageClassType: "CceNodeStorageGroupsList", + }, + selectors: { + value: cdktf.listMapperHcl(cceNodeStorageSelectorsToHclTerraform, true)(struct!.selectors), + isBlock: true, + type: "list", + storageClassType: "CceNodeStorageSelectorsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeStorageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CceNodeStorage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groups?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.groups = this._groups?.internalValue; + } + if (this._selectors?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.selectors = this._selectors?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeStorage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groups.internalValue = undefined; + this._selectors.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groups.internalValue = value.groups; + this._selectors.internalValue = value.selectors; + } + } + + // groups - computed: false, optional: false, required: true + private _groups = new CceNodeStorageGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + public putGroups(value: CceNodeStorageGroups[] | cdktf.IResolvable) { + this._groups.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get groupsInput() { + return this._groups.internalValue; + } + + // selectors - computed: false, optional: false, required: true + private _selectors = new CceNodeStorageSelectorsList(this, "selectors", false); + public get selectors() { + return this._selectors; + } + public putSelectors(value: CceNodeStorageSelectors[] | cdktf.IResolvable) { + this._selectors.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get selectorsInput() { + return this._selectors.internalValue; + } +} +export interface CceNodeTaints { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#effect CceNode#effect} + */ + readonly effect: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#key CceNode#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#value CceNode#value} + */ + readonly value?: string; +} + +export function cceNodeTaintsToTerraform(struct?: CceNodeTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + effect: cdktf.stringToTerraform(struct!.effect), + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cceNodeTaintsToHclTerraform(struct?: CceNodeTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + effect: { + value: cdktf.stringToHclTerraform(struct!.effect), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeTaintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CceNodeTaints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._effect !== undefined) { + hasAnyValues = true; + internalValueResult.effect = this._effect; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeTaints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._effect = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._effect = value.effect; + this._key = value.key; + this._value = value.value; + } + } + + // effect - computed: false, optional: false, required: true + private _effect?: string; + public get effect() { + return this.getStringAttribute('effect'); + } + public set effect(value: string) { + this._effect = value; + } + // Temporarily expose input value. Use with caution. + public get effectInput() { + return this._effect; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CceNodeTaintsList extends cdktf.ComplexList { + public internalValue? : CceNodeTaints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CceNodeTaintsOutputReference { + return new CceNodeTaintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CceNodeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#create CceNode#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#delete CceNode#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#update CceNode#update} + */ + readonly update?: string; +} + +export function cceNodeTimeoutsToTerraform(struct?: CceNodeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cceNodeTimeoutsToHclTerraform(struct?: CceNodeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CceNodeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CceNodeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CceNodeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node huaweicloud_cce_node} +*/ +export class CceNode extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CceNode resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CceNode to import + * @param importFromId The id of the existing CceNode that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CceNode to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_node huaweicloud_cce_node} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CceNodeConfig + */ + public constructor(scope: Construct, id: string, config: CceNodeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._annotations = config.annotations; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._bandwidthChargeMode = config.bandwidthChargeMode; + this._bandwidthSize = config.bandwidthSize; + this._billingMode = config.billingMode; + this._chargingMode = config.chargingMode; + this._clusterId = config.clusterId; + this._dedicatedHostId = config.dedicatedHostId; + this._ecsGroupId = config.ecsGroupId; + this._ecsPerformanceType = config.ecsPerformanceType; + this._eipId = config.eipId; + this._eipIds = config.eipIds; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extendParam = config.extendParam; + this._extendParamChargingMode = config.extendParamChargingMode; + this._fixedIp = config.fixedIp; + this._flavorId = config.flavorId; + this._id = config.id; + this._initializedConditions = config.initializedConditions; + this._iptype = config.iptype; + this._keepEcs = config.keepEcs; + this._keyPair = config.keyPair; + this._labels = config.labels; + this._maxPods = config.maxPods; + this._name = config.name; + this._orderId = config.orderId; + this._os = config.os; + this._partition = config.partition; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._postinstall = config.postinstall; + this._preinstall = config.preinstall; + this._privateKey = config.privateKey; + this._productId = config.productId; + this._publicKey = config.publicKey; + this._region = config.region; + this._runtime = config.runtime; + this._sharetype = config.sharetype; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._dataVolumes.internalValue = config.dataVolumes; + this._extendParams.internalValue = config.extendParams; + this._extensionNics.internalValue = config.extensionNics; + this._hostnameConfig.internalValue = config.hostnameConfig; + this._rootVolume.internalValue = config.rootVolume; + this._storage.internalValue = config.storage; + this._taints.internalValue = config.taints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // bandwidth_charge_mode - computed: false, optional: true, required: false + private _bandwidthChargeMode?: string; + public get bandwidthChargeMode() { + return this.getStringAttribute('bandwidth_charge_mode'); + } + public set bandwidthChargeMode(value: string) { + this._bandwidthChargeMode = value; + } + public resetBandwidthChargeMode() { + this._bandwidthChargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthChargeModeInput() { + return this._bandwidthChargeMode; + } + + // bandwidth_size - computed: false, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // billing_mode - computed: true, optional: true, required: false + private _billingMode?: number; + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + public set billingMode(value: number) { + this._billingMode = value; + } + public resetBillingMode() { + this._billingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get billingModeInput() { + return this._billingMode; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // dedicated_host_id - computed: false, optional: true, required: false + private _dedicatedHostId?: string; + public get dedicatedHostId() { + return this.getStringAttribute('dedicated_host_id'); + } + public set dedicatedHostId(value: string) { + this._dedicatedHostId = value; + } + public resetDedicatedHostId() { + this._dedicatedHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedHostIdInput() { + return this._dedicatedHostId; + } + + // ecs_group_id - computed: false, optional: true, required: false + private _ecsGroupId?: string; + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + public set ecsGroupId(value: string) { + this._ecsGroupId = value; + } + public resetEcsGroupId() { + this._ecsGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsGroupIdInput() { + return this._ecsGroupId; + } + + // ecs_performance_type - computed: false, optional: true, required: false + private _ecsPerformanceType?: string; + public get ecsPerformanceType() { + return this.getStringAttribute('ecs_performance_type'); + } + public set ecsPerformanceType(value: string) { + this._ecsPerformanceType = value; + } + public resetEcsPerformanceType() { + this._ecsPerformanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsPerformanceTypeInput() { + return this._ecsPerformanceType; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // eip_ids - computed: false, optional: true, required: false + private _eipIds?: string[]; + public get eipIds() { + return cdktf.Fn.tolist(this.getListAttribute('eip_ids')); + } + public set eipIds(value: string[]) { + this._eipIds = value; + } + public resetEipIds() { + this._eipIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdsInput() { + return this._eipIds; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // extend_param_charging_mode - computed: false, optional: true, required: false + private _extendParamChargingMode?: number; + public get extendParamChargingMode() { + return this.getNumberAttribute('extend_param_charging_mode'); + } + public set extendParamChargingMode(value: number) { + this._extendParamChargingMode = value; + } + public resetExtendParamChargingMode() { + this._extendParamChargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamChargingModeInput() { + return this._extendParamChargingMode; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // initialized_conditions - computed: true, optional: true, required: false + private _initializedConditions?: string[]; + public get initializedConditions() { + return this.getListAttribute('initialized_conditions'); + } + public set initializedConditions(value: string[]) { + this._initializedConditions = value; + } + public resetInitializedConditions() { + this._initializedConditions = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializedConditionsInput() { + return this._initializedConditions; + } + + // iptype - computed: false, optional: true, required: false + private _iptype?: string; + public get iptype() { + return this.getStringAttribute('iptype'); + } + public set iptype(value: string) { + this._iptype = value; + } + public resetIptype() { + this._iptype = undefined; + } + // Temporarily expose input value. Use with caution. + public get iptypeInput() { + return this._iptype; + } + + // keep_ecs - computed: false, optional: true, required: false + private _keepEcs?: boolean | cdktf.IResolvable; + public get keepEcs() { + return this.getBooleanAttribute('keep_ecs'); + } + public set keepEcs(value: boolean | cdktf.IResolvable) { + this._keepEcs = value; + } + public resetKeepEcs() { + this._keepEcs = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepEcsInput() { + return this._keepEcs; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // max_pods - computed: false, optional: true, required: false + private _maxPods?: number; + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + public set maxPods(value: number) { + this._maxPods = value; + } + public resetMaxPods() { + this._maxPods = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPodsInput() { + return this._maxPods; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: false, optional: true, required: false + private _orderId?: string; + public get orderId() { + return this.getStringAttribute('order_id'); + } + public set orderId(value: string) { + this._orderId = value; + } + public resetOrderId() { + this._orderId = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderIdInput() { + return this._orderId; + } + + // os - computed: true, optional: true, required: false + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + public resetOs() { + this._os = undefined; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // partition - computed: false, optional: true, required: false + private _partition?: string; + public get partition() { + return this.getStringAttribute('partition'); + } + public set partition(value: string) { + this._partition = value; + } + public resetPartition() { + this._partition = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionInput() { + return this._partition; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // postinstall - computed: false, optional: true, required: false + private _postinstall?: string; + public get postinstall() { + return this.getStringAttribute('postinstall'); + } + public set postinstall(value: string) { + this._postinstall = value; + } + public resetPostinstall() { + this._postinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postinstallInput() { + return this._postinstall; + } + + // preinstall - computed: false, optional: true, required: false + private _preinstall?: string; + public get preinstall() { + return this.getStringAttribute('preinstall'); + } + public set preinstall(value: string) { + this._preinstall = value; + } + public resetPreinstall() { + this._preinstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get preinstallInput() { + return this._preinstall; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // public_key - computed: false, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: true, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // sharetype - computed: false, optional: true, required: false + private _sharetype?: string; + public get sharetype() { + return this.getStringAttribute('sharetype'); + } + public set sharetype(value: string) { + this._sharetype = value; + } + public resetSharetype() { + this._sharetype = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharetypeInput() { + return this._sharetype; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // data_volumes - computed: false, optional: true, required: false + private _dataVolumes = new CceNodeDataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + public putDataVolumes(value: CceNodeDataVolumes[] | cdktf.IResolvable) { + this._dataVolumes.internalValue = value; + } + public resetDataVolumes() { + this._dataVolumes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumesInput() { + return this._dataVolumes.internalValue; + } + + // extend_params - computed: false, optional: true, required: false + private _extendParams = new CceNodeExtendParamsOutputReference(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + public putExtendParams(value: CceNodeExtendParams) { + this._extendParams.internalValue = value; + } + public resetExtendParams() { + this._extendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams.internalValue; + } + + // extension_nics - computed: false, optional: true, required: false + private _extensionNics = new CceNodeExtensionNicsList(this, "extension_nics", false); + public get extensionNics() { + return this._extensionNics; + } + public putExtensionNics(value: CceNodeExtensionNics[] | cdktf.IResolvable) { + this._extensionNics.internalValue = value; + } + public resetExtensionNics() { + this._extensionNics.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionNicsInput() { + return this._extensionNics.internalValue; + } + + // hostname_config - computed: false, optional: true, required: false + private _hostnameConfig = new CceNodeHostnameConfigOutputReference(this, "hostname_config"); + public get hostnameConfig() { + return this._hostnameConfig; + } + public putHostnameConfig(value: CceNodeHostnameConfig) { + this._hostnameConfig.internalValue = value; + } + public resetHostnameConfig() { + this._hostnameConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostnameConfigInput() { + return this._hostnameConfig.internalValue; + } + + // root_volume - computed: false, optional: false, required: true + private _rootVolume = new CceNodeRootVolumeOutputReference(this, "root_volume"); + public get rootVolume() { + return this._rootVolume; + } + public putRootVolume(value: CceNodeRootVolume) { + this._rootVolume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeInput() { + return this._rootVolume.internalValue; + } + + // storage - computed: false, optional: true, required: false + private _storage = new CceNodeStorageOutputReference(this, "storage"); + public get storage() { + return this._storage; + } + public putStorage(value: CceNodeStorage) { + this._storage.internalValue = value; + } + public resetStorage() { + this._storage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage.internalValue; + } + + // taints - computed: false, optional: true, required: false + private _taints = new CceNodeTaintsList(this, "taints", false); + public get taints() { + return this._taints; + } + public putTaints(value: CceNodeTaints[] | cdktf.IResolvable) { + this._taints.internalValue = value; + } + public resetTaints() { + this._taints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get taintsInput() { + return this._taints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CceNodeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CceNodeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + bandwidth_charge_mode: cdktf.stringToTerraform(this._bandwidthChargeMode), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + billing_mode: cdktf.numberToTerraform(this._billingMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cluster_id: cdktf.stringToTerraform(this._clusterId), + dedicated_host_id: cdktf.stringToTerraform(this._dedicatedHostId), + ecs_group_id: cdktf.stringToTerraform(this._ecsGroupId), + ecs_performance_type: cdktf.stringToTerraform(this._ecsPerformanceType), + eip_id: cdktf.stringToTerraform(this._eipId), + eip_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._eipIds), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(this._extendParam), + extend_param_charging_mode: cdktf.numberToTerraform(this._extendParamChargingMode), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + initialized_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._initializedConditions), + iptype: cdktf.stringToTerraform(this._iptype), + keep_ecs: cdktf.booleanToTerraform(this._keepEcs), + key_pair: cdktf.stringToTerraform(this._keyPair), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + max_pods: cdktf.numberToTerraform(this._maxPods), + name: cdktf.stringToTerraform(this._name), + order_id: cdktf.stringToTerraform(this._orderId), + os: cdktf.stringToTerraform(this._os), + partition: cdktf.stringToTerraform(this._partition), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + postinstall: cdktf.stringToTerraform(this._postinstall), + preinstall: cdktf.stringToTerraform(this._preinstall), + private_key: cdktf.stringToTerraform(this._privateKey), + product_id: cdktf.stringToTerraform(this._productId), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + sharetype: cdktf.stringToTerraform(this._sharetype), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + data_volumes: cdktf.listMapper(cceNodeDataVolumesToTerraform, true)(this._dataVolumes.internalValue), + extend_params: cceNodeExtendParamsToTerraform(this._extendParams.internalValue), + extension_nics: cdktf.listMapper(cceNodeExtensionNicsToTerraform, true)(this._extensionNics.internalValue), + hostname_config: cceNodeHostnameConfigToTerraform(this._hostnameConfig.internalValue), + root_volume: cceNodeRootVolumeToTerraform(this._rootVolume.internalValue), + storage: cceNodeStorageToTerraform(this._storage.internalValue), + taints: cdktf.listMapper(cceNodeTaintsToTerraform, true)(this._taints.internalValue), + timeouts: cceNodeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_charge_mode: { + value: cdktf.stringToHclTerraform(this._bandwidthChargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + billing_mode: { + value: cdktf.numberToHclTerraform(this._billingMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_host_id: { + value: cdktf.stringToHclTerraform(this._dedicatedHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_group_id: { + value: cdktf.stringToHclTerraform(this._ecsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_performance_type: { + value: cdktf.stringToHclTerraform(this._ecsPerformanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._eipIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + extend_param_charging_mode: { + value: cdktf.numberToHclTerraform(this._extendParamChargingMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initialized_conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._initializedConditions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + iptype: { + value: cdktf.stringToHclTerraform(this._iptype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_ecs: { + value: cdktf.booleanToHclTerraform(this._keepEcs), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + max_pods: { + value: cdktf.numberToHclTerraform(this._maxPods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + order_id: { + value: cdktf.stringToHclTerraform(this._orderId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition: { + value: cdktf.stringToHclTerraform(this._partition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + postinstall: { + value: cdktf.stringToHclTerraform(this._postinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + preinstall: { + value: cdktf.stringToHclTerraform(this._preinstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sharetype: { + value: cdktf.stringToHclTerraform(this._sharetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + data_volumes: { + value: cdktf.listMapperHcl(cceNodeDataVolumesToHclTerraform, true)(this._dataVolumes.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeDataVolumesList", + }, + extend_params: { + value: cceNodeExtendParamsToHclTerraform(this._extendParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeExtendParamsList", + }, + extension_nics: { + value: cdktf.listMapperHcl(cceNodeExtensionNicsToHclTerraform, true)(this._extensionNics.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeExtensionNicsList", + }, + hostname_config: { + value: cceNodeHostnameConfigToHclTerraform(this._hostnameConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeHostnameConfigList", + }, + root_volume: { + value: cceNodeRootVolumeToHclTerraform(this._rootVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeRootVolumeList", + }, + storage: { + value: cceNodeStorageToHclTerraform(this._storage.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeStorageList", + }, + taints: { + value: cdktf.listMapperHcl(cceNodeTaintsToHclTerraform, true)(this._taints.internalValue), + isBlock: true, + type: "list", + storageClassType: "CceNodeTaintsList", + }, + timeouts: { + value: cceNodeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CceNodeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-partition/README.md b/src/constructs/providers/huaweicloud/cce-partition/README.md new file mode 100644 index 00000000..17be1075 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-partition/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_partition` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_partition`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition). diff --git a/src/constructs/providers/huaweicloud/cce-partition/index.ts b/src/constructs/providers/huaweicloud/cce-partition/index.ts new file mode 100644 index 00000000..e1e7d54c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-partition/index.ts @@ -0,0 +1,393 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcePartitionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#availability_zone CcePartition#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#category CcePartition#category} + */ + readonly category: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#cluster_id CcePartition#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#container_subnet_ids CcePartition#container_subnet_ids} + */ + readonly containerSubnetIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#id CcePartition#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#partition_subnet_id CcePartition#partition_subnet_id} + */ + readonly partitionSubnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#region CcePartition#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#timeouts CcePartition#timeouts} + */ + readonly timeouts?: CcePartitionTimeouts; +} +export interface CcePartitionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#create CcePartition#create} + */ + readonly create?: string; +} + +export function ccePartitionTimeoutsToTerraform(struct?: CcePartitionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ccePartitionTimeoutsToHclTerraform(struct?: CcePartitionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcePartitionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcePartitionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcePartitionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition huaweicloud_cce_partition} +*/ +export class CcePartition extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_partition"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcePartition resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcePartition to import + * @param importFromId The id of the existing CcePartition that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcePartition to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_partition", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_partition huaweicloud_cce_partition} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcePartitionConfig + */ + public constructor(scope: Construct, id: string, config: CcePartitionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_partition', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._category = config.category; + this._clusterId = config.clusterId; + this._containerSubnetIds = config.containerSubnetIds; + this._id = config.id; + this._partitionSubnetId = config.partitionSubnetId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // category - computed: false, optional: false, required: true + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // container_subnet_ids - computed: false, optional: false, required: true + private _containerSubnetIds?: string[]; + public get containerSubnetIds() { + return cdktf.Fn.tolist(this.getListAttribute('container_subnet_ids')); + } + public set containerSubnetIds(value: string[]) { + this._containerSubnetIds = value; + } + // Temporarily expose input value. Use with caution. + public get containerSubnetIdsInput() { + return this._containerSubnetIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // partition_subnet_id - computed: false, optional: false, required: true + private _partitionSubnetId?: string; + public get partitionSubnetId() { + return this.getStringAttribute('partition_subnet_id'); + } + public set partitionSubnetId(value: string) { + this._partitionSubnetId = value; + } + // Temporarily expose input value. Use with caution. + public get partitionSubnetIdInput() { + return this._partitionSubnetId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcePartitionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcePartitionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + category: cdktf.stringToTerraform(this._category), + cluster_id: cdktf.stringToTerraform(this._clusterId), + container_subnet_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._containerSubnetIds), + id: cdktf.stringToTerraform(this._id), + partition_subnet_id: cdktf.stringToTerraform(this._partitionSubnetId), + region: cdktf.stringToTerraform(this._region), + timeouts: ccePartitionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_subnet_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._containerSubnetIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_subnet_id: { + value: cdktf.stringToHclTerraform(this._partitionSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ccePartitionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcePartitionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cce-pvc/README.md b/src/constructs/providers/huaweicloud/cce-pvc/README.md new file mode 100644 index 00000000..bbabe10c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-pvc/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cce_pvc` + +Refer to the Terraform Registry for docs: [`huaweicloud_cce_pvc`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc). diff --git a/src/constructs/providers/huaweicloud/cce-pvc/index.ts b/src/constructs/providers/huaweicloud/cce-pvc/index.ts new file mode 100644 index 00000000..daad8d37 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cce-pvc/index.ts @@ -0,0 +1,517 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcePvcConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#access_modes CcePvc#access_modes} + */ + readonly accessModes: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#annotations CcePvc#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#cluster_id CcePvc#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#id CcePvc#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#labels CcePvc#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#name CcePvc#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#namespace CcePvc#namespace} + */ + readonly namespace: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#region CcePvc#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#storage CcePvc#storage} + */ + readonly storage: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#storage_class_name CcePvc#storage_class_name} + */ + readonly storageClassName: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#timeouts CcePvc#timeouts} + */ + readonly timeouts?: CcePvcTimeouts; +} +export interface CcePvcTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#create CcePvc#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#delete CcePvc#delete} + */ + readonly delete?: string; +} + +export function ccePvcTimeoutsToTerraform(struct?: CcePvcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ccePvcTimeoutsToHclTerraform(struct?: CcePvcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcePvcTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcePvcTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcePvcTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc huaweicloud_cce_pvc} +*/ +export class CcePvc extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_pvc"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcePvc resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcePvc to import + * @param importFromId The id of the existing CcePvc that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcePvc to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_pvc", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cce_pvc huaweicloud_cce_pvc} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcePvcConfig + */ + public constructor(scope: Construct, id: string, config: CcePvcConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_pvc', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessModes = config.accessModes; + this._annotations = config.annotations; + this._clusterId = config.clusterId; + this._id = config.id; + this._labels = config.labels; + this._name = config.name; + this._namespace = config.namespace; + this._region = config.region; + this._storage = config.storage; + this._storageClassName = config.storageClassName; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_modes - computed: false, optional: false, required: true + private _accessModes?: string[]; + public get accessModes() { + return cdktf.Fn.tolist(this.getListAttribute('access_modes')); + } + public set accessModes(value: string[]) { + this._accessModes = value; + } + // Temporarily expose input value. Use with caution. + public get accessModesInput() { + return this._accessModes; + } + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // creation_timestamp - computed: true, optional: false, required: false + public get creationTimestamp() { + return this.getStringAttribute('creation_timestamp'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage - computed: false, optional: false, required: true + private _storage?: string; + public get storage() { + return this.getStringAttribute('storage'); + } + public set storage(value: string) { + this._storage = value; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage; + } + + // storage_class_name - computed: false, optional: false, required: true + private _storageClassName?: string; + public get storageClassName() { + return this.getStringAttribute('storage_class_name'); + } + public set storageClassName(value: string) { + this._storageClassName = value; + } + // Temporarily expose input value. Use with caution. + public get storageClassNameInput() { + return this._storageClassName; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcePvcTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcePvcTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_modes: cdktf.listMapper(cdktf.stringToTerraform, false)(this._accessModes), + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + region: cdktf.stringToTerraform(this._region), + storage: cdktf.stringToTerraform(this._storage), + storage_class_name: cdktf.stringToTerraform(this._storageClassName), + timeouts: ccePvcTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_modes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._accessModes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage: { + value: cdktf.stringToHclTerraform(this._storage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_class_name: { + value: cdktf.stringToHclTerraform(this._storageClassName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ccePvcTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcePvcTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cci-namespace/README.md b/src/constructs/providers/huaweicloud/cci-namespace/README.md new file mode 100644 index 00000000..5e71e1f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cci-namespace/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cci_namespace` + +Refer to the Terraform Registry for docs: [`huaweicloud_cci_namespace`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace). diff --git a/src/constructs/providers/huaweicloud/cci-namespace/index.ts b/src/constructs/providers/huaweicloud/cci-namespace/index.ts new file mode 100644 index 00000000..de2ae9b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cci-namespace/index.ts @@ -0,0 +1,529 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CciNamespaceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#auto_expend_enabled CciNamespace#auto_expend_enabled} + */ + readonly autoExpendEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#container_network_enabled CciNamespace#container_network_enabled} + */ + readonly containerNetworkEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#enterprise_project_id CciNamespace#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#id CciNamespace#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#name CciNamespace#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#rbac_enabled CciNamespace#rbac_enabled} + */ + readonly rbacEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#recycling_interval CciNamespace#recycling_interval} + */ + readonly recyclingInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#region CciNamespace#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#type CciNamespace#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#warmup_pool_size CciNamespace#warmup_pool_size} + */ + readonly warmupPoolSize?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#timeouts CciNamespace#timeouts} + */ + readonly timeouts?: CciNamespaceTimeouts; +} +export interface CciNamespaceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#create CciNamespace#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#delete CciNamespace#delete} + */ + readonly delete?: string; +} + +export function cciNamespaceTimeoutsToTerraform(struct?: CciNamespaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cciNamespaceTimeoutsToHclTerraform(struct?: CciNamespaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CciNamespaceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CciNamespaceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CciNamespaceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace huaweicloud_cci_namespace} +*/ +export class CciNamespace extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cci_namespace"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CciNamespace resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CciNamespace to import + * @param importFromId The id of the existing CciNamespace that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CciNamespace to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cci_namespace", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_namespace huaweicloud_cci_namespace} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CciNamespaceConfig + */ + public constructor(scope: Construct, id: string, config: CciNamespaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cci_namespace', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoExpendEnabled = config.autoExpendEnabled; + this._containerNetworkEnabled = config.containerNetworkEnabled; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._rbacEnabled = config.rbacEnabled; + this._recyclingInterval = config.recyclingInterval; + this._region = config.region; + this._type = config.type; + this._warmupPoolSize = config.warmupPoolSize; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_expend_enabled - computed: true, optional: true, required: false + private _autoExpendEnabled?: boolean | cdktf.IResolvable; + public get autoExpendEnabled() { + return this.getBooleanAttribute('auto_expend_enabled'); + } + public set autoExpendEnabled(value: boolean | cdktf.IResolvable) { + this._autoExpendEnabled = value; + } + public resetAutoExpendEnabled() { + this._autoExpendEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoExpendEnabledInput() { + return this._autoExpendEnabled; + } + + // container_network_enabled - computed: true, optional: true, required: false + private _containerNetworkEnabled?: boolean | cdktf.IResolvable; + public get containerNetworkEnabled() { + return this.getBooleanAttribute('container_network_enabled'); + } + public set containerNetworkEnabled(value: boolean | cdktf.IResolvable) { + this._containerNetworkEnabled = value; + } + public resetContainerNetworkEnabled() { + this._containerNetworkEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get containerNetworkEnabledInput() { + return this._containerNetworkEnabled; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // rbac_enabled - computed: false, optional: true, required: false + private _rbacEnabled?: boolean | cdktf.IResolvable; + public get rbacEnabled() { + return this.getBooleanAttribute('rbac_enabled'); + } + public set rbacEnabled(value: boolean | cdktf.IResolvable) { + this._rbacEnabled = value; + } + public resetRbacEnabled() { + this._rbacEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get rbacEnabledInput() { + return this._rbacEnabled; + } + + // recycling_interval - computed: true, optional: true, required: false + private _recyclingInterval?: number; + public get recyclingInterval() { + return this.getNumberAttribute('recycling_interval'); + } + public set recyclingInterval(value: number) { + this._recyclingInterval = value; + } + public resetRecyclingInterval() { + this._recyclingInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get recyclingIntervalInput() { + return this._recyclingInterval; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // warmup_pool_size - computed: true, optional: true, required: false + private _warmupPoolSize?: number; + public get warmupPoolSize() { + return this.getNumberAttribute('warmup_pool_size'); + } + public set warmupPoolSize(value: number) { + this._warmupPoolSize = value; + } + public resetWarmupPoolSize() { + this._warmupPoolSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get warmupPoolSizeInput() { + return this._warmupPoolSize; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CciNamespaceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CciNamespaceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_expend_enabled: cdktf.booleanToTerraform(this._autoExpendEnabled), + container_network_enabled: cdktf.booleanToTerraform(this._containerNetworkEnabled), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + rbac_enabled: cdktf.booleanToTerraform(this._rbacEnabled), + recycling_interval: cdktf.numberToTerraform(this._recyclingInterval), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + warmup_pool_size: cdktf.numberToTerraform(this._warmupPoolSize), + timeouts: cciNamespaceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_expend_enabled: { + value: cdktf.booleanToHclTerraform(this._autoExpendEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + container_network_enabled: { + value: cdktf.booleanToHclTerraform(this._containerNetworkEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rbac_enabled: { + value: cdktf.booleanToHclTerraform(this._rbacEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + recycling_interval: { + value: cdktf.numberToHclTerraform(this._recyclingInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + warmup_pool_size: { + value: cdktf.numberToHclTerraform(this._warmupPoolSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: cciNamespaceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CciNamespaceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cci-network/README.md b/src/constructs/providers/huaweicloud/cci-network/README.md new file mode 100644 index 00000000..36df4ad1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cci-network/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cci_network` + +Refer to the Terraform Registry for docs: [`huaweicloud_cci_network`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network). diff --git a/src/constructs/providers/huaweicloud/cci-network/index.ts b/src/constructs/providers/huaweicloud/cci-network/index.ts new file mode 100644 index 00000000..5c4de13e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cci-network/index.ts @@ -0,0 +1,449 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CciNetworkConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#availability_zone CciNetwork#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#id CciNetwork#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#name CciNetwork#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#namespace CciNetwork#namespace} + */ + readonly namespace: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#network_id CciNetwork#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#region CciNetwork#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#security_group_id CciNetwork#security_group_id} + */ + readonly securityGroupId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#timeouts CciNetwork#timeouts} + */ + readonly timeouts?: CciNetworkTimeouts; +} +export interface CciNetworkTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#create CciNetwork#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#delete CciNetwork#delete} + */ + readonly delete?: string; +} + +export function cciNetworkTimeoutsToTerraform(struct?: CciNetworkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cciNetworkTimeoutsToHclTerraform(struct?: CciNetworkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CciNetworkTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CciNetworkTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CciNetworkTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network huaweicloud_cci_network} +*/ +export class CciNetwork extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cci_network"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CciNetwork resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CciNetwork to import + * @param importFromId The id of the existing CciNetwork that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CciNetwork to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cci_network", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_network huaweicloud_cci_network} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CciNetworkConfig + */ + public constructor(scope: Construct, id: string, config: CciNetworkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cci_network', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._id = config.id; + this._name = config.name; + this._namespace = config.namespace; + this._networkId = config.networkId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CciNetworkTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CciNetworkTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + timeouts: cciNetworkTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cciNetworkTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CciNetworkTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cci-pvc/README.md b/src/constructs/providers/huaweicloud/cci-pvc/README.md new file mode 100644 index 00000000..58a5147f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cci-pvc/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cci_pvc` + +Refer to the Terraform Registry for docs: [`huaweicloud_cci_pvc`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc). diff --git a/src/constructs/providers/huaweicloud/cci-pvc/index.ts b/src/constructs/providers/huaweicloud/cci-pvc/index.ts new file mode 100644 index 00000000..fd028f36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cci-pvc/index.ts @@ -0,0 +1,452 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CciPvcConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#device_mount_path CciPvc#device_mount_path} + */ + readonly deviceMountPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#id CciPvc#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#name CciPvc#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#namespace CciPvc#namespace} + */ + readonly namespace: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#region CciPvc#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#volume_id CciPvc#volume_id} + */ + readonly volumeId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#volume_type CciPvc#volume_type} + */ + readonly volumeType?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#timeouts CciPvc#timeouts} + */ + readonly timeouts?: CciPvcTimeouts; +} +export interface CciPvcTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#create CciPvc#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#delete CciPvc#delete} + */ + readonly delete?: string; +} + +export function cciPvcTimeoutsToTerraform(struct?: CciPvcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cciPvcTimeoutsToHclTerraform(struct?: CciPvcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CciPvcTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CciPvcTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CciPvcTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc huaweicloud_cci_pvc} +*/ +export class CciPvc extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cci_pvc"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CciPvc resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CciPvc to import + * @param importFromId The id of the existing CciPvc that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CciPvc to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cci_pvc", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cci_pvc huaweicloud_cci_pvc} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CciPvcConfig + */ + public constructor(scope: Construct, id: string, config: CciPvcConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cci_pvc', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceMountPath = config.deviceMountPath; + this._id = config.id; + this._name = config.name; + this._namespace = config.namespace; + this._region = config.region; + this._volumeId = config.volumeId; + this._volumeType = config.volumeType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_modes - computed: true, optional: false, required: false + public get accessModes() { + return this.getListAttribute('access_modes'); + } + + // creation_timestamp - computed: true, optional: false, required: false + public get creationTimestamp() { + return this.getStringAttribute('creation_timestamp'); + } + + // device_mount_path - computed: true, optional: true, required: false + private _deviceMountPath?: string; + public get deviceMountPath() { + return this.getStringAttribute('device_mount_path'); + } + public set deviceMountPath(value: string) { + this._deviceMountPath = value; + } + public resetDeviceMountPath() { + this._deviceMountPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceMountPathInput() { + return this._deviceMountPath; + } + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getBooleanAttribute('enable'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // volume_type - computed: false, optional: true, required: false + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + public resetVolumeType() { + this._volumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CciPvcTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CciPvcTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_mount_path: cdktf.stringToTerraform(this._deviceMountPath), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + region: cdktf.stringToTerraform(this._region), + volume_id: cdktf.stringToTerraform(this._volumeId), + volume_type: cdktf.stringToTerraform(this._volumeType), + timeouts: cciPvcTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_mount_path: { + value: cdktf.stringToHclTerraform(this._deviceMountPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cciPvcTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CciPvcTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-apply/README.md b/src/constructs/providers/huaweicloud/ccm-certificate-apply/README.md new file mode 100644 index 00000000..52ed4007 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-apply/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_certificate_apply` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_certificate_apply`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply). diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-apply/index.ts b/src/constructs/providers/huaweicloud/ccm-certificate-apply/index.ts new file mode 100644 index 00000000..3aeea5ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-apply/index.ts @@ -0,0 +1,698 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmCertificateApplyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the email of the applicant. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#applicant_email CcmCertificateApply#applicant_email} + */ + readonly applicantEmail: string; + /** + * Specifies the name of the applicant. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#applicant_name CcmCertificateApply#applicant_name} + */ + readonly applicantName: string; + /** + * Specifies the phone number of the applicant. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#applicant_phone CcmCertificateApply#applicant_phone} + */ + readonly applicantPhone: string; + /** + * Specifies whether to push DNS verification information to HuaweiCloud resolution service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#auto_dns_auth CcmCertificateApply#auto_dns_auth} + */ + readonly autoDnsAuth?: boolean | cdktf.IResolvable; + /** + * Specifies the signature algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#ca_hash_algorithm CcmCertificateApply#ca_hash_algorithm} + */ + readonly caHashAlgorithm?: string; + /** + * Specifies the CCM SSL certificate ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#certificate_id CcmCertificateApply#certificate_id} + */ + readonly certificateId: string; + /** + * Specifies the city where the company is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#company_city CcmCertificateApply#company_city} + */ + readonly companyCity?: string; + /** + * Specifies the company name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#company_name CcmCertificateApply#company_name} + */ + readonly companyName?: string; + /** + * Specifies the province where the company is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#company_province CcmCertificateApply#company_province} + */ + readonly companyProvince?: string; + /** + * Specifies the department name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#company_unit CcmCertificateApply#company_unit} + */ + readonly companyUnit?: string; + /** + * Specifies the technical contact email. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#contact_email CcmCertificateApply#contact_email} + */ + readonly contactEmail?: string; + /** + * Specifies the technical contact name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#contact_name CcmCertificateApply#contact_name} + */ + readonly contactName?: string; + /** + * Specifies the technical contact phone number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#contact_phone CcmCertificateApply#contact_phone} + */ + readonly contactPhone?: string; + /** + * Specifies the country code. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#country CcmCertificateApply#country} + */ + readonly country?: string; + /** + * Specifies the certificate CSR string, which must match the domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#csr CcmCertificateApply#csr} + */ + readonly csr?: string; + /** + * Specifies the domain name bound to the certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#domain CcmCertificateApply#domain} + */ + readonly domain: string; + /** + * Specifies the domain name verification method. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#domain_method CcmCertificateApply#domain_method} + */ + readonly domainMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#id CcmCertificateApply#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the key algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#key_algorithm CcmCertificateApply#key_algorithm} + */ + readonly keyAlgorithm?: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#region CcmCertificateApply#region} + */ + readonly region?: string; + /** + * Specifies additional domain names bound to multi-domain type certificates. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#sans CcmCertificateApply#sans} + */ + readonly sans?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply huaweicloud_ccm_certificate_apply} +*/ +export class CcmCertificateApply extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificate_apply"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmCertificateApply resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmCertificateApply to import + * @param importFromId The id of the existing CcmCertificateApply that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmCertificateApply to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificate_apply", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_apply huaweicloud_ccm_certificate_apply} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmCertificateApplyConfig + */ + public constructor(scope: Construct, id: string, config: CcmCertificateApplyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificate_apply', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicantEmail = config.applicantEmail; + this._applicantName = config.applicantName; + this._applicantPhone = config.applicantPhone; + this._autoDnsAuth = config.autoDnsAuth; + this._caHashAlgorithm = config.caHashAlgorithm; + this._certificateId = config.certificateId; + this._companyCity = config.companyCity; + this._companyName = config.companyName; + this._companyProvince = config.companyProvince; + this._companyUnit = config.companyUnit; + this._contactEmail = config.contactEmail; + this._contactName = config.contactName; + this._contactPhone = config.contactPhone; + this._country = config.country; + this._csr = config.csr; + this._domain = config.domain; + this._domainMethod = config.domainMethod; + this._id = config.id; + this._keyAlgorithm = config.keyAlgorithm; + this._region = config.region; + this._sans = config.sans; + } + + // ========== + // ATTRIBUTES + // ========== + + // applicant_email - computed: false, optional: false, required: true + private _applicantEmail?: string; + public get applicantEmail() { + return this.getStringAttribute('applicant_email'); + } + public set applicantEmail(value: string) { + this._applicantEmail = value; + } + // Temporarily expose input value. Use with caution. + public get applicantEmailInput() { + return this._applicantEmail; + } + + // applicant_name - computed: false, optional: false, required: true + private _applicantName?: string; + public get applicantName() { + return this.getStringAttribute('applicant_name'); + } + public set applicantName(value: string) { + this._applicantName = value; + } + // Temporarily expose input value. Use with caution. + public get applicantNameInput() { + return this._applicantName; + } + + // applicant_phone - computed: false, optional: false, required: true + private _applicantPhone?: string; + public get applicantPhone() { + return this.getStringAttribute('applicant_phone'); + } + public set applicantPhone(value: string) { + this._applicantPhone = value; + } + // Temporarily expose input value. Use with caution. + public get applicantPhoneInput() { + return this._applicantPhone; + } + + // auto_dns_auth - computed: false, optional: true, required: false + private _autoDnsAuth?: boolean | cdktf.IResolvable; + public get autoDnsAuth() { + return this.getBooleanAttribute('auto_dns_auth'); + } + public set autoDnsAuth(value: boolean | cdktf.IResolvable) { + this._autoDnsAuth = value; + } + public resetAutoDnsAuth() { + this._autoDnsAuth = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoDnsAuthInput() { + return this._autoDnsAuth; + } + + // ca_hash_algorithm - computed: false, optional: true, required: false + private _caHashAlgorithm?: string; + public get caHashAlgorithm() { + return this.getStringAttribute('ca_hash_algorithm'); + } + public set caHashAlgorithm(value: string) { + this._caHashAlgorithm = value; + } + public resetCaHashAlgorithm() { + this._caHashAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get caHashAlgorithmInput() { + return this._caHashAlgorithm; + } + + // certificate_id - computed: false, optional: false, required: true + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // company_city - computed: false, optional: true, required: false + private _companyCity?: string; + public get companyCity() { + return this.getStringAttribute('company_city'); + } + public set companyCity(value: string) { + this._companyCity = value; + } + public resetCompanyCity() { + this._companyCity = undefined; + } + // Temporarily expose input value. Use with caution. + public get companyCityInput() { + return this._companyCity; + } + + // company_name - computed: false, optional: true, required: false + private _companyName?: string; + public get companyName() { + return this.getStringAttribute('company_name'); + } + public set companyName(value: string) { + this._companyName = value; + } + public resetCompanyName() { + this._companyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get companyNameInput() { + return this._companyName; + } + + // company_province - computed: false, optional: true, required: false + private _companyProvince?: string; + public get companyProvince() { + return this.getStringAttribute('company_province'); + } + public set companyProvince(value: string) { + this._companyProvince = value; + } + public resetCompanyProvince() { + this._companyProvince = undefined; + } + // Temporarily expose input value. Use with caution. + public get companyProvinceInput() { + return this._companyProvince; + } + + // company_unit - computed: false, optional: true, required: false + private _companyUnit?: string; + public get companyUnit() { + return this.getStringAttribute('company_unit'); + } + public set companyUnit(value: string) { + this._companyUnit = value; + } + public resetCompanyUnit() { + this._companyUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get companyUnitInput() { + return this._companyUnit; + } + + // contact_email - computed: false, optional: true, required: false + private _contactEmail?: string; + public get contactEmail() { + return this.getStringAttribute('contact_email'); + } + public set contactEmail(value: string) { + this._contactEmail = value; + } + public resetContactEmail() { + this._contactEmail = undefined; + } + // Temporarily expose input value. Use with caution. + public get contactEmailInput() { + return this._contactEmail; + } + + // contact_name - computed: false, optional: true, required: false + private _contactName?: string; + public get contactName() { + return this.getStringAttribute('contact_name'); + } + public set contactName(value: string) { + this._contactName = value; + } + public resetContactName() { + this._contactName = undefined; + } + // Temporarily expose input value. Use with caution. + public get contactNameInput() { + return this._contactName; + } + + // contact_phone - computed: false, optional: true, required: false + private _contactPhone?: string; + public get contactPhone() { + return this.getStringAttribute('contact_phone'); + } + public set contactPhone(value: string) { + this._contactPhone = value; + } + public resetContactPhone() { + this._contactPhone = undefined; + } + // Temporarily expose input value. Use with caution. + public get contactPhoneInput() { + return this._contactPhone; + } + + // country - computed: false, optional: true, required: false + private _country?: string; + public get country() { + return this.getStringAttribute('country'); + } + public set country(value: string) { + this._country = value; + } + public resetCountry() { + this._country = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryInput() { + return this._country; + } + + // csr - computed: false, optional: true, required: false + private _csr?: string; + public get csr() { + return this.getStringAttribute('csr'); + } + public set csr(value: string) { + this._csr = value; + } + public resetCsr() { + this._csr = undefined; + } + // Temporarily expose input value. Use with caution. + public get csrInput() { + return this._csr; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // domain_method - computed: false, optional: false, required: true + private _domainMethod?: string; + public get domainMethod() { + return this.getStringAttribute('domain_method'); + } + public set domainMethod(value: string) { + this._domainMethod = value; + } + // Temporarily expose input value. Use with caution. + public get domainMethodInput() { + return this._domainMethod; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_algorithm - computed: false, optional: true, required: false + private _keyAlgorithm?: string; + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + public set keyAlgorithm(value: string) { + this._keyAlgorithm = value; + } + public resetKeyAlgorithm() { + this._keyAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyAlgorithmInput() { + return this._keyAlgorithm; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sans - computed: false, optional: true, required: false + private _sans?: string; + public get sans() { + return this.getStringAttribute('sans'); + } + public set sans(value: string) { + this._sans = value; + } + public resetSans() { + this._sans = undefined; + } + // Temporarily expose input value. Use with caution. + public get sansInput() { + return this._sans; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + applicant_email: cdktf.stringToTerraform(this._applicantEmail), + applicant_name: cdktf.stringToTerraform(this._applicantName), + applicant_phone: cdktf.stringToTerraform(this._applicantPhone), + auto_dns_auth: cdktf.booleanToTerraform(this._autoDnsAuth), + ca_hash_algorithm: cdktf.stringToTerraform(this._caHashAlgorithm), + certificate_id: cdktf.stringToTerraform(this._certificateId), + company_city: cdktf.stringToTerraform(this._companyCity), + company_name: cdktf.stringToTerraform(this._companyName), + company_province: cdktf.stringToTerraform(this._companyProvince), + company_unit: cdktf.stringToTerraform(this._companyUnit), + contact_email: cdktf.stringToTerraform(this._contactEmail), + contact_name: cdktf.stringToTerraform(this._contactName), + contact_phone: cdktf.stringToTerraform(this._contactPhone), + country: cdktf.stringToTerraform(this._country), + csr: cdktf.stringToTerraform(this._csr), + domain: cdktf.stringToTerraform(this._domain), + domain_method: cdktf.stringToTerraform(this._domainMethod), + id: cdktf.stringToTerraform(this._id), + key_algorithm: cdktf.stringToTerraform(this._keyAlgorithm), + region: cdktf.stringToTerraform(this._region), + sans: cdktf.stringToTerraform(this._sans), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + applicant_email: { + value: cdktf.stringToHclTerraform(this._applicantEmail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + applicant_name: { + value: cdktf.stringToHclTerraform(this._applicantName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + applicant_phone: { + value: cdktf.stringToHclTerraform(this._applicantPhone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_dns_auth: { + value: cdktf.booleanToHclTerraform(this._autoDnsAuth), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ca_hash_algorithm: { + value: cdktf.stringToHclTerraform(this._caHashAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + company_city: { + value: cdktf.stringToHclTerraform(this._companyCity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + company_name: { + value: cdktf.stringToHclTerraform(this._companyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + company_province: { + value: cdktf.stringToHclTerraform(this._companyProvince), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + company_unit: { + value: cdktf.stringToHclTerraform(this._companyUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + contact_email: { + value: cdktf.stringToHclTerraform(this._contactEmail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + contact_name: { + value: cdktf.stringToHclTerraform(this._contactName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + contact_phone: { + value: cdktf.stringToHclTerraform(this._contactPhone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country: { + value: cdktf.stringToHclTerraform(this._country), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + csr: { + value: cdktf.stringToHclTerraform(this._csr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_method: { + value: cdktf.stringToHclTerraform(this._domainMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_algorithm: { + value: cdktf.stringToHclTerraform(this._keyAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sans: { + value: cdktf.stringToHclTerraform(this._sans), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-deploy/README.md b/src/constructs/providers/huaweicloud/ccm-certificate-deploy/README.md new file mode 100644 index 00000000..69e694e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-deploy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_certificate_deploy` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_certificate_deploy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy). diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-deploy/index.ts b/src/constructs/providers/huaweicloud/ccm-certificate-deploy/index.ts new file mode 100644 index 00000000..12cf8a6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-deploy/index.ts @@ -0,0 +1,483 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmCertificateDeployConfig extends cdktf.TerraformMetaArguments { + /** + * The CCM SSL certificate ID to be deployed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#certificate_id CcmCertificateDeploy#certificate_id} + */ + readonly certificateId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#id CcmCertificateDeploy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the project where the deployed resources are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#project_name CcmCertificateDeploy#project_name} + */ + readonly projectName?: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#region CcmCertificateDeploy#region} + */ + readonly region?: string; + /** + * The target service to which the certificate is pushed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#service_name CcmCertificateDeploy#service_name} + */ + readonly serviceName: string; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#resources CcmCertificateDeploy#resources} + */ + readonly resources: CcmCertificateDeployResources[] | cdktf.IResolvable; +} +export interface CcmCertificateDeployResources { + /** + * The domain name to be deployed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#domain_name CcmCertificateDeploy#domain_name} + */ + readonly domainName?: string; + /** + * The enterprise project ID to which the resources to be deployed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#enterprise_project_id CcmCertificateDeploy#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#id CcmCertificateDeploy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#type CcmCertificateDeploy#type} + */ + readonly type?: string; +} + +export function ccmCertificateDeployResourcesToTerraform(struct?: CcmCertificateDeployResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + domain_name: cdktf.stringToTerraform(struct!.domainName), + enterprise_project_id: cdktf.stringToTerraform(struct!.enterpriseProjectId), + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ccmCertificateDeployResourcesToHclTerraform(struct?: CcmCertificateDeployResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(struct!.domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmCertificateDeployResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmCertificateDeployResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._domainName !== undefined) { + hasAnyValues = true; + internalValueResult.domainName = this._domainName; + } + if (this._enterpriseProjectId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseProjectId = this._enterpriseProjectId; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmCertificateDeployResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._domainName = undefined; + this._enterpriseProjectId = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._domainName = value.domainName; + this._enterpriseProjectId = value.enterpriseProjectId; + this._id = value.id; + this._type = value.type; + } + } + + // domain_name - computed: false, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CcmCertificateDeployResourcesList extends cdktf.ComplexList { + public internalValue? : CcmCertificateDeployResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmCertificateDeployResourcesOutputReference { + return new CcmCertificateDeployResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy huaweicloud_ccm_certificate_deploy} +*/ +export class CcmCertificateDeploy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificate_deploy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmCertificateDeploy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmCertificateDeploy to import + * @param importFromId The id of the existing CcmCertificateDeploy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmCertificateDeploy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificate_deploy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_deploy huaweicloud_ccm_certificate_deploy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmCertificateDeployConfig + */ + public constructor(scope: Construct, id: string, config: CcmCertificateDeployConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificate_deploy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._id = config.id; + this._projectName = config.projectName; + this._region = config.region; + this._serviceName = config.serviceName; + this._resources.internalValue = config.resources; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate_id - computed: false, optional: false, required: true + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // project_name - computed: false, optional: true, required: false + private _projectName?: string; + public get projectName() { + return this.getStringAttribute('project_name'); + } + public set projectName(value: string) { + this._projectName = value; + } + public resetProjectName() { + this._projectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectNameInput() { + return this._projectName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_name - computed: false, optional: false, required: true + private _serviceName?: string; + public get serviceName() { + return this.getStringAttribute('service_name'); + } + public set serviceName(value: string) { + this._serviceName = value; + } + // Temporarily expose input value. Use with caution. + public get serviceNameInput() { + return this._serviceName; + } + + // resources - computed: false, optional: false, required: true + private _resources = new CcmCertificateDeployResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: CcmCertificateDeployResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + id: cdktf.stringToTerraform(this._id), + project_name: cdktf.stringToTerraform(this._projectName), + region: cdktf.stringToTerraform(this._region), + service_name: cdktf.stringToTerraform(this._serviceName), + resources: cdktf.listMapper(ccmCertificateDeployResourcesToTerraform, true)(this._resources.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_name: { + value: cdktf.stringToHclTerraform(this._projectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_name: { + value: cdktf.stringToHclTerraform(this._serviceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resources: { + value: cdktf.listMapperHcl(ccmCertificateDeployResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmCertificateDeployResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-import/README.md b/src/constructs/providers/huaweicloud/ccm-certificate-import/README.md new file mode 100644 index 00000000..c3f23355 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-import/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_certificate_import` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_certificate_import`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import). diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-import/index.ts b/src/constructs/providers/huaweicloud/ccm-certificate-import/index.ts new file mode 100644 index 00000000..80a9bf35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-import/index.ts @@ -0,0 +1,633 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmCertificateImportConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#certificate CcmCertificateImport#certificate} + */ + readonly certificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#certificate_chain CcmCertificateImport#certificate_chain} + */ + readonly certificateChain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#enc_certificate CcmCertificateImport#enc_certificate} + */ + readonly encCertificate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#enc_private_key CcmCertificateImport#enc_private_key} + */ + readonly encPrivateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#enterprise_project_id CcmCertificateImport#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#id CcmCertificateImport#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#name CcmCertificateImport#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#private_key CcmCertificateImport#private_key} + */ + readonly privateKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#region CcmCertificateImport#region} + */ + readonly region?: string; + /** + * target block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#target CcmCertificateImport#target} + */ + readonly target?: CcmCertificateImportTarget[] | cdktf.IResolvable; +} +export interface CcmCertificateImportAuthentifications { +} + +export function ccmCertificateImportAuthentificationsToTerraform(struct?: CcmCertificateImportAuthentifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ccmCertificateImportAuthentificationsToHclTerraform(struct?: CcmCertificateImportAuthentifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CcmCertificateImportAuthentificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmCertificateImportAuthentifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmCertificateImportAuthentifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // record_name - computed: true, optional: false, required: false + public get recordName() { + return this.getStringAttribute('record_name'); + } + + // record_type - computed: true, optional: false, required: false + public get recordType() { + return this.getStringAttribute('record_type'); + } + + // record_value - computed: true, optional: false, required: false + public get recordValue() { + return this.getStringAttribute('record_value'); + } +} + +export class CcmCertificateImportAuthentificationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmCertificateImportAuthentificationsOutputReference { + return new CcmCertificateImportAuthentificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcmCertificateImportTarget { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#project CcmCertificateImport#project} + */ + readonly project?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#service CcmCertificateImport#service} + */ + readonly service: string; +} + +export function ccmCertificateImportTargetToTerraform(struct?: CcmCertificateImportTarget | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.project), + service: cdktf.stringToTerraform(struct!.service), + } +} + + +export function ccmCertificateImportTargetToHclTerraform(struct?: CcmCertificateImportTarget | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.project), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + service: { + value: cdktf.stringToHclTerraform(struct!.service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmCertificateImportTargetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmCertificateImportTarget | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._project !== undefined) { + hasAnyValues = true; + internalValueResult.project = this._project; + } + if (this._service !== undefined) { + hasAnyValues = true; + internalValueResult.service = this._service; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmCertificateImportTarget | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._project = undefined; + this._service = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._project = value.project; + this._service = value.service; + } + } + + // project - computed: false, optional: true, required: false + private _project?: string[]; + public get project() { + return this.getListAttribute('project'); + } + public set project(value: string[]) { + this._project = value; + } + public resetProject() { + this._project = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectInput() { + return this._project; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } +} + +export class CcmCertificateImportTargetList extends cdktf.ComplexList { + public internalValue? : CcmCertificateImportTarget[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmCertificateImportTargetOutputReference { + return new CcmCertificateImportTargetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import huaweicloud_ccm_certificate_import} +*/ +export class CcmCertificateImport extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificate_import"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmCertificateImport resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmCertificateImport to import + * @param importFromId The id of the existing CcmCertificateImport that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmCertificateImport to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificate_import", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_import huaweicloud_ccm_certificate_import} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmCertificateImportConfig + */ + public constructor(scope: Construct, id: string, config: CcmCertificateImportConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificate_import', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificate = config.certificate; + this._certificateChain = config.certificateChain; + this._encCertificate = config.encCertificate; + this._encPrivateKey = config.encPrivateKey; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._target.internalValue = config.target; + } + + // ========== + // ATTRIBUTES + // ========== + + // authentifications - computed: true, optional: false, required: false + private _authentifications = new CcmCertificateImportAuthentificationsList(this, "authentifications", false); + public get authentifications() { + return this._authentifications; + } + + // certificate - computed: false, optional: false, required: true + private _certificate?: string; + public get certificate() { + return this.getStringAttribute('certificate'); + } + public set certificate(value: string) { + this._certificate = value; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate; + } + + // certificate_chain - computed: false, optional: true, required: false + private _certificateChain?: string; + public get certificateChain() { + return this.getStringAttribute('certificate_chain'); + } + public set certificateChain(value: string) { + this._certificateChain = value; + } + public resetCertificateChain() { + this._certificateChain = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateChainInput() { + return this._certificateChain; + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // domain_count - computed: true, optional: false, required: false + public get domainCount() { + return this.getNumberAttribute('domain_count'); + } + + // enc_certificate - computed: false, optional: true, required: false + private _encCertificate?: string; + public get encCertificate() { + return this.getStringAttribute('enc_certificate'); + } + public set encCertificate(value: string) { + this._encCertificate = value; + } + public resetEncCertificate() { + this._encCertificate = undefined; + } + // Temporarily expose input value. Use with caution. + public get encCertificateInput() { + return this._encCertificate; + } + + // enc_private_key - computed: false, optional: true, required: false + private _encPrivateKey?: string; + public get encPrivateKey() { + return this.getStringAttribute('enc_private_key'); + } + public set encPrivateKey(value: string) { + this._encPrivateKey = value; + } + public resetEncPrivateKey() { + this._encPrivateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get encPrivateKeyInput() { + return this._encPrivateKey; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // not_after - computed: true, optional: false, required: false + public get notAfter() { + return this.getStringAttribute('not_after'); + } + + // not_before - computed: true, optional: false, required: false + public get notBefore() { + return this.getStringAttribute('not_before'); + } + + // private_key - computed: false, optional: false, required: true + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // push_support - computed: true, optional: false, required: false + public get pushSupport() { + return this.getStringAttribute('push_support'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // target - computed: false, optional: true, required: false + private _target = new CcmCertificateImportTargetList(this, "target", false); + public get target() { + return this._target; + } + public putTarget(value: CcmCertificateImportTarget[] | cdktf.IResolvable) { + this._target.internalValue = value; + } + public resetTarget() { + this._target.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetInput() { + return this._target.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate: cdktf.stringToTerraform(this._certificate), + certificate_chain: cdktf.stringToTerraform(this._certificateChain), + enc_certificate: cdktf.stringToTerraform(this._encCertificate), + enc_private_key: cdktf.stringToTerraform(this._encPrivateKey), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + target: cdktf.listMapper(ccmCertificateImportTargetToTerraform, true)(this._target.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate: { + value: cdktf.stringToHclTerraform(this._certificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_chain: { + value: cdktf.stringToHclTerraform(this._certificateChain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enc_certificate: { + value: cdktf.stringToHclTerraform(this._encCertificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enc_private_key: { + value: cdktf.stringToHclTerraform(this._encPrivateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target: { + value: cdktf.listMapperHcl(ccmCertificateImportTargetToHclTerraform, true)(this._target.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmCertificateImportTargetList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-push/README.md b/src/constructs/providers/huaweicloud/ccm-certificate-push/README.md new file mode 100644 index 00000000..49f9ad66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-push/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_certificate_push` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_certificate_push`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push). diff --git a/src/constructs/providers/huaweicloud/ccm-certificate-push/index.ts b/src/constructs/providers/huaweicloud/ccm-certificate-push/index.ts new file mode 100644 index 00000000..edb0f437 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate-push/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmCertificatePushConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#certificate_id CcmCertificatePush#certificate_id} + */ + readonly certificateId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#id CcmCertificatePush#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#region CcmCertificatePush#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#service CcmCertificatePush#service} + */ + readonly service: string; + /** + * targets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#targets CcmCertificatePush#targets} + */ + readonly targets: CcmCertificatePushTargets[] | cdktf.IResolvable; +} +export interface CcmCertificatePushTargets { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#project_name CcmCertificatePush#project_name} + */ + readonly projectName: string; +} + +export function ccmCertificatePushTargetsToTerraform(struct?: CcmCertificatePushTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project_name: cdktf.stringToTerraform(struct!.projectName), + } +} + + +export function ccmCertificatePushTargetsToHclTerraform(struct?: CcmCertificatePushTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project_name: { + value: cdktf.stringToHclTerraform(struct!.projectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmCertificatePushTargetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmCertificatePushTargets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._projectName !== undefined) { + hasAnyValues = true; + internalValueResult.projectName = this._projectName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmCertificatePushTargets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._projectName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._projectName = value.projectName; + } + } + + // cert_id - computed: true, optional: false, required: false + public get certId() { + return this.getStringAttribute('cert_id'); + } + + // cert_name - computed: true, optional: false, required: false + public get certName() { + return this.getStringAttribute('cert_name'); + } + + // project_name - computed: false, optional: false, required: true + private _projectName?: string; + public get projectName() { + return this.getStringAttribute('project_name'); + } + public set projectName(value: string) { + this._projectName = value; + } + // Temporarily expose input value. Use with caution. + public get projectNameInput() { + return this._projectName; + } +} + +export class CcmCertificatePushTargetsList extends cdktf.ComplexList { + public internalValue? : CcmCertificatePushTargets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmCertificatePushTargetsOutputReference { + return new CcmCertificatePushTargetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push huaweicloud_ccm_certificate_push} +*/ +export class CcmCertificatePush extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificate_push"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmCertificatePush resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmCertificatePush to import + * @param importFromId The id of the existing CcmCertificatePush that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmCertificatePush to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificate_push", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate_push huaweicloud_ccm_certificate_push} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmCertificatePushConfig + */ + public constructor(scope: Construct, id: string, config: CcmCertificatePushConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificate_push', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._id = config.id; + this._region = config.region; + this._service = config.service; + this._targets.internalValue = config.targets; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate_id - computed: false, optional: false, required: true + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } + + // targets - computed: false, optional: false, required: true + private _targets = new CcmCertificatePushTargetsList(this, "targets", true); + public get targets() { + return this._targets; + } + public putTargets(value: CcmCertificatePushTargets[] | cdktf.IResolvable) { + this._targets.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get targetsInput() { + return this._targets.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service: cdktf.stringToTerraform(this._service), + targets: cdktf.listMapper(ccmCertificatePushTargetsToTerraform, true)(this._targets.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service: { + value: cdktf.stringToHclTerraform(this._service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + targets: { + value: cdktf.listMapperHcl(ccmCertificatePushTargetsToHclTerraform, true)(this._targets.internalValue), + isBlock: true, + type: "set", + storageClassType: "CcmCertificatePushTargetsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-certificate/README.md b/src/constructs/providers/huaweicloud/ccm-certificate/README.md new file mode 100644 index 00000000..65417de9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate). diff --git a/src/constructs/providers/huaweicloud/ccm-certificate/index.ts b/src/constructs/providers/huaweicloud/ccm-certificate/index.ts new file mode 100644 index 00000000..feadf178 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-certificate/index.ts @@ -0,0 +1,755 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the certificate authority. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#cert_brand CcmCertificate#cert_brand} + */ + readonly certBrand: string; + /** + * Specifies the certificate type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#cert_type CcmCertificate#cert_type} + */ + readonly certType: string; + /** + * Specifies the quantity of domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#domain_numbers CcmCertificate#domain_numbers} + */ + readonly domainNumbers: number; + /** + * Specifies the type of domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#domain_type CcmCertificate#domain_type} + */ + readonly domainType: string; + /** + * Specifies the validity period (year). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#effective_time CcmCertificate#effective_time} + */ + readonly effectiveTime: number; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#enterprise_project_id CcmCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#id CcmCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the type of primary domain name in multiple domains. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#primary_domain_type CcmCertificate#primary_domain_type} + */ + readonly primaryDomainType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#region CcmCertificate#region} + */ + readonly region?: string; + /** + * Specifies the number of additional single domain names. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#single_domain_number CcmCertificate#single_domain_number} + */ + readonly singleDomainNumber?: number; + /** + * Specifies the number of additional wildcard domain names. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#wildcard_domain_number CcmCertificate#wildcard_domain_number} + */ + readonly wildcardDomainNumber?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#timeouts CcmCertificate#timeouts} + */ + readonly timeouts?: CcmCertificateTimeouts; +} +export interface CcmCertificateAuthentification { +} + +export function ccmCertificateAuthentificationToTerraform(struct?: CcmCertificateAuthentification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ccmCertificateAuthentificationToHclTerraform(struct?: CcmCertificateAuthentification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CcmCertificateAuthentificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmCertificateAuthentification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmCertificateAuthentification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // record_name - computed: true, optional: false, required: false + public get recordName() { + return this.getStringAttribute('record_name'); + } + + // record_type - computed: true, optional: false, required: false + public get recordType() { + return this.getStringAttribute('record_type'); + } + + // record_value - computed: true, optional: false, required: false + public get recordValue() { + return this.getStringAttribute('record_value'); + } +} + +export class CcmCertificateAuthentificationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmCertificateAuthentificationOutputReference { + return new CcmCertificateAuthentificationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcmCertificateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#create CcmCertificate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#delete CcmCertificate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#update CcmCertificate#update} + */ + readonly update?: string; +} + +export function ccmCertificateTimeoutsToTerraform(struct?: CcmCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ccmCertificateTimeoutsToHclTerraform(struct?: CcmCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmCertificateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CcmCertificateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmCertificateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate huaweicloud_ccm_certificate} +*/ +export class CcmCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmCertificate to import + * @param importFromId The id of the existing CcmCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_certificate huaweicloud_ccm_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmCertificateConfig + */ + public constructor(scope: Construct, id: string, config: CcmCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certBrand = config.certBrand; + this._certType = config.certType; + this._domainNumbers = config.domainNumbers; + this._domainType = config.domainType; + this._effectiveTime = config.effectiveTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._primaryDomainType = config.primaryDomainType; + this._region = config.region; + this._singleDomainNumber = config.singleDomainNumber; + this._wildcardDomainNumber = config.wildcardDomainNumber; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // authentification - computed: true, optional: false, required: false + private _authentification = new CcmCertificateAuthentificationList(this, "authentification", false); + public get authentification() { + return this._authentification; + } + + // cert_brand - computed: false, optional: false, required: true + private _certBrand?: string; + public get certBrand() { + return this.getStringAttribute('cert_brand'); + } + public set certBrand(value: string) { + this._certBrand = value; + } + // Temporarily expose input value. Use with caution. + public get certBrandInput() { + return this._certBrand; + } + + // cert_type - computed: false, optional: false, required: true + private _certType?: string; + public get certType() { + return this.getStringAttribute('cert_type'); + } + public set certType(value: string) { + this._certType = value; + } + // Temporarily expose input value. Use with caution. + public get certTypeInput() { + return this._certType; + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // domain_numbers - computed: false, optional: false, required: true + private _domainNumbers?: number; + public get domainNumbers() { + return this.getNumberAttribute('domain_numbers'); + } + public set domainNumbers(value: number) { + this._domainNumbers = value; + } + // Temporarily expose input value. Use with caution. + public get domainNumbersInput() { + return this._domainNumbers; + } + + // domain_type - computed: false, optional: false, required: true + private _domainType?: string; + public get domainType() { + return this.getStringAttribute('domain_type'); + } + public set domainType(value: string) { + this._domainType = value; + } + // Temporarily expose input value. Use with caution. + public get domainTypeInput() { + return this._domainType; + } + + // effective_time - computed: false, optional: false, required: true + private _effectiveTime?: number; + public get effectiveTime() { + return this.getNumberAttribute('effective_time'); + } + public set effectiveTime(value: number) { + this._effectiveTime = value; + } + // Temporarily expose input value. Use with caution. + public get effectiveTimeInput() { + return this._effectiveTime; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fingerprint - computed: true, optional: false, required: false + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // issue_time - computed: true, optional: false, required: false + public get issueTime() { + return this.getStringAttribute('issue_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // not_after - computed: true, optional: false, required: false + public get notAfter() { + return this.getStringAttribute('not_after'); + } + + // not_before - computed: true, optional: false, required: false + public get notBefore() { + return this.getStringAttribute('not_before'); + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // primary_domain_type - computed: true, optional: true, required: false + private _primaryDomainType?: string; + public get primaryDomainType() { + return this.getStringAttribute('primary_domain_type'); + } + public set primaryDomainType(value: string) { + this._primaryDomainType = value; + } + public resetPrimaryDomainType() { + this._primaryDomainType = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryDomainTypeInput() { + return this._primaryDomainType; + } + + // push_support - computed: true, optional: false, required: false + public get pushSupport() { + return this.getStringAttribute('push_support'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // revoke_reason - computed: true, optional: false, required: false + public get revokeReason() { + return this.getStringAttribute('revoke_reason'); + } + + // sans - computed: true, optional: false, required: false + public get sans() { + return this.getStringAttribute('sans'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // single_domain_number - computed: true, optional: true, required: false + private _singleDomainNumber?: number; + public get singleDomainNumber() { + return this.getNumberAttribute('single_domain_number'); + } + public set singleDomainNumber(value: number) { + this._singleDomainNumber = value; + } + public resetSingleDomainNumber() { + this._singleDomainNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get singleDomainNumberInput() { + return this._singleDomainNumber; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // validation_method - computed: true, optional: false, required: false + public get validationMethod() { + return this.getStringAttribute('validation_method'); + } + + // validity_period - computed: true, optional: false, required: false + public get validityPeriod() { + return this.getNumberAttribute('validity_period'); + } + + // wildcard_domain_number - computed: true, optional: true, required: false + private _wildcardDomainNumber?: number; + public get wildcardDomainNumber() { + return this.getNumberAttribute('wildcard_domain_number'); + } + public set wildcardDomainNumber(value: number) { + this._wildcardDomainNumber = value; + } + public resetWildcardDomainNumber() { + this._wildcardDomainNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get wildcardDomainNumberInput() { + return this._wildcardDomainNumber; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CcmCertificateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CcmCertificateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cert_brand: cdktf.stringToTerraform(this._certBrand), + cert_type: cdktf.stringToTerraform(this._certType), + domain_numbers: cdktf.numberToTerraform(this._domainNumbers), + domain_type: cdktf.stringToTerraform(this._domainType), + effective_time: cdktf.numberToTerraform(this._effectiveTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + primary_domain_type: cdktf.stringToTerraform(this._primaryDomainType), + region: cdktf.stringToTerraform(this._region), + single_domain_number: cdktf.numberToTerraform(this._singleDomainNumber), + wildcard_domain_number: cdktf.numberToTerraform(this._wildcardDomainNumber), + timeouts: ccmCertificateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cert_brand: { + value: cdktf.stringToHclTerraform(this._certBrand), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cert_type: { + value: cdktf.stringToHclTerraform(this._certType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_numbers: { + value: cdktf.numberToHclTerraform(this._domainNumbers), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + domain_type: { + value: cdktf.stringToHclTerraform(this._domainType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + effective_time: { + value: cdktf.numberToHclTerraform(this._effectiveTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_domain_type: { + value: cdktf.stringToHclTerraform(this._primaryDomainType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + single_domain_number: { + value: cdktf.numberToHclTerraform(this._singleDomainNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + wildcard_domain_number: { + value: cdktf.numberToHclTerraform(this._wildcardDomainNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: ccmCertificateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CcmCertificateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-private-ca-restore/README.md b/src/constructs/providers/huaweicloud/ccm-private-ca-restore/README.md new file mode 100644 index 00000000..9b287ce9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-ca-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_private_ca_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_private_ca_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore). diff --git a/src/constructs/providers/huaweicloud/ccm-private-ca-restore/index.ts b/src/constructs/providers/huaweicloud/ccm-private-ca-restore/index.ts new file mode 100644 index 00000000..0dcdc4b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-ca-restore/index.ts @@ -0,0 +1,173 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmPrivateCaRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * ID of the CA you want to restore. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore#ca_id CcmPrivateCaRestore#ca_id} + */ + readonly caId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore#id CcmPrivateCaRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore#region CcmPrivateCaRestore#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore huaweicloud_ccm_private_ca_restore} +*/ +export class CcmPrivateCaRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_ca_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmPrivateCaRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmPrivateCaRestore to import + * @param importFromId The id of the existing CcmPrivateCaRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmPrivateCaRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_ca_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_restore huaweicloud_ccm_private_ca_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmPrivateCaRestoreConfig + */ + public constructor(scope: Construct, id: string, config: CcmPrivateCaRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_ca_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._caId = config.caId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // ca_id - computed: false, optional: false, required: true + private _caId?: string; + public get caId() { + return this.getStringAttribute('ca_id'); + } + public set caId(value: string) { + this._caId = value; + } + // Temporarily expose input value. Use with caution. + public get caIdInput() { + return this._caId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + ca_id: cdktf.stringToTerraform(this._caId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + ca_id: { + value: cdktf.stringToHclTerraform(this._caId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-private-ca-revoke/README.md b/src/constructs/providers/huaweicloud/ccm-private-ca-revoke/README.md new file mode 100644 index 00000000..b51a8255 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-ca-revoke/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_private_ca_revoke` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_private_ca_revoke`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke). diff --git a/src/constructs/providers/huaweicloud/ccm-private-ca-revoke/index.ts b/src/constructs/providers/huaweicloud/ccm-private-ca-revoke/index.ts new file mode 100644 index 00000000..20ff5b52 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-ca-revoke/index.ts @@ -0,0 +1,197 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmPrivateCaRevokeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke#ca_id CcmPrivateCaRevoke#ca_id} + */ + readonly caId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke#id CcmPrivateCaRevoke#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke#reason CcmPrivateCaRevoke#reason} + */ + readonly reason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke#region CcmPrivateCaRevoke#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke huaweicloud_ccm_private_ca_revoke} +*/ +export class CcmPrivateCaRevoke extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_ca_revoke"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmPrivateCaRevoke resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmPrivateCaRevoke to import + * @param importFromId The id of the existing CcmPrivateCaRevoke that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmPrivateCaRevoke to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_ca_revoke", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca_revoke huaweicloud_ccm_private_ca_revoke} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmPrivateCaRevokeConfig + */ + public constructor(scope: Construct, id: string, config: CcmPrivateCaRevokeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_ca_revoke', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._caId = config.caId; + this._id = config.id; + this._reason = config.reason; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // ca_id - computed: false, optional: false, required: true + private _caId?: string; + public get caId() { + return this.getStringAttribute('ca_id'); + } + public set caId(value: string) { + this._caId = value; + } + // Temporarily expose input value. Use with caution. + public get caIdInput() { + return this._caId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // reason - computed: false, optional: true, required: false + private _reason?: string; + public get reason() { + return this.getStringAttribute('reason'); + } + public set reason(value: string) { + this._reason = value; + } + public resetReason() { + this._reason = undefined; + } + // Temporarily expose input value. Use with caution. + public get reasonInput() { + return this._reason; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + ca_id: cdktf.stringToTerraform(this._caId), + id: cdktf.stringToTerraform(this._id), + reason: cdktf.stringToTerraform(this._reason), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + ca_id: { + value: cdktf.stringToHclTerraform(this._caId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reason: { + value: cdktf.stringToHclTerraform(this._reason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-private-ca/README.md b/src/constructs/providers/huaweicloud/ccm-private-ca/README.md new file mode 100644 index 00000000..e0b52a05 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-ca/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_private_ca` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_private_ca`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca). diff --git a/src/constructs/providers/huaweicloud/ccm-private-ca/index.ts b/src/constructs/providers/huaweicloud/ccm-private-ca/index.ts new file mode 100644 index 00000000..e0970da3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-ca/index.ts @@ -0,0 +1,1248 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmPrivateCaConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#action CcmPrivateCa#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#auto_renew CcmPrivateCa#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#charging_mode CcmPrivateCa#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#enterprise_project_id CcmPrivateCa#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#id CcmPrivateCa#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#issuer_id CcmPrivateCa#issuer_id} + */ + readonly issuerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#key_algorithm CcmPrivateCa#key_algorithm} + */ + readonly keyAlgorithm: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#key_usages CcmPrivateCa#key_usages} + */ + readonly keyUsages?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#path_length CcmPrivateCa#path_length} + */ + readonly pathLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#pending_days CcmPrivateCa#pending_days} + */ + readonly pendingDays: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#region CcmPrivateCa#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#signature_algorithm CcmPrivateCa#signature_algorithm} + */ + readonly signatureAlgorithm: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#tags CcmPrivateCa#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#type CcmPrivateCa#type} + */ + readonly type: string; + /** + * crl_configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#crl_configuration CcmPrivateCa#crl_configuration} + */ + readonly crlConfiguration?: CcmPrivateCaCrlConfiguration[] | cdktf.IResolvable; + /** + * distinguished_name block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#distinguished_name CcmPrivateCa#distinguished_name} + */ + readonly distinguishedName: CcmPrivateCaDistinguishedName[] | cdktf.IResolvable; + /** + * validity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#validity CcmPrivateCa#validity} + */ + readonly validity: CcmPrivateCaValidity[] | cdktf.IResolvable; +} +export interface CcmPrivateCaCrlConfiguration { + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#crl_name CcmPrivateCa#crl_name} + */ + readonly crlName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#enabled CcmPrivateCa#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#obs_bucket_name CcmPrivateCa#obs_bucket_name} + */ + readonly obsBucketName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#valid_days CcmPrivateCa#valid_days} + */ + readonly validDays?: number; +} + +export function ccmPrivateCaCrlConfigurationToTerraform(struct?: CcmPrivateCaCrlConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + crl_name: cdktf.stringToTerraform(struct!.crlName), + enabled: cdktf.booleanToTerraform(struct!.enabled), + obs_bucket_name: cdktf.stringToTerraform(struct!.obsBucketName), + valid_days: cdktf.numberToTerraform(struct!.validDays), + } +} + + +export function ccmPrivateCaCrlConfigurationToHclTerraform(struct?: CcmPrivateCaCrlConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + crl_name: { + value: cdktf.stringToHclTerraform(struct!.crlName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + obs_bucket_name: { + value: cdktf.stringToHclTerraform(struct!.obsBucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + valid_days: { + value: cdktf.numberToHclTerraform(struct!.validDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmPrivateCaCrlConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmPrivateCaCrlConfiguration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._crlName !== undefined) { + hasAnyValues = true; + internalValueResult.crlName = this._crlName; + } + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._obsBucketName !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketName = this._obsBucketName; + } + if (this._validDays !== undefined) { + hasAnyValues = true; + internalValueResult.validDays = this._validDays; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmPrivateCaCrlConfiguration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._crlName = undefined; + this._enabled = undefined; + this._obsBucketName = undefined; + this._validDays = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._crlName = value.crlName; + this._enabled = value.enabled; + this._obsBucketName = value.obsBucketName; + this._validDays = value.validDays; + } + } + + // crl_dis_point - computed: true, optional: false, required: false + public get crlDisPoint() { + return this.getStringAttribute('crl_dis_point'); + } + + // crl_name - computed: true, optional: true, required: false + private _crlName?: string; + public get crlName() { + return this.getStringAttribute('crl_name'); + } + public set crlName(value: string) { + this._crlName = value; + } + public resetCrlName() { + this._crlName = undefined; + } + // Temporarily expose input value. Use with caution. + public get crlNameInput() { + return this._crlName; + } + + // enabled - computed: true, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // obs_bucket_name - computed: true, optional: true, required: false + private _obsBucketName?: string; + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + public set obsBucketName(value: string) { + this._obsBucketName = value; + } + public resetObsBucketName() { + this._obsBucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketNameInput() { + return this._obsBucketName; + } + + // valid_days - computed: true, optional: true, required: false + private _validDays?: number; + public get validDays() { + return this.getNumberAttribute('valid_days'); + } + public set validDays(value: number) { + this._validDays = value; + } + public resetValidDays() { + this._validDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get validDaysInput() { + return this._validDays; + } +} + +export class CcmPrivateCaCrlConfigurationList extends cdktf.ComplexList { + public internalValue? : CcmPrivateCaCrlConfiguration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmPrivateCaCrlConfigurationOutputReference { + return new CcmPrivateCaCrlConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcmPrivateCaDistinguishedName { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#common_name CcmPrivateCa#common_name} + */ + readonly commonName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#country CcmPrivateCa#country} + */ + readonly country: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#locality CcmPrivateCa#locality} + */ + readonly locality: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#organization CcmPrivateCa#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#organizational_unit CcmPrivateCa#organizational_unit} + */ + readonly organizationalUnit: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#state CcmPrivateCa#state} + */ + readonly state: string; +} + +export function ccmPrivateCaDistinguishedNameToTerraform(struct?: CcmPrivateCaDistinguishedName | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + common_name: cdktf.stringToTerraform(struct!.commonName), + country: cdktf.stringToTerraform(struct!.country), + locality: cdktf.stringToTerraform(struct!.locality), + organization: cdktf.stringToTerraform(struct!.organization), + organizational_unit: cdktf.stringToTerraform(struct!.organizationalUnit), + state: cdktf.stringToTerraform(struct!.state), + } +} + + +export function ccmPrivateCaDistinguishedNameToHclTerraform(struct?: CcmPrivateCaDistinguishedName | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + common_name: { + value: cdktf.stringToHclTerraform(struct!.commonName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country: { + value: cdktf.stringToHclTerraform(struct!.country), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + locality: { + value: cdktf.stringToHclTerraform(struct!.locality), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(struct!.organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organizational_unit: { + value: cdktf.stringToHclTerraform(struct!.organizationalUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(struct!.state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmPrivateCaDistinguishedNameOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmPrivateCaDistinguishedName | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._commonName !== undefined) { + hasAnyValues = true; + internalValueResult.commonName = this._commonName; + } + if (this._country !== undefined) { + hasAnyValues = true; + internalValueResult.country = this._country; + } + if (this._locality !== undefined) { + hasAnyValues = true; + internalValueResult.locality = this._locality; + } + if (this._organization !== undefined) { + hasAnyValues = true; + internalValueResult.organization = this._organization; + } + if (this._organizationalUnit !== undefined) { + hasAnyValues = true; + internalValueResult.organizationalUnit = this._organizationalUnit; + } + if (this._state !== undefined) { + hasAnyValues = true; + internalValueResult.state = this._state; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmPrivateCaDistinguishedName | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._commonName = undefined; + this._country = undefined; + this._locality = undefined; + this._organization = undefined; + this._organizationalUnit = undefined; + this._state = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._commonName = value.commonName; + this._country = value.country; + this._locality = value.locality; + this._organization = value.organization; + this._organizationalUnit = value.organizationalUnit; + this._state = value.state; + } + } + + // common_name - computed: false, optional: false, required: true + private _commonName?: string; + public get commonName() { + return this.getStringAttribute('common_name'); + } + public set commonName(value: string) { + this._commonName = value; + } + // Temporarily expose input value. Use with caution. + public get commonNameInput() { + return this._commonName; + } + + // country - computed: false, optional: false, required: true + private _country?: string; + public get country() { + return this.getStringAttribute('country'); + } + public set country(value: string) { + this._country = value; + } + // Temporarily expose input value. Use with caution. + public get countryInput() { + return this._country; + } + + // locality - computed: false, optional: false, required: true + private _locality?: string; + public get locality() { + return this.getStringAttribute('locality'); + } + public set locality(value: string) { + this._locality = value; + } + // Temporarily expose input value. Use with caution. + public get localityInput() { + return this._locality; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // organizational_unit - computed: false, optional: false, required: true + private _organizationalUnit?: string; + public get organizationalUnit() { + return this.getStringAttribute('organizational_unit'); + } + public set organizationalUnit(value: string) { + this._organizationalUnit = value; + } + // Temporarily expose input value. Use with caution. + public get organizationalUnitInput() { + return this._organizationalUnit; + } + + // state - computed: false, optional: false, required: true + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } +} + +export class CcmPrivateCaDistinguishedNameList extends cdktf.ComplexList { + public internalValue? : CcmPrivateCaDistinguishedName[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmPrivateCaDistinguishedNameOutputReference { + return new CcmPrivateCaDistinguishedNameOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcmPrivateCaValidity { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#started_at CcmPrivateCa#started_at} + */ + readonly startedAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#type CcmPrivateCa#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#value CcmPrivateCa#value} + */ + readonly value: number; +} + +export function ccmPrivateCaValidityToTerraform(struct?: CcmPrivateCaValidity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + started_at: cdktf.stringToTerraform(struct!.startedAt), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function ccmPrivateCaValidityToHclTerraform(struct?: CcmPrivateCaValidity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + started_at: { + value: cdktf.stringToHclTerraform(struct!.startedAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmPrivateCaValidityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmPrivateCaValidity | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._startedAt !== undefined) { + hasAnyValues = true; + internalValueResult.startedAt = this._startedAt; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmPrivateCaValidity | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._startedAt = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._startedAt = value.startedAt; + this._type = value.type; + this._value = value.value; + } + } + + // started_at - computed: false, optional: true, required: false + private _startedAt?: string; + public get startedAt() { + return this.getStringAttribute('started_at'); + } + public set startedAt(value: string) { + this._startedAt = value; + } + public resetStartedAt() { + this._startedAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get startedAtInput() { + return this._startedAt; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CcmPrivateCaValidityList extends cdktf.ComplexList { + public internalValue? : CcmPrivateCaValidity[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmPrivateCaValidityOutputReference { + return new CcmPrivateCaValidityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca huaweicloud_ccm_private_ca} +*/ +export class CcmPrivateCa extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_ca"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmPrivateCa resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmPrivateCa to import + * @param importFromId The id of the existing CcmPrivateCa that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmPrivateCa to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_ca", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_ca huaweicloud_ccm_private_ca} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmPrivateCaConfig + */ + public constructor(scope: Construct, id: string, config: CcmPrivateCaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_ca', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._issuerId = config.issuerId; + this._keyAlgorithm = config.keyAlgorithm; + this._keyUsages = config.keyUsages; + this._pathLength = config.pathLength; + this._pendingDays = config.pendingDays; + this._region = config.region; + this._signatureAlgorithm = config.signatureAlgorithm; + this._tags = config.tags; + this._type = config.type; + this._crlConfiguration.internalValue = config.crlConfiguration; + this._distinguishedName.internalValue = config.distinguishedName; + this._validity.internalValue = config.validity; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // free_quota - computed: true, optional: false, required: false + public get freeQuota() { + return this.getNumberAttribute('free_quota'); + } + + // gen_mode - computed: true, optional: false, required: false + public get genMode() { + return this.getStringAttribute('gen_mode'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // issuer_id - computed: false, optional: true, required: false + private _issuerId?: string; + public get issuerId() { + return this.getStringAttribute('issuer_id'); + } + public set issuerId(value: string) { + this._issuerId = value; + } + public resetIssuerId() { + this._issuerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get issuerIdInput() { + return this._issuerId; + } + + // issuer_name - computed: true, optional: false, required: false + public get issuerName() { + return this.getStringAttribute('issuer_name'); + } + + // key_algorithm - computed: false, optional: false, required: true + private _keyAlgorithm?: string; + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + public set keyAlgorithm(value: string) { + this._keyAlgorithm = value; + } + // Temporarily expose input value. Use with caution. + public get keyAlgorithmInput() { + return this._keyAlgorithm; + } + + // key_usages - computed: false, optional: true, required: false + private _keyUsages?: string[]; + public get keyUsages() { + return this.getListAttribute('key_usages'); + } + public set keyUsages(value: string[]) { + this._keyUsages = value; + } + public resetKeyUsages() { + this._keyUsages = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyUsagesInput() { + return this._keyUsages; + } + + // path_length - computed: true, optional: true, required: false + private _pathLength?: number; + public get pathLength() { + return this.getNumberAttribute('path_length'); + } + public set pathLength(value: number) { + this._pathLength = value; + } + public resetPathLength() { + this._pathLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathLengthInput() { + return this._pathLength; + } + + // pending_days - computed: false, optional: false, required: true + private _pendingDays?: string; + public get pendingDays() { + return this.getStringAttribute('pending_days'); + } + public set pendingDays(value: string) { + this._pendingDays = value; + } + // Temporarily expose input value. Use with caution. + public get pendingDaysInput() { + return this._pendingDays; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: false, optional: false, required: true + private _signatureAlgorithm?: string; + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + public set signatureAlgorithm(value: string) { + this._signatureAlgorithm = value; + } + // Temporarily expose input value. Use with caution. + public get signatureAlgorithmInput() { + return this._signatureAlgorithm; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // crl_configuration - computed: false, optional: true, required: false + private _crlConfiguration = new CcmPrivateCaCrlConfigurationList(this, "crl_configuration", false); + public get crlConfiguration() { + return this._crlConfiguration; + } + public putCrlConfiguration(value: CcmPrivateCaCrlConfiguration[] | cdktf.IResolvable) { + this._crlConfiguration.internalValue = value; + } + public resetCrlConfiguration() { + this._crlConfiguration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get crlConfigurationInput() { + return this._crlConfiguration.internalValue; + } + + // distinguished_name - computed: false, optional: false, required: true + private _distinguishedName = new CcmPrivateCaDistinguishedNameList(this, "distinguished_name", false); + public get distinguishedName() { + return this._distinguishedName; + } + public putDistinguishedName(value: CcmPrivateCaDistinguishedName[] | cdktf.IResolvable) { + this._distinguishedName.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get distinguishedNameInput() { + return this._distinguishedName.internalValue; + } + + // validity - computed: false, optional: false, required: true + private _validity = new CcmPrivateCaValidityList(this, "validity", false); + public get validity() { + return this._validity; + } + public putValidity(value: CcmPrivateCaValidity[] | cdktf.IResolvable) { + this._validity.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get validityInput() { + return this._validity.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + issuer_id: cdktf.stringToTerraform(this._issuerId), + key_algorithm: cdktf.stringToTerraform(this._keyAlgorithm), + key_usages: cdktf.listMapper(cdktf.stringToTerraform, false)(this._keyUsages), + path_length: cdktf.numberToTerraform(this._pathLength), + pending_days: cdktf.stringToTerraform(this._pendingDays), + region: cdktf.stringToTerraform(this._region), + signature_algorithm: cdktf.stringToTerraform(this._signatureAlgorithm), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + crl_configuration: cdktf.listMapper(ccmPrivateCaCrlConfigurationToTerraform, true)(this._crlConfiguration.internalValue), + distinguished_name: cdktf.listMapper(ccmPrivateCaDistinguishedNameToTerraform, true)(this._distinguishedName.internalValue), + validity: cdktf.listMapper(ccmPrivateCaValidityToTerraform, true)(this._validity.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + issuer_id: { + value: cdktf.stringToHclTerraform(this._issuerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_algorithm: { + value: cdktf.stringToHclTerraform(this._keyAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_usages: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._keyUsages), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + path_length: { + value: cdktf.numberToHclTerraform(this._pathLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + pending_days: { + value: cdktf.stringToHclTerraform(this._pendingDays), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + signature_algorithm: { + value: cdktf.stringToHclTerraform(this._signatureAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + crl_configuration: { + value: cdktf.listMapperHcl(ccmPrivateCaCrlConfigurationToHclTerraform, true)(this._crlConfiguration.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmPrivateCaCrlConfigurationList", + }, + distinguished_name: { + value: cdktf.listMapperHcl(ccmPrivateCaDistinguishedNameToHclTerraform, true)(this._distinguishedName.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmPrivateCaDistinguishedNameList", + }, + validity: { + value: cdktf.listMapperHcl(ccmPrivateCaValidityToHclTerraform, true)(this._validity.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmPrivateCaValidityList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/README.md b/src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/README.md new file mode 100644 index 00000000..faef8f58 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_private_certificate_revoke` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_private_certificate_revoke`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke). diff --git a/src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/index.ts b/src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/index.ts new file mode 100644 index 00000000..3af9f787 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-certificate-revoke/index.ts @@ -0,0 +1,197 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmPrivateCertificateRevokeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke#certificate_id CcmPrivateCertificateRevoke#certificate_id} + */ + readonly certificateId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke#id CcmPrivateCertificateRevoke#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke#reason CcmPrivateCertificateRevoke#reason} + */ + readonly reason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke#region CcmPrivateCertificateRevoke#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke huaweicloud_ccm_private_certificate_revoke} +*/ +export class CcmPrivateCertificateRevoke extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_certificate_revoke"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmPrivateCertificateRevoke resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmPrivateCertificateRevoke to import + * @param importFromId The id of the existing CcmPrivateCertificateRevoke that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmPrivateCertificateRevoke to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_certificate_revoke", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate_revoke huaweicloud_ccm_private_certificate_revoke} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmPrivateCertificateRevokeConfig + */ + public constructor(scope: Construct, id: string, config: CcmPrivateCertificateRevokeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_certificate_revoke', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._id = config.id; + this._reason = config.reason; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate_id - computed: false, optional: false, required: true + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // reason - computed: false, optional: true, required: false + private _reason?: string; + public get reason() { + return this.getStringAttribute('reason'); + } + public set reason(value: string) { + this._reason = value; + } + public resetReason() { + this._reason = undefined; + } + // Temporarily expose input value. Use with caution. + public get reasonInput() { + return this._reason; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + id: cdktf.stringToTerraform(this._id), + reason: cdktf.stringToTerraform(this._reason), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reason: { + value: cdktf.stringToHclTerraform(this._reason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ccm-private-certificate/README.md b/src/constructs/providers/huaweicloud/ccm-private-certificate/README.md new file mode 100644 index 00000000..1041dad4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ccm_private_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_ccm_private_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate). diff --git a/src/constructs/providers/huaweicloud/ccm-private-certificate/index.ts b/src/constructs/providers/huaweicloud/ccm-private-certificate/index.ts new file mode 100644 index 00000000..9eade679 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ccm-private-certificate/index.ts @@ -0,0 +1,1214 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CcmPrivateCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#client_auth CcmPrivateCertificate#client_auth} + */ + readonly clientAuth?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#code_signing CcmPrivateCertificate#code_signing} + */ + readonly codeSigning?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#email_protection CcmPrivateCertificate#email_protection} + */ + readonly emailProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#enterprise_project_id CcmPrivateCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#id CcmPrivateCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#issuer_id CcmPrivateCertificate#issuer_id} + */ + readonly issuerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#key_algorithm CcmPrivateCertificate#key_algorithm} + */ + readonly keyAlgorithm: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#key_usage CcmPrivateCertificate#key_usage} + */ + readonly keyUsage?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#object_identifier CcmPrivateCertificate#object_identifier} + */ + readonly objectIdentifier?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#object_identifier_value CcmPrivateCertificate#object_identifier_value} + */ + readonly objectIdentifierValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#region CcmPrivateCertificate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#server_auth CcmPrivateCertificate#server_auth} + */ + readonly serverAuth?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#signature_algorithm CcmPrivateCertificate#signature_algorithm} + */ + readonly signatureAlgorithm: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#tags CcmPrivateCertificate#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#time_stamping CcmPrivateCertificate#time_stamping} + */ + readonly timeStamping?: boolean | cdktf.IResolvable; + /** + * distinguished_name block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#distinguished_name CcmPrivateCertificate#distinguished_name} + */ + readonly distinguishedName: CcmPrivateCertificateDistinguishedName[] | cdktf.IResolvable; + /** + * subject_alternative_names block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#subject_alternative_names CcmPrivateCertificate#subject_alternative_names} + */ + readonly subjectAlternativeNames?: CcmPrivateCertificateSubjectAlternativeNames[] | cdktf.IResolvable; + /** + * validity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#validity CcmPrivateCertificate#validity} + */ + readonly validity: CcmPrivateCertificateValidity[] | cdktf.IResolvable; +} +export interface CcmPrivateCertificateDistinguishedName { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#common_name CcmPrivateCertificate#common_name} + */ + readonly commonName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#country CcmPrivateCertificate#country} + */ + readonly country?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#locality CcmPrivateCertificate#locality} + */ + readonly locality?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#organization CcmPrivateCertificate#organization} + */ + readonly organization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#organizational_unit CcmPrivateCertificate#organizational_unit} + */ + readonly organizationalUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#state CcmPrivateCertificate#state} + */ + readonly state?: string; +} + +export function ccmPrivateCertificateDistinguishedNameToTerraform(struct?: CcmPrivateCertificateDistinguishedName | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + common_name: cdktf.stringToTerraform(struct!.commonName), + country: cdktf.stringToTerraform(struct!.country), + locality: cdktf.stringToTerraform(struct!.locality), + organization: cdktf.stringToTerraform(struct!.organization), + organizational_unit: cdktf.stringToTerraform(struct!.organizationalUnit), + state: cdktf.stringToTerraform(struct!.state), + } +} + + +export function ccmPrivateCertificateDistinguishedNameToHclTerraform(struct?: CcmPrivateCertificateDistinguishedName | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + common_name: { + value: cdktf.stringToHclTerraform(struct!.commonName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country: { + value: cdktf.stringToHclTerraform(struct!.country), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + locality: { + value: cdktf.stringToHclTerraform(struct!.locality), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(struct!.organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organizational_unit: { + value: cdktf.stringToHclTerraform(struct!.organizationalUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(struct!.state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmPrivateCertificateDistinguishedNameOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmPrivateCertificateDistinguishedName | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._commonName !== undefined) { + hasAnyValues = true; + internalValueResult.commonName = this._commonName; + } + if (this._country !== undefined) { + hasAnyValues = true; + internalValueResult.country = this._country; + } + if (this._locality !== undefined) { + hasAnyValues = true; + internalValueResult.locality = this._locality; + } + if (this._organization !== undefined) { + hasAnyValues = true; + internalValueResult.organization = this._organization; + } + if (this._organizationalUnit !== undefined) { + hasAnyValues = true; + internalValueResult.organizationalUnit = this._organizationalUnit; + } + if (this._state !== undefined) { + hasAnyValues = true; + internalValueResult.state = this._state; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmPrivateCertificateDistinguishedName | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._commonName = undefined; + this._country = undefined; + this._locality = undefined; + this._organization = undefined; + this._organizationalUnit = undefined; + this._state = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._commonName = value.commonName; + this._country = value.country; + this._locality = value.locality; + this._organization = value.organization; + this._organizationalUnit = value.organizationalUnit; + this._state = value.state; + } + } + + // common_name - computed: false, optional: false, required: true + private _commonName?: string; + public get commonName() { + return this.getStringAttribute('common_name'); + } + public set commonName(value: string) { + this._commonName = value; + } + // Temporarily expose input value. Use with caution. + public get commonNameInput() { + return this._commonName; + } + + // country - computed: true, optional: true, required: false + private _country?: string; + public get country() { + return this.getStringAttribute('country'); + } + public set country(value: string) { + this._country = value; + } + public resetCountry() { + this._country = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryInput() { + return this._country; + } + + // locality - computed: true, optional: true, required: false + private _locality?: string; + public get locality() { + return this.getStringAttribute('locality'); + } + public set locality(value: string) { + this._locality = value; + } + public resetLocality() { + this._locality = undefined; + } + // Temporarily expose input value. Use with caution. + public get localityInput() { + return this._locality; + } + + // organization - computed: true, optional: true, required: false + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + public resetOrganization() { + this._organization = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // organizational_unit - computed: true, optional: true, required: false + private _organizationalUnit?: string; + public get organizationalUnit() { + return this.getStringAttribute('organizational_unit'); + } + public set organizationalUnit(value: string) { + this._organizationalUnit = value; + } + public resetOrganizationalUnit() { + this._organizationalUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationalUnitInput() { + return this._organizationalUnit; + } + + // state - computed: true, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } +} + +export class CcmPrivateCertificateDistinguishedNameList extends cdktf.ComplexList { + public internalValue? : CcmPrivateCertificateDistinguishedName[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmPrivateCertificateDistinguishedNameOutputReference { + return new CcmPrivateCertificateDistinguishedNameOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcmPrivateCertificateSubjectAlternativeNames { + /** + * Type of the alternative name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#type CcmPrivateCertificate#type} + */ + readonly type: string; + /** + * Value of the corresponding alternative name type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#value CcmPrivateCertificate#value} + */ + readonly value: string; +} + +export function ccmPrivateCertificateSubjectAlternativeNamesToTerraform(struct?: CcmPrivateCertificateSubjectAlternativeNames | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ccmPrivateCertificateSubjectAlternativeNamesToHclTerraform(struct?: CcmPrivateCertificateSubjectAlternativeNames | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmPrivateCertificateSubjectAlternativeNamesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmPrivateCertificateSubjectAlternativeNames | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmPrivateCertificateSubjectAlternativeNames | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._type = value.type; + this._value = value.value; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CcmPrivateCertificateSubjectAlternativeNamesList extends cdktf.ComplexList { + public internalValue? : CcmPrivateCertificateSubjectAlternativeNames[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmPrivateCertificateSubjectAlternativeNamesOutputReference { + return new CcmPrivateCertificateSubjectAlternativeNamesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CcmPrivateCertificateValidity { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#start_at CcmPrivateCertificate#start_at} + */ + readonly startAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#type CcmPrivateCertificate#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#value CcmPrivateCertificate#value} + */ + readonly value: number; +} + +export function ccmPrivateCertificateValidityToTerraform(struct?: CcmPrivateCertificateValidity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + start_at: cdktf.stringToTerraform(struct!.startAt), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function ccmPrivateCertificateValidityToHclTerraform(struct?: CcmPrivateCertificateValidity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + start_at: { + value: cdktf.stringToHclTerraform(struct!.startAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CcmPrivateCertificateValidityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CcmPrivateCertificateValidity | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._startAt !== undefined) { + hasAnyValues = true; + internalValueResult.startAt = this._startAt; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CcmPrivateCertificateValidity | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._startAt = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._startAt = value.startAt; + this._type = value.type; + this._value = value.value; + } + } + + // start_at - computed: false, optional: true, required: false + private _startAt?: string; + public get startAt() { + return this.getStringAttribute('start_at'); + } + public set startAt(value: string) { + this._startAt = value; + } + public resetStartAt() { + this._startAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get startAtInput() { + return this._startAt; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CcmPrivateCertificateValidityList extends cdktf.ComplexList { + public internalValue? : CcmPrivateCertificateValidity[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CcmPrivateCertificateValidityOutputReference { + return new CcmPrivateCertificateValidityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate huaweicloud_ccm_private_certificate} +*/ +export class CcmPrivateCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CcmPrivateCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CcmPrivateCertificate to import + * @param importFromId The id of the existing CcmPrivateCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CcmPrivateCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ccm_private_certificate huaweicloud_ccm_private_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CcmPrivateCertificateConfig + */ + public constructor(scope: Construct, id: string, config: CcmPrivateCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clientAuth = config.clientAuth; + this._codeSigning = config.codeSigning; + this._emailProtection = config.emailProtection; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._issuerId = config.issuerId; + this._keyAlgorithm = config.keyAlgorithm; + this._keyUsage = config.keyUsage; + this._objectIdentifier = config.objectIdentifier; + this._objectIdentifierValue = config.objectIdentifierValue; + this._region = config.region; + this._serverAuth = config.serverAuth; + this._signatureAlgorithm = config.signatureAlgorithm; + this._tags = config.tags; + this._timeStamping = config.timeStamping; + this._distinguishedName.internalValue = config.distinguishedName; + this._subjectAlternativeNames.internalValue = config.subjectAlternativeNames; + this._validity.internalValue = config.validity; + } + + // ========== + // ATTRIBUTES + // ========== + + // client_auth - computed: false, optional: true, required: false + private _clientAuth?: boolean | cdktf.IResolvable; + public get clientAuth() { + return this.getBooleanAttribute('client_auth'); + } + public set clientAuth(value: boolean | cdktf.IResolvable) { + this._clientAuth = value; + } + public resetClientAuth() { + this._clientAuth = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientAuthInput() { + return this._clientAuth; + } + + // code_signing - computed: false, optional: true, required: false + private _codeSigning?: boolean | cdktf.IResolvable; + public get codeSigning() { + return this.getBooleanAttribute('code_signing'); + } + public set codeSigning(value: boolean | cdktf.IResolvable) { + this._codeSigning = value; + } + public resetCodeSigning() { + this._codeSigning = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeSigningInput() { + return this._codeSigning; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // email_protection - computed: false, optional: true, required: false + private _emailProtection?: boolean | cdktf.IResolvable; + public get emailProtection() { + return this.getBooleanAttribute('email_protection'); + } + public set emailProtection(value: boolean | cdktf.IResolvable) { + this._emailProtection = value; + } + public resetEmailProtection() { + this._emailProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailProtectionInput() { + return this._emailProtection; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // gen_mode - computed: true, optional: false, required: false + public get genMode() { + return this.getStringAttribute('gen_mode'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // issuer_id - computed: false, optional: false, required: true + private _issuerId?: string; + public get issuerId() { + return this.getStringAttribute('issuer_id'); + } + public set issuerId(value: string) { + this._issuerId = value; + } + // Temporarily expose input value. Use with caution. + public get issuerIdInput() { + return this._issuerId; + } + + // issuer_name - computed: true, optional: false, required: false + public get issuerName() { + return this.getStringAttribute('issuer_name'); + } + + // key_algorithm - computed: false, optional: false, required: true + private _keyAlgorithm?: string; + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + public set keyAlgorithm(value: string) { + this._keyAlgorithm = value; + } + // Temporarily expose input value. Use with caution. + public get keyAlgorithmInput() { + return this._keyAlgorithm; + } + + // key_usage - computed: false, optional: true, required: false + private _keyUsage?: string[]; + public get keyUsage() { + return this.getListAttribute('key_usage'); + } + public set keyUsage(value: string[]) { + this._keyUsage = value; + } + public resetKeyUsage() { + this._keyUsage = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyUsageInput() { + return this._keyUsage; + } + + // object_identifier - computed: false, optional: true, required: false + private _objectIdentifier?: string; + public get objectIdentifier() { + return this.getStringAttribute('object_identifier'); + } + public set objectIdentifier(value: string) { + this._objectIdentifier = value; + } + public resetObjectIdentifier() { + this._objectIdentifier = undefined; + } + // Temporarily expose input value. Use with caution. + public get objectIdentifierInput() { + return this._objectIdentifier; + } + + // object_identifier_value - computed: false, optional: true, required: false + private _objectIdentifierValue?: string; + public get objectIdentifierValue() { + return this.getStringAttribute('object_identifier_value'); + } + public set objectIdentifierValue(value: string) { + this._objectIdentifierValue = value; + } + public resetObjectIdentifierValue() { + this._objectIdentifierValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get objectIdentifierValueInput() { + return this._objectIdentifierValue; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_auth - computed: false, optional: true, required: false + private _serverAuth?: boolean | cdktf.IResolvable; + public get serverAuth() { + return this.getBooleanAttribute('server_auth'); + } + public set serverAuth(value: boolean | cdktf.IResolvable) { + this._serverAuth = value; + } + public resetServerAuth() { + this._serverAuth = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverAuthInput() { + return this._serverAuth; + } + + // signature_algorithm - computed: false, optional: false, required: true + private _signatureAlgorithm?: string; + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + public set signatureAlgorithm(value: string) { + this._signatureAlgorithm = value; + } + // Temporarily expose input value. Use with caution. + public get signatureAlgorithmInput() { + return this._signatureAlgorithm; + } + + // start_at - computed: true, optional: false, required: false + public get startAt() { + return this.getStringAttribute('start_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // time_stamping - computed: false, optional: true, required: false + private _timeStamping?: boolean | cdktf.IResolvable; + public get timeStamping() { + return this.getBooleanAttribute('time_stamping'); + } + public set timeStamping(value: boolean | cdktf.IResolvable) { + this._timeStamping = value; + } + public resetTimeStamping() { + this._timeStamping = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeStampingInput() { + return this._timeStamping; + } + + // distinguished_name - computed: false, optional: false, required: true + private _distinguishedName = new CcmPrivateCertificateDistinguishedNameList(this, "distinguished_name", false); + public get distinguishedName() { + return this._distinguishedName; + } + public putDistinguishedName(value: CcmPrivateCertificateDistinguishedName[] | cdktf.IResolvable) { + this._distinguishedName.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get distinguishedNameInput() { + return this._distinguishedName.internalValue; + } + + // subject_alternative_names - computed: false, optional: true, required: false + private _subjectAlternativeNames = new CcmPrivateCertificateSubjectAlternativeNamesList(this, "subject_alternative_names", false); + public get subjectAlternativeNames() { + return this._subjectAlternativeNames; + } + public putSubjectAlternativeNames(value: CcmPrivateCertificateSubjectAlternativeNames[] | cdktf.IResolvable) { + this._subjectAlternativeNames.internalValue = value; + } + public resetSubjectAlternativeNames() { + this._subjectAlternativeNames.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get subjectAlternativeNamesInput() { + return this._subjectAlternativeNames.internalValue; + } + + // validity - computed: false, optional: false, required: true + private _validity = new CcmPrivateCertificateValidityList(this, "validity", false); + public get validity() { + return this._validity; + } + public putValidity(value: CcmPrivateCertificateValidity[] | cdktf.IResolvable) { + this._validity.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get validityInput() { + return this._validity.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + client_auth: cdktf.booleanToTerraform(this._clientAuth), + code_signing: cdktf.booleanToTerraform(this._codeSigning), + email_protection: cdktf.booleanToTerraform(this._emailProtection), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + issuer_id: cdktf.stringToTerraform(this._issuerId), + key_algorithm: cdktf.stringToTerraform(this._keyAlgorithm), + key_usage: cdktf.listMapper(cdktf.stringToTerraform, false)(this._keyUsage), + object_identifier: cdktf.stringToTerraform(this._objectIdentifier), + object_identifier_value: cdktf.stringToTerraform(this._objectIdentifierValue), + region: cdktf.stringToTerraform(this._region), + server_auth: cdktf.booleanToTerraform(this._serverAuth), + signature_algorithm: cdktf.stringToTerraform(this._signatureAlgorithm), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + time_stamping: cdktf.booleanToTerraform(this._timeStamping), + distinguished_name: cdktf.listMapper(ccmPrivateCertificateDistinguishedNameToTerraform, true)(this._distinguishedName.internalValue), + subject_alternative_names: cdktf.listMapper(ccmPrivateCertificateSubjectAlternativeNamesToTerraform, true)(this._subjectAlternativeNames.internalValue), + validity: cdktf.listMapper(ccmPrivateCertificateValidityToTerraform, true)(this._validity.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + client_auth: { + value: cdktf.booleanToHclTerraform(this._clientAuth), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + code_signing: { + value: cdktf.booleanToHclTerraform(this._codeSigning), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + email_protection: { + value: cdktf.booleanToHclTerraform(this._emailProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + issuer_id: { + value: cdktf.stringToHclTerraform(this._issuerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_algorithm: { + value: cdktf.stringToHclTerraform(this._keyAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_usage: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._keyUsage), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + object_identifier: { + value: cdktf.stringToHclTerraform(this._objectIdentifier), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_identifier_value: { + value: cdktf.stringToHclTerraform(this._objectIdentifierValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_auth: { + value: cdktf.booleanToHclTerraform(this._serverAuth), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + signature_algorithm: { + value: cdktf.stringToHclTerraform(this._signatureAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + time_stamping: { + value: cdktf.booleanToHclTerraform(this._timeStamping), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + distinguished_name: { + value: cdktf.listMapperHcl(ccmPrivateCertificateDistinguishedNameToHclTerraform, true)(this._distinguishedName.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmPrivateCertificateDistinguishedNameList", + }, + subject_alternative_names: { + value: cdktf.listMapperHcl(ccmPrivateCertificateSubjectAlternativeNamesToHclTerraform, true)(this._subjectAlternativeNames.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmPrivateCertificateSubjectAlternativeNamesList", + }, + validity: { + value: cdktf.listMapperHcl(ccmPrivateCertificateValidityToHclTerraform, true)(this._validity.internalValue), + isBlock: true, + type: "list", + storageClassType: "CcmPrivateCertificateValidityList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdm-cluster-action/README.md b/src/constructs/providers/huaweicloud/cdm-cluster-action/README.md new file mode 100644 index 00000000..9b62ab23 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-cluster-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdm_cluster_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdm_cluster_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action). diff --git a/src/constructs/providers/huaweicloud/cdm-cluster-action/index.ts b/src/constructs/providers/huaweicloud/cdm-cluster-action/index.ts new file mode 100644 index 00000000..df039eba --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-cluster-action/index.ts @@ -0,0 +1,502 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdmClusterActionConfig extends cdktf.TerraformMetaArguments { + /** + * ID of CDM cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#cluster_id CdmClusterAction#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#id CdmClusterAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#region CdmClusterAction#region} + */ + readonly region?: string; + /** + * Action type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#type CdmClusterAction#type} + */ + readonly type: string; + /** + * restart block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#restart CdmClusterAction#restart} + */ + readonly restart?: CdmClusterActionRestart; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#timeouts CdmClusterAction#timeouts} + */ + readonly timeouts?: CdmClusterActionTimeouts; +} +export interface CdmClusterActionRestart { + /** + * Restart delay, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#delay_time CdmClusterAction#delay_time} + */ + readonly delayTime?: number; + /** + * Restart level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#level CdmClusterAction#level} + */ + readonly level: string; + /** + * Restart mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#mode CdmClusterAction#mode} + */ + readonly mode: string; +} + +export function cdmClusterActionRestartToTerraform(struct?: CdmClusterActionRestartOutputReference | CdmClusterActionRestart): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delay_time: cdktf.numberToTerraform(struct!.delayTime), + level: cdktf.stringToTerraform(struct!.level), + mode: cdktf.stringToTerraform(struct!.mode), + } +} + + +export function cdmClusterActionRestartToHclTerraform(struct?: CdmClusterActionRestartOutputReference | CdmClusterActionRestart): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delay_time: { + value: cdktf.numberToHclTerraform(struct!.delayTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + level: { + value: cdktf.stringToHclTerraform(struct!.level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdmClusterActionRestartOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdmClusterActionRestart | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delayTime !== undefined) { + hasAnyValues = true; + internalValueResult.delayTime = this._delayTime; + } + if (this._level !== undefined) { + hasAnyValues = true; + internalValueResult.level = this._level; + } + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmClusterActionRestart | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delayTime = undefined; + this._level = undefined; + this._mode = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delayTime = value.delayTime; + this._level = value.level; + this._mode = value.mode; + } + } + + // delay_time - computed: false, optional: true, required: false + private _delayTime?: number; + public get delayTime() { + return this.getNumberAttribute('delay_time'); + } + public set delayTime(value: number) { + this._delayTime = value; + } + public resetDelayTime() { + this._delayTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get delayTimeInput() { + return this._delayTime; + } + + // level - computed: false, optional: false, required: true + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } +} +export interface CdmClusterActionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#create CdmClusterAction#create} + */ + readonly create?: string; +} + +export function cdmClusterActionTimeoutsToTerraform(struct?: CdmClusterActionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cdmClusterActionTimeoutsToHclTerraform(struct?: CdmClusterActionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdmClusterActionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CdmClusterActionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmClusterActionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action huaweicloud_cdm_cluster_action} +*/ +export class CdmClusterAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_cluster_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdmClusterAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdmClusterAction to import + * @param importFromId The id of the existing CdmClusterAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdmClusterAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_cluster_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_action huaweicloud_cdm_cluster_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdmClusterActionConfig + */ + public constructor(scope: Construct, id: string, config: CdmClusterActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_cluster_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._type = config.type; + this._restart.internalValue = config.restart; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // restart - computed: false, optional: true, required: false + private _restart = new CdmClusterActionRestartOutputReference(this, "restart"); + public get restart() { + return this._restart; + } + public putRestart(value: CdmClusterActionRestart) { + this._restart.internalValue = value; + } + public resetRestart() { + this._restart.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get restartInput() { + return this._restart.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CdmClusterActionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CdmClusterActionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + restart: cdmClusterActionRestartToTerraform(this._restart.internalValue), + timeouts: cdmClusterActionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restart: { + value: cdmClusterActionRestartToHclTerraform(this._restart.internalValue), + isBlock: true, + type: "list", + storageClassType: "CdmClusterActionRestartList", + }, + timeouts: { + value: cdmClusterActionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CdmClusterActionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdm-cluster-v1/README.md b/src/constructs/providers/huaweicloud/cdm-cluster-v1/README.md new file mode 100644 index 00000000..16839d78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-cluster-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdm_cluster_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdm_cluster_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1). diff --git a/src/constructs/providers/huaweicloud/cdm-cluster-v1/index.ts b/src/constructs/providers/huaweicloud/cdm-cluster-v1/index.ts new file mode 100644 index 00000000..7ee563a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-cluster-v1/index.ts @@ -0,0 +1,788 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdmClusterV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#availability_zone CdmClusterV1#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#email CdmClusterV1#email} + */ + readonly email?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#enterprise_project_id CdmClusterV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#flavor_id CdmClusterV1#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#id CdmClusterV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#is_auto_off CdmClusterV1#is_auto_off} + */ + readonly isAutoOff?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#name CdmClusterV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#phone_num CdmClusterV1#phone_num} + */ + readonly phoneNum?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#region CdmClusterV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#schedule_boot_time CdmClusterV1#schedule_boot_time} + */ + readonly scheduleBootTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#schedule_off_time CdmClusterV1#schedule_off_time} + */ + readonly scheduleOffTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#security_group_id CdmClusterV1#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#subnet_id CdmClusterV1#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#version CdmClusterV1#version} + */ + readonly version?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#vpc_id CdmClusterV1#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#timeouts CdmClusterV1#timeouts} + */ + readonly timeouts?: CdmClusterV1Timeouts; +} +export interface CdmClusterV1Instances { +} + +export function cdmClusterV1InstancesToTerraform(struct?: CdmClusterV1Instances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cdmClusterV1InstancesToHclTerraform(struct?: CdmClusterV1Instances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CdmClusterV1InstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdmClusterV1Instances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmClusterV1Instances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // manage_ip - computed: true, optional: false, required: false + public get manageIp() { + return this.getStringAttribute('manage_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // traffic_ip - computed: true, optional: false, required: false + public get trafficIp() { + return this.getStringAttribute('traffic_ip'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CdmClusterV1InstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdmClusterV1InstancesOutputReference { + return new CdmClusterV1InstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdmClusterV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#create CdmClusterV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#delete CdmClusterV1#delete} + */ + readonly delete?: string; +} + +export function cdmClusterV1TimeoutsToTerraform(struct?: CdmClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cdmClusterV1TimeoutsToHclTerraform(struct?: CdmClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdmClusterV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CdmClusterV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmClusterV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1 huaweicloud_cdm_cluster_v1} +*/ +export class CdmClusterV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_cluster_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdmClusterV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdmClusterV1 to import + * @param importFromId The id of the existing CdmClusterV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdmClusterV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_cluster_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster_v1 huaweicloud_cdm_cluster_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdmClusterV1Config + */ + public constructor(scope: Construct, id: string, config: CdmClusterV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_cluster_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._email = config.email; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._isAutoOff = config.isAutoOff; + this._name = config.name; + this._phoneNum = config.phoneNum; + this._region = config.region; + this._scheduleBootTime = config.scheduleBootTime; + this._scheduleOffTime = config.scheduleOffTime; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._version = config.version; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // email - computed: false, optional: true, required: false + private _email?: string[]; + public get email() { + return cdktf.Fn.tolist(this.getListAttribute('email')); + } + public set email(value: string[]) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new CdmClusterV1InstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // is_auto_off - computed: true, optional: true, required: false + private _isAutoOff?: boolean | cdktf.IResolvable; + public get isAutoOff() { + return this.getBooleanAttribute('is_auto_off'); + } + public set isAutoOff(value: boolean | cdktf.IResolvable) { + this._isAutoOff = value; + } + public resetIsAutoOff() { + this._isAutoOff = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAutoOffInput() { + return this._isAutoOff; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // phone_num - computed: false, optional: true, required: false + private _phoneNum?: string[]; + public get phoneNum() { + return cdktf.Fn.tolist(this.getListAttribute('phone_num')); + } + public set phoneNum(value: string[]) { + this._phoneNum = value; + } + public resetPhoneNum() { + this._phoneNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneNumInput() { + return this._phoneNum; + } + + // public_endpoint - computed: true, optional: false, required: false + public get publicEndpoint() { + return this.getStringAttribute('public_endpoint'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schedule_boot_time - computed: true, optional: true, required: false + private _scheduleBootTime?: string; + public get scheduleBootTime() { + return this.getStringAttribute('schedule_boot_time'); + } + public set scheduleBootTime(value: string) { + this._scheduleBootTime = value; + } + public resetScheduleBootTime() { + this._scheduleBootTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleBootTimeInput() { + return this._scheduleBootTime; + } + + // schedule_off_time - computed: true, optional: true, required: false + private _scheduleOffTime?: string; + public get scheduleOffTime() { + return this.getStringAttribute('schedule_off_time'); + } + public set scheduleOffTime(value: string) { + this._scheduleOffTime = value; + } + public resetScheduleOffTime() { + this._scheduleOffTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleOffTimeInput() { + return this._scheduleOffTime; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CdmClusterV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CdmClusterV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + email: cdktf.listMapper(cdktf.stringToTerraform, false)(this._email), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + is_auto_off: cdktf.booleanToTerraform(this._isAutoOff), + name: cdktf.stringToTerraform(this._name), + phone_num: cdktf.listMapper(cdktf.stringToTerraform, false)(this._phoneNum), + region: cdktf.stringToTerraform(this._region), + schedule_boot_time: cdktf.stringToTerraform(this._scheduleBootTime), + schedule_off_time: cdktf.stringToTerraform(this._scheduleOffTime), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + version: cdktf.stringToTerraform(this._version), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: cdmClusterV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._email), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_auto_off: { + value: cdktf.booleanToHclTerraform(this._isAutoOff), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_num: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._phoneNum), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_boot_time: { + value: cdktf.stringToHclTerraform(this._scheduleBootTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_off_time: { + value: cdktf.stringToHclTerraform(this._scheduleOffTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cdmClusterV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CdmClusterV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdm-cluster/README.md b/src/constructs/providers/huaweicloud/cdm-cluster/README.md new file mode 100644 index 00000000..a02183df --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdm_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdm_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster). diff --git a/src/constructs/providers/huaweicloud/cdm-cluster/index.ts b/src/constructs/providers/huaweicloud/cdm-cluster/index.ts new file mode 100644 index 00000000..45c4e0fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-cluster/index.ts @@ -0,0 +1,788 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdmClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#availability_zone CdmCluster#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#email CdmCluster#email} + */ + readonly email?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#enterprise_project_id CdmCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#flavor_id CdmCluster#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#id CdmCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#is_auto_off CdmCluster#is_auto_off} + */ + readonly isAutoOff?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#name CdmCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#phone_num CdmCluster#phone_num} + */ + readonly phoneNum?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#region CdmCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#schedule_boot_time CdmCluster#schedule_boot_time} + */ + readonly scheduleBootTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#schedule_off_time CdmCluster#schedule_off_time} + */ + readonly scheduleOffTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#security_group_id CdmCluster#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#subnet_id CdmCluster#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#version CdmCluster#version} + */ + readonly version?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#vpc_id CdmCluster#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#timeouts CdmCluster#timeouts} + */ + readonly timeouts?: CdmClusterTimeouts; +} +export interface CdmClusterInstances { +} + +export function cdmClusterInstancesToTerraform(struct?: CdmClusterInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cdmClusterInstancesToHclTerraform(struct?: CdmClusterInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CdmClusterInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdmClusterInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmClusterInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // manage_ip - computed: true, optional: false, required: false + public get manageIp() { + return this.getStringAttribute('manage_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // traffic_ip - computed: true, optional: false, required: false + public get trafficIp() { + return this.getStringAttribute('traffic_ip'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CdmClusterInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdmClusterInstancesOutputReference { + return new CdmClusterInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdmClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#create CdmCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#delete CdmCluster#delete} + */ + readonly delete?: string; +} + +export function cdmClusterTimeoutsToTerraform(struct?: CdmClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cdmClusterTimeoutsToHclTerraform(struct?: CdmClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdmClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CdmClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster huaweicloud_cdm_cluster} +*/ +export class CdmCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdmCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdmCluster to import + * @param importFromId The id of the existing CdmCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdmCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_cluster huaweicloud_cdm_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdmClusterConfig + */ + public constructor(scope: Construct, id: string, config: CdmClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._email = config.email; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._isAutoOff = config.isAutoOff; + this._name = config.name; + this._phoneNum = config.phoneNum; + this._region = config.region; + this._scheduleBootTime = config.scheduleBootTime; + this._scheduleOffTime = config.scheduleOffTime; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._version = config.version; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // email - computed: false, optional: true, required: false + private _email?: string[]; + public get email() { + return cdktf.Fn.tolist(this.getListAttribute('email')); + } + public set email(value: string[]) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new CdmClusterInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // is_auto_off - computed: true, optional: true, required: false + private _isAutoOff?: boolean | cdktf.IResolvable; + public get isAutoOff() { + return this.getBooleanAttribute('is_auto_off'); + } + public set isAutoOff(value: boolean | cdktf.IResolvable) { + this._isAutoOff = value; + } + public resetIsAutoOff() { + this._isAutoOff = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAutoOffInput() { + return this._isAutoOff; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // phone_num - computed: false, optional: true, required: false + private _phoneNum?: string[]; + public get phoneNum() { + return cdktf.Fn.tolist(this.getListAttribute('phone_num')); + } + public set phoneNum(value: string[]) { + this._phoneNum = value; + } + public resetPhoneNum() { + this._phoneNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneNumInput() { + return this._phoneNum; + } + + // public_endpoint - computed: true, optional: false, required: false + public get publicEndpoint() { + return this.getStringAttribute('public_endpoint'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schedule_boot_time - computed: true, optional: true, required: false + private _scheduleBootTime?: string; + public get scheduleBootTime() { + return this.getStringAttribute('schedule_boot_time'); + } + public set scheduleBootTime(value: string) { + this._scheduleBootTime = value; + } + public resetScheduleBootTime() { + this._scheduleBootTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleBootTimeInput() { + return this._scheduleBootTime; + } + + // schedule_off_time - computed: true, optional: true, required: false + private _scheduleOffTime?: string; + public get scheduleOffTime() { + return this.getStringAttribute('schedule_off_time'); + } + public set scheduleOffTime(value: string) { + this._scheduleOffTime = value; + } + public resetScheduleOffTime() { + this._scheduleOffTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleOffTimeInput() { + return this._scheduleOffTime; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CdmClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CdmClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + email: cdktf.listMapper(cdktf.stringToTerraform, false)(this._email), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + is_auto_off: cdktf.booleanToTerraform(this._isAutoOff), + name: cdktf.stringToTerraform(this._name), + phone_num: cdktf.listMapper(cdktf.stringToTerraform, false)(this._phoneNum), + region: cdktf.stringToTerraform(this._region), + schedule_boot_time: cdktf.stringToTerraform(this._scheduleBootTime), + schedule_off_time: cdktf.stringToTerraform(this._scheduleOffTime), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + version: cdktf.stringToTerraform(this._version), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: cdmClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._email), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_auto_off: { + value: cdktf.booleanToHclTerraform(this._isAutoOff), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_num: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._phoneNum), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_boot_time: { + value: cdktf.stringToHclTerraform(this._scheduleBootTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_off_time: { + value: cdktf.stringToHclTerraform(this._scheduleOffTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cdmClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CdmClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdm-job/README.md b/src/constructs/providers/huaweicloud/cdm-job/README.md new file mode 100644 index 00000000..9bbec5fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdm_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdm_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job). diff --git a/src/constructs/providers/huaweicloud/cdm-job/index.ts b/src/constructs/providers/huaweicloud/cdm-job/index.ts new file mode 100644 index 00000000..77e63ccf --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-job/index.ts @@ -0,0 +1,1173 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdmJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#cluster_id CdmJob#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#destination_connector CdmJob#destination_connector} + */ + readonly destinationConnector: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#destination_job_config CdmJob#destination_job_config} + */ + readonly destinationJobConfig: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#destination_link_name CdmJob#destination_link_name} + */ + readonly destinationLinkName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#id CdmJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#job_type CdmJob#job_type} + */ + readonly jobType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#name CdmJob#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#region CdmJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#source_connector CdmJob#source_connector} + */ + readonly sourceConnector: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#source_job_config CdmJob#source_job_config} + */ + readonly sourceJobConfig: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#source_link_name CdmJob#source_link_name} + */ + readonly sourceLinkName: string; + /** + * config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#config CdmJob#config} + */ + readonly config?: CdmJobConfigA; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#timeouts CdmJob#timeouts} + */ + readonly timeouts?: CdmJobTimeouts; +} +export interface CdmJobConfigA { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#group_name CdmJob#group_name} + */ + readonly groupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#retry_type CdmJob#retry_type} + */ + readonly retryType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_cycle CdmJob#scheduler_cycle} + */ + readonly schedulerCycle?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_cycle_type CdmJob#scheduler_cycle_type} + */ + readonly schedulerCycleType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_disposable_type CdmJob#scheduler_disposable_type} + */ + readonly schedulerDisposableType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_enabled CdmJob#scheduler_enabled} + */ + readonly schedulerEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_run_at CdmJob#scheduler_run_at} + */ + readonly schedulerRunAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_start_date CdmJob#scheduler_start_date} + */ + readonly schedulerStartDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#scheduler_stop_date CdmJob#scheduler_stop_date} + */ + readonly schedulerStopDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_dirty_write_to_bucket CdmJob#throttling_dirty_write_to_bucket} + */ + readonly throttlingDirtyWriteToBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_dirty_write_to_directory CdmJob#throttling_dirty_write_to_directory} + */ + readonly throttlingDirtyWriteToDirectory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_dirty_write_to_link CdmJob#throttling_dirty_write_to_link} + */ + readonly throttlingDirtyWriteToLink?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_extractors_number CdmJob#throttling_extractors_number} + */ + readonly throttlingExtractorsNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_loader_number CdmJob#throttling_loader_number} + */ + readonly throttlingLoaderNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_max_error_records CdmJob#throttling_max_error_records} + */ + readonly throttlingMaxErrorRecords?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#throttling_record_dirty_data CdmJob#throttling_record_dirty_data} + */ + readonly throttlingRecordDirtyData?: boolean | cdktf.IResolvable; +} + +export function cdmJobConfigAToTerraform(struct?: CdmJobConfigAOutputReference | CdmJobConfigA): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_name: cdktf.stringToTerraform(struct!.groupName), + retry_type: cdktf.stringToTerraform(struct!.retryType), + scheduler_cycle: cdktf.numberToTerraform(struct!.schedulerCycle), + scheduler_cycle_type: cdktf.stringToTerraform(struct!.schedulerCycleType), + scheduler_disposable_type: cdktf.stringToTerraform(struct!.schedulerDisposableType), + scheduler_enabled: cdktf.booleanToTerraform(struct!.schedulerEnabled), + scheduler_run_at: cdktf.stringToTerraform(struct!.schedulerRunAt), + scheduler_start_date: cdktf.stringToTerraform(struct!.schedulerStartDate), + scheduler_stop_date: cdktf.stringToTerraform(struct!.schedulerStopDate), + throttling_dirty_write_to_bucket: cdktf.stringToTerraform(struct!.throttlingDirtyWriteToBucket), + throttling_dirty_write_to_directory: cdktf.stringToTerraform(struct!.throttlingDirtyWriteToDirectory), + throttling_dirty_write_to_link: cdktf.stringToTerraform(struct!.throttlingDirtyWriteToLink), + throttling_extractors_number: cdktf.numberToTerraform(struct!.throttlingExtractorsNumber), + throttling_loader_number: cdktf.numberToTerraform(struct!.throttlingLoaderNumber), + throttling_max_error_records: cdktf.numberToTerraform(struct!.throttlingMaxErrorRecords), + throttling_record_dirty_data: cdktf.booleanToTerraform(struct!.throttlingRecordDirtyData), + } +} + + +export function cdmJobConfigAToHclTerraform(struct?: CdmJobConfigAOutputReference | CdmJobConfigA): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retry_type: { + value: cdktf.stringToHclTerraform(struct!.retryType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scheduler_cycle: { + value: cdktf.numberToHclTerraform(struct!.schedulerCycle), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheduler_cycle_type: { + value: cdktf.stringToHclTerraform(struct!.schedulerCycleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scheduler_disposable_type: { + value: cdktf.stringToHclTerraform(struct!.schedulerDisposableType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scheduler_enabled: { + value: cdktf.booleanToHclTerraform(struct!.schedulerEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + scheduler_run_at: { + value: cdktf.stringToHclTerraform(struct!.schedulerRunAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scheduler_start_date: { + value: cdktf.stringToHclTerraform(struct!.schedulerStartDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scheduler_stop_date: { + value: cdktf.stringToHclTerraform(struct!.schedulerStopDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throttling_dirty_write_to_bucket: { + value: cdktf.stringToHclTerraform(struct!.throttlingDirtyWriteToBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throttling_dirty_write_to_directory: { + value: cdktf.stringToHclTerraform(struct!.throttlingDirtyWriteToDirectory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throttling_dirty_write_to_link: { + value: cdktf.stringToHclTerraform(struct!.throttlingDirtyWriteToLink), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throttling_extractors_number: { + value: cdktf.numberToHclTerraform(struct!.throttlingExtractorsNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + throttling_loader_number: { + value: cdktf.numberToHclTerraform(struct!.throttlingLoaderNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + throttling_max_error_records: { + value: cdktf.numberToHclTerraform(struct!.throttlingMaxErrorRecords), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + throttling_record_dirty_data: { + value: cdktf.booleanToHclTerraform(struct!.throttlingRecordDirtyData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdmJobConfigAOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdmJobConfigA | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._retryType !== undefined) { + hasAnyValues = true; + internalValueResult.retryType = this._retryType; + } + if (this._schedulerCycle !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerCycle = this._schedulerCycle; + } + if (this._schedulerCycleType !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerCycleType = this._schedulerCycleType; + } + if (this._schedulerDisposableType !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerDisposableType = this._schedulerDisposableType; + } + if (this._schedulerEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerEnabled = this._schedulerEnabled; + } + if (this._schedulerRunAt !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerRunAt = this._schedulerRunAt; + } + if (this._schedulerStartDate !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerStartDate = this._schedulerStartDate; + } + if (this._schedulerStopDate !== undefined) { + hasAnyValues = true; + internalValueResult.schedulerStopDate = this._schedulerStopDate; + } + if (this._throttlingDirtyWriteToBucket !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingDirtyWriteToBucket = this._throttlingDirtyWriteToBucket; + } + if (this._throttlingDirtyWriteToDirectory !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingDirtyWriteToDirectory = this._throttlingDirtyWriteToDirectory; + } + if (this._throttlingDirtyWriteToLink !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingDirtyWriteToLink = this._throttlingDirtyWriteToLink; + } + if (this._throttlingExtractorsNumber !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingExtractorsNumber = this._throttlingExtractorsNumber; + } + if (this._throttlingLoaderNumber !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingLoaderNumber = this._throttlingLoaderNumber; + } + if (this._throttlingMaxErrorRecords !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingMaxErrorRecords = this._throttlingMaxErrorRecords; + } + if (this._throttlingRecordDirtyData !== undefined) { + hasAnyValues = true; + internalValueResult.throttlingRecordDirtyData = this._throttlingRecordDirtyData; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmJobConfigA | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groupName = undefined; + this._retryType = undefined; + this._schedulerCycle = undefined; + this._schedulerCycleType = undefined; + this._schedulerDisposableType = undefined; + this._schedulerEnabled = undefined; + this._schedulerRunAt = undefined; + this._schedulerStartDate = undefined; + this._schedulerStopDate = undefined; + this._throttlingDirtyWriteToBucket = undefined; + this._throttlingDirtyWriteToDirectory = undefined; + this._throttlingDirtyWriteToLink = undefined; + this._throttlingExtractorsNumber = undefined; + this._throttlingLoaderNumber = undefined; + this._throttlingMaxErrorRecords = undefined; + this._throttlingRecordDirtyData = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groupName = value.groupName; + this._retryType = value.retryType; + this._schedulerCycle = value.schedulerCycle; + this._schedulerCycleType = value.schedulerCycleType; + this._schedulerDisposableType = value.schedulerDisposableType; + this._schedulerEnabled = value.schedulerEnabled; + this._schedulerRunAt = value.schedulerRunAt; + this._schedulerStartDate = value.schedulerStartDate; + this._schedulerStopDate = value.schedulerStopDate; + this._throttlingDirtyWriteToBucket = value.throttlingDirtyWriteToBucket; + this._throttlingDirtyWriteToDirectory = value.throttlingDirtyWriteToDirectory; + this._throttlingDirtyWriteToLink = value.throttlingDirtyWriteToLink; + this._throttlingExtractorsNumber = value.throttlingExtractorsNumber; + this._throttlingLoaderNumber = value.throttlingLoaderNumber; + this._throttlingMaxErrorRecords = value.throttlingMaxErrorRecords; + this._throttlingRecordDirtyData = value.throttlingRecordDirtyData; + } + } + + // group_name - computed: false, optional: true, required: false + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + public resetGroupName() { + this._groupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // retry_type - computed: false, optional: true, required: false + private _retryType?: string; + public get retryType() { + return this.getStringAttribute('retry_type'); + } + public set retryType(value: string) { + this._retryType = value; + } + public resetRetryType() { + this._retryType = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryTypeInput() { + return this._retryType; + } + + // scheduler_cycle - computed: false, optional: true, required: false + private _schedulerCycle?: number; + public get schedulerCycle() { + return this.getNumberAttribute('scheduler_cycle'); + } + public set schedulerCycle(value: number) { + this._schedulerCycle = value; + } + public resetSchedulerCycle() { + this._schedulerCycle = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerCycleInput() { + return this._schedulerCycle; + } + + // scheduler_cycle_type - computed: false, optional: true, required: false + private _schedulerCycleType?: string; + public get schedulerCycleType() { + return this.getStringAttribute('scheduler_cycle_type'); + } + public set schedulerCycleType(value: string) { + this._schedulerCycleType = value; + } + public resetSchedulerCycleType() { + this._schedulerCycleType = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerCycleTypeInput() { + return this._schedulerCycleType; + } + + // scheduler_disposable_type - computed: false, optional: true, required: false + private _schedulerDisposableType?: string; + public get schedulerDisposableType() { + return this.getStringAttribute('scheduler_disposable_type'); + } + public set schedulerDisposableType(value: string) { + this._schedulerDisposableType = value; + } + public resetSchedulerDisposableType() { + this._schedulerDisposableType = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerDisposableTypeInput() { + return this._schedulerDisposableType; + } + + // scheduler_enabled - computed: false, optional: true, required: false + private _schedulerEnabled?: boolean | cdktf.IResolvable; + public get schedulerEnabled() { + return this.getBooleanAttribute('scheduler_enabled'); + } + public set schedulerEnabled(value: boolean | cdktf.IResolvable) { + this._schedulerEnabled = value; + } + public resetSchedulerEnabled() { + this._schedulerEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerEnabledInput() { + return this._schedulerEnabled; + } + + // scheduler_run_at - computed: false, optional: true, required: false + private _schedulerRunAt?: string; + public get schedulerRunAt() { + return this.getStringAttribute('scheduler_run_at'); + } + public set schedulerRunAt(value: string) { + this._schedulerRunAt = value; + } + public resetSchedulerRunAt() { + this._schedulerRunAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerRunAtInput() { + return this._schedulerRunAt; + } + + // scheduler_start_date - computed: false, optional: true, required: false + private _schedulerStartDate?: string; + public get schedulerStartDate() { + return this.getStringAttribute('scheduler_start_date'); + } + public set schedulerStartDate(value: string) { + this._schedulerStartDate = value; + } + public resetSchedulerStartDate() { + this._schedulerStartDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerStartDateInput() { + return this._schedulerStartDate; + } + + // scheduler_stop_date - computed: false, optional: true, required: false + private _schedulerStopDate?: string; + public get schedulerStopDate() { + return this.getStringAttribute('scheduler_stop_date'); + } + public set schedulerStopDate(value: string) { + this._schedulerStopDate = value; + } + public resetSchedulerStopDate() { + this._schedulerStopDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerStopDateInput() { + return this._schedulerStopDate; + } + + // throttling_dirty_write_to_bucket - computed: false, optional: true, required: false + private _throttlingDirtyWriteToBucket?: string; + public get throttlingDirtyWriteToBucket() { + return this.getStringAttribute('throttling_dirty_write_to_bucket'); + } + public set throttlingDirtyWriteToBucket(value: string) { + this._throttlingDirtyWriteToBucket = value; + } + public resetThrottlingDirtyWriteToBucket() { + this._throttlingDirtyWriteToBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingDirtyWriteToBucketInput() { + return this._throttlingDirtyWriteToBucket; + } + + // throttling_dirty_write_to_directory - computed: false, optional: true, required: false + private _throttlingDirtyWriteToDirectory?: string; + public get throttlingDirtyWriteToDirectory() { + return this.getStringAttribute('throttling_dirty_write_to_directory'); + } + public set throttlingDirtyWriteToDirectory(value: string) { + this._throttlingDirtyWriteToDirectory = value; + } + public resetThrottlingDirtyWriteToDirectory() { + this._throttlingDirtyWriteToDirectory = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingDirtyWriteToDirectoryInput() { + return this._throttlingDirtyWriteToDirectory; + } + + // throttling_dirty_write_to_link - computed: false, optional: true, required: false + private _throttlingDirtyWriteToLink?: string; + public get throttlingDirtyWriteToLink() { + return this.getStringAttribute('throttling_dirty_write_to_link'); + } + public set throttlingDirtyWriteToLink(value: string) { + this._throttlingDirtyWriteToLink = value; + } + public resetThrottlingDirtyWriteToLink() { + this._throttlingDirtyWriteToLink = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingDirtyWriteToLinkInput() { + return this._throttlingDirtyWriteToLink; + } + + // throttling_extractors_number - computed: false, optional: true, required: false + private _throttlingExtractorsNumber?: number; + public get throttlingExtractorsNumber() { + return this.getNumberAttribute('throttling_extractors_number'); + } + public set throttlingExtractorsNumber(value: number) { + this._throttlingExtractorsNumber = value; + } + public resetThrottlingExtractorsNumber() { + this._throttlingExtractorsNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingExtractorsNumberInput() { + return this._throttlingExtractorsNumber; + } + + // throttling_loader_number - computed: false, optional: true, required: false + private _throttlingLoaderNumber?: number; + public get throttlingLoaderNumber() { + return this.getNumberAttribute('throttling_loader_number'); + } + public set throttlingLoaderNumber(value: number) { + this._throttlingLoaderNumber = value; + } + public resetThrottlingLoaderNumber() { + this._throttlingLoaderNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingLoaderNumberInput() { + return this._throttlingLoaderNumber; + } + + // throttling_max_error_records - computed: false, optional: true, required: false + private _throttlingMaxErrorRecords?: number; + public get throttlingMaxErrorRecords() { + return this.getNumberAttribute('throttling_max_error_records'); + } + public set throttlingMaxErrorRecords(value: number) { + this._throttlingMaxErrorRecords = value; + } + public resetThrottlingMaxErrorRecords() { + this._throttlingMaxErrorRecords = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingMaxErrorRecordsInput() { + return this._throttlingMaxErrorRecords; + } + + // throttling_record_dirty_data - computed: false, optional: true, required: false + private _throttlingRecordDirtyData?: boolean | cdktf.IResolvable; + public get throttlingRecordDirtyData() { + return this.getBooleanAttribute('throttling_record_dirty_data'); + } + public set throttlingRecordDirtyData(value: boolean | cdktf.IResolvable) { + this._throttlingRecordDirtyData = value; + } + public resetThrottlingRecordDirtyData() { + this._throttlingRecordDirtyData = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttlingRecordDirtyDataInput() { + return this._throttlingRecordDirtyData; + } +} +export interface CdmJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#create CdmJob#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#delete CdmJob#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#update CdmJob#update} + */ + readonly update?: string; +} + +export function cdmJobTimeoutsToTerraform(struct?: CdmJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cdmJobTimeoutsToHclTerraform(struct?: CdmJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdmJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CdmJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdmJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job huaweicloud_cdm_job} +*/ +export class CdmJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdmJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdmJob to import + * @param importFromId The id of the existing CdmJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdmJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_job huaweicloud_cdm_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdmJobConfig + */ + public constructor(scope: Construct, id: string, config: CdmJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._destinationConnector = config.destinationConnector; + this._destinationJobConfig = config.destinationJobConfig; + this._destinationLinkName = config.destinationLinkName; + this._id = config.id; + this._jobType = config.jobType; + this._name = config.name; + this._region = config.region; + this._sourceConnector = config.sourceConnector; + this._sourceJobConfig = config.sourceJobConfig; + this._sourceLinkName = config.sourceLinkName; + this._config.internalValue = config.config; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // destination_connector - computed: false, optional: false, required: true + private _destinationConnector?: string; + public get destinationConnector() { + return this.getStringAttribute('destination_connector'); + } + public set destinationConnector(value: string) { + this._destinationConnector = value; + } + // Temporarily expose input value. Use with caution. + public get destinationConnectorInput() { + return this._destinationConnector; + } + + // destination_job_config - computed: false, optional: false, required: true + private _destinationJobConfig?: { [key: string]: string }; + public get destinationJobConfig() { + return this.getStringMapAttribute('destination_job_config'); + } + public set destinationJobConfig(value: { [key: string]: string }) { + this._destinationJobConfig = value; + } + // Temporarily expose input value. Use with caution. + public get destinationJobConfigInput() { + return this._destinationJobConfig; + } + + // destination_link_name - computed: false, optional: false, required: true + private _destinationLinkName?: string; + public get destinationLinkName() { + return this.getStringAttribute('destination_link_name'); + } + public set destinationLinkName(value: string) { + this._destinationLinkName = value; + } + // Temporarily expose input value. Use with caution. + public get destinationLinkNameInput() { + return this._destinationLinkName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_type - computed: false, optional: false, required: true + private _jobType?: string; + public get jobType() { + return this.getStringAttribute('job_type'); + } + public set jobType(value: string) { + this._jobType = value; + } + // Temporarily expose input value. Use with caution. + public get jobTypeInput() { + return this._jobType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_connector - computed: false, optional: false, required: true + private _sourceConnector?: string; + public get sourceConnector() { + return this.getStringAttribute('source_connector'); + } + public set sourceConnector(value: string) { + this._sourceConnector = value; + } + // Temporarily expose input value. Use with caution. + public get sourceConnectorInput() { + return this._sourceConnector; + } + + // source_job_config - computed: false, optional: false, required: true + private _sourceJobConfig?: { [key: string]: string }; + public get sourceJobConfig() { + return this.getStringMapAttribute('source_job_config'); + } + public set sourceJobConfig(value: { [key: string]: string }) { + this._sourceJobConfig = value; + } + // Temporarily expose input value. Use with caution. + public get sourceJobConfigInput() { + return this._sourceJobConfig; + } + + // source_link_name - computed: false, optional: false, required: true + private _sourceLinkName?: string; + public get sourceLinkName() { + return this.getStringAttribute('source_link_name'); + } + public set sourceLinkName(value: string) { + this._sourceLinkName = value; + } + // Temporarily expose input value. Use with caution. + public get sourceLinkNameInput() { + return this._sourceLinkName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // config - computed: false, optional: true, required: false + private _config = new CdmJobConfigAOutputReference(this, "config"); + public get config() { + return this._config; + } + public putConfig(value: CdmJobConfigA) { + this._config.internalValue = value; + } + public resetConfig() { + this._config.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configInput() { + return this._config.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CdmJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CdmJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + destination_connector: cdktf.stringToTerraform(this._destinationConnector), + destination_job_config: cdktf.hashMapper(cdktf.stringToTerraform)(this._destinationJobConfig), + destination_link_name: cdktf.stringToTerraform(this._destinationLinkName), + id: cdktf.stringToTerraform(this._id), + job_type: cdktf.stringToTerraform(this._jobType), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_connector: cdktf.stringToTerraform(this._sourceConnector), + source_job_config: cdktf.hashMapper(cdktf.stringToTerraform)(this._sourceJobConfig), + source_link_name: cdktf.stringToTerraform(this._sourceLinkName), + config: cdmJobConfigAToTerraform(this._config.internalValue), + timeouts: cdmJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_connector: { + value: cdktf.stringToHclTerraform(this._destinationConnector), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_job_config: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._destinationJobConfig), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + destination_link_name: { + value: cdktf.stringToHclTerraform(this._destinationLinkName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_type: { + value: cdktf.stringToHclTerraform(this._jobType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_connector: { + value: cdktf.stringToHclTerraform(this._sourceConnector), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_job_config: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._sourceJobConfig), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + source_link_name: { + value: cdktf.stringToHclTerraform(this._sourceLinkName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + config: { + value: cdmJobConfigAToHclTerraform(this._config.internalValue), + isBlock: true, + type: "list", + storageClassType: "CdmJobConfigAList", + }, + timeouts: { + value: cdmJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CdmJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdm-link/README.md b/src/constructs/providers/huaweicloud/cdm-link/README.md new file mode 100644 index 00000000..7bd7ceb2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-link/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdm_link` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdm_link`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link). diff --git a/src/constructs/providers/huaweicloud/cdm-link/index.ts b/src/constructs/providers/huaweicloud/cdm-link/index.ts new file mode 100644 index 00000000..b515b2ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdm-link/index.ts @@ -0,0 +1,356 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdmLinkConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#access_key CdmLink#access_key} + */ + readonly accessKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#cluster_id CdmLink#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#config CdmLink#config} + */ + readonly config: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#connector CdmLink#connector} + */ + readonly connector: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#enabled CdmLink#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#id CdmLink#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#name CdmLink#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#password CdmLink#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#region CdmLink#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#secret_key CdmLink#secret_key} + */ + readonly secretKey?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link huaweicloud_cdm_link} +*/ +export class CdmLink extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_link"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdmLink resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdmLink to import + * @param importFromId The id of the existing CdmLink that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdmLink to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_link", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdm_link huaweicloud_cdm_link} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdmLinkConfig + */ + public constructor(scope: Construct, id: string, config: CdmLinkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_link', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessKey = config.accessKey; + this._clusterId = config.clusterId; + this._config = config.config; + this._connector = config.connector; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._secretKey = config.secretKey; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // config - computed: false, optional: false, required: true + private _config?: { [key: string]: string }; + public get config() { + return this.getStringMapAttribute('config'); + } + public set config(value: { [key: string]: string }) { + this._config = value; + } + // Temporarily expose input value. Use with caution. + public get configInput() { + return this._config; + } + + // connector - computed: false, optional: false, required: true + private _connector?: string; + public get connector() { + return this.getStringAttribute('connector'); + } + public set connector(value: string) { + this._connector = value; + } + // Temporarily expose input value. Use with caution. + public get connectorInput() { + return this._connector; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_key: cdktf.stringToTerraform(this._accessKey), + cluster_id: cdktf.stringToTerraform(this._clusterId), + config: cdktf.hashMapper(cdktf.stringToTerraform)(this._config), + connector: cdktf.stringToTerraform(this._connector), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + secret_key: cdktf.stringToTerraform(this._secretKey), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(this._accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + config: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._config), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + connector: { + value: cdktf.stringToHclTerraform(this._connector), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(this._secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdn-billing-option/README.md b/src/constructs/providers/huaweicloud/cdn-billing-option/README.md new file mode 100644 index 00000000..49d5bfde --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-billing-option/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdn_billing_option` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdn_billing_option`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option). diff --git a/src/constructs/providers/huaweicloud/cdn-billing-option/index.ts b/src/constructs/providers/huaweicloud/cdn-billing-option/index.ts new file mode 100644 index 00000000..2a5a7c00 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-billing-option/index.ts @@ -0,0 +1,217 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdnBillingOptionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the billing option. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option#charge_mode CdnBillingOption#charge_mode} + */ + readonly chargeMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option#id CdnBillingOption#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the product mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option#product_type CdnBillingOption#product_type} + */ + readonly productType: string; + /** + * Specifies the service area. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option#service_area CdnBillingOption#service_area} + */ + readonly serviceArea: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option huaweicloud_cdn_billing_option} +*/ +export class CdnBillingOption extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_billing_option"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdnBillingOption resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdnBillingOption to import + * @param importFromId The id of the existing CdnBillingOption that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdnBillingOption to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_billing_option", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_billing_option huaweicloud_cdn_billing_option} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdnBillingOptionConfig + */ + public constructor(scope: Construct, id: string, config: CdnBillingOptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_billing_option', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._chargeMode = config.chargeMode; + this._id = config.id; + this._productType = config.productType; + this._serviceArea = config.serviceArea; + } + + // ========== + // ATTRIBUTES + // ========== + + // charge_mode - computed: false, optional: false, required: true + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_charge_mode - computed: true, optional: false, required: false + public get currentChargeMode() { + return this.getStringAttribute('current_charge_mode'); + } + + // effective_time - computed: true, optional: false, required: false + public get effectiveTime() { + return this.getStringAttribute('effective_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // product_type - computed: false, optional: false, required: true + private _productType?: string; + public get productType() { + return this.getStringAttribute('product_type'); + } + public set productType(value: string) { + this._productType = value; + } + // Temporarily expose input value. Use with caution. + public get productTypeInput() { + return this._productType; + } + + // service_area - computed: false, optional: false, required: true + private _serviceArea?: string; + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + public set serviceArea(value: string) { + this._serviceArea = value; + } + // Temporarily expose input value. Use with caution. + public get serviceAreaInput() { + return this._serviceArea; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + charge_mode: cdktf.stringToTerraform(this._chargeMode), + id: cdktf.stringToTerraform(this._id), + product_type: cdktf.stringToTerraform(this._productType), + service_area: cdktf.stringToTerraform(this._serviceArea), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_type: { + value: cdktf.stringToHclTerraform(this._productType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_area: { + value: cdktf.stringToHclTerraform(this._serviceArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdn-cache-preheat/README.md b/src/constructs/providers/huaweicloud/cdn-cache-preheat/README.md new file mode 100644 index 00000000..4928adbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-cache-preheat/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdn_cache_preheat` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdn_cache_preheat`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat). diff --git a/src/constructs/providers/huaweicloud/cdn-cache-preheat/index.ts b/src/constructs/providers/huaweicloud/cdn-cache-preheat/index.ts new file mode 100644 index 00000000..0dbd758e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-cache-preheat/index.ts @@ -0,0 +1,233 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdnCachePreheatConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat#enterprise_project_id CdnCachePreheat#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat#id CdnCachePreheat#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the URLs that need to be preheated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat#urls CdnCachePreheat#urls} + */ + readonly urls: string[]; + /** + * Specifies whether to encode Chinese characters in URLs before cache preheat. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat#zh_url_encode CdnCachePreheat#zh_url_encode} + */ + readonly zhUrlEncode?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat huaweicloud_cdn_cache_preheat} +*/ +export class CdnCachePreheat extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_cache_preheat"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdnCachePreheat resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdnCachePreheat to import + * @param importFromId The id of the existing CdnCachePreheat that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdnCachePreheat to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_cache_preheat", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_preheat huaweicloud_cdn_cache_preheat} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdnCachePreheatConfig + */ + public constructor(scope: Construct, id: string, config: CdnCachePreheatConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_cache_preheat', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._urls = config.urls; + this._zhUrlEncode = config.zhUrlEncode; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // failed - computed: true, optional: false, required: false + public get failed() { + return this.getNumberAttribute('failed'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // processing - computed: true, optional: false, required: false + public get processing() { + return this.getNumberAttribute('processing'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // succeed - computed: true, optional: false, required: false + public get succeed() { + return this.getNumberAttribute('succeed'); + } + + // total - computed: true, optional: false, required: false + public get total() { + return this.getNumberAttribute('total'); + } + + // urls - computed: false, optional: false, required: true + private _urls?: string[]; + public get urls() { + return cdktf.Fn.tolist(this.getListAttribute('urls')); + } + public set urls(value: string[]) { + this._urls = value; + } + // Temporarily expose input value. Use with caution. + public get urlsInput() { + return this._urls; + } + + // zh_url_encode - computed: false, optional: true, required: false + private _zhUrlEncode?: boolean | cdktf.IResolvable; + public get zhUrlEncode() { + return this.getBooleanAttribute('zh_url_encode'); + } + public set zhUrlEncode(value: boolean | cdktf.IResolvable) { + this._zhUrlEncode = value; + } + public resetZhUrlEncode() { + this._zhUrlEncode = undefined; + } + // Temporarily expose input value. Use with caution. + public get zhUrlEncodeInput() { + return this._zhUrlEncode; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + urls: cdktf.listMapper(cdktf.stringToTerraform, false)(this._urls), + zh_url_encode: cdktf.booleanToTerraform(this._zhUrlEncode), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + urls: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._urls), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + zh_url_encode: { + value: cdktf.booleanToHclTerraform(this._zhUrlEncode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdn-cache-refresh/README.md b/src/constructs/providers/huaweicloud/cdn-cache-refresh/README.md new file mode 100644 index 00000000..3d070aad --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-cache-refresh/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdn_cache_refresh` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdn_cache_refresh`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh). diff --git a/src/constructs/providers/huaweicloud/cdn-cache-refresh/index.ts b/src/constructs/providers/huaweicloud/cdn-cache-refresh/index.ts new file mode 100644 index 00000000..f857086c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-cache-refresh/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdnCacheRefreshConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#enterprise_project_id CdnCacheRefresh#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#id CdnCacheRefresh#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the directory refresh mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#mode CdnCacheRefresh#mode} + */ + readonly mode?: string; + /** + * Specifies the refresh type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#type CdnCacheRefresh#type} + */ + readonly type?: string; + /** + * Specifies the URLs that need to be refreshed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#urls CdnCacheRefresh#urls} + */ + readonly urls: string[]; + /** + * Specifies whether to encode Chinese characters in URLs before cache refresh. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#zh_url_encode CdnCacheRefresh#zh_url_encode} + */ + readonly zhUrlEncode?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh huaweicloud_cdn_cache_refresh} +*/ +export class CdnCacheRefresh extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_cache_refresh"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdnCacheRefresh resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdnCacheRefresh to import + * @param importFromId The id of the existing CdnCacheRefresh that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdnCacheRefresh to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_cache_refresh", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_cache_refresh huaweicloud_cdn_cache_refresh} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdnCacheRefreshConfig + */ + public constructor(scope: Construct, id: string, config: CdnCacheRefreshConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_cache_refresh', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._mode = config.mode; + this._type = config.type; + this._urls = config.urls; + this._zhUrlEncode = config.zhUrlEncode; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // failed - computed: true, optional: false, required: false + public get failed() { + return this.getNumberAttribute('failed'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // processing - computed: true, optional: false, required: false + public get processing() { + return this.getNumberAttribute('processing'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // succeed - computed: true, optional: false, required: false + public get succeed() { + return this.getNumberAttribute('succeed'); + } + + // total - computed: true, optional: false, required: false + public get total() { + return this.getNumberAttribute('total'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // urls - computed: false, optional: false, required: true + private _urls?: string[]; + public get urls() { + return cdktf.Fn.tolist(this.getListAttribute('urls')); + } + public set urls(value: string[]) { + this._urls = value; + } + // Temporarily expose input value. Use with caution. + public get urlsInput() { + return this._urls; + } + + // zh_url_encode - computed: false, optional: true, required: false + private _zhUrlEncode?: boolean | cdktf.IResolvable; + public get zhUrlEncode() { + return this.getBooleanAttribute('zh_url_encode'); + } + public set zhUrlEncode(value: boolean | cdktf.IResolvable) { + this._zhUrlEncode = value; + } + public resetZhUrlEncode() { + this._zhUrlEncode = undefined; + } + // Temporarily expose input value. Use with caution. + public get zhUrlEncodeInput() { + return this._zhUrlEncode; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + mode: cdktf.stringToTerraform(this._mode), + type: cdktf.stringToTerraform(this._type), + urls: cdktf.listMapper(cdktf.stringToTerraform, false)(this._urls), + zh_url_encode: cdktf.booleanToTerraform(this._zhUrlEncode), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + urls: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._urls), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + zh_url_encode: { + value: cdktf.booleanToHclTerraform(this._zhUrlEncode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdn-domain-v1/README.md b/src/constructs/providers/huaweicloud/cdn-domain-v1/README.md new file mode 100644 index 00000000..9aed5d62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-domain-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdn_domain_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdn_domain_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1). diff --git a/src/constructs/providers/huaweicloud/cdn-domain-v1/index.ts b/src/constructs/providers/huaweicloud/cdn-domain-v1/index.ts new file mode 100644 index 00000000..7b307e0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-domain-v1/index.ts @@ -0,0 +1,7618 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdnDomainV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enable_force_new CdnDomainV1#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enterprise_project_id CdnDomainV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#id CdnDomainV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#name CdnDomainV1#name} + */ + readonly name: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#service_area CdnDomainV1#service_area} + */ + readonly serviceArea?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#tags CdnDomainV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; + /** + * cache_settings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#cache_settings CdnDomainV1#cache_settings} + */ + readonly cacheSettings?: CdnDomainV1CacheSettings; + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#configs CdnDomainV1#configs} + */ + readonly configs?: CdnDomainV1Configs; + /** + * sources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#sources CdnDomainV1#sources} + */ + readonly sources: CdnDomainV1Sources[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#timeouts CdnDomainV1#timeouts} + */ + readonly timeouts?: CdnDomainV1Timeouts; +} +export interface CdnDomainV1CacheSettingsRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#content CdnDomainV1#content} + */ + readonly content?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#priority CdnDomainV1#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#rule_type CdnDomainV1#rule_type} + */ + readonly ruleType: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ttl CdnDomainV1#ttl} + */ + readonly ttl?: number; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ttl_type CdnDomainV1#ttl_type} + */ + readonly ttlType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#url_parameter_type CdnDomainV1#url_parameter_type} + */ + readonly urlParameterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#url_parameter_value CdnDomainV1#url_parameter_value} + */ + readonly urlParameterValue?: string; +} + +export function cdnDomainV1CacheSettingsRulesToTerraform(struct?: CdnDomainV1CacheSettingsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + priority: cdktf.numberToTerraform(struct!.priority), + rule_type: cdktf.stringToTerraform(struct!.ruleType), + ttl: cdktf.numberToTerraform(struct!.ttl), + ttl_type: cdktf.stringToTerraform(struct!.ttlType), + url_parameter_type: cdktf.stringToTerraform(struct!.urlParameterType), + url_parameter_value: cdktf.stringToTerraform(struct!.urlParameterValue), + } +} + + +export function cdnDomainV1CacheSettingsRulesToHclTerraform(struct?: CdnDomainV1CacheSettingsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rule_type: { + value: cdktf.stringToHclTerraform(struct!.ruleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ttl: { + value: cdktf.numberToHclTerraform(struct!.ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ttl_type: { + value: cdktf.stringToHclTerraform(struct!.ttlType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_parameter_type: { + value: cdktf.stringToHclTerraform(struct!.urlParameterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_parameter_value: { + value: cdktf.stringToHclTerraform(struct!.urlParameterValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1CacheSettingsRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1CacheSettingsRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._ruleType !== undefined) { + hasAnyValues = true; + internalValueResult.ruleType = this._ruleType; + } + if (this._ttl !== undefined) { + hasAnyValues = true; + internalValueResult.ttl = this._ttl; + } + if (this._ttlType !== undefined) { + hasAnyValues = true; + internalValueResult.ttlType = this._ttlType; + } + if (this._urlParameterType !== undefined) { + hasAnyValues = true; + internalValueResult.urlParameterType = this._urlParameterType; + } + if (this._urlParameterValue !== undefined) { + hasAnyValues = true; + internalValueResult.urlParameterValue = this._urlParameterValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1CacheSettingsRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._priority = undefined; + this._ruleType = undefined; + this._ttl = undefined; + this._ttlType = undefined; + this._urlParameterType = undefined; + this._urlParameterValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._priority = value.priority; + this._ruleType = value.ruleType; + this._ttl = value.ttl; + this._ttlType = value.ttlType; + this._urlParameterType = value.urlParameterType; + this._urlParameterValue = value.urlParameterValue; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // rule_type - computed: false, optional: false, required: true + private _ruleType?: string; + public get ruleType() { + return this.getStringAttribute('rule_type'); + } + public set ruleType(value: string) { + this._ruleType = value; + } + // Temporarily expose input value. Use with caution. + public get ruleTypeInput() { + return this._ruleType; + } + + // ttl - computed: true, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // ttl_type - computed: true, optional: true, required: false + private _ttlType?: string; + public get ttlType() { + return this.getStringAttribute('ttl_type'); + } + public set ttlType(value: string) { + this._ttlType = value; + } + public resetTtlType() { + this._ttlType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlTypeInput() { + return this._ttlType; + } + + // url_parameter_type - computed: false, optional: true, required: false + private _urlParameterType?: string; + public get urlParameterType() { + return this.getStringAttribute('url_parameter_type'); + } + public set urlParameterType(value: string) { + this._urlParameterType = value; + } + public resetUrlParameterType() { + this._urlParameterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlParameterTypeInput() { + return this._urlParameterType; + } + + // url_parameter_value - computed: false, optional: true, required: false + private _urlParameterValue?: string; + public get urlParameterValue() { + return this.getStringAttribute('url_parameter_value'); + } + public set urlParameterValue(value: string) { + this._urlParameterValue = value; + } + public resetUrlParameterValue() { + this._urlParameterValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlParameterValueInput() { + return this._urlParameterValue; + } +} + +export class CdnDomainV1CacheSettingsRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1CacheSettingsRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1CacheSettingsRulesOutputReference { + return new CdnDomainV1CacheSettingsRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1CacheSettings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#follow_origin CdnDomainV1#follow_origin} + */ + readonly followOrigin?: boolean | cdktf.IResolvable; + /** + * rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#rules CdnDomainV1#rules} + */ + readonly rules?: CdnDomainV1CacheSettingsRules[] | cdktf.IResolvable; +} + +export function cdnDomainV1CacheSettingsToTerraform(struct?: CdnDomainV1CacheSettingsOutputReference | CdnDomainV1CacheSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + follow_origin: cdktf.booleanToTerraform(struct!.followOrigin), + rules: cdktf.listMapper(cdnDomainV1CacheSettingsRulesToTerraform, true)(struct!.rules), + } +} + + +export function cdnDomainV1CacheSettingsToHclTerraform(struct?: CdnDomainV1CacheSettingsOutputReference | CdnDomainV1CacheSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + follow_origin: { + value: cdktf.booleanToHclTerraform(struct!.followOrigin), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + rules: { + value: cdktf.listMapperHcl(cdnDomainV1CacheSettingsRulesToHclTerraform, true)(struct!.rules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1CacheSettingsRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1CacheSettingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1CacheSettings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._followOrigin !== undefined) { + hasAnyValues = true; + internalValueResult.followOrigin = this._followOrigin; + } + if (this._rules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.rules = this._rules?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1CacheSettings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._followOrigin = undefined; + this._rules.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._followOrigin = value.followOrigin; + this._rules.internalValue = value.rules; + } + } + + // follow_origin - computed: false, optional: true, required: false + private _followOrigin?: boolean | cdktf.IResolvable; + public get followOrigin() { + return this.getBooleanAttribute('follow_origin'); + } + public set followOrigin(value: boolean | cdktf.IResolvable) { + this._followOrigin = value; + } + public resetFollowOrigin() { + this._followOrigin = undefined; + } + // Temporarily expose input value. Use with caution. + public get followOriginInput() { + return this._followOrigin; + } + + // rules - computed: false, optional: true, required: false + private _rules = new CdnDomainV1CacheSettingsRulesList(this, "rules", true); + public get rules() { + return this._rules; + } + public putRules(value: CdnDomainV1CacheSettingsRules[] | cdktf.IResolvable) { + this._rules.internalValue = value; + } + public resetRules() { + this._rules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get rulesInput() { + return this._rules.internalValue; + } +} +export interface CdnDomainV1ConfigsAccessAreaFilter { + /** + * Specifies the areas, separated by commas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#area CdnDomainV1#area} + */ + readonly area: string; + /** + * Specifies the content type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#content_type CdnDomainV1#content_type} + */ + readonly contentType: string; + /** + * Specifies the content value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#content_value CdnDomainV1#content_value} + */ + readonly contentValue?: string; + /** + * Specifies the IP addresses exception in access control, separated by commas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#exception_ip CdnDomainV1#exception_ip} + */ + readonly exceptionIp?: string; + /** + * Specifies the blacklist and whitelist rule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; +} + +export function cdnDomainV1ConfigsAccessAreaFilterToTerraform(struct?: CdnDomainV1ConfigsAccessAreaFilter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + area: cdktf.stringToTerraform(struct!.area), + content_type: cdktf.stringToTerraform(struct!.contentType), + content_value: cdktf.stringToTerraform(struct!.contentValue), + exception_ip: cdktf.stringToTerraform(struct!.exceptionIp), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainV1ConfigsAccessAreaFilterToHclTerraform(struct?: CdnDomainV1ConfigsAccessAreaFilter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + area: { + value: cdktf.stringToHclTerraform(struct!.area), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content_type: { + value: cdktf.stringToHclTerraform(struct!.contentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content_value: { + value: cdktf.stringToHclTerraform(struct!.contentValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exception_ip: { + value: cdktf.stringToHclTerraform(struct!.exceptionIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsAccessAreaFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsAccessAreaFilter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._area !== undefined) { + hasAnyValues = true; + internalValueResult.area = this._area; + } + if (this._contentType !== undefined) { + hasAnyValues = true; + internalValueResult.contentType = this._contentType; + } + if (this._contentValue !== undefined) { + hasAnyValues = true; + internalValueResult.contentValue = this._contentValue; + } + if (this._exceptionIp !== undefined) { + hasAnyValues = true; + internalValueResult.exceptionIp = this._exceptionIp; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsAccessAreaFilter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._area = undefined; + this._contentType = undefined; + this._contentValue = undefined; + this._exceptionIp = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._area = value.area; + this._contentType = value.contentType; + this._contentValue = value.contentValue; + this._exceptionIp = value.exceptionIp; + this._type = value.type; + } + } + + // area - computed: false, optional: false, required: true + private _area?: string; + public get area() { + return this.getStringAttribute('area'); + } + public set area(value: string) { + this._area = value; + } + // Temporarily expose input value. Use with caution. + public get areaInput() { + return this._area; + } + + // content_type - computed: false, optional: false, required: true + private _contentType?: string; + public get contentType() { + return this.getStringAttribute('content_type'); + } + public set contentType(value: string) { + this._contentType = value; + } + // Temporarily expose input value. Use with caution. + public get contentTypeInput() { + return this._contentType; + } + + // content_value - computed: true, optional: true, required: false + private _contentValue?: string; + public get contentValue() { + return this.getStringAttribute('content_value'); + } + public set contentValue(value: string) { + this._contentValue = value; + } + public resetContentValue() { + this._contentValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentValueInput() { + return this._contentValue; + } + + // exception_ip - computed: true, optional: true, required: false + private _exceptionIp?: string; + public get exceptionIp() { + return this.getStringAttribute('exception_ip'); + } + public set exceptionIp(value: string) { + this._exceptionIp = value; + } + public resetExceptionIp() { + this._exceptionIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get exceptionIpInput() { + return this._exceptionIp; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CdnDomainV1ConfigsAccessAreaFilterList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsAccessAreaFilter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsAccessAreaFilterOutputReference { + return new CdnDomainV1ConfigsAccessAreaFilterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsCacheUrlParameterFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value?: string; +} + +export function cdnDomainV1ConfigsCacheUrlParameterFilterToTerraform(struct?: CdnDomainV1ConfigsCacheUrlParameterFilterOutputReference | CdnDomainV1ConfigsCacheUrlParameterFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsCacheUrlParameterFilterToHclTerraform(struct?: CdnDomainV1ConfigsCacheUrlParameterFilterOutputReference | CdnDomainV1ConfigsCacheUrlParameterFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsCacheUrlParameterFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsCacheUrlParameterFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsCacheUrlParameterFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._value = value.value; + } + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface CdnDomainV1ConfigsCompress { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#file_type CdnDomainV1#file_type} + */ + readonly fileType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type?: string; +} + +export function cdnDomainV1ConfigsCompressToTerraform(struct?: CdnDomainV1ConfigsCompressOutputReference | CdnDomainV1ConfigsCompress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + file_type: cdktf.stringToTerraform(struct!.fileType), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainV1ConfigsCompressToHclTerraform(struct?: CdnDomainV1ConfigsCompressOutputReference | CdnDomainV1ConfigsCompress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + file_type: { + value: cdktf.stringToHclTerraform(struct!.fileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsCompressOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsCompress | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._fileType !== undefined) { + hasAnyValues = true; + internalValueResult.fileType = this._fileType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsCompress | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._fileType = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._fileType = value.fileType; + this._type = value.type; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // file_type - computed: true, optional: true, required: false + private _fileType?: string; + public get fileType() { + return this.getStringAttribute('file_type'); + } + public set fileType(value: string) { + this._fileType = value; + } + public resetFileType() { + this._fileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileTypeInput() { + return this._fileType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CdnDomainV1ConfigsErrorCodeCache { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#code CdnDomainV1#code} + */ + readonly code: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ttl CdnDomainV1#ttl} + */ + readonly ttl: number; +} + +export function cdnDomainV1ConfigsErrorCodeCacheToTerraform(struct?: CdnDomainV1ConfigsErrorCodeCache | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + code: cdktf.numberToTerraform(struct!.code), + ttl: cdktf.numberToTerraform(struct!.ttl), + } +} + + +export function cdnDomainV1ConfigsErrorCodeCacheToHclTerraform(struct?: CdnDomainV1ConfigsErrorCodeCache | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + code: { + value: cdktf.numberToHclTerraform(struct!.code), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ttl: { + value: cdktf.numberToHclTerraform(struct!.ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsErrorCodeCacheOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsErrorCodeCache | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._code !== undefined) { + hasAnyValues = true; + internalValueResult.code = this._code; + } + if (this._ttl !== undefined) { + hasAnyValues = true; + internalValueResult.ttl = this._ttl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsErrorCodeCache | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._code = undefined; + this._ttl = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._code = value.code; + this._ttl = value.ttl; + } + } + + // code - computed: false, optional: false, required: true + private _code?: number; + public get code() { + return this.getNumberAttribute('code'); + } + public set code(value: number) { + this._code = value; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // ttl - computed: false, optional: false, required: true + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } +} + +export class CdnDomainV1ConfigsErrorCodeCacheList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsErrorCodeCache[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsErrorCodeCacheOutputReference { + return new CdnDomainV1ConfigsErrorCodeCacheOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsErrorCodeRedirectRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#error_code CdnDomainV1#error_code} + */ + readonly errorCode: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#target_code CdnDomainV1#target_code} + */ + readonly targetCode: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#target_link CdnDomainV1#target_link} + */ + readonly targetLink: string; +} + +export function cdnDomainV1ConfigsErrorCodeRedirectRulesToTerraform(struct?: CdnDomainV1ConfigsErrorCodeRedirectRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + error_code: cdktf.numberToTerraform(struct!.errorCode), + target_code: cdktf.numberToTerraform(struct!.targetCode), + target_link: cdktf.stringToTerraform(struct!.targetLink), + } +} + + +export function cdnDomainV1ConfigsErrorCodeRedirectRulesToHclTerraform(struct?: CdnDomainV1ConfigsErrorCodeRedirectRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + error_code: { + value: cdktf.numberToHclTerraform(struct!.errorCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + target_code: { + value: cdktf.numberToHclTerraform(struct!.targetCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + target_link: { + value: cdktf.stringToHclTerraform(struct!.targetLink), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsErrorCodeRedirectRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsErrorCodeRedirectRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._errorCode !== undefined) { + hasAnyValues = true; + internalValueResult.errorCode = this._errorCode; + } + if (this._targetCode !== undefined) { + hasAnyValues = true; + internalValueResult.targetCode = this._targetCode; + } + if (this._targetLink !== undefined) { + hasAnyValues = true; + internalValueResult.targetLink = this._targetLink; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsErrorCodeRedirectRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._errorCode = undefined; + this._targetCode = undefined; + this._targetLink = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._errorCode = value.errorCode; + this._targetCode = value.targetCode; + this._targetLink = value.targetLink; + } + } + + // error_code - computed: false, optional: false, required: true + private _errorCode?: number; + public get errorCode() { + return this.getNumberAttribute('error_code'); + } + public set errorCode(value: number) { + this._errorCode = value; + } + // Temporarily expose input value. Use with caution. + public get errorCodeInput() { + return this._errorCode; + } + + // target_code - computed: false, optional: false, required: true + private _targetCode?: number; + public get targetCode() { + return this.getNumberAttribute('target_code'); + } + public set targetCode(value: number) { + this._targetCode = value; + } + // Temporarily expose input value. Use with caution. + public get targetCodeInput() { + return this._targetCode; + } + + // target_link - computed: false, optional: false, required: true + private _targetLink?: string; + public get targetLink() { + return this.getStringAttribute('target_link'); + } + public set targetLink(value: string) { + this._targetLink = value; + } + // Temporarily expose input value. Use with caution. + public get targetLinkInput() { + return this._targetLink; + } +} + +export class CdnDomainV1ConfigsErrorCodeRedirectRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsErrorCodeRedirectRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsErrorCodeRedirectRulesOutputReference { + return new CdnDomainV1ConfigsErrorCodeRedirectRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsFlexibleOriginBackSources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#http_port CdnDomainV1#http_port} + */ + readonly httpPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#https_port CdnDomainV1#https_port} + */ + readonly httpsPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ip_or_domain CdnDomainV1#ip_or_domain} + */ + readonly ipOrDomain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#obs_bucket_type CdnDomainV1#obs_bucket_type} + */ + readonly obsBucketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#sources_type CdnDomainV1#sources_type} + */ + readonly sourcesType: string; +} + +export function cdnDomainV1ConfigsFlexibleOriginBackSourcesToTerraform(struct?: CdnDomainV1ConfigsFlexibleOriginBackSourcesOutputReference | CdnDomainV1ConfigsFlexibleOriginBackSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + http_port: cdktf.numberToTerraform(struct!.httpPort), + https_port: cdktf.numberToTerraform(struct!.httpsPort), + ip_or_domain: cdktf.stringToTerraform(struct!.ipOrDomain), + obs_bucket_type: cdktf.stringToTerraform(struct!.obsBucketType), + sources_type: cdktf.stringToTerraform(struct!.sourcesType), + } +} + + +export function cdnDomainV1ConfigsFlexibleOriginBackSourcesToHclTerraform(struct?: CdnDomainV1ConfigsFlexibleOriginBackSourcesOutputReference | CdnDomainV1ConfigsFlexibleOriginBackSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + http_port: { + value: cdktf.numberToHclTerraform(struct!.httpPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + https_port: { + value: cdktf.numberToHclTerraform(struct!.httpsPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ip_or_domain: { + value: cdktf.stringToHclTerraform(struct!.ipOrDomain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket_type: { + value: cdktf.stringToHclTerraform(struct!.obsBucketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sources_type: { + value: cdktf.stringToHclTerraform(struct!.sourcesType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsFlexibleOriginBackSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsFlexibleOriginBackSources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._httpPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpPort = this._httpPort; + } + if (this._httpsPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpsPort = this._httpsPort; + } + if (this._ipOrDomain !== undefined) { + hasAnyValues = true; + internalValueResult.ipOrDomain = this._ipOrDomain; + } + if (this._obsBucketType !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketType = this._obsBucketType; + } + if (this._sourcesType !== undefined) { + hasAnyValues = true; + internalValueResult.sourcesType = this._sourcesType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsFlexibleOriginBackSources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._httpPort = undefined; + this._httpsPort = undefined; + this._ipOrDomain = undefined; + this._obsBucketType = undefined; + this._sourcesType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._httpPort = value.httpPort; + this._httpsPort = value.httpsPort; + this._ipOrDomain = value.ipOrDomain; + this._obsBucketType = value.obsBucketType; + this._sourcesType = value.sourcesType; + } + } + + // http_port - computed: true, optional: true, required: false + private _httpPort?: number; + public get httpPort() { + return this.getNumberAttribute('http_port'); + } + public set httpPort(value: number) { + this._httpPort = value; + } + public resetHttpPort() { + this._httpPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpPortInput() { + return this._httpPort; + } + + // https_port - computed: true, optional: true, required: false + private _httpsPort?: number; + public get httpsPort() { + return this.getNumberAttribute('https_port'); + } + public set httpsPort(value: number) { + this._httpsPort = value; + } + public resetHttpsPort() { + this._httpsPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsPortInput() { + return this._httpsPort; + } + + // ip_or_domain - computed: false, optional: false, required: true + private _ipOrDomain?: string; + public get ipOrDomain() { + return this.getStringAttribute('ip_or_domain'); + } + public set ipOrDomain(value: string) { + this._ipOrDomain = value; + } + // Temporarily expose input value. Use with caution. + public get ipOrDomainInput() { + return this._ipOrDomain; + } + + // obs_bucket_type - computed: true, optional: true, required: false + private _obsBucketType?: string; + public get obsBucketType() { + return this.getStringAttribute('obs_bucket_type'); + } + public set obsBucketType(value: string) { + this._obsBucketType = value; + } + public resetObsBucketType() { + this._obsBucketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketTypeInput() { + return this._obsBucketType; + } + + // sources_type - computed: false, optional: false, required: true + private _sourcesType?: string; + public get sourcesType() { + return this.getStringAttribute('sources_type'); + } + public set sourcesType(value: string) { + this._sourcesType = value; + } + // Temporarily expose input value. Use with caution. + public get sourcesTypeInput() { + return this._sourcesType; + } +} +export interface CdnDomainV1ConfigsFlexibleOrigin { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#match_pattern CdnDomainV1#match_pattern} + */ + readonly matchPattern?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#match_type CdnDomainV1#match_type} + */ + readonly matchType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#priority CdnDomainV1#priority} + */ + readonly priority: number; + /** + * back_sources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#back_sources CdnDomainV1#back_sources} + */ + readonly backSources: CdnDomainV1ConfigsFlexibleOriginBackSources; +} + +export function cdnDomainV1ConfigsFlexibleOriginToTerraform(struct?: CdnDomainV1ConfigsFlexibleOrigin | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_pattern: cdktf.stringToTerraform(struct!.matchPattern), + match_type: cdktf.stringToTerraform(struct!.matchType), + priority: cdktf.numberToTerraform(struct!.priority), + back_sources: cdnDomainV1ConfigsFlexibleOriginBackSourcesToTerraform(struct!.backSources), + } +} + + +export function cdnDomainV1ConfigsFlexibleOriginToHclTerraform(struct?: CdnDomainV1ConfigsFlexibleOrigin | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_pattern: { + value: cdktf.stringToHclTerraform(struct!.matchPattern), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + back_sources: { + value: cdnDomainV1ConfigsFlexibleOriginBackSourcesToHclTerraform(struct!.backSources), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsFlexibleOriginBackSourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsFlexibleOriginOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsFlexibleOrigin | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchPattern !== undefined) { + hasAnyValues = true; + internalValueResult.matchPattern = this._matchPattern; + } + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._backSources?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backSources = this._backSources?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsFlexibleOrigin | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchPattern = undefined; + this._matchType = undefined; + this._priority = undefined; + this._backSources.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchPattern = value.matchPattern; + this._matchType = value.matchType; + this._priority = value.priority; + this._backSources.internalValue = value.backSources; + } + } + + // match_pattern - computed: true, optional: true, required: false + private _matchPattern?: string; + public get matchPattern() { + return this.getStringAttribute('match_pattern'); + } + public set matchPattern(value: string) { + this._matchPattern = value; + } + public resetMatchPattern() { + this._matchPattern = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchPatternInput() { + return this._matchPattern; + } + + // match_type - computed: false, optional: false, required: true + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // back_sources - computed: false, optional: false, required: true + private _backSources = new CdnDomainV1ConfigsFlexibleOriginBackSourcesOutputReference(this, "back_sources"); + public get backSources() { + return this._backSources; + } + public putBackSources(value: CdnDomainV1ConfigsFlexibleOriginBackSources) { + this._backSources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get backSourcesInput() { + return this._backSources.internalValue; + } +} + +export class CdnDomainV1ConfigsFlexibleOriginList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsFlexibleOrigin[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsFlexibleOriginOutputReference { + return new CdnDomainV1ConfigsFlexibleOriginOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsForceRedirect { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#redirect_code CdnDomainV1#redirect_code} + */ + readonly redirectCode?: number; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type?: string; +} + +export function cdnDomainV1ConfigsForceRedirectToTerraform(struct?: CdnDomainV1ConfigsForceRedirectOutputReference | CdnDomainV1ConfigsForceRedirect): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + redirect_code: cdktf.numberToTerraform(struct!.redirectCode), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainV1ConfigsForceRedirectToHclTerraform(struct?: CdnDomainV1ConfigsForceRedirectOutputReference | CdnDomainV1ConfigsForceRedirect): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + redirect_code: { + value: cdktf.numberToHclTerraform(struct!.redirectCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsForceRedirectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsForceRedirect | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._redirectCode !== undefined) { + hasAnyValues = true; + internalValueResult.redirectCode = this._redirectCode; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsForceRedirect | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._redirectCode = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._redirectCode = value.redirectCode; + this._type = value.type; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // redirect_code - computed: true, optional: true, required: false + private _redirectCode?: number; + public get redirectCode() { + return this.getNumberAttribute('redirect_code'); + } + public set redirectCode(value: number) { + this._redirectCode = value; + } + public resetRedirectCode() { + this._redirectCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectCodeInput() { + return this._redirectCode; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CdnDomainV1ConfigsHsts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#include_subdomains CdnDomainV1#include_subdomains} + */ + readonly includeSubdomains?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#max_age CdnDomainV1#max_age} + */ + readonly maxAge?: number; +} + +export function cdnDomainV1ConfigsHstsToTerraform(struct?: CdnDomainV1ConfigsHstsOutputReference | CdnDomainV1ConfigsHsts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + include_subdomains: cdktf.stringToTerraform(struct!.includeSubdomains), + max_age: cdktf.numberToTerraform(struct!.maxAge), + } +} + + +export function cdnDomainV1ConfigsHstsToHclTerraform(struct?: CdnDomainV1ConfigsHstsOutputReference | CdnDomainV1ConfigsHsts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + include_subdomains: { + value: cdktf.stringToHclTerraform(struct!.includeSubdomains), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_age: { + value: cdktf.numberToHclTerraform(struct!.maxAge), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsHstsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsHsts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._includeSubdomains !== undefined) { + hasAnyValues = true; + internalValueResult.includeSubdomains = this._includeSubdomains; + } + if (this._maxAge !== undefined) { + hasAnyValues = true; + internalValueResult.maxAge = this._maxAge; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsHsts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._includeSubdomains = undefined; + this._maxAge = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._includeSubdomains = value.includeSubdomains; + this._maxAge = value.maxAge; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // include_subdomains - computed: true, optional: true, required: false + private _includeSubdomains?: string; + public get includeSubdomains() { + return this.getStringAttribute('include_subdomains'); + } + public set includeSubdomains(value: string) { + this._includeSubdomains = value; + } + public resetIncludeSubdomains() { + this._includeSubdomains = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeSubdomainsInput() { + return this._includeSubdomains; + } + + // max_age - computed: true, optional: true, required: false + private _maxAge?: number; + public get maxAge() { + return this.getNumberAttribute('max_age'); + } + public set maxAge(value: number) { + this._maxAge = value; + } + public resetMaxAge() { + this._maxAge = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxAgeInput() { + return this._maxAge; + } +} +export interface CdnDomainV1ConfigsHttpResponseHeader { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#action CdnDomainV1#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#name CdnDomainV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value?: string; +} + +export function cdnDomainV1ConfigsHttpResponseHeaderToTerraform(struct?: CdnDomainV1ConfigsHttpResponseHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsHttpResponseHeaderToHclTerraform(struct?: CdnDomainV1ConfigsHttpResponseHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsHttpResponseHeaderOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsHttpResponseHeader | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsHttpResponseHeader | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._name = value.name; + this._value = value.value; + } + } + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainV1ConfigsHttpResponseHeaderList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsHttpResponseHeader[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsHttpResponseHeaderOutputReference { + return new CdnDomainV1ConfigsHttpResponseHeaderOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsHttpsSettings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#certificate_body CdnDomainV1#certificate_body} + */ + readonly certificateBody?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#certificate_name CdnDomainV1#certificate_name} + */ + readonly certificateName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#certificate_source CdnDomainV1#certificate_source} + */ + readonly certificateSource?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#certificate_type CdnDomainV1#certificate_type} + */ + readonly certificateType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#http2_enabled CdnDomainV1#http2_enabled} + */ + readonly http2Enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#https_enabled CdnDomainV1#https_enabled} + */ + readonly httpsEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ocsp_stapling_status CdnDomainV1#ocsp_stapling_status} + */ + readonly ocspStaplingStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#private_key CdnDomainV1#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#scm_certificate_id CdnDomainV1#scm_certificate_id} + */ + readonly scmCertificateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#tls_version CdnDomainV1#tls_version} + */ + readonly tlsVersion?: string; +} + +export function cdnDomainV1ConfigsHttpsSettingsToTerraform(struct?: CdnDomainV1ConfigsHttpsSettingsOutputReference | CdnDomainV1ConfigsHttpsSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + certificate_body: cdktf.stringToTerraform(struct!.certificateBody), + certificate_name: cdktf.stringToTerraform(struct!.certificateName), + certificate_source: cdktf.numberToTerraform(struct!.certificateSource), + certificate_type: cdktf.stringToTerraform(struct!.certificateType), + http2_enabled: cdktf.booleanToTerraform(struct!.http2Enabled), + https_enabled: cdktf.booleanToTerraform(struct!.httpsEnabled), + ocsp_stapling_status: cdktf.stringToTerraform(struct!.ocspStaplingStatus), + private_key: cdktf.stringToTerraform(struct!.privateKey), + scm_certificate_id: cdktf.stringToTerraform(struct!.scmCertificateId), + tls_version: cdktf.stringToTerraform(struct!.tlsVersion), + } +} + + +export function cdnDomainV1ConfigsHttpsSettingsToHclTerraform(struct?: CdnDomainV1ConfigsHttpsSettingsOutputReference | CdnDomainV1ConfigsHttpsSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + certificate_body: { + value: cdktf.stringToHclTerraform(struct!.certificateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_name: { + value: cdktf.stringToHclTerraform(struct!.certificateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_source: { + value: cdktf.numberToHclTerraform(struct!.certificateSource), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + certificate_type: { + value: cdktf.stringToHclTerraform(struct!.certificateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http2_enabled: { + value: cdktf.booleanToHclTerraform(struct!.http2Enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + https_enabled: { + value: cdktf.booleanToHclTerraform(struct!.httpsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ocsp_stapling_status: { + value: cdktf.stringToHclTerraform(struct!.ocspStaplingStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(struct!.privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scm_certificate_id: { + value: cdktf.stringToHclTerraform(struct!.scmCertificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tls_version: { + value: cdktf.stringToHclTerraform(struct!.tlsVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsHttpsSettingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsHttpsSettings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._certificateBody !== undefined) { + hasAnyValues = true; + internalValueResult.certificateBody = this._certificateBody; + } + if (this._certificateName !== undefined) { + hasAnyValues = true; + internalValueResult.certificateName = this._certificateName; + } + if (this._certificateSource !== undefined) { + hasAnyValues = true; + internalValueResult.certificateSource = this._certificateSource; + } + if (this._certificateType !== undefined) { + hasAnyValues = true; + internalValueResult.certificateType = this._certificateType; + } + if (this._http2Enabled !== undefined) { + hasAnyValues = true; + internalValueResult.http2Enabled = this._http2Enabled; + } + if (this._httpsEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.httpsEnabled = this._httpsEnabled; + } + if (this._ocspStaplingStatus !== undefined) { + hasAnyValues = true; + internalValueResult.ocspStaplingStatus = this._ocspStaplingStatus; + } + if (this._privateKey !== undefined) { + hasAnyValues = true; + internalValueResult.privateKey = this._privateKey; + } + if (this._scmCertificateId !== undefined) { + hasAnyValues = true; + internalValueResult.scmCertificateId = this._scmCertificateId; + } + if (this._tlsVersion !== undefined) { + hasAnyValues = true; + internalValueResult.tlsVersion = this._tlsVersion; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsHttpsSettings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._certificateBody = undefined; + this._certificateName = undefined; + this._certificateSource = undefined; + this._certificateType = undefined; + this._http2Enabled = undefined; + this._httpsEnabled = undefined; + this._ocspStaplingStatus = undefined; + this._privateKey = undefined; + this._scmCertificateId = undefined; + this._tlsVersion = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._certificateBody = value.certificateBody; + this._certificateName = value.certificateName; + this._certificateSource = value.certificateSource; + this._certificateType = value.certificateType; + this._http2Enabled = value.http2Enabled; + this._httpsEnabled = value.httpsEnabled; + this._ocspStaplingStatus = value.ocspStaplingStatus; + this._privateKey = value.privateKey; + this._scmCertificateId = value.scmCertificateId; + this._tlsVersion = value.tlsVersion; + } + } + + // certificate_body - computed: true, optional: true, required: false + private _certificateBody?: string; + public get certificateBody() { + return this.getStringAttribute('certificate_body'); + } + public set certificateBody(value: string) { + this._certificateBody = value; + } + public resetCertificateBody() { + this._certificateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateBodyInput() { + return this._certificateBody; + } + + // certificate_name - computed: true, optional: true, required: false + private _certificateName?: string; + public get certificateName() { + return this.getStringAttribute('certificate_name'); + } + public set certificateName(value: string) { + this._certificateName = value; + } + public resetCertificateName() { + this._certificateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateNameInput() { + return this._certificateName; + } + + // certificate_source - computed: true, optional: true, required: false + private _certificateSource?: number; + public get certificateSource() { + return this.getNumberAttribute('certificate_source'); + } + public set certificateSource(value: number) { + this._certificateSource = value; + } + public resetCertificateSource() { + this._certificateSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateSourceInput() { + return this._certificateSource; + } + + // certificate_type - computed: true, optional: true, required: false + private _certificateType?: string; + public get certificateType() { + return this.getStringAttribute('certificate_type'); + } + public set certificateType(value: string) { + this._certificateType = value; + } + public resetCertificateType() { + this._certificateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateTypeInput() { + return this._certificateType; + } + + // http2_enabled - computed: true, optional: true, required: false + private _http2Enabled?: boolean | cdktf.IResolvable; + public get http2Enabled() { + return this.getBooleanAttribute('http2_enabled'); + } + public set http2Enabled(value: boolean | cdktf.IResolvable) { + this._http2Enabled = value; + } + public resetHttp2Enabled() { + this._http2Enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get http2EnabledInput() { + return this._http2Enabled; + } + + // http2_status - computed: true, optional: false, required: false + public get http2Status() { + return this.getStringAttribute('http2_status'); + } + + // https_enabled - computed: true, optional: true, required: false + private _httpsEnabled?: boolean | cdktf.IResolvable; + public get httpsEnabled() { + return this.getBooleanAttribute('https_enabled'); + } + public set httpsEnabled(value: boolean | cdktf.IResolvable) { + this._httpsEnabled = value; + } + public resetHttpsEnabled() { + this._httpsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsEnabledInput() { + return this._httpsEnabled; + } + + // https_status - computed: true, optional: false, required: false + public get httpsStatus() { + return this.getStringAttribute('https_status'); + } + + // ocsp_stapling_status - computed: true, optional: true, required: false + private _ocspStaplingStatus?: string; + public get ocspStaplingStatus() { + return this.getStringAttribute('ocsp_stapling_status'); + } + public set ocspStaplingStatus(value: string) { + this._ocspStaplingStatus = value; + } + public resetOcspStaplingStatus() { + this._ocspStaplingStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get ocspStaplingStatusInput() { + return this._ocspStaplingStatus; + } + + // private_key - computed: true, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // scm_certificate_id - computed: true, optional: true, required: false + private _scmCertificateId?: string; + public get scmCertificateId() { + return this.getStringAttribute('scm_certificate_id'); + } + public set scmCertificateId(value: string) { + this._scmCertificateId = value; + } + public resetScmCertificateId() { + this._scmCertificateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scmCertificateIdInput() { + return this._scmCertificateId; + } + + // tls_version - computed: true, optional: true, required: false + private _tlsVersion?: string; + public get tlsVersion() { + return this.getStringAttribute('tls_version'); + } + public set tlsVersion(value: string) { + this._tlsVersion = value; + } + public resetTlsVersion() { + this._tlsVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get tlsVersionInput() { + return this._tlsVersion; + } +} +export interface CdnDomainV1ConfigsIpFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value?: string; +} + +export function cdnDomainV1ConfigsIpFilterToTerraform(struct?: CdnDomainV1ConfigsIpFilterOutputReference | CdnDomainV1ConfigsIpFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsIpFilterToHclTerraform(struct?: CdnDomainV1ConfigsIpFilterOutputReference | CdnDomainV1ConfigsIpFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsIpFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsIpFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsIpFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._value = value.value; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface CdnDomainV1ConfigsIpFrequencyLimit { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#qps CdnDomainV1#qps} + */ + readonly qps?: number; +} + +export function cdnDomainV1ConfigsIpFrequencyLimitToTerraform(struct?: CdnDomainV1ConfigsIpFrequencyLimitOutputReference | CdnDomainV1ConfigsIpFrequencyLimit): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + qps: cdktf.numberToTerraform(struct!.qps), + } +} + + +export function cdnDomainV1ConfigsIpFrequencyLimitToHclTerraform(struct?: CdnDomainV1ConfigsIpFrequencyLimitOutputReference | CdnDomainV1ConfigsIpFrequencyLimit): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + qps: { + value: cdktf.numberToHclTerraform(struct!.qps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsIpFrequencyLimitOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsIpFrequencyLimit | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._qps !== undefined) { + hasAnyValues = true; + internalValueResult.qps = this._qps; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsIpFrequencyLimit | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._qps = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._qps = value.qps; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // qps - computed: true, optional: true, required: false + private _qps?: number; + public get qps() { + return this.getNumberAttribute('qps'); + } + public set qps(value: number) { + this._qps = value; + } + public resetQps() { + this._qps = undefined; + } + // Temporarily expose input value. Use with caution. + public get qpsInput() { + return this._qps; + } +} +export interface CdnDomainV1ConfigsOriginRequestUrlRewrite { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#match_type CdnDomainV1#match_type} + */ + readonly matchType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#priority CdnDomainV1#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#source_url CdnDomainV1#source_url} + */ + readonly sourceUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#target_url CdnDomainV1#target_url} + */ + readonly targetUrl: string; +} + +export function cdnDomainV1ConfigsOriginRequestUrlRewriteToTerraform(struct?: CdnDomainV1ConfigsOriginRequestUrlRewrite | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_type: cdktf.stringToTerraform(struct!.matchType), + priority: cdktf.numberToTerraform(struct!.priority), + source_url: cdktf.stringToTerraform(struct!.sourceUrl), + target_url: cdktf.stringToTerraform(struct!.targetUrl), + } +} + + +export function cdnDomainV1ConfigsOriginRequestUrlRewriteToHclTerraform(struct?: CdnDomainV1ConfigsOriginRequestUrlRewrite | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_url: { + value: cdktf.stringToHclTerraform(struct!.sourceUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_url: { + value: cdktf.stringToHclTerraform(struct!.targetUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsOriginRequestUrlRewriteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsOriginRequestUrlRewrite | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._sourceUrl !== undefined) { + hasAnyValues = true; + internalValueResult.sourceUrl = this._sourceUrl; + } + if (this._targetUrl !== undefined) { + hasAnyValues = true; + internalValueResult.targetUrl = this._targetUrl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsOriginRequestUrlRewrite | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchType = undefined; + this._priority = undefined; + this._sourceUrl = undefined; + this._targetUrl = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchType = value.matchType; + this._priority = value.priority; + this._sourceUrl = value.sourceUrl; + this._targetUrl = value.targetUrl; + } + } + + // match_type - computed: false, optional: false, required: true + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // source_url - computed: true, optional: true, required: false + private _sourceUrl?: string; + public get sourceUrl() { + return this.getStringAttribute('source_url'); + } + public set sourceUrl(value: string) { + this._sourceUrl = value; + } + public resetSourceUrl() { + this._sourceUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceUrlInput() { + return this._sourceUrl; + } + + // target_url - computed: false, optional: false, required: true + private _targetUrl?: string; + public get targetUrl() { + return this.getStringAttribute('target_url'); + } + public set targetUrl(value: string) { + this._targetUrl = value; + } + // Temporarily expose input value. Use with caution. + public get targetUrlInput() { + return this._targetUrl; + } +} + +export class CdnDomainV1ConfigsOriginRequestUrlRewriteList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsOriginRequestUrlRewrite[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsOriginRequestUrlRewriteOutputReference { + return new CdnDomainV1ConfigsOriginRequestUrlRewriteOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsQuic { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; +} + +export function cdnDomainV1ConfigsQuicToTerraform(struct?: CdnDomainV1ConfigsQuicOutputReference | CdnDomainV1ConfigsQuic): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + } +} + + +export function cdnDomainV1ConfigsQuicToHclTerraform(struct?: CdnDomainV1ConfigsQuicOutputReference | CdnDomainV1ConfigsQuic): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsQuicOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsQuic | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsQuic | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } +} +export interface CdnDomainV1ConfigsReferer { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#include_empty CdnDomainV1#include_empty} + */ + readonly includeEmpty?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value?: string; +} + +export function cdnDomainV1ConfigsRefererToTerraform(struct?: CdnDomainV1ConfigsRefererOutputReference | CdnDomainV1ConfigsReferer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + include_empty: cdktf.booleanToTerraform(struct!.includeEmpty), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsRefererToHclTerraform(struct?: CdnDomainV1ConfigsRefererOutputReference | CdnDomainV1ConfigsReferer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + include_empty: { + value: cdktf.booleanToHclTerraform(struct!.includeEmpty), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRefererOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsReferer | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._includeEmpty !== undefined) { + hasAnyValues = true; + internalValueResult.includeEmpty = this._includeEmpty; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsReferer | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._includeEmpty = undefined; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._includeEmpty = value.includeEmpty; + this._type = value.type; + this._value = value.value; + } + } + + // include_empty - computed: true, optional: true, required: false + private _includeEmpty?: boolean | cdktf.IResolvable; + public get includeEmpty() { + return this.getBooleanAttribute('include_empty'); + } + public set includeEmpty(value: boolean | cdktf.IResolvable) { + this._includeEmpty = value; + } + public resetIncludeEmpty() { + this._includeEmpty = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeEmptyInput() { + return this._includeEmpty; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#key CdnDomainV1#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value: string; +} + +export function cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToTerraform(struct?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToHclTerraform(struct?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._type = value.type; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesOutputReference { + return new CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#key CdnDomainV1#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value: string; +} + +export function cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToTerraform(struct?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToHclTerraform(struct?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._type = value.type; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesOutputReference { + return new CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsRemoteAuthRemoteAuthRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#auth_failed_status CdnDomainV1#auth_failed_status} + */ + readonly authFailedStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#auth_server CdnDomainV1#auth_server} + */ + readonly authServer: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#auth_success_status CdnDomainV1#auth_success_status} + */ + readonly authSuccessStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#file_type_setting CdnDomainV1#file_type_setting} + */ + readonly fileTypeSetting: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#request_method CdnDomainV1#request_method} + */ + readonly requestMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#reserve_args CdnDomainV1#reserve_args} + */ + readonly reserveArgs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#reserve_args_setting CdnDomainV1#reserve_args_setting} + */ + readonly reserveArgsSetting: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#reserve_headers CdnDomainV1#reserve_headers} + */ + readonly reserveHeaders?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#reserve_headers_setting CdnDomainV1#reserve_headers_setting} + */ + readonly reserveHeadersSetting: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#response_status CdnDomainV1#response_status} + */ + readonly responseStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#specified_file_type CdnDomainV1#specified_file_type} + */ + readonly specifiedFileType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#timeout CdnDomainV1#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#timeout_action CdnDomainV1#timeout_action} + */ + readonly timeoutAction: string; + /** + * add_custom_args_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#add_custom_args_rules CdnDomainV1#add_custom_args_rules} + */ + readonly addCustomArgsRules?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules[] | cdktf.IResolvable; + /** + * add_custom_headers_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#add_custom_headers_rules CdnDomainV1#add_custom_headers_rules} + */ + readonly addCustomHeadersRules?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules[] | cdktf.IResolvable; +} + +export function cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesToTerraform(struct?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesOutputReference | CdnDomainV1ConfigsRemoteAuthRemoteAuthRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auth_failed_status: cdktf.stringToTerraform(struct!.authFailedStatus), + auth_server: cdktf.stringToTerraform(struct!.authServer), + auth_success_status: cdktf.stringToTerraform(struct!.authSuccessStatus), + file_type_setting: cdktf.stringToTerraform(struct!.fileTypeSetting), + request_method: cdktf.stringToTerraform(struct!.requestMethod), + reserve_args: cdktf.stringToTerraform(struct!.reserveArgs), + reserve_args_setting: cdktf.stringToTerraform(struct!.reserveArgsSetting), + reserve_headers: cdktf.stringToTerraform(struct!.reserveHeaders), + reserve_headers_setting: cdktf.stringToTerraform(struct!.reserveHeadersSetting), + response_status: cdktf.stringToTerraform(struct!.responseStatus), + specified_file_type: cdktf.stringToTerraform(struct!.specifiedFileType), + timeout: cdktf.numberToTerraform(struct!.timeout), + timeout_action: cdktf.stringToTerraform(struct!.timeoutAction), + add_custom_args_rules: cdktf.listMapper(cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToTerraform, true)(struct!.addCustomArgsRules), + add_custom_headers_rules: cdktf.listMapper(cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToTerraform, true)(struct!.addCustomHeadersRules), + } +} + + +export function cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesToHclTerraform(struct?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesOutputReference | CdnDomainV1ConfigsRemoteAuthRemoteAuthRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auth_failed_status: { + value: cdktf.stringToHclTerraform(struct!.authFailedStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_server: { + value: cdktf.stringToHclTerraform(struct!.authServer), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_success_status: { + value: cdktf.stringToHclTerraform(struct!.authSuccessStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_type_setting: { + value: cdktf.stringToHclTerraform(struct!.fileTypeSetting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(struct!.requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_args: { + value: cdktf.stringToHclTerraform(struct!.reserveArgs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_args_setting: { + value: cdktf.stringToHclTerraform(struct!.reserveArgsSetting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_headers: { + value: cdktf.stringToHclTerraform(struct!.reserveHeaders), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_headers_setting: { + value: cdktf.stringToHclTerraform(struct!.reserveHeadersSetting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_status: { + value: cdktf.stringToHclTerraform(struct!.responseStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specified_file_type: { + value: cdktf.stringToHclTerraform(struct!.specifiedFileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout_action: { + value: cdktf.stringToHclTerraform(struct!.timeoutAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + add_custom_args_rules: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToHclTerraform, true)(struct!.addCustomArgsRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesList", + }, + add_custom_headers_rules: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToHclTerraform, true)(struct!.addCustomHeadersRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsRemoteAuthRemoteAuthRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authFailedStatus !== undefined) { + hasAnyValues = true; + internalValueResult.authFailedStatus = this._authFailedStatus; + } + if (this._authServer !== undefined) { + hasAnyValues = true; + internalValueResult.authServer = this._authServer; + } + if (this._authSuccessStatus !== undefined) { + hasAnyValues = true; + internalValueResult.authSuccessStatus = this._authSuccessStatus; + } + if (this._fileTypeSetting !== undefined) { + hasAnyValues = true; + internalValueResult.fileTypeSetting = this._fileTypeSetting; + } + if (this._requestMethod !== undefined) { + hasAnyValues = true; + internalValueResult.requestMethod = this._requestMethod; + } + if (this._reserveArgs !== undefined) { + hasAnyValues = true; + internalValueResult.reserveArgs = this._reserveArgs; + } + if (this._reserveArgsSetting !== undefined) { + hasAnyValues = true; + internalValueResult.reserveArgsSetting = this._reserveArgsSetting; + } + if (this._reserveHeaders !== undefined) { + hasAnyValues = true; + internalValueResult.reserveHeaders = this._reserveHeaders; + } + if (this._reserveHeadersSetting !== undefined) { + hasAnyValues = true; + internalValueResult.reserveHeadersSetting = this._reserveHeadersSetting; + } + if (this._responseStatus !== undefined) { + hasAnyValues = true; + internalValueResult.responseStatus = this._responseStatus; + } + if (this._specifiedFileType !== undefined) { + hasAnyValues = true; + internalValueResult.specifiedFileType = this._specifiedFileType; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._timeoutAction !== undefined) { + hasAnyValues = true; + internalValueResult.timeoutAction = this._timeoutAction; + } + if (this._addCustomArgsRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.addCustomArgsRules = this._addCustomArgsRules?.internalValue; + } + if (this._addCustomHeadersRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.addCustomHeadersRules = this._addCustomHeadersRules?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsRemoteAuthRemoteAuthRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authFailedStatus = undefined; + this._authServer = undefined; + this._authSuccessStatus = undefined; + this._fileTypeSetting = undefined; + this._requestMethod = undefined; + this._reserveArgs = undefined; + this._reserveArgsSetting = undefined; + this._reserveHeaders = undefined; + this._reserveHeadersSetting = undefined; + this._responseStatus = undefined; + this._specifiedFileType = undefined; + this._timeout = undefined; + this._timeoutAction = undefined; + this._addCustomArgsRules.internalValue = undefined; + this._addCustomHeadersRules.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authFailedStatus = value.authFailedStatus; + this._authServer = value.authServer; + this._authSuccessStatus = value.authSuccessStatus; + this._fileTypeSetting = value.fileTypeSetting; + this._requestMethod = value.requestMethod; + this._reserveArgs = value.reserveArgs; + this._reserveArgsSetting = value.reserveArgsSetting; + this._reserveHeaders = value.reserveHeaders; + this._reserveHeadersSetting = value.reserveHeadersSetting; + this._responseStatus = value.responseStatus; + this._specifiedFileType = value.specifiedFileType; + this._timeout = value.timeout; + this._timeoutAction = value.timeoutAction; + this._addCustomArgsRules.internalValue = value.addCustomArgsRules; + this._addCustomHeadersRules.internalValue = value.addCustomHeadersRules; + } + } + + // auth_failed_status - computed: false, optional: false, required: true + private _authFailedStatus?: string; + public get authFailedStatus() { + return this.getStringAttribute('auth_failed_status'); + } + public set authFailedStatus(value: string) { + this._authFailedStatus = value; + } + // Temporarily expose input value. Use with caution. + public get authFailedStatusInput() { + return this._authFailedStatus; + } + + // auth_server - computed: false, optional: false, required: true + private _authServer?: string; + public get authServer() { + return this.getStringAttribute('auth_server'); + } + public set authServer(value: string) { + this._authServer = value; + } + // Temporarily expose input value. Use with caution. + public get authServerInput() { + return this._authServer; + } + + // auth_success_status - computed: false, optional: false, required: true + private _authSuccessStatus?: string; + public get authSuccessStatus() { + return this.getStringAttribute('auth_success_status'); + } + public set authSuccessStatus(value: string) { + this._authSuccessStatus = value; + } + // Temporarily expose input value. Use with caution. + public get authSuccessStatusInput() { + return this._authSuccessStatus; + } + + // file_type_setting - computed: false, optional: false, required: true + private _fileTypeSetting?: string; + public get fileTypeSetting() { + return this.getStringAttribute('file_type_setting'); + } + public set fileTypeSetting(value: string) { + this._fileTypeSetting = value; + } + // Temporarily expose input value. Use with caution. + public get fileTypeSettingInput() { + return this._fileTypeSetting; + } + + // request_method - computed: false, optional: false, required: true + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // reserve_args - computed: false, optional: true, required: false + private _reserveArgs?: string; + public get reserveArgs() { + return this.getStringAttribute('reserve_args'); + } + public set reserveArgs(value: string) { + this._reserveArgs = value; + } + public resetReserveArgs() { + this._reserveArgs = undefined; + } + // Temporarily expose input value. Use with caution. + public get reserveArgsInput() { + return this._reserveArgs; + } + + // reserve_args_setting - computed: false, optional: false, required: true + private _reserveArgsSetting?: string; + public get reserveArgsSetting() { + return this.getStringAttribute('reserve_args_setting'); + } + public set reserveArgsSetting(value: string) { + this._reserveArgsSetting = value; + } + // Temporarily expose input value. Use with caution. + public get reserveArgsSettingInput() { + return this._reserveArgsSetting; + } + + // reserve_headers - computed: false, optional: true, required: false + private _reserveHeaders?: string; + public get reserveHeaders() { + return this.getStringAttribute('reserve_headers'); + } + public set reserveHeaders(value: string) { + this._reserveHeaders = value; + } + public resetReserveHeaders() { + this._reserveHeaders = undefined; + } + // Temporarily expose input value. Use with caution. + public get reserveHeadersInput() { + return this._reserveHeaders; + } + + // reserve_headers_setting - computed: false, optional: false, required: true + private _reserveHeadersSetting?: string; + public get reserveHeadersSetting() { + return this.getStringAttribute('reserve_headers_setting'); + } + public set reserveHeadersSetting(value: string) { + this._reserveHeadersSetting = value; + } + // Temporarily expose input value. Use with caution. + public get reserveHeadersSettingInput() { + return this._reserveHeadersSetting; + } + + // response_status - computed: false, optional: false, required: true + private _responseStatus?: string; + public get responseStatus() { + return this.getStringAttribute('response_status'); + } + public set responseStatus(value: string) { + this._responseStatus = value; + } + // Temporarily expose input value. Use with caution. + public get responseStatusInput() { + return this._responseStatus; + } + + // specified_file_type - computed: false, optional: true, required: false + private _specifiedFileType?: string; + public get specifiedFileType() { + return this.getStringAttribute('specified_file_type'); + } + public set specifiedFileType(value: string) { + this._specifiedFileType = value; + } + public resetSpecifiedFileType() { + this._specifiedFileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get specifiedFileTypeInput() { + return this._specifiedFileType; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // timeout_action - computed: false, optional: false, required: true + private _timeoutAction?: string; + public get timeoutAction() { + return this.getStringAttribute('timeout_action'); + } + public set timeoutAction(value: string) { + this._timeoutAction = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutActionInput() { + return this._timeoutAction; + } + + // add_custom_args_rules - computed: false, optional: true, required: false + private _addCustomArgsRules = new CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesList(this, "add_custom_args_rules", true); + public get addCustomArgsRules() { + return this._addCustomArgsRules; + } + public putAddCustomArgsRules(value: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules[] | cdktf.IResolvable) { + this._addCustomArgsRules.internalValue = value; + } + public resetAddCustomArgsRules() { + this._addCustomArgsRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addCustomArgsRulesInput() { + return this._addCustomArgsRules.internalValue; + } + + // add_custom_headers_rules - computed: false, optional: true, required: false + private _addCustomHeadersRules = new CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesList(this, "add_custom_headers_rules", true); + public get addCustomHeadersRules() { + return this._addCustomHeadersRules; + } + public putAddCustomHeadersRules(value: CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules[] | cdktf.IResolvable) { + this._addCustomHeadersRules.internalValue = value; + } + public resetAddCustomHeadersRules() { + this._addCustomHeadersRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addCustomHeadersRulesInput() { + return this._addCustomHeadersRules.internalValue; + } +} +export interface CdnDomainV1ConfigsRemoteAuth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * remote_auth_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#remote_auth_rules CdnDomainV1#remote_auth_rules} + */ + readonly remoteAuthRules?: CdnDomainV1ConfigsRemoteAuthRemoteAuthRules; +} + +export function cdnDomainV1ConfigsRemoteAuthToTerraform(struct?: CdnDomainV1ConfigsRemoteAuthOutputReference | CdnDomainV1ConfigsRemoteAuth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + remote_auth_rules: cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesToTerraform(struct!.remoteAuthRules), + } +} + + +export function cdnDomainV1ConfigsRemoteAuthToHclTerraform(struct?: CdnDomainV1ConfigsRemoteAuthOutputReference | CdnDomainV1ConfigsRemoteAuth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + remote_auth_rules: { + value: cdnDomainV1ConfigsRemoteAuthRemoteAuthRulesToHclTerraform(struct!.remoteAuthRules), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRemoteAuthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsRemoteAuth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._remoteAuthRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.remoteAuthRules = this._remoteAuthRules?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsRemoteAuth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._remoteAuthRules.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._remoteAuthRules.internalValue = value.remoteAuthRules; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // remote_auth_rules - computed: false, optional: true, required: false + private _remoteAuthRules = new CdnDomainV1ConfigsRemoteAuthRemoteAuthRulesOutputReference(this, "remote_auth_rules"); + public get remoteAuthRules() { + return this._remoteAuthRules; + } + public putRemoteAuthRules(value: CdnDomainV1ConfigsRemoteAuthRemoteAuthRules) { + this._remoteAuthRules.internalValue = value; + } + public resetRemoteAuthRules() { + this._remoteAuthRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAuthRulesInput() { + return this._remoteAuthRules.internalValue; + } +} +export interface CdnDomainV1ConfigsRequestLimitRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#limit_rate_after CdnDomainV1#limit_rate_after} + */ + readonly limitRateAfter: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#limit_rate_value CdnDomainV1#limit_rate_value} + */ + readonly limitRateValue: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#match_type CdnDomainV1#match_type} + */ + readonly matchType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#match_value CdnDomainV1#match_value} + */ + readonly matchValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#priority CdnDomainV1#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; +} + +export function cdnDomainV1ConfigsRequestLimitRulesToTerraform(struct?: CdnDomainV1ConfigsRequestLimitRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + limit_rate_after: cdktf.numberToTerraform(struct!.limitRateAfter), + limit_rate_value: cdktf.numberToTerraform(struct!.limitRateValue), + match_type: cdktf.stringToTerraform(struct!.matchType), + match_value: cdktf.stringToTerraform(struct!.matchValue), + priority: cdktf.numberToTerraform(struct!.priority), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainV1ConfigsRequestLimitRulesToHclTerraform(struct?: CdnDomainV1ConfigsRequestLimitRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + limit_rate_after: { + value: cdktf.numberToHclTerraform(struct!.limitRateAfter), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + limit_rate_value: { + value: cdktf.numberToHclTerraform(struct!.limitRateValue), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_value: { + value: cdktf.stringToHclTerraform(struct!.matchValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRequestLimitRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsRequestLimitRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._limitRateAfter !== undefined) { + hasAnyValues = true; + internalValueResult.limitRateAfter = this._limitRateAfter; + } + if (this._limitRateValue !== undefined) { + hasAnyValues = true; + internalValueResult.limitRateValue = this._limitRateValue; + } + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._matchValue !== undefined) { + hasAnyValues = true; + internalValueResult.matchValue = this._matchValue; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsRequestLimitRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._limitRateAfter = undefined; + this._limitRateValue = undefined; + this._matchType = undefined; + this._matchValue = undefined; + this._priority = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._limitRateAfter = value.limitRateAfter; + this._limitRateValue = value.limitRateValue; + this._matchType = value.matchType; + this._matchValue = value.matchValue; + this._priority = value.priority; + this._type = value.type; + } + } + + // limit_rate_after - computed: false, optional: false, required: true + private _limitRateAfter?: number; + public get limitRateAfter() { + return this.getNumberAttribute('limit_rate_after'); + } + public set limitRateAfter(value: number) { + this._limitRateAfter = value; + } + // Temporarily expose input value. Use with caution. + public get limitRateAfterInput() { + return this._limitRateAfter; + } + + // limit_rate_value - computed: false, optional: false, required: true + private _limitRateValue?: number; + public get limitRateValue() { + return this.getNumberAttribute('limit_rate_value'); + } + public set limitRateValue(value: number) { + this._limitRateValue = value; + } + // Temporarily expose input value. Use with caution. + public get limitRateValueInput() { + return this._limitRateValue; + } + + // match_type - computed: false, optional: false, required: true + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // match_value - computed: false, optional: true, required: false + private _matchValue?: string; + public get matchValue() { + return this.getStringAttribute('match_value'); + } + public set matchValue(value: string) { + this._matchValue = value; + } + public resetMatchValue() { + this._matchValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchValueInput() { + return this._matchValue; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CdnDomainV1ConfigsRequestLimitRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsRequestLimitRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsRequestLimitRulesOutputReference { + return new CdnDomainV1ConfigsRequestLimitRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsRetrievalRequestHeader { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#action CdnDomainV1#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#name CdnDomainV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#value CdnDomainV1#value} + */ + readonly value?: string; +} + +export function cdnDomainV1ConfigsRetrievalRequestHeaderToTerraform(struct?: CdnDomainV1ConfigsRetrievalRequestHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainV1ConfigsRetrievalRequestHeaderToHclTerraform(struct?: CdnDomainV1ConfigsRetrievalRequestHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsRetrievalRequestHeaderOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1ConfigsRetrievalRequestHeader | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsRetrievalRequestHeader | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._name = value.name; + this._value = value.value; + } + } + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainV1ConfigsRetrievalRequestHeaderList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1ConfigsRetrievalRequestHeader[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1ConfigsRetrievalRequestHeaderOutputReference { + return new CdnDomainV1ConfigsRetrievalRequestHeaderOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1ConfigsUrlSigningInheritConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#inherit_time_type CdnDomainV1#inherit_time_type} + */ + readonly inheritTimeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#inherit_type CdnDomainV1#inherit_type} + */ + readonly inheritType?: string; +} + +export function cdnDomainV1ConfigsUrlSigningInheritConfigToTerraform(struct?: CdnDomainV1ConfigsUrlSigningInheritConfigOutputReference | CdnDomainV1ConfigsUrlSigningInheritConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + inherit_time_type: cdktf.stringToTerraform(struct!.inheritTimeType), + inherit_type: cdktf.stringToTerraform(struct!.inheritType), + } +} + + +export function cdnDomainV1ConfigsUrlSigningInheritConfigToHclTerraform(struct?: CdnDomainV1ConfigsUrlSigningInheritConfigOutputReference | CdnDomainV1ConfigsUrlSigningInheritConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + inherit_time_type: { + value: cdktf.stringToHclTerraform(struct!.inheritTimeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inherit_type: { + value: cdktf.stringToHclTerraform(struct!.inheritType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsUrlSigningInheritConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsUrlSigningInheritConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._inheritTimeType !== undefined) { + hasAnyValues = true; + internalValueResult.inheritTimeType = this._inheritTimeType; + } + if (this._inheritType !== undefined) { + hasAnyValues = true; + internalValueResult.inheritType = this._inheritType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsUrlSigningInheritConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._inheritTimeType = undefined; + this._inheritType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._inheritTimeType = value.inheritTimeType; + this._inheritType = value.inheritType; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // inherit_time_type - computed: true, optional: true, required: false + private _inheritTimeType?: string; + public get inheritTimeType() { + return this.getStringAttribute('inherit_time_type'); + } + public set inheritTimeType(value: string) { + this._inheritTimeType = value; + } + public resetInheritTimeType() { + this._inheritTimeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get inheritTimeTypeInput() { + return this._inheritTimeType; + } + + // inherit_type - computed: true, optional: true, required: false + private _inheritType?: string; + public get inheritType() { + return this.getStringAttribute('inherit_type'); + } + public set inheritType(value: string) { + this._inheritType = value; + } + public resetInheritType() { + this._inheritType = undefined; + } + // Temporarily expose input value. Use with caution. + public get inheritTypeInput() { + return this._inheritType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} +export interface CdnDomainV1ConfigsUrlSigning { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#backup_key CdnDomainV1#backup_key} + */ + readonly backupKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#expire_time CdnDomainV1#expire_time} + */ + readonly expireTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#key CdnDomainV1#key} + */ + readonly key?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#match_type CdnDomainV1#match_type} + */ + readonly matchType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#sign_arg CdnDomainV1#sign_arg} + */ + readonly signArg?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#sign_method CdnDomainV1#sign_method} + */ + readonly signMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#time_format CdnDomainV1#time_format} + */ + readonly timeFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type?: string; + /** + * inherit_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#inherit_config CdnDomainV1#inherit_config} + */ + readonly inheritConfig?: CdnDomainV1ConfigsUrlSigningInheritConfig; +} + +export function cdnDomainV1ConfigsUrlSigningToTerraform(struct?: CdnDomainV1ConfigsUrlSigningOutputReference | CdnDomainV1ConfigsUrlSigning): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backup_key: cdktf.stringToTerraform(struct!.backupKey), + enabled: cdktf.booleanToTerraform(struct!.enabled), + expire_time: cdktf.numberToTerraform(struct!.expireTime), + key: cdktf.stringToTerraform(struct!.key), + match_type: cdktf.stringToTerraform(struct!.matchType), + sign_arg: cdktf.stringToTerraform(struct!.signArg), + sign_method: cdktf.stringToTerraform(struct!.signMethod), + time_format: cdktf.stringToTerraform(struct!.timeFormat), + type: cdktf.stringToTerraform(struct!.type), + inherit_config: cdnDomainV1ConfigsUrlSigningInheritConfigToTerraform(struct!.inheritConfig), + } +} + + +export function cdnDomainV1ConfigsUrlSigningToHclTerraform(struct?: CdnDomainV1ConfigsUrlSigningOutputReference | CdnDomainV1ConfigsUrlSigning): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backup_key: { + value: cdktf.stringToHclTerraform(struct!.backupKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + expire_time: { + value: cdktf.numberToHclTerraform(struct!.expireTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign_arg: { + value: cdktf.stringToHclTerraform(struct!.signArg), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign_method: { + value: cdktf.stringToHclTerraform(struct!.signMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_format: { + value: cdktf.stringToHclTerraform(struct!.timeFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inherit_config: { + value: cdnDomainV1ConfigsUrlSigningInheritConfigToHclTerraform(struct!.inheritConfig), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsUrlSigningInheritConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsUrlSigningOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsUrlSigning | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backupKey !== undefined) { + hasAnyValues = true; + internalValueResult.backupKey = this._backupKey; + } + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._expireTime !== undefined) { + hasAnyValues = true; + internalValueResult.expireTime = this._expireTime; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._signArg !== undefined) { + hasAnyValues = true; + internalValueResult.signArg = this._signArg; + } + if (this._signMethod !== undefined) { + hasAnyValues = true; + internalValueResult.signMethod = this._signMethod; + } + if (this._timeFormat !== undefined) { + hasAnyValues = true; + internalValueResult.timeFormat = this._timeFormat; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._inheritConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.inheritConfig = this._inheritConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsUrlSigning | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._backupKey = undefined; + this._enabled = undefined; + this._expireTime = undefined; + this._key = undefined; + this._matchType = undefined; + this._signArg = undefined; + this._signMethod = undefined; + this._timeFormat = undefined; + this._type = undefined; + this._inheritConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._backupKey = value.backupKey; + this._enabled = value.enabled; + this._expireTime = value.expireTime; + this._key = value.key; + this._matchType = value.matchType; + this._signArg = value.signArg; + this._signMethod = value.signMethod; + this._timeFormat = value.timeFormat; + this._type = value.type; + this._inheritConfig.internalValue = value.inheritConfig; + } + } + + // backup_key - computed: true, optional: true, required: false + private _backupKey?: string; + public get backupKey() { + return this.getStringAttribute('backup_key'); + } + public set backupKey(value: string) { + this._backupKey = value; + } + public resetBackupKey() { + this._backupKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupKeyInput() { + return this._backupKey; + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // expire_time - computed: true, optional: true, required: false + private _expireTime?: number; + public get expireTime() { + return this.getNumberAttribute('expire_time'); + } + public set expireTime(value: number) { + this._expireTime = value; + } + public resetExpireTime() { + this._expireTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get expireTimeInput() { + return this._expireTime; + } + + // key - computed: true, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // match_type - computed: true, optional: true, required: false + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + public resetMatchType() { + this._matchType = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // sign_arg - computed: true, optional: true, required: false + private _signArg?: string; + public get signArg() { + return this.getStringAttribute('sign_arg'); + } + public set signArg(value: string) { + this._signArg = value; + } + public resetSignArg() { + this._signArg = undefined; + } + // Temporarily expose input value. Use with caution. + public get signArgInput() { + return this._signArg; + } + + // sign_method - computed: true, optional: true, required: false + private _signMethod?: string; + public get signMethod() { + return this.getStringAttribute('sign_method'); + } + public set signMethod(value: string) { + this._signMethod = value; + } + public resetSignMethod() { + this._signMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get signMethodInput() { + return this._signMethod; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // time_format - computed: true, optional: true, required: false + private _timeFormat?: string; + public get timeFormat() { + return this.getStringAttribute('time_format'); + } + public set timeFormat(value: string) { + this._timeFormat = value; + } + public resetTimeFormat() { + this._timeFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeFormatInput() { + return this._timeFormat; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // inherit_config - computed: false, optional: true, required: false + private _inheritConfig = new CdnDomainV1ConfigsUrlSigningInheritConfigOutputReference(this, "inherit_config"); + public get inheritConfig() { + return this._inheritConfig; + } + public putInheritConfig(value: CdnDomainV1ConfigsUrlSigningInheritConfig) { + this._inheritConfig.internalValue = value; + } + public resetInheritConfig() { + this._inheritConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get inheritConfigInput() { + return this._inheritConfig.internalValue; + } +} +export interface CdnDomainV1ConfigsUserAgentFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#include_empty CdnDomainV1#include_empty} + */ + readonly includeEmpty?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#type CdnDomainV1#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ua_list CdnDomainV1#ua_list} + */ + readonly uaList?: string[]; +} + +export function cdnDomainV1ConfigsUserAgentFilterToTerraform(struct?: CdnDomainV1ConfigsUserAgentFilterOutputReference | CdnDomainV1ConfigsUserAgentFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + include_empty: cdktf.stringToTerraform(struct!.includeEmpty), + type: cdktf.stringToTerraform(struct!.type), + ua_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.uaList), + } +} + + +export function cdnDomainV1ConfigsUserAgentFilterToHclTerraform(struct?: CdnDomainV1ConfigsUserAgentFilterOutputReference | CdnDomainV1ConfigsUserAgentFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + include_empty: { + value: cdktf.stringToHclTerraform(struct!.includeEmpty), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ua_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.uaList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsUserAgentFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsUserAgentFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._includeEmpty !== undefined) { + hasAnyValues = true; + internalValueResult.includeEmpty = this._includeEmpty; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._uaList !== undefined) { + hasAnyValues = true; + internalValueResult.uaList = this._uaList; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsUserAgentFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._includeEmpty = undefined; + this._type = undefined; + this._uaList = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._includeEmpty = value.includeEmpty; + this._type = value.type; + this._uaList = value.uaList; + } + } + + // include_empty - computed: true, optional: true, required: false + private _includeEmpty?: string; + public get includeEmpty() { + return this.getStringAttribute('include_empty'); + } + public set includeEmpty(value: string) { + this._includeEmpty = value; + } + public resetIncludeEmpty() { + this._includeEmpty = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeEmptyInput() { + return this._includeEmpty; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ua_list - computed: true, optional: true, required: false + private _uaList?: string[]; + public get uaList() { + return cdktf.Fn.tolist(this.getListAttribute('ua_list')); + } + public set uaList(value: string[]) { + this._uaList = value; + } + public resetUaList() { + this._uaList = undefined; + } + // Temporarily expose input value. Use with caution. + public get uaListInput() { + return this._uaList; + } +} +export interface CdnDomainV1ConfigsVideoSeek { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enable_flv_by_time_seek CdnDomainV1#enable_flv_by_time_seek} + */ + readonly enableFlvByTimeSeek?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enable_video_seek CdnDomainV1#enable_video_seek} + */ + readonly enableVideoSeek: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#end_parameter CdnDomainV1#end_parameter} + */ + readonly endParameter?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#start_parameter CdnDomainV1#start_parameter} + */ + readonly startParameter?: string; +} + +export function cdnDomainV1ConfigsVideoSeekToTerraform(struct?: CdnDomainV1ConfigsVideoSeekOutputReference | CdnDomainV1ConfigsVideoSeek): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable_flv_by_time_seek: cdktf.booleanToTerraform(struct!.enableFlvByTimeSeek), + enable_video_seek: cdktf.booleanToTerraform(struct!.enableVideoSeek), + end_parameter: cdktf.stringToTerraform(struct!.endParameter), + start_parameter: cdktf.stringToTerraform(struct!.startParameter), + } +} + + +export function cdnDomainV1ConfigsVideoSeekToHclTerraform(struct?: CdnDomainV1ConfigsVideoSeekOutputReference | CdnDomainV1ConfigsVideoSeek): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable_flv_by_time_seek: { + value: cdktf.booleanToHclTerraform(struct!.enableFlvByTimeSeek), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_video_seek: { + value: cdktf.booleanToHclTerraform(struct!.enableVideoSeek), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end_parameter: { + value: cdktf.stringToHclTerraform(struct!.endParameter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_parameter: { + value: cdktf.stringToHclTerraform(struct!.startParameter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsVideoSeekOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsVideoSeek | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enableFlvByTimeSeek !== undefined) { + hasAnyValues = true; + internalValueResult.enableFlvByTimeSeek = this._enableFlvByTimeSeek; + } + if (this._enableVideoSeek !== undefined) { + hasAnyValues = true; + internalValueResult.enableVideoSeek = this._enableVideoSeek; + } + if (this._endParameter !== undefined) { + hasAnyValues = true; + internalValueResult.endParameter = this._endParameter; + } + if (this._startParameter !== undefined) { + hasAnyValues = true; + internalValueResult.startParameter = this._startParameter; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsVideoSeek | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enableFlvByTimeSeek = undefined; + this._enableVideoSeek = undefined; + this._endParameter = undefined; + this._startParameter = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enableFlvByTimeSeek = value.enableFlvByTimeSeek; + this._enableVideoSeek = value.enableVideoSeek; + this._endParameter = value.endParameter; + this._startParameter = value.startParameter; + } + } + + // enable_flv_by_time_seek - computed: true, optional: true, required: false + private _enableFlvByTimeSeek?: boolean | cdktf.IResolvable; + public get enableFlvByTimeSeek() { + return this.getBooleanAttribute('enable_flv_by_time_seek'); + } + public set enableFlvByTimeSeek(value: boolean | cdktf.IResolvable) { + this._enableFlvByTimeSeek = value; + } + public resetEnableFlvByTimeSeek() { + this._enableFlvByTimeSeek = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableFlvByTimeSeekInput() { + return this._enableFlvByTimeSeek; + } + + // enable_video_seek - computed: false, optional: false, required: true + private _enableVideoSeek?: boolean | cdktf.IResolvable; + public get enableVideoSeek() { + return this.getBooleanAttribute('enable_video_seek'); + } + public set enableVideoSeek(value: boolean | cdktf.IResolvable) { + this._enableVideoSeek = value; + } + // Temporarily expose input value. Use with caution. + public get enableVideoSeekInput() { + return this._enableVideoSeek; + } + + // end_parameter - computed: false, optional: true, required: false + private _endParameter?: string; + public get endParameter() { + return this.getStringAttribute('end_parameter'); + } + public set endParameter(value: string) { + this._endParameter = value; + } + public resetEndParameter() { + this._endParameter = undefined; + } + // Temporarily expose input value. Use with caution. + public get endParameterInput() { + return this._endParameter; + } + + // start_parameter - computed: false, optional: true, required: false + private _startParameter?: string; + public get startParameter() { + return this.getStringAttribute('start_parameter'); + } + public set startParameter(value: string) { + this._startParameter = value; + } + public resetStartParameter() { + this._startParameter = undefined; + } + // Temporarily expose input value. Use with caution. + public get startParameterInput() { + return this._startParameter; + } +} +export interface CdnDomainV1ConfigsWebsocket { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#enabled CdnDomainV1#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#timeout CdnDomainV1#timeout} + */ + readonly timeout?: number; +} + +export function cdnDomainV1ConfigsWebsocketToTerraform(struct?: CdnDomainV1ConfigsWebsocketOutputReference | CdnDomainV1ConfigsWebsocket): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function cdnDomainV1ConfigsWebsocketToHclTerraform(struct?: CdnDomainV1ConfigsWebsocketOutputReference | CdnDomainV1ConfigsWebsocket): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsWebsocketOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1ConfigsWebsocket | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1ConfigsWebsocket | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._timeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._timeout = value.timeout; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} +export interface CdnDomainV1Configs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#description CdnDomainV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ipv6_enable CdnDomainV1#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#origin_follow302_status CdnDomainV1#origin_follow302_status} + */ + readonly originFollow302Status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#origin_protocol CdnDomainV1#origin_protocol} + */ + readonly originProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#origin_receive_timeout CdnDomainV1#origin_receive_timeout} + */ + readonly originReceiveTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#range_based_retrieval_enabled CdnDomainV1#range_based_retrieval_enabled} + */ + readonly rangeBasedRetrievalEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#slice_etag_status CdnDomainV1#slice_etag_status} + */ + readonly sliceEtagStatus?: string; + /** + * access_area_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#access_area_filter CdnDomainV1#access_area_filter} + */ + readonly accessAreaFilter?: CdnDomainV1ConfigsAccessAreaFilter[] | cdktf.IResolvable; + /** + * cache_url_parameter_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#cache_url_parameter_filter CdnDomainV1#cache_url_parameter_filter} + */ + readonly cacheUrlParameterFilter?: CdnDomainV1ConfigsCacheUrlParameterFilter; + /** + * compress block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#compress CdnDomainV1#compress} + */ + readonly compress?: CdnDomainV1ConfigsCompress; + /** + * error_code_cache block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#error_code_cache CdnDomainV1#error_code_cache} + */ + readonly errorCodeCache?: CdnDomainV1ConfigsErrorCodeCache[] | cdktf.IResolvable; + /** + * error_code_redirect_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#error_code_redirect_rules CdnDomainV1#error_code_redirect_rules} + */ + readonly errorCodeRedirectRules?: CdnDomainV1ConfigsErrorCodeRedirectRules[] | cdktf.IResolvable; + /** + * flexible_origin block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#flexible_origin CdnDomainV1#flexible_origin} + */ + readonly flexibleOrigin?: CdnDomainV1ConfigsFlexibleOrigin[] | cdktf.IResolvable; + /** + * force_redirect block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#force_redirect CdnDomainV1#force_redirect} + */ + readonly forceRedirect?: CdnDomainV1ConfigsForceRedirect; + /** + * hsts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#hsts CdnDomainV1#hsts} + */ + readonly hsts?: CdnDomainV1ConfigsHsts; + /** + * http_response_header block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#http_response_header CdnDomainV1#http_response_header} + */ + readonly httpResponseHeader?: CdnDomainV1ConfigsHttpResponseHeader[] | cdktf.IResolvable; + /** + * https_settings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#https_settings CdnDomainV1#https_settings} + */ + readonly httpsSettings?: CdnDomainV1ConfigsHttpsSettings; + /** + * ip_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ip_filter CdnDomainV1#ip_filter} + */ + readonly ipFilter?: CdnDomainV1ConfigsIpFilter; + /** + * ip_frequency_limit block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#ip_frequency_limit CdnDomainV1#ip_frequency_limit} + */ + readonly ipFrequencyLimit?: CdnDomainV1ConfigsIpFrequencyLimit; + /** + * origin_request_url_rewrite block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#origin_request_url_rewrite CdnDomainV1#origin_request_url_rewrite} + */ + readonly originRequestUrlRewrite?: CdnDomainV1ConfigsOriginRequestUrlRewrite[] | cdktf.IResolvable; + /** + * quic block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#quic CdnDomainV1#quic} + */ + readonly quic?: CdnDomainV1ConfigsQuic; + /** + * referer block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#referer CdnDomainV1#referer} + */ + readonly referer?: CdnDomainV1ConfigsReferer; + /** + * remote_auth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#remote_auth CdnDomainV1#remote_auth} + */ + readonly remoteAuth?: CdnDomainV1ConfigsRemoteAuth; + /** + * request_limit_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#request_limit_rules CdnDomainV1#request_limit_rules} + */ + readonly requestLimitRules?: CdnDomainV1ConfigsRequestLimitRules[] | cdktf.IResolvable; + /** + * retrieval_request_header block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#retrieval_request_header CdnDomainV1#retrieval_request_header} + */ + readonly retrievalRequestHeader?: CdnDomainV1ConfigsRetrievalRequestHeader[] | cdktf.IResolvable; + /** + * url_signing block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#url_signing CdnDomainV1#url_signing} + */ + readonly urlSigning?: CdnDomainV1ConfigsUrlSigning; + /** + * user_agent_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#user_agent_filter CdnDomainV1#user_agent_filter} + */ + readonly userAgentFilter?: CdnDomainV1ConfigsUserAgentFilter; + /** + * video_seek block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#video_seek CdnDomainV1#video_seek} + */ + readonly videoSeek?: CdnDomainV1ConfigsVideoSeek; + /** + * websocket block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#websocket CdnDomainV1#websocket} + */ + readonly websocket?: CdnDomainV1ConfigsWebsocket; +} + +export function cdnDomainV1ConfigsToTerraform(struct?: CdnDomainV1ConfigsOutputReference | CdnDomainV1Configs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + ipv6_enable: cdktf.booleanToTerraform(struct!.ipv6Enable), + origin_follow302_status: cdktf.stringToTerraform(struct!.originFollow302Status), + origin_protocol: cdktf.stringToTerraform(struct!.originProtocol), + origin_receive_timeout: cdktf.numberToTerraform(struct!.originReceiveTimeout), + range_based_retrieval_enabled: cdktf.booleanToTerraform(struct!.rangeBasedRetrievalEnabled), + slice_etag_status: cdktf.stringToTerraform(struct!.sliceEtagStatus), + access_area_filter: cdktf.listMapper(cdnDomainV1ConfigsAccessAreaFilterToTerraform, true)(struct!.accessAreaFilter), + cache_url_parameter_filter: cdnDomainV1ConfigsCacheUrlParameterFilterToTerraform(struct!.cacheUrlParameterFilter), + compress: cdnDomainV1ConfigsCompressToTerraform(struct!.compress), + error_code_cache: cdktf.listMapper(cdnDomainV1ConfigsErrorCodeCacheToTerraform, true)(struct!.errorCodeCache), + error_code_redirect_rules: cdktf.listMapper(cdnDomainV1ConfigsErrorCodeRedirectRulesToTerraform, true)(struct!.errorCodeRedirectRules), + flexible_origin: cdktf.listMapper(cdnDomainV1ConfigsFlexibleOriginToTerraform, true)(struct!.flexibleOrigin), + force_redirect: cdnDomainV1ConfigsForceRedirectToTerraform(struct!.forceRedirect), + hsts: cdnDomainV1ConfigsHstsToTerraform(struct!.hsts), + http_response_header: cdktf.listMapper(cdnDomainV1ConfigsHttpResponseHeaderToTerraform, true)(struct!.httpResponseHeader), + https_settings: cdnDomainV1ConfigsHttpsSettingsToTerraform(struct!.httpsSettings), + ip_filter: cdnDomainV1ConfigsIpFilterToTerraform(struct!.ipFilter), + ip_frequency_limit: cdnDomainV1ConfigsIpFrequencyLimitToTerraform(struct!.ipFrequencyLimit), + origin_request_url_rewrite: cdktf.listMapper(cdnDomainV1ConfigsOriginRequestUrlRewriteToTerraform, true)(struct!.originRequestUrlRewrite), + quic: cdnDomainV1ConfigsQuicToTerraform(struct!.quic), + referer: cdnDomainV1ConfigsRefererToTerraform(struct!.referer), + remote_auth: cdnDomainV1ConfigsRemoteAuthToTerraform(struct!.remoteAuth), + request_limit_rules: cdktf.listMapper(cdnDomainV1ConfigsRequestLimitRulesToTerraform, true)(struct!.requestLimitRules), + retrieval_request_header: cdktf.listMapper(cdnDomainV1ConfigsRetrievalRequestHeaderToTerraform, true)(struct!.retrievalRequestHeader), + url_signing: cdnDomainV1ConfigsUrlSigningToTerraform(struct!.urlSigning), + user_agent_filter: cdnDomainV1ConfigsUserAgentFilterToTerraform(struct!.userAgentFilter), + video_seek: cdnDomainV1ConfigsVideoSeekToTerraform(struct!.videoSeek), + websocket: cdnDomainV1ConfigsWebsocketToTerraform(struct!.websocket), + } +} + + +export function cdnDomainV1ConfigsToHclTerraform(struct?: CdnDomainV1ConfigsOutputReference | CdnDomainV1Configs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(struct!.ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + origin_follow302_status: { + value: cdktf.stringToHclTerraform(struct!.originFollow302Status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin_protocol: { + value: cdktf.stringToHclTerraform(struct!.originProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin_receive_timeout: { + value: cdktf.numberToHclTerraform(struct!.originReceiveTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + range_based_retrieval_enabled: { + value: cdktf.booleanToHclTerraform(struct!.rangeBasedRetrievalEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + slice_etag_status: { + value: cdktf.stringToHclTerraform(struct!.sliceEtagStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_area_filter: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsAccessAreaFilterToHclTerraform, true)(struct!.accessAreaFilter), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsAccessAreaFilterList", + }, + cache_url_parameter_filter: { + value: cdnDomainV1ConfigsCacheUrlParameterFilterToHclTerraform(struct!.cacheUrlParameterFilter), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsCacheUrlParameterFilterList", + }, + compress: { + value: cdnDomainV1ConfigsCompressToHclTerraform(struct!.compress), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsCompressList", + }, + error_code_cache: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsErrorCodeCacheToHclTerraform, true)(struct!.errorCodeCache), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsErrorCodeCacheList", + }, + error_code_redirect_rules: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsErrorCodeRedirectRulesToHclTerraform, true)(struct!.errorCodeRedirectRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsErrorCodeRedirectRulesList", + }, + flexible_origin: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsFlexibleOriginToHclTerraform, true)(struct!.flexibleOrigin), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsFlexibleOriginList", + }, + force_redirect: { + value: cdnDomainV1ConfigsForceRedirectToHclTerraform(struct!.forceRedirect), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsForceRedirectList", + }, + hsts: { + value: cdnDomainV1ConfigsHstsToHclTerraform(struct!.hsts), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsHstsList", + }, + http_response_header: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsHttpResponseHeaderToHclTerraform, true)(struct!.httpResponseHeader), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsHttpResponseHeaderList", + }, + https_settings: { + value: cdnDomainV1ConfigsHttpsSettingsToHclTerraform(struct!.httpsSettings), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsHttpsSettingsList", + }, + ip_filter: { + value: cdnDomainV1ConfigsIpFilterToHclTerraform(struct!.ipFilter), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsIpFilterList", + }, + ip_frequency_limit: { + value: cdnDomainV1ConfigsIpFrequencyLimitToHclTerraform(struct!.ipFrequencyLimit), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsIpFrequencyLimitList", + }, + origin_request_url_rewrite: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsOriginRequestUrlRewriteToHclTerraform, true)(struct!.originRequestUrlRewrite), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsOriginRequestUrlRewriteList", + }, + quic: { + value: cdnDomainV1ConfigsQuicToHclTerraform(struct!.quic), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsQuicList", + }, + referer: { + value: cdnDomainV1ConfigsRefererToHclTerraform(struct!.referer), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsRefererList", + }, + remote_auth: { + value: cdnDomainV1ConfigsRemoteAuthToHclTerraform(struct!.remoteAuth), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsRemoteAuthList", + }, + request_limit_rules: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsRequestLimitRulesToHclTerraform, true)(struct!.requestLimitRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsRequestLimitRulesList", + }, + retrieval_request_header: { + value: cdktf.listMapperHcl(cdnDomainV1ConfigsRetrievalRequestHeaderToHclTerraform, true)(struct!.retrievalRequestHeader), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1ConfigsRetrievalRequestHeaderList", + }, + url_signing: { + value: cdnDomainV1ConfigsUrlSigningToHclTerraform(struct!.urlSigning), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsUrlSigningList", + }, + user_agent_filter: { + value: cdnDomainV1ConfigsUserAgentFilterToHclTerraform(struct!.userAgentFilter), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsUserAgentFilterList", + }, + video_seek: { + value: cdnDomainV1ConfigsVideoSeekToHclTerraform(struct!.videoSeek), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsVideoSeekList", + }, + websocket: { + value: cdnDomainV1ConfigsWebsocketToHclTerraform(struct!.websocket), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsWebsocketList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1ConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainV1Configs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._ipv6Enable !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6Enable = this._ipv6Enable; + } + if (this._originFollow302Status !== undefined) { + hasAnyValues = true; + internalValueResult.originFollow302Status = this._originFollow302Status; + } + if (this._originProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.originProtocol = this._originProtocol; + } + if (this._originReceiveTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.originReceiveTimeout = this._originReceiveTimeout; + } + if (this._rangeBasedRetrievalEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.rangeBasedRetrievalEnabled = this._rangeBasedRetrievalEnabled; + } + if (this._sliceEtagStatus !== undefined) { + hasAnyValues = true; + internalValueResult.sliceEtagStatus = this._sliceEtagStatus; + } + if (this._accessAreaFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.accessAreaFilter = this._accessAreaFilter?.internalValue; + } + if (this._cacheUrlParameterFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cacheUrlParameterFilter = this._cacheUrlParameterFilter?.internalValue; + } + if (this._compress?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.compress = this._compress?.internalValue; + } + if (this._errorCodeCache?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.errorCodeCache = this._errorCodeCache?.internalValue; + } + if (this._errorCodeRedirectRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.errorCodeRedirectRules = this._errorCodeRedirectRules?.internalValue; + } + if (this._flexibleOrigin?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.flexibleOrigin = this._flexibleOrigin?.internalValue; + } + if (this._forceRedirect?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.forceRedirect = this._forceRedirect?.internalValue; + } + if (this._hsts?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.hsts = this._hsts?.internalValue; + } + if (this._httpResponseHeader?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpResponseHeader = this._httpResponseHeader?.internalValue; + } + if (this._httpsSettings?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpsSettings = this._httpsSettings?.internalValue; + } + if (this._ipFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.ipFilter = this._ipFilter?.internalValue; + } + if (this._ipFrequencyLimit?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.ipFrequencyLimit = this._ipFrequencyLimit?.internalValue; + } + if (this._originRequestUrlRewrite?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.originRequestUrlRewrite = this._originRequestUrlRewrite?.internalValue; + } + if (this._quic?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.quic = this._quic?.internalValue; + } + if (this._referer?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.referer = this._referer?.internalValue; + } + if (this._remoteAuth?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.remoteAuth = this._remoteAuth?.internalValue; + } + if (this._requestLimitRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.requestLimitRules = this._requestLimitRules?.internalValue; + } + if (this._retrievalRequestHeader?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.retrievalRequestHeader = this._retrievalRequestHeader?.internalValue; + } + if (this._urlSigning?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.urlSigning = this._urlSigning?.internalValue; + } + if (this._userAgentFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.userAgentFilter = this._userAgentFilter?.internalValue; + } + if (this._videoSeek?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.videoSeek = this._videoSeek?.internalValue; + } + if (this._websocket?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.websocket = this._websocket?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1Configs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._ipv6Enable = undefined; + this._originFollow302Status = undefined; + this._originProtocol = undefined; + this._originReceiveTimeout = undefined; + this._rangeBasedRetrievalEnabled = undefined; + this._sliceEtagStatus = undefined; + this._accessAreaFilter.internalValue = undefined; + this._cacheUrlParameterFilter.internalValue = undefined; + this._compress.internalValue = undefined; + this._errorCodeCache.internalValue = undefined; + this._errorCodeRedirectRules.internalValue = undefined; + this._flexibleOrigin.internalValue = undefined; + this._forceRedirect.internalValue = undefined; + this._hsts.internalValue = undefined; + this._httpResponseHeader.internalValue = undefined; + this._httpsSettings.internalValue = undefined; + this._ipFilter.internalValue = undefined; + this._ipFrequencyLimit.internalValue = undefined; + this._originRequestUrlRewrite.internalValue = undefined; + this._quic.internalValue = undefined; + this._referer.internalValue = undefined; + this._remoteAuth.internalValue = undefined; + this._requestLimitRules.internalValue = undefined; + this._retrievalRequestHeader.internalValue = undefined; + this._urlSigning.internalValue = undefined; + this._userAgentFilter.internalValue = undefined; + this._videoSeek.internalValue = undefined; + this._websocket.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._ipv6Enable = value.ipv6Enable; + this._originFollow302Status = value.originFollow302Status; + this._originProtocol = value.originProtocol; + this._originReceiveTimeout = value.originReceiveTimeout; + this._rangeBasedRetrievalEnabled = value.rangeBasedRetrievalEnabled; + this._sliceEtagStatus = value.sliceEtagStatus; + this._accessAreaFilter.internalValue = value.accessAreaFilter; + this._cacheUrlParameterFilter.internalValue = value.cacheUrlParameterFilter; + this._compress.internalValue = value.compress; + this._errorCodeCache.internalValue = value.errorCodeCache; + this._errorCodeRedirectRules.internalValue = value.errorCodeRedirectRules; + this._flexibleOrigin.internalValue = value.flexibleOrigin; + this._forceRedirect.internalValue = value.forceRedirect; + this._hsts.internalValue = value.hsts; + this._httpResponseHeader.internalValue = value.httpResponseHeader; + this._httpsSettings.internalValue = value.httpsSettings; + this._ipFilter.internalValue = value.ipFilter; + this._ipFrequencyLimit.internalValue = value.ipFrequencyLimit; + this._originRequestUrlRewrite.internalValue = value.originRequestUrlRewrite; + this._quic.internalValue = value.quic; + this._referer.internalValue = value.referer; + this._remoteAuth.internalValue = value.remoteAuth; + this._requestLimitRules.internalValue = value.requestLimitRules; + this._retrievalRequestHeader.internalValue = value.retrievalRequestHeader; + this._urlSigning.internalValue = value.urlSigning; + this._userAgentFilter.internalValue = value.userAgentFilter; + this._videoSeek.internalValue = value.videoSeek; + this._websocket.internalValue = value.websocket; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // origin_follow302_status - computed: true, optional: true, required: false + private _originFollow302Status?: string; + public get originFollow302Status() { + return this.getStringAttribute('origin_follow302_status'); + } + public set originFollow302Status(value: string) { + this._originFollow302Status = value; + } + public resetOriginFollow302Status() { + this._originFollow302Status = undefined; + } + // Temporarily expose input value. Use with caution. + public get originFollow302StatusInput() { + return this._originFollow302Status; + } + + // origin_protocol - computed: true, optional: true, required: false + private _originProtocol?: string; + public get originProtocol() { + return this.getStringAttribute('origin_protocol'); + } + public set originProtocol(value: string) { + this._originProtocol = value; + } + public resetOriginProtocol() { + this._originProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get originProtocolInput() { + return this._originProtocol; + } + + // origin_receive_timeout - computed: true, optional: true, required: false + private _originReceiveTimeout?: number; + public get originReceiveTimeout() { + return this.getNumberAttribute('origin_receive_timeout'); + } + public set originReceiveTimeout(value: number) { + this._originReceiveTimeout = value; + } + public resetOriginReceiveTimeout() { + this._originReceiveTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get originReceiveTimeoutInput() { + return this._originReceiveTimeout; + } + + // range_based_retrieval_enabled - computed: false, optional: true, required: false + private _rangeBasedRetrievalEnabled?: boolean | cdktf.IResolvable; + public get rangeBasedRetrievalEnabled() { + return this.getBooleanAttribute('range_based_retrieval_enabled'); + } + public set rangeBasedRetrievalEnabled(value: boolean | cdktf.IResolvable) { + this._rangeBasedRetrievalEnabled = value; + } + public resetRangeBasedRetrievalEnabled() { + this._rangeBasedRetrievalEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get rangeBasedRetrievalEnabledInput() { + return this._rangeBasedRetrievalEnabled; + } + + // slice_etag_status - computed: true, optional: true, required: false + private _sliceEtagStatus?: string; + public get sliceEtagStatus() { + return this.getStringAttribute('slice_etag_status'); + } + public set sliceEtagStatus(value: string) { + this._sliceEtagStatus = value; + } + public resetSliceEtagStatus() { + this._sliceEtagStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get sliceEtagStatusInput() { + return this._sliceEtagStatus; + } + + // access_area_filter - computed: false, optional: true, required: false + private _accessAreaFilter = new CdnDomainV1ConfigsAccessAreaFilterList(this, "access_area_filter", true); + public get accessAreaFilter() { + return this._accessAreaFilter; + } + public putAccessAreaFilter(value: CdnDomainV1ConfigsAccessAreaFilter[] | cdktf.IResolvable) { + this._accessAreaFilter.internalValue = value; + } + public resetAccessAreaFilter() { + this._accessAreaFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessAreaFilterInput() { + return this._accessAreaFilter.internalValue; + } + + // cache_url_parameter_filter - computed: false, optional: true, required: false + private _cacheUrlParameterFilter = new CdnDomainV1ConfigsCacheUrlParameterFilterOutputReference(this, "cache_url_parameter_filter"); + public get cacheUrlParameterFilter() { + return this._cacheUrlParameterFilter; + } + public putCacheUrlParameterFilter(value: CdnDomainV1ConfigsCacheUrlParameterFilter) { + this._cacheUrlParameterFilter.internalValue = value; + } + public resetCacheUrlParameterFilter() { + this._cacheUrlParameterFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheUrlParameterFilterInput() { + return this._cacheUrlParameterFilter.internalValue; + } + + // compress - computed: false, optional: true, required: false + private _compress = new CdnDomainV1ConfigsCompressOutputReference(this, "compress"); + public get compress() { + return this._compress; + } + public putCompress(value: CdnDomainV1ConfigsCompress) { + this._compress.internalValue = value; + } + public resetCompress() { + this._compress.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressInput() { + return this._compress.internalValue; + } + + // error_code_cache - computed: false, optional: true, required: false + private _errorCodeCache = new CdnDomainV1ConfigsErrorCodeCacheList(this, "error_code_cache", true); + public get errorCodeCache() { + return this._errorCodeCache; + } + public putErrorCodeCache(value: CdnDomainV1ConfigsErrorCodeCache[] | cdktf.IResolvable) { + this._errorCodeCache.internalValue = value; + } + public resetErrorCodeCache() { + this._errorCodeCache.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorCodeCacheInput() { + return this._errorCodeCache.internalValue; + } + + // error_code_redirect_rules - computed: false, optional: true, required: false + private _errorCodeRedirectRules = new CdnDomainV1ConfigsErrorCodeRedirectRulesList(this, "error_code_redirect_rules", true); + public get errorCodeRedirectRules() { + return this._errorCodeRedirectRules; + } + public putErrorCodeRedirectRules(value: CdnDomainV1ConfigsErrorCodeRedirectRules[] | cdktf.IResolvable) { + this._errorCodeRedirectRules.internalValue = value; + } + public resetErrorCodeRedirectRules() { + this._errorCodeRedirectRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorCodeRedirectRulesInput() { + return this._errorCodeRedirectRules.internalValue; + } + + // flexible_origin - computed: false, optional: true, required: false + private _flexibleOrigin = new CdnDomainV1ConfigsFlexibleOriginList(this, "flexible_origin", true); + public get flexibleOrigin() { + return this._flexibleOrigin; + } + public putFlexibleOrigin(value: CdnDomainV1ConfigsFlexibleOrigin[] | cdktf.IResolvable) { + this._flexibleOrigin.internalValue = value; + } + public resetFlexibleOrigin() { + this._flexibleOrigin.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get flexibleOriginInput() { + return this._flexibleOrigin.internalValue; + } + + // force_redirect - computed: false, optional: true, required: false + private _forceRedirect = new CdnDomainV1ConfigsForceRedirectOutputReference(this, "force_redirect"); + public get forceRedirect() { + return this._forceRedirect; + } + public putForceRedirect(value: CdnDomainV1ConfigsForceRedirect) { + this._forceRedirect.internalValue = value; + } + public resetForceRedirect() { + this._forceRedirect.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceRedirectInput() { + return this._forceRedirect.internalValue; + } + + // hsts - computed: false, optional: true, required: false + private _hsts = new CdnDomainV1ConfigsHstsOutputReference(this, "hsts"); + public get hsts() { + return this._hsts; + } + public putHsts(value: CdnDomainV1ConfigsHsts) { + this._hsts.internalValue = value; + } + public resetHsts() { + this._hsts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hstsInput() { + return this._hsts.internalValue; + } + + // http_response_header - computed: false, optional: true, required: false + private _httpResponseHeader = new CdnDomainV1ConfigsHttpResponseHeaderList(this, "http_response_header", true); + public get httpResponseHeader() { + return this._httpResponseHeader; + } + public putHttpResponseHeader(value: CdnDomainV1ConfigsHttpResponseHeader[] | cdktf.IResolvable) { + this._httpResponseHeader.internalValue = value; + } + public resetHttpResponseHeader() { + this._httpResponseHeader.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpResponseHeaderInput() { + return this._httpResponseHeader.internalValue; + } + + // https_settings - computed: false, optional: true, required: false + private _httpsSettings = new CdnDomainV1ConfigsHttpsSettingsOutputReference(this, "https_settings"); + public get httpsSettings() { + return this._httpsSettings; + } + public putHttpsSettings(value: CdnDomainV1ConfigsHttpsSettings) { + this._httpsSettings.internalValue = value; + } + public resetHttpsSettings() { + this._httpsSettings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsSettingsInput() { + return this._httpsSettings.internalValue; + } + + // ip_filter - computed: false, optional: true, required: false + private _ipFilter = new CdnDomainV1ConfigsIpFilterOutputReference(this, "ip_filter"); + public get ipFilter() { + return this._ipFilter; + } + public putIpFilter(value: CdnDomainV1ConfigsIpFilter) { + this._ipFilter.internalValue = value; + } + public resetIpFilter() { + this._ipFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipFilterInput() { + return this._ipFilter.internalValue; + } + + // ip_frequency_limit - computed: false, optional: true, required: false + private _ipFrequencyLimit = new CdnDomainV1ConfigsIpFrequencyLimitOutputReference(this, "ip_frequency_limit"); + public get ipFrequencyLimit() { + return this._ipFrequencyLimit; + } + public putIpFrequencyLimit(value: CdnDomainV1ConfigsIpFrequencyLimit) { + this._ipFrequencyLimit.internalValue = value; + } + public resetIpFrequencyLimit() { + this._ipFrequencyLimit.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipFrequencyLimitInput() { + return this._ipFrequencyLimit.internalValue; + } + + // origin_request_url_rewrite - computed: false, optional: true, required: false + private _originRequestUrlRewrite = new CdnDomainV1ConfigsOriginRequestUrlRewriteList(this, "origin_request_url_rewrite", true); + public get originRequestUrlRewrite() { + return this._originRequestUrlRewrite; + } + public putOriginRequestUrlRewrite(value: CdnDomainV1ConfigsOriginRequestUrlRewrite[] | cdktf.IResolvable) { + this._originRequestUrlRewrite.internalValue = value; + } + public resetOriginRequestUrlRewrite() { + this._originRequestUrlRewrite.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get originRequestUrlRewriteInput() { + return this._originRequestUrlRewrite.internalValue; + } + + // quic - computed: false, optional: true, required: false + private _quic = new CdnDomainV1ConfigsQuicOutputReference(this, "quic"); + public get quic() { + return this._quic; + } + public putQuic(value: CdnDomainV1ConfigsQuic) { + this._quic.internalValue = value; + } + public resetQuic() { + this._quic.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get quicInput() { + return this._quic.internalValue; + } + + // referer - computed: false, optional: true, required: false + private _referer = new CdnDomainV1ConfigsRefererOutputReference(this, "referer"); + public get referer() { + return this._referer; + } + public putReferer(value: CdnDomainV1ConfigsReferer) { + this._referer.internalValue = value; + } + public resetReferer() { + this._referer.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get refererInput() { + return this._referer.internalValue; + } + + // remote_auth - computed: false, optional: true, required: false + private _remoteAuth = new CdnDomainV1ConfigsRemoteAuthOutputReference(this, "remote_auth"); + public get remoteAuth() { + return this._remoteAuth; + } + public putRemoteAuth(value: CdnDomainV1ConfigsRemoteAuth) { + this._remoteAuth.internalValue = value; + } + public resetRemoteAuth() { + this._remoteAuth.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAuthInput() { + return this._remoteAuth.internalValue; + } + + // request_limit_rules - computed: false, optional: true, required: false + private _requestLimitRules = new CdnDomainV1ConfigsRequestLimitRulesList(this, "request_limit_rules", true); + public get requestLimitRules() { + return this._requestLimitRules; + } + public putRequestLimitRules(value: CdnDomainV1ConfigsRequestLimitRules[] | cdktf.IResolvable) { + this._requestLimitRules.internalValue = value; + } + public resetRequestLimitRules() { + this._requestLimitRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestLimitRulesInput() { + return this._requestLimitRules.internalValue; + } + + // retrieval_request_header - computed: false, optional: true, required: false + private _retrievalRequestHeader = new CdnDomainV1ConfigsRetrievalRequestHeaderList(this, "retrieval_request_header", true); + public get retrievalRequestHeader() { + return this._retrievalRequestHeader; + } + public putRetrievalRequestHeader(value: CdnDomainV1ConfigsRetrievalRequestHeader[] | cdktf.IResolvable) { + this._retrievalRequestHeader.internalValue = value; + } + public resetRetrievalRequestHeader() { + this._retrievalRequestHeader.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get retrievalRequestHeaderInput() { + return this._retrievalRequestHeader.internalValue; + } + + // url_signing - computed: false, optional: true, required: false + private _urlSigning = new CdnDomainV1ConfigsUrlSigningOutputReference(this, "url_signing"); + public get urlSigning() { + return this._urlSigning; + } + public putUrlSigning(value: CdnDomainV1ConfigsUrlSigning) { + this._urlSigning.internalValue = value; + } + public resetUrlSigning() { + this._urlSigning.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlSigningInput() { + return this._urlSigning.internalValue; + } + + // user_agent_filter - computed: false, optional: true, required: false + private _userAgentFilter = new CdnDomainV1ConfigsUserAgentFilterOutputReference(this, "user_agent_filter"); + public get userAgentFilter() { + return this._userAgentFilter; + } + public putUserAgentFilter(value: CdnDomainV1ConfigsUserAgentFilter) { + this._userAgentFilter.internalValue = value; + } + public resetUserAgentFilter() { + this._userAgentFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get userAgentFilterInput() { + return this._userAgentFilter.internalValue; + } + + // video_seek - computed: false, optional: true, required: false + private _videoSeek = new CdnDomainV1ConfigsVideoSeekOutputReference(this, "video_seek"); + public get videoSeek() { + return this._videoSeek; + } + public putVideoSeek(value: CdnDomainV1ConfigsVideoSeek) { + this._videoSeek.internalValue = value; + } + public resetVideoSeek() { + this._videoSeek.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get videoSeekInput() { + return this._videoSeek.internalValue; + } + + // websocket - computed: false, optional: true, required: false + private _websocket = new CdnDomainV1ConfigsWebsocketOutputReference(this, "websocket"); + public get websocket() { + return this._websocket; + } + public putWebsocket(value: CdnDomainV1ConfigsWebsocket) { + this._websocket.internalValue = value; + } + public resetWebsocket() { + this._websocket.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get websocketInput() { + return this._websocket.internalValue; + } +} +export interface CdnDomainV1Sources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#active CdnDomainV1#active} + */ + readonly active?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#http_port CdnDomainV1#http_port} + */ + readonly httpPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#https_port CdnDomainV1#https_port} + */ + readonly httpsPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#obs_bucket_type CdnDomainV1#obs_bucket_type} + */ + readonly obsBucketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#obs_web_hosting_enabled CdnDomainV1#obs_web_hosting_enabled} + */ + readonly obsWebHostingEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#origin CdnDomainV1#origin} + */ + readonly origin: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#origin_type CdnDomainV1#origin_type} + */ + readonly originType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#retrieval_host CdnDomainV1#retrieval_host} + */ + readonly retrievalHost?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#weight CdnDomainV1#weight} + */ + readonly weight?: number; +} + +export function cdnDomainV1SourcesToTerraform(struct?: CdnDomainV1Sources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + active: cdktf.numberToTerraform(struct!.active), + http_port: cdktf.numberToTerraform(struct!.httpPort), + https_port: cdktf.numberToTerraform(struct!.httpsPort), + obs_bucket_type: cdktf.stringToTerraform(struct!.obsBucketType), + obs_web_hosting_enabled: cdktf.booleanToTerraform(struct!.obsWebHostingEnabled), + origin: cdktf.stringToTerraform(struct!.origin), + origin_type: cdktf.stringToTerraform(struct!.originType), + retrieval_host: cdktf.stringToTerraform(struct!.retrievalHost), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function cdnDomainV1SourcesToHclTerraform(struct?: CdnDomainV1Sources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + active: { + value: cdktf.numberToHclTerraform(struct!.active), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + http_port: { + value: cdktf.numberToHclTerraform(struct!.httpPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + https_port: { + value: cdktf.numberToHclTerraform(struct!.httpsPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + obs_bucket_type: { + value: cdktf.stringToHclTerraform(struct!.obsBucketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_web_hosting_enabled: { + value: cdktf.booleanToHclTerraform(struct!.obsWebHostingEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + origin: { + value: cdktf.stringToHclTerraform(struct!.origin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin_type: { + value: cdktf.stringToHclTerraform(struct!.originType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retrieval_host: { + value: cdktf.stringToHclTerraform(struct!.retrievalHost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1SourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainV1Sources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._active !== undefined) { + hasAnyValues = true; + internalValueResult.active = this._active; + } + if (this._httpPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpPort = this._httpPort; + } + if (this._httpsPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpsPort = this._httpsPort; + } + if (this._obsBucketType !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketType = this._obsBucketType; + } + if (this._obsWebHostingEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.obsWebHostingEnabled = this._obsWebHostingEnabled; + } + if (this._origin !== undefined) { + hasAnyValues = true; + internalValueResult.origin = this._origin; + } + if (this._originType !== undefined) { + hasAnyValues = true; + internalValueResult.originType = this._originType; + } + if (this._retrievalHost !== undefined) { + hasAnyValues = true; + internalValueResult.retrievalHost = this._retrievalHost; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1Sources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._active = undefined; + this._httpPort = undefined; + this._httpsPort = undefined; + this._obsBucketType = undefined; + this._obsWebHostingEnabled = undefined; + this._origin = undefined; + this._originType = undefined; + this._retrievalHost = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._active = value.active; + this._httpPort = value.httpPort; + this._httpsPort = value.httpsPort; + this._obsBucketType = value.obsBucketType; + this._obsWebHostingEnabled = value.obsWebHostingEnabled; + this._origin = value.origin; + this._originType = value.originType; + this._retrievalHost = value.retrievalHost; + this._weight = value.weight; + } + } + + // active - computed: false, optional: true, required: false + private _active?: number; + public get active() { + return this.getNumberAttribute('active'); + } + public set active(value: number) { + this._active = value; + } + public resetActive() { + this._active = undefined; + } + // Temporarily expose input value. Use with caution. + public get activeInput() { + return this._active; + } + + // http_port - computed: true, optional: true, required: false + private _httpPort?: number; + public get httpPort() { + return this.getNumberAttribute('http_port'); + } + public set httpPort(value: number) { + this._httpPort = value; + } + public resetHttpPort() { + this._httpPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpPortInput() { + return this._httpPort; + } + + // https_port - computed: true, optional: true, required: false + private _httpsPort?: number; + public get httpsPort() { + return this.getNumberAttribute('https_port'); + } + public set httpsPort(value: number) { + this._httpsPort = value; + } + public resetHttpsPort() { + this._httpsPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsPortInput() { + return this._httpsPort; + } + + // obs_bucket_type - computed: true, optional: true, required: false + private _obsBucketType?: string; + public get obsBucketType() { + return this.getStringAttribute('obs_bucket_type'); + } + public set obsBucketType(value: string) { + this._obsBucketType = value; + } + public resetObsBucketType() { + this._obsBucketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketTypeInput() { + return this._obsBucketType; + } + + // obs_web_hosting_enabled - computed: true, optional: true, required: false + private _obsWebHostingEnabled?: boolean | cdktf.IResolvable; + public get obsWebHostingEnabled() { + return this.getBooleanAttribute('obs_web_hosting_enabled'); + } + public set obsWebHostingEnabled(value: boolean | cdktf.IResolvable) { + this._obsWebHostingEnabled = value; + } + public resetObsWebHostingEnabled() { + this._obsWebHostingEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsWebHostingEnabledInput() { + return this._obsWebHostingEnabled; + } + + // origin - computed: false, optional: false, required: true + private _origin?: string; + public get origin() { + return this.getStringAttribute('origin'); + } + public set origin(value: string) { + this._origin = value; + } + // Temporarily expose input value. Use with caution. + public get originInput() { + return this._origin; + } + + // origin_type - computed: false, optional: false, required: true + private _originType?: string; + public get originType() { + return this.getStringAttribute('origin_type'); + } + public set originType(value: string) { + this._originType = value; + } + // Temporarily expose input value. Use with caution. + public get originTypeInput() { + return this._originType; + } + + // retrieval_host - computed: true, optional: true, required: false + private _retrievalHost?: string; + public get retrievalHost() { + return this.getStringAttribute('retrieval_host'); + } + public set retrievalHost(value: string) { + this._retrievalHost = value; + } + public resetRetrievalHost() { + this._retrievalHost = undefined; + } + // Temporarily expose input value. Use with caution. + public get retrievalHostInput() { + return this._retrievalHost; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class CdnDomainV1SourcesList extends cdktf.ComplexList { + public internalValue? : CdnDomainV1Sources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainV1SourcesOutputReference { + return new CdnDomainV1SourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#create CdnDomainV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#delete CdnDomainV1#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#update CdnDomainV1#update} + */ + readonly update?: string; +} + +export function cdnDomainV1TimeoutsToTerraform(struct?: CdnDomainV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cdnDomainV1TimeoutsToHclTerraform(struct?: CdnDomainV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CdnDomainV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1 huaweicloud_cdn_domain_v1} +*/ +export class CdnDomainV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_domain_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdnDomainV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdnDomainV1 to import + * @param importFromId The id of the existing CdnDomainV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdnDomainV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_domain_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain_v1 huaweicloud_cdn_domain_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdnDomainV1Config + */ + public constructor(scope: Construct, id: string, config: CdnDomainV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_domain_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._serviceArea = config.serviceArea; + this._tags = config.tags; + this._type = config.type; + this._cacheSettings.internalValue = config.cacheSettings; + this._configs.internalValue = config.configs; + this._sources.internalValue = config.sources; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cname - computed: true, optional: false, required: false + public get cname() { + return this.getStringAttribute('cname'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // domain_status - computed: true, optional: false, required: false + public get domainStatus() { + return this.getStringAttribute('domain_status'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // service_area - computed: true, optional: true, required: false + private _serviceArea?: string; + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + public set serviceArea(value: string) { + this._serviceArea = value; + } + public resetServiceArea() { + this._serviceArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceAreaInput() { + return this._serviceArea; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // cache_settings - computed: false, optional: true, required: false + private _cacheSettings = new CdnDomainV1CacheSettingsOutputReference(this, "cache_settings"); + public get cacheSettings() { + return this._cacheSettings; + } + public putCacheSettings(value: CdnDomainV1CacheSettings) { + this._cacheSettings.internalValue = value; + } + public resetCacheSettings() { + this._cacheSettings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheSettingsInput() { + return this._cacheSettings.internalValue; + } + + // configs - computed: false, optional: true, required: false + private _configs = new CdnDomainV1ConfigsOutputReference(this, "configs"); + public get configs() { + return this._configs; + } + public putConfigs(value: CdnDomainV1Configs) { + this._configs.internalValue = value; + } + public resetConfigs() { + this._configs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } + + // sources - computed: false, optional: false, required: true + private _sources = new CdnDomainV1SourcesList(this, "sources", true); + public get sources() { + return this._sources; + } + public putSources(value: CdnDomainV1Sources[] | cdktf.IResolvable) { + this._sources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourcesInput() { + return this._sources.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CdnDomainV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CdnDomainV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + service_area: cdktf.stringToTerraform(this._serviceArea), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + cache_settings: cdnDomainV1CacheSettingsToTerraform(this._cacheSettings.internalValue), + configs: cdnDomainV1ConfigsToTerraform(this._configs.internalValue), + sources: cdktf.listMapper(cdnDomainV1SourcesToTerraform, true)(this._sources.internalValue), + timeouts: cdnDomainV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_area: { + value: cdktf.stringToHclTerraform(this._serviceArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cache_settings: { + value: cdnDomainV1CacheSettingsToHclTerraform(this._cacheSettings.internalValue), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1CacheSettingsList", + }, + configs: { + value: cdnDomainV1ConfigsToHclTerraform(this._configs.internalValue), + isBlock: true, + type: "list", + storageClassType: "CdnDomainV1ConfigsList", + }, + sources: { + value: cdktf.listMapperHcl(cdnDomainV1SourcesToHclTerraform, true)(this._sources.internalValue), + isBlock: true, + type: "set", + storageClassType: "CdnDomainV1SourcesList", + }, + timeouts: { + value: cdnDomainV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CdnDomainV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cdn-domain/README.md b/src/constructs/providers/huaweicloud/cdn-domain/README.md new file mode 100644 index 00000000..e1dc00cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-domain/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cdn_domain` + +Refer to the Terraform Registry for docs: [`huaweicloud_cdn_domain`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain). diff --git a/src/constructs/providers/huaweicloud/cdn-domain/index.ts b/src/constructs/providers/huaweicloud/cdn-domain/index.ts new file mode 100644 index 00000000..4d3a5c1c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cdn-domain/index.ts @@ -0,0 +1,7618 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CdnDomainConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enable_force_new CdnDomain#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enterprise_project_id CdnDomain#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#id CdnDomain#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#name CdnDomain#name} + */ + readonly name: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#service_area CdnDomain#service_area} + */ + readonly serviceArea?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#tags CdnDomain#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; + /** + * cache_settings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#cache_settings CdnDomain#cache_settings} + */ + readonly cacheSettings?: CdnDomainCacheSettings; + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#configs CdnDomain#configs} + */ + readonly configs?: CdnDomainConfigs; + /** + * sources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#sources CdnDomain#sources} + */ + readonly sources: CdnDomainSources[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#timeouts CdnDomain#timeouts} + */ + readonly timeouts?: CdnDomainTimeouts; +} +export interface CdnDomainCacheSettingsRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#content CdnDomain#content} + */ + readonly content?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#priority CdnDomain#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#rule_type CdnDomain#rule_type} + */ + readonly ruleType: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ttl CdnDomain#ttl} + */ + readonly ttl?: number; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ttl_type CdnDomain#ttl_type} + */ + readonly ttlType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#url_parameter_type CdnDomain#url_parameter_type} + */ + readonly urlParameterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#url_parameter_value CdnDomain#url_parameter_value} + */ + readonly urlParameterValue?: string; +} + +export function cdnDomainCacheSettingsRulesToTerraform(struct?: CdnDomainCacheSettingsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + priority: cdktf.numberToTerraform(struct!.priority), + rule_type: cdktf.stringToTerraform(struct!.ruleType), + ttl: cdktf.numberToTerraform(struct!.ttl), + ttl_type: cdktf.stringToTerraform(struct!.ttlType), + url_parameter_type: cdktf.stringToTerraform(struct!.urlParameterType), + url_parameter_value: cdktf.stringToTerraform(struct!.urlParameterValue), + } +} + + +export function cdnDomainCacheSettingsRulesToHclTerraform(struct?: CdnDomainCacheSettingsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rule_type: { + value: cdktf.stringToHclTerraform(struct!.ruleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ttl: { + value: cdktf.numberToHclTerraform(struct!.ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ttl_type: { + value: cdktf.stringToHclTerraform(struct!.ttlType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_parameter_type: { + value: cdktf.stringToHclTerraform(struct!.urlParameterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_parameter_value: { + value: cdktf.stringToHclTerraform(struct!.urlParameterValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainCacheSettingsRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainCacheSettingsRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._ruleType !== undefined) { + hasAnyValues = true; + internalValueResult.ruleType = this._ruleType; + } + if (this._ttl !== undefined) { + hasAnyValues = true; + internalValueResult.ttl = this._ttl; + } + if (this._ttlType !== undefined) { + hasAnyValues = true; + internalValueResult.ttlType = this._ttlType; + } + if (this._urlParameterType !== undefined) { + hasAnyValues = true; + internalValueResult.urlParameterType = this._urlParameterType; + } + if (this._urlParameterValue !== undefined) { + hasAnyValues = true; + internalValueResult.urlParameterValue = this._urlParameterValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainCacheSettingsRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._priority = undefined; + this._ruleType = undefined; + this._ttl = undefined; + this._ttlType = undefined; + this._urlParameterType = undefined; + this._urlParameterValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._priority = value.priority; + this._ruleType = value.ruleType; + this._ttl = value.ttl; + this._ttlType = value.ttlType; + this._urlParameterType = value.urlParameterType; + this._urlParameterValue = value.urlParameterValue; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // rule_type - computed: false, optional: false, required: true + private _ruleType?: string; + public get ruleType() { + return this.getStringAttribute('rule_type'); + } + public set ruleType(value: string) { + this._ruleType = value; + } + // Temporarily expose input value. Use with caution. + public get ruleTypeInput() { + return this._ruleType; + } + + // ttl - computed: true, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // ttl_type - computed: true, optional: true, required: false + private _ttlType?: string; + public get ttlType() { + return this.getStringAttribute('ttl_type'); + } + public set ttlType(value: string) { + this._ttlType = value; + } + public resetTtlType() { + this._ttlType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlTypeInput() { + return this._ttlType; + } + + // url_parameter_type - computed: false, optional: true, required: false + private _urlParameterType?: string; + public get urlParameterType() { + return this.getStringAttribute('url_parameter_type'); + } + public set urlParameterType(value: string) { + this._urlParameterType = value; + } + public resetUrlParameterType() { + this._urlParameterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlParameterTypeInput() { + return this._urlParameterType; + } + + // url_parameter_value - computed: false, optional: true, required: false + private _urlParameterValue?: string; + public get urlParameterValue() { + return this.getStringAttribute('url_parameter_value'); + } + public set urlParameterValue(value: string) { + this._urlParameterValue = value; + } + public resetUrlParameterValue() { + this._urlParameterValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlParameterValueInput() { + return this._urlParameterValue; + } +} + +export class CdnDomainCacheSettingsRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainCacheSettingsRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainCacheSettingsRulesOutputReference { + return new CdnDomainCacheSettingsRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainCacheSettings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#follow_origin CdnDomain#follow_origin} + */ + readonly followOrigin?: boolean | cdktf.IResolvable; + /** + * rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#rules CdnDomain#rules} + */ + readonly rules?: CdnDomainCacheSettingsRules[] | cdktf.IResolvable; +} + +export function cdnDomainCacheSettingsToTerraform(struct?: CdnDomainCacheSettingsOutputReference | CdnDomainCacheSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + follow_origin: cdktf.booleanToTerraform(struct!.followOrigin), + rules: cdktf.listMapper(cdnDomainCacheSettingsRulesToTerraform, true)(struct!.rules), + } +} + + +export function cdnDomainCacheSettingsToHclTerraform(struct?: CdnDomainCacheSettingsOutputReference | CdnDomainCacheSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + follow_origin: { + value: cdktf.booleanToHclTerraform(struct!.followOrigin), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + rules: { + value: cdktf.listMapperHcl(cdnDomainCacheSettingsRulesToHclTerraform, true)(struct!.rules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainCacheSettingsRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainCacheSettingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainCacheSettings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._followOrigin !== undefined) { + hasAnyValues = true; + internalValueResult.followOrigin = this._followOrigin; + } + if (this._rules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.rules = this._rules?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainCacheSettings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._followOrigin = undefined; + this._rules.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._followOrigin = value.followOrigin; + this._rules.internalValue = value.rules; + } + } + + // follow_origin - computed: false, optional: true, required: false + private _followOrigin?: boolean | cdktf.IResolvable; + public get followOrigin() { + return this.getBooleanAttribute('follow_origin'); + } + public set followOrigin(value: boolean | cdktf.IResolvable) { + this._followOrigin = value; + } + public resetFollowOrigin() { + this._followOrigin = undefined; + } + // Temporarily expose input value. Use with caution. + public get followOriginInput() { + return this._followOrigin; + } + + // rules - computed: false, optional: true, required: false + private _rules = new CdnDomainCacheSettingsRulesList(this, "rules", true); + public get rules() { + return this._rules; + } + public putRules(value: CdnDomainCacheSettingsRules[] | cdktf.IResolvable) { + this._rules.internalValue = value; + } + public resetRules() { + this._rules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get rulesInput() { + return this._rules.internalValue; + } +} +export interface CdnDomainConfigsAccessAreaFilter { + /** + * Specifies the areas, separated by commas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#area CdnDomain#area} + */ + readonly area: string; + /** + * Specifies the content type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#content_type CdnDomain#content_type} + */ + readonly contentType: string; + /** + * Specifies the content value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#content_value CdnDomain#content_value} + */ + readonly contentValue?: string; + /** + * Specifies the IP addresses exception in access control, separated by commas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#exception_ip CdnDomain#exception_ip} + */ + readonly exceptionIp?: string; + /** + * Specifies the blacklist and whitelist rule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; +} + +export function cdnDomainConfigsAccessAreaFilterToTerraform(struct?: CdnDomainConfigsAccessAreaFilter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + area: cdktf.stringToTerraform(struct!.area), + content_type: cdktf.stringToTerraform(struct!.contentType), + content_value: cdktf.stringToTerraform(struct!.contentValue), + exception_ip: cdktf.stringToTerraform(struct!.exceptionIp), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainConfigsAccessAreaFilterToHclTerraform(struct?: CdnDomainConfigsAccessAreaFilter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + area: { + value: cdktf.stringToHclTerraform(struct!.area), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content_type: { + value: cdktf.stringToHclTerraform(struct!.contentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content_value: { + value: cdktf.stringToHclTerraform(struct!.contentValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exception_ip: { + value: cdktf.stringToHclTerraform(struct!.exceptionIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsAccessAreaFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsAccessAreaFilter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._area !== undefined) { + hasAnyValues = true; + internalValueResult.area = this._area; + } + if (this._contentType !== undefined) { + hasAnyValues = true; + internalValueResult.contentType = this._contentType; + } + if (this._contentValue !== undefined) { + hasAnyValues = true; + internalValueResult.contentValue = this._contentValue; + } + if (this._exceptionIp !== undefined) { + hasAnyValues = true; + internalValueResult.exceptionIp = this._exceptionIp; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsAccessAreaFilter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._area = undefined; + this._contentType = undefined; + this._contentValue = undefined; + this._exceptionIp = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._area = value.area; + this._contentType = value.contentType; + this._contentValue = value.contentValue; + this._exceptionIp = value.exceptionIp; + this._type = value.type; + } + } + + // area - computed: false, optional: false, required: true + private _area?: string; + public get area() { + return this.getStringAttribute('area'); + } + public set area(value: string) { + this._area = value; + } + // Temporarily expose input value. Use with caution. + public get areaInput() { + return this._area; + } + + // content_type - computed: false, optional: false, required: true + private _contentType?: string; + public get contentType() { + return this.getStringAttribute('content_type'); + } + public set contentType(value: string) { + this._contentType = value; + } + // Temporarily expose input value. Use with caution. + public get contentTypeInput() { + return this._contentType; + } + + // content_value - computed: true, optional: true, required: false + private _contentValue?: string; + public get contentValue() { + return this.getStringAttribute('content_value'); + } + public set contentValue(value: string) { + this._contentValue = value; + } + public resetContentValue() { + this._contentValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentValueInput() { + return this._contentValue; + } + + // exception_ip - computed: true, optional: true, required: false + private _exceptionIp?: string; + public get exceptionIp() { + return this.getStringAttribute('exception_ip'); + } + public set exceptionIp(value: string) { + this._exceptionIp = value; + } + public resetExceptionIp() { + this._exceptionIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get exceptionIpInput() { + return this._exceptionIp; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CdnDomainConfigsAccessAreaFilterList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsAccessAreaFilter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsAccessAreaFilterOutputReference { + return new CdnDomainConfigsAccessAreaFilterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsCacheUrlParameterFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value?: string; +} + +export function cdnDomainConfigsCacheUrlParameterFilterToTerraform(struct?: CdnDomainConfigsCacheUrlParameterFilterOutputReference | CdnDomainConfigsCacheUrlParameterFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsCacheUrlParameterFilterToHclTerraform(struct?: CdnDomainConfigsCacheUrlParameterFilterOutputReference | CdnDomainConfigsCacheUrlParameterFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsCacheUrlParameterFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsCacheUrlParameterFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsCacheUrlParameterFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._value = value.value; + } + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface CdnDomainConfigsCompress { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#file_type CdnDomain#file_type} + */ + readonly fileType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type?: string; +} + +export function cdnDomainConfigsCompressToTerraform(struct?: CdnDomainConfigsCompressOutputReference | CdnDomainConfigsCompress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + file_type: cdktf.stringToTerraform(struct!.fileType), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainConfigsCompressToHclTerraform(struct?: CdnDomainConfigsCompressOutputReference | CdnDomainConfigsCompress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + file_type: { + value: cdktf.stringToHclTerraform(struct!.fileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsCompressOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsCompress | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._fileType !== undefined) { + hasAnyValues = true; + internalValueResult.fileType = this._fileType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsCompress | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._fileType = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._fileType = value.fileType; + this._type = value.type; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // file_type - computed: true, optional: true, required: false + private _fileType?: string; + public get fileType() { + return this.getStringAttribute('file_type'); + } + public set fileType(value: string) { + this._fileType = value; + } + public resetFileType() { + this._fileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileTypeInput() { + return this._fileType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CdnDomainConfigsErrorCodeCache { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#code CdnDomain#code} + */ + readonly code: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ttl CdnDomain#ttl} + */ + readonly ttl: number; +} + +export function cdnDomainConfigsErrorCodeCacheToTerraform(struct?: CdnDomainConfigsErrorCodeCache | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + code: cdktf.numberToTerraform(struct!.code), + ttl: cdktf.numberToTerraform(struct!.ttl), + } +} + + +export function cdnDomainConfigsErrorCodeCacheToHclTerraform(struct?: CdnDomainConfigsErrorCodeCache | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + code: { + value: cdktf.numberToHclTerraform(struct!.code), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ttl: { + value: cdktf.numberToHclTerraform(struct!.ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsErrorCodeCacheOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsErrorCodeCache | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._code !== undefined) { + hasAnyValues = true; + internalValueResult.code = this._code; + } + if (this._ttl !== undefined) { + hasAnyValues = true; + internalValueResult.ttl = this._ttl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsErrorCodeCache | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._code = undefined; + this._ttl = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._code = value.code; + this._ttl = value.ttl; + } + } + + // code - computed: false, optional: false, required: true + private _code?: number; + public get code() { + return this.getNumberAttribute('code'); + } + public set code(value: number) { + this._code = value; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // ttl - computed: false, optional: false, required: true + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } +} + +export class CdnDomainConfigsErrorCodeCacheList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsErrorCodeCache[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsErrorCodeCacheOutputReference { + return new CdnDomainConfigsErrorCodeCacheOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsErrorCodeRedirectRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#error_code CdnDomain#error_code} + */ + readonly errorCode: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#target_code CdnDomain#target_code} + */ + readonly targetCode: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#target_link CdnDomain#target_link} + */ + readonly targetLink: string; +} + +export function cdnDomainConfigsErrorCodeRedirectRulesToTerraform(struct?: CdnDomainConfigsErrorCodeRedirectRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + error_code: cdktf.numberToTerraform(struct!.errorCode), + target_code: cdktf.numberToTerraform(struct!.targetCode), + target_link: cdktf.stringToTerraform(struct!.targetLink), + } +} + + +export function cdnDomainConfigsErrorCodeRedirectRulesToHclTerraform(struct?: CdnDomainConfigsErrorCodeRedirectRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + error_code: { + value: cdktf.numberToHclTerraform(struct!.errorCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + target_code: { + value: cdktf.numberToHclTerraform(struct!.targetCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + target_link: { + value: cdktf.stringToHclTerraform(struct!.targetLink), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsErrorCodeRedirectRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsErrorCodeRedirectRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._errorCode !== undefined) { + hasAnyValues = true; + internalValueResult.errorCode = this._errorCode; + } + if (this._targetCode !== undefined) { + hasAnyValues = true; + internalValueResult.targetCode = this._targetCode; + } + if (this._targetLink !== undefined) { + hasAnyValues = true; + internalValueResult.targetLink = this._targetLink; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsErrorCodeRedirectRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._errorCode = undefined; + this._targetCode = undefined; + this._targetLink = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._errorCode = value.errorCode; + this._targetCode = value.targetCode; + this._targetLink = value.targetLink; + } + } + + // error_code - computed: false, optional: false, required: true + private _errorCode?: number; + public get errorCode() { + return this.getNumberAttribute('error_code'); + } + public set errorCode(value: number) { + this._errorCode = value; + } + // Temporarily expose input value. Use with caution. + public get errorCodeInput() { + return this._errorCode; + } + + // target_code - computed: false, optional: false, required: true + private _targetCode?: number; + public get targetCode() { + return this.getNumberAttribute('target_code'); + } + public set targetCode(value: number) { + this._targetCode = value; + } + // Temporarily expose input value. Use with caution. + public get targetCodeInput() { + return this._targetCode; + } + + // target_link - computed: false, optional: false, required: true + private _targetLink?: string; + public get targetLink() { + return this.getStringAttribute('target_link'); + } + public set targetLink(value: string) { + this._targetLink = value; + } + // Temporarily expose input value. Use with caution. + public get targetLinkInput() { + return this._targetLink; + } +} + +export class CdnDomainConfigsErrorCodeRedirectRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsErrorCodeRedirectRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsErrorCodeRedirectRulesOutputReference { + return new CdnDomainConfigsErrorCodeRedirectRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsFlexibleOriginBackSources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#http_port CdnDomain#http_port} + */ + readonly httpPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#https_port CdnDomain#https_port} + */ + readonly httpsPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ip_or_domain CdnDomain#ip_or_domain} + */ + readonly ipOrDomain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#obs_bucket_type CdnDomain#obs_bucket_type} + */ + readonly obsBucketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#sources_type CdnDomain#sources_type} + */ + readonly sourcesType: string; +} + +export function cdnDomainConfigsFlexibleOriginBackSourcesToTerraform(struct?: CdnDomainConfigsFlexibleOriginBackSourcesOutputReference | CdnDomainConfigsFlexibleOriginBackSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + http_port: cdktf.numberToTerraform(struct!.httpPort), + https_port: cdktf.numberToTerraform(struct!.httpsPort), + ip_or_domain: cdktf.stringToTerraform(struct!.ipOrDomain), + obs_bucket_type: cdktf.stringToTerraform(struct!.obsBucketType), + sources_type: cdktf.stringToTerraform(struct!.sourcesType), + } +} + + +export function cdnDomainConfigsFlexibleOriginBackSourcesToHclTerraform(struct?: CdnDomainConfigsFlexibleOriginBackSourcesOutputReference | CdnDomainConfigsFlexibleOriginBackSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + http_port: { + value: cdktf.numberToHclTerraform(struct!.httpPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + https_port: { + value: cdktf.numberToHclTerraform(struct!.httpsPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ip_or_domain: { + value: cdktf.stringToHclTerraform(struct!.ipOrDomain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket_type: { + value: cdktf.stringToHclTerraform(struct!.obsBucketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sources_type: { + value: cdktf.stringToHclTerraform(struct!.sourcesType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsFlexibleOriginBackSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsFlexibleOriginBackSources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._httpPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpPort = this._httpPort; + } + if (this._httpsPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpsPort = this._httpsPort; + } + if (this._ipOrDomain !== undefined) { + hasAnyValues = true; + internalValueResult.ipOrDomain = this._ipOrDomain; + } + if (this._obsBucketType !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketType = this._obsBucketType; + } + if (this._sourcesType !== undefined) { + hasAnyValues = true; + internalValueResult.sourcesType = this._sourcesType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsFlexibleOriginBackSources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._httpPort = undefined; + this._httpsPort = undefined; + this._ipOrDomain = undefined; + this._obsBucketType = undefined; + this._sourcesType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._httpPort = value.httpPort; + this._httpsPort = value.httpsPort; + this._ipOrDomain = value.ipOrDomain; + this._obsBucketType = value.obsBucketType; + this._sourcesType = value.sourcesType; + } + } + + // http_port - computed: true, optional: true, required: false + private _httpPort?: number; + public get httpPort() { + return this.getNumberAttribute('http_port'); + } + public set httpPort(value: number) { + this._httpPort = value; + } + public resetHttpPort() { + this._httpPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpPortInput() { + return this._httpPort; + } + + // https_port - computed: true, optional: true, required: false + private _httpsPort?: number; + public get httpsPort() { + return this.getNumberAttribute('https_port'); + } + public set httpsPort(value: number) { + this._httpsPort = value; + } + public resetHttpsPort() { + this._httpsPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsPortInput() { + return this._httpsPort; + } + + // ip_or_domain - computed: false, optional: false, required: true + private _ipOrDomain?: string; + public get ipOrDomain() { + return this.getStringAttribute('ip_or_domain'); + } + public set ipOrDomain(value: string) { + this._ipOrDomain = value; + } + // Temporarily expose input value. Use with caution. + public get ipOrDomainInput() { + return this._ipOrDomain; + } + + // obs_bucket_type - computed: true, optional: true, required: false + private _obsBucketType?: string; + public get obsBucketType() { + return this.getStringAttribute('obs_bucket_type'); + } + public set obsBucketType(value: string) { + this._obsBucketType = value; + } + public resetObsBucketType() { + this._obsBucketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketTypeInput() { + return this._obsBucketType; + } + + // sources_type - computed: false, optional: false, required: true + private _sourcesType?: string; + public get sourcesType() { + return this.getStringAttribute('sources_type'); + } + public set sourcesType(value: string) { + this._sourcesType = value; + } + // Temporarily expose input value. Use with caution. + public get sourcesTypeInput() { + return this._sourcesType; + } +} +export interface CdnDomainConfigsFlexibleOrigin { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#match_pattern CdnDomain#match_pattern} + */ + readonly matchPattern?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#match_type CdnDomain#match_type} + */ + readonly matchType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#priority CdnDomain#priority} + */ + readonly priority: number; + /** + * back_sources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#back_sources CdnDomain#back_sources} + */ + readonly backSources: CdnDomainConfigsFlexibleOriginBackSources; +} + +export function cdnDomainConfigsFlexibleOriginToTerraform(struct?: CdnDomainConfigsFlexibleOrigin | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_pattern: cdktf.stringToTerraform(struct!.matchPattern), + match_type: cdktf.stringToTerraform(struct!.matchType), + priority: cdktf.numberToTerraform(struct!.priority), + back_sources: cdnDomainConfigsFlexibleOriginBackSourcesToTerraform(struct!.backSources), + } +} + + +export function cdnDomainConfigsFlexibleOriginToHclTerraform(struct?: CdnDomainConfigsFlexibleOrigin | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_pattern: { + value: cdktf.stringToHclTerraform(struct!.matchPattern), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + back_sources: { + value: cdnDomainConfigsFlexibleOriginBackSourcesToHclTerraform(struct!.backSources), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsFlexibleOriginBackSourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsFlexibleOriginOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsFlexibleOrigin | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchPattern !== undefined) { + hasAnyValues = true; + internalValueResult.matchPattern = this._matchPattern; + } + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._backSources?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backSources = this._backSources?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsFlexibleOrigin | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchPattern = undefined; + this._matchType = undefined; + this._priority = undefined; + this._backSources.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchPattern = value.matchPattern; + this._matchType = value.matchType; + this._priority = value.priority; + this._backSources.internalValue = value.backSources; + } + } + + // match_pattern - computed: true, optional: true, required: false + private _matchPattern?: string; + public get matchPattern() { + return this.getStringAttribute('match_pattern'); + } + public set matchPattern(value: string) { + this._matchPattern = value; + } + public resetMatchPattern() { + this._matchPattern = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchPatternInput() { + return this._matchPattern; + } + + // match_type - computed: false, optional: false, required: true + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // back_sources - computed: false, optional: false, required: true + private _backSources = new CdnDomainConfigsFlexibleOriginBackSourcesOutputReference(this, "back_sources"); + public get backSources() { + return this._backSources; + } + public putBackSources(value: CdnDomainConfigsFlexibleOriginBackSources) { + this._backSources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get backSourcesInput() { + return this._backSources.internalValue; + } +} + +export class CdnDomainConfigsFlexibleOriginList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsFlexibleOrigin[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsFlexibleOriginOutputReference { + return new CdnDomainConfigsFlexibleOriginOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsForceRedirect { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#redirect_code CdnDomain#redirect_code} + */ + readonly redirectCode?: number; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type?: string; +} + +export function cdnDomainConfigsForceRedirectToTerraform(struct?: CdnDomainConfigsForceRedirectOutputReference | CdnDomainConfigsForceRedirect): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + redirect_code: cdktf.numberToTerraform(struct!.redirectCode), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainConfigsForceRedirectToHclTerraform(struct?: CdnDomainConfigsForceRedirectOutputReference | CdnDomainConfigsForceRedirect): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + redirect_code: { + value: cdktf.numberToHclTerraform(struct!.redirectCode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsForceRedirectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsForceRedirect | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._redirectCode !== undefined) { + hasAnyValues = true; + internalValueResult.redirectCode = this._redirectCode; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsForceRedirect | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._redirectCode = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._redirectCode = value.redirectCode; + this._type = value.type; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // redirect_code - computed: true, optional: true, required: false + private _redirectCode?: number; + public get redirectCode() { + return this.getNumberAttribute('redirect_code'); + } + public set redirectCode(value: number) { + this._redirectCode = value; + } + public resetRedirectCode() { + this._redirectCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectCodeInput() { + return this._redirectCode; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface CdnDomainConfigsHsts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#include_subdomains CdnDomain#include_subdomains} + */ + readonly includeSubdomains?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#max_age CdnDomain#max_age} + */ + readonly maxAge?: number; +} + +export function cdnDomainConfigsHstsToTerraform(struct?: CdnDomainConfigsHstsOutputReference | CdnDomainConfigsHsts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + include_subdomains: cdktf.stringToTerraform(struct!.includeSubdomains), + max_age: cdktf.numberToTerraform(struct!.maxAge), + } +} + + +export function cdnDomainConfigsHstsToHclTerraform(struct?: CdnDomainConfigsHstsOutputReference | CdnDomainConfigsHsts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + include_subdomains: { + value: cdktf.stringToHclTerraform(struct!.includeSubdomains), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_age: { + value: cdktf.numberToHclTerraform(struct!.maxAge), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsHstsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsHsts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._includeSubdomains !== undefined) { + hasAnyValues = true; + internalValueResult.includeSubdomains = this._includeSubdomains; + } + if (this._maxAge !== undefined) { + hasAnyValues = true; + internalValueResult.maxAge = this._maxAge; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsHsts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._includeSubdomains = undefined; + this._maxAge = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._includeSubdomains = value.includeSubdomains; + this._maxAge = value.maxAge; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // include_subdomains - computed: true, optional: true, required: false + private _includeSubdomains?: string; + public get includeSubdomains() { + return this.getStringAttribute('include_subdomains'); + } + public set includeSubdomains(value: string) { + this._includeSubdomains = value; + } + public resetIncludeSubdomains() { + this._includeSubdomains = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeSubdomainsInput() { + return this._includeSubdomains; + } + + // max_age - computed: true, optional: true, required: false + private _maxAge?: number; + public get maxAge() { + return this.getNumberAttribute('max_age'); + } + public set maxAge(value: number) { + this._maxAge = value; + } + public resetMaxAge() { + this._maxAge = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxAgeInput() { + return this._maxAge; + } +} +export interface CdnDomainConfigsHttpResponseHeader { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#action CdnDomain#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#name CdnDomain#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value?: string; +} + +export function cdnDomainConfigsHttpResponseHeaderToTerraform(struct?: CdnDomainConfigsHttpResponseHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsHttpResponseHeaderToHclTerraform(struct?: CdnDomainConfigsHttpResponseHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsHttpResponseHeaderOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsHttpResponseHeader | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsHttpResponseHeader | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._name = value.name; + this._value = value.value; + } + } + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainConfigsHttpResponseHeaderList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsHttpResponseHeader[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsHttpResponseHeaderOutputReference { + return new CdnDomainConfigsHttpResponseHeaderOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsHttpsSettings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#certificate_body CdnDomain#certificate_body} + */ + readonly certificateBody?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#certificate_name CdnDomain#certificate_name} + */ + readonly certificateName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#certificate_source CdnDomain#certificate_source} + */ + readonly certificateSource?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#certificate_type CdnDomain#certificate_type} + */ + readonly certificateType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#http2_enabled CdnDomain#http2_enabled} + */ + readonly http2Enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#https_enabled CdnDomain#https_enabled} + */ + readonly httpsEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ocsp_stapling_status CdnDomain#ocsp_stapling_status} + */ + readonly ocspStaplingStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#private_key CdnDomain#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#scm_certificate_id CdnDomain#scm_certificate_id} + */ + readonly scmCertificateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#tls_version CdnDomain#tls_version} + */ + readonly tlsVersion?: string; +} + +export function cdnDomainConfigsHttpsSettingsToTerraform(struct?: CdnDomainConfigsHttpsSettingsOutputReference | CdnDomainConfigsHttpsSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + certificate_body: cdktf.stringToTerraform(struct!.certificateBody), + certificate_name: cdktf.stringToTerraform(struct!.certificateName), + certificate_source: cdktf.numberToTerraform(struct!.certificateSource), + certificate_type: cdktf.stringToTerraform(struct!.certificateType), + http2_enabled: cdktf.booleanToTerraform(struct!.http2Enabled), + https_enabled: cdktf.booleanToTerraform(struct!.httpsEnabled), + ocsp_stapling_status: cdktf.stringToTerraform(struct!.ocspStaplingStatus), + private_key: cdktf.stringToTerraform(struct!.privateKey), + scm_certificate_id: cdktf.stringToTerraform(struct!.scmCertificateId), + tls_version: cdktf.stringToTerraform(struct!.tlsVersion), + } +} + + +export function cdnDomainConfigsHttpsSettingsToHclTerraform(struct?: CdnDomainConfigsHttpsSettingsOutputReference | CdnDomainConfigsHttpsSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + certificate_body: { + value: cdktf.stringToHclTerraform(struct!.certificateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_name: { + value: cdktf.stringToHclTerraform(struct!.certificateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_source: { + value: cdktf.numberToHclTerraform(struct!.certificateSource), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + certificate_type: { + value: cdktf.stringToHclTerraform(struct!.certificateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http2_enabled: { + value: cdktf.booleanToHclTerraform(struct!.http2Enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + https_enabled: { + value: cdktf.booleanToHclTerraform(struct!.httpsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ocsp_stapling_status: { + value: cdktf.stringToHclTerraform(struct!.ocspStaplingStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(struct!.privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scm_certificate_id: { + value: cdktf.stringToHclTerraform(struct!.scmCertificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tls_version: { + value: cdktf.stringToHclTerraform(struct!.tlsVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsHttpsSettingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsHttpsSettings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._certificateBody !== undefined) { + hasAnyValues = true; + internalValueResult.certificateBody = this._certificateBody; + } + if (this._certificateName !== undefined) { + hasAnyValues = true; + internalValueResult.certificateName = this._certificateName; + } + if (this._certificateSource !== undefined) { + hasAnyValues = true; + internalValueResult.certificateSource = this._certificateSource; + } + if (this._certificateType !== undefined) { + hasAnyValues = true; + internalValueResult.certificateType = this._certificateType; + } + if (this._http2Enabled !== undefined) { + hasAnyValues = true; + internalValueResult.http2Enabled = this._http2Enabled; + } + if (this._httpsEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.httpsEnabled = this._httpsEnabled; + } + if (this._ocspStaplingStatus !== undefined) { + hasAnyValues = true; + internalValueResult.ocspStaplingStatus = this._ocspStaplingStatus; + } + if (this._privateKey !== undefined) { + hasAnyValues = true; + internalValueResult.privateKey = this._privateKey; + } + if (this._scmCertificateId !== undefined) { + hasAnyValues = true; + internalValueResult.scmCertificateId = this._scmCertificateId; + } + if (this._tlsVersion !== undefined) { + hasAnyValues = true; + internalValueResult.tlsVersion = this._tlsVersion; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsHttpsSettings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._certificateBody = undefined; + this._certificateName = undefined; + this._certificateSource = undefined; + this._certificateType = undefined; + this._http2Enabled = undefined; + this._httpsEnabled = undefined; + this._ocspStaplingStatus = undefined; + this._privateKey = undefined; + this._scmCertificateId = undefined; + this._tlsVersion = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._certificateBody = value.certificateBody; + this._certificateName = value.certificateName; + this._certificateSource = value.certificateSource; + this._certificateType = value.certificateType; + this._http2Enabled = value.http2Enabled; + this._httpsEnabled = value.httpsEnabled; + this._ocspStaplingStatus = value.ocspStaplingStatus; + this._privateKey = value.privateKey; + this._scmCertificateId = value.scmCertificateId; + this._tlsVersion = value.tlsVersion; + } + } + + // certificate_body - computed: true, optional: true, required: false + private _certificateBody?: string; + public get certificateBody() { + return this.getStringAttribute('certificate_body'); + } + public set certificateBody(value: string) { + this._certificateBody = value; + } + public resetCertificateBody() { + this._certificateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateBodyInput() { + return this._certificateBody; + } + + // certificate_name - computed: true, optional: true, required: false + private _certificateName?: string; + public get certificateName() { + return this.getStringAttribute('certificate_name'); + } + public set certificateName(value: string) { + this._certificateName = value; + } + public resetCertificateName() { + this._certificateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateNameInput() { + return this._certificateName; + } + + // certificate_source - computed: true, optional: true, required: false + private _certificateSource?: number; + public get certificateSource() { + return this.getNumberAttribute('certificate_source'); + } + public set certificateSource(value: number) { + this._certificateSource = value; + } + public resetCertificateSource() { + this._certificateSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateSourceInput() { + return this._certificateSource; + } + + // certificate_type - computed: true, optional: true, required: false + private _certificateType?: string; + public get certificateType() { + return this.getStringAttribute('certificate_type'); + } + public set certificateType(value: string) { + this._certificateType = value; + } + public resetCertificateType() { + this._certificateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateTypeInput() { + return this._certificateType; + } + + // http2_enabled - computed: true, optional: true, required: false + private _http2Enabled?: boolean | cdktf.IResolvable; + public get http2Enabled() { + return this.getBooleanAttribute('http2_enabled'); + } + public set http2Enabled(value: boolean | cdktf.IResolvable) { + this._http2Enabled = value; + } + public resetHttp2Enabled() { + this._http2Enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get http2EnabledInput() { + return this._http2Enabled; + } + + // http2_status - computed: true, optional: false, required: false + public get http2Status() { + return this.getStringAttribute('http2_status'); + } + + // https_enabled - computed: true, optional: true, required: false + private _httpsEnabled?: boolean | cdktf.IResolvable; + public get httpsEnabled() { + return this.getBooleanAttribute('https_enabled'); + } + public set httpsEnabled(value: boolean | cdktf.IResolvable) { + this._httpsEnabled = value; + } + public resetHttpsEnabled() { + this._httpsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsEnabledInput() { + return this._httpsEnabled; + } + + // https_status - computed: true, optional: false, required: false + public get httpsStatus() { + return this.getStringAttribute('https_status'); + } + + // ocsp_stapling_status - computed: true, optional: true, required: false + private _ocspStaplingStatus?: string; + public get ocspStaplingStatus() { + return this.getStringAttribute('ocsp_stapling_status'); + } + public set ocspStaplingStatus(value: string) { + this._ocspStaplingStatus = value; + } + public resetOcspStaplingStatus() { + this._ocspStaplingStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get ocspStaplingStatusInput() { + return this._ocspStaplingStatus; + } + + // private_key - computed: true, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // scm_certificate_id - computed: true, optional: true, required: false + private _scmCertificateId?: string; + public get scmCertificateId() { + return this.getStringAttribute('scm_certificate_id'); + } + public set scmCertificateId(value: string) { + this._scmCertificateId = value; + } + public resetScmCertificateId() { + this._scmCertificateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scmCertificateIdInput() { + return this._scmCertificateId; + } + + // tls_version - computed: true, optional: true, required: false + private _tlsVersion?: string; + public get tlsVersion() { + return this.getStringAttribute('tls_version'); + } + public set tlsVersion(value: string) { + this._tlsVersion = value; + } + public resetTlsVersion() { + this._tlsVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get tlsVersionInput() { + return this._tlsVersion; + } +} +export interface CdnDomainConfigsIpFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value?: string; +} + +export function cdnDomainConfigsIpFilterToTerraform(struct?: CdnDomainConfigsIpFilterOutputReference | CdnDomainConfigsIpFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsIpFilterToHclTerraform(struct?: CdnDomainConfigsIpFilterOutputReference | CdnDomainConfigsIpFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsIpFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsIpFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsIpFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._value = value.value; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface CdnDomainConfigsIpFrequencyLimit { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#qps CdnDomain#qps} + */ + readonly qps?: number; +} + +export function cdnDomainConfigsIpFrequencyLimitToTerraform(struct?: CdnDomainConfigsIpFrequencyLimitOutputReference | CdnDomainConfigsIpFrequencyLimit): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + qps: cdktf.numberToTerraform(struct!.qps), + } +} + + +export function cdnDomainConfigsIpFrequencyLimitToHclTerraform(struct?: CdnDomainConfigsIpFrequencyLimitOutputReference | CdnDomainConfigsIpFrequencyLimit): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + qps: { + value: cdktf.numberToHclTerraform(struct!.qps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsIpFrequencyLimitOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsIpFrequencyLimit | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._qps !== undefined) { + hasAnyValues = true; + internalValueResult.qps = this._qps; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsIpFrequencyLimit | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._qps = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._qps = value.qps; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // qps - computed: true, optional: true, required: false + private _qps?: number; + public get qps() { + return this.getNumberAttribute('qps'); + } + public set qps(value: number) { + this._qps = value; + } + public resetQps() { + this._qps = undefined; + } + // Temporarily expose input value. Use with caution. + public get qpsInput() { + return this._qps; + } +} +export interface CdnDomainConfigsOriginRequestUrlRewrite { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#match_type CdnDomain#match_type} + */ + readonly matchType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#priority CdnDomain#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#source_url CdnDomain#source_url} + */ + readonly sourceUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#target_url CdnDomain#target_url} + */ + readonly targetUrl: string; +} + +export function cdnDomainConfigsOriginRequestUrlRewriteToTerraform(struct?: CdnDomainConfigsOriginRequestUrlRewrite | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + match_type: cdktf.stringToTerraform(struct!.matchType), + priority: cdktf.numberToTerraform(struct!.priority), + source_url: cdktf.stringToTerraform(struct!.sourceUrl), + target_url: cdktf.stringToTerraform(struct!.targetUrl), + } +} + + +export function cdnDomainConfigsOriginRequestUrlRewriteToHclTerraform(struct?: CdnDomainConfigsOriginRequestUrlRewrite | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_url: { + value: cdktf.stringToHclTerraform(struct!.sourceUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_url: { + value: cdktf.stringToHclTerraform(struct!.targetUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsOriginRequestUrlRewriteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsOriginRequestUrlRewrite | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._sourceUrl !== undefined) { + hasAnyValues = true; + internalValueResult.sourceUrl = this._sourceUrl; + } + if (this._targetUrl !== undefined) { + hasAnyValues = true; + internalValueResult.targetUrl = this._targetUrl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsOriginRequestUrlRewrite | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._matchType = undefined; + this._priority = undefined; + this._sourceUrl = undefined; + this._targetUrl = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._matchType = value.matchType; + this._priority = value.priority; + this._sourceUrl = value.sourceUrl; + this._targetUrl = value.targetUrl; + } + } + + // match_type - computed: false, optional: false, required: true + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // source_url - computed: true, optional: true, required: false + private _sourceUrl?: string; + public get sourceUrl() { + return this.getStringAttribute('source_url'); + } + public set sourceUrl(value: string) { + this._sourceUrl = value; + } + public resetSourceUrl() { + this._sourceUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceUrlInput() { + return this._sourceUrl; + } + + // target_url - computed: false, optional: false, required: true + private _targetUrl?: string; + public get targetUrl() { + return this.getStringAttribute('target_url'); + } + public set targetUrl(value: string) { + this._targetUrl = value; + } + // Temporarily expose input value. Use with caution. + public get targetUrlInput() { + return this._targetUrl; + } +} + +export class CdnDomainConfigsOriginRequestUrlRewriteList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsOriginRequestUrlRewrite[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsOriginRequestUrlRewriteOutputReference { + return new CdnDomainConfigsOriginRequestUrlRewriteOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsQuic { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; +} + +export function cdnDomainConfigsQuicToTerraform(struct?: CdnDomainConfigsQuicOutputReference | CdnDomainConfigsQuic): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + } +} + + +export function cdnDomainConfigsQuicToHclTerraform(struct?: CdnDomainConfigsQuicOutputReference | CdnDomainConfigsQuic): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsQuicOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsQuic | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsQuic | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } +} +export interface CdnDomainConfigsReferer { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#include_empty CdnDomain#include_empty} + */ + readonly includeEmpty?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value?: string; +} + +export function cdnDomainConfigsRefererToTerraform(struct?: CdnDomainConfigsRefererOutputReference | CdnDomainConfigsReferer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + include_empty: cdktf.booleanToTerraform(struct!.includeEmpty), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsRefererToHclTerraform(struct?: CdnDomainConfigsRefererOutputReference | CdnDomainConfigsReferer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + include_empty: { + value: cdktf.booleanToHclTerraform(struct!.includeEmpty), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRefererOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsReferer | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._includeEmpty !== undefined) { + hasAnyValues = true; + internalValueResult.includeEmpty = this._includeEmpty; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsReferer | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._includeEmpty = undefined; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._includeEmpty = value.includeEmpty; + this._type = value.type; + this._value = value.value; + } + } + + // include_empty - computed: true, optional: true, required: false + private _includeEmpty?: boolean | cdktf.IResolvable; + public get includeEmpty() { + return this.getBooleanAttribute('include_empty'); + } + public set includeEmpty(value: boolean | cdktf.IResolvable) { + this._includeEmpty = value; + } + public resetIncludeEmpty() { + this._includeEmpty = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeEmptyInput() { + return this._includeEmpty; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#key CdnDomain#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value: string; +} + +export function cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToTerraform(struct?: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToHclTerraform(struct?: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._type = value.type; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesOutputReference { + return new CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#key CdnDomain#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value: string; +} + +export function cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToTerraform(struct?: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToHclTerraform(struct?: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._type = value.type; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesOutputReference { + return new CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsRemoteAuthRemoteAuthRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#auth_failed_status CdnDomain#auth_failed_status} + */ + readonly authFailedStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#auth_server CdnDomain#auth_server} + */ + readonly authServer: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#auth_success_status CdnDomain#auth_success_status} + */ + readonly authSuccessStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#file_type_setting CdnDomain#file_type_setting} + */ + readonly fileTypeSetting: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#request_method CdnDomain#request_method} + */ + readonly requestMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#reserve_args CdnDomain#reserve_args} + */ + readonly reserveArgs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#reserve_args_setting CdnDomain#reserve_args_setting} + */ + readonly reserveArgsSetting: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#reserve_headers CdnDomain#reserve_headers} + */ + readonly reserveHeaders?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#reserve_headers_setting CdnDomain#reserve_headers_setting} + */ + readonly reserveHeadersSetting: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#response_status CdnDomain#response_status} + */ + readonly responseStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#specified_file_type CdnDomain#specified_file_type} + */ + readonly specifiedFileType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#timeout CdnDomain#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#timeout_action CdnDomain#timeout_action} + */ + readonly timeoutAction: string; + /** + * add_custom_args_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#add_custom_args_rules CdnDomain#add_custom_args_rules} + */ + readonly addCustomArgsRules?: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules[] | cdktf.IResolvable; + /** + * add_custom_headers_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#add_custom_headers_rules CdnDomain#add_custom_headers_rules} + */ + readonly addCustomHeadersRules?: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules[] | cdktf.IResolvable; +} + +export function cdnDomainConfigsRemoteAuthRemoteAuthRulesToTerraform(struct?: CdnDomainConfigsRemoteAuthRemoteAuthRulesOutputReference | CdnDomainConfigsRemoteAuthRemoteAuthRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auth_failed_status: cdktf.stringToTerraform(struct!.authFailedStatus), + auth_server: cdktf.stringToTerraform(struct!.authServer), + auth_success_status: cdktf.stringToTerraform(struct!.authSuccessStatus), + file_type_setting: cdktf.stringToTerraform(struct!.fileTypeSetting), + request_method: cdktf.stringToTerraform(struct!.requestMethod), + reserve_args: cdktf.stringToTerraform(struct!.reserveArgs), + reserve_args_setting: cdktf.stringToTerraform(struct!.reserveArgsSetting), + reserve_headers: cdktf.stringToTerraform(struct!.reserveHeaders), + reserve_headers_setting: cdktf.stringToTerraform(struct!.reserveHeadersSetting), + response_status: cdktf.stringToTerraform(struct!.responseStatus), + specified_file_type: cdktf.stringToTerraform(struct!.specifiedFileType), + timeout: cdktf.numberToTerraform(struct!.timeout), + timeout_action: cdktf.stringToTerraform(struct!.timeoutAction), + add_custom_args_rules: cdktf.listMapper(cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToTerraform, true)(struct!.addCustomArgsRules), + add_custom_headers_rules: cdktf.listMapper(cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToTerraform, true)(struct!.addCustomHeadersRules), + } +} + + +export function cdnDomainConfigsRemoteAuthRemoteAuthRulesToHclTerraform(struct?: CdnDomainConfigsRemoteAuthRemoteAuthRulesOutputReference | CdnDomainConfigsRemoteAuthRemoteAuthRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auth_failed_status: { + value: cdktf.stringToHclTerraform(struct!.authFailedStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_server: { + value: cdktf.stringToHclTerraform(struct!.authServer), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_success_status: { + value: cdktf.stringToHclTerraform(struct!.authSuccessStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_type_setting: { + value: cdktf.stringToHclTerraform(struct!.fileTypeSetting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(struct!.requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_args: { + value: cdktf.stringToHclTerraform(struct!.reserveArgs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_args_setting: { + value: cdktf.stringToHclTerraform(struct!.reserveArgsSetting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_headers: { + value: cdktf.stringToHclTerraform(struct!.reserveHeaders), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_headers_setting: { + value: cdktf.stringToHclTerraform(struct!.reserveHeadersSetting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_status: { + value: cdktf.stringToHclTerraform(struct!.responseStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specified_file_type: { + value: cdktf.stringToHclTerraform(struct!.specifiedFileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout_action: { + value: cdktf.stringToHclTerraform(struct!.timeoutAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + add_custom_args_rules: { + value: cdktf.listMapperHcl(cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesToHclTerraform, true)(struct!.addCustomArgsRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesList", + }, + add_custom_headers_rules: { + value: cdktf.listMapperHcl(cdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesToHclTerraform, true)(struct!.addCustomHeadersRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRemoteAuthRemoteAuthRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsRemoteAuthRemoteAuthRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authFailedStatus !== undefined) { + hasAnyValues = true; + internalValueResult.authFailedStatus = this._authFailedStatus; + } + if (this._authServer !== undefined) { + hasAnyValues = true; + internalValueResult.authServer = this._authServer; + } + if (this._authSuccessStatus !== undefined) { + hasAnyValues = true; + internalValueResult.authSuccessStatus = this._authSuccessStatus; + } + if (this._fileTypeSetting !== undefined) { + hasAnyValues = true; + internalValueResult.fileTypeSetting = this._fileTypeSetting; + } + if (this._requestMethod !== undefined) { + hasAnyValues = true; + internalValueResult.requestMethod = this._requestMethod; + } + if (this._reserveArgs !== undefined) { + hasAnyValues = true; + internalValueResult.reserveArgs = this._reserveArgs; + } + if (this._reserveArgsSetting !== undefined) { + hasAnyValues = true; + internalValueResult.reserveArgsSetting = this._reserveArgsSetting; + } + if (this._reserveHeaders !== undefined) { + hasAnyValues = true; + internalValueResult.reserveHeaders = this._reserveHeaders; + } + if (this._reserveHeadersSetting !== undefined) { + hasAnyValues = true; + internalValueResult.reserveHeadersSetting = this._reserveHeadersSetting; + } + if (this._responseStatus !== undefined) { + hasAnyValues = true; + internalValueResult.responseStatus = this._responseStatus; + } + if (this._specifiedFileType !== undefined) { + hasAnyValues = true; + internalValueResult.specifiedFileType = this._specifiedFileType; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._timeoutAction !== undefined) { + hasAnyValues = true; + internalValueResult.timeoutAction = this._timeoutAction; + } + if (this._addCustomArgsRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.addCustomArgsRules = this._addCustomArgsRules?.internalValue; + } + if (this._addCustomHeadersRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.addCustomHeadersRules = this._addCustomHeadersRules?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsRemoteAuthRemoteAuthRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authFailedStatus = undefined; + this._authServer = undefined; + this._authSuccessStatus = undefined; + this._fileTypeSetting = undefined; + this._requestMethod = undefined; + this._reserveArgs = undefined; + this._reserveArgsSetting = undefined; + this._reserveHeaders = undefined; + this._reserveHeadersSetting = undefined; + this._responseStatus = undefined; + this._specifiedFileType = undefined; + this._timeout = undefined; + this._timeoutAction = undefined; + this._addCustomArgsRules.internalValue = undefined; + this._addCustomHeadersRules.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authFailedStatus = value.authFailedStatus; + this._authServer = value.authServer; + this._authSuccessStatus = value.authSuccessStatus; + this._fileTypeSetting = value.fileTypeSetting; + this._requestMethod = value.requestMethod; + this._reserveArgs = value.reserveArgs; + this._reserveArgsSetting = value.reserveArgsSetting; + this._reserveHeaders = value.reserveHeaders; + this._reserveHeadersSetting = value.reserveHeadersSetting; + this._responseStatus = value.responseStatus; + this._specifiedFileType = value.specifiedFileType; + this._timeout = value.timeout; + this._timeoutAction = value.timeoutAction; + this._addCustomArgsRules.internalValue = value.addCustomArgsRules; + this._addCustomHeadersRules.internalValue = value.addCustomHeadersRules; + } + } + + // auth_failed_status - computed: false, optional: false, required: true + private _authFailedStatus?: string; + public get authFailedStatus() { + return this.getStringAttribute('auth_failed_status'); + } + public set authFailedStatus(value: string) { + this._authFailedStatus = value; + } + // Temporarily expose input value. Use with caution. + public get authFailedStatusInput() { + return this._authFailedStatus; + } + + // auth_server - computed: false, optional: false, required: true + private _authServer?: string; + public get authServer() { + return this.getStringAttribute('auth_server'); + } + public set authServer(value: string) { + this._authServer = value; + } + // Temporarily expose input value. Use with caution. + public get authServerInput() { + return this._authServer; + } + + // auth_success_status - computed: false, optional: false, required: true + private _authSuccessStatus?: string; + public get authSuccessStatus() { + return this.getStringAttribute('auth_success_status'); + } + public set authSuccessStatus(value: string) { + this._authSuccessStatus = value; + } + // Temporarily expose input value. Use with caution. + public get authSuccessStatusInput() { + return this._authSuccessStatus; + } + + // file_type_setting - computed: false, optional: false, required: true + private _fileTypeSetting?: string; + public get fileTypeSetting() { + return this.getStringAttribute('file_type_setting'); + } + public set fileTypeSetting(value: string) { + this._fileTypeSetting = value; + } + // Temporarily expose input value. Use with caution. + public get fileTypeSettingInput() { + return this._fileTypeSetting; + } + + // request_method - computed: false, optional: false, required: true + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // reserve_args - computed: false, optional: true, required: false + private _reserveArgs?: string; + public get reserveArgs() { + return this.getStringAttribute('reserve_args'); + } + public set reserveArgs(value: string) { + this._reserveArgs = value; + } + public resetReserveArgs() { + this._reserveArgs = undefined; + } + // Temporarily expose input value. Use with caution. + public get reserveArgsInput() { + return this._reserveArgs; + } + + // reserve_args_setting - computed: false, optional: false, required: true + private _reserveArgsSetting?: string; + public get reserveArgsSetting() { + return this.getStringAttribute('reserve_args_setting'); + } + public set reserveArgsSetting(value: string) { + this._reserveArgsSetting = value; + } + // Temporarily expose input value. Use with caution. + public get reserveArgsSettingInput() { + return this._reserveArgsSetting; + } + + // reserve_headers - computed: false, optional: true, required: false + private _reserveHeaders?: string; + public get reserveHeaders() { + return this.getStringAttribute('reserve_headers'); + } + public set reserveHeaders(value: string) { + this._reserveHeaders = value; + } + public resetReserveHeaders() { + this._reserveHeaders = undefined; + } + // Temporarily expose input value. Use with caution. + public get reserveHeadersInput() { + return this._reserveHeaders; + } + + // reserve_headers_setting - computed: false, optional: false, required: true + private _reserveHeadersSetting?: string; + public get reserveHeadersSetting() { + return this.getStringAttribute('reserve_headers_setting'); + } + public set reserveHeadersSetting(value: string) { + this._reserveHeadersSetting = value; + } + // Temporarily expose input value. Use with caution. + public get reserveHeadersSettingInput() { + return this._reserveHeadersSetting; + } + + // response_status - computed: false, optional: false, required: true + private _responseStatus?: string; + public get responseStatus() { + return this.getStringAttribute('response_status'); + } + public set responseStatus(value: string) { + this._responseStatus = value; + } + // Temporarily expose input value. Use with caution. + public get responseStatusInput() { + return this._responseStatus; + } + + // specified_file_type - computed: false, optional: true, required: false + private _specifiedFileType?: string; + public get specifiedFileType() { + return this.getStringAttribute('specified_file_type'); + } + public set specifiedFileType(value: string) { + this._specifiedFileType = value; + } + public resetSpecifiedFileType() { + this._specifiedFileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get specifiedFileTypeInput() { + return this._specifiedFileType; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // timeout_action - computed: false, optional: false, required: true + private _timeoutAction?: string; + public get timeoutAction() { + return this.getStringAttribute('timeout_action'); + } + public set timeoutAction(value: string) { + this._timeoutAction = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutActionInput() { + return this._timeoutAction; + } + + // add_custom_args_rules - computed: false, optional: true, required: false + private _addCustomArgsRules = new CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRulesList(this, "add_custom_args_rules", true); + public get addCustomArgsRules() { + return this._addCustomArgsRules; + } + public putAddCustomArgsRules(value: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomArgsRules[] | cdktf.IResolvable) { + this._addCustomArgsRules.internalValue = value; + } + public resetAddCustomArgsRules() { + this._addCustomArgsRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addCustomArgsRulesInput() { + return this._addCustomArgsRules.internalValue; + } + + // add_custom_headers_rules - computed: false, optional: true, required: false + private _addCustomHeadersRules = new CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRulesList(this, "add_custom_headers_rules", true); + public get addCustomHeadersRules() { + return this._addCustomHeadersRules; + } + public putAddCustomHeadersRules(value: CdnDomainConfigsRemoteAuthRemoteAuthRulesAddCustomHeadersRules[] | cdktf.IResolvable) { + this._addCustomHeadersRules.internalValue = value; + } + public resetAddCustomHeadersRules() { + this._addCustomHeadersRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addCustomHeadersRulesInput() { + return this._addCustomHeadersRules.internalValue; + } +} +export interface CdnDomainConfigsRemoteAuth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * remote_auth_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#remote_auth_rules CdnDomain#remote_auth_rules} + */ + readonly remoteAuthRules?: CdnDomainConfigsRemoteAuthRemoteAuthRules; +} + +export function cdnDomainConfigsRemoteAuthToTerraform(struct?: CdnDomainConfigsRemoteAuthOutputReference | CdnDomainConfigsRemoteAuth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + remote_auth_rules: cdnDomainConfigsRemoteAuthRemoteAuthRulesToTerraform(struct!.remoteAuthRules), + } +} + + +export function cdnDomainConfigsRemoteAuthToHclTerraform(struct?: CdnDomainConfigsRemoteAuthOutputReference | CdnDomainConfigsRemoteAuth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + remote_auth_rules: { + value: cdnDomainConfigsRemoteAuthRemoteAuthRulesToHclTerraform(struct!.remoteAuthRules), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsRemoteAuthRemoteAuthRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRemoteAuthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsRemoteAuth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._remoteAuthRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.remoteAuthRules = this._remoteAuthRules?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsRemoteAuth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._remoteAuthRules.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._remoteAuthRules.internalValue = value.remoteAuthRules; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // remote_auth_rules - computed: false, optional: true, required: false + private _remoteAuthRules = new CdnDomainConfigsRemoteAuthRemoteAuthRulesOutputReference(this, "remote_auth_rules"); + public get remoteAuthRules() { + return this._remoteAuthRules; + } + public putRemoteAuthRules(value: CdnDomainConfigsRemoteAuthRemoteAuthRules) { + this._remoteAuthRules.internalValue = value; + } + public resetRemoteAuthRules() { + this._remoteAuthRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAuthRulesInput() { + return this._remoteAuthRules.internalValue; + } +} +export interface CdnDomainConfigsRequestLimitRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#limit_rate_after CdnDomain#limit_rate_after} + */ + readonly limitRateAfter: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#limit_rate_value CdnDomain#limit_rate_value} + */ + readonly limitRateValue: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#match_type CdnDomain#match_type} + */ + readonly matchType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#match_value CdnDomain#match_value} + */ + readonly matchValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#priority CdnDomain#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; +} + +export function cdnDomainConfigsRequestLimitRulesToTerraform(struct?: CdnDomainConfigsRequestLimitRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + limit_rate_after: cdktf.numberToTerraform(struct!.limitRateAfter), + limit_rate_value: cdktf.numberToTerraform(struct!.limitRateValue), + match_type: cdktf.stringToTerraform(struct!.matchType), + match_value: cdktf.stringToTerraform(struct!.matchValue), + priority: cdktf.numberToTerraform(struct!.priority), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cdnDomainConfigsRequestLimitRulesToHclTerraform(struct?: CdnDomainConfigsRequestLimitRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + limit_rate_after: { + value: cdktf.numberToHclTerraform(struct!.limitRateAfter), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + limit_rate_value: { + value: cdktf.numberToHclTerraform(struct!.limitRateValue), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_value: { + value: cdktf.stringToHclTerraform(struct!.matchValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRequestLimitRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsRequestLimitRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._limitRateAfter !== undefined) { + hasAnyValues = true; + internalValueResult.limitRateAfter = this._limitRateAfter; + } + if (this._limitRateValue !== undefined) { + hasAnyValues = true; + internalValueResult.limitRateValue = this._limitRateValue; + } + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._matchValue !== undefined) { + hasAnyValues = true; + internalValueResult.matchValue = this._matchValue; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsRequestLimitRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._limitRateAfter = undefined; + this._limitRateValue = undefined; + this._matchType = undefined; + this._matchValue = undefined; + this._priority = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._limitRateAfter = value.limitRateAfter; + this._limitRateValue = value.limitRateValue; + this._matchType = value.matchType; + this._matchValue = value.matchValue; + this._priority = value.priority; + this._type = value.type; + } + } + + // limit_rate_after - computed: false, optional: false, required: true + private _limitRateAfter?: number; + public get limitRateAfter() { + return this.getNumberAttribute('limit_rate_after'); + } + public set limitRateAfter(value: number) { + this._limitRateAfter = value; + } + // Temporarily expose input value. Use with caution. + public get limitRateAfterInput() { + return this._limitRateAfter; + } + + // limit_rate_value - computed: false, optional: false, required: true + private _limitRateValue?: number; + public get limitRateValue() { + return this.getNumberAttribute('limit_rate_value'); + } + public set limitRateValue(value: number) { + this._limitRateValue = value; + } + // Temporarily expose input value. Use with caution. + public get limitRateValueInput() { + return this._limitRateValue; + } + + // match_type - computed: false, optional: false, required: true + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // match_value - computed: false, optional: true, required: false + private _matchValue?: string; + public get matchValue() { + return this.getStringAttribute('match_value'); + } + public set matchValue(value: string) { + this._matchValue = value; + } + public resetMatchValue() { + this._matchValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchValueInput() { + return this._matchValue; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CdnDomainConfigsRequestLimitRulesList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsRequestLimitRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsRequestLimitRulesOutputReference { + return new CdnDomainConfigsRequestLimitRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsRetrievalRequestHeader { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#action CdnDomain#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#name CdnDomain#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#value CdnDomain#value} + */ + readonly value?: string; +} + +export function cdnDomainConfigsRetrievalRequestHeaderToTerraform(struct?: CdnDomainConfigsRetrievalRequestHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cdnDomainConfigsRetrievalRequestHeaderToHclTerraform(struct?: CdnDomainConfigsRetrievalRequestHeader | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsRetrievalRequestHeaderOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainConfigsRetrievalRequestHeader | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsRetrievalRequestHeader | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._name = value.name; + this._value = value.value; + } + } + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CdnDomainConfigsRetrievalRequestHeaderList extends cdktf.ComplexList { + public internalValue? : CdnDomainConfigsRetrievalRequestHeader[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainConfigsRetrievalRequestHeaderOutputReference { + return new CdnDomainConfigsRetrievalRequestHeaderOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainConfigsUrlSigningInheritConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#inherit_time_type CdnDomain#inherit_time_type} + */ + readonly inheritTimeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#inherit_type CdnDomain#inherit_type} + */ + readonly inheritType?: string; +} + +export function cdnDomainConfigsUrlSigningInheritConfigToTerraform(struct?: CdnDomainConfigsUrlSigningInheritConfigOutputReference | CdnDomainConfigsUrlSigningInheritConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + inherit_time_type: cdktf.stringToTerraform(struct!.inheritTimeType), + inherit_type: cdktf.stringToTerraform(struct!.inheritType), + } +} + + +export function cdnDomainConfigsUrlSigningInheritConfigToHclTerraform(struct?: CdnDomainConfigsUrlSigningInheritConfigOutputReference | CdnDomainConfigsUrlSigningInheritConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + inherit_time_type: { + value: cdktf.stringToHclTerraform(struct!.inheritTimeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inherit_type: { + value: cdktf.stringToHclTerraform(struct!.inheritType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsUrlSigningInheritConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsUrlSigningInheritConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._inheritTimeType !== undefined) { + hasAnyValues = true; + internalValueResult.inheritTimeType = this._inheritTimeType; + } + if (this._inheritType !== undefined) { + hasAnyValues = true; + internalValueResult.inheritType = this._inheritType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsUrlSigningInheritConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._inheritTimeType = undefined; + this._inheritType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._inheritTimeType = value.inheritTimeType; + this._inheritType = value.inheritType; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // inherit_time_type - computed: true, optional: true, required: false + private _inheritTimeType?: string; + public get inheritTimeType() { + return this.getStringAttribute('inherit_time_type'); + } + public set inheritTimeType(value: string) { + this._inheritTimeType = value; + } + public resetInheritTimeType() { + this._inheritTimeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get inheritTimeTypeInput() { + return this._inheritTimeType; + } + + // inherit_type - computed: true, optional: true, required: false + private _inheritType?: string; + public get inheritType() { + return this.getStringAttribute('inherit_type'); + } + public set inheritType(value: string) { + this._inheritType = value; + } + public resetInheritType() { + this._inheritType = undefined; + } + // Temporarily expose input value. Use with caution. + public get inheritTypeInput() { + return this._inheritType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} +export interface CdnDomainConfigsUrlSigning { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#backup_key CdnDomain#backup_key} + */ + readonly backupKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#expire_time CdnDomain#expire_time} + */ + readonly expireTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#key CdnDomain#key} + */ + readonly key?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#match_type CdnDomain#match_type} + */ + readonly matchType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#sign_arg CdnDomain#sign_arg} + */ + readonly signArg?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#sign_method CdnDomain#sign_method} + */ + readonly signMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#time_format CdnDomain#time_format} + */ + readonly timeFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type?: string; + /** + * inherit_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#inherit_config CdnDomain#inherit_config} + */ + readonly inheritConfig?: CdnDomainConfigsUrlSigningInheritConfig; +} + +export function cdnDomainConfigsUrlSigningToTerraform(struct?: CdnDomainConfigsUrlSigningOutputReference | CdnDomainConfigsUrlSigning): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backup_key: cdktf.stringToTerraform(struct!.backupKey), + enabled: cdktf.booleanToTerraform(struct!.enabled), + expire_time: cdktf.numberToTerraform(struct!.expireTime), + key: cdktf.stringToTerraform(struct!.key), + match_type: cdktf.stringToTerraform(struct!.matchType), + sign_arg: cdktf.stringToTerraform(struct!.signArg), + sign_method: cdktf.stringToTerraform(struct!.signMethod), + time_format: cdktf.stringToTerraform(struct!.timeFormat), + type: cdktf.stringToTerraform(struct!.type), + inherit_config: cdnDomainConfigsUrlSigningInheritConfigToTerraform(struct!.inheritConfig), + } +} + + +export function cdnDomainConfigsUrlSigningToHclTerraform(struct?: CdnDomainConfigsUrlSigningOutputReference | CdnDomainConfigsUrlSigning): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backup_key: { + value: cdktf.stringToHclTerraform(struct!.backupKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + expire_time: { + value: cdktf.numberToHclTerraform(struct!.expireTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + match_type: { + value: cdktf.stringToHclTerraform(struct!.matchType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign_arg: { + value: cdktf.stringToHclTerraform(struct!.signArg), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign_method: { + value: cdktf.stringToHclTerraform(struct!.signMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_format: { + value: cdktf.stringToHclTerraform(struct!.timeFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inherit_config: { + value: cdnDomainConfigsUrlSigningInheritConfigToHclTerraform(struct!.inheritConfig), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsUrlSigningInheritConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsUrlSigningOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsUrlSigning | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backupKey !== undefined) { + hasAnyValues = true; + internalValueResult.backupKey = this._backupKey; + } + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._expireTime !== undefined) { + hasAnyValues = true; + internalValueResult.expireTime = this._expireTime; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._matchType !== undefined) { + hasAnyValues = true; + internalValueResult.matchType = this._matchType; + } + if (this._signArg !== undefined) { + hasAnyValues = true; + internalValueResult.signArg = this._signArg; + } + if (this._signMethod !== undefined) { + hasAnyValues = true; + internalValueResult.signMethod = this._signMethod; + } + if (this._timeFormat !== undefined) { + hasAnyValues = true; + internalValueResult.timeFormat = this._timeFormat; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._inheritConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.inheritConfig = this._inheritConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsUrlSigning | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._backupKey = undefined; + this._enabled = undefined; + this._expireTime = undefined; + this._key = undefined; + this._matchType = undefined; + this._signArg = undefined; + this._signMethod = undefined; + this._timeFormat = undefined; + this._type = undefined; + this._inheritConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._backupKey = value.backupKey; + this._enabled = value.enabled; + this._expireTime = value.expireTime; + this._key = value.key; + this._matchType = value.matchType; + this._signArg = value.signArg; + this._signMethod = value.signMethod; + this._timeFormat = value.timeFormat; + this._type = value.type; + this._inheritConfig.internalValue = value.inheritConfig; + } + } + + // backup_key - computed: true, optional: true, required: false + private _backupKey?: string; + public get backupKey() { + return this.getStringAttribute('backup_key'); + } + public set backupKey(value: string) { + this._backupKey = value; + } + public resetBackupKey() { + this._backupKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupKeyInput() { + return this._backupKey; + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // expire_time - computed: true, optional: true, required: false + private _expireTime?: number; + public get expireTime() { + return this.getNumberAttribute('expire_time'); + } + public set expireTime(value: number) { + this._expireTime = value; + } + public resetExpireTime() { + this._expireTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get expireTimeInput() { + return this._expireTime; + } + + // key - computed: true, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // match_type - computed: true, optional: true, required: false + private _matchType?: string; + public get matchType() { + return this.getStringAttribute('match_type'); + } + public set matchType(value: string) { + this._matchType = value; + } + public resetMatchType() { + this._matchType = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchTypeInput() { + return this._matchType; + } + + // sign_arg - computed: true, optional: true, required: false + private _signArg?: string; + public get signArg() { + return this.getStringAttribute('sign_arg'); + } + public set signArg(value: string) { + this._signArg = value; + } + public resetSignArg() { + this._signArg = undefined; + } + // Temporarily expose input value. Use with caution. + public get signArgInput() { + return this._signArg; + } + + // sign_method - computed: true, optional: true, required: false + private _signMethod?: string; + public get signMethod() { + return this.getStringAttribute('sign_method'); + } + public set signMethod(value: string) { + this._signMethod = value; + } + public resetSignMethod() { + this._signMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get signMethodInput() { + return this._signMethod; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // time_format - computed: true, optional: true, required: false + private _timeFormat?: string; + public get timeFormat() { + return this.getStringAttribute('time_format'); + } + public set timeFormat(value: string) { + this._timeFormat = value; + } + public resetTimeFormat() { + this._timeFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeFormatInput() { + return this._timeFormat; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // inherit_config - computed: false, optional: true, required: false + private _inheritConfig = new CdnDomainConfigsUrlSigningInheritConfigOutputReference(this, "inherit_config"); + public get inheritConfig() { + return this._inheritConfig; + } + public putInheritConfig(value: CdnDomainConfigsUrlSigningInheritConfig) { + this._inheritConfig.internalValue = value; + } + public resetInheritConfig() { + this._inheritConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get inheritConfigInput() { + return this._inheritConfig.internalValue; + } +} +export interface CdnDomainConfigsUserAgentFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#include_empty CdnDomain#include_empty} + */ + readonly includeEmpty?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#type CdnDomain#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ua_list CdnDomain#ua_list} + */ + readonly uaList?: string[]; +} + +export function cdnDomainConfigsUserAgentFilterToTerraform(struct?: CdnDomainConfigsUserAgentFilterOutputReference | CdnDomainConfigsUserAgentFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + include_empty: cdktf.stringToTerraform(struct!.includeEmpty), + type: cdktf.stringToTerraform(struct!.type), + ua_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.uaList), + } +} + + +export function cdnDomainConfigsUserAgentFilterToHclTerraform(struct?: CdnDomainConfigsUserAgentFilterOutputReference | CdnDomainConfigsUserAgentFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + include_empty: { + value: cdktf.stringToHclTerraform(struct!.includeEmpty), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ua_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.uaList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsUserAgentFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsUserAgentFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._includeEmpty !== undefined) { + hasAnyValues = true; + internalValueResult.includeEmpty = this._includeEmpty; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._uaList !== undefined) { + hasAnyValues = true; + internalValueResult.uaList = this._uaList; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsUserAgentFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._includeEmpty = undefined; + this._type = undefined; + this._uaList = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._includeEmpty = value.includeEmpty; + this._type = value.type; + this._uaList = value.uaList; + } + } + + // include_empty - computed: true, optional: true, required: false + private _includeEmpty?: string; + public get includeEmpty() { + return this.getStringAttribute('include_empty'); + } + public set includeEmpty(value: string) { + this._includeEmpty = value; + } + public resetIncludeEmpty() { + this._includeEmpty = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeEmptyInput() { + return this._includeEmpty; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ua_list - computed: true, optional: true, required: false + private _uaList?: string[]; + public get uaList() { + return cdktf.Fn.tolist(this.getListAttribute('ua_list')); + } + public set uaList(value: string[]) { + this._uaList = value; + } + public resetUaList() { + this._uaList = undefined; + } + // Temporarily expose input value. Use with caution. + public get uaListInput() { + return this._uaList; + } +} +export interface CdnDomainConfigsVideoSeek { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enable_flv_by_time_seek CdnDomain#enable_flv_by_time_seek} + */ + readonly enableFlvByTimeSeek?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enable_video_seek CdnDomain#enable_video_seek} + */ + readonly enableVideoSeek: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#end_parameter CdnDomain#end_parameter} + */ + readonly endParameter?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#start_parameter CdnDomain#start_parameter} + */ + readonly startParameter?: string; +} + +export function cdnDomainConfigsVideoSeekToTerraform(struct?: CdnDomainConfigsVideoSeekOutputReference | CdnDomainConfigsVideoSeek): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable_flv_by_time_seek: cdktf.booleanToTerraform(struct!.enableFlvByTimeSeek), + enable_video_seek: cdktf.booleanToTerraform(struct!.enableVideoSeek), + end_parameter: cdktf.stringToTerraform(struct!.endParameter), + start_parameter: cdktf.stringToTerraform(struct!.startParameter), + } +} + + +export function cdnDomainConfigsVideoSeekToHclTerraform(struct?: CdnDomainConfigsVideoSeekOutputReference | CdnDomainConfigsVideoSeek): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable_flv_by_time_seek: { + value: cdktf.booleanToHclTerraform(struct!.enableFlvByTimeSeek), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_video_seek: { + value: cdktf.booleanToHclTerraform(struct!.enableVideoSeek), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end_parameter: { + value: cdktf.stringToHclTerraform(struct!.endParameter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_parameter: { + value: cdktf.stringToHclTerraform(struct!.startParameter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsVideoSeekOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsVideoSeek | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enableFlvByTimeSeek !== undefined) { + hasAnyValues = true; + internalValueResult.enableFlvByTimeSeek = this._enableFlvByTimeSeek; + } + if (this._enableVideoSeek !== undefined) { + hasAnyValues = true; + internalValueResult.enableVideoSeek = this._enableVideoSeek; + } + if (this._endParameter !== undefined) { + hasAnyValues = true; + internalValueResult.endParameter = this._endParameter; + } + if (this._startParameter !== undefined) { + hasAnyValues = true; + internalValueResult.startParameter = this._startParameter; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsVideoSeek | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enableFlvByTimeSeek = undefined; + this._enableVideoSeek = undefined; + this._endParameter = undefined; + this._startParameter = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enableFlvByTimeSeek = value.enableFlvByTimeSeek; + this._enableVideoSeek = value.enableVideoSeek; + this._endParameter = value.endParameter; + this._startParameter = value.startParameter; + } + } + + // enable_flv_by_time_seek - computed: true, optional: true, required: false + private _enableFlvByTimeSeek?: boolean | cdktf.IResolvable; + public get enableFlvByTimeSeek() { + return this.getBooleanAttribute('enable_flv_by_time_seek'); + } + public set enableFlvByTimeSeek(value: boolean | cdktf.IResolvable) { + this._enableFlvByTimeSeek = value; + } + public resetEnableFlvByTimeSeek() { + this._enableFlvByTimeSeek = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableFlvByTimeSeekInput() { + return this._enableFlvByTimeSeek; + } + + // enable_video_seek - computed: false, optional: false, required: true + private _enableVideoSeek?: boolean | cdktf.IResolvable; + public get enableVideoSeek() { + return this.getBooleanAttribute('enable_video_seek'); + } + public set enableVideoSeek(value: boolean | cdktf.IResolvable) { + this._enableVideoSeek = value; + } + // Temporarily expose input value. Use with caution. + public get enableVideoSeekInput() { + return this._enableVideoSeek; + } + + // end_parameter - computed: false, optional: true, required: false + private _endParameter?: string; + public get endParameter() { + return this.getStringAttribute('end_parameter'); + } + public set endParameter(value: string) { + this._endParameter = value; + } + public resetEndParameter() { + this._endParameter = undefined; + } + // Temporarily expose input value. Use with caution. + public get endParameterInput() { + return this._endParameter; + } + + // start_parameter - computed: false, optional: true, required: false + private _startParameter?: string; + public get startParameter() { + return this.getStringAttribute('start_parameter'); + } + public set startParameter(value: string) { + this._startParameter = value; + } + public resetStartParameter() { + this._startParameter = undefined; + } + // Temporarily expose input value. Use with caution. + public get startParameterInput() { + return this._startParameter; + } +} +export interface CdnDomainConfigsWebsocket { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#enabled CdnDomain#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#timeout CdnDomain#timeout} + */ + readonly timeout?: number; +} + +export function cdnDomainConfigsWebsocketToTerraform(struct?: CdnDomainConfigsWebsocketOutputReference | CdnDomainConfigsWebsocket): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function cdnDomainConfigsWebsocketToHclTerraform(struct?: CdnDomainConfigsWebsocketOutputReference | CdnDomainConfigsWebsocket): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsWebsocketOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigsWebsocket | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigsWebsocket | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enabled = undefined; + this._timeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enabled = value.enabled; + this._timeout = value.timeout; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} +export interface CdnDomainConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#description CdnDomain#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ipv6_enable CdnDomain#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#origin_follow302_status CdnDomain#origin_follow302_status} + */ + readonly originFollow302Status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#origin_protocol CdnDomain#origin_protocol} + */ + readonly originProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#origin_receive_timeout CdnDomain#origin_receive_timeout} + */ + readonly originReceiveTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#range_based_retrieval_enabled CdnDomain#range_based_retrieval_enabled} + */ + readonly rangeBasedRetrievalEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#slice_etag_status CdnDomain#slice_etag_status} + */ + readonly sliceEtagStatus?: string; + /** + * access_area_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#access_area_filter CdnDomain#access_area_filter} + */ + readonly accessAreaFilter?: CdnDomainConfigsAccessAreaFilter[] | cdktf.IResolvable; + /** + * cache_url_parameter_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#cache_url_parameter_filter CdnDomain#cache_url_parameter_filter} + */ + readonly cacheUrlParameterFilter?: CdnDomainConfigsCacheUrlParameterFilter; + /** + * compress block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#compress CdnDomain#compress} + */ + readonly compress?: CdnDomainConfigsCompress; + /** + * error_code_cache block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#error_code_cache CdnDomain#error_code_cache} + */ + readonly errorCodeCache?: CdnDomainConfigsErrorCodeCache[] | cdktf.IResolvable; + /** + * error_code_redirect_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#error_code_redirect_rules CdnDomain#error_code_redirect_rules} + */ + readonly errorCodeRedirectRules?: CdnDomainConfigsErrorCodeRedirectRules[] | cdktf.IResolvable; + /** + * flexible_origin block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#flexible_origin CdnDomain#flexible_origin} + */ + readonly flexibleOrigin?: CdnDomainConfigsFlexibleOrigin[] | cdktf.IResolvable; + /** + * force_redirect block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#force_redirect CdnDomain#force_redirect} + */ + readonly forceRedirect?: CdnDomainConfigsForceRedirect; + /** + * hsts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#hsts CdnDomain#hsts} + */ + readonly hsts?: CdnDomainConfigsHsts; + /** + * http_response_header block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#http_response_header CdnDomain#http_response_header} + */ + readonly httpResponseHeader?: CdnDomainConfigsHttpResponseHeader[] | cdktf.IResolvable; + /** + * https_settings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#https_settings CdnDomain#https_settings} + */ + readonly httpsSettings?: CdnDomainConfigsHttpsSettings; + /** + * ip_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ip_filter CdnDomain#ip_filter} + */ + readonly ipFilter?: CdnDomainConfigsIpFilter; + /** + * ip_frequency_limit block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#ip_frequency_limit CdnDomain#ip_frequency_limit} + */ + readonly ipFrequencyLimit?: CdnDomainConfigsIpFrequencyLimit; + /** + * origin_request_url_rewrite block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#origin_request_url_rewrite CdnDomain#origin_request_url_rewrite} + */ + readonly originRequestUrlRewrite?: CdnDomainConfigsOriginRequestUrlRewrite[] | cdktf.IResolvable; + /** + * quic block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#quic CdnDomain#quic} + */ + readonly quic?: CdnDomainConfigsQuic; + /** + * referer block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#referer CdnDomain#referer} + */ + readonly referer?: CdnDomainConfigsReferer; + /** + * remote_auth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#remote_auth CdnDomain#remote_auth} + */ + readonly remoteAuth?: CdnDomainConfigsRemoteAuth; + /** + * request_limit_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#request_limit_rules CdnDomain#request_limit_rules} + */ + readonly requestLimitRules?: CdnDomainConfigsRequestLimitRules[] | cdktf.IResolvable; + /** + * retrieval_request_header block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#retrieval_request_header CdnDomain#retrieval_request_header} + */ + readonly retrievalRequestHeader?: CdnDomainConfigsRetrievalRequestHeader[] | cdktf.IResolvable; + /** + * url_signing block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#url_signing CdnDomain#url_signing} + */ + readonly urlSigning?: CdnDomainConfigsUrlSigning; + /** + * user_agent_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#user_agent_filter CdnDomain#user_agent_filter} + */ + readonly userAgentFilter?: CdnDomainConfigsUserAgentFilter; + /** + * video_seek block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#video_seek CdnDomain#video_seek} + */ + readonly videoSeek?: CdnDomainConfigsVideoSeek; + /** + * websocket block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#websocket CdnDomain#websocket} + */ + readonly websocket?: CdnDomainConfigsWebsocket; +} + +export function cdnDomainConfigsToTerraform(struct?: CdnDomainConfigsOutputReference | CdnDomainConfigs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + ipv6_enable: cdktf.booleanToTerraform(struct!.ipv6Enable), + origin_follow302_status: cdktf.stringToTerraform(struct!.originFollow302Status), + origin_protocol: cdktf.stringToTerraform(struct!.originProtocol), + origin_receive_timeout: cdktf.numberToTerraform(struct!.originReceiveTimeout), + range_based_retrieval_enabled: cdktf.booleanToTerraform(struct!.rangeBasedRetrievalEnabled), + slice_etag_status: cdktf.stringToTerraform(struct!.sliceEtagStatus), + access_area_filter: cdktf.listMapper(cdnDomainConfigsAccessAreaFilterToTerraform, true)(struct!.accessAreaFilter), + cache_url_parameter_filter: cdnDomainConfigsCacheUrlParameterFilterToTerraform(struct!.cacheUrlParameterFilter), + compress: cdnDomainConfigsCompressToTerraform(struct!.compress), + error_code_cache: cdktf.listMapper(cdnDomainConfigsErrorCodeCacheToTerraform, true)(struct!.errorCodeCache), + error_code_redirect_rules: cdktf.listMapper(cdnDomainConfigsErrorCodeRedirectRulesToTerraform, true)(struct!.errorCodeRedirectRules), + flexible_origin: cdktf.listMapper(cdnDomainConfigsFlexibleOriginToTerraform, true)(struct!.flexibleOrigin), + force_redirect: cdnDomainConfigsForceRedirectToTerraform(struct!.forceRedirect), + hsts: cdnDomainConfigsHstsToTerraform(struct!.hsts), + http_response_header: cdktf.listMapper(cdnDomainConfigsHttpResponseHeaderToTerraform, true)(struct!.httpResponseHeader), + https_settings: cdnDomainConfigsHttpsSettingsToTerraform(struct!.httpsSettings), + ip_filter: cdnDomainConfigsIpFilterToTerraform(struct!.ipFilter), + ip_frequency_limit: cdnDomainConfigsIpFrequencyLimitToTerraform(struct!.ipFrequencyLimit), + origin_request_url_rewrite: cdktf.listMapper(cdnDomainConfigsOriginRequestUrlRewriteToTerraform, true)(struct!.originRequestUrlRewrite), + quic: cdnDomainConfigsQuicToTerraform(struct!.quic), + referer: cdnDomainConfigsRefererToTerraform(struct!.referer), + remote_auth: cdnDomainConfigsRemoteAuthToTerraform(struct!.remoteAuth), + request_limit_rules: cdktf.listMapper(cdnDomainConfigsRequestLimitRulesToTerraform, true)(struct!.requestLimitRules), + retrieval_request_header: cdktf.listMapper(cdnDomainConfigsRetrievalRequestHeaderToTerraform, true)(struct!.retrievalRequestHeader), + url_signing: cdnDomainConfigsUrlSigningToTerraform(struct!.urlSigning), + user_agent_filter: cdnDomainConfigsUserAgentFilterToTerraform(struct!.userAgentFilter), + video_seek: cdnDomainConfigsVideoSeekToTerraform(struct!.videoSeek), + websocket: cdnDomainConfigsWebsocketToTerraform(struct!.websocket), + } +} + + +export function cdnDomainConfigsToHclTerraform(struct?: CdnDomainConfigsOutputReference | CdnDomainConfigs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(struct!.ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + origin_follow302_status: { + value: cdktf.stringToHclTerraform(struct!.originFollow302Status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin_protocol: { + value: cdktf.stringToHclTerraform(struct!.originProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin_receive_timeout: { + value: cdktf.numberToHclTerraform(struct!.originReceiveTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + range_based_retrieval_enabled: { + value: cdktf.booleanToHclTerraform(struct!.rangeBasedRetrievalEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + slice_etag_status: { + value: cdktf.stringToHclTerraform(struct!.sliceEtagStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_area_filter: { + value: cdktf.listMapperHcl(cdnDomainConfigsAccessAreaFilterToHclTerraform, true)(struct!.accessAreaFilter), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsAccessAreaFilterList", + }, + cache_url_parameter_filter: { + value: cdnDomainConfigsCacheUrlParameterFilterToHclTerraform(struct!.cacheUrlParameterFilter), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsCacheUrlParameterFilterList", + }, + compress: { + value: cdnDomainConfigsCompressToHclTerraform(struct!.compress), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsCompressList", + }, + error_code_cache: { + value: cdktf.listMapperHcl(cdnDomainConfigsErrorCodeCacheToHclTerraform, true)(struct!.errorCodeCache), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsErrorCodeCacheList", + }, + error_code_redirect_rules: { + value: cdktf.listMapperHcl(cdnDomainConfigsErrorCodeRedirectRulesToHclTerraform, true)(struct!.errorCodeRedirectRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsErrorCodeRedirectRulesList", + }, + flexible_origin: { + value: cdktf.listMapperHcl(cdnDomainConfigsFlexibleOriginToHclTerraform, true)(struct!.flexibleOrigin), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsFlexibleOriginList", + }, + force_redirect: { + value: cdnDomainConfigsForceRedirectToHclTerraform(struct!.forceRedirect), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsForceRedirectList", + }, + hsts: { + value: cdnDomainConfigsHstsToHclTerraform(struct!.hsts), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsHstsList", + }, + http_response_header: { + value: cdktf.listMapperHcl(cdnDomainConfigsHttpResponseHeaderToHclTerraform, true)(struct!.httpResponseHeader), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsHttpResponseHeaderList", + }, + https_settings: { + value: cdnDomainConfigsHttpsSettingsToHclTerraform(struct!.httpsSettings), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsHttpsSettingsList", + }, + ip_filter: { + value: cdnDomainConfigsIpFilterToHclTerraform(struct!.ipFilter), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsIpFilterList", + }, + ip_frequency_limit: { + value: cdnDomainConfigsIpFrequencyLimitToHclTerraform(struct!.ipFrequencyLimit), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsIpFrequencyLimitList", + }, + origin_request_url_rewrite: { + value: cdktf.listMapperHcl(cdnDomainConfigsOriginRequestUrlRewriteToHclTerraform, true)(struct!.originRequestUrlRewrite), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsOriginRequestUrlRewriteList", + }, + quic: { + value: cdnDomainConfigsQuicToHclTerraform(struct!.quic), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsQuicList", + }, + referer: { + value: cdnDomainConfigsRefererToHclTerraform(struct!.referer), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsRefererList", + }, + remote_auth: { + value: cdnDomainConfigsRemoteAuthToHclTerraform(struct!.remoteAuth), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsRemoteAuthList", + }, + request_limit_rules: { + value: cdktf.listMapperHcl(cdnDomainConfigsRequestLimitRulesToHclTerraform, true)(struct!.requestLimitRules), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsRequestLimitRulesList", + }, + retrieval_request_header: { + value: cdktf.listMapperHcl(cdnDomainConfigsRetrievalRequestHeaderToHclTerraform, true)(struct!.retrievalRequestHeader), + isBlock: true, + type: "set", + storageClassType: "CdnDomainConfigsRetrievalRequestHeaderList", + }, + url_signing: { + value: cdnDomainConfigsUrlSigningToHclTerraform(struct!.urlSigning), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsUrlSigningList", + }, + user_agent_filter: { + value: cdnDomainConfigsUserAgentFilterToHclTerraform(struct!.userAgentFilter), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsUserAgentFilterList", + }, + video_seek: { + value: cdnDomainConfigsVideoSeekToHclTerraform(struct!.videoSeek), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsVideoSeekList", + }, + websocket: { + value: cdnDomainConfigsWebsocketToHclTerraform(struct!.websocket), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsWebsocketList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CdnDomainConfigs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._ipv6Enable !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6Enable = this._ipv6Enable; + } + if (this._originFollow302Status !== undefined) { + hasAnyValues = true; + internalValueResult.originFollow302Status = this._originFollow302Status; + } + if (this._originProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.originProtocol = this._originProtocol; + } + if (this._originReceiveTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.originReceiveTimeout = this._originReceiveTimeout; + } + if (this._rangeBasedRetrievalEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.rangeBasedRetrievalEnabled = this._rangeBasedRetrievalEnabled; + } + if (this._sliceEtagStatus !== undefined) { + hasAnyValues = true; + internalValueResult.sliceEtagStatus = this._sliceEtagStatus; + } + if (this._accessAreaFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.accessAreaFilter = this._accessAreaFilter?.internalValue; + } + if (this._cacheUrlParameterFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cacheUrlParameterFilter = this._cacheUrlParameterFilter?.internalValue; + } + if (this._compress?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.compress = this._compress?.internalValue; + } + if (this._errorCodeCache?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.errorCodeCache = this._errorCodeCache?.internalValue; + } + if (this._errorCodeRedirectRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.errorCodeRedirectRules = this._errorCodeRedirectRules?.internalValue; + } + if (this._flexibleOrigin?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.flexibleOrigin = this._flexibleOrigin?.internalValue; + } + if (this._forceRedirect?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.forceRedirect = this._forceRedirect?.internalValue; + } + if (this._hsts?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.hsts = this._hsts?.internalValue; + } + if (this._httpResponseHeader?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpResponseHeader = this._httpResponseHeader?.internalValue; + } + if (this._httpsSettings?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpsSettings = this._httpsSettings?.internalValue; + } + if (this._ipFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.ipFilter = this._ipFilter?.internalValue; + } + if (this._ipFrequencyLimit?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.ipFrequencyLimit = this._ipFrequencyLimit?.internalValue; + } + if (this._originRequestUrlRewrite?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.originRequestUrlRewrite = this._originRequestUrlRewrite?.internalValue; + } + if (this._quic?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.quic = this._quic?.internalValue; + } + if (this._referer?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.referer = this._referer?.internalValue; + } + if (this._remoteAuth?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.remoteAuth = this._remoteAuth?.internalValue; + } + if (this._requestLimitRules?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.requestLimitRules = this._requestLimitRules?.internalValue; + } + if (this._retrievalRequestHeader?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.retrievalRequestHeader = this._retrievalRequestHeader?.internalValue; + } + if (this._urlSigning?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.urlSigning = this._urlSigning?.internalValue; + } + if (this._userAgentFilter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.userAgentFilter = this._userAgentFilter?.internalValue; + } + if (this._videoSeek?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.videoSeek = this._videoSeek?.internalValue; + } + if (this._websocket?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.websocket = this._websocket?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainConfigs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._ipv6Enable = undefined; + this._originFollow302Status = undefined; + this._originProtocol = undefined; + this._originReceiveTimeout = undefined; + this._rangeBasedRetrievalEnabled = undefined; + this._sliceEtagStatus = undefined; + this._accessAreaFilter.internalValue = undefined; + this._cacheUrlParameterFilter.internalValue = undefined; + this._compress.internalValue = undefined; + this._errorCodeCache.internalValue = undefined; + this._errorCodeRedirectRules.internalValue = undefined; + this._flexibleOrigin.internalValue = undefined; + this._forceRedirect.internalValue = undefined; + this._hsts.internalValue = undefined; + this._httpResponseHeader.internalValue = undefined; + this._httpsSettings.internalValue = undefined; + this._ipFilter.internalValue = undefined; + this._ipFrequencyLimit.internalValue = undefined; + this._originRequestUrlRewrite.internalValue = undefined; + this._quic.internalValue = undefined; + this._referer.internalValue = undefined; + this._remoteAuth.internalValue = undefined; + this._requestLimitRules.internalValue = undefined; + this._retrievalRequestHeader.internalValue = undefined; + this._urlSigning.internalValue = undefined; + this._userAgentFilter.internalValue = undefined; + this._videoSeek.internalValue = undefined; + this._websocket.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._ipv6Enable = value.ipv6Enable; + this._originFollow302Status = value.originFollow302Status; + this._originProtocol = value.originProtocol; + this._originReceiveTimeout = value.originReceiveTimeout; + this._rangeBasedRetrievalEnabled = value.rangeBasedRetrievalEnabled; + this._sliceEtagStatus = value.sliceEtagStatus; + this._accessAreaFilter.internalValue = value.accessAreaFilter; + this._cacheUrlParameterFilter.internalValue = value.cacheUrlParameterFilter; + this._compress.internalValue = value.compress; + this._errorCodeCache.internalValue = value.errorCodeCache; + this._errorCodeRedirectRules.internalValue = value.errorCodeRedirectRules; + this._flexibleOrigin.internalValue = value.flexibleOrigin; + this._forceRedirect.internalValue = value.forceRedirect; + this._hsts.internalValue = value.hsts; + this._httpResponseHeader.internalValue = value.httpResponseHeader; + this._httpsSettings.internalValue = value.httpsSettings; + this._ipFilter.internalValue = value.ipFilter; + this._ipFrequencyLimit.internalValue = value.ipFrequencyLimit; + this._originRequestUrlRewrite.internalValue = value.originRequestUrlRewrite; + this._quic.internalValue = value.quic; + this._referer.internalValue = value.referer; + this._remoteAuth.internalValue = value.remoteAuth; + this._requestLimitRules.internalValue = value.requestLimitRules; + this._retrievalRequestHeader.internalValue = value.retrievalRequestHeader; + this._urlSigning.internalValue = value.urlSigning; + this._userAgentFilter.internalValue = value.userAgentFilter; + this._videoSeek.internalValue = value.videoSeek; + this._websocket.internalValue = value.websocket; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // origin_follow302_status - computed: true, optional: true, required: false + private _originFollow302Status?: string; + public get originFollow302Status() { + return this.getStringAttribute('origin_follow302_status'); + } + public set originFollow302Status(value: string) { + this._originFollow302Status = value; + } + public resetOriginFollow302Status() { + this._originFollow302Status = undefined; + } + // Temporarily expose input value. Use with caution. + public get originFollow302StatusInput() { + return this._originFollow302Status; + } + + // origin_protocol - computed: true, optional: true, required: false + private _originProtocol?: string; + public get originProtocol() { + return this.getStringAttribute('origin_protocol'); + } + public set originProtocol(value: string) { + this._originProtocol = value; + } + public resetOriginProtocol() { + this._originProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get originProtocolInput() { + return this._originProtocol; + } + + // origin_receive_timeout - computed: true, optional: true, required: false + private _originReceiveTimeout?: number; + public get originReceiveTimeout() { + return this.getNumberAttribute('origin_receive_timeout'); + } + public set originReceiveTimeout(value: number) { + this._originReceiveTimeout = value; + } + public resetOriginReceiveTimeout() { + this._originReceiveTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get originReceiveTimeoutInput() { + return this._originReceiveTimeout; + } + + // range_based_retrieval_enabled - computed: false, optional: true, required: false + private _rangeBasedRetrievalEnabled?: boolean | cdktf.IResolvable; + public get rangeBasedRetrievalEnabled() { + return this.getBooleanAttribute('range_based_retrieval_enabled'); + } + public set rangeBasedRetrievalEnabled(value: boolean | cdktf.IResolvable) { + this._rangeBasedRetrievalEnabled = value; + } + public resetRangeBasedRetrievalEnabled() { + this._rangeBasedRetrievalEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get rangeBasedRetrievalEnabledInput() { + return this._rangeBasedRetrievalEnabled; + } + + // slice_etag_status - computed: true, optional: true, required: false + private _sliceEtagStatus?: string; + public get sliceEtagStatus() { + return this.getStringAttribute('slice_etag_status'); + } + public set sliceEtagStatus(value: string) { + this._sliceEtagStatus = value; + } + public resetSliceEtagStatus() { + this._sliceEtagStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get sliceEtagStatusInput() { + return this._sliceEtagStatus; + } + + // access_area_filter - computed: false, optional: true, required: false + private _accessAreaFilter = new CdnDomainConfigsAccessAreaFilterList(this, "access_area_filter", true); + public get accessAreaFilter() { + return this._accessAreaFilter; + } + public putAccessAreaFilter(value: CdnDomainConfigsAccessAreaFilter[] | cdktf.IResolvable) { + this._accessAreaFilter.internalValue = value; + } + public resetAccessAreaFilter() { + this._accessAreaFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessAreaFilterInput() { + return this._accessAreaFilter.internalValue; + } + + // cache_url_parameter_filter - computed: false, optional: true, required: false + private _cacheUrlParameterFilter = new CdnDomainConfigsCacheUrlParameterFilterOutputReference(this, "cache_url_parameter_filter"); + public get cacheUrlParameterFilter() { + return this._cacheUrlParameterFilter; + } + public putCacheUrlParameterFilter(value: CdnDomainConfigsCacheUrlParameterFilter) { + this._cacheUrlParameterFilter.internalValue = value; + } + public resetCacheUrlParameterFilter() { + this._cacheUrlParameterFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheUrlParameterFilterInput() { + return this._cacheUrlParameterFilter.internalValue; + } + + // compress - computed: false, optional: true, required: false + private _compress = new CdnDomainConfigsCompressOutputReference(this, "compress"); + public get compress() { + return this._compress; + } + public putCompress(value: CdnDomainConfigsCompress) { + this._compress.internalValue = value; + } + public resetCompress() { + this._compress.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressInput() { + return this._compress.internalValue; + } + + // error_code_cache - computed: false, optional: true, required: false + private _errorCodeCache = new CdnDomainConfigsErrorCodeCacheList(this, "error_code_cache", true); + public get errorCodeCache() { + return this._errorCodeCache; + } + public putErrorCodeCache(value: CdnDomainConfigsErrorCodeCache[] | cdktf.IResolvable) { + this._errorCodeCache.internalValue = value; + } + public resetErrorCodeCache() { + this._errorCodeCache.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorCodeCacheInput() { + return this._errorCodeCache.internalValue; + } + + // error_code_redirect_rules - computed: false, optional: true, required: false + private _errorCodeRedirectRules = new CdnDomainConfigsErrorCodeRedirectRulesList(this, "error_code_redirect_rules", true); + public get errorCodeRedirectRules() { + return this._errorCodeRedirectRules; + } + public putErrorCodeRedirectRules(value: CdnDomainConfigsErrorCodeRedirectRules[] | cdktf.IResolvable) { + this._errorCodeRedirectRules.internalValue = value; + } + public resetErrorCodeRedirectRules() { + this._errorCodeRedirectRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorCodeRedirectRulesInput() { + return this._errorCodeRedirectRules.internalValue; + } + + // flexible_origin - computed: false, optional: true, required: false + private _flexibleOrigin = new CdnDomainConfigsFlexibleOriginList(this, "flexible_origin", true); + public get flexibleOrigin() { + return this._flexibleOrigin; + } + public putFlexibleOrigin(value: CdnDomainConfigsFlexibleOrigin[] | cdktf.IResolvable) { + this._flexibleOrigin.internalValue = value; + } + public resetFlexibleOrigin() { + this._flexibleOrigin.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get flexibleOriginInput() { + return this._flexibleOrigin.internalValue; + } + + // force_redirect - computed: false, optional: true, required: false + private _forceRedirect = new CdnDomainConfigsForceRedirectOutputReference(this, "force_redirect"); + public get forceRedirect() { + return this._forceRedirect; + } + public putForceRedirect(value: CdnDomainConfigsForceRedirect) { + this._forceRedirect.internalValue = value; + } + public resetForceRedirect() { + this._forceRedirect.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceRedirectInput() { + return this._forceRedirect.internalValue; + } + + // hsts - computed: false, optional: true, required: false + private _hsts = new CdnDomainConfigsHstsOutputReference(this, "hsts"); + public get hsts() { + return this._hsts; + } + public putHsts(value: CdnDomainConfigsHsts) { + this._hsts.internalValue = value; + } + public resetHsts() { + this._hsts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hstsInput() { + return this._hsts.internalValue; + } + + // http_response_header - computed: false, optional: true, required: false + private _httpResponseHeader = new CdnDomainConfigsHttpResponseHeaderList(this, "http_response_header", true); + public get httpResponseHeader() { + return this._httpResponseHeader; + } + public putHttpResponseHeader(value: CdnDomainConfigsHttpResponseHeader[] | cdktf.IResolvable) { + this._httpResponseHeader.internalValue = value; + } + public resetHttpResponseHeader() { + this._httpResponseHeader.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpResponseHeaderInput() { + return this._httpResponseHeader.internalValue; + } + + // https_settings - computed: false, optional: true, required: false + private _httpsSettings = new CdnDomainConfigsHttpsSettingsOutputReference(this, "https_settings"); + public get httpsSettings() { + return this._httpsSettings; + } + public putHttpsSettings(value: CdnDomainConfigsHttpsSettings) { + this._httpsSettings.internalValue = value; + } + public resetHttpsSettings() { + this._httpsSettings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsSettingsInput() { + return this._httpsSettings.internalValue; + } + + // ip_filter - computed: false, optional: true, required: false + private _ipFilter = new CdnDomainConfigsIpFilterOutputReference(this, "ip_filter"); + public get ipFilter() { + return this._ipFilter; + } + public putIpFilter(value: CdnDomainConfigsIpFilter) { + this._ipFilter.internalValue = value; + } + public resetIpFilter() { + this._ipFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipFilterInput() { + return this._ipFilter.internalValue; + } + + // ip_frequency_limit - computed: false, optional: true, required: false + private _ipFrequencyLimit = new CdnDomainConfigsIpFrequencyLimitOutputReference(this, "ip_frequency_limit"); + public get ipFrequencyLimit() { + return this._ipFrequencyLimit; + } + public putIpFrequencyLimit(value: CdnDomainConfigsIpFrequencyLimit) { + this._ipFrequencyLimit.internalValue = value; + } + public resetIpFrequencyLimit() { + this._ipFrequencyLimit.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipFrequencyLimitInput() { + return this._ipFrequencyLimit.internalValue; + } + + // origin_request_url_rewrite - computed: false, optional: true, required: false + private _originRequestUrlRewrite = new CdnDomainConfigsOriginRequestUrlRewriteList(this, "origin_request_url_rewrite", true); + public get originRequestUrlRewrite() { + return this._originRequestUrlRewrite; + } + public putOriginRequestUrlRewrite(value: CdnDomainConfigsOriginRequestUrlRewrite[] | cdktf.IResolvable) { + this._originRequestUrlRewrite.internalValue = value; + } + public resetOriginRequestUrlRewrite() { + this._originRequestUrlRewrite.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get originRequestUrlRewriteInput() { + return this._originRequestUrlRewrite.internalValue; + } + + // quic - computed: false, optional: true, required: false + private _quic = new CdnDomainConfigsQuicOutputReference(this, "quic"); + public get quic() { + return this._quic; + } + public putQuic(value: CdnDomainConfigsQuic) { + this._quic.internalValue = value; + } + public resetQuic() { + this._quic.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get quicInput() { + return this._quic.internalValue; + } + + // referer - computed: false, optional: true, required: false + private _referer = new CdnDomainConfigsRefererOutputReference(this, "referer"); + public get referer() { + return this._referer; + } + public putReferer(value: CdnDomainConfigsReferer) { + this._referer.internalValue = value; + } + public resetReferer() { + this._referer.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get refererInput() { + return this._referer.internalValue; + } + + // remote_auth - computed: false, optional: true, required: false + private _remoteAuth = new CdnDomainConfigsRemoteAuthOutputReference(this, "remote_auth"); + public get remoteAuth() { + return this._remoteAuth; + } + public putRemoteAuth(value: CdnDomainConfigsRemoteAuth) { + this._remoteAuth.internalValue = value; + } + public resetRemoteAuth() { + this._remoteAuth.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAuthInput() { + return this._remoteAuth.internalValue; + } + + // request_limit_rules - computed: false, optional: true, required: false + private _requestLimitRules = new CdnDomainConfigsRequestLimitRulesList(this, "request_limit_rules", true); + public get requestLimitRules() { + return this._requestLimitRules; + } + public putRequestLimitRules(value: CdnDomainConfigsRequestLimitRules[] | cdktf.IResolvable) { + this._requestLimitRules.internalValue = value; + } + public resetRequestLimitRules() { + this._requestLimitRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestLimitRulesInput() { + return this._requestLimitRules.internalValue; + } + + // retrieval_request_header - computed: false, optional: true, required: false + private _retrievalRequestHeader = new CdnDomainConfigsRetrievalRequestHeaderList(this, "retrieval_request_header", true); + public get retrievalRequestHeader() { + return this._retrievalRequestHeader; + } + public putRetrievalRequestHeader(value: CdnDomainConfigsRetrievalRequestHeader[] | cdktf.IResolvable) { + this._retrievalRequestHeader.internalValue = value; + } + public resetRetrievalRequestHeader() { + this._retrievalRequestHeader.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get retrievalRequestHeaderInput() { + return this._retrievalRequestHeader.internalValue; + } + + // url_signing - computed: false, optional: true, required: false + private _urlSigning = new CdnDomainConfigsUrlSigningOutputReference(this, "url_signing"); + public get urlSigning() { + return this._urlSigning; + } + public putUrlSigning(value: CdnDomainConfigsUrlSigning) { + this._urlSigning.internalValue = value; + } + public resetUrlSigning() { + this._urlSigning.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlSigningInput() { + return this._urlSigning.internalValue; + } + + // user_agent_filter - computed: false, optional: true, required: false + private _userAgentFilter = new CdnDomainConfigsUserAgentFilterOutputReference(this, "user_agent_filter"); + public get userAgentFilter() { + return this._userAgentFilter; + } + public putUserAgentFilter(value: CdnDomainConfigsUserAgentFilter) { + this._userAgentFilter.internalValue = value; + } + public resetUserAgentFilter() { + this._userAgentFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get userAgentFilterInput() { + return this._userAgentFilter.internalValue; + } + + // video_seek - computed: false, optional: true, required: false + private _videoSeek = new CdnDomainConfigsVideoSeekOutputReference(this, "video_seek"); + public get videoSeek() { + return this._videoSeek; + } + public putVideoSeek(value: CdnDomainConfigsVideoSeek) { + this._videoSeek.internalValue = value; + } + public resetVideoSeek() { + this._videoSeek.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get videoSeekInput() { + return this._videoSeek.internalValue; + } + + // websocket - computed: false, optional: true, required: false + private _websocket = new CdnDomainConfigsWebsocketOutputReference(this, "websocket"); + public get websocket() { + return this._websocket; + } + public putWebsocket(value: CdnDomainConfigsWebsocket) { + this._websocket.internalValue = value; + } + public resetWebsocket() { + this._websocket.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get websocketInput() { + return this._websocket.internalValue; + } +} +export interface CdnDomainSources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#active CdnDomain#active} + */ + readonly active?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#http_port CdnDomain#http_port} + */ + readonly httpPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#https_port CdnDomain#https_port} + */ + readonly httpsPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#obs_bucket_type CdnDomain#obs_bucket_type} + */ + readonly obsBucketType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#obs_web_hosting_enabled CdnDomain#obs_web_hosting_enabled} + */ + readonly obsWebHostingEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#origin CdnDomain#origin} + */ + readonly origin: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#origin_type CdnDomain#origin_type} + */ + readonly originType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#retrieval_host CdnDomain#retrieval_host} + */ + readonly retrievalHost?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#weight CdnDomain#weight} + */ + readonly weight?: number; +} + +export function cdnDomainSourcesToTerraform(struct?: CdnDomainSources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + active: cdktf.numberToTerraform(struct!.active), + http_port: cdktf.numberToTerraform(struct!.httpPort), + https_port: cdktf.numberToTerraform(struct!.httpsPort), + obs_bucket_type: cdktf.stringToTerraform(struct!.obsBucketType), + obs_web_hosting_enabled: cdktf.booleanToTerraform(struct!.obsWebHostingEnabled), + origin: cdktf.stringToTerraform(struct!.origin), + origin_type: cdktf.stringToTerraform(struct!.originType), + retrieval_host: cdktf.stringToTerraform(struct!.retrievalHost), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function cdnDomainSourcesToHclTerraform(struct?: CdnDomainSources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + active: { + value: cdktf.numberToHclTerraform(struct!.active), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + http_port: { + value: cdktf.numberToHclTerraform(struct!.httpPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + https_port: { + value: cdktf.numberToHclTerraform(struct!.httpsPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + obs_bucket_type: { + value: cdktf.stringToHclTerraform(struct!.obsBucketType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_web_hosting_enabled: { + value: cdktf.booleanToHclTerraform(struct!.obsWebHostingEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + origin: { + value: cdktf.stringToHclTerraform(struct!.origin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin_type: { + value: cdktf.stringToHclTerraform(struct!.originType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retrieval_host: { + value: cdktf.stringToHclTerraform(struct!.retrievalHost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CdnDomainSources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._active !== undefined) { + hasAnyValues = true; + internalValueResult.active = this._active; + } + if (this._httpPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpPort = this._httpPort; + } + if (this._httpsPort !== undefined) { + hasAnyValues = true; + internalValueResult.httpsPort = this._httpsPort; + } + if (this._obsBucketType !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketType = this._obsBucketType; + } + if (this._obsWebHostingEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.obsWebHostingEnabled = this._obsWebHostingEnabled; + } + if (this._origin !== undefined) { + hasAnyValues = true; + internalValueResult.origin = this._origin; + } + if (this._originType !== undefined) { + hasAnyValues = true; + internalValueResult.originType = this._originType; + } + if (this._retrievalHost !== undefined) { + hasAnyValues = true; + internalValueResult.retrievalHost = this._retrievalHost; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainSources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._active = undefined; + this._httpPort = undefined; + this._httpsPort = undefined; + this._obsBucketType = undefined; + this._obsWebHostingEnabled = undefined; + this._origin = undefined; + this._originType = undefined; + this._retrievalHost = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._active = value.active; + this._httpPort = value.httpPort; + this._httpsPort = value.httpsPort; + this._obsBucketType = value.obsBucketType; + this._obsWebHostingEnabled = value.obsWebHostingEnabled; + this._origin = value.origin; + this._originType = value.originType; + this._retrievalHost = value.retrievalHost; + this._weight = value.weight; + } + } + + // active - computed: false, optional: true, required: false + private _active?: number; + public get active() { + return this.getNumberAttribute('active'); + } + public set active(value: number) { + this._active = value; + } + public resetActive() { + this._active = undefined; + } + // Temporarily expose input value. Use with caution. + public get activeInput() { + return this._active; + } + + // http_port - computed: true, optional: true, required: false + private _httpPort?: number; + public get httpPort() { + return this.getNumberAttribute('http_port'); + } + public set httpPort(value: number) { + this._httpPort = value; + } + public resetHttpPort() { + this._httpPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpPortInput() { + return this._httpPort; + } + + // https_port - computed: true, optional: true, required: false + private _httpsPort?: number; + public get httpsPort() { + return this.getNumberAttribute('https_port'); + } + public set httpsPort(value: number) { + this._httpsPort = value; + } + public resetHttpsPort() { + this._httpsPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsPortInput() { + return this._httpsPort; + } + + // obs_bucket_type - computed: true, optional: true, required: false + private _obsBucketType?: string; + public get obsBucketType() { + return this.getStringAttribute('obs_bucket_type'); + } + public set obsBucketType(value: string) { + this._obsBucketType = value; + } + public resetObsBucketType() { + this._obsBucketType = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketTypeInput() { + return this._obsBucketType; + } + + // obs_web_hosting_enabled - computed: true, optional: true, required: false + private _obsWebHostingEnabled?: boolean | cdktf.IResolvable; + public get obsWebHostingEnabled() { + return this.getBooleanAttribute('obs_web_hosting_enabled'); + } + public set obsWebHostingEnabled(value: boolean | cdktf.IResolvable) { + this._obsWebHostingEnabled = value; + } + public resetObsWebHostingEnabled() { + this._obsWebHostingEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsWebHostingEnabledInput() { + return this._obsWebHostingEnabled; + } + + // origin - computed: false, optional: false, required: true + private _origin?: string; + public get origin() { + return this.getStringAttribute('origin'); + } + public set origin(value: string) { + this._origin = value; + } + // Temporarily expose input value. Use with caution. + public get originInput() { + return this._origin; + } + + // origin_type - computed: false, optional: false, required: true + private _originType?: string; + public get originType() { + return this.getStringAttribute('origin_type'); + } + public set originType(value: string) { + this._originType = value; + } + // Temporarily expose input value. Use with caution. + public get originTypeInput() { + return this._originType; + } + + // retrieval_host - computed: true, optional: true, required: false + private _retrievalHost?: string; + public get retrievalHost() { + return this.getStringAttribute('retrieval_host'); + } + public set retrievalHost(value: string) { + this._retrievalHost = value; + } + public resetRetrievalHost() { + this._retrievalHost = undefined; + } + // Temporarily expose input value. Use with caution. + public get retrievalHostInput() { + return this._retrievalHost; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class CdnDomainSourcesList extends cdktf.ComplexList { + public internalValue? : CdnDomainSources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CdnDomainSourcesOutputReference { + return new CdnDomainSourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CdnDomainTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#create CdnDomain#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#delete CdnDomain#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#update CdnDomain#update} + */ + readonly update?: string; +} + +export function cdnDomainTimeoutsToTerraform(struct?: CdnDomainTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cdnDomainTimeoutsToHclTerraform(struct?: CdnDomainTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CdnDomainTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CdnDomainTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CdnDomainTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain huaweicloud_cdn_domain} +*/ +export class CdnDomain extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_domain"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CdnDomain resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CdnDomain to import + * @param importFromId The id of the existing CdnDomain that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CdnDomain to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_domain", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cdn_domain huaweicloud_cdn_domain} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CdnDomainConfig + */ + public constructor(scope: Construct, id: string, config: CdnDomainConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_domain', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._serviceArea = config.serviceArea; + this._tags = config.tags; + this._type = config.type; + this._cacheSettings.internalValue = config.cacheSettings; + this._configs.internalValue = config.configs; + this._sources.internalValue = config.sources; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cname - computed: true, optional: false, required: false + public get cname() { + return this.getStringAttribute('cname'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // domain_status - computed: true, optional: false, required: false + public get domainStatus() { + return this.getStringAttribute('domain_status'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // service_area - computed: true, optional: true, required: false + private _serviceArea?: string; + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + public set serviceArea(value: string) { + this._serviceArea = value; + } + public resetServiceArea() { + this._serviceArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceAreaInput() { + return this._serviceArea; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // cache_settings - computed: false, optional: true, required: false + private _cacheSettings = new CdnDomainCacheSettingsOutputReference(this, "cache_settings"); + public get cacheSettings() { + return this._cacheSettings; + } + public putCacheSettings(value: CdnDomainCacheSettings) { + this._cacheSettings.internalValue = value; + } + public resetCacheSettings() { + this._cacheSettings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheSettingsInput() { + return this._cacheSettings.internalValue; + } + + // configs - computed: false, optional: true, required: false + private _configs = new CdnDomainConfigsOutputReference(this, "configs"); + public get configs() { + return this._configs; + } + public putConfigs(value: CdnDomainConfigs) { + this._configs.internalValue = value; + } + public resetConfigs() { + this._configs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } + + // sources - computed: false, optional: false, required: true + private _sources = new CdnDomainSourcesList(this, "sources", true); + public get sources() { + return this._sources; + } + public putSources(value: CdnDomainSources[] | cdktf.IResolvable) { + this._sources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourcesInput() { + return this._sources.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CdnDomainTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CdnDomainTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + service_area: cdktf.stringToTerraform(this._serviceArea), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + cache_settings: cdnDomainCacheSettingsToTerraform(this._cacheSettings.internalValue), + configs: cdnDomainConfigsToTerraform(this._configs.internalValue), + sources: cdktf.listMapper(cdnDomainSourcesToTerraform, true)(this._sources.internalValue), + timeouts: cdnDomainTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_area: { + value: cdktf.stringToHclTerraform(this._serviceArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cache_settings: { + value: cdnDomainCacheSettingsToHclTerraform(this._cacheSettings.internalValue), + isBlock: true, + type: "list", + storageClassType: "CdnDomainCacheSettingsList", + }, + configs: { + value: cdnDomainConfigsToHclTerraform(this._configs.internalValue), + isBlock: true, + type: "list", + storageClassType: "CdnDomainConfigsList", + }, + sources: { + value: cdktf.listMapperHcl(cdnDomainSourcesToHclTerraform, true)(this._sources.internalValue), + isBlock: true, + type: "set", + storageClassType: "CdnDomainSourcesList", + }, + timeouts: { + value: cdnDomainTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CdnDomainTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-alarm-template/README.md b/src/constructs/providers/huaweicloud/ces-alarm-template/README.md new file mode 100644 index 00000000..7a341ebe --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-alarm-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_alarm_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_alarm_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template). diff --git a/src/constructs/providers/huaweicloud/ces-alarm-template/index.ts b/src/constructs/providers/huaweicloud/ces-alarm-template/index.ts new file mode 100644 index 00000000..adf05be8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-alarm-template/index.ts @@ -0,0 +1,737 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesAlarmTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether delete the alarm rule which the alarm template associated with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#delete_associate_alarm CesAlarmTemplate#delete_associate_alarm} + */ + readonly deleteAssociateAlarm?: boolean | cdktf.IResolvable; + /** + * Specifies the description of the CES alarm template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#description CesAlarmTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#id CesAlarmTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the CES alarm template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#name CesAlarmTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#region CesAlarmTemplate#region} + */ + readonly region?: string; + /** + * Specifies the type of the CES alarm template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#type CesAlarmTemplate#type} + */ + readonly type?: number; + /** + * policies block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#policies CesAlarmTemplate#policies} + */ + readonly policies: CesAlarmTemplatePolicies[] | cdktf.IResolvable; +} +export interface CesAlarmTemplatePolicies { + /** + * Specifies the alarm level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#alarm_level CesAlarmTemplate#alarm_level} + */ + readonly alarmLevel?: number; + /** + * Specifies the comparison conditions for alarm threshold. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#comparison_operator CesAlarmTemplate#comparison_operator} + */ + readonly comparisonOperator: string; + /** + * Specifies the number of consecutive triggering of alarms. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#count CesAlarmTemplate#count} + */ + readonly count: number; + /** + * Specifies the resource dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#dimension_name CesAlarmTemplate#dimension_name} + */ + readonly dimensionName?: string; + /** + * Specifies the data rollup methods. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#filter CesAlarmTemplate#filter} + */ + readonly filter: string; + /** + * Specifies the alarm metric name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#metric_name CesAlarmTemplate#metric_name} + */ + readonly metricName: string; + /** + * Specifies the namespace of the service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#namespace CesAlarmTemplate#namespace} + */ + readonly namespace: string; + /** + * Specifies the judgment period of alarm condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#period CesAlarmTemplate#period} + */ + readonly period: number; + /** + * Specifies the alarm suppression cycle. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#suppress_duration CesAlarmTemplate#suppress_duration} + */ + readonly suppressDuration: number; + /** + * Specifies the unit string of the alarm threshold. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#unit CesAlarmTemplate#unit} + */ + readonly unit?: string; + /** + * Specifies the alarm threshold. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#value CesAlarmTemplate#value} + */ + readonly value: number; +} + +export function cesAlarmTemplatePoliciesToTerraform(struct?: CesAlarmTemplatePolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_level: cdktf.numberToTerraform(struct!.alarmLevel), + comparison_operator: cdktf.stringToTerraform(struct!.comparisonOperator), + count: cdktf.numberToTerraform(struct!.count), + dimension_name: cdktf.stringToTerraform(struct!.dimensionName), + filter: cdktf.stringToTerraform(struct!.filter), + metric_name: cdktf.stringToTerraform(struct!.metricName), + namespace: cdktf.stringToTerraform(struct!.namespace), + period: cdktf.numberToTerraform(struct!.period), + suppress_duration: cdktf.numberToTerraform(struct!.suppressDuration), + unit: cdktf.stringToTerraform(struct!.unit), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function cesAlarmTemplatePoliciesToHclTerraform(struct?: CesAlarmTemplatePolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_level: { + value: cdktf.numberToHclTerraform(struct!.alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + comparison_operator: { + value: cdktf.stringToHclTerraform(struct!.comparisonOperator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dimension_name: { + value: cdktf.stringToHclTerraform(struct!.dimensionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter: { + value: cdktf.stringToHclTerraform(struct!.filter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(struct!.namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + suppress_duration: { + value: cdktf.numberToHclTerraform(struct!.suppressDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + unit: { + value: cdktf.stringToHclTerraform(struct!.unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmTemplatePoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmTemplatePolicies | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmLevel !== undefined) { + hasAnyValues = true; + internalValueResult.alarmLevel = this._alarmLevel; + } + if (this._comparisonOperator !== undefined) { + hasAnyValues = true; + internalValueResult.comparisonOperator = this._comparisonOperator; + } + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._dimensionName !== undefined) { + hasAnyValues = true; + internalValueResult.dimensionName = this._dimensionName; + } + if (this._filter !== undefined) { + hasAnyValues = true; + internalValueResult.filter = this._filter; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._namespace !== undefined) { + hasAnyValues = true; + internalValueResult.namespace = this._namespace; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._suppressDuration !== undefined) { + hasAnyValues = true; + internalValueResult.suppressDuration = this._suppressDuration; + } + if (this._unit !== undefined) { + hasAnyValues = true; + internalValueResult.unit = this._unit; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmTemplatePolicies | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._alarmLevel = undefined; + this._comparisonOperator = undefined; + this._count = undefined; + this._dimensionName = undefined; + this._filter = undefined; + this._metricName = undefined; + this._namespace = undefined; + this._period = undefined; + this._suppressDuration = undefined; + this._unit = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._alarmLevel = value.alarmLevel; + this._comparisonOperator = value.comparisonOperator; + this._count = value.count; + this._dimensionName = value.dimensionName; + this._filter = value.filter; + this._metricName = value.metricName; + this._namespace = value.namespace; + this._period = value.period; + this._suppressDuration = value.suppressDuration; + this._unit = value.unit; + this._value = value.value; + } + } + + // alarm_level - computed: true, optional: true, required: false + private _alarmLevel?: number; + public get alarmLevel() { + return this.getNumberAttribute('alarm_level'); + } + public set alarmLevel(value: number) { + this._alarmLevel = value; + } + public resetAlarmLevel() { + this._alarmLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // comparison_operator - computed: false, optional: false, required: true + private _comparisonOperator?: string; + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + public set comparisonOperator(value: string) { + this._comparisonOperator = value; + } + // Temporarily expose input value. Use with caution. + public get comparisonOperatorInput() { + return this._comparisonOperator; + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // dimension_name - computed: false, optional: true, required: false + private _dimensionName?: string; + public get dimensionName() { + return this.getStringAttribute('dimension_name'); + } + public set dimensionName(value: string) { + this._dimensionName = value; + } + public resetDimensionName() { + this._dimensionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionNameInput() { + return this._dimensionName; + } + + // filter - computed: false, optional: false, required: true + private _filter?: string; + public get filter() { + return this.getStringAttribute('filter'); + } + public set filter(value: string) { + this._filter = value; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter; + } + + // metric_name - computed: false, optional: false, required: true + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // suppress_duration - computed: false, optional: false, required: true + private _suppressDuration?: number; + public get suppressDuration() { + return this.getNumberAttribute('suppress_duration'); + } + public set suppressDuration(value: number) { + this._suppressDuration = value; + } + // Temporarily expose input value. Use with caution. + public get suppressDurationInput() { + return this._suppressDuration; + } + + // unit - computed: true, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } + + // value - computed: false, optional: false, required: true + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CesAlarmTemplatePoliciesList extends cdktf.ComplexList { + public internalValue? : CesAlarmTemplatePolicies[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmTemplatePoliciesOutputReference { + return new CesAlarmTemplatePoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template huaweicloud_ces_alarm_template} +*/ +export class CesAlarmTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_alarm_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesAlarmTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesAlarmTemplate to import + * @param importFromId The id of the existing CesAlarmTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesAlarmTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_alarm_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarm_template huaweicloud_ces_alarm_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesAlarmTemplateConfig + */ + public constructor(scope: Construct, id: string, config: CesAlarmTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_alarm_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteAssociateAlarm = config.deleteAssociateAlarm; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._policies.internalValue = config.policies; + } + + // ========== + // ATTRIBUTES + // ========== + + // association_alarm_total - computed: true, optional: false, required: false + public get associationAlarmTotal() { + return this.getNumberAttribute('association_alarm_total'); + } + + // delete_associate_alarm - computed: false, optional: true, required: false + private _deleteAssociateAlarm?: boolean | cdktf.IResolvable; + public get deleteAssociateAlarm() { + return this.getBooleanAttribute('delete_associate_alarm'); + } + public set deleteAssociateAlarm(value: boolean | cdktf.IResolvable) { + this._deleteAssociateAlarm = value; + } + public resetDeleteAssociateAlarm() { + this._deleteAssociateAlarm = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteAssociateAlarmInput() { + return this._deleteAssociateAlarm; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // policies - computed: false, optional: false, required: true + private _policies = new CesAlarmTemplatePoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + public putPolicies(value: CesAlarmTemplatePolicies[] | cdktf.IResolvable) { + this._policies.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get policiesInput() { + return this._policies.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_associate_alarm: cdktf.booleanToTerraform(this._deleteAssociateAlarm), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.numberToTerraform(this._type), + policies: cdktf.listMapper(cesAlarmTemplatePoliciesToTerraform, true)(this._policies.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_associate_alarm: { + value: cdktf.booleanToHclTerraform(this._deleteAssociateAlarm), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + policies: { + value: cdktf.listMapperHcl(cesAlarmTemplatePoliciesToHclTerraform, true)(this._policies.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesAlarmTemplatePoliciesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-alarmrule/README.md b/src/constructs/providers/huaweicloud/ces-alarmrule/README.md new file mode 100644 index 00000000..b9a966b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-alarmrule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_alarmrule` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_alarmrule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule). diff --git a/src/constructs/providers/huaweicloud/ces-alarmrule/index.ts b/src/constructs/providers/huaweicloud/ces-alarmrule/index.ts new file mode 100644 index 00000000..27443d88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-alarmrule/index.ts @@ -0,0 +1,2156 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesAlarmruleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_action_enabled CesAlarmrule#alarm_action_enabled} + */ + readonly alarmActionEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_description CesAlarmrule#alarm_description} + */ + readonly alarmDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_enabled CesAlarmrule#alarm_enabled} + */ + readonly alarmEnabled?: boolean | cdktf.IResolvable; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_level CesAlarmrule#alarm_level} + */ + readonly alarmLevel?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_name CesAlarmrule#alarm_name} + */ + readonly alarmName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_type CesAlarmrule#alarm_type} + */ + readonly alarmType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#enterprise_project_id CesAlarmrule#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#id CesAlarmrule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#notification_begin_time CesAlarmrule#notification_begin_time} + */ + readonly notificationBeginTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#notification_end_time CesAlarmrule#notification_end_time} + */ + readonly notificationEndTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#region CesAlarmrule#region} + */ + readonly region?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#resource_group_id CesAlarmrule#resource_group_id} + */ + readonly resourceGroupId?: string; + /** + * alarm_actions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_actions CesAlarmrule#alarm_actions} + */ + readonly alarmActions?: CesAlarmruleAlarmActions[] | cdktf.IResolvable; + /** + * condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#condition CesAlarmrule#condition} + */ + readonly condition: CesAlarmruleCondition[] | cdktf.IResolvable; + /** + * insufficientdata_actions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#insufficientdata_actions CesAlarmrule#insufficientdata_actions} + */ + readonly insufficientdataActions?: CesAlarmruleInsufficientdataActions[] | cdktf.IResolvable; + /** + * metric block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#metric CesAlarmrule#metric} + */ + readonly metric: CesAlarmruleMetric; + /** + * ok_actions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#ok_actions CesAlarmrule#ok_actions} + */ + readonly okActions?: CesAlarmruleOkActions[] | cdktf.IResolvable; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#resources CesAlarmrule#resources} + */ + readonly resources?: CesAlarmruleResources[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#timeouts CesAlarmrule#timeouts} + */ + readonly timeouts?: CesAlarmruleTimeouts; +} +export interface CesAlarmruleAlarmActions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#notification_list CesAlarmrule#notification_list} + */ + readonly notificationList: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#type CesAlarmrule#type} + */ + readonly type: string; +} + +export function cesAlarmruleAlarmActionsToTerraform(struct?: CesAlarmruleAlarmActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + notification_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.notificationList), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cesAlarmruleAlarmActionsToHclTerraform(struct?: CesAlarmruleAlarmActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + notification_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.notificationList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleAlarmActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleAlarmActions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._notificationList !== undefined) { + hasAnyValues = true; + internalValueResult.notificationList = this._notificationList; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleAlarmActions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._notificationList = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._notificationList = value.notificationList; + this._type = value.type; + } + } + + // notification_list - computed: false, optional: false, required: true + private _notificationList?: string[]; + public get notificationList() { + return this.getListAttribute('notification_list'); + } + public set notificationList(value: string[]) { + this._notificationList = value; + } + // Temporarily expose input value. Use with caution. + public get notificationListInput() { + return this._notificationList; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CesAlarmruleAlarmActionsList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleAlarmActions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleAlarmActionsOutputReference { + return new CesAlarmruleAlarmActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleCondition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#alarm_level CesAlarmrule#alarm_level} + */ + readonly alarmLevel?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#comparison_operator CesAlarmrule#comparison_operator} + */ + readonly comparisonOperator: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#count CesAlarmrule#count} + */ + readonly count: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#filter CesAlarmrule#filter} + */ + readonly filter: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#metric_name CesAlarmrule#metric_name} + */ + readonly metricName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#period CesAlarmrule#period} + */ + readonly period: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#suppress_duration CesAlarmrule#suppress_duration} + */ + readonly suppressDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#unit CesAlarmrule#unit} + */ + readonly unit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#value CesAlarmrule#value} + */ + readonly value: number; +} + +export function cesAlarmruleConditionToTerraform(struct?: CesAlarmruleCondition | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alarm_level: cdktf.numberToTerraform(struct!.alarmLevel), + comparison_operator: cdktf.stringToTerraform(struct!.comparisonOperator), + count: cdktf.numberToTerraform(struct!.count), + filter: cdktf.stringToTerraform(struct!.filter), + metric_name: cdktf.stringToTerraform(struct!.metricName), + period: cdktf.numberToTerraform(struct!.period), + suppress_duration: cdktf.numberToTerraform(struct!.suppressDuration), + unit: cdktf.stringToTerraform(struct!.unit), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function cesAlarmruleConditionToHclTerraform(struct?: CesAlarmruleCondition | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alarm_level: { + value: cdktf.numberToHclTerraform(struct!.alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + comparison_operator: { + value: cdktf.stringToHclTerraform(struct!.comparisonOperator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + filter: { + value: cdktf.stringToHclTerraform(struct!.filter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + suppress_duration: { + value: cdktf.numberToHclTerraform(struct!.suppressDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + unit: { + value: cdktf.stringToHclTerraform(struct!.unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleCondition | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alarmLevel !== undefined) { + hasAnyValues = true; + internalValueResult.alarmLevel = this._alarmLevel; + } + if (this._comparisonOperator !== undefined) { + hasAnyValues = true; + internalValueResult.comparisonOperator = this._comparisonOperator; + } + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._filter !== undefined) { + hasAnyValues = true; + internalValueResult.filter = this._filter; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._suppressDuration !== undefined) { + hasAnyValues = true; + internalValueResult.suppressDuration = this._suppressDuration; + } + if (this._unit !== undefined) { + hasAnyValues = true; + internalValueResult.unit = this._unit; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleCondition | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._alarmLevel = undefined; + this._comparisonOperator = undefined; + this._count = undefined; + this._filter = undefined; + this._metricName = undefined; + this._period = undefined; + this._suppressDuration = undefined; + this._unit = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._alarmLevel = value.alarmLevel; + this._comparisonOperator = value.comparisonOperator; + this._count = value.count; + this._filter = value.filter; + this._metricName = value.metricName; + this._period = value.period; + this._suppressDuration = value.suppressDuration; + this._unit = value.unit; + this._value = value.value; + } + } + + // alarm_level - computed: true, optional: true, required: false + private _alarmLevel?: number; + public get alarmLevel() { + return this.getNumberAttribute('alarm_level'); + } + public set alarmLevel(value: number) { + this._alarmLevel = value; + } + public resetAlarmLevel() { + this._alarmLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // comparison_operator - computed: false, optional: false, required: true + private _comparisonOperator?: string; + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + public set comparisonOperator(value: string) { + this._comparisonOperator = value; + } + // Temporarily expose input value. Use with caution. + public get comparisonOperatorInput() { + return this._comparisonOperator; + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // filter - computed: false, optional: false, required: true + private _filter?: string; + public get filter() { + return this.getStringAttribute('filter'); + } + public set filter(value: string) { + this._filter = value; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter; + } + + // metric_name - computed: true, optional: true, required: false + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + public resetMetricName() { + this._metricName = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // suppress_duration - computed: false, optional: true, required: false + private _suppressDuration?: number; + public get suppressDuration() { + return this.getNumberAttribute('suppress_duration'); + } + public set suppressDuration(value: number) { + this._suppressDuration = value; + } + public resetSuppressDuration() { + this._suppressDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get suppressDurationInput() { + return this._suppressDuration; + } + + // unit - computed: false, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } + + // value - computed: false, optional: false, required: true + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CesAlarmruleConditionList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleCondition[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleConditionOutputReference { + return new CesAlarmruleConditionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleInsufficientdataActions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#notification_list CesAlarmrule#notification_list} + */ + readonly notificationList: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#type CesAlarmrule#type} + */ + readonly type: string; +} + +export function cesAlarmruleInsufficientdataActionsToTerraform(struct?: CesAlarmruleInsufficientdataActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + notification_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.notificationList), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cesAlarmruleInsufficientdataActionsToHclTerraform(struct?: CesAlarmruleInsufficientdataActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + notification_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.notificationList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleInsufficientdataActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleInsufficientdataActions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._notificationList !== undefined) { + hasAnyValues = true; + internalValueResult.notificationList = this._notificationList; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleInsufficientdataActions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._notificationList = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._notificationList = value.notificationList; + this._type = value.type; + } + } + + // notification_list - computed: false, optional: false, required: true + private _notificationList?: string[]; + public get notificationList() { + return this.getListAttribute('notification_list'); + } + public set notificationList(value: string[]) { + this._notificationList = value; + } + // Temporarily expose input value. Use with caution. + public get notificationListInput() { + return this._notificationList; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CesAlarmruleInsufficientdataActionsList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleInsufficientdataActions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleInsufficientdataActionsOutputReference { + return new CesAlarmruleInsufficientdataActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleMetricDimensions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#name CesAlarmrule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#value CesAlarmrule#value} + */ + readonly value?: string; +} + +export function cesAlarmruleMetricDimensionsToTerraform(struct?: CesAlarmruleMetricDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cesAlarmruleMetricDimensionsToHclTerraform(struct?: CesAlarmruleMetricDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleMetricDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleMetricDimensions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleMetricDimensions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CesAlarmruleMetricDimensionsList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleMetricDimensions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleMetricDimensionsOutputReference { + return new CesAlarmruleMetricDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleMetric { + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#metric_name CesAlarmrule#metric_name} + */ + readonly metricName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#namespace CesAlarmrule#namespace} + */ + readonly namespace: string; + /** + * dimensions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#dimensions CesAlarmrule#dimensions} + */ + readonly dimensions?: CesAlarmruleMetricDimensions[] | cdktf.IResolvable; +} + +export function cesAlarmruleMetricToTerraform(struct?: CesAlarmruleMetricOutputReference | CesAlarmruleMetric): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + metric_name: cdktf.stringToTerraform(struct!.metricName), + namespace: cdktf.stringToTerraform(struct!.namespace), + dimensions: cdktf.listMapper(cesAlarmruleMetricDimensionsToTerraform, true)(struct!.dimensions), + } +} + + +export function cesAlarmruleMetricToHclTerraform(struct?: CesAlarmruleMetricOutputReference | CesAlarmruleMetric): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(struct!.namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimensions: { + value: cdktf.listMapperHcl(cesAlarmruleMetricDimensionsToHclTerraform, true)(struct!.dimensions), + isBlock: true, + type: "set", + storageClassType: "CesAlarmruleMetricDimensionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleMetricOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CesAlarmruleMetric | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._namespace !== undefined) { + hasAnyValues = true; + internalValueResult.namespace = this._namespace; + } + if (this._dimensions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dimensions = this._dimensions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleMetric | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._metricName = undefined; + this._namespace = undefined; + this._dimensions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._metricName = value.metricName; + this._namespace = value.namespace; + this._dimensions.internalValue = value.dimensions; + } + } + + // metric_name - computed: true, optional: true, required: false + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + public resetMetricName() { + this._metricName = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // dimensions - computed: false, optional: true, required: false + private _dimensions = new CesAlarmruleMetricDimensionsList(this, "dimensions", true); + public get dimensions() { + return this._dimensions; + } + public putDimensions(value: CesAlarmruleMetricDimensions[] | cdktf.IResolvable) { + this._dimensions.internalValue = value; + } + public resetDimensions() { + this._dimensions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions.internalValue; + } +} +export interface CesAlarmruleOkActions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#notification_list CesAlarmrule#notification_list} + */ + readonly notificationList: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#type CesAlarmrule#type} + */ + readonly type: string; +} + +export function cesAlarmruleOkActionsToTerraform(struct?: CesAlarmruleOkActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + notification_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.notificationList), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cesAlarmruleOkActionsToHclTerraform(struct?: CesAlarmruleOkActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + notification_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.notificationList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleOkActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleOkActions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._notificationList !== undefined) { + hasAnyValues = true; + internalValueResult.notificationList = this._notificationList; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleOkActions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._notificationList = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._notificationList = value.notificationList; + this._type = value.type; + } + } + + // notification_list - computed: false, optional: false, required: true + private _notificationList?: string[]; + public get notificationList() { + return this.getListAttribute('notification_list'); + } + public set notificationList(value: string[]) { + this._notificationList = value; + } + // Temporarily expose input value. Use with caution. + public get notificationListInput() { + return this._notificationList; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CesAlarmruleOkActionsList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleOkActions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleOkActionsOutputReference { + return new CesAlarmruleOkActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleResourcesDimensions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#name CesAlarmrule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#value CesAlarmrule#value} + */ + readonly value?: string; +} + +export function cesAlarmruleResourcesDimensionsToTerraform(struct?: CesAlarmruleResourcesDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cesAlarmruleResourcesDimensionsToHclTerraform(struct?: CesAlarmruleResourcesDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleResourcesDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleResourcesDimensions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleResourcesDimensions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CesAlarmruleResourcesDimensionsList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleResourcesDimensions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleResourcesDimensionsOutputReference { + return new CesAlarmruleResourcesDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleResources { + /** + * dimensions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#dimensions CesAlarmrule#dimensions} + */ + readonly dimensions?: CesAlarmruleResourcesDimensions[] | cdktf.IResolvable; +} + +export function cesAlarmruleResourcesToTerraform(struct?: CesAlarmruleResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dimensions: cdktf.listMapper(cesAlarmruleResourcesDimensionsToTerraform, true)(struct!.dimensions), + } +} + + +export function cesAlarmruleResourcesToHclTerraform(struct?: CesAlarmruleResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dimensions: { + value: cdktf.listMapperHcl(cesAlarmruleResourcesDimensionsToHclTerraform, true)(struct!.dimensions), + isBlock: true, + type: "list", + storageClassType: "CesAlarmruleResourcesDimensionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesAlarmruleResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dimensions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dimensions = this._dimensions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dimensions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dimensions.internalValue = value.dimensions; + } + } + + // dimensions - computed: false, optional: true, required: false + private _dimensions = new CesAlarmruleResourcesDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + public putDimensions(value: CesAlarmruleResourcesDimensions[] | cdktf.IResolvable) { + this._dimensions.internalValue = value; + } + public resetDimensions() { + this._dimensions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions.internalValue; + } +} + +export class CesAlarmruleResourcesList extends cdktf.ComplexList { + public internalValue? : CesAlarmruleResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesAlarmruleResourcesOutputReference { + return new CesAlarmruleResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesAlarmruleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#create CesAlarmrule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#delete CesAlarmrule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#update CesAlarmrule#update} + */ + readonly update?: string; +} + +export function cesAlarmruleTimeoutsToTerraform(struct?: CesAlarmruleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cesAlarmruleTimeoutsToHclTerraform(struct?: CesAlarmruleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesAlarmruleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CesAlarmruleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesAlarmruleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule huaweicloud_ces_alarmrule} +*/ +export class CesAlarmrule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_alarmrule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesAlarmrule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesAlarmrule to import + * @param importFromId The id of the existing CesAlarmrule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesAlarmrule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_alarmrule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_alarmrule huaweicloud_ces_alarmrule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesAlarmruleConfig + */ + public constructor(scope: Construct, id: string, config: CesAlarmruleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_alarmrule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmActionEnabled = config.alarmActionEnabled; + this._alarmDescription = config.alarmDescription; + this._alarmEnabled = config.alarmEnabled; + this._alarmLevel = config.alarmLevel; + this._alarmName = config.alarmName; + this._alarmType = config.alarmType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._notificationBeginTime = config.notificationBeginTime; + this._notificationEndTime = config.notificationEndTime; + this._region = config.region; + this._resourceGroupId = config.resourceGroupId; + this._alarmActions.internalValue = config.alarmActions; + this._condition.internalValue = config.condition; + this._insufficientdataActions.internalValue = config.insufficientdataActions; + this._metric.internalValue = config.metric; + this._okActions.internalValue = config.okActions; + this._resources.internalValue = config.resources; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_action_enabled - computed: false, optional: true, required: false + private _alarmActionEnabled?: boolean | cdktf.IResolvable; + public get alarmActionEnabled() { + return this.getBooleanAttribute('alarm_action_enabled'); + } + public set alarmActionEnabled(value: boolean | cdktf.IResolvable) { + this._alarmActionEnabled = value; + } + public resetAlarmActionEnabled() { + this._alarmActionEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmActionEnabledInput() { + return this._alarmActionEnabled; + } + + // alarm_description - computed: false, optional: true, required: false + private _alarmDescription?: string; + public get alarmDescription() { + return this.getStringAttribute('alarm_description'); + } + public set alarmDescription(value: string) { + this._alarmDescription = value; + } + public resetAlarmDescription() { + this._alarmDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmDescriptionInput() { + return this._alarmDescription; + } + + // alarm_enabled - computed: false, optional: true, required: false + private _alarmEnabled?: boolean | cdktf.IResolvable; + public get alarmEnabled() { + return this.getBooleanAttribute('alarm_enabled'); + } + public set alarmEnabled(value: boolean | cdktf.IResolvable) { + this._alarmEnabled = value; + } + public resetAlarmEnabled() { + this._alarmEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmEnabledInput() { + return this._alarmEnabled; + } + + // alarm_level - computed: true, optional: true, required: false + private _alarmLevel?: number; + public get alarmLevel() { + return this.getNumberAttribute('alarm_level'); + } + public set alarmLevel(value: number) { + this._alarmLevel = value; + } + public resetAlarmLevel() { + this._alarmLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // alarm_name - computed: false, optional: false, required: true + private _alarmName?: string; + public get alarmName() { + return this.getStringAttribute('alarm_name'); + } + public set alarmName(value: string) { + this._alarmName = value; + } + // Temporarily expose input value. Use with caution. + public get alarmNameInput() { + return this._alarmName; + } + + // alarm_state - computed: true, optional: false, required: false + public get alarmState() { + return this.getStringAttribute('alarm_state'); + } + + // alarm_type - computed: false, optional: true, required: false + private _alarmType?: string; + public get alarmType() { + return this.getStringAttribute('alarm_type'); + } + public set alarmType(value: string) { + this._alarmType = value; + } + public resetAlarmType() { + this._alarmType = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmTypeInput() { + return this._alarmType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // notification_begin_time - computed: true, optional: true, required: false + private _notificationBeginTime?: string; + public get notificationBeginTime() { + return this.getStringAttribute('notification_begin_time'); + } + public set notificationBeginTime(value: string) { + this._notificationBeginTime = value; + } + public resetNotificationBeginTime() { + this._notificationBeginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationBeginTimeInput() { + return this._notificationBeginTime; + } + + // notification_end_time - computed: true, optional: true, required: false + private _notificationEndTime?: string; + public get notificationEndTime() { + return this.getStringAttribute('notification_end_time'); + } + public set notificationEndTime(value: string) { + this._notificationEndTime = value; + } + public resetNotificationEndTime() { + this._notificationEndTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationEndTimeInput() { + return this._notificationEndTime; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_group_id - computed: true, optional: true, required: false + private _resourceGroupId?: string; + public get resourceGroupId() { + return this.getStringAttribute('resource_group_id'); + } + public set resourceGroupId(value: string) { + this._resourceGroupId = value; + } + public resetResourceGroupId() { + this._resourceGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceGroupIdInput() { + return this._resourceGroupId; + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getNumberAttribute('update_time'); + } + + // alarm_actions - computed: false, optional: true, required: false + private _alarmActions = new CesAlarmruleAlarmActionsList(this, "alarm_actions", false); + public get alarmActions() { + return this._alarmActions; + } + public putAlarmActions(value: CesAlarmruleAlarmActions[] | cdktf.IResolvable) { + this._alarmActions.internalValue = value; + } + public resetAlarmActions() { + this._alarmActions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmActionsInput() { + return this._alarmActions.internalValue; + } + + // condition - computed: false, optional: false, required: true + private _condition = new CesAlarmruleConditionList(this, "condition", true); + public get condition() { + return this._condition; + } + public putCondition(value: CesAlarmruleCondition[] | cdktf.IResolvable) { + this._condition.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition.internalValue; + } + + // insufficientdata_actions - computed: false, optional: true, required: false + private _insufficientdataActions = new CesAlarmruleInsufficientdataActionsList(this, "insufficientdata_actions", false); + public get insufficientdataActions() { + return this._insufficientdataActions; + } + public putInsufficientdataActions(value: CesAlarmruleInsufficientdataActions[] | cdktf.IResolvable) { + this._insufficientdataActions.internalValue = value; + } + public resetInsufficientdataActions() { + this._insufficientdataActions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get insufficientdataActionsInput() { + return this._insufficientdataActions.internalValue; + } + + // metric - computed: false, optional: false, required: true + private _metric = new CesAlarmruleMetricOutputReference(this, "metric"); + public get metric() { + return this._metric; + } + public putMetric(value: CesAlarmruleMetric) { + this._metric.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get metricInput() { + return this._metric.internalValue; + } + + // ok_actions - computed: false, optional: true, required: false + private _okActions = new CesAlarmruleOkActionsList(this, "ok_actions", false); + public get okActions() { + return this._okActions; + } + public putOkActions(value: CesAlarmruleOkActions[] | cdktf.IResolvable) { + this._okActions.internalValue = value; + } + public resetOkActions() { + this._okActions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get okActionsInput() { + return this._okActions.internalValue; + } + + // resources - computed: false, optional: true, required: false + private _resources = new CesAlarmruleResourcesList(this, "resources", true); + public get resources() { + return this._resources; + } + public putResources(value: CesAlarmruleResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CesAlarmruleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CesAlarmruleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_action_enabled: cdktf.booleanToTerraform(this._alarmActionEnabled), + alarm_description: cdktf.stringToTerraform(this._alarmDescription), + alarm_enabled: cdktf.booleanToTerraform(this._alarmEnabled), + alarm_level: cdktf.numberToTerraform(this._alarmLevel), + alarm_name: cdktf.stringToTerraform(this._alarmName), + alarm_type: cdktf.stringToTerraform(this._alarmType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + notification_begin_time: cdktf.stringToTerraform(this._notificationBeginTime), + notification_end_time: cdktf.stringToTerraform(this._notificationEndTime), + region: cdktf.stringToTerraform(this._region), + resource_group_id: cdktf.stringToTerraform(this._resourceGroupId), + alarm_actions: cdktf.listMapper(cesAlarmruleAlarmActionsToTerraform, true)(this._alarmActions.internalValue), + condition: cdktf.listMapper(cesAlarmruleConditionToTerraform, true)(this._condition.internalValue), + insufficientdata_actions: cdktf.listMapper(cesAlarmruleInsufficientdataActionsToTerraform, true)(this._insufficientdataActions.internalValue), + metric: cesAlarmruleMetricToTerraform(this._metric.internalValue), + ok_actions: cdktf.listMapper(cesAlarmruleOkActionsToTerraform, true)(this._okActions.internalValue), + resources: cdktf.listMapper(cesAlarmruleResourcesToTerraform, true)(this._resources.internalValue), + timeouts: cesAlarmruleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_action_enabled: { + value: cdktf.booleanToHclTerraform(this._alarmActionEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + alarm_description: { + value: cdktf.stringToHclTerraform(this._alarmDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_enabled: { + value: cdktf.booleanToHclTerraform(this._alarmEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + alarm_level: { + value: cdktf.numberToHclTerraform(this._alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + alarm_name: { + value: cdktf.stringToHclTerraform(this._alarmName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_type: { + value: cdktf.stringToHclTerraform(this._alarmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_begin_time: { + value: cdktf.stringToHclTerraform(this._notificationBeginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_end_time: { + value: cdktf.stringToHclTerraform(this._notificationEndTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_group_id: { + value: cdktf.stringToHclTerraform(this._resourceGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_actions: { + value: cdktf.listMapperHcl(cesAlarmruleAlarmActionsToHclTerraform, true)(this._alarmActions.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesAlarmruleAlarmActionsList", + }, + condition: { + value: cdktf.listMapperHcl(cesAlarmruleConditionToHclTerraform, true)(this._condition.internalValue), + isBlock: true, + type: "set", + storageClassType: "CesAlarmruleConditionList", + }, + insufficientdata_actions: { + value: cdktf.listMapperHcl(cesAlarmruleInsufficientdataActionsToHclTerraform, true)(this._insufficientdataActions.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesAlarmruleInsufficientdataActionsList", + }, + metric: { + value: cesAlarmruleMetricToHclTerraform(this._metric.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesAlarmruleMetricList", + }, + ok_actions: { + value: cdktf.listMapperHcl(cesAlarmruleOkActionsToHclTerraform, true)(this._okActions.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesAlarmruleOkActionsList", + }, + resources: { + value: cdktf.listMapperHcl(cesAlarmruleResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "set", + storageClassType: "CesAlarmruleResourcesList", + }, + timeouts: { + value: cesAlarmruleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CesAlarmruleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-dashboard-widget/README.md b/src/constructs/providers/huaweicloud/ces-dashboard-widget/README.md new file mode 100644 index 00000000..8486dedb --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-dashboard-widget/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_dashboard_widget` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_dashboard_widget`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget). diff --git a/src/constructs/providers/huaweicloud/ces-dashboard-widget/index.ts b/src/constructs/providers/huaweicloud/ces-dashboard-widget/index.ts new file mode 100644 index 00000000..a557e491 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-dashboard-widget/index.ts @@ -0,0 +1,1067 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesDashboardWidgetConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the dashboard ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#dashboard_id CesDashboardWidget#dashboard_id} + */ + readonly dashboardId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#id CesDashboardWidget#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies how many metrics will be displayed on one widget. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#metric_display_mode CesDashboardWidget#metric_display_mode} + */ + readonly metricDisplayMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#region CesDashboardWidget#region} + */ + readonly region?: string; + /** + * Specifies the dashboard widget title. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#title CesDashboardWidget#title} + */ + readonly title: string; + /** + * Specifies the metric unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#unit CesDashboardWidget#unit} + */ + readonly unit?: string; + /** + * Specifies the graph type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#view CesDashboardWidget#view} + */ + readonly view: string; + /** + * location block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#location CesDashboardWidget#location} + */ + readonly location: CesDashboardWidgetLocation; + /** + * metrics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#metrics CesDashboardWidget#metrics} + */ + readonly metrics: CesDashboardWidgetMetrics[] | cdktf.IResolvable; + /** + * properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#properties CesDashboardWidget#properties} + */ + readonly properties?: CesDashboardWidgetProperties; +} +export interface CesDashboardWidgetLocation { + /** + * Specifies the dashboard widget height. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#height CesDashboardWidget#height} + */ + readonly height: number; + /** + * Specifies the grids between the widget and the left side of the dashboard. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#left CesDashboardWidget#left} + */ + readonly left: number; + /** + * Specifies the grids between the widget and the top of the dashboard. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#top CesDashboardWidget#top} + */ + readonly top: number; + /** + * Specifies the dashboard widget width. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#width CesDashboardWidget#width} + */ + readonly width: number; +} + +export function cesDashboardWidgetLocationToTerraform(struct?: CesDashboardWidgetLocationOutputReference | CesDashboardWidgetLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + height: cdktf.numberToTerraform(struct!.height), + left: cdktf.numberToTerraform(struct!.left), + top: cdktf.numberToTerraform(struct!.top), + width: cdktf.numberToTerraform(struct!.width), + } +} + + +export function cesDashboardWidgetLocationToHclTerraform(struct?: CesDashboardWidgetLocationOutputReference | CesDashboardWidgetLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + height: { + value: cdktf.numberToHclTerraform(struct!.height), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + left: { + value: cdktf.numberToHclTerraform(struct!.left), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + top: { + value: cdktf.numberToHclTerraform(struct!.top), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + width: { + value: cdktf.numberToHclTerraform(struct!.width), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesDashboardWidgetLocationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CesDashboardWidgetLocation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._height !== undefined) { + hasAnyValues = true; + internalValueResult.height = this._height; + } + if (this._left !== undefined) { + hasAnyValues = true; + internalValueResult.left = this._left; + } + if (this._top !== undefined) { + hasAnyValues = true; + internalValueResult.top = this._top; + } + if (this._width !== undefined) { + hasAnyValues = true; + internalValueResult.width = this._width; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesDashboardWidgetLocation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._height = undefined; + this._left = undefined; + this._top = undefined; + this._width = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._height = value.height; + this._left = value.left; + this._top = value.top; + this._width = value.width; + } + } + + // height - computed: false, optional: false, required: true + private _height?: number; + public get height() { + return this.getNumberAttribute('height'); + } + public set height(value: number) { + this._height = value; + } + // Temporarily expose input value. Use with caution. + public get heightInput() { + return this._height; + } + + // left - computed: false, optional: false, required: true + private _left?: number; + public get left() { + return this.getNumberAttribute('left'); + } + public set left(value: number) { + this._left = value; + } + // Temporarily expose input value. Use with caution. + public get leftInput() { + return this._left; + } + + // top - computed: false, optional: false, required: true + private _top?: number; + public get top() { + return this.getNumberAttribute('top'); + } + public set top(value: number) { + this._top = value; + } + // Temporarily expose input value. Use with caution. + public get topInput() { + return this._top; + } + + // width - computed: false, optional: false, required: true + private _width?: number; + public get width() { + return this.getNumberAttribute('width'); + } + public set width(value: number) { + this._width = value; + } + // Temporarily expose input value. Use with caution. + public get widthInput() { + return this._width; + } +} +export interface CesDashboardWidgetMetricsDimensions { + /** + * Specifies the resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#filter_type CesDashboardWidget#filter_type} + */ + readonly filterType: string; + /** + * Specifies the dimension name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#name CesDashboardWidget#name} + */ + readonly name: string; + /** + * Specifies the dimension value list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#values CesDashboardWidget#values} + */ + readonly values?: string[]; +} + +export function cesDashboardWidgetMetricsDimensionsToTerraform(struct?: CesDashboardWidgetMetricsDimensionsOutputReference | CesDashboardWidgetMetricsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + filter_type: cdktf.stringToTerraform(struct!.filterType), + name: cdktf.stringToTerraform(struct!.name), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function cesDashboardWidgetMetricsDimensionsToHclTerraform(struct?: CesDashboardWidgetMetricsDimensionsOutputReference | CesDashboardWidgetMetricsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + filter_type: { + value: cdktf.stringToHclTerraform(struct!.filterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesDashboardWidgetMetricsDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CesDashboardWidgetMetricsDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._filterType !== undefined) { + hasAnyValues = true; + internalValueResult.filterType = this._filterType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesDashboardWidgetMetricsDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._filterType = undefined; + this._name = undefined; + this._values = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._filterType = value.filterType; + this._name = value.name; + this._values = value.values; + } + } + + // filter_type - computed: false, optional: false, required: true + private _filterType?: string; + public get filterType() { + return this.getStringAttribute('filter_type'); + } + public set filterType(value: string) { + this._filterType = value; + } + // Temporarily expose input value. Use with caution. + public get filterTypeInput() { + return this._filterType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // values - computed: false, optional: true, required: false + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + public resetValues() { + this._values = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} +export interface CesDashboardWidgetMetrics { + /** + * Specifies the alias list of metrics. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#alias CesDashboardWidget#alias} + */ + readonly alias?: string[]; + /** + * Specifies the metric name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#metric_name CesDashboardWidget#metric_name} + */ + readonly metricName: string; + /** + * Specifies the cloud service dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#namespace CesDashboardWidget#namespace} + */ + readonly namespace: string; + /** + * dimensions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#dimensions CesDashboardWidget#dimensions} + */ + readonly dimensions: CesDashboardWidgetMetricsDimensions; +} + +export function cesDashboardWidgetMetricsToTerraform(struct?: CesDashboardWidgetMetrics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alias: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.alias), + metric_name: cdktf.stringToTerraform(struct!.metricName), + namespace: cdktf.stringToTerraform(struct!.namespace), + dimensions: cesDashboardWidgetMetricsDimensionsToTerraform(struct!.dimensions), + } +} + + +export function cesDashboardWidgetMetricsToHclTerraform(struct?: CesDashboardWidgetMetrics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alias: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.alias), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(struct!.namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimensions: { + value: cesDashboardWidgetMetricsDimensionsToHclTerraform(struct!.dimensions), + isBlock: true, + type: "list", + storageClassType: "CesDashboardWidgetMetricsDimensionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesDashboardWidgetMetricsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesDashboardWidgetMetrics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alias !== undefined) { + hasAnyValues = true; + internalValueResult.alias = this._alias; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._namespace !== undefined) { + hasAnyValues = true; + internalValueResult.namespace = this._namespace; + } + if (this._dimensions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dimensions = this._dimensions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesDashboardWidgetMetrics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._alias = undefined; + this._metricName = undefined; + this._namespace = undefined; + this._dimensions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._alias = value.alias; + this._metricName = value.metricName; + this._namespace = value.namespace; + this._dimensions.internalValue = value.dimensions; + } + } + + // alias - computed: false, optional: true, required: false + private _alias?: string[]; + public get alias() { + return this.getListAttribute('alias'); + } + public set alias(value: string[]) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // metric_name - computed: false, optional: false, required: true + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // dimensions - computed: false, optional: false, required: true + private _dimensions = new CesDashboardWidgetMetricsDimensionsOutputReference(this, "dimensions"); + public get dimensions() { + return this._dimensions; + } + public putDimensions(value: CesDashboardWidgetMetricsDimensions) { + this._dimensions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions.internalValue; + } +} + +export class CesDashboardWidgetMetricsList extends cdktf.ComplexList { + public internalValue? : CesDashboardWidgetMetrics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesDashboardWidgetMetricsOutputReference { + return new CesDashboardWidgetMetricsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesDashboardWidgetProperties { + /** + * Specifies how metric data is aggregated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#filter CesDashboardWidget#filter} + */ + readonly filter?: string; + /** + * Specifies how top n resources by a metric are sorted on a dashboard widget. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#order CesDashboardWidget#order} + */ + readonly order?: string; + /** + * Specifies the top n resources sorted by a metric. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#top_n CesDashboardWidget#top_n} + */ + readonly topN: number; +} + +export function cesDashboardWidgetPropertiesToTerraform(struct?: CesDashboardWidgetPropertiesOutputReference | CesDashboardWidgetProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + filter: cdktf.stringToTerraform(struct!.filter), + order: cdktf.stringToTerraform(struct!.order), + top_n: cdktf.numberToTerraform(struct!.topN), + } +} + + +export function cesDashboardWidgetPropertiesToHclTerraform(struct?: CesDashboardWidgetPropertiesOutputReference | CesDashboardWidgetProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + filter: { + value: cdktf.stringToHclTerraform(struct!.filter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + order: { + value: cdktf.stringToHclTerraform(struct!.order), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + top_n: { + value: cdktf.numberToHclTerraform(struct!.topN), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesDashboardWidgetPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CesDashboardWidgetProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._filter !== undefined) { + hasAnyValues = true; + internalValueResult.filter = this._filter; + } + if (this._order !== undefined) { + hasAnyValues = true; + internalValueResult.order = this._order; + } + if (this._topN !== undefined) { + hasAnyValues = true; + internalValueResult.topN = this._topN; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesDashboardWidgetProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._filter = undefined; + this._order = undefined; + this._topN = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._filter = value.filter; + this._order = value.order; + this._topN = value.topN; + } + } + + // filter - computed: true, optional: true, required: false + private _filter?: string; + public get filter() { + return this.getStringAttribute('filter'); + } + public set filter(value: string) { + this._filter = value; + } + public resetFilter() { + this._filter = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter; + } + + // order - computed: true, optional: true, required: false + private _order?: string; + public get order() { + return this.getStringAttribute('order'); + } + public set order(value: string) { + this._order = value; + } + public resetOrder() { + this._order = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderInput() { + return this._order; + } + + // top_n - computed: false, optional: false, required: true + private _topN?: number; + public get topN() { + return this.getNumberAttribute('top_n'); + } + public set topN(value: number) { + this._topN = value; + } + // Temporarily expose input value. Use with caution. + public get topNInput() { + return this._topN; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget huaweicloud_ces_dashboard_widget} +*/ +export class CesDashboardWidget extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_dashboard_widget"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesDashboardWidget resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesDashboardWidget to import + * @param importFromId The id of the existing CesDashboardWidget that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesDashboardWidget to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_dashboard_widget", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard_widget huaweicloud_ces_dashboard_widget} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesDashboardWidgetConfig + */ + public constructor(scope: Construct, id: string, config: CesDashboardWidgetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_dashboard_widget', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashboardId = config.dashboardId; + this._id = config.id; + this._metricDisplayMode = config.metricDisplayMode; + this._region = config.region; + this._title = config.title; + this._unit = config.unit; + this._view = config.view; + this._location.internalValue = config.location; + this._metrics.internalValue = config.metrics; + this._properties.internalValue = config.properties; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dashboard_id - computed: false, optional: false, required: true + private _dashboardId?: string; + public get dashboardId() { + return this.getStringAttribute('dashboard_id'); + } + public set dashboardId(value: string) { + this._dashboardId = value; + } + // Temporarily expose input value. Use with caution. + public get dashboardIdInput() { + return this._dashboardId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // metric_display_mode - computed: false, optional: false, required: true + private _metricDisplayMode?: string; + public get metricDisplayMode() { + return this.getStringAttribute('metric_display_mode'); + } + public set metricDisplayMode(value: string) { + this._metricDisplayMode = value; + } + // Temporarily expose input value. Use with caution. + public get metricDisplayModeInput() { + return this._metricDisplayMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // title - computed: false, optional: false, required: true + private _title?: string; + public get title() { + return this.getStringAttribute('title'); + } + public set title(value: string) { + this._title = value; + } + // Temporarily expose input value. Use with caution. + public get titleInput() { + return this._title; + } + + // unit - computed: true, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } + + // view - computed: false, optional: false, required: true + private _view?: string; + public get view() { + return this.getStringAttribute('view'); + } + public set view(value: string) { + this._view = value; + } + // Temporarily expose input value. Use with caution. + public get viewInput() { + return this._view; + } + + // location - computed: false, optional: false, required: true + private _location = new CesDashboardWidgetLocationOutputReference(this, "location"); + public get location() { + return this._location; + } + public putLocation(value: CesDashboardWidgetLocation) { + this._location.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location.internalValue; + } + + // metrics - computed: false, optional: false, required: true + private _metrics = new CesDashboardWidgetMetricsList(this, "metrics", false); + public get metrics() { + return this._metrics; + } + public putMetrics(value: CesDashboardWidgetMetrics[] | cdktf.IResolvable) { + this._metrics.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get metricsInput() { + return this._metrics.internalValue; + } + + // properties - computed: false, optional: true, required: false + private _properties = new CesDashboardWidgetPropertiesOutputReference(this, "properties"); + public get properties() { + return this._properties; + } + public putProperties(value: CesDashboardWidgetProperties) { + this._properties.internalValue = value; + } + public resetProperties() { + this._properties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dashboard_id: cdktf.stringToTerraform(this._dashboardId), + id: cdktf.stringToTerraform(this._id), + metric_display_mode: cdktf.stringToTerraform(this._metricDisplayMode), + region: cdktf.stringToTerraform(this._region), + title: cdktf.stringToTerraform(this._title), + unit: cdktf.stringToTerraform(this._unit), + view: cdktf.stringToTerraform(this._view), + location: cesDashboardWidgetLocationToTerraform(this._location.internalValue), + metrics: cdktf.listMapper(cesDashboardWidgetMetricsToTerraform, true)(this._metrics.internalValue), + properties: cesDashboardWidgetPropertiesToTerraform(this._properties.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dashboard_id: { + value: cdktf.stringToHclTerraform(this._dashboardId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_display_mode: { + value: cdktf.stringToHclTerraform(this._metricDisplayMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + title: { + value: cdktf.stringToHclTerraform(this._title), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unit: { + value: cdktf.stringToHclTerraform(this._unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + view: { + value: cdktf.stringToHclTerraform(this._view), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cesDashboardWidgetLocationToHclTerraform(this._location.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesDashboardWidgetLocationList", + }, + metrics: { + value: cdktf.listMapperHcl(cesDashboardWidgetMetricsToHclTerraform, true)(this._metrics.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesDashboardWidgetMetricsList", + }, + properties: { + value: cesDashboardWidgetPropertiesToHclTerraform(this._properties.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesDashboardWidgetPropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-dashboard/README.md b/src/constructs/providers/huaweicloud/ces-dashboard/README.md new file mode 100644 index 00000000..b68c868a --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-dashboard/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_dashboard` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_dashboard`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard). diff --git a/src/constructs/providers/huaweicloud/ces-dashboard/index.ts b/src/constructs/providers/huaweicloud/ces-dashboard/index.ts new file mode 100644 index 00000000..8595a1f7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-dashboard/index.ts @@ -0,0 +1,298 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesDashboardConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the copied dashboard ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#dashboard_id CesDashboard#dashboard_id} + */ + readonly dashboardId?: string; + /** + * Specifies the enterprise project ID of the dashboard. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#enterprise_project_id CesDashboard#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#id CesDashboard#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the dashboard is favorite. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#is_favorite CesDashboard#is_favorite} + */ + readonly isFavorite?: boolean | cdktf.IResolvable; + /** + * Specifies the dashboard name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#name CesDashboard#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#region CesDashboard#region} + */ + readonly region?: string; + /** + * Specifies the monitoring view display mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#row_widget_num CesDashboard#row_widget_num} + */ + readonly rowWidgetNum: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard huaweicloud_ces_dashboard} +*/ +export class CesDashboard extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_dashboard"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesDashboard resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesDashboard to import + * @param importFromId The id of the existing CesDashboard that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesDashboard to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_dashboard", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_dashboard huaweicloud_ces_dashboard} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesDashboardConfig + */ + public constructor(scope: Construct, id: string, config: CesDashboardConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_dashboard', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashboardId = config.dashboardId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isFavorite = config.isFavorite; + this._name = config.name; + this._region = config.region; + this._rowWidgetNum = config.rowWidgetNum; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator_name - computed: true, optional: false, required: false + public get creatorName() { + return this.getStringAttribute('creator_name'); + } + + // dashboard_id - computed: false, optional: true, required: false + private _dashboardId?: string; + public get dashboardId() { + return this.getStringAttribute('dashboard_id'); + } + public set dashboardId(value: string) { + this._dashboardId = value; + } + public resetDashboardId() { + this._dashboardId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dashboardIdInput() { + return this._dashboardId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_favorite - computed: false, optional: true, required: false + private _isFavorite?: boolean | cdktf.IResolvable; + public get isFavorite() { + return this.getBooleanAttribute('is_favorite'); + } + public set isFavorite(value: boolean | cdktf.IResolvable) { + this._isFavorite = value; + } + public resetIsFavorite() { + this._isFavorite = undefined; + } + // Temporarily expose input value. Use with caution. + public get isFavoriteInput() { + return this._isFavorite; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // row_widget_num - computed: false, optional: false, required: true + private _rowWidgetNum?: number; + public get rowWidgetNum() { + return this.getNumberAttribute('row_widget_num'); + } + public set rowWidgetNum(value: number) { + this._rowWidgetNum = value; + } + // Temporarily expose input value. Use with caution. + public get rowWidgetNumInput() { + return this._rowWidgetNum; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dashboard_id: cdktf.stringToTerraform(this._dashboardId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_favorite: cdktf.booleanToTerraform(this._isFavorite), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + row_widget_num: cdktf.numberToTerraform(this._rowWidgetNum), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dashboard_id: { + value: cdktf.stringToHclTerraform(this._dashboardId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_favorite: { + value: cdktf.booleanToHclTerraform(this._isFavorite), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + row_widget_num: { + value: cdktf.numberToHclTerraform(this._rowWidgetNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-event-report/README.md b/src/constructs/providers/huaweicloud/ces-event-report/README.md new file mode 100644 index 00000000..33863222 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-event-report/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_event_report` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_event_report`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report). diff --git a/src/constructs/providers/huaweicloud/ces-event-report/index.ts b/src/constructs/providers/huaweicloud/ces-event-report/index.ts new file mode 100644 index 00000000..4085a3f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-event-report/index.ts @@ -0,0 +1,759 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesEventReportConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#id CesEventReport#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the CES event name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#name CesEventReport#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#region CesEventReport#region} + */ + readonly region?: string; + /** + * Specifies the event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#source CesEventReport#source} + */ + readonly source: string; + /** + * Specifies the occurrence time of the event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#time CesEventReport#time} + */ + readonly time: string; + /** + * detail block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#detail CesEventReport#detail} + */ + readonly detail: CesEventReportDetail; +} +export interface CesEventReportDetailDimensions { + /** + * The resource dimension name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#name CesEventReport#name} + */ + readonly name: string; + /** + * The resource dimension value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#value CesEventReport#value} + */ + readonly value: string; +} + +export function cesEventReportDetailDimensionsToTerraform(struct?: CesEventReportDetailDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cesEventReportDetailDimensionsToHclTerraform(struct?: CesEventReportDetailDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesEventReportDetailDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesEventReportDetailDimensions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesEventReportDetailDimensions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CesEventReportDetailDimensionsList extends cdktf.ComplexList { + public internalValue? : CesEventReportDetailDimensions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesEventReportDetailDimensionsOutputReference { + return new CesEventReportDetailDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesEventReportDetail { + /** + * Specifies the event content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#content CesEventReport#content} + */ + readonly content?: string; + /** + * Specifies the group that the event belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#group_id CesEventReport#group_id} + */ + readonly groupId?: string; + /** + * Specifies the event level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#level CesEventReport#level} + */ + readonly level: string; + /** + * Specifies the resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#resource_id CesEventReport#resource_id} + */ + readonly resourceId?: string; + /** + * Specifies the resource name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#resource_name CesEventReport#resource_name} + */ + readonly resourceName?: string; + /** + * Specifies the event status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#state CesEventReport#state} + */ + readonly state: string; + /** + * Specifies the event type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#type CesEventReport#type} + */ + readonly type?: string; + /** + * Specifies the event user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#user CesEventReport#user} + */ + readonly user?: string; + /** + * dimensions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#dimensions CesEventReport#dimensions} + */ + readonly dimensions?: CesEventReportDetailDimensions[] | cdktf.IResolvable; +} + +export function cesEventReportDetailToTerraform(struct?: CesEventReportDetailOutputReference | CesEventReportDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + group_id: cdktf.stringToTerraform(struct!.groupId), + level: cdktf.stringToTerraform(struct!.level), + resource_id: cdktf.stringToTerraform(struct!.resourceId), + resource_name: cdktf.stringToTerraform(struct!.resourceName), + state: cdktf.stringToTerraform(struct!.state), + type: cdktf.stringToTerraform(struct!.type), + user: cdktf.stringToTerraform(struct!.user), + dimensions: cdktf.listMapper(cesEventReportDetailDimensionsToTerraform, true)(struct!.dimensions), + } +} + + +export function cesEventReportDetailToHclTerraform(struct?: CesEventReportDetailOutputReference | CesEventReportDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(struct!.groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(struct!.level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(struct!.resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(struct!.state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(struct!.user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimensions: { + value: cdktf.listMapperHcl(cesEventReportDetailDimensionsToHclTerraform, true)(struct!.dimensions), + isBlock: true, + type: "list", + storageClassType: "CesEventReportDetailDimensionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesEventReportDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CesEventReportDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._groupId !== undefined) { + hasAnyValues = true; + internalValueResult.groupId = this._groupId; + } + if (this._level !== undefined) { + hasAnyValues = true; + internalValueResult.level = this._level; + } + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._resourceName !== undefined) { + hasAnyValues = true; + internalValueResult.resourceName = this._resourceName; + } + if (this._state !== undefined) { + hasAnyValues = true; + internalValueResult.state = this._state; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._user !== undefined) { + hasAnyValues = true; + internalValueResult.user = this._user; + } + if (this._dimensions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dimensions = this._dimensions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesEventReportDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._content = undefined; + this._groupId = undefined; + this._level = undefined; + this._resourceId = undefined; + this._resourceName = undefined; + this._state = undefined; + this._type = undefined; + this._user = undefined; + this._dimensions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._content = value.content; + this._groupId = value.groupId; + this._level = value.level; + this._resourceId = value.resourceId; + this._resourceName = value.resourceName; + this._state = value.state; + this._type = value.type; + this._user = value.user; + this._dimensions.internalValue = value.dimensions; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // level - computed: false, optional: false, required: true + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: false, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // state - computed: false, optional: false, required: true + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // dimensions - computed: false, optional: true, required: false + private _dimensions = new CesEventReportDetailDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + public putDimensions(value: CesEventReportDetailDimensions[] | cdktf.IResolvable) { + this._dimensions.internalValue = value; + } + public resetDimensions() { + this._dimensions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report huaweicloud_ces_event_report} +*/ +export class CesEventReport extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_event_report"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesEventReport resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesEventReport to import + * @param importFromId The id of the existing CesEventReport that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesEventReport to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_event_report", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_event_report huaweicloud_ces_event_report} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesEventReportConfig + */ + public constructor(scope: Construct, id: string, config: CesEventReportConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_event_report', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._source = config.source; + this._time = config.time; + this._detail.internalValue = config.detail; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: false, optional: false, required: true + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // time - computed: false, optional: false, required: true + private _time?: string; + public get time() { + return this.getStringAttribute('time'); + } + public set time(value: string) { + this._time = value; + } + // Temporarily expose input value. Use with caution. + public get timeInput() { + return this._time; + } + + // detail - computed: false, optional: false, required: true + private _detail = new CesEventReportDetailOutputReference(this, "detail"); + public get detail() { + return this._detail; + } + public putDetail(value: CesEventReportDetail) { + this._detail.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get detailInput() { + return this._detail.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + time: cdktf.stringToTerraform(this._time), + detail: cesEventReportDetailToTerraform(this._detail.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time: { + value: cdktf.stringToHclTerraform(this._time), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detail: { + value: cesEventReportDetailToHclTerraform(this._detail.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesEventReportDetailList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-one-click-alarm/README.md b/src/constructs/providers/huaweicloud/ces-one-click-alarm/README.md new file mode 100644 index 00000000..62aa37ef --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-one-click-alarm/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_one_click_alarm` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_one_click_alarm`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm). diff --git a/src/constructs/providers/huaweicloud/ces-one-click-alarm/index.ts b/src/constructs/providers/huaweicloud/ces-one-click-alarm/index.ts new file mode 100644 index 00000000..9a0edd07 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-one-click-alarm/index.ts @@ -0,0 +1,775 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesOneClickAlarmConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#id CesOneClickAlarm#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the time when the alarm notification was enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#notification_begin_time CesOneClickAlarm#notification_begin_time} + */ + readonly notificationBeginTime?: string; + /** + * Specifies whether to enable the alarm notification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#notification_enabled CesOneClickAlarm#notification_enabled} + */ + readonly notificationEnabled: boolean | cdktf.IResolvable; + /** + * Specifies the time when the alarm notification was disabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#notification_end_time CesOneClickAlarm#notification_end_time} + */ + readonly notificationEndTime?: string; + /** + * Specifies the default one-click monitoring ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#one_click_alarm_id CesOneClickAlarm#one_click_alarm_id} + */ + readonly oneClickAlarmId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#region CesOneClickAlarm#region} + */ + readonly region?: string; + /** + * alarm_notifications block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#alarm_notifications CesOneClickAlarm#alarm_notifications} + */ + readonly alarmNotifications?: CesOneClickAlarmAlarmNotifications[] | cdktf.IResolvable; + /** + * dimension_names block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#dimension_names CesOneClickAlarm#dimension_names} + */ + readonly dimensionNames: CesOneClickAlarmDimensionNames; + /** + * ok_notifications block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#ok_notifications CesOneClickAlarm#ok_notifications} + */ + readonly okNotifications?: CesOneClickAlarmOkNotifications[] | cdktf.IResolvable; +} +export interface CesOneClickAlarmAlarmNotifications { + /** + * Specifies the list of objects to be notified if the alarm status changes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#notification_list CesOneClickAlarm#notification_list} + */ + readonly notificationList: string[]; + /** + * Specifies the notification type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#type CesOneClickAlarm#type} + */ + readonly type: string; +} + +export function cesOneClickAlarmAlarmNotificationsToTerraform(struct?: CesOneClickAlarmAlarmNotifications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + notification_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.notificationList), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cesOneClickAlarmAlarmNotificationsToHclTerraform(struct?: CesOneClickAlarmAlarmNotifications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + notification_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.notificationList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesOneClickAlarmAlarmNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesOneClickAlarmAlarmNotifications | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._notificationList !== undefined) { + hasAnyValues = true; + internalValueResult.notificationList = this._notificationList; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesOneClickAlarmAlarmNotifications | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._notificationList = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._notificationList = value.notificationList; + this._type = value.type; + } + } + + // notification_list - computed: false, optional: false, required: true + private _notificationList?: string[]; + public get notificationList() { + return this.getListAttribute('notification_list'); + } + public set notificationList(value: string[]) { + this._notificationList = value; + } + // Temporarily expose input value. Use with caution. + public get notificationListInput() { + return this._notificationList; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CesOneClickAlarmAlarmNotificationsList extends cdktf.ComplexList { + public internalValue? : CesOneClickAlarmAlarmNotifications[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesOneClickAlarmAlarmNotificationsOutputReference { + return new CesOneClickAlarmAlarmNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesOneClickAlarmDimensionNames { + /** + * Specifies whether to enable the event alarm rules. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#event CesOneClickAlarm#event} + */ + readonly event?: boolean | cdktf.IResolvable; + /** + * Specifies dimensions in metric alarm rules that have one-click monitoring enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#metric CesOneClickAlarm#metric} + */ + readonly metric?: string[]; +} + +export function cesOneClickAlarmDimensionNamesToTerraform(struct?: CesOneClickAlarmDimensionNamesOutputReference | CesOneClickAlarmDimensionNames): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + event: cdktf.booleanToTerraform(struct!.event), + metric: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.metric), + } +} + + +export function cesOneClickAlarmDimensionNamesToHclTerraform(struct?: CesOneClickAlarmDimensionNamesOutputReference | CesOneClickAlarmDimensionNames): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + event: { + value: cdktf.booleanToHclTerraform(struct!.event), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + metric: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.metric), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesOneClickAlarmDimensionNamesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CesOneClickAlarmDimensionNames | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._event !== undefined) { + hasAnyValues = true; + internalValueResult.event = this._event; + } + if (this._metric !== undefined) { + hasAnyValues = true; + internalValueResult.metric = this._metric; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesOneClickAlarmDimensionNames | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._event = undefined; + this._metric = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._event = value.event; + this._metric = value.metric; + } + } + + // event - computed: false, optional: true, required: false + private _event?: boolean | cdktf.IResolvable; + public get event() { + return this.getBooleanAttribute('event'); + } + public set event(value: boolean | cdktf.IResolvable) { + this._event = value; + } + public resetEvent() { + this._event = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventInput() { + return this._event; + } + + // metric - computed: false, optional: true, required: false + private _metric?: string[]; + public get metric() { + return this.getListAttribute('metric'); + } + public set metric(value: string[]) { + this._metric = value; + } + public resetMetric() { + this._metric = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricInput() { + return this._metric; + } +} +export interface CesOneClickAlarmOkNotifications { + /** + * Specifies the list of objects to be notified if the alarm status changes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#notification_list CesOneClickAlarm#notification_list} + */ + readonly notificationList: string[]; + /** + * Specifies the notification type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#type CesOneClickAlarm#type} + */ + readonly type: string; +} + +export function cesOneClickAlarmOkNotificationsToTerraform(struct?: CesOneClickAlarmOkNotifications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + notification_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.notificationList), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cesOneClickAlarmOkNotificationsToHclTerraform(struct?: CesOneClickAlarmOkNotifications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + notification_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.notificationList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesOneClickAlarmOkNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesOneClickAlarmOkNotifications | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._notificationList !== undefined) { + hasAnyValues = true; + internalValueResult.notificationList = this._notificationList; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesOneClickAlarmOkNotifications | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._notificationList = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._notificationList = value.notificationList; + this._type = value.type; + } + } + + // notification_list - computed: false, optional: false, required: true + private _notificationList?: string[]; + public get notificationList() { + return this.getListAttribute('notification_list'); + } + public set notificationList(value: string[]) { + this._notificationList = value; + } + // Temporarily expose input value. Use with caution. + public get notificationListInput() { + return this._notificationList; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CesOneClickAlarmOkNotificationsList extends cdktf.ComplexList { + public internalValue? : CesOneClickAlarmOkNotifications[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesOneClickAlarmOkNotificationsOutputReference { + return new CesOneClickAlarmOkNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm huaweicloud_ces_one_click_alarm} +*/ +export class CesOneClickAlarm extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_one_click_alarm"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesOneClickAlarm resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesOneClickAlarm to import + * @param importFromId The id of the existing CesOneClickAlarm that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesOneClickAlarm to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_one_click_alarm", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_one_click_alarm huaweicloud_ces_one_click_alarm} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesOneClickAlarmConfig + */ + public constructor(scope: Construct, id: string, config: CesOneClickAlarmConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_one_click_alarm', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._notificationBeginTime = config.notificationBeginTime; + this._notificationEnabled = config.notificationEnabled; + this._notificationEndTime = config.notificationEndTime; + this._oneClickAlarmId = config.oneClickAlarmId; + this._region = config.region; + this._alarmNotifications.internalValue = config.alarmNotifications; + this._dimensionNames.internalValue = config.dimensionNames; + this._okNotifications.internalValue = config.okNotifications; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // notification_begin_time - computed: false, optional: true, required: false + private _notificationBeginTime?: string; + public get notificationBeginTime() { + return this.getStringAttribute('notification_begin_time'); + } + public set notificationBeginTime(value: string) { + this._notificationBeginTime = value; + } + public resetNotificationBeginTime() { + this._notificationBeginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationBeginTimeInput() { + return this._notificationBeginTime; + } + + // notification_enabled - computed: false, optional: false, required: true + private _notificationEnabled?: boolean | cdktf.IResolvable; + public get notificationEnabled() { + return this.getBooleanAttribute('notification_enabled'); + } + public set notificationEnabled(value: boolean | cdktf.IResolvable) { + this._notificationEnabled = value; + } + // Temporarily expose input value. Use with caution. + public get notificationEnabledInput() { + return this._notificationEnabled; + } + + // notification_end_time - computed: false, optional: true, required: false + private _notificationEndTime?: string; + public get notificationEndTime() { + return this.getStringAttribute('notification_end_time'); + } + public set notificationEndTime(value: string) { + this._notificationEndTime = value; + } + public resetNotificationEndTime() { + this._notificationEndTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationEndTimeInput() { + return this._notificationEndTime; + } + + // one_click_alarm_id - computed: false, optional: false, required: true + private _oneClickAlarmId?: string; + public get oneClickAlarmId() { + return this.getStringAttribute('one_click_alarm_id'); + } + public set oneClickAlarmId(value: string) { + this._oneClickAlarmId = value; + } + // Temporarily expose input value. Use with caution. + public get oneClickAlarmIdInput() { + return this._oneClickAlarmId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // alarm_notifications - computed: false, optional: true, required: false + private _alarmNotifications = new CesOneClickAlarmAlarmNotificationsList(this, "alarm_notifications", false); + public get alarmNotifications() { + return this._alarmNotifications; + } + public putAlarmNotifications(value: CesOneClickAlarmAlarmNotifications[] | cdktf.IResolvable) { + this._alarmNotifications.internalValue = value; + } + public resetAlarmNotifications() { + this._alarmNotifications.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmNotificationsInput() { + return this._alarmNotifications.internalValue; + } + + // dimension_names - computed: false, optional: false, required: true + private _dimensionNames = new CesOneClickAlarmDimensionNamesOutputReference(this, "dimension_names"); + public get dimensionNames() { + return this._dimensionNames; + } + public putDimensionNames(value: CesOneClickAlarmDimensionNames) { + this._dimensionNames.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dimensionNamesInput() { + return this._dimensionNames.internalValue; + } + + // ok_notifications - computed: false, optional: true, required: false + private _okNotifications = new CesOneClickAlarmOkNotificationsList(this, "ok_notifications", false); + public get okNotifications() { + return this._okNotifications; + } + public putOkNotifications(value: CesOneClickAlarmOkNotifications[] | cdktf.IResolvable) { + this._okNotifications.internalValue = value; + } + public resetOkNotifications() { + this._okNotifications.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get okNotificationsInput() { + return this._okNotifications.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + notification_begin_time: cdktf.stringToTerraform(this._notificationBeginTime), + notification_enabled: cdktf.booleanToTerraform(this._notificationEnabled), + notification_end_time: cdktf.stringToTerraform(this._notificationEndTime), + one_click_alarm_id: cdktf.stringToTerraform(this._oneClickAlarmId), + region: cdktf.stringToTerraform(this._region), + alarm_notifications: cdktf.listMapper(cesOneClickAlarmAlarmNotificationsToTerraform, true)(this._alarmNotifications.internalValue), + dimension_names: cesOneClickAlarmDimensionNamesToTerraform(this._dimensionNames.internalValue), + ok_notifications: cdktf.listMapper(cesOneClickAlarmOkNotificationsToTerraform, true)(this._okNotifications.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_begin_time: { + value: cdktf.stringToHclTerraform(this._notificationBeginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_enabled: { + value: cdktf.booleanToHclTerraform(this._notificationEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + notification_end_time: { + value: cdktf.stringToHclTerraform(this._notificationEndTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + one_click_alarm_id: { + value: cdktf.stringToHclTerraform(this._oneClickAlarmId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_notifications: { + value: cdktf.listMapperHcl(cesOneClickAlarmAlarmNotificationsToHclTerraform, true)(this._alarmNotifications.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesOneClickAlarmAlarmNotificationsList", + }, + dimension_names: { + value: cesOneClickAlarmDimensionNamesToHclTerraform(this._dimensionNames.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesOneClickAlarmDimensionNamesList", + }, + ok_notifications: { + value: cdktf.listMapperHcl(cesOneClickAlarmOkNotificationsToHclTerraform, true)(this._okNotifications.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesOneClickAlarmOkNotificationsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ces-resource-group/README.md b/src/constructs/providers/huaweicloud/ces-resource-group/README.md new file mode 100644 index 00000000..f6320bbe --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-resource-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ces_resource_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_ces_resource_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group). diff --git a/src/constructs/providers/huaweicloud/ces-resource-group/index.ts b/src/constructs/providers/huaweicloud/ces-resource-group/index.ts new file mode 100644 index 00000000..237451d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ces-resource-group/index.ts @@ -0,0 +1,620 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CesResourceGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project IDs where the resources from. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#associated_eps_ids CesResourceGroup#associated_eps_ids} + */ + readonly associatedEpsIds?: string[]; + /** + * Specifies the enterprise project ID of the resource group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#enterprise_project_id CesResourceGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#id CesResourceGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the resource group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#name CesResourceGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#region CesResourceGroup#region} + */ + readonly region?: string; + /** + * Specifies the key/value to match resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#tags CesResourceGroup#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the resource group type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#type CesResourceGroup#type} + */ + readonly type?: string; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#resources CesResourceGroup#resources} + */ + readonly resources?: CesResourceGroupResources[] | cdktf.IResolvable; +} +export interface CesResourceGroupResourcesDimensions { + /** + * Specifies the dimension name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#name CesResourceGroup#name} + */ + readonly name: string; + /** + * Specifies the dimension value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#value CesResourceGroup#value} + */ + readonly value: string; +} + +export function cesResourceGroupResourcesDimensionsToTerraform(struct?: CesResourceGroupResourcesDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cesResourceGroupResourcesDimensionsToHclTerraform(struct?: CesResourceGroupResourcesDimensions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesResourceGroupResourcesDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesResourceGroupResourcesDimensions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesResourceGroupResourcesDimensions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CesResourceGroupResourcesDimensionsList extends cdktf.ComplexList { + public internalValue? : CesResourceGroupResourcesDimensions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesResourceGroupResourcesDimensionsOutputReference { + return new CesResourceGroupResourcesDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CesResourceGroupResources { + /** + * Specifies the namespace in **service.item** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#namespace CesResourceGroup#namespace} + */ + readonly namespace: string; + /** + * dimensions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#dimensions CesResourceGroup#dimensions} + */ + readonly dimensions: CesResourceGroupResourcesDimensions[] | cdktf.IResolvable; +} + +export function cesResourceGroupResourcesToTerraform(struct?: CesResourceGroupResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + namespace: cdktf.stringToTerraform(struct!.namespace), + dimensions: cdktf.listMapper(cesResourceGroupResourcesDimensionsToTerraform, true)(struct!.dimensions), + } +} + + +export function cesResourceGroupResourcesToHclTerraform(struct?: CesResourceGroupResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + namespace: { + value: cdktf.stringToHclTerraform(struct!.namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimensions: { + value: cdktf.listMapperHcl(cesResourceGroupResourcesDimensionsToHclTerraform, true)(struct!.dimensions), + isBlock: true, + type: "list", + storageClassType: "CesResourceGroupResourcesDimensionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CesResourceGroupResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CesResourceGroupResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._namespace !== undefined) { + hasAnyValues = true; + internalValueResult.namespace = this._namespace; + } + if (this._dimensions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dimensions = this._dimensions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CesResourceGroupResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._namespace = undefined; + this._dimensions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._namespace = value.namespace; + this._dimensions.internalValue = value.dimensions; + } + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // dimensions - computed: false, optional: false, required: true + private _dimensions = new CesResourceGroupResourcesDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + public putDimensions(value: CesResourceGroupResourcesDimensions[] | cdktf.IResolvable) { + this._dimensions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions.internalValue; + } +} + +export class CesResourceGroupResourcesList extends cdktf.ComplexList { + public internalValue? : CesResourceGroupResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CesResourceGroupResourcesOutputReference { + return new CesResourceGroupResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group huaweicloud_ces_resource_group} +*/ +export class CesResourceGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_resource_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CesResourceGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CesResourceGroup to import + * @param importFromId The id of the existing CesResourceGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CesResourceGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_resource_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ces_resource_group huaweicloud_ces_resource_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CesResourceGroupConfig + */ + public constructor(scope: Construct, id: string, config: CesResourceGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_resource_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._associatedEpsIds = config.associatedEpsIds; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + this._resources.internalValue = config.resources; + } + + // ========== + // ATTRIBUTES + // ========== + + // associated_eps_ids - computed: true, optional: true, required: false + private _associatedEpsIds?: string[]; + public get associatedEpsIds() { + return this.getListAttribute('associated_eps_ids'); + } + public set associatedEpsIds(value: string[]) { + this._associatedEpsIds = value; + } + public resetAssociatedEpsIds() { + this._associatedEpsIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get associatedEpsIdsInput() { + return this._associatedEpsIds; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // resources - computed: false, optional: true, required: false + private _resources = new CesResourceGroupResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: CesResourceGroupResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + associated_eps_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._associatedEpsIds), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + resources: cdktf.listMapper(cesResourceGroupResourcesToTerraform, true)(this._resources.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + associated_eps_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._associatedEpsIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resources: { + value: cdktf.listMapperHcl(cesResourceGroupResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "list", + storageClassType: "CesResourceGroupResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-acl-rule/README.md b/src/constructs/providers/huaweicloud/cfw-acl-rule/README.md new file mode 100644 index 00000000..048bfb48 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-acl-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_acl_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_acl_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule). diff --git a/src/constructs/providers/huaweicloud/cfw-acl-rule/index.ts b/src/constructs/providers/huaweicloud/cfw-acl-rule/index.ts new file mode 100644 index 00000000..26711365 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-acl-rule/index.ts @@ -0,0 +1,2077 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwAclRuleConfig extends cdktf.TerraformMetaArguments { + /** + * The action type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#action_type CfwAclRule#action_type} + */ + readonly actionType: number; + /** + * The address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#address_type CfwAclRule#address_type} + */ + readonly addressType: number; + /** + * The rule description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#description CfwAclRule#description} + */ + readonly description?: string; + /** + * The destination address group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_address_groups CfwAclRule#destination_address_groups} + */ + readonly destinationAddressGroups?: string[]; + /** + * The destination address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_address_type CfwAclRule#destination_address_type} + */ + readonly destinationAddressType?: number; + /** + * The destination IP address list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_addresses CfwAclRule#destination_addresses} + */ + readonly destinationAddresses?: string[]; + /** + * The destination domain address name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_domain_address_name CfwAclRule#destination_domain_address_name} + */ + readonly destinationDomainAddressName?: string; + /** + * The destination domain group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_domain_group_id CfwAclRule#destination_domain_group_id} + */ + readonly destinationDomainGroupId?: string; + /** + * The destination domain group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_domain_group_name CfwAclRule#destination_domain_group_name} + */ + readonly destinationDomainGroupName?: string; + /** + * The destination domain group type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_domain_group_type CfwAclRule#destination_domain_group_type} + */ + readonly destinationDomainGroupType?: number; + /** + * The rule direction. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#direction CfwAclRule#direction} + */ + readonly direction?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#enable_force_new CfwAclRule#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#id CfwAclRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to support persistent connections. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#long_connect_enable CfwAclRule#long_connect_enable} + */ + readonly longConnectEnable: number; + /** + * The persistent connection duration (hour). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#long_connect_time_hour CfwAclRule#long_connect_time_hour} + */ + readonly longConnectTimeHour?: number; + /** + * The persistent connection duration (minute). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#long_connect_time_minute CfwAclRule#long_connect_time_minute} + */ + readonly longConnectTimeMinute?: number; + /** + * The persistent Connection Duration (second). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#long_connect_time_second CfwAclRule#long_connect_time_second} + */ + readonly longConnectTimeSecond?: number; + /** + * The rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#name CfwAclRule#name} + */ + readonly name: string; + /** + * The protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#object_id CfwAclRule#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#region CfwAclRule#region} + */ + readonly region?: string; + /** + * The number of times the ACL rule is hit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#rule_hit_count CfwAclRule#rule_hit_count} + */ + readonly ruleHitCount?: string; + /** + * The source address group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#source_address_groups CfwAclRule#source_address_groups} + */ + readonly sourceAddressGroups?: string[]; + /** + * The source address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#source_address_type CfwAclRule#source_address_type} + */ + readonly sourceAddressType?: number; + /** + * The source IP address list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#source_addresses CfwAclRule#source_addresses} + */ + readonly sourceAddresses?: string[]; + /** + * The source predefined address group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#source_predefined_groups CfwAclRule#source_predefined_groups} + */ + readonly sourcePredefinedGroups?: string[]; + /** + * The rule status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#status CfwAclRule#status} + */ + readonly status: number; + /** + * The key/value pairs to associate with the ACL rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#tags CfwAclRule#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The rule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#type CfwAclRule#type} + */ + readonly type: number; + /** + * custom_service_groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#custom_service_groups CfwAclRule#custom_service_groups} + */ + readonly customServiceGroups?: CfwAclRuleCustomServiceGroups; + /** + * custom_services block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#custom_services CfwAclRule#custom_services} + */ + readonly customServices?: CfwAclRuleCustomServices[] | cdktf.IResolvable; + /** + * destination_region_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#destination_region_list CfwAclRule#destination_region_list} + */ + readonly destinationRegionList?: CfwAclRuleDestinationRegionListStruct[] | cdktf.IResolvable; + /** + * predefined_service_groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#predefined_service_groups CfwAclRule#predefined_service_groups} + */ + readonly predefinedServiceGroups?: CfwAclRulePredefinedServiceGroups; + /** + * sequence block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#sequence CfwAclRule#sequence} + */ + readonly sequence: CfwAclRuleSequence; + /** + * source_region_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#source_region_list CfwAclRule#source_region_list} + */ + readonly sourceRegionList?: CfwAclRuleSourceRegionListStruct[] | cdktf.IResolvable; +} +export interface CfwAclRuleCustomServiceGroups { + /** + * The IDs of the service groups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#group_ids CfwAclRule#group_ids} + */ + readonly groupIds: string[]; + /** + * The protocols used in the service groups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#protocols CfwAclRule#protocols} + */ + readonly protocols: number[]; +} + +export function cfwAclRuleCustomServiceGroupsToTerraform(struct?: CfwAclRuleCustomServiceGroupsOutputReference | CfwAclRuleCustomServiceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.groupIds), + protocols: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.protocols), + } +} + + +export function cfwAclRuleCustomServiceGroupsToHclTerraform(struct?: CfwAclRuleCustomServiceGroupsOutputReference | CfwAclRuleCustomServiceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.groupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + protocols: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.protocols), + isBlock: false, + type: "set", + storageClassType: "numberList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwAclRuleCustomServiceGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwAclRuleCustomServiceGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupIds !== undefined) { + hasAnyValues = true; + internalValueResult.groupIds = this._groupIds; + } + if (this._protocols !== undefined) { + hasAnyValues = true; + internalValueResult.protocols = this._protocols; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwAclRuleCustomServiceGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groupIds = undefined; + this._protocols = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groupIds = value.groupIds; + this._protocols = value.protocols; + } + } + + // group_ids - computed: false, optional: false, required: true + private _groupIds?: string[]; + public get groupIds() { + return this.getListAttribute('group_ids'); + } + public set groupIds(value: string[]) { + this._groupIds = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdsInput() { + return this._groupIds; + } + + // protocols - computed: false, optional: false, required: true + private _protocols?: number[]; + public get protocols() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('protocols'))); + } + public set protocols(value: number[]) { + this._protocols = value; + } + // Temporarily expose input value. Use with caution. + public get protocolsInput() { + return this._protocols; + } +} +export interface CfwAclRuleCustomServices { + /** + * The destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#dest_port CfwAclRule#dest_port} + */ + readonly destPort: string; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#protocol CfwAclRule#protocol} + */ + readonly protocol: number; + /** + * The source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#source_port CfwAclRule#source_port} + */ + readonly sourcePort: string; +} + +export function cfwAclRuleCustomServicesToTerraform(struct?: CfwAclRuleCustomServices | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_port: cdktf.stringToTerraform(struct!.destPort), + protocol: cdktf.numberToTerraform(struct!.protocol), + source_port: cdktf.stringToTerraform(struct!.sourcePort), + } +} + + +export function cfwAclRuleCustomServicesToHclTerraform(struct?: CfwAclRuleCustomServices | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_port: { + value: cdktf.stringToHclTerraform(struct!.destPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_port: { + value: cdktf.stringToHclTerraform(struct!.sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwAclRuleCustomServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwAclRuleCustomServices | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destPort !== undefined) { + hasAnyValues = true; + internalValueResult.destPort = this._destPort; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._sourcePort !== undefined) { + hasAnyValues = true; + internalValueResult.sourcePort = this._sourcePort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwAclRuleCustomServices | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destPort = undefined; + this._protocol = undefined; + this._sourcePort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destPort = value.destPort; + this._protocol = value.protocol; + this._sourcePort = value.sourcePort; + } + } + + // dest_port - computed: false, optional: false, required: true + private _destPort?: string; + public get destPort() { + return this.getStringAttribute('dest_port'); + } + public set destPort(value: string) { + this._destPort = value; + } + // Temporarily expose input value. Use with caution. + public get destPortInput() { + return this._destPort; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // source_port - computed: false, optional: false, required: true + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } +} + +export class CfwAclRuleCustomServicesList extends cdktf.ComplexList { + public internalValue? : CfwAclRuleCustomServices[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwAclRuleCustomServicesOutputReference { + return new CfwAclRuleCustomServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwAclRuleDestinationRegionListStruct { + /** + * The Chinese description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#description_cn CfwAclRule#description_cn} + */ + readonly descriptionCn?: string; + /** + * The English description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#description_en CfwAclRule#description_en} + */ + readonly descriptionEn?: string; + /** + * The region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#region_id CfwAclRule#region_id} + */ + readonly regionId: string; + /** + * The region type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#region_type CfwAclRule#region_type} + */ + readonly regionType: number; +} + +export function cfwAclRuleDestinationRegionListStructToTerraform(struct?: CfwAclRuleDestinationRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description_cn: cdktf.stringToTerraform(struct!.descriptionCn), + description_en: cdktf.stringToTerraform(struct!.descriptionEn), + region_id: cdktf.stringToTerraform(struct!.regionId), + region_type: cdktf.numberToTerraform(struct!.regionType), + } +} + + +export function cfwAclRuleDestinationRegionListStructToHclTerraform(struct?: CfwAclRuleDestinationRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description_cn: { + value: cdktf.stringToHclTerraform(struct!.descriptionCn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description_en: { + value: cdktf.stringToHclTerraform(struct!.descriptionEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_type: { + value: cdktf.numberToHclTerraform(struct!.regionType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwAclRuleDestinationRegionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwAclRuleDestinationRegionListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._descriptionCn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionCn = this._descriptionCn; + } + if (this._descriptionEn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionEn = this._descriptionEn; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + if (this._regionType !== undefined) { + hasAnyValues = true; + internalValueResult.regionType = this._regionType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwAclRuleDestinationRegionListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._descriptionCn = undefined; + this._descriptionEn = undefined; + this._regionId = undefined; + this._regionType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._descriptionCn = value.descriptionCn; + this._descriptionEn = value.descriptionEn; + this._regionId = value.regionId; + this._regionType = value.regionType; + } + } + + // description_cn - computed: false, optional: true, required: false + private _descriptionCn?: string; + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + public set descriptionCn(value: string) { + this._descriptionCn = value; + } + public resetDescriptionCn() { + this._descriptionCn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionCnInput() { + return this._descriptionCn; + } + + // description_en - computed: false, optional: true, required: false + private _descriptionEn?: string; + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + public set descriptionEn(value: string) { + this._descriptionEn = value; + } + public resetDescriptionEn() { + this._descriptionEn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionEnInput() { + return this._descriptionEn; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // region_type - computed: false, optional: false, required: true + private _regionType?: number; + public get regionType() { + return this.getNumberAttribute('region_type'); + } + public set regionType(value: number) { + this._regionType = value; + } + // Temporarily expose input value. Use with caution. + public get regionTypeInput() { + return this._regionType; + } +} + +export class CfwAclRuleDestinationRegionListStructList extends cdktf.ComplexList { + public internalValue? : CfwAclRuleDestinationRegionListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwAclRuleDestinationRegionListStructOutputReference { + return new CfwAclRuleDestinationRegionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwAclRulePredefinedServiceGroups { + /** + * The IDs of the service groups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#group_ids CfwAclRule#group_ids} + */ + readonly groupIds: string[]; + /** + * The protocols used in the service groups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#protocols CfwAclRule#protocols} + */ + readonly protocols: number[]; +} + +export function cfwAclRulePredefinedServiceGroupsToTerraform(struct?: CfwAclRulePredefinedServiceGroupsOutputReference | CfwAclRulePredefinedServiceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.groupIds), + protocols: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.protocols), + } +} + + +export function cfwAclRulePredefinedServiceGroupsToHclTerraform(struct?: CfwAclRulePredefinedServiceGroupsOutputReference | CfwAclRulePredefinedServiceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.groupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + protocols: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.protocols), + isBlock: false, + type: "set", + storageClassType: "numberList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwAclRulePredefinedServiceGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwAclRulePredefinedServiceGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupIds !== undefined) { + hasAnyValues = true; + internalValueResult.groupIds = this._groupIds; + } + if (this._protocols !== undefined) { + hasAnyValues = true; + internalValueResult.protocols = this._protocols; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwAclRulePredefinedServiceGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._groupIds = undefined; + this._protocols = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._groupIds = value.groupIds; + this._protocols = value.protocols; + } + } + + // group_ids - computed: false, optional: false, required: true + private _groupIds?: string[]; + public get groupIds() { + return this.getListAttribute('group_ids'); + } + public set groupIds(value: string[]) { + this._groupIds = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdsInput() { + return this._groupIds; + } + + // protocols - computed: false, optional: false, required: true + private _protocols?: number[]; + public get protocols() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('protocols'))); + } + public set protocols(value: number[]) { + this._protocols = value; + } + // Temporarily expose input value. Use with caution. + public get protocolsInput() { + return this._protocols; + } +} +export interface CfwAclRuleSequence { + /** + * Whether to pin on bottom. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#bottom CfwAclRule#bottom} + */ + readonly bottom?: number; + /** + * The ID of the rule that the added rule will follow. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#dest_rule_id CfwAclRule#dest_rule_id} + */ + readonly destRuleId?: string; + /** + * Whether to pin on top. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#top CfwAclRule#top} + */ + readonly top?: number; +} + +export function cfwAclRuleSequenceToTerraform(struct?: CfwAclRuleSequenceOutputReference | CfwAclRuleSequence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bottom: cdktf.numberToTerraform(struct!.bottom), + dest_rule_id: cdktf.stringToTerraform(struct!.destRuleId), + top: cdktf.numberToTerraform(struct!.top), + } +} + + +export function cfwAclRuleSequenceToHclTerraform(struct?: CfwAclRuleSequenceOutputReference | CfwAclRuleSequence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bottom: { + value: cdktf.numberToHclTerraform(struct!.bottom), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dest_rule_id: { + value: cdktf.stringToHclTerraform(struct!.destRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + top: { + value: cdktf.numberToHclTerraform(struct!.top), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwAclRuleSequenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwAclRuleSequence | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bottom !== undefined) { + hasAnyValues = true; + internalValueResult.bottom = this._bottom; + } + if (this._destRuleId !== undefined) { + hasAnyValues = true; + internalValueResult.destRuleId = this._destRuleId; + } + if (this._top !== undefined) { + hasAnyValues = true; + internalValueResult.top = this._top; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwAclRuleSequence | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bottom = undefined; + this._destRuleId = undefined; + this._top = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bottom = value.bottom; + this._destRuleId = value.destRuleId; + this._top = value.top; + } + } + + // bottom - computed: false, optional: true, required: false + private _bottom?: number; + public get bottom() { + return this.getNumberAttribute('bottom'); + } + public set bottom(value: number) { + this._bottom = value; + } + public resetBottom() { + this._bottom = undefined; + } + // Temporarily expose input value. Use with caution. + public get bottomInput() { + return this._bottom; + } + + // dest_rule_id - computed: true, optional: true, required: false + private _destRuleId?: string; + public get destRuleId() { + return this.getStringAttribute('dest_rule_id'); + } + public set destRuleId(value: string) { + this._destRuleId = value; + } + public resetDestRuleId() { + this._destRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destRuleIdInput() { + return this._destRuleId; + } + + // top - computed: false, optional: true, required: false + private _top?: number; + public get top() { + return this.getNumberAttribute('top'); + } + public set top(value: number) { + this._top = value; + } + public resetTop() { + this._top = undefined; + } + // Temporarily expose input value. Use with caution. + public get topInput() { + return this._top; + } +} +export interface CfwAclRuleSourceRegionListStruct { + /** + * The Chinese description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#description_cn CfwAclRule#description_cn} + */ + readonly descriptionCn?: string; + /** + * The English description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#description_en CfwAclRule#description_en} + */ + readonly descriptionEn?: string; + /** + * The region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#region_id CfwAclRule#region_id} + */ + readonly regionId: string; + /** + * The region type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#region_type CfwAclRule#region_type} + */ + readonly regionType: number; +} + +export function cfwAclRuleSourceRegionListStructToTerraform(struct?: CfwAclRuleSourceRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description_cn: cdktf.stringToTerraform(struct!.descriptionCn), + description_en: cdktf.stringToTerraform(struct!.descriptionEn), + region_id: cdktf.stringToTerraform(struct!.regionId), + region_type: cdktf.numberToTerraform(struct!.regionType), + } +} + + +export function cfwAclRuleSourceRegionListStructToHclTerraform(struct?: CfwAclRuleSourceRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description_cn: { + value: cdktf.stringToHclTerraform(struct!.descriptionCn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description_en: { + value: cdktf.stringToHclTerraform(struct!.descriptionEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_type: { + value: cdktf.numberToHclTerraform(struct!.regionType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwAclRuleSourceRegionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwAclRuleSourceRegionListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._descriptionCn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionCn = this._descriptionCn; + } + if (this._descriptionEn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionEn = this._descriptionEn; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + if (this._regionType !== undefined) { + hasAnyValues = true; + internalValueResult.regionType = this._regionType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwAclRuleSourceRegionListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._descriptionCn = undefined; + this._descriptionEn = undefined; + this._regionId = undefined; + this._regionType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._descriptionCn = value.descriptionCn; + this._descriptionEn = value.descriptionEn; + this._regionId = value.regionId; + this._regionType = value.regionType; + } + } + + // description_cn - computed: false, optional: true, required: false + private _descriptionCn?: string; + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + public set descriptionCn(value: string) { + this._descriptionCn = value; + } + public resetDescriptionCn() { + this._descriptionCn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionCnInput() { + return this._descriptionCn; + } + + // description_en - computed: false, optional: true, required: false + private _descriptionEn?: string; + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + public set descriptionEn(value: string) { + this._descriptionEn = value; + } + public resetDescriptionEn() { + this._descriptionEn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionEnInput() { + return this._descriptionEn; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // region_type - computed: false, optional: false, required: true + private _regionType?: number; + public get regionType() { + return this.getNumberAttribute('region_type'); + } + public set regionType(value: number) { + this._regionType = value; + } + // Temporarily expose input value. Use with caution. + public get regionTypeInput() { + return this._regionType; + } +} + +export class CfwAclRuleSourceRegionListStructList extends cdktf.ComplexList { + public internalValue? : CfwAclRuleSourceRegionListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwAclRuleSourceRegionListStructOutputReference { + return new CfwAclRuleSourceRegionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule huaweicloud_cfw_acl_rule} +*/ +export class CfwAclRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_acl_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwAclRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwAclRule to import + * @param importFromId The id of the existing CfwAclRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwAclRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_acl_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_acl_rule huaweicloud_cfw_acl_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwAclRuleConfig + */ + public constructor(scope: Construct, id: string, config: CfwAclRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_acl_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionType = config.actionType; + this._addressType = config.addressType; + this._description = config.description; + this._destinationAddressGroups = config.destinationAddressGroups; + this._destinationAddressType = config.destinationAddressType; + this._destinationAddresses = config.destinationAddresses; + this._destinationDomainAddressName = config.destinationDomainAddressName; + this._destinationDomainGroupId = config.destinationDomainGroupId; + this._destinationDomainGroupName = config.destinationDomainGroupName; + this._destinationDomainGroupType = config.destinationDomainGroupType; + this._direction = config.direction; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._longConnectEnable = config.longConnectEnable; + this._longConnectTimeHour = config.longConnectTimeHour; + this._longConnectTimeMinute = config.longConnectTimeMinute; + this._longConnectTimeSecond = config.longConnectTimeSecond; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + this._ruleHitCount = config.ruleHitCount; + this._sourceAddressGroups = config.sourceAddressGroups; + this._sourceAddressType = config.sourceAddressType; + this._sourceAddresses = config.sourceAddresses; + this._sourcePredefinedGroups = config.sourcePredefinedGroups; + this._status = config.status; + this._tags = config.tags; + this._type = config.type; + this._customServiceGroups.internalValue = config.customServiceGroups; + this._customServices.internalValue = config.customServices; + this._destinationRegionList.internalValue = config.destinationRegionList; + this._predefinedServiceGroups.internalValue = config.predefinedServiceGroups; + this._sequence.internalValue = config.sequence; + this._sourceRegionList.internalValue = config.sourceRegionList; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_type - computed: false, optional: false, required: true + private _actionType?: number; + public get actionType() { + return this.getNumberAttribute('action_type'); + } + public set actionType(value: number) { + this._actionType = value; + } + // Temporarily expose input value. Use with caution. + public get actionTypeInput() { + return this._actionType; + } + + // address_type - computed: false, optional: false, required: true + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_address_groups - computed: false, optional: true, required: false + private _destinationAddressGroups?: string[]; + public get destinationAddressGroups() { + return this.getListAttribute('destination_address_groups'); + } + public set destinationAddressGroups(value: string[]) { + this._destinationAddressGroups = value; + } + public resetDestinationAddressGroups() { + this._destinationAddressGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationAddressGroupsInput() { + return this._destinationAddressGroups; + } + + // destination_address_type - computed: false, optional: true, required: false + private _destinationAddressType?: number; + public get destinationAddressType() { + return this.getNumberAttribute('destination_address_type'); + } + public set destinationAddressType(value: number) { + this._destinationAddressType = value; + } + public resetDestinationAddressType() { + this._destinationAddressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationAddressTypeInput() { + return this._destinationAddressType; + } + + // destination_addresses - computed: false, optional: true, required: false + private _destinationAddresses?: string[]; + public get destinationAddresses() { + return this.getListAttribute('destination_addresses'); + } + public set destinationAddresses(value: string[]) { + this._destinationAddresses = value; + } + public resetDestinationAddresses() { + this._destinationAddresses = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationAddressesInput() { + return this._destinationAddresses; + } + + // destination_domain_address_name - computed: false, optional: true, required: false + private _destinationDomainAddressName?: string; + public get destinationDomainAddressName() { + return this.getStringAttribute('destination_domain_address_name'); + } + public set destinationDomainAddressName(value: string) { + this._destinationDomainAddressName = value; + } + public resetDestinationDomainAddressName() { + this._destinationDomainAddressName = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationDomainAddressNameInput() { + return this._destinationDomainAddressName; + } + + // destination_domain_group_id - computed: false, optional: true, required: false + private _destinationDomainGroupId?: string; + public get destinationDomainGroupId() { + return this.getStringAttribute('destination_domain_group_id'); + } + public set destinationDomainGroupId(value: string) { + this._destinationDomainGroupId = value; + } + public resetDestinationDomainGroupId() { + this._destinationDomainGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationDomainGroupIdInput() { + return this._destinationDomainGroupId; + } + + // destination_domain_group_name - computed: false, optional: true, required: false + private _destinationDomainGroupName?: string; + public get destinationDomainGroupName() { + return this.getStringAttribute('destination_domain_group_name'); + } + public set destinationDomainGroupName(value: string) { + this._destinationDomainGroupName = value; + } + public resetDestinationDomainGroupName() { + this._destinationDomainGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationDomainGroupNameInput() { + return this._destinationDomainGroupName; + } + + // destination_domain_group_type - computed: false, optional: true, required: false + private _destinationDomainGroupType?: number; + public get destinationDomainGroupType() { + return this.getNumberAttribute('destination_domain_group_type'); + } + public set destinationDomainGroupType(value: number) { + this._destinationDomainGroupType = value; + } + public resetDestinationDomainGroupType() { + this._destinationDomainGroupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationDomainGroupTypeInput() { + return this._destinationDomainGroupType; + } + + // direction - computed: true, optional: true, required: false + private _direction?: number; + public get direction() { + return this.getNumberAttribute('direction'); + } + public set direction(value: number) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // long_connect_enable - computed: false, optional: false, required: true + private _longConnectEnable?: number; + public get longConnectEnable() { + return this.getNumberAttribute('long_connect_enable'); + } + public set longConnectEnable(value: number) { + this._longConnectEnable = value; + } + // Temporarily expose input value. Use with caution. + public get longConnectEnableInput() { + return this._longConnectEnable; + } + + // long_connect_time_hour - computed: true, optional: true, required: false + private _longConnectTimeHour?: number; + public get longConnectTimeHour() { + return this.getNumberAttribute('long_connect_time_hour'); + } + public set longConnectTimeHour(value: number) { + this._longConnectTimeHour = value; + } + public resetLongConnectTimeHour() { + this._longConnectTimeHour = undefined; + } + // Temporarily expose input value. Use with caution. + public get longConnectTimeHourInput() { + return this._longConnectTimeHour; + } + + // long_connect_time_minute - computed: true, optional: true, required: false + private _longConnectTimeMinute?: number; + public get longConnectTimeMinute() { + return this.getNumberAttribute('long_connect_time_minute'); + } + public set longConnectTimeMinute(value: number) { + this._longConnectTimeMinute = value; + } + public resetLongConnectTimeMinute() { + this._longConnectTimeMinute = undefined; + } + // Temporarily expose input value. Use with caution. + public get longConnectTimeMinuteInput() { + return this._longConnectTimeMinute; + } + + // long_connect_time_second - computed: true, optional: true, required: false + private _longConnectTimeSecond?: number; + public get longConnectTimeSecond() { + return this.getNumberAttribute('long_connect_time_second'); + } + public set longConnectTimeSecond(value: number) { + this._longConnectTimeSecond = value; + } + public resetLongConnectTimeSecond() { + this._longConnectTimeSecond = undefined; + } + // Temporarily expose input value. Use with caution. + public get longConnectTimeSecondInput() { + return this._longConnectTimeSecond; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_hit_count - computed: true, optional: true, required: false + private _ruleHitCount?: string; + public get ruleHitCount() { + return this.getStringAttribute('rule_hit_count'); + } + public set ruleHitCount(value: string) { + this._ruleHitCount = value; + } + public resetRuleHitCount() { + this._ruleHitCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleHitCountInput() { + return this._ruleHitCount; + } + + // source_address_groups - computed: false, optional: true, required: false + private _sourceAddressGroups?: string[]; + public get sourceAddressGroups() { + return this.getListAttribute('source_address_groups'); + } + public set sourceAddressGroups(value: string[]) { + this._sourceAddressGroups = value; + } + public resetSourceAddressGroups() { + this._sourceAddressGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceAddressGroupsInput() { + return this._sourceAddressGroups; + } + + // source_address_type - computed: false, optional: true, required: false + private _sourceAddressType?: number; + public get sourceAddressType() { + return this.getNumberAttribute('source_address_type'); + } + public set sourceAddressType(value: number) { + this._sourceAddressType = value; + } + public resetSourceAddressType() { + this._sourceAddressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceAddressTypeInput() { + return this._sourceAddressType; + } + + // source_addresses - computed: false, optional: true, required: false + private _sourceAddresses?: string[]; + public get sourceAddresses() { + return this.getListAttribute('source_addresses'); + } + public set sourceAddresses(value: string[]) { + this._sourceAddresses = value; + } + public resetSourceAddresses() { + this._sourceAddresses = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceAddressesInput() { + return this._sourceAddresses; + } + + // source_predefined_groups - computed: false, optional: true, required: false + private _sourcePredefinedGroups?: string[]; + public get sourcePredefinedGroups() { + return this.getListAttribute('source_predefined_groups'); + } + public set sourcePredefinedGroups(value: string[]) { + this._sourcePredefinedGroups = value; + } + public resetSourcePredefinedGroups() { + this._sourcePredefinedGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePredefinedGroupsInput() { + return this._sourcePredefinedGroups; + } + + // status - computed: false, optional: false, required: true + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // custom_service_groups - computed: false, optional: true, required: false + private _customServiceGroups = new CfwAclRuleCustomServiceGroupsOutputReference(this, "custom_service_groups"); + public get customServiceGroups() { + return this._customServiceGroups; + } + public putCustomServiceGroups(value: CfwAclRuleCustomServiceGroups) { + this._customServiceGroups.internalValue = value; + } + public resetCustomServiceGroups() { + this._customServiceGroups.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customServiceGroupsInput() { + return this._customServiceGroups.internalValue; + } + + // custom_services - computed: false, optional: true, required: false + private _customServices = new CfwAclRuleCustomServicesList(this, "custom_services", false); + public get customServices() { + return this._customServices; + } + public putCustomServices(value: CfwAclRuleCustomServices[] | cdktf.IResolvable) { + this._customServices.internalValue = value; + } + public resetCustomServices() { + this._customServices.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customServicesInput() { + return this._customServices.internalValue; + } + + // destination_region_list - computed: false, optional: true, required: false + private _destinationRegionList = new CfwAclRuleDestinationRegionListStructList(this, "destination_region_list", false); + public get destinationRegionList() { + return this._destinationRegionList; + } + public putDestinationRegionList(value: CfwAclRuleDestinationRegionListStruct[] | cdktf.IResolvable) { + this._destinationRegionList.internalValue = value; + } + public resetDestinationRegionList() { + this._destinationRegionList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationRegionListInput() { + return this._destinationRegionList.internalValue; + } + + // predefined_service_groups - computed: false, optional: true, required: false + private _predefinedServiceGroups = new CfwAclRulePredefinedServiceGroupsOutputReference(this, "predefined_service_groups"); + public get predefinedServiceGroups() { + return this._predefinedServiceGroups; + } + public putPredefinedServiceGroups(value: CfwAclRulePredefinedServiceGroups) { + this._predefinedServiceGroups.internalValue = value; + } + public resetPredefinedServiceGroups() { + this._predefinedServiceGroups.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get predefinedServiceGroupsInput() { + return this._predefinedServiceGroups.internalValue; + } + + // sequence - computed: false, optional: false, required: true + private _sequence = new CfwAclRuleSequenceOutputReference(this, "sequence"); + public get sequence() { + return this._sequence; + } + public putSequence(value: CfwAclRuleSequence) { + this._sequence.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sequenceInput() { + return this._sequence.internalValue; + } + + // source_region_list - computed: false, optional: true, required: false + private _sourceRegionList = new CfwAclRuleSourceRegionListStructList(this, "source_region_list", false); + public get sourceRegionList() { + return this._sourceRegionList; + } + public putSourceRegionList(value: CfwAclRuleSourceRegionListStruct[] | cdktf.IResolvable) { + this._sourceRegionList.internalValue = value; + } + public resetSourceRegionList() { + this._sourceRegionList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceRegionListInput() { + return this._sourceRegionList.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_type: cdktf.numberToTerraform(this._actionType), + address_type: cdktf.numberToTerraform(this._addressType), + description: cdktf.stringToTerraform(this._description), + destination_address_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._destinationAddressGroups), + destination_address_type: cdktf.numberToTerraform(this._destinationAddressType), + destination_addresses: cdktf.listMapper(cdktf.stringToTerraform, false)(this._destinationAddresses), + destination_domain_address_name: cdktf.stringToTerraform(this._destinationDomainAddressName), + destination_domain_group_id: cdktf.stringToTerraform(this._destinationDomainGroupId), + destination_domain_group_name: cdktf.stringToTerraform(this._destinationDomainGroupName), + destination_domain_group_type: cdktf.numberToTerraform(this._destinationDomainGroupType), + direction: cdktf.numberToTerraform(this._direction), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + long_connect_enable: cdktf.numberToTerraform(this._longConnectEnable), + long_connect_time_hour: cdktf.numberToTerraform(this._longConnectTimeHour), + long_connect_time_minute: cdktf.numberToTerraform(this._longConnectTimeMinute), + long_connect_time_second: cdktf.numberToTerraform(this._longConnectTimeSecond), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + rule_hit_count: cdktf.stringToTerraform(this._ruleHitCount), + source_address_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sourceAddressGroups), + source_address_type: cdktf.numberToTerraform(this._sourceAddressType), + source_addresses: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sourceAddresses), + source_predefined_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sourcePredefinedGroups), + status: cdktf.numberToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.numberToTerraform(this._type), + custom_service_groups: cfwAclRuleCustomServiceGroupsToTerraform(this._customServiceGroups.internalValue), + custom_services: cdktf.listMapper(cfwAclRuleCustomServicesToTerraform, true)(this._customServices.internalValue), + destination_region_list: cdktf.listMapper(cfwAclRuleDestinationRegionListStructToTerraform, true)(this._destinationRegionList.internalValue), + predefined_service_groups: cfwAclRulePredefinedServiceGroupsToTerraform(this._predefinedServiceGroups.internalValue), + sequence: cfwAclRuleSequenceToTerraform(this._sequence.internalValue), + source_region_list: cdktf.listMapper(cfwAclRuleSourceRegionListStructToTerraform, true)(this._sourceRegionList.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_type: { + value: cdktf.numberToHclTerraform(this._actionType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + address_type: { + value: cdktf.numberToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_address_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._destinationAddressGroups), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + destination_address_type: { + value: cdktf.numberToHclTerraform(this._destinationAddressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + destination_addresses: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._destinationAddresses), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + destination_domain_address_name: { + value: cdktf.stringToHclTerraform(this._destinationDomainAddressName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_domain_group_id: { + value: cdktf.stringToHclTerraform(this._destinationDomainGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_domain_group_name: { + value: cdktf.stringToHclTerraform(this._destinationDomainGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_domain_group_type: { + value: cdktf.numberToHclTerraform(this._destinationDomainGroupType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + direction: { + value: cdktf.numberToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + long_connect_enable: { + value: cdktf.numberToHclTerraform(this._longConnectEnable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + long_connect_time_hour: { + value: cdktf.numberToHclTerraform(this._longConnectTimeHour), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + long_connect_time_minute: { + value: cdktf.numberToHclTerraform(this._longConnectTimeMinute), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + long_connect_time_second: { + value: cdktf.numberToHclTerraform(this._longConnectTimeSecond), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_hit_count: { + value: cdktf.stringToHclTerraform(this._ruleHitCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_address_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sourceAddressGroups), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + source_address_type: { + value: cdktf.numberToHclTerraform(this._sourceAddressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_addresses: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sourceAddresses), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + source_predefined_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sourcePredefinedGroups), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + custom_service_groups: { + value: cfwAclRuleCustomServiceGroupsToHclTerraform(this._customServiceGroups.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwAclRuleCustomServiceGroupsList", + }, + custom_services: { + value: cdktf.listMapperHcl(cfwAclRuleCustomServicesToHclTerraform, true)(this._customServices.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwAclRuleCustomServicesList", + }, + destination_region_list: { + value: cdktf.listMapperHcl(cfwAclRuleDestinationRegionListStructToHclTerraform, true)(this._destinationRegionList.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwAclRuleDestinationRegionListStructList", + }, + predefined_service_groups: { + value: cfwAclRulePredefinedServiceGroupsToHclTerraform(this._predefinedServiceGroups.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwAclRulePredefinedServiceGroupsList", + }, + sequence: { + value: cfwAclRuleSequenceToHclTerraform(this._sequence.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwAclRuleSequenceList", + }, + source_region_list: { + value: cdktf.listMapperHcl(cfwAclRuleSourceRegionListStructToHclTerraform, true)(this._sourceRegionList.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwAclRuleSourceRegionListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-address-group-member/README.md b/src/constructs/providers/huaweicloud/cfw-address-group-member/README.md new file mode 100644 index 00000000..3acbaa83 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-address-group-member/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_address_group_member` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_address_group_member`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member). diff --git a/src/constructs/providers/huaweicloud/cfw-address-group-member/index.ts b/src/constructs/providers/huaweicloud/cfw-address-group-member/index.ts new file mode 100644 index 00000000..1d312d45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-address-group-member/index.ts @@ -0,0 +1,288 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwAddressGroupMemberConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#address CfwAddressGroupMember#address} + */ + readonly address: string; + /** + * Specifies the address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#address_type CfwAddressGroupMember#address_type} + */ + readonly addressType?: number; + /** + * Specifies address description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#description CfwAddressGroupMember#description} + */ + readonly description?: string; + /** + * Specifies the ID of the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#group_id CfwAddressGroupMember#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#id CfwAddressGroupMember#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Deprecated; Specifies the address name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#name CfwAddressGroupMember#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#region CfwAddressGroupMember#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member huaweicloud_cfw_address_group_member} +*/ +export class CfwAddressGroupMember extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_address_group_member"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwAddressGroupMember resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwAddressGroupMember to import + * @param importFromId The id of the existing CfwAddressGroupMember that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwAddressGroupMember to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_address_group_member", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group_member huaweicloud_cfw_address_group_member} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwAddressGroupMemberConfig + */ + public constructor(scope: Construct, id: string, config: CfwAddressGroupMemberConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_address_group_member', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._addressType = config.addressType; + this._description = config.description; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_type - computed: true, optional: true, required: false + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + public resetAddressType() { + this._addressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + address_type: cdktf.numberToTerraform(this._addressType), + description: cdktf.stringToTerraform(this._description), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.numberToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-address-group/README.md b/src/constructs/providers/huaweicloud/cfw-address-group/README.md new file mode 100644 index 00000000..3e571b04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-address-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_address_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_address_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group). diff --git a/src/constructs/providers/huaweicloud/cfw-address-group/index.ts b/src/constructs/providers/huaweicloud/cfw-address-group/index.ts new file mode 100644 index 00000000..f1b8e34b --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-address-group/index.ts @@ -0,0 +1,258 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwAddressGroupConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Computed; Specifies the Address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#address_type CfwAddressGroup#address_type} + */ + readonly addressType?: number; + /** + * Specifies the Address group description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#description CfwAddressGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#id CfwAddressGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP address group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#name CfwAddressGroup#name} + */ + readonly name: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#object_id CfwAddressGroup#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#region CfwAddressGroup#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group huaweicloud_cfw_address_group} +*/ +export class CfwAddressGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_address_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwAddressGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwAddressGroup to import + * @param importFromId The id of the existing CfwAddressGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwAddressGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_address_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_address_group huaweicloud_cfw_address_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwAddressGroupConfig + */ + public constructor(scope: Construct, id: string, config: CfwAddressGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_address_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._addressType = config.addressType; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address_type - computed: true, optional: true, required: false + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + public resetAddressType() { + this._addressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address_type: cdktf.numberToTerraform(this._addressType), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address_type: { + value: cdktf.numberToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-black-white-list/README.md b/src/constructs/providers/huaweicloud/cfw-black-white-list/README.md new file mode 100644 index 00000000..8b0e380f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-black-white-list/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_black_white_list` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_black_white_list`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list). diff --git a/src/constructs/providers/huaweicloud/cfw-black-white-list/index.ts b/src/constructs/providers/huaweicloud/cfw-black-white-list/index.ts new file mode 100644 index 00000000..2ab02bc6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-black-white-list/index.ts @@ -0,0 +1,366 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwBlackWhiteListConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#address CfwBlackWhiteList#address} + */ + readonly address: string; + /** + * Specifies the IP address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#address_type CfwBlackWhiteList#address_type} + */ + readonly addressType: number; + /** + * Specifies the description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#description CfwBlackWhiteList#description} + */ + readonly description?: string; + /** + * Specifies the address direction. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#direction CfwBlackWhiteList#direction} + */ + readonly direction: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#id CfwBlackWhiteList#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the list type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#list_type CfwBlackWhiteList#list_type} + */ + readonly listType: number; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#object_id CfwBlackWhiteList#object_id} + */ + readonly objectId: string; + /** + * Specifies the destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#port CfwBlackWhiteList#port} + */ + readonly port?: string; + /** + * Specifies the protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#protocol CfwBlackWhiteList#protocol} + */ + readonly protocol: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#region CfwBlackWhiteList#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list huaweicloud_cfw_black_white_list} +*/ +export class CfwBlackWhiteList extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_black_white_list"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwBlackWhiteList resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwBlackWhiteList to import + * @param importFromId The id of the existing CfwBlackWhiteList that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwBlackWhiteList to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_black_white_list", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_black_white_list huaweicloud_cfw_black_white_list} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwBlackWhiteListConfig + */ + public constructor(scope: Construct, id: string, config: CfwBlackWhiteListConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_black_white_list', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._addressType = config.addressType; + this._description = config.description; + this._direction = config.direction; + this._id = config.id; + this._listType = config.listType; + this._objectId = config.objectId; + this._port = config.port; + this._protocol = config.protocol; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_type - computed: false, optional: false, required: true + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: false, optional: false, required: true + private _direction?: number; + public get direction() { + return this.getNumberAttribute('direction'); + } + public set direction(value: number) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // list_type - computed: false, optional: false, required: true + private _listType?: number; + public get listType() { + return this.getNumberAttribute('list_type'); + } + public set listType(value: number) { + this._listType = value; + } + // Temporarily expose input value. Use with caution. + public get listTypeInput() { + return this._listType; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + address_type: cdktf.numberToTerraform(this._addressType), + description: cdktf.stringToTerraform(this._description), + direction: cdktf.numberToTerraform(this._direction), + id: cdktf.stringToTerraform(this._id), + list_type: cdktf.numberToTerraform(this._listType), + object_id: cdktf.stringToTerraform(this._objectId), + port: cdktf.stringToTerraform(this._port), + protocol: cdktf.numberToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.numberToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.numberToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_type: { + value: cdktf.numberToHclTerraform(this._listType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-capture-task/README.md b/src/constructs/providers/huaweicloud/cfw-capture-task/README.md new file mode 100644 index 00000000..7fc75d51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-capture-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_capture_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_capture_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task). diff --git a/src/constructs/providers/huaweicloud/cfw-capture-task/index.ts b/src/constructs/providers/huaweicloud/cfw-capture-task/index.ts new file mode 100644 index 00000000..2dc1cc66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-capture-task/index.ts @@ -0,0 +1,923 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwCaptureTaskConfig extends cdktf.TerraformMetaArguments { + /** + * The capture task duration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#duration CfwCaptureTask#duration} + */ + readonly duration: number; + /** + * The ID of the firewall instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#fw_instance_id CfwCaptureTask#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#id CfwCaptureTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The maximum number of packets captured. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#max_packets CfwCaptureTask#max_packets} + */ + readonly maxPackets: number; + /** + * The capture task name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#name CfwCaptureTask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#region CfwCaptureTask#region} + */ + readonly region?: string; + /** + * Whether to stop the capture. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#stop_capture CfwCaptureTask#stop_capture} + */ + readonly stopCapture?: boolean | cdktf.IResolvable; + /** + * destination block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#destination CfwCaptureTask#destination} + */ + readonly destination: CfwCaptureTaskDestination; + /** + * service block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#service CfwCaptureTask#service} + */ + readonly service: CfwCaptureTaskService; + /** + * source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#source CfwCaptureTask#source} + */ + readonly source: CfwCaptureTaskSource; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#timeouts CfwCaptureTask#timeouts} + */ + readonly timeouts?: CfwCaptureTaskTimeouts; +} +export interface CfwCaptureTaskDestination { + /** + * The address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#address CfwCaptureTask#address} + */ + readonly address: string; + /** + * The address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#address_type CfwCaptureTask#address_type} + */ + readonly addressType: number; +} + +export function cfwCaptureTaskDestinationToTerraform(struct?: CfwCaptureTaskDestinationOutputReference | CfwCaptureTaskDestination): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + address_type: cdktf.numberToTerraform(struct!.addressType), + } +} + + +export function cfwCaptureTaskDestinationToHclTerraform(struct?: CfwCaptureTaskDestinationOutputReference | CfwCaptureTaskDestination): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.numberToHclTerraform(struct!.addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwCaptureTaskDestinationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwCaptureTaskDestination | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._addressType !== undefined) { + hasAnyValues = true; + internalValueResult.addressType = this._addressType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwCaptureTaskDestination | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._address = undefined; + this._addressType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._address = value.address; + this._addressType = value.addressType; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_type - computed: false, optional: false, required: true + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } +} +export interface CfwCaptureTaskService { + /** + * The destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#dest_port CfwCaptureTask#dest_port} + */ + readonly destPort?: string; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#protocol CfwCaptureTask#protocol} + */ + readonly protocol: number; + /** + * The source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#source_port CfwCaptureTask#source_port} + */ + readonly sourcePort?: string; +} + +export function cfwCaptureTaskServiceToTerraform(struct?: CfwCaptureTaskServiceOutputReference | CfwCaptureTaskService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_port: cdktf.stringToTerraform(struct!.destPort), + protocol: cdktf.numberToTerraform(struct!.protocol), + source_port: cdktf.stringToTerraform(struct!.sourcePort), + } +} + + +export function cfwCaptureTaskServiceToHclTerraform(struct?: CfwCaptureTaskServiceOutputReference | CfwCaptureTaskService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_port: { + value: cdktf.stringToHclTerraform(struct!.destPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_port: { + value: cdktf.stringToHclTerraform(struct!.sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwCaptureTaskServiceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwCaptureTaskService | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destPort !== undefined) { + hasAnyValues = true; + internalValueResult.destPort = this._destPort; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._sourcePort !== undefined) { + hasAnyValues = true; + internalValueResult.sourcePort = this._sourcePort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwCaptureTaskService | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._destPort = undefined; + this._protocol = undefined; + this._sourcePort = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._destPort = value.destPort; + this._protocol = value.protocol; + this._sourcePort = value.sourcePort; + } + } + + // dest_port - computed: false, optional: true, required: false + private _destPort?: string; + public get destPort() { + return this.getStringAttribute('dest_port'); + } + public set destPort(value: string) { + this._destPort = value; + } + public resetDestPort() { + this._destPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destPortInput() { + return this._destPort; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } +} +export interface CfwCaptureTaskSource { + /** + * The address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#address CfwCaptureTask#address} + */ + readonly address: string; + /** + * The address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#address_type CfwCaptureTask#address_type} + */ + readonly addressType: number; +} + +export function cfwCaptureTaskSourceToTerraform(struct?: CfwCaptureTaskSourceOutputReference | CfwCaptureTaskSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + address_type: cdktf.numberToTerraform(struct!.addressType), + } +} + + +export function cfwCaptureTaskSourceToHclTerraform(struct?: CfwCaptureTaskSourceOutputReference | CfwCaptureTaskSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.numberToHclTerraform(struct!.addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwCaptureTaskSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwCaptureTaskSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._addressType !== undefined) { + hasAnyValues = true; + internalValueResult.addressType = this._addressType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwCaptureTaskSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._address = undefined; + this._addressType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._address = value.address; + this._addressType = value.addressType; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_type - computed: false, optional: false, required: true + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } +} +export interface CfwCaptureTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#delete CfwCaptureTask#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#update CfwCaptureTask#update} + */ + readonly update?: string; +} + +export function cfwCaptureTaskTimeoutsToTerraform(struct?: CfwCaptureTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cfwCaptureTaskTimeoutsToHclTerraform(struct?: CfwCaptureTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwCaptureTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CfwCaptureTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwCaptureTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + this._update = value.update; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task huaweicloud_cfw_capture_task} +*/ +export class CfwCaptureTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_capture_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwCaptureTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwCaptureTask to import + * @param importFromId The id of the existing CfwCaptureTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwCaptureTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_capture_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_capture_task huaweicloud_cfw_capture_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwCaptureTaskConfig + */ + public constructor(scope: Construct, id: string, config: CfwCaptureTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_capture_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._duration = config.duration; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._maxPackets = config.maxPackets; + this._name = config.name; + this._region = config.region; + this._stopCapture = config.stopCapture; + this._destination.internalValue = config.destination; + this._service.internalValue = config.service; + this._source.internalValue = config.source; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // duration - computed: false, optional: false, required: true + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_packets - computed: false, optional: false, required: true + private _maxPackets?: number; + public get maxPackets() { + return this.getNumberAttribute('max_packets'); + } + public set maxPackets(value: number) { + this._maxPackets = value; + } + // Temporarily expose input value. Use with caution. + public get maxPacketsInput() { + return this._maxPackets; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // stop_capture - computed: false, optional: true, required: false + private _stopCapture?: boolean | cdktf.IResolvable; + public get stopCapture() { + return this.getBooleanAttribute('stop_capture'); + } + public set stopCapture(value: boolean | cdktf.IResolvable) { + this._stopCapture = value; + } + public resetStopCapture() { + this._stopCapture = undefined; + } + // Temporarily expose input value. Use with caution. + public get stopCaptureInput() { + return this._stopCapture; + } + + // task_id - computed: true, optional: false, required: false + public get taskId() { + return this.getStringAttribute('task_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // destination - computed: false, optional: false, required: true + private _destination = new CfwCaptureTaskDestinationOutputReference(this, "destination"); + public get destination() { + return this._destination; + } + public putDestination(value: CfwCaptureTaskDestination) { + this._destination.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination.internalValue; + } + + // service - computed: false, optional: false, required: true + private _service = new CfwCaptureTaskServiceOutputReference(this, "service"); + public get service() { + return this._service; + } + public putService(value: CfwCaptureTaskService) { + this._service.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service.internalValue; + } + + // source - computed: false, optional: false, required: true + private _source = new CfwCaptureTaskSourceOutputReference(this, "source"); + public get source() { + return this._source; + } + public putSource(value: CfwCaptureTaskSource) { + this._source.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CfwCaptureTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CfwCaptureTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + duration: cdktf.numberToTerraform(this._duration), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + max_packets: cdktf.numberToTerraform(this._maxPackets), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + stop_capture: cdktf.booleanToTerraform(this._stopCapture), + destination: cfwCaptureTaskDestinationToTerraform(this._destination.internalValue), + service: cfwCaptureTaskServiceToTerraform(this._service.internalValue), + source: cfwCaptureTaskSourceToTerraform(this._source.internalValue), + timeouts: cfwCaptureTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + duration: { + value: cdktf.numberToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_packets: { + value: cdktf.numberToHclTerraform(this._maxPackets), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stop_capture: { + value: cdktf.booleanToHclTerraform(this._stopCapture), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + destination: { + value: cfwCaptureTaskDestinationToHclTerraform(this._destination.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwCaptureTaskDestinationList", + }, + service: { + value: cfwCaptureTaskServiceToHclTerraform(this._service.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwCaptureTaskServiceList", + }, + source: { + value: cfwCaptureTaskSourceToHclTerraform(this._source.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwCaptureTaskSourceList", + }, + timeouts: { + value: cfwCaptureTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CfwCaptureTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-dns-resolution/README.md b/src/constructs/providers/huaweicloud/cfw-dns-resolution/README.md new file mode 100644 index 00000000..0eddab8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-dns-resolution/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_dns_resolution` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_dns_resolution`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution). diff --git a/src/constructs/providers/huaweicloud/cfw-dns-resolution/index.ts b/src/constructs/providers/huaweicloud/cfw-dns-resolution/index.ts new file mode 100644 index 00000000..21beca1c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-dns-resolution/index.ts @@ -0,0 +1,261 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwDnsResolutionConfig extends cdktf.TerraformMetaArguments { + /** + * The custom DNS servers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#custom_dns_servers CfwDnsResolution#custom_dns_servers} + */ + readonly customDnsServers?: string[]; + /** + * The default DNS servers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#default_dns_servers CfwDnsResolution#default_dns_servers} + */ + readonly defaultDnsServers?: string[]; + /** + * The ID of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#fw_instance_id CfwDnsResolution#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * The health check domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#health_check_domain_name CfwDnsResolution#health_check_domain_name} + */ + readonly healthCheckDomainName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#id CfwDnsResolution#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#region CfwDnsResolution#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution huaweicloud_cfw_dns_resolution} +*/ +export class CfwDnsResolution extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_dns_resolution"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwDnsResolution resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwDnsResolution to import + * @param importFromId The id of the existing CfwDnsResolution that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwDnsResolution to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_dns_resolution", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_dns_resolution huaweicloud_cfw_dns_resolution} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwDnsResolutionConfig + */ + public constructor(scope: Construct, id: string, config: CfwDnsResolutionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_dns_resolution', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._customDnsServers = config.customDnsServers; + this._defaultDnsServers = config.defaultDnsServers; + this._fwInstanceId = config.fwInstanceId; + this._healthCheckDomainName = config.healthCheckDomainName; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // custom_dns_servers - computed: false, optional: true, required: false + private _customDnsServers?: string[]; + public get customDnsServers() { + return cdktf.Fn.tolist(this.getListAttribute('custom_dns_servers')); + } + public set customDnsServers(value: string[]) { + this._customDnsServers = value; + } + public resetCustomDnsServers() { + this._customDnsServers = undefined; + } + // Temporarily expose input value. Use with caution. + public get customDnsServersInput() { + return this._customDnsServers; + } + + // default_dns_servers - computed: false, optional: true, required: false + private _defaultDnsServers?: string[]; + public get defaultDnsServers() { + return cdktf.Fn.tolist(this.getListAttribute('default_dns_servers')); + } + public set defaultDnsServers(value: string[]) { + this._defaultDnsServers = value; + } + public resetDefaultDnsServers() { + this._defaultDnsServers = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultDnsServersInput() { + return this._defaultDnsServers; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // health_check_domain_name - computed: true, optional: true, required: false + private _healthCheckDomainName?: string; + public get healthCheckDomainName() { + return this.getStringAttribute('health_check_domain_name'); + } + public set healthCheckDomainName(value: string) { + this._healthCheckDomainName = value; + } + public resetHealthCheckDomainName() { + this._healthCheckDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthCheckDomainNameInput() { + return this._healthCheckDomainName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + custom_dns_servers: cdktf.listMapper(cdktf.stringToTerraform, false)(this._customDnsServers), + default_dns_servers: cdktf.listMapper(cdktf.stringToTerraform, false)(this._defaultDnsServers), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + health_check_domain_name: cdktf.stringToTerraform(this._healthCheckDomainName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + custom_dns_servers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._customDnsServers), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + default_dns_servers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._defaultDnsServers), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + health_check_domain_name: { + value: cdktf.stringToHclTerraform(this._healthCheckDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-domain-name-group/README.md b/src/constructs/providers/huaweicloud/cfw-domain-name-group/README.md new file mode 100644 index 00000000..11f2851d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-domain-name-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_domain_name_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_domain_name_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group). diff --git a/src/constructs/providers/huaweicloud/cfw-domain-name-group/index.ts b/src/constructs/providers/huaweicloud/cfw-domain-name-group/index.ts new file mode 100644 index 00000000..b18079cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-domain-name-group/index.ts @@ -0,0 +1,487 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwDomainNameGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the domain name group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#description CfwDomainNameGroup#description} + */ + readonly description?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#fw_instance_id CfwDomainNameGroup#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#id CfwDomainNameGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the domain name group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#name CfwDomainNameGroup#name} + */ + readonly name: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#object_id CfwDomainNameGroup#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#region CfwDomainNameGroup#region} + */ + readonly region?: string; + /** + * Specifies the type of the domain name group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#type CfwDomainNameGroup#type} + */ + readonly type: number; + /** + * domain_names block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#domain_names CfwDomainNameGroup#domain_names} + */ + readonly domainNames?: CfwDomainNameGroupDomainNames[] | cdktf.IResolvable; +} +export interface CfwDomainNameGroupDomainNames { + /** + * Specifies the description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#description CfwDomainNameGroup#description} + */ + readonly description?: string; + /** + * Specifies the domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#domain_name CfwDomainNameGroup#domain_name} + */ + readonly domainName: string; +} + +export function cfwDomainNameGroupDomainNamesToTerraform(struct?: CfwDomainNameGroupDomainNames | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + domain_name: cdktf.stringToTerraform(struct!.domainName), + } +} + + +export function cfwDomainNameGroupDomainNamesToHclTerraform(struct?: CfwDomainNameGroupDomainNames | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(struct!.domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwDomainNameGroupDomainNamesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwDomainNameGroupDomainNames | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._domainName !== undefined) { + hasAnyValues = true; + internalValueResult.domainName = this._domainName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwDomainNameGroupDomainNames | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._domainName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._domainName = value.domainName; + } + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dns_ips - computed: true, optional: false, required: false + public get dnsIps() { + return this.getStringAttribute('dns_ips'); + } + + // domain_address_id - computed: true, optional: false, required: false + public get domainAddressId() { + return this.getStringAttribute('domain_address_id'); + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } +} + +export class CfwDomainNameGroupDomainNamesList extends cdktf.ComplexList { + public internalValue? : CfwDomainNameGroupDomainNames[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwDomainNameGroupDomainNamesOutputReference { + return new CfwDomainNameGroupDomainNamesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group huaweicloud_cfw_domain_name_group} +*/ +export class CfwDomainNameGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_domain_name_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwDomainNameGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwDomainNameGroup to import + * @param importFromId The id of the existing CfwDomainNameGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwDomainNameGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_domain_name_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_domain_name_group huaweicloud_cfw_domain_name_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwDomainNameGroupConfig + */ + public constructor(scope: Construct, id: string, config: CfwDomainNameGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_domain_name_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + this._type = config.type; + this._domainNames.internalValue = config.domainNames; + } + + // ========== + // ATTRIBUTES + // ========== + + // config_status - computed: true, optional: false, required: false + public get configStatus() { + return this.getNumberAttribute('config_status'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // ref_count - computed: true, optional: false, required: false + public get refCount() { + return this.getNumberAttribute('ref_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // domain_names - computed: false, optional: true, required: false + private _domainNames = new CfwDomainNameGroupDomainNamesList(this, "domain_names", false); + public get domainNames() { + return this._domainNames; + } + public putDomainNames(value: CfwDomainNameGroupDomainNames[] | cdktf.IResolvable) { + this._domainNames.internalValue = value; + } + public resetDomainNames() { + this._domainNames.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNamesInput() { + return this._domainNames.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.numberToTerraform(this._type), + domain_names: cdktf.listMapper(cfwDomainNameGroupDomainNamesToTerraform, true)(this._domainNames.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + domain_names: { + value: cdktf.listMapperHcl(cfwDomainNameGroupDomainNamesToHclTerraform, true)(this._domainNames.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwDomainNameGroupDomainNamesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-eip-protection/README.md b/src/constructs/providers/huaweicloud/cfw-eip-protection/README.md new file mode 100644 index 00000000..78185efe --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-eip-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_eip_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_eip_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection). diff --git a/src/constructs/providers/huaweicloud/cfw-eip-protection/index.ts b/src/constructs/providers/huaweicloud/cfw-eip-protection/index.ts new file mode 100644 index 00000000..f720f9b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-eip-protection/index.ts @@ -0,0 +1,576 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwEipProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#id CfwEipProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#object_id CfwEipProtection#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#region CfwEipProtection#region} + */ + readonly region?: string; + /** + * protected_eip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#protected_eip CfwEipProtection#protected_eip} + */ + readonly protectedEip: CfwEipProtectionProtectedEip[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#timeouts CfwEipProtection#timeouts} + */ + readonly timeouts?: CfwEipProtectionTimeouts; +} +export interface CfwEipProtectionProtectedEip { + /** + * The ID of the protected EIP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#id CfwEipProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * The IPv4 address of the protected EIP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#public_ipv4 CfwEipProtection#public_ipv4} + */ + readonly publicIpv4?: string; + /** + * The IPv6 address of the protected EIP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#public_ipv6 CfwEipProtection#public_ipv6} + */ + readonly publicIpv6?: string; +} + +export function cfwEipProtectionProtectedEipToTerraform(struct?: CfwEipProtectionProtectedEip | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + public_ipv4: cdktf.stringToTerraform(struct!.publicIpv4), + public_ipv6: cdktf.stringToTerraform(struct!.publicIpv6), + } +} + + +export function cfwEipProtectionProtectedEipToHclTerraform(struct?: CfwEipProtectionProtectedEip | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ipv4: { + value: cdktf.stringToHclTerraform(struct!.publicIpv4), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ipv6: { + value: cdktf.stringToHclTerraform(struct!.publicIpv6), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwEipProtectionProtectedEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwEipProtectionProtectedEip | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._publicIpv4 !== undefined) { + hasAnyValues = true; + internalValueResult.publicIpv4 = this._publicIpv4; + } + if (this._publicIpv6 !== undefined) { + hasAnyValues = true; + internalValueResult.publicIpv6 = this._publicIpv6; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwEipProtectionProtectedEip | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._publicIpv4 = undefined; + this._publicIpv6 = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._publicIpv4 = value.publicIpv4; + this._publicIpv6 = value.publicIpv6; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // public_ipv4 - computed: true, optional: true, required: false + private _publicIpv4?: string; + public get publicIpv4() { + return this.getStringAttribute('public_ipv4'); + } + public set publicIpv4(value: string) { + this._publicIpv4 = value; + } + public resetPublicIpv4() { + this._publicIpv4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpv4Input() { + return this._publicIpv4; + } + + // public_ipv6 - computed: true, optional: true, required: false + private _publicIpv6?: string; + public get publicIpv6() { + return this.getStringAttribute('public_ipv6'); + } + public set publicIpv6(value: string) { + this._publicIpv6 = value; + } + public resetPublicIpv6() { + this._publicIpv6 = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpv6Input() { + return this._publicIpv6; + } +} + +export class CfwEipProtectionProtectedEipList extends cdktf.ComplexList { + public internalValue? : CfwEipProtectionProtectedEip[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwEipProtectionProtectedEipOutputReference { + return new CfwEipProtectionProtectedEipOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwEipProtectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#create CfwEipProtection#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#delete CfwEipProtection#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#update CfwEipProtection#update} + */ + readonly update?: string; +} + +export function cfwEipProtectionTimeoutsToTerraform(struct?: CfwEipProtectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cfwEipProtectionTimeoutsToHclTerraform(struct?: CfwEipProtectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwEipProtectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CfwEipProtectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwEipProtectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection huaweicloud_cfw_eip_protection} +*/ +export class CfwEipProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_eip_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwEipProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwEipProtection to import + * @param importFromId The id of the existing CfwEipProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwEipProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_eip_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_eip_protection huaweicloud_cfw_eip_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwEipProtectionConfig + */ + public constructor(scope: Construct, id: string, config: CfwEipProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_eip_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._objectId = config.objectId; + this._region = config.region; + this._protectedEip.internalValue = config.protectedEip; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // protected_eip - computed: false, optional: false, required: true + private _protectedEip = new CfwEipProtectionProtectedEipList(this, "protected_eip", true); + public get protectedEip() { + return this._protectedEip; + } + public putProtectedEip(value: CfwEipProtectionProtectedEip[] | cdktf.IResolvable) { + this._protectedEip.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get protectedEipInput() { + return this._protectedEip.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CfwEipProtectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CfwEipProtectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + protected_eip: cdktf.listMapper(cfwEipProtectionProtectedEipToTerraform, true)(this._protectedEip.internalValue), + timeouts: cfwEipProtectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected_eip: { + value: cdktf.listMapperHcl(cfwEipProtectionProtectedEipToHclTerraform, true)(this._protectedEip.internalValue), + isBlock: true, + type: "set", + storageClassType: "CfwEipProtectionProtectedEipList", + }, + timeouts: { + value: cfwEipProtectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CfwEipProtectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-firewall/README.md b/src/constructs/providers/huaweicloud/cfw-firewall/README.md new file mode 100644 index 00000000..58d5d913 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-firewall/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_firewall` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_firewall`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall). diff --git a/src/constructs/providers/huaweicloud/cfw-firewall/index.ts b/src/constructs/providers/huaweicloud/cfw-firewall/index.ts new file mode 100644 index 00000000..4413b004 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-firewall/index.ts @@ -0,0 +1,1078 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwFirewallConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#auto_renew CfwFirewall#auto_renew} + */ + readonly autoRenew?: string; + /** + * Specifies the charging mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#charging_mode CfwFirewall#charging_mode} + */ + readonly chargingMode?: string; + /** + * Specifies the ER ID of the east-west firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#east_west_firewall_er_id CfwFirewall#east_west_firewall_er_id} + */ + readonly eastWestFirewallErId?: string; + /** + * Specifies the inspection cidr of the east-west firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#east_west_firewall_inspection_cidr CfwFirewall#east_west_firewall_inspection_cidr} + */ + readonly eastWestFirewallInspectionCidr?: string; + /** + * Specifies the mode of the east-west firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#east_west_firewall_mode CfwFirewall#east_west_firewall_mode} + */ + readonly eastWestFirewallMode?: string; + /** + * Specifies the protection statue of the east-west firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#east_west_firewall_status CfwFirewall#east_west_firewall_status} + */ + readonly eastWestFirewallStatus?: number; + /** + * Specifies the enterprise project ID of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#enterprise_project_id CfwFirewall#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#id CfwFirewall#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IPS protection mode of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#ips_protection_mode CfwFirewall#ips_protection_mode} + */ + readonly ipsProtectionMode?: number; + /** + * Specifies the IPS patch switch status of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#ips_switch_status CfwFirewall#ips_switch_status} + */ + readonly ipsSwitchStatus?: number; + /** + * Specifies the firewall name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#name CfwFirewall#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#period CfwFirewall#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#period_unit CfwFirewall#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#region CfwFirewall#region} + */ + readonly region?: string; + /** + * Specifies the key/value pairs to associate with the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#tags CfwFirewall#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * flavor block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#flavor CfwFirewall#flavor} + */ + readonly flavor: CfwFirewallFlavor; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#timeouts CfwFirewall#timeouts} + */ + readonly timeouts?: CfwFirewallTimeouts; +} +export interface CfwFirewallProtectObjects { +} + +export function cfwFirewallProtectObjectsToTerraform(struct?: CfwFirewallProtectObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cfwFirewallProtectObjectsToHclTerraform(struct?: CfwFirewallProtectObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CfwFirewallProtectObjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwFirewallProtectObjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwFirewallProtectObjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // object_id - computed: true, optional: false, required: false + public get objectId() { + return this.getStringAttribute('object_id'); + } + + // object_name - computed: true, optional: false, required: false + public get objectName() { + return this.getStringAttribute('object_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class CfwFirewallProtectObjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwFirewallProtectObjectsOutputReference { + return new CfwFirewallProtectObjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwFirewallFlavor { + /** + * Specifies the extend bandwidth of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#extend_bandwidth CfwFirewall#extend_bandwidth} + */ + readonly extendBandwidth?: number; + /** + * Specifies the extend EIP number of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#extend_eip_count CfwFirewall#extend_eip_count} + */ + readonly extendEipCount?: number; + /** + * Specifies the extend VPC number of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#extend_vpc_count CfwFirewall#extend_vpc_count} + */ + readonly extendVpcCount?: number; + /** + * Specifies the version of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#version CfwFirewall#version} + */ + readonly version: string; +} + +export function cfwFirewallFlavorToTerraform(struct?: CfwFirewallFlavorOutputReference | CfwFirewallFlavor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + extend_bandwidth: cdktf.numberToTerraform(struct!.extendBandwidth), + extend_eip_count: cdktf.numberToTerraform(struct!.extendEipCount), + extend_vpc_count: cdktf.numberToTerraform(struct!.extendVpcCount), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function cfwFirewallFlavorToHclTerraform(struct?: CfwFirewallFlavorOutputReference | CfwFirewallFlavor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + extend_bandwidth: { + value: cdktf.numberToHclTerraform(struct!.extendBandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + extend_eip_count: { + value: cdktf.numberToHclTerraform(struct!.extendEipCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + extend_vpc_count: { + value: cdktf.numberToHclTerraform(struct!.extendVpcCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwFirewallFlavorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwFirewallFlavor | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._extendBandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.extendBandwidth = this._extendBandwidth; + } + if (this._extendEipCount !== undefined) { + hasAnyValues = true; + internalValueResult.extendEipCount = this._extendEipCount; + } + if (this._extendVpcCount !== undefined) { + hasAnyValues = true; + internalValueResult.extendVpcCount = this._extendVpcCount; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwFirewallFlavor | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._extendBandwidth = undefined; + this._extendEipCount = undefined; + this._extendVpcCount = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._extendBandwidth = value.extendBandwidth; + this._extendEipCount = value.extendEipCount; + this._extendVpcCount = value.extendVpcCount; + this._version = value.version; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // default_bandwidth - computed: true, optional: false, required: false + public get defaultBandwidth() { + return this.getNumberAttribute('default_bandwidth'); + } + + // default_eip_count - computed: true, optional: false, required: false + public get defaultEipCount() { + return this.getNumberAttribute('default_eip_count'); + } + + // default_log_storage - computed: true, optional: false, required: false + public get defaultLogStorage() { + return this.getNumberAttribute('default_log_storage'); + } + + // default_vpc_count - computed: true, optional: false, required: false + public get defaultVpcCount() { + return this.getNumberAttribute('default_vpc_count'); + } + + // eip_count - computed: true, optional: false, required: false + public get eipCount() { + return this.getNumberAttribute('eip_count'); + } + + // extend_bandwidth - computed: false, optional: true, required: false + private _extendBandwidth?: number; + public get extendBandwidth() { + return this.getNumberAttribute('extend_bandwidth'); + } + public set extendBandwidth(value: number) { + this._extendBandwidth = value; + } + public resetExtendBandwidth() { + this._extendBandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendBandwidthInput() { + return this._extendBandwidth; + } + + // extend_eip_count - computed: false, optional: true, required: false + private _extendEipCount?: number; + public get extendEipCount() { + return this.getNumberAttribute('extend_eip_count'); + } + public set extendEipCount(value: number) { + this._extendEipCount = value; + } + public resetExtendEipCount() { + this._extendEipCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendEipCountInput() { + return this._extendEipCount; + } + + // extend_vpc_count - computed: false, optional: true, required: false + private _extendVpcCount?: number; + public get extendVpcCount() { + return this.getNumberAttribute('extend_vpc_count'); + } + public set extendVpcCount(value: number) { + this._extendVpcCount = value; + } + public resetExtendVpcCount() { + this._extendVpcCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendVpcCountInput() { + return this._extendVpcCount; + } + + // log_storage - computed: true, optional: false, required: false + public get logStorage() { + return this.getNumberAttribute('log_storage'); + } + + // total_rule_count - computed: true, optional: false, required: false + public get totalRuleCount() { + return this.getNumberAttribute('total_rule_count'); + } + + // used_rule_count - computed: true, optional: false, required: false + public get usedRuleCount() { + return this.getNumberAttribute('used_rule_count'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_bandwidth - computed: true, optional: false, required: false + public get vpcBandwidth() { + return this.getNumberAttribute('vpc_bandwidth'); + } + + // vpc_count - computed: true, optional: false, required: false + public get vpcCount() { + return this.getNumberAttribute('vpc_count'); + } +} +export interface CfwFirewallTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#create CfwFirewall#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#delete CfwFirewall#delete} + */ + readonly delete?: string; +} + +export function cfwFirewallTimeoutsToTerraform(struct?: CfwFirewallTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cfwFirewallTimeoutsToHclTerraform(struct?: CfwFirewallTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwFirewallTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CfwFirewallTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwFirewallTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall huaweicloud_cfw_firewall} +*/ +export class CfwFirewall extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_firewall"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwFirewall resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwFirewall to import + * @param importFromId The id of the existing CfwFirewall that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwFirewall to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_firewall", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_firewall huaweicloud_cfw_firewall} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwFirewallConfig + */ + public constructor(scope: Construct, id: string, config: CfwFirewallConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_firewall', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._eastWestFirewallErId = config.eastWestFirewallErId; + this._eastWestFirewallInspectionCidr = config.eastWestFirewallInspectionCidr; + this._eastWestFirewallMode = config.eastWestFirewallMode; + this._eastWestFirewallStatus = config.eastWestFirewallStatus; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ipsProtectionMode = config.ipsProtectionMode; + this._ipsSwitchStatus = config.ipsSwitchStatus; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._tags = config.tags; + this._flavor.internalValue = config.flavor; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // east_west_firewall_er_attachment_id - computed: true, optional: false, required: false + public get eastWestFirewallErAttachmentId() { + return this.getStringAttribute('east_west_firewall_er_attachment_id'); + } + + // east_west_firewall_er_id - computed: true, optional: true, required: false + private _eastWestFirewallErId?: string; + public get eastWestFirewallErId() { + return this.getStringAttribute('east_west_firewall_er_id'); + } + public set eastWestFirewallErId(value: string) { + this._eastWestFirewallErId = value; + } + public resetEastWestFirewallErId() { + this._eastWestFirewallErId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eastWestFirewallErIdInput() { + return this._eastWestFirewallErId; + } + + // east_west_firewall_inspection_cidr - computed: true, optional: true, required: false + private _eastWestFirewallInspectionCidr?: string; + public get eastWestFirewallInspectionCidr() { + return this.getStringAttribute('east_west_firewall_inspection_cidr'); + } + public set eastWestFirewallInspectionCidr(value: string) { + this._eastWestFirewallInspectionCidr = value; + } + public resetEastWestFirewallInspectionCidr() { + this._eastWestFirewallInspectionCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get eastWestFirewallInspectionCidrInput() { + return this._eastWestFirewallInspectionCidr; + } + + // east_west_firewall_inspection_vpc_id - computed: true, optional: false, required: false + public get eastWestFirewallInspectionVpcId() { + return this.getStringAttribute('east_west_firewall_inspection_vpc_id'); + } + + // east_west_firewall_mode - computed: true, optional: true, required: false + private _eastWestFirewallMode?: string; + public get eastWestFirewallMode() { + return this.getStringAttribute('east_west_firewall_mode'); + } + public set eastWestFirewallMode(value: string) { + this._eastWestFirewallMode = value; + } + public resetEastWestFirewallMode() { + this._eastWestFirewallMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get eastWestFirewallModeInput() { + return this._eastWestFirewallMode; + } + + // east_west_firewall_status - computed: false, optional: true, required: false + private _eastWestFirewallStatus?: number; + public get eastWestFirewallStatus() { + return this.getNumberAttribute('east_west_firewall_status'); + } + public set eastWestFirewallStatus(value: number) { + this._eastWestFirewallStatus = value; + } + public resetEastWestFirewallStatus() { + this._eastWestFirewallStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get eastWestFirewallStatusInput() { + return this._eastWestFirewallStatus; + } + + // engine_type - computed: true, optional: false, required: false + public get engineType() { + return this.getNumberAttribute('engine_type'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // ha_type - computed: true, optional: false, required: false + public get haType() { + return this.getNumberAttribute('ha_type'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ips_protection_mode - computed: false, optional: true, required: false + private _ipsProtectionMode?: number; + public get ipsProtectionMode() { + return this.getNumberAttribute('ips_protection_mode'); + } + public set ipsProtectionMode(value: number) { + this._ipsProtectionMode = value; + } + public resetIpsProtectionMode() { + this._ipsProtectionMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipsProtectionModeInput() { + return this._ipsProtectionMode; + } + + // ips_switch_status - computed: false, optional: true, required: false + private _ipsSwitchStatus?: number; + public get ipsSwitchStatus() { + return this.getNumberAttribute('ips_switch_status'); + } + public set ipsSwitchStatus(value: number) { + this._ipsSwitchStatus = value; + } + public resetIpsSwitchStatus() { + this._ipsSwitchStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipsSwitchStatusInput() { + return this._ipsSwitchStatus; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // protect_objects - computed: true, optional: false, required: false + private _protectObjects = new CfwFirewallProtectObjectsList(this, "protect_objects", false); + public get protectObjects() { + return this._protectObjects; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getNumberAttribute('service_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // support_ipv6 - computed: true, optional: false, required: false + public get supportIpv6() { + return this.getBooleanAttribute('support_ipv6'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // flavor - computed: false, optional: false, required: true + private _flavor = new CfwFirewallFlavorOutputReference(this, "flavor"); + public get flavor() { + return this._flavor; + } + public putFlavor(value: CfwFirewallFlavor) { + this._flavor.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CfwFirewallTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CfwFirewallTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + east_west_firewall_er_id: cdktf.stringToTerraform(this._eastWestFirewallErId), + east_west_firewall_inspection_cidr: cdktf.stringToTerraform(this._eastWestFirewallInspectionCidr), + east_west_firewall_mode: cdktf.stringToTerraform(this._eastWestFirewallMode), + east_west_firewall_status: cdktf.numberToTerraform(this._eastWestFirewallStatus), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ips_protection_mode: cdktf.numberToTerraform(this._ipsProtectionMode), + ips_switch_status: cdktf.numberToTerraform(this._ipsSwitchStatus), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + flavor: cfwFirewallFlavorToTerraform(this._flavor.internalValue), + timeouts: cfwFirewallTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + east_west_firewall_er_id: { + value: cdktf.stringToHclTerraform(this._eastWestFirewallErId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + east_west_firewall_inspection_cidr: { + value: cdktf.stringToHclTerraform(this._eastWestFirewallInspectionCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + east_west_firewall_mode: { + value: cdktf.stringToHclTerraform(this._eastWestFirewallMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + east_west_firewall_status: { + value: cdktf.numberToHclTerraform(this._eastWestFirewallStatus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ips_protection_mode: { + value: cdktf.numberToHclTerraform(this._ipsProtectionMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ips_switch_status: { + value: cdktf.numberToHclTerraform(this._ipsSwitchStatus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + flavor: { + value: cfwFirewallFlavorToHclTerraform(this._flavor.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwFirewallFlavorList", + }, + timeouts: { + value: cfwFirewallTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CfwFirewallTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-lts-log/README.md b/src/constructs/providers/huaweicloud/cfw-lts-log/README.md new file mode 100644 index 00000000..96cadbba --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-lts-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_lts_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_lts_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log). diff --git a/src/constructs/providers/huaweicloud/cfw-lts-log/index.ts b/src/constructs/providers/huaweicloud/cfw-lts-log/index.ts new file mode 100644 index 00000000..1068d4ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-lts-log/index.ts @@ -0,0 +1,369 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwLtsLogConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the firewall. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#fw_instance_id CfwLtsLog#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#id CfwLtsLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * LTS access log stream switch. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_access_log_stream_enable CfwLtsLog#lts_access_log_stream_enable} + */ + readonly ltsAccessLogStreamEnable: number; + /** + * LTS access log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_access_log_stream_id CfwLtsLog#lts_access_log_stream_id} + */ + readonly ltsAccessLogStreamId?: string; + /** + * LTS attack log stream switch. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_attack_log_stream_enable CfwLtsLog#lts_attack_log_stream_enable} + */ + readonly ltsAttackLogStreamEnable: number; + /** + * LTS attack log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_attack_log_stream_id CfwLtsLog#lts_attack_log_stream_id} + */ + readonly ltsAttackLogStreamId?: string; + /** + * LTS flow log stream switch. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_flow_log_stream_enable CfwLtsLog#lts_flow_log_stream_enable} + */ + readonly ltsFlowLogStreamEnable: number; + /** + * LTS flow log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_flow_log_stream_id CfwLtsLog#lts_flow_log_stream_id} + */ + readonly ltsFlowLogStreamId?: string; + /** + * LTS log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#lts_log_group_id CfwLtsLog#lts_log_group_id} + */ + readonly ltsLogGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#region CfwLtsLog#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log huaweicloud_cfw_lts_log} +*/ +export class CfwLtsLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_lts_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwLtsLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwLtsLog to import + * @param importFromId The id of the existing CfwLtsLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwLtsLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_lts_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_lts_log huaweicloud_cfw_lts_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwLtsLogConfig + */ + public constructor(scope: Construct, id: string, config: CfwLtsLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_lts_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._ltsAccessLogStreamEnable = config.ltsAccessLogStreamEnable; + this._ltsAccessLogStreamId = config.ltsAccessLogStreamId; + this._ltsAttackLogStreamEnable = config.ltsAttackLogStreamEnable; + this._ltsAttackLogStreamId = config.ltsAttackLogStreamId; + this._ltsFlowLogStreamEnable = config.ltsFlowLogStreamEnable; + this._ltsFlowLogStreamId = config.ltsFlowLogStreamId; + this._ltsLogGroupId = config.ltsLogGroupId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lts_access_log_stream_enable - computed: false, optional: false, required: true + private _ltsAccessLogStreamEnable?: number; + public get ltsAccessLogStreamEnable() { + return this.getNumberAttribute('lts_access_log_stream_enable'); + } + public set ltsAccessLogStreamEnable(value: number) { + this._ltsAccessLogStreamEnable = value; + } + // Temporarily expose input value. Use with caution. + public get ltsAccessLogStreamEnableInput() { + return this._ltsAccessLogStreamEnable; + } + + // lts_access_log_stream_id - computed: false, optional: true, required: false + private _ltsAccessLogStreamId?: string; + public get ltsAccessLogStreamId() { + return this.getStringAttribute('lts_access_log_stream_id'); + } + public set ltsAccessLogStreamId(value: string) { + this._ltsAccessLogStreamId = value; + } + public resetLtsAccessLogStreamId() { + this._ltsAccessLogStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsAccessLogStreamIdInput() { + return this._ltsAccessLogStreamId; + } + + // lts_attack_log_stream_enable - computed: false, optional: false, required: true + private _ltsAttackLogStreamEnable?: number; + public get ltsAttackLogStreamEnable() { + return this.getNumberAttribute('lts_attack_log_stream_enable'); + } + public set ltsAttackLogStreamEnable(value: number) { + this._ltsAttackLogStreamEnable = value; + } + // Temporarily expose input value. Use with caution. + public get ltsAttackLogStreamEnableInput() { + return this._ltsAttackLogStreamEnable; + } + + // lts_attack_log_stream_id - computed: false, optional: true, required: false + private _ltsAttackLogStreamId?: string; + public get ltsAttackLogStreamId() { + return this.getStringAttribute('lts_attack_log_stream_id'); + } + public set ltsAttackLogStreamId(value: string) { + this._ltsAttackLogStreamId = value; + } + public resetLtsAttackLogStreamId() { + this._ltsAttackLogStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsAttackLogStreamIdInput() { + return this._ltsAttackLogStreamId; + } + + // lts_flow_log_stream_enable - computed: false, optional: false, required: true + private _ltsFlowLogStreamEnable?: number; + public get ltsFlowLogStreamEnable() { + return this.getNumberAttribute('lts_flow_log_stream_enable'); + } + public set ltsFlowLogStreamEnable(value: number) { + this._ltsFlowLogStreamEnable = value; + } + // Temporarily expose input value. Use with caution. + public get ltsFlowLogStreamEnableInput() { + return this._ltsFlowLogStreamEnable; + } + + // lts_flow_log_stream_id - computed: false, optional: true, required: false + private _ltsFlowLogStreamId?: string; + public get ltsFlowLogStreamId() { + return this.getStringAttribute('lts_flow_log_stream_id'); + } + public set ltsFlowLogStreamId(value: string) { + this._ltsFlowLogStreamId = value; + } + public resetLtsFlowLogStreamId() { + this._ltsFlowLogStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsFlowLogStreamIdInput() { + return this._ltsFlowLogStreamId; + } + + // lts_log_group_id - computed: false, optional: false, required: true + private _ltsLogGroupId?: string; + public get ltsLogGroupId() { + return this.getStringAttribute('lts_log_group_id'); + } + public set ltsLogGroupId(value: string) { + this._ltsLogGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsLogGroupIdInput() { + return this._ltsLogGroupId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + lts_access_log_stream_enable: cdktf.numberToTerraform(this._ltsAccessLogStreamEnable), + lts_access_log_stream_id: cdktf.stringToTerraform(this._ltsAccessLogStreamId), + lts_attack_log_stream_enable: cdktf.numberToTerraform(this._ltsAttackLogStreamEnable), + lts_attack_log_stream_id: cdktf.stringToTerraform(this._ltsAttackLogStreamId), + lts_flow_log_stream_enable: cdktf.numberToTerraform(this._ltsFlowLogStreamEnable), + lts_flow_log_stream_id: cdktf.stringToTerraform(this._ltsFlowLogStreamId), + lts_log_group_id: cdktf.stringToTerraform(this._ltsLogGroupId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_access_log_stream_enable: { + value: cdktf.numberToHclTerraform(this._ltsAccessLogStreamEnable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + lts_access_log_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsAccessLogStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_attack_log_stream_enable: { + value: cdktf.numberToHclTerraform(this._ltsAttackLogStreamEnable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + lts_attack_log_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsAttackLogStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_flow_log_stream_enable: { + value: cdktf.numberToHclTerraform(this._ltsFlowLogStreamEnable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + lts_flow_log_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsFlowLogStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_log_group_id: { + value: cdktf.stringToHclTerraform(this._ltsLogGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-protection-rule/README.md b/src/constructs/providers/huaweicloud/cfw-protection-rule/README.md new file mode 100644 index 00000000..6410f4d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-protection-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_protection_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_protection_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule). diff --git a/src/constructs/providers/huaweicloud/cfw-protection-rule/index.ts b/src/constructs/providers/huaweicloud/cfw-protection-rule/index.ts new file mode 100644 index 00000000..5f6d9cd3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-protection-rule/index.ts @@ -0,0 +1,2703 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwProtectionRuleConfig extends cdktf.TerraformMetaArguments { + /** + * The action type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#action_type CfwProtectionRule#action_type} + */ + readonly actionType: number; + /** + * The address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_type CfwProtectionRule#address_type} + */ + readonly addressType: number; + /** + * The description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#description CfwProtectionRule#description} + */ + readonly description?: string; + /** + * The direction. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#direction CfwProtectionRule#direction} + */ + readonly direction?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#id CfwProtectionRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to support persistent connections. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#long_connect_enable CfwProtectionRule#long_connect_enable} + */ + readonly longConnectEnable: number; + /** + * The persistent connection duration (hour). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#long_connect_time_hour CfwProtectionRule#long_connect_time_hour} + */ + readonly longConnectTimeHour?: number; + /** + * The persistent connection duration (minute). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#long_connect_time_minute CfwProtectionRule#long_connect_time_minute} + */ + readonly longConnectTimeMinute?: number; + /** + * The persistent Connection Duration (second). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#long_connect_time_second CfwProtectionRule#long_connect_time_second} + */ + readonly longConnectTimeSecond?: number; + /** + * The rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#name CfwProtectionRule#name} + */ + readonly name: string; + /** + * The protected object ID + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#object_id CfwProtectionRule#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region CfwProtectionRule#region} + */ + readonly region?: string; + /** + * The number of times the protection rule is hit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#rule_hit_count CfwProtectionRule#rule_hit_count} + */ + readonly ruleHitCount?: string; + /** + * The rule status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#status CfwProtectionRule#status} + */ + readonly status: number; + /** + * The key/value pairs to associate with the protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#tags CfwProtectionRule#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The rule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#type CfwProtectionRule#type} + */ + readonly type: number; + /** + * destination block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#destination CfwProtectionRule#destination} + */ + readonly destination: CfwProtectionRuleDestination; + /** + * sequence block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#sequence CfwProtectionRule#sequence} + */ + readonly sequence: CfwProtectionRuleSequence; + /** + * service block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#service CfwProtectionRule#service} + */ + readonly service: CfwProtectionRuleService; + /** + * source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#source CfwProtectionRule#source} + */ + readonly source: CfwProtectionRuleSource; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#timeouts CfwProtectionRule#timeouts} + */ + readonly timeouts?: CfwProtectionRuleTimeouts; +} +export interface CfwProtectionRuleDestinationRegionListStruct { + /** + * The Chinese description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#description_cn CfwProtectionRule#description_cn} + */ + readonly descriptionCn?: string; + /** + * The English description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#description_en CfwProtectionRule#description_en} + */ + readonly descriptionEn?: string; + /** + * The region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region_id CfwProtectionRule#region_id} + */ + readonly regionId: string; + /** + * The region type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region_type CfwProtectionRule#region_type} + */ + readonly regionType: number; +} + +export function cfwProtectionRuleDestinationRegionListStructToTerraform(struct?: CfwProtectionRuleDestinationRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description_cn: cdktf.stringToTerraform(struct!.descriptionCn), + description_en: cdktf.stringToTerraform(struct!.descriptionEn), + region_id: cdktf.stringToTerraform(struct!.regionId), + region_type: cdktf.numberToTerraform(struct!.regionType), + } +} + + +export function cfwProtectionRuleDestinationRegionListStructToHclTerraform(struct?: CfwProtectionRuleDestinationRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description_cn: { + value: cdktf.stringToHclTerraform(struct!.descriptionCn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description_en: { + value: cdktf.stringToHclTerraform(struct!.descriptionEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_type: { + value: cdktf.numberToHclTerraform(struct!.regionType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleDestinationRegionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwProtectionRuleDestinationRegionListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._descriptionCn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionCn = this._descriptionCn; + } + if (this._descriptionEn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionEn = this._descriptionEn; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + if (this._regionType !== undefined) { + hasAnyValues = true; + internalValueResult.regionType = this._regionType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleDestinationRegionListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._descriptionCn = undefined; + this._descriptionEn = undefined; + this._regionId = undefined; + this._regionType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._descriptionCn = value.descriptionCn; + this._descriptionEn = value.descriptionEn; + this._regionId = value.regionId; + this._regionType = value.regionType; + } + } + + // description_cn - computed: false, optional: true, required: false + private _descriptionCn?: string; + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + public set descriptionCn(value: string) { + this._descriptionCn = value; + } + public resetDescriptionCn() { + this._descriptionCn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionCnInput() { + return this._descriptionCn; + } + + // description_en - computed: false, optional: true, required: false + private _descriptionEn?: string; + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + public set descriptionEn(value: string) { + this._descriptionEn = value; + } + public resetDescriptionEn() { + this._descriptionEn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionEnInput() { + return this._descriptionEn; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // region_type - computed: false, optional: false, required: true + private _regionType?: number; + public get regionType() { + return this.getNumberAttribute('region_type'); + } + public set regionType(value: number) { + this._regionType = value; + } + // Temporarily expose input value. Use with caution. + public get regionTypeInput() { + return this._regionType; + } +} + +export class CfwProtectionRuleDestinationRegionListStructList extends cdktf.ComplexList { + public internalValue? : CfwProtectionRuleDestinationRegionListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwProtectionRuleDestinationRegionListStructOutputReference { + return new CfwProtectionRuleDestinationRegionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwProtectionRuleDestination { + /** + * The IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address CfwProtectionRule#address} + */ + readonly address?: string; + /** + * The address group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_group CfwProtectionRule#address_group} + */ + readonly addressGroup?: string[]; + /** + * The ID of the associated IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_set_id CfwProtectionRule#address_set_id} + */ + readonly addressSetId?: string; + /** + * The IP address group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_set_name CfwProtectionRule#address_set_name} + */ + readonly addressSetName?: string; + /** + * The address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_type CfwProtectionRule#address_type} + */ + readonly addressType?: number; + /** + * The name of the domain name address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#domain_address_name CfwProtectionRule#domain_address_name} + */ + readonly domainAddressName?: string; + /** + * The ID of the domain group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#domain_set_id CfwProtectionRule#domain_set_id} + */ + readonly domainSetId?: string; + /** + * The name of domain group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#domain_set_name CfwProtectionRule#domain_set_name} + */ + readonly domainSetName?: string; + /** + * The IP address list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#ip_address CfwProtectionRule#ip_address} + */ + readonly ipAddress?: string[]; + /** + * The Source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#type CfwProtectionRule#type} + */ + readonly type: number; + /** + * region_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region_list CfwProtectionRule#region_list} + */ + readonly regionList?: CfwProtectionRuleDestinationRegionListStruct[] | cdktf.IResolvable; +} + +export function cfwProtectionRuleDestinationToTerraform(struct?: CfwProtectionRuleDestinationOutputReference | CfwProtectionRuleDestination): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + address_group: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.addressGroup), + address_set_id: cdktf.stringToTerraform(struct!.addressSetId), + address_set_name: cdktf.stringToTerraform(struct!.addressSetName), + address_type: cdktf.numberToTerraform(struct!.addressType), + domain_address_name: cdktf.stringToTerraform(struct!.domainAddressName), + domain_set_id: cdktf.stringToTerraform(struct!.domainSetId), + domain_set_name: cdktf.stringToTerraform(struct!.domainSetName), + ip_address: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.ipAddress), + type: cdktf.numberToTerraform(struct!.type), + region_list: cdktf.listMapper(cfwProtectionRuleDestinationRegionListStructToTerraform, true)(struct!.regionList), + } +} + + +export function cfwProtectionRuleDestinationToHclTerraform(struct?: CfwProtectionRuleDestinationOutputReference | CfwProtectionRuleDestination): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_group: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.addressGroup), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + address_set_id: { + value: cdktf.stringToHclTerraform(struct!.addressSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_set_name: { + value: cdktf.stringToHclTerraform(struct!.addressSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.numberToHclTerraform(struct!.addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + domain_address_name: { + value: cdktf.stringToHclTerraform(struct!.domainAddressName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_set_id: { + value: cdktf.stringToHclTerraform(struct!.domainSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_set_name: { + value: cdktf.stringToHclTerraform(struct!.domainSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.ipAddress), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.numberToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region_list: { + value: cdktf.listMapperHcl(cfwProtectionRuleDestinationRegionListStructToHclTerraform, true)(struct!.regionList), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleDestinationRegionListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleDestinationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwProtectionRuleDestination | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._addressGroup !== undefined) { + hasAnyValues = true; + internalValueResult.addressGroup = this._addressGroup; + } + if (this._addressSetId !== undefined) { + hasAnyValues = true; + internalValueResult.addressSetId = this._addressSetId; + } + if (this._addressSetName !== undefined) { + hasAnyValues = true; + internalValueResult.addressSetName = this._addressSetName; + } + if (this._addressType !== undefined) { + hasAnyValues = true; + internalValueResult.addressType = this._addressType; + } + if (this._domainAddressName !== undefined) { + hasAnyValues = true; + internalValueResult.domainAddressName = this._domainAddressName; + } + if (this._domainSetId !== undefined) { + hasAnyValues = true; + internalValueResult.domainSetId = this._domainSetId; + } + if (this._domainSetName !== undefined) { + hasAnyValues = true; + internalValueResult.domainSetName = this._domainSetName; + } + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._regionList?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.regionList = this._regionList?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleDestination | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._address = undefined; + this._addressGroup = undefined; + this._addressSetId = undefined; + this._addressSetName = undefined; + this._addressType = undefined; + this._domainAddressName = undefined; + this._domainSetId = undefined; + this._domainSetName = undefined; + this._ipAddress = undefined; + this._type = undefined; + this._regionList.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._address = value.address; + this._addressGroup = value.addressGroup; + this._addressSetId = value.addressSetId; + this._addressSetName = value.addressSetName; + this._addressType = value.addressType; + this._domainAddressName = value.domainAddressName; + this._domainSetId = value.domainSetId; + this._domainSetName = value.domainSetName; + this._ipAddress = value.ipAddress; + this._type = value.type; + this._regionList.internalValue = value.regionList; + } + } + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_group - computed: false, optional: true, required: false + private _addressGroup?: string[]; + public get addressGroup() { + return this.getListAttribute('address_group'); + } + public set addressGroup(value: string[]) { + this._addressGroup = value; + } + public resetAddressGroup() { + this._addressGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressGroupInput() { + return this._addressGroup; + } + + // address_set_id - computed: false, optional: true, required: false + private _addressSetId?: string; + public get addressSetId() { + return this.getStringAttribute('address_set_id'); + } + public set addressSetId(value: string) { + this._addressSetId = value; + } + public resetAddressSetId() { + this._addressSetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressSetIdInput() { + return this._addressSetId; + } + + // address_set_name - computed: false, optional: true, required: false + private _addressSetName?: string; + public get addressSetName() { + return this.getStringAttribute('address_set_name'); + } + public set addressSetName(value: string) { + this._addressSetName = value; + } + public resetAddressSetName() { + this._addressSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressSetNameInput() { + return this._addressSetName; + } + + // address_type - computed: false, optional: true, required: false + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + public resetAddressType() { + this._addressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // domain_address_name - computed: false, optional: true, required: false + private _domainAddressName?: string; + public get domainAddressName() { + return this.getStringAttribute('domain_address_name'); + } + public set domainAddressName(value: string) { + this._domainAddressName = value; + } + public resetDomainAddressName() { + this._domainAddressName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainAddressNameInput() { + return this._domainAddressName; + } + + // domain_set_id - computed: false, optional: true, required: false + private _domainSetId?: string; + public get domainSetId() { + return this.getStringAttribute('domain_set_id'); + } + public set domainSetId(value: string) { + this._domainSetId = value; + } + public resetDomainSetId() { + this._domainSetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainSetIdInput() { + return this._domainSetId; + } + + // domain_set_name - computed: false, optional: true, required: false + private _domainSetName?: string; + public get domainSetName() { + return this.getStringAttribute('domain_set_name'); + } + public set domainSetName(value: string) { + this._domainSetName = value; + } + public resetDomainSetName() { + this._domainSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainSetNameInput() { + return this._domainSetName; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string[]; + public get ipAddress() { + return this.getListAttribute('ip_address'); + } + public set ipAddress(value: string[]) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // region_list - computed: false, optional: true, required: false + private _regionList = new CfwProtectionRuleDestinationRegionListStructList(this, "region_list", false); + public get regionList() { + return this._regionList; + } + public putRegionList(value: CfwProtectionRuleDestinationRegionListStruct[] | cdktf.IResolvable) { + this._regionList.internalValue = value; + } + public resetRegionList() { + this._regionList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionListInput() { + return this._regionList.internalValue; + } +} +export interface CfwProtectionRuleSequence { + /** + * The ID of the rule that the added rule will follow. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#dest_rule_id CfwProtectionRule#dest_rule_id} + */ + readonly destRuleId?: string; + /** + * Whether to pin on top. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#top CfwProtectionRule#top} + */ + readonly top?: number; +} + +export function cfwProtectionRuleSequenceToTerraform(struct?: CfwProtectionRuleSequenceOutputReference | CfwProtectionRuleSequence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_rule_id: cdktf.stringToTerraform(struct!.destRuleId), + top: cdktf.numberToTerraform(struct!.top), + } +} + + +export function cfwProtectionRuleSequenceToHclTerraform(struct?: CfwProtectionRuleSequenceOutputReference | CfwProtectionRuleSequence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_rule_id: { + value: cdktf.stringToHclTerraform(struct!.destRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + top: { + value: cdktf.numberToHclTerraform(struct!.top), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleSequenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwProtectionRuleSequence | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destRuleId !== undefined) { + hasAnyValues = true; + internalValueResult.destRuleId = this._destRuleId; + } + if (this._top !== undefined) { + hasAnyValues = true; + internalValueResult.top = this._top; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleSequence | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._destRuleId = undefined; + this._top = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._destRuleId = value.destRuleId; + this._top = value.top; + } + } + + // dest_rule_id - computed: true, optional: true, required: false + private _destRuleId?: string; + public get destRuleId() { + return this.getStringAttribute('dest_rule_id'); + } + public set destRuleId(value: string) { + this._destRuleId = value; + } + public resetDestRuleId() { + this._destRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destRuleIdInput() { + return this._destRuleId; + } + + // top - computed: true, optional: true, required: false + private _top?: number; + public get top() { + return this.getNumberAttribute('top'); + } + public set top(value: number) { + this._top = value; + } + public resetTop() { + this._top = undefined; + } + // Temporarily expose input value. Use with caution. + public get topInput() { + return this._top; + } +} +export interface CfwProtectionRuleServiceCustomService { + /** + * The destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#dest_port CfwProtectionRule#dest_port} + */ + readonly destPort: string; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#protocol CfwProtectionRule#protocol} + */ + readonly protocol: number; + /** + * The source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#source_port CfwProtectionRule#source_port} + */ + readonly sourcePort: string; +} + +export function cfwProtectionRuleServiceCustomServiceToTerraform(struct?: CfwProtectionRuleServiceCustomService | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_port: cdktf.stringToTerraform(struct!.destPort), + protocol: cdktf.numberToTerraform(struct!.protocol), + source_port: cdktf.stringToTerraform(struct!.sourcePort), + } +} + + +export function cfwProtectionRuleServiceCustomServiceToHclTerraform(struct?: CfwProtectionRuleServiceCustomService | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_port: { + value: cdktf.stringToHclTerraform(struct!.destPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_port: { + value: cdktf.stringToHclTerraform(struct!.sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleServiceCustomServiceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwProtectionRuleServiceCustomService | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destPort !== undefined) { + hasAnyValues = true; + internalValueResult.destPort = this._destPort; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._sourcePort !== undefined) { + hasAnyValues = true; + internalValueResult.sourcePort = this._sourcePort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleServiceCustomService | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destPort = undefined; + this._protocol = undefined; + this._sourcePort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destPort = value.destPort; + this._protocol = value.protocol; + this._sourcePort = value.sourcePort; + } + } + + // dest_port - computed: false, optional: false, required: true + private _destPort?: string; + public get destPort() { + return this.getStringAttribute('dest_port'); + } + public set destPort(value: string) { + this._destPort = value; + } + // Temporarily expose input value. Use with caution. + public get destPortInput() { + return this._destPort; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // source_port - computed: false, optional: false, required: true + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } +} + +export class CfwProtectionRuleServiceCustomServiceList extends cdktf.ComplexList { + public internalValue? : CfwProtectionRuleServiceCustomService[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwProtectionRuleServiceCustomServiceOutputReference { + return new CfwProtectionRuleServiceCustomServiceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwProtectionRuleService { + /** + * The destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#dest_port CfwProtectionRule#dest_port} + */ + readonly destPort?: string; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#protocol CfwProtectionRule#protocol} + */ + readonly protocol?: number; + /** + * The service group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#service_group CfwProtectionRule#service_group} + */ + readonly serviceGroup?: string[]; + /** + * The service group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#service_set_id CfwProtectionRule#service_set_id} + */ + readonly serviceSetId?: string; + /** + * The service group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#service_set_name CfwProtectionRule#service_set_name} + */ + readonly serviceSetName?: string; + /** + * The source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#source_port CfwProtectionRule#source_port} + */ + readonly sourcePort?: string; + /** + * The service input type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#type CfwProtectionRule#type} + */ + readonly type: number; + /** + * custom_service block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#custom_service CfwProtectionRule#custom_service} + */ + readonly customService?: CfwProtectionRuleServiceCustomService[] | cdktf.IResolvable; +} + +export function cfwProtectionRuleServiceToTerraform(struct?: CfwProtectionRuleServiceOutputReference | CfwProtectionRuleService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_port: cdktf.stringToTerraform(struct!.destPort), + protocol: cdktf.numberToTerraform(struct!.protocol), + service_group: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.serviceGroup), + service_set_id: cdktf.stringToTerraform(struct!.serviceSetId), + service_set_name: cdktf.stringToTerraform(struct!.serviceSetName), + source_port: cdktf.stringToTerraform(struct!.sourcePort), + type: cdktf.numberToTerraform(struct!.type), + custom_service: cdktf.listMapper(cfwProtectionRuleServiceCustomServiceToTerraform, true)(struct!.customService), + } +} + + +export function cfwProtectionRuleServiceToHclTerraform(struct?: CfwProtectionRuleServiceOutputReference | CfwProtectionRuleService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_port: { + value: cdktf.stringToHclTerraform(struct!.destPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + service_group: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.serviceGroup), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + service_set_id: { + value: cdktf.stringToHclTerraform(struct!.serviceSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_set_name: { + value: cdktf.stringToHclTerraform(struct!.serviceSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(struct!.sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + custom_service: { + value: cdktf.listMapperHcl(cfwProtectionRuleServiceCustomServiceToHclTerraform, true)(struct!.customService), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleServiceCustomServiceList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleServiceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwProtectionRuleService | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destPort !== undefined) { + hasAnyValues = true; + internalValueResult.destPort = this._destPort; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._serviceGroup !== undefined) { + hasAnyValues = true; + internalValueResult.serviceGroup = this._serviceGroup; + } + if (this._serviceSetId !== undefined) { + hasAnyValues = true; + internalValueResult.serviceSetId = this._serviceSetId; + } + if (this._serviceSetName !== undefined) { + hasAnyValues = true; + internalValueResult.serviceSetName = this._serviceSetName; + } + if (this._sourcePort !== undefined) { + hasAnyValues = true; + internalValueResult.sourcePort = this._sourcePort; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._customService?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.customService = this._customService?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleService | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._destPort = undefined; + this._protocol = undefined; + this._serviceGroup = undefined; + this._serviceSetId = undefined; + this._serviceSetName = undefined; + this._sourcePort = undefined; + this._type = undefined; + this._customService.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._destPort = value.destPort; + this._protocol = value.protocol; + this._serviceGroup = value.serviceGroup; + this._serviceSetId = value.serviceSetId; + this._serviceSetName = value.serviceSetName; + this._sourcePort = value.sourcePort; + this._type = value.type; + this._customService.internalValue = value.customService; + } + } + + // dest_port - computed: false, optional: true, required: false + private _destPort?: string; + public get destPort() { + return this.getStringAttribute('dest_port'); + } + public set destPort(value: string) { + this._destPort = value; + } + public resetDestPort() { + this._destPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destPortInput() { + return this._destPort; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // service_group - computed: false, optional: true, required: false + private _serviceGroup?: string[]; + public get serviceGroup() { + return this.getListAttribute('service_group'); + } + public set serviceGroup(value: string[]) { + this._serviceGroup = value; + } + public resetServiceGroup() { + this._serviceGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceGroupInput() { + return this._serviceGroup; + } + + // service_set_id - computed: false, optional: true, required: false + private _serviceSetId?: string; + public get serviceSetId() { + return this.getStringAttribute('service_set_id'); + } + public set serviceSetId(value: string) { + this._serviceSetId = value; + } + public resetServiceSetId() { + this._serviceSetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceSetIdInput() { + return this._serviceSetId; + } + + // service_set_name - computed: false, optional: true, required: false + private _serviceSetName?: string; + public get serviceSetName() { + return this.getStringAttribute('service_set_name'); + } + public set serviceSetName(value: string) { + this._serviceSetName = value; + } + public resetServiceSetName() { + this._serviceSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceSetNameInput() { + return this._serviceSetName; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // custom_service - computed: false, optional: true, required: false + private _customService = new CfwProtectionRuleServiceCustomServiceList(this, "custom_service", false); + public get customService() { + return this._customService; + } + public putCustomService(value: CfwProtectionRuleServiceCustomService[] | cdktf.IResolvable) { + this._customService.internalValue = value; + } + public resetCustomService() { + this._customService.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customServiceInput() { + return this._customService.internalValue; + } +} +export interface CfwProtectionRuleSourceRegionListStruct { + /** + * The Chinese description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#description_cn CfwProtectionRule#description_cn} + */ + readonly descriptionCn?: string; + /** + * The English description of the region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#description_en CfwProtectionRule#description_en} + */ + readonly descriptionEn?: string; + /** + * The region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region_id CfwProtectionRule#region_id} + */ + readonly regionId: string; + /** + * The region type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region_type CfwProtectionRule#region_type} + */ + readonly regionType: number; +} + +export function cfwProtectionRuleSourceRegionListStructToTerraform(struct?: CfwProtectionRuleSourceRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description_cn: cdktf.stringToTerraform(struct!.descriptionCn), + description_en: cdktf.stringToTerraform(struct!.descriptionEn), + region_id: cdktf.stringToTerraform(struct!.regionId), + region_type: cdktf.numberToTerraform(struct!.regionType), + } +} + + +export function cfwProtectionRuleSourceRegionListStructToHclTerraform(struct?: CfwProtectionRuleSourceRegionListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description_cn: { + value: cdktf.stringToHclTerraform(struct!.descriptionCn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description_en: { + value: cdktf.stringToHclTerraform(struct!.descriptionEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_type: { + value: cdktf.numberToHclTerraform(struct!.regionType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleSourceRegionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CfwProtectionRuleSourceRegionListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._descriptionCn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionCn = this._descriptionCn; + } + if (this._descriptionEn !== undefined) { + hasAnyValues = true; + internalValueResult.descriptionEn = this._descriptionEn; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + if (this._regionType !== undefined) { + hasAnyValues = true; + internalValueResult.regionType = this._regionType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleSourceRegionListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._descriptionCn = undefined; + this._descriptionEn = undefined; + this._regionId = undefined; + this._regionType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._descriptionCn = value.descriptionCn; + this._descriptionEn = value.descriptionEn; + this._regionId = value.regionId; + this._regionType = value.regionType; + } + } + + // description_cn - computed: false, optional: true, required: false + private _descriptionCn?: string; + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + public set descriptionCn(value: string) { + this._descriptionCn = value; + } + public resetDescriptionCn() { + this._descriptionCn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionCnInput() { + return this._descriptionCn; + } + + // description_en - computed: false, optional: true, required: false + private _descriptionEn?: string; + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + public set descriptionEn(value: string) { + this._descriptionEn = value; + } + public resetDescriptionEn() { + this._descriptionEn = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionEnInput() { + return this._descriptionEn; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // region_type - computed: false, optional: false, required: true + private _regionType?: number; + public get regionType() { + return this.getNumberAttribute('region_type'); + } + public set regionType(value: number) { + this._regionType = value; + } + // Temporarily expose input value. Use with caution. + public get regionTypeInput() { + return this._regionType; + } +} + +export class CfwProtectionRuleSourceRegionListStructList extends cdktf.ComplexList { + public internalValue? : CfwProtectionRuleSourceRegionListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CfwProtectionRuleSourceRegionListStructOutputReference { + return new CfwProtectionRuleSourceRegionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CfwProtectionRuleSource { + /** + * The IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address CfwProtectionRule#address} + */ + readonly address?: string; + /** + * The address group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_group CfwProtectionRule#address_group} + */ + readonly addressGroup?: string[]; + /** + * The ID of the associated IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_set_id CfwProtectionRule#address_set_id} + */ + readonly addressSetId?: string; + /** + * The IP address group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_set_name CfwProtectionRule#address_set_name} + */ + readonly addressSetName?: string; + /** + * The address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#address_type CfwProtectionRule#address_type} + */ + readonly addressType?: number; + /** + * The name of the domain name address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#domain_address_name CfwProtectionRule#domain_address_name} + */ + readonly domainAddressName?: string; + /** + * The ID of the domain group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#domain_set_id CfwProtectionRule#domain_set_id} + */ + readonly domainSetId?: string; + /** + * The name of domain group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#domain_set_name CfwProtectionRule#domain_set_name} + */ + readonly domainSetName?: string; + /** + * The IP address list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#ip_address CfwProtectionRule#ip_address} + */ + readonly ipAddress?: string[]; + /** + * The Source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#type CfwProtectionRule#type} + */ + readonly type: number; + /** + * region_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#region_list CfwProtectionRule#region_list} + */ + readonly regionList?: CfwProtectionRuleSourceRegionListStruct[] | cdktf.IResolvable; +} + +export function cfwProtectionRuleSourceToTerraform(struct?: CfwProtectionRuleSourceOutputReference | CfwProtectionRuleSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + address_group: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.addressGroup), + address_set_id: cdktf.stringToTerraform(struct!.addressSetId), + address_set_name: cdktf.stringToTerraform(struct!.addressSetName), + address_type: cdktf.numberToTerraform(struct!.addressType), + domain_address_name: cdktf.stringToTerraform(struct!.domainAddressName), + domain_set_id: cdktf.stringToTerraform(struct!.domainSetId), + domain_set_name: cdktf.stringToTerraform(struct!.domainSetName), + ip_address: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.ipAddress), + type: cdktf.numberToTerraform(struct!.type), + region_list: cdktf.listMapper(cfwProtectionRuleSourceRegionListStructToTerraform, true)(struct!.regionList), + } +} + + +export function cfwProtectionRuleSourceToHclTerraform(struct?: CfwProtectionRuleSourceOutputReference | CfwProtectionRuleSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_group: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.addressGroup), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + address_set_id: { + value: cdktf.stringToHclTerraform(struct!.addressSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_set_name: { + value: cdktf.stringToHclTerraform(struct!.addressSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.numberToHclTerraform(struct!.addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + domain_address_name: { + value: cdktf.stringToHclTerraform(struct!.domainAddressName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_set_id: { + value: cdktf.stringToHclTerraform(struct!.domainSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_set_name: { + value: cdktf.stringToHclTerraform(struct!.domainSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.ipAddress), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.numberToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region_list: { + value: cdktf.listMapperHcl(cfwProtectionRuleSourceRegionListStructToHclTerraform, true)(struct!.regionList), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleSourceRegionListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CfwProtectionRuleSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._addressGroup !== undefined) { + hasAnyValues = true; + internalValueResult.addressGroup = this._addressGroup; + } + if (this._addressSetId !== undefined) { + hasAnyValues = true; + internalValueResult.addressSetId = this._addressSetId; + } + if (this._addressSetName !== undefined) { + hasAnyValues = true; + internalValueResult.addressSetName = this._addressSetName; + } + if (this._addressType !== undefined) { + hasAnyValues = true; + internalValueResult.addressType = this._addressType; + } + if (this._domainAddressName !== undefined) { + hasAnyValues = true; + internalValueResult.domainAddressName = this._domainAddressName; + } + if (this._domainSetId !== undefined) { + hasAnyValues = true; + internalValueResult.domainSetId = this._domainSetId; + } + if (this._domainSetName !== undefined) { + hasAnyValues = true; + internalValueResult.domainSetName = this._domainSetName; + } + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._regionList?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.regionList = this._regionList?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._address = undefined; + this._addressGroup = undefined; + this._addressSetId = undefined; + this._addressSetName = undefined; + this._addressType = undefined; + this._domainAddressName = undefined; + this._domainSetId = undefined; + this._domainSetName = undefined; + this._ipAddress = undefined; + this._type = undefined; + this._regionList.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._address = value.address; + this._addressGroup = value.addressGroup; + this._addressSetId = value.addressSetId; + this._addressSetName = value.addressSetName; + this._addressType = value.addressType; + this._domainAddressName = value.domainAddressName; + this._domainSetId = value.domainSetId; + this._domainSetName = value.domainSetName; + this._ipAddress = value.ipAddress; + this._type = value.type; + this._regionList.internalValue = value.regionList; + } + } + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_group - computed: false, optional: true, required: false + private _addressGroup?: string[]; + public get addressGroup() { + return this.getListAttribute('address_group'); + } + public set addressGroup(value: string[]) { + this._addressGroup = value; + } + public resetAddressGroup() { + this._addressGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressGroupInput() { + return this._addressGroup; + } + + // address_set_id - computed: false, optional: true, required: false + private _addressSetId?: string; + public get addressSetId() { + return this.getStringAttribute('address_set_id'); + } + public set addressSetId(value: string) { + this._addressSetId = value; + } + public resetAddressSetId() { + this._addressSetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressSetIdInput() { + return this._addressSetId; + } + + // address_set_name - computed: false, optional: true, required: false + private _addressSetName?: string; + public get addressSetName() { + return this.getStringAttribute('address_set_name'); + } + public set addressSetName(value: string) { + this._addressSetName = value; + } + public resetAddressSetName() { + this._addressSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressSetNameInput() { + return this._addressSetName; + } + + // address_type - computed: false, optional: true, required: false + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + public resetAddressType() { + this._addressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // domain_address_name - computed: false, optional: true, required: false + private _domainAddressName?: string; + public get domainAddressName() { + return this.getStringAttribute('domain_address_name'); + } + public set domainAddressName(value: string) { + this._domainAddressName = value; + } + public resetDomainAddressName() { + this._domainAddressName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainAddressNameInput() { + return this._domainAddressName; + } + + // domain_set_id - computed: false, optional: true, required: false + private _domainSetId?: string; + public get domainSetId() { + return this.getStringAttribute('domain_set_id'); + } + public set domainSetId(value: string) { + this._domainSetId = value; + } + public resetDomainSetId() { + this._domainSetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainSetIdInput() { + return this._domainSetId; + } + + // domain_set_name - computed: false, optional: true, required: false + private _domainSetName?: string; + public get domainSetName() { + return this.getStringAttribute('domain_set_name'); + } + public set domainSetName(value: string) { + this._domainSetName = value; + } + public resetDomainSetName() { + this._domainSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainSetNameInput() { + return this._domainSetName; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string[]; + public get ipAddress() { + return this.getListAttribute('ip_address'); + } + public set ipAddress(value: string[]) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // region_list - computed: false, optional: true, required: false + private _regionList = new CfwProtectionRuleSourceRegionListStructList(this, "region_list", false); + public get regionList() { + return this._regionList; + } + public putRegionList(value: CfwProtectionRuleSourceRegionListStruct[] | cdktf.IResolvable) { + this._regionList.internalValue = value; + } + public resetRegionList() { + this._regionList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionListInput() { + return this._regionList.internalValue; + } +} +export interface CfwProtectionRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#delete CfwProtectionRule#delete} + */ + readonly delete?: string; +} + +export function cfwProtectionRuleTimeoutsToTerraform(struct?: CfwProtectionRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cfwProtectionRuleTimeoutsToHclTerraform(struct?: CfwProtectionRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CfwProtectionRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CfwProtectionRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CfwProtectionRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule huaweicloud_cfw_protection_rule} +*/ +export class CfwProtectionRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_protection_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwProtectionRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwProtectionRule to import + * @param importFromId The id of the existing CfwProtectionRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwProtectionRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_protection_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_protection_rule huaweicloud_cfw_protection_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwProtectionRuleConfig + */ + public constructor(scope: Construct, id: string, config: CfwProtectionRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_protection_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionType = config.actionType; + this._addressType = config.addressType; + this._description = config.description; + this._direction = config.direction; + this._id = config.id; + this._longConnectEnable = config.longConnectEnable; + this._longConnectTimeHour = config.longConnectTimeHour; + this._longConnectTimeMinute = config.longConnectTimeMinute; + this._longConnectTimeSecond = config.longConnectTimeSecond; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + this._ruleHitCount = config.ruleHitCount; + this._status = config.status; + this._tags = config.tags; + this._type = config.type; + this._destination.internalValue = config.destination; + this._sequence.internalValue = config.sequence; + this._service.internalValue = config.service; + this._source.internalValue = config.source; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_type - computed: false, optional: false, required: true + private _actionType?: number; + public get actionType() { + return this.getNumberAttribute('action_type'); + } + public set actionType(value: number) { + this._actionType = value; + } + // Temporarily expose input value. Use with caution. + public get actionTypeInput() { + return this._actionType; + } + + // address_type - computed: false, optional: false, required: true + private _addressType?: number; + public get addressType() { + return this.getNumberAttribute('address_type'); + } + public set addressType(value: number) { + this._addressType = value; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: true, optional: true, required: false + private _direction?: number; + public get direction() { + return this.getNumberAttribute('direction'); + } + public set direction(value: number) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // long_connect_enable - computed: false, optional: false, required: true + private _longConnectEnable?: number; + public get longConnectEnable() { + return this.getNumberAttribute('long_connect_enable'); + } + public set longConnectEnable(value: number) { + this._longConnectEnable = value; + } + // Temporarily expose input value. Use with caution. + public get longConnectEnableInput() { + return this._longConnectEnable; + } + + // long_connect_time_hour - computed: true, optional: true, required: false + private _longConnectTimeHour?: number; + public get longConnectTimeHour() { + return this.getNumberAttribute('long_connect_time_hour'); + } + public set longConnectTimeHour(value: number) { + this._longConnectTimeHour = value; + } + public resetLongConnectTimeHour() { + this._longConnectTimeHour = undefined; + } + // Temporarily expose input value. Use with caution. + public get longConnectTimeHourInput() { + return this._longConnectTimeHour; + } + + // long_connect_time_minute - computed: true, optional: true, required: false + private _longConnectTimeMinute?: number; + public get longConnectTimeMinute() { + return this.getNumberAttribute('long_connect_time_minute'); + } + public set longConnectTimeMinute(value: number) { + this._longConnectTimeMinute = value; + } + public resetLongConnectTimeMinute() { + this._longConnectTimeMinute = undefined; + } + // Temporarily expose input value. Use with caution. + public get longConnectTimeMinuteInput() { + return this._longConnectTimeMinute; + } + + // long_connect_time_second - computed: true, optional: true, required: false + private _longConnectTimeSecond?: number; + public get longConnectTimeSecond() { + return this.getNumberAttribute('long_connect_time_second'); + } + public set longConnectTimeSecond(value: number) { + this._longConnectTimeSecond = value; + } + public resetLongConnectTimeSecond() { + this._longConnectTimeSecond = undefined; + } + // Temporarily expose input value. Use with caution. + public get longConnectTimeSecondInput() { + return this._longConnectTimeSecond; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_hit_count - computed: true, optional: true, required: false + private _ruleHitCount?: string; + public get ruleHitCount() { + return this.getStringAttribute('rule_hit_count'); + } + public set ruleHitCount(value: string) { + this._ruleHitCount = value; + } + public resetRuleHitCount() { + this._ruleHitCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleHitCountInput() { + return this._ruleHitCount; + } + + // status - computed: false, optional: false, required: true + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // destination - computed: false, optional: false, required: true + private _destination = new CfwProtectionRuleDestinationOutputReference(this, "destination"); + public get destination() { + return this._destination; + } + public putDestination(value: CfwProtectionRuleDestination) { + this._destination.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination.internalValue; + } + + // sequence - computed: false, optional: false, required: true + private _sequence = new CfwProtectionRuleSequenceOutputReference(this, "sequence"); + public get sequence() { + return this._sequence; + } + public putSequence(value: CfwProtectionRuleSequence) { + this._sequence.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sequenceInput() { + return this._sequence.internalValue; + } + + // service - computed: false, optional: false, required: true + private _service = new CfwProtectionRuleServiceOutputReference(this, "service"); + public get service() { + return this._service; + } + public putService(value: CfwProtectionRuleService) { + this._service.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service.internalValue; + } + + // source - computed: false, optional: false, required: true + private _source = new CfwProtectionRuleSourceOutputReference(this, "source"); + public get source() { + return this._source; + } + public putSource(value: CfwProtectionRuleSource) { + this._source.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CfwProtectionRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CfwProtectionRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_type: cdktf.numberToTerraform(this._actionType), + address_type: cdktf.numberToTerraform(this._addressType), + description: cdktf.stringToTerraform(this._description), + direction: cdktf.numberToTerraform(this._direction), + id: cdktf.stringToTerraform(this._id), + long_connect_enable: cdktf.numberToTerraform(this._longConnectEnable), + long_connect_time_hour: cdktf.numberToTerraform(this._longConnectTimeHour), + long_connect_time_minute: cdktf.numberToTerraform(this._longConnectTimeMinute), + long_connect_time_second: cdktf.numberToTerraform(this._longConnectTimeSecond), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + rule_hit_count: cdktf.stringToTerraform(this._ruleHitCount), + status: cdktf.numberToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.numberToTerraform(this._type), + destination: cfwProtectionRuleDestinationToTerraform(this._destination.internalValue), + sequence: cfwProtectionRuleSequenceToTerraform(this._sequence.internalValue), + service: cfwProtectionRuleServiceToTerraform(this._service.internalValue), + source: cfwProtectionRuleSourceToTerraform(this._source.internalValue), + timeouts: cfwProtectionRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_type: { + value: cdktf.numberToHclTerraform(this._actionType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + address_type: { + value: cdktf.numberToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.numberToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + long_connect_enable: { + value: cdktf.numberToHclTerraform(this._longConnectEnable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + long_connect_time_hour: { + value: cdktf.numberToHclTerraform(this._longConnectTimeHour), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + long_connect_time_minute: { + value: cdktf.numberToHclTerraform(this._longConnectTimeMinute), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + long_connect_time_second: { + value: cdktf.numberToHclTerraform(this._longConnectTimeSecond), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_hit_count: { + value: cdktf.stringToHclTerraform(this._ruleHitCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + destination: { + value: cfwProtectionRuleDestinationToHclTerraform(this._destination.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleDestinationList", + }, + sequence: { + value: cfwProtectionRuleSequenceToHclTerraform(this._sequence.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleSequenceList", + }, + service: { + value: cfwProtectionRuleServiceToHclTerraform(this._service.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleServiceList", + }, + source: { + value: cfwProtectionRuleSourceToHclTerraform(this._source.internalValue), + isBlock: true, + type: "list", + storageClassType: "CfwProtectionRuleSourceList", + }, + timeouts: { + value: cfwProtectionRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CfwProtectionRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-service-group-member/README.md b/src/constructs/providers/huaweicloud/cfw-service-group-member/README.md new file mode 100644 index 00000000..29095723 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-service-group-member/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_service_group_member` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_service_group_member`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member). diff --git a/src/constructs/providers/huaweicloud/cfw-service-group-member/index.ts b/src/constructs/providers/huaweicloud/cfw-service-group-member/index.ts new file mode 100644 index 00000000..872f1895 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-service-group-member/index.ts @@ -0,0 +1,312 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwServiceGroupMemberConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the service group member description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#description CfwServiceGroupMember#description} + */ + readonly description?: string; + /** + * Specifies the destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#dest_port CfwServiceGroupMember#dest_port} + */ + readonly destPort: string; + /** + * Specifies the ID of the service group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#group_id CfwServiceGroupMember#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#id CfwServiceGroupMember#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the service group member name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#name CfwServiceGroupMember#name} + */ + readonly name?: string; + /** + * Specifies the protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#protocol CfwServiceGroupMember#protocol} + */ + readonly protocol: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#region CfwServiceGroupMember#region} + */ + readonly region?: string; + /** + * Specifies the source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#source_port CfwServiceGroupMember#source_port} + */ + readonly sourcePort: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member huaweicloud_cfw_service_group_member} +*/ +export class CfwServiceGroupMember extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_service_group_member"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwServiceGroupMember resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwServiceGroupMember to import + * @param importFromId The id of the existing CfwServiceGroupMember that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwServiceGroupMember to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_service_group_member", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group_member huaweicloud_cfw_service_group_member} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwServiceGroupMemberConfig + */ + public constructor(scope: Construct, id: string, config: CfwServiceGroupMemberConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_service_group_member', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._destPort = config.destPort; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + this._sourcePort = config.sourcePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dest_port - computed: false, optional: false, required: true + private _destPort?: string; + public get destPort() { + return this.getStringAttribute('dest_port'); + } + public set destPort(value: string) { + this._destPort = value; + } + // Temporarily expose input value. Use with caution. + public get destPortInput() { + return this._destPort; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_port - computed: false, optional: false, required: true + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + dest_port: cdktf.stringToTerraform(this._destPort), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.numberToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + source_port: cdktf.stringToTerraform(this._sourcePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dest_port: { + value: cdktf.stringToHclTerraform(this._destPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(this._sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cfw-service-group/README.md b/src/constructs/providers/huaweicloud/cfw-service-group/README.md new file mode 100644 index 00000000..505f9f71 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-service-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cfw_service_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_cfw_service_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group). diff --git a/src/constructs/providers/huaweicloud/cfw-service-group/index.ts b/src/constructs/providers/huaweicloud/cfw-service-group/index.ts new file mode 100644 index 00000000..4bdb8dc5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cfw-service-group/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CfwServiceGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the service group description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group#description CfwServiceGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group#id CfwServiceGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the service group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group#name CfwServiceGroup#name} + */ + readonly name: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group#object_id CfwServiceGroup#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group#region CfwServiceGroup#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group huaweicloud_cfw_service_group} +*/ +export class CfwServiceGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_service_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CfwServiceGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CfwServiceGroup to import + * @param importFromId The id of the existing CfwServiceGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CfwServiceGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_service_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cfw_service_group huaweicloud_cfw_service_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CfwServiceGroupConfig + */ + public constructor(scope: Construct, id: string, config: CfwServiceGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_service_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cloudtable-cluster/README.md b/src/constructs/providers/huaweicloud/cloudtable-cluster/README.md new file mode 100644 index 00000000..0e05783e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cloudtable-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cloudtable_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_cloudtable_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster). diff --git a/src/constructs/providers/huaweicloud/cloudtable-cluster/index.ts b/src/constructs/providers/huaweicloud/cloudtable-cluster/index.ts new file mode 100644 index 00000000..fb0e6058 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cloudtable-cluster/index.ts @@ -0,0 +1,600 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CloudtableClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#availability_zone CloudtableCluster#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#hbase_version CloudtableCluster#hbase_version} + */ + readonly hbaseVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#iam_auth_enabled CloudtableCluster#iam_auth_enabled} + */ + readonly iamAuthEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#id CloudtableCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#name CloudtableCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#network_id CloudtableCluster#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#opentsdb_num CloudtableCluster#opentsdb_num} + */ + readonly opentsdbNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#region CloudtableCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#rs_num CloudtableCluster#rs_num} + */ + readonly rsNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#security_group_id CloudtableCluster#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#storage_type CloudtableCluster#storage_type} + */ + readonly storageType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#vpc_id CloudtableCluster#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#timeouts CloudtableCluster#timeouts} + */ + readonly timeouts?: CloudtableClusterTimeouts; +} +export interface CloudtableClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#create CloudtableCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#delete CloudtableCluster#delete} + */ + readonly delete?: string; +} + +export function cloudtableClusterTimeoutsToTerraform(struct?: CloudtableClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cloudtableClusterTimeoutsToHclTerraform(struct?: CloudtableClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CloudtableClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CloudtableClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CloudtableClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster huaweicloud_cloudtable_cluster} +*/ +export class CloudtableCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cloudtable_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CloudtableCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CloudtableCluster to import + * @param importFromId The id of the existing CloudtableCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CloudtableCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cloudtable_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cloudtable_cluster huaweicloud_cloudtable_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CloudtableClusterConfig + */ + public constructor(scope: Construct, id: string, config: CloudtableClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cloudtable_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._hbaseVersion = config.hbaseVersion; + this._iamAuthEnabled = config.iamAuthEnabled; + this._id = config.id; + this._name = config.name; + this._networkId = config.networkId; + this._opentsdbNum = config.opentsdbNum; + this._region = config.region; + this._rsNum = config.rsNum; + this._securityGroupId = config.securityGroupId; + this._storageType = config.storageType; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // hbase_public_endpoint - computed: true, optional: false, required: false + public get hbasePublicEndpoint() { + return this.getStringAttribute('hbase_public_endpoint'); + } + + // hbase_version - computed: false, optional: false, required: true + private _hbaseVersion?: string; + public get hbaseVersion() { + return this.getStringAttribute('hbase_version'); + } + public set hbaseVersion(value: string) { + this._hbaseVersion = value; + } + // Temporarily expose input value. Use with caution. + public get hbaseVersionInput() { + return this._hbaseVersion; + } + + // iam_auth_enabled - computed: true, optional: true, required: false + private _iamAuthEnabled?: boolean | cdktf.IResolvable; + public get iamAuthEnabled() { + return this.getBooleanAttribute('iam_auth_enabled'); + } + public set iamAuthEnabled(value: boolean | cdktf.IResolvable) { + this._iamAuthEnabled = value; + } + public resetIamAuthEnabled() { + this._iamAuthEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get iamAuthEnabledInput() { + return this._iamAuthEnabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // open_tsdb_link - computed: true, optional: false, required: false + public get openTsdbLink() { + return this.getStringAttribute('open_tsdb_link'); + } + + // opentsdb_num - computed: true, optional: true, required: false + private _opentsdbNum?: number; + public get opentsdbNum() { + return this.getNumberAttribute('opentsdb_num'); + } + public set opentsdbNum(value: number) { + this._opentsdbNum = value; + } + public resetOpentsdbNum() { + this._opentsdbNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get opentsdbNumInput() { + return this._opentsdbNum; + } + + // opentsdb_public_endpoint - computed: true, optional: false, required: false + public get opentsdbPublicEndpoint() { + return this.getStringAttribute('opentsdb_public_endpoint'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rs_num - computed: false, optional: true, required: false + private _rsNum?: number; + public get rsNum() { + return this.getNumberAttribute('rs_num'); + } + public set rsNum(value: number) { + this._rsNum = value; + } + public resetRsNum() { + this._rsNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get rsNumInput() { + return this._rsNum; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_size - computed: true, optional: false, required: false + public get storageSize() { + return this.getNumberAttribute('storage_size'); + } + + // storage_size_used - computed: true, optional: false, required: false + public get storageSizeUsed() { + return this.getNumberAttribute('storage_size_used'); + } + + // storage_type - computed: false, optional: false, required: true + private _storageType?: string; + public get storageType() { + return this.getStringAttribute('storage_type'); + } + public set storageType(value: string) { + this._storageType = value; + } + // Temporarily expose input value. Use with caution. + public get storageTypeInput() { + return this._storageType; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // zookeeper_link - computed: true, optional: false, required: false + public get zookeeperLink() { + return this.getStringAttribute('zookeeper_link'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CloudtableClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CloudtableClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + hbase_version: cdktf.stringToTerraform(this._hbaseVersion), + iam_auth_enabled: cdktf.booleanToTerraform(this._iamAuthEnabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + opentsdb_num: cdktf.numberToTerraform(this._opentsdbNum), + region: cdktf.stringToTerraform(this._region), + rs_num: cdktf.numberToTerraform(this._rsNum), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + storage_type: cdktf.stringToTerraform(this._storageType), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: cloudtableClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hbase_version: { + value: cdktf.stringToHclTerraform(this._hbaseVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iam_auth_enabled: { + value: cdktf.booleanToHclTerraform(this._iamAuthEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + opentsdb_num: { + value: cdktf.numberToHclTerraform(this._opentsdbNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rs_num: { + value: cdktf.numberToHclTerraform(this._rsNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_type: { + value: cdktf.stringToHclTerraform(this._storageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cloudtableClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CloudtableClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/README.md b/src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/README.md new file mode 100644 index 00000000..ff7cf615 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cnad_advanced_black_white_list` + +Refer to the Terraform Registry for docs: [`huaweicloud_cnad_advanced_black_white_list`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list). diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/index.ts b/src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/index.ts new file mode 100644 index 00000000..599f352d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-black-white-list/index.ts @@ -0,0 +1,203 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CnadAdvancedBlackWhiteListConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the black IP list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list#black_ip_list CnadAdvancedBlackWhiteList#black_ip_list} + */ + readonly blackIpList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list#id CnadAdvancedBlackWhiteList#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list#policy_id CnadAdvancedBlackWhiteList#policy_id} + */ + readonly policyId: string; + /** + * Specifies the white IP list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list#white_ip_list CnadAdvancedBlackWhiteList#white_ip_list} + */ + readonly whiteIpList?: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list huaweicloud_cnad_advanced_black_white_list} +*/ +export class CnadAdvancedBlackWhiteList extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_black_white_list"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CnadAdvancedBlackWhiteList resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CnadAdvancedBlackWhiteList to import + * @param importFromId The id of the existing CnadAdvancedBlackWhiteList that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CnadAdvancedBlackWhiteList to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_black_white_list", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_black_white_list huaweicloud_cnad_advanced_black_white_list} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CnadAdvancedBlackWhiteListConfig + */ + public constructor(scope: Construct, id: string, config: CnadAdvancedBlackWhiteListConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_black_white_list', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._blackIpList = config.blackIpList; + this._id = config.id; + this._policyId = config.policyId; + this._whiteIpList = config.whiteIpList; + } + + // ========== + // ATTRIBUTES + // ========== + + // black_ip_list - computed: true, optional: true, required: false + private _blackIpList?: string[]; + public get blackIpList() { + return cdktf.Fn.tolist(this.getListAttribute('black_ip_list')); + } + public set blackIpList(value: string[]) { + this._blackIpList = value; + } + public resetBlackIpList() { + this._blackIpList = undefined; + } + // Temporarily expose input value. Use with caution. + public get blackIpListInput() { + return this._blackIpList; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // white_ip_list - computed: true, optional: true, required: false + private _whiteIpList?: string[]; + public get whiteIpList() { + return cdktf.Fn.tolist(this.getListAttribute('white_ip_list')); + } + public set whiteIpList(value: string[]) { + this._whiteIpList = value; + } + public resetWhiteIpList() { + this._whiteIpList = undefined; + } + // Temporarily expose input value. Use with caution. + public get whiteIpListInput() { + return this._whiteIpList; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + black_ip_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._blackIpList), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + white_ip_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._whiteIpList), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + black_ip_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._blackIpList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + white_ip_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._whiteIpList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/README.md b/src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/README.md new file mode 100644 index 00000000..9ffa64e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cnad_advanced_policy_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_cnad_advanced_policy_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate). diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/index.ts b/src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/index.ts new file mode 100644 index 00000000..9259a82e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-policy-associate/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CnadAdvancedPolicyAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate#id CnadAdvancedPolicyAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. This field must be the instance ID where the policy is + * located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate#instance_id CnadAdvancedPolicyAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the CNAD advanced policy ID in which to associate protected objects. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate#policy_id CnadAdvancedPolicyAssociate#policy_id} + */ + readonly policyId: string; + /** + * Specifies the protected object IDs to associate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate#protected_object_ids CnadAdvancedPolicyAssociate#protected_object_ids} + */ + readonly protectedObjectIds: string[]; +} +export interface CnadAdvancedPolicyAssociateProtectedObjects { +} + +export function cnadAdvancedPolicyAssociateProtectedObjectsToTerraform(struct?: CnadAdvancedPolicyAssociateProtectedObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cnadAdvancedPolicyAssociateProtectedObjectsToHclTerraform(struct?: CnadAdvancedPolicyAssociateProtectedObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CnadAdvancedPolicyAssociateProtectedObjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CnadAdvancedPolicyAssociateProtectedObjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CnadAdvancedPolicyAssociateProtectedObjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // block_threshold - computed: true, optional: false, required: false + public get blockThreshold() { + return this.getStringAttribute('block_threshold'); + } + + // clean_threshold - computed: true, optional: false, required: false + public get cleanThreshold() { + return this.getNumberAttribute('clean_threshold'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_version - computed: true, optional: false, required: false + public get instanceVersion() { + return this.getStringAttribute('instance_version'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_name - computed: true, optional: false, required: false + public get policyName() { + return this.getStringAttribute('policy_name'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CnadAdvancedPolicyAssociateProtectedObjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CnadAdvancedPolicyAssociateProtectedObjectsOutputReference { + return new CnadAdvancedPolicyAssociateProtectedObjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate huaweicloud_cnad_advanced_policy_associate} +*/ +export class CnadAdvancedPolicyAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_policy_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CnadAdvancedPolicyAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CnadAdvancedPolicyAssociate to import + * @param importFromId The id of the existing CnadAdvancedPolicyAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CnadAdvancedPolicyAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_policy_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy_associate huaweicloud_cnad_advanced_policy_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CnadAdvancedPolicyAssociateConfig + */ + public constructor(scope: Construct, id: string, config: CnadAdvancedPolicyAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_policy_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._policyId = config.policyId; + this._protectedObjectIds = config.protectedObjectIds; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protected_object_ids - computed: false, optional: false, required: true + private _protectedObjectIds?: string[]; + public get protectedObjectIds() { + return cdktf.Fn.tolist(this.getListAttribute('protected_object_ids')); + } + public set protectedObjectIds(value: string[]) { + this._protectedObjectIds = value; + } + // Temporarily expose input value. Use with caution. + public get protectedObjectIdsInput() { + return this._protectedObjectIds; + } + + // protected_objects - computed: true, optional: false, required: false + private _protectedObjects = new CnadAdvancedPolicyAssociateProtectedObjectsList(this, "protected_objects", false); + public get protectedObjects() { + return this._protectedObjects; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + policy_id: cdktf.stringToTerraform(this._policyId), + protected_object_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._protectedObjectIds), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected_object_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._protectedObjectIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-policy/README.md b/src/constructs/providers/huaweicloud/cnad-advanced-policy/README.md new file mode 100644 index 00000000..4563daa8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cnad_advanced_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_cnad_advanced_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy). diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-policy/index.ts b/src/constructs/providers/huaweicloud/cnad-advanced-policy/index.ts new file mode 100644 index 00000000..47471d6f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-policy/index.ts @@ -0,0 +1,265 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CnadAdvancedPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy#id CnadAdvancedPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the CNAD advanced instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy#instance_id CnadAdvancedPolicy#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the policy name, the maximum length is 255 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy#name CnadAdvancedPolicy#name} + */ + readonly name: string; + /** + * Specifies the cleaning threshold, the value ranges from 100 to 1000. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy#threshold CnadAdvancedPolicy#threshold} + */ + readonly threshold?: number; + /** + * Specifies whether to block the UDP protocol. Valid values are **block** and **unblock**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy#udp CnadAdvancedPolicy#udp} + */ + readonly udp?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy huaweicloud_cnad_advanced_policy} +*/ +export class CnadAdvancedPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CnadAdvancedPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CnadAdvancedPolicy to import + * @param importFromId The id of the existing CnadAdvancedPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CnadAdvancedPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_policy huaweicloud_cnad_advanced_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CnadAdvancedPolicyConfig + */ + public constructor(scope: Construct, id: string, config: CnadAdvancedPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._threshold = config.threshold; + this._udp = config.udp; + } + + // ========== + // ATTRIBUTES + // ========== + + // block_location - computed: true, optional: false, required: false + public get blockLocation() { + return this.getListAttribute('block_location'); + } + + // block_protocol - computed: true, optional: false, required: false + public get blockProtocol() { + return this.getListAttribute('block_protocol'); + } + + // connection_protection - computed: true, optional: false, required: false + public get connectionProtection() { + return this.getBooleanAttribute('connection_protection'); + } + + // connection_protection_list - computed: true, optional: false, required: false + public get connectionProtectionList() { + return this.getListAttribute('connection_protection_list'); + } + + // fingerprint_count - computed: true, optional: false, required: false + public get fingerprintCount() { + return this.getNumberAttribute('fingerprint_count'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port_block_count - computed: true, optional: false, required: false + public get portBlockCount() { + return this.getNumberAttribute('port_block_count'); + } + + // threshold - computed: true, optional: true, required: false + private _threshold?: number; + public get threshold() { + return this.getNumberAttribute('threshold'); + } + public set threshold(value: number) { + this._threshold = value; + } + public resetThreshold() { + this._threshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get thresholdInput() { + return this._threshold; + } + + // udp - computed: false, optional: true, required: false + private _udp?: string; + public get udp() { + return this.getStringAttribute('udp'); + } + public set udp(value: string) { + this._udp = value; + } + public resetUdp() { + this._udp = undefined; + } + // Temporarily expose input value. Use with caution. + public get udpInput() { + return this._udp; + } + + // watermark_count - computed: true, optional: false, required: false + public get watermarkCount() { + return this.getNumberAttribute('watermark_count'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + threshold: cdktf.numberToTerraform(this._threshold), + udp: cdktf.stringToTerraform(this._udp), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + threshold: { + value: cdktf.numberToHclTerraform(this._threshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + udp: { + value: cdktf.stringToHclTerraform(this._udp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-protected-object/README.md b/src/constructs/providers/huaweicloud/cnad-advanced-protected-object/README.md new file mode 100644 index 00000000..6852a60b --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-protected-object/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cnad_advanced_protected_object` + +Refer to the Terraform Registry for docs: [`huaweicloud_cnad_advanced_protected_object`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object). diff --git a/src/constructs/providers/huaweicloud/cnad-advanced-protected-object/index.ts b/src/constructs/providers/huaweicloud/cnad-advanced-protected-object/index.ts new file mode 100644 index 00000000..345c8363 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cnad-advanced-protected-object/index.ts @@ -0,0 +1,398 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CnadAdvancedProtectedObjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#id CnadAdvancedProtectedObject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID in which to bind protected objects. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#instance_id CnadAdvancedProtectedObject#instance_id} + */ + readonly instanceId: string; + /** + * protected_objects block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#protected_objects CnadAdvancedProtectedObject#protected_objects} + */ + readonly protectedObjects: CnadAdvancedProtectedObjectProtectedObjects[] | cdktf.IResolvable; +} +export interface CnadAdvancedProtectedObjectProtectedObjects { + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#id CnadAdvancedProtectedObject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Specifies the protected object IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#ip_address CnadAdvancedProtectedObject#ip_address} + */ + readonly ipAddress: string; + /** + * Specifies the protected object type. Valid values are **VPN**, **NAT**, **VIP**, **CCI**, + * **EIP**, **ELB**, **REROUTING_IP**, **SubEni** and **NetInterFace**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#type CnadAdvancedProtectedObject#type} + */ + readonly type: string; +} + +export function cnadAdvancedProtectedObjectProtectedObjectsToTerraform(struct?: CnadAdvancedProtectedObjectProtectedObjects | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function cnadAdvancedProtectedObjectProtectedObjectsToHclTerraform(struct?: CnadAdvancedProtectedObjectProtectedObjects | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CnadAdvancedProtectedObjectProtectedObjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CnadAdvancedProtectedObjectProtectedObjects | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CnadAdvancedProtectedObjectProtectedObjects | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._ipAddress = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._ipAddress = value.ipAddress; + this._type = value.type; + } + } + + // block_threshold - computed: true, optional: false, required: false + public get blockThreshold() { + return this.getStringAttribute('block_threshold'); + } + + // clean_threshold - computed: true, optional: false, required: false + public get cleanThreshold() { + return this.getNumberAttribute('clean_threshold'); + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_version - computed: true, optional: false, required: false + public get instanceVersion() { + return this.getStringAttribute('instance_version'); + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_name - computed: true, optional: false, required: false + public get policyName() { + return this.getStringAttribute('policy_name'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CnadAdvancedProtectedObjectProtectedObjectsList extends cdktf.ComplexList { + public internalValue? : CnadAdvancedProtectedObjectProtectedObjects[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CnadAdvancedProtectedObjectProtectedObjectsOutputReference { + return new CnadAdvancedProtectedObjectProtectedObjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object huaweicloud_cnad_advanced_protected_object} +*/ +export class CnadAdvancedProtectedObject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_protected_object"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CnadAdvancedProtectedObject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CnadAdvancedProtectedObject to import + * @param importFromId The id of the existing CnadAdvancedProtectedObject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CnadAdvancedProtectedObject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_protected_object", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cnad_advanced_protected_object huaweicloud_cnad_advanced_protected_object} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CnadAdvancedProtectedObjectConfig + */ + public constructor(scope: Construct, id: string, config: CnadAdvancedProtectedObjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_protected_object', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._protectedObjects.internalValue = config.protectedObjects; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // protected_objects - computed: false, optional: false, required: true + private _protectedObjects = new CnadAdvancedProtectedObjectProtectedObjectsList(this, "protected_objects", false); + public get protectedObjects() { + return this._protectedObjects; + } + public putProtectedObjects(value: CnadAdvancedProtectedObjectProtectedObjects[] | cdktf.IResolvable) { + this._protectedObjects.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get protectedObjectsInput() { + return this._protectedObjects.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + protected_objects: cdktf.listMapper(cnadAdvancedProtectedObjectProtectedObjectsToTerraform, true)(this._protectedObjects.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected_objects: { + value: cdktf.listMapperHcl(cnadAdvancedProtectedObjectProtectedObjectsToHclTerraform, true)(this._protectedObjects.internalValue), + isBlock: true, + type: "list", + storageClassType: "CnadAdvancedProtectedObjectProtectedObjectsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/coc-script-execute/README.md b/src/constructs/providers/huaweicloud/coc-script-execute/README.md new file mode 100644 index 00000000..15bfa376 --- /dev/null +++ b/src/constructs/providers/huaweicloud/coc-script-execute/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_coc_script_execute` + +Refer to the Terraform Registry for docs: [`huaweicloud_coc_script_execute`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute). diff --git a/src/constructs/providers/huaweicloud/coc-script-execute/index.ts b/src/constructs/providers/huaweicloud/coc-script-execute/index.ts new file mode 100644 index 00000000..c6e58ab3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/coc-script-execute/index.ts @@ -0,0 +1,566 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CocScriptExecuteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#execute_user CocScriptExecute#execute_user} + */ + readonly executeUser: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#id CocScriptExecute#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#instance_id CocScriptExecute#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#script_id CocScriptExecute#script_id} + */ + readonly scriptId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#timeout CocScriptExecute#timeout} + */ + readonly timeout: number; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#parameters CocScriptExecute#parameters} + */ + readonly parameters?: CocScriptExecuteParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#timeouts CocScriptExecute#timeouts} + */ + readonly timeouts?: CocScriptExecuteTimeouts; +} +export interface CocScriptExecuteParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#name CocScriptExecute#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#value CocScriptExecute#value} + */ + readonly value: string; +} + +export function cocScriptExecuteParametersToTerraform(struct?: CocScriptExecuteParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cocScriptExecuteParametersToHclTerraform(struct?: CocScriptExecuteParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CocScriptExecuteParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CocScriptExecuteParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CocScriptExecuteParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CocScriptExecuteParametersList extends cdktf.ComplexList { + public internalValue? : CocScriptExecuteParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CocScriptExecuteParametersOutputReference { + return new CocScriptExecuteParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CocScriptExecuteTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#create CocScriptExecute#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#delete CocScriptExecute#delete} + */ + readonly delete?: string; +} + +export function cocScriptExecuteTimeoutsToTerraform(struct?: CocScriptExecuteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cocScriptExecuteTimeoutsToHclTerraform(struct?: CocScriptExecuteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CocScriptExecuteTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CocScriptExecuteTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CocScriptExecuteTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute huaweicloud_coc_script_execute} +*/ +export class CocScriptExecute extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_coc_script_execute"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CocScriptExecute resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CocScriptExecute to import + * @param importFromId The id of the existing CocScriptExecute that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CocScriptExecute to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_coc_script_execute", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script_execute huaweicloud_coc_script_execute} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CocScriptExecuteConfig + */ + public constructor(scope: Construct, id: string, config: CocScriptExecuteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_coc_script_execute', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._executeUser = config.executeUser; + this._id = config.id; + this._instanceId = config.instanceId; + this._scriptId = config.scriptId; + this._timeout = config.timeout; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // execute_user - computed: false, optional: false, required: true + private _executeUser?: string; + public get executeUser() { + return this.getStringAttribute('execute_user'); + } + public set executeUser(value: string) { + this._executeUser = value; + } + // Temporarily expose input value. Use with caution. + public get executeUserInput() { + return this._executeUser; + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // script_id - computed: false, optional: false, required: true + private _scriptId?: string; + public get scriptId() { + return this.getStringAttribute('script_id'); + } + public set scriptId(value: string) { + this._scriptId = value; + } + // Temporarily expose input value. Use with caution. + public get scriptIdInput() { + return this._scriptId; + } + + // script_name - computed: true, optional: false, required: false + public get scriptName() { + return this.getStringAttribute('script_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new CocScriptExecuteParametersList(this, "parameters", false); + public get parameters() { + return this._parameters; + } + public putParameters(value: CocScriptExecuteParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CocScriptExecuteTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CocScriptExecuteTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + execute_user: cdktf.stringToTerraform(this._executeUser), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + script_id: cdktf.stringToTerraform(this._scriptId), + timeout: cdktf.numberToTerraform(this._timeout), + parameters: cdktf.listMapper(cocScriptExecuteParametersToTerraform, true)(this._parameters.internalValue), + timeouts: cocScriptExecuteTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + execute_user: { + value: cdktf.stringToHclTerraform(this._executeUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + script_id: { + value: cdktf.stringToHclTerraform(this._scriptId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + parameters: { + value: cdktf.listMapperHcl(cocScriptExecuteParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "list", + storageClassType: "CocScriptExecuteParametersList", + }, + timeouts: { + value: cocScriptExecuteTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CocScriptExecuteTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/coc-script/README.md b/src/constructs/providers/huaweicloud/coc-script/README.md new file mode 100644 index 00000000..8b6d4f01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/coc-script/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_coc_script` + +Refer to the Terraform Registry for docs: [`huaweicloud_coc_script`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script). diff --git a/src/constructs/providers/huaweicloud/coc-script/index.ts b/src/constructs/providers/huaweicloud/coc-script/index.ts new file mode 100644 index 00000000..b8b605e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/coc-script/index.ts @@ -0,0 +1,517 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CocScriptConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#content CocScript#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#description CocScript#description} + */ + readonly description: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#id CocScript#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#name CocScript#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#risk_level CocScript#risk_level} + */ + readonly riskLevel: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#type CocScript#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#version CocScript#version} + */ + readonly version: string; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#parameters CocScript#parameters} + */ + readonly parameters?: CocScriptParameters[] | cdktf.IResolvable; +} +export interface CocScriptParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#description CocScript#description} + */ + readonly description: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#name CocScript#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#sensitive CocScript#sensitive} + */ + readonly sensitive?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#value CocScript#value} + */ + readonly value: string; +} + +export function cocScriptParametersToTerraform(struct?: CocScriptParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + sensitive: cdktf.booleanToTerraform(struct!.sensitive), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function cocScriptParametersToHclTerraform(struct?: CocScriptParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sensitive: { + value: cdktf.booleanToHclTerraform(struct!.sensitive), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CocScriptParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CocScriptParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._sensitive !== undefined) { + hasAnyValues = true; + internalValueResult.sensitive = this._sensitive; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CocScriptParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._name = undefined; + this._sensitive = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._name = value.name; + this._sensitive = value.sensitive; + this._value = value.value; + } + } + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // sensitive - computed: false, optional: true, required: false + private _sensitive?: boolean | cdktf.IResolvable; + public get sensitive() { + return this.getBooleanAttribute('sensitive'); + } + public set sensitive(value: boolean | cdktf.IResolvable) { + this._sensitive = value; + } + public resetSensitive() { + this._sensitive = undefined; + } + // Temporarily expose input value. Use with caution. + public get sensitiveInput() { + return this._sensitive; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class CocScriptParametersList extends cdktf.ComplexList { + public internalValue? : CocScriptParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CocScriptParametersOutputReference { + return new CocScriptParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script huaweicloud_coc_script} +*/ +export class CocScript extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_coc_script"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CocScript resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CocScript to import + * @param importFromId The id of the existing CocScript that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CocScript to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_coc_script", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/coc_script huaweicloud_coc_script} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CocScriptConfig + */ + public constructor(scope: Construct, id: string, config: CocScriptConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_coc_script', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._riskLevel = config.riskLevel; + this._type = config.type; + this._version = config.version; + this._parameters.internalValue = config.parameters; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // risk_level - computed: false, optional: false, required: true + private _riskLevel?: string; + public get riskLevel() { + return this.getStringAttribute('risk_level'); + } + public set riskLevel(value: string) { + this._riskLevel = value; + } + // Temporarily expose input value. Use with caution. + public get riskLevelInput() { + return this._riskLevel; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new CocScriptParametersList(this, "parameters", false); + public get parameters() { + return this._parameters; + } + public putParameters(value: CocScriptParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + risk_level: cdktf.stringToTerraform(this._riskLevel), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + parameters: cdktf.listMapper(cocScriptParametersToTerraform, true)(this._parameters.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + risk_level: { + value: cdktf.stringToHclTerraform(this._riskLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.listMapperHcl(cocScriptParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "list", + storageClassType: "CocScriptParametersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-deploy-application/README.md b/src/constructs/providers/huaweicloud/codearts-deploy-application/README.md new file mode 100644 index 00000000..495ad812 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-deploy-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_deploy_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_deploy_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application). diff --git a/src/constructs/providers/huaweicloud/codearts-deploy-application/index.ts b/src/constructs/providers/huaweicloud/codearts-deploy-application/index.ts new file mode 100644 index 00000000..52ec28b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-deploy-application/index.ts @@ -0,0 +1,853 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsDeployApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the source information transferred by the pipeline. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#artifact_source_system CodeartsDeployApplication#artifact_source_system} + */ + readonly artifactSourceSystem?: string; + /** + * Specifies the artifact type for the pipeline source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#artifact_type CodeartsDeployApplication#artifact_type} + */ + readonly artifactType?: string; + /** + * Specifies the creation type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#create_type CodeartsDeployApplication#create_type} + */ + readonly createType: string; + /** + * Specifies the application description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#description CodeartsDeployApplication#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#id CodeartsDeployApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the application is in draft status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#is_draft CodeartsDeployApplication#is_draft} + */ + readonly isDraft: boolean | cdktf.IResolvable; + /** + * Specifies the application name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#name CodeartsDeployApplication#name} + */ + readonly name: string; + /** + * Specifies the project ID for CodeArts service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#project_id CodeartsDeployApplication#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#region CodeartsDeployApplication#region} + */ + readonly region?: string; + /** + * Specifies the custom slave resource pool ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#resource_pool_id CodeartsDeployApplication#resource_pool_id} + */ + readonly resourcePoolId?: string; + /** + * schema: Deprecated; Currently, the field is useless for creating API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#template_id CodeartsDeployApplication#template_id} + */ + readonly templateId?: string; + /** + * Specifies where a deployment task can be executed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#trigger_source CodeartsDeployApplication#trigger_source} + */ + readonly triggerSource: string; + /** + * operation_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#operation_list CodeartsDeployApplication#operation_list} + */ + readonly operationList?: CodeartsDeployApplicationOperationListStruct[] | cdktf.IResolvable; +} +export interface CodeartsDeployApplicationOperationListStruct { + /** + * Specifies the download URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#code CodeartsDeployApplication#code} + */ + readonly code?: string; + /** + * Specifies the step description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#description CodeartsDeployApplication#description} + */ + readonly description?: string; + /** + * Specifies the entry function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#entrance CodeartsDeployApplication#entrance} + */ + readonly entrance?: string; + /** + * Specifies the module ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#module_id CodeartsDeployApplication#module_id} + */ + readonly moduleId?: string; + /** + * Specifies the step name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#name CodeartsDeployApplication#name} + */ + readonly name?: string; + /** + * Specifies the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#params CodeartsDeployApplication#params} + */ + readonly params?: string; + /** + * Specifies the version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#version CodeartsDeployApplication#version} + */ + readonly version?: string; +} + +export function codeartsDeployApplicationOperationListStructToTerraform(struct?: CodeartsDeployApplicationOperationListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + code: cdktf.stringToTerraform(struct!.code), + description: cdktf.stringToTerraform(struct!.description), + entrance: cdktf.stringToTerraform(struct!.entrance), + module_id: cdktf.stringToTerraform(struct!.moduleId), + name: cdktf.stringToTerraform(struct!.name), + params: cdktf.stringToTerraform(struct!.params), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function codeartsDeployApplicationOperationListStructToHclTerraform(struct?: CodeartsDeployApplicationOperationListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + code: { + value: cdktf.stringToHclTerraform(struct!.code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + entrance: { + value: cdktf.stringToHclTerraform(struct!.entrance), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + module_id: { + value: cdktf.stringToHclTerraform(struct!.moduleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + params: { + value: cdktf.stringToHclTerraform(struct!.params), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CodeartsDeployApplicationOperationListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CodeartsDeployApplicationOperationListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._code !== undefined) { + hasAnyValues = true; + internalValueResult.code = this._code; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._entrance !== undefined) { + hasAnyValues = true; + internalValueResult.entrance = this._entrance; + } + if (this._moduleId !== undefined) { + hasAnyValues = true; + internalValueResult.moduleId = this._moduleId; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._params !== undefined) { + hasAnyValues = true; + internalValueResult.params = this._params; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CodeartsDeployApplicationOperationListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._code = undefined; + this._description = undefined; + this._entrance = undefined; + this._moduleId = undefined; + this._name = undefined; + this._params = undefined; + this._version = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._code = value.code; + this._description = value.description; + this._entrance = value.entrance; + this._moduleId = value.moduleId; + this._name = value.name; + this._params = value.params; + this._version = value.version; + } + } + + // code - computed: false, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // entrance - computed: false, optional: true, required: false + private _entrance?: string; + public get entrance() { + return this.getStringAttribute('entrance'); + } + public set entrance(value: string) { + this._entrance = value; + } + public resetEntrance() { + this._entrance = undefined; + } + // Temporarily expose input value. Use with caution. + public get entranceInput() { + return this._entrance; + } + + // module_id - computed: false, optional: true, required: false + private _moduleId?: string; + public get moduleId() { + return this.getStringAttribute('module_id'); + } + public set moduleId(value: string) { + this._moduleId = value; + } + public resetModuleId() { + this._moduleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get moduleIdInput() { + return this._moduleId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // params - computed: false, optional: true, required: false + private _params?: string; + public get params() { + return this.getStringAttribute('params'); + } + public set params(value: string) { + this._params = value; + } + public resetParams() { + this._params = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} + +export class CodeartsDeployApplicationOperationListStructList extends cdktf.ComplexList { + public internalValue? : CodeartsDeployApplicationOperationListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CodeartsDeployApplicationOperationListStructOutputReference { + return new CodeartsDeployApplicationOperationListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application huaweicloud_codearts_deploy_application} +*/ +export class CodeartsDeployApplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_deploy_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsDeployApplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsDeployApplication to import + * @param importFromId The id of the existing CodeartsDeployApplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsDeployApplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_deploy_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_application huaweicloud_codearts_deploy_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsDeployApplicationConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsDeployApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_deploy_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._artifactSourceSystem = config.artifactSourceSystem; + this._artifactType = config.artifactType; + this._createType = config.createType; + this._description = config.description; + this._id = config.id; + this._isDraft = config.isDraft; + this._name = config.name; + this._projectId = config.projectId; + this._region = config.region; + this._resourcePoolId = config.resourcePoolId; + this._templateId = config.templateId; + this._triggerSource = config.triggerSource; + this._operationList.internalValue = config.operationList; + } + + // ========== + // ATTRIBUTES + // ========== + + // artifact_source_system - computed: false, optional: true, required: false + private _artifactSourceSystem?: string; + public get artifactSourceSystem() { + return this.getStringAttribute('artifact_source_system'); + } + public set artifactSourceSystem(value: string) { + this._artifactSourceSystem = value; + } + public resetArtifactSourceSystem() { + this._artifactSourceSystem = undefined; + } + // Temporarily expose input value. Use with caution. + public get artifactSourceSystemInput() { + return this._artifactSourceSystem; + } + + // artifact_type - computed: false, optional: true, required: false + private _artifactType?: string; + public get artifactType() { + return this.getStringAttribute('artifact_type'); + } + public set artifactType(value: string) { + this._artifactType = value; + } + public resetArtifactType() { + this._artifactType = undefined; + } + // Temporarily expose input value. Use with caution. + public get artifactTypeInput() { + return this._artifactType; + } + + // can_copy - computed: true, optional: false, required: false + public get canCopy() { + return this.getBooleanAttribute('can_copy'); + } + + // can_create_env - computed: true, optional: false, required: false + public get canCreateEnv() { + return this.getBooleanAttribute('can_create_env'); + } + + // can_delete - computed: true, optional: false, required: false + public get canDelete() { + return this.getBooleanAttribute('can_delete'); + } + + // can_execute - computed: true, optional: false, required: false + public get canExecute() { + return this.getBooleanAttribute('can_execute'); + } + + // can_manage - computed: true, optional: false, required: false + public get canManage() { + return this.getBooleanAttribute('can_manage'); + } + + // can_modify - computed: true, optional: false, required: false + public get canModify() { + return this.getBooleanAttribute('can_modify'); + } + + // can_view - computed: true, optional: false, required: false + public get canView() { + return this.getBooleanAttribute('can_view'); + } + + // create_type - computed: false, optional: false, required: true + private _createType?: string; + public get createType() { + return this.getStringAttribute('create_type'); + } + public set createType(value: string) { + this._createType = value; + } + // Temporarily expose input value. Use with caution. + public get createTypeInput() { + return this._createType; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_draft - computed: false, optional: false, required: true + private _isDraft?: boolean | cdktf.IResolvable; + public get isDraft() { + return this.getBooleanAttribute('is_draft'); + } + public set isDraft(value: boolean | cdktf.IResolvable) { + this._isDraft = value; + } + // Temporarily expose input value. Use with caution. + public get isDraftInput() { + return this._isDraft; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // project_name - computed: true, optional: false, required: false + public get projectName() { + return this.getStringAttribute('project_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_pool_id - computed: true, optional: true, required: false + private _resourcePoolId?: string; + public get resourcePoolId() { + return this.getStringAttribute('resource_pool_id'); + } + public set resourcePoolId(value: string) { + this._resourcePoolId = value; + } + public resetResourcePoolId() { + this._resourcePoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcePoolIdInput() { + return this._resourcePoolId; + } + + // steps - computed: true, optional: false, required: false + private _steps = new cdktf.StringMap(this, "steps"); + public get steps() { + return this._steps; + } + + // task_id - computed: true, optional: false, required: false + public get taskId() { + return this.getStringAttribute('task_id'); + } + + // task_name - computed: true, optional: false, required: false + public get taskName() { + return this.getStringAttribute('task_name'); + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // trigger_source - computed: false, optional: false, required: true + private _triggerSource?: string; + public get triggerSource() { + return this.getStringAttribute('trigger_source'); + } + public set triggerSource(value: string) { + this._triggerSource = value; + } + // Temporarily expose input value. Use with caution. + public get triggerSourceInput() { + return this._triggerSource; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // operation_list - computed: false, optional: true, required: false + private _operationList = new CodeartsDeployApplicationOperationListStructList(this, "operation_list", false); + public get operationList() { + return this._operationList; + } + public putOperationList(value: CodeartsDeployApplicationOperationListStruct[] | cdktf.IResolvable) { + this._operationList.internalValue = value; + } + public resetOperationList() { + this._operationList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationListInput() { + return this._operationList.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + artifact_source_system: cdktf.stringToTerraform(this._artifactSourceSystem), + artifact_type: cdktf.stringToTerraform(this._artifactType), + create_type: cdktf.stringToTerraform(this._createType), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + is_draft: cdktf.booleanToTerraform(this._isDraft), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + resource_pool_id: cdktf.stringToTerraform(this._resourcePoolId), + template_id: cdktf.stringToTerraform(this._templateId), + trigger_source: cdktf.stringToTerraform(this._triggerSource), + operation_list: cdktf.listMapper(codeartsDeployApplicationOperationListStructToTerraform, true)(this._operationList.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + artifact_source_system: { + value: cdktf.stringToHclTerraform(this._artifactSourceSystem), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + artifact_type: { + value: cdktf.stringToHclTerraform(this._artifactType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + create_type: { + value: cdktf.stringToHclTerraform(this._createType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_draft: { + value: cdktf.booleanToHclTerraform(this._isDraft), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_pool_id: { + value: cdktf.stringToHclTerraform(this._resourcePoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_source: { + value: cdktf.stringToHclTerraform(this._triggerSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation_list: { + value: cdktf.listMapperHcl(codeartsDeployApplicationOperationListStructToHclTerraform, true)(this._operationList.internalValue), + isBlock: true, + type: "list", + storageClassType: "CodeartsDeployApplicationOperationListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-deploy-group/README.md b/src/constructs/providers/huaweicloud/codearts-deploy-group/README.md new file mode 100644 index 00000000..82e27dc6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-deploy-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_deploy_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_deploy_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group). diff --git a/src/constructs/providers/huaweicloud/codearts-deploy-group/index.ts b/src/constructs/providers/huaweicloud/codearts-deploy-group/index.ts new file mode 100644 index 00000000..5267a8b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-deploy-group/index.ts @@ -0,0 +1,512 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsDeployGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#description CodeartsDeployGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#id CodeartsDeployGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the host is in agent access mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#is_proxy_mode CodeartsDeployGroup#is_proxy_mode} + */ + readonly isProxyMode?: number; + /** + * Specifies the group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#name CodeartsDeployGroup#name} + */ + readonly name: string; + /** + * Specifies the operating system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#os_type CodeartsDeployGroup#os_type} + */ + readonly osType: string; + /** + * Specifies the project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#project_id CodeartsDeployGroup#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#region CodeartsDeployGroup#region} + */ + readonly region?: string; + /** + * Specifies the resource pool ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#resource_pool_id CodeartsDeployGroup#resource_pool_id} + */ + readonly resourcePoolId?: string; +} +export interface CodeartsDeployGroupCreatedBy { +} + +export function codeartsDeployGroupCreatedByToTerraform(struct?: CodeartsDeployGroupCreatedBy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function codeartsDeployGroupCreatedByToHclTerraform(struct?: CodeartsDeployGroupCreatedBy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CodeartsDeployGroupCreatedByOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CodeartsDeployGroupCreatedBy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CodeartsDeployGroupCreatedBy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class CodeartsDeployGroupCreatedByList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CodeartsDeployGroupCreatedByOutputReference { + return new CodeartsDeployGroupCreatedByOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CodeartsDeployGroupPermission { +} + +export function codeartsDeployGroupPermissionToTerraform(struct?: CodeartsDeployGroupPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function codeartsDeployGroupPermissionToHclTerraform(struct?: CodeartsDeployGroupPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CodeartsDeployGroupPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CodeartsDeployGroupPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CodeartsDeployGroupPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // can_add_host - computed: true, optional: false, required: false + public get canAddHost() { + return this.getBooleanAttribute('can_add_host'); + } + + // can_delete - computed: true, optional: false, required: false + public get canDelete() { + return this.getBooleanAttribute('can_delete'); + } + + // can_edit - computed: true, optional: false, required: false + public get canEdit() { + return this.getBooleanAttribute('can_edit'); + } + + // can_manage - computed: true, optional: false, required: false + public get canManage() { + return this.getBooleanAttribute('can_manage'); + } + + // can_view - computed: true, optional: false, required: false + public get canView() { + return this.getBooleanAttribute('can_view'); + } +} + +export class CodeartsDeployGroupPermissionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CodeartsDeployGroupPermissionOutputReference { + return new CodeartsDeployGroupPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group huaweicloud_codearts_deploy_group} +*/ +export class CodeartsDeployGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_deploy_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsDeployGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsDeployGroup to import + * @param importFromId The id of the existing CodeartsDeployGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsDeployGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_deploy_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_group huaweicloud_codearts_deploy_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsDeployGroupConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsDeployGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_deploy_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._isProxyMode = config.isProxyMode; + this._name = config.name; + this._osType = config.osType; + this._projectId = config.projectId; + this._region = config.region; + this._resourcePoolId = config.resourcePoolId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + private _createdBy = new CodeartsDeployGroupCreatedByList(this, "created_by", false); + public get createdBy() { + return this._createdBy; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_proxy_mode - computed: false, optional: true, required: false + private _isProxyMode?: number; + public get isProxyMode() { + return this.getNumberAttribute('is_proxy_mode'); + } + public set isProxyMode(value: number) { + this._isProxyMode = value; + } + public resetIsProxyMode() { + this._isProxyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get isProxyModeInput() { + return this._isProxyMode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: false, required: true + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // permission - computed: true, optional: false, required: false + private _permission = new CodeartsDeployGroupPermissionList(this, "permission", false); + public get permission() { + return this._permission; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_pool_id - computed: false, optional: true, required: false + private _resourcePoolId?: string; + public get resourcePoolId() { + return this.getStringAttribute('resource_pool_id'); + } + public set resourcePoolId(value: string) { + this._resourcePoolId = value; + } + public resetResourcePoolId() { + this._resourcePoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcePoolIdInput() { + return this._resourcePoolId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + is_proxy_mode: cdktf.numberToTerraform(this._isProxyMode), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + resource_pool_id: cdktf.stringToTerraform(this._resourcePoolId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_proxy_mode: { + value: cdktf.numberToHclTerraform(this._isProxyMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_pool_id: { + value: cdktf.stringToHclTerraform(this._resourcePoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-deploy-host/README.md b/src/constructs/providers/huaweicloud/codearts-deploy-host/README.md new file mode 100644 index 00000000..a61dcee7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-deploy-host/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_deploy_host` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_deploy_host`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host). diff --git a/src/constructs/providers/huaweicloud/codearts-deploy-host/index.ts b/src/constructs/providers/huaweicloud/codearts-deploy-host/index.ts new file mode 100644 index 00000000..1f718e96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-deploy-host/index.ts @@ -0,0 +1,609 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsDeployHostConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether the host is an agent host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#as_proxy CodeartsDeployHost#as_proxy} + */ + readonly asProxy?: boolean | cdktf.IResolvable; + /** + * Specifies the CodeArts deploy group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#group_id CodeartsDeployHost#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#id CodeartsDeployHost#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether to enable Application Operations Management (AOM) for free to provide + * metric monitoring, log query and alarm functions. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#install_icagent CodeartsDeployHost#install_icagent} + */ + readonly installIcagent?: boolean | cdktf.IResolvable; + /** + * Specifies the IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#ip_address CodeartsDeployHost#ip_address} + */ + readonly ipAddress: string; + /** + * Specifies the host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#name CodeartsDeployHost#name} + */ + readonly name: string; + /** + * Specifies the operating system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#os_type CodeartsDeployHost#os_type} + */ + readonly osType: string; + /** + * Specifies the password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#password CodeartsDeployHost#password} + */ + readonly password?: string; + /** + * Specifies the SSH port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#port CodeartsDeployHost#port} + */ + readonly port: number; + /** + * Specifies the private key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#private_key CodeartsDeployHost#private_key} + */ + readonly privateKey?: string; + /** + * Specifies the agent ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#proxy_host_id CodeartsDeployHost#proxy_host_id} + */ + readonly proxyHostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#region CodeartsDeployHost#region} + */ + readonly region?: string; + /** + * Specifies whether to synchronize the password of the current host to the hosts with the + * same IP address, username and port number in other group in the same project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#sync CodeartsDeployHost#sync} + */ + readonly sync?: boolean | cdktf.IResolvable; + /** + * Specifies the username. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#username CodeartsDeployHost#username} + */ + readonly username: string; +} +export interface CodeartsDeployHostPermission { +} + +export function codeartsDeployHostPermissionToTerraform(struct?: CodeartsDeployHostPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function codeartsDeployHostPermissionToHclTerraform(struct?: CodeartsDeployHostPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CodeartsDeployHostPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CodeartsDeployHostPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CodeartsDeployHostPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // can_add_host - computed: true, optional: false, required: false + public get canAddHost() { + return this.getBooleanAttribute('can_add_host'); + } + + // can_copy - computed: true, optional: false, required: false + public get canCopy() { + return this.getBooleanAttribute('can_copy'); + } + + // can_delete - computed: true, optional: false, required: false + public get canDelete() { + return this.getBooleanAttribute('can_delete'); + } + + // can_edit - computed: true, optional: false, required: false + public get canEdit() { + return this.getBooleanAttribute('can_edit'); + } + + // can_view - computed: true, optional: false, required: false + public get canView() { + return this.getBooleanAttribute('can_view'); + } +} + +export class CodeartsDeployHostPermissionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CodeartsDeployHostPermissionOutputReference { + return new CodeartsDeployHostPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host huaweicloud_codearts_deploy_host} +*/ +export class CodeartsDeployHost extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_deploy_host"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsDeployHost resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsDeployHost to import + * @param importFromId The id of the existing CodeartsDeployHost that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsDeployHost to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_deploy_host", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_deploy_host huaweicloud_codearts_deploy_host} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsDeployHostConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsDeployHostConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_deploy_host', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._asProxy = config.asProxy; + this._groupId = config.groupId; + this._id = config.id; + this._installIcagent = config.installIcagent; + this._ipAddress = config.ipAddress; + this._name = config.name; + this._osType = config.osType; + this._password = config.password; + this._port = config.port; + this._privateKey = config.privateKey; + this._proxyHostId = config.proxyHostId; + this._region = config.region; + this._sync = config.sync; + this._username = config.username; + } + + // ========== + // ATTRIBUTES + // ========== + + // as_proxy - computed: true, optional: true, required: false + private _asProxy?: boolean | cdktf.IResolvable; + public get asProxy() { + return this.getBooleanAttribute('as_proxy'); + } + public set asProxy(value: boolean | cdktf.IResolvable) { + this._asProxy = value; + } + public resetAsProxy() { + this._asProxy = undefined; + } + // Temporarily expose input value. Use with caution. + public get asProxyInput() { + return this._asProxy; + } + + // connection_status - computed: true, optional: false, required: false + public get connectionStatus() { + return this.getStringAttribute('connection_status'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // install_icagent - computed: false, optional: true, required: false + private _installIcagent?: boolean | cdktf.IResolvable; + public get installIcagent() { + return this.getBooleanAttribute('install_icagent'); + } + public set installIcagent(value: boolean | cdktf.IResolvable) { + this._installIcagent = value; + } + public resetInstallIcagent() { + this._installIcagent = undefined; + } + // Temporarily expose input value. Use with caution. + public get installIcagentInput() { + return this._installIcagent; + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // lastest_connection_at - computed: true, optional: false, required: false + public get lastestConnectionAt() { + return this.getStringAttribute('lastest_connection_at'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: false, required: true + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // permission - computed: true, optional: false, required: false + private _permission = new CodeartsDeployHostPermissionList(this, "permission", false); + public get permission() { + return this._permission; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // proxy_host_id - computed: true, optional: true, required: false + private _proxyHostId?: string; + public get proxyHostId() { + return this.getStringAttribute('proxy_host_id'); + } + public set proxyHostId(value: string) { + this._proxyHostId = value; + } + public resetProxyHostId() { + this._proxyHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyHostIdInput() { + return this._proxyHostId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sync - computed: false, optional: true, required: false + private _sync?: boolean | cdktf.IResolvable; + public get sync() { + return this.getBooleanAttribute('sync'); + } + public set sync(value: boolean | cdktf.IResolvable) { + this._sync = value; + } + public resetSync() { + this._sync = undefined; + } + // Temporarily expose input value. Use with caution. + public get syncInput() { + return this._sync; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // username - computed: false, optional: false, required: true + private _username?: string; + public get username() { + return this.getStringAttribute('username'); + } + public set username(value: string) { + this._username = value; + } + // Temporarily expose input value. Use with caution. + public get usernameInput() { + return this._username; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + as_proxy: cdktf.booleanToTerraform(this._asProxy), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + install_icagent: cdktf.booleanToTerraform(this._installIcagent), + ip_address: cdktf.stringToTerraform(this._ipAddress), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + password: cdktf.stringToTerraform(this._password), + port: cdktf.numberToTerraform(this._port), + private_key: cdktf.stringToTerraform(this._privateKey), + proxy_host_id: cdktf.stringToTerraform(this._proxyHostId), + region: cdktf.stringToTerraform(this._region), + sync: cdktf.booleanToTerraform(this._sync), + username: cdktf.stringToTerraform(this._username), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + as_proxy: { + value: cdktf.booleanToHclTerraform(this._asProxy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + install_icagent: { + value: cdktf.booleanToHclTerraform(this._installIcagent), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_host_id: { + value: cdktf.stringToHclTerraform(this._proxyHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sync: { + value: cdktf.booleanToHclTerraform(this._sync), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + username: { + value: cdktf.stringToHclTerraform(this._username), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-inspector-website-scan/README.md b/src/constructs/providers/huaweicloud/codearts-inspector-website-scan/README.md new file mode 100644 index 00000000..2107daa0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-inspector-website-scan/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_inspector_website_scan` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_inspector_website_scan`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan). diff --git a/src/constructs/providers/huaweicloud/codearts-inspector-website-scan/index.ts b/src/constructs/providers/huaweicloud/codearts-inspector-website-scan/index.ts new file mode 100644 index 00000000..5b628458 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-inspector-website-scan/index.ts @@ -0,0 +1,590 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsInspectorWebsiteScanConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to perform CVE vulnerability scanning. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#cve_check CodeartsInspectorWebsiteScan#cve_check} + */ + readonly cveCheck?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#id CodeartsInspectorWebsiteScan#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether to perform malicious code scanning. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#malicious_code CodeartsInspectorWebsiteScan#malicious_code} + */ + readonly maliciousCode?: boolean | cdktf.IResolvable; + /** + * Specifies whether to perform link health detection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#malicious_link CodeartsInspectorWebsiteScan#malicious_link} + */ + readonly maliciousLink?: boolean | cdktf.IResolvable; + /** + * Specifies whether to conduct website content compliance image detection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#picture_check CodeartsInspectorWebsiteScan#picture_check} + */ + readonly pictureCheck?: boolean | cdktf.IResolvable; + /** + * Specifies whether to perform port scanning. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#port_scan CodeartsInspectorWebsiteScan#port_scan} + */ + readonly portScan?: boolean | cdktf.IResolvable; + /** + * Specifies the task scan mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#scan_mode CodeartsInspectorWebsiteScan#scan_mode} + */ + readonly scanMode?: string; + /** + * Specifies the task name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#task_name CodeartsInspectorWebsiteScan#task_name} + */ + readonly taskName: string; + /** + * Specifies the scheduled trigger period of the monitor task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#task_period CodeartsInspectorWebsiteScan#task_period} + */ + readonly taskPeriod?: string; + /** + * Specifies the task type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#task_type CodeartsInspectorWebsiteScan#task_type} + */ + readonly taskType?: string; + /** + * Specifies whether to conduct website content compliance text detection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#text_check CodeartsInspectorWebsiteScan#text_check} + */ + readonly textCheck?: boolean | cdktf.IResolvable; + /** + * Specifies the scheduled trigger time of the normal task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#timer CodeartsInspectorWebsiteScan#timer} + */ + readonly timer?: string; + /** + * Specifies the scheduled trigger time of the monitor task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#trigger_time CodeartsInspectorWebsiteScan#trigger_time} + */ + readonly triggerTime?: string; + /** + * Specifies the URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#url CodeartsInspectorWebsiteScan#url} + */ + readonly url: string; + /** + * Specifies whether to scan for weak passwords. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#weak_pwd_scan CodeartsInspectorWebsiteScan#weak_pwd_scan} + */ + readonly weakPwdScan?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan huaweicloud_codearts_inspector_website_scan} +*/ +export class CodeartsInspectorWebsiteScan extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_inspector_website_scan"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsInspectorWebsiteScan resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsInspectorWebsiteScan to import + * @param importFromId The id of the existing CodeartsInspectorWebsiteScan that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsInspectorWebsiteScan to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_inspector_website_scan", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website_scan huaweicloud_codearts_inspector_website_scan} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsInspectorWebsiteScanConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsInspectorWebsiteScanConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_inspector_website_scan', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cveCheck = config.cveCheck; + this._id = config.id; + this._maliciousCode = config.maliciousCode; + this._maliciousLink = config.maliciousLink; + this._pictureCheck = config.pictureCheck; + this._portScan = config.portScan; + this._scanMode = config.scanMode; + this._taskName = config.taskName; + this._taskPeriod = config.taskPeriod; + this._taskType = config.taskType; + this._textCheck = config.textCheck; + this._timer = config.timer; + this._triggerTime = config.triggerTime; + this._url = config.url; + this._weakPwdScan = config.weakPwdScan; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // cve_check - computed: true, optional: true, required: false + private _cveCheck?: boolean | cdktf.IResolvable; + public get cveCheck() { + return this.getBooleanAttribute('cve_check'); + } + public set cveCheck(value: boolean | cdktf.IResolvable) { + this._cveCheck = value; + } + public resetCveCheck() { + this._cveCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get cveCheckInput() { + return this._cveCheck; + } + + // high - computed: true, optional: false, required: false + public get high() { + return this.getNumberAttribute('high'); + } + + // hint - computed: true, optional: false, required: false + public get hint() { + return this.getNumberAttribute('hint'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // low - computed: true, optional: false, required: false + public get low() { + return this.getNumberAttribute('low'); + } + + // malicious_code - computed: true, optional: true, required: false + private _maliciousCode?: boolean | cdktf.IResolvable; + public get maliciousCode() { + return this.getBooleanAttribute('malicious_code'); + } + public set maliciousCode(value: boolean | cdktf.IResolvable) { + this._maliciousCode = value; + } + public resetMaliciousCode() { + this._maliciousCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get maliciousCodeInput() { + return this._maliciousCode; + } + + // malicious_link - computed: true, optional: true, required: false + private _maliciousLink?: boolean | cdktf.IResolvable; + public get maliciousLink() { + return this.getBooleanAttribute('malicious_link'); + } + public set maliciousLink(value: boolean | cdktf.IResolvable) { + this._maliciousLink = value; + } + public resetMaliciousLink() { + this._maliciousLink = undefined; + } + // Temporarily expose input value. Use with caution. + public get maliciousLinkInput() { + return this._maliciousLink; + } + + // middle - computed: true, optional: false, required: false + public get middle() { + return this.getNumberAttribute('middle'); + } + + // pack_num - computed: true, optional: false, required: false + public get packNum() { + return this.getNumberAttribute('pack_num'); + } + + // picture_check - computed: true, optional: true, required: false + private _pictureCheck?: boolean | cdktf.IResolvable; + public get pictureCheck() { + return this.getBooleanAttribute('picture_check'); + } + public set pictureCheck(value: boolean | cdktf.IResolvable) { + this._pictureCheck = value; + } + public resetPictureCheck() { + this._pictureCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get pictureCheckInput() { + return this._pictureCheck; + } + + // port_scan - computed: true, optional: true, required: false + private _portScan?: boolean | cdktf.IResolvable; + public get portScan() { + return this.getBooleanAttribute('port_scan'); + } + public set portScan(value: boolean | cdktf.IResolvable) { + this._portScan = value; + } + public resetPortScan() { + this._portScan = undefined; + } + // Temporarily expose input value. Use with caution. + public get portScanInput() { + return this._portScan; + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getNumberAttribute('progress'); + } + + // reason - computed: true, optional: false, required: false + public get reason() { + return this.getStringAttribute('reason'); + } + + // safe_level - computed: true, optional: false, required: false + public get safeLevel() { + return this.getStringAttribute('safe_level'); + } + + // scan_mode - computed: true, optional: true, required: false + private _scanMode?: string; + public get scanMode() { + return this.getStringAttribute('scan_mode'); + } + public set scanMode(value: string) { + this._scanMode = value; + } + public resetScanMode() { + this._scanMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get scanModeInput() { + return this._scanMode; + } + + // schedule_status - computed: true, optional: false, required: false + public get scheduleStatus() { + return this.getStringAttribute('schedule_status'); + } + + // score - computed: true, optional: false, required: false + public get score() { + return this.getNumberAttribute('score'); + } + + // task_name - computed: false, optional: false, required: true + private _taskName?: string; + public get taskName() { + return this.getStringAttribute('task_name'); + } + public set taskName(value: string) { + this._taskName = value; + } + // Temporarily expose input value. Use with caution. + public get taskNameInput() { + return this._taskName; + } + + // task_period - computed: true, optional: true, required: false + private _taskPeriod?: string; + public get taskPeriod() { + return this.getStringAttribute('task_period'); + } + public set taskPeriod(value: string) { + this._taskPeriod = value; + } + public resetTaskPeriod() { + this._taskPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskPeriodInput() { + return this._taskPeriod; + } + + // task_status - computed: true, optional: false, required: false + public get taskStatus() { + return this.getStringAttribute('task_status'); + } + + // task_type - computed: true, optional: true, required: false + private _taskType?: string; + public get taskType() { + return this.getStringAttribute('task_type'); + } + public set taskType(value: string) { + this._taskType = value; + } + public resetTaskType() { + this._taskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskTypeInput() { + return this._taskType; + } + + // text_check - computed: true, optional: true, required: false + private _textCheck?: boolean | cdktf.IResolvable; + public get textCheck() { + return this.getBooleanAttribute('text_check'); + } + public set textCheck(value: boolean | cdktf.IResolvable) { + this._textCheck = value; + } + public resetTextCheck() { + this._textCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get textCheckInput() { + return this._textCheck; + } + + // timer - computed: true, optional: true, required: false + private _timer?: string; + public get timer() { + return this.getStringAttribute('timer'); + } + public set timer(value: string) { + this._timer = value; + } + public resetTimer() { + this._timer = undefined; + } + // Temporarily expose input value. Use with caution. + public get timerInput() { + return this._timer; + } + + // trigger_time - computed: true, optional: true, required: false + private _triggerTime?: string; + public get triggerTime() { + return this.getStringAttribute('trigger_time'); + } + public set triggerTime(value: string) { + this._triggerTime = value; + } + public resetTriggerTime() { + this._triggerTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTimeInput() { + return this._triggerTime; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // weak_pwd_scan - computed: true, optional: true, required: false + private _weakPwdScan?: boolean | cdktf.IResolvable; + public get weakPwdScan() { + return this.getBooleanAttribute('weak_pwd_scan'); + } + public set weakPwdScan(value: boolean | cdktf.IResolvable) { + this._weakPwdScan = value; + } + public resetWeakPwdScan() { + this._weakPwdScan = undefined; + } + // Temporarily expose input value. Use with caution. + public get weakPwdScanInput() { + return this._weakPwdScan; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cve_check: cdktf.booleanToTerraform(this._cveCheck), + id: cdktf.stringToTerraform(this._id), + malicious_code: cdktf.booleanToTerraform(this._maliciousCode), + malicious_link: cdktf.booleanToTerraform(this._maliciousLink), + picture_check: cdktf.booleanToTerraform(this._pictureCheck), + port_scan: cdktf.booleanToTerraform(this._portScan), + scan_mode: cdktf.stringToTerraform(this._scanMode), + task_name: cdktf.stringToTerraform(this._taskName), + task_period: cdktf.stringToTerraform(this._taskPeriod), + task_type: cdktf.stringToTerraform(this._taskType), + text_check: cdktf.booleanToTerraform(this._textCheck), + timer: cdktf.stringToTerraform(this._timer), + trigger_time: cdktf.stringToTerraform(this._triggerTime), + url: cdktf.stringToTerraform(this._url), + weak_pwd_scan: cdktf.booleanToTerraform(this._weakPwdScan), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cve_check: { + value: cdktf.booleanToHclTerraform(this._cveCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + malicious_code: { + value: cdktf.booleanToHclTerraform(this._maliciousCode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + malicious_link: { + value: cdktf.booleanToHclTerraform(this._maliciousLink), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + picture_check: { + value: cdktf.booleanToHclTerraform(this._pictureCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + port_scan: { + value: cdktf.booleanToHclTerraform(this._portScan), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + scan_mode: { + value: cdktf.stringToHclTerraform(this._scanMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_name: { + value: cdktf.stringToHclTerraform(this._taskName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_period: { + value: cdktf.stringToHclTerraform(this._taskPeriod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_type: { + value: cdktf.stringToHclTerraform(this._taskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + text_check: { + value: cdktf.booleanToHclTerraform(this._textCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timer: { + value: cdktf.stringToHclTerraform(this._timer), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_time: { + value: cdktf.stringToHclTerraform(this._triggerTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(this._url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weak_pwd_scan: { + value: cdktf.booleanToHclTerraform(this._weakPwdScan), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-inspector-website/README.md b/src/constructs/providers/huaweicloud/codearts-inspector-website/README.md new file mode 100644 index 00000000..bbfb09d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-inspector-website/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_inspector_website` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_inspector_website`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website). diff --git a/src/constructs/providers/huaweicloud/codearts-inspector-website/index.ts b/src/constructs/providers/huaweicloud/codearts-inspector-website/index.ts new file mode 100644 index 00000000..ec712818 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-inspector-website/index.ts @@ -0,0 +1,407 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsInspectorWebsiteConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the authentication type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#auth_type CodeartsInspectorWebsite#auth_type} + */ + readonly authType: string; + /** + * Specifies the HTTP headers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#http_headers CodeartsInspectorWebsite#http_headers} + */ + readonly httpHeaders?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#id CodeartsInspectorWebsite#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the login cookies. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#login_cookie CodeartsInspectorWebsite#login_cookie} + */ + readonly loginCookie?: string; + /** + * Specifies the login password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#login_password CodeartsInspectorWebsite#login_password} + */ + readonly loginPassword?: string; + /** + * Specifies the login URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#login_url CodeartsInspectorWebsite#login_url} + */ + readonly loginUrl?: string; + /** + * Specifies the login username. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#login_username CodeartsInspectorWebsite#login_username} + */ + readonly loginUsername?: string; + /** + * Specifies the verify URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#verify_url CodeartsInspectorWebsite#verify_url} + */ + readonly verifyUrl?: string; + /** + * Specifies the website address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#website_address CodeartsInspectorWebsite#website_address} + */ + readonly websiteAddress: string; + /** + * Specifies the website name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#website_name CodeartsInspectorWebsite#website_name} + */ + readonly websiteName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website huaweicloud_codearts_inspector_website} +*/ +export class CodeartsInspectorWebsite extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_inspector_website"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsInspectorWebsite resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsInspectorWebsite to import + * @param importFromId The id of the existing CodeartsInspectorWebsite that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsInspectorWebsite to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_inspector_website", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_inspector_website huaweicloud_codearts_inspector_website} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsInspectorWebsiteConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsInspectorWebsiteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_inspector_website', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authType = config.authType; + this._httpHeaders = config.httpHeaders; + this._id = config.id; + this._loginCookie = config.loginCookie; + this._loginPassword = config.loginPassword; + this._loginUrl = config.loginUrl; + this._loginUsername = config.loginUsername; + this._verifyUrl = config.verifyUrl; + this._websiteAddress = config.websiteAddress; + this._websiteName = config.websiteName; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_status - computed: true, optional: false, required: false + public get authStatus() { + return this.getStringAttribute('auth_status'); + } + + // auth_type - computed: false, optional: false, required: true + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // high - computed: true, optional: false, required: false + public get high() { + return this.getNumberAttribute('high'); + } + + // hint - computed: true, optional: false, required: false + public get hint() { + return this.getNumberAttribute('hint'); + } + + // http_headers - computed: false, optional: true, required: false + private _httpHeaders?: { [key: string]: string }; + public get httpHeaders() { + return this.getStringMapAttribute('http_headers'); + } + public set httpHeaders(value: { [key: string]: string }) { + this._httpHeaders = value; + } + public resetHttpHeaders() { + this._httpHeaders = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpHeadersInput() { + return this._httpHeaders; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // login_cookie - computed: false, optional: true, required: false + private _loginCookie?: string; + public get loginCookie() { + return this.getStringAttribute('login_cookie'); + } + public set loginCookie(value: string) { + this._loginCookie = value; + } + public resetLoginCookie() { + this._loginCookie = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginCookieInput() { + return this._loginCookie; + } + + // login_password - computed: false, optional: true, required: false + private _loginPassword?: string; + public get loginPassword() { + return this.getStringAttribute('login_password'); + } + public set loginPassword(value: string) { + this._loginPassword = value; + } + public resetLoginPassword() { + this._loginPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginPasswordInput() { + return this._loginPassword; + } + + // login_url - computed: false, optional: true, required: false + private _loginUrl?: string; + public get loginUrl() { + return this.getStringAttribute('login_url'); + } + public set loginUrl(value: string) { + this._loginUrl = value; + } + public resetLoginUrl() { + this._loginUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginUrlInput() { + return this._loginUrl; + } + + // login_username - computed: false, optional: true, required: false + private _loginUsername?: string; + public get loginUsername() { + return this.getStringAttribute('login_username'); + } + public set loginUsername(value: string) { + this._loginUsername = value; + } + public resetLoginUsername() { + this._loginUsername = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginUsernameInput() { + return this._loginUsername; + } + + // low - computed: true, optional: false, required: false + public get low() { + return this.getNumberAttribute('low'); + } + + // middle - computed: true, optional: false, required: false + public get middle() { + return this.getNumberAttribute('middle'); + } + + // verify_url - computed: false, optional: true, required: false + private _verifyUrl?: string; + public get verifyUrl() { + return this.getStringAttribute('verify_url'); + } + public set verifyUrl(value: string) { + this._verifyUrl = value; + } + public resetVerifyUrl() { + this._verifyUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get verifyUrlInput() { + return this._verifyUrl; + } + + // website_address - computed: false, optional: false, required: true + private _websiteAddress?: string; + public get websiteAddress() { + return this.getStringAttribute('website_address'); + } + public set websiteAddress(value: string) { + this._websiteAddress = value; + } + // Temporarily expose input value. Use with caution. + public get websiteAddressInput() { + return this._websiteAddress; + } + + // website_name - computed: false, optional: false, required: true + private _websiteName?: string; + public get websiteName() { + return this.getStringAttribute('website_name'); + } + public set websiteName(value: string) { + this._websiteName = value; + } + // Temporarily expose input value. Use with caution. + public get websiteNameInput() { + return this._websiteName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_type: cdktf.stringToTerraform(this._authType), + http_headers: cdktf.hashMapper(cdktf.stringToTerraform)(this._httpHeaders), + id: cdktf.stringToTerraform(this._id), + login_cookie: cdktf.stringToTerraform(this._loginCookie), + login_password: cdktf.stringToTerraform(this._loginPassword), + login_url: cdktf.stringToTerraform(this._loginUrl), + login_username: cdktf.stringToTerraform(this._loginUsername), + verify_url: cdktf.stringToTerraform(this._verifyUrl), + website_address: cdktf.stringToTerraform(this._websiteAddress), + website_name: cdktf.stringToTerraform(this._websiteName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_headers: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._httpHeaders), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + login_cookie: { + value: cdktf.stringToHclTerraform(this._loginCookie), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + login_password: { + value: cdktf.stringToHclTerraform(this._loginPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + login_url: { + value: cdktf.stringToHclTerraform(this._loginUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + login_username: { + value: cdktf.stringToHclTerraform(this._loginUsername), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + verify_url: { + value: cdktf.stringToHclTerraform(this._verifyUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + website_address: { + value: cdktf.stringToHclTerraform(this._websiteAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + website_name: { + value: cdktf.stringToHclTerraform(this._websiteName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-project/README.md b/src/constructs/providers/huaweicloud/codearts-project/README.md new file mode 100644 index 00000000..db542c2a --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-project/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_project` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_project`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project). diff --git a/src/constructs/providers/huaweicloud/codearts-project/index.ts b/src/constructs/providers/huaweicloud/codearts-project/index.ts new file mode 100644 index 00000000..570664c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-project/index.ts @@ -0,0 +1,333 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsProjectConfig extends cdktf.TerraformMetaArguments { + /** + * The description about the project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#description CodeartsProject#description} + */ + readonly description?: string; + /** + * The enterprise project ID of the project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#enterprise_project_id CodeartsProject#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#id CodeartsProject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The project name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#name CodeartsProject#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#region CodeartsProject#region} + */ + readonly region?: string; + /** + * The source of project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#source CodeartsProject#source} + */ + readonly source?: string; + /** + * The template id which used to create project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#template_id CodeartsProject#template_id} + */ + readonly templateId?: number; + /** + * The type of project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#type CodeartsProject#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project huaweicloud_codearts_project} +*/ +export class CodeartsProject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_project"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsProject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsProject to import + * @param importFromId The id of the existing CodeartsProject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsProject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_project", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_project huaweicloud_codearts_project} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsProjectConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsProjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_project', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._source = config.source; + this._templateId = config.templateId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // archive - computed: true, optional: false, required: false + public get archive() { + return this.getNumberAttribute('archive'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_code - computed: true, optional: false, required: false + public get projectCode() { + return this.getStringAttribute('project_code'); + } + + // project_num_id - computed: true, optional: false, required: false + public get projectNumId() { + return this.getNumberAttribute('project_num_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: true, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // template_id - computed: true, optional: true, required: false + private _templateId?: number; + public get templateId() { + return this.getNumberAttribute('template_id'); + } + public set templateId(value: number) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + template_id: cdktf.numberToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.numberToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codearts-repository/README.md b/src/constructs/providers/huaweicloud/codearts-repository/README.md new file mode 100644 index 00000000..d935d073 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-repository/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codearts_repository` + +Refer to the Terraform Registry for docs: [`huaweicloud_codearts_repository`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository). diff --git a/src/constructs/providers/huaweicloud/codearts-repository/index.ts b/src/constructs/providers/huaweicloud/codearts-repository/index.ts new file mode 100644 index 00000000..3705fc22 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codearts-repository/index.ts @@ -0,0 +1,572 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodeartsRepositoryConfig extends cdktf.TerraformMetaArguments { + /** + * The repository description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#description CodeartsRepository#description} + */ + readonly description?: string; + /** + * Whether to generate the README.md file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#enable_readme CodeartsRepository#enable_readme} + */ + readonly enableReadme?: number; + /** + * The program language type for generating .gitignore files. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#gitignore_id CodeartsRepository#gitignore_id} + */ + readonly gitignoreId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#id CodeartsRepository#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to import the project members. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#import_members CodeartsRepository#import_members} + */ + readonly importMembers?: number; + /** + * The HTTPS address of the template repository encrypted using Base64. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#import_url CodeartsRepository#import_url} + */ + readonly importUrl?: string; + /** + * The license ID for public repository. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#license_id CodeartsRepository#license_id} + */ + readonly licenseId?: number; + /** + * The repository name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#name CodeartsRepository#name} + */ + readonly name: string; + /** + * The project ID for CodeHub service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#project_id CodeartsRepository#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#region CodeartsRepository#region} + */ + readonly region?: string; + /** + * The visibility level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#visibility_level CodeartsRepository#visibility_level} + */ + readonly visibilityLevel?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#timeouts CodeartsRepository#timeouts} + */ + readonly timeouts?: CodeartsRepositoryTimeouts; +} +export interface CodeartsRepositoryTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#create CodeartsRepository#create} + */ + readonly create?: string; +} + +export function codeartsRepositoryTimeoutsToTerraform(struct?: CodeartsRepositoryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function codeartsRepositoryTimeoutsToHclTerraform(struct?: CodeartsRepositoryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CodeartsRepositoryTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CodeartsRepositoryTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CodeartsRepositoryTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository huaweicloud_codearts_repository} +*/ +export class CodeartsRepository extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codearts_repository"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodeartsRepository resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodeartsRepository to import + * @param importFromId The id of the existing CodeartsRepository that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodeartsRepository to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codearts_repository", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codearts_repository huaweicloud_codearts_repository} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodeartsRepositoryConfig + */ + public constructor(scope: Construct, id: string, config: CodeartsRepositoryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codearts_repository', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableReadme = config.enableReadme; + this._gitignoreId = config.gitignoreId; + this._id = config.id; + this._importMembers = config.importMembers; + this._importUrl = config.importUrl; + this._licenseId = config.licenseId; + this._name = config.name; + this._projectId = config.projectId; + this._region = config.region; + this._visibilityLevel = config.visibilityLevel; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // capacity - computed: true, optional: false, required: false + public get capacity() { + return this.getStringAttribute('capacity'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_readme - computed: false, optional: true, required: false + private _enableReadme?: number; + public get enableReadme() { + return this.getNumberAttribute('enable_readme'); + } + public set enableReadme(value: number) { + this._enableReadme = value; + } + public resetEnableReadme() { + this._enableReadme = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableReadmeInput() { + return this._enableReadme; + } + + // gitignore_id - computed: true, optional: true, required: false + private _gitignoreId?: string; + public get gitignoreId() { + return this.getStringAttribute('gitignore_id'); + } + public set gitignoreId(value: string) { + this._gitignoreId = value; + } + public resetGitignoreId() { + this._gitignoreId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gitignoreIdInput() { + return this._gitignoreId; + } + + // https_url - computed: true, optional: false, required: false + public get httpsUrl() { + return this.getStringAttribute('https_url'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // import_members - computed: false, optional: true, required: false + private _importMembers?: number; + public get importMembers() { + return this.getNumberAttribute('import_members'); + } + public set importMembers(value: number) { + this._importMembers = value; + } + public resetImportMembers() { + this._importMembers = undefined; + } + // Temporarily expose input value. Use with caution. + public get importMembersInput() { + return this._importMembers; + } + + // import_url - computed: true, optional: true, required: false + private _importUrl?: string; + public get importUrl() { + return this.getStringAttribute('import_url'); + } + public set importUrl(value: string) { + this._importUrl = value; + } + public resetImportUrl() { + this._importUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get importUrlInput() { + return this._importUrl; + } + + // lfs_size - computed: true, optional: false, required: false + public get lfsSize() { + return this.getStringAttribute('lfs_size'); + } + + // license_id - computed: false, optional: true, required: false + private _licenseId?: number; + public get licenseId() { + return this.getNumberAttribute('license_id'); + } + public set licenseId(value: number) { + this._licenseId = value; + } + public resetLicenseId() { + this._licenseId = undefined; + } + // Temporarily expose input value. Use with caution. + public get licenseIdInput() { + return this._licenseId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ssh_url - computed: true, optional: false, required: false + public get sshUrl() { + return this.getStringAttribute('ssh_url'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } + + // visibility_level - computed: true, optional: true, required: false + private _visibilityLevel?: number; + public get visibilityLevel() { + return this.getNumberAttribute('visibility_level'); + } + public set visibilityLevel(value: number) { + this._visibilityLevel = value; + } + public resetVisibilityLevel() { + this._visibilityLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityLevelInput() { + return this._visibilityLevel; + } + + // web_url - computed: true, optional: false, required: false + public get webUrl() { + return this.getStringAttribute('web_url'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CodeartsRepositoryTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CodeartsRepositoryTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_readme: cdktf.numberToTerraform(this._enableReadme), + gitignore_id: cdktf.stringToTerraform(this._gitignoreId), + id: cdktf.stringToTerraform(this._id), + import_members: cdktf.numberToTerraform(this._importMembers), + import_url: cdktf.stringToTerraform(this._importUrl), + license_id: cdktf.numberToTerraform(this._licenseId), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + visibility_level: cdktf.numberToTerraform(this._visibilityLevel), + timeouts: codeartsRepositoryTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_readme: { + value: cdktf.numberToHclTerraform(this._enableReadme), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + gitignore_id: { + value: cdktf.stringToHclTerraform(this._gitignoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + import_members: { + value: cdktf.numberToHclTerraform(this._importMembers), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + import_url: { + value: cdktf.stringToHclTerraform(this._importUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + license_id: { + value: cdktf.numberToHclTerraform(this._licenseId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility_level: { + value: cdktf.numberToHclTerraform(this._visibilityLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: codeartsRepositoryTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CodeartsRepositoryTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/codehub-repository/README.md b/src/constructs/providers/huaweicloud/codehub-repository/README.md new file mode 100644 index 00000000..a44f337a --- /dev/null +++ b/src/constructs/providers/huaweicloud/codehub-repository/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_codehub_repository` + +Refer to the Terraform Registry for docs: [`huaweicloud_codehub_repository`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository). diff --git a/src/constructs/providers/huaweicloud/codehub-repository/index.ts b/src/constructs/providers/huaweicloud/codehub-repository/index.ts new file mode 100644 index 00000000..a9ade406 --- /dev/null +++ b/src/constructs/providers/huaweicloud/codehub-repository/index.ts @@ -0,0 +1,572 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CodehubRepositoryConfig extends cdktf.TerraformMetaArguments { + /** + * The repository description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#description CodehubRepository#description} + */ + readonly description?: string; + /** + * Whether to generate the README.md file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#enable_readme CodehubRepository#enable_readme} + */ + readonly enableReadme?: number; + /** + * The program language type for generating .gitignore files. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#gitignore_id CodehubRepository#gitignore_id} + */ + readonly gitignoreId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#id CodehubRepository#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to import the project members. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#import_members CodehubRepository#import_members} + */ + readonly importMembers?: number; + /** + * The HTTPS address of the template repository encrypted using Base64. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#import_url CodehubRepository#import_url} + */ + readonly importUrl?: string; + /** + * The license ID for public repository. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#license_id CodehubRepository#license_id} + */ + readonly licenseId?: number; + /** + * The repository name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#name CodehubRepository#name} + */ + readonly name: string; + /** + * The project ID for CodeHub service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#project_id CodehubRepository#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#region CodehubRepository#region} + */ + readonly region?: string; + /** + * The visibility level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#visibility_level CodehubRepository#visibility_level} + */ + readonly visibilityLevel?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#timeouts CodehubRepository#timeouts} + */ + readonly timeouts?: CodehubRepositoryTimeouts; +} +export interface CodehubRepositoryTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#create CodehubRepository#create} + */ + readonly create?: string; +} + +export function codehubRepositoryTimeoutsToTerraform(struct?: CodehubRepositoryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function codehubRepositoryTimeoutsToHclTerraform(struct?: CodehubRepositoryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CodehubRepositoryTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CodehubRepositoryTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CodehubRepositoryTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository huaweicloud_codehub_repository} +*/ +export class CodehubRepository extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_codehub_repository"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CodehubRepository resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CodehubRepository to import + * @param importFromId The id of the existing CodehubRepository that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CodehubRepository to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_codehub_repository", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/codehub_repository huaweicloud_codehub_repository} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CodehubRepositoryConfig + */ + public constructor(scope: Construct, id: string, config: CodehubRepositoryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_codehub_repository', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableReadme = config.enableReadme; + this._gitignoreId = config.gitignoreId; + this._id = config.id; + this._importMembers = config.importMembers; + this._importUrl = config.importUrl; + this._licenseId = config.licenseId; + this._name = config.name; + this._projectId = config.projectId; + this._region = config.region; + this._visibilityLevel = config.visibilityLevel; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // capacity - computed: true, optional: false, required: false + public get capacity() { + return this.getStringAttribute('capacity'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_readme - computed: false, optional: true, required: false + private _enableReadme?: number; + public get enableReadme() { + return this.getNumberAttribute('enable_readme'); + } + public set enableReadme(value: number) { + this._enableReadme = value; + } + public resetEnableReadme() { + this._enableReadme = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableReadmeInput() { + return this._enableReadme; + } + + // gitignore_id - computed: true, optional: true, required: false + private _gitignoreId?: string; + public get gitignoreId() { + return this.getStringAttribute('gitignore_id'); + } + public set gitignoreId(value: string) { + this._gitignoreId = value; + } + public resetGitignoreId() { + this._gitignoreId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gitignoreIdInput() { + return this._gitignoreId; + } + + // https_url - computed: true, optional: false, required: false + public get httpsUrl() { + return this.getStringAttribute('https_url'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // import_members - computed: false, optional: true, required: false + private _importMembers?: number; + public get importMembers() { + return this.getNumberAttribute('import_members'); + } + public set importMembers(value: number) { + this._importMembers = value; + } + public resetImportMembers() { + this._importMembers = undefined; + } + // Temporarily expose input value. Use with caution. + public get importMembersInput() { + return this._importMembers; + } + + // import_url - computed: true, optional: true, required: false + private _importUrl?: string; + public get importUrl() { + return this.getStringAttribute('import_url'); + } + public set importUrl(value: string) { + this._importUrl = value; + } + public resetImportUrl() { + this._importUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get importUrlInput() { + return this._importUrl; + } + + // lfs_size - computed: true, optional: false, required: false + public get lfsSize() { + return this.getStringAttribute('lfs_size'); + } + + // license_id - computed: false, optional: true, required: false + private _licenseId?: number; + public get licenseId() { + return this.getNumberAttribute('license_id'); + } + public set licenseId(value: number) { + this._licenseId = value; + } + public resetLicenseId() { + this._licenseId = undefined; + } + // Temporarily expose input value. Use with caution. + public get licenseIdInput() { + return this._licenseId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ssh_url - computed: true, optional: false, required: false + public get sshUrl() { + return this.getStringAttribute('ssh_url'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } + + // visibility_level - computed: true, optional: true, required: false + private _visibilityLevel?: number; + public get visibilityLevel() { + return this.getNumberAttribute('visibility_level'); + } + public set visibilityLevel(value: number) { + this._visibilityLevel = value; + } + public resetVisibilityLevel() { + this._visibilityLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityLevelInput() { + return this._visibilityLevel; + } + + // web_url - computed: true, optional: false, required: false + public get webUrl() { + return this.getStringAttribute('web_url'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CodehubRepositoryTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CodehubRepositoryTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_readme: cdktf.numberToTerraform(this._enableReadme), + gitignore_id: cdktf.stringToTerraform(this._gitignoreId), + id: cdktf.stringToTerraform(this._id), + import_members: cdktf.numberToTerraform(this._importMembers), + import_url: cdktf.stringToTerraform(this._importUrl), + license_id: cdktf.numberToTerraform(this._licenseId), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + visibility_level: cdktf.numberToTerraform(this._visibilityLevel), + timeouts: codehubRepositoryTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_readme: { + value: cdktf.numberToHclTerraform(this._enableReadme), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + gitignore_id: { + value: cdktf.stringToHclTerraform(this._gitignoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + import_members: { + value: cdktf.numberToHclTerraform(this._importMembers), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + import_url: { + value: cdktf.stringToHclTerraform(this._importUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + license_id: { + value: cdktf.numberToHclTerraform(this._licenseId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility_level: { + value: cdktf.numberToHclTerraform(this._visibilityLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: codehubRepositoryTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CodehubRepositoryTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-auto-launch-group/README.md b/src/constructs/providers/huaweicloud/compute-auto-launch-group/README.md new file mode 100644 index 00000000..ef6768e9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-auto-launch-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_auto_launch_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_auto_launch_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group). diff --git a/src/constructs/providers/huaweicloud/compute-auto-launch-group/index.ts b/src/constructs/providers/huaweicloud/compute-auto-launch-group/index.ts new file mode 100644 index 00000000..22b0a202 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-auto-launch-group/index.ts @@ -0,0 +1,942 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeAutoLaunchGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#allocation_strategy ComputeAutoLaunchGroup#allocation_strategy} + */ + readonly allocationStrategy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#delete_instances ComputeAutoLaunchGroup#delete_instances} + */ + readonly deleteInstances?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#excess_fulfilled_capacity_behavior ComputeAutoLaunchGroup#excess_fulfilled_capacity_behavior} + */ + readonly excessFulfilledCapacityBehavior?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#id ComputeAutoLaunchGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#instances_behavior_with_expiration ComputeAutoLaunchGroup#instances_behavior_with_expiration} + */ + readonly instancesBehaviorWithExpiration?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#launch_template_id ComputeAutoLaunchGroup#launch_template_id} + */ + readonly launchTemplateId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#launch_template_version ComputeAutoLaunchGroup#launch_template_version} + */ + readonly launchTemplateVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#name ComputeAutoLaunchGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#region ComputeAutoLaunchGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#spot_price ComputeAutoLaunchGroup#spot_price} + */ + readonly spotPrice?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#stable_capacity ComputeAutoLaunchGroup#stable_capacity} + */ + readonly stableCapacity?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#supply_option ComputeAutoLaunchGroup#supply_option} + */ + readonly supplyOption?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#target_capacity ComputeAutoLaunchGroup#target_capacity} + */ + readonly targetCapacity: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#type ComputeAutoLaunchGroup#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#valid_since ComputeAutoLaunchGroup#valid_since} + */ + readonly validSince?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#valid_until ComputeAutoLaunchGroup#valid_until} + */ + readonly validUntil?: string; + /** + * overrides block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#overrides ComputeAutoLaunchGroup#overrides} + */ + readonly overrides: ComputeAutoLaunchGroupOverrides[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#timeouts ComputeAutoLaunchGroup#timeouts} + */ + readonly timeouts?: ComputeAutoLaunchGroupTimeouts; +} +export interface ComputeAutoLaunchGroupOverrides { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#availability_zone ComputeAutoLaunchGroup#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#flavor_id ComputeAutoLaunchGroup#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#priority ComputeAutoLaunchGroup#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#spot_price ComputeAutoLaunchGroup#spot_price} + */ + readonly spotPrice?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#weighted_capacity ComputeAutoLaunchGroup#weighted_capacity} + */ + readonly weightedCapacity?: number; +} + +export function computeAutoLaunchGroupOverridesToTerraform(struct?: ComputeAutoLaunchGroupOverrides | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + flavor_id: cdktf.stringToTerraform(struct!.flavorId), + priority: cdktf.numberToTerraform(struct!.priority), + spot_price: cdktf.numberToTerraform(struct!.spotPrice), + weighted_capacity: cdktf.numberToTerraform(struct!.weightedCapacity), + } +} + + +export function computeAutoLaunchGroupOverridesToHclTerraform(struct?: ComputeAutoLaunchGroupOverrides | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(struct!.flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spot_price: { + value: cdktf.numberToHclTerraform(struct!.spotPrice), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + weighted_capacity: { + value: cdktf.numberToHclTerraform(struct!.weightedCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeAutoLaunchGroupOverridesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeAutoLaunchGroupOverrides | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + if (this._flavorId !== undefined) { + hasAnyValues = true; + internalValueResult.flavorId = this._flavorId; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + if (this._spotPrice !== undefined) { + hasAnyValues = true; + internalValueResult.spotPrice = this._spotPrice; + } + if (this._weightedCapacity !== undefined) { + hasAnyValues = true; + internalValueResult.weightedCapacity = this._weightedCapacity; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeAutoLaunchGroupOverrides | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._availabilityZone = undefined; + this._flavorId = undefined; + this._priority = undefined; + this._spotPrice = undefined; + this._weightedCapacity = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._availabilityZone = value.availabilityZone; + this._flavorId = value.flavorId; + this._priority = value.priority; + this._spotPrice = value.spotPrice; + this._weightedCapacity = value.weightedCapacity; + } + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // spot_price - computed: true, optional: true, required: false + private _spotPrice?: number; + public get spotPrice() { + return this.getNumberAttribute('spot_price'); + } + public set spotPrice(value: number) { + this._spotPrice = value; + } + public resetSpotPrice() { + this._spotPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotPriceInput() { + return this._spotPrice; + } + + // weighted_capacity - computed: true, optional: true, required: false + private _weightedCapacity?: number; + public get weightedCapacity() { + return this.getNumberAttribute('weighted_capacity'); + } + public set weightedCapacity(value: number) { + this._weightedCapacity = value; + } + public resetWeightedCapacity() { + this._weightedCapacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightedCapacityInput() { + return this._weightedCapacity; + } +} + +export class ComputeAutoLaunchGroupOverridesList extends cdktf.ComplexList { + public internalValue? : ComputeAutoLaunchGroupOverrides[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeAutoLaunchGroupOverridesOutputReference { + return new ComputeAutoLaunchGroupOverridesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeAutoLaunchGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#delete ComputeAutoLaunchGroup#delete} + */ + readonly delete?: string; +} + +export function computeAutoLaunchGroupTimeoutsToTerraform(struct?: ComputeAutoLaunchGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function computeAutoLaunchGroupTimeoutsToHclTerraform(struct?: ComputeAutoLaunchGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeAutoLaunchGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeAutoLaunchGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeAutoLaunchGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group huaweicloud_compute_auto_launch_group} +*/ +export class ComputeAutoLaunchGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_auto_launch_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeAutoLaunchGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeAutoLaunchGroup to import + * @param importFromId The id of the existing ComputeAutoLaunchGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeAutoLaunchGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_auto_launch_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_auto_launch_group huaweicloud_compute_auto_launch_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeAutoLaunchGroupConfig + */ + public constructor(scope: Construct, id: string, config: ComputeAutoLaunchGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_auto_launch_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allocationStrategy = config.allocationStrategy; + this._deleteInstances = config.deleteInstances; + this._excessFulfilledCapacityBehavior = config.excessFulfilledCapacityBehavior; + this._id = config.id; + this._instancesBehaviorWithExpiration = config.instancesBehaviorWithExpiration; + this._launchTemplateId = config.launchTemplateId; + this._launchTemplateVersion = config.launchTemplateVersion; + this._name = config.name; + this._region = config.region; + this._spotPrice = config.spotPrice; + this._stableCapacity = config.stableCapacity; + this._supplyOption = config.supplyOption; + this._targetCapacity = config.targetCapacity; + this._type = config.type; + this._validSince = config.validSince; + this._validUntil = config.validUntil; + this._overrides.internalValue = config.overrides; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // allocation_strategy - computed: true, optional: true, required: false + private _allocationStrategy?: string; + public get allocationStrategy() { + return this.getStringAttribute('allocation_strategy'); + } + public set allocationStrategy(value: string) { + this._allocationStrategy = value; + } + public resetAllocationStrategy() { + this._allocationStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get allocationStrategyInput() { + return this._allocationStrategy; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_capacity - computed: true, optional: false, required: false + public get currentCapacity() { + return this.getNumberAttribute('current_capacity'); + } + + // current_stable_capacity - computed: true, optional: false, required: false + public get currentStableCapacity() { + return this.getNumberAttribute('current_stable_capacity'); + } + + // delete_instances - computed: false, optional: true, required: false + private _deleteInstances?: string; + public get deleteInstances() { + return this.getStringAttribute('delete_instances'); + } + public set deleteInstances(value: string) { + this._deleteInstances = value; + } + public resetDeleteInstances() { + this._deleteInstances = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInstancesInput() { + return this._deleteInstances; + } + + // excess_fulfilled_capacity_behavior - computed: true, optional: true, required: false + private _excessFulfilledCapacityBehavior?: string; + public get excessFulfilledCapacityBehavior() { + return this.getStringAttribute('excess_fulfilled_capacity_behavior'); + } + public set excessFulfilledCapacityBehavior(value: string) { + this._excessFulfilledCapacityBehavior = value; + } + public resetExcessFulfilledCapacityBehavior() { + this._excessFulfilledCapacityBehavior = undefined; + } + // Temporarily expose input value. Use with caution. + public get excessFulfilledCapacityBehaviorInput() { + return this._excessFulfilledCapacityBehavior; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances_behavior_with_expiration - computed: true, optional: true, required: false + private _instancesBehaviorWithExpiration?: string; + public get instancesBehaviorWithExpiration() { + return this.getStringAttribute('instances_behavior_with_expiration'); + } + public set instancesBehaviorWithExpiration(value: string) { + this._instancesBehaviorWithExpiration = value; + } + public resetInstancesBehaviorWithExpiration() { + this._instancesBehaviorWithExpiration = undefined; + } + // Temporarily expose input value. Use with caution. + public get instancesBehaviorWithExpirationInput() { + return this._instancesBehaviorWithExpiration; + } + + // launch_template_id - computed: false, optional: false, required: true + private _launchTemplateId?: string; + public get launchTemplateId() { + return this.getStringAttribute('launch_template_id'); + } + public set launchTemplateId(value: string) { + this._launchTemplateId = value; + } + // Temporarily expose input value. Use with caution. + public get launchTemplateIdInput() { + return this._launchTemplateId; + } + + // launch_template_version - computed: false, optional: false, required: true + private _launchTemplateVersion?: string; + public get launchTemplateVersion() { + return this.getStringAttribute('launch_template_version'); + } + public set launchTemplateVersion(value: string) { + this._launchTemplateVersion = value; + } + // Temporarily expose input value. Use with caution. + public get launchTemplateVersionInput() { + return this._launchTemplateVersion; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spot_price - computed: true, optional: true, required: false + private _spotPrice?: number; + public get spotPrice() { + return this.getNumberAttribute('spot_price'); + } + public set spotPrice(value: number) { + this._spotPrice = value; + } + public resetSpotPrice() { + this._spotPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotPriceInput() { + return this._spotPrice; + } + + // stable_capacity - computed: true, optional: true, required: false + private _stableCapacity?: number; + public get stableCapacity() { + return this.getNumberAttribute('stable_capacity'); + } + public set stableCapacity(value: number) { + this._stableCapacity = value; + } + public resetStableCapacity() { + this._stableCapacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get stableCapacityInput() { + return this._stableCapacity; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // supply_option - computed: true, optional: true, required: false + private _supplyOption?: string; + public get supplyOption() { + return this.getStringAttribute('supply_option'); + } + public set supplyOption(value: string) { + this._supplyOption = value; + } + public resetSupplyOption() { + this._supplyOption = undefined; + } + // Temporarily expose input value. Use with caution. + public get supplyOptionInput() { + return this._supplyOption; + } + + // target_capacity - computed: false, optional: false, required: true + private _targetCapacity?: number; + public get targetCapacity() { + return this.getNumberAttribute('target_capacity'); + } + public set targetCapacity(value: number) { + this._targetCapacity = value; + } + // Temporarily expose input value. Use with caution. + public get targetCapacityInput() { + return this._targetCapacity; + } + + // task_state - computed: true, optional: false, required: false + public get taskState() { + return this.getStringAttribute('task_state'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // valid_since - computed: true, optional: true, required: false + private _validSince?: string; + public get validSince() { + return this.getStringAttribute('valid_since'); + } + public set validSince(value: string) { + this._validSince = value; + } + public resetValidSince() { + this._validSince = undefined; + } + // Temporarily expose input value. Use with caution. + public get validSinceInput() { + return this._validSince; + } + + // valid_until - computed: true, optional: true, required: false + private _validUntil?: string; + public get validUntil() { + return this.getStringAttribute('valid_until'); + } + public set validUntil(value: string) { + this._validUntil = value; + } + public resetValidUntil() { + this._validUntil = undefined; + } + // Temporarily expose input value. Use with caution. + public get validUntilInput() { + return this._validUntil; + } + + // overrides - computed: false, optional: false, required: true + private _overrides = new ComputeAutoLaunchGroupOverridesList(this, "overrides", true); + public get overrides() { + return this._overrides; + } + public putOverrides(value: ComputeAutoLaunchGroupOverrides[] | cdktf.IResolvable) { + this._overrides.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get overridesInput() { + return this._overrides.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeAutoLaunchGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeAutoLaunchGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + allocation_strategy: cdktf.stringToTerraform(this._allocationStrategy), + delete_instances: cdktf.stringToTerraform(this._deleteInstances), + excess_fulfilled_capacity_behavior: cdktf.stringToTerraform(this._excessFulfilledCapacityBehavior), + id: cdktf.stringToTerraform(this._id), + instances_behavior_with_expiration: cdktf.stringToTerraform(this._instancesBehaviorWithExpiration), + launch_template_id: cdktf.stringToTerraform(this._launchTemplateId), + launch_template_version: cdktf.stringToTerraform(this._launchTemplateVersion), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + spot_price: cdktf.numberToTerraform(this._spotPrice), + stable_capacity: cdktf.numberToTerraform(this._stableCapacity), + supply_option: cdktf.stringToTerraform(this._supplyOption), + target_capacity: cdktf.numberToTerraform(this._targetCapacity), + type: cdktf.stringToTerraform(this._type), + valid_since: cdktf.stringToTerraform(this._validSince), + valid_until: cdktf.stringToTerraform(this._validUntil), + overrides: cdktf.listMapper(computeAutoLaunchGroupOverridesToTerraform, true)(this._overrides.internalValue), + timeouts: computeAutoLaunchGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + allocation_strategy: { + value: cdktf.stringToHclTerraform(this._allocationStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_instances: { + value: cdktf.stringToHclTerraform(this._deleteInstances), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + excess_fulfilled_capacity_behavior: { + value: cdktf.stringToHclTerraform(this._excessFulfilledCapacityBehavior), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instances_behavior_with_expiration: { + value: cdktf.stringToHclTerraform(this._instancesBehaviorWithExpiration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + launch_template_id: { + value: cdktf.stringToHclTerraform(this._launchTemplateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + launch_template_version: { + value: cdktf.stringToHclTerraform(this._launchTemplateVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spot_price: { + value: cdktf.numberToHclTerraform(this._spotPrice), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + stable_capacity: { + value: cdktf.numberToHclTerraform(this._stableCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + supply_option: { + value: cdktf.stringToHclTerraform(this._supplyOption), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_capacity: { + value: cdktf.numberToHclTerraform(this._targetCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + valid_since: { + value: cdktf.stringToHclTerraform(this._validSince), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + valid_until: { + value: cdktf.stringToHclTerraform(this._validUntil), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + overrides: { + value: cdktf.listMapperHcl(computeAutoLaunchGroupOverridesToHclTerraform, true)(this._overrides.internalValue), + isBlock: true, + type: "set", + storageClassType: "ComputeAutoLaunchGroupOverridesList", + }, + timeouts: { + value: computeAutoLaunchGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeAutoLaunchGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-eip-associate/README.md b/src/constructs/providers/huaweicloud/compute-eip-associate/README.md new file mode 100644 index 00000000..6fe16c74 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate). diff --git a/src/constructs/providers/huaweicloud/compute-eip-associate/index.ts b/src/constructs/providers/huaweicloud/compute-eip-associate/index.ts new file mode 100644 index 00000000..7cc3ca63 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-eip-associate/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#bandwidth_id ComputeEipAssociate#bandwidth_id} + */ + readonly bandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#fixed_ip ComputeEipAssociate#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#id ComputeEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#instance_id ComputeEipAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#public_ip ComputeEipAssociate#public_ip} + */ + readonly publicIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#region ComputeEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#timeouts ComputeEipAssociate#timeouts} + */ + readonly timeouts?: ComputeEipAssociateTimeouts; +} +export interface ComputeEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#create ComputeEipAssociate#create} + */ + readonly create?: string; +} + +export function computeEipAssociateTimeoutsToTerraform(struct?: ComputeEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function computeEipAssociateTimeoutsToHclTerraform(struct?: ComputeEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate huaweicloud_compute_eip_associate} +*/ +export class ComputeEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeEipAssociate to import + * @param importFromId The id of the existing ComputeEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_eip_associate huaweicloud_compute_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: ComputeEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthId = config.bandwidthId; + this._fixedIp = config.fixedIp; + this._id = config.id; + this._instanceId = config.instanceId; + this._publicIp = config.publicIp; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_id - computed: false, optional: true, required: false + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + public resetBandwidthId() { + this._bandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + timeouts: computeEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: computeEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/README.md b/src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/README.md new file mode 100644 index 00000000..72f761f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_floatingip_associate_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_floatingip_associate_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2). diff --git a/src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/index.ts b/src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/index.ts new file mode 100644 index 00000000..0919bbda --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-floatingip-associate-v2/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeFloatingipAssociateV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#bandwidth_id ComputeFloatingipAssociateV2#bandwidth_id} + */ + readonly bandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#fixed_ip ComputeFloatingipAssociateV2#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#id ComputeFloatingipAssociateV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#instance_id ComputeFloatingipAssociateV2#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#public_ip ComputeFloatingipAssociateV2#public_ip} + */ + readonly publicIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#region ComputeFloatingipAssociateV2#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#timeouts ComputeFloatingipAssociateV2#timeouts} + */ + readonly timeouts?: ComputeFloatingipAssociateV2Timeouts; +} +export interface ComputeFloatingipAssociateV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#create ComputeFloatingipAssociateV2#create} + */ + readonly create?: string; +} + +export function computeFloatingipAssociateV2TimeoutsToTerraform(struct?: ComputeFloatingipAssociateV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function computeFloatingipAssociateV2TimeoutsToHclTerraform(struct?: ComputeFloatingipAssociateV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeFloatingipAssociateV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeFloatingipAssociateV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeFloatingipAssociateV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2 huaweicloud_compute_floatingip_associate_v2} +*/ +export class ComputeFloatingipAssociateV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_floatingip_associate_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeFloatingipAssociateV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeFloatingipAssociateV2 to import + * @param importFromId The id of the existing ComputeFloatingipAssociateV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeFloatingipAssociateV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_floatingip_associate_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_associate_v2 huaweicloud_compute_floatingip_associate_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeFloatingipAssociateV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeFloatingipAssociateV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_floatingip_associate_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthId = config.bandwidthId; + this._fixedIp = config.fixedIp; + this._id = config.id; + this._instanceId = config.instanceId; + this._publicIp = config.publicIp; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_id - computed: false, optional: true, required: false + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + public resetBandwidthId() { + this._bandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeFloatingipAssociateV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeFloatingipAssociateV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + timeouts: computeFloatingipAssociateV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: computeFloatingipAssociateV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeFloatingipAssociateV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-floatingip-v2/README.md b/src/constructs/providers/huaweicloud/compute-floatingip-v2/README.md new file mode 100644 index 00000000..cd9a39e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-floatingip-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_floatingip_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_floatingip_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2). diff --git a/src/constructs/providers/huaweicloud/compute-floatingip-v2/index.ts b/src/constructs/providers/huaweicloud/compute-floatingip-v2/index.ts new file mode 100644 index 00000000..6798466b --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-floatingip-v2/index.ts @@ -0,0 +1,187 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeFloatingipV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2#id ComputeFloatingipV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2#pool ComputeFloatingipV2#pool} + */ + readonly pool?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2#region ComputeFloatingipV2#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2 huaweicloud_compute_floatingip_v2} +*/ +export class ComputeFloatingipV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_floatingip_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeFloatingipV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeFloatingipV2 to import + * @param importFromId The id of the existing ComputeFloatingipV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeFloatingipV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_floatingip_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_floatingip_v2 huaweicloud_compute_floatingip_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeFloatingipV2Config = {} + */ + public constructor(scope: Construct, id: string, config: ComputeFloatingipV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_floatingip_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._pool = config.pool; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // fixed_ip - computed: true, optional: false, required: false + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // pool - computed: false, optional: true, required: false + private _pool?: string; + public get pool() { + return this.getStringAttribute('pool'); + } + public set pool(value: string) { + this._pool = value; + } + public resetPool() { + this._pool = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolInput() { + return this._pool; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + pool: cdktf.stringToTerraform(this._pool), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool: { + value: cdktf.stringToHclTerraform(this._pool), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-instance-v2/README.md b/src/constructs/providers/huaweicloud/compute-instance-v2/README.md new file mode 100644 index 00000000..91408af3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-instance-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_instance_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_instance_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2). diff --git a/src/constructs/providers/huaweicloud/compute-instance-v2/index.ts b/src/constructs/providers/huaweicloud/compute-instance-v2/index.ts new file mode 100644 index 00000000..ed4d2c92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-instance-v2/index.ts @@ -0,0 +1,2814 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeInstanceV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#admin_pass ComputeInstanceV2#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#agency_name ComputeInstanceV2#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#agent_list ComputeInstanceV2#agent_list} + */ + readonly agentList?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#auto_pay ComputeInstanceV2#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#auto_renew ComputeInstanceV2#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#auto_terminate_time ComputeInstanceV2#auto_terminate_time} + */ + readonly autoTerminateTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#availability_zone ComputeInstanceV2#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#charging_mode ComputeInstanceV2#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#delete_disks_on_termination ComputeInstanceV2#delete_disks_on_termination} + */ + readonly deleteDisksOnTermination?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#delete_eip_on_termination ComputeInstanceV2#delete_eip_on_termination} + */ + readonly deleteEipOnTermination?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#description ComputeInstanceV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#eip_id ComputeInstanceV2#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#eip_type ComputeInstanceV2#eip_type} + */ + readonly eipType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#enterprise_project_id ComputeInstanceV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#flavor_id ComputeInstanceV2#flavor_id} + */ + readonly flavorId?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#flavor_name ComputeInstanceV2#flavor_name} + */ + readonly flavorName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#hostname ComputeInstanceV2#hostname} + */ + readonly hostname?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#id ComputeInstanceV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#image_id ComputeInstanceV2#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#image_name ComputeInstanceV2#image_name} + */ + readonly imageName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#key_pair ComputeInstanceV2#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#metadata ComputeInstanceV2#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#name ComputeInstanceV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#period ComputeInstanceV2#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#period_unit ComputeInstanceV2#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#power_action ComputeInstanceV2#power_action} + */ + readonly powerAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#private_key ComputeInstanceV2#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#region ComputeInstanceV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#security_group_ids ComputeInstanceV2#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#security_groups ComputeInstanceV2#security_groups} + */ + readonly securityGroups?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#spot_duration ComputeInstanceV2#spot_duration} + */ + readonly spotDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#spot_duration_count ComputeInstanceV2#spot_duration_count} + */ + readonly spotDurationCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#spot_maximum_price ComputeInstanceV2#spot_maximum_price} + */ + readonly spotMaximumPrice?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#stop_before_destroy ComputeInstanceV2#stop_before_destroy} + */ + readonly stopBeforeDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#system_disk_dss_pool_id ComputeInstanceV2#system_disk_dss_pool_id} + */ + readonly systemDiskDssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#system_disk_iops ComputeInstanceV2#system_disk_iops} + */ + readonly systemDiskIops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#system_disk_kms_key_id ComputeInstanceV2#system_disk_kms_key_id} + */ + readonly systemDiskKmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#system_disk_size ComputeInstanceV2#system_disk_size} + */ + readonly systemDiskSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#system_disk_throughput ComputeInstanceV2#system_disk_throughput} + */ + readonly systemDiskThroughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#system_disk_type ComputeInstanceV2#system_disk_type} + */ + readonly systemDiskType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#tags ComputeInstanceV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#user_data ComputeInstanceV2#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#user_id ComputeInstanceV2#user_id} + */ + readonly userId?: string; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#bandwidth ComputeInstanceV2#bandwidth} + */ + readonly bandwidth?: ComputeInstanceV2Bandwidth; + /** + * data_disks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#data_disks ComputeInstanceV2#data_disks} + */ + readonly dataDisks?: ComputeInstanceV2DataDisks[] | cdktf.IResolvable; + /** + * network block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#network ComputeInstanceV2#network} + */ + readonly network: ComputeInstanceV2Network[] | cdktf.IResolvable; + /** + * scheduler_hints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#scheduler_hints ComputeInstanceV2#scheduler_hints} + */ + readonly schedulerHints?: ComputeInstanceV2SchedulerHints[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#timeouts ComputeInstanceV2#timeouts} + */ + readonly timeouts?: ComputeInstanceV2Timeouts; +} +export interface ComputeInstanceV2VolumeAttached { +} + +export function computeInstanceV2VolumeAttachedToTerraform(struct?: ComputeInstanceV2VolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function computeInstanceV2VolumeAttachedToHclTerraform(struct?: ComputeInstanceV2VolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ComputeInstanceV2VolumeAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceV2VolumeAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceV2VolumeAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getNumberAttribute('boot_index'); + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // pci_address - computed: true, optional: false, required: false + public get pciAddress() { + return this.getStringAttribute('pci_address'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class ComputeInstanceV2VolumeAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceV2VolumeAttachedOutputReference { + return new ComputeInstanceV2VolumeAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceV2Bandwidth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#charge_mode ComputeInstanceV2#charge_mode} + */ + readonly chargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#extend_param ComputeInstanceV2#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#id ComputeInstanceV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#share_type ComputeInstanceV2#share_type} + */ + readonly shareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#size ComputeInstanceV2#size} + */ + readonly size?: number; +} + +export function computeInstanceV2BandwidthToTerraform(struct?: ComputeInstanceV2BandwidthOutputReference | ComputeInstanceV2Bandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParam), + id: cdktf.stringToTerraform(struct!.id), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function computeInstanceV2BandwidthToHclTerraform(struct?: ComputeInstanceV2BandwidthOutputReference | ComputeInstanceV2Bandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceV2BandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ComputeInstanceV2Bandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceV2Bandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargeMode = undefined; + this._extendParam = undefined; + this._id = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargeMode = value.chargeMode; + this._extendParam = value.extendParam; + this._id = value.id; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charge_mode - computed: false, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface ComputeInstanceV2DataDisks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#dss_pool_id ComputeInstanceV2#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#iops ComputeInstanceV2#iops} + */ + readonly iops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#kms_key_id ComputeInstanceV2#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#size ComputeInstanceV2#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#snapshot_id ComputeInstanceV2#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#throughput ComputeInstanceV2#throughput} + */ + readonly throughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#type ComputeInstanceV2#type} + */ + readonly type: string; +} + +export function computeInstanceV2DataDisksToTerraform(struct?: ComputeInstanceV2DataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + iops: cdktf.numberToTerraform(struct!.iops), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + snapshot_id: cdktf.stringToTerraform(struct!.snapshotId), + throughput: cdktf.numberToTerraform(struct!.throughput), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function computeInstanceV2DataDisksToHclTerraform(struct?: ComputeInstanceV2DataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iops: { + value: cdktf.numberToHclTerraform(struct!.iops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(struct!.snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throughput: { + value: cdktf.numberToHclTerraform(struct!.throughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceV2DataDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceV2DataDisks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._iops !== undefined) { + hasAnyValues = true; + internalValueResult.iops = this._iops; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._snapshotId !== undefined) { + hasAnyValues = true; + internalValueResult.snapshotId = this._snapshotId; + } + if (this._throughput !== undefined) { + hasAnyValues = true; + internalValueResult.throughput = this._throughput; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceV2DataDisks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dssPoolId = undefined; + this._iops = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._snapshotId = undefined; + this._throughput = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dssPoolId = value.dssPoolId; + this._iops = value.iops; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._snapshotId = value.snapshotId; + this._throughput = value.throughput; + this._type = value.type; + } + } + + // dss_pool_id - computed: false, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // iops - computed: false, optional: true, required: false + private _iops?: number; + public get iops() { + return this.getNumberAttribute('iops'); + } + public set iops(value: number) { + this._iops = value; + } + public resetIops() { + this._iops = undefined; + } + // Temporarily expose input value. Use with caution. + public get iopsInput() { + return this._iops; + } + + // kms_key_id - computed: false, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: false, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // throughput - computed: false, optional: true, required: false + private _throughput?: number; + public get throughput() { + return this.getNumberAttribute('throughput'); + } + public set throughput(value: number) { + this._throughput = value; + } + public resetThroughput() { + this._throughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get throughputInput() { + return this._throughput; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ComputeInstanceV2DataDisksList extends cdktf.ComplexList { + public internalValue? : ComputeInstanceV2DataDisks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceV2DataDisksOutputReference { + return new ComputeInstanceV2DataDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceV2Network { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#access_network ComputeInstanceV2#access_network} + */ + readonly accessNetwork?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#fixed_ip_v4 ComputeInstanceV2#fixed_ip_v4} + */ + readonly fixedIpV4?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#fixed_ip_v6 ComputeInstanceV2#fixed_ip_v6} + */ + readonly fixedIpV6?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#ipv6_enable ComputeInstanceV2#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#port ComputeInstanceV2#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#source_dest_check ComputeInstanceV2#source_dest_check} + */ + readonly sourceDestCheck?: boolean | cdktf.IResolvable; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#uuid ComputeInstanceV2#uuid} + */ + readonly uuid?: string; +} + +export function computeInstanceV2NetworkToTerraform(struct?: ComputeInstanceV2Network | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_network: cdktf.booleanToTerraform(struct!.accessNetwork), + fixed_ip_v4: cdktf.stringToTerraform(struct!.fixedIpV4), + fixed_ip_v6: cdktf.stringToTerraform(struct!.fixedIpV6), + ipv6_enable: cdktf.booleanToTerraform(struct!.ipv6Enable), + port: cdktf.stringToTerraform(struct!.port), + source_dest_check: cdktf.booleanToTerraform(struct!.sourceDestCheck), + uuid: cdktf.stringToTerraform(struct!.uuid), + } +} + + +export function computeInstanceV2NetworkToHclTerraform(struct?: ComputeInstanceV2Network | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_network: { + value: cdktf.booleanToHclTerraform(struct!.accessNetwork), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + fixed_ip_v4: { + value: cdktf.stringToHclTerraform(struct!.fixedIpV4), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip_v6: { + value: cdktf.stringToHclTerraform(struct!.fixedIpV6), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(struct!.ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + port: { + value: cdktf.stringToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_dest_check: { + value: cdktf.booleanToHclTerraform(struct!.sourceDestCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + uuid: { + value: cdktf.stringToHclTerraform(struct!.uuid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceV2NetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceV2Network | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessNetwork !== undefined) { + hasAnyValues = true; + internalValueResult.accessNetwork = this._accessNetwork; + } + if (this._fixedIpV4 !== undefined) { + hasAnyValues = true; + internalValueResult.fixedIpV4 = this._fixedIpV4; + } + if (this._fixedIpV6 !== undefined) { + hasAnyValues = true; + internalValueResult.fixedIpV6 = this._fixedIpV6; + } + if (this._ipv6Enable !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6Enable = this._ipv6Enable; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._sourceDestCheck !== undefined) { + hasAnyValues = true; + internalValueResult.sourceDestCheck = this._sourceDestCheck; + } + if (this._uuid !== undefined) { + hasAnyValues = true; + internalValueResult.uuid = this._uuid; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceV2Network | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accessNetwork = undefined; + this._fixedIpV4 = undefined; + this._fixedIpV6 = undefined; + this._ipv6Enable = undefined; + this._port = undefined; + this._sourceDestCheck = undefined; + this._uuid = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accessNetwork = value.accessNetwork; + this._fixedIpV4 = value.fixedIpV4; + this._fixedIpV6 = value.fixedIpV6; + this._ipv6Enable = value.ipv6Enable; + this._port = value.port; + this._sourceDestCheck = value.sourceDestCheck; + this._uuid = value.uuid; + } + } + + // access_network - computed: false, optional: true, required: false + private _accessNetwork?: boolean | cdktf.IResolvable; + public get accessNetwork() { + return this.getBooleanAttribute('access_network'); + } + public set accessNetwork(value: boolean | cdktf.IResolvable) { + this._accessNetwork = value; + } + public resetAccessNetwork() { + this._accessNetwork = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessNetworkInput() { + return this._accessNetwork; + } + + // fixed_ip_v4 - computed: true, optional: true, required: false + private _fixedIpV4?: string; + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + public set fixedIpV4(value: string) { + this._fixedIpV4 = value; + } + public resetFixedIpV4() { + this._fixedIpV4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV4Input() { + return this._fixedIpV4; + } + + // fixed_ip_v6 - computed: true, optional: true, required: false + private _fixedIpV6?: string; + public get fixedIpV6() { + return this.getStringAttribute('fixed_ip_v6'); + } + public set fixedIpV6(value: string) { + this._fixedIpV6 = value; + } + public resetFixedIpV6() { + this._fixedIpV6 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV6Input() { + return this._fixedIpV6; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // source_dest_check - computed: false, optional: true, required: false + private _sourceDestCheck?: boolean | cdktf.IResolvable; + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } + public set sourceDestCheck(value: boolean | cdktf.IResolvable) { + this._sourceDestCheck = value; + } + public resetSourceDestCheck() { + this._sourceDestCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceDestCheckInput() { + return this._sourceDestCheck; + } + + // uuid - computed: true, optional: true, required: false + private _uuid?: string; + public get uuid() { + return this.getStringAttribute('uuid'); + } + public set uuid(value: string) { + this._uuid = value; + } + public resetUuid() { + this._uuid = undefined; + } + // Temporarily expose input value. Use with caution. + public get uuidInput() { + return this._uuid; + } +} + +export class ComputeInstanceV2NetworkList extends cdktf.ComplexList { + public internalValue? : ComputeInstanceV2Network[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceV2NetworkOutputReference { + return new ComputeInstanceV2NetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceV2SchedulerHints { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#deh_id ComputeInstanceV2#deh_id} + */ + readonly dehId?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#fault_domain ComputeInstanceV2#fault_domain} + */ + readonly faultDomain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#group ComputeInstanceV2#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#tenancy ComputeInstanceV2#tenancy} + */ + readonly tenancy?: string; +} + +export function computeInstanceV2SchedulerHintsToTerraform(struct?: ComputeInstanceV2SchedulerHints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + deh_id: cdktf.stringToTerraform(struct!.dehId), + fault_domain: cdktf.stringToTerraform(struct!.faultDomain), + group: cdktf.stringToTerraform(struct!.group), + tenancy: cdktf.stringToTerraform(struct!.tenancy), + } +} + + +export function computeInstanceV2SchedulerHintsToHclTerraform(struct?: ComputeInstanceV2SchedulerHints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + deh_id: { + value: cdktf.stringToHclTerraform(struct!.dehId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fault_domain: { + value: cdktf.stringToHclTerraform(struct!.faultDomain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(struct!.group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenancy: { + value: cdktf.stringToHclTerraform(struct!.tenancy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceV2SchedulerHintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceV2SchedulerHints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dehId !== undefined) { + hasAnyValues = true; + internalValueResult.dehId = this._dehId; + } + if (this._faultDomain !== undefined) { + hasAnyValues = true; + internalValueResult.faultDomain = this._faultDomain; + } + if (this._group !== undefined) { + hasAnyValues = true; + internalValueResult.group = this._group; + } + if (this._tenancy !== undefined) { + hasAnyValues = true; + internalValueResult.tenancy = this._tenancy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceV2SchedulerHints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dehId = undefined; + this._faultDomain = undefined; + this._group = undefined; + this._tenancy = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dehId = value.dehId; + this._faultDomain = value.faultDomain; + this._group = value.group; + this._tenancy = value.tenancy; + } + } + + // deh_id - computed: false, optional: true, required: false + private _dehId?: string; + public get dehId() { + return this.getStringAttribute('deh_id'); + } + public set dehId(value: string) { + this._dehId = value; + } + public resetDehId() { + this._dehId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dehIdInput() { + return this._dehId; + } + + // fault_domain - computed: false, optional: true, required: false + private _faultDomain?: string; + public get faultDomain() { + return this.getStringAttribute('fault_domain'); + } + public set faultDomain(value: string) { + this._faultDomain = value; + } + public resetFaultDomain() { + this._faultDomain = undefined; + } + // Temporarily expose input value. Use with caution. + public get faultDomainInput() { + return this._faultDomain; + } + + // group - computed: true, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // tenancy - computed: false, optional: true, required: false + private _tenancy?: string; + public get tenancy() { + return this.getStringAttribute('tenancy'); + } + public set tenancy(value: string) { + this._tenancy = value; + } + public resetTenancy() { + this._tenancy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenancyInput() { + return this._tenancy; + } +} + +export class ComputeInstanceV2SchedulerHintsList extends cdktf.ComplexList { + public internalValue? : ComputeInstanceV2SchedulerHints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceV2SchedulerHintsOutputReference { + return new ComputeInstanceV2SchedulerHintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#create ComputeInstanceV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#delete ComputeInstanceV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#update ComputeInstanceV2#update} + */ + readonly update?: string; +} + +export function computeInstanceV2TimeoutsToTerraform(struct?: ComputeInstanceV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function computeInstanceV2TimeoutsToHclTerraform(struct?: ComputeInstanceV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeInstanceV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2 huaweicloud_compute_instance_v2} +*/ +export class ComputeInstanceV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_instance_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeInstanceV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeInstanceV2 to import + * @param importFromId The id of the existing ComputeInstanceV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeInstanceV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_instance_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance_v2 huaweicloud_compute_instance_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeInstanceV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeInstanceV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_instance_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._agencyName = config.agencyName; + this._agentList = config.agentList; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._autoTerminateTime = config.autoTerminateTime; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._deleteDisksOnTermination = config.deleteDisksOnTermination; + this._deleteEipOnTermination = config.deleteEipOnTermination; + this._description = config.description; + this._eipId = config.eipId; + this._eipType = config.eipType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._flavorName = config.flavorName; + this._hostname = config.hostname; + this._id = config.id; + this._imageId = config.imageId; + this._imageName = config.imageName; + this._keyPair = config.keyPair; + this._metadata = config.metadata; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._powerAction = config.powerAction; + this._privateKey = config.privateKey; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._securityGroups = config.securityGroups; + this._spotDuration = config.spotDuration; + this._spotDurationCount = config.spotDurationCount; + this._spotMaximumPrice = config.spotMaximumPrice; + this._stopBeforeDestroy = config.stopBeforeDestroy; + this._systemDiskDssPoolId = config.systemDiskDssPoolId; + this._systemDiskIops = config.systemDiskIops; + this._systemDiskKmsKeyId = config.systemDiskKmsKeyId; + this._systemDiskSize = config.systemDiskSize; + this._systemDiskThroughput = config.systemDiskThroughput; + this._systemDiskType = config.systemDiskType; + this._tags = config.tags; + this._userData = config.userData; + this._userId = config.userId; + this._bandwidth.internalValue = config.bandwidth; + this._dataDisks.internalValue = config.dataDisks; + this._network.internalValue = config.network; + this._schedulerHints.internalValue = config.schedulerHints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_ip_v4 - computed: true, optional: false, required: false + public get accessIpV4() { + return this.getStringAttribute('access_ip_v4'); + } + + // access_ip_v6 - computed: true, optional: false, required: false + public get accessIpV6() { + return this.getStringAttribute('access_ip_v6'); + } + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // agent_list - computed: true, optional: true, required: false + private _agentList?: string; + public get agentList() { + return this.getStringAttribute('agent_list'); + } + public set agentList(value: string) { + this._agentList = value; + } + public resetAgentList() { + this._agentList = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentListInput() { + return this._agentList; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // auto_terminate_time - computed: false, optional: true, required: false + private _autoTerminateTime?: string; + public get autoTerminateTime() { + return this.getStringAttribute('auto_terminate_time'); + } + public set autoTerminateTime(value: string) { + this._autoTerminateTime = value; + } + public resetAutoTerminateTime() { + this._autoTerminateTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoTerminateTimeInput() { + return this._autoTerminateTime; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delete_disks_on_termination - computed: false, optional: true, required: false + private _deleteDisksOnTermination?: boolean | cdktf.IResolvable; + public get deleteDisksOnTermination() { + return this.getBooleanAttribute('delete_disks_on_termination'); + } + public set deleteDisksOnTermination(value: boolean | cdktf.IResolvable) { + this._deleteDisksOnTermination = value; + } + public resetDeleteDisksOnTermination() { + this._deleteDisksOnTermination = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteDisksOnTerminationInput() { + return this._deleteDisksOnTermination; + } + + // delete_eip_on_termination - computed: false, optional: true, required: false + private _deleteEipOnTermination?: boolean | cdktf.IResolvable; + public get deleteEipOnTermination() { + return this.getBooleanAttribute('delete_eip_on_termination'); + } + public set deleteEipOnTermination(value: boolean | cdktf.IResolvable) { + this._deleteEipOnTermination = value; + } + public resetDeleteEipOnTermination() { + this._deleteEipOnTermination = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEipOnTerminationInput() { + return this._deleteEipOnTermination; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // eip_type - computed: false, optional: true, required: false + private _eipType?: string; + public get eipType() { + return this.getStringAttribute('eip_type'); + } + public set eipType(value: string) { + this._eipType = value; + } + public resetEipType() { + this._eipType = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipTypeInput() { + return this._eipType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_time - computed: true, optional: false, required: false + public get expiredTime() { + return this.getStringAttribute('expired_time'); + } + + // flavor_id - computed: true, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: true, optional: true, required: false + private _flavorName?: string; + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + public set flavorName(value: string) { + this._flavorName = value; + } + public resetFlavorName() { + this._flavorName = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorNameInput() { + return this._flavorName; + } + + // hostname - computed: true, optional: true, required: false + private _hostname?: string; + public get hostname() { + return this.getStringAttribute('hostname'); + } + public set hostname(value: string) { + this._hostname = value; + } + public resetHostname() { + this._hostname = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostnameInput() { + return this._hostname; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: true, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_name - computed: true, optional: true, required: false + private _imageName?: string; + public get imageName() { + return this.getStringAttribute('image_name'); + } + public set imageName(value: string) { + this._imageName = value; + } + public resetImageName() { + this._imageName = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageNameInput() { + return this._imageName; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // power_action - computed: true, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // security_groups - computed: true, optional: true, required: false + private _securityGroups?: string[]; + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + public resetSecurityGroups() { + this._securityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // spot_duration - computed: false, optional: true, required: false + private _spotDuration?: number; + public get spotDuration() { + return this.getNumberAttribute('spot_duration'); + } + public set spotDuration(value: number) { + this._spotDuration = value; + } + public resetSpotDuration() { + this._spotDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotDurationInput() { + return this._spotDuration; + } + + // spot_duration_count - computed: true, optional: true, required: false + private _spotDurationCount?: number; + public get spotDurationCount() { + return this.getNumberAttribute('spot_duration_count'); + } + public set spotDurationCount(value: number) { + this._spotDurationCount = value; + } + public resetSpotDurationCount() { + this._spotDurationCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotDurationCountInput() { + return this._spotDurationCount; + } + + // spot_maximum_price - computed: false, optional: true, required: false + private _spotMaximumPrice?: string; + public get spotMaximumPrice() { + return this.getStringAttribute('spot_maximum_price'); + } + public set spotMaximumPrice(value: string) { + this._spotMaximumPrice = value; + } + public resetSpotMaximumPrice() { + this._spotMaximumPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotMaximumPriceInput() { + return this._spotMaximumPrice; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stop_before_destroy - computed: false, optional: true, required: false + private _stopBeforeDestroy?: boolean | cdktf.IResolvable; + public get stopBeforeDestroy() { + return this.getBooleanAttribute('stop_before_destroy'); + } + public set stopBeforeDestroy(value: boolean | cdktf.IResolvable) { + this._stopBeforeDestroy = value; + } + public resetStopBeforeDestroy() { + this._stopBeforeDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get stopBeforeDestroyInput() { + return this._stopBeforeDestroy; + } + + // system_disk_dss_pool_id - computed: false, optional: true, required: false + private _systemDiskDssPoolId?: string; + public get systemDiskDssPoolId() { + return this.getStringAttribute('system_disk_dss_pool_id'); + } + public set systemDiskDssPoolId(value: string) { + this._systemDiskDssPoolId = value; + } + public resetSystemDiskDssPoolId() { + this._systemDiskDssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskDssPoolIdInput() { + return this._systemDiskDssPoolId; + } + + // system_disk_id - computed: true, optional: false, required: false + public get systemDiskId() { + return this.getStringAttribute('system_disk_id'); + } + + // system_disk_iops - computed: true, optional: true, required: false + private _systemDiskIops?: number; + public get systemDiskIops() { + return this.getNumberAttribute('system_disk_iops'); + } + public set systemDiskIops(value: number) { + this._systemDiskIops = value; + } + public resetSystemDiskIops() { + this._systemDiskIops = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskIopsInput() { + return this._systemDiskIops; + } + + // system_disk_kms_key_id - computed: true, optional: true, required: false + private _systemDiskKmsKeyId?: string; + public get systemDiskKmsKeyId() { + return this.getStringAttribute('system_disk_kms_key_id'); + } + public set systemDiskKmsKeyId(value: string) { + this._systemDiskKmsKeyId = value; + } + public resetSystemDiskKmsKeyId() { + this._systemDiskKmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskKmsKeyIdInput() { + return this._systemDiskKmsKeyId; + } + + // system_disk_size - computed: true, optional: true, required: false + private _systemDiskSize?: number; + public get systemDiskSize() { + return this.getNumberAttribute('system_disk_size'); + } + public set systemDiskSize(value: number) { + this._systemDiskSize = value; + } + public resetSystemDiskSize() { + this._systemDiskSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskSizeInput() { + return this._systemDiskSize; + } + + // system_disk_throughput - computed: true, optional: true, required: false + private _systemDiskThroughput?: number; + public get systemDiskThroughput() { + return this.getNumberAttribute('system_disk_throughput'); + } + public set systemDiskThroughput(value: number) { + this._systemDiskThroughput = value; + } + public resetSystemDiskThroughput() { + this._systemDiskThroughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskThroughputInput() { + return this._systemDiskThroughput; + } + + // system_disk_type - computed: true, optional: true, required: false + private _systemDiskType?: string; + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + public set systemDiskType(value: string) { + this._systemDiskType = value; + } + public resetSystemDiskType() { + this._systemDiskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskTypeInput() { + return this._systemDiskType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // user_id - computed: false, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // volume_attached - computed: true, optional: false, required: false + private _volumeAttached = new ComputeInstanceV2VolumeAttachedList(this, "volume_attached", false); + public get volumeAttached() { + return this._volumeAttached; + } + + // bandwidth - computed: false, optional: true, required: false + private _bandwidth = new ComputeInstanceV2BandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: ComputeInstanceV2Bandwidth) { + this._bandwidth.internalValue = value; + } + public resetBandwidth() { + this._bandwidth.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } + + // data_disks - computed: false, optional: true, required: false + private _dataDisks = new ComputeInstanceV2DataDisksList(this, "data_disks", false); + public get dataDisks() { + return this._dataDisks; + } + public putDataDisks(value: ComputeInstanceV2DataDisks[] | cdktf.IResolvable) { + this._dataDisks.internalValue = value; + } + public resetDataDisks() { + this._dataDisks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDisksInput() { + return this._dataDisks.internalValue; + } + + // network - computed: false, optional: false, required: true + private _network = new ComputeInstanceV2NetworkList(this, "network", false); + public get network() { + return this._network; + } + public putNetwork(value: ComputeInstanceV2Network[] | cdktf.IResolvable) { + this._network.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get networkInput() { + return this._network.internalValue; + } + + // scheduler_hints - computed: false, optional: true, required: false + private _schedulerHints = new ComputeInstanceV2SchedulerHintsList(this, "scheduler_hints", true); + public get schedulerHints() { + return this._schedulerHints; + } + public putSchedulerHints(value: ComputeInstanceV2SchedulerHints[] | cdktf.IResolvable) { + this._schedulerHints.internalValue = value; + } + public resetSchedulerHints() { + this._schedulerHints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerHintsInput() { + return this._schedulerHints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeInstanceV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeInstanceV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + agency_name: cdktf.stringToTerraform(this._agencyName), + agent_list: cdktf.stringToTerraform(this._agentList), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + auto_terminate_time: cdktf.stringToTerraform(this._autoTerminateTime), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + delete_disks_on_termination: cdktf.booleanToTerraform(this._deleteDisksOnTermination), + delete_eip_on_termination: cdktf.booleanToTerraform(this._deleteEipOnTermination), + description: cdktf.stringToTerraform(this._description), + eip_id: cdktf.stringToTerraform(this._eipId), + eip_type: cdktf.stringToTerraform(this._eipType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + flavor_name: cdktf.stringToTerraform(this._flavorName), + hostname: cdktf.stringToTerraform(this._hostname), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_name: cdktf.stringToTerraform(this._imageName), + key_pair: cdktf.stringToTerraform(this._keyPair), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + power_action: cdktf.stringToTerraform(this._powerAction), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + spot_duration: cdktf.numberToTerraform(this._spotDuration), + spot_duration_count: cdktf.numberToTerraform(this._spotDurationCount), + spot_maximum_price: cdktf.stringToTerraform(this._spotMaximumPrice), + stop_before_destroy: cdktf.booleanToTerraform(this._stopBeforeDestroy), + system_disk_dss_pool_id: cdktf.stringToTerraform(this._systemDiskDssPoolId), + system_disk_iops: cdktf.numberToTerraform(this._systemDiskIops), + system_disk_kms_key_id: cdktf.stringToTerraform(this._systemDiskKmsKeyId), + system_disk_size: cdktf.numberToTerraform(this._systemDiskSize), + system_disk_throughput: cdktf.numberToTerraform(this._systemDiskThroughput), + system_disk_type: cdktf.stringToTerraform(this._systemDiskType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_data: cdktf.stringToTerraform(this._userData), + user_id: cdktf.stringToTerraform(this._userId), + bandwidth: computeInstanceV2BandwidthToTerraform(this._bandwidth.internalValue), + data_disks: cdktf.listMapper(computeInstanceV2DataDisksToTerraform, true)(this._dataDisks.internalValue), + network: cdktf.listMapper(computeInstanceV2NetworkToTerraform, true)(this._network.internalValue), + scheduler_hints: cdktf.listMapper(computeInstanceV2SchedulerHintsToTerraform, true)(this._schedulerHints.internalValue), + timeouts: computeInstanceV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agent_list: { + value: cdktf.stringToHclTerraform(this._agentList), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_terminate_time: { + value: cdktf.stringToHclTerraform(this._autoTerminateTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_disks_on_termination: { + value: cdktf.booleanToHclTerraform(this._deleteDisksOnTermination), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delete_eip_on_termination: { + value: cdktf.booleanToHclTerraform(this._deleteEipOnTermination), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_type: { + value: cdktf.stringToHclTerraform(this._eipType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_name: { + value: cdktf.stringToHclTerraform(this._flavorName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hostname: { + value: cdktf.stringToHclTerraform(this._hostname), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_name: { + value: cdktf.stringToHclTerraform(this._imageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + spot_duration: { + value: cdktf.numberToHclTerraform(this._spotDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spot_duration_count: { + value: cdktf.numberToHclTerraform(this._spotDurationCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spot_maximum_price: { + value: cdktf.stringToHclTerraform(this._spotMaximumPrice), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stop_before_destroy: { + value: cdktf.booleanToHclTerraform(this._stopBeforeDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + system_disk_dss_pool_id: { + value: cdktf.stringToHclTerraform(this._systemDiskDssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_iops: { + value: cdktf.numberToHclTerraform(this._systemDiskIops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_kms_key_id: { + value: cdktf.stringToHclTerraform(this._systemDiskKmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_size: { + value: cdktf.numberToHclTerraform(this._systemDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_throughput: { + value: cdktf.numberToHclTerraform(this._systemDiskThroughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_type: { + value: cdktf.stringToHclTerraform(this._systemDiskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth: { + value: computeInstanceV2BandwidthToHclTerraform(this._bandwidth.internalValue), + isBlock: true, + type: "list", + storageClassType: "ComputeInstanceV2BandwidthList", + }, + data_disks: { + value: cdktf.listMapperHcl(computeInstanceV2DataDisksToHclTerraform, true)(this._dataDisks.internalValue), + isBlock: true, + type: "list", + storageClassType: "ComputeInstanceV2DataDisksList", + }, + network: { + value: cdktf.listMapperHcl(computeInstanceV2NetworkToHclTerraform, true)(this._network.internalValue), + isBlock: true, + type: "list", + storageClassType: "ComputeInstanceV2NetworkList", + }, + scheduler_hints: { + value: cdktf.listMapperHcl(computeInstanceV2SchedulerHintsToHclTerraform, true)(this._schedulerHints.internalValue), + isBlock: true, + type: "set", + storageClassType: "ComputeInstanceV2SchedulerHintsList", + }, + timeouts: { + value: computeInstanceV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeInstanceV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-instance/README.md b/src/constructs/providers/huaweicloud/compute-instance/README.md new file mode 100644 index 00000000..ae99353e --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance). diff --git a/src/constructs/providers/huaweicloud/compute-instance/index.ts b/src/constructs/providers/huaweicloud/compute-instance/index.ts new file mode 100644 index 00000000..dd8db4e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-instance/index.ts @@ -0,0 +1,2814 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#admin_pass ComputeInstance#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#agency_name ComputeInstance#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#agent_list ComputeInstance#agent_list} + */ + readonly agentList?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#auto_pay ComputeInstance#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#auto_renew ComputeInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#auto_terminate_time ComputeInstance#auto_terminate_time} + */ + readonly autoTerminateTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#availability_zone ComputeInstance#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#charging_mode ComputeInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#delete_disks_on_termination ComputeInstance#delete_disks_on_termination} + */ + readonly deleteDisksOnTermination?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#delete_eip_on_termination ComputeInstance#delete_eip_on_termination} + */ + readonly deleteEipOnTermination?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#description ComputeInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#eip_id ComputeInstance#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#eip_type ComputeInstance#eip_type} + */ + readonly eipType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#enterprise_project_id ComputeInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#flavor_id ComputeInstance#flavor_id} + */ + readonly flavorId?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#flavor_name ComputeInstance#flavor_name} + */ + readonly flavorName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#hostname ComputeInstance#hostname} + */ + readonly hostname?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#id ComputeInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#image_id ComputeInstance#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#image_name ComputeInstance#image_name} + */ + readonly imageName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#key_pair ComputeInstance#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#metadata ComputeInstance#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#name ComputeInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#period ComputeInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#period_unit ComputeInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#power_action ComputeInstance#power_action} + */ + readonly powerAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#private_key ComputeInstance#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#region ComputeInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#security_group_ids ComputeInstance#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#security_groups ComputeInstance#security_groups} + */ + readonly securityGroups?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#spot_duration ComputeInstance#spot_duration} + */ + readonly spotDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#spot_duration_count ComputeInstance#spot_duration_count} + */ + readonly spotDurationCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#spot_maximum_price ComputeInstance#spot_maximum_price} + */ + readonly spotMaximumPrice?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#stop_before_destroy ComputeInstance#stop_before_destroy} + */ + readonly stopBeforeDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#system_disk_dss_pool_id ComputeInstance#system_disk_dss_pool_id} + */ + readonly systemDiskDssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#system_disk_iops ComputeInstance#system_disk_iops} + */ + readonly systemDiskIops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#system_disk_kms_key_id ComputeInstance#system_disk_kms_key_id} + */ + readonly systemDiskKmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#system_disk_size ComputeInstance#system_disk_size} + */ + readonly systemDiskSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#system_disk_throughput ComputeInstance#system_disk_throughput} + */ + readonly systemDiskThroughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#system_disk_type ComputeInstance#system_disk_type} + */ + readonly systemDiskType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#tags ComputeInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#user_data ComputeInstance#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#user_id ComputeInstance#user_id} + */ + readonly userId?: string; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#bandwidth ComputeInstance#bandwidth} + */ + readonly bandwidth?: ComputeInstanceBandwidth; + /** + * data_disks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#data_disks ComputeInstance#data_disks} + */ + readonly dataDisks?: ComputeInstanceDataDisks[] | cdktf.IResolvable; + /** + * network block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#network ComputeInstance#network} + */ + readonly network: ComputeInstanceNetwork[] | cdktf.IResolvable; + /** + * scheduler_hints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#scheduler_hints ComputeInstance#scheduler_hints} + */ + readonly schedulerHints?: ComputeInstanceSchedulerHints[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#timeouts ComputeInstance#timeouts} + */ + readonly timeouts?: ComputeInstanceTimeouts; +} +export interface ComputeInstanceVolumeAttached { +} + +export function computeInstanceVolumeAttachedToTerraform(struct?: ComputeInstanceVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function computeInstanceVolumeAttachedToHclTerraform(struct?: ComputeInstanceVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ComputeInstanceVolumeAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceVolumeAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceVolumeAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getNumberAttribute('boot_index'); + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // pci_address - computed: true, optional: false, required: false + public get pciAddress() { + return this.getStringAttribute('pci_address'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class ComputeInstanceVolumeAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceVolumeAttachedOutputReference { + return new ComputeInstanceVolumeAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceBandwidth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#charge_mode ComputeInstance#charge_mode} + */ + readonly chargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#extend_param ComputeInstance#extend_param} + */ + readonly extendParam?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#id ComputeInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#share_type ComputeInstance#share_type} + */ + readonly shareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#size ComputeInstance#size} + */ + readonly size?: number; +} + +export function computeInstanceBandwidthToTerraform(struct?: ComputeInstanceBandwidthOutputReference | ComputeInstanceBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + extend_param: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.extendParam), + id: cdktf.stringToTerraform(struct!.id), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function computeInstanceBandwidthToHclTerraform(struct?: ComputeInstanceBandwidthOutputReference | ComputeInstanceBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_param: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.extendParam), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ComputeInstanceBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._extendParam !== undefined) { + hasAnyValues = true; + internalValueResult.extendParam = this._extendParam; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargeMode = undefined; + this._extendParam = undefined; + this._id = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargeMode = value.chargeMode; + this._extendParam = value.extendParam; + this._id = value.id; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charge_mode - computed: false, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // extend_param - computed: false, optional: true, required: false + private _extendParam?: { [key: string]: string }; + public get extendParam() { + return this.getStringMapAttribute('extend_param'); + } + public set extendParam(value: { [key: string]: string }) { + this._extendParam = value; + } + public resetExtendParam() { + this._extendParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamInput() { + return this._extendParam; + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface ComputeInstanceDataDisks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#dss_pool_id ComputeInstance#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#iops ComputeInstance#iops} + */ + readonly iops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#kms_key_id ComputeInstance#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#size ComputeInstance#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#snapshot_id ComputeInstance#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#throughput ComputeInstance#throughput} + */ + readonly throughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#type ComputeInstance#type} + */ + readonly type: string; +} + +export function computeInstanceDataDisksToTerraform(struct?: ComputeInstanceDataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dss_pool_id: cdktf.stringToTerraform(struct!.dssPoolId), + iops: cdktf.numberToTerraform(struct!.iops), + kms_key_id: cdktf.stringToTerraform(struct!.kmsKeyId), + size: cdktf.numberToTerraform(struct!.size), + snapshot_id: cdktf.stringToTerraform(struct!.snapshotId), + throughput: cdktf.numberToTerraform(struct!.throughput), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function computeInstanceDataDisksToHclTerraform(struct?: ComputeInstanceDataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dss_pool_id: { + value: cdktf.stringToHclTerraform(struct!.dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iops: { + value: cdktf.numberToHclTerraform(struct!.iops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(struct!.kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(struct!.snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throughput: { + value: cdktf.numberToHclTerraform(struct!.throughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceDataDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceDataDisks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dssPoolId !== undefined) { + hasAnyValues = true; + internalValueResult.dssPoolId = this._dssPoolId; + } + if (this._iops !== undefined) { + hasAnyValues = true; + internalValueResult.iops = this._iops; + } + if (this._kmsKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.kmsKeyId = this._kmsKeyId; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._snapshotId !== undefined) { + hasAnyValues = true; + internalValueResult.snapshotId = this._snapshotId; + } + if (this._throughput !== undefined) { + hasAnyValues = true; + internalValueResult.throughput = this._throughput; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceDataDisks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dssPoolId = undefined; + this._iops = undefined; + this._kmsKeyId = undefined; + this._size = undefined; + this._snapshotId = undefined; + this._throughput = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dssPoolId = value.dssPoolId; + this._iops = value.iops; + this._kmsKeyId = value.kmsKeyId; + this._size = value.size; + this._snapshotId = value.snapshotId; + this._throughput = value.throughput; + this._type = value.type; + } + } + + // dss_pool_id - computed: false, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // iops - computed: false, optional: true, required: false + private _iops?: number; + public get iops() { + return this.getNumberAttribute('iops'); + } + public set iops(value: number) { + this._iops = value; + } + public resetIops() { + this._iops = undefined; + } + // Temporarily expose input value. Use with caution. + public get iopsInput() { + return this._iops; + } + + // kms_key_id - computed: false, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: false, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // throughput - computed: false, optional: true, required: false + private _throughput?: number; + public get throughput() { + return this.getNumberAttribute('throughput'); + } + public set throughput(value: number) { + this._throughput = value; + } + public resetThroughput() { + this._throughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get throughputInput() { + return this._throughput; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ComputeInstanceDataDisksList extends cdktf.ComplexList { + public internalValue? : ComputeInstanceDataDisks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceDataDisksOutputReference { + return new ComputeInstanceDataDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceNetwork { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#access_network ComputeInstance#access_network} + */ + readonly accessNetwork?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#fixed_ip_v4 ComputeInstance#fixed_ip_v4} + */ + readonly fixedIpV4?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#fixed_ip_v6 ComputeInstance#fixed_ip_v6} + */ + readonly fixedIpV6?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#ipv6_enable ComputeInstance#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#port ComputeInstance#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#source_dest_check ComputeInstance#source_dest_check} + */ + readonly sourceDestCheck?: boolean | cdktf.IResolvable; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#uuid ComputeInstance#uuid} + */ + readonly uuid?: string; +} + +export function computeInstanceNetworkToTerraform(struct?: ComputeInstanceNetwork | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_network: cdktf.booleanToTerraform(struct!.accessNetwork), + fixed_ip_v4: cdktf.stringToTerraform(struct!.fixedIpV4), + fixed_ip_v6: cdktf.stringToTerraform(struct!.fixedIpV6), + ipv6_enable: cdktf.booleanToTerraform(struct!.ipv6Enable), + port: cdktf.stringToTerraform(struct!.port), + source_dest_check: cdktf.booleanToTerraform(struct!.sourceDestCheck), + uuid: cdktf.stringToTerraform(struct!.uuid), + } +} + + +export function computeInstanceNetworkToHclTerraform(struct?: ComputeInstanceNetwork | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_network: { + value: cdktf.booleanToHclTerraform(struct!.accessNetwork), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + fixed_ip_v4: { + value: cdktf.stringToHclTerraform(struct!.fixedIpV4), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip_v6: { + value: cdktf.stringToHclTerraform(struct!.fixedIpV6), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(struct!.ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + port: { + value: cdktf.stringToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_dest_check: { + value: cdktf.booleanToHclTerraform(struct!.sourceDestCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + uuid: { + value: cdktf.stringToHclTerraform(struct!.uuid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceNetwork | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessNetwork !== undefined) { + hasAnyValues = true; + internalValueResult.accessNetwork = this._accessNetwork; + } + if (this._fixedIpV4 !== undefined) { + hasAnyValues = true; + internalValueResult.fixedIpV4 = this._fixedIpV4; + } + if (this._fixedIpV6 !== undefined) { + hasAnyValues = true; + internalValueResult.fixedIpV6 = this._fixedIpV6; + } + if (this._ipv6Enable !== undefined) { + hasAnyValues = true; + internalValueResult.ipv6Enable = this._ipv6Enable; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._sourceDestCheck !== undefined) { + hasAnyValues = true; + internalValueResult.sourceDestCheck = this._sourceDestCheck; + } + if (this._uuid !== undefined) { + hasAnyValues = true; + internalValueResult.uuid = this._uuid; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceNetwork | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accessNetwork = undefined; + this._fixedIpV4 = undefined; + this._fixedIpV6 = undefined; + this._ipv6Enable = undefined; + this._port = undefined; + this._sourceDestCheck = undefined; + this._uuid = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accessNetwork = value.accessNetwork; + this._fixedIpV4 = value.fixedIpV4; + this._fixedIpV6 = value.fixedIpV6; + this._ipv6Enable = value.ipv6Enable; + this._port = value.port; + this._sourceDestCheck = value.sourceDestCheck; + this._uuid = value.uuid; + } + } + + // access_network - computed: false, optional: true, required: false + private _accessNetwork?: boolean | cdktf.IResolvable; + public get accessNetwork() { + return this.getBooleanAttribute('access_network'); + } + public set accessNetwork(value: boolean | cdktf.IResolvable) { + this._accessNetwork = value; + } + public resetAccessNetwork() { + this._accessNetwork = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessNetworkInput() { + return this._accessNetwork; + } + + // fixed_ip_v4 - computed: true, optional: true, required: false + private _fixedIpV4?: string; + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + public set fixedIpV4(value: string) { + this._fixedIpV4 = value; + } + public resetFixedIpV4() { + this._fixedIpV4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV4Input() { + return this._fixedIpV4; + } + + // fixed_ip_v6 - computed: true, optional: true, required: false + private _fixedIpV6?: string; + public get fixedIpV6() { + return this.getStringAttribute('fixed_ip_v6'); + } + public set fixedIpV6(value: string) { + this._fixedIpV6 = value; + } + public resetFixedIpV6() { + this._fixedIpV6 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV6Input() { + return this._fixedIpV6; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // source_dest_check - computed: false, optional: true, required: false + private _sourceDestCheck?: boolean | cdktf.IResolvable; + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } + public set sourceDestCheck(value: boolean | cdktf.IResolvable) { + this._sourceDestCheck = value; + } + public resetSourceDestCheck() { + this._sourceDestCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceDestCheckInput() { + return this._sourceDestCheck; + } + + // uuid - computed: true, optional: true, required: false + private _uuid?: string; + public get uuid() { + return this.getStringAttribute('uuid'); + } + public set uuid(value: string) { + this._uuid = value; + } + public resetUuid() { + this._uuid = undefined; + } + // Temporarily expose input value. Use with caution. + public get uuidInput() { + return this._uuid; + } +} + +export class ComputeInstanceNetworkList extends cdktf.ComplexList { + public internalValue? : ComputeInstanceNetwork[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceNetworkOutputReference { + return new ComputeInstanceNetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceSchedulerHints { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#deh_id ComputeInstance#deh_id} + */ + readonly dehId?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#fault_domain ComputeInstance#fault_domain} + */ + readonly faultDomain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#group ComputeInstance#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#tenancy ComputeInstance#tenancy} + */ + readonly tenancy?: string; +} + +export function computeInstanceSchedulerHintsToTerraform(struct?: ComputeInstanceSchedulerHints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + deh_id: cdktf.stringToTerraform(struct!.dehId), + fault_domain: cdktf.stringToTerraform(struct!.faultDomain), + group: cdktf.stringToTerraform(struct!.group), + tenancy: cdktf.stringToTerraform(struct!.tenancy), + } +} + + +export function computeInstanceSchedulerHintsToHclTerraform(struct?: ComputeInstanceSchedulerHints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + deh_id: { + value: cdktf.stringToHclTerraform(struct!.dehId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fault_domain: { + value: cdktf.stringToHclTerraform(struct!.faultDomain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(struct!.group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenancy: { + value: cdktf.stringToHclTerraform(struct!.tenancy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceSchedulerHintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeInstanceSchedulerHints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dehId !== undefined) { + hasAnyValues = true; + internalValueResult.dehId = this._dehId; + } + if (this._faultDomain !== undefined) { + hasAnyValues = true; + internalValueResult.faultDomain = this._faultDomain; + } + if (this._group !== undefined) { + hasAnyValues = true; + internalValueResult.group = this._group; + } + if (this._tenancy !== undefined) { + hasAnyValues = true; + internalValueResult.tenancy = this._tenancy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceSchedulerHints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dehId = undefined; + this._faultDomain = undefined; + this._group = undefined; + this._tenancy = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dehId = value.dehId; + this._faultDomain = value.faultDomain; + this._group = value.group; + this._tenancy = value.tenancy; + } + } + + // deh_id - computed: false, optional: true, required: false + private _dehId?: string; + public get dehId() { + return this.getStringAttribute('deh_id'); + } + public set dehId(value: string) { + this._dehId = value; + } + public resetDehId() { + this._dehId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dehIdInput() { + return this._dehId; + } + + // fault_domain - computed: false, optional: true, required: false + private _faultDomain?: string; + public get faultDomain() { + return this.getStringAttribute('fault_domain'); + } + public set faultDomain(value: string) { + this._faultDomain = value; + } + public resetFaultDomain() { + this._faultDomain = undefined; + } + // Temporarily expose input value. Use with caution. + public get faultDomainInput() { + return this._faultDomain; + } + + // group - computed: true, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // tenancy - computed: false, optional: true, required: false + private _tenancy?: string; + public get tenancy() { + return this.getStringAttribute('tenancy'); + } + public set tenancy(value: string) { + this._tenancy = value; + } + public resetTenancy() { + this._tenancy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenancyInput() { + return this._tenancy; + } +} + +export class ComputeInstanceSchedulerHintsList extends cdktf.ComplexList { + public internalValue? : ComputeInstanceSchedulerHints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeInstanceSchedulerHintsOutputReference { + return new ComputeInstanceSchedulerHintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#create ComputeInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#delete ComputeInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#update ComputeInstance#update} + */ + readonly update?: string; +} + +export function computeInstanceTimeoutsToTerraform(struct?: ComputeInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function computeInstanceTimeoutsToHclTerraform(struct?: ComputeInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance huaweicloud_compute_instance} +*/ +export class ComputeInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeInstance to import + * @param importFromId The id of the existing ComputeInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_instance huaweicloud_compute_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeInstanceConfig + */ + public constructor(scope: Construct, id: string, config: ComputeInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._agencyName = config.agencyName; + this._agentList = config.agentList; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._autoTerminateTime = config.autoTerminateTime; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._deleteDisksOnTermination = config.deleteDisksOnTermination; + this._deleteEipOnTermination = config.deleteEipOnTermination; + this._description = config.description; + this._eipId = config.eipId; + this._eipType = config.eipType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._flavorName = config.flavorName; + this._hostname = config.hostname; + this._id = config.id; + this._imageId = config.imageId; + this._imageName = config.imageName; + this._keyPair = config.keyPair; + this._metadata = config.metadata; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._powerAction = config.powerAction; + this._privateKey = config.privateKey; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._securityGroups = config.securityGroups; + this._spotDuration = config.spotDuration; + this._spotDurationCount = config.spotDurationCount; + this._spotMaximumPrice = config.spotMaximumPrice; + this._stopBeforeDestroy = config.stopBeforeDestroy; + this._systemDiskDssPoolId = config.systemDiskDssPoolId; + this._systemDiskIops = config.systemDiskIops; + this._systemDiskKmsKeyId = config.systemDiskKmsKeyId; + this._systemDiskSize = config.systemDiskSize; + this._systemDiskThroughput = config.systemDiskThroughput; + this._systemDiskType = config.systemDiskType; + this._tags = config.tags; + this._userData = config.userData; + this._userId = config.userId; + this._bandwidth.internalValue = config.bandwidth; + this._dataDisks.internalValue = config.dataDisks; + this._network.internalValue = config.network; + this._schedulerHints.internalValue = config.schedulerHints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_ip_v4 - computed: true, optional: false, required: false + public get accessIpV4() { + return this.getStringAttribute('access_ip_v4'); + } + + // access_ip_v6 - computed: true, optional: false, required: false + public get accessIpV6() { + return this.getStringAttribute('access_ip_v6'); + } + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // agent_list - computed: true, optional: true, required: false + private _agentList?: string; + public get agentList() { + return this.getStringAttribute('agent_list'); + } + public set agentList(value: string) { + this._agentList = value; + } + public resetAgentList() { + this._agentList = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentListInput() { + return this._agentList; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // auto_terminate_time - computed: false, optional: true, required: false + private _autoTerminateTime?: string; + public get autoTerminateTime() { + return this.getStringAttribute('auto_terminate_time'); + } + public set autoTerminateTime(value: string) { + this._autoTerminateTime = value; + } + public resetAutoTerminateTime() { + this._autoTerminateTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoTerminateTimeInput() { + return this._autoTerminateTime; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delete_disks_on_termination - computed: false, optional: true, required: false + private _deleteDisksOnTermination?: boolean | cdktf.IResolvable; + public get deleteDisksOnTermination() { + return this.getBooleanAttribute('delete_disks_on_termination'); + } + public set deleteDisksOnTermination(value: boolean | cdktf.IResolvable) { + this._deleteDisksOnTermination = value; + } + public resetDeleteDisksOnTermination() { + this._deleteDisksOnTermination = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteDisksOnTerminationInput() { + return this._deleteDisksOnTermination; + } + + // delete_eip_on_termination - computed: false, optional: true, required: false + private _deleteEipOnTermination?: boolean | cdktf.IResolvable; + public get deleteEipOnTermination() { + return this.getBooleanAttribute('delete_eip_on_termination'); + } + public set deleteEipOnTermination(value: boolean | cdktf.IResolvable) { + this._deleteEipOnTermination = value; + } + public resetDeleteEipOnTermination() { + this._deleteEipOnTermination = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteEipOnTerminationInput() { + return this._deleteEipOnTermination; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // eip_type - computed: false, optional: true, required: false + private _eipType?: string; + public get eipType() { + return this.getStringAttribute('eip_type'); + } + public set eipType(value: string) { + this._eipType = value; + } + public resetEipType() { + this._eipType = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipTypeInput() { + return this._eipType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_time - computed: true, optional: false, required: false + public get expiredTime() { + return this.getStringAttribute('expired_time'); + } + + // flavor_id - computed: true, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: true, optional: true, required: false + private _flavorName?: string; + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + public set flavorName(value: string) { + this._flavorName = value; + } + public resetFlavorName() { + this._flavorName = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorNameInput() { + return this._flavorName; + } + + // hostname - computed: true, optional: true, required: false + private _hostname?: string; + public get hostname() { + return this.getStringAttribute('hostname'); + } + public set hostname(value: string) { + this._hostname = value; + } + public resetHostname() { + this._hostname = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostnameInput() { + return this._hostname; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: true, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_name - computed: true, optional: true, required: false + private _imageName?: string; + public get imageName() { + return this.getStringAttribute('image_name'); + } + public set imageName(value: string) { + this._imageName = value; + } + public resetImageName() { + this._imageName = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageNameInput() { + return this._imageName; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // power_action - computed: true, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // security_groups - computed: true, optional: true, required: false + private _securityGroups?: string[]; + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + public resetSecurityGroups() { + this._securityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // spot_duration - computed: false, optional: true, required: false + private _spotDuration?: number; + public get spotDuration() { + return this.getNumberAttribute('spot_duration'); + } + public set spotDuration(value: number) { + this._spotDuration = value; + } + public resetSpotDuration() { + this._spotDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotDurationInput() { + return this._spotDuration; + } + + // spot_duration_count - computed: true, optional: true, required: false + private _spotDurationCount?: number; + public get spotDurationCount() { + return this.getNumberAttribute('spot_duration_count'); + } + public set spotDurationCount(value: number) { + this._spotDurationCount = value; + } + public resetSpotDurationCount() { + this._spotDurationCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotDurationCountInput() { + return this._spotDurationCount; + } + + // spot_maximum_price - computed: false, optional: true, required: false + private _spotMaximumPrice?: string; + public get spotMaximumPrice() { + return this.getStringAttribute('spot_maximum_price'); + } + public set spotMaximumPrice(value: string) { + this._spotMaximumPrice = value; + } + public resetSpotMaximumPrice() { + this._spotMaximumPrice = undefined; + } + // Temporarily expose input value. Use with caution. + public get spotMaximumPriceInput() { + return this._spotMaximumPrice; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stop_before_destroy - computed: false, optional: true, required: false + private _stopBeforeDestroy?: boolean | cdktf.IResolvable; + public get stopBeforeDestroy() { + return this.getBooleanAttribute('stop_before_destroy'); + } + public set stopBeforeDestroy(value: boolean | cdktf.IResolvable) { + this._stopBeforeDestroy = value; + } + public resetStopBeforeDestroy() { + this._stopBeforeDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get stopBeforeDestroyInput() { + return this._stopBeforeDestroy; + } + + // system_disk_dss_pool_id - computed: false, optional: true, required: false + private _systemDiskDssPoolId?: string; + public get systemDiskDssPoolId() { + return this.getStringAttribute('system_disk_dss_pool_id'); + } + public set systemDiskDssPoolId(value: string) { + this._systemDiskDssPoolId = value; + } + public resetSystemDiskDssPoolId() { + this._systemDiskDssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskDssPoolIdInput() { + return this._systemDiskDssPoolId; + } + + // system_disk_id - computed: true, optional: false, required: false + public get systemDiskId() { + return this.getStringAttribute('system_disk_id'); + } + + // system_disk_iops - computed: true, optional: true, required: false + private _systemDiskIops?: number; + public get systemDiskIops() { + return this.getNumberAttribute('system_disk_iops'); + } + public set systemDiskIops(value: number) { + this._systemDiskIops = value; + } + public resetSystemDiskIops() { + this._systemDiskIops = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskIopsInput() { + return this._systemDiskIops; + } + + // system_disk_kms_key_id - computed: true, optional: true, required: false + private _systemDiskKmsKeyId?: string; + public get systemDiskKmsKeyId() { + return this.getStringAttribute('system_disk_kms_key_id'); + } + public set systemDiskKmsKeyId(value: string) { + this._systemDiskKmsKeyId = value; + } + public resetSystemDiskKmsKeyId() { + this._systemDiskKmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskKmsKeyIdInput() { + return this._systemDiskKmsKeyId; + } + + // system_disk_size - computed: true, optional: true, required: false + private _systemDiskSize?: number; + public get systemDiskSize() { + return this.getNumberAttribute('system_disk_size'); + } + public set systemDiskSize(value: number) { + this._systemDiskSize = value; + } + public resetSystemDiskSize() { + this._systemDiskSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskSizeInput() { + return this._systemDiskSize; + } + + // system_disk_throughput - computed: true, optional: true, required: false + private _systemDiskThroughput?: number; + public get systemDiskThroughput() { + return this.getNumberAttribute('system_disk_throughput'); + } + public set systemDiskThroughput(value: number) { + this._systemDiskThroughput = value; + } + public resetSystemDiskThroughput() { + this._systemDiskThroughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskThroughputInput() { + return this._systemDiskThroughput; + } + + // system_disk_type - computed: true, optional: true, required: false + private _systemDiskType?: string; + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + public set systemDiskType(value: string) { + this._systemDiskType = value; + } + public resetSystemDiskType() { + this._systemDiskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskTypeInput() { + return this._systemDiskType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // user_id - computed: false, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // volume_attached - computed: true, optional: false, required: false + private _volumeAttached = new ComputeInstanceVolumeAttachedList(this, "volume_attached", false); + public get volumeAttached() { + return this._volumeAttached; + } + + // bandwidth - computed: false, optional: true, required: false + private _bandwidth = new ComputeInstanceBandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: ComputeInstanceBandwidth) { + this._bandwidth.internalValue = value; + } + public resetBandwidth() { + this._bandwidth.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } + + // data_disks - computed: false, optional: true, required: false + private _dataDisks = new ComputeInstanceDataDisksList(this, "data_disks", false); + public get dataDisks() { + return this._dataDisks; + } + public putDataDisks(value: ComputeInstanceDataDisks[] | cdktf.IResolvable) { + this._dataDisks.internalValue = value; + } + public resetDataDisks() { + this._dataDisks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDisksInput() { + return this._dataDisks.internalValue; + } + + // network - computed: false, optional: false, required: true + private _network = new ComputeInstanceNetworkList(this, "network", false); + public get network() { + return this._network; + } + public putNetwork(value: ComputeInstanceNetwork[] | cdktf.IResolvable) { + this._network.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get networkInput() { + return this._network.internalValue; + } + + // scheduler_hints - computed: false, optional: true, required: false + private _schedulerHints = new ComputeInstanceSchedulerHintsList(this, "scheduler_hints", true); + public get schedulerHints() { + return this._schedulerHints; + } + public putSchedulerHints(value: ComputeInstanceSchedulerHints[] | cdktf.IResolvable) { + this._schedulerHints.internalValue = value; + } + public resetSchedulerHints() { + this._schedulerHints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerHintsInput() { + return this._schedulerHints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + agency_name: cdktf.stringToTerraform(this._agencyName), + agent_list: cdktf.stringToTerraform(this._agentList), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + auto_terminate_time: cdktf.stringToTerraform(this._autoTerminateTime), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + delete_disks_on_termination: cdktf.booleanToTerraform(this._deleteDisksOnTermination), + delete_eip_on_termination: cdktf.booleanToTerraform(this._deleteEipOnTermination), + description: cdktf.stringToTerraform(this._description), + eip_id: cdktf.stringToTerraform(this._eipId), + eip_type: cdktf.stringToTerraform(this._eipType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + flavor_name: cdktf.stringToTerraform(this._flavorName), + hostname: cdktf.stringToTerraform(this._hostname), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_name: cdktf.stringToTerraform(this._imageName), + key_pair: cdktf.stringToTerraform(this._keyPair), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + power_action: cdktf.stringToTerraform(this._powerAction), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + spot_duration: cdktf.numberToTerraform(this._spotDuration), + spot_duration_count: cdktf.numberToTerraform(this._spotDurationCount), + spot_maximum_price: cdktf.stringToTerraform(this._spotMaximumPrice), + stop_before_destroy: cdktf.booleanToTerraform(this._stopBeforeDestroy), + system_disk_dss_pool_id: cdktf.stringToTerraform(this._systemDiskDssPoolId), + system_disk_iops: cdktf.numberToTerraform(this._systemDiskIops), + system_disk_kms_key_id: cdktf.stringToTerraform(this._systemDiskKmsKeyId), + system_disk_size: cdktf.numberToTerraform(this._systemDiskSize), + system_disk_throughput: cdktf.numberToTerraform(this._systemDiskThroughput), + system_disk_type: cdktf.stringToTerraform(this._systemDiskType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_data: cdktf.stringToTerraform(this._userData), + user_id: cdktf.stringToTerraform(this._userId), + bandwidth: computeInstanceBandwidthToTerraform(this._bandwidth.internalValue), + data_disks: cdktf.listMapper(computeInstanceDataDisksToTerraform, true)(this._dataDisks.internalValue), + network: cdktf.listMapper(computeInstanceNetworkToTerraform, true)(this._network.internalValue), + scheduler_hints: cdktf.listMapper(computeInstanceSchedulerHintsToTerraform, true)(this._schedulerHints.internalValue), + timeouts: computeInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agent_list: { + value: cdktf.stringToHclTerraform(this._agentList), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_terminate_time: { + value: cdktf.stringToHclTerraform(this._autoTerminateTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_disks_on_termination: { + value: cdktf.booleanToHclTerraform(this._deleteDisksOnTermination), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delete_eip_on_termination: { + value: cdktf.booleanToHclTerraform(this._deleteEipOnTermination), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_type: { + value: cdktf.stringToHclTerraform(this._eipType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_name: { + value: cdktf.stringToHclTerraform(this._flavorName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hostname: { + value: cdktf.stringToHclTerraform(this._hostname), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_name: { + value: cdktf.stringToHclTerraform(this._imageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + spot_duration: { + value: cdktf.numberToHclTerraform(this._spotDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spot_duration_count: { + value: cdktf.numberToHclTerraform(this._spotDurationCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spot_maximum_price: { + value: cdktf.stringToHclTerraform(this._spotMaximumPrice), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stop_before_destroy: { + value: cdktf.booleanToHclTerraform(this._stopBeforeDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + system_disk_dss_pool_id: { + value: cdktf.stringToHclTerraform(this._systemDiskDssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_iops: { + value: cdktf.numberToHclTerraform(this._systemDiskIops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_kms_key_id: { + value: cdktf.stringToHclTerraform(this._systemDiskKmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_size: { + value: cdktf.numberToHclTerraform(this._systemDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_throughput: { + value: cdktf.numberToHclTerraform(this._systemDiskThroughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_type: { + value: cdktf.stringToHclTerraform(this._systemDiskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth: { + value: computeInstanceBandwidthToHclTerraform(this._bandwidth.internalValue), + isBlock: true, + type: "list", + storageClassType: "ComputeInstanceBandwidthList", + }, + data_disks: { + value: cdktf.listMapperHcl(computeInstanceDataDisksToHclTerraform, true)(this._dataDisks.internalValue), + isBlock: true, + type: "list", + storageClassType: "ComputeInstanceDataDisksList", + }, + network: { + value: cdktf.listMapperHcl(computeInstanceNetworkToHclTerraform, true)(this._network.internalValue), + isBlock: true, + type: "list", + storageClassType: "ComputeInstanceNetworkList", + }, + scheduler_hints: { + value: cdktf.listMapperHcl(computeInstanceSchedulerHintsToHclTerraform, true)(this._schedulerHints.internalValue), + isBlock: true, + type: "set", + storageClassType: "ComputeInstanceSchedulerHintsList", + }, + timeouts: { + value: computeInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-interface-attach-v2/README.md b/src/constructs/providers/huaweicloud/compute-interface-attach-v2/README.md new file mode 100644 index 00000000..9aaf157b --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-interface-attach-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_interface_attach_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_interface_attach_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2). diff --git a/src/constructs/providers/huaweicloud/compute-interface-attach-v2/index.ts b/src/constructs/providers/huaweicloud/compute-interface-attach-v2/index.ts new file mode 100644 index 00000000..6819ad00 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-interface-attach-v2/index.ts @@ -0,0 +1,532 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeInterfaceAttachV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#fixed_ip ComputeInterfaceAttachV2#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#id ComputeInterfaceAttachV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#instance_id ComputeInterfaceAttachV2#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#ipv6_bandwidth_id ComputeInterfaceAttachV2#ipv6_bandwidth_id} + */ + readonly ipv6BandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#ipv6_enable ComputeInterfaceAttachV2#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#network_id ComputeInterfaceAttachV2#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#port_id ComputeInterfaceAttachV2#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#region ComputeInterfaceAttachV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#security_group_ids ComputeInterfaceAttachV2#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#source_dest_check ComputeInterfaceAttachV2#source_dest_check} + */ + readonly sourceDestCheck?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#timeouts ComputeInterfaceAttachV2#timeouts} + */ + readonly timeouts?: ComputeInterfaceAttachV2Timeouts; +} +export interface ComputeInterfaceAttachV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#create ComputeInterfaceAttachV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#delete ComputeInterfaceAttachV2#delete} + */ + readonly delete?: string; +} + +export function computeInterfaceAttachV2TimeoutsToTerraform(struct?: ComputeInterfaceAttachV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function computeInterfaceAttachV2TimeoutsToHclTerraform(struct?: ComputeInterfaceAttachV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInterfaceAttachV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeInterfaceAttachV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInterfaceAttachV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2 huaweicloud_compute_interface_attach_v2} +*/ +export class ComputeInterfaceAttachV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_interface_attach_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeInterfaceAttachV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeInterfaceAttachV2 to import + * @param importFromId The id of the existing ComputeInterfaceAttachV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeInterfaceAttachV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_interface_attach_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach_v2 huaweicloud_compute_interface_attach_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeInterfaceAttachV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeInterfaceAttachV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_interface_attach_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fixedIp = config.fixedIp; + this._id = config.id; + this._instanceId = config.instanceId; + this._ipv6BandwidthId = config.ipv6BandwidthId; + this._ipv6Enable = config.ipv6Enable; + this._networkId = config.networkId; + this._portId = config.portId; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._sourceDestCheck = config.sourceDestCheck; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // fixed_ipv6 - computed: true, optional: false, required: false + public get fixedIpv6() { + return this.getStringAttribute('fixed_ipv6'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ipv6_bandwidth_id - computed: false, optional: true, required: false + private _ipv6BandwidthId?: string; + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + public set ipv6BandwidthId(value: string) { + this._ipv6BandwidthId = value; + } + public resetIpv6BandwidthId() { + this._ipv6BandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6BandwidthIdInput() { + return this._ipv6BandwidthId; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // source_dest_check - computed: false, optional: true, required: false + private _sourceDestCheck?: boolean | cdktf.IResolvable; + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } + public set sourceDestCheck(value: boolean | cdktf.IResolvable) { + this._sourceDestCheck = value; + } + public resetSourceDestCheck() { + this._sourceDestCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceDestCheckInput() { + return this._sourceDestCheck; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeInterfaceAttachV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeInterfaceAttachV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + ipv6_bandwidth_id: cdktf.stringToTerraform(this._ipv6BandwidthId), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + network_id: cdktf.stringToTerraform(this._networkId), + port_id: cdktf.stringToTerraform(this._portId), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + source_dest_check: cdktf.booleanToTerraform(this._sourceDestCheck), + timeouts: computeInterfaceAttachV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._ipv6BandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + source_dest_check: { + value: cdktf.booleanToHclTerraform(this._sourceDestCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: computeInterfaceAttachV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeInterfaceAttachV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-interface-attach/README.md b/src/constructs/providers/huaweicloud/compute-interface-attach/README.md new file mode 100644 index 00000000..440f19e6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-interface-attach/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_interface_attach` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_interface_attach`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach). diff --git a/src/constructs/providers/huaweicloud/compute-interface-attach/index.ts b/src/constructs/providers/huaweicloud/compute-interface-attach/index.ts new file mode 100644 index 00000000..f35e4f59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-interface-attach/index.ts @@ -0,0 +1,532 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeInterfaceAttachConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#fixed_ip ComputeInterfaceAttach#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#id ComputeInterfaceAttach#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#instance_id ComputeInterfaceAttach#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#ipv6_bandwidth_id ComputeInterfaceAttach#ipv6_bandwidth_id} + */ + readonly ipv6BandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#ipv6_enable ComputeInterfaceAttach#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#network_id ComputeInterfaceAttach#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#port_id ComputeInterfaceAttach#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#region ComputeInterfaceAttach#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#security_group_ids ComputeInterfaceAttach#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#source_dest_check ComputeInterfaceAttach#source_dest_check} + */ + readonly sourceDestCheck?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#timeouts ComputeInterfaceAttach#timeouts} + */ + readonly timeouts?: ComputeInterfaceAttachTimeouts; +} +export interface ComputeInterfaceAttachTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#create ComputeInterfaceAttach#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#delete ComputeInterfaceAttach#delete} + */ + readonly delete?: string; +} + +export function computeInterfaceAttachTimeoutsToTerraform(struct?: ComputeInterfaceAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function computeInterfaceAttachTimeoutsToHclTerraform(struct?: ComputeInterfaceAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeInterfaceAttachTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeInterfaceAttachTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeInterfaceAttachTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach huaweicloud_compute_interface_attach} +*/ +export class ComputeInterfaceAttach extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_interface_attach"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeInterfaceAttach resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeInterfaceAttach to import + * @param importFromId The id of the existing ComputeInterfaceAttach that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeInterfaceAttach to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_interface_attach", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_interface_attach huaweicloud_compute_interface_attach} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeInterfaceAttachConfig + */ + public constructor(scope: Construct, id: string, config: ComputeInterfaceAttachConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_interface_attach', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fixedIp = config.fixedIp; + this._id = config.id; + this._instanceId = config.instanceId; + this._ipv6BandwidthId = config.ipv6BandwidthId; + this._ipv6Enable = config.ipv6Enable; + this._networkId = config.networkId; + this._portId = config.portId; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._sourceDestCheck = config.sourceDestCheck; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // fixed_ipv6 - computed: true, optional: false, required: false + public get fixedIpv6() { + return this.getStringAttribute('fixed_ipv6'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ipv6_bandwidth_id - computed: false, optional: true, required: false + private _ipv6BandwidthId?: string; + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + public set ipv6BandwidthId(value: string) { + this._ipv6BandwidthId = value; + } + public resetIpv6BandwidthId() { + this._ipv6BandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6BandwidthIdInput() { + return this._ipv6BandwidthId; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // source_dest_check - computed: false, optional: true, required: false + private _sourceDestCheck?: boolean | cdktf.IResolvable; + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } + public set sourceDestCheck(value: boolean | cdktf.IResolvable) { + this._sourceDestCheck = value; + } + public resetSourceDestCheck() { + this._sourceDestCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceDestCheckInput() { + return this._sourceDestCheck; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeInterfaceAttachTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeInterfaceAttachTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + ipv6_bandwidth_id: cdktf.stringToTerraform(this._ipv6BandwidthId), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + network_id: cdktf.stringToTerraform(this._networkId), + port_id: cdktf.stringToTerraform(this._portId), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + source_dest_check: cdktf.booleanToTerraform(this._sourceDestCheck), + timeouts: computeInterfaceAttachTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._ipv6BandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + source_dest_check: { + value: cdktf.booleanToHclTerraform(this._sourceDestCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: computeInterfaceAttachTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeInterfaceAttachTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-keypair-v2/README.md b/src/constructs/providers/huaweicloud/compute-keypair-v2/README.md new file mode 100644 index 00000000..81c770dd --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-keypair-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_keypair_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_keypair_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2). diff --git a/src/constructs/providers/huaweicloud/compute-keypair-v2/index.ts b/src/constructs/providers/huaweicloud/compute-keypair-v2/index.ts new file mode 100644 index 00000000..13b5a47e --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-keypair-v2/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeKeypairV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2#id ComputeKeypairV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2#key_file ComputeKeypairV2#key_file} + */ + readonly keyFile?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2#name ComputeKeypairV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2#public_key ComputeKeypairV2#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2#region ComputeKeypairV2#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2 huaweicloud_compute_keypair_v2} +*/ +export class ComputeKeypairV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_keypair_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeKeypairV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeKeypairV2 to import + * @param importFromId The id of the existing ComputeKeypairV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeKeypairV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_keypair_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair_v2 huaweicloud_compute_keypair_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeKeypairV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeKeypairV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_keypair_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._keyFile = config.keyFile; + this._name = config.name; + this._publicKey = config.publicKey; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_file - computed: true, optional: true, required: false + private _keyFile?: string; + public get keyFile() { + return this.getStringAttribute('key_file'); + } + public set keyFile(value: string) { + this._keyFile = value; + } + public resetKeyFile() { + this._keyFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyFileInput() { + return this._keyFile; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // public_key - computed: true, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + key_file: cdktf.stringToTerraform(this._keyFile), + name: cdktf.stringToTerraform(this._name), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_file: { + value: cdktf.stringToHclTerraform(this._keyFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-keypair/README.md b/src/constructs/providers/huaweicloud/compute-keypair/README.md new file mode 100644 index 00000000..aaab8f9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-keypair/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_keypair` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_keypair`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair). diff --git a/src/constructs/providers/huaweicloud/compute-keypair/index.ts b/src/constructs/providers/huaweicloud/compute-keypair/index.ts new file mode 100644 index 00000000..eb5aaf56 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-keypair/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeKeypairConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair#id ComputeKeypair#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair#key_file ComputeKeypair#key_file} + */ + readonly keyFile?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair#name ComputeKeypair#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair#public_key ComputeKeypair#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair#region ComputeKeypair#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair huaweicloud_compute_keypair} +*/ +export class ComputeKeypair extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_keypair"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeKeypair resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeKeypair to import + * @param importFromId The id of the existing ComputeKeypair that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeKeypair to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_keypair", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_keypair huaweicloud_compute_keypair} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeKeypairConfig + */ + public constructor(scope: Construct, id: string, config: ComputeKeypairConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_keypair', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._keyFile = config.keyFile; + this._name = config.name; + this._publicKey = config.publicKey; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_file - computed: true, optional: true, required: false + private _keyFile?: string; + public get keyFile() { + return this.getStringAttribute('key_file'); + } + public set keyFile(value: string) { + this._keyFile = value; + } + public resetKeyFile() { + this._keyFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyFileInput() { + return this._keyFile; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // public_key - computed: true, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + key_file: cdktf.stringToTerraform(this._keyFile), + name: cdktf.stringToTerraform(this._name), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_file: { + value: cdktf.stringToHclTerraform(this._keyFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-secgroup-v2/README.md b/src/constructs/providers/huaweicloud/compute-secgroup-v2/README.md new file mode 100644 index 00000000..e7c637f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-secgroup-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_secgroup_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_secgroup_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2). diff --git a/src/constructs/providers/huaweicloud/compute-secgroup-v2/index.ts b/src/constructs/providers/huaweicloud/compute-secgroup-v2/index.ts new file mode 100644 index 00000000..3c03b75d --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-secgroup-v2/index.ts @@ -0,0 +1,625 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeSecgroupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#description ComputeSecgroupV2#description} + */ + readonly description: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#id ComputeSecgroupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#name ComputeSecgroupV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#region ComputeSecgroupV2#region} + */ + readonly region?: string; + /** + * rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#rule ComputeSecgroupV2#rule} + */ + readonly rule?: ComputeSecgroupV2Rule[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#timeouts ComputeSecgroupV2#timeouts} + */ + readonly timeouts?: ComputeSecgroupV2Timeouts; +} +export interface ComputeSecgroupV2Rule { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#cidr ComputeSecgroupV2#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#from_group_id ComputeSecgroupV2#from_group_id} + */ + readonly fromGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#from_port ComputeSecgroupV2#from_port} + */ + readonly fromPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#ip_protocol ComputeSecgroupV2#ip_protocol} + */ + readonly ipProtocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#self ComputeSecgroupV2#self} + */ + readonly selfAttribute?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#to_port ComputeSecgroupV2#to_port} + */ + readonly toPort: number; +} + +export function computeSecgroupV2RuleToTerraform(struct?: ComputeSecgroupV2Rule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cidr: cdktf.stringToTerraform(struct!.cidr), + from_group_id: cdktf.stringToTerraform(struct!.fromGroupId), + from_port: cdktf.numberToTerraform(struct!.fromPort), + ip_protocol: cdktf.stringToTerraform(struct!.ipProtocol), + self: cdktf.booleanToTerraform(struct!.selfAttribute), + to_port: cdktf.numberToTerraform(struct!.toPort), + } +} + + +export function computeSecgroupV2RuleToHclTerraform(struct?: ComputeSecgroupV2Rule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(struct!.cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + from_group_id: { + value: cdktf.stringToHclTerraform(struct!.fromGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + from_port: { + value: cdktf.numberToHclTerraform(struct!.fromPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ip_protocol: { + value: cdktf.stringToHclTerraform(struct!.ipProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + self: { + value: cdktf.booleanToHclTerraform(struct!.selfAttribute), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + to_port: { + value: cdktf.numberToHclTerraform(struct!.toPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeSecgroupV2RuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ComputeSecgroupV2Rule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cidr !== undefined) { + hasAnyValues = true; + internalValueResult.cidr = this._cidr; + } + if (this._fromGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.fromGroupId = this._fromGroupId; + } + if (this._fromPort !== undefined) { + hasAnyValues = true; + internalValueResult.fromPort = this._fromPort; + } + if (this._ipProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.ipProtocol = this._ipProtocol; + } + if (this._self !== undefined) { + hasAnyValues = true; + internalValueResult.selfAttribute = this._self; + } + if (this._toPort !== undefined) { + hasAnyValues = true; + internalValueResult.toPort = this._toPort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeSecgroupV2Rule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cidr = undefined; + this._fromGroupId = undefined; + this._fromPort = undefined; + this._ipProtocol = undefined; + this._self = undefined; + this._toPort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cidr = value.cidr; + this._fromGroupId = value.fromGroupId; + this._fromPort = value.fromPort; + this._ipProtocol = value.ipProtocol; + this._self = value.selfAttribute; + this._toPort = value.toPort; + } + } + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // from_group_id - computed: false, optional: true, required: false + private _fromGroupId?: string; + public get fromGroupId() { + return this.getStringAttribute('from_group_id'); + } + public set fromGroupId(value: string) { + this._fromGroupId = value; + } + public resetFromGroupId() { + this._fromGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromGroupIdInput() { + return this._fromGroupId; + } + + // from_port - computed: false, optional: false, required: true + private _fromPort?: number; + public get fromPort() { + return this.getNumberAttribute('from_port'); + } + public set fromPort(value: number) { + this._fromPort = value; + } + // Temporarily expose input value. Use with caution. + public get fromPortInput() { + return this._fromPort; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_protocol - computed: false, optional: false, required: true + private _ipProtocol?: string; + public get ipProtocol() { + return this.getStringAttribute('ip_protocol'); + } + public set ipProtocol(value: string) { + this._ipProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get ipProtocolInput() { + return this._ipProtocol; + } + + // self - computed: false, optional: true, required: false + private _self?: boolean | cdktf.IResolvable; + public get selfAttribute() { + return this.getBooleanAttribute('self'); + } + public set selfAttribute(value: boolean | cdktf.IResolvable) { + this._self = value; + } + public resetSelfAttribute() { + this._self = undefined; + } + // Temporarily expose input value. Use with caution. + public get selfAttributeInput() { + return this._self; + } + + // to_port - computed: false, optional: false, required: true + private _toPort?: number; + public get toPort() { + return this.getNumberAttribute('to_port'); + } + public set toPort(value: number) { + this._toPort = value; + } + // Temporarily expose input value. Use with caution. + public get toPortInput() { + return this._toPort; + } +} + +export class ComputeSecgroupV2RuleList extends cdktf.ComplexList { + public internalValue? : ComputeSecgroupV2Rule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ComputeSecgroupV2RuleOutputReference { + return new ComputeSecgroupV2RuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ComputeSecgroupV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#delete ComputeSecgroupV2#delete} + */ + readonly delete?: string; +} + +export function computeSecgroupV2TimeoutsToTerraform(struct?: ComputeSecgroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function computeSecgroupV2TimeoutsToHclTerraform(struct?: ComputeSecgroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeSecgroupV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeSecgroupV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeSecgroupV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2 huaweicloud_compute_secgroup_v2} +*/ +export class ComputeSecgroupV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_secgroup_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeSecgroupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeSecgroupV2 to import + * @param importFromId The id of the existing ComputeSecgroupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeSecgroupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_secgroup_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_secgroup_v2 huaweicloud_compute_secgroup_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeSecgroupV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeSecgroupV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_secgroup_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._rule.internalValue = config.rule; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule - computed: false, optional: true, required: false + private _rule = new ComputeSecgroupV2RuleList(this, "rule", true); + public get rule() { + return this._rule; + } + public putRule(value: ComputeSecgroupV2Rule[] | cdktf.IResolvable) { + this._rule.internalValue = value; + } + public resetRule() { + this._rule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleInput() { + return this._rule.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeSecgroupV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeSecgroupV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rule: cdktf.listMapper(computeSecgroupV2RuleToTerraform, true)(this._rule.internalValue), + timeouts: computeSecgroupV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule: { + value: cdktf.listMapperHcl(computeSecgroupV2RuleToHclTerraform, true)(this._rule.internalValue), + isBlock: true, + type: "set", + storageClassType: "ComputeSecgroupV2RuleList", + }, + timeouts: { + value: computeSecgroupV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeSecgroupV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-servergroup-v2/README.md b/src/constructs/providers/huaweicloud/compute-servergroup-v2/README.md new file mode 100644 index 00000000..53e1a3e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-servergroup-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_servergroup_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_servergroup_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2). diff --git a/src/constructs/providers/huaweicloud/compute-servergroup-v2/index.ts b/src/constructs/providers/huaweicloud/compute-servergroup-v2/index.ts new file mode 100644 index 00000000..884da41b --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-servergroup-v2/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeServergroupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2#id ComputeServergroupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2#members ComputeServergroupV2#members} + */ + readonly members?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2#name ComputeServergroupV2#name} + */ + readonly name: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2#policies ComputeServergroupV2#policies} + */ + readonly policies?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2#region ComputeServergroupV2#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2 huaweicloud_compute_servergroup_v2} +*/ +export class ComputeServergroupV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_servergroup_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeServergroupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeServergroupV2 to import + * @param importFromId The id of the existing ComputeServergroupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeServergroupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_servergroup_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup_v2 huaweicloud_compute_servergroup_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeServergroupV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeServergroupV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_servergroup_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._members = config.members; + this._name = config.name; + this._policies = config.policies; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // fault_domains - computed: true, optional: false, required: false + public get faultDomains() { + return this.getListAttribute('fault_domains'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // members - computed: true, optional: true, required: false + private _members?: string[]; + public get members() { + return cdktf.Fn.tolist(this.getListAttribute('members')); + } + public set members(value: string[]) { + this._members = value; + } + public resetMembers() { + this._members = undefined; + } + // Temporarily expose input value. Use with caution. + public get membersInput() { + return this._members; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: false, optional: true, required: false + private _policies?: string[]; + public get policies() { + return this.getListAttribute('policies'); + } + public set policies(value: string[]) { + this._policies = value; + } + public resetPolicies() { + this._policies = undefined; + } + // Temporarily expose input value. Use with caution. + public get policiesInput() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + members: cdktf.listMapper(cdktf.stringToTerraform, false)(this._members), + name: cdktf.stringToTerraform(this._name), + policies: cdktf.listMapper(cdktf.stringToTerraform, false)(this._policies), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + members: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._members), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policies: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._policies), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-servergroup/README.md b/src/constructs/providers/huaweicloud/compute-servergroup/README.md new file mode 100644 index 00000000..20f5bd44 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-servergroup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_servergroup` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_servergroup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup). diff --git a/src/constructs/providers/huaweicloud/compute-servergroup/index.ts b/src/constructs/providers/huaweicloud/compute-servergroup/index.ts new file mode 100644 index 00000000..f6b2abb8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-servergroup/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeServergroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup#id ComputeServergroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup#members ComputeServergroup#members} + */ + readonly members?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup#name ComputeServergroup#name} + */ + readonly name: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup#policies ComputeServergroup#policies} + */ + readonly policies?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup#region ComputeServergroup#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup huaweicloud_compute_servergroup} +*/ +export class ComputeServergroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_servergroup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeServergroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeServergroup to import + * @param importFromId The id of the existing ComputeServergroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeServergroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_servergroup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_servergroup huaweicloud_compute_servergroup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeServergroupConfig + */ + public constructor(scope: Construct, id: string, config: ComputeServergroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_servergroup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._members = config.members; + this._name = config.name; + this._policies = config.policies; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // fault_domains - computed: true, optional: false, required: false + public get faultDomains() { + return this.getListAttribute('fault_domains'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // members - computed: true, optional: true, required: false + private _members?: string[]; + public get members() { + return cdktf.Fn.tolist(this.getListAttribute('members')); + } + public set members(value: string[]) { + this._members = value; + } + public resetMembers() { + this._members = undefined; + } + // Temporarily expose input value. Use with caution. + public get membersInput() { + return this._members; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: false, optional: true, required: false + private _policies?: string[]; + public get policies() { + return this.getListAttribute('policies'); + } + public set policies(value: string[]) { + this._policies = value; + } + public resetPolicies() { + this._policies = undefined; + } + // Temporarily expose input value. Use with caution. + public get policiesInput() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + members: cdktf.listMapper(cdktf.stringToTerraform, false)(this._members), + name: cdktf.stringToTerraform(this._name), + policies: cdktf.listMapper(cdktf.stringToTerraform, false)(this._policies), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + members: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._members), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policies: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._policies), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-volume-attach-v2/README.md b/src/constructs/providers/huaweicloud/compute-volume-attach-v2/README.md new file mode 100644 index 00000000..5630c921 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-volume-attach-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_volume_attach_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_volume_attach_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2). diff --git a/src/constructs/providers/huaweicloud/compute-volume-attach-v2/index.ts b/src/constructs/providers/huaweicloud/compute-volume-attach-v2/index.ts new file mode 100644 index 00000000..3d9e836a --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-volume-attach-v2/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeVolumeAttachV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#device ComputeVolumeAttachV2#device} + */ + readonly device?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#id ComputeVolumeAttachV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#instance_id ComputeVolumeAttachV2#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#region ComputeVolumeAttachV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#volume_id ComputeVolumeAttachV2#volume_id} + */ + readonly volumeId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#timeouts ComputeVolumeAttachV2#timeouts} + */ + readonly timeouts?: ComputeVolumeAttachV2Timeouts; +} +export interface ComputeVolumeAttachV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#create ComputeVolumeAttachV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#delete ComputeVolumeAttachV2#delete} + */ + readonly delete?: string; +} + +export function computeVolumeAttachV2TimeoutsToTerraform(struct?: ComputeVolumeAttachV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function computeVolumeAttachV2TimeoutsToHclTerraform(struct?: ComputeVolumeAttachV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeVolumeAttachV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeVolumeAttachV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeVolumeAttachV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2 huaweicloud_compute_volume_attach_v2} +*/ +export class ComputeVolumeAttachV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_volume_attach_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeVolumeAttachV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeVolumeAttachV2 to import + * @param importFromId The id of the existing ComputeVolumeAttachV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeVolumeAttachV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_volume_attach_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach_v2 huaweicloud_compute_volume_attach_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeVolumeAttachV2Config + */ + public constructor(scope: Construct, id: string, config: ComputeVolumeAttachV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_volume_attach_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._device = config.device; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // device - computed: true, optional: true, required: false + private _device?: string; + public get device() { + return this.getStringAttribute('device'); + } + public set device(value: string) { + this._device = value; + } + public resetDevice() { + this._device = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceInput() { + return this._device; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // pci_address - computed: true, optional: false, required: false + public get pciAddress() { + return this.getStringAttribute('pci_address'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeVolumeAttachV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeVolumeAttachV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device: cdktf.stringToTerraform(this._device), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: computeVolumeAttachV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device: { + value: cdktf.stringToHclTerraform(this._device), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: computeVolumeAttachV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeVolumeAttachV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/compute-volume-attach/README.md b/src/constructs/providers/huaweicloud/compute-volume-attach/README.md new file mode 100644 index 00000000..55b26bb3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-volume-attach/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_compute_volume_attach` + +Refer to the Terraform Registry for docs: [`huaweicloud_compute_volume_attach`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach). diff --git a/src/constructs/providers/huaweicloud/compute-volume-attach/index.ts b/src/constructs/providers/huaweicloud/compute-volume-attach/index.ts new file mode 100644 index 00000000..92938997 --- /dev/null +++ b/src/constructs/providers/huaweicloud/compute-volume-attach/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ComputeVolumeAttachConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#device ComputeVolumeAttach#device} + */ + readonly device?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#id ComputeVolumeAttach#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#instance_id ComputeVolumeAttach#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#region ComputeVolumeAttach#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#volume_id ComputeVolumeAttach#volume_id} + */ + readonly volumeId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#timeouts ComputeVolumeAttach#timeouts} + */ + readonly timeouts?: ComputeVolumeAttachTimeouts; +} +export interface ComputeVolumeAttachTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#create ComputeVolumeAttach#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#delete ComputeVolumeAttach#delete} + */ + readonly delete?: string; +} + +export function computeVolumeAttachTimeoutsToTerraform(struct?: ComputeVolumeAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function computeVolumeAttachTimeoutsToHclTerraform(struct?: ComputeVolumeAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ComputeVolumeAttachTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ComputeVolumeAttachTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ComputeVolumeAttachTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach huaweicloud_compute_volume_attach} +*/ +export class ComputeVolumeAttach extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_volume_attach"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ComputeVolumeAttach resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ComputeVolumeAttach to import + * @param importFromId The id of the existing ComputeVolumeAttach that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ComputeVolumeAttach to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_volume_attach", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/compute_volume_attach huaweicloud_compute_volume_attach} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ComputeVolumeAttachConfig + */ + public constructor(scope: Construct, id: string, config: ComputeVolumeAttachConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_volume_attach', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._device = config.device; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // device - computed: true, optional: true, required: false + private _device?: string; + public get device() { + return this.getStringAttribute('device'); + } + public set device(value: string) { + this._device = value; + } + public resetDevice() { + this._device = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceInput() { + return this._device; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // pci_address - computed: true, optional: false, required: false + public get pciAddress() { + return this.getStringAttribute('pci_address'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ComputeVolumeAttachTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ComputeVolumeAttachTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device: cdktf.stringToTerraform(this._device), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: computeVolumeAttachTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device: { + value: cdktf.stringToHclTerraform(this._device), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: computeVolumeAttachTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ComputeVolumeAttachTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-adb-command/README.md b/src/constructs/providers/huaweicloud/cph-adb-command/README.md new file mode 100644 index 00000000..85548f9a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-adb-command/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_adb_command` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_adb_command`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command). diff --git a/src/constructs/providers/huaweicloud/cph-adb-command/index.ts b/src/constructs/providers/huaweicloud/cph-adb-command/index.ts new file mode 100644 index 00000000..f2e4e434 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-adb-command/index.ts @@ -0,0 +1,410 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphAdbCommandConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ADB command. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#command CphAdbCommand#command} + */ + readonly command: string; + /** + * Specifies the content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#content CphAdbCommand#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#enable_force_new CphAdbCommand#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#id CphAdbCommand#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IDs of the CPH phone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#phone_ids CphAdbCommand#phone_ids} + */ + readonly phoneIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#region CphAdbCommand#region} + */ + readonly region?: string; + /** + * Specifies the IDs of CPH server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#server_ids CphAdbCommand#server_ids} + */ + readonly serverIds?: string[]; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#timeouts CphAdbCommand#timeouts} + */ + readonly timeouts?: CphAdbCommandTimeouts; +} +export interface CphAdbCommandTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#create CphAdbCommand#create} + */ + readonly create?: string; +} + +export function cphAdbCommandTimeoutsToTerraform(struct?: CphAdbCommandTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cphAdbCommandTimeoutsToHclTerraform(struct?: CphAdbCommandTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphAdbCommandTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphAdbCommandTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphAdbCommandTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command huaweicloud_cph_adb_command} +*/ +export class CphAdbCommand extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_adb_command"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphAdbCommand resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphAdbCommand to import + * @param importFromId The id of the existing CphAdbCommand that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphAdbCommand to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_adb_command", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_adb_command huaweicloud_cph_adb_command} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphAdbCommandConfig + */ + public constructor(scope: Construct, id: string, config: CphAdbCommandConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_adb_command', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._command = config.command; + this._content = config.content; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._phoneIds = config.phoneIds; + this._region = config.region; + this._serverIds = config.serverIds; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // command - computed: false, optional: false, required: true + private _command?: string; + public get command() { + return this.getStringAttribute('command'); + } + public set command(value: string) { + this._command = value; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // phone_ids - computed: false, optional: true, required: false + private _phoneIds?: string[]; + public get phoneIds() { + return this.getListAttribute('phone_ids'); + } + public set phoneIds(value: string[]) { + this._phoneIds = value; + } + public resetPhoneIds() { + this._phoneIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneIdsInput() { + return this._phoneIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_ids - computed: false, optional: true, required: false + private _serverIds?: string[]; + public get serverIds() { + return this.getListAttribute('server_ids'); + } + public set serverIds(value: string[]) { + this._serverIds = value; + } + public resetServerIds() { + this._serverIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdsInput() { + return this._serverIds; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphAdbCommandTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphAdbCommandTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + command: cdktf.stringToTerraform(this._command), + content: cdktf.stringToTerraform(this._content), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + phone_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._phoneIds), + region: cdktf.stringToTerraform(this._region), + server_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._serverIds), + timeouts: cphAdbCommandTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + command: { + value: cdktf.stringToHclTerraform(this._command), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._phoneIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._serverIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + timeouts: { + value: cphAdbCommandTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphAdbCommandTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-phone-property/README.md b/src/constructs/providers/huaweicloud/cph-phone-property/README.md new file mode 100644 index 00000000..426b14b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-property/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_phone_property` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_phone_property`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property). diff --git a/src/constructs/providers/huaweicloud/cph-phone-property/index.ts b/src/constructs/providers/huaweicloud/cph-phone-property/index.ts new file mode 100644 index 00000000..252c7c1b --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-property/index.ts @@ -0,0 +1,438 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphPhonePropertyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#enable_force_new CphPhoneProperty#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#id CphPhoneProperty#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#region CphPhoneProperty#region} + */ + readonly region?: string; + /** + * phones block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#phones CphPhoneProperty#phones} + */ + readonly phones: CphPhonePropertyPhones; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#timeouts CphPhoneProperty#timeouts} + */ + readonly timeouts?: CphPhonePropertyTimeouts; +} +export interface CphPhonePropertyPhones { + /** + * Specifies the phone ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#phone_id CphPhoneProperty#phone_id} + */ + readonly phoneId: string; + /** + * Specifies the phone property, the format is json string. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#property CphPhoneProperty#property} + */ + readonly property: string; +} + +export function cphPhonePropertyPhonesToTerraform(struct?: CphPhonePropertyPhonesOutputReference | CphPhonePropertyPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + phone_id: cdktf.stringToTerraform(struct!.phoneId), + property: cdktf.stringToTerraform(struct!.property), + } +} + + +export function cphPhonePropertyPhonesToHclTerraform(struct?: CphPhonePropertyPhonesOutputReference | CphPhonePropertyPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + phone_id: { + value: cdktf.stringToHclTerraform(struct!.phoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property: { + value: cdktf.stringToHclTerraform(struct!.property), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhonePropertyPhonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CphPhonePropertyPhones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._phoneId !== undefined) { + hasAnyValues = true; + internalValueResult.phoneId = this._phoneId; + } + if (this._property !== undefined) { + hasAnyValues = true; + internalValueResult.property = this._property; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhonePropertyPhones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._phoneId = undefined; + this._property = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._phoneId = value.phoneId; + this._property = value.property; + } + } + + // phone_id - computed: false, optional: false, required: true + private _phoneId?: string; + public get phoneId() { + return this.getStringAttribute('phone_id'); + } + public set phoneId(value: string) { + this._phoneId = value; + } + // Temporarily expose input value. Use with caution. + public get phoneIdInput() { + return this._phoneId; + } + + // property - computed: false, optional: false, required: true + private _property?: string; + public get property() { + return this.getStringAttribute('property'); + } + public set property(value: string) { + this._property = value; + } + // Temporarily expose input value. Use with caution. + public get propertyInput() { + return this._property; + } +} +export interface CphPhonePropertyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#create CphPhoneProperty#create} + */ + readonly create?: string; +} + +export function cphPhonePropertyTimeoutsToTerraform(struct?: CphPhonePropertyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cphPhonePropertyTimeoutsToHclTerraform(struct?: CphPhonePropertyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhonePropertyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphPhonePropertyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhonePropertyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property huaweicloud_cph_phone_property} +*/ +export class CphPhoneProperty extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_property"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphPhoneProperty resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphPhoneProperty to import + * @param importFromId The id of the existing CphPhoneProperty that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphPhoneProperty to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_property", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_property huaweicloud_cph_phone_property} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphPhonePropertyConfig + */ + public constructor(scope: Construct, id: string, config: CphPhonePropertyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_property', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._region = config.region; + this._phones.internalValue = config.phones; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // phones - computed: false, optional: false, required: true + private _phones = new CphPhonePropertyPhonesOutputReference(this, "phones"); + public get phones() { + return this._phones; + } + public putPhones(value: CphPhonePropertyPhones) { + this._phones.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get phonesInput() { + return this._phones.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphPhonePropertyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphPhonePropertyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + phones: cphPhonePropertyPhonesToTerraform(this._phones.internalValue), + timeouts: cphPhonePropertyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phones: { + value: cphPhonePropertyPhonesToHclTerraform(this._phones.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphPhonePropertyPhonesList", + }, + timeouts: { + value: cphPhonePropertyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphPhonePropertyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-phone-reset/README.md b/src/constructs/providers/huaweicloud/cph-phone-reset/README.md new file mode 100644 index 00000000..cca1b587 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-reset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_phone_reset` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_phone_reset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset). diff --git a/src/constructs/providers/huaweicloud/cph-phone-reset/index.ts b/src/constructs/providers/huaweicloud/cph-phone-reset/index.ts new file mode 100644 index 00000000..c99364b3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-reset/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphPhoneResetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#enable_force_new CphPhoneReset#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#id CphPhoneReset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the image ID of the CPH phone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#image_id CphPhoneReset#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#region CphPhoneReset#region} + */ + readonly region?: string; + /** + * phones block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#phones CphPhoneReset#phones} + */ + readonly phones: CphPhoneResetPhones; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#timeouts CphPhoneReset#timeouts} + */ + readonly timeouts?: CphPhoneResetTimeouts; +} +export interface CphPhoneResetPhones { + /** + * Specifies the phone ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#phone_id CphPhoneReset#phone_id} + */ + readonly phoneId: string; + /** + * Specifies the phone property. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#property CphPhoneReset#property} + */ + readonly property?: string; +} + +export function cphPhoneResetPhonesToTerraform(struct?: CphPhoneResetPhonesOutputReference | CphPhoneResetPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + phone_id: cdktf.stringToTerraform(struct!.phoneId), + property: cdktf.stringToTerraform(struct!.property), + } +} + + +export function cphPhoneResetPhonesToHclTerraform(struct?: CphPhoneResetPhonesOutputReference | CphPhoneResetPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + phone_id: { + value: cdktf.stringToHclTerraform(struct!.phoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property: { + value: cdktf.stringToHclTerraform(struct!.property), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhoneResetPhonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CphPhoneResetPhones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._phoneId !== undefined) { + hasAnyValues = true; + internalValueResult.phoneId = this._phoneId; + } + if (this._property !== undefined) { + hasAnyValues = true; + internalValueResult.property = this._property; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhoneResetPhones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._phoneId = undefined; + this._property = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._phoneId = value.phoneId; + this._property = value.property; + } + } + + // phone_id - computed: false, optional: false, required: true + private _phoneId?: string; + public get phoneId() { + return this.getStringAttribute('phone_id'); + } + public set phoneId(value: string) { + this._phoneId = value; + } + // Temporarily expose input value. Use with caution. + public get phoneIdInput() { + return this._phoneId; + } + + // property - computed: false, optional: true, required: false + private _property?: string; + public get property() { + return this.getStringAttribute('property'); + } + public set property(value: string) { + this._property = value; + } + public resetProperty() { + this._property = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertyInput() { + return this._property; + } +} +export interface CphPhoneResetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#create CphPhoneReset#create} + */ + readonly create?: string; +} + +export function cphPhoneResetTimeoutsToTerraform(struct?: CphPhoneResetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cphPhoneResetTimeoutsToHclTerraform(struct?: CphPhoneResetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhoneResetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphPhoneResetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhoneResetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset huaweicloud_cph_phone_reset} +*/ +export class CphPhoneReset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_reset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphPhoneReset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphPhoneReset to import + * @param importFromId The id of the existing CphPhoneReset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphPhoneReset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_reset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_reset huaweicloud_cph_phone_reset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphPhoneResetConfig + */ + public constructor(scope: Construct, id: string, config: CphPhoneResetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_reset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._imageId = config.imageId; + this._region = config.region; + this._phones.internalValue = config.phones; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // phones - computed: false, optional: false, required: true + private _phones = new CphPhoneResetPhonesOutputReference(this, "phones"); + public get phones() { + return this._phones; + } + public putPhones(value: CphPhoneResetPhones) { + this._phones.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get phonesInput() { + return this._phones.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphPhoneResetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphPhoneResetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + region: cdktf.stringToTerraform(this._region), + phones: cphPhoneResetPhonesToTerraform(this._phones.internalValue), + timeouts: cphPhoneResetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phones: { + value: cphPhoneResetPhonesToHclTerraform(this._phones.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphPhoneResetPhonesList", + }, + timeouts: { + value: cphPhoneResetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphPhoneResetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-phone-restart/README.md b/src/constructs/providers/huaweicloud/cph-phone-restart/README.md new file mode 100644 index 00000000..c448b19f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_phone_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_phone_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart). diff --git a/src/constructs/providers/huaweicloud/cph-phone-restart/index.ts b/src/constructs/providers/huaweicloud/cph-phone-restart/index.ts new file mode 100644 index 00000000..065cf676 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-restart/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphPhoneRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#enable_force_new CphPhoneRestart#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#id CphPhoneRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the image ID of the CPH phone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#image_id CphPhoneRestart#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#region CphPhoneRestart#region} + */ + readonly region?: string; + /** + * phones block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#phones CphPhoneRestart#phones} + */ + readonly phones: CphPhoneRestartPhones; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#timeouts CphPhoneRestart#timeouts} + */ + readonly timeouts?: CphPhoneRestartTimeouts; +} +export interface CphPhoneRestartPhones { + /** + * Specifies the phone ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#phone_id CphPhoneRestart#phone_id} + */ + readonly phoneId: string; + /** + * Specifies the phone property. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#property CphPhoneRestart#property} + */ + readonly property?: string; +} + +export function cphPhoneRestartPhonesToTerraform(struct?: CphPhoneRestartPhonesOutputReference | CphPhoneRestartPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + phone_id: cdktf.stringToTerraform(struct!.phoneId), + property: cdktf.stringToTerraform(struct!.property), + } +} + + +export function cphPhoneRestartPhonesToHclTerraform(struct?: CphPhoneRestartPhonesOutputReference | CphPhoneRestartPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + phone_id: { + value: cdktf.stringToHclTerraform(struct!.phoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property: { + value: cdktf.stringToHclTerraform(struct!.property), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhoneRestartPhonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CphPhoneRestartPhones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._phoneId !== undefined) { + hasAnyValues = true; + internalValueResult.phoneId = this._phoneId; + } + if (this._property !== undefined) { + hasAnyValues = true; + internalValueResult.property = this._property; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhoneRestartPhones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._phoneId = undefined; + this._property = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._phoneId = value.phoneId; + this._property = value.property; + } + } + + // phone_id - computed: false, optional: false, required: true + private _phoneId?: string; + public get phoneId() { + return this.getStringAttribute('phone_id'); + } + public set phoneId(value: string) { + this._phoneId = value; + } + // Temporarily expose input value. Use with caution. + public get phoneIdInput() { + return this._phoneId; + } + + // property - computed: false, optional: true, required: false + private _property?: string; + public get property() { + return this.getStringAttribute('property'); + } + public set property(value: string) { + this._property = value; + } + public resetProperty() { + this._property = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertyInput() { + return this._property; + } +} +export interface CphPhoneRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#create CphPhoneRestart#create} + */ + readonly create?: string; +} + +export function cphPhoneRestartTimeoutsToTerraform(struct?: CphPhoneRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cphPhoneRestartTimeoutsToHclTerraform(struct?: CphPhoneRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhoneRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphPhoneRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhoneRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart huaweicloud_cph_phone_restart} +*/ +export class CphPhoneRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphPhoneRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphPhoneRestart to import + * @param importFromId The id of the existing CphPhoneRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphPhoneRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_restart huaweicloud_cph_phone_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphPhoneRestartConfig + */ + public constructor(scope: Construct, id: string, config: CphPhoneRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._imageId = config.imageId; + this._region = config.region; + this._phones.internalValue = config.phones; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // phones - computed: false, optional: false, required: true + private _phones = new CphPhoneRestartPhonesOutputReference(this, "phones"); + public get phones() { + return this._phones; + } + public putPhones(value: CphPhoneRestartPhones) { + this._phones.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get phonesInput() { + return this._phones.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphPhoneRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphPhoneRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + region: cdktf.stringToTerraform(this._region), + phones: cphPhoneRestartPhonesToTerraform(this._phones.internalValue), + timeouts: cphPhoneRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phones: { + value: cphPhoneRestartPhonesToHclTerraform(this._phones.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphPhoneRestartPhonesList", + }, + timeouts: { + value: cphPhoneRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphPhoneRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-phone-stop/README.md b/src/constructs/providers/huaweicloud/cph-phone-stop/README.md new file mode 100644 index 00000000..64d89008 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-stop/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_phone_stop` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_phone_stop`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop). diff --git a/src/constructs/providers/huaweicloud/cph-phone-stop/index.ts b/src/constructs/providers/huaweicloud/cph-phone-stop/index.ts new file mode 100644 index 00000000..0ba3e1fd --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-phone-stop/index.ts @@ -0,0 +1,323 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphPhoneStopConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#enable_force_new CphPhoneStop#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#id CphPhoneStop#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the CPH phone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#phone_id CphPhoneStop#phone_id} + */ + readonly phoneId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#region CphPhoneStop#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#timeouts CphPhoneStop#timeouts} + */ + readonly timeouts?: CphPhoneStopTimeouts; +} +export interface CphPhoneStopTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#create CphPhoneStop#create} + */ + readonly create?: string; +} + +export function cphPhoneStopTimeoutsToTerraform(struct?: CphPhoneStopTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cphPhoneStopTimeoutsToHclTerraform(struct?: CphPhoneStopTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphPhoneStopTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphPhoneStopTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphPhoneStopTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop huaweicloud_cph_phone_stop} +*/ +export class CphPhoneStop extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_stop"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphPhoneStop resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphPhoneStop to import + * @param importFromId The id of the existing CphPhoneStop that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphPhoneStop to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_stop", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_phone_stop huaweicloud_cph_phone_stop} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphPhoneStopConfig + */ + public constructor(scope: Construct, id: string, config: CphPhoneStopConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_stop', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._phoneId = config.phoneId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // phone_id - computed: false, optional: false, required: true + private _phoneId?: string; + public get phoneId() { + return this.getStringAttribute('phone_id'); + } + public set phoneId(value: string) { + this._phoneId = value; + } + // Temporarily expose input value. Use with caution. + public get phoneIdInput() { + return this._phoneId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphPhoneStopTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphPhoneStopTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + phone_id: cdktf.stringToTerraform(this._phoneId), + region: cdktf.stringToTerraform(this._region), + timeouts: cphPhoneStopTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_id: { + value: cdktf.stringToHclTerraform(this._phoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cphPhoneStopTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphPhoneStopTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-server-restart/README.md b/src/constructs/providers/huaweicloud/cph-server-restart/README.md new file mode 100644 index 00000000..ad37ad29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-server-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_server_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_server_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart). diff --git a/src/constructs/providers/huaweicloud/cph-server-restart/index.ts b/src/constructs/providers/huaweicloud/cph-server-restart/index.ts new file mode 100644 index 00000000..e2fc4de3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-server-restart/index.ts @@ -0,0 +1,326 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphServerRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#enable_force_new CphServerRestart#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#id CphServerRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#region CphServerRestart#region} + */ + readonly region?: string; + /** + * Specifies the ID of CPH server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#server_id CphServerRestart#server_id} + */ + readonly serverId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#timeouts CphServerRestart#timeouts} + */ + readonly timeouts?: CphServerRestartTimeouts; +} +export interface CphServerRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#create CphServerRestart#create} + */ + readonly create?: string; +} + +export function cphServerRestartTimeoutsToTerraform(struct?: CphServerRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cphServerRestartTimeoutsToHclTerraform(struct?: CphServerRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphServerRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphServerRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart huaweicloud_cph_server_restart} +*/ +export class CphServerRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_server_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphServerRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphServerRestart to import + * @param importFromId The id of the existing CphServerRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphServerRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_server_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server_restart huaweicloud_cph_server_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphServerRestartConfig = {} + */ + public constructor(scope: Construct, id: string, config: CphServerRestartConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_server_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._region = config.region; + this._serverId = config.serverId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphServerRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphServerRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + timeouts: cphServerRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cphServerRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphServerRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-server/README.md b/src/constructs/providers/huaweicloud/cph-server/README.md new file mode 100644 index 00000000..99d1b715 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-server/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_server` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_server`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server). diff --git a/src/constructs/providers/huaweicloud/cph-server/index.ts b/src/constructs/providers/huaweicloud/cph-server/index.ts new file mode 100644 index 00000000..f0faa626 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-server/index.ts @@ -0,0 +1,1580 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphServerConfig extends cdktf.TerraformMetaArguments { + /** + * Whether auto renew is enabled. Valid values are "true" and "false". + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#auto_renew CphServer#auto_renew} + */ + readonly autoRenew: string; + /** + * The name of the AZ where the cloud server is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#availability_zone CphServer#availability_zone} + */ + readonly availabilityZone?: string; + /** + * The ID of an **existing** EIP assigned to the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#eip_id CphServer#eip_id} + */ + readonly eipId?: string; + /** + * The type of an EIP that will be automatically assigned to the cloud server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#eip_type CphServer#eip_type} + */ + readonly eipType?: string; + /** + * the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#enterprise_project_id CphServer#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#id CphServer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The cloud phone image ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#image_id CphServer#image_id} + */ + readonly imageId: string; + /** + * The key pair name, which is used for logging in to the cloud phone through ADB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#keypair_name CphServer#keypair_name} + */ + readonly keypairName?: string; + /** + * Server name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#name CphServer#name} + */ + readonly name: string; + /** + * The charging period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#period CphServer#period} + */ + readonly period: number; + /** + * The charging period unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#period_unit CphServer#period_unit} + */ + readonly periodUnit: string; + /** + * The cloud phone flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#phone_flavor CphServer#phone_flavor} + */ + readonly phoneFlavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#region CphServer#region} + */ + readonly region?: string; + /** + * The CPH server flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#server_flavor CphServer#server_flavor} + */ + readonly serverFlavor: string; + /** + * The ID of subnet which the cloud server belongs to + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#subnet_id CphServer#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#tags CphServer#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of VPC which the cloud server belongs to + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#vpc_id CphServer#vpc_id} + */ + readonly vpcId: string; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#bandwidth CphServer#bandwidth} + */ + readonly bandwidth?: CphServerBandwidth; + /** + * phone_data_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#phone_data_volume CphServer#phone_data_volume} + */ + readonly phoneDataVolume?: CphServerPhoneDataVolume; + /** + * ports block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#ports CphServer#ports} + */ + readonly ports?: CphServerPorts[] | cdktf.IResolvable; + /** + * server_share_data_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#server_share_data_volume CphServer#server_share_data_volume} + */ + readonly serverShareDataVolume?: CphServerServerShareDataVolume; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#timeouts CphServer#timeouts} + */ + readonly timeouts?: CphServerTimeouts; +} +export interface CphServerAddresses { +} + +export function cphServerAddressesToTerraform(struct?: CphServerAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cphServerAddressesToHclTerraform(struct?: CphServerAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CphServerAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CphServerAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // server_ip - computed: true, optional: false, required: false + public get serverIp() { + return this.getStringAttribute('server_ip'); + } +} + +export class CphServerAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CphServerAddressesOutputReference { + return new CphServerAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CphServerBandwidth { + /** + * Which the bandwidth used by the CPH server is billed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#charge_mode CphServer#charge_mode} + */ + readonly chargeMode?: string; + /** + * The bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#id CphServer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The bandwidth type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#share_type CphServer#share_type} + */ + readonly shareType: string; + /** + * The bandwidth (Mbit/s). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#size CphServer#size} + */ + readonly size?: number; +} + +export function cphServerBandwidthToTerraform(struct?: CphServerBandwidthOutputReference | CphServerBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function cphServerBandwidthToHclTerraform(struct?: CphServerBandwidthOutputReference | CphServerBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphServerBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CphServerBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargeMode = undefined; + this._id = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface CphServerPhoneDataVolume { + /** + * Specifies the volume size, the unit is GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#volume_size CphServer#volume_size} + */ + readonly volumeSize?: number; + /** + * Specifies the volume type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#volume_type CphServer#volume_type} + */ + readonly volumeType?: string; +} + +export function cphServerPhoneDataVolumeToTerraform(struct?: CphServerPhoneDataVolumeOutputReference | CphServerPhoneDataVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + volume_size: cdktf.numberToTerraform(struct!.volumeSize), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cphServerPhoneDataVolumeToHclTerraform(struct?: CphServerPhoneDataVolumeOutputReference | CphServerPhoneDataVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + volume_size: { + value: cdktf.numberToHclTerraform(struct!.volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphServerPhoneDataVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CphServerPhoneDataVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._volumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.volumeSize = this._volumeSize; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerPhoneDataVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._volumeSize = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._volumeSize = value.volumeSize; + this._volumeType = value.volumeType; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + + // volume_name - computed: true, optional: false, required: false + public get volumeName() { + return this.getStringAttribute('volume_name'); + } + + // volume_size - computed: false, optional: true, required: false + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + public resetVolumeSize() { + this._volumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // volume_type - computed: false, optional: true, required: false + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + public resetVolumeType() { + this._volumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CphServerPorts { + /** + * Whether public network access is mapped. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#internet_accessible CphServer#internet_accessible} + */ + readonly internetAccessible: string; + /** + * The port number, which ranges from 10000 to 50000. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#listen_port CphServer#listen_port} + */ + readonly listenPort: number; + /** + * The application port name, which can contain a maximum of 16 bytes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#name CphServer#name} + */ + readonly name: string; +} + +export function cphServerPortsToTerraform(struct?: CphServerPorts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + internet_accessible: cdktf.stringToTerraform(struct!.internetAccessible), + listen_port: cdktf.numberToTerraform(struct!.listenPort), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function cphServerPortsToHclTerraform(struct?: CphServerPorts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + internet_accessible: { + value: cdktf.stringToHclTerraform(struct!.internetAccessible), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listen_port: { + value: cdktf.numberToHclTerraform(struct!.listenPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphServerPortsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CphServerPorts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._internetAccessible !== undefined) { + hasAnyValues = true; + internalValueResult.internetAccessible = this._internetAccessible; + } + if (this._listenPort !== undefined) { + hasAnyValues = true; + internalValueResult.listenPort = this._listenPort; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerPorts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._internetAccessible = undefined; + this._listenPort = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._internetAccessible = value.internetAccessible; + this._listenPort = value.listenPort; + this._name = value.name; + } + } + + // internet_accessible - computed: false, optional: false, required: true + private _internetAccessible?: string; + public get internetAccessible() { + return this.getStringAttribute('internet_accessible'); + } + public set internetAccessible(value: string) { + this._internetAccessible = value; + } + // Temporarily expose input value. Use with caution. + public get internetAccessibleInput() { + return this._internetAccessible; + } + + // listen_port - computed: false, optional: false, required: true + private _listenPort?: number; + public get listenPort() { + return this.getNumberAttribute('listen_port'); + } + public set listenPort(value: number) { + this._listenPort = value; + } + // Temporarily expose input value. Use with caution. + public get listenPortInput() { + return this._listenPort; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class CphServerPortsList extends cdktf.ComplexList { + public internalValue? : CphServerPorts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CphServerPortsOutputReference { + return new CphServerPortsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CphServerServerShareDataVolume { + /** + * Specifies the share volume size, the unit is GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#size CphServer#size} + */ + readonly size?: number; + /** + * Specifies the share volume type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#volume_type CphServer#volume_type} + */ + readonly volumeType?: string; +} + +export function cphServerServerShareDataVolumeToTerraform(struct?: CphServerServerShareDataVolumeOutputReference | CphServerServerShareDataVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cphServerServerShareDataVolumeToHclTerraform(struct?: CphServerServerShareDataVolumeOutputReference | CphServerServerShareDataVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphServerServerShareDataVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CphServerServerShareDataVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerServerShareDataVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } + + // volume_type - computed: false, optional: true, required: false + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + public resetVolumeType() { + this._volumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CphServerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#create CphServer#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#delete CphServer#delete} + */ + readonly delete?: string; +} + +export function cphServerTimeoutsToTerraform(struct?: CphServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cphServerTimeoutsToHclTerraform(struct?: CphServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphServerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphServerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphServerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server huaweicloud_cph_server} +*/ +export class CphServer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_server"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphServer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphServer to import + * @param importFromId The id of the existing CphServer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphServer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_server", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_server huaweicloud_cph_server} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphServerConfig + */ + public constructor(scope: Construct, id: string, config: CphServerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_server', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._eipId = config.eipId; + this._eipType = config.eipType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._imageId = config.imageId; + this._keypairName = config.keypairName; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._phoneFlavor = config.phoneFlavor; + this._region = config.region; + this._serverFlavor = config.serverFlavor; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._bandwidth.internalValue = config.bandwidth; + this._phoneDataVolume.internalValue = config.phoneDataVolume; + this._ports.internalValue = config.ports; + this._serverShareDataVolume.internalValue = config.serverShareDataVolume; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // addresses - computed: true, optional: false, required: false + private _addresses = new CphServerAddressesList(this, "addresses", false); + public get addresses() { + return this._addresses; + } + + // auto_renew - computed: false, optional: false, required: true + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // eip_type - computed: false, optional: true, required: false + private _eipType?: string; + public get eipType() { + return this.getStringAttribute('eip_type'); + } + public set eipType(value: string) { + this._eipType = value; + } + public resetEipType() { + this._eipType = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipTypeInput() { + return this._eipType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // keypair_name - computed: true, optional: true, required: false + private _keypairName?: string; + public get keypairName() { + return this.getStringAttribute('keypair_name'); + } + public set keypairName(value: string) { + this._keypairName = value; + } + public resetKeypairName() { + this._keypairName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keypairNameInput() { + return this._keypairName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // phone_flavor - computed: false, optional: false, required: true + private _phoneFlavor?: string; + public get phoneFlavor() { + return this.getStringAttribute('phone_flavor'); + } + public set phoneFlavor(value: string) { + this._phoneFlavor = value; + } + // Temporarily expose input value. Use with caution. + public get phoneFlavorInput() { + return this._phoneFlavor; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_groups - computed: true, optional: false, required: false + public get securityGroups() { + return this.getListAttribute('security_groups'); + } + + // server_flavor - computed: false, optional: false, required: true + private _serverFlavor?: string; + public get serverFlavor() { + return this.getStringAttribute('server_flavor'); + } + public set serverFlavor(value: string) { + this._serverFlavor = value; + } + // Temporarily expose input value. Use with caution. + public get serverFlavorInput() { + return this._serverFlavor; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // bandwidth - computed: false, optional: true, required: false + private _bandwidth = new CphServerBandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: CphServerBandwidth) { + this._bandwidth.internalValue = value; + } + public resetBandwidth() { + this._bandwidth.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } + + // phone_data_volume - computed: false, optional: true, required: false + private _phoneDataVolume = new CphServerPhoneDataVolumeOutputReference(this, "phone_data_volume"); + public get phoneDataVolume() { + return this._phoneDataVolume; + } + public putPhoneDataVolume(value: CphServerPhoneDataVolume) { + this._phoneDataVolume.internalValue = value; + } + public resetPhoneDataVolume() { + this._phoneDataVolume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneDataVolumeInput() { + return this._phoneDataVolume.internalValue; + } + + // ports - computed: false, optional: true, required: false + private _ports = new CphServerPortsList(this, "ports", false); + public get ports() { + return this._ports; + } + public putPorts(value: CphServerPorts[] | cdktf.IResolvable) { + this._ports.internalValue = value; + } + public resetPorts() { + this._ports.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get portsInput() { + return this._ports.internalValue; + } + + // server_share_data_volume - computed: false, optional: true, required: false + private _serverShareDataVolume = new CphServerServerShareDataVolumeOutputReference(this, "server_share_data_volume"); + public get serverShareDataVolume() { + return this._serverShareDataVolume; + } + public putServerShareDataVolume(value: CphServerServerShareDataVolume) { + this._serverShareDataVolume.internalValue = value; + } + public resetServerShareDataVolume() { + this._serverShareDataVolume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverShareDataVolumeInput() { + return this._serverShareDataVolume.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphServerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphServerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + eip_id: cdktf.stringToTerraform(this._eipId), + eip_type: cdktf.stringToTerraform(this._eipType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + keypair_name: cdktf.stringToTerraform(this._keypairName), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + phone_flavor: cdktf.stringToTerraform(this._phoneFlavor), + region: cdktf.stringToTerraform(this._region), + server_flavor: cdktf.stringToTerraform(this._serverFlavor), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + bandwidth: cphServerBandwidthToTerraform(this._bandwidth.internalValue), + phone_data_volume: cphServerPhoneDataVolumeToTerraform(this._phoneDataVolume.internalValue), + ports: cdktf.listMapper(cphServerPortsToTerraform, true)(this._ports.internalValue), + server_share_data_volume: cphServerServerShareDataVolumeToTerraform(this._serverShareDataVolume.internalValue), + timeouts: cphServerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_type: { + value: cdktf.stringToHclTerraform(this._eipType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keypair_name: { + value: cdktf.stringToHclTerraform(this._keypairName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_flavor: { + value: cdktf.stringToHclTerraform(this._phoneFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_flavor: { + value: cdktf.stringToHclTerraform(this._serverFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth: { + value: cphServerBandwidthToHclTerraform(this._bandwidth.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphServerBandwidthList", + }, + phone_data_volume: { + value: cphServerPhoneDataVolumeToHclTerraform(this._phoneDataVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphServerPhoneDataVolumeList", + }, + ports: { + value: cdktf.listMapperHcl(cphServerPortsToHclTerraform, true)(this._ports.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphServerPortsList", + }, + server_share_data_volume: { + value: cphServerServerShareDataVolumeToHclTerraform(this._serverShareDataVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "CphServerServerShareDataVolumeList", + }, + timeouts: { + value: cphServerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphServerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cph-share-app/README.md b/src/constructs/providers/huaweicloud/cph-share-app/README.md new file mode 100644 index 00000000..3df30c22 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-share-app/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cph_share_app` + +Refer to the Terraform Registry for docs: [`huaweicloud_cph_share_app`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app). diff --git a/src/constructs/providers/huaweicloud/cph-share-app/index.ts b/src/constructs/providers/huaweicloud/cph-share-app/index.ts new file mode 100644 index 00000000..9e5ab42d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cph-share-app/index.ts @@ -0,0 +1,467 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CphShareAppConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the OBS bucket name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#bucket_name CphShareApp#bucket_name} + */ + readonly bucketName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#enable_force_new CphShareApp#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#id CphShareApp#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the OBS object path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#object_path CphShareApp#object_path} + */ + readonly objectPath: string; + /** + * Specifies the package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#package_name CphShareApp#package_name} + */ + readonly packageName: string; + /** + * Specifies whether to pre-install the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#pre_install_app CphShareApp#pre_install_app} + */ + readonly preInstallApp?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#region CphShareApp#region} + */ + readonly region?: string; + /** + * Specifies the CPH server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#server_id CphShareApp#server_id} + */ + readonly serverId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#timeouts CphShareApp#timeouts} + */ + readonly timeouts?: CphShareAppTimeouts; +} +export interface CphShareAppTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#create CphShareApp#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#delete CphShareApp#delete} + */ + readonly delete?: string; +} + +export function cphShareAppTimeoutsToTerraform(struct?: CphShareAppTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cphShareAppTimeoutsToHclTerraform(struct?: CphShareAppTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CphShareAppTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CphShareAppTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CphShareAppTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app huaweicloud_cph_share_app} +*/ +export class CphShareApp extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_share_app"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CphShareApp resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CphShareApp to import + * @param importFromId The id of the existing CphShareApp that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CphShareApp to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_share_app", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cph_share_app huaweicloud_cph_share_app} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CphShareAppConfig + */ + public constructor(scope: Construct, id: string, config: CphShareAppConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_share_app', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._objectPath = config.objectPath; + this._packageName = config.packageName; + this._preInstallApp = config.preInstallApp; + this._region = config.region; + this._serverId = config.serverId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_name - computed: false, optional: false, required: true + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // object_path - computed: false, optional: false, required: true + private _objectPath?: string; + public get objectPath() { + return this.getStringAttribute('object_path'); + } + public set objectPath(value: string) { + this._objectPath = value; + } + // Temporarily expose input value. Use with caution. + public get objectPathInput() { + return this._objectPath; + } + + // package_name - computed: false, optional: false, required: true + private _packageName?: string; + public get packageName() { + return this.getStringAttribute('package_name'); + } + public set packageName(value: string) { + this._packageName = value; + } + // Temporarily expose input value. Use with caution. + public get packageNameInput() { + return this._packageName; + } + + // pre_install_app - computed: false, optional: true, required: false + private _preInstallApp?: number; + public get preInstallApp() { + return this.getNumberAttribute('pre_install_app'); + } + public set preInstallApp(value: number) { + this._preInstallApp = value; + } + public resetPreInstallApp() { + this._preInstallApp = undefined; + } + // Temporarily expose input value. Use with caution. + public get preInstallAppInput() { + return this._preInstallApp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: false, required: true + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CphShareAppTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CphShareAppTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + object_path: cdktf.stringToTerraform(this._objectPath), + package_name: cdktf.stringToTerraform(this._packageName), + pre_install_app: cdktf.numberToTerraform(this._preInstallApp), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + timeouts: cphShareAppTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_path: { + value: cdktf.stringToHclTerraform(this._objectPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package_name: { + value: cdktf.stringToHclTerraform(this._packageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pre_install_app: { + value: cdktf.numberToHclTerraform(this._preInstallApp), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cphShareAppTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CphShareAppTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cpts-project/README.md b/src/constructs/providers/huaweicloud/cpts-project/README.md new file mode 100644 index 00000000..d17066a1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cpts-project/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cpts_project` + +Refer to the Terraform Registry for docs: [`huaweicloud_cpts_project`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project). diff --git a/src/constructs/providers/huaweicloud/cpts-project/index.ts b/src/constructs/providers/huaweicloud/cpts-project/index.ts new file mode 100644 index 00000000..1f6a2113 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cpts-project/index.ts @@ -0,0 +1,207 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CptsProjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project#description CptsProject#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project#id CptsProject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project#name CptsProject#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project#region CptsProject#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project huaweicloud_cpts_project} +*/ +export class CptsProject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cpts_project"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CptsProject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CptsProject to import + * @param importFromId The id of the existing CptsProject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CptsProject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cpts_project", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_project huaweicloud_cpts_project} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CptsProjectConfig + */ + public constructor(scope: Construct, id: string, config: CptsProjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cpts_project', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cpts-task/README.md b/src/constructs/providers/huaweicloud/cpts-task/README.md new file mode 100644 index 00000000..fd066313 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cpts-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cpts_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_cpts_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task). diff --git a/src/constructs/providers/huaweicloud/cpts-task/index.ts b/src/constructs/providers/huaweicloud/cpts-task/index.ts new file mode 100644 index 00000000..ed79dc45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cpts-task/index.ts @@ -0,0 +1,407 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CptsTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#benchmark_concurrency CptsTask#benchmark_concurrency} + */ + readonly benchmarkConcurrency?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#cluster_id CptsTask#cluster_id} + */ + readonly clusterId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#id CptsTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#name CptsTask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#operation CptsTask#operation} + */ + readonly operation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#project_id CptsTask#project_id} + */ + readonly projectId: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#region CptsTask#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#timeouts CptsTask#timeouts} + */ + readonly timeouts?: CptsTaskTimeouts; +} +export interface CptsTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#update CptsTask#update} + */ + readonly update?: string; +} + +export function cptsTaskTimeoutsToTerraform(struct?: CptsTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cptsTaskTimeoutsToHclTerraform(struct?: CptsTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CptsTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CptsTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CptsTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._update = value.update; + } + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task huaweicloud_cpts_task} +*/ +export class CptsTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cpts_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CptsTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CptsTask to import + * @param importFromId The id of the existing CptsTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CptsTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cpts_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cpts_task huaweicloud_cpts_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CptsTaskConfig + */ + public constructor(scope: Construct, id: string, config: CptsTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cpts_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._benchmarkConcurrency = config.benchmarkConcurrency; + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._operation = config.operation; + this._projectId = config.projectId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // benchmark_concurrency - computed: false, optional: true, required: false + private _benchmarkConcurrency?: number; + public get benchmarkConcurrency() { + return this.getNumberAttribute('benchmark_concurrency'); + } + public set benchmarkConcurrency(value: number) { + this._benchmarkConcurrency = value; + } + public resetBenchmarkConcurrency() { + this._benchmarkConcurrency = undefined; + } + // Temporarily expose input value. Use with caution. + public get benchmarkConcurrencyInput() { + return this._benchmarkConcurrency; + } + + // cluster_id - computed: false, optional: true, required: false + private _clusterId?: number; + public get clusterId() { + return this.getNumberAttribute('cluster_id'); + } + public set clusterId(value: number) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operation - computed: false, optional: true, required: false + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + public resetOperation() { + this._operation = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: number; + public get projectId() { + return this.getNumberAttribute('project_id'); + } + public set projectId(value: number) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CptsTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CptsTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + benchmark_concurrency: cdktf.numberToTerraform(this._benchmarkConcurrency), + cluster_id: cdktf.numberToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + operation: cdktf.stringToTerraform(this._operation), + project_id: cdktf.numberToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + timeouts: cptsTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + benchmark_concurrency: { + value: cdktf.numberToHclTerraform(this._benchmarkConcurrency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cluster_id: { + value: cdktf.numberToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation: { + value: cdktf.stringToHclTerraform(this._operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.numberToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cptsTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CptsTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cs-cluster-v1/README.md b/src/constructs/providers/huaweicloud/cs-cluster-v1/README.md new file mode 100644 index 00000000..36408c35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-cluster-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cs_cluster_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_cs_cluster_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1). diff --git a/src/constructs/providers/huaweicloud/cs-cluster-v1/index.ts b/src/constructs/providers/huaweicloud/cs-cluster-v1/index.ts new file mode 100644 index 00000000..9835906a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-cluster-v1/index.ts @@ -0,0 +1,481 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsClusterV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#description CsClusterV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#id CsClusterV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#max_spu_num CsClusterV1#max_spu_num} + */ + readonly maxSpuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#name CsClusterV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#region CsClusterV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#subnet_cidr CsClusterV1#subnet_cidr} + */ + readonly subnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#subnet_gateway CsClusterV1#subnet_gateway} + */ + readonly subnetGateway?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#vpc_cidr CsClusterV1#vpc_cidr} + */ + readonly vpcCidr?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#timeouts CsClusterV1#timeouts} + */ + readonly timeouts?: CsClusterV1Timeouts; +} +export interface CsClusterV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#create CsClusterV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#delete CsClusterV1#delete} + */ + readonly delete?: string; +} + +export function csClusterV1TimeoutsToTerraform(struct?: CsClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csClusterV1TimeoutsToHclTerraform(struct?: CsClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsClusterV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsClusterV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsClusterV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1 huaweicloud_cs_cluster_v1} +*/ +export class CsClusterV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cs_cluster_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsClusterV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsClusterV1 to import + * @param importFromId The id of the existing CsClusterV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsClusterV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cs_cluster_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster_v1 huaweicloud_cs_cluster_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsClusterV1Config + */ + public constructor(scope: Construct, id: string, config: CsClusterV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cs_cluster_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._maxSpuNum = config.maxSpuNum; + this._name = config.name; + this._region = config.region; + this._subnetCidr = config.subnetCidr; + this._subnetGateway = config.subnetGateway; + this._vpcCidr = config.vpcCidr; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // manager_node_spu_num - computed: true, optional: false, required: false + public get managerNodeSpuNum() { + return this.getNumberAttribute('manager_node_spu_num'); + } + + // max_spu_num - computed: true, optional: true, required: false + private _maxSpuNum?: number; + public get maxSpuNum() { + return this.getNumberAttribute('max_spu_num'); + } + public set maxSpuNum(value: number) { + this._maxSpuNum = value; + } + public resetMaxSpuNum() { + this._maxSpuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxSpuNumInput() { + return this._maxSpuNum; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_cidr - computed: true, optional: true, required: false + private _subnetCidr?: string; + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + public set subnetCidr(value: string) { + this._subnetCidr = value; + } + public resetSubnetCidr() { + this._subnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetCidrInput() { + return this._subnetCidr; + } + + // subnet_gateway - computed: true, optional: true, required: false + private _subnetGateway?: string; + public get subnetGateway() { + return this.getStringAttribute('subnet_gateway'); + } + public set subnetGateway(value: string) { + this._subnetGateway = value; + } + public resetSubnetGateway() { + this._subnetGateway = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetGatewayInput() { + return this._subnetGateway; + } + + // used_spu_num - computed: true, optional: false, required: false + public get usedSpuNum() { + return this.getNumberAttribute('used_spu_num'); + } + + // vpc_cidr - computed: true, optional: true, required: false + private _vpcCidr?: string; + public get vpcCidr() { + return this.getStringAttribute('vpc_cidr'); + } + public set vpcCidr(value: string) { + this._vpcCidr = value; + } + public resetVpcCidr() { + this._vpcCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcCidrInput() { + return this._vpcCidr; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsClusterV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsClusterV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + max_spu_num: cdktf.numberToTerraform(this._maxSpuNum), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_cidr: cdktf.stringToTerraform(this._subnetCidr), + subnet_gateway: cdktf.stringToTerraform(this._subnetGateway), + vpc_cidr: cdktf.stringToTerraform(this._vpcCidr), + timeouts: csClusterV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_spu_num: { + value: cdktf.numberToHclTerraform(this._maxSpuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_cidr: { + value: cdktf.stringToHclTerraform(this._subnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_gateway: { + value: cdktf.stringToHclTerraform(this._subnetGateway), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_cidr: { + value: cdktf.stringToHclTerraform(this._vpcCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: csClusterV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsClusterV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cs-cluster/README.md b/src/constructs/providers/huaweicloud/cs-cluster/README.md new file mode 100644 index 00000000..f1a03ade --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cs_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_cs_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster). diff --git a/src/constructs/providers/huaweicloud/cs-cluster/index.ts b/src/constructs/providers/huaweicloud/cs-cluster/index.ts new file mode 100644 index 00000000..e9283e0e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-cluster/index.ts @@ -0,0 +1,481 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#description CsCluster#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#id CsCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#max_spu_num CsCluster#max_spu_num} + */ + readonly maxSpuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#name CsCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#region CsCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#subnet_cidr CsCluster#subnet_cidr} + */ + readonly subnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#subnet_gateway CsCluster#subnet_gateway} + */ + readonly subnetGateway?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#vpc_cidr CsCluster#vpc_cidr} + */ + readonly vpcCidr?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#timeouts CsCluster#timeouts} + */ + readonly timeouts?: CsClusterTimeouts; +} +export interface CsClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#create CsCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#delete CsCluster#delete} + */ + readonly delete?: string; +} + +export function csClusterTimeoutsToTerraform(struct?: CsClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csClusterTimeoutsToHclTerraform(struct?: CsClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster huaweicloud_cs_cluster} +*/ +export class CsCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cs_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsCluster to import + * @param importFromId The id of the existing CsCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cs_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_cluster huaweicloud_cs_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsClusterConfig + */ + public constructor(scope: Construct, id: string, config: CsClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cs_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._maxSpuNum = config.maxSpuNum; + this._name = config.name; + this._region = config.region; + this._subnetCidr = config.subnetCidr; + this._subnetGateway = config.subnetGateway; + this._vpcCidr = config.vpcCidr; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // manager_node_spu_num - computed: true, optional: false, required: false + public get managerNodeSpuNum() { + return this.getNumberAttribute('manager_node_spu_num'); + } + + // max_spu_num - computed: true, optional: true, required: false + private _maxSpuNum?: number; + public get maxSpuNum() { + return this.getNumberAttribute('max_spu_num'); + } + public set maxSpuNum(value: number) { + this._maxSpuNum = value; + } + public resetMaxSpuNum() { + this._maxSpuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxSpuNumInput() { + return this._maxSpuNum; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_cidr - computed: true, optional: true, required: false + private _subnetCidr?: string; + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + public set subnetCidr(value: string) { + this._subnetCidr = value; + } + public resetSubnetCidr() { + this._subnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetCidrInput() { + return this._subnetCidr; + } + + // subnet_gateway - computed: true, optional: true, required: false + private _subnetGateway?: string; + public get subnetGateway() { + return this.getStringAttribute('subnet_gateway'); + } + public set subnetGateway(value: string) { + this._subnetGateway = value; + } + public resetSubnetGateway() { + this._subnetGateway = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetGatewayInput() { + return this._subnetGateway; + } + + // used_spu_num - computed: true, optional: false, required: false + public get usedSpuNum() { + return this.getNumberAttribute('used_spu_num'); + } + + // vpc_cidr - computed: true, optional: true, required: false + private _vpcCidr?: string; + public get vpcCidr() { + return this.getStringAttribute('vpc_cidr'); + } + public set vpcCidr(value: string) { + this._vpcCidr = value; + } + public resetVpcCidr() { + this._vpcCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcCidrInput() { + return this._vpcCidr; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + max_spu_num: cdktf.numberToTerraform(this._maxSpuNum), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_cidr: cdktf.stringToTerraform(this._subnetCidr), + subnet_gateway: cdktf.stringToTerraform(this._subnetGateway), + vpc_cidr: cdktf.stringToTerraform(this._vpcCidr), + timeouts: csClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_spu_num: { + value: cdktf.numberToHclTerraform(this._maxSpuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_cidr: { + value: cdktf.stringToHclTerraform(this._subnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_gateway: { + value: cdktf.stringToHclTerraform(this._subnetGateway), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_cidr: { + value: cdktf.stringToHclTerraform(this._vpcCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: csClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cs-peering-connect-v1/README.md b/src/constructs/providers/huaweicloud/cs-peering-connect-v1/README.md new file mode 100644 index 00000000..f4523f4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-peering-connect-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cs_peering_connect_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_cs_peering_connect_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1). diff --git a/src/constructs/providers/huaweicloud/cs-peering-connect-v1/index.ts b/src/constructs/providers/huaweicloud/cs-peering-connect-v1/index.ts new file mode 100644 index 00000000..abbfe5b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-peering-connect-v1/index.ts @@ -0,0 +1,495 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsPeeringConnectV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#cluster_id CsPeeringConnectV1#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#id CsPeeringConnectV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#name CsPeeringConnectV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#region CsPeeringConnectV1#region} + */ + readonly region?: string; + /** + * target_vpc_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#target_vpc_info CsPeeringConnectV1#target_vpc_info} + */ + readonly targetVpcInfo?: CsPeeringConnectV1TargetVpcInfo; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#timeouts CsPeeringConnectV1#timeouts} + */ + readonly timeouts?: CsPeeringConnectV1Timeouts; +} +export interface CsPeeringConnectV1TargetVpcInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#project_id CsPeeringConnectV1#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#vpc_id CsPeeringConnectV1#vpc_id} + */ + readonly vpcId: string; +} + +export function csPeeringConnectV1TargetVpcInfoToTerraform(struct?: CsPeeringConnectV1TargetVpcInfoOutputReference | CsPeeringConnectV1TargetVpcInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project_id: cdktf.stringToTerraform(struct!.projectId), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function csPeeringConnectV1TargetVpcInfoToHclTerraform(struct?: CsPeeringConnectV1TargetVpcInfoOutputReference | CsPeeringConnectV1TargetVpcInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsPeeringConnectV1TargetVpcInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CsPeeringConnectV1TargetVpcInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsPeeringConnectV1TargetVpcInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._projectId = undefined; + this._vpcId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._projectId = value.projectId; + this._vpcId = value.vpcId; + } + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} +export interface CsPeeringConnectV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#create CsPeeringConnectV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#delete CsPeeringConnectV1#delete} + */ + readonly delete?: string; +} + +export function csPeeringConnectV1TimeoutsToTerraform(struct?: CsPeeringConnectV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csPeeringConnectV1TimeoutsToHclTerraform(struct?: CsPeeringConnectV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsPeeringConnectV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsPeeringConnectV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsPeeringConnectV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1 huaweicloud_cs_peering_connect_v1} +*/ +export class CsPeeringConnectV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cs_peering_connect_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsPeeringConnectV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsPeeringConnectV1 to import + * @param importFromId The id of the existing CsPeeringConnectV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsPeeringConnectV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cs_peering_connect_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect_v1 huaweicloud_cs_peering_connect_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsPeeringConnectV1Config + */ + public constructor(scope: Construct, id: string, config: CsPeeringConnectV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cs_peering_connect_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._targetVpcInfo.internalValue = config.targetVpcInfo; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_vpc_info - computed: false, optional: true, required: false + private _targetVpcInfo = new CsPeeringConnectV1TargetVpcInfoOutputReference(this, "target_vpc_info"); + public get targetVpcInfo() { + return this._targetVpcInfo; + } + public putTargetVpcInfo(value: CsPeeringConnectV1TargetVpcInfo) { + this._targetVpcInfo.internalValue = value; + } + public resetTargetVpcInfo() { + this._targetVpcInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetVpcInfoInput() { + return this._targetVpcInfo.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsPeeringConnectV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsPeeringConnectV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + target_vpc_info: csPeeringConnectV1TargetVpcInfoToTerraform(this._targetVpcInfo.internalValue), + timeouts: csPeeringConnectV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_vpc_info: { + value: csPeeringConnectV1TargetVpcInfoToHclTerraform(this._targetVpcInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "CsPeeringConnectV1TargetVpcInfoList", + }, + timeouts: { + value: csPeeringConnectV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsPeeringConnectV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cs-peering-connect/README.md b/src/constructs/providers/huaweicloud/cs-peering-connect/README.md new file mode 100644 index 00000000..8db2f32a --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-peering-connect/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cs_peering_connect` + +Refer to the Terraform Registry for docs: [`huaweicloud_cs_peering_connect`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect). diff --git a/src/constructs/providers/huaweicloud/cs-peering-connect/index.ts b/src/constructs/providers/huaweicloud/cs-peering-connect/index.ts new file mode 100644 index 00000000..6650c097 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-peering-connect/index.ts @@ -0,0 +1,495 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsPeeringConnectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#cluster_id CsPeeringConnect#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#id CsPeeringConnect#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#name CsPeeringConnect#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#region CsPeeringConnect#region} + */ + readonly region?: string; + /** + * target_vpc_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#target_vpc_info CsPeeringConnect#target_vpc_info} + */ + readonly targetVpcInfo?: CsPeeringConnectTargetVpcInfo; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#timeouts CsPeeringConnect#timeouts} + */ + readonly timeouts?: CsPeeringConnectTimeouts; +} +export interface CsPeeringConnectTargetVpcInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#project_id CsPeeringConnect#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#vpc_id CsPeeringConnect#vpc_id} + */ + readonly vpcId: string; +} + +export function csPeeringConnectTargetVpcInfoToTerraform(struct?: CsPeeringConnectTargetVpcInfoOutputReference | CsPeeringConnectTargetVpcInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project_id: cdktf.stringToTerraform(struct!.projectId), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function csPeeringConnectTargetVpcInfoToHclTerraform(struct?: CsPeeringConnectTargetVpcInfoOutputReference | CsPeeringConnectTargetVpcInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsPeeringConnectTargetVpcInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CsPeeringConnectTargetVpcInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsPeeringConnectTargetVpcInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._projectId = undefined; + this._vpcId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._projectId = value.projectId; + this._vpcId = value.vpcId; + } + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} +export interface CsPeeringConnectTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#create CsPeeringConnect#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#delete CsPeeringConnect#delete} + */ + readonly delete?: string; +} + +export function csPeeringConnectTimeoutsToTerraform(struct?: CsPeeringConnectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csPeeringConnectTimeoutsToHclTerraform(struct?: CsPeeringConnectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsPeeringConnectTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsPeeringConnectTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsPeeringConnectTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect huaweicloud_cs_peering_connect} +*/ +export class CsPeeringConnect extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cs_peering_connect"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsPeeringConnect resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsPeeringConnect to import + * @param importFromId The id of the existing CsPeeringConnect that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsPeeringConnect to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cs_peering_connect", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_peering_connect huaweicloud_cs_peering_connect} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsPeeringConnectConfig + */ + public constructor(scope: Construct, id: string, config: CsPeeringConnectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cs_peering_connect', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._targetVpcInfo.internalValue = config.targetVpcInfo; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_vpc_info - computed: false, optional: true, required: false + private _targetVpcInfo = new CsPeeringConnectTargetVpcInfoOutputReference(this, "target_vpc_info"); + public get targetVpcInfo() { + return this._targetVpcInfo; + } + public putTargetVpcInfo(value: CsPeeringConnectTargetVpcInfo) { + this._targetVpcInfo.internalValue = value; + } + public resetTargetVpcInfo() { + this._targetVpcInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetVpcInfoInput() { + return this._targetVpcInfo.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsPeeringConnectTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsPeeringConnectTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + target_vpc_info: csPeeringConnectTargetVpcInfoToTerraform(this._targetVpcInfo.internalValue), + timeouts: csPeeringConnectTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_vpc_info: { + value: csPeeringConnectTargetVpcInfoToHclTerraform(this._targetVpcInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "CsPeeringConnectTargetVpcInfoList", + }, + timeouts: { + value: csPeeringConnectTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsPeeringConnectTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cs-route-v1/README.md b/src/constructs/providers/huaweicloud/cs-route-v1/README.md new file mode 100644 index 00000000..151da041 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-route-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cs_route_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_cs_route_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1). diff --git a/src/constructs/providers/huaweicloud/cs-route-v1/index.ts b/src/constructs/providers/huaweicloud/cs-route-v1/index.ts new file mode 100644 index 00000000..f12a5bbe --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-route-v1/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsRouteV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1#cluster_id CsRouteV1#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1#destination CsRouteV1#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1#id CsRouteV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1#peering_id CsRouteV1#peering_id} + */ + readonly peeringId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1#region CsRouteV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1 huaweicloud_cs_route_v1} +*/ +export class CsRouteV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cs_route_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsRouteV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsRouteV1 to import + * @param importFromId The id of the existing CsRouteV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsRouteV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cs_route_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route_v1 huaweicloud_cs_route_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsRouteV1Config + */ + public constructor(scope: Construct, id: string, config: CsRouteV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cs_route_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._destination = config.destination; + this._id = config.id; + this._peeringId = config.peeringId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // peering_id - computed: false, optional: false, required: true + private _peeringId?: string; + public get peeringId() { + return this.getStringAttribute('peering_id'); + } + public set peeringId(value: string) { + this._peeringId = value; + } + // Temporarily expose input value. Use with caution. + public get peeringIdInput() { + return this._peeringId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + peering_id: cdktf.stringToTerraform(this._peeringId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peering_id: { + value: cdktf.stringToHclTerraform(this._peeringId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cs-route/README.md b/src/constructs/providers/huaweicloud/cs-route/README.md new file mode 100644 index 00000000..d2475c49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-route/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cs_route` + +Refer to the Terraform Registry for docs: [`huaweicloud_cs_route`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route). diff --git a/src/constructs/providers/huaweicloud/cs-route/index.ts b/src/constructs/providers/huaweicloud/cs-route/index.ts new file mode 100644 index 00000000..824af99f --- /dev/null +++ b/src/constructs/providers/huaweicloud/cs-route/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsRouteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route#cluster_id CsRoute#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route#destination CsRoute#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route#id CsRoute#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route#peering_id CsRoute#peering_id} + */ + readonly peeringId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route#region CsRoute#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route huaweicloud_cs_route} +*/ +export class CsRoute extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cs_route"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsRoute resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsRoute to import + * @param importFromId The id of the existing CsRoute that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsRoute to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cs_route", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cs_route huaweicloud_cs_route} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsRouteConfig + */ + public constructor(scope: Construct, id: string, config: CsRouteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cs_route', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._destination = config.destination; + this._id = config.id; + this._peeringId = config.peeringId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // peering_id - computed: false, optional: false, required: true + private _peeringId?: string; + public get peeringId() { + return this.getStringAttribute('peering_id'); + } + public set peeringId(value: string) { + this._peeringId = value; + } + // Temporarily expose input value. Use with caution. + public get peeringIdInput() { + return this._peeringId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + peering_id: cdktf.stringToTerraform(this._peeringId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peering_id: { + value: cdktf.stringToHclTerraform(this._peeringId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csbs-backup-policy-v1/README.md b/src/constructs/providers/huaweicloud/csbs-backup-policy-v1/README.md new file mode 100644 index 00000000..7dd42ae2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup-policy-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csbs_backup_policy_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_csbs_backup_policy_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1). diff --git a/src/constructs/providers/huaweicloud/csbs-backup-policy-v1/index.ts b/src/constructs/providers/huaweicloud/csbs-backup-policy-v1/index.ts new file mode 100644 index 00000000..7de57fc0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup-policy-v1/index.ts @@ -0,0 +1,979 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsbsBackupPolicyV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#common CsbsBackupPolicyV1#common} + */ + readonly common?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#description CsbsBackupPolicyV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#id CsbsBackupPolicyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#name CsbsBackupPolicyV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#provider_id CsbsBackupPolicyV1#provider_id} + */ + readonly providerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#region CsbsBackupPolicyV1#region} + */ + readonly region?: string; + /** + * resource block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#resource CsbsBackupPolicyV1#resource} + */ + readonly resource: CsbsBackupPolicyV1Resource[] | cdktf.IResolvable; + /** + * scheduled_operation block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#scheduled_operation CsbsBackupPolicyV1#scheduled_operation} + */ + readonly scheduledOperation: CsbsBackupPolicyV1ScheduledOperation; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#timeouts CsbsBackupPolicyV1#timeouts} + */ + readonly timeouts?: CsbsBackupPolicyV1Timeouts; +} +export interface CsbsBackupPolicyV1Resource { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#id CsbsBackupPolicyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#name CsbsBackupPolicyV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#type CsbsBackupPolicyV1#type} + */ + readonly type: string; +} + +export function csbsBackupPolicyV1ResourceToTerraform(struct?: CsbsBackupPolicyV1Resource | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function csbsBackupPolicyV1ResourceToHclTerraform(struct?: CsbsBackupPolicyV1Resource | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupPolicyV1ResourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CsbsBackupPolicyV1Resource | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupPolicyV1Resource | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._name = value.name; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CsbsBackupPolicyV1ResourceList extends cdktf.ComplexList { + public internalValue? : CsbsBackupPolicyV1Resource[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CsbsBackupPolicyV1ResourceOutputReference { + return new CsbsBackupPolicyV1ResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CsbsBackupPolicyV1ScheduledOperation { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#description CsbsBackupPolicyV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#enabled CsbsBackupPolicyV1#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#max_backups CsbsBackupPolicyV1#max_backups} + */ + readonly maxBackups?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#name CsbsBackupPolicyV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#operation_type CsbsBackupPolicyV1#operation_type} + */ + readonly operationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#permanent CsbsBackupPolicyV1#permanent} + */ + readonly permanent?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#retention_duration_days CsbsBackupPolicyV1#retention_duration_days} + */ + readonly retentionDurationDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#trigger_pattern CsbsBackupPolicyV1#trigger_pattern} + */ + readonly triggerPattern: string; +} + +export function csbsBackupPolicyV1ScheduledOperationToTerraform(struct?: CsbsBackupPolicyV1ScheduledOperationOutputReference | CsbsBackupPolicyV1ScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + enabled: cdktf.booleanToTerraform(struct!.enabled), + max_backups: cdktf.numberToTerraform(struct!.maxBackups), + name: cdktf.stringToTerraform(struct!.name), + operation_type: cdktf.stringToTerraform(struct!.operationType), + permanent: cdktf.booleanToTerraform(struct!.permanent), + retention_duration_days: cdktf.numberToTerraform(struct!.retentionDurationDays), + trigger_pattern: cdktf.stringToTerraform(struct!.triggerPattern), + } +} + + +export function csbsBackupPolicyV1ScheduledOperationToHclTerraform(struct?: CsbsBackupPolicyV1ScheduledOperationOutputReference | CsbsBackupPolicyV1ScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_backups: { + value: cdktf.numberToHclTerraform(struct!.maxBackups), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation_type: { + value: cdktf.stringToHclTerraform(struct!.operationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permanent: { + value: cdktf.booleanToHclTerraform(struct!.permanent), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + retention_duration_days: { + value: cdktf.numberToHclTerraform(struct!.retentionDurationDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_pattern: { + value: cdktf.stringToHclTerraform(struct!.triggerPattern), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupPolicyV1ScheduledOperationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CsbsBackupPolicyV1ScheduledOperation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._maxBackups !== undefined) { + hasAnyValues = true; + internalValueResult.maxBackups = this._maxBackups; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._operationType !== undefined) { + hasAnyValues = true; + internalValueResult.operationType = this._operationType; + } + if (this._permanent !== undefined) { + hasAnyValues = true; + internalValueResult.permanent = this._permanent; + } + if (this._retentionDurationDays !== undefined) { + hasAnyValues = true; + internalValueResult.retentionDurationDays = this._retentionDurationDays; + } + if (this._triggerPattern !== undefined) { + hasAnyValues = true; + internalValueResult.triggerPattern = this._triggerPattern; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupPolicyV1ScheduledOperation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._enabled = undefined; + this._maxBackups = undefined; + this._name = undefined; + this._operationType = undefined; + this._permanent = undefined; + this._retentionDurationDays = undefined; + this._triggerPattern = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._enabled = value.enabled; + this._maxBackups = value.maxBackups; + this._name = value.name; + this._operationType = value.operationType; + this._permanent = value.permanent; + this._retentionDurationDays = value.retentionDurationDays; + this._triggerPattern = value.triggerPattern; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_backups - computed: false, optional: true, required: false + private _maxBackups?: number; + public get maxBackups() { + return this.getNumberAttribute('max_backups'); + } + public set maxBackups(value: number) { + this._maxBackups = value; + } + public resetMaxBackups() { + this._maxBackups = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxBackupsInput() { + return this._maxBackups; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operation_type - computed: false, optional: false, required: true + private _operationType?: string; + public get operationType() { + return this.getStringAttribute('operation_type'); + } + public set operationType(value: string) { + this._operationType = value; + } + // Temporarily expose input value. Use with caution. + public get operationTypeInput() { + return this._operationType; + } + + // permanent - computed: true, optional: true, required: false + private _permanent?: boolean | cdktf.IResolvable; + public get permanent() { + return this.getBooleanAttribute('permanent'); + } + public set permanent(value: boolean | cdktf.IResolvable) { + this._permanent = value; + } + public resetPermanent() { + this._permanent = undefined; + } + // Temporarily expose input value. Use with caution. + public get permanentInput() { + return this._permanent; + } + + // retention_duration_days - computed: false, optional: true, required: false + private _retentionDurationDays?: number; + public get retentionDurationDays() { + return this.getNumberAttribute('retention_duration_days'); + } + public set retentionDurationDays(value: number) { + this._retentionDurationDays = value; + } + public resetRetentionDurationDays() { + this._retentionDurationDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionDurationDaysInput() { + return this._retentionDurationDays; + } + + // trigger_id - computed: true, optional: false, required: false + public get triggerId() { + return this.getStringAttribute('trigger_id'); + } + + // trigger_name - computed: true, optional: false, required: false + public get triggerName() { + return this.getStringAttribute('trigger_name'); + } + + // trigger_pattern - computed: false, optional: false, required: true + private _triggerPattern?: string; + public get triggerPattern() { + return this.getStringAttribute('trigger_pattern'); + } + public set triggerPattern(value: string) { + this._triggerPattern = value; + } + // Temporarily expose input value. Use with caution. + public get triggerPatternInput() { + return this._triggerPattern; + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} +export interface CsbsBackupPolicyV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#create CsbsBackupPolicyV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#delete CsbsBackupPolicyV1#delete} + */ + readonly delete?: string; +} + +export function csbsBackupPolicyV1TimeoutsToTerraform(struct?: CsbsBackupPolicyV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csbsBackupPolicyV1TimeoutsToHclTerraform(struct?: CsbsBackupPolicyV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupPolicyV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsbsBackupPolicyV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupPolicyV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1 huaweicloud_csbs_backup_policy_v1} +*/ +export class CsbsBackupPolicyV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup_policy_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsbsBackupPolicyV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsbsBackupPolicyV1 to import + * @param importFromId The id of the existing CsbsBackupPolicyV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsbsBackupPolicyV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup_policy_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy_v1 huaweicloud_csbs_backup_policy_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsbsBackupPolicyV1Config + */ + public constructor(scope: Construct, id: string, config: CsbsBackupPolicyV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup_policy_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._common = config.common; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._providerId = config.providerId; + this._region = config.region; + this._resource.internalValue = config.resource; + this._scheduledOperation.internalValue = config.scheduledOperation; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // common - computed: false, optional: true, required: false + private _common?: { [key: string]: string }; + public get common() { + return this.getStringMapAttribute('common'); + } + public set common(value: { [key: string]: string }) { + this._common = value; + } + public resetCommon() { + this._common = undefined; + } + // Temporarily expose input value. Use with caution. + public get commonInput() { + return this._common; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_id - computed: false, optional: true, required: false + private _providerId?: string; + public get providerId() { + return this.getStringAttribute('provider_id'); + } + public set providerId(value: string) { + this._providerId = value; + } + public resetProviderId() { + this._providerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get providerIdInput() { + return this._providerId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // resource - computed: false, optional: false, required: true + private _resource = new CsbsBackupPolicyV1ResourceList(this, "resource", true); + public get resource() { + return this._resource; + } + public putResource(value: CsbsBackupPolicyV1Resource[] | cdktf.IResolvable) { + this._resource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourceInput() { + return this._resource.internalValue; + } + + // scheduled_operation - computed: false, optional: false, required: true + private _scheduledOperation = new CsbsBackupPolicyV1ScheduledOperationOutputReference(this, "scheduled_operation"); + public get scheduledOperation() { + return this._scheduledOperation; + } + public putScheduledOperation(value: CsbsBackupPolicyV1ScheduledOperation) { + this._scheduledOperation.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get scheduledOperationInput() { + return this._scheduledOperation.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsbsBackupPolicyV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsbsBackupPolicyV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + common: cdktf.hashMapper(cdktf.stringToTerraform)(this._common), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + provider_id: cdktf.stringToTerraform(this._providerId), + region: cdktf.stringToTerraform(this._region), + resource: cdktf.listMapper(csbsBackupPolicyV1ResourceToTerraform, true)(this._resource.internalValue), + scheduled_operation: csbsBackupPolicyV1ScheduledOperationToTerraform(this._scheduledOperation.internalValue), + timeouts: csbsBackupPolicyV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + common: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._common), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_id: { + value: cdktf.stringToHclTerraform(this._providerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource: { + value: cdktf.listMapperHcl(csbsBackupPolicyV1ResourceToHclTerraform, true)(this._resource.internalValue), + isBlock: true, + type: "set", + storageClassType: "CsbsBackupPolicyV1ResourceList", + }, + scheduled_operation: { + value: csbsBackupPolicyV1ScheduledOperationToHclTerraform(this._scheduledOperation.internalValue), + isBlock: true, + type: "list", + storageClassType: "CsbsBackupPolicyV1ScheduledOperationList", + }, + timeouts: { + value: csbsBackupPolicyV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsbsBackupPolicyV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csbs-backup-policy/README.md b/src/constructs/providers/huaweicloud/csbs-backup-policy/README.md new file mode 100644 index 00000000..3ab1f24e --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csbs_backup_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_csbs_backup_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy). diff --git a/src/constructs/providers/huaweicloud/csbs-backup-policy/index.ts b/src/constructs/providers/huaweicloud/csbs-backup-policy/index.ts new file mode 100644 index 00000000..28d7b8e6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup-policy/index.ts @@ -0,0 +1,979 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsbsBackupPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#common CsbsBackupPolicy#common} + */ + readonly common?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#description CsbsBackupPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#id CsbsBackupPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#name CsbsBackupPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#provider_id CsbsBackupPolicy#provider_id} + */ + readonly providerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#region CsbsBackupPolicy#region} + */ + readonly region?: string; + /** + * resource block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#resource CsbsBackupPolicy#resource} + */ + readonly resource: CsbsBackupPolicyResource[] | cdktf.IResolvable; + /** + * scheduled_operation block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#scheduled_operation CsbsBackupPolicy#scheduled_operation} + */ + readonly scheduledOperation: CsbsBackupPolicyScheduledOperation; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#timeouts CsbsBackupPolicy#timeouts} + */ + readonly timeouts?: CsbsBackupPolicyTimeouts; +} +export interface CsbsBackupPolicyResource { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#id CsbsBackupPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#name CsbsBackupPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#type CsbsBackupPolicy#type} + */ + readonly type: string; +} + +export function csbsBackupPolicyResourceToTerraform(struct?: CsbsBackupPolicyResource | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function csbsBackupPolicyResourceToHclTerraform(struct?: CsbsBackupPolicyResource | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupPolicyResourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CsbsBackupPolicyResource | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupPolicyResource | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._name = value.name; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class CsbsBackupPolicyResourceList extends cdktf.ComplexList { + public internalValue? : CsbsBackupPolicyResource[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CsbsBackupPolicyResourceOutputReference { + return new CsbsBackupPolicyResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CsbsBackupPolicyScheduledOperation { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#description CsbsBackupPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#enabled CsbsBackupPolicy#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#max_backups CsbsBackupPolicy#max_backups} + */ + readonly maxBackups?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#name CsbsBackupPolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#operation_type CsbsBackupPolicy#operation_type} + */ + readonly operationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#permanent CsbsBackupPolicy#permanent} + */ + readonly permanent?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#retention_duration_days CsbsBackupPolicy#retention_duration_days} + */ + readonly retentionDurationDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#trigger_pattern CsbsBackupPolicy#trigger_pattern} + */ + readonly triggerPattern: string; +} + +export function csbsBackupPolicyScheduledOperationToTerraform(struct?: CsbsBackupPolicyScheduledOperationOutputReference | CsbsBackupPolicyScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + enabled: cdktf.booleanToTerraform(struct!.enabled), + max_backups: cdktf.numberToTerraform(struct!.maxBackups), + name: cdktf.stringToTerraform(struct!.name), + operation_type: cdktf.stringToTerraform(struct!.operationType), + permanent: cdktf.booleanToTerraform(struct!.permanent), + retention_duration_days: cdktf.numberToTerraform(struct!.retentionDurationDays), + trigger_pattern: cdktf.stringToTerraform(struct!.triggerPattern), + } +} + + +export function csbsBackupPolicyScheduledOperationToHclTerraform(struct?: CsbsBackupPolicyScheduledOperationOutputReference | CsbsBackupPolicyScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_backups: { + value: cdktf.numberToHclTerraform(struct!.maxBackups), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation_type: { + value: cdktf.stringToHclTerraform(struct!.operationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permanent: { + value: cdktf.booleanToHclTerraform(struct!.permanent), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + retention_duration_days: { + value: cdktf.numberToHclTerraform(struct!.retentionDurationDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_pattern: { + value: cdktf.stringToHclTerraform(struct!.triggerPattern), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupPolicyScheduledOperationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CsbsBackupPolicyScheduledOperation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._maxBackups !== undefined) { + hasAnyValues = true; + internalValueResult.maxBackups = this._maxBackups; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._operationType !== undefined) { + hasAnyValues = true; + internalValueResult.operationType = this._operationType; + } + if (this._permanent !== undefined) { + hasAnyValues = true; + internalValueResult.permanent = this._permanent; + } + if (this._retentionDurationDays !== undefined) { + hasAnyValues = true; + internalValueResult.retentionDurationDays = this._retentionDurationDays; + } + if (this._triggerPattern !== undefined) { + hasAnyValues = true; + internalValueResult.triggerPattern = this._triggerPattern; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupPolicyScheduledOperation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._enabled = undefined; + this._maxBackups = undefined; + this._name = undefined; + this._operationType = undefined; + this._permanent = undefined; + this._retentionDurationDays = undefined; + this._triggerPattern = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._enabled = value.enabled; + this._maxBackups = value.maxBackups; + this._name = value.name; + this._operationType = value.operationType; + this._permanent = value.permanent; + this._retentionDurationDays = value.retentionDurationDays; + this._triggerPattern = value.triggerPattern; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_backups - computed: false, optional: true, required: false + private _maxBackups?: number; + public get maxBackups() { + return this.getNumberAttribute('max_backups'); + } + public set maxBackups(value: number) { + this._maxBackups = value; + } + public resetMaxBackups() { + this._maxBackups = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxBackupsInput() { + return this._maxBackups; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operation_type - computed: false, optional: false, required: true + private _operationType?: string; + public get operationType() { + return this.getStringAttribute('operation_type'); + } + public set operationType(value: string) { + this._operationType = value; + } + // Temporarily expose input value. Use with caution. + public get operationTypeInput() { + return this._operationType; + } + + // permanent - computed: true, optional: true, required: false + private _permanent?: boolean | cdktf.IResolvable; + public get permanent() { + return this.getBooleanAttribute('permanent'); + } + public set permanent(value: boolean | cdktf.IResolvable) { + this._permanent = value; + } + public resetPermanent() { + this._permanent = undefined; + } + // Temporarily expose input value. Use with caution. + public get permanentInput() { + return this._permanent; + } + + // retention_duration_days - computed: false, optional: true, required: false + private _retentionDurationDays?: number; + public get retentionDurationDays() { + return this.getNumberAttribute('retention_duration_days'); + } + public set retentionDurationDays(value: number) { + this._retentionDurationDays = value; + } + public resetRetentionDurationDays() { + this._retentionDurationDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionDurationDaysInput() { + return this._retentionDurationDays; + } + + // trigger_id - computed: true, optional: false, required: false + public get triggerId() { + return this.getStringAttribute('trigger_id'); + } + + // trigger_name - computed: true, optional: false, required: false + public get triggerName() { + return this.getStringAttribute('trigger_name'); + } + + // trigger_pattern - computed: false, optional: false, required: true + private _triggerPattern?: string; + public get triggerPattern() { + return this.getStringAttribute('trigger_pattern'); + } + public set triggerPattern(value: string) { + this._triggerPattern = value; + } + // Temporarily expose input value. Use with caution. + public get triggerPatternInput() { + return this._triggerPattern; + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} +export interface CsbsBackupPolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#create CsbsBackupPolicy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#delete CsbsBackupPolicy#delete} + */ + readonly delete?: string; +} + +export function csbsBackupPolicyTimeoutsToTerraform(struct?: CsbsBackupPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csbsBackupPolicyTimeoutsToHclTerraform(struct?: CsbsBackupPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupPolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsbsBackupPolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupPolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy huaweicloud_csbs_backup_policy} +*/ +export class CsbsBackupPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsbsBackupPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsbsBackupPolicy to import + * @param importFromId The id of the existing CsbsBackupPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsbsBackupPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_policy huaweicloud_csbs_backup_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsbsBackupPolicyConfig + */ + public constructor(scope: Construct, id: string, config: CsbsBackupPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._common = config.common; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._providerId = config.providerId; + this._region = config.region; + this._resource.internalValue = config.resource; + this._scheduledOperation.internalValue = config.scheduledOperation; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // common - computed: false, optional: true, required: false + private _common?: { [key: string]: string }; + public get common() { + return this.getStringMapAttribute('common'); + } + public set common(value: { [key: string]: string }) { + this._common = value; + } + public resetCommon() { + this._common = undefined; + } + // Temporarily expose input value. Use with caution. + public get commonInput() { + return this._common; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_id - computed: false, optional: true, required: false + private _providerId?: string; + public get providerId() { + return this.getStringAttribute('provider_id'); + } + public set providerId(value: string) { + this._providerId = value; + } + public resetProviderId() { + this._providerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get providerIdInput() { + return this._providerId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // resource - computed: false, optional: false, required: true + private _resource = new CsbsBackupPolicyResourceList(this, "resource", true); + public get resource() { + return this._resource; + } + public putResource(value: CsbsBackupPolicyResource[] | cdktf.IResolvable) { + this._resource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourceInput() { + return this._resource.internalValue; + } + + // scheduled_operation - computed: false, optional: false, required: true + private _scheduledOperation = new CsbsBackupPolicyScheduledOperationOutputReference(this, "scheduled_operation"); + public get scheduledOperation() { + return this._scheduledOperation; + } + public putScheduledOperation(value: CsbsBackupPolicyScheduledOperation) { + this._scheduledOperation.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get scheduledOperationInput() { + return this._scheduledOperation.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsbsBackupPolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsbsBackupPolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + common: cdktf.hashMapper(cdktf.stringToTerraform)(this._common), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + provider_id: cdktf.stringToTerraform(this._providerId), + region: cdktf.stringToTerraform(this._region), + resource: cdktf.listMapper(csbsBackupPolicyResourceToTerraform, true)(this._resource.internalValue), + scheduled_operation: csbsBackupPolicyScheduledOperationToTerraform(this._scheduledOperation.internalValue), + timeouts: csbsBackupPolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + common: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._common), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_id: { + value: cdktf.stringToHclTerraform(this._providerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource: { + value: cdktf.listMapperHcl(csbsBackupPolicyResourceToHclTerraform, true)(this._resource.internalValue), + isBlock: true, + type: "set", + storageClassType: "CsbsBackupPolicyResourceList", + }, + scheduled_operation: { + value: csbsBackupPolicyScheduledOperationToHclTerraform(this._scheduledOperation.internalValue), + isBlock: true, + type: "list", + storageClassType: "CsbsBackupPolicyScheduledOperationList", + }, + timeouts: { + value: csbsBackupPolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsbsBackupPolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csbs-backup-v1/README.md b/src/constructs/providers/huaweicloud/csbs-backup-v1/README.md new file mode 100644 index 00000000..e56f955b --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csbs_backup_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_csbs_backup_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1). diff --git a/src/constructs/providers/huaweicloud/csbs-backup-v1/index.ts b/src/constructs/providers/huaweicloud/csbs-backup-v1/index.ts new file mode 100644 index 00000000..f84d34ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup-v1/index.ts @@ -0,0 +1,687 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsbsBackupV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#backup_name CsbsBackupV1#backup_name} + */ + readonly backupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#description CsbsBackupV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#id CsbsBackupV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#region CsbsBackupV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#resource_id CsbsBackupV1#resource_id} + */ + readonly resourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#resource_type CsbsBackupV1#resource_type} + */ + readonly resourceType?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#timeouts CsbsBackupV1#timeouts} + */ + readonly timeouts?: CsbsBackupV1Timeouts; +} +export interface CsbsBackupV1VmMetadata { +} + +export function csbsBackupV1VmMetadataToTerraform(struct?: CsbsBackupV1VmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function csbsBackupV1VmMetadataToHclTerraform(struct?: CsbsBackupV1VmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CsbsBackupV1VmMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CsbsBackupV1VmMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupV1VmMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_service_type - computed: true, optional: false, required: false + public get cloudServiceType() { + return this.getStringAttribute('cloud_service_type'); + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getNumberAttribute('disk'); + } + + // eip - computed: true, optional: false, required: false + public get eip() { + return this.getStringAttribute('eip'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class CsbsBackupV1VmMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CsbsBackupV1VmMetadataOutputReference { + return new CsbsBackupV1VmMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CsbsBackupV1VolumeBackups { +} + +export function csbsBackupV1VolumeBackupsToTerraform(struct?: CsbsBackupV1VolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function csbsBackupV1VolumeBackupsToHclTerraform(struct?: CsbsBackupV1VolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CsbsBackupV1VolumeBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CsbsBackupV1VolumeBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupV1VolumeBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // average_speed - computed: true, optional: false, required: false + public get averageSpeed() { + return this.getNumberAttribute('average_speed'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // incremental - computed: true, optional: false, required: false + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: false, required: false + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + + // source_volume_id - computed: true, optional: false, required: false + public get sourceVolumeId() { + return this.getStringAttribute('source_volume_id'); + } + + // source_volume_name - computed: true, optional: false, required: false + public get sourceVolumeName() { + return this.getStringAttribute('source_volume_name'); + } + + // source_volume_size - computed: true, optional: false, required: false + public get sourceVolumeSize() { + return this.getNumberAttribute('source_volume_size'); + } + + // space_saving_ratio - computed: true, optional: false, required: false + public get spaceSavingRatio() { + return this.getNumberAttribute('space_saving_ratio'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class CsbsBackupV1VolumeBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CsbsBackupV1VolumeBackupsOutputReference { + return new CsbsBackupV1VolumeBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CsbsBackupV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#create CsbsBackupV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#delete CsbsBackupV1#delete} + */ + readonly delete?: string; +} + +export function csbsBackupV1TimeoutsToTerraform(struct?: CsbsBackupV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csbsBackupV1TimeoutsToHclTerraform(struct?: CsbsBackupV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsbsBackupV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1 huaweicloud_csbs_backup_v1} +*/ +export class CsbsBackupV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsbsBackupV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsbsBackupV1 to import + * @param importFromId The id of the existing CsbsBackupV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsbsBackupV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup_v1 huaweicloud_csbs_backup_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsbsBackupV1Config + */ + public constructor(scope: Construct, id: string, config: CsbsBackupV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupName = config.backupName; + this._description = config.description; + this._id = config.id; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // backup_name - computed: true, optional: true, required: false + private _backupName?: string; + public get backupName() { + return this.getStringAttribute('backup_name'); + } + public set backupName(value: string) { + this._backupName = value; + } + public resetBackupName() { + this._backupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupNameInput() { + return this._backupName; + } + + // backup_record_id - computed: true, optional: false, required: false + public get backupRecordId() { + return this.getStringAttribute('backup_record_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vm_metadata - computed: true, optional: false, required: false + private _vmMetadata = new CsbsBackupV1VmMetadataList(this, "vm_metadata", true); + public get vmMetadata() { + return this._vmMetadata; + } + + // volume_backups - computed: true, optional: false, required: false + private _volumeBackups = new CsbsBackupV1VolumeBackupsList(this, "volume_backups", true); + public get volumeBackups() { + return this._volumeBackups; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsbsBackupV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsbsBackupV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_name: cdktf.stringToTerraform(this._backupName), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + timeouts: csbsBackupV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_name: { + value: cdktf.stringToHclTerraform(this._backupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: csbsBackupV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsbsBackupV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csbs-backup/README.md b/src/constructs/providers/huaweicloud/csbs-backup/README.md new file mode 100644 index 00000000..afc9054a --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csbs_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_csbs_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup). diff --git a/src/constructs/providers/huaweicloud/csbs-backup/index.ts b/src/constructs/providers/huaweicloud/csbs-backup/index.ts new file mode 100644 index 00000000..3791de0b --- /dev/null +++ b/src/constructs/providers/huaweicloud/csbs-backup/index.ts @@ -0,0 +1,687 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsbsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#backup_name CsbsBackup#backup_name} + */ + readonly backupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#description CsbsBackup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#id CsbsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#region CsbsBackup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#resource_id CsbsBackup#resource_id} + */ + readonly resourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#resource_type CsbsBackup#resource_type} + */ + readonly resourceType?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#timeouts CsbsBackup#timeouts} + */ + readonly timeouts?: CsbsBackupTimeouts; +} +export interface CsbsBackupVmMetadata { +} + +export function csbsBackupVmMetadataToTerraform(struct?: CsbsBackupVmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function csbsBackupVmMetadataToHclTerraform(struct?: CsbsBackupVmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CsbsBackupVmMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CsbsBackupVmMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupVmMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_service_type - computed: true, optional: false, required: false + public get cloudServiceType() { + return this.getStringAttribute('cloud_service_type'); + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getNumberAttribute('disk'); + } + + // eip - computed: true, optional: false, required: false + public get eip() { + return this.getStringAttribute('eip'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class CsbsBackupVmMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CsbsBackupVmMetadataOutputReference { + return new CsbsBackupVmMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CsbsBackupVolumeBackups { +} + +export function csbsBackupVolumeBackupsToTerraform(struct?: CsbsBackupVolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function csbsBackupVolumeBackupsToHclTerraform(struct?: CsbsBackupVolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CsbsBackupVolumeBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CsbsBackupVolumeBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupVolumeBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // average_speed - computed: true, optional: false, required: false + public get averageSpeed() { + return this.getNumberAttribute('average_speed'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // incremental - computed: true, optional: false, required: false + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: false, required: false + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + + // source_volume_id - computed: true, optional: false, required: false + public get sourceVolumeId() { + return this.getStringAttribute('source_volume_id'); + } + + // source_volume_name - computed: true, optional: false, required: false + public get sourceVolumeName() { + return this.getStringAttribute('source_volume_name'); + } + + // source_volume_size - computed: true, optional: false, required: false + public get sourceVolumeSize() { + return this.getNumberAttribute('source_volume_size'); + } + + // space_saving_ratio - computed: true, optional: false, required: false + public get spaceSavingRatio() { + return this.getNumberAttribute('space_saving_ratio'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class CsbsBackupVolumeBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CsbsBackupVolumeBackupsOutputReference { + return new CsbsBackupVolumeBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CsbsBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#create CsbsBackup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#delete CsbsBackup#delete} + */ + readonly delete?: string; +} + +export function csbsBackupTimeoutsToTerraform(struct?: CsbsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function csbsBackupTimeoutsToHclTerraform(struct?: CsbsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CsbsBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CsbsBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CsbsBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup huaweicloud_csbs_backup} +*/ +export class CsbsBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsbsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsbsBackup to import + * @param importFromId The id of the existing CsbsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsbsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csbs_backup huaweicloud_csbs_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsbsBackupConfig + */ + public constructor(scope: Construct, id: string, config: CsbsBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupName = config.backupName; + this._description = config.description; + this._id = config.id; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // backup_name - computed: true, optional: true, required: false + private _backupName?: string; + public get backupName() { + return this.getStringAttribute('backup_name'); + } + public set backupName(value: string) { + this._backupName = value; + } + public resetBackupName() { + this._backupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupNameInput() { + return this._backupName; + } + + // backup_record_id - computed: true, optional: false, required: false + public get backupRecordId() { + return this.getStringAttribute('backup_record_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vm_metadata - computed: true, optional: false, required: false + private _vmMetadata = new CsbsBackupVmMetadataList(this, "vm_metadata", true); + public get vmMetadata() { + return this._vmMetadata; + } + + // volume_backups - computed: true, optional: false, required: false + private _volumeBackups = new CsbsBackupVolumeBackupsList(this, "volume_backups", true); + public get volumeBackups() { + return this._volumeBackups; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CsbsBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CsbsBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_name: cdktf.stringToTerraform(this._backupName), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + timeouts: csbsBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_name: { + value: cdktf.stringToHclTerraform(this._backupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: csbsBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CsbsBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/README.md b/src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/README.md new file mode 100644 index 00000000..39d9ee73 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cse_microservice_engine_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_cse_microservice_engine_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration). diff --git a/src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/index.ts b/src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/index.ts new file mode 100644 index 00000000..319c02b4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice-engine-configuration/index.ts @@ -0,0 +1,391 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CseMicroserviceEngineConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * The user password that used to pass the RBAC control. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#admin_pass CseMicroserviceEngineConfiguration#admin_pass} + */ + readonly adminPass?: string; + /** + * The user name that used to pass the RBAC control. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#admin_user CseMicroserviceEngineConfiguration#admin_user} + */ + readonly adminUser?: string; + /** + * The address that used to request the access token. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#auth_address CseMicroserviceEngineConfiguration#auth_address} + */ + readonly authAddress: string; + /** + * The address that used to send requests and manage configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#connect_address CseMicroserviceEngineConfiguration#connect_address} + */ + readonly connectAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#id CseMicroserviceEngineConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The configuration key (item name). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#key CseMicroserviceEngineConfiguration#key} + */ + readonly key: string; + /** + * The configuration status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#status CseMicroserviceEngineConfiguration#status} + */ + readonly status?: string; + /** + * The key/value pairs to associate with the configuration that used to filter resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#tags CseMicroserviceEngineConfiguration#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The configuration value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#value CseMicroserviceEngineConfiguration#value} + */ + readonly value: string; + /** + * The type of the configuration value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#value_type CseMicroserviceEngineConfiguration#value_type} + */ + readonly valueType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration huaweicloud_cse_microservice_engine_configuration} +*/ +export class CseMicroserviceEngineConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cse_microservice_engine_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CseMicroserviceEngineConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CseMicroserviceEngineConfiguration to import + * @param importFromId The id of the existing CseMicroserviceEngineConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CseMicroserviceEngineConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cse_microservice_engine_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine_configuration huaweicloud_cse_microservice_engine_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CseMicroserviceEngineConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: CseMicroserviceEngineConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cse_microservice_engine_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._adminUser = config.adminUser; + this._authAddress = config.authAddress; + this._connectAddress = config.connectAddress; + this._id = config.id; + this._key = config.key; + this._status = config.status; + this._tags = config.tags; + this._value = config.value; + this._valueType = config.valueType; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // admin_user - computed: false, optional: true, required: false + private _adminUser?: string; + public get adminUser() { + return this.getStringAttribute('admin_user'); + } + public set adminUser(value: string) { + this._adminUser = value; + } + public resetAdminUser() { + this._adminUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminUserInput() { + return this._adminUser; + } + + // auth_address - computed: false, optional: false, required: true + private _authAddress?: string; + public get authAddress() { + return this.getStringAttribute('auth_address'); + } + public set authAddress(value: string) { + this._authAddress = value; + } + // Temporarily expose input value. Use with caution. + public get authAddressInput() { + return this._authAddress; + } + + // connect_address - computed: false, optional: false, required: true + private _connectAddress?: string; + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + public set connectAddress(value: string) { + this._connectAddress = value; + } + // Temporarily expose input value. Use with caution. + public get connectAddressInput() { + return this._connectAddress; + } + + // create_revision - computed: true, optional: false, required: false + public get createRevision() { + return this.getNumberAttribute('create_revision'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // update_revision - computed: true, optional: false, required: false + public get updateRevision() { + return this.getNumberAttribute('update_revision'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // value_type - computed: false, optional: false, required: true + private _valueType?: string; + public get valueType() { + return this.getStringAttribute('value_type'); + } + public set valueType(value: string) { + this._valueType = value; + } + // Temporarily expose input value. Use with caution. + public get valueTypeInput() { + return this._valueType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + admin_user: cdktf.stringToTerraform(this._adminUser), + auth_address: cdktf.stringToTerraform(this._authAddress), + connect_address: cdktf.stringToTerraform(this._connectAddress), + id: cdktf.stringToTerraform(this._id), + key: cdktf.stringToTerraform(this._key), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + value: cdktf.stringToTerraform(this._value), + value_type: cdktf.stringToTerraform(this._valueType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_user: { + value: cdktf.stringToHclTerraform(this._adminUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_address: { + value: cdktf.stringToHclTerraform(this._authAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connect_address: { + value: cdktf.stringToHclTerraform(this._connectAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_type: { + value: cdktf.stringToHclTerraform(this._valueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cse-microservice-engine/README.md b/src/constructs/providers/huaweicloud/cse-microservice-engine/README.md new file mode 100644 index 00000000..ed6d0420 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice-engine/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cse_microservice_engine` + +Refer to the Terraform Registry for docs: [`huaweicloud_cse_microservice_engine`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine). diff --git a/src/constructs/providers/huaweicloud/cse-microservice-engine/index.ts b/src/constructs/providers/huaweicloud/cse-microservice-engine/index.ts new file mode 100644 index 00000000..1f67098e --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice-engine/index.ts @@ -0,0 +1,779 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CseMicroserviceEngineConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#admin_pass CseMicroserviceEngine#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#auth_type CseMicroserviceEngine#auth_type} + */ + readonly authType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#availability_zones CseMicroserviceEngine#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#description CseMicroserviceEngine#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#eip_id CseMicroserviceEngine#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#enterprise_project_id CseMicroserviceEngine#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#extend_params CseMicroserviceEngine#extend_params} + */ + readonly extendParams?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#flavor CseMicroserviceEngine#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#id CseMicroserviceEngine#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#name CseMicroserviceEngine#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#network_id CseMicroserviceEngine#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#region CseMicroserviceEngine#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#version CseMicroserviceEngine#version} + */ + readonly version?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#timeouts CseMicroserviceEngine#timeouts} + */ + readonly timeouts?: CseMicroserviceEngineTimeouts; +} +export interface CseMicroserviceEngineConfigCenterAddresses { +} + +export function cseMicroserviceEngineConfigCenterAddressesToTerraform(struct?: CseMicroserviceEngineConfigCenterAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cseMicroserviceEngineConfigCenterAddressesToHclTerraform(struct?: CseMicroserviceEngineConfigCenterAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CseMicroserviceEngineConfigCenterAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CseMicroserviceEngineConfigCenterAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CseMicroserviceEngineConfigCenterAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // private - computed: true, optional: false, required: false + public get private() { + return this.getStringAttribute('private'); + } + + // public - computed: true, optional: false, required: false + public get public() { + return this.getStringAttribute('public'); + } +} + +export class CseMicroserviceEngineConfigCenterAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CseMicroserviceEngineConfigCenterAddressesOutputReference { + return new CseMicroserviceEngineConfigCenterAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CseMicroserviceEngineServiceRegistryAddresses { +} + +export function cseMicroserviceEngineServiceRegistryAddressesToTerraform(struct?: CseMicroserviceEngineServiceRegistryAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cseMicroserviceEngineServiceRegistryAddressesToHclTerraform(struct?: CseMicroserviceEngineServiceRegistryAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CseMicroserviceEngineServiceRegistryAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CseMicroserviceEngineServiceRegistryAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CseMicroserviceEngineServiceRegistryAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // private - computed: true, optional: false, required: false + public get private() { + return this.getStringAttribute('private'); + } + + // public - computed: true, optional: false, required: false + public get public() { + return this.getStringAttribute('public'); + } +} + +export class CseMicroserviceEngineServiceRegistryAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CseMicroserviceEngineServiceRegistryAddressesOutputReference { + return new CseMicroserviceEngineServiceRegistryAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CseMicroserviceEngineTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#create CseMicroserviceEngine#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#delete CseMicroserviceEngine#delete} + */ + readonly delete?: string; +} + +export function cseMicroserviceEngineTimeoutsToTerraform(struct?: CseMicroserviceEngineTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cseMicroserviceEngineTimeoutsToHclTerraform(struct?: CseMicroserviceEngineTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CseMicroserviceEngineTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CseMicroserviceEngineTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CseMicroserviceEngineTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine huaweicloud_cse_microservice_engine} +*/ +export class CseMicroserviceEngine extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cse_microservice_engine"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CseMicroserviceEngine resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CseMicroserviceEngine to import + * @param importFromId The id of the existing CseMicroserviceEngine that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CseMicroserviceEngine to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cse_microservice_engine", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_engine huaweicloud_cse_microservice_engine} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CseMicroserviceEngineConfig + */ + public constructor(scope: Construct, id: string, config: CseMicroserviceEngineConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cse_microservice_engine', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._authType = config.authType; + this._availabilityZones = config.availabilityZones; + this._description = config.description; + this._eipId = config.eipId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extendParams = config.extendParams; + this._flavor = config.flavor; + this._id = config.id; + this._name = config.name; + this._networkId = config.networkId; + this._region = config.region; + this._version = config.version; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // auth_type - computed: false, optional: false, required: true + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return cdktf.Fn.tolist(this.getListAttribute('availability_zones')); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // config_center_addresses - computed: true, optional: false, required: false + private _configCenterAddresses = new CseMicroserviceEngineConfigCenterAddressesList(this, "config_center_addresses", false); + public get configCenterAddresses() { + return this._configCenterAddresses; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_params - computed: true, optional: true, required: false + private _extendParams?: { [key: string]: string }; + public get extendParams() { + return this.getStringMapAttribute('extend_params'); + } + public set extendParams(value: { [key: string]: string }) { + this._extendParams = value; + } + public resetExtendParams() { + this._extendParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendParamsInput() { + return this._extendParams; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_limit - computed: true, optional: false, required: false + public get instanceLimit() { + return this.getNumberAttribute('instance_limit'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_limit - computed: true, optional: false, required: false + public get serviceLimit() { + return this.getNumberAttribute('service_limit'); + } + + // service_registry_addresses - computed: true, optional: false, required: false + private _serviceRegistryAddresses = new CseMicroserviceEngineServiceRegistryAddressesList(this, "service_registry_addresses", false); + public get serviceRegistryAddresses() { + return this._serviceRegistryAddresses; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CseMicroserviceEngineTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CseMicroserviceEngineTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + auth_type: cdktf.stringToTerraform(this._authType), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + description: cdktf.stringToTerraform(this._description), + eip_id: cdktf.stringToTerraform(this._eipId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extend_params: cdktf.hashMapper(cdktf.stringToTerraform)(this._extendParams), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + timeouts: cseMicroserviceEngineTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_params: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extendParams), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cseMicroserviceEngineTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CseMicroserviceEngineTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cse-microservice-instance/README.md b/src/constructs/providers/huaweicloud/cse-microservice-instance/README.md new file mode 100644 index 00000000..470ac5b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cse_microservice_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_cse_microservice_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance). diff --git a/src/constructs/providers/huaweicloud/cse-microservice-instance/index.ts b/src/constructs/providers/huaweicloud/cse-microservice-instance/index.ts new file mode 100644 index 00000000..4a489796 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice-instance/index.ts @@ -0,0 +1,744 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CseMicroserviceInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * The user password that used to pass the RBAC control. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#admin_pass CseMicroserviceInstance#admin_pass} + */ + readonly adminPass?: string; + /** + * The user name that used to pass the RBAC control. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#admin_user CseMicroserviceInstance#admin_user} + */ + readonly adminUser?: string; + /** + * The address that used to request the access token. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#auth_address CseMicroserviceInstance#auth_address} + */ + readonly authAddress?: string; + /** + * The address that used to send requests and manage configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#connect_address CseMicroserviceInstance#connect_address} + */ + readonly connectAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#endpoints CseMicroserviceInstance#endpoints} + */ + readonly endpoints: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#host_name CseMicroserviceInstance#host_name} + */ + readonly hostName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#id CseMicroserviceInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#microservice_id CseMicroserviceInstance#microservice_id} + */ + readonly microserviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#properties CseMicroserviceInstance#properties} + */ + readonly properties?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#version CseMicroserviceInstance#version} + */ + readonly version?: string; + /** + * data_center block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#data_center CseMicroserviceInstance#data_center} + */ + readonly dataCenter?: CseMicroserviceInstanceDataCenter; + /** + * health_check block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#health_check CseMicroserviceInstance#health_check} + */ + readonly healthCheck?: CseMicroserviceInstanceHealthCheck; +} +export interface CseMicroserviceInstanceDataCenter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#availability_zone CseMicroserviceInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#name CseMicroserviceInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#region CseMicroserviceInstance#region} + */ + readonly region: string; +} + +export function cseMicroserviceInstanceDataCenterToTerraform(struct?: CseMicroserviceInstanceDataCenterOutputReference | CseMicroserviceInstanceDataCenter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + name: cdktf.stringToTerraform(struct!.name), + region: cdktf.stringToTerraform(struct!.region), + } +} + + +export function cseMicroserviceInstanceDataCenterToHclTerraform(struct?: CseMicroserviceInstanceDataCenterOutputReference | CseMicroserviceInstanceDataCenter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CseMicroserviceInstanceDataCenterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CseMicroserviceInstanceDataCenter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CseMicroserviceInstanceDataCenter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZone = undefined; + this._name = undefined; + this._region = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZone = value.availabilityZone; + this._name = value.name; + this._region = value.region; + } + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } +} +export interface CseMicroserviceInstanceHealthCheck { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#interval CseMicroserviceInstance#interval} + */ + readonly interval: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#max_retries CseMicroserviceInstance#max_retries} + */ + readonly maxRetries: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#mode CseMicroserviceInstance#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#port CseMicroserviceInstance#port} + */ + readonly port?: number; +} + +export function cseMicroserviceInstanceHealthCheckToTerraform(struct?: CseMicroserviceInstanceHealthCheckOutputReference | CseMicroserviceInstanceHealthCheck): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + interval: cdktf.numberToTerraform(struct!.interval), + max_retries: cdktf.numberToTerraform(struct!.maxRetries), + mode: cdktf.stringToTerraform(struct!.mode), + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function cseMicroserviceInstanceHealthCheckToHclTerraform(struct?: CseMicroserviceInstanceHealthCheckOutputReference | CseMicroserviceInstanceHealthCheck): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries: { + value: cdktf.numberToHclTerraform(struct!.maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CseMicroserviceInstanceHealthCheckOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CseMicroserviceInstanceHealthCheck | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._maxRetries !== undefined) { + hasAnyValues = true; + internalValueResult.maxRetries = this._maxRetries; + } + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CseMicroserviceInstanceHealthCheck | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._interval = undefined; + this._maxRetries = undefined; + this._mode = undefined; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._interval = value.interval; + this._maxRetries = value.maxRetries; + this._mode = value.mode; + this._port = value.port; + } + } + + // interval - computed: false, optional: false, required: true + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // max_retries - computed: false, optional: false, required: true + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance huaweicloud_cse_microservice_instance} +*/ +export class CseMicroserviceInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cse_microservice_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CseMicroserviceInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CseMicroserviceInstance to import + * @param importFromId The id of the existing CseMicroserviceInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CseMicroserviceInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cse_microservice_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice_instance huaweicloud_cse_microservice_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CseMicroserviceInstanceConfig + */ + public constructor(scope: Construct, id: string, config: CseMicroserviceInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cse_microservice_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._adminUser = config.adminUser; + this._authAddress = config.authAddress; + this._connectAddress = config.connectAddress; + this._endpoints = config.endpoints; + this._hostName = config.hostName; + this._id = config.id; + this._microserviceId = config.microserviceId; + this._properties = config.properties; + this._version = config.version; + this._dataCenter.internalValue = config.dataCenter; + this._healthCheck.internalValue = config.healthCheck; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // admin_user - computed: false, optional: true, required: false + private _adminUser?: string; + public get adminUser() { + return this.getStringAttribute('admin_user'); + } + public set adminUser(value: string) { + this._adminUser = value; + } + public resetAdminUser() { + this._adminUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminUserInput() { + return this._adminUser; + } + + // auth_address - computed: true, optional: true, required: false + private _authAddress?: string; + public get authAddress() { + return this.getStringAttribute('auth_address'); + } + public set authAddress(value: string) { + this._authAddress = value; + } + public resetAuthAddress() { + this._authAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get authAddressInput() { + return this._authAddress; + } + + // connect_address - computed: false, optional: false, required: true + private _connectAddress?: string; + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + public set connectAddress(value: string) { + this._connectAddress = value; + } + // Temporarily expose input value. Use with caution. + public get connectAddressInput() { + return this._connectAddress; + } + + // endpoints - computed: false, optional: false, required: true + private _endpoints?: string[]; + public get endpoints() { + return this.getListAttribute('endpoints'); + } + public set endpoints(value: string[]) { + this._endpoints = value; + } + // Temporarily expose input value. Use with caution. + public get endpointsInput() { + return this._endpoints; + } + + // host_name - computed: false, optional: false, required: true + private _hostName?: string; + public get hostName() { + return this.getStringAttribute('host_name'); + } + public set hostName(value: string) { + this._hostName = value; + } + // Temporarily expose input value. Use with caution. + public get hostNameInput() { + return this._hostName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // microservice_id - computed: false, optional: false, required: true + private _microserviceId?: string; + public get microserviceId() { + return this.getStringAttribute('microservice_id'); + } + public set microserviceId(value: string) { + this._microserviceId = value; + } + // Temporarily expose input value. Use with caution. + public get microserviceIdInput() { + return this._microserviceId; + } + + // properties - computed: true, optional: true, required: false + private _properties?: { [key: string]: string }; + public get properties() { + return this.getStringMapAttribute('properties'); + } + public set properties(value: { [key: string]: string }) { + this._properties = value; + } + public resetProperties() { + this._properties = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // data_center - computed: false, optional: true, required: false + private _dataCenter = new CseMicroserviceInstanceDataCenterOutputReference(this, "data_center"); + public get dataCenter() { + return this._dataCenter; + } + public putDataCenter(value: CseMicroserviceInstanceDataCenter) { + this._dataCenter.internalValue = value; + } + public resetDataCenter() { + this._dataCenter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataCenterInput() { + return this._dataCenter.internalValue; + } + + // health_check - computed: false, optional: true, required: false + private _healthCheck = new CseMicroserviceInstanceHealthCheckOutputReference(this, "health_check"); + public get healthCheck() { + return this._healthCheck; + } + public putHealthCheck(value: CseMicroserviceInstanceHealthCheck) { + this._healthCheck.internalValue = value; + } + public resetHealthCheck() { + this._healthCheck.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthCheckInput() { + return this._healthCheck.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + admin_user: cdktf.stringToTerraform(this._adminUser), + auth_address: cdktf.stringToTerraform(this._authAddress), + connect_address: cdktf.stringToTerraform(this._connectAddress), + endpoints: cdktf.listMapper(cdktf.stringToTerraform, false)(this._endpoints), + host_name: cdktf.stringToTerraform(this._hostName), + id: cdktf.stringToTerraform(this._id), + microservice_id: cdktf.stringToTerraform(this._microserviceId), + properties: cdktf.hashMapper(cdktf.stringToTerraform)(this._properties), + version: cdktf.stringToTerraform(this._version), + data_center: cseMicroserviceInstanceDataCenterToTerraform(this._dataCenter.internalValue), + health_check: cseMicroserviceInstanceHealthCheckToTerraform(this._healthCheck.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_user: { + value: cdktf.stringToHclTerraform(this._adminUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_address: { + value: cdktf.stringToHclTerraform(this._authAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connect_address: { + value: cdktf.stringToHclTerraform(this._connectAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoints: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._endpoints), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + host_name: { + value: cdktf.stringToHclTerraform(this._hostName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + microservice_id: { + value: cdktf.stringToHclTerraform(this._microserviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + properties: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._properties), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_center: { + value: cseMicroserviceInstanceDataCenterToHclTerraform(this._dataCenter.internalValue), + isBlock: true, + type: "list", + storageClassType: "CseMicroserviceInstanceDataCenterList", + }, + health_check: { + value: cseMicroserviceInstanceHealthCheckToHclTerraform(this._healthCheck.internalValue), + isBlock: true, + type: "list", + storageClassType: "CseMicroserviceInstanceHealthCheckList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cse-microservice/README.md b/src/constructs/providers/huaweicloud/cse-microservice/README.md new file mode 100644 index 00000000..4bc6c62d --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cse_microservice` + +Refer to the Terraform Registry for docs: [`huaweicloud_cse_microservice`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice). diff --git a/src/constructs/providers/huaweicloud/cse-microservice/index.ts b/src/constructs/providers/huaweicloud/cse-microservice/index.ts new file mode 100644 index 00000000..bb267213 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cse-microservice/index.ts @@ -0,0 +1,397 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CseMicroserviceConfig extends cdktf.TerraformMetaArguments { + /** + * The user password that used to pass the RBAC control. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#admin_pass CseMicroservice#admin_pass} + */ + readonly adminPass?: string; + /** + * The user name that used to pass the RBAC control. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#admin_user CseMicroservice#admin_user} + */ + readonly adminUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#app_name CseMicroservice#app_name} + */ + readonly appName: string; + /** + * The address that used to request the access token. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#auth_address CseMicroservice#auth_address} + */ + readonly authAddress?: string; + /** + * The address that used to send requests and manage configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#connect_address CseMicroservice#connect_address} + */ + readonly connectAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#description CseMicroservice#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#environment CseMicroservice#environment} + */ + readonly environment?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#id CseMicroservice#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#level CseMicroservice#level} + */ + readonly level?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#name CseMicroservice#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#version CseMicroservice#version} + */ + readonly version: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice huaweicloud_cse_microservice} +*/ +export class CseMicroservice extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cse_microservice"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CseMicroservice resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CseMicroservice to import + * @param importFromId The id of the existing CseMicroservice that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CseMicroservice to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cse_microservice", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cse_microservice huaweicloud_cse_microservice} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CseMicroserviceConfig + */ + public constructor(scope: Construct, id: string, config: CseMicroserviceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cse_microservice', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._adminUser = config.adminUser; + this._appName = config.appName; + this._authAddress = config.authAddress; + this._connectAddress = config.connectAddress; + this._description = config.description; + this._environment = config.environment; + this._id = config.id; + this._level = config.level; + this._name = config.name; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // admin_user - computed: false, optional: true, required: false + private _adminUser?: string; + public get adminUser() { + return this.getStringAttribute('admin_user'); + } + public set adminUser(value: string) { + this._adminUser = value; + } + public resetAdminUser() { + this._adminUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminUserInput() { + return this._adminUser; + } + + // app_name - computed: false, optional: false, required: true + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // auth_address - computed: true, optional: true, required: false + private _authAddress?: string; + public get authAddress() { + return this.getStringAttribute('auth_address'); + } + public set authAddress(value: string) { + this._authAddress = value; + } + public resetAuthAddress() { + this._authAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get authAddressInput() { + return this._authAddress; + } + + // connect_address - computed: false, optional: false, required: true + private _connectAddress?: string; + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + public set connectAddress(value: string) { + this._connectAddress = value; + } + // Temporarily expose input value. Use with caution. + public get connectAddressInput() { + return this._connectAddress; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // environment - computed: false, optional: true, required: false + private _environment?: string; + public get environment() { + return this.getStringAttribute('environment'); + } + public set environment(value: string) { + this._environment = value; + } + public resetEnvironment() { + this._environment = undefined; + } + // Temporarily expose input value. Use with caution. + public get environmentInput() { + return this._environment; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + admin_user: cdktf.stringToTerraform(this._adminUser), + app_name: cdktf.stringToTerraform(this._appName), + auth_address: cdktf.stringToTerraform(this._authAddress), + connect_address: cdktf.stringToTerraform(this._connectAddress), + description: cdktf.stringToTerraform(this._description), + environment: cdktf.stringToTerraform(this._environment), + id: cdktf.stringToTerraform(this._id), + level: cdktf.stringToTerraform(this._level), + name: cdktf.stringToTerraform(this._name), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_user: { + value: cdktf.stringToHclTerraform(this._adminUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_name: { + value: cdktf.stringToHclTerraform(this._appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_address: { + value: cdktf.stringToHclTerraform(this._authAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connect_address: { + value: cdktf.stringToHclTerraform(this._connectAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment: { + value: cdktf.stringToHclTerraform(this._environment), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csms-event/README.md b/src/constructs/providers/huaweicloud/csms-event/README.md new file mode 100644 index 00000000..a7335bc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csms-event/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csms_event` + +Refer to the Terraform Registry for docs: [`huaweicloud_csms_event`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event). diff --git a/src/constructs/providers/huaweicloud/csms-event/index.ts b/src/constructs/providers/huaweicloud/csms-event/index.ts new file mode 100644 index 00000000..7d264a8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/csms-event/index.ts @@ -0,0 +1,311 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsmsEventConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the event list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#event_types CsmsEvent#event_types} + */ + readonly eventTypes: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#id CsmsEvent#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of CSMS event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#name CsmsEvent#name} + */ + readonly name: string; + /** + * Specifies the notification target ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#notification_target_id CsmsEvent#notification_target_id} + */ + readonly notificationTargetId: string; + /** + * Specifies the notification target name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#notification_target_name CsmsEvent#notification_target_name} + */ + readonly notificationTargetName: string; + /** + * Specifies the notification target type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#notification_target_type CsmsEvent#notification_target_type} + */ + readonly notificationTargetType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#region CsmsEvent#region} + */ + readonly region?: string; + /** + * Specifies the event status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#status CsmsEvent#status} + */ + readonly status: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event huaweicloud_csms_event} +*/ +export class CsmsEvent extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_event"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsmsEvent resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsmsEvent to import + * @param importFromId The id of the existing CsmsEvent that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsmsEvent to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_event", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_event huaweicloud_csms_event} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsmsEventConfig + */ + public constructor(scope: Construct, id: string, config: CsmsEventConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_event', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._eventTypes = config.eventTypes; + this._id = config.id; + this._name = config.name; + this._notificationTargetId = config.notificationTargetId; + this._notificationTargetName = config.notificationTargetName; + this._notificationTargetType = config.notificationTargetType; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // event_id - computed: true, optional: false, required: false + public get eventId() { + return this.getStringAttribute('event_id'); + } + + // event_types - computed: false, optional: false, required: true + private _eventTypes?: string[]; + public get eventTypes() { + return this.getListAttribute('event_types'); + } + public set eventTypes(value: string[]) { + this._eventTypes = value; + } + // Temporarily expose input value. Use with caution. + public get eventTypesInput() { + return this._eventTypes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_target_id - computed: false, optional: false, required: true + private _notificationTargetId?: string; + public get notificationTargetId() { + return this.getStringAttribute('notification_target_id'); + } + public set notificationTargetId(value: string) { + this._notificationTargetId = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetIdInput() { + return this._notificationTargetId; + } + + // notification_target_name - computed: false, optional: false, required: true + private _notificationTargetName?: string; + public get notificationTargetName() { + return this.getStringAttribute('notification_target_name'); + } + public set notificationTargetName(value: string) { + this._notificationTargetName = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetNameInput() { + return this._notificationTargetName; + } + + // notification_target_type - computed: false, optional: false, required: true + private _notificationTargetType?: string; + public get notificationTargetType() { + return this.getStringAttribute('notification_target_type'); + } + public set notificationTargetType(value: string) { + this._notificationTargetType = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetTypeInput() { + return this._notificationTargetType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: false, required: true + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + event_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._eventTypes), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_target_id: cdktf.stringToTerraform(this._notificationTargetId), + notification_target_name: cdktf.stringToTerraform(this._notificationTargetName), + notification_target_type: cdktf.stringToTerraform(this._notificationTargetType), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + event_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._eventTypes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_id: { + value: cdktf.stringToHclTerraform(this._notificationTargetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_name: { + value: cdktf.stringToHclTerraform(this._notificationTargetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_type: { + value: cdktf.stringToHclTerraform(this._notificationTargetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csms-secret-version-state/README.md b/src/constructs/providers/huaweicloud/csms-secret-version-state/README.md new file mode 100644 index 00000000..4c75a017 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csms-secret-version-state/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csms_secret_version_state` + +Refer to the Terraform Registry for docs: [`huaweicloud_csms_secret_version_state`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state). diff --git a/src/constructs/providers/huaweicloud/csms-secret-version-state/index.ts b/src/constructs/providers/huaweicloud/csms-secret-version-state/index.ts new file mode 100644 index 00000000..a2d6ed3c --- /dev/null +++ b/src/constructs/providers/huaweicloud/csms-secret-version-state/index.ts @@ -0,0 +1,224 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsmsSecretVersionStateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state#id CsmsSecretVersionState#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state#name CsmsSecretVersionState#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state#region CsmsSecretVersionState#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state#secret_name CsmsSecretVersionState#secret_name} + */ + readonly secretName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state#version_id CsmsSecretVersionState#version_id} + */ + readonly versionId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state huaweicloud_csms_secret_version_state} +*/ +export class CsmsSecretVersionState extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_secret_version_state"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsmsSecretVersionState resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsmsSecretVersionState to import + * @param importFromId The id of the existing CsmsSecretVersionState that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsmsSecretVersionState to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_secret_version_state", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret_version_state huaweicloud_csms_secret_version_state} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsmsSecretVersionStateConfig + */ + public constructor(scope: Construct, id: string, config: CsmsSecretVersionStateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_secret_version_state', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._secretName = config.secretName; + this._versionId = config.versionId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_name - computed: false, optional: false, required: true + private _secretName?: string; + public get secretName() { + return this.getStringAttribute('secret_name'); + } + public set secretName(value: string) { + this._secretName = value; + } + // Temporarily expose input value. Use with caution. + public get secretNameInput() { + return this._secretName; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version_id - computed: false, optional: false, required: true + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secret_name: cdktf.stringToTerraform(this._secretName), + version_id: cdktf.stringToTerraform(this._versionId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_name: { + value: cdktf.stringToHclTerraform(this._secretName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/csms-secret/README.md b/src/constructs/providers/huaweicloud/csms-secret/README.md new file mode 100644 index 00000000..2f1b9cc2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csms-secret/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_csms_secret` + +Refer to the Terraform Registry for docs: [`huaweicloud_csms_secret`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret). diff --git a/src/constructs/providers/huaweicloud/csms-secret/index.ts b/src/constructs/providers/huaweicloud/csms-secret/index.ts new file mode 100644 index 00000000..01bfa8e0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/csms-secret/index.ts @@ -0,0 +1,446 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CsmsSecretConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#description CsmsSecret#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#enterprise_project_id CsmsSecret#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#event_subscriptions CsmsSecret#event_subscriptions} + */ + readonly eventSubscriptions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#expire_time CsmsSecret#expire_time} + */ + readonly expireTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#id CsmsSecret#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#kms_key_id CsmsSecret#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#name CsmsSecret#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#region CsmsSecret#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#secret_binary CsmsSecret#secret_binary} + */ + readonly secretBinary?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#secret_text CsmsSecret#secret_text} + */ + readonly secretText?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#secret_type CsmsSecret#secret_type} + */ + readonly secretType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#tags CsmsSecret#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret huaweicloud_csms_secret} +*/ +export class CsmsSecret extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_secret"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CsmsSecret resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CsmsSecret to import + * @param importFromId The id of the existing CsmsSecret that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CsmsSecret to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_secret", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/csms_secret huaweicloud_csms_secret} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CsmsSecretConfig + */ + public constructor(scope: Construct, id: string, config: CsmsSecretConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_secret', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._eventSubscriptions = config.eventSubscriptions; + this._expireTime = config.expireTime; + this._id = config.id; + this._kmsKeyId = config.kmsKeyId; + this._name = config.name; + this._region = config.region; + this._secretBinary = config.secretBinary; + this._secretText = config.secretText; + this._secretType = config.secretType; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // event_subscriptions - computed: false, optional: true, required: false + private _eventSubscriptions?: string[]; + public get eventSubscriptions() { + return cdktf.Fn.tolist(this.getListAttribute('event_subscriptions')); + } + public set eventSubscriptions(value: string[]) { + this._eventSubscriptions = value; + } + public resetEventSubscriptions() { + this._eventSubscriptions = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventSubscriptionsInput() { + return this._eventSubscriptions; + } + + // expire_time - computed: true, optional: true, required: false + private _expireTime?: number; + public get expireTime() { + return this.getNumberAttribute('expire_time'); + } + public set expireTime(value: number) { + this._expireTime = value; + } + public resetExpireTime() { + this._expireTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get expireTimeInput() { + return this._expireTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // latest_version - computed: true, optional: false, required: false + public get latestVersion() { + return this.getStringAttribute('latest_version'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_binary - computed: false, optional: true, required: false + private _secretBinary?: string; + public get secretBinary() { + return this.getStringAttribute('secret_binary'); + } + public set secretBinary(value: string) { + this._secretBinary = value; + } + public resetSecretBinary() { + this._secretBinary = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretBinaryInput() { + return this._secretBinary; + } + + // secret_id - computed: true, optional: false, required: false + public get secretId() { + return this.getStringAttribute('secret_id'); + } + + // secret_text - computed: false, optional: true, required: false + private _secretText?: string; + public get secretText() { + return this.getStringAttribute('secret_text'); + } + public set secretText(value: string) { + this._secretText = value; + } + public resetSecretText() { + this._secretText = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretTextInput() { + return this._secretText; + } + + // secret_type - computed: true, optional: true, required: false + private _secretType?: string; + public get secretType() { + return this.getStringAttribute('secret_type'); + } + public set secretType(value: string) { + this._secretType = value; + } + public resetSecretType() { + this._secretType = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretTypeInput() { + return this._secretType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // version_stages - computed: true, optional: false, required: false + public get versionStages() { + return this.getListAttribute('version_stages'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + event_subscriptions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._eventSubscriptions), + expire_time: cdktf.numberToTerraform(this._expireTime), + id: cdktf.stringToTerraform(this._id), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secret_binary: cdktf.stringToTerraform(this._secretBinary), + secret_text: cdktf.stringToTerraform(this._secretText), + secret_type: cdktf.stringToTerraform(this._secretType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_subscriptions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._eventSubscriptions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + expire_time: { + value: cdktf.numberToHclTerraform(this._expireTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_binary: { + value: cdktf.stringToHclTerraform(this._secretBinary), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_text: { + value: cdktf.stringToHclTerraform(this._secretText), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_type: { + value: cdktf.stringToHclTerraform(this._secretType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-cluster-az-migrate/README.md b/src/constructs/providers/huaweicloud/css-cluster-az-migrate/README.md new file mode 100644 index 00000000..47325c9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-az-migrate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_cluster_az_migrate` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_cluster_az_migrate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate). diff --git a/src/constructs/providers/huaweicloud/css-cluster-az-migrate/index.ts b/src/constructs/providers/huaweicloud/css-cluster-az-migrate/index.ts new file mode 100644 index 00000000..aec3f276 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-az-migrate/index.ts @@ -0,0 +1,474 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssClusterAzMigrateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#agency CssClusterAzMigrate#agency} + */ + readonly agency: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#cluster_id CssClusterAzMigrate#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#enable_force_new CssClusterAzMigrate#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#id CssClusterAzMigrate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#indices_backup_check CssClusterAzMigrate#indices_backup_check} + */ + readonly indicesBackupCheck?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#instance_type CssClusterAzMigrate#instance_type} + */ + readonly instanceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#migrate_type CssClusterAzMigrate#migrate_type} + */ + readonly migrateType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#region CssClusterAzMigrate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#source_az CssClusterAzMigrate#source_az} + */ + readonly sourceAz: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#target_az CssClusterAzMigrate#target_az} + */ + readonly targetAz: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#timeouts CssClusterAzMigrate#timeouts} + */ + readonly timeouts?: CssClusterAzMigrateTimeouts; +} +export interface CssClusterAzMigrateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#create CssClusterAzMigrate#create} + */ + readonly create?: string; +} + +export function cssClusterAzMigrateTimeoutsToTerraform(struct?: CssClusterAzMigrateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssClusterAzMigrateTimeoutsToHclTerraform(struct?: CssClusterAzMigrateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterAzMigrateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssClusterAzMigrateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterAzMigrateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate huaweicloud_css_cluster_az_migrate} +*/ +export class CssClusterAzMigrate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_cluster_az_migrate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssClusterAzMigrate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssClusterAzMigrate to import + * @param importFromId The id of the existing CssClusterAzMigrate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssClusterAzMigrate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_cluster_az_migrate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_az_migrate huaweicloud_css_cluster_az_migrate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssClusterAzMigrateConfig + */ + public constructor(scope: Construct, id: string, config: CssClusterAzMigrateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_cluster_az_migrate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._clusterId = config.clusterId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._indicesBackupCheck = config.indicesBackupCheck; + this._instanceType = config.instanceType; + this._migrateType = config.migrateType; + this._region = config.region; + this._sourceAz = config.sourceAz; + this._targetAz = config.targetAz; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: false, required: true + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // indices_backup_check - computed: false, optional: true, required: false + private _indicesBackupCheck?: boolean | cdktf.IResolvable; + public get indicesBackupCheck() { + return this.getBooleanAttribute('indices_backup_check'); + } + public set indicesBackupCheck(value: boolean | cdktf.IResolvable) { + this._indicesBackupCheck = value; + } + public resetIndicesBackupCheck() { + this._indicesBackupCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get indicesBackupCheckInput() { + return this._indicesBackupCheck; + } + + // instance_type - computed: false, optional: false, required: true + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // migrate_type - computed: false, optional: false, required: true + private _migrateType?: string; + public get migrateType() { + return this.getStringAttribute('migrate_type'); + } + public set migrateType(value: string) { + this._migrateType = value; + } + // Temporarily expose input value. Use with caution. + public get migrateTypeInput() { + return this._migrateType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_az - computed: false, optional: false, required: true + private _sourceAz?: string; + public get sourceAz() { + return this.getStringAttribute('source_az'); + } + public set sourceAz(value: string) { + this._sourceAz = value; + } + // Temporarily expose input value. Use with caution. + public get sourceAzInput() { + return this._sourceAz; + } + + // target_az - computed: false, optional: false, required: true + private _targetAz?: string; + public get targetAz() { + return this.getStringAttribute('target_az'); + } + public set targetAz(value: string) { + this._targetAz = value; + } + // Temporarily expose input value. Use with caution. + public get targetAzInput() { + return this._targetAz; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssClusterAzMigrateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssClusterAzMigrateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + cluster_id: cdktf.stringToTerraform(this._clusterId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + indices_backup_check: cdktf.booleanToTerraform(this._indicesBackupCheck), + instance_type: cdktf.stringToTerraform(this._instanceType), + migrate_type: cdktf.stringToTerraform(this._migrateType), + region: cdktf.stringToTerraform(this._region), + source_az: cdktf.stringToTerraform(this._sourceAz), + target_az: cdktf.stringToTerraform(this._targetAz), + timeouts: cssClusterAzMigrateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + indices_backup_check: { + value: cdktf.booleanToHclTerraform(this._indicesBackupCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + migrate_type: { + value: cdktf.stringToHclTerraform(this._migrateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_az: { + value: cdktf.stringToHclTerraform(this._sourceAz), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_az: { + value: cdktf.stringToHclTerraform(this._targetAz), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssClusterAzMigrateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssClusterAzMigrateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-cluster-node-replace/README.md b/src/constructs/providers/huaweicloud/css-cluster-node-replace/README.md new file mode 100644 index 00000000..5497aa73 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-node-replace/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_cluster_node_replace` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_cluster_node_replace`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace). diff --git a/src/constructs/providers/huaweicloud/css-cluster-node-replace/index.ts b/src/constructs/providers/huaweicloud/css-cluster-node-replace/index.ts new file mode 100644 index 00000000..b66e32ec --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-node-replace/index.ts @@ -0,0 +1,402 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssClusterNodeReplaceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#agency CssClusterNodeReplace#agency} + */ + readonly agency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#cluster_id CssClusterNodeReplace#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#enable_force_new CssClusterNodeReplace#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#id CssClusterNodeReplace#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#migrate_data CssClusterNodeReplace#migrate_data} + */ + readonly migrateData?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#node_id CssClusterNodeReplace#node_id} + */ + readonly nodeId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#region CssClusterNodeReplace#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#timeouts CssClusterNodeReplace#timeouts} + */ + readonly timeouts?: CssClusterNodeReplaceTimeouts; +} +export interface CssClusterNodeReplaceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#create CssClusterNodeReplace#create} + */ + readonly create?: string; +} + +export function cssClusterNodeReplaceTimeoutsToTerraform(struct?: CssClusterNodeReplaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssClusterNodeReplaceTimeoutsToHclTerraform(struct?: CssClusterNodeReplaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterNodeReplaceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssClusterNodeReplaceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterNodeReplaceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace huaweicloud_css_cluster_node_replace} +*/ +export class CssClusterNodeReplace extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_cluster_node_replace"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssClusterNodeReplace resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssClusterNodeReplace to import + * @param importFromId The id of the existing CssClusterNodeReplace that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssClusterNodeReplace to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_cluster_node_replace", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_node_replace huaweicloud_css_cluster_node_replace} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssClusterNodeReplaceConfig + */ + public constructor(scope: Construct, id: string, config: CssClusterNodeReplaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_cluster_node_replace', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._clusterId = config.clusterId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._migrateData = config.migrateData; + this._nodeId = config.nodeId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: true, required: false + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + public resetAgency() { + this._agency = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // migrate_data - computed: false, optional: true, required: false + private _migrateData?: boolean | cdktf.IResolvable; + public get migrateData() { + return this.getBooleanAttribute('migrate_data'); + } + public set migrateData(value: boolean | cdktf.IResolvable) { + this._migrateData = value; + } + public resetMigrateData() { + this._migrateData = undefined; + } + // Temporarily expose input value. Use with caution. + public get migrateDataInput() { + return this._migrateData; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssClusterNodeReplaceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssClusterNodeReplaceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + cluster_id: cdktf.stringToTerraform(this._clusterId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + migrate_data: cdktf.booleanToTerraform(this._migrateData), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + timeouts: cssClusterNodeReplaceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + migrate_data: { + value: cdktf.booleanToHclTerraform(this._migrateData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssClusterNodeReplaceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssClusterNodeReplaceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-cluster-restart/README.md b/src/constructs/providers/huaweicloud/css-cluster-restart/README.md new file mode 100644 index 00000000..bd44ca3c --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_cluster_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_cluster_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart). diff --git a/src/constructs/providers/huaweicloud/css-cluster-restart/index.ts b/src/constructs/providers/huaweicloud/css-cluster-restart/index.ts new file mode 100644 index 00000000..8ae720ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-restart/index.ts @@ -0,0 +1,371 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssClusterRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#cluster_id CssClusterRestart#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#id CssClusterRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#is_rolling CssClusterRestart#is_rolling} + */ + readonly isRolling?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#region CssClusterRestart#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#type CssClusterRestart#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#value CssClusterRestart#value} + */ + readonly value: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#timeouts CssClusterRestart#timeouts} + */ + readonly timeouts?: CssClusterRestartTimeouts; +} +export interface CssClusterRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#create CssClusterRestart#create} + */ + readonly create?: string; +} + +export function cssClusterRestartTimeoutsToTerraform(struct?: CssClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssClusterRestartTimeoutsToHclTerraform(struct?: CssClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssClusterRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart huaweicloud_css_cluster_restart} +*/ +export class CssClusterRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_cluster_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssClusterRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssClusterRestart to import + * @param importFromId The id of the existing CssClusterRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssClusterRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_cluster_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_restart huaweicloud_css_cluster_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssClusterRestartConfig + */ + public constructor(scope: Construct, id: string, config: CssClusterRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_cluster_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._isRolling = config.isRolling; + this._region = config.region; + this._type = config.type; + this._value = config.value; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_rolling - computed: false, optional: true, required: false + private _isRolling?: boolean | cdktf.IResolvable; + public get isRolling() { + return this.getBooleanAttribute('is_rolling'); + } + public set isRolling(value: boolean | cdktf.IResolvable) { + this._isRolling = value; + } + public resetIsRolling() { + this._isRolling = undefined; + } + // Temporarily expose input value. Use with caution. + public get isRollingInput() { + return this._isRolling; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssClusterRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssClusterRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + is_rolling: cdktf.booleanToTerraform(this._isRolling), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + value: cdktf.stringToTerraform(this._value), + timeouts: cssClusterRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_rolling: { + value: cdktf.booleanToHclTerraform(this._isRolling), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssClusterRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssClusterRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-cluster-v1/README.md b/src/constructs/providers/huaweicloud/css-cluster-v1/README.md new file mode 100644 index 00000000..40646a79 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_cluster_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_cluster_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1). diff --git a/src/constructs/providers/huaweicloud/css-cluster-v1/index.ts b/src/constructs/providers/huaweicloud/css-cluster-v1/index.ts new file mode 100644 index 00000000..151c2bb6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster-v1/index.ts @@ -0,0 +1,3520 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssClusterV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#auto_renew CssClusterV1#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#availability_zone CssClusterV1#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#charging_mode CssClusterV1#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#enable_force_new CssClusterV1#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#engine_type CssClusterV1#engine_type} + */ + readonly engineType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#engine_version CssClusterV1#engine_version} + */ + readonly engineVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#enterprise_project_id CssClusterV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#expect_node_num CssClusterV1#expect_node_num} + */ + readonly expectNodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#https_enabled CssClusterV1#https_enabled} + */ + readonly httpsEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#id CssClusterV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#name CssClusterV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#password CssClusterV1#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#period CssClusterV1#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#period_unit CssClusterV1#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#region CssClusterV1#region} + */ + readonly region?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#security_group_id CssClusterV1#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#security_mode CssClusterV1#security_mode} + */ + readonly securityMode?: boolean | cdktf.IResolvable; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#subnet_id CssClusterV1#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#tags CssClusterV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#vpc_id CssClusterV1#vpc_id} + */ + readonly vpcId?: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#backup_strategy CssClusterV1#backup_strategy} + */ + readonly backupStrategy?: CssClusterV1BackupStrategy; + /** + * client_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#client_node_config CssClusterV1#client_node_config} + */ + readonly clientNodeConfig?: CssClusterV1ClientNodeConfig; + /** + * cold_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#cold_node_config CssClusterV1#cold_node_config} + */ + readonly coldNodeConfig?: CssClusterV1ColdNodeConfig; + /** + * ess_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#ess_node_config CssClusterV1#ess_node_config} + */ + readonly essNodeConfig?: CssClusterV1EssNodeConfig; + /** + * kibana_public_access block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#kibana_public_access CssClusterV1#kibana_public_access} + */ + readonly kibanaPublicAccess?: CssClusterV1KibanaPublicAccess; + /** + * master_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#master_node_config CssClusterV1#master_node_config} + */ + readonly masterNodeConfig?: CssClusterV1MasterNodeConfig; + /** + * node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#node_config CssClusterV1#node_config} + */ + readonly nodeConfig?: CssClusterV1NodeConfig; + /** + * public_access block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#public_access CssClusterV1#public_access} + */ + readonly publicAccess?: CssClusterV1PublicAccess; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#timeouts CssClusterV1#timeouts} + */ + readonly timeouts?: CssClusterV1Timeouts; + /** + * vpcep_endpoint block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#vpcep_endpoint CssClusterV1#vpcep_endpoint} + */ + readonly vpcepEndpoint?: CssClusterV1VpcepEndpoint; +} +export interface CssClusterV1Nodes { +} + +export function cssClusterV1NodesToTerraform(struct?: CssClusterV1Nodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssClusterV1NodesToHclTerraform(struct?: CssClusterV1Nodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssClusterV1NodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssClusterV1Nodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1Nodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CssClusterV1NodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssClusterV1NodesOutputReference { + return new CssClusterV1NodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssClusterV1BackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#agency CssClusterV1#agency} + */ + readonly agency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#backup_path CssClusterV1#backup_path} + */ + readonly backupPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#bucket CssClusterV1#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#keep_days CssClusterV1#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#prefix CssClusterV1#prefix} + */ + readonly prefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#start_time CssClusterV1#start_time} + */ + readonly startTime: string; +} + +export function cssClusterV1BackupStrategyToTerraform(struct?: CssClusterV1BackupStrategyOutputReference | CssClusterV1BackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency: cdktf.stringToTerraform(struct!.agency), + backup_path: cdktf.stringToTerraform(struct!.backupPath), + bucket: cdktf.stringToTerraform(struct!.bucket), + keep_days: cdktf.numberToTerraform(struct!.keepDays), + prefix: cdktf.stringToTerraform(struct!.prefix), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function cssClusterV1BackupStrategyToHclTerraform(struct?: CssClusterV1BackupStrategyOutputReference | CssClusterV1BackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(struct!.agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_path: { + value: cdktf.stringToHclTerraform(struct!.backupPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + prefix: { + value: cdktf.stringToHclTerraform(struct!.prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1BackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1BackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agency !== undefined) { + hasAnyValues = true; + internalValueResult.agency = this._agency; + } + if (this._backupPath !== undefined) { + hasAnyValues = true; + internalValueResult.backupPath = this._backupPath; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._prefix !== undefined) { + hasAnyValues = true; + internalValueResult.prefix = this._prefix; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1BackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._agency = undefined; + this._backupPath = undefined; + this._bucket = undefined; + this._keepDays = undefined; + this._prefix = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._agency = value.agency; + this._backupPath = value.backupPath; + this._bucket = value.bucket; + this._keepDays = value.keepDays; + this._prefix = value.prefix; + this._startTime = value.startTime; + } + } + + // agency - computed: true, optional: true, required: false + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + public resetAgency() { + this._agency = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // backup_path - computed: true, optional: true, required: false + private _backupPath?: string; + public get backupPath() { + return this.getStringAttribute('backup_path'); + } + public set backupPath(value: string) { + this._backupPath = value; + } + public resetBackupPath() { + this._backupPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupPathInput() { + return this._backupPath; + } + + // bucket - computed: true, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // keep_days - computed: false, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // prefix - computed: false, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface CssClusterV1ClientNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#size CssClusterV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume_type CssClusterV1#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterV1ClientNodeConfigVolumeToTerraform(struct?: CssClusterV1ClientNodeConfigVolumeOutputReference | CssClusterV1ClientNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterV1ClientNodeConfigVolumeToHclTerraform(struct?: CssClusterV1ClientNodeConfigVolumeOutputReference | CssClusterV1ClientNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1ClientNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1ClientNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1ClientNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterV1ClientNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#flavor CssClusterV1#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#instance_number CssClusterV1#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#shrink_node_ids CssClusterV1#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume CssClusterV1#volume} + */ + readonly volume: CssClusterV1ClientNodeConfigVolume; +} + +export function cssClusterV1ClientNodeConfigToTerraform(struct?: CssClusterV1ClientNodeConfigOutputReference | CssClusterV1ClientNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterV1ClientNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterV1ClientNodeConfigToHclTerraform(struct?: CssClusterV1ClientNodeConfigOutputReference | CssClusterV1ClientNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterV1ClientNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1ClientNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1ClientNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1ClientNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1ClientNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: false, required: true + private _volume = new CssClusterV1ClientNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterV1ClientNodeConfigVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterV1ColdNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#size CssClusterV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume_type CssClusterV1#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterV1ColdNodeConfigVolumeToTerraform(struct?: CssClusterV1ColdNodeConfigVolumeOutputReference | CssClusterV1ColdNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterV1ColdNodeConfigVolumeToHclTerraform(struct?: CssClusterV1ColdNodeConfigVolumeOutputReference | CssClusterV1ColdNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1ColdNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1ColdNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1ColdNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterV1ColdNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#flavor CssClusterV1#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#instance_number CssClusterV1#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#shrink_node_ids CssClusterV1#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume CssClusterV1#volume} + */ + readonly volume?: CssClusterV1ColdNodeConfigVolume; +} + +export function cssClusterV1ColdNodeConfigToTerraform(struct?: CssClusterV1ColdNodeConfigOutputReference | CssClusterV1ColdNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterV1ColdNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterV1ColdNodeConfigToHclTerraform(struct?: CssClusterV1ColdNodeConfigOutputReference | CssClusterV1ColdNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterV1ColdNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1ColdNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1ColdNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1ColdNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1ColdNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: true, required: false + private _volume = new CssClusterV1ColdNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterV1ColdNodeConfigVolume) { + this._volume.internalValue = value; + } + public resetVolume() { + this._volume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterV1EssNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#size CssClusterV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume_type CssClusterV1#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterV1EssNodeConfigVolumeToTerraform(struct?: CssClusterV1EssNodeConfigVolumeOutputReference | CssClusterV1EssNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterV1EssNodeConfigVolumeToHclTerraform(struct?: CssClusterV1EssNodeConfigVolumeOutputReference | CssClusterV1EssNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1EssNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1EssNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1EssNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterV1EssNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#flavor CssClusterV1#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#instance_number CssClusterV1#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#shrink_node_ids CssClusterV1#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume CssClusterV1#volume} + */ + readonly volume?: CssClusterV1EssNodeConfigVolume; +} + +export function cssClusterV1EssNodeConfigToTerraform(struct?: CssClusterV1EssNodeConfigOutputReference | CssClusterV1EssNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterV1EssNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterV1EssNodeConfigToHclTerraform(struct?: CssClusterV1EssNodeConfigOutputReference | CssClusterV1EssNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterV1EssNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1EssNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1EssNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1EssNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1EssNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: true, required: false + private _volume = new CssClusterV1EssNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterV1EssNodeConfigVolume) { + this._volume.internalValue = value; + } + public resetVolume() { + this._volume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterV1KibanaPublicAccess { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#bandwidth CssClusterV1#bandwidth} + */ + readonly bandwidth: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#whitelist CssClusterV1#whitelist} + */ + readonly whitelist?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#whitelist_enabled CssClusterV1#whitelist_enabled} + */ + readonly whitelistEnabled: boolean | cdktf.IResolvable; +} + +export function cssClusterV1KibanaPublicAccessToTerraform(struct?: CssClusterV1KibanaPublicAccessOutputReference | CssClusterV1KibanaPublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth: cdktf.numberToTerraform(struct!.bandwidth), + whitelist: cdktf.stringToTerraform(struct!.whitelist), + whitelist_enabled: cdktf.booleanToTerraform(struct!.whitelistEnabled), + } +} + + +export function cssClusterV1KibanaPublicAccessToHclTerraform(struct?: CssClusterV1KibanaPublicAccessOutputReference | CssClusterV1KibanaPublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(struct!.bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + whitelist: { + value: cdktf.stringToHclTerraform(struct!.whitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist_enabled: { + value: cdktf.booleanToHclTerraform(struct!.whitelistEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1KibanaPublicAccessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1KibanaPublicAccess | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidth = this._bandwidth; + } + if (this._whitelist !== undefined) { + hasAnyValues = true; + internalValueResult.whitelist = this._whitelist; + } + if (this._whitelistEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.whitelistEnabled = this._whitelistEnabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1KibanaPublicAccess | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidth = undefined; + this._whitelist = undefined; + this._whitelistEnabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidth = value.bandwidth; + this._whitelist = value.whitelist; + this._whitelistEnabled = value.whitelistEnabled; + } + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string; + public get whitelist() { + return this.getStringAttribute('whitelist'); + } + public set whitelist(value: string) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // whitelist_enabled - computed: false, optional: false, required: true + private _whitelistEnabled?: boolean | cdktf.IResolvable; + public get whitelistEnabled() { + return this.getBooleanAttribute('whitelist_enabled'); + } + public set whitelistEnabled(value: boolean | cdktf.IResolvable) { + this._whitelistEnabled = value; + } + // Temporarily expose input value. Use with caution. + public get whitelistEnabledInput() { + return this._whitelistEnabled; + } +} +export interface CssClusterV1MasterNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#size CssClusterV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume_type CssClusterV1#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterV1MasterNodeConfigVolumeToTerraform(struct?: CssClusterV1MasterNodeConfigVolumeOutputReference | CssClusterV1MasterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterV1MasterNodeConfigVolumeToHclTerraform(struct?: CssClusterV1MasterNodeConfigVolumeOutputReference | CssClusterV1MasterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1MasterNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1MasterNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1MasterNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterV1MasterNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#flavor CssClusterV1#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#instance_number CssClusterV1#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#shrink_node_ids CssClusterV1#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume CssClusterV1#volume} + */ + readonly volume: CssClusterV1MasterNodeConfigVolume; +} + +export function cssClusterV1MasterNodeConfigToTerraform(struct?: CssClusterV1MasterNodeConfigOutputReference | CssClusterV1MasterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterV1MasterNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterV1MasterNodeConfigToHclTerraform(struct?: CssClusterV1MasterNodeConfigOutputReference | CssClusterV1MasterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterV1MasterNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1MasterNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1MasterNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1MasterNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1MasterNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: false, required: true + private _volume = new CssClusterV1MasterNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterV1MasterNodeConfigVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterV1NodeConfigNetworkInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#security_group_id CssClusterV1#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#subnet_id CssClusterV1#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#vpc_id CssClusterV1#vpc_id} + */ + readonly vpcId: string; +} + +export function cssClusterV1NodeConfigNetworkInfoToTerraform(struct?: CssClusterV1NodeConfigNetworkInfoOutputReference | CssClusterV1NodeConfigNetworkInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + security_group_id: cdktf.stringToTerraform(struct!.securityGroupId), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function cssClusterV1NodeConfigNetworkInfoToHclTerraform(struct?: CssClusterV1NodeConfigNetworkInfoOutputReference | CssClusterV1NodeConfigNetworkInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + security_group_id: { + value: cdktf.stringToHclTerraform(struct!.securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1NodeConfigNetworkInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1NodeConfigNetworkInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._securityGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.securityGroupId = this._securityGroupId; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1NodeConfigNetworkInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._securityGroupId = undefined; + this._subnetId = undefined; + this._vpcId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._securityGroupId = value.securityGroupId; + this._subnetId = value.subnetId; + this._vpcId = value.vpcId; + } + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} +export interface CssClusterV1NodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#size CssClusterV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume_type CssClusterV1#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterV1NodeConfigVolumeToTerraform(struct?: CssClusterV1NodeConfigVolumeOutputReference | CssClusterV1NodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterV1NodeConfigVolumeToHclTerraform(struct?: CssClusterV1NodeConfigVolumeOutputReference | CssClusterV1NodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1NodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1NodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1NodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterV1NodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#availability_zone CssClusterV1#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#flavor CssClusterV1#flavor} + */ + readonly flavor: string; + /** + * network_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#network_info CssClusterV1#network_info} + */ + readonly networkInfo: CssClusterV1NodeConfigNetworkInfo; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#volume CssClusterV1#volume} + */ + readonly volume: CssClusterV1NodeConfigVolume; +} + +export function cssClusterV1NodeConfigToTerraform(struct?: CssClusterV1NodeConfigOutputReference | CssClusterV1NodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + flavor: cdktf.stringToTerraform(struct!.flavor), + network_info: cssClusterV1NodeConfigNetworkInfoToTerraform(struct!.networkInfo), + volume: cssClusterV1NodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterV1NodeConfigToHclTerraform(struct?: CssClusterV1NodeConfigOutputReference | CssClusterV1NodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_info: { + value: cssClusterV1NodeConfigNetworkInfoToHclTerraform(struct!.networkInfo), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1NodeConfigNetworkInfoList", + }, + volume: { + value: cssClusterV1NodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1NodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1NodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1NodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._networkInfo?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.networkInfo = this._networkInfo?.internalValue; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1NodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZone = undefined; + this._flavor = undefined; + this._networkInfo.internalValue = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZone = value.availabilityZone; + this._flavor = value.flavor; + this._networkInfo.internalValue = value.networkInfo; + this._volume.internalValue = value.volume; + } + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // network_info - computed: false, optional: false, required: true + private _networkInfo = new CssClusterV1NodeConfigNetworkInfoOutputReference(this, "network_info"); + public get networkInfo() { + return this._networkInfo; + } + public putNetworkInfo(value: CssClusterV1NodeConfigNetworkInfo) { + this._networkInfo.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get networkInfoInput() { + return this._networkInfo.internalValue; + } + + // volume - computed: false, optional: false, required: true + private _volume = new CssClusterV1NodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterV1NodeConfigVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterV1PublicAccess { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#bandwidth CssClusterV1#bandwidth} + */ + readonly bandwidth: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#whitelist CssClusterV1#whitelist} + */ + readonly whitelist?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#whitelist_enabled CssClusterV1#whitelist_enabled} + */ + readonly whitelistEnabled: boolean | cdktf.IResolvable; +} + +export function cssClusterV1PublicAccessToTerraform(struct?: CssClusterV1PublicAccessOutputReference | CssClusterV1PublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth: cdktf.numberToTerraform(struct!.bandwidth), + whitelist: cdktf.stringToTerraform(struct!.whitelist), + whitelist_enabled: cdktf.booleanToTerraform(struct!.whitelistEnabled), + } +} + + +export function cssClusterV1PublicAccessToHclTerraform(struct?: CssClusterV1PublicAccessOutputReference | CssClusterV1PublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(struct!.bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + whitelist: { + value: cdktf.stringToHclTerraform(struct!.whitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist_enabled: { + value: cdktf.booleanToHclTerraform(struct!.whitelistEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1PublicAccessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1PublicAccess | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidth = this._bandwidth; + } + if (this._whitelist !== undefined) { + hasAnyValues = true; + internalValueResult.whitelist = this._whitelist; + } + if (this._whitelistEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.whitelistEnabled = this._whitelistEnabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1PublicAccess | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidth = undefined; + this._whitelist = undefined; + this._whitelistEnabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidth = value.bandwidth; + this._whitelist = value.whitelist; + this._whitelistEnabled = value.whitelistEnabled; + } + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string; + public get whitelist() { + return this.getStringAttribute('whitelist'); + } + public set whitelist(value: string) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // whitelist_enabled - computed: false, optional: false, required: true + private _whitelistEnabled?: boolean | cdktf.IResolvable; + public get whitelistEnabled() { + return this.getBooleanAttribute('whitelist_enabled'); + } + public set whitelistEnabled(value: boolean | cdktf.IResolvable) { + this._whitelistEnabled = value; + } + // Temporarily expose input value. Use with caution. + public get whitelistEnabledInput() { + return this._whitelistEnabled; + } +} +export interface CssClusterV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#create CssClusterV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#delete CssClusterV1#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#update CssClusterV1#update} + */ + readonly update?: string; +} + +export function cssClusterV1TimeoutsToTerraform(struct?: CssClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cssClusterV1TimeoutsToHclTerraform(struct?: CssClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssClusterV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface CssClusterV1VpcepEndpoint { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#endpoint_with_dns_name CssClusterV1#endpoint_with_dns_name} + */ + readonly endpointWithDnsName: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#whitelist CssClusterV1#whitelist} + */ + readonly whitelist?: string[]; +} + +export function cssClusterV1VpcepEndpointToTerraform(struct?: CssClusterV1VpcepEndpointOutputReference | CssClusterV1VpcepEndpoint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + endpoint_with_dns_name: cdktf.booleanToTerraform(struct!.endpointWithDnsName), + whitelist: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.whitelist), + } +} + + +export function cssClusterV1VpcepEndpointToHclTerraform(struct?: CssClusterV1VpcepEndpointOutputReference | CssClusterV1VpcepEndpoint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + endpoint_with_dns_name: { + value: cdktf.booleanToHclTerraform(struct!.endpointWithDnsName), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + whitelist: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.whitelist), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterV1VpcepEndpointOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterV1VpcepEndpoint | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endpointWithDnsName !== undefined) { + hasAnyValues = true; + internalValueResult.endpointWithDnsName = this._endpointWithDnsName; + } + if (this._whitelist !== undefined) { + hasAnyValues = true; + internalValueResult.whitelist = this._whitelist; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterV1VpcepEndpoint | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endpointWithDnsName = undefined; + this._whitelist = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endpointWithDnsName = value.endpointWithDnsName; + this._whitelist = value.whitelist; + } + } + + // endpoint_with_dns_name - computed: false, optional: false, required: true + private _endpointWithDnsName?: boolean | cdktf.IResolvable; + public get endpointWithDnsName() { + return this.getBooleanAttribute('endpoint_with_dns_name'); + } + public set endpointWithDnsName(value: boolean | cdktf.IResolvable) { + this._endpointWithDnsName = value; + } + // Temporarily expose input value. Use with caution. + public get endpointWithDnsNameInput() { + return this._endpointWithDnsName; + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string[]; + public get whitelist() { + return this.getListAttribute('whitelist'); + } + public set whitelist(value: string[]) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1 huaweicloud_css_cluster_v1} +*/ +export class CssClusterV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_cluster_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssClusterV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssClusterV1 to import + * @param importFromId The id of the existing CssClusterV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssClusterV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_cluster_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster_v1 huaweicloud_css_cluster_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssClusterV1Config + */ + public constructor(scope: Construct, id: string, config: CssClusterV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_cluster_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._enableForceNew = config.enableForceNew; + this._engineType = config.engineType; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._expectNodeNum = config.expectNodeNum; + this._httpsEnabled = config.httpsEnabled; + this._id = config.id; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._securityMode = config.securityMode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._clientNodeConfig.internalValue = config.clientNodeConfig; + this._coldNodeConfig.internalValue = config.coldNodeConfig; + this._essNodeConfig.internalValue = config.essNodeConfig; + this._kibanaPublicAccess.internalValue = config.kibanaPublicAccess; + this._masterNodeConfig.internalValue = config.masterNodeConfig; + this._nodeConfig.internalValue = config.nodeConfig; + this._publicAccess.internalValue = config.publicAccess; + this._timeouts.internalValue = config.timeouts; + this._vpcepEndpoint.internalValue = config.vpcepEndpoint; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // backup_available - computed: true, optional: false, required: false + public get backupAvailable() { + return this.getBooleanAttribute('backup_available'); + } + + // bandwidth_resource_id - computed: true, optional: false, required: false + public get bandwidthResourceId() { + return this.getStringAttribute('bandwidth_resource_id'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // disk_encrypted - computed: true, optional: false, required: false + public get diskEncrypted() { + return this.getBooleanAttribute('disk_encrypted'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // engine_type - computed: false, optional: true, required: false + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + public resetEngineType() { + this._engineType = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // engine_version - computed: false, optional: false, required: true + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expect_node_num - computed: true, optional: true, required: false + private _expectNodeNum?: number; + public get expectNodeNum() { + return this.getNumberAttribute('expect_node_num'); + } + public set expectNodeNum(value: number) { + this._expectNodeNum = value; + } + public resetExpectNodeNum() { + this._expectNodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get expectNodeNumInput() { + return this._expectNodeNum; + } + + // https_enabled - computed: true, optional: true, required: false + private _httpsEnabled?: boolean | cdktf.IResolvable; + public get httpsEnabled() { + return this.getBooleanAttribute('https_enabled'); + } + public set httpsEnabled(value: boolean | cdktf.IResolvable) { + this._httpsEnabled = value; + } + public resetHttpsEnabled() { + this._httpsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsEnabledInput() { + return this._httpsEnabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_period - computed: true, optional: false, required: false + public get isPeriod() { + return this.getBooleanAttribute('is_period'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new CssClusterV1NodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_mode - computed: false, optional: true, required: false + private _securityMode?: boolean | cdktf.IResolvable; + public get securityMode() { + return this.getBooleanAttribute('security_mode'); + } + public set securityMode(value: boolean | cdktf.IResolvable) { + this._securityMode = value; + } + public resetSecurityMode() { + this._securityMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityModeInput() { + return this._securityMode; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpcep_endpoint_id - computed: true, optional: false, required: false + public get vpcepEndpointId() { + return this.getStringAttribute('vpcep_endpoint_id'); + } + + // vpcep_ip - computed: true, optional: false, required: false + public get vpcepIp() { + return this.getStringAttribute('vpcep_ip'); + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new CssClusterV1BackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: CssClusterV1BackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // client_node_config - computed: false, optional: true, required: false + private _clientNodeConfig = new CssClusterV1ClientNodeConfigOutputReference(this, "client_node_config"); + public get clientNodeConfig() { + return this._clientNodeConfig; + } + public putClientNodeConfig(value: CssClusterV1ClientNodeConfig) { + this._clientNodeConfig.internalValue = value; + } + public resetClientNodeConfig() { + this._clientNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientNodeConfigInput() { + return this._clientNodeConfig.internalValue; + } + + // cold_node_config - computed: false, optional: true, required: false + private _coldNodeConfig = new CssClusterV1ColdNodeConfigOutputReference(this, "cold_node_config"); + public get coldNodeConfig() { + return this._coldNodeConfig; + } + public putColdNodeConfig(value: CssClusterV1ColdNodeConfig) { + this._coldNodeConfig.internalValue = value; + } + public resetColdNodeConfig() { + this._coldNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get coldNodeConfigInput() { + return this._coldNodeConfig.internalValue; + } + + // ess_node_config - computed: false, optional: true, required: false + private _essNodeConfig = new CssClusterV1EssNodeConfigOutputReference(this, "ess_node_config"); + public get essNodeConfig() { + return this._essNodeConfig; + } + public putEssNodeConfig(value: CssClusterV1EssNodeConfig) { + this._essNodeConfig.internalValue = value; + } + public resetEssNodeConfig() { + this._essNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get essNodeConfigInput() { + return this._essNodeConfig.internalValue; + } + + // kibana_public_access - computed: false, optional: true, required: false + private _kibanaPublicAccess = new CssClusterV1KibanaPublicAccessOutputReference(this, "kibana_public_access"); + public get kibanaPublicAccess() { + return this._kibanaPublicAccess; + } + public putKibanaPublicAccess(value: CssClusterV1KibanaPublicAccess) { + this._kibanaPublicAccess.internalValue = value; + } + public resetKibanaPublicAccess() { + this._kibanaPublicAccess.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kibanaPublicAccessInput() { + return this._kibanaPublicAccess.internalValue; + } + + // master_node_config - computed: false, optional: true, required: false + private _masterNodeConfig = new CssClusterV1MasterNodeConfigOutputReference(this, "master_node_config"); + public get masterNodeConfig() { + return this._masterNodeConfig; + } + public putMasterNodeConfig(value: CssClusterV1MasterNodeConfig) { + this._masterNodeConfig.internalValue = value; + } + public resetMasterNodeConfig() { + this._masterNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterNodeConfigInput() { + return this._masterNodeConfig.internalValue; + } + + // node_config - computed: false, optional: true, required: false + private _nodeConfig = new CssClusterV1NodeConfigOutputReference(this, "node_config"); + public get nodeConfig() { + return this._nodeConfig; + } + public putNodeConfig(value: CssClusterV1NodeConfig) { + this._nodeConfig.internalValue = value; + } + public resetNodeConfig() { + this._nodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeConfigInput() { + return this._nodeConfig.internalValue; + } + + // public_access - computed: false, optional: true, required: false + private _publicAccess = new CssClusterV1PublicAccessOutputReference(this, "public_access"); + public get publicAccess() { + return this._publicAccess; + } + public putPublicAccess(value: CssClusterV1PublicAccess) { + this._publicAccess.internalValue = value; + } + public resetPublicAccess() { + this._publicAccess.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicAccessInput() { + return this._publicAccess.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssClusterV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssClusterV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // vpcep_endpoint - computed: false, optional: true, required: false + private _vpcepEndpoint = new CssClusterV1VpcepEndpointOutputReference(this, "vpcep_endpoint"); + public get vpcepEndpoint() { + return this._vpcepEndpoint; + } + public putVpcepEndpoint(value: CssClusterV1VpcepEndpoint) { + this._vpcepEndpoint.internalValue = value; + } + public resetVpcepEndpoint() { + this._vpcepEndpoint.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcepEndpointInput() { + return this._vpcepEndpoint.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + engine_type: cdktf.stringToTerraform(this._engineType), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + expect_node_num: cdktf.numberToTerraform(this._expectNodeNum), + https_enabled: cdktf.booleanToTerraform(this._httpsEnabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + security_mode: cdktf.booleanToTerraform(this._securityMode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: cssClusterV1BackupStrategyToTerraform(this._backupStrategy.internalValue), + client_node_config: cssClusterV1ClientNodeConfigToTerraform(this._clientNodeConfig.internalValue), + cold_node_config: cssClusterV1ColdNodeConfigToTerraform(this._coldNodeConfig.internalValue), + ess_node_config: cssClusterV1EssNodeConfigToTerraform(this._essNodeConfig.internalValue), + kibana_public_access: cssClusterV1KibanaPublicAccessToTerraform(this._kibanaPublicAccess.internalValue), + master_node_config: cssClusterV1MasterNodeConfigToTerraform(this._masterNodeConfig.internalValue), + node_config: cssClusterV1NodeConfigToTerraform(this._nodeConfig.internalValue), + public_access: cssClusterV1PublicAccessToTerraform(this._publicAccess.internalValue), + timeouts: cssClusterV1TimeoutsToTerraform(this._timeouts.internalValue), + vpcep_endpoint: cssClusterV1VpcepEndpointToTerraform(this._vpcepEndpoint.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expect_node_num: { + value: cdktf.numberToHclTerraform(this._expectNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + https_enabled: { + value: cdktf.booleanToHclTerraform(this._httpsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_mode: { + value: cdktf.booleanToHclTerraform(this._securityMode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: cssClusterV1BackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1BackupStrategyList", + }, + client_node_config: { + value: cssClusterV1ClientNodeConfigToHclTerraform(this._clientNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1ClientNodeConfigList", + }, + cold_node_config: { + value: cssClusterV1ColdNodeConfigToHclTerraform(this._coldNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1ColdNodeConfigList", + }, + ess_node_config: { + value: cssClusterV1EssNodeConfigToHclTerraform(this._essNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1EssNodeConfigList", + }, + kibana_public_access: { + value: cssClusterV1KibanaPublicAccessToHclTerraform(this._kibanaPublicAccess.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1KibanaPublicAccessList", + }, + master_node_config: { + value: cssClusterV1MasterNodeConfigToHclTerraform(this._masterNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1MasterNodeConfigList", + }, + node_config: { + value: cssClusterV1NodeConfigToHclTerraform(this._nodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1NodeConfigList", + }, + public_access: { + value: cssClusterV1PublicAccessToHclTerraform(this._publicAccess.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1PublicAccessList", + }, + timeouts: { + value: cssClusterV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssClusterV1Timeouts", + }, + vpcep_endpoint: { + value: cssClusterV1VpcepEndpointToHclTerraform(this._vpcepEndpoint.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterV1VpcepEndpointList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-cluster/README.md b/src/constructs/providers/huaweicloud/css-cluster/README.md new file mode 100644 index 00000000..106cd989 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster). diff --git a/src/constructs/providers/huaweicloud/css-cluster/index.ts b/src/constructs/providers/huaweicloud/css-cluster/index.ts new file mode 100644 index 00000000..319816e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-cluster/index.ts @@ -0,0 +1,3520 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#auto_renew CssCluster#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#availability_zone CssCluster#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#charging_mode CssCluster#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#enable_force_new CssCluster#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#engine_type CssCluster#engine_type} + */ + readonly engineType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#engine_version CssCluster#engine_version} + */ + readonly engineVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#enterprise_project_id CssCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#expect_node_num CssCluster#expect_node_num} + */ + readonly expectNodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#https_enabled CssCluster#https_enabled} + */ + readonly httpsEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#id CssCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#name CssCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#password CssCluster#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#period CssCluster#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#period_unit CssCluster#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#region CssCluster#region} + */ + readonly region?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#security_group_id CssCluster#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#security_mode CssCluster#security_mode} + */ + readonly securityMode?: boolean | cdktf.IResolvable; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#subnet_id CssCluster#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#tags CssCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#vpc_id CssCluster#vpc_id} + */ + readonly vpcId?: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#backup_strategy CssCluster#backup_strategy} + */ + readonly backupStrategy?: CssClusterBackupStrategy; + /** + * client_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#client_node_config CssCluster#client_node_config} + */ + readonly clientNodeConfig?: CssClusterClientNodeConfig; + /** + * cold_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#cold_node_config CssCluster#cold_node_config} + */ + readonly coldNodeConfig?: CssClusterColdNodeConfig; + /** + * ess_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#ess_node_config CssCluster#ess_node_config} + */ + readonly essNodeConfig?: CssClusterEssNodeConfig; + /** + * kibana_public_access block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#kibana_public_access CssCluster#kibana_public_access} + */ + readonly kibanaPublicAccess?: CssClusterKibanaPublicAccess; + /** + * master_node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#master_node_config CssCluster#master_node_config} + */ + readonly masterNodeConfig?: CssClusterMasterNodeConfig; + /** + * node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#node_config CssCluster#node_config} + */ + readonly nodeConfig?: CssClusterNodeConfig; + /** + * public_access block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#public_access CssCluster#public_access} + */ + readonly publicAccess?: CssClusterPublicAccess; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#timeouts CssCluster#timeouts} + */ + readonly timeouts?: CssClusterTimeouts; + /** + * vpcep_endpoint block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#vpcep_endpoint CssCluster#vpcep_endpoint} + */ + readonly vpcepEndpoint?: CssClusterVpcepEndpoint; +} +export interface CssClusterNodes { +} + +export function cssClusterNodesToTerraform(struct?: CssClusterNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssClusterNodesToHclTerraform(struct?: CssClusterNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssClusterNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssClusterNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CssClusterNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssClusterNodesOutputReference { + return new CssClusterNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssClusterBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#agency CssCluster#agency} + */ + readonly agency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#backup_path CssCluster#backup_path} + */ + readonly backupPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#bucket CssCluster#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#keep_days CssCluster#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#prefix CssCluster#prefix} + */ + readonly prefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#start_time CssCluster#start_time} + */ + readonly startTime: string; +} + +export function cssClusterBackupStrategyToTerraform(struct?: CssClusterBackupStrategyOutputReference | CssClusterBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency: cdktf.stringToTerraform(struct!.agency), + backup_path: cdktf.stringToTerraform(struct!.backupPath), + bucket: cdktf.stringToTerraform(struct!.bucket), + keep_days: cdktf.numberToTerraform(struct!.keepDays), + prefix: cdktf.stringToTerraform(struct!.prefix), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function cssClusterBackupStrategyToHclTerraform(struct?: CssClusterBackupStrategyOutputReference | CssClusterBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(struct!.agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_path: { + value: cdktf.stringToHclTerraform(struct!.backupPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + prefix: { + value: cdktf.stringToHclTerraform(struct!.prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agency !== undefined) { + hasAnyValues = true; + internalValueResult.agency = this._agency; + } + if (this._backupPath !== undefined) { + hasAnyValues = true; + internalValueResult.backupPath = this._backupPath; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._prefix !== undefined) { + hasAnyValues = true; + internalValueResult.prefix = this._prefix; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._agency = undefined; + this._backupPath = undefined; + this._bucket = undefined; + this._keepDays = undefined; + this._prefix = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._agency = value.agency; + this._backupPath = value.backupPath; + this._bucket = value.bucket; + this._keepDays = value.keepDays; + this._prefix = value.prefix; + this._startTime = value.startTime; + } + } + + // agency - computed: true, optional: true, required: false + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + public resetAgency() { + this._agency = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // backup_path - computed: true, optional: true, required: false + private _backupPath?: string; + public get backupPath() { + return this.getStringAttribute('backup_path'); + } + public set backupPath(value: string) { + this._backupPath = value; + } + public resetBackupPath() { + this._backupPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupPathInput() { + return this._backupPath; + } + + // bucket - computed: true, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // keep_days - computed: false, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // prefix - computed: false, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface CssClusterClientNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#size CssCluster#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume_type CssCluster#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterClientNodeConfigVolumeToTerraform(struct?: CssClusterClientNodeConfigVolumeOutputReference | CssClusterClientNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterClientNodeConfigVolumeToHclTerraform(struct?: CssClusterClientNodeConfigVolumeOutputReference | CssClusterClientNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterClientNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterClientNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterClientNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterClientNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#flavor CssCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#instance_number CssCluster#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#shrink_node_ids CssCluster#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume CssCluster#volume} + */ + readonly volume: CssClusterClientNodeConfigVolume; +} + +export function cssClusterClientNodeConfigToTerraform(struct?: CssClusterClientNodeConfigOutputReference | CssClusterClientNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterClientNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterClientNodeConfigToHclTerraform(struct?: CssClusterClientNodeConfigOutputReference | CssClusterClientNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterClientNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterClientNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterClientNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterClientNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterClientNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: false, required: true + private _volume = new CssClusterClientNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterClientNodeConfigVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterColdNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#size CssCluster#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume_type CssCluster#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterColdNodeConfigVolumeToTerraform(struct?: CssClusterColdNodeConfigVolumeOutputReference | CssClusterColdNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterColdNodeConfigVolumeToHclTerraform(struct?: CssClusterColdNodeConfigVolumeOutputReference | CssClusterColdNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterColdNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterColdNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterColdNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterColdNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#flavor CssCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#instance_number CssCluster#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#shrink_node_ids CssCluster#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume CssCluster#volume} + */ + readonly volume?: CssClusterColdNodeConfigVolume; +} + +export function cssClusterColdNodeConfigToTerraform(struct?: CssClusterColdNodeConfigOutputReference | CssClusterColdNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterColdNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterColdNodeConfigToHclTerraform(struct?: CssClusterColdNodeConfigOutputReference | CssClusterColdNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterColdNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterColdNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterColdNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterColdNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterColdNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: true, required: false + private _volume = new CssClusterColdNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterColdNodeConfigVolume) { + this._volume.internalValue = value; + } + public resetVolume() { + this._volume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterEssNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#size CssCluster#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume_type CssCluster#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterEssNodeConfigVolumeToTerraform(struct?: CssClusterEssNodeConfigVolumeOutputReference | CssClusterEssNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterEssNodeConfigVolumeToHclTerraform(struct?: CssClusterEssNodeConfigVolumeOutputReference | CssClusterEssNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterEssNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterEssNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterEssNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterEssNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#flavor CssCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#instance_number CssCluster#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#shrink_node_ids CssCluster#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume CssCluster#volume} + */ + readonly volume?: CssClusterEssNodeConfigVolume; +} + +export function cssClusterEssNodeConfigToTerraform(struct?: CssClusterEssNodeConfigOutputReference | CssClusterEssNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterEssNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterEssNodeConfigToHclTerraform(struct?: CssClusterEssNodeConfigOutputReference | CssClusterEssNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterEssNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterEssNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterEssNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterEssNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterEssNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: true, required: false + private _volume = new CssClusterEssNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterEssNodeConfigVolume) { + this._volume.internalValue = value; + } + public resetVolume() { + this._volume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterKibanaPublicAccess { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#bandwidth CssCluster#bandwidth} + */ + readonly bandwidth: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#whitelist CssCluster#whitelist} + */ + readonly whitelist?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#whitelist_enabled CssCluster#whitelist_enabled} + */ + readonly whitelistEnabled: boolean | cdktf.IResolvable; +} + +export function cssClusterKibanaPublicAccessToTerraform(struct?: CssClusterKibanaPublicAccessOutputReference | CssClusterKibanaPublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth: cdktf.numberToTerraform(struct!.bandwidth), + whitelist: cdktf.stringToTerraform(struct!.whitelist), + whitelist_enabled: cdktf.booleanToTerraform(struct!.whitelistEnabled), + } +} + + +export function cssClusterKibanaPublicAccessToHclTerraform(struct?: CssClusterKibanaPublicAccessOutputReference | CssClusterKibanaPublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(struct!.bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + whitelist: { + value: cdktf.stringToHclTerraform(struct!.whitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist_enabled: { + value: cdktf.booleanToHclTerraform(struct!.whitelistEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterKibanaPublicAccessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterKibanaPublicAccess | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidth = this._bandwidth; + } + if (this._whitelist !== undefined) { + hasAnyValues = true; + internalValueResult.whitelist = this._whitelist; + } + if (this._whitelistEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.whitelistEnabled = this._whitelistEnabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterKibanaPublicAccess | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidth = undefined; + this._whitelist = undefined; + this._whitelistEnabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidth = value.bandwidth; + this._whitelist = value.whitelist; + this._whitelistEnabled = value.whitelistEnabled; + } + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string; + public get whitelist() { + return this.getStringAttribute('whitelist'); + } + public set whitelist(value: string) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // whitelist_enabled - computed: false, optional: false, required: true + private _whitelistEnabled?: boolean | cdktf.IResolvable; + public get whitelistEnabled() { + return this.getBooleanAttribute('whitelist_enabled'); + } + public set whitelistEnabled(value: boolean | cdktf.IResolvable) { + this._whitelistEnabled = value; + } + // Temporarily expose input value. Use with caution. + public get whitelistEnabledInput() { + return this._whitelistEnabled; + } +} +export interface CssClusterMasterNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#size CssCluster#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume_type CssCluster#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterMasterNodeConfigVolumeToTerraform(struct?: CssClusterMasterNodeConfigVolumeOutputReference | CssClusterMasterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterMasterNodeConfigVolumeToHclTerraform(struct?: CssClusterMasterNodeConfigVolumeOutputReference | CssClusterMasterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterMasterNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterMasterNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterMasterNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterMasterNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#flavor CssCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#instance_number CssCluster#instance_number} + */ + readonly instanceNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#shrink_node_ids CssCluster#shrink_node_ids} + */ + readonly shrinkNodeIds?: string[]; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume CssCluster#volume} + */ + readonly volume: CssClusterMasterNodeConfigVolume; +} + +export function cssClusterMasterNodeConfigToTerraform(struct?: CssClusterMasterNodeConfigOutputReference | CssClusterMasterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + shrink_node_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.shrinkNodeIds), + volume: cssClusterMasterNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterMasterNodeConfigToHclTerraform(struct?: CssClusterMasterNodeConfigOutputReference | CssClusterMasterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + shrink_node_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.shrinkNodeIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + volume: { + value: cssClusterMasterNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterMasterNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterMasterNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterMasterNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._shrinkNodeIds !== undefined) { + hasAnyValues = true; + internalValueResult.shrinkNodeIds = this._shrinkNodeIds; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterMasterNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._shrinkNodeIds = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._shrinkNodeIds = value.shrinkNodeIds; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // shrink_node_ids - computed: false, optional: true, required: false + private _shrinkNodeIds?: string[]; + public get shrinkNodeIds() { + return this.getListAttribute('shrink_node_ids'); + } + public set shrinkNodeIds(value: string[]) { + this._shrinkNodeIds = value; + } + public resetShrinkNodeIds() { + this._shrinkNodeIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get shrinkNodeIdsInput() { + return this._shrinkNodeIds; + } + + // volume - computed: false, optional: false, required: true + private _volume = new CssClusterMasterNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterMasterNodeConfigVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterNodeConfigNetworkInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#security_group_id CssCluster#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#subnet_id CssCluster#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#vpc_id CssCluster#vpc_id} + */ + readonly vpcId: string; +} + +export function cssClusterNodeConfigNetworkInfoToTerraform(struct?: CssClusterNodeConfigNetworkInfoOutputReference | CssClusterNodeConfigNetworkInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + security_group_id: cdktf.stringToTerraform(struct!.securityGroupId), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function cssClusterNodeConfigNetworkInfoToHclTerraform(struct?: CssClusterNodeConfigNetworkInfoOutputReference | CssClusterNodeConfigNetworkInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + security_group_id: { + value: cdktf.stringToHclTerraform(struct!.securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterNodeConfigNetworkInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterNodeConfigNetworkInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._securityGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.securityGroupId = this._securityGroupId; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterNodeConfigNetworkInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._securityGroupId = undefined; + this._subnetId = undefined; + this._vpcId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._securityGroupId = value.securityGroupId; + this._subnetId = value.subnetId; + this._vpcId = value.vpcId; + } + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} +export interface CssClusterNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#size CssCluster#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume_type CssCluster#volume_type} + */ + readonly volumeType: string; +} + +export function cssClusterNodeConfigVolumeToTerraform(struct?: CssClusterNodeConfigVolumeOutputReference | CssClusterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssClusterNodeConfigVolumeToHclTerraform(struct?: CssClusterNodeConfigVolumeOutputReference | CssClusterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssClusterNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#availability_zone CssCluster#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#flavor CssCluster#flavor} + */ + readonly flavor: string; + /** + * network_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#network_info CssCluster#network_info} + */ + readonly networkInfo: CssClusterNodeConfigNetworkInfo; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#volume CssCluster#volume} + */ + readonly volume: CssClusterNodeConfigVolume; +} + +export function cssClusterNodeConfigToTerraform(struct?: CssClusterNodeConfigOutputReference | CssClusterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zone: cdktf.stringToTerraform(struct!.availabilityZone), + flavor: cdktf.stringToTerraform(struct!.flavor), + network_info: cssClusterNodeConfigNetworkInfoToTerraform(struct!.networkInfo), + volume: cssClusterNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssClusterNodeConfigToHclTerraform(struct?: CssClusterNodeConfigOutputReference | CssClusterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(struct!.availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_info: { + value: cssClusterNodeConfigNetworkInfoToHclTerraform(struct!.networkInfo), + isBlock: true, + type: "list", + storageClassType: "CssClusterNodeConfigNetworkInfoList", + }, + volume: { + value: cssClusterNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssClusterNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZone = this._availabilityZone; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._networkInfo?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.networkInfo = this._networkInfo?.internalValue; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZone = undefined; + this._flavor = undefined; + this._networkInfo.internalValue = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZone = value.availabilityZone; + this._flavor = value.flavor; + this._networkInfo.internalValue = value.networkInfo; + this._volume.internalValue = value.volume; + } + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // network_info - computed: false, optional: false, required: true + private _networkInfo = new CssClusterNodeConfigNetworkInfoOutputReference(this, "network_info"); + public get networkInfo() { + return this._networkInfo; + } + public putNetworkInfo(value: CssClusterNodeConfigNetworkInfo) { + this._networkInfo.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get networkInfoInput() { + return this._networkInfo.internalValue; + } + + // volume - computed: false, optional: false, required: true + private _volume = new CssClusterNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssClusterNodeConfigVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssClusterPublicAccess { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#bandwidth CssCluster#bandwidth} + */ + readonly bandwidth: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#whitelist CssCluster#whitelist} + */ + readonly whitelist?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#whitelist_enabled CssCluster#whitelist_enabled} + */ + readonly whitelistEnabled: boolean | cdktf.IResolvable; +} + +export function cssClusterPublicAccessToTerraform(struct?: CssClusterPublicAccessOutputReference | CssClusterPublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth: cdktf.numberToTerraform(struct!.bandwidth), + whitelist: cdktf.stringToTerraform(struct!.whitelist), + whitelist_enabled: cdktf.booleanToTerraform(struct!.whitelistEnabled), + } +} + + +export function cssClusterPublicAccessToHclTerraform(struct?: CssClusterPublicAccessOutputReference | CssClusterPublicAccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(struct!.bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + whitelist: { + value: cdktf.stringToHclTerraform(struct!.whitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist_enabled: { + value: cdktf.booleanToHclTerraform(struct!.whitelistEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterPublicAccessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterPublicAccess | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidth = this._bandwidth; + } + if (this._whitelist !== undefined) { + hasAnyValues = true; + internalValueResult.whitelist = this._whitelist; + } + if (this._whitelistEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.whitelistEnabled = this._whitelistEnabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterPublicAccess | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidth = undefined; + this._whitelist = undefined; + this._whitelistEnabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidth = value.bandwidth; + this._whitelist = value.whitelist; + this._whitelistEnabled = value.whitelistEnabled; + } + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string; + public get whitelist() { + return this.getStringAttribute('whitelist'); + } + public set whitelist(value: string) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // whitelist_enabled - computed: false, optional: false, required: true + private _whitelistEnabled?: boolean | cdktf.IResolvable; + public get whitelistEnabled() { + return this.getBooleanAttribute('whitelist_enabled'); + } + public set whitelistEnabled(value: boolean | cdktf.IResolvable) { + this._whitelistEnabled = value; + } + // Temporarily expose input value. Use with caution. + public get whitelistEnabledInput() { + return this._whitelistEnabled; + } +} +export interface CssClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#create CssCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#delete CssCluster#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#update CssCluster#update} + */ + readonly update?: string; +} + +export function cssClusterTimeoutsToTerraform(struct?: CssClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cssClusterTimeoutsToHclTerraform(struct?: CssClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface CssClusterVpcepEndpoint { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#endpoint_with_dns_name CssCluster#endpoint_with_dns_name} + */ + readonly endpointWithDnsName: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#whitelist CssCluster#whitelist} + */ + readonly whitelist?: string[]; +} + +export function cssClusterVpcepEndpointToTerraform(struct?: CssClusterVpcepEndpointOutputReference | CssClusterVpcepEndpoint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + endpoint_with_dns_name: cdktf.booleanToTerraform(struct!.endpointWithDnsName), + whitelist: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.whitelist), + } +} + + +export function cssClusterVpcepEndpointToHclTerraform(struct?: CssClusterVpcepEndpointOutputReference | CssClusterVpcepEndpoint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + endpoint_with_dns_name: { + value: cdktf.booleanToHclTerraform(struct!.endpointWithDnsName), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + whitelist: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.whitelist), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssClusterVpcepEndpointOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssClusterVpcepEndpoint | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endpointWithDnsName !== undefined) { + hasAnyValues = true; + internalValueResult.endpointWithDnsName = this._endpointWithDnsName; + } + if (this._whitelist !== undefined) { + hasAnyValues = true; + internalValueResult.whitelist = this._whitelist; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssClusterVpcepEndpoint | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endpointWithDnsName = undefined; + this._whitelist = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endpointWithDnsName = value.endpointWithDnsName; + this._whitelist = value.whitelist; + } + } + + // endpoint_with_dns_name - computed: false, optional: false, required: true + private _endpointWithDnsName?: boolean | cdktf.IResolvable; + public get endpointWithDnsName() { + return this.getBooleanAttribute('endpoint_with_dns_name'); + } + public set endpointWithDnsName(value: boolean | cdktf.IResolvable) { + this._endpointWithDnsName = value; + } + // Temporarily expose input value. Use with caution. + public get endpointWithDnsNameInput() { + return this._endpointWithDnsName; + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string[]; + public get whitelist() { + return this.getListAttribute('whitelist'); + } + public set whitelist(value: string[]) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster huaweicloud_css_cluster} +*/ +export class CssCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssCluster to import + * @param importFromId The id of the existing CssCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_cluster huaweicloud_css_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssClusterConfig + */ + public constructor(scope: Construct, id: string, config: CssClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._enableForceNew = config.enableForceNew; + this._engineType = config.engineType; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._expectNodeNum = config.expectNodeNum; + this._httpsEnabled = config.httpsEnabled; + this._id = config.id; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._securityMode = config.securityMode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._clientNodeConfig.internalValue = config.clientNodeConfig; + this._coldNodeConfig.internalValue = config.coldNodeConfig; + this._essNodeConfig.internalValue = config.essNodeConfig; + this._kibanaPublicAccess.internalValue = config.kibanaPublicAccess; + this._masterNodeConfig.internalValue = config.masterNodeConfig; + this._nodeConfig.internalValue = config.nodeConfig; + this._publicAccess.internalValue = config.publicAccess; + this._timeouts.internalValue = config.timeouts; + this._vpcepEndpoint.internalValue = config.vpcepEndpoint; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // backup_available - computed: true, optional: false, required: false + public get backupAvailable() { + return this.getBooleanAttribute('backup_available'); + } + + // bandwidth_resource_id - computed: true, optional: false, required: false + public get bandwidthResourceId() { + return this.getStringAttribute('bandwidth_resource_id'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // disk_encrypted - computed: true, optional: false, required: false + public get diskEncrypted() { + return this.getBooleanAttribute('disk_encrypted'); + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // engine_type - computed: false, optional: true, required: false + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + public resetEngineType() { + this._engineType = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // engine_version - computed: false, optional: false, required: true + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expect_node_num - computed: true, optional: true, required: false + private _expectNodeNum?: number; + public get expectNodeNum() { + return this.getNumberAttribute('expect_node_num'); + } + public set expectNodeNum(value: number) { + this._expectNodeNum = value; + } + public resetExpectNodeNum() { + this._expectNodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get expectNodeNumInput() { + return this._expectNodeNum; + } + + // https_enabled - computed: true, optional: true, required: false + private _httpsEnabled?: boolean | cdktf.IResolvable; + public get httpsEnabled() { + return this.getBooleanAttribute('https_enabled'); + } + public set httpsEnabled(value: boolean | cdktf.IResolvable) { + this._httpsEnabled = value; + } + public resetHttpsEnabled() { + this._httpsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpsEnabledInput() { + return this._httpsEnabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_period - computed: true, optional: false, required: false + public get isPeriod() { + return this.getBooleanAttribute('is_period'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new CssClusterNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_mode - computed: false, optional: true, required: false + private _securityMode?: boolean | cdktf.IResolvable; + public get securityMode() { + return this.getBooleanAttribute('security_mode'); + } + public set securityMode(value: boolean | cdktf.IResolvable) { + this._securityMode = value; + } + public resetSecurityMode() { + this._securityMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityModeInput() { + return this._securityMode; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpcep_endpoint_id - computed: true, optional: false, required: false + public get vpcepEndpointId() { + return this.getStringAttribute('vpcep_endpoint_id'); + } + + // vpcep_ip - computed: true, optional: false, required: false + public get vpcepIp() { + return this.getStringAttribute('vpcep_ip'); + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new CssClusterBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: CssClusterBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // client_node_config - computed: false, optional: true, required: false + private _clientNodeConfig = new CssClusterClientNodeConfigOutputReference(this, "client_node_config"); + public get clientNodeConfig() { + return this._clientNodeConfig; + } + public putClientNodeConfig(value: CssClusterClientNodeConfig) { + this._clientNodeConfig.internalValue = value; + } + public resetClientNodeConfig() { + this._clientNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientNodeConfigInput() { + return this._clientNodeConfig.internalValue; + } + + // cold_node_config - computed: false, optional: true, required: false + private _coldNodeConfig = new CssClusterColdNodeConfigOutputReference(this, "cold_node_config"); + public get coldNodeConfig() { + return this._coldNodeConfig; + } + public putColdNodeConfig(value: CssClusterColdNodeConfig) { + this._coldNodeConfig.internalValue = value; + } + public resetColdNodeConfig() { + this._coldNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get coldNodeConfigInput() { + return this._coldNodeConfig.internalValue; + } + + // ess_node_config - computed: false, optional: true, required: false + private _essNodeConfig = new CssClusterEssNodeConfigOutputReference(this, "ess_node_config"); + public get essNodeConfig() { + return this._essNodeConfig; + } + public putEssNodeConfig(value: CssClusterEssNodeConfig) { + this._essNodeConfig.internalValue = value; + } + public resetEssNodeConfig() { + this._essNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get essNodeConfigInput() { + return this._essNodeConfig.internalValue; + } + + // kibana_public_access - computed: false, optional: true, required: false + private _kibanaPublicAccess = new CssClusterKibanaPublicAccessOutputReference(this, "kibana_public_access"); + public get kibanaPublicAccess() { + return this._kibanaPublicAccess; + } + public putKibanaPublicAccess(value: CssClusterKibanaPublicAccess) { + this._kibanaPublicAccess.internalValue = value; + } + public resetKibanaPublicAccess() { + this._kibanaPublicAccess.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kibanaPublicAccessInput() { + return this._kibanaPublicAccess.internalValue; + } + + // master_node_config - computed: false, optional: true, required: false + private _masterNodeConfig = new CssClusterMasterNodeConfigOutputReference(this, "master_node_config"); + public get masterNodeConfig() { + return this._masterNodeConfig; + } + public putMasterNodeConfig(value: CssClusterMasterNodeConfig) { + this._masterNodeConfig.internalValue = value; + } + public resetMasterNodeConfig() { + this._masterNodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterNodeConfigInput() { + return this._masterNodeConfig.internalValue; + } + + // node_config - computed: false, optional: true, required: false + private _nodeConfig = new CssClusterNodeConfigOutputReference(this, "node_config"); + public get nodeConfig() { + return this._nodeConfig; + } + public putNodeConfig(value: CssClusterNodeConfig) { + this._nodeConfig.internalValue = value; + } + public resetNodeConfig() { + this._nodeConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeConfigInput() { + return this._nodeConfig.internalValue; + } + + // public_access - computed: false, optional: true, required: false + private _publicAccess = new CssClusterPublicAccessOutputReference(this, "public_access"); + public get publicAccess() { + return this._publicAccess; + } + public putPublicAccess(value: CssClusterPublicAccess) { + this._publicAccess.internalValue = value; + } + public resetPublicAccess() { + this._publicAccess.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicAccessInput() { + return this._publicAccess.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // vpcep_endpoint - computed: false, optional: true, required: false + private _vpcepEndpoint = new CssClusterVpcepEndpointOutputReference(this, "vpcep_endpoint"); + public get vpcepEndpoint() { + return this._vpcepEndpoint; + } + public putVpcepEndpoint(value: CssClusterVpcepEndpoint) { + this._vpcepEndpoint.internalValue = value; + } + public resetVpcepEndpoint() { + this._vpcepEndpoint.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcepEndpointInput() { + return this._vpcepEndpoint.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + engine_type: cdktf.stringToTerraform(this._engineType), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + expect_node_num: cdktf.numberToTerraform(this._expectNodeNum), + https_enabled: cdktf.booleanToTerraform(this._httpsEnabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + security_mode: cdktf.booleanToTerraform(this._securityMode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: cssClusterBackupStrategyToTerraform(this._backupStrategy.internalValue), + client_node_config: cssClusterClientNodeConfigToTerraform(this._clientNodeConfig.internalValue), + cold_node_config: cssClusterColdNodeConfigToTerraform(this._coldNodeConfig.internalValue), + ess_node_config: cssClusterEssNodeConfigToTerraform(this._essNodeConfig.internalValue), + kibana_public_access: cssClusterKibanaPublicAccessToTerraform(this._kibanaPublicAccess.internalValue), + master_node_config: cssClusterMasterNodeConfigToTerraform(this._masterNodeConfig.internalValue), + node_config: cssClusterNodeConfigToTerraform(this._nodeConfig.internalValue), + public_access: cssClusterPublicAccessToTerraform(this._publicAccess.internalValue), + timeouts: cssClusterTimeoutsToTerraform(this._timeouts.internalValue), + vpcep_endpoint: cssClusterVpcepEndpointToTerraform(this._vpcepEndpoint.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expect_node_num: { + value: cdktf.numberToHclTerraform(this._expectNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + https_enabled: { + value: cdktf.booleanToHclTerraform(this._httpsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_mode: { + value: cdktf.booleanToHclTerraform(this._securityMode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: cssClusterBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterBackupStrategyList", + }, + client_node_config: { + value: cssClusterClientNodeConfigToHclTerraform(this._clientNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterClientNodeConfigList", + }, + cold_node_config: { + value: cssClusterColdNodeConfigToHclTerraform(this._coldNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterColdNodeConfigList", + }, + ess_node_config: { + value: cssClusterEssNodeConfigToHclTerraform(this._essNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterEssNodeConfigList", + }, + kibana_public_access: { + value: cssClusterKibanaPublicAccessToHclTerraform(this._kibanaPublicAccess.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterKibanaPublicAccessList", + }, + master_node_config: { + value: cssClusterMasterNodeConfigToHclTerraform(this._masterNodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterMasterNodeConfigList", + }, + node_config: { + value: cssClusterNodeConfigToHclTerraform(this._nodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterNodeConfigList", + }, + public_access: { + value: cssClusterPublicAccessToHclTerraform(this._publicAccess.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterPublicAccessList", + }, + timeouts: { + value: cssClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssClusterTimeouts", + }, + vpcep_endpoint: { + value: cssClusterVpcepEndpointToHclTerraform(this._vpcepEndpoint.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssClusterVpcepEndpointList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-configuration/README.md b/src/constructs/providers/huaweicloud/css-configuration/README.md new file mode 100644 index 00000000..069d12dd --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration). diff --git a/src/constructs/providers/huaweicloud/css-configuration/index.ts b/src/constructs/providers/huaweicloud/css-configuration/index.ts new file mode 100644 index 00000000..cccf7960 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-configuration/index.ts @@ -0,0 +1,598 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * The CSS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#cluster_id CssConfiguration#cluster_id} + */ + readonly clusterId: string; + /** + * Whether to return the Access-Control-Allow-Credentials of the header during cross-domain access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#http_cors_allow_credetials CssConfiguration#http_cors_allow_credetials} + */ + readonly httpCorsAllowCredetials?: string; + /** + * Headers allowed for cross-domain access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#http_cors_allow_headers CssConfiguration#http_cors_allow_headers} + */ + readonly httpCorsAllowHeaders?: string; + /** + * Methods allowed for cross-domain access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#http_cors_allow_methods CssConfiguration#http_cors_allow_methods} + */ + readonly httpCorsAllowMethods?: string; + /** + * Origin IP address allowed for cross-domain access, for example, **122.122.122.122:9200**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#http_cors_allow_origin CssConfiguration#http_cors_allow_origin} + */ + readonly httpCorsAllowOrigin?: string; + /** + * Whether to allow cross-domain access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#http_cors_enabled CssConfiguration#http_cors_enabled} + */ + readonly httpCorsEnabled?: string; + /** + * Cache duration of the browser. The cache is automatically cleared after the time range you specify. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#http_cors_max_age CssConfiguration#http_cors_max_age} + */ + readonly httpCorsMaxAge?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#id CssConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Cache size in the query phase. Value range: **1** to **100**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#indices_queries_cache_size CssConfiguration#indices_queries_cache_size} + */ + readonly indicesQueriesCacheSize?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#region CssConfiguration#region} + */ + readonly region?: string; + /** + * Configured for migrating data from the current cluster to the target cluster through the reindex API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#reindex_remote_whitelist CssConfiguration#reindex_remote_whitelist} + */ + readonly reindexRemoteWhitelist?: string; + /** + * Queue size in the force merge thread pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#thread_pool_force_merge_size CssConfiguration#thread_pool_force_merge_size} + */ + readonly threadPoolForceMergeSize?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#timeouts CssConfiguration#timeouts} + */ + readonly timeouts?: CssConfigurationTimeouts; +} +export interface CssConfigurationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#create CssConfiguration#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#delete CssConfiguration#delete} + */ + readonly delete?: string; +} + +export function cssConfigurationTimeoutsToTerraform(struct?: CssConfigurationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cssConfigurationTimeoutsToHclTerraform(struct?: CssConfigurationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssConfigurationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssConfigurationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssConfigurationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration huaweicloud_css_configuration} +*/ +export class CssConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssConfiguration to import + * @param importFromId The id of the existing CssConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_configuration huaweicloud_css_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: CssConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._httpCorsAllowCredetials = config.httpCorsAllowCredetials; + this._httpCorsAllowHeaders = config.httpCorsAllowHeaders; + this._httpCorsAllowMethods = config.httpCorsAllowMethods; + this._httpCorsAllowOrigin = config.httpCorsAllowOrigin; + this._httpCorsEnabled = config.httpCorsEnabled; + this._httpCorsMaxAge = config.httpCorsMaxAge; + this._id = config.id; + this._indicesQueriesCacheSize = config.indicesQueriesCacheSize; + this._region = config.region; + this._reindexRemoteWhitelist = config.reindexRemoteWhitelist; + this._threadPoolForceMergeSize = config.threadPoolForceMergeSize; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // http_cors_allow_credetials - computed: true, optional: true, required: false + private _httpCorsAllowCredetials?: string; + public get httpCorsAllowCredetials() { + return this.getStringAttribute('http_cors_allow_credetials'); + } + public set httpCorsAllowCredetials(value: string) { + this._httpCorsAllowCredetials = value; + } + public resetHttpCorsAllowCredetials() { + this._httpCorsAllowCredetials = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCorsAllowCredetialsInput() { + return this._httpCorsAllowCredetials; + } + + // http_cors_allow_headers - computed: true, optional: true, required: false + private _httpCorsAllowHeaders?: string; + public get httpCorsAllowHeaders() { + return this.getStringAttribute('http_cors_allow_headers'); + } + public set httpCorsAllowHeaders(value: string) { + this._httpCorsAllowHeaders = value; + } + public resetHttpCorsAllowHeaders() { + this._httpCorsAllowHeaders = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCorsAllowHeadersInput() { + return this._httpCorsAllowHeaders; + } + + // http_cors_allow_methods - computed: true, optional: true, required: false + private _httpCorsAllowMethods?: string; + public get httpCorsAllowMethods() { + return this.getStringAttribute('http_cors_allow_methods'); + } + public set httpCorsAllowMethods(value: string) { + this._httpCorsAllowMethods = value; + } + public resetHttpCorsAllowMethods() { + this._httpCorsAllowMethods = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCorsAllowMethodsInput() { + return this._httpCorsAllowMethods; + } + + // http_cors_allow_origin - computed: true, optional: true, required: false + private _httpCorsAllowOrigin?: string; + public get httpCorsAllowOrigin() { + return this.getStringAttribute('http_cors_allow_origin'); + } + public set httpCorsAllowOrigin(value: string) { + this._httpCorsAllowOrigin = value; + } + public resetHttpCorsAllowOrigin() { + this._httpCorsAllowOrigin = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCorsAllowOriginInput() { + return this._httpCorsAllowOrigin; + } + + // http_cors_enabled - computed: true, optional: true, required: false + private _httpCorsEnabled?: string; + public get httpCorsEnabled() { + return this.getStringAttribute('http_cors_enabled'); + } + public set httpCorsEnabled(value: string) { + this._httpCorsEnabled = value; + } + public resetHttpCorsEnabled() { + this._httpCorsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCorsEnabledInput() { + return this._httpCorsEnabled; + } + + // http_cors_max_age - computed: true, optional: true, required: false + private _httpCorsMaxAge?: string; + public get httpCorsMaxAge() { + return this.getStringAttribute('http_cors_max_age'); + } + public set httpCorsMaxAge(value: string) { + this._httpCorsMaxAge = value; + } + public resetHttpCorsMaxAge() { + this._httpCorsMaxAge = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpCorsMaxAgeInput() { + return this._httpCorsMaxAge; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // indices_queries_cache_size - computed: true, optional: true, required: false + private _indicesQueriesCacheSize?: string; + public get indicesQueriesCacheSize() { + return this.getStringAttribute('indices_queries_cache_size'); + } + public set indicesQueriesCacheSize(value: string) { + this._indicesQueriesCacheSize = value; + } + public resetIndicesQueriesCacheSize() { + this._indicesQueriesCacheSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get indicesQueriesCacheSizeInput() { + return this._indicesQueriesCacheSize; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reindex_remote_whitelist - computed: true, optional: true, required: false + private _reindexRemoteWhitelist?: string; + public get reindexRemoteWhitelist() { + return this.getStringAttribute('reindex_remote_whitelist'); + } + public set reindexRemoteWhitelist(value: string) { + this._reindexRemoteWhitelist = value; + } + public resetReindexRemoteWhitelist() { + this._reindexRemoteWhitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get reindexRemoteWhitelistInput() { + return this._reindexRemoteWhitelist; + } + + // thread_pool_force_merge_size - computed: true, optional: true, required: false + private _threadPoolForceMergeSize?: string; + public get threadPoolForceMergeSize() { + return this.getStringAttribute('thread_pool_force_merge_size'); + } + public set threadPoolForceMergeSize(value: string) { + this._threadPoolForceMergeSize = value; + } + public resetThreadPoolForceMergeSize() { + this._threadPoolForceMergeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get threadPoolForceMergeSizeInput() { + return this._threadPoolForceMergeSize; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssConfigurationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssConfigurationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + http_cors_allow_credetials: cdktf.stringToTerraform(this._httpCorsAllowCredetials), + http_cors_allow_headers: cdktf.stringToTerraform(this._httpCorsAllowHeaders), + http_cors_allow_methods: cdktf.stringToTerraform(this._httpCorsAllowMethods), + http_cors_allow_origin: cdktf.stringToTerraform(this._httpCorsAllowOrigin), + http_cors_enabled: cdktf.stringToTerraform(this._httpCorsEnabled), + http_cors_max_age: cdktf.stringToTerraform(this._httpCorsMaxAge), + id: cdktf.stringToTerraform(this._id), + indices_queries_cache_size: cdktf.stringToTerraform(this._indicesQueriesCacheSize), + region: cdktf.stringToTerraform(this._region), + reindex_remote_whitelist: cdktf.stringToTerraform(this._reindexRemoteWhitelist), + thread_pool_force_merge_size: cdktf.stringToTerraform(this._threadPoolForceMergeSize), + timeouts: cssConfigurationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_cors_allow_credetials: { + value: cdktf.stringToHclTerraform(this._httpCorsAllowCredetials), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_cors_allow_headers: { + value: cdktf.stringToHclTerraform(this._httpCorsAllowHeaders), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_cors_allow_methods: { + value: cdktf.stringToHclTerraform(this._httpCorsAllowMethods), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_cors_allow_origin: { + value: cdktf.stringToHclTerraform(this._httpCorsAllowOrigin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_cors_enabled: { + value: cdktf.stringToHclTerraform(this._httpCorsEnabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_cors_max_age: { + value: cdktf.stringToHclTerraform(this._httpCorsMaxAge), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + indices_queries_cache_size: { + value: cdktf.stringToHclTerraform(this._indicesQueriesCacheSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reindex_remote_whitelist: { + value: cdktf.stringToHclTerraform(this._reindexRemoteWhitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thread_pool_force_merge_size: { + value: cdktf.stringToHclTerraform(this._threadPoolForceMergeSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssConfigurationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssConfigurationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-es-core-upgrade/README.md b/src/constructs/providers/huaweicloud/css-es-core-upgrade/README.md new file mode 100644 index 00000000..dcfbd8fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-es-core-upgrade/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_es_core_upgrade` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_es_core_upgrade`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade). diff --git a/src/constructs/providers/huaweicloud/css-es-core-upgrade/index.ts b/src/constructs/providers/huaweicloud/css-es-core-upgrade/index.ts new file mode 100644 index 00000000..e8a7bafb --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-es-core-upgrade/index.ts @@ -0,0 +1,646 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssEsCoreUpgradeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#agency CssEsCoreUpgrade#agency} + */ + readonly agency: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#cluster_id CssEsCoreUpgrade#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#cluster_load_check CssEsCoreUpgrade#cluster_load_check} + */ + readonly clusterLoadCheck?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#enable_force_new CssEsCoreUpgrade#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#id CssEsCoreUpgrade#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#indices_backup_check CssEsCoreUpgrade#indices_backup_check} + */ + readonly indicesBackupCheck: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#region CssEsCoreUpgrade#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#target_image_id CssEsCoreUpgrade#target_image_id} + */ + readonly targetImageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#upgrade_type CssEsCoreUpgrade#upgrade_type} + */ + readonly upgradeType: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#timeouts CssEsCoreUpgrade#timeouts} + */ + readonly timeouts?: CssEsCoreUpgradeTimeouts; +} +export interface CssEsCoreUpgradeUpgradeDetailDatastore { +} + +export function cssEsCoreUpgradeUpgradeDetailDatastoreToTerraform(struct?: CssEsCoreUpgradeUpgradeDetailDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssEsCoreUpgradeUpgradeDetailDatastoreToHclTerraform(struct?: CssEsCoreUpgradeUpgradeDetailDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssEsCoreUpgradeUpgradeDetailDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssEsCoreUpgradeUpgradeDetailDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsCoreUpgradeUpgradeDetailDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class CssEsCoreUpgradeUpgradeDetailDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssEsCoreUpgradeUpgradeDetailDatastoreOutputReference { + return new CssEsCoreUpgradeUpgradeDetailDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssEsCoreUpgradeUpgradeDetail { +} + +export function cssEsCoreUpgradeUpgradeDetailToTerraform(struct?: CssEsCoreUpgradeUpgradeDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssEsCoreUpgradeUpgradeDetailToHclTerraform(struct?: CssEsCoreUpgradeUpgradeDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssEsCoreUpgradeUpgradeDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssEsCoreUpgradeUpgradeDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsCoreUpgradeUpgradeDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agency - computed: true, optional: false, required: false + public get agency() { + return this.getStringAttribute('agency'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new CssEsCoreUpgradeUpgradeDetailDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // retry_times - computed: true, optional: false, required: false + public get retryTimes() { + return this.getStringAttribute('retry_times'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // total_nodes - computed: true, optional: false, required: false + public get totalNodes() { + return this.getStringAttribute('total_nodes'); + } +} + +export class CssEsCoreUpgradeUpgradeDetailList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssEsCoreUpgradeUpgradeDetailOutputReference { + return new CssEsCoreUpgradeUpgradeDetailOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssEsCoreUpgradeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#create CssEsCoreUpgrade#create} + */ + readonly create?: string; +} + +export function cssEsCoreUpgradeTimeoutsToTerraform(struct?: CssEsCoreUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssEsCoreUpgradeTimeoutsToHclTerraform(struct?: CssEsCoreUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssEsCoreUpgradeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssEsCoreUpgradeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsCoreUpgradeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade huaweicloud_css_es_core_upgrade} +*/ +export class CssEsCoreUpgrade extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_es_core_upgrade"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssEsCoreUpgrade resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssEsCoreUpgrade to import + * @param importFromId The id of the existing CssEsCoreUpgrade that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssEsCoreUpgrade to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_es_core_upgrade", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_core_upgrade huaweicloud_css_es_core_upgrade} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssEsCoreUpgradeConfig + */ + public constructor(scope: Construct, id: string, config: CssEsCoreUpgradeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_es_core_upgrade', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._clusterId = config.clusterId; + this._clusterLoadCheck = config.clusterLoadCheck; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._indicesBackupCheck = config.indicesBackupCheck; + this._region = config.region; + this._targetImageId = config.targetImageId; + this._upgradeType = config.upgradeType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: false, required: true + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_load_check - computed: false, optional: true, required: false + private _clusterLoadCheck?: boolean | cdktf.IResolvable; + public get clusterLoadCheck() { + return this.getBooleanAttribute('cluster_load_check'); + } + public set clusterLoadCheck(value: boolean | cdktf.IResolvable) { + this._clusterLoadCheck = value; + } + public resetClusterLoadCheck() { + this._clusterLoadCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterLoadCheckInput() { + return this._clusterLoadCheck; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // indices_backup_check - computed: false, optional: false, required: true + private _indicesBackupCheck?: boolean | cdktf.IResolvable; + public get indicesBackupCheck() { + return this.getBooleanAttribute('indices_backup_check'); + } + public set indicesBackupCheck(value: boolean | cdktf.IResolvable) { + this._indicesBackupCheck = value; + } + // Temporarily expose input value. Use with caution. + public get indicesBackupCheckInput() { + return this._indicesBackupCheck; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_image_id - computed: false, optional: false, required: true + private _targetImageId?: string; + public get targetImageId() { + return this.getStringAttribute('target_image_id'); + } + public set targetImageId(value: string) { + this._targetImageId = value; + } + // Temporarily expose input value. Use with caution. + public get targetImageIdInput() { + return this._targetImageId; + } + + // upgrade_detail - computed: true, optional: false, required: false + private _upgradeDetail = new CssEsCoreUpgradeUpgradeDetailList(this, "upgrade_detail", false); + public get upgradeDetail() { + return this._upgradeDetail; + } + + // upgrade_type - computed: false, optional: false, required: true + private _upgradeType?: string; + public get upgradeType() { + return this.getStringAttribute('upgrade_type'); + } + public set upgradeType(value: string) { + this._upgradeType = value; + } + // Temporarily expose input value. Use with caution. + public get upgradeTypeInput() { + return this._upgradeType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssEsCoreUpgradeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssEsCoreUpgradeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_load_check: cdktf.booleanToTerraform(this._clusterLoadCheck), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + indices_backup_check: cdktf.booleanToTerraform(this._indicesBackupCheck), + region: cdktf.stringToTerraform(this._region), + target_image_id: cdktf.stringToTerraform(this._targetImageId), + upgrade_type: cdktf.stringToTerraform(this._upgradeType), + timeouts: cssEsCoreUpgradeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_load_check: { + value: cdktf.booleanToHclTerraform(this._clusterLoadCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + indices_backup_check: { + value: cdktf.booleanToHclTerraform(this._indicesBackupCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_image_id: { + value: cdktf.stringToHclTerraform(this._targetImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + upgrade_type: { + value: cdktf.stringToHclTerraform(this._upgradeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssEsCoreUpgradeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssEsCoreUpgradeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-es-loadbalancer-config/README.md b/src/constructs/providers/huaweicloud/css-es-loadbalancer-config/README.md new file mode 100644 index 00000000..3c832abd --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-es-loadbalancer-config/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_es_loadbalancer_config` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_es_loadbalancer_config`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config). diff --git a/src/constructs/providers/huaweicloud/css-es-loadbalancer-config/index.ts b/src/constructs/providers/huaweicloud/css-es-loadbalancer-config/index.ts new file mode 100644 index 00000000..e2b987b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-es-loadbalancer-config/index.ts @@ -0,0 +1,846 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssEsLoadbalancerConfigConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#agency CssEsLoadbalancerConfig#agency} + */ + readonly agency: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#ca_cert_id CssEsLoadbalancerConfig#ca_cert_id} + */ + readonly caCertId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#cluster_id CssEsLoadbalancerConfig#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#id CssEsLoadbalancerConfig#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#loadbalancer_id CssEsLoadbalancerConfig#loadbalancer_id} + */ + readonly loadbalancerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#protocol_port CssEsLoadbalancerConfig#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#region CssEsLoadbalancerConfig#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#server_cert_id CssEsLoadbalancerConfig#server_cert_id} + */ + readonly serverCertId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#timeouts CssEsLoadbalancerConfig#timeouts} + */ + readonly timeouts?: CssEsLoadbalancerConfigTimeouts; +} +export interface CssEsLoadbalancerConfigHealthMonitors { +} + +export function cssEsLoadbalancerConfigHealthMonitorsToTerraform(struct?: CssEsLoadbalancerConfigHealthMonitors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssEsLoadbalancerConfigHealthMonitorsToHclTerraform(struct?: CssEsLoadbalancerConfigHealthMonitors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssEsLoadbalancerConfigHealthMonitorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssEsLoadbalancerConfigHealthMonitors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsLoadbalancerConfigHealthMonitors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class CssEsLoadbalancerConfigHealthMonitorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssEsLoadbalancerConfigHealthMonitorsOutputReference { + return new CssEsLoadbalancerConfigHealthMonitorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssEsLoadbalancerConfigListenerIpGroup { +} + +export function cssEsLoadbalancerConfigListenerIpGroupToTerraform(struct?: CssEsLoadbalancerConfigListenerIpGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssEsLoadbalancerConfigListenerIpGroupToHclTerraform(struct?: CssEsLoadbalancerConfigListenerIpGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssEsLoadbalancerConfigListenerIpGroupOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssEsLoadbalancerConfigListenerIpGroup | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsLoadbalancerConfigListenerIpGroup | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class CssEsLoadbalancerConfigListenerIpGroupList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssEsLoadbalancerConfigListenerIpGroupOutputReference { + return new CssEsLoadbalancerConfigListenerIpGroupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssEsLoadbalancerConfigListener { +} + +export function cssEsLoadbalancerConfigListenerToTerraform(struct?: CssEsLoadbalancerConfigListener): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssEsLoadbalancerConfigListenerToHclTerraform(struct?: CssEsLoadbalancerConfigListener): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssEsLoadbalancerConfigListenerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssEsLoadbalancerConfigListener | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsLoadbalancerConfigListener | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_group - computed: true, optional: false, required: false + private _ipGroup = new CssEsLoadbalancerConfigListenerIpGroupList(this, "ip_group", false); + public get ipGroup() { + return this._ipGroup; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } +} + +export class CssEsLoadbalancerConfigListenerList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssEsLoadbalancerConfigListenerOutputReference { + return new CssEsLoadbalancerConfigListenerOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssEsLoadbalancerConfigLoadbalancer { +} + +export function cssEsLoadbalancerConfigLoadbalancerToTerraform(struct?: CssEsLoadbalancerConfigLoadbalancer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssEsLoadbalancerConfigLoadbalancerToHclTerraform(struct?: CssEsLoadbalancerConfigLoadbalancer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssEsLoadbalancerConfigLoadbalancerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssEsLoadbalancerConfigLoadbalancer | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsLoadbalancerConfigLoadbalancer | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } +} + +export class CssEsLoadbalancerConfigLoadbalancerList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssEsLoadbalancerConfigLoadbalancerOutputReference { + return new CssEsLoadbalancerConfigLoadbalancerOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssEsLoadbalancerConfigTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#create CssEsLoadbalancerConfig#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#delete CssEsLoadbalancerConfig#delete} + */ + readonly delete?: string; +} + +export function cssEsLoadbalancerConfigTimeoutsToTerraform(struct?: CssEsLoadbalancerConfigTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cssEsLoadbalancerConfigTimeoutsToHclTerraform(struct?: CssEsLoadbalancerConfigTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssEsLoadbalancerConfigTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssEsLoadbalancerConfigTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssEsLoadbalancerConfigTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config huaweicloud_css_es_loadbalancer_config} +*/ +export class CssEsLoadbalancerConfig extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_es_loadbalancer_config"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssEsLoadbalancerConfig resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssEsLoadbalancerConfig to import + * @param importFromId The id of the existing CssEsLoadbalancerConfig that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssEsLoadbalancerConfig to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_es_loadbalancer_config", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_es_loadbalancer_config huaweicloud_css_es_loadbalancer_config} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssEsLoadbalancerConfigConfig + */ + public constructor(scope: Construct, id: string, config: CssEsLoadbalancerConfigConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_es_loadbalancer_config', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._caCertId = config.caCertId; + this._clusterId = config.clusterId; + this._id = config.id; + this._loadbalancerId = config.loadbalancerId; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._serverCertId = config.serverCertId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: false, required: true + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // authentication_type - computed: true, optional: false, required: false + public get authenticationType() { + return this.getStringAttribute('authentication_type'); + } + + // ca_cert_id - computed: false, optional: true, required: false + private _caCertId?: string; + public get caCertId() { + return this.getStringAttribute('ca_cert_id'); + } + public set caCertId(value: string) { + this._caCertId = value; + } + public resetCaCertId() { + this._caCertId = undefined; + } + // Temporarily expose input value. Use with caution. + public get caCertIdInput() { + return this._caCertId; + } + + // ca_cert_name - computed: true, optional: false, required: false + public get caCertName() { + return this.getStringAttribute('ca_cert_name'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // elb_enabled - computed: true, optional: false, required: false + public get elbEnabled() { + return this.getBooleanAttribute('elb_enabled'); + } + + // health_monitors - computed: true, optional: false, required: false + private _healthMonitors = new CssEsLoadbalancerConfigHealthMonitorsList(this, "health_monitors", false); + public get healthMonitors() { + return this._healthMonitors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener - computed: true, optional: false, required: false + private _listener = new CssEsLoadbalancerConfigListenerList(this, "listener", false); + public get listener() { + return this._listener; + } + + // loadbalancer - computed: true, optional: false, required: false + private _loadbalancer = new CssEsLoadbalancerConfigLoadbalancerList(this, "loadbalancer", false); + public get loadbalancer() { + return this._loadbalancer; + } + + // loadbalancer_id - computed: false, optional: false, required: true + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_cert_id - computed: false, optional: true, required: false + private _serverCertId?: string; + public get serverCertId() { + return this.getStringAttribute('server_cert_id'); + } + public set serverCertId(value: string) { + this._serverCertId = value; + } + public resetServerCertId() { + this._serverCertId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverCertIdInput() { + return this._serverCertId; + } + + // server_cert_name - computed: true, optional: false, required: false + public get serverCertName() { + return this.getStringAttribute('server_cert_name'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssEsLoadbalancerConfigTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssEsLoadbalancerConfigTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + ca_cert_id: cdktf.stringToTerraform(this._caCertId), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + server_cert_id: cdktf.stringToTerraform(this._serverCertId), + timeouts: cssEsLoadbalancerConfigTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ca_cert_id: { + value: cdktf.stringToHclTerraform(this._caCertId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_cert_id: { + value: cdktf.stringToHclTerraform(this._serverCertId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssEsLoadbalancerConfigTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssEsLoadbalancerConfigTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-log-setting/README.md b/src/constructs/providers/huaweicloud/css-log-setting/README.md new file mode 100644 index 00000000..d6126a0b --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-log-setting/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_log_setting` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_log_setting`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting). diff --git a/src/constructs/providers/huaweicloud/css-log-setting/index.ts b/src/constructs/providers/huaweicloud/css-log-setting/index.ts new file mode 100644 index 00000000..e2e55891 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-log-setting/index.ts @@ -0,0 +1,287 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogSettingConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#agency CssLogSetting#agency} + */ + readonly agency: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#base_path CssLogSetting#base_path} + */ + readonly basePath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#bucket CssLogSetting#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#cluster_id CssLogSetting#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#id CssLogSetting#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#period CssLogSetting#period} + */ + readonly period?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#region CssLogSetting#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting huaweicloud_css_log_setting} +*/ +export class CssLogSetting extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_log_setting"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogSetting resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogSetting to import + * @param importFromId The id of the existing CssLogSetting that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogSetting to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_log_setting", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_log_setting huaweicloud_css_log_setting} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogSettingConfig + */ + public constructor(scope: Construct, id: string, config: CssLogSettingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_log_setting', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._basePath = config.basePath; + this._bucket = config.bucket; + this._clusterId = config.clusterId; + this._id = config.id; + this._period = config.period; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: false, required: true + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // auto_enabled - computed: true, optional: false, required: false + public get autoEnabled() { + return this.getBooleanAttribute('auto_enabled'); + } + + // base_path - computed: false, optional: false, required: true + private _basePath?: string; + public get basePath() { + return this.getStringAttribute('base_path'); + } + public set basePath(value: string) { + this._basePath = value; + } + // Temporarily expose input value. Use with caution. + public get basePathInput() { + return this._basePath; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_switch - computed: true, optional: false, required: false + public get logSwitch() { + return this.getBooleanAttribute('log_switch'); + } + + // period - computed: false, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + base_path: cdktf.stringToTerraform(this._basePath), + bucket: cdktf.stringToTerraform(this._bucket), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + period: cdktf.stringToTerraform(this._period), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + base_path: { + value: cdktf.stringToHclTerraform(this._basePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.stringToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-cluster-restart/README.md b/src/constructs/providers/huaweicloud/css-logstash-cluster-restart/README.md new file mode 100644 index 00000000..06b0cc48 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-cluster-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_cluster_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_cluster_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart). diff --git a/src/constructs/providers/huaweicloud/css-logstash-cluster-restart/index.ts b/src/constructs/providers/huaweicloud/css-logstash-cluster-restart/index.ts new file mode 100644 index 00000000..26c5fad9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-cluster-restart/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashClusterRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart#cluster_id CssLogstashClusterRestart#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart#id CssLogstashClusterRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart#region CssLogstashClusterRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart#timeouts CssLogstashClusterRestart#timeouts} + */ + readonly timeouts?: CssLogstashClusterRestartTimeouts; +} +export interface CssLogstashClusterRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart#create CssLogstashClusterRestart#create} + */ + readonly create?: string; +} + +export function cssLogstashClusterRestartTimeoutsToTerraform(struct?: CssLogstashClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssLogstashClusterRestartTimeoutsToHclTerraform(struct?: CssLogstashClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashClusterRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssLogstashClusterRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashClusterRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart huaweicloud_css_logstash_cluster_restart} +*/ +export class CssLogstashClusterRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_cluster_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashClusterRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashClusterRestart to import + * @param importFromId The id of the existing CssLogstashClusterRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashClusterRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_cluster_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster_restart huaweicloud_css_logstash_cluster_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashClusterRestartConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashClusterRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_cluster_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssLogstashClusterRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssLogstashClusterRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + timeouts: cssLogstashClusterRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssLogstashClusterRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssLogstashClusterRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-cluster/README.md b/src/constructs/providers/huaweicloud/css-logstash-cluster/README.md new file mode 100644 index 00000000..6f954a68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster). diff --git a/src/constructs/providers/huaweicloud/css-logstash-cluster/index.ts b/src/constructs/providers/huaweicloud/css-logstash-cluster/index.ts new file mode 100644 index 00000000..0162a113 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-cluster/index.ts @@ -0,0 +1,1255 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#auto_renew CssLogstashCluster#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#availability_zone CssLogstashCluster#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#charging_mode CssLogstashCluster#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#engine_version CssLogstashCluster#engine_version} + */ + readonly engineVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#enterprise_project_id CssLogstashCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#id CssLogstashCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#name CssLogstashCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#period CssLogstashCluster#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#period_unit CssLogstashCluster#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#region CssLogstashCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#security_group_id CssLogstashCluster#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#subnet_id CssLogstashCluster#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#tags CssLogstashCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#vpc_id CssLogstashCluster#vpc_id} + */ + readonly vpcId: string; + /** + * node_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#node_config CssLogstashCluster#node_config} + */ + readonly nodeConfig: CssLogstashClusterNodeConfig; + /** + * routes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#routes CssLogstashCluster#routes} + */ + readonly routes?: CssLogstashClusterRoutes[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#timeouts CssLogstashCluster#timeouts} + */ + readonly timeouts?: CssLogstashClusterTimeouts; +} +export interface CssLogstashClusterNodes { +} + +export function cssLogstashClusterNodesToTerraform(struct?: CssLogstashClusterNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssLogstashClusterNodesToHclTerraform(struct?: CssLogstashClusterNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssLogstashClusterNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssLogstashClusterNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashClusterNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class CssLogstashClusterNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssLogstashClusterNodesOutputReference { + return new CssLogstashClusterNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssLogstashClusterNodeConfigVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#size CssLogstashCluster#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#volume_type CssLogstashCluster#volume_type} + */ + readonly volumeType: string; +} + +export function cssLogstashClusterNodeConfigVolumeToTerraform(struct?: CssLogstashClusterNodeConfigVolumeOutputReference | CssLogstashClusterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + volume_type: cdktf.stringToTerraform(struct!.volumeType), + } +} + + +export function cssLogstashClusterNodeConfigVolumeToHclTerraform(struct?: CssLogstashClusterNodeConfigVolumeOutputReference | CssLogstashClusterNodeConfigVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(struct!.volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashClusterNodeConfigVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssLogstashClusterNodeConfigVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._volumeType !== undefined) { + hasAnyValues = true; + internalValueResult.volumeType = this._volumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashClusterNodeConfigVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._volumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._volumeType = value.volumeType; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } +} +export interface CssLogstashClusterNodeConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#flavor CssLogstashCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#instance_number CssLogstashCluster#instance_number} + */ + readonly instanceNumber: number; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#volume CssLogstashCluster#volume} + */ + readonly volume?: CssLogstashClusterNodeConfigVolume; +} + +export function cssLogstashClusterNodeConfigToTerraform(struct?: CssLogstashClusterNodeConfigOutputReference | CssLogstashClusterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor: cdktf.stringToTerraform(struct!.flavor), + instance_number: cdktf.numberToTerraform(struct!.instanceNumber), + volume: cssLogstashClusterNodeConfigVolumeToTerraform(struct!.volume), + } +} + + +export function cssLogstashClusterNodeConfigToHclTerraform(struct?: CssLogstashClusterNodeConfigOutputReference | CssLogstashClusterNodeConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_number: { + value: cdktf.numberToHclTerraform(struct!.instanceNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume: { + value: cssLogstashClusterNodeConfigVolumeToHclTerraform(struct!.volume), + isBlock: true, + type: "list", + storageClassType: "CssLogstashClusterNodeConfigVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashClusterNodeConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssLogstashClusterNodeConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._instanceNumber !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNumber = this._instanceNumber; + } + if (this._volume?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.volume = this._volume?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashClusterNodeConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavor = undefined; + this._instanceNumber = undefined; + this._volume.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavor = value.flavor; + this._instanceNumber = value.instanceNumber; + this._volume.internalValue = value.volume; + } + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // instance_number - computed: false, optional: false, required: true + private _instanceNumber?: number; + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + public set instanceNumber(value: number) { + this._instanceNumber = value; + } + // Temporarily expose input value. Use with caution. + public get instanceNumberInput() { + return this._instanceNumber; + } + + // volume - computed: false, optional: true, required: false + private _volume = new CssLogstashClusterNodeConfigVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: CssLogstashClusterNodeConfigVolume) { + this._volume.internalValue = value; + } + public resetVolume() { + this._volume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } +} +export interface CssLogstashClusterRoutes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#ip_address CssLogstashCluster#ip_address} + */ + readonly ipAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#ip_net_mask CssLogstashCluster#ip_net_mask} + */ + readonly ipNetMask: string; +} + +export function cssLogstashClusterRoutesToTerraform(struct?: CssLogstashClusterRoutes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + ip_net_mask: cdktf.stringToTerraform(struct!.ipNetMask), + } +} + + +export function cssLogstashClusterRoutesToHclTerraform(struct?: CssLogstashClusterRoutes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_net_mask: { + value: cdktf.stringToHclTerraform(struct!.ipNetMask), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashClusterRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssLogstashClusterRoutes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._ipNetMask !== undefined) { + hasAnyValues = true; + internalValueResult.ipNetMask = this._ipNetMask; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashClusterRoutes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._ipNetMask = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._ipNetMask = value.ipNetMask; + } + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_net_mask - computed: false, optional: false, required: true + private _ipNetMask?: string; + public get ipNetMask() { + return this.getStringAttribute('ip_net_mask'); + } + public set ipNetMask(value: string) { + this._ipNetMask = value; + } + // Temporarily expose input value. Use with caution. + public get ipNetMaskInput() { + return this._ipNetMask; + } +} + +export class CssLogstashClusterRoutesList extends cdktf.ComplexList { + public internalValue? : CssLogstashClusterRoutes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssLogstashClusterRoutesOutputReference { + return new CssLogstashClusterRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssLogstashClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#create CssLogstashCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#delete CssLogstashCluster#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#update CssLogstashCluster#update} + */ + readonly update?: string; +} + +export function cssLogstashClusterTimeoutsToTerraform(struct?: CssLogstashClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cssLogstashClusterTimeoutsToHclTerraform(struct?: CssLogstashClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssLogstashClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster huaweicloud_css_logstash_cluster} +*/ +export class CssLogstashCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashCluster to import + * @param importFromId The id of the existing CssLogstashCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_cluster huaweicloud_css_logstash_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashClusterConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._nodeConfig.internalValue = config.nodeConfig; + this._routes.internalValue = config.routes; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // engine_type - computed: true, optional: false, required: false + public get engineType() { + return this.getStringAttribute('engine_type'); + } + + // engine_version - computed: false, optional: false, required: true + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_period - computed: true, optional: false, required: false + public get isPeriod() { + return this.getBooleanAttribute('is_period'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new CssLogstashClusterNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // node_config - computed: false, optional: false, required: true + private _nodeConfig = new CssLogstashClusterNodeConfigOutputReference(this, "node_config"); + public get nodeConfig() { + return this._nodeConfig; + } + public putNodeConfig(value: CssLogstashClusterNodeConfig) { + this._nodeConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nodeConfigInput() { + return this._nodeConfig.internalValue; + } + + // routes - computed: false, optional: true, required: false + private _routes = new CssLogstashClusterRoutesList(this, "routes", true); + public get routes() { + return this._routes; + } + public putRoutes(value: CssLogstashClusterRoutes[] | cdktf.IResolvable) { + this._routes.internalValue = value; + } + public resetRoutes() { + this._routes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routesInput() { + return this._routes.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssLogstashClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssLogstashClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + node_config: cssLogstashClusterNodeConfigToTerraform(this._nodeConfig.internalValue), + routes: cdktf.listMapper(cssLogstashClusterRoutesToTerraform, true)(this._routes.internalValue), + timeouts: cssLogstashClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_config: { + value: cssLogstashClusterNodeConfigToHclTerraform(this._nodeConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssLogstashClusterNodeConfigList", + }, + routes: { + value: cdktf.listMapperHcl(cssLogstashClusterRoutesToHclTerraform, true)(this._routes.internalValue), + isBlock: true, + type: "set", + storageClassType: "CssLogstashClusterRoutesList", + }, + timeouts: { + value: cssLogstashClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssLogstashClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-configuration/README.md b/src/constructs/providers/huaweicloud/css-logstash-configuration/README.md new file mode 100644 index 00000000..b44c93f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration). diff --git a/src/constructs/providers/huaweicloud/css-logstash-configuration/index.ts b/src/constructs/providers/huaweicloud/css-logstash-configuration/index.ts new file mode 100644 index 00000000..e5e76d28 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-configuration/index.ts @@ -0,0 +1,687 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#cluster_id CssLogstashConfiguration#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#conf_content CssLogstashConfiguration#conf_content} + */ + readonly confContent: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#id CssLogstashConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#name CssLogstashConfiguration#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#region CssLogstashConfiguration#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#sensitive_words CssLogstashConfiguration#sensitive_words} + */ + readonly sensitiveWords?: string[]; + /** + * setting block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#setting CssLogstashConfiguration#setting} + */ + readonly setting: CssLogstashConfigurationSetting; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#timeouts CssLogstashConfiguration#timeouts} + */ + readonly timeouts?: CssLogstashConfigurationTimeouts; +} +export interface CssLogstashConfigurationSetting { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#batch_delay_ms CssLogstashConfiguration#batch_delay_ms} + */ + readonly batchDelayMs?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#batch_size CssLogstashConfiguration#batch_size} + */ + readonly batchSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#queue_check_point_writes CssLogstashConfiguration#queue_check_point_writes} + */ + readonly queueCheckPointWrites?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#queue_max_bytes_mb CssLogstashConfiguration#queue_max_bytes_mb} + */ + readonly queueMaxBytesMb?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#queue_type CssLogstashConfiguration#queue_type} + */ + readonly queueType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#workers CssLogstashConfiguration#workers} + */ + readonly workers?: number; +} + +export function cssLogstashConfigurationSettingToTerraform(struct?: CssLogstashConfigurationSettingOutputReference | CssLogstashConfigurationSetting): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + batch_delay_ms: cdktf.numberToTerraform(struct!.batchDelayMs), + batch_size: cdktf.numberToTerraform(struct!.batchSize), + queue_check_point_writes: cdktf.numberToTerraform(struct!.queueCheckPointWrites), + queue_max_bytes_mb: cdktf.numberToTerraform(struct!.queueMaxBytesMb), + queue_type: cdktf.stringToTerraform(struct!.queueType), + workers: cdktf.numberToTerraform(struct!.workers), + } +} + + +export function cssLogstashConfigurationSettingToHclTerraform(struct?: CssLogstashConfigurationSettingOutputReference | CssLogstashConfigurationSetting): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + batch_delay_ms: { + value: cdktf.numberToHclTerraform(struct!.batchDelayMs), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + batch_size: { + value: cdktf.numberToHclTerraform(struct!.batchSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_check_point_writes: { + value: cdktf.numberToHclTerraform(struct!.queueCheckPointWrites), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_max_bytes_mb: { + value: cdktf.numberToHclTerraform(struct!.queueMaxBytesMb), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_type: { + value: cdktf.stringToHclTerraform(struct!.queueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workers: { + value: cdktf.numberToHclTerraform(struct!.workers), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashConfigurationSettingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssLogstashConfigurationSetting | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._batchDelayMs !== undefined) { + hasAnyValues = true; + internalValueResult.batchDelayMs = this._batchDelayMs; + } + if (this._batchSize !== undefined) { + hasAnyValues = true; + internalValueResult.batchSize = this._batchSize; + } + if (this._queueCheckPointWrites !== undefined) { + hasAnyValues = true; + internalValueResult.queueCheckPointWrites = this._queueCheckPointWrites; + } + if (this._queueMaxBytesMb !== undefined) { + hasAnyValues = true; + internalValueResult.queueMaxBytesMb = this._queueMaxBytesMb; + } + if (this._queueType !== undefined) { + hasAnyValues = true; + internalValueResult.queueType = this._queueType; + } + if (this._workers !== undefined) { + hasAnyValues = true; + internalValueResult.workers = this._workers; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashConfigurationSetting | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._batchDelayMs = undefined; + this._batchSize = undefined; + this._queueCheckPointWrites = undefined; + this._queueMaxBytesMb = undefined; + this._queueType = undefined; + this._workers = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._batchDelayMs = value.batchDelayMs; + this._batchSize = value.batchSize; + this._queueCheckPointWrites = value.queueCheckPointWrites; + this._queueMaxBytesMb = value.queueMaxBytesMb; + this._queueType = value.queueType; + this._workers = value.workers; + } + } + + // batch_delay_ms - computed: false, optional: true, required: false + private _batchDelayMs?: number; + public get batchDelayMs() { + return this.getNumberAttribute('batch_delay_ms'); + } + public set batchDelayMs(value: number) { + this._batchDelayMs = value; + } + public resetBatchDelayMs() { + this._batchDelayMs = undefined; + } + // Temporarily expose input value. Use with caution. + public get batchDelayMsInput() { + return this._batchDelayMs; + } + + // batch_size - computed: false, optional: true, required: false + private _batchSize?: number; + public get batchSize() { + return this.getNumberAttribute('batch_size'); + } + public set batchSize(value: number) { + this._batchSize = value; + } + public resetBatchSize() { + this._batchSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get batchSizeInput() { + return this._batchSize; + } + + // queue_check_point_writes - computed: false, optional: true, required: false + private _queueCheckPointWrites?: number; + public get queueCheckPointWrites() { + return this.getNumberAttribute('queue_check_point_writes'); + } + public set queueCheckPointWrites(value: number) { + this._queueCheckPointWrites = value; + } + public resetQueueCheckPointWrites() { + this._queueCheckPointWrites = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueCheckPointWritesInput() { + return this._queueCheckPointWrites; + } + + // queue_max_bytes_mb - computed: false, optional: true, required: false + private _queueMaxBytesMb?: number; + public get queueMaxBytesMb() { + return this.getNumberAttribute('queue_max_bytes_mb'); + } + public set queueMaxBytesMb(value: number) { + this._queueMaxBytesMb = value; + } + public resetQueueMaxBytesMb() { + this._queueMaxBytesMb = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueMaxBytesMbInput() { + return this._queueMaxBytesMb; + } + + // queue_type - computed: false, optional: false, required: true + private _queueType?: string; + public get queueType() { + return this.getStringAttribute('queue_type'); + } + public set queueType(value: string) { + this._queueType = value; + } + // Temporarily expose input value. Use with caution. + public get queueTypeInput() { + return this._queueType; + } + + // workers - computed: false, optional: true, required: false + private _workers?: number; + public get workers() { + return this.getNumberAttribute('workers'); + } + public set workers(value: number) { + this._workers = value; + } + public resetWorkers() { + this._workers = undefined; + } + // Temporarily expose input value. Use with caution. + public get workersInput() { + return this._workers; + } +} +export interface CssLogstashConfigurationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#create CssLogstashConfiguration#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#update CssLogstashConfiguration#update} + */ + readonly update?: string; +} + +export function cssLogstashConfigurationTimeoutsToTerraform(struct?: CssLogstashConfigurationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cssLogstashConfigurationTimeoutsToHclTerraform(struct?: CssLogstashConfigurationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashConfigurationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssLogstashConfigurationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashConfigurationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration huaweicloud_css_logstash_configuration} +*/ +export class CssLogstashConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashConfiguration to import + * @param importFromId The id of the existing CssLogstashConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_configuration huaweicloud_css_logstash_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._confContent = config.confContent; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sensitiveWords = config.sensitiveWords; + this._setting.internalValue = config.setting; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // conf_content - computed: false, optional: false, required: true + private _confContent?: string; + public get confContent() { + return this.getStringAttribute('conf_content'); + } + public set confContent(value: string) { + this._confContent = value; + } + // Temporarily expose input value. Use with caution. + public get confContentInput() { + return this._confContent; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sensitive_words - computed: false, optional: true, required: false + private _sensitiveWords?: string[]; + public get sensitiveWords() { + return this.getListAttribute('sensitive_words'); + } + public set sensitiveWords(value: string[]) { + this._sensitiveWords = value; + } + public resetSensitiveWords() { + this._sensitiveWords = undefined; + } + // Temporarily expose input value. Use with caution. + public get sensitiveWordsInput() { + return this._sensitiveWords; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // setting - computed: false, optional: false, required: true + private _setting = new CssLogstashConfigurationSettingOutputReference(this, "setting"); + public get setting() { + return this._setting; + } + public putSetting(value: CssLogstashConfigurationSetting) { + this._setting.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get settingInput() { + return this._setting.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssLogstashConfigurationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssLogstashConfigurationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + conf_content: cdktf.stringToTerraform(this._confContent), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sensitive_words: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sensitiveWords), + setting: cssLogstashConfigurationSettingToTerraform(this._setting.internalValue), + timeouts: cssLogstashConfigurationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conf_content: { + value: cdktf.stringToHclTerraform(this._confContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sensitive_words: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sensitiveWords), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + setting: { + value: cssLogstashConfigurationSettingToHclTerraform(this._setting.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssLogstashConfigurationSettingList", + }, + timeouts: { + value: cssLogstashConfigurationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssLogstashConfigurationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-connectivity/README.md b/src/constructs/providers/huaweicloud/css-logstash-connectivity/README.md new file mode 100644 index 00000000..d145d54f --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-connectivity/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_connectivity` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_connectivity`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity). diff --git a/src/constructs/providers/huaweicloud/css-logstash-connectivity/index.ts b/src/constructs/providers/huaweicloud/css-logstash-connectivity/index.ts new file mode 100644 index 00000000..fd23df53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-connectivity/index.ts @@ -0,0 +1,582 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashConnectivityConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#cluster_id CssLogstashConnectivity#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#enable_force_new CssLogstashConnectivity#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#id CssLogstashConnectivity#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#region CssLogstashConnectivity#region} + */ + readonly region?: string; + /** + * address_and_ports block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#address_and_ports CssLogstashConnectivity#address_and_ports} + */ + readonly addressAndPorts: CssLogstashConnectivityAddressAndPorts[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#timeouts CssLogstashConnectivity#timeouts} + */ + readonly timeouts?: CssLogstashConnectivityTimeouts; +} +export interface CssLogstashConnectivityConnectivityResults { +} + +export function cssLogstashConnectivityConnectivityResultsToTerraform(struct?: CssLogstashConnectivityConnectivityResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssLogstashConnectivityConnectivityResultsToHclTerraform(struct?: CssLogstashConnectivityConnectivityResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssLogstashConnectivityConnectivityResultsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssLogstashConnectivityConnectivityResults | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashConnectivityConnectivityResults | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class CssLogstashConnectivityConnectivityResultsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssLogstashConnectivityConnectivityResultsOutputReference { + return new CssLogstashConnectivityConnectivityResultsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssLogstashConnectivityAddressAndPorts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#address CssLogstashConnectivity#address} + */ + readonly address: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#port CssLogstashConnectivity#port} + */ + readonly port: number; +} + +export function cssLogstashConnectivityAddressAndPortsToTerraform(struct?: CssLogstashConnectivityAddressAndPorts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function cssLogstashConnectivityAddressAndPortsToHclTerraform(struct?: CssLogstashConnectivityAddressAndPorts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashConnectivityAddressAndPortsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssLogstashConnectivityAddressAndPorts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashConnectivityAddressAndPorts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._port = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._port = value.port; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} + +export class CssLogstashConnectivityAddressAndPortsList extends cdktf.ComplexList { + public internalValue? : CssLogstashConnectivityAddressAndPorts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssLogstashConnectivityAddressAndPortsOutputReference { + return new CssLogstashConnectivityAddressAndPortsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssLogstashConnectivityTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#create CssLogstashConnectivity#create} + */ + readonly create?: string; +} + +export function cssLogstashConnectivityTimeoutsToTerraform(struct?: CssLogstashConnectivityTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssLogstashConnectivityTimeoutsToHclTerraform(struct?: CssLogstashConnectivityTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashConnectivityTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssLogstashConnectivityTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashConnectivityTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity huaweicloud_css_logstash_connectivity} +*/ +export class CssLogstashConnectivity extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_connectivity"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashConnectivity resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashConnectivity to import + * @param importFromId The id of the existing CssLogstashConnectivity that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashConnectivity to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_connectivity", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_connectivity huaweicloud_css_logstash_connectivity} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashConnectivityConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashConnectivityConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_connectivity', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._region = config.region; + this._addressAndPorts.internalValue = config.addressAndPorts; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // connectivity_results - computed: true, optional: false, required: false + private _connectivityResults = new CssLogstashConnectivityConnectivityResultsList(this, "connectivity_results", false); + public get connectivityResults() { + return this._connectivityResults; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // address_and_ports - computed: false, optional: false, required: true + private _addressAndPorts = new CssLogstashConnectivityAddressAndPortsList(this, "address_and_ports", false); + public get addressAndPorts() { + return this._addressAndPorts; + } + public putAddressAndPorts(value: CssLogstashConnectivityAddressAndPorts[] | cdktf.IResolvable) { + this._addressAndPorts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get addressAndPortsInput() { + return this._addressAndPorts.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssLogstashConnectivityTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssLogstashConnectivityTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + address_and_ports: cdktf.listMapper(cssLogstashConnectivityAddressAndPortsToTerraform, true)(this._addressAndPorts.internalValue), + timeouts: cssLogstashConnectivityTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_and_ports: { + value: cdktf.listMapperHcl(cssLogstashConnectivityAddressAndPortsToHclTerraform, true)(this._addressAndPorts.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssLogstashConnectivityAddressAndPortsList", + }, + timeouts: { + value: cssLogstashConnectivityTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssLogstashConnectivityTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-custom-certificate/README.md b/src/constructs/providers/huaweicloud/css-logstash-custom-certificate/README.md new file mode 100644 index 00000000..5fd8ad96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-custom-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_custom_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_custom_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate). diff --git a/src/constructs/providers/huaweicloud/css-logstash-custom-certificate/index.ts b/src/constructs/providers/huaweicloud/css-logstash-custom-certificate/index.ts new file mode 100644 index 00000000..fa1e6f31 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-custom-certificate/index.ts @@ -0,0 +1,239 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashCustomCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate#bucket_name CssLogstashCustomCertificate#bucket_name} + */ + readonly bucketName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate#cert_object CssLogstashCustomCertificate#cert_object} + */ + readonly certObject: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate#cluster_id CssLogstashCustomCertificate#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate#id CssLogstashCustomCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate#region CssLogstashCustomCertificate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate huaweicloud_css_logstash_custom_certificate} +*/ +export class CssLogstashCustomCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_custom_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashCustomCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashCustomCertificate to import + * @param importFromId The id of the existing CssLogstashCustomCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashCustomCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_custom_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_certificate huaweicloud_css_logstash_custom_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashCustomCertificateConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashCustomCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_custom_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._certObject = config.certObject; + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_name - computed: false, optional: false, required: true + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // cert_object - computed: false, optional: false, required: true + private _certObject?: string; + public get certObject() { + return this.getStringAttribute('cert_object'); + } + public set certObject(value: string) { + this._certObject = value; + } + // Temporarily expose input value. Use with caution. + public get certObjectInput() { + return this._certObject; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + cert_object: cdktf.stringToTerraform(this._certObject), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cert_object: { + value: cdktf.stringToHclTerraform(this._certObject), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-custom-template/README.md b/src/constructs/providers/huaweicloud/css-logstash-custom-template/README.md new file mode 100644 index 00000000..cd47c465 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-custom-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_custom_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_custom_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template). diff --git a/src/constructs/providers/huaweicloud/css-logstash-custom-template/index.ts b/src/constructs/providers/huaweicloud/css-logstash-custom-template/index.ts new file mode 100644 index 00000000..0a7eb7b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-custom-template/index.ts @@ -0,0 +1,257 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashCustomTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#cluster_id CssLogstashCustomTemplate#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#configuration_name CssLogstashCustomTemplate#configuration_name} + */ + readonly configurationName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#description CssLogstashCustomTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#id CssLogstashCustomTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#name CssLogstashCustomTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#region CssLogstashCustomTemplate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template huaweicloud_css_logstash_custom_template} +*/ +export class CssLogstashCustomTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_custom_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashCustomTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashCustomTemplate to import + * @param importFromId The id of the existing CssLogstashCustomTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashCustomTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_custom_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_custom_template huaweicloud_css_logstash_custom_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashCustomTemplateConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashCustomTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_custom_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._configurationName = config.configurationName; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // conf_content - computed: true, optional: false, required: false + public get confContent() { + return this.getStringAttribute('conf_content'); + } + + // configuration_name - computed: false, optional: false, required: true + private _configurationName?: string; + public get configurationName() { + return this.getStringAttribute('configuration_name'); + } + public set configurationName(value: string) { + this._configurationName = value; + } + // Temporarily expose input value. Use with caution. + public get configurationNameInput() { + return this._configurationName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: true, optional: false, required: false + public get templateId() { + return this.getStringAttribute('template_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + configuration_name: cdktf.stringToTerraform(this._configurationName), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_name: { + value: cdktf.stringToHclTerraform(this._configurationName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-logstash-pipeline/README.md b/src/constructs/providers/huaweicloud/css-logstash-pipeline/README.md new file mode 100644 index 00000000..d4855cf1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-pipeline/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_logstash_pipeline` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_logstash_pipeline`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline). diff --git a/src/constructs/providers/huaweicloud/css-logstash-pipeline/index.ts b/src/constructs/providers/huaweicloud/css-logstash-pipeline/index.ts new file mode 100644 index 00000000..bee9406a --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-logstash-pipeline/index.ts @@ -0,0 +1,566 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssLogstashPipelineConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#cluster_id CssLogstashPipeline#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#id CssLogstashPipeline#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#keep_alive CssLogstashPipeline#keep_alive} + */ + readonly keepAlive?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#names CssLogstashPipeline#names} + */ + readonly names: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#region CssLogstashPipeline#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#timeouts CssLogstashPipeline#timeouts} + */ + readonly timeouts?: CssLogstashPipelineTimeouts; +} +export interface CssLogstashPipelinePipelinesEvents { +} + +export function cssLogstashPipelinePipelinesEventsToTerraform(struct?: CssLogstashPipelinePipelinesEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssLogstashPipelinePipelinesEventsToHclTerraform(struct?: CssLogstashPipelinePipelinesEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssLogstashPipelinePipelinesEventsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssLogstashPipelinePipelinesEvents | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashPipelinePipelinesEvents | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // filtered - computed: true, optional: false, required: false + public get filtered() { + return this.getNumberAttribute('filtered'); + } + + // in - computed: true, optional: false, required: false + public get in() { + return this.getNumberAttribute('in'); + } + + // out - computed: true, optional: false, required: false + public get out() { + return this.getNumberAttribute('out'); + } +} + +export class CssLogstashPipelinePipelinesEventsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssLogstashPipelinePipelinesEventsOutputReference { + return new CssLogstashPipelinePipelinesEventsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssLogstashPipelinePipelines { +} + +export function cssLogstashPipelinePipelinesToTerraform(struct?: CssLogstashPipelinePipelines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssLogstashPipelinePipelinesToHclTerraform(struct?: CssLogstashPipelinePipelines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssLogstashPipelinePipelinesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssLogstashPipelinePipelines | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashPipelinePipelines | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // events - computed: true, optional: false, required: false + private _events = new CssLogstashPipelinePipelinesEventsList(this, "events", false); + public get events() { + return this._events; + } + + // keep_alive - computed: true, optional: false, required: false + public get keepAlive() { + return this.getBooleanAttribute('keep_alive'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class CssLogstashPipelinePipelinesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssLogstashPipelinePipelinesOutputReference { + return new CssLogstashPipelinePipelinesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssLogstashPipelineTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#create CssLogstashPipeline#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#update CssLogstashPipeline#update} + */ + readonly update?: string; +} + +export function cssLogstashPipelineTimeoutsToTerraform(struct?: CssLogstashPipelineTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cssLogstashPipelineTimeoutsToHclTerraform(struct?: CssLogstashPipelineTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssLogstashPipelineTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssLogstashPipelineTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssLogstashPipelineTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline huaweicloud_css_logstash_pipeline} +*/ +export class CssLogstashPipeline extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_pipeline"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssLogstashPipeline resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssLogstashPipeline to import + * @param importFromId The id of the existing CssLogstashPipeline that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssLogstashPipeline to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_pipeline", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_logstash_pipeline huaweicloud_css_logstash_pipeline} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssLogstashPipelineConfig + */ + public constructor(scope: Construct, id: string, config: CssLogstashPipelineConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_pipeline', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._keepAlive = config.keepAlive; + this._names = config.names; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keep_alive - computed: true, optional: true, required: false + private _keepAlive?: boolean | cdktf.IResolvable; + public get keepAlive() { + return this.getBooleanAttribute('keep_alive'); + } + public set keepAlive(value: boolean | cdktf.IResolvable) { + this._keepAlive = value; + } + public resetKeepAlive() { + this._keepAlive = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepAliveInput() { + return this._keepAlive; + } + + // names - computed: false, optional: false, required: true + private _names?: string[]; + public get names() { + return cdktf.Fn.tolist(this.getListAttribute('names')); + } + public set names(value: string[]) { + this._names = value; + } + // Temporarily expose input value. Use with caution. + public get namesInput() { + return this._names; + } + + // pipelines - computed: true, optional: false, required: false + private _pipelines = new CssLogstashPipelinePipelinesList(this, "pipelines", false); + public get pipelines() { + return this._pipelines; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssLogstashPipelineTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssLogstashPipelineTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + keep_alive: cdktf.booleanToTerraform(this._keepAlive), + names: cdktf.listMapper(cdktf.stringToTerraform, false)(this._names), + region: cdktf.stringToTerraform(this._region), + timeouts: cssLogstashPipelineTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_alive: { + value: cdktf.booleanToHclTerraform(this._keepAlive), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._names), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssLogstashPipelineTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssLogstashPipelineTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-manual-log-backup/README.md b/src/constructs/providers/huaweicloud/css-manual-log-backup/README.md new file mode 100644 index 00000000..88fa41fd --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-manual-log-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_manual_log_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_manual_log_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup). diff --git a/src/constructs/providers/huaweicloud/css-manual-log-backup/index.ts b/src/constructs/providers/huaweicloud/css-manual-log-backup/index.ts new file mode 100644 index 00000000..e9fd5dd9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-manual-log-backup/index.ts @@ -0,0 +1,332 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssManualLogBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the CSS cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup#cluster_id CssManualLogBackup#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup#id CssManualLogBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup#region CssManualLogBackup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup#timeouts CssManualLogBackup#timeouts} + */ + readonly timeouts?: CssManualLogBackupTimeouts; +} +export interface CssManualLogBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup#create CssManualLogBackup#create} + */ + readonly create?: string; +} + +export function cssManualLogBackupTimeoutsToTerraform(struct?: CssManualLogBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssManualLogBackupTimeoutsToHclTerraform(struct?: CssManualLogBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssManualLogBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssManualLogBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssManualLogBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup huaweicloud_css_manual_log_backup} +*/ +export class CssManualLogBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_manual_log_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssManualLogBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssManualLogBackup to import + * @param importFromId The id of the existing CssManualLogBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssManualLogBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_manual_log_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_manual_log_backup huaweicloud_css_manual_log_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssManualLogBackupConfig + */ + public constructor(scope: Construct, id: string, config: CssManualLogBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_manual_log_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // failed_msg - computed: true, optional: false, required: false + public get failedMsg() { + return this.getStringAttribute('failed_msg'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: true, optional: false, required: false + public get jobId() { + return this.getStringAttribute('job_id'); + } + + // log_path - computed: true, optional: false, required: false + public get logPath() { + return this.getStringAttribute('log_path'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssManualLogBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssManualLogBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + timeouts: cssManualLogBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssManualLogBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssManualLogBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-scan-task/README.md b/src/constructs/providers/huaweicloud/css-scan-task/README.md new file mode 100644 index 00000000..bfb04041 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-scan-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_scan_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_scan_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task). diff --git a/src/constructs/providers/huaweicloud/css-scan-task/index.ts b/src/constructs/providers/huaweicloud/css-scan-task/index.ts new file mode 100644 index 00000000..4ebf4761 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-scan-task/index.ts @@ -0,0 +1,694 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssScanTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#cluster_id CssScanTask#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#description CssScanTask#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#id CssScanTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#name CssScanTask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#region CssScanTask#region} + */ + readonly region?: string; + /** + * alarm block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#alarm CssScanTask#alarm} + */ + readonly alarm?: CssScanTaskAlarm; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#timeouts CssScanTask#timeouts} + */ + readonly timeouts?: CssScanTaskTimeouts; +} +export interface CssScanTaskSummary { +} + +export function cssScanTaskSummaryToTerraform(struct?: CssScanTaskSummary): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssScanTaskSummaryToHclTerraform(struct?: CssScanTaskSummary): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssScanTaskSummaryOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssScanTaskSummary | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssScanTaskSummary | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // high_num - computed: true, optional: false, required: false + public get highNum() { + return this.getNumberAttribute('high_num'); + } + + // medium_num - computed: true, optional: false, required: false + public get mediumNum() { + return this.getNumberAttribute('medium_num'); + } + + // suggestion_num - computed: true, optional: false, required: false + public get suggestionNum() { + return this.getNumberAttribute('suggestion_num'); + } +} + +export class CssScanTaskSummaryList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssScanTaskSummaryOutputReference { + return new CssScanTaskSummaryOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssScanTaskTaskRisks { +} + +export function cssScanTaskTaskRisksToTerraform(struct?: CssScanTaskTaskRisks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function cssScanTaskTaskRisksToHclTerraform(struct?: CssScanTaskTaskRisks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class CssScanTaskTaskRisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CssScanTaskTaskRisks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssScanTaskTaskRisks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // risk - computed: true, optional: false, required: false + public get risk() { + return this.getStringAttribute('risk'); + } + + // suggestion - computed: true, optional: false, required: false + public get suggestion() { + return this.getStringAttribute('suggestion'); + } +} + +export class CssScanTaskTaskRisksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CssScanTaskTaskRisksOutputReference { + return new CssScanTaskTaskRisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CssScanTaskAlarm { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#level CssScanTask#level} + */ + readonly level: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#smn_topic CssScanTask#smn_topic} + */ + readonly smnTopic: string; +} + +export function cssScanTaskAlarmToTerraform(struct?: CssScanTaskAlarmOutputReference | CssScanTaskAlarm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + level: cdktf.stringToTerraform(struct!.level), + smn_topic: cdktf.stringToTerraform(struct!.smnTopic), + } +} + + +export function cssScanTaskAlarmToHclTerraform(struct?: CssScanTaskAlarmOutputReference | CssScanTaskAlarm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + level: { + value: cdktf.stringToHclTerraform(struct!.level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + smn_topic: { + value: cdktf.stringToHclTerraform(struct!.smnTopic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssScanTaskAlarmOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CssScanTaskAlarm | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._level !== undefined) { + hasAnyValues = true; + internalValueResult.level = this._level; + } + if (this._smnTopic !== undefined) { + hasAnyValues = true; + internalValueResult.smnTopic = this._smnTopic; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssScanTaskAlarm | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._level = undefined; + this._smnTopic = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._level = value.level; + this._smnTopic = value.smnTopic; + } + } + + // level - computed: false, optional: false, required: true + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // smn_topic - computed: false, optional: false, required: true + private _smnTopic?: string; + public get smnTopic() { + return this.getStringAttribute('smn_topic'); + } + public set smnTopic(value: string) { + this._smnTopic = value; + } + // Temporarily expose input value. Use with caution. + public get smnTopicInput() { + return this._smnTopic; + } +} +export interface CssScanTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#create CssScanTask#create} + */ + readonly create?: string; +} + +export function cssScanTaskTimeoutsToTerraform(struct?: CssScanTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function cssScanTaskTimeoutsToHclTerraform(struct?: CssScanTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssScanTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssScanTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssScanTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task huaweicloud_css_scan_task} +*/ +export class CssScanTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_scan_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssScanTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssScanTask to import + * @param importFromId The id of the existing CssScanTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssScanTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_scan_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_scan_task huaweicloud_css_scan_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssScanTaskConfig + */ + public constructor(scope: Construct, id: string, config: CssScanTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_scan_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._alarm.internalValue = config.alarm; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // smn_fail_reason - computed: true, optional: false, required: false + public get smnFailReason() { + return this.getStringAttribute('smn_fail_reason'); + } + + // smn_status - computed: true, optional: false, required: false + public get smnStatus() { + return this.getStringAttribute('smn_status'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // summary - computed: true, optional: false, required: false + private _summary = new CssScanTaskSummaryList(this, "summary", false); + public get summary() { + return this._summary; + } + + // task_risks - computed: true, optional: false, required: false + private _taskRisks = new CssScanTaskTaskRisksList(this, "task_risks", false); + public get taskRisks() { + return this._taskRisks; + } + + // alarm - computed: false, optional: true, required: false + private _alarm = new CssScanTaskAlarmOutputReference(this, "alarm"); + public get alarm() { + return this._alarm; + } + public putAlarm(value: CssScanTaskAlarm) { + this._alarm.internalValue = value; + } + public resetAlarm() { + this._alarm.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmInput() { + return this._alarm.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssScanTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssScanTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + alarm: cssScanTaskAlarmToTerraform(this._alarm.internalValue), + timeouts: cssScanTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm: { + value: cssScanTaskAlarmToHclTerraform(this._alarm.internalValue), + isBlock: true, + type: "list", + storageClassType: "CssScanTaskAlarmList", + }, + timeouts: { + value: cssScanTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssScanTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-snapshot/README.md b/src/constructs/providers/huaweicloud/css-snapshot/README.md new file mode 100644 index 00000000..95abfcc8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-snapshot/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_snapshot` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_snapshot`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot). diff --git a/src/constructs/providers/huaweicloud/css-snapshot/index.ts b/src/constructs/providers/huaweicloud/css-snapshot/index.ts new file mode 100644 index 00000000..01f81d54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-snapshot/index.ts @@ -0,0 +1,394 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssSnapshotConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#cluster_id CssSnapshot#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#description CssSnapshot#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#id CssSnapshot#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#index CssSnapshot#index} + */ + readonly index?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#name CssSnapshot#name} + */ + readonly name: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#timeouts CssSnapshot#timeouts} + */ + readonly timeouts?: CssSnapshotTimeouts; +} +export interface CssSnapshotTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#create CssSnapshot#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#delete CssSnapshot#delete} + */ + readonly delete?: string; +} + +export function cssSnapshotTimeoutsToTerraform(struct?: CssSnapshotTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function cssSnapshotTimeoutsToHclTerraform(struct?: CssSnapshotTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssSnapshotTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssSnapshotTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssSnapshotTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot huaweicloud_css_snapshot} +*/ +export class CssSnapshot extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_snapshot"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssSnapshot resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssSnapshot to import + * @param importFromId The id of the existing CssSnapshot that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssSnapshot to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_snapshot", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_snapshot huaweicloud_css_snapshot} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssSnapshotConfig + */ + public constructor(scope: Construct, id: string, config: CssSnapshotConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_snapshot', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._description = config.description; + this._id = config.id; + this._index = config.index; + this._name = config.name; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_type - computed: true, optional: false, required: false + public get backupType() { + return this.getStringAttribute('backup_type'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: true, optional: false, required: false + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // index - computed: true, optional: true, required: false + private _index?: string; + public get index() { + return this.getStringAttribute('index'); + } + public set index(value: string) { + this._index = value; + } + public resetIndex() { + this._index = undefined; + } + // Temporarily expose input value. Use with caution. + public get indexInput() { + return this._index; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssSnapshotTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssSnapshotTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + index: cdktf.stringToTerraform(this._index), + name: cdktf.stringToTerraform(this._name), + timeouts: cssSnapshotTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + index: { + value: cdktf.stringToHclTerraform(this._index), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssSnapshotTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssSnapshotTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/css-thesaurus/README.md b/src/constructs/providers/huaweicloud/css-thesaurus/README.md new file mode 100644 index 00000000..7ae6c10d --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-thesaurus/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_css_thesaurus` + +Refer to the Terraform Registry for docs: [`huaweicloud_css_thesaurus`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus). diff --git a/src/constructs/providers/huaweicloud/css-thesaurus/index.ts b/src/constructs/providers/huaweicloud/css-thesaurus/index.ts new file mode 100644 index 00000000..5d7004aa --- /dev/null +++ b/src/constructs/providers/huaweicloud/css-thesaurus/index.ts @@ -0,0 +1,478 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CssThesaurusConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#bucket_name CssThesaurus#bucket_name} + */ + readonly bucketName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#cluster_id CssThesaurus#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#id CssThesaurus#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#main_object CssThesaurus#main_object} + */ + readonly mainObject?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#region CssThesaurus#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#stop_object CssThesaurus#stop_object} + */ + readonly stopObject?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#synonym_object CssThesaurus#synonym_object} + */ + readonly synonymObject?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#timeouts CssThesaurus#timeouts} + */ + readonly timeouts?: CssThesaurusTimeouts; +} +export interface CssThesaurusTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#create CssThesaurus#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#delete CssThesaurus#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#update CssThesaurus#update} + */ + readonly update?: string; +} + +export function cssThesaurusTimeoutsToTerraform(struct?: CssThesaurusTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function cssThesaurusTimeoutsToHclTerraform(struct?: CssThesaurusTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CssThesaurusTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CssThesaurusTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CssThesaurusTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus huaweicloud_css_thesaurus} +*/ +export class CssThesaurus extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_thesaurus"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CssThesaurus resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CssThesaurus to import + * @param importFromId The id of the existing CssThesaurus that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CssThesaurus to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_thesaurus", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/css_thesaurus huaweicloud_css_thesaurus} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CssThesaurusConfig + */ + public constructor(scope: Construct, id: string, config: CssThesaurusConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_thesaurus', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._clusterId = config.clusterId; + this._id = config.id; + this._mainObject = config.mainObject; + this._region = config.region; + this._stopObject = config.stopObject; + this._synonymObject = config.synonymObject; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_name - computed: false, optional: false, required: true + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // main_object - computed: true, optional: true, required: false + private _mainObject?: string; + public get mainObject() { + return this.getStringAttribute('main_object'); + } + public set mainObject(value: string) { + this._mainObject = value; + } + public resetMainObject() { + this._mainObject = undefined; + } + // Temporarily expose input value. Use with caution. + public get mainObjectInput() { + return this._mainObject; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stop_object - computed: true, optional: true, required: false + private _stopObject?: string; + public get stopObject() { + return this.getStringAttribute('stop_object'); + } + public set stopObject(value: string) { + this._stopObject = value; + } + public resetStopObject() { + this._stopObject = undefined; + } + // Temporarily expose input value. Use with caution. + public get stopObjectInput() { + return this._stopObject; + } + + // synonym_object - computed: true, optional: true, required: false + private _synonymObject?: string; + public get synonymObject() { + return this.getStringAttribute('synonym_object'); + } + public set synonymObject(value: string) { + this._synonymObject = value; + } + public resetSynonymObject() { + this._synonymObject = undefined; + } + // Temporarily expose input value. Use with caution. + public get synonymObjectInput() { + return this._synonymObject; + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CssThesaurusTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CssThesaurusTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + main_object: cdktf.stringToTerraform(this._mainObject), + region: cdktf.stringToTerraform(this._region), + stop_object: cdktf.stringToTerraform(this._stopObject), + synonym_object: cdktf.stringToTerraform(this._synonymObject), + timeouts: cssThesaurusTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + main_object: { + value: cdktf.stringToHclTerraform(this._mainObject), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stop_object: { + value: cdktf.stringToHclTerraform(this._stopObject), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + synonym_object: { + value: cdktf.stringToHclTerraform(this._synonymObject), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: cssThesaurusTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CssThesaurusTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cts-data-tracker/README.md b/src/constructs/providers/huaweicloud/cts-data-tracker/README.md new file mode 100644 index 00000000..ebc12ea3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cts-data-tracker/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cts_data_tracker` + +Refer to the Terraform Registry for docs: [`huaweicloud_cts_data_tracker`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker). diff --git a/src/constructs/providers/huaweicloud/cts-data-tracker/index.ts b/src/constructs/providers/huaweicloud/cts-data-tracker/index.ts new file mode 100644 index 00000000..8f82e354 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cts-data-tracker/index.ts @@ -0,0 +1,651 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CtsDataTrackerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#bucket_name CtsDataTracker#bucket_name} + */ + readonly bucketName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#compress_type CtsDataTracker#compress_type} + */ + readonly compressType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#data_bucket CtsDataTracker#data_bucket} + */ + readonly dataBucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#data_operation CtsDataTracker#data_operation} + */ + readonly dataOperation?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#enabled CtsDataTracker#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#file_prefix CtsDataTracker#file_prefix} + */ + readonly filePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#id CtsDataTracker#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#is_sort_by_service CtsDataTracker#is_sort_by_service} + */ + readonly isSortByService?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#lts_enabled CtsDataTracker#lts_enabled} + */ + readonly ltsEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#name CtsDataTracker#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#obs_retention_period CtsDataTracker#obs_retention_period} + */ + readonly obsRetentionPeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#region CtsDataTracker#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#tags CtsDataTracker#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#validate_file CtsDataTracker#validate_file} + */ + readonly validateFile?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#timeouts CtsDataTracker#timeouts} + */ + readonly timeouts?: CtsDataTrackerTimeouts; +} +export interface CtsDataTrackerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#create CtsDataTracker#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#delete CtsDataTracker#delete} + */ + readonly delete?: string; +} + +export function ctsDataTrackerTimeoutsToTerraform(struct?: CtsDataTrackerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ctsDataTrackerTimeoutsToHclTerraform(struct?: CtsDataTrackerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CtsDataTrackerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CtsDataTrackerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CtsDataTrackerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker huaweicloud_cts_data_tracker} +*/ +export class CtsDataTracker extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_data_tracker"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CtsDataTracker resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CtsDataTracker to import + * @param importFromId The id of the existing CtsDataTracker that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CtsDataTracker to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_data_tracker", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_data_tracker huaweicloud_cts_data_tracker} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CtsDataTrackerConfig + */ + public constructor(scope: Construct, id: string, config: CtsDataTrackerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_data_tracker', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._compressType = config.compressType; + this._dataBucket = config.dataBucket; + this._dataOperation = config.dataOperation; + this._enabled = config.enabled; + this._filePrefix = config.filePrefix; + this._id = config.id; + this._isSortByService = config.isSortByService; + this._ltsEnabled = config.ltsEnabled; + this._name = config.name; + this._obsRetentionPeriod = config.obsRetentionPeriod; + this._region = config.region; + this._tags = config.tags; + this._validateFile = config.validateFile; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: true, optional: false, required: false + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + + // bucket_name - computed: false, optional: true, required: false + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + public resetBucketName() { + this._bucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // compress_type - computed: false, optional: true, required: false + private _compressType?: string; + public get compressType() { + return this.getStringAttribute('compress_type'); + } + public set compressType(value: string) { + this._compressType = value; + } + public resetCompressType() { + this._compressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressTypeInput() { + return this._compressType; + } + + // data_bucket - computed: false, optional: false, required: true + private _dataBucket?: string; + public get dataBucket() { + return this.getStringAttribute('data_bucket'); + } + public set dataBucket(value: string) { + this._dataBucket = value; + } + // Temporarily expose input value. Use with caution. + public get dataBucketInput() { + return this._dataBucket; + } + + // data_operation - computed: true, optional: true, required: false + private _dataOperation?: string[]; + public get dataOperation() { + return this.getListAttribute('data_operation'); + } + public set dataOperation(value: string[]) { + this._dataOperation = value; + } + public resetDataOperation() { + this._dataOperation = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataOperationInput() { + return this._dataOperation; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // file_prefix - computed: false, optional: true, required: false + private _filePrefix?: string; + public get filePrefix() { + return this.getStringAttribute('file_prefix'); + } + public set filePrefix(value: string) { + this._filePrefix = value; + } + public resetFilePrefix() { + this._filePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get filePrefixInput() { + return this._filePrefix; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_sort_by_service - computed: false, optional: true, required: false + private _isSortByService?: boolean | cdktf.IResolvable; + public get isSortByService() { + return this.getBooleanAttribute('is_sort_by_service'); + } + public set isSortByService(value: boolean | cdktf.IResolvable) { + this._isSortByService = value; + } + public resetIsSortByService() { + this._isSortByService = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSortByServiceInput() { + return this._isSortByService; + } + + // lts_enabled - computed: false, optional: true, required: false + private _ltsEnabled?: boolean | cdktf.IResolvable; + public get ltsEnabled() { + return this.getBooleanAttribute('lts_enabled'); + } + public set ltsEnabled(value: boolean | cdktf.IResolvable) { + this._ltsEnabled = value; + } + public resetLtsEnabled() { + this._ltsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsEnabledInput() { + return this._ltsEnabled; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // obs_retention_period - computed: false, optional: true, required: false + private _obsRetentionPeriod?: number; + public get obsRetentionPeriod() { + return this.getNumberAttribute('obs_retention_period'); + } + public set obsRetentionPeriod(value: number) { + this._obsRetentionPeriod = value; + } + public resetObsRetentionPeriod() { + this._obsRetentionPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsRetentionPeriodInput() { + return this._obsRetentionPeriod; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // transfer_enabled - computed: true, optional: false, required: false + public get transferEnabled() { + return this.getBooleanAttribute('transfer_enabled'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // validate_file - computed: false, optional: true, required: false + private _validateFile?: boolean | cdktf.IResolvable; + public get validateFile() { + return this.getBooleanAttribute('validate_file'); + } + public set validateFile(value: boolean | cdktf.IResolvable) { + this._validateFile = value; + } + public resetValidateFile() { + this._validateFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get validateFileInput() { + return this._validateFile; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CtsDataTrackerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CtsDataTrackerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + compress_type: cdktf.stringToTerraform(this._compressType), + data_bucket: cdktf.stringToTerraform(this._dataBucket), + data_operation: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dataOperation), + enabled: cdktf.booleanToTerraform(this._enabled), + file_prefix: cdktf.stringToTerraform(this._filePrefix), + id: cdktf.stringToTerraform(this._id), + is_sort_by_service: cdktf.booleanToTerraform(this._isSortByService), + lts_enabled: cdktf.booleanToTerraform(this._ltsEnabled), + name: cdktf.stringToTerraform(this._name), + obs_retention_period: cdktf.numberToTerraform(this._obsRetentionPeriod), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + validate_file: cdktf.booleanToTerraform(this._validateFile), + timeouts: ctsDataTrackerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + compress_type: { + value: cdktf.stringToHclTerraform(this._compressType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_bucket: { + value: cdktf.stringToHclTerraform(this._dataBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_operation: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dataOperation), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + file_prefix: { + value: cdktf.stringToHclTerraform(this._filePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_sort_by_service: { + value: cdktf.booleanToHclTerraform(this._isSortByService), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + lts_enabled: { + value: cdktf.booleanToHclTerraform(this._ltsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_retention_period: { + value: cdktf.numberToHclTerraform(this._obsRetentionPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + validate_file: { + value: cdktf.booleanToHclTerraform(this._validateFile), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: ctsDataTrackerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CtsDataTrackerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cts-notification/README.md b/src/constructs/providers/huaweicloud/cts-notification/README.md new file mode 100644 index 00000000..1c297452 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cts-notification/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cts_notification` + +Refer to the Terraform Registry for docs: [`huaweicloud_cts_notification`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification). diff --git a/src/constructs/providers/huaweicloud/cts-notification/index.ts b/src/constructs/providers/huaweicloud/cts-notification/index.ts new file mode 100644 index 00000000..be35354c --- /dev/null +++ b/src/constructs/providers/huaweicloud/cts-notification/index.ts @@ -0,0 +1,995 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CtsNotificationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#agency_name CtsNotification#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#enabled CtsNotification#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#id CtsNotification#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#name CtsNotification#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#operation_type CtsNotification#operation_type} + */ + readonly operationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#region CtsNotification#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#smn_topic CtsNotification#smn_topic} + */ + readonly smnTopic?: string; + /** + * filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#filter CtsNotification#filter} + */ + readonly filter?: CtsNotificationFilter; + /** + * operation_users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#operation_users CtsNotification#operation_users} + */ + readonly operationUsers?: CtsNotificationOperationUsers[] | cdktf.IResolvable; + /** + * operations block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#operations CtsNotification#operations} + */ + readonly operations?: CtsNotificationOperations[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#timeouts CtsNotification#timeouts} + */ + readonly timeouts?: CtsNotificationTimeouts; +} +export interface CtsNotificationFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#condition CtsNotification#condition} + */ + readonly condition: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#rule CtsNotification#rule} + */ + readonly rule: string[]; +} + +export function ctsNotificationFilterToTerraform(struct?: CtsNotificationFilterOutputReference | CtsNotificationFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + condition: cdktf.stringToTerraform(struct!.condition), + rule: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.rule), + } +} + + +export function ctsNotificationFilterToHclTerraform(struct?: CtsNotificationFilterOutputReference | CtsNotificationFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + condition: { + value: cdktf.stringToHclTerraform(struct!.condition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.rule), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CtsNotificationFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): CtsNotificationFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._condition !== undefined) { + hasAnyValues = true; + internalValueResult.condition = this._condition; + } + if (this._rule !== undefined) { + hasAnyValues = true; + internalValueResult.rule = this._rule; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CtsNotificationFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._condition = undefined; + this._rule = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._condition = value.condition; + this._rule = value.rule; + } + } + + // condition - computed: false, optional: false, required: true + private _condition?: string; + public get condition() { + return this.getStringAttribute('condition'); + } + public set condition(value: string) { + this._condition = value; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // rule - computed: false, optional: false, required: true + private _rule?: string[]; + public get rule() { + return this.getListAttribute('rule'); + } + public set rule(value: string[]) { + this._rule = value; + } + // Temporarily expose input value. Use with caution. + public get ruleInput() { + return this._rule; + } +} +export interface CtsNotificationOperationUsers { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#group CtsNotification#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#users CtsNotification#users} + */ + readonly users: string[]; +} + +export function ctsNotificationOperationUsersToTerraform(struct?: CtsNotificationOperationUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group: cdktf.stringToTerraform(struct!.group), + users: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.users), + } +} + + +export function ctsNotificationOperationUsersToHclTerraform(struct?: CtsNotificationOperationUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group: { + value: cdktf.stringToHclTerraform(struct!.group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.users), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CtsNotificationOperationUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CtsNotificationOperationUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._group !== undefined) { + hasAnyValues = true; + internalValueResult.group = this._group; + } + if (this._users !== undefined) { + hasAnyValues = true; + internalValueResult.users = this._users; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CtsNotificationOperationUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._group = undefined; + this._users = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._group = value.group; + this._users = value.users; + } + } + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // users - computed: false, optional: false, required: true + private _users?: string[]; + public get users() { + return this.getListAttribute('users'); + } + public set users(value: string[]) { + this._users = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users; + } +} + +export class CtsNotificationOperationUsersList extends cdktf.ComplexList { + public internalValue? : CtsNotificationOperationUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CtsNotificationOperationUsersOutputReference { + return new CtsNotificationOperationUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CtsNotificationOperations { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#resource CtsNotification#resource} + */ + readonly resource: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#service CtsNotification#service} + */ + readonly service: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#trace_names CtsNotification#trace_names} + */ + readonly traceNames: string[]; +} + +export function ctsNotificationOperationsToTerraform(struct?: CtsNotificationOperations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource: cdktf.stringToTerraform(struct!.resource), + service: cdktf.stringToTerraform(struct!.service), + trace_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.traceNames), + } +} + + +export function ctsNotificationOperationsToHclTerraform(struct?: CtsNotificationOperations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource: { + value: cdktf.stringToHclTerraform(struct!.resource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service: { + value: cdktf.stringToHclTerraform(struct!.service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trace_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.traceNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CtsNotificationOperationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): CtsNotificationOperations | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resource !== undefined) { + hasAnyValues = true; + internalValueResult.resource = this._resource; + } + if (this._service !== undefined) { + hasAnyValues = true; + internalValueResult.service = this._service; + } + if (this._traceNames !== undefined) { + hasAnyValues = true; + internalValueResult.traceNames = this._traceNames; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CtsNotificationOperations | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._resource = undefined; + this._service = undefined; + this._traceNames = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._resource = value.resource; + this._service = value.service; + this._traceNames = value.traceNames; + } + } + + // resource - computed: false, optional: false, required: true + private _resource?: string; + public get resource() { + return this.getStringAttribute('resource'); + } + public set resource(value: string) { + this._resource = value; + } + // Temporarily expose input value. Use with caution. + public get resourceInput() { + return this._resource; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } + + // trace_names - computed: false, optional: false, required: true + private _traceNames?: string[]; + public get traceNames() { + return this.getListAttribute('trace_names'); + } + public set traceNames(value: string[]) { + this._traceNames = value; + } + // Temporarily expose input value. Use with caution. + public get traceNamesInput() { + return this._traceNames; + } +} + +export class CtsNotificationOperationsList extends cdktf.ComplexList { + public internalValue? : CtsNotificationOperations[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): CtsNotificationOperationsOutputReference { + return new CtsNotificationOperationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface CtsNotificationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#create CtsNotification#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#delete CtsNotification#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#update CtsNotification#update} + */ + readonly update?: string; +} + +export function ctsNotificationTimeoutsToTerraform(struct?: CtsNotificationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ctsNotificationTimeoutsToHclTerraform(struct?: CtsNotificationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CtsNotificationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CtsNotificationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CtsNotificationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification huaweicloud_cts_notification} +*/ +export class CtsNotification extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_notification"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CtsNotification resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CtsNotification to import + * @param importFromId The id of the existing CtsNotification that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CtsNotification to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_notification", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_notification huaweicloud_cts_notification} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CtsNotificationConfig + */ + public constructor(scope: Construct, id: string, config: CtsNotificationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_notification', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._operationType = config.operationType; + this._region = config.region; + this._smnTopic = config.smnTopic; + this._filter.internalValue = config.filter; + this._operationUsers.internalValue = config.operationUsers; + this._operations.internalValue = config.operations; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_id - computed: true, optional: false, required: false + public get notificationId() { + return this.getStringAttribute('notification_id'); + } + + // operation_type - computed: false, optional: false, required: true + private _operationType?: string; + public get operationType() { + return this.getStringAttribute('operation_type'); + } + public set operationType(value: string) { + this._operationType = value; + } + // Temporarily expose input value. Use with caution. + public get operationTypeInput() { + return this._operationType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // smn_topic - computed: false, optional: true, required: false + private _smnTopic?: string; + public get smnTopic() { + return this.getStringAttribute('smn_topic'); + } + public set smnTopic(value: string) { + this._smnTopic = value; + } + public resetSmnTopic() { + this._smnTopic = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnTopicInput() { + return this._smnTopic; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // filter - computed: false, optional: true, required: false + private _filter = new CtsNotificationFilterOutputReference(this, "filter"); + public get filter() { + return this._filter; + } + public putFilter(value: CtsNotificationFilter) { + this._filter.internalValue = value; + } + public resetFilter() { + this._filter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter.internalValue; + } + + // operation_users - computed: false, optional: true, required: false + private _operationUsers = new CtsNotificationOperationUsersList(this, "operation_users", false); + public get operationUsers() { + return this._operationUsers; + } + public putOperationUsers(value: CtsNotificationOperationUsers[] | cdktf.IResolvable) { + this._operationUsers.internalValue = value; + } + public resetOperationUsers() { + this._operationUsers.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationUsersInput() { + return this._operationUsers.internalValue; + } + + // operations - computed: false, optional: true, required: false + private _operations = new CtsNotificationOperationsList(this, "operations", false); + public get operations() { + return this._operations; + } + public putOperations(value: CtsNotificationOperations[] | cdktf.IResolvable) { + this._operations.internalValue = value; + } + public resetOperations() { + this._operations.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationsInput() { + return this._operations.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CtsNotificationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CtsNotificationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + operation_type: cdktf.stringToTerraform(this._operationType), + region: cdktf.stringToTerraform(this._region), + smn_topic: cdktf.stringToTerraform(this._smnTopic), + filter: ctsNotificationFilterToTerraform(this._filter.internalValue), + operation_users: cdktf.listMapper(ctsNotificationOperationUsersToTerraform, true)(this._operationUsers.internalValue), + operations: cdktf.listMapper(ctsNotificationOperationsToTerraform, true)(this._operations.internalValue), + timeouts: ctsNotificationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation_type: { + value: cdktf.stringToHclTerraform(this._operationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + smn_topic: { + value: cdktf.stringToHclTerraform(this._smnTopic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter: { + value: ctsNotificationFilterToHclTerraform(this._filter.internalValue), + isBlock: true, + type: "list", + storageClassType: "CtsNotificationFilterList", + }, + operation_users: { + value: cdktf.listMapperHcl(ctsNotificationOperationUsersToHclTerraform, true)(this._operationUsers.internalValue), + isBlock: true, + type: "list", + storageClassType: "CtsNotificationOperationUsersList", + }, + operations: { + value: cdktf.listMapperHcl(ctsNotificationOperationsToHclTerraform, true)(this._operations.internalValue), + isBlock: true, + type: "list", + storageClassType: "CtsNotificationOperationsList", + }, + timeouts: { + value: ctsNotificationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CtsNotificationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/cts-tracker/README.md b/src/constructs/providers/huaweicloud/cts-tracker/README.md new file mode 100644 index 00000000..4c227520 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cts-tracker/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_cts_tracker` + +Refer to the Terraform Registry for docs: [`huaweicloud_cts_tracker`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker). diff --git a/src/constructs/providers/huaweicloud/cts-tracker/index.ts b/src/constructs/providers/huaweicloud/cts-tracker/index.ts new file mode 100644 index 00000000..5d2f77a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/cts-tracker/index.ts @@ -0,0 +1,662 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface CtsTrackerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#bucket_name CtsTracker#bucket_name} + */ + readonly bucketName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#compress_type CtsTracker#compress_type} + */ + readonly compressType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#delete_tracker CtsTracker#delete_tracker} + */ + readonly deleteTracker?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#enabled CtsTracker#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#exclude_service CtsTracker#exclude_service} + */ + readonly excludeService?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#file_prefix CtsTracker#file_prefix} + */ + readonly filePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#id CtsTracker#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#is_sort_by_service CtsTracker#is_sort_by_service} + */ + readonly isSortByService?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#kms_id CtsTracker#kms_id} + */ + readonly kmsId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#lts_enabled CtsTracker#lts_enabled} + */ + readonly ltsEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#organization_enabled CtsTracker#organization_enabled} + */ + readonly organizationEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#region CtsTracker#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#tags CtsTracker#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#validate_file CtsTracker#validate_file} + */ + readonly validateFile?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#timeouts CtsTracker#timeouts} + */ + readonly timeouts?: CtsTrackerTimeouts; +} +export interface CtsTrackerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#create CtsTracker#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#delete CtsTracker#delete} + */ + readonly delete?: string; +} + +export function ctsTrackerTimeoutsToTerraform(struct?: CtsTrackerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ctsTrackerTimeoutsToHclTerraform(struct?: CtsTrackerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class CtsTrackerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): CtsTrackerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: CtsTrackerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker huaweicloud_cts_tracker} +*/ +export class CtsTracker extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_tracker"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a CtsTracker resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the CtsTracker to import + * @param importFromId The id of the existing CtsTracker that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the CtsTracker to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_tracker", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/cts_tracker huaweicloud_cts_tracker} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options CtsTrackerConfig = {} + */ + public constructor(scope: Construct, id: string, config: CtsTrackerConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_tracker', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._compressType = config.compressType; + this._deleteTracker = config.deleteTracker; + this._enabled = config.enabled; + this._excludeService = config.excludeService; + this._filePrefix = config.filePrefix; + this._id = config.id; + this._isSortByService = config.isSortByService; + this._kmsId = config.kmsId; + this._ltsEnabled = config.ltsEnabled; + this._organizationEnabled = config.organizationEnabled; + this._region = config.region; + this._tags = config.tags; + this._validateFile = config.validateFile; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: true, optional: false, required: false + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + + // bucket_name - computed: false, optional: true, required: false + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + public resetBucketName() { + this._bucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // compress_type - computed: false, optional: true, required: false + private _compressType?: string; + public get compressType() { + return this.getStringAttribute('compress_type'); + } + public set compressType(value: string) { + this._compressType = value; + } + public resetCompressType() { + this._compressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressTypeInput() { + return this._compressType; + } + + // delete_tracker - computed: false, optional: true, required: false + private _deleteTracker?: boolean | cdktf.IResolvable; + public get deleteTracker() { + return this.getBooleanAttribute('delete_tracker'); + } + public set deleteTracker(value: boolean | cdktf.IResolvable) { + this._deleteTracker = value; + } + public resetDeleteTracker() { + this._deleteTracker = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteTrackerInput() { + return this._deleteTracker; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // exclude_service - computed: false, optional: true, required: false + private _excludeService?: string[]; + public get excludeService() { + return cdktf.Fn.tolist(this.getListAttribute('exclude_service')); + } + public set excludeService(value: string[]) { + this._excludeService = value; + } + public resetExcludeService() { + this._excludeService = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludeServiceInput() { + return this._excludeService; + } + + // file_prefix - computed: false, optional: true, required: false + private _filePrefix?: string; + public get filePrefix() { + return this.getStringAttribute('file_prefix'); + } + public set filePrefix(value: string) { + this._filePrefix = value; + } + public resetFilePrefix() { + this._filePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get filePrefixInput() { + return this._filePrefix; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_sort_by_service - computed: false, optional: true, required: false + private _isSortByService?: boolean | cdktf.IResolvable; + public get isSortByService() { + return this.getBooleanAttribute('is_sort_by_service'); + } + public set isSortByService(value: boolean | cdktf.IResolvable) { + this._isSortByService = value; + } + public resetIsSortByService() { + this._isSortByService = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSortByServiceInput() { + return this._isSortByService; + } + + // kms_id - computed: false, optional: true, required: false + private _kmsId?: string; + public get kmsId() { + return this.getStringAttribute('kms_id'); + } + public set kmsId(value: string) { + this._kmsId = value; + } + public resetKmsId() { + this._kmsId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsIdInput() { + return this._kmsId; + } + + // lts_enabled - computed: false, optional: true, required: false + private _ltsEnabled?: boolean | cdktf.IResolvable; + public get ltsEnabled() { + return this.getBooleanAttribute('lts_enabled'); + } + public set ltsEnabled(value: boolean | cdktf.IResolvable) { + this._ltsEnabled = value; + } + public resetLtsEnabled() { + this._ltsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsEnabledInput() { + return this._ltsEnabled; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // organization_enabled - computed: true, optional: true, required: false + private _organizationEnabled?: boolean | cdktf.IResolvable; + public get organizationEnabled() { + return this.getBooleanAttribute('organization_enabled'); + } + public set organizationEnabled(value: boolean | cdktf.IResolvable) { + this._organizationEnabled = value; + } + public resetOrganizationEnabled() { + this._organizationEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationEnabledInput() { + return this._organizationEnabled; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // transfer_enabled - computed: true, optional: false, required: false + public get transferEnabled() { + return this.getBooleanAttribute('transfer_enabled'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // validate_file - computed: false, optional: true, required: false + private _validateFile?: boolean | cdktf.IResolvable; + public get validateFile() { + return this.getBooleanAttribute('validate_file'); + } + public set validateFile(value: boolean | cdktf.IResolvable) { + this._validateFile = value; + } + public resetValidateFile() { + this._validateFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get validateFileInput() { + return this._validateFile; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new CtsTrackerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: CtsTrackerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + compress_type: cdktf.stringToTerraform(this._compressType), + delete_tracker: cdktf.booleanToTerraform(this._deleteTracker), + enabled: cdktf.booleanToTerraform(this._enabled), + exclude_service: cdktf.listMapper(cdktf.stringToTerraform, false)(this._excludeService), + file_prefix: cdktf.stringToTerraform(this._filePrefix), + id: cdktf.stringToTerraform(this._id), + is_sort_by_service: cdktf.booleanToTerraform(this._isSortByService), + kms_id: cdktf.stringToTerraform(this._kmsId), + lts_enabled: cdktf.booleanToTerraform(this._ltsEnabled), + organization_enabled: cdktf.booleanToTerraform(this._organizationEnabled), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + validate_file: cdktf.booleanToTerraform(this._validateFile), + timeouts: ctsTrackerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + compress_type: { + value: cdktf.stringToHclTerraform(this._compressType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_tracker: { + value: cdktf.booleanToHclTerraform(this._deleteTracker), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + exclude_service: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._excludeService), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + file_prefix: { + value: cdktf.stringToHclTerraform(this._filePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_sort_by_service: { + value: cdktf.booleanToHclTerraform(this._isSortByService), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kms_id: { + value: cdktf.stringToHclTerraform(this._kmsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_enabled: { + value: cdktf.booleanToHclTerraform(this._ltsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + organization_enabled: { + value: cdktf.booleanToHclTerraform(this._organizationEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + validate_file: { + value: cdktf.booleanToHclTerraform(this._validateFile), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: ctsTrackerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "CtsTrackerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-account/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-account/README.md new file mode 100644 index 00000000..4f16177a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-account/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_account` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/account). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-account/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-account/index.ts new file mode 100644 index 00000000..80851a7c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-account/index.ts @@ -0,0 +1,121 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/account#id DataHuaweicloudAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/account huaweicloud_account} +*/ +export class DataHuaweicloudAccount extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAccount to import + * @param importFromId The id of the existing DataHuaweicloudAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/account huaweicloud_account} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAccountConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAccountConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/README.md new file mode 100644 index 00000000..90b0f4c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_antiddos_config_ranges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_antiddos_config_ranges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/index.ts new file mode 100644 index 00000000..dfe526f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-config-ranges/index.ts @@ -0,0 +1,520 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAntiddosConfigRangesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges#id DataHuaweicloudAntiddosConfigRanges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges#region DataHuaweicloudAntiddosConfigRanges#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStruct { +} + +export function dataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructToTerraform(struct?: DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructToHclTerraform(struct?: DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cleaning_access_pos_id - computed: true, optional: false, required: false + public get cleaningAccessPosId() { + return this.getNumberAttribute('cleaning_access_pos_id'); + } + + // new_connection_limited - computed: true, optional: false, required: false + public get newConnectionLimited() { + return this.getNumberAttribute('new_connection_limited'); + } + + // total_connection_limited - computed: true, optional: false, required: false + public get totalConnectionLimited() { + return this.getNumberAttribute('total_connection_limited'); + } +} + +export class DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructOutputReference { + return new DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAntiddosConfigRangesExtendDdosConfig { +} + +export function dataHuaweicloudAntiddosConfigRangesExtendDdosConfigToTerraform(struct?: DataHuaweicloudAntiddosConfigRangesExtendDdosConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosConfigRangesExtendDdosConfigToHclTerraform(struct?: DataHuaweicloudAntiddosConfigRangesExtendDdosConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosConfigRangesExtendDdosConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosConfigRangesExtendDdosConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosConfigRangesExtendDdosConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // http_packet_per_second - computed: true, optional: false, required: false + public get httpPacketPerSecond() { + return this.getNumberAttribute('http_packet_per_second'); + } + + // new_connection_limited - computed: true, optional: false, required: false + public get newConnectionLimited() { + return this.getNumberAttribute('new_connection_limited'); + } + + // packet_per_second - computed: true, optional: false, required: false + public get packetPerSecond() { + return this.getNumberAttribute('packet_per_second'); + } + + // set_id - computed: true, optional: false, required: false + public get setId() { + return this.getNumberAttribute('set_id'); + } + + // total_connection_limited - computed: true, optional: false, required: false + public get totalConnectionLimited() { + return this.getNumberAttribute('total_connection_limited'); + } + + // traffic_per_second - computed: true, optional: false, required: false + public get trafficPerSecond() { + return this.getNumberAttribute('traffic_per_second'); + } +} + +export class DataHuaweicloudAntiddosConfigRangesExtendDdosConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosConfigRangesExtendDdosConfigOutputReference { + return new DataHuaweicloudAntiddosConfigRangesExtendDdosConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAntiddosConfigRangesHttpLimitedListStruct { +} + +export function dataHuaweicloudAntiddosConfigRangesHttpLimitedListStructToTerraform(struct?: DataHuaweicloudAntiddosConfigRangesHttpLimitedListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosConfigRangesHttpLimitedListStructToHclTerraform(struct?: DataHuaweicloudAntiddosConfigRangesHttpLimitedListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosConfigRangesHttpLimitedListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosConfigRangesHttpLimitedListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosConfigRangesHttpLimitedListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // http_packet_per_second - computed: true, optional: false, required: false + public get httpPacketPerSecond() { + return this.getNumberAttribute('http_packet_per_second'); + } + + // http_request_pos_id - computed: true, optional: false, required: false + public get httpRequestPosId() { + return this.getNumberAttribute('http_request_pos_id'); + } +} + +export class DataHuaweicloudAntiddosConfigRangesHttpLimitedListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosConfigRangesHttpLimitedListStructOutputReference { + return new DataHuaweicloudAntiddosConfigRangesHttpLimitedListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStruct { +} + +export function dataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructToTerraform(struct?: DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructToHclTerraform(struct?: DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // packet_per_second - computed: true, optional: false, required: false + public get packetPerSecond() { + return this.getNumberAttribute('packet_per_second'); + } + + // traffic_per_second - computed: true, optional: false, required: false + public get trafficPerSecond() { + return this.getNumberAttribute('traffic_per_second'); + } + + // traffic_pos_id - computed: true, optional: false, required: false + public get trafficPosId() { + return this.getNumberAttribute('traffic_pos_id'); + } +} + +export class DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructOutputReference { + return new DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges huaweicloud_antiddos_config_ranges} +*/ +export class DataHuaweicloudAntiddosConfigRanges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos_config_ranges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAntiddosConfigRanges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAntiddosConfigRanges to import + * @param importFromId The id of the existing DataHuaweicloudAntiddosConfigRanges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAntiddosConfigRanges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos_config_ranges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_config_ranges huaweicloud_antiddos_config_ranges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAntiddosConfigRangesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAntiddosConfigRangesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos_config_ranges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_limited_list - computed: true, optional: false, required: false + private _connectionLimitedList = new DataHuaweicloudAntiddosConfigRangesConnectionLimitedListStructList(this, "connection_limited_list", false); + public get connectionLimitedList() { + return this._connectionLimitedList; + } + + // extend_ddos_config - computed: true, optional: false, required: false + private _extendDdosConfig = new DataHuaweicloudAntiddosConfigRangesExtendDdosConfigList(this, "extend_ddos_config", false); + public get extendDdosConfig() { + return this._extendDdosConfig; + } + + // http_limited_list - computed: true, optional: false, required: false + private _httpLimitedList = new DataHuaweicloudAntiddosConfigRangesHttpLimitedListStructList(this, "http_limited_list", false); + public get httpLimitedList() { + return this._httpLimitedList; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // traffic_limited_list - computed: true, optional: false, required: false + private _trafficLimitedList = new DataHuaweicloudAntiddosConfigRangesTrafficLimitedListStructList(this, "traffic_limited_list", false); + public get trafficLimitedList() { + return this._trafficLimitedList; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/README.md new file mode 100644 index 00000000..56d3e9bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_antiddos_eip_defense_statuses` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_antiddos_eip_defense_statuses`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/index.ts new file mode 100644 index 00000000..f13c3163 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-eip-defense-statuses/index.ts @@ -0,0 +1,322 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAntiddosEipDefenseStatusesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses#id DataHuaweicloudAntiddosEipDefenseStatuses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP address. Both IPv4 and IPv6 addresses are supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses#ip DataHuaweicloudAntiddosEipDefenseStatuses#ip} + */ + readonly ip?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses#region DataHuaweicloudAntiddosEipDefenseStatuses#region} + */ + readonly region?: string; + /** + * Specifies the defense status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses#status DataHuaweicloudAntiddosEipDefenseStatuses#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudAntiddosEipDefenseStatusesDdosStatus { +} + +export function dataHuaweicloudAntiddosEipDefenseStatusesDdosStatusToTerraform(struct?: DataHuaweicloudAntiddosEipDefenseStatusesDdosStatus): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosEipDefenseStatusesDdosStatusToHclTerraform(struct?: DataHuaweicloudAntiddosEipDefenseStatusesDdosStatus): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosEipDefenseStatusesDdosStatusOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosEipDefenseStatusesDdosStatus | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosEipDefenseStatusesDdosStatus | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // blackhole_endtime - computed: true, optional: false, required: false + public get blackholeEndtime() { + return this.getNumberAttribute('blackhole_endtime'); + } + + // eip_id - computed: true, optional: false, required: false + public get eipId() { + return this.getStringAttribute('eip_id'); + } + + // http_threshold - computed: true, optional: false, required: false + public get httpThreshold() { + return this.getNumberAttribute('http_threshold'); + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // protect_type - computed: true, optional: false, required: false + public get protectType() { + return this.getStringAttribute('protect_type'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_threshold - computed: true, optional: false, required: false + public get trafficThreshold() { + return this.getNumberAttribute('traffic_threshold'); + } +} + +export class DataHuaweicloudAntiddosEipDefenseStatusesDdosStatusList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosEipDefenseStatusesDdosStatusOutputReference { + return new DataHuaweicloudAntiddosEipDefenseStatusesDdosStatusOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses huaweicloud_antiddos_eip_defense_statuses} +*/ +export class DataHuaweicloudAntiddosEipDefenseStatuses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos_eip_defense_statuses"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAntiddosEipDefenseStatuses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAntiddosEipDefenseStatuses to import + * @param importFromId The id of the existing DataHuaweicloudAntiddosEipDefenseStatuses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAntiddosEipDefenseStatuses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos_eip_defense_statuses", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_eip_defense_statuses huaweicloud_antiddos_eip_defense_statuses} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAntiddosEipDefenseStatusesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAntiddosEipDefenseStatusesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos_eip_defense_statuses', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ip = config.ip; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // ddos_status - computed: true, optional: false, required: false + private _ddosStatus = new DataHuaweicloudAntiddosEipDefenseStatusesDdosStatusList(this, "ddos_status", false); + public get ddosStatus() { + return this._ddosStatus; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip - computed: false, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip: cdktf.stringToTerraform(this._ip), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(this._ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/README.md new file mode 100644 index 00000000..8aa2220d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_antiddos_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_antiddos_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/index.ts new file mode 100644 index 00000000..d4124ac0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-v1/index.ts @@ -0,0 +1,298 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAntiddosV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1#floating_ip_address DataHuaweicloudAntiddosV1#floating_ip_address} + */ + readonly floatingIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1#floating_ip_id DataHuaweicloudAntiddosV1#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1#id DataHuaweicloudAntiddosV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1#region DataHuaweicloudAntiddosV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1#status DataHuaweicloudAntiddosV1#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1 huaweicloud_antiddos_v1} +*/ +export class DataHuaweicloudAntiddosV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAntiddosV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAntiddosV1 to import + * @param importFromId The id of the existing DataHuaweicloudAntiddosV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAntiddosV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_v1 huaweicloud_antiddos_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAntiddosV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAntiddosV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._floatingIpAddress = config.floatingIpAddress; + this._floatingIpId = config.floatingIpId; + this._id = config.id; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // bps_attack - computed: true, optional: false, required: false + public get bpsAttack() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('bps_attack'))); + } + + // bps_in - computed: true, optional: false, required: false + public get bpsIn() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('bps_in'))); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('end_time'))); + } + + // floating_ip_address - computed: true, optional: true, required: false + private _floatingIpAddress?: string; + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + public set floatingIpAddress(value: string) { + this._floatingIpAddress = value; + } + public resetFloatingIpAddress() { + this._floatingIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpAddressInput() { + return this._floatingIpAddress; + } + + // floating_ip_id - computed: true, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // period_start - computed: true, optional: false, required: false + public get periodStart() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('period_start'))); + } + + // pps_attack - computed: true, optional: false, required: false + public get ppsAttack() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('pps_attack'))); + } + + // pps_in - computed: true, optional: false, required: false + public get ppsIn() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('pps_in'))); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('start_time'))); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // total_bps - computed: true, optional: false, required: false + public get totalBps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('total_bps'))); + } + + // total_pps - computed: true, optional: false, required: false + public get totalPps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('total_pps'))); + } + + // traffic_cleaning_status - computed: true, optional: false, required: false + public get trafficCleaningStatus() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('traffic_cleaning_status'))); + } + + // trigger_bps - computed: true, optional: false, required: false + public get triggerBps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('trigger_bps'))); + } + + // trigger_http_pps - computed: true, optional: false, required: false + public get triggerHttpPps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('trigger_http_pps'))); + } + + // trigger_pps - computed: true, optional: false, required: false + public get triggerPps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('trigger_pps'))); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + floating_ip_address: cdktf.stringToTerraform(this._floatingIpAddress), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + floating_ip_address: { + value: cdktf.stringToHclTerraform(this._floatingIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/README.md new file mode 100644 index 00000000..cf74219b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_antiddos_weekly_protection_statistics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_antiddos_weekly_protection_statistics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/index.ts new file mode 100644 index 00000000..e98882a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos-weekly-protection-statistics/index.ts @@ -0,0 +1,368 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAntiddosWeeklyProtectionStatisticsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics#id DataHuaweicloudAntiddosWeeklyProtectionStatistics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The start date of the seven-day period, the value is a timestamp in milliseconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics#period_start_date DataHuaweicloudAntiddosWeeklyProtectionStatistics#period_start_date} + */ + readonly periodStartDate?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics#region DataHuaweicloudAntiddosWeeklyProtectionStatistics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10 { +} + +export function dataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10ToTerraform(struct?: DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10ToHclTerraform(struct?: DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10OutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10 | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10 | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // times - computed: true, optional: false, required: false + public get times() { + return this.getNumberAttribute('times'); + } +} + +export class DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10List extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10OutputReference { + return new DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10OutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdata { +} + +export function dataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataToTerraform(struct?: DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataToHclTerraform(struct?: DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ddos_blackhole_times - computed: true, optional: false, required: false + public get ddosBlackholeTimes() { + return this.getNumberAttribute('ddos_blackhole_times'); + } + + // ddos_intercept_times - computed: true, optional: false, required: false + public get ddosInterceptTimes() { + return this.getNumberAttribute('ddos_intercept_times'); + } + + // max_attack_bps - computed: true, optional: false, required: false + public get maxAttackBps() { + return this.getNumberAttribute('max_attack_bps'); + } + + // max_attack_conns - computed: true, optional: false, required: false + public get maxAttackConns() { + return this.getNumberAttribute('max_attack_conns'); + } + + // period_start_date - computed: true, optional: false, required: false + public get periodStartDate() { + return this.getNumberAttribute('period_start_date'); + } +} + +export class DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataOutputReference { + return new DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics huaweicloud_antiddos_weekly_protection_statistics} +*/ +export class DataHuaweicloudAntiddosWeeklyProtectionStatistics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos_weekly_protection_statistics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAntiddosWeeklyProtectionStatistics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAntiddosWeeklyProtectionStatistics to import + * @param importFromId The id of the existing DataHuaweicloudAntiddosWeeklyProtectionStatistics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAntiddosWeeklyProtectionStatistics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos_weekly_protection_statistics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos_weekly_protection_statistics huaweicloud_antiddos_weekly_protection_statistics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAntiddosWeeklyProtectionStatisticsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAntiddosWeeklyProtectionStatisticsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos_weekly_protection_statistics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._periodStartDate = config.periodStartDate; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // ddos_intercept_times - computed: true, optional: false, required: false + public get ddosInterceptTimes() { + return this.getNumberAttribute('ddos_intercept_times'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // period_start_date - computed: false, optional: true, required: false + private _periodStartDate?: string; + public get periodStartDate() { + return this.getStringAttribute('period_start_date'); + } + public set periodStartDate(value: string) { + this._periodStartDate = value; + } + public resetPeriodStartDate() { + this._periodStartDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodStartDateInput() { + return this._periodStartDate; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // top10 - computed: true, optional: false, required: false + private _top10 = new DataHuaweicloudAntiddosWeeklyProtectionStatisticsTop10List(this, "top10", false); + public get top10() { + return this._top10; + } + + // weekdata - computed: true, optional: false, required: false + private _weekdata = new DataHuaweicloudAntiddosWeeklyProtectionStatisticsWeekdataList(this, "weekdata", false); + public get weekdata() { + return this._weekdata; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + period_start_date: cdktf.stringToTerraform(this._periodStartDate), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period_start_date: { + value: cdktf.stringToHclTerraform(this._periodStartDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/README.md new file mode 100644 index 00000000..fabe8fdb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_antiddos` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_antiddos`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/index.ts new file mode 100644 index 00000000..826f5649 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-antiddos/index.ts @@ -0,0 +1,298 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAntiddosConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos#floating_ip_address DataHuaweicloudAntiddos#floating_ip_address} + */ + readonly floatingIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos#floating_ip_id DataHuaweicloudAntiddos#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos#id DataHuaweicloudAntiddos#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos#region DataHuaweicloudAntiddos#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos#status DataHuaweicloudAntiddos#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos huaweicloud_antiddos} +*/ +export class DataHuaweicloudAntiddos extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_antiddos"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAntiddos resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAntiddos to import + * @param importFromId The id of the existing DataHuaweicloudAntiddos that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAntiddos to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_antiddos", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/antiddos huaweicloud_antiddos} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAntiddosConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAntiddosConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_antiddos', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._floatingIpAddress = config.floatingIpAddress; + this._floatingIpId = config.floatingIpId; + this._id = config.id; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // bps_attack - computed: true, optional: false, required: false + public get bpsAttack() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('bps_attack'))); + } + + // bps_in - computed: true, optional: false, required: false + public get bpsIn() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('bps_in'))); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('end_time'))); + } + + // floating_ip_address - computed: true, optional: true, required: false + private _floatingIpAddress?: string; + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + public set floatingIpAddress(value: string) { + this._floatingIpAddress = value; + } + public resetFloatingIpAddress() { + this._floatingIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpAddressInput() { + return this._floatingIpAddress; + } + + // floating_ip_id - computed: true, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // period_start - computed: true, optional: false, required: false + public get periodStart() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('period_start'))); + } + + // pps_attack - computed: true, optional: false, required: false + public get ppsAttack() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('pps_attack'))); + } + + // pps_in - computed: true, optional: false, required: false + public get ppsIn() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('pps_in'))); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('start_time'))); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // total_bps - computed: true, optional: false, required: false + public get totalBps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('total_bps'))); + } + + // total_pps - computed: true, optional: false, required: false + public get totalPps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('total_pps'))); + } + + // traffic_cleaning_status - computed: true, optional: false, required: false + public get trafficCleaningStatus() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('traffic_cleaning_status'))); + } + + // trigger_bps - computed: true, optional: false, required: false + public get triggerBps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('trigger_bps'))); + } + + // trigger_http_pps - computed: true, optional: false, required: false + public get triggerHttpPps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('trigger_http_pps'))); + } + + // trigger_pps - computed: true, optional: false, required: false + public get triggerPps() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('trigger_pps'))); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + floating_ip_address: cdktf.stringToTerraform(this._floatingIpAddress), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + floating_ip_address: { + value: cdktf.stringToHclTerraform(this._floatingIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/README.md new file mode 100644 index 00000000..d33d6af6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_aggregation_metrics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_aggregation_metrics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/index.ts new file mode 100644 index 00000000..eb3dd8a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-aggregation-metrics/index.ts @@ -0,0 +1,230 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomAggregationMetricsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics#id DataHuaweicloudAomAggregationMetrics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics#region DataHuaweicloudAomAggregationMetrics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomAggregationMetricsServiceMetrics { +} + +export function dataHuaweicloudAomAggregationMetricsServiceMetricsToTerraform(struct?: DataHuaweicloudAomAggregationMetricsServiceMetrics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAggregationMetricsServiceMetricsToHclTerraform(struct?: DataHuaweicloudAomAggregationMetricsServiceMetrics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAggregationMetricsServiceMetricsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAggregationMetricsServiceMetrics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAggregationMetricsServiceMetrics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // metrics - computed: true, optional: false, required: false + public get metrics() { + return this.getListAttribute('metrics'); + } + + // service - computed: true, optional: false, required: false + public get service() { + return this.getStringAttribute('service'); + } +} + +export class DataHuaweicloudAomAggregationMetricsServiceMetricsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAggregationMetricsServiceMetricsOutputReference { + return new DataHuaweicloudAomAggregationMetricsServiceMetricsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics huaweicloud_aom_aggregation_metrics} +*/ +export class DataHuaweicloudAomAggregationMetrics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_aggregation_metrics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomAggregationMetrics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomAggregationMetrics to import + * @param importFromId The id of the existing DataHuaweicloudAomAggregationMetrics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomAggregationMetrics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_aggregation_metrics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_aggregation_metrics huaweicloud_aom_aggregation_metrics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomAggregationMetricsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomAggregationMetricsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_aggregation_metrics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_metrics - computed: true, optional: false, required: false + private _serviceMetrics = new DataHuaweicloudAomAggregationMetricsServiceMetricsList(this, "service_metrics", false); + public get serviceMetrics() { + return this._serviceMetrics; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/README.md new file mode 100644 index 00000000..e5be7bb4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_alarm_action_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_alarm_action_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/index.ts new file mode 100644 index 00000000..51c8230f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-action-rules/index.ts @@ -0,0 +1,363 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomAlarmActionRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules#id DataHuaweicloudAomAlarmActionRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules#region DataHuaweicloudAomAlarmActionRules#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopics { +} + +export function dataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsToTerraform(struct?: DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsToHclTerraform(struct?: DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // push_policy - computed: true, optional: false, required: false + public get pushPolicy() { + return this.getNumberAttribute('push_policy'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsOutputReference { + return new DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmActionRulesActionRules { +} + +export function dataHuaweicloudAomAlarmActionRulesActionRulesToTerraform(struct?: DataHuaweicloudAomAlarmActionRulesActionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmActionRulesActionRulesToHclTerraform(struct?: DataHuaweicloudAomAlarmActionRulesActionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmActionRulesActionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmActionRulesActionRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmActionRulesActionRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // notification_template - computed: true, optional: false, required: false + public get notificationTemplate() { + return this.getStringAttribute('notification_template'); + } + + // smn_topics - computed: true, optional: false, required: false + private _smnTopics = new DataHuaweicloudAomAlarmActionRulesActionRulesSmnTopicsList(this, "smn_topics", false); + public get smnTopics() { + return this._smnTopics; + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomAlarmActionRulesActionRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmActionRulesActionRulesOutputReference { + return new DataHuaweicloudAomAlarmActionRulesActionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules huaweicloud_aom_alarm_action_rules} +*/ +export class DataHuaweicloudAomAlarmActionRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_action_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomAlarmActionRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomAlarmActionRules to import + * @param importFromId The id of the existing DataHuaweicloudAomAlarmActionRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomAlarmActionRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_action_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_action_rules huaweicloud_aom_alarm_action_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomAlarmActionRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomAlarmActionRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_action_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_rules - computed: true, optional: false, required: false + private _actionRules = new DataHuaweicloudAomAlarmActionRulesActionRulesList(this, "action_rules", false); + public get actionRules() { + return this._actionRules; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/README.md new file mode 100644 index 00000000..5e6a5a9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_alarm_group_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_alarm_group_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/index.ts new file mode 100644 index 00000000..972f3517 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-group-rules/index.ts @@ -0,0 +1,465 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomAlarmGroupRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules#enterprise_project_id DataHuaweicloudAomAlarmGroupRules#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules#id DataHuaweicloudAomAlarmGroupRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules#region DataHuaweicloudAomAlarmGroupRules#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomAlarmGroupRulesRulesDetailMatch { +} + +export function dataHuaweicloudAomAlarmGroupRulesRulesDetailMatchToTerraform(struct?: DataHuaweicloudAomAlarmGroupRulesRulesDetailMatch): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmGroupRulesRulesDetailMatchToHclTerraform(struct?: DataHuaweicloudAomAlarmGroupRulesRulesDetailMatch): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmGroupRulesRulesDetailMatchOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmGroupRulesRulesDetailMatch | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmGroupRulesRulesDetailMatch | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // operate - computed: true, optional: false, required: false + public get operate() { + return this.getStringAttribute('operate'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getListAttribute('value'); + } +} + +export class DataHuaweicloudAomAlarmGroupRulesRulesDetailMatchList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmGroupRulesRulesDetailMatchOutputReference { + return new DataHuaweicloudAomAlarmGroupRulesRulesDetailMatchOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmGroupRulesRulesDetail { +} + +export function dataHuaweicloudAomAlarmGroupRulesRulesDetailToTerraform(struct?: DataHuaweicloudAomAlarmGroupRulesRulesDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmGroupRulesRulesDetailToHclTerraform(struct?: DataHuaweicloudAomAlarmGroupRulesRulesDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmGroupRulesRulesDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmGroupRulesRulesDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmGroupRulesRulesDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_notification_rule_ids - computed: true, optional: false, required: false + public get bindNotificationRuleIds() { + return this.getListAttribute('bind_notification_rule_ids'); + } + + // match - computed: true, optional: false, required: false + private _match = new DataHuaweicloudAomAlarmGroupRulesRulesDetailMatchList(this, "match", false); + public get match() { + return this._match; + } +} + +export class DataHuaweicloudAomAlarmGroupRulesRulesDetailList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmGroupRulesRulesDetailOutputReference { + return new DataHuaweicloudAomAlarmGroupRulesRulesDetailOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmGroupRulesRules { +} + +export function dataHuaweicloudAomAlarmGroupRulesRulesToTerraform(struct?: DataHuaweicloudAomAlarmGroupRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmGroupRulesRulesToHclTerraform(struct?: DataHuaweicloudAomAlarmGroupRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmGroupRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmGroupRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmGroupRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // detail - computed: true, optional: false, required: false + private _detail = new DataHuaweicloudAomAlarmGroupRulesRulesDetailList(this, "detail", false); + public get detail() { + return this._detail; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // group_by - computed: true, optional: false, required: false + public get groupBy() { + return this.getListAttribute('group_by'); + } + + // group_interval - computed: true, optional: false, required: false + public get groupInterval() { + return this.getNumberAttribute('group_interval'); + } + + // group_repeat_waiting - computed: true, optional: false, required: false + public get groupRepeatWaiting() { + return this.getNumberAttribute('group_repeat_waiting'); + } + + // group_wait - computed: true, optional: false, required: false + public get groupWait() { + return this.getNumberAttribute('group_wait'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomAlarmGroupRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmGroupRulesRulesOutputReference { + return new DataHuaweicloudAomAlarmGroupRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules huaweicloud_aom_alarm_group_rules} +*/ +export class DataHuaweicloudAomAlarmGroupRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_group_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomAlarmGroupRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomAlarmGroupRules to import + * @param importFromId The id of the existing DataHuaweicloudAomAlarmGroupRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomAlarmGroupRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_group_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_group_rules huaweicloud_aom_alarm_group_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomAlarmGroupRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomAlarmGroupRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_group_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudAomAlarmGroupRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/README.md new file mode 100644 index 00000000..6cfd8ba1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_alarm_rules_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_alarm_rules_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/index.ts new file mode 100644 index 00000000..e9d82949 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules-templates/index.ts @@ -0,0 +1,1526 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomAlarmRulesTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates#enterprise_project_id DataHuaweicloudAomAlarmRulesTemplates#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates#id DataHuaweicloudAomAlarmRulesTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates#region DataHuaweicloudAomAlarmRulesTemplates#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates#template_id DataHuaweicloudAomAlarmRulesTemplates#template_id} + */ + readonly templateId?: string; +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotification { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_notification_rule_id - computed: true, optional: false, required: false + public get bindNotificationRuleId() { + return this.getStringAttribute('bind_notification_rule_id'); + } + + // notification_enable - computed: true, optional: false, required: false + public get notificationEnable() { + return this.getBooleanAttribute('notification_enable'); + } + + // notification_type - computed: true, optional: false, required: false + public get notificationType() { + return this.getStringAttribute('notification_type'); + } + + // notify_frequency - computed: true, optional: false, required: false + public get notifyFrequency() { + return this.getStringAttribute('notify_frequency'); + } + + // notify_resolved - computed: true, optional: false, required: false + public get notifyResolved() { + return this.getBooleanAttribute('notify_resolved'); + } + + // notify_triggered - computed: true, optional: false, required: false + public get notifyTriggered() { + return this.getBooleanAttribute('notify_triggered'); + } + + // route_group_enable - computed: true, optional: false, required: false + public get routeGroupEnable() { + return this.getBooleanAttribute('route_group_enable'); + } + + // route_group_rule - computed: true, optional: false, required: false + public get routeGroupRule() { + return this.getStringAttribute('route_group_rule'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // aggregation_window - computed: true, optional: false, required: false + public get aggregationWindow() { + return this.getNumberAttribute('aggregation_window'); + } + + // event_name - computed: true, optional: false, required: false + public get eventName() { + return this.getStringAttribute('event_name'); + } + + // frequency - computed: true, optional: false, required: false + public get frequency() { + return this.getStringAttribute('frequency'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // thresholds - computed: true, optional: false, required: false + private _thresholds = new cdktf.NumberMap(this, "thresholds"); + public get thresholds() { + return this._thresholds; + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_source - computed: true, optional: false, required: false + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + + // alarm_subtype - computed: true, optional: false, required: false + public get alarmSubtype() { + return this.getStringAttribute('alarm_subtype'); + } + + // event_source - computed: true, optional: false, required: false + public get eventSource() { + return this.getStringAttribute('event_source'); + } + + // monitor_object_templates - computed: true, optional: false, required: false + public get monitorObjectTemplates() { + return this.getListAttribute('monitor_object_templates'); + } + + // monitor_objects - computed: true, optional: false, required: false + private _monitorObjects = new cdktf.StringMapList(this, "monitor_objects", false); + public get monitorObjects() { + return this._monitorObjects; + } + + // trigger_conditions - computed: true, optional: false, required: false + private _triggerConditions = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecTriggerConditionsList(this, "trigger_conditions", false); + public get triggerConditions() { + return this._triggerConditions; + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_tags - computed: true, optional: false, required: false + public get autoTags() { + return this.getListAttribute('auto_tags'); + } + + // custom_annotations - computed: true, optional: false, required: false + public get customAnnotations() { + return this.getListAttribute('custom_annotations'); + } + + // custom_tags - computed: true, optional: false, required: false + public get customTags() { + return this.getListAttribute('custom_tags'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // no_data_alert_state - computed: true, optional: false, required: false + public get noDataAlertState() { + return this.getStringAttribute('no_data_alert_state'); + } + + // no_data_timeframe - computed: true, optional: false, required: false + public get noDataTimeframe() { + return this.getNumberAttribute('no_data_timeframe'); + } + + // notify_no_data - computed: true, optional: false, required: false + public get notifyNoData() { + return this.getBooleanAttribute('notify_no_data'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // recovery_timeframe - computed: true, optional: false, required: false + public get recoveryTimeframe() { + return this.getNumberAttribute('recovery_timeframe'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // aggregate_type - computed: true, optional: false, required: false + public get aggregateType() { + return this.getStringAttribute('aggregate_type'); + } + + // aggregation_type - computed: true, optional: false, required: false + public get aggregationType() { + return this.getStringAttribute('aggregation_type'); + } + + // aggregation_window - computed: true, optional: false, required: false + public get aggregationWindow() { + return this.getStringAttribute('aggregation_window'); + } + + // aom_monitor_level - computed: true, optional: false, required: false + public get aomMonitorLevel() { + return this.getStringAttribute('aom_monitor_level'); + } + + // expression - computed: true, optional: false, required: false + public get expression() { + return this.getStringAttribute('expression'); + } + + // metric_labels - computed: true, optional: false, required: false + public get metricLabels() { + return this.getListAttribute('metric_labels'); + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } + + // metric_namespace - computed: true, optional: false, required: false + public get metricNamespace() { + return this.getStringAttribute('metric_namespace'); + } + + // metric_query_mode - computed: true, optional: false, required: false + public get metricQueryMode() { + return this.getStringAttribute('metric_query_mode'); + } + + // metric_statistic_method - computed: true, optional: false, required: false + public get metricStatisticMethod() { + return this.getStringAttribute('metric_statistic_method'); + } + + // metric_unit - computed: true, optional: false, required: false + public get metricUnit() { + return this.getStringAttribute('metric_unit'); + } + + // mix_promql - computed: true, optional: false, required: false + public get mixPromql() { + return this.getStringAttribute('mix_promql'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // promql - computed: true, optional: false, required: false + public get promql() { + return this.getStringAttribute('promql'); + } + + // promql_expr - computed: true, optional: false, required: false + public get promqlExpr() { + return this.getListAttribute('promql_expr'); + } + + // promql_for - computed: true, optional: false, required: false + public get promqlFor() { + return this.getStringAttribute('promql_for'); + } + + // query_match - computed: true, optional: false, required: false + public get queryMatch() { + return this.getStringAttribute('query_match'); + } + + // thresholds - computed: true, optional: false, required: false + private _thresholds = new cdktf.StringMap(this, "thresholds"); + public get thresholds() { + return this._thresholds; + } + + // trigger_interval - computed: true, optional: false, required: false + public get triggerInterval() { + return this.getStringAttribute('trigger_interval'); + } + + // trigger_times - computed: true, optional: false, required: false + public get triggerTimes() { + return this.getStringAttribute('trigger_times'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_source - computed: true, optional: false, required: false + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + + // alarm_subtype - computed: true, optional: false, required: false + public get alarmSubtype() { + return this.getStringAttribute('alarm_subtype'); + } + + // alarm_tags - computed: true, optional: false, required: false + private _alarmTags = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecAlarmTagsList(this, "alarm_tags", false); + public get alarmTags() { + return this._alarmTags; + } + + // monitor_type - computed: true, optional: false, required: false + public get monitorType() { + return this.getStringAttribute('monitor_type'); + } + + // no_data_conditions - computed: true, optional: false, required: false + private _noDataConditions = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecNoDataConditionsList(this, "no_data_conditions", false); + public get noDataConditions() { + return this._noDataConditions; + } + + // recovery_conditions - computed: true, optional: false, required: false + private _recoveryConditions = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecRecoveryConditionsList(this, "recovery_conditions", false); + public get recoveryConditions() { + return this._recoveryConditions; + } + + // trigger_conditions - computed: true, optional: false, required: false + private _triggerConditions = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecTriggerConditionsList(this, "trigger_conditions", false); + public get triggerConditions() { + return this._triggerConditions; + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItems { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItems): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItems): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItems | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItems | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_rule_description - computed: true, optional: false, required: false + public get alarmRuleDescription() { + return this.getStringAttribute('alarm_rule_description'); + } + + // alarm_rule_name - computed: true, optional: false, required: false + public get alarmRuleName() { + return this.getStringAttribute('alarm_rule_name'); + } + + // alarm_rule_type - computed: true, optional: false, required: false + public get alarmRuleType() { + return this.getStringAttribute('alarm_rule_type'); + } + + // event_alarm_spec - computed: true, optional: false, required: false + private _eventAlarmSpec = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsEventAlarmSpecList(this, "event_alarm_spec", false); + public get eventAlarmSpec() { + return this._eventAlarmSpec; + } + + // metric_alarm_spec - computed: true, optional: false, required: false + private _metricAlarmSpec = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsMetricAlarmSpecList(this, "metric_alarm_spec", false); + public get metricAlarmSpec() { + return this._metricAlarmSpec; + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStruct { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_notification - computed: true, optional: false, required: false + private _alarmNotification = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmNotificationList(this, "alarm_notification", false); + public get alarmNotification() { + return this._alarmNotification; + } + + // alarm_template_spec_items - computed: true, optional: false, required: false + private _alarmTemplateSpecItems = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListAlarmTemplateSpecItemsList(this, "alarm_template_spec_items", false); + public get alarmTemplateSpecItems() { + return this._alarmTemplateSpecItems; + } + + // related_cce_clusters - computed: true, optional: false, required: false + public get relatedCceClusters() { + return this.getListAttribute('related_cce_clusters'); + } + + // related_cloud_service - computed: true, optional: false, required: false + public get relatedCloudService() { + return this.getStringAttribute('related_cloud_service'); + } + + // related_prometheus_instances - computed: true, optional: false, required: false + public get relatedPrometheusInstances() { + return this.getListAttribute('related_prometheus_instances'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStruct { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // query - computed: true, optional: false, required: false + public get query() { + return this.getStringAttribute('query'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplating { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplating): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplating): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplating | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplating | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // list - computed: true, optional: false, required: false + private _list = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingListStructList(this, "list", false); + public get list() { + return this._list; + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesTemplatesTemplates { +} + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesToTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_template_spec_list - computed: true, optional: false, required: false + private _alarmTemplateSpecList = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesAlarmTemplateSpecListStructList(this, "alarm_template_spec_list", false); + public get alarmTemplateSpecList() { + return this._alarmTemplateSpecList; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // templating - computed: true, optional: false, required: false + private _templating = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesTemplatingList(this, "templating", false); + public get templating() { + return this._templating; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomAlarmRulesTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesTemplatesTemplatesOutputReference { + return new DataHuaweicloudAomAlarmRulesTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates huaweicloud_aom_alarm_rules_templates} +*/ +export class DataHuaweicloudAomAlarmRulesTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_rules_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomAlarmRulesTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomAlarmRulesTemplates to import + * @param importFromId The id of the existing DataHuaweicloudAomAlarmRulesTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomAlarmRulesTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_rules_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules_templates huaweicloud_aom_alarm_rules_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomAlarmRulesTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomAlarmRulesTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_rules_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + this._templateId = config.templateId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudAomAlarmRulesTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/README.md new file mode 100644 index 00000000..c0e31ae2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_alarm_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_alarm_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/index.ts new file mode 100644 index 00000000..00440678 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-rules/index.ts @@ -0,0 +1,1374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomAlarmRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#alarm_rule_name DataHuaweicloudAomAlarmRules#alarm_rule_name} + */ + readonly alarmRuleName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#alarm_rule_status DataHuaweicloudAomAlarmRules#alarm_rule_status} + */ + readonly alarmRuleStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#alarm_rule_type DataHuaweicloudAomAlarmRules#alarm_rule_type} + */ + readonly alarmRuleType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#bind_notification_rule_id DataHuaweicloudAomAlarmRules#bind_notification_rule_id} + */ + readonly bindNotificationRuleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#enterprise_project_id DataHuaweicloudAomAlarmRules#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#event_severity DataHuaweicloudAomAlarmRules#event_severity} + */ + readonly eventSeverity?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#event_source DataHuaweicloudAomAlarmRules#event_source} + */ + readonly eventSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#id DataHuaweicloudAomAlarmRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#prom_instance_id DataHuaweicloudAomAlarmRules#prom_instance_id} + */ + readonly promInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#region DataHuaweicloudAomAlarmRules#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#related_cce_clusters DataHuaweicloudAomAlarmRules#related_cce_clusters} + */ + readonly relatedCceClusters?: string; +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotifications { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_notification_rule_id - computed: true, optional: false, required: false + public get bindNotificationRuleId() { + return this.getStringAttribute('bind_notification_rule_id'); + } + + // notification_enable - computed: true, optional: false, required: false + public get notificationEnable() { + return this.getBooleanAttribute('notification_enable'); + } + + // notification_type - computed: true, optional: false, required: false + public get notificationType() { + return this.getStringAttribute('notification_type'); + } + + // notify_frequency - computed: true, optional: false, required: false + public get notifyFrequency() { + return this.getStringAttribute('notify_frequency'); + } + + // notify_resolved - computed: true, optional: false, required: false + public get notifyResolved() { + return this.getBooleanAttribute('notify_resolved'); + } + + // notify_triggered - computed: true, optional: false, required: false + public get notifyTriggered() { + return this.getBooleanAttribute('notify_triggered'); + } + + // route_group_enable - computed: true, optional: false, required: false + public get routeGroupEnable() { + return this.getBooleanAttribute('route_group_enable'); + } + + // route_group_rule - computed: true, optional: false, required: false + public get routeGroupRule() { + return this.getStringAttribute('route_group_rule'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditions { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // aggregation_window - computed: true, optional: false, required: false + public get aggregationWindow() { + return this.getNumberAttribute('aggregation_window'); + } + + // event_name - computed: true, optional: false, required: false + public get eventName() { + return this.getStringAttribute('event_name'); + } + + // frequency - computed: true, optional: false, required: false + public get frequency() { + return this.getStringAttribute('frequency'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // thresholds - computed: true, optional: false, required: false + private _thresholds = new cdktf.NumberMap(this, "thresholds"); + public get thresholds() { + return this._thresholds; + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpec { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_source - computed: true, optional: false, required: false + public get alarmSource() { + return this.getStringAttribute('alarm_source'); + } + + // event_source - computed: true, optional: false, required: false + public get eventSource() { + return this.getStringAttribute('event_source'); + } + + // monitor_objects - computed: true, optional: false, required: false + private _monitorObjects = new cdktf.StringMapList(this, "monitor_objects", false); + public get monitorObjects() { + return this._monitorObjects; + } + + // trigger_conditions - computed: true, optional: false, required: false + private _triggerConditions = new DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecTriggerConditionsList(this, "trigger_conditions", false); + public get triggerConditions() { + return this._triggerConditions; + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTags { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_tags - computed: true, optional: false, required: false + public get autoTags() { + return this.getListAttribute('auto_tags'); + } + + // custom_annotations - computed: true, optional: false, required: false + public get customAnnotations() { + return this.getListAttribute('custom_annotations'); + } + + // custom_tags - computed: true, optional: false, required: false + public get customTags() { + return this.getListAttribute('custom_tags'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditions { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // no_data_alert_state - computed: true, optional: false, required: false + public get noDataAlertState() { + return this.getStringAttribute('no_data_alert_state'); + } + + // no_data_timeframe - computed: true, optional: false, required: false + public get noDataTimeframe() { + return this.getNumberAttribute('no_data_timeframe'); + } + + // notify_no_data - computed: true, optional: false, required: false + public get notifyNoData() { + return this.getBooleanAttribute('notify_no_data'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditions { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // recovery_timeframe - computed: true, optional: false, required: false + public get recoveryTimeframe() { + return this.getNumberAttribute('recovery_timeframe'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditions { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // aggregate_type - computed: true, optional: false, required: false + public get aggregateType() { + return this.getStringAttribute('aggregate_type'); + } + + // aggregation_type - computed: true, optional: false, required: false + public get aggregationType() { + return this.getStringAttribute('aggregation_type'); + } + + // aggregation_window - computed: true, optional: false, required: false + public get aggregationWindow() { + return this.getStringAttribute('aggregation_window'); + } + + // aom_monitor_level - computed: true, optional: false, required: false + public get aomMonitorLevel() { + return this.getStringAttribute('aom_monitor_level'); + } + + // expression - computed: true, optional: false, required: false + public get expression() { + return this.getStringAttribute('expression'); + } + + // metric_labels - computed: true, optional: false, required: false + public get metricLabels() { + return this.getListAttribute('metric_labels'); + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } + + // metric_namespace - computed: true, optional: false, required: false + public get metricNamespace() { + return this.getStringAttribute('metric_namespace'); + } + + // metric_query_mode - computed: true, optional: false, required: false + public get metricQueryMode() { + return this.getStringAttribute('metric_query_mode'); + } + + // metric_statistic_method - computed: true, optional: false, required: false + public get metricStatisticMethod() { + return this.getStringAttribute('metric_statistic_method'); + } + + // metric_unit - computed: true, optional: false, required: false + public get metricUnit() { + return this.getStringAttribute('metric_unit'); + } + + // mix_promql - computed: true, optional: false, required: false + public get mixPromql() { + return this.getStringAttribute('mix_promql'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // promql - computed: true, optional: false, required: false + public get promql() { + return this.getStringAttribute('promql'); + } + + // promql_expr - computed: true, optional: false, required: false + public get promqlExpr() { + return cdktf.Fn.tolist(this.getListAttribute('promql_expr')); + } + + // promql_for - computed: true, optional: false, required: false + public get promqlFor() { + return this.getStringAttribute('promql_for'); + } + + // query_match - computed: true, optional: false, required: false + public get queryMatch() { + return this.getStringAttribute('query_match'); + } + + // query_param - computed: true, optional: false, required: false + public get queryParam() { + return this.getStringAttribute('query_param'); + } + + // thresholds - computed: true, optional: false, required: false + private _thresholds = new cdktf.StringMap(this, "thresholds"); + public get thresholds() { + return this._thresholds; + } + + // trigger_interval - computed: true, optional: false, required: false + public get triggerInterval() { + return this.getStringAttribute('trigger_interval'); + } + + // trigger_times - computed: true, optional: false, required: false + public get triggerTimes() { + return this.getStringAttribute('trigger_times'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpec { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_tags - computed: true, optional: false, required: false + private _alarmTags = new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecAlarmTagsList(this, "alarm_tags", false); + public get alarmTags() { + return this._alarmTags; + } + + // monitor_objects - computed: true, optional: false, required: false + private _monitorObjects = new cdktf.StringMapList(this, "monitor_objects", false); + public get monitorObjects() { + return this._monitorObjects; + } + + // monitor_type - computed: true, optional: false, required: false + public get monitorType() { + return this.getStringAttribute('monitor_type'); + } + + // no_data_conditions - computed: true, optional: false, required: false + private _noDataConditions = new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecNoDataConditionsList(this, "no_data_conditions", false); + public get noDataConditions() { + return this._noDataConditions; + } + + // recovery_conditions - computed: true, optional: false, required: false + private _recoveryConditions = new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecRecoveryConditionsList(this, "recovery_conditions", false); + public get recoveryConditions() { + return this._recoveryConditions; + } + + // trigger_conditions - computed: true, optional: false, required: false + private _triggerConditions = new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecTriggerConditionsList(this, "trigger_conditions", false); + public get triggerConditions() { + return this._triggerConditions; + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmRulesAlarmRules { +} + +export function dataHuaweicloudAomAlarmRulesAlarmRulesToTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmRulesAlarmRulesToHclTerraform(struct?: DataHuaweicloudAomAlarmRulesAlarmRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmRulesAlarmRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmRulesAlarmRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_notifications - computed: true, optional: false, required: false + private _alarmNotifications = new DataHuaweicloudAomAlarmRulesAlarmRulesAlarmNotificationsList(this, "alarm_notifications", false); + public get alarmNotifications() { + return this._alarmNotifications; + } + + // alarm_rule_id - computed: true, optional: false, required: false + public get alarmRuleId() { + return this.getStringAttribute('alarm_rule_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getBooleanAttribute('enable'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // event_alarm_spec - computed: true, optional: false, required: false + private _eventAlarmSpec = new DataHuaweicloudAomAlarmRulesAlarmRulesEventAlarmSpecList(this, "event_alarm_spec", false); + public get eventAlarmSpec() { + return this._eventAlarmSpec; + } + + // metric_alarm_spec - computed: true, optional: false, required: false + private _metricAlarmSpec = new DataHuaweicloudAomAlarmRulesAlarmRulesMetricAlarmSpecList(this, "metric_alarm_spec", false); + public get metricAlarmSpec() { + return this._metricAlarmSpec; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // prom_instance_id - computed: true, optional: false, required: false + public get promInstanceId() { + return this.getStringAttribute('prom_instance_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomAlarmRulesAlarmRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmRulesAlarmRulesOutputReference { + return new DataHuaweicloudAomAlarmRulesAlarmRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules huaweicloud_aom_alarm_rules} +*/ +export class DataHuaweicloudAomAlarmRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomAlarmRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomAlarmRules to import + * @param importFromId The id of the existing DataHuaweicloudAomAlarmRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomAlarmRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_rules huaweicloud_aom_alarm_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomAlarmRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomAlarmRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmRuleName = config.alarmRuleName; + this._alarmRuleStatus = config.alarmRuleStatus; + this._alarmRuleType = config.alarmRuleType; + this._bindNotificationRuleId = config.bindNotificationRuleId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._eventSeverity = config.eventSeverity; + this._eventSource = config.eventSource; + this._id = config.id; + this._promInstanceId = config.promInstanceId; + this._region = config.region; + this._relatedCceClusters = config.relatedCceClusters; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_rule_name - computed: false, optional: true, required: false + private _alarmRuleName?: string; + public get alarmRuleName() { + return this.getStringAttribute('alarm_rule_name'); + } + public set alarmRuleName(value: string) { + this._alarmRuleName = value; + } + public resetAlarmRuleName() { + this._alarmRuleName = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleNameInput() { + return this._alarmRuleName; + } + + // alarm_rule_status - computed: false, optional: true, required: false + private _alarmRuleStatus?: string; + public get alarmRuleStatus() { + return this.getStringAttribute('alarm_rule_status'); + } + public set alarmRuleStatus(value: string) { + this._alarmRuleStatus = value; + } + public resetAlarmRuleStatus() { + this._alarmRuleStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleStatusInput() { + return this._alarmRuleStatus; + } + + // alarm_rule_type - computed: false, optional: true, required: false + private _alarmRuleType?: string; + public get alarmRuleType() { + return this.getStringAttribute('alarm_rule_type'); + } + public set alarmRuleType(value: string) { + this._alarmRuleType = value; + } + public resetAlarmRuleType() { + this._alarmRuleType = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmRuleTypeInput() { + return this._alarmRuleType; + } + + // alarm_rules - computed: true, optional: false, required: false + private _alarmRules = new DataHuaweicloudAomAlarmRulesAlarmRulesList(this, "alarm_rules", false); + public get alarmRules() { + return this._alarmRules; + } + + // bind_notification_rule_id - computed: false, optional: true, required: false + private _bindNotificationRuleId?: string; + public get bindNotificationRuleId() { + return this.getStringAttribute('bind_notification_rule_id'); + } + public set bindNotificationRuleId(value: string) { + this._bindNotificationRuleId = value; + } + public resetBindNotificationRuleId() { + this._bindNotificationRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindNotificationRuleIdInput() { + return this._bindNotificationRuleId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // event_severity - computed: false, optional: true, required: false + private _eventSeverity?: string; + public get eventSeverity() { + return this.getStringAttribute('event_severity'); + } + public set eventSeverity(value: string) { + this._eventSeverity = value; + } + public resetEventSeverity() { + this._eventSeverity = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventSeverityInput() { + return this._eventSeverity; + } + + // event_source - computed: false, optional: true, required: false + private _eventSource?: string; + public get eventSource() { + return this.getStringAttribute('event_source'); + } + public set eventSource(value: string) { + this._eventSource = value; + } + public resetEventSource() { + this._eventSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventSourceInput() { + return this._eventSource; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // prom_instance_id - computed: false, optional: true, required: false + private _promInstanceId?: string; + public get promInstanceId() { + return this.getStringAttribute('prom_instance_id'); + } + public set promInstanceId(value: string) { + this._promInstanceId = value; + } + public resetPromInstanceId() { + this._promInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get promInstanceIdInput() { + return this._promInstanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // related_cce_clusters - computed: false, optional: true, required: false + private _relatedCceClusters?: string; + public get relatedCceClusters() { + return this.getStringAttribute('related_cce_clusters'); + } + public set relatedCceClusters(value: string) { + this._relatedCceClusters = value; + } + public resetRelatedCceClusters() { + this._relatedCceClusters = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedCceClustersInput() { + return this._relatedCceClusters; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_rule_name: cdktf.stringToTerraform(this._alarmRuleName), + alarm_rule_status: cdktf.stringToTerraform(this._alarmRuleStatus), + alarm_rule_type: cdktf.stringToTerraform(this._alarmRuleType), + bind_notification_rule_id: cdktf.stringToTerraform(this._bindNotificationRuleId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + event_severity: cdktf.stringToTerraform(this._eventSeverity), + event_source: cdktf.stringToTerraform(this._eventSource), + id: cdktf.stringToTerraform(this._id), + prom_instance_id: cdktf.stringToTerraform(this._promInstanceId), + region: cdktf.stringToTerraform(this._region), + related_cce_clusters: cdktf.stringToTerraform(this._relatedCceClusters), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_rule_name: { + value: cdktf.stringToHclTerraform(this._alarmRuleName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_status: { + value: cdktf.stringToHclTerraform(this._alarmRuleStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_rule_type: { + value: cdktf.stringToHclTerraform(this._alarmRuleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bind_notification_rule_id: { + value: cdktf.stringToHclTerraform(this._bindNotificationRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_severity: { + value: cdktf.stringToHclTerraform(this._eventSeverity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_source: { + value: cdktf.stringToHclTerraform(this._eventSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_instance_id: { + value: cdktf.stringToHclTerraform(this._promInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_cce_clusters: { + value: cdktf.stringToHclTerraform(this._relatedCceClusters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/README.md new file mode 100644 index 00000000..4ee64d86 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_alarm_silence_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_alarm_silence_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/index.ts new file mode 100644 index 00000000..aca0dd8c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-alarm-silence-rules/index.ts @@ -0,0 +1,508 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomAlarmSilenceRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules#id DataHuaweicloudAomAlarmSilenceRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules#region DataHuaweicloudAomAlarmSilenceRules#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditions { +} + +export function dataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsToTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // operate - computed: true, optional: false, required: false + public get operate() { + return this.getStringAttribute('operate'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getListAttribute('value'); + } +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsOutputReference { + return new DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditions { +} + +export function dataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsToTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsToHclTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsOutputReference { + return new DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTime { +} + +export function dataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeToTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTime): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeToHclTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTime): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTime | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTime | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ends_at - computed: true, optional: false, required: false + public get endsAt() { + return this.getNumberAttribute('ends_at'); + } + + // scope - computed: true, optional: false, required: false + public get scope() { + return this.getNumberListAttribute('scope'); + } + + // starts_at - computed: true, optional: false, required: false + public get startsAt() { + return this.getNumberAttribute('starts_at'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeOutputReference { + return new DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomAlarmSilenceRulesRules { +} + +export function dataHuaweicloudAomAlarmSilenceRulesRulesToTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomAlarmSilenceRulesRulesToHclTerraform(struct?: DataHuaweicloudAomAlarmSilenceRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomAlarmSilenceRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomAlarmSilenceRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // silence_conditions - computed: true, optional: false, required: false + private _silenceConditions = new DataHuaweicloudAomAlarmSilenceRulesRulesSilenceConditionsList(this, "silence_conditions", false); + public get silenceConditions() { + return this._silenceConditions; + } + + // silence_time - computed: true, optional: false, required: false + private _silenceTime = new DataHuaweicloudAomAlarmSilenceRulesRulesSilenceTimeList(this, "silence_time", false); + public get silenceTime() { + return this._silenceTime; + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomAlarmSilenceRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomAlarmSilenceRulesRulesOutputReference { + return new DataHuaweicloudAomAlarmSilenceRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules huaweicloud_aom_alarm_silence_rules} +*/ +export class DataHuaweicloudAomAlarmSilenceRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_alarm_silence_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomAlarmSilenceRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomAlarmSilenceRules to import + * @param importFromId The id of the existing DataHuaweicloudAomAlarmSilenceRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomAlarmSilenceRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_alarm_silence_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_alarm_silence_rules huaweicloud_aom_alarm_silence_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomAlarmSilenceRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomAlarmSilenceRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_alarm_silence_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudAomAlarmSilenceRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/README.md new file mode 100644 index 00000000..1d669d9e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_dashboards_folders` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_dashboards_folders`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/index.ts new file mode 100644 index 00000000..aa80f981 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards-folders/index.ts @@ -0,0 +1,298 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomDashboardsFoldersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders#enterprise_project_id DataHuaweicloudAomDashboardsFolders#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders#id DataHuaweicloudAomDashboardsFolders#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders#region DataHuaweicloudAomDashboardsFolders#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomDashboardsFoldersFolders { +} + +export function dataHuaweicloudAomDashboardsFoldersFoldersToTerraform(struct?: DataHuaweicloudAomDashboardsFoldersFolders): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomDashboardsFoldersFoldersToHclTerraform(struct?: DataHuaweicloudAomDashboardsFoldersFolders): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomDashboardsFoldersFoldersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomDashboardsFoldersFolders | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomDashboardsFoldersFolders | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // dashboard_ids - computed: true, optional: false, required: false + public get dashboardIds() { + return this.getListAttribute('dashboard_ids'); + } + + // display - computed: true, optional: false, required: false + public get display() { + return this.getBooleanAttribute('display'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // folder_title - computed: true, optional: false, required: false + public get folderTitle() { + return this.getStringAttribute('folder_title'); + } + + // folder_title_en - computed: true, optional: false, required: false + public get folderTitleEn() { + return this.getStringAttribute('folder_title_en'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_template - computed: true, optional: false, required: false + public get isTemplate() { + return this.getBooleanAttribute('is_template'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomDashboardsFoldersFoldersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomDashboardsFoldersFoldersOutputReference { + return new DataHuaweicloudAomDashboardsFoldersFoldersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders huaweicloud_aom_dashboards_folders} +*/ +export class DataHuaweicloudAomDashboardsFolders extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_dashboards_folders"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomDashboardsFolders resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomDashboardsFolders to import + * @param importFromId The id of the existing DataHuaweicloudAomDashboardsFolders that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomDashboardsFolders to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_dashboards_folders", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards_folders huaweicloud_aom_dashboards_folders} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomDashboardsFoldersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomDashboardsFoldersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_dashboards_folders', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // folders - computed: true, optional: false, required: false + private _folders = new DataHuaweicloudAomDashboardsFoldersFoldersList(this, "folders", false); + public get folders() { + return this._folders; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/README.md new file mode 100644 index 00000000..17dbb2c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_dashboards` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_dashboards`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/index.ts new file mode 100644 index 00000000..8e300e2a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-dashboards/index.ts @@ -0,0 +1,352 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomDashboardsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards#dashboard_type DataHuaweicloudAomDashboards#dashboard_type} + */ + readonly dashboardType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards#enterprise_project_id DataHuaweicloudAomDashboards#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards#id DataHuaweicloudAomDashboards#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards#region DataHuaweicloudAomDashboards#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomDashboardsDashboards { +} + +export function dataHuaweicloudAomDashboardsDashboardsToTerraform(struct?: DataHuaweicloudAomDashboardsDashboards): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomDashboardsDashboardsToHclTerraform(struct?: DataHuaweicloudAomDashboardsDashboards): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomDashboardsDashboardsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomDashboardsDashboards | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomDashboardsDashboards | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // dashboard_tags - computed: true, optional: false, required: false + private _dashboardTags = new cdktf.StringMapList(this, "dashboard_tags", false); + public get dashboardTags() { + return this._dashboardTags; + } + + // dashboard_title - computed: true, optional: false, required: false + public get dashboardTitle() { + return this.getStringAttribute('dashboard_title'); + } + + // dashboard_title_en - computed: true, optional: false, required: false + public get dashboardTitleEn() { + return this.getStringAttribute('dashboard_title_en'); + } + + // dashboard_type - computed: true, optional: false, required: false + public get dashboardType() { + return this.getStringAttribute('dashboard_type'); + } + + // display - computed: true, optional: false, required: false + public get display() { + return this.getBooleanAttribute('display'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // folder_id - computed: true, optional: false, required: false + public get folderId() { + return this.getStringAttribute('folder_id'); + } + + // folder_title - computed: true, optional: false, required: false + public get folderTitle() { + return this.getStringAttribute('folder_title'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_favorite - computed: true, optional: false, required: false + public get isFavorite() { + return this.getBooleanAttribute('is_favorite'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudAomDashboardsDashboardsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomDashboardsDashboardsOutputReference { + return new DataHuaweicloudAomDashboardsDashboardsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards huaweicloud_aom_dashboards} +*/ +export class DataHuaweicloudAomDashboards extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_dashboards"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomDashboards resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomDashboards to import + * @param importFromId The id of the existing DataHuaweicloudAomDashboards that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomDashboards to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_dashboards", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_dashboards huaweicloud_aom_dashboards} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomDashboardsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomDashboardsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_dashboards', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashboardType = config.dashboardType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // dashboard_type - computed: false, optional: true, required: false + private _dashboardType?: string; + public get dashboardType() { + return this.getStringAttribute('dashboard_type'); + } + public set dashboardType(value: string) { + this._dashboardType = value; + } + public resetDashboardType() { + this._dashboardType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dashboardTypeInput() { + return this._dashboardType; + } + + // dashboards - computed: true, optional: false, required: false + private _dashboards = new DataHuaweicloudAomDashboardsDashboardsList(this, "dashboards", false); + public get dashboards() { + return this._dashboards; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dashboard_type: cdktf.stringToTerraform(this._dashboardType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dashboard_type: { + value: cdktf.stringToHclTerraform(this._dashboardType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/README.md new file mode 100644 index 00000000..e087bcdc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_message_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_message_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/index.ts new file mode 100644 index 00000000..ddef00b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-message-templates/index.ts @@ -0,0 +1,379 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomMessageTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates#enterprise_project_id DataHuaweicloudAomMessageTemplates#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates#id DataHuaweicloudAomMessageTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates#region DataHuaweicloudAomMessageTemplates#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplates { +} + +export function dataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesToTerraform(struct?: DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // sub_type - computed: true, optional: false, required: false + public get subType() { + return this.getStringAttribute('sub_type'); + } + + // topic - computed: true, optional: false, required: false + public get topic() { + return this.getStringAttribute('topic'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesOutputReference { + return new DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomMessageTemplatesMessageTemplates { +} + +export function dataHuaweicloudAomMessageTemplatesMessageTemplatesToTerraform(struct?: DataHuaweicloudAomMessageTemplatesMessageTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomMessageTemplatesMessageTemplatesToHclTerraform(struct?: DataHuaweicloudAomMessageTemplatesMessageTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomMessageTemplatesMessageTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomMessageTemplatesMessageTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomMessageTemplatesMessageTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // locale - computed: true, optional: false, required: false + public get locale() { + return this.getStringAttribute('locale'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudAomMessageTemplatesMessageTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomMessageTemplatesMessageTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomMessageTemplatesMessageTemplatesOutputReference { + return new DataHuaweicloudAomMessageTemplatesMessageTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates huaweicloud_aom_message_templates} +*/ +export class DataHuaweicloudAomMessageTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_message_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomMessageTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomMessageTemplates to import + * @param importFromId The id of the existing DataHuaweicloudAomMessageTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomMessageTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_message_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_message_templates huaweicloud_aom_message_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomMessageTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomMessageTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_message_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // message_templates - computed: true, optional: false, required: false + private _messageTemplates = new DataHuaweicloudAomMessageTemplatesMessageTemplatesList(this, "message_templates", false); + public get messageTemplates() { + return this._messageTemplates; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/README.md new file mode 100644 index 00000000..eddd53df --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_multi_account_aggregation_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_multi_account_aggregation_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/index.ts new file mode 100644 index 00000000..f379ee39 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-multi-account-aggregation-rules/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomMultiAccountAggregationRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules#enterprise_project_id DataHuaweicloudAomMultiAccountAggregationRules#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules#id DataHuaweicloudAomMultiAccountAggregationRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules#region DataHuaweicloudAomMultiAccountAggregationRules#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomMultiAccountAggregationRulesRulesAccounts { +} + +export function dataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsToTerraform(struct?: DataHuaweicloudAomMultiAccountAggregationRulesRulesAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsToHclTerraform(struct?: DataHuaweicloudAomMultiAccountAggregationRulesRulesAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomMultiAccountAggregationRulesRulesAccounts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomMultiAccountAggregationRulesRulesAccounts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // join_method - computed: true, optional: false, required: false + public get joinMethod() { + return this.getStringAttribute('join_method'); + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsOutputReference { + return new DataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomMultiAccountAggregationRulesRulesServices { +} + +export function dataHuaweicloudAomMultiAccountAggregationRulesRulesServicesToTerraform(struct?: DataHuaweicloudAomMultiAccountAggregationRulesRulesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomMultiAccountAggregationRulesRulesServicesToHclTerraform(struct?: DataHuaweicloudAomMultiAccountAggregationRulesRulesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomMultiAccountAggregationRulesRulesServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomMultiAccountAggregationRulesRulesServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomMultiAccountAggregationRulesRulesServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // metrics - computed: true, optional: false, required: false + public get metrics() { + return this.getListAttribute('metrics'); + } + + // service - computed: true, optional: false, required: false + public get service() { + return this.getStringAttribute('service'); + } +} + +export class DataHuaweicloudAomMultiAccountAggregationRulesRulesServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomMultiAccountAggregationRulesRulesServicesOutputReference { + return new DataHuaweicloudAomMultiAccountAggregationRulesRulesServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomMultiAccountAggregationRulesRules { +} + +export function dataHuaweicloudAomMultiAccountAggregationRulesRulesToTerraform(struct?: DataHuaweicloudAomMultiAccountAggregationRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomMultiAccountAggregationRulesRulesToHclTerraform(struct?: DataHuaweicloudAomMultiAccountAggregationRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomMultiAccountAggregationRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomMultiAccountAggregationRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomMultiAccountAggregationRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // accounts - computed: true, optional: false, required: false + private _accounts = new DataHuaweicloudAomMultiAccountAggregationRulesRulesAccountsList(this, "accounts", false); + public get accounts() { + return this._accounts; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // send_to_source_account - computed: true, optional: false, required: false + public get sendToSourceAccount() { + return this.getBooleanAttribute('send_to_source_account'); + } + + // services - computed: true, optional: false, required: false + private _services = new DataHuaweicloudAomMultiAccountAggregationRulesRulesServicesList(this, "services", false); + public get services() { + return this._services; + } +} + +export class DataHuaweicloudAomMultiAccountAggregationRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomMultiAccountAggregationRulesRulesOutputReference { + return new DataHuaweicloudAomMultiAccountAggregationRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules huaweicloud_aom_multi_account_aggregation_rules} +*/ +export class DataHuaweicloudAomMultiAccountAggregationRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_multi_account_aggregation_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomMultiAccountAggregationRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomMultiAccountAggregationRules to import + * @param importFromId The id of the existing DataHuaweicloudAomMultiAccountAggregationRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomMultiAccountAggregationRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_multi_account_aggregation_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_multi_account_aggregation_rules huaweicloud_aom_multi_account_aggregation_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomMultiAccountAggregationRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomMultiAccountAggregationRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_multi_account_aggregation_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudAomMultiAccountAggregationRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/README.md new file mode 100644 index 00000000..a0af0c4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_organization_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_organization_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/index.ts new file mode 100644 index 00000000..91a59431 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-organization-accounts/index.ts @@ -0,0 +1,245 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomOrganizationAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts#id DataHuaweicloudAomOrganizationAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts#region DataHuaweicloudAomOrganizationAccounts#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomOrganizationAccountsAccounts { +} + +export function dataHuaweicloudAomOrganizationAccountsAccountsToTerraform(struct?: DataHuaweicloudAomOrganizationAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomOrganizationAccountsAccountsToHclTerraform(struct?: DataHuaweicloudAomOrganizationAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomOrganizationAccountsAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomOrganizationAccountsAccounts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomOrganizationAccountsAccounts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // join_method - computed: true, optional: false, required: false + public get joinMethod() { + return this.getStringAttribute('join_method'); + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudAomOrganizationAccountsAccountsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomOrganizationAccountsAccountsOutputReference { + return new DataHuaweicloudAomOrganizationAccountsAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts huaweicloud_aom_organization_accounts} +*/ +export class DataHuaweicloudAomOrganizationAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_organization_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomOrganizationAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomOrganizationAccounts to import + * @param importFromId The id of the existing DataHuaweicloudAomOrganizationAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomOrganizationAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_organization_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_organization_accounts huaweicloud_aom_organization_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomOrganizationAccountsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomOrganizationAccountsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_organization_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // accounts - computed: true, optional: false, required: false + private _accounts = new DataHuaweicloudAomOrganizationAccountsAccountsList(this, "accounts", false); + public get accounts() { + return this._accounts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/README.md new file mode 100644 index 00000000..2a44783d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_prom_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_prom_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/index.ts new file mode 100644 index 00000000..ef0fd7bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-prom-instances/index.ts @@ -0,0 +1,425 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomPromInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#cce_cluster_enable DataHuaweicloudAomPromInstances#cce_cluster_enable} + */ + readonly cceClusterEnable?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#enterprise_project_id DataHuaweicloudAomPromInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#id DataHuaweicloudAomPromInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#prom_id DataHuaweicloudAomPromInstances#prom_id} + */ + readonly promId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#prom_status DataHuaweicloudAomPromInstances#prom_status} + */ + readonly promStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#prom_type DataHuaweicloudAomPromInstances#prom_type} + */ + readonly promType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#region DataHuaweicloudAomPromInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAomPromInstancesInstances { +} + +export function dataHuaweicloudAomPromInstancesInstancesToTerraform(struct?: DataHuaweicloudAomPromInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomPromInstancesInstancesToHclTerraform(struct?: DataHuaweicloudAomPromInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomPromInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomPromInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomPromInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getStringAttribute('deleted_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_deleted_tag - computed: true, optional: false, required: false + public get isDeletedTag() { + return this.getStringAttribute('is_deleted_tag'); + } + + // prom_http_api_endpoint - computed: true, optional: false, required: false + public get promHttpApiEndpoint() { + return this.getStringAttribute('prom_http_api_endpoint'); + } + + // prom_name - computed: true, optional: false, required: false + public get promName() { + return this.getStringAttribute('prom_name'); + } + + // prom_status - computed: true, optional: false, required: false + public get promStatus() { + return this.getStringAttribute('prom_status'); + } + + // prom_type - computed: true, optional: false, required: false + public get promType() { + return this.getStringAttribute('prom_type'); + } + + // prom_version - computed: true, optional: false, required: false + public get promVersion() { + return this.getStringAttribute('prom_version'); + } + + // remote_read_url - computed: true, optional: false, required: false + public get remoteReadUrl() { + return this.getStringAttribute('remote_read_url'); + } + + // remote_write_url - computed: true, optional: false, required: false + public get remoteWriteUrl() { + return this.getStringAttribute('remote_write_url'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudAomPromInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomPromInstancesInstancesOutputReference { + return new DataHuaweicloudAomPromInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances huaweicloud_aom_prom_instances} +*/ +export class DataHuaweicloudAomPromInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_prom_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomPromInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomPromInstances to import + * @param importFromId The id of the existing DataHuaweicloudAomPromInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomPromInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_prom_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_prom_instances huaweicloud_aom_prom_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomPromInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomPromInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_prom_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cceClusterEnable = config.cceClusterEnable; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._promId = config.promId; + this._promStatus = config.promStatus; + this._promType = config.promType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cce_cluster_enable - computed: false, optional: true, required: false + private _cceClusterEnable?: string; + public get cceClusterEnable() { + return this.getStringAttribute('cce_cluster_enable'); + } + public set cceClusterEnable(value: string) { + this._cceClusterEnable = value; + } + public resetCceClusterEnable() { + this._cceClusterEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get cceClusterEnableInput() { + return this._cceClusterEnable; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudAomPromInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // prom_id - computed: false, optional: true, required: false + private _promId?: string; + public get promId() { + return this.getStringAttribute('prom_id'); + } + public set promId(value: string) { + this._promId = value; + } + public resetPromId() { + this._promId = undefined; + } + // Temporarily expose input value. Use with caution. + public get promIdInput() { + return this._promId; + } + + // prom_status - computed: false, optional: true, required: false + private _promStatus?: string; + public get promStatus() { + return this.getStringAttribute('prom_status'); + } + public set promStatus(value: string) { + this._promStatus = value; + } + public resetPromStatus() { + this._promStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get promStatusInput() { + return this._promStatus; + } + + // prom_type - computed: false, optional: true, required: false + private _promType?: string; + public get promType() { + return this.getStringAttribute('prom_type'); + } + public set promType(value: string) { + this._promType = value; + } + public resetPromType() { + this._promType = undefined; + } + // Temporarily expose input value. Use with caution. + public get promTypeInput() { + return this._promType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cce_cluster_enable: cdktf.stringToTerraform(this._cceClusterEnable), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + prom_id: cdktf.stringToTerraform(this._promId), + prom_status: cdktf.stringToTerraform(this._promStatus), + prom_type: cdktf.stringToTerraform(this._promType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cce_cluster_enable: { + value: cdktf.stringToHclTerraform(this._cceClusterEnable), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_id: { + value: cdktf.stringToHclTerraform(this._promId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_status: { + value: cdktf.stringToHclTerraform(this._promStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prom_type: { + value: cdktf.stringToHclTerraform(this._promType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/README.md new file mode 100644 index 00000000..f6602068 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_aom_service_discovery_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_aom_service_discovery_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/index.ts new file mode 100644 index 00000000..fe938ef6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-aom-service-discovery-rules/index.ts @@ -0,0 +1,738 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAomServiceDiscoveryRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules#id DataHuaweicloudAomServiceDiscoveryRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules#region DataHuaweicloudAomServiceDiscoveryRules#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules#rule_id DataHuaweicloudAomServiceDiscoveryRules#rule_id} + */ + readonly ruleId?: string; +} +export interface DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRules { +} + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesToTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesToHclTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // check_content - computed: true, optional: false, required: false + public get checkContent() { + return this.getListAttribute('check_content'); + } + + // check_mode - computed: true, optional: false, required: false + public get checkMode() { + return this.getStringAttribute('check_mode'); + } + + // check_type - computed: true, optional: false, required: false + public get checkType() { + return this.getStringAttribute('check_type'); + } +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesOutputReference { + return new DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRules { +} + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesToTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesToHclTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // args - computed: true, optional: false, required: false + public get args() { + return this.getListAttribute('args'); + } + + // name_type - computed: true, optional: false, required: false + public get nameType() { + return this.getStringAttribute('name_type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getListAttribute('value'); + } +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesOutputReference { + return new DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRule { +} + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleToTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleToHclTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // args - computed: true, optional: false, required: false + public get args() { + return this.getListAttribute('args'); + } + + // name_type - computed: true, optional: false, required: false + public get nameType() { + return this.getStringAttribute('name_type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getListAttribute('value'); + } +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleOutputReference { + return new DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRule { +} + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleToTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleToHclTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // args - computed: true, optional: false, required: false + public get args() { + return this.getListAttribute('args'); + } + + // name_type - computed: true, optional: false, required: false + public get nameType() { + return this.getStringAttribute('name_type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getListAttribute('value'); + } +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleOutputReference { + return new DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomServiceDiscoveryRulesRulesNameRules { +} + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesToTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesToHclTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomServiceDiscoveryRulesRulesNameRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomServiceDiscoveryRulesRulesNameRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // application_name_rule - computed: true, optional: false, required: false + private _applicationNameRule = new DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesApplicationNameRuleList(this, "application_name_rule", false); + public get applicationNameRule() { + return this._applicationNameRule; + } + + // service_name_rule - computed: true, optional: false, required: false + private _serviceNameRule = new DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesServiceNameRuleList(this, "service_name_rule", false); + public get serviceNameRule() { + return this._serviceNameRule; + } +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesOutputReference { + return new DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAomServiceDiscoveryRulesRules { +} + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesToTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAomServiceDiscoveryRulesRulesToHclTerraform(struct?: DataHuaweicloudAomServiceDiscoveryRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAomServiceDiscoveryRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAomServiceDiscoveryRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // detect_log_enabled - computed: true, optional: false, required: false + public get detectLogEnabled() { + return this.getBooleanAttribute('detect_log_enabled'); + } + + // discovery_rule_enabled - computed: true, optional: false, required: false + public get discoveryRuleEnabled() { + return this.getBooleanAttribute('discovery_rule_enabled'); + } + + // discovery_rules - computed: true, optional: false, required: false + private _discoveryRules = new DataHuaweicloudAomServiceDiscoveryRulesRulesDiscoveryRulesList(this, "discovery_rules", false); + public get discoveryRules() { + return this._discoveryRules; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_default_rule - computed: true, optional: false, required: false + public get isDefaultRule() { + return this.getBooleanAttribute('is_default_rule'); + } + + // log_file_suffix - computed: true, optional: false, required: false + public get logFileSuffix() { + return this.getListAttribute('log_file_suffix'); + } + + // log_path_rules - computed: true, optional: false, required: false + private _logPathRules = new DataHuaweicloudAomServiceDiscoveryRulesRulesLogPathRulesList(this, "log_path_rules", false); + public get logPathRules() { + return this._logPathRules; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // name_rules - computed: true, optional: false, required: false + private _nameRules = new DataHuaweicloudAomServiceDiscoveryRulesRulesNameRulesList(this, "name_rules", false); + public get nameRules() { + return this._nameRules; + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } +} + +export class DataHuaweicloudAomServiceDiscoveryRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAomServiceDiscoveryRulesRulesOutputReference { + return new DataHuaweicloudAomServiceDiscoveryRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules huaweicloud_aom_service_discovery_rules} +*/ +export class DataHuaweicloudAomServiceDiscoveryRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_aom_service_discovery_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAomServiceDiscoveryRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAomServiceDiscoveryRules to import + * @param importFromId The id of the existing DataHuaweicloudAomServiceDiscoveryRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAomServiceDiscoveryRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_aom_service_discovery_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/aom_service_discovery_rules huaweicloud_aom_service_discovery_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAomServiceDiscoveryRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAomServiceDiscoveryRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_aom_service_discovery_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._ruleId = config.ruleId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudAomServiceDiscoveryRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/README.md new file mode 100644 index 00000000..07e6f8fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_acl_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_acl_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/index.ts new file mode 100644 index 00000000..b476fae7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-acl-policies/index.ts @@ -0,0 +1,402 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigAclPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the entity type of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#entity_type DataHuaweicloudApigAclPolicies#entity_type} + */ + readonly entityType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#id DataHuaweicloudApigAclPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the ACL policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#instance_id DataHuaweicloudApigAclPolicies#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#name DataHuaweicloudApigAclPolicies#name} + */ + readonly name?: string; + /** + * Specifies the ID of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#policy_id DataHuaweicloudApigAclPolicies#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#region DataHuaweicloudApigAclPolicies#region} + */ + readonly region?: string; + /** + * Specifies the type of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#type DataHuaweicloudApigAclPolicies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigAclPoliciesPolicies { +} + +export function dataHuaweicloudApigAclPoliciesPoliciesToTerraform(struct?: DataHuaweicloudApigAclPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigAclPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudApigAclPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigAclPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigAclPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigAclPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_num - computed: true, optional: false, required: false + public get bindNum() { + return this.getNumberAttribute('bind_num'); + } + + // entity_type - computed: true, optional: false, required: false + public get entityType() { + return this.getStringAttribute('entity_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigAclPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigAclPoliciesPoliciesOutputReference { + return new DataHuaweicloudApigAclPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies huaweicloud_apig_acl_policies} +*/ +export class DataHuaweicloudApigAclPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_acl_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigAclPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigAclPolicies to import + * @param importFromId The id of the existing DataHuaweicloudApigAclPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigAclPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_acl_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_acl_policies huaweicloud_apig_acl_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigAclPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigAclPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_acl_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._entityType = config.entityType; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // entity_type - computed: false, optional: true, required: false + private _entityType?: string; + public get entityType() { + return this.getStringAttribute('entity_type'); + } + public set entityType(value: string) { + this._entityType = value; + } + public resetEntityType() { + this._entityType = undefined; + } + // Temporarily expose input value. Use with caution. + public get entityTypeInput() { + return this._entityType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudApigAclPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + entity_type: cdktf.stringToTerraform(this._entityType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + entity_type: { + value: cdktf.stringToHclTerraform(this._entityType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/README.md new file mode 100644 index 00000000..93b27f37 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api_associated_acl_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api_associated_acl_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/index.ts new file mode 100644 index 00000000..e683cd8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-acl-policies/index.ts @@ -0,0 +1,499 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiAssociatedAclPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API bound to the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#api_id DataHuaweicloudApigApiAssociatedAclPolicies#api_id} + */ + readonly apiId: string; + /** + * The entity type of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#entity_type DataHuaweicloudApigApiAssociatedAclPolicies#entity_type} + */ + readonly entityType?: string; + /** + * The ID of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#env_id DataHuaweicloudApigApiAssociatedAclPolicies#env_id} + */ + readonly envId?: string; + /** + * The name of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#env_name DataHuaweicloudApigApiAssociatedAclPolicies#env_name} + */ + readonly envName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#id DataHuaweicloudApigApiAssociatedAclPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the ACL policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#instance_id DataHuaweicloudApigApiAssociatedAclPolicies#instance_id} + */ + readonly instanceId: string; + /** + * The name of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#name DataHuaweicloudApigApiAssociatedAclPolicies#name} + */ + readonly name?: string; + /** + * The ID of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#policy_id DataHuaweicloudApigApiAssociatedAclPolicies#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#region DataHuaweicloudApigApiAssociatedAclPolicies#region} + */ + readonly region?: string; + /** + * The type of the ACL policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#type DataHuaweicloudApigApiAssociatedAclPolicies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigApiAssociatedAclPoliciesPolicies { +} + +export function dataHuaweicloudApigApiAssociatedAclPoliciesPoliciesToTerraform(struct?: DataHuaweicloudApigApiAssociatedAclPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedAclPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedAclPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedAclPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedAclPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedAclPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_id - computed: true, optional: false, required: false + public get bindId() { + return this.getStringAttribute('bind_id'); + } + + // bind_time - computed: true, optional: false, required: false + public get bindTime() { + return this.getStringAttribute('bind_time'); + } + + // entity_type - computed: true, optional: false, required: false + public get entityType() { + return this.getStringAttribute('entity_type'); + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiAssociatedAclPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedAclPoliciesPoliciesOutputReference { + return new DataHuaweicloudApigApiAssociatedAclPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies huaweicloud_apig_api_associated_acl_policies} +*/ +export class DataHuaweicloudApigApiAssociatedAclPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_associated_acl_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApiAssociatedAclPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApiAssociatedAclPolicies to import + * @param importFromId The id of the existing DataHuaweicloudApigApiAssociatedAclPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApiAssociatedAclPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_associated_acl_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_acl_policies huaweicloud_apig_api_associated_acl_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiAssociatedAclPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiAssociatedAclPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_associated_acl_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._entityType = config.entityType; + this._envId = config.envId; + this._envName = config.envName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // entity_type - computed: false, optional: true, required: false + private _entityType?: string; + public get entityType() { + return this.getStringAttribute('entity_type'); + } + public set entityType(value: string) { + this._entityType = value; + } + public resetEntityType() { + this._entityType = undefined; + } + // Temporarily expose input value. Use with caution. + public get entityTypeInput() { + return this._entityType; + } + + // env_id - computed: false, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: false, optional: true, required: false + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + public resetEnvName() { + this._envName = undefined; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudApigApiAssociatedAclPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + entity_type: cdktf.stringToTerraform(this._entityType), + env_id: cdktf.stringToTerraform(this._envId), + env_name: cdktf.stringToTerraform(this._envName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + entity_type: { + value: cdktf.stringToHclTerraform(this._entityType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/README.md new file mode 100644 index 00000000..05b520e4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api_associated_applications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api_associated_applications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/index.ts new file mode 100644 index 00000000..9d29af58 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-applications/index.ts @@ -0,0 +1,429 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiAssociatedApplicationsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API bound to the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#api_id DataHuaweicloudApigApiAssociatedApplications#api_id} + */ + readonly apiId: string; + /** + * The ID of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#application_id DataHuaweicloudApigApiAssociatedApplications#application_id} + */ + readonly applicationId?: string; + /** + * The ID of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#env_id DataHuaweicloudApigApiAssociatedApplications#env_id} + */ + readonly envId?: string; + /** + * The name of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#env_name DataHuaweicloudApigApiAssociatedApplications#env_name} + */ + readonly envName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#id DataHuaweicloudApigApiAssociatedApplications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the applications belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#instance_id DataHuaweicloudApigApiAssociatedApplications#instance_id} + */ + readonly instanceId: string; + /** + * The name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#name DataHuaweicloudApigApiAssociatedApplications#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#region DataHuaweicloudApigApiAssociatedApplications#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigApiAssociatedApplicationsApplications { +} + +export function dataHuaweicloudApigApiAssociatedApplicationsApplicationsToTerraform(struct?: DataHuaweicloudApigApiAssociatedApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedApplicationsApplicationsToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedApplicationsApplicationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedApplicationsApplications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedApplicationsApplications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_id - computed: true, optional: false, required: false + public get bindId() { + return this.getStringAttribute('bind_id'); + } + + // bind_time - computed: true, optional: false, required: false + public get bindTime() { + return this.getStringAttribute('bind_time'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudApigApiAssociatedApplicationsApplicationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedApplicationsApplicationsOutputReference { + return new DataHuaweicloudApigApiAssociatedApplicationsApplicationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications huaweicloud_apig_api_associated_applications} +*/ +export class DataHuaweicloudApigApiAssociatedApplications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_associated_applications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApiAssociatedApplications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApiAssociatedApplications to import + * @param importFromId The id of the existing DataHuaweicloudApigApiAssociatedApplications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApiAssociatedApplications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_associated_applications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_applications huaweicloud_apig_api_associated_applications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiAssociatedApplicationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiAssociatedApplicationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_associated_applications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._applicationId = config.applicationId; + this._envId = config.envId; + this._envName = config.envName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // application_id - computed: false, optional: true, required: false + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + public resetApplicationId() { + this._applicationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // applications - computed: true, optional: false, required: false + private _applications = new DataHuaweicloudApigApiAssociatedApplicationsApplicationsList(this, "applications", false); + public get applications() { + return this._applications; + } + + // env_id - computed: false, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: false, optional: true, required: false + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + public resetEnvName() { + this._envName = undefined; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + application_id: cdktf.stringToTerraform(this._applicationId), + env_id: cdktf.stringToTerraform(this._envId), + env_name: cdktf.stringToTerraform(this._envName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/README.md new file mode 100644 index 00000000..23e822a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api_associated_plugins` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api_associated_plugins`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/index.ts new file mode 100644 index 00000000..06714c7a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-plugins/index.ts @@ -0,0 +1,469 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiAssociatedPluginsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API bound to the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#api_id DataHuaweicloudApigApiAssociatedPlugins#api_id} + */ + readonly apiId: string; + /** + * The ID of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#env_id DataHuaweicloudApigApiAssociatedPlugins#env_id} + */ + readonly envId?: string; + /** + * The name of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#env_name DataHuaweicloudApigApiAssociatedPlugins#env_name} + */ + readonly envName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#id DataHuaweicloudApigApiAssociatedPlugins#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the plugins belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#instance_id DataHuaweicloudApigApiAssociatedPlugins#instance_id} + */ + readonly instanceId: string; + /** + * The name of the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#name DataHuaweicloudApigApiAssociatedPlugins#name} + */ + readonly name?: string; + /** + * The ID of the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#plugin_id DataHuaweicloudApigApiAssociatedPlugins#plugin_id} + */ + readonly pluginId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#region DataHuaweicloudApigApiAssociatedPlugins#region} + */ + readonly region?: string; + /** + * The type of the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#type DataHuaweicloudApigApiAssociatedPlugins#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigApiAssociatedPluginsPlugins { +} + +export function dataHuaweicloudApigApiAssociatedPluginsPluginsToTerraform(struct?: DataHuaweicloudApigApiAssociatedPluginsPlugins): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedPluginsPluginsToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedPluginsPlugins): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedPluginsPluginsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedPluginsPlugins | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedPluginsPlugins | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_id - computed: true, optional: false, required: false + public get bindId() { + return this.getStringAttribute('bind_id'); + } + + // bind_time - computed: true, optional: false, required: false + public get bindTime() { + return this.getStringAttribute('bind_time'); + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudApigApiAssociatedPluginsPluginsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedPluginsPluginsOutputReference { + return new DataHuaweicloudApigApiAssociatedPluginsPluginsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins huaweicloud_apig_api_associated_plugins} +*/ +export class DataHuaweicloudApigApiAssociatedPlugins extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_associated_plugins"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApiAssociatedPlugins resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApiAssociatedPlugins to import + * @param importFromId The id of the existing DataHuaweicloudApigApiAssociatedPlugins that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApiAssociatedPlugins to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_associated_plugins", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_plugins huaweicloud_apig_api_associated_plugins} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiAssociatedPluginsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiAssociatedPluginsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_associated_plugins', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._envId = config.envId; + this._envName = config.envName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._pluginId = config.pluginId; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // env_id - computed: false, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: false, optional: true, required: false + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + public resetEnvName() { + this._envName = undefined; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // plugin_id - computed: false, optional: true, required: false + private _pluginId?: string; + public get pluginId() { + return this.getStringAttribute('plugin_id'); + } + public set pluginId(value: string) { + this._pluginId = value; + } + public resetPluginId() { + this._pluginId = undefined; + } + // Temporarily expose input value. Use with caution. + public get pluginIdInput() { + return this._pluginId; + } + + // plugins - computed: true, optional: false, required: false + private _plugins = new DataHuaweicloudApigApiAssociatedPluginsPluginsList(this, "plugins", false); + public get plugins() { + return this._plugins; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + env_id: cdktf.stringToTerraform(this._envId), + env_name: cdktf.stringToTerraform(this._envName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + plugin_id: cdktf.stringToTerraform(this._pluginId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + plugin_id: { + value: cdktf.stringToHclTerraform(this._pluginId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/README.md new file mode 100644 index 00000000..cf850588 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api_associated_signatures` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api_associated_signatures`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/index.ts new file mode 100644 index 00000000..6fac30e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-signatures/index.ts @@ -0,0 +1,469 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiAssociatedSignaturesConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API bound to the signature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#api_id DataHuaweicloudApigApiAssociatedSignatures#api_id} + */ + readonly apiId: string; + /** + * The ID of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#env_id DataHuaweicloudApigApiAssociatedSignatures#env_id} + */ + readonly envId?: string; + /** + * The name of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#env_name DataHuaweicloudApigApiAssociatedSignatures#env_name} + */ + readonly envName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#id DataHuaweicloudApigApiAssociatedSignatures#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the signatures belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#instance_id DataHuaweicloudApigApiAssociatedSignatures#instance_id} + */ + readonly instanceId: string; + /** + * The name of the signature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#name DataHuaweicloudApigApiAssociatedSignatures#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#region DataHuaweicloudApigApiAssociatedSignatures#region} + */ + readonly region?: string; + /** + * The ID of the signature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#signature_id DataHuaweicloudApigApiAssociatedSignatures#signature_id} + */ + readonly signatureId?: string; + /** + * The type of the signature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#type DataHuaweicloudApigApiAssociatedSignatures#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigApiAssociatedSignaturesSignatures { +} + +export function dataHuaweicloudApigApiAssociatedSignaturesSignaturesToTerraform(struct?: DataHuaweicloudApigApiAssociatedSignaturesSignatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedSignaturesSignaturesToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedSignaturesSignatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedSignaturesSignaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedSignaturesSignatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedSignaturesSignatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_id - computed: true, optional: false, required: false + public get bindId() { + return this.getStringAttribute('bind_id'); + } + + // bind_time - computed: true, optional: false, required: false + public get bindTime() { + return this.getStringAttribute('bind_time'); + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // secret - computed: true, optional: false, required: false + public get secret() { + return this.getStringAttribute('secret'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudApigApiAssociatedSignaturesSignaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedSignaturesSignaturesOutputReference { + return new DataHuaweicloudApigApiAssociatedSignaturesSignaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures huaweicloud_apig_api_associated_signatures} +*/ +export class DataHuaweicloudApigApiAssociatedSignatures extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_associated_signatures"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApiAssociatedSignatures resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApiAssociatedSignatures to import + * @param importFromId The id of the existing DataHuaweicloudApigApiAssociatedSignatures that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApiAssociatedSignatures to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_associated_signatures", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_signatures huaweicloud_apig_api_associated_signatures} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiAssociatedSignaturesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiAssociatedSignaturesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_associated_signatures', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._envId = config.envId; + this._envName = config.envName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._signatureId = config.signatureId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // env_id - computed: false, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: false, optional: true, required: false + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + public resetEnvName() { + this._envName = undefined; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // signature_id - computed: false, optional: true, required: false + private _signatureId?: string; + public get signatureId() { + return this.getStringAttribute('signature_id'); + } + public set signatureId(value: string) { + this._signatureId = value; + } + public resetSignatureId() { + this._signatureId = undefined; + } + // Temporarily expose input value. Use with caution. + public get signatureIdInput() { + return this._signatureId; + } + + // signatures - computed: true, optional: false, required: false + private _signatures = new DataHuaweicloudApigApiAssociatedSignaturesSignaturesList(this, "signatures", false); + public get signatures() { + return this._signatures; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + env_id: cdktf.stringToTerraform(this._envId), + env_name: cdktf.stringToTerraform(this._envName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + signature_id: cdktf.stringToTerraform(this._signatureId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + signature_id: { + value: cdktf.stringToHclTerraform(this._signatureId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/README.md new file mode 100644 index 00000000..e6551485 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api_associated_throttling_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api_associated_throttling_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/index.ts new file mode 100644 index 00000000..4a0ca040 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-associated-throttling-policies/index.ts @@ -0,0 +1,686 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiAssociatedThrottlingPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API bound to the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#api_id DataHuaweicloudApigApiAssociatedThrottlingPolicies#api_id} + */ + readonly apiId: string; + /** + * The name of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#env_name DataHuaweicloudApigApiAssociatedThrottlingPolicies#env_name} + */ + readonly envName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#id DataHuaweicloudApigApiAssociatedThrottlingPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the throttling policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#instance_id DataHuaweicloudApigApiAssociatedThrottlingPolicies#instance_id} + */ + readonly instanceId: string; + /** + * The name of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#name DataHuaweicloudApigApiAssociatedThrottlingPolicies#name} + */ + readonly name?: string; + /** + * The time unit for limiting the number of API calls. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#period_unit DataHuaweicloudApigApiAssociatedThrottlingPolicies#period_unit} + */ + readonly periodUnit?: string; + /** + * The ID of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#policy_id DataHuaweicloudApigApiAssociatedThrottlingPolicies#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#region DataHuaweicloudApigApiAssociatedThrottlingPolicies#region} + */ + readonly region?: string; + /** + * The type of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#type DataHuaweicloudApigApiAssociatedThrottlingPolicies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottles { +} + +export function dataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesToTerraform(struct?: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: true, optional: false, required: false + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + + // throttling_object_id - computed: true, optional: false, required: false + public get throttlingObjectId() { + return this.getStringAttribute('throttling_object_id'); + } + + // throttling_object_name - computed: true, optional: false, required: false + public get throttlingObjectName() { + return this.getStringAttribute('throttling_object_name'); + } +} + +export class DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesOutputReference { + return new DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottles { +} + +export function dataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesToTerraform(struct?: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: true, optional: false, required: false + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + + // throttling_object_id - computed: true, optional: false, required: false + public get throttlingObjectId() { + return this.getStringAttribute('throttling_object_id'); + } + + // throttling_object_name - computed: true, optional: false, required: false + public get throttlingObjectName() { + return this.getStringAttribute('throttling_object_name'); + } +} + +export class DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesOutputReference { + return new DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiAssociatedThrottlingPoliciesPolicies { +} + +export function dataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesToTerraform(struct?: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiAssociatedThrottlingPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiAssociatedThrottlingPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_throttles - computed: true, optional: false, required: false + private _appThrottles = new DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesAppThrottlesList(this, "app_throttles", false); + public get appThrottles() { + return this._appThrottles; + } + + // bind_id - computed: true, optional: false, required: false + public get bindId() { + return this.getStringAttribute('bind_id'); + } + + // bind_time - computed: true, optional: false, required: false + public get bindTime() { + return this.getStringAttribute('bind_time'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: true, optional: false, required: false + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + + // max_app_requests - computed: true, optional: false, required: false + public get maxAppRequests() { + return this.getNumberAttribute('max_app_requests'); + } + + // max_ip_requests - computed: true, optional: false, required: false + public get maxIpRequests() { + return this.getNumberAttribute('max_ip_requests'); + } + + // max_user_requests - computed: true, optional: false, required: false + public get maxUserRequests() { + return this.getNumberAttribute('max_user_requests'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getNumberAttribute('period'); + } + + // period_unit - computed: true, optional: false, required: false + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // user_throttles - computed: true, optional: false, required: false + private _userThrottles = new DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesUserThrottlesList(this, "user_throttles", false); + public get userThrottles() { + return this._userThrottles; + } +} + +export class DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesOutputReference { + return new DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies huaweicloud_apig_api_associated_throttling_policies} +*/ +export class DataHuaweicloudApigApiAssociatedThrottlingPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_associated_throttling_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApiAssociatedThrottlingPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApiAssociatedThrottlingPolicies to import + * @param importFromId The id of the existing DataHuaweicloudApigApiAssociatedThrottlingPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApiAssociatedThrottlingPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_associated_throttling_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_associated_throttling_policies huaweicloud_apig_api_associated_throttling_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiAssociatedThrottlingPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiAssociatedThrottlingPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_associated_throttling_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._envName = config.envName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._periodUnit = config.periodUnit; + this._policyId = config.policyId; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // env_name - computed: false, optional: true, required: false + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + public resetEnvName() { + this._envName = undefined; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudApigApiAssociatedThrottlingPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + env_name: cdktf.stringToTerraform(this._envName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + period_unit: cdktf.stringToTerraform(this._periodUnit), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/README.md new file mode 100644 index 00000000..4af70e01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api_basic_configurations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api_basic_configurations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/index.ts new file mode 100644 index 00000000..c1a699ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api-basic-configurations/index.ts @@ -0,0 +1,752 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiBasicConfigurationsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#api_id DataHuaweicloudApigApiBasicConfigurations#api_id} + */ + readonly apiId?: string; + /** + * Specifies the backend type of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#backend_type DataHuaweicloudApigApiBasicConfigurations#backend_type} + */ + readonly backendType?: string; + /** + * Specifies the ID of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#env_id DataHuaweicloudApigApiBasicConfigurations#env_id} + */ + readonly envId?: string; + /** + * Specifies the name of the environment where the API is published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#env_name DataHuaweicloudApigApiBasicConfigurations#env_name} + */ + readonly envName?: string; + /** + * Specifies the ID of the API group to which the APIs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#group_id DataHuaweicloudApigApiBasicConfigurations#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#id DataHuaweicloudApigApiBasicConfigurations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the APIs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#instance_id DataHuaweicloudApigApiBasicConfigurations#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#name DataHuaweicloudApigApiBasicConfigurations#name} + */ + readonly name?: string; + /** + * Specifies the parameter name for exact matching. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#precise_search DataHuaweicloudApigApiBasicConfigurations#precise_search} + */ + readonly preciseSearch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#region DataHuaweicloudApigApiBasicConfigurations#region} + */ + readonly region?: string; + /** + * Specifies the request method of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#request_method DataHuaweicloudApigApiBasicConfigurations#request_method} + */ + readonly requestMethod?: string; + /** + * Specifies the request address of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#request_path DataHuaweicloudApigApiBasicConfigurations#request_path} + */ + readonly requestPath?: string; + /** + * Specifies the request protocol of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#request_protocol DataHuaweicloudApigApiBasicConfigurations#request_protocol} + */ + readonly requestProtocol?: string; + /** + * Specifies the security authentication mode of the API request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#security_authentication DataHuaweicloudApigApiBasicConfigurations#security_authentication} + */ + readonly securityAuthentication?: string; + /** + * Specifies the type of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#type DataHuaweicloudApigApiBasicConfigurations#type} + */ + readonly type?: string; + /** + * Specifies the name of the VPC channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#vpc_channel_name DataHuaweicloudApigApiBasicConfigurations#vpc_channel_name} + */ + readonly vpcChannelName?: string; +} +export interface DataHuaweicloudApigApiBasicConfigurationsConfigurations { +} + +export function dataHuaweicloudApigApiBasicConfigurationsConfigurationsToTerraform(struct?: DataHuaweicloudApigApiBasicConfigurationsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiBasicConfigurationsConfigurationsToHclTerraform(struct?: DataHuaweicloudApigApiBasicConfigurationsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiBasicConfigurationsConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiBasicConfigurationsConfigurations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiBasicConfigurationsConfigurations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // backend_type - computed: true, optional: false, required: false + public get backendType() { + return this.getStringAttribute('backend_type'); + } + + // cors - computed: true, optional: false, required: false + public get cors() { + return this.getBooleanAttribute('cors'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // group_version - computed: true, optional: false, required: false + public get groupVersion() { + return this.getStringAttribute('group_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // matching - computed: true, optional: false, required: false + public get matching() { + return this.getStringAttribute('matching'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // publish_id - computed: true, optional: false, required: false + public get publishId() { + return this.getStringAttribute('publish_id'); + } + + // published_at - computed: true, optional: false, required: false + public get publishedAt() { + return this.getStringAttribute('published_at'); + } + + // registered_at - computed: true, optional: false, required: false + public get registeredAt() { + return this.getStringAttribute('registered_at'); + } + + // request_method - computed: true, optional: false, required: false + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + + // request_path - computed: true, optional: false, required: false + public get requestPath() { + return this.getStringAttribute('request_path'); + } + + // request_protocol - computed: true, optional: false, required: false + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + + // security_authentication - computed: true, optional: false, required: false + public get securityAuthentication() { + return this.getStringAttribute('security_authentication'); + } + + // simple_authentication - computed: true, optional: false, required: false + public get simpleAuthentication() { + return this.getBooleanAttribute('simple_authentication'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return cdktf.Fn.tolist(this.getListAttribute('tags')); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudApigApiBasicConfigurationsConfigurationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiBasicConfigurationsConfigurationsOutputReference { + return new DataHuaweicloudApigApiBasicConfigurationsConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations huaweicloud_apig_api_basic_configurations} +*/ +export class DataHuaweicloudApigApiBasicConfigurations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api_basic_configurations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApiBasicConfigurations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApiBasicConfigurations to import + * @param importFromId The id of the existing DataHuaweicloudApigApiBasicConfigurations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApiBasicConfigurations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api_basic_configurations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api_basic_configurations huaweicloud_apig_api_basic_configurations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiBasicConfigurationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiBasicConfigurationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api_basic_configurations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._backendType = config.backendType; + this._envId = config.envId; + this._envName = config.envName; + this._groupId = config.groupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._preciseSearch = config.preciseSearch; + this._region = config.region; + this._requestMethod = config.requestMethod; + this._requestPath = config.requestPath; + this._requestProtocol = config.requestProtocol; + this._securityAuthentication = config.securityAuthentication; + this._type = config.type; + this._vpcChannelName = config.vpcChannelName; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: true, required: false + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + public resetApiId() { + this._apiId = undefined; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // backend_type - computed: false, optional: true, required: false + private _backendType?: string; + public get backendType() { + return this.getStringAttribute('backend_type'); + } + public set backendType(value: string) { + this._backendType = value; + } + public resetBackendType() { + this._backendType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendTypeInput() { + return this._backendType; + } + + // configurations - computed: true, optional: false, required: false + private _configurations = new DataHuaweicloudApigApiBasicConfigurationsConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + + // env_id - computed: false, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // env_name - computed: false, optional: true, required: false + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + public resetEnvName() { + this._envName = undefined; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // precise_search - computed: false, optional: true, required: false + private _preciseSearch?: string; + public get preciseSearch() { + return this.getStringAttribute('precise_search'); + } + public set preciseSearch(value: string) { + this._preciseSearch = value; + } + public resetPreciseSearch() { + this._preciseSearch = undefined; + } + // Temporarily expose input value. Use with caution. + public get preciseSearchInput() { + return this._preciseSearch; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_method - computed: false, optional: true, required: false + private _requestMethod?: string; + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + public set requestMethod(value: string) { + this._requestMethod = value; + } + public resetRequestMethod() { + this._requestMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestMethodInput() { + return this._requestMethod; + } + + // request_path - computed: false, optional: true, required: false + private _requestPath?: string; + public get requestPath() { + return this.getStringAttribute('request_path'); + } + public set requestPath(value: string) { + this._requestPath = value; + } + public resetRequestPath() { + this._requestPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestPathInput() { + return this._requestPath; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // security_authentication - computed: false, optional: true, required: false + private _securityAuthentication?: string; + public get securityAuthentication() { + return this.getStringAttribute('security_authentication'); + } + public set securityAuthentication(value: string) { + this._securityAuthentication = value; + } + public resetSecurityAuthentication() { + this._securityAuthentication = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityAuthenticationInput() { + return this._securityAuthentication; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_channel_name - computed: false, optional: true, required: false + private _vpcChannelName?: string; + public get vpcChannelName() { + return this.getStringAttribute('vpc_channel_name'); + } + public set vpcChannelName(value: string) { + this._vpcChannelName = value; + } + public resetVpcChannelName() { + this._vpcChannelName = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcChannelNameInput() { + return this._vpcChannelName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + backend_type: cdktf.stringToTerraform(this._backendType), + env_id: cdktf.stringToTerraform(this._envId), + env_name: cdktf.stringToTerraform(this._envName), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + precise_search: cdktf.stringToTerraform(this._preciseSearch), + region: cdktf.stringToTerraform(this._region), + request_method: cdktf.stringToTerraform(this._requestMethod), + request_path: cdktf.stringToTerraform(this._requestPath), + request_protocol: cdktf.stringToTerraform(this._requestProtocol), + security_authentication: cdktf.stringToTerraform(this._securityAuthentication), + type: cdktf.stringToTerraform(this._type), + vpc_channel_name: cdktf.stringToTerraform(this._vpcChannelName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_type: { + value: cdktf.stringToHclTerraform(this._backendType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(this._envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + precise_search: { + value: cdktf.stringToHclTerraform(this._preciseSearch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_method: { + value: cdktf.stringToHclTerraform(this._requestMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_path: { + value: cdktf.stringToHclTerraform(this._requestPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(this._requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_authentication: { + value: cdktf.stringToHclTerraform(this._securityAuthentication), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_channel_name: { + value: cdktf.stringToHclTerraform(this._vpcChannelName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/README.md new file mode 100644 index 00000000..2093c07f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_api` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_api`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/index.ts new file mode 100644 index 00000000..59712e31 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-api/index.ts @@ -0,0 +1,2032 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApiConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api#api_id DataHuaweicloudApigApi#api_id} + */ + readonly apiId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api#id DataHuaweicloudApigApi#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the API belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api#instance_id DataHuaweicloudApigApi#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api#region DataHuaweicloudApigApi#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigApiBackendParams { +} + +export function dataHuaweicloudApigApiBackendParamsToTerraform(struct?: DataHuaweicloudApigApiBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiBackendParamsToHclTerraform(struct?: DataHuaweicloudApigApiBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiBackendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiBackendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // system_param_type - computed: true, optional: false, required: false + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiBackendParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiBackendParamsOutputReference { + return new DataHuaweicloudApigApiBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiFuncGraph { +} + +export function dataHuaweicloudApigApiFuncGraphToTerraform(struct?: DataHuaweicloudApigApiFuncGraph): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiFuncGraphToHclTerraform(struct?: DataHuaweicloudApigApiFuncGraph): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiFuncGraphOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiFuncGraph | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiFuncGraph | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // function_alias_urn - computed: true, optional: false, required: false + public get functionAliasUrn() { + return this.getStringAttribute('function_alias_urn'); + } + + // function_urn - computed: true, optional: false, required: false + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // invocation_type - computed: true, optional: false, required: false + public get invocationType() { + return this.getStringAttribute('invocation_type'); + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // request_protocol - computed: true, optional: false, required: false + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudApigApiFuncGraphList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiFuncGraphOutputReference { + return new DataHuaweicloudApigApiFuncGraphOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiFuncGraphPolicyBackendParams { +} + +export function dataHuaweicloudApigApiFuncGraphPolicyBackendParamsToTerraform(struct?: DataHuaweicloudApigApiFuncGraphPolicyBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiFuncGraphPolicyBackendParamsToHclTerraform(struct?: DataHuaweicloudApigApiFuncGraphPolicyBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiFuncGraphPolicyBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiFuncGraphPolicyBackendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiFuncGraphPolicyBackendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // system_param_type - computed: true, optional: false, required: false + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiFuncGraphPolicyBackendParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiFuncGraphPolicyBackendParamsOutputReference { + return new DataHuaweicloudApigApiFuncGraphPolicyBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiFuncGraphPolicyConditions { +} + +export function dataHuaweicloudApigApiFuncGraphPolicyConditionsToTerraform(struct?: DataHuaweicloudApigApiFuncGraphPolicyConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiFuncGraphPolicyConditionsToHclTerraform(struct?: DataHuaweicloudApigApiFuncGraphPolicyConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiFuncGraphPolicyConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiFuncGraphPolicyConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiFuncGraphPolicyConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cookie_name - computed: true, optional: false, required: false + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + + // frontend_authorizer_name - computed: true, optional: false, required: false + public get frontendAuthorizerName() { + return this.getStringAttribute('frontend_authorizer_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // param_name - computed: true, optional: false, required: false + public get paramName() { + return this.getStringAttribute('param_name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // request_location - computed: true, optional: false, required: false + public get requestLocation() { + return this.getStringAttribute('request_location'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // sys_name - computed: true, optional: false, required: false + public get sysName() { + return this.getStringAttribute('sys_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiFuncGraphPolicyConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiFuncGraphPolicyConditionsOutputReference { + return new DataHuaweicloudApigApiFuncGraphPolicyConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiFuncGraphPolicy { +} + +export function dataHuaweicloudApigApiFuncGraphPolicyToTerraform(struct?: DataHuaweicloudApigApiFuncGraphPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiFuncGraphPolicyToHclTerraform(struct?: DataHuaweicloudApigApiFuncGraphPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiFuncGraphPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiFuncGraphPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiFuncGraphPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // backend_params - computed: true, optional: false, required: false + private _backendParams = new DataHuaweicloudApigApiFuncGraphPolicyBackendParamsList(this, "backend_params", false); + public get backendParams() { + return this._backendParams; + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudApigApiFuncGraphPolicyConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // effective_mode - computed: true, optional: false, required: false + public get effectiveMode() { + return this.getStringAttribute('effective_mode'); + } + + // function_alias_urn - computed: true, optional: false, required: false + public get functionAliasUrn() { + return this.getStringAttribute('function_alias_urn'); + } + + // function_urn - computed: true, optional: false, required: false + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // invocation_type - computed: true, optional: false, required: false + public get invocationType() { + return this.getStringAttribute('invocation_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // request_protocol - computed: true, optional: false, required: false + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudApigApiFuncGraphPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiFuncGraphPolicyOutputReference { + return new DataHuaweicloudApigApiFuncGraphPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiMock { +} + +export function dataHuaweicloudApigApiMockToTerraform(struct?: DataHuaweicloudApigApiMock): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiMockToHclTerraform(struct?: DataHuaweicloudApigApiMock): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiMockOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiMock | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiMock | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // response - computed: true, optional: false, required: false + public get response() { + return this.getStringAttribute('response'); + } + + // status_code - computed: true, optional: false, required: false + public get statusCode() { + return this.getNumberAttribute('status_code'); + } +} + +export class DataHuaweicloudApigApiMockList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiMockOutputReference { + return new DataHuaweicloudApigApiMockOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiMockPolicyBackendParams { +} + +export function dataHuaweicloudApigApiMockPolicyBackendParamsToTerraform(struct?: DataHuaweicloudApigApiMockPolicyBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiMockPolicyBackendParamsToHclTerraform(struct?: DataHuaweicloudApigApiMockPolicyBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiMockPolicyBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiMockPolicyBackendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiMockPolicyBackendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // system_param_type - computed: true, optional: false, required: false + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiMockPolicyBackendParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiMockPolicyBackendParamsOutputReference { + return new DataHuaweicloudApigApiMockPolicyBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiMockPolicyConditions { +} + +export function dataHuaweicloudApigApiMockPolicyConditionsToTerraform(struct?: DataHuaweicloudApigApiMockPolicyConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiMockPolicyConditionsToHclTerraform(struct?: DataHuaweicloudApigApiMockPolicyConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiMockPolicyConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiMockPolicyConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiMockPolicyConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cookie_name - computed: true, optional: false, required: false + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + + // frontend_authorizer_name - computed: true, optional: false, required: false + public get frontendAuthorizerName() { + return this.getStringAttribute('frontend_authorizer_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // param_name - computed: true, optional: false, required: false + public get paramName() { + return this.getStringAttribute('param_name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // request_location - computed: true, optional: false, required: false + public get requestLocation() { + return this.getStringAttribute('request_location'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // sys_name - computed: true, optional: false, required: false + public get sysName() { + return this.getStringAttribute('sys_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiMockPolicyConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiMockPolicyConditionsOutputReference { + return new DataHuaweicloudApigApiMockPolicyConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiMockPolicy { +} + +export function dataHuaweicloudApigApiMockPolicyToTerraform(struct?: DataHuaweicloudApigApiMockPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiMockPolicyToHclTerraform(struct?: DataHuaweicloudApigApiMockPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiMockPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiMockPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiMockPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // backend_params - computed: true, optional: false, required: false + private _backendParams = new DataHuaweicloudApigApiMockPolicyBackendParamsList(this, "backend_params", false); + public get backendParams() { + return this._backendParams; + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudApigApiMockPolicyConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // effective_mode - computed: true, optional: false, required: false + public get effectiveMode() { + return this.getStringAttribute('effective_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // response - computed: true, optional: false, required: false + public get response() { + return this.getStringAttribute('response'); + } + + // status_code - computed: true, optional: false, required: false + public get statusCode() { + return this.getNumberAttribute('status_code'); + } +} + +export class DataHuaweicloudApigApiMockPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiMockPolicyOutputReference { + return new DataHuaweicloudApigApiMockPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiRequestParams { +} + +export function dataHuaweicloudApigApiRequestParamsToTerraform(struct?: DataHuaweicloudApigApiRequestParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiRequestParamsToHclTerraform(struct?: DataHuaweicloudApigApiRequestParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiRequestParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiRequestParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiRequestParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default - computed: true, optional: false, required: false + public get default() { + return this.getStringAttribute('default'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enumeration - computed: true, optional: false, required: false + public get enumeration() { + return this.getStringAttribute('enumeration'); + } + + // example - computed: true, optional: false, required: false + public get example() { + return this.getStringAttribute('example'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // maximum - computed: true, optional: false, required: false + public get maximum() { + return this.getNumberAttribute('maximum'); + } + + // minimum - computed: true, optional: false, required: false + public get minimum() { + return this.getNumberAttribute('minimum'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // passthrough - computed: true, optional: false, required: false + public get passthrough() { + return this.getBooleanAttribute('passthrough'); + } + + // required - computed: true, optional: false, required: false + public get required() { + return this.getBooleanAttribute('required'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // valid_enable - computed: true, optional: false, required: false + public get validEnable() { + return this.getNumberAttribute('valid_enable'); + } +} + +export class DataHuaweicloudApigApiRequestParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiRequestParamsOutputReference { + return new DataHuaweicloudApigApiRequestParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiWeb { +} + +export function dataHuaweicloudApigApiWebToTerraform(struct?: DataHuaweicloudApigApiWeb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiWebToHclTerraform(struct?: DataHuaweicloudApigApiWeb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiWebOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiWeb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiWeb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // backend_address - computed: true, optional: false, required: false + public get backendAddress() { + return this.getStringAttribute('backend_address'); + } + + // host_header - computed: true, optional: false, required: false + public get hostHeader() { + return this.getStringAttribute('host_header'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // request_method - computed: true, optional: false, required: false + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + + // request_protocol - computed: true, optional: false, required: false + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + + // retry_count - computed: true, optional: false, required: false + public get retryCount() { + return this.getNumberAttribute('retry_count'); + } + + // ssl_enable - computed: true, optional: false, required: false + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // vpc_channel_id - computed: true, optional: false, required: false + public get vpcChannelId() { + return this.getStringAttribute('vpc_channel_id'); + } +} + +export class DataHuaweicloudApigApiWebList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiWebOutputReference { + return new DataHuaweicloudApigApiWebOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiWebPolicyBackendParams { +} + +export function dataHuaweicloudApigApiWebPolicyBackendParamsToTerraform(struct?: DataHuaweicloudApigApiWebPolicyBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiWebPolicyBackendParamsToHclTerraform(struct?: DataHuaweicloudApigApiWebPolicyBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiWebPolicyBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiWebPolicyBackendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiWebPolicyBackendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // system_param_type - computed: true, optional: false, required: false + public get systemParamType() { + return this.getStringAttribute('system_param_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiWebPolicyBackendParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiWebPolicyBackendParamsOutputReference { + return new DataHuaweicloudApigApiWebPolicyBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiWebPolicyConditions { +} + +export function dataHuaweicloudApigApiWebPolicyConditionsToTerraform(struct?: DataHuaweicloudApigApiWebPolicyConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiWebPolicyConditionsToHclTerraform(struct?: DataHuaweicloudApigApiWebPolicyConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiWebPolicyConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiWebPolicyConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiWebPolicyConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cookie_name - computed: true, optional: false, required: false + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + + // frontend_authorizer_name - computed: true, optional: false, required: false + public get frontendAuthorizerName() { + return this.getStringAttribute('frontend_authorizer_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // param_name - computed: true, optional: false, required: false + public get paramName() { + return this.getStringAttribute('param_name'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // request_location - computed: true, optional: false, required: false + public get requestLocation() { + return this.getStringAttribute('request_location'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // sys_name - computed: true, optional: false, required: false + public get sysName() { + return this.getStringAttribute('sys_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigApiWebPolicyConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiWebPolicyConditionsOutputReference { + return new DataHuaweicloudApigApiWebPolicyConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigApiWebPolicy { +} + +export function dataHuaweicloudApigApiWebPolicyToTerraform(struct?: DataHuaweicloudApigApiWebPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApiWebPolicyToHclTerraform(struct?: DataHuaweicloudApigApiWebPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApiWebPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApiWebPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApiWebPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // backend_address - computed: true, optional: false, required: false + public get backendAddress() { + return this.getStringAttribute('backend_address'); + } + + // backend_params - computed: true, optional: false, required: false + private _backendParams = new DataHuaweicloudApigApiWebPolicyBackendParamsList(this, "backend_params", false); + public get backendParams() { + return this._backendParams; + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudApigApiWebPolicyConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // effective_mode - computed: true, optional: false, required: false + public get effectiveMode() { + return this.getStringAttribute('effective_mode'); + } + + // host_header - computed: true, optional: false, required: false + public get hostHeader() { + return this.getStringAttribute('host_header'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // request_method - computed: true, optional: false, required: false + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + + // request_protocol - computed: true, optional: false, required: false + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + + // retry_count - computed: true, optional: false, required: false + public get retryCount() { + return this.getNumberAttribute('retry_count'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // vpc_channel_id - computed: true, optional: false, required: false + public get vpcChannelId() { + return this.getStringAttribute('vpc_channel_id'); + } +} + +export class DataHuaweicloudApigApiWebPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApiWebPolicyOutputReference { + return new DataHuaweicloudApigApiWebPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api huaweicloud_apig_api} +*/ +export class DataHuaweicloudApigApi extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_api"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApi resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApi to import + * @param importFromId The id of the existing DataHuaweicloudApigApi that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApi to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_api", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_api huaweicloud_apig_api} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApiConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApiConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_api', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // authorizer_id - computed: true, optional: false, required: false + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + + // backend_params - computed: true, optional: false, required: false + private _backendParams = new DataHuaweicloudApigApiBackendParamsList(this, "backend_params", false); + public get backendParams() { + return this._backendParams; + } + + // backend_type - computed: true, optional: false, required: false + public get backendType() { + return this.getStringAttribute('backend_type'); + } + + // body_description - computed: true, optional: false, required: false + public get bodyDescription() { + return this.getStringAttribute('body_description'); + } + + // cors - computed: true, optional: false, required: false + public get cors() { + return this.getBooleanAttribute('cors'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // env_name - computed: true, optional: false, required: false + public get envName() { + return this.getStringAttribute('env_name'); + } + + // failure_response - computed: true, optional: false, required: false + public get failureResponse() { + return this.getStringAttribute('failure_response'); + } + + // func_graph - computed: true, optional: false, required: false + private _funcGraph = new DataHuaweicloudApigApiFuncGraphList(this, "func_graph", false); + public get funcGraph() { + return this._funcGraph; + } + + // func_graph_policy - computed: true, optional: false, required: false + private _funcGraphPolicy = new DataHuaweicloudApigApiFuncGraphPolicyList(this, "func_graph_policy", false); + public get funcGraphPolicy() { + return this._funcGraphPolicy; + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // group_version - computed: true, optional: false, required: false + public get groupVersion() { + return this.getStringAttribute('group_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // matching - computed: true, optional: false, required: false + public get matching() { + return this.getStringAttribute('matching'); + } + + // mock - computed: true, optional: false, required: false + private _mock = new DataHuaweicloudApigApiMockList(this, "mock", false); + public get mock() { + return this._mock; + } + + // mock_policy - computed: true, optional: false, required: false + private _mockPolicy = new DataHuaweicloudApigApiMockPolicyList(this, "mock_policy", false); + public get mockPolicy() { + return this._mockPolicy; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // publish_id - computed: true, optional: false, required: false + public get publishId() { + return this.getStringAttribute('publish_id'); + } + + // published_at - computed: true, optional: false, required: false + public get publishedAt() { + return this.getStringAttribute('published_at'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // registered_at - computed: true, optional: false, required: false + public get registeredAt() { + return this.getStringAttribute('registered_at'); + } + + // request_method - computed: true, optional: false, required: false + public get requestMethod() { + return this.getStringAttribute('request_method'); + } + + // request_params - computed: true, optional: false, required: false + private _requestParams = new DataHuaweicloudApigApiRequestParamsList(this, "request_params", false); + public get requestParams() { + return this._requestParams; + } + + // request_path - computed: true, optional: false, required: false + public get requestPath() { + return this.getStringAttribute('request_path'); + } + + // request_protocol - computed: true, optional: false, required: false + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + + // response_id - computed: true, optional: false, required: false + public get responseId() { + return this.getStringAttribute('response_id'); + } + + // security_authentication - computed: true, optional: false, required: false + public get securityAuthentication() { + return this.getStringAttribute('security_authentication'); + } + + // simple_authentication - computed: true, optional: false, required: false + public get simpleAuthentication() { + return this.getBooleanAttribute('simple_authentication'); + } + + // success_response - computed: true, optional: false, required: false + public get successResponse() { + return this.getStringAttribute('success_response'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return cdktf.Fn.tolist(this.getListAttribute('tags')); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // web - computed: true, optional: false, required: false + private _web = new DataHuaweicloudApigApiWebList(this, "web", false); + public get web() { + return this._web; + } + + // web_policy - computed: true, optional: false, required: false + private _webPolicy = new DataHuaweicloudApigApiWebPolicyList(this, "web_policy", false); + public get webPolicy() { + return this._webPolicy; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/README.md new file mode 100644 index 00000000..61abc341 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_appcodes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_appcodes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/index.ts new file mode 100644 index 00000000..eee8df8c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-appcodes/index.ts @@ -0,0 +1,294 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigAppcodesConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes#application_id DataHuaweicloudApigAppcodes#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes#id DataHuaweicloudApigAppcodes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes#instance_id DataHuaweicloudApigAppcodes#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes#region DataHuaweicloudApigAppcodes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigAppcodesAppcodes { +} + +export function dataHuaweicloudApigAppcodesAppcodesToTerraform(struct?: DataHuaweicloudApigAppcodesAppcodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigAppcodesAppcodesToHclTerraform(struct?: DataHuaweicloudApigAppcodesAppcodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigAppcodesAppcodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigAppcodesAppcodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigAppcodesAppcodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // application_id - computed: true, optional: false, required: false + public get applicationId() { + return this.getStringAttribute('application_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigAppcodesAppcodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigAppcodesAppcodesOutputReference { + return new DataHuaweicloudApigAppcodesAppcodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes huaweicloud_apig_appcodes} +*/ +export class DataHuaweicloudApigAppcodes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_appcodes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigAppcodes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigAppcodes to import + * @param importFromId The id of the existing DataHuaweicloudApigAppcodes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigAppcodes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_appcodes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_appcodes huaweicloud_apig_appcodes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigAppcodesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigAppcodesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_appcodes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // appcodes - computed: true, optional: false, required: false + private _appcodes = new DataHuaweicloudApigAppcodesAppcodesList(this, "appcodes", false); + public get appcodes() { + return this._appcodes; + } + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/README.md new file mode 100644 index 00000000..3efbfc9e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_application_acl` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_application_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/index.ts new file mode 100644 index 00000000..af578ecb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-acl/index.ts @@ -0,0 +1,210 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApplicationAclConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application to which the ACL rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl#application_id DataHuaweicloudApigApplicationAcl#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl#id DataHuaweicloudApigApplicationAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl#instance_id DataHuaweicloudApigApplicationAcl#instance_id} + */ + readonly instanceId: string; + /** + * The region where the application and ACL rules are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl#region DataHuaweicloudApigApplicationAcl#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl huaweicloud_apig_application_acl} +*/ +export class DataHuaweicloudApigApplicationAcl extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApplicationAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApplicationAcl to import + * @param importFromId The id of the existing DataHuaweicloudApigApplicationAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApplicationAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_acl huaweicloud_apig_application_acl} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApplicationAclConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApplicationAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // values - computed: true, optional: false, required: false + public get values() { + return this.getListAttribute('values'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/README.md new file mode 100644 index 00000000..600518ce --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_application_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_application_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/index.ts new file mode 100644 index 00000000..5d0ce02f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-application-quotas/index.ts @@ -0,0 +1,349 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApplicationQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas#id DataHuaweicloudApigApplicationQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the application quotas belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas#instance_id DataHuaweicloudApigApplicationQuotas#instance_id} + */ + readonly instanceId: string; + /** + * The name of the application quota to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas#name DataHuaweicloudApigApplicationQuotas#name} + */ + readonly name?: string; + /** + * The ID of the application quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas#quota_id DataHuaweicloudApigApplicationQuotas#quota_id} + */ + readonly quotaId?: string; + /** + * The region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas#region DataHuaweicloudApigApplicationQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigApplicationQuotasQuotas { +} + +export function dataHuaweicloudApigApplicationQuotasQuotasToTerraform(struct?: DataHuaweicloudApigApplicationQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApplicationQuotasQuotasToHclTerraform(struct?: DataHuaweicloudApigApplicationQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApplicationQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApplicationQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApplicationQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bound_app_num - computed: true, optional: false, required: false + public get boundAppNum() { + return this.getNumberAttribute('bound_app_num'); + } + + // call_limits - computed: true, optional: false, required: false + public get callLimits() { + return this.getNumberAttribute('call_limits'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // time_interval - computed: true, optional: false, required: false + public get timeInterval() { + return this.getNumberAttribute('time_interval'); + } + + // time_unit - computed: true, optional: false, required: false + public get timeUnit() { + return this.getStringAttribute('time_unit'); + } +} + +export class DataHuaweicloudApigApplicationQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApplicationQuotasQuotasOutputReference { + return new DataHuaweicloudApigApplicationQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas huaweicloud_apig_application_quotas} +*/ +export class DataHuaweicloudApigApplicationQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_application_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApplicationQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApplicationQuotas to import + * @param importFromId The id of the existing DataHuaweicloudApigApplicationQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApplicationQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_application_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_application_quotas huaweicloud_apig_application_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApplicationQuotasConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApplicationQuotasConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_application_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._quotaId = config.quotaId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // quota_id - computed: false, optional: true, required: false + private _quotaId?: string; + public get quotaId() { + return this.getStringAttribute('quota_id'); + } + public set quotaId(value: string) { + this._quotaId = value; + } + public resetQuotaId() { + this._quotaId = undefined; + } + // Temporarily expose input value. Use with caution. + public get quotaIdInput() { + return this._quotaId; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudApigApplicationQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + quota_id: cdktf.stringToTerraform(this._quotaId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quota_id: { + value: cdktf.stringToHclTerraform(this._quotaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/README.md new file mode 100644 index 00000000..c9109f5b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_applications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_applications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/index.ts new file mode 100644 index 00000000..c0596456 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-applications/index.ts @@ -0,0 +1,424 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigApplicationsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the key of the application to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#app_key DataHuaweicloudApigApplications#app_key} + */ + readonly appKey?: string; + /** + * Specifies the ID of the application to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#application_id DataHuaweicloudApigApplications#application_id} + */ + readonly applicationId?: string; + /** + * Specifies the creator of the application to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#created_by DataHuaweicloudApigApplications#created_by} + */ + readonly createdBy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#id DataHuaweicloudApigApplications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the applications belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#instance_id DataHuaweicloudApigApplications#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the application to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#name DataHuaweicloudApigApplications#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#region DataHuaweicloudApigApplications#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigApplicationsApplications { +} + +export function dataHuaweicloudApigApplicationsApplicationsToTerraform(struct?: DataHuaweicloudApigApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigApplicationsApplicationsToHclTerraform(struct?: DataHuaweicloudApigApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigApplicationsApplicationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigApplicationsApplications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigApplicationsApplications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_key - computed: true, optional: false, required: false + public get appKey() { + return this.getStringAttribute('app_key'); + } + + // app_secret - computed: true, optional: false, required: false + public get appSecret() { + return this.getStringAttribute('app_secret'); + } + + // app_type - computed: true, optional: false, required: false + public get appType() { + return this.getStringAttribute('app_type'); + } + + // bind_num - computed: true, optional: false, required: false + public get bindNum() { + return this.getNumberAttribute('bind_num'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudApigApplicationsApplicationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigApplicationsApplicationsOutputReference { + return new DataHuaweicloudApigApplicationsApplicationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications huaweicloud_apig_applications} +*/ +export class DataHuaweicloudApigApplications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_applications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigApplications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigApplications to import + * @param importFromId The id of the existing DataHuaweicloudApigApplications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigApplications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_applications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_applications huaweicloud_apig_applications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigApplicationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigApplicationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_applications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appKey = config.appKey; + this._applicationId = config.applicationId; + this._createdBy = config.createdBy; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_key - computed: false, optional: true, required: false + private _appKey?: string; + public get appKey() { + return this.getStringAttribute('app_key'); + } + public set appKey(value: string) { + this._appKey = value; + } + public resetAppKey() { + this._appKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get appKeyInput() { + return this._appKey; + } + + // application_id - computed: false, optional: true, required: false + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + public resetApplicationId() { + this._applicationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // applications - computed: true, optional: false, required: false + private _applications = new DataHuaweicloudApigApplicationsApplicationsList(this, "applications", false); + public get applications() { + return this._applications; + } + + // created_by - computed: false, optional: true, required: false + private _createdBy?: string; + public get createdBy() { + return this.getStringAttribute('created_by'); + } + public set createdBy(value: string) { + this._createdBy = value; + } + public resetCreatedBy() { + this._createdBy = undefined; + } + // Temporarily expose input value. Use with caution. + public get createdByInput() { + return this._createdBy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_key: cdktf.stringToTerraform(this._appKey), + application_id: cdktf.stringToTerraform(this._applicationId), + created_by: cdktf.stringToTerraform(this._createdBy), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_key: { + value: cdktf.stringToHclTerraform(this._appKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + created_by: { + value: cdktf.stringToHclTerraform(this._createdBy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/README.md new file mode 100644 index 00000000..419088d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_channels` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_channels`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/index.ts new file mode 100644 index 00000000..a84e7681 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-channels/index.ts @@ -0,0 +1,624 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigChannelsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the VPC channel ID of the to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#channel_id DataHuaweicloudApigChannels#channel_id} + */ + readonly channelId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#id DataHuaweicloudApigChannels#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the channels belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#instance_id DataHuaweicloudApigChannels#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the member group to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#member_group_id DataHuaweicloudApigChannels#member_group_id} + */ + readonly memberGroupId?: string; + /** + * Specifies the name of the member group to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#member_group_name DataHuaweicloudApigChannels#member_group_name} + */ + readonly memberGroupName?: string; + /** + * Specifies the name of the channel to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#name DataHuaweicloudApigChannels#name} + */ + readonly name?: string; + /** + * Specifies the parameter name for exact matching to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#precise_search DataHuaweicloudApigChannels#precise_search} + */ + readonly preciseSearch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#region DataHuaweicloudApigChannels#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabels { +} + +export function dataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsToTerraform(struct?: DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsToHclTerraform(struct?: DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsOutputReference { + return new DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigChannelsVpcChannelsMemberGroup { +} + +export function dataHuaweicloudApigChannelsVpcChannelsMemberGroupToTerraform(struct?: DataHuaweicloudApigChannelsVpcChannelsMemberGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigChannelsVpcChannelsMemberGroupToHclTerraform(struct?: DataHuaweicloudApigChannelsVpcChannelsMemberGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigChannelsVpcChannelsMemberGroupOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigChannelsVpcChannelsMemberGroup | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigChannelsVpcChannelsMemberGroup | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // microservice_labels - computed: true, optional: false, required: false + private _microserviceLabels = new DataHuaweicloudApigChannelsVpcChannelsMemberGroupMicroserviceLabelsList(this, "microservice_labels", false); + public get microserviceLabels() { + return this._microserviceLabels; + } + + // microservice_port - computed: true, optional: false, required: false + public get microservicePort() { + return this.getNumberAttribute('microservice_port'); + } + + // microservice_version - computed: true, optional: false, required: false + public get microserviceVersion() { + return this.getStringAttribute('microservice_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudApigChannelsVpcChannelsMemberGroupList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigChannelsVpcChannelsMemberGroupOutputReference { + return new DataHuaweicloudApigChannelsVpcChannelsMemberGroupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigChannelsVpcChannels { +} + +export function dataHuaweicloudApigChannelsVpcChannelsToTerraform(struct?: DataHuaweicloudApigChannelsVpcChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigChannelsVpcChannelsToHclTerraform(struct?: DataHuaweicloudApigChannelsVpcChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigChannelsVpcChannelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigChannelsVpcChannels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigChannelsVpcChannels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // balance_strategy - computed: true, optional: false, required: false + public get balanceStrategy() { + return this.getNumberAttribute('balance_strategy'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // member_group - computed: true, optional: false, required: false + private _memberGroup = new DataHuaweicloudApigChannelsVpcChannelsMemberGroupList(this, "member_group", false); + public get memberGroup() { + return this._memberGroup; + } + + // member_type - computed: true, optional: false, required: false + public get memberType() { + return this.getStringAttribute('member_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudApigChannelsVpcChannelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigChannelsVpcChannelsOutputReference { + return new DataHuaweicloudApigChannelsVpcChannelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels huaweicloud_apig_channels} +*/ +export class DataHuaweicloudApigChannels extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_channels"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigChannels resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigChannels to import + * @param importFromId The id of the existing DataHuaweicloudApigChannels that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigChannels to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_channels", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_channels huaweicloud_apig_channels} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigChannelsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigChannelsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_channels', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._channelId = config.channelId; + this._id = config.id; + this._instanceId = config.instanceId; + this._memberGroupId = config.memberGroupId; + this._memberGroupName = config.memberGroupName; + this._name = config.name; + this._preciseSearch = config.preciseSearch; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // channel_id - computed: false, optional: true, required: false + private _channelId?: string; + public get channelId() { + return this.getStringAttribute('channel_id'); + } + public set channelId(value: string) { + this._channelId = value; + } + public resetChannelId() { + this._channelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get channelIdInput() { + return this._channelId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // member_group_id - computed: false, optional: true, required: false + private _memberGroupId?: string; + public get memberGroupId() { + return this.getStringAttribute('member_group_id'); + } + public set memberGroupId(value: string) { + this._memberGroupId = value; + } + public resetMemberGroupId() { + this._memberGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberGroupIdInput() { + return this._memberGroupId; + } + + // member_group_name - computed: false, optional: true, required: false + private _memberGroupName?: string; + public get memberGroupName() { + return this.getStringAttribute('member_group_name'); + } + public set memberGroupName(value: string) { + this._memberGroupName = value; + } + public resetMemberGroupName() { + this._memberGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberGroupNameInput() { + return this._memberGroupName; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // precise_search - computed: false, optional: true, required: false + private _preciseSearch?: string; + public get preciseSearch() { + return this.getStringAttribute('precise_search'); + } + public set preciseSearch(value: string) { + this._preciseSearch = value; + } + public resetPreciseSearch() { + this._preciseSearch = undefined; + } + // Temporarily expose input value. Use with caution. + public get preciseSearchInput() { + return this._preciseSearch; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_channels - computed: true, optional: false, required: false + private _vpcChannels = new DataHuaweicloudApigChannelsVpcChannelsList(this, "vpc_channels", false); + public get vpcChannels() { + return this._vpcChannels; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + channel_id: cdktf.stringToTerraform(this._channelId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + member_group_id: cdktf.stringToTerraform(this._memberGroupId), + member_group_name: cdktf.stringToTerraform(this._memberGroupName), + name: cdktf.stringToTerraform(this._name), + precise_search: cdktf.stringToTerraform(this._preciseSearch), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + channel_id: { + value: cdktf.stringToHclTerraform(this._channelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_group_id: { + value: cdktf.stringToHclTerraform(this._memberGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_group_name: { + value: cdktf.stringToHclTerraform(this._memberGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + precise_search: { + value: cdktf.stringToHclTerraform(this._preciseSearch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/README.md new file mode 100644 index 00000000..3addf4bd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_custom_authorizers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_custom_authorizers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/index.ts new file mode 100644 index 00000000..decd3ad9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-custom-authorizers/index.ts @@ -0,0 +1,488 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigCustomAuthorizersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the custom authorizer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#authorizer_id DataHuaweicloudApigCustomAuthorizers#authorizer_id} + */ + readonly authorizerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#id DataHuaweicloudApigCustomAuthorizers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the custom authorizers belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#instance_id DataHuaweicloudApigCustomAuthorizers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the custom authorizer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#name DataHuaweicloudApigCustomAuthorizers#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#region DataHuaweicloudApigCustomAuthorizers#region} + */ + readonly region?: string; + /** + * Specifies the type of the custom authorizer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#type DataHuaweicloudApigCustomAuthorizers#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigCustomAuthorizersAuthorizersIdentity { +} + +export function dataHuaweicloudApigCustomAuthorizersAuthorizersIdentityToTerraform(struct?: DataHuaweicloudApigCustomAuthorizersAuthorizersIdentity): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigCustomAuthorizersAuthorizersIdentityToHclTerraform(struct?: DataHuaweicloudApigCustomAuthorizersAuthorizersIdentity): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigCustomAuthorizersAuthorizersIdentityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigCustomAuthorizersAuthorizersIdentity | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigCustomAuthorizersAuthorizersIdentity | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // validation - computed: true, optional: false, required: false + public get validation() { + return this.getStringAttribute('validation'); + } +} + +export class DataHuaweicloudApigCustomAuthorizersAuthorizersIdentityList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigCustomAuthorizersAuthorizersIdentityOutputReference { + return new DataHuaweicloudApigCustomAuthorizersAuthorizersIdentityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigCustomAuthorizersAuthorizers { +} + +export function dataHuaweicloudApigCustomAuthorizersAuthorizersToTerraform(struct?: DataHuaweicloudApigCustomAuthorizersAuthorizers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigCustomAuthorizersAuthorizersToHclTerraform(struct?: DataHuaweicloudApigCustomAuthorizersAuthorizers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigCustomAuthorizersAuthorizersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigCustomAuthorizersAuthorizers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigCustomAuthorizersAuthorizers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cache_age - computed: true, optional: false, required: false + public get cacheAge() { + return this.getNumberAttribute('cache_age'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // function_alias_uri - computed: true, optional: false, required: false + public get functionAliasUri() { + return this.getStringAttribute('function_alias_uri'); + } + + // function_type - computed: true, optional: false, required: false + public get functionType() { + return this.getStringAttribute('function_type'); + } + + // function_urn - computed: true, optional: false, required: false + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + + // function_version - computed: true, optional: false, required: false + public get functionVersion() { + return this.getStringAttribute('function_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // identity - computed: true, optional: false, required: false + private _identity = new DataHuaweicloudApigCustomAuthorizersAuthorizersIdentityList(this, "identity", false); + public get identity() { + return this._identity; + } + + // is_body_send - computed: true, optional: false, required: false + public get isBodySend() { + return this.getBooleanAttribute('is_body_send'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } +} + +export class DataHuaweicloudApigCustomAuthorizersAuthorizersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigCustomAuthorizersAuthorizersOutputReference { + return new DataHuaweicloudApigCustomAuthorizersAuthorizersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers huaweicloud_apig_custom_authorizers} +*/ +export class DataHuaweicloudApigCustomAuthorizers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_custom_authorizers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigCustomAuthorizers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigCustomAuthorizers to import + * @param importFromId The id of the existing DataHuaweicloudApigCustomAuthorizers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigCustomAuthorizers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_custom_authorizers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_custom_authorizers huaweicloud_apig_custom_authorizers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigCustomAuthorizersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigCustomAuthorizersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_custom_authorizers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authorizerId = config.authorizerId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // authorizer_id - computed: false, optional: true, required: false + private _authorizerId?: string; + public get authorizerId() { + return this.getStringAttribute('authorizer_id'); + } + public set authorizerId(value: string) { + this._authorizerId = value; + } + public resetAuthorizerId() { + this._authorizerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizerIdInput() { + return this._authorizerId; + } + + // authorizers - computed: true, optional: false, required: false + private _authorizers = new DataHuaweicloudApigCustomAuthorizersAuthorizersList(this, "authorizers", false); + public get authorizers() { + return this._authorizers; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + authorizer_id: cdktf.stringToTerraform(this._authorizerId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + authorizer_id: { + value: cdktf.stringToHclTerraform(this._authorizerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/README.md new file mode 100644 index 00000000..31859aaa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_endpoint_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_endpoint_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/index.ts new file mode 100644 index 00000000..7f154465 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-endpoint-connections/index.ts @@ -0,0 +1,369 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigEndpointConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the endpoint connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#endpoint_id DataHuaweicloudApigEndpointConnections#endpoint_id} + */ + readonly endpointId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#id DataHuaweicloudApigEndpointConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the dedicated instance ID to which the endpoint connections belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#instance_id DataHuaweicloudApigEndpointConnections#instance_id} + */ + readonly instanceId: string; + /** + * Specifies packet ID of endpoint connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#packet_id DataHuaweicloudApigEndpointConnections#packet_id} + */ + readonly packetId?: number; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#region DataHuaweicloudApigEndpointConnections#region} + */ + readonly region?: string; + /** + * Specifies status of endpoint connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#status DataHuaweicloudApigEndpointConnections#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudApigEndpointConnectionsConnections { +} + +export function dataHuaweicloudApigEndpointConnectionsConnectionsToTerraform(struct?: DataHuaweicloudApigEndpointConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigEndpointConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudApigEndpointConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigEndpointConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigEndpointConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigEndpointConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // packet_id - computed: true, optional: false, required: false + public get packetId() { + return this.getNumberAttribute('packet_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudApigEndpointConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigEndpointConnectionsConnectionsOutputReference { + return new DataHuaweicloudApigEndpointConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections huaweicloud_apig_endpoint_connections} +*/ +export class DataHuaweicloudApigEndpointConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_endpoint_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigEndpointConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigEndpointConnections to import + * @param importFromId The id of the existing DataHuaweicloudApigEndpointConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigEndpointConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_endpoint_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_endpoint_connections huaweicloud_apig_endpoint_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigEndpointConnectionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigEndpointConnectionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_endpoint_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointId = config.endpointId; + this._id = config.id; + this._instanceId = config.instanceId; + this._packetId = config.packetId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudApigEndpointConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // endpoint_id - computed: false, optional: true, required: false + private _endpointId?: string; + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + public set endpointId(value: string) { + this._endpointId = value; + } + public resetEndpointId() { + this._endpointId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointIdInput() { + return this._endpointId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // packet_id - computed: false, optional: true, required: false + private _packetId?: number; + public get packetId() { + return this.getNumberAttribute('packet_id'); + } + public set packetId(value: number) { + this._packetId = value; + } + public resetPacketId() { + this._packetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get packetIdInput() { + return this._packetId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_id: cdktf.stringToTerraform(this._endpointId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + packet_id: cdktf.numberToTerraform(this._packetId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_id: { + value: cdktf.stringToHclTerraform(this._endpointId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + packet_id: { + value: cdktf.numberToHclTerraform(this._packetId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/README.md new file mode 100644 index 00000000..904d2047 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_environment_variables` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_environment_variables`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/index.ts new file mode 100644 index 00000000..826b9a08 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environment-variables/index.ts @@ -0,0 +1,361 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigEnvironmentVariablesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the environment to which the environment variables belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#env_id DataHuaweicloudApigEnvironmentVariables#env_id} + */ + readonly envId?: string; + /** + * Specifies the ID of the group to which the environment variables belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#group_id DataHuaweicloudApigEnvironmentVariables#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#id DataHuaweicloudApigEnvironmentVariables#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the environment variables belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#instance_id DataHuaweicloudApigEnvironmentVariables#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the environment variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#name DataHuaweicloudApigEnvironmentVariables#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#region DataHuaweicloudApigEnvironmentVariables#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigEnvironmentVariablesVariables { +} + +export function dataHuaweicloudApigEnvironmentVariablesVariablesToTerraform(struct?: DataHuaweicloudApigEnvironmentVariablesVariables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigEnvironmentVariablesVariablesToHclTerraform(struct?: DataHuaweicloudApigEnvironmentVariablesVariables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigEnvironmentVariablesVariablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigEnvironmentVariablesVariables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigEnvironmentVariablesVariables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // env_id - computed: true, optional: false, required: false + public get envId() { + return this.getStringAttribute('env_id'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigEnvironmentVariablesVariablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigEnvironmentVariablesVariablesOutputReference { + return new DataHuaweicloudApigEnvironmentVariablesVariablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables huaweicloud_apig_environment_variables} +*/ +export class DataHuaweicloudApigEnvironmentVariables extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_environment_variables"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigEnvironmentVariables resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigEnvironmentVariables to import + * @param importFromId The id of the existing DataHuaweicloudApigEnvironmentVariables that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigEnvironmentVariables to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_environment_variables", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environment_variables huaweicloud_apig_environment_variables} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigEnvironmentVariablesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigEnvironmentVariablesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_environment_variables', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._envId = config.envId; + this._groupId = config.groupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // env_id - computed: false, optional: true, required: false + private _envId?: string; + public get envId() { + return this.getStringAttribute('env_id'); + } + public set envId(value: string) { + this._envId = value; + } + public resetEnvId() { + this._envId = undefined; + } + // Temporarily expose input value. Use with caution. + public get envIdInput() { + return this._envId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // variables - computed: true, optional: false, required: false + private _variables = new DataHuaweicloudApigEnvironmentVariablesVariablesList(this, "variables", false); + public get variables() { + return this._variables; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + env_id: cdktf.stringToTerraform(this._envId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + env_id: { + value: cdktf.stringToHclTerraform(this._envId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/README.md new file mode 100644 index 00000000..bfc5f04c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_environments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_environments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/index.ts new file mode 100644 index 00000000..da15746f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-environments/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigEnvironmentsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments#id DataHuaweicloudApigEnvironments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments#instance_id DataHuaweicloudApigEnvironments#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments#name DataHuaweicloudApigEnvironments#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments#region DataHuaweicloudApigEnvironments#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigEnvironmentsEnvironments { +} + +export function dataHuaweicloudApigEnvironmentsEnvironmentsToTerraform(struct?: DataHuaweicloudApigEnvironmentsEnvironments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigEnvironmentsEnvironmentsToHclTerraform(struct?: DataHuaweicloudApigEnvironmentsEnvironments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigEnvironmentsEnvironmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigEnvironmentsEnvironments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigEnvironmentsEnvironments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudApigEnvironmentsEnvironmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigEnvironmentsEnvironmentsOutputReference { + return new DataHuaweicloudApigEnvironmentsEnvironmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments huaweicloud_apig_environments} +*/ +export class DataHuaweicloudApigEnvironments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_environments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigEnvironments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigEnvironments to import + * @param importFromId The id of the existing DataHuaweicloudApigEnvironments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigEnvironments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_environments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_environments huaweicloud_apig_environments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigEnvironmentsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigEnvironmentsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_environments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // environments - computed: true, optional: false, required: false + private _environments = new DataHuaweicloudApigEnvironmentsEnvironmentsList(this, "environments", false); + public get environments() { + return this._environments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/README.md new file mode 100644 index 00000000..0a9b7435 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/index.ts new file mode 100644 index 00000000..939e4b65 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-groups/index.ts @@ -0,0 +1,639 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups#group_id DataHuaweicloudApigGroups#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups#id DataHuaweicloudApigGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups#instance_id DataHuaweicloudApigGroups#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups#name DataHuaweicloudApigGroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups#region DataHuaweicloudApigGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigGroupsGroupsEnvironmentVariable { +} + +export function dataHuaweicloudApigGroupsGroupsEnvironmentVariableToTerraform(struct?: DataHuaweicloudApigGroupsGroupsEnvironmentVariable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigGroupsGroupsEnvironmentVariableToHclTerraform(struct?: DataHuaweicloudApigGroupsGroupsEnvironmentVariable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigGroupsGroupsEnvironmentVariableOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigGroupsGroupsEnvironmentVariable | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigGroupsGroupsEnvironmentVariable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudApigGroupsGroupsEnvironmentVariableList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigGroupsGroupsEnvironmentVariableOutputReference { + return new DataHuaweicloudApigGroupsGroupsEnvironmentVariableOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigGroupsGroupsEnvironment { +} + +export function dataHuaweicloudApigGroupsGroupsEnvironmentToTerraform(struct?: DataHuaweicloudApigGroupsGroupsEnvironment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigGroupsGroupsEnvironmentToHclTerraform(struct?: DataHuaweicloudApigGroupsGroupsEnvironment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigGroupsGroupsEnvironmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigGroupsGroupsEnvironment | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigGroupsGroupsEnvironment | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // environment_id - computed: true, optional: false, required: false + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + + // variable - computed: true, optional: false, required: false + private _variable = new DataHuaweicloudApigGroupsGroupsEnvironmentVariableList(this, "variable", true); + public get variable() { + return this._variable; + } +} + +export class DataHuaweicloudApigGroupsGroupsEnvironmentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigGroupsGroupsEnvironmentOutputReference { + return new DataHuaweicloudApigGroupsGroupsEnvironmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigGroupsGroupsUrlDomains { +} + +export function dataHuaweicloudApigGroupsGroupsUrlDomainsToTerraform(struct?: DataHuaweicloudApigGroupsGroupsUrlDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigGroupsGroupsUrlDomainsToHclTerraform(struct?: DataHuaweicloudApigGroupsGroupsUrlDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigGroupsGroupsUrlDomainsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigGroupsGroupsUrlDomains | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigGroupsGroupsUrlDomains | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cname_status - computed: true, optional: false, required: false + public get cnameStatus() { + return this.getNumberAttribute('cname_status'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_has_trusted_root_ca - computed: true, optional: false, required: false + public get isHasTrustedRootCa() { + return this.getBooleanAttribute('is_has_trusted_root_ca'); + } + + // min_ssl_version - computed: true, optional: false, required: false + public get minSslVersion() { + return this.getStringAttribute('min_ssl_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // ssl_id - computed: true, optional: false, required: false + public get sslId() { + return this.getStringAttribute('ssl_id'); + } + + // ssl_name - computed: true, optional: false, required: false + public get sslName() { + return this.getStringAttribute('ssl_name'); + } + + // verified_client_certificate_enabled - computed: true, optional: false, required: false + public get verifiedClientCertificateEnabled() { + return this.getBooleanAttribute('verified_client_certificate_enabled'); + } +} + +export class DataHuaweicloudApigGroupsGroupsUrlDomainsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigGroupsGroupsUrlDomainsOutputReference { + return new DataHuaweicloudApigGroupsGroupsUrlDomainsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigGroupsGroups { +} + +export function dataHuaweicloudApigGroupsGroupsToTerraform(struct?: DataHuaweicloudApigGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigGroupsGroupsToHclTerraform(struct?: DataHuaweicloudApigGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // environment - computed: true, optional: false, required: false + private _environment = new DataHuaweicloudApigGroupsGroupsEnvironmentList(this, "environment", true); + public get environment() { + return this._environment; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_default - computed: true, optional: false, required: false + public get isDefault() { + return this.getNumberAttribute('is_default'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // on_sell_status - computed: true, optional: false, required: false + public get onSellStatus() { + return this.getNumberAttribute('on_sell_status'); + } + + // sl_domain - computed: true, optional: false, required: false + public get slDomain() { + return this.getStringAttribute('sl_domain'); + } + + // sl_domains - computed: true, optional: false, required: false + public get slDomains() { + return this.getListAttribute('sl_domains'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // url_domains - computed: true, optional: false, required: false + private _urlDomains = new DataHuaweicloudApigGroupsGroupsUrlDomainsList(this, "url_domains", false); + public get urlDomains() { + return this._urlDomains; + } +} + +export class DataHuaweicloudApigGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigGroupsGroupsOutputReference { + return new DataHuaweicloudApigGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups huaweicloud_apig_groups} +*/ +export class DataHuaweicloudApigGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigGroups to import + * @param importFromId The id of the existing DataHuaweicloudApigGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_groups huaweicloud_apig_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupId = config.groupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudApigGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/README.md new file mode 100644 index 00000000..5471f0b3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_instance_features` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_instance_features`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/index.ts new file mode 100644 index 00000000..947335c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-features/index.ts @@ -0,0 +1,302 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigInstanceFeaturesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features#id DataHuaweicloudApigInstanceFeatures#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specified the ID of the dedicated instance to which the features belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features#instance_id DataHuaweicloudApigInstanceFeatures#instance_id} + */ + readonly instanceId: string; + /** + * Specified the name of the feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features#name DataHuaweicloudApigInstanceFeatures#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features#region DataHuaweicloudApigInstanceFeatures#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudApigInstanceFeaturesFeatures { +} + +export function dataHuaweicloudApigInstanceFeaturesFeaturesToTerraform(struct?: DataHuaweicloudApigInstanceFeaturesFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigInstanceFeaturesFeaturesToHclTerraform(struct?: DataHuaweicloudApigInstanceFeaturesFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigInstanceFeaturesFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigInstanceFeaturesFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigInstanceFeaturesFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // config - computed: true, optional: false, required: false + public get config() { + return this.getStringAttribute('config'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudApigInstanceFeaturesFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigInstanceFeaturesFeaturesOutputReference { + return new DataHuaweicloudApigInstanceFeaturesFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features huaweicloud_apig_instance_features} +*/ +export class DataHuaweicloudApigInstanceFeatures extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_instance_features"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigInstanceFeatures resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigInstanceFeatures to import + * @param importFromId The id of the existing DataHuaweicloudApigInstanceFeatures that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigInstanceFeatures to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_instance_features", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_features huaweicloud_apig_instance_features} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigInstanceFeaturesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigInstanceFeaturesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_instance_features', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // features - computed: true, optional: false, required: false + private _features = new DataHuaweicloudApigInstanceFeaturesFeaturesList(this, "features", false); + public get features() { + return this._features; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/README.md new file mode 100644 index 00000000..2381f4cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_instance_supported_features` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_instance_supported_features`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/index.ts new file mode 100644 index 00000000..5518440f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instance-supported-features/index.ts @@ -0,0 +1,176 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigInstanceSupportedFeaturesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features#id DataHuaweicloudApigInstanceSupportedFeatures#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the dedicated instance to which the features belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features#instance_id DataHuaweicloudApigInstanceSupportedFeatures#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features#region DataHuaweicloudApigInstanceSupportedFeatures#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features huaweicloud_apig_instance_supported_features} +*/ +export class DataHuaweicloudApigInstanceSupportedFeatures extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_instance_supported_features"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigInstanceSupportedFeatures resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigInstanceSupportedFeatures to import + * @param importFromId The id of the existing DataHuaweicloudApigInstanceSupportedFeatures that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigInstanceSupportedFeatures to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_instance_supported_features", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instance_supported_features huaweicloud_apig_instance_supported_features} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigInstanceSupportedFeaturesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigInstanceSupportedFeaturesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_instance_supported_features', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // features - computed: true, optional: false, required: false + public get features() { + return this.getListAttribute('features'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/README.md new file mode 100644 index 00000000..0cbe24f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/index.ts new file mode 100644 index 00000000..1bd2dc79 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-instances/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the enterprise project to which the instances belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#enterprise_project_id DataHuaweicloudApigInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#id DataHuaweicloudApigInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#instance_id DataHuaweicloudApigInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the name of the instance to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#name DataHuaweicloudApigInstances#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#region DataHuaweicloudApigInstances#region} + */ + readonly region?: string; + /** + * Specifies the status of the instance to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#status DataHuaweicloudApigInstances#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudApigInstancesInstances { +} + +export function dataHuaweicloudApigInstancesInstancesToTerraform(struct?: DataHuaweicloudApigInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigInstancesInstancesToHclTerraform(struct?: DataHuaweicloudApigInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // edition - computed: true, optional: false, required: false + public get edition() { + return this.getStringAttribute('edition'); + } + + // eip_address - computed: true, optional: false, required: false + public get eipAddress() { + return this.getStringAttribute('eip_address'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // loadbalancer_provider - computed: true, optional: false, required: false + public get loadbalancerProvider() { + return this.getStringAttribute('loadbalancer_provider'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudApigInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigInstancesInstancesOutputReference { + return new DataHuaweicloudApigInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances huaweicloud_apig_instances} +*/ +export class DataHuaweicloudApigInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigInstances to import + * @param importFromId The id of the existing DataHuaweicloudApigInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_instances huaweicloud_apig_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudApigInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/README.md new file mode 100644 index 00000000..a76da5ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_signatures` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_signatures`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/index.ts new file mode 100644 index 00000000..77ffaa9e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-signatures/index.ts @@ -0,0 +1,412 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigSignaturesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the algorithm of the signature to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#algorithm DataHuaweicloudApigSignatures#algorithm} + */ + readonly algorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#id DataHuaweicloudApigSignatures#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the signatrues belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#instance_id DataHuaweicloudApigSignatures#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of signature to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#name DataHuaweicloudApigSignatures#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#region DataHuaweicloudApigSignatures#region} + */ + readonly region?: string; + /** + * Specifies the ID of signature to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#signature_id DataHuaweicloudApigSignatures#signature_id} + */ + readonly signatureId?: string; + /** + * Specifies the type of signature to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#type DataHuaweicloudApigSignatures#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigSignaturesSignatures { +} + +export function dataHuaweicloudApigSignaturesSignaturesToTerraform(struct?: DataHuaweicloudApigSignaturesSignatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigSignaturesSignaturesToHclTerraform(struct?: DataHuaweicloudApigSignaturesSignatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigSignaturesSignaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigSignaturesSignatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigSignaturesSignatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // algorithm - computed: true, optional: false, required: false + public get algorithm() { + return this.getStringAttribute('algorithm'); + } + + // bind_num - computed: true, optional: false, required: false + public get bindNum() { + return this.getNumberAttribute('bind_num'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // secret - computed: true, optional: false, required: false + public get secret() { + return this.getStringAttribute('secret'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudApigSignaturesSignaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigSignaturesSignaturesOutputReference { + return new DataHuaweicloudApigSignaturesSignaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures huaweicloud_apig_signatures} +*/ +export class DataHuaweicloudApigSignatures extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_signatures"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigSignatures resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigSignatures to import + * @param importFromId The id of the existing DataHuaweicloudApigSignatures that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigSignatures to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_signatures", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_signatures huaweicloud_apig_signatures} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigSignaturesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigSignaturesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_signatures', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._algorithm = config.algorithm; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._signatureId = config.signatureId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // algorithm - computed: false, optional: true, required: false + private _algorithm?: string; + public get algorithm() { + return this.getStringAttribute('algorithm'); + } + public set algorithm(value: string) { + this._algorithm = value; + } + public resetAlgorithm() { + this._algorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get algorithmInput() { + return this._algorithm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // signature_id - computed: false, optional: true, required: false + private _signatureId?: string; + public get signatureId() { + return this.getStringAttribute('signature_id'); + } + public set signatureId(value: string) { + this._signatureId = value; + } + public resetSignatureId() { + this._signatureId = undefined; + } + // Temporarily expose input value. Use with caution. + public get signatureIdInput() { + return this._signatureId; + } + + // signatures - computed: true, optional: false, required: false + private _signatures = new DataHuaweicloudApigSignaturesSignaturesList(this, "signatures", false); + public get signatures() { + return this._signatures; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + algorithm: cdktf.stringToTerraform(this._algorithm), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + signature_id: cdktf.stringToTerraform(this._signatureId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + algorithm: { + value: cdktf.stringToHclTerraform(this._algorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + signature_id: { + value: cdktf.stringToHclTerraform(this._signatureId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/README.md new file mode 100644 index 00000000..2c43899d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_apig_throttling_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_apig_throttling_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/index.ts new file mode 100644 index 00000000..0e3fa3e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-apig-throttling-policies/index.ts @@ -0,0 +1,589 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudApigThrottlingPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#id DataHuaweicloudApigThrottlingPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the dedicated instance to which the throttling policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#instance_id DataHuaweicloudApigThrottlingPolicies#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#name DataHuaweicloudApigThrottlingPolicies#name} + */ + readonly name?: string; + /** + * Specifies the ID of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#policy_id DataHuaweicloudApigThrottlingPolicies#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#region DataHuaweicloudApigThrottlingPolicies#region} + */ + readonly region?: string; + /** + * The type of the throttling policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#type DataHuaweicloudApigThrottlingPolicies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottles { +} + +export function dataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesToTerraform(struct?: DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesToHclTerraform(struct?: DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: true, optional: false, required: false + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + + // throttling_object_id - computed: true, optional: false, required: false + public get throttlingObjectId() { + return this.getStringAttribute('throttling_object_id'); + } + + // throttling_object_name - computed: true, optional: false, required: false + public get throttlingObjectName() { + return this.getStringAttribute('throttling_object_name'); + } +} + +export class DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesOutputReference { + return new DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottles { +} + +export function dataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesToTerraform(struct?: DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesToHclTerraform(struct?: DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: true, optional: false, required: false + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + + // throttling_object_id - computed: true, optional: false, required: false + public get throttlingObjectId() { + return this.getStringAttribute('throttling_object_id'); + } + + // throttling_object_name - computed: true, optional: false, required: false + public get throttlingObjectName() { + return this.getStringAttribute('throttling_object_name'); + } +} + +export class DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesOutputReference { + return new DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudApigThrottlingPoliciesPolicies { +} + +export function dataHuaweicloudApigThrottlingPoliciesPoliciesToTerraform(struct?: DataHuaweicloudApigThrottlingPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudApigThrottlingPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudApigThrottlingPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudApigThrottlingPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudApigThrottlingPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudApigThrottlingPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_throttles - computed: true, optional: false, required: false + private _appThrottles = new DataHuaweicloudApigThrottlingPoliciesPoliciesAppThrottlesList(this, "app_throttles", false); + public get appThrottles() { + return this._appThrottles; + } + + // bind_num - computed: true, optional: false, required: false + public get bindNum() { + return this.getNumberAttribute('bind_num'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_api_requests - computed: true, optional: false, required: false + public get maxApiRequests() { + return this.getNumberAttribute('max_api_requests'); + } + + // max_app_requests - computed: true, optional: false, required: false + public get maxAppRequests() { + return this.getNumberAttribute('max_app_requests'); + } + + // max_ip_requests - computed: true, optional: false, required: false + public get maxIpRequests() { + return this.getNumberAttribute('max_ip_requests'); + } + + // max_user_requests - computed: true, optional: false, required: false + public get maxUserRequests() { + return this.getNumberAttribute('max_user_requests'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getNumberAttribute('period'); + } + + // period_unit - computed: true, optional: false, required: false + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // user_throttles - computed: true, optional: false, required: false + private _userThrottles = new DataHuaweicloudApigThrottlingPoliciesPoliciesUserThrottlesList(this, "user_throttles", false); + public get userThrottles() { + return this._userThrottles; + } +} + +export class DataHuaweicloudApigThrottlingPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudApigThrottlingPoliciesPoliciesOutputReference { + return new DataHuaweicloudApigThrottlingPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies huaweicloud_apig_throttling_policies} +*/ +export class DataHuaweicloudApigThrottlingPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_apig_throttling_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudApigThrottlingPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudApigThrottlingPolicies to import + * @param importFromId The id of the existing DataHuaweicloudApigThrottlingPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudApigThrottlingPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_apig_throttling_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/apig_throttling_policies huaweicloud_apig_throttling_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudApigThrottlingPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudApigThrottlingPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_apig_throttling_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudApigThrottlingPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/README.md new file mode 100644 index 00000000..bcf24e58 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_activity_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_activity_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/index.ts new file mode 100644 index 00000000..6afee1a6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-activity-logs/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsActivityLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#end_time DataHuaweicloudAsActivityLogs#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#id DataHuaweicloudAsActivityLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#region DataHuaweicloudAsActivityLogs#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#scaling_group_id DataHuaweicloudAsActivityLogs#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#start_time DataHuaweicloudAsActivityLogs#start_time} + */ + readonly startTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#status DataHuaweicloudAsActivityLogs#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudAsActivityLogsActivityLogs { +} + +export function dataHuaweicloudAsActivityLogsActivityLogsToTerraform(struct?: DataHuaweicloudAsActivityLogsActivityLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsActivityLogsActivityLogsToHclTerraform(struct?: DataHuaweicloudAsActivityLogsActivityLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsActivityLogsActivityLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsActivityLogsActivityLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsActivityLogsActivityLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // added_instances - computed: true, optional: false, required: false + public get addedInstances() { + return this.getStringAttribute('added_instances'); + } + + // changes_instance_number - computed: true, optional: false, required: false + public get changesInstanceNumber() { + return this.getNumberAttribute('changes_instance_number'); + } + + // current_instance_number - computed: true, optional: false, required: false + public get currentInstanceNumber() { + return this.getNumberAttribute('current_instance_number'); + } + + // deleted_instances - computed: true, optional: false, required: false + public get deletedInstances() { + return this.getStringAttribute('deleted_instances'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // desire_instance_number - computed: true, optional: false, required: false + public get desireInstanceNumber() { + return this.getNumberAttribute('desire_instance_number'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // removed_instances - computed: true, optional: false, required: false + public get removedInstances() { + return this.getStringAttribute('removed_instances'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudAsActivityLogsActivityLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsActivityLogsActivityLogsOutputReference { + return new DataHuaweicloudAsActivityLogsActivityLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs huaweicloud_as_activity_logs} +*/ +export class DataHuaweicloudAsActivityLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_activity_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsActivityLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsActivityLogs to import + * @param importFromId The id of the existing DataHuaweicloudAsActivityLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsActivityLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_activity_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_activity_logs huaweicloud_as_activity_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsActivityLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsActivityLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_activity_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._startTime = config.startTime; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // activity_logs - computed: true, optional: false, required: false + private _activityLogs = new DataHuaweicloudAsActivityLogsActivityLogsList(this, "activity_logs", false); + public get activityLogs() { + return this._activityLogs; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/README.md new file mode 100644 index 00000000..17f18b75 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_configurations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_configurations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/index.ts new file mode 100644 index 00000000..83e8acc9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-configurations/index.ts @@ -0,0 +1,849 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsConfigurationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations#id DataHuaweicloudAsConfigurations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The AS image id used to query configuration list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations#image_id DataHuaweicloudAsConfigurations#image_id} + */ + readonly imageId?: string; + /** + * The AS configuration name used to query configuration list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations#name DataHuaweicloudAsConfigurations#name} + */ + readonly name?: string; + /** + * The region where the AS configurations are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations#region DataHuaweicloudAsConfigurations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDisk { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDisk): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDisk): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDisk | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDisk | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // disk_type - computed: true, optional: false, required: false + public get diskType() { + return this.getStringAttribute('disk_type'); + } + + // kms_id - computed: true, optional: false, required: false + public get kmsId() { + return this.getStringAttribute('kms_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volume_type - computed: true, optional: false, required: false + public get volumeType() { + return this.getStringAttribute('volume_type'); + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonality { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonality): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonality): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonality | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonality | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidth { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEip { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + private _bandwidth = new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipBandwidthList(this, "bandwidth", false); + public get bandwidth() { + return this._bandwidth; + } + + // ip_type - computed: true, optional: false, required: false + public get ipType() { + return this.getStringAttribute('ip_type'); + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIp { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // eip - computed: true, optional: false, required: false + private _eip = new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpEipList(this, "eip", false); + public get eip() { + return this._eip; + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsConfigurationsConfigurationsInstanceConfig { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsInstanceConfigToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurationsInstanceConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // disk - computed: true, optional: false, required: false + private _disk = new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigDiskList(this, "disk", false); + public get disk() { + return this._disk; + } + + // ecs_group_id - computed: true, optional: false, required: false + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // flavor_priority_policy - computed: true, optional: false, required: false + public get flavorPriorityPolicy() { + return this.getStringAttribute('flavor_priority_policy'); + } + + // image - computed: true, optional: false, required: false + public get image() { + return this.getStringAttribute('image'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // key_name - computed: true, optional: false, required: false + public get keyName() { + return this.getStringAttribute('key_name'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // personality - computed: true, optional: false, required: false + private _personality = new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPersonalityList(this, "personality", false); + public get personality() { + return this._personality; + } + + // public_ip - computed: true, optional: false, required: false + private _publicIp = new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigPublicIpList(this, "public_ip", false); + public get publicIp() { + return this._publicIp; + } + + // security_group_ids - computed: true, optional: false, required: false + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsConfigurationsConfigurations { +} + +export function dataHuaweicloudAsConfigurationsConfigurationsToTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsConfigurationsConfigurationsToHclTerraform(struct?: DataHuaweicloudAsConfigurationsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsConfigurationsConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsConfigurationsConfigurations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsConfigurationsConfigurations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // instance_config - computed: true, optional: false, required: false + private _instanceConfig = new DataHuaweicloudAsConfigurationsConfigurationsInstanceConfigList(this, "instance_config", false); + public get instanceConfig() { + return this._instanceConfig; + } + + // scaling_configuration_name - computed: true, optional: false, required: false + public get scalingConfigurationName() { + return this.getStringAttribute('scaling_configuration_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudAsConfigurationsConfigurationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsConfigurationsConfigurationsOutputReference { + return new DataHuaweicloudAsConfigurationsConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations huaweicloud_as_configurations} +*/ +export class DataHuaweicloudAsConfigurations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_configurations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsConfigurations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsConfigurations to import + * @param importFromId The id of the existing DataHuaweicloudAsConfigurations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsConfigurations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_configurations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_configurations huaweicloud_as_configurations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsConfigurationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsConfigurationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_configurations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._imageId = config.imageId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configurations - computed: true, optional: false, required: false + private _configurations = new DataHuaweicloudAsConfigurationsConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/README.md new file mode 100644 index 00000000..0cec1811 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_group_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_group_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/index.ts new file mode 100644 index 00000000..05a667ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-group-quotas/index.ts @@ -0,0 +1,350 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsGroupQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas#id DataHuaweicloudAsGroupQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas#region DataHuaweicloudAsGroupQuotas#region} + */ + readonly region?: string; + /** + * Specifies the AS group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas#scaling_group_id DataHuaweicloudAsGroupQuotas#scaling_group_id} + */ + readonly scalingGroupId: string; +} +export interface DataHuaweicloudAsGroupQuotasQuotasResources { +} + +export function dataHuaweicloudAsGroupQuotasQuotasResourcesToTerraform(struct?: DataHuaweicloudAsGroupQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsGroupQuotasQuotasResourcesToHclTerraform(struct?: DataHuaweicloudAsGroupQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsGroupQuotasQuotasResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsGroupQuotasQuotasResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsGroupQuotasQuotasResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max - computed: true, optional: false, required: false + public get max() { + return this.getNumberAttribute('max'); + } + + // min - computed: true, optional: false, required: false + public get min() { + return this.getNumberAttribute('min'); + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudAsGroupQuotasQuotasResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsGroupQuotasQuotasResourcesOutputReference { + return new DataHuaweicloudAsGroupQuotasQuotasResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsGroupQuotasQuotas { +} + +export function dataHuaweicloudAsGroupQuotasQuotasToTerraform(struct?: DataHuaweicloudAsGroupQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsGroupQuotasQuotasToHclTerraform(struct?: DataHuaweicloudAsGroupQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsGroupQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsGroupQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsGroupQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudAsGroupQuotasQuotasResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudAsGroupQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsGroupQuotasQuotasOutputReference { + return new DataHuaweicloudAsGroupQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas huaweicloud_as_group_quotas} +*/ +export class DataHuaweicloudAsGroupQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_group_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsGroupQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsGroupQuotas to import + * @param importFromId The id of the existing DataHuaweicloudAsGroupQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsGroupQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_group_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_group_quotas huaweicloud_as_group_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsGroupQuotasConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsGroupQuotasConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_group_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudAsGroupQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/README.md new file mode 100644 index 00000000..a2afa965 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/index.ts new file mode 100644 index 00000000..bc3e844f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-groups/index.ts @@ -0,0 +1,751 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * The Enterprise Project id used to query group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#enterprise_project_id DataHuaweicloudAsGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#id DataHuaweicloudAsGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The AS group name used to query group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#name DataHuaweicloudAsGroups#name} + */ + readonly name?: string; + /** + * The region where the AS groups are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#region DataHuaweicloudAsGroups#region} + */ + readonly region?: string; + /** + * The AS group configuration id used to query group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#scaling_configuration_id DataHuaweicloudAsGroups#scaling_configuration_id} + */ + readonly scalingConfigurationId?: string; + /** + * The AS group status used to query group list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#status DataHuaweicloudAsGroups#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudAsGroupsGroupsLbaasListeners { +} + +export function dataHuaweicloudAsGroupsGroupsLbaasListenersToTerraform(struct?: DataHuaweicloudAsGroupsGroupsLbaasListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsGroupsGroupsLbaasListenersToHclTerraform(struct?: DataHuaweicloudAsGroupsGroupsLbaasListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsGroupsGroupsLbaasListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsGroupsGroupsLbaasListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsGroupsGroupsLbaasListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // pool_id - computed: true, optional: false, required: false + public get poolId() { + return this.getStringAttribute('pool_id'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudAsGroupsGroupsLbaasListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsGroupsGroupsLbaasListenersOutputReference { + return new DataHuaweicloudAsGroupsGroupsLbaasListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsGroupsGroupsNetworks { +} + +export function dataHuaweicloudAsGroupsGroupsNetworksToTerraform(struct?: DataHuaweicloudAsGroupsGroupsNetworks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsGroupsGroupsNetworksToHclTerraform(struct?: DataHuaweicloudAsGroupsGroupsNetworks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsGroupsGroupsNetworksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsGroupsGroupsNetworks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsGroupsGroupsNetworks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv6_bandwidth_id - computed: true, optional: false, required: false + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // source_dest_check - computed: true, optional: false, required: false + public get sourceDestCheck() { + return this.getBooleanAttribute('source_dest_check'); + } +} + +export class DataHuaweicloudAsGroupsGroupsNetworksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsGroupsGroupsNetworksOutputReference { + return new DataHuaweicloudAsGroupsGroupsNetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsGroupsGroupsSecurityGroups { +} + +export function dataHuaweicloudAsGroupsGroupsSecurityGroupsToTerraform(struct?: DataHuaweicloudAsGroupsGroupsSecurityGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsGroupsGroupsSecurityGroupsToHclTerraform(struct?: DataHuaweicloudAsGroupsGroupsSecurityGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsGroupsGroupsSecurityGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsGroupsGroupsSecurityGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsGroupsGroupsSecurityGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudAsGroupsGroupsSecurityGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsGroupsGroupsSecurityGroupsOutputReference { + return new DataHuaweicloudAsGroupsGroupsSecurityGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsGroupsGroups { +} + +export function dataHuaweicloudAsGroupsGroupsToTerraform(struct?: DataHuaweicloudAsGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsGroupsGroupsToHclTerraform(struct?: DataHuaweicloudAsGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // activity_type - computed: true, optional: false, required: false + public get activityType() { + return this.getStringAttribute('activity_type'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // cool_down_time - computed: true, optional: false, required: false + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_instance_number - computed: true, optional: false, required: false + public get currentInstanceNumber() { + return this.getNumberAttribute('current_instance_number'); + } + + // delete_publicip - computed: true, optional: false, required: false + public get deletePublicip() { + return this.getBooleanAttribute('delete_publicip'); + } + + // delete_volume - computed: true, optional: false, required: false + public get deleteVolume() { + return this.getBooleanAttribute('delete_volume'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // desire_instance_number - computed: true, optional: false, required: false + public get desireInstanceNumber() { + return this.getNumberAttribute('desire_instance_number'); + } + + // detail - computed: true, optional: false, required: false + public get detail() { + return this.getStringAttribute('detail'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // health_periodic_audit_grace_period - computed: true, optional: false, required: false + public get healthPeriodicAuditGracePeriod() { + return this.getNumberAttribute('health_periodic_audit_grace_period'); + } + + // health_periodic_audit_method - computed: true, optional: false, required: false + public get healthPeriodicAuditMethod() { + return this.getStringAttribute('health_periodic_audit_method'); + } + + // health_periodic_audit_time - computed: true, optional: false, required: false + public get healthPeriodicAuditTime() { + return this.getNumberAttribute('health_periodic_audit_time'); + } + + // iam_agency_name - computed: true, optional: false, required: false + public get iamAgencyName() { + return this.getStringAttribute('iam_agency_name'); + } + + // instance_terminate_policy - computed: true, optional: false, required: false + public get instanceTerminatePolicy() { + return this.getStringAttribute('instance_terminate_policy'); + } + + // instances - computed: true, optional: false, required: false + public get instances() { + return this.getListAttribute('instances'); + } + + // is_scaling - computed: true, optional: false, required: false + public get isScaling() { + return this.getBooleanAttribute('is_scaling'); + } + + // lbaas_listeners - computed: true, optional: false, required: false + private _lbaasListeners = new DataHuaweicloudAsGroupsGroupsLbaasListenersList(this, "lbaas_listeners", false); + public get lbaasListeners() { + return this._lbaasListeners; + } + + // max_instance_number - computed: true, optional: false, required: false + public get maxInstanceNumber() { + return this.getNumberAttribute('max_instance_number'); + } + + // min_instance_number - computed: true, optional: false, required: false + public get minInstanceNumber() { + return this.getNumberAttribute('min_instance_number'); + } + + // multi_az_scaling_policy - computed: true, optional: false, required: false + public get multiAzScalingPolicy() { + return this.getStringAttribute('multi_az_scaling_policy'); + } + + // networks - computed: true, optional: false, required: false + private _networks = new DataHuaweicloudAsGroupsGroupsNetworksList(this, "networks", false); + public get networks() { + return this._networks; + } + + // scaling_configuration_id - computed: true, optional: false, required: false + public get scalingConfigurationId() { + return this.getStringAttribute('scaling_configuration_id'); + } + + // scaling_configuration_name - computed: true, optional: false, required: false + public get scalingConfigurationName() { + return this.getStringAttribute('scaling_configuration_name'); + } + + // scaling_group_id - computed: true, optional: false, required: false + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + + // scaling_group_name - computed: true, optional: false, required: false + public get scalingGroupName() { + return this.getStringAttribute('scaling_group_name'); + } + + // security_groups - computed: true, optional: false, required: false + private _securityGroups = new DataHuaweicloudAsGroupsGroupsSecurityGroupsList(this, "security_groups", false); + public get securityGroups() { + return this._securityGroups; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudAsGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsGroupsGroupsOutputReference { + return new DataHuaweicloudAsGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups huaweicloud_as_groups} +*/ +export class DataHuaweicloudAsGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsGroups to import + * @param importFromId The id of the existing DataHuaweicloudAsGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_groups huaweicloud_as_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._scalingConfigurationId = config.scalingConfigurationId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudAsGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_configuration_id - computed: false, optional: true, required: false + private _scalingConfigurationId?: string; + public get scalingConfigurationId() { + return this.getStringAttribute('scaling_configuration_id'); + } + public set scalingConfigurationId(value: string) { + this._scalingConfigurationId = value; + } + public resetScalingConfigurationId() { + this._scalingConfigurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingConfigurationIdInput() { + return this._scalingConfigurationId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + scaling_configuration_id: cdktf.stringToTerraform(this._scalingConfigurationId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_configuration_id: { + value: cdktf.stringToHclTerraform(this._scalingConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/README.md new file mode 100644 index 00000000..ce6e329c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_hook_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_hook_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/index.ts new file mode 100644 index 00000000..22763607 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-hook-instances/index.ts @@ -0,0 +1,374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsHookInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#id DataHuaweicloudAsHookInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the AS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#instance_id DataHuaweicloudAsHookInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the name of the lifecycle hook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#lifecycle_hook_name DataHuaweicloudAsHookInstances#lifecycle_hook_name} + */ + readonly lifecycleHookName?: string; + /** + * Specifies the status of the lifecycle hook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#lifecycle_hook_status DataHuaweicloudAsHookInstances#lifecycle_hook_status} + */ + readonly lifecycleHookStatus?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#region DataHuaweicloudAsHookInstances#region} + */ + readonly region?: string; + /** + * Specifies the ID of the AS group to which the AS instances belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#scaling_group_id DataHuaweicloudAsHookInstances#scaling_group_id} + */ + readonly scalingGroupId: string; +} +export interface DataHuaweicloudAsHookInstancesInstanceHangingInfo { +} + +export function dataHuaweicloudAsHookInstancesInstanceHangingInfoToTerraform(struct?: DataHuaweicloudAsHookInstancesInstanceHangingInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsHookInstancesInstanceHangingInfoToHclTerraform(struct?: DataHuaweicloudAsHookInstancesInstanceHangingInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsHookInstancesInstanceHangingInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsHookInstancesInstanceHangingInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsHookInstancesInstanceHangingInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default_result - computed: true, optional: false, required: false + public get defaultResult() { + return this.getStringAttribute('default_result'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // lifecycle_action_key - computed: true, optional: false, required: false + public get lifecycleActionKey() { + return this.getStringAttribute('lifecycle_action_key'); + } + + // lifecycle_hook_name - computed: true, optional: false, required: false + public get lifecycleHookName() { + return this.getStringAttribute('lifecycle_hook_name'); + } + + // lifecycle_hook_status - computed: true, optional: false, required: false + public get lifecycleHookStatus() { + return this.getStringAttribute('lifecycle_hook_status'); + } + + // scaling_group_id - computed: true, optional: false, required: false + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getStringAttribute('timeout'); + } +} + +export class DataHuaweicloudAsHookInstancesInstanceHangingInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsHookInstancesInstanceHangingInfoOutputReference { + return new DataHuaweicloudAsHookInstancesInstanceHangingInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances huaweicloud_as_hook_instances} +*/ +export class DataHuaweicloudAsHookInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_hook_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsHookInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsHookInstances to import + * @param importFromId The id of the existing DataHuaweicloudAsHookInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsHookInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_hook_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_hook_instances huaweicloud_as_hook_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsHookInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsHookInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_hook_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._lifecycleHookName = config.lifecycleHookName; + this._lifecycleHookStatus = config.lifecycleHookStatus; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_hanging_info - computed: true, optional: false, required: false + private _instanceHangingInfo = new DataHuaweicloudAsHookInstancesInstanceHangingInfoList(this, "instance_hanging_info", false); + public get instanceHangingInfo() { + return this._instanceHangingInfo; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lifecycle_hook_name - computed: false, optional: true, required: false + private _lifecycleHookName?: string; + public get lifecycleHookName() { + return this.getStringAttribute('lifecycle_hook_name'); + } + public set lifecycleHookName(value: string) { + this._lifecycleHookName = value; + } + public resetLifecycleHookName() { + this._lifecycleHookName = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifecycleHookNameInput() { + return this._lifecycleHookName; + } + + // lifecycle_hook_status - computed: false, optional: true, required: false + private _lifecycleHookStatus?: string; + public get lifecycleHookStatus() { + return this.getStringAttribute('lifecycle_hook_status'); + } + public set lifecycleHookStatus(value: string) { + this._lifecycleHookStatus = value; + } + public resetLifecycleHookStatus() { + this._lifecycleHookStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifecycleHookStatusInput() { + return this._lifecycleHookStatus; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lifecycle_hook_name: cdktf.stringToTerraform(this._lifecycleHookName), + lifecycle_hook_status: cdktf.stringToTerraform(this._lifecycleHookStatus), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifecycle_hook_name: { + value: cdktf.stringToHclTerraform(this._lifecycleHookName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifecycle_hook_status: { + value: cdktf.stringToHclTerraform(this._lifecycleHookStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/README.md new file mode 100644 index 00000000..72e37443 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/index.ts new file mode 100644 index 00000000..6d9f78d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-instances/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the instance health status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#health_status DataHuaweicloudAsInstances#health_status} + */ + readonly healthStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#id DataHuaweicloudAsInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance lifecycle status in the AS group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#life_cycle_state DataHuaweicloudAsInstances#life_cycle_state} + */ + readonly lifeCycleState?: string; + /** + * Specifies the instance protection status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#protect_from_scaling_down DataHuaweicloudAsInstances#protect_from_scaling_down} + */ + readonly protectFromScalingDown?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#region DataHuaweicloudAsInstances#region} + */ + readonly region?: string; + /** + * Specifies the AS group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#scaling_group_id DataHuaweicloudAsInstances#scaling_group_id} + */ + readonly scalingGroupId: string; +} +export interface DataHuaweicloudAsInstancesInstances { +} + +export function dataHuaweicloudAsInstancesInstancesToTerraform(struct?: DataHuaweicloudAsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsInstancesInstancesToHclTerraform(struct?: DataHuaweicloudAsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // health_status - computed: true, optional: false, required: false + public get healthStatus() { + return this.getStringAttribute('health_status'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // life_cycle_state - computed: true, optional: false, required: false + public get lifeCycleState() { + return this.getStringAttribute('life_cycle_state'); + } + + // protect_from_scaling_down - computed: true, optional: false, required: false + public get protectFromScalingDown() { + return this.getBooleanAttribute('protect_from_scaling_down'); + } + + // scaling_configuration_id - computed: true, optional: false, required: false + public get scalingConfigurationId() { + return this.getStringAttribute('scaling_configuration_id'); + } + + // scaling_configuration_name - computed: true, optional: false, required: false + public get scalingConfigurationName() { + return this.getStringAttribute('scaling_configuration_name'); + } + + // scaling_group_id - computed: true, optional: false, required: false + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + + // scaling_group_name - computed: true, optional: false, required: false + public get scalingGroupName() { + return this.getStringAttribute('scaling_group_name'); + } +} + +export class DataHuaweicloudAsInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsInstancesInstancesOutputReference { + return new DataHuaweicloudAsInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances huaweicloud_as_instances} +*/ +export class DataHuaweicloudAsInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsInstances to import + * @param importFromId The id of the existing DataHuaweicloudAsInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_instances huaweicloud_as_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._healthStatus = config.healthStatus; + this._id = config.id; + this._lifeCycleState = config.lifeCycleState; + this._protectFromScalingDown = config.protectFromScalingDown; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // health_status - computed: false, optional: true, required: false + private _healthStatus?: string; + public get healthStatus() { + return this.getStringAttribute('health_status'); + } + public set healthStatus(value: string) { + this._healthStatus = value; + } + public resetHealthStatus() { + this._healthStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthStatusInput() { + return this._healthStatus; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudAsInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // life_cycle_state - computed: false, optional: true, required: false + private _lifeCycleState?: string; + public get lifeCycleState() { + return this.getStringAttribute('life_cycle_state'); + } + public set lifeCycleState(value: string) { + this._lifeCycleState = value; + } + public resetLifeCycleState() { + this._lifeCycleState = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifeCycleStateInput() { + return this._lifeCycleState; + } + + // protect_from_scaling_down - computed: false, optional: true, required: false + private _protectFromScalingDown?: string; + public get protectFromScalingDown() { + return this.getStringAttribute('protect_from_scaling_down'); + } + public set protectFromScalingDown(value: string) { + this._protectFromScalingDown = value; + } + public resetProtectFromScalingDown() { + this._protectFromScalingDown = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectFromScalingDownInput() { + return this._protectFromScalingDown; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + health_status: cdktf.stringToTerraform(this._healthStatus), + id: cdktf.stringToTerraform(this._id), + life_cycle_state: cdktf.stringToTerraform(this._lifeCycleState), + protect_from_scaling_down: cdktf.stringToTerraform(this._protectFromScalingDown), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + health_status: { + value: cdktf.stringToHclTerraform(this._healthStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + life_cycle_state: { + value: cdktf.stringToHclTerraform(this._lifeCycleState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_from_scaling_down: { + value: cdktf.stringToHclTerraform(this._protectFromScalingDown), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/README.md new file mode 100644 index 00000000..ffaa5dc4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_lifecycle_hooks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_lifecycle_hooks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/index.ts new file mode 100644 index 00000000..6f627b01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-lifecycle-hooks/index.ts @@ -0,0 +1,369 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsLifecycleHooksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#default_result DataHuaweicloudAsLifecycleHooks#default_result} + */ + readonly defaultResult?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#id DataHuaweicloudAsLifecycleHooks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#name DataHuaweicloudAsLifecycleHooks#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#region DataHuaweicloudAsLifecycleHooks#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#scaling_group_id DataHuaweicloudAsLifecycleHooks#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#type DataHuaweicloudAsLifecycleHooks#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudAsLifecycleHooksLifecycleHooks { +} + +export function dataHuaweicloudAsLifecycleHooksLifecycleHooksToTerraform(struct?: DataHuaweicloudAsLifecycleHooksLifecycleHooks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsLifecycleHooksLifecycleHooksToHclTerraform(struct?: DataHuaweicloudAsLifecycleHooksLifecycleHooks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsLifecycleHooksLifecycleHooksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsLifecycleHooksLifecycleHooks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsLifecycleHooksLifecycleHooks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_result - computed: true, optional: false, required: false + public get defaultResult() { + return this.getStringAttribute('default_result'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // notification_message - computed: true, optional: false, required: false + public get notificationMessage() { + return this.getStringAttribute('notification_message'); + } + + // notification_topic_name - computed: true, optional: false, required: false + public get notificationTopicName() { + return this.getStringAttribute('notification_topic_name'); + } + + // notification_topic_urn - computed: true, optional: false, required: false + public get notificationTopicUrn() { + return this.getStringAttribute('notification_topic_urn'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudAsLifecycleHooksLifecycleHooksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsLifecycleHooksLifecycleHooksOutputReference { + return new DataHuaweicloudAsLifecycleHooksLifecycleHooksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks huaweicloud_as_lifecycle_hooks} +*/ +export class DataHuaweicloudAsLifecycleHooks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_lifecycle_hooks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsLifecycleHooks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsLifecycleHooks to import + * @param importFromId The id of the existing DataHuaweicloudAsLifecycleHooks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsLifecycleHooks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_lifecycle_hooks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_lifecycle_hooks huaweicloud_as_lifecycle_hooks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsLifecycleHooksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsLifecycleHooksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_lifecycle_hooks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._defaultResult = config.defaultResult; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // default_result - computed: false, optional: true, required: false + private _defaultResult?: string; + public get defaultResult() { + return this.getStringAttribute('default_result'); + } + public set defaultResult(value: string) { + this._defaultResult = value; + } + public resetDefaultResult() { + this._defaultResult = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultResultInput() { + return this._defaultResult; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lifecycle_hooks - computed: true, optional: false, required: false + private _lifecycleHooks = new DataHuaweicloudAsLifecycleHooksLifecycleHooksList(this, "lifecycle_hooks", false); + public get lifecycleHooks() { + return this._lifecycleHooks; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + default_result: cdktf.stringToTerraform(this._defaultResult), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + default_result: { + value: cdktf.stringToHclTerraform(this._defaultResult), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/README.md new file mode 100644 index 00000000..f9b54e60 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_notifications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_notifications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/index.ts new file mode 100644 index 00000000..71334d08 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-notifications/index.ts @@ -0,0 +1,294 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsNotificationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications#id DataHuaweicloudAsNotifications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications#region DataHuaweicloudAsNotifications#region} + */ + readonly region?: string; + /** + * Specifies the ID of the AS group to which the notifications belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications#scaling_group_id DataHuaweicloudAsNotifications#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Specifies the topic name in SMN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications#topic_name DataHuaweicloudAsNotifications#topic_name} + */ + readonly topicName?: string; +} +export interface DataHuaweicloudAsNotificationsTopics { +} + +export function dataHuaweicloudAsNotificationsTopicsToTerraform(struct?: DataHuaweicloudAsNotificationsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsNotificationsTopicsToHclTerraform(struct?: DataHuaweicloudAsNotificationsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsNotificationsTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsNotificationsTopics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsNotificationsTopics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // events - computed: true, optional: false, required: false + public get events() { + return this.getListAttribute('events'); + } + + // topic_name - computed: true, optional: false, required: false + public get topicName() { + return this.getStringAttribute('topic_name'); + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudAsNotificationsTopicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsNotificationsTopicsOutputReference { + return new DataHuaweicloudAsNotificationsTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications huaweicloud_as_notifications} +*/ +export class DataHuaweicloudAsNotifications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_notifications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsNotifications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsNotifications to import + * @param importFromId The id of the existing DataHuaweicloudAsNotifications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsNotifications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_notifications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_notifications huaweicloud_as_notifications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsNotificationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsNotificationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_notifications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._topicName = config.topicName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // topic_name - computed: false, optional: true, required: false + private _topicName?: string; + public get topicName() { + return this.getStringAttribute('topic_name'); + } + public set topicName(value: string) { + this._topicName = value; + } + public resetTopicName() { + this._topicName = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicNameInput() { + return this._topicName; + } + + // topics - computed: true, optional: false, required: false + private _topics = new DataHuaweicloudAsNotificationsTopicsList(this, "topics", false); + public get topics() { + return this._topics; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + topic_name: cdktf.stringToTerraform(this._topicName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name: { + value: cdktf.stringToHclTerraform(this._topicName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/README.md new file mode 100644 index 00000000..3bdfbc66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_planned_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_planned_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/index.ts new file mode 100644 index 00000000..48b029e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-planned-tasks/index.ts @@ -0,0 +1,521 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsPlannedTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks#id DataHuaweicloudAsPlannedTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the planned task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks#name DataHuaweicloudAsPlannedTasks#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks#region DataHuaweicloudAsPlannedTasks#region} + */ + readonly region?: string; + /** + * Specifies the ID of the AS group to which the planned tasks belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks#scaling_group_id DataHuaweicloudAsPlannedTasks#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Specifies the ID of the planned task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks#task_id DataHuaweicloudAsPlannedTasks#task_id} + */ + readonly taskId?: string; +} +export interface DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumber { +} + +export function dataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberToTerraform(struct?: DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumber): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberToHclTerraform(struct?: DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumber): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumber | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumber | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // desire - computed: true, optional: false, required: false + public get desire() { + return this.getNumberAttribute('desire'); + } + + // max - computed: true, optional: false, required: false + public get max() { + return this.getNumberAttribute('max'); + } + + // min - computed: true, optional: false, required: false + public get min() { + return this.getNumberAttribute('min'); + } +} + +export class DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberOutputReference { + return new DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicy { +} + +export function dataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyToTerraform(struct?: DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyToHclTerraform(struct?: DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // launch_time - computed: true, optional: false, required: false + public get launchTime() { + return this.getStringAttribute('launch_time'); + } + + // recurrence_type - computed: true, optional: false, required: false + public get recurrenceType() { + return this.getStringAttribute('recurrence_type'); + } + + // recurrence_value - computed: true, optional: false, required: false + public get recurrenceValue() { + return this.getStringAttribute('recurrence_value'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyOutputReference { + return new DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsPlannedTasksScheduledTasks { +} + +export function dataHuaweicloudAsPlannedTasksScheduledTasksToTerraform(struct?: DataHuaweicloudAsPlannedTasksScheduledTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPlannedTasksScheduledTasksToHclTerraform(struct?: DataHuaweicloudAsPlannedTasksScheduledTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPlannedTasksScheduledTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPlannedTasksScheduledTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPlannedTasksScheduledTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_number - computed: true, optional: false, required: false + private _instanceNumber = new DataHuaweicloudAsPlannedTasksScheduledTasksInstanceNumberList(this, "instance_number", false); + public get instanceNumber() { + return this._instanceNumber; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // scaling_group_id - computed: true, optional: false, required: false + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + + // scheduled_policy - computed: true, optional: false, required: false + private _scheduledPolicy = new DataHuaweicloudAsPlannedTasksScheduledTasksScheduledPolicyList(this, "scheduled_policy", false); + public get scheduledPolicy() { + return this._scheduledPolicy; + } +} + +export class DataHuaweicloudAsPlannedTasksScheduledTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPlannedTasksScheduledTasksOutputReference { + return new DataHuaweicloudAsPlannedTasksScheduledTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks huaweicloud_as_planned_tasks} +*/ +export class DataHuaweicloudAsPlannedTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_planned_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsPlannedTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsPlannedTasks to import + * @param importFromId The id of the existing DataHuaweicloudAsPlannedTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsPlannedTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_planned_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_planned_tasks huaweicloud_as_planned_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsPlannedTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsPlannedTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_planned_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._taskId = config.taskId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // scheduled_tasks - computed: true, optional: false, required: false + private _scheduledTasks = new DataHuaweicloudAsPlannedTasksScheduledTasksList(this, "scheduled_tasks", false); + public get scheduledTasks() { + return this._scheduledTasks; + } + + // task_id - computed: false, optional: true, required: false + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + public resetTaskId() { + this._taskId = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + task_id: cdktf.stringToTerraform(this._taskId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/README.md new file mode 100644 index 00000000..9ddaabb9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/index.ts new file mode 100644 index 00000000..b0507852 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policies/index.ts @@ -0,0 +1,561 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#id DataHuaweicloudAsPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#region DataHuaweicloudAsPolicies#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#scaling_group_id DataHuaweicloudAsPolicies#scaling_group_id} + */ + readonly scalingGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#scaling_policy_id DataHuaweicloudAsPolicies#scaling_policy_id} + */ + readonly scalingPolicyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#scaling_policy_name DataHuaweicloudAsPolicies#scaling_policy_name} + */ + readonly scalingPolicyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#scaling_policy_type DataHuaweicloudAsPolicies#scaling_policy_type} + */ + readonly scalingPolicyType?: string; +} +export interface DataHuaweicloudAsPoliciesPoliciesAction { +} + +export function dataHuaweicloudAsPoliciesPoliciesActionToTerraform(struct?: DataHuaweicloudAsPoliciesPoliciesAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPoliciesPoliciesActionToHclTerraform(struct?: DataHuaweicloudAsPoliciesPoliciesAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPoliciesPoliciesActionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPoliciesPoliciesAction | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPoliciesPoliciesAction | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // instance_number - computed: true, optional: false, required: false + public get instanceNumber() { + return this.getNumberAttribute('instance_number'); + } + + // instance_percentage - computed: true, optional: false, required: false + public get instancePercentage() { + return this.getNumberAttribute('instance_percentage'); + } + + // operation - computed: true, optional: false, required: false + public get operation() { + return this.getStringAttribute('operation'); + } +} + +export class DataHuaweicloudAsPoliciesPoliciesActionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPoliciesPoliciesActionOutputReference { + return new DataHuaweicloudAsPoliciesPoliciesActionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsPoliciesPoliciesScheduledPolicy { +} + +export function dataHuaweicloudAsPoliciesPoliciesScheduledPolicyToTerraform(struct?: DataHuaweicloudAsPoliciesPoliciesScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPoliciesPoliciesScheduledPolicyToHclTerraform(struct?: DataHuaweicloudAsPoliciesPoliciesScheduledPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPoliciesPoliciesScheduledPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPoliciesPoliciesScheduledPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPoliciesPoliciesScheduledPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // launch_time - computed: true, optional: false, required: false + public get launchTime() { + return this.getStringAttribute('launch_time'); + } + + // recurrence_type - computed: true, optional: false, required: false + public get recurrenceType() { + return this.getStringAttribute('recurrence_type'); + } + + // recurrence_value - computed: true, optional: false, required: false + public get recurrenceValue() { + return this.getStringAttribute('recurrence_value'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudAsPoliciesPoliciesScheduledPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPoliciesPoliciesScheduledPolicyOutputReference { + return new DataHuaweicloudAsPoliciesPoliciesScheduledPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsPoliciesPolicies { +} + +export function dataHuaweicloudAsPoliciesPoliciesToTerraform(struct?: DataHuaweicloudAsPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudAsPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + private _action = new DataHuaweicloudAsPoliciesPoliciesActionList(this, "action", false); + public get action() { + return this._action; + } + + // alarm_id - computed: true, optional: false, required: false + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + + // cool_down_time - computed: true, optional: false, required: false + public get coolDownTime() { + return this.getNumberAttribute('cool_down_time'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // scaling_group_id - computed: true, optional: false, required: false + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + + // scheduled_policy - computed: true, optional: false, required: false + private _scheduledPolicy = new DataHuaweicloudAsPoliciesPoliciesScheduledPolicyList(this, "scheduled_policy", false); + public get scheduledPolicy() { + return this._scheduledPolicy; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudAsPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPoliciesPoliciesOutputReference { + return new DataHuaweicloudAsPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies huaweicloud_as_policies} +*/ +export class DataHuaweicloudAsPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsPolicies to import + * @param importFromId The id of the existing DataHuaweicloudAsPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policies huaweicloud_as_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._scalingGroupId = config.scalingGroupId; + this._scalingPolicyId = config.scalingPolicyId; + this._scalingPolicyName = config.scalingPolicyName; + this._scalingPolicyType = config.scalingPolicyType; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudAsPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_group_id - computed: false, optional: false, required: true + private _scalingGroupId?: string; + public get scalingGroupId() { + return this.getStringAttribute('scaling_group_id'); + } + public set scalingGroupId(value: string) { + this._scalingGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingGroupIdInput() { + return this._scalingGroupId; + } + + // scaling_policy_id - computed: false, optional: true, required: false + private _scalingPolicyId?: string; + public get scalingPolicyId() { + return this.getStringAttribute('scaling_policy_id'); + } + public set scalingPolicyId(value: string) { + this._scalingPolicyId = value; + } + public resetScalingPolicyId() { + this._scalingPolicyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyIdInput() { + return this._scalingPolicyId; + } + + // scaling_policy_name - computed: false, optional: true, required: false + private _scalingPolicyName?: string; + public get scalingPolicyName() { + return this.getStringAttribute('scaling_policy_name'); + } + public set scalingPolicyName(value: string) { + this._scalingPolicyName = value; + } + public resetScalingPolicyName() { + this._scalingPolicyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyNameInput() { + return this._scalingPolicyName; + } + + // scaling_policy_type - computed: false, optional: true, required: false + private _scalingPolicyType?: string; + public get scalingPolicyType() { + return this.getStringAttribute('scaling_policy_type'); + } + public set scalingPolicyType(value: string) { + this._scalingPolicyType = value; + } + public resetScalingPolicyType() { + this._scalingPolicyType = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyTypeInput() { + return this._scalingPolicyType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + scaling_group_id: cdktf.stringToTerraform(this._scalingGroupId), + scaling_policy_id: cdktf.stringToTerraform(this._scalingPolicyId), + scaling_policy_name: cdktf.stringToTerraform(this._scalingPolicyName), + scaling_policy_type: cdktf.stringToTerraform(this._scalingPolicyType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_group_id: { + value: cdktf.stringToHclTerraform(this._scalingGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_id: { + value: cdktf.stringToHclTerraform(this._scalingPolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_name: { + value: cdktf.stringToHclTerraform(this._scalingPolicyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_type: { + value: cdktf.stringToHclTerraform(this._scalingPolicyType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/README.md new file mode 100644 index 00000000..fa4e4a9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_policy_execute_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_policy_execute_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/index.ts new file mode 100644 index 00000000..ec4e93e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-policy-execute-logs/index.ts @@ -0,0 +1,623 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsPolicyExecuteLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#end_time DataHuaweicloudAsPolicyExecuteLogs#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#execute_type DataHuaweicloudAsPolicyExecuteLogs#execute_type} + */ + readonly executeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#id DataHuaweicloudAsPolicyExecuteLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#log_id DataHuaweicloudAsPolicyExecuteLogs#log_id} + */ + readonly logId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#region DataHuaweicloudAsPolicyExecuteLogs#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#scaling_policy_id DataHuaweicloudAsPolicyExecuteLogs#scaling_policy_id} + */ + readonly scalingPolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#scaling_resource_id DataHuaweicloudAsPolicyExecuteLogs#scaling_resource_id} + */ + readonly scalingResourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#scaling_resource_type DataHuaweicloudAsPolicyExecuteLogs#scaling_resource_type} + */ + readonly scalingResourceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#start_time DataHuaweicloudAsPolicyExecuteLogs#start_time} + */ + readonly startTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#status DataHuaweicloudAsPolicyExecuteLogs#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecords { +} + +export function dataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsToTerraform(struct?: DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsToHclTerraform(struct?: DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // job_name - computed: true, optional: false, required: false + public get jobName() { + return this.getStringAttribute('job_name'); + } + + // job_status - computed: true, optional: false, required: false + public get jobStatus() { + return this.getStringAttribute('job_status'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // record_time - computed: true, optional: false, required: false + public get recordTime() { + return this.getStringAttribute('record_time'); + } + + // record_type - computed: true, optional: false, required: false + public get recordType() { + return this.getStringAttribute('record_type'); + } + + // request - computed: true, optional: false, required: false + public get request() { + return this.getStringAttribute('request'); + } + + // response - computed: true, optional: false, required: false + public get response() { + return this.getStringAttribute('response'); + } +} + +export class DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsOutputReference { + return new DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsPolicyExecuteLogsExecuteLogs { +} + +export function dataHuaweicloudAsPolicyExecuteLogsExecuteLogsToTerraform(struct?: DataHuaweicloudAsPolicyExecuteLogsExecuteLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsPolicyExecuteLogsExecuteLogsToHclTerraform(struct?: DataHuaweicloudAsPolicyExecuteLogsExecuteLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsPolicyExecuteLogsExecuteLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsPolicyExecuteLogsExecuteLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsPolicyExecuteLogsExecuteLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // desire_value - computed: true, optional: false, required: false + public get desireValue() { + return this.getStringAttribute('desire_value'); + } + + // execute_time - computed: true, optional: false, required: false + public get executeTime() { + return this.getStringAttribute('execute_time'); + } + + // execute_type - computed: true, optional: false, required: false + public get executeType() { + return this.getStringAttribute('execute_type'); + } + + // failed_reason - computed: true, optional: false, required: false + public get failedReason() { + return this.getStringAttribute('failed_reason'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // job_records - computed: true, optional: false, required: false + private _jobRecords = new DataHuaweicloudAsPolicyExecuteLogsExecuteLogsJobRecordsList(this, "job_records", false); + public get jobRecords() { + return this._jobRecords; + } + + // limit_value - computed: true, optional: false, required: false + public get limitValue() { + return this.getStringAttribute('limit_value'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // old_value - computed: true, optional: false, required: false + public get oldValue() { + return this.getStringAttribute('old_value'); + } + + // scaling_policy_id - computed: true, optional: false, required: false + public get scalingPolicyId() { + return this.getStringAttribute('scaling_policy_id'); + } + + // scaling_resource_id - computed: true, optional: false, required: false + public get scalingResourceId() { + return this.getStringAttribute('scaling_resource_id'); + } + + // scaling_resource_type - computed: true, optional: false, required: false + public get scalingResourceType() { + return this.getStringAttribute('scaling_resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudAsPolicyExecuteLogsExecuteLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsPolicyExecuteLogsExecuteLogsOutputReference { + return new DataHuaweicloudAsPolicyExecuteLogsExecuteLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs huaweicloud_as_policy_execute_logs} +*/ +export class DataHuaweicloudAsPolicyExecuteLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_policy_execute_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsPolicyExecuteLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsPolicyExecuteLogs to import + * @param importFromId The id of the existing DataHuaweicloudAsPolicyExecuteLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsPolicyExecuteLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_policy_execute_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_policy_execute_logs huaweicloud_as_policy_execute_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsPolicyExecuteLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsPolicyExecuteLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_policy_execute_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._executeType = config.executeType; + this._id = config.id; + this._logId = config.logId; + this._region = config.region; + this._scalingPolicyId = config.scalingPolicyId; + this._scalingResourceId = config.scalingResourceId; + this._scalingResourceType = config.scalingResourceType; + this._startTime = config.startTime; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // execute_logs - computed: true, optional: false, required: false + private _executeLogs = new DataHuaweicloudAsPolicyExecuteLogsExecuteLogsList(this, "execute_logs", false); + public get executeLogs() { + return this._executeLogs; + } + + // execute_type - computed: false, optional: true, required: false + private _executeType?: string; + public get executeType() { + return this.getStringAttribute('execute_type'); + } + public set executeType(value: string) { + this._executeType = value; + } + public resetExecuteType() { + this._executeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get executeTypeInput() { + return this._executeType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_id - computed: false, optional: true, required: false + private _logId?: string; + public get logId() { + return this.getStringAttribute('log_id'); + } + public set logId(value: string) { + this._logId = value; + } + public resetLogId() { + this._logId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logIdInput() { + return this._logId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scaling_policy_id - computed: false, optional: false, required: true + private _scalingPolicyId?: string; + public get scalingPolicyId() { + return this.getStringAttribute('scaling_policy_id'); + } + public set scalingPolicyId(value: string) { + this._scalingPolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get scalingPolicyIdInput() { + return this._scalingPolicyId; + } + + // scaling_resource_id - computed: false, optional: true, required: false + private _scalingResourceId?: string; + public get scalingResourceId() { + return this.getStringAttribute('scaling_resource_id'); + } + public set scalingResourceId(value: string) { + this._scalingResourceId = value; + } + public resetScalingResourceId() { + this._scalingResourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingResourceIdInput() { + return this._scalingResourceId; + } + + // scaling_resource_type - computed: false, optional: true, required: false + private _scalingResourceType?: string; + public get scalingResourceType() { + return this.getStringAttribute('scaling_resource_type'); + } + public set scalingResourceType(value: string) { + this._scalingResourceType = value; + } + public resetScalingResourceType() { + this._scalingResourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingResourceTypeInput() { + return this._scalingResourceType; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + execute_type: cdktf.stringToTerraform(this._executeType), + id: cdktf.stringToTerraform(this._id), + log_id: cdktf.stringToTerraform(this._logId), + region: cdktf.stringToTerraform(this._region), + scaling_policy_id: cdktf.stringToTerraform(this._scalingPolicyId), + scaling_resource_id: cdktf.stringToTerraform(this._scalingResourceId), + scaling_resource_type: cdktf.stringToTerraform(this._scalingResourceType), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + execute_type: { + value: cdktf.stringToHclTerraform(this._executeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_id: { + value: cdktf.stringToHclTerraform(this._logId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policy_id: { + value: cdktf.stringToHclTerraform(this._scalingPolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_resource_id: { + value: cdktf.stringToHclTerraform(this._scalingResourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_resource_type: { + value: cdktf.stringToHclTerraform(this._scalingResourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/README.md new file mode 100644 index 00000000..1b205069 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_as_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_as_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/index.ts new file mode 100644 index 00000000..33804a98 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-as-quotas/index.ts @@ -0,0 +1,323 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAsQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas#id DataHuaweicloudAsQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas#region DataHuaweicloudAsQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudAsQuotasQuotasResources { +} + +export function dataHuaweicloudAsQuotasQuotasResourcesToTerraform(struct?: DataHuaweicloudAsQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsQuotasQuotasResourcesToHclTerraform(struct?: DataHuaweicloudAsQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsQuotasQuotasResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsQuotasQuotasResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsQuotasQuotasResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max - computed: true, optional: false, required: false + public get max() { + return this.getNumberAttribute('max'); + } + + // min - computed: true, optional: false, required: false + public get min() { + return this.getNumberAttribute('min'); + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudAsQuotasQuotasResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsQuotasQuotasResourcesOutputReference { + return new DataHuaweicloudAsQuotasQuotasResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudAsQuotasQuotas { +} + +export function dataHuaweicloudAsQuotasQuotasToTerraform(struct?: DataHuaweicloudAsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudAsQuotasQuotasToHclTerraform(struct?: DataHuaweicloudAsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudAsQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudAsQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudAsQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudAsQuotasQuotasResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudAsQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudAsQuotasQuotasOutputReference { + return new DataHuaweicloudAsQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas huaweicloud_as_quotas} +*/ +export class DataHuaweicloudAsQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_as_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAsQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAsQuotas to import + * @param importFromId The id of the existing DataHuaweicloudAsQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAsQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_as_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/as_quotas huaweicloud_as_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAsQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAsQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_as_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudAsQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/README.md new file mode 100644 index 00000000..2175b188 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/index.ts new file mode 100644 index 00000000..814c57db --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-availability-zones/index.ts @@ -0,0 +1,177 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones#id DataHuaweicloudAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones#region DataHuaweicloudAvailabilityZones#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones#state DataHuaweicloudAvailabilityZones#state} + */ + readonly state?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones huaweicloud_availability_zones} +*/ +export class DataHuaweicloudAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/availability_zones huaweicloud_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._state = config.state; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // names - computed: true, optional: false, required: false + public get names() { + return this.getListAttribute('names'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + state: cdktf.stringToTerraform(this._state), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/README.md new file mode 100644 index 00000000..dbeec740 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_bms_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_bms_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/index.ts new file mode 100644 index 00000000..ebdfa1f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-flavors/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudBmsFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#availability_zone DataHuaweicloudBmsFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#cpu_arch DataHuaweicloudBmsFlavors#cpu_arch} + */ + readonly cpuArch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#id DataHuaweicloudBmsFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#memory DataHuaweicloudBmsFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#region DataHuaweicloudBmsFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#vcpus DataHuaweicloudBmsFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudBmsFlavorsFlavors { +} + +export function dataHuaweicloudBmsFlavorsFlavorsToTerraform(struct?: DataHuaweicloudBmsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudBmsFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudBmsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudBmsFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudBmsFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudBmsFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cpu_arch - computed: true, optional: false, required: false + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // operation - computed: true, optional: false, required: false + public get operation() { + return this.getStringAttribute('operation'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudBmsFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudBmsFlavorsFlavorsOutputReference { + return new DataHuaweicloudBmsFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors huaweicloud_bms_flavors} +*/ +export class DataHuaweicloudBmsFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_bms_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudBmsFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudBmsFlavors to import + * @param importFromId The id of the existing DataHuaweicloudBmsFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudBmsFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_bms_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_flavors huaweicloud_bms_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudBmsFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudBmsFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_bms_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cpuArch = config.cpuArch; + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cpu_arch - computed: false, optional: true, required: false + private _cpuArch?: string; + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + public set cpuArch(value: string) { + this._cpuArch = value; + } + public resetCpuArch() { + this._cpuArch = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuArchInput() { + return this._cpuArch; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudBmsFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cpu_arch: cdktf.stringToTerraform(this._cpuArch), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_arch: { + value: cdktf.stringToHclTerraform(this._cpuArch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/README.md new file mode 100644 index 00000000..d8a84d6b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_bms_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_bms_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/index.ts new file mode 100644 index 00000000..ae0548c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-bms-instances/index.ts @@ -0,0 +1,693 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudBmsInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#enterprise_project_id DataHuaweicloudBmsInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#flavor_id DataHuaweicloudBmsInstances#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#id DataHuaweicloudBmsInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#name DataHuaweicloudBmsInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#region DataHuaweicloudBmsInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#status DataHuaweicloudBmsInstances#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#tags DataHuaweicloudBmsInstances#tags} + */ + readonly tags?: string; +} +export interface DataHuaweicloudBmsInstancesServersNics { +} + +export function dataHuaweicloudBmsInstancesServersNicsToTerraform(struct?: DataHuaweicloudBmsInstancesServersNics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudBmsInstancesServersNicsToHclTerraform(struct?: DataHuaweicloudBmsInstancesServersNics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudBmsInstancesServersNicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudBmsInstancesServersNics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudBmsInstancesServersNics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } +} + +export class DataHuaweicloudBmsInstancesServersNicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudBmsInstancesServersNicsOutputReference { + return new DataHuaweicloudBmsInstancesServersNicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudBmsInstancesServersVolumesAttached { +} + +export function dataHuaweicloudBmsInstancesServersVolumesAttachedToTerraform(struct?: DataHuaweicloudBmsInstancesServersVolumesAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudBmsInstancesServersVolumesAttachedToHclTerraform(struct?: DataHuaweicloudBmsInstancesServersVolumesAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudBmsInstancesServersVolumesAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudBmsInstancesServersVolumesAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudBmsInstancesServersVolumesAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getStringAttribute('boot_index'); + } + + // delete_on_termination - computed: true, optional: false, required: false + public get deleteOnTermination() { + return this.getStringAttribute('delete_on_termination'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudBmsInstancesServersVolumesAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudBmsInstancesServersVolumesAttachedOutputReference { + return new DataHuaweicloudBmsInstancesServersVolumesAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudBmsInstancesServers { +} + +export function dataHuaweicloudBmsInstancesServersToTerraform(struct?: DataHuaweicloudBmsInstancesServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudBmsInstancesServersToHclTerraform(struct?: DataHuaweicloudBmsInstancesServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudBmsInstancesServersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudBmsInstancesServers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudBmsInstancesServers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agency_name - computed: true, optional: false, required: false + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getStringAttribute('disk'); + } + + // disk_config - computed: true, optional: false, required: false + public get diskConfig() { + return this.getStringAttribute('disk_config'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // launched_at - computed: true, optional: false, required: false + public get launchedAt() { + return this.getStringAttribute('launched_at'); + } + + // locked - computed: true, optional: false, required: false + public get locked() { + return this.getBooleanAttribute('locked'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nics - computed: true, optional: false, required: false + private _nics = new DataHuaweicloudBmsInstancesServersNicsList(this, "nics", false); + public get nics() { + return this._nics; + } + + // root_device_name - computed: true, optional: false, required: false + public get rootDeviceName() { + return this.getStringAttribute('root_device_name'); + } + + // security_groups - computed: true, optional: false, required: false + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + + // vm_state - computed: true, optional: false, required: false + public get vmState() { + return this.getStringAttribute('vm_state'); + } + + // volumes_attached - computed: true, optional: false, required: false + private _volumesAttached = new DataHuaweicloudBmsInstancesServersVolumesAttachedList(this, "volumes_attached", false); + public get volumesAttached() { + return this._volumesAttached; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudBmsInstancesServersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudBmsInstancesServersOutputReference { + return new DataHuaweicloudBmsInstancesServersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances huaweicloud_bms_instances} +*/ +export class DataHuaweicloudBmsInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_bms_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudBmsInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudBmsInstances to import + * @param importFromId The id of the existing DataHuaweicloudBmsInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudBmsInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_bms_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/bms_instances huaweicloud_bms_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudBmsInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudBmsInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_bms_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // servers - computed: true, optional: false, required: false + private _servers = new DataHuaweicloudBmsInstancesServersList(this, "servers", false); + public get servers() { + return this._servers; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: string; + public get tags() { + return this.getStringAttribute('tags'); + } + public set tags(value: string) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.stringToTerraform(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.stringToHclTerraform(this._tags), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/README.md new file mode 100644 index 00000000..47bbc256 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cae_applications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cae_applications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/index.ts new file mode 100644 index 00000000..e729faac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-applications/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCaeApplicationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications#application_id DataHuaweicloudCaeApplications#application_id} + */ + readonly applicationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications#environment_id DataHuaweicloudCaeApplications#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications#id DataHuaweicloudCaeApplications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications#name DataHuaweicloudCaeApplications#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications#region DataHuaweicloudCaeApplications#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCaeApplicationsApplications { +} + +export function dataHuaweicloudCaeApplicationsApplicationsToTerraform(struct?: DataHuaweicloudCaeApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCaeApplicationsApplicationsToHclTerraform(struct?: DataHuaweicloudCaeApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCaeApplicationsApplicationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCaeApplicationsApplications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCaeApplicationsApplications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCaeApplicationsApplicationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCaeApplicationsApplicationsOutputReference { + return new DataHuaweicloudCaeApplicationsApplicationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications huaweicloud_cae_applications} +*/ +export class DataHuaweicloudCaeApplications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cae_applications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCaeApplications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCaeApplications to import + * @param importFromId The id of the existing DataHuaweicloudCaeApplications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCaeApplications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cae_applications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_applications huaweicloud_cae_applications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCaeApplicationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCaeApplicationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cae_applications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._environmentId = config.environmentId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: true, required: false + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + public resetApplicationId() { + this._applicationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // applications - computed: true, optional: false, required: false + private _applications = new DataHuaweicloudCaeApplicationsApplicationsList(this, "applications", false); + public get applications() { + return this._applications; + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/README.md new file mode 100644 index 00000000..ca31e93d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cae_environments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cae_environments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/index.ts new file mode 100644 index 00000000..186febc2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cae-environments/index.ts @@ -0,0 +1,371 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCaeEnvironmentsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the enterprise project to which the environments belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#enterprise_project_id DataHuaweicloudCaeEnvironments#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the ID of the environment to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#environment_id DataHuaweicloudCaeEnvironments#environment_id} + */ + readonly environmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#id DataHuaweicloudCaeEnvironments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the environment to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#name DataHuaweicloudCaeEnvironments#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#region DataHuaweicloudCaeEnvironments#region} + */ + readonly region?: string; + /** + * Specifies the status of the environment to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#status DataHuaweicloudCaeEnvironments#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCaeEnvironmentsEnvironments { +} + +export function dataHuaweicloudCaeEnvironmentsEnvironmentsToTerraform(struct?: DataHuaweicloudCaeEnvironmentsEnvironments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCaeEnvironmentsEnvironmentsToHclTerraform(struct?: DataHuaweicloudCaeEnvironmentsEnvironments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCaeEnvironmentsEnvironmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCaeEnvironmentsEnvironments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCaeEnvironmentsEnvironments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // annotations - computed: true, optional: false, required: false + private _annotations = new cdktf.StringMap(this, "annotations"); + public get annotations() { + return this._annotations; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCaeEnvironmentsEnvironmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCaeEnvironmentsEnvironmentsOutputReference { + return new DataHuaweicloudCaeEnvironmentsEnvironmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments huaweicloud_cae_environments} +*/ +export class DataHuaweicloudCaeEnvironments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cae_environments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCaeEnvironments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCaeEnvironments to import + * @param importFromId The id of the existing DataHuaweicloudCaeEnvironments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCaeEnvironments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cae_environments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cae_environments huaweicloud_cae_environments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCaeEnvironmentsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCaeEnvironmentsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cae_environments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._environmentId = config.environmentId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // environment_id - computed: false, optional: true, required: false + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + public resetEnvironmentId() { + this._environmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // environments - computed: true, optional: false, required: false + private _environments = new DataHuaweicloudCaeEnvironmentsEnvironmentsList(this, "environments", false); + public get environments() { + return this._environments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/README.md new file mode 100644 index 00000000..8c20e94d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cbh_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cbh_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/index.ts new file mode 100644 index 00000000..c1cfcd96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-availability-zones/index.ts @@ -0,0 +1,301 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCbhAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones#display_name DataHuaweicloudCbhAvailabilityZones#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones#id DataHuaweicloudCbhAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones#name DataHuaweicloudCbhAvailabilityZones#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones#region DataHuaweicloudCbhAvailabilityZones#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCbhAvailabilityZonesAvailabilityZones { +} + +export function dataHuaweicloudCbhAvailabilityZonesAvailabilityZonesToTerraform(struct?: DataHuaweicloudCbhAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbhAvailabilityZonesAvailabilityZonesToHclTerraform(struct?: DataHuaweicloudCbhAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbhAvailabilityZonesAvailabilityZonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbhAvailabilityZonesAvailabilityZones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbhAvailabilityZonesAvailabilityZones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCbhAvailabilityZonesAvailabilityZonesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbhAvailabilityZonesAvailabilityZonesOutputReference { + return new DataHuaweicloudCbhAvailabilityZonesAvailabilityZonesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones huaweicloud_cbh_availability_zones} +*/ +export class DataHuaweicloudCbhAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbh_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCbhAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCbhAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudCbhAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCbhAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbh_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_availability_zones huaweicloud_cbh_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCbhAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCbhAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbh_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: false, required: false + private _availabilityZones = new DataHuaweicloudCbhAvailabilityZonesAvailabilityZonesList(this, "availability_zones", false); + public get availabilityZones() { + return this._availabilityZones; + } + + // display_name - computed: false, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/README.md new file mode 100644 index 00000000..aacf0361 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cbh_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cbh_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/index.ts new file mode 100644 index 00000000..63c61754 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-flavors/index.ts @@ -0,0 +1,484 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCbhFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#action DataHuaweicloudCbhFlavors#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#asset DataHuaweicloudCbhFlavors#asset} + */ + readonly asset?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#flavor_id DataHuaweicloudCbhFlavors#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#id DataHuaweicloudCbhFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#max_connection DataHuaweicloudCbhFlavors#max_connection} + */ + readonly maxConnection?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#memory DataHuaweicloudCbhFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#region DataHuaweicloudCbhFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#spec_code DataHuaweicloudCbhFlavors#spec_code} + */ + readonly specCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#type DataHuaweicloudCbhFlavors#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#vcpus DataHuaweicloudCbhFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudCbhFlavorsFlavors { +} + +export function dataHuaweicloudCbhFlavorsFlavorsToTerraform(struct?: DataHuaweicloudCbhFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbhFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudCbhFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbhFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbhFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbhFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // asset - computed: true, optional: false, required: false + public get asset() { + return this.getNumberAttribute('asset'); + } + + // data_disk_size - computed: true, optional: false, required: false + public get dataDiskSize() { + return this.getNumberAttribute('data_disk_size'); + } + + // ecs_system_data_size - computed: true, optional: false, required: false + public get ecsSystemDataSize() { + return this.getNumberAttribute('ecs_system_data_size'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_connection - computed: true, optional: false, required: false + public get maxConnection() { + return this.getNumberAttribute('max_connection'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudCbhFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbhFlavorsFlavorsOutputReference { + return new DataHuaweicloudCbhFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors huaweicloud_cbh_flavors} +*/ +export class DataHuaweicloudCbhFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbh_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCbhFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCbhFlavors to import + * @param importFromId The id of the existing DataHuaweicloudCbhFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCbhFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbh_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_flavors huaweicloud_cbh_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCbhFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCbhFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbh_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._asset = config.asset; + this._flavorId = config.flavorId; + this._id = config.id; + this._maxConnection = config.maxConnection; + this._memory = config.memory; + this._region = config.region; + this._specCode = config.specCode; + this._type = config.type; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // asset - computed: false, optional: true, required: false + private _asset?: number; + public get asset() { + return this.getNumberAttribute('asset'); + } + public set asset(value: number) { + this._asset = value; + } + public resetAsset() { + this._asset = undefined; + } + // Temporarily expose input value. Use with caution. + public get assetInput() { + return this._asset; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCbhFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_connection - computed: false, optional: true, required: false + private _maxConnection?: number; + public get maxConnection() { + return this.getNumberAttribute('max_connection'); + } + public set maxConnection(value: number) { + this._maxConnection = value; + } + public resetMaxConnection() { + this._maxConnection = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConnectionInput() { + return this._maxConnection; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec_code - computed: false, optional: true, required: false + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + public resetSpecCode() { + this._specCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + asset: cdktf.numberToTerraform(this._asset), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + max_connection: cdktf.numberToTerraform(this._maxConnection), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + spec_code: cdktf.stringToTerraform(this._specCode), + type: cdktf.stringToTerraform(this._type), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + asset: { + value: cdktf.numberToHclTerraform(this._asset), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_connection: { + value: cdktf.numberToHclTerraform(this._maxConnection), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_code: { + value: cdktf.stringToHclTerraform(this._specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/README.md new file mode 100644 index 00000000..73a35fba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cbh_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cbh_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/index.ts new file mode 100644 index 00000000..d11951e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbh-instances/index.ts @@ -0,0 +1,460 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCbhInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the specification of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#flavor_id DataHuaweicloudCbhInstances#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#id DataHuaweicloudCbhInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#name DataHuaweicloudCbhInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#region DataHuaweicloudCbhInstances#region} + */ + readonly region?: string; + /** + * Specifies the ID of a security group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#security_group_id DataHuaweicloudCbhInstances#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Specifies the ID of a subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#subnet_id DataHuaweicloudCbhInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Specifies the current version of the instance image + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#version DataHuaweicloudCbhInstances#version} + */ + readonly version?: string; + /** + * Specifies the ID of a VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#vpc_id DataHuaweicloudCbhInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudCbhInstancesInstances { +} + +export function dataHuaweicloudCbhInstancesInstancesToTerraform(struct?: DataHuaweicloudCbhInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbhInstancesInstancesToHclTerraform(struct?: DataHuaweicloudCbhInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbhInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbhInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbhInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // public_ip_id - computed: true, optional: false, required: false + public get publicIpId() { + return this.getStringAttribute('public_ip_id'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudCbhInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbhInstancesInstancesOutputReference { + return new DataHuaweicloudCbhInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances huaweicloud_cbh_instances} +*/ +export class DataHuaweicloudCbhInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbh_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCbhInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCbhInstances to import + * @param importFromId The id of the existing DataHuaweicloudCbhInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCbhInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbh_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbh_instances huaweicloud_cbh_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCbhInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCbhInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbh_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._flavorId = config.flavorId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._version = config.version; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudCbhInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + version: cdktf.stringToTerraform(this._version), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/README.md new file mode 100644 index 00000000..6cfabef8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cbr_backup` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cbr_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/index.ts new file mode 100644 index 00000000..37403452 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-backup/index.ts @@ -0,0 +1,1117 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCbrBackupConfig extends cdktf.TerraformMetaArguments { + /** + * The backup ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup#id DataHuaweicloudCbrBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * The region where the CBR backup is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup#region DataHuaweicloudCbrBackup#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCbrBackupChildrenExtendInfo { +} + +export function dataHuaweicloudCbrBackupChildrenExtendInfoToTerraform(struct?: DataHuaweicloudCbrBackupChildrenExtendInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupChildrenExtendInfoToHclTerraform(struct?: DataHuaweicloudCbrBackupChildrenExtendInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupChildrenExtendInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupChildrenExtendInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupChildrenExtendInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // contain_system_disk - computed: true, optional: false, required: false + public get containSystemDisk() { + return this.getBooleanAttribute('contain_system_disk'); + } + + // encrypted - computed: true, optional: false, required: false + public get encrypted() { + return this.getBooleanAttribute('encrypted'); + } + + // incremental - computed: true, optional: false, required: false + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + + // is_system_disk - computed: true, optional: false, required: false + public get isSystemDisk() { + return this.getBooleanAttribute('is_system_disk'); + } + + // os_registry_images - computed: true, optional: false, required: false + public get osRegistryImages() { + return this.getListAttribute('os_registry_images'); + } + + // snapshot_id - computed: true, optional: false, required: false + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + + // support_lld - computed: true, optional: false, required: false + public get supportLld() { + return this.getBooleanAttribute('support_lld'); + } + + // supported_restore_mode - computed: true, optional: false, required: false + public get supportedRestoreMode() { + return this.getStringAttribute('supported_restore_mode'); + } +} + +export class DataHuaweicloudCbrBackupChildrenExtendInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupChildrenExtendInfoOutputReference { + return new DataHuaweicloudCbrBackupChildrenExtendInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfo { +} + +export function dataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoToTerraform(struct?: DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoToHclTerraform(struct?: DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // destination_vault_id - computed: true, optional: false, required: false + public get destinationVaultId() { + return this.getStringAttribute('destination_vault_id'); + } + + // fail_code - computed: true, optional: false, required: false + public get failCode() { + return this.getStringAttribute('fail_code'); + } + + // fail_reason - computed: true, optional: false, required: false + public get failReason() { + return this.getStringAttribute('fail_reason'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getNumberAttribute('progress'); + } +} + +export class DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoOutputReference { + return new DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrBackupChildrenReplicationRecords { +} + +export function dataHuaweicloudCbrBackupChildrenReplicationRecordsToTerraform(struct?: DataHuaweicloudCbrBackupChildrenReplicationRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupChildrenReplicationRecordsToHclTerraform(struct?: DataHuaweicloudCbrBackupChildrenReplicationRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupChildrenReplicationRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupChildrenReplicationRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupChildrenReplicationRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // destination_backup_id - computed: true, optional: false, required: false + public get destinationBackupId() { + return this.getStringAttribute('destination_backup_id'); + } + + // destination_checkpoint_id - computed: true, optional: false, required: false + public get destinationCheckpointId() { + return this.getStringAttribute('destination_checkpoint_id'); + } + + // destination_project_id - computed: true, optional: false, required: false + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + + // destination_region - computed: true, optional: false, required: false + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + + // destination_vault_id - computed: true, optional: false, required: false + public get destinationVaultId() { + return this.getStringAttribute('destination_vault_id'); + } + + // extra_info - computed: true, optional: false, required: false + private _extraInfo = new DataHuaweicloudCbrBackupChildrenReplicationRecordsExtraInfoList(this, "extra_info", false); + public get extraInfo() { + return this._extraInfo; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // source_backup_id - computed: true, optional: false, required: false + public get sourceBackupId() { + return this.getStringAttribute('source_backup_id'); + } + + // source_checkpoint_id - computed: true, optional: false, required: false + public get sourceCheckpointId() { + return this.getStringAttribute('source_checkpoint_id'); + } + + // source_project_id - computed: true, optional: false, required: false + public get sourceProjectId() { + return this.getStringAttribute('source_project_id'); + } + + // source_region - computed: true, optional: false, required: false + public get sourceRegion() { + return this.getStringAttribute('source_region'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vault_id - computed: true, optional: false, required: false + public get vaultId() { + return this.getStringAttribute('vault_id'); + } +} + +export class DataHuaweicloudCbrBackupChildrenReplicationRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupChildrenReplicationRecordsOutputReference { + return new DataHuaweicloudCbrBackupChildrenReplicationRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrBackupChildren { +} + +export function dataHuaweicloudCbrBackupChildrenToTerraform(struct?: DataHuaweicloudCbrBackupChildren): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupChildrenToHclTerraform(struct?: DataHuaweicloudCbrBackupChildren): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupChildrenOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupChildren | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupChildren | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // checkpoint_id - computed: true, optional: false, required: false + public get checkpointId() { + return this.getStringAttribute('checkpoint_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // extend_info - computed: true, optional: false, required: false + private _extendInfo = new DataHuaweicloudCbrBackupChildrenExtendInfoList(this, "extend_info", false); + public get extendInfo() { + return this._extendInfo; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // replication_records - computed: true, optional: false, required: false + private _replicationRecords = new DataHuaweicloudCbrBackupChildrenReplicationRecordsList(this, "replication_records", false); + public get replicationRecords() { + return this._replicationRecords; + } + + // resource_az - computed: true, optional: false, required: false + public get resourceAz() { + return this.getStringAttribute('resource_az'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_size - computed: true, optional: false, required: false + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vault_id - computed: true, optional: false, required: false + public get vaultId() { + return this.getStringAttribute('vault_id'); + } +} + +export class DataHuaweicloudCbrBackupChildrenList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupChildrenOutputReference { + return new DataHuaweicloudCbrBackupChildrenOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrBackupExtendInfo { +} + +export function dataHuaweicloudCbrBackupExtendInfoToTerraform(struct?: DataHuaweicloudCbrBackupExtendInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupExtendInfoToHclTerraform(struct?: DataHuaweicloudCbrBackupExtendInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupExtendInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupExtendInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupExtendInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // contain_system_disk - computed: true, optional: false, required: false + public get containSystemDisk() { + return this.getBooleanAttribute('contain_system_disk'); + } + + // encrypted - computed: true, optional: false, required: false + public get encrypted() { + return this.getBooleanAttribute('encrypted'); + } + + // incremental - computed: true, optional: false, required: false + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + + // is_system_disk - computed: true, optional: false, required: false + public get isSystemDisk() { + return this.getBooleanAttribute('is_system_disk'); + } + + // os_registry_images - computed: true, optional: false, required: false + public get osRegistryImages() { + return this.getListAttribute('os_registry_images'); + } + + // snapshot_id - computed: true, optional: false, required: false + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + + // support_lld - computed: true, optional: false, required: false + public get supportLld() { + return this.getBooleanAttribute('support_lld'); + } + + // supported_restore_mode - computed: true, optional: false, required: false + public get supportedRestoreMode() { + return this.getStringAttribute('supported_restore_mode'); + } +} + +export class DataHuaweicloudCbrBackupExtendInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupExtendInfoOutputReference { + return new DataHuaweicloudCbrBackupExtendInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrBackupReplicationRecordsExtraInfo { +} + +export function dataHuaweicloudCbrBackupReplicationRecordsExtraInfoToTerraform(struct?: DataHuaweicloudCbrBackupReplicationRecordsExtraInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupReplicationRecordsExtraInfoToHclTerraform(struct?: DataHuaweicloudCbrBackupReplicationRecordsExtraInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupReplicationRecordsExtraInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupReplicationRecordsExtraInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupReplicationRecordsExtraInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // destination_vault_id - computed: true, optional: false, required: false + public get destinationVaultId() { + return this.getStringAttribute('destination_vault_id'); + } + + // fail_code - computed: true, optional: false, required: false + public get failCode() { + return this.getStringAttribute('fail_code'); + } + + // fail_reason - computed: true, optional: false, required: false + public get failReason() { + return this.getStringAttribute('fail_reason'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getNumberAttribute('progress'); + } +} + +export class DataHuaweicloudCbrBackupReplicationRecordsExtraInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupReplicationRecordsExtraInfoOutputReference { + return new DataHuaweicloudCbrBackupReplicationRecordsExtraInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrBackupReplicationRecords { +} + +export function dataHuaweicloudCbrBackupReplicationRecordsToTerraform(struct?: DataHuaweicloudCbrBackupReplicationRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrBackupReplicationRecordsToHclTerraform(struct?: DataHuaweicloudCbrBackupReplicationRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrBackupReplicationRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrBackupReplicationRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrBackupReplicationRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // destination_backup_id - computed: true, optional: false, required: false + public get destinationBackupId() { + return this.getStringAttribute('destination_backup_id'); + } + + // destination_checkpoint_id - computed: true, optional: false, required: false + public get destinationCheckpointId() { + return this.getStringAttribute('destination_checkpoint_id'); + } + + // destination_project_id - computed: true, optional: false, required: false + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + + // destination_region - computed: true, optional: false, required: false + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + + // destination_vault_id - computed: true, optional: false, required: false + public get destinationVaultId() { + return this.getStringAttribute('destination_vault_id'); + } + + // extra_info - computed: true, optional: false, required: false + private _extraInfo = new DataHuaweicloudCbrBackupReplicationRecordsExtraInfoList(this, "extra_info", false); + public get extraInfo() { + return this._extraInfo; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // source_backup_id - computed: true, optional: false, required: false + public get sourceBackupId() { + return this.getStringAttribute('source_backup_id'); + } + + // source_checkpoint_id - computed: true, optional: false, required: false + public get sourceCheckpointId() { + return this.getStringAttribute('source_checkpoint_id'); + } + + // source_project_id - computed: true, optional: false, required: false + public get sourceProjectId() { + return this.getStringAttribute('source_project_id'); + } + + // source_region - computed: true, optional: false, required: false + public get sourceRegion() { + return this.getStringAttribute('source_region'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vault_id - computed: true, optional: false, required: false + public get vaultId() { + return this.getStringAttribute('vault_id'); + } +} + +export class DataHuaweicloudCbrBackupReplicationRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrBackupReplicationRecordsOutputReference { + return new DataHuaweicloudCbrBackupReplicationRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup huaweicloud_cbr_backup} +*/ +export class DataHuaweicloudCbrBackup extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCbrBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCbrBackup to import + * @param importFromId The id of the existing DataHuaweicloudCbrBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCbrBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_backup huaweicloud_cbr_backup} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCbrBackupConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCbrBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // checkpoint_id - computed: true, optional: false, required: false + public get checkpointId() { + return this.getStringAttribute('checkpoint_id'); + } + + // children - computed: true, optional: false, required: false + private _children = new DataHuaweicloudCbrBackupChildrenList(this, "children", false); + public get children() { + return this._children; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // extend_info - computed: true, optional: false, required: false + private _extendInfo = new DataHuaweicloudCbrBackupExtendInfoList(this, "extend_info", false); + public get extendInfo() { + return this._extendInfo; + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parent_id - computed: true, optional: false, required: false + public get parentId() { + return this.getStringAttribute('parent_id'); + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replication_records - computed: true, optional: false, required: false + private _replicationRecords = new DataHuaweicloudCbrBackupReplicationRecordsList(this, "replication_records", false); + public get replicationRecords() { + return this._replicationRecords; + } + + // resource_az - computed: true, optional: false, required: false + public get resourceAz() { + return this.getStringAttribute('resource_az'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_size - computed: true, optional: false, required: false + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vault_id - computed: true, optional: false, required: false + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/README.md new file mode 100644 index 00000000..de5b445f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cbr_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cbr_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/index.ts new file mode 100644 index 00000000..80fa6127 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-policies/index.ts @@ -0,0 +1,700 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCbrPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Whether to enable the CBR policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#enabled DataHuaweicloudCbrPolicies#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#id DataHuaweicloudCbrPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of CBR policies to query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#name DataHuaweicloudCbrPolicies#name} + */ + readonly name?: string; + /** + * The ID of CBR policies to query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#policy_id DataHuaweicloudCbrPolicies#policy_id} + */ + readonly policyId?: string; + /** + * The region in which to query the CBR policies. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#region DataHuaweicloudCbrPolicies#region} + */ + readonly region?: string; + /** + * The type of CBR policies to query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#type DataHuaweicloudCbrPolicies#type} + */ + readonly type?: string; + /** + * The ID of vault to which the CBR policy resource belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#vault_id DataHuaweicloudCbrPolicies#vault_id} + */ + readonly vaultId?: string; +} +export interface DataHuaweicloudCbrPoliciesPoliciesAssociatedVaults { +} + +export function dataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsToTerraform(struct?: DataHuaweicloudCbrPoliciesPoliciesAssociatedVaults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsToHclTerraform(struct?: DataHuaweicloudCbrPoliciesPoliciesAssociatedVaults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrPoliciesPoliciesAssociatedVaults | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrPoliciesPoliciesAssociatedVaults | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination_vault_id - computed: true, optional: false, required: false + public get destinationVaultId() { + return this.getStringAttribute('destination_vault_id'); + } + + // vault_id - computed: true, optional: false, required: false + public get vaultId() { + return this.getStringAttribute('vault_id'); + } +} + +export class DataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsOutputReference { + return new DataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrPoliciesPoliciesBackupCycle { +} + +export function dataHuaweicloudCbrPoliciesPoliciesBackupCycleToTerraform(struct?: DataHuaweicloudCbrPoliciesPoliciesBackupCycle): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrPoliciesPoliciesBackupCycleToHclTerraform(struct?: DataHuaweicloudCbrPoliciesPoliciesBackupCycle): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrPoliciesPoliciesBackupCycleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrPoliciesPoliciesBackupCycle | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrPoliciesPoliciesBackupCycle | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // days - computed: true, optional: false, required: false + public get days() { + return this.getStringAttribute('days'); + } + + // execution_times - computed: true, optional: false, required: false + public get executionTimes() { + return this.getListAttribute('execution_times'); + } + + // interval - computed: true, optional: false, required: false + public get interval() { + return this.getNumberAttribute('interval'); + } +} + +export class DataHuaweicloudCbrPoliciesPoliciesBackupCycleList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrPoliciesPoliciesBackupCycleOutputReference { + return new DataHuaweicloudCbrPoliciesPoliciesBackupCycleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrPoliciesPoliciesLongTermRetention { +} + +export function dataHuaweicloudCbrPoliciesPoliciesLongTermRetentionToTerraform(struct?: DataHuaweicloudCbrPoliciesPoliciesLongTermRetention): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrPoliciesPoliciesLongTermRetentionToHclTerraform(struct?: DataHuaweicloudCbrPoliciesPoliciesLongTermRetention): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrPoliciesPoliciesLongTermRetentionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrPoliciesPoliciesLongTermRetention | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrPoliciesPoliciesLongTermRetention | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // daily - computed: true, optional: false, required: false + public get daily() { + return this.getNumberAttribute('daily'); + } + + // full_backup_interval - computed: true, optional: false, required: false + public get fullBackupInterval() { + return this.getNumberAttribute('full_backup_interval'); + } + + // monthly - computed: true, optional: false, required: false + public get monthly() { + return this.getNumberAttribute('monthly'); + } + + // weekly - computed: true, optional: false, required: false + public get weekly() { + return this.getNumberAttribute('weekly'); + } + + // yearly - computed: true, optional: false, required: false + public get yearly() { + return this.getNumberAttribute('yearly'); + } +} + +export class DataHuaweicloudCbrPoliciesPoliciesLongTermRetentionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrPoliciesPoliciesLongTermRetentionOutputReference { + return new DataHuaweicloudCbrPoliciesPoliciesLongTermRetentionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrPoliciesPolicies { +} + +export function dataHuaweicloudCbrPoliciesPoliciesToTerraform(struct?: DataHuaweicloudCbrPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudCbrPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated_vaults - computed: true, optional: false, required: false + private _associatedVaults = new DataHuaweicloudCbrPoliciesPoliciesAssociatedVaultsList(this, "associated_vaults", false); + public get associatedVaults() { + return this._associatedVaults; + } + + // backup_cycle - computed: true, optional: false, required: false + private _backupCycle = new DataHuaweicloudCbrPoliciesPoliciesBackupCycleList(this, "backup_cycle", false); + public get backupCycle() { + return this._backupCycle; + } + + // backup_quantity - computed: true, optional: false, required: false + public get backupQuantity() { + return this.getNumberAttribute('backup_quantity'); + } + + // destination_project_id - computed: true, optional: false, required: false + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + + // destination_region - computed: true, optional: false, required: false + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + + // enable_acceleration - computed: true, optional: false, required: false + public get enableAcceleration() { + return this.getBooleanAttribute('enable_acceleration'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // long_term_retention - computed: true, optional: false, required: false + private _longTermRetention = new DataHuaweicloudCbrPoliciesPoliciesLongTermRetentionList(this, "long_term_retention", false); + public get longTermRetention() { + return this._longTermRetention; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // time_period - computed: true, optional: false, required: false + public get timePeriod() { + return this.getNumberAttribute('time_period'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCbrPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrPoliciesPoliciesOutputReference { + return new DataHuaweicloudCbrPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies huaweicloud_cbr_policies} +*/ +export class DataHuaweicloudCbrPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCbrPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCbrPolicies to import + * @param importFromId The id of the existing DataHuaweicloudCbrPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCbrPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_policies huaweicloud_cbr_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCbrPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCbrPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._type = config.type; + this._vaultId = config.vaultId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudCbrPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vault_id - computed: false, optional: true, required: false + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + public resetVaultId() { + this._vaultId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vault_id: cdktf.stringToTerraform(this._vaultId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/README.md new file mode 100644 index 00000000..d065854b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cbr_vaults` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cbr_vaults`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/index.ts new file mode 100644 index 00000000..a83de1aa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cbr-vaults/index.ts @@ -0,0 +1,670 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCbrVaultsConfig extends cdktf.TerraformMetaArguments { + /** + * Whether to enable automatic expansion of the backup protection type vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#auto_expand_enabled DataHuaweicloudCbrVaults#auto_expand_enabled} + */ + readonly autoExpandEnabled?: boolean | cdktf.IResolvable; + /** + * The consistent level (specification) of the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#consistent_level DataHuaweicloudCbrVaults#consistent_level} + */ + readonly consistentLevel?: string; + /** + * The ID of the enterprise project to which the vault belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#enterprise_project_id DataHuaweicloudCbrVaults#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#id DataHuaweicloudCbrVaults#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The vault name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#name DataHuaweicloudCbrVaults#name} + */ + readonly name?: string; + /** + * The ID of the policy associated with the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#policy_id DataHuaweicloudCbrVaults#policy_id} + */ + readonly policyId?: string; + /** + * The protection type of the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#protection_type DataHuaweicloudCbrVaults#protection_type} + */ + readonly protectionType?: string; + /** + * The region in which to query the vaults. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#region DataHuaweicloudCbrVaults#region} + */ + readonly region?: string; + /** + * The vault sapacity, in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#size DataHuaweicloudCbrVaults#size} + */ + readonly size?: number; + /** + * The vault status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#status DataHuaweicloudCbrVaults#status} + */ + readonly status?: string; + /** + * The object type of the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#type DataHuaweicloudCbrVaults#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCbrVaultsVaultsResources { +} + +export function dataHuaweicloudCbrVaultsVaultsResourcesToTerraform(struct?: DataHuaweicloudCbrVaultsVaultsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrVaultsVaultsResourcesToHclTerraform(struct?: DataHuaweicloudCbrVaultsVaultsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrVaultsVaultsResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrVaultsVaultsResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrVaultsVaultsResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // excludes - computed: true, optional: false, required: false + public get excludes() { + return this.getListAttribute('excludes'); + } + + // includes - computed: true, optional: false, required: false + public get includes() { + return this.getListAttribute('includes'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } +} + +export class DataHuaweicloudCbrVaultsVaultsResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrVaultsVaultsResourcesOutputReference { + return new DataHuaweicloudCbrVaultsVaultsResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCbrVaultsVaults { +} + +export function dataHuaweicloudCbrVaultsVaultsToTerraform(struct?: DataHuaweicloudCbrVaultsVaults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCbrVaultsVaultsToHclTerraform(struct?: DataHuaweicloudCbrVaultsVaults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCbrVaultsVaultsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCbrVaultsVaults | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCbrVaultsVaults | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // allocated - computed: true, optional: false, required: false + public get allocated() { + return this.getNumberAttribute('allocated'); + } + + // auto_bind - computed: true, optional: false, required: false + public get autoBind() { + return this.getBooleanAttribute('auto_bind'); + } + + // auto_expand_enabled - computed: true, optional: false, required: false + public get autoExpandEnabled() { + return this.getBooleanAttribute('auto_expand_enabled'); + } + + // bind_rules - computed: true, optional: false, required: false + private _bindRules = new cdktf.StringMap(this, "bind_rules"); + public get bindRules() { + return this._bindRules; + } + + // consistent_level - computed: true, optional: false, required: false + public get consistentLevel() { + return this.getStringAttribute('consistent_level'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // protection_type - computed: true, optional: false, required: false + public get protectionType() { + return this.getStringAttribute('protection_type'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudCbrVaultsVaultsResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage - computed: true, optional: false, required: false + public get storage() { + return this.getStringAttribute('storage'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudCbrVaultsVaultsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCbrVaultsVaultsOutputReference { + return new DataHuaweicloudCbrVaultsVaultsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults huaweicloud_cbr_vaults} +*/ +export class DataHuaweicloudCbrVaults extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cbr_vaults"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCbrVaults resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCbrVaults to import + * @param importFromId The id of the existing DataHuaweicloudCbrVaults that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCbrVaults to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cbr_vaults", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cbr_vaults huaweicloud_cbr_vaults} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCbrVaultsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCbrVaultsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cbr_vaults', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoExpandEnabled = config.autoExpandEnabled; + this._consistentLevel = config.consistentLevel; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._protectionType = config.protectionType; + this._region = config.region; + this._size = config.size; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_expand_enabled - computed: false, optional: true, required: false + private _autoExpandEnabled?: boolean | cdktf.IResolvable; + public get autoExpandEnabled() { + return this.getBooleanAttribute('auto_expand_enabled'); + } + public set autoExpandEnabled(value: boolean | cdktf.IResolvable) { + this._autoExpandEnabled = value; + } + public resetAutoExpandEnabled() { + this._autoExpandEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoExpandEnabledInput() { + return this._autoExpandEnabled; + } + + // consistent_level - computed: false, optional: true, required: false + private _consistentLevel?: string; + public get consistentLevel() { + return this.getStringAttribute('consistent_level'); + } + public set consistentLevel(value: string) { + this._consistentLevel = value; + } + public resetConsistentLevel() { + this._consistentLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistentLevelInput() { + return this._consistentLevel; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protection_type - computed: false, optional: true, required: false + private _protectionType?: string; + public get protectionType() { + return this.getStringAttribute('protection_type'); + } + public set protectionType(value: string) { + this._protectionType = value; + } + public resetProtectionType() { + this._protectionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionTypeInput() { + return this._protectionType; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vaults - computed: true, optional: false, required: false + private _vaults = new DataHuaweicloudCbrVaultsVaultsList(this, "vaults", false); + public get vaults() { + return this._vaults; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_expand_enabled: cdktf.booleanToTerraform(this._autoExpandEnabled), + consistent_level: cdktf.stringToTerraform(this._consistentLevel), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + protection_type: cdktf.stringToTerraform(this._protectionType), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_expand_enabled: { + value: cdktf.booleanToHclTerraform(this._autoExpandEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + consistent_level: { + value: cdktf.stringToHclTerraform(this._consistentLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_type: { + value: cdktf.stringToHclTerraform(this._protectionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/README.md new file mode 100644 index 00000000..88cf931b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_authorizations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_authorizations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/index.ts new file mode 100644 index 00000000..69285110 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-authorizations/index.ts @@ -0,0 +1,467 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcAuthorizationsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the cross-account authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#authorization_id DataHuaweicloudCcAuthorizations#authorization_id} + */ + readonly authorizationId?: string; + /** + * Specifies the account ID that the cloud connection belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#cloud_connection_domain_id DataHuaweicloudCcAuthorizations#cloud_connection_domain_id} + */ + readonly cloudConnectionDomainId?: string; + /** + * Specifies the cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#cloud_connection_id DataHuaweicloudCcAuthorizations#cloud_connection_id} + */ + readonly cloudConnectionId?: string; + /** + * Specifies the description of the cross-account authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#description DataHuaweicloudCcAuthorizations#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#id DataHuaweicloudCcAuthorizations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the network instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#instance_id DataHuaweicloudCcAuthorizations#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the name of the cross-account authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#name DataHuaweicloudCcAuthorizations#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#region DataHuaweicloudCcAuthorizations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCcAuthorizationsAuthorizations { +} + +export function dataHuaweicloudCcAuthorizationsAuthorizationsToTerraform(struct?: DataHuaweicloudCcAuthorizationsAuthorizations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcAuthorizationsAuthorizationsToHclTerraform(struct?: DataHuaweicloudCcAuthorizationsAuthorizations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcAuthorizationsAuthorizationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcAuthorizationsAuthorizations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcAuthorizationsAuthorizations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_connection_domain_id - computed: true, optional: false, required: false + public get cloudConnectionDomainId() { + return this.getStringAttribute('cloud_connection_domain_id'); + } + + // cloud_connection_id - computed: true, optional: false, required: false + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcAuthorizationsAuthorizationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcAuthorizationsAuthorizationsOutputReference { + return new DataHuaweicloudCcAuthorizationsAuthorizationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations huaweicloud_cc_authorizations} +*/ +export class DataHuaweicloudCcAuthorizations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_authorizations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcAuthorizations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcAuthorizations to import + * @param importFromId The id of the existing DataHuaweicloudCcAuthorizations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcAuthorizations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_authorizations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_authorizations huaweicloud_cc_authorizations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcAuthorizationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcAuthorizationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_authorizations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authorizationId = config.authorizationId; + this._cloudConnectionDomainId = config.cloudConnectionDomainId; + this._cloudConnectionId = config.cloudConnectionId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // authorization_id - computed: false, optional: true, required: false + private _authorizationId?: string; + public get authorizationId() { + return this.getStringAttribute('authorization_id'); + } + public set authorizationId(value: string) { + this._authorizationId = value; + } + public resetAuthorizationId() { + this._authorizationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizationIdInput() { + return this._authorizationId; + } + + // authorizations - computed: true, optional: false, required: false + private _authorizations = new DataHuaweicloudCcAuthorizationsAuthorizationsList(this, "authorizations", false); + public get authorizations() { + return this._authorizations; + } + + // cloud_connection_domain_id - computed: false, optional: true, required: false + private _cloudConnectionDomainId?: string; + public get cloudConnectionDomainId() { + return this.getStringAttribute('cloud_connection_domain_id'); + } + public set cloudConnectionDomainId(value: string) { + this._cloudConnectionDomainId = value; + } + public resetCloudConnectionDomainId() { + this._cloudConnectionDomainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionDomainIdInput() { + return this._cloudConnectionDomainId; + } + + // cloud_connection_id - computed: false, optional: true, required: false + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + public resetCloudConnectionId() { + this._cloudConnectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + authorization_id: cdktf.stringToTerraform(this._authorizationId), + cloud_connection_domain_id: cdktf.stringToTerraform(this._cloudConnectionDomainId), + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + authorization_id: { + value: cdktf.stringToHclTerraform(this._authorizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_connection_domain_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionDomainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/README.md new file mode 100644 index 00000000..fef5613a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_bandwidth_packages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_bandwidth_packages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/index.ts new file mode 100644 index 00000000..3d122b7a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-bandwidth-packages/index.ts @@ -0,0 +1,568 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcBandwidthPackagesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies Bandwidth range specified for the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#bandwidth DataHuaweicloudCcBandwidthPackages#bandwidth} + */ + readonly bandwidth?: number; + /** + * Specifies the bandwidth package ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#bandwidth_package_id DataHuaweicloudCcBandwidthPackages#bandwidth_package_id} + */ + readonly bandwidthPackageId?: string; + /** + * Specifies the billing mode of the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#billing_mode DataHuaweicloudCcBandwidthPackages#billing_mode} + */ + readonly billingMode?: string; + /** + * Specifies the ID of the enterprise project that the bandwidth package belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#enterprise_project_id DataHuaweicloudCcBandwidthPackages#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#id DataHuaweicloudCcBandwidthPackages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the bandwidth package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#name DataHuaweicloudCcBandwidthPackages#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#region DataHuaweicloudCcBandwidthPackages#region} + */ + readonly region?: string; + /** + * Specifies the ID of the resource that the bandwidth package is bound to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#resource_id DataHuaweicloudCcBandwidthPackages#resource_id} + */ + readonly resourceId?: string; + /** + * Specifies the bandwidth package status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#status DataHuaweicloudCcBandwidthPackages#status} + */ + readonly status?: string; + /** + * Specifies the tags of the bandwidth package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#tags DataHuaweicloudCcBandwidthPackages#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudCcBandwidthPackagesBandwidthPackages { +} + +export function dataHuaweicloudCcBandwidthPackagesBandwidthPackagesToTerraform(struct?: DataHuaweicloudCcBandwidthPackagesBandwidthPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcBandwidthPackagesBandwidthPackagesToHclTerraform(struct?: DataHuaweicloudCcBandwidthPackagesBandwidthPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcBandwidthPackagesBandwidthPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcBandwidthPackagesBandwidthPackages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcBandwidthPackagesBandwidthPackages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getStringAttribute('billing_mode'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // interflow_mode - computed: true, optional: false, required: false + public get interflowMode() { + return this.getStringAttribute('interflow_mode'); + } + + // local_area_id - computed: true, optional: false, required: false + public get localAreaId() { + return this.getStringAttribute('local_area_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // remote_area_id - computed: true, optional: false, required: false + public get remoteAreaId() { + return this.getStringAttribute('remote_area_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcBandwidthPackagesBandwidthPackagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcBandwidthPackagesBandwidthPackagesOutputReference { + return new DataHuaweicloudCcBandwidthPackagesBandwidthPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages huaweicloud_cc_bandwidth_packages} +*/ +export class DataHuaweicloudCcBandwidthPackages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_bandwidth_packages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcBandwidthPackages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcBandwidthPackages to import + * @param importFromId The id of the existing DataHuaweicloudCcBandwidthPackages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcBandwidthPackages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_bandwidth_packages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_bandwidth_packages huaweicloud_cc_bandwidth_packages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcBandwidthPackagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcBandwidthPackagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_bandwidth_packages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidth = config.bandwidth; + this._bandwidthPackageId = config.bandwidthPackageId; + this._billingMode = config.billingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._resourceId = config.resourceId; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth - computed: false, optional: true, required: false + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + public resetBandwidth() { + this._bandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // bandwidth_package_id - computed: false, optional: true, required: false + private _bandwidthPackageId?: string; + public get bandwidthPackageId() { + return this.getStringAttribute('bandwidth_package_id'); + } + public set bandwidthPackageId(value: string) { + this._bandwidthPackageId = value; + } + public resetBandwidthPackageId() { + this._bandwidthPackageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthPackageIdInput() { + return this._bandwidthPackageId; + } + + // bandwidth_packages - computed: true, optional: false, required: false + private _bandwidthPackages = new DataHuaweicloudCcBandwidthPackagesBandwidthPackagesList(this, "bandwidth_packages", false); + public get bandwidthPackages() { + return this._bandwidthPackages; + } + + // billing_mode - computed: false, optional: true, required: false + private _billingMode?: string; + public get billingMode() { + return this.getStringAttribute('billing_mode'); + } + public set billingMode(value: string) { + this._billingMode = value; + } + public resetBillingMode() { + this._billingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get billingModeInput() { + return this._billingMode; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth: cdktf.numberToTerraform(this._bandwidth), + bandwidth_package_id: cdktf.stringToTerraform(this._bandwidthPackageId), + billing_mode: cdktf.stringToTerraform(this._billingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + bandwidth_package_id: { + value: cdktf.stringToHclTerraform(this._bandwidthPackageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + billing_mode: { + value: cdktf.stringToHclTerraform(this._billingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/README.md new file mode 100644 index 00000000..18907ecf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_network_attachments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_network_attachments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/index.ts new file mode 100644 index 00000000..5cc751a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-attachments/index.ts @@ -0,0 +1,620 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworkAttachmentsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the attachment ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#attachment_id DataHuaweicloudCcCentralNetworkAttachments#attachment_id} + */ + readonly attachmentId?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#attachment_instance_id DataHuaweicloudCcCentralNetworkAttachments#attachment_instance_id} + */ + readonly attachmentInstanceId?: string; + /** + * Specifies the type of attachment instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#attachment_instance_type DataHuaweicloudCcCentralNetworkAttachments#attachment_instance_type} + */ + readonly attachmentInstanceType?: string; + /** + * Specifies the central network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#central_network_id DataHuaweicloudCcCentralNetworkAttachments#central_network_id} + */ + readonly centralNetworkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#id DataHuaweicloudCcCentralNetworkAttachments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the attachment name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#name DataHuaweicloudCcCentralNetworkAttachments#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#region DataHuaweicloudCcCentralNetworkAttachments#region} + */ + readonly region?: string; + /** + * Specifies the attachment status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#state DataHuaweicloudCcCentralNetworkAttachments#state} + */ + readonly state?: string; +} +export interface DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValue { +} + +export function dataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueToTerraform(struct?: DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValue): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValue): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValue | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValue | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // approved_state - computed: true, optional: false, required: false + public get approvedState() { + return this.getStringAttribute('approved_state'); + } + + // attached_er_id - computed: true, optional: false, required: false + public get attachedErId() { + return this.getStringAttribute('attached_er_id'); + } + + // enterprise_router_table_id - computed: true, optional: false, required: false + public get enterpriseRouterTableId() { + return this.getStringAttribute('enterprise_router_table_id'); + } + + // hosted_cloud - computed: true, optional: false, required: false + public get hostedCloud() { + return this.getStringAttribute('hosted_cloud'); + } + + // reason - computed: true, optional: false, required: false + public get reason() { + return this.getStringAttribute('reason'); + } +} + +export class DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueOutputReference { + return new DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachments { +} + +export function dataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsToTerraform(struct?: DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // attachment_instance_id - computed: true, optional: false, required: false + public get attachmentInstanceId() { + return this.getStringAttribute('attachment_instance_id'); + } + + // attachment_instance_project_id - computed: true, optional: false, required: false + public get attachmentInstanceProjectId() { + return this.getStringAttribute('attachment_instance_project_id'); + } + + // attachment_instance_region_id - computed: true, optional: false, required: false + public get attachmentInstanceRegionId() { + return this.getStringAttribute('attachment_instance_region_id'); + } + + // attachment_instance_site_code - computed: true, optional: false, required: false + public get attachmentInstanceSiteCode() { + return this.getStringAttribute('attachment_instance_site_code'); + } + + // attachment_instance_type - computed: true, optional: false, required: false + public get attachmentInstanceType() { + return this.getStringAttribute('attachment_instance_type'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // bandwidth_type - computed: true, optional: false, required: false + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + + // central_network_id - computed: true, optional: false, required: false + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + + // central_network_plane_id - computed: true, optional: false, required: false + public get centralNetworkPlaneId() { + return this.getStringAttribute('central_network_plane_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enterprise_router_attachment_id - computed: true, optional: false, required: false + public get enterpriseRouterAttachmentId() { + return this.getStringAttribute('enterprise_router_attachment_id'); + } + + // enterprise_router_id - computed: true, optional: false, required: false + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + + // enterprise_router_project_id - computed: true, optional: false, required: false + public get enterpriseRouterProjectId() { + return this.getStringAttribute('enterprise_router_project_id'); + } + + // enterprise_router_region_id - computed: true, optional: false, required: false + public get enterpriseRouterRegionId() { + return this.getStringAttribute('enterprise_router_region_id'); + } + + // enterprise_router_site_code - computed: true, optional: false, required: false + public get enterpriseRouterSiteCode() { + return this.getStringAttribute('enterprise_router_site_code'); + } + + // global_connection_bandwidth_id - computed: true, optional: false, required: false + public get globalConnectionBandwidthId() { + return this.getStringAttribute('global_connection_bandwidth_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_frozen - computed: true, optional: false, required: false + public get isFrozen() { + return this.getBooleanAttribute('is_frozen'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // specification_value - computed: true, optional: false, required: false + private _specificationValue = new DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsSpecificationValueList(this, "specification_value", false); + public get specificationValue() { + return this._specificationValue; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsOutputReference { + return new DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments huaweicloud_cc_central_network_attachments} +*/ +export class DataHuaweicloudCcCentralNetworkAttachments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_attachments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworkAttachments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworkAttachments to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworkAttachments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworkAttachments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_attachments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_attachments huaweicloud_cc_central_network_attachments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworkAttachmentsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworkAttachmentsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_attachments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._attachmentInstanceId = config.attachmentInstanceId; + this._attachmentInstanceType = config.attachmentInstanceType; + this._centralNetworkId = config.centralNetworkId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._state = config.state; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_id - computed: false, optional: true, required: false + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + public resetAttachmentId() { + this._attachmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // attachment_instance_id - computed: false, optional: true, required: false + private _attachmentInstanceId?: string; + public get attachmentInstanceId() { + return this.getStringAttribute('attachment_instance_id'); + } + public set attachmentInstanceId(value: string) { + this._attachmentInstanceId = value; + } + public resetAttachmentInstanceId() { + this._attachmentInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentInstanceIdInput() { + return this._attachmentInstanceId; + } + + // attachment_instance_type - computed: false, optional: true, required: false + private _attachmentInstanceType?: string; + public get attachmentInstanceType() { + return this.getStringAttribute('attachment_instance_type'); + } + public set attachmentInstanceType(value: string) { + this._attachmentInstanceType = value; + } + public resetAttachmentInstanceType() { + this._attachmentInstanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentInstanceTypeInput() { + return this._attachmentInstanceType; + } + + // central_network_attachments - computed: true, optional: false, required: false + private _centralNetworkAttachments = new DataHuaweicloudCcCentralNetworkAttachmentsCentralNetworkAttachmentsList(this, "central_network_attachments", false); + public get centralNetworkAttachments() { + return this._centralNetworkAttachments; + } + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + attachment_instance_id: cdktf.stringToTerraform(this._attachmentInstanceId), + attachment_instance_type: cdktf.stringToTerraform(this._attachmentInstanceType), + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + state: cdktf.stringToTerraform(this._state), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attachment_instance_id: { + value: cdktf.stringToHclTerraform(this._attachmentInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attachment_instance_type: { + value: cdktf.stringToHclTerraform(this._attachmentInstanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/README.md new file mode 100644 index 00000000..70dca766 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_network_capabilities` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_network_capabilities`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/index.ts new file mode 100644 index 00000000..ca296c28 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-capabilities/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworkCapabilitiesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the capability of the central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities#capability DataHuaweicloudCcCentralNetworkCapabilities#capability} + */ + readonly capability?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities#id DataHuaweicloudCcCentralNetworkCapabilities#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities#region DataHuaweicloudCcCentralNetworkCapabilities#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCcCentralNetworkCapabilitiesCapabilities { +} + +export function dataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesToTerraform(struct?: DataHuaweicloudCcCentralNetworkCapabilitiesCapabilities): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkCapabilitiesCapabilities): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkCapabilitiesCapabilities | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkCapabilitiesCapabilities | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // capability - computed: true, optional: false, required: false + public get capability() { + return this.getStringAttribute('capability'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // specifications - computed: true, optional: false, required: false + public get specifications() { + return this.getStringAttribute('specifications'); + } +} + +export class DataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesOutputReference { + return new DataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities huaweicloud_cc_central_network_capabilities} +*/ +export class DataHuaweicloudCcCentralNetworkCapabilities extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_capabilities"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworkCapabilities resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworkCapabilities to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworkCapabilities that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworkCapabilities to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_capabilities", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_capabilities huaweicloud_cc_central_network_capabilities} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworkCapabilitiesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworkCapabilitiesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_capabilities', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._capability = config.capability; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // capabilities - computed: true, optional: false, required: false + private _capabilities = new DataHuaweicloudCcCentralNetworkCapabilitiesCapabilitiesList(this, "capabilities", false); + public get capabilities() { + return this._capabilities; + } + + // capability - computed: false, optional: true, required: false + private _capability?: string; + public get capability() { + return this.getStringAttribute('capability'); + } + public set capability(value: string) { + this._capability = value; + } + public resetCapability() { + this._capability = undefined; + } + // Temporarily expose input value. Use with caution. + public get capabilityInput() { + return this._capability; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + capability: cdktf.stringToTerraform(this._capability), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + capability: { + value: cdktf.stringToHclTerraform(this._capability), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/README.md new file mode 100644 index 00000000..b4589ccb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_network_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_network_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/index.ts new file mode 100644 index 00000000..13f64453 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-connections/index.ts @@ -0,0 +1,605 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworkConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the bandwidth type of the central network connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#bandwidth_type DataHuaweicloudCcCentralNetworkConnections#bandwidth_type} + */ + readonly bandwidthType?: string; + /** + * Specifies the central network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#central_network_id DataHuaweicloudCcCentralNetworkConnections#central_network_id} + */ + readonly centralNetworkId: string; + /** + * Specifies the central network connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#connection_id DataHuaweicloudCcCentralNetworkConnections#connection_id} + */ + readonly connectionId?: string; + /** + * Specifies the bandwidth package ID of the central network connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#global_connection_bandwidth_id DataHuaweicloudCcCentralNetworkConnections#global_connection_bandwidth_id} + */ + readonly globalConnectionBandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#id DataHuaweicloudCcCentralNetworkConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether there are different regions. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#is_cross_region DataHuaweicloudCcCentralNetworkConnections#is_cross_region} + */ + readonly isCrossRegion?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#region DataHuaweicloudCcCentralNetworkConnections#region} + */ + readonly region?: string; + /** + * Specifies the central network connection status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#status DataHuaweicloudCcCentralNetworkConnections#status} + */ + readonly status?: string; + /** + * Specifies the central network connection type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#type DataHuaweicloudCcCentralNetworkConnections#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPair { +} + +export function dataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairToTerraform(struct?: DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPair): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPair): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPair | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPair | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // site_code - computed: true, optional: false, required: false + public get siteCode() { + return this.getStringAttribute('site_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairOutputReference { + return new DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnections { +} + +export function dataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsToTerraform(struct?: DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // bandwidth_type - computed: true, optional: false, required: false + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + + // central_network_id - computed: true, optional: false, required: false + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + + // central_network_plane_id - computed: true, optional: false, required: false + public get centralNetworkPlaneId() { + return this.getStringAttribute('central_network_plane_id'); + } + + // connection_point_pair - computed: true, optional: false, required: false + private _connectionPointPair = new DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsConnectionPointPairList(this, "connection_point_pair", false); + public get connectionPointPair() { + return this._connectionPointPair; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // global_connection_bandwidth_id - computed: true, optional: false, required: false + public get globalConnectionBandwidthId() { + return this.getStringAttribute('global_connection_bandwidth_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_frozen - computed: true, optional: false, required: false + public get isFrozen() { + return this.getBooleanAttribute('is_frozen'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsOutputReference { + return new DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections huaweicloud_cc_central_network_connections} +*/ +export class DataHuaweicloudCcCentralNetworkConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworkConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworkConnections to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworkConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworkConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_connections huaweicloud_cc_central_network_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworkConnectionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworkConnectionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthType = config.bandwidthType; + this._centralNetworkId = config.centralNetworkId; + this._connectionId = config.connectionId; + this._globalConnectionBandwidthId = config.globalConnectionBandwidthId; + this._id = config.id; + this._isCrossRegion = config.isCrossRegion; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_type - computed: false, optional: true, required: false + private _bandwidthType?: string; + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + public set bandwidthType(value: string) { + this._bandwidthType = value; + } + public resetBandwidthType() { + this._bandwidthType = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthTypeInput() { + return this._bandwidthType; + } + + // central_network_connections - computed: true, optional: false, required: false + private _centralNetworkConnections = new DataHuaweicloudCcCentralNetworkConnectionsCentralNetworkConnectionsList(this, "central_network_connections", false); + public get centralNetworkConnections() { + return this._centralNetworkConnections; + } + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // global_connection_bandwidth_id - computed: false, optional: true, required: false + private _globalConnectionBandwidthId?: string; + public get globalConnectionBandwidthId() { + return this.getStringAttribute('global_connection_bandwidth_id'); + } + public set globalConnectionBandwidthId(value: string) { + this._globalConnectionBandwidthId = value; + } + public resetGlobalConnectionBandwidthId() { + this._globalConnectionBandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalConnectionBandwidthIdInput() { + return this._globalConnectionBandwidthId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_cross_region - computed: false, optional: true, required: false + private _isCrossRegion?: string; + public get isCrossRegion() { + return this.getStringAttribute('is_cross_region'); + } + public set isCrossRegion(value: string) { + this._isCrossRegion = value; + } + public resetIsCrossRegion() { + this._isCrossRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get isCrossRegionInput() { + return this._isCrossRegion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_type: cdktf.stringToTerraform(this._bandwidthType), + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + connection_id: cdktf.stringToTerraform(this._connectionId), + global_connection_bandwidth_id: cdktf.stringToTerraform(this._globalConnectionBandwidthId), + id: cdktf.stringToTerraform(this._id), + is_cross_region: cdktf.stringToTerraform(this._isCrossRegion), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_type: { + value: cdktf.stringToHclTerraform(this._bandwidthType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_connection_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._globalConnectionBandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_cross_region: { + value: cdktf.stringToHclTerraform(this._isCrossRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/README.md new file mode 100644 index 00000000..95b1110f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_network_policies_change_set` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_network_policies_change_set`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/index.ts new file mode 100644 index 00000000..2aab5797 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies-change-set/index.ts @@ -0,0 +1,282 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworkPoliciesChangeSetConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies central network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set#central_network_id DataHuaweicloudCcCentralNetworkPoliciesChangeSet#central_network_id} + */ + readonly centralNetworkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set#id DataHuaweicloudCcCentralNetworkPoliciesChangeSet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies central network policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set#policy_id DataHuaweicloudCcCentralNetworkPoliciesChangeSet#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set#region DataHuaweicloudCcCentralNetworkPoliciesChangeSet#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSet { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSet): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSet): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSet | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSet | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // change_content - computed: true, optional: false, required: false + private _changeContent = new cdktf.StringMap(this, "change_content"); + public get changeContent() { + return this._changeContent; + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set huaweicloud_cc_central_network_policies_change_set} +*/ +export class DataHuaweicloudCcCentralNetworkPoliciesChangeSet extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_policies_change_set"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworkPoliciesChangeSet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworkPoliciesChangeSet to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworkPoliciesChangeSet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworkPoliciesChangeSet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_policies_change_set", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies_change_set huaweicloud_cc_central_network_policies_change_set} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworkPoliciesChangeSetConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworkPoliciesChangeSetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_policies_change_set', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._centralNetworkId = config.centralNetworkId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // central_network_policy_change_set - computed: true, optional: false, required: false + private _centralNetworkPolicyChangeSet = new DataHuaweicloudCcCentralNetworkPoliciesChangeSetCentralNetworkPolicyChangeSetList(this, "central_network_policy_change_set", false); + public get centralNetworkPolicyChangeSet() { + return this._centralNetworkPolicyChangeSet; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/README.md new file mode 100644 index 00000000..d2ed6eee --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_network_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_network_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/index.ts new file mode 100644 index 00000000..0c3b72f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-policies/index.ts @@ -0,0 +1,890 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworkPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#central_network_id DataHuaweicloudCcCentralNetworkPolicies#central_network_id} + */ + readonly centralNetworkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#id DataHuaweicloudCcCentralNetworkPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the central network policy is applied or not. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#is_applied DataHuaweicloudCcCentralNetworkPolicies#is_applied} + */ + readonly isApplied?: string; + /** + * Specifies the ID of central network policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#policy_id DataHuaweicloudCcCentralNetworkPolicies#policy_id} + */ + readonly policyId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#region DataHuaweicloudCcCentralNetworkPolicies#region} + */ + readonly region?: string; + /** + * Specifies the status of central network policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#status DataHuaweicloudCcCentralNetworkPolicies#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstances { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enterprise_router_id - computed: true, optional: false, required: false + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTables { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enterprise_router_id - computed: true, optional: false, required: false + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + + // enterprise_router_table_id - computed: true, optional: false, required: false + public get enterpriseRouterTableId() { + return this.getStringAttribute('enterprise_router_table_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstances { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enterprise_router_id - computed: true, optional: false, required: false + public get enterpriseRouterId() { + return this.getStringAttribute('enterprise_router_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnections { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // exclude_er_instances - computed: true, optional: false, required: false + private _excludeErInstances = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsExcludeErInstancesList(this, "exclude_er_instances", false); + public get excludeErInstances() { + return this._excludeErInstances; + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanes { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associate_er_tables - computed: true, optional: false, required: false + private _associateErTables = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesAssociateErTablesList(this, "associate_er_tables", false); + public get associateErTables() { + return this._associateErTables; + } + + // exclude_er_connections - computed: true, optional: false, required: false + private _excludeErConnections = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesExcludeErConnectionsList(this, "exclude_er_connections", false); + public get excludeErConnections() { + return this._excludeErConnections; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocument { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocument): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocument): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocument | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocument | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default_plane - computed: true, optional: false, required: false + public get defaultPlane() { + return this.getStringAttribute('default_plane'); + } + + // er_instances - computed: true, optional: false, required: false + private _erInstances = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentErInstancesList(this, "er_instances", false); + public get erInstances() { + return this._erInstances; + } + + // planes - computed: true, optional: false, required: false + private _planes = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentPlanesList(this, "planes", false); + public get planes() { + return this._planes; + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPolicies { +} + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesToTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // central_network_id - computed: true, optional: false, required: false + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // document - computed: true, optional: false, required: false + private _document = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesDocumentList(this, "document", false); + public get document() { + return this._document; + } + + // document_template_version - computed: true, optional: false, required: false + public get documentTemplateVersion() { + return this.getStringAttribute('document_template_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_applied - computed: true, optional: false, required: false + public get isApplied() { + return this.getBooleanAttribute('is_applied'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } +} + +export class DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesOutputReference { + return new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies huaweicloud_cc_central_network_policies} +*/ +export class DataHuaweicloudCcCentralNetworkPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworkPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworkPolicies to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworkPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworkPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_policies huaweicloud_cc_central_network_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworkPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworkPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._centralNetworkId = config.centralNetworkId; + this._id = config.id; + this._isApplied = config.isApplied; + this._policyId = config.policyId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // central_network_id - computed: false, optional: false, required: true + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // central_network_policies - computed: true, optional: false, required: false + private _centralNetworkPolicies = new DataHuaweicloudCcCentralNetworkPoliciesCentralNetworkPoliciesList(this, "central_network_policies", false); + public get centralNetworkPolicies() { + return this._centralNetworkPolicies; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_applied - computed: false, optional: true, required: false + private _isApplied?: string; + public get isApplied() { + return this.getStringAttribute('is_applied'); + } + public set isApplied(value: string) { + this._isApplied = value; + } + public resetIsApplied() { + this._isApplied = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAppliedInput() { + return this._isApplied; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + id: cdktf.stringToTerraform(this._id), + is_applied: cdktf.stringToTerraform(this._isApplied), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_applied: { + value: cdktf.stringToHclTerraform(this._isApplied), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/README.md new file mode 100644 index 00000000..b0bfa076 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_network_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_network_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/index.ts new file mode 100644 index 00000000..7705ef00 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-network-quotas/index.ts @@ -0,0 +1,272 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworkQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas#id DataHuaweicloudCcCentralNetworkQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the quota type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas#quota_type DataHuaweicloudCcCentralNetworkQuotas#quota_type} + */ + readonly quotaType?: string[]; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas#region DataHuaweicloudCcCentralNetworkQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCcCentralNetworkQuotasQuotas { +} + +export function dataHuaweicloudCcCentralNetworkQuotasQuotasToTerraform(struct?: DataHuaweicloudCcCentralNetworkQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworkQuotasQuotasToHclTerraform(struct?: DataHuaweicloudCcCentralNetworkQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworkQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworkQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworkQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // quota_key - computed: true, optional: false, required: false + public get quotaKey() { + return this.getStringAttribute('quota_key'); + } + + // quota_limit - computed: true, optional: false, required: false + public get quotaLimit() { + return this.getNumberAttribute('quota_limit'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudCcCentralNetworkQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworkQuotasQuotasOutputReference { + return new DataHuaweicloudCcCentralNetworkQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas huaweicloud_cc_central_network_quotas} +*/ +export class DataHuaweicloudCcCentralNetworkQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_network_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworkQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworkQuotas to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworkQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworkQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_network_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_network_quotas huaweicloud_cc_central_network_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworkQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworkQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_network_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._quotaType = config.quotaType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quota_type - computed: false, optional: true, required: false + private _quotaType?: string[]; + public get quotaType() { + return this.getListAttribute('quota_type'); + } + public set quotaType(value: string[]) { + this._quotaType = value; + } + public resetQuotaType() { + this._quotaType = undefined; + } + // Temporarily expose input value. Use with caution. + public get quotaTypeInput() { + return this._quotaType; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudCcCentralNetworkQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + quota_type: cdktf.listMapper(cdktf.stringToTerraform, false)(this._quotaType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quota_type: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._quotaType), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/README.md new file mode 100644 index 00000000..a71581e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_central_networks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_central_networks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/index.ts new file mode 100644 index 00000000..79c4c1fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-central-networks/index.ts @@ -0,0 +1,416 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcCentralNetworksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#central_network_id DataHuaweicloudCcCentralNetworks#central_network_id} + */ + readonly centralNetworkId?: string; + /** + * Specifies enterprise project ID to which the central network belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#enterprise_project_id DataHuaweicloudCcCentralNetworks#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#id DataHuaweicloudCcCentralNetworks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the central network. The name supports fuzzy query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#name DataHuaweicloudCcCentralNetworks#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#region DataHuaweicloudCcCentralNetworks#region} + */ + readonly region?: string; + /** + * Specifies the status of the central network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#state DataHuaweicloudCcCentralNetworks#state} + */ + readonly state?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#tags DataHuaweicloudCcCentralNetworks#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudCcCentralNetworksCentralNetworks { +} + +export function dataHuaweicloudCcCentralNetworksCentralNetworksToTerraform(struct?: DataHuaweicloudCcCentralNetworksCentralNetworks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcCentralNetworksCentralNetworksToHclTerraform(struct?: DataHuaweicloudCcCentralNetworksCentralNetworks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcCentralNetworksCentralNetworksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcCentralNetworksCentralNetworks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcCentralNetworksCentralNetworks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_plane_id - computed: true, optional: false, required: false + public get defaultPlaneId() { + return this.getStringAttribute('default_plane_id'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcCentralNetworksCentralNetworksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcCentralNetworksCentralNetworksOutputReference { + return new DataHuaweicloudCcCentralNetworksCentralNetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks huaweicloud_cc_central_networks} +*/ +export class DataHuaweicloudCcCentralNetworks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_central_networks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcCentralNetworks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcCentralNetworks to import + * @param importFromId The id of the existing DataHuaweicloudCcCentralNetworks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcCentralNetworks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_central_networks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_central_networks huaweicloud_cc_central_networks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcCentralNetworksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcCentralNetworksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_central_networks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._centralNetworkId = config.centralNetworkId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._state = config.state; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // central_network_id - computed: false, optional: true, required: false + private _centralNetworkId?: string; + public get centralNetworkId() { + return this.getStringAttribute('central_network_id'); + } + public set centralNetworkId(value: string) { + this._centralNetworkId = value; + } + public resetCentralNetworkId() { + this._centralNetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get centralNetworkIdInput() { + return this._centralNetworkId; + } + + // central_networks - computed: true, optional: false, required: false + private _centralNetworks = new DataHuaweicloudCcCentralNetworksCentralNetworksList(this, "central_networks", false); + public get centralNetworks() { + return this._centralNetworks; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + central_network_id: cdktf.stringToTerraform(this._centralNetworkId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + state: cdktf.stringToTerraform(this._state), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + central_network_id: { + value: cdktf.stringToHclTerraform(this._centralNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/README.md new file mode 100644 index 00000000..bf72410a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_connection_routes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_connection_routes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/index.ts new file mode 100644 index 00000000..c684bafc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-routes/index.ts @@ -0,0 +1,377 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcConnectionRoutesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#cloud_connection_id DataHuaweicloudCcConnectionRoutes#cloud_connection_id} + */ + readonly cloudConnectionId?: string; + /** + * Specifies cloud connection route ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#cloud_connection_route_id DataHuaweicloudCcConnectionRoutes#cloud_connection_route_id} + */ + readonly cloudConnectionRouteId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#id DataHuaweicloudCcConnectionRoutes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies network instance ID of cloud connection route. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#instance_id DataHuaweicloudCcConnectionRoutes#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#region DataHuaweicloudCcConnectionRoutes#region} + */ + readonly region?: string; + /** + * Specifies region ID of cloud connection route. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#region_id DataHuaweicloudCcConnectionRoutes#region_id} + */ + readonly regionId?: string; +} +export interface DataHuaweicloudCcConnectionRoutesCloudConnectionRoutes { +} + +export function dataHuaweicloudCcConnectionRoutesCloudConnectionRoutesToTerraform(struct?: DataHuaweicloudCcConnectionRoutesCloudConnectionRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcConnectionRoutesCloudConnectionRoutesToHclTerraform(struct?: DataHuaweicloudCcConnectionRoutesCloudConnectionRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcConnectionRoutesCloudConnectionRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcConnectionRoutesCloudConnectionRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcConnectionRoutesCloudConnectionRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_connection_id - computed: true, optional: false, required: false + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCcConnectionRoutesCloudConnectionRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcConnectionRoutesCloudConnectionRoutesOutputReference { + return new DataHuaweicloudCcConnectionRoutesCloudConnectionRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes huaweicloud_cc_connection_routes} +*/ +export class DataHuaweicloudCcConnectionRoutes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_connection_routes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcConnectionRoutes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcConnectionRoutes to import + * @param importFromId The id of the existing DataHuaweicloudCcConnectionRoutes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcConnectionRoutes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_connection_routes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_routes huaweicloud_cc_connection_routes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcConnectionRoutesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcConnectionRoutesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_connection_routes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cloudConnectionId = config.cloudConnectionId; + this._cloudConnectionRouteId = config.cloudConnectionRouteId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._regionId = config.regionId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cloud_connection_id - computed: false, optional: true, required: false + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + public resetCloudConnectionId() { + this._cloudConnectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // cloud_connection_route_id - computed: false, optional: true, required: false + private _cloudConnectionRouteId?: string; + public get cloudConnectionRouteId() { + return this.getStringAttribute('cloud_connection_route_id'); + } + public set cloudConnectionRouteId(value: string) { + this._cloudConnectionRouteId = value; + } + public resetCloudConnectionRouteId() { + this._cloudConnectionRouteId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionRouteIdInput() { + return this._cloudConnectionRouteId; + } + + // cloud_connection_routes - computed: true, optional: false, required: false + private _cloudConnectionRoutes = new DataHuaweicloudCcConnectionRoutesCloudConnectionRoutesList(this, "cloud_connection_routes", false); + public get cloudConnectionRoutes() { + return this._cloudConnectionRoutes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + cloud_connection_route_id: cdktf.stringToTerraform(this._cloudConnectionRouteId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + region_id: cdktf.stringToTerraform(this._regionId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_connection_route_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionRouteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/README.md new file mode 100644 index 00000000..33843235 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_connection_tags` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_connection_tags`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/index.ts new file mode 100644 index 00000000..2a7061d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connection-tags/index.ts @@ -0,0 +1,152 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcConnectionTagsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags#id DataHuaweicloudCcConnectionTags#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags#region DataHuaweicloudCcConnectionTags#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags huaweicloud_cc_connection_tags} +*/ +export class DataHuaweicloudCcConnectionTags extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_connection_tags"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcConnectionTags resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcConnectionTags to import + * @param importFromId The id of the existing DataHuaweicloudCcConnectionTags that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcConnectionTags to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_connection_tags", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connection_tags huaweicloud_cc_connection_tags} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcConnectionTagsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcConnectionTagsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_connection_tags', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/README.md new file mode 100644 index 00000000..d09f4e60 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/index.ts new file mode 100644 index 00000000..bf93f4e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-connections/index.ts @@ -0,0 +1,498 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#connection_id DataHuaweicloudCcConnections#connection_id} + */ + readonly connectionId?: string; + /** + * Cloud connection description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#description DataHuaweicloudCcConnections#description} + */ + readonly description?: string; + /** + * Enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#enterprise_project_id DataHuaweicloudCcConnections#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#id DataHuaweicloudCcConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Cloud connection name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#name DataHuaweicloudCcConnections#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#region DataHuaweicloudCcConnections#region} + */ + readonly region?: string; + /** + * Cloud connection status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#status DataHuaweicloudCcConnections#status} + */ + readonly status?: string; + /** + * Cloud connection tags. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#tags DataHuaweicloudCcConnections#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Application scenario. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#used_scene DataHuaweicloudCcConnections#used_scene} + */ + readonly usedScene?: string; +} +export interface DataHuaweicloudCcConnectionsConnections { +} + +export function dataHuaweicloudCcConnectionsConnectionsToTerraform(struct?: DataHuaweicloudCcConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudCcConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_package_number - computed: true, optional: false, required: false + public get bandwidthPackageNumber() { + return this.getNumberAttribute('bandwidth_package_number'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // inter_region_bandwidth_number - computed: true, optional: false, required: false + public get interRegionBandwidthNumber() { + return this.getNumberAttribute('inter_region_bandwidth_number'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_instance_number - computed: true, optional: false, required: false + public get networkInstanceNumber() { + return this.getNumberAttribute('network_instance_number'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // used_scene - computed: true, optional: false, required: false + public get usedScene() { + return this.getStringAttribute('used_scene'); + } +} + +export class DataHuaweicloudCcConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcConnectionsConnectionsOutputReference { + return new DataHuaweicloudCcConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections huaweicloud_cc_connections} +*/ +export class DataHuaweicloudCcConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcConnections to import + * @param importFromId The id of the existing DataHuaweicloudCcConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_connections huaweicloud_cc_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcConnectionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcConnectionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + this._usedScene = config.usedScene; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudCcConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // used_scene - computed: false, optional: true, required: false + private _usedScene?: string; + public get usedScene() { + return this.getStringAttribute('used_scene'); + } + public set usedScene(value: string) { + this._usedScene = value; + } + public resetUsedScene() { + this._usedScene = undefined; + } + // Temporarily expose input value. Use with caution. + public get usedSceneInput() { + return this._usedScene; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + used_scene: cdktf.stringToTerraform(this._usedScene), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + used_scene: { + value: cdktf.stringToHclTerraform(this._usedScene), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/README.md new file mode 100644 index 00000000..dde60470 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_global_connection_bandwidth_line_levels` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_global_connection_bandwidth_line_levels`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/index.ts new file mode 100644 index 00000000..ea11dd50 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-line-levels/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#id DataHuaweicloudCcGlobalConnectionBandwidthLineLevels#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Line grade. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#levels DataHuaweicloudCcGlobalConnectionBandwidthLineLevels#levels} + */ + readonly levels?: string; + /** + * Line ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#line_id DataHuaweicloudCcGlobalConnectionBandwidthLineLevels#line_id} + */ + readonly lineId?: string; + /** + * Local access point code included in the line specification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#local_area DataHuaweicloudCcGlobalConnectionBandwidthLineLevels#local_area} + */ + readonly localArea?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#region DataHuaweicloudCcGlobalConnectionBandwidthLineLevels#region} + */ + readonly region?: string; + /** + * Remote access point code included in the line specification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#remote_area DataHuaweicloudCcGlobalConnectionBandwidthLineLevels#remote_area} + */ + readonly remoteArea?: string; +} +export interface DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevels { +} + +export function dataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsToTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsToHclTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // levels - computed: true, optional: false, required: false + public get levels() { + return this.getListAttribute('levels'); + } + + // local_area - computed: true, optional: false, required: false + public get localArea() { + return this.getStringAttribute('local_area'); + } + + // remote_area - computed: true, optional: false, required: false + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsOutputReference { + return new DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels huaweicloud_cc_global_connection_bandwidth_line_levels} +*/ +export class DataHuaweicloudCcGlobalConnectionBandwidthLineLevels extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_global_connection_bandwidth_line_levels"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcGlobalConnectionBandwidthLineLevels resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcGlobalConnectionBandwidthLineLevels to import + * @param importFromId The id of the existing DataHuaweicloudCcGlobalConnectionBandwidthLineLevels that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcGlobalConnectionBandwidthLineLevels to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_global_connection_bandwidth_line_levels", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_line_levels huaweicloud_cc_global_connection_bandwidth_line_levels} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_global_connection_bandwidth_line_levels', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._levels = config.levels; + this._lineId = config.lineId; + this._localArea = config.localArea; + this._region = config.region; + this._remoteArea = config.remoteArea; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // levels - computed: false, optional: true, required: false + private _levels?: string; + public get levels() { + return this.getStringAttribute('levels'); + } + public set levels(value: string) { + this._levels = value; + } + public resetLevels() { + this._levels = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelsInput() { + return this._levels; + } + + // line_id - computed: false, optional: true, required: false + private _lineId?: string; + public get lineId() { + return this.getStringAttribute('line_id'); + } + public set lineId(value: string) { + this._lineId = value; + } + public resetLineId() { + this._lineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lineIdInput() { + return this._lineId; + } + + // line_levels - computed: true, optional: false, required: false + private _lineLevels = new DataHuaweicloudCcGlobalConnectionBandwidthLineLevelsLineLevelsList(this, "line_levels", false); + public get lineLevels() { + return this._lineLevels; + } + + // local_area - computed: false, optional: true, required: false + private _localArea?: string; + public get localArea() { + return this.getStringAttribute('local_area'); + } + public set localArea(value: string) { + this._localArea = value; + } + public resetLocalArea() { + this._localArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get localAreaInput() { + return this._localArea; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_area - computed: false, optional: true, required: false + private _remoteArea?: string; + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + public set remoteArea(value: string) { + this._remoteArea = value; + } + public resetRemoteArea() { + this._remoteArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAreaInput() { + return this._remoteArea; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + levels: cdktf.stringToTerraform(this._levels), + line_id: cdktf.stringToTerraform(this._lineId), + local_area: cdktf.stringToTerraform(this._localArea), + region: cdktf.stringToTerraform(this._region), + remote_area: cdktf.stringToTerraform(this._remoteArea), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + levels: { + value: cdktf.stringToHclTerraform(this._levels), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + line_id: { + value: cdktf.stringToHclTerraform(this._lineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_area: { + value: cdktf.stringToHclTerraform(this._localArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_area: { + value: cdktf.stringToHclTerraform(this._remoteArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/README.md new file mode 100644 index 00000000..d2355d8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_global_connection_bandwidth_sites` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_global_connection_bandwidth_sites`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/index.ts new file mode 100644 index 00000000..5d0d33e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-sites/index.ts @@ -0,0 +1,523 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcGlobalConnectionBandwidthSitesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#id DataHuaweicloudCcGlobalConnectionBandwidthSites#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the site name in Chinese. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#name_cn DataHuaweicloudCcGlobalConnectionBandwidthSites#name_cn} + */ + readonly nameCn?: string; + /** + * Specifies the site name in English. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#name_en DataHuaweicloudCcGlobalConnectionBandwidthSites#name_en} + */ + readonly nameEn?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#region DataHuaweicloudCcGlobalConnectionBandwidthSites#region} + */ + readonly region?: string; + /** + * Specifies site code. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#site_code DataHuaweicloudCcGlobalConnectionBandwidthSites#site_code} + */ + readonly siteCode?: string; + /** + * Specifies site ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#site_id DataHuaweicloudCcGlobalConnectionBandwidthSites#site_id} + */ + readonly siteId?: string; + /** + * Specifies site type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#site_type DataHuaweicloudCcGlobalConnectionBandwidthSites#site_type} + */ + readonly siteType?: string; +} +export interface DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStruct { +} + +export function dataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructToTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructToHclTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name_cn - computed: true, optional: false, required: false + public get nameCn() { + return this.getStringAttribute('name_cn'); + } + + // name_en - computed: true, optional: false, required: false + public get nameEn() { + return this.getStringAttribute('name_en'); + } +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructOutputReference { + return new DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfos { +} + +export function dataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosToTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosToHclTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // group_list - computed: true, optional: false, required: false + private _groupList = new DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosGroupListStructList(this, "group_list", false); + public get groupList() { + return this._groupList; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name_cn - computed: true, optional: false, required: false + public get nameCn() { + return this.getStringAttribute('name_cn'); + } + + // name_en - computed: true, optional: false, required: false + public get nameEn() { + return this.getStringAttribute('name_en'); + } + + // public_border_group - computed: true, optional: false, required: false + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // service_list - computed: true, optional: false, required: false + public get serviceList() { + return this.getStringAttribute('service_list'); + } + + // site_code - computed: true, optional: false, required: false + public get siteCode() { + return this.getStringAttribute('site_code'); + } + + // site_type - computed: true, optional: false, required: false + public get siteType() { + return this.getStringAttribute('site_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosOutputReference { + return new DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites huaweicloud_cc_global_connection_bandwidth_sites} +*/ +export class DataHuaweicloudCcGlobalConnectionBandwidthSites extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_global_connection_bandwidth_sites"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcGlobalConnectionBandwidthSites resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcGlobalConnectionBandwidthSites to import + * @param importFromId The id of the existing DataHuaweicloudCcGlobalConnectionBandwidthSites that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcGlobalConnectionBandwidthSites to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_global_connection_bandwidth_sites", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_sites huaweicloud_cc_global_connection_bandwidth_sites} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcGlobalConnectionBandwidthSitesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcGlobalConnectionBandwidthSitesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_global_connection_bandwidth_sites', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._nameCn = config.nameCn; + this._nameEn = config.nameEn; + this._region = config.region; + this._siteCode = config.siteCode; + this._siteId = config.siteId; + this._siteType = config.siteType; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name_cn - computed: false, optional: true, required: false + private _nameCn?: string; + public get nameCn() { + return this.getStringAttribute('name_cn'); + } + public set nameCn(value: string) { + this._nameCn = value; + } + public resetNameCn() { + this._nameCn = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameCnInput() { + return this._nameCn; + } + + // name_en - computed: false, optional: true, required: false + private _nameEn?: string; + public get nameEn() { + return this.getStringAttribute('name_en'); + } + public set nameEn(value: string) { + this._nameEn = value; + } + public resetNameEn() { + this._nameEn = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameEnInput() { + return this._nameEn; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // site_code - computed: false, optional: true, required: false + private _siteCode?: string; + public get siteCode() { + return this.getStringAttribute('site_code'); + } + public set siteCode(value: string) { + this._siteCode = value; + } + public resetSiteCode() { + this._siteCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get siteCodeInput() { + return this._siteCode; + } + + // site_id - computed: false, optional: true, required: false + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + public resetSiteId() { + this._siteId = undefined; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } + + // site_infos - computed: true, optional: false, required: false + private _siteInfos = new DataHuaweicloudCcGlobalConnectionBandwidthSitesSiteInfosList(this, "site_infos", false); + public get siteInfos() { + return this._siteInfos; + } + + // site_type - computed: false, optional: true, required: false + private _siteType?: string; + public get siteType() { + return this.getStringAttribute('site_type'); + } + public set siteType(value: string) { + this._siteType = value; + } + public resetSiteType() { + this._siteType = undefined; + } + // Temporarily expose input value. Use with caution. + public get siteTypeInput() { + return this._siteType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name_cn: cdktf.stringToTerraform(this._nameCn), + name_en: cdktf.stringToTerraform(this._nameEn), + region: cdktf.stringToTerraform(this._region), + site_code: cdktf.stringToTerraform(this._siteCode), + site_id: cdktf.stringToTerraform(this._siteId), + site_type: cdktf.stringToTerraform(this._siteType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_cn: { + value: cdktf.stringToHclTerraform(this._nameCn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_en: { + value: cdktf.stringToHclTerraform(this._nameEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_code: { + value: cdktf.stringToHclTerraform(this._siteCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(this._siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_type: { + value: cdktf.stringToHclTerraform(this._siteType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/README.md new file mode 100644 index 00000000..f1f34508 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_global_connection_bandwidth_spec_codes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_global_connection_bandwidth_spec_codes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/index.ts new file mode 100644 index 00000000..f83e03cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidth-spec-codes/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#id DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Line grade. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#level DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes#level} + */ + readonly level?: string; + /** + * Local access point included in the line specification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#local_area DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes#local_area} + */ + readonly localArea?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#region DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes#region} + */ + readonly region?: string; + /** + * Remote access point included in the line specification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#remote_area DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes#remote_area} + */ + readonly remoteArea?: string; + /** + * Line specification ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#spec_id DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes#spec_id} + */ + readonly specId?: string; +} +export interface DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodes { +} + +export function dataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesToTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesToHclTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // local_area - computed: true, optional: false, required: false + public get localArea() { + return this.getStringAttribute('local_area'); + } + + // name_en - computed: true, optional: false, required: false + public get nameEn() { + return this.getStringAttribute('name_en'); + } + + // name_zh - computed: true, optional: false, required: false + public get nameZh() { + return this.getStringAttribute('name_zh'); + } + + // remote_area - computed: true, optional: false, required: false + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // sku - computed: true, optional: false, required: false + public get sku() { + return this.getStringAttribute('sku'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesOutputReference { + return new DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes huaweicloud_cc_global_connection_bandwidth_spec_codes} +*/ +export class DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_global_connection_bandwidth_spec_codes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes to import + * @param importFromId The id of the existing DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcGlobalConnectionBandwidthSpecCodes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_global_connection_bandwidth_spec_codes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidth_spec_codes huaweicloud_cc_global_connection_bandwidth_spec_codes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_global_connection_bandwidth_spec_codes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._level = config.level; + this._localArea = config.localArea; + this._region = config.region; + this._remoteArea = config.remoteArea; + this._specId = config.specId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // local_area - computed: false, optional: true, required: false + private _localArea?: string; + public get localArea() { + return this.getStringAttribute('local_area'); + } + public set localArea(value: string) { + this._localArea = value; + } + public resetLocalArea() { + this._localArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get localAreaInput() { + return this._localArea; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_area - computed: false, optional: true, required: false + private _remoteArea?: string; + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + public set remoteArea(value: string) { + this._remoteArea = value; + } + public resetRemoteArea() { + this._remoteArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAreaInput() { + return this._remoteArea; + } + + // spec_codes - computed: true, optional: false, required: false + private _specCodes = new DataHuaweicloudCcGlobalConnectionBandwidthSpecCodesSpecCodesList(this, "spec_codes", false); + public get specCodes() { + return this._specCodes; + } + + // spec_id - computed: false, optional: true, required: false + private _specId?: string; + public get specId() { + return this.getStringAttribute('spec_id'); + } + public set specId(value: string) { + this._specId = value; + } + public resetSpecId() { + this._specId = undefined; + } + // Temporarily expose input value. Use with caution. + public get specIdInput() { + return this._specId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + level: cdktf.stringToTerraform(this._level), + local_area: cdktf.stringToTerraform(this._localArea), + region: cdktf.stringToTerraform(this._region), + remote_area: cdktf.stringToTerraform(this._remoteArea), + spec_id: cdktf.stringToTerraform(this._specId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_area: { + value: cdktf.stringToHclTerraform(this._localArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_area: { + value: cdktf.stringToHclTerraform(this._remoteArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_id: { + value: cdktf.stringToHclTerraform(this._specId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/README.md new file mode 100644 index 00000000..b521f1bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_global_connection_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_global_connection_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/index.ts new file mode 100644 index 00000000..81c2bab5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-global-connection-bandwidths/index.ts @@ -0,0 +1,757 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcGlobalConnectionBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Status of the global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#admin_state DataHuaweicloudCcGlobalConnectionBandwidths#admin_state} + */ + readonly adminState?: string; + /** + * Binding service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#binding_service DataHuaweicloudCcGlobalConnectionBandwidths#binding_service} + */ + readonly bindingService?: string; + /** + * Billing option. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#charge_mode DataHuaweicloudCcGlobalConnectionBandwidths#charge_mode} + */ + readonly chargeMode?: string; + /** + * Enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#enterprise_project_id DataHuaweicloudCcGlobalConnectionBandwidths#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#gcb_id DataHuaweicloudCcGlobalConnectionBandwidths#gcb_id} + */ + readonly gcbId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#id DataHuaweicloudCcGlobalConnectionBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Bound instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#instance_id DataHuaweicloudCcGlobalConnectionBandwidths#instance_id} + */ + readonly instanceId?: string; + /** + * Instance type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#instance_type DataHuaweicloudCcGlobalConnectionBandwidths#instance_type} + */ + readonly instanceType?: string; + /** + * Resource name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#name DataHuaweicloudCcGlobalConnectionBandwidths#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#region DataHuaweicloudCcGlobalConnectionBandwidths#region} + */ + readonly region?: string; + /** + * Range of a global connection bandwidth, in Mbit/s. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#size DataHuaweicloudCcGlobalConnectionBandwidths#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#tags DataHuaweicloudCcGlobalConnectionBandwidths#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Type of a global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#type DataHuaweicloudCcGlobalConnectionBandwidths#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstances { +} + +export function dataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesToTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesToHclTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesOutputReference { + return new DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidths { +} + +export function dataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsToTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsToHclTerraform(struct?: DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // admin_state - computed: true, optional: false, required: false + public get adminState() { + return this.getStringAttribute('admin_state'); + } + + // binding_service - computed: true, optional: false, required: false + public get bindingService() { + return this.getStringAttribute('binding_service'); + } + + // bordercross - computed: true, optional: false, required: false + public get bordercross() { + return this.getBooleanAttribute('bordercross'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enable_share - computed: true, optional: false, required: false + public get enableShare() { + return this.getBooleanAttribute('enable_share'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // frozen - computed: true, optional: false, required: false + public get frozen() { + return this.getBooleanAttribute('frozen'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // local_area - computed: true, optional: false, required: false + public get localArea() { + return this.getStringAttribute('local_area'); + } + + // local_site_code - computed: true, optional: false, required: false + public get localSiteCode() { + return this.getStringAttribute('local_site_code'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // remote_area - computed: true, optional: false, required: false + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + + // remote_site_code - computed: true, optional: false, required: false + public get remoteSiteCode() { + return this.getStringAttribute('remote_site_code'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // sla_level - computed: true, optional: false, required: false + public get slaLevel() { + return this.getStringAttribute('sla_level'); + } + + // spec_code_id - computed: true, optional: false, required: false + public get specCodeId() { + return this.getStringAttribute('spec_code_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsOutputReference { + return new DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths huaweicloud_cc_global_connection_bandwidths} +*/ +export class DataHuaweicloudCcGlobalConnectionBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_global_connection_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcGlobalConnectionBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcGlobalConnectionBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudCcGlobalConnectionBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcGlobalConnectionBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_global_connection_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_global_connection_bandwidths huaweicloud_cc_global_connection_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcGlobalConnectionBandwidthsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcGlobalConnectionBandwidthsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_global_connection_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminState = config.adminState; + this._bindingService = config.bindingService; + this._chargeMode = config.chargeMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._gcbId = config.gcbId; + this._id = config.id; + this._instanceId = config.instanceId; + this._instanceType = config.instanceType; + this._name = config.name; + this._region = config.region; + this._size = config.size; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state - computed: false, optional: true, required: false + private _adminState?: string; + public get adminState() { + return this.getStringAttribute('admin_state'); + } + public set adminState(value: string) { + this._adminState = value; + } + public resetAdminState() { + this._adminState = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateInput() { + return this._adminState; + } + + // binding_service - computed: false, optional: true, required: false + private _bindingService?: string; + public get bindingService() { + return this.getStringAttribute('binding_service'); + } + public set bindingService(value: string) { + this._bindingService = value; + } + public resetBindingService() { + this._bindingService = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindingServiceInput() { + return this._bindingService; + } + + // charge_mode - computed: false, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gcb_id - computed: false, optional: true, required: false + private _gcbId?: string; + public get gcbId() { + return this.getStringAttribute('gcb_id'); + } + public set gcbId(value: string) { + this._gcbId = value; + } + public resetGcbId() { + this._gcbId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gcbIdInput() { + return this._gcbId; + } + + // globalconnection_bandwidths - computed: true, optional: false, required: false + private _globalconnectionBandwidths = new DataHuaweicloudCcGlobalConnectionBandwidthsGlobalconnectionBandwidthsList(this, "globalconnection_bandwidths", false); + public get globalconnectionBandwidths() { + return this._globalconnectionBandwidths; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_type - computed: false, optional: true, required: false + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + public resetInstanceType() { + this._instanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state: cdktf.stringToTerraform(this._adminState), + binding_service: cdktf.stringToTerraform(this._bindingService), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gcb_id: cdktf.stringToTerraform(this._gcbId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_type: cdktf.stringToTerraform(this._instanceType), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state: { + value: cdktf.stringToHclTerraform(this._adminState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + binding_service: { + value: cdktf.stringToHclTerraform(this._bindingService), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gcb_id: { + value: cdktf.stringToHclTerraform(this._gcbId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/README.md new file mode 100644 index 00000000..6a657e42 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_inter_region_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_inter_region_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/index.ts new file mode 100644 index 00000000..e15ef440 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-inter-region-bandwidths/index.ts @@ -0,0 +1,478 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcInterRegionBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the bandwidth package ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#bandwidth_package_id DataHuaweicloudCcInterRegionBandwidths#bandwidth_package_id} + */ + readonly bandwidthPackageId?: string; + /** + * Specifies the cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#cloud_connection_id DataHuaweicloudCcInterRegionBandwidths#cloud_connection_id} + */ + readonly cloudConnectionId?: string; + /** + * Specifies enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#enterprise_project_id DataHuaweicloudCcInterRegionBandwidths#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#id DataHuaweicloudCcInterRegionBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the inter-region bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#inter_region_bandwidth_id DataHuaweicloudCcInterRegionBandwidths#inter_region_bandwidth_id} + */ + readonly interRegionBandwidthId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#region DataHuaweicloudCcInterRegionBandwidths#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegions { +} + +export function dataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsToTerraform(struct?: DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsToHclTerraform(struct?: DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_region_id - computed: true, optional: false, required: false + public get localRegionId() { + return this.getStringAttribute('local_region_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // remote_region_id - computed: true, optional: false, required: false + public get remoteRegionId() { + return this.getStringAttribute('remote_region_id'); + } +} + +export class DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsOutputReference { + return new DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidths { +} + +export function dataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsToTerraform(struct?: DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsToHclTerraform(struct?: DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // bandwidth_package_id - computed: true, optional: false, required: false + public get bandwidthPackageId() { + return this.getStringAttribute('bandwidth_package_id'); + } + + // cloud_connection_id - computed: true, optional: false, required: false + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // inter_regions - computed: true, optional: false, required: false + private _interRegions = new DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsInterRegionsList(this, "inter_regions", false); + public get interRegions() { + return this._interRegions; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsOutputReference { + return new DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths huaweicloud_cc_inter_region_bandwidths} +*/ +export class DataHuaweicloudCcInterRegionBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_inter_region_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcInterRegionBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcInterRegionBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudCcInterRegionBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcInterRegionBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_inter_region_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_inter_region_bandwidths huaweicloud_cc_inter_region_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcInterRegionBandwidthsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcInterRegionBandwidthsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_inter_region_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthPackageId = config.bandwidthPackageId; + this._cloudConnectionId = config.cloudConnectionId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._interRegionBandwidthId = config.interRegionBandwidthId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_package_id - computed: false, optional: true, required: false + private _bandwidthPackageId?: string; + public get bandwidthPackageId() { + return this.getStringAttribute('bandwidth_package_id'); + } + public set bandwidthPackageId(value: string) { + this._bandwidthPackageId = value; + } + public resetBandwidthPackageId() { + this._bandwidthPackageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthPackageIdInput() { + return this._bandwidthPackageId; + } + + // cloud_connection_id - computed: false, optional: true, required: false + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + public resetCloudConnectionId() { + this._cloudConnectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inter_region_bandwidth_id - computed: false, optional: true, required: false + private _interRegionBandwidthId?: string; + public get interRegionBandwidthId() { + return this.getStringAttribute('inter_region_bandwidth_id'); + } + public set interRegionBandwidthId(value: string) { + this._interRegionBandwidthId = value; + } + public resetInterRegionBandwidthId() { + this._interRegionBandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get interRegionBandwidthIdInput() { + return this._interRegionBandwidthId; + } + + // inter_region_bandwidths - computed: true, optional: false, required: false + private _interRegionBandwidths = new DataHuaweicloudCcInterRegionBandwidthsInterRegionBandwidthsList(this, "inter_region_bandwidths", false); + public get interRegionBandwidths() { + return this._interRegionBandwidths; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_package_id: cdktf.stringToTerraform(this._bandwidthPackageId), + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + inter_region_bandwidth_id: cdktf.stringToTerraform(this._interRegionBandwidthId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_package_id: { + value: cdktf.stringToHclTerraform(this._bandwidthPackageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inter_region_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._interRegionBandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/README.md new file mode 100644 index 00000000..2312860a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_network_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_network_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/index.ts new file mode 100644 index 00000000..86e42494 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-network-instances/index.ts @@ -0,0 +1,532 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcNetworkInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#cloud_connection_id DataHuaweicloudCcNetworkInstances#cloud_connection_id} + */ + readonly cloudConnectionId?: string; + /** + * Specifies the network instance description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#description DataHuaweicloudCcNetworkInstances#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#id DataHuaweicloudCcNetworkInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the VPC or virtual gateway to be loaded to the cloud connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#instance_id DataHuaweicloudCcNetworkInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the network instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#name DataHuaweicloudCcNetworkInstances#name} + */ + readonly name?: string; + /** + * Specifies the network instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#network_instance_id DataHuaweicloudCcNetworkInstances#network_instance_id} + */ + readonly networkInstanceId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#region DataHuaweicloudCcNetworkInstances#region} + */ + readonly region?: string; + /** + * Specifies the region ID of the network instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#region_id DataHuaweicloudCcNetworkInstances#region_id} + */ + readonly regionId?: string; + /** + * Specifies the status of the network instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#status DataHuaweicloudCcNetworkInstances#status} + */ + readonly status?: string; + /** + * Specifies the type of the network instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#type DataHuaweicloudCcNetworkInstances#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCcNetworkInstancesNetworkInstances { +} + +export function dataHuaweicloudCcNetworkInstancesNetworkInstancesToTerraform(struct?: DataHuaweicloudCcNetworkInstancesNetworkInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcNetworkInstancesNetworkInstancesToHclTerraform(struct?: DataHuaweicloudCcNetworkInstancesNetworkInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcNetworkInstancesNetworkInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcNetworkInstancesNetworkInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcNetworkInstancesNetworkInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidrs - computed: true, optional: false, required: false + public get cidrs() { + return this.getListAttribute('cidrs'); + } + + // cloud_connection_id - computed: true, optional: false, required: false + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_domain_id - computed: true, optional: false, required: false + public get instanceDomainId() { + return this.getStringAttribute('instance_domain_id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcNetworkInstancesNetworkInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcNetworkInstancesNetworkInstancesOutputReference { + return new DataHuaweicloudCcNetworkInstancesNetworkInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances huaweicloud_cc_network_instances} +*/ +export class DataHuaweicloudCcNetworkInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_network_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcNetworkInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcNetworkInstances to import + * @param importFromId The id of the existing DataHuaweicloudCcNetworkInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcNetworkInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_network_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_network_instances huaweicloud_cc_network_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcNetworkInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcNetworkInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_network_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cloudConnectionId = config.cloudConnectionId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._networkInstanceId = config.networkInstanceId; + this._region = config.region; + this._regionId = config.regionId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cloud_connection_id - computed: false, optional: true, required: false + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + public resetCloudConnectionId() { + this._cloudConnectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_instance_id - computed: false, optional: true, required: false + private _networkInstanceId?: string; + public get networkInstanceId() { + return this.getStringAttribute('network_instance_id'); + } + public set networkInstanceId(value: string) { + this._networkInstanceId = value; + } + public resetNetworkInstanceId() { + this._networkInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkInstanceIdInput() { + return this._networkInstanceId; + } + + // network_instances - computed: true, optional: false, required: false + private _networkInstances = new DataHuaweicloudCcNetworkInstancesNetworkInstancesList(this, "network_instances", false); + public get networkInstances() { + return this._networkInstances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + network_instance_id: cdktf.stringToTerraform(this._networkInstanceId), + region: cdktf.stringToTerraform(this._region), + region_id: cdktf.stringToTerraform(this._regionId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_instance_id: { + value: cdktf.stringToHclTerraform(this._networkInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/README.md new file mode 100644 index 00000000..99e7f668 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_permissions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/index.ts new file mode 100644 index 00000000..f22fb80f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-permissions/index.ts @@ -0,0 +1,432 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcPermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cloud connection ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#cloud_connection_id DataHuaweicloudCcPermissions#cloud_connection_id} + */ + readonly cloudConnectionId?: string; + /** + * Specifies the permission description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#description DataHuaweicloudCcPermissions#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#id DataHuaweicloudCcPermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the network instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#instance_id DataHuaweicloudCcPermissions#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the permission name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#name DataHuaweicloudCcPermissions#name} + */ + readonly name?: string; + /** + * Specifies the permission ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#permission_id DataHuaweicloudCcPermissions#permission_id} + */ + readonly permissionId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#region DataHuaweicloudCcPermissions#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCcPermissionsPermissions { +} + +export function dataHuaweicloudCcPermissionsPermissionsToTerraform(struct?: DataHuaweicloudCcPermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcPermissionsPermissionsToHclTerraform(struct?: DataHuaweicloudCcPermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcPermissionsPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcPermissionsPermissions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcPermissionsPermissions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_connection_id - computed: true, optional: false, required: false + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_domain_id - computed: true, optional: false, required: false + public get instanceDomainId() { + return this.getStringAttribute('instance_domain_id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudCcPermissionsPermissionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcPermissionsPermissionsOutputReference { + return new DataHuaweicloudCcPermissionsPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions huaweicloud_cc_permissions} +*/ +export class DataHuaweicloudCcPermissions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcPermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcPermissions to import + * @param importFromId The id of the existing DataHuaweicloudCcPermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcPermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_permissions huaweicloud_cc_permissions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcPermissionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcPermissionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cloudConnectionId = config.cloudConnectionId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._permissionId = config.permissionId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cloud_connection_id - computed: false, optional: true, required: false + private _cloudConnectionId?: string; + public get cloudConnectionId() { + return this.getStringAttribute('cloud_connection_id'); + } + public set cloudConnectionId(value: string) { + this._cloudConnectionId = value; + } + public resetCloudConnectionId() { + this._cloudConnectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudConnectionIdInput() { + return this._cloudConnectionId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permission_id - computed: false, optional: true, required: false + private _permissionId?: string; + public get permissionId() { + return this.getStringAttribute('permission_id'); + } + public set permissionId(value: string) { + this._permissionId = value; + } + public resetPermissionId() { + this._permissionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionIdInput() { + return this._permissionId; + } + + // permissions - computed: true, optional: false, required: false + private _permissions = new DataHuaweicloudCcPermissionsPermissionsList(this, "permissions", false); + public get permissions() { + return this._permissions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cloud_connection_id: cdktf.stringToTerraform(this._cloudConnectionId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + permission_id: cdktf.stringToTerraform(this._permissionId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cloud_connection_id: { + value: cdktf.stringToHclTerraform(this._cloudConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_id: { + value: cdktf.stringToHclTerraform(this._permissionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/README.md new file mode 100644 index 00000000..049074a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cc_support_binding_global_connection_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cc_support_binding_global_connection_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/index.ts new file mode 100644 index 00000000..7fad7da2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cc-support-binding-global-connection-bandwidths/index.ts @@ -0,0 +1,654 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the global connection bandwidth status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#admin_state DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#admin_state} + */ + readonly adminState?: string; + /** + * Specifies the binding service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#binding_service DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#binding_service} + */ + readonly bindingService: string; + /** + * Specifies the billing option. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#charge_mode DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#charge_mode} + */ + readonly chargeMode?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#enterprise_project_id DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the global connection bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#gcb_id DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#gcb_id} + */ + readonly gcbId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#id DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the local access point. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#local_area DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#local_area} + */ + readonly localArea?: string; + /** + * Specifies the global connection bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#name DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#region DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#region} + */ + readonly region?: string; + /** + * Specifies the remote access point. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#remote_area DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#remote_area} + */ + readonly remoteArea?: string; + /** + * Specifies the global connection bandwidth size. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#size DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#size} + */ + readonly size?: number; + /** + * Specifies the class of a global connection bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#sla_level DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#sla_level} + */ + readonly slaLevel?: string; + /** + * Specifies the global connection bandwidth type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#type DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidths { +} + +export function dataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsToTerraform(struct?: DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsToHclTerraform(struct?: DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // admin_state - computed: true, optional: false, required: false + public get adminState() { + return this.getStringAttribute('admin_state'); + } + + // binding_service - computed: true, optional: false, required: false + public get bindingService() { + return this.getStringAttribute('binding_service'); + } + + // bordercross - computed: true, optional: false, required: false + public get bordercross() { + return this.getBooleanAttribute('bordercross'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enable_share - computed: true, optional: false, required: false + public get enableShare() { + return this.getBooleanAttribute('enable_share'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // frozen - computed: true, optional: false, required: false + public get frozen() { + return this.getBooleanAttribute('frozen'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_area - computed: true, optional: false, required: false + public get localArea() { + return this.getStringAttribute('local_area'); + } + + // local_site_code - computed: true, optional: false, required: false + public get localSiteCode() { + return this.getStringAttribute('local_site_code'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // remote_area - computed: true, optional: false, required: false + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + + // remote_site_code - computed: true, optional: false, required: false + public get remoteSiteCode() { + return this.getStringAttribute('remote_site_code'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // sla_level - computed: true, optional: false, required: false + public get slaLevel() { + return this.getStringAttribute('sla_level'); + } + + // spec_code_id - computed: true, optional: false, required: false + public get specCodeId() { + return this.getStringAttribute('spec_code_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsOutputReference { + return new DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths huaweicloud_cc_support_binding_global_connection_bandwidths} +*/ +export class DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cc_support_binding_global_connection_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcSupportBindingGlobalConnectionBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cc_support_binding_global_connection_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cc_support_binding_global_connection_bandwidths huaweicloud_cc_support_binding_global_connection_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cc_support_binding_global_connection_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminState = config.adminState; + this._bindingService = config.bindingService; + this._chargeMode = config.chargeMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._gcbId = config.gcbId; + this._id = config.id; + this._localArea = config.localArea; + this._name = config.name; + this._region = config.region; + this._remoteArea = config.remoteArea; + this._size = config.size; + this._slaLevel = config.slaLevel; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state - computed: false, optional: true, required: false + private _adminState?: string; + public get adminState() { + return this.getStringAttribute('admin_state'); + } + public set adminState(value: string) { + this._adminState = value; + } + public resetAdminState() { + this._adminState = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateInput() { + return this._adminState; + } + + // binding_service - computed: false, optional: false, required: true + private _bindingService?: string; + public get bindingService() { + return this.getStringAttribute('binding_service'); + } + public set bindingService(value: string) { + this._bindingService = value; + } + // Temporarily expose input value. Use with caution. + public get bindingServiceInput() { + return this._bindingService; + } + + // charge_mode - computed: false, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gcb_id - computed: false, optional: true, required: false + private _gcbId?: string; + public get gcbId() { + return this.getStringAttribute('gcb_id'); + } + public set gcbId(value: string) { + this._gcbId = value; + } + public resetGcbId() { + this._gcbId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gcbIdInput() { + return this._gcbId; + } + + // globalconnection_bandwidths - computed: true, optional: false, required: false + private _globalconnectionBandwidths = new DataHuaweicloudCcSupportBindingGlobalConnectionBandwidthsGlobalconnectionBandwidthsList(this, "globalconnection_bandwidths", false); + public get globalconnectionBandwidths() { + return this._globalconnectionBandwidths; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // local_area - computed: false, optional: true, required: false + private _localArea?: string; + public get localArea() { + return this.getStringAttribute('local_area'); + } + public set localArea(value: string) { + this._localArea = value; + } + public resetLocalArea() { + this._localArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get localAreaInput() { + return this._localArea; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_area - computed: false, optional: true, required: false + private _remoteArea?: string; + public get remoteArea() { + return this.getStringAttribute('remote_area'); + } + public set remoteArea(value: string) { + this._remoteArea = value; + } + public resetRemoteArea() { + this._remoteArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAreaInput() { + return this._remoteArea; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // sla_level - computed: false, optional: true, required: false + private _slaLevel?: string; + public get slaLevel() { + return this.getStringAttribute('sla_level'); + } + public set slaLevel(value: string) { + this._slaLevel = value; + } + public resetSlaLevel() { + this._slaLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get slaLevelInput() { + return this._slaLevel; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state: cdktf.stringToTerraform(this._adminState), + binding_service: cdktf.stringToTerraform(this._bindingService), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gcb_id: cdktf.stringToTerraform(this._gcbId), + id: cdktf.stringToTerraform(this._id), + local_area: cdktf.stringToTerraform(this._localArea), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + remote_area: cdktf.stringToTerraform(this._remoteArea), + size: cdktf.numberToTerraform(this._size), + sla_level: cdktf.stringToTerraform(this._slaLevel), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state: { + value: cdktf.stringToHclTerraform(this._adminState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + binding_service: { + value: cdktf.stringToHclTerraform(this._bindingService), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gcb_id: { + value: cdktf.stringToHclTerraform(this._gcbId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_area: { + value: cdktf.stringToHclTerraform(this._localArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_area: { + value: cdktf.stringToHclTerraform(this._remoteArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sla_level: { + value: cdktf.stringToHclTerraform(this._slaLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/README.md new file mode 100644 index 00000000..19606797 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_addon_template` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_addon_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/index.ts new file mode 100644 index 00000000..4526e6e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-addon-template/index.ts @@ -0,0 +1,320 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceAddonTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template#cluster_id DataHuaweicloudCceAddonTemplate#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template#id DataHuaweicloudCceAddonTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template#name DataHuaweicloudCceAddonTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template#region DataHuaweicloudCceAddonTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template#version DataHuaweicloudCceAddonTemplate#version} + */ + readonly version: string; +} +export interface DataHuaweicloudCceAddonTemplateSupportVersion { +} + +export function dataHuaweicloudCceAddonTemplateSupportVersionToTerraform(struct?: DataHuaweicloudCceAddonTemplateSupportVersion): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceAddonTemplateSupportVersionToHclTerraform(struct?: DataHuaweicloudCceAddonTemplateSupportVersion): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceAddonTemplateSupportVersionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceAddonTemplateSupportVersion | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceAddonTemplateSupportVersion | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bare_metal - computed: true, optional: false, required: false + public get bareMetal() { + return cdktf.Fn.tolist(this.getListAttribute('bare_metal')); + } + + // virtual_machine - computed: true, optional: false, required: false + public get virtualMachine() { + return cdktf.Fn.tolist(this.getListAttribute('virtual_machine')); + } +} + +export class DataHuaweicloudCceAddonTemplateSupportVersionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceAddonTemplateSupportVersionOutputReference { + return new DataHuaweicloudCceAddonTemplateSupportVersionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template huaweicloud_cce_addon_template} +*/ +export class DataHuaweicloudCceAddonTemplate extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_addon_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceAddonTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceAddonTemplate to import + * @param importFromId The id of the existing DataHuaweicloudCceAddonTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceAddonTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_addon_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_addon_template huaweicloud_cce_addon_template} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceAddonTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceAddonTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_addon_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: true, optional: false, required: false + public get spec() { + return this.getStringAttribute('spec'); + } + + // stable - computed: true, optional: false, required: false + public get stable() { + return this.getBooleanAttribute('stable'); + } + + // support_version - computed: true, optional: false, required: false + private _supportVersion = new DataHuaweicloudCceAddonTemplateSupportVersionList(this, "support_version", false); + public get supportVersion() { + return this._supportVersion; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/README.md new file mode 100644 index 00000000..f482724e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_cluster_certificate` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_cluster_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/index.ts new file mode 100644 index 00000000..8a420a79 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-certificate/index.ts @@ -0,0 +1,482 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceClusterCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate#cluster_id DataHuaweicloudCceClusterCertificate#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate#duration DataHuaweicloudCceClusterCertificate#duration} + */ + readonly duration: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate#id DataHuaweicloudCceClusterCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate#region DataHuaweicloudCceClusterCertificate#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCceClusterCertificateClustersA { +} + +export function dataHuaweicloudCceClusterCertificateClustersAToTerraform(struct?: DataHuaweicloudCceClusterCertificateClustersA): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterCertificateClustersAToHclTerraform(struct?: DataHuaweicloudCceClusterCertificateClustersA): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterCertificateClustersAOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterCertificateClustersA | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterCertificateClustersA | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_authority_data - computed: true, optional: false, required: false + public get certificateAuthorityData() { + return this.getStringAttribute('certificate_authority_data'); + } + + // insecure_skip_tls_verify - computed: true, optional: false, required: false + public get insecureSkipTlsVerify() { + return this.getBooleanAttribute('insecure_skip_tls_verify'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server - computed: true, optional: false, required: false + public get server() { + return this.getStringAttribute('server'); + } +} + +export class DataHuaweicloudCceClusterCertificateClustersAList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterCertificateClustersAOutputReference { + return new DataHuaweicloudCceClusterCertificateClustersAOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterCertificateContexts { +} + +export function dataHuaweicloudCceClusterCertificateContextsToTerraform(struct?: DataHuaweicloudCceClusterCertificateContexts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterCertificateContextsToHclTerraform(struct?: DataHuaweicloudCceClusterCertificateContexts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterCertificateContextsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterCertificateContexts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterCertificateContexts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster - computed: true, optional: false, required: false + public get cluster() { + return this.getStringAttribute('cluster'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // user - computed: true, optional: false, required: false + public get user() { + return this.getStringAttribute('user'); + } +} + +export class DataHuaweicloudCceClusterCertificateContextsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterCertificateContextsOutputReference { + return new DataHuaweicloudCceClusterCertificateContextsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterCertificateUsersA { +} + +export function dataHuaweicloudCceClusterCertificateUsersAToTerraform(struct?: DataHuaweicloudCceClusterCertificateUsersA): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterCertificateUsersAToHclTerraform(struct?: DataHuaweicloudCceClusterCertificateUsersA): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterCertificateUsersAOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterCertificateUsersA | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterCertificateUsersA | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_certificate_data - computed: true, optional: false, required: false + public get clientCertificateData() { + return this.getStringAttribute('client_certificate_data'); + } + + // client_key_data - computed: true, optional: false, required: false + public get clientKeyData() { + return this.getStringAttribute('client_key_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCceClusterCertificateUsersAList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterCertificateUsersAOutputReference { + return new DataHuaweicloudCceClusterCertificateUsersAOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate huaweicloud_cce_cluster_certificate} +*/ +export class DataHuaweicloudCceClusterCertificate extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceClusterCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceClusterCertificate to import + * @param importFromId The id of the existing DataHuaweicloudCceClusterCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceClusterCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_certificate huaweicloud_cce_cluster_certificate} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceClusterCertificateConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceClusterCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._duration = config.duration; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // clusters - computed: true, optional: false, required: false + private _clusters = new DataHuaweicloudCceClusterCertificateClustersAList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + + // contexts - computed: true, optional: false, required: false + private _contexts = new DataHuaweicloudCceClusterCertificateContextsList(this, "contexts", false); + public get contexts() { + return this._contexts; + } + + // current_context - computed: true, optional: false, required: false + public get currentContext() { + return this.getStringAttribute('current_context'); + } + + // duration - computed: false, optional: false, required: true + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kube_config_raw - computed: true, optional: false, required: false + public get kubeConfigRaw() { + return this.getStringAttribute('kube_config_raw'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudCceClusterCertificateUsersAList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + duration: cdktf.numberToTerraform(this._duration), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + duration: { + value: cdktf.numberToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/README.md new file mode 100644 index 00000000..ae56d782 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_cluster_openid_jwks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_cluster_openid_jwks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/index.ts new file mode 100644 index 00000000..888c336d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-openid-jwks/index.ts @@ -0,0 +1,275 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceClusterOpenidJwksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks#cluster_id DataHuaweicloudCceClusterOpenidJwks#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks#id DataHuaweicloudCceClusterOpenidJwks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks#region DataHuaweicloudCceClusterOpenidJwks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCceClusterOpenidJwksKeys { +} + +export function dataHuaweicloudCceClusterOpenidJwksKeysToTerraform(struct?: DataHuaweicloudCceClusterOpenidJwksKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterOpenidJwksKeysToHclTerraform(struct?: DataHuaweicloudCceClusterOpenidJwksKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterOpenidJwksKeysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterOpenidJwksKeys | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterOpenidJwksKeys | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alg - computed: true, optional: false, required: false + public get alg() { + return this.getStringAttribute('alg'); + } + + // e - computed: true, optional: false, required: false + public get e() { + return this.getStringAttribute('e'); + } + + // kid - computed: true, optional: false, required: false + public get kid() { + return this.getStringAttribute('kid'); + } + + // kty - computed: true, optional: false, required: false + public get kty() { + return this.getStringAttribute('kty'); + } + + // n - computed: true, optional: false, required: false + public get n() { + return this.getStringAttribute('n'); + } + + // use - computed: true, optional: false, required: false + public get use() { + return this.getStringAttribute('use'); + } +} + +export class DataHuaweicloudCceClusterOpenidJwksKeysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterOpenidJwksKeysOutputReference { + return new DataHuaweicloudCceClusterOpenidJwksKeysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks huaweicloud_cce_cluster_openid_jwks} +*/ +export class DataHuaweicloudCceClusterOpenidJwks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster_openid_jwks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceClusterOpenidJwks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceClusterOpenidJwks to import + * @param importFromId The id of the existing DataHuaweicloudCceClusterOpenidJwks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceClusterOpenidJwks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster_openid_jwks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_openid_jwks huaweicloud_cce_cluster_openid_jwks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceClusterOpenidJwksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceClusterOpenidJwksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster_openid_jwks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keys - computed: true, optional: false, required: false + private _keys = new DataHuaweicloudCceClusterOpenidJwksKeysList(this, "keys", false); + public get keys() { + return this._keys; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/README.md new file mode 100644 index 00000000..242ebf6e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_cluster_v3` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_cluster_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/index.ts new file mode 100644 index 00000000..79c212f0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster-v3/index.ts @@ -0,0 +1,680 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceClusterV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#cluster_type DataHuaweicloudCceClusterV3#cluster_type} + */ + readonly clusterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#id DataHuaweicloudCceClusterV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#name DataHuaweicloudCceClusterV3#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#region DataHuaweicloudCceClusterV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#status DataHuaweicloudCceClusterV3#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#vpc_id DataHuaweicloudCceClusterV3#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudCceClusterV3CertificateClusters { +} + +export function dataHuaweicloudCceClusterV3CertificateClustersToTerraform(struct?: DataHuaweicloudCceClusterV3CertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterV3CertificateClustersToHclTerraform(struct?: DataHuaweicloudCceClusterV3CertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterV3CertificateClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterV3CertificateClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterV3CertificateClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_authority_data - computed: true, optional: false, required: false + public get certificateAuthorityData() { + return this.getStringAttribute('certificate_authority_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server - computed: true, optional: false, required: false + public get server() { + return this.getStringAttribute('server'); + } +} + +export class DataHuaweicloudCceClusterV3CertificateClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterV3CertificateClustersOutputReference { + return new DataHuaweicloudCceClusterV3CertificateClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterV3CertificateUsers { +} + +export function dataHuaweicloudCceClusterV3CertificateUsersToTerraform(struct?: DataHuaweicloudCceClusterV3CertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterV3CertificateUsersToHclTerraform(struct?: DataHuaweicloudCceClusterV3CertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterV3CertificateUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterV3CertificateUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterV3CertificateUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_certificate_data - computed: true, optional: false, required: false + public get clientCertificateData() { + return this.getStringAttribute('client_certificate_data'); + } + + // client_key_data - computed: true, optional: false, required: false + public get clientKeyData() { + return this.getStringAttribute('client_key_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCceClusterV3CertificateUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterV3CertificateUsersOutputReference { + return new DataHuaweicloudCceClusterV3CertificateUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterV3Endpoints { +} + +export function dataHuaweicloudCceClusterV3EndpointsToTerraform(struct?: DataHuaweicloudCceClusterV3Endpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterV3EndpointsToHclTerraform(struct?: DataHuaweicloudCceClusterV3Endpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterV3EndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterV3Endpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterV3Endpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class DataHuaweicloudCceClusterV3EndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterV3EndpointsOutputReference { + return new DataHuaweicloudCceClusterV3EndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterV3Masters { +} + +export function dataHuaweicloudCceClusterV3MastersToTerraform(struct?: DataHuaweicloudCceClusterV3Masters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterV3MastersToHclTerraform(struct?: DataHuaweicloudCceClusterV3Masters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterV3MastersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterV3Masters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterV3Masters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } +} + +export class DataHuaweicloudCceClusterV3MastersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterV3MastersOutputReference { + return new DataHuaweicloudCceClusterV3MastersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3 huaweicloud_cce_cluster_v3} +*/ +export class DataHuaweicloudCceClusterV3 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceClusterV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceClusterV3 to import + * @param importFromId The id of the existing DataHuaweicloudCceClusterV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceClusterV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster_v3 huaweicloud_cce_cluster_v3} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceClusterV3Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceClusterV3Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterType = config.clusterType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // authentication_mode - computed: true, optional: false, required: false + public get authenticationMode() { + return this.getStringAttribute('authentication_mode'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // certificate_clusters - computed: true, optional: false, required: false + private _certificateClusters = new DataHuaweicloudCceClusterV3CertificateClustersList(this, "certificate_clusters", false); + public get certificateClusters() { + return this._certificateClusters; + } + + // certificate_users - computed: true, optional: false, required: false + private _certificateUsers = new DataHuaweicloudCceClusterV3CertificateUsersList(this, "certificate_users", false); + public get certificateUsers() { + return this._certificateUsers; + } + + // cluster_type - computed: true, optional: true, required: false + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cluster_version - computed: true, optional: false, required: false + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + + // container_network_cidr - computed: true, optional: false, required: false + public get containerNetworkCidr() { + return this.getStringAttribute('container_network_cidr'); + } + + // container_network_type - computed: true, optional: false, required: false + public get containerNetworkType() { + return this.getStringAttribute('container_network_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DataHuaweicloudCceClusterV3EndpointsList(this, "endpoints", true); + public get endpoints() { + return this._endpoints; + } + + // eni_subnet_cidr - computed: true, optional: false, required: false + public get eniSubnetCidr() { + return this.getStringAttribute('eni_subnet_cidr'); + } + + // eni_subnet_id - computed: true, optional: false, required: false + public get eniSubnetId() { + return this.getStringAttribute('eni_subnet_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // highway_subnet_id - computed: true, optional: false, required: false + public get highwaySubnetId() { + return this.getStringAttribute('highway_subnet_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kube_config_raw - computed: true, optional: false, required: false + public get kubeConfigRaw() { + return this.getStringAttribute('kube_config_raw'); + } + + // masters - computed: true, optional: false, required: false + private _masters = new DataHuaweicloudCceClusterV3MastersList(this, "masters", false); + public get masters() { + return this._masters; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // service_network_cidr - computed: true, optional: false, required: false + public get serviceNetworkCidr() { + return this.getStringAttribute('service_network_cidr'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_type: cdktf.stringToTerraform(this._clusterType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/README.md new file mode 100644 index 00000000..5f8df53d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_cluster` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/index.ts new file mode 100644 index 00000000..0ea309d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-cluster/index.ts @@ -0,0 +1,680 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#cluster_type DataHuaweicloudCceCluster#cluster_type} + */ + readonly clusterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#id DataHuaweicloudCceCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#name DataHuaweicloudCceCluster#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#region DataHuaweicloudCceCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#status DataHuaweicloudCceCluster#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#vpc_id DataHuaweicloudCceCluster#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudCceClusterCertificateClusters { +} + +export function dataHuaweicloudCceClusterCertificateClustersToTerraform(struct?: DataHuaweicloudCceClusterCertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterCertificateClustersToHclTerraform(struct?: DataHuaweicloudCceClusterCertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterCertificateClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterCertificateClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterCertificateClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_authority_data - computed: true, optional: false, required: false + public get certificateAuthorityData() { + return this.getStringAttribute('certificate_authority_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server - computed: true, optional: false, required: false + public get server() { + return this.getStringAttribute('server'); + } +} + +export class DataHuaweicloudCceClusterCertificateClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterCertificateClustersOutputReference { + return new DataHuaweicloudCceClusterCertificateClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterCertificateUsers { +} + +export function dataHuaweicloudCceClusterCertificateUsersToTerraform(struct?: DataHuaweicloudCceClusterCertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterCertificateUsersToHclTerraform(struct?: DataHuaweicloudCceClusterCertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterCertificateUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterCertificateUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterCertificateUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_certificate_data - computed: true, optional: false, required: false + public get clientCertificateData() { + return this.getStringAttribute('client_certificate_data'); + } + + // client_key_data - computed: true, optional: false, required: false + public get clientKeyData() { + return this.getStringAttribute('client_key_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCceClusterCertificateUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterCertificateUsersOutputReference { + return new DataHuaweicloudCceClusterCertificateUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterEndpoints { +} + +export function dataHuaweicloudCceClusterEndpointsToTerraform(struct?: DataHuaweicloudCceClusterEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterEndpointsToHclTerraform(struct?: DataHuaweicloudCceClusterEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class DataHuaweicloudCceClusterEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterEndpointsOutputReference { + return new DataHuaweicloudCceClusterEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClusterMasters { +} + +export function dataHuaweicloudCceClusterMastersToTerraform(struct?: DataHuaweicloudCceClusterMasters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClusterMastersToHclTerraform(struct?: DataHuaweicloudCceClusterMasters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClusterMastersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClusterMasters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClusterMasters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } +} + +export class DataHuaweicloudCceClusterMastersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClusterMastersOutputReference { + return new DataHuaweicloudCceClusterMastersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster huaweicloud_cce_cluster} +*/ +export class DataHuaweicloudCceCluster extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceCluster to import + * @param importFromId The id of the existing DataHuaweicloudCceCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_cluster huaweicloud_cce_cluster} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceClusterConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceClusterConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterType = config.clusterType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // authentication_mode - computed: true, optional: false, required: false + public get authenticationMode() { + return this.getStringAttribute('authentication_mode'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // certificate_clusters - computed: true, optional: false, required: false + private _certificateClusters = new DataHuaweicloudCceClusterCertificateClustersList(this, "certificate_clusters", false); + public get certificateClusters() { + return this._certificateClusters; + } + + // certificate_users - computed: true, optional: false, required: false + private _certificateUsers = new DataHuaweicloudCceClusterCertificateUsersList(this, "certificate_users", false); + public get certificateUsers() { + return this._certificateUsers; + } + + // cluster_type - computed: true, optional: true, required: false + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cluster_version - computed: true, optional: false, required: false + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + + // container_network_cidr - computed: true, optional: false, required: false + public get containerNetworkCidr() { + return this.getStringAttribute('container_network_cidr'); + } + + // container_network_type - computed: true, optional: false, required: false + public get containerNetworkType() { + return this.getStringAttribute('container_network_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DataHuaweicloudCceClusterEndpointsList(this, "endpoints", true); + public get endpoints() { + return this._endpoints; + } + + // eni_subnet_cidr - computed: true, optional: false, required: false + public get eniSubnetCidr() { + return this.getStringAttribute('eni_subnet_cidr'); + } + + // eni_subnet_id - computed: true, optional: false, required: false + public get eniSubnetId() { + return this.getStringAttribute('eni_subnet_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // highway_subnet_id - computed: true, optional: false, required: false + public get highwaySubnetId() { + return this.getStringAttribute('highway_subnet_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kube_config_raw - computed: true, optional: false, required: false + public get kubeConfigRaw() { + return this.getStringAttribute('kube_config_raw'); + } + + // masters - computed: true, optional: false, required: false + private _masters = new DataHuaweicloudCceClusterMastersList(this, "masters", false); + public get masters() { + return this._masters; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // service_network_cidr - computed: true, optional: false, required: false + public get serviceNetworkCidr() { + return this.getStringAttribute('service_network_cidr'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_type: cdktf.stringToTerraform(this._clusterType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/README.md new file mode 100644 index 00000000..eebcd31e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_clusters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_clusters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/index.ts new file mode 100644 index 00000000..40844768 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-clusters/index.ts @@ -0,0 +1,837 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceClustersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#cluster_id DataHuaweicloudCceClusters#cluster_id} + */ + readonly clusterId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#cluster_type DataHuaweicloudCceClusters#cluster_type} + */ + readonly clusterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#enterprise_project_id DataHuaweicloudCceClusters#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#id DataHuaweicloudCceClusters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#name DataHuaweicloudCceClusters#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#region DataHuaweicloudCceClusters#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#status DataHuaweicloudCceClusters#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#vpc_id DataHuaweicloudCceClusters#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudCceClustersClustersCertificateClusters { +} + +export function dataHuaweicloudCceClustersClustersCertificateClustersToTerraform(struct?: DataHuaweicloudCceClustersClustersCertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClustersClustersCertificateClustersToHclTerraform(struct?: DataHuaweicloudCceClustersClustersCertificateClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClustersClustersCertificateClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClustersClustersCertificateClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClustersClustersCertificateClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_authority_data - computed: true, optional: false, required: false + public get certificateAuthorityData() { + return this.getStringAttribute('certificate_authority_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server - computed: true, optional: false, required: false + public get server() { + return this.getStringAttribute('server'); + } +} + +export class DataHuaweicloudCceClustersClustersCertificateClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClustersClustersCertificateClustersOutputReference { + return new DataHuaweicloudCceClustersClustersCertificateClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClustersClustersCertificateUsers { +} + +export function dataHuaweicloudCceClustersClustersCertificateUsersToTerraform(struct?: DataHuaweicloudCceClustersClustersCertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClustersClustersCertificateUsersToHclTerraform(struct?: DataHuaweicloudCceClustersClustersCertificateUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClustersClustersCertificateUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClustersClustersCertificateUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClustersClustersCertificateUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_certificate_data - computed: true, optional: false, required: false + public get clientCertificateData() { + return this.getStringAttribute('client_certificate_data'); + } + + // client_key_data - computed: true, optional: false, required: false + public get clientKeyData() { + return this.getStringAttribute('client_key_data'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCceClustersClustersCertificateUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClustersClustersCertificateUsersOutputReference { + return new DataHuaweicloudCceClustersClustersCertificateUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClustersClustersEndpoints { +} + +export function dataHuaweicloudCceClustersClustersEndpointsToTerraform(struct?: DataHuaweicloudCceClustersClustersEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClustersClustersEndpointsToHclTerraform(struct?: DataHuaweicloudCceClustersClustersEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClustersClustersEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClustersClustersEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClustersClustersEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class DataHuaweicloudCceClustersClustersEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClustersClustersEndpointsOutputReference { + return new DataHuaweicloudCceClustersClustersEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClustersClustersMasters { +} + +export function dataHuaweicloudCceClustersClustersMastersToTerraform(struct?: DataHuaweicloudCceClustersClustersMasters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClustersClustersMastersToHclTerraform(struct?: DataHuaweicloudCceClustersClustersMasters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClustersClustersMastersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClustersClustersMasters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClustersClustersMasters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } +} + +export class DataHuaweicloudCceClustersClustersMastersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClustersClustersMastersOutputReference { + return new DataHuaweicloudCceClustersClustersMastersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceClustersClusters { +} + +export function dataHuaweicloudCceClustersClustersToTerraform(struct?: DataHuaweicloudCceClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceClustersClustersToHclTerraform(struct?: DataHuaweicloudCceClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceClustersClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceClustersClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceClustersClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authentication_mode - computed: true, optional: false, required: false + public get authenticationMode() { + return this.getStringAttribute('authentication_mode'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // certificate_clusters - computed: true, optional: false, required: false + private _certificateClusters = new DataHuaweicloudCceClustersClustersCertificateClustersList(this, "certificate_clusters", false); + public get certificateClusters() { + return this._certificateClusters; + } + + // certificate_users - computed: true, optional: false, required: false + private _certificateUsers = new DataHuaweicloudCceClustersClustersCertificateUsersList(this, "certificate_users", false); + public get certificateUsers() { + return this._certificateUsers; + } + + // cluster_type - computed: true, optional: false, required: false + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + + // cluster_version - computed: true, optional: false, required: false + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + + // container_network_cidr - computed: true, optional: false, required: false + public get containerNetworkCidr() { + return this.getStringAttribute('container_network_cidr'); + } + + // container_network_type - computed: true, optional: false, required: false + public get containerNetworkType() { + return this.getStringAttribute('container_network_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DataHuaweicloudCceClustersClustersEndpointsList(this, "endpoints", true); + public get endpoints() { + return this._endpoints; + } + + // eni_subnet_cidr - computed: true, optional: false, required: false + public get eniSubnetCidr() { + return this.getStringAttribute('eni_subnet_cidr'); + } + + // eni_subnet_id - computed: true, optional: false, required: false + public get eniSubnetId() { + return this.getStringAttribute('eni_subnet_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // kube_config_raw - computed: true, optional: false, required: false + public get kubeConfigRaw() { + return this.getStringAttribute('kube_config_raw'); + } + + // masters - computed: true, optional: false, required: false + private _masters = new DataHuaweicloudCceClustersClustersMastersList(this, "masters", false); + public get masters() { + return this._masters; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // service_network_cidr - computed: true, optional: false, required: false + public get serviceNetworkCidr() { + return this.getStringAttribute('service_network_cidr'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudCceClustersClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceClustersClustersOutputReference { + return new DataHuaweicloudCceClustersClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters huaweicloud_cce_clusters} +*/ +export class DataHuaweicloudCceClusters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_clusters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceClusters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceClusters to import + * @param importFromId The id of the existing DataHuaweicloudCceClusters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceClusters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_clusters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_clusters huaweicloud_cce_clusters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceClustersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceClustersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_clusters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._clusterType = config.clusterType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_type - computed: false, optional: true, required: false + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // clusters - computed: true, optional: false, required: false + private _clusters = new DataHuaweicloudCceClustersClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_type: cdktf.stringToTerraform(this._clusterType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/README.md new file mode 100644 index 00000000..fbbb1d21 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_node_pool` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_node_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/index.ts new file mode 100644 index 00000000..8355325a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-pool/index.ts @@ -0,0 +1,611 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceNodePoolConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#cluster_id DataHuaweicloudCceNodePool#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#id DataHuaweicloudCceNodePool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#name DataHuaweicloudCceNodePool#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#node_pool_id DataHuaweicloudCceNodePool#node_pool_id} + */ + readonly nodePoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#region DataHuaweicloudCceNodePool#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#status DataHuaweicloudCceNodePool#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCceNodePoolDataVolumes { +} + +export function dataHuaweicloudCceNodePoolDataVolumesToTerraform(struct?: DataHuaweicloudCceNodePoolDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodePoolDataVolumesToHclTerraform(struct?: DataHuaweicloudCceNodePoolDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodePoolDataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodePoolDataVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodePoolDataVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodePoolDataVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodePoolDataVolumesOutputReference { + return new DataHuaweicloudCceNodePoolDataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodePoolHostnameConfig { +} + +export function dataHuaweicloudCceNodePoolHostnameConfigToTerraform(struct?: DataHuaweicloudCceNodePoolHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodePoolHostnameConfigToHclTerraform(struct?: DataHuaweicloudCceNodePoolHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodePoolHostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodePoolHostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodePoolHostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCceNodePoolHostnameConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodePoolHostnameConfigOutputReference { + return new DataHuaweicloudCceNodePoolHostnameConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodePoolRootVolume { +} + +export function dataHuaweicloudCceNodePoolRootVolumeToTerraform(struct?: DataHuaweicloudCceNodePoolRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodePoolRootVolumeToHclTerraform(struct?: DataHuaweicloudCceNodePoolRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodePoolRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodePoolRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodePoolRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodePoolRootVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodePoolRootVolumeOutputReference { + return new DataHuaweicloudCceNodePoolRootVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool huaweicloud_cce_node_pool} +*/ +export class DataHuaweicloudCceNodePool extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceNodePool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceNodePool to import + * @param importFromId The id of the existing DataHuaweicloudCceNodePool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceNodePool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_pool huaweicloud_cce_node_pool} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceNodePoolConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceNodePoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._nodePoolId = config.nodePoolId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // current_node_count - computed: true, optional: false, required: false + public get currentNodeCount() { + return this.getNumberAttribute('current_node_count'); + } + + // data_volumes - computed: true, optional: false, required: false + private _dataVolumes = new DataHuaweicloudCceNodePoolDataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // extend_param - computed: true, optional: false, required: false + private _extendParam = new cdktf.StringMap(this, "extend_param"); + public get extendParam() { + return this._extendParam; + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // hostname_config - computed: true, optional: false, required: false + private _hostnameConfig = new DataHuaweicloudCceNodePoolHostnameConfigList(this, "hostname_config", false); + public get hostnameConfig() { + return this._hostnameConfig; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // initial_node_count - computed: true, optional: false, required: false + public get initialNodeCount() { + return this.getNumberAttribute('initial_node_count'); + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // labels - computed: true, optional: false, required: false + private _labels = new cdktf.StringMap(this, "labels"); + public get labels() { + return this._labels; + } + + // max_node_count - computed: true, optional: false, required: false + public get maxNodeCount() { + return this.getNumberAttribute('max_node_count'); + } + + // max_pods - computed: true, optional: false, required: false + public get maxPods() { + return this.getNumberAttribute('max_pods'); + } + + // min_node_count - computed: true, optional: false, required: false + public get minNodeCount() { + return this.getNumberAttribute('min_node_count'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_pool_id - computed: true, optional: true, required: false + private _nodePoolId?: string; + public get nodePoolId() { + return this.getStringAttribute('node_pool_id'); + } + public set nodePoolId(value: string) { + this._nodePoolId = value; + } + public resetNodePoolId() { + this._nodePoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodePoolIdInput() { + return this._nodePoolId; + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // root_volume - computed: true, optional: false, required: false + private _rootVolume = new DataHuaweicloudCceNodePoolRootVolumeList(this, "root_volume", false); + public get rootVolume() { + return this._rootVolume; + } + + // scale_down_cooldown_time - computed: true, optional: false, required: false + public get scaleDownCooldownTime() { + return this.getNumberAttribute('scale_down_cooldown_time'); + } + + // scall_enable - computed: true, optional: false, required: false + public get scallEnable() { + return this.getBooleanAttribute('scall_enable'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_pool_id: cdktf.stringToTerraform(this._nodePoolId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_pool_id: { + value: cdktf.stringToHclTerraform(this._nodePoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/README.md new file mode 100644 index 00000000..100473b0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_node_v3` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_node_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/index.ts new file mode 100644 index 00000000..a7d17f1d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node-v3/index.ts @@ -0,0 +1,579 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceNodeV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#cluster_id DataHuaweicloudCceNodeV3#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#id DataHuaweicloudCceNodeV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#name DataHuaweicloudCceNodeV3#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#node_id DataHuaweicloudCceNodeV3#node_id} + */ + readonly nodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#region DataHuaweicloudCceNodeV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#status DataHuaweicloudCceNodeV3#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCceNodeV3DataVolumes { +} + +export function dataHuaweicloudCceNodeV3DataVolumesToTerraform(struct?: DataHuaweicloudCceNodeV3DataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodeV3DataVolumesToHclTerraform(struct?: DataHuaweicloudCceNodeV3DataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodeV3DataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodeV3DataVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodeV3DataVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodeV3DataVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodeV3DataVolumesOutputReference { + return new DataHuaweicloudCceNodeV3DataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodeV3HostnameConfig { +} + +export function dataHuaweicloudCceNodeV3HostnameConfigToTerraform(struct?: DataHuaweicloudCceNodeV3HostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodeV3HostnameConfigToHclTerraform(struct?: DataHuaweicloudCceNodeV3HostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodeV3HostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodeV3HostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodeV3HostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCceNodeV3HostnameConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodeV3HostnameConfigOutputReference { + return new DataHuaweicloudCceNodeV3HostnameConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodeV3RootVolume { +} + +export function dataHuaweicloudCceNodeV3RootVolumeToTerraform(struct?: DataHuaweicloudCceNodeV3RootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodeV3RootVolumeToHclTerraform(struct?: DataHuaweicloudCceNodeV3RootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodeV3RootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodeV3RootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodeV3RootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodeV3RootVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodeV3RootVolumeOutputReference { + return new DataHuaweicloudCceNodeV3RootVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3 huaweicloud_cce_node_v3} +*/ +export class DataHuaweicloudCceNodeV3 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceNodeV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceNodeV3 to import + * @param importFromId The id of the existing DataHuaweicloudCceNodeV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceNodeV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node_v3 huaweicloud_cce_node_v3} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceNodeV3Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceNodeV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._nodeId = config.nodeId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // data_volumes - computed: true, optional: false, required: false + private _dataVolumes = new DataHuaweicloudCceNodeV3DataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + + // ecs_group_id - computed: true, optional: false, required: false + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // hostname_config - computed: true, optional: false, required: false + private _hostnameConfig = new DataHuaweicloudCceNodeV3HostnameConfigList(this, "hostname_config", false); + public get hostnameConfig() { + return this._hostnameConfig; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_id - computed: true, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // root_volume - computed: true, optional: false, required: false + private _rootVolume = new DataHuaweicloudCceNodeV3RootVolumeList(this, "root_volume", false); + public get rootVolume() { + return this._rootVolume; + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/README.md new file mode 100644 index 00000000..3155434a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_node` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_node`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/index.ts new file mode 100644 index 00000000..19579c47 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-node/index.ts @@ -0,0 +1,579 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceNodeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#cluster_id DataHuaweicloudCceNode#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#id DataHuaweicloudCceNode#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#name DataHuaweicloudCceNode#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#node_id DataHuaweicloudCceNode#node_id} + */ + readonly nodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#region DataHuaweicloudCceNode#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#status DataHuaweicloudCceNode#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCceNodeDataVolumes { +} + +export function dataHuaweicloudCceNodeDataVolumesToTerraform(struct?: DataHuaweicloudCceNodeDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodeDataVolumesToHclTerraform(struct?: DataHuaweicloudCceNodeDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodeDataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodeDataVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodeDataVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodeDataVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodeDataVolumesOutputReference { + return new DataHuaweicloudCceNodeDataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodeHostnameConfig { +} + +export function dataHuaweicloudCceNodeHostnameConfigToTerraform(struct?: DataHuaweicloudCceNodeHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodeHostnameConfigToHclTerraform(struct?: DataHuaweicloudCceNodeHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodeHostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodeHostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodeHostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCceNodeHostnameConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodeHostnameConfigOutputReference { + return new DataHuaweicloudCceNodeHostnameConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodeRootVolume { +} + +export function dataHuaweicloudCceNodeRootVolumeToTerraform(struct?: DataHuaweicloudCceNodeRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodeRootVolumeToHclTerraform(struct?: DataHuaweicloudCceNodeRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodeRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodeRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodeRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodeRootVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodeRootVolumeOutputReference { + return new DataHuaweicloudCceNodeRootVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node huaweicloud_cce_node} +*/ +export class DataHuaweicloudCceNode extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_node"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceNode resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceNode to import + * @param importFromId The id of the existing DataHuaweicloudCceNode that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceNode to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_node", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_node huaweicloud_cce_node} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceNodeConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceNodeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_node', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._nodeId = config.nodeId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // data_volumes - computed: true, optional: false, required: false + private _dataVolumes = new DataHuaweicloudCceNodeDataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + + // ecs_group_id - computed: true, optional: false, required: false + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // hostname_config - computed: true, optional: false, required: false + private _hostnameConfig = new DataHuaweicloudCceNodeHostnameConfigList(this, "hostname_config", false); + public get hostnameConfig() { + return this._hostnameConfig; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_id - computed: true, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // root_volume - computed: true, optional: false, required: false + private _rootVolume = new DataHuaweicloudCceNodeRootVolumeList(this, "root_volume", false); + public get rootVolume() { + return this._rootVolume; + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/README.md new file mode 100644 index 00000000..d4cd841d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cce_nodes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cce_nodes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/index.ts new file mode 100644 index 00000000..3244e3ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cce-nodes/index.ts @@ -0,0 +1,703 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCceNodesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#cluster_id DataHuaweicloudCceNodes#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#id DataHuaweicloudCceNodes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#ignore_details DataHuaweicloudCceNodes#ignore_details} + */ + readonly ignoreDetails?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#name DataHuaweicloudCceNodes#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#node_id DataHuaweicloudCceNodes#node_id} + */ + readonly nodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#region DataHuaweicloudCceNodes#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#status DataHuaweicloudCceNodes#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCceNodesNodesDataVolumes { +} + +export function dataHuaweicloudCceNodesNodesDataVolumesToTerraform(struct?: DataHuaweicloudCceNodesNodesDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodesNodesDataVolumesToHclTerraform(struct?: DataHuaweicloudCceNodesNodesDataVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodesNodesDataVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodesNodesDataVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodesNodesDataVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodesNodesDataVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodesNodesDataVolumesOutputReference { + return new DataHuaweicloudCceNodesNodesDataVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodesNodesHostnameConfig { +} + +export function dataHuaweicloudCceNodesNodesHostnameConfigToTerraform(struct?: DataHuaweicloudCceNodesNodesHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodesNodesHostnameConfigToHclTerraform(struct?: DataHuaweicloudCceNodesNodesHostnameConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodesNodesHostnameConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodesNodesHostnameConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodesNodesHostnameConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCceNodesNodesHostnameConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodesNodesHostnameConfigOutputReference { + return new DataHuaweicloudCceNodesNodesHostnameConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodesNodesRootVolume { +} + +export function dataHuaweicloudCceNodesNodesRootVolumeToTerraform(struct?: DataHuaweicloudCceNodesNodesRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodesNodesRootVolumeToHclTerraform(struct?: DataHuaweicloudCceNodesNodesRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodesNodesRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodesNodesRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodesNodesRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudCceNodesNodesRootVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodesNodesRootVolumeOutputReference { + return new DataHuaweicloudCceNodesNodesRootVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCceNodesNodes { +} + +export function dataHuaweicloudCceNodesNodesToTerraform(struct?: DataHuaweicloudCceNodesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCceNodesNodesToHclTerraform(struct?: DataHuaweicloudCceNodesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCceNodesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCceNodesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCceNodesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // billing_mode - computed: true, optional: false, required: false + public get billingMode() { + return this.getNumberAttribute('billing_mode'); + } + + // data_volumes - computed: true, optional: false, required: false + private _dataVolumes = new DataHuaweicloudCceNodesNodesDataVolumesList(this, "data_volumes", false); + public get dataVolumes() { + return this._dataVolumes; + } + + // ecs_group_id - computed: true, optional: false, required: false + public get ecsGroupId() { + return this.getStringAttribute('ecs_group_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // hostname_config - computed: true, optional: false, required: false + private _hostnameConfig = new DataHuaweicloudCceNodesNodesHostnameConfigList(this, "hostname_config", false); + public get hostnameConfig() { + return this._hostnameConfig; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // root_volume - computed: true, optional: false, required: false + private _rootVolume = new DataHuaweicloudCceNodesNodesRootVolumeList(this, "root_volume", false); + public get rootVolume() { + return this._rootVolume; + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } +} + +export class DataHuaweicloudCceNodesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCceNodesNodesOutputReference { + return new DataHuaweicloudCceNodesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes huaweicloud_cce_nodes} +*/ +export class DataHuaweicloudCceNodes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cce_nodes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCceNodes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCceNodes to import + * @param importFromId The id of the existing DataHuaweicloudCceNodes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCceNodes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cce_nodes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cce_nodes huaweicloud_cce_nodes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCceNodesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCceNodesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cce_nodes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._ignoreDetails = config.ignoreDetails; + this._name = config.name; + this._nodeId = config.nodeId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // ignore_details - computed: false, optional: true, required: false + private _ignoreDetails?: string; + public get ignoreDetails() { + return this.getStringAttribute('ignore_details'); + } + public set ignoreDetails(value: string) { + this._ignoreDetails = value; + } + public resetIgnoreDetails() { + this._ignoreDetails = undefined; + } + // Temporarily expose input value. Use with caution. + public get ignoreDetailsInput() { + return this._ignoreDetails; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudCceNodesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + ignore_details: cdktf.stringToTerraform(this._ignoreDetails), + name: cdktf.stringToTerraform(this._name), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ignore_details: { + value: cdktf.stringToHclTerraform(this._ignoreDetails), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/README.md new file mode 100644 index 00000000..e7441c01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cci_namespaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cci_namespaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/index.ts new file mode 100644 index 00000000..18d2da4f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cci-namespaces/index.ts @@ -0,0 +1,541 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCciNamespacesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces#enterprise_project_id DataHuaweicloudCciNamespaces#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces#id DataHuaweicloudCciNamespaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces#name DataHuaweicloudCciNamespaces#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces#region DataHuaweicloudCciNamespaces#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces#type DataHuaweicloudCciNamespaces#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCciNamespacesNamespacesNetworkVpc { +} + +export function dataHuaweicloudCciNamespacesNamespacesNetworkVpcToTerraform(struct?: DataHuaweicloudCciNamespacesNamespacesNetworkVpc): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCciNamespacesNamespacesNetworkVpcToHclTerraform(struct?: DataHuaweicloudCciNamespacesNamespacesNetworkVpc): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCciNamespacesNamespacesNetworkVpcOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCciNamespacesNamespacesNetworkVpc | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCciNamespacesNamespacesNetworkVpc | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // network_id - computed: true, optional: false, required: false + public get networkId() { + return this.getStringAttribute('network_id'); + } + + // subnet_cidr - computed: true, optional: false, required: false + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } +} + +export class DataHuaweicloudCciNamespacesNamespacesNetworkVpcList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCciNamespacesNamespacesNetworkVpcOutputReference { + return new DataHuaweicloudCciNamespacesNamespacesNetworkVpcOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCciNamespacesNamespacesNetwork { +} + +export function dataHuaweicloudCciNamespacesNamespacesNetworkToTerraform(struct?: DataHuaweicloudCciNamespacesNamespacesNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCciNamespacesNamespacesNetworkToHclTerraform(struct?: DataHuaweicloudCciNamespacesNamespacesNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCciNamespacesNamespacesNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCciNamespacesNamespacesNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCciNamespacesNamespacesNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // vpc - computed: true, optional: false, required: false + private _vpc = new DataHuaweicloudCciNamespacesNamespacesNetworkVpcList(this, "vpc", false); + public get vpc() { + return this._vpc; + } +} + +export class DataHuaweicloudCciNamespacesNamespacesNetworkList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCciNamespacesNamespacesNetworkOutputReference { + return new DataHuaweicloudCciNamespacesNamespacesNetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCciNamespacesNamespaces { +} + +export function dataHuaweicloudCciNamespacesNamespacesToTerraform(struct?: DataHuaweicloudCciNamespacesNamespaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCciNamespacesNamespacesToHclTerraform(struct?: DataHuaweicloudCciNamespacesNamespaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCciNamespacesNamespacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCciNamespacesNamespaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCciNamespacesNamespaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_expend_enabled - computed: true, optional: false, required: false + public get autoExpendEnabled() { + return this.getBooleanAttribute('auto_expend_enabled'); + } + + // container_network_enabled - computed: true, optional: false, required: false + public get containerNetworkEnabled() { + return this.getBooleanAttribute('container_network_enabled'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network - computed: true, optional: false, required: false + private _network = new DataHuaweicloudCciNamespacesNamespacesNetworkList(this, "network", false); + public get network() { + return this._network; + } + + // rbac_enabled - computed: true, optional: false, required: false + public get rbacEnabled() { + return this.getBooleanAttribute('rbac_enabled'); + } + + // recycling_interval - computed: true, optional: false, required: false + public get recyclingInterval() { + return this.getNumberAttribute('recycling_interval'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // warmup_pool_size - computed: true, optional: false, required: false + public get warmupPoolSize() { + return this.getNumberAttribute('warmup_pool_size'); + } +} + +export class DataHuaweicloudCciNamespacesNamespacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCciNamespacesNamespacesOutputReference { + return new DataHuaweicloudCciNamespacesNamespacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces huaweicloud_cci_namespaces} +*/ +export class DataHuaweicloudCciNamespaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cci_namespaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCciNamespaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCciNamespaces to import + * @param importFromId The id of the existing DataHuaweicloudCciNamespaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCciNamespaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cci_namespaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cci_namespaces huaweicloud_cci_namespaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCciNamespacesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCciNamespacesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cci_namespaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespaces - computed: true, optional: false, required: false + private _namespaces = new DataHuaweicloudCciNamespacesNamespacesList(this, "namespaces", false); + public get namespaces() { + return this._namespaces; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/README.md new file mode 100644 index 00000000..14548de2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ccm_certificate_export` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ccm_certificate_export`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/index.ts new file mode 100644 index 00000000..0de9587e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificate-export/index.ts @@ -0,0 +1,203 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcmCertificateExportConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the certificate ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export#certificate_id DataHuaweicloudCcmCertificateExport#certificate_id} + */ + readonly certificateId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export#id DataHuaweicloudCcmCertificateExport#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export#region DataHuaweicloudCcmCertificateExport#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export huaweicloud_ccm_certificate_export} +*/ +export class DataHuaweicloudCcmCertificateExport extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificate_export"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcmCertificateExport resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcmCertificateExport to import + * @param importFromId The id of the existing DataHuaweicloudCcmCertificateExport that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcmCertificateExport to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificate_export", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificate_export huaweicloud_ccm_certificate_export} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcmCertificateExportConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcmCertificateExportConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificate_export', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate - computed: true, optional: false, required: false + public get certificate() { + return this.getStringAttribute('certificate'); + } + + // certificate_chain - computed: true, optional: false, required: false + public get certificateChain() { + return this.getStringAttribute('certificate_chain'); + } + + // certificate_id - computed: false, optional: false, required: true + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // enc_certificate - computed: true, optional: false, required: false + public get encCertificate() { + return this.getStringAttribute('enc_certificate'); + } + + // enc_private_key - computed: true, optional: false, required: false + public get encPrivateKey() { + return this.getStringAttribute('enc_private_key'); + } + + // entire_certificate - computed: true, optional: false, required: false + public get entireCertificate() { + return this.getStringAttribute('entire_certificate'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // private_key - computed: true, optional: false, required: false + public get privateKey() { + return this.getStringAttribute('private_key'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/README.md new file mode 100644 index 00000000..92b578c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ccm_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ccm_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/index.ts new file mode 100644 index 00000000..b38af148 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-certificates/index.ts @@ -0,0 +1,412 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcmCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#deploy_support DataHuaweicloudCcmCertificates#deploy_support} + */ + readonly deploySupport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#enterprise_project_id DataHuaweicloudCcmCertificates#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#id DataHuaweicloudCcmCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#name DataHuaweicloudCcmCertificates#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#region DataHuaweicloudCcmCertificates#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#status DataHuaweicloudCcmCertificates#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCcmCertificatesCertificates { +} + +export function dataHuaweicloudCcmCertificatesCertificatesToTerraform(struct?: DataHuaweicloudCcmCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcmCertificatesCertificatesToHclTerraform(struct?: DataHuaweicloudCcmCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcmCertificatesCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcmCertificatesCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcmCertificatesCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // brand - computed: true, optional: false, required: false + public get brand() { + return this.getStringAttribute('brand'); + } + + // deploy_support - computed: true, optional: false, required: false + public get deploySupport() { + return this.getBooleanAttribute('deploy_support'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // domain_count - computed: true, optional: false, required: false + public get domainCount() { + return this.getNumberAttribute('domain_count'); + } + + // domain_type - computed: true, optional: false, required: false + public get domainType() { + return this.getStringAttribute('domain_type'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // sans - computed: true, optional: false, required: false + public get sans() { + return this.getStringAttribute('sans'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // validity_period - computed: true, optional: false, required: false + public get validityPeriod() { + return this.getNumberAttribute('validity_period'); + } + + // wildcard_count - computed: true, optional: false, required: false + public get wildcardCount() { + return this.getNumberAttribute('wildcard_count'); + } +} + +export class DataHuaweicloudCcmCertificatesCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcmCertificatesCertificatesOutputReference { + return new DataHuaweicloudCcmCertificatesCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates huaweicloud_ccm_certificates} +*/ +export class DataHuaweicloudCcmCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcmCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcmCertificates to import + * @param importFromId The id of the existing DataHuaweicloudCcmCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcmCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_certificates huaweicloud_ccm_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcmCertificatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcmCertificatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deploySupport = config.deploySupport; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificates - computed: true, optional: false, required: false + private _certificates = new DataHuaweicloudCcmCertificatesCertificatesList(this, "certificates", false); + public get certificates() { + return this._certificates; + } + + // deploy_support - computed: false, optional: true, required: false + private _deploySupport?: boolean | cdktf.IResolvable; + public get deploySupport() { + return this.getBooleanAttribute('deploy_support'); + } + public set deploySupport(value: boolean | cdktf.IResolvable) { + this._deploySupport = value; + } + public resetDeploySupport() { + this._deploySupport = undefined; + } + // Temporarily expose input value. Use with caution. + public get deploySupportInput() { + return this._deploySupport; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + deploy_support: cdktf.booleanToTerraform(this._deploySupport), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + deploy_support: { + value: cdktf.booleanToHclTerraform(this._deploySupport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/README.md new file mode 100644 index 00000000..6cdd71a2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ccm_private_ca_export` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ccm_private_ca_export`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/index.ts new file mode 100644 index 00000000..6c17c6e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-ca-export/index.ts @@ -0,0 +1,183 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcmPrivateCaExportConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the CA certificate you want to export. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export#ca_id DataHuaweicloudCcmPrivateCaExport#ca_id} + */ + readonly caId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export#id DataHuaweicloudCcmPrivateCaExport#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export#region DataHuaweicloudCcmPrivateCaExport#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export huaweicloud_ccm_private_ca_export} +*/ +export class DataHuaweicloudCcmPrivateCaExport extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_ca_export"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcmPrivateCaExport resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcmPrivateCaExport to import + * @param importFromId The id of the existing DataHuaweicloudCcmPrivateCaExport that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcmPrivateCaExport to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_ca_export", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_ca_export huaweicloud_ccm_private_ca_export} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcmPrivateCaExportConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcmPrivateCaExportConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_ca_export', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._caId = config.caId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // ca_id - computed: false, optional: false, required: true + private _caId?: string; + public get caId() { + return this.getStringAttribute('ca_id'); + } + public set caId(value: string) { + this._caId = value; + } + // Temporarily expose input value. Use with caution. + public get caIdInput() { + return this._caId; + } + + // certificate - computed: true, optional: false, required: false + public get certificate() { + return this.getStringAttribute('certificate'); + } + + // certificate_chain - computed: true, optional: false, required: false + public get certificateChain() { + return this.getStringAttribute('certificate_chain'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + ca_id: cdktf.stringToTerraform(this._caId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + ca_id: { + value: cdktf.stringToHclTerraform(this._caId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/README.md new file mode 100644 index 00000000..d093ac72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ccm_private_cas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ccm_private_cas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/index.ts new file mode 100644 index 00000000..19d59921 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-cas/index.ts @@ -0,0 +1,659 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcmPrivateCasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#id DataHuaweicloudCcmPrivateCas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the private CA name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#name DataHuaweicloudCcmPrivateCas#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#region DataHuaweicloudCcmPrivateCas#region} + */ + readonly region?: string; + /** + * Specifies the sorting sequence. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#sort_dir DataHuaweicloudCcmPrivateCas#sort_dir} + */ + readonly sortDir?: string; + /** + * Specifies the sorting attribute. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#sort_key DataHuaweicloudCcmPrivateCas#sort_key} + */ + readonly sortKey?: string; + /** + * Specifies the private CA status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#status DataHuaweicloudCcmPrivateCas#status} + */ + readonly status?: string; + /** + * Specifies the private CA type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#type DataHuaweicloudCcmPrivateCas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCcmPrivateCasCasCrlConfiguration { +} + +export function dataHuaweicloudCcmPrivateCasCasCrlConfigurationToTerraform(struct?: DataHuaweicloudCcmPrivateCasCasCrlConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcmPrivateCasCasCrlConfigurationToHclTerraform(struct?: DataHuaweicloudCcmPrivateCasCasCrlConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcmPrivateCasCasCrlConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcmPrivateCasCasCrlConfiguration | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcmPrivateCasCasCrlConfiguration | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // crl_dis_point - computed: true, optional: false, required: false + public get crlDisPoint() { + return this.getStringAttribute('crl_dis_point'); + } + + // crl_name - computed: true, optional: false, required: false + public get crlName() { + return this.getStringAttribute('crl_name'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // obs_bucket_name - computed: true, optional: false, required: false + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + + // valid_days - computed: true, optional: false, required: false + public get validDays() { + return this.getNumberAttribute('valid_days'); + } +} + +export class DataHuaweicloudCcmPrivateCasCasCrlConfigurationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcmPrivateCasCasCrlConfigurationOutputReference { + return new DataHuaweicloudCcmPrivateCasCasCrlConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcmPrivateCasCasDistinguishedName { +} + +export function dataHuaweicloudCcmPrivateCasCasDistinguishedNameToTerraform(struct?: DataHuaweicloudCcmPrivateCasCasDistinguishedName): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcmPrivateCasCasDistinguishedNameToHclTerraform(struct?: DataHuaweicloudCcmPrivateCasCasDistinguishedName): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcmPrivateCasCasDistinguishedNameOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcmPrivateCasCasDistinguishedName | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcmPrivateCasCasDistinguishedName | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // common_name - computed: true, optional: false, required: false + public get commonName() { + return this.getStringAttribute('common_name'); + } + + // country - computed: true, optional: false, required: false + public get country() { + return this.getStringAttribute('country'); + } + + // locality - computed: true, optional: false, required: false + public get locality() { + return this.getStringAttribute('locality'); + } + + // organization - computed: true, optional: false, required: false + public get organization() { + return this.getStringAttribute('organization'); + } + + // organizational_unit - computed: true, optional: false, required: false + public get organizationalUnit() { + return this.getStringAttribute('organizational_unit'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } +} + +export class DataHuaweicloudCcmPrivateCasCasDistinguishedNameList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcmPrivateCasCasDistinguishedNameOutputReference { + return new DataHuaweicloudCcmPrivateCasCasDistinguishedNameOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcmPrivateCasCas { +} + +export function dataHuaweicloudCcmPrivateCasCasToTerraform(struct?: DataHuaweicloudCcmPrivateCasCas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcmPrivateCasCasToHclTerraform(struct?: DataHuaweicloudCcmPrivateCasCas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcmPrivateCasCasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcmPrivateCasCas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcmPrivateCasCas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // crl_configuration - computed: true, optional: false, required: false + private _crlConfiguration = new DataHuaweicloudCcmPrivateCasCasCrlConfigurationList(this, "crl_configuration", false); + public get crlConfiguration() { + return this._crlConfiguration; + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getStringAttribute('deleted_at'); + } + + // distinguished_name - computed: true, optional: false, required: false + private _distinguishedName = new DataHuaweicloudCcmPrivateCasCasDistinguishedNameList(this, "distinguished_name", false); + public get distinguishedName() { + return this._distinguishedName; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // free_quota - computed: true, optional: false, required: false + public get freeQuota() { + return this.getNumberAttribute('free_quota'); + } + + // gen_mode - computed: true, optional: false, required: false + public get genMode() { + return this.getStringAttribute('gen_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // issuer_id - computed: true, optional: false, required: false + public get issuerId() { + return this.getStringAttribute('issuer_id'); + } + + // issuer_name - computed: true, optional: false, required: false + public get issuerName() { + return this.getStringAttribute('issuer_name'); + } + + // key_algorithm - computed: true, optional: false, required: false + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + + // path_length - computed: true, optional: false, required: false + public get pathLength() { + return this.getNumberAttribute('path_length'); + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCcmPrivateCasCasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcmPrivateCasCasOutputReference { + return new DataHuaweicloudCcmPrivateCasCasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas huaweicloud_ccm_private_cas} +*/ +export class DataHuaweicloudCcmPrivateCas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_cas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcmPrivateCas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcmPrivateCas to import + * @param importFromId The id of the existing DataHuaweicloudCcmPrivateCas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcmPrivateCas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_cas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_cas huaweicloud_ccm_private_cas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcmPrivateCasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcmPrivateCasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_cas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sortDir = config.sortDir; + this._sortKey = config.sortKey; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cas - computed: true, optional: false, required: false + private _cas = new DataHuaweicloudCcmPrivateCasCasList(this, "cas", false); + public get cas() { + return this._cas; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sort_dir - computed: false, optional: true, required: false + private _sortDir?: string; + public get sortDir() { + return this.getStringAttribute('sort_dir'); + } + public set sortDir(value: string) { + this._sortDir = value; + } + public resetSortDir() { + this._sortDir = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortDirInput() { + return this._sortDir; + } + + // sort_key - computed: false, optional: true, required: false + private _sortKey?: string; + public get sortKey() { + return this.getStringAttribute('sort_key'); + } + public set sortKey(value: string) { + this._sortKey = value; + } + public resetSortKey() { + this._sortKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortKeyInput() { + return this._sortKey; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sort_dir: cdktf.stringToTerraform(this._sortDir), + sort_key: cdktf.stringToTerraform(this._sortKey), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_dir: { + value: cdktf.stringToHclTerraform(this._sortDir), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_key: { + value: cdktf.stringToHclTerraform(this._sortKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/README.md new file mode 100644 index 00000000..88148979 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ccm_private_certificate_export` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ccm_private_certificate_export`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/index.ts new file mode 100644 index 00000000..8a560c45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificate-export/index.ts @@ -0,0 +1,300 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcmPrivateCertificateExportConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#certificate_id DataHuaweicloudCcmPrivateCertificateExport#certificate_id} + */ + readonly certificateId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#id DataHuaweicloudCcmPrivateCertificateExport#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#password DataHuaweicloudCcmPrivateCertificateExport#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#region DataHuaweicloudCcmPrivateCertificateExport#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#sm_standard DataHuaweicloudCcmPrivateCertificateExport#sm_standard} + */ + readonly smStandard?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#type DataHuaweicloudCcmPrivateCertificateExport#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export huaweicloud_ccm_private_certificate_export} +*/ +export class DataHuaweicloudCcmPrivateCertificateExport extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_certificate_export"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcmPrivateCertificateExport resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcmPrivateCertificateExport to import + * @param importFromId The id of the existing DataHuaweicloudCcmPrivateCertificateExport that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcmPrivateCertificateExport to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_certificate_export", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificate_export huaweicloud_ccm_private_certificate_export} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcmPrivateCertificateExportConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcmPrivateCertificateExportConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_certificate_export', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._id = config.id; + this._password = config.password; + this._region = config.region; + this._smStandard = config.smStandard; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate - computed: true, optional: false, required: false + public get certificate() { + return this.getStringAttribute('certificate'); + } + + // certificate_chain - computed: true, optional: false, required: false + public get certificateChain() { + return this.getStringAttribute('certificate_chain'); + } + + // certificate_id - computed: false, optional: false, required: true + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // enc_certificate - computed: true, optional: false, required: false + public get encCertificate() { + return this.getStringAttribute('enc_certificate'); + } + + // enc_private_key - computed: true, optional: false, required: false + public get encPrivateKey() { + return this.getStringAttribute('enc_private_key'); + } + + // enc_sm2_enveloped_key - computed: true, optional: false, required: false + public get encSm2EnvelopedKey() { + return this.getStringAttribute('enc_sm2_enveloped_key'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keystore_pass - computed: true, optional: false, required: false + public get keystorePass() { + return this.getStringAttribute('keystore_pass'); + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // private_key - computed: true, optional: false, required: false + public get privateKey() { + return this.getStringAttribute('private_key'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_jks - computed: true, optional: false, required: false + public get serverJks() { + return this.getStringAttribute('server_jks'); + } + + // server_pfx - computed: true, optional: false, required: false + public get serverPfx() { + return this.getStringAttribute('server_pfx'); + } + + // signed_and_enveloped_data - computed: true, optional: false, required: false + public get signedAndEnvelopedData() { + return this.getStringAttribute('signed_and_enveloped_data'); + } + + // sm_standard - computed: false, optional: true, required: false + private _smStandard?: string; + public get smStandard() { + return this.getStringAttribute('sm_standard'); + } + public set smStandard(value: string) { + this._smStandard = value; + } + public resetSmStandard() { + this._smStandard = undefined; + } + // Temporarily expose input value. Use with caution. + public get smStandardInput() { + return this._smStandard; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + id: cdktf.stringToTerraform(this._id), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + sm_standard: cdktf.stringToTerraform(this._smStandard), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sm_standard: { + value: cdktf.stringToHclTerraform(this._smStandard), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/README.md new file mode 100644 index 00000000..798b83ce --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ccm_private_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ccm_private_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/index.ts new file mode 100644 index 00000000..74666295 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ccm-private-certificates/index.ts @@ -0,0 +1,503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCcmPrivateCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#id DataHuaweicloudCcmPrivateCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the private certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#name DataHuaweicloudCcmPrivateCertificates#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#region DataHuaweicloudCcmPrivateCertificates#region} + */ + readonly region?: string; + /** + * Specifies the sorting sequence. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#sort_dir DataHuaweicloudCcmPrivateCertificates#sort_dir} + */ + readonly sortDir?: string; + /** + * Specifies the sorting attribute. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#sort_key DataHuaweicloudCcmPrivateCertificates#sort_key} + */ + readonly sortKey?: string; + /** + * Specifies the private certificate status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#status DataHuaweicloudCcmPrivateCertificates#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedName { +} + +export function dataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameToTerraform(struct?: DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedName): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameToHclTerraform(struct?: DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedName): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedName | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedName | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // common_name - computed: true, optional: false, required: false + public get commonName() { + return this.getStringAttribute('common_name'); + } + + // country - computed: true, optional: false, required: false + public get country() { + return this.getStringAttribute('country'); + } + + // locality - computed: true, optional: false, required: false + public get locality() { + return this.getStringAttribute('locality'); + } + + // organization - computed: true, optional: false, required: false + public get organization() { + return this.getStringAttribute('organization'); + } + + // organizational_unit - computed: true, optional: false, required: false + public get organizationalUnit() { + return this.getStringAttribute('organizational_unit'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } +} + +export class DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameOutputReference { + return new DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCcmPrivateCertificatesCertificates { +} + +export function dataHuaweicloudCcmPrivateCertificatesCertificatesToTerraform(struct?: DataHuaweicloudCcmPrivateCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCcmPrivateCertificatesCertificatesToHclTerraform(struct?: DataHuaweicloudCcmPrivateCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCcmPrivateCertificatesCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCcmPrivateCertificatesCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCcmPrivateCertificatesCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // distinguished_name - computed: true, optional: false, required: false + private _distinguishedName = new DataHuaweicloudCcmPrivateCertificatesCertificatesDistinguishedNameList(this, "distinguished_name", false); + public get distinguishedName() { + return this._distinguishedName; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // gen_mode - computed: true, optional: false, required: false + public get genMode() { + return this.getStringAttribute('gen_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // issuer_id - computed: true, optional: false, required: false + public get issuerId() { + return this.getStringAttribute('issuer_id'); + } + + // issuer_name - computed: true, optional: false, required: false + public get issuerName() { + return this.getStringAttribute('issuer_name'); + } + + // key_algorithm - computed: true, optional: false, required: false + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // start_at - computed: true, optional: false, required: false + public get startAt() { + return this.getStringAttribute('start_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudCcmPrivateCertificatesCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCcmPrivateCertificatesCertificatesOutputReference { + return new DataHuaweicloudCcmPrivateCertificatesCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates huaweicloud_ccm_private_certificates} +*/ +export class DataHuaweicloudCcmPrivateCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ccm_private_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCcmPrivateCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCcmPrivateCertificates to import + * @param importFromId The id of the existing DataHuaweicloudCcmPrivateCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCcmPrivateCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ccm_private_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ccm_private_certificates huaweicloud_ccm_private_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCcmPrivateCertificatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCcmPrivateCertificatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ccm_private_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sortDir = config.sortDir; + this._sortKey = config.sortKey; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificates - computed: true, optional: false, required: false + private _certificates = new DataHuaweicloudCcmPrivateCertificatesCertificatesList(this, "certificates", false); + public get certificates() { + return this._certificates; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sort_dir - computed: false, optional: true, required: false + private _sortDir?: string; + public get sortDir() { + return this.getStringAttribute('sort_dir'); + } + public set sortDir(value: string) { + this._sortDir = value; + } + public resetSortDir() { + this._sortDir = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortDirInput() { + return this._sortDir; + } + + // sort_key - computed: false, optional: true, required: false + private _sortKey?: string; + public get sortKey() { + return this.getStringAttribute('sort_key'); + } + public set sortKey(value: string) { + this._sortKey = value; + } + public resetSortKey() { + this._sortKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortKeyInput() { + return this._sortKey; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sort_dir: cdktf.stringToTerraform(this._sortDir), + sort_key: cdktf.stringToTerraform(this._sortKey), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_dir: { + value: cdktf.stringToHclTerraform(this._sortDir), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_key: { + value: cdktf.stringToHclTerraform(this._sortKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/README.md new file mode 100644 index 00000000..54b5ba73 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdm_clusters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdm_clusters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/index.ts new file mode 100644 index 00000000..36479332 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-clusters/index.ts @@ -0,0 +1,486 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdmClustersConfig extends cdktf.TerraformMetaArguments { + /** + * The AZ name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters#availability_zone DataHuaweicloudCdmClusters#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters#id DataHuaweicloudCdmClusters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Cluster name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters#name DataHuaweicloudCdmClusters#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters#region DataHuaweicloudCdmClusters#region} + */ + readonly region?: string; + /** + * Cluster status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters#status DataHuaweicloudCdmClusters#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCdmClustersClustersInstances { +} + +export function dataHuaweicloudCdmClustersClustersInstancesToTerraform(struct?: DataHuaweicloudCdmClustersClustersInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdmClustersClustersInstancesToHclTerraform(struct?: DataHuaweicloudCdmClustersClustersInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdmClustersClustersInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdmClustersClustersInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdmClustersClustersInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_frozen - computed: true, optional: false, required: false + public get isFrozen() { + return this.getStringAttribute('is_frozen'); + } + + // manage_ip - computed: true, optional: false, required: false + public get manageIp() { + return this.getStringAttribute('manage_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_ip - computed: true, optional: false, required: false + public get trafficIp() { + return this.getStringAttribute('traffic_ip'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCdmClustersClustersInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdmClustersClustersInstancesOutputReference { + return new DataHuaweicloudCdmClustersClustersInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCdmClustersClusters { +} + +export function dataHuaweicloudCdmClustersClustersToTerraform(struct?: DataHuaweicloudCdmClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdmClustersClustersToHclTerraform(struct?: DataHuaweicloudCdmClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdmClustersClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdmClustersClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdmClustersClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudCdmClustersClustersInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // is_auto_off - computed: true, optional: false, required: false + public get isAutoOff() { + return this.getBooleanAttribute('is_auto_off'); + } + + // is_failure_remind - computed: true, optional: false, required: false + public get isFailureRemind() { + return this.getStringAttribute('is_failure_remind'); + } + + // is_frozen - computed: true, optional: false, required: false + public get isFrozen() { + return this.getStringAttribute('is_frozen'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // public_endpoint - computed: true, optional: false, required: false + public get publicEndpoint() { + return this.getStringAttribute('public_endpoint'); + } + + // recent_event - computed: true, optional: false, required: false + public get recentEvent() { + return this.getNumberAttribute('recent_event'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCdmClustersClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdmClustersClustersOutputReference { + return new DataHuaweicloudCdmClustersClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters huaweicloud_cdm_clusters} +*/ +export class DataHuaweicloudCdmClusters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_clusters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdmClusters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdmClusters to import + * @param importFromId The id of the existing DataHuaweicloudCdmClusters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdmClusters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_clusters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_clusters huaweicloud_cdm_clusters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdmClustersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdmClustersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_clusters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // clusters - computed: true, optional: false, required: false + private _clusters = new DataHuaweicloudCdmClustersClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/README.md new file mode 100644 index 00000000..79bf37d3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdm_flavors_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdm_flavors_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/index.ts new file mode 100644 index 00000000..a80ce4dd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors-v1/index.ts @@ -0,0 +1,245 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdmFlavorsV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1#id DataHuaweicloudCdmFlavorsV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1#region DataHuaweicloudCdmFlavorsV1#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCdmFlavorsV1Flavors { +} + +export function dataHuaweicloudCdmFlavorsV1FlavorsToTerraform(struct?: DataHuaweicloudCdmFlavorsV1Flavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdmFlavorsV1FlavorsToHclTerraform(struct?: DataHuaweicloudCdmFlavorsV1Flavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdmFlavorsV1FlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdmFlavorsV1Flavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdmFlavorsV1Flavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cpu - computed: true, optional: false, required: false + public get cpu() { + return this.getStringAttribute('cpu'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCdmFlavorsV1FlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdmFlavorsV1FlavorsOutputReference { + return new DataHuaweicloudCdmFlavorsV1FlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1 huaweicloud_cdm_flavors_v1} +*/ +export class DataHuaweicloudCdmFlavorsV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_flavors_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdmFlavorsV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdmFlavorsV1 to import + * @param importFromId The id of the existing DataHuaweicloudCdmFlavorsV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdmFlavorsV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_flavors_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors_v1 huaweicloud_cdm_flavors_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdmFlavorsV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdmFlavorsV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_flavors_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCdmFlavorsV1FlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/README.md new file mode 100644 index 00000000..a4504e89 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdm_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdm_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/index.ts new file mode 100644 index 00000000..2b630a42 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-flavors/index.ts @@ -0,0 +1,245 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdmFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors#id DataHuaweicloudCdmFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors#region DataHuaweicloudCdmFlavors#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCdmFlavorsFlavors { +} + +export function dataHuaweicloudCdmFlavorsFlavorsToTerraform(struct?: DataHuaweicloudCdmFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdmFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudCdmFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdmFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdmFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdmFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cpu - computed: true, optional: false, required: false + public get cpu() { + return this.getStringAttribute('cpu'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCdmFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdmFlavorsFlavorsOutputReference { + return new DataHuaweicloudCdmFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors huaweicloud_cdm_flavors} +*/ +export class DataHuaweicloudCdmFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdmFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdmFlavors to import + * @param importFromId The id of the existing DataHuaweicloudCdmFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdmFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_flavors huaweicloud_cdm_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdmFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdmFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCdmFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/README.md new file mode 100644 index 00000000..02c86345 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdm_job_execution_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdm_job_execution_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/index.ts new file mode 100644 index 00000000..9f3873ef --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdm-job-execution-records/index.ts @@ -0,0 +1,490 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdmJobExecutionRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records#cluster_id DataHuaweicloudCdmJobExecutionRecords#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records#id DataHuaweicloudCdmJobExecutionRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the job name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records#job_name DataHuaweicloudCdmJobExecutionRecords#job_name} + */ + readonly jobName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records#region DataHuaweicloudCdmJobExecutionRecords#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCdmJobExecutionRecordsRecordsCounters { +} + +export function dataHuaweicloudCdmJobExecutionRecordsRecordsCountersToTerraform(struct?: DataHuaweicloudCdmJobExecutionRecordsRecordsCounters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdmJobExecutionRecordsRecordsCountersToHclTerraform(struct?: DataHuaweicloudCdmJobExecutionRecordsRecordsCounters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdmJobExecutionRecordsRecordsCountersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdmJobExecutionRecordsRecordsCounters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdmJobExecutionRecordsRecordsCounters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bytes_read - computed: true, optional: false, required: false + public get bytesRead() { + return this.getNumberAttribute('bytes_read'); + } + + // bytes_written - computed: true, optional: false, required: false + public get bytesWritten() { + return this.getNumberAttribute('bytes_written'); + } + + // file_skipped - computed: true, optional: false, required: false + public get fileSkipped() { + return this.getNumberAttribute('file_skipped'); + } + + // files_read - computed: true, optional: false, required: false + public get filesRead() { + return this.getNumberAttribute('files_read'); + } + + // files_written - computed: true, optional: false, required: false + public get filesWritten() { + return this.getNumberAttribute('files_written'); + } + + // rows_read - computed: true, optional: false, required: false + public get rowsRead() { + return this.getNumberAttribute('rows_read'); + } + + // rows_written - computed: true, optional: false, required: false + public get rowsWritten() { + return this.getNumberAttribute('rows_written'); + } + + // rows_written_skipped - computed: true, optional: false, required: false + public get rowsWrittenSkipped() { + return this.getNumberAttribute('rows_written_skipped'); + } + + // total_files - computed: true, optional: false, required: false + public get totalFiles() { + return this.getNumberAttribute('total_files'); + } + + // total_size - computed: true, optional: false, required: false + public get totalSize() { + return this.getNumberAttribute('total_size'); + } +} + +export class DataHuaweicloudCdmJobExecutionRecordsRecordsCountersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdmJobExecutionRecordsRecordsCountersOutputReference { + return new DataHuaweicloudCdmJobExecutionRecordsRecordsCountersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCdmJobExecutionRecordsRecords { +} + +export function dataHuaweicloudCdmJobExecutionRecordsRecordsToTerraform(struct?: DataHuaweicloudCdmJobExecutionRecordsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdmJobExecutionRecordsRecordsToHclTerraform(struct?: DataHuaweicloudCdmJobExecutionRecordsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdmJobExecutionRecordsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdmJobExecutionRecordsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdmJobExecutionRecordsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // counters - computed: true, optional: false, required: false + private _counters = new DataHuaweicloudCdmJobExecutionRecordsRecordsCountersList(this, "counters", false); + public get counters() { + return this._counters; + } + + // creation_date - computed: true, optional: false, required: false + public get creationDate() { + return this.getStringAttribute('creation_date'); + } + + // creation_user - computed: true, optional: false, required: false + public get creationUser() { + return this.getStringAttribute('creation_user'); + } + + // delete_rows - computed: true, optional: false, required: false + public get deleteRows() { + return this.getNumberAttribute('delete_rows'); + } + + // error_details - computed: true, optional: false, required: false + public get errorDetails() { + return this.getStringAttribute('error_details'); + } + + // error_summary - computed: true, optional: false, required: false + public get errorSummary() { + return this.getStringAttribute('error_summary'); + } + + // execute_date - computed: true, optional: false, required: false + public get executeDate() { + return this.getStringAttribute('execute_date'); + } + + // external_id - computed: true, optional: false, required: false + public get externalId() { + return this.getStringAttribute('external_id'); + } + + // is_delete_job - computed: true, optional: false, required: false + public get isDeleteJob() { + return this.getBooleanAttribute('is_delete_job'); + } + + // is_execute_auto - computed: true, optional: false, required: false + public get isExecuteAuto() { + return this.getBooleanAttribute('is_execute_auto'); + } + + // is_incrementing - computed: true, optional: false, required: false + public get isIncrementing() { + return this.getBooleanAttribute('is_incrementing'); + } + + // is_stoping_increment - computed: true, optional: false, required: false + public get isStopingIncrement() { + return this.getStringAttribute('is_stoping_increment'); + } + + // last_udpate_user - computed: true, optional: false, required: false + public get lastUdpateUser() { + return this.getStringAttribute('last_udpate_user'); + } + + // last_update_date - computed: true, optional: false, required: false + public get lastUpdateDate() { + return this.getStringAttribute('last_update_date'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getNumberAttribute('progress'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // submission_id - computed: true, optional: false, required: false + public get submissionId() { + return this.getNumberAttribute('submission_id'); + } + + // update_rows - computed: true, optional: false, required: false + public get updateRows() { + return this.getNumberAttribute('update_rows'); + } + + // write_rows - computed: true, optional: false, required: false + public get writeRows() { + return this.getNumberAttribute('write_rows'); + } +} + +export class DataHuaweicloudCdmJobExecutionRecordsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdmJobExecutionRecordsRecordsOutputReference { + return new DataHuaweicloudCdmJobExecutionRecordsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records huaweicloud_cdm_job_execution_records} +*/ +export class DataHuaweicloudCdmJobExecutionRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdm_job_execution_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdmJobExecutionRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdmJobExecutionRecords to import + * @param importFromId The id of the existing DataHuaweicloudCdmJobExecutionRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdmJobExecutionRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdm_job_execution_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdm_job_execution_records huaweicloud_cdm_job_execution_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdmJobExecutionRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdmJobExecutionRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdm_job_execution_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._jobName = config.jobName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_name - computed: false, optional: false, required: true + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCdmJobExecutionRecordsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + job_name: cdktf.stringToTerraform(this._jobName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/README.md new file mode 100644 index 00000000..7ec73b68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_analytics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_analytics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/index.ts new file mode 100644 index 00000000..2606247d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-analytics/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnAnalyticsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action name. Possible values are **summary** and **detail**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#action DataHuaweicloudCdnAnalytics#action} + */ + readonly action: string; + /** + * Specifies the domain name list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#domain_name DataHuaweicloudCdnAnalytics#domain_name} + */ + readonly domainName: string; + /** + * Specifies the end timestamp of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#end_time DataHuaweicloudCdnAnalytics#end_time} + */ + readonly endTime: number; + /** + * Specifies the ID of the enterprise project that the resource belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#enterprise_project_id DataHuaweicloudCdnAnalytics#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the data grouping mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#group_by DataHuaweicloudCdnAnalytics#group_by} + */ + readonly groupBy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#id DataHuaweicloudCdnAnalytics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the query interval, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#interval DataHuaweicloudCdnAnalytics#interval} + */ + readonly interval?: number; + /** + * Specifies the service area. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#service_area DataHuaweicloudCdnAnalytics#service_area} + */ + readonly serviceArea?: string; + /** + * Specifies the start timestamp of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#start_time DataHuaweicloudCdnAnalytics#start_time} + */ + readonly startTime: number; + /** + * Specifies the network resource consumption statistics. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#stat_type DataHuaweicloudCdnAnalytics#stat_type} + */ + readonly statType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics huaweicloud_cdn_analytics} +*/ +export class DataHuaweicloudCdnAnalytics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_analytics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnAnalytics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnAnalytics to import + * @param importFromId The id of the existing DataHuaweicloudCdnAnalytics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnAnalytics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_analytics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_analytics huaweicloud_cdn_analytics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnAnalyticsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnAnalyticsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_analytics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._domainName = config.domainName; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupBy = config.groupBy; + this._id = config.id; + this._interval = config.interval; + this._serviceArea = config.serviceArea; + this._startTime = config.startTime; + this._statType = config.statType; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: number; + public get endTime() { + return this.getNumberAttribute('end_time'); + } + public set endTime(value: number) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_by - computed: false, optional: true, required: false + private _groupBy?: string; + public get groupBy() { + return this.getStringAttribute('group_by'); + } + public set groupBy(value: string) { + this._groupBy = value; + } + public resetGroupBy() { + this._groupBy = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupByInput() { + return this._groupBy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interval - computed: false, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // service_area - computed: false, optional: true, required: false + private _serviceArea?: string; + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + public set serviceArea(value: string) { + this._serviceArea = value; + } + public resetServiceArea() { + this._serviceArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceAreaInput() { + return this._serviceArea; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: number; + public get startTime() { + return this.getNumberAttribute('start_time'); + } + public set startTime(value: number) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // stat_type - computed: false, optional: false, required: true + private _statType?: string; + public get statType() { + return this.getStringAttribute('stat_type'); + } + public set statType(value: string) { + this._statType = value; + } + // Temporarily expose input value. Use with caution. + public get statTypeInput() { + return this._statType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + domain_name: cdktf.stringToTerraform(this._domainName), + end_time: cdktf.numberToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_by: cdktf.stringToTerraform(this._groupBy), + id: cdktf.stringToTerraform(this._id), + interval: cdktf.numberToTerraform(this._interval), + service_area: cdktf.stringToTerraform(this._serviceArea), + start_time: cdktf.numberToTerraform(this._startTime), + stat_type: cdktf.stringToTerraform(this._statType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.numberToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_by: { + value: cdktf.stringToHclTerraform(this._groupBy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(this._interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + service_area: { + value: cdktf.stringToHclTerraform(this._serviceArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.numberToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + stat_type: { + value: cdktf.stringToHclTerraform(this._statType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/README.md new file mode 100644 index 00000000..7a269d3e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_billing_option` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_billing_option`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/index.ts new file mode 100644 index 00000000..7604c6e6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-billing-option/index.ts @@ -0,0 +1,218 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnBillingOptionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option#id DataHuaweicloudCdnBillingOption#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the product mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option#product_type DataHuaweicloudCdnBillingOption#product_type} + */ + readonly productType: string; + /** + * Specifies the service area + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option#service_area DataHuaweicloudCdnBillingOption#service_area} + */ + readonly serviceArea?: string; + /** + * Specifies the billing option status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option#status DataHuaweicloudCdnBillingOption#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option huaweicloud_cdn_billing_option} +*/ +export class DataHuaweicloudCdnBillingOption extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_billing_option"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnBillingOption resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnBillingOption to import + * @param importFromId The id of the existing DataHuaweicloudCdnBillingOption that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnBillingOption to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_billing_option", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_billing_option huaweicloud_cdn_billing_option} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnBillingOptionConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnBillingOptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_billing_option', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._productType = config.productType; + this._serviceArea = config.serviceArea; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // effective_time - computed: true, optional: false, required: false + public get effectiveTime() { + return this.getStringAttribute('effective_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // product_type - computed: false, optional: false, required: true + private _productType?: string; + public get productType() { + return this.getStringAttribute('product_type'); + } + public set productType(value: string) { + this._productType = value; + } + // Temporarily expose input value. Use with caution. + public get productTypeInput() { + return this._productType; + } + + // service_area - computed: true, optional: true, required: false + private _serviceArea?: string; + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + public set serviceArea(value: string) { + this._serviceArea = value; + } + public resetServiceArea() { + this._serviceArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceAreaInput() { + return this._serviceArea; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + product_type: cdktf.stringToTerraform(this._productType), + service_area: cdktf.stringToTerraform(this._serviceArea), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_type: { + value: cdktf.stringToHclTerraform(this._productType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_area: { + value: cdktf.stringToHclTerraform(this._serviceArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/README.md new file mode 100644 index 00000000..e71a7341 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_cache_history_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_cache_history_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/index.ts new file mode 100644 index 00000000..55dc9c67 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-history-tasks/index.ts @@ -0,0 +1,477 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnCacheHistoryTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the query end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#end_date DataHuaweicloudCdnCacheHistoryTasks#end_date} + */ + readonly endDate?: number; + /** + * Specifies the ID of the enterprise project to which the resource belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#enterprise_project_id DataHuaweicloudCdnCacheHistoryTasks#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the file type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#file_type DataHuaweicloudCdnCacheHistoryTasks#file_type} + */ + readonly fileType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#id DataHuaweicloudCdnCacheHistoryTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the field used for sorting. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#order_field DataHuaweicloudCdnCacheHistoryTasks#order_field} + */ + readonly orderField?: string; + /** + * Specifies the sorting type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#order_type DataHuaweicloudCdnCacheHistoryTasks#order_type} + */ + readonly orderType?: string; + /** + * Specifies the query start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#start_date DataHuaweicloudCdnCacheHistoryTasks#start_date} + */ + readonly startDate?: number; + /** + * Specifies the task status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#status DataHuaweicloudCdnCacheHistoryTasks#status} + */ + readonly status?: string; + /** + * Specifies the task type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#task_type DataHuaweicloudCdnCacheHistoryTasks#task_type} + */ + readonly taskType?: string; +} +export interface DataHuaweicloudCdnCacheHistoryTasksTasks { +} + +export function dataHuaweicloudCdnCacheHistoryTasksTasksToTerraform(struct?: DataHuaweicloudCdnCacheHistoryTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdnCacheHistoryTasksTasksToHclTerraform(struct?: DataHuaweicloudCdnCacheHistoryTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdnCacheHistoryTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdnCacheHistoryTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdnCacheHistoryTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // failed - computed: true, optional: false, required: false + public get failed() { + return this.getNumberAttribute('failed'); + } + + // file_type - computed: true, optional: false, required: false + public get fileType() { + return this.getStringAttribute('file_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // processing - computed: true, optional: false, required: false + public get processing() { + return this.getNumberAttribute('processing'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // succeed - computed: true, optional: false, required: false + public get succeed() { + return this.getNumberAttribute('succeed'); + } + + // task_type - computed: true, optional: false, required: false + public get taskType() { + return this.getStringAttribute('task_type'); + } + + // total - computed: true, optional: false, required: false + public get total() { + return this.getNumberAttribute('total'); + } +} + +export class DataHuaweicloudCdnCacheHistoryTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdnCacheHistoryTasksTasksOutputReference { + return new DataHuaweicloudCdnCacheHistoryTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks huaweicloud_cdn_cache_history_tasks} +*/ +export class DataHuaweicloudCdnCacheHistoryTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_cache_history_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnCacheHistoryTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnCacheHistoryTasks to import + * @param importFromId The id of the existing DataHuaweicloudCdnCacheHistoryTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnCacheHistoryTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_cache_history_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_history_tasks huaweicloud_cdn_cache_history_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnCacheHistoryTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnCacheHistoryTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_cache_history_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endDate = config.endDate; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fileType = config.fileType; + this._id = config.id; + this._orderField = config.orderField; + this._orderType = config.orderType; + this._startDate = config.startDate; + this._status = config.status; + this._taskType = config.taskType; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_date - computed: false, optional: true, required: false + private _endDate?: number; + public get endDate() { + return this.getNumberAttribute('end_date'); + } + public set endDate(value: number) { + this._endDate = value; + } + public resetEndDate() { + this._endDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get endDateInput() { + return this._endDate; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // file_type - computed: false, optional: true, required: false + private _fileType?: string; + public get fileType() { + return this.getStringAttribute('file_type'); + } + public set fileType(value: string) { + this._fileType = value; + } + public resetFileType() { + this._fileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileTypeInput() { + return this._fileType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // order_field - computed: false, optional: true, required: false + private _orderField?: string; + public get orderField() { + return this.getStringAttribute('order_field'); + } + public set orderField(value: string) { + this._orderField = value; + } + public resetOrderField() { + this._orderField = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderFieldInput() { + return this._orderField; + } + + // order_type - computed: false, optional: true, required: false + private _orderType?: string; + public get orderType() { + return this.getStringAttribute('order_type'); + } + public set orderType(value: string) { + this._orderType = value; + } + public resetOrderType() { + this._orderType = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderTypeInput() { + return this._orderType; + } + + // start_date - computed: false, optional: true, required: false + private _startDate?: number; + public get startDate() { + return this.getNumberAttribute('start_date'); + } + public set startDate(value: number) { + this._startDate = value; + } + public resetStartDate() { + this._startDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get startDateInput() { + return this._startDate; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // task_type - computed: false, optional: true, required: false + private _taskType?: string; + public get taskType() { + return this.getStringAttribute('task_type'); + } + public set taskType(value: string) { + this._taskType = value; + } + public resetTaskType() { + this._taskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskTypeInput() { + return this._taskType; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudCdnCacheHistoryTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_date: cdktf.numberToTerraform(this._endDate), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + file_type: cdktf.stringToTerraform(this._fileType), + id: cdktf.stringToTerraform(this._id), + order_field: cdktf.stringToTerraform(this._orderField), + order_type: cdktf.stringToTerraform(this._orderType), + start_date: cdktf.numberToTerraform(this._startDate), + status: cdktf.stringToTerraform(this._status), + task_type: cdktf.stringToTerraform(this._taskType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_date: { + value: cdktf.numberToHclTerraform(this._endDate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_type: { + value: cdktf.stringToHclTerraform(this._fileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + order_field: { + value: cdktf.stringToHclTerraform(this._orderField), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + order_type: { + value: cdktf.stringToHclTerraform(this._orderType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_date: { + value: cdktf.numberToHclTerraform(this._startDate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_type: { + value: cdktf.stringToHclTerraform(this._taskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/README.md new file mode 100644 index 00000000..367c27d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_cache_url_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_cache_url_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/index.ts new file mode 100644 index 00000000..1d3edefc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-cache-url-tasks/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnCacheUrlTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end timestamp, in milliseconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#end_time DataHuaweicloudCdnCacheUrlTasks#end_time} + */ + readonly endTime?: number; + /** + * Specifies the file type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#file_type DataHuaweicloudCdnCacheUrlTasks#file_type} + */ + readonly fileType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#id DataHuaweicloudCdnCacheUrlTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the start timestamp, in milliseconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#start_time DataHuaweicloudCdnCacheUrlTasks#start_time} + */ + readonly startTime?: number; + /** + * Specifies the URL status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#status DataHuaweicloudCdnCacheUrlTasks#status} + */ + readonly status?: string; + /** + * Specifies the task type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#task_type DataHuaweicloudCdnCacheUrlTasks#task_type} + */ + readonly taskType?: string; + /** + * Specifies the refresh or preheat URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#url DataHuaweicloudCdnCacheUrlTasks#url} + */ + readonly url?: string; +} +export interface DataHuaweicloudCdnCacheUrlTasksTasks { +} + +export function dataHuaweicloudCdnCacheUrlTasksTasksToTerraform(struct?: DataHuaweicloudCdnCacheUrlTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdnCacheUrlTasksTasksToHclTerraform(struct?: DataHuaweicloudCdnCacheUrlTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdnCacheUrlTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdnCacheUrlTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdnCacheUrlTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // file_type - computed: true, optional: false, required: false + public get fileType() { + return this.getStringAttribute('file_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // modify_time - computed: true, optional: false, required: false + public get modifyTime() { + return this.getStringAttribute('modify_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // task_id - computed: true, optional: false, required: false + public get taskId() { + return this.getNumberAttribute('task_id'); + } + + // task_type - computed: true, optional: false, required: false + public get taskType() { + return this.getStringAttribute('task_type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class DataHuaweicloudCdnCacheUrlTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdnCacheUrlTasksTasksOutputReference { + return new DataHuaweicloudCdnCacheUrlTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks huaweicloud_cdn_cache_url_tasks} +*/ +export class DataHuaweicloudCdnCacheUrlTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_cache_url_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnCacheUrlTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnCacheUrlTasks to import + * @param importFromId The id of the existing DataHuaweicloudCdnCacheUrlTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnCacheUrlTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_cache_url_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_cache_url_tasks huaweicloud_cdn_cache_url_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnCacheUrlTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnCacheUrlTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_cache_url_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._fileType = config.fileType; + this._id = config.id; + this._startTime = config.startTime; + this._status = config.status; + this._taskType = config.taskType; + this._url = config.url; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: number; + public get endTime() { + return this.getNumberAttribute('end_time'); + } + public set endTime(value: number) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // file_type - computed: false, optional: true, required: false + private _fileType?: string; + public get fileType() { + return this.getStringAttribute('file_type'); + } + public set fileType(value: string) { + this._fileType = value; + } + public resetFileType() { + this._fileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileTypeInput() { + return this._fileType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: number; + public get startTime() { + return this.getNumberAttribute('start_time'); + } + public set startTime(value: number) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // task_type - computed: false, optional: true, required: false + private _taskType?: string; + public get taskType() { + return this.getStringAttribute('task_type'); + } + public set taskType(value: string) { + this._taskType = value; + } + public resetTaskType() { + this._taskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskTypeInput() { + return this._taskType; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudCdnCacheUrlTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // url - computed: false, optional: true, required: false + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + public resetUrl() { + this._url = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.numberToTerraform(this._endTime), + file_type: cdktf.stringToTerraform(this._fileType), + id: cdktf.stringToTerraform(this._id), + start_time: cdktf.numberToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + task_type: cdktf.stringToTerraform(this._taskType), + url: cdktf.stringToTerraform(this._url), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.numberToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + file_type: { + value: cdktf.stringToHclTerraform(this._fileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.numberToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_type: { + value: cdktf.stringToHclTerraform(this._taskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(this._url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/README.md new file mode 100644 index 00000000..822829ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_domain_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_domain_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/index.ts new file mode 100644 index 00000000..21008238 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-certificates/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnDomainCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates#enterprise_project_id DataHuaweicloudCdnDomainCertificates#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates#id DataHuaweicloudCdnDomainCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates#name DataHuaweicloudCdnDomainCertificates#name} + */ + readonly name?: string; +} +export interface DataHuaweicloudCdnDomainCertificatesDomainCertificates { +} + +export function dataHuaweicloudCdnDomainCertificatesDomainCertificatesToTerraform(struct?: DataHuaweicloudCdnDomainCertificatesDomainCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdnDomainCertificatesDomainCertificatesToHclTerraform(struct?: DataHuaweicloudCdnDomainCertificatesDomainCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdnDomainCertificatesDomainCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdnDomainCertificatesDomainCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdnDomainCertificatesDomainCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_body - computed: true, optional: false, required: false + public get certificateBody() { + return this.getStringAttribute('certificate_body'); + } + + // certificate_name - computed: true, optional: false, required: false + public get certificateName() { + return this.getStringAttribute('certificate_name'); + } + + // certificate_source - computed: true, optional: false, required: false + public get certificateSource() { + return this.getNumberAttribute('certificate_source'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // expire_at - computed: true, optional: false, required: false + public get expireAt() { + return this.getStringAttribute('expire_at'); + } + + // force_redirect_https - computed: true, optional: false, required: false + public get forceRedirectHttps() { + return this.getNumberAttribute('force_redirect_https'); + } + + // http2_enabled - computed: true, optional: false, required: false + public get http2Enabled() { + return this.getNumberAttribute('http2_enabled'); + } + + // https_status - computed: true, optional: false, required: false + public get httpsStatus() { + return this.getNumberAttribute('https_status'); + } +} + +export class DataHuaweicloudCdnDomainCertificatesDomainCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdnDomainCertificatesDomainCertificatesOutputReference { + return new DataHuaweicloudCdnDomainCertificatesDomainCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates huaweicloud_cdn_domain_certificates} +*/ +export class DataHuaweicloudCdnDomainCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_domain_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnDomainCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnDomainCertificates to import + * @param importFromId The id of the existing DataHuaweicloudCdnDomainCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnDomainCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_domain_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_certificates huaweicloud_cdn_domain_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnDomainCertificatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnDomainCertificatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_domain_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_certificates - computed: true, optional: false, required: false + private _domainCertificates = new DataHuaweicloudCdnDomainCertificatesDomainCertificatesList(this, "domain_certificates", false); + public get domainCertificates() { + return this._domainCertificates; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/README.md new file mode 100644 index 00000000..bc391185 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_domain_statistics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_domain_statistics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/index.ts new file mode 100644 index 00000000..9275a87b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domain-statistics/index.ts @@ -0,0 +1,436 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnDomainStatisticsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#action DataHuaweicloudCdnDomainStatistics#action} + */ + readonly action: string; + /** + * Specifies the country or region code. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#country DataHuaweicloudCdnDomainStatistics#country} + */ + readonly country?: string; + /** + * Specifies the domain name list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#domain_name DataHuaweicloudCdnDomainStatistics#domain_name} + */ + readonly domainName: string; + /** + * Specifies the end timestamp of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#end_time DataHuaweicloudCdnDomainStatistics#end_time} + */ + readonly endTime: number; + /** + * Specifies the enterprise project that the resource belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#enterprise_project_id DataHuaweicloudCdnDomainStatistics#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the data grouping mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#group_by DataHuaweicloudCdnDomainStatistics#group_by} + */ + readonly groupBy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#id DataHuaweicloudCdnDomainStatistics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the query time interval. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#interval DataHuaweicloudCdnDomainStatistics#interval} + */ + readonly interval?: number; + /** + * Specifies the carrier code. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#isp DataHuaweicloudCdnDomainStatistics#isp} + */ + readonly isp?: string; + /** + * Specifies the province code. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#province DataHuaweicloudCdnDomainStatistics#province} + */ + readonly province?: string; + /** + * Specifies the start timestamp of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#start_time DataHuaweicloudCdnDomainStatistics#start_time} + */ + readonly startTime: number; + /** + * Specifies the status type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#stat_type DataHuaweicloudCdnDomainStatistics#stat_type} + */ + readonly statType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics huaweicloud_cdn_domain_statistics} +*/ +export class DataHuaweicloudCdnDomainStatistics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_domain_statistics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnDomainStatistics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnDomainStatistics to import + * @param importFromId The id of the existing DataHuaweicloudCdnDomainStatistics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnDomainStatistics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_domain_statistics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domain_statistics huaweicloud_cdn_domain_statistics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnDomainStatisticsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnDomainStatisticsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_domain_statistics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._country = config.country; + this._domainName = config.domainName; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupBy = config.groupBy; + this._id = config.id; + this._interval = config.interval; + this._isp = config.isp; + this._province = config.province; + this._startTime = config.startTime; + this._statType = config.statType; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // country - computed: false, optional: true, required: false + private _country?: string; + public get country() { + return this.getStringAttribute('country'); + } + public set country(value: string) { + this._country = value; + } + public resetCountry() { + this._country = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryInput() { + return this._country; + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: number; + public get endTime() { + return this.getNumberAttribute('end_time'); + } + public set endTime(value: number) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_by - computed: false, optional: true, required: false + private _groupBy?: string; + public get groupBy() { + return this.getStringAttribute('group_by'); + } + public set groupBy(value: string) { + this._groupBy = value; + } + public resetGroupBy() { + this._groupBy = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupByInput() { + return this._groupBy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interval - computed: false, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // isp - computed: false, optional: true, required: false + private _isp?: string; + public get isp() { + return this.getStringAttribute('isp'); + } + public set isp(value: string) { + this._isp = value; + } + public resetIsp() { + this._isp = undefined; + } + // Temporarily expose input value. Use with caution. + public get ispInput() { + return this._isp; + } + + // province - computed: false, optional: true, required: false + private _province?: string; + public get province() { + return this.getStringAttribute('province'); + } + public set province(value: string) { + this._province = value; + } + public resetProvince() { + this._province = undefined; + } + // Temporarily expose input value. Use with caution. + public get provinceInput() { + return this._province; + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: number; + public get startTime() { + return this.getNumberAttribute('start_time'); + } + public set startTime(value: number) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // stat_type - computed: false, optional: false, required: true + private _statType?: string; + public get statType() { + return this.getStringAttribute('stat_type'); + } + public set statType(value: string) { + this._statType = value; + } + // Temporarily expose input value. Use with caution. + public get statTypeInput() { + return this._statType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + country: cdktf.stringToTerraform(this._country), + domain_name: cdktf.stringToTerraform(this._domainName), + end_time: cdktf.numberToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_by: cdktf.stringToTerraform(this._groupBy), + id: cdktf.stringToTerraform(this._id), + interval: cdktf.numberToTerraform(this._interval), + isp: cdktf.stringToTerraform(this._isp), + province: cdktf.stringToTerraform(this._province), + start_time: cdktf.numberToTerraform(this._startTime), + stat_type: cdktf.stringToTerraform(this._statType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country: { + value: cdktf.stringToHclTerraform(this._country), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.numberToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_by: { + value: cdktf.stringToHclTerraform(this._groupBy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(this._interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + isp: { + value: cdktf.stringToHclTerraform(this._isp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + province: { + value: cdktf.stringToHclTerraform(this._province), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.numberToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + stat_type: { + value: cdktf.stringToHclTerraform(this._statType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/README.md new file mode 100644 index 00000000..7b98d0ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_domains` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_domains`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/index.ts new file mode 100644 index 00000000..4c014aec --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-domains/index.ts @@ -0,0 +1,558 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnDomainsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#domain_id DataHuaweicloudCdnDomains#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#domain_status DataHuaweicloudCdnDomains#domain_status} + */ + readonly domainStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#enterprise_project_id DataHuaweicloudCdnDomains#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#id DataHuaweicloudCdnDomains#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#name DataHuaweicloudCdnDomains#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#service_area DataHuaweicloudCdnDomains#service_area} + */ + readonly serviceArea?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#type DataHuaweicloudCdnDomains#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCdnDomainsDomainsSources { +} + +export function dataHuaweicloudCdnDomainsDomainsSourcesToTerraform(struct?: DataHuaweicloudCdnDomainsDomainsSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdnDomainsDomainsSourcesToHclTerraform(struct?: DataHuaweicloudCdnDomainsDomainsSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdnDomainsDomainsSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdnDomainsDomainsSources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdnDomainsDomainsSources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // active - computed: true, optional: false, required: false + public get active() { + return this.getNumberAttribute('active'); + } + + // obs_web_hosting_enabled - computed: true, optional: false, required: false + public get obsWebHostingEnabled() { + return this.getBooleanAttribute('obs_web_hosting_enabled'); + } + + // origin - computed: true, optional: false, required: false + public get origin() { + return this.getStringAttribute('origin'); + } + + // origin_type - computed: true, optional: false, required: false + public get originType() { + return this.getStringAttribute('origin_type'); + } +} + +export class DataHuaweicloudCdnDomainsDomainsSourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdnDomainsDomainsSourcesOutputReference { + return new DataHuaweicloudCdnDomainsDomainsSourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCdnDomainsDomains { +} + +export function dataHuaweicloudCdnDomainsDomainsToTerraform(struct?: DataHuaweicloudCdnDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdnDomainsDomainsToHclTerraform(struct?: DataHuaweicloudCdnDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdnDomainsDomainsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdnDomainsDomains | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdnDomainsDomains | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_refresh_preheat - computed: true, optional: false, required: false + public get autoRefreshPreheat() { + return this.getNumberAttribute('auto_refresh_preheat'); + } + + // banned_reason - computed: true, optional: false, required: false + public get bannedReason() { + return this.getStringAttribute('banned_reason'); + } + + // cname - computed: true, optional: false, required: false + public get cname() { + return this.getStringAttribute('cname'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // disabled - computed: true, optional: false, required: false + public get disabled() { + return this.getNumberAttribute('disabled'); + } + + // domain_origin_host - computed: true, optional: false, required: false + private _domainOriginHost = new cdktf.StringMap(this, "domain_origin_host"); + public get domainOriginHost() { + return this._domainOriginHost; + } + + // domain_status - computed: true, optional: false, required: false + public get domainStatus() { + return this.getStringAttribute('domain_status'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // follow_status - computed: true, optional: false, required: false + public get followStatus() { + return this.getStringAttribute('follow_status'); + } + + // https_status - computed: true, optional: false, required: false + public get httpsStatus() { + return this.getNumberAttribute('https_status'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // locked - computed: true, optional: false, required: false + public get locked() { + return this.getNumberAttribute('locked'); + } + + // locked_reason - computed: true, optional: false, required: false + public get lockedReason() { + return this.getStringAttribute('locked_reason'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // origin_status - computed: true, optional: false, required: false + public get originStatus() { + return this.getStringAttribute('origin_status'); + } + + // range_based_retrieval_enabled - computed: true, optional: false, required: false + public get rangeBasedRetrievalEnabled() { + return this.getBooleanAttribute('range_based_retrieval_enabled'); + } + + // service_area - computed: true, optional: false, required: false + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + + // sources - computed: true, optional: false, required: false + private _sources = new DataHuaweicloudCdnDomainsDomainsSourcesList(this, "sources", false); + public get sources() { + return this._sources; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCdnDomainsDomainsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdnDomainsDomainsOutputReference { + return new DataHuaweicloudCdnDomainsDomainsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains huaweicloud_cdn_domains} +*/ +export class DataHuaweicloudCdnDomains extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_domains"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnDomains resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnDomains to import + * @param importFromId The id of the existing DataHuaweicloudCdnDomains that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnDomains to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_domains", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_domains huaweicloud_cdn_domains} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnDomainsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnDomainsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_domains', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainId = config.domainId; + this._domainStatus = config.domainStatus; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._serviceArea = config.serviceArea; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_id - computed: false, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // domain_status - computed: false, optional: true, required: false + private _domainStatus?: string; + public get domainStatus() { + return this.getStringAttribute('domain_status'); + } + public set domainStatus(value: string) { + this._domainStatus = value; + } + public resetDomainStatus() { + this._domainStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainStatusInput() { + return this._domainStatus; + } + + // domains - computed: true, optional: false, required: false + private _domains = new DataHuaweicloudCdnDomainsDomainsList(this, "domains", false); + public get domains() { + return this._domains; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // service_area - computed: false, optional: true, required: false + private _serviceArea?: string; + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + public set serviceArea(value: string) { + this._serviceArea = value; + } + public resetServiceArea() { + this._serviceArea = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceAreaInput() { + return this._serviceArea; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_id: cdktf.stringToTerraform(this._domainId), + domain_status: cdktf.stringToTerraform(this._domainStatus), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + service_area: cdktf.stringToTerraform(this._serviceArea), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_status: { + value: cdktf.stringToHclTerraform(this._domainStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_area: { + value: cdktf.stringToHclTerraform(this._serviceArea), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/README.md new file mode 100644 index 00000000..827d8f9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cdn_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cdn_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/index.ts new file mode 100644 index 00000000..da22ccb3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cdn-logs/index.ts @@ -0,0 +1,339 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCdnLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the domain name to which the logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs#domain_name DataHuaweicloudCdnLogs#domain_name} + */ + readonly domainName: string; + /** + * Specifies the end time for querying logs (excluding the end time point). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs#end_time DataHuaweicloudCdnLogs#end_time} + */ + readonly endTime?: number; + /** + * Specifies the enterprise project ID to which the domain name belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs#enterprise_project_id DataHuaweicloudCdnLogs#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs#id DataHuaweicloudCdnLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the start time for querying logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs#start_time DataHuaweicloudCdnLogs#start_time} + */ + readonly startTime?: number; +} +export interface DataHuaweicloudCdnLogsLogs { +} + +export function dataHuaweicloudCdnLogsLogsToTerraform(struct?: DataHuaweicloudCdnLogsLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCdnLogsLogsToHclTerraform(struct?: DataHuaweicloudCdnLogsLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCdnLogsLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCdnLogsLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCdnLogsLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getNumberAttribute('end_time'); + } + + // link - computed: true, optional: false, required: false + public get link() { + return this.getStringAttribute('link'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getNumberAttribute('start_time'); + } +} + +export class DataHuaweicloudCdnLogsLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCdnLogsLogsOutputReference { + return new DataHuaweicloudCdnLogsLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs huaweicloud_cdn_logs} +*/ +export class DataHuaweicloudCdnLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cdn_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCdnLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCdnLogs to import + * @param importFromId The id of the existing DataHuaweicloudCdnLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCdnLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cdn_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cdn_logs huaweicloud_cdn_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCdnLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCdnLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cdn_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainName = config.domainName; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: number; + public get endTime() { + return this.getNumberAttribute('end_time'); + } + public set endTime(value: number) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logs - computed: true, optional: false, required: false + private _logs = new DataHuaweicloudCdnLogsLogsList(this, "logs", false); + public get logs() { + return this._logs; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: number; + public get startTime() { + return this.getNumberAttribute('start_time'); + } + public set startTime(value: number) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_name: cdktf.stringToTerraform(this._domainName), + end_time: cdktf.numberToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + start_time: cdktf.numberToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.numberToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.numberToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/README.md new file mode 100644 index 00000000..e94c5178 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_agent_dimensions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_agent_dimensions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/index.ts new file mode 100644 index 00000000..6433684e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-agent-dimensions/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesAgentDimensionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the dimension name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions#dim_name DataHuaweicloudCesAgentDimensions#dim_name} + */ + readonly dimName: string; + /** + * Specifies the dimension value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions#dim_value DataHuaweicloudCesAgentDimensions#dim_value} + */ + readonly dimValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions#id DataHuaweicloudCesAgentDimensions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions#instance_id DataHuaweicloudCesAgentDimensions#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions#region DataHuaweicloudCesAgentDimensions#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCesAgentDimensionsDimensions { +} + +export function dataHuaweicloudCesAgentDimensionsDimensionsToTerraform(struct?: DataHuaweicloudCesAgentDimensionsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAgentDimensionsDimensionsToHclTerraform(struct?: DataHuaweicloudCesAgentDimensionsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAgentDimensionsDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAgentDimensionsDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAgentDimensionsDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // origin_value - computed: true, optional: false, required: false + public get originValue() { + return this.getStringAttribute('origin_value'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudCesAgentDimensionsDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAgentDimensionsDimensionsOutputReference { + return new DataHuaweicloudCesAgentDimensionsDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions huaweicloud_ces_agent_dimensions} +*/ +export class DataHuaweicloudCesAgentDimensions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_agent_dimensions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesAgentDimensions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesAgentDimensions to import + * @param importFromId The id of the existing DataHuaweicloudCesAgentDimensions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesAgentDimensions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_agent_dimensions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_agent_dimensions huaweicloud_ces_agent_dimensions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesAgentDimensionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesAgentDimensionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_agent_dimensions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dimName = config.dimName; + this._dimValue = config.dimValue; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // dim_name - computed: false, optional: false, required: true + private _dimName?: string; + public get dimName() { + return this.getStringAttribute('dim_name'); + } + public set dimName(value: string) { + this._dimName = value; + } + // Temporarily expose input value. Use with caution. + public get dimNameInput() { + return this._dimName; + } + + // dim_value - computed: false, optional: true, required: false + private _dimValue?: string; + public get dimValue() { + return this.getStringAttribute('dim_value'); + } + public set dimValue(value: string) { + this._dimValue = value; + } + public resetDimValue() { + this._dimValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimValueInput() { + return this._dimValue; + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesAgentDimensionsDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dim_name: cdktf.stringToTerraform(this._dimName), + dim_value: cdktf.stringToTerraform(this._dimValue), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dim_name: { + value: cdktf.stringToHclTerraform(this._dimName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dim_value: { + value: cdktf.stringToHclTerraform(this._dimValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/README.md new file mode 100644 index 00000000..6523e8e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_alarm_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_alarm_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/index.ts new file mode 100644 index 00000000..6eb93cde --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarm-templates/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesAlarmTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the resource dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#dimension_name DataHuaweicloudCesAlarmTemplates#dimension_name} + */ + readonly dimensionName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#id DataHuaweicloudCesAlarmTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of an alarm template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#name DataHuaweicloudCesAlarmTemplates#name} + */ + readonly name?: string; + /** + * Specifies the namespace of a service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#namespace DataHuaweicloudCesAlarmTemplates#namespace} + */ + readonly namespace?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#region DataHuaweicloudCesAlarmTemplates#region} + */ + readonly region?: string; + /** + * Specifies the alarm template type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#type DataHuaweicloudCesAlarmTemplates#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCesAlarmTemplatesAlarmTemplates { +} + +export function dataHuaweicloudCesAlarmTemplatesAlarmTemplatesToTerraform(struct?: DataHuaweicloudCesAlarmTemplatesAlarmTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmTemplatesAlarmTemplatesToHclTerraform(struct?: DataHuaweicloudCesAlarmTemplatesAlarmTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmTemplatesAlarmTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmTemplatesAlarmTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmTemplatesAlarmTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // template_id - computed: true, optional: false, required: false + public get templateId() { + return this.getStringAttribute('template_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesAlarmTemplatesAlarmTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmTemplatesAlarmTemplatesOutputReference { + return new DataHuaweicloudCesAlarmTemplatesAlarmTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates huaweicloud_ces_alarm_templates} +*/ +export class DataHuaweicloudCesAlarmTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_alarm_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesAlarmTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesAlarmTemplates to import + * @param importFromId The id of the existing DataHuaweicloudCesAlarmTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesAlarmTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_alarm_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarm_templates huaweicloud_ces_alarm_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesAlarmTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesAlarmTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_alarm_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dimensionName = config.dimensionName; + this._id = config.id; + this._name = config.name; + this._namespace = config.namespace; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_templates - computed: true, optional: false, required: false + private _alarmTemplates = new DataHuaweicloudCesAlarmTemplatesAlarmTemplatesList(this, "alarm_templates", false); + public get alarmTemplates() { + return this._alarmTemplates; + } + + // dimension_name - computed: false, optional: true, required: false + private _dimensionName?: string; + public get dimensionName() { + return this.getStringAttribute('dimension_name'); + } + public set dimensionName(value: string) { + this._dimensionName = value; + } + public resetDimensionName() { + this._dimensionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionNameInput() { + return this._dimensionName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: true, required: false + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + public resetNamespace() { + this._namespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dimension_name: cdktf.stringToTerraform(this._dimensionName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dimension_name: { + value: cdktf.stringToHclTerraform(this._dimensionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/README.md new file mode 100644 index 00000000..f3edac4f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_alarmrules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_alarmrules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/index.ts new file mode 100644 index 00000000..361bf824 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-alarmrules/index.ts @@ -0,0 +1,857 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesAlarmrulesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the alarm rule ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#alarm_id DataHuaweicloudCesAlarmrules#alarm_id} + */ + readonly alarmId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#id DataHuaweicloudCesAlarmrules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of an alarm rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#name DataHuaweicloudCesAlarmrules#name} + */ + readonly name?: string; + /** + * Specifies the namespace of a service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#namespace DataHuaweicloudCesAlarmrules#namespace} + */ + readonly namespace?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#region DataHuaweicloudCesAlarmrules#region} + */ + readonly region?: string; + /** + * Specifies the alarm resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#resource_id DataHuaweicloudCesAlarmrules#resource_id} + */ + readonly resourceId?: string; +} +export interface DataHuaweicloudCesAlarmrulesAlarmsAlarmActions { +} + +export function dataHuaweicloudCesAlarmrulesAlarmsAlarmActionsToTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsAlarmActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmrulesAlarmsAlarmActionsToHclTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsAlarmActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmrulesAlarmsAlarmActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmrulesAlarmsAlarmActions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmrulesAlarmsAlarmActions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // notification_list - computed: true, optional: false, required: false + public get notificationList() { + return this.getListAttribute('notification_list'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesAlarmrulesAlarmsAlarmActionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmrulesAlarmsAlarmActionsOutputReference { + return new DataHuaweicloudCesAlarmrulesAlarmsAlarmActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesAlarmrulesAlarmsCondition { +} + +export function dataHuaweicloudCesAlarmrulesAlarmsConditionToTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmrulesAlarmsConditionToHclTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmrulesAlarmsConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmrulesAlarmsCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmrulesAlarmsCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_level - computed: true, optional: false, required: false + public get alarmLevel() { + return this.getNumberAttribute('alarm_level'); + } + + // comparison_operator - computed: true, optional: false, required: false + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getNumberAttribute('count'); + } + + // filter - computed: true, optional: false, required: false + public get filter() { + return this.getStringAttribute('filter'); + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getNumberAttribute('period'); + } + + // suppress_duration - computed: true, optional: false, required: false + public get suppressDuration() { + return this.getNumberAttribute('suppress_duration'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getNumberAttribute('value'); + } +} + +export class DataHuaweicloudCesAlarmrulesAlarmsConditionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmrulesAlarmsConditionOutputReference { + return new DataHuaweicloudCesAlarmrulesAlarmsConditionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesAlarmrulesAlarmsOkActions { +} + +export function dataHuaweicloudCesAlarmrulesAlarmsOkActionsToTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsOkActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmrulesAlarmsOkActionsToHclTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsOkActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmrulesAlarmsOkActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmrulesAlarmsOkActions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmrulesAlarmsOkActions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // notification_list - computed: true, optional: false, required: false + public get notificationList() { + return this.getListAttribute('notification_list'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesAlarmrulesAlarmsOkActionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmrulesAlarmsOkActionsOutputReference { + return new DataHuaweicloudCesAlarmrulesAlarmsOkActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensions { +} + +export function dataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsToTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsToHclTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsOutputReference { + return new DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesAlarmrulesAlarmsResources { +} + +export function dataHuaweicloudCesAlarmrulesAlarmsResourcesToTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmrulesAlarmsResourcesToHclTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarmsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmrulesAlarmsResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmrulesAlarmsResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmrulesAlarmsResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesAlarmrulesAlarmsResourcesDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // resource_group_id - computed: true, optional: false, required: false + public get resourceGroupId() { + return this.getStringAttribute('resource_group_id'); + } + + // resource_group_name - computed: true, optional: false, required: false + public get resourceGroupName() { + return this.getStringAttribute('resource_group_name'); + } +} + +export class DataHuaweicloudCesAlarmrulesAlarmsResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmrulesAlarmsResourcesOutputReference { + return new DataHuaweicloudCesAlarmrulesAlarmsResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesAlarmrulesAlarms { +} + +export function dataHuaweicloudCesAlarmrulesAlarmsToTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesAlarmrulesAlarmsToHclTerraform(struct?: DataHuaweicloudCesAlarmrulesAlarms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesAlarmrulesAlarmsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesAlarmrulesAlarms | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesAlarmrulesAlarms | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_action_enabled - computed: true, optional: false, required: false + public get alarmActionEnabled() { + return this.getBooleanAttribute('alarm_action_enabled'); + } + + // alarm_actions - computed: true, optional: false, required: false + private _alarmActions = new DataHuaweicloudCesAlarmrulesAlarmsAlarmActionsList(this, "alarm_actions", false); + public get alarmActions() { + return this._alarmActions; + } + + // alarm_description - computed: true, optional: false, required: false + public get alarmDescription() { + return this.getStringAttribute('alarm_description'); + } + + // alarm_enabled - computed: true, optional: false, required: false + public get alarmEnabled() { + return this.getBooleanAttribute('alarm_enabled'); + } + + // alarm_id - computed: true, optional: false, required: false + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + + // alarm_name - computed: true, optional: false, required: false + public get alarmName() { + return this.getStringAttribute('alarm_name'); + } + + // alarm_template_id - computed: true, optional: false, required: false + public get alarmTemplateId() { + return this.getStringAttribute('alarm_template_id'); + } + + // alarm_type - computed: true, optional: false, required: false + public get alarmType() { + return this.getStringAttribute('alarm_type'); + } + + // condition - computed: true, optional: false, required: false + private _condition = new DataHuaweicloudCesAlarmrulesAlarmsConditionList(this, "condition", false); + public get condition() { + return this._condition; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // notification_begin_time - computed: true, optional: false, required: false + public get notificationBeginTime() { + return this.getStringAttribute('notification_begin_time'); + } + + // notification_end_time - computed: true, optional: false, required: false + public get notificationEndTime() { + return this.getStringAttribute('notification_end_time'); + } + + // ok_actions - computed: true, optional: false, required: false + private _okActions = new DataHuaweicloudCesAlarmrulesAlarmsOkActionsList(this, "ok_actions", false); + public get okActions() { + return this._okActions; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudCesAlarmrulesAlarmsResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudCesAlarmrulesAlarmsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesAlarmrulesAlarmsOutputReference { + return new DataHuaweicloudCesAlarmrulesAlarmsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules huaweicloud_ces_alarmrules} +*/ +export class DataHuaweicloudCesAlarmrules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_alarmrules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesAlarmrules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesAlarmrules to import + * @param importFromId The id of the existing DataHuaweicloudCesAlarmrules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesAlarmrules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_alarmrules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_alarmrules huaweicloud_ces_alarmrules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesAlarmrulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesAlarmrulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_alarmrules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmId = config.alarmId; + this._id = config.id; + this._name = config.name; + this._namespace = config.namespace; + this._region = config.region; + this._resourceId = config.resourceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_id - computed: false, optional: true, required: false + private _alarmId?: string; + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + public set alarmId(value: string) { + this._alarmId = value; + } + public resetAlarmId() { + this._alarmId = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmIdInput() { + return this._alarmId; + } + + // alarms - computed: true, optional: false, required: false + private _alarms = new DataHuaweicloudCesAlarmrulesAlarmsList(this, "alarms", false); + public get alarms() { + return this._alarms; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: true, required: false + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + public resetNamespace() { + this._namespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_id: cdktf.stringToTerraform(this._alarmId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_id: { + value: cdktf.stringToHclTerraform(this._alarmId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/README.md new file mode 100644 index 00000000..b4c11933 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_dashboard_widgets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_dashboard_widgets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/index.ts new file mode 100644 index 00000000..4f786c60 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboard-widgets/index.ts @@ -0,0 +1,658 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesDashboardWidgetsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the dashboard ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets#dashboard_id DataHuaweicloudCesDashboardWidgets#dashboard_id} + */ + readonly dashboardId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets#id DataHuaweicloudCesDashboardWidgets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets#region DataHuaweicloudCesDashboardWidgets#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCesDashboardWidgetsWidgetsLocation { +} + +export function dataHuaweicloudCesDashboardWidgetsWidgetsLocationToTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesDashboardWidgetsWidgetsLocationToHclTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsLocationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesDashboardWidgetsWidgetsLocation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesDashboardWidgetsWidgetsLocation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // height - computed: true, optional: false, required: false + public get height() { + return this.getNumberAttribute('height'); + } + + // left - computed: true, optional: false, required: false + public get left() { + return this.getNumberAttribute('left'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getNumberAttribute('top'); + } + + // width - computed: true, optional: false, required: false + public get width() { + return this.getNumberAttribute('width'); + } +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsLocationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesDashboardWidgetsWidgetsLocationOutputReference { + return new DataHuaweicloudCesDashboardWidgetsWidgetsLocationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensions { +} + +export function dataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsToTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsToHclTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // filter_type - computed: true, optional: false, required: false + public get filterType() { + return this.getStringAttribute('filter_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // values - computed: true, optional: false, required: false + public get values() { + return this.getListAttribute('values'); + } +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsOutputReference { + return new DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesDashboardWidgetsWidgetsMetrics { +} + +export function dataHuaweicloudCesDashboardWidgetsWidgetsMetricsToTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsMetrics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesDashboardWidgetsWidgetsMetricsToHclTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsMetrics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsMetricsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesDashboardWidgetsWidgetsMetrics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesDashboardWidgetsWidgetsMetrics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alias - computed: true, optional: false, required: false + public get alias() { + return this.getListAttribute('alias'); + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesDashboardWidgetsWidgetsMetricsDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsMetricsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesDashboardWidgetsWidgetsMetricsOutputReference { + return new DataHuaweicloudCesDashboardWidgetsWidgetsMetricsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesDashboardWidgetsWidgetsProperties { +} + +export function dataHuaweicloudCesDashboardWidgetsWidgetsPropertiesToTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesDashboardWidgetsWidgetsPropertiesToHclTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgetsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesDashboardWidgetsWidgetsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesDashboardWidgetsWidgetsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // filter - computed: true, optional: false, required: false + public get filter() { + return this.getStringAttribute('filter'); + } + + // order - computed: true, optional: false, required: false + public get order() { + return this.getStringAttribute('order'); + } + + // top_n - computed: true, optional: false, required: false + public get topN() { + return this.getNumberAttribute('top_n'); + } +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesDashboardWidgetsWidgetsPropertiesOutputReference { + return new DataHuaweicloudCesDashboardWidgetsWidgetsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesDashboardWidgetsWidgets { +} + +export function dataHuaweicloudCesDashboardWidgetsWidgetsToTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesDashboardWidgetsWidgetsToHclTerraform(struct?: DataHuaweicloudCesDashboardWidgetsWidgets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesDashboardWidgetsWidgets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesDashboardWidgetsWidgets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // location - computed: true, optional: false, required: false + private _location = new DataHuaweicloudCesDashboardWidgetsWidgetsLocationList(this, "location", false); + public get location() { + return this._location; + } + + // metric_display_mode - computed: true, optional: false, required: false + public get metricDisplayMode() { + return this.getStringAttribute('metric_display_mode'); + } + + // metrics - computed: true, optional: false, required: false + private _metrics = new DataHuaweicloudCesDashboardWidgetsWidgetsMetricsList(this, "metrics", false); + public get metrics() { + return this._metrics; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudCesDashboardWidgetsWidgetsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // threshold - computed: true, optional: false, required: false + public get threshold() { + return this.getNumberAttribute('threshold'); + } + + // threshold_enabled - computed: true, optional: false, required: false + public get thresholdEnabled() { + return this.getBooleanAttribute('threshold_enabled'); + } + + // title - computed: true, optional: false, required: false + public get title() { + return this.getStringAttribute('title'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // view - computed: true, optional: false, required: false + public get view() { + return this.getStringAttribute('view'); + } + + // widget_id - computed: true, optional: false, required: false + public get widgetId() { + return this.getStringAttribute('widget_id'); + } +} + +export class DataHuaweicloudCesDashboardWidgetsWidgetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesDashboardWidgetsWidgetsOutputReference { + return new DataHuaweicloudCesDashboardWidgetsWidgetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets huaweicloud_ces_dashboard_widgets} +*/ +export class DataHuaweicloudCesDashboardWidgets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_dashboard_widgets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesDashboardWidgets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesDashboardWidgets to import + * @param importFromId The id of the existing DataHuaweicloudCesDashboardWidgets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesDashboardWidgets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_dashboard_widgets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboard_widgets huaweicloud_ces_dashboard_widgets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesDashboardWidgetsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesDashboardWidgetsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_dashboard_widgets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashboardId = config.dashboardId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // dashboard_id - computed: false, optional: false, required: true + private _dashboardId?: string; + public get dashboardId() { + return this.getStringAttribute('dashboard_id'); + } + public set dashboardId(value: string) { + this._dashboardId = value; + } + // Temporarily expose input value. Use with caution. + public get dashboardIdInput() { + return this._dashboardId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // widgets - computed: true, optional: false, required: false + private _widgets = new DataHuaweicloudCesDashboardWidgetsWidgetsList(this, "widgets", false); + public get widgets() { + return this._widgets; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dashboard_id: cdktf.stringToTerraform(this._dashboardId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dashboard_id: { + value: cdktf.stringToHclTerraform(this._dashboardId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/README.md new file mode 100644 index 00000000..d7d79c05 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_dashboards` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_dashboards`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/index.ts new file mode 100644 index 00000000..1dca3e35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-dashboards/index.ts @@ -0,0 +1,377 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesDashboardsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the dashboard ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#dashboard_id DataHuaweicloudCesDashboards#dashboard_id} + */ + readonly dashboardId?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#enterprise_project_id DataHuaweicloudCesDashboards#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#id DataHuaweicloudCesDashboards#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether a dashboard in an enterprise project is added to favorites. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#is_favorite DataHuaweicloudCesDashboards#is_favorite} + */ + readonly isFavorite?: boolean | cdktf.IResolvable; + /** + * Specifies the dashboard name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#name DataHuaweicloudCesDashboards#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#region DataHuaweicloudCesDashboards#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCesDashboardsDashboards { +} + +export function dataHuaweicloudCesDashboardsDashboardsToTerraform(struct?: DataHuaweicloudCesDashboardsDashboards): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesDashboardsDashboardsToHclTerraform(struct?: DataHuaweicloudCesDashboardsDashboards): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesDashboardsDashboardsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesDashboardsDashboards | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesDashboardsDashboards | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator_name - computed: true, optional: false, required: false + public get creatorName() { + return this.getStringAttribute('creator_name'); + } + + // dashboard_id - computed: true, optional: false, required: false + public get dashboardId() { + return this.getStringAttribute('dashboard_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // is_favorite - computed: true, optional: false, required: false + public get isFavorite() { + return this.getBooleanAttribute('is_favorite'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // row_widget_num - computed: true, optional: false, required: false + public get rowWidgetNum() { + return this.getNumberAttribute('row_widget_num'); + } +} + +export class DataHuaweicloudCesDashboardsDashboardsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesDashboardsDashboardsOutputReference { + return new DataHuaweicloudCesDashboardsDashboardsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards huaweicloud_ces_dashboards} +*/ +export class DataHuaweicloudCesDashboards extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_dashboards"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesDashboards resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesDashboards to import + * @param importFromId The id of the existing DataHuaweicloudCesDashboards that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesDashboards to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_dashboards", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_dashboards huaweicloud_ces_dashboards} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesDashboardsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesDashboardsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_dashboards', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashboardId = config.dashboardId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isFavorite = config.isFavorite; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // dashboard_id - computed: false, optional: true, required: false + private _dashboardId?: string; + public get dashboardId() { + return this.getStringAttribute('dashboard_id'); + } + public set dashboardId(value: string) { + this._dashboardId = value; + } + public resetDashboardId() { + this._dashboardId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dashboardIdInput() { + return this._dashboardId; + } + + // dashboards - computed: true, optional: false, required: false + private _dashboards = new DataHuaweicloudCesDashboardsDashboardsList(this, "dashboards", false); + public get dashboards() { + return this._dashboards; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_favorite - computed: false, optional: true, required: false + private _isFavorite?: boolean | cdktf.IResolvable; + public get isFavorite() { + return this.getBooleanAttribute('is_favorite'); + } + public set isFavorite(value: boolean | cdktf.IResolvable) { + this._isFavorite = value; + } + public resetIsFavorite() { + this._isFavorite = undefined; + } + // Temporarily expose input value. Use with caution. + public get isFavoriteInput() { + return this._isFavorite; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dashboard_id: cdktf.stringToTerraform(this._dashboardId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_favorite: cdktf.booleanToTerraform(this._isFavorite), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dashboard_id: { + value: cdktf.stringToHclTerraform(this._dashboardId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_favorite: { + value: cdktf.booleanToHclTerraform(this._isFavorite), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/README.md new file mode 100644 index 00000000..bf42b6ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_event_details` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_event_details`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/index.ts new file mode 100644 index 00000000..cdea7c36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-event-details/index.ts @@ -0,0 +1,678 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesEventDetailsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the start time of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#from DataHuaweicloudCesEventDetails#from} + */ + readonly from?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#id DataHuaweicloudCesEventDetails#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the event severity. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#level DataHuaweicloudCesEventDetails#level} + */ + readonly level?: string; + /** + * Specifies the event name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#name DataHuaweicloudCesEventDetails#name} + */ + readonly name: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#region DataHuaweicloudCesEventDetails#region} + */ + readonly region?: string; + /** + * Specifies the event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#source DataHuaweicloudCesEventDetails#source} + */ + readonly source?: string; + /** + * Specifies the event status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#state DataHuaweicloudCesEventDetails#state} + */ + readonly state?: string; + /** + * Specifies the end time of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#to DataHuaweicloudCesEventDetails#to} + */ + readonly to?: string; + /** + * Specifies the event type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#type DataHuaweicloudCesEventDetails#type} + */ + readonly type: string; + /** + * Specifies the name of the user for reporting event monitoring data. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#user DataHuaweicloudCesEventDetails#user} + */ + readonly user?: string; +} +export interface DataHuaweicloudCesEventDetailsEventInfoDetailDimensions { +} + +export function dataHuaweicloudCesEventDetailsEventInfoDetailDimensionsToTerraform(struct?: DataHuaweicloudCesEventDetailsEventInfoDetailDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesEventDetailsEventInfoDetailDimensionsToHclTerraform(struct?: DataHuaweicloudCesEventDetailsEventInfoDetailDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesEventDetailsEventInfoDetailDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesEventDetailsEventInfoDetailDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesEventDetailsEventInfoDetailDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudCesEventDetailsEventInfoDetailDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesEventDetailsEventInfoDetailDimensionsOutputReference { + return new DataHuaweicloudCesEventDetailsEventInfoDetailDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesEventDetailsEventInfoDetail { +} + +export function dataHuaweicloudCesEventDetailsEventInfoDetailToTerraform(struct?: DataHuaweicloudCesEventDetailsEventInfoDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesEventDetailsEventInfoDetailToHclTerraform(struct?: DataHuaweicloudCesEventDetailsEventInfoDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesEventDetailsEventInfoDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesEventDetailsEventInfoDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesEventDetailsEventInfoDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesEventDetailsEventInfoDetailDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // event_level - computed: true, optional: false, required: false + public get eventLevel() { + return this.getStringAttribute('event_level'); + } + + // event_state - computed: true, optional: false, required: false + public get eventState() { + return this.getStringAttribute('event_state'); + } + + // event_type - computed: true, optional: false, required: false + public get eventType() { + return this.getStringAttribute('event_type'); + } + + // event_user - computed: true, optional: false, required: false + public get eventUser() { + return this.getStringAttribute('event_user'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } +} + +export class DataHuaweicloudCesEventDetailsEventInfoDetailList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesEventDetailsEventInfoDetailOutputReference { + return new DataHuaweicloudCesEventDetailsEventInfoDetailOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesEventDetailsEventInfo { +} + +export function dataHuaweicloudCesEventDetailsEventInfoToTerraform(struct?: DataHuaweicloudCesEventDetailsEventInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesEventDetailsEventInfoToHclTerraform(struct?: DataHuaweicloudCesEventDetailsEventInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesEventDetailsEventInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesEventDetailsEventInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesEventDetailsEventInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // detail - computed: true, optional: false, required: false + private _detail = new DataHuaweicloudCesEventDetailsEventInfoDetailList(this, "detail", false); + public get detail() { + return this._detail; + } + + // event_id - computed: true, optional: false, required: false + public get eventId() { + return this.getStringAttribute('event_id'); + } + + // event_name - computed: true, optional: false, required: false + public get eventName() { + return this.getStringAttribute('event_name'); + } + + // event_source - computed: true, optional: false, required: false + public get eventSource() { + return this.getStringAttribute('event_source'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } +} + +export class DataHuaweicloudCesEventDetailsEventInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesEventDetailsEventInfoOutputReference { + return new DataHuaweicloudCesEventDetailsEventInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details huaweicloud_ces_event_details} +*/ +export class DataHuaweicloudCesEventDetails extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_event_details"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesEventDetails resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesEventDetails to import + * @param importFromId The id of the existing DataHuaweicloudCesEventDetails that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesEventDetails to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_event_details", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_event_details huaweicloud_ces_event_details} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesEventDetailsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesEventDetailsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_event_details', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._from = config.from; + this._id = config.id; + this._level = config.level; + this._name = config.name; + this._region = config.region; + this._source = config.source; + this._state = config.state; + this._to = config.to; + this._type = config.type; + this._user = config.user; + } + + // ========== + // ATTRIBUTES + // ========== + + // event_info - computed: true, optional: false, required: false + private _eventInfo = new DataHuaweicloudCesEventDetailsEventInfoList(this, "event_info", false); + public get eventInfo() { + return this._eventInfo; + } + + // from - computed: false, optional: true, required: false + private _from?: string; + public get from() { + return this.getStringAttribute('from'); + } + public set from(value: string) { + this._from = value; + } + public resetFrom() { + this._from = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromInput() { + return this._from; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // to - computed: false, optional: true, required: false + private _to?: string; + public get to() { + return this.getStringAttribute('to'); + } + public set to(value: string) { + this._to = value; + } + public resetTo() { + this._to = undefined; + } + // Temporarily expose input value. Use with caution. + public get toInput() { + return this._to; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + from: cdktf.stringToTerraform(this._from), + id: cdktf.stringToTerraform(this._id), + level: cdktf.stringToTerraform(this._level), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + state: cdktf.stringToTerraform(this._state), + to: cdktf.stringToTerraform(this._to), + type: cdktf.stringToTerraform(this._type), + user: cdktf.stringToTerraform(this._user), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + from: { + value: cdktf.stringToHclTerraform(this._from), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to: { + value: cdktf.stringToHclTerraform(this._to), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(this._user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/README.md new file mode 100644 index 00000000..190ca458 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_events` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_events`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/index.ts new file mode 100644 index 00000000..63ad3d57 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-events/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesEventsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the start time of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#from DataHuaweicloudCesEvents#from} + */ + readonly from?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#id DataHuaweicloudCesEvents#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the event name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#name DataHuaweicloudCesEvents#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#region DataHuaweicloudCesEvents#region} + */ + readonly region?: string; + /** + * Specifies the end time of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#to DataHuaweicloudCesEvents#to} + */ + readonly to?: string; + /** + * Specifies the event type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#type DataHuaweicloudCesEvents#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCesEventsEvents { +} + +export function dataHuaweicloudCesEventsEventsToTerraform(struct?: DataHuaweicloudCesEventsEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesEventsEventsToHclTerraform(struct?: DataHuaweicloudCesEventsEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesEventsEventsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesEventsEvents | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesEventsEvents | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // event_count - computed: true, optional: false, required: false + public get eventCount() { + return this.getNumberAttribute('event_count'); + } + + // event_name - computed: true, optional: false, required: false + public get eventName() { + return this.getStringAttribute('event_name'); + } + + // event_type - computed: true, optional: false, required: false + public get eventType() { + return this.getStringAttribute('event_type'); + } + + // latest_event_source - computed: true, optional: false, required: false + public get latestEventSource() { + return this.getStringAttribute('latest_event_source'); + } + + // latest_occur_time - computed: true, optional: false, required: false + public get latestOccurTime() { + return this.getStringAttribute('latest_occur_time'); + } +} + +export class DataHuaweicloudCesEventsEventsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesEventsEventsOutputReference { + return new DataHuaweicloudCesEventsEventsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events huaweicloud_ces_events} +*/ +export class DataHuaweicloudCesEvents extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_events"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesEvents resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesEvents to import + * @param importFromId The id of the existing DataHuaweicloudCesEvents that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesEvents to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_events", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_events huaweicloud_ces_events} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesEventsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesEventsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_events', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._from = config.from; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._to = config.to; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // events - computed: true, optional: false, required: false + private _events = new DataHuaweicloudCesEventsEventsList(this, "events", false); + public get events() { + return this._events; + } + + // from - computed: false, optional: true, required: false + private _from?: string; + public get from() { + return this.getStringAttribute('from'); + } + public set from(value: string) { + this._from = value; + } + public resetFrom() { + this._from = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromInput() { + return this._from; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // to - computed: false, optional: true, required: false + private _to?: string; + public get to() { + return this.getStringAttribute('to'); + } + public set to(value: string) { + this._to = value; + } + public resetTo() { + this._to = undefined; + } + // Temporarily expose input value. Use with caution. + public get toInput() { + return this._to; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + from: cdktf.stringToTerraform(this._from), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + to: cdktf.stringToTerraform(this._to), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + from: { + value: cdktf.stringToHclTerraform(this._from), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to: { + value: cdktf.stringToHclTerraform(this._to), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/README.md new file mode 100644 index 00000000..a30cd54e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_metrics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_metrics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/index.ts new file mode 100644 index 00000000..f60a9dda --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-metrics/index.ts @@ -0,0 +1,473 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesMetricsConfig extends cdktf.TerraformMetaArguments { + /** + * The first metric dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#dim_0 DataHuaweicloudCesMetrics#dim_0} + */ + readonly dim0?: string; + /** + * The second metric dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#dim_1 DataHuaweicloudCesMetrics#dim_1} + */ + readonly dim1?: string; + /** + * The third metric dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#dim_2 DataHuaweicloudCesMetrics#dim_2} + */ + readonly dim2?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#id DataHuaweicloudCesMetrics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The metric name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#metric_name DataHuaweicloudCesMetrics#metric_name} + */ + readonly metricName?: string; + /** + * The metric namespace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#namespace DataHuaweicloudCesMetrics#namespace} + */ + readonly namespace?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#region DataHuaweicloudCesMetrics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCesMetricsMetricsDimensions { +} + +export function dataHuaweicloudCesMetricsMetricsDimensionsToTerraform(struct?: DataHuaweicloudCesMetricsMetricsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesMetricsMetricsDimensionsToHclTerraform(struct?: DataHuaweicloudCesMetricsMetricsDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesMetricsMetricsDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesMetricsMetricsDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesMetricsMetricsDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudCesMetricsMetricsDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesMetricsMetricsDimensionsOutputReference { + return new DataHuaweicloudCesMetricsMetricsDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesMetricsMetrics { +} + +export function dataHuaweicloudCesMetricsMetricsToTerraform(struct?: DataHuaweicloudCesMetricsMetrics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesMetricsMetricsToHclTerraform(struct?: DataHuaweicloudCesMetricsMetrics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesMetricsMetricsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesMetricsMetrics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesMetricsMetrics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesMetricsMetricsDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } +} + +export class DataHuaweicloudCesMetricsMetricsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesMetricsMetricsOutputReference { + return new DataHuaweicloudCesMetricsMetricsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics huaweicloud_ces_metrics} +*/ +export class DataHuaweicloudCesMetrics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_metrics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesMetrics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesMetrics to import + * @param importFromId The id of the existing DataHuaweicloudCesMetrics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesMetrics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_metrics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_metrics huaweicloud_ces_metrics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesMetricsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesMetricsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_metrics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dim0 = config.dim0; + this._dim1 = config.dim1; + this._dim2 = config.dim2; + this._id = config.id; + this._metricName = config.metricName; + this._namespace = config.namespace; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // dim_0 - computed: false, optional: true, required: false + private _dim0?: string; + public get dim0() { + return this.getStringAttribute('dim_0'); + } + public set dim0(value: string) { + this._dim0 = value; + } + public resetDim0() { + this._dim0 = undefined; + } + // Temporarily expose input value. Use with caution. + public get dim0Input() { + return this._dim0; + } + + // dim_1 - computed: false, optional: true, required: false + private _dim1?: string; + public get dim1() { + return this.getStringAttribute('dim_1'); + } + public set dim1(value: string) { + this._dim1 = value; + } + public resetDim1() { + this._dim1 = undefined; + } + // Temporarily expose input value. Use with caution. + public get dim1Input() { + return this._dim1; + } + + // dim_2 - computed: false, optional: true, required: false + private _dim2?: string; + public get dim2() { + return this.getStringAttribute('dim_2'); + } + public set dim2(value: string) { + this._dim2 = value; + } + public resetDim2() { + this._dim2 = undefined; + } + // Temporarily expose input value. Use with caution. + public get dim2Input() { + return this._dim2; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // metric_name - computed: false, optional: true, required: false + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + public resetMetricName() { + this._metricName = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // metrics - computed: true, optional: false, required: false + private _metrics = new DataHuaweicloudCesMetricsMetricsList(this, "metrics", false); + public get metrics() { + return this._metrics; + } + + // namespace - computed: false, optional: true, required: false + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + public resetNamespace() { + this._namespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dim_0: cdktf.stringToTerraform(this._dim0), + dim_1: cdktf.stringToTerraform(this._dim1), + dim_2: cdktf.stringToTerraform(this._dim2), + id: cdktf.stringToTerraform(this._id), + metric_name: cdktf.stringToTerraform(this._metricName), + namespace: cdktf.stringToTerraform(this._namespace), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dim_0: { + value: cdktf.stringToHclTerraform(this._dim0), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dim_1: { + value: cdktf.stringToHclTerraform(this._dim1), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dim_2: { + value: cdktf.stringToHclTerraform(this._dim2), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_name: { + value: cdktf.stringToHclTerraform(this._metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/README.md new file mode 100644 index 00000000..6771f5ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_one_click_alarm_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_one_click_alarm_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/index.ts new file mode 100644 index 00000000..ea090968 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarm-rules/index.ts @@ -0,0 +1,769 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesOneClickAlarmRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules#id DataHuaweicloudCesOneClickAlarmRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the one-click monitoring ID for a service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules#one_click_alarm_id DataHuaweicloudCesOneClickAlarmRules#one_click_alarm_id} + */ + readonly oneClickAlarmId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules#region DataHuaweicloudCesOneClickAlarmRules#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotifications { +} + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsToTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // notification_list - computed: true, optional: false, required: false + public get notificationList() { + return this.getListAttribute('notification_list'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsOutputReference { + return new DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotifications { +} + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsToTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // notification_list - computed: true, optional: false, required: false + public get notificationList() { + return this.getListAttribute('notification_list'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsOutputReference { + return new DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesOneClickAlarmRulesAlarmsPolicies { +} + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesToTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmRulesAlarmsPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmRulesAlarmsPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_policy_id - computed: true, optional: false, required: false + public get alarmPolicyId() { + return this.getStringAttribute('alarm_policy_id'); + } + + // comparison_operator - computed: true, optional: false, required: false + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getNumberAttribute('count'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // filter - computed: true, optional: false, required: false + public get filter() { + return this.getStringAttribute('filter'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getNumberAttribute('level'); + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getNumberAttribute('period'); + } + + // suppress_duration - computed: true, optional: false, required: false + public get suppressDuration() { + return this.getNumberAttribute('suppress_duration'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getNumberAttribute('value'); + } +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesOutputReference { + return new DataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensions { +} + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsToTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsOutputReference { + return new DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesOneClickAlarmRulesAlarmsResources { +} + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesToTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarmsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmRulesAlarmsResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmRulesAlarmsResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // resource_group_id - computed: true, optional: false, required: false + public get resourceGroupId() { + return this.getStringAttribute('resource_group_id'); + } + + // resource_group_name - computed: true, optional: false, required: false + public get resourceGroupName() { + return this.getStringAttribute('resource_group_name'); + } +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesOutputReference { + return new DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesOneClickAlarmRulesAlarms { +} + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsToTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmRulesAlarmsToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmRulesAlarms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmRulesAlarms | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmRulesAlarms | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_id - computed: true, optional: false, required: false + public get alarmId() { + return this.getStringAttribute('alarm_id'); + } + + // alarm_notifications - computed: true, optional: false, required: false + private _alarmNotifications = new DataHuaweicloudCesOneClickAlarmRulesAlarmsAlarmNotificationsList(this, "alarm_notifications", false); + public get alarmNotifications() { + return this._alarmNotifications; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // notification_begin_time - computed: true, optional: false, required: false + public get notificationBeginTime() { + return this.getStringAttribute('notification_begin_time'); + } + + // notification_enabled - computed: true, optional: false, required: false + public get notificationEnabled() { + return this.getBooleanAttribute('notification_enabled'); + } + + // notification_end_time - computed: true, optional: false, required: false + public get notificationEndTime() { + return this.getStringAttribute('notification_end_time'); + } + + // ok_notifications - computed: true, optional: false, required: false + private _okNotifications = new DataHuaweicloudCesOneClickAlarmRulesAlarmsOkNotificationsList(this, "ok_notifications", false); + public get okNotifications() { + return this._okNotifications; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudCesOneClickAlarmRulesAlarmsPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudCesOneClickAlarmRulesAlarmsResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesOneClickAlarmRulesAlarmsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmRulesAlarmsOutputReference { + return new DataHuaweicloudCesOneClickAlarmRulesAlarmsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules huaweicloud_ces_one_click_alarm_rules} +*/ +export class DataHuaweicloudCesOneClickAlarmRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_one_click_alarm_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesOneClickAlarmRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesOneClickAlarmRules to import + * @param importFromId The id of the existing DataHuaweicloudCesOneClickAlarmRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesOneClickAlarmRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_one_click_alarm_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarm_rules huaweicloud_ces_one_click_alarm_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesOneClickAlarmRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesOneClickAlarmRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_one_click_alarm_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._oneClickAlarmId = config.oneClickAlarmId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarms - computed: true, optional: false, required: false + private _alarms = new DataHuaweicloudCesOneClickAlarmRulesAlarmsList(this, "alarms", false); + public get alarms() { + return this._alarms; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // one_click_alarm_id - computed: false, optional: false, required: true + private _oneClickAlarmId?: string; + public get oneClickAlarmId() { + return this.getStringAttribute('one_click_alarm_id'); + } + public set oneClickAlarmId(value: string) { + this._oneClickAlarmId = value; + } + // Temporarily expose input value. Use with caution. + public get oneClickAlarmIdInput() { + return this._oneClickAlarmId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + one_click_alarm_id: cdktf.stringToTerraform(this._oneClickAlarmId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + one_click_alarm_id: { + value: cdktf.stringToHclTerraform(this._oneClickAlarmId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/README.md new file mode 100644 index 00000000..6044174d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_one_click_alarms` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_one_click_alarms`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/index.ts new file mode 100644 index 00000000..70fec2aa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-one-click-alarms/index.ts @@ -0,0 +1,242 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesOneClickAlarmsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms#id DataHuaweicloudCesOneClickAlarms#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms#region DataHuaweicloudCesOneClickAlarms#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCesOneClickAlarmsOneClickAlarms { +} + +export function dataHuaweicloudCesOneClickAlarmsOneClickAlarmsToTerraform(struct?: DataHuaweicloudCesOneClickAlarmsOneClickAlarms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesOneClickAlarmsOneClickAlarmsToHclTerraform(struct?: DataHuaweicloudCesOneClickAlarmsOneClickAlarms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesOneClickAlarmsOneClickAlarmsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesOneClickAlarmsOneClickAlarms | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesOneClickAlarmsOneClickAlarms | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // one_click_alarm_id - computed: true, optional: false, required: false + public get oneClickAlarmId() { + return this.getStringAttribute('one_click_alarm_id'); + } +} + +export class DataHuaweicloudCesOneClickAlarmsOneClickAlarmsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesOneClickAlarmsOneClickAlarmsOutputReference { + return new DataHuaweicloudCesOneClickAlarmsOneClickAlarmsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms huaweicloud_ces_one_click_alarms} +*/ +export class DataHuaweicloudCesOneClickAlarms extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_one_click_alarms"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesOneClickAlarms resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesOneClickAlarms to import + * @param importFromId The id of the existing DataHuaweicloudCesOneClickAlarms that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesOneClickAlarms to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_one_click_alarms", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_one_click_alarms huaweicloud_ces_one_click_alarms} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesOneClickAlarmsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesOneClickAlarmsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_one_click_alarms', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // one_click_alarms - computed: true, optional: false, required: false + private _oneClickAlarms = new DataHuaweicloudCesOneClickAlarmsOneClickAlarmsList(this, "one_click_alarms", false); + public get oneClickAlarms() { + return this._oneClickAlarms; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/README.md new file mode 100644 index 00000000..af17591b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_resource_group_service_resources` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_resource_group_service_resources`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/index.ts new file mode 100644 index 00000000..497b4a93 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-group-service-resources/index.ts @@ -0,0 +1,457 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesResourceGroupServiceResourcesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the dimension name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#dim_name DataHuaweicloudCesResourceGroupServiceResources#dim_name} + */ + readonly dimName?: string; + /** + * Specifies the dimension value. Fuzzy match is not supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#dim_value DataHuaweicloudCesResourceGroupServiceResources#dim_value} + */ + readonly dimValue?: string; + /** + * Specifies the resource group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#group_id DataHuaweicloudCesResourceGroupServiceResources#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#id DataHuaweicloudCesResourceGroupServiceResources#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#region DataHuaweicloudCesResourceGroupServiceResources#region} + */ + readonly region?: string; + /** + * Specifies the service type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#service DataHuaweicloudCesResourceGroupServiceResources#service} + */ + readonly service: string; + /** + * Specifies the health status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#status DataHuaweicloudCesResourceGroupServiceResources#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensions { +} + +export function dataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsToTerraform(struct?: DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsToHclTerraform(struct?: DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsOutputReference { + return new DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCesResourceGroupServiceResourcesResources { +} + +export function dataHuaweicloudCesResourceGroupServiceResourcesResourcesToTerraform(struct?: DataHuaweicloudCesResourceGroupServiceResourcesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesResourceGroupServiceResourcesResourcesToHclTerraform(struct?: DataHuaweicloudCesResourceGroupServiceResourcesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesResourceGroupServiceResourcesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesResourceGroupServiceResourcesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesResourceGroupServiceResourcesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dimensions - computed: true, optional: false, required: false + private _dimensions = new DataHuaweicloudCesResourceGroupServiceResourcesResourcesDimensionsList(this, "dimensions", false); + public get dimensions() { + return this._dimensions; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudCesResourceGroupServiceResourcesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesResourceGroupServiceResourcesResourcesOutputReference { + return new DataHuaweicloudCesResourceGroupServiceResourcesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources huaweicloud_ces_resource_group_service_resources} +*/ +export class DataHuaweicloudCesResourceGroupServiceResources extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_resource_group_service_resources"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesResourceGroupServiceResources resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesResourceGroupServiceResources to import + * @param importFromId The id of the existing DataHuaweicloudCesResourceGroupServiceResources that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesResourceGroupServiceResources to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_resource_group_service_resources", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_group_service_resources huaweicloud_ces_resource_group_service_resources} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesResourceGroupServiceResourcesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesResourceGroupServiceResourcesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_resource_group_service_resources', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dimName = config.dimName; + this._dimValue = config.dimValue; + this._groupId = config.groupId; + this._id = config.id; + this._region = config.region; + this._service = config.service; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // dim_name - computed: false, optional: true, required: false + private _dimName?: string; + public get dimName() { + return this.getStringAttribute('dim_name'); + } + public set dimName(value: string) { + this._dimName = value; + } + public resetDimName() { + this._dimName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimNameInput() { + return this._dimName; + } + + // dim_value - computed: false, optional: true, required: false + private _dimValue?: string; + public get dimValue() { + return this.getStringAttribute('dim_value'); + } + public set dimValue(value: string) { + this._dimValue = value; + } + public resetDimValue() { + this._dimValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimValueInput() { + return this._dimValue; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudCesResourceGroupServiceResourcesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dim_name: cdktf.stringToTerraform(this._dimName), + dim_value: cdktf.stringToTerraform(this._dimValue), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service: cdktf.stringToTerraform(this._service), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dim_name: { + value: cdktf.stringToHclTerraform(this._dimName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dim_value: { + value: cdktf.stringToHclTerraform(this._dimValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service: { + value: cdktf.stringToHclTerraform(this._service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/README.md new file mode 100644 index 00000000..10b29248 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ces_resource_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ces_resource_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/index.ts new file mode 100644 index 00000000..d4ef122d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ces-resource-groups/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCesResourceGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the enterprise project to which the resource group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#enterprise_project_id DataHuaweicloudCesResourceGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the resource group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#group_id DataHuaweicloudCesResourceGroups#group_id} + */ + readonly groupId?: string; + /** + * Specifies the name of a resource group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#group_name DataHuaweicloudCesResourceGroups#group_name} + */ + readonly groupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#id DataHuaweicloudCesResourceGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#region DataHuaweicloudCesResourceGroups#region} + */ + readonly region?: string; + /** + * Specifies the method of adding resources to a resource group when you create a resource group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#type DataHuaweicloudCesResourceGroups#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCesResourceGroupsResourceGroups { +} + +export function dataHuaweicloudCesResourceGroupsResourceGroupsToTerraform(struct?: DataHuaweicloudCesResourceGroupsResourceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCesResourceGroupsResourceGroupsToHclTerraform(struct?: DataHuaweicloudCesResourceGroupsResourceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCesResourceGroupsResourceGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCesResourceGroupsResourceGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCesResourceGroupsResourceGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCesResourceGroupsResourceGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCesResourceGroupsResourceGroupsOutputReference { + return new DataHuaweicloudCesResourceGroupsResourceGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups huaweicloud_ces_resource_groups} +*/ +export class DataHuaweicloudCesResourceGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ces_resource_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCesResourceGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCesResourceGroups to import + * @param importFromId The id of the existing DataHuaweicloudCesResourceGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCesResourceGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ces_resource_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ces_resource_groups huaweicloud_ces_resource_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCesResourceGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCesResourceGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ces_resource_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._groupName = config.groupName; + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // group_name - computed: false, optional: true, required: false + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + public resetGroupName() { + this._groupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_groups - computed: true, optional: false, required: false + private _resourceGroups = new DataHuaweicloudCesResourceGroupsResourceGroupsList(this, "resource_groups", false); + public get resourceGroups() { + return this._resourceGroups; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + group_name: cdktf.stringToTerraform(this._groupName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_name: { + value: cdktf.stringToHclTerraform(this._groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/README.md new file mode 100644 index 00000000..ac599ed7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_access_control_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_access_control_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/index.ts new file mode 100644 index 00000000..c2db6214 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-access-control-logs/index.ts @@ -0,0 +1,843 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwAccessControlLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action. The values can be **allow** and **deny**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#action DataHuaweicloudCfwAccessControlLogs#action} + */ + readonly action?: string; + /** + * Specifies the application protocol. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#app DataHuaweicloudCfwAccessControlLogs#app} + */ + readonly app?: string; + /** + * Specifies the destination city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#dst_city_name DataHuaweicloudCfwAccessControlLogs#dst_city_name} + */ + readonly dstCityName?: string; + /** + * Specifies the destination IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#dst_ip DataHuaweicloudCfwAccessControlLogs#dst_ip} + */ + readonly dstIp?: string; + /** + * Specifies the destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#dst_port DataHuaweicloudCfwAccessControlLogs#dst_port} + */ + readonly dstPort?: number; + /** + * Specifies the destination province name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#dst_province_name DataHuaweicloudCfwAccessControlLogs#dst_province_name} + */ + readonly dstProvinceName?: string; + /** + * Specifies the destination region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#dst_region_name DataHuaweicloudCfwAccessControlLogs#dst_region_name} + */ + readonly dstRegionName?: string; + /** + * Specifies the end time. The time is in UTC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#end_time DataHuaweicloudCfwAccessControlLogs#end_time} + */ + readonly endTime: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#enterprise_project_id DataHuaweicloudCfwAccessControlLogs#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#fw_instance_id DataHuaweicloudCfwAccessControlLogs#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#id DataHuaweicloudCfwAccessControlLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#region DataHuaweicloudCfwAccessControlLogs#region} + */ + readonly region?: string; + /** + * Specifies the rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#rule_name DataHuaweicloudCfwAccessControlLogs#rule_name} + */ + readonly ruleName?: string; + /** + * Specifies the source city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#src_city_name DataHuaweicloudCfwAccessControlLogs#src_city_name} + */ + readonly srcCityName?: string; + /** + * Specifies the source IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#src_ip DataHuaweicloudCfwAccessControlLogs#src_ip} + */ + readonly srcIp?: string; + /** + * Specifies the source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#src_port DataHuaweicloudCfwAccessControlLogs#src_port} + */ + readonly srcPort?: number; + /** + * Specifies the source province name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#src_province_name DataHuaweicloudCfwAccessControlLogs#src_province_name} + */ + readonly srcProvinceName?: string; + /** + * Specifies the source region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#src_region_name DataHuaweicloudCfwAccessControlLogs#src_region_name} + */ + readonly srcRegionName?: string; + /** + * Specifies the start time. The time is in UTC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#start_time DataHuaweicloudCfwAccessControlLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudCfwAccessControlLogsRecords { +} + +export function dataHuaweicloudCfwAccessControlLogsRecordsToTerraform(struct?: DataHuaweicloudCfwAccessControlLogsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwAccessControlLogsRecordsToHclTerraform(struct?: DataHuaweicloudCfwAccessControlLogsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwAccessControlLogsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwAccessControlLogsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwAccessControlLogsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // app - computed: true, optional: false, required: false + public get app() { + return this.getStringAttribute('app'); + } + + // dst_city_id - computed: true, optional: false, required: false + public get dstCityId() { + return this.getStringAttribute('dst_city_id'); + } + + // dst_city_name - computed: true, optional: false, required: false + public get dstCityName() { + return this.getStringAttribute('dst_city_name'); + } + + // dst_host - computed: true, optional: false, required: false + public get dstHost() { + return this.getStringAttribute('dst_host'); + } + + // dst_ip - computed: true, optional: false, required: false + public get dstIp() { + return this.getStringAttribute('dst_ip'); + } + + // dst_port - computed: true, optional: false, required: false + public get dstPort() { + return this.getNumberAttribute('dst_port'); + } + + // dst_province_id - computed: true, optional: false, required: false + public get dstProvinceId() { + return this.getStringAttribute('dst_province_id'); + } + + // dst_province_name - computed: true, optional: false, required: false + public get dstProvinceName() { + return this.getStringAttribute('dst_province_name'); + } + + // dst_region_id - computed: true, optional: false, required: false + public get dstRegionId() { + return this.getStringAttribute('dst_region_id'); + } + + // dst_region_name - computed: true, optional: false, required: false + public get dstRegionName() { + return this.getStringAttribute('dst_region_name'); + } + + // hit_time - computed: true, optional: false, required: false + public get hitTime() { + return this.getStringAttribute('hit_time'); + } + + // log_id - computed: true, optional: false, required: false + public get logId() { + return this.getStringAttribute('log_id'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // rule_name - computed: true, optional: false, required: false + public get ruleName() { + return this.getStringAttribute('rule_name'); + } + + // src_city_id - computed: true, optional: false, required: false + public get srcCityId() { + return this.getStringAttribute('src_city_id'); + } + + // src_city_name - computed: true, optional: false, required: false + public get srcCityName() { + return this.getStringAttribute('src_city_name'); + } + + // src_ip - computed: true, optional: false, required: false + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + + // src_port - computed: true, optional: false, required: false + public get srcPort() { + return this.getNumberAttribute('src_port'); + } + + // src_province_id - computed: true, optional: false, required: false + public get srcProvinceId() { + return this.getStringAttribute('src_province_id'); + } + + // src_province_name - computed: true, optional: false, required: false + public get srcProvinceName() { + return this.getStringAttribute('src_province_name'); + } + + // src_region_id - computed: true, optional: false, required: false + public get srcRegionId() { + return this.getStringAttribute('src_region_id'); + } + + // src_region_name - computed: true, optional: false, required: false + public get srcRegionName() { + return this.getStringAttribute('src_region_name'); + } +} + +export class DataHuaweicloudCfwAccessControlLogsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwAccessControlLogsRecordsOutputReference { + return new DataHuaweicloudCfwAccessControlLogsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs huaweicloud_cfw_access_control_logs} +*/ +export class DataHuaweicloudCfwAccessControlLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_access_control_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwAccessControlLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwAccessControlLogs to import + * @param importFromId The id of the existing DataHuaweicloudCfwAccessControlLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwAccessControlLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_access_control_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_access_control_logs huaweicloud_cfw_access_control_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwAccessControlLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwAccessControlLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_access_control_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._app = config.app; + this._dstCityName = config.dstCityName; + this._dstIp = config.dstIp; + this._dstPort = config.dstPort; + this._dstProvinceName = config.dstProvinceName; + this._dstRegionName = config.dstRegionName; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._region = config.region; + this._ruleName = config.ruleName; + this._srcCityName = config.srcCityName; + this._srcIp = config.srcIp; + this._srcPort = config.srcPort; + this._srcProvinceName = config.srcProvinceName; + this._srcRegionName = config.srcRegionName; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // app - computed: false, optional: true, required: false + private _app?: string; + public get app() { + return this.getStringAttribute('app'); + } + public set app(value: string) { + this._app = value; + } + public resetApp() { + this._app = undefined; + } + // Temporarily expose input value. Use with caution. + public get appInput() { + return this._app; + } + + // dst_city_name - computed: false, optional: true, required: false + private _dstCityName?: string; + public get dstCityName() { + return this.getStringAttribute('dst_city_name'); + } + public set dstCityName(value: string) { + this._dstCityName = value; + } + public resetDstCityName() { + this._dstCityName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstCityNameInput() { + return this._dstCityName; + } + + // dst_ip - computed: false, optional: true, required: false + private _dstIp?: string; + public get dstIp() { + return this.getStringAttribute('dst_ip'); + } + public set dstIp(value: string) { + this._dstIp = value; + } + public resetDstIp() { + this._dstIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstIpInput() { + return this._dstIp; + } + + // dst_port - computed: false, optional: true, required: false + private _dstPort?: number; + public get dstPort() { + return this.getNumberAttribute('dst_port'); + } + public set dstPort(value: number) { + this._dstPort = value; + } + public resetDstPort() { + this._dstPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstPortInput() { + return this._dstPort; + } + + // dst_province_name - computed: false, optional: true, required: false + private _dstProvinceName?: string; + public get dstProvinceName() { + return this.getStringAttribute('dst_province_name'); + } + public set dstProvinceName(value: string) { + this._dstProvinceName = value; + } + public resetDstProvinceName() { + this._dstProvinceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstProvinceNameInput() { + return this._dstProvinceName; + } + + // dst_region_name - computed: false, optional: true, required: false + private _dstRegionName?: string; + public get dstRegionName() { + return this.getStringAttribute('dst_region_name'); + } + public set dstRegionName(value: string) { + this._dstRegionName = value; + } + public resetDstRegionName() { + this._dstRegionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstRegionNameInput() { + return this._dstRegionName; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwAccessControlLogsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_name - computed: false, optional: true, required: false + private _ruleName?: string; + public get ruleName() { + return this.getStringAttribute('rule_name'); + } + public set ruleName(value: string) { + this._ruleName = value; + } + public resetRuleName() { + this._ruleName = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleNameInput() { + return this._ruleName; + } + + // src_city_name - computed: false, optional: true, required: false + private _srcCityName?: string; + public get srcCityName() { + return this.getStringAttribute('src_city_name'); + } + public set srcCityName(value: string) { + this._srcCityName = value; + } + public resetSrcCityName() { + this._srcCityName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcCityNameInput() { + return this._srcCityName; + } + + // src_ip - computed: false, optional: true, required: false + private _srcIp?: string; + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + public set srcIp(value: string) { + this._srcIp = value; + } + public resetSrcIp() { + this._srcIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcIpInput() { + return this._srcIp; + } + + // src_port - computed: false, optional: true, required: false + private _srcPort?: number; + public get srcPort() { + return this.getNumberAttribute('src_port'); + } + public set srcPort(value: number) { + this._srcPort = value; + } + public resetSrcPort() { + this._srcPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcPortInput() { + return this._srcPort; + } + + // src_province_name - computed: false, optional: true, required: false + private _srcProvinceName?: string; + public get srcProvinceName() { + return this.getStringAttribute('src_province_name'); + } + public set srcProvinceName(value: string) { + this._srcProvinceName = value; + } + public resetSrcProvinceName() { + this._srcProvinceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcProvinceNameInput() { + return this._srcProvinceName; + } + + // src_region_name - computed: false, optional: true, required: false + private _srcRegionName?: string; + public get srcRegionName() { + return this.getStringAttribute('src_region_name'); + } + public set srcRegionName(value: string) { + this._srcRegionName = value; + } + public resetSrcRegionName() { + this._srcRegionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcRegionNameInput() { + return this._srcRegionName; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + app: cdktf.stringToTerraform(this._app), + dst_city_name: cdktf.stringToTerraform(this._dstCityName), + dst_ip: cdktf.stringToTerraform(this._dstIp), + dst_port: cdktf.numberToTerraform(this._dstPort), + dst_province_name: cdktf.stringToTerraform(this._dstProvinceName), + dst_region_name: cdktf.stringToTerraform(this._dstRegionName), + end_time: cdktf.stringToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + rule_name: cdktf.stringToTerraform(this._ruleName), + src_city_name: cdktf.stringToTerraform(this._srcCityName), + src_ip: cdktf.stringToTerraform(this._srcIp), + src_port: cdktf.numberToTerraform(this._srcPort), + src_province_name: cdktf.stringToTerraform(this._srcProvinceName), + src_region_name: cdktf.stringToTerraform(this._srcRegionName), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app: { + value: cdktf.stringToHclTerraform(this._app), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_city_name: { + value: cdktf.stringToHclTerraform(this._dstCityName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_ip: { + value: cdktf.stringToHclTerraform(this._dstIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_port: { + value: cdktf.numberToHclTerraform(this._dstPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dst_province_name: { + value: cdktf.stringToHclTerraform(this._dstProvinceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_region_name: { + value: cdktf.stringToHclTerraform(this._dstRegionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_name: { + value: cdktf.stringToHclTerraform(this._ruleName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_city_name: { + value: cdktf.stringToHclTerraform(this._srcCityName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_ip: { + value: cdktf.stringToHclTerraform(this._srcIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_port: { + value: cdktf.numberToHclTerraform(this._srcPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + src_province_name: { + value: cdktf.stringToHclTerraform(this._srcProvinceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_region_name: { + value: cdktf.stringToHclTerraform(this._srcRegionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/README.md new file mode 100644 index 00000000..4c0f19f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_address_group_members` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_address_group_members`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/index.ts new file mode 100644 index 00000000..20926dfd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-group-members/index.ts @@ -0,0 +1,419 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwAddressGroupMembersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the IP address + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#address DataHuaweicloudCfwAddressGroupMembers#address} + */ + readonly address?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#fw_instance_id DataHuaweicloudCfwAddressGroupMembers#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Specifies the ID of the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#group_id DataHuaweicloudCfwAddressGroupMembers#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#id DataHuaweicloudCfwAddressGroupMembers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the address group member ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#item_id DataHuaweicloudCfwAddressGroupMembers#item_id} + */ + readonly itemId?: string; + /** + * Specifies the keyword. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#key_word DataHuaweicloudCfwAddressGroupMembers#key_word} + */ + readonly keyWord?: string; + /** + * Specifies the query address group type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#query_address_set_type DataHuaweicloudCfwAddressGroupMembers#query_address_set_type} + */ + readonly queryAddressSetType?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#region DataHuaweicloudCfwAddressGroupMembers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCfwAddressGroupMembersRecords { +} + +export function dataHuaweicloudCfwAddressGroupMembersRecordsToTerraform(struct?: DataHuaweicloudCfwAddressGroupMembersRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwAddressGroupMembersRecordsToHclTerraform(struct?: DataHuaweicloudCfwAddressGroupMembersRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwAddressGroupMembersRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwAddressGroupMembersRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwAddressGroupMembersRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // address_type - computed: true, optional: false, required: false + public get addressType() { + return this.getNumberAttribute('address_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // item_id - computed: true, optional: false, required: false + public get itemId() { + return this.getStringAttribute('item_id'); + } +} + +export class DataHuaweicloudCfwAddressGroupMembersRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwAddressGroupMembersRecordsOutputReference { + return new DataHuaweicloudCfwAddressGroupMembersRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members huaweicloud_cfw_address_group_members} +*/ +export class DataHuaweicloudCfwAddressGroupMembers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_address_group_members"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwAddressGroupMembers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwAddressGroupMembers to import + * @param importFromId The id of the existing DataHuaweicloudCfwAddressGroupMembers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwAddressGroupMembers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_address_group_members", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_group_members huaweicloud_cfw_address_group_members} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwAddressGroupMembersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwAddressGroupMembersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_address_group_members', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._fwInstanceId = config.fwInstanceId; + this._groupId = config.groupId; + this._id = config.id; + this._itemId = config.itemId; + this._keyWord = config.keyWord; + this._queryAddressSetType = config.queryAddressSetType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // item_id - computed: false, optional: true, required: false + private _itemId?: string; + public get itemId() { + return this.getStringAttribute('item_id'); + } + public set itemId(value: string) { + this._itemId = value; + } + public resetItemId() { + this._itemId = undefined; + } + // Temporarily expose input value. Use with caution. + public get itemIdInput() { + return this._itemId; + } + + // key_word - computed: false, optional: true, required: false + private _keyWord?: string; + public get keyWord() { + return this.getStringAttribute('key_word'); + } + public set keyWord(value: string) { + this._keyWord = value; + } + public resetKeyWord() { + this._keyWord = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyWordInput() { + return this._keyWord; + } + + // query_address_set_type - computed: false, optional: true, required: false + private _queryAddressSetType?: string; + public get queryAddressSetType() { + return this.getStringAttribute('query_address_set_type'); + } + public set queryAddressSetType(value: string) { + this._queryAddressSetType = value; + } + public resetQueryAddressSetType() { + this._queryAddressSetType = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryAddressSetTypeInput() { + return this._queryAddressSetType; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwAddressGroupMembersRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + item_id: cdktf.stringToTerraform(this._itemId), + key_word: cdktf.stringToTerraform(this._keyWord), + query_address_set_type: cdktf.stringToTerraform(this._queryAddressSetType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + item_id: { + value: cdktf.stringToHclTerraform(this._itemId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_word: { + value: cdktf.stringToHclTerraform(this._keyWord), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_address_set_type: { + value: cdktf.stringToHclTerraform(this._queryAddressSetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/README.md new file mode 100644 index 00000000..8d41c1e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_address_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_address_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/index.ts new file mode 100644 index 00000000..7dd4913d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-address-groups/index.ts @@ -0,0 +1,494 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwAddressGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies IP address of the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#address DataHuaweicloudCfwAddressGroups#address} + */ + readonly address?: string; + /** + * Specifies the IP address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#address_type DataHuaweicloudCfwAddressGroups#address_type} + */ + readonly addressType?: string; + /** + * Specifies the enterprise project id to which the IP address group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#enterprise_project_id DataHuaweicloudCfwAddressGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#fw_instance_id DataHuaweicloudCfwAddressGroups#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#id DataHuaweicloudCfwAddressGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the keyword of the address group description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#key_word DataHuaweicloudCfwAddressGroups#key_word} + */ + readonly keyWord?: string; + /** + * Specifies the name of the address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#name DataHuaweicloudCfwAddressGroups#name} + */ + readonly name?: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#object_id DataHuaweicloudCfwAddressGroups#object_id} + */ + readonly objectId: string; + /** + * Specifies the address group type of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#query_address_set_type DataHuaweicloudCfwAddressGroups#query_address_set_type} + */ + readonly queryAddressSetType?: number; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#region DataHuaweicloudCfwAddressGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCfwAddressGroupsAddressGroups { +} + +export function dataHuaweicloudCfwAddressGroupsAddressGroupsToTerraform(struct?: DataHuaweicloudCfwAddressGroupsAddressGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwAddressGroupsAddressGroupsToHclTerraform(struct?: DataHuaweicloudCfwAddressGroupsAddressGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwAddressGroupsAddressGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwAddressGroupsAddressGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwAddressGroupsAddressGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address_type - computed: true, optional: false, required: false + public get addressType() { + return this.getNumberAttribute('address_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // object_id - computed: true, optional: false, required: false + public get objectId() { + return this.getStringAttribute('object_id'); + } + + // ref_count - computed: true, optional: false, required: false + public get refCount() { + return this.getNumberAttribute('ref_count'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCfwAddressGroupsAddressGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwAddressGroupsAddressGroupsOutputReference { + return new DataHuaweicloudCfwAddressGroupsAddressGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups huaweicloud_cfw_address_groups} +*/ +export class DataHuaweicloudCfwAddressGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_address_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwAddressGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwAddressGroups to import + * @param importFromId The id of the existing DataHuaweicloudCfwAddressGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwAddressGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_address_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_address_groups huaweicloud_cfw_address_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwAddressGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwAddressGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_address_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._addressType = config.addressType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._keyWord = config.keyWord; + this._name = config.name; + this._objectId = config.objectId; + this._queryAddressSetType = config.queryAddressSetType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_groups - computed: true, optional: false, required: false + private _addressGroups = new DataHuaweicloudCfwAddressGroupsAddressGroupsList(this, "address_groups", false); + public get addressGroups() { + return this._addressGroups; + } + + // address_type - computed: false, optional: true, required: false + private _addressType?: string; + public get addressType() { + return this.getStringAttribute('address_type'); + } + public set addressType(value: string) { + this._addressType = value; + } + public resetAddressType() { + this._addressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_word - computed: false, optional: true, required: false + private _keyWord?: string; + public get keyWord() { + return this.getStringAttribute('key_word'); + } + public set keyWord(value: string) { + this._keyWord = value; + } + public resetKeyWord() { + this._keyWord = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyWordInput() { + return this._keyWord; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // query_address_set_type - computed: false, optional: true, required: false + private _queryAddressSetType?: number; + public get queryAddressSetType() { + return this.getNumberAttribute('query_address_set_type'); + } + public set queryAddressSetType(value: number) { + this._queryAddressSetType = value; + } + public resetQueryAddressSetType() { + this._queryAddressSetType = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryAddressSetTypeInput() { + return this._queryAddressSetType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + address_type: cdktf.stringToTerraform(this._addressType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + key_word: cdktf.stringToTerraform(this._keyWord), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + query_address_set_type: cdktf.numberToTerraform(this._queryAddressSetType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.stringToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_word: { + value: cdktf.stringToHclTerraform(this._keyWord), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_address_set_type: { + value: cdktf.numberToHclTerraform(this._queryAddressSetType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/README.md new file mode 100644 index 00000000..b4833dca --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_attack_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_attack_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/index.ts new file mode 100644 index 00000000..8763a537 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-attack-logs/index.ts @@ -0,0 +1,1049 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwAttackLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the application protocol. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#app DataHuaweicloudCfwAttackLogs#app} + */ + readonly app?: string; + /** + * Specifies the intrusion event rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#attack_rule DataHuaweicloudCfwAttackLogs#attack_rule} + */ + readonly attackRule?: string; + /** + * Specifies the attack rule ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#attack_rule_id DataHuaweicloudCfwAttackLogs#attack_rule_id} + */ + readonly attackRuleId?: string; + /** + * Specifies the intrusion event type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#attack_type DataHuaweicloudCfwAttackLogs#attack_type} + */ + readonly attackType?: string; + /** + * Specifies the destination city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#dst_city_name DataHuaweicloudCfwAttackLogs#dst_city_name} + */ + readonly dstCityName?: string; + /** + * Specifies the destination IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#dst_ip DataHuaweicloudCfwAttackLogs#dst_ip} + */ + readonly dstIp?: string; + /** + * Specifies the destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#dst_port DataHuaweicloudCfwAttackLogs#dst_port} + */ + readonly dstPort?: number; + /** + * Specifies the destination province name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#dst_province_name DataHuaweicloudCfwAttackLogs#dst_province_name} + */ + readonly dstProvinceName?: string; + /** + * Specifies the destination region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#dst_region_name DataHuaweicloudCfwAttackLogs#dst_region_name} + */ + readonly dstRegionName?: string; + /** + * Specifies the end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#end_time DataHuaweicloudCfwAttackLogs#end_time} + */ + readonly endTime: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#enterprise_project_id DataHuaweicloudCfwAttackLogs#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#fw_instance_id DataHuaweicloudCfwAttackLogs#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#id DataHuaweicloudCfwAttackLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the threat level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#level DataHuaweicloudCfwAttackLogs#level} + */ + readonly level?: string; + /** + * Specifies the log type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#log_type DataHuaweicloudCfwAttackLogs#log_type} + */ + readonly logType?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#region DataHuaweicloudCfwAttackLogs#region} + */ + readonly region?: string; + /** + * Specifies the source city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#src_city_name DataHuaweicloudCfwAttackLogs#src_city_name} + */ + readonly srcCityName?: string; + /** + * Specifies the source IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#src_ip DataHuaweicloudCfwAttackLogs#src_ip} + */ + readonly srcIp?: string; + /** + * Specifies the source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#src_port DataHuaweicloudCfwAttackLogs#src_port} + */ + readonly srcPort?: number; + /** + * Specifies the source province name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#src_province_name DataHuaweicloudCfwAttackLogs#src_province_name} + */ + readonly srcProvinceName?: string; + /** + * Specifies the source region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#src_region_name DataHuaweicloudCfwAttackLogs#src_region_name} + */ + readonly srcRegionName?: string; + /** + * Specifies the start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#start_time DataHuaweicloudCfwAttackLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudCfwAttackLogsRecordsPacketMessages { +} + +export function dataHuaweicloudCfwAttackLogsRecordsPacketMessagesToTerraform(struct?: DataHuaweicloudCfwAttackLogsRecordsPacketMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwAttackLogsRecordsPacketMessagesToHclTerraform(struct?: DataHuaweicloudCfwAttackLogsRecordsPacketMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwAttackLogsRecordsPacketMessagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwAttackLogsRecordsPacketMessages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwAttackLogsRecordsPacketMessages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // hex_index - computed: true, optional: false, required: false + public get hexIndex() { + return this.getStringAttribute('hex_index'); + } + + // hexs - computed: true, optional: false, required: false + public get hexs() { + return this.getListAttribute('hexs'); + } + + // utf8_string - computed: true, optional: false, required: false + public get utf8String() { + return this.getStringAttribute('utf8_string'); + } +} + +export class DataHuaweicloudCfwAttackLogsRecordsPacketMessagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwAttackLogsRecordsPacketMessagesOutputReference { + return new DataHuaweicloudCfwAttackLogsRecordsPacketMessagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwAttackLogsRecords { +} + +export function dataHuaweicloudCfwAttackLogsRecordsToTerraform(struct?: DataHuaweicloudCfwAttackLogsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwAttackLogsRecordsToHclTerraform(struct?: DataHuaweicloudCfwAttackLogsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwAttackLogsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwAttackLogsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwAttackLogsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // app - computed: true, optional: false, required: false + public get app() { + return this.getStringAttribute('app'); + } + + // attack_rule - computed: true, optional: false, required: false + public get attackRule() { + return this.getStringAttribute('attack_rule'); + } + + // attack_rule_id - computed: true, optional: false, required: false + public get attackRuleId() { + return this.getStringAttribute('attack_rule_id'); + } + + // attack_type - computed: true, optional: false, required: false + public get attackType() { + return this.getStringAttribute('attack_type'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // dst_city_id - computed: true, optional: false, required: false + public get dstCityId() { + return this.getStringAttribute('dst_city_id'); + } + + // dst_city_name - computed: true, optional: false, required: false + public get dstCityName() { + return this.getStringAttribute('dst_city_name'); + } + + // dst_ip - computed: true, optional: false, required: false + public get dstIp() { + return this.getStringAttribute('dst_ip'); + } + + // dst_port - computed: true, optional: false, required: false + public get dstPort() { + return this.getNumberAttribute('dst_port'); + } + + // dst_province_id - computed: true, optional: false, required: false + public get dstProvinceId() { + return this.getStringAttribute('dst_province_id'); + } + + // dst_province_name - computed: true, optional: false, required: false + public get dstProvinceName() { + return this.getStringAttribute('dst_province_name'); + } + + // dst_region_id - computed: true, optional: false, required: false + public get dstRegionId() { + return this.getStringAttribute('dst_region_id'); + } + + // dst_region_name - computed: true, optional: false, required: false + public get dstRegionName() { + return this.getStringAttribute('dst_region_name'); + } + + // event_time - computed: true, optional: false, required: false + public get eventTime() { + return this.getStringAttribute('event_time'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // log_id - computed: true, optional: false, required: false + public get logId() { + return this.getStringAttribute('log_id'); + } + + // packet - computed: true, optional: false, required: false + public get packet() { + return this.getStringAttribute('packet'); + } + + // packet_length - computed: true, optional: false, required: false + public get packetLength() { + return this.getNumberAttribute('packet_length'); + } + + // packet_messages - computed: true, optional: false, required: false + private _packetMessages = new DataHuaweicloudCfwAttackLogsRecordsPacketMessagesList(this, "packet_messages", false); + public get packetMessages() { + return this._packetMessages; + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // src_city_id - computed: true, optional: false, required: false + public get srcCityId() { + return this.getStringAttribute('src_city_id'); + } + + // src_city_name - computed: true, optional: false, required: false + public get srcCityName() { + return this.getStringAttribute('src_city_name'); + } + + // src_ip - computed: true, optional: false, required: false + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + + // src_port - computed: true, optional: false, required: false + public get srcPort() { + return this.getNumberAttribute('src_port'); + } + + // src_province_id - computed: true, optional: false, required: false + public get srcProvinceId() { + return this.getStringAttribute('src_province_id'); + } + + // src_province_name - computed: true, optional: false, required: false + public get srcProvinceName() { + return this.getStringAttribute('src_province_name'); + } + + // src_region_id - computed: true, optional: false, required: false + public get srcRegionId() { + return this.getStringAttribute('src_region_id'); + } + + // src_region_name - computed: true, optional: false, required: false + public get srcRegionName() { + return this.getStringAttribute('src_region_name'); + } +} + +export class DataHuaweicloudCfwAttackLogsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwAttackLogsRecordsOutputReference { + return new DataHuaweicloudCfwAttackLogsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs huaweicloud_cfw_attack_logs} +*/ +export class DataHuaweicloudCfwAttackLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_attack_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwAttackLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwAttackLogs to import + * @param importFromId The id of the existing DataHuaweicloudCfwAttackLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwAttackLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_attack_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_attack_logs huaweicloud_cfw_attack_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwAttackLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwAttackLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_attack_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._app = config.app; + this._attackRule = config.attackRule; + this._attackRuleId = config.attackRuleId; + this._attackType = config.attackType; + this._dstCityName = config.dstCityName; + this._dstIp = config.dstIp; + this._dstPort = config.dstPort; + this._dstProvinceName = config.dstProvinceName; + this._dstRegionName = config.dstRegionName; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._level = config.level; + this._logType = config.logType; + this._region = config.region; + this._srcCityName = config.srcCityName; + this._srcIp = config.srcIp; + this._srcPort = config.srcPort; + this._srcProvinceName = config.srcProvinceName; + this._srcRegionName = config.srcRegionName; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // app - computed: false, optional: true, required: false + private _app?: string; + public get app() { + return this.getStringAttribute('app'); + } + public set app(value: string) { + this._app = value; + } + public resetApp() { + this._app = undefined; + } + // Temporarily expose input value. Use with caution. + public get appInput() { + return this._app; + } + + // attack_rule - computed: false, optional: true, required: false + private _attackRule?: string; + public get attackRule() { + return this.getStringAttribute('attack_rule'); + } + public set attackRule(value: string) { + this._attackRule = value; + } + public resetAttackRule() { + this._attackRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get attackRuleInput() { + return this._attackRule; + } + + // attack_rule_id - computed: false, optional: true, required: false + private _attackRuleId?: string; + public get attackRuleId() { + return this.getStringAttribute('attack_rule_id'); + } + public set attackRuleId(value: string) { + this._attackRuleId = value; + } + public resetAttackRuleId() { + this._attackRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attackRuleIdInput() { + return this._attackRuleId; + } + + // attack_type - computed: false, optional: true, required: false + private _attackType?: string; + public get attackType() { + return this.getStringAttribute('attack_type'); + } + public set attackType(value: string) { + this._attackType = value; + } + public resetAttackType() { + this._attackType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attackTypeInput() { + return this._attackType; + } + + // dst_city_name - computed: false, optional: true, required: false + private _dstCityName?: string; + public get dstCityName() { + return this.getStringAttribute('dst_city_name'); + } + public set dstCityName(value: string) { + this._dstCityName = value; + } + public resetDstCityName() { + this._dstCityName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstCityNameInput() { + return this._dstCityName; + } + + // dst_ip - computed: false, optional: true, required: false + private _dstIp?: string; + public get dstIp() { + return this.getStringAttribute('dst_ip'); + } + public set dstIp(value: string) { + this._dstIp = value; + } + public resetDstIp() { + this._dstIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstIpInput() { + return this._dstIp; + } + + // dst_port - computed: false, optional: true, required: false + private _dstPort?: number; + public get dstPort() { + return this.getNumberAttribute('dst_port'); + } + public set dstPort(value: number) { + this._dstPort = value; + } + public resetDstPort() { + this._dstPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstPortInput() { + return this._dstPort; + } + + // dst_province_name - computed: false, optional: true, required: false + private _dstProvinceName?: string; + public get dstProvinceName() { + return this.getStringAttribute('dst_province_name'); + } + public set dstProvinceName(value: string) { + this._dstProvinceName = value; + } + public resetDstProvinceName() { + this._dstProvinceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstProvinceNameInput() { + return this._dstProvinceName; + } + + // dst_region_name - computed: false, optional: true, required: false + private _dstRegionName?: string; + public get dstRegionName() { + return this.getStringAttribute('dst_region_name'); + } + public set dstRegionName(value: string) { + this._dstRegionName = value; + } + public resetDstRegionName() { + this._dstRegionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstRegionNameInput() { + return this._dstRegionName; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // log_type - computed: false, optional: true, required: false + private _logType?: string; + public get logType() { + return this.getStringAttribute('log_type'); + } + public set logType(value: string) { + this._logType = value; + } + public resetLogType() { + this._logType = undefined; + } + // Temporarily expose input value. Use with caution. + public get logTypeInput() { + return this._logType; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwAttackLogsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // src_city_name - computed: false, optional: true, required: false + private _srcCityName?: string; + public get srcCityName() { + return this.getStringAttribute('src_city_name'); + } + public set srcCityName(value: string) { + this._srcCityName = value; + } + public resetSrcCityName() { + this._srcCityName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcCityNameInput() { + return this._srcCityName; + } + + // src_ip - computed: false, optional: true, required: false + private _srcIp?: string; + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + public set srcIp(value: string) { + this._srcIp = value; + } + public resetSrcIp() { + this._srcIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcIpInput() { + return this._srcIp; + } + + // src_port - computed: false, optional: true, required: false + private _srcPort?: number; + public get srcPort() { + return this.getNumberAttribute('src_port'); + } + public set srcPort(value: number) { + this._srcPort = value; + } + public resetSrcPort() { + this._srcPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcPortInput() { + return this._srcPort; + } + + // src_province_name - computed: false, optional: true, required: false + private _srcProvinceName?: string; + public get srcProvinceName() { + return this.getStringAttribute('src_province_name'); + } + public set srcProvinceName(value: string) { + this._srcProvinceName = value; + } + public resetSrcProvinceName() { + this._srcProvinceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcProvinceNameInput() { + return this._srcProvinceName; + } + + // src_region_name - computed: false, optional: true, required: false + private _srcRegionName?: string; + public get srcRegionName() { + return this.getStringAttribute('src_region_name'); + } + public set srcRegionName(value: string) { + this._srcRegionName = value; + } + public resetSrcRegionName() { + this._srcRegionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcRegionNameInput() { + return this._srcRegionName; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app: cdktf.stringToTerraform(this._app), + attack_rule: cdktf.stringToTerraform(this._attackRule), + attack_rule_id: cdktf.stringToTerraform(this._attackRuleId), + attack_type: cdktf.stringToTerraform(this._attackType), + dst_city_name: cdktf.stringToTerraform(this._dstCityName), + dst_ip: cdktf.stringToTerraform(this._dstIp), + dst_port: cdktf.numberToTerraform(this._dstPort), + dst_province_name: cdktf.stringToTerraform(this._dstProvinceName), + dst_region_name: cdktf.stringToTerraform(this._dstRegionName), + end_time: cdktf.stringToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + level: cdktf.stringToTerraform(this._level), + log_type: cdktf.stringToTerraform(this._logType), + region: cdktf.stringToTerraform(this._region), + src_city_name: cdktf.stringToTerraform(this._srcCityName), + src_ip: cdktf.stringToTerraform(this._srcIp), + src_port: cdktf.numberToTerraform(this._srcPort), + src_province_name: cdktf.stringToTerraform(this._srcProvinceName), + src_region_name: cdktf.stringToTerraform(this._srcRegionName), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app: { + value: cdktf.stringToHclTerraform(this._app), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attack_rule: { + value: cdktf.stringToHclTerraform(this._attackRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attack_rule_id: { + value: cdktf.stringToHclTerraform(this._attackRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attack_type: { + value: cdktf.stringToHclTerraform(this._attackType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_city_name: { + value: cdktf.stringToHclTerraform(this._dstCityName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_ip: { + value: cdktf.stringToHclTerraform(this._dstIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_port: { + value: cdktf.numberToHclTerraform(this._dstPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dst_province_name: { + value: cdktf.stringToHclTerraform(this._dstProvinceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_region_name: { + value: cdktf.stringToHclTerraform(this._dstRegionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_type: { + value: cdktf.stringToHclTerraform(this._logType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_city_name: { + value: cdktf.stringToHclTerraform(this._srcCityName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_ip: { + value: cdktf.stringToHclTerraform(this._srcIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_port: { + value: cdktf.numberToHclTerraform(this._srcPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + src_province_name: { + value: cdktf.stringToHclTerraform(this._srcProvinceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_region_name: { + value: cdktf.stringToHclTerraform(this._srcRegionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/README.md new file mode 100644 index 00000000..50892aa0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_black_white_lists` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_black_white_lists`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/index.ts new file mode 100644 index 00000000..4d534752 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-black-white-lists/index.ts @@ -0,0 +1,551 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwBlackWhiteListsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#address DataHuaweicloudCfwBlackWhiteLists#address} + */ + readonly address?: string; + /** + * Specifies the IP address type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#address_type DataHuaweicloudCfwBlackWhiteLists#address_type} + */ + readonly addressType?: string; + /** + * Specifies the description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#description DataHuaweicloudCfwBlackWhiteLists#description} + */ + readonly description?: string; + /** + * Specifies the direction of a black or white address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#direction DataHuaweicloudCfwBlackWhiteLists#direction} + */ + readonly direction?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#fw_instance_id DataHuaweicloudCfwBlackWhiteLists#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#id DataHuaweicloudCfwBlackWhiteLists#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the blacklist/whitelist ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#list_id DataHuaweicloudCfwBlackWhiteLists#list_id} + */ + readonly listId?: string; + /** + * Specifies the blacklist/whitelist type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#list_type DataHuaweicloudCfwBlackWhiteLists#list_type} + */ + readonly listType: number; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#object_id DataHuaweicloudCfwBlackWhiteLists#object_id} + */ + readonly objectId: string; + /** + * Specifies the port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#port DataHuaweicloudCfwBlackWhiteLists#port} + */ + readonly port?: string; + /** + * Specifies The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#protocol DataHuaweicloudCfwBlackWhiteLists#protocol} + */ + readonly protocol?: number; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#region DataHuaweicloudCfwBlackWhiteLists#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCfwBlackWhiteListsRecords { +} + +export function dataHuaweicloudCfwBlackWhiteListsRecordsToTerraform(struct?: DataHuaweicloudCfwBlackWhiteListsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwBlackWhiteListsRecordsToHclTerraform(struct?: DataHuaweicloudCfwBlackWhiteListsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwBlackWhiteListsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwBlackWhiteListsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwBlackWhiteListsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // address_type - computed: true, optional: false, required: false + public get addressType() { + return this.getStringAttribute('address_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // list_id - computed: true, optional: false, required: false + public get listId() { + return this.getStringAttribute('list_id'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getNumberAttribute('protocol'); + } +} + +export class DataHuaweicloudCfwBlackWhiteListsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwBlackWhiteListsRecordsOutputReference { + return new DataHuaweicloudCfwBlackWhiteListsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists huaweicloud_cfw_black_white_lists} +*/ +export class DataHuaweicloudCfwBlackWhiteLists extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_black_white_lists"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwBlackWhiteLists resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwBlackWhiteLists to import + * @param importFromId The id of the existing DataHuaweicloudCfwBlackWhiteLists that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwBlackWhiteLists to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_black_white_lists", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_black_white_lists huaweicloud_cfw_black_white_lists} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwBlackWhiteListsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwBlackWhiteListsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_black_white_lists', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._addressType = config.addressType; + this._description = config.description; + this._direction = config.direction; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._listId = config.listId; + this._listType = config.listType; + this._objectId = config.objectId; + this._port = config.port; + this._protocol = config.protocol; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // address_type - computed: false, optional: true, required: false + private _addressType?: string; + public get addressType() { + return this.getStringAttribute('address_type'); + } + public set addressType(value: string) { + this._addressType = value; + } + public resetAddressType() { + this._addressType = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressTypeInput() { + return this._addressType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: false, optional: true, required: false + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // list_id - computed: false, optional: true, required: false + private _listId?: string; + public get listId() { + return this.getStringAttribute('list_id'); + } + public set listId(value: string) { + this._listId = value; + } + public resetListId() { + this._listId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listIdInput() { + return this._listId; + } + + // list_type - computed: false, optional: false, required: true + private _listType?: number; + public get listType() { + return this.getNumberAttribute('list_type'); + } + public set listType(value: number) { + this._listType = value; + } + // Temporarily expose input value. Use with caution. + public get listTypeInput() { + return this._listType; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // port - computed: false, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwBlackWhiteListsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + address_type: cdktf.stringToTerraform(this._addressType), + description: cdktf.stringToTerraform(this._description), + direction: cdktf.stringToTerraform(this._direction), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + list_id: cdktf.stringToTerraform(this._listId), + list_type: cdktf.numberToTerraform(this._listType), + object_id: cdktf.stringToTerraform(this._objectId), + port: cdktf.stringToTerraform(this._port), + protocol: cdktf.numberToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + address_type: { + value: cdktf.stringToHclTerraform(this._addressType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_id: { + value: cdktf.stringToHclTerraform(this._listId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_type: { + value: cdktf.numberToHclTerraform(this._listType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/README.md new file mode 100644 index 00000000..31b2e213 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_capture_task_results` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_capture_task_results`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/index.ts new file mode 100644 index 00000000..755f0123 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-task-results/index.ts @@ -0,0 +1,447 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwCaptureTaskResultsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the firewall instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#fw_instance_id DataHuaweicloudCfwCaptureTaskResults#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#id DataHuaweicloudCfwCaptureTaskResults#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the public IP address ranges. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#ip DataHuaweicloudCfwCaptureTaskResults#ip} + */ + readonly ip?: string[]; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#region DataHuaweicloudCfwCaptureTaskResults#region} + */ + readonly region?: string; + /** + * Specifies the capture task ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#task_id DataHuaweicloudCfwCaptureTaskResults#task_id} + */ + readonly taskId: string; + /** + * Specifies whether to set a public IP address for downloading. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#type DataHuaweicloudCfwCaptureTaskResults#type} + */ + readonly type?: number; +} +export interface DataHuaweicloudCfwCaptureTaskResultsFileListStruct { +} + +export function dataHuaweicloudCfwCaptureTaskResultsFileListStructToTerraform(struct?: DataHuaweicloudCfwCaptureTaskResultsFileListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwCaptureTaskResultsFileListStructToHclTerraform(struct?: DataHuaweicloudCfwCaptureTaskResultsFileListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwCaptureTaskResultsFileListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwCaptureTaskResultsFileListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwCaptureTaskResultsFileListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_path - computed: true, optional: false, required: false + public get filePath() { + return this.getStringAttribute('file_path'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class DataHuaweicloudCfwCaptureTaskResultsFileListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwCaptureTaskResultsFileListStructOutputReference { + return new DataHuaweicloudCfwCaptureTaskResultsFileListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwCaptureTaskResultsRequestHeader { +} + +export function dataHuaweicloudCfwCaptureTaskResultsRequestHeaderToTerraform(struct?: DataHuaweicloudCfwCaptureTaskResultsRequestHeader): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwCaptureTaskResultsRequestHeaderToHclTerraform(struct?: DataHuaweicloudCfwCaptureTaskResultsRequestHeader): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwCaptureTaskResultsRequestHeaderOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwCaptureTaskResultsRequestHeader | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwCaptureTaskResultsRequestHeader | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } +} + +export class DataHuaweicloudCfwCaptureTaskResultsRequestHeaderList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwCaptureTaskResultsRequestHeaderOutputReference { + return new DataHuaweicloudCfwCaptureTaskResultsRequestHeaderOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results huaweicloud_cfw_capture_task_results} +*/ +export class DataHuaweicloudCfwCaptureTaskResults extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_capture_task_results"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwCaptureTaskResults resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwCaptureTaskResults to import + * @param importFromId The id of the existing DataHuaweicloudCfwCaptureTaskResults that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwCaptureTaskResults to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_capture_task_results", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_task_results huaweicloud_cfw_capture_task_results} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwCaptureTaskResultsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwCaptureTaskResultsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_capture_task_results', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._ip = config.ip; + this._region = config.region; + this._taskId = config.taskId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // captcha - computed: true, optional: false, required: false + public get captcha() { + return this.getStringAttribute('captcha'); + } + + // expires - computed: true, optional: false, required: false + public get expires() { + return this.getNumberAttribute('expires'); + } + + // file_list - computed: true, optional: false, required: false + private _fileList = new DataHuaweicloudCfwCaptureTaskResultsFileListStructList(this, "file_list", false); + public get fileList() { + return this._fileList; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip - computed: false, optional: true, required: false + private _ip?: string[]; + public get ip() { + return this.getListAttribute('ip'); + } + public set ip(value: string[]) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_header - computed: true, optional: false, required: false + private _requestHeader = new DataHuaweicloudCfwCaptureTaskResultsRequestHeaderList(this, "request_header", false); + public get requestHeader() { + return this._requestHeader; + } + + // task_id - computed: false, optional: false, required: true + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // type - computed: false, optional: true, required: false + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + ip: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ip), + region: cdktf.stringToTerraform(this._region), + task_id: cdktf.stringToTerraform(this._taskId), + type: cdktf.numberToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ip), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/README.md new file mode 100644 index 00000000..6ce39f37 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_capture_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_capture_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/index.ts new file mode 100644 index 00000000..44170082 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-capture-tasks/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwCaptureTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the firewall instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks#fw_instance_id DataHuaweicloudCfwCaptureTasks#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks#id DataHuaweicloudCfwCaptureTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks#region DataHuaweicloudCfwCaptureTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCfwCaptureTasksRecords { +} + +export function dataHuaweicloudCfwCaptureTasksRecordsToTerraform(struct?: DataHuaweicloudCfwCaptureTasksRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwCaptureTasksRecordsToHclTerraform(struct?: DataHuaweicloudCfwCaptureTasksRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwCaptureTasksRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwCaptureTasksRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwCaptureTasksRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // capture_size - computed: true, optional: false, required: false + public get captureSize() { + return this.getStringAttribute('capture_size'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dest_address - computed: true, optional: false, required: false + public get destAddress() { + return this.getStringAttribute('dest_address'); + } + + // dest_address_type - computed: true, optional: false, required: false + public get destAddressType() { + return this.getNumberAttribute('dest_address_type'); + } + + // dest_port - computed: true, optional: false, required: false + public get destPort() { + return this.getStringAttribute('dest_port'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getNumberAttribute('duration'); + } + + // is_deleted - computed: true, optional: false, required: false + public get isDeleted() { + return this.getNumberAttribute('is_deleted'); + } + + // max_packets - computed: true, optional: false, required: false + public get maxPackets() { + return this.getNumberAttribute('max_packets'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getNumberAttribute('protocol'); + } + + // remaining_days - computed: true, optional: false, required: false + public get remainingDays() { + return this.getNumberAttribute('remaining_days'); + } + + // source_address - computed: true, optional: false, required: false + public get sourceAddress() { + return this.getStringAttribute('source_address'); + } + + // source_address_type - computed: true, optional: false, required: false + public get sourceAddressType() { + return this.getNumberAttribute('source_address_type'); + } + + // source_port - computed: true, optional: false, required: false + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // task_id - computed: true, optional: false, required: false + public get taskId() { + return this.getStringAttribute('task_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCfwCaptureTasksRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwCaptureTasksRecordsOutputReference { + return new DataHuaweicloudCfwCaptureTasksRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks huaweicloud_cfw_capture_tasks} +*/ +export class DataHuaweicloudCfwCaptureTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_capture_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwCaptureTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwCaptureTasks to import + * @param importFromId The id of the existing DataHuaweicloudCfwCaptureTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwCaptureTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_capture_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_capture_tasks huaweicloud_cfw_capture_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwCaptureTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwCaptureTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_capture_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwCaptureTasksRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/README.md new file mode 100644 index 00000000..fdba3e39 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_domain_name_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_domain_name_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/index.ts new file mode 100644 index 00000000..f7b89e59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-domain-name-groups/index.ts @@ -0,0 +1,698 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwDomainNameGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the configuration status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#config_status DataHuaweicloudCfwDomainNameGroups#config_status} + */ + readonly configStatus?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#enterprise_project_id DataHuaweicloudCfwDomainNameGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#fw_instance_id DataHuaweicloudCfwDomainNameGroups#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Specifies the domain name group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#group_id DataHuaweicloudCfwDomainNameGroups#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#id DataHuaweicloudCfwDomainNameGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the key word. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#key_word DataHuaweicloudCfwDomainNameGroups#key_word} + */ + readonly keyWord?: string; + /** + * Specifies the name of a domain name group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#name DataHuaweicloudCfwDomainNameGroups#name} + */ + readonly name?: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#object_id DataHuaweicloudCfwDomainNameGroups#object_id} + */ + readonly objectId: string; + /** + * Specifies the domain name group reference count. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#ref_count DataHuaweicloudCfwDomainNameGroups#ref_count} + */ + readonly refCount?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#region DataHuaweicloudCfwDomainNameGroups#region} + */ + readonly region?: string; + /** + * Specifies the domain name group type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#type DataHuaweicloudCfwDomainNameGroups#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCfwDomainNameGroupsRecordsDomainNames { +} + +export function dataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesToTerraform(struct?: DataHuaweicloudCfwDomainNameGroupsRecordsDomainNames): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesToHclTerraform(struct?: DataHuaweicloudCfwDomainNameGroupsRecordsDomainNames): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwDomainNameGroupsRecordsDomainNames | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwDomainNameGroupsRecordsDomainNames | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_address_id - computed: true, optional: false, required: false + public get domainAddressId() { + return this.getStringAttribute('domain_address_id'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } +} + +export class DataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesOutputReference { + return new DataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwDomainNameGroupsRecordsRules { +} + +export function dataHuaweicloudCfwDomainNameGroupsRecordsRulesToTerraform(struct?: DataHuaweicloudCfwDomainNameGroupsRecordsRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwDomainNameGroupsRecordsRulesToHclTerraform(struct?: DataHuaweicloudCfwDomainNameGroupsRecordsRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwDomainNameGroupsRecordsRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwDomainNameGroupsRecordsRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwDomainNameGroupsRecordsRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCfwDomainNameGroupsRecordsRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwDomainNameGroupsRecordsRulesOutputReference { + return new DataHuaweicloudCfwDomainNameGroupsRecordsRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwDomainNameGroupsRecords { +} + +export function dataHuaweicloudCfwDomainNameGroupsRecordsToTerraform(struct?: DataHuaweicloudCfwDomainNameGroupsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwDomainNameGroupsRecordsToHclTerraform(struct?: DataHuaweicloudCfwDomainNameGroupsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwDomainNameGroupsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwDomainNameGroupsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwDomainNameGroupsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // config_status - computed: true, optional: false, required: false + public get configStatus() { + return this.getStringAttribute('config_status'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_names - computed: true, optional: false, required: false + private _domainNames = new DataHuaweicloudCfwDomainNameGroupsRecordsDomainNamesList(this, "domain_names", false); + public get domainNames() { + return this._domainNames; + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // ref_count - computed: true, optional: false, required: false + public get refCount() { + return this.getStringAttribute('ref_count'); + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudCfwDomainNameGroupsRecordsRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCfwDomainNameGroupsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwDomainNameGroupsRecordsOutputReference { + return new DataHuaweicloudCfwDomainNameGroupsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups huaweicloud_cfw_domain_name_groups} +*/ +export class DataHuaweicloudCfwDomainNameGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_domain_name_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwDomainNameGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwDomainNameGroups to import + * @param importFromId The id of the existing DataHuaweicloudCfwDomainNameGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwDomainNameGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_domain_name_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_domain_name_groups huaweicloud_cfw_domain_name_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwDomainNameGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwDomainNameGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_domain_name_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configStatus = config.configStatus; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fwInstanceId = config.fwInstanceId; + this._groupId = config.groupId; + this._id = config.id; + this._keyWord = config.keyWord; + this._name = config.name; + this._objectId = config.objectId; + this._refCount = config.refCount; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // config_status - computed: false, optional: true, required: false + private _configStatus?: string; + public get configStatus() { + return this.getStringAttribute('config_status'); + } + public set configStatus(value: string) { + this._configStatus = value; + } + public resetConfigStatus() { + this._configStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get configStatusInput() { + return this._configStatus; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_word - computed: false, optional: true, required: false + private _keyWord?: string; + public get keyWord() { + return this.getStringAttribute('key_word'); + } + public set keyWord(value: string) { + this._keyWord = value; + } + public resetKeyWord() { + this._keyWord = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyWordInput() { + return this._keyWord; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwDomainNameGroupsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // ref_count - computed: false, optional: true, required: false + private _refCount?: string; + public get refCount() { + return this.getStringAttribute('ref_count'); + } + public set refCount(value: string) { + this._refCount = value; + } + public resetRefCount() { + this._refCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get refCountInput() { + return this._refCount; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + config_status: cdktf.stringToTerraform(this._configStatus), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + key_word: cdktf.stringToTerraform(this._keyWord), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + ref_count: cdktf.stringToTerraform(this._refCount), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + config_status: { + value: cdktf.stringToHclTerraform(this._configStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_word: { + value: cdktf.stringToHclTerraform(this._keyWord), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ref_count: { + value: cdktf.stringToHclTerraform(this._refCount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/README.md new file mode 100644 index 00000000..b8a74cb2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_firewalls` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_firewalls`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/index.ts new file mode 100644 index 00000000..77993fe1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-firewalls/index.ts @@ -0,0 +1,633 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwFirewallsConfig extends cdktf.TerraformMetaArguments { + /** + * |- + * The firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls#fw_instance_id DataHuaweicloudCfwFirewalls#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls#id DataHuaweicloudCfwFirewalls#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls#region DataHuaweicloudCfwFirewalls#region} + */ + readonly region?: string; + /** + * |- + * Service type + * 0. North-south firewall + * 1. East-west firewall + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls#service_type DataHuaweicloudCfwFirewalls#service_type} + */ + readonly serviceType?: number; +} +export interface DataHuaweicloudCfwFirewallsRecordsFlavor { +} + +export function dataHuaweicloudCfwFirewallsRecordsFlavorToTerraform(struct?: DataHuaweicloudCfwFirewallsRecordsFlavor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwFirewallsRecordsFlavorToHclTerraform(struct?: DataHuaweicloudCfwFirewallsRecordsFlavor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwFirewallsRecordsFlavorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwFirewallsRecordsFlavor | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwFirewallsRecordsFlavor | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // eip_count - computed: true, optional: false, required: false + public get eipCount() { + return this.getNumberAttribute('eip_count'); + } + + // log_storage - computed: true, optional: false, required: false + public get logStorage() { + return this.getNumberAttribute('log_storage'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } + + // vpc_count - computed: true, optional: false, required: false + public get vpcCount() { + return this.getNumberAttribute('vpc_count'); + } +} + +export class DataHuaweicloudCfwFirewallsRecordsFlavorList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwFirewallsRecordsFlavorOutputReference { + return new DataHuaweicloudCfwFirewallsRecordsFlavorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwFirewallsRecordsProtectObjects { +} + +export function dataHuaweicloudCfwFirewallsRecordsProtectObjectsToTerraform(struct?: DataHuaweicloudCfwFirewallsRecordsProtectObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwFirewallsRecordsProtectObjectsToHclTerraform(struct?: DataHuaweicloudCfwFirewallsRecordsProtectObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwFirewallsRecordsProtectObjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwFirewallsRecordsProtectObjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwFirewallsRecordsProtectObjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // object_id - computed: true, optional: false, required: false + public get objectId() { + return this.getStringAttribute('object_id'); + } + + // object_name - computed: true, optional: false, required: false + public get objectName() { + return this.getStringAttribute('object_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCfwFirewallsRecordsProtectObjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwFirewallsRecordsProtectObjectsOutputReference { + return new DataHuaweicloudCfwFirewallsRecordsProtectObjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwFirewallsRecordsResources { +} + +export function dataHuaweicloudCfwFirewallsRecordsResourcesToTerraform(struct?: DataHuaweicloudCfwFirewallsRecordsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwFirewallsRecordsResourcesToHclTerraform(struct?: DataHuaweicloudCfwFirewallsRecordsResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwFirewallsRecordsResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwFirewallsRecordsResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwFirewallsRecordsResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_service_type - computed: true, optional: false, required: false + public get cloudServiceType() { + return this.getStringAttribute('cloud_service_type'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_size - computed: true, optional: false, required: false + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + + // resource_size_measure_id - computed: true, optional: false, required: false + public get resourceSizeMeasureId() { + return this.getNumberAttribute('resource_size_measure_id'); + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } +} + +export class DataHuaweicloudCfwFirewallsRecordsResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwFirewallsRecordsResourcesOutputReference { + return new DataHuaweicloudCfwFirewallsRecordsResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwFirewallsRecords { +} + +export function dataHuaweicloudCfwFirewallsRecordsToTerraform(struct?: DataHuaweicloudCfwFirewallsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwFirewallsRecordsToHclTerraform(struct?: DataHuaweicloudCfwFirewallsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwFirewallsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwFirewallsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwFirewallsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getNumberAttribute('charge_mode'); + } + + // engine_type - computed: true, optional: false, required: false + public get engineType() { + return this.getNumberAttribute('engine_type'); + } + + // feature_toggle - computed: true, optional: false, required: false + private _featureToggle = new cdktf.BooleanMap(this, "feature_toggle"); + public get featureToggle() { + return this._featureToggle; + } + + // flavor - computed: true, optional: false, required: false + private _flavor = new DataHuaweicloudCfwFirewallsRecordsFlavorList(this, "flavor", false); + public get flavor() { + return this._flavor; + } + + // fw_instance_id - computed: true, optional: false, required: false + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + + // ha_type - computed: true, optional: false, required: false + public get haType() { + return this.getNumberAttribute('ha_type'); + } + + // is_old_firewall_instance - computed: true, optional: false, required: false + public get isOldFirewallInstance() { + return this.getBooleanAttribute('is_old_firewall_instance'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protect_objects - computed: true, optional: false, required: false + private _protectObjects = new DataHuaweicloudCfwFirewallsRecordsProtectObjectsList(this, "protect_objects", false); + public get protectObjects() { + return this._protectObjects; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudCfwFirewallsRecordsResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getNumberAttribute('service_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // support_ipv6 - computed: true, optional: false, required: false + public get supportIpv6() { + return this.getBooleanAttribute('support_ipv6'); + } +} + +export class DataHuaweicloudCfwFirewallsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwFirewallsRecordsOutputReference { + return new DataHuaweicloudCfwFirewallsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls huaweicloud_cfw_firewalls} +*/ +export class DataHuaweicloudCfwFirewalls extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_firewalls"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwFirewalls resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwFirewalls to import + * @param importFromId The id of the existing DataHuaweicloudCfwFirewalls that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwFirewalls to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_firewalls", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_firewalls huaweicloud_cfw_firewalls} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwFirewallsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwFirewallsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_firewalls', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._region = config.region; + this._serviceType = config.serviceType; + } + + // ========== + // ATTRIBUTES + // ========== + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwFirewallsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_type - computed: false, optional: true, required: false + private _serviceType?: number; + public get serviceType() { + return this.getNumberAttribute('service_type'); + } + public set serviceType(value: number) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service_type: cdktf.numberToTerraform(this._serviceType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.numberToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/README.md new file mode 100644 index 00000000..e5f0dc19 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_flow_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_flow_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/index.ts new file mode 100644 index 00000000..49be3e59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-flow-logs/index.ts @@ -0,0 +1,818 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwFlowLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the application protocol. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#app DataHuaweicloudCfwFlowLogs#app} + */ + readonly app?: string; + /** + * Specifies the direction. The values can be **out2in** and **in2out**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#direction DataHuaweicloudCfwFlowLogs#direction} + */ + readonly direction?: string; + /** + * Specifies the destination city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#dst_city_name DataHuaweicloudCfwFlowLogs#dst_city_name} + */ + readonly dstCityName?: string; + /** + * Specifies the destination IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#dst_ip DataHuaweicloudCfwFlowLogs#dst_ip} + */ + readonly dstIp?: string; + /** + * Specifies the destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#dst_port DataHuaweicloudCfwFlowLogs#dst_port} + */ + readonly dstPort?: number; + /** + * Specifies the destination province name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#dst_province_name DataHuaweicloudCfwFlowLogs#dst_province_name} + */ + readonly dstProvinceName?: string; + /** + * Specifies the destination region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#dst_region_name DataHuaweicloudCfwFlowLogs#dst_region_name} + */ + readonly dstRegionName?: string; + /** + * Specifies the end time. The time is in UTC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#end_time DataHuaweicloudCfwFlowLogs#end_time} + */ + readonly endTime: string; + /** + * Specifies the enterprise project id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#enterprise_project_id DataHuaweicloudCfwFlowLogs#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#fw_instance_id DataHuaweicloudCfwFlowLogs#fw_instance_id} + */ + readonly fwInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#id DataHuaweicloudCfwFlowLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#region DataHuaweicloudCfwFlowLogs#region} + */ + readonly region?: string; + /** + * Specifies the source city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#src_city_name DataHuaweicloudCfwFlowLogs#src_city_name} + */ + readonly srcCityName?: string; + /** + * Specifies the source IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#src_ip DataHuaweicloudCfwFlowLogs#src_ip} + */ + readonly srcIp?: string; + /** + * Specifies the source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#src_port DataHuaweicloudCfwFlowLogs#src_port} + */ + readonly srcPort?: number; + /** + * Specifies the source province name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#src_province_name DataHuaweicloudCfwFlowLogs#src_province_name} + */ + readonly srcProvinceName?: string; + /** + * Specifies the source region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#src_region_name DataHuaweicloudCfwFlowLogs#src_region_name} + */ + readonly srcRegionName?: string; + /** + * Specifies the start time. The time is in UTC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#start_time DataHuaweicloudCfwFlowLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudCfwFlowLogsRecords { +} + +export function dataHuaweicloudCfwFlowLogsRecordsToTerraform(struct?: DataHuaweicloudCfwFlowLogsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwFlowLogsRecordsToHclTerraform(struct?: DataHuaweicloudCfwFlowLogsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwFlowLogsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwFlowLogsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwFlowLogsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app - computed: true, optional: false, required: false + public get app() { + return this.getStringAttribute('app'); + } + + // bytes - computed: true, optional: false, required: false + public get bytes() { + return this.getNumberAttribute('bytes'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // dst_city_id - computed: true, optional: false, required: false + public get dstCityId() { + return this.getStringAttribute('dst_city_id'); + } + + // dst_city_name - computed: true, optional: false, required: false + public get dstCityName() { + return this.getStringAttribute('dst_city_name'); + } + + // dst_host - computed: true, optional: false, required: false + public get dstHost() { + return this.getStringAttribute('dst_host'); + } + + // dst_ip - computed: true, optional: false, required: false + public get dstIp() { + return this.getStringAttribute('dst_ip'); + } + + // dst_port - computed: true, optional: false, required: false + public get dstPort() { + return this.getNumberAttribute('dst_port'); + } + + // dst_province_id - computed: true, optional: false, required: false + public get dstProvinceId() { + return this.getStringAttribute('dst_province_id'); + } + + // dst_province_name - computed: true, optional: false, required: false + public get dstProvinceName() { + return this.getStringAttribute('dst_province_name'); + } + + // dst_region_id - computed: true, optional: false, required: false + public get dstRegionId() { + return this.getStringAttribute('dst_region_id'); + } + + // dst_region_name - computed: true, optional: false, required: false + public get dstRegionName() { + return this.getStringAttribute('dst_region_name'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // log_id - computed: true, optional: false, required: false + public get logId() { + return this.getStringAttribute('log_id'); + } + + // packets - computed: true, optional: false, required: false + public get packets() { + return this.getNumberAttribute('packets'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // src_city_id - computed: true, optional: false, required: false + public get srcCityId() { + return this.getStringAttribute('src_city_id'); + } + + // src_city_name - computed: true, optional: false, required: false + public get srcCityName() { + return this.getStringAttribute('src_city_name'); + } + + // src_ip - computed: true, optional: false, required: false + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + + // src_port - computed: true, optional: false, required: false + public get srcPort() { + return this.getNumberAttribute('src_port'); + } + + // src_province_id - computed: true, optional: false, required: false + public get srcProvinceId() { + return this.getStringAttribute('src_province_id'); + } + + // src_province_name - computed: true, optional: false, required: false + public get srcProvinceName() { + return this.getStringAttribute('src_province_name'); + } + + // src_region_id - computed: true, optional: false, required: false + public get srcRegionId() { + return this.getStringAttribute('src_region_id'); + } + + // src_region_name - computed: true, optional: false, required: false + public get srcRegionName() { + return this.getStringAttribute('src_region_name'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudCfwFlowLogsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwFlowLogsRecordsOutputReference { + return new DataHuaweicloudCfwFlowLogsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs huaweicloud_cfw_flow_logs} +*/ +export class DataHuaweicloudCfwFlowLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_flow_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwFlowLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwFlowLogs to import + * @param importFromId The id of the existing DataHuaweicloudCfwFlowLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwFlowLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_flow_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_flow_logs huaweicloud_cfw_flow_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwFlowLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwFlowLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_flow_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._app = config.app; + this._direction = config.direction; + this._dstCityName = config.dstCityName; + this._dstIp = config.dstIp; + this._dstPort = config.dstPort; + this._dstProvinceName = config.dstProvinceName; + this._dstRegionName = config.dstRegionName; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._region = config.region; + this._srcCityName = config.srcCityName; + this._srcIp = config.srcIp; + this._srcPort = config.srcPort; + this._srcProvinceName = config.srcProvinceName; + this._srcRegionName = config.srcRegionName; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // app - computed: false, optional: true, required: false + private _app?: string; + public get app() { + return this.getStringAttribute('app'); + } + public set app(value: string) { + this._app = value; + } + public resetApp() { + this._app = undefined; + } + // Temporarily expose input value. Use with caution. + public get appInput() { + return this._app; + } + + // direction - computed: false, optional: true, required: false + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // dst_city_name - computed: false, optional: true, required: false + private _dstCityName?: string; + public get dstCityName() { + return this.getStringAttribute('dst_city_name'); + } + public set dstCityName(value: string) { + this._dstCityName = value; + } + public resetDstCityName() { + this._dstCityName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstCityNameInput() { + return this._dstCityName; + } + + // dst_ip - computed: false, optional: true, required: false + private _dstIp?: string; + public get dstIp() { + return this.getStringAttribute('dst_ip'); + } + public set dstIp(value: string) { + this._dstIp = value; + } + public resetDstIp() { + this._dstIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstIpInput() { + return this._dstIp; + } + + // dst_port - computed: false, optional: true, required: false + private _dstPort?: number; + public get dstPort() { + return this.getNumberAttribute('dst_port'); + } + public set dstPort(value: number) { + this._dstPort = value; + } + public resetDstPort() { + this._dstPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstPortInput() { + return this._dstPort; + } + + // dst_province_name - computed: false, optional: true, required: false + private _dstProvinceName?: string; + public get dstProvinceName() { + return this.getStringAttribute('dst_province_name'); + } + public set dstProvinceName(value: string) { + this._dstProvinceName = value; + } + public resetDstProvinceName() { + this._dstProvinceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstProvinceNameInput() { + return this._dstProvinceName; + } + + // dst_region_name - computed: false, optional: true, required: false + private _dstRegionName?: string; + public get dstRegionName() { + return this.getStringAttribute('dst_region_name'); + } + public set dstRegionName(value: string) { + this._dstRegionName = value; + } + public resetDstRegionName() { + this._dstRegionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dstRegionNameInput() { + return this._dstRegionName; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fw_instance_id - computed: false, optional: false, required: true + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwFlowLogsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // src_city_name - computed: false, optional: true, required: false + private _srcCityName?: string; + public get srcCityName() { + return this.getStringAttribute('src_city_name'); + } + public set srcCityName(value: string) { + this._srcCityName = value; + } + public resetSrcCityName() { + this._srcCityName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcCityNameInput() { + return this._srcCityName; + } + + // src_ip - computed: false, optional: true, required: false + private _srcIp?: string; + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + public set srcIp(value: string) { + this._srcIp = value; + } + public resetSrcIp() { + this._srcIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcIpInput() { + return this._srcIp; + } + + // src_port - computed: false, optional: true, required: false + private _srcPort?: number; + public get srcPort() { + return this.getNumberAttribute('src_port'); + } + public set srcPort(value: number) { + this._srcPort = value; + } + public resetSrcPort() { + this._srcPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcPortInput() { + return this._srcPort; + } + + // src_province_name - computed: false, optional: true, required: false + private _srcProvinceName?: string; + public get srcProvinceName() { + return this.getStringAttribute('src_province_name'); + } + public set srcProvinceName(value: string) { + this._srcProvinceName = value; + } + public resetSrcProvinceName() { + this._srcProvinceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcProvinceNameInput() { + return this._srcProvinceName; + } + + // src_region_name - computed: false, optional: true, required: false + private _srcRegionName?: string; + public get srcRegionName() { + return this.getStringAttribute('src_region_name'); + } + public set srcRegionName(value: string) { + this._srcRegionName = value; + } + public resetSrcRegionName() { + this._srcRegionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcRegionNameInput() { + return this._srcRegionName; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app: cdktf.stringToTerraform(this._app), + direction: cdktf.stringToTerraform(this._direction), + dst_city_name: cdktf.stringToTerraform(this._dstCityName), + dst_ip: cdktf.stringToTerraform(this._dstIp), + dst_port: cdktf.numberToTerraform(this._dstPort), + dst_province_name: cdktf.stringToTerraform(this._dstProvinceName), + dst_region_name: cdktf.stringToTerraform(this._dstRegionName), + end_time: cdktf.stringToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + src_city_name: cdktf.stringToTerraform(this._srcCityName), + src_ip: cdktf.stringToTerraform(this._srcIp), + src_port: cdktf.numberToTerraform(this._srcPort), + src_province_name: cdktf.stringToTerraform(this._srcProvinceName), + src_region_name: cdktf.stringToTerraform(this._srcRegionName), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app: { + value: cdktf.stringToHclTerraform(this._app), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_city_name: { + value: cdktf.stringToHclTerraform(this._dstCityName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_ip: { + value: cdktf.stringToHclTerraform(this._dstIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_port: { + value: cdktf.numberToHclTerraform(this._dstPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dst_province_name: { + value: cdktf.stringToHclTerraform(this._dstProvinceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_region_name: { + value: cdktf.stringToHclTerraform(this._dstRegionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_city_name: { + value: cdktf.stringToHclTerraform(this._srcCityName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_ip: { + value: cdktf.stringToHclTerraform(this._srcIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_port: { + value: cdktf.numberToHclTerraform(this._srcPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + src_province_name: { + value: cdktf.stringToHclTerraform(this._srcProvinceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_region_name: { + value: cdktf.stringToHclTerraform(this._srcRegionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/README.md new file mode 100644 index 00000000..8d74fcce --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_protection_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_protection_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/index.ts new file mode 100644 index 00000000..f8956d29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-protection-rules/index.ts @@ -0,0 +1,1296 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwProtectionRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the rule action type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#action_type DataHuaweicloudCfwProtectionRules#action_type} + */ + readonly actionType?: string; + /** + * Specifies the destination address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#destination DataHuaweicloudCfwProtectionRules#destination} + */ + readonly destination?: string; + /** + * Specifies the rule direction. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#direction DataHuaweicloudCfwProtectionRules#direction} + */ + readonly direction?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#fw_instance_id DataHuaweicloudCfwProtectionRules#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#id DataHuaweicloudCfwProtectionRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#name DataHuaweicloudCfwProtectionRules#name} + */ + readonly name?: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#object_id DataHuaweicloudCfwProtectionRules#object_id} + */ + readonly objectId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#region DataHuaweicloudCfwProtectionRules#region} + */ + readonly region?: string; + /** + * Specifies the rule ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#rule_id DataHuaweicloudCfwProtectionRules#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the source address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#source DataHuaweicloudCfwProtectionRules#source} + */ + readonly source?: string; + /** + * Specifies the rule status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#status DataHuaweicloudCfwProtectionRules#status} + */ + readonly status?: string; + /** + * Specifies the key/value pairs to associate with the protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#tags DataHuaweicloudCfwProtectionRules#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the rule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#type DataHuaweicloudCfwProtectionRules#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStruct { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description_cn - computed: true, optional: false, required: false + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + + // description_en - computed: true, optional: false, required: false + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // region_type - computed: true, optional: false, required: false + public get regionType() { + return this.getNumberAttribute('region_type'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwProtectionRulesRecordsDestination { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsDestinationToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsDestination): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsDestinationToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsDestination): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsDestinationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecordsDestination | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecordsDestination | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // address_group - computed: true, optional: false, required: false + public get addressGroup() { + return this.getListAttribute('address_group'); + } + + // address_set_id - computed: true, optional: false, required: false + public get addressSetId() { + return this.getStringAttribute('address_set_id'); + } + + // address_set_name - computed: true, optional: false, required: false + public get addressSetName() { + return this.getStringAttribute('address_set_name'); + } + + // address_set_type - computed: true, optional: false, required: false + public get addressSetType() { + return this.getNumberAttribute('address_set_type'); + } + + // address_type - computed: true, optional: false, required: false + public get addressType() { + return this.getNumberAttribute('address_type'); + } + + // domain_address_name - computed: true, optional: false, required: false + public get domainAddressName() { + return this.getStringAttribute('domain_address_name'); + } + + // domain_set_id - computed: true, optional: false, required: false + public get domainSetId() { + return this.getStringAttribute('domain_set_id'); + } + + // domain_set_name - computed: true, optional: false, required: false + public get domainSetName() { + return this.getStringAttribute('domain_set_name'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getListAttribute('ip_address'); + } + + // region_list - computed: true, optional: false, required: false + private _regionList = new DataHuaweicloudCfwProtectionRulesRecordsDestinationRegionListStructList(this, "region_list", false); + public get regionList() { + return this._regionList; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsDestinationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsDestinationOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsDestinationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwProtectionRulesRecordsServiceCustomService { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsServiceCustomService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsServiceCustomService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecordsServiceCustomService | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecordsServiceCustomService | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dest_port - computed: true, optional: false, required: false + public get destPort() { + return this.getStringAttribute('dest_port'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getNumberAttribute('protocol'); + } + + // source_port - computed: true, optional: false, required: false + public get sourcePort() { + return this.getStringAttribute('source_port'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwProtectionRulesRecordsService { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsServiceToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsServiceToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsService): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsServiceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecordsService | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecordsService | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // custom_service - computed: true, optional: false, required: false + private _customService = new DataHuaweicloudCfwProtectionRulesRecordsServiceCustomServiceList(this, "custom_service", false); + public get customService() { + return this._customService; + } + + // dest_port - computed: true, optional: false, required: false + public get destPort() { + return this.getStringAttribute('dest_port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getNumberAttribute('protocol'); + } + + // protocols - computed: true, optional: false, required: false + public get protocols() { + return this.getNumberListAttribute('protocols'); + } + + // service_group - computed: true, optional: false, required: false + public get serviceGroup() { + return this.getListAttribute('service_group'); + } + + // service_set_id - computed: true, optional: false, required: false + public get serviceSetId() { + return this.getStringAttribute('service_set_id'); + } + + // service_set_name - computed: true, optional: false, required: false + public get serviceSetName() { + return this.getStringAttribute('service_set_name'); + } + + // service_set_type - computed: true, optional: false, required: false + public get serviceSetType() { + return this.getNumberAttribute('service_set_type'); + } + + // source_port - computed: true, optional: false, required: false + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsServiceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsServiceOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsServiceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStruct { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description_cn - computed: true, optional: false, required: false + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + + // description_en - computed: true, optional: false, required: false + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // region_type - computed: true, optional: false, required: false + public get regionType() { + return this.getNumberAttribute('region_type'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwProtectionRulesRecordsSource { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsSourceToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsSourceToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecordsSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecordsSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecordsSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // address_group - computed: true, optional: false, required: false + public get addressGroup() { + return this.getListAttribute('address_group'); + } + + // address_set_id - computed: true, optional: false, required: false + public get addressSetId() { + return this.getStringAttribute('address_set_id'); + } + + // address_set_name - computed: true, optional: false, required: false + public get addressSetName() { + return this.getStringAttribute('address_set_name'); + } + + // address_set_type - computed: true, optional: false, required: false + public get addressSetType() { + return this.getNumberAttribute('address_set_type'); + } + + // address_type - computed: true, optional: false, required: false + public get addressType() { + return this.getNumberAttribute('address_type'); + } + + // domain_address_name - computed: true, optional: false, required: false + public get domainAddressName() { + return this.getStringAttribute('domain_address_name'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getListAttribute('ip_address'); + } + + // region_list - computed: true, optional: false, required: false + private _regionList = new DataHuaweicloudCfwProtectionRulesRecordsSourceRegionListStructList(this, "region_list", false); + public get regionList() { + return this._regionList; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsSourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsSourceOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsSourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCfwProtectionRulesRecords { +} + +export function dataHuaweicloudCfwProtectionRulesRecordsToTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwProtectionRulesRecordsToHclTerraform(struct?: DataHuaweicloudCfwProtectionRulesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwProtectionRulesRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwProtectionRulesRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwProtectionRulesRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action_type - computed: true, optional: false, required: false + public get actionType() { + return this.getStringAttribute('action_type'); + } + + // address_type - computed: true, optional: false, required: false + public get addressType() { + return this.getNumberAttribute('address_type'); + } + + // created_date - computed: true, optional: false, required: false + public get createdDate() { + return this.getStringAttribute('created_date'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination - computed: true, optional: false, required: false + private _destination = new DataHuaweicloudCfwProtectionRulesRecordsDestinationList(this, "destination", false); + public get destination() { + return this._destination; + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // last_open_time - computed: true, optional: false, required: false + public get lastOpenTime() { + return this.getStringAttribute('last_open_time'); + } + + // long_connect_enable - computed: true, optional: false, required: false + public get longConnectEnable() { + return this.getNumberAttribute('long_connect_enable'); + } + + // long_connect_time - computed: true, optional: false, required: false + public get longConnectTime() { + return this.getNumberAttribute('long_connect_time'); + } + + // long_connect_time_hour - computed: true, optional: false, required: false + public get longConnectTimeHour() { + return this.getNumberAttribute('long_connect_time_hour'); + } + + // long_connect_time_minute - computed: true, optional: false, required: false + public get longConnectTimeMinute() { + return this.getNumberAttribute('long_connect_time_minute'); + } + + // long_connect_time_second - computed: true, optional: false, required: false + public get longConnectTimeSecond() { + return this.getNumberAttribute('long_connect_time_second'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // service - computed: true, optional: false, required: false + private _service = new DataHuaweicloudCfwProtectionRulesRecordsServiceList(this, "service", false); + public get service() { + return this._service; + } + + // source - computed: true, optional: false, required: false + private _source = new DataHuaweicloudCfwProtectionRulesRecordsSourceList(this, "source", false); + public get source() { + return this._source; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCfwProtectionRulesRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwProtectionRulesRecordsOutputReference { + return new DataHuaweicloudCfwProtectionRulesRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules huaweicloud_cfw_protection_rules} +*/ +export class DataHuaweicloudCfwProtectionRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_protection_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwProtectionRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwProtectionRules to import + * @param importFromId The id of the existing DataHuaweicloudCfwProtectionRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwProtectionRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_protection_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_protection_rules huaweicloud_cfw_protection_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwProtectionRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwProtectionRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_protection_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionType = config.actionType; + this._destination = config.destination; + this._direction = config.direction; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + this._ruleId = config.ruleId; + this._source = config.source; + this._status = config.status; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_type - computed: false, optional: true, required: false + private _actionType?: string; + public get actionType() { + return this.getStringAttribute('action_type'); + } + public set actionType(value: string) { + this._actionType = value; + } + public resetActionType() { + this._actionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionTypeInput() { + return this._actionType; + } + + // destination - computed: false, optional: true, required: false + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // direction - computed: false, optional: true, required: false + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwProtectionRulesRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_type: cdktf.stringToTerraform(this._actionType), + destination: cdktf.stringToTerraform(this._destination), + direction: cdktf.stringToTerraform(this._direction), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + source: cdktf.stringToTerraform(this._source), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_type: { + value: cdktf.stringToHclTerraform(this._actionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/README.md new file mode 100644 index 00000000..ae194e13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_service_group_members` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_service_group_members`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/index.ts new file mode 100644 index 00000000..d8ae0945 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-group-members/index.ts @@ -0,0 +1,484 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwServiceGroupMembersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the destination port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#dest_port DataHuaweicloudCfwServiceGroupMembers#dest_port} + */ + readonly destPort?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#fw_instance_id DataHuaweicloudCfwServiceGroupMembers#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Specifies the service group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#group_id DataHuaweicloudCfwServiceGroupMembers#group_id} + */ + readonly groupId: string; + /** + * Specifies the service group type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#group_type DataHuaweicloudCfwServiceGroupMembers#group_type} + */ + readonly groupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#id DataHuaweicloudCfwServiceGroupMembers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the service group member ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#item_id DataHuaweicloudCfwServiceGroupMembers#item_id} + */ + readonly itemId?: string; + /** + * Specifies the key word. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#key_word DataHuaweicloudCfwServiceGroupMembers#key_word} + */ + readonly keyWord?: string; + /** + * Specifies the protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#protocol DataHuaweicloudCfwServiceGroupMembers#protocol} + */ + readonly protocol?: number; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#region DataHuaweicloudCfwServiceGroupMembers#region} + */ + readonly region?: string; + /** + * Specifies the source port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#source_port DataHuaweicloudCfwServiceGroupMembers#source_port} + */ + readonly sourcePort?: string; +} +export interface DataHuaweicloudCfwServiceGroupMembersRecords { +} + +export function dataHuaweicloudCfwServiceGroupMembersRecordsToTerraform(struct?: DataHuaweicloudCfwServiceGroupMembersRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwServiceGroupMembersRecordsToHclTerraform(struct?: DataHuaweicloudCfwServiceGroupMembersRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwServiceGroupMembersRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwServiceGroupMembersRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwServiceGroupMembersRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dest_port - computed: true, optional: false, required: false + public get destPort() { + return this.getStringAttribute('dest_port'); + } + + // item_id - computed: true, optional: false, required: false + public get itemId() { + return this.getStringAttribute('item_id'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getNumberAttribute('protocol'); + } + + // source_port - computed: true, optional: false, required: false + public get sourcePort() { + return this.getStringAttribute('source_port'); + } +} + +export class DataHuaweicloudCfwServiceGroupMembersRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwServiceGroupMembersRecordsOutputReference { + return new DataHuaweicloudCfwServiceGroupMembersRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members huaweicloud_cfw_service_group_members} +*/ +export class DataHuaweicloudCfwServiceGroupMembers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_service_group_members"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwServiceGroupMembers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwServiceGroupMembers to import + * @param importFromId The id of the existing DataHuaweicloudCfwServiceGroupMembers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwServiceGroupMembers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_service_group_members", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_group_members huaweicloud_cfw_service_group_members} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwServiceGroupMembersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwServiceGroupMembersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_service_group_members', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destPort = config.destPort; + this._fwInstanceId = config.fwInstanceId; + this._groupId = config.groupId; + this._groupType = config.groupType; + this._id = config.id; + this._itemId = config.itemId; + this._keyWord = config.keyWord; + this._protocol = config.protocol; + this._region = config.region; + this._sourcePort = config.sourcePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // dest_port - computed: false, optional: true, required: false + private _destPort?: string; + public get destPort() { + return this.getStringAttribute('dest_port'); + } + public set destPort(value: string) { + this._destPort = value; + } + public resetDestPort() { + this._destPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destPortInput() { + return this._destPort; + } + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // group_type - computed: false, optional: true, required: false + private _groupType?: string; + public get groupType() { + return this.getStringAttribute('group_type'); + } + public set groupType(value: string) { + this._groupType = value; + } + public resetGroupType() { + this._groupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupTypeInput() { + return this._groupType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // item_id - computed: false, optional: true, required: false + private _itemId?: string; + public get itemId() { + return this.getStringAttribute('item_id'); + } + public set itemId(value: string) { + this._itemId = value; + } + public resetItemId() { + this._itemId = undefined; + } + // Temporarily expose input value. Use with caution. + public get itemIdInput() { + return this._itemId; + } + + // key_word - computed: false, optional: true, required: false + private _keyWord?: string; + public get keyWord() { + return this.getStringAttribute('key_word'); + } + public set keyWord(value: string) { + this._keyWord = value; + } + public resetKeyWord() { + this._keyWord = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyWordInput() { + return this._keyWord; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: number; + public get protocol() { + return this.getNumberAttribute('protocol'); + } + public set protocol(value: number) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCfwServiceGroupMembersRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dest_port: cdktf.stringToTerraform(this._destPort), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + group_id: cdktf.stringToTerraform(this._groupId), + group_type: cdktf.stringToTerraform(this._groupType), + id: cdktf.stringToTerraform(this._id), + item_id: cdktf.stringToTerraform(this._itemId), + key_word: cdktf.stringToTerraform(this._keyWord), + protocol: cdktf.numberToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + source_port: cdktf.stringToTerraform(this._sourcePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dest_port: { + value: cdktf.stringToHclTerraform(this._destPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_type: { + value: cdktf.stringToHclTerraform(this._groupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + item_id: { + value: cdktf.stringToHclTerraform(this._itemId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_word: { + value: cdktf.stringToHclTerraform(this._keyWord), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.numberToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(this._sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/README.md new file mode 100644 index 00000000..1a8b0995 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cfw_service_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cfw_service_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/index.ts new file mode 100644 index 00000000..e641f5b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cfw-service-groups/index.ts @@ -0,0 +1,399 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCfwServiceGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#enterprise_project_id DataHuaweicloudCfwServiceGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the firewall instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#fw_instance_id DataHuaweicloudCfwServiceGroups#fw_instance_id} + */ + readonly fwInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#id DataHuaweicloudCfwServiceGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the keyword of the service group description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#key_word DataHuaweicloudCfwServiceGroups#key_word} + */ + readonly keyWord?: string; + /** + * Specifies the name of the service group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#name DataHuaweicloudCfwServiceGroups#name} + */ + readonly name?: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#object_id DataHuaweicloudCfwServiceGroups#object_id} + */ + readonly objectId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#region DataHuaweicloudCfwServiceGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCfwServiceGroupsServiceGroups { +} + +export function dataHuaweicloudCfwServiceGroupsServiceGroupsToTerraform(struct?: DataHuaweicloudCfwServiceGroupsServiceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCfwServiceGroupsServiceGroupsToHclTerraform(struct?: DataHuaweicloudCfwServiceGroupsServiceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCfwServiceGroupsServiceGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCfwServiceGroupsServiceGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCfwServiceGroupsServiceGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocols - computed: true, optional: false, required: false + public get protocols() { + return this.getNumberListAttribute('protocols'); + } + + // ref_count - computed: true, optional: false, required: false + public get refCount() { + return this.getNumberAttribute('ref_count'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCfwServiceGroupsServiceGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCfwServiceGroupsServiceGroupsOutputReference { + return new DataHuaweicloudCfwServiceGroupsServiceGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups huaweicloud_cfw_service_groups} +*/ +export class DataHuaweicloudCfwServiceGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cfw_service_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCfwServiceGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCfwServiceGroups to import + * @param importFromId The id of the existing DataHuaweicloudCfwServiceGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCfwServiceGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cfw_service_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cfw_service_groups huaweicloud_cfw_service_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCfwServiceGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCfwServiceGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cfw_service_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._fwInstanceId = config.fwInstanceId; + this._id = config.id; + this._keyWord = config.keyWord; + this._name = config.name; + this._objectId = config.objectId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fw_instance_id - computed: false, optional: true, required: false + private _fwInstanceId?: string; + public get fwInstanceId() { + return this.getStringAttribute('fw_instance_id'); + } + public set fwInstanceId(value: string) { + this._fwInstanceId = value; + } + public resetFwInstanceId() { + this._fwInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fwInstanceIdInput() { + return this._fwInstanceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_word - computed: false, optional: true, required: false + private _keyWord?: string; + public get keyWord() { + return this.getStringAttribute('key_word'); + } + public set keyWord(value: string) { + this._keyWord = value; + } + public resetKeyWord() { + this._keyWord = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyWordInput() { + return this._keyWord; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_groups - computed: true, optional: false, required: false + private _serviceGroups = new DataHuaweicloudCfwServiceGroupsServiceGroupsList(this, "service_groups", false); + public get serviceGroups() { + return this._serviceGroups; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fw_instance_id: cdktf.stringToTerraform(this._fwInstanceId), + id: cdktf.stringToTerraform(this._id), + key_word: cdktf.stringToTerraform(this._keyWord), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fw_instance_id: { + value: cdktf.stringToHclTerraform(this._fwInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_word: { + value: cdktf.stringToHclTerraform(this._keyWord), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/README.md new file mode 100644 index 00000000..553c0741 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cnad_advanced_available_objects` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cnad_advanced_available_objects`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/index.ts new file mode 100644 index 00000000..cd27cac0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-available-objects/index.ts @@ -0,0 +1,325 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCnadAdvancedAvailableObjectsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects#id DataHuaweicloudCnadAdvancedAvailableObjects#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects#instance_id DataHuaweicloudCnadAdvancedAvailableObjects#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the protected object ip. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects#ip_address DataHuaweicloudCnadAdvancedAvailableObjects#ip_address} + */ + readonly ipAddress?: string; + /** + * Specifies the protected object id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects#protected_object_id DataHuaweicloudCnadAdvancedAvailableObjects#protected_object_id} + */ + readonly protectedObjectId?: string; + /** + * Specifies the type of the protected object. Valid values are **VPN**, **NAT**, **VIP**, + * **CCI**, **EIP**, **ELB**, **REROUTING_IP**, **SubEni** and **NetInterFace** + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects#type DataHuaweicloudCnadAdvancedAvailableObjects#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjects { +} + +export function dataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsToTerraform(struct?: DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsToHclTerraform(struct?: DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsOutputReference { + return new DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects huaweicloud_cnad_advanced_available_objects} +*/ +export class DataHuaweicloudCnadAdvancedAvailableObjects extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_available_objects"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCnadAdvancedAvailableObjects resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCnadAdvancedAvailableObjects to import + * @param importFromId The id of the existing DataHuaweicloudCnadAdvancedAvailableObjects that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCnadAdvancedAvailableObjects to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_available_objects", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_available_objects huaweicloud_cnad_advanced_available_objects} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCnadAdvancedAvailableObjectsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCnadAdvancedAvailableObjectsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_available_objects', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._ipAddress = config.ipAddress; + this._protectedObjectId = config.protectedObjectId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // protected_object_id - computed: false, optional: true, required: false + private _protectedObjectId?: string; + public get protectedObjectId() { + return this.getStringAttribute('protected_object_id'); + } + public set protectedObjectId(value: string) { + this._protectedObjectId = value; + } + public resetProtectedObjectId() { + this._protectedObjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectedObjectIdInput() { + return this._protectedObjectId; + } + + // protected_objects - computed: true, optional: false, required: false + private _protectedObjects = new DataHuaweicloudCnadAdvancedAvailableObjectsProtectedObjectsList(this, "protected_objects", false); + public get protectedObjects() { + return this._protectedObjects; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + ip_address: cdktf.stringToTerraform(this._ipAddress), + protected_object_id: cdktf.stringToTerraform(this._protectedObjectId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected_object_id: { + value: cdktf.stringToHclTerraform(this._protectedObjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/README.md new file mode 100644 index 00000000..4a379c24 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cnad_advanced_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cnad_advanced_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/index.ts new file mode 100644 index 00000000..5a7121de --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-instances/index.ts @@ -0,0 +1,363 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCnadAdvancedInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances#id DataHuaweicloudCnadAdvancedInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances#instance_id DataHuaweicloudCnadAdvancedInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances#instance_name DataHuaweicloudCnadAdvancedInstances#instance_name} + */ + readonly instanceName?: string; + /** + * Specifies the instance type. Valid values are **cnad_pro**, **cnad_ip**, + * **cnad_ep**, **cnad_full_high**, **cnad_vic** and **cnad_intl_ep**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances#instance_type DataHuaweicloudCnadAdvancedInstances#instance_type} + */ + readonly instanceType?: string; + /** + * Specifies the region in which to query the data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances#region DataHuaweicloudCnadAdvancedInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCnadAdvancedInstancesInstances { +} + +export function dataHuaweicloudCnadAdvancedInstancesInstancesToTerraform(struct?: DataHuaweicloudCnadAdvancedInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCnadAdvancedInstancesInstancesToHclTerraform(struct?: DataHuaweicloudCnadAdvancedInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCnadAdvancedInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCnadAdvancedInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCnadAdvancedInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // ip_num - computed: true, optional: false, required: false + public get ipNum() { + return this.getNumberAttribute('ip_num'); + } + + // ip_num_now - computed: true, optional: false, required: false + public get ipNumNow() { + return this.getNumberAttribute('ip_num_now'); + } + + // protection_num - computed: true, optional: false, required: false + public get protectionNum() { + return this.getNumberAttribute('protection_num'); + } + + // protection_num_now - computed: true, optional: false, required: false + public get protectionNumNow() { + return this.getNumberAttribute('protection_num_now'); + } + + // protection_type - computed: true, optional: false, required: false + public get protectionType() { + return this.getNumberAttribute('protection_type'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } +} + +export class DataHuaweicloudCnadAdvancedInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCnadAdvancedInstancesInstancesOutputReference { + return new DataHuaweicloudCnadAdvancedInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances huaweicloud_cnad_advanced_instances} +*/ +export class DataHuaweicloudCnadAdvancedInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCnadAdvancedInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCnadAdvancedInstances to import + * @param importFromId The id of the existing DataHuaweicloudCnadAdvancedInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCnadAdvancedInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_instances huaweicloud_cnad_advanced_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCnadAdvancedInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCnadAdvancedInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._instanceName = config.instanceName; + this._instanceType = config.instanceType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: false, optional: true, required: false + private _instanceName?: string; + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + public set instanceName(value: string) { + this._instanceName = value; + } + public resetInstanceName() { + this._instanceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNameInput() { + return this._instanceName; + } + + // instance_type - computed: false, optional: true, required: false + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + public resetInstanceType() { + this._instanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudCnadAdvancedInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_name: cdktf.stringToTerraform(this._instanceName), + instance_type: cdktf.stringToTerraform(this._instanceType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_name: { + value: cdktf.stringToHclTerraform(this._instanceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/README.md new file mode 100644 index 00000000..15775231 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cnad_advanced_protected_objects` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cnad_advanced_protected_objects`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/index.ts new file mode 100644 index 00000000..5119a056 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cnad-advanced-protected-objects/index.ts @@ -0,0 +1,433 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCnadAdvancedProtectedObjectsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#id DataHuaweicloudCnadAdvancedProtectedObjects#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the CNAD advanced instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#instance_id DataHuaweicloudCnadAdvancedProtectedObjects#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the CNAD advanced protected object IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#ip_address DataHuaweicloudCnadAdvancedProtectedObjects#ip_address} + */ + readonly ipAddress?: string; + /** + * Specifies whether query protected objects which policies unbound. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#is_unbound DataHuaweicloudCnadAdvancedProtectedObjects#is_unbound} + */ + readonly isUnbound?: boolean | cdktf.IResolvable; + /** + * Specifies the CNAD advanced policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#policy_id DataHuaweicloudCnadAdvancedProtectedObjects#policy_id} + */ + readonly policyId?: string; + /** + * Specifies the protected object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#protected_object_id DataHuaweicloudCnadAdvancedProtectedObjects#protected_object_id} + */ + readonly protectedObjectId?: string; + /** + * Specifies the type of the protected object. Valid values are **VPN**, **NAT**, **VIP**, + * **CCI**, **EIP**, **ELB**, **REROUTING_IP**, **SubEni** and **NetInterFace** + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#type DataHuaweicloudCnadAdvancedProtectedObjects#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjects { +} + +export function dataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsToTerraform(struct?: DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsToHclTerraform(struct?: DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // block_threshold - computed: true, optional: false, required: false + public get blockThreshold() { + return this.getStringAttribute('block_threshold'); + } + + // clean_threshold - computed: true, optional: false, required: false + public get cleanThreshold() { + return this.getNumberAttribute('clean_threshold'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_version - computed: true, optional: false, required: false + public get instanceVersion() { + return this.getStringAttribute('instance_version'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_name - computed: true, optional: false, required: false + public get policyName() { + return this.getStringAttribute('policy_name'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsOutputReference { + return new DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects huaweicloud_cnad_advanced_protected_objects} +*/ +export class DataHuaweicloudCnadAdvancedProtectedObjects extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cnad_advanced_protected_objects"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCnadAdvancedProtectedObjects resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCnadAdvancedProtectedObjects to import + * @param importFromId The id of the existing DataHuaweicloudCnadAdvancedProtectedObjects that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCnadAdvancedProtectedObjects to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cnad_advanced_protected_objects", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cnad_advanced_protected_objects huaweicloud_cnad_advanced_protected_objects} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCnadAdvancedProtectedObjectsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCnadAdvancedProtectedObjectsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cnad_advanced_protected_objects', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._ipAddress = config.ipAddress; + this._isUnbound = config.isUnbound; + this._policyId = config.policyId; + this._protectedObjectId = config.protectedObjectId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // is_unbound - computed: false, optional: true, required: false + private _isUnbound?: boolean | cdktf.IResolvable; + public get isUnbound() { + return this.getBooleanAttribute('is_unbound'); + } + public set isUnbound(value: boolean | cdktf.IResolvable) { + this._isUnbound = value; + } + public resetIsUnbound() { + this._isUnbound = undefined; + } + // Temporarily expose input value. Use with caution. + public get isUnboundInput() { + return this._isUnbound; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protected_object_id - computed: false, optional: true, required: false + private _protectedObjectId?: string; + public get protectedObjectId() { + return this.getStringAttribute('protected_object_id'); + } + public set protectedObjectId(value: string) { + this._protectedObjectId = value; + } + public resetProtectedObjectId() { + this._protectedObjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectedObjectIdInput() { + return this._protectedObjectId; + } + + // protected_objects - computed: true, optional: false, required: false + private _protectedObjects = new DataHuaweicloudCnadAdvancedProtectedObjectsProtectedObjectsList(this, "protected_objects", false); + public get protectedObjects() { + return this._protectedObjects; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + ip_address: cdktf.stringToTerraform(this._ipAddress), + is_unbound: cdktf.booleanToTerraform(this._isUnbound), + policy_id: cdktf.stringToTerraform(this._policyId), + protected_object_id: cdktf.stringToTerraform(this._protectedObjectId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_unbound: { + value: cdktf.booleanToHclTerraform(this._isUnbound), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected_object_id: { + value: cdktf.stringToHclTerraform(this._protectedObjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/README.md new file mode 100644 index 00000000..bc332f02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_compute_availability_zones_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_compute_availability_zones_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/index.ts new file mode 100644 index 00000000..a7b72fce --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-availability-zones-v2/index.ts @@ -0,0 +1,149 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudComputeAvailabilityZonesV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2#id DataHuaweicloudComputeAvailabilityZonesV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2#state DataHuaweicloudComputeAvailabilityZonesV2#state} + */ + readonly state?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2 huaweicloud_compute_availability_zones_v2} +*/ +export class DataHuaweicloudComputeAvailabilityZonesV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_availability_zones_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudComputeAvailabilityZonesV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudComputeAvailabilityZonesV2 to import + * @param importFromId The id of the existing DataHuaweicloudComputeAvailabilityZonesV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudComputeAvailabilityZonesV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_availability_zones_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_availability_zones_v2 huaweicloud_compute_availability_zones_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudComputeAvailabilityZonesV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudComputeAvailabilityZonesV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_availability_zones_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._state = config.state; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // names - computed: true, optional: false, required: false + public get names() { + return this.getListAttribute('names'); + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + state: cdktf.stringToTerraform(this._state), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/README.md new file mode 100644 index 00000000..cde4bc0b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_compute_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_compute_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/index.ts new file mode 100644 index 00000000..37599659 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-flavors/index.ts @@ -0,0 +1,423 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudComputeFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#availability_zone DataHuaweicloudComputeFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#cpu_core_count DataHuaweicloudComputeFlavors#cpu_core_count} + */ + readonly cpuCoreCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#generation DataHuaweicloudComputeFlavors#generation} + */ + readonly generation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#id DataHuaweicloudComputeFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#memory_size DataHuaweicloudComputeFlavors#memory_size} + */ + readonly memorySize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#performance_type DataHuaweicloudComputeFlavors#performance_type} + */ + readonly performanceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#region DataHuaweicloudComputeFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#storage_type DataHuaweicloudComputeFlavors#storage_type} + */ + readonly storageType?: string; +} +export interface DataHuaweicloudComputeFlavorsFlavors { +} + +export function dataHuaweicloudComputeFlavorsFlavorsToTerraform(struct?: DataHuaweicloudComputeFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudComputeFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cpu_core_count - computed: true, optional: false, required: false + public get cpuCoreCount() { + return this.getNumberAttribute('cpu_core_count'); + } + + // generation - computed: true, optional: false, required: false + public get generation() { + return this.getStringAttribute('generation'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory_size - computed: true, optional: false, required: false + public get memorySize() { + return this.getNumberAttribute('memory_size'); + } + + // performance_type - computed: true, optional: false, required: false + public get performanceType() { + return this.getStringAttribute('performance_type'); + } + + // storage_type - computed: true, optional: false, required: false + public get storageType() { + return this.getStringAttribute('storage_type'); + } +} + +export class DataHuaweicloudComputeFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeFlavorsFlavorsOutputReference { + return new DataHuaweicloudComputeFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors huaweicloud_compute_flavors} +*/ +export class DataHuaweicloudComputeFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudComputeFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudComputeFlavors to import + * @param importFromId The id of the existing DataHuaweicloudComputeFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudComputeFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_flavors huaweicloud_compute_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudComputeFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudComputeFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cpuCoreCount = config.cpuCoreCount; + this._generation = config.generation; + this._id = config.id; + this._memorySize = config.memorySize; + this._performanceType = config.performanceType; + this._region = config.region; + this._storageType = config.storageType; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cpu_core_count - computed: false, optional: true, required: false + private _cpuCoreCount?: number; + public get cpuCoreCount() { + return this.getNumberAttribute('cpu_core_count'); + } + public set cpuCoreCount(value: number) { + this._cpuCoreCount = value; + } + public resetCpuCoreCount() { + this._cpuCoreCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuCoreCountInput() { + return this._cpuCoreCount; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudComputeFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // generation - computed: false, optional: true, required: false + private _generation?: string; + public get generation() { + return this.getStringAttribute('generation'); + } + public set generation(value: string) { + this._generation = value; + } + public resetGeneration() { + this._generation = undefined; + } + // Temporarily expose input value. Use with caution. + public get generationInput() { + return this._generation; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // memory_size - computed: false, optional: true, required: false + private _memorySize?: number; + public get memorySize() { + return this.getNumberAttribute('memory_size'); + } + public set memorySize(value: number) { + this._memorySize = value; + } + public resetMemorySize() { + this._memorySize = undefined; + } + // Temporarily expose input value. Use with caution. + public get memorySizeInput() { + return this._memorySize; + } + + // performance_type - computed: false, optional: true, required: false + private _performanceType?: string; + public get performanceType() { + return this.getStringAttribute('performance_type'); + } + public set performanceType(value: string) { + this._performanceType = value; + } + public resetPerformanceType() { + this._performanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get performanceTypeInput() { + return this._performanceType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_type - computed: false, optional: true, required: false + private _storageType?: string; + public get storageType() { + return this.getStringAttribute('storage_type'); + } + public set storageType(value: string) { + this._storageType = value; + } + public resetStorageType() { + this._storageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageTypeInput() { + return this._storageType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cpu_core_count: cdktf.numberToTerraform(this._cpuCoreCount), + generation: cdktf.stringToTerraform(this._generation), + id: cdktf.stringToTerraform(this._id), + memory_size: cdktf.numberToTerraform(this._memorySize), + performance_type: cdktf.stringToTerraform(this._performanceType), + region: cdktf.stringToTerraform(this._region), + storage_type: cdktf.stringToTerraform(this._storageType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_core_count: { + value: cdktf.numberToHclTerraform(this._cpuCoreCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + generation: { + value: cdktf.stringToHclTerraform(this._generation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory_size: { + value: cdktf.numberToHclTerraform(this._memorySize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + performance_type: { + value: cdktf.stringToHclTerraform(this._performanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_type: { + value: cdktf.stringToHclTerraform(this._storageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/README.md new file mode 100644 index 00000000..8cc1f771 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_compute_instance_remote_console` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_compute_instance_remote_console`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/index.ts new file mode 100644 index 00000000..ca3dd046 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance-remote-console/index.ts @@ -0,0 +1,184 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudComputeInstanceRemoteConsoleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console#id DataHuaweicloudComputeInstanceRemoteConsole#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console#instance_id DataHuaweicloudComputeInstanceRemoteConsole#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console#region DataHuaweicloudComputeInstanceRemoteConsole#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console huaweicloud_compute_instance_remote_console} +*/ +export class DataHuaweicloudComputeInstanceRemoteConsole extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_instance_remote_console"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudComputeInstanceRemoteConsole resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudComputeInstanceRemoteConsole to import + * @param importFromId The id of the existing DataHuaweicloudComputeInstanceRemoteConsole that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudComputeInstanceRemoteConsole to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_instance_remote_console", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance_remote_console huaweicloud_compute_instance_remote_console} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudComputeInstanceRemoteConsoleConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudComputeInstanceRemoteConsoleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_instance_remote_console', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/README.md new file mode 100644 index 00000000..47d6f7a6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_compute_instance` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_compute_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/index.ts new file mode 100644 index 00000000..69cbeffb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instance/index.ts @@ -0,0 +1,665 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudComputeInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#enterprise_project_id DataHuaweicloudComputeInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#fixed_ip_v4 DataHuaweicloudComputeInstance#fixed_ip_v4} + */ + readonly fixedIpV4?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#flavor_id DataHuaweicloudComputeInstance#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#id DataHuaweicloudComputeInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#instance_id DataHuaweicloudComputeInstance#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#name DataHuaweicloudComputeInstance#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#region DataHuaweicloudComputeInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#tags DataHuaweicloudComputeInstance#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudComputeInstanceNetwork { +} + +export function dataHuaweicloudComputeInstanceNetworkToTerraform(struct?: DataHuaweicloudComputeInstanceNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstanceNetworkToHclTerraform(struct?: DataHuaweicloudComputeInstanceNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstanceNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstanceNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstanceNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // fixed_ip_v4 - computed: true, optional: false, required: false + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + + // fixed_ip_v6 - computed: true, optional: false, required: false + public get fixedIpV6() { + return this.getStringAttribute('fixed_ip_v6'); + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // uuid - computed: true, optional: false, required: false + public get uuid() { + return this.getStringAttribute('uuid'); + } +} + +export class DataHuaweicloudComputeInstanceNetworkList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstanceNetworkOutputReference { + return new DataHuaweicloudComputeInstanceNetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudComputeInstanceSchedulerHints { +} + +export function dataHuaweicloudComputeInstanceSchedulerHintsToTerraform(struct?: DataHuaweicloudComputeInstanceSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstanceSchedulerHintsToHclTerraform(struct?: DataHuaweicloudComputeInstanceSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstanceSchedulerHintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstanceSchedulerHints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstanceSchedulerHints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // group - computed: true, optional: false, required: false + public get group() { + return this.getStringAttribute('group'); + } +} + +export class DataHuaweicloudComputeInstanceSchedulerHintsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstanceSchedulerHintsOutputReference { + return new DataHuaweicloudComputeInstanceSchedulerHintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudComputeInstanceVolumeAttached { +} + +export function dataHuaweicloudComputeInstanceVolumeAttachedToTerraform(struct?: DataHuaweicloudComputeInstanceVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstanceVolumeAttachedToHclTerraform(struct?: DataHuaweicloudComputeInstanceVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstanceVolumeAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstanceVolumeAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstanceVolumeAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getNumberAttribute('boot_index'); + } + + // is_sys_volume - computed: true, optional: false, required: false + public get isSysVolume() { + return this.getBooleanAttribute('is_sys_volume'); + } + + // pci_address - computed: true, optional: false, required: false + public get pciAddress() { + return this.getStringAttribute('pci_address'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudComputeInstanceVolumeAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstanceVolumeAttachedOutputReference { + return new DataHuaweicloudComputeInstanceVolumeAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance huaweicloud_compute_instance} +*/ +export class DataHuaweicloudComputeInstance extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudComputeInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudComputeInstance to import + * @param importFromId The id of the existing DataHuaweicloudComputeInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudComputeInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instance huaweicloud_compute_instance} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudComputeInstanceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudComputeInstanceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._fixedIpV4 = config.fixedIpV4; + this._flavorId = config.flavorId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_time - computed: true, optional: false, required: false + public get expiredTime() { + return this.getStringAttribute('expired_time'); + } + + // fixed_ip_v4 - computed: false, optional: true, required: false + private _fixedIpV4?: string; + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + public set fixedIpV4(value: string) { + this._fixedIpV4 = value; + } + public resetFixedIpV4() { + this._fixedIpV4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV4Input() { + return this._fixedIpV4; + } + + // flavor_id - computed: true, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network - computed: true, optional: false, required: false + private _network = new DataHuaweicloudComputeInstanceNetworkList(this, "network", false); + public get network() { + return this._network; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scheduler_hints - computed: true, optional: false, required: false + private _schedulerHints = new DataHuaweicloudComputeInstanceSchedulerHintsList(this, "scheduler_hints", false); + public get schedulerHints() { + return this._schedulerHints; + } + + // security_group_ids - computed: true, optional: false, required: false + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + + // security_groups - computed: true, optional: false, required: false + public get securityGroups() { + return this.getListAttribute('security_groups'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // system_disk_id - computed: true, optional: false, required: false + public get systemDiskId() { + return this.getStringAttribute('system_disk_id'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } + + // volume_attached - computed: true, optional: false, required: false + private _volumeAttached = new DataHuaweicloudComputeInstanceVolumeAttachedList(this, "volume_attached", false); + public get volumeAttached() { + return this._volumeAttached; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fixed_ip_v4: cdktf.stringToTerraform(this._fixedIpV4), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip_v4: { + value: cdktf.stringToHclTerraform(this._fixedIpV4), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/README.md new file mode 100644 index 00000000..dd1b8c9a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_compute_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_compute_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/index.ts new file mode 100644 index 00000000..835dd665 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-instances/index.ts @@ -0,0 +1,902 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudComputeInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#availability_zone DataHuaweicloudComputeInstances#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#enterprise_project_id DataHuaweicloudComputeInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#fixed_ip_v4 DataHuaweicloudComputeInstances#fixed_ip_v4} + */ + readonly fixedIpV4?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#flavor_id DataHuaweicloudComputeInstances#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#flavor_name DataHuaweicloudComputeInstances#flavor_name} + */ + readonly flavorName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#id DataHuaweicloudComputeInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#image_id DataHuaweicloudComputeInstances#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#instance_id DataHuaweicloudComputeInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#key_pair DataHuaweicloudComputeInstances#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#name DataHuaweicloudComputeInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#region DataHuaweicloudComputeInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#status DataHuaweicloudComputeInstances#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#tags DataHuaweicloudComputeInstances#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudComputeInstancesInstancesNetwork { +} + +export function dataHuaweicloudComputeInstancesInstancesNetworkToTerraform(struct?: DataHuaweicloudComputeInstancesInstancesNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstancesInstancesNetworkToHclTerraform(struct?: DataHuaweicloudComputeInstancesInstancesNetwork): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstancesInstancesNetworkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstancesInstancesNetwork | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstancesInstancesNetwork | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // fixed_ip_v4 - computed: true, optional: false, required: false + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + + // fixed_ip_v6 - computed: true, optional: false, required: false + public get fixedIpV6() { + return this.getStringAttribute('fixed_ip_v6'); + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // uuid - computed: true, optional: false, required: false + public get uuid() { + return this.getStringAttribute('uuid'); + } +} + +export class DataHuaweicloudComputeInstancesInstancesNetworkList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstancesInstancesNetworkOutputReference { + return new DataHuaweicloudComputeInstancesInstancesNetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudComputeInstancesInstancesSchedulerHints { +} + +export function dataHuaweicloudComputeInstancesInstancesSchedulerHintsToTerraform(struct?: DataHuaweicloudComputeInstancesInstancesSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstancesInstancesSchedulerHintsToHclTerraform(struct?: DataHuaweicloudComputeInstancesInstancesSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstancesInstancesSchedulerHintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstancesInstancesSchedulerHints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstancesInstancesSchedulerHints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // group - computed: true, optional: false, required: false + public get group() { + return this.getStringAttribute('group'); + } +} + +export class DataHuaweicloudComputeInstancesInstancesSchedulerHintsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstancesInstancesSchedulerHintsOutputReference { + return new DataHuaweicloudComputeInstancesInstancesSchedulerHintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudComputeInstancesInstancesVolumeAttached { +} + +export function dataHuaweicloudComputeInstancesInstancesVolumeAttachedToTerraform(struct?: DataHuaweicloudComputeInstancesInstancesVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstancesInstancesVolumeAttachedToHclTerraform(struct?: DataHuaweicloudComputeInstancesInstancesVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstancesInstancesVolumeAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstancesInstancesVolumeAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstancesInstancesVolumeAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getNumberAttribute('boot_index'); + } + + // is_sys_volume - computed: true, optional: false, required: false + public get isSysVolume() { + return this.getBooleanAttribute('is_sys_volume'); + } + + // pci_address - computed: true, optional: false, required: false + public get pciAddress() { + return this.getStringAttribute('pci_address'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudComputeInstancesInstancesVolumeAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstancesInstancesVolumeAttachedOutputReference { + return new DataHuaweicloudComputeInstancesInstancesVolumeAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudComputeInstancesInstances { +} + +export function dataHuaweicloudComputeInstancesInstancesToTerraform(struct?: DataHuaweicloudComputeInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeInstancesInstancesToHclTerraform(struct?: DataHuaweicloudComputeInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expired_time - computed: true, optional: false, required: false + public get expiredTime() { + return this.getStringAttribute('expired_time'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network - computed: true, optional: false, required: false + private _network = new DataHuaweicloudComputeInstancesInstancesNetworkList(this, "network", false); + public get network() { + return this._network; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // scheduler_hints - computed: true, optional: false, required: false + private _schedulerHints = new DataHuaweicloudComputeInstancesInstancesSchedulerHintsList(this, "scheduler_hints", false); + public get schedulerHints() { + return this._schedulerHints; + } + + // security_group_ids - computed: true, optional: false, required: false + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // system_disk_id - computed: true, optional: false, required: false + public get systemDiskId() { + return this.getStringAttribute('system_disk_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } + + // volume_attached - computed: true, optional: false, required: false + private _volumeAttached = new DataHuaweicloudComputeInstancesInstancesVolumeAttachedList(this, "volume_attached", false); + public get volumeAttached() { + return this._volumeAttached; + } +} + +export class DataHuaweicloudComputeInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeInstancesInstancesOutputReference { + return new DataHuaweicloudComputeInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances huaweicloud_compute_instances} +*/ +export class DataHuaweicloudComputeInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudComputeInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudComputeInstances to import + * @param importFromId The id of the existing DataHuaweicloudComputeInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudComputeInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_instances huaweicloud_compute_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudComputeInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudComputeInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fixedIpV4 = config.fixedIpV4; + this._flavorId = config.flavorId; + this._flavorName = config.flavorName; + this._id = config.id; + this._imageId = config.imageId; + this._instanceId = config.instanceId; + this._keyPair = config.keyPair; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fixed_ip_v4 - computed: false, optional: true, required: false + private _fixedIpV4?: string; + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + public set fixedIpV4(value: string) { + this._fixedIpV4 = value; + } + public resetFixedIpV4() { + this._fixedIpV4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV4Input() { + return this._fixedIpV4; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: false, optional: true, required: false + private _flavorName?: string; + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + public set flavorName(value: string) { + this._flavorName = value; + } + public resetFlavorName() { + this._flavorName = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorNameInput() { + return this._flavorName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudComputeInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fixed_ip_v4: cdktf.stringToTerraform(this._fixedIpV4), + flavor_id: cdktf.stringToTerraform(this._flavorId), + flavor_name: cdktf.stringToTerraform(this._flavorName), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + instance_id: cdktf.stringToTerraform(this._instanceId), + key_pair: cdktf.stringToTerraform(this._keyPair), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip_v4: { + value: cdktf.stringToHclTerraform(this._fixedIpV4), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_name: { + value: cdktf.stringToHclTerraform(this._flavorName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/README.md new file mode 100644 index 00000000..0a728127 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_compute_servergroups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_compute_servergroups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/index.ts new file mode 100644 index 00000000..3dfe5c5d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-compute-servergroups/index.ts @@ -0,0 +1,268 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudComputeServergroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups#id DataHuaweicloudComputeServergroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups#name DataHuaweicloudComputeServergroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups#region DataHuaweicloudComputeServergroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudComputeServergroupsServergroups { +} + +export function dataHuaweicloudComputeServergroupsServergroupsToTerraform(struct?: DataHuaweicloudComputeServergroupsServergroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudComputeServergroupsServergroupsToHclTerraform(struct?: DataHuaweicloudComputeServergroupsServergroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudComputeServergroupsServergroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudComputeServergroupsServergroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudComputeServergroupsServergroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // members - computed: true, optional: false, required: false + public get members() { + return this.getListAttribute('members'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policies - computed: true, optional: false, required: false + public get policies() { + return this.getListAttribute('policies'); + } +} + +export class DataHuaweicloudComputeServergroupsServergroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudComputeServergroupsServergroupsOutputReference { + return new DataHuaweicloudComputeServergroupsServergroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups huaweicloud_compute_servergroups} +*/ +export class DataHuaweicloudComputeServergroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_compute_servergroups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudComputeServergroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudComputeServergroups to import + * @param importFromId The id of the existing DataHuaweicloudComputeServergroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudComputeServergroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_compute_servergroups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/compute_servergroups huaweicloud_compute_servergroups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudComputeServergroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudComputeServergroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_compute_servergroups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // servergroups - computed: true, optional: false, required: false + private _servergroups = new DataHuaweicloudComputeServergroupsServergroupsList(this, "servergroups", false); + public get servergroups() { + return this._servergroups; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/README.md new file mode 100644 index 00000000..8e684990 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_encode_servers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_encode_servers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/index.ts new file mode 100644 index 00000000..99de3886 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-encode-servers/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphEncodeServersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers#id DataHuaweicloudCphEncodeServers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers#region DataHuaweicloudCphEncodeServers#region} + */ + readonly region?: string; + /** + * Specifies the CPH server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers#server_id DataHuaweicloudCphEncodeServers#server_id} + */ + readonly serverId?: string; + /** + * Specifies the encode server status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers#status DataHuaweicloudCphEncodeServers#status} + */ + readonly status?: string; + /** + * Specifies the encode server type. The valid value can be **0** (server), **1** (container). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers#type DataHuaweicloudCphEncodeServers#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCphEncodeServersEncodeServersAccessInfos { +} + +export function dataHuaweicloudCphEncodeServersEncodeServersAccessInfosToTerraform(struct?: DataHuaweicloudCphEncodeServersEncodeServersAccessInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphEncodeServersEncodeServersAccessInfosToHclTerraform(struct?: DataHuaweicloudCphEncodeServersEncodeServersAccessInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphEncodeServersEncodeServersAccessInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphEncodeServersEncodeServersAccessInfos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphEncodeServersEncodeServersAccessInfos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_port - computed: true, optional: false, required: false + public get accessPort() { + return this.getNumberAttribute('access_port'); + } + + // listen_port - computed: true, optional: false, required: false + public get listenPort() { + return this.getNumberAttribute('listen_port'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // server_ip - computed: true, optional: false, required: false + public get serverIp() { + return this.getStringAttribute('server_ip'); + } + + // server_ipv6 - computed: true, optional: false, required: false + public get serverIpv6() { + return this.getStringAttribute('server_ipv6'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCphEncodeServersEncodeServersAccessInfosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphEncodeServersEncodeServersAccessInfosOutputReference { + return new DataHuaweicloudCphEncodeServersEncodeServersAccessInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCphEncodeServersEncodeServers { +} + +export function dataHuaweicloudCphEncodeServersEncodeServersToTerraform(struct?: DataHuaweicloudCphEncodeServersEncodeServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphEncodeServersEncodeServersToHclTerraform(struct?: DataHuaweicloudCphEncodeServersEncodeServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphEncodeServersEncodeServersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphEncodeServersEncodeServers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphEncodeServersEncodeServers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_infos - computed: true, optional: false, required: false + private _accessInfos = new DataHuaweicloudCphEncodeServersEncodeServersAccessInfosList(this, "access_infos", false); + public get accessInfos() { + return this._accessInfos; + } + + // encode_server_id - computed: true, optional: false, required: false + public get encodeServerId() { + return this.getStringAttribute('encode_server_id'); + } + + // encode_server_ip - computed: true, optional: false, required: false + public get encodeServerIp() { + return this.getStringAttribute('encode_server_ip'); + } + + // encode_server_ipv6 - computed: true, optional: false, required: false + public get encodeServerIpv6() { + return this.getStringAttribute('encode_server_ipv6'); + } + + // encode_server_name - computed: true, optional: false, required: false + public get encodeServerName() { + return this.getStringAttribute('encode_server_name'); + } + + // keypair_name - computed: true, optional: false, required: false + public get keypairName() { + return this.getStringAttribute('keypair_name'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudCphEncodeServersEncodeServersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphEncodeServersEncodeServersOutputReference { + return new DataHuaweicloudCphEncodeServersEncodeServersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers huaweicloud_cph_encode_servers} +*/ +export class DataHuaweicloudCphEncodeServers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_encode_servers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphEncodeServers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphEncodeServers to import + * @param importFromId The id of the existing DataHuaweicloudCphEncodeServers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphEncodeServers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_encode_servers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_encode_servers huaweicloud_cph_encode_servers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphEncodeServersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphEncodeServersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_encode_servers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._serverId = config.serverId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // encode_servers - computed: true, optional: false, required: false + private _encodeServers = new DataHuaweicloudCphEncodeServersEncodeServersList(this, "encode_servers", false); + public get encodeServers() { + return this._encodeServers; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/README.md new file mode 100644 index 00000000..0b67dba4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_phone_custom_images` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_phone_custom_images`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/index.ts new file mode 100644 index 00000000..b6f48483 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-custom-images/index.ts @@ -0,0 +1,487 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphPhoneCustomImagesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the image creation since time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#create_since DataHuaweicloudCphPhoneCustomImages#create_since} + */ + readonly createSince?: string; + /** + * Specifies the image creation until time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#create_until DataHuaweicloudCphPhoneCustomImages#create_until} + */ + readonly createUntil?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#id DataHuaweicloudCphPhoneCustomImages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the image ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#image_id DataHuaweicloudCphPhoneCustomImages#image_id} + */ + readonly imageId?: string; + /** + * Specifies the image name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#name DataHuaweicloudCphPhoneCustomImages#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#region DataHuaweicloudCphPhoneCustomImages#region} + */ + readonly region?: string; + /** + * Specifies the project ID of the share image account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#src_project_id DataHuaweicloudCphPhoneCustomImages#src_project_id} + */ + readonly srcProjectId?: string; + /** + * Specifies the image status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#status DataHuaweicloudCphPhoneCustomImages#status} + */ + readonly status?: string; + /** + * Specifies the image type. The valid value can be **public**, **private** or **share**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#type DataHuaweicloudCphPhoneCustomImages#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCphPhoneCustomImagesImages { +} + +export function dataHuaweicloudCphPhoneCustomImagesImagesToTerraform(struct?: DataHuaweicloudCphPhoneCustomImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphPhoneCustomImagesImagesToHclTerraform(struct?: DataHuaweicloudCphPhoneCustomImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphPhoneCustomImagesImagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphPhoneCustomImagesImages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphPhoneCustomImagesImages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // src_project_id - computed: true, optional: false, required: false + public get srcProjectId() { + return this.getStringAttribute('src_project_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCphPhoneCustomImagesImagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphPhoneCustomImagesImagesOutputReference { + return new DataHuaweicloudCphPhoneCustomImagesImagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images huaweicloud_cph_phone_custom_images} +*/ +export class DataHuaweicloudCphPhoneCustomImages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_custom_images"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphPhoneCustomImages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphPhoneCustomImages to import + * @param importFromId The id of the existing DataHuaweicloudCphPhoneCustomImages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphPhoneCustomImages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_custom_images", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_custom_images huaweicloud_cph_phone_custom_images} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphPhoneCustomImagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphPhoneCustomImagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_custom_images', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._createSince = config.createSince; + this._createUntil = config.createUntil; + this._id = config.id; + this._imageId = config.imageId; + this._name = config.name; + this._region = config.region; + this._srcProjectId = config.srcProjectId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_since - computed: false, optional: true, required: false + private _createSince?: string; + public get createSince() { + return this.getStringAttribute('create_since'); + } + public set createSince(value: string) { + this._createSince = value; + } + public resetCreateSince() { + this._createSince = undefined; + } + // Temporarily expose input value. Use with caution. + public get createSinceInput() { + return this._createSince; + } + + // create_until - computed: false, optional: true, required: false + private _createUntil?: string; + public get createUntil() { + return this.getStringAttribute('create_until'); + } + public set createUntil(value: string) { + this._createUntil = value; + } + public resetCreateUntil() { + this._createUntil = undefined; + } + // Temporarily expose input value. Use with caution. + public get createUntilInput() { + return this._createUntil; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // images - computed: true, optional: false, required: false + private _images = new DataHuaweicloudCphPhoneCustomImagesImagesList(this, "images", false); + public get images() { + return this._images; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // src_project_id - computed: false, optional: true, required: false + private _srcProjectId?: string; + public get srcProjectId() { + return this.getStringAttribute('src_project_id'); + } + public set srcProjectId(value: string) { + this._srcProjectId = value; + } + public resetSrcProjectId() { + this._srcProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcProjectIdInput() { + return this._srcProjectId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + create_since: cdktf.stringToTerraform(this._createSince), + create_until: cdktf.stringToTerraform(this._createUntil), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + src_project_id: cdktf.stringToTerraform(this._srcProjectId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + create_since: { + value: cdktf.stringToHclTerraform(this._createSince), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + create_until: { + value: cdktf.stringToHclTerraform(this._createUntil), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_project_id: { + value: cdktf.stringToHclTerraform(this._srcProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/README.md new file mode 100644 index 00000000..0d996b03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_phone_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_phone_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/index.ts new file mode 100644 index 00000000..25ad1182 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-flavors/index.ts @@ -0,0 +1,430 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphPhoneFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#id DataHuaweicloudCphPhoneFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ram of the CPH phone in MB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#memory DataHuaweicloudCphPhoneFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#region DataHuaweicloudCphPhoneFlavors#region} + */ + readonly region?: string; + /** + * The CPH server flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#server_flavor_id DataHuaweicloudCphPhoneFlavors#server_flavor_id} + */ + readonly serverFlavorId?: string; + /** + * The flavor status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#status DataHuaweicloudCphPhoneFlavors#status} + */ + readonly status?: string; + /** + * The cloud phone type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#type DataHuaweicloudCphPhoneFlavors#type} + */ + readonly type?: string; + /** + * The vcpus of the CPH phone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#vcpus DataHuaweicloudCphPhoneFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudCphPhoneFlavorsFlavors { +} + +export function dataHuaweicloudCphPhoneFlavorsFlavorsToTerraform(struct?: DataHuaweicloudCphPhoneFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphPhoneFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudCphPhoneFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphPhoneFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphPhoneFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphPhoneFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getNumberAttribute('disk'); + } + + // extend_spec - computed: true, optional: false, required: false + public get extendSpec() { + return this.getStringAttribute('extend_spec'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // image_label - computed: true, optional: false, required: false + public get imageLabel() { + return this.getStringAttribute('image_label'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // phone_capacity - computed: true, optional: false, required: false + public get phoneCapacity() { + return this.getNumberAttribute('phone_capacity'); + } + + // resolution - computed: true, optional: false, required: false + public get resolution() { + return this.getStringAttribute('resolution'); + } + + // server_flavor_id - computed: true, optional: false, required: false + public get serverFlavorId() { + return this.getStringAttribute('server_flavor_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudCphPhoneFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphPhoneFlavorsFlavorsOutputReference { + return new DataHuaweicloudCphPhoneFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors huaweicloud_cph_phone_flavors} +*/ +export class DataHuaweicloudCphPhoneFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphPhoneFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphPhoneFlavors to import + * @param importFromId The id of the existing DataHuaweicloudCphPhoneFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphPhoneFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_flavors huaweicloud_cph_phone_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphPhoneFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphPhoneFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._serverFlavorId = config.serverFlavorId; + this._status = config.status; + this._type = config.type; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCphPhoneFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_label - computed: true, optional: false, required: false + public get imageLabel() { + return this.getStringAttribute('image_label'); + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_flavor_id - computed: false, optional: true, required: false + private _serverFlavorId?: string; + public get serverFlavorId() { + return this.getStringAttribute('server_flavor_id'); + } + public set serverFlavorId(value: string) { + this._serverFlavorId = value; + } + public resetServerFlavorId() { + this._serverFlavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverFlavorIdInput() { + return this._serverFlavorId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + server_flavor_id: cdktf.stringToTerraform(this._serverFlavorId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_flavor_id: { + value: cdktf.stringToHclTerraform(this._serverFlavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/README.md new file mode 100644 index 00000000..676c6211 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_phone_images` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_phone_images`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/index.ts new file mode 100644 index 00000000..1341654b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phone-images/index.ts @@ -0,0 +1,310 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphPhoneImagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images#id DataHuaweicloudCphPhoneImages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The label of image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images#image_label DataHuaweicloudCphPhoneImages#image_label} + */ + readonly imageLabel?: string; + /** + * The image type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images#is_public DataHuaweicloudCphPhoneImages#is_public} + */ + readonly isPublic?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images#region DataHuaweicloudCphPhoneImages#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCphPhoneImagesImages { +} + +export function dataHuaweicloudCphPhoneImagesImagesToTerraform(struct?: DataHuaweicloudCphPhoneImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphPhoneImagesImagesToHclTerraform(struct?: DataHuaweicloudCphPhoneImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphPhoneImagesImagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphPhoneImagesImages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphPhoneImagesImages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_label - computed: true, optional: false, required: false + public get imageLabel() { + return this.getStringAttribute('image_label'); + } + + // is_public - computed: true, optional: false, required: false + public get isPublic() { + return this.getNumberAttribute('is_public'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os_name - computed: true, optional: false, required: false + public get osName() { + return this.getStringAttribute('os_name'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } +} + +export class DataHuaweicloudCphPhoneImagesImagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphPhoneImagesImagesOutputReference { + return new DataHuaweicloudCphPhoneImagesImagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images huaweicloud_cph_phone_images} +*/ +export class DataHuaweicloudCphPhoneImages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phone_images"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphPhoneImages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphPhoneImages to import + * @param importFromId The id of the existing DataHuaweicloudCphPhoneImages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphPhoneImages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phone_images", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phone_images huaweicloud_cph_phone_images} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphPhoneImagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphPhoneImagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phone_images', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._imageLabel = config.imageLabel; + this._isPublic = config.isPublic; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_label - computed: false, optional: true, required: false + private _imageLabel?: string; + public get imageLabel() { + return this.getStringAttribute('image_label'); + } + public set imageLabel(value: string) { + this._imageLabel = value; + } + public resetImageLabel() { + this._imageLabel = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageLabelInput() { + return this._imageLabel; + } + + // images - computed: true, optional: false, required: false + private _images = new DataHuaweicloudCphPhoneImagesImagesList(this, "images", false); + public get images() { + return this._images; + } + + // is_public - computed: false, optional: true, required: false + private _isPublic?: number; + public get isPublic() { + return this.getNumberAttribute('is_public'); + } + public set isPublic(value: number) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + image_label: cdktf.stringToTerraform(this._imageLabel), + is_public: cdktf.numberToTerraform(this._isPublic), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_label: { + value: cdktf.stringToHclTerraform(this._imageLabel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_public: { + value: cdktf.numberToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/README.md new file mode 100644 index 00000000..cf8b6d0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_phones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_phones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/index.ts new file mode 100644 index 00000000..cd85b3de --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-phones/index.ts @@ -0,0 +1,503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphPhonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#id DataHuaweicloudCphPhones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the cloud phone name and support fuzzy query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#phone_name DataHuaweicloudCphPhones#phone_name} + */ + readonly phoneName?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#region DataHuaweicloudCphPhones#region} + */ + readonly region?: string; + /** + * Specifies the cloud phone server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#server_id DataHuaweicloudCphPhones#server_id} + */ + readonly serverId?: string; + /** + * Specifies the cloud phone status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#status DataHuaweicloudCphPhones#status} + */ + readonly status?: number; + /** + * Specifies the cloud phone type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#type DataHuaweicloudCphPhones#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCphPhonesPhonesMetadata { +} + +export function dataHuaweicloudCphPhonesPhonesMetadataToTerraform(struct?: DataHuaweicloudCphPhonesPhonesMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphPhonesPhonesMetadataToHclTerraform(struct?: DataHuaweicloudCphPhonesPhonesMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphPhonesPhonesMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphPhonesPhonesMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphPhonesPhonesMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } +} + +export class DataHuaweicloudCphPhonesPhonesMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphPhonesPhonesMetadataOutputReference { + return new DataHuaweicloudCphPhonesPhonesMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCphPhonesPhones { +} + +export function dataHuaweicloudCphPhonesPhonesToTerraform(struct?: DataHuaweicloudCphPhonesPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphPhonesPhonesToHclTerraform(struct?: DataHuaweicloudCphPhonesPhones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphPhonesPhonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphPhonesPhones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphPhonesPhones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // image_version - computed: true, optional: false, required: false + public get imageVersion() { + return this.getStringAttribute('image_version'); + } + + // imei - computed: true, optional: false, required: false + public get imei() { + return this.getStringAttribute('imei'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new DataHuaweicloudCphPhonesPhonesMetadataList(this, "metadata", false); + public get metadata() { + return this._metadata; + } + + // phone_id - computed: true, optional: false, required: false + public get phoneId() { + return this.getStringAttribute('phone_id'); + } + + // phone_model_name - computed: true, optional: false, required: false + public get phoneModelName() { + return this.getStringAttribute('phone_model_name'); + } + + // phone_name - computed: true, optional: false, required: false + public get phoneName() { + return this.getStringAttribute('phone_name'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // traffic_type - computed: true, optional: false, required: false + public get trafficType() { + return this.getStringAttribute('traffic_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // vnc_enable - computed: true, optional: false, required: false + public get vncEnable() { + return this.getStringAttribute('vnc_enable'); + } + + // volume_mode - computed: true, optional: false, required: false + public get volumeMode() { + return this.getNumberAttribute('volume_mode'); + } +} + +export class DataHuaweicloudCphPhonesPhonesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphPhonesPhonesOutputReference { + return new DataHuaweicloudCphPhonesPhonesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones huaweicloud_cph_phones} +*/ +export class DataHuaweicloudCphPhones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_phones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphPhones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphPhones to import + * @param importFromId The id of the existing DataHuaweicloudCphPhones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphPhones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_phones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_phones huaweicloud_cph_phones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphPhonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphPhonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_phones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._phoneName = config.phoneName; + this._region = config.region; + this._serverId = config.serverId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // phone_name - computed: false, optional: true, required: false + private _phoneName?: string; + public get phoneName() { + return this.getStringAttribute('phone_name'); + } + public set phoneName(value: string) { + this._phoneName = value; + } + public resetPhoneName() { + this._phoneName = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneNameInput() { + return this._phoneName; + } + + // phones - computed: true, optional: false, required: false + private _phones = new DataHuaweicloudCphPhonesPhonesList(this, "phones", false); + public get phones() { + return this._phones; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + phone_name: cdktf.stringToTerraform(this._phoneName), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + status: cdktf.numberToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_name: { + value: cdktf.stringToHclTerraform(this._phoneName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/README.md new file mode 100644 index 00000000..49486a5c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_server_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_server_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/index.ts new file mode 100644 index 00000000..1bf89ee2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-bandwidths/index.ts @@ -0,0 +1,257 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphServerBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths#id DataHuaweicloudCphServerBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths#region DataHuaweicloudCphServerBandwidths#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCphServerBandwidthsBandwidths { +} + +export function dataHuaweicloudCphServerBandwidthsBandwidthsToTerraform(struct?: DataHuaweicloudCphServerBandwidthsBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphServerBandwidthsBandwidthsToHclTerraform(struct?: DataHuaweicloudCphServerBandwidthsBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphServerBandwidthsBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphServerBandwidthsBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphServerBandwidthsBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_charge_mode - computed: true, optional: false, required: false + public get bandwidthChargeMode() { + return this.getNumberAttribute('bandwidth_charge_mode'); + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // bandwidth_type - computed: true, optional: false, required: false + public get bandwidthType() { + return this.getNumberAttribute('bandwidth_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCphServerBandwidthsBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphServerBandwidthsBandwidthsOutputReference { + return new DataHuaweicloudCphServerBandwidthsBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths huaweicloud_cph_server_bandwidths} +*/ +export class DataHuaweicloudCphServerBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_server_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphServerBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphServerBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudCphServerBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphServerBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_server_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_bandwidths huaweicloud_cph_server_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphServerBandwidthsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphServerBandwidthsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_server_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidths - computed: true, optional: false, required: false + private _bandwidths = new DataHuaweicloudCphServerBandwidthsBandwidthsList(this, "bandwidths", false); + public get bandwidths() { + return this._bandwidths; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/README.md new file mode 100644 index 00000000..dd0a6bc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_server_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_server_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/index.ts new file mode 100644 index 00000000..2ebcfcfe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-server-flavors/index.ts @@ -0,0 +1,446 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphServerFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors#id DataHuaweicloudCphServerFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ram of the CPH server in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors#memory DataHuaweicloudCphServerFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors#region DataHuaweicloudCphServerFlavors#region} + */ + readonly region?: string; + /** + * The type of the CPH server flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors#type DataHuaweicloudCphServerFlavors#type} + */ + readonly type?: string; + /** + * The vcpus of the CPH server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors#vcpus DataHuaweicloudCphServerFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudCphServerFlavorsFlavorsExtendSpec { +} + +export function dataHuaweicloudCphServerFlavorsFlavorsExtendSpecToTerraform(struct?: DataHuaweicloudCphServerFlavorsFlavorsExtendSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphServerFlavorsFlavorsExtendSpecToHclTerraform(struct?: DataHuaweicloudCphServerFlavorsFlavorsExtendSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphServerFlavorsFlavorsExtendSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphServerFlavorsFlavorsExtendSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphServerFlavorsFlavorsExtendSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bms_flavor - computed: true, optional: false, required: false + public get bmsFlavor() { + return this.getStringAttribute('bms_flavor'); + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getStringAttribute('disk'); + } + + // gpu - computed: true, optional: false, required: false + public get gpu() { + return this.getStringAttribute('gpu'); + } + + // gpu_count - computed: true, optional: false, required: false + public get gpuCount() { + return this.getNumberAttribute('gpu_count'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // network_interface - computed: true, optional: false, required: false + public get networkInterface() { + return this.getStringAttribute('network_interface'); + } + + // numa_count - computed: true, optional: false, required: false + public get numaCount() { + return this.getNumberAttribute('numa_count'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudCphServerFlavorsFlavorsExtendSpecList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphServerFlavorsFlavorsExtendSpecOutputReference { + return new DataHuaweicloudCphServerFlavorsFlavorsExtendSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCphServerFlavorsFlavors { +} + +export function dataHuaweicloudCphServerFlavorsFlavorsToTerraform(struct?: DataHuaweicloudCphServerFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphServerFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudCphServerFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphServerFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphServerFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphServerFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // extend_spec - computed: true, optional: false, required: false + private _extendSpec = new DataHuaweicloudCphServerFlavorsFlavorsExtendSpecList(this, "extend_spec", false); + public get extendSpec() { + return this._extendSpec; + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudCphServerFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphServerFlavorsFlavorsOutputReference { + return new DataHuaweicloudCphServerFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors huaweicloud_cph_server_flavors} +*/ +export class DataHuaweicloudCphServerFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_server_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphServerFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphServerFlavors to import + * @param importFromId The id of the existing DataHuaweicloudCphServerFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphServerFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_server_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_server_flavors huaweicloud_cph_server_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphServerFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphServerFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_server_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._type = config.type; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCphServerFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/README.md new file mode 100644 index 00000000..b52d0894 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cph_servers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cph_servers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/index.ts new file mode 100644 index 00000000..04769d33 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cph-servers/index.ts @@ -0,0 +1,689 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCphServersConfig extends cdktf.TerraformMetaArguments { + /** + * The creation start time. For example, **2024-10-15 15:04:05**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#create_since DataHuaweicloudCphServers#create_since} + */ + readonly createSince?: string; + /** + * The creation end time. For example, **2024-10-15 15:04:05**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#create_until DataHuaweicloudCphServers#create_until} + */ + readonly createUntil?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#id DataHuaweicloudCphServers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the cloud phone server is a custom network identifier. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#network_version DataHuaweicloudCphServers#network_version} + */ + readonly networkVersion?: string; + /** + * Specifies the cloud phone flavor name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#phone_flavor DataHuaweicloudCphServers#phone_flavor} + */ + readonly phoneFlavor?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#region DataHuaweicloudCphServers#region} + */ + readonly region?: string; + /** + * Specifies the cloud phone server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#server_id DataHuaweicloudCphServers#server_id} + */ + readonly serverId?: string; + /** + * Specifies the cloud phone server name and support fuzzy query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#server_name DataHuaweicloudCphServers#server_name} + */ + readonly serverName?: string; + /** + * Specifies the server status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#status DataHuaweicloudCphServers#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCphServersServersAddresses { +} + +export function dataHuaweicloudCphServersServersAddressesToTerraform(struct?: DataHuaweicloudCphServersServersAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphServersServersAddressesToHclTerraform(struct?: DataHuaweicloudCphServersServersAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphServersServersAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphServersServersAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphServersServersAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // server_ip - computed: true, optional: false, required: false + public get serverIp() { + return this.getStringAttribute('server_ip'); + } +} + +export class DataHuaweicloudCphServersServersAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphServersServersAddressesOutputReference { + return new DataHuaweicloudCphServersServersAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCphServersServersMetadata { +} + +export function dataHuaweicloudCphServersServersMetadataToTerraform(struct?: DataHuaweicloudCphServersServersMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphServersServersMetadataToHclTerraform(struct?: DataHuaweicloudCphServersServersMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphServersServersMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphServersServersMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphServersServersMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } +} + +export class DataHuaweicloudCphServersServersMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphServersServersMetadataOutputReference { + return new DataHuaweicloudCphServersServersMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCphServersServers { +} + +export function dataHuaweicloudCphServersServersToTerraform(struct?: DataHuaweicloudCphServersServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCphServersServersToHclTerraform(struct?: DataHuaweicloudCphServersServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCphServersServersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCphServersServers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCphServersServers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // addresses - computed: true, optional: false, required: false + private _addresses = new DataHuaweicloudCphServersServersAddressesList(this, "addresses", false); + public get addresses() { + return this._addresses; + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // keypair_name - computed: true, optional: false, required: false + public get keypairName() { + return this.getStringAttribute('keypair_name'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new DataHuaweicloudCphServersServersMetadataList(this, "metadata", false); + public get metadata() { + return this._metadata; + } + + // network_version - computed: true, optional: false, required: false + public get networkVersion() { + return this.getStringAttribute('network_version'); + } + + // phone_flavor - computed: true, optional: false, required: false + public get phoneFlavor() { + return this.getStringAttribute('phone_flavor'); + } + + // resource_project_id - computed: true, optional: false, required: false + public get resourceProjectId() { + return this.getStringAttribute('resource_project_id'); + } + + // server_flavor - computed: true, optional: false, required: false + public get serverFlavor() { + return this.getStringAttribute('server_flavor'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // server_name - computed: true, optional: false, required: false + public get serverName() { + return this.getStringAttribute('server_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subnet_cidr - computed: true, optional: false, required: false + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // vpc_cidr - computed: true, optional: false, required: false + public get vpcCidr() { + return this.getStringAttribute('vpc_cidr'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudCphServersServersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCphServersServersOutputReference { + return new DataHuaweicloudCphServersServersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers huaweicloud_cph_servers} +*/ +export class DataHuaweicloudCphServers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cph_servers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCphServers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCphServers to import + * @param importFromId The id of the existing DataHuaweicloudCphServers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCphServers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cph_servers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cph_servers huaweicloud_cph_servers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCphServersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCphServersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cph_servers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._createSince = config.createSince; + this._createUntil = config.createUntil; + this._id = config.id; + this._networkVersion = config.networkVersion; + this._phoneFlavor = config.phoneFlavor; + this._region = config.region; + this._serverId = config.serverId; + this._serverName = config.serverName; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_since - computed: false, optional: true, required: false + private _createSince?: string; + public get createSince() { + return this.getStringAttribute('create_since'); + } + public set createSince(value: string) { + this._createSince = value; + } + public resetCreateSince() { + this._createSince = undefined; + } + // Temporarily expose input value. Use with caution. + public get createSinceInput() { + return this._createSince; + } + + // create_until - computed: false, optional: true, required: false + private _createUntil?: string; + public get createUntil() { + return this.getStringAttribute('create_until'); + } + public set createUntil(value: string) { + this._createUntil = value; + } + public resetCreateUntil() { + this._createUntil = undefined; + } + // Temporarily expose input value. Use with caution. + public get createUntilInput() { + return this._createUntil; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // network_version - computed: false, optional: true, required: false + private _networkVersion?: string; + public get networkVersion() { + return this.getStringAttribute('network_version'); + } + public set networkVersion(value: string) { + this._networkVersion = value; + } + public resetNetworkVersion() { + this._networkVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkVersionInput() { + return this._networkVersion; + } + + // phone_flavor - computed: false, optional: true, required: false + private _phoneFlavor?: string; + public get phoneFlavor() { + return this.getStringAttribute('phone_flavor'); + } + public set phoneFlavor(value: string) { + this._phoneFlavor = value; + } + public resetPhoneFlavor() { + this._phoneFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneFlavorInput() { + return this._phoneFlavor; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // server_name - computed: false, optional: true, required: false + private _serverName?: string; + public get serverName() { + return this.getStringAttribute('server_name'); + } + public set serverName(value: string) { + this._serverName = value; + } + public resetServerName() { + this._serverName = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverNameInput() { + return this._serverName; + } + + // servers - computed: true, optional: false, required: false + private _servers = new DataHuaweicloudCphServersServersList(this, "servers", false); + public get servers() { + return this._servers; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + create_since: cdktf.stringToTerraform(this._createSince), + create_until: cdktf.stringToTerraform(this._createUntil), + id: cdktf.stringToTerraform(this._id), + network_version: cdktf.stringToTerraform(this._networkVersion), + phone_flavor: cdktf.stringToTerraform(this._phoneFlavor), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + server_name: cdktf.stringToTerraform(this._serverName), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + create_since: { + value: cdktf.stringToHclTerraform(this._createSince), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + create_until: { + value: cdktf.stringToHclTerraform(this._createUntil), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_version: { + value: cdktf.stringToHclTerraform(this._networkVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_flavor: { + value: cdktf.stringToHclTerraform(this._phoneFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_name: { + value: cdktf.stringToHclTerraform(this._serverName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/README.md new file mode 100644 index 00000000..086a9936 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csbs_backup_policy_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csbs_backup_policy_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/index.ts new file mode 100644 index 00000000..f148c4d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy-v1/index.ts @@ -0,0 +1,443 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsbsBackupPolicyV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1#id DataHuaweicloudCsbsBackupPolicyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1#name DataHuaweicloudCsbsBackupPolicyV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1#region DataHuaweicloudCsbsBackupPolicyV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1#status DataHuaweicloudCsbsBackupPolicyV1#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCsbsBackupPolicyV1Resource { +} + +export function dataHuaweicloudCsbsBackupPolicyV1ResourceToTerraform(struct?: DataHuaweicloudCsbsBackupPolicyV1Resource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupPolicyV1ResourceToHclTerraform(struct?: DataHuaweicloudCsbsBackupPolicyV1Resource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupPolicyV1ResourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupPolicyV1Resource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupPolicyV1Resource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCsbsBackupPolicyV1ResourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupPolicyV1ResourceOutputReference { + return new DataHuaweicloudCsbsBackupPolicyV1ResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCsbsBackupPolicyV1ScheduledOperation { +} + +export function dataHuaweicloudCsbsBackupPolicyV1ScheduledOperationToTerraform(struct?: DataHuaweicloudCsbsBackupPolicyV1ScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupPolicyV1ScheduledOperationToHclTerraform(struct?: DataHuaweicloudCsbsBackupPolicyV1ScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupPolicyV1ScheduledOperationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupPolicyV1ScheduledOperation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupPolicyV1ScheduledOperation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_backups - computed: true, optional: false, required: false + public get maxBackups() { + return this.getNumberAttribute('max_backups'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operation_type - computed: true, optional: false, required: false + public get operationType() { + return this.getStringAttribute('operation_type'); + } + + // permanent - computed: true, optional: false, required: false + public get permanent() { + return this.getBooleanAttribute('permanent'); + } + + // retention_duration_days - computed: true, optional: false, required: false + public get retentionDurationDays() { + return this.getNumberAttribute('retention_duration_days'); + } + + // trigger_id - computed: true, optional: false, required: false + public get triggerId() { + return this.getStringAttribute('trigger_id'); + } + + // trigger_name - computed: true, optional: false, required: false + public get triggerName() { + return this.getStringAttribute('trigger_name'); + } + + // trigger_pattern - computed: true, optional: false, required: false + public get triggerPattern() { + return this.getStringAttribute('trigger_pattern'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudCsbsBackupPolicyV1ScheduledOperationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupPolicyV1ScheduledOperationOutputReference { + return new DataHuaweicloudCsbsBackupPolicyV1ScheduledOperationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1 huaweicloud_csbs_backup_policy_v1} +*/ +export class DataHuaweicloudCsbsBackupPolicyV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup_policy_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsbsBackupPolicyV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsbsBackupPolicyV1 to import + * @param importFromId The id of the existing DataHuaweicloudCsbsBackupPolicyV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsbsBackupPolicyV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup_policy_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy_v1 huaweicloud_csbs_backup_policy_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsbsBackupPolicyV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsbsBackupPolicyV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup_policy_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // common - computed: true, optional: false, required: false + private _common = new cdktf.StringMap(this, "common"); + public get common() { + return this._common; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_id - computed: true, optional: false, required: false + public get providerId() { + return this.getStringAttribute('provider_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource - computed: true, optional: false, required: false + private _resource = new DataHuaweicloudCsbsBackupPolicyV1ResourceList(this, "resource", true); + public get resource() { + return this._resource; + } + + // scheduled_operation - computed: true, optional: false, required: false + private _scheduledOperation = new DataHuaweicloudCsbsBackupPolicyV1ScheduledOperationList(this, "scheduled_operation", true); + public get scheduledOperation() { + return this._scheduledOperation; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/README.md new file mode 100644 index 00000000..b600acbd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csbs_backup_policy` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csbs_backup_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/index.ts new file mode 100644 index 00000000..71ef61d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-policy/index.ts @@ -0,0 +1,443 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsbsBackupPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy#id DataHuaweicloudCsbsBackupPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy#name DataHuaweicloudCsbsBackupPolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy#region DataHuaweicloudCsbsBackupPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy#status DataHuaweicloudCsbsBackupPolicy#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCsbsBackupPolicyResource { +} + +export function dataHuaweicloudCsbsBackupPolicyResourceToTerraform(struct?: DataHuaweicloudCsbsBackupPolicyResource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupPolicyResourceToHclTerraform(struct?: DataHuaweicloudCsbsBackupPolicyResource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupPolicyResourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupPolicyResource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupPolicyResource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCsbsBackupPolicyResourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupPolicyResourceOutputReference { + return new DataHuaweicloudCsbsBackupPolicyResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCsbsBackupPolicyScheduledOperation { +} + +export function dataHuaweicloudCsbsBackupPolicyScheduledOperationToTerraform(struct?: DataHuaweicloudCsbsBackupPolicyScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupPolicyScheduledOperationToHclTerraform(struct?: DataHuaweicloudCsbsBackupPolicyScheduledOperation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupPolicyScheduledOperationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupPolicyScheduledOperation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupPolicyScheduledOperation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_backups - computed: true, optional: false, required: false + public get maxBackups() { + return this.getNumberAttribute('max_backups'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operation_type - computed: true, optional: false, required: false + public get operationType() { + return this.getStringAttribute('operation_type'); + } + + // permanent - computed: true, optional: false, required: false + public get permanent() { + return this.getBooleanAttribute('permanent'); + } + + // retention_duration_days - computed: true, optional: false, required: false + public get retentionDurationDays() { + return this.getNumberAttribute('retention_duration_days'); + } + + // trigger_id - computed: true, optional: false, required: false + public get triggerId() { + return this.getStringAttribute('trigger_id'); + } + + // trigger_name - computed: true, optional: false, required: false + public get triggerName() { + return this.getStringAttribute('trigger_name'); + } + + // trigger_pattern - computed: true, optional: false, required: false + public get triggerPattern() { + return this.getStringAttribute('trigger_pattern'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudCsbsBackupPolicyScheduledOperationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupPolicyScheduledOperationOutputReference { + return new DataHuaweicloudCsbsBackupPolicyScheduledOperationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy huaweicloud_csbs_backup_policy} +*/ +export class DataHuaweicloudCsbsBackupPolicy extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsbsBackupPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsbsBackupPolicy to import + * @param importFromId The id of the existing DataHuaweicloudCsbsBackupPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsbsBackupPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_policy huaweicloud_csbs_backup_policy} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsbsBackupPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsbsBackupPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // common - computed: true, optional: false, required: false + private _common = new cdktf.StringMap(this, "common"); + public get common() { + return this._common; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_id - computed: true, optional: false, required: false + public get providerId() { + return this.getStringAttribute('provider_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource - computed: true, optional: false, required: false + private _resource = new DataHuaweicloudCsbsBackupPolicyResourceList(this, "resource", true); + public get resource() { + return this._resource; + } + + // scheduled_operation - computed: true, optional: false, required: false + private _scheduledOperation = new DataHuaweicloudCsbsBackupPolicyScheduledOperationList(this, "scheduled_operation", true); + public get scheduledOperation() { + return this._scheduledOperation; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/README.md new file mode 100644 index 00000000..221ec512 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csbs_backup_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csbs_backup_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/index.ts new file mode 100644 index 00000000..998ca279 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup-v1/index.ts @@ -0,0 +1,645 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsbsBackupV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#backup_name DataHuaweicloudCsbsBackupV1#backup_name} + */ + readonly backupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#backup_record_id DataHuaweicloudCsbsBackupV1#backup_record_id} + */ + readonly backupRecordId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#id DataHuaweicloudCsbsBackupV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#policy_id DataHuaweicloudCsbsBackupV1#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#region DataHuaweicloudCsbsBackupV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#resource_id DataHuaweicloudCsbsBackupV1#resource_id} + */ + readonly resourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#resource_name DataHuaweicloudCsbsBackupV1#resource_name} + */ + readonly resourceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#resource_type DataHuaweicloudCsbsBackupV1#resource_type} + */ + readonly resourceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#status DataHuaweicloudCsbsBackupV1#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#vm_ip DataHuaweicloudCsbsBackupV1#vm_ip} + */ + readonly vmIp?: string; +} +export interface DataHuaweicloudCsbsBackupV1VmMetadata { +} + +export function dataHuaweicloudCsbsBackupV1VmMetadataToTerraform(struct?: DataHuaweicloudCsbsBackupV1VmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupV1VmMetadataToHclTerraform(struct?: DataHuaweicloudCsbsBackupV1VmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupV1VmMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupV1VmMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupV1VmMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_service_type - computed: true, optional: false, required: false + public get cloudServiceType() { + return this.getStringAttribute('cloud_service_type'); + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getNumberAttribute('disk'); + } + + // eip - computed: true, optional: false, required: false + public get eip() { + return this.getStringAttribute('eip'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudCsbsBackupV1VmMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupV1VmMetadataOutputReference { + return new DataHuaweicloudCsbsBackupV1VmMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCsbsBackupV1VolumeBackups { +} + +export function dataHuaweicloudCsbsBackupV1VolumeBackupsToTerraform(struct?: DataHuaweicloudCsbsBackupV1VolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupV1VolumeBackupsToHclTerraform(struct?: DataHuaweicloudCsbsBackupV1VolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupV1VolumeBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupV1VolumeBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupV1VolumeBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // average_speed - computed: true, optional: false, required: false + public get averageSpeed() { + return this.getNumberAttribute('average_speed'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // incremental - computed: true, optional: false, required: false + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: false, required: false + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + + // source_volume_id - computed: true, optional: false, required: false + public get sourceVolumeId() { + return this.getStringAttribute('source_volume_id'); + } + + // source_volume_name - computed: true, optional: false, required: false + public get sourceVolumeName() { + return this.getStringAttribute('source_volume_name'); + } + + // source_volume_size - computed: true, optional: false, required: false + public get sourceVolumeSize() { + return this.getNumberAttribute('source_volume_size'); + } + + // space_saving_ratio - computed: true, optional: false, required: false + public get spaceSavingRatio() { + return this.getNumberAttribute('space_saving_ratio'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudCsbsBackupV1VolumeBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupV1VolumeBackupsOutputReference { + return new DataHuaweicloudCsbsBackupV1VolumeBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1 huaweicloud_csbs_backup_v1} +*/ +export class DataHuaweicloudCsbsBackupV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsbsBackupV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsbsBackupV1 to import + * @param importFromId The id of the existing DataHuaweicloudCsbsBackupV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsbsBackupV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup_v1 huaweicloud_csbs_backup_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsbsBackupV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsbsBackupV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupName = config.backupName; + this._backupRecordId = config.backupRecordId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceName = config.resourceName; + this._resourceType = config.resourceType; + this._status = config.status; + this._vmIp = config.vmIp; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // average_speed - computed: true, optional: false, required: false + public get averageSpeed() { + return this.getNumberAttribute('average_speed'); + } + + // backup_name - computed: true, optional: true, required: false + private _backupName?: string; + public get backupName() { + return this.getStringAttribute('backup_name'); + } + public set backupName(value: string) { + this._backupName = value; + } + public resetBackupName() { + this._backupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupNameInput() { + return this._backupName; + } + + // backup_record_id - computed: true, optional: true, required: false + private _backupRecordId?: string; + public get backupRecordId() { + return this.getStringAttribute('backup_record_id'); + } + public set backupRecordId(value: string) { + this._backupRecordId = value; + } + public resetBackupRecordId() { + this._backupRecordId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupRecordIdInput() { + return this._backupRecordId; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: true, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: true, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // resource_type - computed: true, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vm_ip - computed: false, optional: true, required: false + private _vmIp?: string; + public get vmIp() { + return this.getStringAttribute('vm_ip'); + } + public set vmIp(value: string) { + this._vmIp = value; + } + public resetVmIp() { + this._vmIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get vmIpInput() { + return this._vmIp; + } + + // vm_metadata - computed: true, optional: false, required: false + private _vmMetadata = new DataHuaweicloudCsbsBackupV1VmMetadataList(this, "vm_metadata", true); + public get vmMetadata() { + return this._vmMetadata; + } + + // volume_backups - computed: true, optional: false, required: false + private _volumeBackups = new DataHuaweicloudCsbsBackupV1VolumeBackupsList(this, "volume_backups", true); + public get volumeBackups() { + return this._volumeBackups; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_name: cdktf.stringToTerraform(this._backupName), + backup_record_id: cdktf.stringToTerraform(this._backupRecordId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_name: cdktf.stringToTerraform(this._resourceName), + resource_type: cdktf.stringToTerraform(this._resourceType), + status: cdktf.stringToTerraform(this._status), + vm_ip: cdktf.stringToTerraform(this._vmIp), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_name: { + value: cdktf.stringToHclTerraform(this._backupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_record_id: { + value: cdktf.stringToHclTerraform(this._backupRecordId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vm_ip: { + value: cdktf.stringToHclTerraform(this._vmIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/README.md new file mode 100644 index 00000000..aa100a47 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csbs_backup` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csbs_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/index.ts new file mode 100644 index 00000000..82e20f64 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csbs-backup/index.ts @@ -0,0 +1,645 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsbsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#backup_name DataHuaweicloudCsbsBackup#backup_name} + */ + readonly backupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#backup_record_id DataHuaweicloudCsbsBackup#backup_record_id} + */ + readonly backupRecordId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#id DataHuaweicloudCsbsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#policy_id DataHuaweicloudCsbsBackup#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#region DataHuaweicloudCsbsBackup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#resource_id DataHuaweicloudCsbsBackup#resource_id} + */ + readonly resourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#resource_name DataHuaweicloudCsbsBackup#resource_name} + */ + readonly resourceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#resource_type DataHuaweicloudCsbsBackup#resource_type} + */ + readonly resourceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#status DataHuaweicloudCsbsBackup#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#vm_ip DataHuaweicloudCsbsBackup#vm_ip} + */ + readonly vmIp?: string; +} +export interface DataHuaweicloudCsbsBackupVmMetadata { +} + +export function dataHuaweicloudCsbsBackupVmMetadataToTerraform(struct?: DataHuaweicloudCsbsBackupVmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupVmMetadataToHclTerraform(struct?: DataHuaweicloudCsbsBackupVmMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupVmMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupVmMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupVmMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cloud_service_type - computed: true, optional: false, required: false + public get cloudServiceType() { + return this.getStringAttribute('cloud_service_type'); + } + + // disk - computed: true, optional: false, required: false + public get disk() { + return this.getNumberAttribute('disk'); + } + + // eip - computed: true, optional: false, required: false + public get eip() { + return this.getStringAttribute('eip'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudCsbsBackupVmMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupVmMetadataOutputReference { + return new DataHuaweicloudCsbsBackupVmMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCsbsBackupVolumeBackups { +} + +export function dataHuaweicloudCsbsBackupVolumeBackupsToTerraform(struct?: DataHuaweicloudCsbsBackupVolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsbsBackupVolumeBackupsToHclTerraform(struct?: DataHuaweicloudCsbsBackupVolumeBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsbsBackupVolumeBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsbsBackupVolumeBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsbsBackupVolumeBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // average_speed - computed: true, optional: false, required: false + public get averageSpeed() { + return this.getNumberAttribute('average_speed'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // incremental - computed: true, optional: false, required: false + public get incremental() { + return this.getBooleanAttribute('incremental'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: false, required: false + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + + // source_volume_id - computed: true, optional: false, required: false + public get sourceVolumeId() { + return this.getStringAttribute('source_volume_id'); + } + + // source_volume_name - computed: true, optional: false, required: false + public get sourceVolumeName() { + return this.getStringAttribute('source_volume_name'); + } + + // source_volume_size - computed: true, optional: false, required: false + public get sourceVolumeSize() { + return this.getNumberAttribute('source_volume_size'); + } + + // space_saving_ratio - computed: true, optional: false, required: false + public get spaceSavingRatio() { + return this.getNumberAttribute('space_saving_ratio'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudCsbsBackupVolumeBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsbsBackupVolumeBackupsOutputReference { + return new DataHuaweicloudCsbsBackupVolumeBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup huaweicloud_csbs_backup} +*/ +export class DataHuaweicloudCsbsBackup extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csbs_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsbsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsbsBackup to import + * @param importFromId The id of the existing DataHuaweicloudCsbsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsbsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csbs_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csbs_backup huaweicloud_csbs_backup} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsbsBackupConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsbsBackupConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csbs_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupName = config.backupName; + this._backupRecordId = config.backupRecordId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceName = config.resourceName; + this._resourceType = config.resourceType; + this._status = config.status; + this._vmIp = config.vmIp; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_trigger - computed: true, optional: false, required: false + public get autoTrigger() { + return this.getBooleanAttribute('auto_trigger'); + } + + // average_speed - computed: true, optional: false, required: false + public get averageSpeed() { + return this.getNumberAttribute('average_speed'); + } + + // backup_name - computed: true, optional: true, required: false + private _backupName?: string; + public get backupName() { + return this.getStringAttribute('backup_name'); + } + public set backupName(value: string) { + this._backupName = value; + } + public resetBackupName() { + this._backupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupNameInput() { + return this._backupName; + } + + // backup_record_id - computed: true, optional: true, required: false + private _backupRecordId?: string; + public get backupRecordId() { + return this.getStringAttribute('backup_record_id'); + } + public set backupRecordId(value: string) { + this._backupRecordId = value; + } + public resetBackupRecordId() { + this._backupRecordId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupRecordIdInput() { + return this._backupRecordId; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: true, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: true, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // resource_type - computed: true, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vm_ip - computed: false, optional: true, required: false + private _vmIp?: string; + public get vmIp() { + return this.getStringAttribute('vm_ip'); + } + public set vmIp(value: string) { + this._vmIp = value; + } + public resetVmIp() { + this._vmIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get vmIpInput() { + return this._vmIp; + } + + // vm_metadata - computed: true, optional: false, required: false + private _vmMetadata = new DataHuaweicloudCsbsBackupVmMetadataList(this, "vm_metadata", true); + public get vmMetadata() { + return this._vmMetadata; + } + + // volume_backups - computed: true, optional: false, required: false + private _volumeBackups = new DataHuaweicloudCsbsBackupVolumeBackupsList(this, "volume_backups", true); + public get volumeBackups() { + return this._volumeBackups; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_name: cdktf.stringToTerraform(this._backupName), + backup_record_id: cdktf.stringToTerraform(this._backupRecordId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_name: cdktf.stringToTerraform(this._resourceName), + resource_type: cdktf.stringToTerraform(this._resourceType), + status: cdktf.stringToTerraform(this._status), + vm_ip: cdktf.stringToTerraform(this._vmIp), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_name: { + value: cdktf.stringToHclTerraform(this._backupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_record_id: { + value: cdktf.stringToHclTerraform(this._backupRecordId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vm_ip: { + value: cdktf.stringToHclTerraform(this._vmIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/README.md new file mode 100644 index 00000000..a745e88e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cse_microservice_engine_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cse_microservice_engine_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/index.ts new file mode 100644 index 00000000..c22456c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engine-flavors/index.ts @@ -0,0 +1,348 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCseMicroserviceEngineFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors#id DataHuaweicloudCseMicroserviceEngineFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the microservice engine flavors are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors#region DataHuaweicloudCseMicroserviceEngineFlavors#region} + */ + readonly region?: string; + /** + * The version that used to filter the microservice engine flavors. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors#version DataHuaweicloudCseMicroserviceEngineFlavors#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpec { +} + +export function dataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecToTerraform(struct?: DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecToHclTerraform(struct?: DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // available_cpu_memory - computed: true, optional: false, required: false + public get availableCpuMemory() { + return this.getStringAttribute('available_cpu_memory'); + } + + // available_prefix - computed: true, optional: false, required: false + public get availablePrefix() { + return this.getStringAttribute('available_prefix'); + } + + // linear - computed: true, optional: false, required: false + public get linear() { + return this.getStringAttribute('linear'); + } +} + +export class DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecOutputReference { + return new DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCseMicroserviceEngineFlavorsFlavors { +} + +export function dataHuaweicloudCseMicroserviceEngineFlavorsFlavorsToTerraform(struct?: DataHuaweicloudCseMicroserviceEngineFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCseMicroserviceEngineFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudCseMicroserviceEngineFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCseMicroserviceEngineFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCseMicroserviceEngineFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // spec - computed: true, optional: false, required: false + private _spec = new DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsSpecList(this, "spec", false); + public get spec() { + return this._spec; + } +} + +export class DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsOutputReference { + return new DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors huaweicloud_cse_microservice_engine_flavors} +*/ +export class DataHuaweicloudCseMicroserviceEngineFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cse_microservice_engine_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCseMicroserviceEngineFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCseMicroserviceEngineFlavors to import + * @param importFromId The id of the existing DataHuaweicloudCseMicroserviceEngineFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCseMicroserviceEngineFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cse_microservice_engine_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engine_flavors huaweicloud_cse_microservice_engine_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCseMicroserviceEngineFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCseMicroserviceEngineFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cse_microservice_engine_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCseMicroserviceEngineFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/README.md new file mode 100644 index 00000000..a890eb48 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cse_microservice_engines` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cse_microservice_engines`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/index.ts new file mode 100644 index 00000000..d1463700 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cse-microservice-engines/index.ts @@ -0,0 +1,470 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCseMicroserviceEnginesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines#id DataHuaweicloudCseMicroserviceEngines#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where dedicated microservice engines are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines#region DataHuaweicloudCseMicroserviceEngines#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddresses { +} + +export function dataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesToTerraform(struct?: DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesToHclTerraform(struct?: DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // private - computed: true, optional: false, required: false + public get private() { + return this.getStringAttribute('private'); + } + + // public - computed: true, optional: false, required: false + public get public() { + return this.getStringAttribute('public'); + } +} + +export class DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesOutputReference { + return new DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddresses { +} + +export function dataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesToTerraform(struct?: DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesToHclTerraform(struct?: DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // private - computed: true, optional: false, required: false + public get private() { + return this.getStringAttribute('private'); + } + + // public - computed: true, optional: false, required: false + public get public() { + return this.getStringAttribute('public'); + } +} + +export class DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesOutputReference { + return new DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCseMicroserviceEnginesEngines { +} + +export function dataHuaweicloudCseMicroserviceEnginesEnginesToTerraform(struct?: DataHuaweicloudCseMicroserviceEnginesEngines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCseMicroserviceEnginesEnginesToHclTerraform(struct?: DataHuaweicloudCseMicroserviceEnginesEngines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCseMicroserviceEnginesEnginesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCseMicroserviceEnginesEngines | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCseMicroserviceEnginesEngines | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auth_type - computed: true, optional: false, required: false + public get authType() { + return this.getStringAttribute('auth_type'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // config_center_addresses - computed: true, optional: false, required: false + private _configCenterAddresses = new DataHuaweicloudCseMicroserviceEnginesEnginesConfigCenterAddressesList(this, "config_center_addresses", false); + public get configCenterAddresses() { + return this._configCenterAddresses; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // eip_id - computed: true, optional: false, required: false + public get eipId() { + return this.getStringAttribute('eip_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // extend_params - computed: true, optional: false, required: false + private _extendParams = new cdktf.StringMap(this, "extend_params"); + public get extendParams() { + return this._extendParams; + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_limit - computed: true, optional: false, required: false + public get instanceLimit() { + return this.getNumberAttribute('instance_limit'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_id - computed: true, optional: false, required: false + public get networkId() { + return this.getStringAttribute('network_id'); + } + + // service_limit - computed: true, optional: false, required: false + public get serviceLimit() { + return this.getNumberAttribute('service_limit'); + } + + // service_registry_addresses - computed: true, optional: false, required: false + private _serviceRegistryAddresses = new DataHuaweicloudCseMicroserviceEnginesEnginesServiceRegistryAddressesList(this, "service_registry_addresses", false); + public get serviceRegistryAddresses() { + return this._serviceRegistryAddresses; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCseMicroserviceEnginesEnginesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCseMicroserviceEnginesEnginesOutputReference { + return new DataHuaweicloudCseMicroserviceEnginesEnginesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines huaweicloud_cse_microservice_engines} +*/ +export class DataHuaweicloudCseMicroserviceEngines extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cse_microservice_engines"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCseMicroserviceEngines resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCseMicroserviceEngines to import + * @param importFromId The id of the existing DataHuaweicloudCseMicroserviceEngines that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCseMicroserviceEngines to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cse_microservice_engines", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cse_microservice_engines huaweicloud_cse_microservice_engines} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCseMicroserviceEnginesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCseMicroserviceEnginesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cse_microservice_engines', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // engines - computed: true, optional: false, required: false + private _engines = new DataHuaweicloudCseMicroserviceEnginesEnginesList(this, "engines", false); + public get engines() { + return this._engines; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/README.md new file mode 100644 index 00000000..bde20628 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csms_events` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csms_events`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/index.ts new file mode 100644 index 00000000..d5f4efe1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-events/index.ts @@ -0,0 +1,425 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsmsEventsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events#event_id DataHuaweicloudCsmsEvents#event_id} + */ + readonly eventId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events#id DataHuaweicloudCsmsEvents#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events#name DataHuaweicloudCsmsEvents#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events#region DataHuaweicloudCsmsEvents#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events#status DataHuaweicloudCsmsEvents#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCsmsEventsEventsNotification { +} + +export function dataHuaweicloudCsmsEventsEventsNotificationToTerraform(struct?: DataHuaweicloudCsmsEventsEventsNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsmsEventsEventsNotificationToHclTerraform(struct?: DataHuaweicloudCsmsEventsEventsNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsmsEventsEventsNotificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsmsEventsEventsNotification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsmsEventsEventsNotification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // target_id - computed: true, optional: false, required: false + public get targetId() { + return this.getStringAttribute('target_id'); + } + + // target_name - computed: true, optional: false, required: false + public get targetName() { + return this.getStringAttribute('target_name'); + } + + // target_type - computed: true, optional: false, required: false + public get targetType() { + return this.getStringAttribute('target_type'); + } +} + +export class DataHuaweicloudCsmsEventsEventsNotificationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsmsEventsEventsNotificationOutputReference { + return new DataHuaweicloudCsmsEventsEventsNotificationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCsmsEventsEvents { +} + +export function dataHuaweicloudCsmsEventsEventsToTerraform(struct?: DataHuaweicloudCsmsEventsEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsmsEventsEventsToHclTerraform(struct?: DataHuaweicloudCsmsEventsEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsmsEventsEventsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsmsEventsEvents | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsmsEventsEvents | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // event_id - computed: true, optional: false, required: false + public get eventId() { + return this.getStringAttribute('event_id'); + } + + // event_types - computed: true, optional: false, required: false + public get eventTypes() { + return this.getListAttribute('event_types'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // notification - computed: true, optional: false, required: false + private _notification = new DataHuaweicloudCsmsEventsEventsNotificationList(this, "notification", false); + public get notification() { + return this._notification; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCsmsEventsEventsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsmsEventsEventsOutputReference { + return new DataHuaweicloudCsmsEventsEventsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events huaweicloud_csms_events} +*/ +export class DataHuaweicloudCsmsEvents extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_events"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsmsEvents resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsmsEvents to import + * @param importFromId The id of the existing DataHuaweicloudCsmsEvents that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsmsEvents to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_events", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_events huaweicloud_csms_events} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsmsEventsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsmsEventsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_events', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._eventId = config.eventId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // event_id - computed: false, optional: true, required: false + private _eventId?: string; + public get eventId() { + return this.getStringAttribute('event_id'); + } + public set eventId(value: string) { + this._eventId = value; + } + public resetEventId() { + this._eventId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventIdInput() { + return this._eventId; + } + + // events - computed: true, optional: false, required: false + private _events = new DataHuaweicloudCsmsEventsEventsList(this, "events", false); + public get events() { + return this._events; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + event_id: cdktf.stringToTerraform(this._eventId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + event_id: { + value: cdktf.stringToHclTerraform(this._eventId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/README.md new file mode 100644 index 00000000..8b5153ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csms_secret_version` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csms_secret_version`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/index.ts new file mode 100644 index 00000000..0099e97f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-version/index.ts @@ -0,0 +1,217 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsmsSecretVersionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version#id DataHuaweicloudCsmsSecretVersion#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version#region DataHuaweicloudCsmsSecretVersion#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version#secret_name DataHuaweicloudCsmsSecretVersion#secret_name} + */ + readonly secretName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version#version DataHuaweicloudCsmsSecretVersion#version} + */ + readonly version?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version huaweicloud_csms_secret_version} +*/ +export class DataHuaweicloudCsmsSecretVersion extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_secret_version"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsmsSecretVersion resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsmsSecretVersion to import + * @param importFromId The id of the existing DataHuaweicloudCsmsSecretVersion that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsmsSecretVersion to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_secret_version", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_version huaweicloud_csms_secret_version} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsmsSecretVersionConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsmsSecretVersionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_secret_version', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._secretName = config.secretName; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_name - computed: false, optional: false, required: true + private _secretName?: string; + public get secretName() { + return this.getStringAttribute('secret_name'); + } + public set secretName(value: string) { + this._secretName = value; + } + // Temporarily expose input value. Use with caution. + public get secretNameInput() { + return this._secretName; + } + + // secret_text - computed: true, optional: false, required: false + public get secretText() { + return this.getStringAttribute('secret_text'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getListAttribute('status'); + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + secret_name: cdktf.stringToTerraform(this._secretName), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_name: { + value: cdktf.stringToHclTerraform(this._secretName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/README.md new file mode 100644 index 00000000..96109d66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csms_secret_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csms_secret_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/index.ts new file mode 100644 index 00000000..945db8f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secret-versions/index.ts @@ -0,0 +1,279 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsmsSecretVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions#id DataHuaweicloudCsmsSecretVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions#region DataHuaweicloudCsmsSecretVersions#region} + */ + readonly region?: string; + /** + * Specifies the secret name to which the versions belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions#secret_name DataHuaweicloudCsmsSecretVersions#secret_name} + */ + readonly secretName: string; +} +export interface DataHuaweicloudCsmsSecretVersionsVersions { +} + +export function dataHuaweicloudCsmsSecretVersionsVersionsToTerraform(struct?: DataHuaweicloudCsmsSecretVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsmsSecretVersionsVersionsToHclTerraform(struct?: DataHuaweicloudCsmsSecretVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsmsSecretVersionsVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsmsSecretVersionsVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsmsSecretVersionsVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // secret_name - computed: true, optional: false, required: false + public get secretName() { + return this.getStringAttribute('secret_name'); + } + + // version_stages - computed: true, optional: false, required: false + public get versionStages() { + return this.getListAttribute('version_stages'); + } +} + +export class DataHuaweicloudCsmsSecretVersionsVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsmsSecretVersionsVersionsOutputReference { + return new DataHuaweicloudCsmsSecretVersionsVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions huaweicloud_csms_secret_versions} +*/ +export class DataHuaweicloudCsmsSecretVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_secret_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsmsSecretVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsmsSecretVersions to import + * @param importFromId The id of the existing DataHuaweicloudCsmsSecretVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsmsSecretVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_secret_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secret_versions huaweicloud_csms_secret_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsmsSecretVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsmsSecretVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_secret_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._secretName = config.secretName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_name - computed: false, optional: false, required: true + private _secretName?: string; + public get secretName() { + return this.getStringAttribute('secret_name'); + } + public set secretName(value: string) { + this._secretName = value; + } + // Temporarily expose input value. Use with caution. + public get secretNameInput() { + return this._secretName; + } + + // versions - computed: true, optional: false, required: false + private _versions = new DataHuaweicloudCsmsSecretVersionsVersionsList(this, "versions", false); + public get versions() { + return this._versions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + secret_name: cdktf.stringToTerraform(this._secretName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_name: { + value: cdktf.stringToHclTerraform(this._secretName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/README.md new file mode 100644 index 00000000..6df65bb6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_csms_secrets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_csms_secrets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/index.ts new file mode 100644 index 00000000..dd14b01d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-csms-secrets/index.ts @@ -0,0 +1,440 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCsmsSecretsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#enterprise_project_id DataHuaweicloudCsmsSecrets#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#event_name DataHuaweicloudCsmsSecrets#event_name} + */ + readonly eventName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#id DataHuaweicloudCsmsSecrets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#name DataHuaweicloudCsmsSecrets#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#region DataHuaweicloudCsmsSecrets#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#secret_id DataHuaweicloudCsmsSecrets#secret_id} + */ + readonly secretId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#status DataHuaweicloudCsmsSecrets#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCsmsSecretsSecrets { +} + +export function dataHuaweicloudCsmsSecretsSecretsToTerraform(struct?: DataHuaweicloudCsmsSecretsSecrets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCsmsSecretsSecretsToHclTerraform(struct?: DataHuaweicloudCsmsSecretsSecrets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCsmsSecretsSecretsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCsmsSecretsSecrets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCsmsSecretsSecrets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_rotation - computed: true, optional: false, required: false + public get autoRotation() { + return this.getBooleanAttribute('auto_rotation'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // event_subscriptions - computed: true, optional: false, required: false + public get eventSubscriptions() { + return this.getListAttribute('event_subscriptions'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // kms_key_id - computed: true, optional: false, required: false + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // next_rotation_at - computed: true, optional: false, required: false + public get nextRotationAt() { + return this.getStringAttribute('next_rotation_at'); + } + + // rotation_at - computed: true, optional: false, required: false + public get rotationAt() { + return this.getStringAttribute('rotation_at'); + } + + // rotation_config - computed: true, optional: false, required: false + public get rotationConfig() { + return this.getStringAttribute('rotation_config'); + } + + // rotation_period - computed: true, optional: false, required: false + public get rotationPeriod() { + return this.getStringAttribute('rotation_period'); + } + + // scheduled_deleted_at - computed: true, optional: false, required: false + public get scheduledDeletedAt() { + return this.getStringAttribute('scheduled_deleted_at'); + } + + // secret_type - computed: true, optional: false, required: false + public get secretType() { + return this.getStringAttribute('secret_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCsmsSecretsSecretsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCsmsSecretsSecretsOutputReference { + return new DataHuaweicloudCsmsSecretsSecretsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets huaweicloud_csms_secrets} +*/ +export class DataHuaweicloudCsmsSecrets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_csms_secrets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCsmsSecrets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCsmsSecrets to import + * @param importFromId The id of the existing DataHuaweicloudCsmsSecrets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCsmsSecrets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_csms_secrets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/csms_secrets huaweicloud_csms_secrets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCsmsSecretsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCsmsSecretsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_csms_secrets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._eventName = config.eventName; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._secretId = config.secretId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // event_name - computed: false, optional: true, required: false + private _eventName?: string; + public get eventName() { + return this.getStringAttribute('event_name'); + } + public set eventName(value: string) { + this._eventName = value; + } + public resetEventName() { + this._eventName = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventNameInput() { + return this._eventName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_id - computed: false, optional: true, required: false + private _secretId?: string; + public get secretId() { + return this.getStringAttribute('secret_id'); + } + public set secretId(value: string) { + this._secretId = value; + } + public resetSecretId() { + this._secretId = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretIdInput() { + return this._secretId; + } + + // secrets - computed: true, optional: false, required: false + private _secrets = new DataHuaweicloudCsmsSecretsSecretsList(this, "secrets", false); + public get secrets() { + return this._secrets; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + event_name: cdktf.stringToTerraform(this._eventName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secret_id: cdktf.stringToTerraform(this._secretId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_name: { + value: cdktf.stringToHclTerraform(this._eventName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_id: { + value: cdktf.stringToHclTerraform(this._secretId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/README.md new file mode 100644 index 00000000..bc634e0e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_cluster_tags` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_cluster_tags`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/index.ts new file mode 100644 index 00000000..eda219b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-cluster-tags/index.ts @@ -0,0 +1,179 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssClusterTagsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags#id DataHuaweicloudCssClusterTags#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags#region DataHuaweicloudCssClusterTags#region} + */ + readonly region?: string; + /** + * Specifies the resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags#resource_type DataHuaweicloudCssClusterTags#resource_type} + */ + readonly resourceType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags huaweicloud_css_cluster_tags} +*/ +export class DataHuaweicloudCssClusterTags extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_cluster_tags"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssClusterTags resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssClusterTags to import + * @param importFromId The id of the existing DataHuaweicloudCssClusterTags that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssClusterTags to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_cluster_tags", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_cluster_tags huaweicloud_css_cluster_tags} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssClusterTagsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssClusterTagsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_cluster_tags', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._resourceType = config.resourceType; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_type: cdktf.stringToTerraform(this._resourceType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/README.md new file mode 100644 index 00000000..7afed92f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_clusters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_clusters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/index.ts new file mode 100644 index 00000000..5d73f6b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-clusters/index.ts @@ -0,0 +1,983 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssClustersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#cluster_id DataHuaweicloudCssClusters#cluster_id} + */ + readonly clusterId?: string; + /** + * Specifies the engine type. The values can be **elasticsearch** and **logstash**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#engine_type DataHuaweicloudCssClusters#engine_type} + */ + readonly engineType?: string; + /** + * Specifies the engine version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#engine_version DataHuaweicloudCssClusters#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#id DataHuaweicloudCssClusters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the cluster name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#name DataHuaweicloudCssClusters#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#region DataHuaweicloudCssClusters#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCssClustersClustersDatastore { +} + +export function dataHuaweicloudCssClustersClustersDatastoreToTerraform(struct?: DataHuaweicloudCssClustersClustersDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersDatastoreToHclTerraform(struct?: DataHuaweicloudCssClustersClustersDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClustersDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClustersDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCssClustersClustersDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersDatastoreOutputReference { + return new DataHuaweicloudCssClustersClustersDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssClustersClustersElbWhiteListStruct { +} + +export function dataHuaweicloudCssClustersClustersElbWhiteListStructToTerraform(struct?: DataHuaweicloudCssClustersClustersElbWhiteListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersElbWhiteListStructToHclTerraform(struct?: DataHuaweicloudCssClustersClustersElbWhiteListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersElbWhiteListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClustersElbWhiteListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClustersElbWhiteListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enable_white_list - computed: true, optional: false, required: false + public get enableWhiteList() { + return this.getBooleanAttribute('enable_white_list'); + } + + // white_list - computed: true, optional: false, required: false + public get whiteList() { + return this.getStringAttribute('white_list'); + } +} + +export class DataHuaweicloudCssClustersClustersElbWhiteListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersElbWhiteListStructOutputReference { + return new DataHuaweicloudCssClustersClustersElbWhiteListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssClustersClustersInstancesVolume { +} + +export function dataHuaweicloudCssClustersClustersInstancesVolumeToTerraform(struct?: DataHuaweicloudCssClustersClustersInstancesVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersInstancesVolumeToHclTerraform(struct?: DataHuaweicloudCssClustersClustersInstancesVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersInstancesVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClustersInstancesVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClustersInstancesVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCssClustersClustersInstancesVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersInstancesVolumeOutputReference { + return new DataHuaweicloudCssClustersClustersInstancesVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssClustersClustersInstances { +} + +export function dataHuaweicloudCssClustersClustersInstancesToTerraform(struct?: DataHuaweicloudCssClustersClustersInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersInstancesToHclTerraform(struct?: DataHuaweicloudCssClustersClustersInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClustersInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClustersInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume - computed: true, optional: false, required: false + private _volume = new DataHuaweicloudCssClustersClustersInstancesVolumeList(this, "volume", false); + public get volume() { + return this._volume; + } +} + +export class DataHuaweicloudCssClustersClustersInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersInstancesOutputReference { + return new DataHuaweicloudCssClustersClustersInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListResp { +} + +export function dataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespToTerraform(struct?: DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListResp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespToHclTerraform(struct?: DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListResp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListResp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListResp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enable_white_list - computed: true, optional: false, required: false + public get enableWhiteList() { + return this.getBooleanAttribute('enable_white_list'); + } + + // white_list - computed: true, optional: false, required: false + public get whiteList() { + return this.getStringAttribute('white_list'); + } +} + +export class DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespOutputReference { + return new DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssClustersClustersPublicKibanaResp { +} + +export function dataHuaweicloudCssClustersClustersPublicKibanaRespToTerraform(struct?: DataHuaweicloudCssClustersClustersPublicKibanaResp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersPublicKibanaRespToHclTerraform(struct?: DataHuaweicloudCssClustersClustersPublicKibanaResp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersPublicKibanaRespOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClustersPublicKibanaResp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClustersPublicKibanaResp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_resource_id - computed: true, optional: false, required: false + public get bandwidthResourceId() { + return this.getStringAttribute('bandwidth_resource_id'); + } + + // eip_size - computed: true, optional: false, required: false + public get eipSize() { + return this.getNumberAttribute('eip_size'); + } + + // elb_white_list_resp - computed: true, optional: false, required: false + private _elbWhiteListResp = new DataHuaweicloudCssClustersClustersPublicKibanaRespElbWhiteListRespList(this, "elb_white_list_resp", false); + public get elbWhiteListResp() { + return this._elbWhiteListResp; + } + + // public_kibana_ip - computed: true, optional: false, required: false + public get publicKibanaIp() { + return this.getStringAttribute('public_kibana_ip'); + } +} + +export class DataHuaweicloudCssClustersClustersPublicKibanaRespList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersPublicKibanaRespOutputReference { + return new DataHuaweicloudCssClustersClustersPublicKibanaRespOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssClustersClusters { +} + +export function dataHuaweicloudCssClustersClustersToTerraform(struct?: DataHuaweicloudCssClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssClustersClustersToHclTerraform(struct?: DataHuaweicloudCssClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssClustersClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssClustersClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssClustersClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // authority_enable - computed: true, optional: false, required: false + public get authorityEnable() { + return this.getBooleanAttribute('authority_enable'); + } + + // backup_available - computed: true, optional: false, required: false + public get backupAvailable() { + return this.getBooleanAttribute('backup_available'); + } + + // bandwidth_resource_id - computed: true, optional: false, required: false + public get bandwidthResourceId() { + return this.getStringAttribute('bandwidth_resource_id'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudCssClustersClustersDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // disk_encrypted - computed: true, optional: false, required: false + public get diskEncrypted() { + return this.getBooleanAttribute('disk_encrypted'); + } + + // elb_white_list - computed: true, optional: false, required: false + private _elbWhiteList = new DataHuaweicloudCssClustersClustersElbWhiteListStructList(this, "elb_white_list", false); + public get elbWhiteList() { + return this._elbWhiteList; + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // https_enable - computed: true, optional: false, required: false + public get httpsEnable() { + return this.getBooleanAttribute('https_enable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudCssClustersClustersInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getBooleanAttribute('period'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // public_kibana_resp - computed: true, optional: false, required: false + private _publicKibanaResp = new DataHuaweicloudCssClustersClustersPublicKibanaRespList(this, "public_kibana_resp", false); + public get publicKibanaResp() { + return this._publicKibanaResp; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudCssClustersClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssClustersClustersOutputReference { + return new DataHuaweicloudCssClustersClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters huaweicloud_css_clusters} +*/ +export class DataHuaweicloudCssClusters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_clusters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssClusters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssClusters to import + * @param importFromId The id of the existing DataHuaweicloudCssClusters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssClusters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_clusters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_clusters huaweicloud_css_clusters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssClustersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssClustersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_clusters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._engineType = config.engineType; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // clusters - computed: true, optional: false, required: false + private _clusters = new DataHuaweicloudCssClustersClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + + // engine_type - computed: false, optional: true, required: false + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + public resetEngineType() { + this._engineType = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + engine_type: cdktf.stringToTerraform(this._engineType), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/README.md new file mode 100644 index 00000000..1a2edba8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_elb_loadbalancers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_elb_loadbalancers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/index.ts new file mode 100644 index 00000000..c8f7ac56 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-elb-loadbalancers/index.ts @@ -0,0 +1,389 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssElbLoadbalancersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the CSS cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#cluster_id DataHuaweicloudCssElbLoadbalancers#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#id DataHuaweicloudCssElbLoadbalancers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether to enable cross-VPC backend. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#is_cross DataHuaweicloudCssElbLoadbalancers#is_cross} + */ + readonly isCross?: boolean | cdktf.IResolvable; + /** + * Specifies the ID of the loadbalancer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#loadbalancer_id DataHuaweicloudCssElbLoadbalancers#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Specifies the name of the loadbalancer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#name DataHuaweicloudCssElbLoadbalancers#name} + */ + readonly name?: string; + /** + * Specifies the layer 7 protocol ID of the loadbalancer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#protocol_id DataHuaweicloudCssElbLoadbalancers#protocol_id} + */ + readonly protocolId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#region DataHuaweicloudCssElbLoadbalancers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCssElbLoadbalancersLoadbalancers { +} + +export function dataHuaweicloudCssElbLoadbalancersLoadbalancersToTerraform(struct?: DataHuaweicloudCssElbLoadbalancersLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssElbLoadbalancersLoadbalancersToHclTerraform(struct?: DataHuaweicloudCssElbLoadbalancersLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssElbLoadbalancersLoadbalancersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssElbLoadbalancersLoadbalancers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssElbLoadbalancersLoadbalancers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_target_enable - computed: true, optional: false, required: false + public get ipTargetEnable() { + return this.getBooleanAttribute('ip_target_enable'); + } + + // l7_flavor_id - computed: true, optional: false, required: false + public get l7FlavorId() { + return this.getStringAttribute('l7_flavor_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCssElbLoadbalancersLoadbalancersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssElbLoadbalancersLoadbalancersOutputReference { + return new DataHuaweicloudCssElbLoadbalancersLoadbalancersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers huaweicloud_css_elb_loadbalancers} +*/ +export class DataHuaweicloudCssElbLoadbalancers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_elb_loadbalancers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssElbLoadbalancers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssElbLoadbalancers to import + * @param importFromId The id of the existing DataHuaweicloudCssElbLoadbalancers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssElbLoadbalancers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_elb_loadbalancers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_elb_loadbalancers huaweicloud_css_elb_loadbalancers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssElbLoadbalancersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssElbLoadbalancersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_elb_loadbalancers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._isCross = config.isCross; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protocolId = config.protocolId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_cross - computed: false, optional: true, required: false + private _isCross?: boolean | cdktf.IResolvable; + public get isCross() { + return this.getBooleanAttribute('is_cross'); + } + public set isCross(value: boolean | cdktf.IResolvable) { + this._isCross = value; + } + public resetIsCross() { + this._isCross = undefined; + } + // Temporarily expose input value. Use with caution. + public get isCrossInput() { + return this._isCross; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // loadbalancers - computed: true, optional: false, required: false + private _loadbalancers = new DataHuaweicloudCssElbLoadbalancersLoadbalancersList(this, "loadbalancers", false); + public get loadbalancers() { + return this._loadbalancers; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol_id - computed: false, optional: true, required: false + private _protocolId?: string; + public get protocolId() { + return this.getStringAttribute('protocol_id'); + } + public set protocolId(value: string) { + this._protocolId = value; + } + public resetProtocolId() { + this._protocolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolIdInput() { + return this._protocolId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + is_cross: cdktf.booleanToTerraform(this._isCross), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protocol_id: cdktf.stringToTerraform(this._protocolId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_cross: { + value: cdktf.booleanToHclTerraform(this._isCross), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_id: { + value: cdktf.stringToHclTerraform(this._protocolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/README.md new file mode 100644 index 00000000..23a0dcc1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/index.ts new file mode 100644 index 00000000..1d2e7dde --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-flavors/index.ts @@ -0,0 +1,405 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#id DataHuaweicloudCssFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#memory DataHuaweicloudCssFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#name DataHuaweicloudCssFlavors#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#region DataHuaweicloudCssFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#type DataHuaweicloudCssFlavors#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#vcpus DataHuaweicloudCssFlavors#vcpus} + */ + readonly vcpus?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#version DataHuaweicloudCssFlavors#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudCssFlavorsFlavors { +} + +export function dataHuaweicloudCssFlavorsFlavorsToTerraform(struct?: DataHuaweicloudCssFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudCssFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getStringAttribute('availability_zones'); + } + + // disk_range - computed: true, optional: false, required: false + public get diskRange() { + return this.getStringAttribute('disk_range'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCssFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssFlavorsFlavorsOutputReference { + return new DataHuaweicloudCssFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors huaweicloud_css_flavors} +*/ +export class DataHuaweicloudCssFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssFlavors to import + * @param importFromId The id of the existing DataHuaweicloudCssFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_flavors huaweicloud_css_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._memory = config.memory; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._vcpus = config.vcpus; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudCssFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vcpus: cdktf.numberToTerraform(this._vcpus), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/README.md new file mode 100644 index 00000000..3934dc54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_log_backup_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_log_backup_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/index.ts new file mode 100644 index 00000000..a6ce7441 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-log-backup-records/index.ts @@ -0,0 +1,379 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssLogBackupRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the CSS cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#cluster_id DataHuaweicloudCssLogBackupRecords#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#id DataHuaweicloudCssLogBackupRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the log backup job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#job_id DataHuaweicloudCssLogBackupRecords#job_id} + */ + readonly jobId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#region DataHuaweicloudCssLogBackupRecords#region} + */ + readonly region?: string; + /** + * Specifies the status of the log backup job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#status DataHuaweicloudCssLogBackupRecords#status} + */ + readonly status?: string; + /** + * Specifies the type of the log backup job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#type DataHuaweicloudCssLogBackupRecords#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCssLogBackupRecordsRecords { +} + +export function dataHuaweicloudCssLogBackupRecordsRecordsToTerraform(struct?: DataHuaweicloudCssLogBackupRecordsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogBackupRecordsRecordsToHclTerraform(struct?: DataHuaweicloudCssLogBackupRecordsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogBackupRecordsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogBackupRecordsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogBackupRecordsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // failed_msg - computed: true, optional: false, required: false + public get failedMsg() { + return this.getStringAttribute('failed_msg'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // log_path - computed: true, optional: false, required: false + public get logPath() { + return this.getStringAttribute('log_path'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCssLogBackupRecordsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogBackupRecordsRecordsOutputReference { + return new DataHuaweicloudCssLogBackupRecordsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records huaweicloud_css_log_backup_records} +*/ +export class DataHuaweicloudCssLogBackupRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_log_backup_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssLogBackupRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssLogBackupRecords to import + * @param importFromId The id of the existing DataHuaweicloudCssLogBackupRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssLogBackupRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_log_backup_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_log_backup_records huaweicloud_css_log_backup_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssLogBackupRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssLogBackupRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_log_backup_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._jobId = config.jobId; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: true, required: false + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + public resetJobId() { + this._jobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudCssLogBackupRecordsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/README.md new file mode 100644 index 00000000..1ce8c2ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_logstash_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_logstash_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/index.ts new file mode 100644 index 00000000..28051b9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-certificates/index.ts @@ -0,0 +1,364 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssLogstashCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the certificate type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#certs_type DataHuaweicloudCssLogstashCertificates#certs_type} + */ + readonly certsType?: string; + /** + * Specifies ID of the CSS logstash cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#cluster_id DataHuaweicloudCssLogstashCertificates#cluster_id} + */ + readonly clusterId: string; + /** + * Specifies the file name of the certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#file_name DataHuaweicloudCssLogstashCertificates#file_name} + */ + readonly fileName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#id DataHuaweicloudCssLogstashCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#region DataHuaweicloudCssLogstashCertificates#region} + */ + readonly region?: string; + /** + * Specifies the status of the certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#status DataHuaweicloudCssLogstashCertificates#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCssLogstashCertificatesCertificates { +} + +export function dataHuaweicloudCssLogstashCertificatesCertificatesToTerraform(struct?: DataHuaweicloudCssLogstashCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashCertificatesCertificatesToHclTerraform(struct?: DataHuaweicloudCssLogstashCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashCertificatesCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashCertificatesCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashCertificatesCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_location - computed: true, optional: false, required: false + public get fileLocation() { + return this.getStringAttribute('file_location'); + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCssLogstashCertificatesCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashCertificatesCertificatesOutputReference { + return new DataHuaweicloudCssLogstashCertificatesCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates huaweicloud_css_logstash_certificates} +*/ +export class DataHuaweicloudCssLogstashCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssLogstashCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssLogstashCertificates to import + * @param importFromId The id of the existing DataHuaweicloudCssLogstashCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssLogstashCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_certificates huaweicloud_css_logstash_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssLogstashCertificatesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssLogstashCertificatesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certsType = config.certsType; + this._clusterId = config.clusterId; + this._fileName = config.fileName; + this._id = config.id; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificates - computed: true, optional: false, required: false + private _certificates = new DataHuaweicloudCssLogstashCertificatesCertificatesList(this, "certificates", false); + public get certificates() { + return this._certificates; + } + + // certs_type - computed: false, optional: true, required: false + private _certsType?: string; + public get certsType() { + return this.getStringAttribute('certs_type'); + } + public set certsType(value: string) { + this._certsType = value; + } + public resetCertsType() { + this._certsType = undefined; + } + // Temporarily expose input value. Use with caution. + public get certsTypeInput() { + return this._certsType; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // file_name - computed: false, optional: true, required: false + private _fileName?: string; + public get fileName() { + return this.getStringAttribute('file_name'); + } + public set fileName(value: string) { + this._fileName = value; + } + public resetFileName() { + this._fileName = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNameInput() { + return this._fileName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certs_type: cdktf.stringToTerraform(this._certsType), + cluster_id: cdktf.stringToTerraform(this._clusterId), + file_name: cdktf.stringToTerraform(this._fileName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certs_type: { + value: cdktf.stringToHclTerraform(this._certsType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_name: { + value: cdktf.stringToHclTerraform(this._fileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/README.md new file mode 100644 index 00000000..c26f7d18 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_logstash_configurations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_logstash_configurations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/index.ts new file mode 100644 index 00000000..04323833 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-configurations/index.ts @@ -0,0 +1,435 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssLogstashConfigurationsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies ID of the CSS logstash cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations#cluster_id DataHuaweicloudCssLogstashConfigurations#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations#id DataHuaweicloudCssLogstashConfigurations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the configuration file name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations#name DataHuaweicloudCssLogstashConfigurations#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations#region DataHuaweicloudCssLogstashConfigurations#region} + */ + readonly region?: string; + /** + * Specifies the configuration file content check status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations#status DataHuaweicloudCssLogstashConfigurations#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudCssLogstashConfigurationsConfsSetting { +} + +export function dataHuaweicloudCssLogstashConfigurationsConfsSettingToTerraform(struct?: DataHuaweicloudCssLogstashConfigurationsConfsSetting): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashConfigurationsConfsSettingToHclTerraform(struct?: DataHuaweicloudCssLogstashConfigurationsConfsSetting): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashConfigurationsConfsSettingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashConfigurationsConfsSetting | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashConfigurationsConfsSetting | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // batch_delay_ms - computed: true, optional: false, required: false + public get batchDelayMs() { + return this.getNumberAttribute('batch_delay_ms'); + } + + // batch_size - computed: true, optional: false, required: false + public get batchSize() { + return this.getNumberAttribute('batch_size'); + } + + // queue_check_point_writes - computed: true, optional: false, required: false + public get queueCheckPointWrites() { + return this.getNumberAttribute('queue_check_point_writes'); + } + + // queue_max_bytes_mb - computed: true, optional: false, required: false + public get queueMaxBytesMb() { + return this.getNumberAttribute('queue_max_bytes_mb'); + } + + // queue_type - computed: true, optional: false, required: false + public get queueType() { + return this.getStringAttribute('queue_type'); + } + + // workers - computed: true, optional: false, required: false + public get workers() { + return this.getNumberAttribute('workers'); + } +} + +export class DataHuaweicloudCssLogstashConfigurationsConfsSettingList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashConfigurationsConfsSettingOutputReference { + return new DataHuaweicloudCssLogstashConfigurationsConfsSettingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssLogstashConfigurationsConfs { +} + +export function dataHuaweicloudCssLogstashConfigurationsConfsToTerraform(struct?: DataHuaweicloudCssLogstashConfigurationsConfs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashConfigurationsConfsToHclTerraform(struct?: DataHuaweicloudCssLogstashConfigurationsConfs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashConfigurationsConfsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashConfigurationsConfs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashConfigurationsConfs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conf_content - computed: true, optional: false, required: false + public get confContent() { + return this.getStringAttribute('conf_content'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // setting - computed: true, optional: false, required: false + private _setting = new DataHuaweicloudCssLogstashConfigurationsConfsSettingList(this, "setting", false); + public get setting() { + return this._setting; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCssLogstashConfigurationsConfsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashConfigurationsConfsOutputReference { + return new DataHuaweicloudCssLogstashConfigurationsConfsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations huaweicloud_css_logstash_configurations} +*/ +export class DataHuaweicloudCssLogstashConfigurations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_configurations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssLogstashConfigurations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssLogstashConfigurations to import + * @param importFromId The id of the existing DataHuaweicloudCssLogstashConfigurations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssLogstashConfigurations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_configurations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_configurations huaweicloud_css_logstash_configurations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssLogstashConfigurationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssLogstashConfigurationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_configurations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // confs - computed: true, optional: false, required: false + private _confs = new DataHuaweicloudCssLogstashConfigurationsConfsList(this, "confs", false); + public get confs() { + return this._confs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/README.md new file mode 100644 index 00000000..13573e62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_logstash_pipeline_actions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_logstash_pipeline_actions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/index.ts new file mode 100644 index 00000000..ba544789 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipeline-actions/index.ts @@ -0,0 +1,374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssLogstashPipelineActionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#action_id DataHuaweicloudCssLogstashPipelineActions#action_id} + */ + readonly actionId?: string; + /** + * Specifies the ID of the CSS logstash cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#cluster_id DataHuaweicloudCssLogstashPipelineActions#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#id DataHuaweicloudCssLogstashPipelineActions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#region DataHuaweicloudCssLogstashPipelineActions#region} + */ + readonly region?: string; + /** + * Specifies the status of the action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#status DataHuaweicloudCssLogstashPipelineActions#status} + */ + readonly status?: string; + /** + * Specifies the type of the action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#type DataHuaweicloudCssLogstashPipelineActions#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCssLogstashPipelineActionsActions { +} + +export function dataHuaweicloudCssLogstashPipelineActionsActionsToTerraform(struct?: DataHuaweicloudCssLogstashPipelineActionsActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashPipelineActionsActionsToHclTerraform(struct?: DataHuaweicloudCssLogstashPipelineActionsActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashPipelineActionsActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashPipelineActionsActions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashPipelineActionsActions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conf_content - computed: true, optional: false, required: false + public get confContent() { + return this.getStringAttribute('conf_content'); + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudCssLogstashPipelineActionsActionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashPipelineActionsActionsOutputReference { + return new DataHuaweicloudCssLogstashPipelineActionsActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions huaweicloud_css_logstash_pipeline_actions} +*/ +export class DataHuaweicloudCssLogstashPipelineActions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_pipeline_actions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssLogstashPipelineActions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssLogstashPipelineActions to import + * @param importFromId The id of the existing DataHuaweicloudCssLogstashPipelineActions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssLogstashPipelineActions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_pipeline_actions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipeline_actions huaweicloud_css_logstash_pipeline_actions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssLogstashPipelineActionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssLogstashPipelineActionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_pipeline_actions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionId = config.actionId; + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_id - computed: false, optional: true, required: false + private _actionId?: string; + public get actionId() { + return this.getStringAttribute('action_id'); + } + public set actionId(value: string) { + this._actionId = value; + } + public resetActionId() { + this._actionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionIdInput() { + return this._actionId; + } + + // actions - computed: true, optional: false, required: false + private _actions = new DataHuaweicloudCssLogstashPipelineActionsActionsList(this, "actions", false); + public get actions() { + return this._actions; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_id: cdktf.stringToTerraform(this._actionId), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_id: { + value: cdktf.stringToHclTerraform(this._actionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/README.md new file mode 100644 index 00000000..2fded089 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_logstash_pipelines` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_logstash_pipelines`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/index.ts new file mode 100644 index 00000000..4ad535ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-pipelines/index.ts @@ -0,0 +1,305 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssLogstashPipelinesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies ID of the CSS logstash cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines#cluster_id DataHuaweicloudCssLogstashPipelines#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines#id DataHuaweicloudCssLogstashPipelines#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the configuration file names of the CSS logstash cluster pipeline. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines#name DataHuaweicloudCssLogstashPipelines#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines#region DataHuaweicloudCssLogstashPipelines#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCssLogstashPipelinesPipelines { +} + +export function dataHuaweicloudCssLogstashPipelinesPipelinesToTerraform(struct?: DataHuaweicloudCssLogstashPipelinesPipelines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashPipelinesPipelinesToHclTerraform(struct?: DataHuaweicloudCssLogstashPipelinesPipelines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashPipelinesPipelinesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashPipelinesPipelines | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashPipelinesPipelines | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // events - computed: true, optional: false, required: false + private _events = new cdktf.StringMap(this, "events"); + public get events() { + return this._events; + } + + // keep_alive - computed: true, optional: false, required: false + public get keepAlive() { + return this.getBooleanAttribute('keep_alive'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } +} + +export class DataHuaweicloudCssLogstashPipelinesPipelinesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashPipelinesPipelinesOutputReference { + return new DataHuaweicloudCssLogstashPipelinesPipelinesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines huaweicloud_css_logstash_pipelines} +*/ +export class DataHuaweicloudCssLogstashPipelines extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_pipelines"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssLogstashPipelines resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssLogstashPipelines to import + * @param importFromId The id of the existing DataHuaweicloudCssLogstashPipelines that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssLogstashPipelines to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_pipelines", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_pipelines huaweicloud_css_logstash_pipelines} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssLogstashPipelinesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssLogstashPipelinesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_pipelines', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pipelines - computed: true, optional: false, required: false + private _pipelines = new DataHuaweicloudCssLogstashPipelinesPipelinesList(this, "pipelines", false); + public get pipelines() { + return this._pipelines; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/README.md new file mode 100644 index 00000000..b843ad22 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_logstash_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_logstash_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/index.ts new file mode 100644 index 00000000..60b921a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-logstash-templates/index.ts @@ -0,0 +1,398 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssLogstashTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates#id DataHuaweicloudCssLogstashTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates#name DataHuaweicloudCssLogstashTemplates#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates#region DataHuaweicloudCssLogstashTemplates#region} + */ + readonly region?: string; + /** + * Specifies the type of the CSS logstash configuration template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates#type DataHuaweicloudCssLogstashTemplates#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCssLogstashTemplatesCustomTemplates { +} + +export function dataHuaweicloudCssLogstashTemplatesCustomTemplatesToTerraform(struct?: DataHuaweicloudCssLogstashTemplatesCustomTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashTemplatesCustomTemplatesToHclTerraform(struct?: DataHuaweicloudCssLogstashTemplatesCustomTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashTemplatesCustomTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashTemplatesCustomTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashTemplatesCustomTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conf_content - computed: true, optional: false, required: false + public get confContent() { + return this.getStringAttribute('conf_content'); + } + + // desc - computed: true, optional: false, required: false + public get desc() { + return this.getStringAttribute('desc'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCssLogstashTemplatesCustomTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashTemplatesCustomTemplatesOutputReference { + return new DataHuaweicloudCssLogstashTemplatesCustomTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssLogstashTemplatesSystemTemplates { +} + +export function dataHuaweicloudCssLogstashTemplatesSystemTemplatesToTerraform(struct?: DataHuaweicloudCssLogstashTemplatesSystemTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssLogstashTemplatesSystemTemplatesToHclTerraform(struct?: DataHuaweicloudCssLogstashTemplatesSystemTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssLogstashTemplatesSystemTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssLogstashTemplatesSystemTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssLogstashTemplatesSystemTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conf_content - computed: true, optional: false, required: false + public get confContent() { + return this.getStringAttribute('conf_content'); + } + + // desc - computed: true, optional: false, required: false + public get desc() { + return this.getStringAttribute('desc'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCssLogstashTemplatesSystemTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssLogstashTemplatesSystemTemplatesOutputReference { + return new DataHuaweicloudCssLogstashTemplatesSystemTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates huaweicloud_css_logstash_templates} +*/ +export class DataHuaweicloudCssLogstashTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_logstash_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssLogstashTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssLogstashTemplates to import + * @param importFromId The id of the existing DataHuaweicloudCssLogstashTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssLogstashTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_logstash_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_logstash_templates huaweicloud_css_logstash_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssLogstashTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssLogstashTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_logstash_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // custom_templates - computed: true, optional: false, required: false + private _customTemplates = new DataHuaweicloudCssLogstashTemplatesCustomTemplatesList(this, "custom_templates", false); + public get customTemplates() { + return this._customTemplates; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // system_templates - computed: true, optional: false, required: false + private _systemTemplates = new DataHuaweicloudCssLogstashTemplatesSystemTemplatesList(this, "system_templates", false); + public get systemTemplates() { + return this._systemTemplates; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/README.md new file mode 100644 index 00000000..64ebb542 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_scan_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_scan_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/index.ts new file mode 100644 index 00000000..d0e5959a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-scan-tasks/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssScanTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the CSS cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks#cluster_id DataHuaweicloudCssScanTasks#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks#id DataHuaweicloudCssScanTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks#region DataHuaweicloudCssScanTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCssScanTasksScanTasksSummary { +} + +export function dataHuaweicloudCssScanTasksScanTasksSummaryToTerraform(struct?: DataHuaweicloudCssScanTasksScanTasksSummary): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssScanTasksScanTasksSummaryToHclTerraform(struct?: DataHuaweicloudCssScanTasksScanTasksSummary): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssScanTasksScanTasksSummaryOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssScanTasksScanTasksSummary | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssScanTasksScanTasksSummary | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // high - computed: true, optional: false, required: false + public get high() { + return this.getNumberAttribute('high'); + } + + // medium - computed: true, optional: false, required: false + public get medium() { + return this.getNumberAttribute('medium'); + } + + // suggestion - computed: true, optional: false, required: false + public get suggestion() { + return this.getNumberAttribute('suggestion'); + } +} + +export class DataHuaweicloudCssScanTasksScanTasksSummaryList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssScanTasksScanTasksSummaryOutputReference { + return new DataHuaweicloudCssScanTasksScanTasksSummaryOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssScanTasksScanTasksTaskRisks { +} + +export function dataHuaweicloudCssScanTasksScanTasksTaskRisksToTerraform(struct?: DataHuaweicloudCssScanTasksScanTasksTaskRisks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssScanTasksScanTasksTaskRisksToHclTerraform(struct?: DataHuaweicloudCssScanTasksScanTasksTaskRisks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssScanTasksScanTasksTaskRisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssScanTasksScanTasksTaskRisks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssScanTasksScanTasksTaskRisks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // risk - computed: true, optional: false, required: false + public get risk() { + return this.getStringAttribute('risk'); + } + + // suggestion - computed: true, optional: false, required: false + public get suggestion() { + return this.getStringAttribute('suggestion'); + } +} + +export class DataHuaweicloudCssScanTasksScanTasksTaskRisksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssScanTasksScanTasksTaskRisksOutputReference { + return new DataHuaweicloudCssScanTasksScanTasksTaskRisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssScanTasksScanTasks { +} + +export function dataHuaweicloudCssScanTasksScanTasksToTerraform(struct?: DataHuaweicloudCssScanTasksScanTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssScanTasksScanTasksToHclTerraform(struct?: DataHuaweicloudCssScanTasksScanTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssScanTasksScanTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssScanTasksScanTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssScanTasksScanTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // smn_fail_reason - computed: true, optional: false, required: false + public get smnFailReason() { + return this.getStringAttribute('smn_fail_reason'); + } + + // smn_status - computed: true, optional: false, required: false + public get smnStatus() { + return this.getStringAttribute('smn_status'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // summary - computed: true, optional: false, required: false + private _summary = new DataHuaweicloudCssScanTasksScanTasksSummaryList(this, "summary", false); + public get summary() { + return this._summary; + } + + // task_risks - computed: true, optional: false, required: false + private _taskRisks = new DataHuaweicloudCssScanTasksScanTasksTaskRisksList(this, "task_risks", false); + public get taskRisks() { + return this._taskRisks; + } +} + +export class DataHuaweicloudCssScanTasksScanTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssScanTasksScanTasksOutputReference { + return new DataHuaweicloudCssScanTasksScanTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks huaweicloud_css_scan_tasks} +*/ +export class DataHuaweicloudCssScanTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_scan_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssScanTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssScanTasks to import + * @param importFromId The id of the existing DataHuaweicloudCssScanTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssScanTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_scan_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_scan_tasks huaweicloud_css_scan_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssScanTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssScanTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_scan_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scan_tasks - computed: true, optional: false, required: false + private _scanTasks = new DataHuaweicloudCssScanTasksScanTasksList(this, "scan_tasks", false); + public get scanTasks() { + return this._scanTasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/README.md new file mode 100644 index 00000000..7acd33c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_snapshots` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_snapshots`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/index.ts new file mode 100644 index 00000000..01ff7113 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-snapshots/index.ts @@ -0,0 +1,440 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssSnapshotsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots#cluster_id DataHuaweicloudCssSnapshots#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots#id DataHuaweicloudCssSnapshots#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots#region DataHuaweicloudCssSnapshots#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudCssSnapshotsBackupsDatastore { +} + +export function dataHuaweicloudCssSnapshotsBackupsDatastoreToTerraform(struct?: DataHuaweicloudCssSnapshotsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssSnapshotsBackupsDatastoreToHclTerraform(struct?: DataHuaweicloudCssSnapshotsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssSnapshotsBackupsDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssSnapshotsBackupsDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssSnapshotsBackupsDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCssSnapshotsBackupsDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssSnapshotsBackupsDatastoreOutputReference { + return new DataHuaweicloudCssSnapshotsBackupsDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCssSnapshotsBackups { +} + +export function dataHuaweicloudCssSnapshotsBackupsToTerraform(struct?: DataHuaweicloudCssSnapshotsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssSnapshotsBackupsToHclTerraform(struct?: DataHuaweicloudCssSnapshotsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssSnapshotsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssSnapshotsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssSnapshotsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backup_expected_start_time - computed: true, optional: false, required: false + public get backupExpectedStartTime() { + return this.getStringAttribute('backup_expected_start_time'); + } + + // backup_keep_day - computed: true, optional: false, required: false + public get backupKeepDay() { + return this.getNumberAttribute('backup_keep_day'); + } + + // backup_method - computed: true, optional: false, required: false + public get backupMethod() { + return this.getStringAttribute('backup_method'); + } + + // backup_period - computed: true, optional: false, required: false + public get backupPeriod() { + return this.getStringAttribute('backup_period'); + } + + // backup_type - computed: true, optional: false, required: false + public get backupType() { + return this.getStringAttribute('backup_type'); + } + + // bucket_name - computed: true, optional: false, required: false + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // cluster_name - computed: true, optional: false, required: false + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudCssSnapshotsBackupsDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // failed_shards - computed: true, optional: false, required: false + public get failedShards() { + return this.getNumberAttribute('failed_shards'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // indices - computed: true, optional: false, required: false + public get indices() { + return this.getStringAttribute('indices'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // restore_status - computed: true, optional: false, required: false + public get restoreStatus() { + return this.getStringAttribute('restore_status'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // total_shards - computed: true, optional: false, required: false + public get totalShards() { + return this.getNumberAttribute('total_shards'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudCssSnapshotsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssSnapshotsBackupsOutputReference { + return new DataHuaweicloudCssSnapshotsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots huaweicloud_css_snapshots} +*/ +export class DataHuaweicloudCssSnapshots extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_snapshots"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssSnapshots resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssSnapshots to import + * @param importFromId The id of the existing DataHuaweicloudCssSnapshots that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssSnapshots to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_snapshots", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_snapshots huaweicloud_css_snapshots} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssSnapshotsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssSnapshotsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_snapshots', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudCssSnapshotsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/README.md new file mode 100644 index 00000000..56f0e812 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_css_upgrade_target_images` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_css_upgrade_target_images`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/index.ts new file mode 100644 index 00000000..ed5abfbf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-css-upgrade-target-images/index.ts @@ -0,0 +1,396 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCssUpgradeTargetImagesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the cluster to be upgraded. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#cluster_id DataHuaweicloudCssUpgradeTargetImages#cluster_id} + */ + readonly clusterId: string; + /** + * Specifies the datastore type of the target image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#engine_type DataHuaweicloudCssUpgradeTargetImages#engine_type} + */ + readonly engineType?: string; + /** + * Specifies the datastore version of the target image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#engine_version DataHuaweicloudCssUpgradeTargetImages#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#id DataHuaweicloudCssUpgradeTargetImages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the target image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#image_id DataHuaweicloudCssUpgradeTargetImages#image_id} + */ + readonly imageId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#region DataHuaweicloudCssUpgradeTargetImages#region} + */ + readonly region?: string; + /** + * Specifies the upgrade type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#upgrade_type DataHuaweicloudCssUpgradeTargetImages#upgrade_type} + */ + readonly upgradeType: string; +} +export interface DataHuaweicloudCssUpgradeTargetImagesImages { +} + +export function dataHuaweicloudCssUpgradeTargetImagesImagesToTerraform(struct?: DataHuaweicloudCssUpgradeTargetImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCssUpgradeTargetImagesImagesToHclTerraform(struct?: DataHuaweicloudCssUpgradeTargetImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCssUpgradeTargetImagesImagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCssUpgradeTargetImagesImages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCssUpgradeTargetImagesImages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // engine_type - computed: true, optional: false, required: false + public get engineType() { + return this.getStringAttribute('engine_type'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } +} + +export class DataHuaweicloudCssUpgradeTargetImagesImagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCssUpgradeTargetImagesImagesOutputReference { + return new DataHuaweicloudCssUpgradeTargetImagesImagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images huaweicloud_css_upgrade_target_images} +*/ +export class DataHuaweicloudCssUpgradeTargetImages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_css_upgrade_target_images"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCssUpgradeTargetImages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCssUpgradeTargetImages to import + * @param importFromId The id of the existing DataHuaweicloudCssUpgradeTargetImages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCssUpgradeTargetImages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_css_upgrade_target_images", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/css_upgrade_target_images huaweicloud_css_upgrade_target_images} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCssUpgradeTargetImagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCssUpgradeTargetImagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_css_upgrade_target_images', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._engineType = config.engineType; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._imageId = config.imageId; + this._region = config.region; + this._upgradeType = config.upgradeType; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // engine_type - computed: false, optional: true, required: false + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + public resetEngineType() { + this._engineType = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // images - computed: true, optional: false, required: false + private _images = new DataHuaweicloudCssUpgradeTargetImagesImagesList(this, "images", false); + public get images() { + return this._images; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // upgrade_type - computed: false, optional: false, required: true + private _upgradeType?: string; + public get upgradeType() { + return this.getStringAttribute('upgrade_type'); + } + public set upgradeType(value: string) { + this._upgradeType = value; + } + // Temporarily expose input value. Use with caution. + public get upgradeTypeInput() { + return this._upgradeType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + engine_type: cdktf.stringToTerraform(this._engineType), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + region: cdktf.stringToTerraform(this._region), + upgrade_type: cdktf.stringToTerraform(this._upgradeType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + upgrade_type: { + value: cdktf.stringToHclTerraform(this._upgradeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/README.md new file mode 100644 index 00000000..4b47a142 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cts_notifications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cts_notifications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/index.ts new file mode 100644 index 00000000..49108776 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-notifications/index.ts @@ -0,0 +1,692 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCtsNotificationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#id DataHuaweicloudCtsNotifications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of CTS key event notification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#name DataHuaweicloudCtsNotifications#name} + */ + readonly name?: string; + /** + * The ID of the CTS key event notification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#notification_id DataHuaweicloudCtsNotifications#notification_id} + */ + readonly notificationId?: string; + /** + * The type of operation that will send notifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#operation_type DataHuaweicloudCtsNotifications#operation_type} + */ + readonly operationType?: string; + /** + * The region in which to query the CTS key event notification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#region DataHuaweicloudCtsNotifications#region} + */ + readonly region?: string; + /** + * The status of CTS key event notification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#status DataHuaweicloudCtsNotifications#status} + */ + readonly status?: string; + /** + * The URN of the topic which CTS key event notification uses. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#topic_id DataHuaweicloudCtsNotifications#topic_id} + */ + readonly topicId?: string; + /** + * The type of CTS key event notification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#type DataHuaweicloudCtsNotifications#type} + */ + readonly type: string; +} +export interface DataHuaweicloudCtsNotificationsNotificationsFilter { +} + +export function dataHuaweicloudCtsNotificationsNotificationsFilterToTerraform(struct?: DataHuaweicloudCtsNotificationsNotificationsFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsNotificationsNotificationsFilterToHclTerraform(struct?: DataHuaweicloudCtsNotificationsNotificationsFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsNotificationsNotificationsFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsNotificationsNotificationsFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsNotificationsNotificationsFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // condition - computed: true, optional: false, required: false + public get condition() { + return this.getStringAttribute('condition'); + } + + // rule - computed: true, optional: false, required: false + public get rule() { + return this.getListAttribute('rule'); + } +} + +export class DataHuaweicloudCtsNotificationsNotificationsFilterList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsNotificationsNotificationsFilterOutputReference { + return new DataHuaweicloudCtsNotificationsNotificationsFilterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsNotificationsNotificationsOperationUsers { +} + +export function dataHuaweicloudCtsNotificationsNotificationsOperationUsersToTerraform(struct?: DataHuaweicloudCtsNotificationsNotificationsOperationUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsNotificationsNotificationsOperationUsersToHclTerraform(struct?: DataHuaweicloudCtsNotificationsNotificationsOperationUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsNotificationsNotificationsOperationUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsNotificationsNotificationsOperationUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsNotificationsNotificationsOperationUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // group - computed: true, optional: false, required: false + public get group() { + return this.getStringAttribute('group'); + } + + // users - computed: true, optional: false, required: false + public get users() { + return this.getListAttribute('users'); + } +} + +export class DataHuaweicloudCtsNotificationsNotificationsOperationUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsNotificationsNotificationsOperationUsersOutputReference { + return new DataHuaweicloudCtsNotificationsNotificationsOperationUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsNotificationsNotificationsOperations { +} + +export function dataHuaweicloudCtsNotificationsNotificationsOperationsToTerraform(struct?: DataHuaweicloudCtsNotificationsNotificationsOperations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsNotificationsNotificationsOperationsToHclTerraform(struct?: DataHuaweicloudCtsNotificationsNotificationsOperations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsNotificationsNotificationsOperationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsNotificationsNotificationsOperations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsNotificationsNotificationsOperations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resource - computed: true, optional: false, required: false + public get resource() { + return this.getStringAttribute('resource'); + } + + // service - computed: true, optional: false, required: false + public get service() { + return this.getStringAttribute('service'); + } + + // trace_names - computed: true, optional: false, required: false + public get traceNames() { + return this.getListAttribute('trace_names'); + } +} + +export class DataHuaweicloudCtsNotificationsNotificationsOperationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsNotificationsNotificationsOperationsOutputReference { + return new DataHuaweicloudCtsNotificationsNotificationsOperationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsNotificationsNotifications { +} + +export function dataHuaweicloudCtsNotificationsNotificationsToTerraform(struct?: DataHuaweicloudCtsNotificationsNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsNotificationsNotificationsToHclTerraform(struct?: DataHuaweicloudCtsNotificationsNotifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsNotificationsNotificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsNotificationsNotifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsNotificationsNotifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // filter - computed: true, optional: false, required: false + private _filter = new DataHuaweicloudCtsNotificationsNotificationsFilterList(this, "filter", false); + public get filter() { + return this._filter; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operation_type - computed: true, optional: false, required: false + public get operationType() { + return this.getStringAttribute('operation_type'); + } + + // operation_users - computed: true, optional: false, required: false + private _operationUsers = new DataHuaweicloudCtsNotificationsNotificationsOperationUsersList(this, "operation_users", false); + public get operationUsers() { + return this._operationUsers; + } + + // operations - computed: true, optional: false, required: false + private _operations = new DataHuaweicloudCtsNotificationsNotificationsOperationsList(this, "operations", false); + public get operations() { + return this._operations; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // topic_id - computed: true, optional: false, required: false + public get topicId() { + return this.getStringAttribute('topic_id'); + } +} + +export class DataHuaweicloudCtsNotificationsNotificationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsNotificationsNotificationsOutputReference { + return new DataHuaweicloudCtsNotificationsNotificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications huaweicloud_cts_notifications} +*/ +export class DataHuaweicloudCtsNotifications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_notifications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCtsNotifications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCtsNotifications to import + * @param importFromId The id of the existing DataHuaweicloudCtsNotifications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCtsNotifications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_notifications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_notifications huaweicloud_cts_notifications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCtsNotificationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCtsNotificationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_notifications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._notificationId = config.notificationId; + this._operationType = config.operationType; + this._region = config.region; + this._status = config.status; + this._topicId = config.topicId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_id - computed: false, optional: true, required: false + private _notificationId?: string; + public get notificationId() { + return this.getStringAttribute('notification_id'); + } + public set notificationId(value: string) { + this._notificationId = value; + } + public resetNotificationId() { + this._notificationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationIdInput() { + return this._notificationId; + } + + // notifications - computed: true, optional: false, required: false + private _notifications = new DataHuaweicloudCtsNotificationsNotificationsList(this, "notifications", false); + public get notifications() { + return this._notifications; + } + + // operation_type - computed: false, optional: true, required: false + private _operationType?: string; + public get operationType() { + return this.getStringAttribute('operation_type'); + } + public set operationType(value: string) { + this._operationType = value; + } + public resetOperationType() { + this._operationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationTypeInput() { + return this._operationType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // topic_id - computed: false, optional: true, required: false + private _topicId?: string; + public get topicId() { + return this.getStringAttribute('topic_id'); + } + public set topicId(value: string) { + this._topicId = value; + } + public resetTopicId() { + this._topicId = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicIdInput() { + return this._topicId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_id: cdktf.stringToTerraform(this._notificationId), + operation_type: cdktf.stringToTerraform(this._operationType), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + topic_id: cdktf.stringToTerraform(this._topicId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_id: { + value: cdktf.stringToHclTerraform(this._notificationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation_type: { + value: cdktf.stringToHclTerraform(this._operationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_id: { + value: cdktf.stringToHclTerraform(this._topicId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/README.md new file mode 100644 index 00000000..b1cc3ff3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cts_traces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cts_traces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/index.ts new file mode 100644 index 00000000..cd4504f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-traces/index.ts @@ -0,0 +1,845 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCtsTracesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#from DataHuaweicloudCtsTraces#from} + */ + readonly from: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#id DataHuaweicloudCtsTraces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#region DataHuaweicloudCtsTraces#region} + */ + readonly region?: string; + /** + * Specifies the cloud resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#resource_id DataHuaweicloudCtsTraces#resource_id} + */ + readonly resourceId?: string; + /** + * Specifies the name of a resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#resource_name DataHuaweicloudCtsTraces#resource_name} + */ + readonly resourceName?: string; + /** + * Specifies the type of a resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#resource_type DataHuaweicloudCtsTraces#resource_type} + */ + readonly resourceType?: string; + /** + * Specifies the cloud service type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#service_type DataHuaweicloudCtsTraces#service_type} + */ + readonly serviceType?: string; + /** + * Specifies the end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#to DataHuaweicloudCtsTraces#to} + */ + readonly to: string; + /** + * Specifies the trace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#trace_id DataHuaweicloudCtsTraces#trace_id} + */ + readonly traceId?: string; + /** + * Specifies the trace name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#trace_name DataHuaweicloudCtsTraces#trace_name} + */ + readonly traceName?: string; + /** + * Specifies the trace status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#trace_rating DataHuaweicloudCtsTraces#trace_rating} + */ + readonly traceRating?: string; + /** + * Specifies the trace type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#trace_type DataHuaweicloudCtsTraces#trace_type} + */ + readonly traceType: string; + /** + * Specifies the tracker name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#tracker_name DataHuaweicloudCtsTraces#tracker_name} + */ + readonly trackerName?: string; + /** + * Specifies the user name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#user DataHuaweicloudCtsTraces#user} + */ + readonly user?: string; +} +export interface DataHuaweicloudCtsTracesTracesUserDomain { +} + +export function dataHuaweicloudCtsTracesTracesUserDomainToTerraform(struct?: DataHuaweicloudCtsTracesTracesUserDomain): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTracesTracesUserDomainToHclTerraform(struct?: DataHuaweicloudCtsTracesTracesUserDomain): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTracesTracesUserDomainOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTracesTracesUserDomain | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTracesTracesUserDomain | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCtsTracesTracesUserDomainList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTracesTracesUserDomainOutputReference { + return new DataHuaweicloudCtsTracesTracesUserDomainOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsTracesTracesUser { +} + +export function dataHuaweicloudCtsTracesTracesUserToTerraform(struct?: DataHuaweicloudCtsTracesTracesUser): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTracesTracesUserToHclTerraform(struct?: DataHuaweicloudCtsTracesTracesUser): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTracesTracesUserOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTracesTracesUser | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTracesTracesUser | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain - computed: true, optional: false, required: false + private _domain = new DataHuaweicloudCtsTracesTracesUserDomainList(this, "domain", false); + public get domain() { + return this._domain; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudCtsTracesTracesUserList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTracesTracesUserOutputReference { + return new DataHuaweicloudCtsTracesTracesUserOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsTracesTraces { +} + +export function dataHuaweicloudCtsTracesTracesToTerraform(struct?: DataHuaweicloudCtsTracesTraces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTracesTracesToHclTerraform(struct?: DataHuaweicloudCtsTracesTraces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTracesTracesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTracesTraces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTracesTraces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // api_version - computed: true, optional: false, required: false + public get apiVersion() { + return this.getStringAttribute('api_version'); + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // location_info - computed: true, optional: false, required: false + public get locationInfo() { + return this.getStringAttribute('location_info'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // record_time - computed: true, optional: false, required: false + public get recordTime() { + return this.getStringAttribute('record_time'); + } + + // request - computed: true, optional: false, required: false + public get request() { + return this.getStringAttribute('request'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // resource_url - computed: true, optional: false, required: false + public get resourceUrl() { + return this.getStringAttribute('resource_url'); + } + + // response - computed: true, optional: false, required: false + public get response() { + return this.getStringAttribute('response'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // source_ip - computed: true, optional: false, required: false + public get sourceIp() { + return this.getStringAttribute('source_ip'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } + + // trace_id - computed: true, optional: false, required: false + public get traceId() { + return this.getStringAttribute('trace_id'); + } + + // trace_name - computed: true, optional: false, required: false + public get traceName() { + return this.getStringAttribute('trace_name'); + } + + // trace_rating - computed: true, optional: false, required: false + public get traceRating() { + return this.getStringAttribute('trace_rating'); + } + + // trace_type - computed: true, optional: false, required: false + public get traceType() { + return this.getStringAttribute('trace_type'); + } + + // user - computed: true, optional: false, required: false + private _user = new DataHuaweicloudCtsTracesTracesUserList(this, "user", false); + public get user() { + return this._user; + } +} + +export class DataHuaweicloudCtsTracesTracesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTracesTracesOutputReference { + return new DataHuaweicloudCtsTracesTracesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces huaweicloud_cts_traces} +*/ +export class DataHuaweicloudCtsTraces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_traces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCtsTraces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCtsTraces to import + * @param importFromId The id of the existing DataHuaweicloudCtsTraces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCtsTraces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_traces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_traces huaweicloud_cts_traces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCtsTracesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCtsTracesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_traces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._from = config.from; + this._id = config.id; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceName = config.resourceName; + this._resourceType = config.resourceType; + this._serviceType = config.serviceType; + this._to = config.to; + this._traceId = config.traceId; + this._traceName = config.traceName; + this._traceRating = config.traceRating; + this._traceType = config.traceType; + this._trackerName = config.trackerName; + this._user = config.user; + } + + // ========== + // ATTRIBUTES + // ========== + + // from - computed: false, optional: false, required: true + private _from?: string; + public get from() { + return this.getStringAttribute('from'); + } + public set from(value: string) { + this._from = value; + } + // Temporarily expose input value. Use with caution. + public get fromInput() { + return this._from; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: false, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // service_type - computed: false, optional: true, required: false + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // to - computed: false, optional: false, required: true + private _to?: string; + public get to() { + return this.getStringAttribute('to'); + } + public set to(value: string) { + this._to = value; + } + // Temporarily expose input value. Use with caution. + public get toInput() { + return this._to; + } + + // trace_id - computed: false, optional: true, required: false + private _traceId?: string; + public get traceId() { + return this.getStringAttribute('trace_id'); + } + public set traceId(value: string) { + this._traceId = value; + } + public resetTraceId() { + this._traceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get traceIdInput() { + return this._traceId; + } + + // trace_name - computed: false, optional: true, required: false + private _traceName?: string; + public get traceName() { + return this.getStringAttribute('trace_name'); + } + public set traceName(value: string) { + this._traceName = value; + } + public resetTraceName() { + this._traceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get traceNameInput() { + return this._traceName; + } + + // trace_rating - computed: false, optional: true, required: false + private _traceRating?: string; + public get traceRating() { + return this.getStringAttribute('trace_rating'); + } + public set traceRating(value: string) { + this._traceRating = value; + } + public resetTraceRating() { + this._traceRating = undefined; + } + // Temporarily expose input value. Use with caution. + public get traceRatingInput() { + return this._traceRating; + } + + // trace_type - computed: false, optional: false, required: true + private _traceType?: string; + public get traceType() { + return this.getStringAttribute('trace_type'); + } + public set traceType(value: string) { + this._traceType = value; + } + // Temporarily expose input value. Use with caution. + public get traceTypeInput() { + return this._traceType; + } + + // traces - computed: true, optional: false, required: false + private _traces = new DataHuaweicloudCtsTracesTracesList(this, "traces", false); + public get traces() { + return this._traces; + } + + // tracker_name - computed: false, optional: true, required: false + private _trackerName?: string; + public get trackerName() { + return this.getStringAttribute('tracker_name'); + } + public set trackerName(value: string) { + this._trackerName = value; + } + public resetTrackerName() { + this._trackerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get trackerNameInput() { + return this._trackerName; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + from: cdktf.stringToTerraform(this._from), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_name: cdktf.stringToTerraform(this._resourceName), + resource_type: cdktf.stringToTerraform(this._resourceType), + service_type: cdktf.stringToTerraform(this._serviceType), + to: cdktf.stringToTerraform(this._to), + trace_id: cdktf.stringToTerraform(this._traceId), + trace_name: cdktf.stringToTerraform(this._traceName), + trace_rating: cdktf.stringToTerraform(this._traceRating), + trace_type: cdktf.stringToTerraform(this._traceType), + tracker_name: cdktf.stringToTerraform(this._trackerName), + user: cdktf.stringToTerraform(this._user), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + from: { + value: cdktf.stringToHclTerraform(this._from), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to: { + value: cdktf.stringToHclTerraform(this._to), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trace_id: { + value: cdktf.stringToHclTerraform(this._traceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trace_name: { + value: cdktf.stringToHclTerraform(this._traceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trace_rating: { + value: cdktf.stringToHclTerraform(this._traceRating), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trace_type: { + value: cdktf.stringToHclTerraform(this._traceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tracker_name: { + value: cdktf.stringToHclTerraform(this._trackerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(this._user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/README.md new file mode 100644 index 00000000..8c8e9a18 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cts_tracker` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cts_tracker`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/index.ts new file mode 100644 index 00000000..e8e71253 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-tracker/index.ts @@ -0,0 +1,281 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCtsTrackerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#bucket_name DataHuaweicloudCtsTracker#bucket_name} + */ + readonly bucketName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#file_prefix_name DataHuaweicloudCtsTracker#file_prefix_name} + */ + readonly filePrefixName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#id DataHuaweicloudCtsTracker#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#region DataHuaweicloudCtsTracker#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#status DataHuaweicloudCtsTracker#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#tracker_name DataHuaweicloudCtsTracker#tracker_name} + */ + readonly trackerName?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker huaweicloud_cts_tracker} +*/ +export class DataHuaweicloudCtsTracker extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_tracker"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCtsTracker resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCtsTracker to import + * @param importFromId The id of the existing DataHuaweicloudCtsTracker that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCtsTracker to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_tracker", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_tracker huaweicloud_cts_tracker} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCtsTrackerConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCtsTrackerConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_tracker', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._filePrefixName = config.filePrefixName; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._trackerName = config.trackerName; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_name - computed: true, optional: true, required: false + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + public resetBucketName() { + this._bucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // file_prefix_name - computed: true, optional: true, required: false + private _filePrefixName?: string; + public get filePrefixName() { + return this.getStringAttribute('file_prefix_name'); + } + public set filePrefixName(value: string) { + this._filePrefixName = value; + } + public resetFilePrefixName() { + this._filePrefixName = undefined; + } + // Temporarily expose input value. Use with caution. + public get filePrefixNameInput() { + return this._filePrefixName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_send_all_key_operation - computed: true, optional: false, required: false + public get isSendAllKeyOperation() { + return this.getBooleanAttribute('is_send_all_key_operation'); + } + + // is_support_smn - computed: true, optional: false, required: false + public get isSupportSmn() { + return this.getBooleanAttribute('is_support_smn'); + } + + // need_notify_user_list - computed: true, optional: false, required: false + public get needNotifyUserList() { + return cdktf.Fn.tolist(this.getListAttribute('need_notify_user_list')); + } + + // operations - computed: true, optional: false, required: false + public get operations() { + return cdktf.Fn.tolist(this.getListAttribute('operations')); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // topic_id - computed: true, optional: false, required: false + public get topicId() { + return this.getStringAttribute('topic_id'); + } + + // tracker_name - computed: true, optional: true, required: false + private _trackerName?: string; + public get trackerName() { + return this.getStringAttribute('tracker_name'); + } + public set trackerName(value: string) { + this._trackerName = value; + } + public resetTrackerName() { + this._trackerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get trackerNameInput() { + return this._trackerName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + file_prefix_name: cdktf.stringToTerraform(this._filePrefixName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tracker_name: cdktf.stringToTerraform(this._trackerName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_prefix_name: { + value: cdktf.stringToHclTerraform(this._filePrefixName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tracker_name: { + value: cdktf.stringToHclTerraform(this._trackerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/README.md new file mode 100644 index 00000000..1f249369 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_cts_trackers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_cts_trackers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/index.ts new file mode 100644 index 00000000..82ec1c29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-cts-trackers/index.ts @@ -0,0 +1,821 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudCtsTrackersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data bucket name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#data_bucket_name DataHuaweicloudCtsTrackers#data_bucket_name} + */ + readonly dataBucketName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#id DataHuaweicloudCtsTrackers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the tracker name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#name DataHuaweicloudCtsTrackers#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#region DataHuaweicloudCtsTrackers#region} + */ + readonly region?: string; + /** + * Specifies the tracker status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#status DataHuaweicloudCtsTrackers#status} + */ + readonly status?: string; + /** + * Specifies the tracker ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#tracker_id DataHuaweicloudCtsTrackers#tracker_id} + */ + readonly trackerId?: string; + /** + * Specifies the tracker type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#type DataHuaweicloudCtsTrackers#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudCtsTrackersTrackersDataBucket { +} + +export function dataHuaweicloudCtsTrackersTrackersDataBucketToTerraform(struct?: DataHuaweicloudCtsTrackersTrackersDataBucket): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTrackersTrackersDataBucketToHclTerraform(struct?: DataHuaweicloudCtsTrackersTrackersDataBucket): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTrackersTrackersDataBucketOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTrackersTrackersDataBucket | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTrackersTrackersDataBucket | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_bucket_name - computed: true, optional: false, required: false + public get dataBucketName() { + return this.getStringAttribute('data_bucket_name'); + } + + // data_event - computed: true, optional: false, required: false + public get dataEvent() { + return this.getListAttribute('data_event'); + } + + // search_enabled - computed: true, optional: false, required: false + public get searchEnabled() { + return this.getBooleanAttribute('search_enabled'); + } +} + +export class DataHuaweicloudCtsTrackersTrackersDataBucketList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTrackersTrackersDataBucketOutputReference { + return new DataHuaweicloudCtsTrackersTrackersDataBucketOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsTrackersTrackersLts { +} + +export function dataHuaweicloudCtsTrackersTrackersLtsToTerraform(struct?: DataHuaweicloudCtsTrackersTrackersLts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTrackersTrackersLtsToHclTerraform(struct?: DataHuaweicloudCtsTrackersTrackersLts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTrackersTrackersLtsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTrackersTrackersLts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTrackersTrackersLts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // is_lts_enabled - computed: true, optional: false, required: false + public get isLtsEnabled() { + return this.getBooleanAttribute('is_lts_enabled'); + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // log_topic_name - computed: true, optional: false, required: false + public get logTopicName() { + return this.getStringAttribute('log_topic_name'); + } +} + +export class DataHuaweicloudCtsTrackersTrackersLtsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTrackersTrackersLtsOutputReference { + return new DataHuaweicloudCtsTrackersTrackersLtsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsTrackersTrackersManagementEventSelector { +} + +export function dataHuaweicloudCtsTrackersTrackersManagementEventSelectorToTerraform(struct?: DataHuaweicloudCtsTrackersTrackersManagementEventSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTrackersTrackersManagementEventSelectorToHclTerraform(struct?: DataHuaweicloudCtsTrackersTrackersManagementEventSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTrackersTrackersManagementEventSelectorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTrackersTrackersManagementEventSelector | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTrackersTrackersManagementEventSelector | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // exclude_service - computed: true, optional: false, required: false + public get excludeService() { + return this.getListAttribute('exclude_service'); + } +} + +export class DataHuaweicloudCtsTrackersTrackersManagementEventSelectorList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTrackersTrackersManagementEventSelectorOutputReference { + return new DataHuaweicloudCtsTrackersTrackersManagementEventSelectorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsTrackersTrackersObsInfo { +} + +export function dataHuaweicloudCtsTrackersTrackersObsInfoToTerraform(struct?: DataHuaweicloudCtsTrackersTrackersObsInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTrackersTrackersObsInfoToHclTerraform(struct?: DataHuaweicloudCtsTrackersTrackersObsInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTrackersTrackersObsInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTrackersTrackersObsInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTrackersTrackersObsInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bucket_lifecycle - computed: true, optional: false, required: false + public get bucketLifecycle() { + return this.getNumberAttribute('bucket_lifecycle'); + } + + // bucket_name - computed: true, optional: false, required: false + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + + // compress_type - computed: true, optional: false, required: false + public get compressType() { + return this.getStringAttribute('compress_type'); + } + + // file_prefix_name - computed: true, optional: false, required: false + public get filePrefixName() { + return this.getStringAttribute('file_prefix_name'); + } + + // is_authorized_bucket - computed: true, optional: false, required: false + public get isAuthorizedBucket() { + return this.getBooleanAttribute('is_authorized_bucket'); + } + + // is_obs_created - computed: true, optional: false, required: false + public get isObsCreated() { + return this.getBooleanAttribute('is_obs_created'); + } + + // is_sort_by_service - computed: true, optional: false, required: false + public get isSortByService() { + return this.getBooleanAttribute('is_sort_by_service'); + } +} + +export class DataHuaweicloudCtsTrackersTrackersObsInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTrackersTrackersObsInfoOutputReference { + return new DataHuaweicloudCtsTrackersTrackersObsInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudCtsTrackersTrackers { +} + +export function dataHuaweicloudCtsTrackersTrackersToTerraform(struct?: DataHuaweicloudCtsTrackersTrackers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudCtsTrackersTrackersToHclTerraform(struct?: DataHuaweicloudCtsTrackersTrackers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudCtsTrackersTrackersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudCtsTrackersTrackers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudCtsTrackersTrackers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agency_name - computed: true, optional: false, required: false + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // data_bucket - computed: true, optional: false, required: false + private _dataBucket = new DataHuaweicloudCtsTrackersTrackersDataBucketList(this, "data_bucket", false); + public get dataBucket() { + return this._dataBucket; + } + + // detail - computed: true, optional: false, required: false + public get detail() { + return this.getStringAttribute('detail'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_organization_tracker - computed: true, optional: false, required: false + public get isOrganizationTracker() { + return this.getBooleanAttribute('is_organization_tracker'); + } + + // is_support_trace_files_encryption - computed: true, optional: false, required: false + public get isSupportTraceFilesEncryption() { + return this.getBooleanAttribute('is_support_trace_files_encryption'); + } + + // is_support_validate - computed: true, optional: false, required: false + public get isSupportValidate() { + return this.getBooleanAttribute('is_support_validate'); + } + + // kms_id - computed: true, optional: false, required: false + public get kmsId() { + return this.getStringAttribute('kms_id'); + } + + // lts - computed: true, optional: false, required: false + private _lts = new DataHuaweicloudCtsTrackersTrackersLtsList(this, "lts", false); + public get lts() { + return this._lts; + } + + // management_event_selector - computed: true, optional: false, required: false + private _managementEventSelector = new DataHuaweicloudCtsTrackersTrackersManagementEventSelectorList(this, "management_event_selector", false); + public get managementEventSelector() { + return this._managementEventSelector; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // obs_info - computed: true, optional: false, required: false + private _obsInfo = new DataHuaweicloudCtsTrackersTrackersObsInfoList(this, "obs_info", false); + public get obsInfo() { + return this._obsInfo; + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stream_id - computed: true, optional: false, required: false + public get streamId() { + return this.getStringAttribute('stream_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudCtsTrackersTrackersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudCtsTrackersTrackersOutputReference { + return new DataHuaweicloudCtsTrackersTrackersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers huaweicloud_cts_trackers} +*/ +export class DataHuaweicloudCtsTrackers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_cts_trackers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudCtsTrackers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudCtsTrackers to import + * @param importFromId The id of the existing DataHuaweicloudCtsTrackers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudCtsTrackers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_cts_trackers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/cts_trackers huaweicloud_cts_trackers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudCtsTrackersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudCtsTrackersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_cts_trackers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataBucketName = config.dataBucketName; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._trackerId = config.trackerId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_bucket_name - computed: false, optional: true, required: false + private _dataBucketName?: string; + public get dataBucketName() { + return this.getStringAttribute('data_bucket_name'); + } + public set dataBucketName(value: string) { + this._dataBucketName = value; + } + public resetDataBucketName() { + this._dataBucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataBucketNameInput() { + return this._dataBucketName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tracker_id - computed: false, optional: true, required: false + private _trackerId?: string; + public get trackerId() { + return this.getStringAttribute('tracker_id'); + } + public set trackerId(value: string) { + this._trackerId = value; + } + public resetTrackerId() { + this._trackerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trackerIdInput() { + return this._trackerId; + } + + // trackers - computed: true, optional: false, required: false + private _trackers = new DataHuaweicloudCtsTrackersTrackersList(this, "trackers", false); + public get trackers() { + return this._trackers; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_bucket_name: cdktf.stringToTerraform(this._dataBucketName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tracker_id: cdktf.stringToTerraform(this._trackerId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_bucket_name: { + value: cdktf.stringToHclTerraform(this._dataBucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tracker_id: { + value: cdktf.stringToHclTerraform(this._trackerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/README.md new file mode 100644 index 00000000..e1082521 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_architecture_ds_template_optionals` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_architecture_ds_template_optionals`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/index.ts new file mode 100644 index 00000000..b8461f4a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-ds-template-optionals/index.ts @@ -0,0 +1,362 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsArchitectureDsTemplateOptionalsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the optional field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#fd_name DataHuaweicloudDataartsArchitectureDsTemplateOptionals#fd_name} + */ + readonly fdName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#id DataHuaweicloudDataartsArchitectureDsTemplateOptionals#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#region DataHuaweicloudDataartsArchitectureDsTemplateOptionals#region} + */ + readonly region?: string; + /** + * Specifies whether the field is required. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#required DataHuaweicloudDataartsArchitectureDsTemplateOptionals#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * Specifies whether the field is search supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#searchable DataHuaweicloudDataartsArchitectureDsTemplateOptionals#searchable} + */ + readonly searchable?: boolean | cdktf.IResolvable; + /** + * Specifies the workspace ID of DataArts Architecture. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#workspace_id DataHuaweicloudDataartsArchitectureDsTemplateOptionals#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFields { +} + +export function dataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsToTerraform(struct?: DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFields): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFields): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFields | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFields | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // description_en - computed: true, optional: false, required: false + public get descriptionEn() { + return this.getStringAttribute('description_en'); + } + + // fd_name - computed: true, optional: false, required: false + public get fdName() { + return this.getStringAttribute('fd_name'); + } + + // required - computed: true, optional: false, required: false + public get required() { + return this.getBooleanAttribute('required'); + } + + // searchable - computed: true, optional: false, required: false + public get searchable() { + return this.getBooleanAttribute('searchable'); + } +} + +export class DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsOutputReference { + return new DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals huaweicloud_dataarts_architecture_ds_template_optionals} +*/ +export class DataHuaweicloudDataartsArchitectureDsTemplateOptionals extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_ds_template_optionals"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsArchitectureDsTemplateOptionals resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsArchitectureDsTemplateOptionals to import + * @param importFromId The id of the existing DataHuaweicloudDataartsArchitectureDsTemplateOptionals that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsArchitectureDsTemplateOptionals to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_ds_template_optionals", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_ds_template_optionals huaweicloud_dataarts_architecture_ds_template_optionals} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsArchitectureDsTemplateOptionalsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsArchitectureDsTemplateOptionalsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_ds_template_optionals', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fdName = config.fdName; + this._id = config.id; + this._region = config.region; + this._required = config.required; + this._searchable = config.searchable; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // fd_name - computed: false, optional: true, required: false + private _fdName?: string; + public get fdName() { + return this.getStringAttribute('fd_name'); + } + public set fdName(value: string) { + this._fdName = value; + } + public resetFdName() { + this._fdName = undefined; + } + // Temporarily expose input value. Use with caution. + public get fdNameInput() { + return this._fdName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // optional_fields - computed: true, optional: false, required: false + private _optionalFields = new DataHuaweicloudDataartsArchitectureDsTemplateOptionalsOptionalFieldsList(this, "optional_fields", false); + public get optionalFields() { + return this._optionalFields; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // required - computed: false, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // searchable - computed: false, optional: true, required: false + private _searchable?: boolean | cdktf.IResolvable; + public get searchable() { + return this.getBooleanAttribute('searchable'); + } + public set searchable(value: boolean | cdktf.IResolvable) { + this._searchable = value; + } + public resetSearchable() { + this._searchable = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchableInput() { + return this._searchable; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fd_name: cdktf.stringToTerraform(this._fdName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + required: cdktf.booleanToTerraform(this._required), + searchable: cdktf.booleanToTerraform(this._searchable), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fd_name: { + value: cdktf.stringToHclTerraform(this._fdName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(this._required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + searchable: { + value: cdktf.booleanToHclTerraform(this._searchable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/README.md new file mode 100644 index 00000000..73ad21b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_architecture_model_statistic` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_architecture_model_statistic`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/index.ts new file mode 100644 index 00000000..6167d3e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-model-statistic/index.ts @@ -0,0 +1,1835 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsArchitectureModelStatisticConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic#id DataHuaweicloudDataartsArchitectureModelStatistic#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to query model statistic information. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic#region DataHuaweicloudDataartsArchitectureModelStatistic#region} + */ + readonly region?: string; + /** + * The ID of the workspace in which to query model statistic information. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic#workspace_id DataHuaweicloudDataartsArchitectureModelStatistic#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticDmModel { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticDmModelToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDmModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticDmModelToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDmModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDmModelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticDmModel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticDmModel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_catalog_ids - computed: true, optional: false, required: false + public get bizCatalogIds() { + return this.getStringAttribute('biz_catalog_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // frequent - computed: true, optional: false, required: false + public get frequent() { + return this.getBooleanAttribute('frequent'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_physical - computed: true, optional: false, required: false + public get isPhysical() { + return this.getBooleanAttribute('is_physical'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // table_model_prefix - computed: true, optional: false, required: false + public get tableModelPrefix() { + return this.getStringAttribute('table_model_prefix'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getBooleanAttribute('top'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDmModelList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticDmModelOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticDmModelOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticDm { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticDmToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticDmToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDmOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticDm | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticDm | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // fd - computed: true, optional: false, required: false + public get fd() { + return this.getNumberAttribute('fd'); + } + + // fd_published - computed: true, optional: false, required: false + public get fdPublished() { + return this.getNumberAttribute('fd_published'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // model - computed: true, optional: false, required: false + private _model = new DataHuaweicloudDataartsArchitectureModelStatisticDmModelList(this, "model", false); + public get model() { + return this._model; + } + + // st - computed: true, optional: false, required: false + public get st() { + return this.getNumberAttribute('st'); + } + + // st_published - computed: true, optional: false, required: false + public get stPublished() { + return this.getNumberAttribute('st_published'); + } + + // tb - computed: true, optional: false, required: false + public get tb() { + return this.getNumberAttribute('tb'); + } + + // tb_published - computed: true, optional: false, required: false + public get tbPublished() { + return this.getNumberAttribute('tb_published'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDmList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticDmOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticDmOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticDwrModel { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticDwrModelToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDwrModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticDwrModelToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDwrModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDwrModelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticDwrModel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticDwrModel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_catalog_ids - computed: true, optional: false, required: false + public get bizCatalogIds() { + return this.getStringAttribute('biz_catalog_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // frequent - computed: true, optional: false, required: false + public get frequent() { + return this.getBooleanAttribute('frequent'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_physical - computed: true, optional: false, required: false + public get isPhysical() { + return this.getBooleanAttribute('is_physical'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // table_model_prefix - computed: true, optional: false, required: false + public get tableModelPrefix() { + return this.getStringAttribute('table_model_prefix'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getBooleanAttribute('top'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDwrModelList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticDwrModelOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticDwrModelOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticDwr { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticDwrToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDwr): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticDwrToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticDwr): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDwrOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticDwr | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticDwr | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // fd - computed: true, optional: false, required: false + public get fd() { + return this.getNumberAttribute('fd'); + } + + // fd_published - computed: true, optional: false, required: false + public get fdPublished() { + return this.getNumberAttribute('fd_published'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // model - computed: true, optional: false, required: false + private _model = new DataHuaweicloudDataartsArchitectureModelStatisticDwrModelList(this, "model", false); + public get model() { + return this._model; + } + + // st - computed: true, optional: false, required: false + public get st() { + return this.getNumberAttribute('st'); + } + + // st_published - computed: true, optional: false, required: false + public get stPublished() { + return this.getNumberAttribute('st_published'); + } + + // tb - computed: true, optional: false, required: false + public get tb() { + return this.getNumberAttribute('tb'); + } + + // tb_published - computed: true, optional: false, required: false + public get tbPublished() { + return this.getNumberAttribute('tb_published'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticDwrList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticDwrOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticDwrOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticFrequentModel { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticFrequentModelToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticFrequentModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticFrequentModelToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticFrequentModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticFrequentModelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticFrequentModel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticFrequentModel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_catalog_ids - computed: true, optional: false, required: false + public get bizCatalogIds() { + return this.getStringAttribute('biz_catalog_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // frequent - computed: true, optional: false, required: false + public get frequent() { + return this.getBooleanAttribute('frequent'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_physical - computed: true, optional: false, required: false + public get isPhysical() { + return this.getBooleanAttribute('is_physical'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // table_model_prefix - computed: true, optional: false, required: false + public get tableModelPrefix() { + return this.getStringAttribute('table_model_prefix'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getBooleanAttribute('top'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticFrequentModelList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticFrequentModelOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticFrequentModelOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticFrequent { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticFrequentToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticFrequent): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticFrequentToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticFrequent): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticFrequentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticFrequent | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticFrequent | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // fd - computed: true, optional: false, required: false + public get fd() { + return this.getNumberAttribute('fd'); + } + + // fd_published - computed: true, optional: false, required: false + public get fdPublished() { + return this.getNumberAttribute('fd_published'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // model - computed: true, optional: false, required: false + private _model = new DataHuaweicloudDataartsArchitectureModelStatisticFrequentModelList(this, "model", false); + public get model() { + return this._model; + } + + // st - computed: true, optional: false, required: false + public get st() { + return this.getNumberAttribute('st'); + } + + // st_published - computed: true, optional: false, required: false + public get stPublished() { + return this.getNumberAttribute('st_published'); + } + + // tb - computed: true, optional: false, required: false + public get tb() { + return this.getNumberAttribute('tb'); + } + + // tb_published - computed: true, optional: false, required: false + public get tbPublished() { + return this.getNumberAttribute('tb_published'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticFrequentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticFrequentOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticFrequentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticLogicsModel { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticLogicsModelToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticLogicsModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticLogicsModelToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticLogicsModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticLogicsModelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticLogicsModel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticLogicsModel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_catalog_ids - computed: true, optional: false, required: false + public get bizCatalogIds() { + return this.getStringAttribute('biz_catalog_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // frequent - computed: true, optional: false, required: false + public get frequent() { + return this.getBooleanAttribute('frequent'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_physical - computed: true, optional: false, required: false + public get isPhysical() { + return this.getBooleanAttribute('is_physical'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // table_model_prefix - computed: true, optional: false, required: false + public get tableModelPrefix() { + return this.getStringAttribute('table_model_prefix'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getBooleanAttribute('top'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticLogicsModelList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticLogicsModelOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticLogicsModelOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticLogics { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticLogicsToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticLogics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticLogicsToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticLogics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticLogicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticLogics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticLogics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // fd - computed: true, optional: false, required: false + public get fd() { + return this.getNumberAttribute('fd'); + } + + // fd_published - computed: true, optional: false, required: false + public get fdPublished() { + return this.getNumberAttribute('fd_published'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // model - computed: true, optional: false, required: false + private _model = new DataHuaweicloudDataartsArchitectureModelStatisticLogicsModelList(this, "model", false); + public get model() { + return this._model; + } + + // st - computed: true, optional: false, required: false + public get st() { + return this.getNumberAttribute('st'); + } + + // st_published - computed: true, optional: false, required: false + public get stPublished() { + return this.getNumberAttribute('st_published'); + } + + // tb - computed: true, optional: false, required: false + public get tb() { + return this.getNumberAttribute('tb'); + } + + // tb_published - computed: true, optional: false, required: false + public get tbPublished() { + return this.getNumberAttribute('tb_published'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticLogicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticLogicsOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticLogicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModel { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_catalog_ids - computed: true, optional: false, required: false + public get bizCatalogIds() { + return this.getStringAttribute('biz_catalog_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // frequent - computed: true, optional: false, required: false + public get frequent() { + return this.getBooleanAttribute('frequent'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_physical - computed: true, optional: false, required: false + public get isPhysical() { + return this.getBooleanAttribute('is_physical'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // table_model_prefix - computed: true, optional: false, required: false + public get tableModelPrefix() { + return this.getStringAttribute('table_model_prefix'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getBooleanAttribute('top'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticPhysicals { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticPhysicalsToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticPhysicals): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticPhysicalsToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticPhysicals): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticPhysicals | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticPhysicals | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // fd - computed: true, optional: false, required: false + public get fd() { + return this.getNumberAttribute('fd'); + } + + // fd_published - computed: true, optional: false, required: false + public get fdPublished() { + return this.getNumberAttribute('fd_published'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // model - computed: true, optional: false, required: false + private _model = new DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsModelList(this, "model", false); + public get model() { + return this._model; + } + + // st - computed: true, optional: false, required: false + public get st() { + return this.getNumberAttribute('st'); + } + + // st_published - computed: true, optional: false, required: false + public get stPublished() { + return this.getNumberAttribute('st_published'); + } + + // tb - computed: true, optional: false, required: false + public get tb() { + return this.getNumberAttribute('tb'); + } + + // tb_published - computed: true, optional: false, required: false + public get tbPublished() { + return this.getNumberAttribute('tb_published'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticTopsModel { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticTopsModelToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticTopsModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticTopsModelToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticTopsModel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticTopsModelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticTopsModel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticTopsModel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_catalog_ids - computed: true, optional: false, required: false + public get bizCatalogIds() { + return this.getStringAttribute('biz_catalog_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // frequent - computed: true, optional: false, required: false + public get frequent() { + return this.getBooleanAttribute('frequent'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_physical - computed: true, optional: false, required: false + public get isPhysical() { + return this.getBooleanAttribute('is_physical'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // table_model_prefix - computed: true, optional: false, required: false + public get tableModelPrefix() { + return this.getStringAttribute('table_model_prefix'); + } + + // top - computed: true, optional: false, required: false + public get top() { + return this.getBooleanAttribute('top'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticTopsModelList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticTopsModelOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticTopsModelOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureModelStatisticTops { +} + +export function dataHuaweicloudDataartsArchitectureModelStatisticTopsToTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticTops): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureModelStatisticTopsToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureModelStatisticTops): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticTopsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureModelStatisticTops | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureModelStatisticTops | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // fd - computed: true, optional: false, required: false + public get fd() { + return this.getNumberAttribute('fd'); + } + + // fd_published - computed: true, optional: false, required: false + public get fdPublished() { + return this.getNumberAttribute('fd_published'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // model - computed: true, optional: false, required: false + private _model = new DataHuaweicloudDataartsArchitectureModelStatisticTopsModelList(this, "model", false); + public get model() { + return this._model; + } + + // st - computed: true, optional: false, required: false + public get st() { + return this.getNumberAttribute('st'); + } + + // st_published - computed: true, optional: false, required: false + public get stPublished() { + return this.getNumberAttribute('st_published'); + } + + // tb - computed: true, optional: false, required: false + public get tb() { + return this.getNumberAttribute('tb'); + } + + // tb_published - computed: true, optional: false, required: false + public get tbPublished() { + return this.getNumberAttribute('tb_published'); + } +} + +export class DataHuaweicloudDataartsArchitectureModelStatisticTopsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureModelStatisticTopsOutputReference { + return new DataHuaweicloudDataartsArchitectureModelStatisticTopsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic huaweicloud_dataarts_architecture_model_statistic} +*/ +export class DataHuaweicloudDataartsArchitectureModelStatistic extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_model_statistic"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsArchitectureModelStatistic resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsArchitectureModelStatistic to import + * @param importFromId The id of the existing DataHuaweicloudDataartsArchitectureModelStatistic that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsArchitectureModelStatistic to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_model_statistic", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_model_statistic huaweicloud_dataarts_architecture_model_statistic} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsArchitectureModelStatisticConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsArchitectureModelStatisticConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_model_statistic', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // dm - computed: true, optional: false, required: false + private _dm = new DataHuaweicloudDataartsArchitectureModelStatisticDmList(this, "dm", false); + public get dm() { + return this._dm; + } + + // dwr - computed: true, optional: false, required: false + private _dwr = new DataHuaweicloudDataartsArchitectureModelStatisticDwrList(this, "dwr", false); + public get dwr() { + return this._dwr; + } + + // frequent - computed: true, optional: false, required: false + private _frequent = new DataHuaweicloudDataartsArchitectureModelStatisticFrequentList(this, "frequent", false); + public get frequent() { + return this._frequent; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logics - computed: true, optional: false, required: false + private _logics = new DataHuaweicloudDataartsArchitectureModelStatisticLogicsList(this, "logics", false); + public get logics() { + return this._logics; + } + + // physicals - computed: true, optional: false, required: false + private _physicals = new DataHuaweicloudDataartsArchitectureModelStatisticPhysicalsList(this, "physicals", false); + public get physicals() { + return this._physicals; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tops - computed: true, optional: false, required: false + private _tops = new DataHuaweicloudDataartsArchitectureModelStatisticTopsList(this, "tops", false); + public get tops() { + return this._tops; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/README.md new file mode 100644 index 00000000..8be08344 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_architecture_table_models` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_architecture_table_models`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/index.ts new file mode 100644 index 00000000..1f52d3cb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-architecture-table-models/index.ts @@ -0,0 +1,830 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsArchitectureTableModelsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the creator of the table model. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#created_by DataHuaweicloudDataartsArchitectureTableModels#created_by} + */ + readonly createdBy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#id DataHuaweicloudDataartsArchitectureTableModels#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the model ID to which the table model belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#model_id DataHuaweicloudDataartsArchitectureTableModels#model_id} + */ + readonly modelId: string; + /** + * Specifies the Chinese or English name of the table model. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#name DataHuaweicloudDataartsArchitectureTableModels#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#region DataHuaweicloudDataartsArchitectureTableModels#region} + */ + readonly region?: string; + /** + * Specifies the status of the table model. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#status DataHuaweicloudDataartsArchitectureTableModels#status} + */ + readonly status?: string; + /** + * Specifies the subject ID to which the table model belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#subject_id DataHuaweicloudDataartsArchitectureTableModels#subject_id} + */ + readonly subjectId?: string; + /** + * Specifies the workspace ID of DataArts Architecture. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#workspace_id DataHuaweicloudDataartsArchitectureTableModels#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsArchitectureTableModelsTablesAttributes { +} + +export function dataHuaweicloudDataartsArchitectureTableModelsTablesAttributesToTerraform(struct?: DataHuaweicloudDataartsArchitectureTableModelsTablesAttributes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureTableModelsTablesAttributesToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureTableModelsTablesAttributes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureTableModelsTablesAttributesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureTableModelsTablesAttributes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureTableModelsTablesAttributes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_type - computed: true, optional: false, required: false + public get dataType() { + return this.getStringAttribute('data_type'); + } + + // data_type_extend - computed: true, optional: false, required: false + public get dataTypeExtend() { + return this.getStringAttribute('data_type_extend'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_type - computed: true, optional: false, required: false + public get domainType() { + return this.getStringAttribute('domain_type'); + } + + // extend_field - computed: true, optional: false, required: false + public get extendField() { + return this.getBooleanAttribute('extend_field'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_foreign_key - computed: true, optional: false, required: false + public get isForeignKey() { + return this.getBooleanAttribute('is_foreign_key'); + } + + // is_partition_key - computed: true, optional: false, required: false + public get isPartitionKey() { + return this.getBooleanAttribute('is_partition_key'); + } + + // is_primary_key - computed: true, optional: false, required: false + public get isPrimaryKey() { + return this.getBooleanAttribute('is_primary_key'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // name_en - computed: true, optional: false, required: false + public get nameEn() { + return this.getStringAttribute('name_en'); + } + + // not_null - computed: true, optional: false, required: false + public get notNull() { + return this.getBooleanAttribute('not_null'); + } + + // ordinal - computed: true, optional: false, required: false + public get ordinal() { + return this.getNumberAttribute('ordinal'); + } + + // stand_row_id - computed: true, optional: false, required: false + public get standRowId() { + return this.getStringAttribute('stand_row_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDataartsArchitectureTableModelsTablesAttributesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureTableModelsTablesAttributesOutputReference { + return new DataHuaweicloudDataartsArchitectureTableModelsTablesAttributesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsArchitectureTableModelsTables { +} + +export function dataHuaweicloudDataartsArchitectureTableModelsTablesToTerraform(struct?: DataHuaweicloudDataartsArchitectureTableModelsTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsArchitectureTableModelsTablesToHclTerraform(struct?: DataHuaweicloudDataartsArchitectureTableModelsTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsArchitectureTableModelsTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsArchitectureTableModelsTables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsArchitectureTableModelsTables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attributes - computed: true, optional: false, required: false + private _attributes = new DataHuaweicloudDataartsArchitectureTableModelsTablesAttributesList(this, "attributes", false); + public get attributes() { + return this._attributes; + } + + // business_asset_status - computed: true, optional: false, required: false + public get businessAssetStatus() { + return this.getStringAttribute('business_asset_status'); + } + + // catalog_path - computed: true, optional: false, required: false + public get catalogPath() { + return this.getStringAttribute('catalog_path'); + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // compression - computed: true, optional: false, required: false + public get compression() { + return this.getStringAttribute('compression'); + } + + // configs - computed: true, optional: false, required: false + public get configs() { + return this.getStringAttribute('configs'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // data_format - computed: true, optional: false, required: false + public get dataFormat() { + return this.getStringAttribute('data_format'); + } + + // data_quality_status - computed: true, optional: false, required: false + public get dataQualityStatus() { + return this.getStringAttribute('data_quality_status'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dev_physical_table_status - computed: true, optional: false, required: false + public get devPhysicalTableStatus() { + return this.getStringAttribute('dev_physical_table_status'); + } + + // dev_version - computed: true, optional: false, required: false + public get devVersion() { + return this.getStringAttribute('dev_version'); + } + + // dirty_out_database - computed: true, optional: false, required: false + public get dirtyOutDatabase() { + return this.getStringAttribute('dirty_out_database'); + } + + // dirty_out_prefix - computed: true, optional: false, required: false + public get dirtyOutPrefix() { + return this.getStringAttribute('dirty_out_prefix'); + } + + // dirty_out_suffix - computed: true, optional: false, required: false + public get dirtyOutSuffix() { + return this.getStringAttribute('dirty_out_suffix'); + } + + // dirty_out_switch - computed: true, optional: false, required: false + public get dirtyOutSwitch() { + return this.getBooleanAttribute('dirty_out_switch'); + } + + // distribute - computed: true, optional: false, required: false + public get distribute() { + return this.getStringAttribute('distribute'); + } + + // distribute_column - computed: true, optional: false, required: false + public get distributeColumn() { + return this.getStringAttribute('distribute_column'); + } + + // dlf_task_id - computed: true, optional: false, required: false + public get dlfTaskId() { + return this.getStringAttribute('dlf_task_id'); + } + + // dw_id - computed: true, optional: false, required: false + public get dwId() { + return this.getStringAttribute('dw_id'); + } + + // dw_type - computed: true, optional: false, required: false + public get dwType() { + return this.getStringAttribute('dw_type'); + } + + // env_type - computed: true, optional: false, required: false + public get envType() { + return this.getStringAttribute('env_type'); + } + + // extend_info - computed: true, optional: false, required: false + public get extendInfo() { + return this.getStringAttribute('extend_info'); + } + + // has_related_logic_table - computed: true, optional: false, required: false + public get hasRelatedLogicTable() { + return this.getBooleanAttribute('has_related_logic_table'); + } + + // has_related_physical_table - computed: true, optional: false, required: false + public get hasRelatedPhysicalTable() { + return this.getBooleanAttribute('has_related_physical_table'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_partition - computed: true, optional: false, required: false + public get isPartition() { + return this.getBooleanAttribute('is_partition'); + } + + // logic_tb_guid - computed: true, optional: false, required: false + public get logicTbGuid() { + return this.getStringAttribute('logic_tb_guid'); + } + + // logic_tb_id - computed: true, optional: false, required: false + public get logicTbId() { + return this.getStringAttribute('logic_tb_id'); + } + + // meta_data_link_status - computed: true, optional: false, required: false + public get metaDataLinkStatus() { + return this.getStringAttribute('meta_data_link_status'); + } + + // model_id - computed: true, optional: false, required: false + public get modelId() { + return this.getStringAttribute('model_id'); + } + + // obs_location - computed: true, optional: false, required: false + public get obsLocation() { + return this.getStringAttribute('obs_location'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // parent_table_code - computed: true, optional: false, required: false + public get parentTableCode() { + return this.getStringAttribute('parent_table_code'); + } + + // parent_table_id - computed: true, optional: false, required: false + public get parentTableId() { + return this.getStringAttribute('parent_table_id'); + } + + // parent_table_name - computed: true, optional: false, required: false + public get parentTableName() { + return this.getStringAttribute('parent_table_name'); + } + + // partition_conf - computed: true, optional: false, required: false + public get partitionConf() { + return this.getStringAttribute('partition_conf'); + } + + // physical_table_name - computed: true, optional: false, required: false + public get physicalTableName() { + return this.getStringAttribute('physical_table_name'); + } + + // physical_table_status - computed: true, optional: false, required: false + public get physicalTableStatus() { + return this.getStringAttribute('physical_table_status'); + } + + // prod_version - computed: true, optional: false, required: false + public get prodVersion() { + return this.getStringAttribute('prod_version'); + } + + // queue_name - computed: true, optional: false, required: false + public get queueName() { + return this.getStringAttribute('queue_name'); + } + + // related_logic_table_id - computed: true, optional: false, required: false + public get relatedLogicTableId() { + return this.getStringAttribute('related_logic_table_id'); + } + + // schema - computed: true, optional: false, required: false + public get schema() { + return this.getStringAttribute('schema'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subject_id - computed: true, optional: false, required: false + public get subjectId() { + return this.getStringAttribute('subject_id'); + } + + // summary_status - computed: true, optional: false, required: false + public get summaryStatus() { + return this.getStringAttribute('summary_status'); + } + + // table_name - computed: true, optional: false, required: false + public get tableName() { + return this.getStringAttribute('table_name'); + } + + // table_type - computed: true, optional: false, required: false + public get tableType() { + return this.getStringAttribute('table_type'); + } + + // tb_guid - computed: true, optional: false, required: false + public get tbGuid() { + return this.getStringAttribute('tb_guid'); + } + + // tb_id - computed: true, optional: false, required: false + public get tbId() { + return this.getStringAttribute('tb_id'); + } + + // technical_asset_status - computed: true, optional: false, required: false + public get technicalAssetStatus() { + return this.getStringAttribute('technical_asset_status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // use_recently_partition - computed: true, optional: false, required: false + public get useRecentlyPartition() { + return this.getBooleanAttribute('use_recently_partition'); + } +} + +export class DataHuaweicloudDataartsArchitectureTableModelsTablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsArchitectureTableModelsTablesOutputReference { + return new DataHuaweicloudDataartsArchitectureTableModelsTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models huaweicloud_dataarts_architecture_table_models} +*/ +export class DataHuaweicloudDataartsArchitectureTableModels extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_table_models"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsArchitectureTableModels resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsArchitectureTableModels to import + * @param importFromId The id of the existing DataHuaweicloudDataartsArchitectureTableModels that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsArchitectureTableModels to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_table_models", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_architecture_table_models huaweicloud_dataarts_architecture_table_models} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsArchitectureTableModelsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsArchitectureTableModelsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_table_models', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._createdBy = config.createdBy; + this._id = config.id; + this._modelId = config.modelId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._subjectId = config.subjectId; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_by - computed: false, optional: true, required: false + private _createdBy?: string; + public get createdBy() { + return this.getStringAttribute('created_by'); + } + public set createdBy(value: string) { + this._createdBy = value; + } + public resetCreatedBy() { + this._createdBy = undefined; + } + // Temporarily expose input value. Use with caution. + public get createdByInput() { + return this._createdBy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // model_id - computed: false, optional: false, required: true + private _modelId?: string; + public get modelId() { + return this.getStringAttribute('model_id'); + } + public set modelId(value: string) { + this._modelId = value; + } + // Temporarily expose input value. Use with caution. + public get modelIdInput() { + return this._modelId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subject_id - computed: false, optional: true, required: false + private _subjectId?: string; + public get subjectId() { + return this.getStringAttribute('subject_id'); + } + public set subjectId(value: string) { + this._subjectId = value; + } + public resetSubjectId() { + this._subjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subjectIdInput() { + return this._subjectId; + } + + // tables - computed: true, optional: false, required: false + private _tables = new DataHuaweicloudDataartsArchitectureTableModelsTablesList(this, "tables", false); + public get tables() { + return this._tables; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + created_by: cdktf.stringToTerraform(this._createdBy), + id: cdktf.stringToTerraform(this._id), + model_id: cdktf.stringToTerraform(this._modelId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + subject_id: cdktf.stringToTerraform(this._subjectId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + created_by: { + value: cdktf.stringToHclTerraform(this._createdBy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_id: { + value: cdktf.stringToHclTerraform(this._modelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subject_id: { + value: cdktf.stringToHclTerraform(this._subjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/README.md new file mode 100644 index 00000000..142d375d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_dataservice_apis` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_dataservice_apis`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/index.ts new file mode 100644 index 00000000..44018a45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apis/index.ts @@ -0,0 +1,1352 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsDataserviceApisConfig extends cdktf.TerraformMetaArguments { + /** + * The API ID to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#api_id DataHuaweicloudDataartsDataserviceApis#api_id} + */ + readonly apiId?: string; + /** + * The API creator to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#create_user DataHuaweicloudDataartsDataserviceApis#create_user} + */ + readonly createUser?: string; + /** + * The data table name used by API to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#datatable DataHuaweicloudDataartsDataserviceApis#datatable} + */ + readonly datatable?: string; + /** + * The API description to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#description DataHuaweicloudDataartsDataserviceApis#description} + */ + readonly description?: string; + /** + * The type of DLM engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#dlm_type DataHuaweicloudDataartsDataserviceApis#dlm_type} + */ + readonly dlmType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#id DataHuaweicloudDataartsDataserviceApis#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The API name to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#name DataHuaweicloudDataartsDataserviceApis#name} + */ + readonly name?: string; + /** + * The region where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#region DataHuaweicloudDataartsDataserviceApis#region} + */ + readonly region?: string; + /** + * The API type to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#type DataHuaweicloudDataartsDataserviceApis#type} + */ + readonly type?: string; + /** + * The ID of the workspace to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#workspace_id DataHuaweicloudDataartsDataserviceApis#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParams { +} + +export function dataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backend_param_name - computed: true, optional: false, required: false + public get backendParamName() { + return this.getStringAttribute('backend_param_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // position - computed: true, optional: false, required: false + public get position() { + return this.getStringAttribute('position'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParams { +} + +export function dataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // position - computed: true, optional: false, required: false + public get position() { + return this.getStringAttribute('position'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisBackendConfig { +} + +export function dataHuaweicloudDataartsDataserviceApisApisBackendConfigToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisBackendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisBackendConfigToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisBackendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisBackendConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisBackendConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisBackendConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backend_params - computed: true, optional: false, required: false + private _backendParams = new DataHuaweicloudDataartsDataserviceApisApisBackendConfigBackendParamsList(this, "backend_params", false); + public get backendParams() { + return this._backendParams; + } + + // constant_params - computed: true, optional: false, required: false + private _constantParams = new DataHuaweicloudDataartsDataserviceApisApisBackendConfigConstantParamsList(this, "constant_params", false); + public get constantParams() { + return this._constantParams; + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisBackendConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisBackendConfigOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisBackendConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParams { +} + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // condition - computed: true, optional: false, required: false + public get condition() { + return this.getStringAttribute('condition'); + } + + // mapping - computed: true, optional: false, required: false + public get mapping() { + return this.getStringAttribute('mapping'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParams { +} + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // optional - computed: true, optional: false, required: false + public get optional() { + return this.getBooleanAttribute('optional'); + } + + // order - computed: true, optional: false, required: false + public get order() { + return this.getNumberAttribute('order'); + } + + // sort - computed: true, optional: false, required: false + public get sort() { + return this.getStringAttribute('sort'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParams { +} + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // example_value - computed: true, optional: false, required: false + public get exampleValue() { + return this.getStringAttribute('example_value'); + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisDatasourceConfig { +} + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisDatasourceConfigToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisDatasourceConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_mode - computed: true, optional: false, required: false + public get accessMode() { + return this.getStringAttribute('access_mode'); + } + + // backend_params - computed: true, optional: false, required: false + private _backendParams = new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigBackendParamsList(this, "backend_params", false); + public get backendParams() { + return this._backendParams; + } + + // connection_id - computed: true, optional: false, required: false + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + + // connection_name - computed: true, optional: false, required: false + public get connectionName() { + return this.getStringAttribute('connection_name'); + } + + // database - computed: true, optional: false, required: false + public get database() { + return this.getStringAttribute('database'); + } + + // datatable - computed: true, optional: false, required: false + public get datatable() { + return this.getStringAttribute('datatable'); + } + + // order_params - computed: true, optional: false, required: false + private _orderParams = new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOrderParamsList(this, "order_params", false); + public get orderParams() { + return this._orderParams; + } + + // queue - computed: true, optional: false, required: false + public get queue() { + return this.getStringAttribute('queue'); + } + + // response_params - computed: true, optional: false, required: false + private _responseParams = new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigResponseParamsList(this, "response_params", false); + public get responseParams() { + return this._responseParams; + } + + // sql - computed: true, optional: false, required: false + public get sql() { + return this.getStringAttribute('sql'); + } + + // table_id - computed: true, optional: false, required: false + public get tableId() { + return this.getStringAttribute('table_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApisRequestParams { +} + +export function dataHuaweicloudDataartsDataserviceApisApisRequestParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisRequestParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisRequestParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApisRequestParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisRequestParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApisRequestParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApisRequestParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default_value - computed: true, optional: false, required: false + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // example_value - computed: true, optional: false, required: false + public get exampleValue() { + return this.getStringAttribute('example_value'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // necessary - computed: true, optional: false, required: false + public get necessary() { + return this.getBooleanAttribute('necessary'); + } + + // position - computed: true, optional: false, required: false + public get position() { + return this.getStringAttribute('position'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisRequestParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisRequestParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisRequestParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceApisApis { +} + +export function dataHuaweicloudDataartsDataserviceApisApisToTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApis): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceApisApisToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceApisApis): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceApisApisOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceApisApis | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceApisApis | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backend_config - computed: true, optional: false, required: false + private _backendConfig = new DataHuaweicloudDataartsDataserviceApisApisBackendConfigList(this, "backend_config", false); + public get backendConfig() { + return this._backendConfig; + } + + // create_user - computed: true, optional: false, required: false + public get createUser() { + return this.getStringAttribute('create_user'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datasource_config - computed: true, optional: false, required: false + private _datasourceConfig = new DataHuaweicloudDataartsDataserviceApisApisDatasourceConfigList(this, "datasource_config", false); + public get datasourceConfig() { + return this._datasourceConfig; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // hosts - computed: true, optional: false, required: false + public get hosts() { + return this.getListAttribute('hosts'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // manager - computed: true, optional: false, required: false + public get manager() { + return this.getStringAttribute('manager'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // request_params - computed: true, optional: false, required: false + private _requestParams = new DataHuaweicloudDataartsDataserviceApisApisRequestParamsList(this, "request_params", false); + public get requestParams() { + return this._requestParams; + } + + // request_type - computed: true, optional: false, required: false + public get requestType() { + return this.getStringAttribute('request_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDataartsDataserviceApisApisList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceApisApisOutputReference { + return new DataHuaweicloudDataartsDataserviceApisApisOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis huaweicloud_dataarts_dataservice_apis} +*/ +export class DataHuaweicloudDataartsDataserviceApis extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_apis"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsDataserviceApis resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsDataserviceApis to import + * @param importFromId The id of the existing DataHuaweicloudDataartsDataserviceApis that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsDataserviceApis to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_apis", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apis huaweicloud_dataarts_dataservice_apis} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsDataserviceApisConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsDataserviceApisConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_apis', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._createUser = config.createUser; + this._datatable = config.datatable; + this._description = config.description; + this._dlmType = config.dlmType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: true, required: false + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + public resetApiId() { + this._apiId = undefined; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // apis - computed: true, optional: false, required: false + private _apis = new DataHuaweicloudDataartsDataserviceApisApisList(this, "apis", false); + public get apis() { + return this._apis; + } + + // create_user - computed: false, optional: true, required: false + private _createUser?: string; + public get createUser() { + return this.getStringAttribute('create_user'); + } + public set createUser(value: string) { + this._createUser = value; + } + public resetCreateUser() { + this._createUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get createUserInput() { + return this._createUser; + } + + // datatable - computed: false, optional: true, required: false + private _datatable?: string; + public get datatable() { + return this.getStringAttribute('datatable'); + } + public set datatable(value: string) { + this._datatable = value; + } + public resetDatatable() { + this._datatable = undefined; + } + // Temporarily expose input value. Use with caution. + public get datatableInput() { + return this._datatable; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dlm_type - computed: false, optional: true, required: false + private _dlmType?: string; + public get dlmType() { + return this.getStringAttribute('dlm_type'); + } + public set dlmType(value: string) { + this._dlmType = value; + } + public resetDlmType() { + this._dlmType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dlmTypeInput() { + return this._dlmType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + create_user: cdktf.stringToTerraform(this._createUser), + datatable: cdktf.stringToTerraform(this._datatable), + description: cdktf.stringToTerraform(this._description), + dlm_type: cdktf.stringToTerraform(this._dlmType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + create_user: { + value: cdktf.stringToHclTerraform(this._createUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + datatable: { + value: cdktf.stringToHclTerraform(this._datatable), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dlm_type: { + value: cdktf.stringToHclTerraform(this._dlmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/README.md new file mode 100644 index 00000000..1fe8ba9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_dataservice_apps` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_dataservice_apps`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/index.ts new file mode 100644 index 00000000..98926671 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-apps/index.ts @@ -0,0 +1,359 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsDataserviceAppsConfig extends cdktf.TerraformMetaArguments { + /** + * The type of DLM engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps#dlm_type DataHuaweicloudDataartsDataserviceApps#dlm_type} + */ + readonly dlmType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps#id DataHuaweicloudDataartsDataserviceApps#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the applications to be fuzzy queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps#name DataHuaweicloudDataartsDataserviceApps#name} + */ + readonly name?: string; + /** + * The region where the applications are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps#region DataHuaweicloudDataartsDataserviceApps#region} + */ + readonly region?: string; + /** + * The ID of the workspace to which the applications belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps#workspace_id DataHuaweicloudDataartsDataserviceApps#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsDataserviceAppsApps { +} + +export function dataHuaweicloudDataartsDataserviceAppsAppsToTerraform(struct?: DataHuaweicloudDataartsDataserviceAppsApps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceAppsAppsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceAppsApps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceAppsAppsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceAppsApps | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceAppsApps | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_key - computed: true, optional: false, required: false + public get appKey() { + return this.getStringAttribute('app_key'); + } + + // app_secret - computed: true, optional: false, required: false + public get appSecret() { + return this.getStringAttribute('app_secret'); + } + + // app_type - computed: true, optional: false, required: false + public get appType() { + return this.getStringAttribute('app_type'); + } + + // create_user - computed: true, optional: false, required: false + public get createUser() { + return this.getStringAttribute('create_user'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // update_user - computed: true, optional: false, required: false + public get updateUser() { + return this.getStringAttribute('update_user'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDataartsDataserviceAppsAppsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceAppsAppsOutputReference { + return new DataHuaweicloudDataartsDataserviceAppsAppsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps huaweicloud_dataarts_dataservice_apps} +*/ +export class DataHuaweicloudDataartsDataserviceApps extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_apps"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsDataserviceApps resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsDataserviceApps to import + * @param importFromId The id of the existing DataHuaweicloudDataartsDataserviceApps that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsDataserviceApps to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_apps", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_apps huaweicloud_dataarts_dataservice_apps} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsDataserviceAppsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsDataserviceAppsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_apps', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dlmType = config.dlmType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // apps - computed: true, optional: false, required: false + private _apps = new DataHuaweicloudDataartsDataserviceAppsAppsList(this, "apps", false); + public get apps() { + return this._apps; + } + + // dlm_type - computed: false, optional: true, required: false + private _dlmType?: string; + public get dlmType() { + return this.getStringAttribute('dlm_type'); + } + public set dlmType(value: string) { + this._dlmType = value; + } + public resetDlmType() { + this._dlmType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dlmTypeInput() { + return this._dlmType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dlm_type: cdktf.stringToTerraform(this._dlmType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dlm_type: { + value: cdktf.stringToHclTerraform(this._dlmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/README.md new file mode 100644 index 00000000..2ea5bead --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_dataservice_authorized_apps` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_dataservice_authorized_apps`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/index.ts new file mode 100644 index 00000000..e28ceea8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-authorized-apps/index.ts @@ -0,0 +1,427 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsDataserviceAuthorizedAppsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API used to authorize the APPs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps#api_id DataHuaweicloudDataartsDataserviceAuthorizedApps#api_id} + */ + readonly apiId: string; + /** + * The type of DLM engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps#dlm_type DataHuaweicloudDataartsDataserviceAuthorizedApps#dlm_type} + */ + readonly dlmType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps#id DataHuaweicloudDataartsDataserviceAuthorizedApps#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps#region DataHuaweicloudDataartsDataserviceAuthorizedApps#region} + */ + readonly region?: string; + /** + * The ID of the workspace to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps#workspace_id DataHuaweicloudDataartsDataserviceAuthorizedApps#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParams { +} + +export function dataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsToTerraform(struct?: DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsOutputReference { + return new DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceAuthorizedAppsApps { +} + +export function dataHuaweicloudDataartsDataserviceAuthorizedAppsAppsToTerraform(struct?: DataHuaweicloudDataartsDataserviceAuthorizedAppsApps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceAuthorizedAppsAppsToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceAuthorizedAppsApps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceAuthorizedAppsApps | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceAuthorizedAppsApps | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // approved_at - computed: true, optional: false, required: false + public get approvedAt() { + return this.getStringAttribute('approved_at'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // relationship_type - computed: true, optional: false, required: false + public get relationshipType() { + return this.getStringAttribute('relationship_type'); + } + + // static_params - computed: true, optional: false, required: false + private _staticParams = new DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsStaticParamsList(this, "static_params", false); + public get staticParams() { + return this._staticParams; + } +} + +export class DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsOutputReference { + return new DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps huaweicloud_dataarts_dataservice_authorized_apps} +*/ +export class DataHuaweicloudDataartsDataserviceAuthorizedApps extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_authorized_apps"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsDataserviceAuthorizedApps resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsDataserviceAuthorizedApps to import + * @param importFromId The id of the existing DataHuaweicloudDataartsDataserviceAuthorizedApps that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsDataserviceAuthorizedApps to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_authorized_apps", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_authorized_apps huaweicloud_dataarts_dataservice_authorized_apps} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsDataserviceAuthorizedAppsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsDataserviceAuthorizedAppsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_authorized_apps', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._dlmType = config.dlmType; + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // apps - computed: true, optional: false, required: false + private _apps = new DataHuaweicloudDataartsDataserviceAuthorizedAppsAppsList(this, "apps", false); + public get apps() { + return this._apps; + } + + // dlm_type - computed: false, optional: true, required: false + private _dlmType?: string; + public get dlmType() { + return this.getStringAttribute('dlm_type'); + } + public set dlmType(value: string) { + this._dlmType = value; + } + public resetDlmType() { + this._dlmType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dlmTypeInput() { + return this._dlmType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + dlm_type: cdktf.stringToTerraform(this._dlmType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dlm_type: { + value: cdktf.stringToHclTerraform(this._dlmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/README.md new file mode 100644 index 00000000..35b8152f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_dataservice_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_dataservice_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/index.ts new file mode 100644 index 00000000..90191d94 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-instances/index.ts @@ -0,0 +1,641 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsDataserviceInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * The create user name of the exclusive clusters to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances#create_user DataHuaweicloudDataartsDataserviceInstances#create_user} + */ + readonly createUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances#id DataHuaweicloudDataartsDataserviceInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster name to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances#name DataHuaweicloudDataartsDataserviceInstances#name} + */ + readonly name?: string; + /** + * The region where the exclusive clusters are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances#region DataHuaweicloudDataartsDataserviceInstances#region} + */ + readonly region?: string; + /** + * The ID of the workspace to which the exclusive clusters belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances#workspace_id DataHuaweicloudDataartsDataserviceInstances#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsDataserviceInstancesInstancesFlavor { +} + +export function dataHuaweicloudDataartsDataserviceInstancesInstancesFlavorToTerraform(struct?: DataHuaweicloudDataartsDataserviceInstancesInstancesFlavor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceInstancesInstancesFlavorToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceInstancesInstancesFlavor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceInstancesInstancesFlavorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceInstancesInstancesFlavor | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceInstancesInstancesFlavor | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // disk_size - computed: true, optional: false, required: false + public get diskSize() { + return this.getNumberAttribute('disk_size'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudDataartsDataserviceInstancesInstancesFlavorList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceInstancesInstancesFlavorOutputReference { + return new DataHuaweicloudDataartsDataserviceInstancesInstancesFlavorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceInstancesInstancesNodes { +} + +export function dataHuaweicloudDataartsDataserviceInstancesInstancesNodesToTerraform(struct?: DataHuaweicloudDataartsDataserviceInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceInstancesInstancesNodesToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceInstancesInstancesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceInstancesInstancesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceInstancesInstancesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // create_user - computed: true, optional: false, required: false + public get createUser() { + return this.getStringAttribute('create_user'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // gateway_version - computed: true, optional: false, required: false + public get gatewayVersion() { + return this.getStringAttribute('gateway_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDataartsDataserviceInstancesInstancesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceInstancesInstancesNodesOutputReference { + return new DataHuaweicloudDataartsDataserviceInstancesInstancesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDataartsDataserviceInstancesInstances { +} + +export function dataHuaweicloudDataartsDataserviceInstancesInstancesToTerraform(struct?: DataHuaweicloudDataartsDataserviceInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // all_namespace_publish_api_num - computed: true, optional: false, required: false + public get allNamespacePublishApiNum() { + return this.getNumberAttribute('all_namespace_publish_api_num'); + } + + // api_publishable_num - computed: true, optional: false, required: false + public get apiPublishableNum() { + return this.getNumberAttribute('api_publishable_num'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // create_user - computed: true, optional: false, required: false + public get createUser() { + return this.getStringAttribute('create_user'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_namespace_publish_api_num - computed: true, optional: false, required: false + public get currentNamespacePublishApiNum() { + return this.getNumberAttribute('current_namespace_publish_api_num'); + } + + // deletable - computed: true, optional: false, required: false + public get deletable() { + return this.getBooleanAttribute('deletable'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // external_address - computed: true, optional: false, required: false + public get externalAddress() { + return this.getStringAttribute('external_address'); + } + + // flavor - computed: true, optional: false, required: false + private _flavor = new DataHuaweicloudDataartsDataserviceInstancesInstancesFlavorList(this, "flavor", false); + public get flavor() { + return this._flavor; + } + + // gateway_version - computed: true, optional: false, required: false + public get gatewayVersion() { + return this.getStringAttribute('gateway_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // intranet_address - computed: true, optional: false, required: false + public get intranetAddress() { + return this.getStringAttribute('intranet_address'); + } + + // intranet_address_ipv6 - computed: true, optional: false, required: false + public get intranetAddressIpv6() { + return this.getStringAttribute('intranet_address_ipv6'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudDataartsDataserviceInstancesInstancesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // private_zone_id - computed: true, optional: false, required: false + public get privateZoneId() { + return this.getStringAttribute('private_zone_id'); + } + + // private_zone_name - computed: true, optional: false, required: false + public get privateZoneName() { + return this.getStringAttribute('private_zone_name'); + } + + // public_zone_id - computed: true, optional: false, required: false + public get publicZoneId() { + return this.getStringAttribute('public_zone_id'); + } + + // public_zone_name - computed: true, optional: false, required: false + public get publicZoneName() { + return this.getStringAttribute('public_zone_name'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDataartsDataserviceInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceInstancesInstancesOutputReference { + return new DataHuaweicloudDataartsDataserviceInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances huaweicloud_dataarts_dataservice_instances} +*/ +export class DataHuaweicloudDataartsDataserviceInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsDataserviceInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsDataserviceInstances to import + * @param importFromId The id of the existing DataHuaweicloudDataartsDataserviceInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsDataserviceInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_instances huaweicloud_dataarts_dataservice_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsDataserviceInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsDataserviceInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._createUser = config.createUser; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_user - computed: false, optional: true, required: false + private _createUser?: string; + public get createUser() { + return this.getStringAttribute('create_user'); + } + public set createUser(value: string) { + this._createUser = value; + } + public resetCreateUser() { + this._createUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get createUserInput() { + return this._createUser; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDataartsDataserviceInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + create_user: cdktf.stringToTerraform(this._createUser), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + create_user: { + value: cdktf.stringToHclTerraform(this._createUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/README.md new file mode 100644 index 00000000..25abac36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_dataservice_messages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_dataservice_messages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/index.ts new file mode 100644 index 00000000..9f9ade29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-dataservice-messages/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsDataserviceMessagesConfig extends cdktf.TerraformMetaArguments { + /** + * The name of the API to be approved. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages#api_name DataHuaweicloudDataartsDataserviceMessages#api_name} + */ + readonly apiName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages#id DataHuaweicloudDataartsDataserviceMessages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the approval messages are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages#region DataHuaweicloudDataartsDataserviceMessages#region} + */ + readonly region?: string; + /** + * The workspace ID of the exclusive API to which the approval message belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages#workspace_id DataHuaweicloudDataartsDataserviceMessages#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsDataserviceMessagesMessages { +} + +export function dataHuaweicloudDataartsDataserviceMessagesMessagesToTerraform(struct?: DataHuaweicloudDataartsDataserviceMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsDataserviceMessagesMessagesToHclTerraform(struct?: DataHuaweicloudDataartsDataserviceMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsDataserviceMessagesMessagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsDataserviceMessagesMessages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsDataserviceMessagesMessages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // api_apply_status - computed: true, optional: false, required: false + public get apiApplyStatus() { + return this.getStringAttribute('api_apply_status'); + } + + // api_apply_type - computed: true, optional: false, required: false + public get apiApplyType() { + return this.getStringAttribute('api_apply_type'); + } + + // api_id - computed: true, optional: false, required: false + public get apiId() { + return this.getStringAttribute('api_id'); + } + + // api_name - computed: true, optional: false, required: false + public get apiName() { + return this.getStringAttribute('api_name'); + } + + // api_using_time - computed: true, optional: false, required: false + public get apiUsingTime() { + return this.getStringAttribute('api_using_time'); + } + + // app_id - computed: true, optional: false, required: false + public get appId() { + return this.getStringAttribute('app_id'); + } + + // app_name - computed: true, optional: false, required: false + public get appName() { + return this.getStringAttribute('app_name'); + } + + // apply_time - computed: true, optional: false, required: false + public get applyTime() { + return this.getStringAttribute('apply_time'); + } + + // approval_time - computed: true, optional: false, required: false + public get approvalTime() { + return this.getStringAttribute('approval_time'); + } + + // approver_name - computed: true, optional: false, required: false + public get approverName() { + return this.getStringAttribute('approver_name'); + } + + // comment - computed: true, optional: false, required: false + public get comment() { + return this.getStringAttribute('comment'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudDataartsDataserviceMessagesMessagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsDataserviceMessagesMessagesOutputReference { + return new DataHuaweicloudDataartsDataserviceMessagesMessagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages huaweicloud_dataarts_dataservice_messages} +*/ +export class DataHuaweicloudDataartsDataserviceMessages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_messages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsDataserviceMessages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsDataserviceMessages to import + * @param importFromId The id of the existing DataHuaweicloudDataartsDataserviceMessages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsDataserviceMessages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_messages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_dataservice_messages huaweicloud_dataarts_dataservice_messages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsDataserviceMessagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsDataserviceMessagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_messages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiName = config.apiName; + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_name - computed: false, optional: true, required: false + private _apiName?: string; + public get apiName() { + return this.getStringAttribute('api_name'); + } + public set apiName(value: string) { + this._apiName = value; + } + public resetApiName() { + this._apiName = undefined; + } + // Temporarily expose input value. Use with caution. + public get apiNameInput() { + return this._apiName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // messages - computed: true, optional: false, required: false + private _messages = new DataHuaweicloudDataartsDataserviceMessagesMessagesList(this, "messages", false); + public get messages() { + return this._messages; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_name: cdktf.stringToTerraform(this._apiName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_name: { + value: cdktf.stringToHclTerraform(this._apiName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/README.md new file mode 100644 index 00000000..074ab2be --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_factory_jobs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_factory_jobs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/index.ts new file mode 100644 index 00000000..15b3791e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-factory-jobs/index.ts @@ -0,0 +1,385 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsFactoryJobsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs#id DataHuaweicloudDataartsFactoryJobs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specified the job name to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs#name DataHuaweicloudDataartsFactoryJobs#name} + */ + readonly name?: string; + /** + * Specified the job type to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs#process_type DataHuaweicloudDataartsFactoryJobs#process_type} + */ + readonly processType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs#region DataHuaweicloudDataartsFactoryJobs#region} + */ + readonly region?: string; + /** + * The ID of the workspace to which the jobs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs#workspace_id DataHuaweicloudDataartsFactoryJobs#workspace_id} + */ + readonly workspaceId?: string; +} +export interface DataHuaweicloudDataartsFactoryJobsJobs { +} + +export function dataHuaweicloudDataartsFactoryJobsJobsToTerraform(struct?: DataHuaweicloudDataartsFactoryJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsFactoryJobsJobsToHclTerraform(struct?: DataHuaweicloudDataartsFactoryJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsFactoryJobsJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsFactoryJobsJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsFactoryJobsJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // directory - computed: true, optional: false, required: false + public get directory() { + return this.getStringAttribute('directory'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // is_single_task_job - computed: true, optional: false, required: false + public get isSingleTaskJob() { + return this.getBooleanAttribute('is_single_task_job'); + } + + // last_instance_end_time - computed: true, optional: false, required: false + public get lastInstanceEndTime() { + return this.getStringAttribute('last_instance_end_time'); + } + + // last_instance_status - computed: true, optional: false, required: false + public get lastInstanceStatus() { + return this.getStringAttribute('last_instance_status'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // process_type - computed: true, optional: false, required: false + public get processType() { + return this.getStringAttribute('process_type'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsFactoryJobsJobsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsFactoryJobsJobsOutputReference { + return new DataHuaweicloudDataartsFactoryJobsJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs huaweicloud_dataarts_factory_jobs} +*/ +export class DataHuaweicloudDataartsFactoryJobs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_factory_jobs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsFactoryJobs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsFactoryJobs to import + * @param importFromId The id of the existing DataHuaweicloudDataartsFactoryJobs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsFactoryJobs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_factory_jobs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_factory_jobs huaweicloud_dataarts_factory_jobs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsFactoryJobsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsFactoryJobsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_factory_jobs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._processType = config.processType; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // jobs - computed: true, optional: false, required: false + private _jobs = new DataHuaweicloudDataartsFactoryJobsJobsList(this, "jobs", false); + public get jobs() { + return this._jobs; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // process_type - computed: false, optional: true, required: false + private _processType?: string; + public get processType() { + return this.getStringAttribute('process_type'); + } + public set processType(value: string) { + this._processType = value; + } + public resetProcessType() { + this._processType = undefined; + } + // Temporarily expose input value. Use with caution. + public get processTypeInput() { + return this._processType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + process_type: cdktf.stringToTerraform(this._processType), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + process_type: { + value: cdktf.stringToHclTerraform(this._processType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/README.md new file mode 100644 index 00000000..66a8313d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_quality_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_quality_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/index.ts new file mode 100644 index 00000000..3e64b4b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-quality-tasks/index.ts @@ -0,0 +1,444 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsQualityTasksConfig extends cdktf.TerraformMetaArguments { + /** + * The category ID to which the quality tasks belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#category_id DataHuaweicloudDataartsQualityTasks#category_id} + */ + readonly categoryId?: string; + /** + * The name of the quality task creator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#creator DataHuaweicloudDataartsQualityTasks#creator} + */ + readonly creator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#id DataHuaweicloudDataartsQualityTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the quality task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#name DataHuaweicloudDataartsQualityTasks#name} + */ + readonly name?: string; + /** + * The region where the quality tasks are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#region DataHuaweicloudDataartsQualityTasks#region} + */ + readonly region?: string; + /** + * The schedule status of the quality task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#schedule_status DataHuaweicloudDataartsQualityTasks#schedule_status} + */ + readonly scheduleStatus?: string; + /** + * The start time of the query interval for the most recent run time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#start_time DataHuaweicloudDataartsQualityTasks#start_time} + */ + readonly startTime?: string; + /** + * The workspace ID to which the quality tasks belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#workspace_id DataHuaweicloudDataartsQualityTasks#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsQualityTasksTasks { +} + +export function dataHuaweicloudDataartsQualityTasksTasksToTerraform(struct?: DataHuaweicloudDataartsQualityTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsQualityTasksTasksToHclTerraform(struct?: DataHuaweicloudDataartsQualityTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsQualityTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsQualityTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsQualityTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category_id - computed: true, optional: false, required: false + public get categoryId() { + return this.getStringAttribute('category_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // last_run_time - computed: true, optional: false, required: false + public get lastRunTime() { + return this.getStringAttribute('last_run_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // schedule_interval - computed: true, optional: false, required: false + public get scheduleInterval() { + return this.getStringAttribute('schedule_interval'); + } + + // schedule_period - computed: true, optional: false, required: false + public get schedulePeriod() { + return this.getStringAttribute('schedule_period'); + } + + // schedule_status - computed: true, optional: false, required: false + public get scheduleStatus() { + return this.getStringAttribute('schedule_status'); + } +} + +export class DataHuaweicloudDataartsQualityTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsQualityTasksTasksOutputReference { + return new DataHuaweicloudDataartsQualityTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks huaweicloud_dataarts_quality_tasks} +*/ +export class DataHuaweicloudDataartsQualityTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_quality_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsQualityTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsQualityTasks to import + * @param importFromId The id of the existing DataHuaweicloudDataartsQualityTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsQualityTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_quality_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_quality_tasks huaweicloud_dataarts_quality_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsQualityTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsQualityTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_quality_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._categoryId = config.categoryId; + this._creator = config.creator; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._scheduleStatus = config.scheduleStatus; + this._startTime = config.startTime; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // category_id - computed: false, optional: true, required: false + private _categoryId?: string; + public get categoryId() { + return this.getStringAttribute('category_id'); + } + public set categoryId(value: string) { + this._categoryId = value; + } + public resetCategoryId() { + this._categoryId = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryIdInput() { + return this._categoryId; + } + + // creator - computed: false, optional: true, required: false + private _creator?: string; + public get creator() { + return this.getStringAttribute('creator'); + } + public set creator(value: string) { + this._creator = value; + } + public resetCreator() { + this._creator = undefined; + } + // Temporarily expose input value. Use with caution. + public get creatorInput() { + return this._creator; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schedule_status - computed: false, optional: true, required: false + private _scheduleStatus?: string; + public get scheduleStatus() { + return this.getStringAttribute('schedule_status'); + } + public set scheduleStatus(value: string) { + this._scheduleStatus = value; + } + public resetScheduleStatus() { + this._scheduleStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleStatusInput() { + return this._scheduleStatus; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDataartsQualityTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category_id: cdktf.stringToTerraform(this._categoryId), + creator: cdktf.stringToTerraform(this._creator), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + schedule_status: cdktf.stringToTerraform(this._scheduleStatus), + start_time: cdktf.stringToTerraform(this._startTime), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category_id: { + value: cdktf.stringToHclTerraform(this._categoryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + creator: { + value: cdktf.stringToHclTerraform(this._creator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_status: { + value: cdktf.stringToHclTerraform(this._scheduleStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/README.md new file mode 100644 index 00000000..716f3a08 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_studio_data_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_studio_data_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/index.ts new file mode 100644 index 00000000..99dafb16 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-data-connections/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsStudioDataConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the data connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#connection_id DataHuaweicloudDataartsStudioDataConnections#connection_id} + */ + readonly connectionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#id DataHuaweicloudDataartsStudioDataConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the data connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#name DataHuaweicloudDataartsStudioDataConnections#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#region DataHuaweicloudDataartsStudioDataConnections#region} + */ + readonly region?: string; + /** + * Specifies the type of the data connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#type DataHuaweicloudDataartsStudioDataConnections#type} + */ + readonly type?: string; + /** + * Specifies the ID of the workspace to which the data connection belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#workspace_id DataHuaweicloudDataartsStudioDataConnections#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudDataartsStudioDataConnectionsConnections { +} + +export function dataHuaweicloudDataartsStudioDataConnectionsConnectionsToTerraform(struct?: DataHuaweicloudDataartsStudioDataConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsStudioDataConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudDataartsStudioDataConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsStudioDataConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsStudioDataConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsStudioDataConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agent_id - computed: true, optional: false, required: false + public get agentId() { + return this.getStringAttribute('agent_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // qualified_name - computed: true, optional: false, required: false + public get qualifiedName() { + return this.getStringAttribute('qualified_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDataartsStudioDataConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsStudioDataConnectionsConnectionsOutputReference { + return new DataHuaweicloudDataartsStudioDataConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections huaweicloud_dataarts_studio_data_connections} +*/ +export class DataHuaweicloudDataartsStudioDataConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_studio_data_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsStudioDataConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsStudioDataConnections to import + * @param importFromId The id of the existing DataHuaweicloudDataartsStudioDataConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsStudioDataConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_studio_data_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_data_connections huaweicloud_dataarts_studio_data_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsStudioDataConnectionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsStudioDataConnectionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_studio_data_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudDataartsStudioDataConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/README.md new file mode 100644 index 00000000..a20913f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dataarts_studio_workspaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dataarts_studio_workspaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/index.ts new file mode 100644 index 00000000..174a650a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dataarts-studio-workspaces/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDataartsStudioWorkspacesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#created_by DataHuaweicloudDataartsStudioWorkspaces#created_by} + */ + readonly createdBy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#enterprise_project_id DataHuaweicloudDataartsStudioWorkspaces#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#id DataHuaweicloudDataartsStudioWorkspaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#instance_id DataHuaweicloudDataartsStudioWorkspaces#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#name DataHuaweicloudDataartsStudioWorkspaces#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#region DataHuaweicloudDataartsStudioWorkspaces#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#workspace_id DataHuaweicloudDataartsStudioWorkspaces#workspace_id} + */ + readonly workspaceId?: string; +} +export interface DataHuaweicloudDataartsStudioWorkspacesWorkspaces { +} + +export function dataHuaweicloudDataartsStudioWorkspacesWorkspacesToTerraform(struct?: DataHuaweicloudDataartsStudioWorkspacesWorkspaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDataartsStudioWorkspacesWorkspacesToHclTerraform(struct?: DataHuaweicloudDataartsStudioWorkspacesWorkspaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDataartsStudioWorkspacesWorkspacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDataartsStudioWorkspacesWorkspaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDataartsStudioWorkspacesWorkspaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bad_record_location_name - computed: true, optional: false, required: false + public get badRecordLocationName() { + return this.getStringAttribute('bad_record_location_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_default - computed: true, optional: false, required: false + public get isDefault() { + return this.getNumberAttribute('is_default'); + } + + // job_log_location_name - computed: true, optional: false, required: false + public get jobLogLocationName() { + return this.getStringAttribute('job_log_location_name'); + } + + // member_num - computed: true, optional: false, required: false + public get memberNum() { + return this.getNumberAttribute('member_num'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudDataartsStudioWorkspacesWorkspacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDataartsStudioWorkspacesWorkspacesOutputReference { + return new DataHuaweicloudDataartsStudioWorkspacesWorkspacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces huaweicloud_dataarts_studio_workspaces} +*/ +export class DataHuaweicloudDataartsStudioWorkspaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_studio_workspaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDataartsStudioWorkspaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDataartsStudioWorkspaces to import + * @param importFromId The id of the existing DataHuaweicloudDataartsStudioWorkspaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDataartsStudioWorkspaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_studio_workspaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dataarts_studio_workspaces huaweicloud_dataarts_studio_workspaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDataartsStudioWorkspacesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDataartsStudioWorkspacesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_studio_workspaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._createdBy = config.createdBy; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_by - computed: false, optional: true, required: false + private _createdBy?: string; + public get createdBy() { + return this.getStringAttribute('created_by'); + } + public set createdBy(value: string) { + this._createdBy = value; + } + public resetCreatedBy() { + this._createdBy = undefined; + } + // Temporarily expose input value. Use with caution. + public get createdByInput() { + return this._createdBy; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // workspaces - computed: true, optional: false, required: false + private _workspaces = new DataHuaweicloudDataartsStudioWorkspacesWorkspacesList(this, "workspaces", false); + public get workspaces() { + return this._workspaces; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + created_by: cdktf.stringToTerraform(this._createdBy), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + created_by: { + value: cdktf.stringToHclTerraform(this._createdBy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/README.md new file mode 100644 index 00000000..23dddb7b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_audit_data_masking_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_audit_data_masking_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/index.ts new file mode 100644 index 00000000..fbf2c4f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-data-masking-rules/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssAuditDataMaskingRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules#id DataHuaweicloudDbssAuditDataMaskingRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the audit instance ID to which the privacy data masking rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules#instance_id DataHuaweicloudDbssAuditDataMaskingRules#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules#region DataHuaweicloudDbssAuditDataMaskingRules#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDbssAuditDataMaskingRulesRules { +} + +export function dataHuaweicloudDbssAuditDataMaskingRulesRulesToTerraform(struct?: DataHuaweicloudDbssAuditDataMaskingRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssAuditDataMaskingRulesRulesToHclTerraform(struct?: DataHuaweicloudDbssAuditDataMaskingRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssAuditDataMaskingRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssAuditDataMaskingRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssAuditDataMaskingRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mask_value - computed: true, optional: false, required: false + public get maskValue() { + return this.getStringAttribute('mask_value'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operate_time - computed: true, optional: false, required: false + public get operateTime() { + return this.getStringAttribute('operate_time'); + } + + // regex - computed: true, optional: false, required: false + public get regex() { + return this.getStringAttribute('regex'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDbssAuditDataMaskingRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssAuditDataMaskingRulesRulesOutputReference { + return new DataHuaweicloudDbssAuditDataMaskingRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules huaweicloud_dbss_audit_data_masking_rules} +*/ +export class DataHuaweicloudDbssAuditDataMaskingRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_audit_data_masking_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssAuditDataMaskingRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssAuditDataMaskingRules to import + * @param importFromId The id of the existing DataHuaweicloudDbssAuditDataMaskingRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssAuditDataMaskingRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_audit_data_masking_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_data_masking_rules huaweicloud_dbss_audit_data_masking_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssAuditDataMaskingRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssAuditDataMaskingRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_audit_data_masking_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudDbssAuditDataMaskingRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/README.md new file mode 100644 index 00000000..ccee2d19 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_audit_risk_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_audit_risk_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/index.ts new file mode 100644 index 00000000..3a8c151d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-risk-rules/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssAuditRiskRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules#id DataHuaweicloudDbssAuditRiskRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the audit instance ID to which the risk rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules#instance_id DataHuaweicloudDbssAuditRiskRules#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the risk rule. Supports fuzzy search. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules#name DataHuaweicloudDbssAuditRiskRules#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules#region DataHuaweicloudDbssAuditRiskRules#region} + */ + readonly region?: string; + /** + * Specifies the risk level of the risk rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules#risk_level DataHuaweicloudDbssAuditRiskRules#risk_level} + */ + readonly riskLevel?: string; +} +export interface DataHuaweicloudDbssAuditRiskRulesRules { +} + +export function dataHuaweicloudDbssAuditRiskRulesRulesToTerraform(struct?: DataHuaweicloudDbssAuditRiskRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssAuditRiskRulesRulesToHclTerraform(struct?: DataHuaweicloudDbssAuditRiskRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssAuditRiskRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssAuditRiskRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssAuditRiskRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // feature - computed: true, optional: false, required: false + public get feature() { + return this.getStringAttribute('feature'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // rank - computed: true, optional: false, required: false + public get rank() { + return this.getNumberAttribute('rank'); + } + + // risk_level - computed: true, optional: false, required: false + public get riskLevel() { + return this.getStringAttribute('risk_level'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDbssAuditRiskRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssAuditRiskRulesRulesOutputReference { + return new DataHuaweicloudDbssAuditRiskRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules huaweicloud_dbss_audit_risk_rules} +*/ +export class DataHuaweicloudDbssAuditRiskRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_audit_risk_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssAuditRiskRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssAuditRiskRules to import + * @param importFromId The id of the existing DataHuaweicloudDbssAuditRiskRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssAuditRiskRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_audit_risk_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_risk_rules huaweicloud_dbss_audit_risk_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssAuditRiskRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssAuditRiskRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_audit_risk_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._riskLevel = config.riskLevel; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // risk_level - computed: false, optional: true, required: false + private _riskLevel?: string; + public get riskLevel() { + return this.getStringAttribute('risk_level'); + } + public set riskLevel(value: string) { + this._riskLevel = value; + } + public resetRiskLevel() { + this._riskLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get riskLevelInput() { + return this._riskLevel; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudDbssAuditRiskRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + risk_level: cdktf.stringToTerraform(this._riskLevel), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + risk_level: { + value: cdktf.stringToHclTerraform(this._riskLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/README.md new file mode 100644 index 00000000..9a537c44 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_audit_rule_scopes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_audit_rule_scopes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/index.ts new file mode 100644 index 00000000..f10de49b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-rule-scopes/index.ts @@ -0,0 +1,304 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssAuditRuleScopesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes#id DataHuaweicloudDbssAuditRuleScopes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the audit instance ID to which the audit scopes belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes#instance_id DataHuaweicloudDbssAuditRuleScopes#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes#region DataHuaweicloudDbssAuditRuleScopes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDbssAuditRuleScopesScopes { +} + +export function dataHuaweicloudDbssAuditRuleScopesScopesToTerraform(struct?: DataHuaweicloudDbssAuditRuleScopesScopes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssAuditRuleScopesScopesToHclTerraform(struct?: DataHuaweicloudDbssAuditRuleScopesScopes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssAuditRuleScopesScopesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssAuditRuleScopesScopes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssAuditRuleScopesScopes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // all_audit - computed: true, optional: false, required: false + public get allAudit() { + return this.getBooleanAttribute('all_audit'); + } + + // db_ids - computed: true, optional: false, required: false + public get dbIds() { + return this.getStringAttribute('db_ids'); + } + + // db_names - computed: true, optional: false, required: false + public get dbNames() { + return this.getStringAttribute('db_names'); + } + + // db_users - computed: true, optional: false, required: false + public get dbUsers() { + return this.getStringAttribute('db_users'); + } + + // exception_ips - computed: true, optional: false, required: false + public get exceptionIps() { + return this.getStringAttribute('exception_ips'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // source_ips - computed: true, optional: false, required: false + public get sourceIps() { + return this.getStringAttribute('source_ips'); + } + + // source_ports - computed: true, optional: false, required: false + public get sourcePorts() { + return this.getStringAttribute('source_ports'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDbssAuditRuleScopesScopesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssAuditRuleScopesScopesOutputReference { + return new DataHuaweicloudDbssAuditRuleScopesScopesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes huaweicloud_dbss_audit_rule_scopes} +*/ +export class DataHuaweicloudDbssAuditRuleScopes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_audit_rule_scopes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssAuditRuleScopes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssAuditRuleScopes to import + * @param importFromId The id of the existing DataHuaweicloudDbssAuditRuleScopes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssAuditRuleScopes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_audit_rule_scopes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_rule_scopes huaweicloud_dbss_audit_rule_scopes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssAuditRuleScopesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssAuditRuleScopesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_audit_rule_scopes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scopes - computed: true, optional: false, required: false + private _scopes = new DataHuaweicloudDbssAuditRuleScopesScopesList(this, "scopes", false); + public get scopes() { + return this._scopes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/README.md new file mode 100644 index 00000000..7fe58b5c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_audit_sql_injection_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_audit_sql_injection_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/index.ts new file mode 100644 index 00000000..eaf29f8c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-audit-sql-injection-rules/index.ts @@ -0,0 +1,319 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssAuditSqlInjectionRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules#id DataHuaweicloudDbssAuditSqlInjectionRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the audit instance ID to which the SQL injection rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules#instance_id DataHuaweicloudDbssAuditSqlInjectionRules#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules#region DataHuaweicloudDbssAuditSqlInjectionRules#region} + */ + readonly region?: string; + /** + * Specifies the risk level of the SQL injection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules#risk_levels DataHuaweicloudDbssAuditSqlInjectionRules#risk_levels} + */ + readonly riskLevels?: string; +} +export interface DataHuaweicloudDbssAuditSqlInjectionRulesRules { +} + +export function dataHuaweicloudDbssAuditSqlInjectionRulesRulesToTerraform(struct?: DataHuaweicloudDbssAuditSqlInjectionRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssAuditSqlInjectionRulesRulesToHclTerraform(struct?: DataHuaweicloudDbssAuditSqlInjectionRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssAuditSqlInjectionRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssAuditSqlInjectionRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssAuditSqlInjectionRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // feature - computed: true, optional: false, required: false + public get feature() { + return this.getStringAttribute('feature'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // rank - computed: true, optional: false, required: false + public get rank() { + return this.getNumberAttribute('rank'); + } + + // regex - computed: true, optional: false, required: false + public get regex() { + return this.getStringAttribute('regex'); + } + + // risk_level - computed: true, optional: false, required: false + public get riskLevel() { + return this.getStringAttribute('risk_level'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDbssAuditSqlInjectionRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssAuditSqlInjectionRulesRulesOutputReference { + return new DataHuaweicloudDbssAuditSqlInjectionRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules huaweicloud_dbss_audit_sql_injection_rules} +*/ +export class DataHuaweicloudDbssAuditSqlInjectionRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_audit_sql_injection_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssAuditSqlInjectionRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssAuditSqlInjectionRules to import + * @param importFromId The id of the existing DataHuaweicloudDbssAuditSqlInjectionRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssAuditSqlInjectionRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_audit_sql_injection_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_audit_sql_injection_rules huaweicloud_dbss_audit_sql_injection_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssAuditSqlInjectionRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssAuditSqlInjectionRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_audit_sql_injection_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._riskLevels = config.riskLevels; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // risk_levels - computed: false, optional: true, required: false + private _riskLevels?: string; + public get riskLevels() { + return this.getStringAttribute('risk_levels'); + } + public set riskLevels(value: string) { + this._riskLevels = value; + } + public resetRiskLevels() { + this._riskLevels = undefined; + } + // Temporarily expose input value. Use with caution. + public get riskLevelsInput() { + return this._riskLevels; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudDbssAuditSqlInjectionRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + risk_levels: cdktf.stringToTerraform(this._riskLevels), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + risk_levels: { + value: cdktf.stringToHclTerraform(this._riskLevels), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/README.md new file mode 100644 index 00000000..9df97d0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/index.ts new file mode 100644 index 00000000..619fc666 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-availability-zones/index.ts @@ -0,0 +1,247 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones#id DataHuaweicloudDbssAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones#region DataHuaweicloudDbssAvailabilityZones#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDbssAvailabilityZonesAvailabilityZones { +} + +export function dataHuaweicloudDbssAvailabilityZonesAvailabilityZonesToTerraform(struct?: DataHuaweicloudDbssAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssAvailabilityZonesAvailabilityZonesToHclTerraform(struct?: DataHuaweicloudDbssAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssAvailabilityZonesAvailabilityZonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssAvailabilityZonesAvailabilityZones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssAvailabilityZonesAvailabilityZones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alias - computed: true, optional: false, required: false + public get alias() { + return this.getStringAttribute('alias'); + } + + // alias_us - computed: true, optional: false, required: false + public get aliasUs() { + return this.getStringAttribute('alias_us'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // number - computed: true, optional: false, required: false + public get number() { + return this.getNumberAttribute('number'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDbssAvailabilityZonesAvailabilityZonesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssAvailabilityZonesAvailabilityZonesOutputReference { + return new DataHuaweicloudDbssAvailabilityZonesAvailabilityZonesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones huaweicloud_dbss_availability_zones} +*/ +export class DataHuaweicloudDbssAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudDbssAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_availability_zones huaweicloud_dbss_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: false, required: false + private _availabilityZones = new DataHuaweicloudDbssAvailabilityZonesAvailabilityZonesList(this, "availability_zones", false); + public get availabilityZones() { + return this._availabilityZones; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/README.md new file mode 100644 index 00000000..1fb7390e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/index.ts new file mode 100644 index 00000000..7a09ea8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-databases/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases#id DataHuaweicloudDbssDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the audit instance ID to which the databases belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases#instance_id DataHuaweicloudDbssDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases#region DataHuaweicloudDbssDatabases#region} + */ + readonly region?: string; + /** + * Specifies the status of the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases#status DataHuaweicloudDbssDatabases#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDbssDatabasesDatabases { +} + +export function dataHuaweicloudDbssDatabasesDatabasesToTerraform(struct?: DataHuaweicloudDbssDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudDbssDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agent_url - computed: true, optional: false, required: false + public get agentUrl() { + return this.getListAttribute('agent_url'); + } + + // audit_status - computed: true, optional: false, required: false + public get auditStatus() { + return this.getStringAttribute('audit_status'); + } + + // charset - computed: true, optional: false, required: false + public get charset() { + return this.getStringAttribute('charset'); + } + + // db_classification - computed: true, optional: false, required: false + public get dbClassification() { + return this.getStringAttribute('db_classification'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDbssDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssDatabasesDatabasesOutputReference { + return new DataHuaweicloudDbssDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases huaweicloud_dbss_databases} +*/ +export class DataHuaweicloudDbssDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssDatabases to import + * @param importFromId The id of the existing DataHuaweicloudDbssDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_databases huaweicloud_dbss_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudDbssDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/README.md new file mode 100644 index 00000000..f91d37e9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/index.ts new file mode 100644 index 00000000..7836bae0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-flavors/index.ts @@ -0,0 +1,430 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the availability zone which the flavor belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#availability_zone DataHuaweicloudDbssFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Specifies the ID of the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#flavor_id DataHuaweicloudDbssFlavors#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#id DataHuaweicloudDbssFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the level of the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#level DataHuaweicloudDbssFlavors#level} + */ + readonly level?: string; + /** + * Specifies the memory size(GB) in the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#memory DataHuaweicloudDbssFlavors#memory} + */ + readonly memory?: number; + /** + * Specifies the maximum supported database instances. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#proxy DataHuaweicloudDbssFlavors#proxy} + */ + readonly proxy?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#region DataHuaweicloudDbssFlavors#region} + */ + readonly region?: string; + /** + * Specifies the number of CPUs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#vcpus DataHuaweicloudDbssFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudDbssFlavorsFlavors { +} + +export function dataHuaweicloudDbssFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDbssFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDbssFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // proxy - computed: true, optional: false, required: false + public get proxy() { + return this.getNumberAttribute('proxy'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudDbssFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssFlavorsFlavorsOutputReference { + return new DataHuaweicloudDbssFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors huaweicloud_dbss_flavors} +*/ +export class DataHuaweicloudDbssFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDbssFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_flavors huaweicloud_dbss_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._flavorId = config.flavorId; + this._id = config.id; + this._level = config.level; + this._memory = config.memory; + this._proxy = config.proxy; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDbssFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // proxy - computed: false, optional: true, required: false + private _proxy?: number; + public get proxy() { + return this.getNumberAttribute('proxy'); + } + public set proxy(value: number) { + this._proxy = value; + } + public resetProxy() { + this._proxy = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyInput() { + return this._proxy; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + level: cdktf.stringToTerraform(this._level), + memory: cdktf.numberToTerraform(this._memory), + proxy: cdktf.numberToTerraform(this._proxy), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + proxy: { + value: cdktf.numberToHclTerraform(this._proxy), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/README.md new file mode 100644 index 00000000..cd1a9ae7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/index.ts new file mode 100644 index 00000000..219630ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-instances/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances#id DataHuaweicloudDbssInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances#region DataHuaweicloudDbssInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDbssInstancesInstances { +} + +export function dataHuaweicloudDbssInstancesInstancesToTerraform(struct?: DataHuaweicloudDbssInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDbssInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // charge_model - computed: true, optional: false, required: false + public get chargeModel() { + return this.getStringAttribute('charge_model'); + } + + // config_num - computed: true, optional: false, required: false + public get configNum() { + return this.getNumberAttribute('config_num'); + } + + // connect_ip - computed: true, optional: false, required: false + public get connectIp() { + return this.getStringAttribute('connect_ip'); + } + + // connect_ipv6 - computed: true, optional: false, required: false + public get connectIpv6() { + return this.getStringAttribute('connect_ipv6'); + } + + // cpu - computed: true, optional: false, required: false + public get cpu() { + return this.getNumberAttribute('cpu'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // database_limit - computed: true, optional: false, required: false + public get databaseLimit() { + return this.getNumberAttribute('database_limit'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // effect - computed: true, optional: false, required: false + public get effect() { + return this.getNumberAttribute('effect'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getStringAttribute('keep_days'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // new_version - computed: true, optional: false, required: false + public get newVersion() { + return this.getStringAttribute('new_version'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // remain_days - computed: true, optional: false, required: false + public get remainDays() { + return this.getStringAttribute('remain_days'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // scene - computed: true, optional: false, required: false + public get scene() { + return this.getStringAttribute('scene'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // specification - computed: true, optional: false, required: false + public get specification() { + return this.getStringAttribute('specification'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // task - computed: true, optional: false, required: false + public get task() { + return this.getStringAttribute('task'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDbssInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssInstancesInstancesOutputReference { + return new DataHuaweicloudDbssInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances huaweicloud_dbss_instances} +*/ +export class DataHuaweicloudDbssInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssInstances to import + * @param importFromId The id of the existing DataHuaweicloudDbssInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_instances huaweicloud_dbss_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDbssInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/README.md new file mode 100644 index 00000000..0b5d78e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_operation_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_operation_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/index.ts new file mode 100644 index 00000000..7481e973 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-operation-logs/index.ts @@ -0,0 +1,469 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssOperationLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time of the user operation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#end_time DataHuaweicloudDbssOperationLogs#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#id DataHuaweicloudDbssOperationLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the audit instance ID to which the user operation logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#instance_id DataHuaweicloudDbssOperationLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the operation object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#operate_name DataHuaweicloudDbssOperationLogs#operate_name} + */ + readonly operateName?: string; + /** + * Specifies the region in which to query the data source. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#region DataHuaweicloudDbssOperationLogs#region} + */ + readonly region?: string; + /** + * Specifies the execution result of user operation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#result DataHuaweicloudDbssOperationLogs#result} + */ + readonly result?: string; + /** + * Specifies the start time of the user operation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#start_time DataHuaweicloudDbssOperationLogs#start_time} + */ + readonly startTime?: string; + /** + * Specifies the time segment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#time_range DataHuaweicloudDbssOperationLogs#time_range} + */ + readonly timeRange?: string; + /** + * Specifies the name of the operation user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#user_name DataHuaweicloudDbssOperationLogs#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudDbssOperationLogsLogs { +} + +export function dataHuaweicloudDbssOperationLogsLogsToTerraform(struct?: DataHuaweicloudDbssOperationLogsLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssOperationLogsLogsToHclTerraform(struct?: DataHuaweicloudDbssOperationLogsLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssOperationLogsLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssOperationLogsLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssOperationLogsLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // function - computed: true, optional: false, required: false + public get function() { + return this.getStringAttribute('function'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } + + // user - computed: true, optional: false, required: false + public get user() { + return this.getStringAttribute('user'); + } +} + +export class DataHuaweicloudDbssOperationLogsLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssOperationLogsLogsOutputReference { + return new DataHuaweicloudDbssOperationLogsLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs huaweicloud_dbss_operation_logs} +*/ +export class DataHuaweicloudDbssOperationLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_operation_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssOperationLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssOperationLogs to import + * @param importFromId The id of the existing DataHuaweicloudDbssOperationLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssOperationLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_operation_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_operation_logs huaweicloud_dbss_operation_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssOperationLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssOperationLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_operation_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._operateName = config.operateName; + this._region = config.region; + this._result = config.result; + this._startTime = config.startTime; + this._timeRange = config.timeRange; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // logs - computed: true, optional: false, required: false + private _logs = new DataHuaweicloudDbssOperationLogsLogsList(this, "logs", false); + public get logs() { + return this._logs; + } + + // operate_name - computed: false, optional: true, required: false + private _operateName?: string; + public get operateName() { + return this.getStringAttribute('operate_name'); + } + public set operateName(value: string) { + this._operateName = value; + } + public resetOperateName() { + this._operateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get operateNameInput() { + return this._operateName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // result - computed: false, optional: true, required: false + private _result?: string; + public get result() { + return this.getStringAttribute('result'); + } + public set result(value: string) { + this._result = value; + } + public resetResult() { + this._result = undefined; + } + // Temporarily expose input value. Use with caution. + public get resultInput() { + return this._result; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // time_range - computed: false, optional: true, required: false + private _timeRange?: string; + public get timeRange() { + return this.getStringAttribute('time_range'); + } + public set timeRange(value: string) { + this._timeRange = value; + } + public resetTimeRange() { + this._timeRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeRangeInput() { + return this._timeRange; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + operate_name: cdktf.stringToTerraform(this._operateName), + region: cdktf.stringToTerraform(this._region), + result: cdktf.stringToTerraform(this._result), + start_time: cdktf.stringToTerraform(this._startTime), + time_range: cdktf.stringToTerraform(this._timeRange), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operate_name: { + value: cdktf.stringToHclTerraform(this._operateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + result: { + value: cdktf.stringToHclTerraform(this._result), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_range: { + value: cdktf.stringToHclTerraform(this._timeRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/README.md new file mode 100644 index 00000000..2c9a1218 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dbss_rds_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dbss_rds_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/index.ts new file mode 100644 index 00000000..0242dec4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dbss-rds-databases/index.ts @@ -0,0 +1,299 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDbssRdsDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases#id DataHuaweicloudDbssRdsDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases#region DataHuaweicloudDbssRdsDatabases#region} + */ + readonly region?: string; + /** + * Specifies the RDS database type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases#type DataHuaweicloudDbssRdsDatabases#type} + */ + readonly type: string; +} +export interface DataHuaweicloudDbssRdsDatabasesDatabases { +} + +export function dataHuaweicloudDbssRdsDatabasesDatabasesToTerraform(struct?: DataHuaweicloudDbssRdsDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDbssRdsDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudDbssRdsDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDbssRdsDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDbssRdsDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDbssRdsDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // is_supported - computed: true, optional: false, required: false + public get isSupported() { + return this.getBooleanAttribute('is_supported'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDbssRdsDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDbssRdsDatabasesDatabasesOutputReference { + return new DataHuaweicloudDbssRdsDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases huaweicloud_dbss_rds_databases} +*/ +export class DataHuaweicloudDbssRdsDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_rds_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDbssRdsDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDbssRdsDatabases to import + * @param importFromId The id of the existing DataHuaweicloudDbssRdsDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDbssRdsDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_rds_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dbss_rds_databases huaweicloud_dbss_rds_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDbssRdsDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDbssRdsDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_rds_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudDbssRdsDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/README.md new file mode 100644 index 00000000..83e8a7e0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dc_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dc_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/index.ts new file mode 100644 index 00000000..f26307a8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-connections/index.ts @@ -0,0 +1,588 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#connection_id DataHuaweicloudDcConnections#connection_id} + */ + readonly connectionId?: string; + /** + * Specifies the ID of the enterprise project to which the connections belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#enterprise_project_id DataHuaweicloudDcConnections#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies operations connection ID by which hosted connections are filtered. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#hosting_id DataHuaweicloudDcConnections#hosting_id} + */ + readonly hostingId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#id DataHuaweicloudDcConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#name DataHuaweicloudDcConnections#name} + */ + readonly name?: string; + /** + * Specifies the type of the port used by the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#port_type DataHuaweicloudDcConnections#port_type} + */ + readonly portType?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#region DataHuaweicloudDcConnections#region} + */ + readonly region?: string; + /** + * Specifies the status of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#status DataHuaweicloudDcConnections#status} + */ + readonly status?: string; + /** + * Specifies the type of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#type DataHuaweicloudDcConnections#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDcConnectionsDirectConnects { +} + +export function dataHuaweicloudDcConnectionsDirectConnectsToTerraform(struct?: DataHuaweicloudDcConnectionsDirectConnects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcConnectionsDirectConnectsToHclTerraform(struct?: DataHuaweicloudDcConnectionsDirectConnects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcConnectionsDirectConnectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcConnectionsDirectConnects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcConnectionsDirectConnects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // apply_time - computed: true, optional: false, required: false + public get applyTime() { + return this.getStringAttribute('apply_time'); + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // change_mode - computed: true, optional: false, required: false + public get changeMode() { + return this.getNumberAttribute('change_mode'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // email - computed: true, optional: false, required: false + public get email() { + return this.getStringAttribute('email'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // hosting_id - computed: true, optional: false, required: false + public get hostingId() { + return this.getStringAttribute('hosting_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ies_id - computed: true, optional: false, required: false + public get iesId() { + return this.getStringAttribute('ies_id'); + } + + // lag_id - computed: true, optional: false, required: false + public get lagId() { + return this.getStringAttribute('lag_id'); + } + + // location - computed: true, optional: false, required: false + public get location() { + return this.getStringAttribute('location'); + } + + // modified_bandwidth - computed: true, optional: false, required: false + public get modifiedBandwidth() { + return this.getNumberAttribute('modified_bandwidth'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // onestopdc_status - computed: true, optional: false, required: false + public get onestopdcStatus() { + return this.getStringAttribute('onestopdc_status'); + } + + // peer_location - computed: true, optional: false, required: false + public get peerLocation() { + return this.getStringAttribute('peer_location'); + } + + // peer_port_type - computed: true, optional: false, required: false + public get peerPortType() { + return this.getStringAttribute('peer_port_type'); + } + + // peer_provider - computed: true, optional: false, required: false + public get peerProvider() { + return this.getStringAttribute('peer_provider'); + } + + // port_type - computed: true, optional: false, required: false + public get portType() { + return this.getStringAttribute('port_type'); + } + + // provider - computed: true, optional: false, required: false + public get provider() { + return this.getStringAttribute('provider'); + } + + // provider_status - computed: true, optional: false, required: false + public get providerStatus() { + return this.getStringAttribute('provider_status'); + } + + // public_border_group - computed: true, optional: false, required: false + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + + // ratio_95peak - computed: true, optional: false, required: false + public get ratio95Peak() { + return this.getNumberAttribute('ratio_95peak'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_feature - computed: true, optional: false, required: false + public get supportFeature() { + return this.getListAttribute('support_feature'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vgw_type - computed: true, optional: false, required: false + public get vgwType() { + return this.getStringAttribute('vgw_type'); + } + + // vlan - computed: true, optional: false, required: false + public get vlan() { + return this.getNumberAttribute('vlan'); + } +} + +export class DataHuaweicloudDcConnectionsDirectConnectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcConnectionsDirectConnectsOutputReference { + return new DataHuaweicloudDcConnectionsDirectConnectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections huaweicloud_dc_connections} +*/ +export class DataHuaweicloudDcConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcConnections to import + * @param importFromId The id of the existing DataHuaweicloudDcConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_connections huaweicloud_dc_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcConnectionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcConnectionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._hostingId = config.hostingId; + this._id = config.id; + this._name = config.name; + this._portType = config.portType; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // direct_connects - computed: true, optional: false, required: false + private _directConnects = new DataHuaweicloudDcConnectionsDirectConnectsList(this, "direct_connects", false); + public get directConnects() { + return this._directConnects; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // hosting_id - computed: false, optional: true, required: false + private _hostingId?: string; + public get hostingId() { + return this.getStringAttribute('hosting_id'); + } + public set hostingId(value: string) { + this._hostingId = value; + } + public resetHostingId() { + this._hostingId = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostingIdInput() { + return this._hostingId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port_type - computed: false, optional: true, required: false + private _portType?: string; + public get portType() { + return this.getStringAttribute('port_type'); + } + public set portType(value: string) { + this._portType = value; + } + public resetPortType() { + this._portType = undefined; + } + // Temporarily expose input value. Use with caution. + public get portTypeInput() { + return this._portType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + hosting_id: cdktf.stringToTerraform(this._hostingId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + port_type: cdktf.stringToTerraform(this._portType), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hosting_id: { + value: cdktf.stringToHclTerraform(this._hostingId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_type: { + value: cdktf.stringToHclTerraform(this._portType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/README.md new file mode 100644 index 00000000..617c40bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dc_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dc_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/index.ts new file mode 100644 index 00000000..a816f06d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-quotas/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas#id DataHuaweicloudDcQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas#region DataHuaweicloudDcQuotas#region} + */ + readonly region?: string; + /** + * Specifies the quota type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas#type DataHuaweicloudDcQuotas#type} + */ + readonly type?: string[]; +} +export interface DataHuaweicloudDcQuotasQuotas { +} + +export function dataHuaweicloudDcQuotasQuotasToTerraform(struct?: DataHuaweicloudDcQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcQuotasQuotasToHclTerraform(struct?: DataHuaweicloudDcQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudDcQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcQuotasQuotasOutputReference { + return new DataHuaweicloudDcQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas huaweicloud_dc_quotas} +*/ +export class DataHuaweicloudDcQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcQuotas to import + * @param importFromId The id of the existing DataHuaweicloudDcQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_quotas huaweicloud_dc_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudDcQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string[]; + public get type() { + return this.getListAttribute('type'); + } + public set type(value: string[]) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.listMapper(cdktf.stringToTerraform, false)(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._type), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/README.md new file mode 100644 index 00000000..4a4b2e4b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dc_virtual_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dc_virtual_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/index.ts new file mode 100644 index 00000000..d58bfc23 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-gateways/index.ts @@ -0,0 +1,385 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcVirtualGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#enterprise_project_id DataHuaweicloudDcVirtualGateways#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#id DataHuaweicloudDcVirtualGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#name DataHuaweicloudDcVirtualGateways#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#region DataHuaweicloudDcVirtualGateways#region} + */ + readonly region?: string; + /** + * Specifies the ID of the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#virtual_gateway_id DataHuaweicloudDcVirtualGateways#virtual_gateway_id} + */ + readonly virtualGatewayId?: string; + /** + * Specifies the ID of the VPC connected to the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#vpc_id DataHuaweicloudDcVirtualGateways#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudDcVirtualGatewaysVirtualGateways { +} + +export function dataHuaweicloudDcVirtualGatewaysVirtualGatewaysToTerraform(struct?: DataHuaweicloudDcVirtualGatewaysVirtualGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcVirtualGatewaysVirtualGatewaysToHclTerraform(struct?: DataHuaweicloudDcVirtualGatewaysVirtualGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcVirtualGatewaysVirtualGatewaysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcVirtualGatewaysVirtualGateways | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcVirtualGatewaysVirtualGateways | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // asn - computed: true, optional: false, required: false + public get asn() { + return this.getNumberAttribute('asn'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_ep_group - computed: true, optional: false, required: false + public get localEpGroup() { + return this.getListAttribute('local_ep_group'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDcVirtualGatewaysVirtualGatewaysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcVirtualGatewaysVirtualGatewaysOutputReference { + return new DataHuaweicloudDcVirtualGatewaysVirtualGatewaysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways huaweicloud_dc_virtual_gateways} +*/ +export class DataHuaweicloudDcVirtualGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_virtual_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcVirtualGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcVirtualGateways to import + * @param importFromId The id of the existing DataHuaweicloudDcVirtualGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcVirtualGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_virtual_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_gateways huaweicloud_dc_virtual_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcVirtualGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcVirtualGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_virtual_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._virtualGatewayId = config.virtualGatewayId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // virtual_gateway_id - computed: false, optional: true, required: false + private _virtualGatewayId?: string; + public get virtualGatewayId() { + return this.getStringAttribute('virtual_gateway_id'); + } + public set virtualGatewayId(value: string) { + this._virtualGatewayId = value; + } + public resetVirtualGatewayId() { + this._virtualGatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get virtualGatewayIdInput() { + return this._virtualGatewayId; + } + + // virtual_gateways - computed: true, optional: false, required: false + private _virtualGateways = new DataHuaweicloudDcVirtualGatewaysVirtualGatewaysList(this, "virtual_gateways", false); + public get virtualGateways() { + return this._virtualGateways; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + virtual_gateway_id: cdktf.stringToTerraform(this._virtualGatewayId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + virtual_gateway_id: { + value: cdktf.stringToHclTerraform(this._virtualGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/README.md new file mode 100644 index 00000000..a51bb82d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dc_virtual_interfaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dc_virtual_interfaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/index.ts new file mode 100644 index 00000000..977a6667 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dc-virtual-interfaces/index.ts @@ -0,0 +1,691 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcVirtualInterfacesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the direct connection associated with the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#direct_connect_id DataHuaweicloudDcVirtualInterfaces#direct_connect_id} + */ + readonly directConnectId?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#enterprise_project_id DataHuaweicloudDcVirtualInterfaces#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#id DataHuaweicloudDcVirtualInterfaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#name DataHuaweicloudDcVirtualInterfaces#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#region DataHuaweicloudDcVirtualInterfaces#region} + */ + readonly region?: string; + /** + * Specifies the status of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#status DataHuaweicloudDcVirtualInterfaces#status} + */ + readonly status?: string; + /** + * Specifies the ID of the virtual gateway for the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#vgw_id DataHuaweicloudDcVirtualInterfaces#vgw_id} + */ + readonly vgwId?: string; + /** + * Specifies the ID of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#virtual_interface_id DataHuaweicloudDcVirtualInterfaces#virtual_interface_id} + */ + readonly virtualInterfaceId?: string; +} +export interface DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeers { +} + +export function dataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersToTerraform(struct?: DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersToHclTerraform(struct?: DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address_family - computed: true, optional: false, required: false + public get addressFamily() { + return this.getStringAttribute('address_family'); + } + + // bgp_asn - computed: true, optional: false, required: false + public get bgpAsn() { + return this.getNumberAttribute('bgp_asn'); + } + + // bgp_md5 - computed: true, optional: false, required: false + public get bgpMd5() { + return this.getStringAttribute('bgp_md5'); + } + + // bgp_route_limit - computed: true, optional: false, required: false + public get bgpRouteLimit() { + return this.getNumberAttribute('bgp_route_limit'); + } + + // bgp_status - computed: true, optional: false, required: false + public get bgpStatus() { + return this.getStringAttribute('bgp_status'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // enable_bfd - computed: true, optional: false, required: false + public get enableBfd() { + return this.getBooleanAttribute('enable_bfd'); + } + + // enable_nqa - computed: true, optional: false, required: false + public get enableNqa() { + return this.getBooleanAttribute('enable_nqa'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_gateway_ip - computed: true, optional: false, required: false + public get localGatewayIp() { + return this.getStringAttribute('local_gateway_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // receive_route_num - computed: true, optional: false, required: false + public get receiveRouteNum() { + return this.getNumberAttribute('receive_route_num'); + } + + // remote_ep_group - computed: true, optional: false, required: false + public get remoteEpGroup() { + return this.getListAttribute('remote_ep_group'); + } + + // remote_gateway_ip - computed: true, optional: false, required: false + public get remoteGatewayIp() { + return this.getStringAttribute('remote_gateway_ip'); + } + + // route_mode - computed: true, optional: false, required: false + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vif_id - computed: true, optional: false, required: false + public get vifId() { + return this.getStringAttribute('vif_id'); + } +} + +export class DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersOutputReference { + return new DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDcVirtualInterfacesVirtualInterfaces { +} + +export function dataHuaweicloudDcVirtualInterfacesVirtualInterfacesToTerraform(struct?: DataHuaweicloudDcVirtualInterfacesVirtualInterfaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcVirtualInterfacesVirtualInterfacesToHclTerraform(struct?: DataHuaweicloudDcVirtualInterfacesVirtualInterfaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcVirtualInterfacesVirtualInterfacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcVirtualInterfacesVirtualInterfaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcVirtualInterfacesVirtualInterfaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address_family - computed: true, optional: false, required: false + public get addressFamily() { + return this.getStringAttribute('address_family'); + } + + // asn - computed: true, optional: false, required: false + public get asn() { + return this.getNumberAttribute('asn'); + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // bgp_md5 - computed: true, optional: false, required: false + public get bgpMd5() { + return this.getStringAttribute('bgp_md5'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // direct_connect_id - computed: true, optional: false, required: false + public get directConnectId() { + return this.getStringAttribute('direct_connect_id'); + } + + // enable_bfd - computed: true, optional: false, required: false + public get enableBfd() { + return this.getBooleanAttribute('enable_bfd'); + } + + // enable_nqa - computed: true, optional: false, required: false + public get enableNqa() { + return this.getBooleanAttribute('enable_nqa'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // lag_id - computed: true, optional: false, required: false + public get lagId() { + return this.getStringAttribute('lag_id'); + } + + // local_gateway_v4_ip - computed: true, optional: false, required: false + public get localGatewayV4Ip() { + return this.getStringAttribute('local_gateway_v4_ip'); + } + + // local_gateway_v6_ip - computed: true, optional: false, required: false + public get localGatewayV6Ip() { + return this.getStringAttribute('local_gateway_v6_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // remote_ep_group - computed: true, optional: false, required: false + public get remoteEpGroup() { + return this.getListAttribute('remote_ep_group'); + } + + // remote_gateway_v4_ip - computed: true, optional: false, required: false + public get remoteGatewayV4Ip() { + return this.getStringAttribute('remote_gateway_v4_ip'); + } + + // remote_gateway_v6_ip - computed: true, optional: false, required: false + public get remoteGatewayV6Ip() { + return this.getStringAttribute('remote_gateway_v6_ip'); + } + + // route_mode - computed: true, optional: false, required: false + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vgw_id - computed: true, optional: false, required: false + public get vgwId() { + return this.getStringAttribute('vgw_id'); + } + + // vif_peers - computed: true, optional: false, required: false + private _vifPeers = new DataHuaweicloudDcVirtualInterfacesVirtualInterfacesVifPeersList(this, "vif_peers", false); + public get vifPeers() { + return this._vifPeers; + } + + // vlan - computed: true, optional: false, required: false + public get vlan() { + return this.getNumberAttribute('vlan'); + } +} + +export class DataHuaweicloudDcVirtualInterfacesVirtualInterfacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcVirtualInterfacesVirtualInterfacesOutputReference { + return new DataHuaweicloudDcVirtualInterfacesVirtualInterfacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces huaweicloud_dc_virtual_interfaces} +*/ +export class DataHuaweicloudDcVirtualInterfaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_virtual_interfaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcVirtualInterfaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcVirtualInterfaces to import + * @param importFromId The id of the existing DataHuaweicloudDcVirtualInterfaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcVirtualInterfaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_virtual_interfaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dc_virtual_interfaces huaweicloud_dc_virtual_interfaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcVirtualInterfacesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcVirtualInterfacesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_virtual_interfaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._directConnectId = config.directConnectId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._vgwId = config.vgwId; + this._virtualInterfaceId = config.virtualInterfaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // direct_connect_id - computed: false, optional: true, required: false + private _directConnectId?: string; + public get directConnectId() { + return this.getStringAttribute('direct_connect_id'); + } + public set directConnectId(value: string) { + this._directConnectId = value; + } + public resetDirectConnectId() { + this._directConnectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get directConnectIdInput() { + return this._directConnectId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vgw_id - computed: false, optional: true, required: false + private _vgwId?: string; + public get vgwId() { + return this.getStringAttribute('vgw_id'); + } + public set vgwId(value: string) { + this._vgwId = value; + } + public resetVgwId() { + this._vgwId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vgwIdInput() { + return this._vgwId; + } + + // virtual_interface_id - computed: false, optional: true, required: false + private _virtualInterfaceId?: string; + public get virtualInterfaceId() { + return this.getStringAttribute('virtual_interface_id'); + } + public set virtualInterfaceId(value: string) { + this._virtualInterfaceId = value; + } + public resetVirtualInterfaceId() { + this._virtualInterfaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get virtualInterfaceIdInput() { + return this._virtualInterfaceId; + } + + // virtual_interfaces - computed: true, optional: false, required: false + private _virtualInterfaces = new DataHuaweicloudDcVirtualInterfacesVirtualInterfacesList(this, "virtual_interfaces", false); + public get virtualInterfaces() { + return this._virtualInterfaces; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + direct_connect_id: cdktf.stringToTerraform(this._directConnectId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vgw_id: cdktf.stringToTerraform(this._vgwId), + virtual_interface_id: cdktf.stringToTerraform(this._virtualInterfaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + direct_connect_id: { + value: cdktf.stringToHclTerraform(this._directConnectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vgw_id: { + value: cdktf.stringToHclTerraform(this._vgwId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + virtual_interface_id: { + value: cdktf.stringToHclTerraform(this._virtualInterfaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/README.md new file mode 100644 index 00000000..ab0978fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/index.ts new file mode 100644 index 00000000..afae1ae7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-accounts/index.ts @@ -0,0 +1,429 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the account name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#account_name DataHuaweicloudDcsAccounts#account_name} + */ + readonly accountName?: string; + /** + * Specifies the account role. The value can be **read** or **write**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#account_role DataHuaweicloudDcsAccounts#account_role} + */ + readonly accountRole?: string; + /** + * Specifies the account type. The value can be **normal** or **default**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#account_type DataHuaweicloudDcsAccounts#account_type} + */ + readonly accountType?: string; + /** + * Specifies the account description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#description DataHuaweicloudDcsAccounts#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#id DataHuaweicloudDcsAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#instance_id DataHuaweicloudDcsAccounts#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#region DataHuaweicloudDcsAccounts#region} + */ + readonly region?: string; + /** + * Specifies the account status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#status DataHuaweicloudDcsAccounts#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDcsAccountsAccounts { +} + +export function dataHuaweicloudDcsAccountsAccountsToTerraform(struct?: DataHuaweicloudDcsAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsAccountsAccountsToHclTerraform(struct?: DataHuaweicloudDcsAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsAccountsAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsAccountsAccounts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsAccountsAccounts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // account_name - computed: true, optional: false, required: false + public get accountName() { + return this.getStringAttribute('account_name'); + } + + // account_role - computed: true, optional: false, required: false + public get accountRole() { + return this.getStringAttribute('account_role'); + } + + // account_type - computed: true, optional: false, required: false + public get accountType() { + return this.getStringAttribute('account_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDcsAccountsAccountsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsAccountsAccountsOutputReference { + return new DataHuaweicloudDcsAccountsAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts huaweicloud_dcs_accounts} +*/ +export class DataHuaweicloudDcsAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsAccounts to import + * @param importFromId The id of the existing DataHuaweicloudDcsAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_accounts huaweicloud_dcs_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsAccountsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsAccountsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountName = config.accountName; + this._accountRole = config.accountRole; + this._accountType = config.accountType; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_name - computed: false, optional: true, required: false + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + public resetAccountName() { + this._accountName = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // account_role - computed: false, optional: true, required: false + private _accountRole?: string; + public get accountRole() { + return this.getStringAttribute('account_role'); + } + public set accountRole(value: string) { + this._accountRole = value; + } + public resetAccountRole() { + this._accountRole = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountRoleInput() { + return this._accountRole; + } + + // account_type - computed: false, optional: true, required: false + private _accountType?: string; + public get accountType() { + return this.getStringAttribute('account_type'); + } + public set accountType(value: string) { + this._accountType = value; + } + public resetAccountType() { + this._accountType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountTypeInput() { + return this._accountType; + } + + // accounts - computed: true, optional: false, required: false + private _accounts = new DataHuaweicloudDcsAccountsAccountsList(this, "accounts", false); + public get accounts() { + return this._accounts; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_name: cdktf.stringToTerraform(this._accountName), + account_role: cdktf.stringToTerraform(this._accountRole), + account_type: cdktf.stringToTerraform(this._accountType), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_role: { + value: cdktf.stringToHclTerraform(this._accountRole), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_type: { + value: cdktf.stringToHclTerraform(this._accountType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/README.md new file mode 100644 index 00000000..7f3d3ffe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_az_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_az_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/index.ts new file mode 100644 index 00000000..01bd8cf3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az-v1/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsAzV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1#code DataHuaweicloudDcsAzV1#code} + */ + readonly code?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1#id DataHuaweicloudDcsAzV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1#name DataHuaweicloudDcsAzV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1#port DataHuaweicloudDcsAzV1#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1#region DataHuaweicloudDcsAzV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1 huaweicloud_dcs_az_v1} +*/ +export class DataHuaweicloudDcsAzV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_az_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsAzV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsAzV1 to import + * @param importFromId The id of the existing DataHuaweicloudDcsAzV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsAzV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_az_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az_v1 huaweicloud_dcs_az_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsAzV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsAzV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_az_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._id = config.id; + this._name = config.name; + this._port = config.port; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + port: cdktf.stringToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/README.md new file mode 100644 index 00000000..5d47d695 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_az` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_az`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/index.ts new file mode 100644 index 00000000..2dfa4ab9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-az/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsAzConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az#code DataHuaweicloudDcsAz#code} + */ + readonly code?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az#id DataHuaweicloudDcsAz#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az#name DataHuaweicloudDcsAz#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az#port DataHuaweicloudDcsAz#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az#region DataHuaweicloudDcsAz#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az huaweicloud_dcs_az} +*/ +export class DataHuaweicloudDcsAz extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_az"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsAz resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsAz to import + * @param importFromId The id of the existing DataHuaweicloudDcsAz that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsAz to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_az", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_az huaweicloud_dcs_az} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsAzConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsAzConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_az', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._id = config.id; + this._name = config.name; + this._port = config.port; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + port: cdktf.stringToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/README.md new file mode 100644 index 00000000..eaccfe1f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_backups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_backups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/index.ts new file mode 100644 index 00000000..37ace8a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-backups/index.ts @@ -0,0 +1,552 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsBackupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the format of the DCS instance backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#backup_format DataHuaweicloudDcsBackups#backup_format} + */ + readonly backupFormat?: string; + /** + * Specifies the ID of the DCS instance backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#backup_id DataHuaweicloudDcsBackups#backup_id} + */ + readonly backupId?: string; + /** + * Specifies the start time (UTC) of DCS backups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#begin_time DataHuaweicloudDcsBackups#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the end time (UTC) of DCS backups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#end_time DataHuaweicloudDcsBackups#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#id DataHuaweicloudDcsBackups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#instance_id DataHuaweicloudDcsBackups#instance_id} + */ + readonly instanceId: string; + /** + * Specifies whether restoration is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#is_support_restore DataHuaweicloudDcsBackups#is_support_restore} + */ + readonly isSupportRestore?: string; + /** + * Specifies the backup name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#name DataHuaweicloudDcsBackups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#region DataHuaweicloudDcsBackups#region} + */ + readonly region?: string; + /** + * Specifies the backup status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#status DataHuaweicloudDcsBackups#status} + */ + readonly status?: string; + /** + * Specifies the backup type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#type DataHuaweicloudDcsBackups#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDcsBackupsBackups { +} + +export function dataHuaweicloudDcsBackupsBackupsToTerraform(struct?: DataHuaweicloudDcsBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsBackupsBackupsToHclTerraform(struct?: DataHuaweicloudDcsBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsBackupsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsBackupsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsBackupsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backup_format - computed: true, optional: false, required: false + public get backupFormat() { + return this.getStringAttribute('backup_format'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // is_support_restore - computed: true, optional: false, required: false + public get isSupportRestore() { + return this.getStringAttribute('is_support_restore'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getStringAttribute('progress'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDcsBackupsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsBackupsBackupsOutputReference { + return new DataHuaweicloudDcsBackupsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups huaweicloud_dcs_backups} +*/ +export class DataHuaweicloudDcsBackups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_backups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsBackups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsBackups to import + * @param importFromId The id of the existing DataHuaweicloudDcsBackups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsBackups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_backups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_backups huaweicloud_dcs_backups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsBackupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsBackupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_backups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupFormat = config.backupFormat; + this._backupId = config.backupId; + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._isSupportRestore = config.isSupportRestore; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_format - computed: false, optional: true, required: false + private _backupFormat?: string; + public get backupFormat() { + return this.getStringAttribute('backup_format'); + } + public set backupFormat(value: string) { + this._backupFormat = value; + } + public resetBackupFormat() { + this._backupFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupFormatInput() { + return this._backupFormat; + } + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudDcsBackupsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_support_restore - computed: false, optional: true, required: false + private _isSupportRestore?: string; + public get isSupportRestore() { + return this.getStringAttribute('is_support_restore'); + } + public set isSupportRestore(value: string) { + this._isSupportRestore = value; + } + public resetIsSupportRestore() { + this._isSupportRestore = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSupportRestoreInput() { + return this._isSupportRestore; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_format: cdktf.stringToTerraform(this._backupFormat), + backup_id: cdktf.stringToTerraform(this._backupId), + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_support_restore: cdktf.stringToTerraform(this._isSupportRestore), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_format: { + value: cdktf.stringToHclTerraform(this._backupFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_support_restore: { + value: cdktf.stringToHclTerraform(this._isSupportRestore), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/README.md new file mode 100644 index 00000000..351cecf6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_bigkey_analyses` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_bigkey_analyses`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/index.ts new file mode 100644 index 00000000..90942659 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-bigkey-analyses/index.ts @@ -0,0 +1,369 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsBigkeyAnalysesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the big key analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#analysis_id DataHuaweicloudDcsBigkeyAnalyses#analysis_id} + */ + readonly analysisId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#id DataHuaweicloudDcsBigkeyAnalyses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#instance_id DataHuaweicloudDcsBigkeyAnalyses#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#region DataHuaweicloudDcsBigkeyAnalyses#region} + */ + readonly region?: string; + /** + * Specifies the mode of the big key analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#scan_type DataHuaweicloudDcsBigkeyAnalyses#scan_type} + */ + readonly scanType?: string; + /** + * Specifies the status of the big key analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#status DataHuaweicloudDcsBigkeyAnalyses#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDcsBigkeyAnalysesRecords { +} + +export function dataHuaweicloudDcsBigkeyAnalysesRecordsToTerraform(struct?: DataHuaweicloudDcsBigkeyAnalysesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsBigkeyAnalysesRecordsToHclTerraform(struct?: DataHuaweicloudDcsBigkeyAnalysesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsBigkeyAnalysesRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsBigkeyAnalysesRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsBigkeyAnalysesRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // scan_type - computed: true, optional: false, required: false + public get scanType() { + return this.getStringAttribute('scan_type'); + } + + // started_at - computed: true, optional: false, required: false + public get startedAt() { + return this.getStringAttribute('started_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDcsBigkeyAnalysesRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsBigkeyAnalysesRecordsOutputReference { + return new DataHuaweicloudDcsBigkeyAnalysesRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses huaweicloud_dcs_bigkey_analyses} +*/ +export class DataHuaweicloudDcsBigkeyAnalyses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_bigkey_analyses"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsBigkeyAnalyses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsBigkeyAnalyses to import + * @param importFromId The id of the existing DataHuaweicloudDcsBigkeyAnalyses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsBigkeyAnalyses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_bigkey_analyses", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_bigkey_analyses huaweicloud_dcs_bigkey_analyses} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsBigkeyAnalysesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsBigkeyAnalysesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_bigkey_analyses', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._analysisId = config.analysisId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._scanType = config.scanType; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // analysis_id - computed: false, optional: true, required: false + private _analysisId?: string; + public get analysisId() { + return this.getStringAttribute('analysis_id'); + } + public set analysisId(value: string) { + this._analysisId = value; + } + public resetAnalysisId() { + this._analysisId = undefined; + } + // Temporarily expose input value. Use with caution. + public get analysisIdInput() { + return this._analysisId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudDcsBigkeyAnalysesRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scan_type - computed: false, optional: true, required: false + private _scanType?: string; + public get scanType() { + return this.getStringAttribute('scan_type'); + } + public set scanType(value: string) { + this._scanType = value; + } + public resetScanType() { + this._scanType = undefined; + } + // Temporarily expose input value. Use with caution. + public get scanTypeInput() { + return this._scanType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + analysis_id: cdktf.stringToTerraform(this._analysisId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + scan_type: cdktf.stringToTerraform(this._scanType), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + analysis_id: { + value: cdktf.stringToHclTerraform(this._analysisId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scan_type: { + value: cdktf.stringToHclTerraform(this._scanType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/README.md new file mode 100644 index 00000000..402ce891 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_diagnosis_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_diagnosis_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/index.ts new file mode 100644 index 00000000..314243fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-diagnosis-tasks/index.ts @@ -0,0 +1,439 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsDiagnosisTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the start time of the diagnosis task, in RFC3339 format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#begin_time DataHuaweicloudDcsDiagnosisTasks#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the end time of the diagnosis task, in RFC3339 format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#end_time DataHuaweicloudDcsDiagnosisTasks#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#id DataHuaweicloudDcsDiagnosisTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#instance_id DataHuaweicloudDcsDiagnosisTasks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the number of diagnosed nodes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#node_num DataHuaweicloudDcsDiagnosisTasks#node_num} + */ + readonly nodeNum?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#region DataHuaweicloudDcsDiagnosisTasks#region} + */ + readonly region?: string; + /** + * Specifies the status of the diagnosis task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#status DataHuaweicloudDcsDiagnosisTasks#status} + */ + readonly status?: string; + /** + * Specifies the ID of the diagnosis task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#task_id DataHuaweicloudDcsDiagnosisTasks#task_id} + */ + readonly taskId?: string; +} +export interface DataHuaweicloudDcsDiagnosisTasksDiagnosisTasks { +} + +export function dataHuaweicloudDcsDiagnosisTasksDiagnosisTasksToTerraform(struct?: DataHuaweicloudDcsDiagnosisTasksDiagnosisTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsDiagnosisTasksDiagnosisTasksToHclTerraform(struct?: DataHuaweicloudDcsDiagnosisTasksDiagnosisTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsDiagnosisTasksDiagnosisTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsDiagnosisTasksDiagnosisTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsDiagnosisTasksDiagnosisTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // abnormal_item_sum - computed: true, optional: false, required: false + public get abnormalItemSum() { + return this.getNumberAttribute('abnormal_item_sum'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // failed_item_sum - computed: true, optional: false, required: false + public get failedItemSum() { + return this.getNumberAttribute('failed_item_sum'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDcsDiagnosisTasksDiagnosisTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsDiagnosisTasksDiagnosisTasksOutputReference { + return new DataHuaweicloudDcsDiagnosisTasksDiagnosisTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks huaweicloud_dcs_diagnosis_tasks} +*/ +export class DataHuaweicloudDcsDiagnosisTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_diagnosis_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsDiagnosisTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsDiagnosisTasks to import + * @param importFromId The id of the existing DataHuaweicloudDcsDiagnosisTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsDiagnosisTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_diagnosis_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_diagnosis_tasks huaweicloud_dcs_diagnosis_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsDiagnosisTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsDiagnosisTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_diagnosis_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeNum = config.nodeNum; + this._region = config.region; + this._status = config.status; + this._taskId = config.taskId; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // diagnosis_tasks - computed: true, optional: false, required: false + private _diagnosisTasks = new DataHuaweicloudDcsDiagnosisTasksDiagnosisTasksList(this, "diagnosis_tasks", false); + public get diagnosisTasks() { + return this._diagnosisTasks; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_num - computed: false, optional: true, required: false + private _nodeNum?: string; + public get nodeNum() { + return this.getStringAttribute('node_num'); + } + public set nodeNum(value: string) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // task_id - computed: false, optional: true, required: false + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + public resetTaskId() { + this._taskId = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_num: cdktf.stringToTerraform(this._nodeNum), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + task_id: cdktf.stringToTerraform(this._taskId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.stringToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/README.md new file mode 100644 index 00000000..1aef51e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/index.ts new file mode 100644 index 00000000..be36df11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-flavors/index.ts @@ -0,0 +1,433 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#cache_mode DataHuaweicloudDcsFlavors#cache_mode} + */ + readonly cacheMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#capacity DataHuaweicloudDcsFlavors#capacity} + */ + readonly capacity?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#cpu_architecture DataHuaweicloudDcsFlavors#cpu_architecture} + */ + readonly cpuArchitecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#engine DataHuaweicloudDcsFlavors#engine} + */ + readonly engine?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#engine_version DataHuaweicloudDcsFlavors#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#id DataHuaweicloudDcsFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#name DataHuaweicloudDcsFlavors#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#region DataHuaweicloudDcsFlavors#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDcsFlavorsFlavors { +} + +export function dataHuaweicloudDcsFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDcsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDcsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // available_zones - computed: true, optional: false, required: false + public get availableZones() { + return this.getListAttribute('available_zones'); + } + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // capacity - computed: true, optional: false, required: false + public get capacity() { + return this.getNumberAttribute('capacity'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // cpu_architecture - computed: true, optional: false, required: false + public get cpuArchitecture() { + return this.getStringAttribute('cpu_architecture'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_versions - computed: true, optional: false, required: false + public get engineVersions() { + return this.getStringAttribute('engine_versions'); + } + + // ip_count - computed: true, optional: false, required: false + public get ipCount() { + return this.getNumberAttribute('ip_count'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDcsFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsFlavorsFlavorsOutputReference { + return new DataHuaweicloudDcsFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors huaweicloud_dcs_flavors} +*/ +export class DataHuaweicloudDcsFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDcsFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_flavors huaweicloud_dcs_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cacheMode = config.cacheMode; + this._capacity = config.capacity; + this._cpuArchitecture = config.cpuArchitecture; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_mode - computed: false, optional: true, required: false + private _cacheMode?: string; + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + public set cacheMode(value: string) { + this._cacheMode = value; + } + public resetCacheMode() { + this._cacheMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheModeInput() { + return this._cacheMode; + } + + // capacity - computed: false, optional: true, required: false + private _capacity?: number; + public get capacity() { + return this.getNumberAttribute('capacity'); + } + public set capacity(value: number) { + this._capacity = value; + } + public resetCapacity() { + this._capacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get capacityInput() { + return this._capacity; + } + + // cpu_architecture - computed: false, optional: true, required: false + private _cpuArchitecture?: string; + public get cpuArchitecture() { + return this.getStringAttribute('cpu_architecture'); + } + public set cpuArchitecture(value: string) { + this._cpuArchitecture = value; + } + public resetCpuArchitecture() { + this._cpuArchitecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuArchitectureInput() { + return this._cpuArchitecture; + } + + // engine - computed: false, optional: true, required: false + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + public resetEngine() { + this._engine = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDcsFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cache_mode: cdktf.stringToTerraform(this._cacheMode), + capacity: cdktf.numberToTerraform(this._capacity), + cpu_architecture: cdktf.stringToTerraform(this._cpuArchitecture), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cache_mode: { + value: cdktf.stringToHclTerraform(this._cacheMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + capacity: { + value: cdktf.numberToHclTerraform(this._capacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cpu_architecture: { + value: cdktf.stringToHclTerraform(this._cpuArchitecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/README.md new file mode 100644 index 00000000..e0646086 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_hotkey_analyses` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_hotkey_analyses`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/index.ts new file mode 100644 index 00000000..1c954900 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-hotkey-analyses/index.ts @@ -0,0 +1,369 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsHotkeyAnalysesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the hot key analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#analysis_id DataHuaweicloudDcsHotkeyAnalyses#analysis_id} + */ + readonly analysisId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#id DataHuaweicloudDcsHotkeyAnalyses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#instance_id DataHuaweicloudDcsHotkeyAnalyses#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#region DataHuaweicloudDcsHotkeyAnalyses#region} + */ + readonly region?: string; + /** + * Specifies the mode of the hot key analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#scan_type DataHuaweicloudDcsHotkeyAnalyses#scan_type} + */ + readonly scanType?: string; + /** + * Specifies the status of the hot key analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#status DataHuaweicloudDcsHotkeyAnalyses#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDcsHotkeyAnalysesRecords { +} + +export function dataHuaweicloudDcsHotkeyAnalysesRecordsToTerraform(struct?: DataHuaweicloudDcsHotkeyAnalysesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsHotkeyAnalysesRecordsToHclTerraform(struct?: DataHuaweicloudDcsHotkeyAnalysesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsHotkeyAnalysesRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsHotkeyAnalysesRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsHotkeyAnalysesRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // scan_type - computed: true, optional: false, required: false + public get scanType() { + return this.getStringAttribute('scan_type'); + } + + // started_at - computed: true, optional: false, required: false + public get startedAt() { + return this.getStringAttribute('started_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDcsHotkeyAnalysesRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsHotkeyAnalysesRecordsOutputReference { + return new DataHuaweicloudDcsHotkeyAnalysesRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses huaweicloud_dcs_hotkey_analyses} +*/ +export class DataHuaweicloudDcsHotkeyAnalyses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_hotkey_analyses"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsHotkeyAnalyses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsHotkeyAnalyses to import + * @param importFromId The id of the existing DataHuaweicloudDcsHotkeyAnalyses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsHotkeyAnalyses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_hotkey_analyses", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_hotkey_analyses huaweicloud_dcs_hotkey_analyses} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsHotkeyAnalysesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsHotkeyAnalysesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_hotkey_analyses', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._analysisId = config.analysisId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._scanType = config.scanType; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // analysis_id - computed: false, optional: true, required: false + private _analysisId?: string; + public get analysisId() { + return this.getStringAttribute('analysis_id'); + } + public set analysisId(value: string) { + this._analysisId = value; + } + public resetAnalysisId() { + this._analysisId = undefined; + } + // Temporarily expose input value. Use with caution. + public get analysisIdInput() { + return this._analysisId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudDcsHotkeyAnalysesRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scan_type - computed: false, optional: true, required: false + private _scanType?: string; + public get scanType() { + return this.getStringAttribute('scan_type'); + } + public set scanType(value: string) { + this._scanType = value; + } + public resetScanType() { + this._scanType = undefined; + } + // Temporarily expose input value. Use with caution. + public get scanTypeInput() { + return this._scanType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + analysis_id: cdktf.stringToTerraform(this._analysisId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + scan_type: cdktf.stringToTerraform(this._scanType), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + analysis_id: { + value: cdktf.stringToHclTerraform(this._analysisId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scan_type: { + value: cdktf.stringToHclTerraform(this._scanType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/README.md new file mode 100644 index 00000000..fa9b5c70 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/index.ts new file mode 100644 index 00000000..b76e2085 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-instances/index.ts @@ -0,0 +1,476 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cache capacity. Unit: GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#capacity DataHuaweicloudDcsInstances#capacity} + */ + readonly capacity?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#id DataHuaweicloudDcsInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of an instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#name DataHuaweicloudDcsInstances#name} + */ + readonly name?: string; + /** + * Specifies the subnet Network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#private_ip DataHuaweicloudDcsInstances#private_ip} + */ + readonly privateIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#region DataHuaweicloudDcsInstances#region} + */ + readonly region?: string; + /** + * Specifies the cache instance status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#status DataHuaweicloudDcsInstances#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDcsInstancesInstances { +} + +export function dataHuaweicloudDcsInstancesInstancesToTerraform(struct?: DataHuaweicloudDcsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDcsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_user - computed: true, optional: false, required: false + public get accessUser() { + return this.getStringAttribute('access_user'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // capacity - computed: true, optional: false, required: false + public get capacity() { + return this.getNumberAttribute('capacity'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // max_memory - computed: true, optional: false, required: false + public get maxMemory() { + return this.getNumberAttribute('max_memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // security_group_name - computed: true, optional: false, required: false + public get securityGroupName() { + return this.getStringAttribute('security_group_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // subnet_name - computed: true, optional: false, required: false + public get subnetName() { + return this.getStringAttribute('subnet_name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // used_memory - computed: true, optional: false, required: false + public get usedMemory() { + return this.getNumberAttribute('used_memory'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } +} + +export class DataHuaweicloudDcsInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsInstancesInstancesOutputReference { + return new DataHuaweicloudDcsInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances huaweicloud_dcs_instances} +*/ +export class DataHuaweicloudDcsInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsInstances to import + * @param importFromId The id of the existing DataHuaweicloudDcsInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_instances huaweicloud_dcs_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._capacity = config.capacity; + this._id = config.id; + this._name = config.name; + this._privateIp = config.privateIp; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // capacity - computed: false, optional: true, required: false + private _capacity?: number; + public get capacity() { + return this.getNumberAttribute('capacity'); + } + public set capacity(value: number) { + this._capacity = value; + } + public resetCapacity() { + this._capacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get capacityInput() { + return this._capacity; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDcsInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_ip - computed: false, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + capacity: cdktf.numberToTerraform(this._capacity), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_ip: cdktf.stringToTerraform(this._privateIp), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + capacity: { + value: cdktf.numberToHclTerraform(this._capacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/README.md new file mode 100644 index 00000000..fa957078 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_maintainwindow_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_maintainwindow_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/index.ts new file mode 100644 index 00000000..ae8e247c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow-v1/index.ts @@ -0,0 +1,256 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsMaintainwindowV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#begin DataHuaweicloudDcsMaintainwindowV1#begin} + */ + readonly begin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#default DataHuaweicloudDcsMaintainwindowV1#default} + */ + readonly default?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#end DataHuaweicloudDcsMaintainwindowV1#end} + */ + readonly end?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#id DataHuaweicloudDcsMaintainwindowV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#region DataHuaweicloudDcsMaintainwindowV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#seq DataHuaweicloudDcsMaintainwindowV1#seq} + */ + readonly seq?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1 huaweicloud_dcs_maintainwindow_v1} +*/ +export class DataHuaweicloudDcsMaintainwindowV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_maintainwindow_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsMaintainwindowV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsMaintainwindowV1 to import + * @param importFromId The id of the existing DataHuaweicloudDcsMaintainwindowV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsMaintainwindowV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_maintainwindow_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow_v1 huaweicloud_dcs_maintainwindow_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsMaintainwindowV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsMaintainwindowV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_maintainwindow_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._begin = config.begin; + this._default = config.default; + this._end = config.end; + this._id = config.id; + this._region = config.region; + this._seq = config.seq; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin - computed: true, optional: true, required: false + private _begin?: string; + public get begin() { + return this.getStringAttribute('begin'); + } + public set begin(value: string) { + this._begin = value; + } + public resetBegin() { + this._begin = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginInput() { + return this._begin; + } + + // default - computed: true, optional: true, required: false + private _default?: boolean | cdktf.IResolvable; + public get default() { + return this.getBooleanAttribute('default'); + } + public set default(value: boolean | cdktf.IResolvable) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // end - computed: true, optional: true, required: false + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + public resetEnd() { + this._end = undefined; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // seq - computed: true, optional: true, required: false + private _seq?: number; + public get seq() { + return this.getNumberAttribute('seq'); + } + public set seq(value: number) { + this._seq = value; + } + public resetSeq() { + this._seq = undefined; + } + // Temporarily expose input value. Use with caution. + public get seqInput() { + return this._seq; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin: cdktf.stringToTerraform(this._begin), + default: cdktf.booleanToTerraform(this._default), + end: cdktf.stringToTerraform(this._end), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + seq: cdktf.numberToTerraform(this._seq), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin: { + value: cdktf.stringToHclTerraform(this._begin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default: { + value: cdktf.booleanToHclTerraform(this._default), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end: { + value: cdktf.stringToHclTerraform(this._end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + seq: { + value: cdktf.numberToHclTerraform(this._seq), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/README.md new file mode 100644 index 00000000..e29dfb6c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_maintainwindow` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_maintainwindow`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/index.ts new file mode 100644 index 00000000..f96efe3d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-maintainwindow/index.ts @@ -0,0 +1,256 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsMaintainwindowConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#begin DataHuaweicloudDcsMaintainwindow#begin} + */ + readonly begin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#default DataHuaweicloudDcsMaintainwindow#default} + */ + readonly default?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#end DataHuaweicloudDcsMaintainwindow#end} + */ + readonly end?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#id DataHuaweicloudDcsMaintainwindow#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#region DataHuaweicloudDcsMaintainwindow#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#seq DataHuaweicloudDcsMaintainwindow#seq} + */ + readonly seq?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow huaweicloud_dcs_maintainwindow} +*/ +export class DataHuaweicloudDcsMaintainwindow extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_maintainwindow"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsMaintainwindow resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsMaintainwindow to import + * @param importFromId The id of the existing DataHuaweicloudDcsMaintainwindow that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsMaintainwindow to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_maintainwindow", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_maintainwindow huaweicloud_dcs_maintainwindow} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsMaintainwindowConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsMaintainwindowConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_maintainwindow', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._begin = config.begin; + this._default = config.default; + this._end = config.end; + this._id = config.id; + this._region = config.region; + this._seq = config.seq; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin - computed: true, optional: true, required: false + private _begin?: string; + public get begin() { + return this.getStringAttribute('begin'); + } + public set begin(value: string) { + this._begin = value; + } + public resetBegin() { + this._begin = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginInput() { + return this._begin; + } + + // default - computed: true, optional: true, required: false + private _default?: boolean | cdktf.IResolvable; + public get default() { + return this.getBooleanAttribute('default'); + } + public set default(value: boolean | cdktf.IResolvable) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // end - computed: true, optional: true, required: false + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + public resetEnd() { + this._end = undefined; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // seq - computed: true, optional: true, required: false + private _seq?: number; + public get seq() { + return this.getNumberAttribute('seq'); + } + public set seq(value: number) { + this._seq = value; + } + public resetSeq() { + this._seq = undefined; + } + // Temporarily expose input value. Use with caution. + public get seqInput() { + return this._seq; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin: cdktf.stringToTerraform(this._begin), + default: cdktf.booleanToTerraform(this._default), + end: cdktf.stringToTerraform(this._end), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + seq: cdktf.numberToTerraform(this._seq), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin: { + value: cdktf.stringToHclTerraform(this._begin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default: { + value: cdktf.booleanToHclTerraform(this._default), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end: { + value: cdktf.stringToHclTerraform(this._end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + seq: { + value: cdktf.numberToHclTerraform(this._seq), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/README.md new file mode 100644 index 00000000..56078995 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_product_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_product_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/index.ts new file mode 100644 index 00000000..98280f49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product-v1/index.ts @@ -0,0 +1,192 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsProductV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1#id DataHuaweicloudDcsProductV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1#region DataHuaweicloudDcsProductV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1#spec_code DataHuaweicloudDcsProductV1#spec_code} + */ + readonly specCode?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1 huaweicloud_dcs_product_v1} +*/ +export class DataHuaweicloudDcsProductV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_product_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsProductV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsProductV1 to import + * @param importFromId The id of the existing DataHuaweicloudDcsProductV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsProductV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_product_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product_v1 huaweicloud_dcs_product_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsProductV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsProductV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_product_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._specCode = config.specCode; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // capacity - computed: true, optional: false, required: false + public get capacity() { + return this.getStringAttribute('capacity'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec_code - computed: true, optional: true, required: false + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + public resetSpecCode() { + this._specCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + spec_code: cdktf.stringToTerraform(this._specCode), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_code: { + value: cdktf.stringToHclTerraform(this._specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/README.md new file mode 100644 index 00000000..421a607e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_product` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_product`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/index.ts new file mode 100644 index 00000000..5800cc48 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-product/index.ts @@ -0,0 +1,192 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsProductConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product#id DataHuaweicloudDcsProduct#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product#region DataHuaweicloudDcsProduct#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product#spec_code DataHuaweicloudDcsProduct#spec_code} + */ + readonly specCode?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product huaweicloud_dcs_product} +*/ +export class DataHuaweicloudDcsProduct extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_product"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsProduct resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsProduct to import + * @param importFromId The id of the existing DataHuaweicloudDcsProduct that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsProduct to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_product", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_product huaweicloud_dcs_product} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsProductConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsProductConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_product', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._specCode = config.specCode; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // capacity - computed: true, optional: false, required: false + public get capacity() { + return this.getStringAttribute('capacity'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec_code - computed: true, optional: true, required: false + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + public resetSpecCode() { + this._specCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + spec_code: cdktf.stringToTerraform(this._specCode), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_code: { + value: cdktf.stringToHclTerraform(this._specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/README.md new file mode 100644 index 00000000..15954069 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_template_detail` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_template_detail`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/index.ts new file mode 100644 index 00000000..97149bad --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-template-detail/index.ts @@ -0,0 +1,411 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsTemplateDetailConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#id DataHuaweicloudDcsTemplateDetail#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#region DataHuaweicloudDcsTemplateDetail#region} + */ + readonly region?: string; + /** + * Specifies the ID of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#template_id DataHuaweicloudDcsTemplateDetail#template_id} + */ + readonly templateId: string; + /** + * Specifies the type of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#type DataHuaweicloudDcsTemplateDetail#type} + */ + readonly type: string; + /** + * params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#params DataHuaweicloudDcsTemplateDetail#params} + */ + readonly params?: DataHuaweicloudDcsTemplateDetailParams[] | cdktf.IResolvable; +} +export interface DataHuaweicloudDcsTemplateDetailParams { + /** + * Specifies the name of the param. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#param_name DataHuaweicloudDcsTemplateDetail#param_name} + */ + readonly paramName?: string; +} + +export function dataHuaweicloudDcsTemplateDetailParamsToTerraform(struct?: DataHuaweicloudDcsTemplateDetailParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + param_name: cdktf.stringToTerraform(struct!.paramName), + } +} + + +export function dataHuaweicloudDcsTemplateDetailParamsToHclTerraform(struct?: DataHuaweicloudDcsTemplateDetailParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + param_name: { + value: cdktf.stringToHclTerraform(struct!.paramName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudDcsTemplateDetailParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsTemplateDetailParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._paramName !== undefined) { + hasAnyValues = true; + internalValueResult.paramName = this._paramName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsTemplateDetailParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._paramName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._paramName = value.paramName; + } + } + + // default_value - computed: true, optional: false, required: false + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // need_restart - computed: true, optional: false, required: false + public get needRestart() { + return this.getBooleanAttribute('need_restart'); + } + + // param_id - computed: true, optional: false, required: false + public get paramId() { + return this.getStringAttribute('param_id'); + } + + // param_name - computed: true, optional: true, required: false + private _paramName?: string; + public get paramName() { + return this.getStringAttribute('param_name'); + } + public set paramName(value: string) { + this._paramName = value; + } + public resetParamName() { + this._paramName = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramNameInput() { + return this._paramName; + } + + // value_range - computed: true, optional: false, required: false + public get valueRange() { + return this.getStringAttribute('value_range'); + } + + // value_type - computed: true, optional: false, required: false + public get valueType() { + return this.getStringAttribute('value_type'); + } +} + +export class DataHuaweicloudDcsTemplateDetailParamsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudDcsTemplateDetailParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsTemplateDetailParamsOutputReference { + return new DataHuaweicloudDcsTemplateDetailParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail huaweicloud_dcs_template_detail} +*/ +export class DataHuaweicloudDcsTemplateDetail extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_template_detail"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsTemplateDetail resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsTemplateDetail to import + * @param importFromId The id of the existing DataHuaweicloudDcsTemplateDetail that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsTemplateDetail to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_template_detail", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_template_detail huaweicloud_dcs_template_detail} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsTemplateDetailConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsTemplateDetailConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_template_detail', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._templateId = config.templateId; + this._type = config.type; + this._params.internalValue = config.params; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // product_type - computed: true, optional: false, required: false + public get productType() { + return this.getStringAttribute('product_type'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_type - computed: true, optional: false, required: false + public get storageType() { + return this.getStringAttribute('storage_type'); + } + + // template_id - computed: false, optional: false, required: true + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // params - computed: false, optional: true, required: false + private _params = new DataHuaweicloudDcsTemplateDetailParamsList(this, "params", false); + public get params() { + return this._params; + } + public putParams(value: DataHuaweicloudDcsTemplateDetailParams[] | cdktf.IResolvable) { + this._params.internalValue = value; + } + public resetParams() { + this._params.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + params: cdktf.listMapper(dataHuaweicloudDcsTemplateDetailParamsToTerraform, true)(this._params.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + params: { + value: cdktf.listMapperHcl(dataHuaweicloudDcsTemplateDetailParamsToHclTerraform, true)(this._params.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudDcsTemplateDetailParamsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/README.md new file mode 100644 index 00000000..5d78f05c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dcs_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dcs_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/index.ts new file mode 100644 index 00000000..86d99237 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dcs-templates/index.ts @@ -0,0 +1,502 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDcsTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DCS instance type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#cache_mode DataHuaweicloudDcsTemplates#cache_mode} + */ + readonly cacheMode?: string; + /** + * Specifies the cache engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#engine DataHuaweicloudDcsTemplates#engine} + */ + readonly engine?: string; + /** + * Specifies the cache engine version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#engine_version DataHuaweicloudDcsTemplates#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#id DataHuaweicloudDcsTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#name DataHuaweicloudDcsTemplates#name} + */ + readonly name?: string; + /** + * Specifies the product edition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#product_type DataHuaweicloudDcsTemplates#product_type} + */ + readonly productType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#region DataHuaweicloudDcsTemplates#region} + */ + readonly region?: string; + /** + * Specifies the storage type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#storage_type DataHuaweicloudDcsTemplates#storage_type} + */ + readonly storageType?: string; + /** + * Specifies the ID of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#template_id DataHuaweicloudDcsTemplates#template_id} + */ + readonly templateId?: string; + /** + * Specifies the type of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#type DataHuaweicloudDcsTemplates#type} + */ + readonly type: string; +} +export interface DataHuaweicloudDcsTemplatesTemplates { +} + +export function dataHuaweicloudDcsTemplatesTemplatesToTerraform(struct?: DataHuaweicloudDcsTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDcsTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudDcsTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDcsTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDcsTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDcsTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // product_type - computed: true, optional: false, required: false + public get productType() { + return this.getStringAttribute('product_type'); + } + + // storage_type - computed: true, optional: false, required: false + public get storageType() { + return this.getStringAttribute('storage_type'); + } + + // template_id - computed: true, optional: false, required: false + public get templateId() { + return this.getStringAttribute('template_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDcsTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDcsTemplatesTemplatesOutputReference { + return new DataHuaweicloudDcsTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates huaweicloud_dcs_templates} +*/ +export class DataHuaweicloudDcsTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDcsTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDcsTemplates to import + * @param importFromId The id of the existing DataHuaweicloudDcsTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDcsTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dcs_templates huaweicloud_dcs_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDcsTemplatesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDcsTemplatesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cacheMode = config.cacheMode; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._name = config.name; + this._productType = config.productType; + this._region = config.region; + this._storageType = config.storageType; + this._templateId = config.templateId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_mode - computed: false, optional: true, required: false + private _cacheMode?: string; + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + public set cacheMode(value: string) { + this._cacheMode = value; + } + public resetCacheMode() { + this._cacheMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheModeInput() { + return this._cacheMode; + } + + // engine - computed: false, optional: true, required: false + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + public resetEngine() { + this._engine = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // product_type - computed: false, optional: true, required: false + private _productType?: string; + public get productType() { + return this.getStringAttribute('product_type'); + } + public set productType(value: string) { + this._productType = value; + } + public resetProductType() { + this._productType = undefined; + } + // Temporarily expose input value. Use with caution. + public get productTypeInput() { + return this._productType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_type - computed: false, optional: true, required: false + private _storageType?: string; + public get storageType() { + return this.getStringAttribute('storage_type'); + } + public set storageType(value: string) { + this._storageType = value; + } + public resetStorageType() { + this._storageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageTypeInput() { + return this._storageType; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudDcsTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cache_mode: cdktf.stringToTerraform(this._cacheMode), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + product_type: cdktf.stringToTerraform(this._productType), + region: cdktf.stringToTerraform(this._region), + storage_type: cdktf.stringToTerraform(this._storageType), + template_id: cdktf.stringToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cache_mode: { + value: cdktf.stringToHclTerraform(this._cacheMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_type: { + value: cdktf.stringToHclTerraform(this._productType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_type: { + value: cdktf.stringToHclTerraform(this._storageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/README.md new file mode 100644 index 00000000..7ca395a4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/index.ts new file mode 100644 index 00000000..21eede4b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-accounts/index.ts @@ -0,0 +1,413 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts#id DataHuaweicloudDdmAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts#instance_id DataHuaweicloudDdmAccounts#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the DDM account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts#name DataHuaweicloudDdmAccounts#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts#region DataHuaweicloudDdmAccounts#region} + */ + readonly region?: string; + /** + * Specifies the status of the DDM account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts#status DataHuaweicloudDdmAccounts#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDdmAccountsAccountsSchemas { +} + +export function dataHuaweicloudDdmAccountsAccountsSchemasToTerraform(struct?: DataHuaweicloudDdmAccountsAccountsSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmAccountsAccountsSchemasToHclTerraform(struct?: DataHuaweicloudDdmAccountsAccountsSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmAccountsAccountsSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmAccountsAccountsSchemas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmAccountsAccountsSchemas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDdmAccountsAccountsSchemasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmAccountsAccountsSchemasOutputReference { + return new DataHuaweicloudDdmAccountsAccountsSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdmAccountsAccounts { +} + +export function dataHuaweicloudDdmAccountsAccountsToTerraform(struct?: DataHuaweicloudDdmAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmAccountsAccountsToHclTerraform(struct?: DataHuaweicloudDdmAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmAccountsAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmAccountsAccounts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmAccountsAccounts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // permissions - computed: true, optional: false, required: false + public get permissions() { + return this.getListAttribute('permissions'); + } + + // schemas - computed: true, optional: false, required: false + private _schemas = new DataHuaweicloudDdmAccountsAccountsSchemasList(this, "schemas", false); + public get schemas() { + return this._schemas; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDdmAccountsAccountsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmAccountsAccountsOutputReference { + return new DataHuaweicloudDdmAccountsAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts huaweicloud_ddm_accounts} +*/ +export class DataHuaweicloudDdmAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmAccounts to import + * @param importFromId The id of the existing DataHuaweicloudDdmAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_accounts huaweicloud_ddm_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmAccountsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmAccountsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // accounts - computed: true, optional: false, required: false + private _accounts = new DataHuaweicloudDdmAccountsAccountsList(this, "accounts", false); + public get accounts() { + return this._accounts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/README.md new file mode 100644 index 00000000..59a72409 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_engines` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_engines`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/index.ts new file mode 100644 index 00000000..75c23947 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-engines/index.ts @@ -0,0 +1,260 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmEnginesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines#id DataHuaweicloudDdmEngines#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines#region DataHuaweicloudDdmEngines#region} + */ + readonly region?: string; + /** + * Specifies the engine version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines#version DataHuaweicloudDdmEngines#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudDdmEnginesEngines { +} + +export function dataHuaweicloudDdmEnginesEnginesToTerraform(struct?: DataHuaweicloudDdmEnginesEngines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmEnginesEnginesToHclTerraform(struct?: DataHuaweicloudDdmEnginesEngines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmEnginesEnginesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmEnginesEngines | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmEnginesEngines | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDdmEnginesEnginesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmEnginesEnginesOutputReference { + return new DataHuaweicloudDdmEnginesEnginesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines huaweicloud_ddm_engines} +*/ +export class DataHuaweicloudDdmEngines extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_engines"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmEngines resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmEngines to import + * @param importFromId The id of the existing DataHuaweicloudDdmEngines that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmEngines to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_engines", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_engines huaweicloud_ddm_engines} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmEnginesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmEnginesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_engines', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // engines - computed: true, optional: false, required: false + private _engines = new DataHuaweicloudDdmEnginesEnginesList(this, "engines", false); + public get engines() { + return this._engines; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/README.md new file mode 100644 index 00000000..eeed4b96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/index.ts new file mode 100644 index 00000000..93d4c0bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-flavors/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the VM flavor types recorded in DDM. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#code DataHuaweicloudDdmFlavors#code} + */ + readonly code?: string; + /** + * Specifies the compute resource architecture type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#cpu_arch DataHuaweicloudDdmFlavors#cpu_arch} + */ + readonly cpuArch?: string; + /** + * Specifies the ID of an engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#engine_id DataHuaweicloudDdmFlavors#engine_id} + */ + readonly engineId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#id DataHuaweicloudDdmFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the memory size. Unit GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#memory DataHuaweicloudDdmFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#region DataHuaweicloudDdmFlavors#region} + */ + readonly region?: string; + /** + * Specifies the number of CPUs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#vcpus DataHuaweicloudDdmFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudDdmFlavorsFlavors { +} + +export function dataHuaweicloudDdmFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDdmFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDdmFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // cpu_arch - computed: true, optional: false, required: false + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudDdmFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmFlavorsFlavorsOutputReference { + return new DataHuaweicloudDdmFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors huaweicloud_ddm_flavors} +*/ +export class DataHuaweicloudDdmFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDdmFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_flavors huaweicloud_ddm_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._cpuArch = config.cpuArch; + this._engineId = config.engineId; + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: false, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // cpu_arch - computed: false, optional: true, required: false + private _cpuArch?: string; + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + public set cpuArch(value: string) { + this._cpuArch = value; + } + public resetCpuArch() { + this._cpuArch = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuArchInput() { + return this._cpuArch; + } + + // engine_id - computed: false, optional: false, required: true + private _engineId?: string; + public get engineId() { + return this.getStringAttribute('engine_id'); + } + public set engineId(value: string) { + this._engineId = value; + } + // Temporarily expose input value. Use with caution. + public get engineIdInput() { + return this._engineId; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDdmFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + cpu_arch: cdktf.stringToTerraform(this._cpuArch), + engine_id: cdktf.stringToTerraform(this._engineId), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_arch: { + value: cdktf.stringToHclTerraform(this._cpuArch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_id: { + value: cdktf.stringToHclTerraform(this._engineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/README.md new file mode 100644 index 00000000..dfbb15c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_instance_available_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_instance_available_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/index.ts new file mode 100644 index 00000000..425fa5a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-available-versions/index.ts @@ -0,0 +1,198 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmInstanceAvailableVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions#id DataHuaweicloudDdmInstanceAvailableVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the DDM instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions#instance_id DataHuaweicloudDdmInstanceAvailableVersions#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions#region DataHuaweicloudDdmInstanceAvailableVersions#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions huaweicloud_ddm_instance_available_versions} +*/ +export class DataHuaweicloudDdmInstanceAvailableVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_available_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmInstanceAvailableVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmInstanceAvailableVersions to import + * @param importFromId The id of the existing DataHuaweicloudDdmInstanceAvailableVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmInstanceAvailableVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_available_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_available_versions huaweicloud_ddm_instance_available_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmInstanceAvailableVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmInstanceAvailableVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_available_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // current_favored_version - computed: true, optional: false, required: false + public get currentFavoredVersion() { + return this.getStringAttribute('current_favored_version'); + } + + // current_version - computed: true, optional: false, required: false + public get currentVersion() { + return this.getStringAttribute('current_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // latest_version - computed: true, optional: false, required: false + public get latestVersion() { + return this.getStringAttribute('latest_version'); + } + + // previous_version - computed: true, optional: false, required: false + public get previousVersion() { + return this.getStringAttribute('previous_version'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/README.md new file mode 100644 index 00000000..6c773c66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_instance_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_instance_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/index.ts new file mode 100644 index 00000000..6feca04c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-groups/index.ts @@ -0,0 +1,386 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmInstanceGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups#id DataHuaweicloudDdmInstanceGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups#instance_id DataHuaweicloudDdmInstanceGroups#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups#region DataHuaweicloudDdmInstanceGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdmInstanceGroupsGroupListNodeListStruct { +} + +export function dataHuaweicloudDdmInstanceGroupsGroupListNodeListStructToTerraform(struct?: DataHuaweicloudDdmInstanceGroupsGroupListNodeListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmInstanceGroupsGroupListNodeListStructToHclTerraform(struct?: DataHuaweicloudDdmInstanceGroupsGroupListNodeListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmInstanceGroupsGroupListNodeListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmInstanceGroupsGroupListNodeListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmInstanceGroupsGroupListNodeListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az - computed: true, optional: false, required: false + public get az() { + return this.getStringAttribute('az'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDdmInstanceGroupsGroupListNodeListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmInstanceGroupsGroupListNodeListStructOutputReference { + return new DataHuaweicloudDdmInstanceGroupsGroupListNodeListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdmInstanceGroupsGroupListStruct { +} + +export function dataHuaweicloudDdmInstanceGroupsGroupListStructToTerraform(struct?: DataHuaweicloudDdmInstanceGroupsGroupListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmInstanceGroupsGroupListStructToHclTerraform(struct?: DataHuaweicloudDdmInstanceGroupsGroupListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmInstanceGroupsGroupListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmInstanceGroupsGroupListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmInstanceGroupsGroupListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // architecture - computed: true, optional: false, required: false + public get architecture() { + return this.getStringAttribute('architecture'); + } + + // cpu_num_per_node - computed: true, optional: false, required: false + public get cpuNumPerNode() { + return this.getNumberAttribute('cpu_num_per_node'); + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv6_endpoint - computed: true, optional: false, required: false + public get ipv6Endpoint() { + return this.getStringAttribute('ipv6_endpoint'); + } + + // is_default_group - computed: true, optional: false, required: false + public get isDefaultGroup() { + return this.getBooleanAttribute('is_default_group'); + } + + // is_load_balance - computed: true, optional: false, required: false + public get isLoadBalance() { + return this.getBooleanAttribute('is_load_balance'); + } + + // mem_num_per_node - computed: true, optional: false, required: false + public get memNumPerNode() { + return this.getNumberAttribute('mem_num_per_node'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_list - computed: true, optional: false, required: false + private _nodeList = new DataHuaweicloudDdmInstanceGroupsGroupListNodeListStructList(this, "node_list", false); + public get nodeList() { + return this._nodeList; + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } +} + +export class DataHuaweicloudDdmInstanceGroupsGroupListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmInstanceGroupsGroupListStructOutputReference { + return new DataHuaweicloudDdmInstanceGroupsGroupListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups huaweicloud_ddm_instance_groups} +*/ +export class DataHuaweicloudDdmInstanceGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmInstanceGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmInstanceGroups to import + * @param importFromId The id of the existing DataHuaweicloudDdmInstanceGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmInstanceGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_groups huaweicloud_ddm_instance_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmInstanceGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmInstanceGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // group_list - computed: true, optional: false, required: false + private _groupList = new DataHuaweicloudDdmInstanceGroupsGroupListStructList(this, "group_list", false); + public get groupList() { + return this._groupList; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/README.md new file mode 100644 index 00000000..8b24dae9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_instance_nodes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_instance_nodes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/index.ts new file mode 100644 index 00000000..c29efa51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instance-nodes/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmInstanceNodesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes#id DataHuaweicloudDdmInstanceNodes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes#instance_id DataHuaweicloudDdmInstanceNodes#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes#region DataHuaweicloudDdmInstanceNodes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdmInstanceNodesNodes { +} + +export function dataHuaweicloudDdmInstanceNodesNodesToTerraform(struct?: DataHuaweicloudDdmInstanceNodesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmInstanceNodesNodesToHclTerraform(struct?: DataHuaweicloudDdmInstanceNodesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmInstanceNodesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmInstanceNodesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmInstanceNodesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDdmInstanceNodesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmInstanceNodesNodesOutputReference { + return new DataHuaweicloudDdmInstanceNodesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes huaweicloud_ddm_instance_nodes} +*/ +export class DataHuaweicloudDdmInstanceNodes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_nodes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmInstanceNodes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmInstanceNodes to import + * @param importFromId The id of the existing DataHuaweicloudDdmInstanceNodes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmInstanceNodes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_nodes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instance_nodes huaweicloud_ddm_instance_nodes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmInstanceNodesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmInstanceNodesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_nodes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudDdmInstanceNodesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/README.md new file mode 100644 index 00000000..55bb4d5f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/index.ts new file mode 100644 index 00000000..e7da068a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-instances/index.ts @@ -0,0 +1,395 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the engine version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#engine_version DataHuaweicloudDdmInstances#engine_version} + */ + readonly engineVersion?: string; + /** + * Specifies the enterprise project id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#enterprise_project_id DataHuaweicloudDdmInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#id DataHuaweicloudDdmInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#name DataHuaweicloudDdmInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#region DataHuaweicloudDdmInstances#region} + */ + readonly region?: string; + /** + * Specifies the status of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#status DataHuaweicloudDdmInstances#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDdmInstancesInstances { +} + +export function dataHuaweicloudDdmInstancesInstancesToTerraform(struct?: DataHuaweicloudDdmInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDdmInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_ip - computed: true, optional: false, required: false + public get accessIp() { + return this.getStringAttribute('access_ip'); + } + + // access_port - computed: true, optional: false, required: false + public get accessPort() { + return this.getStringAttribute('access_port'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDdmInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmInstancesInstancesOutputReference { + return new DataHuaweicloudDdmInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances huaweicloud_ddm_instances} +*/ +export class DataHuaweicloudDdmInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmInstances to import + * @param importFromId The id of the existing DataHuaweicloudDdmInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_instances huaweicloud_ddm_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDdmInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/README.md new file mode 100644 index 00000000..9c6634ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_killing_sessions_audit_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_killing_sessions_audit_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/index.ts new file mode 100644 index 00000000..88d8c5c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-killing-sessions-audit-logs/index.ts @@ -0,0 +1,328 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmKillingSessionsAuditLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in UTC, accurate to milliseconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs#end_time DataHuaweicloudDdmKillingSessionsAuditLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs#id DataHuaweicloudDdmKillingSessionsAuditLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the DDM instance ID or ID of the associated RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs#instance_id DataHuaweicloudDdmKillingSessionsAuditLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs#region DataHuaweicloudDdmKillingSessionsAuditLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in UTC, accurate to milliseconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs#start_time DataHuaweicloudDdmKillingSessionsAuditLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogs { +} + +export function dataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsToTerraform(struct?: DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsToHclTerraform(struct?: DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // execute_time - computed: true, optional: false, required: false + public get executeTime() { + return this.getStringAttribute('execute_time'); + } + + // execute_user_name - computed: true, optional: false, required: false + public get executeUserName() { + return this.getStringAttribute('execute_user_name'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // process_id - computed: true, optional: false, required: false + public get processId() { + return this.getStringAttribute('process_id'); + } +} + +export class DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsOutputReference { + return new DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs huaweicloud_ddm_killing_sessions_audit_logs} +*/ +export class DataHuaweicloudDdmKillingSessionsAuditLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_killing_sessions_audit_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmKillingSessionsAuditLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmKillingSessionsAuditLogs to import + * @param importFromId The id of the existing DataHuaweicloudDdmKillingSessionsAuditLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmKillingSessionsAuditLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_killing_sessions_audit_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_killing_sessions_audit_logs huaweicloud_ddm_killing_sessions_audit_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmKillingSessionsAuditLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmKillingSessionsAuditLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_killing_sessions_audit_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // process_audit_logs - computed: true, optional: false, required: false + private _processAuditLogs = new DataHuaweicloudDdmKillingSessionsAuditLogsProcessAuditLogsList(this, "process_audit_logs", false); + public get processAuditLogs() { + return this._processAuditLogs; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/README.md new file mode 100644 index 00000000..36533fea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_logical_sessions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_logical_sessions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/index.ts new file mode 100644 index 00000000..6fd74bb6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-logical-sessions/index.ts @@ -0,0 +1,319 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmLogicalSessionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions#id DataHuaweicloudDdmLogicalSessions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the DDM instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions#instance_id DataHuaweicloudDdmLogicalSessions#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the keyword filtered by the session result. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions#keyword DataHuaweicloudDdmLogicalSessions#keyword} + */ + readonly keyword?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions#region DataHuaweicloudDdmLogicalSessions#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdmLogicalSessionsLogicalProcesses { +} + +export function dataHuaweicloudDdmLogicalSessionsLogicalProcessesToTerraform(struct?: DataHuaweicloudDdmLogicalSessionsLogicalProcesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmLogicalSessionsLogicalProcessesToHclTerraform(struct?: DataHuaweicloudDdmLogicalSessionsLogicalProcesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmLogicalSessionsLogicalProcessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmLogicalSessionsLogicalProcesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmLogicalSessionsLogicalProcesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // command - computed: true, optional: false, required: false + public get command() { + return this.getStringAttribute('command'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getStringAttribute('db'); + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // info - computed: true, optional: false, required: false + public get info() { + return this.getStringAttribute('info'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } + + // user - computed: true, optional: false, required: false + public get user() { + return this.getStringAttribute('user'); + } +} + +export class DataHuaweicloudDdmLogicalSessionsLogicalProcessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmLogicalSessionsLogicalProcessesOutputReference { + return new DataHuaweicloudDdmLogicalSessionsLogicalProcessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions huaweicloud_ddm_logical_sessions} +*/ +export class DataHuaweicloudDdmLogicalSessions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_logical_sessions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmLogicalSessions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmLogicalSessions to import + * @param importFromId The id of the existing DataHuaweicloudDdmLogicalSessions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmLogicalSessions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_logical_sessions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_logical_sessions huaweicloud_ddm_logical_sessions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmLogicalSessionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmLogicalSessionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_logical_sessions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._keyword = config.keyword; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keyword - computed: false, optional: true, required: false + private _keyword?: string; + public get keyword() { + return this.getStringAttribute('keyword'); + } + public set keyword(value: string) { + this._keyword = value; + } + public resetKeyword() { + this._keyword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordInput() { + return this._keyword; + } + + // logical_processes - computed: true, optional: false, required: false + private _logicalProcesses = new DataHuaweicloudDdmLogicalSessionsLogicalProcessesList(this, "logical_processes", false); + public get logicalProcesses() { + return this._logicalProcesses; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keyword: cdktf.stringToTerraform(this._keyword), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keyword: { + value: cdktf.stringToHclTerraform(this._keyword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/README.md new file mode 100644 index 00000000..9b462121 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_physical_sessions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_physical_sessions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/index.ts new file mode 100644 index 00000000..00586b6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-physical-sessions/index.ts @@ -0,0 +1,324 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmPhysicalSessionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions#id DataHuaweicloudDdmPhysicalSessions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the associated RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions#instance_id DataHuaweicloudDdmPhysicalSessions#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the Keyword filtered by the sessions result. It can contain a maximum of 255 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions#keyword DataHuaweicloudDdmPhysicalSessions#keyword} + */ + readonly keyword?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions#region DataHuaweicloudDdmPhysicalSessions#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdmPhysicalSessionsPhysicalProcesses { +} + +export function dataHuaweicloudDdmPhysicalSessionsPhysicalProcessesToTerraform(struct?: DataHuaweicloudDdmPhysicalSessionsPhysicalProcesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmPhysicalSessionsPhysicalProcessesToHclTerraform(struct?: DataHuaweicloudDdmPhysicalSessionsPhysicalProcesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmPhysicalSessionsPhysicalProcessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmPhysicalSessionsPhysicalProcesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmPhysicalSessionsPhysicalProcesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // command - computed: true, optional: false, required: false + public get command() { + return this.getStringAttribute('command'); + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getStringAttribute('db'); + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // info - computed: true, optional: false, required: false + public get info() { + return this.getStringAttribute('info'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getNumberAttribute('time'); + } + + // trx_executed_time - computed: true, optional: false, required: false + public get trxExecutedTime() { + return this.getNumberAttribute('trx_executed_time'); + } + + // user - computed: true, optional: false, required: false + public get user() { + return this.getStringAttribute('user'); + } +} + +export class DataHuaweicloudDdmPhysicalSessionsPhysicalProcessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmPhysicalSessionsPhysicalProcessesOutputReference { + return new DataHuaweicloudDdmPhysicalSessionsPhysicalProcessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions huaweicloud_ddm_physical_sessions} +*/ +export class DataHuaweicloudDdmPhysicalSessions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_physical_sessions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmPhysicalSessions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmPhysicalSessions to import + * @param importFromId The id of the existing DataHuaweicloudDdmPhysicalSessions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmPhysicalSessions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_physical_sessions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_physical_sessions huaweicloud_ddm_physical_sessions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmPhysicalSessionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmPhysicalSessionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_physical_sessions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._keyword = config.keyword; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keyword - computed: false, optional: true, required: false + private _keyword?: string; + public get keyword() { + return this.getStringAttribute('keyword'); + } + public set keyword(value: string) { + this._keyword = value; + } + public resetKeyword() { + this._keyword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordInput() { + return this._keyword; + } + + // physical_processes - computed: true, optional: false, required: false + private _physicalProcesses = new DataHuaweicloudDdmPhysicalSessionsPhysicalProcessesList(this, "physical_processes", false); + public get physicalProcesses() { + return this._physicalProcesses; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keyword: cdktf.stringToTerraform(this._keyword), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keyword: { + value: cdktf.stringToHclTerraform(this._keyword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/README.md new file mode 100644 index 00000000..8e0e5f72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ddm_schemas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ddm_schemas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/index.ts new file mode 100644 index 00000000..748f0d02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ddm-schemas/index.ts @@ -0,0 +1,448 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdmSchemasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#id DataHuaweicloudDdmSchemas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#instance_id DataHuaweicloudDdmSchemas#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the DDM schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#name DataHuaweicloudDdmSchemas#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#region DataHuaweicloudDdmSchemas#region} + */ + readonly region?: string; + /** + * Specifies the sharding mode of the schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#shard_mode DataHuaweicloudDdmSchemas#shard_mode} + */ + readonly shardMode?: string; + /** + * Specifies the status of the DDM schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#status DataHuaweicloudDdmSchemas#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDdmSchemasSchemasDataNodes { +} + +export function dataHuaweicloudDdmSchemasSchemasDataNodesToTerraform(struct?: DataHuaweicloudDdmSchemasSchemasDataNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmSchemasSchemasDataNodesToHclTerraform(struct?: DataHuaweicloudDdmSchemasSchemasDataNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmSchemasSchemasDataNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmSchemasSchemasDataNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmSchemasSchemasDataNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDdmSchemasSchemasDataNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmSchemasSchemasDataNodesOutputReference { + return new DataHuaweicloudDdmSchemasSchemasDataNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdmSchemasSchemas { +} + +export function dataHuaweicloudDdmSchemasSchemasToTerraform(struct?: DataHuaweicloudDdmSchemasSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdmSchemasSchemasToHclTerraform(struct?: DataHuaweicloudDdmSchemasSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdmSchemasSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdmSchemasSchemas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdmSchemasSchemas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_nodes - computed: true, optional: false, required: false + private _dataNodes = new DataHuaweicloudDdmSchemasSchemasDataNodesList(this, "data_nodes", false); + public get dataNodes() { + return this._dataNodes; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // shard_mode - computed: true, optional: false, required: false + public get shardMode() { + return this.getStringAttribute('shard_mode'); + } + + // shard_number - computed: true, optional: false, required: false + public get shardNumber() { + return this.getNumberAttribute('shard_number'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDdmSchemasSchemasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdmSchemasSchemasOutputReference { + return new DataHuaweicloudDdmSchemasSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas huaweicloud_ddm_schemas} +*/ +export class DataHuaweicloudDdmSchemas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_schemas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdmSchemas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdmSchemas to import + * @param importFromId The id of the existing DataHuaweicloudDdmSchemas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdmSchemas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_schemas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ddm_schemas huaweicloud_ddm_schemas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdmSchemasConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdmSchemasConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_schemas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._shardMode = config.shardMode; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schemas - computed: true, optional: false, required: false + private _schemas = new DataHuaweicloudDdmSchemasSchemasList(this, "schemas", false); + public get schemas() { + return this._schemas; + } + + // shard_mode - computed: false, optional: true, required: false + private _shardMode?: string; + public get shardMode() { + return this.getStringAttribute('shard_mode'); + } + public set shardMode(value: string) { + this._shardMode = value; + } + public resetShardMode() { + this._shardMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get shardModeInput() { + return this._shardMode; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + shard_mode: cdktf.stringToTerraform(this._shardMode), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shard_mode: { + value: cdktf.stringToHclTerraform(this._shardMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/README.md new file mode 100644 index 00000000..92251d76 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_audit_log_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_audit_log_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/index.ts new file mode 100644 index 00000000..37f42390 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-log-links/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsAuditLogLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links#id DataHuaweicloudDdsAuditLogLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the list of audit log ids. A maximum of 50 audit log IDs are allowed in the list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links#ids DataHuaweicloudDdsAuditLogLinks#ids} + */ + readonly ids: string[]; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links#instance_id DataHuaweicloudDdsAuditLogLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links#region DataHuaweicloudDdsAuditLogLinks#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links huaweicloud_dds_audit_log_links} +*/ +export class DataHuaweicloudDdsAuditLogLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_audit_log_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsAuditLogLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsAuditLogLinks to import + * @param importFromId The id of the existing DataHuaweicloudDdsAuditLogLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsAuditLogLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_audit_log_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_log_links huaweicloud_dds_audit_log_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsAuditLogLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsAuditLogLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_audit_log_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ids = config.ids; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: false, optional: false, required: true + private _ids?: string[]; + public get ids() { + return this.getListAttribute('ids'); + } + public set ids(value: string[]) { + this._ids = value; + } + // Temporarily expose input value. Use with caution. + public get idsInput() { + return this._ids; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // links - computed: true, optional: false, required: false + public get links() { + return this.getListAttribute('links'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ids), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ids), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/README.md new file mode 100644 index 00000000..8244159e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_audit_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_audit_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/index.ts new file mode 100644 index 00000000..533ee733 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-audit-logs/index.ts @@ -0,0 +1,363 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsAuditLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time. The format of the end time is **yyyy-mm-ddThh:mm:ssZ**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#end_time DataHuaweicloudDdsAuditLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#id DataHuaweicloudDdsAuditLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#instance_id DataHuaweicloudDdsAuditLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the node whose audit logs are to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#node_id DataHuaweicloudDdsAuditLogs#node_id} + */ + readonly nodeId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#region DataHuaweicloudDdsAuditLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time. The format of the start time is **yyyy-MM-ddThh:mm:ssZ**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#start_time DataHuaweicloudDdsAuditLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudDdsAuditLogsAuditLogs { +} + +export function dataHuaweicloudDdsAuditLogsAuditLogsToTerraform(struct?: DataHuaweicloudDdsAuditLogsAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsAuditLogsAuditLogsToHclTerraform(struct?: DataHuaweicloudDdsAuditLogsAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsAuditLogsAuditLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsAuditLogsAuditLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsAuditLogsAuditLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_id - computed: true, optional: false, required: false + public get nodeId() { + return this.getStringAttribute('node_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudDdsAuditLogsAuditLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsAuditLogsAuditLogsOutputReference { + return new DataHuaweicloudDdsAuditLogsAuditLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs huaweicloud_dds_audit_logs} +*/ +export class DataHuaweicloudDdsAuditLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_audit_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsAuditLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsAuditLogs to import + * @param importFromId The id of the existing DataHuaweicloudDdsAuditLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsAuditLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_audit_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_audit_logs huaweicloud_dds_audit_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsAuditLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsAuditLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_audit_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // audit_logs - computed: true, optional: false, required: false + private _auditLogs = new DataHuaweicloudDdsAuditLogsAuditLogsList(this, "audit_logs", false); + public get auditLogs() { + return this._auditLogs; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/README.md new file mode 100644 index 00000000..2de1f4e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_backup_download_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_backup_download_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/index.ts new file mode 100644 index 00000000..4a141214 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backup-download-links/index.ts @@ -0,0 +1,301 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsBackupDownloadLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the backup ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links#backup_id DataHuaweicloudDdsBackupDownloadLinks#backup_id} + */ + readonly backupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links#id DataHuaweicloudDdsBackupDownloadLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links#instance_id DataHuaweicloudDdsBackupDownloadLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links#region DataHuaweicloudDdsBackupDownloadLinks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsBackupDownloadLinksFiles { +} + +export function dataHuaweicloudDdsBackupDownloadLinksFilesToTerraform(struct?: DataHuaweicloudDdsBackupDownloadLinksFiles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsBackupDownloadLinksFilesToHclTerraform(struct?: DataHuaweicloudDdsBackupDownloadLinksFiles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsBackupDownloadLinksFilesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsBackupDownloadLinksFiles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsBackupDownloadLinksFiles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // download_link - computed: true, optional: false, required: false + public get downloadLink() { + return this.getStringAttribute('download_link'); + } + + // link_expired_time - computed: true, optional: false, required: false + public get linkExpiredTime() { + return this.getStringAttribute('link_expired_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudDdsBackupDownloadLinksFilesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsBackupDownloadLinksFilesOutputReference { + return new DataHuaweicloudDdsBackupDownloadLinksFilesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links huaweicloud_dds_backup_download_links} +*/ +export class DataHuaweicloudDdsBackupDownloadLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_backup_download_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsBackupDownloadLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsBackupDownloadLinks to import + * @param importFromId The id of the existing DataHuaweicloudDdsBackupDownloadLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsBackupDownloadLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_backup_download_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backup_download_links huaweicloud_dds_backup_download_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsBackupDownloadLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsBackupDownloadLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_backup_download_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // bucket - computed: true, optional: false, required: false + public get bucket() { + return this.getStringAttribute('bucket'); + } + + // files - computed: true, optional: false, required: false + private _files = new DataHuaweicloudDdsBackupDownloadLinksFilesList(this, "files", false); + public get files() { + return this._files; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/README.md new file mode 100644 index 00000000..9cbeb68a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_backups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_backups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/index.ts new file mode 100644 index 00000000..d1f4d2ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-backups/index.ts @@ -0,0 +1,636 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsBackupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#backup_id DataHuaweicloudDdsBackups#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#backup_name DataHuaweicloudDdsBackups#backup_name} + */ + readonly backupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#backup_type DataHuaweicloudDdsBackups#backup_type} + */ + readonly backupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#begin_time DataHuaweicloudDdsBackups#begin_time} + */ + readonly beginTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#description DataHuaweicloudDdsBackups#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#end_time DataHuaweicloudDdsBackups#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#id DataHuaweicloudDdsBackups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#instance_id DataHuaweicloudDdsBackups#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#instance_name DataHuaweicloudDdsBackups#instance_name} + */ + readonly instanceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#mode DataHuaweicloudDdsBackups#mode} + */ + readonly mode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#region DataHuaweicloudDdsBackups#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#status DataHuaweicloudDdsBackups#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDdsBackupsBackupsDatastore { +} + +export function dataHuaweicloudDdsBackupsBackupsDatastoreToTerraform(struct?: DataHuaweicloudDdsBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsBackupsBackupsDatastoreToHclTerraform(struct?: DataHuaweicloudDdsBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsBackupsBackupsDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsBackupsBackupsDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsBackupsBackupsDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDdsBackupsBackupsDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsBackupsBackupsDatastoreOutputReference { + return new DataHuaweicloudDdsBackupsBackupsDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsBackupsBackups { +} + +export function dataHuaweicloudDdsBackupsBackupsToTerraform(struct?: DataHuaweicloudDdsBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsBackupsBackupsToHclTerraform(struct?: DataHuaweicloudDdsBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsBackupsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsBackupsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsBackupsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudDdsBackupsBackupsDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDdsBackupsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsBackupsBackupsOutputReference { + return new DataHuaweicloudDdsBackupsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups huaweicloud_dds_backups} +*/ +export class DataHuaweicloudDdsBackups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_backups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsBackups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsBackups to import + * @param importFromId The id of the existing DataHuaweicloudDdsBackups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsBackups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_backups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_backups huaweicloud_dds_backups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsBackupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsBackupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_backups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._backupName = config.backupName; + this._backupType = config.backupType; + this._beginTime = config.beginTime; + this._description = config.description; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._instanceName = config.instanceName; + this._mode = config.mode; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // backup_name - computed: false, optional: true, required: false + private _backupName?: string; + public get backupName() { + return this.getStringAttribute('backup_name'); + } + public set backupName(value: string) { + this._backupName = value; + } + public resetBackupName() { + this._backupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupNameInput() { + return this._backupName; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudDdsBackupsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: false, optional: true, required: false + private _instanceName?: string; + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + public set instanceName(value: string) { + this._instanceName = value; + } + public resetInstanceName() { + this._instanceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNameInput() { + return this._instanceName; + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + backup_name: cdktf.stringToTerraform(this._backupName), + backup_type: cdktf.stringToTerraform(this._backupType), + begin_time: cdktf.stringToTerraform(this._beginTime), + description: cdktf.stringToTerraform(this._description), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_name: cdktf.stringToTerraform(this._instanceName), + mode: cdktf.stringToTerraform(this._mode), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_name: { + value: cdktf.stringToHclTerraform(this._backupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_name: { + value: cdktf.stringToHclTerraform(this._instanceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/README.md new file mode 100644 index 00000000..2d9725c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_database_roles` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_database_roles`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/index.ts new file mode 100644 index 00000000..e7591fe1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-roles/index.ts @@ -0,0 +1,731 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsDatabaseRolesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles#db_name DataHuaweicloudDdsDatabaseRoles#db_name} + */ + readonly dbName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles#id DataHuaweicloudDdsDatabaseRoles#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles#instance_id DataHuaweicloudDdsDatabaseRoles#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles#name DataHuaweicloudDdsDatabaseRoles#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles#region DataHuaweicloudDdsDatabaseRoles#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResources { +} + +export function dataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesToTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesOutputReference { + return new DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivileges { +} + +export function dataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesToTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesOutputReference { + return new DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResources { +} + +export function dataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesToTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesOutputReference { + return new DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseRolesRolesPrivileges { +} + +export function dataHuaweicloudDdsDatabaseRolesRolesPrivilegesToTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseRolesRolesPrivilegesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseRolesRolesPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseRolesRolesPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseRolesRolesPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudDdsDatabaseRolesRolesPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudDdsDatabaseRolesRolesPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseRolesRolesPrivilegesOutputReference { + return new DataHuaweicloudDdsDatabaseRolesRolesPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseRolesRolesRoles { +} + +export function dataHuaweicloudDdsDatabaseRolesRolesRolesToTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesRoles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseRolesRolesRolesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRolesRoles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseRolesRolesRolesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseRolesRolesRoles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseRolesRolesRoles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDdsDatabaseRolesRolesRolesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseRolesRolesRolesOutputReference { + return new DataHuaweicloudDdsDatabaseRolesRolesRolesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseRolesRoles { +} + +export function dataHuaweicloudDdsDatabaseRolesRolesToTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRoles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseRolesRolesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseRolesRoles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseRolesRolesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseRolesRoles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseRolesRoles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } + + // inherited_privileges - computed: true, optional: false, required: false + private _inheritedPrivileges = new DataHuaweicloudDdsDatabaseRolesRolesInheritedPrivilegesList(this, "inherited_privileges", false); + public get inheritedPrivileges() { + return this._inheritedPrivileges; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // privileges - computed: true, optional: false, required: false + private _privileges = new DataHuaweicloudDdsDatabaseRolesRolesPrivilegesList(this, "privileges", false); + public get privileges() { + return this._privileges; + } + + // roles - computed: true, optional: false, required: false + private _roles = new DataHuaweicloudDdsDatabaseRolesRolesRolesList(this, "roles", false); + public get roles() { + return this._roles; + } +} + +export class DataHuaweicloudDdsDatabaseRolesRolesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseRolesRolesOutputReference { + return new DataHuaweicloudDdsDatabaseRolesRolesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles huaweicloud_dds_database_roles} +*/ +export class DataHuaweicloudDdsDatabaseRoles extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_database_roles"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsDatabaseRoles resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsDatabaseRoles to import + * @param importFromId The id of the existing DataHuaweicloudDdsDatabaseRoles that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsDatabaseRoles to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_database_roles", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_roles huaweicloud_dds_database_roles} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsDatabaseRolesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsDatabaseRolesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_database_roles', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: true, required: false + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + public resetDbName() { + this._dbName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roles - computed: true, optional: false, required: false + private _roles = new DataHuaweicloudDdsDatabaseRolesRolesList(this, "roles", false); + public get roles() { + return this._roles; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/README.md new file mode 100644 index 00000000..164019a3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_database_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_database_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/index.ts new file mode 100644 index 00000000..0162304f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-users/index.ts @@ -0,0 +1,731 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsDatabaseUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users#db_name DataHuaweicloudDdsDatabaseUsers#db_name} + */ + readonly dbName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users#id DataHuaweicloudDdsDatabaseUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users#instance_id DataHuaweicloudDdsDatabaseUsers#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users#name DataHuaweicloudDdsDatabaseUsers#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users#region DataHuaweicloudDdsDatabaseUsers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResources { +} + +export function dataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesToTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesOutputReference { + return new DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivileges { +} + +export function dataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesToTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesOutputReference { + return new DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResources { +} + +export function dataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesToTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesOutputReference { + return new DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseUsersUsersPrivileges { +} + +export function dataHuaweicloudDdsDatabaseUsersUsersPrivilegesToTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseUsersUsersPrivilegesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseUsersUsersPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseUsersUsersPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseUsersUsersPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudDdsDatabaseUsersUsersPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudDdsDatabaseUsersUsersPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseUsersUsersPrivilegesOutputReference { + return new DataHuaweicloudDdsDatabaseUsersUsersPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseUsersUsersRoles { +} + +export function dataHuaweicloudDdsDatabaseUsersUsersRolesToTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersRoles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseUsersUsersRolesToHclTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsersRoles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseUsersUsersRolesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseUsersUsersRoles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseUsersUsersRoles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDdsDatabaseUsersUsersRolesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseUsersUsersRolesOutputReference { + return new DataHuaweicloudDdsDatabaseUsersUsersRolesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsDatabaseUsersUsers { +} + +export function dataHuaweicloudDdsDatabaseUsersUsersToTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabaseUsersUsersToHclTerraform(struct?: DataHuaweicloudDdsDatabaseUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabaseUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabaseUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabaseUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } + + // inherited_privileges - computed: true, optional: false, required: false + private _inheritedPrivileges = new DataHuaweicloudDdsDatabaseUsersUsersInheritedPrivilegesList(this, "inherited_privileges", false); + public get inheritedPrivileges() { + return this._inheritedPrivileges; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // privileges - computed: true, optional: false, required: false + private _privileges = new DataHuaweicloudDdsDatabaseUsersUsersPrivilegesList(this, "privileges", false); + public get privileges() { + return this._privileges; + } + + // roles - computed: true, optional: false, required: false + private _roles = new DataHuaweicloudDdsDatabaseUsersUsersRolesList(this, "roles", false); + public get roles() { + return this._roles; + } +} + +export class DataHuaweicloudDdsDatabaseUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabaseUsersUsersOutputReference { + return new DataHuaweicloudDdsDatabaseUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users huaweicloud_dds_database_users} +*/ +export class DataHuaweicloudDdsDatabaseUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_database_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsDatabaseUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsDatabaseUsers to import + * @param importFromId The id of the existing DataHuaweicloudDdsDatabaseUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsDatabaseUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_database_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_users huaweicloud_dds_database_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsDatabaseUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsDatabaseUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_database_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: true, required: false + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + public resetDbName() { + this._dbName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudDdsDatabaseUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/README.md new file mode 100644 index 00000000..8960bf8d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_database_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_database_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/index.ts new file mode 100644 index 00000000..1d64147b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-database-versions/index.ts @@ -0,0 +1,178 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsDatabaseVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions#datastore_name DataHuaweicloudDdsDatabaseVersions#datastore_name} + */ + readonly datastoreName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions#id DataHuaweicloudDdsDatabaseVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions#region DataHuaweicloudDdsDatabaseVersions#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions huaweicloud_dds_database_versions} +*/ +export class DataHuaweicloudDdsDatabaseVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_database_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsDatabaseVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsDatabaseVersions to import + * @param importFromId The id of the existing DataHuaweicloudDdsDatabaseVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsDatabaseVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_database_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_database_versions huaweicloud_dds_database_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsDatabaseVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsDatabaseVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_database_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datastoreName = config.datastoreName; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // datastore_name - computed: false, optional: false, required: true + private _datastoreName?: string; + public get datastoreName() { + return this.getStringAttribute('datastore_name'); + } + public set datastoreName(value: string) { + this._datastoreName = value; + } + // Temporarily expose input value. Use with caution. + public get datastoreNameInput() { + return this._datastoreName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datastore_name: cdktf.stringToTerraform(this._datastoreName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datastore_name: { + value: cdktf.stringToHclTerraform(this._datastoreName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/README.md new file mode 100644 index 00000000..79b5c279 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/index.ts new file mode 100644 index 00000000..4ae88543 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-databases/index.ts @@ -0,0 +1,269 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases#id DataHuaweicloudDdsDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases#instance_id DataHuaweicloudDdsDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases#region DataHuaweicloudDdsDatabases#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsDatabasesDatabases { +} + +export function dataHuaweicloudDdsDatabasesDatabasesToTerraform(struct?: DataHuaweicloudDdsDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudDdsDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection_num - computed: true, optional: false, required: false + public get collectionNum() { + return this.getNumberAttribute('collection_num'); + } + + // data_size - computed: true, optional: false, required: false + public get dataSize() { + return this.getStringAttribute('data_size'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // storage_size - computed: true, optional: false, required: false + public get storageSize() { + return this.getStringAttribute('storage_size'); + } +} + +export class DataHuaweicloudDdsDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsDatabasesDatabasesOutputReference { + return new DataHuaweicloudDdsDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases huaweicloud_dds_databases} +*/ +export class DataHuaweicloudDdsDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsDatabases to import + * @param importFromId The id of the existing DataHuaweicloudDdsDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_databases huaweicloud_dds_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudDdsDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/README.md new file mode 100644 index 00000000..71862d99 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_error_log_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_error_log_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/index.ts new file mode 100644 index 00000000..2c4f17a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-log-links/index.ts @@ -0,0 +1,461 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsErrorLogLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the names of the files. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#file_name_list DataHuaweicloudDdsErrorLogLinks#file_name_list} + */ + readonly fileNameList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#id DataHuaweicloudDdsErrorLogLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#instance_id DataHuaweicloudDdsErrorLogLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the node IDs to which the files belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#node_id_list DataHuaweicloudDdsErrorLogLinks#node_id_list} + */ + readonly nodeIdList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#region DataHuaweicloudDdsErrorLogLinks#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#timeouts DataHuaweicloudDdsErrorLogLinks#timeouts} + */ + readonly timeouts?: DataHuaweicloudDdsErrorLogLinksTimeouts; +} +export interface DataHuaweicloudDdsErrorLogLinksLinks { +} + +export function dataHuaweicloudDdsErrorLogLinksLinksToTerraform(struct?: DataHuaweicloudDdsErrorLogLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsErrorLogLinksLinksToHclTerraform(struct?: DataHuaweicloudDdsErrorLogLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsErrorLogLinksLinksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsErrorLogLinksLinks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsErrorLogLinksLinks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_link - computed: true, optional: false, required: false + public get fileLink() { + return this.getStringAttribute('file_link'); + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } + + // node_name - computed: true, optional: false, required: false + public get nodeName() { + return this.getStringAttribute('node_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDdsErrorLogLinksLinksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsErrorLogLinksLinksOutputReference { + return new DataHuaweicloudDdsErrorLogLinksLinksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsErrorLogLinksTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#read DataHuaweicloudDdsErrorLogLinks#read} + */ + readonly read?: string; +} + +export function dataHuaweicloudDdsErrorLogLinksTimeoutsToTerraform(struct?: DataHuaweicloudDdsErrorLogLinksTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + read: cdktf.stringToTerraform(struct!.read), + } +} + + +export function dataHuaweicloudDdsErrorLogLinksTimeoutsToHclTerraform(struct?: DataHuaweicloudDdsErrorLogLinksTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + read: { + value: cdktf.stringToHclTerraform(struct!.read), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudDdsErrorLogLinksTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataHuaweicloudDdsErrorLogLinksTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._read !== undefined) { + hasAnyValues = true; + internalValueResult.read = this._read; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsErrorLogLinksTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._read = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._read = value.read; + } + } + + // read - computed: false, optional: true, required: false + private _read?: string; + public get read() { + return this.getStringAttribute('read'); + } + public set read(value: string) { + this._read = value; + } + public resetRead() { + this._read = undefined; + } + // Temporarily expose input value. Use with caution. + public get readInput() { + return this._read; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links huaweicloud_dds_error_log_links} +*/ +export class DataHuaweicloudDdsErrorLogLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_error_log_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsErrorLogLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsErrorLogLinks to import + * @param importFromId The id of the existing DataHuaweicloudDdsErrorLogLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsErrorLogLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_error_log_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_log_links huaweicloud_dds_error_log_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsErrorLogLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsErrorLogLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_error_log_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fileNameList = config.fileNameList; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeIdList = config.nodeIdList; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // file_name_list - computed: false, optional: true, required: false + private _fileNameList?: string[]; + public get fileNameList() { + return this.getListAttribute('file_name_list'); + } + public set fileNameList(value: string[]) { + this._fileNameList = value; + } + public resetFileNameList() { + this._fileNameList = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNameListInput() { + return this._fileNameList; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // links - computed: true, optional: false, required: false + private _links = new DataHuaweicloudDdsErrorLogLinksLinksList(this, "links", false); + public get links() { + return this._links; + } + + // node_id_list - computed: false, optional: true, required: false + private _nodeIdList?: string[]; + public get nodeIdList() { + return this.getListAttribute('node_id_list'); + } + public set nodeIdList(value: string[]) { + this._nodeIdList = value; + } + public resetNodeIdList() { + this._nodeIdList = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdListInput() { + return this._nodeIdList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataHuaweicloudDdsErrorLogLinksTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataHuaweicloudDdsErrorLogLinksTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + file_name_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._fileNameList), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._nodeIdList), + region: cdktf.stringToTerraform(this._region), + timeouts: dataHuaweicloudDdsErrorLogLinksTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + file_name_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._fileNameList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._nodeIdList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataHuaweicloudDdsErrorLogLinksTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataHuaweicloudDdsErrorLogLinksTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/README.md new file mode 100644 index 00000000..e801982c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_error_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_error_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/index.ts new file mode 100644 index 00000000..d78dee9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-error-logs/index.ts @@ -0,0 +1,418 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsErrorLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#end_time DataHuaweicloudDdsErrorLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#id DataHuaweicloudDdsErrorLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#instance_id DataHuaweicloudDdsErrorLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the full-text log search based on multiple keywords, indicating that all keywords are matched. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#keywords DataHuaweicloudDdsErrorLogs#keywords} + */ + readonly keywords?: string[]; + /** + * Specifies the node ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#node_id DataHuaweicloudDdsErrorLogs#node_id} + */ + readonly nodeId?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#region DataHuaweicloudDdsErrorLogs#region} + */ + readonly region?: string; + /** + * Specifies the log level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#severity DataHuaweicloudDdsErrorLogs#severity} + */ + readonly severity?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#start_time DataHuaweicloudDdsErrorLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudDdsErrorLogsErrorLogs { +} + +export function dataHuaweicloudDdsErrorLogsErrorLogsToTerraform(struct?: DataHuaweicloudDdsErrorLogsErrorLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsErrorLogsErrorLogsToHclTerraform(struct?: DataHuaweicloudDdsErrorLogsErrorLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsErrorLogsErrorLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsErrorLogsErrorLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsErrorLogsErrorLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // log_time - computed: true, optional: false, required: false + public get logTime() { + return this.getStringAttribute('log_time'); + } + + // node_id - computed: true, optional: false, required: false + public get nodeId() { + return this.getStringAttribute('node_id'); + } + + // node_name - computed: true, optional: false, required: false + public get nodeName() { + return this.getStringAttribute('node_name'); + } + + // raw_message - computed: true, optional: false, required: false + public get rawMessage() { + return this.getStringAttribute('raw_message'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } +} + +export class DataHuaweicloudDdsErrorLogsErrorLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsErrorLogsErrorLogsOutputReference { + return new DataHuaweicloudDdsErrorLogsErrorLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs huaweicloud_dds_error_logs} +*/ +export class DataHuaweicloudDdsErrorLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_error_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsErrorLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsErrorLogs to import + * @param importFromId The id of the existing DataHuaweicloudDdsErrorLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsErrorLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_error_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_error_logs huaweicloud_dds_error_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsErrorLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsErrorLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_error_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._keywords = config.keywords; + this._nodeId = config.nodeId; + this._region = config.region; + this._severity = config.severity; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // error_logs - computed: true, optional: false, required: false + private _errorLogs = new DataHuaweicloudDdsErrorLogsErrorLogsList(this, "error_logs", false); + public get errorLogs() { + return this._errorLogs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keywords - computed: false, optional: true, required: false + private _keywords?: string[]; + public get keywords() { + return this.getListAttribute('keywords'); + } + public set keywords(value: string[]) { + this._keywords = value; + } + public resetKeywords() { + this._keywords = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordsInput() { + return this._keywords; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // severity - computed: false, optional: true, required: false + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + public resetSeverity() { + this._severity = undefined; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keywords: cdktf.listMapper(cdktf.stringToTerraform, false)(this._keywords), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + severity: cdktf.stringToTerraform(this._severity), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keywords: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._keywords), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(this._severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/README.md new file mode 100644 index 00000000..c8dbfb56 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_flavors_v3` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_flavors_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/index.ts new file mode 100644 index 00000000..21f2fbcf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors-v3/index.ts @@ -0,0 +1,393 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsFlavorsV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#engine_name DataHuaweicloudDdsFlavorsV3#engine_name} + */ + readonly engineName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#engine_version DataHuaweicloudDdsFlavorsV3#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#id DataHuaweicloudDdsFlavorsV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#memory DataHuaweicloudDdsFlavorsV3#memory} + */ + readonly memory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#region DataHuaweicloudDdsFlavorsV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#type DataHuaweicloudDdsFlavorsV3#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#vcpus DataHuaweicloudDdsFlavorsV3#vcpus} + */ + readonly vcpus?: string; +} +export interface DataHuaweicloudDdsFlavorsV3Flavors { +} + +export function dataHuaweicloudDdsFlavorsV3FlavorsToTerraform(struct?: DataHuaweicloudDdsFlavorsV3Flavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsFlavorsV3FlavorsToHclTerraform(struct?: DataHuaweicloudDdsFlavorsV3Flavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsFlavorsV3FlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsFlavorsV3Flavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsFlavorsV3Flavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // engine_name - computed: true, optional: false, required: false + public get engineName() { + return this.getStringAttribute('engine_name'); + } + + // engine_versions - computed: true, optional: false, required: false + public get engineVersions() { + return this.getListAttribute('engine_versions'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudDdsFlavorsV3FlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsFlavorsV3FlavorsOutputReference { + return new DataHuaweicloudDdsFlavorsV3FlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3 huaweicloud_dds_flavors_v3} +*/ +export class DataHuaweicloudDdsFlavorsV3 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_flavors_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsFlavorsV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsFlavorsV3 to import + * @param importFromId The id of the existing DataHuaweicloudDdsFlavorsV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsFlavorsV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_flavors_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors_v3 huaweicloud_dds_flavors_v3} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsFlavorsV3Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsFlavorsV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_flavors_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engineName = config.engineName; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._type = config.type; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine_name - computed: false, optional: false, required: true + private _engineName?: string; + public get engineName() { + return this.getStringAttribute('engine_name'); + } + public set engineName(value: string) { + this._engineName = value; + } + // Temporarily expose input value. Use with caution. + public get engineNameInput() { + return this._engineName; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDdsFlavorsV3FlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: string; + public get memory() { + return this.getStringAttribute('memory'); + } + public set memory(value: string) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: string; + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + public set vcpus(value: string) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine_name: cdktf.stringToTerraform(this._engineName), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.stringToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vcpus: cdktf.stringToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine_name: { + value: cdktf.stringToHclTerraform(this._engineName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.stringToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.stringToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/README.md new file mode 100644 index 00000000..eb530bcc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/index.ts new file mode 100644 index 00000000..422c5dbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-flavors/index.ts @@ -0,0 +1,393 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#engine_name DataHuaweicloudDdsFlavors#engine_name} + */ + readonly engineName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#engine_version DataHuaweicloudDdsFlavors#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#id DataHuaweicloudDdsFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#memory DataHuaweicloudDdsFlavors#memory} + */ + readonly memory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#region DataHuaweicloudDdsFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#type DataHuaweicloudDdsFlavors#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#vcpus DataHuaweicloudDdsFlavors#vcpus} + */ + readonly vcpus?: string; +} +export interface DataHuaweicloudDdsFlavorsFlavors { +} + +export function dataHuaweicloudDdsFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDdsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDdsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // engine_name - computed: true, optional: false, required: false + public get engineName() { + return this.getStringAttribute('engine_name'); + } + + // engine_versions - computed: true, optional: false, required: false + public get engineVersions() { + return this.getListAttribute('engine_versions'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudDdsFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsFlavorsFlavorsOutputReference { + return new DataHuaweicloudDdsFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors huaweicloud_dds_flavors} +*/ +export class DataHuaweicloudDdsFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDdsFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_flavors huaweicloud_dds_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engineName = config.engineName; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._type = config.type; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine_name - computed: false, optional: false, required: true + private _engineName?: string; + public get engineName() { + return this.getStringAttribute('engine_name'); + } + public set engineName(value: string) { + this._engineName = value; + } + // Temporarily expose input value. Use with caution. + public get engineNameInput() { + return this._engineName; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDdsFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: string; + public get memory() { + return this.getStringAttribute('memory'); + } + public set memory(value: string) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: string; + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + public set vcpus(value: string) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine_name: cdktf.stringToTerraform(this._engineName), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.stringToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vcpus: cdktf.stringToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine_name: { + value: cdktf.stringToHclTerraform(this._engineName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.stringToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.stringToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/README.md new file mode 100644 index 00000000..774e36fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/index.ts new file mode 100644 index 00000000..1e8f8e54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instances/index.ts @@ -0,0 +1,911 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#id DataHuaweicloudDdsInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the mode of the database instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#mode DataHuaweicloudDdsInstances#mode} + */ + readonly mode?: string; + /** + * Specifies the DB instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#name DataHuaweicloudDdsInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#region DataHuaweicloudDdsInstances#region} + */ + readonly region?: string; + /** + * Specifies the subnet Network ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#subnet_id DataHuaweicloudDdsInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Specifies the VPC ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#vpc_id DataHuaweicloudDdsInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudDdsInstancesInstancesBackupStrategy { +} + +export function dataHuaweicloudDdsInstancesInstancesBackupStrategyToTerraform(struct?: DataHuaweicloudDdsInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstancesInstancesBackupStrategyToHclTerraform(struct?: DataHuaweicloudDdsInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstancesInstancesBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstancesInstancesBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstancesInstancesBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudDdsInstancesInstancesBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstancesInstancesBackupStrategyOutputReference { + return new DataHuaweicloudDdsInstancesInstancesBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsInstancesInstancesDatastore { +} + +export function dataHuaweicloudDdsInstancesInstancesDatastoreToTerraform(struct?: DataHuaweicloudDdsInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstancesInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudDdsInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstancesInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstancesInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstancesInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // storage_engine - computed: true, optional: false, required: false + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDdsInstancesInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstancesInstancesDatastoreOutputReference { + return new DataHuaweicloudDdsInstancesInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsInstancesInstancesGroupsNodes { +} + +export function dataHuaweicloudDdsInstancesInstancesGroupsNodesToTerraform(struct?: DataHuaweicloudDdsInstancesInstancesGroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstancesInstancesGroupsNodesToHclTerraform(struct?: DataHuaweicloudDdsInstancesInstancesGroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstancesInstancesGroupsNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstancesInstancesGroupsNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstancesInstancesGroupsNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDdsInstancesInstancesGroupsNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstancesInstancesGroupsNodesOutputReference { + return new DataHuaweicloudDdsInstancesInstancesGroupsNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsInstancesInstancesGroups { +} + +export function dataHuaweicloudDdsInstancesInstancesGroupsToTerraform(struct?: DataHuaweicloudDdsInstancesInstancesGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstancesInstancesGroupsToHclTerraform(struct?: DataHuaweicloudDdsInstancesInstancesGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstancesInstancesGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstancesInstancesGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstancesInstancesGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudDdsInstancesInstancesGroupsNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getStringAttribute('used'); + } +} + +export class DataHuaweicloudDdsInstancesInstancesGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstancesInstancesGroupsOutputReference { + return new DataHuaweicloudDdsInstancesInstancesGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsInstancesInstancesNodes { +} + +export function dataHuaweicloudDdsInstancesInstancesNodesToTerraform(struct?: DataHuaweicloudDdsInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstancesInstancesNodesToHclTerraform(struct?: DataHuaweicloudDdsInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstancesInstancesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstancesInstancesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstancesInstancesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDdsInstancesInstancesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstancesInstancesNodesOutputReference { + return new DataHuaweicloudDdsInstancesInstancesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsInstancesInstances { +} + +export function dataHuaweicloudDdsInstancesInstancesToTerraform(struct?: DataHuaweicloudDdsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDdsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudDdsInstancesInstancesBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudDdsInstancesInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_username - computed: true, optional: false, required: false + public get dbUsername() { + return this.getStringAttribute('db_username'); + } + + // disk_encryption_id - computed: true, optional: false, required: false + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudDdsInstancesInstancesGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudDdsInstancesInstancesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // ssl - computed: true, optional: false, required: false + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDdsInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstancesInstancesOutputReference { + return new DataHuaweicloudDdsInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances huaweicloud_dds_instances} +*/ +export class DataHuaweicloudDdsInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsInstances to import + * @param importFromId The id of the existing DataHuaweicloudDdsInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instances huaweicloud_dds_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._mode = config.mode; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDdsInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + mode: cdktf.stringToTerraform(this._mode), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/README.md new file mode 100644 index 00000000..d45f3381 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_instant_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_instant_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/index.ts new file mode 100644 index 00000000..93cc09d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-instant-tasks/index.ts @@ -0,0 +1,381 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsInstantTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time. The format of the end time is **yyyy-mm-ddThh:mm:ssZ** + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#end_time DataHuaweicloudDdsInstantTasks#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#id DataHuaweicloudDdsInstantTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the task name. The value can be: + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#name DataHuaweicloudDdsInstantTasks#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#region DataHuaweicloudDdsInstantTasks#region} + */ + readonly region?: string; + /** + * Specifies the start time. The format of the start time is **yyyy-mm-ddThh:mm:ssZ**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#start_time DataHuaweicloudDdsInstantTasks#start_time} + */ + readonly startTime: string; + /** + * Specifies the task status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#status DataHuaweicloudDdsInstantTasks#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDdsInstantTasksJobs { +} + +export function dataHuaweicloudDdsInstantTasksJobsToTerraform(struct?: DataHuaweicloudDdsInstantTasksJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsInstantTasksJobsToHclTerraform(struct?: DataHuaweicloudDdsInstantTasksJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsInstantTasksJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsInstantTasksJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsInstantTasksJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // ended_at - computed: true, optional: false, required: false + public get endedAt() { + return this.getStringAttribute('ended_at'); + } + + // fail_reason - computed: true, optional: false, required: false + public get failReason() { + return this.getStringAttribute('fail_reason'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getStringAttribute('progress'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDdsInstantTasksJobsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsInstantTasksJobsOutputReference { + return new DataHuaweicloudDdsInstantTasksJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks huaweicloud_dds_instant_tasks} +*/ +export class DataHuaweicloudDdsInstantTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instant_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsInstantTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsInstantTasks to import + * @param importFromId The id of the existing DataHuaweicloudDdsInstantTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsInstantTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instant_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_instant_tasks huaweicloud_dds_instant_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsInstantTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsInstantTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instant_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._startTime = config.startTime; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // jobs - computed: true, optional: false, required: false + private _jobs = new DataHuaweicloudDdsInstantTasksJobsList(this, "jobs", false); + public get jobs() { + return this._jobs; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/README.md new file mode 100644 index 00000000..4ae59bc7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_migrate_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_migrate_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/index.ts new file mode 100644 index 00000000..220615c0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-migrate-availability-zones/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsMigrateAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones#id DataHuaweicloudDdsMigrateAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones#instance_id DataHuaweicloudDdsMigrateAvailabilityZones#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones#region DataHuaweicloudDdsMigrateAvailabilityZones#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones huaweicloud_dds_migrate_availability_zones} +*/ +export class DataHuaweicloudDdsMigrateAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_migrate_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsMigrateAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsMigrateAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudDdsMigrateAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsMigrateAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_migrate_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_migrate_availability_zones huaweicloud_dds_migrate_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsMigrateAvailabilityZonesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsMigrateAvailabilityZonesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_migrate_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // names - computed: true, optional: false, required: false + public get names() { + return this.getListAttribute('names'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/README.md new file mode 100644 index 00000000..3caac4be --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_parameter_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_parameter_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/index.ts new file mode 100644 index 00000000..8aedffd9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-parameter-templates/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsParameterTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database (DB Engine) version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates#datastore_version DataHuaweicloudDdsParameterTemplates#datastore_version} + */ + readonly datastoreVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates#id DataHuaweicloudDdsParameterTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the parameter template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates#name DataHuaweicloudDdsParameterTemplates#name} + */ + readonly name?: string; + /** + * The the node type of parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates#node_type DataHuaweicloudDdsParameterTemplates#node_type} + */ + readonly nodeType?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates#region DataHuaweicloudDdsParameterTemplates#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsParameterTemplatesConfigurations { +} + +export function dataHuaweicloudDdsParameterTemplatesConfigurationsToTerraform(struct?: DataHuaweicloudDdsParameterTemplatesConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsParameterTemplatesConfigurationsToHclTerraform(struct?: DataHuaweicloudDdsParameterTemplatesConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsParameterTemplatesConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsParameterTemplatesConfigurations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsParameterTemplatesConfigurations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore_name - computed: true, optional: false, required: false + public get datastoreName() { + return this.getStringAttribute('datastore_name'); + } + + // datastore_version - computed: true, optional: false, required: false + public get datastoreVersion() { + return this.getStringAttribute('datastore_version'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_type - computed: true, optional: false, required: false + public get nodeType() { + return this.getStringAttribute('node_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_defined - computed: true, optional: false, required: false + public get userDefined() { + return this.getBooleanAttribute('user_defined'); + } +} + +export class DataHuaweicloudDdsParameterTemplatesConfigurationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsParameterTemplatesConfigurationsOutputReference { + return new DataHuaweicloudDdsParameterTemplatesConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates huaweicloud_dds_parameter_templates} +*/ +export class DataHuaweicloudDdsParameterTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_parameter_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsParameterTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsParameterTemplates to import + * @param importFromId The id of the existing DataHuaweicloudDdsParameterTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsParameterTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_parameter_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_parameter_templates huaweicloud_dds_parameter_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsParameterTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsParameterTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_parameter_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datastoreVersion = config.datastoreVersion; + this._id = config.id; + this._name = config.name; + this._nodeType = config.nodeType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configurations - computed: true, optional: false, required: false + private _configurations = new DataHuaweicloudDdsParameterTemplatesConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + + // datastore_version - computed: false, optional: true, required: false + private _datastoreVersion?: string; + public get datastoreVersion() { + return this.getStringAttribute('datastore_version'); + } + public set datastoreVersion(value: string) { + this._datastoreVersion = value; + } + public resetDatastoreVersion() { + this._datastoreVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreVersionInput() { + return this._datastoreVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_type - computed: false, optional: true, required: false + private _nodeType?: string; + public get nodeType() { + return this.getStringAttribute('node_type'); + } + public set nodeType(value: string) { + this._nodeType = value; + } + public resetNodeType() { + this._nodeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeTypeInput() { + return this._nodeType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datastore_version: cdktf.stringToTerraform(this._datastoreVersion), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_type: cdktf.stringToTerraform(this._nodeType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datastore_version: { + value: cdktf.stringToHclTerraform(this._datastoreVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_type: { + value: cdktf.stringToHclTerraform(this._nodeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/README.md new file mode 100644 index 00000000..c38d9e40 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_pt_applicable_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_pt_applicable_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/index.ts new file mode 100644 index 00000000..f027690a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-applicable-instances/index.ts @@ -0,0 +1,345 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsPtApplicableInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances#configuration_id DataHuaweicloudDdsPtApplicableInstances#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances#id DataHuaweicloudDdsPtApplicableInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances#region DataHuaweicloudDdsPtApplicableInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsPtApplicableInstancesInstancesEntities { +} + +export function dataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesToTerraform(struct?: DataHuaweicloudDdsPtApplicableInstancesInstancesEntities): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesToHclTerraform(struct?: DataHuaweicloudDdsPtApplicableInstancesInstancesEntities): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsPtApplicableInstancesInstancesEntities | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsPtApplicableInstancesInstancesEntities | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // entity_id - computed: true, optional: false, required: false + public get entityId() { + return this.getStringAttribute('entity_id'); + } + + // entity_name - computed: true, optional: false, required: false + public get entityName() { + return this.getStringAttribute('entity_name'); + } +} + +export class DataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesOutputReference { + return new DataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsPtApplicableInstancesInstances { +} + +export function dataHuaweicloudDdsPtApplicableInstancesInstancesToTerraform(struct?: DataHuaweicloudDdsPtApplicableInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsPtApplicableInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDdsPtApplicableInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsPtApplicableInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsPtApplicableInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsPtApplicableInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // entities - computed: true, optional: false, required: false + private _entities = new DataHuaweicloudDdsPtApplicableInstancesInstancesEntitiesList(this, "entities", false); + public get entities() { + return this._entities; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } +} + +export class DataHuaweicloudDdsPtApplicableInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsPtApplicableInstancesInstancesOutputReference { + return new DataHuaweicloudDdsPtApplicableInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances huaweicloud_dds_pt_applicable_instances} +*/ +export class DataHuaweicloudDdsPtApplicableInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_pt_applicable_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsPtApplicableInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsPtApplicableInstances to import + * @param importFromId The id of the existing DataHuaweicloudDdsPtApplicableInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsPtApplicableInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_pt_applicable_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_applicable_instances huaweicloud_dds_pt_applicable_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsPtApplicableInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsPtApplicableInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_pt_applicable_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDdsPtApplicableInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/README.md new file mode 100644 index 00000000..1be45b4e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_pt_application_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_pt_application_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/index.ts new file mode 100644 index 00000000..cca51d92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-application-records/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsPtApplicationRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records#configuration_id DataHuaweicloudDdsPtApplicationRecords#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records#id DataHuaweicloudDdsPtApplicationRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records#region DataHuaweicloudDdsPtApplicationRecords#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsPtApplicationRecordsHistories { +} + +export function dataHuaweicloudDdsPtApplicationRecordsHistoriesToTerraform(struct?: DataHuaweicloudDdsPtApplicationRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsPtApplicationRecordsHistoriesToHclTerraform(struct?: DataHuaweicloudDdsPtApplicationRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsPtApplicationRecordsHistoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsPtApplicationRecordsHistories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsPtApplicationRecordsHistories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // applied_at - computed: true, optional: false, required: false + public get appliedAt() { + return this.getStringAttribute('applied_at'); + } + + // apply_result - computed: true, optional: false, required: false + public get applyResult() { + return this.getStringAttribute('apply_result'); + } + + // failure_reason - computed: true, optional: false, required: false + public get failureReason() { + return this.getStringAttribute('failure_reason'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } +} + +export class DataHuaweicloudDdsPtApplicationRecordsHistoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsPtApplicationRecordsHistoriesOutputReference { + return new DataHuaweicloudDdsPtApplicationRecordsHistoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records huaweicloud_dds_pt_application_records} +*/ +export class DataHuaweicloudDdsPtApplicationRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_pt_application_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsPtApplicationRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsPtApplicationRecords to import + * @param importFromId The id of the existing DataHuaweicloudDdsPtApplicationRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsPtApplicationRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_pt_application_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_application_records huaweicloud_dds_pt_application_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsPtApplicationRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsPtApplicationRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_pt_application_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // histories - computed: true, optional: false, required: false + private _histories = new DataHuaweicloudDdsPtApplicationRecordsHistoriesList(this, "histories", false); + public get histories() { + return this._histories; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/README.md new file mode 100644 index 00000000..995353aa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_pt_modification_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_pt_modification_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/index.ts new file mode 100644 index 00000000..ad69789f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-pt-modification-records/index.ts @@ -0,0 +1,269 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsPtModificationRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records#configuration_id DataHuaweicloudDdsPtModificationRecords#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records#id DataHuaweicloudDdsPtModificationRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records#region DataHuaweicloudDdsPtModificationRecords#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsPtModificationRecordsHistories { +} + +export function dataHuaweicloudDdsPtModificationRecordsHistoriesToTerraform(struct?: DataHuaweicloudDdsPtModificationRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsPtModificationRecordsHistoriesToHclTerraform(struct?: DataHuaweicloudDdsPtModificationRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsPtModificationRecordsHistoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsPtModificationRecordsHistories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsPtModificationRecordsHistories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // new_value - computed: true, optional: false, required: false + public get newValue() { + return this.getStringAttribute('new_value'); + } + + // old_value - computed: true, optional: false, required: false + public get oldValue() { + return this.getStringAttribute('old_value'); + } + + // parameter_name - computed: true, optional: false, required: false + public get parameterName() { + return this.getStringAttribute('parameter_name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDdsPtModificationRecordsHistoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsPtModificationRecordsHistoriesOutputReference { + return new DataHuaweicloudDdsPtModificationRecordsHistoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records huaweicloud_dds_pt_modification_records} +*/ +export class DataHuaweicloudDdsPtModificationRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_pt_modification_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsPtModificationRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsPtModificationRecords to import + * @param importFromId The id of the existing DataHuaweicloudDdsPtModificationRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsPtModificationRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_pt_modification_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_pt_modification_records huaweicloud_dds_pt_modification_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsPtModificationRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsPtModificationRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_pt_modification_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // histories - computed: true, optional: false, required: false + private _histories = new DataHuaweicloudDdsPtModificationRecordsHistoriesList(this, "histories", false); + public get histories() { + return this._histories; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/README.md new file mode 100644 index 00000000..e62c14f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/index.ts new file mode 100644 index 00000000..66e8e9ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-quotas/index.ts @@ -0,0 +1,242 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas#id DataHuaweicloudDdsQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas#region DataHuaweicloudDdsQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsQuotasQuotas { +} + +export function dataHuaweicloudDdsQuotasQuotasToTerraform(struct?: DataHuaweicloudDdsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsQuotasQuotasToHclTerraform(struct?: DataHuaweicloudDdsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudDdsQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsQuotasQuotasOutputReference { + return new DataHuaweicloudDdsQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas huaweicloud_dds_quotas} +*/ +export class DataHuaweicloudDdsQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsQuotas to import + * @param importFromId The id of the existing DataHuaweicloudDdsQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_quotas huaweicloud_dds_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudDdsQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/README.md new file mode 100644 index 00000000..315b416f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_recycle_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_recycle_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/index.ts new file mode 100644 index 00000000..17903a90 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-recycle-instances/index.ts @@ -0,0 +1,353 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsRecycleInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances#id DataHuaweicloudDdsRecycleInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances#region DataHuaweicloudDdsRecycleInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsRecycleInstancesInstancesDatastore { +} + +export function dataHuaweicloudDdsRecycleInstancesInstancesDatastoreToTerraform(struct?: DataHuaweicloudDdsRecycleInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsRecycleInstancesInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudDdsRecycleInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsRecycleInstancesInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsRecycleInstancesInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsRecycleInstancesInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDdsRecycleInstancesInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsRecycleInstancesInstancesDatastoreOutputReference { + return new DataHuaweicloudDdsRecycleInstancesInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsRecycleInstancesInstances { +} + +export function dataHuaweicloudDdsRecycleInstancesInstancesToTerraform(struct?: DataHuaweicloudDdsRecycleInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsRecycleInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDdsRecycleInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsRecycleInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsRecycleInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsRecycleInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backup_id - computed: true, optional: false, required: false + public get backupId() { + return this.getStringAttribute('backup_id'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudDdsRecycleInstancesInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getStringAttribute('deleted_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // retained_until - computed: true, optional: false, required: false + public get retainedUntil() { + return this.getStringAttribute('retained_until'); + } +} + +export class DataHuaweicloudDdsRecycleInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsRecycleInstancesInstancesOutputReference { + return new DataHuaweicloudDdsRecycleInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances huaweicloud_dds_recycle_instances} +*/ +export class DataHuaweicloudDdsRecycleInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_recycle_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsRecycleInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsRecycleInstances to import + * @param importFromId The id of the existing DataHuaweicloudDdsRecycleInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsRecycleInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_recycle_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_recycle_instances huaweicloud_dds_recycle_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsRecycleInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsRecycleInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_recycle_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDdsRecycleInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/README.md new file mode 100644 index 00000000..290fc6fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_restore_collections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_restore_collections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/index.ts new file mode 100644 index 00000000..92aad4c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-collections/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsRestoreCollectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections#db_name DataHuaweicloudDdsRestoreCollections#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections#id DataHuaweicloudDdsRestoreCollections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections#instance_id DataHuaweicloudDdsRestoreCollections#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections#region DataHuaweicloudDdsRestoreCollections#region} + */ + readonly region?: string; + /** + * Specifies the restoration time point. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections#restore_time DataHuaweicloudDdsRestoreCollections#restore_time} + */ + readonly restoreTime: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections huaweicloud_dds_restore_collections} +*/ +export class DataHuaweicloudDdsRestoreCollections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_restore_collections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsRestoreCollections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsRestoreCollections to import + * @param importFromId The id of the existing DataHuaweicloudDdsRestoreCollections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsRestoreCollections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_restore_collections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_collections huaweicloud_dds_restore_collections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsRestoreCollectionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsRestoreCollectionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_restore_collections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._restoreTime = config.restoreTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // collections - computed: true, optional: false, required: false + public get collections() { + return this.getListAttribute('collections'); + } + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/README.md new file mode 100644 index 00000000..d1155a1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_restore_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_restore_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/index.ts new file mode 100644 index 00000000..29c4683e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-databases/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsRestoreDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases#id DataHuaweicloudDdsRestoreDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases#instance_id DataHuaweicloudDdsRestoreDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases#region DataHuaweicloudDdsRestoreDatabases#region} + */ + readonly region?: string; + /** + * Specifies the restoration time point. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases#restore_time DataHuaweicloudDdsRestoreDatabases#restore_time} + */ + readonly restoreTime: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases huaweicloud_dds_restore_databases} +*/ +export class DataHuaweicloudDdsRestoreDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_restore_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsRestoreDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsRestoreDatabases to import + * @param importFromId The id of the existing DataHuaweicloudDdsRestoreDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsRestoreDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_restore_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_databases huaweicloud_dds_restore_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsRestoreDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsRestoreDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_restore_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._restoreTime = config.restoreTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // databases - computed: true, optional: false, required: false + public get databases() { + return this.getListAttribute('databases'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/README.md new file mode 100644 index 00000000..ab52936a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_restore_time_ranges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_restore_time_ranges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/index.ts new file mode 100644 index 00000000..489ed92b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-restore-time-ranges/index.ts @@ -0,0 +1,286 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsRestoreTimeRangesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the date to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges#date DataHuaweicloudDdsRestoreTimeRanges#date} + */ + readonly date: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges#id DataHuaweicloudDdsRestoreTimeRanges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges#instance_id DataHuaweicloudDdsRestoreTimeRanges#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges#region DataHuaweicloudDdsRestoreTimeRanges#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsRestoreTimeRangesRestoreTimes { +} + +export function dataHuaweicloudDdsRestoreTimeRangesRestoreTimesToTerraform(struct?: DataHuaweicloudDdsRestoreTimeRangesRestoreTimes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsRestoreTimeRangesRestoreTimesToHclTerraform(struct?: DataHuaweicloudDdsRestoreTimeRangesRestoreTimes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsRestoreTimeRangesRestoreTimesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsRestoreTimeRangesRestoreTimes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsRestoreTimeRangesRestoreTimes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getNumberAttribute('end_time'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getNumberAttribute('start_time'); + } +} + +export class DataHuaweicloudDdsRestoreTimeRangesRestoreTimesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsRestoreTimeRangesRestoreTimesOutputReference { + return new DataHuaweicloudDdsRestoreTimeRangesRestoreTimesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges huaweicloud_dds_restore_time_ranges} +*/ +export class DataHuaweicloudDdsRestoreTimeRanges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_restore_time_ranges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsRestoreTimeRanges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsRestoreTimeRanges to import + * @param importFromId The id of the existing DataHuaweicloudDdsRestoreTimeRanges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsRestoreTimeRanges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_restore_time_ranges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_restore_time_ranges huaweicloud_dds_restore_time_ranges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsRestoreTimeRangesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsRestoreTimeRangesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_restore_time_ranges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._date = config.date; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // date - computed: false, optional: false, required: true + private _date?: string; + public get date() { + return this.getStringAttribute('date'); + } + public set date(value: string) { + this._date = value; + } + // Temporarily expose input value. Use with caution. + public get dateInput() { + return this._date; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_times - computed: true, optional: false, required: false + private _restoreTimes = new DataHuaweicloudDdsRestoreTimeRangesRestoreTimesList(this, "restore_times", false); + public get restoreTimes() { + return this._restoreTimes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + date: cdktf.stringToTerraform(this._date), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + date: { + value: cdktf.stringToHclTerraform(this._date), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/README.md new file mode 100644 index 00000000..08c7f2b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_scheduled_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_scheduled_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/index.ts new file mode 100644 index 00000000..3121ffbb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-scheduled-tasks/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsScheduledTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#end_time DataHuaweicloudDdsScheduledTasks#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#id DataHuaweicloudDdsScheduledTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#instance_id DataHuaweicloudDdsScheduledTasks#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the task name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#job_name DataHuaweicloudDdsScheduledTasks#job_name} + */ + readonly jobName?: string; + /** + * Specifies the task execution status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#job_status DataHuaweicloudDdsScheduledTasks#job_status} + */ + readonly jobStatus?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#region DataHuaweicloudDdsScheduledTasks#region} + */ + readonly region?: string; + /** + * Specifies the start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#start_time DataHuaweicloudDdsScheduledTasks#start_time} + */ + readonly startTime?: string; +} +export interface DataHuaweicloudDdsScheduledTasksSchedules { +} + +export function dataHuaweicloudDdsScheduledTasksSchedulesToTerraform(struct?: DataHuaweicloudDdsScheduledTasksSchedules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsScheduledTasksSchedulesToHclTerraform(struct?: DataHuaweicloudDdsScheduledTasksSchedules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsScheduledTasksSchedulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsScheduledTasksSchedules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsScheduledTasksSchedules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_status - computed: true, optional: false, required: false + public get instanceStatus() { + return this.getStringAttribute('instance_status'); + } + + // job_id - computed: true, optional: false, required: false + public get jobId() { + return this.getStringAttribute('job_id'); + } + + // job_name - computed: true, optional: false, required: false + public get jobName() { + return this.getStringAttribute('job_name'); + } + + // job_status - computed: true, optional: false, required: false + public get jobStatus() { + return this.getStringAttribute('job_status'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudDdsScheduledTasksSchedulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsScheduledTasksSchedulesOutputReference { + return new DataHuaweicloudDdsScheduledTasksSchedulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks huaweicloud_dds_scheduled_tasks} +*/ +export class DataHuaweicloudDdsScheduledTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_scheduled_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsScheduledTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsScheduledTasks to import + * @param importFromId The id of the existing DataHuaweicloudDdsScheduledTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsScheduledTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_scheduled_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_scheduled_tasks huaweicloud_dds_scheduled_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsScheduledTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsScheduledTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_scheduled_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._jobName = config.jobName; + this._jobStatus = config.jobStatus; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // job_name - computed: false, optional: true, required: false + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + public resetJobName() { + this._jobName = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // job_status - computed: false, optional: true, required: false + private _jobStatus?: string; + public get jobStatus() { + return this.getStringAttribute('job_status'); + } + public set jobStatus(value: string) { + this._jobStatus = value; + } + public resetJobStatus() { + this._jobStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobStatusInput() { + return this._jobStatus; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schedules - computed: true, optional: false, required: false + private _schedules = new DataHuaweicloudDdsScheduledTasksSchedulesList(this, "schedules", false); + public get schedules() { + return this._schedules; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + job_name: cdktf.stringToTerraform(this._jobName), + job_status: cdktf.stringToTerraform(this._jobStatus), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_status: { + value: cdktf.stringToHclTerraform(this._jobStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/README.md new file mode 100644 index 00000000..cde924cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_slow_log_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_slow_log_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/index.ts new file mode 100644 index 00000000..495e9dfb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-log-links/index.ts @@ -0,0 +1,461 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsSlowLogLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the names of the files. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#file_name_list DataHuaweicloudDdsSlowLogLinks#file_name_list} + */ + readonly fileNameList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#id DataHuaweicloudDdsSlowLogLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#instance_id DataHuaweicloudDdsSlowLogLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the node IDs to which the files belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#node_id_list DataHuaweicloudDdsSlowLogLinks#node_id_list} + */ + readonly nodeIdList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#region DataHuaweicloudDdsSlowLogLinks#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#timeouts DataHuaweicloudDdsSlowLogLinks#timeouts} + */ + readonly timeouts?: DataHuaweicloudDdsSlowLogLinksTimeouts; +} +export interface DataHuaweicloudDdsSlowLogLinksLinks { +} + +export function dataHuaweicloudDdsSlowLogLinksLinksToTerraform(struct?: DataHuaweicloudDdsSlowLogLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsSlowLogLinksLinksToHclTerraform(struct?: DataHuaweicloudDdsSlowLogLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsSlowLogLinksLinksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsSlowLogLinksLinks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsSlowLogLinksLinks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_link - computed: true, optional: false, required: false + public get fileLink() { + return this.getStringAttribute('file_link'); + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } + + // node_name - computed: true, optional: false, required: false + public get nodeName() { + return this.getStringAttribute('node_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDdsSlowLogLinksLinksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsSlowLogLinksLinksOutputReference { + return new DataHuaweicloudDdsSlowLogLinksLinksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDdsSlowLogLinksTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#read DataHuaweicloudDdsSlowLogLinks#read} + */ + readonly read?: string; +} + +export function dataHuaweicloudDdsSlowLogLinksTimeoutsToTerraform(struct?: DataHuaweicloudDdsSlowLogLinksTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + read: cdktf.stringToTerraform(struct!.read), + } +} + + +export function dataHuaweicloudDdsSlowLogLinksTimeoutsToHclTerraform(struct?: DataHuaweicloudDdsSlowLogLinksTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + read: { + value: cdktf.stringToHclTerraform(struct!.read), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudDdsSlowLogLinksTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataHuaweicloudDdsSlowLogLinksTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._read !== undefined) { + hasAnyValues = true; + internalValueResult.read = this._read; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsSlowLogLinksTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._read = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._read = value.read; + } + } + + // read - computed: false, optional: true, required: false + private _read?: string; + public get read() { + return this.getStringAttribute('read'); + } + public set read(value: string) { + this._read = value; + } + public resetRead() { + this._read = undefined; + } + // Temporarily expose input value. Use with caution. + public get readInput() { + return this._read; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links huaweicloud_dds_slow_log_links} +*/ +export class DataHuaweicloudDdsSlowLogLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_slow_log_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsSlowLogLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsSlowLogLinks to import + * @param importFromId The id of the existing DataHuaweicloudDdsSlowLogLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsSlowLogLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_slow_log_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_log_links huaweicloud_dds_slow_log_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsSlowLogLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsSlowLogLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_slow_log_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fileNameList = config.fileNameList; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeIdList = config.nodeIdList; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // file_name_list - computed: false, optional: true, required: false + private _fileNameList?: string[]; + public get fileNameList() { + return this.getListAttribute('file_name_list'); + } + public set fileNameList(value: string[]) { + this._fileNameList = value; + } + public resetFileNameList() { + this._fileNameList = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNameListInput() { + return this._fileNameList; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // links - computed: true, optional: false, required: false + private _links = new DataHuaweicloudDdsSlowLogLinksLinksList(this, "links", false); + public get links() { + return this._links; + } + + // node_id_list - computed: false, optional: true, required: false + private _nodeIdList?: string[]; + public get nodeIdList() { + return this.getListAttribute('node_id_list'); + } + public set nodeIdList(value: string[]) { + this._nodeIdList = value; + } + public resetNodeIdList() { + this._nodeIdList = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdListInput() { + return this._nodeIdList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataHuaweicloudDdsSlowLogLinksTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataHuaweicloudDdsSlowLogLinksTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + file_name_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._fileNameList), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._nodeIdList), + region: cdktf.stringToTerraform(this._region), + timeouts: dataHuaweicloudDdsSlowLogLinksTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + file_name_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._fileNameList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._nodeIdList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataHuaweicloudDdsSlowLogLinksTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataHuaweicloudDdsSlowLogLinksTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/README.md new file mode 100644 index 00000000..ff32e57a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_slow_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_slow_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/index.ts new file mode 100644 index 00000000..82db5f83 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-slow-logs/index.ts @@ -0,0 +1,568 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsSlowLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the fuzzy search for logs based on multiple database table name keywords. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#collection_keywords DataHuaweicloudDdsSlowLogs#collection_keywords} + */ + readonly collectionKeywords?: string[]; + /** + * Specifies the fuzzy search for logs based on multiple database keywords. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#database_keywords DataHuaweicloudDdsSlowLogs#database_keywords} + */ + readonly databaseKeywords?: string[]; + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#end_time DataHuaweicloudDdsSlowLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#id DataHuaweicloudDdsSlowLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#instance_id DataHuaweicloudDdsSlowLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the full-text log search based on multiple keywords. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#keywords DataHuaweicloudDdsSlowLogs#keywords} + */ + readonly keywords?: string[]; + /** + * Specifies the logs can be searched based on the maximum execution duration. Unit is ms. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#max_cost_time DataHuaweicloudDdsSlowLogs#max_cost_time} + */ + readonly maxCostTime?: number; + /** + * Specifies the logs can be searched based on the minimum execution duration. Unit is ms. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#min_cost_time DataHuaweicloudDdsSlowLogs#min_cost_time} + */ + readonly minCostTime?: number; + /** + * Specifies the node ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#node_id DataHuaweicloudDdsSlowLogs#node_id} + */ + readonly nodeId?: string; + /** + * Specifies the statement type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#operate_type DataHuaweicloudDdsSlowLogs#operate_type} + */ + readonly operateType?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#region DataHuaweicloudDdsSlowLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#start_time DataHuaweicloudDdsSlowLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudDdsSlowLogsSlowLogs { +} + +export function dataHuaweicloudDdsSlowLogsSlowLogsToTerraform(struct?: DataHuaweicloudDdsSlowLogsSlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsSlowLogsSlowLogsToHclTerraform(struct?: DataHuaweicloudDdsSlowLogsSlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsSlowLogsSlowLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsSlowLogsSlowLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsSlowLogsSlowLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // cost_time - computed: true, optional: false, required: false + public get costTime() { + return this.getNumberAttribute('cost_time'); + } + + // database - computed: true, optional: false, required: false + public get database() { + return this.getStringAttribute('database'); + } + + // docs_returned - computed: true, optional: false, required: false + public get docsReturned() { + return this.getNumberAttribute('docs_returned'); + } + + // docs_scanned - computed: true, optional: false, required: false + public get docsScanned() { + return this.getNumberAttribute('docs_scanned'); + } + + // lock_time - computed: true, optional: false, required: false + public get lockTime() { + return this.getNumberAttribute('lock_time'); + } + + // log_time - computed: true, optional: false, required: false + public get logTime() { + return this.getStringAttribute('log_time'); + } + + // node_id - computed: true, optional: false, required: false + public get nodeId() { + return this.getStringAttribute('node_id'); + } + + // node_name - computed: true, optional: false, required: false + public get nodeName() { + return this.getStringAttribute('node_name'); + } + + // operate_type - computed: true, optional: false, required: false + public get operateType() { + return this.getStringAttribute('operate_type'); + } + + // whole_message - computed: true, optional: false, required: false + public get wholeMessage() { + return this.getStringAttribute('whole_message'); + } +} + +export class DataHuaweicloudDdsSlowLogsSlowLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsSlowLogsSlowLogsOutputReference { + return new DataHuaweicloudDdsSlowLogsSlowLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs huaweicloud_dds_slow_logs} +*/ +export class DataHuaweicloudDdsSlowLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_slow_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsSlowLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsSlowLogs to import + * @param importFromId The id of the existing DataHuaweicloudDdsSlowLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsSlowLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_slow_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_slow_logs huaweicloud_dds_slow_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsSlowLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsSlowLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_slow_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._collectionKeywords = config.collectionKeywords; + this._databaseKeywords = config.databaseKeywords; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._keywords = config.keywords; + this._maxCostTime = config.maxCostTime; + this._minCostTime = config.minCostTime; + this._nodeId = config.nodeId; + this._operateType = config.operateType; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // collection_keywords - computed: false, optional: true, required: false + private _collectionKeywords?: string[]; + public get collectionKeywords() { + return this.getListAttribute('collection_keywords'); + } + public set collectionKeywords(value: string[]) { + this._collectionKeywords = value; + } + public resetCollectionKeywords() { + this._collectionKeywords = undefined; + } + // Temporarily expose input value. Use with caution. + public get collectionKeywordsInput() { + return this._collectionKeywords; + } + + // database_keywords - computed: false, optional: true, required: false + private _databaseKeywords?: string[]; + public get databaseKeywords() { + return this.getListAttribute('database_keywords'); + } + public set databaseKeywords(value: string[]) { + this._databaseKeywords = value; + } + public resetDatabaseKeywords() { + this._databaseKeywords = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseKeywordsInput() { + return this._databaseKeywords; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keywords - computed: false, optional: true, required: false + private _keywords?: string[]; + public get keywords() { + return this.getListAttribute('keywords'); + } + public set keywords(value: string[]) { + this._keywords = value; + } + public resetKeywords() { + this._keywords = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordsInput() { + return this._keywords; + } + + // max_cost_time - computed: false, optional: true, required: false + private _maxCostTime?: number; + public get maxCostTime() { + return this.getNumberAttribute('max_cost_time'); + } + public set maxCostTime(value: number) { + this._maxCostTime = value; + } + public resetMaxCostTime() { + this._maxCostTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxCostTimeInput() { + return this._maxCostTime; + } + + // min_cost_time - computed: false, optional: true, required: false + private _minCostTime?: number; + public get minCostTime() { + return this.getNumberAttribute('min_cost_time'); + } + public set minCostTime(value: number) { + this._minCostTime = value; + } + public resetMinCostTime() { + this._minCostTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get minCostTimeInput() { + return this._minCostTime; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // operate_type - computed: false, optional: true, required: false + private _operateType?: string; + public get operateType() { + return this.getStringAttribute('operate_type'); + } + public set operateType(value: string) { + this._operateType = value; + } + public resetOperateType() { + this._operateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get operateTypeInput() { + return this._operateType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // slow_logs - computed: true, optional: false, required: false + private _slowLogs = new DataHuaweicloudDdsSlowLogsSlowLogsList(this, "slow_logs", false); + public get slowLogs() { + return this._slowLogs; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + collection_keywords: cdktf.listMapper(cdktf.stringToTerraform, false)(this._collectionKeywords), + database_keywords: cdktf.listMapper(cdktf.stringToTerraform, false)(this._databaseKeywords), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keywords: cdktf.listMapper(cdktf.stringToTerraform, false)(this._keywords), + max_cost_time: cdktf.numberToTerraform(this._maxCostTime), + min_cost_time: cdktf.numberToTerraform(this._minCostTime), + node_id: cdktf.stringToTerraform(this._nodeId), + operate_type: cdktf.stringToTerraform(this._operateType), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + collection_keywords: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._collectionKeywords), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + database_keywords: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._databaseKeywords), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keywords: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._keywords), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + max_cost_time: { + value: cdktf.numberToHclTerraform(this._maxCostTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_cost_time: { + value: cdktf.numberToHclTerraform(this._minCostTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operate_type: { + value: cdktf.stringToHclTerraform(this._operateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/README.md new file mode 100644 index 00000000..b3e8846a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_ssl_cert_download_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_ssl_cert_download_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/index.ts new file mode 100644 index 00000000..d8a03bec --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-ssl-cert-download-links/index.ts @@ -0,0 +1,259 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsSslCertDownloadLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links#id DataHuaweicloudDdsSslCertDownloadLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links#instance_id DataHuaweicloudDdsSslCertDownloadLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links#region DataHuaweicloudDdsSslCertDownloadLinks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsSslCertDownloadLinksCerts { +} + +export function dataHuaweicloudDdsSslCertDownloadLinksCertsToTerraform(struct?: DataHuaweicloudDdsSslCertDownloadLinksCerts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsSslCertDownloadLinksCertsToHclTerraform(struct?: DataHuaweicloudDdsSslCertDownloadLinksCerts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsSslCertDownloadLinksCertsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsSslCertDownloadLinksCerts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsSslCertDownloadLinksCerts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // download_link - computed: true, optional: false, required: false + public get downloadLink() { + return this.getStringAttribute('download_link'); + } +} + +export class DataHuaweicloudDdsSslCertDownloadLinksCertsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsSslCertDownloadLinksCertsOutputReference { + return new DataHuaweicloudDdsSslCertDownloadLinksCertsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links huaweicloud_dds_ssl_cert_download_links} +*/ +export class DataHuaweicloudDdsSslCertDownloadLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_ssl_cert_download_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsSslCertDownloadLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsSslCertDownloadLinks to import + * @param importFromId The id of the existing DataHuaweicloudDdsSslCertDownloadLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsSslCertDownloadLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_ssl_cert_download_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_ssl_cert_download_links huaweicloud_dds_ssl_cert_download_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsSslCertDownloadLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsSslCertDownloadLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_ssl_cert_download_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // certs - computed: true, optional: false, required: false + private _certs = new DataHuaweicloudDdsSslCertDownloadLinksCertsList(this, "certs", false); + public get certs() { + return this._certs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/README.md new file mode 100644 index 00000000..c2238921 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dds_storage_types` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dds_storage_types`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/index.ts new file mode 100644 index 00000000..67e2bafc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dds-storage-types/index.ts @@ -0,0 +1,259 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDdsStorageTypesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types#engine_name DataHuaweicloudDdsStorageTypes#engine_name} + */ + readonly engineName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types#id DataHuaweicloudDdsStorageTypes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types#region DataHuaweicloudDdsStorageTypes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDdsStorageTypesStorageTypes { +} + +export function dataHuaweicloudDdsStorageTypesStorageTypesToTerraform(struct?: DataHuaweicloudDdsStorageTypesStorageTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDdsStorageTypesStorageTypesToHclTerraform(struct?: DataHuaweicloudDdsStorageTypesStorageTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDdsStorageTypesStorageTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDdsStorageTypesStorageTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDdsStorageTypesStorageTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDdsStorageTypesStorageTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDdsStorageTypesStorageTypesOutputReference { + return new DataHuaweicloudDdsStorageTypesStorageTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types huaweicloud_dds_storage_types} +*/ +export class DataHuaweicloudDdsStorageTypes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_storage_types"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDdsStorageTypes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDdsStorageTypes to import + * @param importFromId The id of the existing DataHuaweicloudDdsStorageTypes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDdsStorageTypes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_storage_types", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dds_storage_types huaweicloud_dds_storage_types} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDdsStorageTypesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDdsStorageTypesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_storage_types', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engineName = config.engineName; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine_name - computed: false, optional: true, required: false + private _engineName?: string; + public get engineName() { + return this.getStringAttribute('engine_name'); + } + public set engineName(value: string) { + this._engineName = value; + } + public resetEngineName() { + this._engineName = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineNameInput() { + return this._engineName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_types - computed: true, optional: false, required: false + private _storageTypes = new DataHuaweicloudDdsStorageTypesStorageTypesList(this, "storage_types", false); + public get storageTypes() { + return this._storageTypes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine_name: cdktf.stringToTerraform(this._engineName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine_name: { + value: cdktf.stringToHclTerraform(this._engineName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/README.md new file mode 100644 index 00000000..7a14407e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_datasource_auths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_datasource_auths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/index.ts new file mode 100644 index 00000000..e6a673ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-auths/index.ts @@ -0,0 +1,303 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliDatasourceAuthsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths#id DataHuaweicloudDliDatasourceAuths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths#name DataHuaweicloudDliDatasourceAuths#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths#region DataHuaweicloudDliDatasourceAuths#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDliDatasourceAuthsAuths { +} + +export function dataHuaweicloudDliDatasourceAuthsAuthsToTerraform(struct?: DataHuaweicloudDliDatasourceAuthsAuths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliDatasourceAuthsAuthsToHclTerraform(struct?: DataHuaweicloudDliDatasourceAuthsAuths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliDatasourceAuthsAuthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliDatasourceAuthsAuths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliDatasourceAuthsAuths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // certificate_location - computed: true, optional: false, required: false + public get certificateLocation() { + return this.getStringAttribute('certificate_location'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // keystore_location - computed: true, optional: false, required: false + public get keystoreLocation() { + return this.getStringAttribute('keystore_location'); + } + + // keytab - computed: true, optional: false, required: false + public get keytab() { + return this.getStringAttribute('keytab'); + } + + // krb5_conf - computed: true, optional: false, required: false + public get krb5Conf() { + return this.getStringAttribute('krb5_conf'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // truststore_location - computed: true, optional: false, required: false + public get truststoreLocation() { + return this.getStringAttribute('truststore_location'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // username - computed: true, optional: false, required: false + public get username() { + return this.getStringAttribute('username'); + } +} + +export class DataHuaweicloudDliDatasourceAuthsAuthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliDatasourceAuthsAuthsOutputReference { + return new DataHuaweicloudDliDatasourceAuthsAuthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths huaweicloud_dli_datasource_auths} +*/ +export class DataHuaweicloudDliDatasourceAuths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_datasource_auths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliDatasourceAuths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliDatasourceAuths to import + * @param importFromId The id of the existing DataHuaweicloudDliDatasourceAuths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliDatasourceAuths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_datasource_auths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_auths huaweicloud_dli_datasource_auths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliDatasourceAuthsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliDatasourceAuthsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_datasource_auths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // auths - computed: true, optional: false, required: false + private _auths = new DataHuaweicloudDliDatasourceAuthsAuthsList(this, "auths", false); + public get auths() { + return this._auths; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/README.md new file mode 100644 index 00000000..a5121c25 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_datasource_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_datasource_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/index.ts new file mode 100644 index 00000000..de6c3dbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-datasource-connections/index.ts @@ -0,0 +1,690 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliDatasourceConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections#id DataHuaweicloudDliDatasourceConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections#name DataHuaweicloudDliDatasourceConnections#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections#region DataHuaweicloudDliDatasourceConnections#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections#tags DataHuaweicloudDliDatasourceConnections#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePools { +} + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsToTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsToHclTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsOutputReference { + return new DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliDatasourceConnectionsConnectionsHosts { +} + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsHostsToTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsHostsToHclTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliDatasourceConnectionsConnectionsHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliDatasourceConnectionsConnectionsHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliDatasourceConnectionsConnectionsHostsOutputReference { + return new DataHuaweicloudDliDatasourceConnectionsConnectionsHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliDatasourceConnectionsConnectionsQueues { +} + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsQueuesToTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsQueuesToHclTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliDatasourceConnectionsConnectionsQueues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliDatasourceConnectionsConnectionsQueues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsQueuesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliDatasourceConnectionsConnectionsQueuesOutputReference { + return new DataHuaweicloudDliDatasourceConnectionsConnectionsQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliDatasourceConnectionsConnectionsRoutes { +} + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsRoutesToTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsRoutesToHclTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnectionsRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliDatasourceConnectionsConnectionsRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliDatasourceConnectionsConnectionsRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliDatasourceConnectionsConnectionsRoutesOutputReference { + return new DataHuaweicloudDliDatasourceConnectionsConnectionsRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliDatasourceConnectionsConnections { +} + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsToTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliDatasourceConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudDliDatasourceConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliDatasourceConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliDatasourceConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // elastic_resource_pools - computed: true, optional: false, required: false + private _elasticResourcePools = new DataHuaweicloudDliDatasourceConnectionsConnectionsElasticResourcePoolsList(this, "elastic_resource_pools", false); + public get elasticResourcePools() { + return this._elasticResourcePools; + } + + // hosts - computed: true, optional: false, required: false + private _hosts = new DataHuaweicloudDliDatasourceConnectionsConnectionsHostsList(this, "hosts", false); + public get hosts() { + return this._hosts; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_privis - computed: true, optional: false, required: false + public get isPrivis() { + return this.getBooleanAttribute('is_privis'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // queues - computed: true, optional: false, required: false + private _queues = new DataHuaweicloudDliDatasourceConnectionsConnectionsQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + + // routes - computed: true, optional: false, required: false + private _routes = new DataHuaweicloudDliDatasourceConnectionsConnectionsRoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDliDatasourceConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliDatasourceConnectionsConnectionsOutputReference { + return new DataHuaweicloudDliDatasourceConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections huaweicloud_dli_datasource_connections} +*/ +export class DataHuaweicloudDliDatasourceConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_datasource_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliDatasourceConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliDatasourceConnections to import + * @param importFromId The id of the existing DataHuaweicloudDliDatasourceConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliDatasourceConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_datasource_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_datasource_connections huaweicloud_dli_datasource_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliDatasourceConnectionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliDatasourceConnectionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_datasource_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudDliDatasourceConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/README.md new file mode 100644 index 00000000..8328d611 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_elastic_resource_pools` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_elastic_resource_pools`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/index.ts new file mode 100644 index 00000000..c1046587 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-elastic-resource-pools/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliElasticResourcePoolsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools#id DataHuaweicloudDliElasticResourcePools#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the elastic resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools#name DataHuaweicloudDliElasticResourcePools#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools#region DataHuaweicloudDliElasticResourcePools#region} + */ + readonly region?: string; + /** + * Specifies the status of the elastic resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools#status DataHuaweicloudDliElasticResourcePools#status} + */ + readonly status?: string; + /** + * Specifies the key/value pairs to associate with the elastic resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools#tags DataHuaweicloudDliElasticResourcePools#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudDliElasticResourcePoolsElasticResourcePools { +} + +export function dataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsToTerraform(struct?: DataHuaweicloudDliElasticResourcePoolsElasticResourcePools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsToHclTerraform(struct?: DataHuaweicloudDliElasticResourcePoolsElasticResourcePools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliElasticResourcePoolsElasticResourcePools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliElasticResourcePoolsElasticResourcePools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actual_cu - computed: true, optional: false, required: false + public get actualCu() { + return this.getNumberAttribute('actual_cu'); + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_cu - computed: true, optional: false, required: false + public get currentCu() { + return this.getNumberAttribute('current_cu'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // fail_reason - computed: true, optional: false, required: false + public get failReason() { + return this.getStringAttribute('fail_reason'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // manager - computed: true, optional: false, required: false + public get manager() { + return this.getStringAttribute('manager'); + } + + // max_cu - computed: true, optional: false, required: false + public get maxCu() { + return this.getNumberAttribute('max_cu'); + } + + // min_cu - computed: true, optional: false, required: false + public get minCu() { + return this.getNumberAttribute('min_cu'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // queues - computed: true, optional: false, required: false + public get queues() { + return this.getListAttribute('queues'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsOutputReference { + return new DataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools huaweicloud_dli_elastic_resource_pools} +*/ +export class DataHuaweicloudDliElasticResourcePools extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_elastic_resource_pools"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliElasticResourcePools resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliElasticResourcePools to import + * @param importFromId The id of the existing DataHuaweicloudDliElasticResourcePools that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliElasticResourcePools to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_elastic_resource_pools", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_elastic_resource_pools huaweicloud_dli_elastic_resource_pools} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliElasticResourcePoolsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliElasticResourcePoolsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_elastic_resource_pools', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // elastic_resource_pools - computed: true, optional: false, required: false + private _elasticResourcePools = new DataHuaweicloudDliElasticResourcePoolsElasticResourcePoolsList(this, "elastic_resource_pools", false); + public get elasticResourcePools() { + return this._elasticResourcePools; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/README.md new file mode 100644 index 00000000..2ba1939d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_flink_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_flink_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/index.ts new file mode 100644 index 00000000..adf6d7cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flink-templates/index.ts @@ -0,0 +1,347 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliFlinkTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates#id DataHuaweicloudDliFlinkTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the flink template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates#name DataHuaweicloudDliFlinkTemplates#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates#region DataHuaweicloudDliFlinkTemplates#region} + */ + readonly region?: string; + /** + * Specifies the ID of the flink template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates#template_id DataHuaweicloudDliFlinkTemplates#template_id} + */ + readonly templateId?: string; + /** + * Specifies the type of the flink template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates#type DataHuaweicloudDliFlinkTemplates#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDliFlinkTemplatesTemplates { +} + +export function dataHuaweicloudDliFlinkTemplatesTemplatesToTerraform(struct?: DataHuaweicloudDliFlinkTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliFlinkTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudDliFlinkTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliFlinkTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliFlinkTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliFlinkTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // sql - computed: true, optional: false, required: false + public get sql() { + return this.getStringAttribute('sql'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDliFlinkTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliFlinkTemplatesTemplatesOutputReference { + return new DataHuaweicloudDliFlinkTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates huaweicloud_dli_flink_templates} +*/ +export class DataHuaweicloudDliFlinkTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_flink_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliFlinkTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliFlinkTemplates to import + * @param importFromId The id of the existing DataHuaweicloudDliFlinkTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliFlinkTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_flink_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flink_templates huaweicloud_dli_flink_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliFlinkTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliFlinkTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_flink_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._templateId = config.templateId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudDliFlinkTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/README.md new file mode 100644 index 00000000..ba2bb84a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_flinkjar_jobs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_flinkjar_jobs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/index.ts new file mode 100644 index 00000000..ed046e7c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinkjar-jobs/index.ts @@ -0,0 +1,574 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliFlinkjarJobsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#cu_num DataHuaweicloudDliFlinkjarJobs#cu_num} + */ + readonly cuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#id DataHuaweicloudDliFlinkjarJobs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#job_id DataHuaweicloudDliFlinkjarJobs#job_id} + */ + readonly jobId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#manager_cu_num DataHuaweicloudDliFlinkjarJobs#manager_cu_num} + */ + readonly managerCuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#parallel_num DataHuaweicloudDliFlinkjarJobs#parallel_num} + */ + readonly parallelNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#queue_name DataHuaweicloudDliFlinkjarJobs#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#region DataHuaweicloudDliFlinkjarJobs#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#tags DataHuaweicloudDliFlinkjarJobs#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#tm_cu_num DataHuaweicloudDliFlinkjarJobs#tm_cu_num} + */ + readonly tmCuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#tm_slot_num DataHuaweicloudDliFlinkjarJobs#tm_slot_num} + */ + readonly tmSlotNum?: number; +} +export interface DataHuaweicloudDliFlinkjarJobsJobs { +} + +export function dataHuaweicloudDliFlinkjarJobsJobsToTerraform(struct?: DataHuaweicloudDliFlinkjarJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliFlinkjarJobsJobsToHclTerraform(struct?: DataHuaweicloudDliFlinkjarJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliFlinkjarJobsJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliFlinkjarJobsJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliFlinkjarJobsJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // checkpoint_path - computed: true, optional: false, required: false + public get checkpointPath() { + return this.getStringAttribute('checkpoint_path'); + } + + // cu_num - computed: true, optional: false, required: false + public get cuNum() { + return this.getNumberAttribute('cu_num'); + } + + // dependency_files - computed: true, optional: false, required: false + public get dependencyFiles() { + return this.getListAttribute('dependency_files'); + } + + // dependency_jars - computed: true, optional: false, required: false + public get dependencyJars() { + return this.getListAttribute('dependency_jars'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // entrypoint - computed: true, optional: false, required: false + public get entrypoint() { + return this.getStringAttribute('entrypoint'); + } + + // entrypoint_args - computed: true, optional: false, required: false + public get entrypointArgs() { + return this.getStringAttribute('entrypoint_args'); + } + + // feature - computed: true, optional: false, required: false + public get feature() { + return this.getStringAttribute('feature'); + } + + // flink_version - computed: true, optional: false, required: false + public get flinkVersion() { + return this.getStringAttribute('flink_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image - computed: true, optional: false, required: false + public get image() { + return this.getStringAttribute('image'); + } + + // log_enabled - computed: true, optional: false, required: false + public get logEnabled() { + return this.getBooleanAttribute('log_enabled'); + } + + // main_class - computed: true, optional: false, required: false + public get mainClass() { + return this.getStringAttribute('main_class'); + } + + // manager_cu_num - computed: true, optional: false, required: false + public get managerCuNum() { + return this.getNumberAttribute('manager_cu_num'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // obs_bucket - computed: true, optional: false, required: false + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + + // parallel_num - computed: true, optional: false, required: false + public get parallelNum() { + return this.getNumberAttribute('parallel_num'); + } + + // queue_name - computed: true, optional: false, required: false + public get queueName() { + return this.getStringAttribute('queue_name'); + } + + // restart_when_exception - computed: true, optional: false, required: false + public get restartWhenException() { + return this.getBooleanAttribute('restart_when_exception'); + } + + // resume_checkpoint - computed: true, optional: false, required: false + public get resumeCheckpoint() { + return this.getBooleanAttribute('resume_checkpoint'); + } + + // resume_max_num - computed: true, optional: false, required: false + public get resumeMaxNum() { + return this.getNumberAttribute('resume_max_num'); + } + + // runtime_config - computed: true, optional: false, required: false + public get runtimeConfig() { + return this.getStringAttribute('runtime_config'); + } + + // smn_topic - computed: true, optional: false, required: false + public get smnTopic() { + return this.getStringAttribute('smn_topic'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tm_cu_num - computed: true, optional: false, required: false + public get tmCuNum() { + return this.getNumberAttribute('tm_cu_num'); + } + + // tm_slot_num - computed: true, optional: false, required: false + public get tmSlotNum() { + return this.getNumberAttribute('tm_slot_num'); + } +} + +export class DataHuaweicloudDliFlinkjarJobsJobsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliFlinkjarJobsJobsOutputReference { + return new DataHuaweicloudDliFlinkjarJobsJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs huaweicloud_dli_flinkjar_jobs} +*/ +export class DataHuaweicloudDliFlinkjarJobs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_flinkjar_jobs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliFlinkjarJobs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliFlinkjarJobs to import + * @param importFromId The id of the existing DataHuaweicloudDliFlinkjarJobs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliFlinkjarJobs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_flinkjar_jobs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinkjar_jobs huaweicloud_dli_flinkjar_jobs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliFlinkjarJobsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliFlinkjarJobsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_flinkjar_jobs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cuNum = config.cuNum; + this._id = config.id; + this._jobId = config.jobId; + this._managerCuNum = config.managerCuNum; + this._parallelNum = config.parallelNum; + this._queueName = config.queueName; + this._region = config.region; + this._tags = config.tags; + this._tmCuNum = config.tmCuNum; + this._tmSlotNum = config.tmSlotNum; + } + + // ========== + // ATTRIBUTES + // ========== + + // cu_num - computed: false, optional: true, required: false + private _cuNum?: number; + public get cuNum() { + return this.getNumberAttribute('cu_num'); + } + public set cuNum(value: number) { + this._cuNum = value; + } + public resetCuNum() { + this._cuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get cuNumInput() { + return this._cuNum; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: true, required: false + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + public resetJobId() { + this._jobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // jobs - computed: true, optional: false, required: false + private _jobs = new DataHuaweicloudDliFlinkjarJobsJobsList(this, "jobs", false); + public get jobs() { + return this._jobs; + } + + // manager_cu_num - computed: false, optional: true, required: false + private _managerCuNum?: number; + public get managerCuNum() { + return this.getNumberAttribute('manager_cu_num'); + } + public set managerCuNum(value: number) { + this._managerCuNum = value; + } + public resetManagerCuNum() { + this._managerCuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerCuNumInput() { + return this._managerCuNum; + } + + // parallel_num - computed: false, optional: true, required: false + private _parallelNum?: number; + public get parallelNum() { + return this.getNumberAttribute('parallel_num'); + } + public set parallelNum(value: number) { + this._parallelNum = value; + } + public resetParallelNum() { + this._parallelNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get parallelNumInput() { + return this._parallelNum; + } + + // queue_name - computed: false, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tm_cu_num - computed: false, optional: true, required: false + private _tmCuNum?: number; + public get tmCuNum() { + return this.getNumberAttribute('tm_cu_num'); + } + public set tmCuNum(value: number) { + this._tmCuNum = value; + } + public resetTmCuNum() { + this._tmCuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmCuNumInput() { + return this._tmCuNum; + } + + // tm_slot_num - computed: false, optional: true, required: false + private _tmSlotNum?: number; + public get tmSlotNum() { + return this.getNumberAttribute('tm_slot_num'); + } + public set tmSlotNum(value: number) { + this._tmSlotNum = value; + } + public resetTmSlotNum() { + this._tmSlotNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmSlotNumInput() { + return this._tmSlotNum; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cu_num: cdktf.numberToTerraform(this._cuNum), + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + manager_cu_num: cdktf.numberToTerraform(this._managerCuNum), + parallel_num: cdktf.numberToTerraform(this._parallelNum), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tm_cu_num: cdktf.numberToTerraform(this._tmCuNum), + tm_slot_num: cdktf.numberToTerraform(this._tmSlotNum), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cu_num: { + value: cdktf.numberToHclTerraform(this._cuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_cu_num: { + value: cdktf.numberToHclTerraform(this._managerCuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + parallel_num: { + value: cdktf.numberToHclTerraform(this._parallelNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tm_cu_num: { + value: cdktf.numberToHclTerraform(this._tmCuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tm_slot_num: { + value: cdktf.numberToHclTerraform(this._tmSlotNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/README.md new file mode 100644 index 00000000..f6d7521a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_flinksql_jobs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_flinksql_jobs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/index.ts new file mode 100644 index 00000000..2339bbca --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-flinksql-jobs/index.ts @@ -0,0 +1,594 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliFlinksqlJobsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#cu_num DataHuaweicloudDliFlinksqlJobs#cu_num} + */ + readonly cuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#id DataHuaweicloudDliFlinksqlJobs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#job_id DataHuaweicloudDliFlinksqlJobs#job_id} + */ + readonly jobId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#manager_cu_num DataHuaweicloudDliFlinksqlJobs#manager_cu_num} + */ + readonly managerCuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#parallel_num DataHuaweicloudDliFlinksqlJobs#parallel_num} + */ + readonly parallelNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#queue_name DataHuaweicloudDliFlinksqlJobs#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#region DataHuaweicloudDliFlinksqlJobs#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#tags DataHuaweicloudDliFlinksqlJobs#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#tm_cu_num DataHuaweicloudDliFlinksqlJobs#tm_cu_num} + */ + readonly tmCuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#tm_slot_num DataHuaweicloudDliFlinksqlJobs#tm_slot_num} + */ + readonly tmSlotNum?: number; +} +export interface DataHuaweicloudDliFlinksqlJobsJobs { +} + +export function dataHuaweicloudDliFlinksqlJobsJobsToTerraform(struct?: DataHuaweicloudDliFlinksqlJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliFlinksqlJobsJobsToHclTerraform(struct?: DataHuaweicloudDliFlinksqlJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliFlinksqlJobsJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliFlinksqlJobsJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliFlinksqlJobsJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // checkpoint_enabled - computed: true, optional: false, required: false + public get checkpointEnabled() { + return this.getBooleanAttribute('checkpoint_enabled'); + } + + // checkpoint_interval - computed: true, optional: false, required: false + public get checkpointInterval() { + return this.getNumberAttribute('checkpoint_interval'); + } + + // checkpoint_mode - computed: true, optional: false, required: false + public get checkpointMode() { + return this.getStringAttribute('checkpoint_mode'); + } + + // cu_num - computed: true, optional: false, required: false + public get cuNum() { + return this.getNumberAttribute('cu_num'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dirty_data_strategy - computed: true, optional: false, required: false + public get dirtyDataStrategy() { + return this.getStringAttribute('dirty_data_strategy'); + } + + // edge_group_ids - computed: true, optional: false, required: false + public get edgeGroupIds() { + return this.getListAttribute('edge_group_ids'); + } + + // flink_version - computed: true, optional: false, required: false + public get flinkVersion() { + return this.getStringAttribute('flink_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // idle_state_retention - computed: true, optional: false, required: false + public get idleStateRetention() { + return this.getNumberAttribute('idle_state_retention'); + } + + // log_enabled - computed: true, optional: false, required: false + public get logEnabled() { + return this.getBooleanAttribute('log_enabled'); + } + + // manager_cu_num - computed: true, optional: false, required: false + public get managerCuNum() { + return this.getNumberAttribute('manager_cu_num'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // obs_bucket - computed: true, optional: false, required: false + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + + // operator_config - computed: true, optional: false, required: false + public get operatorConfig() { + return this.getStringAttribute('operator_config'); + } + + // parallel_num - computed: true, optional: false, required: false + public get parallelNum() { + return this.getNumberAttribute('parallel_num'); + } + + // queue_name - computed: true, optional: false, required: false + public get queueName() { + return this.getStringAttribute('queue_name'); + } + + // restart_when_exception - computed: true, optional: false, required: false + public get restartWhenException() { + return this.getBooleanAttribute('restart_when_exception'); + } + + // resume_checkpoint - computed: true, optional: false, required: false + public get resumeCheckpoint() { + return this.getBooleanAttribute('resume_checkpoint'); + } + + // resume_max_num - computed: true, optional: false, required: false + public get resumeMaxNum() { + return this.getNumberAttribute('resume_max_num'); + } + + // run_mode - computed: true, optional: false, required: false + public get runMode() { + return this.getStringAttribute('run_mode'); + } + + // runtime_config - computed: true, optional: false, required: false + public get runtimeConfig() { + return this.getStringAttribute('runtime_config'); + } + + // smn_topic - computed: true, optional: false, required: false + public get smnTopic() { + return this.getStringAttribute('smn_topic'); + } + + // sql - computed: true, optional: false, required: false + public get sql() { + return this.getStringAttribute('sql'); + } + + // static_estimator_config - computed: true, optional: false, required: false + public get staticEstimatorConfig() { + return this.getStringAttribute('static_estimator_config'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tm_cu_num - computed: true, optional: false, required: false + public get tmCuNum() { + return this.getNumberAttribute('tm_cu_num'); + } + + // tm_slot_num - computed: true, optional: false, required: false + public get tmSlotNum() { + return this.getNumberAttribute('tm_slot_num'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // udf_jar_url - computed: true, optional: false, required: false + public get udfJarUrl() { + return this.getStringAttribute('udf_jar_url'); + } +} + +export class DataHuaweicloudDliFlinksqlJobsJobsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliFlinksqlJobsJobsOutputReference { + return new DataHuaweicloudDliFlinksqlJobsJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs huaweicloud_dli_flinksql_jobs} +*/ +export class DataHuaweicloudDliFlinksqlJobs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_flinksql_jobs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliFlinksqlJobs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliFlinksqlJobs to import + * @param importFromId The id of the existing DataHuaweicloudDliFlinksqlJobs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliFlinksqlJobs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_flinksql_jobs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_flinksql_jobs huaweicloud_dli_flinksql_jobs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliFlinksqlJobsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliFlinksqlJobsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_flinksql_jobs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cuNum = config.cuNum; + this._id = config.id; + this._jobId = config.jobId; + this._managerCuNum = config.managerCuNum; + this._parallelNum = config.parallelNum; + this._queueName = config.queueName; + this._region = config.region; + this._tags = config.tags; + this._tmCuNum = config.tmCuNum; + this._tmSlotNum = config.tmSlotNum; + } + + // ========== + // ATTRIBUTES + // ========== + + // cu_num - computed: false, optional: true, required: false + private _cuNum?: number; + public get cuNum() { + return this.getNumberAttribute('cu_num'); + } + public set cuNum(value: number) { + this._cuNum = value; + } + public resetCuNum() { + this._cuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get cuNumInput() { + return this._cuNum; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: true, required: false + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + public resetJobId() { + this._jobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // jobs - computed: true, optional: false, required: false + private _jobs = new DataHuaweicloudDliFlinksqlJobsJobsList(this, "jobs", false); + public get jobs() { + return this._jobs; + } + + // manager_cu_num - computed: false, optional: true, required: false + private _managerCuNum?: number; + public get managerCuNum() { + return this.getNumberAttribute('manager_cu_num'); + } + public set managerCuNum(value: number) { + this._managerCuNum = value; + } + public resetManagerCuNum() { + this._managerCuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerCuNumInput() { + return this._managerCuNum; + } + + // parallel_num - computed: false, optional: true, required: false + private _parallelNum?: number; + public get parallelNum() { + return this.getNumberAttribute('parallel_num'); + } + public set parallelNum(value: number) { + this._parallelNum = value; + } + public resetParallelNum() { + this._parallelNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get parallelNumInput() { + return this._parallelNum; + } + + // queue_name - computed: false, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tm_cu_num - computed: false, optional: true, required: false + private _tmCuNum?: number; + public get tmCuNum() { + return this.getNumberAttribute('tm_cu_num'); + } + public set tmCuNum(value: number) { + this._tmCuNum = value; + } + public resetTmCuNum() { + this._tmCuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmCuNumInput() { + return this._tmCuNum; + } + + // tm_slot_num - computed: false, optional: true, required: false + private _tmSlotNum?: number; + public get tmSlotNum() { + return this.getNumberAttribute('tm_slot_num'); + } + public set tmSlotNum(value: number) { + this._tmSlotNum = value; + } + public resetTmSlotNum() { + this._tmSlotNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmSlotNumInput() { + return this._tmSlotNum; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cu_num: cdktf.numberToTerraform(this._cuNum), + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + manager_cu_num: cdktf.numberToTerraform(this._managerCuNum), + parallel_num: cdktf.numberToTerraform(this._parallelNum), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tm_cu_num: cdktf.numberToTerraform(this._tmCuNum), + tm_slot_num: cdktf.numberToTerraform(this._tmSlotNum), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cu_num: { + value: cdktf.numberToHclTerraform(this._cuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_cu_num: { + value: cdktf.numberToHclTerraform(this._managerCuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + parallel_num: { + value: cdktf.numberToHclTerraform(this._parallelNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tm_cu_num: { + value: cdktf.numberToHclTerraform(this._tmCuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tm_slot_num: { + value: cdktf.numberToHclTerraform(this._tmSlotNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/README.md new file mode 100644 index 00000000..ed21dcd7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/index.ts new file mode 100644 index 00000000..7b188a3e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-quotas/index.ts @@ -0,0 +1,277 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas#id DataHuaweicloudDliQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource quota. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas#region DataHuaweicloudDliQuotas#region} + */ + readonly region?: string; + /** + * Specifies the resource type that used to query corresponding quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas#type DataHuaweicloudDliQuotas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDliQuotasQuotas { +} + +export function dataHuaweicloudDliQuotasQuotasToTerraform(struct?: DataHuaweicloudDliQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliQuotasQuotasToHclTerraform(struct?: DataHuaweicloudDliQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max - computed: true, optional: false, required: false + public get max() { + return this.getNumberAttribute('max'); + } + + // min - computed: true, optional: false, required: false + public get min() { + return this.getNumberAttribute('min'); + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudDliQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliQuotasQuotasOutputReference { + return new DataHuaweicloudDliQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas huaweicloud_dli_quotas} +*/ +export class DataHuaweicloudDliQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliQuotas to import + * @param importFromId The id of the existing DataHuaweicloudDliQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_quotas huaweicloud_dli_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudDliQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/README.md new file mode 100644 index 00000000..ea7dc535 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_spark_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_spark_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/index.ts new file mode 100644 index 00000000..f5ef11df --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-spark-templates/index.ts @@ -0,0 +1,757 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliSparkTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the group name to which the spark templates belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates#group DataHuaweicloudDliSparkTemplates#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates#id DataHuaweicloudDliSparkTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the spark template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates#name DataHuaweicloudDliSparkTemplates#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates#region DataHuaweicloudDliSparkTemplates#region} + */ + readonly region?: string; + /** + * Specifies the ID of the spark template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates#template_id DataHuaweicloudDliSparkTemplates#template_id} + */ + readonly templateId?: string; +} +export interface DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResources { +} + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesToTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesToHclTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesOutputReference { + return new DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackages { +} + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesToTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesToHclTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesOutputReference { + return new DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliSparkTemplatesTemplatesBodyResources { +} + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesToTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBodyResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesToHclTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBodyResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSparkTemplatesTemplatesBodyResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSparkTemplatesTemplatesBodyResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesOutputReference { + return new DataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliSparkTemplatesTemplatesBody { +} + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyToTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBody): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSparkTemplatesTemplatesBodyToHclTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplatesBody): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSparkTemplatesTemplatesBody | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSparkTemplatesTemplatesBody | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_name - computed: true, optional: false, required: false + public get appName() { + return this.getStringAttribute('app_name'); + } + + // app_parameters - computed: true, optional: false, required: false + public get appParameters() { + return this.getListAttribute('app_parameters'); + } + + // auto_recovery - computed: true, optional: false, required: false + public get autoRecovery() { + return this.getBooleanAttribute('auto_recovery'); + } + + // configurations - computed: true, optional: false, required: false + private _configurations = new cdktf.StringMap(this, "configurations"); + public get configurations() { + return this._configurations; + } + + // dependent_packages - computed: true, optional: false, required: false + private _dependentPackages = new DataHuaweicloudDliSparkTemplatesTemplatesBodyDependentPackagesList(this, "dependent_packages", false); + public get dependentPackages() { + return this._dependentPackages; + } + + // driver_cores - computed: true, optional: false, required: false + public get driverCores() { + return this.getNumberAttribute('driver_cores'); + } + + // driver_memory - computed: true, optional: false, required: false + public get driverMemory() { + return this.getStringAttribute('driver_memory'); + } + + // executor_cores - computed: true, optional: false, required: false + public get executorCores() { + return this.getNumberAttribute('executor_cores'); + } + + // executor_memory - computed: true, optional: false, required: false + public get executorMemory() { + return this.getStringAttribute('executor_memory'); + } + + // files - computed: true, optional: false, required: false + public get files() { + return this.getListAttribute('files'); + } + + // jars - computed: true, optional: false, required: false + public get jars() { + return this.getListAttribute('jars'); + } + + // main_class - computed: true, optional: false, required: false + public get mainClass() { + return this.getStringAttribute('main_class'); + } + + // max_retry_times - computed: true, optional: false, required: false + public get maxRetryTimes() { + return this.getNumberAttribute('max_retry_times'); + } + + // modules - computed: true, optional: false, required: false + public get modules() { + return this.getListAttribute('modules'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // num_executors - computed: true, optional: false, required: false + public get numExecutors() { + return this.getNumberAttribute('num_executors'); + } + + // obs_bucket - computed: true, optional: false, required: false + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + + // python_files - computed: true, optional: false, required: false + public get pythonFiles() { + return this.getListAttribute('python_files'); + } + + // queue_name - computed: true, optional: false, required: false + public get queueName() { + return this.getStringAttribute('queue_name'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudDliSparkTemplatesTemplatesBodyResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // specification - computed: true, optional: false, required: false + public get specification() { + return this.getStringAttribute('specification'); + } +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesBodyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSparkTemplatesTemplatesBodyOutputReference { + return new DataHuaweicloudDliSparkTemplatesTemplatesBodyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDliSparkTemplatesTemplates { +} + +export function dataHuaweicloudDliSparkTemplatesTemplatesToTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSparkTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudDliSparkTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSparkTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSparkTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // body - computed: true, optional: false, required: false + private _body = new DataHuaweicloudDliSparkTemplatesTemplatesBodyList(this, "body", false); + public get body() { + return this._body; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // group - computed: true, optional: false, required: false + public get group() { + return this.getStringAttribute('group'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudDliSparkTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSparkTemplatesTemplatesOutputReference { + return new DataHuaweicloudDliSparkTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates huaweicloud_dli_spark_templates} +*/ +export class DataHuaweicloudDliSparkTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_spark_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliSparkTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliSparkTemplates to import + * @param importFromId The id of the existing DataHuaweicloudDliSparkTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliSparkTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_spark_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_spark_templates huaweicloud_dli_spark_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliSparkTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliSparkTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_spark_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._templateId = config.templateId; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudDliSparkTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/README.md new file mode 100644 index 00000000..7ced3ae9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_sql_jobs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_sql_jobs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/index.ts new file mode 100644 index 00000000..d26d4ecf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-jobs/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliSqlJobsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the time when a job is end to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#end_time DataHuaweicloudDliSqlJobs#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#id DataHuaweicloudDliSqlJobs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the job to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#job_id DataHuaweicloudDliSqlJobs#job_id} + */ + readonly jobId?: string; + /** + * Specifies the queue name which this job to be submitted belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#queue_name DataHuaweicloudDliSqlJobs#queue_name} + */ + readonly queueName?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#region DataHuaweicloudDliSqlJobs#region} + */ + readonly region?: string; + /** + * Specifies the time when a job is start to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#start_time DataHuaweicloudDliSqlJobs#start_time} + */ + readonly startTime?: string; + /** + * Specifies the status of the job to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#status DataHuaweicloudDliSqlJobs#status} + */ + readonly status?: string; + /** + * Specifies the type of the job to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#type DataHuaweicloudDliSqlJobs#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDliSqlJobsJobs { +} + +export function dataHuaweicloudDliSqlJobsJobsToTerraform(struct?: DataHuaweicloudDliSqlJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSqlJobsJobsToHclTerraform(struct?: DataHuaweicloudDliSqlJobsJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSqlJobsJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSqlJobsJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSqlJobsJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // database_name - computed: true, optional: false, required: false + public get databaseName() { + return this.getStringAttribute('database_name'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getNumberAttribute('duration'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // queue_name - computed: true, optional: false, required: false + public get queueName() { + return this.getStringAttribute('queue_name'); + } + + // sql - computed: true, optional: false, required: false + public get sql() { + return this.getStringAttribute('sql'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDliSqlJobsJobsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSqlJobsJobsOutputReference { + return new DataHuaweicloudDliSqlJobsJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs huaweicloud_dli_sql_jobs} +*/ +export class DataHuaweicloudDliSqlJobs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_sql_jobs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliSqlJobs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliSqlJobs to import + * @param importFromId The id of the existing DataHuaweicloudDliSqlJobs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliSqlJobs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_sql_jobs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_jobs huaweicloud_dli_sql_jobs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliSqlJobsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliSqlJobsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_sql_jobs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._jobId = config.jobId; + this._queueName = config.queueName; + this._region = config.region; + this._startTime = config.startTime; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: true, required: false + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + public resetJobId() { + this._jobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // jobs - computed: true, optional: false, required: false + private _jobs = new DataHuaweicloudDliSqlJobsJobsList(this, "jobs", false); + public get jobs() { + return this._jobs; + } + + // queue_name - computed: false, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/README.md new file mode 100644 index 00000000..77b25137 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dli_sql_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dli_sql_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/index.ts new file mode 100644 index 00000000..fa77af9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dli-sql-templates/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDliSqlTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the group name to which the SQL templates belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#group DataHuaweicloudDliSqlTemplates#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#id DataHuaweicloudDliSqlTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the SQL template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#name DataHuaweicloudDliSqlTemplates#name} + */ + readonly name?: string; + /** + * Specifies user ID of owner to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#owner DataHuaweicloudDliSqlTemplates#owner} + */ + readonly owner?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#region DataHuaweicloudDliSqlTemplates#region} + */ + readonly region?: string; + /** + * Specifies the ID of the SQL template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#template_id DataHuaweicloudDliSqlTemplates#template_id} + */ + readonly templateId?: string; +} +export interface DataHuaweicloudDliSqlTemplatesTemplates { +} + +export function dataHuaweicloudDliSqlTemplatesTemplatesToTerraform(struct?: DataHuaweicloudDliSqlTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDliSqlTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudDliSqlTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDliSqlTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDliSqlTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDliSqlTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // group - computed: true, optional: false, required: false + public get group() { + return this.getStringAttribute('group'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // sql - computed: true, optional: false, required: false + public get sql() { + return this.getStringAttribute('sql'); + } +} + +export class DataHuaweicloudDliSqlTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDliSqlTemplatesTemplatesOutputReference { + return new DataHuaweicloudDliSqlTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates huaweicloud_dli_sql_templates} +*/ +export class DataHuaweicloudDliSqlTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_sql_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDliSqlTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDliSqlTemplates to import + * @param importFromId The id of the existing DataHuaweicloudDliSqlTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDliSqlTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_sql_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dli_sql_templates huaweicloud_dli_sql_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDliSqlTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDliSqlTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_sql_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._name = config.name; + this._owner = config.owner; + this._region = config.region; + this._templateId = config.templateId; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: false, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudDliSqlTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/README.md new file mode 100644 index 00000000..10089b42 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_az_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_az_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/index.ts new file mode 100644 index 00000000..21e97449 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az-v1/index.ts @@ -0,0 +1,233 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsAzV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1#code DataHuaweicloudDmsAzV1#code} + */ + readonly code?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1#id DataHuaweicloudDmsAzV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1#name DataHuaweicloudDmsAzV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1#port DataHuaweicloudDmsAzV1#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1#region DataHuaweicloudDmsAzV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1 huaweicloud_dms_az_v1} +*/ +export class DataHuaweicloudDmsAzV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_az_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsAzV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsAzV1 to import + * @param importFromId The id of the existing DataHuaweicloudDmsAzV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsAzV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_az_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az_v1 huaweicloud_dms_az_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsAzV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsAzV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_az_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._id = config.id; + this._name = config.name; + this._port = config.port; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + port: cdktf.stringToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/README.md new file mode 100644 index 00000000..7b8e2510 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_az` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_az`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/index.ts new file mode 100644 index 00000000..12cbfac8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-az/index.ts @@ -0,0 +1,233 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsAzConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az#code DataHuaweicloudDmsAz#code} + */ + readonly code?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az#id DataHuaweicloudDmsAz#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az#name DataHuaweicloudDmsAz#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az#port DataHuaweicloudDmsAz#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az#region DataHuaweicloudDmsAz#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az huaweicloud_dms_az} +*/ +export class DataHuaweicloudDmsAz extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_az"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsAz resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsAz to import + * @param importFromId The id of the existing DataHuaweicloudDmsAz that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsAz to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_az", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_az huaweicloud_dms_az} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsAzConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsAzConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_az', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._id = config.id; + this._name = config.name; + this._port = config.port; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + port: cdktf.stringToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/README.md new file mode 100644 index 00000000..f25ab97e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_background_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_background_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/index.ts new file mode 100644 index 00000000..f02fcea9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-background-tasks/index.ts @@ -0,0 +1,349 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaBackgroundTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the time of task where the query starts. The format is YYYYMMDDHHmmss. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks#begin_time DataHuaweicloudDmsKafkaBackgroundTasks#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the time of task where the query ends. The format is YYYYMMDDHHmmss. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks#end_time DataHuaweicloudDmsKafkaBackgroundTasks#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks#id DataHuaweicloudDmsKafkaBackgroundTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks#instance_id DataHuaweicloudDmsKafkaBackgroundTasks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks#region DataHuaweicloudDmsKafkaBackgroundTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsKafkaBackgroundTasksTasks { +} + +export function dataHuaweicloudDmsKafkaBackgroundTasksTasksToTerraform(struct?: DataHuaweicloudDmsKafkaBackgroundTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaBackgroundTasksTasksToHclTerraform(struct?: DataHuaweicloudDmsKafkaBackgroundTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaBackgroundTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaBackgroundTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaBackgroundTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // params - computed: true, optional: false, required: false + public get params() { + return this.getStringAttribute('params'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudDmsKafkaBackgroundTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaBackgroundTasksTasksOutputReference { + return new DataHuaweicloudDmsKafkaBackgroundTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks huaweicloud_dms_kafka_background_tasks} +*/ +export class DataHuaweicloudDmsKafkaBackgroundTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_background_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaBackgroundTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaBackgroundTasks to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaBackgroundTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaBackgroundTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_background_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_background_tasks huaweicloud_dms_kafka_background_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaBackgroundTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaBackgroundTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_background_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDmsKafkaBackgroundTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/README.md new file mode 100644 index 00000000..71ccc029 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_consumer_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_consumer_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/index.ts new file mode 100644 index 00000000..4981cfff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-consumer-groups/index.ts @@ -0,0 +1,712 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaConsumerGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the coordinator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#coordinator_id DataHuaweicloudDmsKafkaConsumerGroups#coordinator_id} + */ + readonly coordinatorId?: number; + /** + * Specifies the consumer group description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#description DataHuaweicloudDmsKafkaConsumerGroups#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#id DataHuaweicloudDmsKafkaConsumerGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#instance_id DataHuaweicloudDmsKafkaConsumerGroups#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the the number of accumulated messages. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#lag DataHuaweicloudDmsKafkaConsumerGroups#lag} + */ + readonly lag?: number; + /** + * Specifies the consumer group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#name DataHuaweicloudDmsKafkaConsumerGroups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#region DataHuaweicloudDmsKafkaConsumerGroups#region} + */ + readonly region?: string; + /** + * Specifies the consumer group status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#state DataHuaweicloudDmsKafkaConsumerGroups#state} + */ + readonly state?: string; +} +export interface DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsets { +} + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsToTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsToHclTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // lag - computed: true, optional: false, required: false + public get lag() { + return this.getNumberAttribute('lag'); + } + + // message_current_offset - computed: true, optional: false, required: false + public get messageCurrentOffset() { + return this.getNumberAttribute('message_current_offset'); + } + + // message_log_end_offset - computed: true, optional: false, required: false + public get messageLogEndOffset() { + return this.getNumberAttribute('message_log_end_offset'); + } + + // partition - computed: true, optional: false, required: false + public get partition() { + return this.getNumberAttribute('partition'); + } + + // topic - computed: true, optional: false, required: false + public get topic() { + return this.getStringAttribute('topic'); + } +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsOutputReference { + return new DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignment { +} + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentToTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentToHclTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignment | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignment | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // partitions - computed: true, optional: false, required: false + public get partitions() { + return this.getNumberListAttribute('partitions'); + } + + // topic - computed: true, optional: false, required: false + public get topic() { + return this.getStringAttribute('topic'); + } +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentOutputReference { + return new DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembers { +} + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersToTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersToHclTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // assignment - computed: true, optional: false, required: false + private _assignment = new DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersAssignmentList(this, "assignment", false); + public get assignment() { + return this._assignment; + } + + // client_id - computed: true, optional: false, required: false + public get clientId() { + return this.getStringAttribute('client_id'); + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // member_id - computed: true, optional: false, required: false + public get memberId() { + return this.getStringAttribute('member_id'); + } +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersOutputReference { + return new DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaConsumerGroupsGroups { +} + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsToTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaConsumerGroupsGroupsToHclTerraform(struct?: DataHuaweicloudDmsKafkaConsumerGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaConsumerGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaConsumerGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // assignment_strategy - computed: true, optional: false, required: false + public get assignmentStrategy() { + return this.getStringAttribute('assignment_strategy'); + } + + // coordinator_id - computed: true, optional: false, required: false + public get coordinatorId() { + return this.getNumberAttribute('coordinator_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // group_message_offsets - computed: true, optional: false, required: false + private _groupMessageOffsets = new DataHuaweicloudDmsKafkaConsumerGroupsGroupsGroupMessageOffsetsList(this, "group_message_offsets", false); + public get groupMessageOffsets() { + return this._groupMessageOffsets; + } + + // lag - computed: true, optional: false, required: false + public get lag() { + return this.getNumberAttribute('lag'); + } + + // members - computed: true, optional: false, required: false + private _members = new DataHuaweicloudDmsKafkaConsumerGroupsGroupsMembersList(this, "members", false); + public get members() { + return this._members; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } +} + +export class DataHuaweicloudDmsKafkaConsumerGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaConsumerGroupsGroupsOutputReference { + return new DataHuaweicloudDmsKafkaConsumerGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups huaweicloud_dms_kafka_consumer_groups} +*/ +export class DataHuaweicloudDmsKafkaConsumerGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_consumer_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaConsumerGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaConsumerGroups to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaConsumerGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaConsumerGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_consumer_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_consumer_groups huaweicloud_dms_kafka_consumer_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaConsumerGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaConsumerGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_consumer_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._coordinatorId = config.coordinatorId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._lag = config.lag; + this._name = config.name; + this._region = config.region; + this._state = config.state; + } + + // ========== + // ATTRIBUTES + // ========== + + // coordinator_id - computed: false, optional: true, required: false + private _coordinatorId?: number; + public get coordinatorId() { + return this.getNumberAttribute('coordinator_id'); + } + public set coordinatorId(value: number) { + this._coordinatorId = value; + } + public resetCoordinatorId() { + this._coordinatorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get coordinatorIdInput() { + return this._coordinatorId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudDmsKafkaConsumerGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lag - computed: false, optional: true, required: false + private _lag?: number; + public get lag() { + return this.getNumberAttribute('lag'); + } + public set lag(value: number) { + this._lag = value; + } + public resetLag() { + this._lag = undefined; + } + // Temporarily expose input value. Use with caution. + public get lagInput() { + return this._lag; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + coordinator_id: cdktf.numberToTerraform(this._coordinatorId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lag: cdktf.numberToTerraform(this._lag), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + state: cdktf.stringToTerraform(this._state), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + coordinator_id: { + value: cdktf.numberToHclTerraform(this._coordinatorId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lag: { + value: cdktf.numberToHclTerraform(this._lag), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/README.md new file mode 100644 index 00000000..810be162 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_extend_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_extend_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/index.ts new file mode 100644 index 00000000..57d544c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-extend-flavors/index.ts @@ -0,0 +1,713 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaExtendFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the type of CPU architecture, e.g. **X86**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#arch_type DataHuaweicloudDmsKafkaExtendFlavors#arch_type} + */ + readonly archType?: string; + /** + * Specifies the flavor billing mode. The valid values are **prePaid** and **postPaid**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#charging_mode DataHuaweicloudDmsKafkaExtendFlavors#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#id DataHuaweicloudDmsKafkaExtendFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#instance_id DataHuaweicloudDmsKafkaExtendFlavors#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#region DataHuaweicloudDmsKafkaExtendFlavors#region} + */ + readonly region?: string; + /** + * Specifies the disk IO encoding, e.g. **dms.physical.storage.high.v2**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#storage_spec_code DataHuaweicloudDmsKafkaExtendFlavors#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Specifies the flavor type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#type DataHuaweicloudDmsKafkaExtendFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIos { +} + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosToTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosToHclTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // available_zones - computed: true, optional: false, required: false + public get availableZones() { + return this.getListAttribute('available_zones'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailable_zones - computed: true, optional: false, required: false + public get unavailableZones() { + return this.getListAttribute('unavailable_zones'); + } +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosOutputReference { + return new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaExtendFlavorsFlavorsProperties { +} + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesToTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesToHclTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavor_alias - computed: true, optional: false, required: false + public get flavorAlias() { + return this.getStringAttribute('flavor_alias'); + } + + // max_bandwidth_per_broker - computed: true, optional: false, required: false + public get maxBandwidthPerBroker() { + return this.getStringAttribute('max_bandwidth_per_broker'); + } + + // max_broker - computed: true, optional: false, required: false + public get maxBroker() { + return this.getStringAttribute('max_broker'); + } + + // max_consumer_per_broker - computed: true, optional: false, required: false + public get maxConsumerPerBroker() { + return this.getStringAttribute('max_consumer_per_broker'); + } + + // max_partition_per_broker - computed: true, optional: false, required: false + public get maxPartitionPerBroker() { + return this.getStringAttribute('max_partition_per_broker'); + } + + // max_storage_per_node - computed: true, optional: false, required: false + public get maxStoragePerNode() { + return this.getStringAttribute('max_storage_per_node'); + } + + // max_tps_per_broker - computed: true, optional: false, required: false + public get maxTpsPerBroker() { + return this.getStringAttribute('max_tps_per_broker'); + } + + // min_broker - computed: true, optional: false, required: false + public get minBroker() { + return this.getStringAttribute('min_broker'); + } + + // min_storage_per_node - computed: true, optional: false, required: false + public get minStoragePerNode() { + return this.getStringAttribute('min_storage_per_node'); + } +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesOutputReference { + return new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeatures { +} + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesToTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesToHclTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new cdktf.StringMap(this, "properties"); + public get properties() { + return this._properties; + } +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesOutputReference { + return new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaExtendFlavorsFlavors { +} + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaExtendFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDmsKafkaExtendFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaExtendFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaExtendFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch_types - computed: true, optional: false, required: false + public get archTypes() { + return this.getListAttribute('arch_types'); + } + + // available_zones - computed: true, optional: false, required: false + public get availableZones() { + return this.getListAttribute('available_zones'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ios - computed: true, optional: false, required: false + private _ios = new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsIosList(this, "ios", false); + public get ios() { + return this._ios; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // support_features - computed: true, optional: false, required: false + private _supportFeatures = new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsSupportFeaturesList(this, "support_features", false); + public get supportFeatures() { + return this._supportFeatures; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailable_zones - computed: true, optional: false, required: false + public get unavailableZones() { + return this.getListAttribute('unavailable_zones'); + } + + // vm_specification - computed: true, optional: false, required: false + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } +} + +export class DataHuaweicloudDmsKafkaExtendFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaExtendFlavorsFlavorsOutputReference { + return new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors huaweicloud_dms_kafka_extend_flavors} +*/ +export class DataHuaweicloudDmsKafkaExtendFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_extend_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaExtendFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaExtendFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaExtendFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaExtendFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_extend_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_extend_flavors huaweicloud_dms_kafka_extend_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaExtendFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaExtendFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_extend_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._archType = config.archType; + this._chargingMode = config.chargingMode; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDmsKafkaExtendFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arch_type: cdktf.stringToTerraform(this._archType), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/README.md new file mode 100644 index 00000000..f374ffd3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/index.ts new file mode 100644 index 00000000..930b6802 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-flavors/index.ts @@ -0,0 +1,812 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#arch_type DataHuaweicloudDmsKafkaFlavors#arch_type} + */ + readonly archType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#availability_zones DataHuaweicloudDmsKafkaFlavors#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#charging_mode DataHuaweicloudDmsKafkaFlavors#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#flavor_id DataHuaweicloudDmsKafkaFlavors#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#id DataHuaweicloudDmsKafkaFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#region DataHuaweicloudDmsKafkaFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#storage_spec_code DataHuaweicloudDmsKafkaFlavors#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#type DataHuaweicloudDmsKafkaFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsKafkaFlavorsFlavorsIos { +} + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsIosToTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsIosToHclTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsIosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaFlavorsFlavorsIos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaFlavorsFlavorsIos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailability_zones - computed: true, optional: false, required: false + public get unavailabilityZones() { + return this.getListAttribute('unavailability_zones'); + } +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsIosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaFlavorsFlavorsIosOutputReference { + return new DataHuaweicloudDmsKafkaFlavorsFlavorsIosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaFlavorsFlavorsProperties { +} + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesToTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesToHclTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaFlavorsFlavorsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaFlavorsFlavorsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavor_alias - computed: true, optional: false, required: false + public get flavorAlias() { + return this.getStringAttribute('flavor_alias'); + } + + // max_bandwidth_per_broker - computed: true, optional: false, required: false + public get maxBandwidthPerBroker() { + return this.getNumberAttribute('max_bandwidth_per_broker'); + } + + // max_broker - computed: true, optional: false, required: false + public get maxBroker() { + return this.getNumberAttribute('max_broker'); + } + + // max_consumer_per_broker - computed: true, optional: false, required: false + public get maxConsumerPerBroker() { + return this.getNumberAttribute('max_consumer_per_broker'); + } + + // max_partition_per_broker - computed: true, optional: false, required: false + public get maxPartitionPerBroker() { + return this.getNumberAttribute('max_partition_per_broker'); + } + + // max_storage_per_node - computed: true, optional: false, required: false + public get maxStoragePerNode() { + return this.getNumberAttribute('max_storage_per_node'); + } + + // max_tps_per_broker - computed: true, optional: false, required: false + public get maxTpsPerBroker() { + return this.getNumberAttribute('max_tps_per_broker'); + } + + // min_broker - computed: true, optional: false, required: false + public get minBroker() { + return this.getNumberAttribute('min_broker'); + } + + // min_storage_per_node - computed: true, optional: false, required: false + public get minStoragePerNode() { + return this.getNumberAttribute('min_storage_per_node'); + } +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesOutputReference { + return new DataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesProperties { +} + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesToTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesToHclTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max_node - computed: true, optional: false, required: false + public get maxNode() { + return this.getNumberAttribute('max_node'); + } + + // max_task - computed: true, optional: false, required: false + public get maxTask() { + return this.getNumberAttribute('max_task'); + } + + // min_node - computed: true, optional: false, required: false + public get minNode() { + return this.getNumberAttribute('min_node'); + } + + // min_task - computed: true, optional: false, required: false + public get minTask() { + return this.getNumberAttribute('min_task'); + } +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesOutputReference { + return new DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeatures { +} + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesToTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesToHclTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesOutputReference { + return new DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaFlavorsFlavors { +} + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDmsKafkaFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch_types - computed: true, optional: false, required: false + public get archTypes() { + return this.getListAttribute('arch_types'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ios - computed: true, optional: false, required: false + private _ios = new DataHuaweicloudDmsKafkaFlavorsFlavorsIosList(this, "ios", false); + public get ios() { + return this._ios; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsKafkaFlavorsFlavorsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // support_features - computed: true, optional: false, required: false + private _supportFeatures = new DataHuaweicloudDmsKafkaFlavorsFlavorsSupportFeaturesList(this, "support_features", false); + public get supportFeatures() { + return this._supportFeatures; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vm_specification - computed: true, optional: false, required: false + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } +} + +export class DataHuaweicloudDmsKafkaFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaFlavorsFlavorsOutputReference { + return new DataHuaweicloudDmsKafkaFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors huaweicloud_dms_kafka_flavors} +*/ +export class DataHuaweicloudDmsKafkaFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_flavors huaweicloud_dms_kafka_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._archType = config.archType; + this._availabilityZones = config.availabilityZones; + this._chargingMode = config.chargingMode; + this._flavorId = config.flavorId; + this._id = config.id; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // availability_zones - computed: false, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDmsKafkaFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arch_type: cdktf.stringToTerraform(this._archType), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/README.md new file mode 100644 index 00000000..0d68b107 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/index.ts new file mode 100644 index 00000000..c888b289 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-instances/index.ts @@ -0,0 +1,675 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#enterprise_project_id DataHuaweicloudDmsKafkaInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#fuzzy_match DataHuaweicloudDmsKafkaInstances#fuzzy_match} + */ + readonly fuzzyMatch?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#id DataHuaweicloudDmsKafkaInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#include_failure DataHuaweicloudDmsKafkaInstances#include_failure} + */ + readonly includeFailure?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#instance_id DataHuaweicloudDmsKafkaInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#name DataHuaweicloudDmsKafkaInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#region DataHuaweicloudDmsKafkaInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#status DataHuaweicloudDmsKafkaInstances#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccesses { +} + +export function dataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesToTerraform(struct?: DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesToHclTerraform(struct?: DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advertised_ip - computed: true, optional: false, required: false + public get advertisedIp() { + return this.getStringAttribute('advertised_ip'); + } + + // lisenter_ip - computed: true, optional: false, required: false + public get lisenterIp() { + return this.getStringAttribute('lisenter_ip'); + } + + // listener_ip - computed: true, optional: false, required: false + public get listenerIp() { + return this.getStringAttribute('listener_ip'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } +} + +export class DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesOutputReference { + return new DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaInstancesInstances { +} + +export function dataHuaweicloudDmsKafkaInstancesInstancesToTerraform(struct?: DataHuaweicloudDmsKafkaInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDmsKafkaInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_user - computed: true, optional: false, required: false + public get accessUser() { + return this.getStringAttribute('access_user'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // connect_address - computed: true, optional: false, required: false + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + + // cross_vpc_accesses - computed: true, optional: false, required: false + private _crossVpcAccesses = new DataHuaweicloudDmsKafkaInstancesInstancesCrossVpcAccessesList(this, "cross_vpc_accesses", false); + public get crossVpcAccesses() { + return this._crossVpcAccesses; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dumping - computed: true, optional: false, required: false + public get dumping() { + return this.getBooleanAttribute('dumping'); + } + + // enable_auto_topic - computed: true, optional: false, required: false + public get enableAutoTopic() { + return this.getBooleanAttribute('enable_auto_topic'); + } + + // enable_public_ip - computed: true, optional: false, required: false + public get enablePublicIp() { + return this.getBooleanAttribute('enable_public_ip'); + } + + // enabled_mechanisms - computed: true, optional: false, required: false + public get enabledMechanisms() { + return cdktf.Fn.tolist(this.getListAttribute('enabled_mechanisms')); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // management_connect_address - computed: true, optional: false, required: false + public get managementConnectAddress() { + return this.getStringAttribute('management_connect_address'); + } + + // manager_user - computed: true, optional: false, required: false + public get managerUser() { + return this.getStringAttribute('manager_user'); + } + + // manegement_connect_address - computed: true, optional: false, required: false + public get manegementConnectAddress() { + return this.getStringAttribute('manegement_connect_address'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_id - computed: true, optional: false, required: false + public get networkId() { + return this.getStringAttribute('network_id'); + } + + // partition_num - computed: true, optional: false, required: false + public get partitionNum() { + return this.getNumberAttribute('partition_num'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // public_conn_addresses - computed: true, optional: false, required: false + public get publicConnAddresses() { + return this.getStringAttribute('public_conn_addresses'); + } + + // public_ip_ids - computed: true, optional: false, required: false + public get publicIpIds() { + return this.getListAttribute('public_ip_ids'); + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // retention_policy - computed: true, optional: false, required: false + public get retentionPolicy() { + return this.getStringAttribute('retention_policy'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // security_protocol - computed: true, optional: false, required: false + public get securityProtocol() { + return this.getStringAttribute('security_protocol'); + } + + // ssl_enable - computed: true, optional: false, required: false + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_space - computed: true, optional: false, required: false + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDmsKafkaInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaInstancesInstancesOutputReference { + return new DataHuaweicloudDmsKafkaInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances huaweicloud_dms_kafka_instances} +*/ +export class DataHuaweicloudDmsKafkaInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaInstances to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_instances huaweicloud_dms_kafka_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._fuzzyMatch = config.fuzzyMatch; + this._id = config.id; + this._includeFailure = config.includeFailure; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fuzzy_match - computed: false, optional: true, required: false + private _fuzzyMatch?: boolean | cdktf.IResolvable; + public get fuzzyMatch() { + return this.getBooleanAttribute('fuzzy_match'); + } + public set fuzzyMatch(value: boolean | cdktf.IResolvable) { + this._fuzzyMatch = value; + } + public resetFuzzyMatch() { + this._fuzzyMatch = undefined; + } + // Temporarily expose input value. Use with caution. + public get fuzzyMatchInput() { + return this._fuzzyMatch; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // include_failure - computed: false, optional: true, required: false + private _includeFailure?: boolean | cdktf.IResolvable; + public get includeFailure() { + return this.getBooleanAttribute('include_failure'); + } + public set includeFailure(value: boolean | cdktf.IResolvable) { + this._includeFailure = value; + } + public resetIncludeFailure() { + this._includeFailure = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeFailureInput() { + return this._includeFailure; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDmsKafkaInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fuzzy_match: cdktf.booleanToTerraform(this._fuzzyMatch), + id: cdktf.stringToTerraform(this._id), + include_failure: cdktf.booleanToTerraform(this._includeFailure), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fuzzy_match: { + value: cdktf.booleanToHclTerraform(this._fuzzyMatch), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + include_failure: { + value: cdktf.booleanToHclTerraform(this._includeFailure), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/README.md new file mode 100644 index 00000000..a62ae44f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_message_diagnosis_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_message_diagnosis_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/index.ts new file mode 100644 index 00000000..f6f42419 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-message-diagnosis-tasks/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaMessageDiagnosisTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks#id DataHuaweicloudDmsKafkaMessageDiagnosisTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the kafka instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks#instance_id DataHuaweicloudDmsKafkaMessageDiagnosisTasks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks#region DataHuaweicloudDmsKafkaMessageDiagnosisTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStruct { +} + +export function dataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructToTerraform(struct?: DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructToHclTerraform(struct?: DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // accumulated_partitions - computed: true, optional: false, required: false + public get accumulatedPartitions() { + return this.getNumberAttribute('accumulated_partitions'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // report_id - computed: true, optional: false, required: false + public get reportId() { + return this.getStringAttribute('report_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // topic_name - computed: true, optional: false, required: false + public get topicName() { + return this.getStringAttribute('topic_name'); + } +} + +export class DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructOutputReference { + return new DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks huaweicloud_dms_kafka_message_diagnosis_tasks} +*/ +export class DataHuaweicloudDmsKafkaMessageDiagnosisTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_message_diagnosis_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaMessageDiagnosisTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaMessageDiagnosisTasks to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaMessageDiagnosisTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaMessageDiagnosisTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_message_diagnosis_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_message_diagnosis_tasks huaweicloud_dms_kafka_message_diagnosis_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaMessageDiagnosisTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaMessageDiagnosisTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_message_diagnosis_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // report_list - computed: true, optional: false, required: false + private _reportList = new DataHuaweicloudDmsKafkaMessageDiagnosisTasksReportListStructList(this, "report_list", false); + public get reportList() { + return this._reportList; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/README.md new file mode 100644 index 00000000..32fb786d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_messages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_messages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/index.ts new file mode 100644 index 00000000..4e715362 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-messages/index.ts @@ -0,0 +1,506 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaMessagesConfig extends cdktf.TerraformMetaArguments { + /** + * Whether download is required. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#download DataHuaweicloudDmsKafkaMessages#download} + */ + readonly download?: boolean | cdktf.IResolvable; + /** + * Specifies the end time, a Unix timestamp in millisecond. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#end_time DataHuaweicloudDmsKafkaMessages#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#id DataHuaweicloudDmsKafkaMessages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#instance_id DataHuaweicloudDmsKafkaMessages#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the keyword. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#keyword DataHuaweicloudDmsKafkaMessages#keyword} + */ + readonly keyword?: string; + /** + * Specifies the message offset. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#message_offset DataHuaweicloudDmsKafkaMessages#message_offset} + */ + readonly messageOffset?: string; + /** + * Specifies the partition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#partition DataHuaweicloudDmsKafkaMessages#partition} + */ + readonly partition?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#region DataHuaweicloudDmsKafkaMessages#region} + */ + readonly region?: string; + /** + * Specifies the start time, a Unix timestamp in millisecond. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#start_time DataHuaweicloudDmsKafkaMessages#start_time} + */ + readonly startTime?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#topic DataHuaweicloudDmsKafkaMessages#topic} + */ + readonly topic: string; +} +export interface DataHuaweicloudDmsKafkaMessagesMessages { +} + +export function dataHuaweicloudDmsKafkaMessagesMessagesToTerraform(struct?: DataHuaweicloudDmsKafkaMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaMessagesMessagesToHclTerraform(struct?: DataHuaweicloudDmsKafkaMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaMessagesMessagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaMessagesMessages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaMessagesMessages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_id - computed: true, optional: false, required: false + public get appId() { + return this.getStringAttribute('app_id'); + } + + // huge_message - computed: true, optional: false, required: false + public get hugeMessage() { + return this.getBooleanAttribute('huge_message'); + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // message_id - computed: true, optional: false, required: false + public get messageId() { + return this.getStringAttribute('message_id'); + } + + // message_offset - computed: true, optional: false, required: false + public get messageOffset() { + return this.getNumberAttribute('message_offset'); + } + + // partition - computed: true, optional: false, required: false + public get partition() { + return this.getNumberAttribute('partition'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // tag - computed: true, optional: false, required: false + public get tag() { + return this.getStringAttribute('tag'); + } + + // timestamp - computed: true, optional: false, required: false + public get timestamp() { + return this.getStringAttribute('timestamp'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudDmsKafkaMessagesMessagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaMessagesMessagesOutputReference { + return new DataHuaweicloudDmsKafkaMessagesMessagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages huaweicloud_dms_kafka_messages} +*/ +export class DataHuaweicloudDmsKafkaMessages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_messages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaMessages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaMessages to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaMessages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaMessages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_messages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_messages huaweicloud_dms_kafka_messages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaMessagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaMessagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_messages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._download = config.download; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._keyword = config.keyword; + this._messageOffset = config.messageOffset; + this._partition = config.partition; + this._region = config.region; + this._startTime = config.startTime; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // download - computed: false, optional: true, required: false + private _download?: boolean | cdktf.IResolvable; + public get download() { + return this.getBooleanAttribute('download'); + } + public set download(value: boolean | cdktf.IResolvable) { + this._download = value; + } + public resetDownload() { + this._download = undefined; + } + // Temporarily expose input value. Use with caution. + public get downloadInput() { + return this._download; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keyword - computed: false, optional: true, required: false + private _keyword?: string; + public get keyword() { + return this.getStringAttribute('keyword'); + } + public set keyword(value: string) { + this._keyword = value; + } + public resetKeyword() { + this._keyword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordInput() { + return this._keyword; + } + + // message_offset - computed: false, optional: true, required: false + private _messageOffset?: string; + public get messageOffset() { + return this.getStringAttribute('message_offset'); + } + public set messageOffset(value: string) { + this._messageOffset = value; + } + public resetMessageOffset() { + this._messageOffset = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageOffsetInput() { + return this._messageOffset; + } + + // messages - computed: true, optional: false, required: false + private _messages = new DataHuaweicloudDmsKafkaMessagesMessagesList(this, "messages", false); + public get messages() { + return this._messages; + } + + // partition - computed: false, optional: true, required: false + private _partition?: string; + public get partition() { + return this.getStringAttribute('partition'); + } + public set partition(value: string) { + this._partition = value; + } + public resetPartition() { + this._partition = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionInput() { + return this._partition; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + download: cdktf.booleanToTerraform(this._download), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keyword: cdktf.stringToTerraform(this._keyword), + message_offset: cdktf.stringToTerraform(this._messageOffset), + partition: cdktf.stringToTerraform(this._partition), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + download: { + value: cdktf.booleanToHclTerraform(this._download), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keyword: { + value: cdktf.stringToHclTerraform(this._keyword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_offset: { + value: cdktf.stringToHclTerraform(this._messageOffset), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition: { + value: cdktf.stringToHclTerraform(this._partition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/README.md new file mode 100644 index 00000000..86a4e7ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_smart_connect_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_smart_connect_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/index.ts new file mode 100644 index 00000000..3d7fd6f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-smart-connect-tasks/index.ts @@ -0,0 +1,397 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaSmartConnectTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the connector ID of the kafka instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#connector_id DataHuaweicloudDmsKafkaSmartConnectTasks#connector_id} + */ + readonly connectorId: string; + /** + * Specifies the destination type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#destination_type DataHuaweicloudDmsKafkaSmartConnectTasks#destination_type} + */ + readonly destinationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#id DataHuaweicloudDmsKafkaSmartConnectTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#region DataHuaweicloudDmsKafkaSmartConnectTasks#region} + */ + readonly region?: string; + /** + * Specifies the status of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#status DataHuaweicloudDmsKafkaSmartConnectTasks#status} + */ + readonly status?: string; + /** + * Specifies the ID of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#task_id DataHuaweicloudDmsKafkaSmartConnectTasks#task_id} + */ + readonly taskId?: string; + /** + * Specifies the name of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#task_name DataHuaweicloudDmsKafkaSmartConnectTasks#task_name} + */ + readonly taskName?: string; +} +export interface DataHuaweicloudDmsKafkaSmartConnectTasksTasks { +} + +export function dataHuaweicloudDmsKafkaSmartConnectTasksTasksToTerraform(struct?: DataHuaweicloudDmsKafkaSmartConnectTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaSmartConnectTasksTasksToHclTerraform(struct?: DataHuaweicloudDmsKafkaSmartConnectTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaSmartConnectTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaSmartConnectTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaSmartConnectTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // destination_type - computed: true, optional: false, required: false + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // task_name - computed: true, optional: false, required: false + public get taskName() { + return this.getStringAttribute('task_name'); + } + + // topics - computed: true, optional: false, required: false + public get topics() { + return this.getStringAttribute('topics'); + } +} + +export class DataHuaweicloudDmsKafkaSmartConnectTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaSmartConnectTasksTasksOutputReference { + return new DataHuaweicloudDmsKafkaSmartConnectTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks huaweicloud_dms_kafka_smart_connect_tasks} +*/ +export class DataHuaweicloudDmsKafkaSmartConnectTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_smart_connect_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaSmartConnectTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaSmartConnectTasks to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaSmartConnectTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaSmartConnectTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_smart_connect_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_smart_connect_tasks huaweicloud_dms_kafka_smart_connect_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaSmartConnectTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaSmartConnectTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_smart_connect_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectorId = config.connectorId; + this._destinationType = config.destinationType; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._taskId = config.taskId; + this._taskName = config.taskName; + } + + // ========== + // ATTRIBUTES + // ========== + + // connector_id - computed: false, optional: false, required: true + private _connectorId?: string; + public get connectorId() { + return this.getStringAttribute('connector_id'); + } + public set connectorId(value: string) { + this._connectorId = value; + } + // Temporarily expose input value. Use with caution. + public get connectorIdInput() { + return this._connectorId; + } + + // destination_type - computed: false, optional: true, required: false + private _destinationType?: string; + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + public set destinationType(value: string) { + this._destinationType = value; + } + public resetDestinationType() { + this._destinationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationTypeInput() { + return this._destinationType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // task_id - computed: false, optional: true, required: false + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + public resetTaskId() { + this._taskId = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // task_name - computed: false, optional: true, required: false + private _taskName?: string; + public get taskName() { + return this.getStringAttribute('task_name'); + } + public set taskName(value: string) { + this._taskName = value; + } + public resetTaskName() { + this._taskName = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskNameInput() { + return this._taskName; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDmsKafkaSmartConnectTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connector_id: cdktf.stringToTerraform(this._connectorId), + destination_type: cdktf.stringToTerraform(this._destinationType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + task_id: cdktf.stringToTerraform(this._taskId), + task_name: cdktf.stringToTerraform(this._taskName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connector_id: { + value: cdktf.stringToHclTerraform(this._connectorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_type: { + value: cdktf.stringToHclTerraform(this._destinationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_name: { + value: cdktf.stringToHclTerraform(this._taskName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/README.md new file mode 100644 index 00000000..3fa6d31c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_topic_partitions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_topic_partitions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/index.ts new file mode 100644 index 00000000..00b032f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-partitions/index.ts @@ -0,0 +1,301 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaTopicPartitionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions#id DataHuaweicloudDmsKafkaTopicPartitions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions#instance_id DataHuaweicloudDmsKafkaTopicPartitions#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions#region DataHuaweicloudDmsKafkaTopicPartitions#region} + */ + readonly region?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions#topic DataHuaweicloudDmsKafkaTopicPartitions#topic} + */ + readonly topic: string; +} +export interface DataHuaweicloudDmsKafkaTopicPartitionsPartitions { +} + +export function dataHuaweicloudDmsKafkaTopicPartitionsPartitionsToTerraform(struct?: DataHuaweicloudDmsKafkaTopicPartitionsPartitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaTopicPartitionsPartitionsToHclTerraform(struct?: DataHuaweicloudDmsKafkaTopicPartitionsPartitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaTopicPartitionsPartitionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaTopicPartitionsPartitions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaTopicPartitionsPartitions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // last_offset - computed: true, optional: false, required: false + public get lastOffset() { + return this.getNumberAttribute('last_offset'); + } + + // last_update_time - computed: true, optional: false, required: false + public get lastUpdateTime() { + return this.getStringAttribute('last_update_time'); + } + + // message_count - computed: true, optional: false, required: false + public get messageCount() { + return this.getNumberAttribute('message_count'); + } + + // partition - computed: true, optional: false, required: false + public get partition() { + return this.getNumberAttribute('partition'); + } + + // start_offset - computed: true, optional: false, required: false + public get startOffset() { + return this.getNumberAttribute('start_offset'); + } +} + +export class DataHuaweicloudDmsKafkaTopicPartitionsPartitionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaTopicPartitionsPartitionsOutputReference { + return new DataHuaweicloudDmsKafkaTopicPartitionsPartitionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions huaweicloud_dms_kafka_topic_partitions} +*/ +export class DataHuaweicloudDmsKafkaTopicPartitions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_topic_partitions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaTopicPartitions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaTopicPartitions to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaTopicPartitions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaTopicPartitions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_topic_partitions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_partitions huaweicloud_dms_kafka_topic_partitions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaTopicPartitionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaTopicPartitionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_topic_partitions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // partitions - computed: true, optional: false, required: false + private _partitions = new DataHuaweicloudDmsKafkaTopicPartitionsPartitionsList(this, "partitions", false); + public get partitions() { + return this._partitions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/README.md new file mode 100644 index 00000000..fd53d020 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_topic_producers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_topic_producers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/index.ts new file mode 100644 index 00000000..0b23007c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topic-producers/index.ts @@ -0,0 +1,291 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaTopicProducersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers#id DataHuaweicloudDmsKafkaTopicProducers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers#instance_id DataHuaweicloudDmsKafkaTopicProducers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers#region DataHuaweicloudDmsKafkaTopicProducers#region} + */ + readonly region?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers#topic DataHuaweicloudDmsKafkaTopicProducers#topic} + */ + readonly topic: string; +} +export interface DataHuaweicloudDmsKafkaTopicProducersProducers { +} + +export function dataHuaweicloudDmsKafkaTopicProducersProducersToTerraform(struct?: DataHuaweicloudDmsKafkaTopicProducersProducers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaTopicProducersProducersToHclTerraform(struct?: DataHuaweicloudDmsKafkaTopicProducersProducers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaTopicProducersProducersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaTopicProducersProducers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaTopicProducersProducers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // broker_address - computed: true, optional: false, required: false + public get brokerAddress() { + return this.getStringAttribute('broker_address'); + } + + // join_time - computed: true, optional: false, required: false + public get joinTime() { + return this.getStringAttribute('join_time'); + } + + // producer_address - computed: true, optional: false, required: false + public get producerAddress() { + return this.getStringAttribute('producer_address'); + } +} + +export class DataHuaweicloudDmsKafkaTopicProducersProducersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaTopicProducersProducersOutputReference { + return new DataHuaweicloudDmsKafkaTopicProducersProducersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers huaweicloud_dms_kafka_topic_producers} +*/ +export class DataHuaweicloudDmsKafkaTopicProducers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_topic_producers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaTopicProducers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaTopicProducers to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaTopicProducers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaTopicProducers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_topic_producers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topic_producers huaweicloud_dms_kafka_topic_producers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaTopicProducersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaTopicProducersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_topic_producers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // producers - computed: true, optional: false, required: false + private _producers = new DataHuaweicloudDmsKafkaTopicProducersProducersList(this, "producers", false); + public get producers() { + return this._producers; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/README.md new file mode 100644 index 00000000..8473e41e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_topics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_topics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/index.ts new file mode 100644 index 00000000..70c43dae --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-topics/index.ts @@ -0,0 +1,430 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaTopicsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics#id DataHuaweicloudDmsKafkaTopics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the DMS kafka instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics#instance_id DataHuaweicloudDmsKafkaTopics#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics#name DataHuaweicloudDmsKafkaTopics#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics#region DataHuaweicloudDmsKafkaTopics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsKafkaTopicsTopicsConfigs { +} + +export function dataHuaweicloudDmsKafkaTopicsTopicsConfigsToTerraform(struct?: DataHuaweicloudDmsKafkaTopicsTopicsConfigs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaTopicsTopicsConfigsToHclTerraform(struct?: DataHuaweicloudDmsKafkaTopicsTopicsConfigs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaTopicsTopicsConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaTopicsTopicsConfigs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaTopicsTopicsConfigs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudDmsKafkaTopicsTopicsConfigsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaTopicsTopicsConfigsOutputReference { + return new DataHuaweicloudDmsKafkaTopicsTopicsConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkaTopicsTopics { +} + +export function dataHuaweicloudDmsKafkaTopicsTopicsToTerraform(struct?: DataHuaweicloudDmsKafkaTopicsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaTopicsTopicsToHclTerraform(struct?: DataHuaweicloudDmsKafkaTopicsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaTopicsTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaTopicsTopics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaTopicsTopics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // aging_time - computed: true, optional: false, required: false + public get agingTime() { + return this.getNumberAttribute('aging_time'); + } + + // configs - computed: true, optional: false, required: false + private _configs = new DataHuaweicloudDmsKafkaTopicsTopicsConfigsList(this, "configs", false); + public get configs() { + return this._configs; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // partitions - computed: true, optional: false, required: false + public get partitions() { + return this.getNumberAttribute('partitions'); + } + + // policies_only - computed: true, optional: false, required: false + public get policiesOnly() { + return this.getBooleanAttribute('policies_only'); + } + + // replicas - computed: true, optional: false, required: false + public get replicas() { + return this.getNumberAttribute('replicas'); + } + + // sync_flushing - computed: true, optional: false, required: false + public get syncFlushing() { + return this.getBooleanAttribute('sync_flushing'); + } + + // sync_replication - computed: true, optional: false, required: false + public get syncReplication() { + return this.getBooleanAttribute('sync_replication'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDmsKafkaTopicsTopicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaTopicsTopicsOutputReference { + return new DataHuaweicloudDmsKafkaTopicsTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics huaweicloud_dms_kafka_topics} +*/ +export class DataHuaweicloudDmsKafkaTopics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_topics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaTopics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaTopics to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaTopics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaTopics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_topics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_topics huaweicloud_dms_kafka_topics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaTopicsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaTopicsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_topics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // max_partitions - computed: true, optional: false, required: false + public get maxPartitions() { + return this.getNumberAttribute('max_partitions'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remain_partitions - computed: true, optional: false, required: false + public get remainPartitions() { + return this.getNumberAttribute('remain_partitions'); + } + + // topic_max_partitions - computed: true, optional: false, required: false + public get topicMaxPartitions() { + return this.getNumberAttribute('topic_max_partitions'); + } + + // topics - computed: true, optional: false, required: false + private _topics = new DataHuaweicloudDmsKafkaTopicsTopicsList(this, "topics", false); + public get topics() { + return this._topics; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/README.md new file mode 100644 index 00000000..0dd45e70 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_user_client_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_user_client_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/index.ts new file mode 100644 index 00000000..70ca252c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-user-client-quotas/index.ts @@ -0,0 +1,339 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaUserClientQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the client ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas#client DataHuaweicloudDmsKafkaUserClientQuotas#client} + */ + readonly client?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas#id DataHuaweicloudDmsKafkaUserClientQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas#instance_id DataHuaweicloudDmsKafkaUserClientQuotas#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas#region DataHuaweicloudDmsKafkaUserClientQuotas#region} + */ + readonly region?: string; + /** + * Specifies the user name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas#user DataHuaweicloudDmsKafkaUserClientQuotas#user} + */ + readonly user?: string; +} +export interface DataHuaweicloudDmsKafkaUserClientQuotasQuotas { +} + +export function dataHuaweicloudDmsKafkaUserClientQuotasQuotasToTerraform(struct?: DataHuaweicloudDmsKafkaUserClientQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaUserClientQuotasQuotasToHclTerraform(struct?: DataHuaweicloudDmsKafkaUserClientQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaUserClientQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaUserClientQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaUserClientQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client - computed: true, optional: false, required: false + public get client() { + return this.getStringAttribute('client'); + } + + // client_default - computed: true, optional: false, required: false + public get clientDefault() { + return this.getBooleanAttribute('client_default'); + } + + // consumer_byte_rate - computed: true, optional: false, required: false + public get consumerByteRate() { + return this.getNumberAttribute('consumer_byte_rate'); + } + + // producer_byte_rate - computed: true, optional: false, required: false + public get producerByteRate() { + return this.getNumberAttribute('producer_byte_rate'); + } + + // user - computed: true, optional: false, required: false + public get user() { + return this.getStringAttribute('user'); + } + + // user_default - computed: true, optional: false, required: false + public get userDefault() { + return this.getBooleanAttribute('user_default'); + } +} + +export class DataHuaweicloudDmsKafkaUserClientQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaUserClientQuotasQuotasOutputReference { + return new DataHuaweicloudDmsKafkaUserClientQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas huaweicloud_dms_kafka_user_client_quotas} +*/ +export class DataHuaweicloudDmsKafkaUserClientQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_user_client_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaUserClientQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaUserClientQuotas to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaUserClientQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaUserClientQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_user_client_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_user_client_quotas huaweicloud_dms_kafka_user_client_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaUserClientQuotasConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaUserClientQuotasConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_user_client_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._client = config.client; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._user = config.user; + } + + // ========== + // ATTRIBUTES + // ========== + + // client - computed: false, optional: true, required: false + private _client?: string; + public get client() { + return this.getStringAttribute('client'); + } + public set client(value: string) { + this._client = value; + } + public resetClient() { + this._client = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientInput() { + return this._client; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudDmsKafkaUserClientQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + client: cdktf.stringToTerraform(this._client), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + user: cdktf.stringToTerraform(this._user), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + client: { + value: cdktf.stringToHclTerraform(this._client), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(this._user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/README.md new file mode 100644 index 00000000..3274b10a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafka_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafka_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/index.ts new file mode 100644 index 00000000..24bce58d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafka-users/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkaUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the user description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users#description DataHuaweicloudDmsKafkaUsers#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users#id DataHuaweicloudDmsKafkaUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users#instance_id DataHuaweicloudDmsKafkaUsers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the user name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users#name DataHuaweicloudDmsKafkaUsers#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users#region DataHuaweicloudDmsKafkaUsers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsKafkaUsersUsers { +} + +export function dataHuaweicloudDmsKafkaUsersUsersToTerraform(struct?: DataHuaweicloudDmsKafkaUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkaUsersUsersToHclTerraform(struct?: DataHuaweicloudDmsKafkaUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkaUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkaUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkaUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_app - computed: true, optional: false, required: false + public get defaultApp() { + return this.getBooleanAttribute('default_app'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } +} + +export class DataHuaweicloudDmsKafkaUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkaUsersUsersOutputReference { + return new DataHuaweicloudDmsKafkaUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users huaweicloud_dms_kafka_users} +*/ +export class DataHuaweicloudDmsKafkaUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkaUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkaUsers to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkaUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkaUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafka_users huaweicloud_dms_kafka_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkaUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkaUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudDmsKafkaUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/README.md new file mode 100644 index 00000000..0234045d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_kafkav2_smart_connect_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_kafkav2_smart_connect_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/index.ts new file mode 100644 index 00000000..04d0820d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-kafkav2-smart-connect-tasks/index.ts @@ -0,0 +1,601 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsKafkav2SmartConnectTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks#id DataHuaweicloudDmsKafkav2SmartConnectTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the kafka instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks#instance_id DataHuaweicloudDmsKafkav2SmartConnectTasks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks#region DataHuaweicloudDmsKafkav2SmartConnectTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTask { +} + +export function dataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskToTerraform(struct?: DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskToHclTerraform(struct?: DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTask | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTask | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // consumer_strategy - computed: true, optional: false, required: false + public get consumerStrategy() { + return this.getStringAttribute('consumer_strategy'); + } + + // deliver_time_interval - computed: true, optional: false, required: false + public get deliverTimeInterval() { + return this.getNumberAttribute('deliver_time_interval'); + } + + // destination_file_type - computed: true, optional: false, required: false + public get destinationFileType() { + return this.getStringAttribute('destination_file_type'); + } + + // flush_size - computed: true, optional: false, required: false + public get flushSize() { + return this.getNumberAttribute('flush_size'); + } + + // key_converter - computed: true, optional: false, required: false + public get keyConverter() { + return this.getStringAttribute('key_converter'); + } + + // kv_delimiter - computed: true, optional: false, required: false + public get kvDelimiter() { + return this.getStringAttribute('kv_delimiter'); + } + + // obs_bucket_name - computed: true, optional: false, required: false + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + + // obs_part_size - computed: true, optional: false, required: false + public get obsPartSize() { + return this.getNumberAttribute('obs_part_size'); + } + + // obs_path - computed: true, optional: false, required: false + public get obsPath() { + return this.getStringAttribute('obs_path'); + } + + // partition_format - computed: true, optional: false, required: false + public get partitionFormat() { + return this.getStringAttribute('partition_format'); + } + + // partitioner_class - computed: true, optional: false, required: false + public get partitionerClass() { + return this.getStringAttribute('partitioner_class'); + } + + // record_delimiter - computed: true, optional: false, required: false + public get recordDelimiter() { + return this.getStringAttribute('record_delimiter'); + } + + // schema_generator_class - computed: true, optional: false, required: false + public get schemaGeneratorClass() { + return this.getStringAttribute('schema_generator_class'); + } + + // store_keys - computed: true, optional: false, required: false + public get storeKeys() { + return this.getBooleanAttribute('store_keys'); + } + + // timezone - computed: true, optional: false, required: false + public get timezone() { + return this.getStringAttribute('timezone'); + } + + // value_converter - computed: true, optional: false, required: false + public get valueConverter() { + return this.getStringAttribute('value_converter'); + } +} + +export class DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskOutputReference { + return new DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTask { +} + +export function dataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskToTerraform(struct?: DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskToHclTerraform(struct?: DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTask | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTask | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compression_type - computed: true, optional: false, required: false + public get compressionType() { + return this.getStringAttribute('compression_type'); + } + + // consumer_strategy - computed: true, optional: false, required: false + public get consumerStrategy() { + return this.getStringAttribute('consumer_strategy'); + } + + // current_instance_alias - computed: true, optional: false, required: false + public get currentInstanceAlias() { + return this.getStringAttribute('current_instance_alias'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // peer_instance_address - computed: true, optional: false, required: false + public get peerInstanceAddress() { + return this.getListAttribute('peer_instance_address'); + } + + // peer_instance_alias - computed: true, optional: false, required: false + public get peerInstanceAlias() { + return this.getStringAttribute('peer_instance_alias'); + } + + // peer_instance_id - computed: true, optional: false, required: false + public get peerInstanceId() { + return this.getStringAttribute('peer_instance_id'); + } + + // provenance_header_enabled - computed: true, optional: false, required: false + public get provenanceHeaderEnabled() { + return this.getBooleanAttribute('provenance_header_enabled'); + } + + // rename_topic_enabled - computed: true, optional: false, required: false + public get renameTopicEnabled() { + return this.getBooleanAttribute('rename_topic_enabled'); + } + + // replication_factor - computed: true, optional: false, required: false + public get replicationFactor() { + return this.getNumberAttribute('replication_factor'); + } + + // sasl_mechanism - computed: true, optional: false, required: false + public get saslMechanism() { + return this.getStringAttribute('sasl_mechanism'); + } + + // security_protocol - computed: true, optional: false, required: false + public get securityProtocol() { + return this.getStringAttribute('security_protocol'); + } + + // sync_consumer_offsets_enabled - computed: true, optional: false, required: false + public get syncConsumerOffsetsEnabled() { + return this.getBooleanAttribute('sync_consumer_offsets_enabled'); + } + + // task_num - computed: true, optional: false, required: false + public get taskNum() { + return this.getNumberAttribute('task_num'); + } + + // topics_mapping - computed: true, optional: false, required: false + public get topicsMapping() { + return this.getListAttribute('topics_mapping'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskOutputReference { + return new DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsKafkav2SmartConnectTasksTasks { +} + +export function dataHuaweicloudDmsKafkav2SmartConnectTasksTasksToTerraform(struct?: DataHuaweicloudDmsKafkav2SmartConnectTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsKafkav2SmartConnectTasksTasksToHclTerraform(struct?: DataHuaweicloudDmsKafkav2SmartConnectTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsKafkav2SmartConnectTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsKafkav2SmartConnectTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsKafkav2SmartConnectTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // destination_task - computed: true, optional: false, required: false + private _destinationTask = new DataHuaweicloudDmsKafkav2SmartConnectTasksTasksDestinationTaskList(this, "destination_task", false); + public get destinationTask() { + return this._destinationTask; + } + + // destination_type - computed: true, optional: false, required: false + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // source_task - computed: true, optional: false, required: false + private _sourceTask = new DataHuaweicloudDmsKafkav2SmartConnectTasksTasksSourceTaskList(this, "source_task", false); + public get sourceTask() { + return this._sourceTask; + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getStringAttribute('source_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // task_name - computed: true, optional: false, required: false + public get taskName() { + return this.getStringAttribute('task_name'); + } + + // topics - computed: true, optional: false, required: false + public get topics() { + return this.getListAttribute('topics'); + } + + // topics_regex - computed: true, optional: false, required: false + public get topicsRegex() { + return this.getStringAttribute('topics_regex'); + } +} + +export class DataHuaweicloudDmsKafkav2SmartConnectTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsKafkav2SmartConnectTasksTasksOutputReference { + return new DataHuaweicloudDmsKafkav2SmartConnectTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks huaweicloud_dms_kafkav2_smart_connect_tasks} +*/ +export class DataHuaweicloudDmsKafkav2SmartConnectTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafkav2_smart_connect_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsKafkav2SmartConnectTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsKafkav2SmartConnectTasks to import + * @param importFromId The id of the existing DataHuaweicloudDmsKafkav2SmartConnectTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsKafkav2SmartConnectTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafkav2_smart_connect_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_kafkav2_smart_connect_tasks huaweicloud_dms_kafkav2_smart_connect_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsKafkav2SmartConnectTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsKafkav2SmartConnectTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafkav2_smart_connect_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDmsKafkav2SmartConnectTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/README.md new file mode 100644 index 00000000..01a255ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_maintainwindow_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_maintainwindow_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/index.ts new file mode 100644 index 00000000..41631d3e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow-v1/index.ts @@ -0,0 +1,256 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsMaintainwindowV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#begin DataHuaweicloudDmsMaintainwindowV1#begin} + */ + readonly begin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#default DataHuaweicloudDmsMaintainwindowV1#default} + */ + readonly default?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#end DataHuaweicloudDmsMaintainwindowV1#end} + */ + readonly end?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#id DataHuaweicloudDmsMaintainwindowV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#region DataHuaweicloudDmsMaintainwindowV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#seq DataHuaweicloudDmsMaintainwindowV1#seq} + */ + readonly seq?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1 huaweicloud_dms_maintainwindow_v1} +*/ +export class DataHuaweicloudDmsMaintainwindowV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_maintainwindow_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsMaintainwindowV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsMaintainwindowV1 to import + * @param importFromId The id of the existing DataHuaweicloudDmsMaintainwindowV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsMaintainwindowV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_maintainwindow_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow_v1 huaweicloud_dms_maintainwindow_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsMaintainwindowV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsMaintainwindowV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_maintainwindow_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._begin = config.begin; + this._default = config.default; + this._end = config.end; + this._id = config.id; + this._region = config.region; + this._seq = config.seq; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin - computed: true, optional: true, required: false + private _begin?: string; + public get begin() { + return this.getStringAttribute('begin'); + } + public set begin(value: string) { + this._begin = value; + } + public resetBegin() { + this._begin = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginInput() { + return this._begin; + } + + // default - computed: true, optional: true, required: false + private _default?: boolean | cdktf.IResolvable; + public get default() { + return this.getBooleanAttribute('default'); + } + public set default(value: boolean | cdktf.IResolvable) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // end - computed: true, optional: true, required: false + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + public resetEnd() { + this._end = undefined; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // seq - computed: true, optional: true, required: false + private _seq?: number; + public get seq() { + return this.getNumberAttribute('seq'); + } + public set seq(value: number) { + this._seq = value; + } + public resetSeq() { + this._seq = undefined; + } + // Temporarily expose input value. Use with caution. + public get seqInput() { + return this._seq; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin: cdktf.stringToTerraform(this._begin), + default: cdktf.booleanToTerraform(this._default), + end: cdktf.stringToTerraform(this._end), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + seq: cdktf.numberToTerraform(this._seq), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin: { + value: cdktf.stringToHclTerraform(this._begin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default: { + value: cdktf.booleanToHclTerraform(this._default), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end: { + value: cdktf.stringToHclTerraform(this._end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + seq: { + value: cdktf.numberToHclTerraform(this._seq), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/README.md new file mode 100644 index 00000000..7df2be4e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_maintainwindow` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_maintainwindow`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/index.ts new file mode 100644 index 00000000..9baf8dcb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-maintainwindow/index.ts @@ -0,0 +1,256 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsMaintainwindowConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#begin DataHuaweicloudDmsMaintainwindow#begin} + */ + readonly begin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#default DataHuaweicloudDmsMaintainwindow#default} + */ + readonly default?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#end DataHuaweicloudDmsMaintainwindow#end} + */ + readonly end?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#id DataHuaweicloudDmsMaintainwindow#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#region DataHuaweicloudDmsMaintainwindow#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#seq DataHuaweicloudDmsMaintainwindow#seq} + */ + readonly seq?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow huaweicloud_dms_maintainwindow} +*/ +export class DataHuaweicloudDmsMaintainwindow extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_maintainwindow"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsMaintainwindow resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsMaintainwindow to import + * @param importFromId The id of the existing DataHuaweicloudDmsMaintainwindow that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsMaintainwindow to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_maintainwindow", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_maintainwindow huaweicloud_dms_maintainwindow} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsMaintainwindowConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsMaintainwindowConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_maintainwindow', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._begin = config.begin; + this._default = config.default; + this._end = config.end; + this._id = config.id; + this._region = config.region; + this._seq = config.seq; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin - computed: true, optional: true, required: false + private _begin?: string; + public get begin() { + return this.getStringAttribute('begin'); + } + public set begin(value: string) { + this._begin = value; + } + public resetBegin() { + this._begin = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginInput() { + return this._begin; + } + + // default - computed: true, optional: true, required: false + private _default?: boolean | cdktf.IResolvable; + public get default() { + return this.getBooleanAttribute('default'); + } + public set default(value: boolean | cdktf.IResolvable) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // end - computed: true, optional: true, required: false + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + public resetEnd() { + this._end = undefined; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // seq - computed: true, optional: true, required: false + private _seq?: number; + public get seq() { + return this.getNumberAttribute('seq'); + } + public set seq(value: number) { + this._seq = value; + } + public resetSeq() { + this._seq = undefined; + } + // Temporarily expose input value. Use with caution. + public get seqInput() { + return this._seq; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin: cdktf.stringToTerraform(this._begin), + default: cdktf.booleanToTerraform(this._default), + end: cdktf.stringToTerraform(this._end), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + seq: cdktf.numberToTerraform(this._seq), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin: { + value: cdktf.stringToHclTerraform(this._begin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default: { + value: cdktf.booleanToHclTerraform(this._default), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end: { + value: cdktf.stringToHclTerraform(this._end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + seq: { + value: cdktf.numberToHclTerraform(this._seq), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/README.md new file mode 100644 index 00000000..b5a6fd64 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_product_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_product_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/index.ts new file mode 100644 index 00000000..22c0dcc9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product-v1/index.ts @@ -0,0 +1,451 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsProductV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#availability_zones DataHuaweicloudDmsProductV1#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#bandwidth DataHuaweicloudDmsProductV1#bandwidth} + */ + readonly bandwidth?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#engine DataHuaweicloudDmsProductV1#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#id DataHuaweicloudDmsProductV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#instance_type DataHuaweicloudDmsProductV1#instance_type} + */ + readonly instanceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#io_type DataHuaweicloudDmsProductV1#io_type} + */ + readonly ioType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#node_num DataHuaweicloudDmsProductV1#node_num} + */ + readonly nodeNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#partition_num DataHuaweicloudDmsProductV1#partition_num} + */ + readonly partitionNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#region DataHuaweicloudDmsProductV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#storage DataHuaweicloudDmsProductV1#storage} + */ + readonly storage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#storage_spec_code DataHuaweicloudDmsProductV1#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#version DataHuaweicloudDmsProductV1#version} + */ + readonly version?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#vm_specification DataHuaweicloudDmsProductV1#vm_specification} + */ + readonly vmSpecification?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1 huaweicloud_dms_product_v1} +*/ +export class DataHuaweicloudDmsProductV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_product_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsProductV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsProductV1 to import + * @param importFromId The id of the existing DataHuaweicloudDmsProductV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsProductV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_product_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product_v1 huaweicloud_dms_product_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsProductV1Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsProductV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_product_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZones = config.availabilityZones; + this._bandwidth = config.bandwidth; + this._engine = config.engine; + this._id = config.id; + this._instanceType = config.instanceType; + this._ioType = config.ioType; + this._nodeNum = config.nodeNum; + this._partitionNum = config.partitionNum; + this._region = config.region; + this._storage = config.storage; + this._storageSpecCode = config.storageSpecCode; + this._version = config.version; + this._vmSpecification = config.vmSpecification; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // bandwidth - computed: true, optional: true, required: false + private _bandwidth?: string; + public get bandwidth() { + return this.getStringAttribute('bandwidth'); + } + public set bandwidth(value: string) { + this._bandwidth = value; + } + public resetBandwidth() { + this._bandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_type - computed: false, optional: false, required: true + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // io_type - computed: true, optional: true, required: false + private _ioType?: string; + public get ioType() { + return this.getStringAttribute('io_type'); + } + public set ioType(value: string) { + this._ioType = value; + } + public resetIoType() { + this._ioType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ioTypeInput() { + return this._ioType; + } + + // node_num - computed: true, optional: true, required: false + private _nodeNum?: string; + public get nodeNum() { + return this.getStringAttribute('node_num'); + } + public set nodeNum(value: string) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // partition_num - computed: true, optional: true, required: false + private _partitionNum?: string; + public get partitionNum() { + return this.getStringAttribute('partition_num'); + } + public set partitionNum(value: string) { + this._partitionNum = value; + } + public resetPartitionNum() { + this._partitionNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionNumInput() { + return this._partitionNum; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage - computed: true, optional: true, required: false + private _storage?: string; + public get storage() { + return this.getStringAttribute('storage'); + } + public set storage(value: string) { + this._storage = value; + } + public resetStorage() { + this._storage = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage; + } + + // storage_spec_code - computed: true, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // storage_spec_codes - computed: true, optional: false, required: false + public get storageSpecCodes() { + return this.getListAttribute('storage_spec_codes'); + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vm_specification - computed: true, optional: true, required: false + private _vmSpecification?: string; + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } + public set vmSpecification(value: string) { + this._vmSpecification = value; + } + public resetVmSpecification() { + this._vmSpecification = undefined; + } + // Temporarily expose input value. Use with caution. + public get vmSpecificationInput() { + return this._vmSpecification; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + bandwidth: cdktf.stringToTerraform(this._bandwidth), + engine: cdktf.stringToTerraform(this._engine), + id: cdktf.stringToTerraform(this._id), + instance_type: cdktf.stringToTerraform(this._instanceType), + io_type: cdktf.stringToTerraform(this._ioType), + node_num: cdktf.stringToTerraform(this._nodeNum), + partition_num: cdktf.stringToTerraform(this._partitionNum), + region: cdktf.stringToTerraform(this._region), + storage: cdktf.stringToTerraform(this._storage), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + version: cdktf.stringToTerraform(this._version), + vm_specification: cdktf.stringToTerraform(this._vmSpecification), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + bandwidth: { + value: cdktf.stringToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + io_type: { + value: cdktf.stringToHclTerraform(this._ioType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.stringToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_num: { + value: cdktf.stringToHclTerraform(this._partitionNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage: { + value: cdktf.stringToHclTerraform(this._storage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vm_specification: { + value: cdktf.stringToHclTerraform(this._vmSpecification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/README.md new file mode 100644 index 00000000..b6c9d2b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_product` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_product`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/index.ts new file mode 100644 index 00000000..05fe76dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-product/index.ts @@ -0,0 +1,451 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsProductConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#availability_zones DataHuaweicloudDmsProduct#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#bandwidth DataHuaweicloudDmsProduct#bandwidth} + */ + readonly bandwidth?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#engine DataHuaweicloudDmsProduct#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#id DataHuaweicloudDmsProduct#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#instance_type DataHuaweicloudDmsProduct#instance_type} + */ + readonly instanceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#io_type DataHuaweicloudDmsProduct#io_type} + */ + readonly ioType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#node_num DataHuaweicloudDmsProduct#node_num} + */ + readonly nodeNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#partition_num DataHuaweicloudDmsProduct#partition_num} + */ + readonly partitionNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#region DataHuaweicloudDmsProduct#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#storage DataHuaweicloudDmsProduct#storage} + */ + readonly storage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#storage_spec_code DataHuaweicloudDmsProduct#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#version DataHuaweicloudDmsProduct#version} + */ + readonly version?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#vm_specification DataHuaweicloudDmsProduct#vm_specification} + */ + readonly vmSpecification?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product huaweicloud_dms_product} +*/ +export class DataHuaweicloudDmsProduct extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_product"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsProduct resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsProduct to import + * @param importFromId The id of the existing DataHuaweicloudDmsProduct that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsProduct to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_product", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_product huaweicloud_dms_product} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsProductConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsProductConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_product', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZones = config.availabilityZones; + this._bandwidth = config.bandwidth; + this._engine = config.engine; + this._id = config.id; + this._instanceType = config.instanceType; + this._ioType = config.ioType; + this._nodeNum = config.nodeNum; + this._partitionNum = config.partitionNum; + this._region = config.region; + this._storage = config.storage; + this._storageSpecCode = config.storageSpecCode; + this._version = config.version; + this._vmSpecification = config.vmSpecification; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // bandwidth - computed: true, optional: true, required: false + private _bandwidth?: string; + public get bandwidth() { + return this.getStringAttribute('bandwidth'); + } + public set bandwidth(value: string) { + this._bandwidth = value; + } + public resetBandwidth() { + this._bandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_type - computed: false, optional: false, required: true + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // io_type - computed: true, optional: true, required: false + private _ioType?: string; + public get ioType() { + return this.getStringAttribute('io_type'); + } + public set ioType(value: string) { + this._ioType = value; + } + public resetIoType() { + this._ioType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ioTypeInput() { + return this._ioType; + } + + // node_num - computed: true, optional: true, required: false + private _nodeNum?: string; + public get nodeNum() { + return this.getStringAttribute('node_num'); + } + public set nodeNum(value: string) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // partition_num - computed: true, optional: true, required: false + private _partitionNum?: string; + public get partitionNum() { + return this.getStringAttribute('partition_num'); + } + public set partitionNum(value: string) { + this._partitionNum = value; + } + public resetPartitionNum() { + this._partitionNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionNumInput() { + return this._partitionNum; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage - computed: true, optional: true, required: false + private _storage?: string; + public get storage() { + return this.getStringAttribute('storage'); + } + public set storage(value: string) { + this._storage = value; + } + public resetStorage() { + this._storage = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage; + } + + // storage_spec_code - computed: true, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // storage_spec_codes - computed: true, optional: false, required: false + public get storageSpecCodes() { + return this.getListAttribute('storage_spec_codes'); + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vm_specification - computed: true, optional: true, required: false + private _vmSpecification?: string; + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } + public set vmSpecification(value: string) { + this._vmSpecification = value; + } + public resetVmSpecification() { + this._vmSpecification = undefined; + } + // Temporarily expose input value. Use with caution. + public get vmSpecificationInput() { + return this._vmSpecification; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + bandwidth: cdktf.stringToTerraform(this._bandwidth), + engine: cdktf.stringToTerraform(this._engine), + id: cdktf.stringToTerraform(this._id), + instance_type: cdktf.stringToTerraform(this._instanceType), + io_type: cdktf.stringToTerraform(this._ioType), + node_num: cdktf.stringToTerraform(this._nodeNum), + partition_num: cdktf.stringToTerraform(this._partitionNum), + region: cdktf.stringToTerraform(this._region), + storage: cdktf.stringToTerraform(this._storage), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + version: cdktf.stringToTerraform(this._version), + vm_specification: cdktf.stringToTerraform(this._vmSpecification), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + bandwidth: { + value: cdktf.stringToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + io_type: { + value: cdktf.stringToHclTerraform(this._ioType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.stringToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_num: { + value: cdktf.stringToHclTerraform(this._partitionNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage: { + value: cdktf.stringToHclTerraform(this._storage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vm_specification: { + value: cdktf.stringToHclTerraform(this._vmSpecification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/README.md new file mode 100644 index 00000000..d8b832c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_background_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_background_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/index.ts new file mode 100644 index 00000000..b8ef3345 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-background-tasks/index.ts @@ -0,0 +1,349 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqBackgroundTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the time of task where the query starts. The format is YYYYMMDDHHmmss. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks#begin_time DataHuaweicloudDmsRabbitmqBackgroundTasks#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the time of task where the query ends. The format is YYYYMMDDHHmmss. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks#end_time DataHuaweicloudDmsRabbitmqBackgroundTasks#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks#id DataHuaweicloudDmsRabbitmqBackgroundTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks#instance_id DataHuaweicloudDmsRabbitmqBackgroundTasks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks#region DataHuaweicloudDmsRabbitmqBackgroundTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsRabbitmqBackgroundTasksTasks { +} + +export function dataHuaweicloudDmsRabbitmqBackgroundTasksTasksToTerraform(struct?: DataHuaweicloudDmsRabbitmqBackgroundTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqBackgroundTasksTasksToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqBackgroundTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqBackgroundTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqBackgroundTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqBackgroundTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // params - computed: true, optional: false, required: false + public get params() { + return this.getStringAttribute('params'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudDmsRabbitmqBackgroundTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqBackgroundTasksTasksOutputReference { + return new DataHuaweicloudDmsRabbitmqBackgroundTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks huaweicloud_dms_rabbitmq_background_tasks} +*/ +export class DataHuaweicloudDmsRabbitmqBackgroundTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_background_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqBackgroundTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqBackgroundTasks to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqBackgroundTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqBackgroundTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_background_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_background_tasks huaweicloud_dms_rabbitmq_background_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqBackgroundTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqBackgroundTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_background_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDmsRabbitmqBackgroundTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/README.md new file mode 100644 index 00000000..afc6766a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_exchanges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_exchanges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/index.ts new file mode 100644 index 00000000..6844310a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-exchanges/index.ts @@ -0,0 +1,300 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqExchangesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges#id DataHuaweicloudDmsRabbitmqExchanges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges#instance_id DataHuaweicloudDmsRabbitmqExchanges#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges#region DataHuaweicloudDmsRabbitmqExchanges#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges#vhost DataHuaweicloudDmsRabbitmqExchanges#vhost} + */ + readonly vhost: string; +} +export interface DataHuaweicloudDmsRabbitmqExchangesExchanges { +} + +export function dataHuaweicloudDmsRabbitmqExchangesExchangesToTerraform(struct?: DataHuaweicloudDmsRabbitmqExchangesExchanges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqExchangesExchangesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqExchangesExchanges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqExchangesExchangesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqExchangesExchanges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqExchangesExchanges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_delete - computed: true, optional: false, required: false + public get autoDelete() { + return this.getBooleanAttribute('auto_delete'); + } + + // default - computed: true, optional: false, required: false + public get default() { + return this.getBooleanAttribute('default'); + } + + // durable - computed: true, optional: false, required: false + public get durable() { + return this.getBooleanAttribute('durable'); + } + + // internal - computed: true, optional: false, required: false + public get internal() { + return this.getBooleanAttribute('internal'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDmsRabbitmqExchangesExchangesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqExchangesExchangesOutputReference { + return new DataHuaweicloudDmsRabbitmqExchangesExchangesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges huaweicloud_dms_rabbitmq_exchanges} +*/ +export class DataHuaweicloudDmsRabbitmqExchanges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_exchanges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqExchanges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqExchanges to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqExchanges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqExchanges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_exchanges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_exchanges huaweicloud_dms_rabbitmq_exchanges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqExchangesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqExchangesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_exchanges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._vhost = config.vhost; + } + + // ========== + // ATTRIBUTES + // ========== + + // exchanges - computed: true, optional: false, required: false + private _exchanges = new DataHuaweicloudDmsRabbitmqExchangesExchangesList(this, "exchanges", false); + public get exchanges() { + return this._exchanges; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + vhost: cdktf.stringToTerraform(this._vhost), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(this._vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/README.md new file mode 100644 index 00000000..aabf58ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_extend_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_extend_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/index.ts new file mode 100644 index 00000000..2b7514fd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-extend-flavors/index.ts @@ -0,0 +1,698 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqExtendFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the type of CPU architecture, e.g. **X86**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#arch_type DataHuaweicloudDmsRabbitmqExtendFlavors#arch_type} + */ + readonly archType?: string; + /** + * Specifies the flavor billing mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#charging_mode DataHuaweicloudDmsRabbitmqExtendFlavors#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#id DataHuaweicloudDmsRabbitmqExtendFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the DMS RabbitMQ instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#instance_id DataHuaweicloudDmsRabbitmqExtendFlavors#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#region DataHuaweicloudDmsRabbitmqExtendFlavors#region} + */ + readonly region?: string; + /** + * Specifies the disk IO encoding, e.g. **dms.physical.storage.high.v2**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#storage_spec_code DataHuaweicloudDmsRabbitmqExtendFlavors#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Specifies flavor type. The valid values are **single** and **cluster**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#type DataHuaweicloudDmsRabbitmqExtendFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIos { +} + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosToTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // available_zones - computed: true, optional: false, required: false + public get availableZones() { + return this.getListAttribute('available_zones'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailable_zones - computed: true, optional: false, required: false + public get unavailableZones() { + return this.getListAttribute('unavailable_zones'); + } +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosOutputReference { + return new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsProperties { +} + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesToTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavor_alias - computed: true, optional: false, required: false + public get flavorAlias() { + return this.getStringAttribute('flavor_alias'); + } + + // max_broker - computed: true, optional: false, required: false + public get maxBroker() { + return this.getStringAttribute('max_broker'); + } + + // max_connection_per_broker - computed: true, optional: false, required: false + public get maxConnectionPerBroker() { + return this.getStringAttribute('max_connection_per_broker'); + } + + // max_queue_per_broker - computed: true, optional: false, required: false + public get maxQueuePerBroker() { + return this.getStringAttribute('max_queue_per_broker'); + } + + // max_storage_per_node - computed: true, optional: false, required: false + public get maxStoragePerNode() { + return this.getStringAttribute('max_storage_per_node'); + } + + // min_broker - computed: true, optional: false, required: false + public get minBroker() { + return this.getStringAttribute('min_broker'); + } + + // min_storage_per_node - computed: true, optional: false, required: false + public get minStoragePerNode() { + return this.getStringAttribute('min_storage_per_node'); + } + + // step_length - computed: true, optional: false, required: false + public get stepLength() { + return this.getStringAttribute('step_length'); + } +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesOutputReference { + return new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeatures { +} + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesToTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new cdktf.StringMap(this, "properties"); + public get properties() { + return this._properties; + } +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesOutputReference { + return new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqExtendFlavorsFlavors { +} + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqExtendFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch_types - computed: true, optional: false, required: false + public get archTypes() { + return this.getListAttribute('arch_types'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ios - computed: true, optional: false, required: false + private _ios = new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsIosList(this, "ios", false); + public get ios() { + return this._ios; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // support_features - computed: true, optional: false, required: false + private _supportFeatures = new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsSupportFeaturesList(this, "support_features", false); + public get supportFeatures() { + return this._supportFeatures; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vm_specification - computed: true, optional: false, required: false + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } +} + +export class DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsOutputReference { + return new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors huaweicloud_dms_rabbitmq_extend_flavors} +*/ +export class DataHuaweicloudDmsRabbitmqExtendFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_extend_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqExtendFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqExtendFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqExtendFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqExtendFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_extend_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_extend_flavors huaweicloud_dms_rabbitmq_extend_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqExtendFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqExtendFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_extend_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._archType = config.archType; + this._chargingMode = config.chargingMode; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDmsRabbitmqExtendFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arch_type: cdktf.stringToTerraform(this._archType), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/README.md new file mode 100644 index 00000000..0bc55b9a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/index.ts new file mode 100644 index 00000000..69b10782 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-flavors/index.ts @@ -0,0 +1,812 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#arch_type DataHuaweicloudDmsRabbitmqFlavors#arch_type} + */ + readonly archType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#availability_zones DataHuaweicloudDmsRabbitmqFlavors#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#charging_mode DataHuaweicloudDmsRabbitmqFlavors#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#flavor_id DataHuaweicloudDmsRabbitmqFlavors#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#id DataHuaweicloudDmsRabbitmqFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#region DataHuaweicloudDmsRabbitmqFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#storage_spec_code DataHuaweicloudDmsRabbitmqFlavors#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#type DataHuaweicloudDmsRabbitmqFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsRabbitmqFlavorsFlavorsIos { +} + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsIosToTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsIosToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsIosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqFlavorsFlavorsIos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqFlavorsFlavorsIos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailability_zones - computed: true, optional: false, required: false + public get unavailabilityZones() { + return this.getListAttribute('unavailability_zones'); + } +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsIosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqFlavorsFlavorsIosOutputReference { + return new DataHuaweicloudDmsRabbitmqFlavorsFlavorsIosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqFlavorsFlavorsProperties { +} + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesToTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqFlavorsFlavorsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqFlavorsFlavorsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavor_alias - computed: true, optional: false, required: false + public get flavorAlias() { + return this.getStringAttribute('flavor_alias'); + } + + // max_bandwidth_per_broker - computed: true, optional: false, required: false + public get maxBandwidthPerBroker() { + return this.getNumberAttribute('max_bandwidth_per_broker'); + } + + // max_broker - computed: true, optional: false, required: false + public get maxBroker() { + return this.getNumberAttribute('max_broker'); + } + + // max_consumer_per_broker - computed: true, optional: false, required: false + public get maxConsumerPerBroker() { + return this.getNumberAttribute('max_consumer_per_broker'); + } + + // max_partition_per_broker - computed: true, optional: false, required: false + public get maxPartitionPerBroker() { + return this.getNumberAttribute('max_partition_per_broker'); + } + + // max_storage_per_node - computed: true, optional: false, required: false + public get maxStoragePerNode() { + return this.getNumberAttribute('max_storage_per_node'); + } + + // max_tps_per_broker - computed: true, optional: false, required: false + public get maxTpsPerBroker() { + return this.getNumberAttribute('max_tps_per_broker'); + } + + // min_broker - computed: true, optional: false, required: false + public get minBroker() { + return this.getNumberAttribute('min_broker'); + } + + // min_storage_per_node - computed: true, optional: false, required: false + public get minStoragePerNode() { + return this.getNumberAttribute('min_storage_per_node'); + } +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesOutputReference { + return new DataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesProperties { +} + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesToTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max_node - computed: true, optional: false, required: false + public get maxNode() { + return this.getNumberAttribute('max_node'); + } + + // max_task - computed: true, optional: false, required: false + public get maxTask() { + return this.getNumberAttribute('max_task'); + } + + // min_node - computed: true, optional: false, required: false + public get minNode() { + return this.getNumberAttribute('min_node'); + } + + // min_task - computed: true, optional: false, required: false + public get minTask() { + return this.getNumberAttribute('min_task'); + } +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesOutputReference { + return new DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeatures { +} + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesToTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesOutputReference { + return new DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqFlavorsFlavors { +} + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch_types - computed: true, optional: false, required: false + public get archTypes() { + return this.getListAttribute('arch_types'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ios - computed: true, optional: false, required: false + private _ios = new DataHuaweicloudDmsRabbitmqFlavorsFlavorsIosList(this, "ios", false); + public get ios() { + return this._ios; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsRabbitmqFlavorsFlavorsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // support_features - computed: true, optional: false, required: false + private _supportFeatures = new DataHuaweicloudDmsRabbitmqFlavorsFlavorsSupportFeaturesList(this, "support_features", false); + public get supportFeatures() { + return this._supportFeatures; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vm_specification - computed: true, optional: false, required: false + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } +} + +export class DataHuaweicloudDmsRabbitmqFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqFlavorsFlavorsOutputReference { + return new DataHuaweicloudDmsRabbitmqFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors huaweicloud_dms_rabbitmq_flavors} +*/ +export class DataHuaweicloudDmsRabbitmqFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_flavors huaweicloud_dms_rabbitmq_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._archType = config.archType; + this._availabilityZones = config.availabilityZones; + this._chargingMode = config.chargingMode; + this._flavorId = config.flavorId; + this._id = config.id; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // availability_zones - computed: false, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDmsRabbitmqFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arch_type: cdktf.stringToTerraform(this._archType), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/README.md new file mode 100644 index 00000000..40b44b36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/index.ts new file mode 100644 index 00000000..9c33747b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-instances/index.ts @@ -0,0 +1,631 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the version of the RabbitMQ engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#engine_version DataHuaweicloudDmsRabbitmqInstances#engine_version} + */ + readonly engineVersion?: string; + /** + * Specifies the enterprise project ID to which the RabbitMQ instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#enterprise_project_id DataHuaweicloudDmsRabbitmqInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies whether to search for the instance that precisely matches a specified instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#exact_match_name DataHuaweicloudDmsRabbitmqInstances#exact_match_name} + */ + readonly exactMatchName?: string; + /** + * Specifies the flavor ID of the RabbitMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#flavor_id DataHuaweicloudDmsRabbitmqInstances#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#id DataHuaweicloudDmsRabbitmqInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RabbitMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#instance_id DataHuaweicloudDmsRabbitmqInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the name of the RabbitMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#name DataHuaweicloudDmsRabbitmqInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#region DataHuaweicloudDmsRabbitmqInstances#region} + */ + readonly region?: string; + /** + * Specifies the status of the RabbitMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#status DataHuaweicloudDmsRabbitmqInstances#status} + */ + readonly status?: string; + /** + * Specifies the RabbitMQ instance type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#type DataHuaweicloudDmsRabbitmqInstances#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsRabbitmqInstancesInstances { +} + +export function dataHuaweicloudDmsRabbitmqInstancesInstancesToTerraform(struct?: DataHuaweicloudDmsRabbitmqInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_user - computed: true, optional: false, required: false + public get accessUser() { + return this.getStringAttribute('access_user'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // broker_num - computed: true, optional: false, required: false + public get brokerNum() { + return this.getNumberAttribute('broker_num'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // connect_address - computed: true, optional: false, required: false + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // extend_times - computed: true, optional: false, required: false + public get extendTimes() { + return this.getNumberAttribute('extend_times'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_logical_volume - computed: true, optional: false, required: false + public get isLogicalVolume() { + return this.getBooleanAttribute('is_logical_volume'); + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // management_connect_address - computed: true, optional: false, required: false + public get managementConnectAddress() { + return this.getStringAttribute('management_connect_address'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // security_group_name - computed: true, optional: false, required: false + public get securityGroupName() { + return this.getStringAttribute('security_group_name'); + } + + // specification - computed: true, optional: false, required: false + public get specification() { + return this.getStringAttribute('specification'); + } + + // ssl_enable - computed: true, optional: false, required: false + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_resource_id - computed: true, optional: false, required: false + public get storageResourceId() { + return this.getStringAttribute('storage_resource_id'); + } + + // storage_space - computed: true, optional: false, required: false + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } +} + +export class DataHuaweicloudDmsRabbitmqInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqInstancesInstancesOutputReference { + return new DataHuaweicloudDmsRabbitmqInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances huaweicloud_dms_rabbitmq_instances} +*/ +export class DataHuaweicloudDmsRabbitmqInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqInstances to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_instances huaweicloud_dms_rabbitmq_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._exactMatchName = config.exactMatchName; + this._flavorId = config.flavorId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // exact_match_name - computed: false, optional: true, required: false + private _exactMatchName?: string; + public get exactMatchName() { + return this.getStringAttribute('exact_match_name'); + } + public set exactMatchName(value: string) { + this._exactMatchName = value; + } + public resetExactMatchName() { + this._exactMatchName = undefined; + } + // Temporarily expose input value. Use with caution. + public get exactMatchNameInput() { + return this._exactMatchName; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDmsRabbitmqInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + exact_match_name: cdktf.stringToTerraform(this._exactMatchName), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exact_match_name: { + value: cdktf.stringToHclTerraform(this._exactMatchName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/README.md new file mode 100644 index 00000000..7838cc35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_plugins` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_plugins`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/index.ts new file mode 100644 index 00000000..051d7297 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-plugins/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqPluginsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether the plugin is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#enable DataHuaweicloudDmsRabbitmqPlugins#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#id DataHuaweicloudDmsRabbitmqPlugins#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RabbitMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#instance_id DataHuaweicloudDmsRabbitmqPlugins#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#name DataHuaweicloudDmsRabbitmqPlugins#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#region DataHuaweicloudDmsRabbitmqPlugins#region} + */ + readonly region?: string; + /** + * Specifies whether the plugin is running. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#running DataHuaweicloudDmsRabbitmqPlugins#running} + */ + readonly running?: boolean | cdktf.IResolvable; + /** + * Specifies the version of the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#version DataHuaweicloudDmsRabbitmqPlugins#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudDmsRabbitmqPluginsPlugins { +} + +export function dataHuaweicloudDmsRabbitmqPluginsPluginsToTerraform(struct?: DataHuaweicloudDmsRabbitmqPluginsPlugins): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqPluginsPluginsToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqPluginsPlugins): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqPluginsPluginsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqPluginsPlugins | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqPluginsPlugins | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getBooleanAttribute('enable'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // running - computed: true, optional: false, required: false + public get running() { + return this.getBooleanAttribute('running'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDmsRabbitmqPluginsPluginsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqPluginsPluginsOutputReference { + return new DataHuaweicloudDmsRabbitmqPluginsPluginsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins huaweicloud_dms_rabbitmq_plugins} +*/ +export class DataHuaweicloudDmsRabbitmqPlugins extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_plugins"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqPlugins resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqPlugins to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqPlugins that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqPlugins to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_plugins", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_plugins huaweicloud_dms_rabbitmq_plugins} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqPluginsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqPluginsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_plugins', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enable = config.enable; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._running = config.running; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // plugins - computed: true, optional: false, required: false + private _plugins = new DataHuaweicloudDmsRabbitmqPluginsPluginsList(this, "plugins", false); + public get plugins() { + return this._plugins; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // running - computed: false, optional: true, required: false + private _running?: boolean | cdktf.IResolvable; + public get running() { + return this.getBooleanAttribute('running'); + } + public set running(value: boolean | cdktf.IResolvable) { + this._running = value; + } + public resetRunning() { + this._running = undefined; + } + // Temporarily expose input value. Use with caution. + public get runningInput() { + return this._running; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable: cdktf.booleanToTerraform(this._enable), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + running: cdktf.booleanToTerraform(this._running), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + running: { + value: cdktf.booleanToHclTerraform(this._running), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/README.md new file mode 100644 index 00000000..63ad796d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_queues` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_queues`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/index.ts new file mode 100644 index 00000000..85941d11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-queues/index.ts @@ -0,0 +1,320 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqQueuesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues#id DataHuaweicloudDmsRabbitmqQueues#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues#instance_id DataHuaweicloudDmsRabbitmqQueues#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues#region DataHuaweicloudDmsRabbitmqQueues#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues#vhost DataHuaweicloudDmsRabbitmqQueues#vhost} + */ + readonly vhost: string; +} +export interface DataHuaweicloudDmsRabbitmqQueuesQueues { +} + +export function dataHuaweicloudDmsRabbitmqQueuesQueuesToTerraform(struct?: DataHuaweicloudDmsRabbitmqQueuesQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqQueuesQueuesToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqQueuesQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqQueuesQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqQueuesQueues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqQueuesQueues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auto_delete - computed: true, optional: false, required: false + public get autoDelete() { + return this.getBooleanAttribute('auto_delete'); + } + + // consumers - computed: true, optional: false, required: false + public get consumers() { + return this.getNumberAttribute('consumers'); + } + + // dead_letter_exchange - computed: true, optional: false, required: false + public get deadLetterExchange() { + return this.getStringAttribute('dead_letter_exchange'); + } + + // dead_letter_routing_key - computed: true, optional: false, required: false + public get deadLetterRoutingKey() { + return this.getStringAttribute('dead_letter_routing_key'); + } + + // durable - computed: true, optional: false, required: false + public get durable() { + return this.getBooleanAttribute('durable'); + } + + // lazy_mode - computed: true, optional: false, required: false + public get lazyMode() { + return this.getStringAttribute('lazy_mode'); + } + + // message_ttl - computed: true, optional: false, required: false + public get messageTtl() { + return this.getNumberAttribute('message_ttl'); + } + + // messages - computed: true, optional: false, required: false + public get messages() { + return this.getNumberAttribute('messages'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy - computed: true, optional: false, required: false + public get policy() { + return this.getStringAttribute('policy'); + } +} + +export class DataHuaweicloudDmsRabbitmqQueuesQueuesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqQueuesQueuesOutputReference { + return new DataHuaweicloudDmsRabbitmqQueuesQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues huaweicloud_dms_rabbitmq_queues} +*/ +export class DataHuaweicloudDmsRabbitmqQueues extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_queues"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqQueues resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqQueues to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqQueues that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqQueues to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_queues", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_queues huaweicloud_dms_rabbitmq_queues} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqQueuesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqQueuesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_queues', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._vhost = config.vhost; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // queues - computed: true, optional: false, required: false + private _queues = new DataHuaweicloudDmsRabbitmqQueuesQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + vhost: cdktf.stringToTerraform(this._vhost), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(this._vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/README.md new file mode 100644 index 00000000..6fbb3a76 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/index.ts new file mode 100644 index 00000000..ce905d66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-users/index.ts @@ -0,0 +1,350 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users#id DataHuaweicloudDmsRabbitmqUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the RabbitMQ instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users#instance_id DataHuaweicloudDmsRabbitmqUsers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users#region DataHuaweicloudDmsRabbitmqUsers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsRabbitmqUsersUsersVhosts { +} + +export function dataHuaweicloudDmsRabbitmqUsersUsersVhostsToTerraform(struct?: DataHuaweicloudDmsRabbitmqUsersUsersVhosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqUsersUsersVhostsToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqUsersUsersVhosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqUsersUsersVhostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqUsersUsersVhosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqUsersUsersVhosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conf - computed: true, optional: false, required: false + public get conf() { + return this.getStringAttribute('conf'); + } + + // read - computed: true, optional: false, required: false + public get read() { + return this.getStringAttribute('read'); + } + + // vhost - computed: true, optional: false, required: false + public get vhost() { + return this.getStringAttribute('vhost'); + } + + // write - computed: true, optional: false, required: false + public get write() { + return this.getStringAttribute('write'); + } +} + +export class DataHuaweicloudDmsRabbitmqUsersUsersVhostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqUsersUsersVhostsOutputReference { + return new DataHuaweicloudDmsRabbitmqUsersUsersVhostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRabbitmqUsersUsers { +} + +export function dataHuaweicloudDmsRabbitmqUsersUsersToTerraform(struct?: DataHuaweicloudDmsRabbitmqUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqUsersUsersToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_key - computed: true, optional: false, required: false + public get accessKey() { + return this.getStringAttribute('access_key'); + } + + // vhosts - computed: true, optional: false, required: false + private _vhosts = new DataHuaweicloudDmsRabbitmqUsersUsersVhostsList(this, "vhosts", false); + public get vhosts() { + return this._vhosts; + } +} + +export class DataHuaweicloudDmsRabbitmqUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqUsersUsersOutputReference { + return new DataHuaweicloudDmsRabbitmqUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users huaweicloud_dms_rabbitmq_users} +*/ +export class DataHuaweicloudDmsRabbitmqUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqUsers to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_users huaweicloud_dms_rabbitmq_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudDmsRabbitmqUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/README.md new file mode 100644 index 00000000..4821c255 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rabbitmq_vhosts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rabbitmq_vhosts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/index.ts new file mode 100644 index 00000000..19117560 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rabbitmq-vhosts/index.ts @@ -0,0 +1,255 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRabbitmqVhostsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts#id DataHuaweicloudDmsRabbitmqVhosts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts#instance_id DataHuaweicloudDmsRabbitmqVhosts#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts#region DataHuaweicloudDmsRabbitmqVhosts#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsRabbitmqVhostsVhosts { +} + +export function dataHuaweicloudDmsRabbitmqVhostsVhostsToTerraform(struct?: DataHuaweicloudDmsRabbitmqVhostsVhosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRabbitmqVhostsVhostsToHclTerraform(struct?: DataHuaweicloudDmsRabbitmqVhostsVhosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRabbitmqVhostsVhostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRabbitmqVhostsVhosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRabbitmqVhostsVhosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tracing - computed: true, optional: false, required: false + public get tracing() { + return this.getBooleanAttribute('tracing'); + } +} + +export class DataHuaweicloudDmsRabbitmqVhostsVhostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRabbitmqVhostsVhostsOutputReference { + return new DataHuaweicloudDmsRabbitmqVhostsVhostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts huaweicloud_dms_rabbitmq_vhosts} +*/ +export class DataHuaweicloudDmsRabbitmqVhosts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_vhosts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRabbitmqVhosts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRabbitmqVhosts to import + * @param importFromId The id of the existing DataHuaweicloudDmsRabbitmqVhosts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRabbitmqVhosts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_vhosts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rabbitmq_vhosts huaweicloud_dms_rabbitmq_vhosts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRabbitmqVhostsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRabbitmqVhostsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_vhosts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vhosts - computed: true, optional: false, required: false + private _vhosts = new DataHuaweicloudDmsRabbitmqVhostsVhostsList(this, "vhosts", false); + public get vhosts() { + return this._vhosts; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/README.md new file mode 100644 index 00000000..747fb3c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_broker` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_broker`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/index.ts new file mode 100644 index 00000000..83de5a7e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-broker/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqBrokerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker#id DataHuaweicloudDmsRocketmqBroker#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker#instance_id DataHuaweicloudDmsRocketmqBroker#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker#region DataHuaweicloudDmsRocketmqBroker#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker huaweicloud_dms_rocketmq_broker} +*/ +export class DataHuaweicloudDmsRocketmqBroker extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_broker"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqBroker resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqBroker to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqBroker that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqBroker to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_broker", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_broker huaweicloud_dms_rocketmq_broker} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqBrokerConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqBrokerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_broker', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // brokers - computed: true, optional: false, required: false + public get brokers() { + return this.getListAttribute('brokers'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/README.md new file mode 100644 index 00000000..dcbfae77 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_consumer_group_access_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_consumer_group_access_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/index.ts new file mode 100644 index 00000000..1440e89a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-group-access-users/index.ts @@ -0,0 +1,296 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users#group DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users#id DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users#instance_id DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users#region DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPolicies { +} + +export function dataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesToTerraform(struct?: DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_key - computed: true, optional: false, required: false + public get accessKey() { + return this.getStringAttribute('access_key'); + } + + // admin - computed: true, optional: false, required: false + public get admin() { + return this.getBooleanAttribute('admin'); + } + + // perm - computed: true, optional: false, required: false + public get perm() { + return this.getStringAttribute('perm'); + } + + // white_remote_address - computed: true, optional: false, required: false + public get whiteRemoteAddress() { + return this.getStringAttribute('white_remote_address'); + } +} + +export class DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesOutputReference { + return new DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users huaweicloud_dms_rocketmq_consumer_group_access_users} +*/ +export class DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_consumer_group_access_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqConsumerGroupAccessUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_consumer_group_access_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_group_access_users huaweicloud_dms_rocketmq_consumer_group_access_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_consumer_group_access_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudDmsRocketmqConsumerGroupAccessUsersPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/README.md new file mode 100644 index 00000000..34d519c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_consumer_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_consumer_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/index.ts new file mode 100644 index 00000000..4440513a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumer-groups/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqConsumerGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#broadcast DataHuaweicloudDmsRocketmqConsumerGroups#broadcast} + */ + readonly broadcast?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#enabled DataHuaweicloudDmsRocketmqConsumerGroups#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#id DataHuaweicloudDmsRocketmqConsumerGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#instance_id DataHuaweicloudDmsRocketmqConsumerGroups#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#name DataHuaweicloudDmsRocketmqConsumerGroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#region DataHuaweicloudDmsRocketmqConsumerGroups#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#retry_max_times DataHuaweicloudDmsRocketmqConsumerGroups#retry_max_times} + */ + readonly retryMaxTimes?: number; +} +export interface DataHuaweicloudDmsRocketmqConsumerGroupsGroups { +} + +export function dataHuaweicloudDmsRocketmqConsumerGroupsGroupsToTerraform(struct?: DataHuaweicloudDmsRocketmqConsumerGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqConsumerGroupsGroupsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqConsumerGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqConsumerGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqConsumerGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqConsumerGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // broadcast - computed: true, optional: false, required: false + public get broadcast() { + return this.getBooleanAttribute('broadcast'); + } + + // brokers - computed: true, optional: false, required: false + public get brokers() { + return this.getListAttribute('brokers'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // retry_max_times - computed: true, optional: false, required: false + public get retryMaxTimes() { + return this.getNumberAttribute('retry_max_times'); + } +} + +export class DataHuaweicloudDmsRocketmqConsumerGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqConsumerGroupsGroupsOutputReference { + return new DataHuaweicloudDmsRocketmqConsumerGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups huaweicloud_dms_rocketmq_consumer_groups} +*/ +export class DataHuaweicloudDmsRocketmqConsumerGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_consumer_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqConsumerGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqConsumerGroups to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqConsumerGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqConsumerGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_consumer_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumer_groups huaweicloud_dms_rocketmq_consumer_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqConsumerGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqConsumerGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_consumer_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._broadcast = config.broadcast; + this._enabled = config.enabled; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._retryMaxTimes = config.retryMaxTimes; + } + + // ========== + // ATTRIBUTES + // ========== + + // broadcast - computed: false, optional: true, required: false + private _broadcast?: boolean | cdktf.IResolvable; + public get broadcast() { + return this.getBooleanAttribute('broadcast'); + } + public set broadcast(value: boolean | cdktf.IResolvable) { + this._broadcast = value; + } + public resetBroadcast() { + this._broadcast = undefined; + } + // Temporarily expose input value. Use with caution. + public get broadcastInput() { + return this._broadcast; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudDmsRocketmqConsumerGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retry_max_times - computed: false, optional: true, required: false + private _retryMaxTimes?: number; + public get retryMaxTimes() { + return this.getNumberAttribute('retry_max_times'); + } + public set retryMaxTimes(value: number) { + this._retryMaxTimes = value; + } + public resetRetryMaxTimes() { + this._retryMaxTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryMaxTimesInput() { + return this._retryMaxTimes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + broadcast: cdktf.booleanToTerraform(this._broadcast), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + retry_max_times: cdktf.numberToTerraform(this._retryMaxTimes), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + broadcast: { + value: cdktf.booleanToHclTerraform(this._broadcast), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retry_max_times: { + value: cdktf.numberToHclTerraform(this._retryMaxTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/README.md new file mode 100644 index 00000000..ebf1b84e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_consumers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_consumers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/index.ts new file mode 100644 index 00000000..24ca88b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-consumers/index.ts @@ -0,0 +1,427 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqConsumersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the consumer group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers#group DataHuaweicloudDmsRocketmqConsumers#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers#id DataHuaweicloudDmsRocketmqConsumers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers#instance_id DataHuaweicloudDmsRocketmqConsumers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies whether to query the consumer details. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers#is_detail DataHuaweicloudDmsRocketmqConsumers#is_detail} + */ + readonly isDetail?: boolean | cdktf.IResolvable; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers#region DataHuaweicloudDmsRocketmqConsumers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsRocketmqConsumersClientsSubscriptions { +} + +export function dataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsToTerraform(struct?: DataHuaweicloudDmsRocketmqConsumersClientsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqConsumersClientsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqConsumersClientsSubscriptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqConsumersClientsSubscriptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // expression - computed: true, optional: false, required: false + public get expression() { + return this.getStringAttribute('expression'); + } + + // topic - computed: true, optional: false, required: false + public get topic() { + return this.getStringAttribute('topic'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsOutputReference { + return new DataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqConsumersClients { +} + +export function dataHuaweicloudDmsRocketmqConsumersClientsToTerraform(struct?: DataHuaweicloudDmsRocketmqConsumersClients): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqConsumersClientsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqConsumersClients): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqConsumersClientsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqConsumersClients | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqConsumersClients | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_address - computed: true, optional: false, required: false + public get clientAddress() { + return this.getStringAttribute('client_address'); + } + + // client_id - computed: true, optional: false, required: false + public get clientId() { + return this.getStringAttribute('client_id'); + } + + // language - computed: true, optional: false, required: false + public get language() { + return this.getStringAttribute('language'); + } + + // subscriptions - computed: true, optional: false, required: false + private _subscriptions = new DataHuaweicloudDmsRocketmqConsumersClientsSubscriptionsList(this, "subscriptions", false); + public get subscriptions() { + return this._subscriptions; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudDmsRocketmqConsumersClientsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqConsumersClientsOutputReference { + return new DataHuaweicloudDmsRocketmqConsumersClientsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers huaweicloud_dms_rocketmq_consumers} +*/ +export class DataHuaweicloudDmsRocketmqConsumers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_consumers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqConsumers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqConsumers to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqConsumers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqConsumers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_consumers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_consumers huaweicloud_dms_rocketmq_consumers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqConsumersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqConsumersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_consumers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._instanceId = config.instanceId; + this._isDetail = config.isDetail; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // clients - computed: true, optional: false, required: false + private _clients = new DataHuaweicloudDmsRocketmqConsumersClientsList(this, "clients", false); + public get clients() { + return this._clients; + } + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_detail - computed: false, optional: true, required: false + private _isDetail?: boolean | cdktf.IResolvable; + public get isDetail() { + return this.getBooleanAttribute('is_detail'); + } + public set isDetail(value: boolean | cdktf.IResolvable) { + this._isDetail = value; + } + public resetIsDetail() { + this._isDetail = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDetailInput() { + return this._isDetail; + } + + // online - computed: true, optional: false, required: false + public get online() { + return this.getBooleanAttribute('online'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subscription_consistency - computed: true, optional: false, required: false + public get subscriptionConsistency() { + return this.getBooleanAttribute('subscription_consistency'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_detail: cdktf.booleanToTerraform(this._isDetail), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_detail: { + value: cdktf.booleanToHclTerraform(this._isDetail), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/README.md new file mode 100644 index 00000000..06627dbf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_extend_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_extend_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/index.ts new file mode 100644 index 00000000..028bc619 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-extend-flavors/index.ts @@ -0,0 +1,713 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqExtendFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the type of CPU architecture, e.g. **X86**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#arch_type DataHuaweicloudDmsRocketmqExtendFlavors#arch_type} + */ + readonly archType?: string; + /** + * Specifies the flavor billing mode. The valid values are **prePaid** and **postPaid**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#charging_mode DataHuaweicloudDmsRocketmqExtendFlavors#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#id DataHuaweicloudDmsRocketmqExtendFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#instance_id DataHuaweicloudDmsRocketmqExtendFlavors#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#region DataHuaweicloudDmsRocketmqExtendFlavors#region} + */ + readonly region?: string; + /** + * Specifies the disk IO encoding, e.g. **dms.physical.storage.high.v2**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#storage_spec_code DataHuaweicloudDmsRocketmqExtendFlavors#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Specifies the flavor type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#type DataHuaweicloudDmsRocketmqExtendFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIos { +} + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosToTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosToHclTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // available_zones - computed: true, optional: false, required: false + public get availableZones() { + return this.getListAttribute('available_zones'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailable_zones - computed: true, optional: false, required: false + public get unavailableZones() { + return this.getListAttribute('unavailable_zones'); + } +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosOutputReference { + return new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsProperties { +} + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesToTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine_versions - computed: true, optional: false, required: false + public get engineVersions() { + return this.getStringAttribute('engine_versions'); + } + + // flavor_alias - computed: true, optional: false, required: false + public get flavorAlias() { + return this.getStringAttribute('flavor_alias'); + } + + // max_broker - computed: true, optional: false, required: false + public get maxBroker() { + return this.getStringAttribute('max_broker'); + } + + // max_consumer_per_broker - computed: true, optional: false, required: false + public get maxConsumerPerBroker() { + return this.getStringAttribute('max_consumer_per_broker'); + } + + // max_storage_per_node - computed: true, optional: false, required: false + public get maxStoragePerNode() { + return this.getStringAttribute('max_storage_per_node'); + } + + // max_topic_per_broker - computed: true, optional: false, required: false + public get maxTopicPerBroker() { + return this.getStringAttribute('max_topic_per_broker'); + } + + // min_broker - computed: true, optional: false, required: false + public get minBroker() { + return this.getStringAttribute('min_broker'); + } + + // min_storage_per_node - computed: true, optional: false, required: false + public get minStoragePerNode() { + return this.getStringAttribute('min_storage_per_node'); + } +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesOutputReference { + return new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeatures { +} + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesToTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new cdktf.StringMap(this, "properties"); + public get properties() { + return this._properties; + } +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesOutputReference { + return new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqExtendFlavorsFlavors { +} + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqExtendFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqExtendFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqExtendFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqExtendFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch_types - computed: true, optional: false, required: false + public get archTypes() { + return this.getListAttribute('arch_types'); + } + + // available_zones - computed: true, optional: false, required: false + public get availableZones() { + return this.getListAttribute('available_zones'); + } + + // billing_code - computed: true, optional: false, required: false + public get billingCode() { + return this.getStringAttribute('billing_code'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ios - computed: true, optional: false, required: false + private _ios = new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsIosList(this, "ios", false); + public get ios() { + return this._ios; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // support_features - computed: true, optional: false, required: false + private _supportFeatures = new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsSupportFeaturesList(this, "support_features", false); + public get supportFeatures() { + return this._supportFeatures; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailable_zones - computed: true, optional: false, required: false + public get unavailableZones() { + return this.getListAttribute('unavailable_zones'); + } + + // vm_specification - computed: true, optional: false, required: false + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } +} + +export class DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsOutputReference { + return new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors huaweicloud_dms_rocketmq_extend_flavors} +*/ +export class DataHuaweicloudDmsRocketmqExtendFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_extend_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqExtendFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqExtendFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqExtendFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqExtendFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_extend_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_extend_flavors huaweicloud_dms_rocketmq_extend_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqExtendFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqExtendFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_extend_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._archType = config.archType; + this._chargingMode = config.chargingMode; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDmsRocketmqExtendFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arch_type: cdktf.stringToTerraform(this._archType), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/README.md new file mode 100644 index 00000000..a58af646 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/index.ts new file mode 100644 index 00000000..35818c56 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-flavors/index.ts @@ -0,0 +1,824 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the type of CPU architecture. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#arch_type DataHuaweicloudDmsRocketmqFlavors#arch_type} + */ + readonly archType?: string; + /** + * Specifies the list of availability zone names. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#availability_zones DataHuaweicloudDmsRocketmqFlavors#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Specifies the billing mode of the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#charging_mode DataHuaweicloudDmsRocketmqFlavors#charging_mode} + */ + readonly chargingMode?: string; + /** + * Specifies the ID of the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#flavor_id DataHuaweicloudDmsRocketmqFlavors#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#id DataHuaweicloudDmsRocketmqFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#region DataHuaweicloudDmsRocketmqFlavors#region} + */ + readonly region?: string; + /** + * Specifies the disk IO encoding. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#storage_spec_code DataHuaweicloudDmsRocketmqFlavors#storage_spec_code} + */ + readonly storageSpecCode?: string; + /** + * Specifies the type of the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#type DataHuaweicloudDmsRocketmqFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsRocketmqFlavorsFlavorsIos { +} + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsIosToTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsIosToHclTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsIos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsIosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqFlavorsFlavorsIos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqFlavorsFlavorsIos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unavailability_zones - computed: true, optional: false, required: false + public get unavailabilityZones() { + return this.getListAttribute('unavailability_zones'); + } +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsIosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqFlavorsFlavorsIosOutputReference { + return new DataHuaweicloudDmsRocketmqFlavorsFlavorsIosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqFlavorsFlavorsProperties { +} + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesToTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqFlavorsFlavorsProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqFlavorsFlavorsProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavor_alias - computed: true, optional: false, required: false + public get flavorAlias() { + return this.getStringAttribute('flavor_alias'); + } + + // max_bandwidth_per_broker - computed: true, optional: false, required: false + public get maxBandwidthPerBroker() { + return this.getNumberAttribute('max_bandwidth_per_broker'); + } + + // max_broker - computed: true, optional: false, required: false + public get maxBroker() { + return this.getNumberAttribute('max_broker'); + } + + // max_consumer_per_broker - computed: true, optional: false, required: false + public get maxConsumerPerBroker() { + return this.getNumberAttribute('max_consumer_per_broker'); + } + + // max_partition_per_broker - computed: true, optional: false, required: false + public get maxPartitionPerBroker() { + return this.getNumberAttribute('max_partition_per_broker'); + } + + // max_storage_per_node - computed: true, optional: false, required: false + public get maxStoragePerNode() { + return this.getNumberAttribute('max_storage_per_node'); + } + + // max_tps_per_broker - computed: true, optional: false, required: false + public get maxTpsPerBroker() { + return this.getNumberAttribute('max_tps_per_broker'); + } + + // min_broker - computed: true, optional: false, required: false + public get minBroker() { + return this.getNumberAttribute('min_broker'); + } + + // min_storage_per_node - computed: true, optional: false, required: false + public get minStoragePerNode() { + return this.getNumberAttribute('min_storage_per_node'); + } +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesOutputReference { + return new DataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesProperties { +} + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesToTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max_node - computed: true, optional: false, required: false + public get maxNode() { + return this.getNumberAttribute('max_node'); + } + + // max_task - computed: true, optional: false, required: false + public get maxTask() { + return this.getNumberAttribute('max_task'); + } + + // min_node - computed: true, optional: false, required: false + public get minNode() { + return this.getNumberAttribute('min_node'); + } + + // min_task - computed: true, optional: false, required: false + public get minTask() { + return this.getNumberAttribute('min_task'); + } +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesOutputReference { + return new DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeatures { +} + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesToTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeatures): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeatures | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeatures | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesOutputReference { + return new DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqFlavorsFlavors { +} + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch_types - computed: true, optional: false, required: false + public get archTypes() { + return this.getListAttribute('arch_types'); + } + + // charging_modes - computed: true, optional: false, required: false + public get chargingModes() { + return this.getListAttribute('charging_modes'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ios - computed: true, optional: false, required: false + private _ios = new DataHuaweicloudDmsRocketmqFlavorsFlavorsIosList(this, "ios", false); + public get ios() { + return this._ios; + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudDmsRocketmqFlavorsFlavorsPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // support_features - computed: true, optional: false, required: false + private _supportFeatures = new DataHuaweicloudDmsRocketmqFlavorsFlavorsSupportFeaturesList(this, "support_features", false); + public get supportFeatures() { + return this._supportFeatures; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vm_specification - computed: true, optional: false, required: false + public get vmSpecification() { + return this.getStringAttribute('vm_specification'); + } +} + +export class DataHuaweicloudDmsRocketmqFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqFlavorsFlavorsOutputReference { + return new DataHuaweicloudDmsRocketmqFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors huaweicloud_dms_rocketmq_flavors} +*/ +export class DataHuaweicloudDmsRocketmqFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_flavors huaweicloud_dms_rocketmq_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._archType = config.archType; + this._availabilityZones = config.availabilityZones; + this._chargingMode = config.chargingMode; + this._flavorId = config.flavorId; + this._id = config.id; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // availability_zones - computed: false, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDmsRocketmqFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: true, required: false + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + public resetStorageSpecCode() { + this._storageSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arch_type: cdktf.stringToTerraform(this._archType), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/README.md new file mode 100644 index 00000000..bf26b63a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/index.ts new file mode 100644 index 00000000..6cab08dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-instances/index.ts @@ -0,0 +1,597 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to search for the instance that precisely matches a specified + * instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#exact_match_name DataHuaweicloudDmsRocketmqInstances#exact_match_name} + */ + readonly exactMatchName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#id DataHuaweicloudDmsRocketmqInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the rocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#instance_id DataHuaweicloudDmsRocketmqInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the name of the DMS RocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#name DataHuaweicloudDmsRocketmqInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#region DataHuaweicloudDmsRocketmqInstances#region} + */ + readonly region?: string; + /** + * Specifies the status of the DMS RocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#status DataHuaweicloudDmsRocketmqInstances#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccesses { +} + +export function dataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesToTerraform(struct?: DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advertised_ip - computed: true, optional: false, required: false + public get advertisedIp() { + return this.getStringAttribute('advertised_ip'); + } + + // lisenter_ip - computed: true, optional: false, required: false + public get lisenterIp() { + return this.getStringAttribute('lisenter_ip'); + } + + // listener_ip - computed: true, optional: false, required: false + public get listenerIp() { + return this.getStringAttribute('listener_ip'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } +} + +export class DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesOutputReference { + return new DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqInstancesInstances { +} + +export function dataHuaweicloudDmsRocketmqInstancesInstancesToTerraform(struct?: DataHuaweicloudDmsRocketmqInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqInstancesInstancesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // broker_address - computed: true, optional: false, required: false + public get brokerAddress() { + return this.getStringAttribute('broker_address'); + } + + // broker_num - computed: true, optional: false, required: false + public get brokerNum() { + return this.getNumberAttribute('broker_num'); + } + + // cross_vpc_accesses - computed: true, optional: false, required: false + private _crossVpcAccesses = new DataHuaweicloudDmsRocketmqInstancesInstancesCrossVpcAccessesList(this, "cross_vpc_accesses", false); + public get crossVpcAccesses() { + return this._crossVpcAccesses; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enable_acl - computed: true, optional: false, required: false + public get enableAcl() { + return this.getBooleanAttribute('enable_acl'); + } + + // enable_publicip - computed: true, optional: false, required: false + public get enablePublicip() { + return this.getBooleanAttribute('enable_publicip'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // namesrv_address - computed: true, optional: false, required: false + public get namesrvAddress() { + return this.getStringAttribute('namesrv_address'); + } + + // new_spec_billing_enable - computed: true, optional: false, required: false + public get newSpecBillingEnable() { + return this.getBooleanAttribute('new_spec_billing_enable'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // public_broker_address - computed: true, optional: false, required: false + public get publicBrokerAddress() { + return this.getStringAttribute('public_broker_address'); + } + + // public_namesrv_address - computed: true, optional: false, required: false + public get publicNamesrvAddress() { + return this.getStringAttribute('public_namesrv_address'); + } + + // publicip_address - computed: true, optional: false, required: false + public get publicipAddress() { + return this.getStringAttribute('publicip_address'); + } + + // publicip_id - computed: true, optional: false, required: false + public get publicipId() { + return this.getStringAttribute('publicip_id'); + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // specification - computed: true, optional: false, required: false + public get specification() { + return this.getStringAttribute('specification'); + } + + // ssl_enable - computed: true, optional: false, required: false + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_space - computed: true, optional: false, required: false + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + + // storage_spec_code - computed: true, optional: false, required: false + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDmsRocketmqInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqInstancesInstancesOutputReference { + return new DataHuaweicloudDmsRocketmqInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances huaweicloud_dms_rocketmq_instances} +*/ +export class DataHuaweicloudDmsRocketmqInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqInstances to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_instances huaweicloud_dms_rocketmq_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._exactMatchName = config.exactMatchName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // exact_match_name - computed: false, optional: true, required: false + private _exactMatchName?: string; + public get exactMatchName() { + return this.getStringAttribute('exact_match_name'); + } + public set exactMatchName(value: string) { + this._exactMatchName = value; + } + public resetExactMatchName() { + this._exactMatchName = undefined; + } + // Temporarily expose input value. Use with caution. + public get exactMatchNameInput() { + return this._exactMatchName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDmsRocketmqInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + exact_match_name: cdktf.stringToTerraform(this._exactMatchName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + exact_match_name: { + value: cdktf.stringToHclTerraform(this._exactMatchName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/README.md new file mode 100644 index 00000000..faa8b7c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_message_traces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_message_traces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/index.ts new file mode 100644 index 00000000..5f7ce850 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-message-traces/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqMessageTracesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces#id DataHuaweicloudDmsRocketmqMessageTraces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces#instance_id DataHuaweicloudDmsRocketmqMessageTraces#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the message ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces#message_id DataHuaweicloudDmsRocketmqMessageTraces#message_id} + */ + readonly messageId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces#region DataHuaweicloudDmsRocketmqMessageTraces#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDmsRocketmqMessageTracesTraces { +} + +export function dataHuaweicloudDmsRocketmqMessageTracesTracesToTerraform(struct?: DataHuaweicloudDmsRocketmqMessageTracesTraces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqMessageTracesTracesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqMessageTracesTraces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqMessageTracesTracesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqMessageTracesTraces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqMessageTracesTraces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // body_length - computed: true, optional: false, required: false + public get bodyLength() { + return this.getNumberAttribute('body_length'); + } + + // client_host - computed: true, optional: false, required: false + public get clientHost() { + return this.getStringAttribute('client_host'); + } + + // consume_status - computed: true, optional: false, required: false + public get consumeStatus() { + return this.getNumberAttribute('consume_status'); + } + + // cost_time - computed: true, optional: false, required: false + public get costTime() { + return this.getNumberAttribute('cost_time'); + } + + // from_transaction_check - computed: true, optional: false, required: false + public get fromTransactionCheck() { + return this.getBooleanAttribute('from_transaction_check'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // keys - computed: true, optional: false, required: false + public get keys() { + return this.getStringAttribute('keys'); + } + + // message_id - computed: true, optional: false, required: false + public get messageId() { + return this.getStringAttribute('message_id'); + } + + // message_type - computed: true, optional: false, required: false + public get messageType() { + return this.getStringAttribute('message_type'); + } + + // offset_message_id - computed: true, optional: false, required: false + public get offsetMessageId() { + return this.getStringAttribute('offset_message_id'); + } + + // request_id - computed: true, optional: false, required: false + public get requestId() { + return this.getStringAttribute('request_id'); + } + + // retry_times - computed: true, optional: false, required: false + public get retryTimes() { + return this.getNumberAttribute('retry_times'); + } + + // store_host - computed: true, optional: false, required: false + public get storeHost() { + return this.getStringAttribute('store_host'); + } + + // success - computed: true, optional: false, required: false + public get success() { + return this.getBooleanAttribute('success'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return this.getStringAttribute('tags'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } + + // topic - computed: true, optional: false, required: false + public get topic() { + return this.getStringAttribute('topic'); + } + + // trace_type - computed: true, optional: false, required: false + public get traceType() { + return this.getStringAttribute('trace_type'); + } + + // transaction_id - computed: true, optional: false, required: false + public get transactionId() { + return this.getStringAttribute('transaction_id'); + } + + // transaction_state - computed: true, optional: false, required: false + public get transactionState() { + return this.getStringAttribute('transaction_state'); + } +} + +export class DataHuaweicloudDmsRocketmqMessageTracesTracesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqMessageTracesTracesOutputReference { + return new DataHuaweicloudDmsRocketmqMessageTracesTracesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces huaweicloud_dms_rocketmq_message_traces} +*/ +export class DataHuaweicloudDmsRocketmqMessageTraces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_message_traces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqMessageTraces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqMessageTraces to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqMessageTraces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqMessageTraces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_message_traces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_message_traces huaweicloud_dms_rocketmq_message_traces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqMessageTracesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqMessageTracesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_message_traces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._messageId = config.messageId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // message_id - computed: false, optional: false, required: true + private _messageId?: string; + public get messageId() { + return this.getStringAttribute('message_id'); + } + public set messageId(value: string) { + this._messageId = value; + } + // Temporarily expose input value. Use with caution. + public get messageIdInput() { + return this._messageId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // traces - computed: true, optional: false, required: false + private _traces = new DataHuaweicloudDmsRocketmqMessageTracesTracesList(this, "traces", false); + public get traces() { + return this._traces; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + message_id: cdktf.stringToTerraform(this._messageId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_id: { + value: cdktf.stringToHclTerraform(this._messageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/README.md new file mode 100644 index 00000000..f1e8af32 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_messages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_messages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/index.ts new file mode 100644 index 00000000..a26b3810 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-messages/index.ts @@ -0,0 +1,537 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqMessagesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time, a Unix timestamp in millisecond. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#end_time DataHuaweicloudDmsRocketmqMessages#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#id DataHuaweicloudDmsRocketmqMessages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#instance_id DataHuaweicloudDmsRocketmqMessages#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the message key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#key DataHuaweicloudDmsRocketmqMessages#key} + */ + readonly key?: string; + /** + * Specifies the message ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#message_id DataHuaweicloudDmsRocketmqMessages#message_id} + */ + readonly messageId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#region DataHuaweicloudDmsRocketmqMessages#region} + */ + readonly region?: string; + /** + * Specifies the start time, a Unix timestamp in millisecond. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#start_time DataHuaweicloudDmsRocketmqMessages#start_time} + */ + readonly startTime?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#topic DataHuaweicloudDmsRocketmqMessages#topic} + */ + readonly topic: string; +} +export interface DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStruct { +} + +export function dataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructToTerraform(struct?: DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructToHclTerraform(struct?: DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructOutputReference { + return new DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqMessagesMessages { +} + +export function dataHuaweicloudDmsRocketmqMessagesMessagesToTerraform(struct?: DataHuaweicloudDmsRocketmqMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqMessagesMessagesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqMessagesMessagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqMessagesMessages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqMessagesMessages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // body - computed: true, optional: false, required: false + public get body() { + return this.getStringAttribute('body'); + } + + // body_crc - computed: true, optional: false, required: false + public get bodyCrc() { + return this.getNumberAttribute('body_crc'); + } + + // born_host - computed: true, optional: false, required: false + public get bornHost() { + return this.getStringAttribute('born_host'); + } + + // born_time - computed: true, optional: false, required: false + public get bornTime() { + return this.getStringAttribute('born_time'); + } + + // message_id - computed: true, optional: false, required: false + public get messageId() { + return this.getStringAttribute('message_id'); + } + + // property_list - computed: true, optional: false, required: false + private _propertyList = new DataHuaweicloudDmsRocketmqMessagesMessagesPropertyListStructList(this, "property_list", false); + public get propertyList() { + return this._propertyList; + } + + // queue_id - computed: true, optional: false, required: false + public get queueId() { + return this.getNumberAttribute('queue_id'); + } + + // queue_offset - computed: true, optional: false, required: false + public get queueOffset() { + return this.getNumberAttribute('queue_offset'); + } + + // reconsume_times - computed: true, optional: false, required: false + public get reconsumeTimes() { + return this.getNumberAttribute('reconsume_times'); + } + + // store_host - computed: true, optional: false, required: false + public get storeHost() { + return this.getStringAttribute('store_host'); + } + + // store_size - computed: true, optional: false, required: false + public get storeSize() { + return this.getNumberAttribute('store_size'); + } + + // store_time - computed: true, optional: false, required: false + public get storeTime() { + return this.getStringAttribute('store_time'); + } +} + +export class DataHuaweicloudDmsRocketmqMessagesMessagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqMessagesMessagesOutputReference { + return new DataHuaweicloudDmsRocketmqMessagesMessagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages huaweicloud_dms_rocketmq_messages} +*/ +export class DataHuaweicloudDmsRocketmqMessages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_messages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqMessages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqMessages to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqMessages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqMessages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_messages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_messages huaweicloud_dms_rocketmq_messages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqMessagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqMessagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_messages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._key = config.key; + this._messageId = config.messageId; + this._region = config.region; + this._startTime = config.startTime; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // key - computed: false, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // message_id - computed: false, optional: true, required: false + private _messageId?: string; + public get messageId() { + return this.getStringAttribute('message_id'); + } + public set messageId(value: string) { + this._messageId = value; + } + public resetMessageId() { + this._messageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageIdInput() { + return this._messageId; + } + + // messages - computed: true, optional: false, required: false + private _messages = new DataHuaweicloudDmsRocketmqMessagesMessagesList(this, "messages", false); + public get messages() { + return this._messages; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + key: cdktf.stringToTerraform(this._key), + message_id: cdktf.stringToTerraform(this._messageId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_id: { + value: cdktf.stringToHclTerraform(this._messageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/README.md new file mode 100644 index 00000000..6ac730f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_migration_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_migration_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/index.ts new file mode 100644 index 00000000..981fd52c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-migration-tasks/index.ts @@ -0,0 +1,364 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqMigrationTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#id DataHuaweicloudDmsRocketmqMigrationTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the RocketMQ instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#instance_id DataHuaweicloudDmsRocketmqMigrationTasks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the RocketMQ migration task name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#name DataHuaweicloudDmsRocketmqMigrationTasks#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#region DataHuaweicloudDmsRocketmqMigrationTasks#region} + */ + readonly region?: string; + /** + * Specifies the RocketMQ migration task ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#task_id DataHuaweicloudDmsRocketmqMigrationTasks#task_id} + */ + readonly taskId?: string; + /** + * Specifies the RocketMQ migration task type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#type DataHuaweicloudDmsRocketmqMigrationTasks#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDmsRocketmqMigrationTasksTasks { +} + +export function dataHuaweicloudDmsRocketmqMigrationTasksTasksToTerraform(struct?: DataHuaweicloudDmsRocketmqMigrationTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqMigrationTasksTasksToHclTerraform(struct?: DataHuaweicloudDmsRocketmqMigrationTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqMigrationTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqMigrationTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqMigrationTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // start_date - computed: true, optional: false, required: false + public get startDate() { + return this.getStringAttribute('start_date'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDmsRocketmqMigrationTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqMigrationTasksTasksOutputReference { + return new DataHuaweicloudDmsRocketmqMigrationTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks huaweicloud_dms_rocketmq_migration_tasks} +*/ +export class DataHuaweicloudDmsRocketmqMigrationTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_migration_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqMigrationTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqMigrationTasks to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqMigrationTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqMigrationTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_migration_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_migration_tasks huaweicloud_dms_rocketmq_migration_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqMigrationTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqMigrationTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_migration_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._taskId = config.taskId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // task_id - computed: false, optional: true, required: false + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + public resetTaskId() { + this._taskId = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDmsRocketmqMigrationTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + task_id: cdktf.stringToTerraform(this._taskId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/README.md new file mode 100644 index 00000000..f064ce73 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_topic_access_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_topic_access_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/index.ts new file mode 100644 index 00000000..a0b316c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-access-users/index.ts @@ -0,0 +1,296 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqTopicAccessUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users#id DataHuaweicloudDmsRocketmqTopicAccessUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users#instance_id DataHuaweicloudDmsRocketmqTopicAccessUsers#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users#region DataHuaweicloudDmsRocketmqTopicAccessUsers#region} + */ + readonly region?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users#topic DataHuaweicloudDmsRocketmqTopicAccessUsers#topic} + */ + readonly topic: string; +} +export interface DataHuaweicloudDmsRocketmqTopicAccessUsersPolicies { +} + +export function dataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesToTerraform(struct?: DataHuaweicloudDmsRocketmqTopicAccessUsersPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesToHclTerraform(struct?: DataHuaweicloudDmsRocketmqTopicAccessUsersPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqTopicAccessUsersPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqTopicAccessUsersPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_key - computed: true, optional: false, required: false + public get accessKey() { + return this.getStringAttribute('access_key'); + } + + // admin - computed: true, optional: false, required: false + public get admin() { + return this.getBooleanAttribute('admin'); + } + + // perm - computed: true, optional: false, required: false + public get perm() { + return this.getStringAttribute('perm'); + } + + // white_remote_address - computed: true, optional: false, required: false + public get whiteRemoteAddress() { + return this.getStringAttribute('white_remote_address'); + } +} + +export class DataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesOutputReference { + return new DataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users huaweicloud_dms_rocketmq_topic_access_users} +*/ +export class DataHuaweicloudDmsRocketmqTopicAccessUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_topic_access_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqTopicAccessUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqTopicAccessUsers to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqTopicAccessUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqTopicAccessUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_topic_access_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_access_users huaweicloud_dms_rocketmq_topic_access_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqTopicAccessUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqTopicAccessUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_topic_access_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudDmsRocketmqTopicAccessUsersPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/README.md new file mode 100644 index 00000000..d013d436 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_topic_consumer_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_topic_consumer_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/index.ts new file mode 100644 index 00000000..574fcf1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topic-consumer-groups/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqTopicConsumerGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups#id DataHuaweicloudDmsRocketmqTopicConsumerGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups#instance_id DataHuaweicloudDmsRocketmqTopicConsumerGroups#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups#region DataHuaweicloudDmsRocketmqTopicConsumerGroups#region} + */ + readonly region?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups#topic_name DataHuaweicloudDmsRocketmqTopicConsumerGroups#topic_name} + */ + readonly topicName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups huaweicloud_dms_rocketmq_topic_consumer_groups} +*/ +export class DataHuaweicloudDmsRocketmqTopicConsumerGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_topic_consumer_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqTopicConsumerGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqTopicConsumerGroups to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqTopicConsumerGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqTopicConsumerGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_topic_consumer_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topic_consumer_groups huaweicloud_dms_rocketmq_topic_consumer_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqTopicConsumerGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqTopicConsumerGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_topic_consumer_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topicName = config.topicName; + } + + // ========== + // ATTRIBUTES + // ========== + + // groups - computed: true, optional: false, required: false + public get groups() { + return this.getListAttribute('groups'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_name - computed: false, optional: false, required: true + private _topicName?: string; + public get topicName() { + return this.getStringAttribute('topic_name'); + } + public set topicName(value: string) { + this._topicName = value; + } + // Temporarily expose input value. Use with caution. + public get topicNameInput() { + return this._topicName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic_name: cdktf.stringToTerraform(this._topicName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name: { + value: cdktf.stringToHclTerraform(this._topicName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/README.md new file mode 100644 index 00000000..0c6e65a7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_topics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_topics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/index.ts new file mode 100644 index 00000000..cdaffcdf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-topics/index.ts @@ -0,0 +1,468 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqTopicsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#id DataHuaweicloudDmsRocketmqTopics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#instance_id DataHuaweicloudDmsRocketmqTopics#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#name DataHuaweicloudDmsRocketmqTopics#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#permission DataHuaweicloudDmsRocketmqTopics#permission} + */ + readonly permission?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#region DataHuaweicloudDmsRocketmqTopics#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#total_read_queue_num DataHuaweicloudDmsRocketmqTopics#total_read_queue_num} + */ + readonly totalReadQueueNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#total_write_queue_num DataHuaweicloudDmsRocketmqTopics#total_write_queue_num} + */ + readonly totalWriteQueueNum?: number; +} +export interface DataHuaweicloudDmsRocketmqTopicsTopicsBrokers { +} + +export function dataHuaweicloudDmsRocketmqTopicsTopicsBrokersToTerraform(struct?: DataHuaweicloudDmsRocketmqTopicsTopicsBrokers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqTopicsTopicsBrokersToHclTerraform(struct?: DataHuaweicloudDmsRocketmqTopicsTopicsBrokers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqTopicsTopicsBrokersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqTopicsTopicsBrokers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqTopicsTopicsBrokers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // broker_name - computed: true, optional: false, required: false + public get brokerName() { + return this.getStringAttribute('broker_name'); + } + + // read_queue_num - computed: true, optional: false, required: false + public get readQueueNum() { + return this.getNumberAttribute('read_queue_num'); + } + + // write_queue_num - computed: true, optional: false, required: false + public get writeQueueNum() { + return this.getNumberAttribute('write_queue_num'); + } +} + +export class DataHuaweicloudDmsRocketmqTopicsTopicsBrokersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqTopicsTopicsBrokersOutputReference { + return new DataHuaweicloudDmsRocketmqTopicsTopicsBrokersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqTopicsTopics { +} + +export function dataHuaweicloudDmsRocketmqTopicsTopicsToTerraform(struct?: DataHuaweicloudDmsRocketmqTopicsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqTopicsTopicsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqTopicsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqTopicsTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqTopicsTopics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqTopicsTopics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // brokers - computed: true, optional: false, required: false + private _brokers = new DataHuaweicloudDmsRocketmqTopicsTopicsBrokersList(this, "brokers", false); + public get brokers() { + return this._brokers; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // permission - computed: true, optional: false, required: false + public get permission() { + return this.getStringAttribute('permission'); + } + + // total_read_queue_num - computed: true, optional: false, required: false + public get totalReadQueueNum() { + return this.getNumberAttribute('total_read_queue_num'); + } + + // total_write_queue_num - computed: true, optional: false, required: false + public get totalWriteQueueNum() { + return this.getNumberAttribute('total_write_queue_num'); + } +} + +export class DataHuaweicloudDmsRocketmqTopicsTopicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqTopicsTopicsOutputReference { + return new DataHuaweicloudDmsRocketmqTopicsTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics huaweicloud_dms_rocketmq_topics} +*/ +export class DataHuaweicloudDmsRocketmqTopics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_topics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqTopics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqTopics to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqTopics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqTopics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_topics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_topics huaweicloud_dms_rocketmq_topics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqTopicsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqTopicsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_topics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._permission = config.permission; + this._region = config.region; + this._totalReadQueueNum = config.totalReadQueueNum; + this._totalWriteQueueNum = config.totalWriteQueueNum; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permission - computed: false, optional: true, required: false + private _permission?: string; + public get permission() { + return this.getStringAttribute('permission'); + } + public set permission(value: string) { + this._permission = value; + } + public resetPermission() { + this._permission = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionInput() { + return this._permission; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topics - computed: true, optional: false, required: false + private _topics = new DataHuaweicloudDmsRocketmqTopicsTopicsList(this, "topics", false); + public get topics() { + return this._topics; + } + + // total_read_queue_num - computed: false, optional: true, required: false + private _totalReadQueueNum?: number; + public get totalReadQueueNum() { + return this.getNumberAttribute('total_read_queue_num'); + } + public set totalReadQueueNum(value: number) { + this._totalReadQueueNum = value; + } + public resetTotalReadQueueNum() { + this._totalReadQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get totalReadQueueNumInput() { + return this._totalReadQueueNum; + } + + // total_write_queue_num - computed: false, optional: true, required: false + private _totalWriteQueueNum?: number; + public get totalWriteQueueNum() { + return this.getNumberAttribute('total_write_queue_num'); + } + public set totalWriteQueueNum(value: number) { + this._totalWriteQueueNum = value; + } + public resetTotalWriteQueueNum() { + this._totalWriteQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get totalWriteQueueNumInput() { + return this._totalWriteQueueNum; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + permission: cdktf.stringToTerraform(this._permission), + region: cdktf.stringToTerraform(this._region), + total_read_queue_num: cdktf.numberToTerraform(this._totalReadQueueNum), + total_write_queue_num: cdktf.numberToTerraform(this._totalWriteQueueNum), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission: { + value: cdktf.stringToHclTerraform(this._permission), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + total_read_queue_num: { + value: cdktf.numberToHclTerraform(this._totalReadQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + total_write_queue_num: { + value: cdktf.numberToHclTerraform(this._totalWriteQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/README.md new file mode 100644 index 00000000..4acff975 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dms_rocketmq_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dms_rocketmq_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/index.ts new file mode 100644 index 00000000..be713267 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dms-rocketmq-users/index.ts @@ -0,0 +1,582 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDmsRocketmqUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#access_key DataHuaweicloudDmsRocketmqUsers#access_key} + */ + readonly accessKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#admin DataHuaweicloudDmsRocketmqUsers#admin} + */ + readonly admin?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#default_group_perm DataHuaweicloudDmsRocketmqUsers#default_group_perm} + */ + readonly defaultGroupPerm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#default_topic_perm DataHuaweicloudDmsRocketmqUsers#default_topic_perm} + */ + readonly defaultTopicPerm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#id DataHuaweicloudDmsRocketmqUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#instance_id DataHuaweicloudDmsRocketmqUsers#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#region DataHuaweicloudDmsRocketmqUsers#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#white_remote_address DataHuaweicloudDmsRocketmqUsers#white_remote_address} + */ + readonly whiteRemoteAddress?: string; +} +export interface DataHuaweicloudDmsRocketmqUsersUsersGroupPerms { +} + +export function dataHuaweicloudDmsRocketmqUsersUsersGroupPermsToTerraform(struct?: DataHuaweicloudDmsRocketmqUsersUsersGroupPerms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqUsersUsersGroupPermsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqUsersUsersGroupPerms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqUsersUsersGroupPermsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqUsersUsersGroupPerms | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqUsersUsersGroupPerms | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // perm - computed: true, optional: false, required: false + public get perm() { + return this.getStringAttribute('perm'); + } +} + +export class DataHuaweicloudDmsRocketmqUsersUsersGroupPermsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqUsersUsersGroupPermsOutputReference { + return new DataHuaweicloudDmsRocketmqUsersUsersGroupPermsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqUsersUsersTopicPerms { +} + +export function dataHuaweicloudDmsRocketmqUsersUsersTopicPermsToTerraform(struct?: DataHuaweicloudDmsRocketmqUsersUsersTopicPerms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqUsersUsersTopicPermsToHclTerraform(struct?: DataHuaweicloudDmsRocketmqUsersUsersTopicPerms): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqUsersUsersTopicPermsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqUsersUsersTopicPerms | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqUsersUsersTopicPerms | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // perm - computed: true, optional: false, required: false + public get perm() { + return this.getStringAttribute('perm'); + } +} + +export class DataHuaweicloudDmsRocketmqUsersUsersTopicPermsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqUsersUsersTopicPermsOutputReference { + return new DataHuaweicloudDmsRocketmqUsersUsersTopicPermsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDmsRocketmqUsersUsers { +} + +export function dataHuaweicloudDmsRocketmqUsersUsersToTerraform(struct?: DataHuaweicloudDmsRocketmqUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDmsRocketmqUsersUsersToHclTerraform(struct?: DataHuaweicloudDmsRocketmqUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDmsRocketmqUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDmsRocketmqUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDmsRocketmqUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_key - computed: true, optional: false, required: false + public get accessKey() { + return this.getStringAttribute('access_key'); + } + + // admin - computed: true, optional: false, required: false + public get admin() { + return this.getBooleanAttribute('admin'); + } + + // default_group_perm - computed: true, optional: false, required: false + public get defaultGroupPerm() { + return this.getStringAttribute('default_group_perm'); + } + + // default_topic_perm - computed: true, optional: false, required: false + public get defaultTopicPerm() { + return this.getStringAttribute('default_topic_perm'); + } + + // group_perms - computed: true, optional: false, required: false + private _groupPerms = new DataHuaweicloudDmsRocketmqUsersUsersGroupPermsList(this, "group_perms", false); + public get groupPerms() { + return this._groupPerms; + } + + // topic_perms - computed: true, optional: false, required: false + private _topicPerms = new DataHuaweicloudDmsRocketmqUsersUsersTopicPermsList(this, "topic_perms", false); + public get topicPerms() { + return this._topicPerms; + } + + // white_remote_address - computed: true, optional: false, required: false + public get whiteRemoteAddress() { + return this.getStringAttribute('white_remote_address'); + } +} + +export class DataHuaweicloudDmsRocketmqUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDmsRocketmqUsersUsersOutputReference { + return new DataHuaweicloudDmsRocketmqUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users huaweicloud_dms_rocketmq_users} +*/ +export class DataHuaweicloudDmsRocketmqUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDmsRocketmqUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDmsRocketmqUsers to import + * @param importFromId The id of the existing DataHuaweicloudDmsRocketmqUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDmsRocketmqUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dms_rocketmq_users huaweicloud_dms_rocketmq_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDmsRocketmqUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDmsRocketmqUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessKey = config.accessKey; + this._admin = config.admin; + this._defaultGroupPerm = config.defaultGroupPerm; + this._defaultTopicPerm = config.defaultTopicPerm; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._whiteRemoteAddress = config.whiteRemoteAddress; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // admin - computed: false, optional: true, required: false + private _admin?: boolean | cdktf.IResolvable; + public get admin() { + return this.getBooleanAttribute('admin'); + } + public set admin(value: boolean | cdktf.IResolvable) { + this._admin = value; + } + public resetAdmin() { + this._admin = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminInput() { + return this._admin; + } + + // default_group_perm - computed: false, optional: true, required: false + private _defaultGroupPerm?: string; + public get defaultGroupPerm() { + return this.getStringAttribute('default_group_perm'); + } + public set defaultGroupPerm(value: string) { + this._defaultGroupPerm = value; + } + public resetDefaultGroupPerm() { + this._defaultGroupPerm = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultGroupPermInput() { + return this._defaultGroupPerm; + } + + // default_topic_perm - computed: false, optional: true, required: false + private _defaultTopicPerm?: string; + public get defaultTopicPerm() { + return this.getStringAttribute('default_topic_perm'); + } + public set defaultTopicPerm(value: string) { + this._defaultTopicPerm = value; + } + public resetDefaultTopicPerm() { + this._defaultTopicPerm = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultTopicPermInput() { + return this._defaultTopicPerm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudDmsRocketmqUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // white_remote_address - computed: false, optional: true, required: false + private _whiteRemoteAddress?: string; + public get whiteRemoteAddress() { + return this.getStringAttribute('white_remote_address'); + } + public set whiteRemoteAddress(value: string) { + this._whiteRemoteAddress = value; + } + public resetWhiteRemoteAddress() { + this._whiteRemoteAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get whiteRemoteAddressInput() { + return this._whiteRemoteAddress; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_key: cdktf.stringToTerraform(this._accessKey), + admin: cdktf.booleanToTerraform(this._admin), + default_group_perm: cdktf.stringToTerraform(this._defaultGroupPerm), + default_topic_perm: cdktf.stringToTerraform(this._defaultTopicPerm), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + white_remote_address: cdktf.stringToTerraform(this._whiteRemoteAddress), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(this._accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin: { + value: cdktf.booleanToHclTerraform(this._admin), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + default_group_perm: { + value: cdktf.stringToHclTerraform(this._defaultGroupPerm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default_topic_perm: { + value: cdktf.stringToHclTerraform(this._defaultTopicPerm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + white_remote_address: { + value: cdktf.stringToHclTerraform(this._whiteRemoteAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/README.md new file mode 100644 index 00000000..c2f1ef6a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_custom_lines` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_custom_lines`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/index.ts new file mode 100644 index 00000000..60eef4c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-custom-lines/index.ts @@ -0,0 +1,347 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsCustomLinesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines#id DataHuaweicloudDnsCustomLines#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specified the ID of the custom line. Fuzzy search is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines#line_id DataHuaweicloudDnsCustomLines#line_id} + */ + readonly lineId?: string; + /** + * Specified the name of the custom line. Fuzzy search is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines#name DataHuaweicloudDnsCustomLines#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines#region DataHuaweicloudDnsCustomLines#region} + */ + readonly region?: string; + /** + * Specifies the status of the custom line. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines#status DataHuaweicloudDnsCustomLines#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDnsCustomLinesLines { +} + +export function dataHuaweicloudDnsCustomLinesLinesToTerraform(struct?: DataHuaweicloudDnsCustomLinesLines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsCustomLinesLinesToHclTerraform(struct?: DataHuaweicloudDnsCustomLinesLines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsCustomLinesLinesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsCustomLinesLines | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsCustomLinesLines | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_segments - computed: true, optional: false, required: false + public get ipSegments() { + return this.getListAttribute('ip_segments'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDnsCustomLinesLinesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsCustomLinesLinesOutputReference { + return new DataHuaweicloudDnsCustomLinesLinesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines huaweicloud_dns_custom_lines} +*/ +export class DataHuaweicloudDnsCustomLines extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_custom_lines"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsCustomLines resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsCustomLines to import + * @param importFromId The id of the existing DataHuaweicloudDnsCustomLines that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsCustomLines to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_custom_lines", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_custom_lines huaweicloud_dns_custom_lines} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsCustomLinesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsCustomLinesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_custom_lines', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._lineId = config.lineId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // line_id - computed: false, optional: true, required: false + private _lineId?: string; + public get lineId() { + return this.getStringAttribute('line_id'); + } + public set lineId(value: string) { + this._lineId = value; + } + public resetLineId() { + this._lineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lineIdInput() { + return this._lineId; + } + + // lines - computed: true, optional: false, required: false + private _lines = new DataHuaweicloudDnsCustomLinesLinesList(this, "lines", false); + public get lines() { + return this._lines; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + line_id: cdktf.stringToTerraform(this._lineId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + line_id: { + value: cdktf.stringToHclTerraform(this._lineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/README.md new file mode 100644 index 00000000..b03607df --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_floating_ptrrecords` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_floating_ptrrecords`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/index.ts new file mode 100644 index 00000000..3bb5671c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-floating-ptrrecords/index.ts @@ -0,0 +1,443 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsFloatingPtrrecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the domain name of the PTR record. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#domain_name DataHuaweicloudDnsFloatingPtrrecords#domain_name} + */ + readonly domainName?: string; + /** + * Specifies the enterprise project ID corresponding to the PTR record. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#enterprise_project_id DataHuaweicloudDnsFloatingPtrrecords#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#id DataHuaweicloudDnsFloatingPtrrecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the EIP address of the PTR record. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#public_ip DataHuaweicloudDnsFloatingPtrrecords#public_ip} + */ + readonly publicIp?: string; + /** + * Specifies the ID of the PTR record. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#record_id DataHuaweicloudDnsFloatingPtrrecords#record_id} + */ + readonly recordId?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#region DataHuaweicloudDnsFloatingPtrrecords#region} + */ + readonly region?: string; + /** + * Specifies the status of the PTR record. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#status DataHuaweicloudDnsFloatingPtrrecords#status} + */ + readonly status?: string; + /** + * Specifies the key/value pairs to associate with the PTR record. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#tags DataHuaweicloudDnsFloatingPtrrecords#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudDnsFloatingPtrrecordsPtrrecords { +} + +export function dataHuaweicloudDnsFloatingPtrrecordsPtrrecordsToTerraform(struct?: DataHuaweicloudDnsFloatingPtrrecordsPtrrecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsFloatingPtrrecordsPtrrecordsToHclTerraform(struct?: DataHuaweicloudDnsFloatingPtrrecordsPtrrecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsFloatingPtrrecordsPtrrecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsFloatingPtrrecordsPtrrecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsFloatingPtrrecordsPtrrecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ttl - computed: true, optional: false, required: false + public get ttl() { + return this.getNumberAttribute('ttl'); + } +} + +export class DataHuaweicloudDnsFloatingPtrrecordsPtrrecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsFloatingPtrrecordsPtrrecordsOutputReference { + return new DataHuaweicloudDnsFloatingPtrrecordsPtrrecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords huaweicloud_dns_floating_ptrrecords} +*/ +export class DataHuaweicloudDnsFloatingPtrrecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_floating_ptrrecords"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsFloatingPtrrecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsFloatingPtrrecords to import + * @param importFromId The id of the existing DataHuaweicloudDnsFloatingPtrrecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsFloatingPtrrecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_floating_ptrrecords", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_floating_ptrrecords huaweicloud_dns_floating_ptrrecords} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsFloatingPtrrecordsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsFloatingPtrrecordsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_floating_ptrrecords', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainName = config.domainName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._publicIp = config.publicIp; + this._recordId = config.recordId; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_name - computed: false, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ptrrecords - computed: true, optional: false, required: false + private _ptrrecords = new DataHuaweicloudDnsFloatingPtrrecordsPtrrecordsList(this, "ptrrecords", false); + public get ptrrecords() { + return this._ptrrecords; + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // record_id - computed: false, optional: true, required: false + private _recordId?: string; + public get recordId() { + return this.getStringAttribute('record_id'); + } + public set recordId(value: string) { + this._recordId = value; + } + public resetRecordId() { + this._recordId = undefined; + } + // Temporarily expose input value. Use with caution. + public get recordIdInput() { + return this._recordId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_name: cdktf.stringToTerraform(this._domainName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + public_ip: cdktf.stringToTerraform(this._publicIp), + record_id: cdktf.stringToTerraform(this._recordId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + record_id: { + value: cdktf.stringToHclTerraform(this._recordId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/README.md new file mode 100644 index 00000000..21a421ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_line_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_line_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/index.ts new file mode 100644 index 00000000..98ad9de8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-line-groups/index.ts @@ -0,0 +1,317 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsLineGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups#id DataHuaweicloudDnsLineGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the line group. Fuzzy search is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups#line_id DataHuaweicloudDnsLineGroups#line_id} + */ + readonly lineId?: string; + /** + * Specifies the name of the line group. Fuzzy search is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups#name DataHuaweicloudDnsLineGroups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups#region DataHuaweicloudDnsLineGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDnsLineGroupsGroups { +} + +export function dataHuaweicloudDnsLineGroupsGroupsToTerraform(struct?: DataHuaweicloudDnsLineGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsLineGroupsGroupsToHclTerraform(struct?: DataHuaweicloudDnsLineGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsLineGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsLineGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsLineGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // lines - computed: true, optional: false, required: false + public get lines() { + return cdktf.Fn.tolist(this.getListAttribute('lines')); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDnsLineGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsLineGroupsGroupsOutputReference { + return new DataHuaweicloudDnsLineGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups huaweicloud_dns_line_groups} +*/ +export class DataHuaweicloudDnsLineGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_line_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsLineGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsLineGroups to import + * @param importFromId The id of the existing DataHuaweicloudDnsLineGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsLineGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_line_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_line_groups huaweicloud_dns_line_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsLineGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsLineGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_line_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._lineId = config.lineId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudDnsLineGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // line_id - computed: false, optional: true, required: false + private _lineId?: string; + public get lineId() { + return this.getStringAttribute('line_id'); + } + public set lineId(value: string) { + this._lineId = value; + } + public resetLineId() { + this._lineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lineIdInput() { + return this._lineId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + line_id: cdktf.stringToTerraform(this._lineId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + line_id: { + value: cdktf.stringToHclTerraform(this._lineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/README.md new file mode 100644 index 00000000..2a351d41 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_nameservers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_nameservers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/index.ts new file mode 100644 index 00000000..16040f33 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-nameservers/index.ts @@ -0,0 +1,383 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsNameserversConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers#id DataHuaweicloudDnsNameservers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers#region DataHuaweicloudDnsNameservers#region} + */ + readonly region?: string; + /** + * Specifies the region to which the name server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers#server_region DataHuaweicloudDnsNameservers#server_region} + */ + readonly serverRegion?: string; + /** + * Specifies the type of the name server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers#type DataHuaweicloudDnsNameservers#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDnsNameserversNameserversNsRecords { +} + +export function dataHuaweicloudDnsNameserversNameserversNsRecordsToTerraform(struct?: DataHuaweicloudDnsNameserversNameserversNsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsNameserversNameserversNsRecordsToHclTerraform(struct?: DataHuaweicloudDnsNameserversNameserversNsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsNameserversNameserversNsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsNameserversNameserversNsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsNameserversNameserversNsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // hostname - computed: true, optional: false, required: false + public get hostname() { + return this.getStringAttribute('hostname'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } +} + +export class DataHuaweicloudDnsNameserversNameserversNsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsNameserversNameserversNsRecordsOutputReference { + return new DataHuaweicloudDnsNameserversNameserversNsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDnsNameserversNameservers { +} + +export function dataHuaweicloudDnsNameserversNameserversToTerraform(struct?: DataHuaweicloudDnsNameserversNameservers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsNameserversNameserversToHclTerraform(struct?: DataHuaweicloudDnsNameserversNameservers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsNameserversNameserversOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsNameserversNameservers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsNameserversNameservers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ns_records - computed: true, optional: false, required: false + private _nsRecords = new DataHuaweicloudDnsNameserversNameserversNsRecordsList(this, "ns_records", false); + public get nsRecords() { + return this._nsRecords; + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDnsNameserversNameserversList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsNameserversNameserversOutputReference { + return new DataHuaweicloudDnsNameserversNameserversOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers huaweicloud_dns_nameservers} +*/ +export class DataHuaweicloudDnsNameservers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_nameservers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsNameservers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsNameservers to import + * @param importFromId The id of the existing DataHuaweicloudDnsNameservers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsNameservers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_nameservers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_nameservers huaweicloud_dns_nameservers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsNameserversConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsNameserversConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_nameservers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._serverRegion = config.serverRegion; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nameservers - computed: true, optional: false, required: false + private _nameservers = new DataHuaweicloudDnsNameserversNameserversList(this, "nameservers", false); + public get nameservers() { + return this._nameservers; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_region - computed: false, optional: true, required: false + private _serverRegion?: string; + public get serverRegion() { + return this.getStringAttribute('server_region'); + } + public set serverRegion(value: string) { + this._serverRegion = value; + } + public resetServerRegion() { + this._serverRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverRegionInput() { + return this._serverRegion; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + server_region: cdktf.stringToTerraform(this._serverRegion), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_region: { + value: cdktf.stringToHclTerraform(this._serverRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/README.md new file mode 100644 index 00000000..7f9c5159 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/index.ts new file mode 100644 index 00000000..6e8b334e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-quotas/index.ts @@ -0,0 +1,299 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the account ID of IAM user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas#domain_id DataHuaweicloudDnsQuotas#domain_id} + */ + readonly domainId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas#id DataHuaweicloudDnsQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas#region DataHuaweicloudDnsQuotas#region} + */ + readonly region?: string; + /** + * Specifies the resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas#type DataHuaweicloudDnsQuotas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudDnsQuotasQuotas { +} + +export function dataHuaweicloudDnsQuotasQuotasToTerraform(struct?: DataHuaweicloudDnsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsQuotasQuotasToHclTerraform(struct?: DataHuaweicloudDnsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max - computed: true, optional: false, required: false + public get max() { + return this.getNumberAttribute('max'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudDnsQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsQuotasQuotasOutputReference { + return new DataHuaweicloudDnsQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas huaweicloud_dns_quotas} +*/ +export class DataHuaweicloudDnsQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsQuotas to import + * @param importFromId The id of the existing DataHuaweicloudDnsQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_quotas huaweicloud_dns_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsQuotasConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsQuotasConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainId = config.domainId; + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_id - computed: false, optional: false, required: true + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudDnsQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_id: cdktf.stringToTerraform(this._domainId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/README.md new file mode 100644 index 00000000..9f970540 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_recordsets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_recordsets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/index.ts new file mode 100644 index 00000000..d0e16f5f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-recordsets/index.ts @@ -0,0 +1,517 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsRecordsetsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#id DataHuaweicloudDnsRecordsets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the resolution line ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#line_id DataHuaweicloudDnsRecordsets#line_id} + */ + readonly lineId?: string; + /** + * Specifies the name of the recordset to be queried. Fuzzy matching will work. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#name DataHuaweicloudDnsRecordsets#name} + */ + readonly name?: string; + /** + * Specifies the ID of the recordset to be queried. Fuzzy matching will work. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#recordset_id DataHuaweicloudDnsRecordsets#recordset_id} + */ + readonly recordsetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#region DataHuaweicloudDnsRecordsets#region} + */ + readonly region?: string; + /** + * Specifies the query criteria search mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#search_mode DataHuaweicloudDnsRecordsets#search_mode} + */ + readonly searchMode?: string; + /** + * Specifies the status of the recordset to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#status DataHuaweicloudDnsRecordsets#status} + */ + readonly status?: string; + /** + * Specifies the resource tag. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#tags DataHuaweicloudDnsRecordsets#tags} + */ + readonly tags?: string; + /** + * Specifies the recordset type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#type DataHuaweicloudDnsRecordsets#type} + */ + readonly type?: string; + /** + * Specifies the zone ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#zone_id DataHuaweicloudDnsRecordsets#zone_id} + */ + readonly zoneId: string; +} +export interface DataHuaweicloudDnsRecordsetsRecordsets { +} + +export function dataHuaweicloudDnsRecordsetsRecordsetsToTerraform(struct?: DataHuaweicloudDnsRecordsetsRecordsets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsRecordsetsRecordsetsToHclTerraform(struct?: DataHuaweicloudDnsRecordsetsRecordsets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsRecordsetsRecordsetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsRecordsetsRecordsets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsRecordsetsRecordsets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default - computed: true, optional: false, required: false + public get default() { + return this.getBooleanAttribute('default'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // line_id - computed: true, optional: false, required: false + public get lineId() { + return this.getStringAttribute('line_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // records - computed: true, optional: false, required: false + public get records() { + return this.getListAttribute('records'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ttl - computed: true, optional: false, required: false + public get ttl() { + return this.getNumberAttribute('ttl'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } + + // zone_id - computed: true, optional: false, required: false + public get zoneId() { + return this.getStringAttribute('zone_id'); + } + + // zone_name - computed: true, optional: false, required: false + public get zoneName() { + return this.getStringAttribute('zone_name'); + } +} + +export class DataHuaweicloudDnsRecordsetsRecordsetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsRecordsetsRecordsetsOutputReference { + return new DataHuaweicloudDnsRecordsetsRecordsetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets huaweicloud_dns_recordsets} +*/ +export class DataHuaweicloudDnsRecordsets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_recordsets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsRecordsets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsRecordsets to import + * @param importFromId The id of the existing DataHuaweicloudDnsRecordsets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsRecordsets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_recordsets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_recordsets huaweicloud_dns_recordsets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsRecordsetsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsRecordsetsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_recordsets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._lineId = config.lineId; + this._name = config.name; + this._recordsetId = config.recordsetId; + this._region = config.region; + this._searchMode = config.searchMode; + this._status = config.status; + this._tags = config.tags; + this._type = config.type; + this._zoneId = config.zoneId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // line_id - computed: false, optional: true, required: false + private _lineId?: string; + public get lineId() { + return this.getStringAttribute('line_id'); + } + public set lineId(value: string) { + this._lineId = value; + } + public resetLineId() { + this._lineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lineIdInput() { + return this._lineId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // recordset_id - computed: false, optional: true, required: false + private _recordsetId?: string; + public get recordsetId() { + return this.getStringAttribute('recordset_id'); + } + public set recordsetId(value: string) { + this._recordsetId = value; + } + public resetRecordsetId() { + this._recordsetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get recordsetIdInput() { + return this._recordsetId; + } + + // recordsets - computed: true, optional: false, required: false + private _recordsets = new DataHuaweicloudDnsRecordsetsRecordsetsList(this, "recordsets", false); + public get recordsets() { + return this._recordsets; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // search_mode - computed: false, optional: true, required: false + private _searchMode?: string; + public get searchMode() { + return this.getStringAttribute('search_mode'); + } + public set searchMode(value: string) { + this._searchMode = value; + } + public resetSearchMode() { + this._searchMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchModeInput() { + return this._searchMode; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: string; + public get tags() { + return this.getStringAttribute('tags'); + } + public set tags(value: string) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // zone_id - computed: false, optional: false, required: true + private _zoneId?: string; + public get zoneId() { + return this.getStringAttribute('zone_id'); + } + public set zoneId(value: string) { + this._zoneId = value; + } + // Temporarily expose input value. Use with caution. + public get zoneIdInput() { + return this._zoneId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + line_id: cdktf.stringToTerraform(this._lineId), + name: cdktf.stringToTerraform(this._name), + recordset_id: cdktf.stringToTerraform(this._recordsetId), + region: cdktf.stringToTerraform(this._region), + search_mode: cdktf.stringToTerraform(this._searchMode), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.stringToTerraform(this._tags), + type: cdktf.stringToTerraform(this._type), + zone_id: cdktf.stringToTerraform(this._zoneId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + line_id: { + value: cdktf.stringToHclTerraform(this._lineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recordset_id: { + value: cdktf.stringToHclTerraform(this._recordsetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + search_mode: { + value: cdktf.stringToHclTerraform(this._searchMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.stringToHclTerraform(this._tags), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + zone_id: { + value: cdktf.stringToHclTerraform(this._zoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/README.md new file mode 100644 index 00000000..c571aeb8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dns_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dns_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/index.ts new file mode 100644 index 00000000..e501737a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dns-zones/index.ts @@ -0,0 +1,539 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDnsZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID which the zone associated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#enterprise_project_id DataHuaweicloudDnsZones#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#id DataHuaweicloudDnsZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the zone name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#name DataHuaweicloudDnsZones#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#region DataHuaweicloudDnsZones#region} + */ + readonly region?: string; + /** + * Specifies the query criteria search mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#search_mode DataHuaweicloudDnsZones#search_mode} + */ + readonly searchMode?: string; + /** + * Specifies the zone status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#status DataHuaweicloudDnsZones#status} + */ + readonly status?: string; + /** + * Specifies the resource tag. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#tags DataHuaweicloudDnsZones#tags} + */ + readonly tags?: string; + /** + * Specifies the zone type. The value can be **public** or **private**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#zone_type DataHuaweicloudDnsZones#zone_type} + */ + readonly zoneType: string; +} +export interface DataHuaweicloudDnsZonesZonesRouters { +} + +export function dataHuaweicloudDnsZonesZonesRoutersToTerraform(struct?: DataHuaweicloudDnsZonesZonesRouters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsZonesZonesRoutersToHclTerraform(struct?: DataHuaweicloudDnsZonesZonesRouters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsZonesZonesRoutersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsZonesZonesRouters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsZonesZonesRouters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // router_id - computed: true, optional: false, required: false + public get routerId() { + return this.getStringAttribute('router_id'); + } + + // router_region - computed: true, optional: false, required: false + public get routerRegion() { + return this.getStringAttribute('router_region'); + } +} + +export class DataHuaweicloudDnsZonesZonesRoutersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsZonesZonesRoutersOutputReference { + return new DataHuaweicloudDnsZonesZonesRoutersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDnsZonesZones { +} + +export function dataHuaweicloudDnsZonesZonesToTerraform(struct?: DataHuaweicloudDnsZonesZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDnsZonesZonesToHclTerraform(struct?: DataHuaweicloudDnsZonesZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDnsZonesZonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDnsZonesZones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDnsZonesZones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // email - computed: true, optional: false, required: false + public get email() { + return this.getStringAttribute('email'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // masters - computed: true, optional: false, required: false + public get masters() { + return this.getListAttribute('masters'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // record_num - computed: true, optional: false, required: false + public get recordNum() { + return this.getNumberAttribute('record_num'); + } + + // routers - computed: true, optional: false, required: false + private _routers = new DataHuaweicloudDnsZonesZonesRoutersList(this, "routers", false); + public get routers() { + return this._routers; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ttl - computed: true, optional: false, required: false + public get ttl() { + return this.getNumberAttribute('ttl'); + } + + // zone_type - computed: true, optional: false, required: false + public get zoneType() { + return this.getStringAttribute('zone_type'); + } +} + +export class DataHuaweicloudDnsZonesZonesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDnsZonesZonesOutputReference { + return new DataHuaweicloudDnsZonesZonesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones huaweicloud_dns_zones} +*/ +export class DataHuaweicloudDnsZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDnsZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDnsZones to import + * @param importFromId The id of the existing DataHuaweicloudDnsZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDnsZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dns_zones huaweicloud_dns_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDnsZonesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDnsZonesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._searchMode = config.searchMode; + this._status = config.status; + this._tags = config.tags; + this._zoneType = config.zoneType; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // search_mode - computed: false, optional: true, required: false + private _searchMode?: string; + public get searchMode() { + return this.getStringAttribute('search_mode'); + } + public set searchMode(value: string) { + this._searchMode = value; + } + public resetSearchMode() { + this._searchMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchModeInput() { + return this._searchMode; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: string; + public get tags() { + return this.getStringAttribute('tags'); + } + public set tags(value: string) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // zone_type - computed: false, optional: false, required: true + private _zoneType?: string; + public get zoneType() { + return this.getStringAttribute('zone_type'); + } + public set zoneType(value: string) { + this._zoneType = value; + } + // Temporarily expose input value. Use with caution. + public get zoneTypeInput() { + return this._zoneType; + } + + // zones - computed: true, optional: false, required: false + private _zones = new DataHuaweicloudDnsZonesZonesList(this, "zones", false); + public get zones() { + return this._zones; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + search_mode: cdktf.stringToTerraform(this._searchMode), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.stringToTerraform(this._tags), + zone_type: cdktf.stringToTerraform(this._zoneType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + search_mode: { + value: cdktf.stringToHclTerraform(this._searchMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.stringToHclTerraform(this._tags), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + zone_type: { + value: cdktf.stringToHclTerraform(this._zoneType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/README.md new file mode 100644 index 00000000..4cd3b11e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_drs_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_drs_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/index.ts new file mode 100644 index 00000000..97c435cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-availability-zones/index.ts @@ -0,0 +1,277 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDrsAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#direction DataHuaweicloudDrsAvailabilityZones#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#engine_type DataHuaweicloudDrsAvailabilityZones#engine_type} + */ + readonly engineType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#id DataHuaweicloudDrsAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#multi_write DataHuaweicloudDrsAvailabilityZones#multi_write} + */ + readonly multiWrite?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#node_type DataHuaweicloudDrsAvailabilityZones#node_type} + */ + readonly nodeType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#region DataHuaweicloudDrsAvailabilityZones#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#type DataHuaweicloudDrsAvailabilityZones#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones huaweicloud_drs_availability_zones} +*/ +export class DataHuaweicloudDrsAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_drs_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDrsAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDrsAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudDrsAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDrsAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_drs_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_availability_zones huaweicloud_drs_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDrsAvailabilityZonesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDrsAvailabilityZonesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_drs_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._direction = config.direction; + this._engineType = config.engineType; + this._id = config.id; + this._multiWrite = config.multiWrite; + this._nodeType = config.nodeType; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // engine_type - computed: false, optional: false, required: true + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // multi_write - computed: false, optional: true, required: false + private _multiWrite?: boolean | cdktf.IResolvable; + public get multiWrite() { + return this.getBooleanAttribute('multi_write'); + } + public set multiWrite(value: boolean | cdktf.IResolvable) { + this._multiWrite = value; + } + public resetMultiWrite() { + this._multiWrite = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiWriteInput() { + return this._multiWrite; + } + + // names - computed: true, optional: false, required: false + public get names() { + return this.getListAttribute('names'); + } + + // node_type - computed: false, optional: false, required: true + private _nodeType?: string; + public get nodeType() { + return this.getStringAttribute('node_type'); + } + public set nodeType(value: string) { + this._nodeType = value; + } + // Temporarily expose input value. Use with caution. + public get nodeTypeInput() { + return this._nodeType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + direction: cdktf.stringToTerraform(this._direction), + engine_type: cdktf.stringToTerraform(this._engineType), + id: cdktf.stringToTerraform(this._id), + multi_write: cdktf.booleanToTerraform(this._multiWrite), + node_type: cdktf.stringToTerraform(this._nodeType), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multi_write: { + value: cdktf.booleanToHclTerraform(this._multiWrite), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + node_type: { + value: cdktf.stringToHclTerraform(this._nodeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/README.md new file mode 100644 index 00000000..f5d8e3b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_drs_node_types` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_drs_node_types`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/index.ts new file mode 100644 index 00000000..80f23e76 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-drs-node-types/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDrsNodeTypesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#direction DataHuaweicloudDrsNodeTypes#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#engine_type DataHuaweicloudDrsNodeTypes#engine_type} + */ + readonly engineType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#id DataHuaweicloudDrsNodeTypes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#multi_write DataHuaweicloudDrsNodeTypes#multi_write} + */ + readonly multiWrite?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#region DataHuaweicloudDrsNodeTypes#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#type DataHuaweicloudDrsNodeTypes#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types huaweicloud_drs_node_types} +*/ +export class DataHuaweicloudDrsNodeTypes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_drs_node_types"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDrsNodeTypes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDrsNodeTypes to import + * @param importFromId The id of the existing DataHuaweicloudDrsNodeTypes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDrsNodeTypes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_drs_node_types", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/drs_node_types huaweicloud_drs_node_types} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDrsNodeTypesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDrsNodeTypesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_drs_node_types', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._direction = config.direction; + this._engineType = config.engineType; + this._id = config.id; + this._multiWrite = config.multiWrite; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // engine_type - computed: false, optional: false, required: true + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // multi_write - computed: false, optional: true, required: false + private _multiWrite?: boolean | cdktf.IResolvable; + public get multiWrite() { + return this.getBooleanAttribute('multi_write'); + } + public set multiWrite(value: boolean | cdktf.IResolvable) { + this._multiWrite = value; + } + public resetMultiWrite() { + this._multiWrite = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiWriteInput() { + return this._multiWrite; + } + + // node_types - computed: true, optional: false, required: false + public get nodeTypes() { + return this.getListAttribute('node_types'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + direction: cdktf.stringToTerraform(this._direction), + engine_type: cdktf.stringToTerraform(this._engineType), + id: cdktf.stringToTerraform(this._id), + multi_write: cdktf.booleanToTerraform(this._multiWrite), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multi_write: { + value: cdktf.booleanToHclTerraform(this._multiWrite), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/README.md new file mode 100644 index 00000000..4f379c1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_alarm_subscriptions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_alarm_subscriptions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/index.ts new file mode 100644 index 00000000..b20ebf35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-alarm-subscriptions/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsAlarmSubscriptionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions#id DataHuaweicloudDwsAlarmSubscriptions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions#region DataHuaweicloudDwsAlarmSubscriptions#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsAlarmSubscriptionsSubscriptions { +} + +export function dataHuaweicloudDwsAlarmSubscriptionsSubscriptionsToTerraform(struct?: DataHuaweicloudDwsAlarmSubscriptionsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsAlarmSubscriptionsSubscriptionsToHclTerraform(struct?: DataHuaweicloudDwsAlarmSubscriptionsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsAlarmSubscriptionsSubscriptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsAlarmSubscriptionsSubscriptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsAlarmSubscriptionsSubscriptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alarm_level - computed: true, optional: false, required: false + public get alarmLevel() { + return this.getStringAttribute('alarm_level'); + } + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getNumberAttribute('enable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // language - computed: true, optional: false, required: false + public get language() { + return this.getStringAttribute('language'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // notification_target - computed: true, optional: false, required: false + public get notificationTarget() { + return this.getStringAttribute('notification_target'); + } + + // notification_target_name - computed: true, optional: false, required: false + public get notificationTargetName() { + return this.getStringAttribute('notification_target_name'); + } + + // notification_target_type - computed: true, optional: false, required: false + public get notificationTargetType() { + return this.getStringAttribute('notification_target_type'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } +} + +export class DataHuaweicloudDwsAlarmSubscriptionsSubscriptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsAlarmSubscriptionsSubscriptionsOutputReference { + return new DataHuaweicloudDwsAlarmSubscriptionsSubscriptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions huaweicloud_dws_alarm_subscriptions} +*/ +export class DataHuaweicloudDwsAlarmSubscriptions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_alarm_subscriptions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsAlarmSubscriptions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsAlarmSubscriptions to import + * @param importFromId The id of the existing DataHuaweicloudDwsAlarmSubscriptions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsAlarmSubscriptions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_alarm_subscriptions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_alarm_subscriptions huaweicloud_dws_alarm_subscriptions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsAlarmSubscriptionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsAlarmSubscriptionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_alarm_subscriptions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subscriptions - computed: true, optional: false, required: false + private _subscriptions = new DataHuaweicloudDwsAlarmSubscriptionsSubscriptionsList(this, "subscriptions", false); + public get subscriptions() { + return this._subscriptions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/README.md new file mode 100644 index 00000000..24e2bbac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/index.ts new file mode 100644 index 00000000..9e42d28e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-availability-zones/index.ts @@ -0,0 +1,242 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones#id DataHuaweicloudDwsAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones#region DataHuaweicloudDwsAvailabilityZones#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsAvailabilityZonesAvailabilityZones { +} + +export function dataHuaweicloudDwsAvailabilityZonesAvailabilityZonesToTerraform(struct?: DataHuaweicloudDwsAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsAvailabilityZonesAvailabilityZonesToHclTerraform(struct?: DataHuaweicloudDwsAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsAvailabilityZonesAvailabilityZonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsAvailabilityZonesAvailabilityZones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsAvailabilityZonesAvailabilityZones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // public_border_group - computed: true, optional: false, required: false + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDwsAvailabilityZonesAvailabilityZonesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsAvailabilityZonesAvailabilityZonesOutputReference { + return new DataHuaweicloudDwsAvailabilityZonesAvailabilityZonesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones huaweicloud_dws_availability_zones} +*/ +export class DataHuaweicloudDwsAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudDwsAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_availability_zones huaweicloud_dws_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: false, required: false + private _availabilityZones = new DataHuaweicloudDwsAvailabilityZonesAvailabilityZonesList(this, "availability_zones", false); + public get availabilityZones() { + return this._availabilityZones; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/README.md new file mode 100644 index 00000000..997678b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_cluster_cns` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_cluster_cns`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/index.ts new file mode 100644 index 00000000..b352cd95 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-cns/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClusterCnsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the CNs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns#cluster_id DataHuaweicloudDwsClusterCns#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns#id DataHuaweicloudDwsClusterCns#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns#region DataHuaweicloudDwsClusterCns#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClusterCnsCns { +} + +export function dataHuaweicloudDwsClusterCnsCnsToTerraform(struct?: DataHuaweicloudDwsClusterCnsCns): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterCnsCnsToHclTerraform(struct?: DataHuaweicloudDwsClusterCnsCns): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterCnsCnsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterCnsCns | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterCnsCns | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } +} + +export class DataHuaweicloudDwsClusterCnsCnsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterCnsCnsOutputReference { + return new DataHuaweicloudDwsClusterCnsCnsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns huaweicloud_dws_cluster_cns} +*/ +export class DataHuaweicloudDwsClusterCns extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_cns"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusterCns resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusterCns to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusterCns that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusterCns to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_cns", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_cns huaweicloud_dws_cluster_cns} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClusterCnsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClusterCnsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_cns', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cns - computed: true, optional: false, required: false + private _cns = new DataHuaweicloudDwsClusterCnsCnsList(this, "cns", false); + public get cns() { + return this._cns; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_num - computed: true, optional: false, required: false + public get maxNum() { + return this.getNumberAttribute('max_num'); + } + + // min_num - computed: true, optional: false, required: false + public get minNum() { + return this.getNumberAttribute('min_num'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/README.md new file mode 100644 index 00000000..5c064a6f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_cluster_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_cluster_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/index.ts new file mode 100644 index 00000000..ec404180 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-logs/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClusterLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs#cluster_id DataHuaweicloudDwsClusterLogs#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs#id DataHuaweicloudDwsClusterLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs#region DataHuaweicloudDwsClusterLogs#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClusterLogsLogs { +} + +export function dataHuaweicloudDwsClusterLogsLogsToTerraform(struct?: DataHuaweicloudDwsClusterLogsLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterLogsLogsToHclTerraform(struct?: DataHuaweicloudDwsClusterLogsLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterLogsLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterLogsLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterLogsLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_url - computed: true, optional: false, required: false + public get accessUrl() { + return this.getStringAttribute('access_url'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDwsClusterLogsLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterLogsLogsOutputReference { + return new DataHuaweicloudDwsClusterLogsLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs huaweicloud_dws_cluster_logs} +*/ +export class DataHuaweicloudDwsClusterLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusterLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusterLogs to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusterLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusterLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_logs huaweicloud_dws_cluster_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClusterLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClusterLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logs - computed: true, optional: false, required: false + private _logs = new DataHuaweicloudDwsClusterLogsLogsList(this, "logs", false); + public get logs() { + return this._logs; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/README.md new file mode 100644 index 00000000..45845805 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_cluster_nodes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_cluster_nodes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/index.ts new file mode 100644 index 00000000..02634bba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-nodes/index.ts @@ -0,0 +1,379 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClusterNodesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#cluster_id DataHuaweicloudDwsClusterNodes#cluster_id} + */ + readonly clusterId: string; + /** + * Specifies the type corresponding to the `filter_by` parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#filter DataHuaweicloudDwsClusterNodes#filter} + */ + readonly filter?: string; + /** + * Specifies the query filter criteria. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#filter_by DataHuaweicloudDwsClusterNodes#filter_by} + */ + readonly filterBy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#id DataHuaweicloudDwsClusterNodes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#node_id DataHuaweicloudDwsClusterNodes#node_id} + */ + readonly nodeId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#region DataHuaweicloudDwsClusterNodes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClusterNodesNodes { +} + +export function dataHuaweicloudDwsClusterNodesNodesToTerraform(struct?: DataHuaweicloudDwsClusterNodesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterNodesNodesToHclTerraform(struct?: DataHuaweicloudDwsClusterNodesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterNodesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterNodesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterNodesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alias_name - computed: true, optional: false, required: false + public get aliasName() { + return this.getStringAttribute('alias_name'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // inst_create_type - computed: true, optional: false, required: false + public get instCreateType() { + return this.getStringAttribute('inst_create_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // spec - computed: true, optional: false, required: false + public get spec() { + return this.getStringAttribute('spec'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // sub_status - computed: true, optional: false, required: false + public get subStatus() { + return this.getStringAttribute('sub_status'); + } +} + +export class DataHuaweicloudDwsClusterNodesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterNodesNodesOutputReference { + return new DataHuaweicloudDwsClusterNodesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes huaweicloud_dws_cluster_nodes} +*/ +export class DataHuaweicloudDwsClusterNodes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_nodes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusterNodes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusterNodes to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusterNodes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusterNodes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_nodes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_nodes huaweicloud_dws_cluster_nodes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClusterNodesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClusterNodesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_nodes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._filter = config.filter; + this._filterBy = config.filterBy; + this._id = config.id; + this._nodeId = config.nodeId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // filter - computed: false, optional: true, required: false + private _filter?: string; + public get filter() { + return this.getStringAttribute('filter'); + } + public set filter(value: string) { + this._filter = value; + } + public resetFilter() { + this._filter = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter; + } + + // filter_by - computed: false, optional: true, required: false + private _filterBy?: string; + public get filterBy() { + return this.getStringAttribute('filter_by'); + } + public set filterBy(value: string) { + this._filterBy = value; + } + public resetFilterBy() { + this._filterBy = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterByInput() { + return this._filterBy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudDwsClusterNodesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + filter: cdktf.stringToTerraform(this._filter), + filter_by: cdktf.stringToTerraform(this._filterBy), + id: cdktf.stringToTerraform(this._id), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter: { + value: cdktf.stringToHclTerraform(this._filter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_by: { + value: cdktf.stringToHclTerraform(this._filterBy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/README.md new file mode 100644 index 00000000..06472b21 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_cluster_parameters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_cluster_parameters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/index.ts new file mode 100644 index 00000000..3d66941e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-parameters/index.ts @@ -0,0 +1,373 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClusterParametersConfig extends cdktf.TerraformMetaArguments { + /** + * The DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters#cluster_id DataHuaweicloudDwsClusterParameters#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters#id DataHuaweicloudDwsClusterParameters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters#region DataHuaweicloudDwsClusterParameters#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClusterParametersParametersValues { +} + +export function dataHuaweicloudDwsClusterParametersParametersValuesToTerraform(struct?: DataHuaweicloudDwsClusterParametersParametersValues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterParametersParametersValuesToHclTerraform(struct?: DataHuaweicloudDwsClusterParametersParametersValues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterParametersParametersValuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterParametersParametersValues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterParametersParametersValues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default_value - computed: true, optional: false, required: false + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudDwsClusterParametersParametersValuesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterParametersParametersValuesOutputReference { + return new DataHuaweicloudDwsClusterParametersParametersValuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsClusterParametersParameters { +} + +export function dataHuaweicloudDwsClusterParametersParametersToTerraform(struct?: DataHuaweicloudDwsClusterParametersParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterParametersParametersToHclTerraform(struct?: DataHuaweicloudDwsClusterParametersParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterParametersParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterParametersParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterParametersParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + + // restart_required - computed: true, optional: false, required: false + public get restartRequired() { + return this.getBooleanAttribute('restart_required'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // value_range - computed: true, optional: false, required: false + public get valueRange() { + return this.getStringAttribute('value_range'); + } + + // values - computed: true, optional: false, required: false + private _values = new DataHuaweicloudDwsClusterParametersParametersValuesList(this, "values", false); + public get values() { + return this._values; + } +} + +export class DataHuaweicloudDwsClusterParametersParametersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterParametersParametersOutputReference { + return new DataHuaweicloudDwsClusterParametersParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters huaweicloud_dws_cluster_parameters} +*/ +export class DataHuaweicloudDwsClusterParameters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_parameters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusterParameters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusterParameters to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusterParameters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusterParameters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_parameters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_parameters huaweicloud_dws_cluster_parameters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClusterParametersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClusterParametersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_parameters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // parameters - computed: true, optional: false, required: false + private _parameters = new DataHuaweicloudDwsClusterParametersParametersList(this, "parameters", false); + public get parameters() { + return this._parameters; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/README.md new file mode 100644 index 00000000..3bd6c762 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_cluster_snapshot_statistics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_cluster_snapshot_statistics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/index.ts new file mode 100644 index 00000000..270e3611 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-snapshot-statistics/index.ts @@ -0,0 +1,264 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClusterSnapshotStatisticsConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the ID of the DWS cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics#cluster_id DataHuaweicloudDwsClusterSnapshotStatistics#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics#id DataHuaweicloudDwsClusterSnapshotStatistics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics#region DataHuaweicloudDwsClusterSnapshotStatistics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClusterSnapshotStatisticsStatistics { +} + +export function dataHuaweicloudDwsClusterSnapshotStatisticsStatisticsToTerraform(struct?: DataHuaweicloudDwsClusterSnapshotStatisticsStatistics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterSnapshotStatisticsStatisticsToHclTerraform(struct?: DataHuaweicloudDwsClusterSnapshotStatisticsStatistics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterSnapshotStatisticsStatisticsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterSnapshotStatisticsStatistics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterSnapshotStatisticsStatistics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getNumberAttribute('value'); + } +} + +export class DataHuaweicloudDwsClusterSnapshotStatisticsStatisticsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterSnapshotStatisticsStatisticsOutputReference { + return new DataHuaweicloudDwsClusterSnapshotStatisticsStatisticsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics huaweicloud_dws_cluster_snapshot_statistics} +*/ +export class DataHuaweicloudDwsClusterSnapshotStatistics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_snapshot_statistics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusterSnapshotStatistics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusterSnapshotStatistics to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusterSnapshotStatistics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusterSnapshotStatistics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_snapshot_statistics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_snapshot_statistics huaweicloud_dws_cluster_snapshot_statistics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClusterSnapshotStatisticsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClusterSnapshotStatisticsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_snapshot_statistics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // statistics - computed: true, optional: false, required: false + private _statistics = new DataHuaweicloudDwsClusterSnapshotStatisticsStatisticsList(this, "statistics", false); + public get statistics() { + return this._statistics; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/README.md new file mode 100644 index 00000000..e9018ef2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_cluster_topo_rings` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_cluster_topo_rings`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/index.ts new file mode 100644 index 00000000..ec99e536 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-cluster-topo-rings/index.ts @@ -0,0 +1,375 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClusterTopoRingsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the topology rings belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings#cluster_id DataHuaweicloudDwsClusterTopoRings#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings#id DataHuaweicloudDwsClusterTopoRings#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings#region DataHuaweicloudDwsClusterTopoRings#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClusterTopoRingsRingsInstances { +} + +export function dataHuaweicloudDwsClusterTopoRingsRingsInstancesToTerraform(struct?: DataHuaweicloudDwsClusterTopoRingsRingsInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterTopoRingsRingsInstancesToHclTerraform(struct?: DataHuaweicloudDwsClusterTopoRingsRingsInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterTopoRingsRingsInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterTopoRingsRingsInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterTopoRingsRingsInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // eip_address - computed: true, optional: false, required: false + public get eipAddress() { + return this.getStringAttribute('eip_address'); + } + + // elb_address - computed: true, optional: false, required: false + public get elbAddress() { + return this.getStringAttribute('elb_address'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // internal_ip - computed: true, optional: false, required: false + public get internalIp() { + return this.getStringAttribute('internal_ip'); + } + + // internal_mgnt_ip - computed: true, optional: false, required: false + public get internalMgntIp() { + return this.getStringAttribute('internal_mgnt_ip'); + } + + // manage_ip - computed: true, optional: false, required: false + public get manageIp() { + return this.getStringAttribute('manage_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_ip - computed: true, optional: false, required: false + public get trafficIp() { + return this.getStringAttribute('traffic_ip'); + } +} + +export class DataHuaweicloudDwsClusterTopoRingsRingsInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterTopoRingsRingsInstancesOutputReference { + return new DataHuaweicloudDwsClusterTopoRingsRingsInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsClusterTopoRingsRings { +} + +export function dataHuaweicloudDwsClusterTopoRingsRingsToTerraform(struct?: DataHuaweicloudDwsClusterTopoRingsRings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClusterTopoRingsRingsToHclTerraform(struct?: DataHuaweicloudDwsClusterTopoRingsRings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClusterTopoRingsRingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClusterTopoRingsRings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClusterTopoRingsRings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudDwsClusterTopoRingsRingsInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } +} + +export class DataHuaweicloudDwsClusterTopoRingsRingsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClusterTopoRingsRingsOutputReference { + return new DataHuaweicloudDwsClusterTopoRingsRingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings huaweicloud_dws_cluster_topo_rings} +*/ +export class DataHuaweicloudDwsClusterTopoRings extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_topo_rings"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusterTopoRings resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusterTopoRings to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusterTopoRings that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusterTopoRings to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_topo_rings", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_cluster_topo_rings huaweicloud_dws_cluster_topo_rings} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClusterTopoRingsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClusterTopoRingsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_topo_rings', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rings - computed: true, optional: false, required: false + private _rings = new DataHuaweicloudDwsClusterTopoRingsRingsList(this, "rings", false); + public get rings() { + return this._rings; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/README.md new file mode 100644 index 00000000..9b66ac94 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_clusters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_clusters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/index.ts new file mode 100644 index 00000000..ca0b26a7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-clusters/index.ts @@ -0,0 +1,662 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsClustersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters#id DataHuaweicloudDwsClusters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters#region DataHuaweicloudDwsClusters#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsClustersClustersEndpoints { +} + +export function dataHuaweicloudDwsClustersClustersEndpointsToTerraform(struct?: DataHuaweicloudDwsClustersClustersEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClustersClustersEndpointsToHclTerraform(struct?: DataHuaweicloudDwsClustersClustersEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClustersClustersEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClustersClustersEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClustersClustersEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connect_info - computed: true, optional: false, required: false + public get connectInfo() { + return this.getStringAttribute('connect_info'); + } + + // jdbc_url - computed: true, optional: false, required: false + public get jdbcUrl() { + return this.getStringAttribute('jdbc_url'); + } +} + +export class DataHuaweicloudDwsClustersClustersEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClustersClustersEndpointsOutputReference { + return new DataHuaweicloudDwsClustersClustersEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsClustersClustersNodes { +} + +export function dataHuaweicloudDwsClustersClustersNodesToTerraform(struct?: DataHuaweicloudDwsClustersClustersNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClustersClustersNodesToHclTerraform(struct?: DataHuaweicloudDwsClustersClustersNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClustersClustersNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClustersClustersNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClustersClustersNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDwsClustersClustersNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClustersClustersNodesOutputReference { + return new DataHuaweicloudDwsClustersClustersNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsClustersClustersPublicEndpoints { +} + +export function dataHuaweicloudDwsClustersClustersPublicEndpointsToTerraform(struct?: DataHuaweicloudDwsClustersClustersPublicEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClustersClustersPublicEndpointsToHclTerraform(struct?: DataHuaweicloudDwsClustersClustersPublicEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClustersClustersPublicEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClustersClustersPublicEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClustersClustersPublicEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // jdbc_url - computed: true, optional: false, required: false + public get jdbcUrl() { + return this.getStringAttribute('jdbc_url'); + } + + // public_connect_info - computed: true, optional: false, required: false + public get publicConnectInfo() { + return this.getStringAttribute('public_connect_info'); + } +} + +export class DataHuaweicloudDwsClustersClustersPublicEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClustersClustersPublicEndpointsOutputReference { + return new DataHuaweicloudDwsClustersClustersPublicEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsClustersClustersPublicIp { +} + +export function dataHuaweicloudDwsClustersClustersPublicIpToTerraform(struct?: DataHuaweicloudDwsClustersClustersPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClustersClustersPublicIpToHclTerraform(struct?: DataHuaweicloudDwsClustersClustersPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClustersClustersPublicIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClustersClustersPublicIp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClustersClustersPublicIp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // eip_id - computed: true, optional: false, required: false + public get eipId() { + return this.getStringAttribute('eip_id'); + } + + // public_bind_type - computed: true, optional: false, required: false + public get publicBindType() { + return this.getStringAttribute('public_bind_type'); + } +} + +export class DataHuaweicloudDwsClustersClustersPublicIpList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClustersClustersPublicIpOutputReference { + return new DataHuaweicloudDwsClustersClustersPublicIpOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsClustersClusters { +} + +export function dataHuaweicloudDwsClustersClustersToTerraform(struct?: DataHuaweicloudDwsClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsClustersClustersToHclTerraform(struct?: DataHuaweicloudDwsClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsClustersClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsClustersClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsClustersClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DataHuaweicloudDwsClustersClustersEndpointsList(this, "endpoints", false); + public get endpoints() { + return this._endpoints; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_type - computed: true, optional: false, required: false + public get nodeType() { + return this.getStringAttribute('node_type'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudDwsClustersClustersNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // number_of_node - computed: true, optional: false, required: false + public get numberOfNode() { + return this.getNumberAttribute('number_of_node'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // public_endpoints - computed: true, optional: false, required: false + private _publicEndpoints = new DataHuaweicloudDwsClustersClustersPublicEndpointsList(this, "public_endpoints", false); + public get publicEndpoints() { + return this._publicEndpoints; + } + + // public_ip - computed: true, optional: false, required: false + private _publicIp = new DataHuaweicloudDwsClustersClustersPublicIpList(this, "public_ip", false); + public get publicIp() { + return this._publicIp; + } + + // recent_event - computed: true, optional: false, required: false + public get recentEvent() { + return this.getNumberAttribute('recent_event'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // sub_status - computed: true, optional: false, required: false + public get subStatus() { + return this.getStringAttribute('sub_status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // task_status - computed: true, optional: false, required: false + public get taskStatus() { + return this.getStringAttribute('task_status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudDwsClustersClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsClustersClustersOutputReference { + return new DataHuaweicloudDwsClustersClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters huaweicloud_dws_clusters} +*/ +export class DataHuaweicloudDwsClusters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_clusters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsClusters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsClusters to import + * @param importFromId The id of the existing DataHuaweicloudDwsClusters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsClusters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_clusters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_clusters huaweicloud_dws_clusters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsClustersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsClustersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_clusters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // clusters - computed: true, optional: false, required: false + private _clusters = new DataHuaweicloudDwsClustersClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/README.md new file mode 100644 index 00000000..23541f59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_disaster_recovery_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_disaster_recovery_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/index.ts new file mode 100644 index 00000000..724a63bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-disaster-recovery-tasks/index.ts @@ -0,0 +1,511 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsDisasterRecoveryTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#dr_type DataHuaweicloudDwsDisasterRecoveryTasks#dr_type} + */ + readonly drType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#id DataHuaweicloudDwsDisasterRecoveryTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#name DataHuaweicloudDwsDisasterRecoveryTasks#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#primary_cluster_name DataHuaweicloudDwsDisasterRecoveryTasks#primary_cluster_name} + */ + readonly primaryClusterName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#primary_cluster_region DataHuaweicloudDwsDisasterRecoveryTasks#primary_cluster_region} + */ + readonly primaryClusterRegion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#region DataHuaweicloudDwsDisasterRecoveryTasks#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#standby_cluster_name DataHuaweicloudDwsDisasterRecoveryTasks#standby_cluster_name} + */ + readonly standbyClusterName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#standby_cluster_region DataHuaweicloudDwsDisasterRecoveryTasks#standby_cluster_region} + */ + readonly standbyClusterRegion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#status DataHuaweicloudDwsDisasterRecoveryTasks#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudDwsDisasterRecoveryTasksTasks { +} + +export function dataHuaweicloudDwsDisasterRecoveryTasksTasksToTerraform(struct?: DataHuaweicloudDwsDisasterRecoveryTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsDisasterRecoveryTasksTasksToHclTerraform(struct?: DataHuaweicloudDwsDisasterRecoveryTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsDisasterRecoveryTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsDisasterRecoveryTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsDisasterRecoveryTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // dr_type - computed: true, optional: false, required: false + public get drType() { + return this.getStringAttribute('dr_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // last_disaster_time - computed: true, optional: false, required: false + public get lastDisasterTime() { + return this.getStringAttribute('last_disaster_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // primary_cluster_id - computed: true, optional: false, required: false + public get primaryClusterId() { + return this.getStringAttribute('primary_cluster_id'); + } + + // primary_cluster_name - computed: true, optional: false, required: false + public get primaryClusterName() { + return this.getStringAttribute('primary_cluster_name'); + } + + // primary_cluster_project_id - computed: true, optional: false, required: false + public get primaryClusterProjectId() { + return this.getStringAttribute('primary_cluster_project_id'); + } + + // primary_cluster_region - computed: true, optional: false, required: false + public get primaryClusterRegion() { + return this.getStringAttribute('primary_cluster_region'); + } + + // primary_cluster_role - computed: true, optional: false, required: false + public get primaryClusterRole() { + return this.getStringAttribute('primary_cluster_role'); + } + + // primary_cluster_status - computed: true, optional: false, required: false + public get primaryClusterStatus() { + return this.getStringAttribute('primary_cluster_status'); + } + + // standby_cluster_id - computed: true, optional: false, required: false + public get standbyClusterId() { + return this.getStringAttribute('standby_cluster_id'); + } + + // standby_cluster_name - computed: true, optional: false, required: false + public get standbyClusterName() { + return this.getStringAttribute('standby_cluster_name'); + } + + // standby_cluster_project_id - computed: true, optional: false, required: false + public get standbyClusterProjectId() { + return this.getStringAttribute('standby_cluster_project_id'); + } + + // standby_cluster_region - computed: true, optional: false, required: false + public get standbyClusterRegion() { + return this.getStringAttribute('standby_cluster_region'); + } + + // standby_cluster_role - computed: true, optional: false, required: false + public get standbyClusterRole() { + return this.getStringAttribute('standby_cluster_role'); + } + + // standby_cluster_status - computed: true, optional: false, required: false + public get standbyClusterStatus() { + return this.getStringAttribute('standby_cluster_status'); + } + + // start_at - computed: true, optional: false, required: false + public get startAt() { + return this.getStringAttribute('start_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDwsDisasterRecoveryTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsDisasterRecoveryTasksTasksOutputReference { + return new DataHuaweicloudDwsDisasterRecoveryTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks huaweicloud_dws_disaster_recovery_tasks} +*/ +export class DataHuaweicloudDwsDisasterRecoveryTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_disaster_recovery_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsDisasterRecoveryTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsDisasterRecoveryTasks to import + * @param importFromId The id of the existing DataHuaweicloudDwsDisasterRecoveryTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsDisasterRecoveryTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_disaster_recovery_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_disaster_recovery_tasks huaweicloud_dws_disaster_recovery_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsDisasterRecoveryTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsDisasterRecoveryTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_disaster_recovery_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._drType = config.drType; + this._id = config.id; + this._name = config.name; + this._primaryClusterName = config.primaryClusterName; + this._primaryClusterRegion = config.primaryClusterRegion; + this._region = config.region; + this._standbyClusterName = config.standbyClusterName; + this._standbyClusterRegion = config.standbyClusterRegion; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // dr_type - computed: false, optional: true, required: false + private _drType?: string; + public get drType() { + return this.getStringAttribute('dr_type'); + } + public set drType(value: string) { + this._drType = value; + } + public resetDrType() { + this._drType = undefined; + } + // Temporarily expose input value. Use with caution. + public get drTypeInput() { + return this._drType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // primary_cluster_name - computed: false, optional: true, required: false + private _primaryClusterName?: string; + public get primaryClusterName() { + return this.getStringAttribute('primary_cluster_name'); + } + public set primaryClusterName(value: string) { + this._primaryClusterName = value; + } + public resetPrimaryClusterName() { + this._primaryClusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryClusterNameInput() { + return this._primaryClusterName; + } + + // primary_cluster_region - computed: false, optional: true, required: false + private _primaryClusterRegion?: string; + public get primaryClusterRegion() { + return this.getStringAttribute('primary_cluster_region'); + } + public set primaryClusterRegion(value: string) { + this._primaryClusterRegion = value; + } + public resetPrimaryClusterRegion() { + this._primaryClusterRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryClusterRegionInput() { + return this._primaryClusterRegion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // standby_cluster_name - computed: false, optional: true, required: false + private _standbyClusterName?: string; + public get standbyClusterName() { + return this.getStringAttribute('standby_cluster_name'); + } + public set standbyClusterName(value: string) { + this._standbyClusterName = value; + } + public resetStandbyClusterName() { + this._standbyClusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get standbyClusterNameInput() { + return this._standbyClusterName; + } + + // standby_cluster_region - computed: false, optional: true, required: false + private _standbyClusterRegion?: string; + public get standbyClusterRegion() { + return this.getStringAttribute('standby_cluster_region'); + } + public set standbyClusterRegion(value: string) { + this._standbyClusterRegion = value; + } + public resetStandbyClusterRegion() { + this._standbyClusterRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get standbyClusterRegionInput() { + return this._standbyClusterRegion; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudDwsDisasterRecoveryTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dr_type: cdktf.stringToTerraform(this._drType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + primary_cluster_name: cdktf.stringToTerraform(this._primaryClusterName), + primary_cluster_region: cdktf.stringToTerraform(this._primaryClusterRegion), + region: cdktf.stringToTerraform(this._region), + standby_cluster_name: cdktf.stringToTerraform(this._standbyClusterName), + standby_cluster_region: cdktf.stringToTerraform(this._standbyClusterRegion), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dr_type: { + value: cdktf.stringToHclTerraform(this._drType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_cluster_name: { + value: cdktf.stringToHclTerraform(this._primaryClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_cluster_region: { + value: cdktf.stringToHclTerraform(this._primaryClusterRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby_cluster_name: { + value: cdktf.stringToHclTerraform(this._standbyClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby_cluster_region: { + value: cdktf.stringToHclTerraform(this._standbyClusterRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/README.md new file mode 100644 index 00000000..db5ebd16 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_event_subscriptions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_event_subscriptions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/index.ts new file mode 100644 index 00000000..46073801 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-event-subscriptions/index.ts @@ -0,0 +1,470 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsEventSubscriptionsConfig extends cdktf.TerraformMetaArguments { + /** + * The category of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#category DataHuaweicloudDwsEventSubscriptions#category} + */ + readonly category?: string; + /** + * Whether the event subscription is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#enable DataHuaweicloudDwsEventSubscriptions#enable} + */ + readonly enable?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#id DataHuaweicloudDwsEventSubscriptions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of event subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#name DataHuaweicloudDwsEventSubscriptions#name} + */ + readonly name?: string; + /** + * The name of notification target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#notification_target_name DataHuaweicloudDwsEventSubscriptions#notification_target_name} + */ + readonly notificationTargetName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#region DataHuaweicloudDwsEventSubscriptions#region} + */ + readonly region?: string; + /** + * The severity of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#severity DataHuaweicloudDwsEventSubscriptions#severity} + */ + readonly severity?: string; + /** + * The type of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#source_type DataHuaweicloudDwsEventSubscriptions#source_type} + */ + readonly sourceType?: string; +} +export interface DataHuaweicloudDwsEventSubscriptionsEventSubscriptions { +} + +export function dataHuaweicloudDwsEventSubscriptionsEventSubscriptionsToTerraform(struct?: DataHuaweicloudDwsEventSubscriptionsEventSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsEventSubscriptionsEventSubscriptionsToHclTerraform(struct?: DataHuaweicloudDwsEventSubscriptionsEventSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsEventSubscriptionsEventSubscriptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsEventSubscriptionsEventSubscriptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsEventSubscriptionsEventSubscriptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getStringAttribute('enable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // language - computed: true, optional: false, required: false + public get language() { + return this.getStringAttribute('language'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // name_space - computed: true, optional: false, required: false + public get nameSpace() { + return this.getStringAttribute('name_space'); + } + + // notification_target - computed: true, optional: false, required: false + public get notificationTarget() { + return this.getStringAttribute('notification_target'); + } + + // notification_target_name - computed: true, optional: false, required: false + public get notificationTargetName() { + return this.getStringAttribute('notification_target_name'); + } + + // notification_target_type - computed: true, optional: false, required: false + public get notificationTargetType() { + return this.getStringAttribute('notification_target_type'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } + + // source_id - computed: true, optional: false, required: false + public get sourceId() { + return this.getStringAttribute('source_id'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getStringAttribute('source_type'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } +} + +export class DataHuaweicloudDwsEventSubscriptionsEventSubscriptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsEventSubscriptionsEventSubscriptionsOutputReference { + return new DataHuaweicloudDwsEventSubscriptionsEventSubscriptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions huaweicloud_dws_event_subscriptions} +*/ +export class DataHuaweicloudDwsEventSubscriptions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_event_subscriptions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsEventSubscriptions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsEventSubscriptions to import + * @param importFromId The id of the existing DataHuaweicloudDwsEventSubscriptions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsEventSubscriptions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_event_subscriptions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_event_subscriptions huaweicloud_dws_event_subscriptions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsEventSubscriptionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsEventSubscriptionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_event_subscriptions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._enable = config.enable; + this._id = config.id; + this._name = config.name; + this._notificationTargetName = config.notificationTargetName; + this._region = config.region; + this._severity = config.severity; + this._sourceType = config.sourceType; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // enable - computed: false, optional: true, required: false + private _enable?: string; + public get enable() { + return this.getStringAttribute('enable'); + } + public set enable(value: string) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // event_subscriptions - computed: true, optional: false, required: false + private _eventSubscriptions = new DataHuaweicloudDwsEventSubscriptionsEventSubscriptionsList(this, "event_subscriptions", false); + public get eventSubscriptions() { + return this._eventSubscriptions; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_target_name - computed: false, optional: true, required: false + private _notificationTargetName?: string; + public get notificationTargetName() { + return this.getStringAttribute('notification_target_name'); + } + public set notificationTargetName(value: string) { + this._notificationTargetName = value; + } + public resetNotificationTargetName() { + this._notificationTargetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetNameInput() { + return this._notificationTargetName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // severity - computed: false, optional: true, required: false + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + public resetSeverity() { + this._severity = undefined; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // source_type - computed: false, optional: true, required: false + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + enable: cdktf.stringToTerraform(this._enable), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_target_name: cdktf.stringToTerraform(this._notificationTargetName), + region: cdktf.stringToTerraform(this._region), + severity: cdktf.stringToTerraform(this._severity), + source_type: cdktf.stringToTerraform(this._sourceType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.stringToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_name: { + value: cdktf.stringToHclTerraform(this._notificationTargetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(this._severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/README.md new file mode 100644 index 00000000..9b683f51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/index.ts new file mode 100644 index 00000000..ede74493 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-flavors/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * The availability zone name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#availability_zone DataHuaweicloudDwsFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * The type of datastore. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#datastore_type DataHuaweicloudDwsFlavors#datastore_type} + */ + readonly datastoreType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#id DataHuaweicloudDwsFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ram of the dws node flavor in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#memory DataHuaweicloudDwsFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#region DataHuaweicloudDwsFlavors#region} + */ + readonly region?: string; + /** + * The vcpus of the dws node flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#vcpus DataHuaweicloudDwsFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecs { +} + +export function dataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsToTerraform(struct?: DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsToHclTerraform(struct?: DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max_size - computed: true, optional: false, required: false + public get maxSize() { + return this.getNumberAttribute('max_size'); + } + + // min_size - computed: true, optional: false, required: false + public get minSize() { + return this.getNumberAttribute('min_size'); + } + + // step - computed: true, optional: false, required: false + public get step() { + return this.getNumberAttribute('step'); + } +} + +export class DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsOutputReference { + return new DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsFlavorsFlavors { +} + +export function dataHuaweicloudDwsFlavorsFlavorsToTerraform(struct?: DataHuaweicloudDwsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudDwsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // datastore_type - computed: true, optional: false, required: false + public get datastoreType() { + return this.getStringAttribute('datastore_type'); + } + + // datastore_version - computed: true, optional: false, required: false + public get datastoreVersion() { + return this.getStringAttribute('datastore_version'); + } + + // elastic_volume_specs - computed: true, optional: false, required: false + private _elasticVolumeSpecs = new DataHuaweicloudDwsFlavorsFlavorsElasticVolumeSpecsList(this, "elastic_volume_specs", false); + public get elasticVolumeSpecs() { + return this._elasticVolumeSpecs; + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + + // volumetype - computed: true, optional: false, required: false + public get volumetype() { + return this.getStringAttribute('volumetype'); + } +} + +export class DataHuaweicloudDwsFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsFlavorsFlavorsOutputReference { + return new DataHuaweicloudDwsFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors huaweicloud_dws_flavors} +*/ +export class DataHuaweicloudDwsFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsFlavors to import + * @param importFromId The id of the existing DataHuaweicloudDwsFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_flavors huaweicloud_dws_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._datastoreType = config.datastoreType; + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // datastore_type - computed: false, optional: true, required: false + private _datastoreType?: string; + public get datastoreType() { + return this.getStringAttribute('datastore_type'); + } + public set datastoreType(value: string) { + this._datastoreType = value; + } + public resetDatastoreType() { + this._datastoreType = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreTypeInput() { + return this._datastoreType; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudDwsFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + datastore_type: cdktf.stringToTerraform(this._datastoreType), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + datastore_type: { + value: cdktf.stringToHclTerraform(this._datastoreType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/README.md new file mode 100644 index 00000000..e3e0cad2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_logical_cluster_rings` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_logical_cluster_rings`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/index.ts new file mode 100644 index 00000000..6df59a88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-rings/index.ts @@ -0,0 +1,353 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsLogicalClusterRingsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings#cluster_id DataHuaweicloudDwsLogicalClusterRings#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings#id DataHuaweicloudDwsLogicalClusterRings#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings#region DataHuaweicloudDwsLogicalClusterRings#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHosts { +} + +export function dataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsToTerraform(struct?: DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsToHclTerraform(struct?: DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // back_ip - computed: true, optional: false, required: false + public get backIp() { + return this.getStringAttribute('back_ip'); + } + + // cpu_cores - computed: true, optional: false, required: false + public get cpuCores() { + return this.getNumberAttribute('cpu_cores'); + } + + // disk_size - computed: true, optional: false, required: false + public get diskSize() { + return this.getNumberAttribute('disk_size'); + } + + // host_name - computed: true, optional: false, required: false + public get hostName() { + return this.getStringAttribute('host_name'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } +} + +export class DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsOutputReference { + return new DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsLogicalClusterRingsClusterRings { +} + +export function dataHuaweicloudDwsLogicalClusterRingsClusterRingsToTerraform(struct?: DataHuaweicloudDwsLogicalClusterRingsClusterRings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsLogicalClusterRingsClusterRingsToHclTerraform(struct?: DataHuaweicloudDwsLogicalClusterRingsClusterRings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsLogicalClusterRingsClusterRingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsLogicalClusterRingsClusterRings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsLogicalClusterRingsClusterRings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // is_available - computed: true, optional: false, required: false + public get isAvailable() { + return this.getBooleanAttribute('is_available'); + } + + // ring_hosts - computed: true, optional: false, required: false + private _ringHosts = new DataHuaweicloudDwsLogicalClusterRingsClusterRingsRingHostsList(this, "ring_hosts", false); + public get ringHosts() { + return this._ringHosts; + } +} + +export class DataHuaweicloudDwsLogicalClusterRingsClusterRingsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsLogicalClusterRingsClusterRingsOutputReference { + return new DataHuaweicloudDwsLogicalClusterRingsClusterRingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings huaweicloud_dws_logical_cluster_rings} +*/ +export class DataHuaweicloudDwsLogicalClusterRings extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_logical_cluster_rings"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsLogicalClusterRings resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsLogicalClusterRings to import + * @param importFromId The id of the existing DataHuaweicloudDwsLogicalClusterRings that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsLogicalClusterRings to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_logical_cluster_rings", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_rings huaweicloud_dws_logical_cluster_rings} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsLogicalClusterRingsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsLogicalClusterRingsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_logical_cluster_rings', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_rings - computed: true, optional: false, required: false + private _clusterRings = new DataHuaweicloudDwsLogicalClusterRingsClusterRingsList(this, "cluster_rings", false); + public get clusterRings() { + return this._clusterRings; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/README.md new file mode 100644 index 00000000..278400e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_logical_cluster_volumes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_logical_cluster_volumes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/index.ts new file mode 100644 index 00000000..b0616b88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-cluster-volumes/index.ts @@ -0,0 +1,269 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsLogicalClusterVolumesConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the ID of the cluster to which the logical cluster belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes#cluster_id DataHuaweicloudDwsLogicalClusterVolumes#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes#id DataHuaweicloudDwsLogicalClusterVolumes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes#region DataHuaweicloudDwsLogicalClusterVolumes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsLogicalClusterVolumesVolumes { +} + +export function dataHuaweicloudDwsLogicalClusterVolumesVolumesToTerraform(struct?: DataHuaweicloudDwsLogicalClusterVolumesVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsLogicalClusterVolumesVolumesToHclTerraform(struct?: DataHuaweicloudDwsLogicalClusterVolumesVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsLogicalClusterVolumesVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsLogicalClusterVolumesVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsLogicalClusterVolumesVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // logical_cluster_name - computed: true, optional: false, required: false + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + + // percentage - computed: true, optional: false, required: false + public get percentage() { + return this.getStringAttribute('percentage'); + } + + // total - computed: true, optional: false, required: false + public get total() { + return this.getStringAttribute('total'); + } + + // usage - computed: true, optional: false, required: false + public get usage() { + return this.getStringAttribute('usage'); + } +} + +export class DataHuaweicloudDwsLogicalClusterVolumesVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsLogicalClusterVolumesVolumesOutputReference { + return new DataHuaweicloudDwsLogicalClusterVolumesVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes huaweicloud_dws_logical_cluster_volumes} +*/ +export class DataHuaweicloudDwsLogicalClusterVolumes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_logical_cluster_volumes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsLogicalClusterVolumes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsLogicalClusterVolumes to import + * @param importFromId The id of the existing DataHuaweicloudDwsLogicalClusterVolumes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsLogicalClusterVolumes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_logical_cluster_volumes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_cluster_volumes huaweicloud_dws_logical_cluster_volumes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsLogicalClusterVolumesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsLogicalClusterVolumesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_logical_cluster_volumes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // volumes - computed: true, optional: false, required: false + private _volumes = new DataHuaweicloudDwsLogicalClusterVolumesVolumesList(this, "volumes", false); + public get volumes() { + return this._volumes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/README.md new file mode 100644 index 00000000..25075d00 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_logical_clusters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_logical_clusters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/index.ts new file mode 100644 index 00000000..c5fcba2a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-logical-clusters/index.ts @@ -0,0 +1,466 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsLogicalClustersConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the cluster ID of the DWS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters#cluster_id DataHuaweicloudDwsLogicalClusters#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters#id DataHuaweicloudDwsLogicalClusters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters#region DataHuaweicloudDwsLogicalClusters#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHosts { +} + +export function dataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsToTerraform(struct?: DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsToHclTerraform(struct?: DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // back_ip - computed: true, optional: false, required: false + public get backIp() { + return this.getStringAttribute('back_ip'); + } + + // cpu_cores - computed: true, optional: false, required: false + public get cpuCores() { + return this.getNumberAttribute('cpu_cores'); + } + + // disk_size - computed: true, optional: false, required: false + public get diskSize() { + return this.getNumberAttribute('disk_size'); + } + + // host_name - computed: true, optional: false, required: false + public get hostName() { + return this.getStringAttribute('host_name'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } +} + +export class DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsOutputReference { + return new DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRings { +} + +export function dataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsToTerraform(struct?: DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsToHclTerraform(struct?: DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ring_hosts - computed: true, optional: false, required: false + private _ringHosts = new DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsRingHostsList(this, "ring_hosts", false); + public get ringHosts() { + return this._ringHosts; + } +} + +export class DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsOutputReference { + return new DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsLogicalClustersLogicalClusters { +} + +export function dataHuaweicloudDwsLogicalClustersLogicalClustersToTerraform(struct?: DataHuaweicloudDwsLogicalClustersLogicalClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsLogicalClustersLogicalClustersToHclTerraform(struct?: DataHuaweicloudDwsLogicalClustersLogicalClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsLogicalClustersLogicalClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsLogicalClustersLogicalClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsLogicalClustersLogicalClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster_rings - computed: true, optional: false, required: false + private _clusterRings = new DataHuaweicloudDwsLogicalClustersLogicalClustersClusterRingsList(this, "cluster_rings", false); + public get clusterRings() { + return this._clusterRings; + } + + // delete_enable - computed: true, optional: false, required: false + public get deleteEnable() { + return this.getBooleanAttribute('delete_enable'); + } + + // edit_enable - computed: true, optional: false, required: false + public get editEnable() { + return this.getBooleanAttribute('edit_enable'); + } + + // first_logical_cluster - computed: true, optional: false, required: false + public get firstLogicalCluster() { + return this.getBooleanAttribute('first_logical_cluster'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // restart_enable - computed: true, optional: false, required: false + public get restartEnable() { + return this.getBooleanAttribute('restart_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDwsLogicalClustersLogicalClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsLogicalClustersLogicalClustersOutputReference { + return new DataHuaweicloudDwsLogicalClustersLogicalClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters huaweicloud_dws_logical_clusters} +*/ +export class DataHuaweicloudDwsLogicalClusters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_logical_clusters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsLogicalClusters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsLogicalClusters to import + * @param importFromId The id of the existing DataHuaweicloudDwsLogicalClusters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsLogicalClusters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_logical_clusters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_logical_clusters huaweicloud_dws_logical_clusters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsLogicalClustersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsLogicalClustersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_logical_clusters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // add_enable - computed: true, optional: false, required: false + public get addEnable() { + return this.getBooleanAttribute('add_enable'); + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_clusters - computed: true, optional: false, required: false + private _logicalClusters = new DataHuaweicloudDwsLogicalClustersLogicalClustersList(this, "logical_clusters", false); + public get logicalClusters() { + return this._logicalClusters; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/README.md new file mode 100644 index 00000000..299d51c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_om_account_configuration` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_om_account_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/index.ts new file mode 100644 index 00000000..a793ffc7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-om-account-configuration/index.ts @@ -0,0 +1,181 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsOmAccountConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration#cluster_id DataHuaweicloudDwsOmAccountConfiguration#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration#id DataHuaweicloudDwsOmAccountConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration#region DataHuaweicloudDwsOmAccountConfiguration#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration huaweicloud_dws_om_account_configuration} +*/ +export class DataHuaweicloudDwsOmAccountConfiguration extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_om_account_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsOmAccountConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsOmAccountConfiguration to import + * @param importFromId The id of the existing DataHuaweicloudDwsOmAccountConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsOmAccountConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_om_account_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_om_account_configuration huaweicloud_dws_om_account_configuration} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsOmAccountConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsOmAccountConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_om_account_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // om_user_expires_time - computed: true, optional: false, required: false + public get omUserExpiresTime() { + return this.getStringAttribute('om_user_expires_time'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/README.md new file mode 100644 index 00000000..1c4e3ff1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/index.ts new file mode 100644 index 00000000..9fb3f53f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-quotas/index.ts @@ -0,0 +1,242 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas#id DataHuaweicloudDwsQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas#region DataHuaweicloudDwsQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsQuotasQuotas { +} + +export function dataHuaweicloudDwsQuotasQuotasToTerraform(struct?: DataHuaweicloudDwsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsQuotasQuotasToHclTerraform(struct?: DataHuaweicloudDwsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // limit - computed: true, optional: false, required: false + public get limit() { + return this.getNumberAttribute('limit'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudDwsQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsQuotasQuotasOutputReference { + return new DataHuaweicloudDwsQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas huaweicloud_dws_quotas} +*/ +export class DataHuaweicloudDwsQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsQuotas to import + * @param importFromId The id of the existing DataHuaweicloudDwsQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_quotas huaweicloud_dws_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudDwsQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/README.md new file mode 100644 index 00000000..ed679ee9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_snapshot_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_snapshot_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/index.ts new file mode 100644 index 00000000..cea6cd02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshot-policies/index.ts @@ -0,0 +1,299 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsSnapshotPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the snapshot policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies#cluster_id DataHuaweicloudDwsSnapshotPolicies#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies#id DataHuaweicloudDwsSnapshotPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies#region DataHuaweicloudDwsSnapshotPolicies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsSnapshotPoliciesPolicies { +} + +export function dataHuaweicloudDwsSnapshotPoliciesPoliciesToTerraform(struct?: DataHuaweicloudDwsSnapshotPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsSnapshotPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudDwsSnapshotPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsSnapshotPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsSnapshotPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsSnapshotPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backup_level - computed: true, optional: false, required: false + public get backupLevel() { + return this.getStringAttribute('backup_level'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // next_fire_time - computed: true, optional: false, required: false + public get nextFireTime() { + return this.getStringAttribute('next_fire_time'); + } + + // strategy - computed: true, optional: false, required: false + public get strategy() { + return this.getStringAttribute('strategy'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudDwsSnapshotPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsSnapshotPoliciesPoliciesOutputReference { + return new DataHuaweicloudDwsSnapshotPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies huaweicloud_dws_snapshot_policies} +*/ +export class DataHuaweicloudDwsSnapshotPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_snapshot_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsSnapshotPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsSnapshotPolicies to import + * @param importFromId The id of the existing DataHuaweicloudDwsSnapshotPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsSnapshotPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_snapshot_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshot_policies huaweicloud_dws_snapshot_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsSnapshotPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsSnapshotPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_snapshot_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // device_name - computed: true, optional: false, required: false + public get deviceName() { + return this.getStringAttribute('device_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keep_day - computed: true, optional: false, required: false + public get keepDay() { + return this.getNumberAttribute('keep_day'); + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudDwsSnapshotPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_ips - computed: true, optional: false, required: false + public get serverIps() { + return this.getListAttribute('server_ips'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/README.md new file mode 100644 index 00000000..ef2de88b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_snapshots` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_snapshots`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/index.ts new file mode 100644 index 00000000..df6973db --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-snapshots/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsSnapshotsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots#id DataHuaweicloudDwsSnapshots#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots#region DataHuaweicloudDwsSnapshots#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsSnapshotsSnapshots { +} + +export function dataHuaweicloudDwsSnapshotsSnapshotsToTerraform(struct?: DataHuaweicloudDwsSnapshotsSnapshots): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsSnapshotsSnapshotsToHclTerraform(struct?: DataHuaweicloudDwsSnapshotsSnapshots): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsSnapshotsSnapshotsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsSnapshotsSnapshots | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsSnapshotsSnapshots | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudDwsSnapshotsSnapshotsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsSnapshotsSnapshotsOutputReference { + return new DataHuaweicloudDwsSnapshotsSnapshotsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots huaweicloud_dws_snapshots} +*/ +export class DataHuaweicloudDwsSnapshots extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_snapshots"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsSnapshots resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsSnapshots to import + * @param importFromId The id of the existing DataHuaweicloudDwsSnapshots that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsSnapshots to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_snapshots", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_snapshots huaweicloud_dws_snapshots} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsSnapshotsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsSnapshotsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_snapshots', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // snapshots - computed: true, optional: false, required: false + private _snapshots = new DataHuaweicloudDwsSnapshotsSnapshotsList(this, "snapshots", false); + public get snapshots() { + return this._snapshots; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/README.md new file mode 100644 index 00000000..93be139d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_statistics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_statistics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/index.ts new file mode 100644 index 00000000..b9931907 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-statistics/index.ts @@ -0,0 +1,237 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsStatisticsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics#id DataHuaweicloudDwsStatistics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics#region DataHuaweicloudDwsStatistics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsStatisticsStatistics { +} + +export function dataHuaweicloudDwsStatisticsStatisticsToTerraform(struct?: DataHuaweicloudDwsStatisticsStatistics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsStatisticsStatisticsToHclTerraform(struct?: DataHuaweicloudDwsStatisticsStatistics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsStatisticsStatisticsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsStatisticsStatistics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsStatisticsStatistics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getNumberAttribute('value'); + } +} + +export class DataHuaweicloudDwsStatisticsStatisticsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsStatisticsStatisticsOutputReference { + return new DataHuaweicloudDwsStatisticsStatisticsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics huaweicloud_dws_statistics} +*/ +export class DataHuaweicloudDwsStatistics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_statistics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsStatistics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsStatistics to import + * @param importFromId The id of the existing DataHuaweicloudDwsStatistics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsStatistics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_statistics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_statistics huaweicloud_dws_statistics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsStatisticsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsStatisticsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_statistics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // statistics - computed: true, optional: false, required: false + private _statistics = new DataHuaweicloudDwsStatisticsStatisticsList(this, "statistics", false); + public get statistics() { + return this._statistics; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/README.md new file mode 100644 index 00000000..f584853c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_workload_plans` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_workload_plans`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/index.ts new file mode 100644 index 00000000..a8286f8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-plans/index.ts @@ -0,0 +1,304 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsWorkloadPlansConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the workload plans belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans#cluster_id DataHuaweicloudDwsWorkloadPlans#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans#id DataHuaweicloudDwsWorkloadPlans#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the logical cluster name to which the workload plans belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans#logical_cluster_name DataHuaweicloudDwsWorkloadPlans#logical_cluster_name} + */ + readonly logicalClusterName?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans#region DataHuaweicloudDwsWorkloadPlans#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsWorkloadPlansPlans { +} + +export function dataHuaweicloudDwsWorkloadPlansPlansToTerraform(struct?: DataHuaweicloudDwsWorkloadPlansPlans): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsWorkloadPlansPlansToHclTerraform(struct?: DataHuaweicloudDwsWorkloadPlansPlans): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsWorkloadPlansPlansOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsWorkloadPlansPlans | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsWorkloadPlansPlans | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // current_stage_name - computed: true, optional: false, required: false + public get currentStageName() { + return this.getStringAttribute('current_stage_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudDwsWorkloadPlansPlansList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsWorkloadPlansPlansOutputReference { + return new DataHuaweicloudDwsWorkloadPlansPlansOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans huaweicloud_dws_workload_plans} +*/ +export class DataHuaweicloudDwsWorkloadPlans extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_plans"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsWorkloadPlans resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsWorkloadPlans to import + * @param importFromId The id of the existing DataHuaweicloudDwsWorkloadPlans that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsWorkloadPlans to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_plans", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_plans huaweicloud_dws_workload_plans} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsWorkloadPlansConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsWorkloadPlansConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_plans', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._logicalClusterName = config.logicalClusterName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_cluster_name - computed: false, optional: true, required: false + private _logicalClusterName?: string; + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + public set logicalClusterName(value: string) { + this._logicalClusterName = value; + } + public resetLogicalClusterName() { + this._logicalClusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterNameInput() { + return this._logicalClusterName; + } + + // plans - computed: true, optional: false, required: false + private _plans = new DataHuaweicloudDwsWorkloadPlansPlansList(this, "plans", false); + public get plans() { + return this._plans; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + logical_cluster_name: cdktf.stringToTerraform(this._logicalClusterName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_name: { + value: cdktf.stringToHclTerraform(this._logicalClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/README.md new file mode 100644 index 00000000..b0db80c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_workload_queue_associated_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_workload_queue_associated_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/index.ts new file mode 100644 index 00000000..8ae93f51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queue-associated-users/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsWorkloadQueueAssociatedUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users#cluster_id DataHuaweicloudDwsWorkloadQueueAssociatedUsers#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users#id DataHuaweicloudDwsWorkloadQueueAssociatedUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the workload queue name bound to the users. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users#queue_name DataHuaweicloudDwsWorkloadQueueAssociatedUsers#queue_name} + */ + readonly queueName: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users#region DataHuaweicloudDwsWorkloadQueueAssociatedUsers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStruct { +} + +export function dataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructToTerraform(struct?: DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructToHclTerraform(struct?: DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_value - computed: true, optional: false, required: false + public get resourceValue() { + return this.getNumberAttribute('resource_value'); + } + + // value_unit - computed: true, optional: false, required: false + public get valueUnit() { + return this.getStringAttribute('value_unit'); + } +} + +export class DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructOutputReference { + return new DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsers { +} + +export function dataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersToTerraform(struct?: DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersToHclTerraform(struct?: DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // occupy_resource_list - computed: true, optional: false, required: false + private _occupyResourceList = new DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOccupyResourceListStructList(this, "occupy_resource_list", false); + public get occupyResourceList() { + return this._occupyResourceList; + } +} + +export class DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOutputReference { + return new DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users huaweicloud_dws_workload_queue_associated_users} +*/ +export class DataHuaweicloudDwsWorkloadQueueAssociatedUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_queue_associated_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsWorkloadQueueAssociatedUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsWorkloadQueueAssociatedUsers to import + * @param importFromId The id of the existing DataHuaweicloudDwsWorkloadQueueAssociatedUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsWorkloadQueueAssociatedUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_queue_associated_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queue_associated_users huaweicloud_dws_workload_queue_associated_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsWorkloadQueueAssociatedUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsWorkloadQueueAssociatedUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_queue_associated_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._queueName = config.queueName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // queue_name - computed: false, optional: false, required: true + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudDwsWorkloadQueueAssociatedUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/README.md new file mode 100644 index 00000000..93dbc159 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_dws_workload_queues` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_dws_workload_queues`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/index.ts new file mode 100644 index 00000000..e288d544 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-dws-workload-queues/index.ts @@ -0,0 +1,418 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudDwsWorkloadQueuesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cluster ID to which the workload queue belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues#cluster_id DataHuaweicloudDwsWorkloadQueues#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues#id DataHuaweicloudDwsWorkloadQueues#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the cluster. Required if the cluster is a logical cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues#logical_cluster_name DataHuaweicloudDwsWorkloadQueues#logical_cluster_name} + */ + readonly logicalClusterName?: string; + /** + * Specifies the name of the workload queue. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues#name DataHuaweicloudDwsWorkloadQueues#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues#region DataHuaweicloudDwsWorkloadQueues#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudDwsWorkloadQueuesQueuesConfiguration { +} + +export function dataHuaweicloudDwsWorkloadQueuesQueuesConfigurationToTerraform(struct?: DataHuaweicloudDwsWorkloadQueuesQueuesConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsWorkloadQueuesQueuesConfigurationToHclTerraform(struct?: DataHuaweicloudDwsWorkloadQueuesQueuesConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsWorkloadQueuesQueuesConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsWorkloadQueuesQueuesConfiguration | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsWorkloadQueuesQueuesConfiguration | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_value - computed: true, optional: false, required: false + public get resourceValue() { + return this.getNumberAttribute('resource_value'); + } + + // value_unit - computed: true, optional: false, required: false + public get valueUnit() { + return this.getStringAttribute('value_unit'); + } +} + +export class DataHuaweicloudDwsWorkloadQueuesQueuesConfigurationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsWorkloadQueuesQueuesConfigurationOutputReference { + return new DataHuaweicloudDwsWorkloadQueuesQueuesConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudDwsWorkloadQueuesQueues { +} + +export function dataHuaweicloudDwsWorkloadQueuesQueuesToTerraform(struct?: DataHuaweicloudDwsWorkloadQueuesQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudDwsWorkloadQueuesQueuesToHclTerraform(struct?: DataHuaweicloudDwsWorkloadQueuesQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudDwsWorkloadQueuesQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudDwsWorkloadQueuesQueues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudDwsWorkloadQueuesQueues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // configuration - computed: true, optional: false, required: false + private _configuration = new DataHuaweicloudDwsWorkloadQueuesQueuesConfigurationList(this, "configuration", true); + public get configuration() { + return this._configuration; + } + + // logical_cluster_name - computed: true, optional: false, required: false + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // short_query_concurrency_num - computed: true, optional: false, required: false + public get shortQueryConcurrencyNum() { + return this.getNumberAttribute('short_query_concurrency_num'); + } + + // short_query_optimize - computed: true, optional: false, required: false + public get shortQueryOptimize() { + return this.getBooleanAttribute('short_query_optimize'); + } +} + +export class DataHuaweicloudDwsWorkloadQueuesQueuesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudDwsWorkloadQueuesQueuesOutputReference { + return new DataHuaweicloudDwsWorkloadQueuesQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues huaweicloud_dws_workload_queues} +*/ +export class DataHuaweicloudDwsWorkloadQueues extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_queues"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudDwsWorkloadQueues resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudDwsWorkloadQueues to import + * @param importFromId The id of the existing DataHuaweicloudDwsWorkloadQueues that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudDwsWorkloadQueues to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_queues", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/dws_workload_queues huaweicloud_dws_workload_queues} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudDwsWorkloadQueuesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudDwsWorkloadQueuesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_queues', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._logicalClusterName = config.logicalClusterName; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_cluster_name - computed: false, optional: true, required: false + private _logicalClusterName?: string; + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + public set logicalClusterName(value: string) { + this._logicalClusterName = value; + } + public resetLogicalClusterName() { + this._logicalClusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterNameInput() { + return this._logicalClusterName; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // queues - computed: true, optional: false, required: false + private _queues = new DataHuaweicloudDwsWorkloadQueuesQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + logical_cluster_name: cdktf.stringToTerraform(this._logicalClusterName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_name: { + value: cdktf.stringToHclTerraform(this._logicalClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/README.md new file mode 100644 index 00000000..9a520a78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_eg_custom_event_channels` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_eg_custom_event_channels`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/index.ts new file mode 100644 index 00000000..ab7b0384 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-channels/index.ts @@ -0,0 +1,352 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEgCustomEventChannelsConfig extends cdktf.TerraformMetaArguments { + /** + * The channel ID used to query specified custom event channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels#channel_id DataHuaweicloudEgCustomEventChannels#channel_id} + */ + readonly channelId?: string; + /** + * The ID of the enterprise project to which the custom event channels belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels#enterprise_project_id DataHuaweicloudEgCustomEventChannels#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels#id DataHuaweicloudEgCustomEventChannels#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The channel name used to query specified custom event channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels#name DataHuaweicloudEgCustomEventChannels#name} + */ + readonly name?: string; + /** + * The region where the custom event channels are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels#region DataHuaweicloudEgCustomEventChannels#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudEgCustomEventChannelsChannels { +} + +export function dataHuaweicloudEgCustomEventChannelsChannelsToTerraform(struct?: DataHuaweicloudEgCustomEventChannelsChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEgCustomEventChannelsChannelsToHclTerraform(struct?: DataHuaweicloudEgCustomEventChannelsChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEgCustomEventChannelsChannelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEgCustomEventChannelsChannels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEgCustomEventChannelsChannels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // cross_account_ids - computed: true, optional: false, required: false + public get crossAccountIds() { + return this.getListAttribute('cross_account_ids'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // provider_type - computed: true, optional: false, required: false + public get providerType() { + return this.getStringAttribute('provider_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudEgCustomEventChannelsChannelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEgCustomEventChannelsChannelsOutputReference { + return new DataHuaweicloudEgCustomEventChannelsChannelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels huaweicloud_eg_custom_event_channels} +*/ +export class DataHuaweicloudEgCustomEventChannels extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_custom_event_channels"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEgCustomEventChannels resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEgCustomEventChannels to import + * @param importFromId The id of the existing DataHuaweicloudEgCustomEventChannels that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEgCustomEventChannels to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_custom_event_channels", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_channels huaweicloud_eg_custom_event_channels} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEgCustomEventChannelsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEgCustomEventChannelsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_custom_event_channels', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._channelId = config.channelId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // channel_id - computed: false, optional: true, required: false + private _channelId?: string; + public get channelId() { + return this.getStringAttribute('channel_id'); + } + public set channelId(value: string) { + this._channelId = value; + } + public resetChannelId() { + this._channelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get channelIdInput() { + return this._channelId; + } + + // channels - computed: true, optional: false, required: false + private _channels = new DataHuaweicloudEgCustomEventChannelsChannelsList(this, "channels", false); + public get channels() { + return this._channels; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + channel_id: cdktf.stringToTerraform(this._channelId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + channel_id: { + value: cdktf.stringToHclTerraform(this._channelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/README.md new file mode 100644 index 00000000..59c14f91 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_eg_custom_event_sources` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_eg_custom_event_sources`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/index.ts new file mode 100644 index 00000000..c5a2e13a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-custom-event-sources/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEgCustomEventSourcesConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the custom event channel to which the custom event sources belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources#channel_id DataHuaweicloudEgCustomEventSources#channel_id} + */ + readonly channelId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources#id DataHuaweicloudEgCustomEventSources#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The event source name used to query specified custom event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources#name DataHuaweicloudEgCustomEventSources#name} + */ + readonly name?: string; + /** + * The region where the custom event sources are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources#region DataHuaweicloudEgCustomEventSources#region} + */ + readonly region?: string; + /** + * The event source ID used to query specified custom event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources#source_id DataHuaweicloudEgCustomEventSources#source_id} + */ + readonly sourceId?: string; +} +export interface DataHuaweicloudEgCustomEventSourcesSources { +} + +export function dataHuaweicloudEgCustomEventSourcesSourcesToTerraform(struct?: DataHuaweicloudEgCustomEventSourcesSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEgCustomEventSourcesSourcesToHclTerraform(struct?: DataHuaweicloudEgCustomEventSourcesSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEgCustomEventSourcesSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEgCustomEventSourcesSources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEgCustomEventSourcesSources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // channel_id - computed: true, optional: false, required: false + public get channelId() { + return this.getStringAttribute('channel_id'); + } + + // channel_name - computed: true, optional: false, required: false + public get channelName() { + return this.getStringAttribute('channel_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudEgCustomEventSourcesSourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEgCustomEventSourcesSourcesOutputReference { + return new DataHuaweicloudEgCustomEventSourcesSourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources huaweicloud_eg_custom_event_sources} +*/ +export class DataHuaweicloudEgCustomEventSources extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_custom_event_sources"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEgCustomEventSources resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEgCustomEventSources to import + * @param importFromId The id of the existing DataHuaweicloudEgCustomEventSources that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEgCustomEventSources to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_custom_event_sources", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_custom_event_sources huaweicloud_eg_custom_event_sources} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEgCustomEventSourcesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEgCustomEventSourcesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_custom_event_sources', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._channelId = config.channelId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sourceId = config.sourceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // channel_id - computed: false, optional: true, required: false + private _channelId?: string; + public get channelId() { + return this.getStringAttribute('channel_id'); + } + public set channelId(value: string) { + this._channelId = value; + } + public resetChannelId() { + this._channelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get channelIdInput() { + return this._channelId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_id - computed: false, optional: true, required: false + private _sourceId?: string; + public get sourceId() { + return this.getStringAttribute('source_id'); + } + public set sourceId(value: string) { + this._sourceId = value; + } + public resetSourceId() { + this._sourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIdInput() { + return this._sourceId; + } + + // sources - computed: true, optional: false, required: false + private _sources = new DataHuaweicloudEgCustomEventSourcesSourcesList(this, "sources", false); + public get sources() { + return this._sources; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + channel_id: cdktf.stringToTerraform(this._channelId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_id: cdktf.stringToTerraform(this._sourceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + channel_id: { + value: cdktf.stringToHclTerraform(this._channelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_id: { + value: cdktf.stringToHclTerraform(this._sourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/README.md new file mode 100644 index 00000000..610dc9e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_eg_event_channels` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_eg_event_channels`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/index.ts new file mode 100644 index 00000000..36cb4920 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-channels/index.ts @@ -0,0 +1,352 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEgEventChannelsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the event channels belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels#enterprise_project_id DataHuaweicloudEgEventChannels#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels#id DataHuaweicloudEgEventChannels#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The channel name used to query specified event channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels#name DataHuaweicloudEgEventChannels#name} + */ + readonly name?: string; + /** + * The type of the event channels to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels#provider_type DataHuaweicloudEgEventChannels#provider_type} + */ + readonly providerType?: string; + /** + * The region where the event channels are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels#region DataHuaweicloudEgEventChannels#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudEgEventChannelsChannels { +} + +export function dataHuaweicloudEgEventChannelsChannelsToTerraform(struct?: DataHuaweicloudEgEventChannelsChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEgEventChannelsChannelsToHclTerraform(struct?: DataHuaweicloudEgEventChannelsChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEgEventChannelsChannelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEgEventChannelsChannels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEgEventChannelsChannels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // cross_account_ids - computed: true, optional: false, required: false + public get crossAccountIds() { + return this.getListAttribute('cross_account_ids'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // provider_type - computed: true, optional: false, required: false + public get providerType() { + return this.getStringAttribute('provider_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudEgEventChannelsChannelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEgEventChannelsChannelsOutputReference { + return new DataHuaweicloudEgEventChannelsChannelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels huaweicloud_eg_event_channels} +*/ +export class DataHuaweicloudEgEventChannels extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_event_channels"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEgEventChannels resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEgEventChannels to import + * @param importFromId The id of the existing DataHuaweicloudEgEventChannels that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEgEventChannels to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_event_channels", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_channels huaweicloud_eg_event_channels} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEgEventChannelsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEgEventChannelsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_event_channels', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._providerType = config.providerType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // channels - computed: true, optional: false, required: false + private _channels = new DataHuaweicloudEgEventChannelsChannelsList(this, "channels", false); + public get channels() { + return this._channels; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_type - computed: false, optional: true, required: false + private _providerType?: string; + public get providerType() { + return this.getStringAttribute('provider_type'); + } + public set providerType(value: string) { + this._providerType = value; + } + public resetProviderType() { + this._providerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get providerTypeInput() { + return this._providerType; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + provider_type: cdktf.stringToTerraform(this._providerType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_type: { + value: cdktf.stringToHclTerraform(this._providerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/README.md new file mode 100644 index 00000000..86e37292 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_eg_event_sources` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_eg_event_sources`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/index.ts new file mode 100644 index 00000000..a6a9b422 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-eg-event-sources/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEgEventSourcesConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the event channel to which the event sources belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources#channel_id DataHuaweicloudEgEventSources#channel_id} + */ + readonly channelId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources#id DataHuaweicloudEgEventSources#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the event source to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources#name DataHuaweicloudEgEventSources#name} + */ + readonly name?: string; + /** + * The type of the event sources to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources#provider_type DataHuaweicloudEgEventSources#provider_type} + */ + readonly providerType?: string; + /** + * The region where the event sources are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources#region DataHuaweicloudEgEventSources#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudEgEventSourcesSourcesEventTypes { +} + +export function dataHuaweicloudEgEventSourcesSourcesEventTypesToTerraform(struct?: DataHuaweicloudEgEventSourcesSourcesEventTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEgEventSourcesSourcesEventTypesToHclTerraform(struct?: DataHuaweicloudEgEventSourcesSourcesEventTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEgEventSourcesSourcesEventTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEgEventSourcesSourcesEventTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEgEventSourcesSourcesEventTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudEgEventSourcesSourcesEventTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEgEventSourcesSourcesEventTypesOutputReference { + return new DataHuaweicloudEgEventSourcesSourcesEventTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudEgEventSourcesSources { +} + +export function dataHuaweicloudEgEventSourcesSourcesToTerraform(struct?: DataHuaweicloudEgEventSourcesSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEgEventSourcesSourcesToHclTerraform(struct?: DataHuaweicloudEgEventSourcesSources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEgEventSourcesSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEgEventSourcesSources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEgEventSourcesSources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // channel_id - computed: true, optional: false, required: false + public get channelId() { + return this.getStringAttribute('channel_id'); + } + + // channel_name - computed: true, optional: false, required: false + public get channelName() { + return this.getStringAttribute('channel_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // detail - computed: true, optional: false, required: false + public get detail() { + return this.getStringAttribute('detail'); + } + + // event_types - computed: true, optional: false, required: false + private _eventTypes = new DataHuaweicloudEgEventSourcesSourcesEventTypesList(this, "event_types", false); + public get eventTypes() { + return this._eventTypes; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // label - computed: true, optional: false, required: false + public get label() { + return this.getStringAttribute('label'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // provider_type - computed: true, optional: false, required: false + public get providerType() { + return this.getStringAttribute('provider_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudEgEventSourcesSourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEgEventSourcesSourcesOutputReference { + return new DataHuaweicloudEgEventSourcesSourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources huaweicloud_eg_event_sources} +*/ +export class DataHuaweicloudEgEventSources extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_event_sources"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEgEventSources resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEgEventSources to import + * @param importFromId The id of the existing DataHuaweicloudEgEventSources that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEgEventSources to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_event_sources", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/eg_event_sources huaweicloud_eg_event_sources} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEgEventSourcesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEgEventSourcesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_event_sources', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._channelId = config.channelId; + this._id = config.id; + this._name = config.name; + this._providerType = config.providerType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // channel_id - computed: false, optional: true, required: false + private _channelId?: string; + public get channelId() { + return this.getStringAttribute('channel_id'); + } + public set channelId(value: string) { + this._channelId = value; + } + public resetChannelId() { + this._channelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get channelIdInput() { + return this._channelId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_type - computed: false, optional: true, required: false + private _providerType?: string; + public get providerType() { + return this.getStringAttribute('provider_type'); + } + public set providerType(value: string) { + this._providerType = value; + } + public resetProviderType() { + this._providerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get providerTypeInput() { + return this._providerType; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sources - computed: true, optional: false, required: false + private _sources = new DataHuaweicloudEgEventSourcesSourcesList(this, "sources", false); + public get sources() { + return this._sources; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + channel_id: cdktf.stringToTerraform(this._channelId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + provider_type: cdktf.stringToTerraform(this._providerType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + channel_id: { + value: cdktf.stringToHclTerraform(this._channelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_type: { + value: cdktf.stringToHclTerraform(this._providerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/README.md new file mode 100644 index 00000000..d81411ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_active_standby_pools` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_active_standby_pools`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/index.ts new file mode 100644 index 00000000..b1fc7f13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-active-standby-pools/index.ts @@ -0,0 +1,997 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbActiveStandbyPoolsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#description DataHuaweicloudElbActiveStandbyPools#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#healthmonitor_id DataHuaweicloudElbActiveStandbyPools#healthmonitor_id} + */ + readonly healthmonitorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#id DataHuaweicloudElbActiveStandbyPools#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#listener_id DataHuaweicloudElbActiveStandbyPools#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#loadbalancer_id DataHuaweicloudElbActiveStandbyPools#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#member_address DataHuaweicloudElbActiveStandbyPools#member_address} + */ + readonly memberAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#member_instance_id DataHuaweicloudElbActiveStandbyPools#member_instance_id} + */ + readonly memberInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#name DataHuaweicloudElbActiveStandbyPools#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#pool_id DataHuaweicloudElbActiveStandbyPools#pool_id} + */ + readonly poolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#protocol DataHuaweicloudElbActiveStandbyPools#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#region DataHuaweicloudElbActiveStandbyPools#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#type DataHuaweicloudElbActiveStandbyPools#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#vpc_id DataHuaweicloudElbActiveStandbyPools#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitor { +} + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorToTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorToHclTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitor | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitor | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // delay - computed: true, optional: false, required: false + public get delay() { + return this.getNumberAttribute('delay'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // expected_codes - computed: true, optional: false, required: false + public get expectedCodes() { + return this.getStringAttribute('expected_codes'); + } + + // http_method - computed: true, optional: false, required: false + public get httpMethod() { + return this.getStringAttribute('http_method'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_retries - computed: true, optional: false, required: false + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + + // max_retries_down - computed: true, optional: false, required: false + public get maxRetriesDown() { + return this.getNumberAttribute('max_retries_down'); + } + + // monitor_port - computed: true, optional: false, required: false + public get monitorPort() { + return this.getNumberAttribute('monitor_port'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url_path - computed: true, optional: false, required: false + public get urlPath() { + return this.getStringAttribute('url_path'); + } +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorOutputReference { + return new DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbActiveStandbyPoolsPoolsListeners { +} + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsListenersToTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsListenersToHclTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbActiveStandbyPoolsPoolsListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbActiveStandbyPoolsPoolsListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbActiveStandbyPoolsPoolsListenersOutputReference { + return new DataHuaweicloudElbActiveStandbyPoolsPoolsListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancers { +} + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersToTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersToHclTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersOutputReference { + return new DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbActiveStandbyPoolsPoolsMembers { +} + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsMembersToTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsMembersToHclTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPoolsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbActiveStandbyPoolsPoolsMembers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbActiveStandbyPoolsPoolsMembers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + + // member_type - computed: true, optional: false, required: false + public get memberType() { + return this.getStringAttribute('member_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operating_status - computed: true, optional: false, required: false + public get operatingStatus() { + return this.getStringAttribute('operating_status'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsMembersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbActiveStandbyPoolsPoolsMembersOutputReference { + return new DataHuaweicloudElbActiveStandbyPoolsPoolsMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbActiveStandbyPoolsPools { +} + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsToTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbActiveStandbyPoolsPoolsToHclTerraform(struct?: DataHuaweicloudElbActiveStandbyPoolsPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbActiveStandbyPoolsPools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbActiveStandbyPoolsPools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // any_port_enable - computed: true, optional: false, required: false + public get anyPortEnable() { + return this.getBooleanAttribute('any_port_enable'); + } + + // connection_drain_enabled - computed: true, optional: false, required: false + public get connectionDrainEnabled() { + return this.getBooleanAttribute('connection_drain_enabled'); + } + + // connection_drain_timeout - computed: true, optional: false, required: false + public get connectionDrainTimeout() { + return this.getNumberAttribute('connection_drain_timeout'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // healthmonitor - computed: true, optional: false, required: false + private _healthmonitor = new DataHuaweicloudElbActiveStandbyPoolsPoolsHealthmonitorList(this, "healthmonitor", false); + public get healthmonitor() { + return this._healthmonitor; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudElbActiveStandbyPoolsPoolsListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // loadbalancers - computed: true, optional: false, required: false + private _loadbalancers = new DataHuaweicloudElbActiveStandbyPoolsPoolsLoadbalancersList(this, "loadbalancers", false); + public get loadbalancers() { + return this._loadbalancers; + } + + // members - computed: true, optional: false, required: false + private _members = new DataHuaweicloudElbActiveStandbyPoolsPoolsMembersList(this, "members", true); + public get members() { + return this._members; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudElbActiveStandbyPoolsPoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbActiveStandbyPoolsPoolsOutputReference { + return new DataHuaweicloudElbActiveStandbyPoolsPoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools huaweicloud_elb_active_standby_pools} +*/ +export class DataHuaweicloudElbActiveStandbyPools extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_active_standby_pools"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbActiveStandbyPools resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbActiveStandbyPools to import + * @param importFromId The id of the existing DataHuaweicloudElbActiveStandbyPools that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbActiveStandbyPools to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_active_standby_pools", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_active_standby_pools huaweicloud_elb_active_standby_pools} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbActiveStandbyPoolsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbActiveStandbyPoolsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_active_standby_pools', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._healthmonitorId = config.healthmonitorId; + this._id = config.id; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._memberAddress = config.memberAddress; + this._memberInstanceId = config.memberInstanceId; + this._name = config.name; + this._poolId = config.poolId; + this._protocol = config.protocol; + this._region = config.region; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // healthmonitor_id - computed: false, optional: true, required: false + private _healthmonitorId?: string; + public get healthmonitorId() { + return this.getStringAttribute('healthmonitor_id'); + } + public set healthmonitorId(value: string) { + this._healthmonitorId = value; + } + public resetHealthmonitorId() { + this._healthmonitorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthmonitorIdInput() { + return this._healthmonitorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // member_address - computed: false, optional: true, required: false + private _memberAddress?: string; + public get memberAddress() { + return this.getStringAttribute('member_address'); + } + public set memberAddress(value: string) { + this._memberAddress = value; + } + public resetMemberAddress() { + this._memberAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberAddressInput() { + return this._memberAddress; + } + + // member_instance_id - computed: false, optional: true, required: false + private _memberInstanceId?: string; + public get memberInstanceId() { + return this.getStringAttribute('member_instance_id'); + } + public set memberInstanceId(value: string) { + this._memberInstanceId = value; + } + public resetMemberInstanceId() { + this._memberInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberInstanceIdInput() { + return this._memberInstanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: true, required: false + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + public resetPoolId() { + this._poolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // pools - computed: true, optional: false, required: false + private _pools = new DataHuaweicloudElbActiveStandbyPoolsPoolsList(this, "pools", false); + public get pools() { + return this._pools; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + healthmonitor_id: cdktf.stringToTerraform(this._healthmonitorId), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + member_address: cdktf.stringToTerraform(this._memberAddress), + member_instance_id: cdktf.stringToTerraform(this._memberInstanceId), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + healthmonitor_id: { + value: cdktf.stringToHclTerraform(this._healthmonitorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_address: { + value: cdktf.stringToHclTerraform(this._memberAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_instance_id: { + value: cdktf.stringToHclTerraform(this._memberInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/README.md new file mode 100644 index 00000000..5b5094ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_certificate` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/index.ts new file mode 100644 index 00000000..28fe95f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-certificate/index.ts @@ -0,0 +1,189 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate#id DataHuaweicloudElbCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate#name DataHuaweicloudElbCertificate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate#region DataHuaweicloudElbCertificate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate huaweicloud_elb_certificate} +*/ +export class DataHuaweicloudElbCertificate extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbCertificate to import + * @param importFromId The id of the existing DataHuaweicloudElbCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_certificate huaweicloud_elb_certificate} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbCertificateConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // expiration - computed: true, optional: false, required: false + public get expiration() { + return this.getStringAttribute('expiration'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/README.md new file mode 100644 index 00000000..e293ece7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/index.ts new file mode 100644 index 00000000..72f37b5b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-flavors/index.ts @@ -0,0 +1,428 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#bandwidth DataHuaweicloudElbFlavors#bandwidth} + */ + readonly bandwidth?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#cps DataHuaweicloudElbFlavors#cps} + */ + readonly cps?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#id DataHuaweicloudElbFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#max_connections DataHuaweicloudElbFlavors#max_connections} + */ + readonly maxConnections?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#name DataHuaweicloudElbFlavors#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#qps DataHuaweicloudElbFlavors#qps} + */ + readonly qps?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#region DataHuaweicloudElbFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#type DataHuaweicloudElbFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudElbFlavorsFlavors { +} + +export function dataHuaweicloudElbFlavorsFlavorsToTerraform(struct?: DataHuaweicloudElbFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudElbFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // cps - computed: true, optional: false, required: false + public get cps() { + return this.getNumberAttribute('cps'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_connections - computed: true, optional: false, required: false + public get maxConnections() { + return this.getNumberAttribute('max_connections'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // qps - computed: true, optional: false, required: false + public get qps() { + return this.getNumberAttribute('qps'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudElbFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbFlavorsFlavorsOutputReference { + return new DataHuaweicloudElbFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors huaweicloud_elb_flavors} +*/ +export class DataHuaweicloudElbFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbFlavors to import + * @param importFromId The id of the existing DataHuaweicloudElbFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_flavors huaweicloud_elb_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidth = config.bandwidth; + this._cps = config.cps; + this._id = config.id; + this._maxConnections = config.maxConnections; + this._name = config.name; + this._qps = config.qps; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth - computed: false, optional: true, required: false + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + public resetBandwidth() { + this._bandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // cps - computed: false, optional: true, required: false + private _cps?: number; + public get cps() { + return this.getNumberAttribute('cps'); + } + public set cps(value: number) { + this._cps = value; + } + public resetCps() { + this._cps = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpsInput() { + return this._cps; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudElbFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // max_connections - computed: false, optional: true, required: false + private _maxConnections?: number; + public get maxConnections() { + return this.getNumberAttribute('max_connections'); + } + public set maxConnections(value: number) { + this._maxConnections = value; + } + public resetMaxConnections() { + this._maxConnections = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConnectionsInput() { + return this._maxConnections; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // qps - computed: false, optional: true, required: false + private _qps?: number; + public get qps() { + return this.getNumberAttribute('qps'); + } + public set qps(value: number) { + this._qps = value; + } + public resetQps() { + this._qps = undefined; + } + // Temporarily expose input value. Use with caution. + public get qpsInput() { + return this._qps; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth: cdktf.numberToTerraform(this._bandwidth), + cps: cdktf.numberToTerraform(this._cps), + id: cdktf.stringToTerraform(this._id), + max_connections: cdktf.numberToTerraform(this._maxConnections), + name: cdktf.stringToTerraform(this._name), + qps: cdktf.numberToTerraform(this._qps), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cps: { + value: cdktf.numberToHclTerraform(this._cps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_connections: { + value: cdktf.numberToHclTerraform(this._maxConnections), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + qps: { + value: cdktf.numberToHclTerraform(this._qps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/README.md new file mode 100644 index 00000000..375462b0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_ipgroups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_ipgroups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/index.ts new file mode 100644 index 00000000..3a511252 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-ipgroups/index.ts @@ -0,0 +1,529 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbIpgroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#description DataHuaweicloudElbIpgroups#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#id DataHuaweicloudElbIpgroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#ip_address DataHuaweicloudElbIpgroups#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#ipgroup_id DataHuaweicloudElbIpgroups#ipgroup_id} + */ + readonly ipgroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#name DataHuaweicloudElbIpgroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#region DataHuaweicloudElbIpgroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudElbIpgroupsIpgroupsIpListStruct { +} + +export function dataHuaweicloudElbIpgroupsIpgroupsIpListStructToTerraform(struct?: DataHuaweicloudElbIpgroupsIpgroupsIpListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbIpgroupsIpgroupsIpListStructToHclTerraform(struct?: DataHuaweicloudElbIpgroupsIpgroupsIpListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbIpgroupsIpgroupsIpListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbIpgroupsIpgroupsIpListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbIpgroupsIpgroupsIpListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } +} + +export class DataHuaweicloudElbIpgroupsIpgroupsIpListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbIpgroupsIpgroupsIpListStructOutputReference { + return new DataHuaweicloudElbIpgroupsIpgroupsIpListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbIpgroupsIpgroupsListeners { +} + +export function dataHuaweicloudElbIpgroupsIpgroupsListenersToTerraform(struct?: DataHuaweicloudElbIpgroupsIpgroupsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbIpgroupsIpgroupsListenersToHclTerraform(struct?: DataHuaweicloudElbIpgroupsIpgroupsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbIpgroupsIpgroupsListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbIpgroupsIpgroupsListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbIpgroupsIpgroupsListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbIpgroupsIpgroupsListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbIpgroupsIpgroupsListenersOutputReference { + return new DataHuaweicloudElbIpgroupsIpgroupsListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbIpgroupsIpgroups { +} + +export function dataHuaweicloudElbIpgroupsIpgroupsToTerraform(struct?: DataHuaweicloudElbIpgroupsIpgroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbIpgroupsIpgroupsToHclTerraform(struct?: DataHuaweicloudElbIpgroupsIpgroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbIpgroupsIpgroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbIpgroupsIpgroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbIpgroupsIpgroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_list - computed: true, optional: false, required: false + private _ipList = new DataHuaweicloudElbIpgroupsIpgroupsIpListStructList(this, "ip_list", false); + public get ipList() { + return this._ipList; + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudElbIpgroupsIpgroupsListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudElbIpgroupsIpgroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbIpgroupsIpgroupsOutputReference { + return new DataHuaweicloudElbIpgroupsIpgroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups huaweicloud_elb_ipgroups} +*/ +export class DataHuaweicloudElbIpgroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_ipgroups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbIpgroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbIpgroups to import + * @param importFromId The id of the existing DataHuaweicloudElbIpgroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbIpgroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_ipgroups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_ipgroups huaweicloud_elb_ipgroups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbIpgroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbIpgroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_ipgroups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._ipgroupId = config.ipgroupId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ipgroup_id - computed: false, optional: true, required: false + private _ipgroupId?: string; + public get ipgroupId() { + return this.getStringAttribute('ipgroup_id'); + } + public set ipgroupId(value: string) { + this._ipgroupId = value; + } + public resetIpgroupId() { + this._ipgroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipgroupIdInput() { + return this._ipgroupId; + } + + // ipgroups - computed: true, optional: false, required: false + private _ipgroups = new DataHuaweicloudElbIpgroupsIpgroupsList(this, "ipgroups", false); + public get ipgroups() { + return this._ipgroups; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + ipgroup_id: cdktf.stringToTerraform(this._ipgroupId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipgroup_id: { + value: cdktf.stringToHclTerraform(this._ipgroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/README.md new file mode 100644 index 00000000..9513a156 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_l7policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_l7policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/index.ts new file mode 100644 index 00000000..806ea951 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7policies/index.ts @@ -0,0 +1,972 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbL7PoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#action DataHuaweicloudElbL7Policies#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#description DataHuaweicloudElbL7Policies#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#enterprise_project_id DataHuaweicloudElbL7Policies#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#id DataHuaweicloudElbL7Policies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#l7policy_id DataHuaweicloudElbL7Policies#l7policy_id} + */ + readonly l7PolicyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#listener_id DataHuaweicloudElbL7Policies#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#name DataHuaweicloudElbL7Policies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#priority DataHuaweicloudElbL7Policies#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#redirect_listener_id DataHuaweicloudElbL7Policies#redirect_listener_id} + */ + readonly redirectListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#redirect_pool_id DataHuaweicloudElbL7Policies#redirect_pool_id} + */ + readonly redirectPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#region DataHuaweicloudElbL7Policies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfig { +} + +export function dataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigToTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigToHclTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content_type - computed: true, optional: false, required: false + public get contentType() { + return this.getStringAttribute('content_type'); + } + + // message_body - computed: true, optional: false, required: false + public get messageBody() { + return this.getStringAttribute('message_body'); + } + + // status_code - computed: true, optional: false, required: false + public get statusCode() { + return this.getStringAttribute('status_code'); + } +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigOutputReference { + return new DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfig { +} + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigToTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigToHclTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // query - computed: true, optional: false, required: false + public get query() { + return this.getStringAttribute('query'); + } +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigOutputReference { + return new DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfig { +} + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigToTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigToHclTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // rewrite_url_config - computed: true, optional: false, required: false + private _rewriteUrlConfig = new DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigRewriteUrlConfigList(this, "rewrite_url_config", false); + public get rewriteUrlConfig() { + return this._rewriteUrlConfig; + } + + // rewrite_url_enabled - computed: true, optional: false, required: false + public get rewriteUrlEnabled() { + return this.getBooleanAttribute('rewrite_url_enabled'); + } +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigOutputReference { + return new DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfig { +} + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigToTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigToHclTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // query - computed: true, optional: false, required: false + public get query() { + return this.getStringAttribute('query'); + } + + // status_code - computed: true, optional: false, required: false + public get statusCode() { + return this.getStringAttribute('status_code'); + } +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigOutputReference { + return new DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbL7PoliciesL7PoliciesRules { +} + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRulesToTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7PoliciesL7PoliciesRulesToHclTerraform(struct?: DataHuaweicloudElbL7PoliciesL7PoliciesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7PoliciesL7PoliciesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7PoliciesL7PoliciesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7PoliciesL7PoliciesRulesOutputReference { + return new DataHuaweicloudElbL7PoliciesL7PoliciesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbL7PoliciesL7Policies { +} + +export function dataHuaweicloudElbL7PoliciesL7PoliciesToTerraform(struct?: DataHuaweicloudElbL7PoliciesL7Policies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7PoliciesL7PoliciesToHclTerraform(struct?: DataHuaweicloudElbL7PoliciesL7Policies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7PoliciesL7Policies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7PoliciesL7Policies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // fixed_response_config - computed: true, optional: false, required: false + private _fixedResponseConfig = new DataHuaweicloudElbL7PoliciesL7PoliciesFixedResponseConfigList(this, "fixed_response_config", false); + public get fixedResponseConfig() { + return this._fixedResponseConfig; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // listener_id - computed: true, optional: false, required: false + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // redirect_listener_id - computed: true, optional: false, required: false + public get redirectListenerId() { + return this.getStringAttribute('redirect_listener_id'); + } + + // redirect_pool_id - computed: true, optional: false, required: false + public get redirectPoolId() { + return this.getStringAttribute('redirect_pool_id'); + } + + // redirect_pools_extend_config - computed: true, optional: false, required: false + private _redirectPoolsExtendConfig = new DataHuaweicloudElbL7PoliciesL7PoliciesRedirectPoolsExtendConfigList(this, "redirect_pools_extend_config", false); + public get redirectPoolsExtendConfig() { + return this._redirectPoolsExtendConfig; + } + + // redirect_url_config - computed: true, optional: false, required: false + private _redirectUrlConfig = new DataHuaweicloudElbL7PoliciesL7PoliciesRedirectUrlConfigList(this, "redirect_url_config", false); + public get redirectUrlConfig() { + return this._redirectUrlConfig; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudElbL7PoliciesL7PoliciesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudElbL7PoliciesL7PoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7PoliciesL7PoliciesOutputReference { + return new DataHuaweicloudElbL7PoliciesL7PoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies huaweicloud_elb_l7policies} +*/ +export class DataHuaweicloudElbL7Policies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_l7policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbL7Policies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbL7Policies to import + * @param importFromId The id of the existing DataHuaweicloudElbL7Policies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbL7Policies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_l7policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7policies huaweicloud_elb_l7policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbL7PoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbL7PoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_l7policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._l7PolicyId = config.l7PolicyId; + this._listenerId = config.listenerId; + this._name = config.name; + this._priority = config.priority; + this._redirectListenerId = config.redirectListenerId; + this._redirectPoolId = config.redirectPoolId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // l7policies - computed: true, optional: false, required: false + private _l7Policies = new DataHuaweicloudElbL7PoliciesL7PoliciesList(this, "l7policies", false); + public get l7Policies() { + return this._l7Policies; + } + + // l7policy_id - computed: false, optional: true, required: false + private _l7PolicyId?: string; + public get l7PolicyId() { + return this.getStringAttribute('l7policy_id'); + } + public set l7PolicyId(value: string) { + this._l7PolicyId = value; + } + public resetL7PolicyId() { + this._l7PolicyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get l7PolicyIdInput() { + return this._l7PolicyId; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // priority - computed: false, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // redirect_listener_id - computed: false, optional: true, required: false + private _redirectListenerId?: string; + public get redirectListenerId() { + return this.getStringAttribute('redirect_listener_id'); + } + public set redirectListenerId(value: string) { + this._redirectListenerId = value; + } + public resetRedirectListenerId() { + this._redirectListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectListenerIdInput() { + return this._redirectListenerId; + } + + // redirect_pool_id - computed: false, optional: true, required: false + private _redirectPoolId?: string; + public get redirectPoolId() { + return this.getStringAttribute('redirect_pool_id'); + } + public set redirectPoolId(value: string) { + this._redirectPoolId = value; + } + public resetRedirectPoolId() { + this._redirectPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolIdInput() { + return this._redirectPoolId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + l7policy_id: cdktf.stringToTerraform(this._l7PolicyId), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + priority: cdktf.numberToTerraform(this._priority), + redirect_listener_id: cdktf.stringToTerraform(this._redirectListenerId), + redirect_pool_id: cdktf.stringToTerraform(this._redirectPoolId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7policy_id: { + value: cdktf.stringToHclTerraform(this._l7PolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + redirect_listener_id: { + value: cdktf.stringToHclTerraform(this._redirectListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redirect_pool_id: { + value: cdktf.stringToHclTerraform(this._redirectPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/README.md new file mode 100644 index 00000000..bc62e4f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_l7rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_l7rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/index.ts new file mode 100644 index 00000000..40ae2e5d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-l7rules/index.ts @@ -0,0 +1,501 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbL7RulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#compare_type DataHuaweicloudElbL7Rules#compare_type} + */ + readonly compareType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#enterprise_project_id DataHuaweicloudElbL7Rules#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#id DataHuaweicloudElbL7Rules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#l7policy_id DataHuaweicloudElbL7Rules#l7policy_id} + */ + readonly l7PolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#l7rule_id DataHuaweicloudElbL7Rules#l7rule_id} + */ + readonly l7RuleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#region DataHuaweicloudElbL7Rules#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#type DataHuaweicloudElbL7Rules#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#value DataHuaweicloudElbL7Rules#value} + */ + readonly value?: string; +} +export interface DataHuaweicloudElbL7RulesL7RulesConditions { +} + +export function dataHuaweicloudElbL7RulesL7RulesConditionsToTerraform(struct?: DataHuaweicloudElbL7RulesL7RulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7RulesL7RulesConditionsToHclTerraform(struct?: DataHuaweicloudElbL7RulesL7RulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7RulesL7RulesConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7RulesL7RulesConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7RulesL7RulesConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudElbL7RulesL7RulesConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7RulesL7RulesConditionsOutputReference { + return new DataHuaweicloudElbL7RulesL7RulesConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbL7RulesL7Rules { +} + +export function dataHuaweicloudElbL7RulesL7RulesToTerraform(struct?: DataHuaweicloudElbL7RulesL7Rules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbL7RulesL7RulesToHclTerraform(struct?: DataHuaweicloudElbL7RulesL7Rules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbL7RulesL7RulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbL7RulesL7Rules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbL7RulesL7Rules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compare_type - computed: true, optional: false, required: false + public get compareType() { + return this.getStringAttribute('compare_type'); + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudElbL7RulesL7RulesConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudElbL7RulesL7RulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbL7RulesL7RulesOutputReference { + return new DataHuaweicloudElbL7RulesL7RulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules huaweicloud_elb_l7rules} +*/ +export class DataHuaweicloudElbL7Rules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_l7rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbL7Rules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbL7Rules to import + * @param importFromId The id of the existing DataHuaweicloudElbL7Rules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbL7Rules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_l7rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_l7rules huaweicloud_elb_l7rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbL7RulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbL7RulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_l7rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._compareType = config.compareType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._l7PolicyId = config.l7PolicyId; + this._l7RuleId = config.l7RuleId; + this._region = config.region; + this._type = config.type; + this._value = config.value; + } + + // ========== + // ATTRIBUTES + // ========== + + // compare_type - computed: false, optional: true, required: false + private _compareType?: string; + public get compareType() { + return this.getStringAttribute('compare_type'); + } + public set compareType(value: string) { + this._compareType = value; + } + public resetCompareType() { + this._compareType = undefined; + } + // Temporarily expose input value. Use with caution. + public get compareTypeInput() { + return this._compareType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // l7policy_id - computed: false, optional: false, required: true + private _l7PolicyId?: string; + public get l7PolicyId() { + return this.getStringAttribute('l7policy_id'); + } + public set l7PolicyId(value: string) { + this._l7PolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get l7PolicyIdInput() { + return this._l7PolicyId; + } + + // l7rule_id - computed: false, optional: true, required: false + private _l7RuleId?: string; + public get l7RuleId() { + return this.getStringAttribute('l7rule_id'); + } + public set l7RuleId(value: string) { + this._l7RuleId = value; + } + public resetL7RuleId() { + this._l7RuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get l7RuleIdInput() { + return this._l7RuleId; + } + + // l7rules - computed: true, optional: false, required: false + private _l7Rules = new DataHuaweicloudElbL7RulesL7RulesList(this, "l7rules", false); + public get l7Rules() { + return this._l7Rules; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + compare_type: cdktf.stringToTerraform(this._compareType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + l7policy_id: cdktf.stringToTerraform(this._l7PolicyId), + l7rule_id: cdktf.stringToTerraform(this._l7RuleId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + value: cdktf.stringToTerraform(this._value), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + compare_type: { + value: cdktf.stringToHclTerraform(this._compareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7policy_id: { + value: cdktf.stringToHclTerraform(this._l7PolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7rule_id: { + value: cdktf.stringToHclTerraform(this._l7RuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/README.md new file mode 100644 index 00000000..54878592 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_listeners` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_listeners`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/index.ts new file mode 100644 index 00000000..d692291d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-listeners/index.ts @@ -0,0 +1,526 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbListenersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#description DataHuaweicloudElbListeners#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#enterprise_project_id DataHuaweicloudElbListeners#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#id DataHuaweicloudElbListeners#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#listener_id DataHuaweicloudElbListeners#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#loadbalancer_id DataHuaweicloudElbListeners#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#name DataHuaweicloudElbListeners#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#protocol DataHuaweicloudElbListeners#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#protocol_port DataHuaweicloudElbListeners#protocol_port} + */ + readonly protocolPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#region DataHuaweicloudElbListeners#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudElbListenersListeners { +} + +export function dataHuaweicloudElbListenersListenersToTerraform(struct?: DataHuaweicloudElbListenersListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbListenersListenersToHclTerraform(struct?: DataHuaweicloudElbListenersListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbListenersListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbListenersListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbListenersListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advanced_forwarding_enabled - computed: true, optional: false, required: false + public get advancedForwardingEnabled() { + return this.getBooleanAttribute('advanced_forwarding_enabled'); + } + + // ca_certificate - computed: true, optional: false, required: false + public get caCertificate() { + return this.getStringAttribute('ca_certificate'); + } + + // default_pool_id - computed: true, optional: false, required: false + public get defaultPoolId() { + return this.getStringAttribute('default_pool_id'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // forward_eip - computed: true, optional: false, required: false + public get forwardEip() { + return this.getBooleanAttribute('forward_eip'); + } + + // forward_host - computed: true, optional: false, required: false + public get forwardHost() { + return this.getBooleanAttribute('forward_host'); + } + + // forward_port - computed: true, optional: false, required: false + public get forwardPort() { + return this.getBooleanAttribute('forward_port'); + } + + // forward_request_port - computed: true, optional: false, required: false + public get forwardRequestPort() { + return this.getBooleanAttribute('forward_request_port'); + } + + // http2_enable - computed: true, optional: false, required: false + public get http2Enable() { + return this.getBooleanAttribute('http2_enable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // idle_timeout - computed: true, optional: false, required: false + public get idleTimeout() { + return this.getNumberAttribute('idle_timeout'); + } + + // loadbalancer_id - computed: true, optional: false, required: false + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protection_reason - computed: true, optional: false, required: false + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + + // protection_status - computed: true, optional: false, required: false + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + + // request_timeout - computed: true, optional: false, required: false + public get requestTimeout() { + return this.getNumberAttribute('request_timeout'); + } + + // response_timeout - computed: true, optional: false, required: false + public get responseTimeout() { + return this.getNumberAttribute('response_timeout'); + } + + // server_certificate - computed: true, optional: false, required: false + public get serverCertificate() { + return this.getStringAttribute('server_certificate'); + } + + // sni_certificate - computed: true, optional: false, required: false + public get sniCertificate() { + return this.getListAttribute('sni_certificate'); + } + + // tls_ciphers_policy - computed: true, optional: false, required: false + public get tlsCiphersPolicy() { + return this.getStringAttribute('tls_ciphers_policy'); + } +} + +export class DataHuaweicloudElbListenersListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbListenersListenersOutputReference { + return new DataHuaweicloudElbListenersListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners huaweicloud_elb_listeners} +*/ +export class DataHuaweicloudElbListeners extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_listeners"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbListeners resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbListeners to import + * @param importFromId The id of the existing DataHuaweicloudElbListeners that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbListeners to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_listeners", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_listeners huaweicloud_elb_listeners} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbListenersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbListenersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_listeners', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protocol = config.protocol; + this._protocolPort = config.protocolPort; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudElbListenersListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // protocol_port - computed: false, optional: true, required: false + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + public resetProtocolPort() { + this._protocolPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/README.md new file mode 100644 index 00000000..b43cf013 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_loadbalancers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_loadbalancers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/index.ts new file mode 100644 index 00000000..bcad92aa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-loadbalancers/index.ts @@ -0,0 +1,610 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbLoadbalancersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#description DataHuaweicloudElbLoadbalancers#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#enterprise_project_id DataHuaweicloudElbLoadbalancers#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#id DataHuaweicloudElbLoadbalancers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#ipv4_subnet_id DataHuaweicloudElbLoadbalancers#ipv4_subnet_id} + */ + readonly ipv4SubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#ipv6_network_id DataHuaweicloudElbLoadbalancers#ipv6_network_id} + */ + readonly ipv6NetworkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#l4_flavor_id DataHuaweicloudElbLoadbalancers#l4_flavor_id} + */ + readonly l4FlavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#l7_flavor_id DataHuaweicloudElbLoadbalancers#l7_flavor_id} + */ + readonly l7FlavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#loadbalancer_id DataHuaweicloudElbLoadbalancers#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#name DataHuaweicloudElbLoadbalancers#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#region DataHuaweicloudElbLoadbalancers#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#type DataHuaweicloudElbLoadbalancers#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#vpc_id DataHuaweicloudElbLoadbalancers#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudElbLoadbalancersLoadbalancers { +} + +export function dataHuaweicloudElbLoadbalancersLoadbalancersToTerraform(struct?: DataHuaweicloudElbLoadbalancersLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbLoadbalancersLoadbalancersToHclTerraform(struct?: DataHuaweicloudElbLoadbalancersLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbLoadbalancersLoadbalancersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbLoadbalancersLoadbalancers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbLoadbalancersLoadbalancers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // autoscaling_enabled - computed: true, optional: false, required: false + public get autoscalingEnabled() { + return this.getBooleanAttribute('autoscaling_enabled'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getListAttribute('availability_zone'); + } + + // backend_subnets - computed: true, optional: false, required: false + public get backendSubnets() { + return this.getListAttribute('backend_subnets'); + } + + // cross_vpc_backend - computed: true, optional: false, required: false + public get crossVpcBackend() { + return this.getBooleanAttribute('cross_vpc_backend'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gw_flavor_id - computed: true, optional: false, required: false + public get gwFlavorId() { + return this.getStringAttribute('gw_flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv4_address - computed: true, optional: false, required: false + public get ipv4Address() { + return this.getStringAttribute('ipv4_address'); + } + + // ipv4_port_id - computed: true, optional: false, required: false + public get ipv4PortId() { + return this.getStringAttribute('ipv4_port_id'); + } + + // ipv4_subnet_id - computed: true, optional: false, required: false + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + + // ipv6_address - computed: true, optional: false, required: false + public get ipv6Address() { + return this.getStringAttribute('ipv6_address'); + } + + // ipv6_network_id - computed: true, optional: false, required: false + public get ipv6NetworkId() { + return this.getStringAttribute('ipv6_network_id'); + } + + // l4_flavor_id - computed: true, optional: false, required: false + public get l4FlavorId() { + return this.getStringAttribute('l4_flavor_id'); + } + + // l7_flavor_id - computed: true, optional: false, required: false + public get l7FlavorId() { + return this.getStringAttribute('l7_flavor_id'); + } + + // loadbalancer_type - computed: true, optional: false, required: false + public get loadbalancerType() { + return this.getStringAttribute('loadbalancer_type'); + } + + // min_l7_flavor_id - computed: true, optional: false, required: false + public get minL7FlavorId() { + return this.getStringAttribute('min_l7_flavor_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protection_reason - computed: true, optional: false, required: false + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + + // protection_status - computed: true, optional: false, required: false + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudElbLoadbalancersLoadbalancersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbLoadbalancersLoadbalancersOutputReference { + return new DataHuaweicloudElbLoadbalancersLoadbalancersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers huaweicloud_elb_loadbalancers} +*/ +export class DataHuaweicloudElbLoadbalancers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_loadbalancers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbLoadbalancers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbLoadbalancers to import + * @param importFromId The id of the existing DataHuaweicloudElbLoadbalancers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbLoadbalancers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_loadbalancers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_loadbalancers huaweicloud_elb_loadbalancers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbLoadbalancersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbLoadbalancersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_loadbalancers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ipv4SubnetId = config.ipv4SubnetId; + this._ipv6NetworkId = config.ipv6NetworkId; + this._l4FlavorId = config.l4FlavorId; + this._l7FlavorId = config.l7FlavorId; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv4_subnet_id - computed: false, optional: true, required: false + private _ipv4SubnetId?: string; + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + public set ipv4SubnetId(value: string) { + this._ipv4SubnetId = value; + } + public resetIpv4SubnetId() { + this._ipv4SubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv4SubnetIdInput() { + return this._ipv4SubnetId; + } + + // ipv6_network_id - computed: false, optional: true, required: false + private _ipv6NetworkId?: string; + public get ipv6NetworkId() { + return this.getStringAttribute('ipv6_network_id'); + } + public set ipv6NetworkId(value: string) { + this._ipv6NetworkId = value; + } + public resetIpv6NetworkId() { + this._ipv6NetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6NetworkIdInput() { + return this._ipv6NetworkId; + } + + // l4_flavor_id - computed: false, optional: true, required: false + private _l4FlavorId?: string; + public get l4FlavorId() { + return this.getStringAttribute('l4_flavor_id'); + } + public set l4FlavorId(value: string) { + this._l4FlavorId = value; + } + public resetL4FlavorId() { + this._l4FlavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get l4FlavorIdInput() { + return this._l4FlavorId; + } + + // l7_flavor_id - computed: false, optional: true, required: false + private _l7FlavorId?: string; + public get l7FlavorId() { + return this.getStringAttribute('l7_flavor_id'); + } + public set l7FlavorId(value: string) { + this._l7FlavorId = value; + } + public resetL7FlavorId() { + this._l7FlavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get l7FlavorIdInput() { + return this._l7FlavorId; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // loadbalancers - computed: true, optional: false, required: false + private _loadbalancers = new DataHuaweicloudElbLoadbalancersLoadbalancersList(this, "loadbalancers", false); + public get loadbalancers() { + return this._loadbalancers; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ipv4_subnet_id: cdktf.stringToTerraform(this._ipv4SubnetId), + ipv6_network_id: cdktf.stringToTerraform(this._ipv6NetworkId), + l4_flavor_id: cdktf.stringToTerraform(this._l4FlavorId), + l7_flavor_id: cdktf.stringToTerraform(this._l7FlavorId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv4_subnet_id: { + value: cdktf.stringToHclTerraform(this._ipv4SubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_network_id: { + value: cdktf.stringToHclTerraform(this._ipv6NetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l4_flavor_id: { + value: cdktf.stringToHclTerraform(this._l4FlavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7_flavor_id: { + value: cdktf.stringToHclTerraform(this._l7FlavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/README.md new file mode 100644 index 00000000..51a2cb60 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_logtanks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_logtanks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/index.ts new file mode 100644 index 00000000..9fb5f127 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-logtanks/index.ts @@ -0,0 +1,380 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbLogtanksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#enterprise_project_id DataHuaweicloudElbLogtanks#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#id DataHuaweicloudElbLogtanks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#loadbalancer_id DataHuaweicloudElbLogtanks#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#log_group_id DataHuaweicloudElbLogtanks#log_group_id} + */ + readonly logGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#log_topic_id DataHuaweicloudElbLogtanks#log_topic_id} + */ + readonly logTopicId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#logtank_id DataHuaweicloudElbLogtanks#logtank_id} + */ + readonly logtankId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#region DataHuaweicloudElbLogtanks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudElbLogtanksLogtanks { +} + +export function dataHuaweicloudElbLogtanksLogtanksToTerraform(struct?: DataHuaweicloudElbLogtanksLogtanks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbLogtanksLogtanksToHclTerraform(struct?: DataHuaweicloudElbLogtanksLogtanks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbLogtanksLogtanksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbLogtanksLogtanks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbLogtanksLogtanks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // loadbalancer_id - computed: true, optional: false, required: false + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_topic_id - computed: true, optional: false, required: false + public get logTopicId() { + return this.getStringAttribute('log_topic_id'); + } +} + +export class DataHuaweicloudElbLogtanksLogtanksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbLogtanksLogtanksOutputReference { + return new DataHuaweicloudElbLogtanksLogtanksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks huaweicloud_elb_logtanks} +*/ +export class DataHuaweicloudElbLogtanks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_logtanks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbLogtanks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbLogtanks to import + * @param importFromId The id of the existing DataHuaweicloudElbLogtanks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbLogtanks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_logtanks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_logtanks huaweicloud_elb_logtanks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbLogtanksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbLogtanksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_logtanks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._loadbalancerId = config.loadbalancerId; + this._logGroupId = config.logGroupId; + this._logTopicId = config.logTopicId; + this._logtankId = config.logtankId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // log_group_id - computed: false, optional: true, required: false + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + public resetLogGroupId() { + this._logGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_topic_id - computed: false, optional: true, required: false + private _logTopicId?: string; + public get logTopicId() { + return this.getStringAttribute('log_topic_id'); + } + public set logTopicId(value: string) { + this._logTopicId = value; + } + public resetLogTopicId() { + this._logTopicId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logTopicIdInput() { + return this._logTopicId; + } + + // logtank_id - computed: false, optional: true, required: false + private _logtankId?: string; + public get logtankId() { + return this.getStringAttribute('logtank_id'); + } + public set logtankId(value: string) { + this._logtankId = value; + } + public resetLogtankId() { + this._logtankId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logtankIdInput() { + return this._logtankId; + } + + // logtanks - computed: true, optional: false, required: false + private _logtanks = new DataHuaweicloudElbLogtanksLogtanksList(this, "logtanks", false); + public get logtanks() { + return this._logtanks; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_topic_id: cdktf.stringToTerraform(this._logTopicId), + logtank_id: cdktf.stringToTerraform(this._logtankId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_topic_id: { + value: cdktf.stringToHclTerraform(this._logTopicId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logtank_id: { + value: cdktf.stringToHclTerraform(this._logtankId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/README.md new file mode 100644 index 00000000..34a31ac1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_members` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_members`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/index.ts new file mode 100644 index 00000000..bed0ff13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-members/index.ts @@ -0,0 +1,504 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbMembersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#address DataHuaweicloudElbMembers#address} + */ + readonly address?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#enterprise_project_id DataHuaweicloudElbMembers#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#id DataHuaweicloudElbMembers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#member_id DataHuaweicloudElbMembers#member_id} + */ + readonly memberId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#member_type DataHuaweicloudElbMembers#member_type} + */ + readonly memberType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#name DataHuaweicloudElbMembers#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#pool_id DataHuaweicloudElbMembers#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#protocol_port DataHuaweicloudElbMembers#protocol_port} + */ + readonly protocolPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#region DataHuaweicloudElbMembers#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#subnet_id DataHuaweicloudElbMembers#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#weight DataHuaweicloudElbMembers#weight} + */ + readonly weight?: number; +} +export interface DataHuaweicloudElbMembersMembers { +} + +export function dataHuaweicloudElbMembersMembersToTerraform(struct?: DataHuaweicloudElbMembersMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbMembersMembersToHclTerraform(struct?: DataHuaweicloudElbMembersMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbMembersMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbMembersMembers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbMembersMembers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // member_type - computed: true, optional: false, required: false + public get memberType() { + return this.getStringAttribute('member_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudElbMembersMembersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbMembersMembersOutputReference { + return new DataHuaweicloudElbMembersMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members huaweicloud_elb_members} +*/ +export class DataHuaweicloudElbMembers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_members"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbMembers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbMembers to import + * @param importFromId The id of the existing DataHuaweicloudElbMembers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbMembers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_members", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_members huaweicloud_elb_members} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbMembersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbMembersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_members', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._memberId = config.memberId; + this._memberType = config.memberType; + this._name = config.name; + this._poolId = config.poolId; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._subnetId = config.subnetId; + this._weight = config.weight; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // member_id - computed: false, optional: true, required: false + private _memberId?: string; + public get memberId() { + return this.getStringAttribute('member_id'); + } + public set memberId(value: string) { + this._memberId = value; + } + public resetMemberId() { + this._memberId = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberIdInput() { + return this._memberId; + } + + // member_type - computed: false, optional: true, required: false + private _memberType?: string; + public get memberType() { + return this.getStringAttribute('member_type'); + } + public set memberType(value: string) { + this._memberType = value; + } + public resetMemberType() { + this._memberType = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberTypeInput() { + return this._memberType; + } + + // members - computed: true, optional: false, required: false + private _members = new DataHuaweicloudElbMembersMembersList(this, "members", false); + public get members() { + return this._members; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // protocol_port - computed: false, optional: true, required: false + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + public resetProtocolPort() { + this._protocolPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // weight - computed: false, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + member_id: cdktf.stringToTerraform(this._memberId), + member_type: cdktf.stringToTerraform(this._memberType), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + weight: cdktf.numberToTerraform(this._weight), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_id: { + value: cdktf.stringToHclTerraform(this._memberId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_type: { + value: cdktf.stringToHclTerraform(this._memberType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(this._weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/README.md new file mode 100644 index 00000000..a456e444 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_monitors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_monitors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/index.ts new file mode 100644 index 00000000..46c5f611 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-monitors/index.ts @@ -0,0 +1,644 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbMonitorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#domain_name DataHuaweicloudElbMonitors#domain_name} + */ + readonly domainName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#enterprise_project_id DataHuaweicloudElbMonitors#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#id DataHuaweicloudElbMonitors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#interval DataHuaweicloudElbMonitors#interval} + */ + readonly interval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#max_retries DataHuaweicloudElbMonitors#max_retries} + */ + readonly maxRetries?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#max_retries_down DataHuaweicloudElbMonitors#max_retries_down} + */ + readonly maxRetriesDown?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#monitor_id DataHuaweicloudElbMonitors#monitor_id} + */ + readonly monitorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#name DataHuaweicloudElbMonitors#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#pool_id DataHuaweicloudElbMonitors#pool_id} + */ + readonly poolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#port DataHuaweicloudElbMonitors#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#protocol DataHuaweicloudElbMonitors#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#region DataHuaweicloudElbMonitors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#status_code DataHuaweicloudElbMonitors#status_code} + */ + readonly statusCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#timeout DataHuaweicloudElbMonitors#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#url_path DataHuaweicloudElbMonitors#url_path} + */ + readonly urlPath?: string; +} +export interface DataHuaweicloudElbMonitorsMonitors { +} + +export function dataHuaweicloudElbMonitorsMonitorsToTerraform(struct?: DataHuaweicloudElbMonitorsMonitors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbMonitorsMonitorsToHclTerraform(struct?: DataHuaweicloudElbMonitorsMonitors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbMonitorsMonitorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbMonitorsMonitors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbMonitorsMonitors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // interval - computed: true, optional: false, required: false + public get interval() { + return this.getNumberAttribute('interval'); + } + + // max_retries - computed: true, optional: false, required: false + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + + // max_retries_down - computed: true, optional: false, required: false + public get maxRetriesDown() { + return this.getNumberAttribute('max_retries_down'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // pool_id - computed: true, optional: false, required: false + public get poolId() { + return this.getStringAttribute('pool_id'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // status_code - computed: true, optional: false, required: false + public get statusCode() { + return this.getStringAttribute('status_code'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // url_path - computed: true, optional: false, required: false + public get urlPath() { + return this.getStringAttribute('url_path'); + } +} + +export class DataHuaweicloudElbMonitorsMonitorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbMonitorsMonitorsOutputReference { + return new DataHuaweicloudElbMonitorsMonitorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors huaweicloud_elb_monitors} +*/ +export class DataHuaweicloudElbMonitors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_monitors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbMonitors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbMonitors to import + * @param importFromId The id of the existing DataHuaweicloudElbMonitors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbMonitors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_monitors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_monitors huaweicloud_elb_monitors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbMonitorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbMonitorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_monitors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainName = config.domainName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._interval = config.interval; + this._maxRetries = config.maxRetries; + this._maxRetriesDown = config.maxRetriesDown; + this._monitorId = config.monitorId; + this._name = config.name; + this._poolId = config.poolId; + this._port = config.port; + this._protocol = config.protocol; + this._region = config.region; + this._statusCode = config.statusCode; + this._timeout = config.timeout; + this._urlPath = config.urlPath; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_name - computed: false, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interval - computed: false, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // max_retries - computed: false, optional: true, required: false + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + public resetMaxRetries() { + this._maxRetries = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // max_retries_down - computed: false, optional: true, required: false + private _maxRetriesDown?: number; + public get maxRetriesDown() { + return this.getNumberAttribute('max_retries_down'); + } + public set maxRetriesDown(value: number) { + this._maxRetriesDown = value; + } + public resetMaxRetriesDown() { + this._maxRetriesDown = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesDownInput() { + return this._maxRetriesDown; + } + + // monitor_id - computed: false, optional: true, required: false + private _monitorId?: string; + public get monitorId() { + return this.getStringAttribute('monitor_id'); + } + public set monitorId(value: string) { + this._monitorId = value; + } + public resetMonitorId() { + this._monitorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorIdInput() { + return this._monitorId; + } + + // monitors - computed: true, optional: false, required: false + private _monitors = new DataHuaweicloudElbMonitorsMonitorsList(this, "monitors", false); + public get monitors() { + return this._monitors; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: true, required: false + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + public resetPoolId() { + this._poolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status_code - computed: false, optional: true, required: false + private _statusCode?: string; + public get statusCode() { + return this.getStringAttribute('status_code'); + } + public set statusCode(value: string) { + this._statusCode = value; + } + public resetStatusCode() { + this._statusCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // url_path - computed: false, optional: true, required: false + private _urlPath?: string; + public get urlPath() { + return this.getStringAttribute('url_path'); + } + public set urlPath(value: string) { + this._urlPath = value; + } + public resetUrlPath() { + this._urlPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlPathInput() { + return this._urlPath; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_name: cdktf.stringToTerraform(this._domainName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + interval: cdktf.numberToTerraform(this._interval), + max_retries: cdktf.numberToTerraform(this._maxRetries), + max_retries_down: cdktf.numberToTerraform(this._maxRetriesDown), + monitor_id: cdktf.stringToTerraform(this._monitorId), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + port: cdktf.numberToTerraform(this._port), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + status_code: cdktf.stringToTerraform(this._statusCode), + timeout: cdktf.numberToTerraform(this._timeout), + url_path: cdktf.stringToTerraform(this._urlPath), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(this._interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries_down: { + value: cdktf.numberToHclTerraform(this._maxRetriesDown), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + monitor_id: { + value: cdktf.stringToHclTerraform(this._monitorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.stringToHclTerraform(this._statusCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + url_path: { + value: cdktf.stringToHclTerraform(this._urlPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/README.md new file mode 100644 index 00000000..761711b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_pools` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_pools`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/index.ts new file mode 100644 index 00000000..1ad05424 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-pools/index.ts @@ -0,0 +1,964 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbPoolsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#description DataHuaweicloudElbPools#description} + */ + readonly description?: string; + /** + * Specifies the health monitor ID of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#healthmonitor_id DataHuaweicloudElbPools#healthmonitor_id} + */ + readonly healthmonitorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#id DataHuaweicloudElbPools#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the method of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#lb_method DataHuaweicloudElbPools#lb_method} + */ + readonly lbMethod?: string; + /** + * Specifies the listener ID of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#listener_id DataHuaweicloudElbPools#listener_id} + */ + readonly listenerId?: string; + /** + * Specifies the loadbalancer ID of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#loadbalancer_id DataHuaweicloudElbPools#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Specifies the name of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#name DataHuaweicloudElbPools#name} + */ + readonly name?: string; + /** + * Specifies the ID of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#pool_id DataHuaweicloudElbPools#pool_id} + */ + readonly poolId?: string; + /** + * Specifies the protection status for update. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#protection_status DataHuaweicloudElbPools#protection_status} + */ + readonly protectionStatus?: string; + /** + * Specifies the protocol of the ELB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#protocol DataHuaweicloudElbPools#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#region DataHuaweicloudElbPools#region} + */ + readonly region?: string; + /** + * Specifies the type of the backend server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#type DataHuaweicloudElbPools#type} + */ + readonly type?: string; + /** + * Specifies the ID of the VPC where the backend server group works. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#vpc_id DataHuaweicloudElbPools#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudElbPoolsPoolsListeners { +} + +export function dataHuaweicloudElbPoolsPoolsListenersToTerraform(struct?: DataHuaweicloudElbPoolsPoolsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbPoolsPoolsListenersToHclTerraform(struct?: DataHuaweicloudElbPoolsPoolsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbPoolsPoolsListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbPoolsPoolsListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbPoolsPoolsListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbPoolsPoolsListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbPoolsPoolsListenersOutputReference { + return new DataHuaweicloudElbPoolsPoolsListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbPoolsPoolsLoadbalancers { +} + +export function dataHuaweicloudElbPoolsPoolsLoadbalancersToTerraform(struct?: DataHuaweicloudElbPoolsPoolsLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbPoolsPoolsLoadbalancersToHclTerraform(struct?: DataHuaweicloudElbPoolsPoolsLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbPoolsPoolsLoadbalancersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbPoolsPoolsLoadbalancers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbPoolsPoolsLoadbalancers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbPoolsPoolsLoadbalancersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbPoolsPoolsLoadbalancersOutputReference { + return new DataHuaweicloudElbPoolsPoolsLoadbalancersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbPoolsPoolsMembers { +} + +export function dataHuaweicloudElbPoolsPoolsMembersToTerraform(struct?: DataHuaweicloudElbPoolsPoolsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbPoolsPoolsMembersToHclTerraform(struct?: DataHuaweicloudElbPoolsPoolsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbPoolsPoolsMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbPoolsPoolsMembers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbPoolsPoolsMembers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbPoolsPoolsMembersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbPoolsPoolsMembersOutputReference { + return new DataHuaweicloudElbPoolsPoolsMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbPoolsPoolsPersistence { +} + +export function dataHuaweicloudElbPoolsPoolsPersistenceToTerraform(struct?: DataHuaweicloudElbPoolsPoolsPersistence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbPoolsPoolsPersistenceToHclTerraform(struct?: DataHuaweicloudElbPoolsPoolsPersistence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbPoolsPoolsPersistenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbPoolsPoolsPersistence | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbPoolsPoolsPersistence | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cookie_name - computed: true, optional: false, required: false + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudElbPoolsPoolsPersistenceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbPoolsPoolsPersistenceOutputReference { + return new DataHuaweicloudElbPoolsPoolsPersistenceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbPoolsPools { +} + +export function dataHuaweicloudElbPoolsPoolsToTerraform(struct?: DataHuaweicloudElbPoolsPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbPoolsPoolsToHclTerraform(struct?: DataHuaweicloudElbPoolsPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbPoolsPoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbPoolsPools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbPoolsPools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connection_drain_enabled - computed: true, optional: false, required: false + public get connectionDrainEnabled() { + return this.getBooleanAttribute('connection_drain_enabled'); + } + + // connection_drain_timeout - computed: true, optional: false, required: false + public get connectionDrainTimeout() { + return this.getNumberAttribute('connection_drain_timeout'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // healthmonitor_id - computed: true, optional: false, required: false + public get healthmonitorId() { + return this.getStringAttribute('healthmonitor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + + // lb_method - computed: true, optional: false, required: false + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudElbPoolsPoolsListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // loadbalancers - computed: true, optional: false, required: false + private _loadbalancers = new DataHuaweicloudElbPoolsPoolsLoadbalancersList(this, "loadbalancers", false); + public get loadbalancers() { + return this._loadbalancers; + } + + // members - computed: true, optional: false, required: false + private _members = new DataHuaweicloudElbPoolsPoolsMembersList(this, "members", false); + public get members() { + return this._members; + } + + // minimum_healthy_member_count - computed: true, optional: false, required: false + public get minimumHealthyMemberCount() { + return this.getNumberAttribute('minimum_healthy_member_count'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // persistence - computed: true, optional: false, required: false + private _persistence = new DataHuaweicloudElbPoolsPoolsPersistenceList(this, "persistence", false); + public get persistence() { + return this._persistence; + } + + // protection_reason - computed: true, optional: false, required: false + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + + // protection_status - computed: true, optional: false, required: false + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // slow_start_duration - computed: true, optional: false, required: false + public get slowStartDuration() { + return this.getNumberAttribute('slow_start_duration'); + } + + // slow_start_enabled - computed: true, optional: false, required: false + public get slowStartEnabled() { + return this.getBooleanAttribute('slow_start_enabled'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudElbPoolsPoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbPoolsPoolsOutputReference { + return new DataHuaweicloudElbPoolsPoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools huaweicloud_elb_pools} +*/ +export class DataHuaweicloudElbPools extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_pools"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbPools resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbPools to import + * @param importFromId The id of the existing DataHuaweicloudElbPools that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbPools to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_pools", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_pools huaweicloud_elb_pools} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbPoolsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbPoolsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_pools', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._healthmonitorId = config.healthmonitorId; + this._id = config.id; + this._lbMethod = config.lbMethod; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._poolId = config.poolId; + this._protectionStatus = config.protectionStatus; + this._protocol = config.protocol; + this._region = config.region; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // healthmonitor_id - computed: false, optional: true, required: false + private _healthmonitorId?: string; + public get healthmonitorId() { + return this.getStringAttribute('healthmonitor_id'); + } + public set healthmonitorId(value: string) { + this._healthmonitorId = value; + } + public resetHealthmonitorId() { + this._healthmonitorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthmonitorIdInput() { + return this._healthmonitorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_method - computed: false, optional: true, required: false + private _lbMethod?: string; + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + public set lbMethod(value: string) { + this._lbMethod = value; + } + public resetLbMethod() { + this._lbMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbMethodInput() { + return this._lbMethod; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: true, required: false + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + public resetPoolId() { + this._poolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // pools - computed: true, optional: false, required: false + private _pools = new DataHuaweicloudElbPoolsPoolsList(this, "pools", false); + public get pools() { + return this._pools; + } + + // protection_status - computed: false, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + healthmonitor_id: cdktf.stringToTerraform(this._healthmonitorId), + id: cdktf.stringToTerraform(this._id), + lb_method: cdktf.stringToTerraform(this._lbMethod), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + healthmonitor_id: { + value: cdktf.stringToHclTerraform(this._healthmonitorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_method: { + value: cdktf.stringToHclTerraform(this._lbMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/README.md new file mode 100644 index 00000000..f343b445 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_elb_security_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_elb_security_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/index.ts new file mode 100644 index 00000000..ecfd2c82 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-elb-security-policies/index.ts @@ -0,0 +1,509 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudElbSecurityPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#cipher DataHuaweicloudElbSecurityPolicies#cipher} + */ + readonly cipher?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#description DataHuaweicloudElbSecurityPolicies#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#id DataHuaweicloudElbSecurityPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#name DataHuaweicloudElbSecurityPolicies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#protocol DataHuaweicloudElbSecurityPolicies#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#region DataHuaweicloudElbSecurityPolicies#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#security_policy_id DataHuaweicloudElbSecurityPolicies#security_policy_id} + */ + readonly securityPolicyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#type DataHuaweicloudElbSecurityPolicies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListeners { +} + +export function dataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersToTerraform(struct?: DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersToHclTerraform(struct?: DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersOutputReference { + return new DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudElbSecurityPoliciesSecurityPolicies { +} + +export function dataHuaweicloudElbSecurityPoliciesSecurityPoliciesToTerraform(struct?: DataHuaweicloudElbSecurityPoliciesSecurityPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudElbSecurityPoliciesSecurityPoliciesToHclTerraform(struct?: DataHuaweicloudElbSecurityPoliciesSecurityPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudElbSecurityPoliciesSecurityPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudElbSecurityPoliciesSecurityPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudElbSecurityPoliciesSecurityPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ciphers - computed: true, optional: false, required: false + public get ciphers() { + return this.getListAttribute('ciphers'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudElbSecurityPoliciesSecurityPoliciesListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocols - computed: true, optional: false, required: false + public get protocols() { + return this.getListAttribute('protocols'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudElbSecurityPoliciesSecurityPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudElbSecurityPoliciesSecurityPoliciesOutputReference { + return new DataHuaweicloudElbSecurityPoliciesSecurityPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies huaweicloud_elb_security_policies} +*/ +export class DataHuaweicloudElbSecurityPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_security_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudElbSecurityPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudElbSecurityPolicies to import + * @param importFromId The id of the existing DataHuaweicloudElbSecurityPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudElbSecurityPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_security_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/elb_security_policies huaweicloud_elb_security_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudElbSecurityPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudElbSecurityPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_security_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cipher = config.cipher; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + this._securityPolicyId = config.securityPolicyId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cipher - computed: false, optional: true, required: false + private _cipher?: string; + public get cipher() { + return this.getStringAttribute('cipher'); + } + public set cipher(value: string) { + this._cipher = value; + } + public resetCipher() { + this._cipher = undefined; + } + // Temporarily expose input value. Use with caution. + public get cipherInput() { + return this._cipher; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_policies - computed: true, optional: false, required: false + private _securityPolicies = new DataHuaweicloudElbSecurityPoliciesSecurityPoliciesList(this, "security_policies", false); + public get securityPolicies() { + return this._securityPolicies; + } + + // security_policy_id - computed: false, optional: true, required: false + private _securityPolicyId?: string; + public get securityPolicyId() { + return this.getStringAttribute('security_policy_id'); + } + public set securityPolicyId(value: string) { + this._securityPolicyId = value; + } + public resetSecurityPolicyId() { + this._securityPolicyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityPolicyIdInput() { + return this._securityPolicyId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cipher: cdktf.stringToTerraform(this._cipher), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + security_policy_id: cdktf.stringToTerraform(this._securityPolicyId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cipher: { + value: cdktf.stringToHclTerraform(this._cipher), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_policy_id: { + value: cdktf.stringToHclTerraform(this._securityPolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/README.md new file mode 100644 index 00000000..1bb455f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_enterprise_project` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_enterprise_project`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/index.ts new file mode 100644 index 00000000..0d37802b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-project/index.ts @@ -0,0 +1,187 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEnterpriseProjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project#id DataHuaweicloudEnterpriseProject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project#name DataHuaweicloudEnterpriseProject#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project#status DataHuaweicloudEnterpriseProject#status} + */ + readonly status?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project huaweicloud_enterprise_project} +*/ +export class DataHuaweicloudEnterpriseProject extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_enterprise_project"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEnterpriseProject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEnterpriseProject to import + * @param importFromId The id of the existing DataHuaweicloudEnterpriseProject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEnterpriseProject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_enterprise_project", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_project huaweicloud_enterprise_project} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEnterpriseProjectConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEnterpriseProjectConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_enterprise_project', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: true, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + status: cdktf.numberToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/README.md new file mode 100644 index 00000000..0623ea1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_enterprise_projects` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_enterprise_projects`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/index.ts new file mode 100644 index 00000000..ecb76c74 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-enterprise-projects/index.ts @@ -0,0 +1,339 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEnterpriseProjectsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects#enterprise_project_id DataHuaweicloudEnterpriseProjects#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects#id DataHuaweicloudEnterpriseProjects#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects#name DataHuaweicloudEnterpriseProjects#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects#status DataHuaweicloudEnterpriseProjects#status} + */ + readonly status?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects#type DataHuaweicloudEnterpriseProjects#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudEnterpriseProjectsEnterpriseProjects { +} + +export function dataHuaweicloudEnterpriseProjectsEnterpriseProjectsToTerraform(struct?: DataHuaweicloudEnterpriseProjectsEnterpriseProjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEnterpriseProjectsEnterpriseProjectsToHclTerraform(struct?: DataHuaweicloudEnterpriseProjectsEnterpriseProjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEnterpriseProjectsEnterpriseProjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEnterpriseProjectsEnterpriseProjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEnterpriseProjectsEnterpriseProjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudEnterpriseProjectsEnterpriseProjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEnterpriseProjectsEnterpriseProjectsOutputReference { + return new DataHuaweicloudEnterpriseProjectsEnterpriseProjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects huaweicloud_enterprise_projects} +*/ +export class DataHuaweicloudEnterpriseProjects extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_enterprise_projects"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEnterpriseProjects resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEnterpriseProjects to import + * @param importFromId The id of the existing DataHuaweicloudEnterpriseProjects that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEnterpriseProjects to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_enterprise_projects", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/enterprise_projects huaweicloud_enterprise_projects} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEnterpriseProjectsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEnterpriseProjectsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_enterprise_projects', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // enterprise_projects - computed: true, optional: false, required: false + private _enterpriseProjects = new DataHuaweicloudEnterpriseProjectsEnterpriseProjectsList(this, "enterprise_projects", false); + public get enterpriseProjects() { + return this._enterpriseProjects; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + status: cdktf.numberToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/README.md new file mode 100644 index 00000000..6a595093 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_associations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_associations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/index.ts new file mode 100644 index 00000000..a056fae5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-associations/index.ts @@ -0,0 +1,399 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErAssociationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#attachment_id DataHuaweicloudErAssociations#attachment_id} + */ + readonly attachmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#attachment_type DataHuaweicloudErAssociations#attachment_type} + */ + readonly attachmentType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#id DataHuaweicloudErAssociations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#instance_id DataHuaweicloudErAssociations#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#region DataHuaweicloudErAssociations#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#route_table_id DataHuaweicloudErAssociations#route_table_id} + */ + readonly routeTableId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#status DataHuaweicloudErAssociations#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudErAssociationsAssociations { +} + +export function dataHuaweicloudErAssociationsAssociationsToTerraform(struct?: DataHuaweicloudErAssociationsAssociations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErAssociationsAssociationsToHclTerraform(struct?: DataHuaweicloudErAssociationsAssociations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErAssociationsAssociationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErAssociationsAssociations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErAssociationsAssociations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // route_policy_id - computed: true, optional: false, required: false + public get routePolicyId() { + return this.getStringAttribute('route_policy_id'); + } + + // route_table_id - computed: true, optional: false, required: false + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudErAssociationsAssociationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErAssociationsAssociationsOutputReference { + return new DataHuaweicloudErAssociationsAssociationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations huaweicloud_er_associations} +*/ +export class DataHuaweicloudErAssociations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_associations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErAssociations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErAssociations to import + * @param importFromId The id of the existing DataHuaweicloudErAssociations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErAssociations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_associations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_associations huaweicloud_er_associations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErAssociationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErAssociationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_associations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._attachmentType = config.attachmentType; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // associations - computed: true, optional: false, required: false + private _associations = new DataHuaweicloudErAssociationsAssociationsList(this, "associations", false); + public get associations() { + return this._associations; + } + + // attachment_id - computed: false, optional: true, required: false + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + public resetAttachmentId() { + this._attachmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // attachment_type - computed: false, optional: true, required: false + private _attachmentType?: string; + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + public set attachmentType(value: string) { + this._attachmentType = value; + } + public resetAttachmentType() { + this._attachmentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentTypeInput() { + return this._attachmentType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: false, required: true + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + attachment_type: cdktf.stringToTerraform(this._attachmentType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attachment_type: { + value: cdktf.stringToHclTerraform(this._attachmentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/README.md new file mode 100644 index 00000000..41485ff8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_attachments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_attachments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/index.ts new file mode 100644 index 00000000..8908ba8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-attachments/index.ts @@ -0,0 +1,485 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErAttachmentsConfig extends cdktf.TerraformMetaArguments { + /** + * The specified attachment ID used to query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#attachment_id DataHuaweicloudErAttachments#attachment_id} + */ + readonly attachmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#id DataHuaweicloudErAttachments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ER instance ID to which the attachment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#instance_id DataHuaweicloudErAttachments#instance_id} + */ + readonly instanceId: string; + /** + * The name used to filter the attachments. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#name DataHuaweicloudErAttachments#name} + */ + readonly name?: string; + /** + * The region where the ER attachments are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#region DataHuaweicloudErAttachments#region} + */ + readonly region?: string; + /** + * The associated resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#resource_id DataHuaweicloudErAttachments#resource_id} + */ + readonly resourceId?: string; + /** + * The status used to filter the attachments. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#status DataHuaweicloudErAttachments#status} + */ + readonly status?: string; + /** + * The key/value pairs used to filter the attachments. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#tags DataHuaweicloudErAttachments#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The resource type to be filtered. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#type DataHuaweicloudErAttachments#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudErAttachmentsAttachments { +} + +export function dataHuaweicloudErAttachmentsAttachmentsToTerraform(struct?: DataHuaweicloudErAttachmentsAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErAttachmentsAttachmentsToHclTerraform(struct?: DataHuaweicloudErAttachmentsAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErAttachmentsAttachmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErAttachmentsAttachments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErAttachmentsAttachments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated - computed: true, optional: false, required: false + public get associated() { + return this.getBooleanAttribute('associated'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // route_table_id - computed: true, optional: false, required: false + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudErAttachmentsAttachmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErAttachmentsAttachmentsOutputReference { + return new DataHuaweicloudErAttachmentsAttachmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments huaweicloud_er_attachments} +*/ +export class DataHuaweicloudErAttachments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_attachments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErAttachments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErAttachments to import + * @param importFromId The id of the existing DataHuaweicloudErAttachments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErAttachments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_attachments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_attachments huaweicloud_er_attachments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErAttachmentsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErAttachmentsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_attachments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._resourceId = config.resourceId; + this._status = config.status; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_id - computed: false, optional: true, required: false + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + public resetAttachmentId() { + this._attachmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // attachments - computed: true, optional: false, required: false + private _attachments = new DataHuaweicloudErAttachmentsAttachmentsList(this, "attachments", false); + public get attachments() { + return this._attachments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/README.md new file mode 100644 index 00000000..b0d8475a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/index.ts new file mode 100644 index 00000000..28b7a23d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-availability-zones/index.ts @@ -0,0 +1,149 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones#id DataHuaweicloudErAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones#region DataHuaweicloudErAvailabilityZones#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones huaweicloud_er_availability_zones} +*/ +export class DataHuaweicloudErAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudErAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_availability_zones huaweicloud_er_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // names - computed: true, optional: false, required: false + public get names() { + return this.getListAttribute('names'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/README.md new file mode 100644 index 00000000..2b1a82ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_available_routes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_available_routes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/index.ts new file mode 100644 index 00000000..8bd59d20 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-available-routes/index.ts @@ -0,0 +1,420 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErAvailableRoutesConfig extends cdktf.TerraformMetaArguments { + /** + * The destination address of the routes to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes#destination DataHuaweicloudErAvailableRoutes#destination} + */ + readonly destination?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes#id DataHuaweicloudErAvailableRoutes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to query the available routes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes#region DataHuaweicloudErAvailableRoutes#region} + */ + readonly region?: string; + /** + * The attachment type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes#resource_type DataHuaweicloudErAvailableRoutes#resource_type} + */ + readonly resourceType?: string; + /** + * The route table ID to which the available routes belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes#route_table_id DataHuaweicloudErAvailableRoutes#route_table_id} + */ + readonly routeTableId: string; +} +export interface DataHuaweicloudErAvailableRoutesRoutesNextHops { +} + +export function dataHuaweicloudErAvailableRoutesRoutesNextHopsToTerraform(struct?: DataHuaweicloudErAvailableRoutesRoutesNextHops): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErAvailableRoutesRoutesNextHopsToHclTerraform(struct?: DataHuaweicloudErAvailableRoutesRoutesNextHops): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErAvailableRoutesRoutesNextHopsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErAvailableRoutesRoutesNextHops | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErAvailableRoutesRoutesNextHops | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } +} + +export class DataHuaweicloudErAvailableRoutesRoutesNextHopsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErAvailableRoutesRoutesNextHopsOutputReference { + return new DataHuaweicloudErAvailableRoutesRoutesNextHopsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudErAvailableRoutesRoutes { +} + +export function dataHuaweicloudErAvailableRoutesRoutesToTerraform(struct?: DataHuaweicloudErAvailableRoutesRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErAvailableRoutesRoutesToHclTerraform(struct?: DataHuaweicloudErAvailableRoutesRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErAvailableRoutesRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErAvailableRoutesRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErAvailableRoutesRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_blackhole - computed: true, optional: false, required: false + public get isBlackhole() { + return this.getBooleanAttribute('is_blackhole'); + } + + // next_hops - computed: true, optional: false, required: false + private _nextHops = new DataHuaweicloudErAvailableRoutesRoutesNextHopsList(this, "next_hops", false); + public get nextHops() { + return this._nextHops; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudErAvailableRoutesRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErAvailableRoutesRoutesOutputReference { + return new DataHuaweicloudErAvailableRoutesRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes huaweicloud_er_available_routes} +*/ +export class DataHuaweicloudErAvailableRoutes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_available_routes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErAvailableRoutes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErAvailableRoutes to import + * @param importFromId The id of the existing DataHuaweicloudErAvailableRoutes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErAvailableRoutes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_available_routes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_available_routes huaweicloud_er_available_routes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErAvailableRoutesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErAvailableRoutesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_available_routes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destination = config.destination; + this._id = config.id; + this._region = config.region; + this._resourceType = config.resourceType; + this._routeTableId = config.routeTableId; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination - computed: false, optional: true, required: false + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // route_table_id - computed: false, optional: false, required: true + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // routes - computed: true, optional: false, required: false + private _routes = new DataHuaweicloudErAvailableRoutesRoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_type: cdktf.stringToTerraform(this._resourceType), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/README.md new file mode 100644 index 00000000..1fe5f368 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_flow_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_flow_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/index.ts new file mode 100644 index 00000000..ef73ca3d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-flow-logs/index.ts @@ -0,0 +1,549 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErFlowLogsConfig extends cdktf.TerraformMetaArguments { + /** + * The switch status of the flow log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#enabled DataHuaweicloudErFlowLogs#enabled} + */ + readonly enabled?: string; + /** + * The ID of the flow log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#flow_log_id DataHuaweicloudErFlowLogs#flow_log_id} + */ + readonly flowLogId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#id DataHuaweicloudErFlowLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the ER instance to which the flow logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#instance_id DataHuaweicloudErFlowLogs#instance_id} + */ + readonly instanceId: string; + /** + * The ID of the log group to which the flow logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#log_group_id DataHuaweicloudErFlowLogs#log_group_id} + */ + readonly logGroupId?: string; + /** + * The ID of the log stream to which the flow logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#log_stream_id DataHuaweicloudErFlowLogs#log_stream_id} + */ + readonly logStreamId?: string; + /** + * The name of the flow log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#name DataHuaweicloudErFlowLogs#name} + */ + readonly name?: string; + /** + * The region where the flow logs are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#region DataHuaweicloudErFlowLogs#region} + */ + readonly region?: string; + /** + * The ID of the attachment to which the flow logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#resource_id DataHuaweicloudErFlowLogs#resource_id} + */ + readonly resourceId?: string; + /** + * The type of the flow logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#resource_type DataHuaweicloudErFlowLogs#resource_type} + */ + readonly resourceType?: string; + /** + * The status of the flow logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#status DataHuaweicloudErFlowLogs#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudErFlowLogsFlowLogs { +} + +export function dataHuaweicloudErFlowLogsFlowLogsToTerraform(struct?: DataHuaweicloudErFlowLogsFlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErFlowLogsFlowLogsToHclTerraform(struct?: DataHuaweicloudErFlowLogsFlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErFlowLogsFlowLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErFlowLogsFlowLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErFlowLogsFlowLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_store_type - computed: true, optional: false, required: false + public get logStoreType() { + return this.getStringAttribute('log_store_type'); + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudErFlowLogsFlowLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErFlowLogsFlowLogsOutputReference { + return new DataHuaweicloudErFlowLogsFlowLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs huaweicloud_er_flow_logs} +*/ +export class DataHuaweicloudErFlowLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_flow_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErFlowLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErFlowLogs to import + * @param importFromId The id of the existing DataHuaweicloudErFlowLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErFlowLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_flow_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_flow_logs huaweicloud_er_flow_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErFlowLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErFlowLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_flow_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._flowLogId = config.flowLogId; + this._id = config.id; + this._instanceId = config.instanceId; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // flow_log_id - computed: false, optional: true, required: false + private _flowLogId?: string; + public get flowLogId() { + return this.getStringAttribute('flow_log_id'); + } + public set flowLogId(value: string) { + this._flowLogId = value; + } + public resetFlowLogId() { + this._flowLogId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flowLogIdInput() { + return this._flowLogId; + } + + // flow_logs - computed: true, optional: false, required: false + private _flowLogs = new DataHuaweicloudErFlowLogsFlowLogsList(this, "flow_logs", false); + public get flowLogs() { + return this._flowLogs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // log_group_id - computed: false, optional: true, required: false + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + public resetLogGroupId() { + this._logGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: true, required: false + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + public resetLogStreamId() { + this._logStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.stringToTerraform(this._enabled), + flow_log_id: cdktf.stringToTerraform(this._flowLogId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flow_log_id: { + value: cdktf.stringToHclTerraform(this._flowLogId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/README.md new file mode 100644 index 00000000..f9646749 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/index.ts new file mode 100644 index 00000000..5366dc78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-instances/index.ts @@ -0,0 +1,478 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * The enterprise project ID of the instances to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#enterprise_project_id DataHuaweicloudErInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#id DataHuaweicloudErInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID used to query specified instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#instance_id DataHuaweicloudErInstances#instance_id} + */ + readonly instanceId?: string; + /** + * The name used to filter the instances. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#name DataHuaweicloudErInstances#name} + */ + readonly name?: string; + /** + * Whether resources belong to the current renant. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#owned_by_self DataHuaweicloudErInstances#owned_by_self} + */ + readonly ownedBySelf?: boolean | cdktf.IResolvable; + /** + * The region where the ER instances are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#region DataHuaweicloudErInstances#region} + */ + readonly region?: string; + /** + * The status used to filter the instances. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#status DataHuaweicloudErInstances#status} + */ + readonly status?: string; + /** + * The key/value pairs used to filter the instances. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#tags DataHuaweicloudErInstances#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudErInstancesInstances { +} + +export function dataHuaweicloudErInstancesInstancesToTerraform(struct?: DataHuaweicloudErInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErInstancesInstancesToHclTerraform(struct?: DataHuaweicloudErInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // asn - computed: true, optional: false, required: false + public get asn() { + return this.getNumberAttribute('asn'); + } + + // auto_accept_shared_attachments - computed: true, optional: false, required: false + public get autoAcceptSharedAttachments() { + return this.getBooleanAttribute('auto_accept_shared_attachments'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_association_route_table_id - computed: true, optional: false, required: false + public get defaultAssociationRouteTableId() { + return this.getStringAttribute('default_association_route_table_id'); + } + + // default_propagation_route_table_id - computed: true, optional: false, required: false + public get defaultPropagationRouteTableId() { + return this.getStringAttribute('default_propagation_route_table_id'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enable_default_association - computed: true, optional: false, required: false + public get enableDefaultAssociation() { + return this.getBooleanAttribute('enable_default_association'); + } + + // enable_default_propagation - computed: true, optional: false, required: false + public get enableDefaultPropagation() { + return this.getBooleanAttribute('enable_default_propagation'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudErInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErInstancesInstancesOutputReference { + return new DataHuaweicloudErInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances huaweicloud_er_instances} +*/ +export class DataHuaweicloudErInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErInstances to import + * @param importFromId The id of the existing DataHuaweicloudErInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_instances huaweicloud_er_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._ownedBySelf = config.ownedBySelf; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudErInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owned_by_self - computed: false, optional: true, required: false + private _ownedBySelf?: boolean | cdktf.IResolvable; + public get ownedBySelf() { + return this.getBooleanAttribute('owned_by_self'); + } + public set ownedBySelf(value: boolean | cdktf.IResolvable) { + this._ownedBySelf = value; + } + public resetOwnedBySelf() { + this._ownedBySelf = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownedBySelfInput() { + return this._ownedBySelf; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + owned_by_self: cdktf.booleanToTerraform(this._ownedBySelf), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owned_by_self: { + value: cdktf.booleanToHclTerraform(this._ownedBySelf), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/README.md new file mode 100644 index 00000000..6719da53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_propagations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_propagations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/index.ts new file mode 100644 index 00000000..85b8e547 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-propagations/index.ts @@ -0,0 +1,404 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErPropagationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#attachment_id DataHuaweicloudErPropagations#attachment_id} + */ + readonly attachmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#attachment_type DataHuaweicloudErPropagations#attachment_type} + */ + readonly attachmentType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#id DataHuaweicloudErPropagations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#instance_id DataHuaweicloudErPropagations#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#region DataHuaweicloudErPropagations#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#route_table_id DataHuaweicloudErPropagations#route_table_id} + */ + readonly routeTableId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#status DataHuaweicloudErPropagations#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudErPropagationsPropagations { +} + +export function dataHuaweicloudErPropagationsPropagationsToTerraform(struct?: DataHuaweicloudErPropagationsPropagations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErPropagationsPropagationsToHclTerraform(struct?: DataHuaweicloudErPropagationsPropagations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErPropagationsPropagationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErPropagationsPropagations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErPropagationsPropagations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // route_policy_id - computed: true, optional: false, required: false + public get routePolicyId() { + return this.getStringAttribute('route_policy_id'); + } + + // route_table_id - computed: true, optional: false, required: false + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudErPropagationsPropagationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErPropagationsPropagationsOutputReference { + return new DataHuaweicloudErPropagationsPropagationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations huaweicloud_er_propagations} +*/ +export class DataHuaweicloudErPropagations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_propagations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErPropagations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErPropagations to import + * @param importFromId The id of the existing DataHuaweicloudErPropagations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErPropagations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_propagations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_propagations huaweicloud_er_propagations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErPropagationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErPropagationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_propagations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._attachmentType = config.attachmentType; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_id - computed: false, optional: true, required: false + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + public resetAttachmentId() { + this._attachmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // attachment_type - computed: false, optional: true, required: false + private _attachmentType?: string; + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + public set attachmentType(value: string) { + this._attachmentType = value; + } + public resetAttachmentType() { + this._attachmentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentTypeInput() { + return this._attachmentType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // propagations - computed: true, optional: false, required: false + private _propagations = new DataHuaweicloudErPropagationsPropagationsList(this, "propagations", false); + public get propagations() { + return this._propagations; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: false, required: true + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + attachment_type: cdktf.stringToTerraform(this._attachmentType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attachment_type: { + value: cdktf.stringToHclTerraform(this._attachmentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/README.md new file mode 100644 index 00000000..b1bd5c20 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/index.ts new file mode 100644 index 00000000..a9a7b4ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-quotas/index.ts @@ -0,0 +1,332 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas#id DataHuaweicloudErQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas#instance_id DataHuaweicloudErQuotas#instance_id} + */ + readonly instanceId?: string; + /** + * The region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas#region DataHuaweicloudErQuotas#region} + */ + readonly region?: string; + /** + * The route table ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas#route_table_id DataHuaweicloudErQuotas#route_table_id} + */ + readonly routeTableId?: string; + /** + * The quota type to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas#type DataHuaweicloudErQuotas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudErQuotasQuotas { +} + +export function dataHuaweicloudErQuotasQuotasToTerraform(struct?: DataHuaweicloudErQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErQuotasQuotasToHclTerraform(struct?: DataHuaweicloudErQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // limit - computed: true, optional: false, required: false + public get limit() { + return this.getNumberAttribute('limit'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudErQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErQuotasQuotasOutputReference { + return new DataHuaweicloudErQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas huaweicloud_er_quotas} +*/ +export class DataHuaweicloudErQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErQuotas to import + * @param importFromId The id of the existing DataHuaweicloudErQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_quotas huaweicloud_er_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudErQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: true, required: false + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + public resetRouteTableId() { + this._routeTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/README.md new file mode 100644 index 00000000..df44afc5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_er_route_tables` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_er_route_tables`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/index.ts new file mode 100644 index 00000000..a32aee43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-er-route-tables/index.ts @@ -0,0 +1,752 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudErRouteTablesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#id DataHuaweicloudErRouteTables#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the ER instance to which the route table belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#instance_id DataHuaweicloudErRouteTables#instance_id} + */ + readonly instanceId: string; + /** + * The name used to filter the route tables. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#name DataHuaweicloudErRouteTables#name} + */ + readonly name?: string; + /** + * The region where the ER instance and route table are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#region DataHuaweicloudErRouteTables#region} + */ + readonly region?: string; + /** + * The route table ID used to query specified route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#route_table_id DataHuaweicloudErRouteTables#route_table_id} + */ + readonly routeTableId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#tags DataHuaweicloudErRouteTables#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudErRouteTablesRouteTablesAssociations { +} + +export function dataHuaweicloudErRouteTablesRouteTablesAssociationsToTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesAssociations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErRouteTablesRouteTablesAssociationsToHclTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesAssociations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErRouteTablesRouteTablesAssociationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErRouteTablesRouteTablesAssociations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErRouteTablesRouteTablesAssociations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudErRouteTablesRouteTablesAssociationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErRouteTablesRouteTablesAssociationsOutputReference { + return new DataHuaweicloudErRouteTablesRouteTablesAssociationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudErRouteTablesRouteTablesPropagations { +} + +export function dataHuaweicloudErRouteTablesRouteTablesPropagationsToTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesPropagations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErRouteTablesRouteTablesPropagationsToHclTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesPropagations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErRouteTablesRouteTablesPropagationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErRouteTablesRouteTablesPropagations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErRouteTablesRouteTablesPropagations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudErRouteTablesRouteTablesPropagationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErRouteTablesRouteTablesPropagationsOutputReference { + return new DataHuaweicloudErRouteTablesRouteTablesPropagationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudErRouteTablesRouteTablesRoutesAttachments { +} + +export function dataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsToTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesRoutesAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsToHclTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesRoutesAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErRouteTablesRouteTablesRoutesAttachments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErRouteTablesRouteTablesRoutesAttachments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachment_id - computed: true, optional: false, required: false + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } +} + +export class DataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsOutputReference { + return new DataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudErRouteTablesRouteTablesRoutes { +} + +export function dataHuaweicloudErRouteTablesRouteTablesRoutesToTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErRouteTablesRouteTablesRoutesToHclTerraform(struct?: DataHuaweicloudErRouteTablesRouteTablesRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErRouteTablesRouteTablesRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErRouteTablesRouteTablesRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErRouteTablesRouteTablesRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachments - computed: true, optional: false, required: false + private _attachments = new DataHuaweicloudErRouteTablesRouteTablesRoutesAttachmentsList(this, "attachments", false); + public get attachments() { + return this._attachments; + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_blackhole - computed: true, optional: false, required: false + public get isBlackhole() { + return this.getBooleanAttribute('is_blackhole'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudErRouteTablesRouteTablesRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErRouteTablesRouteTablesRoutesOutputReference { + return new DataHuaweicloudErRouteTablesRouteTablesRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudErRouteTablesRouteTables { +} + +export function dataHuaweicloudErRouteTablesRouteTablesToTerraform(struct?: DataHuaweicloudErRouteTablesRouteTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudErRouteTablesRouteTablesToHclTerraform(struct?: DataHuaweicloudErRouteTablesRouteTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudErRouteTablesRouteTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudErRouteTablesRouteTables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudErRouteTablesRouteTables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associations - computed: true, optional: false, required: false + private _associations = new DataHuaweicloudErRouteTablesRouteTablesAssociationsList(this, "associations", false); + public get associations() { + return this._associations; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_default_association - computed: true, optional: false, required: false + public get isDefaultAssociation() { + return this.getBooleanAttribute('is_default_association'); + } + + // is_default_propagation - computed: true, optional: false, required: false + public get isDefaultPropagation() { + return this.getBooleanAttribute('is_default_propagation'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // propagations - computed: true, optional: false, required: false + private _propagations = new DataHuaweicloudErRouteTablesRouteTablesPropagationsList(this, "propagations", false); + public get propagations() { + return this._propagations; + } + + // routes - computed: true, optional: false, required: false + private _routes = new DataHuaweicloudErRouteTablesRouteTablesRoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudErRouteTablesRouteTablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudErRouteTablesRouteTablesOutputReference { + return new DataHuaweicloudErRouteTablesRouteTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables huaweicloud_er_route_tables} +*/ +export class DataHuaweicloudErRouteTables extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_route_tables"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudErRouteTables resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudErRouteTables to import + * @param importFromId The id of the existing DataHuaweicloudErRouteTables that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudErRouteTables to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_route_tables", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/er_route_tables huaweicloud_er_route_tables} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudErRouteTablesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudErRouteTablesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_route_tables', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: true, required: false + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + public resetRouteTableId() { + this._routeTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // route_tables - computed: true, optional: false, required: false + private _routeTables = new DataHuaweicloudErRouteTablesRouteTablesList(this, "route_tables", false); + public get routeTables() { + return this._routeTables; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/README.md new file mode 100644 index 00000000..284b9176 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_evs_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_evs_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/index.ts new file mode 100644 index 00000000..90a1cb8d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-availability-zones/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEvsAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones#id DataHuaweicloudEvsAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones#region DataHuaweicloudEvsAvailabilityZones#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudEvsAvailabilityZonesAvailabilityZones { +} + +export function dataHuaweicloudEvsAvailabilityZonesAvailabilityZonesToTerraform(struct?: DataHuaweicloudEvsAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsAvailabilityZonesAvailabilityZonesToHclTerraform(struct?: DataHuaweicloudEvsAvailabilityZonesAvailabilityZones): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsAvailabilityZonesAvailabilityZonesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsAvailabilityZonesAvailabilityZones | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsAvailabilityZonesAvailabilityZones | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // is_available - computed: true, optional: false, required: false + public get isAvailable() { + return this.getBooleanAttribute('is_available'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudEvsAvailabilityZonesAvailabilityZonesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsAvailabilityZonesAvailabilityZonesOutputReference { + return new DataHuaweicloudEvsAvailabilityZonesAvailabilityZonesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones huaweicloud_evs_availability_zones} +*/ +export class DataHuaweicloudEvsAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEvsAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEvsAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudEvsAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEvsAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_availability_zones huaweicloud_evs_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEvsAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEvsAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: false, required: false + private _availabilityZones = new DataHuaweicloudEvsAvailabilityZonesAvailabilityZonesList(this, "availability_zones", false); + public get availabilityZones() { + return this._availabilityZones; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/README.md new file mode 100644 index 00000000..0752c95e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_evs_snapshots` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_evs_snapshots`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/index.ts new file mode 100644 index 00000000..54761dd7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-snapshots/index.ts @@ -0,0 +1,523 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEvsSnapshotsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#availability_zone DataHuaweicloudEvsSnapshots#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#dedicated_storage_id DataHuaweicloudEvsSnapshots#dedicated_storage_id} + */ + readonly dedicatedStorageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#dedicated_storage_name DataHuaweicloudEvsSnapshots#dedicated_storage_name} + */ + readonly dedicatedStorageName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#enterprise_project_id DataHuaweicloudEvsSnapshots#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#id DataHuaweicloudEvsSnapshots#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#name DataHuaweicloudEvsSnapshots#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#region DataHuaweicloudEvsSnapshots#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#service_type DataHuaweicloudEvsSnapshots#service_type} + */ + readonly serviceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#snapshot_id DataHuaweicloudEvsSnapshots#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#status DataHuaweicloudEvsSnapshots#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#volume_id DataHuaweicloudEvsSnapshots#volume_id} + */ + readonly volumeId?: string; +} +export interface DataHuaweicloudEvsSnapshotsSnapshots { +} + +export function dataHuaweicloudEvsSnapshotsSnapshotsToTerraform(struct?: DataHuaweicloudEvsSnapshotsSnapshots): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsSnapshotsSnapshotsToHclTerraform(struct?: DataHuaweicloudEvsSnapshotsSnapshots): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsSnapshotsSnapshotsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsSnapshotsSnapshots | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsSnapshotsSnapshots | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudEvsSnapshotsSnapshotsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsSnapshotsSnapshotsOutputReference { + return new DataHuaweicloudEvsSnapshotsSnapshotsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots huaweicloud_evs_snapshots} +*/ +export class DataHuaweicloudEvsSnapshots extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_snapshots"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEvsSnapshots resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEvsSnapshots to import + * @param importFromId The id of the existing DataHuaweicloudEvsSnapshots that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEvsSnapshots to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_snapshots", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_snapshots huaweicloud_evs_snapshots} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEvsSnapshotsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEvsSnapshotsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_snapshots', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._dedicatedStorageId = config.dedicatedStorageId; + this._dedicatedStorageName = config.dedicatedStorageName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._serviceType = config.serviceType; + this._snapshotId = config.snapshotId; + this._status = config.status; + this._volumeId = config.volumeId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // dedicated_storage_id - computed: false, optional: true, required: false + private _dedicatedStorageId?: string; + public get dedicatedStorageId() { + return this.getStringAttribute('dedicated_storage_id'); + } + public set dedicatedStorageId(value: string) { + this._dedicatedStorageId = value; + } + public resetDedicatedStorageId() { + this._dedicatedStorageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedStorageIdInput() { + return this._dedicatedStorageId; + } + + // dedicated_storage_name - computed: false, optional: true, required: false + private _dedicatedStorageName?: string; + public get dedicatedStorageName() { + return this.getStringAttribute('dedicated_storage_name'); + } + public set dedicatedStorageName(value: string) { + this._dedicatedStorageName = value; + } + public resetDedicatedStorageName() { + this._dedicatedStorageName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedStorageNameInput() { + return this._dedicatedStorageName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_type - computed: false, optional: true, required: false + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // snapshot_id - computed: false, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // snapshots - computed: true, optional: false, required: false + private _snapshots = new DataHuaweicloudEvsSnapshotsSnapshotsList(this, "snapshots", false); + public get snapshots() { + return this._snapshots; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // volume_id - computed: false, optional: true, required: false + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + public resetVolumeId() { + this._volumeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + dedicated_storage_id: cdktf.stringToTerraform(this._dedicatedStorageId), + dedicated_storage_name: cdktf.stringToTerraform(this._dedicatedStorageName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + service_type: cdktf.stringToTerraform(this._serviceType), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + status: cdktf.stringToTerraform(this._status), + volume_id: cdktf.stringToTerraform(this._volumeId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_storage_id: { + value: cdktf.stringToHclTerraform(this._dedicatedStorageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_storage_name: { + value: cdktf.stringToHclTerraform(this._dedicatedStorageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/README.md new file mode 100644 index 00000000..55890614 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_evs_volume_transfers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_evs_volume_transfers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/index.ts new file mode 100644 index 00000000..e1479af5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-transfers/index.ts @@ -0,0 +1,237 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEvsVolumeTransfersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers#id DataHuaweicloudEvsVolumeTransfers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers#region DataHuaweicloudEvsVolumeTransfers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudEvsVolumeTransfersTransfers { +} + +export function dataHuaweicloudEvsVolumeTransfersTransfersToTerraform(struct?: DataHuaweicloudEvsVolumeTransfersTransfers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsVolumeTransfersTransfersToHclTerraform(struct?: DataHuaweicloudEvsVolumeTransfersTransfers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsVolumeTransfersTransfersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsVolumeTransfersTransfers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsVolumeTransfersTransfers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudEvsVolumeTransfersTransfersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsVolumeTransfersTransfersOutputReference { + return new DataHuaweicloudEvsVolumeTransfersTransfersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers huaweicloud_evs_volume_transfers} +*/ +export class DataHuaweicloudEvsVolumeTransfers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_volume_transfers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEvsVolumeTransfers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEvsVolumeTransfers to import + * @param importFromId The id of the existing DataHuaweicloudEvsVolumeTransfers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEvsVolumeTransfers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_volume_transfers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_transfers huaweicloud_evs_volume_transfers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEvsVolumeTransfersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEvsVolumeTransfersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_volume_transfers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // transfers - computed: true, optional: false, required: false + private _transfers = new DataHuaweicloudEvsVolumeTransfersTransfersList(this, "transfers", false); + public get transfers() { + return this._transfers; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/README.md new file mode 100644 index 00000000..5e04426d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_evs_volume_types` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_evs_volume_types`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/index.ts new file mode 100644 index 00000000..2c1e8aa7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volume-types/index.ts @@ -0,0 +1,323 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEvsVolumeTypesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types#id DataHuaweicloudEvsVolumeTypes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types#region DataHuaweicloudEvsVolumeTypes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudEvsVolumeTypesTypesExtraSpecs { +} + +export function dataHuaweicloudEvsVolumeTypesTypesExtraSpecsToTerraform(struct?: DataHuaweicloudEvsVolumeTypesTypesExtraSpecs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsVolumeTypesTypesExtraSpecsToHclTerraform(struct?: DataHuaweicloudEvsVolumeTypesTypesExtraSpecs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsVolumeTypesTypesExtraSpecsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsVolumeTypesTypesExtraSpecs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsVolumeTypesTypesExtraSpecs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // available_availability_zones - computed: true, optional: false, required: false + public get availableAvailabilityZones() { + return this.getStringAttribute('available_availability_zones'); + } + + // sold_out_availability_zones - computed: true, optional: false, required: false + public get soldOutAvailabilityZones() { + return this.getStringAttribute('sold_out_availability_zones'); + } +} + +export class DataHuaweicloudEvsVolumeTypesTypesExtraSpecsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsVolumeTypesTypesExtraSpecsOutputReference { + return new DataHuaweicloudEvsVolumeTypesTypesExtraSpecsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudEvsVolumeTypesTypes { +} + +export function dataHuaweicloudEvsVolumeTypesTypesToTerraform(struct?: DataHuaweicloudEvsVolumeTypesTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsVolumeTypesTypesToHclTerraform(struct?: DataHuaweicloudEvsVolumeTypesTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsVolumeTypesTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsVolumeTypesTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsVolumeTypesTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // extra_specs - computed: true, optional: false, required: false + private _extraSpecs = new DataHuaweicloudEvsVolumeTypesTypesExtraSpecsList(this, "extra_specs", false); + public get extraSpecs() { + return this._extraSpecs; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudEvsVolumeTypesTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsVolumeTypesTypesOutputReference { + return new DataHuaweicloudEvsVolumeTypesTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types huaweicloud_evs_volume_types} +*/ +export class DataHuaweicloudEvsVolumeTypes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_volume_types"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEvsVolumeTypes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEvsVolumeTypes to import + * @param importFromId The id of the existing DataHuaweicloudEvsVolumeTypes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEvsVolumeTypes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_volume_types", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volume_types huaweicloud_evs_volume_types} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEvsVolumeTypesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEvsVolumeTypesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_volume_types', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // types - computed: true, optional: false, required: false + private _types = new DataHuaweicloudEvsVolumeTypesTypesList(this, "types", false); + public get types() { + return this._types; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/README.md new file mode 100644 index 00000000..bf82bb8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_evs_volumes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_evs_volumes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/index.ts new file mode 100644 index 00000000..f8f500e4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-evs-volumes/index.ts @@ -0,0 +1,659 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudEvsVolumesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#availability_zone DataHuaweicloudEvsVolumes#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#enterprise_project_id DataHuaweicloudEvsVolumes#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#id DataHuaweicloudEvsVolumes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#name DataHuaweicloudEvsVolumes#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#region DataHuaweicloudEvsVolumes#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#server_id DataHuaweicloudEvsVolumes#server_id} + */ + readonly serverId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#shareable DataHuaweicloudEvsVolumes#shareable} + */ + readonly shareable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#status DataHuaweicloudEvsVolumes#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#tags DataHuaweicloudEvsVolumes#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#volume_id DataHuaweicloudEvsVolumes#volume_id} + */ + readonly volumeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#volume_type_id DataHuaweicloudEvsVolumes#volume_type_id} + */ + readonly volumeTypeId?: string; +} +export interface DataHuaweicloudEvsVolumesVolumesAttachments { +} + +export function dataHuaweicloudEvsVolumesVolumesAttachmentsToTerraform(struct?: DataHuaweicloudEvsVolumesVolumesAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsVolumesVolumesAttachmentsToHclTerraform(struct?: DataHuaweicloudEvsVolumesVolumesAttachments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsVolumesVolumesAttachmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsVolumesVolumesAttachments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsVolumesVolumesAttachments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attached_at - computed: true, optional: false, required: false + public get attachedAt() { + return this.getStringAttribute('attached_at'); + } + + // attached_mode - computed: true, optional: false, required: false + public get attachedMode() { + return this.getStringAttribute('attached_mode'); + } + + // device_name - computed: true, optional: false, required: false + public get deviceName() { + return this.getStringAttribute('device_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } +} + +export class DataHuaweicloudEvsVolumesVolumesAttachmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsVolumesVolumesAttachmentsOutputReference { + return new DataHuaweicloudEvsVolumesVolumesAttachmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudEvsVolumesVolumes { +} + +export function dataHuaweicloudEvsVolumesVolumesToTerraform(struct?: DataHuaweicloudEvsVolumesVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudEvsVolumesVolumesToHclTerraform(struct?: DataHuaweicloudEvsVolumesVolumes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudEvsVolumesVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudEvsVolumesVolumes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudEvsVolumesVolumes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attachments - computed: true, optional: false, required: false + private _attachments = new DataHuaweicloudEvsVolumesVolumesAttachmentsList(this, "attachments", false); + public get attachments() { + return this._attachments; + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // bootable - computed: true, optional: false, required: false + public get bootable() { + return this.getBooleanAttribute('bootable'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // iops - computed: true, optional: false, required: false + public get iops() { + return this.getNumberAttribute('iops'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // shareable - computed: true, optional: false, required: false + public get shareable() { + return this.getBooleanAttribute('shareable'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // throughput - computed: true, optional: false, required: false + public get throughput() { + return this.getNumberAttribute('throughput'); + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } + + // volume_type - computed: true, optional: false, required: false + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + + // wwn - computed: true, optional: false, required: false + public get wwn() { + return this.getStringAttribute('wwn'); + } +} + +export class DataHuaweicloudEvsVolumesVolumesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudEvsVolumesVolumesOutputReference { + return new DataHuaweicloudEvsVolumesVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes huaweicloud_evs_volumes} +*/ +export class DataHuaweicloudEvsVolumes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_volumes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudEvsVolumes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudEvsVolumes to import + * @param importFromId The id of the existing DataHuaweicloudEvsVolumes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudEvsVolumes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_volumes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/evs_volumes huaweicloud_evs_volumes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudEvsVolumesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudEvsVolumesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_volumes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._serverId = config.serverId; + this._shareable = config.shareable; + this._status = config.status; + this._tags = config.tags; + this._volumeId = config.volumeId; + this._volumeTypeId = config.volumeTypeId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // shareable - computed: false, optional: true, required: false + private _shareable?: boolean | cdktf.IResolvable; + public get shareable() { + return this.getBooleanAttribute('shareable'); + } + public set shareable(value: boolean | cdktf.IResolvable) { + this._shareable = value; + } + public resetShareable() { + this._shareable = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareableInput() { + return this._shareable; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // volume_id - computed: false, optional: true, required: false + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + public resetVolumeId() { + this._volumeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // volume_type_id - computed: false, optional: true, required: false + private _volumeTypeId?: string; + public get volumeTypeId() { + return this.getStringAttribute('volume_type_id'); + } + public set volumeTypeId(value: string) { + this._volumeTypeId = value; + } + public resetVolumeTypeId() { + this._volumeTypeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeIdInput() { + return this._volumeTypeId; + } + + // volumes - computed: true, optional: false, required: false + private _volumes = new DataHuaweicloudEvsVolumesVolumesList(this, "volumes", false); + public get volumes() { + return this._volumes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + shareable: cdktf.booleanToTerraform(this._shareable), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_id: cdktf.stringToTerraform(this._volumeId), + volume_type_id: cdktf.stringToTerraform(this._volumeTypeId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shareable: { + value: cdktf.booleanToHclTerraform(this._shareable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_type_id: { + value: cdktf.stringToHclTerraform(this._volumeTypeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/README.md new file mode 100644 index 00000000..c00eb172 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_application_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_application_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/index.ts new file mode 100644 index 00000000..31a3a2b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-application-templates/index.ts @@ -0,0 +1,306 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsApplicationTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates#category DataHuaweicloudFgsApplicationTemplates#category} + */ + readonly category?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates#id DataHuaweicloudFgsApplicationTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates#region DataHuaweicloudFgsApplicationTemplates#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates#runtime DataHuaweicloudFgsApplicationTemplates#runtime} + */ + readonly runtime?: string; +} +export interface DataHuaweicloudFgsApplicationTemplatesTemplates { +} + +export function dataHuaweicloudFgsApplicationTemplatesTemplatesToTerraform(struct?: DataHuaweicloudFgsApplicationTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsApplicationTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudFgsApplicationTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsApplicationTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsApplicationTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsApplicationTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // runtime - computed: true, optional: false, required: false + public get runtime() { + return this.getStringAttribute('runtime'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudFgsApplicationTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsApplicationTemplatesTemplatesOutputReference { + return new DataHuaweicloudFgsApplicationTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates huaweicloud_fgs_application_templates} +*/ +export class DataHuaweicloudFgsApplicationTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_application_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsApplicationTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsApplicationTemplates to import + * @param importFromId The id of the existing DataHuaweicloudFgsApplicationTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsApplicationTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_application_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_application_templates huaweicloud_fgs_application_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsApplicationTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsApplicationTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_application_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._id = config.id; + this._region = config.region; + this._runtime = config.runtime; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudFgsApplicationTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/README.md new file mode 100644 index 00000000..affc839c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_applications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_applications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/index.ts new file mode 100644 index 00000000..2e9539ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-applications/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsApplicationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#application_id DataHuaweicloudFgsApplications#application_id} + */ + readonly applicationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#description DataHuaweicloudFgsApplications#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#id DataHuaweicloudFgsApplications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#name DataHuaweicloudFgsApplications#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#region DataHuaweicloudFgsApplications#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#status DataHuaweicloudFgsApplications#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudFgsApplicationsApplications { +} + +export function dataHuaweicloudFgsApplicationsApplicationsToTerraform(struct?: DataHuaweicloudFgsApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsApplicationsApplicationsToHclTerraform(struct?: DataHuaweicloudFgsApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsApplicationsApplicationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsApplicationsApplications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsApplicationsApplications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudFgsApplicationsApplicationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsApplicationsApplicationsOutputReference { + return new DataHuaweicloudFgsApplicationsApplicationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications huaweicloud_fgs_applications} +*/ +export class DataHuaweicloudFgsApplications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_applications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsApplications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsApplications to import + * @param importFromId The id of the existing DataHuaweicloudFgsApplications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsApplications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_applications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_applications huaweicloud_fgs_applications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsApplicationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsApplicationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_applications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: true, required: false + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + public resetApplicationId() { + this._applicationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // applications - computed: true, optional: false, required: false + private _applications = new DataHuaweicloudFgsApplicationsApplicationsList(this, "applications", false); + public get applications() { + return this._applications; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/README.md new file mode 100644 index 00000000..a188dad4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_dependencies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_dependencies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/index.ts new file mode 100644 index 00000000..6dc82399 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependencies/index.ts @@ -0,0 +1,430 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsDependenciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies#id DataHuaweicloudFgsDependencies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies#name DataHuaweicloudFgsDependencies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies#region DataHuaweicloudFgsDependencies#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies#runtime DataHuaweicloudFgsDependencies#runtime} + */ + readonly runtime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies#type DataHuaweicloudFgsDependencies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudFgsDependenciesPackagesVersions { +} + +export function dataHuaweicloudFgsDependenciesPackagesVersionsToTerraform(struct?: DataHuaweicloudFgsDependenciesPackagesVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsDependenciesPackagesVersionsToHclTerraform(struct?: DataHuaweicloudFgsDependenciesPackagesVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsDependenciesPackagesVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsDependenciesPackagesVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsDependenciesPackagesVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } +} + +export class DataHuaweicloudFgsDependenciesPackagesVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsDependenciesPackagesVersionsOutputReference { + return new DataHuaweicloudFgsDependenciesPackagesVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudFgsDependenciesPackages { +} + +export function dataHuaweicloudFgsDependenciesPackagesToTerraform(struct?: DataHuaweicloudFgsDependenciesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsDependenciesPackagesToHclTerraform(struct?: DataHuaweicloudFgsDependenciesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsDependenciesPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsDependenciesPackages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsDependenciesPackages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // etag - computed: true, optional: false, required: false + public get etag() { + return this.getStringAttribute('etag'); + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // link - computed: true, optional: false, required: false + public get link() { + return this.getStringAttribute('link'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // runtime - computed: true, optional: false, required: false + public get runtime() { + return this.getStringAttribute('runtime'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // versions - computed: true, optional: false, required: false + private _versions = new DataHuaweicloudFgsDependenciesPackagesVersionsList(this, "versions", false); + public get versions() { + return this._versions; + } +} + +export class DataHuaweicloudFgsDependenciesPackagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsDependenciesPackagesOutputReference { + return new DataHuaweicloudFgsDependenciesPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies huaweicloud_fgs_dependencies} +*/ +export class DataHuaweicloudFgsDependencies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_dependencies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsDependencies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsDependencies to import + * @param importFromId The id of the existing DataHuaweicloudFgsDependencies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsDependencies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_dependencies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependencies huaweicloud_fgs_dependencies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsDependenciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsDependenciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_dependencies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._runtime = config.runtime; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // packages - computed: true, optional: false, required: false + private _packages = new DataHuaweicloudFgsDependenciesPackagesList(this, "packages", false); + public get packages() { + return this._packages; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/README.md new file mode 100644 index 00000000..ba7d58a6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_dependency_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_dependency_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/index.ts new file mode 100644 index 00000000..1dcc41a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-dependency-versions/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsDependencyVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the dependency package to which the versions belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#dependency_id DataHuaweicloudFgsDependencyVersions#dependency_id} + */ + readonly dependencyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#id DataHuaweicloudFgsDependencyVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#region DataHuaweicloudFgsDependencyVersions#region} + */ + readonly region?: string; + /** + * Specifies the runtime of the dependency package version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#runtime DataHuaweicloudFgsDependencyVersions#runtime} + */ + readonly runtime?: string; + /** + * Specifies the version of the dependency package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#version DataHuaweicloudFgsDependencyVersions#version} + */ + readonly version?: number; + /** + * Specifies the ID of the dependency package version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#version_id DataHuaweicloudFgsDependencyVersions#version_id} + */ + readonly versionId?: string; +} +export interface DataHuaweicloudFgsDependencyVersionsVersions { +} + +export function dataHuaweicloudFgsDependencyVersionsVersionsToTerraform(struct?: DataHuaweicloudFgsDependencyVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsDependencyVersionsVersionsToHclTerraform(struct?: DataHuaweicloudFgsDependencyVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsDependencyVersionsVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsDependencyVersionsVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsDependencyVersionsVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dependency_id - computed: true, optional: false, required: false + public get dependencyId() { + return this.getStringAttribute('dependency_id'); + } + + // dependency_name - computed: true, optional: false, required: false + public get dependencyName() { + return this.getStringAttribute('dependency_name'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // etag - computed: true, optional: false, required: false + public get etag() { + return this.getStringAttribute('etag'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // link - computed: true, optional: false, required: false + public get link() { + return this.getStringAttribute('link'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // runtime - computed: true, optional: false, required: false + public get runtime() { + return this.getStringAttribute('runtime'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } +} + +export class DataHuaweicloudFgsDependencyVersionsVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsDependencyVersionsVersionsOutputReference { + return new DataHuaweicloudFgsDependencyVersionsVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions huaweicloud_fgs_dependency_versions} +*/ +export class DataHuaweicloudFgsDependencyVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_dependency_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsDependencyVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsDependencyVersions to import + * @param importFromId The id of the existing DataHuaweicloudFgsDependencyVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsDependencyVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_dependency_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_dependency_versions huaweicloud_fgs_dependency_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsDependencyVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsDependencyVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_dependency_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dependencyId = config.dependencyId; + this._id = config.id; + this._region = config.region; + this._runtime = config.runtime; + this._version = config.version; + this._versionId = config.versionId; + } + + // ========== + // ATTRIBUTES + // ========== + + // dependency_id - computed: false, optional: false, required: true + private _dependencyId?: string; + public get dependencyId() { + return this.getStringAttribute('dependency_id'); + } + public set dependencyId(value: string) { + this._dependencyId = value; + } + // Temporarily expose input value. Use with caution. + public get dependencyIdInput() { + return this._dependencyId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // version - computed: false, optional: true, required: false + private _version?: number; + public get version() { + return this.getNumberAttribute('version'); + } + public set version(value: number) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // version_id - computed: false, optional: true, required: false + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + public resetVersionId() { + this._versionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // versions - computed: true, optional: false, required: false + private _versions = new DataHuaweicloudFgsDependencyVersionsVersionsList(this, "versions", false); + public get versions() { + return this._versions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dependency_id: cdktf.stringToTerraform(this._dependencyId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + version: cdktf.numberToTerraform(this._version), + version_id: cdktf.stringToTerraform(this._versionId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dependency_id: { + value: cdktf.stringToHclTerraform(this._dependencyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.numberToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/README.md new file mode 100644 index 00000000..e4d81001 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_function_events` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_function_events`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/index.ts new file mode 100644 index 00000000..5a13f591 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-events/index.ts @@ -0,0 +1,264 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsFunctionEventsConfig extends cdktf.TerraformMetaArguments { + /** + * The function URN to which the events belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events#function_urn DataHuaweicloudFgsFunctionEvents#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events#id DataHuaweicloudFgsFunctionEvents#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events#region DataHuaweicloudFgsFunctionEvents#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudFgsFunctionEventsEvents { +} + +export function dataHuaweicloudFgsFunctionEventsEventsToTerraform(struct?: DataHuaweicloudFgsFunctionEventsEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsFunctionEventsEventsToHclTerraform(struct?: DataHuaweicloudFgsFunctionEventsEvents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsFunctionEventsEventsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsFunctionEventsEvents | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsFunctionEventsEvents | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudFgsFunctionEventsEventsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsFunctionEventsEventsOutputReference { + return new DataHuaweicloudFgsFunctionEventsEventsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events huaweicloud_fgs_function_events} +*/ +export class DataHuaweicloudFgsFunctionEvents extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_function_events"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsFunctionEvents resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsFunctionEvents to import + * @param importFromId The id of the existing DataHuaweicloudFgsFunctionEvents that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsFunctionEvents to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_function_events", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_events huaweicloud_fgs_function_events} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsFunctionEventsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsFunctionEventsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_function_events', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._functionUrn = config.functionUrn; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // events - computed: true, optional: false, required: false + private _events = new DataHuaweicloudFgsFunctionEventsEventsList(this, "events", false); + public get events() { + return this._events; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/README.md new file mode 100644 index 00000000..4aacfb36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_function_triggers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_function_triggers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/index.ts new file mode 100644 index 00000000..7ad33cf6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-function-triggers/index.ts @@ -0,0 +1,427 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsFunctionTriggersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies end time of creation time of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#end_time DataHuaweicloudFgsFunctionTriggers#end_time} + */ + readonly endTime?: string; + /** + * Specifies the function URN to which the trigger belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#function_urn DataHuaweicloudFgsFunctionTriggers#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#id DataHuaweicloudFgsFunctionTriggers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#region DataHuaweicloudFgsFunctionTriggers#region} + */ + readonly region?: string; + /** + * Specifies start time of creation time of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#start_time DataHuaweicloudFgsFunctionTriggers#start_time} + */ + readonly startTime?: string; + /** + * Specifies status of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#status DataHuaweicloudFgsFunctionTriggers#status} + */ + readonly status?: string; + /** + * Specifies the ID of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#trigger_id DataHuaweicloudFgsFunctionTriggers#trigger_id} + */ + readonly triggerId?: string; + /** + * Specifies type of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#type DataHuaweicloudFgsFunctionTriggers#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudFgsFunctionTriggersTriggers { +} + +export function dataHuaweicloudFgsFunctionTriggersTriggersToTerraform(struct?: DataHuaweicloudFgsFunctionTriggersTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsFunctionTriggersTriggersToHclTerraform(struct?: DataHuaweicloudFgsFunctionTriggersTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsFunctionTriggersTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsFunctionTriggersTriggers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsFunctionTriggersTriggers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // event_data - computed: true, optional: false, required: false + public get eventData() { + return this.getStringAttribute('event_data'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudFgsFunctionTriggersTriggersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsFunctionTriggersTriggersOutputReference { + return new DataHuaweicloudFgsFunctionTriggersTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers huaweicloud_fgs_function_triggers} +*/ +export class DataHuaweicloudFgsFunctionTriggers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_function_triggers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsFunctionTriggers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsFunctionTriggers to import + * @param importFromId The id of the existing DataHuaweicloudFgsFunctionTriggers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsFunctionTriggers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_function_triggers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_function_triggers huaweicloud_fgs_function_triggers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsFunctionTriggersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsFunctionTriggersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_function_triggers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._functionUrn = config.functionUrn; + this._id = config.id; + this._region = config.region; + this._startTime = config.startTime; + this._status = config.status; + this._triggerId = config.triggerId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // trigger_id - computed: false, optional: true, required: false + private _triggerId?: string; + public get triggerId() { + return this.getStringAttribute('trigger_id'); + } + public set triggerId(value: string) { + this._triggerId = value; + } + public resetTriggerId() { + this._triggerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerIdInput() { + return this._triggerId; + } + + // triggers - computed: true, optional: false, required: false + private _triggers = new DataHuaweicloudFgsFunctionTriggersTriggersList(this, "triggers", false); + public get triggers() { + return this._triggers; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + trigger_id: cdktf.stringToTerraform(this._triggerId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_id: { + value: cdktf.stringToHclTerraform(this._triggerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/README.md new file mode 100644 index 00000000..bdf56b5f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_functions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_functions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/index.ts new file mode 100644 index 00000000..ea50eb0e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-functions/index.ts @@ -0,0 +1,485 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsFunctionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#enterprise_project_id DataHuaweicloudFgsFunctions#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#id DataHuaweicloudFgsFunctions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#name DataHuaweicloudFgsFunctions#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#package_name DataHuaweicloudFgsFunctions#package_name} + */ + readonly packageName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#region DataHuaweicloudFgsFunctions#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#runtime DataHuaweicloudFgsFunctions#runtime} + */ + readonly runtime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#urn DataHuaweicloudFgsFunctions#urn} + */ + readonly urn?: string; +} +export interface DataHuaweicloudFgsFunctionsFunctions { +} + +export function dataHuaweicloudFgsFunctionsFunctionsToTerraform(struct?: DataHuaweicloudFgsFunctionsFunctions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsFunctionsFunctionsToHclTerraform(struct?: DataHuaweicloudFgsFunctionsFunctions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsFunctionsFunctionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsFunctionsFunctions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsFunctionsFunctions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agency - computed: true, optional: false, required: false + public get agency() { + return this.getStringAttribute('agency'); + } + + // app_agency - computed: true, optional: false, required: false + public get appAgency() { + return this.getStringAttribute('app_agency'); + } + + // code_filename - computed: true, optional: false, required: false + public get codeFilename() { + return this.getStringAttribute('code_filename'); + } + + // code_type - computed: true, optional: false, required: false + public get codeType() { + return this.getStringAttribute('code_type'); + } + + // code_url - computed: true, optional: false, required: false + public get codeUrl() { + return this.getStringAttribute('code_url'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // encrypted_user_data - computed: true, optional: false, required: false + public get encryptedUserData() { + return this.getStringAttribute('encrypted_user_data'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // functiongraph_version - computed: true, optional: false, required: false + public get functiongraphVersion() { + return this.getStringAttribute('functiongraph_version'); + } + + // handler - computed: true, optional: false, required: false + public get handler() { + return this.getStringAttribute('handler'); + } + + // initializer_handler - computed: true, optional: false, required: false + public get initializerHandler() { + return this.getStringAttribute('initializer_handler'); + } + + // initializer_timeout - computed: true, optional: false, required: false + public get initializerTimeout() { + return this.getNumberAttribute('initializer_timeout'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // max_instance_num - computed: true, optional: false, required: false + public get maxInstanceNum() { + return this.getStringAttribute('max_instance_num'); + } + + // memory_size - computed: true, optional: false, required: false + public get memorySize() { + return this.getNumberAttribute('memory_size'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_id - computed: true, optional: false, required: false + public get networkId() { + return this.getStringAttribute('network_id'); + } + + // package - computed: true, optional: false, required: false + public get package() { + return this.getStringAttribute('package'); + } + + // runtime - computed: true, optional: false, required: false + public get runtime() { + return this.getStringAttribute('runtime'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudFgsFunctionsFunctionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsFunctionsFunctionsOutputReference { + return new DataHuaweicloudFgsFunctionsFunctionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions huaweicloud_fgs_functions} +*/ +export class DataHuaweicloudFgsFunctions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_functions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsFunctions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsFunctions to import + * @param importFromId The id of the existing DataHuaweicloudFgsFunctions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsFunctions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_functions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_functions huaweicloud_fgs_functions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsFunctionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsFunctionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_functions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._packageName = config.packageName; + this._region = config.region; + this._runtime = config.runtime; + this._urn = config.urn; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // functions - computed: true, optional: false, required: false + private _functions = new DataHuaweicloudFgsFunctionsFunctionsList(this, "functions", false); + public get functions() { + return this._functions; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // package_name - computed: false, optional: true, required: false + private _packageName?: string; + public get packageName() { + return this.getStringAttribute('package_name'); + } + public set packageName(value: string) { + this._packageName = value; + } + public resetPackageName() { + this._packageName = undefined; + } + // Temporarily expose input value. Use with caution. + public get packageNameInput() { + return this._packageName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // urn - computed: false, optional: true, required: false + private _urn?: string; + public get urn() { + return this.getStringAttribute('urn'); + } + public set urn(value: string) { + this._urn = value; + } + public resetUrn() { + this._urn = undefined; + } + // Temporarily expose input value. Use with caution. + public get urnInput() { + return this._urn; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + package_name: cdktf.stringToTerraform(this._packageName), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + urn: cdktf.stringToTerraform(this._urn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package_name: { + value: cdktf.stringToHclTerraform(this._packageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + urn: { + value: cdktf.stringToHclTerraform(this._urn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/README.md new file mode 100644 index 00000000..2fd7cc56 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_fgs_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_fgs_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/index.ts new file mode 100644 index 00000000..08bc0cf4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-fgs-quotas/index.ts @@ -0,0 +1,242 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudFgsQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas#id DataHuaweicloudFgsQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas#region DataHuaweicloudFgsQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudFgsQuotasQuotas { +} + +export function dataHuaweicloudFgsQuotasQuotasToTerraform(struct?: DataHuaweicloudFgsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudFgsQuotasQuotasToHclTerraform(struct?: DataHuaweicloudFgsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudFgsQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudFgsQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudFgsQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // limit - computed: true, optional: false, required: false + public get limit() { + return this.getNumberAttribute('limit'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudFgsQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudFgsQuotasQuotasOutputReference { + return new DataHuaweicloudFgsQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas huaweicloud_fgs_quotas} +*/ +export class DataHuaweicloudFgsQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudFgsQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudFgsQuotas to import + * @param importFromId The id of the existing DataHuaweicloudFgsQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudFgsQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/fgs_quotas huaweicloud_fgs_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudFgsQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudFgsQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudFgsQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/README.md new file mode 100644 index 00000000..08b3406a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_accelerators` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_accelerators`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/index.ts new file mode 100644 index 00000000..080fc9f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-accelerators/index.ts @@ -0,0 +1,449 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaAcceleratorsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the accelerator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators#accelerator_id DataHuaweicloudGaAccelerators#accelerator_id} + */ + readonly acceleratorId?: string; + /** + * The ID of the enterprise project to which the accelerator belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators#enterprise_project_id DataHuaweicloudGaAccelerators#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators#id DataHuaweicloudGaAccelerators#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the accelerator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators#name DataHuaweicloudGaAccelerators#name} + */ + readonly name?: string; + /** + * The current status of the accelerator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators#status DataHuaweicloudGaAccelerators#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaAcceleratorsAcceleratorsIpSets { +} + +export function dataHuaweicloudGaAcceleratorsAcceleratorsIpSetsToTerraform(struct?: DataHuaweicloudGaAcceleratorsAcceleratorsIpSets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaAcceleratorsAcceleratorsIpSetsToHclTerraform(struct?: DataHuaweicloudGaAcceleratorsAcceleratorsIpSets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaAcceleratorsAcceleratorsIpSetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaAcceleratorsAcceleratorsIpSets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaAcceleratorsAcceleratorsIpSets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // area - computed: true, optional: false, required: false + public get area() { + return this.getStringAttribute('area'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_type - computed: true, optional: false, required: false + public get ipType() { + return this.getStringAttribute('ip_type'); + } +} + +export class DataHuaweicloudGaAcceleratorsAcceleratorsIpSetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaAcceleratorsAcceleratorsIpSetsOutputReference { + return new DataHuaweicloudGaAcceleratorsAcceleratorsIpSetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaAcceleratorsAccelerators { +} + +export function dataHuaweicloudGaAcceleratorsAcceleratorsToTerraform(struct?: DataHuaweicloudGaAcceleratorsAccelerators): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaAcceleratorsAcceleratorsToHclTerraform(struct?: DataHuaweicloudGaAcceleratorsAccelerators): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaAcceleratorsAcceleratorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaAcceleratorsAccelerators | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaAcceleratorsAccelerators | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_sets - computed: true, optional: false, required: false + private _ipSets = new DataHuaweicloudGaAcceleratorsAcceleratorsIpSetsList(this, "ip_sets", false); + public get ipSets() { + return this._ipSets; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGaAcceleratorsAcceleratorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaAcceleratorsAcceleratorsOutputReference { + return new DataHuaweicloudGaAcceleratorsAcceleratorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators huaweicloud_ga_accelerators} +*/ +export class DataHuaweicloudGaAccelerators extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_accelerators"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaAccelerators resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaAccelerators to import + * @param importFromId The id of the existing DataHuaweicloudGaAccelerators that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaAccelerators to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_accelerators", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_accelerators huaweicloud_ga_accelerators} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaAcceleratorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaAcceleratorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_accelerators', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._acceleratorId = config.acceleratorId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // accelerator_id - computed: false, optional: true, required: false + private _acceleratorId?: string; + public get acceleratorId() { + return this.getStringAttribute('accelerator_id'); + } + public set acceleratorId(value: string) { + this._acceleratorId = value; + } + public resetAcceleratorId() { + this._acceleratorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get acceleratorIdInput() { + return this._acceleratorId; + } + + // accelerators - computed: true, optional: false, required: false + private _accelerators = new DataHuaweicloudGaAcceleratorsAcceleratorsList(this, "accelerators", false); + public get accelerators() { + return this._accelerators; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + accelerator_id: cdktf.stringToTerraform(this._acceleratorId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + accelerator_id: { + value: cdktf.stringToHclTerraform(this._acceleratorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/README.md new file mode 100644 index 00000000..e39473dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_address_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_address_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/index.ts new file mode 100644 index 00000000..5460b8e0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-address-groups/index.ts @@ -0,0 +1,519 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaAddressGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups#address_group_id DataHuaweicloudGaAddressGroups#address_group_id} + */ + readonly addressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups#id DataHuaweicloudGaAddressGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the listener associated with the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups#listener_id DataHuaweicloudGaAddressGroups#listener_id} + */ + readonly listenerId?: string; + /** + * The name of the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups#name DataHuaweicloudGaAddressGroups#name} + */ + readonly name?: string; + /** + * The status of the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups#status DataHuaweicloudGaAddressGroups#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListeners { +} + +export function dataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersToTerraform(struct?: DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersToHclTerraform(struct?: DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersOutputReference { + return new DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaAddressGroupsAddressGroupsIpAddresses { +} + +export function dataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesToTerraform(struct?: DataHuaweicloudGaAddressGroupsAddressGroupsIpAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesToHclTerraform(struct?: DataHuaweicloudGaAddressGroupsAddressGroupsIpAddresses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaAddressGroupsAddressGroupsIpAddresses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaAddressGroupsAddressGroupsIpAddresses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } +} + +export class DataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesOutputReference { + return new DataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaAddressGroupsAddressGroups { +} + +export function dataHuaweicloudGaAddressGroupsAddressGroupsToTerraform(struct?: DataHuaweicloudGaAddressGroupsAddressGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaAddressGroupsAddressGroupsToHclTerraform(struct?: DataHuaweicloudGaAddressGroupsAddressGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaAddressGroupsAddressGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaAddressGroupsAddressGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaAddressGroupsAddressGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated_listeners - computed: true, optional: false, required: false + private _associatedListeners = new DataHuaweicloudGaAddressGroupsAddressGroupsAssociatedListenersList(this, "associated_listeners", false); + public get associatedListeners() { + return this._associatedListeners; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_addresses - computed: true, optional: false, required: false + private _ipAddresses = new DataHuaweicloudGaAddressGroupsAddressGroupsIpAddressesList(this, "ip_addresses", false); + public get ipAddresses() { + return this._ipAddresses; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGaAddressGroupsAddressGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaAddressGroupsAddressGroupsOutputReference { + return new DataHuaweicloudGaAddressGroupsAddressGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups huaweicloud_ga_address_groups} +*/ +export class DataHuaweicloudGaAddressGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_address_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaAddressGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaAddressGroups to import + * @param importFromId The id of the existing DataHuaweicloudGaAddressGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaAddressGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_address_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_address_groups huaweicloud_ga_address_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaAddressGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaAddressGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_address_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._addressGroupId = config.addressGroupId; + this._id = config.id; + this._listenerId = config.listenerId; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // address_group_id - computed: false, optional: true, required: false + private _addressGroupId?: string; + public get addressGroupId() { + return this.getStringAttribute('address_group_id'); + } + public set addressGroupId(value: string) { + this._addressGroupId = value; + } + public resetAddressGroupId() { + this._addressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressGroupIdInput() { + return this._addressGroupId; + } + + // address_groups - computed: true, optional: false, required: false + private _addressGroups = new DataHuaweicloudGaAddressGroupsAddressGroupsList(this, "address_groups", false); + public get addressGroups() { + return this._addressGroups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address_group_id: cdktf.stringToTerraform(this._addressGroupId), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address_group_id: { + value: cdktf.stringToHclTerraform(this._addressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/README.md new file mode 100644 index 00000000..737e6bc5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/index.ts new file mode 100644 index 00000000..cc829288 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-availability-zones/index.ts @@ -0,0 +1,237 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * The acceleration area to which the regions belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones#area DataHuaweicloudGaAvailabilityZones#area} + */ + readonly area?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones#id DataHuaweicloudGaAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} +export interface DataHuaweicloudGaAvailabilityZonesRegions { +} + +export function dataHuaweicloudGaAvailabilityZonesRegionsToTerraform(struct?: DataHuaweicloudGaAvailabilityZonesRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaAvailabilityZonesRegionsToHclTerraform(struct?: DataHuaweicloudGaAvailabilityZonesRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaAvailabilityZonesRegionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaAvailabilityZonesRegions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaAvailabilityZonesRegions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // area - computed: true, optional: false, required: false + public get area() { + return this.getStringAttribute('area'); + } + + // endpoint_types - computed: true, optional: false, required: false + public get endpointTypes() { + return this.getListAttribute('endpoint_types'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } +} + +export class DataHuaweicloudGaAvailabilityZonesRegionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaAvailabilityZonesRegionsOutputReference { + return new DataHuaweicloudGaAvailabilityZonesRegionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones huaweicloud_ga_availability_zones} +*/ +export class DataHuaweicloudGaAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudGaAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_availability_zones huaweicloud_ga_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._area = config.area; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // area - computed: false, optional: true, required: false + private _area?: string; + public get area() { + return this.getStringAttribute('area'); + } + public set area(value: string) { + this._area = value; + } + public resetArea() { + this._area = undefined; + } + // Temporarily expose input value. Use with caution. + public get areaInput() { + return this._area; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // regions - computed: true, optional: false, required: false + private _regions = new DataHuaweicloudGaAvailabilityZonesRegionsList(this, "regions", false); + public get regions() { + return this._regions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + area: cdktf.stringToTerraform(this._area), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + area: { + value: cdktf.stringToHclTerraform(this._area), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/README.md new file mode 100644 index 00000000..1dc10315 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_endpoint_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_endpoint_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/index.ts new file mode 100644 index 00000000..91053781 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoint-groups/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaEndpointGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the endpoint group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups#endpoint_group_id DataHuaweicloudGaEndpointGroups#endpoint_group_id} + */ + readonly endpointGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups#id DataHuaweicloudGaEndpointGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the listener to which the endpoint group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups#listener_id DataHuaweicloudGaEndpointGroups#listener_id} + */ + readonly listenerId?: string; + /** + * The name of the endpoint group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups#name DataHuaweicloudGaEndpointGroups#name} + */ + readonly name?: string; + /** + * The status of the endpoint group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups#status DataHuaweicloudGaEndpointGroups#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaEndpointGroupsEndpointGroups { +} + +export function dataHuaweicloudGaEndpointGroupsEndpointGroupsToTerraform(struct?: DataHuaweicloudGaEndpointGroupsEndpointGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaEndpointGroupsEndpointGroupsToHclTerraform(struct?: DataHuaweicloudGaEndpointGroupsEndpointGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaEndpointGroupsEndpointGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaEndpointGroupsEndpointGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaEndpointGroupsEndpointGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // listener_id - computed: true, optional: false, required: false + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_dial_percentage - computed: true, optional: false, required: false + public get trafficDialPercentage() { + return this.getNumberAttribute('traffic_dial_percentage'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGaEndpointGroupsEndpointGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaEndpointGroupsEndpointGroupsOutputReference { + return new DataHuaweicloudGaEndpointGroupsEndpointGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups huaweicloud_ga_endpoint_groups} +*/ +export class DataHuaweicloudGaEndpointGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_endpoint_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaEndpointGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaEndpointGroups to import + * @param importFromId The id of the existing DataHuaweicloudGaEndpointGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaEndpointGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_endpoint_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoint_groups huaweicloud_ga_endpoint_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaEndpointGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaEndpointGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_endpoint_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointGroupId = config.endpointGroupId; + this._id = config.id; + this._listenerId = config.listenerId; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint_group_id - computed: false, optional: true, required: false + private _endpointGroupId?: string; + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + public set endpointGroupId(value: string) { + this._endpointGroupId = value; + } + public resetEndpointGroupId() { + this._endpointGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointGroupIdInput() { + return this._endpointGroupId; + } + + // endpoint_groups - computed: true, optional: false, required: false + private _endpointGroups = new DataHuaweicloudGaEndpointGroupsEndpointGroupsList(this, "endpoint_groups", false); + public get endpointGroups() { + return this._endpointGroups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_group_id: cdktf.stringToTerraform(this._endpointGroupId), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_group_id: { + value: cdktf.stringToHclTerraform(this._endpointGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/README.md new file mode 100644 index 00000000..f130bbc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_endpoints` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_endpoints`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/index.ts new file mode 100644 index 00000000..cf83ab81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-endpoints/index.ts @@ -0,0 +1,449 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaEndpointsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the endpoint group to which the endpoint belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#endpoint_group_id DataHuaweicloudGaEndpoints#endpoint_group_id} + */ + readonly endpointGroupId: string; + /** + * The ID of the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#endpoint_id DataHuaweicloudGaEndpoints#endpoint_id} + */ + readonly endpointId?: string; + /** + * The health status of the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#health_state DataHuaweicloudGaEndpoints#health_state} + */ + readonly healthState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#id DataHuaweicloudGaEndpoints#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The IP address of the backend resource corresponding to the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#ip_address DataHuaweicloudGaEndpoints#ip_address} + */ + readonly ipAddress?: string; + /** + * The ID of the backend resource corresponding to the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#resource_id DataHuaweicloudGaEndpoints#resource_id} + */ + readonly resourceId?: string; + /** + * The type of the backend resource corresponding to the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#resource_type DataHuaweicloudGaEndpoints#resource_type} + */ + readonly resourceType?: string; + /** + * The status of the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#status DataHuaweicloudGaEndpoints#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaEndpointsEndpoints { +} + +export function dataHuaweicloudGaEndpointsEndpointsToTerraform(struct?: DataHuaweicloudGaEndpointsEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaEndpointsEndpointsToHclTerraform(struct?: DataHuaweicloudGaEndpointsEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaEndpointsEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaEndpointsEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaEndpointsEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // endpoint_group_id - computed: true, optional: false, required: false + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + + // health_state - computed: true, optional: false, required: false + public get healthState() { + return this.getStringAttribute('health_state'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudGaEndpointsEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaEndpointsEndpointsOutputReference { + return new DataHuaweicloudGaEndpointsEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints huaweicloud_ga_endpoints} +*/ +export class DataHuaweicloudGaEndpoints extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_endpoints"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaEndpoints resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaEndpoints to import + * @param importFromId The id of the existing DataHuaweicloudGaEndpoints that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaEndpoints to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_endpoints", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_endpoints huaweicloud_ga_endpoints} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaEndpointsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaEndpointsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_endpoints', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointGroupId = config.endpointGroupId; + this._endpointId = config.endpointId; + this._healthState = config.healthState; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint_group_id - computed: false, optional: false, required: true + private _endpointGroupId?: string; + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + public set endpointGroupId(value: string) { + this._endpointGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get endpointGroupIdInput() { + return this._endpointGroupId; + } + + // endpoint_id - computed: false, optional: true, required: false + private _endpointId?: string; + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + public set endpointId(value: string) { + this._endpointId = value; + } + public resetEndpointId() { + this._endpointId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointIdInput() { + return this._endpointId; + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DataHuaweicloudGaEndpointsEndpointsList(this, "endpoints", false); + public get endpoints() { + return this._endpoints; + } + + // health_state - computed: false, optional: true, required: false + private _healthState?: string; + public get healthState() { + return this.getStringAttribute('health_state'); + } + public set healthState(value: string) { + this._healthState = value; + } + public resetHealthState() { + this._healthState = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthStateInput() { + return this._healthState; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_group_id: cdktf.stringToTerraform(this._endpointGroupId), + endpoint_id: cdktf.stringToTerraform(this._endpointId), + health_state: cdktf.stringToTerraform(this._healthState), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_group_id: { + value: cdktf.stringToHclTerraform(this._endpointGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint_id: { + value: cdktf.stringToHclTerraform(this._endpointId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + health_state: { + value: cdktf.stringToHclTerraform(this._healthState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/README.md new file mode 100644 index 00000000..4c005e94 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_health_checks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_health_checks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/index.ts new file mode 100644 index 00000000..67f40518 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-health-checks/index.ts @@ -0,0 +1,397 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaHealthChecksConfig extends cdktf.TerraformMetaArguments { + /** + * Whether health check is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#enabled DataHuaweicloudGaHealthChecks#enabled} + */ + readonly enabled?: string; + /** + * The ID of the endpoint group to which the health check belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#endpoint_group_id DataHuaweicloudGaHealthChecks#endpoint_group_id} + */ + readonly endpointGroupId?: string; + /** + * The ID of the health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#health_check_id DataHuaweicloudGaHealthChecks#health_check_id} + */ + readonly healthCheckId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#id DataHuaweicloudGaHealthChecks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The front end protocol of the health check used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#protocol DataHuaweicloudGaHealthChecks#protocol} + */ + readonly protocol?: string; + /** + * The status of the health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#status DataHuaweicloudGaHealthChecks#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaHealthChecksHealthChecks { +} + +export function dataHuaweicloudGaHealthChecksHealthChecksToTerraform(struct?: DataHuaweicloudGaHealthChecksHealthChecks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaHealthChecksHealthChecksToHclTerraform(struct?: DataHuaweicloudGaHealthChecksHealthChecks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaHealthChecksHealthChecksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaHealthChecksHealthChecks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaHealthChecksHealthChecks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // endpoint_group_id - computed: true, optional: false, required: false + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // interval - computed: true, optional: false, required: false + public get interval() { + return this.getNumberAttribute('interval'); + } + + // max_retries - computed: true, optional: false, required: false + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGaHealthChecksHealthChecksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaHealthChecksHealthChecksOutputReference { + return new DataHuaweicloudGaHealthChecksHealthChecksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks huaweicloud_ga_health_checks} +*/ +export class DataHuaweicloudGaHealthChecks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_health_checks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaHealthChecks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaHealthChecks to import + * @param importFromId The id of the existing DataHuaweicloudGaHealthChecks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaHealthChecks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_health_checks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_health_checks huaweicloud_ga_health_checks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaHealthChecksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaHealthChecksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_health_checks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._endpointGroupId = config.endpointGroupId; + this._healthCheckId = config.healthCheckId; + this._id = config.id; + this._protocol = config.protocol; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // endpoint_group_id - computed: false, optional: true, required: false + private _endpointGroupId?: string; + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + public set endpointGroupId(value: string) { + this._endpointGroupId = value; + } + public resetEndpointGroupId() { + this._endpointGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointGroupIdInput() { + return this._endpointGroupId; + } + + // health_check_id - computed: false, optional: true, required: false + private _healthCheckId?: string; + public get healthCheckId() { + return this.getStringAttribute('health_check_id'); + } + public set healthCheckId(value: string) { + this._healthCheckId = value; + } + public resetHealthCheckId() { + this._healthCheckId = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthCheckIdInput() { + return this._healthCheckId; + } + + // health_checks - computed: true, optional: false, required: false + private _healthChecks = new DataHuaweicloudGaHealthChecksHealthChecksList(this, "health_checks", false); + public get healthChecks() { + return this._healthChecks; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.stringToTerraform(this._enabled), + endpoint_group_id: cdktf.stringToTerraform(this._endpointGroupId), + health_check_id: cdktf.stringToTerraform(this._healthCheckId), + id: cdktf.stringToTerraform(this._id), + protocol: cdktf.stringToTerraform(this._protocol), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint_group_id: { + value: cdktf.stringToHclTerraform(this._endpointGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + health_check_id: { + value: cdktf.stringToHclTerraform(this._healthCheckId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/README.md new file mode 100644 index 00000000..4c643de7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ga_listeners` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ga_listeners`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/index.ts new file mode 100644 index 00000000..9c4dcf89 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ga-listeners/index.ts @@ -0,0 +1,479 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaListenersConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the accelerator to which the listener belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#accelerator_id DataHuaweicloudGaListeners#accelerator_id} + */ + readonly acceleratorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#id DataHuaweicloudGaListeners#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#listener_id DataHuaweicloudGaListeners#listener_id} + */ + readonly listenerId?: string; + /** + * The name of the listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#name DataHuaweicloudGaListeners#name} + */ + readonly name?: string; + /** + * The network transmission protocol type of the listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#protocol DataHuaweicloudGaListeners#protocol} + */ + readonly protocol?: string; + /** + * The current status of the listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#status DataHuaweicloudGaListeners#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaListenersListenersPortRanges { +} + +export function dataHuaweicloudGaListenersListenersPortRangesToTerraform(struct?: DataHuaweicloudGaListenersListenersPortRanges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaListenersListenersPortRangesToHclTerraform(struct?: DataHuaweicloudGaListenersListenersPortRanges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaListenersListenersPortRangesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaListenersListenersPortRanges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaListenersListenersPortRanges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // from_port - computed: true, optional: false, required: false + public get fromPort() { + return this.getNumberAttribute('from_port'); + } + + // to_port - computed: true, optional: false, required: false + public get toPort() { + return this.getNumberAttribute('to_port'); + } +} + +export class DataHuaweicloudGaListenersListenersPortRangesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaListenersListenersPortRangesOutputReference { + return new DataHuaweicloudGaListenersListenersPortRangesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaListenersListeners { +} + +export function dataHuaweicloudGaListenersListenersToTerraform(struct?: DataHuaweicloudGaListenersListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaListenersListenersToHclTerraform(struct?: DataHuaweicloudGaListenersListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaListenersListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaListenersListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaListenersListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // accelerator_id - computed: true, optional: false, required: false + public get acceleratorId() { + return this.getStringAttribute('accelerator_id'); + } + + // client_affinity - computed: true, optional: false, required: false + public get clientAffinity() { + return this.getStringAttribute('client_affinity'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // port_ranges - computed: true, optional: false, required: false + private _portRanges = new DataHuaweicloudGaListenersListenersPortRangesList(this, "port_ranges", false); + public get portRanges() { + return this._portRanges; + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGaListenersListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaListenersListenersOutputReference { + return new DataHuaweicloudGaListenersListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners huaweicloud_ga_listeners} +*/ +export class DataHuaweicloudGaListeners extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_listeners"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaListeners resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaListeners to import + * @param importFromId The id of the existing DataHuaweicloudGaListeners that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaListeners to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_listeners", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ga_listeners huaweicloud_ga_listeners} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaListenersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaListenersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_listeners', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._acceleratorId = config.acceleratorId; + this._id = config.id; + this._listenerId = config.listenerId; + this._name = config.name; + this._protocol = config.protocol; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // accelerator_id - computed: false, optional: true, required: false + private _acceleratorId?: string; + public get acceleratorId() { + return this.getStringAttribute('accelerator_id'); + } + public set acceleratorId(value: string) { + this._acceleratorId = value; + } + public resetAcceleratorId() { + this._acceleratorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get acceleratorIdInput() { + return this._acceleratorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudGaListenersListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + accelerator_id: cdktf.stringToTerraform(this._acceleratorId), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + accelerator_id: { + value: cdktf.stringToHclTerraform(this._acceleratorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/README.md new file mode 100644 index 00000000..42c891c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_cassandra_dedicated_resource` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_cassandra_dedicated_resource`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/index.ts new file mode 100644 index 00000000..4c2c94f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-dedicated-resource/index.ts @@ -0,0 +1,202 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbCassandraDedicatedResourceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource#id DataHuaweicloudGaussdbCassandraDedicatedResource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource#region DataHuaweicloudGaussdbCassandraDedicatedResource#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource#resource_name DataHuaweicloudGaussdbCassandraDedicatedResource#resource_name} + */ + readonly resourceName?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource huaweicloud_gaussdb_cassandra_dedicated_resource} +*/ +export class DataHuaweicloudGaussdbCassandraDedicatedResource extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_cassandra_dedicated_resource"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbCassandraDedicatedResource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbCassandraDedicatedResource to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbCassandraDedicatedResource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbCassandraDedicatedResource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_cassandra_dedicated_resource", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_dedicated_resource huaweicloud_gaussdb_cassandra_dedicated_resource} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbCassandraDedicatedResourceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbCassandraDedicatedResourceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_cassandra_dedicated_resource', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._resourceName = config.resourceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // architecture - computed: true, optional: false, required: false + public get architecture() { + return this.getStringAttribute('architecture'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_name - computed: true, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + + // volume - computed: true, optional: false, required: false + public get volume() { + return this.getNumberAttribute('volume'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_name: cdktf.stringToTerraform(this._resourceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/README.md new file mode 100644 index 00000000..590c7856 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_cassandra_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_cassandra_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/index.ts new file mode 100644 index 00000000..1e39bbd0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-flavors/index.ts @@ -0,0 +1,330 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbCassandraFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors#id DataHuaweicloudGaussdbCassandraFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors#memory DataHuaweicloudGaussdbCassandraFlavors#memory} + */ + readonly memory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors#region DataHuaweicloudGaussdbCassandraFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors#vcpus DataHuaweicloudGaussdbCassandraFlavors#vcpus} + */ + readonly vcpus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors#version DataHuaweicloudGaussdbCassandraFlavors#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudGaussdbCassandraFlavorsFlavors { +} + +export function dataHuaweicloudGaussdbCassandraFlavorsFlavorsToTerraform(struct?: DataHuaweicloudGaussdbCassandraFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbCassandraFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraFlavorsFlavorsOutputReference { + return new DataHuaweicloudGaussdbCassandraFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors huaweicloud_gaussdb_cassandra_flavors} +*/ +export class DataHuaweicloudGaussdbCassandraFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_cassandra_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbCassandraFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbCassandraFlavors to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbCassandraFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbCassandraFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_cassandra_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_flavors huaweicloud_gaussdb_cassandra_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbCassandraFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbCassandraFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_cassandra_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudGaussdbCassandraFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: string; + public get memory() { + return this.getStringAttribute('memory'); + } + public set memory(value: string) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: string; + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + public set vcpus(value: string) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + memory: cdktf.stringToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.stringToTerraform(this._vcpus), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.stringToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.stringToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/README.md new file mode 100644 index 00000000..661939eb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_cassandra_instance` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_cassandra_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/index.ts new file mode 100644 index 00000000..c3cc4e9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instance/index.ts @@ -0,0 +1,572 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbCassandraInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance#id DataHuaweicloudGaussdbCassandraInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance#name DataHuaweicloudGaussdbCassandraInstance#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance#region DataHuaweicloudGaussdbCassandraInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance#subnet_id DataHuaweicloudGaussdbCassandraInstance#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance#vpc_id DataHuaweicloudGaussdbCassandraInstance#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbCassandraInstanceBackupStrategy { +} + +export function dataHuaweicloudGaussdbCassandraInstanceBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstanceBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstanceBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstanceBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbCassandraInstanceBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbCassandraInstanceDatastore { +} + +export function dataHuaweicloudGaussdbCassandraInstanceDatastoreToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstanceDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // storage_engine - computed: true, optional: false, required: false + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstanceDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstanceDatastoreOutputReference { + return new DataHuaweicloudGaussdbCassandraInstanceDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbCassandraInstanceNodes { +} + +export function dataHuaweicloudGaussdbCassandraInstanceNodesToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstanceNodesToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstanceNodesOutputReference { + return new DataHuaweicloudGaussdbCassandraInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance huaweicloud_gaussdb_cassandra_instance} +*/ +export class DataHuaweicloudGaussdbCassandraInstance extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_cassandra_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbCassandraInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbCassandraInstance to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbCassandraInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbCassandraInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_cassandra_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instance huaweicloud_gaussdb_cassandra_instance} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbCassandraInstanceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbCassandraInstanceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_cassandra_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbCassandraInstanceBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbCassandraInstanceDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbCassandraInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // volume_size - computed: true, optional: false, required: false + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/README.md new file mode 100644 index 00000000..9503aac0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_cassandra_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_cassandra_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/index.ts new file mode 100644 index 00000000..26b97e6f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-cassandra-instances/index.ts @@ -0,0 +1,673 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbCassandraInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances#id DataHuaweicloudGaussdbCassandraInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances#name DataHuaweicloudGaussdbCassandraInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances#region DataHuaweicloudGaussdbCassandraInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances#subnet_id DataHuaweicloudGaussdbCassandraInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances#vpc_id DataHuaweicloudGaussdbCassandraInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategy { +} + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbCassandraInstancesInstancesDatastore { +} + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstancesInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstancesInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // storage_engine - computed: true, optional: false, required: false + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreOutputReference { + return new DataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbCassandraInstancesInstancesNodes { +} + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesNodesToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesNodesToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstancesInstancesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstancesInstancesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstancesInstancesNodesOutputReference { + return new DataHuaweicloudGaussdbCassandraInstancesInstancesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbCassandraInstancesInstances { +} + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesToTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbCassandraInstancesInstancesToHclTerraform(struct?: DataHuaweicloudGaussdbCassandraInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbCassandraInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbCassandraInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbCassandraInstancesInstancesBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbCassandraInstancesInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbCassandraInstancesInstancesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // volume_size - computed: true, optional: false, required: false + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudGaussdbCassandraInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbCassandraInstancesInstancesOutputReference { + return new DataHuaweicloudGaussdbCassandraInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances huaweicloud_gaussdb_cassandra_instances} +*/ +export class DataHuaweicloudGaussdbCassandraInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_cassandra_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbCassandraInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbCassandraInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbCassandraInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbCassandraInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_cassandra_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_cassandra_instances huaweicloud_gaussdb_cassandra_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbCassandraInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbCassandraInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_cassandra_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudGaussdbCassandraInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/README.md new file mode 100644 index 00000000..d7897321 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_influx_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_influx_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/index.ts new file mode 100644 index 00000000..22cca7da --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-influx-instances/index.ts @@ -0,0 +1,945 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbInfluxInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#id DataHuaweicloudGaussdbInfluxInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#instance_id DataHuaweicloudGaussdbInfluxInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#mode DataHuaweicloudGaussdbInfluxInstances#mode} + */ + readonly mode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#name DataHuaweicloudGaussdbInfluxInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#region DataHuaweicloudGaussdbInfluxInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#subnet_id DataHuaweicloudGaussdbInfluxInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#vpc_id DataHuaweicloudGaussdbInfluxInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategy { +} + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbInfluxInstancesInstancesDatastore { +} + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreToTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbInfluxInstancesInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbInfluxInstancesInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // patch_available - computed: true, optional: false, required: false + public get patchAvailable() { + return this.getBooleanAttribute('patch_available'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreOutputReference { + return new DataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodes { +} + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesToTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesToHclTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesOutputReference { + return new DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolume { +} + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeToTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeToHclTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getStringAttribute('used'); + } +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeOutputReference { + return new DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbInfluxInstancesInstancesGroups { +} + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesGroupsToTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesGroupsToHclTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstancesGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbInfluxInstancesInstancesGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbInfluxInstancesInstancesGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // volume - computed: true, optional: false, required: false + private _volume = new DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsVolumeList(this, "volume", false); + public get volume() { + return this._volume; + } +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsOutputReference { + return new DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbInfluxInstancesInstances { +} + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesToTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbInfluxInstancesInstancesToHclTerraform(struct?: DataHuaweicloudGaussdbInfluxInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbInfluxInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbInfluxInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbInfluxInstancesInstancesBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbInfluxInstancesInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // dedicated_resource_id - computed: true, optional: false, required: false + public get dedicatedResourceId() { + return this.getStringAttribute('dedicated_resource_id'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudGaussdbInfluxInstancesInstancesGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // lb_ip_address - computed: true, optional: false, required: false + public get lbIpAddress() { + return this.getStringAttribute('lb_ip_address'); + } + + // lb_port - computed: true, optional: false, required: false + public get lbPort() { + return this.getStringAttribute('lb_port'); + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // pay_mode - computed: true, optional: false, required: false + public get payMode() { + return this.getStringAttribute('pay_mode'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudGaussdbInfluxInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbInfluxInstancesInstancesOutputReference { + return new DataHuaweicloudGaussdbInfluxInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances huaweicloud_gaussdb_influx_instances} +*/ +export class DataHuaweicloudGaussdbInfluxInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_influx_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbInfluxInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbInfluxInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbInfluxInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbInfluxInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_influx_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_influx_instances huaweicloud_gaussdb_influx_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbInfluxInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbInfluxInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_influx_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._mode = config.mode; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudGaussdbInfluxInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + mode: cdktf.stringToTerraform(this._mode), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/README.md new file mode 100644 index 00000000..0f19d849 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_audit_log_download_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_audit_log_download_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/index.ts new file mode 100644 index 00000000..cd2e3e79 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-audit-log-download-links/index.ts @@ -0,0 +1,363 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#end_time DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#id DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#instance_id DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the GaussDB MySQL instance node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#node_id DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks#node_id} + */ + readonly nodeId?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#region DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#start_time DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinks { +} + +export function dataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksToTerraform(struct?: DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // download_link - computed: true, optional: false, required: false + public get downloadLink() { + return this.getStringAttribute('download_link'); + } + + // full_name - computed: true, optional: false, required: false + public get fullName() { + return this.getStringAttribute('full_name'); + } + + // link_expired_time - computed: true, optional: false, required: false + public get linkExpiredTime() { + return this.getStringAttribute('link_expired_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // updated_time - computed: true, optional: false, required: false + public get updatedTime() { + return this.getStringAttribute('updated_time'); + } +} + +export class DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksOutputReference { + return new DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links huaweicloud_gaussdb_mysql_audit_log_download_links} +*/ +export class DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_audit_log_download_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlAuditLogDownloadLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_audit_log_download_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_audit_log_download_links huaweicloud_gaussdb_mysql_audit_log_download_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_audit_log_download_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // links - computed: true, optional: false, required: false + private _links = new DataHuaweicloudGaussdbMysqlAuditLogDownloadLinksLinksList(this, "links", false); + public get links() { + return this._links; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/README.md new file mode 100644 index 00000000..8f777201 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_auto_scaling_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_auto_scaling_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/index.ts new file mode 100644 index 00000000..8334bb26 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-auto-scaling-records/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlAutoScalingRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records#id DataHuaweicloudGaussdbMysqlAutoScalingRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records#instance_id DataHuaweicloudGaussdbMysqlAutoScalingRecords#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records#region DataHuaweicloudGaussdbMysqlAutoScalingRecords#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecords { +} + +export function dataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsToTerraform(struct?: DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // original_value - computed: true, optional: false, required: false + public get originalValue() { + return this.getStringAttribute('original_value'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // scaling_type - computed: true, optional: false, required: false + public get scalingType() { + return this.getStringAttribute('scaling_type'); + } + + // target_value - computed: true, optional: false, required: false + public get targetValue() { + return this.getStringAttribute('target_value'); + } +} + +export class DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsOutputReference { + return new DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records huaweicloud_gaussdb_mysql_auto_scaling_records} +*/ +export class DataHuaweicloudGaussdbMysqlAutoScalingRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_auto_scaling_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlAutoScalingRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlAutoScalingRecords to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlAutoScalingRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlAutoScalingRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_auto_scaling_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_auto_scaling_records huaweicloud_gaussdb_mysql_auto_scaling_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlAutoScalingRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlAutoScalingRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_auto_scaling_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudGaussdbMysqlAutoScalingRecordsRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/README.md new file mode 100644 index 00000000..5bf48859 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_backups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_backups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/index.ts new file mode 100644 index 00000000..29234dff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-backups/index.ts @@ -0,0 +1,603 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlBackupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#backup_id DataHuaweicloudGaussdbMysqlBackups#backup_id} + */ + readonly backupId?: string; + /** + * Specifies the backup type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#backup_type DataHuaweicloudGaussdbMysqlBackups#backup_type} + */ + readonly backupType?: string; + /** + * Specifies the backup start time. The format is **yyyy-mm-ddThh:mm:ssZ**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#begin_time DataHuaweicloudGaussdbMysqlBackups#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the backup end time.The format is **yyyy-mm-ddThh:mm:ssZ**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#end_time DataHuaweicloudGaussdbMysqlBackups#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#id DataHuaweicloudGaussdbMysqlBackups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#instance_id DataHuaweicloudGaussdbMysqlBackups#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#instance_name DataHuaweicloudGaussdbMysqlBackups#instance_name} + */ + readonly instanceName?: string; + /** + * Specifies the backup name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#name DataHuaweicloudGaussdbMysqlBackups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#region DataHuaweicloudGaussdbMysqlBackups#region} + */ + readonly region?: string; + /** + * Specifies the backup type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#status DataHuaweicloudGaussdbMysqlBackups#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaussdbMysqlBackupsBackupsDatastore { +} + +export function dataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreToTerraform(struct?: DataHuaweicloudGaussdbMysqlBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlBackupsBackupsDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlBackupsBackupsDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreOutputReference { + return new DataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlBackupsBackups { +} + +export function dataHuaweicloudGaussdbMysqlBackupsBackupsToTerraform(struct?: DataHuaweicloudGaussdbMysqlBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlBackupsBackupsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlBackupsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlBackupsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlBackupsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbMysqlBackupsBackupsDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // take_up_time - computed: true, optional: false, required: false + public get takeUpTime() { + return this.getNumberAttribute('take_up_time'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaussdbMysqlBackupsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlBackupsBackupsOutputReference { + return new DataHuaweicloudGaussdbMysqlBackupsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups huaweicloud_gaussdb_mysql_backups} +*/ +export class DataHuaweicloudGaussdbMysqlBackups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_backups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlBackups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlBackups to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlBackups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlBackups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_backups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_backups huaweicloud_gaussdb_mysql_backups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlBackupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlBackupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_backups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._backupType = config.backupType; + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._instanceName = config.instanceName; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudGaussdbMysqlBackupsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: false, optional: true, required: false + private _instanceName?: string; + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + public set instanceName(value: string) { + this._instanceName = value; + } + public resetInstanceName() { + this._instanceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNameInput() { + return this._instanceName; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + backup_type: cdktf.stringToTerraform(this._backupType), + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_name: cdktf.stringToTerraform(this._instanceName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_name: { + value: cdktf.stringToHclTerraform(this._instanceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/README.md new file mode 100644 index 00000000..ee9b677b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_configuration` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/index.ts new file mode 100644 index 00000000..d17ba564 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configuration/index.ts @@ -0,0 +1,187 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration#id DataHuaweicloudGaussdbMysqlConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration#name DataHuaweicloudGaussdbMysqlConfiguration#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration#region DataHuaweicloudGaussdbMysqlConfiguration#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration huaweicloud_gaussdb_mysql_configuration} +*/ +export class DataHuaweicloudGaussdbMysqlConfiguration extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlConfiguration to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configuration huaweicloud_gaussdb_mysql_configuration} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlConfigurationConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlConfigurationConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // datastore_name - computed: true, optional: false, required: false + public get datastoreName() { + return this.getStringAttribute('datastore_name'); + } + + // datastore_version - computed: true, optional: false, required: false + public get datastoreVersion() { + return this.getStringAttribute('datastore_version'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/README.md new file mode 100644 index 00000000..8fb55258 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_configurations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_configurations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/index.ts new file mode 100644 index 00000000..5462037b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-configurations/index.ts @@ -0,0 +1,262 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlConfigurationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations#id DataHuaweicloudGaussdbMysqlConfigurations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations#region DataHuaweicloudGaussdbMysqlConfigurations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlConfigurationsConfigurations { +} + +export function dataHuaweicloudGaussdbMysqlConfigurationsConfigurationsToTerraform(struct?: DataHuaweicloudGaussdbMysqlConfigurationsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlConfigurationsConfigurationsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlConfigurationsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlConfigurationsConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlConfigurationsConfigurations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlConfigurationsConfigurations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore_name - computed: true, optional: false, required: false + public get datastoreName() { + return this.getStringAttribute('datastore_name'); + } + + // datastore_version_name - computed: true, optional: false, required: false + public get datastoreVersionName() { + return this.getStringAttribute('datastore_version_name'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_defined - computed: true, optional: false, required: false + public get userDefined() { + return this.getBooleanAttribute('user_defined'); + } +} + +export class DataHuaweicloudGaussdbMysqlConfigurationsConfigurationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlConfigurationsConfigurationsOutputReference { + return new DataHuaweicloudGaussdbMysqlConfigurationsConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations huaweicloud_gaussdb_mysql_configurations} +*/ +export class DataHuaweicloudGaussdbMysqlConfigurations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_configurations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlConfigurations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlConfigurations to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlConfigurations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlConfigurations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_configurations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_configurations huaweicloud_gaussdb_mysql_configurations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlConfigurationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlConfigurationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_configurations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configurations - computed: true, optional: false, required: false + private _configurations = new DataHuaweicloudGaussdbMysqlConfigurationsConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/README.md new file mode 100644 index 00000000..0cbcf90e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_database_character_set` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_database_character_set`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/index.ts new file mode 100644 index 00000000..19bac458 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-database-character-set/index.ts @@ -0,0 +1,178 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlDatabaseCharacterSetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set#id DataHuaweicloudGaussdbMysqlDatabaseCharacterSet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set#instance_id DataHuaweicloudGaussdbMysqlDatabaseCharacterSet#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set#region DataHuaweicloudGaussdbMysqlDatabaseCharacterSet#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set huaweicloud_gaussdb_mysql_database_character_set} +*/ +export class DataHuaweicloudGaussdbMysqlDatabaseCharacterSet extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_database_character_set"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlDatabaseCharacterSet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlDatabaseCharacterSet to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlDatabaseCharacterSet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlDatabaseCharacterSet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_database_character_set", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_database_character_set huaweicloud_gaussdb_mysql_database_character_set} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlDatabaseCharacterSetConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlDatabaseCharacterSetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_database_character_set', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // charsets - computed: true, optional: false, required: false + public get charsets() { + return this.getListAttribute('charsets'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/README.md new file mode 100644 index 00000000..d13c3218 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/index.ts new file mode 100644 index 00000000..178915d9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-databases/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database character set, + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases#character_set DataHuaweicloudGaussdbMysqlDatabases#character_set} + */ + readonly characterSet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases#id DataHuaweicloudGaussdbMysqlDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of GaussDB MySQL Instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases#instance_id DataHuaweicloudGaussdbMysqlDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases#name DataHuaweicloudGaussdbMysqlDatabases#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases#region DataHuaweicloudGaussdbMysqlDatabases#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsers { +} + +export function dataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersToTerraform(struct?: DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } +} + +export class DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersOutputReference { + return new DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlDatabasesDatabases { +} + +export function dataHuaweicloudGaussdbMysqlDatabasesDatabasesToTerraform(struct?: DataHuaweicloudGaussdbMysqlDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // character_set - computed: true, optional: false, required: false + public get characterSet() { + return this.getStringAttribute('character_set'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudGaussdbMysqlDatabasesDatabasesUsersList(this, "users", false); + public get users() { + return this._users; + } +} + +export class DataHuaweicloudGaussdbMysqlDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlDatabasesDatabasesOutputReference { + return new DataHuaweicloudGaussdbMysqlDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases huaweicloud_gaussdb_mysql_databases} +*/ +export class DataHuaweicloudGaussdbMysqlDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlDatabases to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_databases huaweicloud_gaussdb_mysql_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: true, required: false + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + public resetCharacterSet() { + this._characterSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudGaussdbMysqlDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/README.md new file mode 100644 index 00000000..6e036757 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_dedicated_resource` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_dedicated_resource`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/index.ts new file mode 100644 index 00000000..0240a5d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-dedicated-resource/index.ts @@ -0,0 +1,202 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlDedicatedResourceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource#id DataHuaweicloudGaussdbMysqlDedicatedResource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource#region DataHuaweicloudGaussdbMysqlDedicatedResource#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource#resource_name DataHuaweicloudGaussdbMysqlDedicatedResource#resource_name} + */ + readonly resourceName?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource huaweicloud_gaussdb_mysql_dedicated_resource} +*/ +export class DataHuaweicloudGaussdbMysqlDedicatedResource extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_dedicated_resource"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlDedicatedResource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlDedicatedResource to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlDedicatedResource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlDedicatedResource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_dedicated_resource", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_dedicated_resource huaweicloud_gaussdb_mysql_dedicated_resource} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlDedicatedResourceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlDedicatedResourceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_dedicated_resource', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._resourceName = config.resourceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // architecture - computed: true, optional: false, required: false + public get architecture() { + return this.getStringAttribute('architecture'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getListAttribute('availability_zone'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getNumberAttribute('ram'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_name - computed: true, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + + // volume - computed: true, optional: false, required: false + public get volume() { + return this.getNumberAttribute('volume'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_name: cdktf.stringToTerraform(this._resourceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/README.md new file mode 100644 index 00000000..75e34c8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_diagnosis_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_diagnosis_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/index.ts new file mode 100644 index 00000000..96bff7f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-instances/index.ts @@ -0,0 +1,257 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlDiagnosisInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances#id DataHuaweicloudGaussdbMysqlDiagnosisInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the metric name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances#metric_name DataHuaweicloudGaussdbMysqlDiagnosisInstances#metric_name} + */ + readonly metricName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances#region DataHuaweicloudGaussdbMysqlDiagnosisInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfos { +} + +export function dataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosToTerraform(struct?: DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // master_node_id - computed: true, optional: false, required: false + public get masterNodeId() { + return this.getStringAttribute('master_node_id'); + } +} + +export class DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosOutputReference { + return new DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances huaweicloud_gaussdb_mysql_diagnosis_instances} +*/ +export class DataHuaweicloudGaussdbMysqlDiagnosisInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_diagnosis_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlDiagnosisInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlDiagnosisInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlDiagnosisInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlDiagnosisInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_diagnosis_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_instances huaweicloud_gaussdb_mysql_diagnosis_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlDiagnosisInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlDiagnosisInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_diagnosis_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._metricName = config.metricName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_infos - computed: true, optional: false, required: false + private _instanceInfos = new DataHuaweicloudGaussdbMysqlDiagnosisInstancesInstanceInfosList(this, "instance_infos", false); + public get instanceInfos() { + return this._instanceInfos; + } + + // metric_name - computed: false, optional: false, required: true + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + metric_name: cdktf.stringToTerraform(this._metricName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_name: { + value: cdktf.stringToHclTerraform(this._metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/README.md new file mode 100644 index 00000000..684f0590 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_diagnosis_statistics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_diagnosis_statistics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/index.ts new file mode 100644 index 00000000..f4f0a180 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-diagnosis-statistics/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlDiagnosisStatisticsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics#id DataHuaweicloudGaussdbMysqlDiagnosisStatistics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics#region DataHuaweicloudGaussdbMysqlDiagnosisStatistics#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfo { +} + +export function dataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoToTerraform(struct?: DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getNumberAttribute('count'); + } + + // metric_name - computed: true, optional: false, required: false + public get metricName() { + return this.getStringAttribute('metric_name'); + } +} + +export class DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoOutputReference { + return new DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics huaweicloud_gaussdb_mysql_diagnosis_statistics} +*/ +export class DataHuaweicloudGaussdbMysqlDiagnosisStatistics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_diagnosis_statistics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlDiagnosisStatistics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlDiagnosisStatistics to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlDiagnosisStatistics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlDiagnosisStatistics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_diagnosis_statistics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_diagnosis_statistics huaweicloud_gaussdb_mysql_diagnosis_statistics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlDiagnosisStatisticsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlDiagnosisStatisticsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_diagnosis_statistics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // diagnosis_info - computed: true, optional: false, required: false + private _diagnosisInfo = new DataHuaweicloudGaussdbMysqlDiagnosisStatisticsDiagnosisInfoList(this, "diagnosis_info", false); + public get diagnosisInfo() { + return this._diagnosisInfo; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/README.md new file mode 100644 index 00000000..bf10c2df --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_engine_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_engine_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/index.ts new file mode 100644 index 00000000..b8304b50 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-engine-versions/index.ts @@ -0,0 +1,269 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlEngineVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DB engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions#database_name DataHuaweicloudGaussdbMysqlEngineVersions#database_name} + */ + readonly databaseName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions#id DataHuaweicloudGaussdbMysqlEngineVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions#region DataHuaweicloudGaussdbMysqlEngineVersions#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlEngineVersionsDatastores { +} + +export function dataHuaweicloudGaussdbMysqlEngineVersionsDatastoresToTerraform(struct?: DataHuaweicloudGaussdbMysqlEngineVersionsDatastores): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlEngineVersionsDatastoresToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlEngineVersionsDatastores): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlEngineVersionsDatastoresOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlEngineVersionsDatastores | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlEngineVersionsDatastores | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // kernel_version - computed: true, optional: false, required: false + public get kernelVersion() { + return this.getStringAttribute('kernel_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbMysqlEngineVersionsDatastoresList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlEngineVersionsDatastoresOutputReference { + return new DataHuaweicloudGaussdbMysqlEngineVersionsDatastoresOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions huaweicloud_gaussdb_mysql_engine_versions} +*/ +export class DataHuaweicloudGaussdbMysqlEngineVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_engine_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlEngineVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlEngineVersions to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlEngineVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlEngineVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_engine_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_engine_versions huaweicloud_gaussdb_mysql_engine_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlEngineVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlEngineVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_engine_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseName = config.databaseName; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_name - computed: false, optional: false, required: true + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // datastores - computed: true, optional: false, required: false + private _datastores = new DataHuaweicloudGaussdbMysqlEngineVersionsDatastoresList(this, "datastores", false); + public get datastores() { + return this._datastores; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name: cdktf.stringToTerraform(this._databaseName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/README.md new file mode 100644 index 00000000..e5776ace --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_error_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_error_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/index.ts new file mode 100644 index 00000000..f2d97a07 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-error-logs/index.ts @@ -0,0 +1,380 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlErrorLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#end_time DataHuaweicloudGaussdbMysqlErrorLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#id DataHuaweicloudGaussdbMysqlErrorLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#instance_id DataHuaweicloudGaussdbMysqlErrorLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the log level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#level DataHuaweicloudGaussdbMysqlErrorLogs#level} + */ + readonly level?: string; + /** + * Specifies the ID of the GaussDB MySQL instance node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#node_id DataHuaweicloudGaussdbMysqlErrorLogs#node_id} + */ + readonly nodeId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#region DataHuaweicloudGaussdbMysqlErrorLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#start_time DataHuaweicloudGaussdbMysqlErrorLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStruct { +} + +export function dataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructToTerraform(struct?: DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // node_id - computed: true, optional: false, required: false + public get nodeId() { + return this.getStringAttribute('node_id'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } +} + +export class DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructOutputReference { + return new DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs huaweicloud_gaussdb_mysql_error_logs} +*/ +export class DataHuaweicloudGaussdbMysqlErrorLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_error_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlErrorLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlErrorLogs to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlErrorLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlErrorLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_error_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_error_logs huaweicloud_gaussdb_mysql_error_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlErrorLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlErrorLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_error_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._level = config.level; + this._nodeId = config.nodeId; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // error_log_list - computed: true, optional: false, required: false + private _errorLogList = new DataHuaweicloudGaussdbMysqlErrorLogsErrorLogListStructList(this, "error_log_list", false); + public get errorLogList() { + return this._errorLogList; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + level: cdktf.stringToTerraform(this._level), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/README.md new file mode 100644 index 00000000..d8e63e53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/index.ts new file mode 100644 index 00000000..85dd4f09 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-flavors/index.ts @@ -0,0 +1,340 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors#availability_zone_mode DataHuaweicloudGaussdbMysqlFlavors#availability_zone_mode} + */ + readonly availabilityZoneMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors#engine DataHuaweicloudGaussdbMysqlFlavors#engine} + */ + readonly engine?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors#id DataHuaweicloudGaussdbMysqlFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors#region DataHuaweicloudGaussdbMysqlFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors#version DataHuaweicloudGaussdbMysqlFlavors#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudGaussdbMysqlFlavorsFlavors { +} + +export function dataHuaweicloudGaussdbMysqlFlavorsFlavorsToTerraform(struct?: DataHuaweicloudGaussdbMysqlFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbMysqlFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlFlavorsFlavorsOutputReference { + return new DataHuaweicloudGaussdbMysqlFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors huaweicloud_gaussdb_mysql_flavors} +*/ +export class DataHuaweicloudGaussdbMysqlFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlFlavors to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_flavors huaweicloud_gaussdb_mysql_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZoneMode = config.availabilityZoneMode; + this._engine = config.engine; + this._id = config.id; + this._region = config.region; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone_mode - computed: false, optional: true, required: false + private _availabilityZoneMode?: string; + public get availabilityZoneMode() { + return this.getStringAttribute('availability_zone_mode'); + } + public set availabilityZoneMode(value: string) { + this._availabilityZoneMode = value; + } + public resetAvailabilityZoneMode() { + this._availabilityZoneMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneModeInput() { + return this._availabilityZoneMode; + } + + // engine - computed: false, optional: true, required: false + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + public resetEngine() { + this._engine = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudGaussdbMysqlFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone_mode: cdktf.stringToTerraform(this._availabilityZoneMode), + engine: cdktf.stringToTerraform(this._engine), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone_mode: { + value: cdktf.stringToHclTerraform(this._availabilityZoneMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/README.md new file mode 100644 index 00000000..2d7128de --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_incremental_backups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_incremental_backups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/index.ts new file mode 100644 index 00000000..5eb828d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-incremental-backups/index.ts @@ -0,0 +1,339 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlIncrementalBackupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the query start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups#begin_time DataHuaweicloudGaussdbMysqlIncrementalBackups#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the query end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups#end_time DataHuaweicloudGaussdbMysqlIncrementalBackups#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups#id DataHuaweicloudGaussdbMysqlIncrementalBackups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups#instance_id DataHuaweicloudGaussdbMysqlIncrementalBackups#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups#region DataHuaweicloudGaussdbMysqlIncrementalBackups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlIncrementalBackupsBackups { +} + +export function dataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsToTerraform(struct?: DataHuaweicloudGaussdbMysqlIncrementalBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlIncrementalBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlIncrementalBackupsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlIncrementalBackupsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsOutputReference { + return new DataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups huaweicloud_gaussdb_mysql_incremental_backups} +*/ +export class DataHuaweicloudGaussdbMysqlIncrementalBackups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_incremental_backups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlIncrementalBackups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlIncrementalBackups to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlIncrementalBackups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlIncrementalBackups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_incremental_backups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_incremental_backups huaweicloud_gaussdb_mysql_incremental_backups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlIncrementalBackupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlIncrementalBackupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_incremental_backups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudGaussdbMysqlIncrementalBackupsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/README.md new file mode 100644 index 00000000..5c6d27cb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_instance` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/index.ts new file mode 100644 index 00000000..7efebf34 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instance/index.ts @@ -0,0 +1,571 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance#id DataHuaweicloudGaussdbMysqlInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance#name DataHuaweicloudGaussdbMysqlInstance#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance#region DataHuaweicloudGaussdbMysqlInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance#subnet_id DataHuaweicloudGaussdbMysqlInstance#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance#vpc_id DataHuaweicloudGaussdbMysqlInstance#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbMysqlInstanceBackupStrategy { +} + +export function dataHuaweicloudGaussdbMysqlInstanceBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstanceBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstanceBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstanceBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbMysqlInstanceBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlInstanceDatastore { +} + +export function dataHuaweicloudGaussdbMysqlInstanceDatastoreToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstanceDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstanceDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstanceDatastoreOutputReference { + return new DataHuaweicloudGaussdbMysqlInstanceDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlInstanceNodes { +} + +export function dataHuaweicloudGaussdbMysqlInstanceNodesToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstanceNodesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_read_ip - computed: true, optional: false, required: false + public get privateReadIp() { + return this.getStringAttribute('private_read_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstanceNodesOutputReference { + return new DataHuaweicloudGaussdbMysqlInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance huaweicloud_gaussdb_mysql_instance} +*/ +export class DataHuaweicloudGaussdbMysqlInstance extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlInstance to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instance huaweicloud_gaussdb_mysql_instance} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlInstanceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlInstanceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone_mode - computed: true, optional: false, required: false + public get availabilityZoneMode() { + return this.getStringAttribute('availability_zone_mode'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbMysqlInstanceBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // configuration_id - computed: true, optional: false, required: false + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbMysqlInstanceDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // master_availability_zone - computed: true, optional: false, required: false + public get masterAvailabilityZone() { + return this.getStringAttribute('master_availability_zone'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbMysqlInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_write_ip - computed: true, optional: false, required: false + public get privateWriteIp() { + return this.getStringAttribute('private_write_ip'); + } + + // read_replicas - computed: true, optional: false, required: false + public get readReplicas() { + return this.getNumberAttribute('read_replicas'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/README.md new file mode 100644 index 00000000..0144a505 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/index.ts new file mode 100644 index 00000000..bb3ab108 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instances/index.ts @@ -0,0 +1,707 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances#id DataHuaweicloudGaussdbMysqlInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances#name DataHuaweicloudGaussdbMysqlInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances#region DataHuaweicloudGaussdbMysqlInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances#subnet_id DataHuaweicloudGaussdbMysqlInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances#vpc_id DataHuaweicloudGaussdbMysqlInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategy { +} + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlInstancesInstancesDatastore { +} + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstancesInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstancesInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreOutputReference { + return new DataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlInstancesInstancesNodes { +} + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesNodesToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesNodesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstancesInstancesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstancesInstancesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_read_ip - computed: true, optional: false, required: false + public get privateReadIp() { + return this.getStringAttribute('private_read_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstancesInstancesNodesOutputReference { + return new DataHuaweicloudGaussdbMysqlInstancesInstancesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlInstancesInstances { +} + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstancesInstancesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone_mode - computed: true, optional: false, required: false + public get availabilityZoneMode() { + return this.getStringAttribute('availability_zone_mode'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbMysqlInstancesInstancesBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // configuration_id - computed: true, optional: false, required: false + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbMysqlInstancesInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // master_availability_zone - computed: true, optional: false, required: false + public get masterAvailabilityZone() { + return this.getStringAttribute('master_availability_zone'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbMysqlInstancesInstancesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_dns_name - computed: true, optional: false, required: false + public get privateDnsName() { + return this.getStringAttribute('private_dns_name'); + } + + // private_dns_name_prefix - computed: true, optional: false, required: false + public get privateDnsNamePrefix() { + return this.getStringAttribute('private_dns_name_prefix'); + } + + // private_write_ip - computed: true, optional: false, required: false + public get privateWriteIp() { + return this.getStringAttribute('private_write_ip'); + } + + // read_replicas - computed: true, optional: false, required: false + public get readReplicas() { + return this.getNumberAttribute('read_replicas'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstancesInstancesOutputReference { + return new DataHuaweicloudGaussdbMysqlInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances huaweicloud_gaussdb_mysql_instances} +*/ +export class DataHuaweicloudGaussdbMysqlInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instances huaweicloud_gaussdb_mysql_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudGaussdbMysqlInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/README.md new file mode 100644 index 00000000..3ad9d53e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_instant_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_instant_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/index.ts new file mode 100644 index 00000000..efdf3923 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-instant-tasks/index.ts @@ -0,0 +1,427 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlInstantTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#end_time DataHuaweicloudGaussdbMysqlInstantTasks#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#id DataHuaweicloudGaussdbMysqlInstantTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the task ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#job_id DataHuaweicloudGaussdbMysqlInstantTasks#job_id} + */ + readonly jobId?: string; + /** + * Specifies the task name. Value options: + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#job_name DataHuaweicloudGaussdbMysqlInstantTasks#job_name} + */ + readonly jobName?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#region DataHuaweicloudGaussdbMysqlInstantTasks#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#start_time DataHuaweicloudGaussdbMysqlInstantTasks#start_time} + */ + readonly startTime?: string; + /** + * Specifies the task execution status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#status DataHuaweicloudGaussdbMysqlInstantTasks#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaussdbMysqlInstantTasksJobs { +} + +export function dataHuaweicloudGaussdbMysqlInstantTasksJobsToTerraform(struct?: DataHuaweicloudGaussdbMysqlInstantTasksJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlInstantTasksJobsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlInstantTasksJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlInstantTasksJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlInstantTasksJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlInstantTasksJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_time - computed: true, optional: false, required: false + public get createdTime() { + return this.getStringAttribute('created_time'); + } + + // ended_time - computed: true, optional: false, required: false + public get endedTime() { + return this.getStringAttribute('ended_time'); + } + + // fail_reason - computed: true, optional: false, required: false + public get failReason() { + return this.getStringAttribute('fail_reason'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_status - computed: true, optional: false, required: false + public get instanceStatus() { + return this.getStringAttribute('instance_status'); + } + + // job_id - computed: true, optional: false, required: false + public get jobId() { + return this.getStringAttribute('job_id'); + } + + // job_name - computed: true, optional: false, required: false + public get jobName() { + return this.getStringAttribute('job_name'); + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // process - computed: true, optional: false, required: false + public get process() { + return this.getStringAttribute('process'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudGaussdbMysqlInstantTasksJobsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlInstantTasksJobsOutputReference { + return new DataHuaweicloudGaussdbMysqlInstantTasksJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks huaweicloud_gaussdb_mysql_instant_tasks} +*/ +export class DataHuaweicloudGaussdbMysqlInstantTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instant_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlInstantTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlInstantTasks to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlInstantTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlInstantTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instant_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_instant_tasks huaweicloud_gaussdb_mysql_instant_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlInstantTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlInstantTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instant_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._jobId = config.jobId; + this._jobName = config.jobName; + this._region = config.region; + this._startTime = config.startTime; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: true, required: false + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + public resetJobId() { + this._jobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // job_name - computed: false, optional: true, required: false + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + public resetJobName() { + this._jobName = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // jobs - computed: true, optional: false, required: false + private _jobs = new DataHuaweicloudGaussdbMysqlInstantTasksJobsList(this, "jobs", false); + public get jobs() { + return this._jobs; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + job_name: cdktf.stringToTerraform(this._jobName), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/README.md new file mode 100644 index 00000000..203217c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_project_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_project_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/index.ts new file mode 100644 index 00000000..f74f5842 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-project-quotas/index.ts @@ -0,0 +1,343 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlProjectQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas#id DataHuaweicloudGaussdbMysqlProjectQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas#region DataHuaweicloudGaussdbMysqlProjectQuotas#region} + */ + readonly region?: string; + /** + * Specifies the resource type used to filter quotas. Value options: **instance**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas#type DataHuaweicloudGaussdbMysqlProjectQuotas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResources { +} + +export function dataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesToTerraform(struct?: DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesOutputReference { + return new DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlProjectQuotasQuotas { +} + +export function dataHuaweicloudGaussdbMysqlProjectQuotasQuotasToTerraform(struct?: DataHuaweicloudGaussdbMysqlProjectQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProjectQuotasQuotasToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProjectQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProjectQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProjectQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProjectQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudGaussdbMysqlProjectQuotasQuotasResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudGaussdbMysqlProjectQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProjectQuotasQuotasOutputReference { + return new DataHuaweicloudGaussdbMysqlProjectQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas huaweicloud_gaussdb_mysql_project_quotas} +*/ +export class DataHuaweicloudGaussdbMysqlProjectQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_project_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlProjectQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlProjectQuotas to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlProjectQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlProjectQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_project_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_project_quotas huaweicloud_gaussdb_mysql_project_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlProjectQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlProjectQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_project_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudGaussdbMysqlProjectQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/README.md new file mode 100644 index 00000000..7cd0d9fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_proxies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_proxies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/index.ts new file mode 100644 index 00000000..72f859fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxies/index.ts @@ -0,0 +1,647 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlProxiesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies#id DataHuaweicloudGaussdbMysqlProxies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies#instance_id DataHuaweicloudGaussdbMysqlProxies#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies#region DataHuaweicloudGaussdbMysqlProxies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeight { +} + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightToTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeight | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeight | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightOutputReference { + return new DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlProxiesProxyListNodes { +} + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListNodesToTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListNodesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProxiesProxyListNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProxiesProxyListNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // frozen_flag - computed: true, optional: false, required: false + public get frozenFlag() { + return this.getNumberAttribute('frozen_flag'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProxiesProxyListNodesOutputReference { + return new DataHuaweicloudGaussdbMysqlProxiesProxyListNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeight { +} + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightToTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeight | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeight | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightOutputReference { + return new DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlProxiesProxyListStruct { +} + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListStructToTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProxiesProxyListStructToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProxiesProxyListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProxiesProxyListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProxiesProxyListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // balance_route_mode_enabled - computed: true, optional: false, required: false + public get balanceRouteModeEnabled() { + return this.getBooleanAttribute('balance_route_mode_enabled'); + } + + // connection_pool_type - computed: true, optional: false, required: false + public get connectionPoolType() { + return this.getStringAttribute('connection_pool_type'); + } + + // consistence_mode - computed: true, optional: false, required: false + public get consistenceMode() { + return this.getStringAttribute('consistence_mode'); + } + + // delay_threshold_in_seconds - computed: true, optional: false, required: false + public get delayThresholdInSeconds() { + return this.getNumberAttribute('delay_threshold_in_seconds'); + } + + // elb_vip - computed: true, optional: false, required: false + public get elbVip() { + return this.getStringAttribute('elb_vip'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // master_node_weight - computed: true, optional: false, required: false + private _masterNodeWeight = new DataHuaweicloudGaussdbMysqlProxiesProxyListMasterNodeWeightList(this, "master_node_weight", false); + public get masterNodeWeight() { + return this._masterNodeWeight; + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // new_node_auto_add_status - computed: true, optional: false, required: false + public get newNodeAutoAddStatus() { + return this.getStringAttribute('new_node_auto_add_status'); + } + + // new_node_weight - computed: true, optional: false, required: false + public get newNodeWeight() { + return this.getNumberAttribute('new_node_weight'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbMysqlProxiesProxyListNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getStringAttribute('ram'); + } + + // readonly_nodes_weight - computed: true, optional: false, required: false + private _readonlyNodesWeight = new DataHuaweicloudGaussdbMysqlProxiesProxyListReadonlyNodesWeightList(this, "readonly_nodes_weight", false); + public get readonlyNodesWeight() { + return this._readonlyNodesWeight; + } + + // route_mode - computed: true, optional: false, required: false + public get routeMode() { + return this.getNumberAttribute('route_mode'); + } + + // ssl_option - computed: true, optional: false, required: false + public get sslOption() { + return this.getStringAttribute('ssl_option'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // switch_connection_pool_type_enabled - computed: true, optional: false, required: false + public get switchConnectionPoolTypeEnabled() { + return this.getBooleanAttribute('switch_connection_pool_type_enabled'); + } + + // transaction_split - computed: true, optional: false, required: false + public get transactionSplit() { + return this.getStringAttribute('transaction_split'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudGaussdbMysqlProxiesProxyListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProxiesProxyListStructOutputReference { + return new DataHuaweicloudGaussdbMysqlProxiesProxyListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies huaweicloud_gaussdb_mysql_proxies} +*/ +export class DataHuaweicloudGaussdbMysqlProxies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_proxies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlProxies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlProxies to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlProxies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlProxies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_proxies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxies huaweicloud_gaussdb_mysql_proxies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlProxiesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlProxiesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_proxies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // proxy_list - computed: true, optional: false, required: false + private _proxyList = new DataHuaweicloudGaussdbMysqlProxiesProxyListStructList(this, "proxy_list", false); + public get proxyList() { + return this._proxyList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/README.md new file mode 100644 index 00000000..b50fe8c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_proxy_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_proxy_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/index.ts new file mode 100644 index 00000000..a34c4102 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-proxy-flavors/index.ts @@ -0,0 +1,361 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlProxyFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors#id DataHuaweicloudGaussdbMysqlProxyFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of GaussDB MySQL Instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors#instance_id DataHuaweicloudGaussdbMysqlProxyFlavors#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors#region DataHuaweicloudGaussdbMysqlProxyFlavors#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavors { +} + +export function dataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsToTerraform(struct?: DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // db_type - computed: true, optional: false, required: false + public get dbType() { + return this.getStringAttribute('db_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getStringAttribute('ram'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsOutputReference { + return new DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroups { +} + +export function dataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsToTerraform(struct?: DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsOutputReference { + return new DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors huaweicloud_gaussdb_mysql_proxy_flavors} +*/ +export class DataHuaweicloudGaussdbMysqlProxyFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_proxy_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlProxyFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlProxyFlavors to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlProxyFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlProxyFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_proxy_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_proxy_flavors huaweicloud_gaussdb_mysql_proxy_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlProxyFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlProxyFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_proxy_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavor_groups - computed: true, optional: false, required: false + private _flavorGroups = new DataHuaweicloudGaussdbMysqlProxyFlavorsFlavorGroupsList(this, "flavor_groups", false); + public get flavorGroups() { + return this._flavorGroups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/README.md new file mode 100644 index 00000000..7d50dc1d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_pt_applicable_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_pt_applicable_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/index.ts new file mode 100644 index 00000000..b26bb783 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-applicable-instances/index.ts @@ -0,0 +1,259 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlPtApplicableInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances#configuration_id DataHuaweicloudGaussdbMysqlPtApplicableInstances#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances#id DataHuaweicloudGaussdbMysqlPtApplicableInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances#region DataHuaweicloudGaussdbMysqlPtApplicableInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstances { +} + +export function dataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesToTerraform(struct?: DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } +} + +export class DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesOutputReference { + return new DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances huaweicloud_gaussdb_mysql_pt_applicable_instances} +*/ +export class DataHuaweicloudGaussdbMysqlPtApplicableInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_pt_applicable_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlPtApplicableInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlPtApplicableInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlPtApplicableInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlPtApplicableInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_pt_applicable_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_applicable_instances huaweicloud_gaussdb_mysql_pt_applicable_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlPtApplicableInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlPtApplicableInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_pt_applicable_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudGaussdbMysqlPtApplicableInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/README.md new file mode 100644 index 00000000..2c7ca348 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_pt_apply_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_pt_apply_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/index.ts new file mode 100644 index 00000000..260eb663 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-apply-records/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlPtApplyRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records#config_id DataHuaweicloudGaussdbMysqlPtApplyRecords#config_id} + */ + readonly configId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records#id DataHuaweicloudGaussdbMysqlPtApplyRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records#region DataHuaweicloudGaussdbMysqlPtApplyRecords#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlPtApplyRecordsHistories { +} + +export function dataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesToTerraform(struct?: DataHuaweicloudGaussdbMysqlPtApplyRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlPtApplyRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlPtApplyRecordsHistories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlPtApplyRecordsHistories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // applied_at - computed: true, optional: false, required: false + public get appliedAt() { + return this.getStringAttribute('applied_at'); + } + + // apply_result - computed: true, optional: false, required: false + public get applyResult() { + return this.getStringAttribute('apply_result'); + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // target_id - computed: true, optional: false, required: false + public get targetId() { + return this.getStringAttribute('target_id'); + } + + // target_name - computed: true, optional: false, required: false + public get targetName() { + return this.getStringAttribute('target_name'); + } +} + +export class DataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesOutputReference { + return new DataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records huaweicloud_gaussdb_mysql_pt_apply_records} +*/ +export class DataHuaweicloudGaussdbMysqlPtApplyRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_pt_apply_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlPtApplyRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlPtApplyRecords to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlPtApplyRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlPtApplyRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_pt_apply_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_apply_records huaweicloud_gaussdb_mysql_pt_apply_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlPtApplyRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlPtApplyRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_pt_apply_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configId = config.configId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // config_id - computed: false, optional: false, required: true + private _configId?: string; + public get configId() { + return this.getStringAttribute('config_id'); + } + public set configId(value: string) { + this._configId = value; + } + // Temporarily expose input value. Use with caution. + public get configIdInput() { + return this._configId; + } + + // histories - computed: true, optional: false, required: false + private _histories = new DataHuaweicloudGaussdbMysqlPtApplyRecordsHistoriesList(this, "histories", false); + public get histories() { + return this._histories; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + config_id: cdktf.stringToTerraform(this._configId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + config_id: { + value: cdktf.stringToHclTerraform(this._configId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/README.md new file mode 100644 index 00000000..1b56765c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_pt_modify_records` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_pt_modify_records`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/index.ts new file mode 100644 index 00000000..f276b5e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-pt-modify-records/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlPtModifyRecordsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records#configuration_id DataHuaweicloudGaussdbMysqlPtModifyRecords#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records#id DataHuaweicloudGaussdbMysqlPtModifyRecords#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records#region DataHuaweicloudGaussdbMysqlPtModifyRecords#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlPtModifyRecordsHistories { +} + +export function dataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesToTerraform(struct?: DataHuaweicloudGaussdbMysqlPtModifyRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlPtModifyRecordsHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlPtModifyRecordsHistories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlPtModifyRecordsHistories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // applied - computed: true, optional: false, required: false + public get applied() { + return this.getStringAttribute('applied'); + } + + // is_applied - computed: true, optional: false, required: false + public get isApplied() { + return this.getBooleanAttribute('is_applied'); + } + + // new_value - computed: true, optional: false, required: false + public get newValue() { + return this.getStringAttribute('new_value'); + } + + // old_value - computed: true, optional: false, required: false + public get oldValue() { + return this.getStringAttribute('old_value'); + } + + // parameter_name - computed: true, optional: false, required: false + public get parameterName() { + return this.getStringAttribute('parameter_name'); + } + + // update_result - computed: true, optional: false, required: false + public get updateResult() { + return this.getStringAttribute('update_result'); + } + + // updated - computed: true, optional: false, required: false + public get updated() { + return this.getStringAttribute('updated'); + } +} + +export class DataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesOutputReference { + return new DataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records huaweicloud_gaussdb_mysql_pt_modify_records} +*/ +export class DataHuaweicloudGaussdbMysqlPtModifyRecords extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_pt_modify_records"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlPtModifyRecords resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlPtModifyRecords to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlPtModifyRecords that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlPtModifyRecords to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_pt_modify_records", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_pt_modify_records huaweicloud_gaussdb_mysql_pt_modify_records} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlPtModifyRecordsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlPtModifyRecordsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_pt_modify_records', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // histories - computed: true, optional: false, required: false + private _histories = new DataHuaweicloudGaussdbMysqlPtModifyRecordsHistoriesList(this, "histories", false); + public get histories() { + return this._histories; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/README.md new file mode 100644 index 00000000..d0498fba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_recycling_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_recycling_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/index.ts new file mode 100644 index 00000000..bdc3e77b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-recycling-instances/index.ts @@ -0,0 +1,307 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlRecyclingInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances#id DataHuaweicloudGaussdbMysqlRecyclingInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances#region DataHuaweicloudGaussdbMysqlRecyclingInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlRecyclingInstancesInstances { +} + +export function dataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesToTerraform(struct?: DataHuaweicloudGaussdbMysqlRecyclingInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlRecyclingInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlRecyclingInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlRecyclingInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backup_level - computed: true, optional: false, required: false + public get backupLevel() { + return this.getStringAttribute('backup_level'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getNumberAttribute('create_at'); + } + + // data_vip - computed: true, optional: false, required: false + public get dataVip() { + return this.getStringAttribute('data_vip'); + } + + // data_vip_ipv6 - computed: true, optional: false, required: false + public get dataVipIpv6() { + return this.getStringAttribute('data_vip_ipv6'); + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getNumberAttribute('deleted_at'); + } + + // engine_name - computed: true, optional: false, required: false + public get engineName() { + return this.getStringAttribute('engine_name'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // enterprise_project_name - computed: true, optional: false, required: false + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + + // ha_mode - computed: true, optional: false, required: false + public get haMode() { + return this.getStringAttribute('ha_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // pay_model - computed: true, optional: false, required: false + public get payModel() { + return this.getStringAttribute('pay_model'); + } + + // recycle_backup_id - computed: true, optional: false, required: false + public get recycleBackupId() { + return this.getStringAttribute('recycle_backup_id'); + } + + // recycle_status - computed: true, optional: false, required: false + public get recycleStatus() { + return this.getStringAttribute('recycle_status'); + } + + // volume_size - computed: true, optional: false, required: false + public get volumeSize() { + return this.getStringAttribute('volume_size'); + } + + // volume_type - computed: true, optional: false, required: false + public get volumeType() { + return this.getStringAttribute('volume_type'); + } +} + +export class DataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesOutputReference { + return new DataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances huaweicloud_gaussdb_mysql_recycling_instances} +*/ +export class DataHuaweicloudGaussdbMysqlRecyclingInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_recycling_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlRecyclingInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlRecyclingInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlRecyclingInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlRecyclingInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_recycling_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_recycling_instances huaweicloud_gaussdb_mysql_recycling_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlRecyclingInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlRecyclingInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_recycling_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudGaussdbMysqlRecyclingInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/README.md new file mode 100644 index 00000000..216e60e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_restore_time_ranges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_restore_time_ranges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/index.ts new file mode 100644 index 00000000..d82d21c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restore-time-ranges/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlRestoreTimeRangesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the date to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges#date DataHuaweicloudGaussdbMysqlRestoreTimeRanges#date} + */ + readonly date?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges#id DataHuaweicloudGaussdbMysqlRestoreTimeRanges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges#instance_id DataHuaweicloudGaussdbMysqlRestoreTimeRanges#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges#region DataHuaweicloudGaussdbMysqlRestoreTimeRanges#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimes { +} + +export function dataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesToTerraform(struct?: DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getNumberAttribute('end_time'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getNumberAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesOutputReference { + return new DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges huaweicloud_gaussdb_mysql_restore_time_ranges} +*/ +export class DataHuaweicloudGaussdbMysqlRestoreTimeRanges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_restore_time_ranges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlRestoreTimeRanges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlRestoreTimeRanges to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlRestoreTimeRanges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlRestoreTimeRanges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_restore_time_ranges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restore_time_ranges huaweicloud_gaussdb_mysql_restore_time_ranges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlRestoreTimeRangesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlRestoreTimeRangesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_restore_time_ranges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._date = config.date; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // date - computed: false, optional: true, required: false + private _date?: string; + public get date() { + return this.getStringAttribute('date'); + } + public set date(value: string) { + this._date = value; + } + public resetDate() { + this._date = undefined; + } + // Temporarily expose input value. Use with caution. + public get dateInput() { + return this._date; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_times - computed: true, optional: false, required: false + private _restoreTimes = new DataHuaweicloudGaussdbMysqlRestoreTimeRangesRestoreTimesList(this, "restore_times", false); + public get restoreTimes() { + return this._restoreTimes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + date: cdktf.stringToTerraform(this._date), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + date: { + value: cdktf.stringToHclTerraform(this._date), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/README.md new file mode 100644 index 00000000..7d177b89 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_restored_tables` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_restored_tables`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/index.ts new file mode 100644 index 00000000..1e181c13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-restored-tables/index.ts @@ -0,0 +1,454 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlRestoredTablesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name, which is used for fuzzy match. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#database_name DataHuaweicloudGaussdbMysqlRestoredTables#database_name} + */ + readonly databaseName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#id DataHuaweicloudGaussdbMysqlRestoredTables#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance, + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#instance_id DataHuaweicloudGaussdbMysqlRestoredTables#instance_id} + */ + readonly instanceId: string; + /** + * Specifies whether data is restored to the most recent table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#last_table_info DataHuaweicloudGaussdbMysqlRestoredTables#last_table_info} + */ + readonly lastTableInfo: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#region DataHuaweicloudGaussdbMysqlRestoredTables#region} + */ + readonly region?: string; + /** + * Specifies the backup time, in timestamp format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#restore_time DataHuaweicloudGaussdbMysqlRestoredTables#restore_time} + */ + readonly restoreTime: string; + /** + * Specifies the table name, which is used for fuzzy match. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#table_name DataHuaweicloudGaussdbMysqlRestoredTables#table_name} + */ + readonly tableName?: string; +} +export interface DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTables { +} + +export function dataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesToTerraform(struct?: DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesOutputReference { + return new DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbMysqlRestoredTablesDatabases { +} + +export function dataHuaweicloudGaussdbMysqlRestoredTablesDatabasesToTerraform(struct?: DataHuaweicloudGaussdbMysqlRestoredTablesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlRestoredTablesDatabasesToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlRestoredTablesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlRestoredTablesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlRestoredTablesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tables - computed: true, optional: false, required: false + private _tables = new DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesTablesList(this, "tables", false); + public get tables() { + return this._tables; + } + + // total_tables - computed: true, optional: false, required: false + public get totalTables() { + return this.getNumberAttribute('total_tables'); + } +} + +export class DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesOutputReference { + return new DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables huaweicloud_gaussdb_mysql_restored_tables} +*/ +export class DataHuaweicloudGaussdbMysqlRestoredTables extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_restored_tables"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlRestoredTables resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlRestoredTables to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlRestoredTables that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlRestoredTables to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_restored_tables", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_restored_tables huaweicloud_gaussdb_mysql_restored_tables} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlRestoredTablesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlRestoredTablesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_restored_tables', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseName = config.databaseName; + this._id = config.id; + this._instanceId = config.instanceId; + this._lastTableInfo = config.lastTableInfo; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._tableName = config.tableName; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_name - computed: false, optional: true, required: false + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudGaussdbMysqlRestoredTablesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // last_table_info - computed: false, optional: false, required: true + private _lastTableInfo?: string; + public get lastTableInfo() { + return this.getStringAttribute('last_table_info'); + } + public set lastTableInfo(value: string) { + this._lastTableInfo = value; + } + // Temporarily expose input value. Use with caution. + public get lastTableInfoInput() { + return this._lastTableInfo; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // table_name - computed: false, optional: true, required: false + private _tableName?: string; + public get tableName() { + return this.getStringAttribute('table_name'); + } + public set tableName(value: string) { + this._tableName = value; + } + public resetTableName() { + this._tableName = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableNameInput() { + return this._tableName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name: cdktf.stringToTerraform(this._databaseName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + last_table_info: cdktf.stringToTerraform(this._lastTableInfo), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + table_name: cdktf.stringToTerraform(this._tableName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_table_info: { + value: cdktf.stringToHclTerraform(this._lastTableInfo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_name: { + value: cdktf.stringToHclTerraform(this._tableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/README.md new file mode 100644 index 00000000..6f85de65 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_scheduled_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_scheduled_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/index.ts new file mode 100644 index 00000000..0a9b5b15 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-scheduled-tasks/index.ts @@ -0,0 +1,359 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlScheduledTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks#id DataHuaweicloudGaussdbMysqlScheduledTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks#job_id DataHuaweicloudGaussdbMysqlScheduledTasks#job_id} + */ + readonly jobId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks#job_name DataHuaweicloudGaussdbMysqlScheduledTasks#job_name} + */ + readonly jobName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks#region DataHuaweicloudGaussdbMysqlScheduledTasks#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks#status DataHuaweicloudGaussdbMysqlScheduledTasks#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudGaussdbMysqlScheduledTasksTasks { +} + +export function dataHuaweicloudGaussdbMysqlScheduledTasksTasksToTerraform(struct?: DataHuaweicloudGaussdbMysqlScheduledTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlScheduledTasksTasksToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlScheduledTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlScheduledTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlScheduledTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlScheduledTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // datastore_type - computed: true, optional: false, required: false + public get datastoreType() { + return this.getStringAttribute('datastore_type'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_status - computed: true, optional: false, required: false + public get instanceStatus() { + return this.getStringAttribute('instance_status'); + } + + // job_id - computed: true, optional: false, required: false + public get jobId() { + return this.getStringAttribute('job_id'); + } + + // job_name - computed: true, optional: false, required: false + public get jobName() { + return this.getStringAttribute('job_name'); + } + + // job_status - computed: true, optional: false, required: false + public get jobStatus() { + return this.getStringAttribute('job_status'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbMysqlScheduledTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlScheduledTasksTasksOutputReference { + return new DataHuaweicloudGaussdbMysqlScheduledTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks huaweicloud_gaussdb_mysql_scheduled_tasks} +*/ +export class DataHuaweicloudGaussdbMysqlScheduledTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_scheduled_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlScheduledTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlScheduledTasks to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlScheduledTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlScheduledTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_scheduled_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_scheduled_tasks huaweicloud_gaussdb_mysql_scheduled_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlScheduledTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlScheduledTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_scheduled_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._jobId = config.jobId; + this._jobName = config.jobName; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: true, required: false + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + public resetJobId() { + this._jobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // job_name - computed: false, optional: true, required: false + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + public resetJobName() { + this._jobName = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudGaussdbMysqlScheduledTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + job_name: cdktf.stringToTerraform(this._jobName), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/README.md new file mode 100644 index 00000000..a554881f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_mysql_slow_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_mysql_slow_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/index.ts new file mode 100644 index 00000000..dd0653f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-mysql-slow-logs/index.ts @@ -0,0 +1,450 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbMysqlSlowLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database that slow query logs belong to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#database DataHuaweicloudGaussdbMysqlSlowLogs#database} + */ + readonly database?: string; + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#end_time DataHuaweicloudGaussdbMysqlSlowLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#id DataHuaweicloudGaussdbMysqlSlowLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#instance_id DataHuaweicloudGaussdbMysqlSlowLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the instance node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#node_id DataHuaweicloudGaussdbMysqlSlowLogs#node_id} + */ + readonly nodeId: string; + /** + * Specifies the SQL statement type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#operate_type DataHuaweicloudGaussdbMysqlSlowLogs#operate_type} + */ + readonly operateType?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#region DataHuaweicloudGaussdbMysqlSlowLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#start_time DataHuaweicloudGaussdbMysqlSlowLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStruct { +} + +export function dataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructToTerraform(struct?: DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructToHclTerraform(struct?: DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_ip - computed: true, optional: false, required: false + public get clientIp() { + return this.getStringAttribute('client_ip'); + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getStringAttribute('count'); + } + + // database - computed: true, optional: false, required: false + public get database() { + return this.getStringAttribute('database'); + } + + // lock_time - computed: true, optional: false, required: false + public get lockTime() { + return this.getStringAttribute('lock_time'); + } + + // node_id - computed: true, optional: false, required: false + public get nodeId() { + return this.getStringAttribute('node_id'); + } + + // query_sample - computed: true, optional: false, required: false + public get querySample() { + return this.getStringAttribute('query_sample'); + } + + // rows_examined - computed: true, optional: false, required: false + public get rowsExamined() { + return this.getStringAttribute('rows_examined'); + } + + // rows_sent - computed: true, optional: false, required: false + public get rowsSent() { + return this.getStringAttribute('rows_sent'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // users - computed: true, optional: false, required: false + public get users() { + return this.getStringAttribute('users'); + } +} + +export class DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructOutputReference { + return new DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs huaweicloud_gaussdb_mysql_slow_logs} +*/ +export class DataHuaweicloudGaussdbMysqlSlowLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_slow_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbMysqlSlowLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbMysqlSlowLogs to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbMysqlSlowLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbMysqlSlowLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_slow_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_mysql_slow_logs huaweicloud_gaussdb_mysql_slow_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbMysqlSlowLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbMysqlSlowLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_slow_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._database = config.database; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._operateType = config.operateType; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // database - computed: false, optional: true, required: false + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + public resetDatabase() { + this._database = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // operate_type - computed: false, optional: true, required: false + private _operateType?: string; + public get operateType() { + return this.getStringAttribute('operate_type'); + } + public set operateType(value: string) { + this._operateType = value; + } + public resetOperateType() { + this._operateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get operateTypeInput() { + return this._operateType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // slow_log_list - computed: true, optional: false, required: false + private _slowLogList = new DataHuaweicloudGaussdbMysqlSlowLogsSlowLogListStructList(this, "slow_log_list", false); + public get slowLogList() { + return this._slowLogList; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database: cdktf.stringToTerraform(this._database), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + operate_type: cdktf.stringToTerraform(this._operateType), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database: { + value: cdktf.stringToHclTerraform(this._database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operate_type: { + value: cdktf.stringToHclTerraform(this._operateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/README.md new file mode 100644 index 00000000..56fcb979 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_nosql_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_nosql_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/index.ts new file mode 100644 index 00000000..e00d821d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-nosql-flavors/index.ts @@ -0,0 +1,390 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbNosqlFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#availability_zone DataHuaweicloudGaussdbNosqlFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#engine DataHuaweicloudGaussdbNosqlFlavors#engine} + */ + readonly engine?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#engine_version DataHuaweicloudGaussdbNosqlFlavors#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#id DataHuaweicloudGaussdbNosqlFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#memory DataHuaweicloudGaussdbNosqlFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#region DataHuaweicloudGaussdbNosqlFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#vcpus DataHuaweicloudGaussdbNosqlFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudGaussdbNosqlFlavorsFlavors { +} + +export function dataHuaweicloudGaussdbNosqlFlavorsFlavorsToTerraform(struct?: DataHuaweicloudGaussdbNosqlFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbNosqlFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudGaussdbNosqlFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbNosqlFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbNosqlFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbNosqlFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudGaussdbNosqlFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbNosqlFlavorsFlavorsOutputReference { + return new DataHuaweicloudGaussdbNosqlFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors huaweicloud_gaussdb_nosql_flavors} +*/ +export class DataHuaweicloudGaussdbNosqlFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_nosql_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbNosqlFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbNosqlFlavors to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbNosqlFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbNosqlFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_nosql_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_nosql_flavors huaweicloud_gaussdb_nosql_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbNosqlFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbNosqlFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_nosql_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // engine - computed: false, optional: true, required: false + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + public resetEngine() { + this._engine = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudGaussdbNosqlFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/README.md new file mode 100644 index 00000000..e51ee8d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_opengauss_instance` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_opengauss_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/index.ts new file mode 100644 index 00000000..1122fa90 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instance/index.ts @@ -0,0 +1,748 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbOpengaussInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance#id DataHuaweicloudGaussdbOpengaussInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance#name DataHuaweicloudGaussdbOpengaussInstance#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance#region DataHuaweicloudGaussdbOpengaussInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance#subnet_id DataHuaweicloudGaussdbOpengaussInstance#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance#vpc_id DataHuaweicloudGaussdbOpengaussInstance#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbOpengaussInstanceBackupStrategy { +} + +export function dataHuaweicloudGaussdbOpengaussInstanceBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstanceBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstanceBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstanceBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstanceBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstanceDatastore { +} + +export function dataHuaweicloudGaussdbOpengaussInstanceDatastoreToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstanceDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstanceDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstanceDatastoreOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstanceDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstanceHa { +} + +export function dataHuaweicloudGaussdbOpengaussInstanceHaToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceHa): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstanceHaToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceHa): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstanceHaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstanceHa | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstanceHa | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // replication_mode - computed: true, optional: false, required: false + public get replicationMode() { + return this.getStringAttribute('replication_mode'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstanceHaList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstanceHaOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstanceHaOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstanceNodes { +} + +export function dataHuaweicloudGaussdbOpengaussInstanceNodesToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstanceNodesToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstanceNodesOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstanceVolume { +} + +export function dataHuaweicloudGaussdbOpengaussInstanceVolumeToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstanceVolumeToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstanceVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstanceVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstanceVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstanceVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstanceVolumeOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstanceVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance huaweicloud_gaussdb_opengauss_instance} +*/ +export class DataHuaweicloudGaussdbOpengaussInstance extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_opengauss_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbOpengaussInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbOpengaussInstance to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbOpengaussInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbOpengaussInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_opengauss_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instance huaweicloud_gaussdb_opengauss_instance} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbOpengaussInstanceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbOpengaussInstanceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_opengauss_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbOpengaussInstanceBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // coordinator_num - computed: true, optional: false, required: false + public get coordinatorNum() { + return this.getNumberAttribute('coordinator_num'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbOpengaussInstanceDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // ha - computed: true, optional: false, required: false + private _ha = new DataHuaweicloudGaussdbOpengaussInstanceHaList(this, "ha", false); + public get ha() { + return this._ha; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintenance_window - computed: true, optional: false, required: false + public get maintenanceWindow() { + return this.getStringAttribute('maintenance_window'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbOpengaussInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replica_num - computed: true, optional: false, required: false + public get replicaNum() { + return this.getNumberAttribute('replica_num'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // sharding_num - computed: true, optional: false, required: false + public get shardingNum() { + return this.getNumberAttribute('sharding_num'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // switch_strategy - computed: true, optional: false, required: false + public get switchStrategy() { + return this.getStringAttribute('switch_strategy'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume - computed: true, optional: false, required: false + private _volume = new DataHuaweicloudGaussdbOpengaussInstanceVolumeList(this, "volume", false); + public get volume() { + return this._volume; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/README.md new file mode 100644 index 00000000..d943b1ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_opengauss_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_opengauss_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/index.ts new file mode 100644 index 00000000..e6db8877 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-opengauss-instances/index.ts @@ -0,0 +1,849 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbOpengaussInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances#id DataHuaweicloudGaussdbOpengaussInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances#name DataHuaweicloudGaussdbOpengaussInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances#region DataHuaweicloudGaussdbOpengaussInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances#subnet_id DataHuaweicloudGaussdbOpengaussInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances#vpc_id DataHuaweicloudGaussdbOpengaussInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategy { +} + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastore { +} + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstancesInstancesHa { +} + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesHaToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesHa): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesHaToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesHa): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesHaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstancesInstancesHa | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstancesInstancesHa | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // replication_mode - computed: true, optional: false, required: false + public get replicationMode() { + return this.getStringAttribute('replication_mode'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesHaList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstancesInstancesHaOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstancesInstancesHaOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstancesInstancesNodes { +} + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesNodesToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesNodesToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstancesInstancesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstancesInstancesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstancesInstancesNodesOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstancesInstancesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstancesInstancesVolume { +} + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstancesVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstancesInstancesVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstancesInstancesVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbOpengaussInstancesInstances { +} + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesToTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbOpengaussInstancesInstancesToHclTerraform(struct?: DataHuaweicloudGaussdbOpengaussInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbOpengaussInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbOpengaussInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbOpengaussInstancesInstancesBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // coordinator_num - computed: true, optional: false, required: false + public get coordinatorNum() { + return this.getNumberAttribute('coordinator_num'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbOpengaussInstancesInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // ha - computed: true, optional: false, required: false + private _ha = new DataHuaweicloudGaussdbOpengaussInstancesInstancesHaList(this, "ha", false); + public get ha() { + return this._ha; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // maintenance_window - computed: true, optional: false, required: false + public get maintenanceWindow() { + return this.getStringAttribute('maintenance_window'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbOpengaussInstancesInstancesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // replica_num - computed: true, optional: false, required: false + public get replicaNum() { + return this.getNumberAttribute('replica_num'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // sharding_num - computed: true, optional: false, required: false + public get shardingNum() { + return this.getNumberAttribute('sharding_num'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // switch_strategy - computed: true, optional: false, required: false + public get switchStrategy() { + return this.getStringAttribute('switch_strategy'); + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume - computed: true, optional: false, required: false + private _volume = new DataHuaweicloudGaussdbOpengaussInstancesInstancesVolumeList(this, "volume", false); + public get volume() { + return this._volume; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudGaussdbOpengaussInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbOpengaussInstancesInstancesOutputReference { + return new DataHuaweicloudGaussdbOpengaussInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances huaweicloud_gaussdb_opengauss_instances} +*/ +export class DataHuaweicloudGaussdbOpengaussInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_opengauss_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbOpengaussInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbOpengaussInstances to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbOpengaussInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbOpengaussInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_opengauss_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_opengauss_instances huaweicloud_gaussdb_opengauss_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbOpengaussInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbOpengaussInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_opengauss_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudGaussdbOpengaussInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/README.md new file mode 100644 index 00000000..8623eb1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_redis_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_redis_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/index.ts new file mode 100644 index 00000000..04b7c701 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-flavors/index.ts @@ -0,0 +1,251 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbRedisFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors#id DataHuaweicloudGaussdbRedisFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors#region DataHuaweicloudGaussdbRedisFlavors#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudGaussdbRedisFlavorsFlavors { +} + +export function dataHuaweicloudGaussdbRedisFlavorsFlavorsToTerraform(struct?: DataHuaweicloudGaussdbRedisFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbRedisFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudGaussdbRedisFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbRedisFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbRedisFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbRedisFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // engine_name - computed: true, optional: false, required: false + public get engineName() { + return this.getStringAttribute('engine_name'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // ram - computed: true, optional: false, required: false + public get ram() { + return this.getStringAttribute('ram'); + } + + // spec_code - computed: true, optional: false, required: false + public get specCode() { + return this.getStringAttribute('spec_code'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudGaussdbRedisFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbRedisFlavorsFlavorsOutputReference { + return new DataHuaweicloudGaussdbRedisFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors huaweicloud_gaussdb_redis_flavors} +*/ +export class DataHuaweicloudGaussdbRedisFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_redis_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbRedisFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbRedisFlavors to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbRedisFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbRedisFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_redis_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_flavors huaweicloud_gaussdb_redis_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbRedisFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbRedisFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_redis_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudGaussdbRedisFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/README.md new file mode 100644 index 00000000..2f09bae0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_gaussdb_redis_instance` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_gaussdb_redis_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/index.ts new file mode 100644 index 00000000..4b111811 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-gaussdb-redis-instance/index.ts @@ -0,0 +1,572 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGaussdbRedisInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance#id DataHuaweicloudGaussdbRedisInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance#name DataHuaweicloudGaussdbRedisInstance#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance#region DataHuaweicloudGaussdbRedisInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance#subnet_id DataHuaweicloudGaussdbRedisInstance#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance#vpc_id DataHuaweicloudGaussdbRedisInstance#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudGaussdbRedisInstanceBackupStrategy { +} + +export function dataHuaweicloudGaussdbRedisInstanceBackupStrategyToTerraform(struct?: DataHuaweicloudGaussdbRedisInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbRedisInstanceBackupStrategyToHclTerraform(struct?: DataHuaweicloudGaussdbRedisInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbRedisInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbRedisInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbRedisInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudGaussdbRedisInstanceBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbRedisInstanceBackupStrategyOutputReference { + return new DataHuaweicloudGaussdbRedisInstanceBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbRedisInstanceDatastore { +} + +export function dataHuaweicloudGaussdbRedisInstanceDatastoreToTerraform(struct?: DataHuaweicloudGaussdbRedisInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbRedisInstanceDatastoreToHclTerraform(struct?: DataHuaweicloudGaussdbRedisInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbRedisInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbRedisInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbRedisInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // storage_engine - computed: true, optional: false, required: false + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudGaussdbRedisInstanceDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbRedisInstanceDatastoreOutputReference { + return new DataHuaweicloudGaussdbRedisInstanceDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGaussdbRedisInstanceNodes { +} + +export function dataHuaweicloudGaussdbRedisInstanceNodesToTerraform(struct?: DataHuaweicloudGaussdbRedisInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGaussdbRedisInstanceNodesToHclTerraform(struct?: DataHuaweicloudGaussdbRedisInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGaussdbRedisInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGaussdbRedisInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGaussdbRedisInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class DataHuaweicloudGaussdbRedisInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGaussdbRedisInstanceNodesOutputReference { + return new DataHuaweicloudGaussdbRedisInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance huaweicloud_gaussdb_redis_instance} +*/ +export class DataHuaweicloudGaussdbRedisInstance extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_redis_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGaussdbRedisInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGaussdbRedisInstance to import + * @param importFromId The id of the existing DataHuaweicloudGaussdbRedisInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGaussdbRedisInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_redis_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/gaussdb_redis_instance huaweicloud_gaussdb_redis_instance} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGaussdbRedisInstanceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGaussdbRedisInstanceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_redis_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudGaussdbRedisInstanceBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudGaussdbRedisInstanceDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudGaussdbRedisInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // volume_size - computed: true, optional: false, required: false + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/README.md new file mode 100644 index 00000000..c3b0f3fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_global_eip_access_sites` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_global_eip_access_sites`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/index.ts new file mode 100644 index 00000000..86645091 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-access-sites/index.ts @@ -0,0 +1,316 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGlobalEipAccessSitesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites#id DataHuaweicloudGlobalEipAccessSites#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites#iec_az_code DataHuaweicloudGlobalEipAccessSites#iec_az_code} + */ + readonly iecAzCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites#name DataHuaweicloudGlobalEipAccessSites#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites#proxy_region DataHuaweicloudGlobalEipAccessSites#proxy_region} + */ + readonly proxyRegion?: string; +} +export interface DataHuaweicloudGlobalEipAccessSitesAccessSites { +} + +export function dataHuaweicloudGlobalEipAccessSitesAccessSitesToTerraform(struct?: DataHuaweicloudGlobalEipAccessSitesAccessSites): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGlobalEipAccessSitesAccessSitesToHclTerraform(struct?: DataHuaweicloudGlobalEipAccessSitesAccessSites): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGlobalEipAccessSitesAccessSitesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGlobalEipAccessSitesAccessSites | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGlobalEipAccessSitesAccessSites | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cn_name - computed: true, optional: false, required: false + public get cnName() { + return this.getStringAttribute('cn_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // en_name - computed: true, optional: false, required: false + public get enName() { + return this.getStringAttribute('en_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // iec_az_code - computed: true, optional: false, required: false + public get iecAzCode() { + return this.getStringAttribute('iec_az_code'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // proxy_region - computed: true, optional: false, required: false + public get proxyRegion() { + return this.getStringAttribute('proxy_region'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGlobalEipAccessSitesAccessSitesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGlobalEipAccessSitesAccessSitesOutputReference { + return new DataHuaweicloudGlobalEipAccessSitesAccessSitesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites huaweicloud_global_eip_access_sites} +*/ +export class DataHuaweicloudGlobalEipAccessSites extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_eip_access_sites"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGlobalEipAccessSites resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGlobalEipAccessSites to import + * @param importFromId The id of the existing DataHuaweicloudGlobalEipAccessSites that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGlobalEipAccessSites to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_eip_access_sites", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_access_sites huaweicloud_global_eip_access_sites} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGlobalEipAccessSitesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGlobalEipAccessSitesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_eip_access_sites', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._iecAzCode = config.iecAzCode; + this._name = config.name; + this._proxyRegion = config.proxyRegion; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_sites - computed: true, optional: false, required: false + private _accessSites = new DataHuaweicloudGlobalEipAccessSitesAccessSitesList(this, "access_sites", false); + public get accessSites() { + return this._accessSites; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // iec_az_code - computed: false, optional: true, required: false + private _iecAzCode?: string; + public get iecAzCode() { + return this.getStringAttribute('iec_az_code'); + } + public set iecAzCode(value: string) { + this._iecAzCode = value; + } + public resetIecAzCode() { + this._iecAzCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get iecAzCodeInput() { + return this._iecAzCode; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // proxy_region - computed: false, optional: true, required: false + private _proxyRegion?: string; + public get proxyRegion() { + return this.getStringAttribute('proxy_region'); + } + public set proxyRegion(value: string) { + this._proxyRegion = value; + } + public resetProxyRegion() { + this._proxyRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyRegionInput() { + return this._proxyRegion; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + iec_az_code: cdktf.stringToTerraform(this._iecAzCode), + name: cdktf.stringToTerraform(this._name), + proxy_region: cdktf.stringToTerraform(this._proxyRegion), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iec_az_code: { + value: cdktf.stringToHclTerraform(this._iecAzCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_region: { + value: cdktf.stringToHclTerraform(this._proxyRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/README.md new file mode 100644 index 00000000..d653f928 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_global_eip_pools` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_global_eip_pools`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/index.ts new file mode 100644 index 00000000..6d6c8463 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eip-pools/index.ts @@ -0,0 +1,473 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGlobalEipPoolsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#access_site DataHuaweicloudGlobalEipPools#access_site} + */ + readonly accessSite?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#id DataHuaweicloudGlobalEipPools#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#ip_version DataHuaweicloudGlobalEipPools#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#isp DataHuaweicloudGlobalEipPools#isp} + */ + readonly isp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#name DataHuaweicloudGlobalEipPools#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#type DataHuaweicloudGlobalEipPools#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypes { +} + +export function dataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesToTerraform(struct?: DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesToHclTerraform(struct?: DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cn_name - computed: true, optional: false, required: false + public get cnName() { + return this.getStringAttribute('cn_name'); + } + + // en_name - computed: true, optional: false, required: false + public get enName() { + return this.getStringAttribute('en_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesOutputReference { + return new DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudGlobalEipPoolsGeipPools { +} + +export function dataHuaweicloudGlobalEipPoolsGeipPoolsToTerraform(struct?: DataHuaweicloudGlobalEipPoolsGeipPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGlobalEipPoolsGeipPoolsToHclTerraform(struct?: DataHuaweicloudGlobalEipPoolsGeipPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGlobalEipPoolsGeipPoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGlobalEipPoolsGeipPools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGlobalEipPoolsGeipPools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_site - computed: true, optional: false, required: false + public get accessSite() { + return this.getStringAttribute('access_site'); + } + + // allowed_bandwidth_types - computed: true, optional: false, required: false + private _allowedBandwidthTypes = new DataHuaweicloudGlobalEipPoolsGeipPoolsAllowedBandwidthTypesList(this, "allowed_bandwidth_types", false); + public get allowedBandwidthTypes() { + return this._allowedBandwidthTypes; + } + + // cn_name - computed: true, optional: false, required: false + public get cnName() { + return this.getStringAttribute('cn_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // en_name - computed: true, optional: false, required: false + public get enName() { + return this.getStringAttribute('en_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // isp - computed: true, optional: false, required: false + public get isp() { + return this.getStringAttribute('isp'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGlobalEipPoolsGeipPoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGlobalEipPoolsGeipPoolsOutputReference { + return new DataHuaweicloudGlobalEipPoolsGeipPoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools huaweicloud_global_eip_pools} +*/ +export class DataHuaweicloudGlobalEipPools extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_eip_pools"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGlobalEipPools resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGlobalEipPools to import + * @param importFromId The id of the existing DataHuaweicloudGlobalEipPools that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGlobalEipPools to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_eip_pools", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eip_pools huaweicloud_global_eip_pools} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGlobalEipPoolsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGlobalEipPoolsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_eip_pools', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessSite = config.accessSite; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._isp = config.isp; + this._name = config.name; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_site - computed: false, optional: true, required: false + private _accessSite?: string; + public get accessSite() { + return this.getStringAttribute('access_site'); + } + public set accessSite(value: string) { + this._accessSite = value; + } + public resetAccessSite() { + this._accessSite = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessSiteInput() { + return this._accessSite; + } + + // geip_pools - computed: true, optional: false, required: false + private _geipPools = new DataHuaweicloudGlobalEipPoolsGeipPoolsList(this, "geip_pools", false); + public get geipPools() { + return this._geipPools; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // isp - computed: false, optional: true, required: false + private _isp?: string; + public get isp() { + return this.getStringAttribute('isp'); + } + public set isp(value: string) { + this._isp = value; + } + public resetIsp() { + this._isp = undefined; + } + // Temporarily expose input value. Use with caution. + public get ispInput() { + return this._isp; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_site: cdktf.stringToTerraform(this._accessSite), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + isp: cdktf.stringToTerraform(this._isp), + name: cdktf.stringToTerraform(this._name), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_site: { + value: cdktf.stringToHclTerraform(this._accessSite), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + isp: { + value: cdktf.stringToHclTerraform(this._isp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/README.md new file mode 100644 index 00000000..e392e482 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_global_eips` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_global_eips`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/index.ts new file mode 100644 index 00000000..78387ea2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-eips/index.ts @@ -0,0 +1,555 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGlobalEipsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#associate_instance_id DataHuaweicloudGlobalEips#associate_instance_id} + */ + readonly associateInstanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#associate_instance_type DataHuaweicloudGlobalEips#associate_instance_type} + */ + readonly associateInstanceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#enterprise_project_id DataHuaweicloudGlobalEips#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#geip_id DataHuaweicloudGlobalEips#geip_id} + */ + readonly geipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#id DataHuaweicloudGlobalEips#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#internet_bandwidth_id DataHuaweicloudGlobalEips#internet_bandwidth_id} + */ + readonly internetBandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#ip_address DataHuaweicloudGlobalEips#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#name DataHuaweicloudGlobalEips#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#status DataHuaweicloudGlobalEips#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#tags DataHuaweicloudGlobalEips#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudGlobalEipsGlobalEips { +} + +export function dataHuaweicloudGlobalEipsGlobalEipsToTerraform(struct?: DataHuaweicloudGlobalEipsGlobalEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGlobalEipsGlobalEipsToHclTerraform(struct?: DataHuaweicloudGlobalEipsGlobalEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGlobalEipsGlobalEipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGlobalEipsGlobalEips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGlobalEipsGlobalEips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_site - computed: true, optional: false, required: false + public get accessSite() { + return this.getStringAttribute('access_site'); + } + + // associate_instance_id - computed: true, optional: false, required: false + public get associateInstanceId() { + return this.getStringAttribute('associate_instance_id'); + } + + // associate_instance_region - computed: true, optional: false, required: false + public get associateInstanceRegion() { + return this.getStringAttribute('associate_instance_region'); + } + + // associate_instance_type - computed: true, optional: false, required: false + public get associateInstanceType() { + return this.getStringAttribute('associate_instance_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // frozen - computed: true, optional: false, required: false + public get frozen() { + return this.getBooleanAttribute('frozen'); + } + + // frozen_info - computed: true, optional: false, required: false + public get frozenInfo() { + return this.getStringAttribute('frozen_info'); + } + + // geip_pool_name - computed: true, optional: false, required: false + public get geipPoolName() { + return this.getStringAttribute('geip_pool_name'); + } + + // global_connection_bandwidth_id - computed: true, optional: false, required: false + public get globalConnectionBandwidthId() { + return this.getStringAttribute('global_connection_bandwidth_id'); + } + + // global_connection_bandwidth_type - computed: true, optional: false, required: false + public get globalConnectionBandwidthType() { + return this.getStringAttribute('global_connection_bandwidth_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // internet_bandwidth_id - computed: true, optional: false, required: false + public get internetBandwidthId() { + return this.getStringAttribute('internet_bandwidth_id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // isp - computed: true, optional: false, required: false + public get isp() { + return this.getStringAttribute('isp'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // polluted - computed: true, optional: false, required: false + public get polluted() { + return this.getBooleanAttribute('polluted'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGlobalEipsGlobalEipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGlobalEipsGlobalEipsOutputReference { + return new DataHuaweicloudGlobalEipsGlobalEipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips huaweicloud_global_eips} +*/ +export class DataHuaweicloudGlobalEips extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_eips"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGlobalEips resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGlobalEips to import + * @param importFromId The id of the existing DataHuaweicloudGlobalEips that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGlobalEips to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_eips", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_eips huaweicloud_global_eips} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGlobalEipsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGlobalEipsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_eips', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._associateInstanceId = config.associateInstanceId; + this._associateInstanceType = config.associateInstanceType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._geipId = config.geipId; + this._id = config.id; + this._internetBandwidthId = config.internetBandwidthId; + this._ipAddress = config.ipAddress; + this._name = config.name; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // associate_instance_id - computed: false, optional: true, required: false + private _associateInstanceId?: string; + public get associateInstanceId() { + return this.getStringAttribute('associate_instance_id'); + } + public set associateInstanceId(value: string) { + this._associateInstanceId = value; + } + public resetAssociateInstanceId() { + this._associateInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get associateInstanceIdInput() { + return this._associateInstanceId; + } + + // associate_instance_type - computed: false, optional: true, required: false + private _associateInstanceType?: string; + public get associateInstanceType() { + return this.getStringAttribute('associate_instance_type'); + } + public set associateInstanceType(value: string) { + this._associateInstanceType = value; + } + public resetAssociateInstanceType() { + this._associateInstanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get associateInstanceTypeInput() { + return this._associateInstanceType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // geip_id - computed: false, optional: true, required: false + private _geipId?: string; + public get geipId() { + return this.getStringAttribute('geip_id'); + } + public set geipId(value: string) { + this._geipId = value; + } + public resetGeipId() { + this._geipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get geipIdInput() { + return this._geipId; + } + + // global_eips - computed: true, optional: false, required: false + private _globalEips = new DataHuaweicloudGlobalEipsGlobalEipsList(this, "global_eips", false); + public get globalEips() { + return this._globalEips; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internet_bandwidth_id - computed: false, optional: true, required: false + private _internetBandwidthId?: string; + public get internetBandwidthId() { + return this.getStringAttribute('internet_bandwidth_id'); + } + public set internetBandwidthId(value: string) { + this._internetBandwidthId = value; + } + public resetInternetBandwidthId() { + this._internetBandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get internetBandwidthIdInput() { + return this._internetBandwidthId; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + associate_instance_id: cdktf.stringToTerraform(this._associateInstanceId), + associate_instance_type: cdktf.stringToTerraform(this._associateInstanceType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + geip_id: cdktf.stringToTerraform(this._geipId), + id: cdktf.stringToTerraform(this._id), + internet_bandwidth_id: cdktf.stringToTerraform(this._internetBandwidthId), + ip_address: cdktf.stringToTerraform(this._ipAddress), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + associate_instance_id: { + value: cdktf.stringToHclTerraform(this._associateInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + associate_instance_type: { + value: cdktf.stringToHclTerraform(this._associateInstanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + geip_id: { + value: cdktf.stringToHclTerraform(this._geipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internet_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._internetBandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/README.md new file mode 100644 index 00000000..47ee392c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_global_internet_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_global_internet_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/index.ts new file mode 100644 index 00000000..c6c3cbbd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-global-internet-bandwidths/index.ts @@ -0,0 +1,497 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudGlobalInternetBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#access_site DataHuaweicloudGlobalInternetBandwidths#access_site} + */ + readonly accessSite?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#bandwidth_id DataHuaweicloudGlobalInternetBandwidths#bandwidth_id} + */ + readonly bandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#enterprise_project_id DataHuaweicloudGlobalInternetBandwidths#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#id DataHuaweicloudGlobalInternetBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#name DataHuaweicloudGlobalInternetBandwidths#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#size DataHuaweicloudGlobalInternetBandwidths#size} + */ + readonly size?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#status DataHuaweicloudGlobalInternetBandwidths#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#tags DataHuaweicloudGlobalInternetBandwidths#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#type DataHuaweicloudGlobalInternetBandwidths#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudGlobalInternetBandwidthsInternetBandwidths { +} + +export function dataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsToTerraform(struct?: DataHuaweicloudGlobalInternetBandwidthsInternetBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsToHclTerraform(struct?: DataHuaweicloudGlobalInternetBandwidthsInternetBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudGlobalInternetBandwidthsInternetBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudGlobalInternetBandwidthsInternetBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_site - computed: true, optional: false, required: false + public get accessSite() { + return this.getStringAttribute('access_site'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // frozen_info - computed: true, optional: false, required: false + public get frozenInfo() { + return this.getStringAttribute('frozen_info'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ingress_size - computed: true, optional: false, required: false + public get ingressSize() { + return this.getNumberAttribute('ingress_size'); + } + + // isp - computed: true, optional: false, required: false + public get isp() { + return this.getStringAttribute('isp'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // ratio_95peak - computed: true, optional: false, required: false + public get ratio95Peak() { + return this.getNumberAttribute('ratio_95peak'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsOutputReference { + return new DataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths huaweicloud_global_internet_bandwidths} +*/ +export class DataHuaweicloudGlobalInternetBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_internet_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudGlobalInternetBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudGlobalInternetBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudGlobalInternetBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudGlobalInternetBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_internet_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/global_internet_bandwidths huaweicloud_global_internet_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudGlobalInternetBandwidthsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudGlobalInternetBandwidthsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_internet_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessSite = config.accessSite; + this._bandwidthId = config.bandwidthId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._size = config.size; + this._status = config.status; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_site - computed: false, optional: true, required: false + private _accessSite?: string; + public get accessSite() { + return this.getStringAttribute('access_site'); + } + public set accessSite(value: string) { + this._accessSite = value; + } + public resetAccessSite() { + this._accessSite = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessSiteInput() { + return this._accessSite; + } + + // bandwidth_id - computed: false, optional: true, required: false + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + public resetBandwidthId() { + this._bandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internet_bandwidths - computed: true, optional: false, required: false + private _internetBandwidths = new DataHuaweicloudGlobalInternetBandwidthsInternetBandwidthsList(this, "internet_bandwidths", false); + public get internetBandwidths() { + return this._internetBandwidths; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // size - computed: false, optional: true, required: false + private _size?: string; + public get size() { + return this.getStringAttribute('size'); + } + public set size(value: string) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_site: cdktf.stringToTerraform(this._accessSite), + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + size: cdktf.stringToTerraform(this._size), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_site: { + value: cdktf.stringToHclTerraform(this._accessSite), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.stringToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/README.md new file mode 100644 index 00000000..c5609c3d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_hss_host_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_hss_host_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/index.ts new file mode 100644 index 00000000..21eebc0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-host-groups/index.ts @@ -0,0 +1,418 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudHssHostGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#enterprise_project_id DataHuaweicloudHssHostGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#group_id DataHuaweicloudHssHostGroups#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#host_num DataHuaweicloudHssHostGroups#host_num} + */ + readonly hostNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#id DataHuaweicloudHssHostGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#name DataHuaweicloudHssHostGroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#region DataHuaweicloudHssHostGroups#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#risk_host_num DataHuaweicloudHssHostGroups#risk_host_num} + */ + readonly riskHostNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#unprotect_host_num DataHuaweicloudHssHostGroups#unprotect_host_num} + */ + readonly unprotectHostNum?: string; +} +export interface DataHuaweicloudHssHostGroupsGroups { +} + +export function dataHuaweicloudHssHostGroupsGroupsToTerraform(struct?: DataHuaweicloudHssHostGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudHssHostGroupsGroupsToHclTerraform(struct?: DataHuaweicloudHssHostGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudHssHostGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudHssHostGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudHssHostGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // host_ids - computed: true, optional: false, required: false + public get hostIds() { + return this.getListAttribute('host_ids'); + } + + // host_num - computed: true, optional: false, required: false + public get hostNum() { + return this.getNumberAttribute('host_num'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // risk_host_num - computed: true, optional: false, required: false + public get riskHostNum() { + return this.getNumberAttribute('risk_host_num'); + } + + // unprotect_host_num - computed: true, optional: false, required: false + public get unprotectHostNum() { + return this.getNumberAttribute('unprotect_host_num'); + } +} + +export class DataHuaweicloudHssHostGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudHssHostGroupsGroupsOutputReference { + return new DataHuaweicloudHssHostGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups huaweicloud_hss_host_groups} +*/ +export class DataHuaweicloudHssHostGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_host_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudHssHostGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudHssHostGroups to import + * @param importFromId The id of the existing DataHuaweicloudHssHostGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudHssHostGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_host_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_host_groups huaweicloud_hss_host_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudHssHostGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudHssHostGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_host_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._hostNum = config.hostNum; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._riskHostNum = config.riskHostNum; + this._unprotectHostNum = config.unprotectHostNum; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudHssHostGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // host_num - computed: false, optional: true, required: false + private _hostNum?: string; + public get hostNum() { + return this.getStringAttribute('host_num'); + } + public set hostNum(value: string) { + this._hostNum = value; + } + public resetHostNum() { + this._hostNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostNumInput() { + return this._hostNum; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // risk_host_num - computed: false, optional: true, required: false + private _riskHostNum?: string; + public get riskHostNum() { + return this.getStringAttribute('risk_host_num'); + } + public set riskHostNum(value: string) { + this._riskHostNum = value; + } + public resetRiskHostNum() { + this._riskHostNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get riskHostNumInput() { + return this._riskHostNum; + } + + // unprotect_host_num - computed: false, optional: true, required: false + private _unprotectHostNum?: string; + public get unprotectHostNum() { + return this.getStringAttribute('unprotect_host_num'); + } + public set unprotectHostNum(value: string) { + this._unprotectHostNum = value; + } + public resetUnprotectHostNum() { + this._unprotectHostNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get unprotectHostNumInput() { + return this._unprotectHostNum; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + host_num: cdktf.stringToTerraform(this._hostNum), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + risk_host_num: cdktf.stringToTerraform(this._riskHostNum), + unprotect_host_num: cdktf.stringToTerraform(this._unprotectHostNum), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_num: { + value: cdktf.stringToHclTerraform(this._hostNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + risk_host_num: { + value: cdktf.stringToHclTerraform(this._riskHostNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unprotect_host_num: { + value: cdktf.stringToHclTerraform(this._unprotectHostNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/README.md new file mode 100644 index 00000000..f3227f9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_hss_hosts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_hss_hosts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/index.ts new file mode 100644 index 00000000..15689ff3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-hosts/index.ts @@ -0,0 +1,694 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudHssHostsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#agent_status DataHuaweicloudHssHosts#agent_status} + */ + readonly agentStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#asset_value DataHuaweicloudHssHosts#asset_value} + */ + readonly assetValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#detect_result DataHuaweicloudHssHosts#detect_result} + */ + readonly detectResult?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#enterprise_project_id DataHuaweicloudHssHosts#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#group_id DataHuaweicloudHssHosts#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#host_id DataHuaweicloudHssHosts#host_id} + */ + readonly hostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#id DataHuaweicloudHssHosts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#name DataHuaweicloudHssHosts#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#os_type DataHuaweicloudHssHosts#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#policy_group_id DataHuaweicloudHssHosts#policy_group_id} + */ + readonly policyGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#protect_charging_mode DataHuaweicloudHssHosts#protect_charging_mode} + */ + readonly protectChargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#protect_status DataHuaweicloudHssHosts#protect_status} + */ + readonly protectStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#protect_version DataHuaweicloudHssHosts#protect_version} + */ + readonly protectVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#region DataHuaweicloudHssHosts#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#status DataHuaweicloudHssHosts#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudHssHostsHosts { +} + +export function dataHuaweicloudHssHostsHostsToTerraform(struct?: DataHuaweicloudHssHostsHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudHssHostsHostsToHclTerraform(struct?: DataHuaweicloudHssHostsHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudHssHostsHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudHssHostsHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudHssHostsHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agent_id - computed: true, optional: false, required: false + public get agentId() { + return this.getStringAttribute('agent_id'); + } + + // agent_status - computed: true, optional: false, required: false + public get agentStatus() { + return this.getStringAttribute('agent_status'); + } + + // asset_risk_num - computed: true, optional: false, required: false + public get assetRiskNum() { + return this.getNumberAttribute('asset_risk_num'); + } + + // asset_value - computed: true, optional: false, required: false + public get assetValue() { + return this.getStringAttribute('asset_value'); + } + + // baseline_risk_num - computed: true, optional: false, required: false + public get baselineRiskNum() { + return this.getNumberAttribute('baseline_risk_num'); + } + + // detect_result - computed: true, optional: false, required: false + public get detectResult() { + return this.getStringAttribute('detect_result'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // intrusion_risk_num - computed: true, optional: false, required: false + public get intrusionRiskNum() { + return this.getNumberAttribute('intrusion_risk_num'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // open_time - computed: true, optional: false, required: false + public get openTime() { + return this.getStringAttribute('open_time'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // policy_group_id - computed: true, optional: false, required: false + public get policyGroupId() { + return this.getStringAttribute('policy_group_id'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // protect_charging_mode - computed: true, optional: false, required: false + public get protectChargingMode() { + return this.getStringAttribute('protect_charging_mode'); + } + + // protect_status - computed: true, optional: false, required: false + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + + // protect_version - computed: true, optional: false, required: false + public get protectVersion() { + return this.getStringAttribute('protect_version'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // quota_id - computed: true, optional: false, required: false + public get quotaId() { + return this.getStringAttribute('quota_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vulnerability_risk_num - computed: true, optional: false, required: false + public get vulnerabilityRiskNum() { + return this.getNumberAttribute('vulnerability_risk_num'); + } +} + +export class DataHuaweicloudHssHostsHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudHssHostsHostsOutputReference { + return new DataHuaweicloudHssHostsHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts huaweicloud_hss_hosts} +*/ +export class DataHuaweicloudHssHosts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_hosts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudHssHosts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudHssHosts to import + * @param importFromId The id of the existing DataHuaweicloudHssHosts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudHssHosts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_hosts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_hosts huaweicloud_hss_hosts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudHssHostsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudHssHostsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_hosts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agentStatus = config.agentStatus; + this._assetValue = config.assetValue; + this._detectResult = config.detectResult; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._hostId = config.hostId; + this._id = config.id; + this._name = config.name; + this._osType = config.osType; + this._policyGroupId = config.policyGroupId; + this._protectChargingMode = config.protectChargingMode; + this._protectStatus = config.protectStatus; + this._protectVersion = config.protectVersion; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_status - computed: false, optional: true, required: false + private _agentStatus?: string; + public get agentStatus() { + return this.getStringAttribute('agent_status'); + } + public set agentStatus(value: string) { + this._agentStatus = value; + } + public resetAgentStatus() { + this._agentStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentStatusInput() { + return this._agentStatus; + } + + // asset_value - computed: false, optional: true, required: false + private _assetValue?: string; + public get assetValue() { + return this.getStringAttribute('asset_value'); + } + public set assetValue(value: string) { + this._assetValue = value; + } + public resetAssetValue() { + this._assetValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get assetValueInput() { + return this._assetValue; + } + + // detect_result - computed: false, optional: true, required: false + private _detectResult?: string; + public get detectResult() { + return this.getStringAttribute('detect_result'); + } + public set detectResult(value: string) { + this._detectResult = value; + } + public resetDetectResult() { + this._detectResult = undefined; + } + // Temporarily expose input value. Use with caution. + public get detectResultInput() { + return this._detectResult; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // host_id - computed: false, optional: true, required: false + private _hostId?: string; + public get hostId() { + return this.getStringAttribute('host_id'); + } + public set hostId(value: string) { + this._hostId = value; + } + public resetHostId() { + this._hostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostIdInput() { + return this._hostId; + } + + // hosts - computed: true, optional: false, required: false + private _hosts = new DataHuaweicloudHssHostsHostsList(this, "hosts", false); + public get hosts() { + return this._hosts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // policy_group_id - computed: false, optional: true, required: false + private _policyGroupId?: string; + public get policyGroupId() { + return this.getStringAttribute('policy_group_id'); + } + public set policyGroupId(value: string) { + this._policyGroupId = value; + } + public resetPolicyGroupId() { + this._policyGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyGroupIdInput() { + return this._policyGroupId; + } + + // protect_charging_mode - computed: false, optional: true, required: false + private _protectChargingMode?: string; + public get protectChargingMode() { + return this.getStringAttribute('protect_charging_mode'); + } + public set protectChargingMode(value: string) { + this._protectChargingMode = value; + } + public resetProtectChargingMode() { + this._protectChargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectChargingModeInput() { + return this._protectChargingMode; + } + + // protect_status - computed: false, optional: true, required: false + private _protectStatus?: string; + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + public set protectStatus(value: string) { + this._protectStatus = value; + } + public resetProtectStatus() { + this._protectStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectStatusInput() { + return this._protectStatus; + } + + // protect_version - computed: false, optional: true, required: false + private _protectVersion?: string; + public get protectVersion() { + return this.getStringAttribute('protect_version'); + } + public set protectVersion(value: string) { + this._protectVersion = value; + } + public resetProtectVersion() { + this._protectVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectVersionInput() { + return this._protectVersion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agent_status: cdktf.stringToTerraform(this._agentStatus), + asset_value: cdktf.stringToTerraform(this._assetValue), + detect_result: cdktf.stringToTerraform(this._detectResult), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + host_id: cdktf.stringToTerraform(this._hostId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + policy_group_id: cdktf.stringToTerraform(this._policyGroupId), + protect_charging_mode: cdktf.stringToTerraform(this._protectChargingMode), + protect_status: cdktf.stringToTerraform(this._protectStatus), + protect_version: cdktf.stringToTerraform(this._protectVersion), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agent_status: { + value: cdktf.stringToHclTerraform(this._agentStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + asset_value: { + value: cdktf.stringToHclTerraform(this._assetValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detect_result: { + value: cdktf.stringToHclTerraform(this._detectResult), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_id: { + value: cdktf.stringToHclTerraform(this._hostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_group_id: { + value: cdktf.stringToHclTerraform(this._policyGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_charging_mode: { + value: cdktf.stringToHclTerraform(this._protectChargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_status: { + value: cdktf.stringToHclTerraform(this._protectStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_version: { + value: cdktf.stringToHclTerraform(this._protectVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/README.md new file mode 100644 index 00000000..f0a53ade --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_hss_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_hss_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/index.ts new file mode 100644 index 00000000..148f2b9a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-quotas/index.ts @@ -0,0 +1,505 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudHssQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#category DataHuaweicloudHssQuotas#category} + */ + readonly category?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#charging_mode DataHuaweicloudHssQuotas#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#enterprise_project_id DataHuaweicloudHssQuotas#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#host_name DataHuaweicloudHssQuotas#host_name} + */ + readonly hostName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#id DataHuaweicloudHssQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#quota_id DataHuaweicloudHssQuotas#quota_id} + */ + readonly quotaId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#region DataHuaweicloudHssQuotas#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#status DataHuaweicloudHssQuotas#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#used_status DataHuaweicloudHssQuotas#used_status} + */ + readonly usedStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#version DataHuaweicloudHssQuotas#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudHssQuotasQuotas { +} + +export function dataHuaweicloudHssQuotasQuotasToTerraform(struct?: DataHuaweicloudHssQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudHssQuotasQuotasToHclTerraform(struct?: DataHuaweicloudHssQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudHssQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudHssQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudHssQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // enterprise_project_name - computed: true, optional: false, required: false + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // host_id - computed: true, optional: false, required: false + public get hostId() { + return this.getStringAttribute('host_id'); + } + + // host_name - computed: true, optional: false, required: false + public get hostName() { + return this.getStringAttribute('host_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // shared_quota - computed: true, optional: false, required: false + public get sharedQuota() { + return this.getStringAttribute('shared_quota'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // used_status - computed: true, optional: false, required: false + public get usedStatus() { + return this.getStringAttribute('used_status'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudHssQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudHssQuotasQuotasOutputReference { + return new DataHuaweicloudHssQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas huaweicloud_hss_quotas} +*/ +export class DataHuaweicloudHssQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudHssQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudHssQuotas to import + * @param importFromId The id of the existing DataHuaweicloudHssQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudHssQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_quotas huaweicloud_hss_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudHssQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudHssQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._hostName = config.hostName; + this._id = config.id; + this._quotaId = config.quotaId; + this._region = config.region; + this._status = config.status; + this._usedStatus = config.usedStatus; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // host_name - computed: false, optional: true, required: false + private _hostName?: string; + public get hostName() { + return this.getStringAttribute('host_name'); + } + public set hostName(value: string) { + this._hostName = value; + } + public resetHostName() { + this._hostName = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostNameInput() { + return this._hostName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quota_id - computed: false, optional: true, required: false + private _quotaId?: string; + public get quotaId() { + return this.getStringAttribute('quota_id'); + } + public set quotaId(value: string) { + this._quotaId = value; + } + public resetQuotaId() { + this._quotaId = undefined; + } + // Temporarily expose input value. Use with caution. + public get quotaIdInput() { + return this._quotaId; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudHssQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // used_status - computed: false, optional: true, required: false + private _usedStatus?: string; + public get usedStatus() { + return this.getStringAttribute('used_status'); + } + public set usedStatus(value: string) { + this._usedStatus = value; + } + public resetUsedStatus() { + this._usedStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get usedStatusInput() { + return this._usedStatus; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + host_name: cdktf.stringToTerraform(this._hostName), + id: cdktf.stringToTerraform(this._id), + quota_id: cdktf.stringToTerraform(this._quotaId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + used_status: cdktf.stringToTerraform(this._usedStatus), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_name: { + value: cdktf.stringToHclTerraform(this._hostName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quota_id: { + value: cdktf.stringToHclTerraform(this._quotaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + used_status: { + value: cdktf.stringToHclTerraform(this._usedStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/README.md new file mode 100644 index 00000000..381850ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_hss_ransomware_protection_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_hss_ransomware_protection_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/index.ts new file mode 100644 index 00000000..3eb80b43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-ransomware-protection-policies/index.ts @@ -0,0 +1,478 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudHssRansomwareProtectionPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#enterprise_project_id DataHuaweicloudHssRansomwareProtectionPolicies#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#id DataHuaweicloudHssRansomwareProtectionPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#name DataHuaweicloudHssRansomwareProtectionPolicies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#operating_system DataHuaweicloudHssRansomwareProtectionPolicies#operating_system} + */ + readonly operatingSystem?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#policy_id DataHuaweicloudHssRansomwareProtectionPolicies#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#region DataHuaweicloudHssRansomwareProtectionPolicies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStruct { +} + +export function dataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructToTerraform(struct?: DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructToHclTerraform(struct?: DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // hash - computed: true, optional: false, required: false + public get hash() { + return this.getStringAttribute('hash'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } +} + +export class DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructOutputReference { + return new DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudHssRansomwareProtectionPoliciesPolicies { +} + +export function dataHuaweicloudHssRansomwareProtectionPoliciesPoliciesToTerraform(struct?: DataHuaweicloudHssRansomwareProtectionPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudHssRansomwareProtectionPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudHssRansomwareProtectionPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudHssRansomwareProtectionPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudHssRansomwareProtectionPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bait_protection_status - computed: true, optional: false, required: false + public get baitProtectionStatus() { + return this.getStringAttribute('bait_protection_status'); + } + + // count_associated_server - computed: true, optional: false, required: false + public get countAssociatedServer() { + return this.getNumberAttribute('count_associated_server'); + } + + // default_policy - computed: true, optional: false, required: false + public get defaultPolicy() { + return this.getNumberAttribute('default_policy'); + } + + // deploy_mode - computed: true, optional: false, required: false + public get deployMode() { + return this.getStringAttribute('deploy_mode'); + } + + // exclude_directory - computed: true, optional: false, required: false + public get excludeDirectory() { + return this.getStringAttribute('exclude_directory'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operating_system - computed: true, optional: false, required: false + public get operatingSystem() { + return this.getStringAttribute('operating_system'); + } + + // process_whitelist - computed: true, optional: false, required: false + private _processWhitelist = new DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesProcessWhitelistStructList(this, "process_whitelist", false); + public get processWhitelist() { + return this._processWhitelist; + } + + // protection_directory - computed: true, optional: false, required: false + public get protectionDirectory() { + return this.getStringAttribute('protection_directory'); + } + + // protection_mode - computed: true, optional: false, required: false + public get protectionMode() { + return this.getStringAttribute('protection_mode'); + } + + // protection_type - computed: true, optional: false, required: false + public get protectionType() { + return this.getStringAttribute('protection_type'); + } + + // runtime_detection_status - computed: true, optional: false, required: false + public get runtimeDetectionStatus() { + return this.getStringAttribute('runtime_detection_status'); + } +} + +export class DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesOutputReference { + return new DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies huaweicloud_hss_ransomware_protection_policies} +*/ +export class DataHuaweicloudHssRansomwareProtectionPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_ransomware_protection_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudHssRansomwareProtectionPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudHssRansomwareProtectionPolicies to import + * @param importFromId The id of the existing DataHuaweicloudHssRansomwareProtectionPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudHssRansomwareProtectionPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_ransomware_protection_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_ransomware_protection_policies huaweicloud_hss_ransomware_protection_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudHssRansomwareProtectionPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudHssRansomwareProtectionPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_ransomware_protection_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._operatingSystem = config.operatingSystem; + this._policyId = config.policyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operating_system - computed: false, optional: true, required: false + private _operatingSystem?: string; + public get operatingSystem() { + return this.getStringAttribute('operating_system'); + } + public set operatingSystem(value: string) { + this._operatingSystem = value; + } + public resetOperatingSystem() { + this._operatingSystem = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatingSystemInput() { + return this._operatingSystem; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudHssRansomwareProtectionPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_id - computed: false, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + operating_system: cdktf.stringToTerraform(this._operatingSystem), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operating_system: { + value: cdktf.stringToHclTerraform(this._operatingSystem), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/README.md new file mode 100644 index 00000000..cceea341 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_hss_webtamper_hosts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_hss_webtamper_hosts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/index.ts new file mode 100644 index 00000000..47d67e7c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-hss-webtamper-hosts/index.ts @@ -0,0 +1,527 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudHssWebtamperHostsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#enterprise_project_id DataHuaweicloudHssWebtamperHosts#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#group_name DataHuaweicloudHssWebtamperHosts#group_name} + */ + readonly groupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#host_id DataHuaweicloudHssWebtamperHosts#host_id} + */ + readonly hostId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#id DataHuaweicloudHssWebtamperHosts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#name DataHuaweicloudHssWebtamperHosts#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#os_type DataHuaweicloudHssWebtamperHosts#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#private_ip DataHuaweicloudHssWebtamperHosts#private_ip} + */ + readonly privateIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#protect_status DataHuaweicloudHssWebtamperHosts#protect_status} + */ + readonly protectStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#public_ip DataHuaweicloudHssWebtamperHosts#public_ip} + */ + readonly publicIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#rasp_protect_status DataHuaweicloudHssWebtamperHosts#rasp_protect_status} + */ + readonly raspProtectStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#region DataHuaweicloudHssWebtamperHosts#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudHssWebtamperHostsHosts { +} + +export function dataHuaweicloudHssWebtamperHostsHostsToTerraform(struct?: DataHuaweicloudHssWebtamperHostsHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudHssWebtamperHostsHostsToHclTerraform(struct?: DataHuaweicloudHssWebtamperHostsHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudHssWebtamperHostsHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudHssWebtamperHostsHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudHssWebtamperHostsHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // anti_tampering_times - computed: true, optional: false, required: false + public get antiTamperingTimes() { + return this.getNumberAttribute('anti_tampering_times'); + } + + // detect_tampering_times - computed: true, optional: false, required: false + public get detectTamperingTimes() { + return this.getNumberAttribute('detect_tampering_times'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os_bit - computed: true, optional: false, required: false + public get osBit() { + return this.getStringAttribute('os_bit'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // protect_status - computed: true, optional: false, required: false + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // rasp_protect_status - computed: true, optional: false, required: false + public get raspProtectStatus() { + return this.getStringAttribute('rasp_protect_status'); + } +} + +export class DataHuaweicloudHssWebtamperHostsHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudHssWebtamperHostsHostsOutputReference { + return new DataHuaweicloudHssWebtamperHostsHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts huaweicloud_hss_webtamper_hosts} +*/ +export class DataHuaweicloudHssWebtamperHosts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_webtamper_hosts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudHssWebtamperHosts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudHssWebtamperHosts to import + * @param importFromId The id of the existing DataHuaweicloudHssWebtamperHosts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudHssWebtamperHosts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_webtamper_hosts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/hss_webtamper_hosts huaweicloud_hss_webtamper_hosts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudHssWebtamperHostsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudHssWebtamperHostsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_webtamper_hosts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupName = config.groupName; + this._hostId = config.hostId; + this._id = config.id; + this._name = config.name; + this._osType = config.osType; + this._privateIp = config.privateIp; + this._protectStatus = config.protectStatus; + this._publicIp = config.publicIp; + this._raspProtectStatus = config.raspProtectStatus; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_name - computed: false, optional: true, required: false + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + public resetGroupName() { + this._groupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // host_id - computed: false, optional: true, required: false + private _hostId?: string; + public get hostId() { + return this.getStringAttribute('host_id'); + } + public set hostId(value: string) { + this._hostId = value; + } + public resetHostId() { + this._hostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostIdInput() { + return this._hostId; + } + + // hosts - computed: true, optional: false, required: false + private _hosts = new DataHuaweicloudHssWebtamperHostsHostsList(this, "hosts", false); + public get hosts() { + return this._hosts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // private_ip - computed: false, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // protect_status - computed: false, optional: true, required: false + private _protectStatus?: string; + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + public set protectStatus(value: string) { + this._protectStatus = value; + } + public resetProtectStatus() { + this._protectStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectStatusInput() { + return this._protectStatus; + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // rasp_protect_status - computed: false, optional: true, required: false + private _raspProtectStatus?: string; + public get raspProtectStatus() { + return this.getStringAttribute('rasp_protect_status'); + } + public set raspProtectStatus(value: string) { + this._raspProtectStatus = value; + } + public resetRaspProtectStatus() { + this._raspProtectStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get raspProtectStatusInput() { + return this._raspProtectStatus; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_name: cdktf.stringToTerraform(this._groupName), + host_id: cdktf.stringToTerraform(this._hostId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + private_ip: cdktf.stringToTerraform(this._privateIp), + protect_status: cdktf.stringToTerraform(this._protectStatus), + public_ip: cdktf.stringToTerraform(this._publicIp), + rasp_protect_status: cdktf.stringToTerraform(this._raspProtectStatus), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_name: { + value: cdktf.stringToHclTerraform(this._groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_id: { + value: cdktf.stringToHclTerraform(this._hostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_status: { + value: cdktf.stringToHclTerraform(this._protectStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rasp_protect_status: { + value: cdktf.stringToHclTerraform(this._raspProtectStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/README.md new file mode 100644 index 00000000..fad9fd82 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_agencies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_agencies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/index.ts new file mode 100644 index 00000000..8718bdb3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-agencies/index.ts @@ -0,0 +1,288 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityAgenciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies#id DataHuaweicloudIdentityAgencies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies#name DataHuaweicloudIdentityAgencies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies#trust_domain_id DataHuaweicloudIdentityAgencies#trust_domain_id} + */ + readonly trustDomainId?: string; +} +export interface DataHuaweicloudIdentityAgenciesAgencies { +} + +export function dataHuaweicloudIdentityAgenciesAgenciesToTerraform(struct?: DataHuaweicloudIdentityAgenciesAgencies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityAgenciesAgenciesToHclTerraform(struct?: DataHuaweicloudIdentityAgenciesAgencies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityAgenciesAgenciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityAgenciesAgencies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityAgenciesAgencies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getStringAttribute('duration'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // trust_domain_id - computed: true, optional: false, required: false + public get trustDomainId() { + return this.getStringAttribute('trust_domain_id'); + } + + // trust_domain_name - computed: true, optional: false, required: false + public get trustDomainName() { + return this.getStringAttribute('trust_domain_name'); + } +} + +export class DataHuaweicloudIdentityAgenciesAgenciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityAgenciesAgenciesOutputReference { + return new DataHuaweicloudIdentityAgenciesAgenciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies huaweicloud_identity_agencies} +*/ +export class DataHuaweicloudIdentityAgencies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_agencies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityAgencies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityAgencies to import + * @param importFromId The id of the existing DataHuaweicloudIdentityAgencies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityAgencies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_agencies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_agencies huaweicloud_identity_agencies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityAgenciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityAgenciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_agencies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._trustDomainId = config.trustDomainId; + } + + // ========== + // ATTRIBUTES + // ========== + + // agencies - computed: true, optional: false, required: false + private _agencies = new DataHuaweicloudIdentityAgenciesAgenciesList(this, "agencies", false); + public get agencies() { + return this._agencies; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // trust_domain_id - computed: false, optional: true, required: false + private _trustDomainId?: string; + public get trustDomainId() { + return this.getStringAttribute('trust_domain_id'); + } + public set trustDomainId(value: string) { + this._trustDomainId = value; + } + public resetTrustDomainId() { + this._trustDomainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustDomainIdInput() { + return this._trustDomainId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + trust_domain_id: cdktf.stringToTerraform(this._trustDomainId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trust_domain_id: { + value: cdktf.stringToHclTerraform(this._trustDomainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/README.md new file mode 100644 index 00000000..50349aac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_custom_role` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_custom_role`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/index.ts new file mode 100644 index 00000000..62fb2c85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-custom-role/index.ts @@ -0,0 +1,266 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityCustomRoleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#description DataHuaweicloudIdentityCustomRole#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#domain_id DataHuaweicloudIdentityCustomRole#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#id DataHuaweicloudIdentityCustomRole#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#name DataHuaweicloudIdentityCustomRole#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#references DataHuaweicloudIdentityCustomRole#references} + */ + readonly references?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#type DataHuaweicloudIdentityCustomRole#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role huaweicloud_identity_custom_role} +*/ +export class DataHuaweicloudIdentityCustomRole extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_custom_role"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityCustomRole resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityCustomRole to import + * @param importFromId The id of the existing DataHuaweicloudIdentityCustomRole that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityCustomRole to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_custom_role", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_custom_role huaweicloud_identity_custom_role} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityCustomRoleConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityCustomRoleConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_custom_role', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._domainId = config.domainId; + this._id = config.id; + this._name = config.name; + this._references = config.references; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // catalog - computed: true, optional: false, required: false + public get catalog() { + return this.getStringAttribute('catalog'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: true, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy - computed: true, optional: false, required: false + public get policy() { + return this.getStringAttribute('policy'); + } + + // references - computed: true, optional: true, required: false + private _references?: number; + public get references() { + return this.getNumberAttribute('references'); + } + public set references(value: number) { + this._references = value; + } + public resetReferences() { + this._references = undefined; + } + // Temporarily expose input value. Use with caution. + public get referencesInput() { + return this._references; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + domain_id: cdktf.stringToTerraform(this._domainId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + references: cdktf.numberToTerraform(this._references), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + references: { + value: cdktf.numberToHclTerraform(this._references), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/README.md new file mode 100644 index 00000000..041225e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_group` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/index.ts new file mode 100644 index 00000000..8c1b7248 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-group/index.ts @@ -0,0 +1,288 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group#description DataHuaweicloudIdentityGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group#id DataHuaweicloudIdentityGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group#name DataHuaweicloudIdentityGroup#name} + */ + readonly name?: string; +} +export interface DataHuaweicloudIdentityGroupUsers { +} + +export function dataHuaweicloudIdentityGroupUsersToTerraform(struct?: DataHuaweicloudIdentityGroupUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityGroupUsersToHclTerraform(struct?: DataHuaweicloudIdentityGroupUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityGroupUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityGroupUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityGroupUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // password_expires_at - computed: true, optional: false, required: false + public get passwordExpiresAt() { + return this.getStringAttribute('password_expires_at'); + } + + // password_status - computed: true, optional: false, required: false + public get passwordStatus() { + return this.getBooleanAttribute('password_status'); + } + + // password_strength - computed: true, optional: false, required: false + public get passwordStrength() { + return this.getStringAttribute('password_strength'); + } +} + +export class DataHuaweicloudIdentityGroupUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityGroupUsersOutputReference { + return new DataHuaweicloudIdentityGroupUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group huaweicloud_identity_group} +*/ +export class DataHuaweicloudIdentityGroup extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityGroup to import + * @param importFromId The id of the existing DataHuaweicloudIdentityGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_group huaweicloud_identity_group} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityGroupConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityGroupConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudIdentityGroupUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/README.md new file mode 100644 index 00000000..53e155ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_permissions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/index.ts new file mode 100644 index 00000000..1287c65a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-permissions/index.ts @@ -0,0 +1,306 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityPermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions#catalog DataHuaweicloudIdentityPermissions#catalog} + */ + readonly catalog?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions#id DataHuaweicloudIdentityPermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions#name DataHuaweicloudIdentityPermissions#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions#type DataHuaweicloudIdentityPermissions#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudIdentityPermissionsPermissions { +} + +export function dataHuaweicloudIdentityPermissionsPermissionsToTerraform(struct?: DataHuaweicloudIdentityPermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityPermissionsPermissionsToHclTerraform(struct?: DataHuaweicloudIdentityPermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityPermissionsPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityPermissionsPermissions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityPermissionsPermissions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // catalog - computed: true, optional: false, required: false + public get catalog() { + return this.getStringAttribute('catalog'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // description_cn - computed: true, optional: false, required: false + public get descriptionCn() { + return this.getStringAttribute('description_cn'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy - computed: true, optional: false, required: false + public get policy() { + return this.getStringAttribute('policy'); + } +} + +export class DataHuaweicloudIdentityPermissionsPermissionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityPermissionsPermissionsOutputReference { + return new DataHuaweicloudIdentityPermissionsPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions huaweicloud_identity_permissions} +*/ +export class DataHuaweicloudIdentityPermissions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityPermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityPermissions to import + * @param importFromId The id of the existing DataHuaweicloudIdentityPermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityPermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_permissions huaweicloud_identity_permissions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityPermissionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityPermissionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._catalog = config.catalog; + this._id = config.id; + this._name = config.name; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // catalog - computed: false, optional: true, required: false + private _catalog?: string; + public get catalog() { + return this.getStringAttribute('catalog'); + } + public set catalog(value: string) { + this._catalog = value; + } + public resetCatalog() { + this._catalog = undefined; + } + // Temporarily expose input value. Use with caution. + public get catalogInput() { + return this._catalog; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permissions - computed: true, optional: false, required: false + private _permissions = new DataHuaweicloudIdentityPermissionsPermissionsList(this, "permissions", false); + public get permissions() { + return this._permissions; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + catalog: cdktf.stringToTerraform(this._catalog), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + catalog: { + value: cdktf.stringToHclTerraform(this._catalog), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/README.md new file mode 100644 index 00000000..e20954fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_projects` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_projects`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/index.ts new file mode 100644 index 00000000..ce8c2e99 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-projects/index.ts @@ -0,0 +1,235 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityProjectsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects#id DataHuaweicloudIdentityProjects#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects#name DataHuaweicloudIdentityProjects#name} + */ + readonly name?: string; +} +export interface DataHuaweicloudIdentityProjectsProjects { +} + +export function dataHuaweicloudIdentityProjectsProjectsToTerraform(struct?: DataHuaweicloudIdentityProjectsProjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityProjectsProjectsToHclTerraform(struct?: DataHuaweicloudIdentityProjectsProjects): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityProjectsProjectsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityProjectsProjects | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityProjectsProjects | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudIdentityProjectsProjectsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityProjectsProjectsOutputReference { + return new DataHuaweicloudIdentityProjectsProjectsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects huaweicloud_identity_projects} +*/ +export class DataHuaweicloudIdentityProjects extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_projects"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityProjects resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityProjects to import + * @param importFromId The id of the existing DataHuaweicloudIdentityProjects that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityProjects to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_projects", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_projects huaweicloud_identity_projects} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityProjectsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityProjectsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_projects', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // projects - computed: true, optional: false, required: false + private _projects = new DataHuaweicloudIdentityProjectsProjectsList(this, "projects", false); + public get projects() { + return this._projects; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/README.md new file mode 100644 index 00000000..b2433757 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_providers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_providers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/index.ts new file mode 100644 index 00000000..1d3d5993 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-providers/index.ts @@ -0,0 +1,393 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityProvidersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers#id DataHuaweicloudIdentityProviders#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the identity provider. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers#name DataHuaweicloudIdentityProviders#name} + */ + readonly name?: string; + /** + * Specifies the single sign-on type of the identity provider. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers#sso_type DataHuaweicloudIdentityProviders#sso_type} + */ + readonly ssoType?: string; + /** + * Specifies the status of the identity provider. The value can be **true** or **false** + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers#status DataHuaweicloudIdentityProviders#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudIdentityProvidersIdentityProvidersLinks { +} + +export function dataHuaweicloudIdentityProvidersIdentityProvidersLinksToTerraform(struct?: DataHuaweicloudIdentityProvidersIdentityProvidersLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityProvidersIdentityProvidersLinksToHclTerraform(struct?: DataHuaweicloudIdentityProvidersIdentityProvidersLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityProvidersIdentityProvidersLinksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityProvidersIdentityProvidersLinks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityProvidersIdentityProvidersLinks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // protocols - computed: true, optional: false, required: false + public get protocols() { + return this.getStringAttribute('protocols'); + } + + // self - computed: true, optional: false, required: false + public get selfAttribute() { + return this.getStringAttribute('self'); + } +} + +export class DataHuaweicloudIdentityProvidersIdentityProvidersLinksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityProvidersIdentityProvidersLinksOutputReference { + return new DataHuaweicloudIdentityProvidersIdentityProvidersLinksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIdentityProvidersIdentityProviders { +} + +export function dataHuaweicloudIdentityProvidersIdentityProvidersToTerraform(struct?: DataHuaweicloudIdentityProvidersIdentityProviders): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityProvidersIdentityProvidersToHclTerraform(struct?: DataHuaweicloudIdentityProvidersIdentityProviders): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityProvidersIdentityProvidersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityProvidersIdentityProviders | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityProvidersIdentityProviders | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // links - computed: true, optional: false, required: false + private _links = new DataHuaweicloudIdentityProvidersIdentityProvidersLinksList(this, "links", false); + public get links() { + return this._links; + } + + // remote_ids - computed: true, optional: false, required: false + public get remoteIds() { + return this.getListAttribute('remote_ids'); + } + + // sso_type - computed: true, optional: false, required: false + public get ssoType() { + return this.getStringAttribute('sso_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getBooleanAttribute('status'); + } +} + +export class DataHuaweicloudIdentityProvidersIdentityProvidersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityProvidersIdentityProvidersOutputReference { + return new DataHuaweicloudIdentityProvidersIdentityProvidersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers huaweicloud_identity_providers} +*/ +export class DataHuaweicloudIdentityProviders extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_providers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityProviders resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityProviders to import + * @param importFromId The id of the existing DataHuaweicloudIdentityProviders that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityProviders to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_providers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_providers huaweicloud_identity_providers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityProvidersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityProvidersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_providers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._ssoType = config.ssoType; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_providers - computed: true, optional: false, required: false + private _identityProviders = new DataHuaweicloudIdentityProvidersIdentityProvidersList(this, "identity_providers", false); + public get identityProviders() { + return this._identityProviders; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // sso_type - computed: false, optional: true, required: false + private _ssoType?: string; + public get ssoType() { + return this.getStringAttribute('sso_type'); + } + public set ssoType(value: string) { + this._ssoType = value; + } + public resetSsoType() { + this._ssoType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ssoTypeInput() { + return this._ssoType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + sso_type: cdktf.stringToTerraform(this._ssoType), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sso_type: { + value: cdktf.stringToHclTerraform(this._ssoType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/README.md new file mode 100644 index 00000000..bb7d7563 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_role_v3` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_role_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/index.ts new file mode 100644 index 00000000..06a1e136 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role-v3/index.ts @@ -0,0 +1,192 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityRoleV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3#display_name DataHuaweicloudIdentityRoleV3#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3#id DataHuaweicloudIdentityRoleV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3#name DataHuaweicloudIdentityRoleV3#name} + */ + readonly name?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3 huaweicloud_identity_role_v3} +*/ +export class DataHuaweicloudIdentityRoleV3 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_role_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityRoleV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityRoleV3 to import + * @param importFromId The id of the existing DataHuaweicloudIdentityRoleV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityRoleV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_role_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role_v3 huaweicloud_identity_role_v3} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityRoleV3Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityRoleV3Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_role_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // catalog - computed: true, optional: false, required: false + public get catalog() { + return this.getStringAttribute('catalog'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // display_name - computed: true, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy - computed: true, optional: false, required: false + public get policy() { + return this.getStringAttribute('policy'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/README.md new file mode 100644 index 00000000..b7503846 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_role` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_role`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/index.ts new file mode 100644 index 00000000..db49b6f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-role/index.ts @@ -0,0 +1,192 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityRoleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role#display_name DataHuaweicloudIdentityRole#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role#id DataHuaweicloudIdentityRole#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role#name DataHuaweicloudIdentityRole#name} + */ + readonly name?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role huaweicloud_identity_role} +*/ +export class DataHuaweicloudIdentityRole extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_role"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityRole resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityRole to import + * @param importFromId The id of the existing DataHuaweicloudIdentityRole that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityRole to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_role", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_role huaweicloud_identity_role} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityRoleConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityRoleConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_role', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // catalog - computed: true, optional: false, required: false + public get catalog() { + return this.getStringAttribute('catalog'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // display_name - computed: true, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy - computed: true, optional: false, required: false + public get policy() { + return this.getStringAttribute('policy'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/README.md new file mode 100644 index 00000000..be7c52b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/index.ts new file mode 100644 index 00000000..4ee25016 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-users/index.ts @@ -0,0 +1,283 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users#enabled DataHuaweicloudIdentityUsers#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users#id DataHuaweicloudIdentityUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users#name DataHuaweicloudIdentityUsers#name} + */ + readonly name?: string; +} +export interface DataHuaweicloudIdentityUsersUsers { +} + +export function dataHuaweicloudIdentityUsersUsersToTerraform(struct?: DataHuaweicloudIdentityUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityUsersUsersToHclTerraform(struct?: DataHuaweicloudIdentityUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // groups - computed: true, optional: false, required: false + public get groups() { + return this.getListAttribute('groups'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // password_expires_at - computed: true, optional: false, required: false + public get passwordExpiresAt() { + return this.getStringAttribute('password_expires_at'); + } + + // password_status - computed: true, optional: false, required: false + public get passwordStatus() { + return this.getBooleanAttribute('password_status'); + } +} + +export class DataHuaweicloudIdentityUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityUsersUsersOutputReference { + return new DataHuaweicloudIdentityUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users huaweicloud_identity_users} +*/ +export class DataHuaweicloudIdentityUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityUsers to import + * @param importFromId The id of the existing DataHuaweicloudIdentityUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_users huaweicloud_identity_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityUsersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityUsersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudIdentityUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/README.md new file mode 100644 index 00000000..a81bf550 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identity_virtual_mfa_devices` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identity_virtual_mfa_devices`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/index.ts new file mode 100644 index 00000000..bb84be82 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identity-virtual-mfa-devices/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentityVirtualMfaDevicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices#id DataHuaweicloudIdentityVirtualMfaDevices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the user ID to which the virtual MFA device belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices#user_id DataHuaweicloudIdentityVirtualMfaDevices#user_id} + */ + readonly userId?: string; +} +export interface DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevices { +} + +export function dataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesToTerraform(struct?: DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesToHclTerraform(struct?: DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } +} + +export class DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesOutputReference { + return new DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices huaweicloud_identity_virtual_mfa_devices} +*/ +export class DataHuaweicloudIdentityVirtualMfaDevices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_virtual_mfa_devices"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentityVirtualMfaDevices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentityVirtualMfaDevices to import + * @param importFromId The id of the existing DataHuaweicloudIdentityVirtualMfaDevices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentityVirtualMfaDevices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_virtual_mfa_devices", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identity_virtual_mfa_devices huaweicloud_identity_virtual_mfa_devices} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentityVirtualMfaDevicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentityVirtualMfaDevicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_virtual_mfa_devices', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._userId = config.userId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // user_id - computed: false, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // virtual_mfa_devices - computed: true, optional: false, required: false + private _virtualMfaDevices = new DataHuaweicloudIdentityVirtualMfaDevicesVirtualMfaDevicesList(this, "virtual_mfa_devices", false); + public get virtualMfaDevices() { + return this._virtualMfaDevices; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + user_id: cdktf.stringToTerraform(this._userId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/README.md new file mode 100644 index 00000000..2b03a8d3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identitycenter_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identitycenter_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/index.ts new file mode 100644 index 00000000..d4225603 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-groups/index.ts @@ -0,0 +1,302 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentitycenterGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups#id DataHuaweicloudIdentitycenterGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the identity store that associated with IAM Identity Center. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups#identity_store_id DataHuaweicloudIdentitycenterGroups#identity_store_id} + */ + readonly identityStoreId: string; + /** + * Specifies the name of the group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups#name DataHuaweicloudIdentitycenterGroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups#region DataHuaweicloudIdentitycenterGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudIdentitycenterGroupsGroups { +} + +export function dataHuaweicloudIdentitycenterGroupsGroupsToTerraform(struct?: DataHuaweicloudIdentitycenterGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentitycenterGroupsGroupsToHclTerraform(struct?: DataHuaweicloudIdentitycenterGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentitycenterGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentitycenterGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentitycenterGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudIdentitycenterGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentitycenterGroupsGroupsOutputReference { + return new DataHuaweicloudIdentitycenterGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups huaweicloud_identitycenter_groups} +*/ +export class DataHuaweicloudIdentitycenterGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentitycenterGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentitycenterGroups to import + * @param importFromId The id of the existing DataHuaweicloudIdentitycenterGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentitycenterGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_groups huaweicloud_identitycenter_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentitycenterGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentitycenterGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._identityStoreId = config.identityStoreId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudIdentitycenterGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_id - computed: false, optional: false, required: true + private _identityStoreId?: string; + public get identityStoreId() { + return this.getStringAttribute('identity_store_id'); + } + public set identityStoreId(value: string) { + this._identityStoreId = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreIdInput() { + return this._identityStoreId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + identity_store_id: cdktf.stringToTerraform(this._identityStoreId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_id: { + value: cdktf.stringToHclTerraform(this._identityStoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/README.md new file mode 100644 index 00000000..9193e023 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identitycenter_instance` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identitycenter_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_instance). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/index.ts new file mode 100644 index 00000000..9b8ecd03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-instance/index.ts @@ -0,0 +1,131 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentitycenterInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_instance#id DataHuaweicloudIdentitycenterInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_instance huaweicloud_identitycenter_instance} +*/ +export class DataHuaweicloudIdentitycenterInstance extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentitycenterInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentitycenterInstance to import + * @param importFromId The id of the existing DataHuaweicloudIdentitycenterInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentitycenterInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_instance huaweicloud_identitycenter_instance} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentitycenterInstanceConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentitycenterInstanceConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // alias - computed: true, optional: false, required: false + public get alias() { + return this.getStringAttribute('alias'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_id - computed: true, optional: false, required: false + public get identityStoreId() { + return this.getStringAttribute('identity_store_id'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/README.md new file mode 100644 index 00000000..a0f26765 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_identitycenter_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_identitycenter_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/index.ts new file mode 100644 index 00000000..8b03da85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-identitycenter-users/index.ts @@ -0,0 +1,427 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIdentitycenterUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the display name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#display_name DataHuaweicloudIdentitycenterUsers#display_name} + */ + readonly displayName?: string; + /** + * Specifies the email of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#email DataHuaweicloudIdentitycenterUsers#email} + */ + readonly email?: string; + /** + * Specifies the family name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#family_name DataHuaweicloudIdentitycenterUsers#family_name} + */ + readonly familyName?: string; + /** + * Specifies the given name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#given_name DataHuaweicloudIdentitycenterUsers#given_name} + */ + readonly givenName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#id DataHuaweicloudIdentitycenterUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the identity store that associated with IAM Identity Center. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#identity_store_id DataHuaweicloudIdentitycenterUsers#identity_store_id} + */ + readonly identityStoreId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#region DataHuaweicloudIdentitycenterUsers#region} + */ + readonly region?: string; + /** + * Specifies the name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#user_name DataHuaweicloudIdentitycenterUsers#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudIdentitycenterUsersUsers { +} + +export function dataHuaweicloudIdentitycenterUsersUsersToTerraform(struct?: DataHuaweicloudIdentitycenterUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIdentitycenterUsersUsersToHclTerraform(struct?: DataHuaweicloudIdentitycenterUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIdentitycenterUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIdentitycenterUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIdentitycenterUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // email - computed: true, optional: false, required: false + public get email() { + return this.getStringAttribute('email'); + } + + // family_name - computed: true, optional: false, required: false + public get familyName() { + return this.getStringAttribute('family_name'); + } + + // given_name - computed: true, optional: false, required: false + public get givenName() { + return this.getStringAttribute('given_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudIdentitycenterUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIdentitycenterUsersUsersOutputReference { + return new DataHuaweicloudIdentitycenterUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users huaweicloud_identitycenter_users} +*/ +export class DataHuaweicloudIdentitycenterUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIdentitycenterUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIdentitycenterUsers to import + * @param importFromId The id of the existing DataHuaweicloudIdentitycenterUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIdentitycenterUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/identitycenter_users huaweicloud_identitycenter_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIdentitycenterUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIdentitycenterUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._email = config.email; + this._familyName = config.familyName; + this._givenName = config.givenName; + this._id = config.id; + this._identityStoreId = config.identityStoreId; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // display_name - computed: false, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // email - computed: false, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // family_name - computed: false, optional: true, required: false + private _familyName?: string; + public get familyName() { + return this.getStringAttribute('family_name'); + } + public set familyName(value: string) { + this._familyName = value; + } + public resetFamilyName() { + this._familyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get familyNameInput() { + return this._familyName; + } + + // given_name - computed: false, optional: true, required: false + private _givenName?: string; + public get givenName() { + return this.getStringAttribute('given_name'); + } + public set givenName(value: string) { + this._givenName = value; + } + public resetGivenName() { + this._givenName = undefined; + } + // Temporarily expose input value. Use with caution. + public get givenNameInput() { + return this._givenName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_id - computed: false, optional: false, required: true + private _identityStoreId?: string; + public get identityStoreId() { + return this.getStringAttribute('identity_store_id'); + } + public set identityStoreId(value: string) { + this._identityStoreId = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreIdInput() { + return this._identityStoreId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudIdentitycenterUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + email: cdktf.stringToTerraform(this._email), + family_name: cdktf.stringToTerraform(this._familyName), + given_name: cdktf.stringToTerraform(this._givenName), + id: cdktf.stringToTerraform(this._id), + identity_store_id: cdktf.stringToTerraform(this._identityStoreId), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + family_name: { + value: cdktf.stringToHclTerraform(this._familyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + given_name: { + value: cdktf.stringToHclTerraform(this._givenName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_id: { + value: cdktf.stringToHclTerraform(this._identityStoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/README.md new file mode 100644 index 00000000..6a40162b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/index.ts new file mode 100644 index 00000000..0cd18a77 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-bandwidths/index.ts @@ -0,0 +1,257 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths#id DataHuaweicloudIecBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths#site_id DataHuaweicloudIecBandwidths#site_id} + */ + readonly siteId: string; +} +export interface DataHuaweicloudIecBandwidthsBandwidths { +} + +export function dataHuaweicloudIecBandwidthsBandwidthsToTerraform(struct?: DataHuaweicloudIecBandwidthsBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecBandwidthsBandwidthsToHclTerraform(struct?: DataHuaweicloudIecBandwidthsBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecBandwidthsBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecBandwidthsBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecBandwidthsBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // line - computed: true, optional: false, required: false + public get line() { + return this.getStringAttribute('line'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudIecBandwidthsBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecBandwidthsBandwidthsOutputReference { + return new DataHuaweicloudIecBandwidthsBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths huaweicloud_iec_bandwidths} +*/ +export class DataHuaweicloudIecBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudIecBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_bandwidths huaweicloud_iec_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecBandwidthsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecBandwidthsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._siteId = config.siteId; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidths - computed: true, optional: false, required: false + private _bandwidths = new DataHuaweicloudIecBandwidthsBandwidthsList(this, "bandwidths", false); + public get bandwidths() { + return this._bandwidths; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // site_id - computed: false, optional: false, required: true + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } + + // site_info - computed: true, optional: false, required: false + public get siteInfo() { + return this.getStringAttribute('site_info'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + site_id: cdktf.stringToTerraform(this._siteId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(this._siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/README.md new file mode 100644 index 00000000..c9a04428 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_eips` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_eips`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/index.ts new file mode 100644 index 00000000..7b1c927a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-eips/index.ts @@ -0,0 +1,300 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecEipsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips#id DataHuaweicloudIecEips#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips#port_id DataHuaweicloudIecEips#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips#site_id DataHuaweicloudIecEips#site_id} + */ + readonly siteId: string; +} +export interface DataHuaweicloudIecEipsEips { +} + +export function dataHuaweicloudIecEipsEipsToTerraform(struct?: DataHuaweicloudIecEipsEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecEipsEipsToHclTerraform(struct?: DataHuaweicloudIecEipsEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecEipsEipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecEipsEips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecEipsEips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_share_type - computed: true, optional: false, required: false + public get bandwidthShareType() { + return this.getStringAttribute('bandwidth_share_type'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudIecEipsEipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecEipsEipsOutputReference { + return new DataHuaweicloudIecEipsEipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips huaweicloud_iec_eips} +*/ +export class DataHuaweicloudIecEips extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_eips"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecEips resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecEips to import + * @param importFromId The id of the existing DataHuaweicloudIecEips that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecEips to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_eips", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_eips huaweicloud_iec_eips} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecEipsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecEipsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_eips', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._portId = config.portId; + this._siteId = config.siteId; + } + + // ========== + // ATTRIBUTES + // ========== + + // eips - computed: true, optional: false, required: false + private _eips = new DataHuaweicloudIecEipsEipsList(this, "eips", false); + public get eips() { + return this._eips; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // port_id - computed: false, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // site_id - computed: false, optional: false, required: true + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } + + // site_info - computed: true, optional: false, required: false + public get siteInfo() { + return this.getStringAttribute('site_info'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + port_id: cdktf.stringToTerraform(this._portId), + site_id: cdktf.stringToTerraform(this._siteId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(this._siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/README.md new file mode 100644 index 00000000..ba9de82d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/index.ts new file mode 100644 index 00000000..83116b97 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-flavors/index.ts @@ -0,0 +1,408 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#area DataHuaweicloudIecFlavors#area} + */ + readonly area?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#city DataHuaweicloudIecFlavors#city} + */ + readonly city?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#id DataHuaweicloudIecFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#name DataHuaweicloudIecFlavors#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#operator DataHuaweicloudIecFlavors#operator} + */ + readonly operator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#province DataHuaweicloudIecFlavors#province} + */ + readonly province?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#region DataHuaweicloudIecFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#site_ids DataHuaweicloudIecFlavors#site_ids} + */ + readonly siteIds?: string; +} +export interface DataHuaweicloudIecFlavorsFlavors { +} + +export function dataHuaweicloudIecFlavorsFlavorsToTerraform(struct?: DataHuaweicloudIecFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudIecFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudIecFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecFlavorsFlavorsOutputReference { + return new DataHuaweicloudIecFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors huaweicloud_iec_flavors} +*/ +export class DataHuaweicloudIecFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecFlavors to import + * @param importFromId The id of the existing DataHuaweicloudIecFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_flavors huaweicloud_iec_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._area = config.area; + this._city = config.city; + this._id = config.id; + this._name = config.name; + this._operator = config.operator; + this._province = config.province; + this._region = config.region; + this._siteIds = config.siteIds; + } + + // ========== + // ATTRIBUTES + // ========== + + // area - computed: false, optional: true, required: false + private _area?: string; + public get area() { + return this.getStringAttribute('area'); + } + public set area(value: string) { + this._area = value; + } + public resetArea() { + this._area = undefined; + } + // Temporarily expose input value. Use with caution. + public get areaInput() { + return this._area; + } + + // city - computed: false, optional: true, required: false + private _city?: string; + public get city() { + return this.getStringAttribute('city'); + } + public set city(value: string) { + this._city = value; + } + public resetCity() { + this._city = undefined; + } + // Temporarily expose input value. Use with caution. + public get cityInput() { + return this._city; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudIecFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operator - computed: false, optional: true, required: false + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + public resetOperator() { + this._operator = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // province - computed: false, optional: true, required: false + private _province?: string; + public get province() { + return this.getStringAttribute('province'); + } + public set province(value: string) { + this._province = value; + } + public resetProvince() { + this._province = undefined; + } + // Temporarily expose input value. Use with caution. + public get provinceInput() { + return this._province; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // site_ids - computed: false, optional: true, required: false + private _siteIds?: string; + public get siteIds() { + return this.getStringAttribute('site_ids'); + } + public set siteIds(value: string) { + this._siteIds = value; + } + public resetSiteIds() { + this._siteIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get siteIdsInput() { + return this._siteIds; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + area: cdktf.stringToTerraform(this._area), + city: cdktf.stringToTerraform(this._city), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + operator: cdktf.stringToTerraform(this._operator), + province: cdktf.stringToTerraform(this._province), + region: cdktf.stringToTerraform(this._region), + site_ids: cdktf.stringToTerraform(this._siteIds), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + area: { + value: cdktf.stringToHclTerraform(this._area), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + city: { + value: cdktf.stringToHclTerraform(this._city), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(this._operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + province: { + value: cdktf.stringToHclTerraform(this._province), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_ids: { + value: cdktf.stringToHclTerraform(this._siteIds), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/README.md new file mode 100644 index 00000000..01669781 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_images` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_images`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/index.ts new file mode 100644 index 00000000..6877b704 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-images/index.ts @@ -0,0 +1,296 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecImagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images#id DataHuaweicloudIecImages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images#name DataHuaweicloudIecImages#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images#os_type DataHuaweicloudIecImages#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images#region DataHuaweicloudIecImages#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudIecImagesImages { +} + +export function dataHuaweicloudIecImagesImagesToTerraform(struct?: DataHuaweicloudIecImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecImagesImagesToHclTerraform(struct?: DataHuaweicloudIecImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecImagesImagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecImagesImages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecImagesImages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudIecImagesImagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecImagesImagesOutputReference { + return new DataHuaweicloudIecImagesImagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images huaweicloud_iec_images} +*/ +export class DataHuaweicloudIecImages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_images"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecImages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecImages to import + * @param importFromId The id of the existing DataHuaweicloudIecImages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecImages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_images", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_images huaweicloud_iec_images} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecImagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecImagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_images', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._osType = config.osType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // images - computed: true, optional: false, required: false + private _images = new DataHuaweicloudIecImagesImagesList(this, "images", false); + public get images() { + return this._images; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/README.md new file mode 100644 index 00000000..5614bb8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_keypair` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_keypair`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/index.ts new file mode 100644 index 00000000..03299d4b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-keypair/index.ts @@ -0,0 +1,151 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecKeypairConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair#id DataHuaweicloudIecKeypair#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair#name DataHuaweicloudIecKeypair#name} + */ + readonly name: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair huaweicloud_iec_keypair} +*/ +export class DataHuaweicloudIecKeypair extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_keypair"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecKeypair resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecKeypair to import + * @param importFromId The id of the existing DataHuaweicloudIecKeypair that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecKeypair to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_keypair", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_keypair huaweicloud_iec_keypair} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecKeypairConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecKeypairConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_keypair', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // fingerprint - computed: true, optional: false, required: false + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // public_key - computed: true, optional: false, required: false + public get publicKey() { + return this.getStringAttribute('public_key'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/README.md new file mode 100644 index 00000000..e537ee0f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_network_acl` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_network_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/index.ts new file mode 100644 index 00000000..d6764046 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-network-acl/index.ts @@ -0,0 +1,250 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecNetworkAclConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl#id DataHuaweicloudIecNetworkAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl#name DataHuaweicloudIecNetworkAcl#name} + */ + readonly name?: string; +} +export interface DataHuaweicloudIecNetworkAclNetworks { +} + +export function dataHuaweicloudIecNetworkAclNetworksToTerraform(struct?: DataHuaweicloudIecNetworkAclNetworks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecNetworkAclNetworksToHclTerraform(struct?: DataHuaweicloudIecNetworkAclNetworks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecNetworkAclNetworksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecNetworkAclNetworks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecNetworkAclNetworks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudIecNetworkAclNetworksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecNetworkAclNetworksOutputReference { + return new DataHuaweicloudIecNetworkAclNetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl huaweicloud_iec_network_acl} +*/ +export class DataHuaweicloudIecNetworkAcl extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_network_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecNetworkAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecNetworkAcl to import + * @param importFromId The id of the existing DataHuaweicloudIecNetworkAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecNetworkAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_network_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_network_acl huaweicloud_iec_network_acl} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecNetworkAclConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecNetworkAclConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_network_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inbound_rules - computed: true, optional: false, required: false + public get inboundRules() { + return this.getListAttribute('inbound_rules'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // networks - computed: true, optional: false, required: false + private _networks = new DataHuaweicloudIecNetworkAclNetworksList(this, "networks", false); + public get networks() { + return this._networks; + } + + // outbound_rules - computed: true, optional: false, required: false + public get outboundRules() { + return this.getListAttribute('outbound_rules'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/README.md new file mode 100644 index 00000000..a02e36ec --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_port` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_port`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/index.ts new file mode 100644 index 00000000..91cfbd3d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-port/index.ts @@ -0,0 +1,243 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecPortConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port#fixed_ip DataHuaweicloudIecPort#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port#id DataHuaweicloudIecPort#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port#mac_address DataHuaweicloudIecPort#mac_address} + */ + readonly macAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port#region DataHuaweicloudIecPort#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port#subnet_id DataHuaweicloudIecPort#subnet_id} + */ + readonly subnetId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port huaweicloud_iec_port} +*/ +export class DataHuaweicloudIecPort extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_port"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecPort resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecPort to import + * @param importFromId The id of the existing DataHuaweicloudIecPort that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecPort to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_port", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_port huaweicloud_iec_port} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecPortConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecPortConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_port', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fixedIp = config.fixedIp; + this._id = config.id; + this._macAddress = config.macAddress; + this._region = config.region; + this._subnetId = config.subnetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_groups - computed: true, optional: false, required: false + public get securityGroups() { + return this.getListAttribute('security_groups'); + } + + // site_id - computed: true, optional: false, required: false + public get siteId() { + return this.getStringAttribute('site_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + mac_address: cdktf.stringToTerraform(this._macAddress), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(this._macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/README.md new file mode 100644 index 00000000..2544c53d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_security_group` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_security_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/index.ts new file mode 100644 index 00000000..8a7ab157 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-security-group/index.ts @@ -0,0 +1,272 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecSecurityGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group#id DataHuaweicloudIecSecurityGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group#name DataHuaweicloudIecSecurityGroup#name} + */ + readonly name: string; +} +export interface DataHuaweicloudIecSecurityGroupSecurityGroupRules { +} + +export function dataHuaweicloudIecSecurityGroupSecurityGroupRulesToTerraform(struct?: DataHuaweicloudIecSecurityGroupSecurityGroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecSecurityGroupSecurityGroupRulesToHclTerraform(struct?: DataHuaweicloudIecSecurityGroupSecurityGroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecSecurityGroupSecurityGroupRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecSecurityGroupSecurityGroupRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecSecurityGroupSecurityGroupRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port_range_max - computed: true, optional: false, required: false + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + + // port_range_min - computed: true, optional: false, required: false + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } +} + +export class DataHuaweicloudIecSecurityGroupSecurityGroupRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecSecurityGroupSecurityGroupRulesOutputReference { + return new DataHuaweicloudIecSecurityGroupSecurityGroupRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group huaweicloud_iec_security_group} +*/ +export class DataHuaweicloudIecSecurityGroup extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_security_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecSecurityGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecSecurityGroup to import + * @param importFromId The id of the existing DataHuaweicloudIecSecurityGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecSecurityGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_security_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_security_group huaweicloud_iec_security_group} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecSecurityGroupConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecSecurityGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_security_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // security_group_rules - computed: true, optional: false, required: false + private _securityGroupRules = new DataHuaweicloudIecSecurityGroupSecurityGroupRulesList(this, "security_group_rules", false); + public get securityGroupRules() { + return this._securityGroupRules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/README.md new file mode 100644 index 00000000..dc0ec849 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_server` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_server`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/index.ts new file mode 100644 index 00000000..0337a332 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-server/index.ts @@ -0,0 +1,535 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecServerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server#edgecloud_id DataHuaweicloudIecServer#edgecloud_id} + */ + readonly edgecloudId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server#id DataHuaweicloudIecServer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server#name DataHuaweicloudIecServer#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server#status DataHuaweicloudIecServer#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudIecServerCoverageSites { +} + +export function dataHuaweicloudIecServerCoverageSitesToTerraform(struct?: DataHuaweicloudIecServerCoverageSites): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecServerCoverageSitesToHclTerraform(struct?: DataHuaweicloudIecServerCoverageSites): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecServerCoverageSitesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecServerCoverageSites | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecServerCoverageSites | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // site_id - computed: true, optional: false, required: false + public get siteId() { + return this.getStringAttribute('site_id'); + } + + // site_info - computed: true, optional: false, required: false + public get siteInfo() { + return this.getStringAttribute('site_info'); + } +} + +export class DataHuaweicloudIecServerCoverageSitesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecServerCoverageSitesOutputReference { + return new DataHuaweicloudIecServerCoverageSitesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIecServerNics { +} + +export function dataHuaweicloudIecServerNicsToTerraform(struct?: DataHuaweicloudIecServerNics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecServerNicsToHclTerraform(struct?: DataHuaweicloudIecServerNics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecServerNicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecServerNics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecServerNics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } +} + +export class DataHuaweicloudIecServerNicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecServerNicsOutputReference { + return new DataHuaweicloudIecServerNicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIecServerVolumeAttached { +} + +export function dataHuaweicloudIecServerVolumeAttachedToTerraform(struct?: DataHuaweicloudIecServerVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecServerVolumeAttachedToHclTerraform(struct?: DataHuaweicloudIecServerVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecServerVolumeAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecServerVolumeAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecServerVolumeAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getStringAttribute('boot_index'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudIecServerVolumeAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecServerVolumeAttachedOutputReference { + return new DataHuaweicloudIecServerVolumeAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server huaweicloud_iec_server} +*/ +export class DataHuaweicloudIecServer extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_server"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecServer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecServer to import + * @param importFromId The id of the existing DataHuaweicloudIecServer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecServer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_server", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_server huaweicloud_iec_server} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecServerConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecServerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_server', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._edgecloudId = config.edgecloudId; + this._id = config.id; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // coverage_sites - computed: true, optional: false, required: false + private _coverageSites = new DataHuaweicloudIecServerCoverageSitesList(this, "coverage_sites", false); + public get coverageSites() { + return this._coverageSites; + } + + // edgecloud_id - computed: true, optional: true, required: false + private _edgecloudId?: string; + public get edgecloudId() { + return this.getStringAttribute('edgecloud_id'); + } + public set edgecloudId(value: string) { + this._edgecloudId = value; + } + public resetEdgecloudId() { + this._edgecloudId = undefined; + } + // Temporarily expose input value. Use with caution. + public get edgecloudIdInput() { + return this._edgecloudId; + } + + // edgecloud_name - computed: true, optional: false, required: false + public get edgecloudName() { + return this.getStringAttribute('edgecloud_name'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // key_pair - computed: true, optional: false, required: false + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nics - computed: true, optional: false, required: false + private _nics = new DataHuaweicloudIecServerNicsList(this, "nics", false); + public get nics() { + return this._nics; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // security_groups - computed: true, optional: false, required: false + public get securityGroups() { + return this.getListAttribute('security_groups'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // system_disk_id - computed: true, optional: false, required: false + public get systemDiskId() { + return this.getStringAttribute('system_disk_id'); + } + + // user_data - computed: true, optional: false, required: false + public get userData() { + return this.getStringAttribute('user_data'); + } + + // volume_attached - computed: true, optional: false, required: false + private _volumeAttached = new DataHuaweicloudIecServerVolumeAttachedList(this, "volume_attached", false); + public get volumeAttached() { + return this._volumeAttached; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + edgecloud_id: cdktf.stringToTerraform(this._edgecloudId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + edgecloud_id: { + value: cdktf.stringToHclTerraform(this._edgecloudId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/README.md new file mode 100644 index 00000000..45510a61 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_sites` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_sites`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/index.ts new file mode 100644 index 00000000..e3842598 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-sites/index.ts @@ -0,0 +1,402 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecSitesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites#area DataHuaweicloudIecSites#area} + */ + readonly area?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites#city DataHuaweicloudIecSites#city} + */ + readonly city?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites#id DataHuaweicloudIecSites#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites#province DataHuaweicloudIecSites#province} + */ + readonly province?: string; +} +export interface DataHuaweicloudIecSitesSitesLines { +} + +export function dataHuaweicloudIecSitesSitesLinesToTerraform(struct?: DataHuaweicloudIecSitesSitesLines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecSitesSitesLinesToHclTerraform(struct?: DataHuaweicloudIecSitesSitesLines): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecSitesSitesLinesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecSitesSitesLines | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecSitesSitesLines | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } +} + +export class DataHuaweicloudIecSitesSitesLinesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecSitesSitesLinesOutputReference { + return new DataHuaweicloudIecSitesSitesLinesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIecSitesSites { +} + +export function dataHuaweicloudIecSitesSitesToTerraform(struct?: DataHuaweicloudIecSitesSites): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecSitesSitesToHclTerraform(struct?: DataHuaweicloudIecSitesSites): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecSitesSitesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecSitesSites | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecSitesSites | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // area - computed: true, optional: false, required: false + public get area() { + return this.getStringAttribute('area'); + } + + // city - computed: true, optional: false, required: false + public get city() { + return this.getStringAttribute('city'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // lines - computed: true, optional: false, required: false + private _lines = new DataHuaweicloudIecSitesSitesLinesList(this, "lines", false); + public get lines() { + return this._lines; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // province - computed: true, optional: false, required: false + public get province() { + return this.getStringAttribute('province'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudIecSitesSitesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecSitesSitesOutputReference { + return new DataHuaweicloudIecSitesSitesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites huaweicloud_iec_sites} +*/ +export class DataHuaweicloudIecSites extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_sites"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecSites resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecSites to import + * @param importFromId The id of the existing DataHuaweicloudIecSites that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecSites to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_sites", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_sites huaweicloud_iec_sites} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecSitesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecSitesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_sites', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._area = config.area; + this._city = config.city; + this._id = config.id; + this._province = config.province; + } + + // ========== + // ATTRIBUTES + // ========== + + // area - computed: false, optional: true, required: false + private _area?: string; + public get area() { + return this.getStringAttribute('area'); + } + public set area(value: string) { + this._area = value; + } + public resetArea() { + this._area = undefined; + } + // Temporarily expose input value. Use with caution. + public get areaInput() { + return this._area; + } + + // city - computed: false, optional: true, required: false + private _city?: string; + public get city() { + return this.getStringAttribute('city'); + } + public set city(value: string) { + this._city = value; + } + public resetCity() { + this._city = undefined; + } + // Temporarily expose input value. Use with caution. + public get cityInput() { + return this._city; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // province - computed: false, optional: true, required: false + private _province?: string; + public get province() { + return this.getStringAttribute('province'); + } + public set province(value: string) { + this._province = value; + } + public resetProvince() { + this._province = undefined; + } + // Temporarily expose input value. Use with caution. + public get provinceInput() { + return this._province; + } + + // sites - computed: true, optional: false, required: false + private _sites = new DataHuaweicloudIecSitesSitesList(this, "sites", false); + public get sites() { + return this._sites; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + area: cdktf.stringToTerraform(this._area), + city: cdktf.stringToTerraform(this._city), + id: cdktf.stringToTerraform(this._id), + province: cdktf.stringToTerraform(this._province), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + area: { + value: cdktf.stringToHclTerraform(this._area), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + city: { + value: cdktf.stringToHclTerraform(this._city), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + province: { + value: cdktf.stringToHclTerraform(this._province), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/README.md new file mode 100644 index 00000000..7b28413d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_vpc_subnets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_vpc_subnets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/index.ts new file mode 100644 index 00000000..f569693a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc-subnets/index.ts @@ -0,0 +1,313 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecVpcSubnetsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets#id DataHuaweicloudIecVpcSubnets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets#region DataHuaweicloudIecVpcSubnets#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets#site_id DataHuaweicloudIecVpcSubnets#site_id} + */ + readonly siteId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets#vpc_id DataHuaweicloudIecVpcSubnets#vpc_id} + */ + readonly vpcId: string; +} +export interface DataHuaweicloudIecVpcSubnetsSubnets { +} + +export function dataHuaweicloudIecVpcSubnetsSubnetsToTerraform(struct?: DataHuaweicloudIecVpcSubnetsSubnets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIecVpcSubnetsSubnetsToHclTerraform(struct?: DataHuaweicloudIecVpcSubnetsSubnets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIecVpcSubnetsSubnetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIecVpcSubnetsSubnets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIecVpcSubnetsSubnets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // dns_list - computed: true, optional: false, required: false + public get dnsList() { + return this.getListAttribute('dns_list'); + } + + // gateway_ip - computed: true, optional: false, required: false + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // site_id - computed: true, optional: false, required: false + public get siteId() { + return this.getStringAttribute('site_id'); + } + + // site_info - computed: true, optional: false, required: false + public get siteInfo() { + return this.getStringAttribute('site_info'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudIecVpcSubnetsSubnetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIecVpcSubnetsSubnetsOutputReference { + return new DataHuaweicloudIecVpcSubnetsSubnetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets huaweicloud_iec_vpc_subnets} +*/ +export class DataHuaweicloudIecVpcSubnets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_vpc_subnets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecVpcSubnets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecVpcSubnets to import + * @param importFromId The id of the existing DataHuaweicloudIecVpcSubnets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecVpcSubnets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_vpc_subnets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc_subnets huaweicloud_iec_vpc_subnets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecVpcSubnetsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecVpcSubnetsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_vpc_subnets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._siteId = config.siteId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // site_id - computed: false, optional: true, required: false + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + public resetSiteId() { + this._siteId = undefined; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } + + // subnets - computed: true, optional: false, required: false + private _subnets = new DataHuaweicloudIecVpcSubnetsSubnetsList(this, "subnets", false); + public get subnets() { + return this._subnets; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + site_id: cdktf.stringToTerraform(this._siteId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(this._siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/README.md new file mode 100644 index 00000000..52c8204c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iec_vpc` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iec_vpc`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/index.ts new file mode 100644 index 00000000..98c93cc0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iec-vpc/index.ts @@ -0,0 +1,187 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIecVpcConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc#id DataHuaweicloudIecVpc#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc#name DataHuaweicloudIecVpc#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc#region DataHuaweicloudIecVpc#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc huaweicloud_iec_vpc} +*/ +export class DataHuaweicloudIecVpc extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_vpc"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIecVpc resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIecVpc to import + * @param importFromId The id of the existing DataHuaweicloudIecVpc that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIecVpc to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_vpc", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iec_vpc huaweicloud_iec_vpc} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIecVpcConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIecVpcConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_vpc', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_num - computed: true, optional: false, required: false + public get subnetNum() { + return this.getNumberAttribute('subnet_num'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/README.md new file mode 100644 index 00000000..f242a671 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_images_image_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_images_image_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/index.ts new file mode 100644 index 00000000..45617300 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image-v2/index.ts @@ -0,0 +1,741 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudImagesImageV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#architecture DataHuaweicloudImagesImageV2#architecture} + */ + readonly architecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#enterprise_project_id DataHuaweicloudImagesImageV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#flavor_id DataHuaweicloudImagesImageV2#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#id DataHuaweicloudImagesImageV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#image_id DataHuaweicloudImagesImageV2#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#image_type DataHuaweicloudImagesImageV2#image_type} + */ + readonly imageType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#is_whole_image DataHuaweicloudImagesImageV2#is_whole_image} + */ + readonly isWholeImage?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#most_recent DataHuaweicloudImagesImageV2#most_recent} + */ + readonly mostRecent?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#name DataHuaweicloudImagesImageV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#name_regex DataHuaweicloudImagesImageV2#name_regex} + */ + readonly nameRegex?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#os DataHuaweicloudImagesImageV2#os} + */ + readonly os?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#os_version DataHuaweicloudImagesImageV2#os_version} + */ + readonly osVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#owner DataHuaweicloudImagesImageV2#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#region DataHuaweicloudImagesImageV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#size_max DataHuaweicloudImagesImageV2#size_max} + */ + readonly sizeMax?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#size_min DataHuaweicloudImagesImageV2#size_min} + */ + readonly sizeMin?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#sort_direction DataHuaweicloudImagesImageV2#sort_direction} + */ + readonly sortDirection?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#sort_key DataHuaweicloudImagesImageV2#sort_key} + */ + readonly sortKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#tag DataHuaweicloudImagesImageV2#tag} + */ + readonly tag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#visibility DataHuaweicloudImagesImageV2#visibility} + */ + readonly visibility?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2 huaweicloud_images_image_v2} +*/ +export class DataHuaweicloudImagesImageV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudImagesImageV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudImagesImageV2 to import + * @param importFromId The id of the existing DataHuaweicloudImagesImageV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudImagesImageV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image_v2 huaweicloud_images_image_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudImagesImageV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudImagesImageV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._architecture = config.architecture; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._imageType = config.imageType; + this._isWholeImage = config.isWholeImage; + this._mostRecent = config.mostRecent; + this._name = config.name; + this._nameRegex = config.nameRegex; + this._os = config.os; + this._osVersion = config.osVersion; + this._owner = config.owner; + this._region = config.region; + this._sizeMax = config.sizeMax; + this._sizeMin = config.sizeMin; + this._sortDirection = config.sortDirection; + this._sortKey = config.sortKey; + this._tag = config.tag; + this._visibility = config.visibility; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // architecture - computed: true, optional: true, required: false + private _architecture?: string; + public get architecture() { + return this.getStringAttribute('architecture'); + } + public set architecture(value: string) { + this._architecture = value; + } + public resetArchitecture() { + this._architecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get architectureInput() { + return this._architecture; + } + + // backup_id - computed: true, optional: false, required: false + public get backupId() { + return this.getStringAttribute('backup_id'); + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // container_format - computed: true, optional: false, required: false + public get containerFormat() { + return this.getStringAttribute('container_format'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // file - computed: true, optional: false, required: false + public get file() { + return this.getStringAttribute('file'); + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: true, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_type - computed: true, optional: true, required: false + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + public resetImageType() { + this._imageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // is_whole_image - computed: false, optional: true, required: false + private _isWholeImage?: boolean | cdktf.IResolvable; + public get isWholeImage() { + return this.getBooleanAttribute('is_whole_image'); + } + public set isWholeImage(value: boolean | cdktf.IResolvable) { + this._isWholeImage = value; + } + public resetIsWholeImage() { + this._isWholeImage = undefined; + } + // Temporarily expose input value. Use with caution. + public get isWholeImageInput() { + return this._isWholeImage; + } + + // max_ram_mb - computed: true, optional: false, required: false + public get maxRamMb() { + return this.getNumberAttribute('max_ram_mb'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // min_disk_gb - computed: true, optional: false, required: false + public get minDiskGb() { + return this.getNumberAttribute('min_disk_gb'); + } + + // min_ram_mb - computed: true, optional: false, required: false + public get minRamMb() { + return this.getNumberAttribute('min_ram_mb'); + } + + // most_recent - computed: false, optional: true, required: false + private _mostRecent?: boolean | cdktf.IResolvable; + public get mostRecent() { + return this.getBooleanAttribute('most_recent'); + } + public set mostRecent(value: boolean | cdktf.IResolvable) { + this._mostRecent = value; + } + public resetMostRecent() { + this._mostRecent = undefined; + } + // Temporarily expose input value. Use with caution. + public get mostRecentInput() { + return this._mostRecent; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // name_regex - computed: false, optional: true, required: false + private _nameRegex?: string; + public get nameRegex() { + return this.getStringAttribute('name_regex'); + } + public set nameRegex(value: string) { + this._nameRegex = value; + } + public resetNameRegex() { + this._nameRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameRegexInput() { + return this._nameRegex; + } + + // os - computed: true, optional: true, required: false + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + public resetOs() { + this._os = undefined; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // os_version - computed: true, optional: true, required: false + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + public resetOsVersion() { + this._osVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // protected - computed: true, optional: false, required: false + public get protected() { + return this.getBooleanAttribute('protected'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schema - computed: true, optional: false, required: false + public get schema() { + return this.getStringAttribute('schema'); + } + + // size_bytes - computed: true, optional: false, required: false + public get sizeBytes() { + return this.getNumberAttribute('size_bytes'); + } + + // size_max - computed: false, optional: true, required: false + private _sizeMax?: number; + public get sizeMax() { + return this.getNumberAttribute('size_max'); + } + public set sizeMax(value: number) { + this._sizeMax = value; + } + public resetSizeMax() { + this._sizeMax = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeMaxInput() { + return this._sizeMax; + } + + // size_min - computed: false, optional: true, required: false + private _sizeMin?: number; + public get sizeMin() { + return this.getNumberAttribute('size_min'); + } + public set sizeMin(value: number) { + this._sizeMin = value; + } + public resetSizeMin() { + this._sizeMin = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeMinInput() { + return this._sizeMin; + } + + // sort_direction - computed: false, optional: true, required: false + private _sortDirection?: string; + public get sortDirection() { + return this.getStringAttribute('sort_direction'); + } + public set sortDirection(value: string) { + this._sortDirection = value; + } + public resetSortDirection() { + this._sortDirection = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortDirectionInput() { + return this._sortDirection; + } + + // sort_key - computed: false, optional: true, required: false + private _sortKey?: string; + public get sortKey() { + return this.getStringAttribute('sort_key'); + } + public set sortKey(value: string) { + this._sortKey = value; + } + public resetSortKey() { + this._sortKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortKeyInput() { + return this._sortKey; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tag - computed: false, optional: true, required: false + private _tag?: string; + public get tag() { + return this.getStringAttribute('tag'); + } + public set tag(value: string) { + this._tag = value; + } + public resetTag() { + this._tag = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagInput() { + return this._tag; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: true, required: false + private _visibility?: string; + public get visibility() { + return this.getStringAttribute('visibility'); + } + public set visibility(value: string) { + this._visibility = value; + } + public resetVisibility() { + this._visibility = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityInput() { + return this._visibility; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + architecture: cdktf.stringToTerraform(this._architecture), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_type: cdktf.stringToTerraform(this._imageType), + is_whole_image: cdktf.booleanToTerraform(this._isWholeImage), + most_recent: cdktf.booleanToTerraform(this._mostRecent), + name: cdktf.stringToTerraform(this._name), + name_regex: cdktf.stringToTerraform(this._nameRegex), + os: cdktf.stringToTerraform(this._os), + os_version: cdktf.stringToTerraform(this._osVersion), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + size_max: cdktf.numberToTerraform(this._sizeMax), + size_min: cdktf.numberToTerraform(this._sizeMin), + sort_direction: cdktf.stringToTerraform(this._sortDirection), + sort_key: cdktf.stringToTerraform(this._sortKey), + tag: cdktf.stringToTerraform(this._tag), + visibility: cdktf.stringToTerraform(this._visibility), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + architecture: { + value: cdktf.stringToHclTerraform(this._architecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_whole_image: { + value: cdktf.booleanToHclTerraform(this._isWholeImage), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + most_recent: { + value: cdktf.booleanToHclTerraform(this._mostRecent), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_regex: { + value: cdktf.stringToHclTerraform(this._nameRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size_max: { + value: cdktf.numberToHclTerraform(this._sizeMax), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size_min: { + value: cdktf.numberToHclTerraform(this._sizeMin), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sort_direction: { + value: cdktf.stringToHclTerraform(this._sortDirection), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_key: { + value: cdktf.stringToHclTerraform(this._sortKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag: { + value: cdktf.stringToHclTerraform(this._tag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility: { + value: cdktf.stringToHclTerraform(this._visibility), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-images-image/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image/README.md new file mode 100644 index 00000000..f9f89ee7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_images_image` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_images_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-images-image/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image/index.ts new file mode 100644 index 00000000..958ca90b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-images-image/index.ts @@ -0,0 +1,741 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudImagesImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#architecture DataHuaweicloudImagesImage#architecture} + */ + readonly architecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#enterprise_project_id DataHuaweicloudImagesImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#flavor_id DataHuaweicloudImagesImage#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#id DataHuaweicloudImagesImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#image_id DataHuaweicloudImagesImage#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#image_type DataHuaweicloudImagesImage#image_type} + */ + readonly imageType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#is_whole_image DataHuaweicloudImagesImage#is_whole_image} + */ + readonly isWholeImage?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#most_recent DataHuaweicloudImagesImage#most_recent} + */ + readonly mostRecent?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#name DataHuaweicloudImagesImage#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#name_regex DataHuaweicloudImagesImage#name_regex} + */ + readonly nameRegex?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#os DataHuaweicloudImagesImage#os} + */ + readonly os?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#os_version DataHuaweicloudImagesImage#os_version} + */ + readonly osVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#owner DataHuaweicloudImagesImage#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#region DataHuaweicloudImagesImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#size_max DataHuaweicloudImagesImage#size_max} + */ + readonly sizeMax?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#size_min DataHuaweicloudImagesImage#size_min} + */ + readonly sizeMin?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#sort_direction DataHuaweicloudImagesImage#sort_direction} + */ + readonly sortDirection?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#sort_key DataHuaweicloudImagesImage#sort_key} + */ + readonly sortKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#tag DataHuaweicloudImagesImage#tag} + */ + readonly tag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#visibility DataHuaweicloudImagesImage#visibility} + */ + readonly visibility?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image huaweicloud_images_image} +*/ +export class DataHuaweicloudImagesImage extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudImagesImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudImagesImage to import + * @param importFromId The id of the existing DataHuaweicloudImagesImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudImagesImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_image huaweicloud_images_image} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudImagesImageConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudImagesImageConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._architecture = config.architecture; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._imageType = config.imageType; + this._isWholeImage = config.isWholeImage; + this._mostRecent = config.mostRecent; + this._name = config.name; + this._nameRegex = config.nameRegex; + this._os = config.os; + this._osVersion = config.osVersion; + this._owner = config.owner; + this._region = config.region; + this._sizeMax = config.sizeMax; + this._sizeMin = config.sizeMin; + this._sortDirection = config.sortDirection; + this._sortKey = config.sortKey; + this._tag = config.tag; + this._visibility = config.visibility; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // architecture - computed: true, optional: true, required: false + private _architecture?: string; + public get architecture() { + return this.getStringAttribute('architecture'); + } + public set architecture(value: string) { + this._architecture = value; + } + public resetArchitecture() { + this._architecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get architectureInput() { + return this._architecture; + } + + // backup_id - computed: true, optional: false, required: false + public get backupId() { + return this.getStringAttribute('backup_id'); + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // container_format - computed: true, optional: false, required: false + public get containerFormat() { + return this.getStringAttribute('container_format'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // file - computed: true, optional: false, required: false + public get file() { + return this.getStringAttribute('file'); + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: true, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_type - computed: true, optional: true, required: false + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + public resetImageType() { + this._imageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // is_whole_image - computed: false, optional: true, required: false + private _isWholeImage?: boolean | cdktf.IResolvable; + public get isWholeImage() { + return this.getBooleanAttribute('is_whole_image'); + } + public set isWholeImage(value: boolean | cdktf.IResolvable) { + this._isWholeImage = value; + } + public resetIsWholeImage() { + this._isWholeImage = undefined; + } + // Temporarily expose input value. Use with caution. + public get isWholeImageInput() { + return this._isWholeImage; + } + + // max_ram_mb - computed: true, optional: false, required: false + public get maxRamMb() { + return this.getNumberAttribute('max_ram_mb'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // min_disk_gb - computed: true, optional: false, required: false + public get minDiskGb() { + return this.getNumberAttribute('min_disk_gb'); + } + + // min_ram_mb - computed: true, optional: false, required: false + public get minRamMb() { + return this.getNumberAttribute('min_ram_mb'); + } + + // most_recent - computed: false, optional: true, required: false + private _mostRecent?: boolean | cdktf.IResolvable; + public get mostRecent() { + return this.getBooleanAttribute('most_recent'); + } + public set mostRecent(value: boolean | cdktf.IResolvable) { + this._mostRecent = value; + } + public resetMostRecent() { + this._mostRecent = undefined; + } + // Temporarily expose input value. Use with caution. + public get mostRecentInput() { + return this._mostRecent; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // name_regex - computed: false, optional: true, required: false + private _nameRegex?: string; + public get nameRegex() { + return this.getStringAttribute('name_regex'); + } + public set nameRegex(value: string) { + this._nameRegex = value; + } + public resetNameRegex() { + this._nameRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameRegexInput() { + return this._nameRegex; + } + + // os - computed: true, optional: true, required: false + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + public resetOs() { + this._os = undefined; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // os_version - computed: true, optional: true, required: false + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + public resetOsVersion() { + this._osVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // protected - computed: true, optional: false, required: false + public get protected() { + return this.getBooleanAttribute('protected'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schema - computed: true, optional: false, required: false + public get schema() { + return this.getStringAttribute('schema'); + } + + // size_bytes - computed: true, optional: false, required: false + public get sizeBytes() { + return this.getNumberAttribute('size_bytes'); + } + + // size_max - computed: false, optional: true, required: false + private _sizeMax?: number; + public get sizeMax() { + return this.getNumberAttribute('size_max'); + } + public set sizeMax(value: number) { + this._sizeMax = value; + } + public resetSizeMax() { + this._sizeMax = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeMaxInput() { + return this._sizeMax; + } + + // size_min - computed: false, optional: true, required: false + private _sizeMin?: number; + public get sizeMin() { + return this.getNumberAttribute('size_min'); + } + public set sizeMin(value: number) { + this._sizeMin = value; + } + public resetSizeMin() { + this._sizeMin = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeMinInput() { + return this._sizeMin; + } + + // sort_direction - computed: false, optional: true, required: false + private _sortDirection?: string; + public get sortDirection() { + return this.getStringAttribute('sort_direction'); + } + public set sortDirection(value: string) { + this._sortDirection = value; + } + public resetSortDirection() { + this._sortDirection = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortDirectionInput() { + return this._sortDirection; + } + + // sort_key - computed: false, optional: true, required: false + private _sortKey?: string; + public get sortKey() { + return this.getStringAttribute('sort_key'); + } + public set sortKey(value: string) { + this._sortKey = value; + } + public resetSortKey() { + this._sortKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortKeyInput() { + return this._sortKey; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tag - computed: false, optional: true, required: false + private _tag?: string; + public get tag() { + return this.getStringAttribute('tag'); + } + public set tag(value: string) { + this._tag = value; + } + public resetTag() { + this._tag = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagInput() { + return this._tag; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: true, required: false + private _visibility?: string; + public get visibility() { + return this.getStringAttribute('visibility'); + } + public set visibility(value: string) { + this._visibility = value; + } + public resetVisibility() { + this._visibility = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityInput() { + return this._visibility; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + architecture: cdktf.stringToTerraform(this._architecture), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_type: cdktf.stringToTerraform(this._imageType), + is_whole_image: cdktf.booleanToTerraform(this._isWholeImage), + most_recent: cdktf.booleanToTerraform(this._mostRecent), + name: cdktf.stringToTerraform(this._name), + name_regex: cdktf.stringToTerraform(this._nameRegex), + os: cdktf.stringToTerraform(this._os), + os_version: cdktf.stringToTerraform(this._osVersion), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + size_max: cdktf.numberToTerraform(this._sizeMax), + size_min: cdktf.numberToTerraform(this._sizeMin), + sort_direction: cdktf.stringToTerraform(this._sortDirection), + sort_key: cdktf.stringToTerraform(this._sortKey), + tag: cdktf.stringToTerraform(this._tag), + visibility: cdktf.stringToTerraform(this._visibility), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + architecture: { + value: cdktf.stringToHclTerraform(this._architecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_whole_image: { + value: cdktf.booleanToHclTerraform(this._isWholeImage), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + most_recent: { + value: cdktf.booleanToHclTerraform(this._mostRecent), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_regex: { + value: cdktf.stringToHclTerraform(this._nameRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size_max: { + value: cdktf.numberToHclTerraform(this._sizeMax), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size_min: { + value: cdktf.numberToHclTerraform(this._sizeMin), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sort_direction: { + value: cdktf.stringToHclTerraform(this._sortDirection), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_key: { + value: cdktf.stringToHclTerraform(this._sortKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag: { + value: cdktf.stringToHclTerraform(this._tag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility: { + value: cdktf.stringToHclTerraform(this._visibility), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-images-images/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-images-images/README.md new file mode 100644 index 00000000..42dabb2a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-images-images/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_images_images` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_images_images`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-images-images/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-images-images/index.ts new file mode 100644 index 00000000..0fff5b0f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-images-images/index.ts @@ -0,0 +1,767 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudImagesImagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#architecture DataHuaweicloudImagesImages#architecture} + */ + readonly architecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#enterprise_project_id DataHuaweicloudImagesImages#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#flavor_id DataHuaweicloudImagesImages#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#id DataHuaweicloudImagesImages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#image_id DataHuaweicloudImagesImages#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#image_type DataHuaweicloudImagesImages#image_type} + */ + readonly imageType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#is_whole_image DataHuaweicloudImagesImages#is_whole_image} + */ + readonly isWholeImage?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#name DataHuaweicloudImagesImages#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#name_regex DataHuaweicloudImagesImages#name_regex} + */ + readonly nameRegex?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#os DataHuaweicloudImagesImages#os} + */ + readonly os?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#os_version DataHuaweicloudImagesImages#os_version} + */ + readonly osVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#owner DataHuaweicloudImagesImages#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#region DataHuaweicloudImagesImages#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#sort_direction DataHuaweicloudImagesImages#sort_direction} + */ + readonly sortDirection?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#sort_key DataHuaweicloudImagesImages#sort_key} + */ + readonly sortKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#tag DataHuaweicloudImagesImages#tag} + */ + readonly tag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#visibility DataHuaweicloudImagesImages#visibility} + */ + readonly visibility?: string; +} +export interface DataHuaweicloudImagesImagesImages { +} + +export function dataHuaweicloudImagesImagesImagesToTerraform(struct?: DataHuaweicloudImagesImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudImagesImagesImagesToHclTerraform(struct?: DataHuaweicloudImagesImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudImagesImagesImagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudImagesImagesImages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudImagesImagesImages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // architecture - computed: true, optional: false, required: false + public get architecture() { + return this.getStringAttribute('architecture'); + } + + // backup_id - computed: true, optional: false, required: false + public get backupId() { + return this.getStringAttribute('backup_id'); + } + + // container_format - computed: true, optional: false, required: false + public get containerFormat() { + return this.getStringAttribute('container_format'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // file - computed: true, optional: false, required: false + public get file() { + return this.getStringAttribute('file'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // max_ram_mb - computed: true, optional: false, required: false + public get maxRamMb() { + return this.getNumberAttribute('max_ram_mb'); + } + + // min_disk_gb - computed: true, optional: false, required: false + public get minDiskGb() { + return this.getNumberAttribute('min_disk_gb'); + } + + // min_ram_mb - computed: true, optional: false, required: false + public get minRamMb() { + return this.getNumberAttribute('min_ram_mb'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // protected - computed: true, optional: false, required: false + public get protected() { + return this.getBooleanAttribute('protected'); + } + + // schema - computed: true, optional: false, required: false + public get schema() { + return this.getStringAttribute('schema'); + } + + // size_bytes - computed: true, optional: false, required: false + public get sizeBytes() { + return this.getNumberAttribute('size_bytes'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } +} + +export class DataHuaweicloudImagesImagesImagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudImagesImagesImagesOutputReference { + return new DataHuaweicloudImagesImagesImagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images huaweicloud_images_images} +*/ +export class DataHuaweicloudImagesImages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_images"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudImagesImages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudImagesImages to import + * @param importFromId The id of the existing DataHuaweicloudImagesImages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudImagesImages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_images", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/images_images huaweicloud_images_images} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudImagesImagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudImagesImagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_images', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._architecture = config.architecture; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._imageType = config.imageType; + this._isWholeImage = config.isWholeImage; + this._name = config.name; + this._nameRegex = config.nameRegex; + this._os = config.os; + this._osVersion = config.osVersion; + this._owner = config.owner; + this._region = config.region; + this._sortDirection = config.sortDirection; + this._sortKey = config.sortKey; + this._tag = config.tag; + this._visibility = config.visibility; + } + + // ========== + // ATTRIBUTES + // ========== + + // architecture - computed: false, optional: true, required: false + private _architecture?: string; + public get architecture() { + return this.getStringAttribute('architecture'); + } + public set architecture(value: string) { + this._architecture = value; + } + public resetArchitecture() { + this._architecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get architectureInput() { + return this._architecture; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_type - computed: false, optional: true, required: false + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + public resetImageType() { + this._imageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // images - computed: true, optional: false, required: false + private _images = new DataHuaweicloudImagesImagesImagesList(this, "images", false); + public get images() { + return this._images; + } + + // is_whole_image - computed: false, optional: true, required: false + private _isWholeImage?: boolean | cdktf.IResolvable; + public get isWholeImage() { + return this.getBooleanAttribute('is_whole_image'); + } + public set isWholeImage(value: boolean | cdktf.IResolvable) { + this._isWholeImage = value; + } + public resetIsWholeImage() { + this._isWholeImage = undefined; + } + // Temporarily expose input value. Use with caution. + public get isWholeImageInput() { + return this._isWholeImage; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // name_regex - computed: false, optional: true, required: false + private _nameRegex?: string; + public get nameRegex() { + return this.getStringAttribute('name_regex'); + } + public set nameRegex(value: string) { + this._nameRegex = value; + } + public resetNameRegex() { + this._nameRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameRegexInput() { + return this._nameRegex; + } + + // os - computed: false, optional: true, required: false + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + public resetOs() { + this._os = undefined; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // os_version - computed: false, optional: true, required: false + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + public resetOsVersion() { + this._osVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // owner - computed: false, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sort_direction - computed: false, optional: true, required: false + private _sortDirection?: string; + public get sortDirection() { + return this.getStringAttribute('sort_direction'); + } + public set sortDirection(value: string) { + this._sortDirection = value; + } + public resetSortDirection() { + this._sortDirection = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortDirectionInput() { + return this._sortDirection; + } + + // sort_key - computed: false, optional: true, required: false + private _sortKey?: string; + public get sortKey() { + return this.getStringAttribute('sort_key'); + } + public set sortKey(value: string) { + this._sortKey = value; + } + public resetSortKey() { + this._sortKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortKeyInput() { + return this._sortKey; + } + + // tag - computed: false, optional: true, required: false + private _tag?: string; + public get tag() { + return this.getStringAttribute('tag'); + } + public set tag(value: string) { + this._tag = value; + } + public resetTag() { + this._tag = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagInput() { + return this._tag; + } + + // visibility - computed: false, optional: true, required: false + private _visibility?: string; + public get visibility() { + return this.getStringAttribute('visibility'); + } + public set visibility(value: string) { + this._visibility = value; + } + public resetVisibility() { + this._visibility = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityInput() { + return this._visibility; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + architecture: cdktf.stringToTerraform(this._architecture), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_type: cdktf.stringToTerraform(this._imageType), + is_whole_image: cdktf.booleanToTerraform(this._isWholeImage), + name: cdktf.stringToTerraform(this._name), + name_regex: cdktf.stringToTerraform(this._nameRegex), + os: cdktf.stringToTerraform(this._os), + os_version: cdktf.stringToTerraform(this._osVersion), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + sort_direction: cdktf.stringToTerraform(this._sortDirection), + sort_key: cdktf.stringToTerraform(this._sortKey), + tag: cdktf.stringToTerraform(this._tag), + visibility: cdktf.stringToTerraform(this._visibility), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + architecture: { + value: cdktf.stringToHclTerraform(this._architecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_whole_image: { + value: cdktf.booleanToHclTerraform(this._isWholeImage), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_regex: { + value: cdktf.stringToHclTerraform(this._nameRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_direction: { + value: cdktf.stringToHclTerraform(this._sortDirection), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_key: { + value: cdktf.stringToHclTerraform(this._sortKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag: { + value: cdktf.stringToHclTerraform(this._tag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility: { + value: cdktf.stringToHclTerraform(this._visibility), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/README.md new file mode 100644 index 00000000..e15617ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ims_os_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ims_os_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/index.ts new file mode 100644 index 00000000..468ff12f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-os-versions/index.ts @@ -0,0 +1,354 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudImsOsVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions#id DataHuaweicloudImsOsVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions#region DataHuaweicloudImsOsVersions#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions#tag DataHuaweicloudImsOsVersions#tag} + */ + readonly tag?: string; +} +export interface DataHuaweicloudImsOsVersionsOsVersionsVersions { +} + +export function dataHuaweicloudImsOsVersionsOsVersionsVersionsToTerraform(struct?: DataHuaweicloudImsOsVersionsOsVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudImsOsVersionsOsVersionsVersionsToHclTerraform(struct?: DataHuaweicloudImsOsVersionsOsVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudImsOsVersionsOsVersionsVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudImsOsVersionsOsVersionsVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudImsOsVersionsOsVersionsVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // os_bit - computed: true, optional: false, required: false + public get osBit() { + return this.getNumberAttribute('os_bit'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // os_version_key - computed: true, optional: false, required: false + public get osVersionKey() { + return this.getStringAttribute('os_version_key'); + } + + // platform - computed: true, optional: false, required: false + public get platform() { + return this.getStringAttribute('platform'); + } +} + +export class DataHuaweicloudImsOsVersionsOsVersionsVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudImsOsVersionsOsVersionsVersionsOutputReference { + return new DataHuaweicloudImsOsVersionsOsVersionsVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudImsOsVersionsOsVersions { +} + +export function dataHuaweicloudImsOsVersionsOsVersionsToTerraform(struct?: DataHuaweicloudImsOsVersionsOsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudImsOsVersionsOsVersionsToHclTerraform(struct?: DataHuaweicloudImsOsVersionsOsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudImsOsVersionsOsVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudImsOsVersionsOsVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudImsOsVersionsOsVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // platform - computed: true, optional: false, required: false + public get platform() { + return this.getStringAttribute('platform'); + } + + // versions - computed: true, optional: false, required: false + private _versions = new DataHuaweicloudImsOsVersionsOsVersionsVersionsList(this, "versions", false); + public get versions() { + return this._versions; + } +} + +export class DataHuaweicloudImsOsVersionsOsVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudImsOsVersionsOsVersionsOutputReference { + return new DataHuaweicloudImsOsVersionsOsVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions huaweicloud_ims_os_versions} +*/ +export class DataHuaweicloudImsOsVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_os_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudImsOsVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudImsOsVersions to import + * @param importFromId The id of the existing DataHuaweicloudImsOsVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudImsOsVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_os_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_os_versions huaweicloud_ims_os_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudImsOsVersionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudImsOsVersionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_os_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._tag = config.tag; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // os_versions - computed: true, optional: false, required: false + private _osVersions = new DataHuaweicloudImsOsVersionsOsVersionsList(this, "os_versions", false); + public get osVersions() { + return this._osVersions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tag - computed: false, optional: true, required: false + private _tag?: string; + public get tag() { + return this.getStringAttribute('tag'); + } + public set tag(value: string) { + this._tag = value; + } + public resetTag() { + this._tag = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagInput() { + return this._tag; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + tag: cdktf.stringToTerraform(this._tag), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag: { + value: cdktf.stringToHclTerraform(this._tag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/README.md new file mode 100644 index 00000000..34f645c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ims_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ims_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/index.ts new file mode 100644 index 00000000..42a9500a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ims-quotas/index.ts @@ -0,0 +1,323 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudImsQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas#id DataHuaweicloudImsQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas#region DataHuaweicloudImsQuotas#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudImsQuotasQuotasResources { +} + +export function dataHuaweicloudImsQuotasQuotasResourcesToTerraform(struct?: DataHuaweicloudImsQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudImsQuotasQuotasResourcesToHclTerraform(struct?: DataHuaweicloudImsQuotasQuotasResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudImsQuotasQuotasResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudImsQuotasQuotasResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudImsQuotasQuotasResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // max - computed: true, optional: false, required: false + public get max() { + return this.getNumberAttribute('max'); + } + + // min - computed: true, optional: false, required: false + public get min() { + return this.getNumberAttribute('min'); + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudImsQuotasQuotasResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudImsQuotasQuotasResourcesOutputReference { + return new DataHuaweicloudImsQuotasQuotasResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudImsQuotasQuotas { +} + +export function dataHuaweicloudImsQuotasQuotasToTerraform(struct?: DataHuaweicloudImsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudImsQuotasQuotasToHclTerraform(struct?: DataHuaweicloudImsQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudImsQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudImsQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudImsQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudImsQuotasQuotasResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DataHuaweicloudImsQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudImsQuotasQuotasOutputReference { + return new DataHuaweicloudImsQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas huaweicloud_ims_quotas} +*/ +export class DataHuaweicloudImsQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudImsQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudImsQuotas to import + * @param importFromId The id of the existing DataHuaweicloudImsQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudImsQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ims_quotas huaweicloud_ims_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudImsQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudImsQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudImsQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/README.md new file mode 100644 index 00000000..bf39f16f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_amqps` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_amqps`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/index.ts new file mode 100644 index 00000000..9cb1c0b0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-amqps/index.ts @@ -0,0 +1,296 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaAmqpsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps#id DataHuaweicloudIotdaAmqps#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps#name DataHuaweicloudIotdaAmqps#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps#queue_id DataHuaweicloudIotdaAmqps#queue_id} + */ + readonly queueId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps#region DataHuaweicloudIotdaAmqps#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudIotdaAmqpsQueues { +} + +export function dataHuaweicloudIotdaAmqpsQueuesToTerraform(struct?: DataHuaweicloudIotdaAmqpsQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaAmqpsQueuesToHclTerraform(struct?: DataHuaweicloudIotdaAmqpsQueues): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaAmqpsQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaAmqpsQueues | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaAmqpsQueues | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudIotdaAmqpsQueuesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaAmqpsQueuesOutputReference { + return new DataHuaweicloudIotdaAmqpsQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps huaweicloud_iotda_amqps} +*/ +export class DataHuaweicloudIotdaAmqps extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_amqps"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaAmqps resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaAmqps to import + * @param importFromId The id of the existing DataHuaweicloudIotdaAmqps that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaAmqps to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_amqps", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_amqps huaweicloud_iotda_amqps} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaAmqpsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaAmqpsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_amqps', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._queueId = config.queueId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // queue_id - computed: false, optional: true, required: false + private _queueId?: string; + public get queueId() { + return this.getStringAttribute('queue_id'); + } + public set queueId(value: string) { + this._queueId = value; + } + public resetQueueId() { + this._queueId = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueIdInput() { + return this._queueId; + } + + // queues - computed: true, optional: false, required: false + private _queues = new DataHuaweicloudIotdaAmqpsQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + queue_id: cdktf.stringToTerraform(this._queueId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_id: { + value: cdktf.stringToHclTerraform(this._queueId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/README.md new file mode 100644 index 00000000..6d011f4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_batchtasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_batchtasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/index.ts new file mode 100644 index 00000000..fae3bc3e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-batchtasks/index.ts @@ -0,0 +1,549 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaBatchtasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks#id DataHuaweicloudIotdaBatchtasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks#region DataHuaweicloudIotdaBatchtasks#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks#space_id DataHuaweicloudIotdaBatchtasks#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks#status DataHuaweicloudIotdaBatchtasks#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks#type DataHuaweicloudIotdaBatchtasks#type} + */ + readonly type: string; +} +export interface DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicy { +} + +export function dataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyToTerraform(struct?: DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyToHclTerraform(struct?: DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // retry_count - computed: true, optional: false, required: false + public get retryCount() { + return this.getNumberAttribute('retry_count'); + } + + // retry_interval - computed: true, optional: false, required: false + public get retryInterval() { + return this.getNumberAttribute('retry_interval'); + } + + // schedule_time - computed: true, optional: false, required: false + public get scheduleTime() { + return this.getStringAttribute('schedule_time'); + } +} + +export class DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyOutputReference { + return new DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgress { +} + +export function dataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressToTerraform(struct?: DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressToHclTerraform(struct?: DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgress | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgress | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // fail - computed: true, optional: false, required: false + public get fail() { + return this.getNumberAttribute('fail'); + } + + // fail_wait_retry - computed: true, optional: false, required: false + public get failWaitRetry() { + return this.getNumberAttribute('fail_wait_retry'); + } + + // processing - computed: true, optional: false, required: false + public get processing() { + return this.getNumberAttribute('processing'); + } + + // removed - computed: true, optional: false, required: false + public get removed() { + return this.getNumberAttribute('removed'); + } + + // stopped - computed: true, optional: false, required: false + public get stopped() { + return this.getNumberAttribute('stopped'); + } + + // success - computed: true, optional: false, required: false + public get success() { + return this.getNumberAttribute('success'); + } + + // total - computed: true, optional: false, required: false + public get total() { + return this.getNumberAttribute('total'); + } + + // waitting - computed: true, optional: false, required: false + public get waitting() { + return this.getNumberAttribute('waitting'); + } +} + +export class DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressOutputReference { + return new DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaBatchtasksBatchtasks { +} + +export function dataHuaweicloudIotdaBatchtasksBatchtasksToTerraform(struct?: DataHuaweicloudIotdaBatchtasksBatchtasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaBatchtasksBatchtasksToHclTerraform(struct?: DataHuaweicloudIotdaBatchtasksBatchtasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaBatchtasksBatchtasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaBatchtasksBatchtasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaBatchtasksBatchtasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_desc - computed: true, optional: false, required: false + public get statusDesc() { + return this.getStringAttribute('status_desc'); + } + + // targets - computed: true, optional: false, required: false + public get targets() { + return this.getListAttribute('targets'); + } + + // targets_filter - computed: true, optional: false, required: false + private _targetsFilter = new cdktf.StringMap(this, "targets_filter"); + public get targetsFilter() { + return this._targetsFilter; + } + + // task_policy - computed: true, optional: false, required: false + private _taskPolicy = new DataHuaweicloudIotdaBatchtasksBatchtasksTaskPolicyList(this, "task_policy", false); + public get taskPolicy() { + return this._taskPolicy; + } + + // task_progress - computed: true, optional: false, required: false + private _taskProgress = new DataHuaweicloudIotdaBatchtasksBatchtasksTaskProgressList(this, "task_progress", false); + public get taskProgress() { + return this._taskProgress; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudIotdaBatchtasksBatchtasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaBatchtasksBatchtasksOutputReference { + return new DataHuaweicloudIotdaBatchtasksBatchtasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks huaweicloud_iotda_batchtasks} +*/ +export class DataHuaweicloudIotdaBatchtasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_batchtasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaBatchtasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaBatchtasks to import + * @param importFromId The id of the existing DataHuaweicloudIotdaBatchtasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaBatchtasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_batchtasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_batchtasks huaweicloud_iotda_batchtasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaBatchtasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaBatchtasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_batchtasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._spaceId = config.spaceId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // batchtasks - computed: true, optional: false, required: false + private _batchtasks = new DataHuaweicloudIotdaBatchtasksBatchtasksList(this, "batchtasks", false); + public get batchtasks() { + return this._batchtasks; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/README.md new file mode 100644 index 00000000..10813f34 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_data_backlog_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_data_backlog_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/index.ts new file mode 100644 index 00000000..efdea498 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-backlog-policies/index.ts @@ -0,0 +1,273 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDataBacklogPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies#id DataHuaweicloudIotdaDataBacklogPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies#policy_name DataHuaweicloudIotdaDataBacklogPolicies#policy_name} + */ + readonly policyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies#region DataHuaweicloudIotdaDataBacklogPolicies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudIotdaDataBacklogPoliciesPolicies { +} + +export function dataHuaweicloudIotdaDataBacklogPoliciesPoliciesToTerraform(struct?: DataHuaweicloudIotdaDataBacklogPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDataBacklogPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudIotdaDataBacklogPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDataBacklogPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDataBacklogPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDataBacklogPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backlog_size - computed: true, optional: false, required: false + public get backlogSize() { + return this.getNumberAttribute('backlog_size'); + } + + // backlog_time - computed: true, optional: false, required: false + public get backlogTime() { + return this.getNumberAttribute('backlog_time'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudIotdaDataBacklogPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDataBacklogPoliciesPoliciesOutputReference { + return new DataHuaweicloudIotdaDataBacklogPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies huaweicloud_iotda_data_backlog_policies} +*/ +export class DataHuaweicloudIotdaDataBacklogPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_data_backlog_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDataBacklogPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDataBacklogPolicies to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDataBacklogPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDataBacklogPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_data_backlog_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_backlog_policies huaweicloud_iotda_data_backlog_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDataBacklogPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDataBacklogPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_data_backlog_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._policyName = config.policyName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudIotdaDataBacklogPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_name - computed: false, optional: true, required: false + private _policyName?: string; + public get policyName() { + return this.getStringAttribute('policy_name'); + } + public set policyName(value: string) { + this._policyName = value; + } + public resetPolicyName() { + this._policyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyNameInput() { + return this._policyName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + policy_name: cdktf.stringToTerraform(this._policyName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_name: { + value: cdktf.stringToHclTerraform(this._policyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/README.md new file mode 100644 index 00000000..5813dcd3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_data_flow_control_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_data_flow_control_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/index.ts new file mode 100644 index 00000000..adb4a176 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-data-flow-control-policies/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDataFlowControlPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies#id DataHuaweicloudIotdaDataFlowControlPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies#policy_name DataHuaweicloudIotdaDataFlowControlPolicies#policy_name} + */ + readonly policyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies#region DataHuaweicloudIotdaDataFlowControlPolicies#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies#scope DataHuaweicloudIotdaDataFlowControlPolicies#scope} + */ + readonly scope?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies#scope_value DataHuaweicloudIotdaDataFlowControlPolicies#scope_value} + */ + readonly scopeValue?: string; +} +export interface DataHuaweicloudIotdaDataFlowControlPoliciesPolicies { +} + +export function dataHuaweicloudIotdaDataFlowControlPoliciesPoliciesToTerraform(struct?: DataHuaweicloudIotdaDataFlowControlPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDataFlowControlPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudIotdaDataFlowControlPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDataFlowControlPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDataFlowControlPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDataFlowControlPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // limit - computed: true, optional: false, required: false + public get limit() { + return this.getNumberAttribute('limit'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // scope - computed: true, optional: false, required: false + public get scope() { + return this.getStringAttribute('scope'); + } + + // scope_value - computed: true, optional: false, required: false + public get scopeValue() { + return this.getStringAttribute('scope_value'); + } +} + +export class DataHuaweicloudIotdaDataFlowControlPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDataFlowControlPoliciesPoliciesOutputReference { + return new DataHuaweicloudIotdaDataFlowControlPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies huaweicloud_iotda_data_flow_control_policies} +*/ +export class DataHuaweicloudIotdaDataFlowControlPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_data_flow_control_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDataFlowControlPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDataFlowControlPolicies to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDataFlowControlPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDataFlowControlPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_data_flow_control_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_data_flow_control_policies huaweicloud_iotda_data_flow_control_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDataFlowControlPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDataFlowControlPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_data_flow_control_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._policyName = config.policyName; + this._region = config.region; + this._scope = config.scope; + this._scopeValue = config.scopeValue; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudIotdaDataFlowControlPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // policy_name - computed: false, optional: true, required: false + private _policyName?: string; + public get policyName() { + return this.getStringAttribute('policy_name'); + } + public set policyName(value: string) { + this._policyName = value; + } + public resetPolicyName() { + this._policyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyNameInput() { + return this._policyName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scope - computed: false, optional: true, required: false + private _scope?: string; + public get scope() { + return this.getStringAttribute('scope'); + } + public set scope(value: string) { + this._scope = value; + } + public resetScope() { + this._scope = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeInput() { + return this._scope; + } + + // scope_value - computed: false, optional: true, required: false + private _scopeValue?: string; + public get scopeValue() { + return this.getStringAttribute('scope_value'); + } + public set scopeValue(value: string) { + this._scopeValue = value; + } + public resetScopeValue() { + this._scopeValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeValueInput() { + return this._scopeValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + policy_name: cdktf.stringToTerraform(this._policyName), + region: cdktf.stringToTerraform(this._region), + scope: cdktf.stringToTerraform(this._scope), + scope_value: cdktf.stringToTerraform(this._scopeValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_name: { + value: cdktf.stringToHclTerraform(this._policyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scope: { + value: cdktf.stringToHclTerraform(this._scope), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scope_value: { + value: cdktf.stringToHclTerraform(this._scopeValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/README.md new file mode 100644 index 00000000..ce9e96e9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_dataforwarding_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_dataforwarding_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/index.ts new file mode 100644 index 00000000..5daae204 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-dataforwarding-rules/index.ts @@ -0,0 +1,466 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDataforwardingRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#app_type DataHuaweicloudIotdaDataforwardingRules#app_type} + */ + readonly appType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#enabled DataHuaweicloudIotdaDataforwardingRules#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#id DataHuaweicloudIotdaDataforwardingRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#name DataHuaweicloudIotdaDataforwardingRules#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#region DataHuaweicloudIotdaDataforwardingRules#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#resource DataHuaweicloudIotdaDataforwardingRules#resource} + */ + readonly resource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#rule_id DataHuaweicloudIotdaDataforwardingRules#rule_id} + */ + readonly ruleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#space_id DataHuaweicloudIotdaDataforwardingRules#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#trigger DataHuaweicloudIotdaDataforwardingRules#trigger} + */ + readonly trigger?: string; +} +export interface DataHuaweicloudIotdaDataforwardingRulesRules { +} + +export function dataHuaweicloudIotdaDataforwardingRulesRulesToTerraform(struct?: DataHuaweicloudIotdaDataforwardingRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDataforwardingRulesRulesToHclTerraform(struct?: DataHuaweicloudIotdaDataforwardingRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDataforwardingRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDataforwardingRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDataforwardingRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_type - computed: true, optional: false, required: false + public get appType() { + return this.getStringAttribute('app_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource - computed: true, optional: false, required: false + public get resource() { + return this.getStringAttribute('resource'); + } + + // select - computed: true, optional: false, required: false + public get select() { + return this.getStringAttribute('select'); + } + + // space_id - computed: true, optional: false, required: false + public get spaceId() { + return this.getStringAttribute('space_id'); + } + + // trigger - computed: true, optional: false, required: false + public get trigger() { + return this.getStringAttribute('trigger'); + } + + // where - computed: true, optional: false, required: false + public get where() { + return this.getStringAttribute('where'); + } +} + +export class DataHuaweicloudIotdaDataforwardingRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDataforwardingRulesRulesOutputReference { + return new DataHuaweicloudIotdaDataforwardingRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules huaweicloud_iotda_dataforwarding_rules} +*/ +export class DataHuaweicloudIotdaDataforwardingRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_dataforwarding_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDataforwardingRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDataforwardingRules to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDataforwardingRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDataforwardingRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_dataforwarding_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_dataforwarding_rules huaweicloud_iotda_dataforwarding_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDataforwardingRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDataforwardingRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_dataforwarding_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appType = config.appType; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._resource = config.resource; + this._ruleId = config.ruleId; + this._spaceId = config.spaceId; + this._trigger = config.trigger; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_type - computed: false, optional: true, required: false + private _appType?: string; + public get appType() { + return this.getStringAttribute('app_type'); + } + public set appType(value: string) { + this._appType = value; + } + public resetAppType() { + this._appType = undefined; + } + // Temporarily expose input value. Use with caution. + public get appTypeInput() { + return this._appType; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource - computed: false, optional: true, required: false + private _resource?: string; + public get resource() { + return this.getStringAttribute('resource'); + } + public set resource(value: string) { + this._resource = value; + } + public resetResource() { + this._resource = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceInput() { + return this._resource; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudIotdaDataforwardingRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // trigger - computed: false, optional: true, required: false + private _trigger?: string; + public get trigger() { + return this.getStringAttribute('trigger'); + } + public set trigger(value: string) { + this._trigger = value; + } + public resetTrigger() { + this._trigger = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerInput() { + return this._trigger; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_type: cdktf.stringToTerraform(this._appType), + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource: cdktf.stringToTerraform(this._resource), + rule_id: cdktf.stringToTerraform(this._ruleId), + space_id: cdktf.stringToTerraform(this._spaceId), + trigger: cdktf.stringToTerraform(this._trigger), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_type: { + value: cdktf.stringToHclTerraform(this._appType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource: { + value: cdktf.stringToHclTerraform(this._resource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger: { + value: cdktf.stringToHclTerraform(this._trigger), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/README.md new file mode 100644 index 00000000..9d1d4b46 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_device_binding_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_device_binding_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/index.ts new file mode 100644 index 00000000..38d45ab0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-binding-groups/index.ts @@ -0,0 +1,270 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDeviceBindingGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups#device_id DataHuaweicloudIotdaDeviceBindingGroups#device_id} + */ + readonly deviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups#id DataHuaweicloudIotdaDeviceBindingGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups#region DataHuaweicloudIotdaDeviceBindingGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudIotdaDeviceBindingGroupsGroups { +} + +export function dataHuaweicloudIotdaDeviceBindingGroupsGroupsToTerraform(struct?: DataHuaweicloudIotdaDeviceBindingGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceBindingGroupsGroupsToHclTerraform(struct?: DataHuaweicloudIotdaDeviceBindingGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceBindingGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceBindingGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceBindingGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parent_group_id - computed: true, optional: false, required: false + public get parentGroupId() { + return this.getStringAttribute('parent_group_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudIotdaDeviceBindingGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceBindingGroupsGroupsOutputReference { + return new DataHuaweicloudIotdaDeviceBindingGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups huaweicloud_iotda_device_binding_groups} +*/ +export class DataHuaweicloudIotdaDeviceBindingGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_binding_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDeviceBindingGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDeviceBindingGroups to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDeviceBindingGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDeviceBindingGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_binding_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_binding_groups huaweicloud_iotda_device_binding_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDeviceBindingGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDeviceBindingGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_binding_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceId = config.deviceId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // device_id - computed: false, optional: false, required: true + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudIotdaDeviceBindingGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_id: cdktf.stringToTerraform(this._deviceId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/README.md new file mode 100644 index 00000000..f7a6a3e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_device_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_device_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/index.ts new file mode 100644 index 00000000..7f2c5774 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-certificates/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDeviceCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#certificate_id DataHuaweicloudIotdaDeviceCertificates#certificate_id} + */ + readonly certificateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#cn DataHuaweicloudIotdaDeviceCertificates#cn} + */ + readonly cn?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#id DataHuaweicloudIotdaDeviceCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#region DataHuaweicloudIotdaDeviceCertificates#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#space_id DataHuaweicloudIotdaDeviceCertificates#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#status DataHuaweicloudIotdaDeviceCertificates#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudIotdaDeviceCertificatesCertificates { +} + +export function dataHuaweicloudIotdaDeviceCertificatesCertificatesToTerraform(struct?: DataHuaweicloudIotdaDeviceCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceCertificatesCertificatesToHclTerraform(struct?: DataHuaweicloudIotdaDeviceCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceCertificatesCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceCertificatesCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceCertificatesCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cn - computed: true, optional: false, required: false + public get cn() { + return this.getStringAttribute('cn'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // effective_date - computed: true, optional: false, required: false + public get effectiveDate() { + return this.getStringAttribute('effective_date'); + } + + // expiry_date - computed: true, optional: false, required: false + public get expiryDate() { + return this.getStringAttribute('expiry_date'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // verify_code - computed: true, optional: false, required: false + public get verifyCode() { + return this.getStringAttribute('verify_code'); + } +} + +export class DataHuaweicloudIotdaDeviceCertificatesCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceCertificatesCertificatesOutputReference { + return new DataHuaweicloudIotdaDeviceCertificatesCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates huaweicloud_iotda_device_certificates} +*/ +export class DataHuaweicloudIotdaDeviceCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDeviceCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDeviceCertificates to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDeviceCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDeviceCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_certificates huaweicloud_iotda_device_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDeviceCertificatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDeviceCertificatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._cn = config.cn; + this._id = config.id; + this._region = config.region; + this._spaceId = config.spaceId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate_id - computed: false, optional: true, required: false + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + public resetCertificateId() { + this._certificateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // certificates - computed: true, optional: false, required: false + private _certificates = new DataHuaweicloudIotdaDeviceCertificatesCertificatesList(this, "certificates", false); + public get certificates() { + return this._certificates; + } + + // cn - computed: false, optional: true, required: false + private _cn?: string; + public get cn() { + return this.getStringAttribute('cn'); + } + public set cn(value: string) { + this._cn = value; + } + public resetCn() { + this._cn = undefined; + } + // Temporarily expose input value. Use with caution. + public get cnInput() { + return this._cn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + cn: cdktf.stringToTerraform(this._cn), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cn: { + value: cdktf.stringToHclTerraform(this._cn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/README.md new file mode 100644 index 00000000..58cb73fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_device_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_device_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/index.ts new file mode 100644 index 00000000..01a9d676 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-groups/index.ts @@ -0,0 +1,385 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDeviceGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#group_id DataHuaweicloudIotdaDeviceGroups#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#id DataHuaweicloudIotdaDeviceGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#name DataHuaweicloudIotdaDeviceGroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#parent_group_id DataHuaweicloudIotdaDeviceGroups#parent_group_id} + */ + readonly parentGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#region DataHuaweicloudIotdaDeviceGroups#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#space_id DataHuaweicloudIotdaDeviceGroups#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#type DataHuaweicloudIotdaDeviceGroups#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudIotdaDeviceGroupsGroups { +} + +export function dataHuaweicloudIotdaDeviceGroupsGroupsToTerraform(struct?: DataHuaweicloudIotdaDeviceGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceGroupsGroupsToHclTerraform(struct?: DataHuaweicloudIotdaDeviceGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parent_group_id - computed: true, optional: false, required: false + public get parentGroupId() { + return this.getStringAttribute('parent_group_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudIotdaDeviceGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceGroupsGroupsOutputReference { + return new DataHuaweicloudIotdaDeviceGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups huaweicloud_iotda_device_groups} +*/ +export class DataHuaweicloudIotdaDeviceGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDeviceGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDeviceGroups to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDeviceGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDeviceGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_groups huaweicloud_iotda_device_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDeviceGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDeviceGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._parentGroupId = config.parentGroupId; + this._region = config.region; + this._spaceId = config.spaceId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudIotdaDeviceGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_group_id - computed: false, optional: true, required: false + private _parentGroupId?: string; + public get parentGroupId() { + return this.getStringAttribute('parent_group_id'); + } + public set parentGroupId(value: string) { + this._parentGroupId = value; + } + public resetParentGroupId() { + this._parentGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentGroupIdInput() { + return this._parentGroupId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_group_id: cdktf.stringToTerraform(this._parentGroupId), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_group_id: { + value: cdktf.stringToHclTerraform(this._parentGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/README.md new file mode 100644 index 00000000..ab7b9a7f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_device_linkage_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_device_linkage_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/index.ts new file mode 100644 index 00000000..1759c2c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-linkage-rules/index.ts @@ -0,0 +1,1365 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDeviceLinkageRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#id DataHuaweicloudIotdaDeviceLinkageRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#name DataHuaweicloudIotdaDeviceLinkageRules#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#region DataHuaweicloudIotdaDeviceLinkageRules#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#rule_id DataHuaweicloudIotdaDeviceLinkageRules#rule_id} + */ + readonly ruleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#space_id DataHuaweicloudIotdaDeviceLinkageRules#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#status DataHuaweicloudIotdaDeviceLinkageRules#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#type DataHuaweicloudIotdaDeviceLinkageRules#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarm { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarm | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarm | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dimension - computed: true, optional: false, required: false + public get dimension() { + return this.getStringAttribute('dimension'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommand { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommand): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommand): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommand | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommand | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // buffer_timeout - computed: true, optional: false, required: false + public get bufferTimeout() { + return this.getNumberAttribute('buffer_timeout'); + } + + // command_body - computed: true, optional: false, required: false + public get commandBody() { + return this.getStringAttribute('command_body'); + } + + // command_name - computed: true, optional: false, required: false + public get commandName() { + return this.getStringAttribute('command_name'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // response_timeout - computed: true, optional: false, required: false + public get responseTimeout() { + return this.getNumberAttribute('response_timeout'); + } + + // service_id - computed: true, optional: false, required: false + public get serviceId() { + return this.getStringAttribute('service_id'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwarding { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // message_content - computed: true, optional: false, required: false + public get messageContent() { + return this.getStringAttribute('message_content'); + } + + // message_template_name - computed: true, optional: false, required: false + public get messageTemplateName() { + return this.getStringAttribute('message_template_name'); + } + + // message_title - computed: true, optional: false, required: false + public get messageTitle() { + return this.getStringAttribute('message_title'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // topic_name - computed: true, optional: false, required: false + public get topicName() { + return this.getStringAttribute('topic_name'); + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesActions { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesActionsToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesActions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesActions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesActions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // device_alarm - computed: true, optional: false, required: false + private _deviceAlarm = new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceAlarmList(this, "device_alarm", false); + public get deviceAlarm() { + return this._deviceAlarm; + } + + // device_command - computed: true, optional: false, required: false + private _deviceCommand = new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsDeviceCommandList(this, "device_command", false); + public get deviceCommand() { + return this._deviceCommand; + } + + // smn_forwarding - computed: true, optional: false, required: false + private _smnForwarding = new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsSmnForwardingList(this, "smn_forwarding", false); + public get smnForwarding() { + return this._smnForwarding; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriod { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriod): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriod): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriod | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriod | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // days_of_week - computed: true, optional: false, required: false + public get daysOfWeek() { + return this.getStringAttribute('days_of_week'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerCondition { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // days_of_week - computed: true, optional: false, required: false + public get daysOfWeek() { + return this.getStringAttribute('days_of_week'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataCondition { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_validatiy_period - computed: true, optional: false, required: false + public get dataValidatiyPeriod() { + return this.getNumberAttribute('data_validatiy_period'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // in_values - computed: true, optional: false, required: false + public get inValues() { + return this.getListAttribute('in_values'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // trigger_strategy - computed: true, optional: false, required: false + public get triggerStrategy() { + return this.getStringAttribute('trigger_strategy'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusCondition { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getNumberAttribute('duration'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // status_list - computed: true, optional: false, required: false + public get statusList() { + return this.getListAttribute('status_list'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerCondition { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // repeat_count - computed: true, optional: false, required: false + public get repeatCount() { + return this.getNumberAttribute('repeat_count'); + } + + // repeat_interval - computed: true, optional: false, required: false + public get repeatInterval() { + return this.getNumberAttribute('repeat_interval'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggers { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // daily_timer_condition - computed: true, optional: false, required: false + private _dailyTimerCondition = new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDailyTimerConditionList(this, "daily_timer_condition", false); + public get dailyTimerCondition() { + return this._dailyTimerCondition; + } + + // device_data_condition - computed: true, optional: false, required: false + private _deviceDataCondition = new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceDataConditionList(this, "device_data_condition", false); + public get deviceDataCondition() { + return this._deviceDataCondition; + } + + // device_linkage_status_condition - computed: true, optional: false, required: false + private _deviceLinkageStatusCondition = new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersDeviceLinkageStatusConditionList(this, "device_linkage_status_condition", false); + public get deviceLinkageStatusCondition() { + return this._deviceLinkageStatusCondition; + } + + // simple_timer_condition - computed: true, optional: false, required: false + private _simpleTimerCondition = new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersSimpleTimerConditionList(this, "simple_timer_condition", false); + public get simpleTimerCondition() { + return this._simpleTimerCondition; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceLinkageRulesRules { +} + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesToTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceLinkageRulesRulesToHclTerraform(struct?: DataHuaweicloudIotdaDeviceLinkageRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceLinkageRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceLinkageRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + private _actions = new DataHuaweicloudIotdaDeviceLinkageRulesRulesActionsList(this, "actions", false); + public get actions() { + return this._actions; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // effective_period - computed: true, optional: false, required: false + private _effectivePeriod = new DataHuaweicloudIotdaDeviceLinkageRulesRulesEffectivePeriodList(this, "effective_period", false); + public get effectivePeriod() { + return this._effectivePeriod; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // space_id - computed: true, optional: false, required: false + public get spaceId() { + return this.getStringAttribute('space_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // trigger_logic - computed: true, optional: false, required: false + public get triggerLogic() { + return this.getStringAttribute('trigger_logic'); + } + + // triggers - computed: true, optional: false, required: false + private _triggers = new DataHuaweicloudIotdaDeviceLinkageRulesRulesTriggersList(this, "triggers", false); + public get triggers() { + return this._triggers; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudIotdaDeviceLinkageRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceLinkageRulesRulesOutputReference { + return new DataHuaweicloudIotdaDeviceLinkageRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules huaweicloud_iotda_device_linkage_rules} +*/ +export class DataHuaweicloudIotdaDeviceLinkageRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_linkage_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDeviceLinkageRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDeviceLinkageRules to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDeviceLinkageRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDeviceLinkageRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_linkage_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_linkage_rules huaweicloud_iotda_device_linkage_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDeviceLinkageRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDeviceLinkageRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_linkage_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._ruleId = config.ruleId; + this._spaceId = config.spaceId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudIotdaDeviceLinkageRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + space_id: cdktf.stringToTerraform(this._spaceId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/README.md new file mode 100644 index 00000000..47a7b0f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_device_messages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_device_messages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/index.ts new file mode 100644 index 00000000..f7bc0588 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-messages/index.ts @@ -0,0 +1,548 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDeviceMessagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages#device_id DataHuaweicloudIotdaDeviceMessages#device_id} + */ + readonly deviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages#id DataHuaweicloudIotdaDeviceMessages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages#region DataHuaweicloudIotdaDeviceMessages#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfo { +} + +export function dataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoToTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoToHclTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoOutputReference { + return new DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserProperties { +} + +export function dataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesToTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesToHclTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // prop_key - computed: true, optional: false, required: false + public get propKey() { + return this.getStringAttribute('prop_key'); + } + + // prop_value - computed: true, optional: false, required: false + public get propValue() { + return this.getStringAttribute('prop_value'); + } +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesOutputReference { + return new DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceMessagesMessagesProperties { +} + +export function dataHuaweicloudIotdaDeviceMessagesMessagesPropertiesToTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessagesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceMessagesMessagesPropertiesToHclTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessagesProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceMessagesMessagesProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceMessagesMessagesProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // correlation_data - computed: true, optional: false, required: false + public get correlationData() { + return this.getStringAttribute('correlation_data'); + } + + // response_topic - computed: true, optional: false, required: false + public get responseTopic() { + return this.getStringAttribute('response_topic'); + } + + // user_properties - computed: true, optional: false, required: false + private _userProperties = new DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesUserPropertiesList(this, "user_properties", false); + public get userProperties() { + return this._userProperties; + } +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesOutputReference { + return new DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceMessagesMessages { +} + +export function dataHuaweicloudIotdaDeviceMessagesMessagesToTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceMessagesMessagesToHclTerraform(struct?: DataHuaweicloudIotdaDeviceMessagesMessages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceMessagesMessages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceMessagesMessages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_time - computed: true, optional: false, required: false + public get createdTime() { + return this.getStringAttribute('created_time'); + } + + // encoding - computed: true, optional: false, required: false + public get encoding() { + return this.getStringAttribute('encoding'); + } + + // error_info - computed: true, optional: false, required: false + private _errorInfo = new DataHuaweicloudIotdaDeviceMessagesMessagesErrorInfoList(this, "error_info", false); + public get errorInfo() { + return this._errorInfo; + } + + // finished_time - computed: true, optional: false, required: false + public get finishedTime() { + return this.getStringAttribute('finished_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // payload_format - computed: true, optional: false, required: false + public get payloadFormat() { + return this.getStringAttribute('payload_format'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new DataHuaweicloudIotdaDeviceMessagesMessagesPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // topic - computed: true, optional: false, required: false + public get topic() { + return this.getStringAttribute('topic'); + } +} + +export class DataHuaweicloudIotdaDeviceMessagesMessagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceMessagesMessagesOutputReference { + return new DataHuaweicloudIotdaDeviceMessagesMessagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages huaweicloud_iotda_device_messages} +*/ +export class DataHuaweicloudIotdaDeviceMessages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_messages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDeviceMessages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDeviceMessages to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDeviceMessages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDeviceMessages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_messages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_messages huaweicloud_iotda_device_messages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDeviceMessagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDeviceMessagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_messages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceId = config.deviceId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // device_id - computed: false, optional: false, required: true + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // messages - computed: true, optional: false, required: false + private _messages = new DataHuaweicloudIotdaDeviceMessagesMessagesList(this, "messages", false); + public get messages() { + return this._messages; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_id: cdktf.stringToTerraform(this._deviceId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/README.md new file mode 100644 index 00000000..25d8c4d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_device_proxies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_device_proxies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/index.ts new file mode 100644 index 00000000..5406e08e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-device-proxies/index.ts @@ -0,0 +1,377 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDeviceProxiesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies#id DataHuaweicloudIotdaDeviceProxies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies#name DataHuaweicloudIotdaDeviceProxies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies#region DataHuaweicloudIotdaDeviceProxies#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies#space_id DataHuaweicloudIotdaDeviceProxies#space_id} + */ + readonly spaceId?: string; +} +export interface DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRange { +} + +export function dataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeToTerraform(struct?: DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRange): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeToHclTerraform(struct?: DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRange): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRange | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRange | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeOutputReference { + return new DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudIotdaDeviceProxiesProxies { +} + +export function dataHuaweicloudIotdaDeviceProxiesProxiesToTerraform(struct?: DataHuaweicloudIotdaDeviceProxiesProxies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDeviceProxiesProxiesToHclTerraform(struct?: DataHuaweicloudIotdaDeviceProxiesProxies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDeviceProxiesProxiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDeviceProxiesProxies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDeviceProxiesProxies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // effective_time_range - computed: true, optional: false, required: false + private _effectiveTimeRange = new DataHuaweicloudIotdaDeviceProxiesProxiesEffectiveTimeRangeList(this, "effective_time_range", false); + public get effectiveTimeRange() { + return this._effectiveTimeRange; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // space_id - computed: true, optional: false, required: false + public get spaceId() { + return this.getStringAttribute('space_id'); + } +} + +export class DataHuaweicloudIotdaDeviceProxiesProxiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDeviceProxiesProxiesOutputReference { + return new DataHuaweicloudIotdaDeviceProxiesProxiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies huaweicloud_iotda_device_proxies} +*/ +export class DataHuaweicloudIotdaDeviceProxies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_proxies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDeviceProxies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDeviceProxies to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDeviceProxies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDeviceProxies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_proxies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_device_proxies huaweicloud_iotda_device_proxies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDeviceProxiesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDeviceProxiesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_proxies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spaceId = config.spaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // proxies - computed: true, optional: false, required: false + private _proxies = new DataHuaweicloudIotdaDeviceProxiesProxiesList(this, "proxies", false); + public get proxies() { + return this._proxies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/README.md new file mode 100644 index 00000000..75951ef6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_devices` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_devices`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/index.ts new file mode 100644 index 00000000..059d8a6a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-devices/index.ts @@ -0,0 +1,548 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaDevicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#device_id DataHuaweicloudIotdaDevices#device_id} + */ + readonly deviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#end_time DataHuaweicloudIotdaDevices#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#gateway_id DataHuaweicloudIotdaDevices#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#id DataHuaweicloudIotdaDevices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#is_cascade DataHuaweicloudIotdaDevices#is_cascade} + */ + readonly isCascade?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#name DataHuaweicloudIotdaDevices#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#node_id DataHuaweicloudIotdaDevices#node_id} + */ + readonly nodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#product_id DataHuaweicloudIotdaDevices#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#region DataHuaweicloudIotdaDevices#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#space_id DataHuaweicloudIotdaDevices#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#start_time DataHuaweicloudIotdaDevices#start_time} + */ + readonly startTime?: string; +} +export interface DataHuaweicloudIotdaDevicesDevices { +} + +export function dataHuaweicloudIotdaDevicesDevicesToTerraform(struct?: DataHuaweicloudIotdaDevicesDevices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaDevicesDevicesToHclTerraform(struct?: DataHuaweicloudIotdaDevicesDevices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaDevicesDevicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaDevicesDevices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaDevicesDevices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // fw_version - computed: true, optional: false, required: false + public get fwVersion() { + return this.getStringAttribute('fw_version'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_id - computed: true, optional: false, required: false + public get nodeId() { + return this.getStringAttribute('node_id'); + } + + // node_type - computed: true, optional: false, required: false + public get nodeType() { + return this.getStringAttribute('node_type'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // product_name - computed: true, optional: false, required: false + public get productName() { + return this.getStringAttribute('product_name'); + } + + // sdk_version - computed: true, optional: false, required: false + public get sdkVersion() { + return this.getStringAttribute('sdk_version'); + } + + // space_id - computed: true, optional: false, required: false + public get spaceId() { + return this.getStringAttribute('space_id'); + } + + // space_name - computed: true, optional: false, required: false + public get spaceName() { + return this.getStringAttribute('space_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // sw_version - computed: true, optional: false, required: false + public get swVersion() { + return this.getStringAttribute('sw_version'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } +} + +export class DataHuaweicloudIotdaDevicesDevicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaDevicesDevicesOutputReference { + return new DataHuaweicloudIotdaDevicesDevicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices huaweicloud_iotda_devices} +*/ +export class DataHuaweicloudIotdaDevices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_devices"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaDevices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaDevices to import + * @param importFromId The id of the existing DataHuaweicloudIotdaDevices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaDevices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_devices", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_devices huaweicloud_iotda_devices} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaDevicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaDevicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_devices', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceId = config.deviceId; + this._endTime = config.endTime; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._isCascade = config.isCascade; + this._name = config.name; + this._nodeId = config.nodeId; + this._productId = config.productId; + this._region = config.region; + this._spaceId = config.spaceId; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // device_id - computed: false, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // devices - computed: true, optional: false, required: false + private _devices = new DataHuaweicloudIotdaDevicesDevicesList(this, "devices", false); + public get devices() { + return this._devices; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_cascade - computed: false, optional: true, required: false + private _isCascade?: boolean | cdktf.IResolvable; + public get isCascade() { + return this.getBooleanAttribute('is_cascade'); + } + public set isCascade(value: boolean | cdktf.IResolvable) { + this._isCascade = value; + } + public resetIsCascade() { + this._isCascade = undefined; + } + // Temporarily expose input value. Use with caution. + public get isCascadeInput() { + return this._isCascade; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_id: cdktf.stringToTerraform(this._deviceId), + end_time: cdktf.stringToTerraform(this._endTime), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + is_cascade: cdktf.booleanToTerraform(this._isCascade), + name: cdktf.stringToTerraform(this._name), + node_id: cdktf.stringToTerraform(this._nodeId), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_cascade: { + value: cdktf.booleanToHclTerraform(this._isCascade), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/README.md new file mode 100644 index 00000000..51b34dc0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_products` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_products`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/index.ts new file mode 100644 index 00000000..7c4f9c6a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-products/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaProductsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#device_type DataHuaweicloudIotdaProducts#device_type} + */ + readonly deviceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#id DataHuaweicloudIotdaProducts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#product_id DataHuaweicloudIotdaProducts#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#product_name DataHuaweicloudIotdaProducts#product_name} + */ + readonly productName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#region DataHuaweicloudIotdaProducts#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#space_id DataHuaweicloudIotdaProducts#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#space_name DataHuaweicloudIotdaProducts#space_name} + */ + readonly spaceName?: string; +} +export interface DataHuaweicloudIotdaProductsProducts { +} + +export function dataHuaweicloudIotdaProductsProductsToTerraform(struct?: DataHuaweicloudIotdaProductsProducts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaProductsProductsToHclTerraform(struct?: DataHuaweicloudIotdaProductsProducts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaProductsProductsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaProductsProducts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaProductsProducts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_type - computed: true, optional: false, required: false + public get dataType() { + return this.getStringAttribute('data_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // device_type - computed: true, optional: false, required: false + public get deviceType() { + return this.getStringAttribute('device_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // industry - computed: true, optional: false, required: false + public get industry() { + return this.getStringAttribute('industry'); + } + + // manufacturer_name - computed: true, optional: false, required: false + public get manufacturerName() { + return this.getStringAttribute('manufacturer_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol_type - computed: true, optional: false, required: false + public get protocolType() { + return this.getStringAttribute('protocol_type'); + } + + // space_id - computed: true, optional: false, required: false + public get spaceId() { + return this.getStringAttribute('space_id'); + } + + // space_name - computed: true, optional: false, required: false + public get spaceName() { + return this.getStringAttribute('space_name'); + } +} + +export class DataHuaweicloudIotdaProductsProductsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaProductsProductsOutputReference { + return new DataHuaweicloudIotdaProductsProductsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products huaweicloud_iotda_products} +*/ +export class DataHuaweicloudIotdaProducts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_products"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaProducts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaProducts to import + * @param importFromId The id of the existing DataHuaweicloudIotdaProducts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaProducts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_products", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_products huaweicloud_iotda_products} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaProductsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaProductsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_products', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceType = config.deviceType; + this._id = config.id; + this._productId = config.productId; + this._productName = config.productName; + this._region = config.region; + this._spaceId = config.spaceId; + this._spaceName = config.spaceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // device_type - computed: false, optional: true, required: false + private _deviceType?: string; + public get deviceType() { + return this.getStringAttribute('device_type'); + } + public set deviceType(value: string) { + this._deviceType = value; + } + public resetDeviceType() { + this._deviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceTypeInput() { + return this._deviceType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // product_name - computed: false, optional: true, required: false + private _productName?: string; + public get productName() { + return this.getStringAttribute('product_name'); + } + public set productName(value: string) { + this._productName = value; + } + public resetProductName() { + this._productName = undefined; + } + // Temporarily expose input value. Use with caution. + public get productNameInput() { + return this._productName; + } + + // products - computed: true, optional: false, required: false + private _products = new DataHuaweicloudIotdaProductsProductsList(this, "products", false); + public get products() { + return this._products; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // space_name - computed: false, optional: true, required: false + private _spaceName?: string; + public get spaceName() { + return this.getStringAttribute('space_name'); + } + public set spaceName(value: string) { + this._spaceName = value; + } + public resetSpaceName() { + this._spaceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceNameInput() { + return this._spaceName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_type: cdktf.stringToTerraform(this._deviceType), + id: cdktf.stringToTerraform(this._id), + product_id: cdktf.stringToTerraform(this._productId), + product_name: cdktf.stringToTerraform(this._productName), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + space_name: cdktf.stringToTerraform(this._spaceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_type: { + value: cdktf.stringToHclTerraform(this._deviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_name: { + value: cdktf.stringToHclTerraform(this._productName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_name: { + value: cdktf.stringToHclTerraform(this._spaceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/README.md new file mode 100644 index 00000000..8093fc8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_spaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_spaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/index.ts new file mode 100644 index 00000000..51285fb2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-spaces/index.ts @@ -0,0 +1,324 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaSpacesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces#id DataHuaweicloudIotdaSpaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces#is_default DataHuaweicloudIotdaSpaces#is_default} + */ + readonly isDefault?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces#region DataHuaweicloudIotdaSpaces#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces#space_id DataHuaweicloudIotdaSpaces#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces#space_name DataHuaweicloudIotdaSpaces#space_name} + */ + readonly spaceName?: string; +} +export interface DataHuaweicloudIotdaSpacesSpaces { +} + +export function dataHuaweicloudIotdaSpacesSpacesToTerraform(struct?: DataHuaweicloudIotdaSpacesSpaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaSpacesSpacesToHclTerraform(struct?: DataHuaweicloudIotdaSpacesSpaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaSpacesSpacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaSpacesSpaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaSpacesSpaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_default - computed: true, optional: false, required: false + public get isDefault() { + return this.getBooleanAttribute('is_default'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudIotdaSpacesSpacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaSpacesSpacesOutputReference { + return new DataHuaweicloudIotdaSpacesSpacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces huaweicloud_iotda_spaces} +*/ +export class DataHuaweicloudIotdaSpaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_spaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaSpaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaSpaces to import + * @param importFromId The id of the existing DataHuaweicloudIotdaSpaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaSpaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_spaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_spaces huaweicloud_iotda_spaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaSpacesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaSpacesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_spaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._isDefault = config.isDefault; + this._region = config.region; + this._spaceId = config.spaceId; + this._spaceName = config.spaceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_default - computed: false, optional: true, required: false + private _isDefault?: string; + public get isDefault() { + return this.getStringAttribute('is_default'); + } + public set isDefault(value: string) { + this._isDefault = value; + } + public resetIsDefault() { + this._isDefault = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDefaultInput() { + return this._isDefault; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // space_name - computed: false, optional: true, required: false + private _spaceName?: string; + public get spaceName() { + return this.getStringAttribute('space_name'); + } + public set spaceName(value: string) { + this._spaceName = value; + } + public resetSpaceName() { + this._spaceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceNameInput() { + return this._spaceName; + } + + // spaces - computed: true, optional: false, required: false + private _spaces = new DataHuaweicloudIotdaSpacesSpacesList(this, "spaces", false); + public get spaces() { + return this._spaces; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + is_default: cdktf.stringToTerraform(this._isDefault), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + space_name: cdktf.stringToTerraform(this._spaceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_default: { + value: cdktf.stringToHclTerraform(this._isDefault), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_name: { + value: cdktf.stringToHclTerraform(this._spaceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/README.md new file mode 100644 index 00000000..dba7ffed --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_iotda_upgrade_packages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_iotda_upgrade_packages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/index.ts new file mode 100644 index 00000000..f6776662 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-iotda-upgrade-packages/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudIotdaUpgradePackagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#id DataHuaweicloudIotdaUpgradePackages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the product ID associated with the upgrade package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#product_id DataHuaweicloudIotdaUpgradePackages#product_id} + */ + readonly productId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#region DataHuaweicloudIotdaUpgradePackages#region} + */ + readonly region?: string; + /** + * Specifies the resource space ID to which the upgrade packages belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#space_id DataHuaweicloudIotdaUpgradePackages#space_id} + */ + readonly spaceId?: string; + /** + * Specifies the type of the upgrade package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#type DataHuaweicloudIotdaUpgradePackages#type} + */ + readonly type: string; + /** + * Specifies the version number of the upgrade package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#version DataHuaweicloudIotdaUpgradePackages#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudIotdaUpgradePackagesPackages { +} + +export function dataHuaweicloudIotdaUpgradePackagesPackagesToTerraform(struct?: DataHuaweicloudIotdaUpgradePackagesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudIotdaUpgradePackagesPackagesToHclTerraform(struct?: DataHuaweicloudIotdaUpgradePackagesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudIotdaUpgradePackagesPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudIotdaUpgradePackagesPackages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudIotdaUpgradePackagesPackages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // custom_info - computed: true, optional: false, required: false + public get customInfo() { + return this.getStringAttribute('custom_info'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // space_id - computed: true, optional: false, required: false + public get spaceId() { + return this.getStringAttribute('space_id'); + } + + // support_source_versions - computed: true, optional: false, required: false + public get supportSourceVersions() { + return this.getListAttribute('support_source_versions'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudIotdaUpgradePackagesPackagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudIotdaUpgradePackagesPackagesOutputReference { + return new DataHuaweicloudIotdaUpgradePackagesPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages huaweicloud_iotda_upgrade_packages} +*/ +export class DataHuaweicloudIotdaUpgradePackages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_upgrade_packages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudIotdaUpgradePackages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudIotdaUpgradePackages to import + * @param importFromId The id of the existing DataHuaweicloudIotdaUpgradePackages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudIotdaUpgradePackages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_upgrade_packages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/iotda_upgrade_packages huaweicloud_iotda_upgrade_packages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudIotdaUpgradePackagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudIotdaUpgradePackagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_upgrade_packages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._productId = config.productId; + this._region = config.region; + this._spaceId = config.spaceId; + this._type = config.type; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // packages - computed: true, optional: false, required: false + private _packages = new DataHuaweicloudIotdaUpgradePackagesPackagesList(this, "packages", false); + public get packages() { + return this._packages; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/README.md new file mode 100644 index 00000000..0f79f5c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kms_data_key_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kms_data_key_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/index.ts new file mode 100644 index 00000000..68a059c4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key-v1/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKmsDataKeyV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1#datakey_length DataHuaweicloudKmsDataKeyV1#datakey_length} + */ + readonly datakeyLength: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1#encryption_context DataHuaweicloudKmsDataKeyV1#encryption_context} + */ + readonly encryptionContext?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1#id DataHuaweicloudKmsDataKeyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1#key_id DataHuaweicloudKmsDataKeyV1#key_id} + */ + readonly keyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1#region DataHuaweicloudKmsDataKeyV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1 huaweicloud_kms_data_key_v1} +*/ +export class DataHuaweicloudKmsDataKeyV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_data_key_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKmsDataKeyV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKmsDataKeyV1 to import + * @param importFromId The id of the existing DataHuaweicloudKmsDataKeyV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKmsDataKeyV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_data_key_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key_v1 huaweicloud_kms_data_key_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKmsDataKeyV1Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKmsDataKeyV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_data_key_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datakeyLength = config.datakeyLength; + this._encryptionContext = config.encryptionContext; + this._id = config.id; + this._keyId = config.keyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cipher_text - computed: true, optional: false, required: false + public get cipherText() { + return this.getStringAttribute('cipher_text'); + } + + // datakey_length - computed: false, optional: false, required: true + private _datakeyLength?: string; + public get datakeyLength() { + return this.getStringAttribute('datakey_length'); + } + public set datakeyLength(value: string) { + this._datakeyLength = value; + } + // Temporarily expose input value. Use with caution. + public get datakeyLengthInput() { + return this._datakeyLength; + } + + // encryption_context - computed: false, optional: true, required: false + private _encryptionContext?: string; + public get encryptionContext() { + return this.getStringAttribute('encryption_context'); + } + public set encryptionContext(value: string) { + this._encryptionContext = value; + } + public resetEncryptionContext() { + this._encryptionContext = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionContextInput() { + return this._encryptionContext; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_id - computed: false, optional: false, required: true + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // plain_text - computed: true, optional: false, required: false + public get plainText() { + return this.getStringAttribute('plain_text'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datakey_length: cdktf.stringToTerraform(this._datakeyLength), + encryption_context: cdktf.stringToTerraform(this._encryptionContext), + id: cdktf.stringToTerraform(this._id), + key_id: cdktf.stringToTerraform(this._keyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datakey_length: { + value: cdktf.stringToHclTerraform(this._datakeyLength), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_context: { + value: cdktf.stringToHclTerraform(this._encryptionContext), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/README.md new file mode 100644 index 00000000..bbef2a6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kms_data_key` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kms_data_key`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/index.ts new file mode 100644 index 00000000..cb600c71 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-data-key/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKmsDataKeyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key#datakey_length DataHuaweicloudKmsDataKey#datakey_length} + */ + readonly datakeyLength: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key#encryption_context DataHuaweicloudKmsDataKey#encryption_context} + */ + readonly encryptionContext?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key#id DataHuaweicloudKmsDataKey#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key#key_id DataHuaweicloudKmsDataKey#key_id} + */ + readonly keyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key#region DataHuaweicloudKmsDataKey#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key huaweicloud_kms_data_key} +*/ +export class DataHuaweicloudKmsDataKey extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_data_key"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKmsDataKey resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKmsDataKey to import + * @param importFromId The id of the existing DataHuaweicloudKmsDataKey that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKmsDataKey to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_data_key", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_data_key huaweicloud_kms_data_key} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKmsDataKeyConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKmsDataKeyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_data_key', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datakeyLength = config.datakeyLength; + this._encryptionContext = config.encryptionContext; + this._id = config.id; + this._keyId = config.keyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cipher_text - computed: true, optional: false, required: false + public get cipherText() { + return this.getStringAttribute('cipher_text'); + } + + // datakey_length - computed: false, optional: false, required: true + private _datakeyLength?: string; + public get datakeyLength() { + return this.getStringAttribute('datakey_length'); + } + public set datakeyLength(value: string) { + this._datakeyLength = value; + } + // Temporarily expose input value. Use with caution. + public get datakeyLengthInput() { + return this._datakeyLength; + } + + // encryption_context - computed: false, optional: true, required: false + private _encryptionContext?: string; + public get encryptionContext() { + return this.getStringAttribute('encryption_context'); + } + public set encryptionContext(value: string) { + this._encryptionContext = value; + } + public resetEncryptionContext() { + this._encryptionContext = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionContextInput() { + return this._encryptionContext; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_id - computed: false, optional: false, required: true + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // plain_text - computed: true, optional: false, required: false + public get plainText() { + return this.getStringAttribute('plain_text'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datakey_length: cdktf.stringToTerraform(this._datakeyLength), + encryption_context: cdktf.stringToTerraform(this._encryptionContext), + id: cdktf.stringToTerraform(this._id), + key_id: cdktf.stringToTerraform(this._keyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datakey_length: { + value: cdktf.stringToHclTerraform(this._datakeyLength), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_context: { + value: cdktf.stringToHclTerraform(this._encryptionContext), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/README.md new file mode 100644 index 00000000..737f653a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kms_grants` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kms_grants`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/index.ts new file mode 100644 index 00000000..dc2bff71 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-grants/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKmsGrantsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants#id DataHuaweicloudKmsGrants#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the key ID to which the grants belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants#key_id DataHuaweicloudKmsGrants#key_id} + */ + readonly keyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants#region DataHuaweicloudKmsGrants#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudKmsGrantsGrants { +} + +export function dataHuaweicloudKmsGrantsGrantsToTerraform(struct?: DataHuaweicloudKmsGrantsGrants): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKmsGrantsGrantsToHclTerraform(struct?: DataHuaweicloudKmsGrantsGrants): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKmsGrantsGrantsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKmsGrantsGrants | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKmsGrantsGrants | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // grantee_principal - computed: true, optional: false, required: false + public get granteePrincipal() { + return this.getStringAttribute('grantee_principal'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // key_id - computed: true, optional: false, required: false + public get keyId() { + return this.getStringAttribute('key_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // operations - computed: true, optional: false, required: false + public get operations() { + return this.getListAttribute('operations'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudKmsGrantsGrantsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKmsGrantsGrantsOutputReference { + return new DataHuaweicloudKmsGrantsGrantsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants huaweicloud_kms_grants} +*/ +export class DataHuaweicloudKmsGrants extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_grants"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKmsGrants resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKmsGrants to import + * @param importFromId The id of the existing DataHuaweicloudKmsGrants that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKmsGrants to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_grants", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_grants huaweicloud_kms_grants} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKmsGrantsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKmsGrantsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_grants', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._keyId = config.keyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // grants - computed: true, optional: false, required: false + private _grants = new DataHuaweicloudKmsGrantsGrantsList(this, "grants", false); + public get grants() { + return this._grants; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_id - computed: false, optional: false, required: true + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + key_id: cdktf.stringToTerraform(this._keyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/README.md new file mode 100644 index 00000000..40e53294 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kms_key_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kms_key_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/index.ts new file mode 100644 index 00000000..c42c15bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key-v1/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKmsKeyV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#default_key_flag DataHuaweicloudKmsKeyV1#default_key_flag} + */ + readonly defaultKeyFlag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#domain_id DataHuaweicloudKmsKeyV1#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#enterprise_project_id DataHuaweicloudKmsKeyV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#id DataHuaweicloudKmsKeyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#key_alias DataHuaweicloudKmsKeyV1#key_alias} + */ + readonly keyAlias?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#key_description DataHuaweicloudKmsKeyV1#key_description} + */ + readonly keyDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#key_id DataHuaweicloudKmsKeyV1#key_id} + */ + readonly keyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#key_state DataHuaweicloudKmsKeyV1#key_state} + */ + readonly keyState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#region DataHuaweicloudKmsKeyV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1 huaweicloud_kms_key_v1} +*/ +export class DataHuaweicloudKmsKeyV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_key_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKmsKeyV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKmsKeyV1 to import + * @param importFromId The id of the existing DataHuaweicloudKmsKeyV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKmsKeyV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_key_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key_v1 huaweicloud_kms_key_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKmsKeyV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKmsKeyV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_key_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._defaultKeyFlag = config.defaultKeyFlag; + this._domainId = config.domainId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._keyAlias = config.keyAlias; + this._keyDescription = config.keyDescription; + this._keyId = config.keyId; + this._keyState = config.keyState; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // creation_date - computed: true, optional: false, required: false + public get creationDate() { + return this.getStringAttribute('creation_date'); + } + + // default_key_flag - computed: true, optional: true, required: false + private _defaultKeyFlag?: string; + public get defaultKeyFlag() { + return this.getStringAttribute('default_key_flag'); + } + public set defaultKeyFlag(value: string) { + this._defaultKeyFlag = value; + } + public resetDefaultKeyFlag() { + this._defaultKeyFlag = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultKeyFlagInput() { + return this._defaultKeyFlag; + } + + // domain_id - computed: true, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_alias - computed: true, optional: true, required: false + private _keyAlias?: string; + public get keyAlias() { + return this.getStringAttribute('key_alias'); + } + public set keyAlias(value: string) { + this._keyAlias = value; + } + public resetKeyAlias() { + this._keyAlias = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyAliasInput() { + return this._keyAlias; + } + + // key_description - computed: true, optional: true, required: false + private _keyDescription?: string; + public get keyDescription() { + return this.getStringAttribute('key_description'); + } + public set keyDescription(value: string) { + this._keyDescription = value; + } + public resetKeyDescription() { + this._keyDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyDescriptionInput() { + return this._keyDescription; + } + + // key_id - computed: true, optional: true, required: false + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + public resetKeyId() { + this._keyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // key_state - computed: true, optional: true, required: false + private _keyState?: string; + public get keyState() { + return this.getStringAttribute('key_state'); + } + public set keyState(value: string) { + this._keyState = value; + } + public resetKeyState() { + this._keyState = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStateInput() { + return this._keyState; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rotation_enabled - computed: true, optional: false, required: false + public get rotationEnabled() { + return this.getBooleanAttribute('rotation_enabled'); + } + + // rotation_interval - computed: true, optional: false, required: false + public get rotationInterval() { + return this.getNumberAttribute('rotation_interval'); + } + + // rotation_number - computed: true, optional: false, required: false + public get rotationNumber() { + return this.getNumberAttribute('rotation_number'); + } + + // scheduled_deletion_date - computed: true, optional: false, required: false + public get scheduledDeletionDate() { + return this.getStringAttribute('scheduled_deletion_date'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + default_key_flag: cdktf.stringToTerraform(this._defaultKeyFlag), + domain_id: cdktf.stringToTerraform(this._domainId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + key_alias: cdktf.stringToTerraform(this._keyAlias), + key_description: cdktf.stringToTerraform(this._keyDescription), + key_id: cdktf.stringToTerraform(this._keyId), + key_state: cdktf.stringToTerraform(this._keyState), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + default_key_flag: { + value: cdktf.stringToHclTerraform(this._defaultKeyFlag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_alias: { + value: cdktf.stringToHclTerraform(this._keyAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_description: { + value: cdktf.stringToHclTerraform(this._keyDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_state: { + value: cdktf.stringToHclTerraform(this._keyState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/README.md new file mode 100644 index 00000000..0d6a50d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kms_key` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kms_key`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/index.ts new file mode 100644 index 00000000..d53bb3a1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-key/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKmsKeyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#default_key_flag DataHuaweicloudKmsKey#default_key_flag} + */ + readonly defaultKeyFlag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#domain_id DataHuaweicloudKmsKey#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#enterprise_project_id DataHuaweicloudKmsKey#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#id DataHuaweicloudKmsKey#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#key_alias DataHuaweicloudKmsKey#key_alias} + */ + readonly keyAlias?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#key_description DataHuaweicloudKmsKey#key_description} + */ + readonly keyDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#key_id DataHuaweicloudKmsKey#key_id} + */ + readonly keyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#key_state DataHuaweicloudKmsKey#key_state} + */ + readonly keyState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#region DataHuaweicloudKmsKey#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key huaweicloud_kms_key} +*/ +export class DataHuaweicloudKmsKey extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_key"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKmsKey resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKmsKey to import + * @param importFromId The id of the existing DataHuaweicloudKmsKey that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKmsKey to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_key", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_key huaweicloud_kms_key} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKmsKeyConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKmsKeyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_key', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._defaultKeyFlag = config.defaultKeyFlag; + this._domainId = config.domainId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._keyAlias = config.keyAlias; + this._keyDescription = config.keyDescription; + this._keyId = config.keyId; + this._keyState = config.keyState; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // creation_date - computed: true, optional: false, required: false + public get creationDate() { + return this.getStringAttribute('creation_date'); + } + + // default_key_flag - computed: true, optional: true, required: false + private _defaultKeyFlag?: string; + public get defaultKeyFlag() { + return this.getStringAttribute('default_key_flag'); + } + public set defaultKeyFlag(value: string) { + this._defaultKeyFlag = value; + } + public resetDefaultKeyFlag() { + this._defaultKeyFlag = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultKeyFlagInput() { + return this._defaultKeyFlag; + } + + // domain_id - computed: true, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_alias - computed: true, optional: true, required: false + private _keyAlias?: string; + public get keyAlias() { + return this.getStringAttribute('key_alias'); + } + public set keyAlias(value: string) { + this._keyAlias = value; + } + public resetKeyAlias() { + this._keyAlias = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyAliasInput() { + return this._keyAlias; + } + + // key_description - computed: true, optional: true, required: false + private _keyDescription?: string; + public get keyDescription() { + return this.getStringAttribute('key_description'); + } + public set keyDescription(value: string) { + this._keyDescription = value; + } + public resetKeyDescription() { + this._keyDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyDescriptionInput() { + return this._keyDescription; + } + + // key_id - computed: true, optional: true, required: false + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + public resetKeyId() { + this._keyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // key_state - computed: true, optional: true, required: false + private _keyState?: string; + public get keyState() { + return this.getStringAttribute('key_state'); + } + public set keyState(value: string) { + this._keyState = value; + } + public resetKeyState() { + this._keyState = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStateInput() { + return this._keyState; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rotation_enabled - computed: true, optional: false, required: false + public get rotationEnabled() { + return this.getBooleanAttribute('rotation_enabled'); + } + + // rotation_interval - computed: true, optional: false, required: false + public get rotationInterval() { + return this.getNumberAttribute('rotation_interval'); + } + + // rotation_number - computed: true, optional: false, required: false + public get rotationNumber() { + return this.getNumberAttribute('rotation_number'); + } + + // scheduled_deletion_date - computed: true, optional: false, required: false + public get scheduledDeletionDate() { + return this.getStringAttribute('scheduled_deletion_date'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + default_key_flag: cdktf.stringToTerraform(this._defaultKeyFlag), + domain_id: cdktf.stringToTerraform(this._domainId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + key_alias: cdktf.stringToTerraform(this._keyAlias), + key_description: cdktf.stringToTerraform(this._keyDescription), + key_id: cdktf.stringToTerraform(this._keyId), + key_state: cdktf.stringToTerraform(this._keyState), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + default_key_flag: { + value: cdktf.stringToHclTerraform(this._defaultKeyFlag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_alias: { + value: cdktf.stringToHclTerraform(this._keyAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_description: { + value: cdktf.stringToHclTerraform(this._keyDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_state: { + value: cdktf.stringToHclTerraform(this._keyState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/README.md new file mode 100644 index 00000000..0a59fed2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kms_keys` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kms_keys`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/index.ts new file mode 100644 index 00000000..44485f86 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kms-keys/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKmsKeysConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the keys belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys#enterprise_project_id DataHuaweicloudKmsKeys#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys#id DataHuaweicloudKmsKeys#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the key generation algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys#key_algorithm DataHuaweicloudKmsKeys#key_algorithm} + */ + readonly keyAlgorithm?: string; + /** + * Specifies the key current status + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys#key_state DataHuaweicloudKmsKeys#key_state} + */ + readonly keyState?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys#region DataHuaweicloudKmsKeys#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudKmsKeysKeys { +} + +export function dataHuaweicloudKmsKeysKeysToTerraform(struct?: DataHuaweicloudKmsKeysKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKmsKeysKeysToHclTerraform(struct?: DataHuaweicloudKmsKeysKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKmsKeysKeysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKmsKeysKeys | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKmsKeysKeys | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_key_flag - computed: true, optional: false, required: false + public get defaultKeyFlag() { + return this.getStringAttribute('default_key_flag'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // key_algorithm - computed: true, optional: false, required: false + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + + // key_alias - computed: true, optional: false, required: false + public get keyAlias() { + return this.getStringAttribute('key_alias'); + } + + // key_description - computed: true, optional: false, required: false + public get keyDescription() { + return this.getStringAttribute('key_description'); + } + + // key_rotation_enabled - computed: true, optional: false, required: false + public get keyRotationEnabled() { + return this.getStringAttribute('key_rotation_enabled'); + } + + // key_state - computed: true, optional: false, required: false + public get keyState() { + return this.getStringAttribute('key_state'); + } + + // key_type - computed: true, optional: false, required: false + public get keyType() { + return this.getStringAttribute('key_type'); + } + + // key_usage - computed: true, optional: false, required: false + public get keyUsage() { + return this.getStringAttribute('key_usage'); + } + + // keystore_id - computed: true, optional: false, required: false + public get keystoreId() { + return this.getStringAttribute('keystore_id'); + } + + // origin - computed: true, optional: false, required: false + public get origin() { + return this.getStringAttribute('origin'); + } + + // scheduled_deletion_date - computed: true, optional: false, required: false + public get scheduledDeletionDate() { + return this.getStringAttribute('scheduled_deletion_date'); + } +} + +export class DataHuaweicloudKmsKeysKeysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKmsKeysKeysOutputReference { + return new DataHuaweicloudKmsKeysKeysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys huaweicloud_kms_keys} +*/ +export class DataHuaweicloudKmsKeys extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_keys"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKmsKeys resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKmsKeys to import + * @param importFromId The id of the existing DataHuaweicloudKmsKeys that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKmsKeys to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_keys", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kms_keys huaweicloud_kms_keys} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKmsKeysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKmsKeysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_keys', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._keyAlgorithm = config.keyAlgorithm; + this._keyState = config.keyState; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_algorithm - computed: false, optional: true, required: false + private _keyAlgorithm?: string; + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + public set keyAlgorithm(value: string) { + this._keyAlgorithm = value; + } + public resetKeyAlgorithm() { + this._keyAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyAlgorithmInput() { + return this._keyAlgorithm; + } + + // key_state - computed: false, optional: true, required: false + private _keyState?: string; + public get keyState() { + return this.getStringAttribute('key_state'); + } + public set keyState(value: string) { + this._keyState = value; + } + public resetKeyState() { + this._keyState = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStateInput() { + return this._keyState; + } + + // keys - computed: true, optional: false, required: false + private _keys = new DataHuaweicloudKmsKeysKeysList(this, "keys", false); + public get keys() { + return this._keys; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + key_algorithm: cdktf.stringToTerraform(this._keyAlgorithm), + key_state: cdktf.stringToTerraform(this._keyState), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_algorithm: { + value: cdktf.stringToHclTerraform(this._keyAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_state: { + value: cdktf.stringToHclTerraform(this._keyState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/README.md new file mode 100644 index 00000000..89cede41 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_koogallery_assets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_koogallery_assets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/index.ts new file mode 100644 index 00000000..6f6c0963 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-koogallery-assets/index.ts @@ -0,0 +1,515 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKoogalleryAssetsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets#asset_id DataHuaweicloudKoogalleryAssets#asset_id} + */ + readonly assetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets#asset_version DataHuaweicloudKoogalleryAssets#asset_version} + */ + readonly assetVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets#deployed_type DataHuaweicloudKoogalleryAssets#deployed_type} + */ + readonly deployedType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets#id DataHuaweicloudKoogalleryAssets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets#region DataHuaweicloudKoogalleryAssets#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObject { +} + +export function dataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectToTerraform(struct?: DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectToHclTerraform(struct?: DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // architecture - computed: true, optional: false, required: false + public get architecture() { + return this.getStringAttribute('architecture'); + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } +} + +export class DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectOutputReference { + return new DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObject { +} + +export function dataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectToTerraform(struct?: DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectToHclTerraform(struct?: DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // internal_path - computed: true, optional: false, required: false + public get internalPath() { + return this.getStringAttribute('internal_path'); + } + + // package_name - computed: true, optional: false, required: false + public get packageName() { + return this.getStringAttribute('package_name'); + } +} + +export class DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectOutputReference { + return new DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudKoogalleryAssetsAssets { +} + +export function dataHuaweicloudKoogalleryAssetsAssetsToTerraform(struct?: DataHuaweicloudKoogalleryAssetsAssets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKoogalleryAssetsAssetsToHclTerraform(struct?: DataHuaweicloudKoogalleryAssetsAssets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKoogalleryAssetsAssetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKoogalleryAssetsAssets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKoogalleryAssetsAssets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // asset_id - computed: true, optional: false, required: false + public get assetId() { + return this.getStringAttribute('asset_id'); + } + + // deployed_type - computed: true, optional: false, required: false + public get deployedType() { + return this.getStringAttribute('deployed_type'); + } + + // image_deployed_object - computed: true, optional: false, required: false + private _imageDeployedObject = new DataHuaweicloudKoogalleryAssetsAssetsImageDeployedObjectList(this, "image_deployed_object", false); + public get imageDeployedObject() { + return this._imageDeployedObject; + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // software_pkg_deployed_object - computed: true, optional: false, required: false + private _softwarePkgDeployedObject = new DataHuaweicloudKoogalleryAssetsAssetsSoftwarePkgDeployedObjectList(this, "software_pkg_deployed_object", false); + public get softwarePkgDeployedObject() { + return this._softwarePkgDeployedObject; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } +} + +export class DataHuaweicloudKoogalleryAssetsAssetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKoogalleryAssetsAssetsOutputReference { + return new DataHuaweicloudKoogalleryAssetsAssetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets huaweicloud_koogallery_assets} +*/ +export class DataHuaweicloudKoogalleryAssets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_koogallery_assets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKoogalleryAssets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKoogalleryAssets to import + * @param importFromId The id of the existing DataHuaweicloudKoogalleryAssets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKoogalleryAssets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_koogallery_assets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/koogallery_assets huaweicloud_koogallery_assets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKoogalleryAssetsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKoogalleryAssetsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_koogallery_assets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._assetId = config.assetId; + this._assetVersion = config.assetVersion; + this._deployedType = config.deployedType; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // asset_id - computed: false, optional: false, required: true + private _assetId?: string; + public get assetId() { + return this.getStringAttribute('asset_id'); + } + public set assetId(value: string) { + this._assetId = value; + } + // Temporarily expose input value. Use with caution. + public get assetIdInput() { + return this._assetId; + } + + // asset_version - computed: false, optional: true, required: false + private _assetVersion?: string; + public get assetVersion() { + return this.getStringAttribute('asset_version'); + } + public set assetVersion(value: string) { + this._assetVersion = value; + } + public resetAssetVersion() { + this._assetVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get assetVersionInput() { + return this._assetVersion; + } + + // assets - computed: true, optional: false, required: false + private _assets = new DataHuaweicloudKoogalleryAssetsAssetsList(this, "assets", false); + public get assets() { + return this._assets; + } + + // deployed_type - computed: false, optional: false, required: true + private _deployedType?: string; + public get deployedType() { + return this.getStringAttribute('deployed_type'); + } + public set deployedType(value: string) { + this._deployedType = value; + } + // Temporarily expose input value. Use with caution. + public get deployedTypeInput() { + return this._deployedType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + asset_id: cdktf.stringToTerraform(this._assetId), + asset_version: cdktf.stringToTerraform(this._assetVersion), + deployed_type: cdktf.stringToTerraform(this._deployedType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + asset_id: { + value: cdktf.stringToHclTerraform(this._assetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + asset_version: { + value: cdktf.stringToHclTerraform(this._assetVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deployed_type: { + value: cdktf.stringToHclTerraform(this._deployedType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/README.md new file mode 100644 index 00000000..0b1be64e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kps_failed_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kps_failed_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/index.ts new file mode 100644 index 00000000..66ae0122 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-failed-tasks/index.ts @@ -0,0 +1,262 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKpsFailedTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks#id DataHuaweicloudKpsFailedTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks#region DataHuaweicloudKpsFailedTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudKpsFailedTasksTasks { +} + +export function dataHuaweicloudKpsFailedTasksTasksToTerraform(struct?: DataHuaweicloudKpsFailedTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKpsFailedTasksTasksToHclTerraform(struct?: DataHuaweicloudKpsFailedTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKpsFailedTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKpsFailedTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKpsFailedTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // keypair_name - computed: true, optional: false, required: false + public get keypairName() { + return this.getStringAttribute('keypair_name'); + } + + // operate_type - computed: true, optional: false, required: false + public get operateType() { + return this.getStringAttribute('operate_type'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // server_name - computed: true, optional: false, required: false + public get serverName() { + return this.getStringAttribute('server_name'); + } + + // task_error_code - computed: true, optional: false, required: false + public get taskErrorCode() { + return this.getStringAttribute('task_error_code'); + } + + // task_error_msg - computed: true, optional: false, required: false + public get taskErrorMsg() { + return this.getStringAttribute('task_error_msg'); + } + + // task_time - computed: true, optional: false, required: false + public get taskTime() { + return this.getStringAttribute('task_time'); + } +} + +export class DataHuaweicloudKpsFailedTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKpsFailedTasksTasksOutputReference { + return new DataHuaweicloudKpsFailedTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks huaweicloud_kps_failed_tasks} +*/ +export class DataHuaweicloudKpsFailedTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kps_failed_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKpsFailedTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKpsFailedTasks to import + * @param importFromId The id of the existing DataHuaweicloudKpsFailedTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKpsFailedTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kps_failed_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_failed_tasks huaweicloud_kps_failed_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKpsFailedTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKpsFailedTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kps_failed_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudKpsFailedTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/README.md new file mode 100644 index 00000000..5fabc3c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kps_keypairs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kps_keypairs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/index.ts new file mode 100644 index 00000000..95c6ee49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-keypairs/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKpsKeypairsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#fingerprint DataHuaweicloudKpsKeypairs#fingerprint} + */ + readonly fingerprint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#id DataHuaweicloudKpsKeypairs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#is_managed DataHuaweicloudKpsKeypairs#is_managed} + */ + readonly isManaged?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#name DataHuaweicloudKpsKeypairs#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#public_key DataHuaweicloudKpsKeypairs#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#region DataHuaweicloudKpsKeypairs#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudKpsKeypairsKeypairs { +} + +export function dataHuaweicloudKpsKeypairsKeypairsToTerraform(struct?: DataHuaweicloudKpsKeypairsKeypairs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKpsKeypairsKeypairsToHclTerraform(struct?: DataHuaweicloudKpsKeypairsKeypairs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKpsKeypairsKeypairsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKpsKeypairsKeypairs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKpsKeypairsKeypairs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // fingerprint - computed: true, optional: false, required: false + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + + // is_managed - computed: true, optional: false, required: false + public get isManaged() { + return this.getBooleanAttribute('is_managed'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // public_key - computed: true, optional: false, required: false + public get publicKey() { + return this.getStringAttribute('public_key'); + } + + // scope - computed: true, optional: false, required: false + public get scope() { + return this.getStringAttribute('scope'); + } +} + +export class DataHuaweicloudKpsKeypairsKeypairsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKpsKeypairsKeypairsOutputReference { + return new DataHuaweicloudKpsKeypairsKeypairsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs huaweicloud_kps_keypairs} +*/ +export class DataHuaweicloudKpsKeypairs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kps_keypairs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKpsKeypairs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKpsKeypairs to import + * @param importFromId The id of the existing DataHuaweicloudKpsKeypairs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKpsKeypairs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kps_keypairs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_keypairs huaweicloud_kps_keypairs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKpsKeypairsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKpsKeypairsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kps_keypairs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fingerprint = config.fingerprint; + this._id = config.id; + this._isManaged = config.isManaged; + this._name = config.name; + this._publicKey = config.publicKey; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // fingerprint - computed: false, optional: true, required: false + private _fingerprint?: string; + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + public set fingerprint(value: string) { + this._fingerprint = value; + } + public resetFingerprint() { + this._fingerprint = undefined; + } + // Temporarily expose input value. Use with caution. + public get fingerprintInput() { + return this._fingerprint; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_managed - computed: false, optional: true, required: false + private _isManaged?: boolean | cdktf.IResolvable; + public get isManaged() { + return this.getBooleanAttribute('is_managed'); + } + public set isManaged(value: boolean | cdktf.IResolvable) { + this._isManaged = value; + } + public resetIsManaged() { + this._isManaged = undefined; + } + // Temporarily expose input value. Use with caution. + public get isManagedInput() { + return this._isManaged; + } + + // keypairs - computed: true, optional: false, required: false + private _keypairs = new DataHuaweicloudKpsKeypairsKeypairsList(this, "keypairs", false); + public get keypairs() { + return this._keypairs; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // public_key - computed: false, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fingerprint: cdktf.stringToTerraform(this._fingerprint), + id: cdktf.stringToTerraform(this._id), + is_managed: cdktf.booleanToTerraform(this._isManaged), + name: cdktf.stringToTerraform(this._name), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fingerprint: { + value: cdktf.stringToHclTerraform(this._fingerprint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_managed: { + value: cdktf.booleanToHclTerraform(this._isManaged), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/README.md new file mode 100644 index 00000000..19f8a35e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_kps_running_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_kps_running_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/index.ts new file mode 100644 index 00000000..83952ca3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-kps-running-tasks/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudKpsRunningTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks#id DataHuaweicloudKpsRunningTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks#region DataHuaweicloudKpsRunningTasks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudKpsRunningTasksTasks { +} + +export function dataHuaweicloudKpsRunningTasksTasksToTerraform(struct?: DataHuaweicloudKpsRunningTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudKpsRunningTasksTasksToHclTerraform(struct?: DataHuaweicloudKpsRunningTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudKpsRunningTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudKpsRunningTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudKpsRunningTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // keypair_name - computed: true, optional: false, required: false + public get keypairName() { + return this.getStringAttribute('keypair_name'); + } + + // operate_type - computed: true, optional: false, required: false + public get operateType() { + return this.getStringAttribute('operate_type'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // server_name - computed: true, optional: false, required: false + public get serverName() { + return this.getStringAttribute('server_name'); + } + + // task_time - computed: true, optional: false, required: false + public get taskTime() { + return this.getStringAttribute('task_time'); + } +} + +export class DataHuaweicloudKpsRunningTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudKpsRunningTasksTasksOutputReference { + return new DataHuaweicloudKpsRunningTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks huaweicloud_kps_running_tasks} +*/ +export class DataHuaweicloudKpsRunningTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kps_running_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudKpsRunningTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudKpsRunningTasks to import + * @param importFromId The id of the existing DataHuaweicloudKpsRunningTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudKpsRunningTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kps_running_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/kps_running_tasks huaweicloud_kps_running_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudKpsRunningTasksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudKpsRunningTasksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kps_running_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudKpsRunningTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/README.md new file mode 100644 index 00000000..bf05b68b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lb_certificate` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lb_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/index.ts new file mode 100644 index 00000000..516d6e85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-certificate/index.ts @@ -0,0 +1,212 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLbCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate#id DataHuaweicloudLbCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate#name DataHuaweicloudLbCertificate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate#region DataHuaweicloudLbCertificate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate#type DataHuaweicloudLbCertificate#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate huaweicloud_lb_certificate} +*/ +export class DataHuaweicloudLbCertificate extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLbCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLbCertificate to import + * @param importFromId The id of the existing DataHuaweicloudLbCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLbCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_certificate huaweicloud_lb_certificate} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLbCertificateConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLbCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // expiration - computed: true, optional: false, required: false + public get expiration() { + return this.getStringAttribute('expiration'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/README.md new file mode 100644 index 00000000..b744fc1d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lb_listeners` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lb_listeners`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/index.ts new file mode 100644 index 00000000..ae30226f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-listeners/index.ts @@ -0,0 +1,441 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLbListenersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners#id DataHuaweicloudLbListeners#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The listener name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners#name DataHuaweicloudLbListeners#name} + */ + readonly name?: string; + /** + * The listener protocol. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners#protocol DataHuaweicloudLbListeners#protocol} + */ + readonly protocol?: string; + /** + * The front-end listening port of the listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners#protocol_port DataHuaweicloudLbListeners#protocol_port} + */ + readonly protocolPort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners#region DataHuaweicloudLbListeners#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLbListenersListenersLoadbalancers { +} + +export function dataHuaweicloudLbListenersListenersLoadbalancersToTerraform(struct?: DataHuaweicloudLbListenersListenersLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbListenersListenersLoadbalancersToHclTerraform(struct?: DataHuaweicloudLbListenersListenersLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbListenersListenersLoadbalancersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbListenersListenersLoadbalancers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbListenersListenersLoadbalancers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudLbListenersListenersLoadbalancersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbListenersListenersLoadbalancersOutputReference { + return new DataHuaweicloudLbListenersListenersLoadbalancersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLbListenersListeners { +} + +export function dataHuaweicloudLbListenersListenersToTerraform(struct?: DataHuaweicloudLbListenersListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbListenersListenersToHclTerraform(struct?: DataHuaweicloudLbListenersListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbListenersListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbListenersListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbListenersListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connection_limit - computed: true, optional: false, required: false + public get connectionLimit() { + return this.getNumberAttribute('connection_limit'); + } + + // default_pool_id - computed: true, optional: false, required: false + public get defaultPoolId() { + return this.getStringAttribute('default_pool_id'); + } + + // default_tls_container_ref - computed: true, optional: false, required: false + public get defaultTlsContainerRef() { + return this.getStringAttribute('default_tls_container_ref'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // http2_enable - computed: true, optional: false, required: false + public get http2Enable() { + return this.getBooleanAttribute('http2_enable'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // loadbalancers - computed: true, optional: false, required: false + private _loadbalancers = new DataHuaweicloudLbListenersListenersLoadbalancersList(this, "loadbalancers", false); + public get loadbalancers() { + return this._loadbalancers; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // protocol_port - computed: true, optional: false, required: false + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + + // sni_container_refs - computed: true, optional: false, required: false + public get sniContainerRefs() { + return this.getListAttribute('sni_container_refs'); + } +} + +export class DataHuaweicloudLbListenersListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbListenersListenersOutputReference { + return new DataHuaweicloudLbListenersListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners huaweicloud_lb_listeners} +*/ +export class DataHuaweicloudLbListeners extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_listeners"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLbListeners resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLbListeners to import + * @param importFromId The id of the existing DataHuaweicloudLbListeners that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLbListeners to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_listeners", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_listeners huaweicloud_lb_listeners} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLbListenersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLbListenersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_listeners', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._protocol = config.protocol; + this._protocolPort = config.protocolPort; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudLbListenersListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // protocol_port - computed: false, optional: true, required: false + private _protocolPort?: string; + public get protocolPort() { + return this.getStringAttribute('protocol_port'); + } + public set protocolPort(value: string) { + this._protocolPort = value; + } + public resetProtocolPort() { + this._protocolPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + protocol_port: cdktf.stringToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.stringToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/README.md new file mode 100644 index 00000000..de28c322 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lb_loadbalancer` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lb_loadbalancer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/index.ts new file mode 100644 index 00000000..ebc9b891 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-loadbalancer/index.ts @@ -0,0 +1,328 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLbLoadbalancerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#description DataHuaweicloudLbLoadbalancer#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#enterprise_project_id DataHuaweicloudLbLoadbalancer#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#id DataHuaweicloudLbLoadbalancer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#name DataHuaweicloudLbLoadbalancer#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#region DataHuaweicloudLbLoadbalancer#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#status DataHuaweicloudLbLoadbalancer#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#vip_address DataHuaweicloudLbLoadbalancer#vip_address} + */ + readonly vipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#vip_subnet_id DataHuaweicloudLbLoadbalancer#vip_subnet_id} + */ + readonly vipSubnetId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer huaweicloud_lb_loadbalancer} +*/ +export class DataHuaweicloudLbLoadbalancer extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_loadbalancer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLbLoadbalancer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLbLoadbalancer to import + * @param importFromId The id of the existing DataHuaweicloudLbLoadbalancer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLbLoadbalancer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_loadbalancer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_loadbalancer huaweicloud_lb_loadbalancer} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLbLoadbalancerConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLbLoadbalancerConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_loadbalancer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._vipAddress = config.vipAddress; + this._vipSubnetId = config.vipSubnetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // vip_address - computed: true, optional: true, required: false + private _vipAddress?: string; + public get vipAddress() { + return this.getStringAttribute('vip_address'); + } + public set vipAddress(value: string) { + this._vipAddress = value; + } + public resetVipAddress() { + this._vipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get vipAddressInput() { + return this._vipAddress; + } + + // vip_port_id - computed: true, optional: false, required: false + public get vipPortId() { + return this.getStringAttribute('vip_port_id'); + } + + // vip_subnet_id - computed: true, optional: true, required: false + private _vipSubnetId?: string; + public get vipSubnetId() { + return this.getStringAttribute('vip_subnet_id'); + } + public set vipSubnetId(value: string) { + this._vipSubnetId = value; + } + public resetVipSubnetId() { + this._vipSubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vipSubnetIdInput() { + return this._vipSubnetId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vip_address: cdktf.stringToTerraform(this._vipAddress), + vip_subnet_id: cdktf.stringToTerraform(this._vipSubnetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_address: { + value: cdktf.stringToHclTerraform(this._vipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_subnet_id: { + value: cdktf.stringToHclTerraform(this._vipSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/README.md new file mode 100644 index 00000000..25360c62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lb_pools` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lb_pools`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/index.ts new file mode 100644 index 00000000..7860794d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lb-pools/index.ts @@ -0,0 +1,789 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLbPoolsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#description DataHuaweicloudLbPools#description} + */ + readonly description?: string; + /** + * Specifies the health monitor ID of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#healthmonitor_id DataHuaweicloudLbPools#healthmonitor_id} + */ + readonly healthmonitorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#id DataHuaweicloudLbPools#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the method of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#lb_method DataHuaweicloudLbPools#lb_method} + */ + readonly lbMethod?: string; + /** + * Specifies the loadbalancer ID of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#loadbalancer_id DataHuaweicloudLbPools#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Specifies the name of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#name DataHuaweicloudLbPools#name} + */ + readonly name?: string; + /** + * Specifies the ID of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#pool_id DataHuaweicloudLbPools#pool_id} + */ + readonly poolId?: string; + /** + * Specifies the protocol of the LB pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#protocol DataHuaweicloudLbPools#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#region DataHuaweicloudLbPools#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLbPoolsPoolsListeners { +} + +export function dataHuaweicloudLbPoolsPoolsListenersToTerraform(struct?: DataHuaweicloudLbPoolsPoolsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbPoolsPoolsListenersToHclTerraform(struct?: DataHuaweicloudLbPoolsPoolsListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbPoolsPoolsListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbPoolsPoolsListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbPoolsPoolsListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudLbPoolsPoolsListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbPoolsPoolsListenersOutputReference { + return new DataHuaweicloudLbPoolsPoolsListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLbPoolsPoolsLoadbalancers { +} + +export function dataHuaweicloudLbPoolsPoolsLoadbalancersToTerraform(struct?: DataHuaweicloudLbPoolsPoolsLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbPoolsPoolsLoadbalancersToHclTerraform(struct?: DataHuaweicloudLbPoolsPoolsLoadbalancers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbPoolsPoolsLoadbalancersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbPoolsPoolsLoadbalancers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbPoolsPoolsLoadbalancers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudLbPoolsPoolsLoadbalancersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbPoolsPoolsLoadbalancersOutputReference { + return new DataHuaweicloudLbPoolsPoolsLoadbalancersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLbPoolsPoolsMembers { +} + +export function dataHuaweicloudLbPoolsPoolsMembersToTerraform(struct?: DataHuaweicloudLbPoolsPoolsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbPoolsPoolsMembersToHclTerraform(struct?: DataHuaweicloudLbPoolsPoolsMembers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbPoolsPoolsMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbPoolsPoolsMembers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbPoolsPoolsMembers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class DataHuaweicloudLbPoolsPoolsMembersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbPoolsPoolsMembersOutputReference { + return new DataHuaweicloudLbPoolsPoolsMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLbPoolsPoolsPersistence { +} + +export function dataHuaweicloudLbPoolsPoolsPersistenceToTerraform(struct?: DataHuaweicloudLbPoolsPoolsPersistence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbPoolsPoolsPersistenceToHclTerraform(struct?: DataHuaweicloudLbPoolsPoolsPersistence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbPoolsPoolsPersistenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbPoolsPoolsPersistence | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbPoolsPoolsPersistence | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cookie_name - computed: true, optional: false, required: false + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudLbPoolsPoolsPersistenceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbPoolsPoolsPersistenceOutputReference { + return new DataHuaweicloudLbPoolsPoolsPersistenceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLbPoolsPools { +} + +export function dataHuaweicloudLbPoolsPoolsToTerraform(struct?: DataHuaweicloudLbPoolsPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLbPoolsPoolsToHclTerraform(struct?: DataHuaweicloudLbPoolsPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLbPoolsPoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLbPoolsPools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLbPoolsPools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // healthmonitor_id - computed: true, optional: false, required: false + public get healthmonitorId() { + return this.getStringAttribute('healthmonitor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // lb_method - computed: true, optional: false, required: false + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new DataHuaweicloudLbPoolsPoolsListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // loadbalancers - computed: true, optional: false, required: false + private _loadbalancers = new DataHuaweicloudLbPoolsPoolsLoadbalancersList(this, "loadbalancers", false); + public get loadbalancers() { + return this._loadbalancers; + } + + // members - computed: true, optional: false, required: false + private _members = new DataHuaweicloudLbPoolsPoolsMembersList(this, "members", false); + public get members() { + return this._members; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // persistence - computed: true, optional: false, required: false + private _persistence = new DataHuaweicloudLbPoolsPoolsPersistenceList(this, "persistence", false); + public get persistence() { + return this._persistence; + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } +} + +export class DataHuaweicloudLbPoolsPoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLbPoolsPoolsOutputReference { + return new DataHuaweicloudLbPoolsPoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools huaweicloud_lb_pools} +*/ +export class DataHuaweicloudLbPools extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_pools"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLbPools resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLbPools to import + * @param importFromId The id of the existing DataHuaweicloudLbPools that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLbPools to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_pools", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lb_pools huaweicloud_lb_pools} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLbPoolsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLbPoolsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_pools', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._healthmonitorId = config.healthmonitorId; + this._id = config.id; + this._lbMethod = config.lbMethod; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._poolId = config.poolId; + this._protocol = config.protocol; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // healthmonitor_id - computed: false, optional: true, required: false + private _healthmonitorId?: string; + public get healthmonitorId() { + return this.getStringAttribute('healthmonitor_id'); + } + public set healthmonitorId(value: string) { + this._healthmonitorId = value; + } + public resetHealthmonitorId() { + this._healthmonitorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get healthmonitorIdInput() { + return this._healthmonitorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_method - computed: false, optional: true, required: false + private _lbMethod?: string; + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + public set lbMethod(value: string) { + this._lbMethod = value; + } + public resetLbMethod() { + this._lbMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbMethodInput() { + return this._lbMethod; + } + + // loadbalancer_id - computed: false, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: true, required: false + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + public resetPoolId() { + this._poolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // pools - computed: true, optional: false, required: false + private _pools = new DataHuaweicloudLbPoolsPoolsList(this, "pools", false); + public get pools() { + return this._pools; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + healthmonitor_id: cdktf.stringToTerraform(this._healthmonitorId), + id: cdktf.stringToTerraform(this._id), + lb_method: cdktf.stringToTerraform(this._lbMethod), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + healthmonitor_id: { + value: cdktf.stringToHclTerraform(this._healthmonitorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_method: { + value: cdktf.stringToHclTerraform(this._lbMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/README.md new file mode 100644 index 00000000..3d7a4862 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_live_domains` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_live_domains`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/index.ts new file mode 100644 index 00000000..51dcede3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-live-domains/index.ts @@ -0,0 +1,342 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLiveDomainsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains#enterprise_project_id DataHuaweicloudLiveDomains#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains#id DataHuaweicloudLiveDomains#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains#name DataHuaweicloudLiveDomains#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains#region DataHuaweicloudLiveDomains#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLiveDomainsDomains { +} + +export function dataHuaweicloudLiveDomainsDomainsToTerraform(struct?: DataHuaweicloudLiveDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLiveDomainsDomainsToHclTerraform(struct?: DataHuaweicloudLiveDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLiveDomainsDomainsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLiveDomainsDomains | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLiveDomainsDomains | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cname - computed: true, optional: false, required: false + public get cname() { + return this.getStringAttribute('cname'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // ingest_domain_name - computed: true, optional: false, required: false + public get ingestDomainName() { + return this.getStringAttribute('ingest_domain_name'); + } + + // is_ipv6 - computed: true, optional: false, required: false + public get isIpv6() { + return this.getBooleanAttribute('is_ipv6'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // service_area - computed: true, optional: false, required: false + public get serviceArea() { + return this.getStringAttribute('service_area'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_describe - computed: true, optional: false, required: false + public get statusDescribe() { + return this.getStringAttribute('status_describe'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vendor - computed: true, optional: false, required: false + public get vendor() { + return this.getStringAttribute('vendor'); + } +} + +export class DataHuaweicloudLiveDomainsDomainsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLiveDomainsDomainsOutputReference { + return new DataHuaweicloudLiveDomainsDomainsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains huaweicloud_live_domains} +*/ +export class DataHuaweicloudLiveDomains extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_domains"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLiveDomains resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLiveDomains to import + * @param importFromId The id of the existing DataHuaweicloudLiveDomains that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLiveDomains to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_domains", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/live_domains huaweicloud_live_domains} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLiveDomainsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLiveDomainsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_domains', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // domains - computed: true, optional: false, required: false + private _domains = new DataHuaweicloudLiveDomainsDomainsList(this, "domains", false); + public get domains() { + return this._domains; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/README.md new file mode 100644 index 00000000..7f234620 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_aom_accesses` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_aom_accesses`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/index.ts new file mode 100644 index 00000000..58c5c0bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-aom-accesses/index.ts @@ -0,0 +1,416 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsAomAccessesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses#id DataHuaweicloudLtsAomAccesses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the log group name to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses#log_group_name DataHuaweicloudLtsAomAccesses#log_group_name} + */ + readonly logGroupName?: string; + /** + * Specifies the log stream name to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses#log_stream_name DataHuaweicloudLtsAomAccesses#log_stream_name} + */ + readonly logStreamName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses#region DataHuaweicloudLtsAomAccesses#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLtsAomAccessesAccessesAccessRules { +} + +export function dataHuaweicloudLtsAomAccessesAccessesAccessRulesToTerraform(struct?: DataHuaweicloudLtsAomAccessesAccessesAccessRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsAomAccessesAccessesAccessRulesToHclTerraform(struct?: DataHuaweicloudLtsAomAccessesAccessesAccessRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsAomAccessesAccessesAccessRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsAomAccessesAccessesAccessRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsAomAccessesAccessesAccessRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // log_stream_name - computed: true, optional: false, required: false + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } +} + +export class DataHuaweicloudLtsAomAccessesAccessesAccessRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsAomAccessesAccessesAccessRulesOutputReference { + return new DataHuaweicloudLtsAomAccessesAccessesAccessRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsAomAccessesAccesses { +} + +export function dataHuaweicloudLtsAomAccessesAccessesToTerraform(struct?: DataHuaweicloudLtsAomAccessesAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsAomAccessesAccessesToHclTerraform(struct?: DataHuaweicloudLtsAomAccessesAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsAomAccessesAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsAomAccessesAccesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsAomAccessesAccesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_rules - computed: true, optional: false, required: false + private _accessRules = new DataHuaweicloudLtsAomAccessesAccessesAccessRulesList(this, "access_rules", false); + public get accessRules() { + return this._accessRules; + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // cluster_name - computed: true, optional: false, required: false + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + + // container_name - computed: true, optional: false, required: false + public get containerName() { + return this.getStringAttribute('container_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // workloads - computed: true, optional: false, required: false + public get workloads() { + return this.getListAttribute('workloads'); + } +} + +export class DataHuaweicloudLtsAomAccessesAccessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsAomAccessesAccessesOutputReference { + return new DataHuaweicloudLtsAomAccessesAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses huaweicloud_lts_aom_accesses} +*/ +export class DataHuaweicloudLtsAomAccesses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_aom_accesses"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsAomAccesses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsAomAccesses to import + * @param importFromId The id of the existing DataHuaweicloudLtsAomAccesses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsAomAccesses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_aom_accesses", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_aom_accesses huaweicloud_lts_aom_accesses} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsAomAccessesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsAomAccessesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_aom_accesses', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupName = config.logGroupName; + this._logStreamName = config.logStreamName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // accesses - computed: true, optional: false, required: false + private _accesses = new DataHuaweicloudLtsAomAccessesAccessesList(this, "accesses", false); + public get accesses() { + return this._accesses; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_name - computed: false, optional: true, required: false + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + public resetLogGroupName() { + this._logGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_name - computed: false, optional: true, required: false + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + public resetLogStreamName() { + this._logStreamName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/README.md new file mode 100644 index 00000000..5b8a47b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_cce_accesses` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_cce_accesses`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/index.ts new file mode 100644 index 00000000..138a475c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-cce-accesses/index.ts @@ -0,0 +1,844 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsCceAccessesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#id DataHuaweicloudLtsCceAccesses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the log group to which the access configurations and log streams belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#log_group_name DataHuaweicloudLtsCceAccesses#log_group_name} + */ + readonly logGroupName?: string; + /** + * The name of the log stream to which the access configurations belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#log_stream_name DataHuaweicloudLtsCceAccesses#log_stream_name} + */ + readonly logStreamName?: string; + /** + * The name of the CCE access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#name DataHuaweicloudLtsCceAccesses#name} + */ + readonly name?: string; + /** + * The region in which to query CCE access configurations. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#region DataHuaweicloudLtsCceAccesses#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#tags DataHuaweicloudLtsCceAccesses#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormat { +} + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatToTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatToHclTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatOutputReference { + return new DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormat { +} + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatToTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatToHclTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatOutputReference { + return new DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfo { +} + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoToTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoToHclTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // categorys - computed: true, optional: false, required: false + public get categorys() { + return this.getListAttribute('categorys'); + } + + // event_level - computed: true, optional: false, required: false + public get eventLevel() { + return this.getListAttribute('event_level'); + } + + // time_offset - computed: true, optional: false, required: false + public get timeOffset() { + return this.getNumberAttribute('time_offset'); + } + + // time_offset_unit - computed: true, optional: false, required: false + public get timeOffsetUnit() { + return this.getStringAttribute('time_offset_unit'); + } +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoOutputReference { + return new DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsCceAccessesAccessesAccessConfig { +} + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigToTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsCceAccessesAccessesAccessConfigToHclTerraform(struct?: DataHuaweicloudLtsCceAccessesAccessesAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsCceAccessesAccessesAccessConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsCceAccessesAccessesAccessConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // black_paths - computed: true, optional: false, required: false + public get blackPaths() { + return this.getListAttribute('black_paths'); + } + + // container_name_regex - computed: true, optional: false, required: false + public get containerNameRegex() { + return this.getStringAttribute('container_name_regex'); + } + + // exclude_envs - computed: true, optional: false, required: false + private _excludeEnvs = new cdktf.StringMap(this, "exclude_envs"); + public get excludeEnvs() { + return this._excludeEnvs; + } + + // exclude_k8s_labels - computed: true, optional: false, required: false + private _excludeK8SLabels = new cdktf.StringMap(this, "exclude_k8s_labels"); + public get excludeK8SLabels() { + return this._excludeK8SLabels; + } + + // exclude_labels - computed: true, optional: false, required: false + private _excludeLabels = new cdktf.StringMap(this, "exclude_labels"); + public get excludeLabels() { + return this._excludeLabels; + } + + // include_envs - computed: true, optional: false, required: false + private _includeEnvs = new cdktf.StringMap(this, "include_envs"); + public get includeEnvs() { + return this._includeEnvs; + } + + // include_k8s_labels - computed: true, optional: false, required: false + private _includeK8SLabels = new cdktf.StringMap(this, "include_k8s_labels"); + public get includeK8SLabels() { + return this._includeK8SLabels; + } + + // include_labels - computed: true, optional: false, required: false + private _includeLabels = new cdktf.StringMap(this, "include_labels"); + public get includeLabels() { + return this._includeLabels; + } + + // log_envs - computed: true, optional: false, required: false + private _logEnvs = new cdktf.StringMap(this, "log_envs"); + public get logEnvs() { + return this._logEnvs; + } + + // log_k8s - computed: true, optional: false, required: false + private _logK8S = new cdktf.StringMap(this, "log_k8s"); + public get logK8S() { + return this._logK8S; + } + + // log_labels - computed: true, optional: false, required: false + private _logLabels = new cdktf.StringMap(this, "log_labels"); + public get logLabels() { + return this._logLabels; + } + + // multi_log_format - computed: true, optional: false, required: false + private _multiLogFormat = new DataHuaweicloudLtsCceAccessesAccessesAccessConfigMultiLogFormatList(this, "multi_log_format", false); + public get multiLogFormat() { + return this._multiLogFormat; + } + + // name_space_regex - computed: true, optional: false, required: false + public get nameSpaceRegex() { + return this.getStringAttribute('name_space_regex'); + } + + // path_type - computed: true, optional: false, required: false + public get pathType() { + return this.getStringAttribute('path_type'); + } + + // paths - computed: true, optional: false, required: false + public get paths() { + return this.getListAttribute('paths'); + } + + // pod_name_regex - computed: true, optional: false, required: false + public get podNameRegex() { + return this.getStringAttribute('pod_name_regex'); + } + + // single_log_format - computed: true, optional: false, required: false + private _singleLogFormat = new DataHuaweicloudLtsCceAccessesAccessesAccessConfigSingleLogFormatList(this, "single_log_format", false); + public get singleLogFormat() { + return this._singleLogFormat; + } + + // stderr - computed: true, optional: false, required: false + public get stderr() { + return this.getBooleanAttribute('stderr'); + } + + // stdout - computed: true, optional: false, required: false + public get stdout() { + return this.getBooleanAttribute('stdout'); + } + + // windows_log_info - computed: true, optional: false, required: false + private _windowsLogInfo = new DataHuaweicloudLtsCceAccessesAccessesAccessConfigWindowsLogInfoList(this, "windows_log_info", false); + public get windowsLogInfo() { + return this._windowsLogInfo; + } +} + +export class DataHuaweicloudLtsCceAccessesAccessesAccessConfigList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsCceAccessesAccessesAccessConfigOutputReference { + return new DataHuaweicloudLtsCceAccessesAccessesAccessConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsCceAccessesAccesses { +} + +export function dataHuaweicloudLtsCceAccessesAccessesToTerraform(struct?: DataHuaweicloudLtsCceAccessesAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsCceAccessesAccessesToHclTerraform(struct?: DataHuaweicloudLtsCceAccessesAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsCceAccessesAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsCceAccessesAccesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsCceAccessesAccesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_config - computed: true, optional: false, required: false + private _accessConfig = new DataHuaweicloudLtsCceAccessesAccessesAccessConfigList(this, "access_config", false); + public get accessConfig() { + return this._accessConfig; + } + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // binary_collect - computed: true, optional: false, required: false + public get binaryCollect() { + return this.getBooleanAttribute('binary_collect'); + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // host_group_ids - computed: true, optional: false, required: false + public get hostGroupIds() { + return this.getListAttribute('host_group_ids'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // log_split - computed: true, optional: false, required: false + public get logSplit() { + return this.getBooleanAttribute('log_split'); + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // log_stream_name - computed: true, optional: false, required: false + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } +} + +export class DataHuaweicloudLtsCceAccessesAccessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsCceAccessesAccessesOutputReference { + return new DataHuaweicloudLtsCceAccessesAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses huaweicloud_lts_cce_accesses} +*/ +export class DataHuaweicloudLtsCceAccesses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_cce_accesses"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsCceAccesses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsCceAccesses to import + * @param importFromId The id of the existing DataHuaweicloudLtsCceAccesses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsCceAccesses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_cce_accesses", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_cce_accesses huaweicloud_lts_cce_accesses} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsCceAccessesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsCceAccessesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_cce_accesses', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupName = config.logGroupName; + this._logStreamName = config.logStreamName; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // accesses - computed: true, optional: false, required: false + private _accesses = new DataHuaweicloudLtsCceAccessesAccessesList(this, "accesses", false); + public get accesses() { + return this._accesses; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_name - computed: false, optional: true, required: false + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + public resetLogGroupName() { + this._logGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_name - computed: false, optional: true, required: false + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + public resetLogStreamName() { + this._logStreamName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/README.md new file mode 100644 index 00000000..bbece84c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/index.ts new file mode 100644 index 00000000..4ef6e2c0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-groups/index.ts @@ -0,0 +1,253 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups#id DataHuaweicloudLtsGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups#region DataHuaweicloudLtsGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLtsGroupsGroups { +} + +export function dataHuaweicloudLtsGroupsGroupsToTerraform(struct?: DataHuaweicloudLtsGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsGroupsGroupsToHclTerraform(struct?: DataHuaweicloudLtsGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ttl_in_days - computed: true, optional: false, required: false + public get ttlInDays() { + return this.getNumberAttribute('ttl_in_days'); + } +} + +export class DataHuaweicloudLtsGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsGroupsGroupsOutputReference { + return new DataHuaweicloudLtsGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups huaweicloud_lts_groups} +*/ +export class DataHuaweicloudLtsGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsGroups to import + * @param importFromId The id of the existing DataHuaweicloudLtsGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_groups huaweicloud_lts_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudLtsGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/README.md new file mode 100644 index 00000000..f618bd9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_host_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_host_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/index.ts new file mode 100644 index 00000000..614a033c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-host-groups/index.ts @@ -0,0 +1,378 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsHostGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Speicifies the ID of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#host_group_id DataHuaweicloudLtsHostGroups#host_group_id} + */ + readonly hostGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#id DataHuaweicloudLtsHostGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Speicifies the name of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#name DataHuaweicloudLtsHostGroups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#region DataHuaweicloudLtsHostGroups#region} + */ + readonly region?: string; + /** + * Specifies the key/value pairs to associate with the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#tags DataHuaweicloudLtsHostGroups#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Speicifies the type of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#type DataHuaweicloudLtsHostGroups#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudLtsHostGroupsGroups { +} + +export function dataHuaweicloudLtsHostGroupsGroupsToTerraform(struct?: DataHuaweicloudLtsHostGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsHostGroupsGroupsToHclTerraform(struct?: DataHuaweicloudLtsHostGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsHostGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsHostGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsHostGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // host_ids - computed: true, optional: false, required: false + public get hostIds() { + return this.getListAttribute('host_ids'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudLtsHostGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsHostGroupsGroupsOutputReference { + return new DataHuaweicloudLtsHostGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups huaweicloud_lts_host_groups} +*/ +export class DataHuaweicloudLtsHostGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_host_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsHostGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsHostGroups to import + * @param importFromId The id of the existing DataHuaweicloudLtsHostGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsHostGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_host_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_host_groups huaweicloud_lts_host_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsHostGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsHostGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_host_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._hostGroupId = config.hostGroupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudLtsHostGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // host_group_id - computed: false, optional: true, required: false + private _hostGroupId?: string; + public get hostGroupId() { + return this.getStringAttribute('host_group_id'); + } + public set hostGroupId(value: string) { + this._hostGroupId = value; + } + public resetHostGroupId() { + this._hostGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostGroupIdInput() { + return this._hostGroupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + host_group_id: cdktf.stringToTerraform(this._hostGroupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + host_group_id: { + value: cdktf.stringToHclTerraform(this._hostGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/README.md new file mode 100644 index 00000000..bca110e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_notification_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_notification_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/index.ts new file mode 100644 index 00000000..b64d648d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-notification-templates/index.ts @@ -0,0 +1,365 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsNotificationTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the account ID of IAM user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates#domain_id DataHuaweicloudLtsNotificationTemplates#domain_id} + */ + readonly domainId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates#id DataHuaweicloudLtsNotificationTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates#region DataHuaweicloudLtsNotificationTemplates#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLtsNotificationTemplatesTemplatesTemplates { +} + +export function dataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesToTerraform(struct?: DataHuaweicloudLtsNotificationTemplatesTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudLtsNotificationTemplatesTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsNotificationTemplatesTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsNotificationTemplatesTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // sub_type - computed: true, optional: false, required: false + public get subType() { + return this.getStringAttribute('sub_type'); + } +} + +export class DataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesOutputReference { + return new DataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsNotificationTemplatesTemplates { +} + +export function dataHuaweicloudLtsNotificationTemplatesTemplatesToTerraform(struct?: DataHuaweicloudLtsNotificationTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsNotificationTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudLtsNotificationTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsNotificationTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsNotificationTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsNotificationTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // locale - computed: true, optional: false, required: false + public get locale() { + return this.getStringAttribute('locale'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudLtsNotificationTemplatesTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudLtsNotificationTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsNotificationTemplatesTemplatesOutputReference { + return new DataHuaweicloudLtsNotificationTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates huaweicloud_lts_notification_templates} +*/ +export class DataHuaweicloudLtsNotificationTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_notification_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsNotificationTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsNotificationTemplates to import + * @param importFromId The id of the existing DataHuaweicloudLtsNotificationTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsNotificationTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_notification_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_notification_templates huaweicloud_lts_notification_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsNotificationTemplatesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsNotificationTemplatesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_notification_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainId = config.domainId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_id - computed: false, optional: false, required: true + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudLtsNotificationTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_id: cdktf.stringToTerraform(this._domainId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/README.md new file mode 100644 index 00000000..5e20052c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_search_criteria` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_search_criteria`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/index.ts new file mode 100644 index 00000000..3130116f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-search-criteria/index.ts @@ -0,0 +1,355 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsSearchCriteriaConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria#id DataHuaweicloudLtsSearchCriteria#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the log group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria#log_group_id DataHuaweicloudLtsSearchCriteria#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria#region DataHuaweicloudLtsSearchCriteria#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteria { +} + +export function dataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaToTerraform(struct?: DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteria): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaToHclTerraform(struct?: DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteria): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteria | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteria | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // criteria - computed: true, optional: false, required: false + public get criteria() { + return this.getStringAttribute('criteria'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaOutputReference { + return new DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsSearchCriteriaSearchCriteria { +} + +export function dataHuaweicloudLtsSearchCriteriaSearchCriteriaToTerraform(struct?: DataHuaweicloudLtsSearchCriteriaSearchCriteria): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsSearchCriteriaSearchCriteriaToHclTerraform(struct?: DataHuaweicloudLtsSearchCriteriaSearchCriteria): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsSearchCriteriaSearchCriteriaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsSearchCriteriaSearchCriteria | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsSearchCriteriaSearchCriteria | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // criteria - computed: true, optional: false, required: false + private _criteria = new DataHuaweicloudLtsSearchCriteriaSearchCriteriaCriteriaList(this, "criteria", false); + public get criteria() { + return this._criteria; + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // log_stream_name - computed: true, optional: false, required: false + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } +} + +export class DataHuaweicloudLtsSearchCriteriaSearchCriteriaList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsSearchCriteriaSearchCriteriaOutputReference { + return new DataHuaweicloudLtsSearchCriteriaSearchCriteriaOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria huaweicloud_lts_search_criteria} +*/ +export class DataHuaweicloudLtsSearchCriteria extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_search_criteria"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsSearchCriteria resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsSearchCriteria to import + * @param importFromId The id of the existing DataHuaweicloudLtsSearchCriteria that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsSearchCriteria to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_search_criteria", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_search_criteria huaweicloud_lts_search_criteria} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsSearchCriteriaConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsSearchCriteriaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_search_criteria', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupId = config.logGroupId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // search_criteria - computed: true, optional: false, required: false + private _searchCriteria = new DataHuaweicloudLtsSearchCriteriaSearchCriteriaList(this, "search_criteria", false); + public get searchCriteria() { + return this._searchCriteria; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/README.md new file mode 100644 index 00000000..60d0e4ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_streams` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_streams`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/index.ts new file mode 100644 index 00000000..4e14ca9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-streams/index.ts @@ -0,0 +1,303 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsStreamsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams#id DataHuaweicloudLtsStreams#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the log group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams#log_group_name DataHuaweicloudLtsStreams#log_group_name} + */ + readonly logGroupName?: string; + /** + * Specifies the name of the log stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams#name DataHuaweicloudLtsStreams#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams#region DataHuaweicloudLtsStreams#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLtsStreamsStreams { +} + +export function dataHuaweicloudLtsStreamsStreamsToTerraform(struct?: DataHuaweicloudLtsStreamsStreams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsStreamsStreamsToHclTerraform(struct?: DataHuaweicloudLtsStreamsStreams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsStreamsStreamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsStreamsStreams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsStreamsStreams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } +} + +export class DataHuaweicloudLtsStreamsStreamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsStreamsStreamsOutputReference { + return new DataHuaweicloudLtsStreamsStreamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams huaweicloud_lts_streams} +*/ +export class DataHuaweicloudLtsStreams extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_streams"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsStreams resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsStreams to import + * @param importFromId The id of the existing DataHuaweicloudLtsStreams that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsStreams to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_streams", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_streams huaweicloud_lts_streams} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsStreamsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsStreamsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_streams', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupName = config.logGroupName; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_name - computed: false, optional: true, required: false + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + public resetLogGroupName() { + this._logGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // streams - computed: true, optional: false, required: false + private _streams = new DataHuaweicloudLtsStreamsStreamsList(this, "streams", false); + public get streams() { + return this._streams; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/README.md new file mode 100644 index 00000000..f11b0af6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_structuring_custom_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_structuring_custom_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/index.ts new file mode 100644 index 00000000..0ac1752f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-structuring-custom-templates/index.ts @@ -0,0 +1,330 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsStructuringCustomTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates#id DataHuaweicloudLtsStructuringCustomTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the custom template name to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates#name DataHuaweicloudLtsStructuringCustomTemplates#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates#region DataHuaweicloudLtsStructuringCustomTemplates#region} + */ + readonly region?: string; + /** + * Specifies the ID of the template to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates#template_id DataHuaweicloudLtsStructuringCustomTemplates#template_id} + */ + readonly templateId?: string; + /** + * Specifies the custom template type to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates#type DataHuaweicloudLtsStructuringCustomTemplates#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudLtsStructuringCustomTemplatesTemplates { +} + +export function dataHuaweicloudLtsStructuringCustomTemplatesTemplatesToTerraform(struct?: DataHuaweicloudLtsStructuringCustomTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsStructuringCustomTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudLtsStructuringCustomTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsStructuringCustomTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsStructuringCustomTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsStructuringCustomTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // demo_log - computed: true, optional: false, required: false + public get demoLog() { + return this.getStringAttribute('demo_log'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudLtsStructuringCustomTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsStructuringCustomTemplatesTemplatesOutputReference { + return new DataHuaweicloudLtsStructuringCustomTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates huaweicloud_lts_structuring_custom_templates} +*/ +export class DataHuaweicloudLtsStructuringCustomTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_structuring_custom_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsStructuringCustomTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsStructuringCustomTemplates to import + * @param importFromId The id of the existing DataHuaweicloudLtsStructuringCustomTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsStructuringCustomTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_structuring_custom_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_structuring_custom_templates huaweicloud_lts_structuring_custom_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsStructuringCustomTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsStructuringCustomTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_structuring_custom_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._templateId = config.templateId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudLtsStructuringCustomTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/README.md new file mode 100644 index 00000000..14b248bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_lts_transfers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_lts_transfers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/index.ts new file mode 100644 index 00000000..f681ca05 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-lts-transfers/index.ts @@ -0,0 +1,731 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudLtsTransfersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers#id DataHuaweicloudLtsTransfers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the log group to which the log transfers and log streams belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers#log_group_name DataHuaweicloudLtsTransfers#log_group_name} + */ + readonly logGroupName?: string; + /** + * The name of the log stream to be transferred in the log transfer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers#log_stream_name DataHuaweicloudLtsTransfers#log_stream_name} + */ + readonly logStreamName?: string; + /** + * The region in which to query log transfers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers#region DataHuaweicloudLtsTransfers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudLtsTransfersTransfersLogStreams { +} + +export function dataHuaweicloudLtsTransfersTransfersLogStreamsToTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogStreams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsTransfersTransfersLogStreamsToHclTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogStreams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsTransfersTransfersLogStreamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsTransfersTransfersLogStreams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsTransfersTransfersLogStreams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // log_stream_name - computed: true, optional: false, required: false + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } +} + +export class DataHuaweicloudLtsTransfersTransfersLogStreamsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsTransfersTransfersLogStreamsOutputReference { + return new DataHuaweicloudLtsTransfersTransfersLogStreamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransfer { +} + +export function dataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferToTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransfer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferToHclTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransfer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransfer | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransfer | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agency_domain_id - computed: true, optional: false, required: false + public get agencyDomainId() { + return this.getStringAttribute('agency_domain_id'); + } + + // agency_domain_name - computed: true, optional: false, required: false + public get agencyDomainName() { + return this.getStringAttribute('agency_domain_name'); + } + + // agency_name - computed: true, optional: false, required: false + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + + // agency_project_id - computed: true, optional: false, required: false + public get agencyProjectId() { + return this.getStringAttribute('agency_project_id'); + } +} + +export class DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferOutputReference { + return new DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetail { +} + +export function dataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailToTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailToHclTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // delivery_tags - computed: true, optional: false, required: false + public get deliveryTags() { + return this.getListAttribute('delivery_tags'); + } + + // dis_id - computed: true, optional: false, required: false + public get disId() { + return this.getStringAttribute('dis_id'); + } + + // dis_name - computed: true, optional: false, required: false + public get disName() { + return this.getStringAttribute('dis_name'); + } + + // kafka_id - computed: true, optional: false, required: false + public get kafkaId() { + return this.getStringAttribute('kafka_id'); + } + + // kafka_topic - computed: true, optional: false, required: false + public get kafkaTopic() { + return this.getStringAttribute('kafka_topic'); + } + + // obs_bucket_name - computed: true, optional: false, required: false + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + + // obs_dir_prefix_name - computed: true, optional: false, required: false + public get obsDirPrefixName() { + return this.getStringAttribute('obs_dir_prefix_name'); + } + + // obs_encrypted_enable - computed: true, optional: false, required: false + public get obsEncryptedEnable() { + return this.getBooleanAttribute('obs_encrypted_enable'); + } + + // obs_encrypted_id - computed: true, optional: false, required: false + public get obsEncryptedId() { + return this.getStringAttribute('obs_encrypted_id'); + } + + // obs_eps_id - computed: true, optional: false, required: false + public get obsEpsId() { + return this.getStringAttribute('obs_eps_id'); + } + + // obs_period - computed: true, optional: false, required: false + public get obsPeriod() { + return this.getNumberAttribute('obs_period'); + } + + // obs_period_unit - computed: true, optional: false, required: false + public get obsPeriodUnit() { + return this.getStringAttribute('obs_period_unit'); + } + + // obs_prefix_name - computed: true, optional: false, required: false + public get obsPrefixName() { + return this.getStringAttribute('obs_prefix_name'); + } + + // obs_time_zone - computed: true, optional: false, required: false + public get obsTimeZone() { + return this.getStringAttribute('obs_time_zone'); + } + + // obs_time_zone_id - computed: true, optional: false, required: false + public get obsTimeZoneId() { + return this.getStringAttribute('obs_time_zone_id'); + } + + // obs_transfer_path - computed: true, optional: false, required: false + public get obsTransferPath() { + return this.getStringAttribute('obs_transfer_path'); + } +} + +export class DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailOutputReference { + return new DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsTransfersTransfersLogTransferInfo { +} + +export function dataHuaweicloudLtsTransfersTransfersLogTransferInfoToTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogTransferInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsTransfersTransfersLogTransferInfoToHclTerraform(struct?: DataHuaweicloudLtsTransfersTransfersLogTransferInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsTransfersTransfersLogTransferInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsTransfersTransfersLogTransferInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsTransfersTransfersLogTransferInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // log_agency_transfer - computed: true, optional: false, required: false + private _logAgencyTransfer = new DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogAgencyTransferList(this, "log_agency_transfer", false); + public get logAgencyTransfer() { + return this._logAgencyTransfer; + } + + // log_storage_format - computed: true, optional: false, required: false + public get logStorageFormat() { + return this.getStringAttribute('log_storage_format'); + } + + // log_transfer_detail - computed: true, optional: false, required: false + private _logTransferDetail = new DataHuaweicloudLtsTransfersTransfersLogTransferInfoLogTransferDetailList(this, "log_transfer_detail", false); + public get logTransferDetail() { + return this._logTransferDetail; + } + + // log_transfer_mode - computed: true, optional: false, required: false + public get logTransferMode() { + return this.getStringAttribute('log_transfer_mode'); + } + + // log_transfer_status - computed: true, optional: false, required: false + public get logTransferStatus() { + return this.getStringAttribute('log_transfer_status'); + } + + // log_transfer_type - computed: true, optional: false, required: false + public get logTransferType() { + return this.getStringAttribute('log_transfer_type'); + } +} + +export class DataHuaweicloudLtsTransfersTransfersLogTransferInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsTransfersTransfersLogTransferInfoOutputReference { + return new DataHuaweicloudLtsTransfersTransfersLogTransferInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudLtsTransfersTransfers { +} + +export function dataHuaweicloudLtsTransfersTransfersToTerraform(struct?: DataHuaweicloudLtsTransfersTransfers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudLtsTransfersTransfersToHclTerraform(struct?: DataHuaweicloudLtsTransfersTransfers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudLtsTransfersTransfersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudLtsTransfersTransfers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudLtsTransfersTransfers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // log_streams - computed: true, optional: false, required: false + private _logStreams = new DataHuaweicloudLtsTransfersTransfersLogStreamsList(this, "log_streams", false); + public get logStreams() { + return this._logStreams; + } + + // log_transfer_info - computed: true, optional: false, required: false + private _logTransferInfo = new DataHuaweicloudLtsTransfersTransfersLogTransferInfoList(this, "log_transfer_info", false); + public get logTransferInfo() { + return this._logTransferInfo; + } +} + +export class DataHuaweicloudLtsTransfersTransfersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudLtsTransfersTransfersOutputReference { + return new DataHuaweicloudLtsTransfersTransfersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers huaweicloud_lts_transfers} +*/ +export class DataHuaweicloudLtsTransfers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_transfers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudLtsTransfers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudLtsTransfers to import + * @param importFromId The id of the existing DataHuaweicloudLtsTransfers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudLtsTransfers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_transfers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/lts_transfers huaweicloud_lts_transfers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudLtsTransfersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudLtsTransfersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_transfers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupName = config.logGroupName; + this._logStreamName = config.logStreamName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_name - computed: false, optional: true, required: false + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + public resetLogGroupName() { + this._logGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_name - computed: false, optional: true, required: false + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + public resetLogStreamName() { + this._logStreamName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // transfers - computed: true, optional: false, required: false + private _transfers = new DataHuaweicloudLtsTransfersTransfersList(this, "transfers", false); + public get transfers() { + return this._transfers; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/README.md new file mode 100644 index 00000000..dda3502d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_mapreduce_clusters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_mapreduce_clusters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/index.ts new file mode 100644 index 00000000..6d01d405 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-clusters/index.ts @@ -0,0 +1,1024 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudMapreduceClustersConfig extends cdktf.TerraformMetaArguments { + /** + * The enterprise project ID used to query clusters in a specified enterprise project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#enterprise_project_id DataHuaweicloudMapreduceClusters#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#id DataHuaweicloudMapreduceClusters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#name DataHuaweicloudMapreduceClusters#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#region DataHuaweicloudMapreduceClusters#region} + */ + readonly region?: string; + /** + * The status of cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#status DataHuaweicloudMapreduceClusters#status} + */ + readonly status?: string; + /** + * You can search for a cluster by its tags. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#tags DataHuaweicloudMapreduceClusters#tags} + */ + readonly tags?: string; +} +export interface DataHuaweicloudMapreduceClustersClustersComponentListStruct { +} + +export function dataHuaweicloudMapreduceClustersClustersComponentListStructToTerraform(struct?: DataHuaweicloudMapreduceClustersClustersComponentListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudMapreduceClustersClustersComponentListStructToHclTerraform(struct?: DataHuaweicloudMapreduceClustersClustersComponentListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudMapreduceClustersClustersComponentListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudMapreduceClustersClustersComponentListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudMapreduceClustersClustersComponentListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // component_desc - computed: true, optional: false, required: false + public get componentDesc() { + return this.getStringAttribute('component_desc'); + } + + // component_id - computed: true, optional: false, required: false + public get componentId() { + return this.getStringAttribute('component_id'); + } + + // component_name - computed: true, optional: false, required: false + public get componentName() { + return this.getStringAttribute('component_name'); + } + + // component_version - computed: true, optional: false, required: false + public get componentVersion() { + return this.getStringAttribute('component_version'); + } +} + +export class DataHuaweicloudMapreduceClustersClustersComponentListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudMapreduceClustersClustersComponentListStructOutputReference { + return new DataHuaweicloudMapreduceClustersClustersComponentListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudMapreduceClustersClustersNodeGroups { +} + +export function dataHuaweicloudMapreduceClustersClustersNodeGroupsToTerraform(struct?: DataHuaweicloudMapreduceClustersClustersNodeGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudMapreduceClustersClustersNodeGroupsToHclTerraform(struct?: DataHuaweicloudMapreduceClustersClustersNodeGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudMapreduceClustersClustersNodeGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudMapreduceClustersClustersNodeGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudMapreduceClustersClustersNodeGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_volume_count - computed: true, optional: false, required: false + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + + // data_volume_product_id - computed: true, optional: false, required: false + public get dataVolumeProductId() { + return this.getStringAttribute('data_volume_product_id'); + } + + // data_volume_resource_spec_code - computed: true, optional: false, required: false + public get dataVolumeResourceSpecCode() { + return this.getStringAttribute('data_volume_resource_spec_code'); + } + + // data_volume_resource_type - computed: true, optional: false, required: false + public get dataVolumeResourceType() { + return this.getStringAttribute('data_volume_resource_type'); + } + + // data_volume_size - computed: true, optional: false, required: false + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + + // data_volume_type - computed: true, optional: false, required: false + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // node_product_id - computed: true, optional: false, required: false + public get nodeProductId() { + return this.getStringAttribute('node_product_id'); + } + + // node_size - computed: true, optional: false, required: false + public get nodeSize() { + return this.getStringAttribute('node_size'); + } + + // node_spec_id - computed: true, optional: false, required: false + public get nodeSpecId() { + return this.getStringAttribute('node_spec_id'); + } + + // root_volume_product_id - computed: true, optional: false, required: false + public get rootVolumeProductId() { + return this.getStringAttribute('root_volume_product_id'); + } + + // root_volume_resource_spec_code - computed: true, optional: false, required: false + public get rootVolumeResourceSpecCode() { + return this.getStringAttribute('root_volume_resource_spec_code'); + } + + // root_volume_resource_type - computed: true, optional: false, required: false + public get rootVolumeResourceType() { + return this.getStringAttribute('root_volume_resource_type'); + } + + // root_volume_size - computed: true, optional: false, required: false + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + + // root_volume_type - computed: true, optional: false, required: false + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + + // vm_product_id - computed: true, optional: false, required: false + public get vmProductId() { + return this.getStringAttribute('vm_product_id'); + } + + // vm_spec_code - computed: true, optional: false, required: false + public get vmSpecCode() { + return this.getStringAttribute('vm_spec_code'); + } +} + +export class DataHuaweicloudMapreduceClustersClustersNodeGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudMapreduceClustersClustersNodeGroupsOutputReference { + return new DataHuaweicloudMapreduceClustersClustersNodeGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudMapreduceClustersClustersTaskNodeGroups { +} + +export function dataHuaweicloudMapreduceClustersClustersTaskNodeGroupsToTerraform(struct?: DataHuaweicloudMapreduceClustersClustersTaskNodeGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudMapreduceClustersClustersTaskNodeGroupsToHclTerraform(struct?: DataHuaweicloudMapreduceClustersClustersTaskNodeGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudMapreduceClustersClustersTaskNodeGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudMapreduceClustersClustersTaskNodeGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudMapreduceClustersClustersTaskNodeGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_volume_count - computed: true, optional: false, required: false + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + + // data_volume_product_id - computed: true, optional: false, required: false + public get dataVolumeProductId() { + return this.getStringAttribute('data_volume_product_id'); + } + + // data_volume_resource_spec_code - computed: true, optional: false, required: false + public get dataVolumeResourceSpecCode() { + return this.getStringAttribute('data_volume_resource_spec_code'); + } + + // data_volume_resource_type - computed: true, optional: false, required: false + public get dataVolumeResourceType() { + return this.getStringAttribute('data_volume_resource_type'); + } + + // data_volume_size - computed: true, optional: false, required: false + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + + // data_volume_type - computed: true, optional: false, required: false + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // node_product_id - computed: true, optional: false, required: false + public get nodeProductId() { + return this.getStringAttribute('node_product_id'); + } + + // node_size - computed: true, optional: false, required: false + public get nodeSize() { + return this.getStringAttribute('node_size'); + } + + // node_spec_id - computed: true, optional: false, required: false + public get nodeSpecId() { + return this.getStringAttribute('node_spec_id'); + } + + // root_volume_product_id - computed: true, optional: false, required: false + public get rootVolumeProductId() { + return this.getStringAttribute('root_volume_product_id'); + } + + // root_volume_resource_spec_code - computed: true, optional: false, required: false + public get rootVolumeResourceSpecCode() { + return this.getStringAttribute('root_volume_resource_spec_code'); + } + + // root_volume_resource_type - computed: true, optional: false, required: false + public get rootVolumeResourceType() { + return this.getStringAttribute('root_volume_resource_type'); + } + + // root_volume_size - computed: true, optional: false, required: false + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + + // root_volume_type - computed: true, optional: false, required: false + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + + // vm_product_id - computed: true, optional: false, required: false + public get vmProductId() { + return this.getStringAttribute('vm_product_id'); + } + + // vm_spec_code - computed: true, optional: false, required: false + public get vmSpecCode() { + return this.getStringAttribute('vm_spec_code'); + } +} + +export class DataHuaweicloudMapreduceClustersClustersTaskNodeGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudMapreduceClustersClustersTaskNodeGroupsOutputReference { + return new DataHuaweicloudMapreduceClustersClustersTaskNodeGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudMapreduceClustersClusters { +} + +export function dataHuaweicloudMapreduceClustersClustersToTerraform(struct?: DataHuaweicloudMapreduceClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudMapreduceClustersClustersToHclTerraform(struct?: DataHuaweicloudMapreduceClustersClusters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudMapreduceClustersClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudMapreduceClustersClusters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudMapreduceClustersClusters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // billing_type - computed: true, optional: false, required: false + public get billingType() { + return this.getStringAttribute('billing_type'); + } + + // component_list - computed: true, optional: false, required: false + private _componentList = new DataHuaweicloudMapreduceClustersClustersComponentListStructList(this, "component_list", false); + public get componentList() { + return this._componentList; + } + + // core_data_volume_count - computed: true, optional: false, required: false + public get coreDataVolumeCount() { + return this.getNumberAttribute('core_data_volume_count'); + } + + // core_data_volume_size - computed: true, optional: false, required: false + public get coreDataVolumeSize() { + return this.getNumberAttribute('core_data_volume_size'); + } + + // core_data_volume_type - computed: true, optional: false, required: false + public get coreDataVolumeType() { + return this.getStringAttribute('core_data_volume_type'); + } + + // core_node_num - computed: true, optional: false, required: false + public get coreNodeNum() { + return this.getStringAttribute('core_node_num'); + } + + // core_node_product_id - computed: true, optional: false, required: false + public get coreNodeProductId() { + return this.getStringAttribute('core_node_product_id'); + } + + // core_node_size - computed: true, optional: false, required: false + public get coreNodeSize() { + return this.getStringAttribute('core_node_size'); + } + + // core_node_spec_id - computed: true, optional: false, required: false + public get coreNodeSpecId() { + return this.getStringAttribute('core_node_spec_id'); + } + + // deployment_id - computed: true, optional: false, required: false + public get deploymentId() { + return this.getStringAttribute('deployment_id'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getStringAttribute('duration'); + } + + // eip_address - computed: true, optional: false, required: false + public get eipAddress() { + return this.getStringAttribute('eip_address'); + } + + // eip_id - computed: true, optional: false, required: false + public get eipId() { + return this.getStringAttribute('eip_id'); + } + + // eipv6_address - computed: true, optional: false, required: false + public get eipv6Address() { + return this.getStringAttribute('eipv6_address'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // external_alternate_ip - computed: true, optional: false, required: false + public get externalAlternateIp() { + return this.getStringAttribute('external_alternate_ip'); + } + + // external_ip - computed: true, optional: false, required: false + public get externalIp() { + return this.getStringAttribute('external_ip'); + } + + // fee - computed: true, optional: false, required: false + public get fee() { + return this.getStringAttribute('fee'); + } + + // hadoop_version - computed: true, optional: false, required: false + public get hadoopVersion() { + return this.getStringAttribute('hadoop_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // internal_ip - computed: true, optional: false, required: false + public get internalIp() { + return this.getStringAttribute('internal_ip'); + } + + // log_collection - computed: true, optional: false, required: false + public get logCollection() { + return this.getNumberAttribute('log_collection'); + } + + // master_data_volume_count - computed: true, optional: false, required: false + public get masterDataVolumeCount() { + return this.getNumberAttribute('master_data_volume_count'); + } + + // master_data_volume_size - computed: true, optional: false, required: false + public get masterDataVolumeSize() { + return this.getNumberAttribute('master_data_volume_size'); + } + + // master_data_volume_type - computed: true, optional: false, required: false + public get masterDataVolumeType() { + return this.getStringAttribute('master_data_volume_type'); + } + + // master_node_ip - computed: true, optional: false, required: false + public get masterNodeIp() { + return this.getStringAttribute('master_node_ip'); + } + + // master_node_num - computed: true, optional: false, required: false + public get masterNodeNum() { + return this.getStringAttribute('master_node_num'); + } + + // master_node_product_id - computed: true, optional: false, required: false + public get masterNodeProductId() { + return this.getStringAttribute('master_node_product_id'); + } + + // master_node_size - computed: true, optional: false, required: false + public get masterNodeSize() { + return this.getStringAttribute('master_node_size'); + } + + // master_node_spec_id - computed: true, optional: false, required: false + public get masterNodeSpecId() { + return this.getStringAttribute('master_node_spec_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_groups - computed: true, optional: false, required: false + private _nodeGroups = new DataHuaweicloudMapreduceClustersClustersNodeGroupsList(this, "node_groups", false); + public get nodeGroups() { + return this._nodeGroups; + } + + // node_public_cert_name - computed: true, optional: false, required: false + public get nodePublicCertName() { + return this.getStringAttribute('node_public_cert_name'); + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // period_type - computed: true, optional: false, required: false + public get periodType() { + return this.getNumberAttribute('period_type'); + } + + // private_ip_first - computed: true, optional: false, required: false + public get privateIpFirst() { + return this.getStringAttribute('private_ip_first'); + } + + // safe_mode - computed: true, optional: false, required: false + public get safeMode() { + return this.getNumberAttribute('safe_mode'); + } + + // scale - computed: true, optional: false, required: false + public get scale() { + return this.getStringAttribute('scale'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // slave_security_group_id - computed: true, optional: false, required: false + public get slaveSecurityGroupId() { + return this.getStringAttribute('slave_security_group_id'); + } + + // stage_desc - computed: true, optional: false, required: false + public get stageDesc() { + return this.getStringAttribute('stage_desc'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // task_node_groups - computed: true, optional: false, required: false + private _taskNodeGroups = new DataHuaweicloudMapreduceClustersClustersTaskNodeGroupsList(this, "task_node_groups", false); + public get taskNodeGroups() { + return this._taskNodeGroups; + } + + // total_node_num - computed: true, optional: false, required: false + public get totalNodeNum() { + return this.getStringAttribute('total_node_num'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vnc - computed: true, optional: false, required: false + public get vnc() { + return this.getStringAttribute('vnc'); + } + + // volume_size - computed: true, optional: false, required: false + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + + // volume_type - computed: true, optional: false, required: false + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudMapreduceClustersClustersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudMapreduceClustersClustersOutputReference { + return new DataHuaweicloudMapreduceClustersClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters huaweicloud_mapreduce_clusters} +*/ +export class DataHuaweicloudMapreduceClusters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mapreduce_clusters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudMapreduceClusters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudMapreduceClusters to import + * @param importFromId The id of the existing DataHuaweicloudMapreduceClusters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudMapreduceClusters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mapreduce_clusters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_clusters huaweicloud_mapreduce_clusters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudMapreduceClustersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudMapreduceClustersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mapreduce_clusters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // clusters - computed: true, optional: false, required: false + private _clusters = new DataHuaweicloudMapreduceClustersClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: string; + public get tags() { + return this.getStringAttribute('tags'); + } + public set tags(value: string) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.stringToTerraform(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.stringToHclTerraform(this._tags), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/README.md new file mode 100644 index 00000000..b61a7ab1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_mapreduce_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_mapreduce_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/index.ts new file mode 100644 index 00000000..61ea0df2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-mapreduce-versions/index.ts @@ -0,0 +1,149 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudMapreduceVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions#id DataHuaweicloudMapreduceVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions#region DataHuaweicloudMapreduceVersions#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions huaweicloud_mapreduce_versions} +*/ +export class DataHuaweicloudMapreduceVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mapreduce_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudMapreduceVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudMapreduceVersions to import + * @param importFromId The id of the existing DataHuaweicloudMapreduceVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudMapreduceVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mapreduce_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/mapreduce_versions huaweicloud_mapreduce_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudMapreduceVersionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudMapreduceVersionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mapreduce_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // versions - computed: true, optional: false, required: false + public get versions() { + return this.getListAttribute('versions'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/README.md new file mode 100644 index 00000000..5b90e831 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_dataset_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_dataset_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/index.ts new file mode 100644 index 00000000..1428f85b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-dataset-versions/index.ts @@ -0,0 +1,351 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsDatasetVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions#dataset_id DataHuaweicloudModelartsDatasetVersions#dataset_id} + */ + readonly datasetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions#id DataHuaweicloudModelartsDatasetVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions#name DataHuaweicloudModelartsDatasetVersions#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions#region DataHuaweicloudModelartsDatasetVersions#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions#split_ratio DataHuaweicloudModelartsDatasetVersions#split_ratio} + */ + readonly splitRatio?: string; +} +export interface DataHuaweicloudModelartsDatasetVersionsVersions { +} + +export function dataHuaweicloudModelartsDatasetVersionsVersionsToTerraform(struct?: DataHuaweicloudModelartsDatasetVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsDatasetVersionsVersionsToHclTerraform(struct?: DataHuaweicloudModelartsDatasetVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsDatasetVersionsVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsDatasetVersionsVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsDatasetVersionsVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // files - computed: true, optional: false, required: false + public get files() { + return this.getNumberAttribute('files'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_current - computed: true, optional: false, required: false + public get isCurrent() { + return this.getBooleanAttribute('is_current'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // split_ratio - computed: true, optional: false, required: false + public get splitRatio() { + return this.getStringAttribute('split_ratio'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // storage_path - computed: true, optional: false, required: false + public get storagePath() { + return this.getStringAttribute('storage_path'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudModelartsDatasetVersionsVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsDatasetVersionsVersionsOutputReference { + return new DataHuaweicloudModelartsDatasetVersionsVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions huaweicloud_modelarts_dataset_versions} +*/ +export class DataHuaweicloudModelartsDatasetVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_dataset_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsDatasetVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsDatasetVersions to import + * @param importFromId The id of the existing DataHuaweicloudModelartsDatasetVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsDatasetVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_dataset_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_dataset_versions huaweicloud_modelarts_dataset_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsDatasetVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsDatasetVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_dataset_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datasetId = config.datasetId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._splitRatio = config.splitRatio; + } + + // ========== + // ATTRIBUTES + // ========== + + // dataset_id - computed: false, optional: false, required: true + private _datasetId?: string; + public get datasetId() { + return this.getStringAttribute('dataset_id'); + } + public set datasetId(value: string) { + this._datasetId = value; + } + // Temporarily expose input value. Use with caution. + public get datasetIdInput() { + return this._datasetId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // split_ratio - computed: false, optional: true, required: false + private _splitRatio?: string; + public get splitRatio() { + return this.getStringAttribute('split_ratio'); + } + public set splitRatio(value: string) { + this._splitRatio = value; + } + public resetSplitRatio() { + this._splitRatio = undefined; + } + // Temporarily expose input value. Use with caution. + public get splitRatioInput() { + return this._splitRatio; + } + + // versions - computed: true, optional: false, required: false + private _versions = new DataHuaweicloudModelartsDatasetVersionsVersionsList(this, "versions", false); + public get versions() { + return this._versions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dataset_id: cdktf.stringToTerraform(this._datasetId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + split_ratio: cdktf.stringToTerraform(this._splitRatio), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dataset_id: { + value: cdktf.stringToHclTerraform(this._datasetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + split_ratio: { + value: cdktf.stringToHclTerraform(this._splitRatio), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/README.md new file mode 100644 index 00000000..50716096 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_datasets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_datasets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/index.ts new file mode 100644 index 00000000..1af97332 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-datasets/index.ts @@ -0,0 +1,589 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsDatasetsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets#id DataHuaweicloudModelartsDatasets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets#name DataHuaweicloudModelartsDatasets#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets#region DataHuaweicloudModelartsDatasets#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets#type DataHuaweicloudModelartsDatasets#type} + */ + readonly type?: number; +} +export interface DataHuaweicloudModelartsDatasetsDatasetsDataSource { +} + +export function dataHuaweicloudModelartsDatasetsDatasetsDataSourceToTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasetsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsDatasetsDatasetsDataSourceToHclTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasetsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsDatasetsDatasetsDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsDatasetsDatasetsDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsDatasetsDatasetsDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_type - computed: true, optional: false, required: false + public get dataType() { + return this.getNumberAttribute('data_type'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // with_column_header - computed: true, optional: false, required: false + public get withColumnHeader() { + return this.getBooleanAttribute('with_column_header'); + } +} + +export class DataHuaweicloudModelartsDatasetsDatasetsDataSourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsDatasetsDatasetsDataSourceOutputReference { + return new DataHuaweicloudModelartsDatasetsDatasetsDataSourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsDatasetsDatasetsLabels { +} + +export function dataHuaweicloudModelartsDatasetsDatasetsLabelsToTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasetsLabels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsDatasetsDatasetsLabelsToHclTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasetsLabels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsDatasetsDatasetsLabelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsDatasetsDatasetsLabels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsDatasetsDatasetsLabels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // property_color - computed: true, optional: false, required: false + public get propertyColor() { + return this.getStringAttribute('property_color'); + } + + // property_shape - computed: true, optional: false, required: false + public get propertyShape() { + return this.getStringAttribute('property_shape'); + } + + // property_shortcut - computed: true, optional: false, required: false + public get propertyShortcut() { + return this.getStringAttribute('property_shortcut'); + } +} + +export class DataHuaweicloudModelartsDatasetsDatasetsLabelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsDatasetsDatasetsLabelsOutputReference { + return new DataHuaweicloudModelartsDatasetsDatasetsLabelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsDatasetsDatasetsSchemas { +} + +export function dataHuaweicloudModelartsDatasetsDatasetsSchemasToTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasetsSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsDatasetsDatasetsSchemasToHclTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasetsSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsDatasetsDatasetsSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsDatasetsDatasetsSchemas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsDatasetsDatasetsSchemas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsDatasetsDatasetsSchemasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsDatasetsDatasetsSchemasOutputReference { + return new DataHuaweicloudModelartsDatasetsDatasetsSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsDatasetsDatasets { +} + +export function dataHuaweicloudModelartsDatasetsDatasetsToTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsDatasetsDatasetsToHclTerraform(struct?: DataHuaweicloudModelartsDatasetsDatasets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsDatasetsDatasetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsDatasetsDatasets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsDatasetsDatasets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_format - computed: true, optional: false, required: false + public get dataFormat() { + return this.getStringAttribute('data_format'); + } + + // data_source - computed: true, optional: false, required: false + private _dataSource = new DataHuaweicloudModelartsDatasetsDatasetsDataSourceList(this, "data_source", false); + public get dataSource() { + return this._dataSource; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // labels - computed: true, optional: false, required: false + private _labels = new DataHuaweicloudModelartsDatasetsDatasetsLabelsList(this, "labels", false); + public get labels() { + return this._labels; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // output_path - computed: true, optional: false, required: false + public get outputPath() { + return this.getStringAttribute('output_path'); + } + + // schemas - computed: true, optional: false, required: false + private _schemas = new DataHuaweicloudModelartsDatasetsDatasetsSchemasList(this, "schemas", false); + public get schemas() { + return this._schemas; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } +} + +export class DataHuaweicloudModelartsDatasetsDatasetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsDatasetsDatasetsOutputReference { + return new DataHuaweicloudModelartsDatasetsDatasetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets huaweicloud_modelarts_datasets} +*/ +export class DataHuaweicloudModelartsDatasets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_datasets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsDatasets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsDatasets to import + * @param importFromId The id of the existing DataHuaweicloudModelartsDatasets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsDatasets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_datasets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_datasets huaweicloud_modelarts_datasets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsDatasetsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsDatasetsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_datasets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // datasets - computed: true, optional: false, required: false + private _datasets = new DataHuaweicloudModelartsDatasetsDatasetsList(this, "datasets", false); + public get datasets() { + return this._datasets; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.numberToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/README.md new file mode 100644 index 00000000..0c37f2d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_model_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_model_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/index.ts new file mode 100644 index 00000000..a8196b8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-model-templates/index.ts @@ -0,0 +1,557 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsModelTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * The AI engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#engine DataHuaweicloudModelartsModelTemplates#engine} + */ + readonly engine?: string; + /** + * Model runtime environment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#environment DataHuaweicloudModelartsModelTemplates#environment} + */ + readonly environment?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#id DataHuaweicloudModelartsModelTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Keywords to search in name or description. Fuzzy match is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#keyword DataHuaweicloudModelartsModelTemplates#keyword} + */ + readonly keyword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#region DataHuaweicloudModelartsModelTemplates#region} + */ + readonly region?: string; + /** + * The type of model. The valid values are **Classification** and **Common**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#type DataHuaweicloudModelartsModelTemplates#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocs { +} + +export function dataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsToTerraform(struct?: DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsToHclTerraform(struct?: DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // doc_name - computed: true, optional: false, required: false + public get docName() { + return this.getStringAttribute('doc_name'); + } + + // doc_url - computed: true, optional: false, required: false + public get docUrl() { + return this.getStringAttribute('doc_url'); + } +} + +export class DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsOutputReference { + return new DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputs { +} + +export function dataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsToTerraform(struct?: DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsToHclTerraform(struct?: DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsOutputReference { + return new DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsModelTemplatesTemplates { +} + +export function dataHuaweicloudModelartsModelTemplatesTemplatesToTerraform(struct?: DataHuaweicloudModelartsModelTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsModelTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudModelartsModelTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsModelTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsModelTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsModelTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch - computed: true, optional: false, required: false + public get arch() { + return this.getStringAttribute('arch'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // environment - computed: true, optional: false, required: false + public get environment() { + return this.getStringAttribute('environment'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // template_docs - computed: true, optional: false, required: false + private _templateDocs = new DataHuaweicloudModelartsModelTemplatesTemplatesTemplateDocsList(this, "template_docs", false); + public get templateDocs() { + return this._templateDocs; + } + + // template_inputs - computed: true, optional: false, required: false + private _templateInputs = new DataHuaweicloudModelartsModelTemplatesTemplatesTemplateInputsList(this, "template_inputs", false); + public get templateInputs() { + return this._templateInputs; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsModelTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsModelTemplatesTemplatesOutputReference { + return new DataHuaweicloudModelartsModelTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates huaweicloud_modelarts_model_templates} +*/ +export class DataHuaweicloudModelartsModelTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_model_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsModelTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsModelTemplates to import + * @param importFromId The id of the existing DataHuaweicloudModelartsModelTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsModelTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_model_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_model_templates huaweicloud_modelarts_model_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsModelTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsModelTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_model_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engine = config.engine; + this._environment = config.environment; + this._id = config.id; + this._keyword = config.keyword; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine - computed: false, optional: true, required: false + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + public resetEngine() { + this._engine = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // environment - computed: false, optional: true, required: false + private _environment?: string; + public get environment() { + return this.getStringAttribute('environment'); + } + public set environment(value: string) { + this._environment = value; + } + public resetEnvironment() { + this._environment = undefined; + } + // Temporarily expose input value. Use with caution. + public get environmentInput() { + return this._environment; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keyword - computed: false, optional: true, required: false + private _keyword?: string; + public get keyword() { + return this.getStringAttribute('keyword'); + } + public set keyword(value: string) { + this._keyword = value; + } + public resetKeyword() { + this._keyword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordInput() { + return this._keyword; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudModelartsModelTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine: cdktf.stringToTerraform(this._engine), + environment: cdktf.stringToTerraform(this._environment), + id: cdktf.stringToTerraform(this._id), + keyword: cdktf.stringToTerraform(this._keyword), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment: { + value: cdktf.stringToHclTerraform(this._environment), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keyword: { + value: cdktf.stringToHclTerraform(this._keyword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/README.md new file mode 100644 index 00000000..510a6632 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_models` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_models`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/index.ts new file mode 100644 index 00000000..1a4bbc5b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-models/index.ts @@ -0,0 +1,641 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsModelsConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the model. Fuzzy match is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#description DataHuaweicloudModelartsModels#description} + */ + readonly description?: string; + /** + * Whether to use exact match. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#exact_match DataHuaweicloudModelartsModels#exact_match} + */ + readonly exactMatch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#id DataHuaweicloudModelartsModels#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Model type, which is used for obtaining models of this type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#model_type DataHuaweicloudModelartsModels#model_type} + */ + readonly modelType?: string; + /** + * Model name. Fuzzy match is supported. Set **exact_match** to **true** to use exact match. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#name DataHuaweicloudModelartsModels#name} + */ + readonly name?: string; + /** + * Model type, which is used for obtaining models of types except for this type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#not_model_type DataHuaweicloudModelartsModels#not_model_type} + */ + readonly notModelType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#region DataHuaweicloudModelartsModels#region} + */ + readonly region?: string; + /** + * Model status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#status DataHuaweicloudModelartsModels#status} + */ + readonly status?: string; + /** + * Model version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#version DataHuaweicloudModelartsModels#version} + */ + readonly version?: string; + /** + * Workspace ID, which defaults to 0. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#workspace_id DataHuaweicloudModelartsModels#workspace_id} + */ + readonly workspaceId?: string; +} +export interface DataHuaweicloudModelartsModelsModelsSpecification { +} + +export function dataHuaweicloudModelartsModelsModelsSpecificationToTerraform(struct?: DataHuaweicloudModelartsModelsModelsSpecification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsModelsModelsSpecificationToHclTerraform(struct?: DataHuaweicloudModelartsModelsModelsSpecification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsModelsModelsSpecificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsModelsModelsSpecification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsModelsModelsSpecification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // min_ascend - computed: true, optional: false, required: false + public get minAscend() { + return this.getStringAttribute('min_ascend'); + } + + // min_cpu - computed: true, optional: false, required: false + public get minCpu() { + return this.getStringAttribute('min_cpu'); + } + + // min_gpu - computed: true, optional: false, required: false + public get minGpu() { + return this.getStringAttribute('min_gpu'); + } + + // min_memory - computed: true, optional: false, required: false + public get minMemory() { + return this.getStringAttribute('min_memory'); + } +} + +export class DataHuaweicloudModelartsModelsModelsSpecificationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsModelsModelsSpecificationOutputReference { + return new DataHuaweicloudModelartsModelsModelsSpecificationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsModelsModels { +} + +export function dataHuaweicloudModelartsModelsModelsToTerraform(struct?: DataHuaweicloudModelartsModelsModels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsModelsModelsToHclTerraform(struct?: DataHuaweicloudModelartsModelsModels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsModelsModelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsModelsModels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsModelsModels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // extra - computed: true, optional: false, required: false + public get extra() { + return this.getStringAttribute('extra'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // install_type - computed: true, optional: false, required: false + public get installType() { + return this.getListAttribute('install_type'); + } + + // market_flag - computed: true, optional: false, required: false + public get marketFlag() { + return this.getBooleanAttribute('market_flag'); + } + + // model_source - computed: true, optional: false, required: false + public get modelSource() { + return this.getStringAttribute('model_source'); + } + + // model_type - computed: true, optional: false, required: false + public get modelType() { + return this.getStringAttribute('model_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // publishable_flag - computed: true, optional: false, required: false + public get publishableFlag() { + return this.getBooleanAttribute('publishable_flag'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getStringAttribute('source_type'); + } + + // specification - computed: true, optional: false, required: false + private _specification = new DataHuaweicloudModelartsModelsModelsSpecificationList(this, "specification", false); + public get specification() { + return this._specification; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subscription_id - computed: true, optional: false, required: false + public get subscriptionId() { + return this.getStringAttribute('subscription_id'); + } + + // tunable - computed: true, optional: false, required: false + public get tunable() { + return this.getBooleanAttribute('tunable'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudModelartsModelsModelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsModelsModelsOutputReference { + return new DataHuaweicloudModelartsModelsModelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models huaweicloud_modelarts_models} +*/ +export class DataHuaweicloudModelartsModels extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_models"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsModels resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsModels to import + * @param importFromId The id of the existing DataHuaweicloudModelartsModels that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsModels to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_models", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_models huaweicloud_modelarts_models} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsModelsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsModelsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_models', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._exactMatch = config.exactMatch; + this._id = config.id; + this._modelType = config.modelType; + this._name = config.name; + this._notModelType = config.notModelType; + this._region = config.region; + this._status = config.status; + this._version = config.version; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // exact_match - computed: false, optional: true, required: false + private _exactMatch?: string; + public get exactMatch() { + return this.getStringAttribute('exact_match'); + } + public set exactMatch(value: string) { + this._exactMatch = value; + } + public resetExactMatch() { + this._exactMatch = undefined; + } + // Temporarily expose input value. Use with caution. + public get exactMatchInput() { + return this._exactMatch; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // model_type - computed: false, optional: true, required: false + private _modelType?: string; + public get modelType() { + return this.getStringAttribute('model_type'); + } + public set modelType(value: string) { + this._modelType = value; + } + public resetModelType() { + this._modelType = undefined; + } + // Temporarily expose input value. Use with caution. + public get modelTypeInput() { + return this._modelType; + } + + // models - computed: true, optional: false, required: false + private _models = new DataHuaweicloudModelartsModelsModelsList(this, "models", false); + public get models() { + return this._models; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // not_model_type - computed: false, optional: true, required: false + private _notModelType?: string; + public get notModelType() { + return this.getStringAttribute('not_model_type'); + } + public set notModelType(value: string) { + this._notModelType = value; + } + public resetNotModelType() { + this._notModelType = undefined; + } + // Temporarily expose input value. Use with caution. + public get notModelTypeInput() { + return this._notModelType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // workspace_id - computed: false, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + exact_match: cdktf.stringToTerraform(this._exactMatch), + id: cdktf.stringToTerraform(this._id), + model_type: cdktf.stringToTerraform(this._modelType), + name: cdktf.stringToTerraform(this._name), + not_model_type: cdktf.stringToTerraform(this._notModelType), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + version: cdktf.stringToTerraform(this._version), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exact_match: { + value: cdktf.stringToHclTerraform(this._exactMatch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_type: { + value: cdktf.stringToHclTerraform(this._modelType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + not_model_type: { + value: cdktf.stringToHclTerraform(this._notModelType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/README.md new file mode 100644 index 00000000..ac50be86 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_notebook_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_notebook_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/index.ts new file mode 100644 index 00000000..b7248ad1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-flavors/index.ts @@ -0,0 +1,507 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsNotebookFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Processor type. The valid values are: **CPU**, **GPU**, **ASCEND**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors#category DataHuaweicloudModelartsNotebookFlavors#category} + */ + readonly category?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors#id DataHuaweicloudModelartsNotebookFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors#region DataHuaweicloudModelartsNotebookFlavors#region} + */ + readonly region?: string; + /** + * Cluster type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors#type DataHuaweicloudModelartsNotebookFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudModelartsNotebookFlavorsFlavorsBilling { +} + +export function dataHuaweicloudModelartsNotebookFlavorsFlavorsBillingToTerraform(struct?: DataHuaweicloudModelartsNotebookFlavorsFlavorsBilling): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsNotebookFlavorsFlavorsBillingToHclTerraform(struct?: DataHuaweicloudModelartsNotebookFlavorsFlavorsBilling): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsNotebookFlavorsFlavorsBillingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsNotebookFlavorsFlavorsBilling | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsNotebookFlavorsFlavorsBilling | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // unit_num - computed: true, optional: false, required: false + public get unitNum() { + return this.getNumberAttribute('unit_num'); + } +} + +export class DataHuaweicloudModelartsNotebookFlavorsFlavorsBillingList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsNotebookFlavorsFlavorsBillingOutputReference { + return new DataHuaweicloudModelartsNotebookFlavorsFlavorsBillingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsNotebookFlavorsFlavorsGpu { +} + +export function dataHuaweicloudModelartsNotebookFlavorsFlavorsGpuToTerraform(struct?: DataHuaweicloudModelartsNotebookFlavorsFlavorsGpu): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsNotebookFlavorsFlavorsGpuToHclTerraform(struct?: DataHuaweicloudModelartsNotebookFlavorsFlavorsGpu): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsNotebookFlavorsFlavorsGpuOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsNotebookFlavorsFlavorsGpu | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsNotebookFlavorsFlavorsGpu | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // gpu - computed: true, optional: false, required: false + public get gpu() { + return this.getNumberAttribute('gpu'); + } + + // gpu_memory - computed: true, optional: false, required: false + public get gpuMemory() { + return this.getStringAttribute('gpu_memory'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsNotebookFlavorsFlavorsGpuList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsNotebookFlavorsFlavorsGpuOutputReference { + return new DataHuaweicloudModelartsNotebookFlavorsFlavorsGpuOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsNotebookFlavorsFlavors { +} + +export function dataHuaweicloudModelartsNotebookFlavorsFlavorsToTerraform(struct?: DataHuaweicloudModelartsNotebookFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsNotebookFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudModelartsNotebookFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsNotebookFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsNotebookFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsNotebookFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch - computed: true, optional: false, required: false + public get arch() { + return this.getStringAttribute('arch'); + } + + // billing - computed: true, optional: false, required: false + private _billing = new DataHuaweicloudModelartsNotebookFlavorsFlavorsBillingList(this, "billing", false); + public get billing() { + return this._billing; + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // feature - computed: true, optional: false, required: false + public get feature() { + return this.getStringAttribute('feature'); + } + + // free - computed: true, optional: false, required: false + public get free() { + return this.getBooleanAttribute('free'); + } + + // gpu - computed: true, optional: false, required: false + private _gpu = new DataHuaweicloudModelartsNotebookFlavorsFlavorsGpuList(this, "gpu", false); + public get gpu() { + return this._gpu; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // sold_out - computed: true, optional: false, required: false + public get soldOut() { + return this.getBooleanAttribute('sold_out'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudModelartsNotebookFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsNotebookFlavorsFlavorsOutputReference { + return new DataHuaweicloudModelartsNotebookFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors huaweicloud_modelarts_notebook_flavors} +*/ +export class DataHuaweicloudModelartsNotebookFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_notebook_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsNotebookFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsNotebookFlavors to import + * @param importFromId The id of the existing DataHuaweicloudModelartsNotebookFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsNotebookFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_notebook_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_flavors huaweicloud_modelarts_notebook_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsNotebookFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsNotebookFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_notebook_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudModelartsNotebookFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/README.md new file mode 100644 index 00000000..069ded01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_notebook_images` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_notebook_images`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/index.ts new file mode 100644 index 00000000..1dd696a4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-notebook-images/index.ts @@ -0,0 +1,390 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsNotebookImagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#cpu_arch DataHuaweicloudModelartsNotebookImages#cpu_arch} + */ + readonly cpuArch?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#id DataHuaweicloudModelartsNotebookImages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#name DataHuaweicloudModelartsNotebookImages#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#organization DataHuaweicloudModelartsNotebookImages#organization} + */ + readonly organization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#region DataHuaweicloudModelartsNotebookImages#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#type DataHuaweicloudModelartsNotebookImages#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#workspace_id DataHuaweicloudModelartsNotebookImages#workspace_id} + */ + readonly workspaceId?: string; +} +export interface DataHuaweicloudModelartsNotebookImagesImages { +} + +export function dataHuaweicloudModelartsNotebookImagesImagesToTerraform(struct?: DataHuaweicloudModelartsNotebookImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsNotebookImagesImagesToHclTerraform(struct?: DataHuaweicloudModelartsNotebookImagesImages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsNotebookImagesImagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsNotebookImagesImages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsNotebookImagesImages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cpu_arch - computed: true, optional: false, required: false + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // swr_path - computed: true, optional: false, required: false + public get swrPath() { + return this.getStringAttribute('swr_path'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsNotebookImagesImagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsNotebookImagesImagesOutputReference { + return new DataHuaweicloudModelartsNotebookImagesImagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images huaweicloud_modelarts_notebook_images} +*/ +export class DataHuaweicloudModelartsNotebookImages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_notebook_images"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsNotebookImages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsNotebookImages to import + * @param importFromId The id of the existing DataHuaweicloudModelartsNotebookImages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsNotebookImages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_notebook_images", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_notebook_images huaweicloud_modelarts_notebook_images} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsNotebookImagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsNotebookImagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_notebook_images', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cpuArch = config.cpuArch; + this._id = config.id; + this._name = config.name; + this._organization = config.organization; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cpu_arch - computed: false, optional: true, required: false + private _cpuArch?: string; + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + public set cpuArch(value: string) { + this._cpuArch = value; + } + public resetCpuArch() { + this._cpuArch = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuArchInput() { + return this._cpuArch; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // images - computed: true, optional: false, required: false + private _images = new DataHuaweicloudModelartsNotebookImagesImagesList(this, "images", false); + public get images() { + return this._images; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization - computed: false, optional: true, required: false + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + public resetOrganization() { + this._organization = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cpu_arch: cdktf.stringToTerraform(this._cpuArch), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cpu_arch: { + value: cdktf.stringToHclTerraform(this._cpuArch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/README.md new file mode 100644 index 00000000..7b42e6dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_resource_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_resource_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/index.ts new file mode 100644 index 00000000..cdb1dc62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-resource-flavors/index.ts @@ -0,0 +1,585 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsResourceFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors#id DataHuaweicloudModelartsResourceFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors#region DataHuaweicloudModelartsResourceFlavors#region} + */ + readonly region?: string; + /** + * The tag key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors#tag DataHuaweicloudModelartsResourceFlavors#tag} + */ + readonly tag?: string; + /** + * The type of resource flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors#type DataHuaweicloudModelartsResourceFlavors#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudModelartsResourceFlavorsFlavorsGpu { +} + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsGpuToTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavorsGpu): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsGpuToHclTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavorsGpu): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsGpuOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsResourceFlavorsFlavorsGpu | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsResourceFlavorsFlavorsGpu | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsGpuList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsResourceFlavorsFlavorsGpuOutputReference { + return new DataHuaweicloudModelartsResourceFlavorsFlavorsGpuOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsResourceFlavorsFlavorsNpu { +} + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsNpuToTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavorsNpu): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsNpuToHclTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavorsNpu): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsNpuOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsResourceFlavorsFlavorsNpu | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsResourceFlavorsFlavorsNpu | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsNpuList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsResourceFlavorsFlavorsNpuOutputReference { + return new DataHuaweicloudModelartsResourceFlavorsFlavorsNpuOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsResourceFlavorsFlavorsVolume { +} + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsVolumeToTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavorsVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsVolumeToHclTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavorsVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsResourceFlavorsFlavorsVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsResourceFlavorsFlavorsVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsResourceFlavorsFlavorsVolumeOutputReference { + return new DataHuaweicloudModelartsResourceFlavorsFlavorsVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsResourceFlavorsFlavors { +} + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsToTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsResourceFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudModelartsResourceFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsResourceFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsResourceFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arch - computed: true, optional: false, required: false + public get arch() { + return this.getStringAttribute('arch'); + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // billing_modes - computed: true, optional: false, required: false + public get billingModes() { + return this.getNumberListAttribute('billing_modes'); + } + + // cpu - computed: true, optional: false, required: false + public get cpu() { + return this.getStringAttribute('cpu'); + } + + // gpu - computed: true, optional: false, required: false + private _gpu = new DataHuaweicloudModelartsResourceFlavorsFlavorsGpuList(this, "gpu", false); + public get gpu() { + return this._gpu; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // job_flavors - computed: true, optional: false, required: false + public get jobFlavors() { + return this.getListAttribute('job_flavors'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // npu - computed: true, optional: false, required: false + private _npu = new DataHuaweicloudModelartsResourceFlavorsFlavorsNpuList(this, "npu", false); + public get npu() { + return this._npu; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume - computed: true, optional: false, required: false + private _volume = new DataHuaweicloudModelartsResourceFlavorsFlavorsVolumeList(this, "volume", false); + public get volume() { + return this._volume; + } +} + +export class DataHuaweicloudModelartsResourceFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsResourceFlavorsFlavorsOutputReference { + return new DataHuaweicloudModelartsResourceFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors huaweicloud_modelarts_resource_flavors} +*/ +export class DataHuaweicloudModelartsResourceFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_resource_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsResourceFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsResourceFlavors to import + * @param importFromId The id of the existing DataHuaweicloudModelartsResourceFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsResourceFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_resource_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_resource_flavors huaweicloud_modelarts_resource_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsResourceFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsResourceFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_resource_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._tag = config.tag; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudModelartsResourceFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tag - computed: false, optional: true, required: false + private _tag?: string; + public get tag() { + return this.getStringAttribute('tag'); + } + public set tag(value: string) { + this._tag = value; + } + public resetTag() { + this._tag = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagInput() { + return this._tag; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + tag: cdktf.stringToTerraform(this._tag), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag: { + value: cdktf.stringToHclTerraform(this._tag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/README.md new file mode 100644 index 00000000..b29f3947 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_service_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_service_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/index.ts new file mode 100644 index 00000000..0dbcd4c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-service-flavors/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsServiceFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#id DataHuaweicloudModelartsServiceFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Inference mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#infer_type DataHuaweicloudModelartsServiceFlavors#infer_type} + */ + readonly inferType?: string; + /** + * Whether the flavor is free of charge. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#is_free DataHuaweicloudModelartsServiceFlavors#is_free} + */ + readonly isFree?: boolean | cdktf.IResolvable; + /** + * Whether this flavor is open or not. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#is_open DataHuaweicloudModelartsServiceFlavors#is_open} + */ + readonly isOpen?: boolean | cdktf.IResolvable; + /** + * Whether this flavors is supported by dedicated resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#is_personal_cluster DataHuaweicloudModelartsServiceFlavors#is_personal_cluster} + */ + readonly isPersonalCluster?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#region DataHuaweicloudModelartsServiceFlavors#region} + */ + readonly region?: string; + /** + * Flavor status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#status DataHuaweicloudModelartsServiceFlavors#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudModelartsServiceFlavorsFlavors { +} + +export function dataHuaweicloudModelartsServiceFlavorsFlavorsToTerraform(struct?: DataHuaweicloudModelartsServiceFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsServiceFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudModelartsServiceFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsServiceFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsServiceFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsServiceFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // billing_spec - computed: true, optional: false, required: false + public get billingSpec() { + return this.getStringAttribute('billing_spec'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // extend_params - computed: true, optional: false, required: false + public get extendParams() { + return this.getNumberAttribute('extend_params'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_free - computed: true, optional: false, required: false + public get isFree() { + return this.getBooleanAttribute('is_free'); + } + + // is_open - computed: true, optional: false, required: false + public get isOpen() { + return this.getBooleanAttribute('is_open'); + } + + // over_quota - computed: true, optional: false, required: false + public get overQuota() { + return this.getBooleanAttribute('over_quota'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getStringAttribute('source_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudModelartsServiceFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsServiceFlavorsFlavorsOutputReference { + return new DataHuaweicloudModelartsServiceFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors huaweicloud_modelarts_service_flavors} +*/ +export class DataHuaweicloudModelartsServiceFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_service_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsServiceFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsServiceFlavors to import + * @param importFromId The id of the existing DataHuaweicloudModelartsServiceFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsServiceFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_service_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_service_flavors huaweicloud_modelarts_service_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsServiceFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsServiceFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_service_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._inferType = config.inferType; + this._isFree = config.isFree; + this._isOpen = config.isOpen; + this._isPersonalCluster = config.isPersonalCluster; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudModelartsServiceFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // infer_type - computed: false, optional: true, required: false + private _inferType?: string; + public get inferType() { + return this.getStringAttribute('infer_type'); + } + public set inferType(value: string) { + this._inferType = value; + } + public resetInferType() { + this._inferType = undefined; + } + // Temporarily expose input value. Use with caution. + public get inferTypeInput() { + return this._inferType; + } + + // is_free - computed: false, optional: true, required: false + private _isFree?: boolean | cdktf.IResolvable; + public get isFree() { + return this.getBooleanAttribute('is_free'); + } + public set isFree(value: boolean | cdktf.IResolvable) { + this._isFree = value; + } + public resetIsFree() { + this._isFree = undefined; + } + // Temporarily expose input value. Use with caution. + public get isFreeInput() { + return this._isFree; + } + + // is_open - computed: false, optional: true, required: false + private _isOpen?: boolean | cdktf.IResolvable; + public get isOpen() { + return this.getBooleanAttribute('is_open'); + } + public set isOpen(value: boolean | cdktf.IResolvable) { + this._isOpen = value; + } + public resetIsOpen() { + this._isOpen = undefined; + } + // Temporarily expose input value. Use with caution. + public get isOpenInput() { + return this._isOpen; + } + + // is_personal_cluster - computed: false, optional: true, required: false + private _isPersonalCluster?: boolean | cdktf.IResolvable; + public get isPersonalCluster() { + return this.getBooleanAttribute('is_personal_cluster'); + } + public set isPersonalCluster(value: boolean | cdktf.IResolvable) { + this._isPersonalCluster = value; + } + public resetIsPersonalCluster() { + this._isPersonalCluster = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPersonalClusterInput() { + return this._isPersonalCluster; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + infer_type: cdktf.stringToTerraform(this._inferType), + is_free: cdktf.booleanToTerraform(this._isFree), + is_open: cdktf.booleanToTerraform(this._isOpen), + is_personal_cluster: cdktf.booleanToTerraform(this._isPersonalCluster), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + infer_type: { + value: cdktf.stringToHclTerraform(this._inferType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_free: { + value: cdktf.booleanToHclTerraform(this._isFree), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_open: { + value: cdktf.booleanToHclTerraform(this._isOpen), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_personal_cluster: { + value: cdktf.booleanToHclTerraform(this._isPersonalCluster), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/README.md new file mode 100644 index 00000000..b5aaf3a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/index.ts new file mode 100644 index 00000000..412c44d3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-services/index.ts @@ -0,0 +1,799 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#id DataHuaweicloudModelartsServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Inference mode of the service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#infer_type DataHuaweicloudModelartsServices#infer_type} + */ + readonly inferType?: string; + /** + * The model ID which the service used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#model_id DataHuaweicloudModelartsServices#model_id} + */ + readonly modelId?: string; + /** + * Service name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#name DataHuaweicloudModelartsServices#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#region DataHuaweicloudModelartsServices#region} + */ + readonly region?: string; + /** + * Service ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#service_id DataHuaweicloudModelartsServices#service_id} + */ + readonly serviceId?: string; + /** + * Service status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#status DataHuaweicloudModelartsServices#status} + */ + readonly status?: string; + /** + * The workspace ID to which a service belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#workspace_id DataHuaweicloudModelartsServices#workspace_id} + */ + readonly workspaceId?: string; +} +export interface DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannels { +} + +export function dataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsToTerraform(struct?: DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsToHclTerraform(struct?: DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsOutputReference { + return new DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotification { +} + +export function dataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationToTerraform(struct?: DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationToHclTerraform(struct?: DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // events - computed: true, optional: false, required: false + public get events() { + return this.getNumberListAttribute('events'); + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationOutputReference { + return new DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsServicesServicesAdditionalProperties { +} + +export function dataHuaweicloudModelartsServicesServicesAdditionalPropertiesToTerraform(struct?: DataHuaweicloudModelartsServicesServicesAdditionalProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsServicesServicesAdditionalPropertiesToHclTerraform(struct?: DataHuaweicloudModelartsServicesServicesAdditionalProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsServicesServicesAdditionalPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsServicesServicesAdditionalProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsServicesServicesAdditionalProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // log_report_channels - computed: true, optional: false, required: false + private _logReportChannels = new DataHuaweicloudModelartsServicesServicesAdditionalPropertiesLogReportChannelsList(this, "log_report_channels", false); + public get logReportChannels() { + return this._logReportChannels; + } + + // smn_notification - computed: true, optional: false, required: false + private _smnNotification = new DataHuaweicloudModelartsServicesServicesAdditionalPropertiesSmnNotificationList(this, "smn_notification", false); + public get smnNotification() { + return this._smnNotification; + } +} + +export class DataHuaweicloudModelartsServicesServicesAdditionalPropertiesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsServicesServicesAdditionalPropertiesOutputReference { + return new DataHuaweicloudModelartsServicesServicesAdditionalPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsServicesServicesSchedule { +} + +export function dataHuaweicloudModelartsServicesServicesScheduleToTerraform(struct?: DataHuaweicloudModelartsServicesServicesSchedule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsServicesServicesScheduleToHclTerraform(struct?: DataHuaweicloudModelartsServicesServicesSchedule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsServicesServicesScheduleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsServicesServicesSchedule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsServicesServicesSchedule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getNumberAttribute('duration'); + } + + // time_unit - computed: true, optional: false, required: false + public get timeUnit() { + return this.getStringAttribute('time_unit'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudModelartsServicesServicesScheduleList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsServicesServicesScheduleOutputReference { + return new DataHuaweicloudModelartsServicesServicesScheduleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudModelartsServicesServices { +} + +export function dataHuaweicloudModelartsServicesServicesToTerraform(struct?: DataHuaweicloudModelartsServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsServicesServicesToHclTerraform(struct?: DataHuaweicloudModelartsServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsServicesServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsServicesServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsServicesServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // additional_properties - computed: true, optional: false, required: false + private _additionalProperties = new DataHuaweicloudModelartsServicesServicesAdditionalPropertiesList(this, "additional_properties", false); + public get additionalProperties() { + return this._additionalProperties; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // failed_times - computed: true, optional: false, required: false + public get failedTimes() { + return this.getNumberAttribute('failed_times'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // infer_type - computed: true, optional: false, required: false + public get inferType() { + return this.getStringAttribute('infer_type'); + } + + // invocation_times - computed: true, optional: false, required: false + public get invocationTimes() { + return this.getNumberAttribute('invocation_times'); + } + + // is_free - computed: true, optional: false, required: false + public get isFree() { + return this.getBooleanAttribute('is_free'); + } + + // is_opened_sample_collection - computed: true, optional: false, required: false + public get isOpenedSampleCollection() { + return this.getBooleanAttribute('is_opened_sample_collection'); + } + + // is_shared - computed: true, optional: false, required: false + public get isShared() { + return this.getBooleanAttribute('is_shared'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // schedule - computed: true, optional: false, required: false + private _schedule = new DataHuaweicloudModelartsServicesServicesScheduleList(this, "schedule", false); + public get schedule() { + return this._schedule; + } + + // shared_count - computed: true, optional: false, required: false + public get sharedCount() { + return this.getNumberAttribute('shared_count'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudModelartsServicesServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsServicesServicesOutputReference { + return new DataHuaweicloudModelartsServicesServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services huaweicloud_modelarts_services} +*/ +export class DataHuaweicloudModelartsServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsServices to import + * @param importFromId The id of the existing DataHuaweicloudModelartsServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_services huaweicloud_modelarts_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._inferType = config.inferType; + this._modelId = config.modelId; + this._name = config.name; + this._region = config.region; + this._serviceId = config.serviceId; + this._status = config.status; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // infer_type - computed: false, optional: true, required: false + private _inferType?: string; + public get inferType() { + return this.getStringAttribute('infer_type'); + } + public set inferType(value: string) { + this._inferType = value; + } + public resetInferType() { + this._inferType = undefined; + } + // Temporarily expose input value. Use with caution. + public get inferTypeInput() { + return this._inferType; + } + + // model_id - computed: false, optional: true, required: false + private _modelId?: string; + public get modelId() { + return this.getStringAttribute('model_id'); + } + public set modelId(value: string) { + this._modelId = value; + } + public resetModelId() { + this._modelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get modelIdInput() { + return this._modelId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_id - computed: false, optional: true, required: false + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + public resetServiceId() { + this._serviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // services - computed: true, optional: false, required: false + private _services = new DataHuaweicloudModelartsServicesServicesList(this, "services", false); + public get services() { + return this._services; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // workspace_id - computed: false, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + infer_type: cdktf.stringToTerraform(this._inferType), + model_id: cdktf.stringToTerraform(this._modelId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + service_id: cdktf.stringToTerraform(this._serviceId), + status: cdktf.stringToTerraform(this._status), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + infer_type: { + value: cdktf.stringToHclTerraform(this._inferType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_id: { + value: cdktf.stringToHclTerraform(this._modelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/README.md new file mode 100644 index 00000000..1e63afd8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_modelarts_workspaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_modelarts_workspaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/index.ts new file mode 100644 index 00000000..ebb88b29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-modelarts-workspaces/index.ts @@ -0,0 +1,350 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudModelartsWorkspacesConfig extends cdktf.TerraformMetaArguments { + /** + * The enterprise project ID to which the workspace belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces#enterprise_project_id DataHuaweicloudModelartsWorkspaces#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Whether to filter that the current user does not have permission to access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces#filter_accessible DataHuaweicloudModelartsWorkspaces#filter_accessible} + */ + readonly filterAccessible?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces#id DataHuaweicloudModelartsWorkspaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Workspace name. Fuzzy match is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces#name DataHuaweicloudModelartsWorkspaces#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces#region DataHuaweicloudModelartsWorkspaces#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudModelartsWorkspacesWorkspaces { +} + +export function dataHuaweicloudModelartsWorkspacesWorkspacesToTerraform(struct?: DataHuaweicloudModelartsWorkspacesWorkspaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudModelartsWorkspacesWorkspacesToHclTerraform(struct?: DataHuaweicloudModelartsWorkspacesWorkspaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudModelartsWorkspacesWorkspacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudModelartsWorkspacesWorkspaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudModelartsWorkspacesWorkspaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auth_type - computed: true, optional: false, required: false + public get authType() { + return this.getStringAttribute('auth_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_info - computed: true, optional: false, required: false + public get statusInfo() { + return this.getStringAttribute('status_info'); + } +} + +export class DataHuaweicloudModelartsWorkspacesWorkspacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudModelartsWorkspacesWorkspacesOutputReference { + return new DataHuaweicloudModelartsWorkspacesWorkspacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces huaweicloud_modelarts_workspaces} +*/ +export class DataHuaweicloudModelartsWorkspaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_workspaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudModelartsWorkspaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudModelartsWorkspaces to import + * @param importFromId The id of the existing DataHuaweicloudModelartsWorkspaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudModelartsWorkspaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_workspaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/modelarts_workspaces huaweicloud_modelarts_workspaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudModelartsWorkspacesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudModelartsWorkspacesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_workspaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._filterAccessible = config.filterAccessible; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // filter_accessible - computed: false, optional: true, required: false + private _filterAccessible?: boolean | cdktf.IResolvable; + public get filterAccessible() { + return this.getBooleanAttribute('filter_accessible'); + } + public set filterAccessible(value: boolean | cdktf.IResolvable) { + this._filterAccessible = value; + } + public resetFilterAccessible() { + this._filterAccessible = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterAccessibleInput() { + return this._filterAccessible; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspaces - computed: true, optional: false, required: false + private _workspaces = new DataHuaweicloudModelartsWorkspacesWorkspacesList(this, "workspaces", false); + public get workspaces() { + return this._workspaces; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + filter_accessible: cdktf.booleanToTerraform(this._filterAccessible), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_accessible: { + value: cdktf.booleanToHclTerraform(this._filterAccessible), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/README.md new file mode 100644 index 00000000..0bd3bd96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_dnat_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_dnat_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/index.ts new file mode 100644 index 00000000..997c7647 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-dnat-rules/index.ts @@ -0,0 +1,662 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatDnatRulesConfig extends cdktf.TerraformMetaArguments { + /** + * The port of the EIP associated with the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#external_service_port DataHuaweicloudNatDnatRules#external_service_port} + */ + readonly externalServicePort?: string; + /** + * The IP address of EIP associated with the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#floating_ip_address DataHuaweicloudNatDnatRules#floating_ip_address} + */ + readonly floatingIpAddress?: string; + /** + * The ID of the EIP associated with the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#floating_ip_id DataHuaweicloudNatDnatRules#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * The ID of the NAT gateway to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#gateway_id DataHuaweicloudNatDnatRules#gateway_id} + */ + readonly gatewayId?: string; + /** + * The IP address of the global EIP associated with the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#global_eip_address DataHuaweicloudNatDnatRules#global_eip_address} + */ + readonly globalEipAddress?: string; + /** + * The ID of the global EIP associated with the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#global_eip_id DataHuaweicloudNatDnatRules#global_eip_id} + */ + readonly globalEipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#id DataHuaweicloudNatDnatRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The port of the backend instance to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#internal_service_port DataHuaweicloudNatDnatRules#internal_service_port} + */ + readonly internalServicePort?: string; + /** + * The port ID of the backend instance to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#port_id DataHuaweicloudNatDnatRules#port_id} + */ + readonly portId?: string; + /** + * The private IP address of the backend instance to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#private_ip DataHuaweicloudNatDnatRules#private_ip} + */ + readonly privateIp?: string; + /** + * The protocol type of the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#protocol DataHuaweicloudNatDnatRules#protocol} + */ + readonly protocol?: string; + /** + * The region where the DNAT rules are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#region DataHuaweicloudNatDnatRules#region} + */ + readonly region?: string; + /** + * The ID of the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#rule_id DataHuaweicloudNatDnatRules#rule_id} + */ + readonly ruleId?: string; + /** + * The status of the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#status DataHuaweicloudNatDnatRules#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudNatDnatRulesRules { +} + +export function dataHuaweicloudNatDnatRulesRulesToTerraform(struct?: DataHuaweicloudNatDnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatDnatRulesRulesToHclTerraform(struct?: DataHuaweicloudNatDnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatDnatRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatDnatRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatDnatRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // external_service_port - computed: true, optional: false, required: false + public get externalServicePort() { + return this.getNumberAttribute('external_service_port'); + } + + // external_service_port_range - computed: true, optional: false, required: false + public get externalServicePortRange() { + return this.getStringAttribute('external_service_port_range'); + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // floating_ip_id - computed: true, optional: false, required: false + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // global_eip_address - computed: true, optional: false, required: false + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + + // global_eip_id - computed: true, optional: false, required: false + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // internal_service_port - computed: true, optional: false, required: false + public get internalServicePort() { + return this.getNumberAttribute('internal_service_port'); + } + + // internal_service_port_range - computed: true, optional: false, required: false + public get internalServicePortRange() { + return this.getStringAttribute('internal_service_port_range'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudNatDnatRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatDnatRulesRulesOutputReference { + return new DataHuaweicloudNatDnatRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules huaweicloud_nat_dnat_rules} +*/ +export class DataHuaweicloudNatDnatRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_dnat_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatDnatRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatDnatRules to import + * @param importFromId The id of the existing DataHuaweicloudNatDnatRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatDnatRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_dnat_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_dnat_rules huaweicloud_nat_dnat_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatDnatRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatDnatRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_dnat_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._externalServicePort = config.externalServicePort; + this._floatingIpAddress = config.floatingIpAddress; + this._floatingIpId = config.floatingIpId; + this._gatewayId = config.gatewayId; + this._globalEipAddress = config.globalEipAddress; + this._globalEipId = config.globalEipId; + this._id = config.id; + this._internalServicePort = config.internalServicePort; + this._portId = config.portId; + this._privateIp = config.privateIp; + this._protocol = config.protocol; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // external_service_port - computed: false, optional: true, required: false + private _externalServicePort?: string; + public get externalServicePort() { + return this.getStringAttribute('external_service_port'); + } + public set externalServicePort(value: string) { + this._externalServicePort = value; + } + public resetExternalServicePort() { + this._externalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalServicePortInput() { + return this._externalServicePort; + } + + // floating_ip_address - computed: false, optional: true, required: false + private _floatingIpAddress?: string; + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + public set floatingIpAddress(value: string) { + this._floatingIpAddress = value; + } + public resetFloatingIpAddress() { + this._floatingIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpAddressInput() { + return this._floatingIpAddress; + } + + // floating_ip_id - computed: false, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // global_eip_address - computed: false, optional: true, required: false + private _globalEipAddress?: string; + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + public set globalEipAddress(value: string) { + this._globalEipAddress = value; + } + public resetGlobalEipAddress() { + this._globalEipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipAddressInput() { + return this._globalEipAddress; + } + + // global_eip_id - computed: false, optional: true, required: false + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + public resetGlobalEipId() { + this._globalEipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_service_port - computed: false, optional: true, required: false + private _internalServicePort?: string; + public get internalServicePort() { + return this.getStringAttribute('internal_service_port'); + } + public set internalServicePort(value: string) { + this._internalServicePort = value; + } + public resetInternalServicePort() { + this._internalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortInput() { + return this._internalServicePort; + } + + // port_id - computed: false, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // private_ip - computed: false, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNatDnatRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + external_service_port: cdktf.stringToTerraform(this._externalServicePort), + floating_ip_address: cdktf.stringToTerraform(this._floatingIpAddress), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + global_eip_address: cdktf.stringToTerraform(this._globalEipAddress), + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + internal_service_port: cdktf.stringToTerraform(this._internalServicePort), + port_id: cdktf.stringToTerraform(this._portId), + private_ip: cdktf.stringToTerraform(this._privateIp), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + external_service_port: { + value: cdktf.stringToHclTerraform(this._externalServicePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_address: { + value: cdktf.stringToHclTerraform(this._floatingIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_address: { + value: cdktf.stringToHclTerraform(this._globalEipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal_service_port: { + value: cdktf.stringToHclTerraform(this._internalServicePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/README.md new file mode 100644 index 00000000..e4068add --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_gateway` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/index.ts new file mode 100644 index 00000000..b90b5ef7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateway/index.ts @@ -0,0 +1,414 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the public NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#description DataHuaweicloudNatGateway#description} + */ + readonly description?: string; + /** + * The enterprise project ID of the public NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#enterprise_project_id DataHuaweicloudNatGateway#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The public NAT gateway ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#id DataHuaweicloudNatGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#internal_network_id DataHuaweicloudNatGateway#internal_network_id} + */ + readonly internalNetworkId?: string; + /** + * The public NAT gateway name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#name DataHuaweicloudNatGateway#name} + */ + readonly name?: string; + /** + * The region where the public NAT gateway is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#region DataHuaweicloudNatGateway#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#router_id DataHuaweicloudNatGateway#router_id} + */ + readonly routerId?: string; + /** + * The specification of the public NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#spec DataHuaweicloudNatGateway#spec} + */ + readonly spec?: string; + /** + * The current status of the public NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#status DataHuaweicloudNatGateway#status} + */ + readonly status?: string; + /** + * The network ID of the downstream interface (the next hop of the DVR) of the public NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#subnet_id DataHuaweicloudNatGateway#subnet_id} + */ + readonly subnetId?: string; + /** + * The ID of the VPC to which the public NAT gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#vpc_id DataHuaweicloudNatGateway#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway huaweicloud_nat_gateway} +*/ +export class DataHuaweicloudNatGateway extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatGateway to import + * @param importFromId The id of the existing DataHuaweicloudNatGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateway huaweicloud_nat_gateway} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatGatewayConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatGatewayConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._internalNetworkId = config.internalNetworkId; + this._name = config.name; + this._region = config.region; + this._routerId = config.routerId; + this._spec = config.spec; + this._status = config.status; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_network_id - computed: false, optional: true, required: false + private _internalNetworkId?: string; + public get internalNetworkId() { + return this.getStringAttribute('internal_network_id'); + } + public set internalNetworkId(value: string) { + this._internalNetworkId = value; + } + public resetInternalNetworkId() { + this._internalNetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalNetworkIdInput() { + return this._internalNetworkId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // router_id - computed: false, optional: true, required: false + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + public resetRouterId() { + this._routerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // spec - computed: true, optional: true, required: false + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + public resetSpec() { + this._spec = undefined; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + internal_network_id: cdktf.stringToTerraform(this._internalNetworkId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + router_id: cdktf.stringToTerraform(this._routerId), + spec: cdktf.stringToTerraform(this._spec), + status: cdktf.stringToTerraform(this._status), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal_network_id: { + value: cdktf.stringToHclTerraform(this._internalNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_id: { + value: cdktf.stringToHclTerraform(this._routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/README.md new file mode 100644 index 00000000..f3fdde3f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/index.ts new file mode 100644 index 00000000..3bf874f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-gateways/index.ts @@ -0,0 +1,477 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the NAT gateways belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#enterprise_project_id DataHuaweicloudNatGateways#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The ID of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#gateway_id DataHuaweicloudNatGateways#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#id DataHuaweicloudNatGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#name DataHuaweicloudNatGateways#name} + */ + readonly name?: string; + /** + * The region where the NAT gateways are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#region DataHuaweicloudNatGateways#region} + */ + readonly region?: string; + /** + * The specification of the NAT gateways. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#spec DataHuaweicloudNatGateways#spec} + */ + readonly spec?: string; + /** + * The current status of the NAT gateways. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#status DataHuaweicloudNatGateways#status} + */ + readonly status?: string; + /** + * The network ID of the downstream interface (the next hop of the DVR)of the NAT gateways. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#subnet_id DataHuaweicloudNatGateways#subnet_id} + */ + readonly subnetId?: string; + /** + * The ID of the VPC to which the NAT gateways belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#vpc_id DataHuaweicloudNatGateways#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudNatGatewaysGateways { +} + +export function dataHuaweicloudNatGatewaysGatewaysToTerraform(struct?: DataHuaweicloudNatGatewaysGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatGatewaysGatewaysToHclTerraform(struct?: DataHuaweicloudNatGatewaysGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatGatewaysGatewaysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatGatewaysGateways | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatGatewaysGateways | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // spec - computed: true, optional: false, required: false + public get spec() { + return this.getStringAttribute('spec'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudNatGatewaysGatewaysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatGatewaysGatewaysOutputReference { + return new DataHuaweicloudNatGatewaysGatewaysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways huaweicloud_nat_gateways} +*/ +export class DataHuaweicloudNatGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatGateways to import + * @param importFromId The id of the existing DataHuaweicloudNatGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_gateways huaweicloud_nat_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spec = config.spec; + this._status = config.status; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // gateways - computed: true, optional: false, required: false + private _gateways = new DataHuaweicloudNatGatewaysGatewaysList(this, "gateways", false); + public get gateways() { + return this._gateways; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: false, optional: true, required: false + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + public resetSpec() { + this._spec = undefined; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + spec: cdktf.stringToTerraform(this._spec), + status: cdktf.stringToTerraform(this._status), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/README.md new file mode 100644 index 00000000..d7f1c886 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_private_dnat_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_private_dnat_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/index.ts new file mode 100644 index 00000000..4e1f52ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-dnat-rules/index.ts @@ -0,0 +1,592 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatPrivateDnatRulesConfig extends cdktf.TerraformMetaArguments { + /** + * The network interface ID of the backend instance to which the private DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#backend_interface_id DataHuaweicloudNatPrivateDnatRules#backend_interface_id} + */ + readonly backendInterfaceId?: string; + /** + * The private IP address of the backend instance to which the private DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#backend_private_ip DataHuaweicloudNatPrivateDnatRules#backend_private_ip} + */ + readonly backendPrivateIp?: string; + /** + * The type of the backend instance to which the private DNAT rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#backend_type DataHuaweicloudNatPrivateDnatRules#backend_type} + */ + readonly backendType?: string; + /** + * The ID of the enterprise project to which the private DNAT rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#enterprise_project_id DataHuaweicloudNatPrivateDnatRules#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The ID of the private NAT gateway to which the private DNAT rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#gateway_id DataHuaweicloudNatPrivateDnatRules#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#id DataHuaweicloudNatPrivateDnatRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The port of the backend instance to which the private DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#internal_service_port DataHuaweicloudNatPrivateDnatRules#internal_service_port} + */ + readonly internalServicePort?: string; + /** + * The protocol type of the private DNAT rules. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#protocol DataHuaweicloudNatPrivateDnatRules#protocol} + */ + readonly protocol?: string; + /** + * The region where the private DNAT rules are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#region DataHuaweicloudNatPrivateDnatRules#region} + */ + readonly region?: string; + /** + * The ID of the private DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#rule_id DataHuaweicloudNatPrivateDnatRules#rule_id} + */ + readonly ruleId?: string; + /** + * The ID of the transit IP associated with the private DNAT rules. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#transit_ip_id DataHuaweicloudNatPrivateDnatRules#transit_ip_id} + */ + readonly transitIpId?: string; + /** + * The port of the transit IP associated with the private DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#transit_service_port DataHuaweicloudNatPrivateDnatRules#transit_service_port} + */ + readonly transitServicePort?: string; +} +export interface DataHuaweicloudNatPrivateDnatRulesRules { +} + +export function dataHuaweicloudNatPrivateDnatRulesRulesToTerraform(struct?: DataHuaweicloudNatPrivateDnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatPrivateDnatRulesRulesToHclTerraform(struct?: DataHuaweicloudNatPrivateDnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatPrivateDnatRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatPrivateDnatRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatPrivateDnatRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // backend_interface_id - computed: true, optional: false, required: false + public get backendInterfaceId() { + return this.getStringAttribute('backend_interface_id'); + } + + // backend_private_ip - computed: true, optional: false, required: false + public get backendPrivateIp() { + return this.getStringAttribute('backend_private_ip'); + } + + // backend_type - computed: true, optional: false, required: false + public get backendType() { + return this.getStringAttribute('backend_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // internal_service_port - computed: true, optional: false, required: false + public get internalServicePort() { + return this.getStringAttribute('internal_service_port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // transit_ip_id - computed: true, optional: false, required: false + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + + // transit_service_port - computed: true, optional: false, required: false + public get transitServicePort() { + return this.getStringAttribute('transit_service_port'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudNatPrivateDnatRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatPrivateDnatRulesRulesOutputReference { + return new DataHuaweicloudNatPrivateDnatRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules huaweicloud_nat_private_dnat_rules} +*/ +export class DataHuaweicloudNatPrivateDnatRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_dnat_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatPrivateDnatRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatPrivateDnatRules to import + * @param importFromId The id of the existing DataHuaweicloudNatPrivateDnatRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatPrivateDnatRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_dnat_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_dnat_rules huaweicloud_nat_private_dnat_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatPrivateDnatRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatPrivateDnatRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_dnat_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backendInterfaceId = config.backendInterfaceId; + this._backendPrivateIp = config.backendPrivateIp; + this._backendType = config.backendType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._internalServicePort = config.internalServicePort; + this._protocol = config.protocol; + this._region = config.region; + this._ruleId = config.ruleId; + this._transitIpId = config.transitIpId; + this._transitServicePort = config.transitServicePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // backend_interface_id - computed: false, optional: true, required: false + private _backendInterfaceId?: string; + public get backendInterfaceId() { + return this.getStringAttribute('backend_interface_id'); + } + public set backendInterfaceId(value: string) { + this._backendInterfaceId = value; + } + public resetBackendInterfaceId() { + this._backendInterfaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendInterfaceIdInput() { + return this._backendInterfaceId; + } + + // backend_private_ip - computed: false, optional: true, required: false + private _backendPrivateIp?: string; + public get backendPrivateIp() { + return this.getStringAttribute('backend_private_ip'); + } + public set backendPrivateIp(value: string) { + this._backendPrivateIp = value; + } + public resetBackendPrivateIp() { + this._backendPrivateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendPrivateIpInput() { + return this._backendPrivateIp; + } + + // backend_type - computed: false, optional: true, required: false + private _backendType?: string; + public get backendType() { + return this.getStringAttribute('backend_type'); + } + public set backendType(value: string) { + this._backendType = value; + } + public resetBackendType() { + this._backendType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendTypeInput() { + return this._backendType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_service_port - computed: false, optional: true, required: false + private _internalServicePort?: string; + public get internalServicePort() { + return this.getStringAttribute('internal_service_port'); + } + public set internalServicePort(value: string) { + this._internalServicePort = value; + } + public resetInternalServicePort() { + this._internalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortInput() { + return this._internalServicePort; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNatPrivateDnatRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // transit_ip_id - computed: false, optional: true, required: false + private _transitIpId?: string; + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + public set transitIpId(value: string) { + this._transitIpId = value; + } + public resetTransitIpId() { + this._transitIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitIpIdInput() { + return this._transitIpId; + } + + // transit_service_port - computed: false, optional: true, required: false + private _transitServicePort?: string; + public get transitServicePort() { + return this.getStringAttribute('transit_service_port'); + } + public set transitServicePort(value: string) { + this._transitServicePort = value; + } + public resetTransitServicePort() { + this._transitServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitServicePortInput() { + return this._transitServicePort; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backend_interface_id: cdktf.stringToTerraform(this._backendInterfaceId), + backend_private_ip: cdktf.stringToTerraform(this._backendPrivateIp), + backend_type: cdktf.stringToTerraform(this._backendType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + internal_service_port: cdktf.stringToTerraform(this._internalServicePort), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + transit_ip_id: cdktf.stringToTerraform(this._transitIpId), + transit_service_port: cdktf.stringToTerraform(this._transitServicePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backend_interface_id: { + value: cdktf.stringToHclTerraform(this._backendInterfaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_private_ip: { + value: cdktf.stringToHclTerraform(this._backendPrivateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_type: { + value: cdktf.stringToHclTerraform(this._backendType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal_service_port: { + value: cdktf.stringToHclTerraform(this._internalServicePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_ip_id: { + value: cdktf.stringToHclTerraform(this._transitIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_service_port: { + value: cdktf.stringToHclTerraform(this._transitServicePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/README.md new file mode 100644 index 00000000..dddb8533 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_private_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_private_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/index.ts new file mode 100644 index 00000000..04a0b5b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-gateways/index.ts @@ -0,0 +1,518 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatPrivateGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the private NAT gateways belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#enterprise_project_id DataHuaweicloudNatPrivateGateways#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The ID of the private NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#gateway_id DataHuaweicloudNatPrivateGateways#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#id DataHuaweicloudNatPrivateGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the private NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#name DataHuaweicloudNatPrivateGateways#name} + */ + readonly name?: string; + /** + * The region where the private NAT gateways are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#region DataHuaweicloudNatPrivateGateways#region} + */ + readonly region?: string; + /** + * The specification of the private NAT gateways. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#spec DataHuaweicloudNatPrivateGateways#spec} + */ + readonly spec?: string; + /** + * The current status of the private NAT gateways. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#status DataHuaweicloudNatPrivateGateways#status} + */ + readonly status?: string; + /** + * The ID of the subnet to which the private NAT gateways belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#subnet_id DataHuaweicloudNatPrivateGateways#subnet_id} + */ + readonly subnetId?: string; + /** + * The key/value pairs to associate the private NAT gateways. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#tags DataHuaweicloudNatPrivateGateways#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC to which the private NAT gateways belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#vpc_id DataHuaweicloudNatPrivateGateways#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudNatPrivateGatewaysGateways { +} + +export function dataHuaweicloudNatPrivateGatewaysGatewaysToTerraform(struct?: DataHuaweicloudNatPrivateGatewaysGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatPrivateGatewaysGatewaysToHclTerraform(struct?: DataHuaweicloudNatPrivateGatewaysGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatPrivateGatewaysGatewaysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatPrivateGatewaysGateways | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatPrivateGatewaysGateways | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // spec - computed: true, optional: false, required: false + public get spec() { + return this.getStringAttribute('spec'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudNatPrivateGatewaysGatewaysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatPrivateGatewaysGatewaysOutputReference { + return new DataHuaweicloudNatPrivateGatewaysGatewaysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways huaweicloud_nat_private_gateways} +*/ +export class DataHuaweicloudNatPrivateGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatPrivateGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatPrivateGateways to import + * @param importFromId The id of the existing DataHuaweicloudNatPrivateGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatPrivateGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_gateways huaweicloud_nat_private_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatPrivateGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatPrivateGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spec = config.spec; + this._status = config.status; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // gateways - computed: true, optional: false, required: false + private _gateways = new DataHuaweicloudNatPrivateGatewaysGatewaysList(this, "gateways", false); + public get gateways() { + return this._gateways; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: false, optional: true, required: false + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + public resetSpec() { + this._spec = undefined; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + spec: cdktf.stringToTerraform(this._spec), + status: cdktf.stringToTerraform(this._status), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/README.md new file mode 100644 index 00000000..3866dce2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_private_snat_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_private_snat_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/index.ts new file mode 100644 index 00000000..57a1a46c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-snat-rules/index.ts @@ -0,0 +1,487 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatPrivateSnatRulesConfig extends cdktf.TerraformMetaArguments { + /** + * The CIDR block of the private SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#cidr DataHuaweicloudNatPrivateSnatRules#cidr} + */ + readonly cidr?: string; + /** + * The ID of the enterprise project to which the private SNAT rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#enterprise_project_id DataHuaweicloudNatPrivateSnatRules#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The ID of the private NAT gateway to which the private SNAT rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#gateway_id DataHuaweicloudNatPrivateSnatRules#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#id DataHuaweicloudNatPrivateSnatRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the private SNAT rules are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#region DataHuaweicloudNatPrivateSnatRules#region} + */ + readonly region?: string; + /** + * The ID of the private SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#rule_id DataHuaweicloudNatPrivateSnatRules#rule_id} + */ + readonly ruleId?: string; + /** + * The ID of the subnet to which the private SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#subnet_id DataHuaweicloudNatPrivateSnatRules#subnet_id} + */ + readonly subnetId?: string; + /** + * The IP address of the transit IP associated with the private SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#transit_ip_address DataHuaweicloudNatPrivateSnatRules#transit_ip_address} + */ + readonly transitIpAddress?: string; + /** + * The ID of the transit IP associated with the private SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#transit_ip_id DataHuaweicloudNatPrivateSnatRules#transit_ip_id} + */ + readonly transitIpId?: string; +} +export interface DataHuaweicloudNatPrivateSnatRulesRules { +} + +export function dataHuaweicloudNatPrivateSnatRulesRulesToTerraform(struct?: DataHuaweicloudNatPrivateSnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatPrivateSnatRulesRulesToHclTerraform(struct?: DataHuaweicloudNatPrivateSnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatPrivateSnatRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatPrivateSnatRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatPrivateSnatRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // transit_ip_address - computed: true, optional: false, required: false + public get transitIpAddress() { + return this.getStringAttribute('transit_ip_address'); + } + + // transit_ip_id - computed: true, optional: false, required: false + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudNatPrivateSnatRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatPrivateSnatRulesRulesOutputReference { + return new DataHuaweicloudNatPrivateSnatRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules huaweicloud_nat_private_snat_rules} +*/ +export class DataHuaweicloudNatPrivateSnatRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_snat_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatPrivateSnatRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatPrivateSnatRules to import + * @param importFromId The id of the existing DataHuaweicloudNatPrivateSnatRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatPrivateSnatRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_snat_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_snat_rules huaweicloud_nat_private_snat_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatPrivateSnatRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatPrivateSnatRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_snat_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._region = config.region; + this._ruleId = config.ruleId; + this._subnetId = config.subnetId; + this._transitIpAddress = config.transitIpAddress; + this._transitIpId = config.transitIpId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNatPrivateSnatRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // transit_ip_address - computed: false, optional: true, required: false + private _transitIpAddress?: string; + public get transitIpAddress() { + return this.getStringAttribute('transit_ip_address'); + } + public set transitIpAddress(value: string) { + this._transitIpAddress = value; + } + public resetTransitIpAddress() { + this._transitIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitIpAddressInput() { + return this._transitIpAddress; + } + + // transit_ip_id - computed: false, optional: true, required: false + private _transitIpId?: string; + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + public set transitIpId(value: string) { + this._transitIpId = value; + } + public resetTransitIpId() { + this._transitIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitIpIdInput() { + return this._transitIpId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + transit_ip_address: cdktf.stringToTerraform(this._transitIpAddress), + transit_ip_id: cdktf.stringToTerraform(this._transitIpId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_ip_address: { + value: cdktf.stringToHclTerraform(this._transitIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_ip_id: { + value: cdktf.stringToHclTerraform(this._transitIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/README.md new file mode 100644 index 00000000..4d323596 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_private_transit_ips` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_private_transit_ips`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/index.ts new file mode 100644 index 00000000..c02cd8e4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-private-transit-ips/index.ts @@ -0,0 +1,478 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatPrivateTransitIpsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the transit IPs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#enterprise_project_id DataHuaweicloudNatPrivateTransitIps#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The ID of the private NAT gateway to which the transit IP belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#gateway_id DataHuaweicloudNatPrivateTransitIps#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#id DataHuaweicloudNatPrivateTransitIps#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The IP address of the transit IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#ip_address DataHuaweicloudNatPrivateTransitIps#ip_address} + */ + readonly ipAddress?: string; + /** + * The network interface ID of the transit IP for private NAT. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#network_interface_id DataHuaweicloudNatPrivateTransitIps#network_interface_id} + */ + readonly networkInterfaceId?: string; + /** + * The region where the transit IPs are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#region DataHuaweicloudNatPrivateTransitIps#region} + */ + readonly region?: string; + /** + * The ID of the subnet to which the transit IPs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#subnet_id DataHuaweicloudNatPrivateTransitIps#subnet_id} + */ + readonly subnetId?: string; + /** + * The key/value pairs to associate with the transit IPs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#tags DataHuaweicloudNatPrivateTransitIps#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the transit IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#transit_ip_id DataHuaweicloudNatPrivateTransitIps#transit_ip_id} + */ + readonly transitIpId?: string; +} +export interface DataHuaweicloudNatPrivateTransitIpsTransitIps { +} + +export function dataHuaweicloudNatPrivateTransitIpsTransitIpsToTerraform(struct?: DataHuaweicloudNatPrivateTransitIpsTransitIps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatPrivateTransitIpsTransitIpsToHclTerraform(struct?: DataHuaweicloudNatPrivateTransitIpsTransitIps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatPrivateTransitIpsTransitIpsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatPrivateTransitIpsTransitIps | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatPrivateTransitIpsTransitIps | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // network_interface_id - computed: true, optional: false, required: false + public get networkInterfaceId() { + return this.getStringAttribute('network_interface_id'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudNatPrivateTransitIpsTransitIpsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatPrivateTransitIpsTransitIpsOutputReference { + return new DataHuaweicloudNatPrivateTransitIpsTransitIpsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips huaweicloud_nat_private_transit_ips} +*/ +export class DataHuaweicloudNatPrivateTransitIps extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_transit_ips"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatPrivateTransitIps resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatPrivateTransitIps to import + * @param importFromId The id of the existing DataHuaweicloudNatPrivateTransitIps that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatPrivateTransitIps to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_transit_ips", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_private_transit_ips huaweicloud_nat_private_transit_ips} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatPrivateTransitIpsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatPrivateTransitIpsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_transit_ips', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._networkInterfaceId = config.networkInterfaceId; + this._region = config.region; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._transitIpId = config.transitIpId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // network_interface_id - computed: false, optional: true, required: false + private _networkInterfaceId?: string; + public get networkInterfaceId() { + return this.getStringAttribute('network_interface_id'); + } + public set networkInterfaceId(value: string) { + this._networkInterfaceId = value; + } + public resetNetworkInterfaceId() { + this._networkInterfaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkInterfaceIdInput() { + return this._networkInterfaceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // transit_ip_id - computed: false, optional: true, required: false + private _transitIpId?: string; + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + public set transitIpId(value: string) { + this._transitIpId = value; + } + public resetTransitIpId() { + this._transitIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitIpIdInput() { + return this._transitIpId; + } + + // transit_ips - computed: true, optional: false, required: false + private _transitIps = new DataHuaweicloudNatPrivateTransitIpsTransitIpsList(this, "transit_ips", false); + public get transitIps() { + return this._transitIps; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + network_interface_id: cdktf.stringToTerraform(this._networkInterfaceId), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + transit_ip_id: cdktf.stringToTerraform(this._transitIpId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_interface_id: { + value: cdktf.stringToHclTerraform(this._networkInterfaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + transit_ip_id: { + value: cdktf.stringToHclTerraform(this._transitIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/README.md new file mode 100644 index 00000000..f89e1b76 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_nat_snat_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_nat_snat_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/index.ts new file mode 100644 index 00000000..8fa351cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-nat-snat-rules/index.ts @@ -0,0 +1,587 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNatSnatRulesConfig extends cdktf.TerraformMetaArguments { + /** + * The CIDR block to which the SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#cidr DataHuaweicloudNatSnatRules#cidr} + */ + readonly cidr?: string; + /** + * The IP of the EIP associated with SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#floating_ip_address DataHuaweicloudNatSnatRules#floating_ip_address} + */ + readonly floatingIpAddress?: string; + /** + * The ID of the EIP associated with SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#floating_ip_id DataHuaweicloudNatSnatRules#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * The ID of the NAT gateway to which the SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#gateway_id DataHuaweicloudNatSnatRules#gateway_id} + */ + readonly gatewayId?: string; + /** + * The IPs of the global EIP associated with SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#global_eip_address DataHuaweicloudNatSnatRules#global_eip_address} + */ + readonly globalEipAddress?: string; + /** + * The IDs of the global EIP associated with SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#global_eip_id DataHuaweicloudNatSnatRules#global_eip_id} + */ + readonly globalEipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#id DataHuaweicloudNatSnatRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the SNAT rules are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#region DataHuaweicloudNatSnatRules#region} + */ + readonly region?: string; + /** + * The ID of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#rule_id DataHuaweicloudNatSnatRules#rule_id} + */ + readonly ruleId?: string; + /** + * The source type of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#source_type DataHuaweicloudNatSnatRules#source_type} + */ + readonly sourceType?: string; + /** + * The status of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#status DataHuaweicloudNatSnatRules#status} + */ + readonly status?: string; + /** + * The ID of the subnet to which the SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#subnet_id DataHuaweicloudNatSnatRules#subnet_id} + */ + readonly subnetId?: string; +} +export interface DataHuaweicloudNatSnatRulesRules { +} + +export function dataHuaweicloudNatSnatRulesRulesToTerraform(struct?: DataHuaweicloudNatSnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNatSnatRulesRulesToHclTerraform(struct?: DataHuaweicloudNatSnatRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNatSnatRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNatSnatRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNatSnatRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // floating_ip_id - computed: true, optional: false, required: false + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + + // freezed_ip_address - computed: true, optional: false, required: false + public get freezedIpAddress() { + return this.getStringAttribute('freezed_ip_address'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // global_eip_address - computed: true, optional: false, required: false + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + + // global_eip_id - computed: true, optional: false, required: false + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getNumberAttribute('source_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } +} + +export class DataHuaweicloudNatSnatRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNatSnatRulesRulesOutputReference { + return new DataHuaweicloudNatSnatRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules huaweicloud_nat_snat_rules} +*/ +export class DataHuaweicloudNatSnatRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_snat_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNatSnatRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNatSnatRules to import + * @param importFromId The id of the existing DataHuaweicloudNatSnatRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNatSnatRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_snat_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/nat_snat_rules huaweicloud_nat_snat_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNatSnatRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNatSnatRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_snat_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._floatingIpAddress = config.floatingIpAddress; + this._floatingIpId = config.floatingIpId; + this._gatewayId = config.gatewayId; + this._globalEipAddress = config.globalEipAddress; + this._globalEipId = config.globalEipId; + this._id = config.id; + this._region = config.region; + this._ruleId = config.ruleId; + this._sourceType = config.sourceType; + this._status = config.status; + this._subnetId = config.subnetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // floating_ip_address - computed: false, optional: true, required: false + private _floatingIpAddress?: string; + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + public set floatingIpAddress(value: string) { + this._floatingIpAddress = value; + } + public resetFloatingIpAddress() { + this._floatingIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpAddressInput() { + return this._floatingIpAddress; + } + + // floating_ip_id - computed: false, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // global_eip_address - computed: false, optional: true, required: false + private _globalEipAddress?: string; + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + public set globalEipAddress(value: string) { + this._globalEipAddress = value; + } + public resetGlobalEipAddress() { + this._globalEipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipAddressInput() { + return this._globalEipAddress; + } + + // global_eip_id - computed: false, optional: true, required: false + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + public resetGlobalEipId() { + this._globalEipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNatSnatRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // source_type - computed: false, optional: true, required: false + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + floating_ip_address: cdktf.stringToTerraform(this._floatingIpAddress), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + global_eip_address: cdktf.stringToTerraform(this._globalEipAddress), + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + source_type: cdktf.stringToTerraform(this._sourceType), + status: cdktf.stringToTerraform(this._status), + subnet_id: cdktf.stringToTerraform(this._subnetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_address: { + value: cdktf.stringToHclTerraform(this._floatingIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_address: { + value: cdktf.stringToHclTerraform(this._globalEipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/README.md new file mode 100644 index 00000000..ea467af3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_network_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_network_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/index.ts new file mode 100644 index 00000000..54130329 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-network-v2/index.ts @@ -0,0 +1,294 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingNetworkV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#id DataHuaweicloudNetworkingNetworkV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#matching_subnet_cidr DataHuaweicloudNetworkingNetworkV2#matching_subnet_cidr} + */ + readonly matchingSubnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#name DataHuaweicloudNetworkingNetworkV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#network_id DataHuaweicloudNetworkingNetworkV2#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#region DataHuaweicloudNetworkingNetworkV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#status DataHuaweicloudNetworkingNetworkV2#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#tenant_id DataHuaweicloudNetworkingNetworkV2#tenant_id} + */ + readonly tenantId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2 huaweicloud_networking_network_v2} +*/ +export class DataHuaweicloudNetworkingNetworkV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_network_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingNetworkV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingNetworkV2 to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingNetworkV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingNetworkV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_network_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_network_v2 huaweicloud_networking_network_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingNetworkV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingNetworkV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_network_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._matchingSubnetCidr = config.matchingSubnetCidr; + this._name = config.name; + this._networkId = config.networkId; + this._region = config.region; + this._status = config.status; + this._tenantId = config.tenantId; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: false, required: false + public get adminStateUp() { + return this.getStringAttribute('admin_state_up'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // matching_subnet_cidr - computed: false, optional: true, required: false + private _matchingSubnetCidr?: string; + public get matchingSubnetCidr() { + return this.getStringAttribute('matching_subnet_cidr'); + } + public set matchingSubnetCidr(value: string) { + this._matchingSubnetCidr = value; + } + public resetMatchingSubnetCidr() { + this._matchingSubnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchingSubnetCidrInput() { + return this._matchingSubnetCidr; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // shared - computed: true, optional: false, required: false + public get shared() { + return this.getStringAttribute('shared'); + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tenant_id - computed: false, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + matching_subnet_cidr: cdktf.stringToTerraform(this._matchingSubnetCidr), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tenant_id: cdktf.stringToTerraform(this._tenantId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + matching_subnet_cidr: { + value: cdktf.stringToHclTerraform(this._matchingSubnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/README.md new file mode 100644 index 00000000..2077b9b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_port_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_port_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/index.ts new file mode 100644 index 00000000..1953fbee --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port-v2/index.ts @@ -0,0 +1,501 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingPortV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#admin_state_up DataHuaweicloudNetworkingPortV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#device_id DataHuaweicloudNetworkingPortV2#device_id} + */ + readonly deviceId?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#device_owner DataHuaweicloudNetworkingPortV2#device_owner} + */ + readonly deviceOwner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#fixed_ip DataHuaweicloudNetworkingPortV2#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#id DataHuaweicloudNetworkingPortV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#mac_address DataHuaweicloudNetworkingPortV2#mac_address} + */ + readonly macAddress?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#name DataHuaweicloudNetworkingPortV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#network_id DataHuaweicloudNetworkingPortV2#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#port_id DataHuaweicloudNetworkingPortV2#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#project_id DataHuaweicloudNetworkingPortV2#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#region DataHuaweicloudNetworkingPortV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#security_group_ids DataHuaweicloudNetworkingPortV2#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#status DataHuaweicloudNetworkingPortV2#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#tenant_id DataHuaweicloudNetworkingPortV2#tenant_id} + */ + readonly tenantId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2 huaweicloud_networking_port_v2} +*/ +export class DataHuaweicloudNetworkingPortV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_port_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingPortV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingPortV2 to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingPortV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingPortV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_port_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port_v2 huaweicloud_networking_port_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingPortV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingPortV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_port_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._deviceId = config.deviceId; + this._deviceOwner = config.deviceOwner; + this._fixedIp = config.fixedIp; + this._id = config.id; + this._macAddress = config.macAddress; + this._name = config.name; + this._networkId = config.networkId; + this._portId = config.portId; + this._projectId = config.projectId; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._status = config.status; + this._tenantId = config.tenantId; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // all_allowed_ips - computed: true, optional: false, required: false + public get allAllowedIps() { + return this.getListAttribute('all_allowed_ips'); + } + + // all_fixed_ips - computed: true, optional: false, required: false + public get allFixedIps() { + return this.getListAttribute('all_fixed_ips'); + } + + // all_security_group_ids - computed: true, optional: false, required: false + public get allSecurityGroupIds() { + return this.getListAttribute('all_security_group_ids'); + } + + // device_id - computed: true, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // device_owner - computed: true, optional: true, required: false + private _deviceOwner?: string; + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + public set deviceOwner(value: string) { + this._deviceOwner = value; + } + public resetDeviceOwner() { + this._deviceOwner = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceOwnerInput() { + return this._deviceOwner; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: false, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tenant_id - computed: false, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + device_id: cdktf.stringToTerraform(this._deviceId), + device_owner: cdktf.stringToTerraform(this._deviceOwner), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + mac_address: cdktf.stringToTerraform(this._macAddress), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + port_id: cdktf.stringToTerraform(this._portId), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + status: cdktf.stringToTerraform(this._status), + tenant_id: cdktf.stringToTerraform(this._tenantId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_owner: { + value: cdktf.stringToHclTerraform(this._deviceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(this._macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/README.md new file mode 100644 index 00000000..eca08088 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_port` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_port`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/index.ts new file mode 100644 index 00000000..1ef70ed6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-port/index.ts @@ -0,0 +1,501 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingPortConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#admin_state_up DataHuaweicloudNetworkingPort#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#device_id DataHuaweicloudNetworkingPort#device_id} + */ + readonly deviceId?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#device_owner DataHuaweicloudNetworkingPort#device_owner} + */ + readonly deviceOwner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#fixed_ip DataHuaweicloudNetworkingPort#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#id DataHuaweicloudNetworkingPort#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#mac_address DataHuaweicloudNetworkingPort#mac_address} + */ + readonly macAddress?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#name DataHuaweicloudNetworkingPort#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#network_id DataHuaweicloudNetworkingPort#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#port_id DataHuaweicloudNetworkingPort#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#project_id DataHuaweicloudNetworkingPort#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#region DataHuaweicloudNetworkingPort#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#security_group_ids DataHuaweicloudNetworkingPort#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#status DataHuaweicloudNetworkingPort#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#tenant_id DataHuaweicloudNetworkingPort#tenant_id} + */ + readonly tenantId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port huaweicloud_networking_port} +*/ +export class DataHuaweicloudNetworkingPort extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_port"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingPort resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingPort to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingPort that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingPort to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_port", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_port huaweicloud_networking_port} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingPortConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingPortConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_port', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._deviceId = config.deviceId; + this._deviceOwner = config.deviceOwner; + this._fixedIp = config.fixedIp; + this._id = config.id; + this._macAddress = config.macAddress; + this._name = config.name; + this._networkId = config.networkId; + this._portId = config.portId; + this._projectId = config.projectId; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._status = config.status; + this._tenantId = config.tenantId; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // all_allowed_ips - computed: true, optional: false, required: false + public get allAllowedIps() { + return this.getListAttribute('all_allowed_ips'); + } + + // all_fixed_ips - computed: true, optional: false, required: false + public get allFixedIps() { + return this.getListAttribute('all_fixed_ips'); + } + + // all_security_group_ids - computed: true, optional: false, required: false + public get allSecurityGroupIds() { + return this.getListAttribute('all_security_group_ids'); + } + + // device_id - computed: true, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // device_owner - computed: true, optional: true, required: false + private _deviceOwner?: string; + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + public set deviceOwner(value: string) { + this._deviceOwner = value; + } + public resetDeviceOwner() { + this._deviceOwner = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceOwnerInput() { + return this._deviceOwner; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: false, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tenant_id - computed: false, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + device_id: cdktf.stringToTerraform(this._deviceId), + device_owner: cdktf.stringToTerraform(this._deviceOwner), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + mac_address: cdktf.stringToTerraform(this._macAddress), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + port_id: cdktf.stringToTerraform(this._portId), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + status: cdktf.stringToTerraform(this._status), + tenant_id: cdktf.stringToTerraform(this._tenantId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_owner: { + value: cdktf.stringToHclTerraform(this._deviceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(this._macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/README.md new file mode 100644 index 00000000..1b515c82 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_secgroup_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_secgroup_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/index.ts new file mode 100644 index 00000000..9ed222fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-rules/index.ts @@ -0,0 +1,483 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingSecgroupRulesAConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#action DataHuaweicloudNetworkingSecgroupRulesA#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#description DataHuaweicloudNetworkingSecgroupRulesA#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#direction DataHuaweicloudNetworkingSecgroupRulesA#direction} + */ + readonly direction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#id DataHuaweicloudNetworkingSecgroupRulesA#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#protocol DataHuaweicloudNetworkingSecgroupRulesA#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#region DataHuaweicloudNetworkingSecgroupRulesA#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#remote_group_id DataHuaweicloudNetworkingSecgroupRulesA#remote_group_id} + */ + readonly remoteGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#rule_id DataHuaweicloudNetworkingSecgroupRulesA#rule_id} + */ + readonly ruleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#security_group_id DataHuaweicloudNetworkingSecgroupRulesA#security_group_id} + */ + readonly securityGroupId: string; +} +export interface DataHuaweicloudNetworkingSecgroupRulesRules { +} + +export function dataHuaweicloudNetworkingSecgroupRulesRulesToTerraform(struct?: DataHuaweicloudNetworkingSecgroupRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNetworkingSecgroupRulesRulesToHclTerraform(struct?: DataHuaweicloudNetworkingSecgroupRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNetworkingSecgroupRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNetworkingSecgroupRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNetworkingSecgroupRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ports - computed: true, optional: false, required: false + public get ports() { + return this.getStringAttribute('ports'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_address_group_id - computed: true, optional: false, required: false + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudNetworkingSecgroupRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNetworkingSecgroupRulesRulesOutputReference { + return new DataHuaweicloudNetworkingSecgroupRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules huaweicloud_networking_secgroup_rules} +*/ +export class DataHuaweicloudNetworkingSecgroupRulesA extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingSecgroupRulesA resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingSecgroupRulesA to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingSecgroupRulesA that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingSecgroupRulesA to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_rules huaweicloud_networking_secgroup_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingSecgroupRulesAConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingSecgroupRulesAConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._direction = config.direction; + this._id = config.id; + this._protocol = config.protocol; + this._region = config.region; + this._remoteGroupId = config.remoteGroupId; + this._ruleId = config.ruleId; + this._securityGroupId = config.securityGroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: false, optional: true, required: false + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_group_id - computed: false, optional: true, required: false + private _remoteGroupId?: string; + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + public set remoteGroupId(value: string) { + this._remoteGroupId = value; + } + public resetRemoteGroupId() { + this._remoteGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteGroupIdInput() { + return this._remoteGroupId; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNetworkingSecgroupRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + direction: cdktf.stringToTerraform(this._direction), + id: cdktf.stringToTerraform(this._id), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + remote_group_id: cdktf.stringToTerraform(this._remoteGroupId), + rule_id: cdktf.stringToTerraform(this._ruleId), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_group_id: { + value: cdktf.stringToHclTerraform(this._remoteGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/README.md new file mode 100644 index 00000000..7e026599 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_secgroup_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_secgroup_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/index.ts new file mode 100644 index 00000000..de9421b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup-v2/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingSecgroupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2#enterprise_project_id DataHuaweicloudNetworkingSecgroupV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2#id DataHuaweicloudNetworkingSecgroupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2#name DataHuaweicloudNetworkingSecgroupV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2#region DataHuaweicloudNetworkingSecgroupV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2#secgroup_id DataHuaweicloudNetworkingSecgroupV2#secgroup_id} + */ + readonly secgroupId?: string; +} +export interface DataHuaweicloudNetworkingSecgroupV2Rules { +} + +export function dataHuaweicloudNetworkingSecgroupV2RulesToTerraform(struct?: DataHuaweicloudNetworkingSecgroupV2Rules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNetworkingSecgroupV2RulesToHclTerraform(struct?: DataHuaweicloudNetworkingSecgroupV2Rules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNetworkingSecgroupV2RulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNetworkingSecgroupV2Rules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNetworkingSecgroupV2Rules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port_range_max - computed: true, optional: false, required: false + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + + // port_range_min - computed: true, optional: false, required: false + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + + // ports - computed: true, optional: false, required: false + public get ports() { + return this.getStringAttribute('ports'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_address_group_id - computed: true, optional: false, required: false + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } +} + +export class DataHuaweicloudNetworkingSecgroupV2RulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNetworkingSecgroupV2RulesOutputReference { + return new DataHuaweicloudNetworkingSecgroupV2RulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2 huaweicloud_networking_secgroup_v2} +*/ +export class DataHuaweicloudNetworkingSecgroupV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingSecgroupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingSecgroupV2 to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingSecgroupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingSecgroupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup_v2 huaweicloud_networking_secgroup_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingSecgroupV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingSecgroupV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._secgroupId = config.secgroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNetworkingSecgroupV2RulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // secgroup_id - computed: false, optional: true, required: false + private _secgroupId?: string; + public get secgroupId() { + return this.getStringAttribute('secgroup_id'); + } + public set secgroupId(value: string) { + this._secgroupId = value; + } + public resetSecgroupId() { + this._secgroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get secgroupIdInput() { + return this._secgroupId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secgroup_id: cdktf.stringToTerraform(this._secgroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secgroup_id: { + value: cdktf.stringToHclTerraform(this._secgroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/README.md new file mode 100644 index 00000000..052b5b66 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_secgroup` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_secgroup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/index.ts new file mode 100644 index 00000000..3bbb91dd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroup/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingSecgroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup#enterprise_project_id DataHuaweicloudNetworkingSecgroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup#id DataHuaweicloudNetworkingSecgroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup#name DataHuaweicloudNetworkingSecgroup#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup#region DataHuaweicloudNetworkingSecgroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup#secgroup_id DataHuaweicloudNetworkingSecgroup#secgroup_id} + */ + readonly secgroupId?: string; +} +export interface DataHuaweicloudNetworkingSecgroupRules { +} + +export function dataHuaweicloudNetworkingSecgroupRulesToTerraform(struct?: DataHuaweicloudNetworkingSecgroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNetworkingSecgroupRulesToHclTerraform(struct?: DataHuaweicloudNetworkingSecgroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNetworkingSecgroupRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNetworkingSecgroupRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNetworkingSecgroupRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port_range_max - computed: true, optional: false, required: false + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + + // port_range_min - computed: true, optional: false, required: false + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + + // ports - computed: true, optional: false, required: false + public get ports() { + return this.getStringAttribute('ports'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_address_group_id - computed: true, optional: false, required: false + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } +} + +export class DataHuaweicloudNetworkingSecgroupRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNetworkingSecgroupRulesOutputReference { + return new DataHuaweicloudNetworkingSecgroupRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup huaweicloud_networking_secgroup} +*/ +export class DataHuaweicloudNetworkingSecgroup extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingSecgroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingSecgroup to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingSecgroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingSecgroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroup huaweicloud_networking_secgroup} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingSecgroupConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingSecgroupConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._secgroupId = config.secgroupId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudNetworkingSecgroupRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // secgroup_id - computed: false, optional: true, required: false + private _secgroupId?: string; + public get secgroupId() { + return this.getStringAttribute('secgroup_id'); + } + public set secgroupId(value: string) { + this._secgroupId = value; + } + public resetSecgroupId() { + this._secgroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get secgroupIdInput() { + return this._secgroupId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secgroup_id: cdktf.stringToTerraform(this._secgroupId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secgroup_id: { + value: cdktf.stringToHclTerraform(this._secgroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/README.md new file mode 100644 index 00000000..86f668f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_secgroups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_secgroups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/index.ts new file mode 100644 index 00000000..c23b9a67 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-secgroups/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingSecgroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups#description DataHuaweicloudNetworkingSecgroups#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups#enterprise_project_id DataHuaweicloudNetworkingSecgroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups#id DataHuaweicloudNetworkingSecgroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups#name DataHuaweicloudNetworkingSecgroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups#region DataHuaweicloudNetworkingSecgroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudNetworkingSecgroupsSecurityGroups { +} + +export function dataHuaweicloudNetworkingSecgroupsSecurityGroupsToTerraform(struct?: DataHuaweicloudNetworkingSecgroupsSecurityGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNetworkingSecgroupsSecurityGroupsToHclTerraform(struct?: DataHuaweicloudNetworkingSecgroupsSecurityGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNetworkingSecgroupsSecurityGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNetworkingSecgroupsSecurityGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNetworkingSecgroupsSecurityGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudNetworkingSecgroupsSecurityGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNetworkingSecgroupsSecurityGroupsOutputReference { + return new DataHuaweicloudNetworkingSecgroupsSecurityGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups huaweicloud_networking_secgroups} +*/ +export class DataHuaweicloudNetworkingSecgroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingSecgroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingSecgroups to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingSecgroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingSecgroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_secgroups huaweicloud_networking_secgroups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingSecgroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingSecgroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_groups - computed: true, optional: false, required: false + private _securityGroups = new DataHuaweicloudNetworkingSecgroupsSecurityGroupsList(this, "security_groups", false); + public get securityGroups() { + return this._securityGroups; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/README.md new file mode 100644 index 00000000..98c72398 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_networking_subnet_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_networking_subnet_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/index.ts new file mode 100644 index 00000000..7cb35387 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-networking-subnet-v2/index.ts @@ -0,0 +1,634 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudNetworkingSubnetV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#cidr DataHuaweicloudNetworkingSubnetV2#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#dhcp_disabled DataHuaweicloudNetworkingSubnetV2#dhcp_disabled} + */ + readonly dhcpDisabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#dhcp_enabled DataHuaweicloudNetworkingSubnetV2#dhcp_enabled} + */ + readonly dhcpEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#gateway_ip DataHuaweicloudNetworkingSubnetV2#gateway_ip} + */ + readonly gatewayIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#id DataHuaweicloudNetworkingSubnetV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#ip_version DataHuaweicloudNetworkingSubnetV2#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#ipv6_address_mode DataHuaweicloudNetworkingSubnetV2#ipv6_address_mode} + */ + readonly ipv6AddressMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#ipv6_ra_mode DataHuaweicloudNetworkingSubnetV2#ipv6_ra_mode} + */ + readonly ipv6RaMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#name DataHuaweicloudNetworkingSubnetV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#network_id DataHuaweicloudNetworkingSubnetV2#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#region DataHuaweicloudNetworkingSubnetV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#subnet_id DataHuaweicloudNetworkingSubnetV2#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#tenant_id DataHuaweicloudNetworkingSubnetV2#tenant_id} + */ + readonly tenantId?: string; +} +export interface DataHuaweicloudNetworkingSubnetV2AllocationPools { +} + +export function dataHuaweicloudNetworkingSubnetV2AllocationPoolsToTerraform(struct?: DataHuaweicloudNetworkingSubnetV2AllocationPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNetworkingSubnetV2AllocationPoolsToHclTerraform(struct?: DataHuaweicloudNetworkingSubnetV2AllocationPools): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNetworkingSubnetV2AllocationPoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNetworkingSubnetV2AllocationPools | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNetworkingSubnetV2AllocationPools | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end - computed: true, optional: false, required: false + public get end() { + return this.getStringAttribute('end'); + } + + // start - computed: true, optional: false, required: false + public get start() { + return this.getStringAttribute('start'); + } +} + +export class DataHuaweicloudNetworkingSubnetV2AllocationPoolsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNetworkingSubnetV2AllocationPoolsOutputReference { + return new DataHuaweicloudNetworkingSubnetV2AllocationPoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudNetworkingSubnetV2HostRoutes { +} + +export function dataHuaweicloudNetworkingSubnetV2HostRoutesToTerraform(struct?: DataHuaweicloudNetworkingSubnetV2HostRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudNetworkingSubnetV2HostRoutesToHclTerraform(struct?: DataHuaweicloudNetworkingSubnetV2HostRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudNetworkingSubnetV2HostRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudNetworkingSubnetV2HostRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudNetworkingSubnetV2HostRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination_cidr - computed: true, optional: false, required: false + public get destinationCidr() { + return this.getStringAttribute('destination_cidr'); + } + + // next_hop - computed: true, optional: false, required: false + public get nextHop() { + return this.getStringAttribute('next_hop'); + } +} + +export class DataHuaweicloudNetworkingSubnetV2HostRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudNetworkingSubnetV2HostRoutesOutputReference { + return new DataHuaweicloudNetworkingSubnetV2HostRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2 huaweicloud_networking_subnet_v2} +*/ +export class DataHuaweicloudNetworkingSubnetV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_subnet_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudNetworkingSubnetV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudNetworkingSubnetV2 to import + * @param importFromId The id of the existing DataHuaweicloudNetworkingSubnetV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudNetworkingSubnetV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_subnet_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/networking_subnet_v2 huaweicloud_networking_subnet_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudNetworkingSubnetV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudNetworkingSubnetV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_subnet_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._dhcpDisabled = config.dhcpDisabled; + this._dhcpEnabled = config.dhcpEnabled; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._ipv6AddressMode = config.ipv6AddressMode; + this._ipv6RaMode = config.ipv6RaMode; + this._name = config.name; + this._networkId = config.networkId; + this._region = config.region; + this._subnetId = config.subnetId; + this._tenantId = config.tenantId; + } + + // ========== + // ATTRIBUTES + // ========== + + // allocation_pools - computed: true, optional: false, required: false + private _allocationPools = new DataHuaweicloudNetworkingSubnetV2AllocationPoolsList(this, "allocation_pools", false); + public get allocationPools() { + return this._allocationPools; + } + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // dhcp_disabled - computed: false, optional: true, required: false + private _dhcpDisabled?: boolean | cdktf.IResolvable; + public get dhcpDisabled() { + return this.getBooleanAttribute('dhcp_disabled'); + } + public set dhcpDisabled(value: boolean | cdktf.IResolvable) { + this._dhcpDisabled = value; + } + public resetDhcpDisabled() { + this._dhcpDisabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpDisabledInput() { + return this._dhcpDisabled; + } + + // dhcp_enabled - computed: false, optional: true, required: false + private _dhcpEnabled?: boolean | cdktf.IResolvable; + public get dhcpEnabled() { + return this.getBooleanAttribute('dhcp_enabled'); + } + public set dhcpEnabled(value: boolean | cdktf.IResolvable) { + this._dhcpEnabled = value; + } + public resetDhcpEnabled() { + this._dhcpEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpEnabledInput() { + return this._dhcpEnabled; + } + + // dns_nameservers - computed: true, optional: false, required: false + public get dnsNameservers() { + return cdktf.Fn.tolist(this.getListAttribute('dns_nameservers')); + } + + // enable_dhcp - computed: true, optional: false, required: false + public get enableDhcp() { + return this.getBooleanAttribute('enable_dhcp'); + } + + // gateway_ip - computed: true, optional: true, required: false + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + public resetGatewayIp() { + this._gatewayIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // host_routes - computed: true, optional: false, required: false + private _hostRoutes = new DataHuaweicloudNetworkingSubnetV2HostRoutesList(this, "host_routes", false); + public get hostRoutes() { + return this._hostRoutes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // ipv6_address_mode - computed: true, optional: true, required: false + private _ipv6AddressMode?: string; + public get ipv6AddressMode() { + return this.getStringAttribute('ipv6_address_mode'); + } + public set ipv6AddressMode(value: string) { + this._ipv6AddressMode = value; + } + public resetIpv6AddressMode() { + this._ipv6AddressMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6AddressModeInput() { + return this._ipv6AddressMode; + } + + // ipv6_ra_mode - computed: true, optional: true, required: false + private _ipv6RaMode?: string; + public get ipv6RaMode() { + return this.getStringAttribute('ipv6_ra_mode'); + } + public set ipv6RaMode(value: string) { + this._ipv6RaMode = value; + } + public resetIpv6RaMode() { + this._ipv6RaMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6RaModeInput() { + return this._ipv6RaMode; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + dhcp_disabled: cdktf.booleanToTerraform(this._dhcpDisabled), + dhcp_enabled: cdktf.booleanToTerraform(this._dhcpEnabled), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + ipv6_address_mode: cdktf.stringToTerraform(this._ipv6AddressMode), + ipv6_ra_mode: cdktf.stringToTerraform(this._ipv6RaMode), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tenant_id: cdktf.stringToTerraform(this._tenantId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dhcp_disabled: { + value: cdktf.booleanToHclTerraform(this._dhcpDisabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dhcp_enabled: { + value: cdktf.booleanToHclTerraform(this._dhcpEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ipv6_address_mode: { + value: cdktf.stringToHclTerraform(this._ipv6AddressMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_ra_mode: { + value: cdktf.stringToHclTerraform(this._ipv6RaMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/README.md new file mode 100644 index 00000000..9d08e17b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_obs_bucket_object` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_obs_bucket_object`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/index.ts new file mode 100644 index 00000000..e0b5ab1b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-bucket-object/index.ts @@ -0,0 +1,224 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudObsBucketObjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object#bucket DataHuaweicloudObsBucketObject#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object#id DataHuaweicloudObsBucketObject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object#key DataHuaweicloudObsBucketObject#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object#region DataHuaweicloudObsBucketObject#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object huaweicloud_obs_bucket_object} +*/ +export class DataHuaweicloudObsBucketObject extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket_object"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudObsBucketObject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudObsBucketObject to import + * @param importFromId The id of the existing DataHuaweicloudObsBucketObject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudObsBucketObject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket_object", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_bucket_object huaweicloud_obs_bucket_object} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudObsBucketObjectConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudObsBucketObjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket_object', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._id = config.id; + this._key = config.key; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // body - computed: true, optional: false, required: false + public get body() { + return this.getStringAttribute('body'); + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // content_type - computed: true, optional: false, required: false + public get contentType() { + return this.getStringAttribute('content_type'); + } + + // etag - computed: true, optional: false, required: false + public get etag() { + return this.getStringAttribute('etag'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // storage_class - computed: true, optional: false, required: false + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + id: cdktf.stringToTerraform(this._id), + key: cdktf.stringToTerraform(this._key), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/README.md new file mode 100644 index 00000000..fa7f7efb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_obs_buckets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_obs_buckets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/index.ts new file mode 100644 index 00000000..b4a228dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-obs-buckets/index.ts @@ -0,0 +1,301 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudObsBucketsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets#bucket DataHuaweicloudObsBuckets#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets#enterprise_project_id DataHuaweicloudObsBuckets#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets#id DataHuaweicloudObsBuckets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets#region DataHuaweicloudObsBuckets#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudObsBucketsBuckets { +} + +export function dataHuaweicloudObsBucketsBucketsToTerraform(struct?: DataHuaweicloudObsBucketsBuckets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudObsBucketsBucketsToHclTerraform(struct?: DataHuaweicloudObsBucketsBuckets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudObsBucketsBucketsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudObsBucketsBuckets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudObsBucketsBuckets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bucket - computed: true, optional: false, required: false + public get bucket() { + return this.getStringAttribute('bucket'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // storage_class - computed: true, optional: false, required: false + public get storageClass() { + return this.getStringAttribute('storage_class'); + } +} + +export class DataHuaweicloudObsBucketsBucketsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudObsBucketsBucketsOutputReference { + return new DataHuaweicloudObsBucketsBucketsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets huaweicloud_obs_buckets} +*/ +export class DataHuaweicloudObsBuckets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_buckets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudObsBuckets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudObsBuckets to import + * @param importFromId The id of the existing DataHuaweicloudObsBuckets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudObsBuckets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_buckets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/obs_buckets huaweicloud_obs_buckets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudObsBucketsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudObsBucketsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_buckets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket - computed: false, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // buckets - computed: true, optional: false, required: false + private _buckets = new DataHuaweicloudObsBucketsBucketsList(this, "buckets", false); + public get buckets() { + return this._buckets; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/README.md new file mode 100644 index 00000000..5740f0b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/index.ts new file mode 100644 index 00000000..c13ad8f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-accounts/index.ts @@ -0,0 +1,287 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts#id DataHuaweicloudOrganizationsAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts#name DataHuaweicloudOrganizationsAccounts#name} + */ + readonly name?: string; + /** + * Specifies the ID of root or organizational unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts#parent_id DataHuaweicloudOrganizationsAccounts#parent_id} + */ + readonly parentId?: string; +} +export interface DataHuaweicloudOrganizationsAccountsAccounts { +} + +export function dataHuaweicloudOrganizationsAccountsAccountsToTerraform(struct?: DataHuaweicloudOrganizationsAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsAccountsAccountsToHclTerraform(struct?: DataHuaweicloudOrganizationsAccountsAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsAccountsAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsAccountsAccounts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsAccountsAccounts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // join_method - computed: true, optional: false, required: false + public get joinMethod() { + return this.getStringAttribute('join_method'); + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudOrganizationsAccountsAccountsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsAccountsAccountsOutputReference { + return new DataHuaweicloudOrganizationsAccountsAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts huaweicloud_organizations_accounts} +*/ +export class DataHuaweicloudOrganizationsAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsAccounts to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_accounts huaweicloud_organizations_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsAccountsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsAccountsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._parentId = config.parentId; + } + + // ========== + // ATTRIBUTES + // ========== + + // accounts - computed: true, optional: false, required: false + private _accounts = new DataHuaweicloudOrganizationsAccountsAccountsList(this, "accounts", false); + public get accounts() { + return this._accounts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/README.md new file mode 100644 index 00000000..65dd9719 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_effective_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_effective_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/index.ts new file mode 100644 index 00000000..4c878cae --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-effective-policies/index.ts @@ -0,0 +1,210 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsEffectivePoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the unique ID of an account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies#entity_id DataHuaweicloudOrganizationsEffectivePolicies#entity_id} + */ + readonly entityId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies#id DataHuaweicloudOrganizationsEffectivePolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of a policy type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies#policy_type DataHuaweicloudOrganizationsEffectivePolicies#policy_type} + */ + readonly policyType: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies#region DataHuaweicloudOrganizationsEffectivePolicies#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies huaweicloud_organizations_effective_policies} +*/ +export class DataHuaweicloudOrganizationsEffectivePolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_effective_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsEffectivePolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsEffectivePolicies to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsEffectivePolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsEffectivePolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_effective_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_effective_policies huaweicloud_organizations_effective_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsEffectivePoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsEffectivePoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_effective_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._entityId = config.entityId; + this._id = config.id; + this._policyType = config.policyType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // entity_id - computed: false, optional: false, required: true + private _entityId?: string; + public get entityId() { + return this.getStringAttribute('entity_id'); + } + public set entityId(value: string) { + this._entityId = value; + } + // Temporarily expose input value. Use with caution. + public get entityIdInput() { + return this._entityId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // last_updated_at - computed: true, optional: false, required: false + public get lastUpdatedAt() { + return this.getStringAttribute('last_updated_at'); + } + + // policy_content - computed: true, optional: false, required: false + public get policyContent() { + return this.getStringAttribute('policy_content'); + } + + // policy_type - computed: false, optional: false, required: true + private _policyType?: string; + public get policyType() { + return this.getStringAttribute('policy_type'); + } + public set policyType(value: string) { + this._policyType = value; + } + // Temporarily expose input value. Use with caution. + public get policyTypeInput() { + return this._policyType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + entity_id: cdktf.stringToTerraform(this._entityId), + id: cdktf.stringToTerraform(this._id), + policy_type: cdktf.stringToTerraform(this._policyType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + entity_id: { + value: cdktf.stringToHclTerraform(this._entityId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_type: { + value: cdktf.stringToHclTerraform(this._policyType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/README.md new file mode 100644 index 00000000..91380af7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_organization` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_organization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organization). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/index.ts new file mode 100644 index 00000000..9cdf4d2f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organization/index.ts @@ -0,0 +1,162 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsOrganizationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organization#id DataHuaweicloudOrganizationsOrganization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organization huaweicloud_organizations_organization} +*/ +export class DataHuaweicloudOrganizationsOrganization extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_organization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsOrganization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsOrganization to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsOrganization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsOrganization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_organization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organization huaweicloud_organizations_organization} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsOrganizationConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsOrganizationConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_organization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enabled_policy_types - computed: true, optional: false, required: false + public get enabledPolicyTypes() { + return cdktf.Fn.tolist(this.getListAttribute('enabled_policy_types')); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // master_account_id - computed: true, optional: false, required: false + public get masterAccountId() { + return this.getStringAttribute('master_account_id'); + } + + // master_account_name - computed: true, optional: false, required: false + public get masterAccountName() { + return this.getStringAttribute('master_account_name'); + } + + // root_id - computed: true, optional: false, required: false + public get rootId() { + return this.getStringAttribute('root_id'); + } + + // root_name - computed: true, optional: false, required: false + public get rootName() { + return this.getStringAttribute('root_name'); + } + + // root_tags - computed: true, optional: false, required: false + private _rootTags = new cdktf.StringMap(this, "root_tags"); + public get rootTags() { + return this._rootTags; + } + + // root_urn - computed: true, optional: false, required: false + public get rootUrn() { + return this.getStringAttribute('root_urn'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/README.md new file mode 100644 index 00000000..60badada --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_organizational_units` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_organizational_units`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/index.ts new file mode 100644 index 00000000..5a5e8f4f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-organizational-units/index.ts @@ -0,0 +1,239 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsOrganizationalUnitsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units#id DataHuaweicloudOrganizationsOrganizationalUnits#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of root or organizational unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units#parent_id DataHuaweicloudOrganizationsOrganizationalUnits#parent_id} + */ + readonly parentId: string; +} +export interface DataHuaweicloudOrganizationsOrganizationalUnitsChildren { +} + +export function dataHuaweicloudOrganizationsOrganizationalUnitsChildrenToTerraform(struct?: DataHuaweicloudOrganizationsOrganizationalUnitsChildren): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsOrganizationalUnitsChildrenToHclTerraform(struct?: DataHuaweicloudOrganizationsOrganizationalUnitsChildren): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsOrganizationalUnitsChildrenOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsOrganizationalUnitsChildren | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsOrganizationalUnitsChildren | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudOrganizationsOrganizationalUnitsChildrenList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsOrganizationalUnitsChildrenOutputReference { + return new DataHuaweicloudOrganizationsOrganizationalUnitsChildrenOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units huaweicloud_organizations_organizational_units} +*/ +export class DataHuaweicloudOrganizationsOrganizationalUnits extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_organizational_units"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsOrganizationalUnits resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsOrganizationalUnits to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsOrganizationalUnits that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsOrganizationalUnits to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_organizational_units", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_organizational_units huaweicloud_organizations_organizational_units} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsOrganizationalUnitsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsOrganizationalUnitsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_organizational_units', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._parentId = config.parentId; + } + + // ========== + // ATTRIBUTES + // ========== + + // children - computed: true, optional: false, required: false + private _children = new DataHuaweicloudOrganizationsOrganizationalUnitsChildrenList(this, "children", false); + public get children() { + return this._children; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // parent_id - computed: false, optional: false, required: true + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + parent_id: cdktf.stringToTerraform(this._parentId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/README.md new file mode 100644 index 00000000..09943fe6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/index.ts new file mode 100644 index 00000000..728902cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-policies/index.ts @@ -0,0 +1,312 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the build type of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies#build_type DataHuaweicloudOrganizationsPolicies#build_type} + */ + readonly buildType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies#id DataHuaweicloudOrganizationsPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies#name DataHuaweicloudOrganizationsPolicies#name} + */ + readonly name?: string; + /** + * Specifies the type of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies#type DataHuaweicloudOrganizationsPolicies#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudOrganizationsPoliciesPolicies { +} + +export function dataHuaweicloudOrganizationsPoliciesPoliciesToTerraform(struct?: DataHuaweicloudOrganizationsPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudOrganizationsPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // build_type - computed: true, optional: false, required: false + public get buildType() { + return this.getStringAttribute('build_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudOrganizationsPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsPoliciesPoliciesOutputReference { + return new DataHuaweicloudOrganizationsPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies huaweicloud_organizations_policies} +*/ +export class DataHuaweicloudOrganizationsPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsPolicies to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_policies huaweicloud_organizations_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._buildType = config.buildType; + this._id = config.id; + this._name = config.name; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // build_type - computed: false, optional: true, required: false + private _buildType?: string; + public get buildType() { + return this.getStringAttribute('build_type'); + } + public set buildType(value: string) { + this._buildType = value; + } + public resetBuildType() { + this._buildType = undefined; + } + // Temporarily expose input value. Use with caution. + public get buildTypeInput() { + return this._buildType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudOrganizationsPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + build_type: cdktf.stringToTerraform(this._buildType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + build_type: { + value: cdktf.stringToHclTerraform(this._buildType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/README.md new file mode 100644 index 00000000..9b31d363 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_received_invitations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_received_invitations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/index.ts new file mode 100644 index 00000000..a185f4d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-received-invitations/index.ts @@ -0,0 +1,353 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsReceivedInvitationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations#id DataHuaweicloudOrganizationsReceivedInvitations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations#region DataHuaweicloudOrganizationsReceivedInvitations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTarget { +} + +export function dataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetToTerraform(struct?: DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTarget): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetToHclTerraform(struct?: DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTarget): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTarget | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTarget | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // entity - computed: true, optional: false, required: false + public get entity() { + return this.getStringAttribute('entity'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetOutputReference { + return new DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudOrganizationsReceivedInvitationsHandshakes { +} + +export function dataHuaweicloudOrganizationsReceivedInvitationsHandshakesToTerraform(struct?: DataHuaweicloudOrganizationsReceivedInvitationsHandshakes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsReceivedInvitationsHandshakesToHclTerraform(struct?: DataHuaweicloudOrganizationsReceivedInvitationsHandshakes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsReceivedInvitationsHandshakesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsReceivedInvitationsHandshakes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsReceivedInvitationsHandshakes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // management_account_id - computed: true, optional: false, required: false + public get managementAccountId() { + return this.getStringAttribute('management_account_id'); + } + + // management_account_name - computed: true, optional: false, required: false + public get managementAccountName() { + return this.getStringAttribute('management_account_name'); + } + + // notes - computed: true, optional: false, required: false + public get notes() { + return this.getStringAttribute('notes'); + } + + // organization_id - computed: true, optional: false, required: false + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // target - computed: true, optional: false, required: false + private _target = new DataHuaweicloudOrganizationsReceivedInvitationsHandshakesTargetList(this, "target", false); + public get target() { + return this._target; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudOrganizationsReceivedInvitationsHandshakesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsReceivedInvitationsHandshakesOutputReference { + return new DataHuaweicloudOrganizationsReceivedInvitationsHandshakesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations huaweicloud_organizations_received_invitations} +*/ +export class DataHuaweicloudOrganizationsReceivedInvitations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_received_invitations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsReceivedInvitations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsReceivedInvitations to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsReceivedInvitations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsReceivedInvitations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_received_invitations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_received_invitations huaweicloud_organizations_received_invitations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsReceivedInvitationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsReceivedInvitationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_received_invitations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // handshakes - computed: true, optional: false, required: false + private _handshakes = new DataHuaweicloudOrganizationsReceivedInvitationsHandshakesList(this, "handshakes", false); + public get handshakes() { + return this._handshakes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/README.md new file mode 100644 index 00000000..692e0c04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_resource_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_resource_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/index.ts new file mode 100644 index 00000000..89c9e3c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-instances/index.ts @@ -0,0 +1,687 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsResourceInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#id DataHuaweicloudOrganizationsResourceInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#resource_type DataHuaweicloudOrganizationsResourceInstances#resource_type} + */ + readonly resourceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#without_any_tag DataHuaweicloudOrganizationsResourceInstances#without_any_tag} + */ + readonly withoutAnyTag?: boolean | cdktf.IResolvable; + /** + * matches block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#matches DataHuaweicloudOrganizationsResourceInstances#matches} + */ + readonly matches?: DataHuaweicloudOrganizationsResourceInstancesMatches[] | cdktf.IResolvable; + /** + * tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#tags DataHuaweicloudOrganizationsResourceInstances#tags} + */ + readonly tags?: DataHuaweicloudOrganizationsResourceInstancesTags[] | cdktf.IResolvable; +} +export interface DataHuaweicloudOrganizationsResourceInstancesResourcesTags { +} + +export function dataHuaweicloudOrganizationsResourceInstancesResourcesTagsToTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesResourcesTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsResourceInstancesResourcesTagsToHclTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesResourcesTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsResourceInstancesResourcesTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsResourceInstancesResourcesTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsResourceInstancesResourcesTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudOrganizationsResourceInstancesResourcesTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsResourceInstancesResourcesTagsOutputReference { + return new DataHuaweicloudOrganizationsResourceInstancesResourcesTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudOrganizationsResourceInstancesResources { +} + +export function dataHuaweicloudOrganizationsResourceInstancesResourcesToTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsResourceInstancesResourcesToHclTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsResourceInstancesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsResourceInstancesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsResourceInstancesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new DataHuaweicloudOrganizationsResourceInstancesResourcesTagsList(this, "tags", false); + public get tags() { + return this._tags; + } +} + +export class DataHuaweicloudOrganizationsResourceInstancesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsResourceInstancesResourcesOutputReference { + return new DataHuaweicloudOrganizationsResourceInstancesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudOrganizationsResourceInstancesMatches { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#key DataHuaweicloudOrganizationsResourceInstances#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#value DataHuaweicloudOrganizationsResourceInstances#value} + */ + readonly value: string; +} + +export function dataHuaweicloudOrganizationsResourceInstancesMatchesToTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesMatches | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dataHuaweicloudOrganizationsResourceInstancesMatchesToHclTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesMatches | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudOrganizationsResourceInstancesMatchesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsResourceInstancesMatches | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsResourceInstancesMatches | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DataHuaweicloudOrganizationsResourceInstancesMatchesList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudOrganizationsResourceInstancesMatches[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsResourceInstancesMatchesOutputReference { + return new DataHuaweicloudOrganizationsResourceInstancesMatchesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudOrganizationsResourceInstancesTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#key DataHuaweicloudOrganizationsResourceInstances#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#values DataHuaweicloudOrganizationsResourceInstances#values} + */ + readonly values: string[]; +} + +export function dataHuaweicloudOrganizationsResourceInstancesTagsToTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function dataHuaweicloudOrganizationsResourceInstancesTagsToHclTerraform(struct?: DataHuaweicloudOrganizationsResourceInstancesTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudOrganizationsResourceInstancesTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsResourceInstancesTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsResourceInstancesTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._values = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._values = value.values; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} + +export class DataHuaweicloudOrganizationsResourceInstancesTagsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudOrganizationsResourceInstancesTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsResourceInstancesTagsOutputReference { + return new DataHuaweicloudOrganizationsResourceInstancesTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances huaweicloud_organizations_resource_instances} +*/ +export class DataHuaweicloudOrganizationsResourceInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_resource_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsResourceInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsResourceInstances to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsResourceInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsResourceInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_resource_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_instances huaweicloud_organizations_resource_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsResourceInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsResourceInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_resource_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._resourceType = config.resourceType; + this._withoutAnyTag = config.withoutAnyTag; + this._matches.internalValue = config.matches; + this._tags.internalValue = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudOrganizationsResourceInstancesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // without_any_tag - computed: false, optional: true, required: false + private _withoutAnyTag?: boolean | cdktf.IResolvable; + public get withoutAnyTag() { + return this.getBooleanAttribute('without_any_tag'); + } + public set withoutAnyTag(value: boolean | cdktf.IResolvable) { + this._withoutAnyTag = value; + } + public resetWithoutAnyTag() { + this._withoutAnyTag = undefined; + } + // Temporarily expose input value. Use with caution. + public get withoutAnyTagInput() { + return this._withoutAnyTag; + } + + // matches - computed: false, optional: true, required: false + private _matches = new DataHuaweicloudOrganizationsResourceInstancesMatchesList(this, "matches", false); + public get matches() { + return this._matches; + } + public putMatches(value: DataHuaweicloudOrganizationsResourceInstancesMatches[] | cdktf.IResolvable) { + this._matches.internalValue = value; + } + public resetMatches() { + this._matches.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get matchesInput() { + return this._matches.internalValue; + } + + // tags - computed: false, optional: true, required: false + private _tags = new DataHuaweicloudOrganizationsResourceInstancesTagsList(this, "tags", false); + public get tags() { + return this._tags; + } + public putTags(value: DataHuaweicloudOrganizationsResourceInstancesTags[] | cdktf.IResolvable) { + this._tags.internalValue = value; + } + public resetTags() { + this._tags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + resource_type: cdktf.stringToTerraform(this._resourceType), + without_any_tag: cdktf.booleanToTerraform(this._withoutAnyTag), + matches: cdktf.listMapper(dataHuaweicloudOrganizationsResourceInstancesMatchesToTerraform, true)(this._matches.internalValue), + tags: cdktf.listMapper(dataHuaweicloudOrganizationsResourceInstancesTagsToTerraform, true)(this._tags.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + without_any_tag: { + value: cdktf.booleanToHclTerraform(this._withoutAnyTag), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + matches: { + value: cdktf.listMapperHcl(dataHuaweicloudOrganizationsResourceInstancesMatchesToHclTerraform, true)(this._matches.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudOrganizationsResourceInstancesMatchesList", + }, + tags: { + value: cdktf.listMapperHcl(dataHuaweicloudOrganizationsResourceInstancesTagsToHclTerraform, true)(this._tags.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudOrganizationsResourceInstancesTagsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/README.md new file mode 100644 index 00000000..e054318d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_resource_tags` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_resource_tags`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/index.ts new file mode 100644 index 00000000..3d984bfb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-resource-tags/index.ts @@ -0,0 +1,259 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsResourceTagsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags#id DataHuaweicloudOrganizationsResourceTags#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags#region DataHuaweicloudOrganizationsResourceTags#region} + */ + readonly region?: string; + /** + * Specifies the resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags#resource_type DataHuaweicloudOrganizationsResourceTags#resource_type} + */ + readonly resourceType: string; +} +export interface DataHuaweicloudOrganizationsResourceTagsTags { +} + +export function dataHuaweicloudOrganizationsResourceTagsTagsToTerraform(struct?: DataHuaweicloudOrganizationsResourceTagsTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsResourceTagsTagsToHclTerraform(struct?: DataHuaweicloudOrganizationsResourceTagsTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsResourceTagsTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsResourceTagsTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsResourceTagsTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // values - computed: true, optional: false, required: false + public get values() { + return this.getListAttribute('values'); + } +} + +export class DataHuaweicloudOrganizationsResourceTagsTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsResourceTagsTagsOutputReference { + return new DataHuaweicloudOrganizationsResourceTagsTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags huaweicloud_organizations_resource_tags} +*/ +export class DataHuaweicloudOrganizationsResourceTags extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_resource_tags"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsResourceTags resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsResourceTags to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsResourceTags that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsResourceTags to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_resource_tags", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_resource_tags huaweicloud_organizations_resource_tags} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsResourceTagsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsResourceTagsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_resource_tags', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._resourceType = config.resourceType; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // tags - computed: true, optional: false, required: false + private _tags = new DataHuaweicloudOrganizationsResourceTagsTagsList(this, "tags", false); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_type: cdktf.stringToTerraform(this._resourceType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/README.md new file mode 100644 index 00000000..83a08c4e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_sent_invitations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_sent_invitations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/index.ts new file mode 100644 index 00000000..057c565a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-sent-invitations/index.ts @@ -0,0 +1,353 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsSentInvitationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations#id DataHuaweicloudOrganizationsSentInvitations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations#region DataHuaweicloudOrganizationsSentInvitations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudOrganizationsSentInvitationsHandshakesTarget { +} + +export function dataHuaweicloudOrganizationsSentInvitationsHandshakesTargetToTerraform(struct?: DataHuaweicloudOrganizationsSentInvitationsHandshakesTarget): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsSentInvitationsHandshakesTargetToHclTerraform(struct?: DataHuaweicloudOrganizationsSentInvitationsHandshakesTarget): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsSentInvitationsHandshakesTargetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsSentInvitationsHandshakesTarget | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsSentInvitationsHandshakesTarget | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // entity - computed: true, optional: false, required: false + public get entity() { + return this.getStringAttribute('entity'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudOrganizationsSentInvitationsHandshakesTargetList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsSentInvitationsHandshakesTargetOutputReference { + return new DataHuaweicloudOrganizationsSentInvitationsHandshakesTargetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudOrganizationsSentInvitationsHandshakes { +} + +export function dataHuaweicloudOrganizationsSentInvitationsHandshakesToTerraform(struct?: DataHuaweicloudOrganizationsSentInvitationsHandshakes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsSentInvitationsHandshakesToHclTerraform(struct?: DataHuaweicloudOrganizationsSentInvitationsHandshakes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsSentInvitationsHandshakesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsSentInvitationsHandshakes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsSentInvitationsHandshakes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // management_account_id - computed: true, optional: false, required: false + public get managementAccountId() { + return this.getStringAttribute('management_account_id'); + } + + // management_account_name - computed: true, optional: false, required: false + public get managementAccountName() { + return this.getStringAttribute('management_account_name'); + } + + // notes - computed: true, optional: false, required: false + public get notes() { + return this.getStringAttribute('notes'); + } + + // organization_id - computed: true, optional: false, required: false + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // target - computed: true, optional: false, required: false + private _target = new DataHuaweicloudOrganizationsSentInvitationsHandshakesTargetList(this, "target", false); + public get target() { + return this._target; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudOrganizationsSentInvitationsHandshakesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsSentInvitationsHandshakesOutputReference { + return new DataHuaweicloudOrganizationsSentInvitationsHandshakesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations huaweicloud_organizations_sent_invitations} +*/ +export class DataHuaweicloudOrganizationsSentInvitations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_sent_invitations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsSentInvitations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsSentInvitations to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsSentInvitations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsSentInvitations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_sent_invitations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_sent_invitations huaweicloud_organizations_sent_invitations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsSentInvitationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsSentInvitationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_sent_invitations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // handshakes - computed: true, optional: false, required: false + private _handshakes = new DataHuaweicloudOrganizationsSentInvitationsHandshakesList(this, "handshakes", false); + public get handshakes() { + return this._handshakes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/README.md new file mode 100644 index 00000000..2f6037b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/index.ts new file mode 100644 index 00000000..ff13a766 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-services/index.ts @@ -0,0 +1,151 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services#id DataHuaweicloudOrganizationsServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services#region DataHuaweicloudOrganizationsServices#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services huaweicloud_organizations_services} +*/ +export class DataHuaweicloudOrganizationsServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsServices to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_services huaweicloud_organizations_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // services - computed: true, optional: false, required: false + public get services() { + return this.getListAttribute('services'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/README.md new file mode 100644 index 00000000..35b52cf1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_tag_policy_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_tag_policy_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/index.ts new file mode 100644 index 00000000..21e78741 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-tag-policy-services/index.ts @@ -0,0 +1,237 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsTagPolicyServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services#id DataHuaweicloudOrganizationsTagPolicyServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services#region DataHuaweicloudOrganizationsTagPolicyServices#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudOrganizationsTagPolicyServicesServices { +} + +export function dataHuaweicloudOrganizationsTagPolicyServicesServicesToTerraform(struct?: DataHuaweicloudOrganizationsTagPolicyServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsTagPolicyServicesServicesToHclTerraform(struct?: DataHuaweicloudOrganizationsTagPolicyServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsTagPolicyServicesServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsTagPolicyServicesServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsTagPolicyServicesServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // resource_types - computed: true, optional: false, required: false + public get resourceTypes() { + return this.getListAttribute('resource_types'); + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // support_all - computed: true, optional: false, required: false + public get supportAll() { + return this.getBooleanAttribute('support_all'); + } +} + +export class DataHuaweicloudOrganizationsTagPolicyServicesServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsTagPolicyServicesServicesOutputReference { + return new DataHuaweicloudOrganizationsTagPolicyServicesServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services huaweicloud_organizations_tag_policy_services} +*/ +export class DataHuaweicloudOrganizationsTagPolicyServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_tag_policy_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsTagPolicyServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsTagPolicyServices to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsTagPolicyServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsTagPolicyServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_tag_policy_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_tag_policy_services huaweicloud_organizations_tag_policy_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsTagPolicyServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsTagPolicyServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_tag_policy_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // services - computed: true, optional: false, required: false + private _services = new DataHuaweicloudOrganizationsTagPolicyServicesServicesList(this, "services", false); + public get services() { + return this._services; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/README.md new file mode 100644 index 00000000..a6ba070c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_organizations_trusted_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_organizations_trusted_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/index.ts new file mode 100644 index 00000000..4a4e0f38 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-organizations-trusted-services/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudOrganizationsTrustedServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services#id DataHuaweicloudOrganizationsTrustedServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services#region DataHuaweicloudOrganizationsTrustedServices#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudOrganizationsTrustedServicesTrustedServices { +} + +export function dataHuaweicloudOrganizationsTrustedServicesTrustedServicesToTerraform(struct?: DataHuaweicloudOrganizationsTrustedServicesTrustedServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudOrganizationsTrustedServicesTrustedServicesToHclTerraform(struct?: DataHuaweicloudOrganizationsTrustedServicesTrustedServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudOrganizationsTrustedServicesTrustedServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudOrganizationsTrustedServicesTrustedServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudOrganizationsTrustedServicesTrustedServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // enabled_at - computed: true, optional: false, required: false + public get enabledAt() { + return this.getStringAttribute('enabled_at'); + } + + // service_principal - computed: true, optional: false, required: false + public get servicePrincipal() { + return this.getStringAttribute('service_principal'); + } +} + +export class DataHuaweicloudOrganizationsTrustedServicesTrustedServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudOrganizationsTrustedServicesTrustedServicesOutputReference { + return new DataHuaweicloudOrganizationsTrustedServicesTrustedServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services huaweicloud_organizations_trusted_services} +*/ +export class DataHuaweicloudOrganizationsTrustedServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_trusted_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudOrganizationsTrustedServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudOrganizationsTrustedServices to import + * @param importFromId The id of the existing DataHuaweicloudOrganizationsTrustedServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudOrganizationsTrustedServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_trusted_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/organizations_trusted_services huaweicloud_organizations_trusted_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudOrganizationsTrustedServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudOrganizationsTrustedServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_trusted_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // trusted_services - computed: true, optional: false, required: false + private _trustedServices = new DataHuaweicloudOrganizationsTrustedServicesTrustedServicesList(this, "trusted_services", false); + public get trustedServices() { + return this._trustedServices; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/README.md new file mode 100644 index 00000000..cdfbb317 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_resource_permissions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_resource_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/index.ts new file mode 100644 index 00000000..2787fa15 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-permissions/index.ts @@ -0,0 +1,337 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamResourcePermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions#id DataHuaweicloudRamResourcePermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of RAM permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions#name DataHuaweicloudRamResourcePermissions#name} + */ + readonly name?: string; + /** + * Specifies the type of the permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions#permission_type DataHuaweicloudRamResourcePermissions#permission_type} + */ + readonly permissionType?: string; + /** + * Specifies the resource type of RAM permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions#resource_type DataHuaweicloudRamResourcePermissions#resource_type} + */ + readonly resourceType?: string; +} +export interface DataHuaweicloudRamResourcePermissionsPermissions { +} + +export function dataHuaweicloudRamResourcePermissionsPermissionsToTerraform(struct?: DataHuaweicloudRamResourcePermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamResourcePermissionsPermissionsToHclTerraform(struct?: DataHuaweicloudRamResourcePermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamResourcePermissionsPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamResourcePermissionsPermissions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamResourcePermissionsPermissions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_version - computed: true, optional: false, required: false + public get defaultVersion() { + return this.getBooleanAttribute('default_version'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_resource_type_default - computed: true, optional: false, required: false + public get isResourceTypeDefault() { + return this.getBooleanAttribute('is_resource_type_default'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // permission_type - computed: true, optional: false, required: false + public get permissionType() { + return this.getStringAttribute('permission_type'); + } + + // permission_urn - computed: true, optional: false, required: false + public get permissionUrn() { + return this.getStringAttribute('permission_urn'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } +} + +export class DataHuaweicloudRamResourcePermissionsPermissionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamResourcePermissionsPermissionsOutputReference { + return new DataHuaweicloudRamResourcePermissionsPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions huaweicloud_ram_resource_permissions} +*/ +export class DataHuaweicloudRamResourcePermissions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamResourcePermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamResourcePermissions to import + * @param importFromId The id of the existing DataHuaweicloudRamResourcePermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamResourcePermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_permissions huaweicloud_ram_resource_permissions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamResourcePermissionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamResourcePermissionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._permissionType = config.permissionType; + this._resourceType = config.resourceType; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permission_type - computed: false, optional: true, required: false + private _permissionType?: string; + public get permissionType() { + return this.getStringAttribute('permission_type'); + } + public set permissionType(value: string) { + this._permissionType = value; + } + public resetPermissionType() { + this._permissionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionTypeInput() { + return this._permissionType; + } + + // permissions - computed: true, optional: false, required: false + private _permissions = new DataHuaweicloudRamResourcePermissionsPermissionsList(this, "permissions", false); + public get permissions() { + return this._permissions; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + permission_type: cdktf.stringToTerraform(this._permissionType), + resource_type: cdktf.stringToTerraform(this._resourceType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_type: { + value: cdktf.stringToHclTerraform(this._permissionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/README.md new file mode 100644 index 00000000..66ce0085 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_resource_share_associated_permissions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_resource_share_associated_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/index.ts new file mode 100644 index 00000000..ae0a8166 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associated-permissions/index.ts @@ -0,0 +1,309 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamResourceShareAssociatedPermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions#id DataHuaweicloudRamResourceShareAssociatedPermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the RAM managed permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions#permission_name DataHuaweicloudRamResourceShareAssociatedPermissions#permission_name} + */ + readonly permissionName?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions#region DataHuaweicloudRamResourceShareAssociatedPermissions#region} + */ + readonly region?: string; + /** + * Specifies the ID of the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions#resource_share_id DataHuaweicloudRamResourceShareAssociatedPermissions#resource_share_id} + */ + readonly resourceShareId: string; +} +export interface DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissions { +} + +export function dataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsToTerraform(struct?: DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsToHclTerraform(struct?: DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // permission_id - computed: true, optional: false, required: false + public get permissionId() { + return this.getStringAttribute('permission_id'); + } + + // permission_name - computed: true, optional: false, required: false + public get permissionName() { + return this.getStringAttribute('permission_name'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsOutputReference { + return new DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions huaweicloud_ram_resource_share_associated_permissions} +*/ +export class DataHuaweicloudRamResourceShareAssociatedPermissions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_share_associated_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamResourceShareAssociatedPermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamResourceShareAssociatedPermissions to import + * @param importFromId The id of the existing DataHuaweicloudRamResourceShareAssociatedPermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamResourceShareAssociatedPermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_share_associated_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associated_permissions huaweicloud_ram_resource_share_associated_permissions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamResourceShareAssociatedPermissionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamResourceShareAssociatedPermissionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_share_associated_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._permissionName = config.permissionName; + this._region = config.region; + this._resourceShareId = config.resourceShareId; + } + + // ========== + // ATTRIBUTES + // ========== + + // associated_permissions - computed: true, optional: false, required: false + private _associatedPermissions = new DataHuaweicloudRamResourceShareAssociatedPermissionsAssociatedPermissionsList(this, "associated_permissions", false); + public get associatedPermissions() { + return this._associatedPermissions; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // permission_name - computed: false, optional: true, required: false + private _permissionName?: string; + public get permissionName() { + return this.getStringAttribute('permission_name'); + } + public set permissionName(value: string) { + this._permissionName = value; + } + public resetPermissionName() { + this._permissionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionNameInput() { + return this._permissionName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_share_id - computed: false, optional: false, required: true + private _resourceShareId?: string; + public get resourceShareId() { + return this.getStringAttribute('resource_share_id'); + } + public set resourceShareId(value: string) { + this._resourceShareId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceShareIdInput() { + return this._resourceShareId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + permission_name: cdktf.stringToTerraform(this._permissionName), + region: cdktf.stringToTerraform(this._region), + resource_share_id: cdktf.stringToTerraform(this._resourceShareId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_name: { + value: cdktf.stringToHclTerraform(this._permissionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_share_id: { + value: cdktf.stringToHclTerraform(this._resourceShareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/README.md new file mode 100644 index 00000000..1f658af5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_resource_share_associations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_resource_share_associations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/index.ts new file mode 100644 index 00000000..d2584321 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-associations/index.ts @@ -0,0 +1,444 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamResourceShareAssociationsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the association type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#association_type DataHuaweicloudRamResourceShareAssociations#association_type} + */ + readonly associationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#id DataHuaweicloudRamResourceShareAssociations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the principal associated with the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#principal DataHuaweicloudRamResourceShareAssociations#principal} + */ + readonly principal?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#region DataHuaweicloudRamResourceShareAssociations#region} + */ + readonly region?: string; + /** + * Specifies the list of resource IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#resource_ids DataHuaweicloudRamResourceShareAssociations#resource_ids} + */ + readonly resourceIds?: string[]; + /** + * Specifies the list of resource share IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#resource_share_ids DataHuaweicloudRamResourceShareAssociations#resource_share_ids} + */ + readonly resourceShareIds?: string[]; + /** + * Specifies the URN of the resource associated with the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#resource_urn DataHuaweicloudRamResourceShareAssociations#resource_urn} + */ + readonly resourceUrn?: string; + /** + * Specifies the status of the association. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#status DataHuaweicloudRamResourceShareAssociations#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudRamResourceShareAssociationsAssociations { +} + +export function dataHuaweicloudRamResourceShareAssociationsAssociationsToTerraform(struct?: DataHuaweicloudRamResourceShareAssociationsAssociations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamResourceShareAssociationsAssociationsToHclTerraform(struct?: DataHuaweicloudRamResourceShareAssociationsAssociations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamResourceShareAssociationsAssociationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamResourceShareAssociationsAssociations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamResourceShareAssociationsAssociations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated_entity - computed: true, optional: false, required: false + public get associatedEntity() { + return this.getStringAttribute('associated_entity'); + } + + // association_type - computed: true, optional: false, required: false + public get associationType() { + return this.getStringAttribute('association_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // external - computed: true, optional: false, required: false + public get external() { + return this.getBooleanAttribute('external'); + } + + // resource_share_id - computed: true, optional: false, required: false + public get resourceShareId() { + return this.getStringAttribute('resource_share_id'); + } + + // resource_share_name - computed: true, optional: false, required: false + public get resourceShareName() { + return this.getStringAttribute('resource_share_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_message - computed: true, optional: false, required: false + public get statusMessage() { + return this.getStringAttribute('status_message'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRamResourceShareAssociationsAssociationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamResourceShareAssociationsAssociationsOutputReference { + return new DataHuaweicloudRamResourceShareAssociationsAssociationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations huaweicloud_ram_resource_share_associations} +*/ +export class DataHuaweicloudRamResourceShareAssociations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_share_associations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamResourceShareAssociations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamResourceShareAssociations to import + * @param importFromId The id of the existing DataHuaweicloudRamResourceShareAssociations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamResourceShareAssociations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_share_associations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_associations huaweicloud_ram_resource_share_associations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamResourceShareAssociationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamResourceShareAssociationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_share_associations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._associationType = config.associationType; + this._id = config.id; + this._principal = config.principal; + this._region = config.region; + this._resourceIds = config.resourceIds; + this._resourceShareIds = config.resourceShareIds; + this._resourceUrn = config.resourceUrn; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // association_type - computed: false, optional: false, required: true + private _associationType?: string; + public get associationType() { + return this.getStringAttribute('association_type'); + } + public set associationType(value: string) { + this._associationType = value; + } + // Temporarily expose input value. Use with caution. + public get associationTypeInput() { + return this._associationType; + } + + // associations - computed: true, optional: false, required: false + private _associations = new DataHuaweicloudRamResourceShareAssociationsAssociationsList(this, "associations", false); + public get associations() { + return this._associations; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // principal - computed: false, optional: true, required: false + private _principal?: string; + public get principal() { + return this.getStringAttribute('principal'); + } + public set principal(value: string) { + this._principal = value; + } + public resetPrincipal() { + this._principal = undefined; + } + // Temporarily expose input value. Use with caution. + public get principalInput() { + return this._principal; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_ids - computed: false, optional: true, required: false + private _resourceIds?: string[]; + public get resourceIds() { + return this.getListAttribute('resource_ids'); + } + public set resourceIds(value: string[]) { + this._resourceIds = value; + } + public resetResourceIds() { + this._resourceIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdsInput() { + return this._resourceIds; + } + + // resource_share_ids - computed: false, optional: true, required: false + private _resourceShareIds?: string[]; + public get resourceShareIds() { + return this.getListAttribute('resource_share_ids'); + } + public set resourceShareIds(value: string[]) { + this._resourceShareIds = value; + } + public resetResourceShareIds() { + this._resourceShareIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceShareIdsInput() { + return this._resourceShareIds; + } + + // resource_urn - computed: false, optional: true, required: false + private _resourceUrn?: string; + public get resourceUrn() { + return this.getStringAttribute('resource_urn'); + } + public set resourceUrn(value: string) { + this._resourceUrn = value; + } + public resetResourceUrn() { + this._resourceUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceUrnInput() { + return this._resourceUrn; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + association_type: cdktf.stringToTerraform(this._associationType), + id: cdktf.stringToTerraform(this._id), + principal: cdktf.stringToTerraform(this._principal), + region: cdktf.stringToTerraform(this._region), + resource_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceIds), + resource_share_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceShareIds), + resource_urn: cdktf.stringToTerraform(this._resourceUrn), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + association_type: { + value: cdktf.stringToHclTerraform(this._associationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + principal: { + value: cdktf.stringToHclTerraform(this._principal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + resource_share_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceShareIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + resource_urn: { + value: cdktf.stringToHclTerraform(this._resourceUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/README.md new file mode 100644 index 00000000..e65c4d25 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_resource_share_invitations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_resource_share_invitations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/index.ts new file mode 100644 index 00000000..7c2729fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-share-invitations/index.ts @@ -0,0 +1,316 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamResourceShareInvitationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations#id DataHuaweicloudRamResourceShareInvitations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations#resource_share_ids DataHuaweicloudRamResourceShareInvitations#resource_share_ids} + */ + readonly resourceShareIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations#resource_share_invitation_ids DataHuaweicloudRamResourceShareInvitations#resource_share_invitation_ids} + */ + readonly resourceShareInvitationIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations#status DataHuaweicloudRamResourceShareInvitations#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudRamResourceShareInvitationsResourceShareInvitations { +} + +export function dataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsToTerraform(struct?: DataHuaweicloudRamResourceShareInvitationsResourceShareInvitations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsToHclTerraform(struct?: DataHuaweicloudRamResourceShareInvitationsResourceShareInvitations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamResourceShareInvitationsResourceShareInvitations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamResourceShareInvitationsResourceShareInvitations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // receiver_account_id - computed: true, optional: false, required: false + public get receiverAccountId() { + return this.getStringAttribute('receiver_account_id'); + } + + // resource_share_id - computed: true, optional: false, required: false + public get resourceShareId() { + return this.getStringAttribute('resource_share_id'); + } + + // resource_share_name - computed: true, optional: false, required: false + public get resourceShareName() { + return this.getStringAttribute('resource_share_name'); + } + + // sender_account_id - computed: true, optional: false, required: false + public get senderAccountId() { + return this.getStringAttribute('sender_account_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsOutputReference { + return new DataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations huaweicloud_ram_resource_share_invitations} +*/ +export class DataHuaweicloudRamResourceShareInvitations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_share_invitations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamResourceShareInvitations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamResourceShareInvitations to import + * @param importFromId The id of the existing DataHuaweicloudRamResourceShareInvitations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamResourceShareInvitations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_share_invitations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_share_invitations huaweicloud_ram_resource_share_invitations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamResourceShareInvitationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamResourceShareInvitationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_share_invitations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._resourceShareIds = config.resourceShareIds; + this._resourceShareInvitationIds = config.resourceShareInvitationIds; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // resource_share_ids - computed: false, optional: true, required: false + private _resourceShareIds?: string[]; + public get resourceShareIds() { + return this.getListAttribute('resource_share_ids'); + } + public set resourceShareIds(value: string[]) { + this._resourceShareIds = value; + } + public resetResourceShareIds() { + this._resourceShareIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceShareIdsInput() { + return this._resourceShareIds; + } + + // resource_share_invitation_ids - computed: false, optional: true, required: false + private _resourceShareInvitationIds?: string[]; + public get resourceShareInvitationIds() { + return this.getListAttribute('resource_share_invitation_ids'); + } + public set resourceShareInvitationIds(value: string[]) { + this._resourceShareInvitationIds = value; + } + public resetResourceShareInvitationIds() { + this._resourceShareInvitationIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceShareInvitationIdsInput() { + return this._resourceShareInvitationIds; + } + + // resource_share_invitations - computed: true, optional: false, required: false + private _resourceShareInvitations = new DataHuaweicloudRamResourceShareInvitationsResourceShareInvitationsList(this, "resource_share_invitations", false); + public get resourceShareInvitations() { + return this._resourceShareInvitations; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + resource_share_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceShareIds), + resource_share_invitation_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceShareInvitationIds), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_share_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceShareIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + resource_share_invitation_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceShareInvitationIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/README.md new file mode 100644 index 00000000..f320b88c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_resource_shares` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_resource_shares`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/index.ts new file mode 100644 index 00000000..e4a10e1c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-resource-shares/index.ts @@ -0,0 +1,595 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamResourceSharesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#id DataHuaweicloudRamResourceShares#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#name DataHuaweicloudRamResourceShares#name} + */ + readonly name?: string; + /** + * Specifies the permission ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#permission_id DataHuaweicloudRamResourceShares#permission_id} + */ + readonly permissionId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#region DataHuaweicloudRamResourceShares#region} + */ + readonly region?: string; + /** + * Specifies the owner type of resource sharing instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#resource_owner DataHuaweicloudRamResourceShares#resource_owner} + */ + readonly resourceOwner: string; + /** + * Specifies the list of resource share IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#resource_share_ids DataHuaweicloudRamResourceShares#resource_share_ids} + */ + readonly resourceShareIds?: string[]; + /** + * Specifies the status of the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#status DataHuaweicloudRamResourceShares#status} + */ + readonly status?: string; + /** + * tag_filters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#tag_filters DataHuaweicloudRamResourceShares#tag_filters} + */ + readonly tagFilters?: DataHuaweicloudRamResourceSharesTagFilters[] | cdktf.IResolvable; +} +export interface DataHuaweicloudRamResourceSharesResourceShares { +} + +export function dataHuaweicloudRamResourceSharesResourceSharesToTerraform(struct?: DataHuaweicloudRamResourceSharesResourceShares): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamResourceSharesResourceSharesToHclTerraform(struct?: DataHuaweicloudRamResourceSharesResourceShares): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamResourceSharesResourceSharesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamResourceSharesResourceShares | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamResourceSharesResourceShares | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // allow_external_principals - computed: true, optional: false, required: false + public get allowExternalPrincipals() { + return this.getBooleanAttribute('allow_external_principals'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owning_account_id - computed: true, optional: false, required: false + public get owningAccountId() { + return this.getStringAttribute('owning_account_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRamResourceSharesResourceSharesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamResourceSharesResourceSharesOutputReference { + return new DataHuaweicloudRamResourceSharesResourceSharesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRamResourceSharesTagFilters { + /** + * Specifies the identifier or name of the tag key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#key DataHuaweicloudRamResourceShares#key} + */ + readonly key: string; + /** + * Specifies the list of values for the tag key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#values DataHuaweicloudRamResourceShares#values} + */ + readonly values?: string[]; +} + +export function dataHuaweicloudRamResourceSharesTagFiltersToTerraform(struct?: DataHuaweicloudRamResourceSharesTagFilters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function dataHuaweicloudRamResourceSharesTagFiltersToHclTerraform(struct?: DataHuaweicloudRamResourceSharesTagFilters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudRamResourceSharesTagFiltersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamResourceSharesTagFilters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamResourceSharesTagFilters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._values = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._values = value.values; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // values - computed: false, optional: true, required: false + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + public resetValues() { + this._values = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} + +export class DataHuaweicloudRamResourceSharesTagFiltersList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudRamResourceSharesTagFilters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamResourceSharesTagFiltersOutputReference { + return new DataHuaweicloudRamResourceSharesTagFiltersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares huaweicloud_ram_resource_shares} +*/ +export class DataHuaweicloudRamResourceShares extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_shares"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamResourceShares resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamResourceShares to import + * @param importFromId The id of the existing DataHuaweicloudRamResourceShares that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamResourceShares to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_shares", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_resource_shares huaweicloud_ram_resource_shares} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamResourceSharesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamResourceSharesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_shares', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._permissionId = config.permissionId; + this._region = config.region; + this._resourceOwner = config.resourceOwner; + this._resourceShareIds = config.resourceShareIds; + this._status = config.status; + this._tagFilters.internalValue = config.tagFilters; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permission_id - computed: false, optional: true, required: false + private _permissionId?: string; + public get permissionId() { + return this.getStringAttribute('permission_id'); + } + public set permissionId(value: string) { + this._permissionId = value; + } + public resetPermissionId() { + this._permissionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionIdInput() { + return this._permissionId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_owner - computed: false, optional: false, required: true + private _resourceOwner?: string; + public get resourceOwner() { + return this.getStringAttribute('resource_owner'); + } + public set resourceOwner(value: string) { + this._resourceOwner = value; + } + // Temporarily expose input value. Use with caution. + public get resourceOwnerInput() { + return this._resourceOwner; + } + + // resource_share_ids - computed: false, optional: true, required: false + private _resourceShareIds?: string[]; + public get resourceShareIds() { + return this.getListAttribute('resource_share_ids'); + } + public set resourceShareIds(value: string[]) { + this._resourceShareIds = value; + } + public resetResourceShareIds() { + this._resourceShareIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceShareIdsInput() { + return this._resourceShareIds; + } + + // resource_shares - computed: true, optional: false, required: false + private _resourceShares = new DataHuaweicloudRamResourceSharesResourceSharesList(this, "resource_shares", false); + public get resourceShares() { + return this._resourceShares; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tag_filters - computed: false, optional: true, required: false + private _tagFilters = new DataHuaweicloudRamResourceSharesTagFiltersList(this, "tag_filters", false); + public get tagFilters() { + return this._tagFilters; + } + public putTagFilters(value: DataHuaweicloudRamResourceSharesTagFilters[] | cdktf.IResolvable) { + this._tagFilters.internalValue = value; + } + public resetTagFilters() { + this._tagFilters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagFiltersInput() { + return this._tagFilters.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + permission_id: cdktf.stringToTerraform(this._permissionId), + region: cdktf.stringToTerraform(this._region), + resource_owner: cdktf.stringToTerraform(this._resourceOwner), + resource_share_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceShareIds), + status: cdktf.stringToTerraform(this._status), + tag_filters: cdktf.listMapper(dataHuaweicloudRamResourceSharesTagFiltersToTerraform, true)(this._tagFilters.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_id: { + value: cdktf.stringToHclTerraform(this._permissionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_owner: { + value: cdktf.stringToHclTerraform(this._resourceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_share_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceShareIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_filters: { + value: cdktf.listMapperHcl(dataHuaweicloudRamResourceSharesTagFiltersToHclTerraform, true)(this._tagFilters.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudRamResourceSharesTagFiltersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/README.md new file mode 100644 index 00000000..bb41bd59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_shared_principals` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_shared_principals`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/index.ts new file mode 100644 index 00000000..a3b5a054 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-principals/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamSharedPrincipalsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals#id DataHuaweicloudRamSharedPrincipals#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals#principal DataHuaweicloudRamSharedPrincipals#principal} + */ + readonly principal?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals#resource_owner DataHuaweicloudRamSharedPrincipals#resource_owner} + */ + readonly resourceOwner: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals#resource_share_id DataHuaweicloudRamSharedPrincipals#resource_share_id} + */ + readonly resourceShareId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals#resource_urn DataHuaweicloudRamSharedPrincipals#resource_urn} + */ + readonly resourceUrn?: string; +} +export interface DataHuaweicloudRamSharedPrincipalsSharedPrincipals { +} + +export function dataHuaweicloudRamSharedPrincipalsSharedPrincipalsToTerraform(struct?: DataHuaweicloudRamSharedPrincipalsSharedPrincipals): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamSharedPrincipalsSharedPrincipalsToHclTerraform(struct?: DataHuaweicloudRamSharedPrincipalsSharedPrincipals): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamSharedPrincipalsSharedPrincipalsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamSharedPrincipalsSharedPrincipals | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamSharedPrincipalsSharedPrincipals | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // resource_share_id - computed: true, optional: false, required: false + public get resourceShareId() { + return this.getStringAttribute('resource_share_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRamSharedPrincipalsSharedPrincipalsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamSharedPrincipalsSharedPrincipalsOutputReference { + return new DataHuaweicloudRamSharedPrincipalsSharedPrincipalsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals huaweicloud_ram_shared_principals} +*/ +export class DataHuaweicloudRamSharedPrincipals extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_shared_principals"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamSharedPrincipals resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamSharedPrincipals to import + * @param importFromId The id of the existing DataHuaweicloudRamSharedPrincipals that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamSharedPrincipals to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_shared_principals", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_principals huaweicloud_ram_shared_principals} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamSharedPrincipalsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamSharedPrincipalsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_shared_principals', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._principal = config.principal; + this._resourceOwner = config.resourceOwner; + this._resourceShareId = config.resourceShareId; + this._resourceUrn = config.resourceUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // principal - computed: false, optional: true, required: false + private _principal?: string; + public get principal() { + return this.getStringAttribute('principal'); + } + public set principal(value: string) { + this._principal = value; + } + public resetPrincipal() { + this._principal = undefined; + } + // Temporarily expose input value. Use with caution. + public get principalInput() { + return this._principal; + } + + // resource_owner - computed: false, optional: false, required: true + private _resourceOwner?: string; + public get resourceOwner() { + return this.getStringAttribute('resource_owner'); + } + public set resourceOwner(value: string) { + this._resourceOwner = value; + } + // Temporarily expose input value. Use with caution. + public get resourceOwnerInput() { + return this._resourceOwner; + } + + // resource_share_id - computed: false, optional: true, required: false + private _resourceShareId?: string; + public get resourceShareId() { + return this.getStringAttribute('resource_share_id'); + } + public set resourceShareId(value: string) { + this._resourceShareId = value; + } + public resetResourceShareId() { + this._resourceShareId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceShareIdInput() { + return this._resourceShareId; + } + + // resource_urn - computed: false, optional: true, required: false + private _resourceUrn?: string; + public get resourceUrn() { + return this.getStringAttribute('resource_urn'); + } + public set resourceUrn(value: string) { + this._resourceUrn = value; + } + public resetResourceUrn() { + this._resourceUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceUrnInput() { + return this._resourceUrn; + } + + // shared_principals - computed: true, optional: false, required: false + private _sharedPrincipals = new DataHuaweicloudRamSharedPrincipalsSharedPrincipalsList(this, "shared_principals", false); + public get sharedPrincipals() { + return this._sharedPrincipals; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + principal: cdktf.stringToTerraform(this._principal), + resource_owner: cdktf.stringToTerraform(this._resourceOwner), + resource_share_id: cdktf.stringToTerraform(this._resourceShareId), + resource_urn: cdktf.stringToTerraform(this._resourceUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + principal: { + value: cdktf.stringToHclTerraform(this._principal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_owner: { + value: cdktf.stringToHclTerraform(this._resourceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_share_id: { + value: cdktf.stringToHclTerraform(this._resourceShareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_urn: { + value: cdktf.stringToHclTerraform(this._resourceUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/README.md new file mode 100644 index 00000000..faef97fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_ram_shared_resources` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_ram_shared_resources`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/index.ts new file mode 100644 index 00000000..4e1e456f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-ram-shared-resources/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRamSharedResourcesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#id DataHuaweicloudRamSharedResources#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#principal DataHuaweicloudRamSharedResources#principal} + */ + readonly principal?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#resource_ids DataHuaweicloudRamSharedResources#resource_ids} + */ + readonly resourceIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#resource_owner DataHuaweicloudRamSharedResources#resource_owner} + */ + readonly resourceOwner: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#resource_region DataHuaweicloudRamSharedResources#resource_region} + */ + readonly resourceRegion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#resource_share_ids DataHuaweicloudRamSharedResources#resource_share_ids} + */ + readonly resourceShareIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#resource_type DataHuaweicloudRamSharedResources#resource_type} + */ + readonly resourceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#resource_urns DataHuaweicloudRamSharedResources#resource_urns} + */ + readonly resourceUrns?: string[]; +} +export interface DataHuaweicloudRamSharedResourcesSharedResources { +} + +export function dataHuaweicloudRamSharedResourcesSharedResourcesToTerraform(struct?: DataHuaweicloudRamSharedResourcesSharedResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRamSharedResourcesSharedResourcesToHclTerraform(struct?: DataHuaweicloudRamSharedResourcesSharedResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRamSharedResourcesSharedResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRamSharedResourcesSharedResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRamSharedResourcesSharedResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // resource_share_id - computed: true, optional: false, required: false + public get resourceShareId() { + return this.getStringAttribute('resource_share_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // resource_urn - computed: true, optional: false, required: false + public get resourceUrn() { + return this.getStringAttribute('resource_urn'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRamSharedResourcesSharedResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRamSharedResourcesSharedResourcesOutputReference { + return new DataHuaweicloudRamSharedResourcesSharedResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources huaweicloud_ram_shared_resources} +*/ +export class DataHuaweicloudRamSharedResources extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_shared_resources"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRamSharedResources resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRamSharedResources to import + * @param importFromId The id of the existing DataHuaweicloudRamSharedResources that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRamSharedResources to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_shared_resources", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/ram_shared_resources huaweicloud_ram_shared_resources} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRamSharedResourcesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRamSharedResourcesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_shared_resources', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._principal = config.principal; + this._resourceIds = config.resourceIds; + this._resourceOwner = config.resourceOwner; + this._resourceRegion = config.resourceRegion; + this._resourceShareIds = config.resourceShareIds; + this._resourceType = config.resourceType; + this._resourceUrns = config.resourceUrns; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // principal - computed: false, optional: true, required: false + private _principal?: string; + public get principal() { + return this.getStringAttribute('principal'); + } + public set principal(value: string) { + this._principal = value; + } + public resetPrincipal() { + this._principal = undefined; + } + // Temporarily expose input value. Use with caution. + public get principalInput() { + return this._principal; + } + + // resource_ids - computed: false, optional: true, required: false + private _resourceIds?: string[]; + public get resourceIds() { + return this.getListAttribute('resource_ids'); + } + public set resourceIds(value: string[]) { + this._resourceIds = value; + } + public resetResourceIds() { + this._resourceIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdsInput() { + return this._resourceIds; + } + + // resource_owner - computed: false, optional: false, required: true + private _resourceOwner?: string; + public get resourceOwner() { + return this.getStringAttribute('resource_owner'); + } + public set resourceOwner(value: string) { + this._resourceOwner = value; + } + // Temporarily expose input value. Use with caution. + public get resourceOwnerInput() { + return this._resourceOwner; + } + + // resource_region - computed: false, optional: true, required: false + private _resourceRegion?: string; + public get resourceRegion() { + return this.getStringAttribute('resource_region'); + } + public set resourceRegion(value: string) { + this._resourceRegion = value; + } + public resetResourceRegion() { + this._resourceRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceRegionInput() { + return this._resourceRegion; + } + + // resource_share_ids - computed: false, optional: true, required: false + private _resourceShareIds?: string[]; + public get resourceShareIds() { + return this.getListAttribute('resource_share_ids'); + } + public set resourceShareIds(value: string[]) { + this._resourceShareIds = value; + } + public resetResourceShareIds() { + this._resourceShareIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceShareIdsInput() { + return this._resourceShareIds; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // resource_urns - computed: false, optional: true, required: false + private _resourceUrns?: string[]; + public get resourceUrns() { + return this.getListAttribute('resource_urns'); + } + public set resourceUrns(value: string[]) { + this._resourceUrns = value; + } + public resetResourceUrns() { + this._resourceUrns = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceUrnsInput() { + return this._resourceUrns; + } + + // shared_resources - computed: true, optional: false, required: false + private _sharedResources = new DataHuaweicloudRamSharedResourcesSharedResourcesList(this, "shared_resources", false); + public get sharedResources() { + return this._sharedResources; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + principal: cdktf.stringToTerraform(this._principal), + resource_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceIds), + resource_owner: cdktf.stringToTerraform(this._resourceOwner), + resource_region: cdktf.stringToTerraform(this._resourceRegion), + resource_share_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceShareIds), + resource_type: cdktf.stringToTerraform(this._resourceType), + resource_urns: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceUrns), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + principal: { + value: cdktf.stringToHclTerraform(this._principal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + resource_owner: { + value: cdktf.stringToHclTerraform(this._resourceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_region: { + value: cdktf.stringToHclTerraform(this._resourceRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_share_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceShareIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_urns: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceUrns), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/README.md new file mode 100644 index 00000000..065a8390 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_backups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_backups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/index.ts new file mode 100644 index 00000000..83c974df --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-backups/index.ts @@ -0,0 +1,609 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsBackupsConfig extends cdktf.TerraformMetaArguments { + /** + * Backup ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#backup_id DataHuaweicloudRdsBackups#backup_id} + */ + readonly backupId?: string; + /** + * Backup type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#backup_type DataHuaweicloudRdsBackups#backup_type} + */ + readonly backupType?: string; + /** + * Start time in the "yyyy-mm-ddThh:mm:ssZ" format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#begin_time DataHuaweicloudRdsBackups#begin_time} + */ + readonly beginTime?: string; + /** + * End time in the "yyyy-mm-ddThh:mm:ssZ" format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#end_time DataHuaweicloudRdsBackups#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#id DataHuaweicloudRdsBackups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#instance_id DataHuaweicloudRdsBackups#instance_id} + */ + readonly instanceId: string; + /** + * Backup name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#name DataHuaweicloudRdsBackups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#region DataHuaweicloudRdsBackups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsBackupsBackupsDatabases { +} + +export function dataHuaweicloudRdsBackupsBackupsDatabasesToTerraform(struct?: DataHuaweicloudRdsBackupsBackupsDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsBackupsBackupsDatabasesToHclTerraform(struct?: DataHuaweicloudRdsBackupsBackupsDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsBackupsBackupsDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsBackupsBackupsDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsBackupsBackupsDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsBackupsBackupsDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsBackupsBackupsDatabasesOutputReference { + return new DataHuaweicloudRdsBackupsBackupsDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsBackupsBackupsDatastore { +} + +export function dataHuaweicloudRdsBackupsBackupsDatastoreToTerraform(struct?: DataHuaweicloudRdsBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsBackupsBackupsDatastoreToHclTerraform(struct?: DataHuaweicloudRdsBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsBackupsBackupsDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsBackupsBackupsDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsBackupsBackupsDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudRdsBackupsBackupsDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsBackupsBackupsDatastoreOutputReference { + return new DataHuaweicloudRdsBackupsBackupsDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsBackupsBackups { +} + +export function dataHuaweicloudRdsBackupsBackupsToTerraform(struct?: DataHuaweicloudRdsBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsBackupsBackupsToHclTerraform(struct?: DataHuaweicloudRdsBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsBackupsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsBackupsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsBackupsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated_with_ddm - computed: true, optional: false, required: false + public get associatedWithDdm() { + return this.getBooleanAttribute('associated_with_ddm'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsBackupsBackupsDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudRdsBackupsBackupsDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRdsBackupsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsBackupsBackupsOutputReference { + return new DataHuaweicloudRdsBackupsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups huaweicloud_rds_backups} +*/ +export class DataHuaweicloudRdsBackups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_backups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsBackups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsBackups to import + * @param importFromId The id of the existing DataHuaweicloudRdsBackups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsBackups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_backups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_backups huaweicloud_rds_backups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsBackupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsBackupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_backups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._backupType = config.backupType; + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudRdsBackupsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + backup_type: cdktf.stringToTerraform(this._backupType), + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/README.md new file mode 100644 index 00000000..f43dec97 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_cross_region_backup_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_cross_region_backup_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/index.ts new file mode 100644 index 00000000..c6ad364c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backup-instances/index.ts @@ -0,0 +1,553 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsCrossRegionBackupInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the project ID of the target backup region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#destination_project_id DataHuaweicloudRdsCrossRegionBackupInstances#destination_project_id} + */ + readonly destinationProjectId?: string; + /** + * Specifies the region where the cross-region backup is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#destination_region DataHuaweicloudRdsCrossRegionBackupInstances#destination_region} + */ + readonly destinationRegion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#id DataHuaweicloudRdsCrossRegionBackupInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#instance_id DataHuaweicloudRdsCrossRegionBackupInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the number of days to retain cross-region backups. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#keep_days DataHuaweicloudRdsCrossRegionBackupInstances#keep_days} + */ + readonly keepDays?: number; + /** + * Specifies the name of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#name DataHuaweicloudRdsCrossRegionBackupInstances#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#region DataHuaweicloudRdsCrossRegionBackupInstances#region} + */ + readonly region?: string; + /** + * Specifies the project ID of the source backup region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#source_project_id DataHuaweicloudRdsCrossRegionBackupInstances#source_project_id} + */ + readonly sourceProjectId?: string; + /** + * Specifies the source backup region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#source_region DataHuaweicloudRdsCrossRegionBackupInstances#source_region} + */ + readonly sourceRegion?: string; +} +export interface DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastore { +} + +export function dataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreToTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreToHclTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreOutputReference { + return new DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstances { +} + +export function dataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesToTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesToHclTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // destination_project_id - computed: true, optional: false, required: false + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + + // destination_region - computed: true, optional: false, required: false + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // source_project_id - computed: true, optional: false, required: false + public get sourceProjectId() { + return this.getStringAttribute('source_project_id'); + } + + // source_region - computed: true, optional: false, required: false + public get sourceRegion() { + return this.getStringAttribute('source_region'); + } +} + +export class DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesOutputReference { + return new DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances huaweicloud_rds_cross_region_backup_instances} +*/ +export class DataHuaweicloudRdsCrossRegionBackupInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_cross_region_backup_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsCrossRegionBackupInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsCrossRegionBackupInstances to import + * @param importFromId The id of the existing DataHuaweicloudRdsCrossRegionBackupInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsCrossRegionBackupInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_cross_region_backup_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backup_instances huaweicloud_rds_cross_region_backup_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsCrossRegionBackupInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsCrossRegionBackupInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_cross_region_backup_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destinationProjectId = config.destinationProjectId; + this._destinationRegion = config.destinationRegion; + this._id = config.id; + this._instanceId = config.instanceId; + this._keepDays = config.keepDays; + this._name = config.name; + this._region = config.region; + this._sourceProjectId = config.sourceProjectId; + this._sourceRegion = config.sourceRegion; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_instances - computed: true, optional: false, required: false + private _backupInstances = new DataHuaweicloudRdsCrossRegionBackupInstancesBackupInstancesList(this, "backup_instances", false); + public get backupInstances() { + return this._backupInstances; + } + + // destination_project_id - computed: false, optional: true, required: false + private _destinationProjectId?: string; + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + public set destinationProjectId(value: string) { + this._destinationProjectId = value; + } + public resetDestinationProjectId() { + this._destinationProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationProjectIdInput() { + return this._destinationProjectId; + } + + // destination_region - computed: false, optional: true, required: false + private _destinationRegion?: string; + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + public set destinationRegion(value: string) { + this._destinationRegion = value; + } + public resetDestinationRegion() { + this._destinationRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationRegionInput() { + return this._destinationRegion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keep_days - computed: false, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_project_id - computed: false, optional: true, required: false + private _sourceProjectId?: string; + public get sourceProjectId() { + return this.getStringAttribute('source_project_id'); + } + public set sourceProjectId(value: string) { + this._sourceProjectId = value; + } + public resetSourceProjectId() { + this._sourceProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceProjectIdInput() { + return this._sourceProjectId; + } + + // source_region - computed: false, optional: true, required: false + private _sourceRegion?: string; + public get sourceRegion() { + return this.getStringAttribute('source_region'); + } + public set sourceRegion(value: string) { + this._sourceRegion = value; + } + public resetSourceRegion() { + this._sourceRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceRegionInput() { + return this._sourceRegion; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination_project_id: cdktf.stringToTerraform(this._destinationProjectId), + destination_region: cdktf.stringToTerraform(this._destinationRegion), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keep_days: cdktf.numberToTerraform(this._keepDays), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_project_id: cdktf.stringToTerraform(this._sourceProjectId), + source_region: cdktf.stringToTerraform(this._sourceRegion), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination_project_id: { + value: cdktf.stringToHclTerraform(this._destinationProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_region: { + value: cdktf.stringToHclTerraform(this._destinationRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_days: { + value: cdktf.numberToHclTerraform(this._keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_project_id: { + value: cdktf.stringToHclTerraform(this._sourceProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_region: { + value: cdktf.stringToHclTerraform(this._sourceRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/README.md new file mode 100644 index 00000000..ae1d06d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_cross_region_backups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_cross_region_backups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/index.ts new file mode 100644 index 00000000..08c68523 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-cross-region-backups/index.ts @@ -0,0 +1,638 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsCrossRegionBackupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the cross-region backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#backup_id DataHuaweicloudRdsCrossRegionBackups#backup_id} + */ + readonly backupId?: string; + /** + * Specifies the type of the cross-region backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#backup_type DataHuaweicloudRdsCrossRegionBackups#backup_type} + */ + readonly backupType: string; + /** + * Specifies the start time for obtaining the cross-region backup list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#begin_time DataHuaweicloudRdsCrossRegionBackups#begin_time} + */ + readonly beginTime?: string; + /** + * Specifies the end time for obtaining the cross-region backup list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#end_time DataHuaweicloudRdsCrossRegionBackups#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#id DataHuaweicloudRdsCrossRegionBackups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#instance_id DataHuaweicloudRdsCrossRegionBackups#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the cross-region backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#name DataHuaweicloudRdsCrossRegionBackups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#region DataHuaweicloudRdsCrossRegionBackups#region} + */ + readonly region?: string; + /** + * Specifies the status of the cross-region backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#status DataHuaweicloudRdsCrossRegionBackups#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudRdsCrossRegionBackupsBackupsDatabases { +} + +export function dataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesToTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupsBackupsDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesToHclTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupsBackupsDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsCrossRegionBackupsBackupsDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsCrossRegionBackupsBackupsDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesOutputReference { + return new DataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsCrossRegionBackupsBackupsDatastore { +} + +export function dataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreToTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreToHclTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupsBackupsDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsCrossRegionBackupsBackupsDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsCrossRegionBackupsBackupsDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreOutputReference { + return new DataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsCrossRegionBackupsBackups { +} + +export function dataHuaweicloudRdsCrossRegionBackupsBackupsToTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsCrossRegionBackupsBackupsToHclTerraform(struct?: DataHuaweicloudRdsCrossRegionBackupsBackups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsCrossRegionBackupsBackupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsCrossRegionBackupsBackups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsCrossRegionBackupsBackups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated_with_ddm - computed: true, optional: false, required: false + public get associatedWithDdm() { + return this.getBooleanAttribute('associated_with_ddm'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsCrossRegionBackupsBackupsDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DataHuaweicloudRdsCrossRegionBackupsBackupsDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRdsCrossRegionBackupsBackupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsCrossRegionBackupsBackupsOutputReference { + return new DataHuaweicloudRdsCrossRegionBackupsBackupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups huaweicloud_rds_cross_region_backups} +*/ +export class DataHuaweicloudRdsCrossRegionBackups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_cross_region_backups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsCrossRegionBackups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsCrossRegionBackups to import + * @param importFromId The id of the existing DataHuaweicloudRdsCrossRegionBackups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsCrossRegionBackups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_cross_region_backups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_cross_region_backups huaweicloud_rds_cross_region_backups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsCrossRegionBackupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsCrossRegionBackupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_cross_region_backups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._backupType = config.backupType; + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // backup_type - computed: false, optional: false, required: true + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // backups - computed: true, optional: false, required: false + private _backups = new DataHuaweicloudRdsCrossRegionBackupsBackupsList(this, "backups", false); + public get backups() { + return this._backups; + } + + // begin_time - computed: false, optional: true, required: false + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + public resetBeginTime() { + this._beginTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + backup_type: cdktf.stringToTerraform(this._backupType), + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/README.md new file mode 100644 index 00000000..a73652ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_engine_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_engine_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/index.ts new file mode 100644 index 00000000..36bc1072 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-engine-versions/index.ts @@ -0,0 +1,258 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsEngineVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions#id DataHuaweicloudRdsEngineVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions#region DataHuaweicloudRdsEngineVersions#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions#type DataHuaweicloudRdsEngineVersions#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudRdsEngineVersionsVersions { +} + +export function dataHuaweicloudRdsEngineVersionsVersionsToTerraform(struct?: DataHuaweicloudRdsEngineVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsEngineVersionsVersionsToHclTerraform(struct?: DataHuaweicloudRdsEngineVersionsVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsEngineVersionsVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsEngineVersionsVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsEngineVersionsVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsEngineVersionsVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsEngineVersionsVersionsOutputReference { + return new DataHuaweicloudRdsEngineVersionsVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions huaweicloud_rds_engine_versions} +*/ +export class DataHuaweicloudRdsEngineVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_engine_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsEngineVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsEngineVersions to import + * @param importFromId The id of the existing DataHuaweicloudRdsEngineVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsEngineVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_engine_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_engine_versions huaweicloud_rds_engine_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsEngineVersionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsEngineVersionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_engine_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // versions - computed: true, optional: false, required: false + private _versions = new DataHuaweicloudRdsEngineVersionsVersionsList(this, "versions", false); + public get versions() { + return this._versions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/README.md new file mode 100644 index 00000000..0433839b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_error_log_link` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_error_log_link`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/index.ts new file mode 100644 index 00000000..0b75a20d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-log-link/index.ts @@ -0,0 +1,315 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsErrorLogLinkConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link#id DataHuaweicloudRdsErrorLogLink#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link#instance_id DataHuaweicloudRdsErrorLogLink#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link#region DataHuaweicloudRdsErrorLogLink#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link#timeouts DataHuaweicloudRdsErrorLogLink#timeouts} + */ + readonly timeouts?: DataHuaweicloudRdsErrorLogLinkTimeouts; +} +export interface DataHuaweicloudRdsErrorLogLinkTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link#read DataHuaweicloudRdsErrorLogLink#read} + */ + readonly read?: string; +} + +export function dataHuaweicloudRdsErrorLogLinkTimeoutsToTerraform(struct?: DataHuaweicloudRdsErrorLogLinkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + read: cdktf.stringToTerraform(struct!.read), + } +} + + +export function dataHuaweicloudRdsErrorLogLinkTimeoutsToHclTerraform(struct?: DataHuaweicloudRdsErrorLogLinkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + read: { + value: cdktf.stringToHclTerraform(struct!.read), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudRdsErrorLogLinkTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataHuaweicloudRdsErrorLogLinkTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._read !== undefined) { + hasAnyValues = true; + internalValueResult.read = this._read; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsErrorLogLinkTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._read = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._read = value.read; + } + } + + // read - computed: false, optional: true, required: false + private _read?: string; + public get read() { + return this.getStringAttribute('read'); + } + public set read(value: string) { + this._read = value; + } + public resetRead() { + this._read = undefined; + } + // Temporarily expose input value. Use with caution. + public get readInput() { + return this._read; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link huaweicloud_rds_error_log_link} +*/ +export class DataHuaweicloudRdsErrorLogLink extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_error_log_link"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsErrorLogLink resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsErrorLogLink to import + * @param importFromId The id of the existing DataHuaweicloudRdsErrorLogLink that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsErrorLogLink to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_error_log_link", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_log_link huaweicloud_rds_error_log_link} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsErrorLogLinkConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsErrorLogLinkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_error_log_link', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getNumberAttribute('created_at'); + } + + // file_link - computed: true, optional: false, required: false + public get fileLink() { + return this.getStringAttribute('file_link'); + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataHuaweicloudRdsErrorLogLinkTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataHuaweicloudRdsErrorLogLinkTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dataHuaweicloudRdsErrorLogLinkTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataHuaweicloudRdsErrorLogLinkTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataHuaweicloudRdsErrorLogLinkTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/README.md new file mode 100644 index 00000000..d7adc41c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_error_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_error_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/index.ts new file mode 100644 index 00000000..38af8538 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-error-logs/index.ts @@ -0,0 +1,348 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsErrorLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#end_time DataHuaweicloudRdsErrorLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#id DataHuaweicloudRdsErrorLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#instance_id DataHuaweicloudRdsErrorLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the log level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#level DataHuaweicloudRdsErrorLogs#level} + */ + readonly level?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#region DataHuaweicloudRdsErrorLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#start_time DataHuaweicloudRdsErrorLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudRdsErrorLogsErrorLogs { +} + +export function dataHuaweicloudRdsErrorLogsErrorLogsToTerraform(struct?: DataHuaweicloudRdsErrorLogsErrorLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsErrorLogsErrorLogsToHclTerraform(struct?: DataHuaweicloudRdsErrorLogsErrorLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsErrorLogsErrorLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsErrorLogsErrorLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsErrorLogsErrorLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } +} + +export class DataHuaweicloudRdsErrorLogsErrorLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsErrorLogsErrorLogsOutputReference { + return new DataHuaweicloudRdsErrorLogsErrorLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs huaweicloud_rds_error_logs} +*/ +export class DataHuaweicloudRdsErrorLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_error_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsErrorLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsErrorLogs to import + * @param importFromId The id of the existing DataHuaweicloudRdsErrorLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsErrorLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_error_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_error_logs huaweicloud_rds_error_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsErrorLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsErrorLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_error_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._level = config.level; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // error_logs - computed: true, optional: false, required: false + private _errorLogs = new DataHuaweicloudRdsErrorLogsErrorLogsList(this, "error_logs", false); + public get errorLogs() { + return this._errorLogs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // level - computed: false, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + level: cdktf.stringToTerraform(this._level), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/README.md new file mode 100644 index 00000000..5f278bdf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_extend_log_files` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_extend_log_files`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/index.ts new file mode 100644 index 00000000..e6c81b29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-files/index.ts @@ -0,0 +1,259 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsExtendLogFilesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files#id DataHuaweicloudRdsExtendLogFiles#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files#instance_id DataHuaweicloudRdsExtendLogFiles#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files#region DataHuaweicloudRdsExtendLogFiles#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsExtendLogFilesFiles { +} + +export function dataHuaweicloudRdsExtendLogFilesFilesToTerraform(struct?: DataHuaweicloudRdsExtendLogFilesFiles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsExtendLogFilesFilesToHclTerraform(struct?: DataHuaweicloudRdsExtendLogFilesFiles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsExtendLogFilesFilesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsExtendLogFilesFiles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsExtendLogFilesFiles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } +} + +export class DataHuaweicloudRdsExtendLogFilesFilesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsExtendLogFilesFilesOutputReference { + return new DataHuaweicloudRdsExtendLogFilesFilesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files huaweicloud_rds_extend_log_files} +*/ +export class DataHuaweicloudRdsExtendLogFiles extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_extend_log_files"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsExtendLogFiles resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsExtendLogFiles to import + * @param importFromId The id of the existing DataHuaweicloudRdsExtendLogFiles that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsExtendLogFiles to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_extend_log_files", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_files huaweicloud_rds_extend_log_files} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsExtendLogFilesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsExtendLogFilesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_extend_log_files', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // files - computed: true, optional: false, required: false + private _files = new DataHuaweicloudRdsExtendLogFilesFilesList(this, "files", false); + public get files() { + return this._files; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/README.md new file mode 100644 index 00000000..75db96c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_extend_log_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_extend_log_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/index.ts new file mode 100644 index 00000000..96f4355f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-extend-log-links/index.ts @@ -0,0 +1,428 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsExtendLogLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the file to be downloaded. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#file_name DataHuaweicloudRdsExtendLogLinks#file_name} + */ + readonly fileName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#id DataHuaweicloudRdsExtendLogLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#instance_id DataHuaweicloudRdsExtendLogLinks#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#region DataHuaweicloudRdsExtendLogLinks#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#timeouts DataHuaweicloudRdsExtendLogLinks#timeouts} + */ + readonly timeouts?: DataHuaweicloudRdsExtendLogLinksTimeouts; +} +export interface DataHuaweicloudRdsExtendLogLinksLinks { +} + +export function dataHuaweicloudRdsExtendLogLinksLinksToTerraform(struct?: DataHuaweicloudRdsExtendLogLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsExtendLogLinksLinksToHclTerraform(struct?: DataHuaweicloudRdsExtendLogLinksLinks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsExtendLogLinksLinksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsExtendLogLinksLinks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsExtendLogLinksLinks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // file_link - computed: true, optional: false, required: false + public get fileLink() { + return this.getStringAttribute('file_link'); + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRdsExtendLogLinksLinksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsExtendLogLinksLinksOutputReference { + return new DataHuaweicloudRdsExtendLogLinksLinksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsExtendLogLinksTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#create DataHuaweicloudRdsExtendLogLinks#create} + */ + readonly create?: string; +} + +export function dataHuaweicloudRdsExtendLogLinksTimeoutsToTerraform(struct?: DataHuaweicloudRdsExtendLogLinksTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dataHuaweicloudRdsExtendLogLinksTimeoutsToHclTerraform(struct?: DataHuaweicloudRdsExtendLogLinksTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudRdsExtendLogLinksTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataHuaweicloudRdsExtendLogLinksTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsExtendLogLinksTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links huaweicloud_rds_extend_log_links} +*/ +export class DataHuaweicloudRdsExtendLogLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_extend_log_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsExtendLogLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsExtendLogLinks to import + * @param importFromId The id of the existing DataHuaweicloudRdsExtendLogLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsExtendLogLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_extend_log_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_extend_log_links huaweicloud_rds_extend_log_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsExtendLogLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsExtendLogLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_extend_log_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fileName = config.fileName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // file_name - computed: false, optional: false, required: true + private _fileName?: string; + public get fileName() { + return this.getStringAttribute('file_name'); + } + public set fileName(value: string) { + this._fileName = value; + } + // Temporarily expose input value. Use with caution. + public get fileNameInput() { + return this._fileName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // links - computed: true, optional: false, required: false + private _links = new DataHuaweicloudRdsExtendLogLinksLinksList(this, "links", false); + public get links() { + return this._links; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataHuaweicloudRdsExtendLogLinksTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataHuaweicloudRdsExtendLogLinksTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + file_name: cdktf.stringToTerraform(this._fileName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dataHuaweicloudRdsExtendLogLinksTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + file_name: { + value: cdktf.stringToHclTerraform(this._fileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataHuaweicloudRdsExtendLogLinksTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataHuaweicloudRdsExtendLogLinksTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/README.md new file mode 100644 index 00000000..0587dd96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_flavors_v3` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_flavors_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/index.ts new file mode 100644 index 00000000..bd1d6fdb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors-v3/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsFlavorsV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#availability_zone DataHuaweicloudRdsFlavorsV3#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#db_type DataHuaweicloudRdsFlavorsV3#db_type} + */ + readonly dbType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#db_version DataHuaweicloudRdsFlavorsV3#db_version} + */ + readonly dbVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#group_type DataHuaweicloudRdsFlavorsV3#group_type} + */ + readonly groupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#id DataHuaweicloudRdsFlavorsV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#instance_mode DataHuaweicloudRdsFlavorsV3#instance_mode} + */ + readonly instanceMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#memory DataHuaweicloudRdsFlavorsV3#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#region DataHuaweicloudRdsFlavorsV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#vcpus DataHuaweicloudRdsFlavorsV3#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudRdsFlavorsV3Flavors { +} + +export function dataHuaweicloudRdsFlavorsV3FlavorsToTerraform(struct?: DataHuaweicloudRdsFlavorsV3Flavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsFlavorsV3FlavorsToHclTerraform(struct?: DataHuaweicloudRdsFlavorsV3Flavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsFlavorsV3FlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsFlavorsV3Flavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsFlavorsV3Flavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // db_versions - computed: true, optional: false, required: false + public get dbVersions() { + return this.getListAttribute('db_versions'); + } + + // group_type - computed: true, optional: false, required: false + public get groupType() { + return this.getStringAttribute('group_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_mode - computed: true, optional: false, required: false + public get instanceMode() { + return this.getStringAttribute('instance_mode'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudRdsFlavorsV3FlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsFlavorsV3FlavorsOutputReference { + return new DataHuaweicloudRdsFlavorsV3FlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3 huaweicloud_rds_flavors_v3} +*/ +export class DataHuaweicloudRdsFlavorsV3 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_flavors_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsFlavorsV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsFlavorsV3 to import + * @param importFromId The id of the existing DataHuaweicloudRdsFlavorsV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsFlavorsV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_flavors_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors_v3 huaweicloud_rds_flavors_v3} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsFlavorsV3Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsFlavorsV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_flavors_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._dbType = config.dbType; + this._dbVersion = config.dbVersion; + this._groupType = config.groupType; + this._id = config.id; + this._instanceMode = config.instanceMode; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // db_type - computed: false, optional: false, required: true + private _dbType?: string; + public get dbType() { + return this.getStringAttribute('db_type'); + } + public set dbType(value: string) { + this._dbType = value; + } + // Temporarily expose input value. Use with caution. + public get dbTypeInput() { + return this._dbType; + } + + // db_version - computed: false, optional: true, required: false + private _dbVersion?: string; + public get dbVersion() { + return this.getStringAttribute('db_version'); + } + public set dbVersion(value: string) { + this._dbVersion = value; + } + public resetDbVersion() { + this._dbVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get dbVersionInput() { + return this._dbVersion; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudRdsFlavorsV3FlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // group_type - computed: false, optional: true, required: false + private _groupType?: string; + public get groupType() { + return this.getStringAttribute('group_type'); + } + public set groupType(value: string) { + this._groupType = value; + } + public resetGroupType() { + this._groupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupTypeInput() { + return this._groupType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_mode - computed: false, optional: true, required: false + private _instanceMode?: string; + public get instanceMode() { + return this.getStringAttribute('instance_mode'); + } + public set instanceMode(value: string) { + this._instanceMode = value; + } + public resetInstanceMode() { + this._instanceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceModeInput() { + return this._instanceMode; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + db_type: cdktf.stringToTerraform(this._dbType), + db_version: cdktf.stringToTerraform(this._dbVersion), + group_type: cdktf.stringToTerraform(this._groupType), + id: cdktf.stringToTerraform(this._id), + instance_mode: cdktf.stringToTerraform(this._instanceMode), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_type: { + value: cdktf.stringToHclTerraform(this._dbType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_version: { + value: cdktf.stringToHclTerraform(this._dbVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_type: { + value: cdktf.stringToHclTerraform(this._groupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_mode: { + value: cdktf.stringToHclTerraform(this._instanceMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/README.md new file mode 100644 index 00000000..ea21ebe2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/index.ts new file mode 100644 index 00000000..929229f0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-flavors/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#availability_zone DataHuaweicloudRdsFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#db_type DataHuaweicloudRdsFlavors#db_type} + */ + readonly dbType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#db_version DataHuaweicloudRdsFlavors#db_version} + */ + readonly dbVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#group_type DataHuaweicloudRdsFlavors#group_type} + */ + readonly groupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#id DataHuaweicloudRdsFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#instance_mode DataHuaweicloudRdsFlavors#instance_mode} + */ + readonly instanceMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#memory DataHuaweicloudRdsFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#region DataHuaweicloudRdsFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#vcpus DataHuaweicloudRdsFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudRdsFlavorsFlavors { +} + +export function dataHuaweicloudRdsFlavorsFlavorsToTerraform(struct?: DataHuaweicloudRdsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudRdsFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // db_versions - computed: true, optional: false, required: false + public get dbVersions() { + return this.getListAttribute('db_versions'); + } + + // group_type - computed: true, optional: false, required: false + public get groupType() { + return this.getStringAttribute('group_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_mode - computed: true, optional: false, required: false + public get instanceMode() { + return this.getStringAttribute('instance_mode'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudRdsFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsFlavorsFlavorsOutputReference { + return new DataHuaweicloudRdsFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors huaweicloud_rds_flavors} +*/ +export class DataHuaweicloudRdsFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsFlavors to import + * @param importFromId The id of the existing DataHuaweicloudRdsFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_flavors huaweicloud_rds_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._dbType = config.dbType; + this._dbVersion = config.dbVersion; + this._groupType = config.groupType; + this._id = config.id; + this._instanceMode = config.instanceMode; + this._memory = config.memory; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // db_type - computed: false, optional: false, required: true + private _dbType?: string; + public get dbType() { + return this.getStringAttribute('db_type'); + } + public set dbType(value: string) { + this._dbType = value; + } + // Temporarily expose input value. Use with caution. + public get dbTypeInput() { + return this._dbType; + } + + // db_version - computed: false, optional: true, required: false + private _dbVersion?: string; + public get dbVersion() { + return this.getStringAttribute('db_version'); + } + public set dbVersion(value: string) { + this._dbVersion = value; + } + public resetDbVersion() { + this._dbVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get dbVersionInput() { + return this._dbVersion; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudRdsFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // group_type - computed: false, optional: true, required: false + private _groupType?: string; + public get groupType() { + return this.getStringAttribute('group_type'); + } + public set groupType(value: string) { + this._groupType = value; + } + public resetGroupType() { + this._groupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupTypeInput() { + return this._groupType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_mode - computed: false, optional: true, required: false + private _instanceMode?: string; + public get instanceMode() { + return this.getStringAttribute('instance_mode'); + } + public set instanceMode(value: string) { + this._instanceMode = value; + } + public resetInstanceMode() { + this._instanceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceModeInput() { + return this._instanceMode; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + db_type: cdktf.stringToTerraform(this._dbType), + db_version: cdktf.stringToTerraform(this._dbVersion), + group_type: cdktf.stringToTerraform(this._groupType), + id: cdktf.stringToTerraform(this._id), + instance_mode: cdktf.stringToTerraform(this._instanceMode), + memory: cdktf.numberToTerraform(this._memory), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_type: { + value: cdktf.stringToHclTerraform(this._dbType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_version: { + value: cdktf.stringToHclTerraform(this._dbVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_type: { + value: cdktf.stringToHclTerraform(this._groupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_mode: { + value: cdktf.stringToHclTerraform(this._instanceMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/README.md new file mode 100644 index 00000000..06c76dd4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/index.ts new file mode 100644 index 00000000..ebfdf9e6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-instances/index.ts @@ -0,0 +1,858 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#datastore_type DataHuaweicloudRdsInstances#datastore_type} + */ + readonly datastoreType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#enterprise_project_id DataHuaweicloudRdsInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#id DataHuaweicloudRdsInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#name DataHuaweicloudRdsInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#region DataHuaweicloudRdsInstances#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#subnet_id DataHuaweicloudRdsInstances#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#type DataHuaweicloudRdsInstances#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#vpc_id DataHuaweicloudRdsInstances#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudRdsInstancesInstancesBackupStrategy { +} + +export function dataHuaweicloudRdsInstancesInstancesBackupStrategyToTerraform(struct?: DataHuaweicloudRdsInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsInstancesInstancesBackupStrategyToHclTerraform(struct?: DataHuaweicloudRdsInstancesInstancesBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsInstancesInstancesBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsInstancesInstancesBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsInstancesInstancesBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // keep_days - computed: true, optional: false, required: false + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DataHuaweicloudRdsInstancesInstancesBackupStrategyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsInstancesInstancesBackupStrategyOutputReference { + return new DataHuaweicloudRdsInstancesInstancesBackupStrategyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsInstancesInstancesDb { +} + +export function dataHuaweicloudRdsInstancesInstancesDbToTerraform(struct?: DataHuaweicloudRdsInstancesInstancesDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsInstancesInstancesDbToHclTerraform(struct?: DataHuaweicloudRdsInstancesInstancesDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsInstancesInstancesDbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsInstancesInstancesDb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsInstancesInstancesDb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudRdsInstancesInstancesDbList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsInstancesInstancesDbOutputReference { + return new DataHuaweicloudRdsInstancesInstancesDbOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsInstancesInstancesNodes { +} + +export function dataHuaweicloudRdsInstancesInstancesNodesToTerraform(struct?: DataHuaweicloudRdsInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsInstancesInstancesNodesToHclTerraform(struct?: DataHuaweicloudRdsInstancesInstancesNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsInstancesInstancesNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsInstancesInstancesNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsInstancesInstancesNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudRdsInstancesInstancesNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsInstancesInstancesNodesOutputReference { + return new DataHuaweicloudRdsInstancesInstancesNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsInstancesInstancesVolume { +} + +export function dataHuaweicloudRdsInstancesInstancesVolumeToTerraform(struct?: DataHuaweicloudRdsInstancesInstancesVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsInstancesInstancesVolumeToHclTerraform(struct?: DataHuaweicloudRdsInstancesInstancesVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsInstancesInstancesVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsInstancesInstancesVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsInstancesInstancesVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // disk_encryption_id - computed: true, optional: false, required: false + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRdsInstancesInstancesVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsInstancesInstancesVolumeOutputReference { + return new DataHuaweicloudRdsInstancesInstancesVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsInstancesInstances { +} + +export function dataHuaweicloudRdsInstancesInstancesToTerraform(struct?: DataHuaweicloudRdsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsInstancesInstancesToHclTerraform(struct?: DataHuaweicloudRdsInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getListAttribute('availability_zone'); + } + + // backup_strategy - computed: true, optional: false, required: false + private _backupStrategy = new DataHuaweicloudRdsInstancesInstancesBackupStrategyList(this, "backup_strategy", false); + public get backupStrategy() { + return this._backupStrategy; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // db - computed: true, optional: false, required: false + private _db = new DataHuaweicloudRdsInstancesInstancesDbList(this, "db", false); + public get db() { + return this._db; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // fixed_ip - computed: true, optional: false, required: false + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // ha_replication_mode - computed: true, optional: false, required: false + public get haReplicationMode() { + return this.getStringAttribute('ha_replication_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudRdsInstancesInstancesNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // param_group_id - computed: true, optional: false, required: false + public get paramGroupId() { + return this.getStringAttribute('param_group_id'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // ssl_enable - computed: true, optional: false, required: false + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // volume - computed: true, optional: false, required: false + private _volume = new DataHuaweicloudRdsInstancesInstancesVolumeList(this, "volume", false); + public get volume() { + return this._volume; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudRdsInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsInstancesInstancesOutputReference { + return new DataHuaweicloudRdsInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances huaweicloud_rds_instances} +*/ +export class DataHuaweicloudRdsInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsInstances to import + * @param importFromId The id of the existing DataHuaweicloudRdsInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_instances huaweicloud_rds_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datastoreType = config.datastoreType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // datastore_type - computed: false, optional: true, required: false + private _datastoreType?: string; + public get datastoreType() { + return this.getStringAttribute('datastore_type'); + } + public set datastoreType(value: string) { + this._datastoreType = value; + } + public resetDatastoreType() { + this._datastoreType = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreTypeInput() { + return this._datastoreType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudRdsInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datastore_type: cdktf.stringToTerraform(this._datastoreType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datastore_type: { + value: cdktf.stringToHclTerraform(this._datastoreType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/README.md new file mode 100644 index 00000000..a8034be8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_mysql_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_mysql_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/index.ts new file mode 100644 index 00000000..9e4b06ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-accounts/index.ts @@ -0,0 +1,322 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsMysqlAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the IP address that is allowed to access your DB instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts#host DataHuaweicloudRdsMysqlAccounts#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts#id DataHuaweicloudRdsMysqlAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts#instance_id DataHuaweicloudRdsMysqlAccounts#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the username of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts#name DataHuaweicloudRdsMysqlAccounts#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts#region DataHuaweicloudRdsMysqlAccounts#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsMysqlAccountsUsers { +} + +export function dataHuaweicloudRdsMysqlAccountsUsersToTerraform(struct?: DataHuaweicloudRdsMysqlAccountsUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlAccountsUsersToHclTerraform(struct?: DataHuaweicloudRdsMysqlAccountsUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlAccountsUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlAccountsUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlAccountsUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // hosts - computed: true, optional: false, required: false + public get hosts() { + return this.getListAttribute('hosts'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsMysqlAccountsUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlAccountsUsersOutputReference { + return new DataHuaweicloudRdsMysqlAccountsUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts huaweicloud_rds_mysql_accounts} +*/ +export class DataHuaweicloudRdsMysqlAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsMysqlAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsMysqlAccounts to import + * @param importFromId The id of the existing DataHuaweicloudRdsMysqlAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsMysqlAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_accounts huaweicloud_rds_mysql_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsMysqlAccountsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsMysqlAccountsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._host = config.host; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // host - computed: false, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudRdsMysqlAccountsUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + host: cdktf.stringToTerraform(this._host), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + host: { + value: cdktf.stringToHclTerraform(this._host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/README.md new file mode 100644 index 00000000..ae6ab58d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_mysql_binlog` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_mysql_binlog`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/index.ts new file mode 100644 index 00000000..23bacdfa --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-binlog/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsMysqlBinlogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog#id DataHuaweicloudRdsMysqlBinlog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog#instance_id DataHuaweicloudRdsMysqlBinlog#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog#region DataHuaweicloudRdsMysqlBinlog#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog huaweicloud_rds_mysql_binlog} +*/ +export class DataHuaweicloudRdsMysqlBinlog extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_binlog"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsMysqlBinlog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsMysqlBinlog to import + * @param importFromId The id of the existing DataHuaweicloudRdsMysqlBinlog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsMysqlBinlog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_binlog", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_binlog huaweicloud_rds_mysql_binlog} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsMysqlBinlogConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsMysqlBinlogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_binlog', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // binlog_retention_hours - computed: true, optional: false, required: false + public get binlogRetentionHours() { + return this.getNumberAttribute('binlog_retention_hours'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/README.md new file mode 100644 index 00000000..ef9851e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_mysql_database_privileges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_mysql_database_privileges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/index.ts new file mode 100644 index 00000000..098f8a9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-database-privileges/index.ts @@ -0,0 +1,336 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsMysqlDatabasePrivilegesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#db_name DataHuaweicloudRdsMysqlDatabasePrivileges#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#id DataHuaweicloudRdsMysqlDatabasePrivileges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#instance_id DataHuaweicloudRdsMysqlDatabasePrivileges#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#readonly DataHuaweicloudRdsMysqlDatabasePrivileges#readonly} + */ + readonly readonly?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#region DataHuaweicloudRdsMysqlDatabasePrivileges#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#user_name DataHuaweicloudRdsMysqlDatabasePrivileges#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudRdsMysqlDatabasePrivilegesUsers { +} + +export function dataHuaweicloudRdsMysqlDatabasePrivilegesUsersToTerraform(struct?: DataHuaweicloudRdsMysqlDatabasePrivilegesUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlDatabasePrivilegesUsersToHclTerraform(struct?: DataHuaweicloudRdsMysqlDatabasePrivilegesUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlDatabasePrivilegesUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlDatabasePrivilegesUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlDatabasePrivilegesUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } +} + +export class DataHuaweicloudRdsMysqlDatabasePrivilegesUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlDatabasePrivilegesUsersOutputReference { + return new DataHuaweicloudRdsMysqlDatabasePrivilegesUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges huaweicloud_rds_mysql_database_privileges} +*/ +export class DataHuaweicloudRdsMysqlDatabasePrivileges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_database_privileges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsMysqlDatabasePrivileges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsMysqlDatabasePrivileges to import + * @param importFromId The id of the existing DataHuaweicloudRdsMysqlDatabasePrivileges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsMysqlDatabasePrivileges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_database_privileges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_database_privileges huaweicloud_rds_mysql_database_privileges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsMysqlDatabasePrivilegesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsMysqlDatabasePrivilegesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_database_privileges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._readonly = config.readonly; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // readonly - computed: false, optional: true, required: false + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + public resetReadonly() { + this._readonly = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudRdsMysqlDatabasePrivilegesUsersList(this, "users", true); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + readonly: cdktf.booleanToTerraform(this._readonly), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(this._readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/README.md new file mode 100644 index 00000000..b460dfca --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_mysql_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_mysql_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/index.ts new file mode 100644 index 00000000..6512c487 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-databases/index.ts @@ -0,0 +1,316 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsMysqlDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases#character_set DataHuaweicloudRdsMysqlDatabases#character_set} + */ + readonly characterSet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases#id DataHuaweicloudRdsMysqlDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases#instance_id DataHuaweicloudRdsMysqlDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases#name DataHuaweicloudRdsMysqlDatabases#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases#region DataHuaweicloudRdsMysqlDatabases#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsMysqlDatabasesDatabases { +} + +export function dataHuaweicloudRdsMysqlDatabasesDatabasesToTerraform(struct?: DataHuaweicloudRdsMysqlDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudRdsMysqlDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // character_set - computed: true, optional: false, required: false + public get characterSet() { + return this.getStringAttribute('character_set'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsMysqlDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlDatabasesDatabasesOutputReference { + return new DataHuaweicloudRdsMysqlDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases huaweicloud_rds_mysql_databases} +*/ +export class DataHuaweicloudRdsMysqlDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsMysqlDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsMysqlDatabases to import + * @param importFromId The id of the existing DataHuaweicloudRdsMysqlDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsMysqlDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_databases huaweicloud_rds_mysql_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsMysqlDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsMysqlDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: true, required: false + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + public resetCharacterSet() { + this._characterSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsMysqlDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/README.md new file mode 100644 index 00000000..6f5c6590 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_mysql_proxies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_mysql_proxies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/index.ts new file mode 100644 index 00000000..2c06da20 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxies/index.ts @@ -0,0 +1,829 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsMysqlProxiesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies#id DataHuaweicloudRdsMysqlProxies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of RDS MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies#instance_id DataHuaweicloudRdsMysqlProxies#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies#region DataHuaweicloudRdsMysqlProxies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsMysqlProxiesProxyListMasterInstance { +} + +export function dataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceToTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListMasterInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListMasterInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxiesProxyListMasterInstance | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxiesProxyListMasterInstance | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceOutputReference { + return new DataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfo { +} + +export function dataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoToTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // group_type - computed: true, optional: false, required: false + public get groupType() { + return this.getStringAttribute('group_type'); + } +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoOutputReference { + return new DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsMysqlProxiesProxyListProxyNodes { +} + +export function dataHuaweicloudRdsMysqlProxiesProxyListProxyNodesToTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListProxyNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxiesProxyListProxyNodesToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListProxyNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListProxyNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxiesProxyListProxyNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxiesProxyListProxyNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // frozen_flag - computed: true, optional: false, required: false + public get frozenFlag() { + return this.getNumberAttribute('frozen_flag'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListProxyNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxiesProxyListProxyNodesOutputReference { + return new DataHuaweicloudRdsMysqlProxiesProxyListProxyNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsMysqlProxiesProxyListProxy { +} + +export function dataHuaweicloudRdsMysqlProxiesProxyListProxyToTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListProxy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxiesProxyListProxyToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListProxy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListProxyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxiesProxyListProxy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxiesProxyListProxy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // alt_flag - computed: true, optional: false, required: false + public get altFlag() { + return this.getBooleanAttribute('alt_flag'); + } + + // connection_pool_type - computed: true, optional: false, required: false + public get connectionPoolType() { + return this.getStringAttribute('connection_pool_type'); + } + + // delay_threshold_in_seconds - computed: true, optional: false, required: false + public get delayThresholdInSeconds() { + return this.getNumberAttribute('delay_threshold_in_seconds'); + } + + // dns_name - computed: true, optional: false, required: false + public get dnsName() { + return this.getStringAttribute('dns_name'); + } + + // flavor_info - computed: true, optional: false, required: false + private _flavorInfo = new DataHuaweicloudRdsMysqlProxiesProxyListProxyFlavorInfoList(this, "flavor_info", false); + public get flavorInfo() { + return this._flavorInfo; + } + + // force_read_only - computed: true, optional: false, required: false + public get forceReadOnly() { + return this.getBooleanAttribute('force_read_only'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DataHuaweicloudRdsMysqlProxiesProxyListProxyNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // pay_mode - computed: true, optional: false, required: false + public get payMode() { + return this.getStringAttribute('pay_mode'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // proxy_mode - computed: true, optional: false, required: false + public get proxyMode() { + return this.getStringAttribute('proxy_mode'); + } + + // route_mode - computed: true, optional: false, required: false + public get routeMode() { + return this.getNumberAttribute('route_mode'); + } + + // seconds_level_monitor_fun_status - computed: true, optional: false, required: false + public get secondsLevelMonitorFunStatus() { + return this.getStringAttribute('seconds_level_monitor_fun_status'); + } + + // ssl_option - computed: true, optional: false, required: false + public get sslOption() { + return this.getBooleanAttribute('ssl_option'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // support_balance_route_mode - computed: true, optional: false, required: false + public get supportBalanceRouteMode() { + return this.getBooleanAttribute('support_balance_route_mode'); + } + + // support_proxy_ssl - computed: true, optional: false, required: false + public get supportProxySsl() { + return this.getBooleanAttribute('support_proxy_ssl'); + } + + // support_switch_connection_pool_type - computed: true, optional: false, required: false + public get supportSwitchConnectionPoolType() { + return this.getBooleanAttribute('support_switch_connection_pool_type'); + } + + // support_transaction_split - computed: true, optional: false, required: false + public get supportTransactionSplit() { + return this.getBooleanAttribute('support_transaction_split'); + } + + // transaction_split - computed: true, optional: false, required: false + public get transactionSplit() { + return this.getStringAttribute('transaction_split'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListProxyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxiesProxyListProxyOutputReference { + return new DataHuaweicloudRdsMysqlProxiesProxyListProxyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstances { +} + +export function dataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesToTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // weight - computed: true, optional: false, required: false + public get weight() { + return this.getNumberAttribute('weight'); + } +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesOutputReference { + return new DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsMysqlProxiesProxyListStruct { +} + +export function dataHuaweicloudRdsMysqlProxiesProxyListStructToTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxiesProxyListStructToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxiesProxyListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxiesProxyListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxiesProxyListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // master_instance - computed: true, optional: false, required: false + private _masterInstance = new DataHuaweicloudRdsMysqlProxiesProxyListMasterInstanceList(this, "master_instance", false); + public get masterInstance() { + return this._masterInstance; + } + + // proxy - computed: true, optional: false, required: false + private _proxy = new DataHuaweicloudRdsMysqlProxiesProxyListProxyList(this, "proxy", false); + public get proxy() { + return this._proxy; + } + + // proxy_security_group_check_result - computed: true, optional: false, required: false + public get proxySecurityGroupCheckResult() { + return this.getBooleanAttribute('proxy_security_group_check_result'); + } + + // readonly_instances - computed: true, optional: false, required: false + private _readonlyInstances = new DataHuaweicloudRdsMysqlProxiesProxyListReadonlyInstancesList(this, "readonly_instances", false); + public get readonlyInstances() { + return this._readonlyInstances; + } +} + +export class DataHuaweicloudRdsMysqlProxiesProxyListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxiesProxyListStructOutputReference { + return new DataHuaweicloudRdsMysqlProxiesProxyListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies huaweicloud_rds_mysql_proxies} +*/ +export class DataHuaweicloudRdsMysqlProxies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_proxies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsMysqlProxies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsMysqlProxies to import + * @param importFromId The id of the existing DataHuaweicloudRdsMysqlProxies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsMysqlProxies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_proxies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxies huaweicloud_rds_mysql_proxies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsMysqlProxiesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsMysqlProxiesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_proxies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // max_proxy_node_num - computed: true, optional: false, required: false + public get maxProxyNodeNum() { + return this.getNumberAttribute('max_proxy_node_num'); + } + + // max_proxy_num - computed: true, optional: false, required: false + public get maxProxyNum() { + return this.getNumberAttribute('max_proxy_num'); + } + + // proxy_list - computed: true, optional: false, required: false + private _proxyList = new DataHuaweicloudRdsMysqlProxiesProxyListStructList(this, "proxy_list", false); + public get proxyList() { + return this._proxyList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // support_balance_route_mode_for_favored_version - computed: true, optional: false, required: false + public get supportBalanceRouteModeForFavoredVersion() { + return this.getBooleanAttribute('support_balance_route_mode_for_favored_version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/README.md new file mode 100644 index 00000000..4163b3f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_mysql_proxy_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_mysql_proxy_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/index.ts new file mode 100644 index 00000000..96ce1c61 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-mysql-proxy-flavors/index.ts @@ -0,0 +1,357 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsMysqlProxyFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors#id DataHuaweicloudRdsMysqlProxyFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors#instance_id DataHuaweicloudRdsMysqlProxyFlavors#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors#region DataHuaweicloudRdsMysqlProxyFlavors#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavors { +} + +export function dataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsToTerraform(struct?: DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // code - computed: true, optional: false, required: false + public get code() { + return this.getStringAttribute('code'); + } + + // db_type - computed: true, optional: false, required: false + public get dbType() { + return this.getStringAttribute('db_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } +} + +export class DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsOutputReference { + return new DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroups { +} + +export function dataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsToTerraform(struct?: DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsToHclTerraform(struct?: DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // group_type - computed: true, optional: false, required: false + public get groupType() { + return this.getStringAttribute('group_type'); + } +} + +export class DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsOutputReference { + return new DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors huaweicloud_rds_mysql_proxy_flavors} +*/ +export class DataHuaweicloudRdsMysqlProxyFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_proxy_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsMysqlProxyFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsMysqlProxyFlavors to import + * @param importFromId The id of the existing DataHuaweicloudRdsMysqlProxyFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsMysqlProxyFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_proxy_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_mysql_proxy_flavors huaweicloud_rds_mysql_proxy_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsMysqlProxyFlavorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsMysqlProxyFlavorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_proxy_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // flavor_groups - computed: true, optional: false, required: false + private _flavorGroups = new DataHuaweicloudRdsMysqlProxyFlavorsFlavorGroupsList(this, "flavor_groups", false); + public get flavorGroups() { + return this._flavorGroups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/README.md new file mode 100644 index 00000000..7ebb1d54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_parametergroups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_parametergroups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/index.ts new file mode 100644 index 00000000..1d5982fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-parametergroups/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsParametergroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#datastore_name DataHuaweicloudRdsParametergroups#datastore_name} + */ + readonly datastoreName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#datastore_version_name DataHuaweicloudRdsParametergroups#datastore_version_name} + */ + readonly datastoreVersionName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#id DataHuaweicloudRdsParametergroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#name DataHuaweicloudRdsParametergroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#region DataHuaweicloudRdsParametergroups#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#user_defined DataHuaweicloudRdsParametergroups#user_defined} + */ + readonly userDefined?: boolean | cdktf.IResolvable; +} +export interface DataHuaweicloudRdsParametergroupsConfigurations { +} + +export function dataHuaweicloudRdsParametergroupsConfigurationsToTerraform(struct?: DataHuaweicloudRdsParametergroupsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsParametergroupsConfigurationsToHclTerraform(struct?: DataHuaweicloudRdsParametergroupsConfigurations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsParametergroupsConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsParametergroupsConfigurations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsParametergroupsConfigurations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore_name - computed: true, optional: false, required: false + public get datastoreName() { + return this.getStringAttribute('datastore_name'); + } + + // datastore_version_name - computed: true, optional: false, required: false + public get datastoreVersionName() { + return this.getStringAttribute('datastore_version_name'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_defined - computed: true, optional: false, required: false + public get userDefined() { + return this.getBooleanAttribute('user_defined'); + } +} + +export class DataHuaweicloudRdsParametergroupsConfigurationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsParametergroupsConfigurationsOutputReference { + return new DataHuaweicloudRdsParametergroupsConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups huaweicloud_rds_parametergroups} +*/ +export class DataHuaweicloudRdsParametergroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_parametergroups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsParametergroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsParametergroups to import + * @param importFromId The id of the existing DataHuaweicloudRdsParametergroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsParametergroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_parametergroups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_parametergroups huaweicloud_rds_parametergroups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsParametergroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsParametergroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_parametergroups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datastoreName = config.datastoreName; + this._datastoreVersionName = config.datastoreVersionName; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._userDefined = config.userDefined; + } + + // ========== + // ATTRIBUTES + // ========== + + // configurations - computed: true, optional: false, required: false + private _configurations = new DataHuaweicloudRdsParametergroupsConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + + // datastore_name - computed: false, optional: true, required: false + private _datastoreName?: string; + public get datastoreName() { + return this.getStringAttribute('datastore_name'); + } + public set datastoreName(value: string) { + this._datastoreName = value; + } + public resetDatastoreName() { + this._datastoreName = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreNameInput() { + return this._datastoreName; + } + + // datastore_version_name - computed: false, optional: true, required: false + private _datastoreVersionName?: string; + public get datastoreVersionName() { + return this.getStringAttribute('datastore_version_name'); + } + public set datastoreVersionName(value: string) { + this._datastoreVersionName = value; + } + public resetDatastoreVersionName() { + this._datastoreVersionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreVersionNameInput() { + return this._datastoreVersionName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_defined - computed: false, optional: true, required: false + private _userDefined?: boolean | cdktf.IResolvable; + public get userDefined() { + return this.getBooleanAttribute('user_defined'); + } + public set userDefined(value: boolean | cdktf.IResolvable) { + this._userDefined = value; + } + public resetUserDefined() { + this._userDefined = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDefinedInput() { + return this._userDefined; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datastore_name: cdktf.stringToTerraform(this._datastoreName), + datastore_version_name: cdktf.stringToTerraform(this._datastoreVersionName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + user_defined: cdktf.booleanToTerraform(this._userDefined), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datastore_name: { + value: cdktf.stringToHclTerraform(this._datastoreName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + datastore_version_name: { + value: cdktf.stringToHclTerraform(this._datastoreVersionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_defined: { + value: cdktf.booleanToHclTerraform(this._userDefined), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/README.md new file mode 100644 index 00000000..a69bde1f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/index.ts new file mode 100644 index 00000000..29dc97be --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-accounts/index.ts @@ -0,0 +1,404 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts#id DataHuaweicloudRdsPgAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts#instance_id DataHuaweicloudRdsPgAccounts#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts#region DataHuaweicloudRdsPgAccounts#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts#user_name DataHuaweicloudRdsPgAccounts#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudRdsPgAccountsUsersAttributes { +} + +export function dataHuaweicloudRdsPgAccountsUsersAttributesToTerraform(struct?: DataHuaweicloudRdsPgAccountsUsersAttributes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsPgAccountsUsersAttributesToHclTerraform(struct?: DataHuaweicloudRdsPgAccountsUsersAttributes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsPgAccountsUsersAttributesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsPgAccountsUsersAttributes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsPgAccountsUsersAttributes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // rolbypassrls - computed: true, optional: false, required: false + public get rolbypassrls() { + return this.getBooleanAttribute('rolbypassrls'); + } + + // rolcanlogin - computed: true, optional: false, required: false + public get rolcanlogin() { + return this.getBooleanAttribute('rolcanlogin'); + } + + // rolconnlimit - computed: true, optional: false, required: false + public get rolconnlimit() { + return this.getNumberAttribute('rolconnlimit'); + } + + // rolcreatedb - computed: true, optional: false, required: false + public get rolcreatedb() { + return this.getBooleanAttribute('rolcreatedb'); + } + + // rolcreaterole - computed: true, optional: false, required: false + public get rolcreaterole() { + return this.getBooleanAttribute('rolcreaterole'); + } + + // rolinherit - computed: true, optional: false, required: false + public get rolinherit() { + return this.getBooleanAttribute('rolinherit'); + } + + // rolreplication - computed: true, optional: false, required: false + public get rolreplication() { + return this.getBooleanAttribute('rolreplication'); + } + + // rolsuper - computed: true, optional: false, required: false + public get rolsuper() { + return this.getBooleanAttribute('rolsuper'); + } +} + +export class DataHuaweicloudRdsPgAccountsUsersAttributesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsPgAccountsUsersAttributesOutputReference { + return new DataHuaweicloudRdsPgAccountsUsersAttributesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsPgAccountsUsers { +} + +export function dataHuaweicloudRdsPgAccountsUsersToTerraform(struct?: DataHuaweicloudRdsPgAccountsUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsPgAccountsUsersToHclTerraform(struct?: DataHuaweicloudRdsPgAccountsUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsPgAccountsUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsPgAccountsUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsPgAccountsUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attributes - computed: true, optional: false, required: false + private _attributes = new DataHuaweicloudRdsPgAccountsUsersAttributesList(this, "attributes", false); + public get attributes() { + return this._attributes; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // memberof - computed: true, optional: false, required: false + public get memberof() { + return this.getListAttribute('memberof'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsPgAccountsUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsPgAccountsUsersOutputReference { + return new DataHuaweicloudRdsPgAccountsUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts huaweicloud_rds_pg_accounts} +*/ +export class DataHuaweicloudRdsPgAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgAccounts to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_accounts huaweicloud_rds_pg_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgAccountsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgAccountsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudRdsPgAccountsUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/README.md new file mode 100644 index 00000000..d8f7ee59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/index.ts new file mode 100644 index 00000000..3184a0ce --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-databases/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#character_set DataHuaweicloudRdsPgDatabases#character_set} + */ + readonly characterSet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#id DataHuaweicloudRdsPgDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#instance_id DataHuaweicloudRdsPgDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#lc_collate DataHuaweicloudRdsPgDatabases#lc_collate} + */ + readonly lcCollate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#name DataHuaweicloudRdsPgDatabases#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#owner DataHuaweicloudRdsPgDatabases#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#region DataHuaweicloudRdsPgDatabases#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#size DataHuaweicloudRdsPgDatabases#size} + */ + readonly size?: number; +} +export interface DataHuaweicloudRdsPgDatabasesDatabases { +} + +export function dataHuaweicloudRdsPgDatabasesDatabasesToTerraform(struct?: DataHuaweicloudRdsPgDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsPgDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudRdsPgDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsPgDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsPgDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsPgDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // character_set - computed: true, optional: false, required: false + public get characterSet() { + return this.getStringAttribute('character_set'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // lc_collate - computed: true, optional: false, required: false + public get lcCollate() { + return this.getStringAttribute('lc_collate'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudRdsPgDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsPgDatabasesDatabasesOutputReference { + return new DataHuaweicloudRdsPgDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases huaweicloud_rds_pg_databases} +*/ +export class DataHuaweicloudRdsPgDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgDatabases to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_databases huaweicloud_rds_pg_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._id = config.id; + this._instanceId = config.instanceId; + this._lcCollate = config.lcCollate; + this._name = config.name; + this._owner = config.owner; + this._region = config.region; + this._size = config.size; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: true, required: false + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + public resetCharacterSet() { + this._characterSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsPgDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lc_collate - computed: false, optional: true, required: false + private _lcCollate?: string; + public get lcCollate() { + return this.getStringAttribute('lc_collate'); + } + public set lcCollate(value: string) { + this._lcCollate = value; + } + public resetLcCollate() { + this._lcCollate = undefined; + } + // Temporarily expose input value. Use with caution. + public get lcCollateInput() { + return this._lcCollate; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: false, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lc_collate: cdktf.stringToTerraform(this._lcCollate), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lc_collate: { + value: cdktf.stringToHclTerraform(this._lcCollate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/README.md new file mode 100644 index 00000000..cfff69bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_plugin_parameter_value_range` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_plugin_parameter_value_range`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/index.ts new file mode 100644 index 00000000..534f619d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-value-range/index.ts @@ -0,0 +1,215 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgPluginParameterValueRangeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range#id DataHuaweicloudRdsPgPluginParameterValueRange#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range#instance_id DataHuaweicloudRdsPgPluginParameterValueRange#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range#name DataHuaweicloudRdsPgPluginParameterValueRange#name} + */ + readonly name: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range#region DataHuaweicloudRdsPgPluginParameterValueRange#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range huaweicloud_rds_pg_plugin_parameter_value_range} +*/ +export class DataHuaweicloudRdsPgPluginParameterValueRange extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_plugin_parameter_value_range"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgPluginParameterValueRange resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgPluginParameterValueRange to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgPluginParameterValueRange that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgPluginParameterValueRange to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_plugin_parameter_value_range", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_value_range huaweicloud_rds_pg_plugin_parameter_value_range} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgPluginParameterValueRangeConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgPluginParameterValueRangeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_plugin_parameter_value_range', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // default_values - computed: true, optional: false, required: false + public get defaultValues() { + return this.getListAttribute('default_values'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restart_required - computed: true, optional: false, required: false + public get restartRequired() { + return this.getBooleanAttribute('restart_required'); + } + + // values - computed: true, optional: false, required: false + public get values() { + return this.getListAttribute('values'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/README.md new file mode 100644 index 00000000..227bc39c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_plugin_parameter_values` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_plugin_parameter_values`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/index.ts new file mode 100644 index 00000000..28c9af24 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugin-parameter-values/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgPluginParameterValuesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values#id DataHuaweicloudRdsPgPluginParameterValues#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values#instance_id DataHuaweicloudRdsPgPluginParameterValues#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values#name DataHuaweicloudRdsPgPluginParameterValues#name} + */ + readonly name: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values#region DataHuaweicloudRdsPgPluginParameterValues#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values huaweicloud_rds_pg_plugin_parameter_values} +*/ +export class DataHuaweicloudRdsPgPluginParameterValues extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_plugin_parameter_values"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgPluginParameterValues resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgPluginParameterValues to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgPluginParameterValues that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgPluginParameterValues to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_plugin_parameter_values", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugin_parameter_values huaweicloud_rds_pg_plugin_parameter_values} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgPluginParameterValuesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgPluginParameterValuesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_plugin_parameter_values', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // values - computed: true, optional: false, required: false + public get values() { + return this.getListAttribute('values'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/README.md new file mode 100644 index 00000000..9bb0807a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_plugins` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_plugins`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/index.ts new file mode 100644 index 00000000..cf46d16e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-plugins/index.ts @@ -0,0 +1,389 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgPluginsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether the plugin has been created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#created DataHuaweicloudRdsPgPlugins#created} + */ + readonly created?: boolean | cdktf.IResolvable; + /** + * Specifies the database name of a PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#database_name DataHuaweicloudRdsPgPlugins#database_name} + */ + readonly databaseName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#id DataHuaweicloudRdsPgPlugins#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#instance_id DataHuaweicloudRdsPgPlugins#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the plugin name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#name DataHuaweicloudRdsPgPlugins#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#region DataHuaweicloudRdsPgPlugins#region} + */ + readonly region?: string; + /** + * Specifies the plugin version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#version DataHuaweicloudRdsPgPlugins#version} + */ + readonly version?: string; +} +export interface DataHuaweicloudRdsPgPluginsPlugins { +} + +export function dataHuaweicloudRdsPgPluginsPluginsToTerraform(struct?: DataHuaweicloudRdsPgPluginsPlugins): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsPgPluginsPluginsToHclTerraform(struct?: DataHuaweicloudRdsPgPluginsPlugins): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsPgPluginsPluginsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsPgPluginsPlugins | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsPgPluginsPlugins | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getBooleanAttribute('created'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // shared_preload_libraries - computed: true, optional: false, required: false + public get sharedPreloadLibraries() { + return this.getStringAttribute('shared_preload_libraries'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudRdsPgPluginsPluginsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsPgPluginsPluginsOutputReference { + return new DataHuaweicloudRdsPgPluginsPluginsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins huaweicloud_rds_pg_plugins} +*/ +export class DataHuaweicloudRdsPgPlugins extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_plugins"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgPlugins resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgPlugins to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgPlugins that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgPlugins to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_plugins", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_plugins huaweicloud_rds_pg_plugins} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgPluginsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgPluginsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_plugins', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._created = config.created; + this._databaseName = config.databaseName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // created - computed: false, optional: true, required: false + private _created?: boolean | cdktf.IResolvable; + public get created() { + return this.getBooleanAttribute('created'); + } + public set created(value: boolean | cdktf.IResolvable) { + this._created = value; + } + public resetCreated() { + this._created = undefined; + } + // Temporarily expose input value. Use with caution. + public get createdInput() { + return this._created; + } + + // database_name - computed: false, optional: false, required: true + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // plugins - computed: true, optional: false, required: false + private _plugins = new DataHuaweicloudRdsPgPluginsPluginsList(this, "plugins", false); + public get plugins() { + return this._plugins; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + created: cdktf.booleanToTerraform(this._created), + database_name: cdktf.stringToTerraform(this._databaseName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + created: { + value: cdktf.booleanToHclTerraform(this._created), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/README.md new file mode 100644 index 00000000..2ce8cd0b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_roles` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_roles`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/index.ts new file mode 100644 index 00000000..b3efb655 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-roles/index.ts @@ -0,0 +1,208 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgRolesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the username of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles#account DataHuaweicloudRdsPgRoles#account} + */ + readonly account?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles#id DataHuaweicloudRdsPgRoles#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of Instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles#instance_id DataHuaweicloudRdsPgRoles#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles#region DataHuaweicloudRdsPgRoles#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles huaweicloud_rds_pg_roles} +*/ +export class DataHuaweicloudRdsPgRoles extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_roles"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgRoles resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgRoles to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgRoles that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgRoles to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_roles", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_roles huaweicloud_rds_pg_roles} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgRolesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgRolesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_roles', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._account = config.account; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // account - computed: false, optional: true, required: false + private _account?: string; + public get account() { + return this.getStringAttribute('account'); + } + public set account(value: string) { + this._account = value; + } + public resetAccount() { + this._account = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountInput() { + return this._account; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roles - computed: true, optional: false, required: false + public get roles() { + return this.getListAttribute('roles'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account: cdktf.stringToTerraform(this._account), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account: { + value: cdktf.stringToHclTerraform(this._account), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/README.md new file mode 100644 index 00000000..3d6aea49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_pg_sql_limits` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_pg_sql_limits`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/index.ts new file mode 100644 index 00000000..161c13ad --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-pg-sql-limits/index.ts @@ -0,0 +1,521 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsPgSqlLimitsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#db_name DataHuaweicloudRdsPgSqlLimits#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#id DataHuaweicloudRdsPgSqlLimits#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#instance_id DataHuaweicloudRdsPgSqlLimits#instance_id} + */ + readonly instanceId: string; + /** + * Specifies whether the SQL limit is effective. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#is_effective DataHuaweicloudRdsPgSqlLimits#is_effective} + */ + readonly isEffective?: string; + /** + * Specifies the number of SQL statements executed simultaneously. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#max_concurrency DataHuaweicloudRdsPgSqlLimits#max_concurrency} + */ + readonly maxConcurrency?: string; + /** + * Specifies the max waiting time in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#max_waiting DataHuaweicloudRdsPgSqlLimits#max_waiting} + */ + readonly maxWaiting?: string; + /** + * Specifies the query ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#query_id DataHuaweicloudRdsPgSqlLimits#query_id} + */ + readonly queryId?: string; + /** + * Specifies the text form of SQL statement. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#query_string DataHuaweicloudRdsPgSqlLimits#query_string} + */ + readonly queryString?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#region DataHuaweicloudRdsPgSqlLimits#region} + */ + readonly region?: string; + /** + * Specifies the query order for names that are not schema qualified. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#search_path DataHuaweicloudRdsPgSqlLimits#search_path} + */ + readonly searchPath?: string; + /** + * Specifies the ID of SQL limit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#sql_limit_id DataHuaweicloudRdsPgSqlLimits#sql_limit_id} + */ + readonly sqlLimitId?: string; +} +export interface DataHuaweicloudRdsPgSqlLimitsSqlLimits { +} + +export function dataHuaweicloudRdsPgSqlLimitsSqlLimitsToTerraform(struct?: DataHuaweicloudRdsPgSqlLimitsSqlLimits): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsPgSqlLimitsSqlLimitsToHclTerraform(struct?: DataHuaweicloudRdsPgSqlLimitsSqlLimits): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsPgSqlLimitsSqlLimitsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsPgSqlLimitsSqlLimits | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsPgSqlLimitsSqlLimits | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_effective - computed: true, optional: false, required: false + public get isEffective() { + return this.getBooleanAttribute('is_effective'); + } + + // max_concurrency - computed: true, optional: false, required: false + public get maxConcurrency() { + return this.getNumberAttribute('max_concurrency'); + } + + // max_waiting - computed: true, optional: false, required: false + public get maxWaiting() { + return this.getNumberAttribute('max_waiting'); + } + + // query_id - computed: true, optional: false, required: false + public get queryId() { + return this.getStringAttribute('query_id'); + } + + // query_string - computed: true, optional: false, required: false + public get queryString() { + return this.getStringAttribute('query_string'); + } + + // search_path - computed: true, optional: false, required: false + public get searchPath() { + return this.getStringAttribute('search_path'); + } +} + +export class DataHuaweicloudRdsPgSqlLimitsSqlLimitsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsPgSqlLimitsSqlLimitsOutputReference { + return new DataHuaweicloudRdsPgSqlLimitsSqlLimitsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits huaweicloud_rds_pg_sql_limits} +*/ +export class DataHuaweicloudRdsPgSqlLimits extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_sql_limits"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsPgSqlLimits resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsPgSqlLimits to import + * @param importFromId The id of the existing DataHuaweicloudRdsPgSqlLimits that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsPgSqlLimits to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_sql_limits", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_pg_sql_limits huaweicloud_rds_pg_sql_limits} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsPgSqlLimitsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsPgSqlLimitsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_sql_limits', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._isEffective = config.isEffective; + this._maxConcurrency = config.maxConcurrency; + this._maxWaiting = config.maxWaiting; + this._queryId = config.queryId; + this._queryString = config.queryString; + this._region = config.region; + this._searchPath = config.searchPath; + this._sqlLimitId = config.sqlLimitId; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_effective - computed: false, optional: true, required: false + private _isEffective?: string; + public get isEffective() { + return this.getStringAttribute('is_effective'); + } + public set isEffective(value: string) { + this._isEffective = value; + } + public resetIsEffective() { + this._isEffective = undefined; + } + // Temporarily expose input value. Use with caution. + public get isEffectiveInput() { + return this._isEffective; + } + + // max_concurrency - computed: false, optional: true, required: false + private _maxConcurrency?: string; + public get maxConcurrency() { + return this.getStringAttribute('max_concurrency'); + } + public set maxConcurrency(value: string) { + this._maxConcurrency = value; + } + public resetMaxConcurrency() { + this._maxConcurrency = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConcurrencyInput() { + return this._maxConcurrency; + } + + // max_waiting - computed: false, optional: true, required: false + private _maxWaiting?: string; + public get maxWaiting() { + return this.getStringAttribute('max_waiting'); + } + public set maxWaiting(value: string) { + this._maxWaiting = value; + } + public resetMaxWaiting() { + this._maxWaiting = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxWaitingInput() { + return this._maxWaiting; + } + + // query_id - computed: false, optional: true, required: false + private _queryId?: string; + public get queryId() { + return this.getStringAttribute('query_id'); + } + public set queryId(value: string) { + this._queryId = value; + } + public resetQueryId() { + this._queryId = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryIdInput() { + return this._queryId; + } + + // query_string - computed: false, optional: true, required: false + private _queryString?: string; + public get queryString() { + return this.getStringAttribute('query_string'); + } + public set queryString(value: string) { + this._queryString = value; + } + public resetQueryString() { + this._queryString = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryStringInput() { + return this._queryString; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // search_path - computed: false, optional: true, required: false + private _searchPath?: string; + public get searchPath() { + return this.getStringAttribute('search_path'); + } + public set searchPath(value: string) { + this._searchPath = value; + } + public resetSearchPath() { + this._searchPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchPathInput() { + return this._searchPath; + } + + // sql_limit_id - computed: false, optional: true, required: false + private _sqlLimitId?: string; + public get sqlLimitId() { + return this.getStringAttribute('sql_limit_id'); + } + public set sqlLimitId(value: string) { + this._sqlLimitId = value; + } + public resetSqlLimitId() { + this._sqlLimitId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlLimitIdInput() { + return this._sqlLimitId; + } + + // sql_limits - computed: true, optional: false, required: false + private _sqlLimits = new DataHuaweicloudRdsPgSqlLimitsSqlLimitsList(this, "sql_limits", false); + public get sqlLimits() { + return this._sqlLimits; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_effective: cdktf.stringToTerraform(this._isEffective), + max_concurrency: cdktf.stringToTerraform(this._maxConcurrency), + max_waiting: cdktf.stringToTerraform(this._maxWaiting), + query_id: cdktf.stringToTerraform(this._queryId), + query_string: cdktf.stringToTerraform(this._queryString), + region: cdktf.stringToTerraform(this._region), + search_path: cdktf.stringToTerraform(this._searchPath), + sql_limit_id: cdktf.stringToTerraform(this._sqlLimitId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_effective: { + value: cdktf.stringToHclTerraform(this._isEffective), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_concurrency: { + value: cdktf.stringToHclTerraform(this._maxConcurrency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_waiting: { + value: cdktf.stringToHclTerraform(this._maxWaiting), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_id: { + value: cdktf.stringToHclTerraform(this._queryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_string: { + value: cdktf.stringToHclTerraform(this._queryString), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + search_path: { + value: cdktf.stringToHclTerraform(this._searchPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql_limit_id: { + value: cdktf.stringToHclTerraform(this._sqlLimitId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/README.md new file mode 100644 index 00000000..e6938b88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_recycling_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_recycling_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/index.ts new file mode 100644 index 00000000..212478f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-recycling-instances/index.ts @@ -0,0 +1,692 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsRecyclingInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the floating IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#data_vip DataHuaweicloudRdsRecyclingInstances#data_vip} + */ + readonly dataVip?: string; + /** + * Specifies the DB engine name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#engine_name DataHuaweicloudRdsRecyclingInstances#engine_name} + */ + readonly engineName?: string; + /** + * Specifies the DB engine version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#engine_version DataHuaweicloudRdsRecyclingInstances#engine_version} + */ + readonly engineVersion?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#enterprise_project_id DataHuaweicloudRdsRecyclingInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the instance type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#ha_mode DataHuaweicloudRdsRecyclingInstances#ha_mode} + */ + readonly haMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#id DataHuaweicloudRdsRecyclingInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#instance_id DataHuaweicloudRdsRecyclingInstances#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies whether the instance is a serverless instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#is_serverless DataHuaweicloudRdsRecyclingInstances#is_serverless} + */ + readonly isServerless?: string; + /** + * Specifies the instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#name DataHuaweicloudRdsRecyclingInstances#name} + */ + readonly name?: string; + /** + * Specifies the billing mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#pay_model DataHuaweicloudRdsRecyclingInstances#pay_model} + */ + readonly payModel?: string; + /** + * Specifies the backup ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#recycle_backup_id DataHuaweicloudRdsRecyclingInstances#recycle_backup_id} + */ + readonly recycleBackupId?: string; + /** + * Specifies the backup status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#recycle_status DataHuaweicloudRdsRecyclingInstances#recycle_status} + */ + readonly recycleStatus?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#region DataHuaweicloudRdsRecyclingInstances#region} + */ + readonly region?: string; + /** + * Specifies the storage space in **GB**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#volume_size DataHuaweicloudRdsRecyclingInstances#volume_size} + */ + readonly volumeSize?: string; + /** + * Specifies the storage type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#volume_type DataHuaweicloudRdsRecyclingInstances#volume_type} + */ + readonly volumeType?: string; +} +export interface DataHuaweicloudRdsRecyclingInstancesInstances { +} + +export function dataHuaweicloudRdsRecyclingInstancesInstancesToTerraform(struct?: DataHuaweicloudRdsRecyclingInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRecyclingInstancesInstancesToHclTerraform(struct?: DataHuaweicloudRdsRecyclingInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRecyclingInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRecyclingInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRecyclingInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_vip - computed: true, optional: false, required: false + public get dataVip() { + return this.getStringAttribute('data_vip'); + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getStringAttribute('deleted_at'); + } + + // engine_name - computed: true, optional: false, required: false + public get engineName() { + return this.getStringAttribute('engine_name'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // ha_mode - computed: true, optional: false, required: false + public get haMode() { + return this.getStringAttribute('ha_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_serverless - computed: true, optional: false, required: false + public get isServerless() { + return this.getBooleanAttribute('is_serverless'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // pay_model - computed: true, optional: false, required: false + public get payModel() { + return this.getStringAttribute('pay_model'); + } + + // recycle_backup_id - computed: true, optional: false, required: false + public get recycleBackupId() { + return this.getStringAttribute('recycle_backup_id'); + } + + // recycle_status - computed: true, optional: false, required: false + public get recycleStatus() { + return this.getStringAttribute('recycle_status'); + } + + // retained_until - computed: true, optional: false, required: false + public get retainedUntil() { + return this.getStringAttribute('retained_until'); + } + + // volume_size - computed: true, optional: false, required: false + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + + // volume_type - computed: true, optional: false, required: false + public get volumeType() { + return this.getStringAttribute('volume_type'); + } +} + +export class DataHuaweicloudRdsRecyclingInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRecyclingInstancesInstancesOutputReference { + return new DataHuaweicloudRdsRecyclingInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances huaweicloud_rds_recycling_instances} +*/ +export class DataHuaweicloudRdsRecyclingInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_recycling_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsRecyclingInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsRecyclingInstances to import + * @param importFromId The id of the existing DataHuaweicloudRdsRecyclingInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsRecyclingInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_recycling_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_recycling_instances huaweicloud_rds_recycling_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsRecyclingInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsRecyclingInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_recycling_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataVip = config.dataVip; + this._engineName = config.engineName; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._haMode = config.haMode; + this._id = config.id; + this._instanceId = config.instanceId; + this._isServerless = config.isServerless; + this._name = config.name; + this._payModel = config.payModel; + this._recycleBackupId = config.recycleBackupId; + this._recycleStatus = config.recycleStatus; + this._region = config.region; + this._volumeSize = config.volumeSize; + this._volumeType = config.volumeType; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_vip - computed: false, optional: true, required: false + private _dataVip?: string; + public get dataVip() { + return this.getStringAttribute('data_vip'); + } + public set dataVip(value: string) { + this._dataVip = value; + } + public resetDataVip() { + this._dataVip = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVipInput() { + return this._dataVip; + } + + // engine_name - computed: false, optional: true, required: false + private _engineName?: string; + public get engineName() { + return this.getStringAttribute('engine_name'); + } + public set engineName(value: string) { + this._engineName = value; + } + public resetEngineName() { + this._engineName = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineNameInput() { + return this._engineName; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // ha_mode - computed: false, optional: true, required: false + private _haMode?: string; + public get haMode() { + return this.getStringAttribute('ha_mode'); + } + public set haMode(value: string) { + this._haMode = value; + } + public resetHaMode() { + this._haMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get haModeInput() { + return this._haMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudRdsRecyclingInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // is_serverless - computed: false, optional: true, required: false + private _isServerless?: string; + public get isServerless() { + return this.getStringAttribute('is_serverless'); + } + public set isServerless(value: string) { + this._isServerless = value; + } + public resetIsServerless() { + this._isServerless = undefined; + } + // Temporarily expose input value. Use with caution. + public get isServerlessInput() { + return this._isServerless; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pay_model - computed: false, optional: true, required: false + private _payModel?: string; + public get payModel() { + return this.getStringAttribute('pay_model'); + } + public set payModel(value: string) { + this._payModel = value; + } + public resetPayModel() { + this._payModel = undefined; + } + // Temporarily expose input value. Use with caution. + public get payModelInput() { + return this._payModel; + } + + // recycle_backup_id - computed: false, optional: true, required: false + private _recycleBackupId?: string; + public get recycleBackupId() { + return this.getStringAttribute('recycle_backup_id'); + } + public set recycleBackupId(value: string) { + this._recycleBackupId = value; + } + public resetRecycleBackupId() { + this._recycleBackupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get recycleBackupIdInput() { + return this._recycleBackupId; + } + + // recycle_status - computed: false, optional: true, required: false + private _recycleStatus?: string; + public get recycleStatus() { + return this.getStringAttribute('recycle_status'); + } + public set recycleStatus(value: string) { + this._recycleStatus = value; + } + public resetRecycleStatus() { + this._recycleStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get recycleStatusInput() { + return this._recycleStatus; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // volume_size - computed: false, optional: true, required: false + private _volumeSize?: string; + public get volumeSize() { + return this.getStringAttribute('volume_size'); + } + public set volumeSize(value: string) { + this._volumeSize = value; + } + public resetVolumeSize() { + this._volumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // volume_type - computed: false, optional: true, required: false + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + public resetVolumeType() { + this._volumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_vip: cdktf.stringToTerraform(this._dataVip), + engine_name: cdktf.stringToTerraform(this._engineName), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + ha_mode: cdktf.stringToTerraform(this._haMode), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_serverless: cdktf.stringToTerraform(this._isServerless), + name: cdktf.stringToTerraform(this._name), + pay_model: cdktf.stringToTerraform(this._payModel), + recycle_backup_id: cdktf.stringToTerraform(this._recycleBackupId), + recycle_status: cdktf.stringToTerraform(this._recycleStatus), + region: cdktf.stringToTerraform(this._region), + volume_size: cdktf.stringToTerraform(this._volumeSize), + volume_type: cdktf.stringToTerraform(this._volumeType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_vip: { + value: cdktf.stringToHclTerraform(this._dataVip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_name: { + value: cdktf.stringToHclTerraform(this._engineName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ha_mode: { + value: cdktf.stringToHclTerraform(this._haMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_serverless: { + value: cdktf.stringToHclTerraform(this._isServerless), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pay_model: { + value: cdktf.stringToHclTerraform(this._payModel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recycle_backup_id: { + value: cdktf.stringToHclTerraform(this._recycleBackupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recycle_status: { + value: cdktf.stringToHclTerraform(this._recycleStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_size: { + value: cdktf.stringToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/README.md new file mode 100644 index 00000000..dcbe7765 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_restore_time_ranges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_restore_time_ranges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/index.ts new file mode 100644 index 00000000..bb27c368 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restore-time-ranges/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsRestoreTimeRangesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the date to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges#date DataHuaweicloudRdsRestoreTimeRanges#date} + */ + readonly date?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges#id DataHuaweicloudRdsRestoreTimeRanges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges#instance_id DataHuaweicloudRdsRestoreTimeRanges#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges#region DataHuaweicloudRdsRestoreTimeRanges#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsRestoreTimeRangesRestoreTime { +} + +export function dataHuaweicloudRdsRestoreTimeRangesRestoreTimeToTerraform(struct?: DataHuaweicloudRdsRestoreTimeRangesRestoreTime): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoreTimeRangesRestoreTimeToHclTerraform(struct?: DataHuaweicloudRdsRestoreTimeRangesRestoreTime): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoreTimeRangesRestoreTimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoreTimeRangesRestoreTime | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoreTimeRangesRestoreTime | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getNumberAttribute('end_time'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getNumberAttribute('start_time'); + } +} + +export class DataHuaweicloudRdsRestoreTimeRangesRestoreTimeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoreTimeRangesRestoreTimeOutputReference { + return new DataHuaweicloudRdsRestoreTimeRangesRestoreTimeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges huaweicloud_rds_restore_time_ranges} +*/ +export class DataHuaweicloudRdsRestoreTimeRanges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_restore_time_ranges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsRestoreTimeRanges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsRestoreTimeRanges to import + * @param importFromId The id of the existing DataHuaweicloudRdsRestoreTimeRanges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsRestoreTimeRanges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_restore_time_ranges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restore_time_ranges huaweicloud_rds_restore_time_ranges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsRestoreTimeRangesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsRestoreTimeRangesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_restore_time_ranges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._date = config.date; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // date - computed: false, optional: true, required: false + private _date?: string; + public get date() { + return this.getStringAttribute('date'); + } + public set date(value: string) { + this._date = value; + } + public resetDate() { + this._date = undefined; + } + // Temporarily expose input value. Use with caution. + public get dateInput() { + return this._date; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: true, optional: false, required: false + private _restoreTime = new DataHuaweicloudRdsRestoreTimeRangesRestoreTimeList(this, "restore_time", false); + public get restoreTime() { + return this._restoreTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + date: cdktf.stringToTerraform(this._date), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + date: { + value: cdktf.stringToHclTerraform(this._date), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/README.md new file mode 100644 index 00000000..aa156e50 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_restored_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_restored_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/index.ts new file mode 100644 index 00000000..8b1e7bc8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-databases/index.ts @@ -0,0 +1,462 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsRestoredDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#database_name_like DataHuaweicloudRdsRestoredDatabases#database_name_like} + */ + readonly databaseNameLike?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#engine DataHuaweicloudRdsRestoredDatabases#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#id DataHuaweicloudRdsRestoredDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#instance_ids DataHuaweicloudRdsRestoredDatabases#instance_ids} + */ + readonly instanceIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#instance_name_like DataHuaweicloudRdsRestoredDatabases#instance_name_like} + */ + readonly instanceNameLike?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#region DataHuaweicloudRdsRestoredDatabases#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#restore_time DataHuaweicloudRdsRestoredDatabases#restore_time} + */ + readonly restoreTime: string; +} +export interface DataHuaweicloudRdsRestoredDatabasesInstancesDatabases { +} + +export function dataHuaweicloudRdsRestoredDatabasesInstancesDatabasesToTerraform(struct?: DataHuaweicloudRdsRestoredDatabasesInstancesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoredDatabasesInstancesDatabasesToHclTerraform(struct?: DataHuaweicloudRdsRestoredDatabasesInstancesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoredDatabasesInstancesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoredDatabasesInstancesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoredDatabasesInstancesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // total_tables - computed: true, optional: false, required: false + public get totalTables() { + return this.getNumberAttribute('total_tables'); + } +} + +export class DataHuaweicloudRdsRestoredDatabasesInstancesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoredDatabasesInstancesDatabasesOutputReference { + return new DataHuaweicloudRdsRestoredDatabasesInstancesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsRestoredDatabasesInstances { +} + +export function dataHuaweicloudRdsRestoredDatabasesInstancesToTerraform(struct?: DataHuaweicloudRdsRestoredDatabasesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoredDatabasesInstancesToHclTerraform(struct?: DataHuaweicloudRdsRestoredDatabasesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoredDatabasesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoredDatabasesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoredDatabasesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsRestoredDatabasesInstancesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // total_tables - computed: true, optional: false, required: false + public get totalTables() { + return this.getNumberAttribute('total_tables'); + } +} + +export class DataHuaweicloudRdsRestoredDatabasesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoredDatabasesInstancesOutputReference { + return new DataHuaweicloudRdsRestoredDatabasesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases huaweicloud_rds_restored_databases} +*/ +export class DataHuaweicloudRdsRestoredDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_restored_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsRestoredDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsRestoredDatabases to import + * @param importFromId The id of the existing DataHuaweicloudRdsRestoredDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsRestoredDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_restored_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_databases huaweicloud_rds_restored_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsRestoredDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsRestoredDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_restored_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseNameLike = config.databaseNameLike; + this._engine = config.engine; + this._id = config.id; + this._instanceIds = config.instanceIds; + this._instanceNameLike = config.instanceNameLike; + this._region = config.region; + this._restoreTime = config.restoreTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_limit - computed: true, optional: false, required: false + public get databaseLimit() { + return this.getNumberAttribute('database_limit'); + } + + // database_name_like - computed: false, optional: true, required: false + private _databaseNameLike?: string; + public get databaseNameLike() { + return this.getStringAttribute('database_name_like'); + } + public set databaseNameLike(value: string) { + this._databaseNameLike = value; + } + public resetDatabaseNameLike() { + this._databaseNameLike = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameLikeInput() { + return this._databaseNameLike; + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_ids - computed: false, optional: false, required: true + private _instanceIds?: string[]; + public get instanceIds() { + return this.getListAttribute('instance_ids'); + } + public set instanceIds(value: string[]) { + this._instanceIds = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdsInput() { + return this._instanceIds; + } + + // instance_name_like - computed: false, optional: true, required: false + private _instanceNameLike?: string; + public get instanceNameLike() { + return this.getStringAttribute('instance_name_like'); + } + public set instanceNameLike(value: string) { + this._instanceNameLike = value; + } + public resetInstanceNameLike() { + this._instanceNameLike = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNameLikeInput() { + return this._instanceNameLike; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudRdsRestoredDatabasesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // table_limit - computed: true, optional: false, required: false + public get tableLimit() { + return this.getNumberAttribute('table_limit'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name_like: cdktf.stringToTerraform(this._databaseNameLike), + engine: cdktf.stringToTerraform(this._engine), + id: cdktf.stringToTerraform(this._id), + instance_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._instanceIds), + instance_name_like: cdktf.stringToTerraform(this._instanceNameLike), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name_like: { + value: cdktf.stringToHclTerraform(this._databaseNameLike), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._instanceIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + instance_name_like: { + value: cdktf.stringToHclTerraform(this._instanceNameLike), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/README.md new file mode 100644 index 00000000..323281d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_restored_tables` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_restored_tables`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/index.ts new file mode 100644 index 00000000..4a39fd11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-restored-tables/index.ts @@ -0,0 +1,652 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsRestoredTablesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#database_name_like DataHuaweicloudRdsRestoredTables#database_name_like} + */ + readonly databaseNameLike?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#engine DataHuaweicloudRdsRestoredTables#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#id DataHuaweicloudRdsRestoredTables#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#instance_ids DataHuaweicloudRdsRestoredTables#instance_ids} + */ + readonly instanceIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#instance_name_like DataHuaweicloudRdsRestoredTables#instance_name_like} + */ + readonly instanceNameLike?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#region DataHuaweicloudRdsRestoredTables#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#restore_time DataHuaweicloudRdsRestoredTables#restore_time} + */ + readonly restoreTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#table_name_like DataHuaweicloudRdsRestoredTables#table_name_like} + */ + readonly tableNameLike?: string; +} +export interface DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTables { +} + +export function dataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesToTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesToHclTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesOutputReference { + return new DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemas { +} + +export function dataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasToTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasToHclTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tables - computed: true, optional: false, required: false + private _tables = new DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasTablesList(this, "tables", false); + public get tables() { + return this._tables; + } + + // total_tables - computed: true, optional: false, required: false + public get totalTables() { + return this.getNumberAttribute('total_tables'); + } +} + +export class DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasOutputReference { + return new DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsRestoredTablesInstancesDatabases { +} + +export function dataHuaweicloudRdsRestoredTablesInstancesDatabasesToTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstancesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoredTablesInstancesDatabasesToHclTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstancesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoredTablesInstancesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoredTablesInstancesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoredTablesInstancesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // schemas - computed: true, optional: false, required: false + private _schemas = new DataHuaweicloudRdsRestoredTablesInstancesDatabasesSchemasList(this, "schemas", false); + public get schemas() { + return this._schemas; + } + + // total_tables - computed: true, optional: false, required: false + public get totalTables() { + return this.getNumberAttribute('total_tables'); + } +} + +export class DataHuaweicloudRdsRestoredTablesInstancesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoredTablesInstancesDatabasesOutputReference { + return new DataHuaweicloudRdsRestoredTablesInstancesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRdsRestoredTablesInstances { +} + +export function dataHuaweicloudRdsRestoredTablesInstancesToTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsRestoredTablesInstancesToHclTerraform(struct?: DataHuaweicloudRdsRestoredTablesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsRestoredTablesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsRestoredTablesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsRestoredTablesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsRestoredTablesInstancesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // total_tables - computed: true, optional: false, required: false + public get totalTables() { + return this.getNumberAttribute('total_tables'); + } +} + +export class DataHuaweicloudRdsRestoredTablesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsRestoredTablesInstancesOutputReference { + return new DataHuaweicloudRdsRestoredTablesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables huaweicloud_rds_restored_tables} +*/ +export class DataHuaweicloudRdsRestoredTables extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_restored_tables"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsRestoredTables resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsRestoredTables to import + * @param importFromId The id of the existing DataHuaweicloudRdsRestoredTables that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsRestoredTables to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_restored_tables", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_restored_tables huaweicloud_rds_restored_tables} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsRestoredTablesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsRestoredTablesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_restored_tables', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseNameLike = config.databaseNameLike; + this._engine = config.engine; + this._id = config.id; + this._instanceIds = config.instanceIds; + this._instanceNameLike = config.instanceNameLike; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._tableNameLike = config.tableNameLike; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_name_like - computed: false, optional: true, required: false + private _databaseNameLike?: string; + public get databaseNameLike() { + return this.getStringAttribute('database_name_like'); + } + public set databaseNameLike(value: string) { + this._databaseNameLike = value; + } + public resetDatabaseNameLike() { + this._databaseNameLike = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameLikeInput() { + return this._databaseNameLike; + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_ids - computed: false, optional: false, required: true + private _instanceIds?: string[]; + public get instanceIds() { + return this.getListAttribute('instance_ids'); + } + public set instanceIds(value: string[]) { + this._instanceIds = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdsInput() { + return this._instanceIds; + } + + // instance_name_like - computed: false, optional: true, required: false + private _instanceNameLike?: string; + public get instanceNameLike() { + return this.getStringAttribute('instance_name_like'); + } + public set instanceNameLike(value: string) { + this._instanceNameLike = value; + } + public resetInstanceNameLike() { + this._instanceNameLike = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNameLikeInput() { + return this._instanceNameLike; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudRdsRestoredTablesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // table_limit - computed: true, optional: false, required: false + public get tableLimit() { + return this.getNumberAttribute('table_limit'); + } + + // table_name_like - computed: false, optional: true, required: false + private _tableNameLike?: string; + public get tableNameLike() { + return this.getStringAttribute('table_name_like'); + } + public set tableNameLike(value: string) { + this._tableNameLike = value; + } + public resetTableNameLike() { + this._tableNameLike = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableNameLikeInput() { + return this._tableNameLike; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name_like: cdktf.stringToTerraform(this._databaseNameLike), + engine: cdktf.stringToTerraform(this._engine), + id: cdktf.stringToTerraform(this._id), + instance_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._instanceIds), + instance_name_like: cdktf.stringToTerraform(this._instanceNameLike), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + table_name_like: cdktf.stringToTerraform(this._tableNameLike), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name_like: { + value: cdktf.stringToHclTerraform(this._databaseNameLike), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._instanceIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + instance_name_like: { + value: cdktf.stringToHclTerraform(this._instanceNameLike), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_name_like: { + value: cdktf.stringToHclTerraform(this._tableNameLike), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/README.md new file mode 100644 index 00000000..e407ce3f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_slow_log_files` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_slow_log_files`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/index.ts new file mode 100644 index 00000000..4125c130 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-files/index.ts @@ -0,0 +1,259 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSlowLogFilesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files#id DataHuaweicloudRdsSlowLogFiles#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files#instance_id DataHuaweicloudRdsSlowLogFiles#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files#region DataHuaweicloudRdsSlowLogFiles#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsSlowLogFilesFiles { +} + +export function dataHuaweicloudRdsSlowLogFilesFilesToTerraform(struct?: DataHuaweicloudRdsSlowLogFilesFiles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSlowLogFilesFilesToHclTerraform(struct?: DataHuaweicloudRdsSlowLogFilesFiles): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSlowLogFilesFilesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSlowLogFilesFiles | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSlowLogFilesFiles | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_name - computed: true, optional: false, required: false + public get fileName() { + return this.getStringAttribute('file_name'); + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } +} + +export class DataHuaweicloudRdsSlowLogFilesFilesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSlowLogFilesFilesOutputReference { + return new DataHuaweicloudRdsSlowLogFilesFilesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files huaweicloud_rds_slow_log_files} +*/ +export class DataHuaweicloudRdsSlowLogFiles extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_slow_log_files"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSlowLogFiles resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSlowLogFiles to import + * @param importFromId The id of the existing DataHuaweicloudRdsSlowLogFiles that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSlowLogFiles to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_slow_log_files", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_files huaweicloud_rds_slow_log_files} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSlowLogFilesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSlowLogFilesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_slow_log_files', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // files - computed: true, optional: false, required: false + private _files = new DataHuaweicloudRdsSlowLogFilesFilesList(this, "files", false); + public get files() { + return this._files; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/README.md new file mode 100644 index 00000000..1da90f49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_slow_log_link` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_slow_log_link`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/index.ts new file mode 100644 index 00000000..6d08698e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-log-link/index.ts @@ -0,0 +1,340 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSlowLogLinkConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the file to be downloaded. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#file_name DataHuaweicloudRdsSlowLogLink#file_name} + */ + readonly fileName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#id DataHuaweicloudRdsSlowLogLink#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#instance_id DataHuaweicloudRdsSlowLogLink#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#region DataHuaweicloudRdsSlowLogLink#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#timeouts DataHuaweicloudRdsSlowLogLink#timeouts} + */ + readonly timeouts?: DataHuaweicloudRdsSlowLogLinkTimeouts; +} +export interface DataHuaweicloudRdsSlowLogLinkTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#read DataHuaweicloudRdsSlowLogLink#read} + */ + readonly read?: string; +} + +export function dataHuaweicloudRdsSlowLogLinkTimeoutsToTerraform(struct?: DataHuaweicloudRdsSlowLogLinkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + read: cdktf.stringToTerraform(struct!.read), + } +} + + +export function dataHuaweicloudRdsSlowLogLinkTimeoutsToHclTerraform(struct?: DataHuaweicloudRdsSlowLogLinkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + read: { + value: cdktf.stringToHclTerraform(struct!.read), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudRdsSlowLogLinkTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataHuaweicloudRdsSlowLogLinkTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._read !== undefined) { + hasAnyValues = true; + internalValueResult.read = this._read; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSlowLogLinkTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._read = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._read = value.read; + } + } + + // read - computed: false, optional: true, required: false + private _read?: string; + public get read() { + return this.getStringAttribute('read'); + } + public set read(value: string) { + this._read = value; + } + public resetRead() { + this._read = undefined; + } + // Temporarily expose input value. Use with caution. + public get readInput() { + return this._read; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link huaweicloud_rds_slow_log_link} +*/ +export class DataHuaweicloudRdsSlowLogLink extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_slow_log_link"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSlowLogLink resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSlowLogLink to import + * @param importFromId The id of the existing DataHuaweicloudRdsSlowLogLink that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSlowLogLink to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_slow_log_link", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_log_link huaweicloud_rds_slow_log_link} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSlowLogLinkConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSlowLogLinkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_slow_log_link', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fileName = config.fileName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getNumberAttribute('created_at'); + } + + // file_link - computed: true, optional: false, required: false + public get fileLink() { + return this.getStringAttribute('file_link'); + } + + // file_name - computed: false, optional: true, required: false + private _fileName?: string; + public get fileName() { + return this.getStringAttribute('file_name'); + } + public set fileName(value: string) { + this._fileName = value; + } + public resetFileName() { + this._fileName = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNameInput() { + return this._fileName; + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataHuaweicloudRdsSlowLogLinkTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataHuaweicloudRdsSlowLogLinkTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + file_name: cdktf.stringToTerraform(this._fileName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dataHuaweicloudRdsSlowLogLinkTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + file_name: { + value: cdktf.stringToHclTerraform(this._fileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataHuaweicloudRdsSlowLogLinkTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataHuaweicloudRdsSlowLogLinkTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/README.md new file mode 100644 index 00000000..74fc359c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_slow_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_slow_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/index.ts new file mode 100644 index 00000000..49b909a4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-slow-logs/index.ts @@ -0,0 +1,448 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSlowLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#database DataHuaweicloudRdsSlowLogs#database} + */ + readonly database?: string; + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#end_time DataHuaweicloudRdsSlowLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#id DataHuaweicloudRdsSlowLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#instance_id DataHuaweicloudRdsSlowLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#region DataHuaweicloudRdsSlowLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#start_time DataHuaweicloudRdsSlowLogs#start_time} + */ + readonly startTime: string; + /** + * Specifies the statement type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#type DataHuaweicloudRdsSlowLogs#type} + */ + readonly type?: string; + /** + * Specifies the name of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#users DataHuaweicloudRdsSlowLogs#users} + */ + readonly users?: string; +} +export interface DataHuaweicloudRdsSlowLogsSlowLogs { +} + +export function dataHuaweicloudRdsSlowLogsSlowLogsToTerraform(struct?: DataHuaweicloudRdsSlowLogsSlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSlowLogsSlowLogsToHclTerraform(struct?: DataHuaweicloudRdsSlowLogsSlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSlowLogsSlowLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSlowLogsSlowLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSlowLogsSlowLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_ip - computed: true, optional: false, required: false + public get clientIp() { + return this.getStringAttribute('client_ip'); + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getStringAttribute('count'); + } + + // database - computed: true, optional: false, required: false + public get database() { + return this.getStringAttribute('database'); + } + + // lock_time - computed: true, optional: false, required: false + public get lockTime() { + return this.getStringAttribute('lock_time'); + } + + // query_sample - computed: true, optional: false, required: false + public get querySample() { + return this.getStringAttribute('query_sample'); + } + + // rows_examined - computed: true, optional: false, required: false + public get rowsExamined() { + return this.getStringAttribute('rows_examined'); + } + + // rows_sent - computed: true, optional: false, required: false + public get rowsSent() { + return this.getStringAttribute('rows_sent'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getStringAttribute('time'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // users - computed: true, optional: false, required: false + public get users() { + return this.getStringAttribute('users'); + } +} + +export class DataHuaweicloudRdsSlowLogsSlowLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSlowLogsSlowLogsOutputReference { + return new DataHuaweicloudRdsSlowLogsSlowLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs huaweicloud_rds_slow_logs} +*/ +export class DataHuaweicloudRdsSlowLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_slow_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSlowLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSlowLogs to import + * @param importFromId The id of the existing DataHuaweicloudRdsSlowLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSlowLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_slow_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_slow_logs huaweicloud_rds_slow_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSlowLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSlowLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_slow_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._database = config.database; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._startTime = config.startTime; + this._type = config.type; + this._users = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // database - computed: false, optional: true, required: false + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + public resetDatabase() { + this._database = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // slow_logs - computed: true, optional: false, required: false + private _slowLogs = new DataHuaweicloudRdsSlowLogsSlowLogsList(this, "slow_logs", false); + public get slowLogs() { + return this._slowLogs; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // users - computed: false, optional: true, required: false + private _users?: string; + public get users() { + return this.getStringAttribute('users'); + } + public set users(value: string) { + this._users = value; + } + public resetUsers() { + this._users = undefined; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database: cdktf.stringToTerraform(this._database), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + type: cdktf.stringToTerraform(this._type), + users: cdktf.stringToTerraform(this._users), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database: { + value: cdktf.stringToHclTerraform(this._database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.stringToHclTerraform(this._users), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/README.md new file mode 100644 index 00000000..becab950 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sql_audit_log_links` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sql_audit_log_links`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/index.ts new file mode 100644 index 00000000..daa69c1f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-log-links/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlAuditLogLinksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links#id DataHuaweicloudRdsSqlAuditLogLinks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the list of audit log IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links#ids DataHuaweicloudRdsSqlAuditLogLinks#ids} + */ + readonly ids: string[]; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links#instance_id DataHuaweicloudRdsSqlAuditLogLinks#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links#region DataHuaweicloudRdsSqlAuditLogLinks#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links huaweicloud_rds_sql_audit_log_links} +*/ +export class DataHuaweicloudRdsSqlAuditLogLinks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sql_audit_log_links"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlAuditLogLinks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlAuditLogLinks to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlAuditLogLinks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlAuditLogLinks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sql_audit_log_links", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_log_links huaweicloud_rds_sql_audit_log_links} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlAuditLogLinksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlAuditLogLinksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sql_audit_log_links', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ids = config.ids; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: false, optional: false, required: true + private _ids?: string[]; + public get ids() { + return this.getListAttribute('ids'); + } + public set ids(value: string[]) { + this._ids = value; + } + // Temporarily expose input value. Use with caution. + public get idsInput() { + return this._ids; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // links - computed: true, optional: false, required: false + public get links() { + return this.getListAttribute('links'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ids), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ids), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/README.md new file mode 100644 index 00000000..32b1f351 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sql_audit_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sql_audit_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/index.ts new file mode 100644 index 00000000..892d4213 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-logs/index.ts @@ -0,0 +1,328 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlAuditLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs#end_time DataHuaweicloudRdsSqlAuditLogs#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs#id DataHuaweicloudRdsSqlAuditLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs#instance_id DataHuaweicloudRdsSqlAuditLogs#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs#region DataHuaweicloudRdsSqlAuditLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time in the **yyyy-mm-ddThh:mm:ssZ** format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs#start_time DataHuaweicloudRdsSqlAuditLogs#start_time} + */ + readonly startTime: string; +} +export interface DataHuaweicloudRdsSqlAuditLogsAuditLogs { +} + +export function dataHuaweicloudRdsSqlAuditLogsAuditLogsToTerraform(struct?: DataHuaweicloudRdsSqlAuditLogsAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSqlAuditLogsAuditLogsToHclTerraform(struct?: DataHuaweicloudRdsSqlAuditLogsAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSqlAuditLogsAuditLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSqlAuditLogsAuditLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSqlAuditLogsAuditLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudRdsSqlAuditLogsAuditLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSqlAuditLogsAuditLogsOutputReference { + return new DataHuaweicloudRdsSqlAuditLogsAuditLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs huaweicloud_rds_sql_audit_logs} +*/ +export class DataHuaweicloudRdsSqlAuditLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sql_audit_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlAuditLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlAuditLogs to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlAuditLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlAuditLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sql_audit_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_logs huaweicloud_rds_sql_audit_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlAuditLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlAuditLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sql_audit_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._startTime = config.startTime; + } + + // ========== + // ATTRIBUTES + // ========== + + // audit_logs - computed: true, optional: false, required: false + private _auditLogs = new DataHuaweicloudRdsSqlAuditLogsAuditLogsList(this, "audit_logs", false); + public get auditLogs() { + return this._auditLogs; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/README.md new file mode 100644 index 00000000..9c785789 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sql_audit_operations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sql_audit_operations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/index.ts new file mode 100644 index 00000000..8bb759bd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sql-audit-operations/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlAuditOperationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations#id DataHuaweicloudRdsSqlAuditOperations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations#instance_id DataHuaweicloudRdsSqlAuditOperations#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the list of the operation type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations#operation_types DataHuaweicloudRdsSqlAuditOperations#operation_types} + */ + readonly operationTypes?: string[]; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations#region DataHuaweicloudRdsSqlAuditOperations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsSqlAuditOperationsOperations { +} + +export function dataHuaweicloudRdsSqlAuditOperationsOperationsToTerraform(struct?: DataHuaweicloudRdsSqlAuditOperationsOperations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSqlAuditOperationsOperationsToHclTerraform(struct?: DataHuaweicloudRdsSqlAuditOperationsOperations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSqlAuditOperationsOperationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSqlAuditOperationsOperations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSqlAuditOperationsOperations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRdsSqlAuditOperationsOperationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSqlAuditOperationsOperationsOutputReference { + return new DataHuaweicloudRdsSqlAuditOperationsOperationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations huaweicloud_rds_sql_audit_operations} +*/ +export class DataHuaweicloudRdsSqlAuditOperations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sql_audit_operations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlAuditOperations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlAuditOperations to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlAuditOperations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlAuditOperations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sql_audit_operations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sql_audit_operations huaweicloud_rds_sql_audit_operations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlAuditOperationsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlAuditOperationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sql_audit_operations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._operationTypes = config.operationTypes; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // operation_types - computed: false, optional: true, required: false + private _operationTypes?: string[]; + public get operationTypes() { + return this.getListAttribute('operation_types'); + } + public set operationTypes(value: string[]) { + this._operationTypes = value; + } + public resetOperationTypes() { + this._operationTypes = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationTypesInput() { + return this._operationTypes; + } + + // operations - computed: true, optional: false, required: false + private _operations = new DataHuaweicloudRdsSqlAuditOperationsOperationsList(this, "operations", false); + public get operations() { + return this._operations; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + operation_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._operationTypes), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._operationTypes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/README.md new file mode 100644 index 00000000..d2dec898 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sqlserver_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sqlserver_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/index.ts new file mode 100644 index 00000000..8b378997 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-accounts/index.ts @@ -0,0 +1,311 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlserverAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts#id DataHuaweicloudRdsSqlserverAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts#instance_id DataHuaweicloudRdsSqlserverAccounts#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts#region DataHuaweicloudRdsSqlserverAccounts#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts#state DataHuaweicloudRdsSqlserverAccounts#state} + */ + readonly state?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts#user_name DataHuaweicloudRdsSqlserverAccounts#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudRdsSqlserverAccountsUsers { +} + +export function dataHuaweicloudRdsSqlserverAccountsUsersToTerraform(struct?: DataHuaweicloudRdsSqlserverAccountsUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSqlserverAccountsUsersToHclTerraform(struct?: DataHuaweicloudRdsSqlserverAccountsUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSqlserverAccountsUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSqlserverAccountsUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSqlserverAccountsUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } +} + +export class DataHuaweicloudRdsSqlserverAccountsUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSqlserverAccountsUsersOutputReference { + return new DataHuaweicloudRdsSqlserverAccountsUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts huaweicloud_rds_sqlserver_accounts} +*/ +export class DataHuaweicloudRdsSqlserverAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlserverAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlserverAccounts to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlserverAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlserverAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_accounts huaweicloud_rds_sqlserver_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlserverAccountsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlserverAccountsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._state = config.state; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudRdsSqlserverAccountsUsersList(this, "users", false); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + state: cdktf.stringToTerraform(this._state), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/README.md new file mode 100644 index 00000000..520e6eaf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sqlserver_collations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sqlserver_collations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/index.ts new file mode 100644 index 00000000..971ca7f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-collations/index.ts @@ -0,0 +1,149 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlserverCollationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations#id DataHuaweicloudRdsSqlserverCollations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations#region DataHuaweicloudRdsSqlserverCollations#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations huaweicloud_rds_sqlserver_collations} +*/ +export class DataHuaweicloudRdsSqlserverCollations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_collations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlserverCollations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlserverCollations to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlserverCollations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlserverCollations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_collations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_collations huaweicloud_rds_sqlserver_collations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlserverCollationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlserverCollationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_collations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // char_sets - computed: true, optional: false, required: false + public get charSets() { + return this.getListAttribute('char_sets'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/README.md new file mode 100644 index 00000000..cde1eb02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sqlserver_database_privileges` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sqlserver_database_privileges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/index.ts new file mode 100644 index 00000000..cdbfa5c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-database-privileges/index.ts @@ -0,0 +1,336 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlserverDatabasePrivilegesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#db_name DataHuaweicloudRdsSqlserverDatabasePrivileges#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#id DataHuaweicloudRdsSqlserverDatabasePrivileges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#instance_id DataHuaweicloudRdsSqlserverDatabasePrivileges#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#readonly DataHuaweicloudRdsSqlserverDatabasePrivileges#readonly} + */ + readonly readonly?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#region DataHuaweicloudRdsSqlserverDatabasePrivileges#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#user_name DataHuaweicloudRdsSqlserverDatabasePrivileges#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudRdsSqlserverDatabasePrivilegesUsers { +} + +export function dataHuaweicloudRdsSqlserverDatabasePrivilegesUsersToTerraform(struct?: DataHuaweicloudRdsSqlserverDatabasePrivilegesUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSqlserverDatabasePrivilegesUsersToHclTerraform(struct?: DataHuaweicloudRdsSqlserverDatabasePrivilegesUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSqlserverDatabasePrivilegesUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSqlserverDatabasePrivilegesUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSqlserverDatabasePrivilegesUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } +} + +export class DataHuaweicloudRdsSqlserverDatabasePrivilegesUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSqlserverDatabasePrivilegesUsersOutputReference { + return new DataHuaweicloudRdsSqlserverDatabasePrivilegesUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges huaweicloud_rds_sqlserver_database_privileges} +*/ +export class DataHuaweicloudRdsSqlserverDatabasePrivileges extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_database_privileges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlserverDatabasePrivileges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlserverDatabasePrivileges to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlserverDatabasePrivileges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlserverDatabasePrivileges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_database_privileges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_database_privileges huaweicloud_rds_sqlserver_database_privileges} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlserverDatabasePrivilegesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlserverDatabasePrivilegesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_database_privileges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._readonly = config.readonly; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // readonly - computed: false, optional: true, required: false + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + public resetReadonly() { + this._readonly = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudRdsSqlserverDatabasePrivilegesUsersList(this, "users", true); + public get users() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + readonly: cdktf.booleanToTerraform(this._readonly), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(this._readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/README.md new file mode 100644 index 00000000..72c3ffdf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_sqlserver_databases` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_sqlserver_databases`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/index.ts new file mode 100644 index 00000000..01e76bde --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-sqlserver-databases/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsSqlserverDatabasesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#character_set DataHuaweicloudRdsSqlserverDatabases#character_set} + */ + readonly characterSet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#id DataHuaweicloudRdsSqlserverDatabases#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#instance_id DataHuaweicloudRdsSqlserverDatabases#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#name DataHuaweicloudRdsSqlserverDatabases#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#region DataHuaweicloudRdsSqlserverDatabases#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#state DataHuaweicloudRdsSqlserverDatabases#state} + */ + readonly state?: string; +} +export interface DataHuaweicloudRdsSqlserverDatabasesDatabases { +} + +export function dataHuaweicloudRdsSqlserverDatabasesDatabasesToTerraform(struct?: DataHuaweicloudRdsSqlserverDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsSqlserverDatabasesDatabasesToHclTerraform(struct?: DataHuaweicloudRdsSqlserverDatabasesDatabases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsSqlserverDatabasesDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsSqlserverDatabasesDatabases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsSqlserverDatabasesDatabases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // character_set - computed: true, optional: false, required: false + public get characterSet() { + return this.getStringAttribute('character_set'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } +} + +export class DataHuaweicloudRdsSqlserverDatabasesDatabasesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsSqlserverDatabasesDatabasesOutputReference { + return new DataHuaweicloudRdsSqlserverDatabasesDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases huaweicloud_rds_sqlserver_databases} +*/ +export class DataHuaweicloudRdsSqlserverDatabases extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_databases"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsSqlserverDatabases resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsSqlserverDatabases to import + * @param importFromId The id of the existing DataHuaweicloudRdsSqlserverDatabases that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsSqlserverDatabases to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_databases", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_sqlserver_databases huaweicloud_rds_sqlserver_databases} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsSqlserverDatabasesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsSqlserverDatabasesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_databases', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._state = config.state; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: true, required: false + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + public resetCharacterSet() { + this._characterSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // databases - computed: true, optional: false, required: false + private _databases = new DataHuaweicloudRdsSqlserverDatabasesDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + state: cdktf.stringToTerraform(this._state), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/README.md new file mode 100644 index 00000000..0d0b9766 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rds_storage_types` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rds_storage_types`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/index.ts new file mode 100644 index 00000000..fe6c6705 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rds-storage-types/index.ts @@ -0,0 +1,320 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRdsStorageTypesConfig extends cdktf.TerraformMetaArguments { + /** + * DB engine. The valid values are **MySQL**, **PostgreSQL**, **SQLServer**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types#db_type DataHuaweicloudRdsStorageTypes#db_type} + */ + readonly dbType: string; + /** + * DB version number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types#db_version DataHuaweicloudRdsStorageTypes#db_version} + */ + readonly dbVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types#id DataHuaweicloudRdsStorageTypes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * HA mode. The valid values are **single**, **ha**, **replica**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types#instance_mode DataHuaweicloudRdsStorageTypes#instance_mode} + */ + readonly instanceMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types#region DataHuaweicloudRdsStorageTypes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudRdsStorageTypesStorageTypes { +} + +export function dataHuaweicloudRdsStorageTypesStorageTypesToTerraform(struct?: DataHuaweicloudRdsStorageTypesStorageTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRdsStorageTypesStorageTypesToHclTerraform(struct?: DataHuaweicloudRdsStorageTypesStorageTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRdsStorageTypesStorageTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRdsStorageTypesStorageTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRdsStorageTypesStorageTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_status - computed: true, optional: false, required: false + private _azStatus = new cdktf.StringMap(this, "az_status"); + public get azStatus() { + return this._azStatus; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // support_compute_group_type - computed: true, optional: false, required: false + public get supportComputeGroupType() { + return this.getListAttribute('support_compute_group_type'); + } +} + +export class DataHuaweicloudRdsStorageTypesStorageTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRdsStorageTypesStorageTypesOutputReference { + return new DataHuaweicloudRdsStorageTypesStorageTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types huaweicloud_rds_storage_types} +*/ +export class DataHuaweicloudRdsStorageTypes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_storage_types"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRdsStorageTypes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRdsStorageTypes to import + * @param importFromId The id of the existing DataHuaweicloudRdsStorageTypes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRdsStorageTypes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_storage_types", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rds_storage_types huaweicloud_rds_storage_types} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRdsStorageTypesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRdsStorageTypesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_storage_types', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbType = config.dbType; + this._dbVersion = config.dbVersion; + this._id = config.id; + this._instanceMode = config.instanceMode; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_type - computed: false, optional: false, required: true + private _dbType?: string; + public get dbType() { + return this.getStringAttribute('db_type'); + } + public set dbType(value: string) { + this._dbType = value; + } + // Temporarily expose input value. Use with caution. + public get dbTypeInput() { + return this._dbType; + } + + // db_version - computed: false, optional: false, required: true + private _dbVersion?: string; + public get dbVersion() { + return this.getStringAttribute('db_version'); + } + public set dbVersion(value: string) { + this._dbVersion = value; + } + // Temporarily expose input value. Use with caution. + public get dbVersionInput() { + return this._dbVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_mode - computed: false, optional: true, required: false + private _instanceMode?: string; + public get instanceMode() { + return this.getStringAttribute('instance_mode'); + } + public set instanceMode(value: string) { + this._instanceMode = value; + } + public resetInstanceMode() { + this._instanceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceModeInput() { + return this._instanceMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_types - computed: true, optional: false, required: false + private _storageTypes = new DataHuaweicloudRdsStorageTypesStorageTypesList(this, "storage_types", false); + public get storageTypes() { + return this._storageTypes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_type: cdktf.stringToTerraform(this._dbType), + db_version: cdktf.stringToTerraform(this._dbVersion), + id: cdktf.stringToTerraform(this._id), + instance_mode: cdktf.stringToTerraform(this._instanceMode), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_type: { + value: cdktf.stringToHclTerraform(this._dbType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_version: { + value: cdktf.stringToHclTerraform(this._dbVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_mode: { + value: cdktf.stringToHclTerraform(this._instanceMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/README.md new file mode 100644 index 00000000..39a07070 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_advanced_queries` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_advanced_queries`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/index.ts new file mode 100644 index 00000000..699ab265 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-queries/index.ts @@ -0,0 +1,282 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAdvancedQueriesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries#id DataHuaweicloudRmsAdvancedQueries#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the advanced query name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries#name DataHuaweicloudRmsAdvancedQueries#name} + */ + readonly name?: string; + /** + * Specifies the advanced query ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries#query_id DataHuaweicloudRmsAdvancedQueries#query_id} + */ + readonly queryId?: string; +} +export interface DataHuaweicloudRmsAdvancedQueriesQueries { +} + +export function dataHuaweicloudRmsAdvancedQueriesQueriesToTerraform(struct?: DataHuaweicloudRmsAdvancedQueriesQueries): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAdvancedQueriesQueriesToHclTerraform(struct?: DataHuaweicloudRmsAdvancedQueriesQueries): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAdvancedQueriesQueriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAdvancedQueriesQueries | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAdvancedQueriesQueries | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // expression - computed: true, optional: false, required: false + public get expression() { + return this.getStringAttribute('expression'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRmsAdvancedQueriesQueriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAdvancedQueriesQueriesOutputReference { + return new DataHuaweicloudRmsAdvancedQueriesQueriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries huaweicloud_rms_advanced_queries} +*/ +export class DataHuaweicloudRmsAdvancedQueries extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_advanced_queries"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAdvancedQueries resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAdvancedQueries to import + * @param importFromId The id of the existing DataHuaweicloudRmsAdvancedQueries that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAdvancedQueries to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_advanced_queries", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_queries huaweicloud_rms_advanced_queries} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAdvancedQueriesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAdvancedQueriesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_advanced_queries', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._queryId = config.queryId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // queries - computed: true, optional: false, required: false + private _queries = new DataHuaweicloudRmsAdvancedQueriesQueriesList(this, "queries", false); + public get queries() { + return this._queries; + } + + // query_id - computed: false, optional: true, required: false + private _queryId?: string; + public get queryId() { + return this.getStringAttribute('query_id'); + } + public set queryId(value: string) { + this._queryId = value; + } + public resetQueryId() { + this._queryId = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryIdInput() { + return this._queryId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + query_id: cdktf.stringToTerraform(this._queryId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_id: { + value: cdktf.stringToHclTerraform(this._queryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/README.md new file mode 100644 index 00000000..644045c4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_advanced_query_schemas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_advanced_query_schemas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/index.ts new file mode 100644 index 00000000..ce7d704e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query-schemas/index.ts @@ -0,0 +1,233 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAdvancedQuerySchemasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas#id DataHuaweicloudRmsAdvancedQuerySchemas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the type of the schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas#type DataHuaweicloudRmsAdvancedQuerySchemas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudRmsAdvancedQuerySchemasSchemas { +} + +export function dataHuaweicloudRmsAdvancedQuerySchemasSchemasToTerraform(struct?: DataHuaweicloudRmsAdvancedQuerySchemasSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAdvancedQuerySchemasSchemasToHclTerraform(struct?: DataHuaweicloudRmsAdvancedQuerySchemasSchemas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAdvancedQuerySchemasSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAdvancedQuerySchemasSchemas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAdvancedQuerySchemasSchemas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // schema - computed: true, optional: false, required: false + private _schema = new cdktf.StringMap(this, "schema"); + public get schema() { + return this._schema; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRmsAdvancedQuerySchemasSchemasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAdvancedQuerySchemasSchemasOutputReference { + return new DataHuaweicloudRmsAdvancedQuerySchemasSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas huaweicloud_rms_advanced_query_schemas} +*/ +export class DataHuaweicloudRmsAdvancedQuerySchemas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_advanced_query_schemas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAdvancedQuerySchemas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAdvancedQuerySchemas to import + * @param importFromId The id of the existing DataHuaweicloudRmsAdvancedQuerySchemas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAdvancedQuerySchemas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_advanced_query_schemas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query_schemas huaweicloud_rms_advanced_query_schemas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAdvancedQuerySchemasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAdvancedQuerySchemasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_advanced_query_schemas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // schemas - computed: true, optional: false, required: false + private _schemas = new DataHuaweicloudRmsAdvancedQuerySchemasSchemasList(this, "schemas", false); + public get schemas() { + return this._schemas; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/README.md new file mode 100644 index 00000000..5fcf1e77 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_advanced_query` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_advanced_query`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/index.ts new file mode 100644 index 00000000..f9b5abf3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-advanced-query/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAdvancedQueryConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query#expression DataHuaweicloudRmsAdvancedQuery#expression} + */ + readonly expression: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query#id DataHuaweicloudRmsAdvancedQuery#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} +export interface DataHuaweicloudRmsAdvancedQueryQueryInfo { +} + +export function dataHuaweicloudRmsAdvancedQueryQueryInfoToTerraform(struct?: DataHuaweicloudRmsAdvancedQueryQueryInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAdvancedQueryQueryInfoToHclTerraform(struct?: DataHuaweicloudRmsAdvancedQueryQueryInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAdvancedQueryQueryInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAdvancedQueryQueryInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAdvancedQueryQueryInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // select_fields - computed: true, optional: false, required: false + public get selectFields() { + return this.getListAttribute('select_fields'); + } +} + +export class DataHuaweicloudRmsAdvancedQueryQueryInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAdvancedQueryQueryInfoOutputReference { + return new DataHuaweicloudRmsAdvancedQueryQueryInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query huaweicloud_rms_advanced_query} +*/ +export class DataHuaweicloudRmsAdvancedQuery extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_advanced_query"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAdvancedQuery resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAdvancedQuery to import + * @param importFromId The id of the existing DataHuaweicloudRmsAdvancedQuery that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAdvancedQuery to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_advanced_query", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_advanced_query huaweicloud_rms_advanced_query} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAdvancedQueryConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAdvancedQueryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_advanced_query', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._expression = config.expression; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // query_info - computed: true, optional: false, required: false + private _queryInfo = new DataHuaweicloudRmsAdvancedQueryQueryInfoList(this, "query_info", false); + public get queryInfo() { + return this._queryInfo; + } + + // results - computed: true, optional: false, required: false + private _results = new cdktf.StringMapList(this, "results", false); + public get results() { + return this._results; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + expression: cdktf.stringToTerraform(this._expression), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + expression: { + value: cdktf.stringToHclTerraform(this._expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/README.md new file mode 100644 index 00000000..85c69136 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_assignment_package_results` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_assignment_package_results`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/index.ts new file mode 100644 index 00000000..0a20f855 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-results/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAssignmentPackageResultsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the assignment package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results#assignment_package_id DataHuaweicloudRmsAssignmentPackageResults#assignment_package_id} + */ + readonly assignmentPackageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results#id DataHuaweicloudRmsAssignmentPackageResults#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the policy assignment name. Fuzzy search is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results#policy_assignment_name DataHuaweicloudRmsAssignmentPackageResults#policy_assignment_name} + */ + readonly policyAssignmentName?: string; +} +export interface DataHuaweicloudRmsAssignmentPackageResultsValue { +} + +export function dataHuaweicloudRmsAssignmentPackageResultsValueToTerraform(struct?: DataHuaweicloudRmsAssignmentPackageResultsValue): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAssignmentPackageResultsValueToHclTerraform(struct?: DataHuaweicloudRmsAssignmentPackageResultsValue): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAssignmentPackageResultsValueOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAssignmentPackageResultsValue | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAssignmentPackageResultsValue | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compliance_state - computed: true, optional: false, required: false + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + + // evaluation_time - computed: true, optional: false, required: false + public get evaluationTime() { + return this.getStringAttribute('evaluation_time'); + } + + // policy_assignment_id - computed: true, optional: false, required: false + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + + // policy_assignment_name - computed: true, optional: false, required: false + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } +} + +export class DataHuaweicloudRmsAssignmentPackageResultsValueList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAssignmentPackageResultsValueOutputReference { + return new DataHuaweicloudRmsAssignmentPackageResultsValueOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results huaweicloud_rms_assignment_package_results} +*/ +export class DataHuaweicloudRmsAssignmentPackageResults extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_assignment_package_results"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAssignmentPackageResults resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAssignmentPackageResults to import + * @param importFromId The id of the existing DataHuaweicloudRmsAssignmentPackageResults that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAssignmentPackageResults to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_assignment_package_results", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_results huaweicloud_rms_assignment_package_results} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAssignmentPackageResultsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAssignmentPackageResultsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_assignment_package_results', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._assignmentPackageId = config.assignmentPackageId; + this._id = config.id; + this._policyAssignmentName = config.policyAssignmentName; + } + + // ========== + // ATTRIBUTES + // ========== + + // assignment_package_id - computed: false, optional: false, required: true + private _assignmentPackageId?: string; + public get assignmentPackageId() { + return this.getStringAttribute('assignment_package_id'); + } + public set assignmentPackageId(value: string) { + this._assignmentPackageId = value; + } + // Temporarily expose input value. Use with caution. + public get assignmentPackageIdInput() { + return this._assignmentPackageId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_assignment_name - computed: false, optional: true, required: false + private _policyAssignmentName?: string; + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } + public set policyAssignmentName(value: string) { + this._policyAssignmentName = value; + } + public resetPolicyAssignmentName() { + this._policyAssignmentName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentNameInput() { + return this._policyAssignmentName; + } + + // value - computed: true, optional: false, required: false + private _value = new DataHuaweicloudRmsAssignmentPackageResultsValueList(this, "value", false); + public get value() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + assignment_package_id: cdktf.stringToTerraform(this._assignmentPackageId), + id: cdktf.stringToTerraform(this._id), + policy_assignment_name: cdktf.stringToTerraform(this._policyAssignmentName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + assignment_package_id: { + value: cdktf.stringToHclTerraform(this._assignmentPackageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_name: { + value: cdktf.stringToHclTerraform(this._policyAssignmentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/README.md new file mode 100644 index 00000000..f99a53a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_assignment_package_scores` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_assignment_package_scores`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/index.ts new file mode 100644 index 00000000..ddc67613 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-scores/index.ts @@ -0,0 +1,237 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAssignmentPackageScoresConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the assignment package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores#assignment_package_name DataHuaweicloudRmsAssignmentPackageScores#assignment_package_name} + */ + readonly assignmentPackageName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores#id DataHuaweicloudRmsAssignmentPackageScores#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} +export interface DataHuaweicloudRmsAssignmentPackageScoresValue { +} + +export function dataHuaweicloudRmsAssignmentPackageScoresValueToTerraform(struct?: DataHuaweicloudRmsAssignmentPackageScoresValue): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAssignmentPackageScoresValueToHclTerraform(struct?: DataHuaweicloudRmsAssignmentPackageScoresValue): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAssignmentPackageScoresValueOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAssignmentPackageScoresValue | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAssignmentPackageScoresValue | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // score - computed: true, optional: false, required: false + public get score() { + return this.getStringAttribute('score'); + } +} + +export class DataHuaweicloudRmsAssignmentPackageScoresValueList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAssignmentPackageScoresValueOutputReference { + return new DataHuaweicloudRmsAssignmentPackageScoresValueOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores huaweicloud_rms_assignment_package_scores} +*/ +export class DataHuaweicloudRmsAssignmentPackageScores extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_assignment_package_scores"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAssignmentPackageScores resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAssignmentPackageScores to import + * @param importFromId The id of the existing DataHuaweicloudRmsAssignmentPackageScores that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAssignmentPackageScores to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_assignment_package_scores", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_scores huaweicloud_rms_assignment_package_scores} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAssignmentPackageScoresConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAssignmentPackageScoresConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_assignment_package_scores', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._assignmentPackageName = config.assignmentPackageName; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // assignment_package_name - computed: false, optional: true, required: false + private _assignmentPackageName?: string; + public get assignmentPackageName() { + return this.getStringAttribute('assignment_package_name'); + } + public set assignmentPackageName(value: string) { + this._assignmentPackageName = value; + } + public resetAssignmentPackageName() { + this._assignmentPackageName = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignmentPackageNameInput() { + return this._assignmentPackageName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // value - computed: true, optional: false, required: false + private _value = new DataHuaweicloudRmsAssignmentPackageScoresValueList(this, "value", false); + public get value() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + assignment_package_name: cdktf.stringToTerraform(this._assignmentPackageName), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + assignment_package_name: { + value: cdktf.stringToHclTerraform(this._assignmentPackageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/README.md new file mode 100644 index 00000000..532b2ce5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_assignment_package_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_assignment_package_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/index.ts new file mode 100644 index 00000000..4eb7e33f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-package-templates/index.ts @@ -0,0 +1,368 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAssignmentPackageTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description for a built-in assignment package template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates#description DataHuaweicloudRmsAssignmentPackageTemplates#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates#id DataHuaweicloudRmsAssignmentPackageTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of a built-in assignment package template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates#template_key DataHuaweicloudRmsAssignmentPackageTemplates#template_key} + */ + readonly templateKey?: string; +} +export interface DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParameters { +} + +export function dataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersToTerraform(struct?: DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersToHclTerraform(struct?: DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default_value - computed: true, optional: false, required: false + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersOutputReference { + return new DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsAssignmentPackageTemplatesTemplates { +} + +export function dataHuaweicloudRmsAssignmentPackageTemplatesTemplatesToTerraform(struct?: DataHuaweicloudRmsAssignmentPackageTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAssignmentPackageTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudRmsAssignmentPackageTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAssignmentPackageTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAssignmentPackageTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // parameters - computed: true, optional: false, required: false + private _parameters = new DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesParametersList(this, "parameters", false); + public get parameters() { + return this._parameters; + } + + // template_body - computed: true, optional: false, required: false + public get templateBody() { + return this.getStringAttribute('template_body'); + } + + // template_key - computed: true, optional: false, required: false + public get templateKey() { + return this.getStringAttribute('template_key'); + } +} + +export class DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesOutputReference { + return new DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates huaweicloud_rms_assignment_package_templates} +*/ +export class DataHuaweicloudRmsAssignmentPackageTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_assignment_package_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAssignmentPackageTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAssignmentPackageTemplates to import + * @param importFromId The id of the existing DataHuaweicloudRmsAssignmentPackageTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAssignmentPackageTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_assignment_package_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_package_templates huaweicloud_rms_assignment_package_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAssignmentPackageTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAssignmentPackageTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_assignment_package_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._templateKey = config.templateKey; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // template_key - computed: false, optional: true, required: false + private _templateKey?: string; + public get templateKey() { + return this.getStringAttribute('template_key'); + } + public set templateKey(value: string) { + this._templateKey = value; + } + public resetTemplateKey() { + this._templateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateKeyInput() { + return this._templateKey; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudRmsAssignmentPackageTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + template_key: cdktf.stringToTerraform(this._templateKey), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_key: { + value: cdktf.stringToHclTerraform(this._templateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/README.md new file mode 100644 index 00000000..e3be0f5d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_assignment_packages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_assignment_packages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/index.ts new file mode 100644 index 00000000..7ed92fea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-assignment-packages/index.ts @@ -0,0 +1,418 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsAssignmentPackagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages#id DataHuaweicloudRmsAssignmentPackages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the assignment package name. It contains 1 to 64 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages#name DataHuaweicloudRmsAssignmentPackages#name} + */ + readonly name?: string; + /** + * Specifies the assignment package ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages#package_id DataHuaweicloudRmsAssignmentPackages#package_id} + */ + readonly packageId?: string; + /** + * Specifies the assignment package status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages#status DataHuaweicloudRmsAssignmentPackages#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructure { +} + +export function dataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureToTerraform(struct?: DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructure): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureToHclTerraform(struct?: DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructure): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructure | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructure | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // var_key - computed: true, optional: false, required: false + public get varKey() { + return this.getStringAttribute('var_key'); + } + + // var_value - computed: true, optional: false, required: false + public get varValue() { + return this.getStringAttribute('var_value'); + } +} + +export class DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureOutputReference { + return new DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsAssignmentPackagesPackages { +} + +export function dataHuaweicloudRmsAssignmentPackagesPackagesToTerraform(struct?: DataHuaweicloudRmsAssignmentPackagesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsAssignmentPackagesPackagesToHclTerraform(struct?: DataHuaweicloudRmsAssignmentPackagesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsAssignmentPackagesPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsAssignmentPackagesPackages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsAssignmentPackagesPackages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // deployment_id - computed: true, optional: false, required: false + public get deploymentId() { + return this.getStringAttribute('deployment_id'); + } + + // error_message - computed: true, optional: false, required: false + public get errorMessage() { + return this.getStringAttribute('error_message'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // stack_id - computed: true, optional: false, required: false + public get stackId() { + return this.getStringAttribute('stack_id'); + } + + // stack_name - computed: true, optional: false, required: false + public get stackName() { + return this.getStringAttribute('stack_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vars_structure - computed: true, optional: false, required: false + private _varsStructure = new DataHuaweicloudRmsAssignmentPackagesPackagesVarsStructureList(this, "vars_structure", false); + public get varsStructure() { + return this._varsStructure; + } +} + +export class DataHuaweicloudRmsAssignmentPackagesPackagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsAssignmentPackagesPackagesOutputReference { + return new DataHuaweicloudRmsAssignmentPackagesPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages huaweicloud_rms_assignment_packages} +*/ +export class DataHuaweicloudRmsAssignmentPackages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_assignment_packages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsAssignmentPackages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsAssignmentPackages to import + * @param importFromId The id of the existing DataHuaweicloudRmsAssignmentPackages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsAssignmentPackages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_assignment_packages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_assignment_packages huaweicloud_rms_assignment_packages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsAssignmentPackagesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsAssignmentPackagesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_assignment_packages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._packageId = config.packageId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // package_id - computed: false, optional: true, required: false + private _packageId?: string; + public get packageId() { + return this.getStringAttribute('package_id'); + } + public set packageId(value: string) { + this._packageId = value; + } + public resetPackageId() { + this._packageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get packageIdInput() { + return this._packageId; + } + + // packages - computed: true, optional: false, required: false + private _packages = new DataHuaweicloudRmsAssignmentPackagesPackagesList(this, "packages", true); + public get packages() { + return this._packages; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + package_id: cdktf.stringToTerraform(this._packageId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package_id: { + value: cdktf.stringToHclTerraform(this._packageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/README.md new file mode 100644 index 00000000..e5e07e13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_organizational_assignment_packages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_organizational_assignment_packages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/index.ts new file mode 100644 index 00000000..ab5c7723 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-assignment-packages/index.ts @@ -0,0 +1,400 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsOrganizationalAssignmentPackagesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages#id DataHuaweicloudRmsOrganizationalAssignmentPackages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the organizational assignment package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages#name DataHuaweicloudRmsOrganizationalAssignmentPackages#name} + */ + readonly name?: string; + /** + * Specifies the ID of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages#organization_id DataHuaweicloudRmsOrganizationalAssignmentPackages#organization_id} + */ + readonly organizationId: string; + /** + * Specifies the organizational assignment package ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages#package_id DataHuaweicloudRmsOrganizationalAssignmentPackages#package_id} + */ + readonly packageId?: string; +} +export interface DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructure { +} + +export function dataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureToTerraform(struct?: DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructure): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureToHclTerraform(struct?: DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructure): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructure | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructure | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // var_key - computed: true, optional: false, required: false + public get varKey() { + return this.getStringAttribute('var_key'); + } + + // var_value - computed: true, optional: false, required: false + public get varValue() { + return this.getStringAttribute('var_value'); + } +} + +export class DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureOutputReference { + return new DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsOrganizationalAssignmentPackagesPackages { +} + +export function dataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesToTerraform(struct?: DataHuaweicloudRmsOrganizationalAssignmentPackagesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesToHclTerraform(struct?: DataHuaweicloudRmsOrganizationalAssignmentPackagesPackages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsOrganizationalAssignmentPackagesPackages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsOrganizationalAssignmentPackagesPackages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // org_conformance_pack_urn - computed: true, optional: false, required: false + public get orgConformancePackUrn() { + return this.getStringAttribute('org_conformance_pack_urn'); + } + + // organization_id - computed: true, optional: false, required: false + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + + // owner_id - computed: true, optional: false, required: false + public get ownerId() { + return this.getStringAttribute('owner_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vars_structure - computed: true, optional: false, required: false + private _varsStructure = new DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesVarsStructureList(this, "vars_structure", true); + public get varsStructure() { + return this._varsStructure; + } +} + +export class DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesOutputReference { + return new DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages huaweicloud_rms_organizational_assignment_packages} +*/ +export class DataHuaweicloudRmsOrganizationalAssignmentPackages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_organizational_assignment_packages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsOrganizationalAssignmentPackages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsOrganizationalAssignmentPackages to import + * @param importFromId The id of the existing DataHuaweicloudRmsOrganizationalAssignmentPackages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsOrganizationalAssignmentPackages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_organizational_assignment_packages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_assignment_packages huaweicloud_rms_organizational_assignment_packages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsOrganizationalAssignmentPackagesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsOrganizationalAssignmentPackagesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_organizational_assignment_packages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._organizationId = config.organizationId; + this._packageId = config.packageId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization_id - computed: false, optional: false, required: true + private _organizationId?: string; + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + public set organizationId(value: string) { + this._organizationId = value; + } + // Temporarily expose input value. Use with caution. + public get organizationIdInput() { + return this._organizationId; + } + + // package_id - computed: false, optional: true, required: false + private _packageId?: string; + public get packageId() { + return this.getStringAttribute('package_id'); + } + public set packageId(value: string) { + this._packageId = value; + } + public resetPackageId() { + this._packageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get packageIdInput() { + return this._packageId; + } + + // packages - computed: true, optional: false, required: false + private _packages = new DataHuaweicloudRmsOrganizationalAssignmentPackagesPackagesList(this, "packages", true); + public get packages() { + return this._packages; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization_id: cdktf.stringToTerraform(this._organizationId), + package_id: cdktf.stringToTerraform(this._packageId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_id: { + value: cdktf.stringToHclTerraform(this._organizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package_id: { + value: cdktf.stringToHclTerraform(this._packageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/README.md new file mode 100644 index 00000000..38180595 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_organizational_policy_assignments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_organizational_policy_assignments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/index.ts new file mode 100644 index 00000000..48a0e2d9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-organizational-policy-assignments/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsOrganizationalPolicyAssignmentsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the organizational policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments#assignment_id DataHuaweicloudRmsOrganizationalPolicyAssignments#assignment_id} + */ + readonly assignmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments#id DataHuaweicloudRmsOrganizationalPolicyAssignments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the organizational policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments#name DataHuaweicloudRmsOrganizationalPolicyAssignments#name} + */ + readonly name?: string; + /** + * Specifies the ID of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments#organization_id DataHuaweicloudRmsOrganizationalPolicyAssignments#organization_id} + */ + readonly organizationId: string; + /** + * Specifies the ID of the policy definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments#policy_definition_id DataHuaweicloudRmsOrganizationalPolicyAssignments#policy_definition_id} + */ + readonly policyDefinitionId?: string; +} +export interface DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilter { +} + +export function dataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterToTerraform(struct?: DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterToHclTerraform(struct?: DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_provider - computed: true, optional: false, required: false + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // tag_key - computed: true, optional: false, required: false + public get tagKey() { + return this.getStringAttribute('tag_key'); + } + + // tag_value - computed: true, optional: false, required: false + public get tagValue() { + return this.getStringAttribute('tag_value'); + } +} + +export class DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterOutputReference { + return new DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignments { +} + +export function dataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsToTerraform(struct?: DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsToHclTerraform(struct?: DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // organization_id - computed: true, optional: false, required: false + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + + // organization_policy_assignment_urn - computed: true, optional: false, required: false + public get organizationPolicyAssignmentUrn() { + return this.getStringAttribute('organization_policy_assignment_urn'); + } + + // owner_id - computed: true, optional: false, required: false + public get ownerId() { + return this.getStringAttribute('owner_id'); + } + + // parameters - computed: true, optional: false, required: false + private _parameters = new cdktf.StringMap(this, "parameters"); + public get parameters() { + return this._parameters; + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getStringAttribute('period'); + } + + // policy_definition_id - computed: true, optional: false, required: false + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + + // policy_filter - computed: true, optional: false, required: false + private _policyFilter = new DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsPolicyFilterList(this, "policy_filter", false); + public get policyFilter() { + return this._policyFilter; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsOutputReference { + return new DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments huaweicloud_rms_organizational_policy_assignments} +*/ +export class DataHuaweicloudRmsOrganizationalPolicyAssignments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_organizational_policy_assignments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsOrganizationalPolicyAssignments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsOrganizationalPolicyAssignments to import + * @param importFromId The id of the existing DataHuaweicloudRmsOrganizationalPolicyAssignments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsOrganizationalPolicyAssignments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_organizational_policy_assignments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_organizational_policy_assignments huaweicloud_rms_organizational_policy_assignments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsOrganizationalPolicyAssignmentsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsOrganizationalPolicyAssignmentsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_organizational_policy_assignments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._assignmentId = config.assignmentId; + this._id = config.id; + this._name = config.name; + this._organizationId = config.organizationId; + this._policyDefinitionId = config.policyDefinitionId; + } + + // ========== + // ATTRIBUTES + // ========== + + // assignment_id - computed: false, optional: true, required: false + private _assignmentId?: string; + public get assignmentId() { + return this.getStringAttribute('assignment_id'); + } + public set assignmentId(value: string) { + this._assignmentId = value; + } + public resetAssignmentId() { + this._assignmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignmentIdInput() { + return this._assignmentId; + } + + // assignments - computed: true, optional: false, required: false + private _assignments = new DataHuaweicloudRmsOrganizationalPolicyAssignmentsAssignmentsList(this, "assignments", true); + public get assignments() { + return this._assignments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization_id - computed: false, optional: false, required: true + private _organizationId?: string; + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + public set organizationId(value: string) { + this._organizationId = value; + } + // Temporarily expose input value. Use with caution. + public get organizationIdInput() { + return this._organizationId; + } + + // policy_definition_id - computed: false, optional: true, required: false + private _policyDefinitionId?: string; + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + public set policyDefinitionId(value: string) { + this._policyDefinitionId = value; + } + public resetPolicyDefinitionId() { + this._policyDefinitionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyDefinitionIdInput() { + return this._policyDefinitionId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + assignment_id: cdktf.stringToTerraform(this._assignmentId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization_id: cdktf.stringToTerraform(this._organizationId), + policy_definition_id: cdktf.stringToTerraform(this._policyDefinitionId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + assignment_id: { + value: cdktf.stringToHclTerraform(this._assignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_id: { + value: cdktf.stringToHclTerraform(this._organizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_definition_id: { + value: cdktf.stringToHclTerraform(this._policyDefinitionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/README.md new file mode 100644 index 00000000..3316fb6c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_policy_assignments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_policy_assignments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/index.ts new file mode 100644 index 00000000..8ded8cc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-assignments/index.ts @@ -0,0 +1,566 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsPolicyAssignmentsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments#assignment_id DataHuaweicloudRmsPolicyAssignments#assignment_id} + */ + readonly assignmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments#id DataHuaweicloudRmsPolicyAssignments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the assignment name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments#name DataHuaweicloudRmsPolicyAssignments#name} + */ + readonly name?: string; + /** + * Specifies the ID of the policy definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments#policy_definition_id DataHuaweicloudRmsPolicyAssignments#policy_definition_id} + */ + readonly policyDefinitionId?: string; + /** + * Specifies the expect status of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments#status DataHuaweicloudRmsPolicyAssignments#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicy { +} + +export function dataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyToTerraform(struct?: DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyToHclTerraform(struct?: DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // auth_type - computed: true, optional: false, required: false + public get authType() { + return this.getStringAttribute('auth_type'); + } + + // auth_value - computed: true, optional: false, required: false + private _authValue = new cdktf.StringMap(this, "auth_value"); + public get authValue() { + return this._authValue; + } + + // function_urn - computed: true, optional: false, required: false + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } +} + +export class DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyOutputReference { + return new DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilter { +} + +export function dataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterToTerraform(struct?: DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterToHclTerraform(struct?: DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_provider - computed: true, optional: false, required: false + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // tag_key - computed: true, optional: false, required: false + public get tagKey() { + return this.getStringAttribute('tag_key'); + } + + // tag_value - computed: true, optional: false, required: false + public get tagValue() { + return this.getStringAttribute('tag_value'); + } +} + +export class DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterOutputReference { + return new DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsPolicyAssignmentsAssignments { +} + +export function dataHuaweicloudRmsPolicyAssignmentsAssignmentsToTerraform(struct?: DataHuaweicloudRmsPolicyAssignmentsAssignments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsPolicyAssignmentsAssignmentsToHclTerraform(struct?: DataHuaweicloudRmsPolicyAssignmentsAssignments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsPolicyAssignmentsAssignmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsPolicyAssignmentsAssignments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsPolicyAssignmentsAssignments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // custom_policy - computed: true, optional: false, required: false + private _customPolicy = new DataHuaweicloudRmsPolicyAssignmentsAssignmentsCustomPolicyList(this, "custom_policy", false); + public get customPolicy() { + return this._customPolicy; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parameters - computed: true, optional: false, required: false + private _parameters = new cdktf.StringMap(this, "parameters"); + public get parameters() { + return this._parameters; + } + + // period - computed: true, optional: false, required: false + public get period() { + return this.getStringAttribute('period'); + } + + // policy_assignment_type - computed: true, optional: false, required: false + public get policyAssignmentType() { + return this.getStringAttribute('policy_assignment_type'); + } + + // policy_definition_id - computed: true, optional: false, required: false + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + + // policy_filter - computed: true, optional: false, required: false + private _policyFilter = new DataHuaweicloudRmsPolicyAssignmentsAssignmentsPolicyFilterList(this, "policy_filter", false); + public get policyFilter() { + return this._policyFilter; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated - computed: true, optional: false, required: false + public get updated() { + return this.getStringAttribute('updated'); + } +} + +export class DataHuaweicloudRmsPolicyAssignmentsAssignmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsPolicyAssignmentsAssignmentsOutputReference { + return new DataHuaweicloudRmsPolicyAssignmentsAssignmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments huaweicloud_rms_policy_assignments} +*/ +export class DataHuaweicloudRmsPolicyAssignments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_policy_assignments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsPolicyAssignments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsPolicyAssignments to import + * @param importFromId The id of the existing DataHuaweicloudRmsPolicyAssignments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsPolicyAssignments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_policy_assignments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_assignments huaweicloud_rms_policy_assignments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsPolicyAssignmentsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsPolicyAssignmentsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_policy_assignments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._assignmentId = config.assignmentId; + this._id = config.id; + this._name = config.name; + this._policyDefinitionId = config.policyDefinitionId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // assignment_id - computed: false, optional: true, required: false + private _assignmentId?: string; + public get assignmentId() { + return this.getStringAttribute('assignment_id'); + } + public set assignmentId(value: string) { + this._assignmentId = value; + } + public resetAssignmentId() { + this._assignmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignmentIdInput() { + return this._assignmentId; + } + + // assignments - computed: true, optional: false, required: false + private _assignments = new DataHuaweicloudRmsPolicyAssignmentsAssignmentsList(this, "assignments", false); + public get assignments() { + return this._assignments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_definition_id - computed: false, optional: true, required: false + private _policyDefinitionId?: string; + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + public set policyDefinitionId(value: string) { + this._policyDefinitionId = value; + } + public resetPolicyDefinitionId() { + this._policyDefinitionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyDefinitionIdInput() { + return this._policyDefinitionId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + assignment_id: cdktf.stringToTerraform(this._assignmentId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_definition_id: cdktf.stringToTerraform(this._policyDefinitionId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + assignment_id: { + value: cdktf.stringToHclTerraform(this._assignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_definition_id: { + value: cdktf.stringToHclTerraform(this._policyDefinitionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/README.md new file mode 100644 index 00000000..084c19a3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_policy_definitions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_policy_definitions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/index.ts new file mode 100644 index 00000000..0816b3b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-definitions/index.ts @@ -0,0 +1,388 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsPolicyDefinitionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#id DataHuaweicloudRmsPolicyDefinitions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The keyword list used to query definition list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#keywords DataHuaweicloudRmsPolicyDefinitions#keywords} + */ + readonly keywords?: string[]; + /** + * The name of the policy definitions used to query definition list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#name DataHuaweicloudRmsPolicyDefinitions#name} + */ + readonly name?: string; + /** + * The policy rule type used to query definition list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#policy_rule_type DataHuaweicloudRmsPolicyDefinitions#policy_rule_type} + */ + readonly policyRuleType?: string; + /** + * The policy type used to query definition list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#policy_type DataHuaweicloudRmsPolicyDefinitions#policy_type} + */ + readonly policyType?: string; + /** + * The trigger type used to query definition list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#trigger_type DataHuaweicloudRmsPolicyDefinitions#trigger_type} + */ + readonly triggerType?: string; +} +export interface DataHuaweicloudRmsPolicyDefinitionsDefinitions { +} + +export function dataHuaweicloudRmsPolicyDefinitionsDefinitionsToTerraform(struct?: DataHuaweicloudRmsPolicyDefinitionsDefinitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsPolicyDefinitionsDefinitionsToHclTerraform(struct?: DataHuaweicloudRmsPolicyDefinitionsDefinitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsPolicyDefinitionsDefinitionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsPolicyDefinitionsDefinitions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsPolicyDefinitionsDefinitions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // keywords - computed: true, optional: false, required: false + public get keywords() { + return this.getListAttribute('keywords'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parameters - computed: true, optional: false, required: false + private _parameters = new cdktf.StringMap(this, "parameters"); + public get parameters() { + return this._parameters; + } + + // policy_rule - computed: true, optional: false, required: false + public get policyRule() { + return this.getStringAttribute('policy_rule'); + } + + // policy_rule_type - computed: true, optional: false, required: false + public get policyRuleType() { + return this.getStringAttribute('policy_rule_type'); + } + + // policy_type - computed: true, optional: false, required: false + public get policyType() { + return this.getStringAttribute('policy_type'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudRmsPolicyDefinitionsDefinitionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsPolicyDefinitionsDefinitionsOutputReference { + return new DataHuaweicloudRmsPolicyDefinitionsDefinitionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions huaweicloud_rms_policy_definitions} +*/ +export class DataHuaweicloudRmsPolicyDefinitions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_policy_definitions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsPolicyDefinitions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsPolicyDefinitions to import + * @param importFromId The id of the existing DataHuaweicloudRmsPolicyDefinitions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsPolicyDefinitions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_policy_definitions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_definitions huaweicloud_rms_policy_definitions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsPolicyDefinitionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsPolicyDefinitionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_policy_definitions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._keywords = config.keywords; + this._name = config.name; + this._policyRuleType = config.policyRuleType; + this._policyType = config.policyType; + this._triggerType = config.triggerType; + } + + // ========== + // ATTRIBUTES + // ========== + + // definitions - computed: true, optional: false, required: false + private _definitions = new DataHuaweicloudRmsPolicyDefinitionsDefinitionsList(this, "definitions", false); + public get definitions() { + return this._definitions; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keywords - computed: false, optional: true, required: false + private _keywords?: string[]; + public get keywords() { + return this.getListAttribute('keywords'); + } + public set keywords(value: string[]) { + this._keywords = value; + } + public resetKeywords() { + this._keywords = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordsInput() { + return this._keywords; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_rule_type - computed: false, optional: true, required: false + private _policyRuleType?: string; + public get policyRuleType() { + return this.getStringAttribute('policy_rule_type'); + } + public set policyRuleType(value: string) { + this._policyRuleType = value; + } + public resetPolicyRuleType() { + this._policyRuleType = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyRuleTypeInput() { + return this._policyRuleType; + } + + // policy_type - computed: false, optional: true, required: false + private _policyType?: string; + public get policyType() { + return this.getStringAttribute('policy_type'); + } + public set policyType(value: string) { + this._policyType = value; + } + public resetPolicyType() { + this._policyType = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyTypeInput() { + return this._policyType; + } + + // trigger_type - computed: false, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + keywords: cdktf.listMapper(cdktf.stringToTerraform, false)(this._keywords), + name: cdktf.stringToTerraform(this._name), + policy_rule_type: cdktf.stringToTerraform(this._policyRuleType), + policy_type: cdktf.stringToTerraform(this._policyType), + trigger_type: cdktf.stringToTerraform(this._triggerType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keywords: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._keywords), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_rule_type: { + value: cdktf.stringToHclTerraform(this._policyRuleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_type: { + value: cdktf.stringToHclTerraform(this._policyType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(this._triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/README.md new file mode 100644 index 00000000..cea321b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_policy_states` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_policy_states`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/index.ts new file mode 100644 index 00000000..1ea436e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-policy-states/index.ts @@ -0,0 +1,364 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsPolicyStatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states#compliance_state DataHuaweicloudRmsPolicyStates#compliance_state} + */ + readonly complianceState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states#id DataHuaweicloudRmsPolicyStates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states#policy_assignment_id DataHuaweicloudRmsPolicyStates#policy_assignment_id} + */ + readonly policyAssignmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states#resource_id DataHuaweicloudRmsPolicyStates#resource_id} + */ + readonly resourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states#resource_name DataHuaweicloudRmsPolicyStates#resource_name} + */ + readonly resourceName?: string; +} +export interface DataHuaweicloudRmsPolicyStatesStates { +} + +export function dataHuaweicloudRmsPolicyStatesStatesToTerraform(struct?: DataHuaweicloudRmsPolicyStatesStates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsPolicyStatesStatesToHclTerraform(struct?: DataHuaweicloudRmsPolicyStatesStates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsPolicyStatesStatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsPolicyStatesStates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsPolicyStatesStates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compliance_state - computed: true, optional: false, required: false + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // evaluation_time - computed: true, optional: false, required: false + public get evaluationTime() { + return this.getStringAttribute('evaluation_time'); + } + + // policy_assignment_id - computed: true, optional: false, required: false + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + + // policy_assignment_name - computed: true, optional: false, required: false + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } + + // policy_definition_id - computed: true, optional: false, required: false + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_provider - computed: true, optional: false, required: false + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudRmsPolicyStatesStatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsPolicyStatesStatesOutputReference { + return new DataHuaweicloudRmsPolicyStatesStatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states huaweicloud_rms_policy_states} +*/ +export class DataHuaweicloudRmsPolicyStates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_policy_states"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsPolicyStates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsPolicyStates to import + * @param importFromId The id of the existing DataHuaweicloudRmsPolicyStates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsPolicyStates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_policy_states", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_policy_states huaweicloud_rms_policy_states} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsPolicyStatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsPolicyStatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_policy_states', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._complianceState = config.complianceState; + this._id = config.id; + this._policyAssignmentId = config.policyAssignmentId; + this._resourceId = config.resourceId; + this._resourceName = config.resourceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // compliance_state - computed: false, optional: true, required: false + private _complianceState?: string; + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + public set complianceState(value: string) { + this._complianceState = value; + } + public resetComplianceState() { + this._complianceState = undefined; + } + // Temporarily expose input value. Use with caution. + public get complianceStateInput() { + return this._complianceState; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_assignment_id - computed: false, optional: true, required: false + private _policyAssignmentId?: string; + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + public set policyAssignmentId(value: string) { + this._policyAssignmentId = value; + } + public resetPolicyAssignmentId() { + this._policyAssignmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentIdInput() { + return this._policyAssignmentId; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: false, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // states - computed: true, optional: false, required: false + private _states = new DataHuaweicloudRmsPolicyStatesStatesList(this, "states", false); + public get states() { + return this._states; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + compliance_state: cdktf.stringToTerraform(this._complianceState), + id: cdktf.stringToTerraform(this._id), + policy_assignment_id: cdktf.stringToTerraform(this._policyAssignmentId), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_name: cdktf.stringToTerraform(this._resourceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + compliance_state: { + value: cdktf.stringToHclTerraform(this._complianceState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_id: { + value: cdktf.stringToHclTerraform(this._policyAssignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/README.md new file mode 100644 index 00000000..4f30e8c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_regions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_regions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/index.ts new file mode 100644 index 00000000..aaf43c98 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-regions/index.ts @@ -0,0 +1,262 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsRegionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the region dispaly name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions#display_name DataHuaweicloudRmsRegions#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions#id DataHuaweicloudRmsRegions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions#region_id DataHuaweicloudRmsRegions#region_id} + */ + readonly regionId?: string; +} +export interface DataHuaweicloudRmsRegionsRegions { +} + +export function dataHuaweicloudRmsRegionsRegionsToTerraform(struct?: DataHuaweicloudRmsRegionsRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsRegionsRegionsToHclTerraform(struct?: DataHuaweicloudRmsRegionsRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsRegionsRegionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsRegionsRegions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsRegionsRegions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } +} + +export class DataHuaweicloudRmsRegionsRegionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsRegionsRegionsOutputReference { + return new DataHuaweicloudRmsRegionsRegionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions huaweicloud_rms_regions} +*/ +export class DataHuaweicloudRmsRegions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_regions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsRegions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsRegions to import + * @param importFromId The id of the existing DataHuaweicloudRmsRegions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsRegions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_regions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_regions huaweicloud_rms_regions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsRegionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsRegionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_regions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._id = config.id; + this._regionId = config.regionId; + } + + // ========== + // ATTRIBUTES + // ========== + + // display_name - computed: false, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // regions - computed: true, optional: false, required: false + private _regions = new DataHuaweicloudRmsRegionsRegionsList(this, "regions", false); + public get regions() { + return this._regions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + id: cdktf.stringToTerraform(this._id), + region_id: cdktf.stringToTerraform(this._regionId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/README.md new file mode 100644 index 00000000..7746351c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregation_pending_requests` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregation_pending_requests`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/index.ts new file mode 100644 index 00000000..8b49d0fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregation-pending-requests/index.ts @@ -0,0 +1,227 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregationPendingRequestsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the authorized resource aggregator account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests#account_id DataHuaweicloudRmsResourceAggregationPendingRequests#account_id} + */ + readonly accountId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests#id DataHuaweicloudRmsResourceAggregationPendingRequests#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} +export interface DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequests { +} + +export function dataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsToTerraform(struct?: DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequests): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequests): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequests | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequests | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // requester_account_id - computed: true, optional: false, required: false + public get requesterAccountId() { + return this.getStringAttribute('requester_account_id'); + } +} + +export class DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsOutputReference { + return new DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests huaweicloud_rms_resource_aggregation_pending_requests} +*/ +export class DataHuaweicloudRmsResourceAggregationPendingRequests extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregation_pending_requests"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregationPendingRequests resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregationPendingRequests to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregationPendingRequests that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregationPendingRequests to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregation_pending_requests", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregation_pending_requests huaweicloud_rms_resource_aggregation_pending_requests} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregationPendingRequestsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregationPendingRequestsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregation_pending_requests', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountId = config.accountId; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: false, optional: true, required: false + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + public resetAccountId() { + this._accountId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // pending_aggregation_requests - computed: true, optional: false, required: false + private _pendingAggregationRequests = new DataHuaweicloudRmsResourceAggregationPendingRequestsPendingAggregationRequestsList(this, "pending_aggregation_requests", false); + public get pendingAggregationRequests() { + return this._pendingAggregationRequests; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_id: cdktf.stringToTerraform(this._accountId), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(this._accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/README.md new file mode 100644 index 00000000..62a3fe11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregator_advanced_query` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregator_advanced_query`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/index.ts new file mode 100644 index 00000000..3266b184 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-advanced-query/index.ts @@ -0,0 +1,255 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregatorAdvancedQueryConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the resource aggregator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query#aggregator_id DataHuaweicloudRmsResourceAggregatorAdvancedQuery#aggregator_id} + */ + readonly aggregatorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query#expression DataHuaweicloudRmsResourceAggregatorAdvancedQuery#expression} + */ + readonly expression: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query#id DataHuaweicloudRmsResourceAggregatorAdvancedQuery#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} +export interface DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfo { +} + +export function dataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // select_fields - computed: true, optional: false, required: false + public get selectFields() { + return this.getListAttribute('select_fields'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoOutputReference { + return new DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query huaweicloud_rms_resource_aggregator_advanced_query} +*/ +export class DataHuaweicloudRmsResourceAggregatorAdvancedQuery extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregator_advanced_query"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregatorAdvancedQuery resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregatorAdvancedQuery to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregatorAdvancedQuery that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregatorAdvancedQuery to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregator_advanced_query", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_advanced_query huaweicloud_rms_resource_aggregator_advanced_query} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregatorAdvancedQueryConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregatorAdvancedQueryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregator_advanced_query', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aggregatorId = config.aggregatorId; + this._expression = config.expression; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // aggregator_id - computed: false, optional: false, required: true + private _aggregatorId?: string; + public get aggregatorId() { + return this.getStringAttribute('aggregator_id'); + } + public set aggregatorId(value: string) { + this._aggregatorId = value; + } + // Temporarily expose input value. Use with caution. + public get aggregatorIdInput() { + return this._aggregatorId; + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // query_info - computed: true, optional: false, required: false + private _queryInfo = new DataHuaweicloudRmsResourceAggregatorAdvancedQueryQueryInfoList(this, "query_info", false); + public get queryInfo() { + return this._queryInfo; + } + + // results - computed: true, optional: false, required: false + private _results = new cdktf.StringMapList(this, "results", false); + public get results() { + return this._results; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aggregator_id: cdktf.stringToTerraform(this._aggregatorId), + expression: cdktf.stringToTerraform(this._expression), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aggregator_id: { + value: cdktf.stringToHclTerraform(this._aggregatorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(this._expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/README.md new file mode 100644 index 00000000..f36f3e4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregator_discovered_resources` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregator_discovered_resources`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/index.ts new file mode 100644 index 00000000..39695f62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-discovered-resources/index.ts @@ -0,0 +1,518 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the resource aggregator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#aggregator_id DataHuaweicloudRmsResourceAggregatorDiscoveredResources#aggregator_id} + */ + readonly aggregatorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#id DataHuaweicloudRmsResourceAggregatorDiscoveredResources#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#resource_type DataHuaweicloudRmsResourceAggregatorDiscoveredResources#resource_type} + */ + readonly resourceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#service_type DataHuaweicloudRmsResourceAggregatorDiscoveredResources#service_type} + */ + readonly serviceType?: string; + /** + * filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#filter DataHuaweicloudRmsResourceAggregatorDiscoveredResources#filter} + */ + readonly filter?: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter; +} +export interface DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResources { +} + +export function dataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // service - computed: true, optional: false, required: false + public get service() { + return this.getStringAttribute('service'); + } + + // source_account_id - computed: true, optional: false, required: false + public get sourceAccountId() { + return this.getStringAttribute('source_account_id'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesOutputReference { + return new DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#account_id DataHuaweicloudRmsResourceAggregatorDiscoveredResources#account_id} + */ + readonly accountId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#region_id DataHuaweicloudRmsResourceAggregatorDiscoveredResources#region_id} + */ + readonly regionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#resource_id DataHuaweicloudRmsResourceAggregatorDiscoveredResources#resource_id} + */ + readonly resourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#resource_name DataHuaweicloudRmsResourceAggregatorDiscoveredResources#resource_name} + */ + readonly resourceName?: string; +} + +export function dataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterOutputReference | DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + account_id: cdktf.stringToTerraform(struct!.accountId), + region_id: cdktf.stringToTerraform(struct!.regionId), + resource_id: cdktf.stringToTerraform(struct!.resourceId), + resource_name: cdktf.stringToTerraform(struct!.resourceName), + } +} + + +export function dataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterOutputReference | DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(struct!.accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(struct!.regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(struct!.resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accountId !== undefined) { + hasAnyValues = true; + internalValueResult.accountId = this._accountId; + } + if (this._regionId !== undefined) { + hasAnyValues = true; + internalValueResult.regionId = this._regionId; + } + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._resourceName !== undefined) { + hasAnyValues = true; + internalValueResult.resourceName = this._resourceName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accountId = undefined; + this._regionId = undefined; + this._resourceId = undefined; + this._resourceName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accountId = value.accountId; + this._regionId = value.regionId; + this._resourceId = value.resourceId; + this._resourceName = value.resourceName; + } + } + + // account_id - computed: false, optional: true, required: false + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + public resetAccountId() { + this._accountId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: false, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources huaweicloud_rms_resource_aggregator_discovered_resources} +*/ +export class DataHuaweicloudRmsResourceAggregatorDiscoveredResources extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregator_discovered_resources"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregatorDiscoveredResources resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregatorDiscoveredResources to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregatorDiscoveredResources that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregatorDiscoveredResources to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregator_discovered_resources", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_discovered_resources huaweicloud_rms_resource_aggregator_discovered_resources} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregator_discovered_resources', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aggregatorId = config.aggregatorId; + this._id = config.id; + this._resourceType = config.resourceType; + this._serviceType = config.serviceType; + this._filter.internalValue = config.filter; + } + + // ========== + // ATTRIBUTES + // ========== + + // aggregator_id - computed: false, optional: false, required: true + private _aggregatorId?: string; + public get aggregatorId() { + return this.getStringAttribute('aggregator_id'); + } + public set aggregatorId(value: string) { + this._aggregatorId = value; + } + // Temporarily expose input value. Use with caution. + public get aggregatorIdInput() { + return this._aggregatorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // service_type - computed: false, optional: true, required: false + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // filter - computed: false, optional: true, required: false + private _filter = new DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterOutputReference(this, "filter"); + public get filter() { + return this._filter; + } + public putFilter(value: DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilter) { + this._filter.internalValue = value; + } + public resetFilter() { + this._filter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aggregator_id: cdktf.stringToTerraform(this._aggregatorId), + id: cdktf.stringToTerraform(this._id), + resource_type: cdktf.stringToTerraform(this._resourceType), + service_type: cdktf.stringToTerraform(this._serviceType), + filter: dataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterToTerraform(this._filter.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aggregator_id: { + value: cdktf.stringToHclTerraform(this._aggregatorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter: { + value: dataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterToHclTerraform(this._filter.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudRmsResourceAggregatorDiscoveredResourcesFilterList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/README.md new file mode 100644 index 00000000..c587c38e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregator_policy_assignments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregator_policy_assignments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/index.ts new file mode 100644 index 00000000..e243b41a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-assignments/index.ts @@ -0,0 +1,586 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the resource aggregator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#aggregator_id DataHuaweicloudRmsResourceAggregatorPolicyAssignments#aggregator_id} + */ + readonly aggregatorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#id DataHuaweicloudRmsResourceAggregatorPolicyAssignments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#filter DataHuaweicloudRmsResourceAggregatorPolicyAssignments#filter} + */ + readonly filter?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter; +} +export interface DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetails { +} + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetails | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetails | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compliant_count - computed: true, optional: false, required: false + public get compliantCount() { + return this.getNumberAttribute('compliant_count'); + } + + // non_compliant_count - computed: true, optional: false, required: false + public get nonCompliantCount() { + return this.getNumberAttribute('non_compliant_count'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsOutputReference { + return new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsCompliance { +} + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsCompliance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsCompliance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsCompliance | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsCompliance | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compliance_state - computed: true, optional: false, required: false + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + + // resource_details - computed: true, optional: false, required: false + private _resourceDetails = new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceResourceDetailsList(this, "resource_details", false); + public get resourceDetails() { + return this._resourceDetails; + } +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceOutputReference { + return new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignments { +} + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // account_id - computed: true, optional: false, required: false + public get accountId() { + return this.getStringAttribute('account_id'); + } + + // account_name - computed: true, optional: false, required: false + public get accountName() { + return this.getStringAttribute('account_name'); + } + + // compliance - computed: true, optional: false, required: false + private _compliance = new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsComplianceList(this, "compliance", false); + public get compliance() { + return this._compliance; + } + + // policy_assignment_id - computed: true, optional: false, required: false + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + + // policy_assignment_name - computed: true, optional: false, required: false + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsOutputReference { + return new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#account_id DataHuaweicloudRmsResourceAggregatorPolicyAssignments#account_id} + */ + readonly accountId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#compliance_state DataHuaweicloudRmsResourceAggregatorPolicyAssignments#compliance_state} + */ + readonly complianceState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#policy_assignment_name DataHuaweicloudRmsResourceAggregatorPolicyAssignments#policy_assignment_name} + */ + readonly policyAssignmentName?: string; +} + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterOutputReference | DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + account_id: cdktf.stringToTerraform(struct!.accountId), + compliance_state: cdktf.stringToTerraform(struct!.complianceState), + policy_assignment_name: cdktf.stringToTerraform(struct!.policyAssignmentName), + } +} + + +export function dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterOutputReference | DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(struct!.accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + compliance_state: { + value: cdktf.stringToHclTerraform(struct!.complianceState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_name: { + value: cdktf.stringToHclTerraform(struct!.policyAssignmentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accountId !== undefined) { + hasAnyValues = true; + internalValueResult.accountId = this._accountId; + } + if (this._complianceState !== undefined) { + hasAnyValues = true; + internalValueResult.complianceState = this._complianceState; + } + if (this._policyAssignmentName !== undefined) { + hasAnyValues = true; + internalValueResult.policyAssignmentName = this._policyAssignmentName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accountId = undefined; + this._complianceState = undefined; + this._policyAssignmentName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accountId = value.accountId; + this._complianceState = value.complianceState; + this._policyAssignmentName = value.policyAssignmentName; + } + } + + // account_id - computed: false, optional: true, required: false + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + public resetAccountId() { + this._accountId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // compliance_state - computed: false, optional: true, required: false + private _complianceState?: string; + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + public set complianceState(value: string) { + this._complianceState = value; + } + public resetComplianceState() { + this._complianceState = undefined; + } + // Temporarily expose input value. Use with caution. + public get complianceStateInput() { + return this._complianceState; + } + + // policy_assignment_name - computed: false, optional: true, required: false + private _policyAssignmentName?: string; + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } + public set policyAssignmentName(value: string) { + this._policyAssignmentName = value; + } + public resetPolicyAssignmentName() { + this._policyAssignmentName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentNameInput() { + return this._policyAssignmentName; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments huaweicloud_rms_resource_aggregator_policy_assignments} +*/ +export class DataHuaweicloudRmsResourceAggregatorPolicyAssignments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregator_policy_assignments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregatorPolicyAssignments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregatorPolicyAssignments to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregatorPolicyAssignments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregatorPolicyAssignments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregator_policy_assignments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_assignments huaweicloud_rms_resource_aggregator_policy_assignments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregator_policy_assignments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aggregatorId = config.aggregatorId; + this._id = config.id; + this._filter.internalValue = config.filter; + } + + // ========== + // ATTRIBUTES + // ========== + + // aggregator_id - computed: false, optional: false, required: true + private _aggregatorId?: string; + public get aggregatorId() { + return this.getStringAttribute('aggregator_id'); + } + public set aggregatorId(value: string) { + this._aggregatorId = value; + } + // Temporarily expose input value. Use with caution. + public get aggregatorIdInput() { + return this._aggregatorId; + } + + // assignments - computed: true, optional: false, required: false + private _assignments = new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsAssignmentsList(this, "assignments", false); + public get assignments() { + return this._assignments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // filter - computed: false, optional: true, required: false + private _filter = new DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterOutputReference(this, "filter"); + public get filter() { + return this._filter; + } + public putFilter(value: DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilter) { + this._filter.internalValue = value; + } + public resetFilter() { + this._filter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aggregator_id: cdktf.stringToTerraform(this._aggregatorId), + id: cdktf.stringToTerraform(this._id), + filter: dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterToTerraform(this._filter.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aggregator_id: { + value: cdktf.stringToHclTerraform(this._aggregatorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter: { + value: dataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterToHclTerraform(this._filter.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudRmsResourceAggregatorPolicyAssignmentsFilterList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/README.md new file mode 100644 index 00000000..d2957972 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregator_policy_states` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregator_policy_states`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/index.ts new file mode 100644 index 00000000..e9ffab0e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-policy-states/index.ts @@ -0,0 +1,419 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregatorPolicyStatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#account_id DataHuaweicloudRmsResourceAggregatorPolicyStates#account_id} + */ + readonly accountId?: string; + /** + * Specifies the resource aggregator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#aggregator_id DataHuaweicloudRmsResourceAggregatorPolicyStates#aggregator_id} + */ + readonly aggregatorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#compliance_state DataHuaweicloudRmsResourceAggregatorPolicyStates#compliance_state} + */ + readonly complianceState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#id DataHuaweicloudRmsResourceAggregatorPolicyStates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#policy_assignment_name DataHuaweicloudRmsResourceAggregatorPolicyStates#policy_assignment_name} + */ + readonly policyAssignmentName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#resource_id DataHuaweicloudRmsResourceAggregatorPolicyStates#resource_id} + */ + readonly resourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#resource_name DataHuaweicloudRmsResourceAggregatorPolicyStates#resource_name} + */ + readonly resourceName?: string; +} +export interface DataHuaweicloudRmsResourceAggregatorPolicyStatesStates { +} + +export function dataHuaweicloudRmsResourceAggregatorPolicyStatesStatesToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyStatesStates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorPolicyStatesStatesToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorPolicyStatesStates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyStatesStatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorPolicyStatesStates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorPolicyStatesStates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // compliance_state - computed: true, optional: false, required: false + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // evaluation_time - computed: true, optional: false, required: false + public get evaluationTime() { + return this.getStringAttribute('evaluation_time'); + } + + // policy_assignment_id - computed: true, optional: false, required: false + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + + // policy_assignment_name - computed: true, optional: false, required: false + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } + + // policy_definition_id - computed: true, optional: false, required: false + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_provider - computed: true, optional: false, required: false + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorPolicyStatesStatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorPolicyStatesStatesOutputReference { + return new DataHuaweicloudRmsResourceAggregatorPolicyStatesStatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states huaweicloud_rms_resource_aggregator_policy_states} +*/ +export class DataHuaweicloudRmsResourceAggregatorPolicyStates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregator_policy_states"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregatorPolicyStates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregatorPolicyStates to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregatorPolicyStates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregatorPolicyStates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregator_policy_states", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_policy_states huaweicloud_rms_resource_aggregator_policy_states} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregatorPolicyStatesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregatorPolicyStatesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregator_policy_states', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountId = config.accountId; + this._aggregatorId = config.aggregatorId; + this._complianceState = config.complianceState; + this._id = config.id; + this._policyAssignmentName = config.policyAssignmentName; + this._resourceId = config.resourceId; + this._resourceName = config.resourceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: false, optional: true, required: false + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + public resetAccountId() { + this._accountId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // aggregator_id - computed: false, optional: false, required: true + private _aggregatorId?: string; + public get aggregatorId() { + return this.getStringAttribute('aggregator_id'); + } + public set aggregatorId(value: string) { + this._aggregatorId = value; + } + // Temporarily expose input value. Use with caution. + public get aggregatorIdInput() { + return this._aggregatorId; + } + + // compliance_state - computed: false, optional: true, required: false + private _complianceState?: string; + public get complianceState() { + return this.getStringAttribute('compliance_state'); + } + public set complianceState(value: string) { + this._complianceState = value; + } + public resetComplianceState() { + this._complianceState = undefined; + } + // Temporarily expose input value. Use with caution. + public get complianceStateInput() { + return this._complianceState; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_assignment_name - computed: false, optional: true, required: false + private _policyAssignmentName?: string; + public get policyAssignmentName() { + return this.getStringAttribute('policy_assignment_name'); + } + public set policyAssignmentName(value: string) { + this._policyAssignmentName = value; + } + public resetPolicyAssignmentName() { + this._policyAssignmentName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentNameInput() { + return this._policyAssignmentName; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_name - computed: false, optional: true, required: false + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + public resetResourceName() { + this._resourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // states - computed: true, optional: false, required: false + private _states = new DataHuaweicloudRmsResourceAggregatorPolicyStatesStatesList(this, "states", false); + public get states() { + return this._states; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_id: cdktf.stringToTerraform(this._accountId), + aggregator_id: cdktf.stringToTerraform(this._aggregatorId), + compliance_state: cdktf.stringToTerraform(this._complianceState), + id: cdktf.stringToTerraform(this._id), + policy_assignment_name: cdktf.stringToTerraform(this._policyAssignmentName), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_name: cdktf.stringToTerraform(this._resourceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(this._accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aggregator_id: { + value: cdktf.stringToHclTerraform(this._aggregatorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + compliance_state: { + value: cdktf.stringToHclTerraform(this._complianceState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_name: { + value: cdktf.stringToHclTerraform(this._policyAssignmentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(this._resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/README.md new file mode 100644 index 00000000..c79824f7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregator_source_statuses` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregator_source_statuses`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/index.ts new file mode 100644 index 00000000..d2e14474 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregator-source-statuses/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregatorSourceStatusesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the resource aggregator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses#aggregator_id DataHuaweicloudRmsResourceAggregatorSourceStatuses#aggregator_id} + */ + readonly aggregatorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses#id DataHuaweicloudRmsResourceAggregatorSourceStatuses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the status of the aggregated source account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses#status DataHuaweicloudRmsResourceAggregatorSourceStatuses#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatuses { +} + +export function dataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatuses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatuses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatuses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatuses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // last_error_code - computed: true, optional: false, required: false + public get lastErrorCode() { + return this.getStringAttribute('last_error_code'); + } + + // last_error_message - computed: true, optional: false, required: false + public get lastErrorMessage() { + return this.getStringAttribute('last_error_message'); + } + + // last_update_status - computed: true, optional: false, required: false + public get lastUpdateStatus() { + return this.getStringAttribute('last_update_status'); + } + + // last_update_time - computed: true, optional: false, required: false + public get lastUpdateTime() { + return this.getStringAttribute('last_update_time'); + } + + // source_id - computed: true, optional: false, required: false + public get sourceId() { + return this.getStringAttribute('source_id'); + } + + // source_name - computed: true, optional: false, required: false + public get sourceName() { + return this.getStringAttribute('source_name'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getStringAttribute('source_type'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesOutputReference { + return new DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses huaweicloud_rms_resource_aggregator_source_statuses} +*/ +export class DataHuaweicloudRmsResourceAggregatorSourceStatuses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregator_source_statuses"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregatorSourceStatuses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregatorSourceStatuses to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregatorSourceStatuses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregatorSourceStatuses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregator_source_statuses", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregator_source_statuses huaweicloud_rms_resource_aggregator_source_statuses} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregatorSourceStatusesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregatorSourceStatusesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregator_source_statuses', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aggregatorId = config.aggregatorId; + this._id = config.id; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // aggregated_source_statuses - computed: true, optional: false, required: false + private _aggregatedSourceStatuses = new DataHuaweicloudRmsResourceAggregatorSourceStatusesAggregatedSourceStatusesList(this, "aggregated_source_statuses", false); + public get aggregatedSourceStatuses() { + return this._aggregatedSourceStatuses; + } + + // aggregator_id - computed: false, optional: false, required: true + private _aggregatorId?: string; + public get aggregatorId() { + return this.getStringAttribute('aggregator_id'); + } + public set aggregatorId(value: string) { + this._aggregatorId = value; + } + // Temporarily expose input value. Use with caution. + public get aggregatorIdInput() { + return this._aggregatorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aggregator_id: cdktf.stringToTerraform(this._aggregatorId), + id: cdktf.stringToTerraform(this._id), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aggregator_id: { + value: cdktf.stringToHclTerraform(this._aggregatorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/README.md new file mode 100644 index 00000000..db6035cb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_aggregators` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_aggregators`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/index.ts new file mode 100644 index 00000000..e56ee941 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-aggregators/index.ts @@ -0,0 +1,317 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceAggregatorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the resource aggregator ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators#aggregator_id DataHuaweicloudRmsResourceAggregators#aggregator_id} + */ + readonly aggregatorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators#id DataHuaweicloudRmsResourceAggregators#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the resource aggregator name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators#name DataHuaweicloudRmsResourceAggregators#name} + */ + readonly name?: string; + /** + * Specifies the resource aggregator type, which can be ACCOUNT or ORGANIZATION. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators#type DataHuaweicloudRmsResourceAggregators#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudRmsResourceAggregatorsAggregators { +} + +export function dataHuaweicloudRmsResourceAggregatorsAggregatorsToTerraform(struct?: DataHuaweicloudRmsResourceAggregatorsAggregators): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceAggregatorsAggregatorsToHclTerraform(struct?: DataHuaweicloudRmsResourceAggregatorsAggregators): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceAggregatorsAggregatorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceAggregatorsAggregators | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceAggregatorsAggregators | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // account_ids - computed: true, optional: false, required: false + public get accountIds() { + return this.getListAttribute('account_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } +} + +export class DataHuaweicloudRmsResourceAggregatorsAggregatorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceAggregatorsAggregatorsOutputReference { + return new DataHuaweicloudRmsResourceAggregatorsAggregatorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators huaweicloud_rms_resource_aggregators} +*/ +export class DataHuaweicloudRmsResourceAggregators extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregators"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceAggregators resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceAggregators to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceAggregators that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceAggregators to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregators", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_aggregators huaweicloud_rms_resource_aggregators} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceAggregatorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceAggregatorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregators', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._aggregatorId = config.aggregatorId; + this._id = config.id; + this._name = config.name; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // aggregator_id - computed: false, optional: true, required: false + private _aggregatorId?: string; + public get aggregatorId() { + return this.getStringAttribute('aggregator_id'); + } + public set aggregatorId(value: string) { + this._aggregatorId = value; + } + public resetAggregatorId() { + this._aggregatorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get aggregatorIdInput() { + return this._aggregatorId; + } + + // aggregators - computed: true, optional: false, required: false + private _aggregators = new DataHuaweicloudRmsResourceAggregatorsAggregatorsList(this, "aggregators", false); + public get aggregators() { + return this._aggregators; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aggregator_id: cdktf.stringToTerraform(this._aggregatorId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aggregator_id: { + value: cdktf.stringToHclTerraform(this._aggregatorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/README.md new file mode 100644 index 00000000..96f79b7a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_histories` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_histories`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/index.ts new file mode 100644 index 00000000..26cf8e54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-histories/index.ts @@ -0,0 +1,587 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceHistoriesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the start time of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories#earlier_time DataHuaweicloudRmsResourceHistories#earlier_time} + */ + readonly earlierTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories#id DataHuaweicloudRmsResourceHistories#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the end time of the query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories#later_time DataHuaweicloudRmsResourceHistories#later_time} + */ + readonly laterTime?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories#region DataHuaweicloudRmsResourceHistories#region} + */ + readonly region?: string; + /** + * Specifies the resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories#resource_id DataHuaweicloudRmsResourceHistories#resource_id} + */ + readonly resourceId: string; +} +export interface DataHuaweicloudRmsResourceHistoriesItemsRelations { +} + +export function dataHuaweicloudRmsResourceHistoriesItemsRelationsToTerraform(struct?: DataHuaweicloudRmsResourceHistoriesItemsRelations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceHistoriesItemsRelationsToHclTerraform(struct?: DataHuaweicloudRmsResourceHistoriesItemsRelations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceHistoriesItemsRelationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceHistoriesItemsRelations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceHistoriesItemsRelations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // from_resource_id - computed: true, optional: false, required: false + public get fromResourceId() { + return this.getStringAttribute('from_resource_id'); + } + + // from_resource_type - computed: true, optional: false, required: false + public get fromResourceType() { + return this.getStringAttribute('from_resource_type'); + } + + // relation_type - computed: true, optional: false, required: false + public get relationType() { + return this.getStringAttribute('relation_type'); + } + + // to_resource_id - computed: true, optional: false, required: false + public get toResourceId() { + return this.getStringAttribute('to_resource_id'); + } + + // to_resource_type - computed: true, optional: false, required: false + public get toResourceType() { + return this.getStringAttribute('to_resource_type'); + } +} + +export class DataHuaweicloudRmsResourceHistoriesItemsRelationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceHistoriesItemsRelationsOutputReference { + return new DataHuaweicloudRmsResourceHistoriesItemsRelationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourceHistoriesItemsResource { +} + +export function dataHuaweicloudRmsResourceHistoriesItemsResourceToTerraform(struct?: DataHuaweicloudRmsResourceHistoriesItemsResource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceHistoriesItemsResourceToHclTerraform(struct?: DataHuaweicloudRmsResourceHistoriesItemsResource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceHistoriesItemsResourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceHistoriesItemsResource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceHistoriesItemsResource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // ep_id - computed: true, optional: false, required: false + public get epId() { + return this.getStringAttribute('ep_id'); + } + + // ep_name - computed: true, optional: false, required: false + public get epName() { + return this.getStringAttribute('ep_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // project_name - computed: true, optional: false, required: false + public get projectName() { + return this.getStringAttribute('project_name'); + } + + // properties - computed: true, optional: false, required: false + public get properties() { + return this.getStringAttribute('properties'); + } + + // provider - computed: true, optional: false, required: false + public get provider() { + return this.getStringAttribute('provider'); + } + + // provisioning_state - computed: true, optional: false, required: false + public get provisioningState() { + return this.getStringAttribute('provisioning_state'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated - computed: true, optional: false, required: false + public get updated() { + return this.getStringAttribute('updated'); + } +} + +export class DataHuaweicloudRmsResourceHistoriesItemsResourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceHistoriesItemsResourceOutputReference { + return new DataHuaweicloudRmsResourceHistoriesItemsResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourceHistoriesItems { +} + +export function dataHuaweicloudRmsResourceHistoriesItemsToTerraform(struct?: DataHuaweicloudRmsResourceHistoriesItems): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceHistoriesItemsToHclTerraform(struct?: DataHuaweicloudRmsResourceHistoriesItems): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceHistoriesItemsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceHistoriesItems | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceHistoriesItems | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // capture_time - computed: true, optional: false, required: false + public get captureTime() { + return this.getStringAttribute('capture_time'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // relations - computed: true, optional: false, required: false + private _relations = new DataHuaweicloudRmsResourceHistoriesItemsRelationsList(this, "relations", false); + public get relations() { + return this._relations; + } + + // resource - computed: true, optional: false, required: false + private _resource = new DataHuaweicloudRmsResourceHistoriesItemsResourceList(this, "resource", false); + public get resource() { + return this._resource; + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudRmsResourceHistoriesItemsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceHistoriesItemsOutputReference { + return new DataHuaweicloudRmsResourceHistoriesItemsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories huaweicloud_rms_resource_histories} +*/ +export class DataHuaweicloudRmsResourceHistories extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_histories"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceHistories resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceHistories to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceHistories that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceHistories to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_histories", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_histories huaweicloud_rms_resource_histories} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceHistoriesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceHistoriesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_histories', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._earlierTime = config.earlierTime; + this._id = config.id; + this._laterTime = config.laterTime; + this._region = config.region; + this._resourceId = config.resourceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // earlier_time - computed: false, optional: true, required: false + private _earlierTime?: string; + public get earlierTime() { + return this.getStringAttribute('earlier_time'); + } + public set earlierTime(value: string) { + this._earlierTime = value; + } + public resetEarlierTime() { + this._earlierTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get earlierTimeInput() { + return this._earlierTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // items - computed: true, optional: false, required: false + private _items = new DataHuaweicloudRmsResourceHistoriesItemsList(this, "items", false); + public get items() { + return this._items; + } + + // later_time - computed: false, optional: true, required: false + private _laterTime?: string; + public get laterTime() { + return this.getStringAttribute('later_time'); + } + public set laterTime(value: string) { + this._laterTime = value; + } + public resetLaterTime() { + this._laterTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get laterTimeInput() { + return this._laterTime; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + earlier_time: cdktf.stringToTerraform(this._earlierTime), + id: cdktf.stringToTerraform(this._id), + later_time: cdktf.stringToTerraform(this._laterTime), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + earlier_time: { + value: cdktf.stringToHclTerraform(this._earlierTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + later_time: { + value: cdktf.stringToHclTerraform(this._laterTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/README.md new file mode 100644 index 00000000..b8577482 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resource_relations_details` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resource_relations_details`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/index.ts new file mode 100644 index 00000000..f8424155 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resource-relations-details/index.ts @@ -0,0 +1,301 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourceRelationsDetailsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the direction of a resource relationship. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details#direction DataHuaweicloudRmsResourceRelationsDetails#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details#id DataHuaweicloudRmsResourceRelationsDetails#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details#region DataHuaweicloudRmsResourceRelationsDetails#region} + */ + readonly region?: string; + /** + * Specifies the resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details#resource_id DataHuaweicloudRmsResourceRelationsDetails#resource_id} + */ + readonly resourceId: string; +} +export interface DataHuaweicloudRmsResourceRelationsDetailsRelations { +} + +export function dataHuaweicloudRmsResourceRelationsDetailsRelationsToTerraform(struct?: DataHuaweicloudRmsResourceRelationsDetailsRelations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourceRelationsDetailsRelationsToHclTerraform(struct?: DataHuaweicloudRmsResourceRelationsDetailsRelations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourceRelationsDetailsRelationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourceRelationsDetailsRelations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourceRelationsDetailsRelations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // from_resource_id - computed: true, optional: false, required: false + public get fromResourceId() { + return this.getStringAttribute('from_resource_id'); + } + + // from_resource_type - computed: true, optional: false, required: false + public get fromResourceType() { + return this.getStringAttribute('from_resource_type'); + } + + // relation_type - computed: true, optional: false, required: false + public get relationType() { + return this.getStringAttribute('relation_type'); + } + + // to_resource_id - computed: true, optional: false, required: false + public get toResourceId() { + return this.getStringAttribute('to_resource_id'); + } + + // to_resource_type - computed: true, optional: false, required: false + public get toResourceType() { + return this.getStringAttribute('to_resource_type'); + } +} + +export class DataHuaweicloudRmsResourceRelationsDetailsRelationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourceRelationsDetailsRelationsOutputReference { + return new DataHuaweicloudRmsResourceRelationsDetailsRelationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details huaweicloud_rms_resource_relations_details} +*/ +export class DataHuaweicloudRmsResourceRelationsDetails extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_relations_details"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourceRelationsDetails resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourceRelationsDetails to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourceRelationsDetails that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourceRelationsDetails to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_relations_details", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resource_relations_details huaweicloud_rms_resource_relations_details} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourceRelationsDetailsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourceRelationsDetailsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_relations_details', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._direction = config.direction; + this._id = config.id; + this._region = config.region; + this._resourceId = config.resourceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // relations - computed: true, optional: false, required: false + private _relations = new DataHuaweicloudRmsResourceRelationsDetailsRelationsList(this, "relations", false); + public get relations() { + return this._relations; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + direction: cdktf.stringToTerraform(this._direction), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/README.md new file mode 100644 index 00000000..ae914e29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resources_summary` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resources_summary`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/index.ts new file mode 100644 index 00000000..63dc5121 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources-summary/index.ts @@ -0,0 +1,588 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourcesSummaryConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#enterprise_project_id DataHuaweicloudRmsResourcesSummary#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#id DataHuaweicloudRmsResourcesSummary#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#name DataHuaweicloudRmsResourcesSummary#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#project_id DataHuaweicloudRmsResourcesSummary#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#region_id DataHuaweicloudRmsResourcesSummary#region_id} + */ + readonly regionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#resource_deleted DataHuaweicloudRmsResourcesSummary#resource_deleted} + */ + readonly resourceDeleted?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#tags DataHuaweicloudRmsResourcesSummary#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#tracked DataHuaweicloudRmsResourcesSummary#tracked} + */ + readonly tracked?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#type DataHuaweicloudRmsResourcesSummary#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegions { +} + +export function dataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsToTerraform(struct?: DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsToHclTerraform(struct?: DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getNumberAttribute('count'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } +} + +export class DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsOutputReference { + return new DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypes { +} + +export function dataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesToTerraform(struct?: DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesToHclTerraform(struct?: DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // regions - computed: true, optional: false, required: false + private _regions = new DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesRegionsList(this, "regions", false); + public get regions() { + return this._regions; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesOutputReference { + return new DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsResourcesSummaryResourcesSummary { +} + +export function dataHuaweicloudRmsResourcesSummaryResourcesSummaryToTerraform(struct?: DataHuaweicloudRmsResourcesSummaryResourcesSummary): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourcesSummaryResourcesSummaryToHclTerraform(struct?: DataHuaweicloudRmsResourcesSummaryResourcesSummary): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourcesSummaryResourcesSummaryOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourcesSummaryResourcesSummary | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourcesSummaryResourcesSummary | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // service - computed: true, optional: false, required: false + public get service() { + return this.getStringAttribute('service'); + } + + // types - computed: true, optional: false, required: false + private _types = new DataHuaweicloudRmsResourcesSummaryResourcesSummaryTypesList(this, "types", false); + public get types() { + return this._types; + } +} + +export class DataHuaweicloudRmsResourcesSummaryResourcesSummaryList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourcesSummaryResourcesSummaryOutputReference { + return new DataHuaweicloudRmsResourcesSummaryResourcesSummaryOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary huaweicloud_rms_resources_summary} +*/ +export class DataHuaweicloudRmsResourcesSummary extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resources_summary"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResourcesSummary resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResourcesSummary to import + * @param importFromId The id of the existing DataHuaweicloudRmsResourcesSummary that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResourcesSummary to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resources_summary", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources_summary huaweicloud_rms_resources_summary} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourcesSummaryConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourcesSummaryConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resources_summary', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._projectId = config.projectId; + this._regionId = config.regionId; + this._resourceDeleted = config.resourceDeleted; + this._tags = config.tags; + this._tracked = config.tracked; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // resource_deleted - computed: false, optional: true, required: false + private _resourceDeleted?: boolean | cdktf.IResolvable; + public get resourceDeleted() { + return this.getBooleanAttribute('resource_deleted'); + } + public set resourceDeleted(value: boolean | cdktf.IResolvable) { + this._resourceDeleted = value; + } + public resetResourceDeleted() { + this._resourceDeleted = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceDeletedInput() { + return this._resourceDeleted; + } + + // resources_summary - computed: true, optional: false, required: false + private _resourcesSummary = new DataHuaweicloudRmsResourcesSummaryResourcesSummaryList(this, "resources_summary", false); + public get resourcesSummary() { + return this._resourcesSummary; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tracked - computed: false, optional: true, required: false + private _tracked?: boolean | cdktf.IResolvable; + public get tracked() { + return this.getBooleanAttribute('tracked'); + } + public set tracked(value: boolean | cdktf.IResolvable) { + this._tracked = value; + } + public resetTracked() { + this._tracked = undefined; + } + // Temporarily expose input value. Use with caution. + public get trackedInput() { + return this._tracked; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region_id: cdktf.stringToTerraform(this._regionId), + resource_deleted: cdktf.booleanToTerraform(this._resourceDeleted), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tracked: cdktf.booleanToTerraform(this._tracked), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_deleted: { + value: cdktf.booleanToHclTerraform(this._resourceDeleted), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tracked: { + value: cdktf.booleanToHclTerraform(this._tracked), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/README.md new file mode 100644 index 00000000..d6a4d6d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_resources` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_resources`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/index.ts new file mode 100644 index 00000000..ef96c470 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-resources/index.ts @@ -0,0 +1,498 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsResourcesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#enterprise_project_id DataHuaweicloudRmsResources#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#id DataHuaweicloudRmsResources#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#name DataHuaweicloudRmsResources#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#region_id DataHuaweicloudRmsResources#region_id} + */ + readonly regionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#resource_deleted DataHuaweicloudRmsResources#resource_deleted} + */ + readonly resourceDeleted?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#resource_id DataHuaweicloudRmsResources#resource_id} + */ + readonly resourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#tags DataHuaweicloudRmsResources#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#tracked DataHuaweicloudRmsResources#tracked} + */ + readonly tracked?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#type DataHuaweicloudRmsResources#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudRmsResourcesResources { +} + +export function dataHuaweicloudRmsResourcesResourcesToTerraform(struct?: DataHuaweicloudRmsResourcesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsResourcesResourcesToHclTerraform(struct?: DataHuaweicloudRmsResourcesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsResourcesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsResourcesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsResourcesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // enterprise_project_name - computed: true, optional: false, required: false + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // project_name - computed: true, optional: false, required: false + public get projectName() { + return this.getStringAttribute('project_name'); + } + + // properties - computed: true, optional: false, required: false + private _properties = new cdktf.StringMap(this, "properties"); + public get properties() { + return this._properties; + } + + // provisioning_state - computed: true, optional: false, required: false + public get provisioningState() { + return this.getStringAttribute('provisioning_state'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // service - computed: true, optional: false, required: false + public get service() { + return this.getStringAttribute('service'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudRmsResourcesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsResourcesResourcesOutputReference { + return new DataHuaweicloudRmsResourcesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources huaweicloud_rms_resources} +*/ +export class DataHuaweicloudRmsResources extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resources"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsResources resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsResources to import + * @param importFromId The id of the existing DataHuaweicloudRmsResources that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsResources to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resources", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_resources huaweicloud_rms_resources} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsResourcesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsResourcesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resources', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._regionId = config.regionId; + this._resourceDeleted = config.resourceDeleted; + this._resourceId = config.resourceId; + this._tags = config.tags; + this._tracked = config.tracked; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region_id - computed: false, optional: true, required: false + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + public resetRegionId() { + this._regionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // resource_deleted - computed: false, optional: true, required: false + private _resourceDeleted?: boolean | cdktf.IResolvable; + public get resourceDeleted() { + return this.getBooleanAttribute('resource_deleted'); + } + public set resourceDeleted(value: boolean | cdktf.IResolvable) { + this._resourceDeleted = value; + } + public resetResourceDeleted() { + this._resourceDeleted = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceDeletedInput() { + return this._resourceDeleted; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resources - computed: true, optional: false, required: false + private _resources = new DataHuaweicloudRmsResourcesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tracked - computed: false, optional: true, required: false + private _tracked?: boolean | cdktf.IResolvable; + public get tracked() { + return this.getBooleanAttribute('tracked'); + } + public set tracked(value: boolean | cdktf.IResolvable) { + this._tracked = value; + } + public resetTracked() { + this._tracked = undefined; + } + // Temporarily expose input value. Use with caution. + public get trackedInput() { + return this._tracked; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region_id: cdktf.stringToTerraform(this._regionId), + resource_deleted: cdktf.booleanToTerraform(this._resourceDeleted), + resource_id: cdktf.stringToTerraform(this._resourceId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tracked: cdktf.booleanToTerraform(this._tracked), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_deleted: { + value: cdktf.booleanToHclTerraform(this._resourceDeleted), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tracked: { + value: cdktf.booleanToHclTerraform(this._tracked), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/README.md new file mode 100644 index 00000000..9a276120 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_rms_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_rms_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/index.ts new file mode 100644 index 00000000..3f313f24 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-rms-services/index.ts @@ -0,0 +1,383 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudRmsServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services#id DataHuaweicloudRmsServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the service name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services#name DataHuaweicloudRmsServices#name} + */ + readonly name?: string; + /** + * Specifies whether resources are collected by default. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services#track DataHuaweicloudRmsServices#track} + */ + readonly track?: string; +} +export interface DataHuaweicloudRmsServicesServicesResourceTypes { +} + +export function dataHuaweicloudRmsServicesServicesResourceTypesToTerraform(struct?: DataHuaweicloudRmsServicesServicesResourceTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsServicesServicesResourceTypesToHclTerraform(struct?: DataHuaweicloudRmsServicesServicesResourceTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsServicesServicesResourceTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsServicesServicesResourceTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsServicesServicesResourceTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // console_detail_url - computed: true, optional: false, required: false + public get consoleDetailUrl() { + return this.getStringAttribute('console_detail_url'); + } + + // console_endpoint_id - computed: true, optional: false, required: false + public get consoleEndpointId() { + return this.getStringAttribute('console_endpoint_id'); + } + + // console_list_url - computed: true, optional: false, required: false + public get consoleListUrl() { + return this.getStringAttribute('console_list_url'); + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // global - computed: true, optional: false, required: false + public get global() { + return this.getBooleanAttribute('global'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // regions - computed: true, optional: false, required: false + public get regions() { + return this.getListAttribute('regions'); + } + + // track - computed: true, optional: false, required: false + public get track() { + return this.getStringAttribute('track'); + } +} + +export class DataHuaweicloudRmsServicesServicesResourceTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsServicesServicesResourceTypesOutputReference { + return new DataHuaweicloudRmsServicesServicesResourceTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudRmsServicesServices { +} + +export function dataHuaweicloudRmsServicesServicesToTerraform(struct?: DataHuaweicloudRmsServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudRmsServicesServicesToHclTerraform(struct?: DataHuaweicloudRmsServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudRmsServicesServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudRmsServicesServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudRmsServicesServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category_display_name - computed: true, optional: false, required: false + public get categoryDisplayName() { + return this.getStringAttribute('category_display_name'); + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_types - computed: true, optional: false, required: false + private _resourceTypes = new DataHuaweicloudRmsServicesServicesResourceTypesList(this, "resource_types", false); + public get resourceTypes() { + return this._resourceTypes; + } +} + +export class DataHuaweicloudRmsServicesServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudRmsServicesServicesOutputReference { + return new DataHuaweicloudRmsServicesServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services huaweicloud_rms_services} +*/ +export class DataHuaweicloudRmsServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudRmsServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudRmsServices to import + * @param importFromId The id of the existing DataHuaweicloudRmsServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudRmsServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/rms_services huaweicloud_rms_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudRmsServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudRmsServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._track = config.track; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // services - computed: true, optional: false, required: false + private _services = new DataHuaweicloudRmsServicesServicesList(this, "services", false); + public get services() { + return this._services; + } + + // track - computed: false, optional: true, required: false + private _track?: string; + public get track() { + return this.getStringAttribute('track'); + } + public set track(value: string) { + this._track = value; + } + public resetTrack() { + this._track = undefined; + } + // Temporarily expose input value. Use with caution. + public get trackInput() { + return this._track; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + track: cdktf.stringToTerraform(this._track), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + track: { + value: cdktf.stringToHclTerraform(this._track), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/README.md new file mode 100644 index 00000000..1a8726f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_scm_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_scm_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/index.ts new file mode 100644 index 00000000..131c8814 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-scm-certificates/index.ts @@ -0,0 +1,412 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudScmCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#deploy_support DataHuaweicloudScmCertificates#deploy_support} + */ + readonly deploySupport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#enterprise_project_id DataHuaweicloudScmCertificates#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#id DataHuaweicloudScmCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#name DataHuaweicloudScmCertificates#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#region DataHuaweicloudScmCertificates#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#status DataHuaweicloudScmCertificates#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudScmCertificatesCertificates { +} + +export function dataHuaweicloudScmCertificatesCertificatesToTerraform(struct?: DataHuaweicloudScmCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudScmCertificatesCertificatesToHclTerraform(struct?: DataHuaweicloudScmCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudScmCertificatesCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudScmCertificatesCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudScmCertificatesCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // brand - computed: true, optional: false, required: false + public get brand() { + return this.getStringAttribute('brand'); + } + + // deploy_support - computed: true, optional: false, required: false + public get deploySupport() { + return this.getBooleanAttribute('deploy_support'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // domain_count - computed: true, optional: false, required: false + public get domainCount() { + return this.getNumberAttribute('domain_count'); + } + + // domain_type - computed: true, optional: false, required: false + public get domainType() { + return this.getStringAttribute('domain_type'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // sans - computed: true, optional: false, required: false + public get sans() { + return this.getStringAttribute('sans'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // validity_period - computed: true, optional: false, required: false + public get validityPeriod() { + return this.getNumberAttribute('validity_period'); + } + + // wildcard_count - computed: true, optional: false, required: false + public get wildcardCount() { + return this.getNumberAttribute('wildcard_count'); + } +} + +export class DataHuaweicloudScmCertificatesCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudScmCertificatesCertificatesOutputReference { + return new DataHuaweicloudScmCertificatesCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates huaweicloud_scm_certificates} +*/ +export class DataHuaweicloudScmCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_scm_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudScmCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudScmCertificates to import + * @param importFromId The id of the existing DataHuaweicloudScmCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudScmCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_scm_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/scm_certificates huaweicloud_scm_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudScmCertificatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudScmCertificatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_scm_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deploySupport = config.deploySupport; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificates - computed: true, optional: false, required: false + private _certificates = new DataHuaweicloudScmCertificatesCertificatesList(this, "certificates", false); + public get certificates() { + return this._certificates; + } + + // deploy_support - computed: false, optional: true, required: false + private _deploySupport?: boolean | cdktf.IResolvable; + public get deploySupport() { + return this.getBooleanAttribute('deploy_support'); + } + public set deploySupport(value: boolean | cdktf.IResolvable) { + this._deploySupport = value; + } + public resetDeploySupport() { + this._deploySupport = undefined; + } + // Temporarily expose input value. Use with caution. + public get deploySupportInput() { + return this._deploySupport; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + deploy_support: cdktf.booleanToTerraform(this._deploySupport), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + deploy_support: { + value: cdktf.booleanToHclTerraform(this._deploySupport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/README.md new file mode 100644 index 00000000..7b703fc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sdrs_domain` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sdrs_domain`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/index.ts new file mode 100644 index 00000000..2ab7a588 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sdrs-domain/index.ts @@ -0,0 +1,177 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSdrsDomainConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain#id DataHuaweicloudSdrsDomain#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain#name DataHuaweicloudSdrsDomain#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain#region DataHuaweicloudSdrsDomain#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain huaweicloud_sdrs_domain} +*/ +export class DataHuaweicloudSdrsDomain extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sdrs_domain"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSdrsDomain resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSdrsDomain to import + * @param importFromId The id of the existing DataHuaweicloudSdrsDomain that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSdrsDomain to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sdrs_domain", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sdrs_domain huaweicloud_sdrs_domain} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSdrsDomainConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSdrsDomainConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sdrs_domain', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/README.md new file mode 100644 index 00000000..3bca2779 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_alert_rule_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_alert_rule_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/index.ts new file mode 100644 index 00000000..3a015f90 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rule-templates/index.ts @@ -0,0 +1,537 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterAlertRuleTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates#id DataHuaweicloudSecmasterAlertRuleTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates#region DataHuaweicloudSecmasterAlertRuleTemplates#region} + */ + readonly region?: string; + /** + * Specifies the list of the severity. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates#severity DataHuaweicloudSecmasterAlertRuleTemplates#severity} + */ + readonly severity?: string[]; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates#workspace_id DataHuaweicloudSecmasterAlertRuleTemplates#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlan { +} + +export function dataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanToTerraform(struct?: DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlan): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanToHclTerraform(struct?: DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlan): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlan | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlan | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // execution_delay - computed: true, optional: false, required: false + public get executionDelay() { + return this.getNumberAttribute('execution_delay'); + } + + // overtime_interval - computed: true, optional: false, required: false + public get overtimeInterval() { + return this.getNumberAttribute('overtime_interval'); + } + + // query_interval - computed: true, optional: false, required: false + public get queryInterval() { + return this.getNumberAttribute('query_interval'); + } + + // query_interval_unit - computed: true, optional: false, required: false + public get queryIntervalUnit() { + return this.getStringAttribute('query_interval_unit'); + } + + // time_window - computed: true, optional: false, required: false + public get timeWindow() { + return this.getNumberAttribute('time_window'); + } + + // time_window_unit - computed: true, optional: false, required: false + public get timeWindowUnit() { + return this.getStringAttribute('time_window_unit'); + } +} + +export class DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanOutputReference { + return new DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggers { +} + +export function dataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersToTerraform(struct?: DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersToHclTerraform(struct?: DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // accumulated_times - computed: true, optional: false, required: false + public get accumulatedTimes() { + return this.getNumberAttribute('accumulated_times'); + } + + // expression - computed: true, optional: false, required: false + public get expression() { + return this.getStringAttribute('expression'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } +} + +export class DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersOutputReference { + return new DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertRuleTemplatesTemplates { +} + +export function dataHuaweicloudSecmasterAlertRuleTemplatesTemplatesToTerraform(struct?: DataHuaweicloudSecmasterAlertRuleTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertRuleTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudSecmasterAlertRuleTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertRuleTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertRuleTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // custom_properties - computed: true, optional: false, required: false + private _customProperties = new cdktf.StringMap(this, "custom_properties"); + public get customProperties() { + return this._customProperties; + } + + // data_source - computed: true, optional: false, required: false + public get dataSource() { + return this.getStringAttribute('data_source'); + } + + // event_grouping - computed: true, optional: false, required: false + public get eventGrouping() { + return this.getBooleanAttribute('event_grouping'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // query - computed: true, optional: false, required: false + public get query() { + return this.getStringAttribute('query'); + } + + // query_plan - computed: true, optional: false, required: false + private _queryPlan = new DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesQueryPlanList(this, "query_plan", false); + public get queryPlan() { + return this._queryPlan; + } + + // query_type - computed: true, optional: false, required: false + public get queryType() { + return this.getStringAttribute('query_type'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } + + // triggers - computed: true, optional: false, required: false + private _triggers = new DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesTriggersList(this, "triggers", false); + public get triggers() { + return this._triggers; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesOutputReference { + return new DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates huaweicloud_secmaster_alert_rule_templates} +*/ +export class DataHuaweicloudSecmasterAlertRuleTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_alert_rule_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterAlertRuleTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterAlertRuleTemplates to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterAlertRuleTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterAlertRuleTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_alert_rule_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rule_templates huaweicloud_secmaster_alert_rule_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterAlertRuleTemplatesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterAlertRuleTemplatesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_alert_rule_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._severity = config.severity; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // severity - computed: false, optional: true, required: false + private _severity?: string[]; + public get severity() { + return this.getListAttribute('severity'); + } + public set severity(value: string[]) { + this._severity = value; + } + public resetSeverity() { + this._severity = undefined; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudSecmasterAlertRuleTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + severity: cdktf.listMapper(cdktf.stringToTerraform, false)(this._severity), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._severity), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/README.md new file mode 100644 index 00000000..60434997 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_alert_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_alert_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/index.ts new file mode 100644 index 00000000..28e7de6b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alert-rules/index.ts @@ -0,0 +1,682 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterAlertRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#id DataHuaweicloudSecmasterAlertRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the alert rule name. Fuzzy match is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#name DataHuaweicloudSecmasterAlertRules#name} + */ + readonly name?: string; + /** + * Specifies the pipeline ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#pipeline_id DataHuaweicloudSecmasterAlertRules#pipeline_id} + */ + readonly pipelineId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#region DataHuaweicloudSecmasterAlertRules#region} + */ + readonly region?: string; + /** + * Specifies the alert rule ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#rule_id DataHuaweicloudSecmasterAlertRules#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the list of the severity. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#severity DataHuaweicloudSecmasterAlertRules#severity} + */ + readonly severity?: string[]; + /** + * Specifies the list of the status. The value can be **ENABLED** and **DISABLED**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#status DataHuaweicloudSecmasterAlertRules#status} + */ + readonly status?: string[]; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#workspace_id DataHuaweicloudSecmasterAlertRules#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlan { +} + +export function dataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanToTerraform(struct?: DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlan): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanToHclTerraform(struct?: DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlan): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlan | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlan | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // execution_delay - computed: true, optional: false, required: false + public get executionDelay() { + return this.getNumberAttribute('execution_delay'); + } + + // overtime_interval - computed: true, optional: false, required: false + public get overtimeInterval() { + return this.getNumberAttribute('overtime_interval'); + } + + // query_interval - computed: true, optional: false, required: false + public get queryInterval() { + return this.getNumberAttribute('query_interval'); + } + + // query_interval_unit - computed: true, optional: false, required: false + public get queryIntervalUnit() { + return this.getStringAttribute('query_interval_unit'); + } + + // time_window - computed: true, optional: false, required: false + public get timeWindow() { + return this.getNumberAttribute('time_window'); + } + + // time_window_unit - computed: true, optional: false, required: false + public get timeWindowUnit() { + return this.getStringAttribute('time_window_unit'); + } +} + +export class DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanOutputReference { + return new DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertRulesAlertRulesTriggers { +} + +export function dataHuaweicloudSecmasterAlertRulesAlertRulesTriggersToTerraform(struct?: DataHuaweicloudSecmasterAlertRulesAlertRulesTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertRulesAlertRulesTriggersToHclTerraform(struct?: DataHuaweicloudSecmasterAlertRulesAlertRulesTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertRulesAlertRulesTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertRulesAlertRulesTriggers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertRulesAlertRulesTriggers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // accumulated_times - computed: true, optional: false, required: false + public get accumulatedTimes() { + return this.getNumberAttribute('accumulated_times'); + } + + // expression - computed: true, optional: false, required: false + public get expression() { + return this.getStringAttribute('expression'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // operator - computed: true, optional: false, required: false + public get operator() { + return this.getStringAttribute('operator'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } +} + +export class DataHuaweicloudSecmasterAlertRulesAlertRulesTriggersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertRulesAlertRulesTriggersOutputReference { + return new DataHuaweicloudSecmasterAlertRulesAlertRulesTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertRulesAlertRules { +} + +export function dataHuaweicloudSecmasterAlertRulesAlertRulesToTerraform(struct?: DataHuaweicloudSecmasterAlertRulesAlertRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertRulesAlertRulesToHclTerraform(struct?: DataHuaweicloudSecmasterAlertRulesAlertRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertRulesAlertRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertRulesAlertRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertRulesAlertRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // custom_properties - computed: true, optional: false, required: false + private _customProperties = new cdktf.StringMap(this, "custom_properties"); + public get customProperties() { + return this._customProperties; + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getStringAttribute('deleted_at'); + } + + // event_grouping - computed: true, optional: false, required: false + public get eventGrouping() { + return this.getBooleanAttribute('event_grouping'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // pipeline_id - computed: true, optional: false, required: false + public get pipelineId() { + return this.getStringAttribute('pipeline_id'); + } + + // pipeline_name - computed: true, optional: false, required: false + public get pipelineName() { + return this.getStringAttribute('pipeline_name'); + } + + // query_plan - computed: true, optional: false, required: false + private _queryPlan = new DataHuaweicloudSecmasterAlertRulesAlertRulesQueryPlanList(this, "query_plan", false); + public get queryPlan() { + return this._queryPlan; + } + + // query_rule - computed: true, optional: false, required: false + public get queryRule() { + return this.getStringAttribute('query_rule'); + } + + // query_type - computed: true, optional: false, required: false + public get queryType() { + return this.getStringAttribute('query_type'); + } + + // severity - computed: true, optional: false, required: false + public get severity() { + return this.getStringAttribute('severity'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // triggers - computed: true, optional: false, required: false + private _triggers = new DataHuaweicloudSecmasterAlertRulesAlertRulesTriggersList(this, "triggers", false); + public get triggers() { + return this._triggers; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataHuaweicloudSecmasterAlertRulesAlertRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertRulesAlertRulesOutputReference { + return new DataHuaweicloudSecmasterAlertRulesAlertRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules huaweicloud_secmaster_alert_rules} +*/ +export class DataHuaweicloudSecmasterAlertRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_alert_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterAlertRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterAlertRules to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterAlertRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterAlertRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_alert_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alert_rules huaweicloud_secmaster_alert_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterAlertRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterAlertRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_alert_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._pipelineId = config.pipelineId; + this._region = config.region; + this._ruleId = config.ruleId; + this._severity = config.severity; + this._status = config.status; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // alert_rules - computed: true, optional: false, required: false + private _alertRules = new DataHuaweicloudSecmasterAlertRulesAlertRulesList(this, "alert_rules", false); + public get alertRules() { + return this._alertRules; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pipeline_id - computed: false, optional: true, required: false + private _pipelineId?: string; + public get pipelineId() { + return this.getStringAttribute('pipeline_id'); + } + public set pipelineId(value: string) { + this._pipelineId = value; + } + public resetPipelineId() { + this._pipelineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get pipelineIdInput() { + return this._pipelineId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // severity - computed: false, optional: true, required: false + private _severity?: string[]; + public get severity() { + return this.getListAttribute('severity'); + } + public set severity(value: string[]) { + this._severity = value; + } + public resetSeverity() { + this._severity = undefined; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // status - computed: false, optional: true, required: false + private _status?: string[]; + public get status() { + return this.getListAttribute('status'); + } + public set status(value: string[]) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pipeline_id: cdktf.stringToTerraform(this._pipelineId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + severity: cdktf.listMapper(cdktf.stringToTerraform, false)(this._severity), + status: cdktf.listMapper(cdktf.stringToTerraform, false)(this._status), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pipeline_id: { + value: cdktf.stringToHclTerraform(this._pipelineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._severity), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + status: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._status), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/README.md new file mode 100644 index 00000000..ee5efa74 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_alerts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_alerts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/index.ts new file mode 100644 index 00000000..a627cf40 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-alerts/index.ts @@ -0,0 +1,1985 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterAlertsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the search start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#from_date DataHuaweicloudSecmasterAlerts#from_date} + */ + readonly fromDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#id DataHuaweicloudSecmasterAlerts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#region DataHuaweicloudSecmasterAlerts#region} + */ + readonly region?: string; + /** + * Specifies the search end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#to_date DataHuaweicloudSecmasterAlerts#to_date} + */ + readonly toDate?: string; + /** + * Specifies the ID of the workspace to which the alert belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#workspace_id DataHuaweicloudSecmasterAlerts#workspace_id} + */ + readonly workspaceId: string; + /** + * condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#condition DataHuaweicloudSecmasterAlerts#condition} + */ + readonly condition?: DataHuaweicloudSecmasterAlertsCondition; +} +export interface DataHuaweicloudSecmasterAlertsAlertsDataSource { +} + +export function dataHuaweicloudSecmasterAlertsAlertsDataSourceToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsDataSourceToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // product_feature - computed: true, optional: false, required: false + public get productFeature() { + return this.getStringAttribute('product_feature'); + } + + // product_name - computed: true, optional: false, required: false + public get productName() { + return this.getStringAttribute('product_name'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getNumberAttribute('source_type'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsDataSourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsDataSourceOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsDataSourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsEnvironment { +} + +export function dataHuaweicloudSecmasterAlertsAlertsEnvironmentToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsEnvironment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsEnvironmentToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsEnvironment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsEnvironmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsEnvironment | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsEnvironment | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cross_workspace_id - computed: true, optional: false, required: false + public get crossWorkspaceId() { + return this.getStringAttribute('cross_workspace_id'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // vendor_type - computed: true, optional: false, required: false + public get vendorType() { + return this.getStringAttribute('vendor_type'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsEnvironmentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsEnvironmentOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsEnvironmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsFileInfo { +} + +export function dataHuaweicloudSecmasterAlertsAlertsFileInfoToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsFileInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsFileInfoToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsFileInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsFileInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsFileInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsFileInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_attr - computed: true, optional: false, required: false + public get fileAttr() { + return this.getStringAttribute('file_attr'); + } + + // file_content - computed: true, optional: false, required: false + public get fileContent() { + return this.getStringAttribute('file_content'); + } + + // file_hash - computed: true, optional: false, required: false + public get fileHash() { + return this.getStringAttribute('file_hash'); + } + + // file_md5 - computed: true, optional: false, required: false + public get fileMd5() { + return this.getStringAttribute('file_md5'); + } + + // file_new_path - computed: true, optional: false, required: false + public get fileNewPath() { + return this.getStringAttribute('file_new_path'); + } + + // file_path - computed: true, optional: false, required: false + public get filePath() { + return this.getStringAttribute('file_path'); + } + + // file_sha256 - computed: true, optional: false, required: false + public get fileSha256() { + return this.getStringAttribute('file_sha256'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsFileInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsFileInfoOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsFileInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsMalware { +} + +export function dataHuaweicloudSecmasterAlertsAlertsMalwareToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsMalware): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsMalwareToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsMalware): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsMalwareOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsMalware | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsMalware | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // malware_class - computed: true, optional: false, required: false + public get malwareClass() { + return this.getStringAttribute('malware_class'); + } + + // malware_family - computed: true, optional: false, required: false + public get malwareFamily() { + return this.getStringAttribute('malware_family'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsMalwareList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsMalwareOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsMalwareOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeo { +} + +export function dataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // city_code - computed: true, optional: false, required: false + public get cityCode() { + return this.getStringAttribute('city_code'); + } + + // country_code - computed: true, optional: false, required: false + public get countryCode() { + return this.getStringAttribute('country_code'); + } + + // latitude - computed: true, optional: false, required: false + public get latitude() { + return this.getNumberAttribute('latitude'); + } + + // longitude - computed: true, optional: false, required: false + public get longitude() { + return this.getNumberAttribute('longitude'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeo { +} + +export function dataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // city_code - computed: true, optional: false, required: false + public get cityCode() { + return this.getStringAttribute('city_code'); + } + + // country_code - computed: true, optional: false, required: false + public get countryCode() { + return this.getStringAttribute('country_code'); + } + + // latitude - computed: true, optional: false, required: false + public get latitude() { + return this.getNumberAttribute('latitude'); + } + + // longitude - computed: true, optional: false, required: false + public get longitude() { + return this.getNumberAttribute('longitude'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsNetworkListStruct { +} + +export function dataHuaweicloudSecmasterAlertsAlertsNetworkListStructToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsNetworkListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsNetworkListStructToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsNetworkListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsNetworkListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsNetworkListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsNetworkListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dest_domain - computed: true, optional: false, required: false + public get destDomain() { + return this.getStringAttribute('dest_domain'); + } + + // dest_geo - computed: true, optional: false, required: false + private _destGeo = new DataHuaweicloudSecmasterAlertsAlertsNetworkListDestGeoList(this, "dest_geo", false); + public get destGeo() { + return this._destGeo; + } + + // dest_ip - computed: true, optional: false, required: false + public get destIp() { + return this.getStringAttribute('dest_ip'); + } + + // dest_port - computed: true, optional: false, required: false + public get destPort() { + return this.getStringAttribute('dest_port'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // src_domain - computed: true, optional: false, required: false + public get srcDomain() { + return this.getStringAttribute('src_domain'); + } + + // src_geo - computed: true, optional: false, required: false + private _srcGeo = new DataHuaweicloudSecmasterAlertsAlertsNetworkListSrcGeoList(this, "src_geo", false); + public get srcGeo() { + return this._srcGeo; + } + + // src_ip - computed: true, optional: false, required: false + public get srcIp() { + return this.getStringAttribute('src_ip'); + } + + // src_port - computed: true, optional: false, required: false + public get srcPort() { + return this.getStringAttribute('src_port'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsNetworkListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsNetworkListStructOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsNetworkListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsProcess { +} + +export function dataHuaweicloudSecmasterAlertsAlertsProcessToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsProcess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsProcessToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsProcess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsProcessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsProcess | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsProcess | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // process_child_cmdline - computed: true, optional: false, required: false + public get processChildCmdline() { + return this.getStringAttribute('process_child_cmdline'); + } + + // process_child_name - computed: true, optional: false, required: false + public get processChildName() { + return this.getStringAttribute('process_child_name'); + } + + // process_child_path - computed: true, optional: false, required: false + public get processChildPath() { + return this.getStringAttribute('process_child_path'); + } + + // process_child_pid - computed: true, optional: false, required: false + public get processChildPid() { + return this.getNumberAttribute('process_child_pid'); + } + + // process_child_uid - computed: true, optional: false, required: false + public get processChildUid() { + return this.getNumberAttribute('process_child_uid'); + } + + // process_cmdline - computed: true, optional: false, required: false + public get processCmdline() { + return this.getStringAttribute('process_cmdline'); + } + + // process_launche_time - computed: true, optional: false, required: false + public get processLauncheTime() { + return this.getStringAttribute('process_launche_time'); + } + + // process_name - computed: true, optional: false, required: false + public get processName() { + return this.getStringAttribute('process_name'); + } + + // process_parent_cmdline - computed: true, optional: false, required: false + public get processParentCmdline() { + return this.getStringAttribute('process_parent_cmdline'); + } + + // process_parent_name - computed: true, optional: false, required: false + public get processParentName() { + return this.getStringAttribute('process_parent_name'); + } + + // process_parent_path - computed: true, optional: false, required: false + public get processParentPath() { + return this.getStringAttribute('process_parent_path'); + } + + // process_parent_pid - computed: true, optional: false, required: false + public get processParentPid() { + return this.getNumberAttribute('process_parent_pid'); + } + + // process_parent_uid - computed: true, optional: false, required: false + public get processParentUid() { + return this.getNumberAttribute('process_parent_uid'); + } + + // process_path - computed: true, optional: false, required: false + public get processPath() { + return this.getStringAttribute('process_path'); + } + + // process_pid - computed: true, optional: false, required: false + public get processPid() { + return this.getNumberAttribute('process_pid'); + } + + // process_terminate_time - computed: true, optional: false, required: false + public get processTerminateTime() { + return this.getStringAttribute('process_terminate_time'); + } + + // process_uid - computed: true, optional: false, required: false + public get processUid() { + return this.getNumberAttribute('process_uid'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsProcessList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsProcessOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsProcessOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsRemediation { +} + +export function dataHuaweicloudSecmasterAlertsAlertsRemediationToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsRemediation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsRemediationToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsRemediation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsRemediationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsRemediation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsRemediation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // recommendation - computed: true, optional: false, required: false + public get recommendation() { + return this.getStringAttribute('recommendation'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsRemediationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsRemediationOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsRemediationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsResourceListStruct { +} + +export function dataHuaweicloudSecmasterAlertsAlertsResourceListStructToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsResourceListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsResourceListStructToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsResourceListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsResourceListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsResourceListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsResourceListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // ep_id - computed: true, optional: false, required: false + public get epId() { + return this.getStringAttribute('ep_id'); + } + + // ep_name - computed: true, optional: false, required: false + public get epName() { + return this.getStringAttribute('ep_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // provider - computed: true, optional: false, required: false + public get provider() { + return this.getStringAttribute('provider'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return this.getStringAttribute('tags'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsResourceListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsResourceListStructOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsResourceListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsType { +} + +export function dataHuaweicloudSecmasterAlertsAlertsTypeToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsTypeToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // alert_type - computed: true, optional: false, required: false + public get alertType() { + return this.getStringAttribute('alert_type'); + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsTypeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsTypeOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsTypeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlertsUserInfo { +} + +export function dataHuaweicloudSecmasterAlertsAlertsUserInfoToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsUserInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsUserInfoToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlertsUserInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsUserInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlertsUserInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlertsUserInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsUserInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsUserInfoOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsUserInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsAlerts { +} + +export function dataHuaweicloudSecmasterAlertsAlertsToTerraform(struct?: DataHuaweicloudSecmasterAlertsAlerts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterAlertsAlertsToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsAlerts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterAlertsAlertsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsAlerts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsAlerts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arrive_time - computed: true, optional: false, required: false + public get arriveTime() { + return this.getStringAttribute('arrive_time'); + } + + // close_comment - computed: true, optional: false, required: false + public get closeComment() { + return this.getStringAttribute('close_comment'); + } + + // close_reason - computed: true, optional: false, required: false + public get closeReason() { + return this.getStringAttribute('close_reason'); + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getNumberAttribute('count'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // data_source - computed: true, optional: false, required: false + private _dataSource = new DataHuaweicloudSecmasterAlertsAlertsDataSourceList(this, "data_source", false); + public get dataSource() { + return this._dataSource; + } + + // debugging_data - computed: true, optional: false, required: false + public get debuggingData() { + return this.getStringAttribute('debugging_data'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // environment - computed: true, optional: false, required: false + private _environment = new DataHuaweicloudSecmasterAlertsAlertsEnvironmentList(this, "environment", false); + public get environment() { + return this._environment; + } + + // file_info - computed: true, optional: false, required: false + private _fileInfo = new DataHuaweicloudSecmasterAlertsAlertsFileInfoList(this, "file_info", false); + public get fileInfo() { + return this._fileInfo; + } + + // first_occurrence_time - computed: true, optional: false, required: false + public get firstOccurrenceTime() { + return this.getStringAttribute('first_occurrence_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // labels - computed: true, optional: false, required: false + public get labels() { + return this.getStringAttribute('labels'); + } + + // last_occurrence_time - computed: true, optional: false, required: false + public get lastOccurrenceTime() { + return this.getStringAttribute('last_occurrence_time'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // malware - computed: true, optional: false, required: false + private _malware = new DataHuaweicloudSecmasterAlertsAlertsMalwareList(this, "malware", false); + public get malware() { + return this._malware; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_list - computed: true, optional: false, required: false + private _networkList = new DataHuaweicloudSecmasterAlertsAlertsNetworkListStructList(this, "network_list", false); + public get networkList() { + return this._networkList; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // planned_closure_time - computed: true, optional: false, required: false + public get plannedClosureTime() { + return this.getStringAttribute('planned_closure_time'); + } + + // process - computed: true, optional: false, required: false + private _process = new DataHuaweicloudSecmasterAlertsAlertsProcessList(this, "process", false); + public get process() { + return this._process; + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // remediation - computed: true, optional: false, required: false + private _remediation = new DataHuaweicloudSecmasterAlertsAlertsRemediationList(this, "remediation", false); + public get remediation() { + return this._remediation; + } + + // resource_list - computed: true, optional: false, required: false + private _resourceList = new DataHuaweicloudSecmasterAlertsAlertsResourceListStructList(this, "resource_list", false); + public get resourceList() { + return this._resourceList; + } + + // stage - computed: true, optional: false, required: false + public get stage() { + return this.getStringAttribute('stage'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + private _type = new DataHuaweicloudSecmasterAlertsAlertsTypeList(this, "type", false); + public get type() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_info - computed: true, optional: false, required: false + private _userInfo = new DataHuaweicloudSecmasterAlertsAlertsUserInfoList(this, "user_info", false); + public get userInfo() { + return this._userInfo; + } + + // verification_status - computed: true, optional: false, required: false + public get verificationStatus() { + return this.getStringAttribute('verification_status'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudSecmasterAlertsAlertsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsAlertsOutputReference { + return new DataHuaweicloudSecmasterAlertsAlertsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsConditionConditions { + /** + * Specifies the expression content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#data DataHuaweicloudSecmasterAlerts#data} + */ + readonly data?: string[]; + /** + * Specifies the expression name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#name DataHuaweicloudSecmasterAlerts#name} + */ + readonly name?: string; +} + +export function dataHuaweicloudSecmasterAlertsConditionConditionsToTerraform(struct?: DataHuaweicloudSecmasterAlertsConditionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.data), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dataHuaweicloudSecmasterAlertsConditionConditionsToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsConditionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.data), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudSecmasterAlertsConditionConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsConditionConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._data !== undefined) { + hasAnyValues = true; + internalValueResult.data = this._data; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsConditionConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._data = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._data = value.data; + this._name = value.name; + } + } + + // data - computed: false, optional: true, required: false + private _data?: string[]; + public get data() { + return this.getListAttribute('data'); + } + public set data(value: string[]) { + this._data = value; + } + public resetData() { + this._data = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataInput() { + return this._data; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DataHuaweicloudSecmasterAlertsConditionConditionsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudSecmasterAlertsConditionConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterAlertsConditionConditionsOutputReference { + return new DataHuaweicloudSecmasterAlertsConditionConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterAlertsCondition { + /** + * Specifies the expression logic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#logics DataHuaweicloudSecmasterAlerts#logics} + */ + readonly logics?: string[]; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#conditions DataHuaweicloudSecmasterAlerts#conditions} + */ + readonly conditions?: DataHuaweicloudSecmasterAlertsConditionConditions[] | cdktf.IResolvable; +} + +export function dataHuaweicloudSecmasterAlertsConditionToTerraform(struct?: DataHuaweicloudSecmasterAlertsConditionOutputReference | DataHuaweicloudSecmasterAlertsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + logics: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.logics), + conditions: cdktf.listMapper(dataHuaweicloudSecmasterAlertsConditionConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function dataHuaweicloudSecmasterAlertsConditionToHclTerraform(struct?: DataHuaweicloudSecmasterAlertsConditionOutputReference | DataHuaweicloudSecmasterAlertsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + logics: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.logics), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + conditions: { + value: cdktf.listMapperHcl(dataHuaweicloudSecmasterAlertsConditionConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudSecmasterAlertsConditionConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudSecmasterAlertsConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataHuaweicloudSecmasterAlertsCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logics !== undefined) { + hasAnyValues = true; + internalValueResult.logics = this._logics; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterAlertsCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._logics = undefined; + this._conditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._logics = value.logics; + this._conditions.internalValue = value.conditions; + } + } + + // logics - computed: false, optional: true, required: false + private _logics?: string[]; + public get logics() { + return this.getListAttribute('logics'); + } + public set logics(value: string[]) { + this._logics = value; + } + public resetLogics() { + this._logics = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicsInput() { + return this._logics; + } + + // conditions - computed: false, optional: true, required: false + private _conditions = new DataHuaweicloudSecmasterAlertsConditionConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: DataHuaweicloudSecmasterAlertsConditionConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + public resetConditions() { + this._conditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts huaweicloud_secmaster_alerts} +*/ +export class DataHuaweicloudSecmasterAlerts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_alerts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterAlerts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterAlerts to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterAlerts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterAlerts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_alerts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_alerts huaweicloud_secmaster_alerts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterAlertsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterAlertsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_alerts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fromDate = config.fromDate; + this._id = config.id; + this._region = config.region; + this._toDate = config.toDate; + this._workspaceId = config.workspaceId; + this._condition.internalValue = config.condition; + } + + // ========== + // ATTRIBUTES + // ========== + + // alerts - computed: true, optional: false, required: false + private _alerts = new DataHuaweicloudSecmasterAlertsAlertsList(this, "alerts", false); + public get alerts() { + return this._alerts; + } + + // from_date - computed: false, optional: true, required: false + private _fromDate?: string; + public get fromDate() { + return this.getStringAttribute('from_date'); + } + public set fromDate(value: string) { + this._fromDate = value; + } + public resetFromDate() { + this._fromDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromDateInput() { + return this._fromDate; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // to_date - computed: false, optional: true, required: false + private _toDate?: string; + public get toDate() { + return this.getStringAttribute('to_date'); + } + public set toDate(value: string) { + this._toDate = value; + } + public resetToDate() { + this._toDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get toDateInput() { + return this._toDate; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // condition - computed: false, optional: true, required: false + private _condition = new DataHuaweicloudSecmasterAlertsConditionOutputReference(this, "condition"); + public get condition() { + return this._condition; + } + public putCondition(value: DataHuaweicloudSecmasterAlertsCondition) { + this._condition.internalValue = value; + } + public resetCondition() { + this._condition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + from_date: cdktf.stringToTerraform(this._fromDate), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + to_date: cdktf.stringToTerraform(this._toDate), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + condition: dataHuaweicloudSecmasterAlertsConditionToTerraform(this._condition.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + from_date: { + value: cdktf.stringToHclTerraform(this._fromDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to_date: { + value: cdktf.stringToHclTerraform(this._toDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition: { + value: dataHuaweicloudSecmasterAlertsConditionToHclTerraform(this._condition.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudSecmasterAlertsConditionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/README.md new file mode 100644 index 00000000..68f0fa43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_baseline_check_results` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_baseline_check_results`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/index.ts new file mode 100644 index 00000000..c196c0b4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-baseline-check-results/index.ts @@ -0,0 +1,268 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterBaselineCheckResultsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the condition expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#condition DataHuaweicloudSecmasterBaselineCheckResults#condition} + */ + readonly condition?: { [key: string]: string }; + /** + * Specifies the start time of the baseline check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#from_date DataHuaweicloudSecmasterBaselineCheckResults#from_date} + */ + readonly fromDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#id DataHuaweicloudSecmasterBaselineCheckResults#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#region DataHuaweicloudSecmasterBaselineCheckResults#region} + */ + readonly region?: string; + /** + * Specifies the end time of the baseline check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#to_date DataHuaweicloudSecmasterBaselineCheckResults#to_date} + */ + readonly toDate?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#workspace_id DataHuaweicloudSecmasterBaselineCheckResults#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results huaweicloud_secmaster_baseline_check_results} +*/ +export class DataHuaweicloudSecmasterBaselineCheckResults extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_baseline_check_results"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterBaselineCheckResults resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterBaselineCheckResults to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterBaselineCheckResults that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterBaselineCheckResults to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_baseline_check_results", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_baseline_check_results huaweicloud_secmaster_baseline_check_results} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterBaselineCheckResultsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterBaselineCheckResultsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_baseline_check_results', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._condition = config.condition; + this._fromDate = config.fromDate; + this._id = config.id; + this._region = config.region; + this._toDate = config.toDate; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // baseline_check_results - computed: true, optional: false, required: false + public get baselineCheckResults() { + return this.getListAttribute('baseline_check_results'); + } + + // condition - computed: false, optional: true, required: false + private _condition?: { [key: string]: string }; + public get condition() { + return this.getStringMapAttribute('condition'); + } + public set condition(value: { [key: string]: string }) { + this._condition = value; + } + public resetCondition() { + this._condition = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // from_date - computed: false, optional: true, required: false + private _fromDate?: string; + public get fromDate() { + return this.getStringAttribute('from_date'); + } + public set fromDate(value: string) { + this._fromDate = value; + } + public resetFromDate() { + this._fromDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromDateInput() { + return this._fromDate; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // to_date - computed: false, optional: true, required: false + private _toDate?: string; + public get toDate() { + return this.getStringAttribute('to_date'); + } + public set toDate(value: string) { + this._toDate = value; + } + public resetToDate() { + this._toDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get toDateInput() { + return this._toDate; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + condition: cdktf.hashMapper(cdktf.stringToTerraform)(this._condition), + from_date: cdktf.stringToTerraform(this._fromDate), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + to_date: cdktf.stringToTerraform(this._toDate), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + condition: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._condition), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + from_date: { + value: cdktf.stringToHclTerraform(this._fromDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to_date: { + value: cdktf.stringToHclTerraform(this._toDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/README.md new file mode 100644 index 00000000..7ceea6b3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_data_class_fields` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_data_class_fields`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/index.ts new file mode 100644 index 00000000..db02f8f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-class-fields/index.ts @@ -0,0 +1,536 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterDataClassFieldsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data class ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#data_class_id DataHuaweicloudSecmasterDataClassFields#data_class_id} + */ + readonly dataClassId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#id DataHuaweicloudSecmasterDataClassFields#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether it is built in SecMaster. The value can be **true** or **false**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#is_built_in DataHuaweicloudSecmasterDataClassFields#is_built_in} + */ + readonly isBuiltIn?: string; + /** + * Specifies whether to display in other places other the classification and mapping module. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#mapping DataHuaweicloudSecmasterDataClassFields#mapping} + */ + readonly mapping?: string; + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#name DataHuaweicloudSecmasterDataClassFields#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#region DataHuaweicloudSecmasterDataClassFields#region} + */ + readonly region?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#workspace_id DataHuaweicloudSecmasterDataClassFields#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterDataClassFieldsFields { +} + +export function dataHuaweicloudSecmasterDataClassFieldsFieldsToTerraform(struct?: DataHuaweicloudSecmasterDataClassFieldsFields): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterDataClassFieldsFieldsToHclTerraform(struct?: DataHuaweicloudSecmasterDataClassFieldsFields): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterDataClassFieldsFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterDataClassFieldsFields | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterDataClassFieldsFields | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // business_code - computed: true, optional: false, required: false + public get businessCode() { + return this.getStringAttribute('business_code'); + } + + // business_id - computed: true, optional: false, required: false + public get businessId() { + return this.getStringAttribute('business_id'); + } + + // business_type - computed: true, optional: false, required: false + public get businessType() { + return this.getStringAttribute('business_type'); + } + + // case_sensitive - computed: true, optional: false, required: false + public get caseSensitive() { + return this.getBooleanAttribute('case_sensitive'); + } + + // creatabled - computed: true, optional: false, required: false + public get creatabled() { + return this.getBooleanAttribute('creatabled'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // creator_id - computed: true, optional: false, required: false + public get creatorId() { + return this.getStringAttribute('creator_id'); + } + + // data_class_name - computed: true, optional: false, required: false + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + + // default_value - computed: true, optional: false, required: false + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // display_type - computed: true, optional: false, required: false + public get displayType() { + return this.getStringAttribute('display_type'); + } + + // editabled - computed: true, optional: false, required: false + public get editabled() { + return this.getBooleanAttribute('editabled'); + } + + // extra_json - computed: true, optional: false, required: false + public get extraJson() { + return this.getStringAttribute('extra_json'); + } + + // field_key - computed: true, optional: false, required: false + public get fieldKey() { + return this.getStringAttribute('field_key'); + } + + // field_tooltip - computed: true, optional: false, required: false + public get fieldTooltip() { + return this.getStringAttribute('field_tooltip'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // io_type - computed: true, optional: false, required: false + public get ioType() { + return this.getStringAttribute('io_type'); + } + + // is_built_in - computed: true, optional: false, required: false + public get isBuiltIn() { + return this.getBooleanAttribute('is_built_in'); + } + + // json_schema - computed: true, optional: false, required: false + public get jsonSchema() { + return this.getStringAttribute('json_schema'); + } + + // maintainabled - computed: true, optional: false, required: false + public get maintainabled() { + return this.getBooleanAttribute('maintainabled'); + } + + // mapping - computed: true, optional: false, required: false + public get mapping() { + return this.getBooleanAttribute('mapping'); + } + + // modifier - computed: true, optional: false, required: false + public get modifier() { + return this.getStringAttribute('modifier'); + } + + // modifier_id - computed: true, optional: false, required: false + public get modifierId() { + return this.getStringAttribute('modifier_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // read_only - computed: true, optional: false, required: false + public get readOnly() { + return this.getBooleanAttribute('read_only'); + } + + // required - computed: true, optional: false, required: false + public get required() { + return this.getBooleanAttribute('required'); + } + + // searchabled - computed: true, optional: false, required: false + public get searchabled() { + return this.getBooleanAttribute('searchabled'); + } + + // subscribed_version - computed: true, optional: false, required: false + public get subscribedVersion() { + return this.getStringAttribute('subscribed_version'); + } + + // target_api - computed: true, optional: false, required: false + public get targetApi() { + return this.getStringAttribute('target_api'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // used_by - computed: true, optional: false, required: false + public get usedBy() { + return this.getStringAttribute('used_by'); + } + + // visible - computed: true, optional: false, required: false + public get visible() { + return this.getBooleanAttribute('visible'); + } +} + +export class DataHuaweicloudSecmasterDataClassFieldsFieldsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterDataClassFieldsFieldsOutputReference { + return new DataHuaweicloudSecmasterDataClassFieldsFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields huaweicloud_secmaster_data_class_fields} +*/ +export class DataHuaweicloudSecmasterDataClassFields extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_data_class_fields"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterDataClassFields resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterDataClassFields to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterDataClassFields that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterDataClassFields to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_data_class_fields", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_class_fields huaweicloud_secmaster_data_class_fields} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterDataClassFieldsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterDataClassFieldsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_data_class_fields', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataClassId = config.dataClassId; + this._id = config.id; + this._isBuiltIn = config.isBuiltIn; + this._mapping = config.mapping; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_class_id - computed: false, optional: false, required: true + private _dataClassId?: string; + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + public set dataClassId(value: string) { + this._dataClassId = value; + } + // Temporarily expose input value. Use with caution. + public get dataClassIdInput() { + return this._dataClassId; + } + + // fields - computed: true, optional: false, required: false + private _fields = new DataHuaweicloudSecmasterDataClassFieldsFieldsList(this, "fields", false); + public get fields() { + return this._fields; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_built_in - computed: false, optional: true, required: false + private _isBuiltIn?: string; + public get isBuiltIn() { + return this.getStringAttribute('is_built_in'); + } + public set isBuiltIn(value: string) { + this._isBuiltIn = value; + } + public resetIsBuiltIn() { + this._isBuiltIn = undefined; + } + // Temporarily expose input value. Use with caution. + public get isBuiltInInput() { + return this._isBuiltIn; + } + + // mapping - computed: false, optional: true, required: false + private _mapping?: string; + public get mapping() { + return this.getStringAttribute('mapping'); + } + public set mapping(value: string) { + this._mapping = value; + } + public resetMapping() { + this._mapping = undefined; + } + // Temporarily expose input value. Use with caution. + public get mappingInput() { + return this._mapping; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_class_id: cdktf.stringToTerraform(this._dataClassId), + id: cdktf.stringToTerraform(this._id), + is_built_in: cdktf.stringToTerraform(this._isBuiltIn), + mapping: cdktf.stringToTerraform(this._mapping), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_class_id: { + value: cdktf.stringToHclTerraform(this._dataClassId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_built_in: { + value: cdktf.stringToHclTerraform(this._isBuiltIn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mapping: { + value: cdktf.stringToHclTerraform(this._mapping), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/README.md new file mode 100644 index 00000000..495bb2d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_data_classes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_data_classes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/index.ts new file mode 100644 index 00000000..646f9bce --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-data-classes/index.ts @@ -0,0 +1,459 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterDataClassesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the business code of the data class. Fuzzy matching is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#business_code DataHuaweicloudSecmasterDataClasses#business_code} + */ + readonly businessCode?: string; + /** + * Specifies the data class description. Fuzzy matching is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#description DataHuaweicloudSecmasterDataClasses#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#id DataHuaweicloudSecmasterDataClasses#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the data class is built in SecMaster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#is_built_in DataHuaweicloudSecmasterDataClasses#is_built_in} + */ + readonly isBuiltIn?: string; + /** + * Specifies the name of the data class. Fuzzy matching is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#name DataHuaweicloudSecmasterDataClasses#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#region DataHuaweicloudSecmasterDataClasses#region} + */ + readonly region?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#workspace_id DataHuaweicloudSecmasterDataClasses#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterDataClassesDataClasses { +} + +export function dataHuaweicloudSecmasterDataClassesDataClassesToTerraform(struct?: DataHuaweicloudSecmasterDataClassesDataClasses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterDataClassesDataClassesToHclTerraform(struct?: DataHuaweicloudSecmasterDataClassesDataClasses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterDataClassesDataClassesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterDataClassesDataClasses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterDataClassesDataClasses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // business_code - computed: true, optional: false, required: false + public get businessCode() { + return this.getStringAttribute('business_code'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // creator_id - computed: true, optional: false, required: false + public get creatorId() { + return this.getStringAttribute('creator_id'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_built_in - computed: true, optional: false, required: false + public get isBuiltIn() { + return this.getBooleanAttribute('is_built_in'); + } + + // modifier - computed: true, optional: false, required: false + public get modifier() { + return this.getStringAttribute('modifier'); + } + + // modifier_id - computed: true, optional: false, required: false + public get modifierId() { + return this.getStringAttribute('modifier_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parent_id - computed: true, optional: false, required: false + public get parentId() { + return this.getStringAttribute('parent_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // subscribed_version - computed: true, optional: false, required: false + public get subscribedVersion() { + return this.getStringAttribute('subscribed_version'); + } + + // type_num - computed: true, optional: false, required: false + public get typeNum() { + return this.getNumberAttribute('type_num'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudSecmasterDataClassesDataClassesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterDataClassesDataClassesOutputReference { + return new DataHuaweicloudSecmasterDataClassesDataClassesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes huaweicloud_secmaster_data_classes} +*/ +export class DataHuaweicloudSecmasterDataClasses extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_data_classes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterDataClasses resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterDataClasses to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterDataClasses that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterDataClasses to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_data_classes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_data_classes huaweicloud_secmaster_data_classes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterDataClassesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterDataClassesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_data_classes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._businessCode = config.businessCode; + this._description = config.description; + this._id = config.id; + this._isBuiltIn = config.isBuiltIn; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // business_code - computed: false, optional: true, required: false + private _businessCode?: string; + public get businessCode() { + return this.getStringAttribute('business_code'); + } + public set businessCode(value: string) { + this._businessCode = value; + } + public resetBusinessCode() { + this._businessCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get businessCodeInput() { + return this._businessCode; + } + + // data_classes - computed: true, optional: false, required: false + private _dataClasses = new DataHuaweicloudSecmasterDataClassesDataClassesList(this, "data_classes", false); + public get dataClasses() { + return this._dataClasses; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_built_in - computed: false, optional: true, required: false + private _isBuiltIn?: string; + public get isBuiltIn() { + return this.getStringAttribute('is_built_in'); + } + public set isBuiltIn(value: string) { + this._isBuiltIn = value; + } + public resetIsBuiltIn() { + this._isBuiltIn = undefined; + } + // Temporarily expose input value. Use with caution. + public get isBuiltInInput() { + return this._isBuiltIn; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + business_code: cdktf.stringToTerraform(this._businessCode), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + is_built_in: cdktf.stringToTerraform(this._isBuiltIn), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + business_code: { + value: cdktf.stringToHclTerraform(this._businessCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_built_in: { + value: cdktf.stringToHclTerraform(this._isBuiltIn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/README.md new file mode 100644 index 00000000..d06c2639 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_incidents` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_incidents`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/index.ts new file mode 100644 index 00000000..51a95f54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-incidents/index.ts @@ -0,0 +1,920 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterIncidentsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the search start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#from_date DataHuaweicloudSecmasterIncidents#from_date} + */ + readonly fromDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#id DataHuaweicloudSecmasterIncidents#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#region DataHuaweicloudSecmasterIncidents#region} + */ + readonly region?: string; + /** + * Specifies the search end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#to_date DataHuaweicloudSecmasterIncidents#to_date} + */ + readonly toDate?: string; + /** + * Specifies the ID of the workspace to which the incident belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#workspace_id DataHuaweicloudSecmasterIncidents#workspace_id} + */ + readonly workspaceId: string; + /** + * condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#condition DataHuaweicloudSecmasterIncidents#condition} + */ + readonly condition?: DataHuaweicloudSecmasterIncidentsCondition; +} +export interface DataHuaweicloudSecmasterIncidentsIncidentsDataSource { +} + +export function dataHuaweicloudSecmasterIncidentsIncidentsDataSourceToTerraform(struct?: DataHuaweicloudSecmasterIncidentsIncidentsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIncidentsIncidentsDataSourceToHclTerraform(struct?: DataHuaweicloudSecmasterIncidentsIncidentsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIncidentsIncidentsDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIncidentsIncidentsDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIncidentsIncidentsDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // product_feature - computed: true, optional: false, required: false + public get productFeature() { + return this.getStringAttribute('product_feature'); + } + + // product_name - computed: true, optional: false, required: false + public get productName() { + return this.getStringAttribute('product_name'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getNumberAttribute('source_type'); + } +} + +export class DataHuaweicloudSecmasterIncidentsIncidentsDataSourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIncidentsIncidentsDataSourceOutputReference { + return new DataHuaweicloudSecmasterIncidentsIncidentsDataSourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIncidentsIncidentsType { +} + +export function dataHuaweicloudSecmasterIncidentsIncidentsTypeToTerraform(struct?: DataHuaweicloudSecmasterIncidentsIncidentsType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIncidentsIncidentsTypeToHclTerraform(struct?: DataHuaweicloudSecmasterIncidentsIncidentsType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIncidentsIncidentsTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIncidentsIncidentsType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIncidentsIncidentsType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // incident_type - computed: true, optional: false, required: false + public get incidentType() { + return this.getStringAttribute('incident_type'); + } +} + +export class DataHuaweicloudSecmasterIncidentsIncidentsTypeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIncidentsIncidentsTypeOutputReference { + return new DataHuaweicloudSecmasterIncidentsIncidentsTypeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIncidentsIncidents { +} + +export function dataHuaweicloudSecmasterIncidentsIncidentsToTerraform(struct?: DataHuaweicloudSecmasterIncidentsIncidents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIncidentsIncidentsToHclTerraform(struct?: DataHuaweicloudSecmasterIncidentsIncidents): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIncidentsIncidentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIncidentsIncidents | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIncidentsIncidents | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // arrive_time - computed: true, optional: false, required: false + public get arriveTime() { + return this.getStringAttribute('arrive_time'); + } + + // close_comment - computed: true, optional: false, required: false + public get closeComment() { + return this.getStringAttribute('close_comment'); + } + + // close_reason - computed: true, optional: false, required: false + public get closeReason() { + return this.getStringAttribute('close_reason'); + } + + // count - computed: true, optional: false, required: false + public get count() { + return this.getNumberAttribute('count'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // data_source - computed: true, optional: false, required: false + private _dataSource = new DataHuaweicloudSecmasterIncidentsIncidentsDataSourceList(this, "data_source", false); + public get dataSource() { + return this._dataSource; + } + + // debugging_data - computed: true, optional: false, required: false + public get debuggingData() { + return this.getStringAttribute('debugging_data'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // first_occurrence_time - computed: true, optional: false, required: false + public get firstOccurrenceTime() { + return this.getStringAttribute('first_occurrence_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipdrr_phase - computed: true, optional: false, required: false + public get ipdrrPhase() { + return this.getStringAttribute('ipdrr_phase'); + } + + // labels - computed: true, optional: false, required: false + public get labels() { + return this.getStringAttribute('labels'); + } + + // last_occurrence_time - computed: true, optional: false, required: false + public get lastOccurrenceTime() { + return this.getStringAttribute('last_occurrence_time'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getStringAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // planned_closure_time - computed: true, optional: false, required: false + public get plannedClosureTime() { + return this.getStringAttribute('planned_closure_time'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // stage - computed: true, optional: false, required: false + public get stage() { + return this.getStringAttribute('stage'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + private _type = new DataHuaweicloudSecmasterIncidentsIncidentsTypeList(this, "type", false); + public get type() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // verification_status - computed: true, optional: false, required: false + public get verificationStatus() { + return this.getStringAttribute('verification_status'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudSecmasterIncidentsIncidentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIncidentsIncidentsOutputReference { + return new DataHuaweicloudSecmasterIncidentsIncidentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIncidentsConditionConditions { + /** + * Specifies the expression content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#data DataHuaweicloudSecmasterIncidents#data} + */ + readonly data?: string[]; + /** + * Specifies the expression name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#name DataHuaweicloudSecmasterIncidents#name} + */ + readonly name?: string; +} + +export function dataHuaweicloudSecmasterIncidentsConditionConditionsToTerraform(struct?: DataHuaweicloudSecmasterIncidentsConditionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.data), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dataHuaweicloudSecmasterIncidentsConditionConditionsToHclTerraform(struct?: DataHuaweicloudSecmasterIncidentsConditionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.data), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudSecmasterIncidentsConditionConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIncidentsConditionConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._data !== undefined) { + hasAnyValues = true; + internalValueResult.data = this._data; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIncidentsConditionConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._data = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._data = value.data; + this._name = value.name; + } + } + + // data - computed: false, optional: true, required: false + private _data?: string[]; + public get data() { + return this.getListAttribute('data'); + } + public set data(value: string[]) { + this._data = value; + } + public resetData() { + this._data = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataInput() { + return this._data; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DataHuaweicloudSecmasterIncidentsConditionConditionsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudSecmasterIncidentsConditionConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIncidentsConditionConditionsOutputReference { + return new DataHuaweicloudSecmasterIncidentsConditionConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIncidentsCondition { + /** + * Specifies the expression logic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#logics DataHuaweicloudSecmasterIncidents#logics} + */ + readonly logics?: string[]; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#conditions DataHuaweicloudSecmasterIncidents#conditions} + */ + readonly conditions?: DataHuaweicloudSecmasterIncidentsConditionConditions[] | cdktf.IResolvable; +} + +export function dataHuaweicloudSecmasterIncidentsConditionToTerraform(struct?: DataHuaweicloudSecmasterIncidentsConditionOutputReference | DataHuaweicloudSecmasterIncidentsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + logics: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.logics), + conditions: cdktf.listMapper(dataHuaweicloudSecmasterIncidentsConditionConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function dataHuaweicloudSecmasterIncidentsConditionToHclTerraform(struct?: DataHuaweicloudSecmasterIncidentsConditionOutputReference | DataHuaweicloudSecmasterIncidentsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + logics: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.logics), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + conditions: { + value: cdktf.listMapperHcl(dataHuaweicloudSecmasterIncidentsConditionConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudSecmasterIncidentsConditionConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudSecmasterIncidentsConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataHuaweicloudSecmasterIncidentsCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logics !== undefined) { + hasAnyValues = true; + internalValueResult.logics = this._logics; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIncidentsCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._logics = undefined; + this._conditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._logics = value.logics; + this._conditions.internalValue = value.conditions; + } + } + + // logics - computed: false, optional: true, required: false + private _logics?: string[]; + public get logics() { + return this.getListAttribute('logics'); + } + public set logics(value: string[]) { + this._logics = value; + } + public resetLogics() { + this._logics = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicsInput() { + return this._logics; + } + + // conditions - computed: false, optional: true, required: false + private _conditions = new DataHuaweicloudSecmasterIncidentsConditionConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: DataHuaweicloudSecmasterIncidentsConditionConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + public resetConditions() { + this._conditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents huaweicloud_secmaster_incidents} +*/ +export class DataHuaweicloudSecmasterIncidents extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_incidents"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterIncidents resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterIncidents to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterIncidents that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterIncidents to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_incidents", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_incidents huaweicloud_secmaster_incidents} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterIncidentsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterIncidentsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_incidents', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fromDate = config.fromDate; + this._id = config.id; + this._region = config.region; + this._toDate = config.toDate; + this._workspaceId = config.workspaceId; + this._condition.internalValue = config.condition; + } + + // ========== + // ATTRIBUTES + // ========== + + // from_date - computed: false, optional: true, required: false + private _fromDate?: string; + public get fromDate() { + return this.getStringAttribute('from_date'); + } + public set fromDate(value: string) { + this._fromDate = value; + } + public resetFromDate() { + this._fromDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromDateInput() { + return this._fromDate; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // incidents - computed: true, optional: false, required: false + private _incidents = new DataHuaweicloudSecmasterIncidentsIncidentsList(this, "incidents", false); + public get incidents() { + return this._incidents; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // to_date - computed: false, optional: true, required: false + private _toDate?: string; + public get toDate() { + return this.getStringAttribute('to_date'); + } + public set toDate(value: string) { + this._toDate = value; + } + public resetToDate() { + this._toDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get toDateInput() { + return this._toDate; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // condition - computed: false, optional: true, required: false + private _condition = new DataHuaweicloudSecmasterIncidentsConditionOutputReference(this, "condition"); + public get condition() { + return this._condition; + } + public putCondition(value: DataHuaweicloudSecmasterIncidentsCondition) { + this._condition.internalValue = value; + } + public resetCondition() { + this._condition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + from_date: cdktf.stringToTerraform(this._fromDate), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + to_date: cdktf.stringToTerraform(this._toDate), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + condition: dataHuaweicloudSecmasterIncidentsConditionToTerraform(this._condition.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + from_date: { + value: cdktf.stringToHclTerraform(this._fromDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to_date: { + value: cdktf.stringToHclTerraform(this._toDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition: { + value: dataHuaweicloudSecmasterIncidentsConditionToHclTerraform(this._condition.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudSecmasterIncidentsConditionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/README.md new file mode 100644 index 00000000..df72ce4a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_indicators` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_indicators`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/index.ts new file mode 100644 index 00000000..77593e36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-indicators/index.ts @@ -0,0 +1,1031 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterIndicatorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data class ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#data_class_id DataHuaweicloudSecmasterIndicators#data_class_id} + */ + readonly dataClassId?: string; + /** + * Specifies the search start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#from_date DataHuaweicloudSecmasterIndicators#from_date} + */ + readonly fromDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#id DataHuaweicloudSecmasterIndicators#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the indicator IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#ids DataHuaweicloudSecmasterIndicators#ids} + */ + readonly ids?: string[]; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#region DataHuaweicloudSecmasterIndicators#region} + */ + readonly region?: string; + /** + * Specifies the search end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#to_date DataHuaweicloudSecmasterIndicators#to_date} + */ + readonly toDate?: string; + /** + * Specifies the ID of the workspace to which the indicator belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#workspace_id DataHuaweicloudSecmasterIndicators#workspace_id} + */ + readonly workspaceId: string; + /** + * condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#condition DataHuaweicloudSecmasterIndicators#condition} + */ + readonly condition?: DataHuaweicloudSecmasterIndicatorsCondition; +} +export interface DataHuaweicloudSecmasterIndicatorsIndicatorsDataSource { +} + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceToTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicatorsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceToHclTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicatorsDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIndicatorsIndicatorsDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIndicatorsIndicatorsDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // source_type - computed: true, optional: false, required: false + public get sourceType() { + return this.getNumberAttribute('source_type'); + } +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceOutputReference { + return new DataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironment { +} + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentToTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentToHclTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironment | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironment | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region_id - computed: true, optional: false, required: false + public get regionId() { + return this.getStringAttribute('region_id'); + } + + // vendor_type - computed: true, optional: false, required: false + public get vendorType() { + return this.getStringAttribute('vendor_type'); + } +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentOutputReference { + return new DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIndicatorsIndicatorsType { +} + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsTypeToTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicatorsType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsTypeToHclTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicatorsType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIndicatorsIndicatorsType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIndicatorsIndicatorsType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // indicator_type - computed: true, optional: false, required: false + public get indicatorType() { + return this.getStringAttribute('indicator_type'); + } +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsTypeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIndicatorsIndicatorsTypeOutputReference { + return new DataHuaweicloudSecmasterIndicatorsIndicatorsTypeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIndicatorsIndicators { +} + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsToTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicators): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterIndicatorsIndicatorsToHclTerraform(struct?: DataHuaweicloudSecmasterIndicatorsIndicators): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIndicatorsIndicators | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIndicatorsIndicators | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // confidence - computed: true, optional: false, required: false + public get confidence() { + return this.getNumberAttribute('confidence'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // data_source - computed: true, optional: false, required: false + private _dataSource = new DataHuaweicloudSecmasterIndicatorsIndicatorsDataSourceList(this, "data_source", false); + public get dataSource() { + return this._dataSource; + } + + // environment - computed: true, optional: false, required: false + private _environment = new DataHuaweicloudSecmasterIndicatorsIndicatorsEnvironmentList(this, "environment", false); + public get environment() { + return this._environment; + } + + // first_occurrence_time - computed: true, optional: false, required: false + public get firstOccurrenceTime() { + return this.getStringAttribute('first_occurrence_time'); + } + + // granularity - computed: true, optional: false, required: false + public get granularity() { + return this.getNumberAttribute('granularity'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_deleted - computed: true, optional: false, required: false + public get isDeleted() { + return this.getBooleanAttribute('is_deleted'); + } + + // last_occurrence_time - computed: true, optional: false, required: false + public get lastOccurrenceTime() { + return this.getStringAttribute('last_occurrence_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // revoked - computed: true, optional: false, required: false + public get revoked() { + return this.getBooleanAttribute('revoked'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // threat_degree - computed: true, optional: false, required: false + public get threatDegree() { + return this.getStringAttribute('threat_degree'); + } + + // type - computed: true, optional: false, required: false + private _type = new DataHuaweicloudSecmasterIndicatorsIndicatorsTypeList(this, "type", false); + public get type() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudSecmasterIndicatorsIndicatorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIndicatorsIndicatorsOutputReference { + return new DataHuaweicloudSecmasterIndicatorsIndicatorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIndicatorsConditionConditions { + /** + * Specifies the expression content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#data DataHuaweicloudSecmasterIndicators#data} + */ + readonly data?: string[]; + /** + * Specifies the expression name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#name DataHuaweicloudSecmasterIndicators#name} + */ + readonly name?: string; +} + +export function dataHuaweicloudSecmasterIndicatorsConditionConditionsToTerraform(struct?: DataHuaweicloudSecmasterIndicatorsConditionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.data), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dataHuaweicloudSecmasterIndicatorsConditionConditionsToHclTerraform(struct?: DataHuaweicloudSecmasterIndicatorsConditionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.data), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudSecmasterIndicatorsConditionConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterIndicatorsConditionConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._data !== undefined) { + hasAnyValues = true; + internalValueResult.data = this._data; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIndicatorsConditionConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._data = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._data = value.data; + this._name = value.name; + } + } + + // data - computed: false, optional: true, required: false + private _data?: string[]; + public get data() { + return this.getListAttribute('data'); + } + public set data(value: string[]) { + this._data = value; + } + public resetData() { + this._data = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataInput() { + return this._data; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DataHuaweicloudSecmasterIndicatorsConditionConditionsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudSecmasterIndicatorsConditionConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterIndicatorsConditionConditionsOutputReference { + return new DataHuaweicloudSecmasterIndicatorsConditionConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterIndicatorsCondition { + /** + * Specifies the expression logic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#logics DataHuaweicloudSecmasterIndicators#logics} + */ + readonly logics?: string[]; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#conditions DataHuaweicloudSecmasterIndicators#conditions} + */ + readonly conditions?: DataHuaweicloudSecmasterIndicatorsConditionConditions[] | cdktf.IResolvable; +} + +export function dataHuaweicloudSecmasterIndicatorsConditionToTerraform(struct?: DataHuaweicloudSecmasterIndicatorsConditionOutputReference | DataHuaweicloudSecmasterIndicatorsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + logics: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.logics), + conditions: cdktf.listMapper(dataHuaweicloudSecmasterIndicatorsConditionConditionsToTerraform, true)(struct!.conditions), + } +} + + +export function dataHuaweicloudSecmasterIndicatorsConditionToHclTerraform(struct?: DataHuaweicloudSecmasterIndicatorsConditionOutputReference | DataHuaweicloudSecmasterIndicatorsCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + logics: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.logics), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + conditions: { + value: cdktf.listMapperHcl(dataHuaweicloudSecmasterIndicatorsConditionConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudSecmasterIndicatorsConditionConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudSecmasterIndicatorsConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataHuaweicloudSecmasterIndicatorsCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logics !== undefined) { + hasAnyValues = true; + internalValueResult.logics = this._logics; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterIndicatorsCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._logics = undefined; + this._conditions.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._logics = value.logics; + this._conditions.internalValue = value.conditions; + } + } + + // logics - computed: false, optional: true, required: false + private _logics?: string[]; + public get logics() { + return this.getListAttribute('logics'); + } + public set logics(value: string[]) { + this._logics = value; + } + public resetLogics() { + this._logics = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicsInput() { + return this._logics; + } + + // conditions - computed: false, optional: true, required: false + private _conditions = new DataHuaweicloudSecmasterIndicatorsConditionConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: DataHuaweicloudSecmasterIndicatorsConditionConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + public resetConditions() { + this._conditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators huaweicloud_secmaster_indicators} +*/ +export class DataHuaweicloudSecmasterIndicators extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_indicators"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterIndicators resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterIndicators to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterIndicators that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterIndicators to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_indicators", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_indicators huaweicloud_secmaster_indicators} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterIndicatorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterIndicatorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_indicators', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataClassId = config.dataClassId; + this._fromDate = config.fromDate; + this._id = config.id; + this._ids = config.ids; + this._region = config.region; + this._toDate = config.toDate; + this._workspaceId = config.workspaceId; + this._condition.internalValue = config.condition; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_class_id - computed: false, optional: true, required: false + private _dataClassId?: string; + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + public set dataClassId(value: string) { + this._dataClassId = value; + } + public resetDataClassId() { + this._dataClassId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataClassIdInput() { + return this._dataClassId; + } + + // from_date - computed: false, optional: true, required: false + private _fromDate?: string; + public get fromDate() { + return this.getStringAttribute('from_date'); + } + public set fromDate(value: string) { + this._fromDate = value; + } + public resetFromDate() { + this._fromDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromDateInput() { + return this._fromDate; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: false, optional: true, required: false + private _ids?: string[]; + public get ids() { + return this.getListAttribute('ids'); + } + public set ids(value: string[]) { + this._ids = value; + } + public resetIds() { + this._ids = undefined; + } + // Temporarily expose input value. Use with caution. + public get idsInput() { + return this._ids; + } + + // indicators - computed: true, optional: false, required: false + private _indicators = new DataHuaweicloudSecmasterIndicatorsIndicatorsList(this, "indicators", false); + public get indicators() { + return this._indicators; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // to_date - computed: false, optional: true, required: false + private _toDate?: string; + public get toDate() { + return this.getStringAttribute('to_date'); + } + public set toDate(value: string) { + this._toDate = value; + } + public resetToDate() { + this._toDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get toDateInput() { + return this._toDate; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // condition - computed: false, optional: true, required: false + private _condition = new DataHuaweicloudSecmasterIndicatorsConditionOutputReference(this, "condition"); + public get condition() { + return this._condition; + } + public putCondition(value: DataHuaweicloudSecmasterIndicatorsCondition) { + this._condition.internalValue = value; + } + public resetCondition() { + this._condition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_class_id: cdktf.stringToTerraform(this._dataClassId), + from_date: cdktf.stringToTerraform(this._fromDate), + id: cdktf.stringToTerraform(this._id), + ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ids), + region: cdktf.stringToTerraform(this._region), + to_date: cdktf.stringToTerraform(this._toDate), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + condition: dataHuaweicloudSecmasterIndicatorsConditionToTerraform(this._condition.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_class_id: { + value: cdktf.stringToHclTerraform(this._dataClassId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + from_date: { + value: cdktf.stringToHclTerraform(this._fromDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ids), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to_date: { + value: cdktf.stringToHclTerraform(this._toDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition: { + value: dataHuaweicloudSecmasterIndicatorsConditionToHclTerraform(this._condition.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataHuaweicloudSecmasterIndicatorsConditionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/README.md new file mode 100644 index 00000000..2ac5399b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_metric_results` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_metric_results`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/index.ts new file mode 100644 index 00000000..d5aca1d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-metric-results/index.ts @@ -0,0 +1,517 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterMetricResultsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether the cache is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#cache DataHuaweicloudSecmasterMetricResults#cache} + */ + readonly cache?: string; + /** + * Specifies the indicator card IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#field_ids DataHuaweicloudSecmasterMetricResults#field_ids} + */ + readonly fieldIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#id DataHuaweicloudSecmasterMetricResults#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the interactive parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#interactive_params DataHuaweicloudSecmasterMetricResults#interactive_params} + */ + readonly interactiveParams?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * Specifies the metrics IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#metric_ids DataHuaweicloudSecmasterMetricResults#metric_ids} + */ + readonly metricIds: string[]; + /** + * Specifies the parameter list of the metric. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#params DataHuaweicloudSecmasterMetricResults#params} + */ + readonly params?: { [key: string]: string }[] | cdktf.IResolvable; + /** + * Specifies the region in which to query the data source. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#region DataHuaweicloudSecmasterMetricResults#region} + */ + readonly region?: string; + /** + * Specifies the time range for querying metrics. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#timespan DataHuaweicloudSecmasterMetricResults#timespan} + */ + readonly timespan?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#workspace_id DataHuaweicloudSecmasterMetricResults#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterMetricResultsMetricResultsDataRows { +} + +export function dataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsToTerraform(struct?: DataHuaweicloudSecmasterMetricResultsMetricResultsDataRows): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsToHclTerraform(struct?: DataHuaweicloudSecmasterMetricResultsMetricResultsDataRows): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterMetricResultsMetricResultsDataRows | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterMetricResultsMetricResultsDataRows | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_row - computed: true, optional: false, required: false + public get dataRow() { + return this.getListAttribute('data_row'); + } +} + +export class DataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsOutputReference { + return new DataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterMetricResultsMetricResults { +} + +export function dataHuaweicloudSecmasterMetricResultsMetricResultsToTerraform(struct?: DataHuaweicloudSecmasterMetricResultsMetricResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterMetricResultsMetricResultsToHclTerraform(struct?: DataHuaweicloudSecmasterMetricResultsMetricResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterMetricResultsMetricResultsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterMetricResultsMetricResults | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterMetricResultsMetricResults | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // data_rows - computed: true, optional: false, required: false + private _dataRows = new DataHuaweicloudSecmasterMetricResultsMetricResultsDataRowsList(this, "data_rows", false); + public get dataRows() { + return this._dataRows; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // labels - computed: true, optional: false, required: false + public get labels() { + return this.getListAttribute('labels'); + } +} + +export class DataHuaweicloudSecmasterMetricResultsMetricResultsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterMetricResultsMetricResultsOutputReference { + return new DataHuaweicloudSecmasterMetricResultsMetricResultsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results huaweicloud_secmaster_metric_results} +*/ +export class DataHuaweicloudSecmasterMetricResults extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_metric_results"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterMetricResults resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterMetricResults to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterMetricResults that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterMetricResults to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_metric_results", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_metric_results huaweicloud_secmaster_metric_results} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterMetricResultsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterMetricResultsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_metric_results', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cache = config.cache; + this._fieldIds = config.fieldIds; + this._id = config.id; + this._interactiveParams = config.interactiveParams; + this._metricIds = config.metricIds; + this._params = config.params; + this._region = config.region; + this._timespan = config.timespan; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache - computed: false, optional: true, required: false + private _cache?: string; + public get cache() { + return this.getStringAttribute('cache'); + } + public set cache(value: string) { + this._cache = value; + } + public resetCache() { + this._cache = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacheInput() { + return this._cache; + } + + // field_ids - computed: false, optional: true, required: false + private _fieldIds?: string[]; + public get fieldIds() { + return this.getListAttribute('field_ids'); + } + public set fieldIds(value: string[]) { + this._fieldIds = value; + } + public resetFieldIds() { + this._fieldIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get fieldIdsInput() { + return this._fieldIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interactive_params - computed: false, optional: true, required: false + private _interactiveParams?: { [key: string]: string }[] | cdktf.IResolvable; + public get interactiveParams() { + return this.interpolationForAttribute('interactive_params'); + } + public set interactiveParams(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._interactiveParams = value; + } + public resetInteractiveParams() { + this._interactiveParams = undefined; + } + // Temporarily expose input value. Use with caution. + public get interactiveParamsInput() { + return this._interactiveParams; + } + + // metric_ids - computed: false, optional: false, required: true + private _metricIds?: string[]; + public get metricIds() { + return this.getListAttribute('metric_ids'); + } + public set metricIds(value: string[]) { + this._metricIds = value; + } + // Temporarily expose input value. Use with caution. + public get metricIdsInput() { + return this._metricIds; + } + + // metric_results - computed: true, optional: false, required: false + private _metricResults = new DataHuaweicloudSecmasterMetricResultsMetricResultsList(this, "metric_results", false); + public get metricResults() { + return this._metricResults; + } + + // params - computed: false, optional: true, required: false + private _params?: { [key: string]: string }[] | cdktf.IResolvable; + public get params() { + return this.interpolationForAttribute('params'); + } + public set params(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._params = value; + } + public resetParams() { + this._params = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timespan - computed: false, optional: true, required: false + private _timespan?: string; + public get timespan() { + return this.getStringAttribute('timespan'); + } + public set timespan(value: string) { + this._timespan = value; + } + public resetTimespan() { + this._timespan = undefined; + } + // Temporarily expose input value. Use with caution. + public get timespanInput() { + return this._timespan; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cache: cdktf.stringToTerraform(this._cache), + field_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._fieldIds), + id: cdktf.stringToTerraform(this._id), + interactive_params: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(this._interactiveParams), + metric_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._metricIds), + params: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(this._params), + region: cdktf.stringToTerraform(this._region), + timespan: cdktf.stringToTerraform(this._timespan), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cache: { + value: cdktf.stringToHclTerraform(this._cache), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._fieldIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interactive_params: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(this._interactiveParams), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + metric_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._metricIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + params: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(this._params), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timespan: { + value: cdktf.stringToHclTerraform(this._timespan), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/README.md new file mode 100644 index 00000000..196fd7db --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbook_action_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbook_action_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/index.ts new file mode 100644 index 00000000..07503ad9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-action-instances/index.ts @@ -0,0 +1,528 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybookActionInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances#id DataHuaweicloudSecmasterPlaybookActionInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances#playbook_instance_id DataHuaweicloudSecmasterPlaybookActionInstances#playbook_instance_id} + */ + readonly playbookInstanceId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances#region DataHuaweicloudSecmasterPlaybookActionInstances#region} + */ + readonly region?: string; + /** + * Specifies the workspace ID to which the playbook instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances#workspace_id DataHuaweicloudSecmasterPlaybookActionInstances#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesAction { +} + +export function dataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionToTerraform(struct?: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesAction | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesAction | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action_id - computed: true, optional: false, required: false + public get actionId() { + return this.getStringAttribute('action_id'); + } + + // action_type - computed: true, optional: false, required: false + public get actionType() { + return this.getStringAttribute('action_type'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // playbook_id - computed: true, optional: false, required: false + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + + // playbook_version_id - computed: true, optional: false, required: false + public get playbookVersionId() { + return this.getStringAttribute('playbook_version_id'); + } +} + +export class DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionOutputReference { + return new DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLog { +} + +export function dataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogToTerraform(struct?: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLog): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLog): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLog | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLog | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action_id - computed: true, optional: false, required: false + public get actionId() { + return this.getStringAttribute('action_id'); + } + + // action_name - computed: true, optional: false, required: false + public get actionName() { + return this.getStringAttribute('action_name'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } + + // input - computed: true, optional: false, required: false + public get input() { + return this.getStringAttribute('input'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // log_level - computed: true, optional: false, required: false + public get logLevel() { + return this.getStringAttribute('log_level'); + } + + // output - computed: true, optional: false, required: false + public get output() { + return this.getStringAttribute('output'); + } + + // parent_instance_id - computed: true, optional: false, required: false + public get parentInstanceId() { + return this.getStringAttribute('parent_instance_id'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogOutputReference { + return new DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookActionInstancesActionInstances { +} + +export function dataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesToTerraform(struct?: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookActionInstancesActionInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookActionInstancesActionInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + private _action = new DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesActionList(this, "action", false); + public get action() { + return this._action; + } + + // instance_log - computed: true, optional: false, required: false + private _instanceLog = new DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesInstanceLogList(this, "instance_log", false); + public get instanceLog() { + return this._instanceLog; + } +} + +export class DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesOutputReference { + return new DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances huaweicloud_secmaster_playbook_action_instances} +*/ +export class DataHuaweicloudSecmasterPlaybookActionInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_action_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybookActionInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybookActionInstances to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybookActionInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybookActionInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_action_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_action_instances huaweicloud_secmaster_playbook_action_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybookActionInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybookActionInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_action_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._playbookInstanceId = config.playbookInstanceId; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_instances - computed: true, optional: false, required: false + private _actionInstances = new DataHuaweicloudSecmasterPlaybookActionInstancesActionInstancesList(this, "action_instances", false); + public get actionInstances() { + return this._actionInstances; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // playbook_instance_id - computed: false, optional: false, required: true + private _playbookInstanceId?: string; + public get playbookInstanceId() { + return this.getStringAttribute('playbook_instance_id'); + } + public set playbookInstanceId(value: string) { + this._playbookInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get playbookInstanceIdInput() { + return this._playbookInstanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + playbook_instance_id: cdktf.stringToTerraform(this._playbookInstanceId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + playbook_instance_id: { + value: cdktf.stringToHclTerraform(this._playbookInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/README.md new file mode 100644 index 00000000..2428502d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbook_audit_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbook_audit_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/index.ts new file mode 100644 index 00000000..96527b43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-audit-logs/index.ts @@ -0,0 +1,704 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybookAuditLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the workflow ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#action_id DataHuaweicloudSecmasterPlaybookAuditLogs#action_id} + */ + readonly actionId?: string; + /** + * Specifies the workflow name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#action_name DataHuaweicloudSecmasterPlaybookAuditLogs#action_name} + */ + readonly actionName?: string; + /** + * Specifies the end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#end_time DataHuaweicloudSecmasterPlaybookAuditLogs#end_time} + */ + readonly endTime?: string; + /** + * Specifies the error message. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#error_msg DataHuaweicloudSecmasterPlaybookAuditLogs#error_msg} + */ + readonly errorMsg?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#id DataHuaweicloudSecmasterPlaybookAuditLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the input information. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#input DataHuaweicloudSecmasterPlaybookAuditLogs#input} + */ + readonly input?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#instance_id DataHuaweicloudSecmasterPlaybookAuditLogs#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the instance type. The value can be **AOP_WORKFLOW**, **SCRIPT**, or **PLAYBOOK**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#instance_type DataHuaweicloudSecmasterPlaybookAuditLogs#instance_type} + */ + readonly instanceType?: string; + /** + * Specifies the log level. The value can be **DEBUG**, **INFO**, **WARN** or **ERROR**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#log_level DataHuaweicloudSecmasterPlaybookAuditLogs#log_level} + */ + readonly logLevel?: string; + /** + * Specifies the output information. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#output DataHuaweicloudSecmasterPlaybookAuditLogs#output} + */ + readonly output?: string; + /** + * Specifies the instance ID of the parent node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#parent_instance_id DataHuaweicloudSecmasterPlaybookAuditLogs#parent_instance_id} + */ + readonly parentInstanceId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#region DataHuaweicloudSecmasterPlaybookAuditLogs#region} + */ + readonly region?: string; + /** + * Specifies the start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#start_time DataHuaweicloudSecmasterPlaybookAuditLogs#start_time} + */ + readonly startTime?: string; + /** + * Specifies the status. The value can be **RUNNING**, **FINISHED**, **FAILED**, **RETRYING**, or **TERMINATED**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#status DataHuaweicloudSecmasterPlaybookAuditLogs#status} + */ + readonly status?: string; + /** + * Specifies the triggering type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#trigger_type DataHuaweicloudSecmasterPlaybookAuditLogs#trigger_type} + */ + readonly triggerType?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#workspace_id DataHuaweicloudSecmasterPlaybookAuditLogs#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogs { +} + +export function dataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsToTerraform(struct?: DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action_id - computed: true, optional: false, required: false + public get actionId() { + return this.getStringAttribute('action_id'); + } + + // action_name - computed: true, optional: false, required: false + public get actionName() { + return this.getStringAttribute('action_name'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } + + // input - computed: true, optional: false, required: false + public get input() { + return this.getStringAttribute('input'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // log_level - computed: true, optional: false, required: false + public get logLevel() { + return this.getStringAttribute('log_level'); + } + + // output - computed: true, optional: false, required: false + public get output() { + return this.getStringAttribute('output'); + } + + // parent_instance_id - computed: true, optional: false, required: false + public get parentInstanceId() { + return this.getStringAttribute('parent_instance_id'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } +} + +export class DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsOutputReference { + return new DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs huaweicloud_secmaster_playbook_audit_logs} +*/ +export class DataHuaweicloudSecmasterPlaybookAuditLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_audit_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybookAuditLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybookAuditLogs to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybookAuditLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybookAuditLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_audit_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_audit_logs huaweicloud_secmaster_playbook_audit_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybookAuditLogsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybookAuditLogsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_audit_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionId = config.actionId; + this._actionName = config.actionName; + this._endTime = config.endTime; + this._errorMsg = config.errorMsg; + this._id = config.id; + this._input = config.input; + this._instanceId = config.instanceId; + this._instanceType = config.instanceType; + this._logLevel = config.logLevel; + this._output = config.output; + this._parentInstanceId = config.parentInstanceId; + this._region = config.region; + this._startTime = config.startTime; + this._status = config.status; + this._triggerType = config.triggerType; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_id - computed: false, optional: true, required: false + private _actionId?: string; + public get actionId() { + return this.getStringAttribute('action_id'); + } + public set actionId(value: string) { + this._actionId = value; + } + public resetActionId() { + this._actionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionIdInput() { + return this._actionId; + } + + // action_name - computed: false, optional: true, required: false + private _actionName?: string; + public get actionName() { + return this.getStringAttribute('action_name'); + } + public set actionName(value: string) { + this._actionName = value; + } + public resetActionName() { + this._actionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionNameInput() { + return this._actionName; + } + + // audit_logs - computed: true, optional: false, required: false + private _auditLogs = new DataHuaweicloudSecmasterPlaybookAuditLogsAuditLogsList(this, "audit_logs", false); + public get auditLogs() { + return this._auditLogs; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // error_msg - computed: false, optional: true, required: false + private _errorMsg?: string; + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } + public set errorMsg(value: string) { + this._errorMsg = value; + } + public resetErrorMsg() { + this._errorMsg = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorMsgInput() { + return this._errorMsg; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // input - computed: false, optional: true, required: false + private _input?: string; + public get input() { + return this.getStringAttribute('input'); + } + public set input(value: string) { + this._input = value; + } + public resetInput() { + this._input = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputInput() { + return this._input; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_type - computed: false, optional: true, required: false + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + public resetInstanceType() { + this._instanceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // log_level - computed: false, optional: true, required: false + private _logLevel?: string; + public get logLevel() { + return this.getStringAttribute('log_level'); + } + public set logLevel(value: string) { + this._logLevel = value; + } + public resetLogLevel() { + this._logLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get logLevelInput() { + return this._logLevel; + } + + // output - computed: false, optional: true, required: false + private _output?: string; + public get output() { + return this.getStringAttribute('output'); + } + public set output(value: string) { + this._output = value; + } + public resetOutput() { + this._output = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputInput() { + return this._output; + } + + // parent_instance_id - computed: false, optional: true, required: false + private _parentInstanceId?: string; + public get parentInstanceId() { + return this.getStringAttribute('parent_instance_id'); + } + public set parentInstanceId(value: string) { + this._parentInstanceId = value; + } + public resetParentInstanceId() { + this._parentInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentInstanceIdInput() { + return this._parentInstanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // trigger_type - computed: false, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_id: cdktf.stringToTerraform(this._actionId), + action_name: cdktf.stringToTerraform(this._actionName), + end_time: cdktf.stringToTerraform(this._endTime), + error_msg: cdktf.stringToTerraform(this._errorMsg), + id: cdktf.stringToTerraform(this._id), + input: cdktf.stringToTerraform(this._input), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_type: cdktf.stringToTerraform(this._instanceType), + log_level: cdktf.stringToTerraform(this._logLevel), + output: cdktf.stringToTerraform(this._output), + parent_instance_id: cdktf.stringToTerraform(this._parentInstanceId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + trigger_type: cdktf.stringToTerraform(this._triggerType), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_id: { + value: cdktf.stringToHclTerraform(this._actionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + action_name: { + value: cdktf.stringToHclTerraform(this._actionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + error_msg: { + value: cdktf.stringToHclTerraform(this._errorMsg), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input: { + value: cdktf.stringToHclTerraform(this._input), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(this._instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_level: { + value: cdktf.stringToHclTerraform(this._logLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + output: { + value: cdktf.stringToHclTerraform(this._output), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_instance_id: { + value: cdktf.stringToHclTerraform(this._parentInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(this._triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/README.md new file mode 100644 index 00000000..ddc45193 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbook_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbook_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/index.ts new file mode 100644 index 00000000..faffe816 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-instances/index.ts @@ -0,0 +1,757 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybookInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data class name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#data_class_name DataHuaweicloudSecmasterPlaybookInstances#data_class_name} + */ + readonly dataClassName?: string; + /** + * Specifies the data object name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#data_object_name DataHuaweicloudSecmasterPlaybookInstances#data_object_name} + */ + readonly dataObjectName?: string; + /** + * Specifies the search start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#from_date DataHuaweicloudSecmasterPlaybookInstances#from_date} + */ + readonly fromDate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#id DataHuaweicloudSecmasterPlaybookInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#region DataHuaweicloudSecmasterPlaybookInstances#region} + */ + readonly region?: string; + /** + * Specifies the playbook instance status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#status DataHuaweicloudSecmasterPlaybookInstances#status} + */ + readonly status?: string; + /** + * Specifies the search end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#to_date DataHuaweicloudSecmasterPlaybookInstances#to_date} + */ + readonly toDate?: string; + /** + * Specifies the triggering type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#trigger_type DataHuaweicloudSecmasterPlaybookInstances#trigger_type} + */ + readonly triggerType?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#workspace_id DataHuaweicloudSecmasterPlaybookInstances#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClass { +} + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassToTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClass): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClass): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClass | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClass | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassOutputReference { + return new DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObject { +} + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectToTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getStringAttribute('content'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectOutputReference { + return new DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybook { +} + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookToTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybook): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybook): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybook | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybook | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookOutputReference { + return new DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookInstancesInstances { +} + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesToTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookInstancesInstancesToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_class - computed: true, optional: false, required: false + private _dataClass = new DataHuaweicloudSecmasterPlaybookInstancesInstancesDataClassList(this, "data_class", false); + public get dataClass() { + return this._dataClass; + } + + // data_object - computed: true, optional: false, required: false + private _dataObject = new DataHuaweicloudSecmasterPlaybookInstancesInstancesDataObjectList(this, "data_object", false); + public get dataObject() { + return this._dataObject; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // playbook - computed: true, optional: false, required: false + private _playbook = new DataHuaweicloudSecmasterPlaybookInstancesInstancesPlaybookList(this, "playbook", false); + public get playbook() { + return this._playbook; + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSecmasterPlaybookInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookInstancesInstancesOutputReference { + return new DataHuaweicloudSecmasterPlaybookInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances huaweicloud_secmaster_playbook_instances} +*/ +export class DataHuaweicloudSecmasterPlaybookInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybookInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybookInstances to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybookInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybookInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_instances huaweicloud_secmaster_playbook_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybookInstancesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybookInstancesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataClassName = config.dataClassName; + this._dataObjectName = config.dataObjectName; + this._fromDate = config.fromDate; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._toDate = config.toDate; + this._triggerType = config.triggerType; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_class_name - computed: false, optional: true, required: false + private _dataClassName?: string; + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + public set dataClassName(value: string) { + this._dataClassName = value; + } + public resetDataClassName() { + this._dataClassName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataClassNameInput() { + return this._dataClassName; + } + + // data_object_name - computed: false, optional: true, required: false + private _dataObjectName?: string; + public get dataObjectName() { + return this.getStringAttribute('data_object_name'); + } + public set dataObjectName(value: string) { + this._dataObjectName = value; + } + public resetDataObjectName() { + this._dataObjectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataObjectNameInput() { + return this._dataObjectName; + } + + // from_date - computed: false, optional: true, required: false + private _fromDate?: string; + public get fromDate() { + return this.getStringAttribute('from_date'); + } + public set fromDate(value: string) { + this._fromDate = value; + } + public resetFromDate() { + this._fromDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fromDateInput() { + return this._fromDate; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudSecmasterPlaybookInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // to_date - computed: false, optional: true, required: false + private _toDate?: string; + public get toDate() { + return this.getStringAttribute('to_date'); + } + public set toDate(value: string) { + this._toDate = value; + } + public resetToDate() { + this._toDate = undefined; + } + // Temporarily expose input value. Use with caution. + public get toDateInput() { + return this._toDate; + } + + // trigger_type - computed: false, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_class_name: cdktf.stringToTerraform(this._dataClassName), + data_object_name: cdktf.stringToTerraform(this._dataObjectName), + from_date: cdktf.stringToTerraform(this._fromDate), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + to_date: cdktf.stringToTerraform(this._toDate), + trigger_type: cdktf.stringToTerraform(this._triggerType), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_class_name: { + value: cdktf.stringToHclTerraform(this._dataClassName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_object_name: { + value: cdktf.stringToHclTerraform(this._dataObjectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + from_date: { + value: cdktf.stringToHclTerraform(this._fromDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + to_date: { + value: cdktf.stringToHclTerraform(this._toDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(this._triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/README.md new file mode 100644 index 00000000..603d497c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbook_monitors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbook_monitors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/index.ts new file mode 100644 index 00000000..06e894bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-monitors/index.ts @@ -0,0 +1,584 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybookMonitorsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#end_time DataHuaweicloudSecmasterPlaybookMonitors#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#id DataHuaweicloudSecmasterPlaybookMonitors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#playbook_id DataHuaweicloudSecmasterPlaybookMonitors#playbook_id} + */ + readonly playbookId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#region DataHuaweicloudSecmasterPlaybookMonitors#region} + */ + readonly region?: string; + /** + * Specifies the start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#start_time DataHuaweicloudSecmasterPlaybookMonitors#start_time} + */ + readonly startTime: string; + /** + * Specifies the playbook version type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#version_query_type DataHuaweicloudSecmasterPlaybookMonitors#version_query_type} + */ + readonly versionQueryType: string; + /** + * Specifies the workspace ID to which the playbook belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#workspace_id DataHuaweicloudSecmasterPlaybookMonitors#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstance { +} + +export function dataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceToTerraform(struct?: DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstance | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstance | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // playbook_instance_id - computed: true, optional: false, required: false + public get playbookInstanceId() { + return this.getStringAttribute('playbook_instance_id'); + } + + // playbook_instance_name - computed: true, optional: false, required: false + public get playbookInstanceName() { + return this.getStringAttribute('playbook_instance_name'); + } + + // playbook_instance_run_time - computed: true, optional: false, required: false + public get playbookInstanceRunTime() { + return this.getNumberAttribute('playbook_instance_run_time'); + } +} + +export class DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceOutputReference { + return new DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstance { +} + +export function dataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceToTerraform(struct?: DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstance | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstance | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // playbook_instance_id - computed: true, optional: false, required: false + public get playbookInstanceId() { + return this.getStringAttribute('playbook_instance_id'); + } + + // playbook_instance_name - computed: true, optional: false, required: false + public get playbookInstanceName() { + return this.getStringAttribute('playbook_instance_name'); + } + + // playbook_instance_run_time - computed: true, optional: false, required: false + public get playbookInstanceRunTime() { + return this.getNumberAttribute('playbook_instance_run_time'); + } +} + +export class DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceOutputReference { + return new DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSecmasterPlaybookMonitorsData { +} + +export function dataHuaweicloudSecmasterPlaybookMonitorsDataToTerraform(struct?: DataHuaweicloudSecmasterPlaybookMonitorsData): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookMonitorsDataToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookMonitorsData): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookMonitorsDataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookMonitorsData | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookMonitorsData | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // average_run_time - computed: true, optional: false, required: false + public get averageRunTime() { + return this.getNumberAttribute('average_run_time'); + } + + // event_instance_run_num - computed: true, optional: false, required: false + public get eventInstanceRunNum() { + return this.getNumberAttribute('event_instance_run_num'); + } + + // fail_instance_num - computed: true, optional: false, required: false + public get failInstanceNum() { + return this.getNumberAttribute('fail_instance_num'); + } + + // max_run_time_instance - computed: true, optional: false, required: false + private _maxRunTimeInstance = new DataHuaweicloudSecmasterPlaybookMonitorsDataMaxRunTimeInstanceList(this, "max_run_time_instance", false); + public get maxRunTimeInstance() { + return this._maxRunTimeInstance; + } + + // min_run_time_instance - computed: true, optional: false, required: false + private _minRunTimeInstance = new DataHuaweicloudSecmasterPlaybookMonitorsDataMinRunTimeInstanceList(this, "min_run_time_instance", false); + public get minRunTimeInstance() { + return this._minRunTimeInstance; + } + + // running_instance_num - computed: true, optional: false, required: false + public get runningInstanceNum() { + return this.getNumberAttribute('running_instance_num'); + } + + // schedule_instance_run_num - computed: true, optional: false, required: false + public get scheduleInstanceRunNum() { + return this.getNumberAttribute('schedule_instance_run_num'); + } + + // success_instance_num - computed: true, optional: false, required: false + public get successInstanceNum() { + return this.getNumberAttribute('success_instance_num'); + } + + // terminate_instance_num - computed: true, optional: false, required: false + public get terminateInstanceNum() { + return this.getNumberAttribute('terminate_instance_num'); + } + + // total_instance_num - computed: true, optional: false, required: false + public get totalInstanceNum() { + return this.getNumberAttribute('total_instance_num'); + } + + // total_instance_run_num - computed: true, optional: false, required: false + public get totalInstanceRunNum() { + return this.getNumberAttribute('total_instance_run_num'); + } +} + +export class DataHuaweicloudSecmasterPlaybookMonitorsDataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookMonitorsDataOutputReference { + return new DataHuaweicloudSecmasterPlaybookMonitorsDataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors huaweicloud_secmaster_playbook_monitors} +*/ +export class DataHuaweicloudSecmasterPlaybookMonitors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_monitors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybookMonitors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybookMonitors to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybookMonitors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybookMonitors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_monitors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_monitors huaweicloud_secmaster_playbook_monitors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybookMonitorsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybookMonitorsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_monitors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endTime = config.endTime; + this._id = config.id; + this._playbookId = config.playbookId; + this._region = config.region; + this._startTime = config.startTime; + this._versionQueryType = config.versionQueryType; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data - computed: true, optional: false, required: false + private _data = new DataHuaweicloudSecmasterPlaybookMonitorsDataList(this, "data", false); + public get data() { + return this._data; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // playbook_id - computed: false, optional: false, required: true + private _playbookId?: string; + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + public set playbookId(value: string) { + this._playbookId = value; + } + // Temporarily expose input value. Use with caution. + public get playbookIdInput() { + return this._playbookId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // version_query_type - computed: false, optional: false, required: true + private _versionQueryType?: string; + public get versionQueryType() { + return this.getStringAttribute('version_query_type'); + } + public set versionQueryType(value: string) { + this._versionQueryType = value; + } + // Temporarily expose input value. Use with caution. + public get versionQueryTypeInput() { + return this._versionQueryType; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + playbook_id: cdktf.stringToTerraform(this._playbookId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + version_query_type: cdktf.stringToTerraform(this._versionQueryType), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + playbook_id: { + value: cdktf.stringToHclTerraform(this._playbookId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_query_type: { + value: cdktf.stringToHclTerraform(this._versionQueryType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/README.md new file mode 100644 index 00000000..fecb85db --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbook_statistics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbook_statistics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/index.ts new file mode 100644 index 00000000..1e0373f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-statistics/index.ts @@ -0,0 +1,264 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybookStatisticsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics#id DataHuaweicloudSecmasterPlaybookStatistics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics#region DataHuaweicloudSecmasterPlaybookStatistics#region} + */ + readonly region?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics#workspace_id DataHuaweicloudSecmasterPlaybookStatistics#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybookStatisticsData { +} + +export function dataHuaweicloudSecmasterPlaybookStatisticsDataToTerraform(struct?: DataHuaweicloudSecmasterPlaybookStatisticsData): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookStatisticsDataToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookStatisticsData): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookStatisticsDataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookStatisticsData | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookStatisticsData | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // disabled_num - computed: true, optional: false, required: false + public get disabledNum() { + return this.getNumberAttribute('disabled_num'); + } + + // enabled_num - computed: true, optional: false, required: false + public get enabledNum() { + return this.getNumberAttribute('enabled_num'); + } + + // unapproved_num - computed: true, optional: false, required: false + public get unapprovedNum() { + return this.getNumberAttribute('unapproved_num'); + } +} + +export class DataHuaweicloudSecmasterPlaybookStatisticsDataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookStatisticsDataOutputReference { + return new DataHuaweicloudSecmasterPlaybookStatisticsDataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics huaweicloud_secmaster_playbook_statistics} +*/ +export class DataHuaweicloudSecmasterPlaybookStatistics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_statistics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybookStatistics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybookStatistics to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybookStatistics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybookStatistics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_statistics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_statistics huaweicloud_secmaster_playbook_statistics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybookStatisticsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybookStatisticsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_statistics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data - computed: true, optional: false, required: false + private _data = new DataHuaweicloudSecmasterPlaybookStatisticsDataList(this, "data", false); + public get data() { + return this._data; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/README.md new file mode 100644 index 00000000..90ec5879 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbook_versions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbook_versions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/index.ts new file mode 100644 index 00000000..ddf0f2df --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbook-versions/index.ts @@ -0,0 +1,476 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybookVersionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether this version is activated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#enabled DataHuaweicloudSecmasterPlaybookVersions#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#id DataHuaweicloudSecmasterPlaybookVersions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#playbook_id DataHuaweicloudSecmasterPlaybookVersions#playbook_id} + */ + readonly playbookId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#region DataHuaweicloudSecmasterPlaybookVersions#region} + */ + readonly region?: string; + /** + * Specifies the playbook version status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#status DataHuaweicloudSecmasterPlaybookVersions#status} + */ + readonly status?: string; + /** + * Specifies the version type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#type DataHuaweicloudSecmasterPlaybookVersions#type} + */ + readonly type?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#workspace_id DataHuaweicloudSecmasterPlaybookVersions#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersions { +} + +export function dataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsToTerraform(struct?: DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action_strategy - computed: true, optional: false, required: false + public get actionStrategy() { + return this.getStringAttribute('action_strategy'); + } + + // approve_name - computed: true, optional: false, required: false + public get approveName() { + return this.getStringAttribute('approve_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator_id - computed: true, optional: false, required: false + public get creatorId() { + return this.getStringAttribute('creator_id'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // data_class_name - computed: true, optional: false, required: false + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + + // data_object_delete - computed: true, optional: false, required: false + public get dataObjectDelete() { + return this.getBooleanAttribute('data_object_delete'); + } + + // data_object_update - computed: true, optional: false, required: false + public get dataObjectUpdate() { + return this.getBooleanAttribute('data_object_update'); + } + + // dataobject_create - computed: true, optional: false, required: false + public get dataobjectCreate() { + return this.getBooleanAttribute('dataobject_create'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // modifier_id - computed: true, optional: false, required: false + public get modifierId() { + return this.getStringAttribute('modifier_id'); + } + + // playbook_id - computed: true, optional: false, required: false + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // rule_enabled - computed: true, optional: false, required: false + public get ruleEnabled() { + return this.getBooleanAttribute('rule_enabled'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsOutputReference { + return new DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions huaweicloud_secmaster_playbook_versions} +*/ +export class DataHuaweicloudSecmasterPlaybookVersions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_versions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybookVersions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybookVersions to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybookVersions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybookVersions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_versions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbook_versions huaweicloud_secmaster_playbook_versions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybookVersionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybookVersionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_versions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._id = config.id; + this._playbookId = config.playbookId; + this._region = config.region; + this._status = config.status; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // playbook_id - computed: false, optional: false, required: true + private _playbookId?: string; + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + public set playbookId(value: string) { + this._playbookId = value; + } + // Temporarily expose input value. Use with caution. + public get playbookIdInput() { + return this._playbookId; + } + + // playbook_versions - computed: true, optional: false, required: false + private _playbookVersions = new DataHuaweicloudSecmasterPlaybookVersionsPlaybookVersionsList(this, "playbook_versions", false); + public get playbookVersions() { + return this._playbookVersions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + playbook_id: cdktf.stringToTerraform(this._playbookId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + playbook_id: { + value: cdktf.stringToHclTerraform(this._playbookId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/README.md new file mode 100644 index 00000000..8bfa8a26 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_playbooks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_playbooks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/index.ts new file mode 100644 index 00000000..bfed2d85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-playbooks/index.ts @@ -0,0 +1,459 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterPlaybooksConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data class name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#data_class_name DataHuaweicloudSecmasterPlaybooks#data_class_name} + */ + readonly dataClassName?: string; + /** + * Specifies the playbook description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#description DataHuaweicloudSecmasterPlaybooks#description} + */ + readonly description?: string; + /** + * Specifies whether the playbook is enabled. The value can be **true** or **false**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#enabled DataHuaweicloudSecmasterPlaybooks#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#id DataHuaweicloudSecmasterPlaybooks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#name DataHuaweicloudSecmasterPlaybooks#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#region DataHuaweicloudSecmasterPlaybooks#region} + */ + readonly region?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#workspace_id DataHuaweicloudSecmasterPlaybooks#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterPlaybooksPlaybooks { +} + +export function dataHuaweicloudSecmasterPlaybooksPlaybooksToTerraform(struct?: DataHuaweicloudSecmasterPlaybooksPlaybooks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterPlaybooksPlaybooksToHclTerraform(struct?: DataHuaweicloudSecmasterPlaybooksPlaybooks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterPlaybooksPlaybooksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterPlaybooksPlaybooks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterPlaybooksPlaybooks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // approve_role - computed: true, optional: false, required: false + public get approveRole() { + return this.getStringAttribute('approve_role'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // data_class_name - computed: true, optional: false, required: false + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // edit_role - computed: true, optional: false, required: false + public get editRole() { + return this.getStringAttribute('edit_role'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // owner_id - computed: true, optional: false, required: false + public get ownerId() { + return this.getStringAttribute('owner_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // reject_version_id - computed: true, optional: false, required: false + public get rejectVersionId() { + return this.getStringAttribute('reject_version_id'); + } + + // unaudited_version_id - computed: true, optional: false, required: false + public get unauditedVersionId() { + return this.getStringAttribute('unaudited_version_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_role - computed: true, optional: false, required: false + public get userRole() { + return this.getStringAttribute('user_role'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudSecmasterPlaybooksPlaybooksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterPlaybooksPlaybooksOutputReference { + return new DataHuaweicloudSecmasterPlaybooksPlaybooksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks huaweicloud_secmaster_playbooks} +*/ +export class DataHuaweicloudSecmasterPlaybooks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbooks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterPlaybooks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterPlaybooks to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterPlaybooks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterPlaybooks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbooks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_playbooks huaweicloud_secmaster_playbooks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterPlaybooksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterPlaybooksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbooks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataClassName = config.dataClassName; + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_class_name - computed: false, optional: true, required: false + private _dataClassName?: string; + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + public set dataClassName(value: string) { + this._dataClassName = value; + } + public resetDataClassName() { + this._dataClassName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataClassNameInput() { + return this._dataClassName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // playbooks - computed: true, optional: false, required: false + private _playbooks = new DataHuaweicloudSecmasterPlaybooksPlaybooksList(this, "playbooks", false); + public get playbooks() { + return this._playbooks; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_class_name: cdktf.stringToTerraform(this._dataClassName), + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_class_name: { + value: cdktf.stringToHclTerraform(this._dataClassName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/README.md new file mode 100644 index 00000000..db190539 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_workflows` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_workflows`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/index.ts new file mode 100644 index 00000000..d456a0ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workflows/index.ts @@ -0,0 +1,529 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterWorkflowsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data class ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#data_class_id DataHuaweicloudSecmasterWorkflows#data_class_id} + */ + readonly dataClassId?: string; + /** + * Specifies the data class name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#data_class_name DataHuaweicloudSecmasterWorkflows#data_class_name} + */ + readonly dataClassName?: string; + /** + * Specifies the workflow description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#description DataHuaweicloudSecmasterWorkflows#description} + */ + readonly description?: string; + /** + * Specifies whether the version is enabled. The value can be **true** and **false**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#enabled DataHuaweicloudSecmasterWorkflows#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#id DataHuaweicloudSecmasterWorkflows#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the version is the latest. The value can be **true** and **false**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#last_version DataHuaweicloudSecmasterWorkflows#last_version} + */ + readonly lastVersion?: string; + /** + * Specifies the workflow name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#name DataHuaweicloudSecmasterWorkflows#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#region DataHuaweicloudSecmasterWorkflows#region} + */ + readonly region?: string; + /** + * Specifies the workflow type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#type DataHuaweicloudSecmasterWorkflows#type} + */ + readonly type?: string; + /** + * Specifies the workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#workspace_id DataHuaweicloudSecmasterWorkflows#workspace_id} + */ + readonly workspaceId: string; +} +export interface DataHuaweicloudSecmasterWorkflowsWorkflows { +} + +export function dataHuaweicloudSecmasterWorkflowsWorkflowsToTerraform(struct?: DataHuaweicloudSecmasterWorkflowsWorkflows): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterWorkflowsWorkflowsToHclTerraform(struct?: DataHuaweicloudSecmasterWorkflowsWorkflows): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterWorkflowsWorkflowsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterWorkflowsWorkflows | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterWorkflowsWorkflows | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // approve_role - computed: true, optional: false, required: false + public get approveRole() { + return this.getStringAttribute('approve_role'); + } + + // current_approval_version_id - computed: true, optional: false, required: false + public get currentApprovalVersionId() { + return this.getStringAttribute('current_approval_version_id'); + } + + // current_rejected_version_id - computed: true, optional: false, required: false + public get currentRejectedVersionId() { + return this.getStringAttribute('current_rejected_version_id'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // edit_role - computed: true, optional: false, required: false + public get editRole() { + return this.getStringAttribute('edit_role'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // engine_type - computed: true, optional: false, required: false + public get engineType() { + return this.getStringAttribute('engine_type'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // use_role - computed: true, optional: false, required: false + public get useRole() { + return this.getStringAttribute('use_role'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // workspace_id - computed: true, optional: false, required: false + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } +} + +export class DataHuaweicloudSecmasterWorkflowsWorkflowsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterWorkflowsWorkflowsOutputReference { + return new DataHuaweicloudSecmasterWorkflowsWorkflowsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows huaweicloud_secmaster_workflows} +*/ +export class DataHuaweicloudSecmasterWorkflows extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_workflows"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterWorkflows resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterWorkflows to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterWorkflows that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterWorkflows to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_workflows", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workflows huaweicloud_secmaster_workflows} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterWorkflowsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterWorkflowsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_workflows', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataClassId = config.dataClassId; + this._dataClassName = config.dataClassName; + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._lastVersion = config.lastVersion; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_class_id - computed: false, optional: true, required: false + private _dataClassId?: string; + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + public set dataClassId(value: string) { + this._dataClassId = value; + } + public resetDataClassId() { + this._dataClassId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataClassIdInput() { + return this._dataClassId; + } + + // data_class_name - computed: false, optional: true, required: false + private _dataClassName?: string; + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + public set dataClassName(value: string) { + this._dataClassName = value; + } + public resetDataClassName() { + this._dataClassName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataClassNameInput() { + return this._dataClassName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // last_version - computed: false, optional: true, required: false + private _lastVersion?: string; + public get lastVersion() { + return this.getStringAttribute('last_version'); + } + public set lastVersion(value: string) { + this._lastVersion = value; + } + public resetLastVersion() { + this._lastVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get lastVersionInput() { + return this._lastVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workflows - computed: true, optional: false, required: false + private _workflows = new DataHuaweicloudSecmasterWorkflowsWorkflowsList(this, "workflows", false); + public get workflows() { + return this._workflows; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_class_id: cdktf.stringToTerraform(this._dataClassId), + data_class_name: cdktf.stringToTerraform(this._dataClassName), + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + last_version: cdktf.stringToTerraform(this._lastVersion), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_class_id: { + value: cdktf.stringToHclTerraform(this._dataClassId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_class_name: { + value: cdktf.stringToHclTerraform(this._dataClassName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_version: { + value: cdktf.stringToHclTerraform(this._lastVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/README.md new file mode 100644 index 00000000..5514654b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_secmaster_workspaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_secmaster_workspaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/index.ts new file mode 100644 index 00000000..bd5faf78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-secmaster-workspaces/index.ts @@ -0,0 +1,542 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSecmasterWorkspacesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the creation end time, for example, 2024-04-2T16:08:09Z+0800. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#create_time_end DataHuaweicloudSecmasterWorkspaces#create_time_end} + */ + readonly createTimeEnd?: string; + /** + * Specifies the creation start time, for example, 2024-04-26T16:08:09Z+0800. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#create_time_start DataHuaweicloudSecmasterWorkspaces#create_time_start} + */ + readonly createTimeStart?: string; + /** + * Specifies the workspace description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#description DataHuaweicloudSecmasterWorkspaces#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#enterprise_project_id DataHuaweicloudSecmasterWorkspaces#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#id DataHuaweicloudSecmasterWorkspaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the workspace IDs, which is separated by commas (,). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#ids DataHuaweicloudSecmasterWorkspaces#ids} + */ + readonly ids?: string; + /** + * Specifies whether to query the view. The value can be **true** or **false**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#is_view DataHuaweicloudSecmasterWorkspaces#is_view} + */ + readonly isView?: string; + /** + * Specifies the workspace name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#name DataHuaweicloudSecmasterWorkspaces#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#region DataHuaweicloudSecmasterWorkspaces#region} + */ + readonly region?: string; + /** + * Specifies the space ID bound to the view. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#view_bind_id DataHuaweicloudSecmasterWorkspaces#view_bind_id} + */ + readonly viewBindId?: string; + /** + * Specifies the space name bound to the view. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#view_bind_name DataHuaweicloudSecmasterWorkspaces#view_bind_name} + */ + readonly viewBindName?: string; +} +export interface DataHuaweicloudSecmasterWorkspacesWorkspaces { +} + +export function dataHuaweicloudSecmasterWorkspacesWorkspacesToTerraform(struct?: DataHuaweicloudSecmasterWorkspacesWorkspaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSecmasterWorkspacesWorkspacesToHclTerraform(struct?: DataHuaweicloudSecmasterWorkspacesWorkspaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSecmasterWorkspacesWorkspacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSecmasterWorkspacesWorkspaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSecmasterWorkspacesWorkspaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // enterprise_project_name - computed: true, optional: false, required: false + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_view - computed: true, optional: false, required: false + public get isView() { + return this.getBooleanAttribute('is_view'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // view_bind_id - computed: true, optional: false, required: false + public get viewBindId() { + return this.getStringAttribute('view_bind_id'); + } + + // view_bind_name - computed: true, optional: false, required: false + public get viewBindName() { + return this.getStringAttribute('view_bind_name'); + } +} + +export class DataHuaweicloudSecmasterWorkspacesWorkspacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSecmasterWorkspacesWorkspacesOutputReference { + return new DataHuaweicloudSecmasterWorkspacesWorkspacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces huaweicloud_secmaster_workspaces} +*/ +export class DataHuaweicloudSecmasterWorkspaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_workspaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSecmasterWorkspaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSecmasterWorkspaces to import + * @param importFromId The id of the existing DataHuaweicloudSecmasterWorkspaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSecmasterWorkspaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_workspaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/secmaster_workspaces huaweicloud_secmaster_workspaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSecmasterWorkspacesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSecmasterWorkspacesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_workspaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._createTimeEnd = config.createTimeEnd; + this._createTimeStart = config.createTimeStart; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ids = config.ids; + this._isView = config.isView; + this._name = config.name; + this._region = config.region; + this._viewBindId = config.viewBindId; + this._viewBindName = config.viewBindName; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time_end - computed: false, optional: true, required: false + private _createTimeEnd?: string; + public get createTimeEnd() { + return this.getStringAttribute('create_time_end'); + } + public set createTimeEnd(value: string) { + this._createTimeEnd = value; + } + public resetCreateTimeEnd() { + this._createTimeEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get createTimeEndInput() { + return this._createTimeEnd; + } + + // create_time_start - computed: false, optional: true, required: false + private _createTimeStart?: string; + public get createTimeStart() { + return this.getStringAttribute('create_time_start'); + } + public set createTimeStart(value: string) { + this._createTimeStart = value; + } + public resetCreateTimeStart() { + this._createTimeStart = undefined; + } + // Temporarily expose input value. Use with caution. + public get createTimeStartInput() { + return this._createTimeStart; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: false, optional: true, required: false + private _ids?: string; + public get ids() { + return this.getStringAttribute('ids'); + } + public set ids(value: string) { + this._ids = value; + } + public resetIds() { + this._ids = undefined; + } + // Temporarily expose input value. Use with caution. + public get idsInput() { + return this._ids; + } + + // is_view - computed: false, optional: true, required: false + private _isView?: string; + public get isView() { + return this.getStringAttribute('is_view'); + } + public set isView(value: string) { + this._isView = value; + } + public resetIsView() { + this._isView = undefined; + } + // Temporarily expose input value. Use with caution. + public get isViewInput() { + return this._isView; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // view_bind_id - computed: false, optional: true, required: false + private _viewBindId?: string; + public get viewBindId() { + return this.getStringAttribute('view_bind_id'); + } + public set viewBindId(value: string) { + this._viewBindId = value; + } + public resetViewBindId() { + this._viewBindId = undefined; + } + // Temporarily expose input value. Use with caution. + public get viewBindIdInput() { + return this._viewBindId; + } + + // view_bind_name - computed: false, optional: true, required: false + private _viewBindName?: string; + public get viewBindName() { + return this.getStringAttribute('view_bind_name'); + } + public set viewBindName(value: string) { + this._viewBindName = value; + } + public resetViewBindName() { + this._viewBindName = undefined; + } + // Temporarily expose input value. Use with caution. + public get viewBindNameInput() { + return this._viewBindName; + } + + // workspaces - computed: true, optional: false, required: false + private _workspaces = new DataHuaweicloudSecmasterWorkspacesWorkspacesList(this, "workspaces", false); + public get workspaces() { + return this._workspaces; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + create_time_end: cdktf.stringToTerraform(this._createTimeEnd), + create_time_start: cdktf.stringToTerraform(this._createTimeStart), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ids: cdktf.stringToTerraform(this._ids), + is_view: cdktf.stringToTerraform(this._isView), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + view_bind_id: cdktf.stringToTerraform(this._viewBindId), + view_bind_name: cdktf.stringToTerraform(this._viewBindName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + create_time_end: { + value: cdktf.stringToHclTerraform(this._createTimeEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + create_time_start: { + value: cdktf.stringToHclTerraform(this._createTimeStart), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ids: { + value: cdktf.stringToHclTerraform(this._ids), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_view: { + value: cdktf.stringToHclTerraform(this._isView), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + view_bind_id: { + value: cdktf.stringToHclTerraform(this._viewBindId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + view_bind_name: { + value: cdktf.stringToHclTerraform(this._viewBindName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/README.md new file mode 100644 index 00000000..d0b736b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_servicestage_component_runtimes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_servicestage_component_runtimes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/index.ts new file mode 100644 index 00000000..c344f583 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestage-component-runtimes/index.ts @@ -0,0 +1,291 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudServicestageComponentRuntimesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes#default_port DataHuaweicloudServicestageComponentRuntimes#default_port} + */ + readonly defaultPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes#id DataHuaweicloudServicestageComponentRuntimes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes#name DataHuaweicloudServicestageComponentRuntimes#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes#region DataHuaweicloudServicestageComponentRuntimes#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudServicestageComponentRuntimesRuntimes { +} + +export function dataHuaweicloudServicestageComponentRuntimesRuntimesToTerraform(struct?: DataHuaweicloudServicestageComponentRuntimesRuntimes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudServicestageComponentRuntimesRuntimesToHclTerraform(struct?: DataHuaweicloudServicestageComponentRuntimesRuntimes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudServicestageComponentRuntimesRuntimesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudServicestageComponentRuntimesRuntimes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudServicestageComponentRuntimesRuntimes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // default_port - computed: true, optional: false, required: false + public get defaultPort() { + return this.getNumberAttribute('default_port'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudServicestageComponentRuntimesRuntimesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudServicestageComponentRuntimesRuntimesOutputReference { + return new DataHuaweicloudServicestageComponentRuntimesRuntimesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes huaweicloud_servicestage_component_runtimes} +*/ +export class DataHuaweicloudServicestageComponentRuntimes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_component_runtimes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudServicestageComponentRuntimes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudServicestageComponentRuntimes to import + * @param importFromId The id of the existing DataHuaweicloudServicestageComponentRuntimes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudServicestageComponentRuntimes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_component_runtimes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestage_component_runtimes huaweicloud_servicestage_component_runtimes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudServicestageComponentRuntimesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudServicestageComponentRuntimesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_component_runtimes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._defaultPort = config.defaultPort; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // default_port - computed: false, optional: true, required: false + private _defaultPort?: number; + public get defaultPort() { + return this.getNumberAttribute('default_port'); + } + public set defaultPort(value: number) { + this._defaultPort = value; + } + public resetDefaultPort() { + this._defaultPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultPortInput() { + return this._defaultPort; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtimes - computed: true, optional: false, required: false + private _runtimes = new DataHuaweicloudServicestageComponentRuntimesRuntimesList(this, "runtimes", false); + public get runtimes() { + return this._runtimes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + default_port: cdktf.numberToTerraform(this._defaultPort), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + default_port: { + value: cdktf.numberToHclTerraform(this._defaultPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/README.md new file mode 100644 index 00000000..dd680488 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_servicestagev3_applications` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_servicestagev3_applications`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/index.ts new file mode 100644 index 00000000..ab854cc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-applications/index.ts @@ -0,0 +1,263 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudServicestagev3ApplicationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications#id DataHuaweicloudServicestagev3Applications#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the applications are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications#region DataHuaweicloudServicestagev3Applications#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudServicestagev3ApplicationsApplications { +} + +export function dataHuaweicloudServicestagev3ApplicationsApplicationsToTerraform(struct?: DataHuaweicloudServicestagev3ApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudServicestagev3ApplicationsApplicationsToHclTerraform(struct?: DataHuaweicloudServicestagev3ApplicationsApplications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudServicestagev3ApplicationsApplicationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudServicestagev3ApplicationsApplications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudServicestagev3ApplicationsApplications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudServicestagev3ApplicationsApplicationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudServicestagev3ApplicationsApplicationsOutputReference { + return new DataHuaweicloudServicestagev3ApplicationsApplicationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications huaweicloud_servicestagev3_applications} +*/ +export class DataHuaweicloudServicestagev3Applications extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_applications"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudServicestagev3Applications resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudServicestagev3Applications to import + * @param importFromId The id of the existing DataHuaweicloudServicestagev3Applications that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudServicestagev3Applications to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_applications", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_applications huaweicloud_servicestagev3_applications} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudServicestagev3ApplicationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudServicestagev3ApplicationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_applications', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // applications - computed: true, optional: false, required: false + private _applications = new DataHuaweicloudServicestagev3ApplicationsApplicationsList(this, "applications", false); + public get applications() { + return this._applications; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/README.md new file mode 100644 index 00000000..c3578f9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_servicestagev3_environments` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_servicestagev3_environments`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/index.ts new file mode 100644 index 00000000..e83c39bd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-environments/index.ts @@ -0,0 +1,368 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudServicestagev3EnvironmentsConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the environments belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments#enterprise_project_id DataHuaweicloudServicestagev3Environments#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The ID of the environment to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments#environment_id DataHuaweicloudServicestagev3Environments#environment_id} + */ + readonly environmentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments#id DataHuaweicloudServicestagev3Environments#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the environment to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments#name DataHuaweicloudServicestagev3Environments#name} + */ + readonly name?: string; + /** + * The region where the environments are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments#region DataHuaweicloudServicestagev3Environments#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudServicestagev3EnvironmentsEnvironments { +} + +export function dataHuaweicloudServicestagev3EnvironmentsEnvironmentsToTerraform(struct?: DataHuaweicloudServicestagev3EnvironmentsEnvironments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudServicestagev3EnvironmentsEnvironmentsToHclTerraform(struct?: DataHuaweicloudServicestagev3EnvironmentsEnvironments): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudServicestagev3EnvironmentsEnvironmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudServicestagev3EnvironmentsEnvironments | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudServicestagev3EnvironmentsEnvironments | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // deploy_mode - computed: true, optional: false, required: false + public get deployMode() { + return this.getStringAttribute('deploy_mode'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudServicestagev3EnvironmentsEnvironmentsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudServicestagev3EnvironmentsEnvironmentsOutputReference { + return new DataHuaweicloudServicestagev3EnvironmentsEnvironmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments huaweicloud_servicestagev3_environments} +*/ +export class DataHuaweicloudServicestagev3Environments extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_environments"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudServicestagev3Environments resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudServicestagev3Environments to import + * @param importFromId The id of the existing DataHuaweicloudServicestagev3Environments that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudServicestagev3Environments to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_environments", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_environments huaweicloud_servicestagev3_environments} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudServicestagev3EnvironmentsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudServicestagev3EnvironmentsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_environments', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._environmentId = config.environmentId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // environment_id - computed: false, optional: true, required: false + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + public resetEnvironmentId() { + this._environmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // environments - computed: true, optional: false, required: false + private _environments = new DataHuaweicloudServicestagev3EnvironmentsEnvironmentsList(this, "environments", false); + public get environments() { + return this._environments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/README.md new file mode 100644 index 00000000..132ad29d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_servicestagev3_runtime_stacks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_servicestagev3_runtime_stacks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/index.ts new file mode 100644 index 00000000..1795553c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-servicestagev3-runtime-stacks/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudServicestagev3RuntimeStacksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks#id DataHuaweicloudServicestagev3RuntimeStacks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the runtime stacks are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks#region DataHuaweicloudServicestagev3RuntimeStacks#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacks { +} + +export function dataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksToTerraform(struct?: DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksToHclTerraform(struct?: DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // deploy_mode - computed: true, optional: false, required: false + public get deployMode() { + return this.getStringAttribute('deploy_mode'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksOutputReference { + return new DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks huaweicloud_servicestagev3_runtime_stacks} +*/ +export class DataHuaweicloudServicestagev3RuntimeStacks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_runtime_stacks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudServicestagev3RuntimeStacks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudServicestagev3RuntimeStacks to import + * @param importFromId The id of the existing DataHuaweicloudServicestagev3RuntimeStacks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudServicestagev3RuntimeStacks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_runtime_stacks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/servicestagev3_runtime_stacks huaweicloud_servicestagev3_runtime_stacks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudServicestagev3RuntimeStacksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudServicestagev3RuntimeStacksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_runtime_stacks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime_stacks - computed: true, optional: false, required: false + private _runtimeStacks = new DataHuaweicloudServicestagev3RuntimeStacksRuntimeStacksList(this, "runtime_stacks", false); + public get runtimeStacks() { + return this._runtimeStacks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/README.md new file mode 100644 index 00000000..c7d5abcc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_file_system_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_file_system_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/index.ts new file mode 100644 index 00000000..bf8a8e13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system-v2/index.ts @@ -0,0 +1,276 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsFileSystemV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2#id DataHuaweicloudSfsFileSystemV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2#name DataHuaweicloudSfsFileSystemV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2#region DataHuaweicloudSfsFileSystemV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2#status DataHuaweicloudSfsFileSystemV2#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2 huaweicloud_sfs_file_system_v2} +*/ +export class DataHuaweicloudSfsFileSystemV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_file_system_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsFileSystemV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsFileSystemV2 to import + * @param importFromId The id of the existing DataHuaweicloudSfsFileSystemV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsFileSystemV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_file_system_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system_v2 huaweicloud_sfs_file_system_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsFileSystemV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsFileSystemV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_file_system_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_level - computed: true, optional: false, required: false + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + + // access_to - computed: true, optional: false, required: false + public get accessTo() { + return this.getStringAttribute('access_to'); + } + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_public - computed: true, optional: false, required: false + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // mount_id - computed: true, optional: false, required: false + public get mountId() { + return this.getStringAttribute('mount_id'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // preferred - computed: true, optional: false, required: false + public get preferred() { + return this.getBooleanAttribute('preferred'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_access_id - computed: true, optional: false, required: false + public get shareAccessId() { + return this.getStringAttribute('share_access_id'); + } + + // share_instance_id - computed: true, optional: false, required: false + public get shareInstanceId() { + return this.getStringAttribute('share_instance_id'); + } + + // share_proto - computed: true, optional: false, required: false + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/README.md new file mode 100644 index 00000000..7f273b28 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_file_system` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_file_system`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/index.ts new file mode 100644 index 00000000..05ae5b7e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-file-system/index.ts @@ -0,0 +1,276 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsFileSystemConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system#id DataHuaweicloudSfsFileSystem#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system#name DataHuaweicloudSfsFileSystem#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system#region DataHuaweicloudSfsFileSystem#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system#status DataHuaweicloudSfsFileSystem#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system huaweicloud_sfs_file_system} +*/ +export class DataHuaweicloudSfsFileSystem extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_file_system"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsFileSystem resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsFileSystem to import + * @param importFromId The id of the existing DataHuaweicloudSfsFileSystem that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsFileSystem to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_file_system", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_file_system huaweicloud_sfs_file_system} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsFileSystemConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsFileSystemConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_file_system', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_level - computed: true, optional: false, required: false + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + + // access_to - computed: true, optional: false, required: false + public get accessTo() { + return this.getStringAttribute('access_to'); + } + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_public - computed: true, optional: false, required: false + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // mount_id - computed: true, optional: false, required: false + public get mountId() { + return this.getStringAttribute('mount_id'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // preferred - computed: true, optional: false, required: false + public get preferred() { + return this.getBooleanAttribute('preferred'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_access_id - computed: true, optional: false, required: false + public get shareAccessId() { + return this.getStringAttribute('share_access_id'); + } + + // share_instance_id - computed: true, optional: false, required: false + public get shareInstanceId() { + return this.getStringAttribute('share_instance_id'); + } + + // share_proto - computed: true, optional: false, required: false + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/README.md new file mode 100644 index 00000000..c9ff59f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_turbo_data_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_turbo_data_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/index.ts new file mode 100644 index 00000000..860b97dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-data-tasks/index.ts @@ -0,0 +1,359 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsTurboDataTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks#id DataHuaweicloudSfsTurboDataTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks#region DataHuaweicloudSfsTurboDataTasks#region} + */ + readonly region?: string; + /** + * Specifies the ID of the SFS Turbo file system to which the data tasks belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks#share_id DataHuaweicloudSfsTurboDataTasks#share_id} + */ + readonly shareId: string; + /** + * Specifies the status of the data task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks#status DataHuaweicloudSfsTurboDataTasks#status} + */ + readonly status?: string; + /** + * Specifies the type of the data task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks#type DataHuaweicloudSfsTurboDataTasks#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudSfsTurboDataTasksTasks { +} + +export function dataHuaweicloudSfsTurboDataTasksTasksToTerraform(struct?: DataHuaweicloudSfsTurboDataTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboDataTasksTasksToHclTerraform(struct?: DataHuaweicloudSfsTurboDataTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboDataTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboDataTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboDataTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // dest_prefix - computed: true, optional: false, required: false + public get destPrefix() { + return this.getStringAttribute('dest_prefix'); + } + + // dest_target - computed: true, optional: false, required: false + public get destTarget() { + return this.getStringAttribute('dest_target'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // src_prefix - computed: true, optional: false, required: false + public get srcPrefix() { + return this.getStringAttribute('src_prefix'); + } + + // src_target - computed: true, optional: false, required: false + public get srcTarget() { + return this.getStringAttribute('src_target'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudSfsTurboDataTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboDataTasksTasksOutputReference { + return new DataHuaweicloudSfsTurboDataTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks huaweicloud_sfs_turbo_data_tasks} +*/ +export class DataHuaweicloudSfsTurboDataTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_data_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsTurboDataTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsTurboDataTasks to import + * @param importFromId The id of the existing DataHuaweicloudSfsTurboDataTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsTurboDataTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_data_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_data_tasks huaweicloud_sfs_turbo_data_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsTurboDataTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsTurboDataTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_data_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._shareId = config.shareId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudSfsTurboDataTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/README.md new file mode 100644 index 00000000..a859387c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_turbo_du_tasks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_turbo_du_tasks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/index.ts new file mode 100644 index 00000000..3f23c910 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-du-tasks/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsTurboDuTasksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks#id DataHuaweicloudSfsTurboDuTasks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks#region DataHuaweicloudSfsTurboDuTasks#region} + */ + readonly region?: string; + /** + * Specifies the ID of the SFS Turbo file system to which the DU tasks belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks#share_id DataHuaweicloudSfsTurboDuTasks#share_id} + */ + readonly shareId: string; +} +export interface DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCount { +} + +export function dataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountToTerraform(struct?: DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCount): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountToHclTerraform(struct?: DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCount): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCount | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCount | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // block - computed: true, optional: false, required: false + public get block() { + return this.getNumberAttribute('block'); + } + + // char - computed: true, optional: false, required: false + public get char() { + return this.getNumberAttribute('char'); + } + + // dir - computed: true, optional: false, required: false + public get dir() { + return this.getNumberAttribute('dir'); + } + + // pipe - computed: true, optional: false, required: false + public get pipe() { + return this.getNumberAttribute('pipe'); + } + + // regular - computed: true, optional: false, required: false + public get regular() { + return this.getNumberAttribute('regular'); + } + + // socket - computed: true, optional: false, required: false + public get socket() { + return this.getNumberAttribute('socket'); + } + + // symlink - computed: true, optional: false, required: false + public get symlink() { + return this.getNumberAttribute('symlink'); + } +} + +export class DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountOutputReference { + return new DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSfsTurboDuTasksTasksDirUsage { +} + +export function dataHuaweicloudSfsTurboDuTasksTasksDirUsageToTerraform(struct?: DataHuaweicloudSfsTurboDuTasksTasksDirUsage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboDuTasksTasksDirUsageToHclTerraform(struct?: DataHuaweicloudSfsTurboDuTasksTasksDirUsage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboDuTasksTasksDirUsageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboDuTasksTasksDirUsage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboDuTasksTasksDirUsage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_count - computed: true, optional: false, required: false + private _fileCount = new DataHuaweicloudSfsTurboDuTasksTasksDirUsageFileCountList(this, "file_count", false); + public get fileCount() { + return this._fileCount; + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // used_capacity - computed: true, optional: false, required: false + public get usedCapacity() { + return this.getNumberAttribute('used_capacity'); + } +} + +export class DataHuaweicloudSfsTurboDuTasksTasksDirUsageList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboDuTasksTasksDirUsageOutputReference { + return new DataHuaweicloudSfsTurboDuTasksTasksDirUsageOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSfsTurboDuTasksTasks { +} + +export function dataHuaweicloudSfsTurboDuTasksTasksToTerraform(struct?: DataHuaweicloudSfsTurboDuTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboDuTasksTasksToHclTerraform(struct?: DataHuaweicloudSfsTurboDuTasksTasks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboDuTasksTasksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboDuTasksTasks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboDuTasksTasks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // dir_usage - computed: true, optional: false, required: false + private _dirUsage = new DataHuaweicloudSfsTurboDuTasksTasksDirUsageList(this, "dir_usage", false); + public get dirUsage() { + return this._dirUsage; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudSfsTurboDuTasksTasksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboDuTasksTasksOutputReference { + return new DataHuaweicloudSfsTurboDuTasksTasksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks huaweicloud_sfs_turbo_du_tasks} +*/ +export class DataHuaweicloudSfsTurboDuTasks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_du_tasks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsTurboDuTasks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsTurboDuTasks to import + * @param importFromId The id of the existing DataHuaweicloudSfsTurboDuTasks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsTurboDuTasks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_du_tasks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_du_tasks huaweicloud_sfs_turbo_du_tasks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsTurboDuTasksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsTurboDuTasksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_du_tasks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._shareId = config.shareId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // tasks - computed: true, optional: false, required: false + private _tasks = new DataHuaweicloudSfsTurboDuTasksTasksList(this, "tasks", false); + public get tasks() { + return this._tasks; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/README.md new file mode 100644 index 00000000..4d876130 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_turbo_obs_targets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_turbo_obs_targets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/index.ts new file mode 100644 index 00000000..6140aabb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-obs-targets/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsTurboObsTargetsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the OBS bucket associated with the OBS target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#bucket DataHuaweicloudSfsTurboObsTargets#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#id DataHuaweicloudSfsTurboObsTargets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#region DataHuaweicloudSfsTurboObsTargets#region} + */ + readonly region?: string; + /** + * Specifies the ID of the SFS Turbo file system to which the OBS target belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#share_id DataHuaweicloudSfsTurboObsTargets#share_id} + */ + readonly shareId: string; + /** + * Specifies the status of the OBS target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#status DataHuaweicloudSfsTurboObsTargets#status} + */ + readonly status?: string; + /** + * Specifies the ID of the OBS target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#target_id DataHuaweicloudSfsTurboObsTargets#target_id} + */ + readonly targetId?: string; +} +export interface DataHuaweicloudSfsTurboObsTargetsTargetsObs { +} + +export function dataHuaweicloudSfsTurboObsTargetsTargetsObsToTerraform(struct?: DataHuaweicloudSfsTurboObsTargetsTargetsObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboObsTargetsTargetsObsToHclTerraform(struct?: DataHuaweicloudSfsTurboObsTargetsTargetsObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboObsTargetsTargetsObsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboObsTargetsTargetsObs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboObsTargetsTargetsObs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bucket - computed: true, optional: false, required: false + public get bucket() { + return this.getStringAttribute('bucket'); + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } +} + +export class DataHuaweicloudSfsTurboObsTargetsTargetsObsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboObsTargetsTargetsObsOutputReference { + return new DataHuaweicloudSfsTurboObsTargetsTargetsObsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSfsTurboObsTargetsTargets { +} + +export function dataHuaweicloudSfsTurboObsTargetsTargetsToTerraform(struct?: DataHuaweicloudSfsTurboObsTargetsTargets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboObsTargetsTargetsToHclTerraform(struct?: DataHuaweicloudSfsTurboObsTargetsTargets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboObsTargetsTargetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboObsTargetsTargets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboObsTargetsTargets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // file_system_path - computed: true, optional: false, required: false + public get fileSystemPath() { + return this.getStringAttribute('file_system_path'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // obs - computed: true, optional: false, required: false + private _obs = new DataHuaweicloudSfsTurboObsTargetsTargetsObsList(this, "obs", false); + public get obs() { + return this._obs; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DataHuaweicloudSfsTurboObsTargetsTargetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboObsTargetsTargetsOutputReference { + return new DataHuaweicloudSfsTurboObsTargetsTargetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets huaweicloud_sfs_turbo_obs_targets} +*/ +export class DataHuaweicloudSfsTurboObsTargets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_obs_targets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsTurboObsTargets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsTurboObsTargets to import + * @param importFromId The id of the existing DataHuaweicloudSfsTurboObsTargets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsTurboObsTargets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_obs_targets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_obs_targets huaweicloud_sfs_turbo_obs_targets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsTurboObsTargetsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsTurboObsTargetsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_obs_targets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._id = config.id; + this._region = config.region; + this._shareId = config.shareId; + this._status = config.status; + this._targetId = config.targetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket - computed: false, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // target_id - computed: false, optional: true, required: false + private _targetId?: string; + public get targetId() { + return this.getStringAttribute('target_id'); + } + public set targetId(value: string) { + this._targetId = value; + } + public resetTargetId() { + this._targetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetIdInput() { + return this._targetId; + } + + // targets - computed: true, optional: false, required: false + private _targets = new DataHuaweicloudSfsTurboObsTargetsTargetsList(this, "targets", false); + public get targets() { + return this._targets; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + status: cdktf.stringToTerraform(this._status), + target_id: cdktf.stringToTerraform(this._targetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_id: { + value: cdktf.stringToHclTerraform(this._targetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/README.md new file mode 100644 index 00000000..d34f4904 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_turbo_perm_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_turbo_perm_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/index.ts new file mode 100644 index 00000000..088f293c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbo-perm-rules/index.ts @@ -0,0 +1,269 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsTurboPermRulesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules#id DataHuaweicloudSfsTurboPermRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules#region DataHuaweicloudSfsTurboPermRules#region} + */ + readonly region?: string; + /** + * Specifies the ID of the SFS Turbo file system to which the permission rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules#share_id DataHuaweicloudSfsTurboPermRules#share_id} + */ + readonly shareId: string; +} +export interface DataHuaweicloudSfsTurboPermRulesRules { +} + +export function dataHuaweicloudSfsTurboPermRulesRulesToTerraform(struct?: DataHuaweicloudSfsTurboPermRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurboPermRulesRulesToHclTerraform(struct?: DataHuaweicloudSfsTurboPermRulesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurboPermRulesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurboPermRulesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurboPermRulesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_cidr - computed: true, optional: false, required: false + public get ipCidr() { + return this.getStringAttribute('ip_cidr'); + } + + // rw_type - computed: true, optional: false, required: false + public get rwType() { + return this.getStringAttribute('rw_type'); + } + + // user_type - computed: true, optional: false, required: false + public get userType() { + return this.getStringAttribute('user_type'); + } +} + +export class DataHuaweicloudSfsTurboPermRulesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurboPermRulesRulesOutputReference { + return new DataHuaweicloudSfsTurboPermRulesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules huaweicloud_sfs_turbo_perm_rules} +*/ +export class DataHuaweicloudSfsTurboPermRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_perm_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsTurboPermRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsTurboPermRules to import + * @param importFromId The id of the existing DataHuaweicloudSfsTurboPermRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsTurboPermRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_perm_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbo_perm_rules huaweicloud_sfs_turbo_perm_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsTurboPermRulesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsTurboPermRulesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_perm_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._shareId = config.shareId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudSfsTurboPermRulesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/README.md new file mode 100644 index 00000000..980a501b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sfs_turbos` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sfs_turbos`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/index.ts new file mode 100644 index 00000000..e9fde2f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sfs-turbos/index.ts @@ -0,0 +1,435 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSfsTurbosConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#enterprise_project_id DataHuaweicloudSfsTurbos#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#id DataHuaweicloudSfsTurbos#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#name DataHuaweicloudSfsTurbos#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#region DataHuaweicloudSfsTurbos#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#share_proto DataHuaweicloudSfsTurbos#share_proto} + */ + readonly shareProto?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#share_type DataHuaweicloudSfsTurbos#share_type} + */ + readonly shareType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#size DataHuaweicloudSfsTurbos#size} + */ + readonly size?: number; +} +export interface DataHuaweicloudSfsTurbosTurbos { +} + +export function dataHuaweicloudSfsTurbosTurbosToTerraform(struct?: DataHuaweicloudSfsTurbosTurbos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSfsTurbosTurbosToHclTerraform(struct?: DataHuaweicloudSfsTurbosTurbos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSfsTurbosTurbosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSfsTurbosTurbos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSfsTurbosTurbos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // available_capacity - computed: true, optional: false, required: false + public get availableCapacity() { + return this.getStringAttribute('available_capacity'); + } + + // crypt_key_id - computed: true, optional: false, required: false + public get cryptKeyId() { + return this.getStringAttribute('crypt_key_id'); + } + + // enhanced - computed: true, optional: false, required: false + public get enhanced() { + return this.getBooleanAttribute('enhanced'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // share_proto - computed: true, optional: false, required: false + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudSfsTurbosTurbosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSfsTurbosTurbosOutputReference { + return new DataHuaweicloudSfsTurbosTurbosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos huaweicloud_sfs_turbos} +*/ +export class DataHuaweicloudSfsTurbos extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbos"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSfsTurbos resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSfsTurbos to import + * @param importFromId The id of the existing DataHuaweicloudSfsTurbos that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSfsTurbos to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbos", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sfs_turbos huaweicloud_sfs_turbos} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSfsTurbosConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSfsTurbosConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbos', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._shareProto = config.shareProto; + this._shareType = config.shareType; + this._size = config.size; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_proto - computed: false, optional: true, required: false + private _shareProto?: string; + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + public set shareProto(value: string) { + this._shareProto = value; + } + public resetShareProto() { + this._shareProto = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareProtoInput() { + return this._shareProto; + } + + // share_type - computed: false, optional: true, required: false + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + public resetShareType() { + this._shareType = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // turbos - computed: true, optional: false, required: false + private _turbos = new DataHuaweicloudSfsTurbosTurbosList(this, "turbos", false); + public get turbos() { + return this._turbos; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + share_proto: cdktf.stringToTerraform(this._shareProto), + share_type: cdktf.stringToTerraform(this._shareType), + size: cdktf.numberToTerraform(this._size), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_proto: { + value: cdktf.stringToHclTerraform(this._shareProto), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(this._shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/README.md new file mode 100644 index 00000000..c33d69b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_smn_logtanks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_smn_logtanks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/index.ts new file mode 100644 index 00000000..ba94f119 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-logtanks/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSmnLogtanksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks#id DataHuaweicloudSmnLogtanks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks#region DataHuaweicloudSmnLogtanks#region} + */ + readonly region?: string; + /** + * Specifies the topic URN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks#topic_urn DataHuaweicloudSmnLogtanks#topic_urn} + */ + readonly topicUrn: string; +} +export interface DataHuaweicloudSmnLogtanksLogtanks { +} + +export function dataHuaweicloudSmnLogtanksLogtanksToTerraform(struct?: DataHuaweicloudSmnLogtanksLogtanks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnLogtanksLogtanksToHclTerraform(struct?: DataHuaweicloudSmnLogtanksLogtanks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnLogtanksLogtanksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnLogtanksLogtanks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnLogtanksLogtanks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSmnLogtanksLogtanksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnLogtanksLogtanksOutputReference { + return new DataHuaweicloudSmnLogtanksLogtanksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks huaweicloud_smn_logtanks} +*/ +export class DataHuaweicloudSmnLogtanks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_logtanks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSmnLogtanks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSmnLogtanks to import + * @param importFromId The id of the existing DataHuaweicloudSmnLogtanks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSmnLogtanks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_logtanks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_logtanks huaweicloud_smn_logtanks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSmnLogtanksConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSmnLogtanksConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_logtanks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._topicUrn = config.topicUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logtanks - computed: true, optional: false, required: false + private _logtanks = new DataHuaweicloudSmnLogtanksLogtanksList(this, "logtanks", false); + public get logtanks() { + return this._logtanks; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/README.md new file mode 100644 index 00000000..0b46e88e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_smn_message_templates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_smn_message_templates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/index.ts new file mode 100644 index 00000000..cf36ed54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-message-templates/index.ts @@ -0,0 +1,340 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSmnMessageTemplatesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates#id DataHuaweicloudSmnMessageTemplates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the message template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates#name DataHuaweicloudSmnMessageTemplates#name} + */ + readonly name?: string; + /** + * Specifies the protocol of the message template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates#protocol DataHuaweicloudSmnMessageTemplates#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates#region DataHuaweicloudSmnMessageTemplates#region} + */ + readonly region?: string; + /** + * Specifies the message template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates#template_id DataHuaweicloudSmnMessageTemplates#template_id} + */ + readonly templateId?: string; +} +export interface DataHuaweicloudSmnMessageTemplatesTemplates { +} + +export function dataHuaweicloudSmnMessageTemplatesTemplatesToTerraform(struct?: DataHuaweicloudSmnMessageTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnMessageTemplatesTemplatesToHclTerraform(struct?: DataHuaweicloudSmnMessageTemplatesTemplates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnMessageTemplatesTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnMessageTemplatesTemplates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnMessageTemplatesTemplates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // tag_names - computed: true, optional: false, required: false + public get tagNames() { + return this.getListAttribute('tag_names'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSmnMessageTemplatesTemplatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnMessageTemplatesTemplatesOutputReference { + return new DataHuaweicloudSmnMessageTemplatesTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates huaweicloud_smn_message_templates} +*/ +export class DataHuaweicloudSmnMessageTemplates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_message_templates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSmnMessageTemplates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSmnMessageTemplates to import + * @param importFromId The id of the existing DataHuaweicloudSmnMessageTemplates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSmnMessageTemplates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_message_templates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_message_templates huaweicloud_smn_message_templates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSmnMessageTemplatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSmnMessageTemplatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_message_templates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + this._templateId = config.templateId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // templates - computed: true, optional: false, required: false + private _templates = new DataHuaweicloudSmnMessageTemplatesTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/README.md new file mode 100644 index 00000000..27390f72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_smn_subscriptions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_smn_subscriptions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/index.ts new file mode 100644 index 00000000..0204e569 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-subscriptions/index.ts @@ -0,0 +1,433 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSmnSubscriptionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the subscription endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions#endpoint DataHuaweicloudSmnSubscriptions#endpoint} + */ + readonly endpoint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions#id DataHuaweicloudSmnSubscriptions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the protocol name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions#protocol DataHuaweicloudSmnSubscriptions#protocol} + */ + readonly protocol?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions#region DataHuaweicloudSmnSubscriptions#region} + */ + readonly region?: string; + /** + * Specifies the subscription status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions#status DataHuaweicloudSmnSubscriptions#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolices { +} + +export function dataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesToTerraform(struct?: DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesToHclTerraform(struct?: DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // string_equals - computed: true, optional: false, required: false + public get stringEquals() { + return this.getListAttribute('string_equals'); + } +} + +export class DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesOutputReference { + return new DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSmnSubscriptionsSubscriptions { +} + +export function dataHuaweicloudSmnSubscriptionsSubscriptionsToTerraform(struct?: DataHuaweicloudSmnSubscriptionsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnSubscriptionsSubscriptionsToHclTerraform(struct?: DataHuaweicloudSmnSubscriptionsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnSubscriptionsSubscriptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnSubscriptionsSubscriptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnSubscriptionsSubscriptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // filter_polices - computed: true, optional: false, required: false + private _filterPolices = new DataHuaweicloudSmnSubscriptionsSubscriptionsFilterPolicesList(this, "filter_polices", false); + public get filterPolices() { + return this._filterPolices; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remark - computed: true, optional: false, required: false + public get remark() { + return this.getStringAttribute('remark'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subscription_urn - computed: true, optional: false, required: false + public get subscriptionUrn() { + return this.getStringAttribute('subscription_urn'); + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudSmnSubscriptionsSubscriptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnSubscriptionsSubscriptionsOutputReference { + return new DataHuaweicloudSmnSubscriptionsSubscriptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions huaweicloud_smn_subscriptions} +*/ +export class DataHuaweicloudSmnSubscriptions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_subscriptions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSmnSubscriptions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSmnSubscriptions to import + * @param importFromId The id of the existing DataHuaweicloudSmnSubscriptions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSmnSubscriptions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_subscriptions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_subscriptions huaweicloud_smn_subscriptions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSmnSubscriptionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSmnSubscriptionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_subscriptions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpoint = config.endpoint; + this._id = config.id; + this._protocol = config.protocol; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint - computed: false, optional: true, required: false + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + public resetEndpoint() { + this._endpoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subscriptions - computed: true, optional: false, required: false + private _subscriptions = new DataHuaweicloudSmnSubscriptionsSubscriptionsList(this, "subscriptions", false); + public get subscriptions() { + return this._subscriptions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint: cdktf.stringToTerraform(this._endpoint), + id: cdktf.stringToTerraform(this._id), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint: { + value: cdktf.stringToHclTerraform(this._endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/README.md new file mode 100644 index 00000000..f98f8b17 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_smn_topic_subscriptions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_smn_topic_subscriptions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/index.ts new file mode 100644 index 00000000..68b49d19 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topic-subscriptions/index.ts @@ -0,0 +1,370 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSmnTopicSubscriptionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions#id DataHuaweicloudSmnTopicSubscriptions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions#region DataHuaweicloudSmnTopicSubscriptions#region} + */ + readonly region?: string; + /** + * Specifies the topic URN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions#topic_urn DataHuaweicloudSmnTopicSubscriptions#topic_urn} + */ + readonly topicUrn: string; +} +export interface DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolices { +} + +export function dataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesToTerraform(struct?: DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesToHclTerraform(struct?: DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // string_equals - computed: true, optional: false, required: false + public get stringEquals() { + return this.getListAttribute('string_equals'); + } +} + +export class DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesOutputReference { + return new DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSmnTopicSubscriptionsSubscriptions { +} + +export function dataHuaweicloudSmnTopicSubscriptionsSubscriptionsToTerraform(struct?: DataHuaweicloudSmnTopicSubscriptionsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnTopicSubscriptionsSubscriptionsToHclTerraform(struct?: DataHuaweicloudSmnTopicSubscriptionsSubscriptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnTopicSubscriptionsSubscriptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnTopicSubscriptionsSubscriptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnTopicSubscriptionsSubscriptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // endpoint - computed: true, optional: false, required: false + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + + // filter_polices - computed: true, optional: false, required: false + private _filterPolices = new DataHuaweicloudSmnTopicSubscriptionsSubscriptionsFilterPolicesList(this, "filter_polices", false); + public get filterPolices() { + return this._filterPolices; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remark - computed: true, optional: false, required: false + public get remark() { + return this.getStringAttribute('remark'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subscription_urn - computed: true, optional: false, required: false + public get subscriptionUrn() { + return this.getStringAttribute('subscription_urn'); + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudSmnTopicSubscriptionsSubscriptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnTopicSubscriptionsSubscriptionsOutputReference { + return new DataHuaweicloudSmnTopicSubscriptionsSubscriptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions huaweicloud_smn_topic_subscriptions} +*/ +export class DataHuaweicloudSmnTopicSubscriptions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_topic_subscriptions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSmnTopicSubscriptions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSmnTopicSubscriptions to import + * @param importFromId The id of the existing DataHuaweicloudSmnTopicSubscriptions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSmnTopicSubscriptions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_topic_subscriptions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topic_subscriptions huaweicloud_smn_topic_subscriptions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSmnTopicSubscriptionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSmnTopicSubscriptionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_topic_subscriptions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._topicUrn = config.topicUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subscriptions - computed: true, optional: false, required: false + private _subscriptions = new DataHuaweicloudSmnTopicSubscriptionsSubscriptionsList(this, "subscriptions", false); + public get subscriptions() { + return this._subscriptions; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/README.md new file mode 100644 index 00000000..6bdaca43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_smn_topics` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_smn_topics`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/index.ts new file mode 100644 index 00000000..33123b21 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-smn-topics/index.ts @@ -0,0 +1,368 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSmnTopicsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#display_name DataHuaweicloudSmnTopics#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#enterprise_project_id DataHuaweicloudSmnTopics#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#id DataHuaweicloudSmnTopics#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#name DataHuaweicloudSmnTopics#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#region DataHuaweicloudSmnTopics#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#topic_urn DataHuaweicloudSmnTopics#topic_urn} + */ + readonly topicUrn?: string; +} +export interface DataHuaweicloudSmnTopicsTopics { +} + +export function dataHuaweicloudSmnTopicsTopicsToTerraform(struct?: DataHuaweicloudSmnTopicsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmnTopicsTopicsToHclTerraform(struct?: DataHuaweicloudSmnTopicsTopics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmnTopicsTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmnTopicsTopics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmnTopicsTopics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // push_policy - computed: true, optional: false, required: false + public get pushPolicy() { + return this.getNumberAttribute('push_policy'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } +} + +export class DataHuaweicloudSmnTopicsTopicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmnTopicsTopicsOutputReference { + return new DataHuaweicloudSmnTopicsTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics huaweicloud_smn_topics} +*/ +export class DataHuaweicloudSmnTopics extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_topics"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSmnTopics resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSmnTopics to import + * @param importFromId The id of the existing DataHuaweicloudSmnTopics that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSmnTopics to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_topics", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/smn_topics huaweicloud_smn_topics} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSmnTopicsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSmnTopicsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_topics', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._topicUrn = config.topicUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // display_name - computed: false, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_urn - computed: false, optional: true, required: false + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + public resetTopicUrn() { + this._topicUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // topics - computed: true, optional: false, required: false + private _topics = new DataHuaweicloudSmnTopicsTopicsList(this, "topics", false); + public get topics() { + return this._topics; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/README.md new file mode 100644 index 00000000..6f6ac073 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_sms_source_servers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_sms_source_servers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/index.ts new file mode 100644 index 00000000..084810a6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-sms-source-servers/index.ts @@ -0,0 +1,422 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSmsSourceServersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers#id DataHuaweicloudSmsSourceServers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers#ip DataHuaweicloudSmsSourceServers#ip} + */ + readonly ip?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers#name DataHuaweicloudSmsSourceServers#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers#state DataHuaweicloudSmsSourceServers#state} + */ + readonly state?: string; +} +export interface DataHuaweicloudSmsSourceServersServersDisks { +} + +export function dataHuaweicloudSmsSourceServersServersDisksToTerraform(struct?: DataHuaweicloudSmsSourceServersServersDisks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmsSourceServersServersDisksToHclTerraform(struct?: DataHuaweicloudSmsSourceServersServersDisks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmsSourceServersServersDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmsSourceServersServersDisks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmsSourceServersServersDisks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // device_type - computed: true, optional: false, required: false + public get deviceType() { + return this.getStringAttribute('device_type'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudSmsSourceServersServersDisksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmsSourceServersServersDisksOutputReference { + return new DataHuaweicloudSmsSourceServersServersDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSmsSourceServersServers { +} + +export function dataHuaweicloudSmsSourceServersServersToTerraform(struct?: DataHuaweicloudSmsSourceServersServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSmsSourceServersServersToHclTerraform(struct?: DataHuaweicloudSmsSourceServersServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSmsSourceServersServersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSmsSourceServersServers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSmsSourceServersServers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // agent_version - computed: true, optional: false, required: false + public get agentVersion() { + return this.getStringAttribute('agent_version'); + } + + // connected - computed: true, optional: false, required: false + public get connected() { + return this.getBooleanAttribute('connected'); + } + + // disks - computed: true, optional: false, required: false + private _disks = new DataHuaweicloudSmsSourceServersServersDisksList(this, "disks", false); + public get disks() { + return this._disks; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // registered_time - computed: true, optional: false, required: false + public get registeredTime() { + return this.getStringAttribute('registered_time'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudSmsSourceServersServersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSmsSourceServersServersOutputReference { + return new DataHuaweicloudSmsSourceServersServersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers huaweicloud_sms_source_servers} +*/ +export class DataHuaweicloudSmsSourceServers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sms_source_servers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSmsSourceServers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSmsSourceServers to import + * @param importFromId The id of the existing DataHuaweicloudSmsSourceServers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSmsSourceServers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sms_source_servers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/sms_source_servers huaweicloud_sms_source_servers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSmsSourceServersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSmsSourceServersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sms_source_servers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ip = config.ip; + this._name = config.name; + this._state = config.state; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip - computed: false, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // servers - computed: true, optional: false, required: false + private _servers = new DataHuaweicloudSmsSourceServersServersList(this, "servers", false); + public get servers() { + return this._servers; + } + + // state - computed: false, optional: true, required: false + private _state?: string; + public get state() { + return this.getStringAttribute('state'); + } + public set state(value: string) { + this._state = value; + } + public resetState() { + this._state = undefined; + } + // Temporarily expose input value. Use with caution. + public get stateInput() { + return this._state; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip: cdktf.stringToTerraform(this._ip), + name: cdktf.stringToTerraform(this._name), + state: cdktf.stringToTerraform(this._state), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(this._ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + state: { + value: cdktf.stringToHclTerraform(this._state), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/README.md new file mode 100644 index 00000000..e34c0a2b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_image_retention_histories` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_image_retention_histories`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/index.ts new file mode 100644 index 00000000..0bef647e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-histories/index.ts @@ -0,0 +1,311 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrImageRetentionHistoriesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories#id DataHuaweicloudSwrImageRetentionHistories#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories#organization DataHuaweicloudSwrImageRetentionHistories#organization} + */ + readonly organization: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories#region DataHuaweicloudSwrImageRetentionHistories#region} + */ + readonly region?: string; + /** + * Specifies the image repository name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories#repository DataHuaweicloudSwrImageRetentionHistories#repository} + */ + readonly repository: string; +} +export interface DataHuaweicloudSwrImageRetentionHistoriesRecords { +} + +export function dataHuaweicloudSwrImageRetentionHistoriesRecordsToTerraform(struct?: DataHuaweicloudSwrImageRetentionHistoriesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageRetentionHistoriesRecordsToHclTerraform(struct?: DataHuaweicloudSwrImageRetentionHistoriesRecords): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageRetentionHistoriesRecordsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageRetentionHistoriesRecords | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageRetentionHistoriesRecords | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // organization - computed: true, optional: false, required: false + public get organization() { + return this.getStringAttribute('organization'); + } + + // repository - computed: true, optional: false, required: false + public get repository() { + return this.getStringAttribute('repository'); + } + + // retention_id - computed: true, optional: false, required: false + public get retentionId() { + return this.getNumberAttribute('retention_id'); + } + + // rule_type - computed: true, optional: false, required: false + public get ruleType() { + return this.getStringAttribute('rule_type'); + } + + // tag - computed: true, optional: false, required: false + public get tag() { + return this.getStringAttribute('tag'); + } +} + +export class DataHuaweicloudSwrImageRetentionHistoriesRecordsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageRetentionHistoriesRecordsOutputReference { + return new DataHuaweicloudSwrImageRetentionHistoriesRecordsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories huaweicloud_swr_image_retention_histories} +*/ +export class DataHuaweicloudSwrImageRetentionHistories extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_retention_histories"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrImageRetentionHistories resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrImageRetentionHistories to import + * @param importFromId The id of the existing DataHuaweicloudSwrImageRetentionHistories that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrImageRetentionHistories to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_retention_histories", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_histories huaweicloud_swr_image_retention_histories} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrImageRetentionHistoriesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrImageRetentionHistoriesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_retention_histories', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // records - computed: true, optional: false, required: false + private _records = new DataHuaweicloudSwrImageRetentionHistoriesRecordsList(this, "records", false); + public get records() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/README.md new file mode 100644 index 00000000..85e3bff4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_image_retention_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_image_retention_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/index.ts new file mode 100644 index 00000000..5827b85a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-retention-policies/index.ts @@ -0,0 +1,463 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrImageRetentionPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies#id DataHuaweicloudSwrImageRetentionPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the organization to which the image belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies#organization DataHuaweicloudSwrImageRetentionPolicies#organization} + */ + readonly organization: string; + /** + * Specifies the region in which to query the data source. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies#region DataHuaweicloudSwrImageRetentionPolicies#region} + */ + readonly region?: string; + /** + * Specifies the name of the repository to which the image belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies#repository DataHuaweicloudSwrImageRetentionPolicies#repository} + */ + readonly repository: string; +} +export interface DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectors { +} + +export function dataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsToTerraform(struct?: DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsToHclTerraform(struct?: DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // kind - computed: true, optional: false, required: false + public get kind() { + return this.getStringAttribute('kind'); + } + + // pattern - computed: true, optional: false, required: false + public get pattern() { + return this.getStringAttribute('pattern'); + } +} + +export class DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsOutputReference { + return new DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRules { +} + +export function dataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesToTerraform(struct?: DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesToHclTerraform(struct?: DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // params - computed: true, optional: false, required: false + public get params() { + return this.getStringAttribute('params'); + } + + // tag_selectors - computed: true, optional: false, required: false + private _tagSelectors = new DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesTagSelectorsList(this, "tag_selectors", false); + public get tagSelectors() { + return this._tagSelectors; + } + + // template - computed: true, optional: false, required: false + public get template() { + return this.getStringAttribute('template'); + } +} + +export class DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesOutputReference { + return new DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSwrImageRetentionPoliciesRetentionPolicies { +} + +export function dataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesToTerraform(struct?: DataHuaweicloudSwrImageRetentionPoliciesRetentionPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesToHclTerraform(struct?: DataHuaweicloudSwrImageRetentionPoliciesRetentionPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageRetentionPoliciesRetentionPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageRetentionPoliciesRetentionPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // algorithm - computed: true, optional: false, required: false + public get algorithm() { + return this.getStringAttribute('algorithm'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // scope - computed: true, optional: false, required: false + public get scope() { + return this.getStringAttribute('scope'); + } +} + +export class DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesOutputReference { + return new DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies huaweicloud_swr_image_retention_policies} +*/ +export class DataHuaweicloudSwrImageRetentionPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_retention_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrImageRetentionPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrImageRetentionPolicies to import + * @param importFromId The id of the existing DataHuaweicloudSwrImageRetentionPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrImageRetentionPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_retention_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_retention_policies huaweicloud_swr_image_retention_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrImageRetentionPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrImageRetentionPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_retention_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // retention_policies - computed: true, optional: false, required: false + private _retentionPolicies = new DataHuaweicloudSwrImageRetentionPoliciesRetentionPoliciesList(this, "retention_policies", false); + public get retentionPolicies() { + return this._retentionPolicies; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/README.md new file mode 100644 index 00000000..cafba145 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_image_tags` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_image_tags`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/index.ts new file mode 100644 index 00000000..2c4bce80 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-tags/index.ts @@ -0,0 +1,396 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrImageTagsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#digest DataHuaweicloudSwrImageTags#digest} + */ + readonly digest?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#id DataHuaweicloudSwrImageTags#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#name DataHuaweicloudSwrImageTags#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#organization DataHuaweicloudSwrImageTags#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#region DataHuaweicloudSwrImageTags#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#repository DataHuaweicloudSwrImageTags#repository} + */ + readonly repository: string; +} +export interface DataHuaweicloudSwrImageTagsImageTags { +} + +export function dataHuaweicloudSwrImageTagsImageTagsToTerraform(struct?: DataHuaweicloudSwrImageTagsImageTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageTagsImageTagsToHclTerraform(struct?: DataHuaweicloudSwrImageTagsImageTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageTagsImageTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageTagsImageTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageTagsImageTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // deleted_at - computed: true, optional: false, required: false + public get deletedAt() { + return this.getStringAttribute('deleted_at'); + } + + // digest - computed: true, optional: false, required: false + public get digest() { + return this.getStringAttribute('digest'); + } + + // docker_schema - computed: true, optional: false, required: false + public get dockerSchema() { + return this.getNumberAttribute('docker_schema'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // internal_path - computed: true, optional: false, required: false + public get internalPath() { + return this.getStringAttribute('internal_path'); + } + + // is_trusted - computed: true, optional: false, required: false + public get isTrusted() { + return this.getBooleanAttribute('is_trusted'); + } + + // manifest - computed: true, optional: false, required: false + public get manifest() { + return this.getStringAttribute('manifest'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // scanned - computed: true, optional: false, required: false + public get scanned() { + return this.getBooleanAttribute('scanned'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSwrImageTagsImageTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageTagsImageTagsOutputReference { + return new DataHuaweicloudSwrImageTagsImageTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags huaweicloud_swr_image_tags} +*/ +export class DataHuaweicloudSwrImageTags extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_tags"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrImageTags resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrImageTags to import + * @param importFromId The id of the existing DataHuaweicloudSwrImageTags that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrImageTags to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_tags", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_tags huaweicloud_swr_image_tags} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrImageTagsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrImageTagsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_tags', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._digest = config.digest; + this._id = config.id; + this._name = config.name; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + } + + // ========== + // ATTRIBUTES + // ========== + + // digest - computed: false, optional: true, required: false + private _digest?: string; + public get digest() { + return this.getStringAttribute('digest'); + } + public set digest(value: string) { + this._digest = value; + } + public resetDigest() { + this._digest = undefined; + } + // Temporarily expose input value. Use with caution. + public get digestInput() { + return this._digest; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_tags - computed: true, optional: false, required: false + private _imageTags = new DataHuaweicloudSwrImageTagsImageTagsList(this, "image_tags", false); + public get imageTags() { + return this._imageTags; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + digest: cdktf.stringToTerraform(this._digest), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + digest: { + value: cdktf.stringToHclTerraform(this._digest), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/README.md new file mode 100644 index 00000000..629e256c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_image_triggers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_image_triggers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/index.ts new file mode 100644 index 00000000..7f0dd710 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-image-triggers/index.ts @@ -0,0 +1,543 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrImageTriggersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#cluster_name DataHuaweicloudSwrImageTriggers#cluster_name} + */ + readonly clusterName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#condition_type DataHuaweicloudSwrImageTriggers#condition_type} + */ + readonly conditionType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#enabled DataHuaweicloudSwrImageTriggers#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#id DataHuaweicloudSwrImageTriggers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#name DataHuaweicloudSwrImageTriggers#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#organization DataHuaweicloudSwrImageTriggers#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#region DataHuaweicloudSwrImageTriggers#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#repository DataHuaweicloudSwrImageTriggers#repository} + */ + readonly repository: string; +} +export interface DataHuaweicloudSwrImageTriggersTriggersHistories { +} + +export function dataHuaweicloudSwrImageTriggersTriggersHistoriesToTerraform(struct?: DataHuaweicloudSwrImageTriggersTriggersHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageTriggersTriggersHistoriesToHclTerraform(struct?: DataHuaweicloudSwrImageTriggersTriggersHistories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageTriggersTriggersHistoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageTriggersTriggersHistories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageTriggersTriggersHistories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // detail - computed: true, optional: false, required: false + public get detail() { + return this.getStringAttribute('detail'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // tag - computed: true, optional: false, required: false + public get tag() { + return this.getStringAttribute('tag'); + } +} + +export class DataHuaweicloudSwrImageTriggersTriggersHistoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageTriggersTriggersHistoriesOutputReference { + return new DataHuaweicloudSwrImageTriggersTriggersHistoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudSwrImageTriggersTriggers { +} + +export function dataHuaweicloudSwrImageTriggersTriggersToTerraform(struct?: DataHuaweicloudSwrImageTriggersTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrImageTriggersTriggersToHclTerraform(struct?: DataHuaweicloudSwrImageTriggersTriggers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrImageTriggersTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrImageTriggersTriggers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrImageTriggersTriggers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // cluster_id - computed: true, optional: false, required: false + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + + // cluster_name - computed: true, optional: false, required: false + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + + // condition_type - computed: true, optional: false, required: false + public get conditionType() { + return this.getStringAttribute('condition_type'); + } + + // condition_value - computed: true, optional: false, required: false + public get conditionValue() { + return this.getStringAttribute('condition_value'); + } + + // container - computed: true, optional: false, required: false + public get container() { + return this.getStringAttribute('container'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getStringAttribute('enabled'); + } + + // histories - computed: true, optional: false, required: false + private _histories = new DataHuaweicloudSwrImageTriggersTriggersHistoriesList(this, "histories", false); + public get histories() { + return this._histories; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // namespace - computed: true, optional: false, required: false + public get namespace() { + return this.getStringAttribute('namespace'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // workload_name - computed: true, optional: false, required: false + public get workloadName() { + return this.getStringAttribute('workload_name'); + } + + // workload_type - computed: true, optional: false, required: false + public get workloadType() { + return this.getStringAttribute('workload_type'); + } +} + +export class DataHuaweicloudSwrImageTriggersTriggersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrImageTriggersTriggersOutputReference { + return new DataHuaweicloudSwrImageTriggersTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers huaweicloud_swr_image_triggers} +*/ +export class DataHuaweicloudSwrImageTriggers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_triggers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrImageTriggers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrImageTriggers to import + * @param importFromId The id of the existing DataHuaweicloudSwrImageTriggers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrImageTriggers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_triggers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_image_triggers huaweicloud_swr_image_triggers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrImageTriggersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrImageTriggersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_triggers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterName = config.clusterName; + this._conditionType = config.conditionType; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_name - computed: false, optional: true, required: false + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + public resetClusterName() { + this._clusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // condition_type - computed: false, optional: true, required: false + private _conditionType?: string; + public get conditionType() { + return this.getStringAttribute('condition_type'); + } + public set conditionType(value: string) { + this._conditionType = value; + } + public resetConditionType() { + this._conditionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionTypeInput() { + return this._conditionType; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // triggers - computed: true, optional: false, required: false + private _triggers = new DataHuaweicloudSwrImageTriggersTriggersList(this, "triggers", false); + public get triggers() { + return this._triggers; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_name: cdktf.stringToTerraform(this._clusterName), + condition_type: cdktf.stringToTerraform(this._conditionType), + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition_type: { + value: cdktf.stringToHclTerraform(this._conditionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/README.md new file mode 100644 index 00000000..ad9ba84d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_organizations` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_organizations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/index.ts new file mode 100644 index 00000000..e38325e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-organizations/index.ts @@ -0,0 +1,278 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrOrganizationsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations#id DataHuaweicloudSwrOrganizations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations#name DataHuaweicloudSwrOrganizations#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations#region DataHuaweicloudSwrOrganizations#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudSwrOrganizationsOrganizations { +} + +export function dataHuaweicloudSwrOrganizationsOrganizationsToTerraform(struct?: DataHuaweicloudSwrOrganizationsOrganizations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrOrganizationsOrganizationsToHclTerraform(struct?: DataHuaweicloudSwrOrganizationsOrganizations): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrOrganizationsOrganizationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrOrganizationsOrganizations | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrOrganizationsOrganizations | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_user_count - computed: true, optional: false, required: false + public get accessUserCount() { + return this.getNumberAttribute('access_user_count'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // permission - computed: true, optional: false, required: false + public get permission() { + return this.getStringAttribute('permission'); + } + + // repo_count - computed: true, optional: false, required: false + public get repoCount() { + return this.getNumberAttribute('repo_count'); + } +} + +export class DataHuaweicloudSwrOrganizationsOrganizationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrOrganizationsOrganizationsOutputReference { + return new DataHuaweicloudSwrOrganizationsOrganizationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations huaweicloud_swr_organizations} +*/ +export class DataHuaweicloudSwrOrganizations extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_organizations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrOrganizations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrOrganizations to import + * @param importFromId The id of the existing DataHuaweicloudSwrOrganizations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrOrganizations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_organizations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_organizations huaweicloud_swr_organizations} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrOrganizationsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrOrganizationsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_organizations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organizations - computed: true, optional: false, required: false + private _organizations = new DataHuaweicloudSwrOrganizationsOrganizationsList(this, "organizations", false); + public get organizations() { + return this._organizations; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/README.md new file mode 100644 index 00000000..c25d0b67 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_repositories` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_repositories`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/index.ts new file mode 100644 index 00000000..281833f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-repositories/index.ts @@ -0,0 +1,407 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrRepositoriesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#category DataHuaweicloudSwrRepositories#category} + */ + readonly category?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#id DataHuaweicloudSwrRepositories#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#is_public DataHuaweicloudSwrRepositories#is_public} + */ + readonly isPublic?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#name DataHuaweicloudSwrRepositories#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#organization DataHuaweicloudSwrRepositories#organization} + */ + readonly organization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#region DataHuaweicloudSwrRepositories#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudSwrRepositoriesRepositories { +} + +export function dataHuaweicloudSwrRepositoriesRepositoriesToTerraform(struct?: DataHuaweicloudSwrRepositoriesRepositories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrRepositoriesRepositoriesToHclTerraform(struct?: DataHuaweicloudSwrRepositoriesRepositories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrRepositoriesRepositoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrRepositoriesRepositories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrRepositoriesRepositories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // internal_path - computed: true, optional: false, required: false + public get internalPath() { + return this.getStringAttribute('internal_path'); + } + + // is_public - computed: true, optional: false, required: false + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // num_download - computed: true, optional: false, required: false + public get numDownload() { + return this.getNumberAttribute('num_download'); + } + + // num_images - computed: true, optional: false, required: false + public get numImages() { + return this.getNumberAttribute('num_images'); + } + + // organization - computed: true, optional: false, required: false + public get organization() { + return this.getStringAttribute('organization'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getBooleanAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return this.getListAttribute('tags'); + } + + // total_range - computed: true, optional: false, required: false + public get totalRange() { + return this.getNumberAttribute('total_range'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSwrRepositoriesRepositoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrRepositoriesRepositoriesOutputReference { + return new DataHuaweicloudSwrRepositoriesRepositoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories huaweicloud_swr_repositories} +*/ +export class DataHuaweicloudSwrRepositories extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_repositories"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrRepositories resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrRepositories to import + * @param importFromId The id of the existing DataHuaweicloudSwrRepositories that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrRepositories to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_repositories", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_repositories huaweicloud_swr_repositories} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrRepositoriesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrRepositoriesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_repositories', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._id = config.id; + this._isPublic = config.isPublic; + this._name = config.name; + this._organization = config.organization; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_public - computed: false, optional: true, required: false + private _isPublic?: string; + public get isPublic() { + return this.getStringAttribute('is_public'); + } + public set isPublic(value: string) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization - computed: false, optional: true, required: false + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + public resetOrganization() { + this._organization = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repositories - computed: true, optional: false, required: false + private _repositories = new DataHuaweicloudSwrRepositoriesRepositoriesList(this, "repositories", false); + public get repositories() { + return this._repositories; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + id: cdktf.stringToTerraform(this._id), + is_public: cdktf.stringToTerraform(this._isPublic), + name: cdktf.stringToTerraform(this._name), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_public: { + value: cdktf.stringToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/README.md new file mode 100644 index 00000000..1b79c5c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_shared_accounts` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_shared_accounts`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/index.ts new file mode 100644 index 00000000..ba569c73 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-accounts/index.ts @@ -0,0 +1,325 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrSharedAccountsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts#id DataHuaweicloudSwrSharedAccounts#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts#organization DataHuaweicloudSwrSharedAccounts#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts#region DataHuaweicloudSwrSharedAccounts#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts#repository DataHuaweicloudSwrSharedAccounts#repository} + */ + readonly repository: string; +} +export interface DataHuaweicloudSwrSharedAccountsSharedAccounts { +} + +export function dataHuaweicloudSwrSharedAccountsSharedAccountsToTerraform(struct?: DataHuaweicloudSwrSharedAccountsSharedAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrSharedAccountsSharedAccountsToHclTerraform(struct?: DataHuaweicloudSwrSharedAccountsSharedAccounts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrSharedAccountsSharedAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrSharedAccountsSharedAccounts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrSharedAccountsSharedAccounts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // creator_id - computed: true, optional: false, required: false + public get creatorId() { + return this.getStringAttribute('creator_id'); + } + + // deadline - computed: true, optional: false, required: false + public get deadline() { + return this.getStringAttribute('deadline'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // organization - computed: true, optional: false, required: false + public get organization() { + return this.getStringAttribute('organization'); + } + + // permit - computed: true, optional: false, required: false + public get permit() { + return this.getStringAttribute('permit'); + } + + // repository - computed: true, optional: false, required: false + public get repository() { + return this.getStringAttribute('repository'); + } + + // shared_account - computed: true, optional: false, required: false + public get sharedAccount() { + return this.getStringAttribute('shared_account'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getBooleanAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSwrSharedAccountsSharedAccountsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrSharedAccountsSharedAccountsOutputReference { + return new DataHuaweicloudSwrSharedAccountsSharedAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts huaweicloud_swr_shared_accounts} +*/ +export class DataHuaweicloudSwrSharedAccounts extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_shared_accounts"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrSharedAccounts resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrSharedAccounts to import + * @param importFromId The id of the existing DataHuaweicloudSwrSharedAccounts that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrSharedAccounts to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_shared_accounts", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_accounts huaweicloud_swr_shared_accounts} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrSharedAccountsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrSharedAccountsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_shared_accounts', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // shared_accounts - computed: true, optional: false, required: false + private _sharedAccounts = new DataHuaweicloudSwrSharedAccountsSharedAccountsList(this, "shared_accounts", false); + public get sharedAccounts() { + return this._sharedAccounts; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/README.md new file mode 100644 index 00000000..d8b7e0b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_swr_shared_repositories` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_swr_shared_repositories`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/index.ts new file mode 100644 index 00000000..6f244954 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-swr-shared-repositories/index.ts @@ -0,0 +1,404 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudSwrSharedRepositoriesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#center DataHuaweicloudSwrSharedRepositories#center} + */ + readonly center: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#domain_name DataHuaweicloudSwrSharedRepositories#domain_name} + */ + readonly domainName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#id DataHuaweicloudSwrSharedRepositories#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#name DataHuaweicloudSwrSharedRepositories#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#organization DataHuaweicloudSwrSharedRepositories#organization} + */ + readonly organization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#region DataHuaweicloudSwrSharedRepositories#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudSwrSharedRepositoriesRepositories { +} + +export function dataHuaweicloudSwrSharedRepositoriesRepositoriesToTerraform(struct?: DataHuaweicloudSwrSharedRepositoriesRepositories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudSwrSharedRepositoriesRepositoriesToHclTerraform(struct?: DataHuaweicloudSwrSharedRepositoriesRepositories): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudSwrSharedRepositoriesRepositoriesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudSwrSharedRepositoriesRepositories | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudSwrSharedRepositoriesRepositories | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // category - computed: true, optional: false, required: false + public get category() { + return this.getStringAttribute('category'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // internal_path - computed: true, optional: false, required: false + public get internalPath() { + return this.getStringAttribute('internal_path'); + } + + // is_public - computed: true, optional: false, required: false + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // num_download - computed: true, optional: false, required: false + public get numDownload() { + return this.getNumberAttribute('num_download'); + } + + // num_images - computed: true, optional: false, required: false + public get numImages() { + return this.getNumberAttribute('num_images'); + } + + // organization - computed: true, optional: false, required: false + public get organization() { + return this.getStringAttribute('organization'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getBooleanAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return this.getListAttribute('tags'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudSwrSharedRepositoriesRepositoriesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudSwrSharedRepositoriesRepositoriesOutputReference { + return new DataHuaweicloudSwrSharedRepositoriesRepositoriesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories huaweicloud_swr_shared_repositories} +*/ +export class DataHuaweicloudSwrSharedRepositories extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_shared_repositories"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudSwrSharedRepositories resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudSwrSharedRepositories to import + * @param importFromId The id of the existing DataHuaweicloudSwrSharedRepositories that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudSwrSharedRepositories to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_shared_repositories", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/swr_shared_repositories huaweicloud_swr_shared_repositories} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudSwrSharedRepositoriesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudSwrSharedRepositoriesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_shared_repositories', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._center = config.center; + this._domainName = config.domainName; + this._id = config.id; + this._name = config.name; + this._organization = config.organization; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // center - computed: false, optional: false, required: true + private _center?: string; + public get center() { + return this.getStringAttribute('center'); + } + public set center(value: string) { + this._center = value; + } + // Temporarily expose input value. Use with caution. + public get centerInput() { + return this._center; + } + + // domain_name - computed: false, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization - computed: false, optional: true, required: false + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + public resetOrganization() { + this._organization = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repositories - computed: true, optional: false, required: false + private _repositories = new DataHuaweicloudSwrSharedRepositoriesRepositoriesList(this, "repositories", false); + public get repositories() { + return this._repositories; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + center: cdktf.stringToTerraform(this._center), + domain_name: cdktf.stringToTerraform(this._domainName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + center: { + value: cdktf.stringToHclTerraform(this._center), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/README.md new file mode 100644 index 00000000..88a3a5e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_tms_resource_types` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_tms_resource_types`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/index.ts new file mode 100644 index 00000000..6271d8f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-tms-resource-types/index.ts @@ -0,0 +1,272 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudTmsResourceTypesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types#id DataHuaweicloudTmsResourceTypes#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region name used to filter resource types information. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types#region DataHuaweicloudTmsResourceTypes#region} + */ + readonly region?: string; + /** + * The service name used to filter resource types information. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types#service_name DataHuaweicloudTmsResourceTypes#service_name} + */ + readonly serviceName?: string; +} +export interface DataHuaweicloudTmsResourceTypesTypes { +} + +export function dataHuaweicloudTmsResourceTypesTypesToTerraform(struct?: DataHuaweicloudTmsResourceTypesTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudTmsResourceTypesTypesToHclTerraform(struct?: DataHuaweicloudTmsResourceTypesTypes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudTmsResourceTypesTypesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudTmsResourceTypesTypes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudTmsResourceTypesTypes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // is_global - computed: true, optional: false, required: false + public get isGlobal() { + return this.getBooleanAttribute('is_global'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } +} + +export class DataHuaweicloudTmsResourceTypesTypesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudTmsResourceTypesTypesOutputReference { + return new DataHuaweicloudTmsResourceTypesTypesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types huaweicloud_tms_resource_types} +*/ +export class DataHuaweicloudTmsResourceTypes extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_tms_resource_types"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudTmsResourceTypes resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudTmsResourceTypes to import + * @param importFromId The id of the existing DataHuaweicloudTmsResourceTypes that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudTmsResourceTypes to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_tms_resource_types", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/tms_resource_types huaweicloud_tms_resource_types} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudTmsResourceTypesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudTmsResourceTypesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_tms_resource_types', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._serviceName = config.serviceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_name - computed: false, optional: true, required: false + private _serviceName?: string; + public get serviceName() { + return this.getStringAttribute('service_name'); + } + public set serviceName(value: string) { + this._serviceName = value; + } + public resetServiceName() { + this._serviceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNameInput() { + return this._serviceName; + } + + // types - computed: true, optional: false, required: false + private _types = new DataHuaweicloudTmsResourceTypesTypesList(this, "types", false); + public get types() { + return this._types; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service_name: cdktf.stringToTerraform(this._serviceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_name: { + value: cdktf.stringToHclTerraform(this._serviceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/README.md new file mode 100644 index 00000000..1fac717c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vbs_backup_policy_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vbs_backup_policy_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/index.ts new file mode 100644 index 00000000..4e9573f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy-v2/index.ts @@ -0,0 +1,507 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVbsBackupPolicyV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#id DataHuaweicloudVbsBackupPolicyV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#name DataHuaweicloudVbsBackupPolicyV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#policy_resource_count DataHuaweicloudVbsBackupPolicyV2#policy_resource_count} + */ + readonly policyResourceCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#region DataHuaweicloudVbsBackupPolicyV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#status DataHuaweicloudVbsBackupPolicyV2#status} + */ + readonly status?: string; + /** + * filter_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#filter_tags DataHuaweicloudVbsBackupPolicyV2#filter_tags} + */ + readonly filterTags?: DataHuaweicloudVbsBackupPolicyV2FilterTags[] | cdktf.IResolvable; +} +export interface DataHuaweicloudVbsBackupPolicyV2Tags { +} + +export function dataHuaweicloudVbsBackupPolicyV2TagsToTerraform(struct?: DataHuaweicloudVbsBackupPolicyV2Tags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVbsBackupPolicyV2TagsToHclTerraform(struct?: DataHuaweicloudVbsBackupPolicyV2Tags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVbsBackupPolicyV2TagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVbsBackupPolicyV2Tags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVbsBackupPolicyV2Tags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudVbsBackupPolicyV2TagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVbsBackupPolicyV2TagsOutputReference { + return new DataHuaweicloudVbsBackupPolicyV2TagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVbsBackupPolicyV2FilterTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#key DataHuaweicloudVbsBackupPolicyV2#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#values DataHuaweicloudVbsBackupPolicyV2#values} + */ + readonly values: string[]; +} + +export function dataHuaweicloudVbsBackupPolicyV2FilterTagsToTerraform(struct?: DataHuaweicloudVbsBackupPolicyV2FilterTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function dataHuaweicloudVbsBackupPolicyV2FilterTagsToHclTerraform(struct?: DataHuaweicloudVbsBackupPolicyV2FilterTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudVbsBackupPolicyV2FilterTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVbsBackupPolicyV2FilterTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVbsBackupPolicyV2FilterTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._values = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._values = value.values; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return cdktf.Fn.tolist(this.getListAttribute('values')); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} + +export class DataHuaweicloudVbsBackupPolicyV2FilterTagsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudVbsBackupPolicyV2FilterTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVbsBackupPolicyV2FilterTagsOutputReference { + return new DataHuaweicloudVbsBackupPolicyV2FilterTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2 huaweicloud_vbs_backup_policy_v2} +*/ +export class DataHuaweicloudVbsBackupPolicyV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup_policy_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVbsBackupPolicyV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVbsBackupPolicyV2 to import + * @param importFromId The id of the existing DataHuaweicloudVbsBackupPolicyV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVbsBackupPolicyV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup_policy_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy_v2 huaweicloud_vbs_backup_policy_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVbsBackupPolicyV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVbsBackupPolicyV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup_policy_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._policyResourceCount = config.policyResourceCount; + this._region = config.region; + this._status = config.status; + this._filterTags.internalValue = config.filterTags; + } + + // ========== + // ATTRIBUTES + // ========== + + // frequency - computed: true, optional: false, required: false + public get frequency() { + return this.getNumberAttribute('frequency'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_resource_count - computed: true, optional: true, required: false + private _policyResourceCount?: number; + public get policyResourceCount() { + return this.getNumberAttribute('policy_resource_count'); + } + public set policyResourceCount(value: number) { + this._policyResourceCount = value; + } + public resetPolicyResourceCount() { + this._policyResourceCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyResourceCountInput() { + return this._policyResourceCount; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remain_first_backup - computed: true, optional: false, required: false + public get remainFirstBackup() { + return this.getStringAttribute('remain_first_backup'); + } + + // rentention_num - computed: true, optional: false, required: false + public get rententionNum() { + return this.getNumberAttribute('rentention_num'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: true, optional: false, required: false + private _tags = new DataHuaweicloudVbsBackupPolicyV2TagsList(this, "tags", true); + public get tags() { + return this._tags; + } + + // filter_tags - computed: false, optional: true, required: false + private _filterTags = new DataHuaweicloudVbsBackupPolicyV2FilterTagsList(this, "filter_tags", true); + public get filterTags() { + return this._filterTags; + } + public putFilterTags(value: DataHuaweicloudVbsBackupPolicyV2FilterTags[] | cdktf.IResolvable) { + this._filterTags.internalValue = value; + } + public resetFilterTags() { + this._filterTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterTagsInput() { + return this._filterTags.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_resource_count: cdktf.numberToTerraform(this._policyResourceCount), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + filter_tags: cdktf.listMapper(dataHuaweicloudVbsBackupPolicyV2FilterTagsToTerraform, true)(this._filterTags.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_resource_count: { + value: cdktf.numberToHclTerraform(this._policyResourceCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_tags: { + value: cdktf.listMapperHcl(dataHuaweicloudVbsBackupPolicyV2FilterTagsToHclTerraform, true)(this._filterTags.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataHuaweicloudVbsBackupPolicyV2FilterTagsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/README.md new file mode 100644 index 00000000..8d617a8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vbs_backup_policy` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vbs_backup_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/index.ts new file mode 100644 index 00000000..10e4d25f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-policy/index.ts @@ -0,0 +1,507 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVbsBackupPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#id DataHuaweicloudVbsBackupPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#name DataHuaweicloudVbsBackupPolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#policy_resource_count DataHuaweicloudVbsBackupPolicy#policy_resource_count} + */ + readonly policyResourceCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#region DataHuaweicloudVbsBackupPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#status DataHuaweicloudVbsBackupPolicy#status} + */ + readonly status?: string; + /** + * filter_tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#filter_tags DataHuaweicloudVbsBackupPolicy#filter_tags} + */ + readonly filterTags?: DataHuaweicloudVbsBackupPolicyFilterTags[] | cdktf.IResolvable; +} +export interface DataHuaweicloudVbsBackupPolicyTags { +} + +export function dataHuaweicloudVbsBackupPolicyTagsToTerraform(struct?: DataHuaweicloudVbsBackupPolicyTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVbsBackupPolicyTagsToHclTerraform(struct?: DataHuaweicloudVbsBackupPolicyTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVbsBackupPolicyTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVbsBackupPolicyTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVbsBackupPolicyTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudVbsBackupPolicyTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVbsBackupPolicyTagsOutputReference { + return new DataHuaweicloudVbsBackupPolicyTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVbsBackupPolicyFilterTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#key DataHuaweicloudVbsBackupPolicy#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#values DataHuaweicloudVbsBackupPolicy#values} + */ + readonly values: string[]; +} + +export function dataHuaweicloudVbsBackupPolicyFilterTagsToTerraform(struct?: DataHuaweicloudVbsBackupPolicyFilterTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function dataHuaweicloudVbsBackupPolicyFilterTagsToHclTerraform(struct?: DataHuaweicloudVbsBackupPolicyFilterTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataHuaweicloudVbsBackupPolicyFilterTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVbsBackupPolicyFilterTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVbsBackupPolicyFilterTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._values = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._values = value.values; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return cdktf.Fn.tolist(this.getListAttribute('values')); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} + +export class DataHuaweicloudVbsBackupPolicyFilterTagsList extends cdktf.ComplexList { + public internalValue? : DataHuaweicloudVbsBackupPolicyFilterTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVbsBackupPolicyFilterTagsOutputReference { + return new DataHuaweicloudVbsBackupPolicyFilterTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy huaweicloud_vbs_backup_policy} +*/ +export class DataHuaweicloudVbsBackupPolicy extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVbsBackupPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVbsBackupPolicy to import + * @param importFromId The id of the existing DataHuaweicloudVbsBackupPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVbsBackupPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_policy huaweicloud_vbs_backup_policy} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVbsBackupPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVbsBackupPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._policyResourceCount = config.policyResourceCount; + this._region = config.region; + this._status = config.status; + this._filterTags.internalValue = config.filterTags; + } + + // ========== + // ATTRIBUTES + // ========== + + // frequency - computed: true, optional: false, required: false + public get frequency() { + return this.getNumberAttribute('frequency'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_resource_count - computed: true, optional: true, required: false + private _policyResourceCount?: number; + public get policyResourceCount() { + return this.getNumberAttribute('policy_resource_count'); + } + public set policyResourceCount(value: number) { + this._policyResourceCount = value; + } + public resetPolicyResourceCount() { + this._policyResourceCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyResourceCountInput() { + return this._policyResourceCount; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remain_first_backup - computed: true, optional: false, required: false + public get remainFirstBackup() { + return this.getStringAttribute('remain_first_backup'); + } + + // rentention_num - computed: true, optional: false, required: false + public get rententionNum() { + return this.getNumberAttribute('rentention_num'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: true, optional: false, required: false + private _tags = new DataHuaweicloudVbsBackupPolicyTagsList(this, "tags", true); + public get tags() { + return this._tags; + } + + // filter_tags - computed: false, optional: true, required: false + private _filterTags = new DataHuaweicloudVbsBackupPolicyFilterTagsList(this, "filter_tags", true); + public get filterTags() { + return this._filterTags; + } + public putFilterTags(value: DataHuaweicloudVbsBackupPolicyFilterTags[] | cdktf.IResolvable) { + this._filterTags.internalValue = value; + } + public resetFilterTags() { + this._filterTags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterTagsInput() { + return this._filterTags.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_resource_count: cdktf.numberToTerraform(this._policyResourceCount), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + filter_tags: cdktf.listMapper(dataHuaweicloudVbsBackupPolicyFilterTagsToTerraform, true)(this._filterTags.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_resource_count: { + value: cdktf.numberToHclTerraform(this._policyResourceCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_tags: { + value: cdktf.listMapperHcl(dataHuaweicloudVbsBackupPolicyFilterTagsToHclTerraform, true)(this._filterTags.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataHuaweicloudVbsBackupPolicyFilterTagsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/README.md new file mode 100644 index 00000000..01e0311c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vbs_backup_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vbs_backup_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/index.ts new file mode 100644 index 00000000..541a8aea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup-v2/index.ts @@ -0,0 +1,281 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVbsBackupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#id DataHuaweicloudVbsBackupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#name DataHuaweicloudVbsBackupV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#region DataHuaweicloudVbsBackupV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#snapshot_id DataHuaweicloudVbsBackupV2#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#status DataHuaweicloudVbsBackupV2#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#volume_id DataHuaweicloudVbsBackupV2#volume_id} + */ + readonly volumeId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2 huaweicloud_vbs_backup_v2} +*/ +export class DataHuaweicloudVbsBackupV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVbsBackupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVbsBackupV2 to import + * @param importFromId The id of the existing DataHuaweicloudVbsBackupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVbsBackupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup_v2 huaweicloud_vbs_backup_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVbsBackupV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVbsBackupV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._snapshotId = config.snapshotId; + this._status = config.status; + this._volumeId = config.volumeId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // container - computed: true, optional: false, required: false + public get container() { + return this.getStringAttribute('container'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_metadata - computed: true, optional: false, required: false + public get serviceMetadata() { + return this.getStringAttribute('service_metadata'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // volume_id - computed: true, optional: true, required: false + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + public resetVolumeId() { + this._volumeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + status: cdktf.stringToTerraform(this._status), + volume_id: cdktf.stringToTerraform(this._volumeId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/README.md new file mode 100644 index 00000000..6375475b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vbs_backup` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vbs_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/index.ts new file mode 100644 index 00000000..485cc62a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vbs-backup/index.ts @@ -0,0 +1,281 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVbsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#id DataHuaweicloudVbsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#name DataHuaweicloudVbsBackup#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#region DataHuaweicloudVbsBackup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#snapshot_id DataHuaweicloudVbsBackup#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#status DataHuaweicloudVbsBackup#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#volume_id DataHuaweicloudVbsBackup#volume_id} + */ + readonly volumeId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup huaweicloud_vbs_backup} +*/ +export class DataHuaweicloudVbsBackup extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVbsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVbsBackup to import + * @param importFromId The id of the existing DataHuaweicloudVbsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVbsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vbs_backup huaweicloud_vbs_backup} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVbsBackupConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVbsBackupConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._snapshotId = config.snapshotId; + this._status = config.status; + this._volumeId = config.volumeId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // container - computed: true, optional: false, required: false + public get container() { + return this.getStringAttribute('container'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_metadata - computed: true, optional: false, required: false + public get serviceMetadata() { + return this.getStringAttribute('service_metadata'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // volume_id - computed: true, optional: true, required: false + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + public resetVolumeId() { + this._volumeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + status: cdktf.stringToTerraform(this._status), + volume_id: cdktf.stringToTerraform(this._volumeId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/README.md new file mode 100644 index 00000000..284ce2e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_address_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_address_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/index.ts new file mode 100644 index 00000000..1379a4af --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-address-groups/index.ts @@ -0,0 +1,483 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcAddressGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Provides supplementary information about an IP address group, + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#description DataHuaweicloudVpcAddressGroups#description} + */ + readonly description?: string; + /** + * Unique ID of an IP address group, which can be used to filter the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#group_id DataHuaweicloudVpcAddressGroups#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#id DataHuaweicloudVpcAddressGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Version of IP addresses in an IP address group, + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#ip_version DataHuaweicloudVpcAddressGroups#ip_version} + */ + readonly ipVersion?: number; + /** + * Name of an IP address group, which can be used to filter the IP address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#name DataHuaweicloudVpcAddressGroups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#region DataHuaweicloudVpcAddressGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSet { +} + +export function dataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetToTerraform(struct?: DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSet): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetToHclTerraform(struct?: DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSet): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSet | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSet | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // remarks - computed: true, optional: false, required: false + public get remarks() { + return this.getStringAttribute('remarks'); + } +} + +export class DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetOutputReference { + return new DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcAddressGroupsAddressGroups { +} + +export function dataHuaweicloudVpcAddressGroupsAddressGroupsToTerraform(struct?: DataHuaweicloudVpcAddressGroupsAddressGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcAddressGroupsAddressGroupsToHclTerraform(struct?: DataHuaweicloudVpcAddressGroupsAddressGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcAddressGroupsAddressGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcAddressGroupsAddressGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcAddressGroupsAddressGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // addresses - computed: true, optional: false, required: false + public get addresses() { + return cdktf.Fn.tolist(this.getListAttribute('addresses')); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_extra_set - computed: true, optional: false, required: false + private _ipExtraSet = new DataHuaweicloudVpcAddressGroupsAddressGroupsIpExtraSetList(this, "ip_extra_set", true); + public get ipExtraSet() { + return this._ipExtraSet; + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // max_capacity - computed: true, optional: false, required: false + public get maxCapacity() { + return this.getNumberAttribute('max_capacity'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_message - computed: true, optional: false, required: false + public get statusMessage() { + return this.getStringAttribute('status_message'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcAddressGroupsAddressGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcAddressGroupsAddressGroupsOutputReference { + return new DataHuaweicloudVpcAddressGroupsAddressGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups huaweicloud_vpc_address_groups} +*/ +export class DataHuaweicloudVpcAddressGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_address_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcAddressGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcAddressGroups to import + * @param importFromId The id of the existing DataHuaweicloudVpcAddressGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcAddressGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_address_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_address_groups huaweicloud_vpc_address_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcAddressGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcAddressGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_address_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._groupId = config.groupId; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // address_groups - computed: true, optional: false, required: false + private _addressGroups = new DataHuaweicloudVpcAddressGroupsAddressGroupsList(this, "address_groups", false); + public get addressGroups() { + return this._addressGroups; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/README.md new file mode 100644 index 00000000..4053f542 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_bandwidth` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_bandwidth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/index.ts new file mode 100644 index 00000000..d3eedecc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidth/index.ts @@ -0,0 +1,341 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcBandwidthConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth#enterprise_project_id DataHuaweicloudVpcBandwidth#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth#id DataHuaweicloudVpcBandwidth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth#name DataHuaweicloudVpcBandwidth#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth#region DataHuaweicloudVpcBandwidth#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth#size DataHuaweicloudVpcBandwidth#size} + */ + readonly size?: number; +} +export interface DataHuaweicloudVpcBandwidthPublicips { +} + +export function dataHuaweicloudVpcBandwidthPublicipsToTerraform(struct?: DataHuaweicloudVpcBandwidthPublicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcBandwidthPublicipsToHclTerraform(struct?: DataHuaweicloudVpcBandwidthPublicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcBandwidthPublicipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcBandwidthPublicips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcBandwidthPublicips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpcBandwidthPublicipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcBandwidthPublicipsOutputReference { + return new DataHuaweicloudVpcBandwidthPublicipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth huaweicloud_vpc_bandwidth} +*/ +export class DataHuaweicloudVpcBandwidth extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_bandwidth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcBandwidth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcBandwidth to import + * @param importFromId The id of the existing DataHuaweicloudVpcBandwidth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcBandwidth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_bandwidth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidth huaweicloud_vpc_bandwidth} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcBandwidthConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcBandwidthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_bandwidth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._size = config.size; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_type - computed: true, optional: false, required: false + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // publicips - computed: true, optional: false, required: false + private _publicips = new DataHuaweicloudVpcBandwidthPublicipsList(this, "publicips", false); + public get publicips() { + return this._publicips; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/README.md new file mode 100644 index 00000000..aa130420 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_bandwidths` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_bandwidths`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/index.ts new file mode 100644 index 00000000..452b4242 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-bandwidths/index.ts @@ -0,0 +1,506 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcBandwidthsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#bandwidth_id DataHuaweicloudVpcBandwidths#bandwidth_id} + */ + readonly bandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#charge_mode DataHuaweicloudVpcBandwidths#charge_mode} + */ + readonly chargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#enterprise_project_id DataHuaweicloudVpcBandwidths#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#id DataHuaweicloudVpcBandwidths#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#name DataHuaweicloudVpcBandwidths#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#region DataHuaweicloudVpcBandwidths#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#size DataHuaweicloudVpcBandwidths#size} + */ + readonly size?: number; +} +export interface DataHuaweicloudVpcBandwidthsBandwidthsPublicips { +} + +export function dataHuaweicloudVpcBandwidthsBandwidthsPublicipsToTerraform(struct?: DataHuaweicloudVpcBandwidthsBandwidthsPublicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcBandwidthsBandwidthsPublicipsToHclTerraform(struct?: DataHuaweicloudVpcBandwidthsBandwidthsPublicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcBandwidthsBandwidthsPublicipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcBandwidthsBandwidthsPublicips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcBandwidthsBandwidthsPublicips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpcBandwidthsBandwidthsPublicipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcBandwidthsBandwidthsPublicipsOutputReference { + return new DataHuaweicloudVpcBandwidthsBandwidthsPublicipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcBandwidthsBandwidths { +} + +export function dataHuaweicloudVpcBandwidthsBandwidthsToTerraform(struct?: DataHuaweicloudVpcBandwidthsBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcBandwidthsBandwidthsToHclTerraform(struct?: DataHuaweicloudVpcBandwidthsBandwidths): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcBandwidthsBandwidthsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcBandwidthsBandwidths | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcBandwidthsBandwidths | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_type - computed: true, optional: false, required: false + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // publicips - computed: true, optional: false, required: false + private _publicips = new DataHuaweicloudVpcBandwidthsBandwidthsPublicipsList(this, "publicips", false); + public get publicips() { + return this._publicips; + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcBandwidthsBandwidthsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcBandwidthsBandwidthsOutputReference { + return new DataHuaweicloudVpcBandwidthsBandwidthsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths huaweicloud_vpc_bandwidths} +*/ +export class DataHuaweicloudVpcBandwidths extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_bandwidths"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcBandwidths resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcBandwidths to import + * @param importFromId The id of the existing DataHuaweicloudVpcBandwidths that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcBandwidths to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_bandwidths", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_bandwidths huaweicloud_vpc_bandwidths} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcBandwidthsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcBandwidthsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_bandwidths', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthId = config.bandwidthId; + this._chargeMode = config.chargeMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._size = config.size; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_id - computed: false, optional: true, required: false + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + public resetBandwidthId() { + this._bandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // bandwidths - computed: true, optional: false, required: false + private _bandwidths = new DataHuaweicloudVpcBandwidthsBandwidthsList(this, "bandwidths", false); + public get bandwidths() { + return this._bandwidths; + } + + // charge_mode - computed: false, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/README.md new file mode 100644 index 00000000..b791b4db --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_eip` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_eip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/index.ts new file mode 100644 index 00000000..b5cd0f1d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eip/index.ts @@ -0,0 +1,283 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcEipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip#enterprise_project_id DataHuaweicloudVpcEip#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip#id DataHuaweicloudVpcEip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip#port_id DataHuaweicloudVpcEip#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip#public_ip DataHuaweicloudVpcEip#public_ip} + */ + readonly publicIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip#region DataHuaweicloudVpcEip#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip huaweicloud_vpc_eip} +*/ +export class DataHuaweicloudVpcEip extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_eip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcEip resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcEip to import + * @param importFromId The id of the existing DataHuaweicloudVpcEip that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcEip to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_eip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eip huaweicloud_vpc_eip} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcEipConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcEipConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_eip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._portId = config.portId; + this._publicIp = config.publicIp; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_share_type - computed: true, optional: false, required: false + public get bandwidthShareType() { + return this.getStringAttribute('bandwidth_share_type'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // ipv6_address - computed: true, optional: false, required: false + public get ipv6Address() { + return this.getStringAttribute('ipv6_address'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + port_id: cdktf.stringToTerraform(this._portId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/README.md new file mode 100644 index 00000000..6d5fbe13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_eips` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_eips`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/index.ts new file mode 100644 index 00000000..e650b05f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-eips/index.ts @@ -0,0 +1,497 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcEipsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#enterprise_project_id DataHuaweicloudVpcEips#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#id DataHuaweicloudVpcEips#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#ids DataHuaweicloudVpcEips#ids} + */ + readonly ids?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#ip_version DataHuaweicloudVpcEips#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#port_ids DataHuaweicloudVpcEips#port_ids} + */ + readonly portIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#private_ips DataHuaweicloudVpcEips#private_ips} + */ + readonly privateIps?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#public_ips DataHuaweicloudVpcEips#public_ips} + */ + readonly publicIps?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#region DataHuaweicloudVpcEips#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#tags DataHuaweicloudVpcEips#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudVpcEipsEips { +} + +export function dataHuaweicloudVpcEipsEipsToTerraform(struct?: DataHuaweicloudVpcEipsEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcEipsEipsToHclTerraform(struct?: DataHuaweicloudVpcEipsEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcEipsEipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcEipsEips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcEipsEips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_share_type - computed: true, optional: false, required: false + public get bandwidthShareType() { + return this.getStringAttribute('bandwidth_share_type'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // public_ipv6 - computed: true, optional: false, required: false + public get publicIpv6() { + return this.getStringAttribute('public_ipv6'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpcEipsEipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcEipsEipsOutputReference { + return new DataHuaweicloudVpcEipsEipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips huaweicloud_vpc_eips} +*/ +export class DataHuaweicloudVpcEips extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_eips"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcEips resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcEips to import + * @param importFromId The id of the existing DataHuaweicloudVpcEips that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcEips to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_eips", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_eips huaweicloud_vpc_eips} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcEipsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcEipsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_eips', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ids = config.ids; + this._ipVersion = config.ipVersion; + this._portIds = config.portIds; + this._privateIps = config.privateIps; + this._publicIps = config.publicIps; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // eips - computed: true, optional: false, required: false + private _eips = new DataHuaweicloudVpcEipsEipsList(this, "eips", false); + public get eips() { + return this._eips; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: false, optional: true, required: false + private _ids?: string[]; + public get ids() { + return this.getListAttribute('ids'); + } + public set ids(value: string[]) { + this._ids = value; + } + public resetIds() { + this._ids = undefined; + } + // Temporarily expose input value. Use with caution. + public get idsInput() { + return this._ids; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // port_ids - computed: false, optional: true, required: false + private _portIds?: string[]; + public get portIds() { + return this.getListAttribute('port_ids'); + } + public set portIds(value: string[]) { + this._portIds = value; + } + public resetPortIds() { + this._portIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdsInput() { + return this._portIds; + } + + // private_ips - computed: false, optional: true, required: false + private _privateIps?: string[]; + public get privateIps() { + return this.getListAttribute('private_ips'); + } + public set privateIps(value: string[]) { + this._privateIps = value; + } + public resetPrivateIps() { + this._privateIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpsInput() { + return this._privateIps; + } + + // public_ips - computed: false, optional: true, required: false + private _publicIps?: string[]; + public get publicIps() { + return this.getListAttribute('public_ips'); + } + public set publicIps(value: string[]) { + this._publicIps = value; + } + public resetPublicIps() { + this._publicIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpsInput() { + return this._publicIps; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ids), + ip_version: cdktf.numberToTerraform(this._ipVersion), + port_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._portIds), + private_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._privateIps), + public_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._publicIps), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ids), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._portIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + private_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._privateIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + public_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._publicIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/README.md new file mode 100644 index 00000000..c2238445 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_flow_logs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_flow_logs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/index.ts new file mode 100644 index 00000000..899a0322 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-flow-logs/index.ts @@ -0,0 +1,522 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcFlowLogsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the VPC flow log ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#flow_log_id DataHuaweicloudVpcFlowLogs#flow_log_id} + */ + readonly flowLogId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#id DataHuaweicloudVpcFlowLogs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the LTS log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#log_group_id DataHuaweicloudVpcFlowLogs#log_group_id} + */ + readonly logGroupId?: string; + /** + * Specifies the LTS log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#log_stream_id DataHuaweicloudVpcFlowLogs#log_stream_id} + */ + readonly logStreamId?: string; + /** + * Specifies the VPC flow log name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#name DataHuaweicloudVpcFlowLogs#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#region DataHuaweicloudVpcFlowLogs#region} + */ + readonly region?: string; + /** + * Specifies the resource ID for which that the logs to be collected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#resource_id DataHuaweicloudVpcFlowLogs#resource_id} + */ + readonly resourceId?: string; + /** + * Specifies the resource type for which that the logs to be collected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#resource_type DataHuaweicloudVpcFlowLogs#resource_type} + */ + readonly resourceType?: string; + /** + * Specifies the status of the flow log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#status DataHuaweicloudVpcFlowLogs#status} + */ + readonly status?: string; + /** + * Specifies the type of traffic to log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#traffic_type DataHuaweicloudVpcFlowLogs#traffic_type} + */ + readonly trafficType?: string; +} +export interface DataHuaweicloudVpcFlowLogsFlowLogs { +} + +export function dataHuaweicloudVpcFlowLogsFlowLogsToTerraform(struct?: DataHuaweicloudVpcFlowLogsFlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcFlowLogsFlowLogsToHclTerraform(struct?: DataHuaweicloudVpcFlowLogsFlowLogs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcFlowLogsFlowLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcFlowLogsFlowLogs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcFlowLogsFlowLogs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // log_group_id - computed: true, optional: false, required: false + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + + // log_stream_id - computed: true, optional: false, required: false + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_type - computed: true, optional: false, required: false + public get trafficType() { + return this.getStringAttribute('traffic_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcFlowLogsFlowLogsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcFlowLogsFlowLogsOutputReference { + return new DataHuaweicloudVpcFlowLogsFlowLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs huaweicloud_vpc_flow_logs} +*/ +export class DataHuaweicloudVpcFlowLogs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_flow_logs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcFlowLogs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcFlowLogs to import + * @param importFromId The id of the existing DataHuaweicloudVpcFlowLogs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcFlowLogs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_flow_logs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_flow_logs huaweicloud_vpc_flow_logs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcFlowLogsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcFlowLogsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_flow_logs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._flowLogId = config.flowLogId; + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._status = config.status; + this._trafficType = config.trafficType; + } + + // ========== + // ATTRIBUTES + // ========== + + // flow_log_id - computed: false, optional: true, required: false + private _flowLogId?: string; + public get flowLogId() { + return this.getStringAttribute('flow_log_id'); + } + public set flowLogId(value: string) { + this._flowLogId = value; + } + public resetFlowLogId() { + this._flowLogId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flowLogIdInput() { + return this._flowLogId; + } + + // flow_logs - computed: true, optional: false, required: false + private _flowLogs = new DataHuaweicloudVpcFlowLogsFlowLogsList(this, "flow_logs", false); + public get flowLogs() { + return this._flowLogs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: true, required: false + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + public resetLogGroupId() { + this._logGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: true, required: false + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + public resetLogStreamId() { + this._logStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // traffic_type - computed: false, optional: true, required: false + private _trafficType?: string; + public get trafficType() { + return this.getStringAttribute('traffic_type'); + } + public set trafficType(value: string) { + this._trafficType = value; + } + public resetTrafficType() { + this._trafficType = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficTypeInput() { + return this._trafficType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + flow_log_id: cdktf.stringToTerraform(this._flowLogId), + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + status: cdktf.stringToTerraform(this._status), + traffic_type: cdktf.stringToTerraform(this._trafficType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + flow_log_id: { + value: cdktf.stringToHclTerraform(this._flowLogId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_type: { + value: cdktf.stringToHclTerraform(this._trafficType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/README.md new file mode 100644 index 00000000..65912a92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_ids_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_ids_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/index.ts new file mode 100644 index 00000000..6214b14a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids-v1/index.ts @@ -0,0 +1,149 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcIdsV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1#id DataHuaweicloudVpcIdsV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1#region DataHuaweicloudVpcIdsV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1 huaweicloud_vpc_ids_v1} +*/ +export class DataHuaweicloudVpcIdsV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_ids_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcIdsV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcIdsV1 to import + * @param importFromId The id of the existing DataHuaweicloudVpcIdsV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcIdsV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_ids_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids_v1 huaweicloud_vpc_ids_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcIdsV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcIdsV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_ids_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/README.md new file mode 100644 index 00000000..5064b42a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_ids` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_ids`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/index.ts new file mode 100644 index 00000000..1155f93d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-ids/index.ts @@ -0,0 +1,149 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcIdsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids#id DataHuaweicloudVpcIds#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids#region DataHuaweicloudVpcIds#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids huaweicloud_vpc_ids} +*/ +export class DataHuaweicloudVpcIds extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_ids"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcIds resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcIds to import + * @param importFromId The id of the existing DataHuaweicloudVpcIds that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcIds to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_ids", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_ids huaweicloud_vpc_ids} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcIdsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcIdsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_ids', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/README.md new file mode 100644 index 00000000..cf3bd84a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_internet_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_internet_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/index.ts new file mode 100644 index 00000000..744a3d95 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-internet-gateways/index.ts @@ -0,0 +1,339 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcInternetGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways#id DataHuaweicloudVpcInternetGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways#igw_id DataHuaweicloudVpcInternetGateways#igw_id} + */ + readonly igwId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways#igw_name DataHuaweicloudVpcInternetGateways#igw_name} + */ + readonly igwName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways#region DataHuaweicloudVpcInternetGateways#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways#vpc_id DataHuaweicloudVpcInternetGateways#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudVpcInternetGatewaysVpcIgws { +} + +export function dataHuaweicloudVpcInternetGatewaysVpcIgwsToTerraform(struct?: DataHuaweicloudVpcInternetGatewaysVpcIgws): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcInternetGatewaysVpcIgwsToHclTerraform(struct?: DataHuaweicloudVpcInternetGatewaysVpcIgws): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcInternetGatewaysVpcIgwsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcInternetGatewaysVpcIgws | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcInternetGatewaysVpcIgws | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_ipv6 - computed: true, optional: false, required: false + public get enableIpv6() { + return this.getBooleanAttribute('enable_ipv6'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpcInternetGatewaysVpcIgwsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcInternetGatewaysVpcIgwsOutputReference { + return new DataHuaweicloudVpcInternetGatewaysVpcIgwsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways huaweicloud_vpc_internet_gateways} +*/ +export class DataHuaweicloudVpcInternetGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_internet_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcInternetGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcInternetGateways to import + * @param importFromId The id of the existing DataHuaweicloudVpcInternetGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcInternetGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_internet_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_internet_gateways huaweicloud_vpc_internet_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcInternetGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcInternetGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_internet_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._igwId = config.igwId; + this._igwName = config.igwName; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // igw_id - computed: false, optional: true, required: false + private _igwId?: string; + public get igwId() { + return this.getStringAttribute('igw_id'); + } + public set igwId(value: string) { + this._igwId = value; + } + public resetIgwId() { + this._igwId = undefined; + } + // Temporarily expose input value. Use with caution. + public get igwIdInput() { + return this._igwId; + } + + // igw_name - computed: false, optional: true, required: false + private _igwName?: string; + public get igwName() { + return this.getStringAttribute('igw_name'); + } + public set igwName(value: string) { + this._igwName = value; + } + public resetIgwName() { + this._igwName = undefined; + } + // Temporarily expose input value. Use with caution. + public get igwNameInput() { + return this._igwName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_igws - computed: true, optional: false, required: false + private _vpcIgws = new DataHuaweicloudVpcInternetGatewaysVpcIgwsList(this, "vpc_igws", false); + public get vpcIgws() { + return this._vpcIgws; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + igw_id: cdktf.stringToTerraform(this._igwId), + igw_name: cdktf.stringToTerraform(this._igwName), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + igw_id: { + value: cdktf.stringToHclTerraform(this._igwId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + igw_name: { + value: cdktf.stringToHclTerraform(this._igwName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/README.md new file mode 100644 index 00000000..d56a186c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_network_acls` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_network_acls`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/index.ts new file mode 100644 index 00000000..9d5fffff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-network-acls/index.ts @@ -0,0 +1,753 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcNetworkAclsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#enabled DataHuaweicloudVpcNetworkAcls#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#enterprise_project_id DataHuaweicloudVpcNetworkAcls#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#id DataHuaweicloudVpcNetworkAcls#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#name DataHuaweicloudVpcNetworkAcls#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#network_acl_id DataHuaweicloudVpcNetworkAcls#network_acl_id} + */ + readonly networkAclId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#region DataHuaweicloudVpcNetworkAcls#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#status DataHuaweicloudVpcNetworkAcls#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnets { +} + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsToTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsToHclTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsOutputReference { + return new DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRules { +} + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesToTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesToHclTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination_ip_address - computed: true, optional: false, required: false + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + + // destination_ip_address_group_id - computed: true, optional: false, required: false + public get destinationIpAddressGroupId() { + return this.getStringAttribute('destination_ip_address_group_id'); + } + + // destination_port - computed: true, optional: false, required: false + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // source_ip_address - computed: true, optional: false, required: false + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + + // source_ip_address_group_id - computed: true, optional: false, required: false + public get sourceIpAddressGroupId() { + return this.getStringAttribute('source_ip_address_group_id'); + } + + // source_port - computed: true, optional: false, required: false + public get sourcePort() { + return this.getStringAttribute('source_port'); + } +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesOutputReference { + return new DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRules { +} + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesToTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesToHclTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination_ip_address - computed: true, optional: false, required: false + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + + // destination_ip_address_group_id - computed: true, optional: false, required: false + public get destinationIpAddressGroupId() { + return this.getStringAttribute('destination_ip_address_group_id'); + } + + // destination_port - computed: true, optional: false, required: false + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // source_ip_address - computed: true, optional: false, required: false + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + + // source_ip_address_group_id - computed: true, optional: false, required: false + public get sourceIpAddressGroupId() { + return this.getStringAttribute('source_ip_address_group_id'); + } + + // source_port - computed: true, optional: false, required: false + public get sourcePort() { + return this.getStringAttribute('source_port'); + } +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesOutputReference { + return new DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcNetworkAclsNetworkAcls { +} + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsToTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAcls): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcNetworkAclsNetworkAclsToHclTerraform(struct?: DataHuaweicloudVpcNetworkAclsNetworkAcls): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcNetworkAclsNetworkAcls | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcNetworkAclsNetworkAcls | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // associated_subnets - computed: true, optional: false, required: false + private _associatedSubnets = new DataHuaweicloudVpcNetworkAclsNetworkAclsAssociatedSubnetsList(this, "associated_subnets", true); + public get associatedSubnets() { + return this._associatedSubnets; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // egress_rules - computed: true, optional: false, required: false + private _egressRules = new DataHuaweicloudVpcNetworkAclsNetworkAclsEgressRulesList(this, "egress_rules", false); + public get egressRules() { + return this._egressRules; + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ingress_rules - computed: true, optional: false, required: false + private _ingressRules = new DataHuaweicloudVpcNetworkAclsNetworkAclsIngressRulesList(this, "ingress_rules", false); + public get ingressRules() { + return this._ingressRules; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcNetworkAclsNetworkAclsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcNetworkAclsNetworkAclsOutputReference { + return new DataHuaweicloudVpcNetworkAclsNetworkAclsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls huaweicloud_vpc_network_acls} +*/ +export class DataHuaweicloudVpcNetworkAcls extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_network_acls"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcNetworkAcls resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcNetworkAcls to import + * @param importFromId The id of the existing DataHuaweicloudVpcNetworkAcls that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcNetworkAcls to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_network_acls", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_network_acls huaweicloud_vpc_network_acls} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcNetworkAclsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcNetworkAclsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_network_acls', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._networkAclId = config.networkAclId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_acl_id - computed: false, optional: true, required: false + private _networkAclId?: string; + public get networkAclId() { + return this.getStringAttribute('network_acl_id'); + } + public set networkAclId(value: string) { + this._networkAclId = value; + } + public resetNetworkAclId() { + this._networkAclId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkAclIdInput() { + return this._networkAclId; + } + + // network_acls - computed: true, optional: false, required: false + private _networkAcls = new DataHuaweicloudVpcNetworkAclsNetworkAclsList(this, "network_acls", false); + public get networkAcls() { + return this._networkAcls; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.stringToTerraform(this._enabled), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + network_acl_id: cdktf.stringToTerraform(this._networkAclId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_acl_id: { + value: cdktf.stringToHclTerraform(this._networkAclId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/README.md new file mode 100644 index 00000000..f953b366 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_peering_connection_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_peering_connection_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/index.ts new file mode 100644 index 00000000..2a070782 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection-v2/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcPeeringConnectionV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#id DataHuaweicloudVpcPeeringConnectionV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#name DataHuaweicloudVpcPeeringConnectionV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#peer_tenant_id DataHuaweicloudVpcPeeringConnectionV2#peer_tenant_id} + */ + readonly peerTenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#peer_vpc_id DataHuaweicloudVpcPeeringConnectionV2#peer_vpc_id} + */ + readonly peerVpcId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#region DataHuaweicloudVpcPeeringConnectionV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#status DataHuaweicloudVpcPeeringConnectionV2#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#vpc_id DataHuaweicloudVpcPeeringConnectionV2#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2 huaweicloud_vpc_peering_connection_v2} +*/ +export class DataHuaweicloudVpcPeeringConnectionV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_peering_connection_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcPeeringConnectionV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcPeeringConnectionV2 to import + * @param importFromId The id of the existing DataHuaweicloudVpcPeeringConnectionV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcPeeringConnectionV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_peering_connection_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection_v2 huaweicloud_vpc_peering_connection_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcPeeringConnectionV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcPeeringConnectionV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_peering_connection_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._peerTenantId = config.peerTenantId; + this._peerVpcId = config.peerVpcId; + this._region = config.region; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_tenant_id - computed: true, optional: true, required: false + private _peerTenantId?: string; + public get peerTenantId() { + return this.getStringAttribute('peer_tenant_id'); + } + public set peerTenantId(value: string) { + this._peerTenantId = value; + } + public resetPeerTenantId() { + this._peerTenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerTenantIdInput() { + return this._peerTenantId; + } + + // peer_vpc_id - computed: true, optional: true, required: false + private _peerVpcId?: string; + public get peerVpcId() { + return this.getStringAttribute('peer_vpc_id'); + } + public set peerVpcId(value: string) { + this._peerVpcId = value; + } + public resetPeerVpcId() { + this._peerVpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerVpcIdInput() { + return this._peerVpcId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + peer_tenant_id: cdktf.stringToTerraform(this._peerTenantId), + peer_vpc_id: cdktf.stringToTerraform(this._peerVpcId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_tenant_id: { + value: cdktf.stringToHclTerraform(this._peerTenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_vpc_id: { + value: cdktf.stringToHclTerraform(this._peerVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/README.md new file mode 100644 index 00000000..0d845205 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_peering_connection` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_peering_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/index.ts new file mode 100644 index 00000000..2e96600e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-peering-connection/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcPeeringConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#id DataHuaweicloudVpcPeeringConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#name DataHuaweicloudVpcPeeringConnection#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#peer_tenant_id DataHuaweicloudVpcPeeringConnection#peer_tenant_id} + */ + readonly peerTenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#peer_vpc_id DataHuaweicloudVpcPeeringConnection#peer_vpc_id} + */ + readonly peerVpcId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#region DataHuaweicloudVpcPeeringConnection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#status DataHuaweicloudVpcPeeringConnection#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#vpc_id DataHuaweicloudVpcPeeringConnection#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection huaweicloud_vpc_peering_connection} +*/ +export class DataHuaweicloudVpcPeeringConnection extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_peering_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcPeeringConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcPeeringConnection to import + * @param importFromId The id of the existing DataHuaweicloudVpcPeeringConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcPeeringConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_peering_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_peering_connection huaweicloud_vpc_peering_connection} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcPeeringConnectionConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcPeeringConnectionConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_peering_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._peerTenantId = config.peerTenantId; + this._peerVpcId = config.peerVpcId; + this._region = config.region; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_tenant_id - computed: true, optional: true, required: false + private _peerTenantId?: string; + public get peerTenantId() { + return this.getStringAttribute('peer_tenant_id'); + } + public set peerTenantId(value: string) { + this._peerTenantId = value; + } + public resetPeerTenantId() { + this._peerTenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerTenantIdInput() { + return this._peerTenantId; + } + + // peer_vpc_id - computed: true, optional: true, required: false + private _peerVpcId?: string; + public get peerVpcId() { + return this.getStringAttribute('peer_vpc_id'); + } + public set peerVpcId(value: string) { + this._peerVpcId = value; + } + public resetPeerVpcId() { + this._peerVpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerVpcIdInput() { + return this._peerVpcId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + peer_tenant_id: cdktf.stringToTerraform(this._peerTenantId), + peer_vpc_id: cdktf.stringToTerraform(this._peerVpcId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_tenant_id: { + value: cdktf.stringToHclTerraform(this._peerTenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_vpc_id: { + value: cdktf.stringToHclTerraform(this._peerVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/README.md new file mode 100644 index 00000000..6d2ad2dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_route_ids_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_route_ids_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/index.ts new file mode 100644 index 00000000..d2410207 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids-v2/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcRouteIdsV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2#id DataHuaweicloudVpcRouteIdsV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2#region DataHuaweicloudVpcRouteIdsV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2#vpc_id DataHuaweicloudVpcRouteIdsV2#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2 huaweicloud_vpc_route_ids_v2} +*/ +export class DataHuaweicloudVpcRouteIdsV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route_ids_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcRouteIdsV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcRouteIdsV2 to import + * @param importFromId The id of the existing DataHuaweicloudVpcRouteIdsV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcRouteIdsV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route_ids_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids_v2 huaweicloud_vpc_route_ids_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcRouteIdsV2Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcRouteIdsV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route_ids_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/README.md new file mode 100644 index 00000000..814936ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_route_ids` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_route_ids`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/index.ts new file mode 100644 index 00000000..8199c5c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-ids/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcRouteIdsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids#id DataHuaweicloudVpcRouteIds#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids#region DataHuaweicloudVpcRouteIds#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids#vpc_id DataHuaweicloudVpcRouteIds#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids huaweicloud_vpc_route_ids} +*/ +export class DataHuaweicloudVpcRouteIds extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route_ids"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcRouteIds resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcRouteIds to import + * @param importFromId The id of the existing DataHuaweicloudVpcRouteIds that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcRouteIds to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route_ids", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_ids huaweicloud_vpc_route_ids} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcRouteIdsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcRouteIdsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route_ids', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/README.md new file mode 100644 index 00000000..908c4d7f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_route_table` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_route_table`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/index.ts new file mode 100644 index 00000000..0c83e2fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-table/index.ts @@ -0,0 +1,308 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcRouteTableConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table#id DataHuaweicloudVpcRouteTable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table#name DataHuaweicloudVpcRouteTable#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table#region DataHuaweicloudVpcRouteTable#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table#vpc_id DataHuaweicloudVpcRouteTable#vpc_id} + */ + readonly vpcId: string; +} +export interface DataHuaweicloudVpcRouteTableRoute { +} + +export function dataHuaweicloudVpcRouteTableRouteToTerraform(struct?: DataHuaweicloudVpcRouteTableRoute): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcRouteTableRouteToHclTerraform(struct?: DataHuaweicloudVpcRouteTableRoute): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcRouteTableRouteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcRouteTableRoute | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcRouteTableRoute | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpcRouteTableRouteList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcRouteTableRouteOutputReference { + return new DataHuaweicloudVpcRouteTableRouteOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table huaweicloud_vpc_route_table} +*/ +export class DataHuaweicloudVpcRouteTable extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route_table"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcRouteTable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcRouteTable to import + * @param importFromId The id of the existing DataHuaweicloudVpcRouteTable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcRouteTable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route_table", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_table huaweicloud_vpc_route_table} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcRouteTableConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcRouteTableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route_table', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // default - computed: true, optional: false, required: false + public get default() { + return this.getBooleanAttribute('default'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route - computed: true, optional: false, required: false + private _route = new DataHuaweicloudVpcRouteTableRouteList(this, "route", false); + public get route() { + return this._route; + } + + // subnets - computed: true, optional: false, required: false + public get subnets() { + return this.getListAttribute('subnets'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/README.md new file mode 100644 index 00000000..f86e36bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_route_v2` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_route_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/index.ts new file mode 100644 index 00000000..97693e3f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route-v2/index.ts @@ -0,0 +1,261 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcRouteV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#destination DataHuaweicloudVpcRouteV2#destination} + */ + readonly destination?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#id DataHuaweicloudVpcRouteV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#region DataHuaweicloudVpcRouteV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#tenant_id DataHuaweicloudVpcRouteV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#type DataHuaweicloudVpcRouteV2#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#vpc_id DataHuaweicloudVpcRouteV2#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2 huaweicloud_vpc_route_v2} +*/ +export class DataHuaweicloudVpcRouteV2 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcRouteV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcRouteV2 to import + * @param importFromId The id of the existing DataHuaweicloudVpcRouteV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcRouteV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route_v2 huaweicloud_vpc_route_v2} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcRouteV2Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcRouteV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destination = config.destination; + this._id = config.id; + this._region = config.region; + this._tenantId = config.tenantId; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination - computed: true, optional: true, required: false + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/README.md new file mode 100644 index 00000000..f92519fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_route` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_route`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/index.ts new file mode 100644 index 00000000..78c14035 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-route/index.ts @@ -0,0 +1,261 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcRouteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#destination DataHuaweicloudVpcRoute#destination} + */ + readonly destination?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#id DataHuaweicloudVpcRoute#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#region DataHuaweicloudVpcRoute#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#tenant_id DataHuaweicloudVpcRoute#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#type DataHuaweicloudVpcRoute#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#vpc_id DataHuaweicloudVpcRoute#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route huaweicloud_vpc_route} +*/ +export class DataHuaweicloudVpcRoute extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcRoute resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcRoute to import + * @param importFromId The id of the existing DataHuaweicloudVpcRoute that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcRoute to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_route huaweicloud_vpc_route} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcRouteConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcRouteConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destination = config.destination; + this._id = config.id; + this._region = config.region; + this._tenantId = config.tenantId; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination - computed: true, optional: true, required: false + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/README.md new file mode 100644 index 00000000..8e907522 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_routes` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_routes`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/index.ts new file mode 100644 index 00000000..0548a30a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-routes/index.ts @@ -0,0 +1,337 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcRoutesAConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the route destination. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes#destination DataHuaweicloudVpcRoutesA#destination} + */ + readonly destination?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes#id DataHuaweicloudVpcRoutesA#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes#region DataHuaweicloudVpcRoutesA#region} + */ + readonly region?: string; + /** + * Specifies the route type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes#type DataHuaweicloudVpcRoutesA#type} + */ + readonly type?: string; + /** + * Specifies the ID of the VPC to which the route belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes#vpc_id DataHuaweicloudVpcRoutesA#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudVpcRoutesRoutes { +} + +export function dataHuaweicloudVpcRoutesRoutesToTerraform(struct?: DataHuaweicloudVpcRoutesRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcRoutesRoutesToHclTerraform(struct?: DataHuaweicloudVpcRoutesRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcRoutesRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcRoutesRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcRoutesRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpcRoutesRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcRoutesRoutesOutputReference { + return new DataHuaweicloudVpcRoutesRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes huaweicloud_vpc_routes} +*/ +export class DataHuaweicloudVpcRoutesA extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_routes"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcRoutesA resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcRoutesA to import + * @param importFromId The id of the existing DataHuaweicloudVpcRoutesA that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcRoutesA to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_routes", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_routes huaweicloud_vpc_routes} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcRoutesAConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcRoutesAConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_routes', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destination = config.destination; + this._id = config.id; + this._region = config.region; + this._type = config.type; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination - computed: false, optional: true, required: false + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routes - computed: true, optional: false, required: false + private _routes = new DataHuaweicloudVpcRoutesRoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/README.md new file mode 100644 index 00000000..33a85925 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_sub_network_interfaces` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_sub_network_interfaces`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/index.ts new file mode 100644 index 00000000..9b9e357f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-sub-network-interfaces/index.ts @@ -0,0 +1,507 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcSubNetworkInterfacesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the supplementary network interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#description DataHuaweicloudVpcSubNetworkInterfaces#description} + */ + readonly description?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#id DataHuaweicloudVpcSubNetworkInterfaces#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the supplementary network interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#interface_id DataHuaweicloudVpcSubNetworkInterfaces#interface_id} + */ + readonly interfaceId?: string; + /** + * Specifies the private IPv4 address of the supplementary network interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#ip_address DataHuaweicloudVpcSubNetworkInterfaces#ip_address} + */ + readonly ipAddress?: string; + /** + * Specifies the MAC address of the supplementary network interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#mac_address DataHuaweicloudVpcSubNetworkInterfaces#mac_address} + */ + readonly macAddress?: string; + /** + * Specifies the ID of the elastic network interface + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#parent_id DataHuaweicloudVpcSubNetworkInterfaces#parent_id} + */ + readonly parentId?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#region DataHuaweicloudVpcSubNetworkInterfaces#region} + */ + readonly region?: string; + /** + * Specifies the ID of the subnet to which the supplementary network interface belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#subnet_id DataHuaweicloudVpcSubNetworkInterfaces#subnet_id} + */ + readonly subnetId?: string; + /** + * Specifies the ID of the VPC to which the supplementary network interface belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#vpc_id DataHuaweicloudVpcSubNetworkInterfaces#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfaces { +} + +export function dataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesToTerraform(struct?: DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesToHclTerraform(struct?: DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfaces): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfaces | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfaces | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ipv6_ip_address - computed: true, optional: false, required: false + public get ipv6IpAddress() { + return this.getStringAttribute('ipv6_ip_address'); + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // parent_device_id - computed: true, optional: false, required: false + public get parentDeviceId() { + return this.getStringAttribute('parent_device_id'); + } + + // parent_id - computed: true, optional: false, required: false + public get parentId() { + return this.getStringAttribute('parent_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // security_enabled - computed: true, optional: false, required: false + public get securityEnabled() { + return this.getBooleanAttribute('security_enabled'); + } + + // security_groups - computed: true, optional: false, required: false + public get securityGroups() { + return this.getListAttribute('security_groups'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + public get tags() { + return this.getListAttribute('tags'); + } + + // vlan_id - computed: true, optional: false, required: false + public get vlanId() { + return this.getNumberAttribute('vlan_id'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesOutputReference { + return new DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces huaweicloud_vpc_sub_network_interfaces} +*/ +export class DataHuaweicloudVpcSubNetworkInterfaces extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_sub_network_interfaces"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcSubNetworkInterfaces resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcSubNetworkInterfaces to import + * @param importFromId The id of the existing DataHuaweicloudVpcSubNetworkInterfaces that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcSubNetworkInterfaces to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_sub_network_interfaces", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_sub_network_interfaces huaweicloud_vpc_sub_network_interfaces} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcSubNetworkInterfacesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcSubNetworkInterfacesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_sub_network_interfaces', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._interfaceId = config.interfaceId; + this._ipAddress = config.ipAddress; + this._macAddress = config.macAddress; + this._parentId = config.parentId; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string[]; + public get description() { + return this.getListAttribute('description'); + } + public set description(value: string[]) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interface_id - computed: false, optional: true, required: false + private _interfaceId?: string; + public get interfaceId() { + return this.getStringAttribute('interface_id'); + } + public set interfaceId(value: string) { + this._interfaceId = value; + } + public resetInterfaceId() { + this._interfaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get interfaceIdInput() { + return this._interfaceId; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // mac_address - computed: false, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sub_network_interfaces - computed: true, optional: false, required: false + private _subNetworkInterfaces = new DataHuaweicloudVpcSubNetworkInterfacesSubNetworkInterfacesList(this, "sub_network_interfaces", false); + public get subNetworkInterfaces() { + return this._subNetworkInterfaces; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.listMapper(cdktf.stringToTerraform, false)(this._description), + id: cdktf.stringToTerraform(this._id), + interface_id: cdktf.stringToTerraform(this._interfaceId), + ip_address: cdktf.stringToTerraform(this._ipAddress), + mac_address: cdktf.stringToTerraform(this._macAddress), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._description), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interface_id: { + value: cdktf.stringToHclTerraform(this._interfaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(this._macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/README.md new file mode 100644 index 00000000..ebb8d31c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_subnet_ids_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_subnet_ids_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/index.ts new file mode 100644 index 00000000..1b43cc5e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids-v1/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcSubnetIdsV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1#id DataHuaweicloudVpcSubnetIdsV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1#region DataHuaweicloudVpcSubnetIdsV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1#vpc_id DataHuaweicloudVpcSubnetIdsV1#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1 huaweicloud_vpc_subnet_ids_v1} +*/ +export class DataHuaweicloudVpcSubnetIdsV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnet_ids_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcSubnetIdsV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcSubnetIdsV1 to import + * @param importFromId The id of the existing DataHuaweicloudVpcSubnetIdsV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcSubnetIdsV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnet_ids_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids_v1 huaweicloud_vpc_subnet_ids_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcSubnetIdsV1Config + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcSubnetIdsV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnet_ids_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/README.md new file mode 100644 index 00000000..e636231a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_subnet_ids` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_subnet_ids`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/index.ts new file mode 100644 index 00000000..0399fc6f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-ids/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcSubnetIdsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids#id DataHuaweicloudVpcSubnetIds#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids#region DataHuaweicloudVpcSubnetIds#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids#vpc_id DataHuaweicloudVpcSubnetIds#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids huaweicloud_vpc_subnet_ids} +*/ +export class DataHuaweicloudVpcSubnetIds extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnet_ids"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcSubnetIds resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcSubnetIds to import + * @param importFromId The id of the existing DataHuaweicloudVpcSubnetIds that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcSubnetIds to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnet_ids", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_ids huaweicloud_vpc_subnet_ids} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcSubnetIdsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcSubnetIdsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnet_ids', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ids - computed: true, optional: false, required: false + public get ids() { + return this.getListAttribute('ids'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/README.md new file mode 100644 index 00000000..a9b158be --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_subnet_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_subnet_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/index.ts new file mode 100644 index 00000000..93b259ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet-v1/index.ts @@ -0,0 +1,413 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcSubnetV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#availability_zone DataHuaweicloudVpcSubnetV1#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#cidr DataHuaweicloudVpcSubnetV1#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#gateway_ip DataHuaweicloudVpcSubnetV1#gateway_ip} + */ + readonly gatewayIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#id DataHuaweicloudVpcSubnetV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#name DataHuaweicloudVpcSubnetV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#primary_dns DataHuaweicloudVpcSubnetV1#primary_dns} + */ + readonly primaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#region DataHuaweicloudVpcSubnetV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#secondary_dns DataHuaweicloudVpcSubnetV1#secondary_dns} + */ + readonly secondaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#status DataHuaweicloudVpcSubnetV1#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#vpc_id DataHuaweicloudVpcSubnetV1#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1 huaweicloud_vpc_subnet_v1} +*/ +export class DataHuaweicloudVpcSubnetV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnet_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcSubnetV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcSubnetV1 to import + * @param importFromId The id of the existing DataHuaweicloudVpcSubnetV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcSubnetV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnet_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet_v1 huaweicloud_vpc_subnet_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcSubnetV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcSubnetV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnet_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cidr = config.cidr; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._name = config.name; + this._primaryDns = config.primaryDns; + this._region = config.region; + this._secondaryDns = config.secondaryDns; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dhcp_enable - computed: true, optional: false, required: false + public get dhcpEnable() { + return this.getBooleanAttribute('dhcp_enable'); + } + + // dns_list - computed: true, optional: false, required: false + public get dnsList() { + return cdktf.Fn.tolist(this.getListAttribute('dns_list')); + } + + // gateway_ip - computed: true, optional: true, required: false + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + public resetGatewayIp() { + this._gatewayIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv4_subnet_id - computed: true, optional: false, required: false + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + + // ipv6_cidr - computed: true, optional: false, required: false + public get ipv6Cidr() { + return this.getStringAttribute('ipv6_cidr'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // ipv6_gateway - computed: true, optional: false, required: false + public get ipv6Gateway() { + return this.getStringAttribute('ipv6_gateway'); + } + + // ipv6_subnet_id - computed: true, optional: false, required: false + public get ipv6SubnetId() { + return this.getStringAttribute('ipv6_subnet_id'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // primary_dns - computed: true, optional: true, required: false + private _primaryDns?: string; + public get primaryDns() { + return this.getStringAttribute('primary_dns'); + } + public set primaryDns(value: string) { + this._primaryDns = value; + } + public resetPrimaryDns() { + this._primaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryDnsInput() { + return this._primaryDns; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secondary_dns - computed: true, optional: true, required: false + private _secondaryDns?: string; + public get secondaryDns() { + return this.getStringAttribute('secondary_dns'); + } + public set secondaryDns(value: string) { + this._secondaryDns = value; + } + public resetSecondaryDns() { + this._secondaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryDnsInput() { + return this._secondaryDns; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cidr: cdktf.stringToTerraform(this._cidr), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + primary_dns: cdktf.stringToTerraform(this._primaryDns), + region: cdktf.stringToTerraform(this._region), + secondary_dns: cdktf.stringToTerraform(this._secondaryDns), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_dns: { + value: cdktf.stringToHclTerraform(this._primaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_dns: { + value: cdktf.stringToHclTerraform(this._secondaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/README.md new file mode 100644 index 00000000..60a0aa3a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_subnet` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_subnet`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/index.ts new file mode 100644 index 00000000..af1ba9d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnet/index.ts @@ -0,0 +1,413 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcSubnetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#availability_zone DataHuaweicloudVpcSubnet#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#cidr DataHuaweicloudVpcSubnet#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#gateway_ip DataHuaweicloudVpcSubnet#gateway_ip} + */ + readonly gatewayIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#id DataHuaweicloudVpcSubnet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#name DataHuaweicloudVpcSubnet#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#primary_dns DataHuaweicloudVpcSubnet#primary_dns} + */ + readonly primaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#region DataHuaweicloudVpcSubnet#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#secondary_dns DataHuaweicloudVpcSubnet#secondary_dns} + */ + readonly secondaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#status DataHuaweicloudVpcSubnet#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#vpc_id DataHuaweicloudVpcSubnet#vpc_id} + */ + readonly vpcId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet huaweicloud_vpc_subnet} +*/ +export class DataHuaweicloudVpcSubnet extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnet"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcSubnet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcSubnet to import + * @param importFromId The id of the existing DataHuaweicloudVpcSubnet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcSubnet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnet", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnet huaweicloud_vpc_subnet} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcSubnetConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcSubnetConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnet', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cidr = config.cidr; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._name = config.name; + this._primaryDns = config.primaryDns; + this._region = config.region; + this._secondaryDns = config.secondaryDns; + this._status = config.status; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dhcp_enable - computed: true, optional: false, required: false + public get dhcpEnable() { + return this.getBooleanAttribute('dhcp_enable'); + } + + // dns_list - computed: true, optional: false, required: false + public get dnsList() { + return cdktf.Fn.tolist(this.getListAttribute('dns_list')); + } + + // gateway_ip - computed: true, optional: true, required: false + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + public resetGatewayIp() { + this._gatewayIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv4_subnet_id - computed: true, optional: false, required: false + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + + // ipv6_cidr - computed: true, optional: false, required: false + public get ipv6Cidr() { + return this.getStringAttribute('ipv6_cidr'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // ipv6_gateway - computed: true, optional: false, required: false + public get ipv6Gateway() { + return this.getStringAttribute('ipv6_gateway'); + } + + // ipv6_subnet_id - computed: true, optional: false, required: false + public get ipv6SubnetId() { + return this.getStringAttribute('ipv6_subnet_id'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // primary_dns - computed: true, optional: true, required: false + private _primaryDns?: string; + public get primaryDns() { + return this.getStringAttribute('primary_dns'); + } + public set primaryDns(value: string) { + this._primaryDns = value; + } + public resetPrimaryDns() { + this._primaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryDnsInput() { + return this._primaryDns; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secondary_dns - computed: true, optional: true, required: false + private _secondaryDns?: string; + public get secondaryDns() { + return this.getStringAttribute('secondary_dns'); + } + public set secondaryDns(value: string) { + this._secondaryDns = value; + } + public resetSecondaryDns() { + this._secondaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryDnsInput() { + return this._secondaryDns; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cidr: cdktf.stringToTerraform(this._cidr), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + primary_dns: cdktf.stringToTerraform(this._primaryDns), + region: cdktf.stringToTerraform(this._region), + secondary_dns: cdktf.stringToTerraform(this._secondaryDns), + status: cdktf.stringToTerraform(this._status), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_dns: { + value: cdktf.stringToHclTerraform(this._primaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_dns: { + value: cdktf.stringToHclTerraform(this._secondaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/README.md new file mode 100644 index 00000000..316190fd --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_subnets` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_subnets`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/index.ts new file mode 100644 index 00000000..055c7c13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-subnets/index.ts @@ -0,0 +1,568 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcSubnetsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#availability_zone DataHuaweicloudVpcSubnets#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#cidr DataHuaweicloudVpcSubnets#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#gateway_ip DataHuaweicloudVpcSubnets#gateway_ip} + */ + readonly gatewayIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#id DataHuaweicloudVpcSubnets#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#name DataHuaweicloudVpcSubnets#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#primary_dns DataHuaweicloudVpcSubnets#primary_dns} + */ + readonly primaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#region DataHuaweicloudVpcSubnets#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#secondary_dns DataHuaweicloudVpcSubnets#secondary_dns} + */ + readonly secondaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#status DataHuaweicloudVpcSubnets#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#tags DataHuaweicloudVpcSubnets#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#vpc_id DataHuaweicloudVpcSubnets#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudVpcSubnetsSubnets { +} + +export function dataHuaweicloudVpcSubnetsSubnetsToTerraform(struct?: DataHuaweicloudVpcSubnetsSubnets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcSubnetsSubnetsToHclTerraform(struct?: DataHuaweicloudVpcSubnetsSubnets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcSubnetsSubnetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcSubnetsSubnets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcSubnetsSubnets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dhcp_enable - computed: true, optional: false, required: false + public get dhcpEnable() { + return this.getBooleanAttribute('dhcp_enable'); + } + + // dns_list - computed: true, optional: false, required: false + public get dnsList() { + return cdktf.Fn.tolist(this.getListAttribute('dns_list')); + } + + // gateway_ip - computed: true, optional: false, required: false + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv4_subnet_id - computed: true, optional: false, required: false + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + + // ipv6_cidr - computed: true, optional: false, required: false + public get ipv6Cidr() { + return this.getStringAttribute('ipv6_cidr'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // ipv6_gateway - computed: true, optional: false, required: false + public get ipv6Gateway() { + return this.getStringAttribute('ipv6_gateway'); + } + + // ipv6_subnet_id - computed: true, optional: false, required: false + public get ipv6SubnetId() { + return this.getStringAttribute('ipv6_subnet_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // primary_dns - computed: true, optional: false, required: false + public get primaryDns() { + return this.getStringAttribute('primary_dns'); + } + + // secondary_dns - computed: true, optional: false, required: false + public get secondaryDns() { + return this.getStringAttribute('secondary_dns'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpcSubnetsSubnetsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcSubnetsSubnetsOutputReference { + return new DataHuaweicloudVpcSubnetsSubnetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets huaweicloud_vpc_subnets} +*/ +export class DataHuaweicloudVpcSubnets extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnets"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcSubnets resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcSubnets to import + * @param importFromId The id of the existing DataHuaweicloudVpcSubnets that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcSubnets to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnets", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_subnets huaweicloud_vpc_subnets} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcSubnetsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcSubnetsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnets', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cidr = config.cidr; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._name = config.name; + this._primaryDns = config.primaryDns; + this._region = config.region; + this._secondaryDns = config.secondaryDns; + this._status = config.status; + this._tags = config.tags; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // gateway_ip - computed: false, optional: true, required: false + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + public resetGatewayIp() { + this._gatewayIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // primary_dns - computed: false, optional: true, required: false + private _primaryDns?: string; + public get primaryDns() { + return this.getStringAttribute('primary_dns'); + } + public set primaryDns(value: string) { + this._primaryDns = value; + } + public resetPrimaryDns() { + this._primaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryDnsInput() { + return this._primaryDns; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secondary_dns - computed: false, optional: true, required: false + private _secondaryDns?: string; + public get secondaryDns() { + return this.getStringAttribute('secondary_dns'); + } + public set secondaryDns(value: string) { + this._secondaryDns = value; + } + public resetSecondaryDns() { + this._secondaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryDnsInput() { + return this._secondaryDns; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnets - computed: true, optional: false, required: false + private _subnets = new DataHuaweicloudVpcSubnetsSubnetsList(this, "subnets", false); + public get subnets() { + return this._subnets; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cidr: cdktf.stringToTerraform(this._cidr), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + primary_dns: cdktf.stringToTerraform(this._primaryDns), + region: cdktf.stringToTerraform(this._region), + secondary_dns: cdktf.stringToTerraform(this._secondaryDns), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_dns: { + value: cdktf.stringToHclTerraform(this._primaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_dns: { + value: cdktf.stringToHclTerraform(this._secondaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/README.md new file mode 100644 index 00000000..666cd413 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_traffic_mirror_filter_rules` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_traffic_mirror_filter_rules`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/index.ts new file mode 100644 index 00000000..8d0ac7c0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filter-rules/index.ts @@ -0,0 +1,597 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcTrafficMirrorFilterRulesConfig extends cdktf.TerraformMetaArguments { + /** + * The policy of in the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#action DataHuaweicloudVpcTrafficMirrorFilterRules#action} + */ + readonly action?: string; + /** + * The destination IP address of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#destination_cidr_block DataHuaweicloudVpcTrafficMirrorFilterRules#destination_cidr_block} + */ + readonly destinationCidrBlock?: string; + /** + * The destination port number range of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#destination_port_range DataHuaweicloudVpcTrafficMirrorFilterRules#destination_port_range} + */ + readonly destinationPortRange?: string; + /** + * The direction of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#direction DataHuaweicloudVpcTrafficMirrorFilterRules#direction} + */ + readonly direction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#id DataHuaweicloudVpcTrafficMirrorFilterRules#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The priority number of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#priority DataHuaweicloudVpcTrafficMirrorFilterRules#priority} + */ + readonly priority?: string; + /** + * The protocol of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#protocol DataHuaweicloudVpcTrafficMirrorFilterRules#protocol} + */ + readonly protocol?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#region DataHuaweicloudVpcTrafficMirrorFilterRules#region} + */ + readonly region?: string; + /** + * The source IP address of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#source_cidr_block DataHuaweicloudVpcTrafficMirrorFilterRules#source_cidr_block} + */ + readonly sourceCidrBlock?: string; + /** + * The source port number range of the traffic mirror filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#source_port_range DataHuaweicloudVpcTrafficMirrorFilterRules#source_port_range} + */ + readonly sourcePortRange?: string; + /** + * The traffic mirror filter ID used as the query filter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#traffic_mirror_filter_id DataHuaweicloudVpcTrafficMirrorFilterRules#traffic_mirror_filter_id} + */ + readonly trafficMirrorFilterId?: string; + /** + * The traffic mirror filter rule ID used as the query filter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#traffic_mirror_filter_rule_id DataHuaweicloudVpcTrafficMirrorFilterRules#traffic_mirror_filter_rule_id} + */ + readonly trafficMirrorFilterRuleId?: string; +} +export interface DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRules { +} + +export function dataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesToTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesToHclTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination_cidr_block - computed: true, optional: false, required: false + public get destinationCidrBlock() { + return this.getStringAttribute('destination_cidr_block'); + } + + // destination_port_range - computed: true, optional: false, required: false + public get destinationPortRange() { + return this.getStringAttribute('destination_port_range'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // source_cidr_block - computed: true, optional: false, required: false + public get sourceCidrBlock() { + return this.getStringAttribute('source_cidr_block'); + } + + // source_port_range - computed: true, optional: false, required: false + public get sourcePortRange() { + return this.getStringAttribute('source_port_range'); + } + + // traffic_mirror_filter_id - computed: true, optional: false, required: false + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesOutputReference { + return new DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules huaweicloud_vpc_traffic_mirror_filter_rules} +*/ +export class DataHuaweicloudVpcTrafficMirrorFilterRules extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_traffic_mirror_filter_rules"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcTrafficMirrorFilterRules resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcTrafficMirrorFilterRules to import + * @param importFromId The id of the existing DataHuaweicloudVpcTrafficMirrorFilterRules that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcTrafficMirrorFilterRules to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_traffic_mirror_filter_rules", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filter_rules huaweicloud_vpc_traffic_mirror_filter_rules} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcTrafficMirrorFilterRulesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcTrafficMirrorFilterRulesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_traffic_mirror_filter_rules', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._destinationCidrBlock = config.destinationCidrBlock; + this._destinationPortRange = config.destinationPortRange; + this._direction = config.direction; + this._id = config.id; + this._priority = config.priority; + this._protocol = config.protocol; + this._region = config.region; + this._sourceCidrBlock = config.sourceCidrBlock; + this._sourcePortRange = config.sourcePortRange; + this._trafficMirrorFilterId = config.trafficMirrorFilterId; + this._trafficMirrorFilterRuleId = config.trafficMirrorFilterRuleId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // destination_cidr_block - computed: false, optional: true, required: false + private _destinationCidrBlock?: string; + public get destinationCidrBlock() { + return this.getStringAttribute('destination_cidr_block'); + } + public set destinationCidrBlock(value: string) { + this._destinationCidrBlock = value; + } + public resetDestinationCidrBlock() { + this._destinationCidrBlock = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationCidrBlockInput() { + return this._destinationCidrBlock; + } + + // destination_port_range - computed: false, optional: true, required: false + private _destinationPortRange?: string; + public get destinationPortRange() { + return this.getStringAttribute('destination_port_range'); + } + public set destinationPortRange(value: string) { + this._destinationPortRange = value; + } + public resetDestinationPortRange() { + this._destinationPortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortRangeInput() { + return this._destinationPortRange; + } + + // direction - computed: false, optional: true, required: false + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // priority - computed: false, optional: true, required: false + private _priority?: string; + public get priority() { + return this.getStringAttribute('priority'); + } + public set priority(value: string) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_cidr_block - computed: false, optional: true, required: false + private _sourceCidrBlock?: string; + public get sourceCidrBlock() { + return this.getStringAttribute('source_cidr_block'); + } + public set sourceCidrBlock(value: string) { + this._sourceCidrBlock = value; + } + public resetSourceCidrBlock() { + this._sourceCidrBlock = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceCidrBlockInput() { + return this._sourceCidrBlock; + } + + // source_port_range - computed: false, optional: true, required: false + private _sourcePortRange?: string; + public get sourcePortRange() { + return this.getStringAttribute('source_port_range'); + } + public set sourcePortRange(value: string) { + this._sourcePortRange = value; + } + public resetSourcePortRange() { + this._sourcePortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortRangeInput() { + return this._sourcePortRange; + } + + // traffic_mirror_filter_id - computed: false, optional: true, required: false + private _trafficMirrorFilterId?: string; + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + public set trafficMirrorFilterId(value: string) { + this._trafficMirrorFilterId = value; + } + public resetTrafficMirrorFilterId() { + this._trafficMirrorFilterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorFilterIdInput() { + return this._trafficMirrorFilterId; + } + + // traffic_mirror_filter_rule_id - computed: false, optional: true, required: false + private _trafficMirrorFilterRuleId?: string; + public get trafficMirrorFilterRuleId() { + return this.getStringAttribute('traffic_mirror_filter_rule_id'); + } + public set trafficMirrorFilterRuleId(value: string) { + this._trafficMirrorFilterRuleId = value; + } + public resetTrafficMirrorFilterRuleId() { + this._trafficMirrorFilterRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorFilterRuleIdInput() { + return this._trafficMirrorFilterRuleId; + } + + // traffic_mirror_filter_rules - computed: true, optional: false, required: false + private _trafficMirrorFilterRules = new DataHuaweicloudVpcTrafficMirrorFilterRulesTrafficMirrorFilterRulesList(this, "traffic_mirror_filter_rules", false); + public get trafficMirrorFilterRules() { + return this._trafficMirrorFilterRules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + destination_cidr_block: cdktf.stringToTerraform(this._destinationCidrBlock), + destination_port_range: cdktf.stringToTerraform(this._destinationPortRange), + direction: cdktf.stringToTerraform(this._direction), + id: cdktf.stringToTerraform(this._id), + priority: cdktf.stringToTerraform(this._priority), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + source_cidr_block: cdktf.stringToTerraform(this._sourceCidrBlock), + source_port_range: cdktf.stringToTerraform(this._sourcePortRange), + traffic_mirror_filter_id: cdktf.stringToTerraform(this._trafficMirrorFilterId), + traffic_mirror_filter_rule_id: cdktf.stringToTerraform(this._trafficMirrorFilterRuleId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_cidr_block: { + value: cdktf.stringToHclTerraform(this._destinationCidrBlock), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port_range: { + value: cdktf.stringToHclTerraform(this._destinationPortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.stringToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_cidr_block: { + value: cdktf.stringToHclTerraform(this._sourceCidrBlock), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port_range: { + value: cdktf.stringToHclTerraform(this._sourcePortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_filter_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorFilterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_filter_rule_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorFilterRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/README.md new file mode 100644 index 00000000..8c4ccb60 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_traffic_mirror_filters` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_traffic_mirror_filters`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/index.ts new file mode 100644 index 00000000..3724f89e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-filters/index.ts @@ -0,0 +1,614 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcTrafficMirrorFiltersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters#id DataHuaweicloudVpcTrafficMirrorFilters#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the traffic mirror filter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters#name DataHuaweicloudVpcTrafficMirrorFilters#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters#region DataHuaweicloudVpcTrafficMirrorFilters#region} + */ + readonly region?: string; + /** + * Specifies the ID of the traffic mirror filter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters#traffic_mirror_filter_id DataHuaweicloudVpcTrafficMirrorFilters#traffic_mirror_filter_id} + */ + readonly trafficMirrorFilterId?: string; +} +export interface DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRules { +} + +export function dataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesToTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesToHclTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination_cidr_block - computed: true, optional: false, required: false + public get destinationCidrBlock() { + return this.getStringAttribute('destination_cidr_block'); + } + + // destination_port_range - computed: true, optional: false, required: false + public get destinationPortRange() { + return this.getStringAttribute('destination_port_range'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // source_cidr_block - computed: true, optional: false, required: false + public get sourceCidrBlock() { + return this.getStringAttribute('source_cidr_block'); + } + + // source_port_range - computed: true, optional: false, required: false + public get sourcePortRange() { + return this.getStringAttribute('source_port_range'); + } + + // traffic_mirror_filter_id - computed: true, optional: false, required: false + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesOutputReference { + return new DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRules { +} + +export function dataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesToTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesToHclTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // destination_cidr_block - computed: true, optional: false, required: false + public get destinationCidrBlock() { + return this.getStringAttribute('destination_cidr_block'); + } + + // destination_port_range - computed: true, optional: false, required: false + public get destinationPortRange() { + return this.getStringAttribute('destination_port_range'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // source_cidr_block - computed: true, optional: false, required: false + public get sourceCidrBlock() { + return this.getStringAttribute('source_cidr_block'); + } + + // source_port_range - computed: true, optional: false, required: false + public get sourcePortRange() { + return this.getStringAttribute('source_port_range'); + } + + // traffic_mirror_filter_id - computed: true, optional: false, required: false + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesOutputReference { + return new DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFilters { +} + +export function dataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersToTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFilters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersToHclTerraform(struct?: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFilters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFilters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFilters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // egress_rules - computed: true, optional: false, required: false + private _egressRules = new DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersEgressRulesList(this, "egress_rules", true); + public get egressRules() { + return this._egressRules; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ingress_rules - computed: true, optional: false, required: false + private _ingressRules = new DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersIngressRulesList(this, "ingress_rules", false); + public get ingressRules() { + return this._ingressRules; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersOutputReference { + return new DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters huaweicloud_vpc_traffic_mirror_filters} +*/ +export class DataHuaweicloudVpcTrafficMirrorFilters extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_traffic_mirror_filters"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcTrafficMirrorFilters resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcTrafficMirrorFilters to import + * @param importFromId The id of the existing DataHuaweicloudVpcTrafficMirrorFilters that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcTrafficMirrorFilters to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_traffic_mirror_filters", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_filters huaweicloud_vpc_traffic_mirror_filters} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcTrafficMirrorFiltersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcTrafficMirrorFiltersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_traffic_mirror_filters', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._trafficMirrorFilterId = config.trafficMirrorFilterId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // traffic_mirror_filter_id - computed: false, optional: true, required: false + private _trafficMirrorFilterId?: string; + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + public set trafficMirrorFilterId(value: string) { + this._trafficMirrorFilterId = value; + } + public resetTrafficMirrorFilterId() { + this._trafficMirrorFilterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorFilterIdInput() { + return this._trafficMirrorFilterId; + } + + // traffic_mirror_filters - computed: true, optional: false, required: false + private _trafficMirrorFilters = new DataHuaweicloudVpcTrafficMirrorFiltersTrafficMirrorFiltersList(this, "traffic_mirror_filters", false); + public get trafficMirrorFilters() { + return this._trafficMirrorFilters; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + traffic_mirror_filter_id: cdktf.stringToTerraform(this._trafficMirrorFilterId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_filter_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorFilterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/README.md new file mode 100644 index 00000000..7445ef4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_traffic_mirror_sessions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_traffic_mirror_sessions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/index.ts new file mode 100644 index 00000000..0ab517c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-traffic-mirror-sessions/index.ts @@ -0,0 +1,597 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcTrafficMirrorSessionsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether the mirror session is enabled. Defaults to **true**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#enabled DataHuaweicloudVpcTrafficMirrorSessions#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#id DataHuaweicloudVpcTrafficMirrorSessions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the traffic mirror session name used to query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#name DataHuaweicloudVpcTrafficMirrorSessions#name} + */ + readonly name?: string; + /** + * Specifies the maximum transmission unit (MTU). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#packet_length DataHuaweicloudVpcTrafficMirrorSessions#packet_length} + */ + readonly packetLength?: string; + /** + * Specifies the mirror session priority. The value range is **1-32766**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#priority DataHuaweicloudVpcTrafficMirrorSessions#priority} + */ + readonly priority?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#region DataHuaweicloudVpcTrafficMirrorSessions#region} + */ + readonly region?: string; + /** + * Specifies the traffic mirror filter ID used in the session. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#traffic_mirror_filter_id DataHuaweicloudVpcTrafficMirrorSessions#traffic_mirror_filter_id} + */ + readonly trafficMirrorFilterId?: string; + /** + * Specifies the traffic mirror session ID used to query. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#traffic_mirror_session_id DataHuaweicloudVpcTrafficMirrorSessions#traffic_mirror_session_id} + */ + readonly trafficMirrorSessionId?: string; + /** + * Specifies the traffic mirror target ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#traffic_mirror_target_id DataHuaweicloudVpcTrafficMirrorSessions#traffic_mirror_target_id} + */ + readonly trafficMirrorTargetId?: string; + /** + * Specifies the mirror target type. The value can be: + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#traffic_mirror_target_type DataHuaweicloudVpcTrafficMirrorSessions#traffic_mirror_target_type} + */ + readonly trafficMirrorTargetType?: string; + /** + * Specifies the mirror source type. The value can be **eni**(elastic network interface). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#type DataHuaweicloudVpcTrafficMirrorSessions#type} + */ + readonly type?: string; + /** + * Specifies the VNI, which is used to distinguish mirrored traffic of different + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#virtual_network_id DataHuaweicloudVpcTrafficMirrorSessions#virtual_network_id} + */ + readonly virtualNetworkId?: string; +} +export interface DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessions { +} + +export function dataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsToTerraform(struct?: DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsToHclTerraform(struct?: DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // packet_length - computed: true, optional: false, required: false + public get packetLength() { + return this.getNumberAttribute('packet_length'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // traffic_mirror_filter_id - computed: true, optional: false, required: false + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + + // traffic_mirror_sources - computed: true, optional: false, required: false + public get trafficMirrorSources() { + return this.getListAttribute('traffic_mirror_sources'); + } + + // traffic_mirror_target_id - computed: true, optional: false, required: false + public get trafficMirrorTargetId() { + return this.getStringAttribute('traffic_mirror_target_id'); + } + + // traffic_mirror_target_type - computed: true, optional: false, required: false + public get trafficMirrorTargetType() { + return this.getStringAttribute('traffic_mirror_target_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // virtual_network_id - computed: true, optional: false, required: false + public get virtualNetworkId() { + return this.getNumberAttribute('virtual_network_id'); + } +} + +export class DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsOutputReference { + return new DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions huaweicloud_vpc_traffic_mirror_sessions} +*/ +export class DataHuaweicloudVpcTrafficMirrorSessions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_traffic_mirror_sessions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcTrafficMirrorSessions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcTrafficMirrorSessions to import + * @param importFromId The id of the existing DataHuaweicloudVpcTrafficMirrorSessions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcTrafficMirrorSessions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_traffic_mirror_sessions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_traffic_mirror_sessions huaweicloud_vpc_traffic_mirror_sessions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcTrafficMirrorSessionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcTrafficMirrorSessionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_traffic_mirror_sessions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._packetLength = config.packetLength; + this._priority = config.priority; + this._region = config.region; + this._trafficMirrorFilterId = config.trafficMirrorFilterId; + this._trafficMirrorSessionId = config.trafficMirrorSessionId; + this._trafficMirrorTargetId = config.trafficMirrorTargetId; + this._trafficMirrorTargetType = config.trafficMirrorTargetType; + this._type = config.type; + this._virtualNetworkId = config.virtualNetworkId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // packet_length - computed: false, optional: true, required: false + private _packetLength?: string; + public get packetLength() { + return this.getStringAttribute('packet_length'); + } + public set packetLength(value: string) { + this._packetLength = value; + } + public resetPacketLength() { + this._packetLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get packetLengthInput() { + return this._packetLength; + } + + // priority - computed: false, optional: true, required: false + private _priority?: string; + public get priority() { + return this.getStringAttribute('priority'); + } + public set priority(value: string) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // traffic_mirror_filter_id - computed: false, optional: true, required: false + private _trafficMirrorFilterId?: string; + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + public set trafficMirrorFilterId(value: string) { + this._trafficMirrorFilterId = value; + } + public resetTrafficMirrorFilterId() { + this._trafficMirrorFilterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorFilterIdInput() { + return this._trafficMirrorFilterId; + } + + // traffic_mirror_session_id - computed: false, optional: true, required: false + private _trafficMirrorSessionId?: string; + public get trafficMirrorSessionId() { + return this.getStringAttribute('traffic_mirror_session_id'); + } + public set trafficMirrorSessionId(value: string) { + this._trafficMirrorSessionId = value; + } + public resetTrafficMirrorSessionId() { + this._trafficMirrorSessionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorSessionIdInput() { + return this._trafficMirrorSessionId; + } + + // traffic_mirror_sessions - computed: true, optional: false, required: false + private _trafficMirrorSessions = new DataHuaweicloudVpcTrafficMirrorSessionsTrafficMirrorSessionsList(this, "traffic_mirror_sessions", false); + public get trafficMirrorSessions() { + return this._trafficMirrorSessions; + } + + // traffic_mirror_target_id - computed: false, optional: true, required: false + private _trafficMirrorTargetId?: string; + public get trafficMirrorTargetId() { + return this.getStringAttribute('traffic_mirror_target_id'); + } + public set trafficMirrorTargetId(value: string) { + this._trafficMirrorTargetId = value; + } + public resetTrafficMirrorTargetId() { + this._trafficMirrorTargetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorTargetIdInput() { + return this._trafficMirrorTargetId; + } + + // traffic_mirror_target_type - computed: false, optional: true, required: false + private _trafficMirrorTargetType?: string; + public get trafficMirrorTargetType() { + return this.getStringAttribute('traffic_mirror_target_type'); + } + public set trafficMirrorTargetType(value: string) { + this._trafficMirrorTargetType = value; + } + public resetTrafficMirrorTargetType() { + this._trafficMirrorTargetType = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorTargetTypeInput() { + return this._trafficMirrorTargetType; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // virtual_network_id - computed: false, optional: true, required: false + private _virtualNetworkId?: string; + public get virtualNetworkId() { + return this.getStringAttribute('virtual_network_id'); + } + public set virtualNetworkId(value: string) { + this._virtualNetworkId = value; + } + public resetVirtualNetworkId() { + this._virtualNetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get virtualNetworkIdInput() { + return this._virtualNetworkId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + packet_length: cdktf.stringToTerraform(this._packetLength), + priority: cdktf.stringToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + traffic_mirror_filter_id: cdktf.stringToTerraform(this._trafficMirrorFilterId), + traffic_mirror_session_id: cdktf.stringToTerraform(this._trafficMirrorSessionId), + traffic_mirror_target_id: cdktf.stringToTerraform(this._trafficMirrorTargetId), + traffic_mirror_target_type: cdktf.stringToTerraform(this._trafficMirrorTargetType), + type: cdktf.stringToTerraform(this._type), + virtual_network_id: cdktf.stringToTerraform(this._virtualNetworkId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + packet_length: { + value: cdktf.stringToHclTerraform(this._packetLength), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.stringToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_filter_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorFilterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_session_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorSessionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_target_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorTargetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_target_type: { + value: cdktf.stringToHclTerraform(this._trafficMirrorTargetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + virtual_network_id: { + value: cdktf.stringToHclTerraform(this._virtualNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/README.md new file mode 100644 index 00000000..8f7b7492 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc_v1` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/index.ts new file mode 100644 index 00000000..910cbe3c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc-v1/index.ts @@ -0,0 +1,358 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#cidr DataHuaweicloudVpcV1#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#enterprise_project_id DataHuaweicloudVpcV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#id DataHuaweicloudVpcV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#name DataHuaweicloudVpcV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#region DataHuaweicloudVpcV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#status DataHuaweicloudVpcV1#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudVpcV1Routes { +} + +export function dataHuaweicloudVpcV1RoutesToTerraform(struct?: DataHuaweicloudVpcV1Routes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcV1RoutesToHclTerraform(struct?: DataHuaweicloudVpcV1Routes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcV1RoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcV1Routes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcV1Routes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } +} + +export class DataHuaweicloudVpcV1RoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcV1RoutesOutputReference { + return new DataHuaweicloudVpcV1RoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1 huaweicloud_vpc_v1} +*/ +export class DataHuaweicloudVpcV1 extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcV1 to import + * @param importFromId The id of the existing DataHuaweicloudVpcV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc_v1 huaweicloud_vpc_v1} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcV1Config = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcV1Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routes - computed: true, optional: false, required: false + private _routes = new DataHuaweicloudVpcV1RoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // secondary_cidrs - computed: true, optional: false, required: false + public get secondaryCidrs() { + return this.getListAttribute('secondary_cidrs'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc/README.md new file mode 100644 index 00000000..c7e8c03d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpc` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpc`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpc/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc/index.ts new file mode 100644 index 00000000..4377d6d9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpc/index.ts @@ -0,0 +1,358 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#cidr DataHuaweicloudVpc#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#enterprise_project_id DataHuaweicloudVpc#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#id DataHuaweicloudVpc#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#name DataHuaweicloudVpc#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#region DataHuaweicloudVpc#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#status DataHuaweicloudVpc#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudVpcRoutes { +} + +export function dataHuaweicloudVpcRoutesToTerraform(struct?: DataHuaweicloudVpcRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcRoutesToHclTerraform(struct?: DataHuaweicloudVpcRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } +} + +export class DataHuaweicloudVpcRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcRoutesOutputReference { + return new DataHuaweicloudVpcRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc huaweicloud_vpc} +*/ +export class DataHuaweicloudVpc extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpc resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpc to import + * @param importFromId The id of the existing DataHuaweicloudVpc that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpc to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpc huaweicloud_vpc} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routes - computed: true, optional: false, required: false + private _routes = new DataHuaweicloudVpcRoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // secondary_cidrs - computed: true, optional: false, required: false + public get secondaryCidrs() { + return this.getListAttribute('secondary_cidrs'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/README.md new file mode 100644 index 00000000..55b62bb2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_endpoints` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_endpoints`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/index.ts new file mode 100644 index 00000000..04918923 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-endpoints/index.ts @@ -0,0 +1,385 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepEndpointsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints#endpoint_id DataHuaweicloudVpcepEndpoints#endpoint_id} + */ + readonly endpointId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints#id DataHuaweicloudVpcepEndpoints#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints#region DataHuaweicloudVpcepEndpoints#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints#service_name DataHuaweicloudVpcepEndpoints#service_name} + */ + readonly serviceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints#vpc_id DataHuaweicloudVpcepEndpoints#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudVpcepEndpointsEndpoints { +} + +export function dataHuaweicloudVpcepEndpointsEndpointsToTerraform(struct?: DataHuaweicloudVpcepEndpointsEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcepEndpointsEndpointsToHclTerraform(struct?: DataHuaweicloudVpcepEndpointsEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcepEndpointsEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcepEndpointsEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcepEndpointsEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enable_dns - computed: true, optional: false, required: false + public get enableDns() { + return this.getBooleanAttribute('enable_dns'); + } + + // enable_whitelist - computed: true, optional: false, required: false + public get enableWhitelist() { + return this.getBooleanAttribute('enable_whitelist'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // packet_id - computed: true, optional: false, required: false + public get packetId() { + return this.getNumberAttribute('packet_id'); + } + + // service_id - computed: true, optional: false, required: false + public get serviceId() { + return this.getStringAttribute('service_id'); + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // whitelist - computed: true, optional: false, required: false + public get whitelist() { + return this.getListAttribute('whitelist'); + } +} + +export class DataHuaweicloudVpcepEndpointsEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcepEndpointsEndpointsOutputReference { + return new DataHuaweicloudVpcepEndpointsEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints huaweicloud_vpcep_endpoints} +*/ +export class DataHuaweicloudVpcepEndpoints extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_endpoints"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepEndpoints resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepEndpoints to import + * @param importFromId The id of the existing DataHuaweicloudVpcepEndpoints that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepEndpoints to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_endpoints", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_endpoints huaweicloud_vpcep_endpoints} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepEndpointsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepEndpointsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_endpoints', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointId = config.endpointId; + this._id = config.id; + this._region = config.region; + this._serviceName = config.serviceName; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint_id - computed: false, optional: true, required: false + private _endpointId?: string; + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + public set endpointId(value: string) { + this._endpointId = value; + } + public resetEndpointId() { + this._endpointId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointIdInput() { + return this._endpointId; + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DataHuaweicloudVpcepEndpointsEndpointsList(this, "endpoints", false); + public get endpoints() { + return this._endpoints; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_name - computed: false, optional: true, required: false + private _serviceName?: string; + public get serviceName() { + return this.getStringAttribute('service_name'); + } + public set serviceName(value: string) { + this._serviceName = value; + } + public resetServiceName() { + this._serviceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNameInput() { + return this._serviceName; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_id: cdktf.stringToTerraform(this._endpointId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service_name: cdktf.stringToTerraform(this._serviceName), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_id: { + value: cdktf.stringToHclTerraform(this._endpointId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_name: { + value: cdktf.stringToHclTerraform(this._serviceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/README.md new file mode 100644 index 00000000..53d24ebf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_public_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_public_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/index.ts new file mode 100644 index 00000000..08dcd9d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-public-services/index.ts @@ -0,0 +1,301 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepPublicServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services#id DataHuaweicloudVpcepPublicServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services#region DataHuaweicloudVpcepPublicServices#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services#service_id DataHuaweicloudVpcepPublicServices#service_id} + */ + readonly serviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services#service_name DataHuaweicloudVpcepPublicServices#service_name} + */ + readonly serviceName?: string; +} +export interface DataHuaweicloudVpcepPublicServicesServices { +} + +export function dataHuaweicloudVpcepPublicServicesServicesToTerraform(struct?: DataHuaweicloudVpcepPublicServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcepPublicServicesServicesToHclTerraform(struct?: DataHuaweicloudVpcepPublicServicesServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcepPublicServicesServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcepPublicServicesServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcepPublicServicesServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_charge - computed: true, optional: false, required: false + public get isCharge() { + return this.getBooleanAttribute('is_charge'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } +} + +export class DataHuaweicloudVpcepPublicServicesServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcepPublicServicesServicesOutputReference { + return new DataHuaweicloudVpcepPublicServicesServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services huaweicloud_vpcep_public_services} +*/ +export class DataHuaweicloudVpcepPublicServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_public_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepPublicServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepPublicServices to import + * @param importFromId The id of the existing DataHuaweicloudVpcepPublicServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepPublicServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_public_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_public_services huaweicloud_vpcep_public_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepPublicServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepPublicServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_public_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._serviceId = config.serviceId; + this._serviceName = config.serviceName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_id - computed: false, optional: true, required: false + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + public resetServiceId() { + this._serviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // service_name - computed: false, optional: true, required: false + private _serviceName?: string; + public get serviceName() { + return this.getStringAttribute('service_name'); + } + public set serviceName(value: string) { + this._serviceName = value; + } + public resetServiceName() { + this._serviceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNameInput() { + return this._serviceName; + } + + // services - computed: true, optional: false, required: false + private _services = new DataHuaweicloudVpcepPublicServicesServicesList(this, "services", false); + public get services() { + return this._services; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service_id: cdktf.stringToTerraform(this._serviceId), + service_name: cdktf.stringToTerraform(this._serviceName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_name: { + value: cdktf.stringToHclTerraform(this._serviceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/README.md new file mode 100644 index 00000000..1114c602 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_quotas` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_quotas`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/index.ts new file mode 100644 index 00000000..1109b9b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-quotas/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepQuotasConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas#id DataHuaweicloudVpcepQuotas#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas#region DataHuaweicloudVpcepQuotas#region} + */ + readonly region?: string; + /** + * Specifies the resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas#type DataHuaweicloudVpcepQuotas#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudVpcepQuotasQuotas { +} + +export function dataHuaweicloudVpcepQuotasQuotasToTerraform(struct?: DataHuaweicloudVpcepQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcepQuotasQuotasToHclTerraform(struct?: DataHuaweicloudVpcepQuotasQuotas): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcepQuotasQuotasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcepQuotasQuotas | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcepQuotasQuotas | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // quota - computed: true, optional: false, required: false + public get quota() { + return this.getNumberAttribute('quota'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getNumberAttribute('used'); + } +} + +export class DataHuaweicloudVpcepQuotasQuotasList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcepQuotasQuotasOutputReference { + return new DataHuaweicloudVpcepQuotasQuotasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas huaweicloud_vpcep_quotas} +*/ +export class DataHuaweicloudVpcepQuotas extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_quotas"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepQuotas resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepQuotas to import + * @param importFromId The id of the existing DataHuaweicloudVpcepQuotas that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepQuotas to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_quotas", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_quotas huaweicloud_vpcep_quotas} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepQuotasConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepQuotasConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_quotas', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // quotas - computed: true, optional: false, required: false + private _quotas = new DataHuaweicloudVpcepQuotasQuotasList(this, "quotas", false); + public get quotas() { + return this._quotas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/README.md new file mode 100644 index 00000000..63af8b2f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_service_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_service_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/index.ts new file mode 100644 index 00000000..5fecd84a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-connections/index.ts @@ -0,0 +1,364 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepServiceConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#endpoint_id DataHuaweicloudVpcepServiceConnections#endpoint_id} + */ + readonly endpointId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#id DataHuaweicloudVpcepServiceConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#marker_id DataHuaweicloudVpcepServiceConnections#marker_id} + */ + readonly markerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#region DataHuaweicloudVpcepServiceConnections#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#service_id DataHuaweicloudVpcepServiceConnections#service_id} + */ + readonly serviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#status DataHuaweicloudVpcepServiceConnections#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudVpcepServiceConnectionsConnections { +} + +export function dataHuaweicloudVpcepServiceConnectionsConnectionsToTerraform(struct?: DataHuaweicloudVpcepServiceConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcepServiceConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudVpcepServiceConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcepServiceConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcepServiceConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcepServiceConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // endpoint_id - computed: true, optional: false, required: false + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + + // marker_id - computed: true, optional: false, required: false + public get markerId() { + return this.getNumberAttribute('marker_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpcepServiceConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcepServiceConnectionsConnectionsOutputReference { + return new DataHuaweicloudVpcepServiceConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections huaweicloud_vpcep_service_connections} +*/ +export class DataHuaweicloudVpcepServiceConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_service_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepServiceConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepServiceConnections to import + * @param importFromId The id of the existing DataHuaweicloudVpcepServiceConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepServiceConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_service_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_connections huaweicloud_vpcep_service_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepServiceConnectionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepServiceConnectionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_service_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointId = config.endpointId; + this._id = config.id; + this._markerId = config.markerId; + this._region = config.region; + this._serviceId = config.serviceId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudVpcepServiceConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // endpoint_id - computed: false, optional: true, required: false + private _endpointId?: string; + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + public set endpointId(value: string) { + this._endpointId = value; + } + public resetEndpointId() { + this._endpointId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointIdInput() { + return this._endpointId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // marker_id - computed: false, optional: true, required: false + private _markerId?: string; + public get markerId() { + return this.getStringAttribute('marker_id'); + } + public set markerId(value: string) { + this._markerId = value; + } + public resetMarkerId() { + this._markerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get markerIdInput() { + return this._markerId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_id: cdktf.stringToTerraform(this._endpointId), + id: cdktf.stringToTerraform(this._id), + marker_id: cdktf.stringToTerraform(this._markerId), + region: cdktf.stringToTerraform(this._region), + service_id: cdktf.stringToTerraform(this._serviceId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_id: { + value: cdktf.stringToHclTerraform(this._endpointId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + marker_id: { + value: cdktf.stringToHclTerraform(this._markerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/README.md new file mode 100644 index 00000000..e8561495 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_service_permissions` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_service_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/index.ts new file mode 100644 index 00000000..cbdc2333 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-permissions/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepServicePermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions#id DataHuaweicloudVpcepServicePermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions#permission DataHuaweicloudVpcepServicePermissions#permission} + */ + readonly permission?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions#region DataHuaweicloudVpcepServicePermissions#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions#service_id DataHuaweicloudVpcepServicePermissions#service_id} + */ + readonly serviceId: string; +} +export interface DataHuaweicloudVpcepServicePermissionsPermissions { +} + +export function dataHuaweicloudVpcepServicePermissionsPermissionsToTerraform(struct?: DataHuaweicloudVpcepServicePermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcepServicePermissionsPermissionsToHclTerraform(struct?: DataHuaweicloudVpcepServicePermissionsPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcepServicePermissionsPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcepServicePermissionsPermissions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcepServicePermissionsPermissions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // permission - computed: true, optional: false, required: false + public get permission() { + return this.getStringAttribute('permission'); + } + + // permission_id - computed: true, optional: false, required: false + public get permissionId() { + return this.getStringAttribute('permission_id'); + } + + // permission_type - computed: true, optional: false, required: false + public get permissionType() { + return this.getStringAttribute('permission_type'); + } +} + +export class DataHuaweicloudVpcepServicePermissionsPermissionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcepServicePermissionsPermissionsOutputReference { + return new DataHuaweicloudVpcepServicePermissionsPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions huaweicloud_vpcep_service_permissions} +*/ +export class DataHuaweicloudVpcepServicePermissions extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_service_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepServicePermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepServicePermissions to import + * @param importFromId The id of the existing DataHuaweicloudVpcepServicePermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepServicePermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_service_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_permissions huaweicloud_vpcep_service_permissions} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepServicePermissionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepServicePermissionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_service_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._permission = config.permission; + this._region = config.region; + this._serviceId = config.serviceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // permission - computed: false, optional: true, required: false + private _permission?: string; + public get permission() { + return this.getStringAttribute('permission'); + } + public set permission(value: string) { + this._permission = value; + } + public resetPermission() { + this._permission = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionInput() { + return this._permission; + } + + // permissions - computed: true, optional: false, required: false + private _permissions = new DataHuaweicloudVpcepServicePermissionsPermissionsList(this, "permissions", false); + public get permissions() { + return this._permissions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + permission: cdktf.stringToTerraform(this._permission), + region: cdktf.stringToTerraform(this._region), + service_id: cdktf.stringToTerraform(this._serviceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission: { + value: cdktf.stringToHclTerraform(this._permission), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/README.md new file mode 100644 index 00000000..227bb278 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_service_summary` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_service_summary`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/index.ts new file mode 100644 index 00000000..bae9dd9e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-service-summary/index.ts @@ -0,0 +1,236 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepServiceSummaryConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the VPC endpoint service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary#endpoint_service_id DataHuaweicloudVpcepServiceSummary#endpoint_service_id} + */ + readonly endpointServiceId?: string; + /** + * Specifies the name of the VPC endpoint service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary#endpoint_service_name DataHuaweicloudVpcepServiceSummary#endpoint_service_name} + */ + readonly endpointServiceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary#id DataHuaweicloudVpcepServiceSummary#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary#region DataHuaweicloudVpcepServiceSummary#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary huaweicloud_vpcep_service_summary} +*/ +export class DataHuaweicloudVpcepServiceSummary extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_service_summary"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepServiceSummary resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepServiceSummary to import + * @param importFromId The id of the existing DataHuaweicloudVpcepServiceSummary that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepServiceSummary to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_service_summary", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_service_summary huaweicloud_vpcep_service_summary} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepServiceSummaryConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepServiceSummaryConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_service_summary', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointServiceId = config.endpointServiceId; + this._endpointServiceName = config.endpointServiceName; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_policy - computed: true, optional: false, required: false + public get enablePolicy() { + return this.getBooleanAttribute('enable_policy'); + } + + // endpoint_service_id - computed: false, optional: true, required: false + private _endpointServiceId?: string; + public get endpointServiceId() { + return this.getStringAttribute('endpoint_service_id'); + } + public set endpointServiceId(value: string) { + this._endpointServiceId = value; + } + public resetEndpointServiceId() { + this._endpointServiceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointServiceIdInput() { + return this._endpointServiceId; + } + + // endpoint_service_name - computed: false, optional: true, required: false + private _endpointServiceName?: string; + public get endpointServiceName() { + return this.getStringAttribute('endpoint_service_name'); + } + public set endpointServiceName(value: string) { + this._endpointServiceName = value; + } + public resetEndpointServiceName() { + this._endpointServiceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointServiceNameInput() { + return this._endpointServiceName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_charge - computed: true, optional: false, required: false + public get isCharge() { + return this.getBooleanAttribute('is_charge'); + } + + // public_border_group - computed: true, optional: false, required: false + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_service_id: cdktf.stringToTerraform(this._endpointServiceId), + endpoint_service_name: cdktf.stringToTerraform(this._endpointServiceName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_service_id: { + value: cdktf.stringToHclTerraform(this._endpointServiceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint_service_name: { + value: cdktf.stringToHclTerraform(this._endpointServiceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/README.md new file mode 100644 index 00000000..981b4062 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcep_services` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcep_services`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/index.ts new file mode 100644 index 00000000..269e4e14 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcep-services/index.ts @@ -0,0 +1,436 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcepServicesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#id DataHuaweicloudVpcepServices#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#public_border_group DataHuaweicloudVpcepServices#public_border_group} + */ + readonly publicBorderGroup?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#region DataHuaweicloudVpcepServices#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#server_type DataHuaweicloudVpcepServices#server_type} + */ + readonly serverType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#service_id DataHuaweicloudVpcepServices#service_id} + */ + readonly serviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#service_name DataHuaweicloudVpcepServices#service_name} + */ + readonly serviceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#status DataHuaweicloudVpcepServices#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudVpcepServicesEndpointServices { +} + +export function dataHuaweicloudVpcepServicesEndpointServicesToTerraform(struct?: DataHuaweicloudVpcepServicesEndpointServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcepServicesEndpointServicesToHclTerraform(struct?: DataHuaweicloudVpcepServicesEndpointServices): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcepServicesEndpointServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcepServicesEndpointServices | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcepServicesEndpointServices | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // approval_enabled - computed: true, optional: false, required: false + public get approvalEnabled() { + return this.getBooleanAttribute('approval_enabled'); + } + + // connection_count - computed: true, optional: false, required: false + public get connectionCount() { + return this.getNumberAttribute('connection_count'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enable_policy - computed: true, optional: false, required: false + public get enablePolicy() { + return this.getBooleanAttribute('enable_policy'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // public_border_group - computed: true, optional: false, required: false + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + + // server_type - computed: true, optional: false, required: false + public get serverType() { + return this.getStringAttribute('server_type'); + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // tcp_proxy - computed: true, optional: false, required: false + public get tcpProxy() { + return this.getStringAttribute('tcp_proxy'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpcepServicesEndpointServicesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcepServicesEndpointServicesOutputReference { + return new DataHuaweicloudVpcepServicesEndpointServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services huaweicloud_vpcep_services} +*/ +export class DataHuaweicloudVpcepServices extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_services"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcepServices resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcepServices to import + * @param importFromId The id of the existing DataHuaweicloudVpcepServices that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcepServices to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_services", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcep_services huaweicloud_vpcep_services} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcepServicesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcepServicesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_services', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._publicBorderGroup = config.publicBorderGroup; + this._region = config.region; + this._serverType = config.serverType; + this._serviceId = config.serviceId; + this._serviceName = config.serviceName; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint_services - computed: true, optional: false, required: false + private _endpointServices = new DataHuaweicloudVpcepServicesEndpointServicesList(this, "endpoint_services", false); + public get endpointServices() { + return this._endpointServices; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // public_border_group - computed: false, optional: true, required: false + private _publicBorderGroup?: string; + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + public set publicBorderGroup(value: string) { + this._publicBorderGroup = value; + } + public resetPublicBorderGroup() { + this._publicBorderGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicBorderGroupInput() { + return this._publicBorderGroup; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_type - computed: false, optional: true, required: false + private _serverType?: string; + public get serverType() { + return this.getStringAttribute('server_type'); + } + public set serverType(value: string) { + this._serverType = value; + } + public resetServerType() { + this._serverType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverTypeInput() { + return this._serverType; + } + + // service_id - computed: false, optional: true, required: false + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + public resetServiceId() { + this._serviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // service_name - computed: false, optional: true, required: false + private _serviceName?: string; + public get serviceName() { + return this.getStringAttribute('service_name'); + } + public set serviceName(value: string) { + this._serviceName = value; + } + public resetServiceName() { + this._serviceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceNameInput() { + return this._serviceName; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + public_border_group: cdktf.stringToTerraform(this._publicBorderGroup), + region: cdktf.stringToTerraform(this._region), + server_type: cdktf.stringToTerraform(this._serverType), + service_id: cdktf.stringToTerraform(this._serviceId), + service_name: cdktf.stringToTerraform(this._serviceName), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_border_group: { + value: cdktf.stringToHclTerraform(this._publicBorderGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_type: { + value: cdktf.stringToHclTerraform(this._serverType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_name: { + value: cdktf.stringToHclTerraform(this._serviceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/README.md new file mode 100644 index 00000000..3146bd89 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpcs` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpcs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/index.ts new file mode 100644 index 00000000..7fed1d9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpcs/index.ts @@ -0,0 +1,401 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpcsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#cidr DataHuaweicloudVpcs#cidr} + */ + readonly cidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#enterprise_project_id DataHuaweicloudVpcs#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#id DataHuaweicloudVpcs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#name DataHuaweicloudVpcs#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#region DataHuaweicloudVpcs#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#status DataHuaweicloudVpcs#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#tags DataHuaweicloudVpcs#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface DataHuaweicloudVpcsVpcs { +} + +export function dataHuaweicloudVpcsVpcsToTerraform(struct?: DataHuaweicloudVpcsVpcs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpcsVpcsToHclTerraform(struct?: DataHuaweicloudVpcsVpcs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpcsVpcsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpcsVpcs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpcsVpcs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cidr - computed: true, optional: false, required: false + public get cidr() { + return this.getStringAttribute('cidr'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // secondary_cidrs - computed: true, optional: false, required: false + public get secondaryCidrs() { + return this.getListAttribute('secondary_cidrs'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } +} + +export class DataHuaweicloudVpcsVpcsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpcsVpcsOutputReference { + return new DataHuaweicloudVpcsVpcsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs huaweicloud_vpcs} +*/ +export class DataHuaweicloudVpcs extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpcs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpcs to import + * @param importFromId The id of the existing DataHuaweicloudVpcs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpcs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpcs huaweicloud_vpcs} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpcsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpcsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpcs - computed: true, optional: false, required: false + private _vpcs = new DataHuaweicloudVpcsVpcsList(this, "vpcs", false); + public get vpcs() { + return this._vpcs; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/README.md new file mode 100644 index 00000000..00189a9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_access_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_access_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/index.ts new file mode 100644 index 00000000..f52c3695 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-access-policies/index.ts @@ -0,0 +1,289 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnAccessPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies#id DataHuaweicloudVpnAccessPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies#region DataHuaweicloudVpnAccessPolicies#region} + */ + readonly region?: string; + /** + * Specifies the ID of a VPN server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies#vpn_server_id DataHuaweicloudVpnAccessPolicies#vpn_server_id} + */ + readonly vpnServerId: string; +} +export interface DataHuaweicloudVpnAccessPoliciesAccessPolicies { +} + +export function dataHuaweicloudVpnAccessPoliciesAccessPoliciesToTerraform(struct?: DataHuaweicloudVpnAccessPoliciesAccessPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnAccessPoliciesAccessPoliciesToHclTerraform(struct?: DataHuaweicloudVpnAccessPoliciesAccessPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnAccessPoliciesAccessPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnAccessPoliciesAccessPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnAccessPoliciesAccessPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // dest_ip_cidrs - computed: true, optional: false, required: false + public get destIpCidrs() { + return this.getListAttribute('dest_ip_cidrs'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_group_id - computed: true, optional: false, required: false + public get userGroupId() { + return this.getStringAttribute('user_group_id'); + } + + // user_group_name - computed: true, optional: false, required: false + public get userGroupName() { + return this.getStringAttribute('user_group_name'); + } +} + +export class DataHuaweicloudVpnAccessPoliciesAccessPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnAccessPoliciesAccessPoliciesOutputReference { + return new DataHuaweicloudVpnAccessPoliciesAccessPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies huaweicloud_vpn_access_policies} +*/ +export class DataHuaweicloudVpnAccessPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_access_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnAccessPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnAccessPolicies to import + * @param importFromId The id of the existing DataHuaweicloudVpnAccessPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnAccessPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_access_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_access_policies huaweicloud_vpn_access_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnAccessPoliciesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnAccessPoliciesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_access_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpnServerId = config.vpnServerId; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_policies - computed: true, optional: false, required: false + private _accessPolicies = new DataHuaweicloudVpnAccessPoliciesAccessPoliciesList(this, "access_policies", false); + public get accessPolicies() { + return this._accessPolicies; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/README.md new file mode 100644 index 00000000..e34fdc16 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_connection_health_checks` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_connection_health_checks`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/index.ts new file mode 100644 index 00000000..82d6b0c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connection-health-checks/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnConnectionHealthChecksConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#connection_id DataHuaweicloudVpnConnectionHealthChecks#connection_id} + */ + readonly connectionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#destination_ip DataHuaweicloudVpnConnectionHealthChecks#destination_ip} + */ + readonly destinationIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#id DataHuaweicloudVpnConnectionHealthChecks#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#region DataHuaweicloudVpnConnectionHealthChecks#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#source_ip DataHuaweicloudVpnConnectionHealthChecks#source_ip} + */ + readonly sourceIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#status DataHuaweicloudVpnConnectionHealthChecks#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecks { +} + +export function dataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksToTerraform(struct?: DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksToHclTerraform(struct?: DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecks): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecks | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecks | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connection_id - computed: true, optional: false, required: false + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + + // destination_ip - computed: true, optional: false, required: false + public get destinationIp() { + return this.getStringAttribute('destination_ip'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // proto_type - computed: true, optional: false, required: false + public get protoType() { + return this.getStringAttribute('proto_type'); + } + + // source_ip - computed: true, optional: false, required: false + public get sourceIp() { + return this.getStringAttribute('source_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksOutputReference { + return new DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks huaweicloud_vpn_connection_health_checks} +*/ +export class DataHuaweicloudVpnConnectionHealthChecks extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_connection_health_checks"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnConnectionHealthChecks resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnConnectionHealthChecks to import + * @param importFromId The id of the existing DataHuaweicloudVpnConnectionHealthChecks that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnConnectionHealthChecks to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_connection_health_checks", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connection_health_checks huaweicloud_vpn_connection_health_checks} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnConnectionHealthChecksConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnConnectionHealthChecksConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_connection_health_checks', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._destinationIp = config.destinationIp; + this._id = config.id; + this._region = config.region; + this._sourceIp = config.sourceIp; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_health_checks - computed: true, optional: false, required: false + private _connectionHealthChecks = new DataHuaweicloudVpnConnectionHealthChecksConnectionHealthChecksList(this, "connection_health_checks", false); + public get connectionHealthChecks() { + return this._connectionHealthChecks; + } + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // destination_ip - computed: false, optional: true, required: false + private _destinationIp?: string; + public get destinationIp() { + return this.getStringAttribute('destination_ip'); + } + public set destinationIp(value: string) { + this._destinationIp = value; + } + public resetDestinationIp() { + this._destinationIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpInput() { + return this._destinationIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_ip - computed: false, optional: true, required: false + private _sourceIp?: string; + public get sourceIp() { + return this.getStringAttribute('source_ip'); + } + public set sourceIp(value: string) { + this._sourceIp = value; + } + public resetSourceIp() { + this._sourceIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpInput() { + return this._sourceIp; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + destination_ip: cdktf.stringToTerraform(this._destinationIp), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + source_ip: cdktf.stringToTerraform(this._sourceIp), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip: { + value: cdktf.stringToHclTerraform(this._destinationIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip: { + value: cdktf.stringToHclTerraform(this._sourceIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/README.md new file mode 100644 index 00000000..5099ab84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/index.ts new file mode 100644 index 00000000..ca87524a --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-connections/index.ts @@ -0,0 +1,887 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#connection_id DataHuaweicloudVpnConnections#connection_id} + */ + readonly connectionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#gateway_id DataHuaweicloudVpnConnections#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#gateway_ip DataHuaweicloudVpnConnections#gateway_ip} + */ + readonly gatewayIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#id DataHuaweicloudVpnConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#name DataHuaweicloudVpnConnections#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#region DataHuaweicloudVpnConnections#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#status DataHuaweicloudVpnConnections#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#vpn_type DataHuaweicloudVpnConnections#vpn_type} + */ + readonly vpnType?: string; +} +export interface DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpd { +} + +export function dataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdToTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpd): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdToHclTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpd): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpd | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpd | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // interval - computed: true, optional: false, required: false + public get interval() { + return this.getNumberAttribute('interval'); + } + + // msg - computed: true, optional: false, required: false + public get msg() { + return this.getStringAttribute('msg'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } +} + +export class DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdOutputReference { + return new DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnConnectionsConnectionsIkepolicy { +} + +export function dataHuaweicloudVpnConnectionsConnectionsIkepolicyToTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsIkepolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnConnectionsConnectionsIkepolicyToHclTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsIkepolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnConnectionsConnectionsIkepolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnConnectionsConnectionsIkepolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnConnectionsConnectionsIkepolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authentication_algorithm - computed: true, optional: false, required: false + public get authenticationAlgorithm() { + return this.getStringAttribute('authentication_algorithm'); + } + + // authentication_method - computed: true, optional: false, required: false + public get authenticationMethod() { + return this.getStringAttribute('authentication_method'); + } + + // dh_group - computed: true, optional: false, required: false + public get dhGroup() { + return this.getStringAttribute('dh_group'); + } + + // dpd - computed: true, optional: false, required: false + private _dpd = new DataHuaweicloudVpnConnectionsConnectionsIkepolicyDpdList(this, "dpd", false); + public get dpd() { + return this._dpd; + } + + // encryption_algorithm - computed: true, optional: false, required: false + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + + // ike_version - computed: true, optional: false, required: false + public get ikeVersion() { + return this.getStringAttribute('ike_version'); + } + + // lifetime_seconds - computed: true, optional: false, required: false + public get lifetimeSeconds() { + return this.getNumberAttribute('lifetime_seconds'); + } + + // local_id - computed: true, optional: false, required: false + public get localId() { + return this.getStringAttribute('local_id'); + } + + // local_id_type - computed: true, optional: false, required: false + public get localIdType() { + return this.getStringAttribute('local_id_type'); + } + + // peer_id - computed: true, optional: false, required: false + public get peerId() { + return this.getStringAttribute('peer_id'); + } + + // peer_id_type - computed: true, optional: false, required: false + public get peerIdType() { + return this.getStringAttribute('peer_id_type'); + } + + // phase1_negotiation_mode - computed: true, optional: false, required: false + public get phase1NegotiationMode() { + return this.getStringAttribute('phase1_negotiation_mode'); + } +} + +export class DataHuaweicloudVpnConnectionsConnectionsIkepolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnConnectionsConnectionsIkepolicyOutputReference { + return new DataHuaweicloudVpnConnectionsConnectionsIkepolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnConnectionsConnectionsIpsecpolicy { +} + +export function dataHuaweicloudVpnConnectionsConnectionsIpsecpolicyToTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsIpsecpolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnConnectionsConnectionsIpsecpolicyToHclTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsIpsecpolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnConnectionsConnectionsIpsecpolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnConnectionsConnectionsIpsecpolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnConnectionsConnectionsIpsecpolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authentication_algorithm - computed: true, optional: false, required: false + public get authenticationAlgorithm() { + return this.getStringAttribute('authentication_algorithm'); + } + + // encapsulation_mode - computed: true, optional: false, required: false + public get encapsulationMode() { + return this.getStringAttribute('encapsulation_mode'); + } + + // encryption_algorithm - computed: true, optional: false, required: false + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + + // lifetime_seconds - computed: true, optional: false, required: false + public get lifetimeSeconds() { + return this.getNumberAttribute('lifetime_seconds'); + } + + // pfs - computed: true, optional: false, required: false + public get pfs() { + return this.getStringAttribute('pfs'); + } + + // transform_protocol - computed: true, optional: false, required: false + public get transformProtocol() { + return this.getStringAttribute('transform_protocol'); + } +} + +export class DataHuaweicloudVpnConnectionsConnectionsIpsecpolicyList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnConnectionsConnectionsIpsecpolicyOutputReference { + return new DataHuaweicloudVpnConnectionsConnectionsIpsecpolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnConnectionsConnectionsPolicyRules { +} + +export function dataHuaweicloudVpnConnectionsConnectionsPolicyRulesToTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsPolicyRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnConnectionsConnectionsPolicyRulesToHclTerraform(struct?: DataHuaweicloudVpnConnectionsConnectionsPolicyRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnConnectionsConnectionsPolicyRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnConnectionsConnectionsPolicyRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnConnectionsConnectionsPolicyRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getListAttribute('destination'); + } + + // rule_index - computed: true, optional: false, required: false + public get ruleIndex() { + return this.getNumberAttribute('rule_index'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } +} + +export class DataHuaweicloudVpnConnectionsConnectionsPolicyRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnConnectionsConnectionsPolicyRulesOutputReference { + return new DataHuaweicloudVpnConnectionsConnectionsPolicyRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnConnectionsConnections { +} + +export function dataHuaweicloudVpnConnectionsConnectionsToTerraform(struct?: DataHuaweicloudVpnConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudVpnConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connection_monitor_id - computed: true, optional: false, required: false + public get connectionMonitorId() { + return this.getStringAttribute('connection_monitor_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // customer_gateway_id - computed: true, optional: false, required: false + public get customerGatewayId() { + return this.getStringAttribute('customer_gateway_id'); + } + + // enable_nqa - computed: true, optional: false, required: false + public get enableNqa() { + return this.getBooleanAttribute('enable_nqa'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // gateway_ip - computed: true, optional: false, required: false + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + + // ha_role - computed: true, optional: false, required: false + public get haRole() { + return this.getStringAttribute('ha_role'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ikepolicy - computed: true, optional: false, required: false + private _ikepolicy = new DataHuaweicloudVpnConnectionsConnectionsIkepolicyList(this, "ikepolicy", false); + public get ikepolicy() { + return this._ikepolicy; + } + + // ipsecpolicy - computed: true, optional: false, required: false + private _ipsecpolicy = new DataHuaweicloudVpnConnectionsConnectionsIpsecpolicyList(this, "ipsecpolicy", false); + public get ipsecpolicy() { + return this._ipsecpolicy; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // peer_subnets - computed: true, optional: false, required: false + public get peerSubnets() { + return this.getListAttribute('peer_subnets'); + } + + // policy_rules - computed: true, optional: false, required: false + private _policyRules = new DataHuaweicloudVpnConnectionsConnectionsPolicyRulesList(this, "policy_rules", false); + public get policyRules() { + return this._policyRules; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tunnel_local_address - computed: true, optional: false, required: false + public get tunnelLocalAddress() { + return this.getStringAttribute('tunnel_local_address'); + } + + // tunnel_peer_address - computed: true, optional: false, required: false + public get tunnelPeerAddress() { + return this.getStringAttribute('tunnel_peer_address'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpn_type - computed: true, optional: false, required: false + public get vpnType() { + return this.getStringAttribute('vpn_type'); + } +} + +export class DataHuaweicloudVpnConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnConnectionsConnectionsOutputReference { + return new DataHuaweicloudVpnConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections huaweicloud_vpn_connections} +*/ +export class DataHuaweicloudVpnConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnConnections to import + * @param importFromId The id of the existing DataHuaweicloudVpnConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_connections huaweicloud_vpn_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnConnectionsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnConnectionsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._gatewayId = config.gatewayId; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._vpnType = config.vpnType; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudVpnConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // gateway_ip - computed: false, optional: true, required: false + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + public resetGatewayIp() { + this._gatewayIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // vpn_type - computed: false, optional: true, required: false + private _vpnType?: string; + public get vpnType() { + return this.getStringAttribute('vpn_type'); + } + public set vpnType(value: string) { + this._vpnType = value; + } + public resetVpnType() { + this._vpnType = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpnTypeInput() { + return this._vpnType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + vpn_type: cdktf.stringToTerraform(this._vpnType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_type: { + value: cdktf.stringToHclTerraform(this._vpnType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/README.md new file mode 100644 index 00000000..c6449601 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_customer_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_customer_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/index.ts new file mode 100644 index 00000000..52c4aa6b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-customer-gateways/index.ts @@ -0,0 +1,511 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnCustomerGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#asn DataHuaweicloudVpnCustomerGateways#asn} + */ + readonly asn?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#customer_gateway_id DataHuaweicloudVpnCustomerGateways#customer_gateway_id} + */ + readonly customerGatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#id DataHuaweicloudVpnCustomerGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#ip DataHuaweicloudVpnCustomerGateways#ip} + */ + readonly ip?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#name DataHuaweicloudVpnCustomerGateways#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#region DataHuaweicloudVpnCustomerGateways#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#route_mode DataHuaweicloudVpnCustomerGateways#route_mode} + */ + readonly routeMode?: string; +} +export interface DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificate { +} + +export function dataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateToTerraform(struct?: DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateToHclTerraform(struct?: DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificate | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificate | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // is_updatable - computed: true, optional: false, required: false + public get isUpdatable() { + return this.getBooleanAttribute('is_updatable'); + } + + // issuer - computed: true, optional: false, required: false + public get issuer() { + return this.getStringAttribute('issuer'); + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // subject - computed: true, optional: false, required: false + public get subject() { + return this.getStringAttribute('subject'); + } +} + +export class DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateOutputReference { + return new DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnCustomerGatewaysCustomerGateways { +} + +export function dataHuaweicloudVpnCustomerGatewaysCustomerGatewaysToTerraform(struct?: DataHuaweicloudVpnCustomerGatewaysCustomerGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnCustomerGatewaysCustomerGatewaysToHclTerraform(struct?: DataHuaweicloudVpnCustomerGatewaysCustomerGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnCustomerGatewaysCustomerGateways | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnCustomerGatewaysCustomerGateways | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // asn - computed: true, optional: false, required: false + public get asn() { + return this.getNumberAttribute('asn'); + } + + // ca_certificate - computed: true, optional: false, required: false + private _caCertificate = new DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysCaCertificateList(this, "ca_certificate", false); + public get caCertificate() { + return this._caCertificate; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // id_type - computed: true, optional: false, required: false + public get idType() { + return this.getStringAttribute('id_type'); + } + + // id_value - computed: true, optional: false, required: false + public get idValue() { + return this.getStringAttribute('id_value'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // route_mode - computed: true, optional: false, required: false + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysOutputReference { + return new DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways huaweicloud_vpn_customer_gateways} +*/ +export class DataHuaweicloudVpnCustomerGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_customer_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnCustomerGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnCustomerGateways to import + * @param importFromId The id of the existing DataHuaweicloudVpnCustomerGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnCustomerGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_customer_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_customer_gateways huaweicloud_vpn_customer_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnCustomerGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnCustomerGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_customer_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._asn = config.asn; + this._customerGatewayId = config.customerGatewayId; + this._id = config.id; + this._ip = config.ip; + this._name = config.name; + this._region = config.region; + this._routeMode = config.routeMode; + } + + // ========== + // ATTRIBUTES + // ========== + + // asn - computed: false, optional: true, required: false + private _asn?: number; + public get asn() { + return this.getNumberAttribute('asn'); + } + public set asn(value: number) { + this._asn = value; + } + public resetAsn() { + this._asn = undefined; + } + // Temporarily expose input value. Use with caution. + public get asnInput() { + return this._asn; + } + + // customer_gateway_id - computed: false, optional: true, required: false + private _customerGatewayId?: string; + public get customerGatewayId() { + return this.getStringAttribute('customer_gateway_id'); + } + public set customerGatewayId(value: string) { + this._customerGatewayId = value; + } + public resetCustomerGatewayId() { + this._customerGatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get customerGatewayIdInput() { + return this._customerGatewayId; + } + + // customer_gateways - computed: true, optional: false, required: false + private _customerGateways = new DataHuaweicloudVpnCustomerGatewaysCustomerGatewaysList(this, "customer_gateways", false); + public get customerGateways() { + return this._customerGateways; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip - computed: false, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_mode - computed: false, optional: true, required: false + private _routeMode?: string; + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + public set routeMode(value: string) { + this._routeMode = value; + } + public resetRouteMode() { + this._routeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeModeInput() { + return this._routeMode; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + asn: cdktf.numberToTerraform(this._asn), + customer_gateway_id: cdktf.stringToTerraform(this._customerGatewayId), + id: cdktf.stringToTerraform(this._id), + ip: cdktf.stringToTerraform(this._ip), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + route_mode: cdktf.stringToTerraform(this._routeMode), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + asn: { + value: cdktf.numberToHclTerraform(this._asn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + customer_gateway_id: { + value: cdktf.stringToHclTerraform(this._customerGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(this._ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_mode: { + value: cdktf.stringToHclTerraform(this._routeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/README.md new file mode 100644 index 00000000..c91d34a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_gateway_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_gateway_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/index.ts new file mode 100644 index 00000000..c46361c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateway-availability-zones/index.ts @@ -0,0 +1,206 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnGatewayAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the attachment type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones#attachment_type DataHuaweicloudVpnGatewayAvailabilityZones#attachment_type} + */ + readonly attachmentType?: string; + /** + * Specifies the flavor name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones#flavor DataHuaweicloudVpnGatewayAvailabilityZones#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones#id DataHuaweicloudVpnGatewayAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones#region DataHuaweicloudVpnGatewayAvailabilityZones#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones huaweicloud_vpn_gateway_availability_zones} +*/ +export class DataHuaweicloudVpnGatewayAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_gateway_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnGatewayAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnGatewayAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudVpnGatewayAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnGatewayAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_gateway_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateway_availability_zones huaweicloud_vpn_gateway_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnGatewayAvailabilityZonesConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnGatewayAvailabilityZonesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_gateway_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentType = config.attachmentType; + this._flavor = config.flavor; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_type - computed: false, optional: true, required: false + private _attachmentType?: string; + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + public set attachmentType(value: string) { + this._attachmentType = value; + } + public resetAttachmentType() { + this._attachmentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentTypeInput() { + return this._attachmentType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // names - computed: true, optional: false, required: false + public get names() { + return this.getListAttribute('names'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_type: cdktf.stringToTerraform(this._attachmentType), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_type: { + value: cdktf.stringToHclTerraform(this._attachmentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/README.md new file mode 100644 index 00000000..8b0a527b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/index.ts new file mode 100644 index 00000000..4bb998ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-gateways/index.ts @@ -0,0 +1,611 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the attachment type of the gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#attachment_type DataHuaweicloudVpnGateways#attachment_type} + */ + readonly attachmentType?: string; + /** + * Specifies the enterprise project ID of the gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#enterprise_project_id DataHuaweicloudVpnGateways#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the ID of the gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#gateway_id DataHuaweicloudVpnGateways#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#id DataHuaweicloudVpnGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#name DataHuaweicloudVpnGateways#name} + */ + readonly name?: string; + /** + * Specifies the network type of the gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#network_type DataHuaweicloudVpnGateways#network_type} + */ + readonly networkType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#region DataHuaweicloudVpnGateways#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudVpnGatewaysGatewaysEips { +} + +export function dataHuaweicloudVpnGatewaysGatewaysEipsToTerraform(struct?: DataHuaweicloudVpnGatewaysGatewaysEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnGatewaysGatewaysEipsToHclTerraform(struct?: DataHuaweicloudVpnGatewaysGatewaysEips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnGatewaysGatewaysEipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnGatewaysGatewaysEips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnGatewaysGatewaysEips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_billing_info - computed: true, optional: false, required: false + public get bandwidthBillingInfo() { + return this.getStringAttribute('bandwidth_billing_info'); + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // billing_info - computed: true, optional: false, required: false + public get billingInfo() { + return this.getStringAttribute('billing_info'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpnGatewaysGatewaysEipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnGatewaysGatewaysEipsOutputReference { + return new DataHuaweicloudVpnGatewaysGatewaysEipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnGatewaysGateways { +} + +export function dataHuaweicloudVpnGatewaysGatewaysToTerraform(struct?: DataHuaweicloudVpnGatewaysGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnGatewaysGatewaysToHclTerraform(struct?: DataHuaweicloudVpnGatewaysGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnGatewaysGatewaysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnGatewaysGateways | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnGatewaysGateways | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_private_ips - computed: true, optional: false, required: false + public get accessPrivateIps() { + return this.getListAttribute('access_private_ips'); + } + + // access_subnet_id - computed: true, optional: false, required: false + public get accessSubnetId() { + return this.getStringAttribute('access_subnet_id'); + } + + // access_vpc_id - computed: true, optional: false, required: false + public get accessVpcId() { + return this.getStringAttribute('access_vpc_id'); + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // bgp_asn - computed: true, optional: false, required: false + public get bgpAsn() { + return this.getNumberAttribute('bgp_asn'); + } + + // connect_subnet - computed: true, optional: false, required: false + public get connectSubnet() { + return this.getStringAttribute('connect_subnet'); + } + + // connection_number - computed: true, optional: false, required: false + public get connectionNumber() { + return this.getNumberAttribute('connection_number'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // eips - computed: true, optional: false, required: false + private _eips = new DataHuaweicloudVpnGatewaysGatewaysEipsList(this, "eips", false); + public get eips() { + return this._eips; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // er_attachment_id - computed: true, optional: false, required: false + public get erAttachmentId() { + return this.getStringAttribute('er_attachment_id'); + } + + // er_id - computed: true, optional: false, required: false + public get erId() { + return this.getStringAttribute('er_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // ha_mode - computed: true, optional: false, required: false + public get haMode() { + return this.getStringAttribute('ha_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_subnets - computed: true, optional: false, required: false + public get localSubnets() { + return this.getListAttribute('local_subnets'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // network_type - computed: true, optional: false, required: false + public get networkType() { + return this.getStringAttribute('network_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // used_connection_group - computed: true, optional: false, required: false + public get usedConnectionGroup() { + return this.getNumberAttribute('used_connection_group'); + } + + // used_connection_number - computed: true, optional: false, required: false + public get usedConnectionNumber() { + return this.getNumberAttribute('used_connection_number'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpnGatewaysGatewaysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnGatewaysGatewaysOutputReference { + return new DataHuaweicloudVpnGatewaysGatewaysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways huaweicloud_vpn_gateways} +*/ +export class DataHuaweicloudVpnGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnGateways to import + * @param importFromId The id of the existing DataHuaweicloudVpnGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_gateways huaweicloud_vpn_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentType = config.attachmentType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._name = config.name; + this._networkType = config.networkType; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_type - computed: false, optional: true, required: false + private _attachmentType?: string; + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + public set attachmentType(value: string) { + this._attachmentType = value; + } + public resetAttachmentType() { + this._attachmentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentTypeInput() { + return this._attachmentType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // gateways - computed: true, optional: false, required: false + private _gateways = new DataHuaweicloudVpnGatewaysGatewaysList(this, "gateways", false); + public get gateways() { + return this._gateways; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_type - computed: false, optional: true, required: false + private _networkType?: string; + public get networkType() { + return this.getStringAttribute('network_type'); + } + public set networkType(value: string) { + this._networkType = value; + } + public resetNetworkType() { + this._networkType = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkTypeInput() { + return this._networkType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_type: cdktf.stringToTerraform(this._attachmentType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + network_type: cdktf.stringToTerraform(this._networkType), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_type: { + value: cdktf.stringToHclTerraform(this._attachmentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_type: { + value: cdktf.stringToHclTerraform(this._networkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/README.md new file mode 100644 index 00000000..f825cecc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_p2c_gateway_availability_zones` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_p2c_gateway_availability_zones`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/index.ts new file mode 100644 index 00000000..67626d13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-availability-zones/index.ts @@ -0,0 +1,181 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnP2CGatewayAvailabilityZonesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies a flavor. The value can be **Professional1**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones#flavor DataHuaweicloudVpnP2CGatewayAvailabilityZones#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones#id DataHuaweicloudVpnP2CGatewayAvailabilityZones#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones#region DataHuaweicloudVpnP2CGatewayAvailabilityZones#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones huaweicloud_vpn_p2c_gateway_availability_zones} +*/ +export class DataHuaweicloudVpnP2CGatewayAvailabilityZones extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_p2c_gateway_availability_zones"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnP2CGatewayAvailabilityZones resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnP2CGatewayAvailabilityZones to import + * @param importFromId The id of the existing DataHuaweicloudVpnP2CGatewayAvailabilityZones that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnP2CGatewayAvailabilityZones to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_p2c_gateway_availability_zones", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_availability_zones huaweicloud_vpn_p2c_gateway_availability_zones} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnP2CGatewayAvailabilityZonesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnP2CGatewayAvailabilityZonesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_p2c_gateway_availability_zones', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._flavor = config.flavor; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zones - computed: true, optional: false, required: false + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/README.md new file mode 100644 index 00000000..4c37c7b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_p2c_gateway_connections` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_p2c_gateway_connections`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/index.ts new file mode 100644 index 00000000..c8a4f32f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateway-connections/index.ts @@ -0,0 +1,299 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnP2CGatewayConnectionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections#id DataHuaweicloudVpnP2CGatewayConnections#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a P2C VPN gateway instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections#p2c_gateway_id DataHuaweicloudVpnP2CGatewayConnections#p2c_gateway_id} + */ + readonly p2CGatewayId: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections#region DataHuaweicloudVpnP2CGatewayConnections#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudVpnP2CGatewayConnectionsConnections { +} + +export function dataHuaweicloudVpnP2CGatewayConnectionsConnectionsToTerraform(struct?: DataHuaweicloudVpnP2CGatewayConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnP2CGatewayConnectionsConnectionsToHclTerraform(struct?: DataHuaweicloudVpnP2CGatewayConnectionsConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnP2CGatewayConnectionsConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnP2CGatewayConnectionsConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnP2CGatewayConnectionsConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_ip - computed: true, optional: false, required: false + public get clientIp() { + return this.getStringAttribute('client_ip'); + } + + // client_user_name - computed: true, optional: false, required: false + public get clientUserName() { + return this.getStringAttribute('client_user_name'); + } + + // client_virtual_ip - computed: true, optional: false, required: false + public get clientVirtualIp() { + return this.getStringAttribute('client_virtual_ip'); + } + + // connection_established_time - computed: true, optional: false, required: false + public get connectionEstablishedTime() { + return this.getStringAttribute('connection_established_time'); + } + + // connection_id - computed: true, optional: false, required: false + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + + // inbound_bytes - computed: true, optional: false, required: false + public get inboundBytes() { + return this.getNumberAttribute('inbound_bytes'); + } + + // inbound_packets - computed: true, optional: false, required: false + public get inboundPackets() { + return this.getNumberAttribute('inbound_packets'); + } + + // outbound_bytes - computed: true, optional: false, required: false + public get outboundBytes() { + return this.getNumberAttribute('outbound_bytes'); + } + + // outbound_packets - computed: true, optional: false, required: false + public get outboundPackets() { + return this.getNumberAttribute('outbound_packets'); + } + + // timestamp - computed: true, optional: false, required: false + public get timestamp() { + return this.getStringAttribute('timestamp'); + } +} + +export class DataHuaweicloudVpnP2CGatewayConnectionsConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnP2CGatewayConnectionsConnectionsOutputReference { + return new DataHuaweicloudVpnP2CGatewayConnectionsConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections huaweicloud_vpn_p2c_gateway_connections} +*/ +export class DataHuaweicloudVpnP2CGatewayConnections extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_p2c_gateway_connections"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnP2CGatewayConnections resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnP2CGatewayConnections to import + * @param importFromId The id of the existing DataHuaweicloudVpnP2CGatewayConnections that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnP2CGatewayConnections to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_p2c_gateway_connections", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateway_connections huaweicloud_vpn_p2c_gateway_connections} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnP2CGatewayConnectionsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnP2CGatewayConnectionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_p2c_gateway_connections', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._p2CGatewayId = config.p2CGatewayId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // connections - computed: true, optional: false, required: false + private _connections = new DataHuaweicloudVpnP2CGatewayConnectionsConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // p2c_gateway_id - computed: false, optional: false, required: true + private _p2CGatewayId?: string; + public get p2CGatewayId() { + return this.getStringAttribute('p2c_gateway_id'); + } + public set p2CGatewayId(value: string) { + this._p2CGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get p2CGatewayIdInput() { + return this._p2CGatewayId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + p2c_gateway_id: cdktf.stringToTerraform(this._p2CGatewayId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + p2c_gateway_id: { + value: cdktf.stringToHclTerraform(this._p2CGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/README.md new file mode 100644 index 00000000..e8f90702 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_p2c_gateways` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_p2c_gateways`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/index.ts new file mode 100644 index 00000000..ae248b08 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-p2c-gateways/index.ts @@ -0,0 +1,509 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnP2CGatewaysConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways#id DataHuaweicloudVpnP2CGateways#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways#region DataHuaweicloudVpnP2CGateways#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEip { +} + +export function dataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipToTerraform(struct?: DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipToHclTerraform(struct?: DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth_billing_info - computed: true, optional: false, required: false + public get bandwidthBillingInfo() { + return this.getStringAttribute('bandwidth_billing_info'); + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_billing_info - computed: true, optional: false, required: false + public get ipBillingInfo() { + return this.getStringAttribute('ip_billing_info'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipOutputReference { + return new DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTags { +} + +export function dataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsToTerraform(struct?: DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsToHclTerraform(struct?: DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTags): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTags | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTags | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // key - computed: true, optional: false, required: false + public get key() { + return this.getStringAttribute('key'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } +} + +export class DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsOutputReference { + return new DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnP2CGatewaysP2CVpnGateways { +} + +export function dataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysToTerraform(struct?: DataHuaweicloudVpnP2CGatewaysP2CVpnGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysToHclTerraform(struct?: DataHuaweicloudVpnP2CGatewaysP2CVpnGateways): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnP2CGatewaysP2CVpnGateways | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnP2CGatewaysP2CVpnGateways | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone_ids - computed: true, optional: false, required: false + public get availabilityZoneIds() { + return this.getListAttribute('availability_zone_ids'); + } + + // connect_subnet - computed: true, optional: false, required: false + public get connectSubnet() { + return this.getStringAttribute('connect_subnet'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_connection_number - computed: true, optional: false, required: false + public get currentConnectionNumber() { + return this.getNumberAttribute('current_connection_number'); + } + + // eip - computed: true, optional: false, required: false + private _eip = new DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysEipList(this, "eip", false); + public get eip() { + return this._eip; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor - computed: true, optional: false, required: false + public get flavor() { + return this.getStringAttribute('flavor'); + } + + // frozen_effect - computed: true, optional: false, required: false + public get frozenEffect() { + return this.getNumberAttribute('frozen_effect'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_connection_number - computed: true, optional: false, required: false + public get maxConnectionNumber() { + return this.getNumberAttribute('max_connection_number'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysTagsList(this, "tags", false); + public get tags() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysOutputReference { + return new DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways huaweicloud_vpn_p2c_gateways} +*/ +export class DataHuaweicloudVpnP2CGateways extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_p2c_gateways"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnP2CGateways resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnP2CGateways to import + * @param importFromId The id of the existing DataHuaweicloudVpnP2CGateways that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnP2CGateways to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_p2c_gateways", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_p2c_gateways huaweicloud_vpn_p2c_gateways} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnP2CGatewaysConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnP2CGatewaysConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_p2c_gateways', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // p2c_vpn_gateways - computed: true, optional: false, required: false + private _p2CVpnGateways = new DataHuaweicloudVpnP2CGatewaysP2CVpnGatewaysList(this, "p2c_vpn_gateways", false); + public get p2CVpnGateways() { + return this._p2CVpnGateways; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/README.md new file mode 100644 index 00000000..b4e86742 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_servers` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_servers`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/index.ts new file mode 100644 index 00000000..f8240591 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-servers/index.ts @@ -0,0 +1,600 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnServersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers#id DataHuaweicloudVpnServers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers#region DataHuaweicloudVpnServers#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudVpnServersVpnServersClientCaCertificates { +} + +export function dataHuaweicloudVpnServersVpnServersClientCaCertificatesToTerraform(struct?: DataHuaweicloudVpnServersVpnServersClientCaCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnServersVpnServersClientCaCertificatesToHclTerraform(struct?: DataHuaweicloudVpnServersVpnServersClientCaCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnServersVpnServersClientCaCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnServersVpnServersClientCaCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnServersVpnServersClientCaCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // issuer - computed: true, optional: false, required: false + public get issuer() { + return this.getStringAttribute('issuer'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // subject - computed: true, optional: false, required: false + public get subject() { + return this.getStringAttribute('subject'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpnServersVpnServersClientCaCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnServersVpnServersClientCaCertificatesOutputReference { + return new DataHuaweicloudVpnServersVpnServersClientCaCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnServersVpnServersServerCertificate { +} + +export function dataHuaweicloudVpnServersVpnServersServerCertificateToTerraform(struct?: DataHuaweicloudVpnServersVpnServersServerCertificate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnServersVpnServersServerCertificateToHclTerraform(struct?: DataHuaweicloudVpnServersVpnServersServerCertificate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnServersVpnServersServerCertificateOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnServersVpnServersServerCertificate | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnServersVpnServersServerCertificate | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // issuer - computed: true, optional: false, required: false + public get issuer() { + return this.getStringAttribute('issuer'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // subject - computed: true, optional: false, required: false + public get subject() { + return this.getStringAttribute('subject'); + } +} + +export class DataHuaweicloudVpnServersVpnServersServerCertificateList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnServersVpnServersServerCertificateOutputReference { + return new DataHuaweicloudVpnServersVpnServersServerCertificateOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnServersVpnServersSslOptions { +} + +export function dataHuaweicloudVpnServersVpnServersSslOptionsToTerraform(struct?: DataHuaweicloudVpnServersVpnServersSslOptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnServersVpnServersSslOptionsToHclTerraform(struct?: DataHuaweicloudVpnServersVpnServersSslOptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnServersVpnServersSslOptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnServersVpnServersSslOptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnServersVpnServersSslOptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // authentication_algorithm - computed: true, optional: false, required: false + public get authenticationAlgorithm() { + return this.getStringAttribute('authentication_algorithm'); + } + + // encryption_algorithm - computed: true, optional: false, required: false + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + + // is_compressed - computed: true, optional: false, required: false + public get isCompressed() { + return this.getBooleanAttribute('is_compressed'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } +} + +export class DataHuaweicloudVpnServersVpnServersSslOptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnServersVpnServersSslOptionsOutputReference { + return new DataHuaweicloudVpnServersVpnServersSslOptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudVpnServersVpnServers { +} + +export function dataHuaweicloudVpnServersVpnServersToTerraform(struct?: DataHuaweicloudVpnServersVpnServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnServersVpnServersToHclTerraform(struct?: DataHuaweicloudVpnServersVpnServers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnServersVpnServersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnServersVpnServers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnServersVpnServers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_auth_type - computed: true, optional: false, required: false + public get clientAuthType() { + return this.getStringAttribute('client_auth_type'); + } + + // client_ca_certificates - computed: true, optional: false, required: false + private _clientCaCertificates = new DataHuaweicloudVpnServersVpnServersClientCaCertificatesList(this, "client_ca_certificates", false); + public get clientCaCertificates() { + return this._clientCaCertificates; + } + + // client_cidr - computed: true, optional: false, required: false + public get clientCidr() { + return this.getStringAttribute('client_cidr'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_subnets - computed: true, optional: false, required: false + public get localSubnets() { + return this.getListAttribute('local_subnets'); + } + + // p2c_vgw_id - computed: true, optional: false, required: false + public get p2CVgwId() { + return this.getStringAttribute('p2c_vgw_id'); + } + + // server_certificate - computed: true, optional: false, required: false + private _serverCertificate = new DataHuaweicloudVpnServersVpnServersServerCertificateList(this, "server_certificate", false); + public get serverCertificate() { + return this._serverCertificate; + } + + // ssl_options - computed: true, optional: false, required: false + private _sslOptions = new DataHuaweicloudVpnServersVpnServersSslOptionsList(this, "ssl_options", false); + public get sslOptions() { + return this._sslOptions; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tunnel_protocol - computed: true, optional: false, required: false + public get tunnelProtocol() { + return this.getStringAttribute('tunnel_protocol'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataHuaweicloudVpnServersVpnServersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnServersVpnServersOutputReference { + return new DataHuaweicloudVpnServersVpnServersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers huaweicloud_vpn_servers} +*/ +export class DataHuaweicloudVpnServers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_servers"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnServers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnServers to import + * @param importFromId The id of the existing DataHuaweicloudVpnServers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnServers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_servers", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_servers huaweicloud_vpn_servers} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnServersConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnServersConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_servers', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpn_servers - computed: true, optional: false, required: false + private _vpnServers = new DataHuaweicloudVpnServersVpnServersList(this, "vpn_servers", false); + public get vpnServers() { + return this._vpnServers; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/README.md new file mode 100644 index 00000000..b88fbda7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_user_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_user_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/index.ts new file mode 100644 index 00000000..cc40c767 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-user-groups/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnUserGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups#id DataHuaweicloudVpnUserGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups#region DataHuaweicloudVpnUserGroups#region} + */ + readonly region?: string; + /** + * Specifies the ID of a VPN server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups#vpn_server_id DataHuaweicloudVpnUserGroups#vpn_server_id} + */ + readonly vpnServerId: string; +} +export interface DataHuaweicloudVpnUserGroupsUserGroups { +} + +export function dataHuaweicloudVpnUserGroupsUserGroupsToTerraform(struct?: DataHuaweicloudVpnUserGroupsUserGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnUserGroupsUserGroupsToHclTerraform(struct?: DataHuaweicloudVpnUserGroupsUserGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnUserGroupsUserGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnUserGroupsUserGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnUserGroupsUserGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_number - computed: true, optional: false, required: false + public get userNumber() { + return this.getNumberAttribute('user_number'); + } +} + +export class DataHuaweicloudVpnUserGroupsUserGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnUserGroupsUserGroupsOutputReference { + return new DataHuaweicloudVpnUserGroupsUserGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups huaweicloud_vpn_user_groups} +*/ +export class DataHuaweicloudVpnUserGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_user_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnUserGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnUserGroups to import + * @param importFromId The id of the existing DataHuaweicloudVpnUserGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnUserGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_user_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_user_groups huaweicloud_vpn_user_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnUserGroupsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnUserGroupsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_user_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpnServerId = config.vpnServerId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_groups - computed: true, optional: false, required: false + private _userGroups = new DataHuaweicloudVpnUserGroupsUserGroupsList(this, "user_groups", false); + public get userGroups() { + return this._userGroups; + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/README.md new file mode 100644 index 00000000..48aa0d57 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_vpn_users` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_vpn_users`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/index.ts new file mode 100644 index 00000000..6e73a35c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-vpn-users/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudVpnUsersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users#id DataHuaweicloudVpnUsers#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users#region DataHuaweicloudVpnUsers#region} + */ + readonly region?: string; + /** + * Specifies the ID of a VPN server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users#vpn_server_id DataHuaweicloudVpnUsers#vpn_server_id} + */ + readonly vpnServerId: string; +} +export interface DataHuaweicloudVpnUsersUsers { +} + +export function dataHuaweicloudVpnUsersUsersToTerraform(struct?: DataHuaweicloudVpnUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudVpnUsersUsersToHclTerraform(struct?: DataHuaweicloudVpnUsersUsers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudVpnUsersUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudVpnUsersUsers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudVpnUsersUsers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_group_id - computed: true, optional: false, required: false + public get userGroupId() { + return this.getStringAttribute('user_group_id'); + } + + // user_group_name - computed: true, optional: false, required: false + public get userGroupName() { + return this.getStringAttribute('user_group_name'); + } +} + +export class DataHuaweicloudVpnUsersUsersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudVpnUsersUsersOutputReference { + return new DataHuaweicloudVpnUsersUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users huaweicloud_vpn_users} +*/ +export class DataHuaweicloudVpnUsers extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_users"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudVpnUsers resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudVpnUsers to import + * @param importFromId The id of the existing DataHuaweicloudVpnUsers that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudVpnUsers to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_users", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/vpn_users huaweicloud_vpn_users} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudVpnUsersConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudVpnUsersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_users', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._vpnServerId = config.vpnServerId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // users - computed: true, optional: false, required: false + private _users = new DataHuaweicloudVpnUsersUsersList(this, "users", false); + public get users() { + return this._users; + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/README.md new file mode 100644 index 00000000..6c30a464 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_address_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_address_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/index.ts new file mode 100644 index 00000000..8f6300c0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-address-groups/index.ts @@ -0,0 +1,448 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafAddressGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups#enterprise_project_id DataHuaweicloudWafAddressGroups#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups#id DataHuaweicloudWafAddressGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP address or IP address ranges. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups#ip_address DataHuaweicloudWafAddressGroups#ip_address} + */ + readonly ipAddress?: string; + /** + * Specifies the name of the address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups#name DataHuaweicloudWafAddressGroups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups#region DataHuaweicloudWafAddressGroups#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafAddressGroupsGroupsRules { +} + +export function dataHuaweicloudWafAddressGroupsGroupsRulesToTerraform(struct?: DataHuaweicloudWafAddressGroupsGroupsRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafAddressGroupsGroupsRulesToHclTerraform(struct?: DataHuaweicloudWafAddressGroupsGroupsRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafAddressGroupsGroupsRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafAddressGroupsGroupsRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafAddressGroupsGroupsRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // policy_name - computed: true, optional: false, required: false + public get policyName() { + return this.getStringAttribute('policy_name'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // rule_name - computed: true, optional: false, required: false + public get ruleName() { + return this.getStringAttribute('rule_name'); + } +} + +export class DataHuaweicloudWafAddressGroupsGroupsRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafAddressGroupsGroupsRulesOutputReference { + return new DataHuaweicloudWafAddressGroupsGroupsRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafAddressGroupsGroups { +} + +export function dataHuaweicloudWafAddressGroupsGroupsToTerraform(struct?: DataHuaweicloudWafAddressGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafAddressGroupsGroupsToHclTerraform(struct?: DataHuaweicloudWafAddressGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafAddressGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafAddressGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafAddressGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // accept_count - computed: true, optional: false, required: false + public get acceptCount() { + return this.getNumberAttribute('accept_count'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_addresses - computed: true, optional: false, required: false + public get ipAddresses() { + return this.getStringAttribute('ip_addresses'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // process_status - computed: true, optional: false, required: false + public get processStatus() { + return this.getNumberAttribute('process_status'); + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafAddressGroupsGroupsRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // share_count - computed: true, optional: false, required: false + public get shareCount() { + return this.getNumberAttribute('share_count'); + } +} + +export class DataHuaweicloudWafAddressGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafAddressGroupsGroupsOutputReference { + return new DataHuaweicloudWafAddressGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups huaweicloud_waf_address_groups} +*/ +export class DataHuaweicloudWafAddressGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_address_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafAddressGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafAddressGroups to import + * @param importFromId The id of the existing DataHuaweicloudWafAddressGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafAddressGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_address_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_address_groups huaweicloud_waf_address_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafAddressGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafAddressGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_address_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudWafAddressGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/README.md new file mode 100644 index 00000000..a6ca73e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_certificate` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/index.ts new file mode 100644 index 00000000..ebfd8d36 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificate/index.ts @@ -0,0 +1,273 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#enterprise_project_id DataHuaweicloudWafCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#expiration_status DataHuaweicloudWafCertificate#expiration_status} + */ + readonly expirationStatus?: string; + /** + * schema: Deprecated; The certificate expiration status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#expire_status DataHuaweicloudWafCertificate#expire_status} + */ + readonly expireStatus?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#id DataHuaweicloudWafCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#name DataHuaweicloudWafCertificate#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#region DataHuaweicloudWafCertificate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate huaweicloud_waf_certificate} +*/ +export class DataHuaweicloudWafCertificate extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafCertificate to import + * @param importFromId The id of the existing DataHuaweicloudWafCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificate huaweicloud_waf_certificate} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafCertificateConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafCertificateConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._expirationStatus = config.expirationStatus; + this._expireStatus = config.expireStatus; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration - computed: true, optional: false, required: false + public get expiration() { + return this.getStringAttribute('expiration'); + } + + // expiration_status - computed: true, optional: true, required: false + private _expirationStatus?: string; + public get expirationStatus() { + return this.getStringAttribute('expiration_status'); + } + public set expirationStatus(value: string) { + this._expirationStatus = value; + } + public resetExpirationStatus() { + this._expirationStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get expirationStatusInput() { + return this._expirationStatus; + } + + // expire_status - computed: false, optional: true, required: false + private _expireStatus?: number; + public get expireStatus() { + return this.getNumberAttribute('expire_status'); + } + public set expireStatus(value: number) { + this._expireStatus = value; + } + public resetExpireStatus() { + this._expireStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get expireStatusInput() { + return this._expireStatus; + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + expiration_status: cdktf.stringToTerraform(this._expirationStatus), + expire_status: cdktf.numberToTerraform(this._expireStatus), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expiration_status: { + value: cdktf.stringToHclTerraform(this._expirationStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expire_status: { + value: cdktf.numberToHclTerraform(this._expireStatus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/README.md new file mode 100644 index 00000000..c26171a3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_certificates` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_certificates`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/index.ts new file mode 100644 index 00000000..687b7438 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-certificates/index.ts @@ -0,0 +1,463 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafCertificatesConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID of WAF certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#enterprise_project_id DataHuaweicloudWafCertificates#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the certificate expiration status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#expiration_status DataHuaweicloudWafCertificates#expiration_status} + */ + readonly expirationStatus?: string; + /** + * Specifies whether to obtain the domain name for which the certificate is used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#host DataHuaweicloudWafCertificates#host} + */ + readonly host?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#id DataHuaweicloudWafCertificates#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#name DataHuaweicloudWafCertificates#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the data source. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#region DataHuaweicloudWafCertificates#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafCertificatesCertificatesBindHost { +} + +export function dataHuaweicloudWafCertificatesCertificatesBindHostToTerraform(struct?: DataHuaweicloudWafCertificatesCertificatesBindHost): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafCertificatesCertificatesBindHostToHclTerraform(struct?: DataHuaweicloudWafCertificatesCertificatesBindHost): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafCertificatesCertificatesBindHostOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafCertificatesCertificatesBindHost | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafCertificatesCertificatesBindHost | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // waf_type - computed: true, optional: false, required: false + public get wafType() { + return this.getStringAttribute('waf_type'); + } +} + +export class DataHuaweicloudWafCertificatesCertificatesBindHostList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafCertificatesCertificatesBindHostOutputReference { + return new DataHuaweicloudWafCertificatesCertificatesBindHostOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafCertificatesCertificates { +} + +export function dataHuaweicloudWafCertificatesCertificatesToTerraform(struct?: DataHuaweicloudWafCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafCertificatesCertificatesToHclTerraform(struct?: DataHuaweicloudWafCertificatesCertificates): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafCertificatesCertificatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafCertificatesCertificates | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafCertificatesCertificates | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_host - computed: true, optional: false, required: false + private _bindHost = new DataHuaweicloudWafCertificatesCertificatesBindHostList(this, "bind_host", false); + public get bindHost() { + return this._bindHost; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // expiration_status - computed: true, optional: false, required: false + public get expirationStatus() { + return this.getStringAttribute('expiration_status'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudWafCertificatesCertificatesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafCertificatesCertificatesOutputReference { + return new DataHuaweicloudWafCertificatesCertificatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates huaweicloud_waf_certificates} +*/ +export class DataHuaweicloudWafCertificates extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_certificates"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafCertificates resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafCertificates to import + * @param importFromId The id of the existing DataHuaweicloudWafCertificates that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafCertificates to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_certificates", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_certificates huaweicloud_waf_certificates} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafCertificatesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafCertificatesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_certificates', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._expirationStatus = config.expirationStatus; + this._host = config.host; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificates - computed: true, optional: false, required: false + private _certificates = new DataHuaweicloudWafCertificatesCertificatesList(this, "certificates", false); + public get certificates() { + return this._certificates; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration_status - computed: false, optional: true, required: false + private _expirationStatus?: string; + public get expirationStatus() { + return this.getStringAttribute('expiration_status'); + } + public set expirationStatus(value: string) { + this._expirationStatus = value; + } + public resetExpirationStatus() { + this._expirationStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get expirationStatusInput() { + return this._expirationStatus; + } + + // host - computed: false, optional: true, required: false + private _host?: boolean | cdktf.IResolvable; + public get host() { + return this.getBooleanAttribute('host'); + } + public set host(value: boolean | cdktf.IResolvable) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + expiration_status: cdktf.stringToTerraform(this._expirationStatus), + host: cdktf.booleanToTerraform(this._host), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expiration_status: { + value: cdktf.stringToHclTerraform(this._expirationStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host: { + value: cdktf.booleanToHclTerraform(this._host), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/README.md new file mode 100644 index 00000000..28017dea --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_dedicated_domains` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_dedicated_domains`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/index.ts new file mode 100644 index 00000000..ee53e804 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-domains/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafDedicatedDomainsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#domain DataHuaweicloudWafDedicatedDomains#domain} + */ + readonly domain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#enterprise_project_id DataHuaweicloudWafDedicatedDomains#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#id DataHuaweicloudWafDedicatedDomains#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#policy_name DataHuaweicloudWafDedicatedDomains#policy_name} + */ + readonly policyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#protect_status DataHuaweicloudWafDedicatedDomains#protect_status} + */ + readonly protectStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#region DataHuaweicloudWafDedicatedDomains#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafDedicatedDomainsDomains { +} + +export function dataHuaweicloudWafDedicatedDomainsDomainsToTerraform(struct?: DataHuaweicloudWafDedicatedDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafDedicatedDomainsDomainsToHclTerraform(struct?: DataHuaweicloudWafDedicatedDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafDedicatedDomainsDomainsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafDedicatedDomainsDomains | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafDedicatedDomainsDomains | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_status - computed: true, optional: false, required: false + public get accessStatus() { + return this.getNumberAttribute('access_status'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // is_dual_az - computed: true, optional: false, required: false + public get isDualAz() { + return this.getBooleanAttribute('is_dual_az'); + } + + // pci_3ds - computed: true, optional: false, required: false + public get pci3Ds() { + return this.getBooleanAttribute('pci_3ds'); + } + + // pci_dds - computed: true, optional: false, required: false + public get pciDds() { + return this.getBooleanAttribute('pci_dds'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // protect_status - computed: true, optional: false, required: false + public get protectStatus() { + return this.getNumberAttribute('protect_status'); + } + + // website_name - computed: true, optional: false, required: false + public get websiteName() { + return this.getStringAttribute('website_name'); + } +} + +export class DataHuaweicloudWafDedicatedDomainsDomainsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafDedicatedDomainsDomainsOutputReference { + return new DataHuaweicloudWafDedicatedDomainsDomainsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains huaweicloud_waf_dedicated_domains} +*/ +export class DataHuaweicloudWafDedicatedDomains extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_dedicated_domains"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafDedicatedDomains resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafDedicatedDomains to import + * @param importFromId The id of the existing DataHuaweicloudWafDedicatedDomains that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafDedicatedDomains to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_dedicated_domains", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_domains huaweicloud_waf_dedicated_domains} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafDedicatedDomainsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafDedicatedDomainsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_dedicated_domains', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyName = config.policyName; + this._protectStatus = config.protectStatus; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // domains - computed: true, optional: false, required: false + private _domains = new DataHuaweicloudWafDedicatedDomainsDomainsList(this, "domains", false); + public get domains() { + return this._domains; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_name - computed: false, optional: true, required: false + private _policyName?: string; + public get policyName() { + return this.getStringAttribute('policy_name'); + } + public set policyName(value: string) { + this._policyName = value; + } + public resetPolicyName() { + this._policyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyNameInput() { + return this._policyName; + } + + // protect_status - computed: false, optional: true, required: false + private _protectStatus?: string; + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + public set protectStatus(value: string) { + this._protectStatus = value; + } + public resetProtectStatus() { + this._protectStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectStatusInput() { + return this._protectStatus; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_name: cdktf.stringToTerraform(this._policyName), + protect_status: cdktf.stringToTerraform(this._protectStatus), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_name: { + value: cdktf.stringToHclTerraform(this._policyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_status: { + value: cdktf.stringToHclTerraform(this._protectStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/README.md new file mode 100644 index 00000000..9ff5e288 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_dedicated_instances` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_dedicated_instances`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/index.ts new file mode 100644 index 00000000..9b2710bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-dedicated-instances/index.ts @@ -0,0 +1,346 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafDedicatedInstancesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances#enterprise_project_id DataHuaweicloudWafDedicatedInstances#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances#id DataHuaweicloudWafDedicatedInstances#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances#name DataHuaweicloudWafDedicatedInstances#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances#region DataHuaweicloudWafDedicatedInstances#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafDedicatedInstancesInstances { +} + +export function dataHuaweicloudWafDedicatedInstancesInstancesToTerraform(struct?: DataHuaweicloudWafDedicatedInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafDedicatedInstancesInstancesToHclTerraform(struct?: DataHuaweicloudWafDedicatedInstancesInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafDedicatedInstancesInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafDedicatedInstancesInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafDedicatedInstancesInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_status - computed: true, optional: false, required: false + public get accessStatus() { + return this.getNumberAttribute('access_status'); + } + + // available_zone - computed: true, optional: false, required: false + public get availableZone() { + return this.getStringAttribute('available_zone'); + } + + // cpu_architecture - computed: true, optional: false, required: false + public get cpuArchitecture() { + return this.getStringAttribute('cpu_architecture'); + } + + // ecs_flavor - computed: true, optional: false, required: false + public get ecsFlavor() { + return this.getStringAttribute('ecs_flavor'); + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // run_status - computed: true, optional: false, required: false + public get runStatus() { + return this.getNumberAttribute('run_status'); + } + + // security_group - computed: true, optional: false, required: false + public get securityGroup() { + return this.getListAttribute('security_group'); + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // service_ip - computed: true, optional: false, required: false + public get serviceIp() { + return this.getStringAttribute('service_ip'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // upgradable - computed: true, optional: false, required: false + public get upgradable() { + return this.getNumberAttribute('upgradable'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DataHuaweicloudWafDedicatedInstancesInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafDedicatedInstancesInstancesOutputReference { + return new DataHuaweicloudWafDedicatedInstancesInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances huaweicloud_waf_dedicated_instances} +*/ +export class DataHuaweicloudWafDedicatedInstances extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_dedicated_instances"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafDedicatedInstances resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafDedicatedInstances to import + * @param importFromId The id of the existing DataHuaweicloudWafDedicatedInstances that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafDedicatedInstances to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_dedicated_instances", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_dedicated_instances huaweicloud_waf_dedicated_instances} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafDedicatedInstancesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafDedicatedInstancesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_dedicated_instances', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instances - computed: true, optional: false, required: false + private _instances = new DataHuaweicloudWafDedicatedInstancesInstancesList(this, "instances", false); + public get instances() { + return this._instances; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/README.md new file mode 100644 index 00000000..9b668f78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_domains` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_domains`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/index.ts new file mode 100644 index 00000000..366ee09d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-domains/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafDomainsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains#domain DataHuaweicloudWafDomains#domain} + */ + readonly domain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains#enterprise_project_id DataHuaweicloudWafDomains#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains#id DataHuaweicloudWafDomains#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains#policy_name DataHuaweicloudWafDomains#policy_name} + */ + readonly policyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains#region DataHuaweicloudWafDomains#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafDomainsDomains { +} + +export function dataHuaweicloudWafDomainsDomainsToTerraform(struct?: DataHuaweicloudWafDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafDomainsDomainsToHclTerraform(struct?: DataHuaweicloudWafDomainsDomains): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafDomainsDomainsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafDomainsDomains | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafDomainsDomains | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_code - computed: true, optional: false, required: false + public get accessCode() { + return this.getStringAttribute('access_code'); + } + + // access_status - computed: true, optional: false, required: false + public get accessStatus() { + return this.getNumberAttribute('access_status'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ipv6_enable - computed: true, optional: false, required: false + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + + // pci_3ds - computed: true, optional: false, required: false + public get pci3Ds() { + return this.getBooleanAttribute('pci_3ds'); + } + + // pci_dss - computed: true, optional: false, required: false + public get pciDss() { + return this.getBooleanAttribute('pci_dss'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // protect_status - computed: true, optional: false, required: false + public get protectStatus() { + return this.getNumberAttribute('protect_status'); + } + + // proxy - computed: true, optional: false, required: false + public get proxy() { + return this.getBooleanAttribute('proxy'); + } + + // proxy_layer - computed: true, optional: false, required: false + public get proxyLayer() { + return this.getNumberAttribute('proxy_layer'); + } + + // website_name - computed: true, optional: false, required: false + public get websiteName() { + return this.getStringAttribute('website_name'); + } +} + +export class DataHuaweicloudWafDomainsDomainsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafDomainsDomainsOutputReference { + return new DataHuaweicloudWafDomainsDomainsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains huaweicloud_waf_domains} +*/ +export class DataHuaweicloudWafDomains extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_domains"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafDomains resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafDomains to import + * @param importFromId The id of the existing DataHuaweicloudWafDomains that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafDomains to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_domains", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_domains huaweicloud_waf_domains} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafDomainsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafDomainsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_domains', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyName = config.policyName; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // domains - computed: true, optional: false, required: false + private _domains = new DataHuaweicloudWafDomainsDomainsList(this, "domains", false); + public get domains() { + return this._domains; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_name - computed: false, optional: true, required: false + private _policyName?: string; + public get policyName() { + return this.getStringAttribute('policy_name'); + } + public set policyName(value: string) { + this._policyName = value; + } + public resetPolicyName() { + this._policyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyNameInput() { + return this._policyName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_name: cdktf.stringToTerraform(this._policyName), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_name: { + value: cdktf.stringToHclTerraform(this._policyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/README.md new file mode 100644 index 00000000..dcbbe344 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_instance_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_instance_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/index.ts new file mode 100644 index 00000000..ef0d6857 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-instance-groups/index.ts @@ -0,0 +1,498 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafInstanceGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups#id DataHuaweicloudWafInstanceGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups#name DataHuaweicloudWafInstanceGroups#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups#region DataHuaweicloudWafInstanceGroups#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups#vpc_id DataHuaweicloudWafInstanceGroups#vpc_id} + */ + readonly vpcId?: string; +} +export interface DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstances { +} + +export function dataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesToTerraform(struct?: DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesToHclTerraform(struct?: DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstances): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstances | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstances | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesOutputReference { + return new DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafInstanceGroupsGroupsDomainNames { +} + +export function dataHuaweicloudWafInstanceGroupsGroupsDomainNamesToTerraform(struct?: DataHuaweicloudWafInstanceGroupsGroupsDomainNames): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafInstanceGroupsGroupsDomainNamesToHclTerraform(struct?: DataHuaweicloudWafInstanceGroupsGroupsDomainNames): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafInstanceGroupsGroupsDomainNamesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafInstanceGroupsGroupsDomainNames | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafInstanceGroupsGroupsDomainNames | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DataHuaweicloudWafInstanceGroupsGroupsDomainNamesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafInstanceGroupsGroupsDomainNamesOutputReference { + return new DataHuaweicloudWafInstanceGroupsGroupsDomainNamesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafInstanceGroupsGroups { +} + +export function dataHuaweicloudWafInstanceGroupsGroupsToTerraform(struct?: DataHuaweicloudWafInstanceGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafInstanceGroupsGroupsToHclTerraform(struct?: DataHuaweicloudWafInstanceGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafInstanceGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafInstanceGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafInstanceGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // body_limit - computed: true, optional: false, required: false + public get bodyLimit() { + return this.getNumberAttribute('body_limit'); + } + + // connection_timeout - computed: true, optional: false, required: false + public get connectionTimeout() { + return this.getNumberAttribute('connection_timeout'); + } + + // dedicated_instances - computed: true, optional: false, required: false + private _dedicatedInstances = new DataHuaweicloudWafInstanceGroupsGroupsDedicatedInstancesList(this, "dedicated_instances", false); + public get dedicatedInstances() { + return this._dedicatedInstances; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_names - computed: true, optional: false, required: false + private _domainNames = new DataHuaweicloudWafInstanceGroupsGroupsDomainNamesList(this, "domain_names", false); + public get domainNames() { + return this._domainNames; + } + + // header_limit - computed: true, optional: false, required: false + public get headerLimit() { + return this.getNumberAttribute('header_limit'); + } + + // load_balancers - computed: true, optional: false, required: false + public get loadBalancers() { + return this.getListAttribute('load_balancers'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // read_timeout - computed: true, optional: false, required: false + public get readTimeout() { + return this.getNumberAttribute('read_timeout'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // write_timeout - computed: true, optional: false, required: false + public get writeTimeout() { + return this.getNumberAttribute('write_timeout'); + } +} + +export class DataHuaweicloudWafInstanceGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafInstanceGroupsGroupsOutputReference { + return new DataHuaweicloudWafInstanceGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups huaweicloud_waf_instance_groups} +*/ +export class DataHuaweicloudWafInstanceGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_instance_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafInstanceGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafInstanceGroups to import + * @param importFromId The id of the existing DataHuaweicloudWafInstanceGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafInstanceGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_instance_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_instance_groups huaweicloud_waf_instance_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafInstanceGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafInstanceGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_instance_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudWafInstanceGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/README.md new file mode 100644 index 00000000..5ac94e4b --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/index.ts new file mode 100644 index 00000000..b36a75c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-policies/index.ts @@ -0,0 +1,588 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafPoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies#enterprise_project_id DataHuaweicloudWafPolicies#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies#id DataHuaweicloudWafPolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies#name DataHuaweicloudWafPolicies#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies#region DataHuaweicloudWafPolicies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafPoliciesPoliciesBindHosts { +} + +export function dataHuaweicloudWafPoliciesPoliciesBindHostsToTerraform(struct?: DataHuaweicloudWafPoliciesPoliciesBindHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafPoliciesPoliciesBindHostsToHclTerraform(struct?: DataHuaweicloudWafPoliciesPoliciesBindHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafPoliciesPoliciesBindHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafPoliciesPoliciesBindHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafPoliciesPoliciesBindHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // hostname - computed: true, optional: false, required: false + public get hostname() { + return this.getStringAttribute('hostname'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // waf_type - computed: true, optional: false, required: false + public get wafType() { + return this.getStringAttribute('waf_type'); + } +} + +export class DataHuaweicloudWafPoliciesPoliciesBindHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafPoliciesPoliciesBindHostsOutputReference { + return new DataHuaweicloudWafPoliciesPoliciesBindHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafPoliciesPoliciesOptions { +} + +export function dataHuaweicloudWafPoliciesPoliciesOptionsToTerraform(struct?: DataHuaweicloudWafPoliciesPoliciesOptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafPoliciesPoliciesOptionsToHclTerraform(struct?: DataHuaweicloudWafPoliciesPoliciesOptions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafPoliciesPoliciesOptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafPoliciesPoliciesOptions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafPoliciesPoliciesOptions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // anti_crawler - computed: true, optional: false, required: false + public get antiCrawler() { + return this.getBooleanAttribute('anti_crawler'); + } + + // basic_web_protection - computed: true, optional: false, required: false + public get basicWebProtection() { + return this.getBooleanAttribute('basic_web_protection'); + } + + // blacklist - computed: true, optional: false, required: false + public get blacklist() { + return this.getBooleanAttribute('blacklist'); + } + + // bot_enable - computed: true, optional: false, required: false + public get botEnable() { + return this.getBooleanAttribute('bot_enable'); + } + + // cc_attack_protection - computed: true, optional: false, required: false + public get ccAttackProtection() { + return this.getBooleanAttribute('cc_attack_protection'); + } + + // crawler - computed: true, optional: false, required: false + public get crawler() { + return this.getBooleanAttribute('crawler'); + } + + // crawler_engine - computed: true, optional: false, required: false + public get crawlerEngine() { + return this.getBooleanAttribute('crawler_engine'); + } + + // crawler_other - computed: true, optional: false, required: false + public get crawlerOther() { + return this.getBooleanAttribute('crawler_other'); + } + + // crawler_scanner - computed: true, optional: false, required: false + public get crawlerScanner() { + return this.getBooleanAttribute('crawler_scanner'); + } + + // crawler_script - computed: true, optional: false, required: false + public get crawlerScript() { + return this.getBooleanAttribute('crawler_script'); + } + + // data_masking - computed: true, optional: false, required: false + public get dataMasking() { + return this.getBooleanAttribute('data_masking'); + } + + // false_alarm_masking - computed: true, optional: false, required: false + public get falseAlarmMasking() { + return this.getBooleanAttribute('false_alarm_masking'); + } + + // general_check - computed: true, optional: false, required: false + public get generalCheck() { + return this.getBooleanAttribute('general_check'); + } + + // geolocation_access_control - computed: true, optional: false, required: false + public get geolocationAccessControl() { + return this.getBooleanAttribute('geolocation_access_control'); + } + + // information_leakage_prevention - computed: true, optional: false, required: false + public get informationLeakagePrevention() { + return this.getBooleanAttribute('information_leakage_prevention'); + } + + // known_attack_source - computed: true, optional: false, required: false + public get knownAttackSource() { + return this.getBooleanAttribute('known_attack_source'); + } + + // precise_protection - computed: true, optional: false, required: false + public get preciseProtection() { + return this.getBooleanAttribute('precise_protection'); + } + + // web_tamper_protection - computed: true, optional: false, required: false + public get webTamperProtection() { + return this.getBooleanAttribute('web_tamper_protection'); + } + + // webshell - computed: true, optional: false, required: false + public get webshell() { + return this.getBooleanAttribute('webshell'); + } +} + +export class DataHuaweicloudWafPoliciesPoliciesOptionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafPoliciesPoliciesOptionsOutputReference { + return new DataHuaweicloudWafPoliciesPoliciesOptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafPoliciesPolicies { +} + +export function dataHuaweicloudWafPoliciesPoliciesToTerraform(struct?: DataHuaweicloudWafPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafPoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudWafPoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafPoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafPoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafPoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bind_hosts - computed: true, optional: false, required: false + private _bindHosts = new DataHuaweicloudWafPoliciesPoliciesBindHostsList(this, "bind_hosts", false); + public get bindHosts() { + return this._bindHosts; + } + + // deep_inspection - computed: true, optional: false, required: false + public get deepInspection() { + return this.getBooleanAttribute('deep_inspection'); + } + + // full_detection - computed: true, optional: false, required: false + public get fullDetection() { + return this.getBooleanAttribute('full_detection'); + } + + // header_inspection - computed: true, optional: false, required: false + public get headerInspection() { + return this.getBooleanAttribute('header_inspection'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // level - computed: true, optional: false, required: false + public get level() { + return this.getNumberAttribute('level'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // options - computed: true, optional: false, required: false + private _options = new DataHuaweicloudWafPoliciesPoliciesOptionsList(this, "options", false); + public get options() { + return this._options; + } + + // protection_mode - computed: true, optional: false, required: false + public get protectionMode() { + return this.getStringAttribute('protection_mode'); + } + + // robot_action - computed: true, optional: false, required: false + public get robotAction() { + return this.getStringAttribute('robot_action'); + } + + // shiro_decryption_check - computed: true, optional: false, required: false + public get shiroDecryptionCheck() { + return this.getBooleanAttribute('shiro_decryption_check'); + } +} + +export class DataHuaweicloudWafPoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafPoliciesPoliciesOutputReference { + return new DataHuaweicloudWafPoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies huaweicloud_waf_policies} +*/ +export class DataHuaweicloudWafPolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafPolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafPolicies to import + * @param importFromId The id of the existing DataHuaweicloudWafPolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafPolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_policies huaweicloud_waf_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafPoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafPoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudWafPoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/README.md new file mode 100644 index 00000000..e3a69f8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_reference_tables` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_reference_tables`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/index.ts new file mode 100644 index 00000000..89268216 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-reference-tables/index.ts @@ -0,0 +1,306 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafReferenceTablesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables#enterprise_project_id DataHuaweicloudWafReferenceTables#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables#id DataHuaweicloudWafReferenceTables#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables#name DataHuaweicloudWafReferenceTables#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables#region DataHuaweicloudWafReferenceTables#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafReferenceTablesTables { +} + +export function dataHuaweicloudWafReferenceTablesTablesToTerraform(struct?: DataHuaweicloudWafReferenceTablesTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafReferenceTablesTablesToHclTerraform(struct?: DataHuaweicloudWafReferenceTablesTables): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafReferenceTablesTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafReferenceTablesTables | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafReferenceTablesTables | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conditions - computed: true, optional: false, required: false + public get conditions() { + return this.getListAttribute('conditions'); + } + + // creation_time - computed: true, optional: false, required: false + public get creationTime() { + return this.getStringAttribute('creation_time'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudWafReferenceTablesTablesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafReferenceTablesTablesOutputReference { + return new DataHuaweicloudWafReferenceTablesTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables huaweicloud_waf_reference_tables} +*/ +export class DataHuaweicloudWafReferenceTables extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_reference_tables"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafReferenceTables resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafReferenceTables to import + * @param importFromId The id of the existing DataHuaweicloudWafReferenceTables that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafReferenceTables to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_reference_tables", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_reference_tables huaweicloud_waf_reference_tables} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafReferenceTablesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafReferenceTablesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_reference_tables', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tables - computed: true, optional: false, required: false + private _tables = new DataHuaweicloudWafReferenceTablesTablesList(this, "tables", false); + public get tables() { + return this._tables; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/README.md new file mode 100644 index 00000000..f78fac59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_anti_crawler` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_anti_crawler`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/index.ts new file mode 100644 index 00000000..396883f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-anti-crawler/index.ts @@ -0,0 +1,535 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesAntiCrawlerConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#enterprise_project_id DataHuaweicloudWafRulesAntiCrawler#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#id DataHuaweicloudWafRulesAntiCrawler#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the anti crawler rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#name DataHuaweicloudWafRulesAntiCrawler#name} + */ + readonly name?: string; + /** + * Specifies the ID of the policy to which the anti crawler rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#policy_id DataHuaweicloudWafRulesAntiCrawler#policy_id} + */ + readonly policyId: string; + /** + * Specifies the protection mode of the anti crawler rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#protection_mode DataHuaweicloudWafRulesAntiCrawler#protection_mode} + */ + readonly protectionMode?: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#region DataHuaweicloudWafRulesAntiCrawler#region} + */ + readonly region?: string; + /** + * Specifies the ID of the anti crawler rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#rule_id DataHuaweicloudWafRulesAntiCrawler#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the anti crawler rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#status DataHuaweicloudWafRulesAntiCrawler#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesAntiCrawlerRulesConditions { +} + +export function dataHuaweicloudWafRulesAntiCrawlerRulesConditionsToTerraform(struct?: DataHuaweicloudWafRulesAntiCrawlerRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesAntiCrawlerRulesConditionsToHclTerraform(struct?: DataHuaweicloudWafRulesAntiCrawlerRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesAntiCrawlerRulesConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesAntiCrawlerRulesConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesAntiCrawlerRulesConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getListAttribute('content'); + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // logic - computed: true, optional: false, required: false + public get logic() { + return this.getStringAttribute('logic'); + } + + // reference_table_id - computed: true, optional: false, required: false + public get referenceTableId() { + return this.getStringAttribute('reference_table_id'); + } +} + +export class DataHuaweicloudWafRulesAntiCrawlerRulesConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesAntiCrawlerRulesConditionsOutputReference { + return new DataHuaweicloudWafRulesAntiCrawlerRulesConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesAntiCrawlerRules { +} + +export function dataHuaweicloudWafRulesAntiCrawlerRulesToTerraform(struct?: DataHuaweicloudWafRulesAntiCrawlerRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesAntiCrawlerRulesToHclTerraform(struct?: DataHuaweicloudWafRulesAntiCrawlerRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesAntiCrawlerRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesAntiCrawlerRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesAntiCrawlerRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudWafRulesAntiCrawlerRulesConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // protection_mode - computed: true, optional: false, required: false + public get protectionMode() { + return this.getStringAttribute('protection_mode'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } +} + +export class DataHuaweicloudWafRulesAntiCrawlerRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesAntiCrawlerRulesOutputReference { + return new DataHuaweicloudWafRulesAntiCrawlerRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler huaweicloud_waf_rules_anti_crawler} +*/ +export class DataHuaweicloudWafRulesAntiCrawler extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_anti_crawler"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesAntiCrawler resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesAntiCrawler to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesAntiCrawler that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesAntiCrawler to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_anti_crawler", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_anti_crawler huaweicloud_waf_rules_anti_crawler} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesAntiCrawlerConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesAntiCrawlerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_anti_crawler', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._protectionMode = config.protectionMode; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protection_mode - computed: false, optional: true, required: false + private _protectionMode?: string; + public get protectionMode() { + return this.getStringAttribute('protection_mode'); + } + public set protectionMode(value: string) { + this._protectionMode = value; + } + public resetProtectionMode() { + this._protectionMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionModeInput() { + return this._protectionMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesAntiCrawlerRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + protection_mode: cdktf.stringToTerraform(this._protectionMode), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_mode: { + value: cdktf.stringToHclTerraform(this._protectionMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/README.md new file mode 100644 index 00000000..4f21870d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_blacklist` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_blacklist`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/index.ts new file mode 100644 index 00000000..cfa1b94e --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-blacklist/index.ts @@ -0,0 +1,530 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesBlacklistConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the protective action of the blacklist and whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#action DataHuaweicloudWafRulesBlacklist#action} + */ + readonly action?: string; + /** + * Specifies the enterprise project ID to which the protection policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#enterprise_project_id DataHuaweicloudWafRulesBlacklist#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#id DataHuaweicloudWafRulesBlacklist#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the blacklist or whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#name DataHuaweicloudWafRulesBlacklist#name} + */ + readonly name?: string; + /** + * Specifies the ID of the policy to which the blacklist and whitelist rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#policy_id DataHuaweicloudWafRulesBlacklist#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#region DataHuaweicloudWafRulesBlacklist#region} + */ + readonly region?: string; + /** + * Specifies the ID of the blacklist or whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#rule_id DataHuaweicloudWafRulesBlacklist#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the blacklist or whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#status DataHuaweicloudWafRulesBlacklist#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesBlacklistRulesAddressGroup { +} + +export function dataHuaweicloudWafRulesBlacklistRulesAddressGroupToTerraform(struct?: DataHuaweicloudWafRulesBlacklistRulesAddressGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesBlacklistRulesAddressGroupToHclTerraform(struct?: DataHuaweicloudWafRulesBlacklistRulesAddressGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesBlacklistRulesAddressGroupOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesBlacklistRulesAddressGroup | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesBlacklistRulesAddressGroup | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class DataHuaweicloudWafRulesBlacklistRulesAddressGroupList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesBlacklistRulesAddressGroupOutputReference { + return new DataHuaweicloudWafRulesBlacklistRulesAddressGroupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesBlacklistRules { +} + +export function dataHuaweicloudWafRulesBlacklistRulesToTerraform(struct?: DataHuaweicloudWafRulesBlacklistRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesBlacklistRulesToHclTerraform(struct?: DataHuaweicloudWafRulesBlacklistRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesBlacklistRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesBlacklistRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesBlacklistRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getNumberAttribute('action'); + } + + // address_group - computed: true, optional: false, required: false + private _addressGroup = new DataHuaweicloudWafRulesBlacklistRulesAddressGroupList(this, "address_group", false); + public get addressGroup() { + return this._addressGroup; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } +} + +export class DataHuaweicloudWafRulesBlacklistRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesBlacklistRulesOutputReference { + return new DataHuaweicloudWafRulesBlacklistRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist huaweicloud_waf_rules_blacklist} +*/ +export class DataHuaweicloudWafRulesBlacklist extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_blacklist"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesBlacklist resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesBlacklist to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesBlacklist that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesBlacklist to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_blacklist", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_blacklist huaweicloud_waf_rules_blacklist} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesBlacklistConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesBlacklistConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_blacklist', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesBlacklistRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/README.md new file mode 100644 index 00000000..2c4f61bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_cc_protection` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_cc_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/index.ts new file mode 100644 index 00000000..989af6e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-cc-protection/index.ts @@ -0,0 +1,712 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesCcProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#enterprise_project_id DataHuaweicloudWafRulesCcProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#id DataHuaweicloudWafRulesCcProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#name DataHuaweicloudWafRulesCcProtection#name} + */ + readonly name?: string; + /** + * Specifies the ID of the policy to which the cc protection rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#policy_id DataHuaweicloudWafRulesCcProtection#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#region DataHuaweicloudWafRulesCcProtection#region} + */ + readonly region?: string; + /** + * Specifies the ID of the cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#rule_id DataHuaweicloudWafRulesCcProtection#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#status DataHuaweicloudWafRulesCcProtection#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesCcProtectionRulesActionDetail { +} + +export function dataHuaweicloudWafRulesCcProtectionRulesActionDetailToTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRulesActionDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesCcProtectionRulesActionDetailToHclTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRulesActionDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesCcProtectionRulesActionDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesCcProtectionRulesActionDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesCcProtectionRulesActionDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // block_page_type - computed: true, optional: false, required: false + public get blockPageType() { + return this.getStringAttribute('block_page_type'); + } + + // page_content - computed: true, optional: false, required: false + public get pageContent() { + return this.getStringAttribute('page_content'); + } +} + +export class DataHuaweicloudWafRulesCcProtectionRulesActionDetailList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesCcProtectionRulesActionDetailOutputReference { + return new DataHuaweicloudWafRulesCcProtectionRulesActionDetailOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesCcProtectionRulesAction { +} + +export function dataHuaweicloudWafRulesCcProtectionRulesActionToTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRulesAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesCcProtectionRulesActionToHclTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRulesAction): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesCcProtectionRulesActionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesCcProtectionRulesAction | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesCcProtectionRulesAction | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // detail - computed: true, optional: false, required: false + private _detail = new DataHuaweicloudWafRulesCcProtectionRulesActionDetailList(this, "detail", false); + public get detail() { + return this._detail; + } + + // protective_action - computed: true, optional: false, required: false + public get protectiveAction() { + return this.getStringAttribute('protective_action'); + } +} + +export class DataHuaweicloudWafRulesCcProtectionRulesActionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesCcProtectionRulesActionOutputReference { + return new DataHuaweicloudWafRulesCcProtectionRulesActionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesCcProtectionRulesConditions { +} + +export function dataHuaweicloudWafRulesCcProtectionRulesConditionsToTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesCcProtectionRulesConditionsToHclTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesCcProtectionRulesConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesCcProtectionRulesConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesCcProtectionRulesConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getListAttribute('content'); + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // logic - computed: true, optional: false, required: false + public get logic() { + return this.getStringAttribute('logic'); + } + + // reference_table_id - computed: true, optional: false, required: false + public get referenceTableId() { + return this.getStringAttribute('reference_table_id'); + } + + // subfield - computed: true, optional: false, required: false + public get subfield() { + return this.getStringAttribute('subfield'); + } +} + +export class DataHuaweicloudWafRulesCcProtectionRulesConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesCcProtectionRulesConditionsOutputReference { + return new DataHuaweicloudWafRulesCcProtectionRulesConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesCcProtectionRules { +} + +export function dataHuaweicloudWafRulesCcProtectionRulesToTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesCcProtectionRulesToHclTerraform(struct?: DataHuaweicloudWafRulesCcProtectionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesCcProtectionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesCcProtectionRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesCcProtectionRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + private _action = new DataHuaweicloudWafRulesCcProtectionRulesActionList(this, "action", false); + public get action() { + return this._action; + } + + // all_waf_instances - computed: true, optional: false, required: false + public get allWafInstances() { + return this.getBooleanAttribute('all_waf_instances'); + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudWafRulesCcProtectionRulesConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // limit_num - computed: true, optional: false, required: false + public get limitNum() { + return this.getNumberAttribute('limit_num'); + } + + // limit_period - computed: true, optional: false, required: false + public get limitPeriod() { + return this.getNumberAttribute('limit_period'); + } + + // lock_time - computed: true, optional: false, required: false + public get lockTime() { + return this.getNumberAttribute('lock_time'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // other_user_identifier - computed: true, optional: false, required: false + public get otherUserIdentifier() { + return this.getListAttribute('other_user_identifier'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // rate_limit_mode - computed: true, optional: false, required: false + public get rateLimitMode() { + return this.getStringAttribute('rate_limit_mode'); + } + + // request_aggregation - computed: true, optional: false, required: false + public get requestAggregation() { + return this.getBooleanAttribute('request_aggregation'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // unlock_num - computed: true, optional: false, required: false + public get unlockNum() { + return this.getNumberAttribute('unlock_num'); + } + + // user_identifier - computed: true, optional: false, required: false + public get userIdentifier() { + return this.getStringAttribute('user_identifier'); + } +} + +export class DataHuaweicloudWafRulesCcProtectionRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesCcProtectionRulesOutputReference { + return new DataHuaweicloudWafRulesCcProtectionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection huaweicloud_waf_rules_cc_protection} +*/ +export class DataHuaweicloudWafRulesCcProtection extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_cc_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesCcProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesCcProtection to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesCcProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesCcProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_cc_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_cc_protection huaweicloud_waf_rules_cc_protection} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesCcProtectionConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesCcProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_cc_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesCcProtectionRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/README.md new file mode 100644 index 00000000..566fe714 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_data_masking` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_data_masking`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/index.ts new file mode 100644 index 00000000..752d9320 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-data-masking/index.ts @@ -0,0 +1,379 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesDataMaskingConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#enterprise_project_id DataHuaweicloudWafRulesDataMasking#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#id DataHuaweicloudWafRulesDataMasking#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy to which the data masking rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#policy_id DataHuaweicloudWafRulesDataMasking#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#region DataHuaweicloudWafRulesDataMasking#region} + */ + readonly region?: string; + /** + * Specifies the ID of the data masking rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#rule_id DataHuaweicloudWafRulesDataMasking#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the data masking rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#status DataHuaweicloudWafRulesDataMasking#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesDataMaskingRules { +} + +export function dataHuaweicloudWafRulesDataMaskingRulesToTerraform(struct?: DataHuaweicloudWafRulesDataMaskingRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesDataMaskingRulesToHclTerraform(struct?: DataHuaweicloudWafRulesDataMaskingRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesDataMaskingRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesDataMaskingRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesDataMaskingRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subfield - computed: true, optional: false, required: false + public get subfield() { + return this.getStringAttribute('subfield'); + } +} + +export class DataHuaweicloudWafRulesDataMaskingRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesDataMaskingRulesOutputReference { + return new DataHuaweicloudWafRulesDataMaskingRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking huaweicloud_waf_rules_data_masking} +*/ +export class DataHuaweicloudWafRulesDataMasking extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_data_masking"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesDataMasking resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesDataMasking to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesDataMasking that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesDataMasking to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_data_masking", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_data_masking huaweicloud_waf_rules_data_masking} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesDataMaskingConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesDataMaskingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_data_masking', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesDataMaskingRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/README.md new file mode 100644 index 00000000..c3b72cf9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_geolocation_access_control` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_geolocation_access_control`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/index.ts new file mode 100644 index 00000000..0ebb1d4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-geolocation-access-control/index.ts @@ -0,0 +1,434 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesGeolocationAccessControlConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the protective action of the geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#action DataHuaweicloudWafRulesGeolocationAccessControl#action} + */ + readonly action?: string; + /** + * Specifies the enterprise project ID to which the protection policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#enterprise_project_id DataHuaweicloudWafRulesGeolocationAccessControl#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#id DataHuaweicloudWafRulesGeolocationAccessControl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#name DataHuaweicloudWafRulesGeolocationAccessControl#name} + */ + readonly name?: string; + /** + * Specifies the ID of the policy to which the the geolocation access control rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#policy_id DataHuaweicloudWafRulesGeolocationAccessControl#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#region DataHuaweicloudWafRulesGeolocationAccessControl#region} + */ + readonly region?: string; + /** + * Specifies the ID of the geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#rule_id DataHuaweicloudWafRulesGeolocationAccessControl#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#status DataHuaweicloudWafRulesGeolocationAccessControl#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesGeolocationAccessControlRules { +} + +export function dataHuaweicloudWafRulesGeolocationAccessControlRulesToTerraform(struct?: DataHuaweicloudWafRulesGeolocationAccessControlRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesGeolocationAccessControlRulesToHclTerraform(struct?: DataHuaweicloudWafRulesGeolocationAccessControlRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesGeolocationAccessControlRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesGeolocationAccessControlRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesGeolocationAccessControlRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getNumberAttribute('action'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // geolocation - computed: true, optional: false, required: false + public get geolocation() { + return this.getStringAttribute('geolocation'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } +} + +export class DataHuaweicloudWafRulesGeolocationAccessControlRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesGeolocationAccessControlRulesOutputReference { + return new DataHuaweicloudWafRulesGeolocationAccessControlRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control huaweicloud_waf_rules_geolocation_access_control} +*/ +export class DataHuaweicloudWafRulesGeolocationAccessControl extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_geolocation_access_control"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesGeolocationAccessControl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesGeolocationAccessControl to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesGeolocationAccessControl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesGeolocationAccessControl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_geolocation_access_control", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_geolocation_access_control huaweicloud_waf_rules_geolocation_access_control} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesGeolocationAccessControlConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesGeolocationAccessControlConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_geolocation_access_control', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesGeolocationAccessControlRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/README.md new file mode 100644 index 00000000..de7c8b9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_global_protection_whitelist` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_global_protection_whitelist`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/index.ts new file mode 100644 index 00000000..42e57767 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-global-protection-whitelist/index.ts @@ -0,0 +1,480 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesGlobalProtectionWhitelistConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#enterprise_project_id DataHuaweicloudWafRulesGlobalProtectionWhitelist#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#id DataHuaweicloudWafRulesGlobalProtectionWhitelist#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy to which the global protection whitelist rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#policy_id DataHuaweicloudWafRulesGlobalProtectionWhitelist#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#region DataHuaweicloudWafRulesGlobalProtectionWhitelist#region} + */ + readonly region?: string; + /** + * Specifies the ID of the global protection whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#rule_id DataHuaweicloudWafRulesGlobalProtectionWhitelist#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the global protection whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#status DataHuaweicloudWafRulesGlobalProtectionWhitelist#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditions { +} + +export function dataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsToTerraform(struct?: DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsToHclTerraform(struct?: DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getListAttribute('content'); + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // logic - computed: true, optional: false, required: false + public get logic() { + return this.getStringAttribute('logic'); + } + + // subfield - computed: true, optional: false, required: false + public get subfield() { + return this.getStringAttribute('subfield'); + } +} + +export class DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsOutputReference { + return new DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesGlobalProtectionWhitelistRules { +} + +export function dataHuaweicloudWafRulesGlobalProtectionWhitelistRulesToTerraform(struct?: DataHuaweicloudWafRulesGlobalProtectionWhitelistRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesGlobalProtectionWhitelistRulesToHclTerraform(struct?: DataHuaweicloudWafRulesGlobalProtectionWhitelistRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesGlobalProtectionWhitelistRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesGlobalProtectionWhitelistRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advanced_content - computed: true, optional: false, required: false + public get advancedContent() { + return this.getListAttribute('advanced_content'); + } + + // advanced_field - computed: true, optional: false, required: false + public get advancedField() { + return this.getStringAttribute('advanced_field'); + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domains - computed: true, optional: false, required: false + public get domains() { + return this.getListAttribute('domains'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ignore_waf_protection - computed: true, optional: false, required: false + public get ignoreWafProtection() { + return this.getStringAttribute('ignore_waf_protection'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } +} + +export class DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesOutputReference { + return new DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist huaweicloud_waf_rules_global_protection_whitelist} +*/ +export class DataHuaweicloudWafRulesGlobalProtectionWhitelist extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_global_protection_whitelist"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesGlobalProtectionWhitelist resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesGlobalProtectionWhitelist to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesGlobalProtectionWhitelist that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesGlobalProtectionWhitelist to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_global_protection_whitelist", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_global_protection_whitelist huaweicloud_waf_rules_global_protection_whitelist} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesGlobalProtectionWhitelistConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesGlobalProtectionWhitelistConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_global_protection_whitelist', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesGlobalProtectionWhitelistRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/README.md new file mode 100644 index 00000000..bac48126 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_information_leakage_prevention` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_information_leakage_prevention`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/index.ts new file mode 100644 index 00000000..6a3893c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-information-leakage-prevention/index.ts @@ -0,0 +1,414 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesInformationLeakagePreventionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#enterprise_project_id DataHuaweicloudWafRulesInformationLeakagePrevention#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#id DataHuaweicloudWafRulesInformationLeakagePrevention#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy to which the information leakage prevention rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#policy_id DataHuaweicloudWafRulesInformationLeakagePrevention#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#region DataHuaweicloudWafRulesInformationLeakagePrevention#region} + */ + readonly region?: string; + /** + * Specifies the ID of the information leakage prevention rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#rule_id DataHuaweicloudWafRulesInformationLeakagePrevention#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the information leakage prevention rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#status DataHuaweicloudWafRulesInformationLeakagePrevention#status} + */ + readonly status?: string; + /** + * Specifies the type of the information leakage prevention rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#type DataHuaweicloudWafRulesInformationLeakagePrevention#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudWafRulesInformationLeakagePreventionRules { +} + +export function dataHuaweicloudWafRulesInformationLeakagePreventionRulesToTerraform(struct?: DataHuaweicloudWafRulesInformationLeakagePreventionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesInformationLeakagePreventionRulesToHclTerraform(struct?: DataHuaweicloudWafRulesInformationLeakagePreventionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesInformationLeakagePreventionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesInformationLeakagePreventionRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesInformationLeakagePreventionRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // contents - computed: true, optional: false, required: false + public get contents() { + return this.getListAttribute('contents'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // protection_action - computed: true, optional: false, required: false + public get protectionAction() { + return this.getStringAttribute('protection_action'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudWafRulesInformationLeakagePreventionRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesInformationLeakagePreventionRulesOutputReference { + return new DataHuaweicloudWafRulesInformationLeakagePreventionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention huaweicloud_waf_rules_information_leakage_prevention} +*/ +export class DataHuaweicloudWafRulesInformationLeakagePrevention extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_information_leakage_prevention"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesInformationLeakagePrevention resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesInformationLeakagePrevention to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesInformationLeakagePrevention that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesInformationLeakagePrevention to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_information_leakage_prevention", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_information_leakage_prevention huaweicloud_waf_rules_information_leakage_prevention} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesInformationLeakagePreventionConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesInformationLeakagePreventionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_information_leakage_prevention', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesInformationLeakagePreventionRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/README.md new file mode 100644 index 00000000..d5374099 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_known_attack_source` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_known_attack_source`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/index.ts new file mode 100644 index 00000000..42cc6158 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-known-attack-source/index.ts @@ -0,0 +1,369 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesKnownAttackSourceConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the block type of the known attack source rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#block_type DataHuaweicloudWafRulesKnownAttackSource#block_type} + */ + readonly blockType?: string; + /** + * Specifies the enterprise project ID to which the protection policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#enterprise_project_id DataHuaweicloudWafRulesKnownAttackSource#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#id DataHuaweicloudWafRulesKnownAttackSource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy to which the known attack source rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#policy_id DataHuaweicloudWafRulesKnownAttackSource#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#region DataHuaweicloudWafRulesKnownAttackSource#region} + */ + readonly region?: string; + /** + * Specifies the ID of the known attack source rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#rule_id DataHuaweicloudWafRulesKnownAttackSource#rule_id} + */ + readonly ruleId?: string; +} +export interface DataHuaweicloudWafRulesKnownAttackSourceRules { +} + +export function dataHuaweicloudWafRulesKnownAttackSourceRulesToTerraform(struct?: DataHuaweicloudWafRulesKnownAttackSourceRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesKnownAttackSourceRulesToHclTerraform(struct?: DataHuaweicloudWafRulesKnownAttackSourceRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesKnownAttackSourceRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesKnownAttackSourceRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesKnownAttackSourceRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // block_time - computed: true, optional: false, required: false + public get blockTime() { + return this.getNumberAttribute('block_time'); + } + + // block_type - computed: true, optional: false, required: false + public get blockType() { + return this.getStringAttribute('block_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } +} + +export class DataHuaweicloudWafRulesKnownAttackSourceRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesKnownAttackSourceRulesOutputReference { + return new DataHuaweicloudWafRulesKnownAttackSourceRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source huaweicloud_waf_rules_known_attack_source} +*/ +export class DataHuaweicloudWafRulesKnownAttackSource extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_known_attack_source"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesKnownAttackSource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesKnownAttackSource to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesKnownAttackSource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesKnownAttackSource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_known_attack_source", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_known_attack_source huaweicloud_waf_rules_known_attack_source} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesKnownAttackSourceConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesKnownAttackSourceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_known_attack_source', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._blockType = config.blockType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + } + + // ========== + // ATTRIBUTES + // ========== + + // block_type - computed: false, optional: true, required: false + private _blockType?: string; + public get blockType() { + return this.getStringAttribute('block_type'); + } + public set blockType(value: string) { + this._blockType = value; + } + public resetBlockType() { + this._blockType = undefined; + } + // Temporarily expose input value. Use with caution. + public get blockTypeInput() { + return this._blockType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesKnownAttackSourceRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + block_type: cdktf.stringToTerraform(this._blockType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + block_type: { + value: cdktf.stringToHclTerraform(this._blockType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/README.md new file mode 100644 index 00000000..21763779 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_precise_protection` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_precise_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/index.ts new file mode 100644 index 00000000..bba42eb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-precise-protection/index.ts @@ -0,0 +1,530 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesPreciseProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policies belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#enterprise_project_id DataHuaweicloudWafRulesPreciseProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#id DataHuaweicloudWafRulesPreciseProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#name DataHuaweicloudWafRulesPreciseProtection#name} + */ + readonly name?: string; + /** + * Specifies the ID of the policy to which the precise protection rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#policy_id DataHuaweicloudWafRulesPreciseProtection#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#region DataHuaweicloudWafRulesPreciseProtection#region} + */ + readonly region?: string; + /** + * Specifies the ID of the precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#rule_id DataHuaweicloudWafRulesPreciseProtection#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#status DataHuaweicloudWafRulesPreciseProtection#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesPreciseProtectionRulesConditions { +} + +export function dataHuaweicloudWafRulesPreciseProtectionRulesConditionsToTerraform(struct?: DataHuaweicloudWafRulesPreciseProtectionRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesPreciseProtectionRulesConditionsToHclTerraform(struct?: DataHuaweicloudWafRulesPreciseProtectionRulesConditions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesPreciseProtectionRulesConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesPreciseProtectionRulesConditions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesPreciseProtectionRulesConditions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // content - computed: true, optional: false, required: false + public get content() { + return this.getListAttribute('content'); + } + + // field - computed: true, optional: false, required: false + public get field() { + return this.getStringAttribute('field'); + } + + // logic - computed: true, optional: false, required: false + public get logic() { + return this.getStringAttribute('logic'); + } + + // reference_table_id - computed: true, optional: false, required: false + public get referenceTableId() { + return this.getStringAttribute('reference_table_id'); + } + + // subfield - computed: true, optional: false, required: false + public get subfield() { + return this.getStringAttribute('subfield'); + } +} + +export class DataHuaweicloudWafRulesPreciseProtectionRulesConditionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesPreciseProtectionRulesConditionsOutputReference { + return new DataHuaweicloudWafRulesPreciseProtectionRulesConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWafRulesPreciseProtectionRules { +} + +export function dataHuaweicloudWafRulesPreciseProtectionRulesToTerraform(struct?: DataHuaweicloudWafRulesPreciseProtectionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesPreciseProtectionRulesToHclTerraform(struct?: DataHuaweicloudWafRulesPreciseProtectionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesPreciseProtectionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesPreciseProtectionRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesPreciseProtectionRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // conditions - computed: true, optional: false, required: false + private _conditions = new DataHuaweicloudWafRulesPreciseProtectionRulesConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // known_attack_source_id - computed: true, optional: false, required: false + public get knownAttackSourceId() { + return this.getStringAttribute('known_attack_source_id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // time - computed: true, optional: false, required: false + public get time() { + return this.getBooleanAttribute('time'); + } +} + +export class DataHuaweicloudWafRulesPreciseProtectionRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesPreciseProtectionRulesOutputReference { + return new DataHuaweicloudWafRulesPreciseProtectionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection huaweicloud_waf_rules_precise_protection} +*/ +export class DataHuaweicloudWafRulesPreciseProtection extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_precise_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesPreciseProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesPreciseProtection to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesPreciseProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesPreciseProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_precise_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_precise_protection huaweicloud_waf_rules_precise_protection} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesPreciseProtectionConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesPreciseProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_precise_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesPreciseProtectionRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/README.md new file mode 100644 index 00000000..897b62bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_rules_web_tamper_protection` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_rules_web_tamper_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/index.ts new file mode 100644 index 00000000..c55db7b3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-rules-web-tamper-protection/index.ts @@ -0,0 +1,374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafRulesWebTamperProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID to which the protection policy belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#enterprise_project_id DataHuaweicloudWafRulesWebTamperProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#id DataHuaweicloudWafRulesWebTamperProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy to which the web tamper protection rules belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#policy_id DataHuaweicloudWafRulesWebTamperProtection#policy_id} + */ + readonly policyId: string; + /** + * Specifies the region in which to query the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#region DataHuaweicloudWafRulesWebTamperProtection#region} + */ + readonly region?: string; + /** + * Specifies the ID of the web tamper protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#rule_id DataHuaweicloudWafRulesWebTamperProtection#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the status of the web tamper protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#status DataHuaweicloudWafRulesWebTamperProtection#status} + */ + readonly status?: string; +} +export interface DataHuaweicloudWafRulesWebTamperProtectionRules { +} + +export function dataHuaweicloudWafRulesWebTamperProtectionRulesToTerraform(struct?: DataHuaweicloudWafRulesWebTamperProtectionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafRulesWebTamperProtectionRulesToHclTerraform(struct?: DataHuaweicloudWafRulesWebTamperProtectionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafRulesWebTamperProtectionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafRulesWebTamperProtectionRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafRulesWebTamperProtectionRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } +} + +export class DataHuaweicloudWafRulesWebTamperProtectionRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafRulesWebTamperProtectionRulesOutputReference { + return new DataHuaweicloudWafRulesWebTamperProtectionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection huaweicloud_waf_rules_web_tamper_protection} +*/ +export class DataHuaweicloudWafRulesWebTamperProtection extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rules_web_tamper_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafRulesWebTamperProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafRulesWebTamperProtection to import + * @param importFromId The id of the existing DataHuaweicloudWafRulesWebTamperProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafRulesWebTamperProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rules_web_tamper_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_rules_web_tamper_protection huaweicloud_waf_rules_web_tamper_protection} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafRulesWebTamperProtectionConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafRulesWebTamperProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rules_web_tamper_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + this._ruleId = config.ruleId; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_id - computed: false, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // rules - computed: true, optional: false, required: false + private _rules = new DataHuaweicloudWafRulesWebTamperProtectionRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + rule_id: cdktf.stringToTerraform(this._ruleId), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/README.md new file mode 100644 index 00000000..10dba05c --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_waf_source_ips` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_waf_source_ips`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/index.ts new file mode 100644 index 00000000..bf06e515 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-waf-source-ips/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWafSourceIpsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips#id DataHuaweicloudWafSourceIps#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips#region DataHuaweicloudWafSourceIps#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWafSourceIpsSourceIps { +} + +export function dataHuaweicloudWafSourceIpsSourceIpsToTerraform(struct?: DataHuaweicloudWafSourceIpsSourceIps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWafSourceIpsSourceIpsToHclTerraform(struct?: DataHuaweicloudWafSourceIpsSourceIps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWafSourceIpsSourceIpsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWafSourceIpsSourceIps | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWafSourceIpsSourceIps | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ips - computed: true, optional: false, required: false + public get ips() { + return this.getListAttribute('ips'); + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } +} + +export class DataHuaweicloudWafSourceIpsSourceIpsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWafSourceIpsSourceIpsOutputReference { + return new DataHuaweicloudWafSourceIpsSourceIpsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips huaweicloud_waf_source_ips} +*/ +export class DataHuaweicloudWafSourceIps extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_source_ips"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWafSourceIps resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWafSourceIps to import + * @param importFromId The id of the existing DataHuaweicloudWafSourceIps that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWafSourceIps to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_source_ips", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/waf_source_ips huaweicloud_waf_source_ips} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWafSourceIpsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWafSourceIpsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_source_ips', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_ips - computed: true, optional: false, required: false + private _sourceIps = new DataHuaweicloudWafSourceIpsSourceIpsList(this, "source_ips", false); + public get sourceIps() { + return this._sourceIps; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/README.md new file mode 100644 index 00000000..66f8e108 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_workspace_app_groups` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_workspace_app_groups`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/index.ts new file mode 100644 index 00000000..07cc7315 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-groups/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWorkspaceAppGroupsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#group_id DataHuaweicloudWorkspaceAppGroups#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#id DataHuaweicloudWorkspaceAppGroups#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#name DataHuaweicloudWorkspaceAppGroups#name} + */ + readonly name?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#region DataHuaweicloudWorkspaceAppGroups#region} + */ + readonly region?: string; + /** + * Specifies the server group ID associated with the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#server_group_id DataHuaweicloudWorkspaceAppGroups#server_group_id} + */ + readonly serverGroupId?: string; + /** + * Specifies the type of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#type DataHuaweicloudWorkspaceAppGroups#type} + */ + readonly type?: string; +} +export interface DataHuaweicloudWorkspaceAppGroupsGroups { +} + +export function dataHuaweicloudWorkspaceAppGroupsGroupsToTerraform(struct?: DataHuaweicloudWorkspaceAppGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceAppGroupsGroupsToHclTerraform(struct?: DataHuaweicloudWorkspaceAppGroupsGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceAppGroupsGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceAppGroupsGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceAppGroupsGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // app_count - computed: true, optional: false, required: false + public get appCount() { + return this.getNumberAttribute('app_count'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // server_group_id - computed: true, optional: false, required: false + public get serverGroupId() { + return this.getStringAttribute('server_group_id'); + } + + // server_group_name - computed: true, optional: false, required: false + public get serverGroupName() { + return this.getStringAttribute('server_group_name'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudWorkspaceAppGroupsGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceAppGroupsGroupsOutputReference { + return new DataHuaweicloudWorkspaceAppGroupsGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups huaweicloud_workspace_app_groups} +*/ +export class DataHuaweicloudWorkspaceAppGroups extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_groups"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWorkspaceAppGroups resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWorkspaceAppGroups to import + * @param importFromId The id of the existing DataHuaweicloudWorkspaceAppGroups that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWorkspaceAppGroups to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_groups", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_groups huaweicloud_workspace_app_groups} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWorkspaceAppGroupsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWorkspaceAppGroupsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_groups', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._serverGroupId = config.serverGroupId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DataHuaweicloudWorkspaceAppGroupsGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_group_id - computed: false, optional: true, required: false + private _serverGroupId?: string; + public get serverGroupId() { + return this.getStringAttribute('server_group_id'); + } + public set serverGroupId(value: string) { + this._serverGroupId = value; + } + public resetServerGroupId() { + this._serverGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverGroupIdInput() { + return this._serverGroupId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + server_group_id: cdktf.stringToTerraform(this._serverGroupId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_group_id: { + value: cdktf.stringToHclTerraform(this._serverGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/README.md new file mode 100644 index 00000000..2709962f --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_workspace_app_nas_storages` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_workspace_app_nas_storages`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/index.ts new file mode 100644 index 00000000..367f2ff2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-nas-storages/index.ts @@ -0,0 +1,398 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWorkspaceAppNasStoragesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages#id DataHuaweicloudWorkspaceAppNasStorages#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the NAS storage to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages#name DataHuaweicloudWorkspaceAppNasStorages#name} + */ + readonly name?: string; + /** + * The region where the NAS storages are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages#region DataHuaweicloudWorkspaceAppNasStorages#region} + */ + readonly region?: string; + /** + * The ID of the NAS storage to be queried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages#storage_id DataHuaweicloudWorkspaceAppNasStorages#storage_id} + */ + readonly storageId?: string; +} +export interface DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadata { +} + +export function dataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataToTerraform(struct?: DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataToHclTerraform(struct?: DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // storage_class - computed: true, optional: false, required: false + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + + // storage_handle - computed: true, optional: false, required: false + public get storageHandle() { + return this.getStringAttribute('storage_handle'); + } +} + +export class DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataOutputReference { + return new DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWorkspaceAppNasStoragesStorages { +} + +export function dataHuaweicloudWorkspaceAppNasStoragesStoragesToTerraform(struct?: DataHuaweicloudWorkspaceAppNasStoragesStorages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceAppNasStoragesStoragesToHclTerraform(struct?: DataHuaweicloudWorkspaceAppNasStoragesStorages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceAppNasStoragesStoragesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceAppNasStoragesStorages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceAppNasStoragesStorages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // personal_folder_count - computed: true, optional: false, required: false + public get personalFolderCount() { + return this.getNumberAttribute('personal_folder_count'); + } + + // shared_folder_count - computed: true, optional: false, required: false + public get sharedFolderCount() { + return this.getNumberAttribute('shared_folder_count'); + } + + // storage_metadata - computed: true, optional: false, required: false + private _storageMetadata = new DataHuaweicloudWorkspaceAppNasStoragesStoragesStorageMetadataList(this, "storage_metadata", false); + public get storageMetadata() { + return this._storageMetadata; + } +} + +export class DataHuaweicloudWorkspaceAppNasStoragesStoragesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceAppNasStoragesStoragesOutputReference { + return new DataHuaweicloudWorkspaceAppNasStoragesStoragesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages huaweicloud_workspace_app_nas_storages} +*/ +export class DataHuaweicloudWorkspaceAppNasStorages extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_nas_storages"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWorkspaceAppNasStorages resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWorkspaceAppNasStorages to import + * @param importFromId The id of the existing DataHuaweicloudWorkspaceAppNasStorages that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWorkspaceAppNasStorages to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_nas_storages", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_nas_storages huaweicloud_workspace_app_nas_storages} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWorkspaceAppNasStoragesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWorkspaceAppNasStoragesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_nas_storages', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._storageId = config.storageId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_id - computed: false, optional: true, required: false + private _storageId?: string; + public get storageId() { + return this.getStringAttribute('storage_id'); + } + public set storageId(value: string) { + this._storageId = value; + } + public resetStorageId() { + this._storageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageIdInput() { + return this._storageId; + } + + // storages - computed: true, optional: false, required: false + private _storages = new DataHuaweicloudWorkspaceAppNasStoragesStoragesList(this, "storages", false); + public get storages() { + return this._storages; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + storage_id: cdktf.stringToTerraform(this._storageId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_id: { + value: cdktf.stringToHclTerraform(this._storageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/README.md new file mode 100644 index 00000000..8099aa84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_workspace_app_publishable_apps` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_workspace_app_publishable_apps`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/index.ts new file mode 100644 index 00000000..8d66d040 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-publishable-apps/index.ts @@ -0,0 +1,309 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWorkspaceAppPublishableAppsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps#app_group_id DataHuaweicloudWorkspaceAppPublishableApps#app_group_id} + */ + readonly appGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps#id DataHuaweicloudWorkspaceAppPublishableApps#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps#region DataHuaweicloudWorkspaceAppPublishableApps#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWorkspaceAppPublishableAppsApps { +} + +export function dataHuaweicloudWorkspaceAppPublishableAppsAppsToTerraform(struct?: DataHuaweicloudWorkspaceAppPublishableAppsApps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceAppPublishableAppsAppsToHclTerraform(struct?: DataHuaweicloudWorkspaceAppPublishableAppsApps): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceAppPublishableAppsAppsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceAppPublishableAppsApps | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceAppPublishableAppsApps | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // command_param - computed: true, optional: false, required: false + public get commandParam() { + return this.getStringAttribute('command_param'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // execute_path - computed: true, optional: false, required: false + public get executePath() { + return this.getStringAttribute('execute_path'); + } + + // icon_index - computed: true, optional: false, required: false + public get iconIndex() { + return this.getNumberAttribute('icon_index'); + } + + // icon_path - computed: true, optional: false, required: false + public get iconPath() { + return this.getStringAttribute('icon_path'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // publishable - computed: true, optional: false, required: false + public get publishable() { + return this.getBooleanAttribute('publishable'); + } + + // publisher - computed: true, optional: false, required: false + public get publisher() { + return this.getStringAttribute('publisher'); + } + + // source_image_ids - computed: true, optional: false, required: false + public get sourceImageIds() { + return this.getListAttribute('source_image_ids'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // work_path - computed: true, optional: false, required: false + public get workPath() { + return this.getStringAttribute('work_path'); + } +} + +export class DataHuaweicloudWorkspaceAppPublishableAppsAppsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceAppPublishableAppsAppsOutputReference { + return new DataHuaweicloudWorkspaceAppPublishableAppsAppsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps huaweicloud_workspace_app_publishable_apps} +*/ +export class DataHuaweicloudWorkspaceAppPublishableApps extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_publishable_apps"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWorkspaceAppPublishableApps resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWorkspaceAppPublishableApps to import + * @param importFromId The id of the existing DataHuaweicloudWorkspaceAppPublishableApps that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWorkspaceAppPublishableApps to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_publishable_apps", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_publishable_apps huaweicloud_workspace_app_publishable_apps} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWorkspaceAppPublishableAppsConfig + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWorkspaceAppPublishableAppsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_publishable_apps', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appGroupId = config.appGroupId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_group_id - computed: false, optional: false, required: true + private _appGroupId?: string; + public get appGroupId() { + return this.getStringAttribute('app_group_id'); + } + public set appGroupId(value: string) { + this._appGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get appGroupIdInput() { + return this._appGroupId; + } + + // apps - computed: true, optional: false, required: false + private _apps = new DataHuaweicloudWorkspaceAppPublishableAppsAppsList(this, "apps", false); + public get apps() { + return this._apps; + } + + // group_images - computed: true, optional: false, required: false + public get groupImages() { + return this.getListAttribute('group_images'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_group_id: cdktf.stringToTerraform(this._appGroupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_group_id: { + value: cdktf.stringToHclTerraform(this._appGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/README.md new file mode 100644 index 00000000..40f1da35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_workspace_app_storage_policies` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_workspace_app_storage_policies`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/index.ts new file mode 100644 index 00000000..7c24dda5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-app-storage-policies/index.ts @@ -0,0 +1,237 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWorkspaceAppStoragePoliciesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies#id DataHuaweicloudWorkspaceAppStoragePolicies#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the custom storage permission policies are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies#region DataHuaweicloudWorkspaceAppStoragePolicies#region} + */ + readonly region?: string; +} +export interface DataHuaweicloudWorkspaceAppStoragePoliciesPolicies { +} + +export function dataHuaweicloudWorkspaceAppStoragePoliciesPoliciesToTerraform(struct?: DataHuaweicloudWorkspaceAppStoragePoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceAppStoragePoliciesPoliciesToHclTerraform(struct?: DataHuaweicloudWorkspaceAppStoragePoliciesPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceAppStoragePoliciesPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceAppStoragePoliciesPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceAppStoragePoliciesPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // client_actions - computed: true, optional: false, required: false + public get clientActions() { + return cdktf.Fn.tolist(this.getListAttribute('client_actions')); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // server_actions - computed: true, optional: false, required: false + public get serverActions() { + return cdktf.Fn.tolist(this.getListAttribute('server_actions')); + } +} + +export class DataHuaweicloudWorkspaceAppStoragePoliciesPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceAppStoragePoliciesPoliciesOutputReference { + return new DataHuaweicloudWorkspaceAppStoragePoliciesPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies huaweicloud_workspace_app_storage_policies} +*/ +export class DataHuaweicloudWorkspaceAppStoragePolicies extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_storage_policies"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWorkspaceAppStoragePolicies resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWorkspaceAppStoragePolicies to import + * @param importFromId The id of the existing DataHuaweicloudWorkspaceAppStoragePolicies that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWorkspaceAppStoragePolicies to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_storage_policies", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_app_storage_policies huaweicloud_workspace_app_storage_policies} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWorkspaceAppStoragePoliciesConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWorkspaceAppStoragePoliciesConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_storage_policies', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policies - computed: true, optional: false, required: false + private _policies = new DataHuaweicloudWorkspaceAppStoragePoliciesPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/README.md new file mode 100644 index 00000000..4b48fbd4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_workspace_desktops` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_workspace_desktops`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/index.ts new file mode 100644 index 00000000..7c7e1860 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-desktops/index.ts @@ -0,0 +1,975 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWorkspaceDesktopsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#desktop_id DataHuaweicloudWorkspaceDesktops#desktop_id} + */ + readonly desktopId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#desktop_type DataHuaweicloudWorkspaceDesktops#desktop_type} + */ + readonly desktopType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#enterprise_project_id DataHuaweicloudWorkspaceDesktops#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#fixed_ip DataHuaweicloudWorkspaceDesktops#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#id DataHuaweicloudWorkspaceDesktops#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#image_id DataHuaweicloudWorkspaceDesktops#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#in_maintenance_mode DataHuaweicloudWorkspaceDesktops#in_maintenance_mode} + */ + readonly inMaintenanceMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#name DataHuaweicloudWorkspaceDesktops#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#region DataHuaweicloudWorkspaceDesktops#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#status DataHuaweicloudWorkspaceDesktops#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#subnet_id DataHuaweicloudWorkspaceDesktops#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#tags DataHuaweicloudWorkspaceDesktops#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#user_attached DataHuaweicloudWorkspaceDesktops#user_attached} + */ + readonly userAttached?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#user_name DataHuaweicloudWorkspaceDesktops#user_name} + */ + readonly userName?: string; +} +export interface DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfos { +} + +export function dataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosToTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosToHclTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfos): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfos | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfos | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // user_group - computed: true, optional: false, required: false + public get userGroup() { + return this.getStringAttribute('user_group'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosOutputReference { + return new DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWorkspaceDesktopsDesktopsDataVolume { +} + +export function dataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeToTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktopsDataVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeToHclTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktopsDataVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceDesktopsDesktopsDataVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceDesktopsDesktopsDataVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeOutputReference { + return new DataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWorkspaceDesktopsDesktopsRootVolume { +} + +export function dataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeToTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktopsRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeToHclTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktopsRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceDesktopsDesktopsRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceDesktopsDesktopsRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeOutputReference { + return new DataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataHuaweicloudWorkspaceDesktopsDesktops { +} + +export function dataHuaweicloudWorkspaceDesktopsDesktopsToTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktops): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceDesktopsDesktopsToHclTerraform(struct?: DataHuaweicloudWorkspaceDesktopsDesktops): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceDesktopsDesktops | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceDesktopsDesktops | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attach_state - computed: true, optional: false, required: false + public get attachState() { + return this.getStringAttribute('attach_state'); + } + + // attach_user_infos - computed: true, optional: false, required: false + private _attachUserInfos = new DataHuaweicloudWorkspaceDesktopsDesktopsAttachUserInfosList(this, "attach_user_infos", false); + public get attachUserInfos() { + return this._attachUserInfos; + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_volume - computed: true, optional: false, required: false + private _dataVolume = new DataHuaweicloudWorkspaceDesktopsDesktopsDataVolumeList(this, "data_volume", false); + public get dataVolume() { + return this._dataVolume; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // image_id - computed: true, optional: false, required: false + public get imageId() { + return this.getStringAttribute('image_id'); + } + + // in_maintenance_mode - computed: true, optional: false, required: false + public get inMaintenanceMode() { + return this.getBooleanAttribute('in_maintenance_mode'); + } + + // internet_mode - computed: true, optional: false, required: false + public get internetMode() { + return this.getStringAttribute('internet_mode'); + } + + // ip_addresses - computed: true, optional: false, required: false + public get ipAddresses() { + return this.getListAttribute('ip_addresses'); + } + + // is_support_internet - computed: true, optional: false, required: false + public get isSupportInternet() { + return this.getBooleanAttribute('is_support_internet'); + } + + // join_domain - computed: true, optional: false, required: false + public get joinDomain() { + return this.getStringAttribute('join_domain'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // ou_name - computed: true, optional: false, required: false + public get ouName() { + return this.getStringAttribute('ou_name'); + } + + // ou_version - computed: true, optional: false, required: false + public get ouVersion() { + return this.getStringAttribute('ou_version'); + } + + // product_id - computed: true, optional: false, required: false + public get productId() { + return this.getStringAttribute('product_id'); + } + + // root_volume - computed: true, optional: false, required: false + private _rootVolume = new DataHuaweicloudWorkspaceDesktopsDesktopsRootVolumeList(this, "root_volume", false); + public get rootVolume() { + return this._rootVolume; + } + + // site_name - computed: true, optional: false, required: false + public get siteName() { + return this.getStringAttribute('site_name'); + } + + // site_type - computed: true, optional: false, required: false + public get siteType() { + return this.getStringAttribute('site_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: true, optional: false, required: false + private _tags = new cdktf.StringMap(this, "tags"); + public get tags() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DataHuaweicloudWorkspaceDesktopsDesktopsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceDesktopsDesktopsOutputReference { + return new DataHuaweicloudWorkspaceDesktopsDesktopsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops huaweicloud_workspace_desktops} +*/ +export class DataHuaweicloudWorkspaceDesktops extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_desktops"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWorkspaceDesktops resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWorkspaceDesktops to import + * @param importFromId The id of the existing DataHuaweicloudWorkspaceDesktops that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWorkspaceDesktops to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_desktops", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_desktops huaweicloud_workspace_desktops} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWorkspaceDesktopsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWorkspaceDesktopsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_desktops', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._desktopId = config.desktopId; + this._desktopType = config.desktopType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fixedIp = config.fixedIp; + this._id = config.id; + this._imageId = config.imageId; + this._inMaintenanceMode = config.inMaintenanceMode; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._userAttached = config.userAttached; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // desktop_id - computed: false, optional: true, required: false + private _desktopId?: string; + public get desktopId() { + return this.getStringAttribute('desktop_id'); + } + public set desktopId(value: string) { + this._desktopId = value; + } + public resetDesktopId() { + this._desktopId = undefined; + } + // Temporarily expose input value. Use with caution. + public get desktopIdInput() { + return this._desktopId; + } + + // desktop_type - computed: false, optional: true, required: false + private _desktopType?: string; + public get desktopType() { + return this.getStringAttribute('desktop_type'); + } + public set desktopType(value: string) { + this._desktopType = value; + } + public resetDesktopType() { + this._desktopType = undefined; + } + // Temporarily expose input value. Use with caution. + public get desktopTypeInput() { + return this._desktopType; + } + + // desktops - computed: true, optional: false, required: false + private _desktops = new DataHuaweicloudWorkspaceDesktopsDesktopsList(this, "desktops", false); + public get desktops() { + return this._desktops; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // in_maintenance_mode - computed: false, optional: true, required: false + private _inMaintenanceMode?: string; + public get inMaintenanceMode() { + return this.getStringAttribute('in_maintenance_mode'); + } + public set inMaintenanceMode(value: string) { + this._inMaintenanceMode = value; + } + public resetInMaintenanceMode() { + this._inMaintenanceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get inMaintenanceModeInput() { + return this._inMaintenanceMode; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // user_attached - computed: false, optional: true, required: false + private _userAttached?: string; + public get userAttached() { + return this.getStringAttribute('user_attached'); + } + public set userAttached(value: string) { + this._userAttached = value; + } + public resetUserAttached() { + this._userAttached = undefined; + } + // Temporarily expose input value. Use with caution. + public get userAttachedInput() { + return this._userAttached; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + desktop_id: cdktf.stringToTerraform(this._desktopId), + desktop_type: cdktf.stringToTerraform(this._desktopType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + in_maintenance_mode: cdktf.stringToTerraform(this._inMaintenanceMode), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_attached: cdktf.stringToTerraform(this._userAttached), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + desktop_id: { + value: cdktf.stringToHclTerraform(this._desktopId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + desktop_type: { + value: cdktf.stringToHclTerraform(this._desktopType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + in_maintenance_mode: { + value: cdktf.stringToHclTerraform(this._inMaintenanceMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_attached: { + value: cdktf.stringToHclTerraform(this._userAttached), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/README.md b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/README.md new file mode 100644 index 00000000..c8e5d6f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/README.md @@ -0,0 +1,3 @@ +# `data_huaweicloud_workspace_flavors` + +Refer to the Terraform Registry for docs: [`data_huaweicloud_workspace_flavors`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors). diff --git a/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/index.ts b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/index.ts new file mode 100644 index 00000000..ab2fd854 --- /dev/null +++ b/src/constructs/providers/huaweicloud/data-huaweicloud-workspace-flavors/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataHuaweicloudWorkspaceFlavorsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#availability_zone DataHuaweicloudWorkspaceFlavors#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#id DataHuaweicloudWorkspaceFlavors#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#memory DataHuaweicloudWorkspaceFlavors#memory} + */ + readonly memory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#os_type DataHuaweicloudWorkspaceFlavors#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#region DataHuaweicloudWorkspaceFlavors#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#vcpus DataHuaweicloudWorkspaceFlavors#vcpus} + */ + readonly vcpus?: number; +} +export interface DataHuaweicloudWorkspaceFlavorsFlavors { +} + +export function dataHuaweicloudWorkspaceFlavorsFlavorsToTerraform(struct?: DataHuaweicloudWorkspaceFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataHuaweicloudWorkspaceFlavorsFlavorsToHclTerraform(struct?: DataHuaweicloudWorkspaceFlavorsFlavors): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataHuaweicloudWorkspaceFlavorsFlavorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataHuaweicloudWorkspaceFlavorsFlavors | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataHuaweicloudWorkspaceFlavorsFlavors | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // architecture - computed: true, optional: false, required: false + public get architecture() { + return this.getStringAttribute('architecture'); + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_gpu - computed: true, optional: false, required: false + public get isGpu() { + return this.getBooleanAttribute('is_gpu'); + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getNumberAttribute('memory'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // system_disk_size - computed: true, optional: false, required: false + public get systemDiskSize() { + return this.getStringAttribute('system_disk_size'); + } + + // system_disk_type - computed: true, optional: false, required: false + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } +} + +export class DataHuaweicloudWorkspaceFlavorsFlavorsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataHuaweicloudWorkspaceFlavorsFlavorsOutputReference { + return new DataHuaweicloudWorkspaceFlavorsFlavorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors huaweicloud_workspace_flavors} +*/ +export class DataHuaweicloudWorkspaceFlavors extends cdktf.TerraformDataSource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_flavors"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataHuaweicloudWorkspaceFlavors resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataHuaweicloudWorkspaceFlavors to import + * @param importFromId The id of the existing DataHuaweicloudWorkspaceFlavors that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataHuaweicloudWorkspaceFlavors to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_flavors", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/data-sources/workspace_flavors huaweicloud_workspace_flavors} Data Source + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataHuaweicloudWorkspaceFlavorsConfig = {} + */ + public constructor(scope: Construct, id: string, config: DataHuaweicloudWorkspaceFlavorsConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_flavors', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._id = config.id; + this._memory = config.memory; + this._osType = config.osType; + this._region = config.region; + this._vcpus = config.vcpus; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // flavors - computed: true, optional: false, required: false + private _flavors = new DataHuaweicloudWorkspaceFlavorsFlavorsList(this, "flavors", false); + public get flavors() { + return this._flavors; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // memory - computed: false, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } + + // os_type - computed: false, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus - computed: false, optional: true, required: false + private _vcpus?: number; + public get vcpus() { + return this.getNumberAttribute('vcpus'); + } + public set vcpus(value: number) { + this._vcpus = value; + } + public resetVcpus() { + this._vcpus = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusInput() { + return this._vcpus; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + id: cdktf.stringToTerraform(this._id), + memory: cdktf.numberToTerraform(this._memory), + os_type: cdktf.stringToTerraform(this._osType), + region: cdktf.stringToTerraform(this._region), + vcpus: cdktf.numberToTerraform(this._vcpus), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(this._memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus: { + value: cdktf.numberToHclTerraform(this._vcpus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/README.md new file mode 100644 index 00000000..a3c0afae --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_batch_publish` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_batch_publish`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/index.ts new file mode 100644 index 00000000..48948e16 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publish/index.ts @@ -0,0 +1,459 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureBatchPublishConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the user ID of the architecture reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#approver_user_id DataartsArchitectureBatchPublish#approver_user_id} + */ + readonly approverUserId: string; + /** + * Specifies the user name of the architecture reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#approver_user_name DataartsArchitectureBatchPublish#approver_user_name} + */ + readonly approverUserName: string; + /** + * Specifies whether to automatically review. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#fast_approval DataartsArchitectureBatchPublish#fast_approval} + */ + readonly fastApproval?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#id DataartsArchitectureBatchPublish#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#region DataartsArchitectureBatchPublish#region} + */ + readonly region?: string; + /** + * Specifies scheduling time of the DataArts quality job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#schedule_time DataartsArchitectureBatchPublish#schedule_time} + */ + readonly scheduleTime?: string; + /** + * The ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#workspace_id DataartsArchitectureBatchPublish#workspace_id} + */ + readonly workspaceId: string; + /** + * biz_infos block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#biz_infos DataartsArchitectureBatchPublish#biz_infos} + */ + readonly bizInfos: DataartsArchitectureBatchPublishBizInfos[] | cdktf.IResolvable; +} +export interface DataartsArchitectureBatchPublishBizInfos { + /** + * Specifies the ID of the object to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#biz_id DataartsArchitectureBatchPublish#biz_id} + */ + readonly bizId: string; + /** + * Specifies the type of the object to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#biz_type DataartsArchitectureBatchPublish#biz_type} + */ + readonly bizType: string; +} + +export function dataartsArchitectureBatchPublishBizInfosToTerraform(struct?: DataartsArchitectureBatchPublishBizInfos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + biz_id: cdktf.stringToTerraform(struct!.bizId), + biz_type: cdktf.stringToTerraform(struct!.bizType), + } +} + + +export function dataartsArchitectureBatchPublishBizInfosToHclTerraform(struct?: DataartsArchitectureBatchPublishBizInfos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + biz_id: { + value: cdktf.stringToHclTerraform(struct!.bizId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_type: { + value: cdktf.stringToHclTerraform(struct!.bizType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureBatchPublishBizInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureBatchPublishBizInfos | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bizId !== undefined) { + hasAnyValues = true; + internalValueResult.bizId = this._bizId; + } + if (this._bizType !== undefined) { + hasAnyValues = true; + internalValueResult.bizType = this._bizType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureBatchPublishBizInfos | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bizId = undefined; + this._bizType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bizId = value.bizId; + this._bizType = value.bizType; + } + } + + // biz_id - computed: false, optional: false, required: true + private _bizId?: string; + public get bizId() { + return this.getStringAttribute('biz_id'); + } + public set bizId(value: string) { + this._bizId = value; + } + // Temporarily expose input value. Use with caution. + public get bizIdInput() { + return this._bizId; + } + + // biz_type - computed: false, optional: false, required: true + private _bizType?: string; + public get bizType() { + return this.getStringAttribute('biz_type'); + } + public set bizType(value: string) { + this._bizType = value; + } + // Temporarily expose input value. Use with caution. + public get bizTypeInput() { + return this._bizType; + } +} + +export class DataartsArchitectureBatchPublishBizInfosList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureBatchPublishBizInfos[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureBatchPublishBizInfosOutputReference { + return new DataartsArchitectureBatchPublishBizInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish huaweicloud_dataarts_architecture_batch_publish} +*/ +export class DataartsArchitectureBatchPublish extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_batch_publish"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureBatchPublish resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureBatchPublish to import + * @param importFromId The id of the existing DataartsArchitectureBatchPublish that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureBatchPublish to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_batch_publish", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publish huaweicloud_dataarts_architecture_batch_publish} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureBatchPublishConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureBatchPublishConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_batch_publish', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._approverUserId = config.approverUserId; + this._approverUserName = config.approverUserName; + this._fastApproval = config.fastApproval; + this._id = config.id; + this._region = config.region; + this._scheduleTime = config.scheduleTime; + this._workspaceId = config.workspaceId; + this._bizInfos.internalValue = config.bizInfos; + } + + // ========== + // ATTRIBUTES + // ========== + + // approver_user_id - computed: false, optional: false, required: true + private _approverUserId?: string; + public get approverUserId() { + return this.getStringAttribute('approver_user_id'); + } + public set approverUserId(value: string) { + this._approverUserId = value; + } + // Temporarily expose input value. Use with caution. + public get approverUserIdInput() { + return this._approverUserId; + } + + // approver_user_name - computed: false, optional: false, required: true + private _approverUserName?: string; + public get approverUserName() { + return this.getStringAttribute('approver_user_name'); + } + public set approverUserName(value: string) { + this._approverUserName = value; + } + // Temporarily expose input value. Use with caution. + public get approverUserNameInput() { + return this._approverUserName; + } + + // fast_approval - computed: false, optional: true, required: false + private _fastApproval?: boolean | cdktf.IResolvable; + public get fastApproval() { + return this.getBooleanAttribute('fast_approval'); + } + public set fastApproval(value: boolean | cdktf.IResolvable) { + this._fastApproval = value; + } + public resetFastApproval() { + this._fastApproval = undefined; + } + // Temporarily expose input value. Use with caution. + public get fastApprovalInput() { + return this._fastApproval; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schedule_time - computed: false, optional: true, required: false + private _scheduleTime?: string; + public get scheduleTime() { + return this.getStringAttribute('schedule_time'); + } + public set scheduleTime(value: string) { + this._scheduleTime = value; + } + public resetScheduleTime() { + this._scheduleTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleTimeInput() { + return this._scheduleTime; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // biz_infos - computed: false, optional: false, required: true + private _bizInfos = new DataartsArchitectureBatchPublishBizInfosList(this, "biz_infos", false); + public get bizInfos() { + return this._bizInfos; + } + public putBizInfos(value: DataartsArchitectureBatchPublishBizInfos[] | cdktf.IResolvable) { + this._bizInfos.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bizInfosInput() { + return this._bizInfos.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + approver_user_id: cdktf.stringToTerraform(this._approverUserId), + approver_user_name: cdktf.stringToTerraform(this._approverUserName), + fast_approval: cdktf.booleanToTerraform(this._fastApproval), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + schedule_time: cdktf.stringToTerraform(this._scheduleTime), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + biz_infos: cdktf.listMapper(dataartsArchitectureBatchPublishBizInfosToTerraform, true)(this._bizInfos.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + approver_user_id: { + value: cdktf.stringToHclTerraform(this._approverUserId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + approver_user_name: { + value: cdktf.stringToHclTerraform(this._approverUserName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fast_approval: { + value: cdktf.booleanToHclTerraform(this._fastApproval), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_time: { + value: cdktf.stringToHclTerraform(this._scheduleTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_infos: { + value: cdktf.listMapperHcl(dataartsArchitectureBatchPublishBizInfosToHclTerraform, true)(this._bizInfos.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureBatchPublishBizInfosList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/README.md new file mode 100644 index 00000000..e405ed68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_batch_publishment` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_batch_publishment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/index.ts new file mode 100644 index 00000000..47b3d39b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-publishment/index.ts @@ -0,0 +1,459 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureBatchPublishmentConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the user ID of the architecture reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#approver_user_id DataartsArchitectureBatchPublishment#approver_user_id} + */ + readonly approverUserId: string; + /** + * Specifies the user name of the architecture reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#approver_user_name DataartsArchitectureBatchPublishment#approver_user_name} + */ + readonly approverUserName: string; + /** + * Specifies whether to automatically review. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#fast_approval DataartsArchitectureBatchPublishment#fast_approval} + */ + readonly fastApproval?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#id DataartsArchitectureBatchPublishment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#region DataartsArchitectureBatchPublishment#region} + */ + readonly region?: string; + /** + * Specifies scheduling time of the DataArts quality job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#schedule_time DataartsArchitectureBatchPublishment#schedule_time} + */ + readonly scheduleTime?: string; + /** + * The ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#workspace_id DataartsArchitectureBatchPublishment#workspace_id} + */ + readonly workspaceId: string; + /** + * biz_infos block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#biz_infos DataartsArchitectureBatchPublishment#biz_infos} + */ + readonly bizInfos: DataartsArchitectureBatchPublishmentBizInfos[] | cdktf.IResolvable; +} +export interface DataartsArchitectureBatchPublishmentBizInfos { + /** + * Specifies the ID of the object to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#biz_id DataartsArchitectureBatchPublishment#biz_id} + */ + readonly bizId: string; + /** + * Specifies the type of the object to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#biz_type DataartsArchitectureBatchPublishment#biz_type} + */ + readonly bizType: string; +} + +export function dataartsArchitectureBatchPublishmentBizInfosToTerraform(struct?: DataartsArchitectureBatchPublishmentBizInfos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + biz_id: cdktf.stringToTerraform(struct!.bizId), + biz_type: cdktf.stringToTerraform(struct!.bizType), + } +} + + +export function dataartsArchitectureBatchPublishmentBizInfosToHclTerraform(struct?: DataartsArchitectureBatchPublishmentBizInfos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + biz_id: { + value: cdktf.stringToHclTerraform(struct!.bizId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_type: { + value: cdktf.stringToHclTerraform(struct!.bizType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureBatchPublishmentBizInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureBatchPublishmentBizInfos | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bizId !== undefined) { + hasAnyValues = true; + internalValueResult.bizId = this._bizId; + } + if (this._bizType !== undefined) { + hasAnyValues = true; + internalValueResult.bizType = this._bizType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureBatchPublishmentBizInfos | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bizId = undefined; + this._bizType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bizId = value.bizId; + this._bizType = value.bizType; + } + } + + // biz_id - computed: false, optional: false, required: true + private _bizId?: string; + public get bizId() { + return this.getStringAttribute('biz_id'); + } + public set bizId(value: string) { + this._bizId = value; + } + // Temporarily expose input value. Use with caution. + public get bizIdInput() { + return this._bizId; + } + + // biz_type - computed: false, optional: false, required: true + private _bizType?: string; + public get bizType() { + return this.getStringAttribute('biz_type'); + } + public set bizType(value: string) { + this._bizType = value; + } + // Temporarily expose input value. Use with caution. + public get bizTypeInput() { + return this._bizType; + } +} + +export class DataartsArchitectureBatchPublishmentBizInfosList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureBatchPublishmentBizInfos[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureBatchPublishmentBizInfosOutputReference { + return new DataartsArchitectureBatchPublishmentBizInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment huaweicloud_dataarts_architecture_batch_publishment} +*/ +export class DataartsArchitectureBatchPublishment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_batch_publishment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureBatchPublishment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureBatchPublishment to import + * @param importFromId The id of the existing DataartsArchitectureBatchPublishment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureBatchPublishment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_batch_publishment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_publishment huaweicloud_dataarts_architecture_batch_publishment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureBatchPublishmentConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureBatchPublishmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_batch_publishment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._approverUserId = config.approverUserId; + this._approverUserName = config.approverUserName; + this._fastApproval = config.fastApproval; + this._id = config.id; + this._region = config.region; + this._scheduleTime = config.scheduleTime; + this._workspaceId = config.workspaceId; + this._bizInfos.internalValue = config.bizInfos; + } + + // ========== + // ATTRIBUTES + // ========== + + // approver_user_id - computed: false, optional: false, required: true + private _approverUserId?: string; + public get approverUserId() { + return this.getStringAttribute('approver_user_id'); + } + public set approverUserId(value: string) { + this._approverUserId = value; + } + // Temporarily expose input value. Use with caution. + public get approverUserIdInput() { + return this._approverUserId; + } + + // approver_user_name - computed: false, optional: false, required: true + private _approverUserName?: string; + public get approverUserName() { + return this.getStringAttribute('approver_user_name'); + } + public set approverUserName(value: string) { + this._approverUserName = value; + } + // Temporarily expose input value. Use with caution. + public get approverUserNameInput() { + return this._approverUserName; + } + + // fast_approval - computed: false, optional: true, required: false + private _fastApproval?: boolean | cdktf.IResolvable; + public get fastApproval() { + return this.getBooleanAttribute('fast_approval'); + } + public set fastApproval(value: boolean | cdktf.IResolvable) { + this._fastApproval = value; + } + public resetFastApproval() { + this._fastApproval = undefined; + } + // Temporarily expose input value. Use with caution. + public get fastApprovalInput() { + return this._fastApproval; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schedule_time - computed: false, optional: true, required: false + private _scheduleTime?: string; + public get scheduleTime() { + return this.getStringAttribute('schedule_time'); + } + public set scheduleTime(value: string) { + this._scheduleTime = value; + } + public resetScheduleTime() { + this._scheduleTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleTimeInput() { + return this._scheduleTime; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // biz_infos - computed: false, optional: false, required: true + private _bizInfos = new DataartsArchitectureBatchPublishmentBizInfosList(this, "biz_infos", false); + public get bizInfos() { + return this._bizInfos; + } + public putBizInfos(value: DataartsArchitectureBatchPublishmentBizInfos[] | cdktf.IResolvable) { + this._bizInfos.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bizInfosInput() { + return this._bizInfos.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + approver_user_id: cdktf.stringToTerraform(this._approverUserId), + approver_user_name: cdktf.stringToTerraform(this._approverUserName), + fast_approval: cdktf.booleanToTerraform(this._fastApproval), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + schedule_time: cdktf.stringToTerraform(this._scheduleTime), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + biz_infos: cdktf.listMapper(dataartsArchitectureBatchPublishmentBizInfosToTerraform, true)(this._bizInfos.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + approver_user_id: { + value: cdktf.stringToHclTerraform(this._approverUserId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + approver_user_name: { + value: cdktf.stringToHclTerraform(this._approverUserName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fast_approval: { + value: cdktf.booleanToHclTerraform(this._fastApproval), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_time: { + value: cdktf.stringToHclTerraform(this._scheduleTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_infos: { + value: cdktf.listMapperHcl(dataartsArchitectureBatchPublishmentBizInfosToHclTerraform, true)(this._bizInfos.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureBatchPublishmentBizInfosList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/README.md new file mode 100644 index 00000000..7e8dc0e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_batch_unpublish` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_batch_unpublish`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/index.ts new file mode 100644 index 00000000..cbaad312 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-batch-unpublish/index.ts @@ -0,0 +1,429 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureBatchUnpublishConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the user ID of the architecture reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#approver_user_id DataartsArchitectureBatchUnpublish#approver_user_id} + */ + readonly approverUserId: string; + /** + * Specifies the user name of the architecture reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#approver_user_name DataartsArchitectureBatchUnpublish#approver_user_name} + */ + readonly approverUserName: string; + /** + * Specifies whether to automatically review. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#fast_approval DataartsArchitectureBatchUnpublish#fast_approval} + */ + readonly fastApproval?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#id DataartsArchitectureBatchUnpublish#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#region DataartsArchitectureBatchUnpublish#region} + */ + readonly region?: string; + /** + * The ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#workspace_id DataartsArchitectureBatchUnpublish#workspace_id} + */ + readonly workspaceId: string; + /** + * biz_infos block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#biz_infos DataartsArchitectureBatchUnpublish#biz_infos} + */ + readonly bizInfos: DataartsArchitectureBatchUnpublishBizInfos[] | cdktf.IResolvable; +} +export interface DataartsArchitectureBatchUnpublishBizInfos { + /** + * Specifies the ID of the object to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#biz_id DataartsArchitectureBatchUnpublish#biz_id} + */ + readonly bizId: string; + /** + * Specifies the type of the object to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#biz_type DataartsArchitectureBatchUnpublish#biz_type} + */ + readonly bizType: string; +} + +export function dataartsArchitectureBatchUnpublishBizInfosToTerraform(struct?: DataartsArchitectureBatchUnpublishBizInfos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + biz_id: cdktf.stringToTerraform(struct!.bizId), + biz_type: cdktf.stringToTerraform(struct!.bizType), + } +} + + +export function dataartsArchitectureBatchUnpublishBizInfosToHclTerraform(struct?: DataartsArchitectureBatchUnpublishBizInfos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + biz_id: { + value: cdktf.stringToHclTerraform(struct!.bizId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_type: { + value: cdktf.stringToHclTerraform(struct!.bizType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureBatchUnpublishBizInfosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureBatchUnpublishBizInfos | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bizId !== undefined) { + hasAnyValues = true; + internalValueResult.bizId = this._bizId; + } + if (this._bizType !== undefined) { + hasAnyValues = true; + internalValueResult.bizType = this._bizType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureBatchUnpublishBizInfos | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bizId = undefined; + this._bizType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bizId = value.bizId; + this._bizType = value.bizType; + } + } + + // biz_id - computed: false, optional: false, required: true + private _bizId?: string; + public get bizId() { + return this.getStringAttribute('biz_id'); + } + public set bizId(value: string) { + this._bizId = value; + } + // Temporarily expose input value. Use with caution. + public get bizIdInput() { + return this._bizId; + } + + // biz_type - computed: false, optional: false, required: true + private _bizType?: string; + public get bizType() { + return this.getStringAttribute('biz_type'); + } + public set bizType(value: string) { + this._bizType = value; + } + // Temporarily expose input value. Use with caution. + public get bizTypeInput() { + return this._bizType; + } +} + +export class DataartsArchitectureBatchUnpublishBizInfosList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureBatchUnpublishBizInfos[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureBatchUnpublishBizInfosOutputReference { + return new DataartsArchitectureBatchUnpublishBizInfosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish huaweicloud_dataarts_architecture_batch_unpublish} +*/ +export class DataartsArchitectureBatchUnpublish extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_batch_unpublish"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureBatchUnpublish resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureBatchUnpublish to import + * @param importFromId The id of the existing DataartsArchitectureBatchUnpublish that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureBatchUnpublish to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_batch_unpublish", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_batch_unpublish huaweicloud_dataarts_architecture_batch_unpublish} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureBatchUnpublishConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureBatchUnpublishConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_batch_unpublish', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._approverUserId = config.approverUserId; + this._approverUserName = config.approverUserName; + this._fastApproval = config.fastApproval; + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._bizInfos.internalValue = config.bizInfos; + } + + // ========== + // ATTRIBUTES + // ========== + + // approver_user_id - computed: false, optional: false, required: true + private _approverUserId?: string; + public get approverUserId() { + return this.getStringAttribute('approver_user_id'); + } + public set approverUserId(value: string) { + this._approverUserId = value; + } + // Temporarily expose input value. Use with caution. + public get approverUserIdInput() { + return this._approverUserId; + } + + // approver_user_name - computed: false, optional: false, required: true + private _approverUserName?: string; + public get approverUserName() { + return this.getStringAttribute('approver_user_name'); + } + public set approverUserName(value: string) { + this._approverUserName = value; + } + // Temporarily expose input value. Use with caution. + public get approverUserNameInput() { + return this._approverUserName; + } + + // fast_approval - computed: false, optional: true, required: false + private _fastApproval?: boolean | cdktf.IResolvable; + public get fastApproval() { + return this.getBooleanAttribute('fast_approval'); + } + public set fastApproval(value: boolean | cdktf.IResolvable) { + this._fastApproval = value; + } + public resetFastApproval() { + this._fastApproval = undefined; + } + // Temporarily expose input value. Use with caution. + public get fastApprovalInput() { + return this._fastApproval; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // biz_infos - computed: false, optional: false, required: true + private _bizInfos = new DataartsArchitectureBatchUnpublishBizInfosList(this, "biz_infos", false); + public get bizInfos() { + return this._bizInfos; + } + public putBizInfos(value: DataartsArchitectureBatchUnpublishBizInfos[] | cdktf.IResolvable) { + this._bizInfos.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bizInfosInput() { + return this._bizInfos.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + approver_user_id: cdktf.stringToTerraform(this._approverUserId), + approver_user_name: cdktf.stringToTerraform(this._approverUserName), + fast_approval: cdktf.booleanToTerraform(this._fastApproval), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + biz_infos: cdktf.listMapper(dataartsArchitectureBatchUnpublishBizInfosToTerraform, true)(this._bizInfos.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + approver_user_id: { + value: cdktf.stringToHclTerraform(this._approverUserId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + approver_user_name: { + value: cdktf.stringToHclTerraform(this._approverUserName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fast_approval: { + value: cdktf.booleanToHclTerraform(this._fastApproval), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_infos: { + value: cdktf.listMapperHcl(dataartsArchitectureBatchUnpublishBizInfosToHclTerraform, true)(this._bizInfos.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureBatchUnpublishBizInfosList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/README.md new file mode 100644 index 00000000..e614ad6a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_business_metric` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_business_metric`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/index.ts new file mode 100644 index 00000000..60618bfe --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-business-metric/index.ts @@ -0,0 +1,779 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureBusinessMetricConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the application scenarios. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#apply_scenario DataartsArchitectureBusinessMetric#apply_scenario} + */ + readonly applyScenario?: string; + /** + * Specifies the process architecture ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#biz_catalog_id DataartsArchitectureBusinessMetric#biz_catalog_id} + */ + readonly bizCatalogId: string; + /** + * Specifies the indicator encoding. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#code DataartsArchitectureBusinessMetric#code} + */ + readonly code?: string; + /** + * Specifies the data sources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#data_origin DataartsArchitectureBusinessMetric#data_origin} + */ + readonly dataOrigin?: string; + /** + * Specifies the indicator definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#definition DataartsArchitectureBusinessMetric#definition} + */ + readonly definition: string; + /** + * Specifies the description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#description DataartsArchitectureBusinessMetric#description} + */ + readonly description?: string; + /** + * Specifies the purpose of setting. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#destination DataartsArchitectureBusinessMetric#destination} + */ + readonly destination: string; + /** + * Specifies the statistical dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#dimensions DataartsArchitectureBusinessMetric#dimensions} + */ + readonly dimensions?: string; + /** + * Specifies the calculation formula. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#expression DataartsArchitectureBusinessMetric#expression} + */ + readonly expression: string; + /** + * Specifies the statistical caliber and modifiers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#general_filters DataartsArchitectureBusinessMetric#general_filters} + */ + readonly generalFilters?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#id DataartsArchitectureBusinessMetric#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the refresh frequency. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#interval_type DataartsArchitectureBusinessMetric#interval_type} + */ + readonly intervalType: string; + /** + * Specifies the measurement object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#measure DataartsArchitectureBusinessMetric#measure} + */ + readonly measure?: string; + /** + * Specifies the name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#name DataartsArchitectureBusinessMetric#name} + */ + readonly name: string; + /** + * Specifies the indicator alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#name_alias DataartsArchitectureBusinessMetric#name_alias} + */ + readonly nameAlias?: string; + /** + * Specifies the name of person responsible for the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#owner DataartsArchitectureBusinessMetric#owner} + */ + readonly owner: string; + /** + * Specifies the indicator management department name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#owner_department DataartsArchitectureBusinessMetric#owner_department} + */ + readonly ownerDepartment: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#region DataartsArchitectureBusinessMetric#region} + */ + readonly region?: string; + /** + * Specifies the related technical indicators. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#technical_metric DataartsArchitectureBusinessMetric#technical_metric} + */ + readonly technicalMetric?: number; + /** + * Specifies the statistical frequency. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#time_filters DataartsArchitectureBusinessMetric#time_filters} + */ + readonly timeFilters: string; + /** + * Specifies the unit of measurement. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#unit DataartsArchitectureBusinessMetric#unit} + */ + readonly unit?: string; + /** + * Specifies the ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#workspace_id DataartsArchitectureBusinessMetric#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric huaweicloud_dataarts_architecture_business_metric} +*/ +export class DataartsArchitectureBusinessMetric extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_business_metric"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureBusinessMetric resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureBusinessMetric to import + * @param importFromId The id of the existing DataartsArchitectureBusinessMetric that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureBusinessMetric to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_business_metric", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_business_metric huaweicloud_dataarts_architecture_business_metric} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureBusinessMetricConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureBusinessMetricConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_business_metric', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applyScenario = config.applyScenario; + this._bizCatalogId = config.bizCatalogId; + this._code = config.code; + this._dataOrigin = config.dataOrigin; + this._definition = config.definition; + this._description = config.description; + this._destination = config.destination; + this._dimensions = config.dimensions; + this._expression = config.expression; + this._generalFilters = config.generalFilters; + this._id = config.id; + this._intervalType = config.intervalType; + this._measure = config.measure; + this._name = config.name; + this._nameAlias = config.nameAlias; + this._owner = config.owner; + this._ownerDepartment = config.ownerDepartment; + this._region = config.region; + this._technicalMetric = config.technicalMetric; + this._timeFilters = config.timeFilters; + this._unit = config.unit; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // apply_scenario - computed: false, optional: true, required: false + private _applyScenario?: string; + public get applyScenario() { + return this.getStringAttribute('apply_scenario'); + } + public set applyScenario(value: string) { + this._applyScenario = value; + } + public resetApplyScenario() { + this._applyScenario = undefined; + } + // Temporarily expose input value. Use with caution. + public get applyScenarioInput() { + return this._applyScenario; + } + + // biz_catalog_id - computed: false, optional: false, required: true + private _bizCatalogId?: string; + public get bizCatalogId() { + return this.getStringAttribute('biz_catalog_id'); + } + public set bizCatalogId(value: string) { + this._bizCatalogId = value; + } + // Temporarily expose input value. Use with caution. + public get bizCatalogIdInput() { + return this._bizCatalogId; + } + + // biz_catalog_path - computed: true, optional: false, required: false + public get bizCatalogPath() { + return this.getStringAttribute('biz_catalog_path'); + } + + // biz_metric - computed: true, optional: false, required: false + public get bizMetric() { + return this.getStringAttribute('biz_metric'); + } + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // data_origin - computed: false, optional: true, required: false + private _dataOrigin?: string; + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + public set dataOrigin(value: string) { + this._dataOrigin = value; + } + public resetDataOrigin() { + this._dataOrigin = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataOriginInput() { + return this._dataOrigin; + } + + // definition - computed: false, optional: false, required: true + private _definition?: string; + public get definition() { + return this.getStringAttribute('definition'); + } + public set definition(value: string) { + this._definition = value; + } + // Temporarily expose input value. Use with caution. + public get definitionInput() { + return this._definition; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // dimensions - computed: false, optional: true, required: false + private _dimensions?: string; + public get dimensions() { + return this.getStringAttribute('dimensions'); + } + public set dimensions(value: string) { + this._dimensions = value; + } + public resetDimensions() { + this._dimensions = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions; + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // general_filters - computed: false, optional: true, required: false + private _generalFilters?: string; + public get generalFilters() { + return this.getStringAttribute('general_filters'); + } + public set generalFilters(value: string) { + this._generalFilters = value; + } + public resetGeneralFilters() { + this._generalFilters = undefined; + } + // Temporarily expose input value. Use with caution. + public get generalFiltersInput() { + return this._generalFilters; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interval_type - computed: false, optional: false, required: true + private _intervalType?: string; + public get intervalType() { + return this.getStringAttribute('interval_type'); + } + public set intervalType(value: string) { + this._intervalType = value; + } + // Temporarily expose input value. Use with caution. + public get intervalTypeInput() { + return this._intervalType; + } + + // l1 - computed: true, optional: false, required: false + public get l1() { + return this.getStringAttribute('l1'); + } + + // l2 - computed: true, optional: false, required: false + public get l2() { + return this.getStringAttribute('l2'); + } + + // l3 - computed: true, optional: false, required: false + public get l3() { + return this.getStringAttribute('l3'); + } + + // measure - computed: false, optional: true, required: false + private _measure?: string; + public get measure() { + return this.getStringAttribute('measure'); + } + public set measure(value: string) { + this._measure = value; + } + public resetMeasure() { + this._measure = undefined; + } + // Temporarily expose input value. Use with caution. + public get measureInput() { + return this._measure; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // name_alias - computed: false, optional: true, required: false + private _nameAlias?: string; + public get nameAlias() { + return this.getStringAttribute('name_alias'); + } + public set nameAlias(value: string) { + this._nameAlias = value; + } + public resetNameAlias() { + this._nameAlias = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameAliasInput() { + return this._nameAlias; + } + + // owner - computed: false, optional: false, required: true + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // owner_department - computed: false, optional: false, required: true + private _ownerDepartment?: string; + public get ownerDepartment() { + return this.getStringAttribute('owner_department'); + } + public set ownerDepartment(value: string) { + this._ownerDepartment = value; + } + // Temporarily expose input value. Use with caution. + public get ownerDepartmentInput() { + return this._ownerDepartment; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // summary_status - computed: true, optional: false, required: false + public get summaryStatus() { + return this.getStringAttribute('summary_status'); + } + + // technical_metric - computed: false, optional: true, required: false + private _technicalMetric?: number; + public get technicalMetric() { + return this.getNumberAttribute('technical_metric'); + } + public set technicalMetric(value: number) { + this._technicalMetric = value; + } + public resetTechnicalMetric() { + this._technicalMetric = undefined; + } + // Temporarily expose input value. Use with caution. + public get technicalMetricInput() { + return this._technicalMetric; + } + + // technical_metric_name - computed: true, optional: false, required: false + public get technicalMetricName() { + return this.getStringAttribute('technical_metric_name'); + } + + // technical_metric_type - computed: true, optional: false, required: false + public get technicalMetricType() { + return this.getStringAttribute('technical_metric_type'); + } + + // time_filters - computed: false, optional: false, required: true + private _timeFilters?: string; + public get timeFilters() { + return this.getStringAttribute('time_filters'); + } + public set timeFilters(value: string) { + this._timeFilters = value; + } + // Temporarily expose input value. Use with caution. + public get timeFiltersInput() { + return this._timeFilters; + } + + // unit - computed: false, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + apply_scenario: cdktf.stringToTerraform(this._applyScenario), + biz_catalog_id: cdktf.stringToTerraform(this._bizCatalogId), + code: cdktf.stringToTerraform(this._code), + data_origin: cdktf.stringToTerraform(this._dataOrigin), + definition: cdktf.stringToTerraform(this._definition), + description: cdktf.stringToTerraform(this._description), + destination: cdktf.stringToTerraform(this._destination), + dimensions: cdktf.stringToTerraform(this._dimensions), + expression: cdktf.stringToTerraform(this._expression), + general_filters: cdktf.stringToTerraform(this._generalFilters), + id: cdktf.stringToTerraform(this._id), + interval_type: cdktf.stringToTerraform(this._intervalType), + measure: cdktf.stringToTerraform(this._measure), + name: cdktf.stringToTerraform(this._name), + name_alias: cdktf.stringToTerraform(this._nameAlias), + owner: cdktf.stringToTerraform(this._owner), + owner_department: cdktf.stringToTerraform(this._ownerDepartment), + region: cdktf.stringToTerraform(this._region), + technical_metric: cdktf.numberToTerraform(this._technicalMetric), + time_filters: cdktf.stringToTerraform(this._timeFilters), + unit: cdktf.stringToTerraform(this._unit), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + apply_scenario: { + value: cdktf.stringToHclTerraform(this._applyScenario), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + biz_catalog_id: { + value: cdktf.stringToHclTerraform(this._bizCatalogId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_origin: { + value: cdktf.stringToHclTerraform(this._dataOrigin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + definition: { + value: cdktf.stringToHclTerraform(this._definition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimensions: { + value: cdktf.stringToHclTerraform(this._dimensions), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(this._expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + general_filters: { + value: cdktf.stringToHclTerraform(this._generalFilters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval_type: { + value: cdktf.stringToHclTerraform(this._intervalType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + measure: { + value: cdktf.stringToHclTerraform(this._measure), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_alias: { + value: cdktf.stringToHclTerraform(this._nameAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner_department: { + value: cdktf.stringToHclTerraform(this._ownerDepartment), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + technical_metric: { + value: cdktf.numberToHclTerraform(this._technicalMetric), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_filters: { + value: cdktf.stringToHclTerraform(this._timeFilters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unit: { + value: cdktf.stringToHclTerraform(this._unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/README.md new file mode 100644 index 00000000..41ec9914 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_code_table_values` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_code_table_values`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/index.ts new file mode 100644 index 00000000..6ca9dd68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table-values/index.ts @@ -0,0 +1,487 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureCodeTableValuesConfig extends cdktf.TerraformMetaArguments { + /** + * The code of the code table field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#field_code DataartsArchitectureCodeTableValues#field_code} + */ + readonly fieldCode: string; + /** + * The ID of the code table field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#field_id DataartsArchitectureCodeTableValues#field_id} + */ + readonly fieldId: string; + /** + * The name of the code table field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#field_name DataartsArchitectureCodeTableValues#field_name} + */ + readonly fieldName: string; + /** + * The ordinal of the code table field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#field_ordinal DataartsArchitectureCodeTableValues#field_ordinal} + */ + readonly fieldOrdinal: number; + /** + * The type of the code table field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#field_type DataartsArchitectureCodeTableValues#field_type} + */ + readonly fieldType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#id DataartsArchitectureCodeTableValues#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#region DataartsArchitectureCodeTableValues#region} + */ + readonly region?: string; + /** + * The ID of the code table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#table_id DataartsArchitectureCodeTableValues#table_id} + */ + readonly tableId: string; + /** + * The ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#workspace_id DataartsArchitectureCodeTableValues#workspace_id} + */ + readonly workspaceId: string; + /** + * values block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#values DataartsArchitectureCodeTableValues#values} + */ + readonly values: DataartsArchitectureCodeTableValuesValues[] | cdktf.IResolvable; +} +export interface DataartsArchitectureCodeTableValuesValues { + /** + * The value of a field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#value DataartsArchitectureCodeTableValues#value} + */ + readonly value: string; +} + +export function dataartsArchitectureCodeTableValuesValuesToTerraform(struct?: DataartsArchitectureCodeTableValuesValues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dataartsArchitectureCodeTableValuesValuesToHclTerraform(struct?: DataartsArchitectureCodeTableValuesValues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureCodeTableValuesValuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureCodeTableValuesValues | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureCodeTableValuesValues | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._value = value.value; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ordinal - computed: true, optional: false, required: false + public get ordinal() { + return this.getNumberAttribute('ordinal'); + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DataartsArchitectureCodeTableValuesValuesList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureCodeTableValuesValues[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureCodeTableValuesValuesOutputReference { + return new DataartsArchitectureCodeTableValuesValuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values huaweicloud_dataarts_architecture_code_table_values} +*/ +export class DataartsArchitectureCodeTableValues extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_code_table_values"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureCodeTableValues resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureCodeTableValues to import + * @param importFromId The id of the existing DataartsArchitectureCodeTableValues that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureCodeTableValues to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_code_table_values", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table_values huaweicloud_dataarts_architecture_code_table_values} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureCodeTableValuesConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureCodeTableValuesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_code_table_values', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fieldCode = config.fieldCode; + this._fieldId = config.fieldId; + this._fieldName = config.fieldName; + this._fieldOrdinal = config.fieldOrdinal; + this._fieldType = config.fieldType; + this._id = config.id; + this._region = config.region; + this._tableId = config.tableId; + this._workspaceId = config.workspaceId; + this._values.internalValue = config.values; + } + + // ========== + // ATTRIBUTES + // ========== + + // field_code - computed: false, optional: false, required: true + private _fieldCode?: string; + public get fieldCode() { + return this.getStringAttribute('field_code'); + } + public set fieldCode(value: string) { + this._fieldCode = value; + } + // Temporarily expose input value. Use with caution. + public get fieldCodeInput() { + return this._fieldCode; + } + + // field_id - computed: false, optional: false, required: true + private _fieldId?: string; + public get fieldId() { + return this.getStringAttribute('field_id'); + } + public set fieldId(value: string) { + this._fieldId = value; + } + // Temporarily expose input value. Use with caution. + public get fieldIdInput() { + return this._fieldId; + } + + // field_name - computed: false, optional: false, required: true + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // field_ordinal - computed: false, optional: false, required: true + private _fieldOrdinal?: number; + public get fieldOrdinal() { + return this.getNumberAttribute('field_ordinal'); + } + public set fieldOrdinal(value: number) { + this._fieldOrdinal = value; + } + // Temporarily expose input value. Use with caution. + public get fieldOrdinalInput() { + return this._fieldOrdinal; + } + + // field_type - computed: false, optional: false, required: true + private _fieldType?: string; + public get fieldType() { + return this.getStringAttribute('field_type'); + } + public set fieldType(value: string) { + this._fieldType = value; + } + // Temporarily expose input value. Use with caution. + public get fieldTypeInput() { + return this._fieldType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // table_id - computed: false, optional: false, required: true + private _tableId?: string; + public get tableId() { + return this.getStringAttribute('table_id'); + } + public set tableId(value: string) { + this._tableId = value; + } + // Temporarily expose input value. Use with caution. + public get tableIdInput() { + return this._tableId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // values - computed: false, optional: false, required: true + private _values = new DataartsArchitectureCodeTableValuesValuesList(this, "values", false); + public get values() { + return this._values; + } + public putValues(value: DataartsArchitectureCodeTableValuesValues[] | cdktf.IResolvable) { + this._values.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + field_code: cdktf.stringToTerraform(this._fieldCode), + field_id: cdktf.stringToTerraform(this._fieldId), + field_name: cdktf.stringToTerraform(this._fieldName), + field_ordinal: cdktf.numberToTerraform(this._fieldOrdinal), + field_type: cdktf.stringToTerraform(this._fieldType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + table_id: cdktf.stringToTerraform(this._tableId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + values: cdktf.listMapper(dataartsArchitectureCodeTableValuesValuesToTerraform, true)(this._values.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + field_code: { + value: cdktf.stringToHclTerraform(this._fieldCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_id: { + value: cdktf.stringToHclTerraform(this._fieldId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_name: { + value: cdktf.stringToHclTerraform(this._fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_ordinal: { + value: cdktf.numberToHclTerraform(this._fieldOrdinal), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + field_type: { + value: cdktf.stringToHclTerraform(this._fieldType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_id: { + value: cdktf.stringToHclTerraform(this._tableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(dataartsArchitectureCodeTableValuesValuesToHclTerraform, true)(this._values.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureCodeTableValuesValuesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-code-table/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table/README.md new file mode 100644 index 00000000..707933a1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_code_table` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_code_table`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-code-table/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table/index.ts new file mode 100644 index 00000000..b569fc28 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-code-table/index.ts @@ -0,0 +1,560 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureCodeTableConfig extends cdktf.TerraformMetaArguments { + /** + * The code of the code table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#code DataartsArchitectureCodeTable#code} + */ + readonly code: string; + /** + * The description of the code table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#description DataartsArchitectureCodeTable#description} + */ + readonly description?: string; + /** + * The directory ID of the code table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#directory_id DataartsArchitectureCodeTable#directory_id} + */ + readonly directoryId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#id DataartsArchitectureCodeTable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the code table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#name DataartsArchitectureCodeTable#name} + */ + readonly name: string; + /** + * The region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#region DataartsArchitectureCodeTable#region} + */ + readonly region?: string; + /** + * The ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#workspace_id DataartsArchitectureCodeTable#workspace_id} + */ + readonly workspaceId: string; + /** + * fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#fields DataartsArchitectureCodeTable#fields} + */ + readonly fields: DataartsArchitectureCodeTableFields[] | cdktf.IResolvable; +} +export interface DataartsArchitectureCodeTableFields { + /** + * The code of a field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#code DataartsArchitectureCodeTable#code} + */ + readonly code: string; + /** + * The description of a field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#description DataartsArchitectureCodeTable#description} + */ + readonly description?: string; + /** + * The name of a field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#name DataartsArchitectureCodeTable#name} + */ + readonly name: string; + /** + * The type of a field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#type DataartsArchitectureCodeTable#type} + */ + readonly type: string; +} + +export function dataartsArchitectureCodeTableFieldsToTerraform(struct?: DataartsArchitectureCodeTableFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + code: cdktf.stringToTerraform(struct!.code), + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dataartsArchitectureCodeTableFieldsToHclTerraform(struct?: DataartsArchitectureCodeTableFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + code: { + value: cdktf.stringToHclTerraform(struct!.code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureCodeTableFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureCodeTableFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._code !== undefined) { + hasAnyValues = true; + internalValueResult.code = this._code; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureCodeTableFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._code = undefined; + this._description = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._code = value.code; + this._description = value.description; + this._name = value.name; + this._type = value.type; + } + } + + // code - computed: false, optional: false, required: true + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ordinal - computed: true, optional: false, required: false + public get ordinal() { + return this.getNumberAttribute('ordinal'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DataartsArchitectureCodeTableFieldsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureCodeTableFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureCodeTableFieldsOutputReference { + return new DataartsArchitectureCodeTableFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table huaweicloud_dataarts_architecture_code_table} +*/ +export class DataartsArchitectureCodeTable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_code_table"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureCodeTable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureCodeTable to import + * @param importFromId The id of the existing DataartsArchitectureCodeTable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureCodeTable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_code_table", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_code_table huaweicloud_dataarts_architecture_code_table} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureCodeTableConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureCodeTableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_code_table', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._description = config.description; + this._directoryId = config.directoryId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._fields.internalValue = config.fields; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: false, optional: false, required: true + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // directory_id - computed: false, optional: false, required: true + private _directoryId?: string; + public get directoryId() { + return this.getStringAttribute('directory_id'); + } + public set directoryId(value: string) { + this._directoryId = value; + } + // Temporarily expose input value. Use with caution. + public get directoryIdInput() { + return this._directoryId; + } + + // directory_path - computed: true, optional: false, required: false + public get directoryPath() { + return this.getStringAttribute('directory_path'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // fields - computed: false, optional: false, required: true + private _fields = new DataartsArchitectureCodeTableFieldsList(this, "fields", false); + public get fields() { + return this._fields; + } + public putFields(value: DataartsArchitectureCodeTableFields[] | cdktf.IResolvable) { + this._fields.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get fieldsInput() { + return this._fields.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + description: cdktf.stringToTerraform(this._description), + directory_id: cdktf.stringToTerraform(this._directoryId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + fields: cdktf.listMapper(dataartsArchitectureCodeTableFieldsToTerraform, true)(this._fields.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + directory_id: { + value: cdktf.stringToHclTerraform(this._directoryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fields: { + value: cdktf.listMapperHcl(dataartsArchitectureCodeTableFieldsToHclTerraform, true)(this._fields.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureCodeTableFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/README.md new file mode 100644 index 00000000..8d6f0ccc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_data_standard_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_data_standard_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/index.ts new file mode 100644 index 00000000..12c0f569 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard-template/index.ts @@ -0,0 +1,684 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureDataStandardTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#id DataartsArchitectureDataStandardTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#region DataartsArchitectureDataStandardTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#workspace_id DataartsArchitectureDataStandardTemplate#workspace_id} + */ + readonly workspaceId: string; + /** + * custom_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#custom_fields DataartsArchitectureDataStandardTemplate#custom_fields} + */ + readonly customFields?: DataartsArchitectureDataStandardTemplateCustomFields[] | cdktf.IResolvable; + /** + * optional_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#optional_fields DataartsArchitectureDataStandardTemplate#optional_fields} + */ + readonly optionalFields?: DataartsArchitectureDataStandardTemplateOptionalFields[] | cdktf.IResolvable; +} +export interface DataartsArchitectureDataStandardTemplateCustomFields { + /** + * Specifies the name of the field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#fd_name DataartsArchitectureDataStandardTemplate#fd_name} + */ + readonly fdName: string; + /** + * Specifies the optional values of the field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#optional_values DataartsArchitectureDataStandardTemplate#optional_values} + */ + readonly optionalValues?: string; + /** + * Specifies whether the field is required. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#required DataartsArchitectureDataStandardTemplate#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * Specifies whether the field is search supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#searchable DataartsArchitectureDataStandardTemplate#searchable} + */ + readonly searchable?: boolean | cdktf.IResolvable; +} + +export function dataartsArchitectureDataStandardTemplateCustomFieldsToTerraform(struct?: DataartsArchitectureDataStandardTemplateCustomFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + fd_name: cdktf.stringToTerraform(struct!.fdName), + optional_values: cdktf.stringToTerraform(struct!.optionalValues), + required: cdktf.booleanToTerraform(struct!.required), + searchable: cdktf.booleanToTerraform(struct!.searchable), + } +} + + +export function dataartsArchitectureDataStandardTemplateCustomFieldsToHclTerraform(struct?: DataartsArchitectureDataStandardTemplateCustomFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + fd_name: { + value: cdktf.stringToHclTerraform(struct!.fdName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + optional_values: { + value: cdktf.stringToHclTerraform(struct!.optionalValues), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + searchable: { + value: cdktf.booleanToHclTerraform(struct!.searchable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureDataStandardTemplateCustomFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureDataStandardTemplateCustomFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fdName !== undefined) { + hasAnyValues = true; + internalValueResult.fdName = this._fdName; + } + if (this._optionalValues !== undefined) { + hasAnyValues = true; + internalValueResult.optionalValues = this._optionalValues; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._searchable !== undefined) { + hasAnyValues = true; + internalValueResult.searchable = this._searchable; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureDataStandardTemplateCustomFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fdName = undefined; + this._optionalValues = undefined; + this._required = undefined; + this._searchable = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fdName = value.fdName; + this._optionalValues = value.optionalValues; + this._required = value.required; + this._searchable = value.searchable; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // fd_name - computed: false, optional: false, required: true + private _fdName?: string; + public get fdName() { + return this.getStringAttribute('fd_name'); + } + public set fdName(value: string) { + this._fdName = value; + } + // Temporarily expose input value. Use with caution. + public get fdNameInput() { + return this._fdName; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // optional_values - computed: false, optional: true, required: false + private _optionalValues?: string; + public get optionalValues() { + return this.getStringAttribute('optional_values'); + } + public set optionalValues(value: string) { + this._optionalValues = value; + } + public resetOptionalValues() { + this._optionalValues = undefined; + } + // Temporarily expose input value. Use with caution. + public get optionalValuesInput() { + return this._optionalValues; + } + + // required - computed: false, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // searchable - computed: false, optional: true, required: false + private _searchable?: boolean | cdktf.IResolvable; + public get searchable() { + return this.getBooleanAttribute('searchable'); + } + public set searchable(value: boolean | cdktf.IResolvable) { + this._searchable = value; + } + public resetSearchable() { + this._searchable = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchableInput() { + return this._searchable; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataartsArchitectureDataStandardTemplateCustomFieldsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureDataStandardTemplateCustomFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureDataStandardTemplateCustomFieldsOutputReference { + return new DataartsArchitectureDataStandardTemplateCustomFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureDataStandardTemplateOptionalFields { + /** + * Specifies the name of the field. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#fd_name DataartsArchitectureDataStandardTemplate#fd_name} + */ + readonly fdName: string; + /** + * Specifies whether the field is required. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#required DataartsArchitectureDataStandardTemplate#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * Specifies whether the field is search supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#searchable DataartsArchitectureDataStandardTemplate#searchable} + */ + readonly searchable?: boolean | cdktf.IResolvable; +} + +export function dataartsArchitectureDataStandardTemplateOptionalFieldsToTerraform(struct?: DataartsArchitectureDataStandardTemplateOptionalFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + fd_name: cdktf.stringToTerraform(struct!.fdName), + required: cdktf.booleanToTerraform(struct!.required), + searchable: cdktf.booleanToTerraform(struct!.searchable), + } +} + + +export function dataartsArchitectureDataStandardTemplateOptionalFieldsToHclTerraform(struct?: DataartsArchitectureDataStandardTemplateOptionalFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + fd_name: { + value: cdktf.stringToHclTerraform(struct!.fdName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + searchable: { + value: cdktf.booleanToHclTerraform(struct!.searchable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureDataStandardTemplateOptionalFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureDataStandardTemplateOptionalFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fdName !== undefined) { + hasAnyValues = true; + internalValueResult.fdName = this._fdName; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._searchable !== undefined) { + hasAnyValues = true; + internalValueResult.searchable = this._searchable; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureDataStandardTemplateOptionalFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fdName = undefined; + this._required = undefined; + this._searchable = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fdName = value.fdName; + this._required = value.required; + this._searchable = value.searchable; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // fd_name - computed: false, optional: false, required: true + private _fdName?: string; + public get fdName() { + return this.getStringAttribute('fd_name'); + } + public set fdName(value: string) { + this._fdName = value; + } + // Temporarily expose input value. Use with caution. + public get fdNameInput() { + return this._fdName; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // required - computed: false, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // searchable - computed: false, optional: true, required: false + private _searchable?: boolean | cdktf.IResolvable; + public get searchable() { + return this.getBooleanAttribute('searchable'); + } + public set searchable(value: boolean | cdktf.IResolvable) { + this._searchable = value; + } + public resetSearchable() { + this._searchable = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchableInput() { + return this._searchable; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataartsArchitectureDataStandardTemplateOptionalFieldsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureDataStandardTemplateOptionalFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureDataStandardTemplateOptionalFieldsOutputReference { + return new DataartsArchitectureDataStandardTemplateOptionalFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template huaweicloud_dataarts_architecture_data_standard_template} +*/ +export class DataartsArchitectureDataStandardTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_data_standard_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureDataStandardTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureDataStandardTemplate to import + * @param importFromId The id of the existing DataartsArchitectureDataStandardTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureDataStandardTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_data_standard_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard_template huaweicloud_dataarts_architecture_data_standard_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureDataStandardTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureDataStandardTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_data_standard_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._customFields.internalValue = config.customFields; + this._optionalFields.internalValue = config.optionalFields; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // custom_fields - computed: false, optional: true, required: false + private _customFields = new DataartsArchitectureDataStandardTemplateCustomFieldsList(this, "custom_fields", true); + public get customFields() { + return this._customFields; + } + public putCustomFields(value: DataartsArchitectureDataStandardTemplateCustomFields[] | cdktf.IResolvable) { + this._customFields.internalValue = value; + } + public resetCustomFields() { + this._customFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customFieldsInput() { + return this._customFields.internalValue; + } + + // optional_fields - computed: false, optional: true, required: false + private _optionalFields = new DataartsArchitectureDataStandardTemplateOptionalFieldsList(this, "optional_fields", true); + public get optionalFields() { + return this._optionalFields; + } + public putOptionalFields(value: DataartsArchitectureDataStandardTemplateOptionalFields[] | cdktf.IResolvable) { + this._optionalFields.internalValue = value; + } + public resetOptionalFields() { + this._optionalFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get optionalFieldsInput() { + return this._optionalFields.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + custom_fields: cdktf.listMapper(dataartsArchitectureDataStandardTemplateCustomFieldsToTerraform, true)(this._customFields.internalValue), + optional_fields: cdktf.listMapper(dataartsArchitectureDataStandardTemplateOptionalFieldsToTerraform, true)(this._optionalFields.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_fields: { + value: cdktf.listMapperHcl(dataartsArchitectureDataStandardTemplateCustomFieldsToHclTerraform, true)(this._customFields.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataartsArchitectureDataStandardTemplateCustomFieldsList", + }, + optional_fields: { + value: cdktf.listMapperHcl(dataartsArchitectureDataStandardTemplateOptionalFieldsToHclTerraform, true)(this._optionalFields.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataartsArchitectureDataStandardTemplateOptionalFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/README.md new file mode 100644 index 00000000..a716f39c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_data_standard` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_data_standard`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/index.ts new file mode 100644 index 00000000..338eef02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-data-standard/index.ts @@ -0,0 +1,566 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureDataStandardConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the directory ID that the data standard belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#directory_id DataartsArchitectureDataStandard#directory_id} + */ + readonly directoryId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#id DataartsArchitectureDataStandard#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#region DataartsArchitectureDataStandard#region} + */ + readonly region?: string; + /** + * Specifies the workspace ID of DataArts Architecture. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#workspace_id DataartsArchitectureDataStandard#workspace_id} + */ + readonly workspaceId: string; + /** + * values block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#values DataartsArchitectureDataStandard#values} + */ + readonly values: DataartsArchitectureDataStandardValues[] | cdktf.IResolvable; +} +export interface DataartsArchitectureDataStandardNewBiz { +} + +export function dataartsArchitectureDataStandardNewBizToTerraform(struct?: DataartsArchitectureDataStandardNewBiz): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataartsArchitectureDataStandardNewBizToHclTerraform(struct?: DataartsArchitectureDataStandardNewBiz): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataartsArchitectureDataStandardNewBizOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureDataStandardNewBiz | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureDataStandardNewBiz | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // biz_id - computed: true, optional: false, required: false + public get bizId() { + return this.getStringAttribute('biz_id'); + } + + // biz_info - computed: true, optional: false, required: false + public get bizInfo() { + return this.getStringAttribute('biz_info'); + } + + // biz_type - computed: true, optional: false, required: false + public get bizType() { + return this.getStringAttribute('biz_type'); + } + + // biz_version - computed: true, optional: false, required: false + public get bizVersion() { + return this.getStringAttribute('biz_version'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataartsArchitectureDataStandardNewBizList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureDataStandardNewBizOutputReference { + return new DataartsArchitectureDataStandardNewBizOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureDataStandardValues { + /** + * Specifies the name of the data standard attribute. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#fd_name DataartsArchitectureDataStandard#fd_name} + */ + readonly fdName: string; + /** + * Specifies the value of the data standard attribute. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#fd_value DataartsArchitectureDataStandard#fd_value} + */ + readonly fdValue?: string; +} + +export function dataartsArchitectureDataStandardValuesToTerraform(struct?: DataartsArchitectureDataStandardValues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + fd_name: cdktf.stringToTerraform(struct!.fdName), + fd_value: cdktf.stringToTerraform(struct!.fdValue), + } +} + + +export function dataartsArchitectureDataStandardValuesToHclTerraform(struct?: DataartsArchitectureDataStandardValues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + fd_name: { + value: cdktf.stringToHclTerraform(struct!.fdName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fd_value: { + value: cdktf.stringToHclTerraform(struct!.fdValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureDataStandardValuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureDataStandardValues | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fdName !== undefined) { + hasAnyValues = true; + internalValueResult.fdName = this._fdName; + } + if (this._fdValue !== undefined) { + hasAnyValues = true; + internalValueResult.fdValue = this._fdValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureDataStandardValues | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fdName = undefined; + this._fdValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fdName = value.fdName; + this._fdValue = value.fdValue; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // directory_id - computed: true, optional: false, required: false + public get directoryId() { + return this.getStringAttribute('directory_id'); + } + + // fd_id - computed: true, optional: false, required: false + public get fdId() { + return this.getStringAttribute('fd_id'); + } + + // fd_name - computed: false, optional: false, required: true + private _fdName?: string; + public get fdName() { + return this.getStringAttribute('fd_name'); + } + public set fdName(value: string) { + this._fdName = value; + } + // Temporarily expose input value. Use with caution. + public get fdNameInput() { + return this._fdName; + } + + // fd_value - computed: false, optional: true, required: false + private _fdValue?: string; + public get fdValue() { + return this.getStringAttribute('fd_value'); + } + public set fdValue(value: string) { + this._fdValue = value; + } + public resetFdValue() { + this._fdValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get fdValueInput() { + return this._fdValue; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // row_id - computed: true, optional: false, required: false + public get rowId() { + return this.getStringAttribute('row_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataartsArchitectureDataStandardValuesList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureDataStandardValues[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureDataStandardValuesOutputReference { + return new DataartsArchitectureDataStandardValuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard huaweicloud_dataarts_architecture_data_standard} +*/ +export class DataartsArchitectureDataStandard extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_data_standard"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureDataStandard resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureDataStandard to import + * @param importFromId The id of the existing DataartsArchitectureDataStandard that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureDataStandard to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_data_standard", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_data_standard huaweicloud_dataarts_architecture_data_standard} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureDataStandardConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureDataStandardConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_data_standard', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._directoryId = config.directoryId; + this._id = config.id; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._values.internalValue = config.values; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // directory_id - computed: false, optional: false, required: true + private _directoryId?: string; + public get directoryId() { + return this.getStringAttribute('directory_id'); + } + public set directoryId(value: string) { + this._directoryId = value; + } + // Temporarily expose input value. Use with caution. + public get directoryIdInput() { + return this._directoryId; + } + + // directory_path - computed: true, optional: false, required: false + public get directoryPath() { + return this.getStringAttribute('directory_path'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // new_biz - computed: true, optional: false, required: false + private _newBiz = new DataartsArchitectureDataStandardNewBizList(this, "new_biz", false); + public get newBiz() { + return this._newBiz; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // values - computed: false, optional: false, required: true + private _values = new DataartsArchitectureDataStandardValuesList(this, "values", true); + public get values() { + return this._values; + } + public putValues(value: DataartsArchitectureDataStandardValues[] | cdktf.IResolvable) { + this._values.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + directory_id: cdktf.stringToTerraform(this._directoryId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + values: cdktf.listMapper(dataartsArchitectureDataStandardValuesToTerraform, true)(this._values.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + directory_id: { + value: cdktf.stringToHclTerraform(this._directoryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(dataartsArchitectureDataStandardValuesToHclTerraform, true)(this._values.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataartsArchitectureDataStandardValuesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-directory/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-directory/README.md new file mode 100644 index 00000000..b30efc3d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-directory/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_directory` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_directory`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-directory/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-directory/index.ts new file mode 100644 index 00000000..6b05521a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-directory/index.ts @@ -0,0 +1,310 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureDirectoryConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#description DataartsArchitectureDirectory#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#id DataartsArchitectureDirectory#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#name DataartsArchitectureDirectory#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#parent_id DataartsArchitectureDirectory#parent_id} + */ + readonly parentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#region DataartsArchitectureDirectory#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#type DataartsArchitectureDirectory#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#workspace_id DataartsArchitectureDirectory#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory huaweicloud_dataarts_architecture_directory} +*/ +export class DataartsArchitectureDirectory extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_directory"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureDirectory resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureDirectory to import + * @param importFromId The id of the existing DataartsArchitectureDirectory that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureDirectory to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_directory", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_directory huaweicloud_dataarts_architecture_directory} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureDirectoryConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureDirectoryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_directory', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._parentId = config.parentId; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // children - computed: true, optional: false, required: false + public get children() { + return this.getListAttribute('children'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // qualified_name - computed: true, optional: false, required: false + public get qualifiedName() { + return this.getStringAttribute('qualified_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // root_id - computed: true, optional: false, required: false + public get rootId() { + return this.getStringAttribute('root_id'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-model/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-model/README.md new file mode 100644 index 00000000..b4109f64 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-model/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_model` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_model`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-model/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-model/index.ts new file mode 100644 index 00000000..3a2c6a0c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-model/index.ts @@ -0,0 +1,348 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureModelConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#description DataartsArchitectureModel#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#dw_type DataartsArchitectureModel#dw_type} + */ + readonly dwType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#id DataartsArchitectureModel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#level DataartsArchitectureModel#level} + */ + readonly level?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#name DataartsArchitectureModel#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#physical DataartsArchitectureModel#physical} + */ + readonly physical: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#region DataartsArchitectureModel#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#type DataartsArchitectureModel#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#workspace_id DataartsArchitectureModel#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model huaweicloud_dataarts_architecture_model} +*/ +export class DataartsArchitectureModel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_model"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureModel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureModel to import + * @param importFromId The id of the existing DataartsArchitectureModel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureModel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_model", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_model huaweicloud_dataarts_architecture_model} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureModelConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureModelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_model', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._dwType = config.dwType; + this._id = config.id; + this._level = config.level; + this._name = config.name; + this._physical = config.physical; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dw_type - computed: true, optional: true, required: false + private _dwType?: string; + public get dwType() { + return this.getStringAttribute('dw_type'); + } + public set dwType(value: string) { + this._dwType = value; + } + public resetDwType() { + this._dwType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dwTypeInput() { + return this._dwType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: true, optional: true, required: false + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // physical - computed: false, optional: false, required: true + private _physical?: boolean | cdktf.IResolvable; + public get physical() { + return this.getBooleanAttribute('physical'); + } + public set physical(value: boolean | cdktf.IResolvable) { + this._physical = value; + } + // Temporarily expose input value. Use with caution. + public get physicalInput() { + return this._physical; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + dw_type: cdktf.stringToTerraform(this._dwType), + id: cdktf.stringToTerraform(this._id), + level: cdktf.stringToTerraform(this._level), + name: cdktf.stringToTerraform(this._name), + physical: cdktf.booleanToTerraform(this._physical), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dw_type: { + value: cdktf.stringToHclTerraform(this._dwType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + physical: { + value: cdktf.booleanToHclTerraform(this._physical), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-process/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-process/README.md new file mode 100644 index 00000000..a5f33c29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-process/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_process` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_process`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-process/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-process/index.ts new file mode 100644 index 00000000..275d9068 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-process/index.ts @@ -0,0 +1,377 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureProcessConfig extends cdktf.TerraformMetaArguments { + /** + * The description of process. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#description DataartsArchitectureProcess#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#id DataartsArchitectureProcess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of catalog. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#name DataartsArchitectureProcess#name} + */ + readonly name: string; + /** + * The ID of the next node in the process. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#next_id DataartsArchitectureProcess#next_id} + */ + readonly nextId?: string; + /** + * The name of person responsible for process. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#owner DataartsArchitectureProcess#owner} + */ + readonly owner: string; + /** + * The parent process ID of process. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#parent_id DataartsArchitectureProcess#parent_id} + */ + readonly parentId?: string; + /** + * The ID of the previous node in the process. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#prev_id DataartsArchitectureProcess#prev_id} + */ + readonly prevId?: string; + /** + * The region where the process is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#region DataartsArchitectureProcess#region} + */ + readonly region?: string; + /** + * The ID of DataArts Studio workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#workspace_id DataartsArchitectureProcess#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process huaweicloud_dataarts_architecture_process} +*/ +export class DataartsArchitectureProcess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_process"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureProcess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureProcess to import + * @param importFromId The id of the existing DataartsArchitectureProcess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureProcess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_process", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_process huaweicloud_dataarts_architecture_process} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureProcessConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureProcessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_process', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._nextId = config.nextId; + this._owner = config.owner; + this._parentId = config.parentId; + this._prevId = config.prevId; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // children - computed: true, optional: false, required: false + public get children() { + return this.getListAttribute('children'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // next_id - computed: true, optional: true, required: false + private _nextId?: string; + public get nextId() { + return this.getStringAttribute('next_id'); + } + public set nextId(value: string) { + this._nextId = value; + } + public resetNextId() { + this._nextId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nextIdInput() { + return this._nextId; + } + + // owner - computed: false, optional: false, required: true + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // prev_id - computed: true, optional: true, required: false + private _prevId?: string; + public get prevId() { + return this.getStringAttribute('prev_id'); + } + public set prevId(value: string) { + this._prevId = value; + } + public resetPrevId() { + this._prevId = undefined; + } + // Temporarily expose input value. Use with caution. + public get prevIdInput() { + return this._prevId; + } + + // qualified_id - computed: true, optional: false, required: false + public get qualifiedId() { + return this.getStringAttribute('qualified_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + next_id: cdktf.stringToTerraform(this._nextId), + owner: cdktf.stringToTerraform(this._owner), + parent_id: cdktf.stringToTerraform(this._parentId), + prev_id: cdktf.stringToTerraform(this._prevId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + next_id: { + value: cdktf.stringToHclTerraform(this._nextId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prev_id: { + value: cdktf.stringToHclTerraform(this._prevId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/README.md new file mode 100644 index 00000000..d3c9174d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_reviewer` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_reviewer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/index.ts new file mode 100644 index 00000000..e1b84fbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-reviewer/index.ts @@ -0,0 +1,280 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureReviewerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#email DataartsArchitectureReviewer#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#id DataartsArchitectureReviewer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#phone_number DataartsArchitectureReviewer#phone_number} + */ + readonly phoneNumber?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#region DataartsArchitectureReviewer#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#user_id DataartsArchitectureReviewer#user_id} + */ + readonly userId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#user_name DataartsArchitectureReviewer#user_name} + */ + readonly userName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#workspace_id DataartsArchitectureReviewer#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer huaweicloud_dataarts_architecture_reviewer} +*/ +export class DataartsArchitectureReviewer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_reviewer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureReviewer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureReviewer to import + * @param importFromId The id of the existing DataartsArchitectureReviewer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureReviewer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_reviewer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_reviewer huaweicloud_dataarts_architecture_reviewer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureReviewerConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureReviewerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_reviewer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._email = config.email; + this._id = config.id; + this._phoneNumber = config.phoneNumber; + this._region = config.region; + this._userId = config.userId; + this._userName = config.userName; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // email - computed: false, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // phone_number - computed: false, optional: true, required: false + private _phoneNumber?: string; + public get phoneNumber() { + return this.getStringAttribute('phone_number'); + } + public set phoneNumber(value: string) { + this._phoneNumber = value; + } + public resetPhoneNumber() { + this._phoneNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneNumberInput() { + return this._phoneNumber; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reviewer_id - computed: true, optional: false, required: false + public get reviewerId() { + return this.getStringAttribute('reviewer_id'); + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + email: cdktf.stringToTerraform(this._email), + id: cdktf.stringToTerraform(this._id), + phone_number: cdktf.stringToTerraform(this._phoneNumber), + region: cdktf.stringToTerraform(this._region), + user_id: cdktf.stringToTerraform(this._userId), + user_name: cdktf.stringToTerraform(this._userName), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone_number: { + value: cdktf.stringToHclTerraform(this._phoneNumber), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-subject/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-subject/README.md new file mode 100644 index 00000000..55b1f5cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-subject/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_subject` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_subject`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-subject/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-subject/index.ts new file mode 100644 index 00000000..403d9ffc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-subject/index.ts @@ -0,0 +1,388 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureSubjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#code DataartsArchitectureSubject#code} + */ + readonly code: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#department DataartsArchitectureSubject#department} + */ + readonly department?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#description DataartsArchitectureSubject#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#id DataartsArchitectureSubject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#level DataartsArchitectureSubject#level} + */ + readonly level: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#name DataartsArchitectureSubject#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#owner DataartsArchitectureSubject#owner} + */ + readonly owner: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#parent_id DataartsArchitectureSubject#parent_id} + */ + readonly parentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#region DataartsArchitectureSubject#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#workspace_id DataartsArchitectureSubject#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject huaweicloud_dataarts_architecture_subject} +*/ +export class DataartsArchitectureSubject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_subject"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureSubject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureSubject to import + * @param importFromId The id of the existing DataartsArchitectureSubject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureSubject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_subject", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_subject huaweicloud_dataarts_architecture_subject} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureSubjectConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureSubjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_subject', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._department = config.department; + this._description = config.description; + this._id = config.id; + this._level = config.level; + this._name = config.name; + this._owner = config.owner; + this._parentId = config.parentId; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // code - computed: false, optional: false, required: true + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // department - computed: false, optional: true, required: false + private _department?: string; + public get department() { + return this.getStringAttribute('department'); + } + public set department(value: string) { + this._department = value; + } + public resetDepartment() { + this._department = undefined; + } + // Temporarily expose input value. Use with caution. + public get departmentInput() { + return this._department; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // guid - computed: true, optional: false, required: false + public get guid() { + return this.getStringAttribute('guid'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: false, optional: false, required: true + private _level?: number; + public get level() { + return this.getNumberAttribute('level'); + } + public set level(value: number) { + this._level = value; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: false, optional: false, required: true + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + department: cdktf.stringToTerraform(this._department), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + level: cdktf.numberToTerraform(this._level), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + department: { + value: cdktf.stringToHclTerraform(this._department), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.numberToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-table-model/README.md b/src/constructs/providers/huaweicloud/dataarts-architecture-table-model/README.md new file mode 100644 index 00000000..f5f00d50 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-table-model/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_architecture_table_model` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_architecture_table_model`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model). diff --git a/src/constructs/providers/huaweicloud/dataarts-architecture-table-model/index.ts b/src/constructs/providers/huaweicloud/dataarts-architecture-table-model/index.ts new file mode 100644 index 00000000..a7d652c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-architecture-table-model/index.ts @@ -0,0 +1,3626 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsArchitectureTableModelConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#code DataartsArchitectureTableModel#code} + */ + readonly code?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#compression DataartsArchitectureTableModel#compression} + */ + readonly compression?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#configs DataartsArchitectureTableModel#configs} + */ + readonly configs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#data_format DataartsArchitectureTableModel#data_format} + */ + readonly dataFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#db_name DataartsArchitectureTableModel#db_name} + */ + readonly dbName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#del_type DataartsArchitectureTableModel#del_type} + */ + readonly delType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#description DataartsArchitectureTableModel#description} + */ + readonly description: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dirty_out_database DataartsArchitectureTableModel#dirty_out_database} + */ + readonly dirtyOutDatabase?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dirty_out_prefix DataartsArchitectureTableModel#dirty_out_prefix} + */ + readonly dirtyOutPrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dirty_out_suffix DataartsArchitectureTableModel#dirty_out_suffix} + */ + readonly dirtyOutSuffix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dirty_out_switch DataartsArchitectureTableModel#dirty_out_switch} + */ + readonly dirtyOutSwitch?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#distribute DataartsArchitectureTableModel#distribute} + */ + readonly distribute?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#distribute_column DataartsArchitectureTableModel#distribute_column} + */ + readonly distributeColumn?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dlf_task_id DataartsArchitectureTableModel#dlf_task_id} + */ + readonly dlfTaskId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dw_id DataartsArchitectureTableModel#dw_id} + */ + readonly dwId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dw_name DataartsArchitectureTableModel#dw_name} + */ + readonly dwName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#dw_type DataartsArchitectureTableModel#dw_type} + */ + readonly dwType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#id DataartsArchitectureTableModel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#model_id DataartsArchitectureTableModel#model_id} + */ + readonly modelId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#obs_location DataartsArchitectureTableModel#obs_location} + */ + readonly obsLocation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#owner DataartsArchitectureTableModel#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#parent_table_id DataartsArchitectureTableModel#parent_table_id} + */ + readonly parentTableId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#parent_table_name DataartsArchitectureTableModel#parent_table_name} + */ + readonly parentTableName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#partition_conf DataartsArchitectureTableModel#partition_conf} + */ + readonly partitionConf?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#physical_table_name DataartsArchitectureTableModel#physical_table_name} + */ + readonly physicalTableName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#queue_name DataartsArchitectureTableModel#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#region DataartsArchitectureTableModel#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_model_id DataartsArchitectureTableModel#related_logic_model_id} + */ + readonly relatedLogicModelId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_model_name DataartsArchitectureTableModel#related_logic_model_name} + */ + readonly relatedLogicModelName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_table_model_id DataartsArchitectureTableModel#related_logic_table_model_id} + */ + readonly relatedLogicTableModelId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_table_model_name DataartsArchitectureTableModel#related_logic_table_model_name} + */ + readonly relatedLogicTableModelName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#reversed DataartsArchitectureTableModel#reversed} + */ + readonly reversed?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#schema DataartsArchitectureTableModel#schema} + */ + readonly schema?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#subject_id DataartsArchitectureTableModel#subject_id} + */ + readonly subjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#table_name DataartsArchitectureTableModel#table_name} + */ + readonly tableName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#table_type DataartsArchitectureTableModel#table_type} + */ + readonly tableType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#use_recently_partition DataartsArchitectureTableModel#use_recently_partition} + */ + readonly useRecentlyPartition?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#workspace_id DataartsArchitectureTableModel#workspace_id} + */ + readonly workspaceId: string; + /** + * attributes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#attributes DataartsArchitectureTableModel#attributes} + */ + readonly attributes: DataartsArchitectureTableModelAttributes[] | cdktf.IResolvable; + /** + * mappings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#mappings DataartsArchitectureTableModel#mappings} + */ + readonly mappings?: DataartsArchitectureTableModelMappings[] | cdktf.IResolvable; + /** + * relations block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#relations DataartsArchitectureTableModel#relations} + */ + readonly relations?: DataartsArchitectureTableModelRelations[] | cdktf.IResolvable; +} +export interface DataartsArchitectureTableModelAttributes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#code DataartsArchitectureTableModel#code} + */ + readonly code?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#data_type DataartsArchitectureTableModel#data_type} + */ + readonly dataType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#data_type_extend DataartsArchitectureTableModel#data_type_extend} + */ + readonly dataTypeExtend?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#description DataartsArchitectureTableModel#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#extend_field DataartsArchitectureTableModel#extend_field} + */ + readonly extendField?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#is_foreign_key DataartsArchitectureTableModel#is_foreign_key} + */ + readonly isForeignKey?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#is_partition_key DataartsArchitectureTableModel#is_partition_key} + */ + readonly isPartitionKey?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#is_primary_key DataartsArchitectureTableModel#is_primary_key} + */ + readonly isPrimaryKey?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#name DataartsArchitectureTableModel#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#name_en DataartsArchitectureTableModel#name_en} + */ + readonly nameEn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#not_null DataartsArchitectureTableModel#not_null} + */ + readonly notNull?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#ordinal DataartsArchitectureTableModel#ordinal} + */ + readonly ordinal?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_attr_id DataartsArchitectureTableModel#related_logic_attr_id} + */ + readonly relatedLogicAttrId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_attr_name DataartsArchitectureTableModel#related_logic_attr_name} + */ + readonly relatedLogicAttrName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#related_logic_attr_name_en DataartsArchitectureTableModel#related_logic_attr_name_en} + */ + readonly relatedLogicAttrNameEn?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#stand_row_id DataartsArchitectureTableModel#stand_row_id} + */ + readonly standRowId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#stand_row_name DataartsArchitectureTableModel#stand_row_name} + */ + readonly standRowName?: string; +} + +export function dataartsArchitectureTableModelAttributesToTerraform(struct?: DataartsArchitectureTableModelAttributes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + code: cdktf.stringToTerraform(struct!.code), + data_type: cdktf.stringToTerraform(struct!.dataType), + data_type_extend: cdktf.stringToTerraform(struct!.dataTypeExtend), + description: cdktf.stringToTerraform(struct!.description), + extend_field: cdktf.booleanToTerraform(struct!.extendField), + is_foreign_key: cdktf.booleanToTerraform(struct!.isForeignKey), + is_partition_key: cdktf.booleanToTerraform(struct!.isPartitionKey), + is_primary_key: cdktf.booleanToTerraform(struct!.isPrimaryKey), + name: cdktf.stringToTerraform(struct!.name), + name_en: cdktf.stringToTerraform(struct!.nameEn), + not_null: cdktf.booleanToTerraform(struct!.notNull), + ordinal: cdktf.stringToTerraform(struct!.ordinal), + related_logic_attr_id: cdktf.stringToTerraform(struct!.relatedLogicAttrId), + related_logic_attr_name: cdktf.stringToTerraform(struct!.relatedLogicAttrName), + related_logic_attr_name_en: cdktf.stringToTerraform(struct!.relatedLogicAttrNameEn), + stand_row_id: cdktf.stringToTerraform(struct!.standRowId), + stand_row_name: cdktf.stringToTerraform(struct!.standRowName), + } +} + + +export function dataartsArchitectureTableModelAttributesToHclTerraform(struct?: DataartsArchitectureTableModelAttributes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + code: { + value: cdktf.stringToHclTerraform(struct!.code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_type: { + value: cdktf.stringToHclTerraform(struct!.dataType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_type_extend: { + value: cdktf.stringToHclTerraform(struct!.dataTypeExtend), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extend_field: { + value: cdktf.booleanToHclTerraform(struct!.extendField), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_foreign_key: { + value: cdktf.booleanToHclTerraform(struct!.isForeignKey), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_partition_key: { + value: cdktf.booleanToHclTerraform(struct!.isPartitionKey), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_primary_key: { + value: cdktf.booleanToHclTerraform(struct!.isPrimaryKey), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_en: { + value: cdktf.stringToHclTerraform(struct!.nameEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + not_null: { + value: cdktf.booleanToHclTerraform(struct!.notNull), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ordinal: { + value: cdktf.stringToHclTerraform(struct!.ordinal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_attr_id: { + value: cdktf.stringToHclTerraform(struct!.relatedLogicAttrId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_attr_name: { + value: cdktf.stringToHclTerraform(struct!.relatedLogicAttrName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_attr_name_en: { + value: cdktf.stringToHclTerraform(struct!.relatedLogicAttrNameEn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stand_row_id: { + value: cdktf.stringToHclTerraform(struct!.standRowId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stand_row_name: { + value: cdktf.stringToHclTerraform(struct!.standRowName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelAttributesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelAttributes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._code !== undefined) { + hasAnyValues = true; + internalValueResult.code = this._code; + } + if (this._dataType !== undefined) { + hasAnyValues = true; + internalValueResult.dataType = this._dataType; + } + if (this._dataTypeExtend !== undefined) { + hasAnyValues = true; + internalValueResult.dataTypeExtend = this._dataTypeExtend; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._extendField !== undefined) { + hasAnyValues = true; + internalValueResult.extendField = this._extendField; + } + if (this._isForeignKey !== undefined) { + hasAnyValues = true; + internalValueResult.isForeignKey = this._isForeignKey; + } + if (this._isPartitionKey !== undefined) { + hasAnyValues = true; + internalValueResult.isPartitionKey = this._isPartitionKey; + } + if (this._isPrimaryKey !== undefined) { + hasAnyValues = true; + internalValueResult.isPrimaryKey = this._isPrimaryKey; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._nameEn !== undefined) { + hasAnyValues = true; + internalValueResult.nameEn = this._nameEn; + } + if (this._notNull !== undefined) { + hasAnyValues = true; + internalValueResult.notNull = this._notNull; + } + if (this._ordinal !== undefined) { + hasAnyValues = true; + internalValueResult.ordinal = this._ordinal; + } + if (this._relatedLogicAttrId !== undefined) { + hasAnyValues = true; + internalValueResult.relatedLogicAttrId = this._relatedLogicAttrId; + } + if (this._relatedLogicAttrName !== undefined) { + hasAnyValues = true; + internalValueResult.relatedLogicAttrName = this._relatedLogicAttrName; + } + if (this._relatedLogicAttrNameEn !== undefined) { + hasAnyValues = true; + internalValueResult.relatedLogicAttrNameEn = this._relatedLogicAttrNameEn; + } + if (this._standRowId !== undefined) { + hasAnyValues = true; + internalValueResult.standRowId = this._standRowId; + } + if (this._standRowName !== undefined) { + hasAnyValues = true; + internalValueResult.standRowName = this._standRowName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelAttributes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._code = undefined; + this._dataType = undefined; + this._dataTypeExtend = undefined; + this._description = undefined; + this._extendField = undefined; + this._isForeignKey = undefined; + this._isPartitionKey = undefined; + this._isPrimaryKey = undefined; + this._name = undefined; + this._nameEn = undefined; + this._notNull = undefined; + this._ordinal = undefined; + this._relatedLogicAttrId = undefined; + this._relatedLogicAttrName = undefined; + this._relatedLogicAttrNameEn = undefined; + this._standRowId = undefined; + this._standRowName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._code = value.code; + this._dataType = value.dataType; + this._dataTypeExtend = value.dataTypeExtend; + this._description = value.description; + this._extendField = value.extendField; + this._isForeignKey = value.isForeignKey; + this._isPartitionKey = value.isPartitionKey; + this._isPrimaryKey = value.isPrimaryKey; + this._name = value.name; + this._nameEn = value.nameEn; + this._notNull = value.notNull; + this._ordinal = value.ordinal; + this._relatedLogicAttrId = value.relatedLogicAttrId; + this._relatedLogicAttrName = value.relatedLogicAttrName; + this._relatedLogicAttrNameEn = value.relatedLogicAttrNameEn; + this._standRowId = value.standRowId; + this._standRowName = value.standRowName; + } + } + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_type - computed: false, optional: false, required: true + private _dataType?: string; + public get dataType() { + return this.getStringAttribute('data_type'); + } + public set dataType(value: string) { + this._dataType = value; + } + // Temporarily expose input value. Use with caution. + public get dataTypeInput() { + return this._dataType; + } + + // data_type_extend - computed: false, optional: true, required: false + private _dataTypeExtend?: string; + public get dataTypeExtend() { + return this.getStringAttribute('data_type_extend'); + } + public set dataTypeExtend(value: string) { + this._dataTypeExtend = value; + } + public resetDataTypeExtend() { + this._dataTypeExtend = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataTypeExtendInput() { + return this._dataTypeExtend; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_type - computed: true, optional: false, required: false + public get domainType() { + return this.getStringAttribute('domain_type'); + } + + // extend_field - computed: true, optional: true, required: false + private _extendField?: boolean | cdktf.IResolvable; + public get extendField() { + return this.getBooleanAttribute('extend_field'); + } + public set extendField(value: boolean | cdktf.IResolvable) { + this._extendField = value; + } + public resetExtendField() { + this._extendField = undefined; + } + // Temporarily expose input value. Use with caution. + public get extendFieldInput() { + return this._extendField; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_foreign_key - computed: true, optional: true, required: false + private _isForeignKey?: boolean | cdktf.IResolvable; + public get isForeignKey() { + return this.getBooleanAttribute('is_foreign_key'); + } + public set isForeignKey(value: boolean | cdktf.IResolvable) { + this._isForeignKey = value; + } + public resetIsForeignKey() { + this._isForeignKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get isForeignKeyInput() { + return this._isForeignKey; + } + + // is_partition_key - computed: true, optional: true, required: false + private _isPartitionKey?: boolean | cdktf.IResolvable; + public get isPartitionKey() { + return this.getBooleanAttribute('is_partition_key'); + } + public set isPartitionKey(value: boolean | cdktf.IResolvable) { + this._isPartitionKey = value; + } + public resetIsPartitionKey() { + this._isPartitionKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPartitionKeyInput() { + return this._isPartitionKey; + } + + // is_primary_key - computed: true, optional: true, required: false + private _isPrimaryKey?: boolean | cdktf.IResolvable; + public get isPrimaryKey() { + return this.getBooleanAttribute('is_primary_key'); + } + public set isPrimaryKey(value: boolean | cdktf.IResolvable) { + this._isPrimaryKey = value; + } + public resetIsPrimaryKey() { + this._isPrimaryKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPrimaryKeyInput() { + return this._isPrimaryKey; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // name_en - computed: false, optional: false, required: true + private _nameEn?: string; + public get nameEn() { + return this.getStringAttribute('name_en'); + } + public set nameEn(value: string) { + this._nameEn = value; + } + // Temporarily expose input value. Use with caution. + public get nameEnInput() { + return this._nameEn; + } + + // not_null - computed: true, optional: true, required: false + private _notNull?: boolean | cdktf.IResolvable; + public get notNull() { + return this.getBooleanAttribute('not_null'); + } + public set notNull(value: boolean | cdktf.IResolvable) { + this._notNull = value; + } + public resetNotNull() { + this._notNull = undefined; + } + // Temporarily expose input value. Use with caution. + public get notNullInput() { + return this._notNull; + } + + // ordinal - computed: true, optional: true, required: false + private _ordinal?: string; + public get ordinal() { + return this.getStringAttribute('ordinal'); + } + public set ordinal(value: string) { + this._ordinal = value; + } + public resetOrdinal() { + this._ordinal = undefined; + } + // Temporarily expose input value. Use with caution. + public get ordinalInput() { + return this._ordinal; + } + + // related_logic_attr_id - computed: false, optional: true, required: false + private _relatedLogicAttrId?: string; + public get relatedLogicAttrId() { + return this.getStringAttribute('related_logic_attr_id'); + } + public set relatedLogicAttrId(value: string) { + this._relatedLogicAttrId = value; + } + public resetRelatedLogicAttrId() { + this._relatedLogicAttrId = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicAttrIdInput() { + return this._relatedLogicAttrId; + } + + // related_logic_attr_name - computed: true, optional: true, required: false + private _relatedLogicAttrName?: string; + public get relatedLogicAttrName() { + return this.getStringAttribute('related_logic_attr_name'); + } + public set relatedLogicAttrName(value: string) { + this._relatedLogicAttrName = value; + } + public resetRelatedLogicAttrName() { + this._relatedLogicAttrName = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicAttrNameInput() { + return this._relatedLogicAttrName; + } + + // related_logic_attr_name_en - computed: true, optional: true, required: false + private _relatedLogicAttrNameEn?: string; + public get relatedLogicAttrNameEn() { + return this.getStringAttribute('related_logic_attr_name_en'); + } + public set relatedLogicAttrNameEn(value: string) { + this._relatedLogicAttrNameEn = value; + } + public resetRelatedLogicAttrNameEn() { + this._relatedLogicAttrNameEn = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicAttrNameEnInput() { + return this._relatedLogicAttrNameEn; + } + + // stand_row_id - computed: false, optional: true, required: false + private _standRowId?: string; + public get standRowId() { + return this.getStringAttribute('stand_row_id'); + } + public set standRowId(value: string) { + this._standRowId = value; + } + public resetStandRowId() { + this._standRowId = undefined; + } + // Temporarily expose input value. Use with caution. + public get standRowIdInput() { + return this._standRowId; + } + + // stand_row_name - computed: true, optional: true, required: false + private _standRowName?: string; + public get standRowName() { + return this.getStringAttribute('stand_row_name'); + } + public set standRowName(value: string) { + this._standRowName = value; + } + public resetStandRowName() { + this._standRowName = undefined; + } + // Temporarily expose input value. Use with caution. + public get standRowNameInput() { + return this._standRowName; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DataartsArchitectureTableModelAttributesList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelAttributes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelAttributesOutputReference { + return new DataartsArchitectureTableModelAttributesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureTableModelMappingsSourceFields { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#field_ids DataartsArchitectureTableModel#field_ids} + */ + readonly fieldIds?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#field_names DataartsArchitectureTableModel#field_names} + */ + readonly fieldNames?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#target_field_name DataartsArchitectureTableModel#target_field_name} + */ + readonly targetFieldName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#transform_expression DataartsArchitectureTableModel#transform_expression} + */ + readonly transformExpression?: string; +} + +export function dataartsArchitectureTableModelMappingsSourceFieldsToTerraform(struct?: DataartsArchitectureTableModelMappingsSourceFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_ids: cdktf.stringToTerraform(struct!.fieldIds), + field_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.fieldNames), + target_field_name: cdktf.stringToTerraform(struct!.targetFieldName), + transform_expression: cdktf.stringToTerraform(struct!.transformExpression), + } +} + + +export function dataartsArchitectureTableModelMappingsSourceFieldsToHclTerraform(struct?: DataartsArchitectureTableModelMappingsSourceFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_ids: { + value: cdktf.stringToHclTerraform(struct!.fieldIds), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.fieldNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + target_field_name: { + value: cdktf.stringToHclTerraform(struct!.targetFieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transform_expression: { + value: cdktf.stringToHclTerraform(struct!.transformExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelMappingsSourceFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelMappingsSourceFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldIds !== undefined) { + hasAnyValues = true; + internalValueResult.fieldIds = this._fieldIds; + } + if (this._fieldNames !== undefined) { + hasAnyValues = true; + internalValueResult.fieldNames = this._fieldNames; + } + if (this._targetFieldName !== undefined) { + hasAnyValues = true; + internalValueResult.targetFieldName = this._targetFieldName; + } + if (this._transformExpression !== undefined) { + hasAnyValues = true; + internalValueResult.transformExpression = this._transformExpression; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelMappingsSourceFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fieldIds = undefined; + this._fieldNames = undefined; + this._targetFieldName = undefined; + this._transformExpression = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fieldIds = value.fieldIds; + this._fieldNames = value.fieldNames; + this._targetFieldName = value.targetFieldName; + this._transformExpression = value.transformExpression; + } + } + + // changed - computed: true, optional: false, required: false + public get changed() { + return this.getBooleanAttribute('changed'); + } + + // field_ids - computed: false, optional: true, required: false + private _fieldIds?: string; + public get fieldIds() { + return this.getStringAttribute('field_ids'); + } + public set fieldIds(value: string) { + this._fieldIds = value; + } + public resetFieldIds() { + this._fieldIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get fieldIdsInput() { + return this._fieldIds; + } + + // field_names - computed: false, optional: true, required: false + private _fieldNames?: string[]; + public get fieldNames() { + return this.getListAttribute('field_names'); + } + public set fieldNames(value: string[]) { + this._fieldNames = value; + } + public resetFieldNames() { + this._fieldNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get fieldNamesInput() { + return this._fieldNames; + } + + // target_field_name - computed: false, optional: true, required: false + private _targetFieldName?: string; + public get targetFieldName() { + return this.getStringAttribute('target_field_name'); + } + public set targetFieldName(value: string) { + this._targetFieldName = value; + } + public resetTargetFieldName() { + this._targetFieldName = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetFieldNameInput() { + return this._targetFieldName; + } + + // transform_expression - computed: false, optional: true, required: false + private _transformExpression?: string; + public get transformExpression() { + return this.getStringAttribute('transform_expression'); + } + public set transformExpression(value: string) { + this._transformExpression = value; + } + public resetTransformExpression() { + this._transformExpression = undefined; + } + // Temporarily expose input value. Use with caution. + public get transformExpressionInput() { + return this._transformExpression; + } +} + +export class DataartsArchitectureTableModelMappingsSourceFieldsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelMappingsSourceFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelMappingsSourceFieldsOutputReference { + return new DataartsArchitectureTableModelMappingsSourceFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureTableModelMappingsSourceTablesJoinFields { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#field1_id DataartsArchitectureTableModel#field1_id} + */ + readonly field1Id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#field1_name DataartsArchitectureTableModel#field1_name} + */ + readonly field1Name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#field2_id DataartsArchitectureTableModel#field2_id} + */ + readonly field2Id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#field2_name DataartsArchitectureTableModel#field2_name} + */ + readonly field2Name?: string; +} + +export function dataartsArchitectureTableModelMappingsSourceTablesJoinFieldsToTerraform(struct?: DataartsArchitectureTableModelMappingsSourceTablesJoinFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field1_id: cdktf.stringToTerraform(struct!.field1Id), + field1_name: cdktf.stringToTerraform(struct!.field1Name), + field2_id: cdktf.stringToTerraform(struct!.field2Id), + field2_name: cdktf.stringToTerraform(struct!.field2Name), + } +} + + +export function dataartsArchitectureTableModelMappingsSourceTablesJoinFieldsToHclTerraform(struct?: DataartsArchitectureTableModelMappingsSourceTablesJoinFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field1_id: { + value: cdktf.stringToHclTerraform(struct!.field1Id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field1_name: { + value: cdktf.stringToHclTerraform(struct!.field1Name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field2_id: { + value: cdktf.stringToHclTerraform(struct!.field2Id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field2_name: { + value: cdktf.stringToHclTerraform(struct!.field2Name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelMappingsSourceTablesJoinFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelMappingsSourceTablesJoinFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._field1Id !== undefined) { + hasAnyValues = true; + internalValueResult.field1Id = this._field1Id; + } + if (this._field1Name !== undefined) { + hasAnyValues = true; + internalValueResult.field1Name = this._field1Name; + } + if (this._field2Id !== undefined) { + hasAnyValues = true; + internalValueResult.field2Id = this._field2Id; + } + if (this._field2Name !== undefined) { + hasAnyValues = true; + internalValueResult.field2Name = this._field2Name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelMappingsSourceTablesJoinFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._field1Id = undefined; + this._field1Name = undefined; + this._field2Id = undefined; + this._field2Name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._field1Id = value.field1Id; + this._field1Name = value.field1Name; + this._field2Id = value.field2Id; + this._field2Name = value.field2Name; + } + } + + // field1_id - computed: false, optional: false, required: true + private _field1Id?: string; + public get field1Id() { + return this.getStringAttribute('field1_id'); + } + public set field1Id(value: string) { + this._field1Id = value; + } + // Temporarily expose input value. Use with caution. + public get field1IdInput() { + return this._field1Id; + } + + // field1_name - computed: true, optional: true, required: false + private _field1Name?: string; + public get field1Name() { + return this.getStringAttribute('field1_name'); + } + public set field1Name(value: string) { + this._field1Name = value; + } + public resetField1Name() { + this._field1Name = undefined; + } + // Temporarily expose input value. Use with caution. + public get field1NameInput() { + return this._field1Name; + } + + // field2_id - computed: false, optional: false, required: true + private _field2Id?: string; + public get field2Id() { + return this.getStringAttribute('field2_id'); + } + public set field2Id(value: string) { + this._field2Id = value; + } + // Temporarily expose input value. Use with caution. + public get field2IdInput() { + return this._field2Id; + } + + // field2_name - computed: true, optional: true, required: false + private _field2Name?: string; + public get field2Name() { + return this.getStringAttribute('field2_name'); + } + public set field2Name(value: string) { + this._field2Name = value; + } + public resetField2Name() { + this._field2Name = undefined; + } + // Temporarily expose input value. Use with caution. + public get field2NameInput() { + return this._field2Name; + } +} + +export class DataartsArchitectureTableModelMappingsSourceTablesJoinFieldsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelMappingsSourceTablesJoinFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelMappingsSourceTablesJoinFieldsOutputReference { + return new DataartsArchitectureTableModelMappingsSourceTablesJoinFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureTableModelMappingsSourceTables { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#join_type DataartsArchitectureTableModel#join_type} + */ + readonly joinType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#table1_id DataartsArchitectureTableModel#table1_id} + */ + readonly table1Id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#table1_name DataartsArchitectureTableModel#table1_name} + */ + readonly table1Name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#table2_id DataartsArchitectureTableModel#table2_id} + */ + readonly table2Id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#table2_name DataartsArchitectureTableModel#table2_name} + */ + readonly table2Name?: string; + /** + * join_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#join_fields DataartsArchitectureTableModel#join_fields} + */ + readonly joinFields?: DataartsArchitectureTableModelMappingsSourceTablesJoinFields[] | cdktf.IResolvable; +} + +export function dataartsArchitectureTableModelMappingsSourceTablesToTerraform(struct?: DataartsArchitectureTableModelMappingsSourceTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + join_type: cdktf.stringToTerraform(struct!.joinType), + table1_id: cdktf.stringToTerraform(struct!.table1Id), + table1_name: cdktf.stringToTerraform(struct!.table1Name), + table2_id: cdktf.stringToTerraform(struct!.table2Id), + table2_name: cdktf.stringToTerraform(struct!.table2Name), + join_fields: cdktf.listMapper(dataartsArchitectureTableModelMappingsSourceTablesJoinFieldsToTerraform, true)(struct!.joinFields), + } +} + + +export function dataartsArchitectureTableModelMappingsSourceTablesToHclTerraform(struct?: DataartsArchitectureTableModelMappingsSourceTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + join_type: { + value: cdktf.stringToHclTerraform(struct!.joinType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table1_id: { + value: cdktf.stringToHclTerraform(struct!.table1Id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table1_name: { + value: cdktf.stringToHclTerraform(struct!.table1Name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table2_id: { + value: cdktf.stringToHclTerraform(struct!.table2Id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table2_name: { + value: cdktf.stringToHclTerraform(struct!.table2Name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + join_fields: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelMappingsSourceTablesJoinFieldsToHclTerraform, true)(struct!.joinFields), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureTableModelMappingsSourceTablesJoinFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelMappingsSourceTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelMappingsSourceTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._joinType !== undefined) { + hasAnyValues = true; + internalValueResult.joinType = this._joinType; + } + if (this._table1Id !== undefined) { + hasAnyValues = true; + internalValueResult.table1Id = this._table1Id; + } + if (this._table1Name !== undefined) { + hasAnyValues = true; + internalValueResult.table1Name = this._table1Name; + } + if (this._table2Id !== undefined) { + hasAnyValues = true; + internalValueResult.table2Id = this._table2Id; + } + if (this._table2Name !== undefined) { + hasAnyValues = true; + internalValueResult.table2Name = this._table2Name; + } + if (this._joinFields?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.joinFields = this._joinFields?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelMappingsSourceTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._joinType = undefined; + this._table1Id = undefined; + this._table1Name = undefined; + this._table2Id = undefined; + this._table2Name = undefined; + this._joinFields.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._joinType = value.joinType; + this._table1Id = value.table1Id; + this._table1Name = value.table1Name; + this._table2Id = value.table2Id; + this._table2Name = value.table2Name; + this._joinFields.internalValue = value.joinFields; + } + } + + // join_type - computed: true, optional: true, required: false + private _joinType?: string; + public get joinType() { + return this.getStringAttribute('join_type'); + } + public set joinType(value: string) { + this._joinType = value; + } + public resetJoinType() { + this._joinType = undefined; + } + // Temporarily expose input value. Use with caution. + public get joinTypeInput() { + return this._joinType; + } + + // table1_id - computed: false, optional: false, required: true + private _table1Id?: string; + public get table1Id() { + return this.getStringAttribute('table1_id'); + } + public set table1Id(value: string) { + this._table1Id = value; + } + // Temporarily expose input value. Use with caution. + public get table1IdInput() { + return this._table1Id; + } + + // table1_name - computed: true, optional: true, required: false + private _table1Name?: string; + public get table1Name() { + return this.getStringAttribute('table1_name'); + } + public set table1Name(value: string) { + this._table1Name = value; + } + public resetTable1Name() { + this._table1Name = undefined; + } + // Temporarily expose input value. Use with caution. + public get table1NameInput() { + return this._table1Name; + } + + // table2_id - computed: true, optional: true, required: false + private _table2Id?: string; + public get table2Id() { + return this.getStringAttribute('table2_id'); + } + public set table2Id(value: string) { + this._table2Id = value; + } + public resetTable2Id() { + this._table2Id = undefined; + } + // Temporarily expose input value. Use with caution. + public get table2IdInput() { + return this._table2Id; + } + + // table2_name - computed: true, optional: true, required: false + private _table2Name?: string; + public get table2Name() { + return this.getStringAttribute('table2_name'); + } + public set table2Name(value: string) { + this._table2Name = value; + } + public resetTable2Name() { + this._table2Name = undefined; + } + // Temporarily expose input value. Use with caution. + public get table2NameInput() { + return this._table2Name; + } + + // join_fields - computed: false, optional: true, required: false + private _joinFields = new DataartsArchitectureTableModelMappingsSourceTablesJoinFieldsList(this, "join_fields", false); + public get joinFields() { + return this._joinFields; + } + public putJoinFields(value: DataartsArchitectureTableModelMappingsSourceTablesJoinFields[] | cdktf.IResolvable) { + this._joinFields.internalValue = value; + } + public resetJoinFields() { + this._joinFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get joinFieldsInput() { + return this._joinFields.internalValue; + } +} + +export class DataartsArchitectureTableModelMappingsSourceTablesList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelMappingsSourceTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelMappingsSourceTablesOutputReference { + return new DataartsArchitectureTableModelMappingsSourceTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureTableModelMappings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#name DataartsArchitectureTableModel#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#src_model_id DataartsArchitectureTableModel#src_model_id} + */ + readonly srcModelId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#src_model_name DataartsArchitectureTableModel#src_model_name} + */ + readonly srcModelName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#view_text DataartsArchitectureTableModel#view_text} + */ + readonly viewText?: string; + /** + * source_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_fields DataartsArchitectureTableModel#source_fields} + */ + readonly sourceFields?: DataartsArchitectureTableModelMappingsSourceFields[] | cdktf.IResolvable; + /** + * source_tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_tables DataartsArchitectureTableModel#source_tables} + */ + readonly sourceTables: DataartsArchitectureTableModelMappingsSourceTables[] | cdktf.IResolvable; +} + +export function dataartsArchitectureTableModelMappingsToTerraform(struct?: DataartsArchitectureTableModelMappings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + src_model_id: cdktf.stringToTerraform(struct!.srcModelId), + src_model_name: cdktf.stringToTerraform(struct!.srcModelName), + view_text: cdktf.stringToTerraform(struct!.viewText), + source_fields: cdktf.listMapper(dataartsArchitectureTableModelMappingsSourceFieldsToTerraform, true)(struct!.sourceFields), + source_tables: cdktf.listMapper(dataartsArchitectureTableModelMappingsSourceTablesToTerraform, true)(struct!.sourceTables), + } +} + + +export function dataartsArchitectureTableModelMappingsToHclTerraform(struct?: DataartsArchitectureTableModelMappings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_model_id: { + value: cdktf.stringToHclTerraform(struct!.srcModelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_model_name: { + value: cdktf.stringToHclTerraform(struct!.srcModelName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + view_text: { + value: cdktf.stringToHclTerraform(struct!.viewText), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_fields: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelMappingsSourceFieldsToHclTerraform, true)(struct!.sourceFields), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureTableModelMappingsSourceFieldsList", + }, + source_tables: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelMappingsSourceTablesToHclTerraform, true)(struct!.sourceTables), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureTableModelMappingsSourceTablesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelMappingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelMappings | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._srcModelId !== undefined) { + hasAnyValues = true; + internalValueResult.srcModelId = this._srcModelId; + } + if (this._srcModelName !== undefined) { + hasAnyValues = true; + internalValueResult.srcModelName = this._srcModelName; + } + if (this._viewText !== undefined) { + hasAnyValues = true; + internalValueResult.viewText = this._viewText; + } + if (this._sourceFields?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.sourceFields = this._sourceFields?.internalValue; + } + if (this._sourceTables?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.sourceTables = this._sourceTables?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelMappings | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._srcModelId = undefined; + this._srcModelName = undefined; + this._viewText = undefined; + this._sourceFields.internalValue = undefined; + this._sourceTables.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._srcModelId = value.srcModelId; + this._srcModelName = value.srcModelName; + this._viewText = value.viewText; + this._sourceFields.internalValue = value.sourceFields; + this._sourceTables.internalValue = value.sourceTables; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // src_model_id - computed: true, optional: true, required: false + private _srcModelId?: string; + public get srcModelId() { + return this.getStringAttribute('src_model_id'); + } + public set srcModelId(value: string) { + this._srcModelId = value; + } + public resetSrcModelId() { + this._srcModelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcModelIdInput() { + return this._srcModelId; + } + + // src_model_name - computed: true, optional: true, required: false + private _srcModelName?: string; + public get srcModelName() { + return this.getStringAttribute('src_model_name'); + } + public set srcModelName(value: string) { + this._srcModelName = value; + } + public resetSrcModelName() { + this._srcModelName = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcModelNameInput() { + return this._srcModelName; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // view_text - computed: true, optional: true, required: false + private _viewText?: string; + public get viewText() { + return this.getStringAttribute('view_text'); + } + public set viewText(value: string) { + this._viewText = value; + } + public resetViewText() { + this._viewText = undefined; + } + // Temporarily expose input value. Use with caution. + public get viewTextInput() { + return this._viewText; + } + + // source_fields - computed: false, optional: true, required: false + private _sourceFields = new DataartsArchitectureTableModelMappingsSourceFieldsList(this, "source_fields", false); + public get sourceFields() { + return this._sourceFields; + } + public putSourceFields(value: DataartsArchitectureTableModelMappingsSourceFields[] | cdktf.IResolvable) { + this._sourceFields.internalValue = value; + } + public resetSourceFields() { + this._sourceFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceFieldsInput() { + return this._sourceFields.internalValue; + } + + // source_tables - computed: false, optional: false, required: true + private _sourceTables = new DataartsArchitectureTableModelMappingsSourceTablesList(this, "source_tables", false); + public get sourceTables() { + return this._sourceTables; + } + public putSourceTables(value: DataartsArchitectureTableModelMappingsSourceTables[] | cdktf.IResolvable) { + this._sourceTables.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTablesInput() { + return this._sourceTables.internalValue; + } +} + +export class DataartsArchitectureTableModelMappingsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelMappings[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelMappingsOutputReference { + return new DataartsArchitectureTableModelMappingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureTableModelRelationsMappings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_field_id DataartsArchitectureTableModel#source_field_id} + */ + readonly sourceFieldId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_field_name DataartsArchitectureTableModel#source_field_name} + */ + readonly sourceFieldName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#target_field_id DataartsArchitectureTableModel#target_field_id} + */ + readonly targetFieldId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#target_field_name DataartsArchitectureTableModel#target_field_name} + */ + readonly targetFieldName?: string; +} + +export function dataartsArchitectureTableModelRelationsMappingsToTerraform(struct?: DataartsArchitectureTableModelRelationsMappings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + source_field_id: cdktf.stringToTerraform(struct!.sourceFieldId), + source_field_name: cdktf.stringToTerraform(struct!.sourceFieldName), + target_field_id: cdktf.stringToTerraform(struct!.targetFieldId), + target_field_name: cdktf.stringToTerraform(struct!.targetFieldName), + } +} + + +export function dataartsArchitectureTableModelRelationsMappingsToHclTerraform(struct?: DataartsArchitectureTableModelRelationsMappings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + source_field_id: { + value: cdktf.stringToHclTerraform(struct!.sourceFieldId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_field_name: { + value: cdktf.stringToHclTerraform(struct!.sourceFieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_field_id: { + value: cdktf.stringToHclTerraform(struct!.targetFieldId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_field_name: { + value: cdktf.stringToHclTerraform(struct!.targetFieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelRelationsMappingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelRelationsMappings | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._sourceFieldId !== undefined) { + hasAnyValues = true; + internalValueResult.sourceFieldId = this._sourceFieldId; + } + if (this._sourceFieldName !== undefined) { + hasAnyValues = true; + internalValueResult.sourceFieldName = this._sourceFieldName; + } + if (this._targetFieldId !== undefined) { + hasAnyValues = true; + internalValueResult.targetFieldId = this._targetFieldId; + } + if (this._targetFieldName !== undefined) { + hasAnyValues = true; + internalValueResult.targetFieldName = this._targetFieldName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelRelationsMappings | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._sourceFieldId = undefined; + this._sourceFieldName = undefined; + this._targetFieldId = undefined; + this._targetFieldName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._sourceFieldId = value.sourceFieldId; + this._sourceFieldName = value.sourceFieldName; + this._targetFieldId = value.targetFieldId; + this._targetFieldName = value.targetFieldName; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // source_field_id - computed: true, optional: true, required: false + private _sourceFieldId?: string; + public get sourceFieldId() { + return this.getStringAttribute('source_field_id'); + } + public set sourceFieldId(value: string) { + this._sourceFieldId = value; + } + public resetSourceFieldId() { + this._sourceFieldId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceFieldIdInput() { + return this._sourceFieldId; + } + + // source_field_name - computed: true, optional: true, required: false + private _sourceFieldName?: string; + public get sourceFieldName() { + return this.getStringAttribute('source_field_name'); + } + public set sourceFieldName(value: string) { + this._sourceFieldName = value; + } + public resetSourceFieldName() { + this._sourceFieldName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceFieldNameInput() { + return this._sourceFieldName; + } + + // target_field_id - computed: true, optional: true, required: false + private _targetFieldId?: string; + public get targetFieldId() { + return this.getStringAttribute('target_field_id'); + } + public set targetFieldId(value: string) { + this._targetFieldId = value; + } + public resetTargetFieldId() { + this._targetFieldId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetFieldIdInput() { + return this._targetFieldId; + } + + // target_field_name - computed: true, optional: true, required: false + private _targetFieldName?: string; + public get targetFieldName() { + return this.getStringAttribute('target_field_name'); + } + public set targetFieldName(value: string) { + this._targetFieldName = value; + } + public resetTargetFieldName() { + this._targetFieldName = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetFieldNameInput() { + return this._targetFieldName; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } +} + +export class DataartsArchitectureTableModelRelationsMappingsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelRelationsMappings[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelRelationsMappingsOutputReference { + return new DataartsArchitectureTableModelRelationsMappingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsArchitectureTableModelRelations { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#name DataartsArchitectureTableModel#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#role DataartsArchitectureTableModel#role} + */ + readonly role?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_table_id DataartsArchitectureTableModel#source_table_id} + */ + readonly sourceTableId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_table_name DataartsArchitectureTableModel#source_table_name} + */ + readonly sourceTableName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#source_type DataartsArchitectureTableModel#source_type} + */ + readonly sourceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#target_table_id DataartsArchitectureTableModel#target_table_id} + */ + readonly targetTableId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#target_table_name DataartsArchitectureTableModel#target_table_name} + */ + readonly targetTableName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#target_type DataartsArchitectureTableModel#target_type} + */ + readonly targetType: string; + /** + * mappings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#mappings DataartsArchitectureTableModel#mappings} + */ + readonly mappings: DataartsArchitectureTableModelRelationsMappings[] | cdktf.IResolvable; +} + +export function dataartsArchitectureTableModelRelationsToTerraform(struct?: DataartsArchitectureTableModelRelations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + role: cdktf.stringToTerraform(struct!.role), + source_table_id: cdktf.stringToTerraform(struct!.sourceTableId), + source_table_name: cdktf.stringToTerraform(struct!.sourceTableName), + source_type: cdktf.stringToTerraform(struct!.sourceType), + target_table_id: cdktf.stringToTerraform(struct!.targetTableId), + target_table_name: cdktf.stringToTerraform(struct!.targetTableName), + target_type: cdktf.stringToTerraform(struct!.targetType), + mappings: cdktf.listMapper(dataartsArchitectureTableModelRelationsMappingsToTerraform, true)(struct!.mappings), + } +} + + +export function dataartsArchitectureTableModelRelationsToHclTerraform(struct?: DataartsArchitectureTableModelRelations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role: { + value: cdktf.stringToHclTerraform(struct!.role), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_table_id: { + value: cdktf.stringToHclTerraform(struct!.sourceTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_table_name: { + value: cdktf.stringToHclTerraform(struct!.sourceTableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(struct!.sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_table_id: { + value: cdktf.stringToHclTerraform(struct!.targetTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_table_name: { + value: cdktf.stringToHclTerraform(struct!.targetTableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_type: { + value: cdktf.stringToHclTerraform(struct!.targetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mappings: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelRelationsMappingsToHclTerraform, true)(struct!.mappings), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureTableModelRelationsMappingsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsArchitectureTableModelRelationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsArchitectureTableModelRelations | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._role !== undefined) { + hasAnyValues = true; + internalValueResult.role = this._role; + } + if (this._sourceTableId !== undefined) { + hasAnyValues = true; + internalValueResult.sourceTableId = this._sourceTableId; + } + if (this._sourceTableName !== undefined) { + hasAnyValues = true; + internalValueResult.sourceTableName = this._sourceTableName; + } + if (this._sourceType !== undefined) { + hasAnyValues = true; + internalValueResult.sourceType = this._sourceType; + } + if (this._targetTableId !== undefined) { + hasAnyValues = true; + internalValueResult.targetTableId = this._targetTableId; + } + if (this._targetTableName !== undefined) { + hasAnyValues = true; + internalValueResult.targetTableName = this._targetTableName; + } + if (this._targetType !== undefined) { + hasAnyValues = true; + internalValueResult.targetType = this._targetType; + } + if (this._mappings?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.mappings = this._mappings?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsArchitectureTableModelRelations | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._role = undefined; + this._sourceTableId = undefined; + this._sourceTableName = undefined; + this._sourceType = undefined; + this._targetTableId = undefined; + this._targetTableName = undefined; + this._targetType = undefined; + this._mappings.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._role = value.role; + this._sourceTableId = value.sourceTableId; + this._sourceTableName = value.sourceTableName; + this._sourceType = value.sourceType; + this._targetTableId = value.targetTableId; + this._targetTableName = value.targetTableName; + this._targetType = value.targetType; + this._mappings.internalValue = value.mappings; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // role - computed: false, optional: true, required: false + private _role?: string; + public get role() { + return this.getStringAttribute('role'); + } + public set role(value: string) { + this._role = value; + } + public resetRole() { + this._role = undefined; + } + // Temporarily expose input value. Use with caution. + public get roleInput() { + return this._role; + } + + // source_table_id - computed: true, optional: true, required: false + private _sourceTableId?: string; + public get sourceTableId() { + return this.getStringAttribute('source_table_id'); + } + public set sourceTableId(value: string) { + this._sourceTableId = value; + } + public resetSourceTableId() { + this._sourceTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTableIdInput() { + return this._sourceTableId; + } + + // source_table_name - computed: true, optional: true, required: false + private _sourceTableName?: string; + public get sourceTableName() { + return this.getStringAttribute('source_table_name'); + } + public set sourceTableName(value: string) { + this._sourceTableName = value; + } + public resetSourceTableName() { + this._sourceTableName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTableNameInput() { + return this._sourceTableName; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // target_table_id - computed: true, optional: true, required: false + private _targetTableId?: string; + public get targetTableId() { + return this.getStringAttribute('target_table_id'); + } + public set targetTableId(value: string) { + this._targetTableId = value; + } + public resetTargetTableId() { + this._targetTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetTableIdInput() { + return this._targetTableId; + } + + // target_table_name - computed: true, optional: true, required: false + private _targetTableName?: string; + public get targetTableName() { + return this.getStringAttribute('target_table_name'); + } + public set targetTableName(value: string) { + this._targetTableName = value; + } + public resetTargetTableName() { + this._targetTableName = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetTableNameInput() { + return this._targetTableName; + } + + // target_type - computed: false, optional: false, required: true + private _targetType?: string; + public get targetType() { + return this.getStringAttribute('target_type'); + } + public set targetType(value: string) { + this._targetType = value; + } + // Temporarily expose input value. Use with caution. + public get targetTypeInput() { + return this._targetType; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // mappings - computed: false, optional: false, required: true + private _mappings = new DataartsArchitectureTableModelRelationsMappingsList(this, "mappings", false); + public get mappings() { + return this._mappings; + } + public putMappings(value: DataartsArchitectureTableModelRelationsMappings[] | cdktf.IResolvable) { + this._mappings.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get mappingsInput() { + return this._mappings.internalValue; + } +} + +export class DataartsArchitectureTableModelRelationsList extends cdktf.ComplexList { + public internalValue? : DataartsArchitectureTableModelRelations[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsArchitectureTableModelRelationsOutputReference { + return new DataartsArchitectureTableModelRelationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model huaweicloud_dataarts_architecture_table_model} +*/ +export class DataartsArchitectureTableModel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_architecture_table_model"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsArchitectureTableModel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsArchitectureTableModel to import + * @param importFromId The id of the existing DataartsArchitectureTableModel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsArchitectureTableModel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_architecture_table_model", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_architecture_table_model huaweicloud_dataarts_architecture_table_model} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsArchitectureTableModelConfig + */ + public constructor(scope: Construct, id: string, config: DataartsArchitectureTableModelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_architecture_table_model', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._code = config.code; + this._compression = config.compression; + this._configs = config.configs; + this._dataFormat = config.dataFormat; + this._dbName = config.dbName; + this._delType = config.delType; + this._description = config.description; + this._dirtyOutDatabase = config.dirtyOutDatabase; + this._dirtyOutPrefix = config.dirtyOutPrefix; + this._dirtyOutSuffix = config.dirtyOutSuffix; + this._dirtyOutSwitch = config.dirtyOutSwitch; + this._distribute = config.distribute; + this._distributeColumn = config.distributeColumn; + this._dlfTaskId = config.dlfTaskId; + this._dwId = config.dwId; + this._dwName = config.dwName; + this._dwType = config.dwType; + this._id = config.id; + this._modelId = config.modelId; + this._obsLocation = config.obsLocation; + this._owner = config.owner; + this._parentTableId = config.parentTableId; + this._parentTableName = config.parentTableName; + this._partitionConf = config.partitionConf; + this._physicalTableName = config.physicalTableName; + this._queueName = config.queueName; + this._region = config.region; + this._relatedLogicModelId = config.relatedLogicModelId; + this._relatedLogicModelName = config.relatedLogicModelName; + this._relatedLogicTableModelId = config.relatedLogicTableModelId; + this._relatedLogicTableModelName = config.relatedLogicTableModelName; + this._reversed = config.reversed; + this._schema = config.schema; + this._subjectId = config.subjectId; + this._tableName = config.tableName; + this._tableType = config.tableType; + this._useRecentlyPartition = config.useRecentlyPartition; + this._workspaceId = config.workspaceId; + this._attributes.internalValue = config.attributes; + this._mappings.internalValue = config.mappings; + this._relations.internalValue = config.relations; + } + + // ========== + // ATTRIBUTES + // ========== + + // business_asset_status - computed: true, optional: false, required: false + public get businessAssetStatus() { + return this.getStringAttribute('business_asset_status'); + } + + // catalog_path - computed: true, optional: false, required: false + public get catalogPath() { + return this.getStringAttribute('catalog_path'); + } + + // code - computed: true, optional: true, required: false + private _code?: string; + public get code() { + return this.getStringAttribute('code'); + } + public set code(value: string) { + this._code = value; + } + public resetCode() { + this._code = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeInput() { + return this._code; + } + + // compression - computed: true, optional: true, required: false + private _compression?: string; + public get compression() { + return this.getStringAttribute('compression'); + } + public set compression(value: string) { + this._compression = value; + } + public resetCompression() { + this._compression = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressionInput() { + return this._compression; + } + + // configs - computed: false, optional: true, required: false + private _configs?: string; + public get configs() { + return this.getStringAttribute('configs'); + } + public set configs(value: string) { + this._configs = value; + } + public resetConfigs() { + this._configs = undefined; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // data_format - computed: true, optional: true, required: false + private _dataFormat?: string; + public get dataFormat() { + return this.getStringAttribute('data_format'); + } + public set dataFormat(value: string) { + this._dataFormat = value; + } + public resetDataFormat() { + this._dataFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataFormatInput() { + return this._dataFormat; + } + + // data_quality_status - computed: true, optional: false, required: false + public get dataQualityStatus() { + return this.getStringAttribute('data_quality_status'); + } + + // db_name - computed: false, optional: true, required: false + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + public resetDbName() { + this._dbName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // del_type - computed: false, optional: true, required: false + private _delType?: string; + public get delType() { + return this.getStringAttribute('del_type'); + } + public set delType(value: string) { + this._delType = value; + } + public resetDelType() { + this._delType = undefined; + } + // Temporarily expose input value. Use with caution. + public get delTypeInput() { + return this._delType; + } + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dev_physical_table_status - computed: true, optional: false, required: false + public get devPhysicalTableStatus() { + return this.getStringAttribute('dev_physical_table_status'); + } + + // dirty_out_database - computed: false, optional: true, required: false + private _dirtyOutDatabase?: string; + public get dirtyOutDatabase() { + return this.getStringAttribute('dirty_out_database'); + } + public set dirtyOutDatabase(value: string) { + this._dirtyOutDatabase = value; + } + public resetDirtyOutDatabase() { + this._dirtyOutDatabase = undefined; + } + // Temporarily expose input value. Use with caution. + public get dirtyOutDatabaseInput() { + return this._dirtyOutDatabase; + } + + // dirty_out_prefix - computed: false, optional: true, required: false + private _dirtyOutPrefix?: string; + public get dirtyOutPrefix() { + return this.getStringAttribute('dirty_out_prefix'); + } + public set dirtyOutPrefix(value: string) { + this._dirtyOutPrefix = value; + } + public resetDirtyOutPrefix() { + this._dirtyOutPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get dirtyOutPrefixInput() { + return this._dirtyOutPrefix; + } + + // dirty_out_suffix - computed: false, optional: true, required: false + private _dirtyOutSuffix?: string; + public get dirtyOutSuffix() { + return this.getStringAttribute('dirty_out_suffix'); + } + public set dirtyOutSuffix(value: string) { + this._dirtyOutSuffix = value; + } + public resetDirtyOutSuffix() { + this._dirtyOutSuffix = undefined; + } + // Temporarily expose input value. Use with caution. + public get dirtyOutSuffixInput() { + return this._dirtyOutSuffix; + } + + // dirty_out_switch - computed: true, optional: true, required: false + private _dirtyOutSwitch?: boolean | cdktf.IResolvable; + public get dirtyOutSwitch() { + return this.getBooleanAttribute('dirty_out_switch'); + } + public set dirtyOutSwitch(value: boolean | cdktf.IResolvable) { + this._dirtyOutSwitch = value; + } + public resetDirtyOutSwitch() { + this._dirtyOutSwitch = undefined; + } + // Temporarily expose input value. Use with caution. + public get dirtyOutSwitchInput() { + return this._dirtyOutSwitch; + } + + // distribute - computed: true, optional: true, required: false + private _distribute?: string; + public get distribute() { + return this.getStringAttribute('distribute'); + } + public set distribute(value: string) { + this._distribute = value; + } + public resetDistribute() { + this._distribute = undefined; + } + // Temporarily expose input value. Use with caution. + public get distributeInput() { + return this._distribute; + } + + // distribute_column - computed: true, optional: true, required: false + private _distributeColumn?: string; + public get distributeColumn() { + return this.getStringAttribute('distribute_column'); + } + public set distributeColumn(value: string) { + this._distributeColumn = value; + } + public resetDistributeColumn() { + this._distributeColumn = undefined; + } + // Temporarily expose input value. Use with caution. + public get distributeColumnInput() { + return this._distributeColumn; + } + + // dlf_task_id - computed: true, optional: true, required: false + private _dlfTaskId?: string; + public get dlfTaskId() { + return this.getStringAttribute('dlf_task_id'); + } + public set dlfTaskId(value: string) { + this._dlfTaskId = value; + } + public resetDlfTaskId() { + this._dlfTaskId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dlfTaskIdInput() { + return this._dlfTaskId; + } + + // dw_id - computed: false, optional: true, required: false + private _dwId?: string; + public get dwId() { + return this.getStringAttribute('dw_id'); + } + public set dwId(value: string) { + this._dwId = value; + } + public resetDwId() { + this._dwId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dwIdInput() { + return this._dwId; + } + + // dw_name - computed: true, optional: true, required: false + private _dwName?: string; + public get dwName() { + return this.getStringAttribute('dw_name'); + } + public set dwName(value: string) { + this._dwName = value; + } + public resetDwName() { + this._dwName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dwNameInput() { + return this._dwName; + } + + // dw_type - computed: false, optional: false, required: true + private _dwType?: string; + public get dwType() { + return this.getStringAttribute('dw_type'); + } + public set dwType(value: string) { + this._dwType = value; + } + // Temporarily expose input value. Use with caution. + public get dwTypeInput() { + return this._dwType; + } + + // env_type - computed: true, optional: false, required: false + public get envType() { + return this.getStringAttribute('env_type'); + } + + // extend_info - computed: true, optional: false, required: false + public get extendInfo() { + return this.getStringAttribute('extend_info'); + } + + // has_related_logic_table - computed: true, optional: false, required: false + public get hasRelatedLogicTable() { + return this.getBooleanAttribute('has_related_logic_table'); + } + + // has_related_physical_table - computed: true, optional: false, required: false + public get hasRelatedPhysicalTable() { + return this.getBooleanAttribute('has_related_physical_table'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_partition - computed: true, optional: false, required: false + public get isPartition() { + return this.getBooleanAttribute('is_partition'); + } + + // logic_tb_guid - computed: true, optional: false, required: false + public get logicTbGuid() { + return this.getStringAttribute('logic_tb_guid'); + } + + // meta_data_link_status - computed: true, optional: false, required: false + public get metaDataLinkStatus() { + return this.getStringAttribute('meta_data_link_status'); + } + + // model_id - computed: false, optional: false, required: true + private _modelId?: string; + public get modelId() { + return this.getStringAttribute('model_id'); + } + public set modelId(value: string) { + this._modelId = value; + } + // Temporarily expose input value. Use with caution. + public get modelIdInput() { + return this._modelId; + } + + // obs_location - computed: false, optional: true, required: false + private _obsLocation?: string; + public get obsLocation() { + return this.getStringAttribute('obs_location'); + } + public set obsLocation(value: string) { + this._obsLocation = value; + } + public resetObsLocation() { + this._obsLocation = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsLocationInput() { + return this._obsLocation; + } + + // owner - computed: false, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // parent_table_code - computed: true, optional: false, required: false + public get parentTableCode() { + return this.getStringAttribute('parent_table_code'); + } + + // parent_table_id - computed: false, optional: true, required: false + private _parentTableId?: string; + public get parentTableId() { + return this.getStringAttribute('parent_table_id'); + } + public set parentTableId(value: string) { + this._parentTableId = value; + } + public resetParentTableId() { + this._parentTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentTableIdInput() { + return this._parentTableId; + } + + // parent_table_name - computed: true, optional: true, required: false + private _parentTableName?: string; + public get parentTableName() { + return this.getStringAttribute('parent_table_name'); + } + public set parentTableName(value: string) { + this._parentTableName = value; + } + public resetParentTableName() { + this._parentTableName = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentTableNameInput() { + return this._parentTableName; + } + + // partition_conf - computed: false, optional: true, required: false + private _partitionConf?: string; + public get partitionConf() { + return this.getStringAttribute('partition_conf'); + } + public set partitionConf(value: string) { + this._partitionConf = value; + } + public resetPartitionConf() { + this._partitionConf = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionConfInput() { + return this._partitionConf; + } + + // physical_table_name - computed: false, optional: false, required: true + private _physicalTableName?: string; + public get physicalTableName() { + return this.getStringAttribute('physical_table_name'); + } + public set physicalTableName(value: string) { + this._physicalTableName = value; + } + // Temporarily expose input value. Use with caution. + public get physicalTableNameInput() { + return this._physicalTableName; + } + + // physical_table_status - computed: true, optional: false, required: false + public get physicalTableStatus() { + return this.getStringAttribute('physical_table_status'); + } + + // queue_name - computed: false, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // related_logic_model_id - computed: false, optional: true, required: false + private _relatedLogicModelId?: string; + public get relatedLogicModelId() { + return this.getStringAttribute('related_logic_model_id'); + } + public set relatedLogicModelId(value: string) { + this._relatedLogicModelId = value; + } + public resetRelatedLogicModelId() { + this._relatedLogicModelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicModelIdInput() { + return this._relatedLogicModelId; + } + + // related_logic_model_name - computed: true, optional: true, required: false + private _relatedLogicModelName?: string; + public get relatedLogicModelName() { + return this.getStringAttribute('related_logic_model_name'); + } + public set relatedLogicModelName(value: string) { + this._relatedLogicModelName = value; + } + public resetRelatedLogicModelName() { + this._relatedLogicModelName = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicModelNameInput() { + return this._relatedLogicModelName; + } + + // related_logic_table_model_id - computed: false, optional: true, required: false + private _relatedLogicTableModelId?: string; + public get relatedLogicTableModelId() { + return this.getStringAttribute('related_logic_table_model_id'); + } + public set relatedLogicTableModelId(value: string) { + this._relatedLogicTableModelId = value; + } + public resetRelatedLogicTableModelId() { + this._relatedLogicTableModelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicTableModelIdInput() { + return this._relatedLogicTableModelId; + } + + // related_logic_table_model_name - computed: true, optional: true, required: false + private _relatedLogicTableModelName?: string; + public get relatedLogicTableModelName() { + return this.getStringAttribute('related_logic_table_model_name'); + } + public set relatedLogicTableModelName(value: string) { + this._relatedLogicTableModelName = value; + } + public resetRelatedLogicTableModelName() { + this._relatedLogicTableModelName = undefined; + } + // Temporarily expose input value. Use with caution. + public get relatedLogicTableModelNameInput() { + return this._relatedLogicTableModelName; + } + + // reversed - computed: true, optional: true, required: false + private _reversed?: boolean | cdktf.IResolvable; + public get reversed() { + return this.getBooleanAttribute('reversed'); + } + public set reversed(value: boolean | cdktf.IResolvable) { + this._reversed = value; + } + public resetReversed() { + this._reversed = undefined; + } + // Temporarily expose input value. Use with caution. + public get reversedInput() { + return this._reversed; + } + + // schema - computed: false, optional: true, required: false + private _schema?: string; + public get schema() { + return this.getStringAttribute('schema'); + } + public set schema(value: string) { + this._schema = value; + } + public resetSchema() { + this._schema = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemaInput() { + return this._schema; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subject_id - computed: false, optional: false, required: true + private _subjectId?: string; + public get subjectId() { + return this.getStringAttribute('subject_id'); + } + public set subjectId(value: string) { + this._subjectId = value; + } + // Temporarily expose input value. Use with caution. + public get subjectIdInput() { + return this._subjectId; + } + + // summary_status - computed: true, optional: false, required: false + public get summaryStatus() { + return this.getStringAttribute('summary_status'); + } + + // table_name - computed: false, optional: false, required: true + private _tableName?: string; + public get tableName() { + return this.getStringAttribute('table_name'); + } + public set tableName(value: string) { + this._tableName = value; + } + // Temporarily expose input value. Use with caution. + public get tableNameInput() { + return this._tableName; + } + + // table_type - computed: true, optional: true, required: false + private _tableType?: string; + public get tableType() { + return this.getStringAttribute('table_type'); + } + public set tableType(value: string) { + this._tableType = value; + } + public resetTableType() { + this._tableType = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableTypeInput() { + return this._tableType; + } + + // tb_guid - computed: true, optional: false, required: false + public get tbGuid() { + return this.getStringAttribute('tb_guid'); + } + + // technical_asset_status - computed: true, optional: false, required: false + public get technicalAssetStatus() { + return this.getStringAttribute('technical_asset_status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // use_recently_partition - computed: true, optional: true, required: false + private _useRecentlyPartition?: boolean | cdktf.IResolvable; + public get useRecentlyPartition() { + return this.getBooleanAttribute('use_recently_partition'); + } + public set useRecentlyPartition(value: boolean | cdktf.IResolvable) { + this._useRecentlyPartition = value; + } + public resetUseRecentlyPartition() { + this._useRecentlyPartition = undefined; + } + // Temporarily expose input value. Use with caution. + public get useRecentlyPartitionInput() { + return this._useRecentlyPartition; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // attributes - computed: false, optional: false, required: true + private _attributes = new DataartsArchitectureTableModelAttributesList(this, "attributes", true); + public get attributes() { + return this._attributes; + } + public putAttributes(value: DataartsArchitectureTableModelAttributes[] | cdktf.IResolvable) { + this._attributes.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get attributesInput() { + return this._attributes.internalValue; + } + + // mappings - computed: false, optional: true, required: false + private _mappings = new DataartsArchitectureTableModelMappingsList(this, "mappings", false); + public get mappings() { + return this._mappings; + } + public putMappings(value: DataartsArchitectureTableModelMappings[] | cdktf.IResolvable) { + this._mappings.internalValue = value; + } + public resetMappings() { + this._mappings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mappingsInput() { + return this._mappings.internalValue; + } + + // relations - computed: false, optional: true, required: false + private _relations = new DataartsArchitectureTableModelRelationsList(this, "relations", false); + public get relations() { + return this._relations; + } + public putRelations(value: DataartsArchitectureTableModelRelations[] | cdktf.IResolvable) { + this._relations.internalValue = value; + } + public resetRelations() { + this._relations.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get relationsInput() { + return this._relations.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + code: cdktf.stringToTerraform(this._code), + compression: cdktf.stringToTerraform(this._compression), + configs: cdktf.stringToTerraform(this._configs), + data_format: cdktf.stringToTerraform(this._dataFormat), + db_name: cdktf.stringToTerraform(this._dbName), + del_type: cdktf.stringToTerraform(this._delType), + description: cdktf.stringToTerraform(this._description), + dirty_out_database: cdktf.stringToTerraform(this._dirtyOutDatabase), + dirty_out_prefix: cdktf.stringToTerraform(this._dirtyOutPrefix), + dirty_out_suffix: cdktf.stringToTerraform(this._dirtyOutSuffix), + dirty_out_switch: cdktf.booleanToTerraform(this._dirtyOutSwitch), + distribute: cdktf.stringToTerraform(this._distribute), + distribute_column: cdktf.stringToTerraform(this._distributeColumn), + dlf_task_id: cdktf.stringToTerraform(this._dlfTaskId), + dw_id: cdktf.stringToTerraform(this._dwId), + dw_name: cdktf.stringToTerraform(this._dwName), + dw_type: cdktf.stringToTerraform(this._dwType), + id: cdktf.stringToTerraform(this._id), + model_id: cdktf.stringToTerraform(this._modelId), + obs_location: cdktf.stringToTerraform(this._obsLocation), + owner: cdktf.stringToTerraform(this._owner), + parent_table_id: cdktf.stringToTerraform(this._parentTableId), + parent_table_name: cdktf.stringToTerraform(this._parentTableName), + partition_conf: cdktf.stringToTerraform(this._partitionConf), + physical_table_name: cdktf.stringToTerraform(this._physicalTableName), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + related_logic_model_id: cdktf.stringToTerraform(this._relatedLogicModelId), + related_logic_model_name: cdktf.stringToTerraform(this._relatedLogicModelName), + related_logic_table_model_id: cdktf.stringToTerraform(this._relatedLogicTableModelId), + related_logic_table_model_name: cdktf.stringToTerraform(this._relatedLogicTableModelName), + reversed: cdktf.booleanToTerraform(this._reversed), + schema: cdktf.stringToTerraform(this._schema), + subject_id: cdktf.stringToTerraform(this._subjectId), + table_name: cdktf.stringToTerraform(this._tableName), + table_type: cdktf.stringToTerraform(this._tableType), + use_recently_partition: cdktf.booleanToTerraform(this._useRecentlyPartition), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + attributes: cdktf.listMapper(dataartsArchitectureTableModelAttributesToTerraform, true)(this._attributes.internalValue), + mappings: cdktf.listMapper(dataartsArchitectureTableModelMappingsToTerraform, true)(this._mappings.internalValue), + relations: cdktf.listMapper(dataartsArchitectureTableModelRelationsToTerraform, true)(this._relations.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + code: { + value: cdktf.stringToHclTerraform(this._code), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + compression: { + value: cdktf.stringToHclTerraform(this._compression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configs: { + value: cdktf.stringToHclTerraform(this._configs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_format: { + value: cdktf.stringToHclTerraform(this._dataFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + del_type: { + value: cdktf.stringToHclTerraform(this._delType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dirty_out_database: { + value: cdktf.stringToHclTerraform(this._dirtyOutDatabase), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dirty_out_prefix: { + value: cdktf.stringToHclTerraform(this._dirtyOutPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dirty_out_suffix: { + value: cdktf.stringToHclTerraform(this._dirtyOutSuffix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dirty_out_switch: { + value: cdktf.booleanToHclTerraform(this._dirtyOutSwitch), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + distribute: { + value: cdktf.stringToHclTerraform(this._distribute), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + distribute_column: { + value: cdktf.stringToHclTerraform(this._distributeColumn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dlf_task_id: { + value: cdktf.stringToHclTerraform(this._dlfTaskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dw_id: { + value: cdktf.stringToHclTerraform(this._dwId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dw_name: { + value: cdktf.stringToHclTerraform(this._dwName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dw_type: { + value: cdktf.stringToHclTerraform(this._dwType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_id: { + value: cdktf.stringToHclTerraform(this._modelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_location: { + value: cdktf.stringToHclTerraform(this._obsLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_table_id: { + value: cdktf.stringToHclTerraform(this._parentTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_table_name: { + value: cdktf.stringToHclTerraform(this._parentTableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_conf: { + value: cdktf.stringToHclTerraform(this._partitionConf), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + physical_table_name: { + value: cdktf.stringToHclTerraform(this._physicalTableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_model_id: { + value: cdktf.stringToHclTerraform(this._relatedLogicModelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_model_name: { + value: cdktf.stringToHclTerraform(this._relatedLogicModelName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_table_model_id: { + value: cdktf.stringToHclTerraform(this._relatedLogicTableModelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_logic_table_model_name: { + value: cdktf.stringToHclTerraform(this._relatedLogicTableModelName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reversed: { + value: cdktf.booleanToHclTerraform(this._reversed), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + schema: { + value: cdktf.stringToHclTerraform(this._schema), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subject_id: { + value: cdktf.stringToHclTerraform(this._subjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_name: { + value: cdktf.stringToHclTerraform(this._tableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_type: { + value: cdktf.stringToHclTerraform(this._tableType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + use_recently_partition: { + value: cdktf.booleanToHclTerraform(this._useRecentlyPartition), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attributes: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelAttributesToHclTerraform, true)(this._attributes.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataartsArchitectureTableModelAttributesList", + }, + mappings: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelMappingsToHclTerraform, true)(this._mappings.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureTableModelMappingsList", + }, + relations: { + value: cdktf.listMapperHcl(dataartsArchitectureTableModelRelationsToHclTerraform, true)(this._relations.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsArchitectureTableModelRelationsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/README.md new file mode 100644 index 00000000..592cd61e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/index.ts new file mode 100644 index 00000000..bd7d1755 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-action/index.ts @@ -0,0 +1,254 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiActionConfig extends cdktf.TerraformMetaArguments { + /** + * The exclusive API ID, which in published status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#api_id DataartsDataserviceApiAction#api_id} + */ + readonly apiId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#id DataartsDataserviceApiAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster ID to which the published API belongs on Data Service side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#instance_id DataartsDataserviceApiAction#instance_id} + */ + readonly instanceId: string; + /** + * The region where the API to be operated is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#region DataartsDataserviceApiAction#region} + */ + readonly region?: string; + /** + * The action type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#type DataartsDataserviceApiAction#type} + */ + readonly type: string; + /** + * The ID of the workspace to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#workspace_id DataartsDataserviceApiAction#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action huaweicloud_dataarts_dataservice_api_action} +*/ +export class DataartsDataserviceApiAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApiAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApiAction to import + * @param importFromId The id of the existing DataartsDataserviceApiAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApiAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_action huaweicloud_dataarts_dataservice_api_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiActionConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/README.md new file mode 100644 index 00000000..fd5aa280 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api_auth_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api_auth_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/index.ts new file mode 100644 index 00000000..3769aff3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth-action/index.ts @@ -0,0 +1,311 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiAuthActionConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the published API that to be operated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#api_id DataartsDataserviceApiAuthAction#api_id} + */ + readonly apiId: string; + /** + * The ID of the APP to be operated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#app_id DataartsDataserviceApiAuthAction#app_id} + */ + readonly appId: string; + /** + * The expiration time of the authorize operation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#expired_at DataartsDataserviceApiAuthAction#expired_at} + */ + readonly expiredAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#id DataartsDataserviceApiAuthAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster ID to which the published API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#instance_id DataartsDataserviceApiAuthAction#instance_id} + */ + readonly instanceId: string; + /** + * The region where the published API and APP to be operated are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#region DataartsDataserviceApiAuthAction#region} + */ + readonly region?: string; + /** + * The operation type of the authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#type DataartsDataserviceApiAuthAction#type} + */ + readonly type: string; + /** + * The workspace ID to which the published API and APP to be operated belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#workspace_id DataartsDataserviceApiAuthAction#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action huaweicloud_dataarts_dataservice_api_auth_action} +*/ +export class DataartsDataserviceApiAuthAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api_auth_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApiAuthAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApiAuthAction to import + * @param importFromId The id of the existing DataartsDataserviceApiAuthAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApiAuthAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api_auth_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth_action huaweicloud_dataarts_dataservice_api_auth_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiAuthActionConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiAuthActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api_auth_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._appId = config.appId; + this._expiredAt = config.expiredAt; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // app_id - computed: false, optional: false, required: true + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // expired_at - computed: false, optional: true, required: false + private _expiredAt?: string; + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + public set expiredAt(value: string) { + this._expiredAt = value; + } + public resetExpiredAt() { + this._expiredAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get expiredAtInput() { + return this._expiredAt; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + app_id: cdktf.stringToTerraform(this._appId), + expired_at: cdktf.stringToTerraform(this._expiredAt), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expired_at: { + value: cdktf.stringToHclTerraform(this._expiredAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/README.md new file mode 100644 index 00000000..fc70d176 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api_auth` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api_auth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/index.ts new file mode 100644 index 00000000..ba6c2cff --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-auth/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiAuthConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the published API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#api_id DataartsDataserviceApiAuth#api_id} + */ + readonly apiId: string; + /** + * The list of application IDs that used to authorize API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#app_ids DataartsDataserviceApiAuth#app_ids} + */ + readonly appIds: string[]; + /** + * The expiration time of the APP authorize operation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#expired_at DataartsDataserviceApiAuth#expired_at} + */ + readonly expiredAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#id DataartsDataserviceApiAuth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster ID to which the published API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#instance_id DataartsDataserviceApiAuth#instance_id} + */ + readonly instanceId: string; + /** + * The region where the API and APP(s) are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#region DataartsDataserviceApiAuth#region} + */ + readonly region?: string; + /** + * The workspace ID to which the API and APP(s) belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#workspace_id DataartsDataserviceApiAuth#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth huaweicloud_dataarts_dataservice_api_auth} +*/ +export class DataartsDataserviceApiAuth extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api_auth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApiAuth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApiAuth to import + * @param importFromId The id of the existing DataartsDataserviceApiAuth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApiAuth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api_auth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_auth huaweicloud_dataarts_dataservice_api_auth} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiAuthConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiAuthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api_auth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._appIds = config.appIds; + this._expiredAt = config.expiredAt; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // app_ids - computed: false, optional: false, required: true + private _appIds?: string[]; + public get appIds() { + return this.getListAttribute('app_ids'); + } + public set appIds(value: string[]) { + this._appIds = value; + } + // Temporarily expose input value. Use with caution. + public get appIdsInput() { + return this._appIds; + } + + // expired_at - computed: false, optional: true, required: false + private _expiredAt?: string; + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + public set expiredAt(value: string) { + this._expiredAt = value; + } + public resetExpiredAt() { + this._expiredAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get expiredAtInput() { + return this._expiredAt; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + app_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._appIds), + expired_at: cdktf.stringToTerraform(this._expiredAt), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._appIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + expired_at: { + value: cdktf.stringToHclTerraform(this._expiredAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/README.md new file mode 100644 index 00000000..891d75dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api_debug` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api_debug`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/index.ts new file mode 100644 index 00000000..7711c2d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-debug/index.ts @@ -0,0 +1,436 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiDebugConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the catalog where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#api_id DataartsDataserviceApiDebug#api_id} + */ + readonly apiId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#id DataartsDataserviceApiDebug#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#instance_id DataartsDataserviceApiDebug#instance_id} + */ + readonly instanceId: string; + /** + * The maximum retry number of the API debug operation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#max_retries DataartsDataserviceApiDebug#max_retries} + */ + readonly maxRetries?: number; + /** + * The request parameters in which to debug the API, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#params DataartsDataserviceApiDebug#params} + */ + readonly params?: string; + /** + * The region where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#region DataartsDataserviceApiDebug#region} + */ + readonly region?: string; + /** + * The ID of the workspace to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#workspace_id DataartsDataserviceApiDebug#workspace_id} + */ + readonly workspaceId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#timeouts DataartsDataserviceApiDebug#timeouts} + */ + readonly timeouts?: DataartsDataserviceApiDebugTimeouts; +} +export interface DataartsDataserviceApiDebugTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#create DataartsDataserviceApiDebug#create} + */ + readonly create?: string; +} + +export function dataartsDataserviceApiDebugTimeoutsToTerraform(struct?: DataartsDataserviceApiDebugTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dataartsDataserviceApiDebugTimeoutsToHclTerraform(struct?: DataartsDataserviceApiDebugTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiDebugTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataartsDataserviceApiDebugTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiDebugTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug huaweicloud_dataarts_dataservice_api_debug} +*/ +export class DataartsDataserviceApiDebug extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api_debug"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApiDebug resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApiDebug to import + * @param importFromId The id of the existing DataartsDataserviceApiDebug that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApiDebug to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api_debug", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_debug huaweicloud_dataarts_dataservice_api_debug} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiDebugConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiDebugConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api_debug', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._id = config.id; + this._instanceId = config.instanceId; + this._maxRetries = config.maxRetries; + this._params = config.params; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // max_retries - computed: false, optional: true, required: false + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + public resetMaxRetries() { + this._maxRetries = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // params - computed: false, optional: true, required: false + private _params?: string; + public get params() { + return this.getStringAttribute('params'); + } + public set params(value: string) { + this._params = value; + } + public resetParams() { + this._params = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_header - computed: true, optional: false, required: false + public get requestHeader() { + return this.getStringAttribute('request_header'); + } + + // response_header - computed: true, optional: false, required: false + public get responseHeader() { + return this.getStringAttribute('response_header'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // timeout - computed: true, optional: false, required: false + public get timeout() { + return this.getNumberAttribute('timeout'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataartsDataserviceApiDebugTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataartsDataserviceApiDebugTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + max_retries: cdktf.numberToTerraform(this._maxRetries), + params: cdktf.stringToTerraform(this._params), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + timeouts: dataartsDataserviceApiDebugTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + params: { + value: cdktf.stringToHclTerraform(this._params), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataartsDataserviceApiDebugTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataartsDataserviceApiDebugTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/README.md new file mode 100644 index 00000000..ab500c51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api_publish` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api_publish`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/index.ts new file mode 100644 index 00000000..5144c19c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publish/index.ts @@ -0,0 +1,471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiPublishConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#api_id DataartsDataserviceApiPublish#api_id} + */ + readonly apiId: string; + /** + * The APIG group ID to which the published API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#apig_group_id DataartsDataserviceApiPublish#apig_group_id} + */ + readonly apigGroupId?: string; + /** + * The APIG instance ID to which the API is published simultaneously in APIG service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#apig_instance_id DataartsDataserviceApiPublish#apig_instance_id} + */ + readonly apigInstanceId?: string; + /** + * The type of the APIG object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#apig_type DataartsDataserviceApiPublish#apig_type} + */ + readonly apigType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#id DataartsDataserviceApiPublish#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster ID to which the published API belongs in Data Service side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#instance_id DataartsDataserviceApiPublish#instance_id} + */ + readonly instanceId: string; + /** + * The region where the published API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#region DataartsDataserviceApiPublish#region} + */ + readonly region?: string; + /** + * The application ID for ROMA APIC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#roma_app_id DataartsDataserviceApiPublish#roma_app_id} + */ + readonly romaAppId?: string; + /** + * The workspace ID to which the published API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#workspace_id DataartsDataserviceApiPublish#workspace_id} + */ + readonly workspaceId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#timeouts DataartsDataserviceApiPublish#timeouts} + */ + readonly timeouts?: DataartsDataserviceApiPublishTimeouts; +} +export interface DataartsDataserviceApiPublishTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#create DataartsDataserviceApiPublish#create} + */ + readonly create?: string; +} + +export function dataartsDataserviceApiPublishTimeoutsToTerraform(struct?: DataartsDataserviceApiPublishTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dataartsDataserviceApiPublishTimeoutsToHclTerraform(struct?: DataartsDataserviceApiPublishTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiPublishTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataartsDataserviceApiPublishTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiPublishTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish huaweicloud_dataarts_dataservice_api_publish} +*/ +export class DataartsDataserviceApiPublish extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api_publish"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApiPublish resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApiPublish to import + * @param importFromId The id of the existing DataartsDataserviceApiPublish that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApiPublish to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api_publish", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publish huaweicloud_dataarts_dataservice_api_publish} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiPublishConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiPublishConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api_publish', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._apigGroupId = config.apigGroupId; + this._apigInstanceId = config.apigInstanceId; + this._apigType = config.apigType; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._romaAppId = config.romaAppId; + this._workspaceId = config.workspaceId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // apig_group_id - computed: false, optional: true, required: false + private _apigGroupId?: string; + public get apigGroupId() { + return this.getStringAttribute('apig_group_id'); + } + public set apigGroupId(value: string) { + this._apigGroupId = value; + } + public resetApigGroupId() { + this._apigGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigGroupIdInput() { + return this._apigGroupId; + } + + // apig_instance_id - computed: false, optional: true, required: false + private _apigInstanceId?: string; + public get apigInstanceId() { + return this.getStringAttribute('apig_instance_id'); + } + public set apigInstanceId(value: string) { + this._apigInstanceId = value; + } + public resetApigInstanceId() { + this._apigInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigInstanceIdInput() { + return this._apigInstanceId; + } + + // apig_type - computed: false, optional: true, required: false + private _apigType?: string; + public get apigType() { + return this.getStringAttribute('apig_type'); + } + public set apigType(value: string) { + this._apigType = value; + } + public resetApigType() { + this._apigType = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigTypeInput() { + return this._apigType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roma_app_id - computed: false, optional: true, required: false + private _romaAppId?: string; + public get romaAppId() { + return this.getStringAttribute('roma_app_id'); + } + public set romaAppId(value: string) { + this._romaAppId = value; + } + public resetRomaAppId() { + this._romaAppId = undefined; + } + // Temporarily expose input value. Use with caution. + public get romaAppIdInput() { + return this._romaAppId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataartsDataserviceApiPublishTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataartsDataserviceApiPublishTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + apig_group_id: cdktf.stringToTerraform(this._apigGroupId), + apig_instance_id: cdktf.stringToTerraform(this._apigInstanceId), + apig_type: cdktf.stringToTerraform(this._apigType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + roma_app_id: cdktf.stringToTerraform(this._romaAppId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + timeouts: dataartsDataserviceApiPublishTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig_group_id: { + value: cdktf.stringToHclTerraform(this._apigGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig_instance_id: { + value: cdktf.stringToHclTerraform(this._apigInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig_type: { + value: cdktf.stringToHclTerraform(this._apigType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roma_app_id: { + value: cdktf.stringToHclTerraform(this._romaAppId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataartsDataserviceApiPublishTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataartsDataserviceApiPublishTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/README.md new file mode 100644 index 00000000..024b475e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api_publishment` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api_publishment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/index.ts new file mode 100644 index 00000000..e6e6445d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api-publishment/index.ts @@ -0,0 +1,476 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiPublishmentConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the API to be published. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#api_id DataartsDataserviceApiPublishment#api_id} + */ + readonly apiId: string; + /** + * The APIG group ID to which the published API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#apig_group_id DataartsDataserviceApiPublishment#apig_group_id} + */ + readonly apigGroupId?: string; + /** + * The APIG instance ID to which the API is published simultaneously in APIG service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#apig_instance_id DataartsDataserviceApiPublishment#apig_instance_id} + */ + readonly apigInstanceId?: string; + /** + * The type of the APIG object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#apig_type DataartsDataserviceApiPublishment#apig_type} + */ + readonly apigType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#id DataartsDataserviceApiPublishment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The exclusive cluster ID to which the published API belongs in Data Service side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#instance_id DataartsDataserviceApiPublishment#instance_id} + */ + readonly instanceId: string; + /** + * The region where the API to be published is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#region DataartsDataserviceApiPublishment#region} + */ + readonly region?: string; + /** + * The application ID for ROMA APIC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#roma_app_id DataartsDataserviceApiPublishment#roma_app_id} + */ + readonly romaAppId?: string; + /** + * The workspace ID to which the published API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#workspace_id DataartsDataserviceApiPublishment#workspace_id} + */ + readonly workspaceId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#timeouts DataartsDataserviceApiPublishment#timeouts} + */ + readonly timeouts?: DataartsDataserviceApiPublishmentTimeouts; +} +export interface DataartsDataserviceApiPublishmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#create DataartsDataserviceApiPublishment#create} + */ + readonly create?: string; +} + +export function dataartsDataserviceApiPublishmentTimeoutsToTerraform(struct?: DataartsDataserviceApiPublishmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dataartsDataserviceApiPublishmentTimeoutsToHclTerraform(struct?: DataartsDataserviceApiPublishmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiPublishmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataartsDataserviceApiPublishmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiPublishmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment huaweicloud_dataarts_dataservice_api_publishment} +*/ +export class DataartsDataserviceApiPublishment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api_publishment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApiPublishment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApiPublishment to import + * @param importFromId The id of the existing DataartsDataserviceApiPublishment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApiPublishment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api_publishment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api_publishment huaweicloud_dataarts_dataservice_api_publishment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiPublishmentConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiPublishmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api_publishment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._apiId = config.apiId; + this._apigGroupId = config.apigGroupId; + this._apigInstanceId = config.apigInstanceId; + this._apigType = config.apigType; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._romaAppId = config.romaAppId; + this._workspaceId = config.workspaceId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_id - computed: false, optional: false, required: true + private _apiId?: string; + public get apiId() { + return this.getStringAttribute('api_id'); + } + public set apiId(value: string) { + this._apiId = value; + } + // Temporarily expose input value. Use with caution. + public get apiIdInput() { + return this._apiId; + } + + // apig_group_id - computed: false, optional: true, required: false + private _apigGroupId?: string; + public get apigGroupId() { + return this.getStringAttribute('apig_group_id'); + } + public set apigGroupId(value: string) { + this._apigGroupId = value; + } + public resetApigGroupId() { + this._apigGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigGroupIdInput() { + return this._apigGroupId; + } + + // apig_instance_id - computed: false, optional: true, required: false + private _apigInstanceId?: string; + public get apigInstanceId() { + return this.getStringAttribute('apig_instance_id'); + } + public set apigInstanceId(value: string) { + this._apigInstanceId = value; + } + public resetApigInstanceId() { + this._apigInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigInstanceIdInput() { + return this._apigInstanceId; + } + + // apig_type - computed: false, optional: true, required: false + private _apigType?: string; + public get apigType() { + return this.getStringAttribute('apig_type'); + } + public set apigType(value: string) { + this._apigType = value; + } + public resetApigType() { + this._apigType = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigTypeInput() { + return this._apigType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // publish_id - computed: true, optional: false, required: false + public get publishId() { + return this.getStringAttribute('publish_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roma_app_id - computed: false, optional: true, required: false + private _romaAppId?: string; + public get romaAppId() { + return this.getStringAttribute('roma_app_id'); + } + public set romaAppId(value: string) { + this._romaAppId = value; + } + public resetRomaAppId() { + this._romaAppId = undefined; + } + // Temporarily expose input value. Use with caution. + public get romaAppIdInput() { + return this._romaAppId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataartsDataserviceApiPublishmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataartsDataserviceApiPublishmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + api_id: cdktf.stringToTerraform(this._apiId), + apig_group_id: cdktf.stringToTerraform(this._apigGroupId), + apig_instance_id: cdktf.stringToTerraform(this._apigInstanceId), + apig_type: cdktf.stringToTerraform(this._apigType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + roma_app_id: cdktf.stringToTerraform(this._romaAppId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + timeouts: dataartsDataserviceApiPublishmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + api_id: { + value: cdktf.stringToHclTerraform(this._apiId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig_group_id: { + value: cdktf.stringToHclTerraform(this._apigGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig_instance_id: { + value: cdktf.stringToHclTerraform(this._apigInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig_type: { + value: cdktf.stringToHclTerraform(this._apigType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roma_app_id: { + value: cdktf.stringToHclTerraform(this._romaAppId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataartsDataserviceApiPublishmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataartsDataserviceApiPublishmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-api/README.md new file mode 100644 index 00000000..028291e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_api` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_api`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-api/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-api/index.ts new file mode 100644 index 00000000..fe94e0a7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-api/index.ts @@ -0,0 +1,2870 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceApiConfig extends cdktf.TerraformMetaArguments { + /** + * The authentication type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#auth_type DataartsDataserviceApi#auth_type} + */ + readonly authType: string; + /** + * The ID of the catalog where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#catalog_id DataartsDataserviceApi#catalog_id} + */ + readonly catalogId: string; + /** + * The description of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#description DataartsDataserviceApi#description} + */ + readonly description?: string; + /** + * The type of DLM engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#dlm_type DataartsDataserviceApi#dlm_type} + */ + readonly dlmType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#id DataartsDataserviceApi#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The API reviewer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#manager DataartsDataserviceApi#manager} + */ + readonly manager: string; + /** + * The name of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; + /** + * The API request path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#path DataartsDataserviceApi#path} + */ + readonly path: string; + /** + * The request protocol of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#protocol DataartsDataserviceApi#protocol} + */ + readonly protocol: string; + /** + * The region where the API is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#region DataartsDataserviceApi#region} + */ + readonly region?: string; + /** + * The request type of the API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#request_type DataartsDataserviceApi#request_type} + */ + readonly requestType: string; + /** + * The API type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#type DataartsDataserviceApi#type} + */ + readonly type: string; + /** + * The visibility to the catalog of API. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#visibility DataartsDataserviceApi#visibility} + */ + readonly visibility?: string; + /** + * The ID of the workspace to which the API belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#workspace_id DataartsDataserviceApi#workspace_id} + */ + readonly workspaceId: string; + /** + * backend_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#backend_config DataartsDataserviceApi#backend_config} + */ + readonly backendConfig?: DataartsDataserviceApiBackendConfig; + /** + * datasource_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#datasource_config DataartsDataserviceApi#datasource_config} + */ + readonly datasourceConfig: DataartsDataserviceApiDatasourceConfig; + /** + * request_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#request_params DataartsDataserviceApi#request_params} + */ + readonly requestParams?: DataartsDataserviceApiRequestParams[] | cdktf.IResolvable; +} +export interface DataartsDataserviceApiHosts { +} + +export function dataartsDataserviceApiHostsToTerraform(struct?: DataartsDataserviceApiHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dataartsDataserviceApiHostsToHclTerraform(struct?: DataartsDataserviceApiHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DataartsDataserviceApiHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domains - computed: true, optional: false, required: false + public get domains() { + return this.getListAttribute('domains'); + } + + // external_host - computed: true, optional: false, required: false + public get externalHost() { + return this.getStringAttribute('external_host'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // intranet_host - computed: true, optional: false, required: false + public get intranetHost() { + return this.getStringAttribute('intranet_host'); + } +} + +export class DataartsDataserviceApiHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiHostsOutputReference { + return new DataartsDataserviceApiHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsDataserviceApiBackendConfigBackendParams { + /** + * The name of the corresponding backend parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#backend_param_name DataartsDataserviceApi#backend_param_name} + */ + readonly backendParamName: string; + /** + * The name of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; + /** + * The position of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#position DataartsDataserviceApi#position} + */ + readonly position: string; +} + +export function dataartsDataserviceApiBackendConfigBackendParamsToTerraform(struct?: DataartsDataserviceApiBackendConfigBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backend_param_name: cdktf.stringToTerraform(struct!.backendParamName), + name: cdktf.stringToTerraform(struct!.name), + position: cdktf.stringToTerraform(struct!.position), + } +} + + +export function dataartsDataserviceApiBackendConfigBackendParamsToHclTerraform(struct?: DataartsDataserviceApiBackendConfigBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backend_param_name: { + value: cdktf.stringToHclTerraform(struct!.backendParamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + position: { + value: cdktf.stringToHclTerraform(struct!.position), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiBackendConfigBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiBackendConfigBackendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backendParamName !== undefined) { + hasAnyValues = true; + internalValueResult.backendParamName = this._backendParamName; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._position !== undefined) { + hasAnyValues = true; + internalValueResult.position = this._position; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiBackendConfigBackendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._backendParamName = undefined; + this._name = undefined; + this._position = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._backendParamName = value.backendParamName; + this._name = value.name; + this._position = value.position; + } + } + + // backend_param_name - computed: false, optional: false, required: true + private _backendParamName?: string; + public get backendParamName() { + return this.getStringAttribute('backend_param_name'); + } + public set backendParamName(value: string) { + this._backendParamName = value; + } + // Temporarily expose input value. Use with caution. + public get backendParamNameInput() { + return this._backendParamName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // position - computed: false, optional: false, required: true + private _position?: string; + public get position() { + return this.getStringAttribute('position'); + } + public set position(value: string) { + this._position = value; + } + // Temporarily expose input value. Use with caution. + public get positionInput() { + return this._position; + } +} + +export class DataartsDataserviceApiBackendConfigBackendParamsList extends cdktf.ComplexList { + public internalValue? : DataartsDataserviceApiBackendConfigBackendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiBackendConfigBackendParamsOutputReference { + return new DataartsDataserviceApiBackendConfigBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsDataserviceApiBackendConfigConstantParams { + /** + * The description of the constant parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#description DataartsDataserviceApi#description} + */ + readonly description?: string; + /** + * The name of the constant parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; + /** + * The position of the constant parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#position DataartsDataserviceApi#position} + */ + readonly position: string; + /** + * The type of the constant parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#type DataartsDataserviceApi#type} + */ + readonly type: string; + /** + * The value of the constant parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#value DataartsDataserviceApi#value} + */ + readonly value: string; +} + +export function dataartsDataserviceApiBackendConfigConstantParamsToTerraform(struct?: DataartsDataserviceApiBackendConfigConstantParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + position: cdktf.stringToTerraform(struct!.position), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dataartsDataserviceApiBackendConfigConstantParamsToHclTerraform(struct?: DataartsDataserviceApiBackendConfigConstantParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + position: { + value: cdktf.stringToHclTerraform(struct!.position), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiBackendConfigConstantParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiBackendConfigConstantParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._position !== undefined) { + hasAnyValues = true; + internalValueResult.position = this._position; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiBackendConfigConstantParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._name = undefined; + this._position = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._name = value.name; + this._position = value.position; + this._type = value.type; + this._value = value.value; + } + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // position - computed: false, optional: false, required: true + private _position?: string; + public get position() { + return this.getStringAttribute('position'); + } + public set position(value: string) { + this._position = value; + } + // Temporarily expose input value. Use with caution. + public get positionInput() { + return this._position; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DataartsDataserviceApiBackendConfigConstantParamsList extends cdktf.ComplexList { + public internalValue? : DataartsDataserviceApiBackendConfigConstantParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiBackendConfigConstantParamsOutputReference { + return new DataartsDataserviceApiBackendConfigConstantParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsDataserviceApiBackendConfig { + /** + * The backend host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#host DataartsDataserviceApi#host} + */ + readonly host: string; + /** + * The backend path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#path DataartsDataserviceApi#path} + */ + readonly path: string; + /** + * The protocol of the backend request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#protocol DataartsDataserviceApi#protocol} + */ + readonly protocol: string; + /** + * The backend timeout. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#timeout DataartsDataserviceApi#timeout} + */ + readonly timeout?: number; + /** + * The type of the backend request. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#type DataartsDataserviceApi#type} + */ + readonly type: string; + /** + * backend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#backend_params DataartsDataserviceApi#backend_params} + */ + readonly backendParams?: DataartsDataserviceApiBackendConfigBackendParams[] | cdktf.IResolvable; + /** + * constant_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#constant_params DataartsDataserviceApi#constant_params} + */ + readonly constantParams?: DataartsDataserviceApiBackendConfigConstantParams[] | cdktf.IResolvable; +} + +export function dataartsDataserviceApiBackendConfigToTerraform(struct?: DataartsDataserviceApiBackendConfigOutputReference | DataartsDataserviceApiBackendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + protocol: cdktf.stringToTerraform(struct!.protocol), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + backend_params: cdktf.listMapper(dataartsDataserviceApiBackendConfigBackendParamsToTerraform, true)(struct!.backendParams), + constant_params: cdktf.listMapper(dataartsDataserviceApiBackendConfigConstantParamsToTerraform, true)(struct!.constantParams), + } +} + + +export function dataartsDataserviceApiBackendConfigToHclTerraform(struct?: DataartsDataserviceApiBackendConfigOutputReference | DataartsDataserviceApiBackendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_params: { + value: cdktf.listMapperHcl(dataartsDataserviceApiBackendConfigBackendParamsToHclTerraform, true)(struct!.backendParams), + isBlock: true, + type: "set", + storageClassType: "DataartsDataserviceApiBackendConfigBackendParamsList", + }, + constant_params: { + value: cdktf.listMapperHcl(dataartsDataserviceApiBackendConfigConstantParamsToHclTerraform, true)(struct!.constantParams), + isBlock: true, + type: "set", + storageClassType: "DataartsDataserviceApiBackendConfigConstantParamsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiBackendConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsDataserviceApiBackendConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._backendParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backendParams = this._backendParams?.internalValue; + } + if (this._constantParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.constantParams = this._constantParams?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiBackendConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._host = undefined; + this._path = undefined; + this._protocol = undefined; + this._timeout = undefined; + this._type = undefined; + this._backendParams.internalValue = undefined; + this._constantParams.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._host = value.host; + this._path = value.path; + this._protocol = value.protocol; + this._timeout = value.timeout; + this._type = value.type; + this._backendParams.internalValue = value.backendParams; + this._constantParams.internalValue = value.constantParams; + } + } + + // host - computed: false, optional: false, required: true + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // backend_params - computed: false, optional: true, required: false + private _backendParams = new DataartsDataserviceApiBackendConfigBackendParamsList(this, "backend_params", true); + public get backendParams() { + return this._backendParams; + } + public putBackendParams(value: DataartsDataserviceApiBackendConfigBackendParams[] | cdktf.IResolvable) { + this._backendParams.internalValue = value; + } + public resetBackendParams() { + this._backendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParamsInput() { + return this._backendParams.internalValue; + } + + // constant_params - computed: false, optional: true, required: false + private _constantParams = new DataartsDataserviceApiBackendConfigConstantParamsList(this, "constant_params", true); + public get constantParams() { + return this._constantParams; + } + public putConstantParams(value: DataartsDataserviceApiBackendConfigConstantParams[] | cdktf.IResolvable) { + this._constantParams.internalValue = value; + } + public resetConstantParams() { + this._constantParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get constantParamsInput() { + return this._constantParams.internalValue; + } +} +export interface DataartsDataserviceApiDatasourceConfigBackendParams { + /** + * The condition character. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#condition DataartsDataserviceApi#condition} + */ + readonly condition?: string; + /** + * The name of the mapping parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#mapping DataartsDataserviceApi#mapping} + */ + readonly mapping: string; + /** + * The name of the backend parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; +} + +export function dataartsDataserviceApiDatasourceConfigBackendParamsToTerraform(struct?: DataartsDataserviceApiDatasourceConfigBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + condition: cdktf.stringToTerraform(struct!.condition), + mapping: cdktf.stringToTerraform(struct!.mapping), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dataartsDataserviceApiDatasourceConfigBackendParamsToHclTerraform(struct?: DataartsDataserviceApiDatasourceConfigBackendParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + condition: { + value: cdktf.stringToHclTerraform(struct!.condition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mapping: { + value: cdktf.stringToHclTerraform(struct!.mapping), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiDatasourceConfigBackendParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiDatasourceConfigBackendParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._condition !== undefined) { + hasAnyValues = true; + internalValueResult.condition = this._condition; + } + if (this._mapping !== undefined) { + hasAnyValues = true; + internalValueResult.mapping = this._mapping; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiDatasourceConfigBackendParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._condition = undefined; + this._mapping = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._condition = value.condition; + this._mapping = value.mapping; + this._name = value.name; + } + } + + // condition - computed: true, optional: true, required: false + private _condition?: string; + public get condition() { + return this.getStringAttribute('condition'); + } + public set condition(value: string) { + this._condition = value; + } + public resetCondition() { + this._condition = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // mapping - computed: false, optional: false, required: true + private _mapping?: string; + public get mapping() { + return this.getStringAttribute('mapping'); + } + public set mapping(value: string) { + this._mapping = value; + } + // Temporarily expose input value. Use with caution. + public get mappingInput() { + return this._mapping; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DataartsDataserviceApiDatasourceConfigBackendParamsList extends cdktf.ComplexList { + public internalValue? : DataartsDataserviceApiDatasourceConfigBackendParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiDatasourceConfigBackendParamsOutputReference { + return new DataartsDataserviceApiDatasourceConfigBackendParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsDataserviceApiDatasourceConfigOrderParams { + /** + * The corresponding parameter field for the order parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#field DataartsDataserviceApi#field} + */ + readonly field: string; + /** + * The name of the order parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; + /** + * Whether this order parameter is the optional parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#optional DataartsDataserviceApi#optional} + */ + readonly optional?: boolean | cdktf.IResolvable; + /** + * The order of the sorting parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#order DataartsDataserviceApi#order} + */ + readonly order?: number; + /** + * The sort type of the order parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#sort DataartsDataserviceApi#sort} + */ + readonly sort?: string; +} + +export function dataartsDataserviceApiDatasourceConfigOrderParamsToTerraform(struct?: DataartsDataserviceApiDatasourceConfigOrderParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field: cdktf.stringToTerraform(struct!.field), + name: cdktf.stringToTerraform(struct!.name), + optional: cdktf.booleanToTerraform(struct!.optional), + order: cdktf.numberToTerraform(struct!.order), + sort: cdktf.stringToTerraform(struct!.sort), + } +} + + +export function dataartsDataserviceApiDatasourceConfigOrderParamsToHclTerraform(struct?: DataartsDataserviceApiDatasourceConfigOrderParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field: { + value: cdktf.stringToHclTerraform(struct!.field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + optional: { + value: cdktf.booleanToHclTerraform(struct!.optional), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + order: { + value: cdktf.numberToHclTerraform(struct!.order), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sort: { + value: cdktf.stringToHclTerraform(struct!.sort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiDatasourceConfigOrderParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiDatasourceConfigOrderParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._field !== undefined) { + hasAnyValues = true; + internalValueResult.field = this._field; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._optional !== undefined) { + hasAnyValues = true; + internalValueResult.optional = this._optional; + } + if (this._order !== undefined) { + hasAnyValues = true; + internalValueResult.order = this._order; + } + if (this._sort !== undefined) { + hasAnyValues = true; + internalValueResult.sort = this._sort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiDatasourceConfigOrderParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._field = undefined; + this._name = undefined; + this._optional = undefined; + this._order = undefined; + this._sort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._field = value.field; + this._name = value.name; + this._optional = value.optional; + this._order = value.order; + this._sort = value.sort; + } + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // optional - computed: true, optional: true, required: false + private _optional?: boolean | cdktf.IResolvable; + public get optional() { + return this.getBooleanAttribute('optional'); + } + public set optional(value: boolean | cdktf.IResolvable) { + this._optional = value; + } + public resetOptional() { + this._optional = undefined; + } + // Temporarily expose input value. Use with caution. + public get optionalInput() { + return this._optional; + } + + // order - computed: true, optional: true, required: false + private _order?: number; + public get order() { + return this.getNumberAttribute('order'); + } + public set order(value: number) { + this._order = value; + } + public resetOrder() { + this._order = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderInput() { + return this._order; + } + + // sort - computed: true, optional: true, required: false + private _sort?: string; + public get sort() { + return this.getStringAttribute('sort'); + } + public set sort(value: string) { + this._sort = value; + } + public resetSort() { + this._sort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortInput() { + return this._sort; + } +} + +export class DataartsDataserviceApiDatasourceConfigOrderParamsList extends cdktf.ComplexList { + public internalValue? : DataartsDataserviceApiDatasourceConfigOrderParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiDatasourceConfigOrderParamsOutputReference { + return new DataartsDataserviceApiDatasourceConfigOrderParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsDataserviceApiDatasourceConfigResponseParams { + /** + * The description of the response parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#description DataartsDataserviceApi#description} + */ + readonly description?: string; + /** + * The example value of the response parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#example_value DataartsDataserviceApi#example_value} + */ + readonly exampleValue?: string; + /** + * The bound table field for the response parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#field DataartsDataserviceApi#field} + */ + readonly field: string; + /** + * The name of the response parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; + /** + * The type of the response parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#type DataartsDataserviceApi#type} + */ + readonly type: string; +} + +export function dataartsDataserviceApiDatasourceConfigResponseParamsToTerraform(struct?: DataartsDataserviceApiDatasourceConfigResponseParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + example_value: cdktf.stringToTerraform(struct!.exampleValue), + field: cdktf.stringToTerraform(struct!.field), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dataartsDataserviceApiDatasourceConfigResponseParamsToHclTerraform(struct?: DataartsDataserviceApiDatasourceConfigResponseParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + example_value: { + value: cdktf.stringToHclTerraform(struct!.exampleValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field: { + value: cdktf.stringToHclTerraform(struct!.field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiDatasourceConfigResponseParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiDatasourceConfigResponseParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._exampleValue !== undefined) { + hasAnyValues = true; + internalValueResult.exampleValue = this._exampleValue; + } + if (this._field !== undefined) { + hasAnyValues = true; + internalValueResult.field = this._field; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiDatasourceConfigResponseParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._exampleValue = undefined; + this._field = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._exampleValue = value.exampleValue; + this._field = value.field; + this._name = value.name; + this._type = value.type; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // example_value - computed: false, optional: true, required: false + private _exampleValue?: string; + public get exampleValue() { + return this.getStringAttribute('example_value'); + } + public set exampleValue(value: string) { + this._exampleValue = value; + } + public resetExampleValue() { + this._exampleValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get exampleValueInput() { + return this._exampleValue; + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DataartsDataserviceApiDatasourceConfigResponseParamsList extends cdktf.ComplexList { + public internalValue? : DataartsDataserviceApiDatasourceConfigResponseParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiDatasourceConfigResponseParamsOutputReference { + return new DataartsDataserviceApiDatasourceConfigResponseParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsDataserviceApiDatasourceConfig { + /** + * The access mode for the data. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#access_mode DataartsDataserviceApi#access_mode} + */ + readonly accessMode?: string; + /** + * The ID of the data connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#connection_id DataartsDataserviceApi#connection_id} + */ + readonly connectionId?: string; + /** + * The name of the data connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#connection_name DataartsDataserviceApi#connection_name} + */ + readonly connectionName?: string; + /** + * The name of the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#database DataartsDataserviceApi#database} + */ + readonly database: string; + /** + * The name of the data table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#datatable DataartsDataserviceApi#datatable} + */ + readonly datatable: string; + /** + * The ID of the DLI queue. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#queue DataartsDataserviceApi#queue} + */ + readonly queue?: string; + /** + * The SQL statements in script access type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#sql DataartsDataserviceApi#sql} + */ + readonly sql?: string; + /** + * The ID of the data table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#table_id DataartsDataserviceApi#table_id} + */ + readonly tableId?: string; + /** + * The type of the data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#type DataartsDataserviceApi#type} + */ + readonly type: string; + /** + * backend_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#backend_params DataartsDataserviceApi#backend_params} + */ + readonly backendParams?: DataartsDataserviceApiDatasourceConfigBackendParams[] | cdktf.IResolvable; + /** + * order_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#order_params DataartsDataserviceApi#order_params} + */ + readonly orderParams?: DataartsDataserviceApiDatasourceConfigOrderParams[] | cdktf.IResolvable; + /** + * response_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#response_params DataartsDataserviceApi#response_params} + */ + readonly responseParams?: DataartsDataserviceApiDatasourceConfigResponseParams[] | cdktf.IResolvable; +} + +export function dataartsDataserviceApiDatasourceConfigToTerraform(struct?: DataartsDataserviceApiDatasourceConfigOutputReference | DataartsDataserviceApiDatasourceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_mode: cdktf.stringToTerraform(struct!.accessMode), + connection_id: cdktf.stringToTerraform(struct!.connectionId), + connection_name: cdktf.stringToTerraform(struct!.connectionName), + database: cdktf.stringToTerraform(struct!.database), + datatable: cdktf.stringToTerraform(struct!.datatable), + queue: cdktf.stringToTerraform(struct!.queue), + sql: cdktf.stringToTerraform(struct!.sql), + table_id: cdktf.stringToTerraform(struct!.tableId), + type: cdktf.stringToTerraform(struct!.type), + backend_params: cdktf.listMapper(dataartsDataserviceApiDatasourceConfigBackendParamsToTerraform, true)(struct!.backendParams), + order_params: cdktf.listMapper(dataartsDataserviceApiDatasourceConfigOrderParamsToTerraform, true)(struct!.orderParams), + response_params: cdktf.listMapper(dataartsDataserviceApiDatasourceConfigResponseParamsToTerraform, true)(struct!.responseParams), + } +} + + +export function dataartsDataserviceApiDatasourceConfigToHclTerraform(struct?: DataartsDataserviceApiDatasourceConfigOutputReference | DataartsDataserviceApiDatasourceConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_mode: { + value: cdktf.stringToHclTerraform(struct!.accessMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_id: { + value: cdktf.stringToHclTerraform(struct!.connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_name: { + value: cdktf.stringToHclTerraform(struct!.connectionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database: { + value: cdktf.stringToHclTerraform(struct!.database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + datatable: { + value: cdktf.stringToHclTerraform(struct!.datatable), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue: { + value: cdktf.stringToHclTerraform(struct!.queue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(struct!.sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_id: { + value: cdktf.stringToHclTerraform(struct!.tableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_params: { + value: cdktf.listMapperHcl(dataartsDataserviceApiDatasourceConfigBackendParamsToHclTerraform, true)(struct!.backendParams), + isBlock: true, + type: "set", + storageClassType: "DataartsDataserviceApiDatasourceConfigBackendParamsList", + }, + order_params: { + value: cdktf.listMapperHcl(dataartsDataserviceApiDatasourceConfigOrderParamsToHclTerraform, true)(struct!.orderParams), + isBlock: true, + type: "set", + storageClassType: "DataartsDataserviceApiDatasourceConfigOrderParamsList", + }, + response_params: { + value: cdktf.listMapperHcl(dataartsDataserviceApiDatasourceConfigResponseParamsToHclTerraform, true)(struct!.responseParams), + isBlock: true, + type: "set", + storageClassType: "DataartsDataserviceApiDatasourceConfigResponseParamsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiDatasourceConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsDataserviceApiDatasourceConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessMode !== undefined) { + hasAnyValues = true; + internalValueResult.accessMode = this._accessMode; + } + if (this._connectionId !== undefined) { + hasAnyValues = true; + internalValueResult.connectionId = this._connectionId; + } + if (this._connectionName !== undefined) { + hasAnyValues = true; + internalValueResult.connectionName = this._connectionName; + } + if (this._database !== undefined) { + hasAnyValues = true; + internalValueResult.database = this._database; + } + if (this._datatable !== undefined) { + hasAnyValues = true; + internalValueResult.datatable = this._datatable; + } + if (this._queue !== undefined) { + hasAnyValues = true; + internalValueResult.queue = this._queue; + } + if (this._sql !== undefined) { + hasAnyValues = true; + internalValueResult.sql = this._sql; + } + if (this._tableId !== undefined) { + hasAnyValues = true; + internalValueResult.tableId = this._tableId; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._backendParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.backendParams = this._backendParams?.internalValue; + } + if (this._orderParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.orderParams = this._orderParams?.internalValue; + } + if (this._responseParams?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.responseParams = this._responseParams?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiDatasourceConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessMode = undefined; + this._connectionId = undefined; + this._connectionName = undefined; + this._database = undefined; + this._datatable = undefined; + this._queue = undefined; + this._sql = undefined; + this._tableId = undefined; + this._type = undefined; + this._backendParams.internalValue = undefined; + this._orderParams.internalValue = undefined; + this._responseParams.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessMode = value.accessMode; + this._connectionId = value.connectionId; + this._connectionName = value.connectionName; + this._database = value.database; + this._datatable = value.datatable; + this._queue = value.queue; + this._sql = value.sql; + this._tableId = value.tableId; + this._type = value.type; + this._backendParams.internalValue = value.backendParams; + this._orderParams.internalValue = value.orderParams; + this._responseParams.internalValue = value.responseParams; + } + } + + // access_mode - computed: true, optional: true, required: false + private _accessMode?: string; + public get accessMode() { + return this.getStringAttribute('access_mode'); + } + public set accessMode(value: string) { + this._accessMode = value; + } + public resetAccessMode() { + this._accessMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessModeInput() { + return this._accessMode; + } + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // connection_name - computed: true, optional: true, required: false + private _connectionName?: string; + public get connectionName() { + return this.getStringAttribute('connection_name'); + } + public set connectionName(value: string) { + this._connectionName = value; + } + public resetConnectionName() { + this._connectionName = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionNameInput() { + return this._connectionName; + } + + // database - computed: false, optional: false, required: true + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // datatable - computed: false, optional: false, required: true + private _datatable?: string; + public get datatable() { + return this.getStringAttribute('datatable'); + } + public set datatable(value: string) { + this._datatable = value; + } + // Temporarily expose input value. Use with caution. + public get datatableInput() { + return this._datatable; + } + + // queue - computed: true, optional: true, required: false + private _queue?: string; + public get queue() { + return this.getStringAttribute('queue'); + } + public set queue(value: string) { + this._queue = value; + } + public resetQueue() { + this._queue = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueInput() { + return this._queue; + } + + // sql - computed: false, optional: true, required: false + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + public resetSql() { + this._sql = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // table_id - computed: true, optional: true, required: false + private _tableId?: string; + public get tableId() { + return this.getStringAttribute('table_id'); + } + public set tableId(value: string) { + this._tableId = value; + } + public resetTableId() { + this._tableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableIdInput() { + return this._tableId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // backend_params - computed: false, optional: true, required: false + private _backendParams = new DataartsDataserviceApiDatasourceConfigBackendParamsList(this, "backend_params", true); + public get backendParams() { + return this._backendParams; + } + public putBackendParams(value: DataartsDataserviceApiDatasourceConfigBackendParams[] | cdktf.IResolvable) { + this._backendParams.internalValue = value; + } + public resetBackendParams() { + this._backendParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendParamsInput() { + return this._backendParams.internalValue; + } + + // order_params - computed: false, optional: true, required: false + private _orderParams = new DataartsDataserviceApiDatasourceConfigOrderParamsList(this, "order_params", true); + public get orderParams() { + return this._orderParams; + } + public putOrderParams(value: DataartsDataserviceApiDatasourceConfigOrderParams[] | cdktf.IResolvable) { + this._orderParams.internalValue = value; + } + public resetOrderParams() { + this._orderParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderParamsInput() { + return this._orderParams.internalValue; + } + + // response_params - computed: false, optional: true, required: false + private _responseParams = new DataartsDataserviceApiDatasourceConfigResponseParamsList(this, "response_params", true); + public get responseParams() { + return this._responseParams; + } + public putResponseParams(value: DataartsDataserviceApiDatasourceConfigResponseParams[] | cdktf.IResolvable) { + this._responseParams.internalValue = value; + } + public resetResponseParams() { + this._responseParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseParamsInput() { + return this._responseParams.internalValue; + } +} +export interface DataartsDataserviceApiRequestParams { + /** + * The default value of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#default_value DataartsDataserviceApi#default_value} + */ + readonly defaultValue?: string; + /** + * The description of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#description DataartsDataserviceApi#description} + */ + readonly description?: string; + /** + * The example value of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#example_value DataartsDataserviceApi#example_value} + */ + readonly exampleValue?: string; + /** + * The name of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#name DataartsDataserviceApi#name} + */ + readonly name: string; + /** + * Whether this parameter is the required parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#necessary DataartsDataserviceApi#necessary} + */ + readonly necessary?: boolean | cdktf.IResolvable; + /** + * The position of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#position DataartsDataserviceApi#position} + */ + readonly position: string; + /** + * The type of the request parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#type DataartsDataserviceApi#type} + */ + readonly type: string; +} + +export function dataartsDataserviceApiRequestParamsToTerraform(struct?: DataartsDataserviceApiRequestParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default_value: cdktf.stringToTerraform(struct!.defaultValue), + description: cdktf.stringToTerraform(struct!.description), + example_value: cdktf.stringToTerraform(struct!.exampleValue), + name: cdktf.stringToTerraform(struct!.name), + necessary: cdktf.booleanToTerraform(struct!.necessary), + position: cdktf.stringToTerraform(struct!.position), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dataartsDataserviceApiRequestParamsToHclTerraform(struct?: DataartsDataserviceApiRequestParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default_value: { + value: cdktf.stringToHclTerraform(struct!.defaultValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + example_value: { + value: cdktf.stringToHclTerraform(struct!.exampleValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + necessary: { + value: cdktf.booleanToHclTerraform(struct!.necessary), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + position: { + value: cdktf.stringToHclTerraform(struct!.position), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsDataserviceApiRequestParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsDataserviceApiRequestParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._defaultValue !== undefined) { + hasAnyValues = true; + internalValueResult.defaultValue = this._defaultValue; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._exampleValue !== undefined) { + hasAnyValues = true; + internalValueResult.exampleValue = this._exampleValue; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._necessary !== undefined) { + hasAnyValues = true; + internalValueResult.necessary = this._necessary; + } + if (this._position !== undefined) { + hasAnyValues = true; + internalValueResult.position = this._position; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsDataserviceApiRequestParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._defaultValue = undefined; + this._description = undefined; + this._exampleValue = undefined; + this._name = undefined; + this._necessary = undefined; + this._position = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._defaultValue = value.defaultValue; + this._description = value.description; + this._exampleValue = value.exampleValue; + this._name = value.name; + this._necessary = value.necessary; + this._position = value.position; + this._type = value.type; + } + } + + // default_value - computed: false, optional: true, required: false + private _defaultValue?: string; + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + public set defaultValue(value: string) { + this._defaultValue = value; + } + public resetDefaultValue() { + this._defaultValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultValueInput() { + return this._defaultValue; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // example_value - computed: false, optional: true, required: false + private _exampleValue?: string; + public get exampleValue() { + return this.getStringAttribute('example_value'); + } + public set exampleValue(value: string) { + this._exampleValue = value; + } + public resetExampleValue() { + this._exampleValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get exampleValueInput() { + return this._exampleValue; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // necessary - computed: false, optional: true, required: false + private _necessary?: boolean | cdktf.IResolvable; + public get necessary() { + return this.getBooleanAttribute('necessary'); + } + public set necessary(value: boolean | cdktf.IResolvable) { + this._necessary = value; + } + public resetNecessary() { + this._necessary = undefined; + } + // Temporarily expose input value. Use with caution. + public get necessaryInput() { + return this._necessary; + } + + // position - computed: false, optional: false, required: true + private _position?: string; + public get position() { + return this.getStringAttribute('position'); + } + public set position(value: string) { + this._position = value; + } + // Temporarily expose input value. Use with caution. + public get positionInput() { + return this._position; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DataartsDataserviceApiRequestParamsList extends cdktf.ComplexList { + public internalValue? : DataartsDataserviceApiRequestParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsDataserviceApiRequestParamsOutputReference { + return new DataartsDataserviceApiRequestParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api huaweicloud_dataarts_dataservice_api} +*/ +export class DataartsDataserviceApi extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_api"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApi resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApi to import + * @param importFromId The id of the existing DataartsDataserviceApi that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApi to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_api", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_api huaweicloud_dataarts_dataservice_api} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceApiConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceApiConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_api', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authType = config.authType; + this._catalogId = config.catalogId; + this._description = config.description; + this._dlmType = config.dlmType; + this._id = config.id; + this._manager = config.manager; + this._name = config.name; + this._path = config.path; + this._protocol = config.protocol; + this._region = config.region; + this._requestType = config.requestType; + this._type = config.type; + this._visibility = config.visibility; + this._workspaceId = config.workspaceId; + this._backendConfig.internalValue = config.backendConfig; + this._datasourceConfig.internalValue = config.datasourceConfig; + this._requestParams.internalValue = config.requestParams; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_type - computed: false, optional: false, required: true + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // catalog_id - computed: false, optional: false, required: true + private _catalogId?: string; + public get catalogId() { + return this.getStringAttribute('catalog_id'); + } + public set catalogId(value: string) { + this._catalogId = value; + } + // Temporarily expose input value. Use with caution. + public get catalogIdInput() { + return this._catalogId; + } + + // create_user - computed: true, optional: false, required: false + public get createUser() { + return this.getStringAttribute('create_user'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dlm_type - computed: false, optional: true, required: false + private _dlmType?: string; + public get dlmType() { + return this.getStringAttribute('dlm_type'); + } + public set dlmType(value: string) { + this._dlmType = value; + } + public resetDlmType() { + this._dlmType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dlmTypeInput() { + return this._dlmType; + } + + // group_id - computed: true, optional: false, required: false + public get groupId() { + return this.getStringAttribute('group_id'); + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } + + // hosts - computed: true, optional: false, required: false + private _hosts = new DataartsDataserviceApiHostsList(this, "hosts", false); + public get hosts() { + return this._hosts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // manager - computed: false, optional: false, required: true + private _manager?: string; + public get manager() { + return this.getStringAttribute('manager'); + } + public set manager(value: string) { + this._manager = value; + } + // Temporarily expose input value. Use with caution. + public get managerInput() { + return this._manager; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_type - computed: false, optional: false, required: true + private _requestType?: string; + public get requestType() { + return this.getStringAttribute('request_type'); + } + public set requestType(value: string) { + this._requestType = value; + } + // Temporarily expose input value. Use with caution. + public get requestTypeInput() { + return this._requestType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: false, optional: true, required: false + private _visibility?: string; + public get visibility() { + return this.getStringAttribute('visibility'); + } + public set visibility(value: string) { + this._visibility = value; + } + public resetVisibility() { + this._visibility = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityInput() { + return this._visibility; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // backend_config - computed: false, optional: true, required: false + private _backendConfig = new DataartsDataserviceApiBackendConfigOutputReference(this, "backend_config"); + public get backendConfig() { + return this._backendConfig; + } + public putBackendConfig(value: DataartsDataserviceApiBackendConfig) { + this._backendConfig.internalValue = value; + } + public resetBackendConfig() { + this._backendConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendConfigInput() { + return this._backendConfig.internalValue; + } + + // datasource_config - computed: false, optional: false, required: true + private _datasourceConfig = new DataartsDataserviceApiDatasourceConfigOutputReference(this, "datasource_config"); + public get datasourceConfig() { + return this._datasourceConfig; + } + public putDatasourceConfig(value: DataartsDataserviceApiDatasourceConfig) { + this._datasourceConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get datasourceConfigInput() { + return this._datasourceConfig.internalValue; + } + + // request_params - computed: false, optional: true, required: false + private _requestParams = new DataartsDataserviceApiRequestParamsList(this, "request_params", true); + public get requestParams() { + return this._requestParams; + } + public putRequestParams(value: DataartsDataserviceApiRequestParams[] | cdktf.IResolvable) { + this._requestParams.internalValue = value; + } + public resetRequestParams() { + this._requestParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestParamsInput() { + return this._requestParams.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_type: cdktf.stringToTerraform(this._authType), + catalog_id: cdktf.stringToTerraform(this._catalogId), + description: cdktf.stringToTerraform(this._description), + dlm_type: cdktf.stringToTerraform(this._dlmType), + id: cdktf.stringToTerraform(this._id), + manager: cdktf.stringToTerraform(this._manager), + name: cdktf.stringToTerraform(this._name), + path: cdktf.stringToTerraform(this._path), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + request_type: cdktf.stringToTerraform(this._requestType), + type: cdktf.stringToTerraform(this._type), + visibility: cdktf.stringToTerraform(this._visibility), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + backend_config: dataartsDataserviceApiBackendConfigToTerraform(this._backendConfig.internalValue), + datasource_config: dataartsDataserviceApiDatasourceConfigToTerraform(this._datasourceConfig.internalValue), + request_params: cdktf.listMapper(dataartsDataserviceApiRequestParamsToTerraform, true)(this._requestParams.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + catalog_id: { + value: cdktf.stringToHclTerraform(this._catalogId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dlm_type: { + value: cdktf.stringToHclTerraform(this._dlmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager: { + value: cdktf.stringToHclTerraform(this._manager), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_type: { + value: cdktf.stringToHclTerraform(this._requestType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + visibility: { + value: cdktf.stringToHclTerraform(this._visibility), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_config: { + value: dataartsDataserviceApiBackendConfigToHclTerraform(this._backendConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsDataserviceApiBackendConfigList", + }, + datasource_config: { + value: dataartsDataserviceApiDatasourceConfigToHclTerraform(this._datasourceConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsDataserviceApiDatasourceConfigList", + }, + request_params: { + value: cdktf.listMapperHcl(dataartsDataserviceApiRequestParamsToHclTerraform, true)(this._requestParams.internalValue), + isBlock: true, + type: "set", + storageClassType: "DataartsDataserviceApiRequestParamsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-app/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-app/README.md new file mode 100644 index 00000000..2a0b6ea4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-app/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_app` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_app`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-app/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-app/index.ts new file mode 100644 index 00000000..2c563d92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-app/index.ts @@ -0,0 +1,295 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceAppConfig extends cdktf.TerraformMetaArguments { + /** + * The type of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#app_type DataartsDataserviceApp#app_type} + */ + readonly appType?: string; + /** + * The description of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#description DataartsDataserviceApp#description} + */ + readonly description?: string; + /** + * The type of DLM engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#dlm_type DataartsDataserviceApp#dlm_type} + */ + readonly dlmType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#id DataartsDataserviceApp#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#name DataartsDataserviceApp#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#region DataartsDataserviceApp#region} + */ + readonly region?: string; + /** + * The workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#workspace_id DataartsDataserviceApp#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app huaweicloud_dataarts_dataservice_app} +*/ +export class DataartsDataserviceApp extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_app"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceApp resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceApp to import + * @param importFromId The id of the existing DataartsDataserviceApp that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceApp to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_app", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_app huaweicloud_dataarts_dataservice_app} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceAppConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceAppConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_app', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appType = config.appType; + this._description = config.description; + this._dlmType = config.dlmType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_key - computed: true, optional: false, required: false + public get appKey() { + return this.getStringAttribute('app_key'); + } + + // app_secret - computed: true, optional: false, required: false + public get appSecret() { + return this.getStringAttribute('app_secret'); + } + + // app_type - computed: true, optional: true, required: false + private _appType?: string; + public get appType() { + return this.getStringAttribute('app_type'); + } + public set appType(value: string) { + this._appType = value; + } + public resetAppType() { + this._appType = undefined; + } + // Temporarily expose input value. Use with caution. + public get appTypeInput() { + return this._appType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dlm_type - computed: false, optional: false, required: true + private _dlmType?: string; + public get dlmType() { + return this.getStringAttribute('dlm_type'); + } + public set dlmType(value: string) { + this._dlmType = value; + } + // Temporarily expose input value. Use with caution. + public get dlmTypeInput() { + return this._dlmType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_type: cdktf.stringToTerraform(this._appType), + description: cdktf.stringToTerraform(this._description), + dlm_type: cdktf.stringToTerraform(this._dlmType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_type: { + value: cdktf.stringToHclTerraform(this._appType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dlm_type: { + value: cdktf.stringToHclTerraform(this._dlmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/README.md new file mode 100644 index 00000000..150d9be6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_catalog` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_catalog`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/index.ts new file mode 100644 index 00000000..592565b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-catalog/index.ts @@ -0,0 +1,325 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceCatalogConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the catalog. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#description DataartsDataserviceCatalog#description} + */ + readonly description?: string; + /** + * The type of DLM engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#dlm_type DataartsDataserviceCatalog#dlm_type} + */ + readonly dlmType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#id DataartsDataserviceCatalog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the catalog. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#name DataartsDataserviceCatalog#name} + */ + readonly name: string; + /** + * The ID of the parent catalog for current catalog. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#parent_id DataartsDataserviceCatalog#parent_id} + */ + readonly parentId?: string; + /** + * The region where the catalog is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#region DataartsDataserviceCatalog#region} + */ + readonly region?: string; + /** + * The ID of the workspace to which the catalog belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#workspace_id DataartsDataserviceCatalog#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog huaweicloud_dataarts_dataservice_catalog} +*/ +export class DataartsDataserviceCatalog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_catalog"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceCatalog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceCatalog to import + * @param importFromId The id of the existing DataartsDataserviceCatalog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceCatalog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_catalog", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_catalog huaweicloud_dataarts_dataservice_catalog} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceCatalogConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceCatalogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_catalog', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._dlmType = config.dlmType; + this._id = config.id; + this._name = config.name; + this._parentId = config.parentId; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // api_total - computed: true, optional: false, required: false + public get apiTotal() { + return this.getNumberAttribute('api_total'); + } + + // catalog_total - computed: true, optional: false, required: false + public get catalogTotal() { + return this.getNumberAttribute('catalog_total'); + } + + // create_user - computed: true, optional: false, required: false + public get createUser() { + return this.getStringAttribute('create_user'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dlm_type - computed: false, optional: true, required: false + private _dlmType?: string; + public get dlmType() { + return this.getStringAttribute('dlm_type'); + } + public set dlmType(value: string) { + this._dlmType = value; + } + public resetDlmType() { + this._dlmType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dlmTypeInput() { + return this._dlmType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // update_user - computed: true, optional: false, required: false + public get updateUser() { + return this.getStringAttribute('update_user'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + dlm_type: cdktf.stringToTerraform(this._dlmType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dlm_type: { + value: cdktf.stringToHclTerraform(this._dlmType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/README.md b/src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/README.md new file mode 100644 index 00000000..9f2127b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_dataservice_message_approve` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_dataservice_message_approve`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve). diff --git a/src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/index.ts b/src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/index.ts new file mode 100644 index 00000000..bc3bf76c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-dataservice-message-approve/index.ts @@ -0,0 +1,260 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsDataserviceMessageApproveConfig extends cdktf.TerraformMetaArguments { + /** + * The approve action performed by the message. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#action DataartsDataserviceMessageApprove#action} + */ + readonly action?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#id DataartsDataserviceMessageApprove#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the message (to be approved). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#message_id DataartsDataserviceMessageApprove#message_id} + */ + readonly messageId: string; + /** + * The region where the message (to be approved) is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#region DataartsDataserviceMessageApprove#region} + */ + readonly region?: string; + /** + * The execution time of the message action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#time DataartsDataserviceMessageApprove#time} + */ + readonly time?: string; + /** + * The workspace ID of the exclusive API to which the message (to be approved) belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#workspace_id DataartsDataserviceMessageApprove#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve huaweicloud_dataarts_dataservice_message_approve} +*/ +export class DataartsDataserviceMessageApprove extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_dataservice_message_approve"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsDataserviceMessageApprove resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsDataserviceMessageApprove to import + * @param importFromId The id of the existing DataartsDataserviceMessageApprove that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsDataserviceMessageApprove to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_dataservice_message_approve", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_dataservice_message_approve huaweicloud_dataarts_dataservice_message_approve} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsDataserviceMessageApproveConfig + */ + public constructor(scope: Construct, id: string, config: DataartsDataserviceMessageApproveConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_dataservice_message_approve', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._messageId = config.messageId; + this._region = config.region; + this._time = config.time; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: number; + public get action() { + return this.getNumberAttribute('action'); + } + public set action(value: number) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // message_id - computed: false, optional: false, required: true + private _messageId?: string; + public get messageId() { + return this.getStringAttribute('message_id'); + } + public set messageId(value: string) { + this._messageId = value; + } + // Temporarily expose input value. Use with caution. + public get messageIdInput() { + return this._messageId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // time - computed: false, optional: true, required: false + private _time?: string; + public get time() { + return this.getStringAttribute('time'); + } + public set time(value: string) { + this._time = value; + } + public resetTime() { + this._time = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeInput() { + return this._time; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.numberToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + message_id: cdktf.stringToTerraform(this._messageId), + region: cdktf.stringToTerraform(this._region), + time: cdktf.stringToTerraform(this._time), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.numberToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_id: { + value: cdktf.stringToHclTerraform(this._messageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time: { + value: cdktf.stringToHclTerraform(this._time), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-job-action/README.md b/src/constructs/providers/huaweicloud/dataarts-factory-job-action/README.md new file mode 100644 index 00000000..82a2922e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-job-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_factory_job_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_factory_job_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action). diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-job-action/index.ts b/src/constructs/providers/huaweicloud/dataarts-factory-job-action/index.ts new file mode 100644 index 00000000..90504b69 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-job-action/index.ts @@ -0,0 +1,417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsFactoryJobActionConfig extends cdktf.TerraformMetaArguments { + /** + * Specified the action type of the job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#action DataartsFactoryJobAction#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#id DataartsFactoryJobAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specified the name of the job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#job_name DataartsFactoryJobAction#job_name} + */ + readonly jobName: string; + /** + * Specified the type of the job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#process_type DataartsFactoryJobAction#process_type} + */ + readonly processType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#region DataartsFactoryJobAction#region} + */ + readonly region?: string; + /** + * Specified the ID of the workspace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#workspace_id DataartsFactoryJobAction#workspace_id} + */ + readonly workspaceId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#timeouts DataartsFactoryJobAction#timeouts} + */ + readonly timeouts?: DataartsFactoryJobActionTimeouts; +} +export interface DataartsFactoryJobActionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#create DataartsFactoryJobAction#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#update DataartsFactoryJobAction#update} + */ + readonly update?: string; +} + +export function dataartsFactoryJobActionTimeoutsToTerraform(struct?: DataartsFactoryJobActionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dataartsFactoryJobActionTimeoutsToHclTerraform(struct?: DataartsFactoryJobActionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobActionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataartsFactoryJobActionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobActionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action huaweicloud_dataarts_factory_job_action} +*/ +export class DataartsFactoryJobAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_factory_job_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsFactoryJobAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsFactoryJobAction to import + * @param importFromId The id of the existing DataartsFactoryJobAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsFactoryJobAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_factory_job_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job_action huaweicloud_dataarts_factory_job_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsFactoryJobActionConfig + */ + public constructor(scope: Construct, id: string, config: DataartsFactoryJobActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_factory_job_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._jobName = config.jobName; + this._processType = config.processType; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_name - computed: false, optional: false, required: true + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // process_type - computed: false, optional: false, required: true + private _processType?: string; + public get processType() { + return this.getStringAttribute('process_type'); + } + public set processType(value: string) { + this._processType = value; + } + // Temporarily expose input value. Use with caution. + public get processTypeInput() { + return this._processType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // workspace_id - computed: false, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataartsFactoryJobActionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataartsFactoryJobActionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + job_name: cdktf.stringToTerraform(this._jobName), + process_type: cdktf.stringToTerraform(this._processType), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + timeouts: dataartsFactoryJobActionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + process_type: { + value: cdktf.stringToHclTerraform(this._processType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataartsFactoryJobActionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataartsFactoryJobActionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-job/README.md b/src/constructs/providers/huaweicloud/dataarts-factory-job/README.md new file mode 100644 index 00000000..5f82d8fd --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_factory_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_factory_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job). diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-job/index.ts b/src/constructs/providers/huaweicloud/dataarts-factory-job/index.ts new file mode 100644 index 00000000..aa591ef4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-job/index.ts @@ -0,0 +1,3234 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsFactoryJobConfig extends cdktf.TerraformMetaArguments { + /** + * Path of a job in the directory tree. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#directory DataartsFactoryJob#directory} + */ + readonly directory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#id DataartsFactoryJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The OBS path where job execution logs are stored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#log_path DataartsFactoryJob#log_path} + */ + readonly logPath?: string; + /** + * Job name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#name DataartsFactoryJob#name} + */ + readonly name: string; + /** + * Job type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#process_type DataartsFactoryJob#process_type} + */ + readonly processType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#region DataartsFactoryJob#region} + */ + readonly region?: string; + /** + * The workspace ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#workspace_id DataartsFactoryJob#workspace_id} + */ + readonly workspaceId?: string; + /** + * basic_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#basic_config DataartsFactoryJob#basic_config} + */ + readonly basicConfig?: DataartsFactoryJobBasicConfig; + /** + * nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#nodes DataartsFactoryJob#nodes} + */ + readonly nodes: DataartsFactoryJobNodes[] | cdktf.IResolvable; + /** + * params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#params DataartsFactoryJob#params} + */ + readonly params?: DataartsFactoryJobParams[] | cdktf.IResolvable; + /** + * schedule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#schedule DataartsFactoryJob#schedule} + */ + readonly schedule: DataartsFactoryJobSchedule; +} +export interface DataartsFactoryJobBasicConfig { + /** + * Custom fields. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#custom_fields DataartsFactoryJob#custom_fields} + */ + readonly customFields?: { [key: string]: string }; + /** + * Job execution user. The value must be an existing user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#execute_user DataartsFactoryJob#execute_user} + */ + readonly executeUser?: string; + /** + * Maximum execution time of a job instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#instance_timeout DataartsFactoryJob#instance_timeout} + */ + readonly instanceTimeout?: number; + /** + * Job owner. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#owner DataartsFactoryJob#owner} + */ + readonly owner?: string; + /** + * Job priority. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#priority DataartsFactoryJob#priority} + */ + readonly priority?: number; +} + +export function dataartsFactoryJobBasicConfigToTerraform(struct?: DataartsFactoryJobBasicConfigOutputReference | DataartsFactoryJobBasicConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + custom_fields: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.customFields), + execute_user: cdktf.stringToTerraform(struct!.executeUser), + instance_timeout: cdktf.numberToTerraform(struct!.instanceTimeout), + owner: cdktf.stringToTerraform(struct!.owner), + priority: cdktf.numberToTerraform(struct!.priority), + } +} + + +export function dataartsFactoryJobBasicConfigToHclTerraform(struct?: DataartsFactoryJobBasicConfigOutputReference | DataartsFactoryJobBasicConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + custom_fields: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.customFields), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + execute_user: { + value: cdktf.stringToHclTerraform(struct!.executeUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_timeout: { + value: cdktf.numberToHclTerraform(struct!.instanceTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + owner: { + value: cdktf.stringToHclTerraform(struct!.owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobBasicConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobBasicConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._customFields !== undefined) { + hasAnyValues = true; + internalValueResult.customFields = this._customFields; + } + if (this._executeUser !== undefined) { + hasAnyValues = true; + internalValueResult.executeUser = this._executeUser; + } + if (this._instanceTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.instanceTimeout = this._instanceTimeout; + } + if (this._owner !== undefined) { + hasAnyValues = true; + internalValueResult.owner = this._owner; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobBasicConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._customFields = undefined; + this._executeUser = undefined; + this._instanceTimeout = undefined; + this._owner = undefined; + this._priority = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._customFields = value.customFields; + this._executeUser = value.executeUser; + this._instanceTimeout = value.instanceTimeout; + this._owner = value.owner; + this._priority = value.priority; + } + } + + // custom_fields - computed: true, optional: true, required: false + private _customFields?: { [key: string]: string }; + public get customFields() { + return this.getStringMapAttribute('custom_fields'); + } + public set customFields(value: { [key: string]: string }) { + this._customFields = value; + } + public resetCustomFields() { + this._customFields = undefined; + } + // Temporarily expose input value. Use with caution. + public get customFieldsInput() { + return this._customFields; + } + + // execute_user - computed: true, optional: true, required: false + private _executeUser?: string; + public get executeUser() { + return this.getStringAttribute('execute_user'); + } + public set executeUser(value: string) { + this._executeUser = value; + } + public resetExecuteUser() { + this._executeUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get executeUserInput() { + return this._executeUser; + } + + // instance_timeout - computed: true, optional: true, required: false + private _instanceTimeout?: number; + public get instanceTimeout() { + return this.getNumberAttribute('instance_timeout'); + } + public set instanceTimeout(value: number) { + this._instanceTimeout = value; + } + public resetInstanceTimeout() { + this._instanceTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceTimeoutInput() { + return this._instanceTimeout; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } +} +export interface DataartsFactoryJobNodesConditions { + /** + * EL expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#expression DataartsFactoryJob#expression} + */ + readonly expression: string; + /** + * Name of the previous node on which the current node depends. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#pre_node_name DataartsFactoryJob#pre_node_name} + */ + readonly preNodeName: string; +} + +export function dataartsFactoryJobNodesConditionsToTerraform(struct?: DataartsFactoryJobNodesConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + expression: cdktf.stringToTerraform(struct!.expression), + pre_node_name: cdktf.stringToTerraform(struct!.preNodeName), + } +} + + +export function dataartsFactoryJobNodesConditionsToHclTerraform(struct?: DataartsFactoryJobNodesConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + expression: { + value: cdktf.stringToHclTerraform(struct!.expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pre_node_name: { + value: cdktf.stringToHclTerraform(struct!.preNodeName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsFactoryJobNodesConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._expression !== undefined) { + hasAnyValues = true; + internalValueResult.expression = this._expression; + } + if (this._preNodeName !== undefined) { + hasAnyValues = true; + internalValueResult.preNodeName = this._preNodeName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodesConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._expression = undefined; + this._preNodeName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._expression = value.expression; + this._preNodeName = value.preNodeName; + } + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // pre_node_name - computed: false, optional: false, required: true + private _preNodeName?: string; + public get preNodeName() { + return this.getStringAttribute('pre_node_name'); + } + public set preNodeName(value: string) { + this._preNodeName = value; + } + // Temporarily expose input value. Use with caution. + public get preNodeNameInput() { + return this._preNodeName; + } +} + +export class DataartsFactoryJobNodesConditionsList extends cdktf.ComplexList { + public internalValue? : DataartsFactoryJobNodesConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsFactoryJobNodesConditionsOutputReference { + return new DataartsFactoryJobNodesConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsFactoryJobNodesCronTriggerDependJobs { + /** + * Dependency job failure policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_fail_policy DataartsFactoryJob#depend_fail_policy} + */ + readonly dependFailPolicy?: string; + /** + * Dependency period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_period DataartsFactoryJob#depend_period} + */ + readonly dependPeriod?: string; + /** + * A list of dependent jobs. Only the existing jobs can be depended on. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#jobs DataartsFactoryJob#jobs} + */ + readonly jobs: string[]; +} + +export function dataartsFactoryJobNodesCronTriggerDependJobsToTerraform(struct?: DataartsFactoryJobNodesCronTriggerDependJobsOutputReference | DataartsFactoryJobNodesCronTriggerDependJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + depend_fail_policy: cdktf.stringToTerraform(struct!.dependFailPolicy), + depend_period: cdktf.stringToTerraform(struct!.dependPeriod), + jobs: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.jobs), + } +} + + +export function dataartsFactoryJobNodesCronTriggerDependJobsToHclTerraform(struct?: DataartsFactoryJobNodesCronTriggerDependJobsOutputReference | DataartsFactoryJobNodesCronTriggerDependJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + depend_fail_policy: { + value: cdktf.stringToHclTerraform(struct!.dependFailPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + depend_period: { + value: cdktf.stringToHclTerraform(struct!.dependPeriod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + jobs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.jobs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesCronTriggerDependJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobNodesCronTriggerDependJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dependFailPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.dependFailPolicy = this._dependFailPolicy; + } + if (this._dependPeriod !== undefined) { + hasAnyValues = true; + internalValueResult.dependPeriod = this._dependPeriod; + } + if (this._jobs !== undefined) { + hasAnyValues = true; + internalValueResult.jobs = this._jobs; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodesCronTriggerDependJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dependFailPolicy = undefined; + this._dependPeriod = undefined; + this._jobs = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dependFailPolicy = value.dependFailPolicy; + this._dependPeriod = value.dependPeriod; + this._jobs = value.jobs; + } + } + + // depend_fail_policy - computed: true, optional: true, required: false + private _dependFailPolicy?: string; + public get dependFailPolicy() { + return this.getStringAttribute('depend_fail_policy'); + } + public set dependFailPolicy(value: string) { + this._dependFailPolicy = value; + } + public resetDependFailPolicy() { + this._dependFailPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependFailPolicyInput() { + return this._dependFailPolicy; + } + + // depend_period - computed: true, optional: true, required: false + private _dependPeriod?: string; + public get dependPeriod() { + return this.getStringAttribute('depend_period'); + } + public set dependPeriod(value: string) { + this._dependPeriod = value; + } + public resetDependPeriod() { + this._dependPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependPeriodInput() { + return this._dependPeriod; + } + + // jobs - computed: false, optional: false, required: true + private _jobs?: string[]; + public get jobs() { + return this.getListAttribute('jobs'); + } + public set jobs(value: string[]) { + this._jobs = value; + } + // Temporarily expose input value. Use with caution. + public get jobsInput() { + return this._jobs; + } +} +export interface DataartsFactoryJobNodesCronTrigger { + /** + * Number of concurrent executions allowed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#concurrent DataartsFactoryJob#concurrent} + */ + readonly concurrent?: number; + /** + * Indicates whether to depend on the execution result of the current + * job's dependent job in the previous scheduling period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_pre_period DataartsFactoryJob#depend_pre_period} + */ + readonly dependPrePeriod?: boolean | cdktf.IResolvable; + /** + * Scheduling end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#end_time DataartsFactoryJob#end_time} + */ + readonly endTime?: string; + /** + * Cron expression in the format of ****. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#expression DataartsFactoryJob#expression} + */ + readonly expression: string; + /** + * Time zone corresponding to the Cron expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#expression_time_zone DataartsFactoryJob#expression_time_zone} + */ + readonly expressionTimeZone?: string; + /** + * Job execution interval consisting of a time and time unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#period DataartsFactoryJob#period} + */ + readonly period?: string; + /** + * Scheduling start time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#start_time DataartsFactoryJob#start_time} + */ + readonly startTime: string; + /** + * depend_jobs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_jobs DataartsFactoryJob#depend_jobs} + */ + readonly dependJobs?: DataartsFactoryJobNodesCronTriggerDependJobs; +} + +export function dataartsFactoryJobNodesCronTriggerToTerraform(struct?: DataartsFactoryJobNodesCronTriggerOutputReference | DataartsFactoryJobNodesCronTrigger): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + concurrent: cdktf.numberToTerraform(struct!.concurrent), + depend_pre_period: cdktf.booleanToTerraform(struct!.dependPrePeriod), + end_time: cdktf.stringToTerraform(struct!.endTime), + expression: cdktf.stringToTerraform(struct!.expression), + expression_time_zone: cdktf.stringToTerraform(struct!.expressionTimeZone), + period: cdktf.stringToTerraform(struct!.period), + start_time: cdktf.stringToTerraform(struct!.startTime), + depend_jobs: dataartsFactoryJobNodesCronTriggerDependJobsToTerraform(struct!.dependJobs), + } +} + + +export function dataartsFactoryJobNodesCronTriggerToHclTerraform(struct?: DataartsFactoryJobNodesCronTriggerOutputReference | DataartsFactoryJobNodesCronTrigger): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + concurrent: { + value: cdktf.numberToHclTerraform(struct!.concurrent), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + depend_pre_period: { + value: cdktf.booleanToHclTerraform(struct!.dependPrePeriod), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(struct!.expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression_time_zone: { + value: cdktf.stringToHclTerraform(struct!.expressionTimeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.stringToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + depend_jobs: { + value: dataartsFactoryJobNodesCronTriggerDependJobsToHclTerraform(struct!.dependJobs), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesCronTriggerDependJobsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesCronTriggerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobNodesCronTrigger | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._concurrent !== undefined) { + hasAnyValues = true; + internalValueResult.concurrent = this._concurrent; + } + if (this._dependPrePeriod !== undefined) { + hasAnyValues = true; + internalValueResult.dependPrePeriod = this._dependPrePeriod; + } + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._expression !== undefined) { + hasAnyValues = true; + internalValueResult.expression = this._expression; + } + if (this._expressionTimeZone !== undefined) { + hasAnyValues = true; + internalValueResult.expressionTimeZone = this._expressionTimeZone; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + if (this._dependJobs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dependJobs = this._dependJobs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodesCronTrigger | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._concurrent = undefined; + this._dependPrePeriod = undefined; + this._endTime = undefined; + this._expression = undefined; + this._expressionTimeZone = undefined; + this._period = undefined; + this._startTime = undefined; + this._dependJobs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._concurrent = value.concurrent; + this._dependPrePeriod = value.dependPrePeriod; + this._endTime = value.endTime; + this._expression = value.expression; + this._expressionTimeZone = value.expressionTimeZone; + this._period = value.period; + this._startTime = value.startTime; + this._dependJobs.internalValue = value.dependJobs; + } + } + + // concurrent - computed: true, optional: true, required: false + private _concurrent?: number; + public get concurrent() { + return this.getNumberAttribute('concurrent'); + } + public set concurrent(value: number) { + this._concurrent = value; + } + public resetConcurrent() { + this._concurrent = undefined; + } + // Temporarily expose input value. Use with caution. + public get concurrentInput() { + return this._concurrent; + } + + // depend_pre_period - computed: true, optional: true, required: false + private _dependPrePeriod?: boolean | cdktf.IResolvable; + public get dependPrePeriod() { + return this.getBooleanAttribute('depend_pre_period'); + } + public set dependPrePeriod(value: boolean | cdktf.IResolvable) { + this._dependPrePeriod = value; + } + public resetDependPrePeriod() { + this._dependPrePeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependPrePeriodInput() { + return this._dependPrePeriod; + } + + // end_time - computed: true, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // expression_time_zone - computed: true, optional: true, required: false + private _expressionTimeZone?: string; + public get expressionTimeZone() { + return this.getStringAttribute('expression_time_zone'); + } + public set expressionTimeZone(value: string) { + this._expressionTimeZone = value; + } + public resetExpressionTimeZone() { + this._expressionTimeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get expressionTimeZoneInput() { + return this._expressionTimeZone; + } + + // period - computed: true, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // depend_jobs - computed: false, optional: true, required: false + private _dependJobs = new DataartsFactoryJobNodesCronTriggerDependJobsOutputReference(this, "depend_jobs"); + public get dependJobs() { + return this._dependJobs; + } + public putDependJobs(value: DataartsFactoryJobNodesCronTriggerDependJobs) { + this._dependJobs.internalValue = value; + } + public resetDependJobs() { + this._dependJobs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependJobsInput() { + return this._dependJobs.internalValue; + } +} +export interface DataartsFactoryJobNodesEventTrigger { + /** + * DIS stream name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#channel DataartsFactoryJob#channel} + */ + readonly channel: string; + /** + * Number of the concurrently scheduled jobs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#concurrent DataartsFactoryJob#concurrent} + */ + readonly concurrent?: number; + /** + * Event type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#event_type DataartsFactoryJob#event_type} + */ + readonly eventType: string; + /** + * Job failure policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#fail_policy DataartsFactoryJob#fail_policy} + */ + readonly failPolicy?: string; + /** + * Access policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#read_policy DataartsFactoryJob#read_policy} + */ + readonly readPolicy?: string; +} + +export function dataartsFactoryJobNodesEventTriggerToTerraform(struct?: DataartsFactoryJobNodesEventTriggerOutputReference | DataartsFactoryJobNodesEventTrigger): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + channel: cdktf.stringToTerraform(struct!.channel), + concurrent: cdktf.numberToTerraform(struct!.concurrent), + event_type: cdktf.stringToTerraform(struct!.eventType), + fail_policy: cdktf.stringToTerraform(struct!.failPolicy), + read_policy: cdktf.stringToTerraform(struct!.readPolicy), + } +} + + +export function dataartsFactoryJobNodesEventTriggerToHclTerraform(struct?: DataartsFactoryJobNodesEventTriggerOutputReference | DataartsFactoryJobNodesEventTrigger): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + channel: { + value: cdktf.stringToHclTerraform(struct!.channel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + concurrent: { + value: cdktf.numberToHclTerraform(struct!.concurrent), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + event_type: { + value: cdktf.stringToHclTerraform(struct!.eventType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fail_policy: { + value: cdktf.stringToHclTerraform(struct!.failPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_policy: { + value: cdktf.stringToHclTerraform(struct!.readPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesEventTriggerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobNodesEventTrigger | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._channel !== undefined) { + hasAnyValues = true; + internalValueResult.channel = this._channel; + } + if (this._concurrent !== undefined) { + hasAnyValues = true; + internalValueResult.concurrent = this._concurrent; + } + if (this._eventType !== undefined) { + hasAnyValues = true; + internalValueResult.eventType = this._eventType; + } + if (this._failPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.failPolicy = this._failPolicy; + } + if (this._readPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.readPolicy = this._readPolicy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodesEventTrigger | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._channel = undefined; + this._concurrent = undefined; + this._eventType = undefined; + this._failPolicy = undefined; + this._readPolicy = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._channel = value.channel; + this._concurrent = value.concurrent; + this._eventType = value.eventType; + this._failPolicy = value.failPolicy; + this._readPolicy = value.readPolicy; + } + } + + // channel - computed: false, optional: false, required: true + private _channel?: string; + public get channel() { + return this.getStringAttribute('channel'); + } + public set channel(value: string) { + this._channel = value; + } + // Temporarily expose input value. Use with caution. + public get channelInput() { + return this._channel; + } + + // concurrent - computed: true, optional: true, required: false + private _concurrent?: number; + public get concurrent() { + return this.getNumberAttribute('concurrent'); + } + public set concurrent(value: number) { + this._concurrent = value; + } + public resetConcurrent() { + this._concurrent = undefined; + } + // Temporarily expose input value. Use with caution. + public get concurrentInput() { + return this._concurrent; + } + + // event_type - computed: false, optional: false, required: true + private _eventType?: string; + public get eventType() { + return this.getStringAttribute('event_type'); + } + public set eventType(value: string) { + this._eventType = value; + } + // Temporarily expose input value. Use with caution. + public get eventTypeInput() { + return this._eventType; + } + + // fail_policy - computed: true, optional: true, required: false + private _failPolicy?: string; + public get failPolicy() { + return this.getStringAttribute('fail_policy'); + } + public set failPolicy(value: string) { + this._failPolicy = value; + } + public resetFailPolicy() { + this._failPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get failPolicyInput() { + return this._failPolicy; + } + + // read_policy - computed: true, optional: true, required: false + private _readPolicy?: string; + public get readPolicy() { + return this.getStringAttribute('read_policy'); + } + public set readPolicy(value: string) { + this._readPolicy = value; + } + public resetReadPolicy() { + this._readPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get readPolicyInput() { + return this._readPolicy; + } +} +export interface DataartsFactoryJobNodesLocation { + /** + * Position of the node on the horizontal axis of the job canvas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#x DataartsFactoryJob#x} + */ + readonly x: number; + /** + * Position of the node on the vertical axis of the job canvas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#y DataartsFactoryJob#y} + */ + readonly y: number; +} + +export function dataartsFactoryJobNodesLocationToTerraform(struct?: DataartsFactoryJobNodesLocationOutputReference | DataartsFactoryJobNodesLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + x: cdktf.numberToTerraform(struct!.x), + y: cdktf.numberToTerraform(struct!.y), + } +} + + +export function dataartsFactoryJobNodesLocationToHclTerraform(struct?: DataartsFactoryJobNodesLocationOutputReference | DataartsFactoryJobNodesLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + x: { + value: cdktf.numberToHclTerraform(struct!.x), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + y: { + value: cdktf.numberToHclTerraform(struct!.y), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesLocationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobNodesLocation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._x !== undefined) { + hasAnyValues = true; + internalValueResult.x = this._x; + } + if (this._y !== undefined) { + hasAnyValues = true; + internalValueResult.y = this._y; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodesLocation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._x = undefined; + this._y = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._x = value.x; + this._y = value.y; + } + } + + // x - computed: false, optional: false, required: true + private _x?: number; + public get x() { + return this.getNumberAttribute('x'); + } + public set x(value: number) { + this._x = value; + } + // Temporarily expose input value. Use with caution. + public get xInput() { + return this._x; + } + + // y - computed: false, optional: false, required: true + private _y?: number; + public get y() { + return this.getNumberAttribute('y'); + } + public set y(value: number) { + this._y = value; + } + // Temporarily expose input value. Use with caution. + public get yInput() { + return this._y; + } +} +export interface DataartsFactoryJobNodesProperties { + /** + * Property name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#name DataartsFactoryJob#name} + */ + readonly name?: string; + /** + * Property value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#value DataartsFactoryJob#value} + */ + readonly value?: string; +} + +export function dataartsFactoryJobNodesPropertiesToTerraform(struct?: DataartsFactoryJobNodesProperties | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dataartsFactoryJobNodesPropertiesToHclTerraform(struct?: DataartsFactoryJobNodesProperties | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsFactoryJobNodesProperties | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodesProperties | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DataartsFactoryJobNodesPropertiesList extends cdktf.ComplexList { + public internalValue? : DataartsFactoryJobNodesProperties[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsFactoryJobNodesPropertiesOutputReference { + return new DataartsFactoryJobNodesPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsFactoryJobNodes { + /** + * Node failure policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#fail_policy DataartsFactoryJob#fail_policy} + */ + readonly failPolicy?: string; + /** + * Maximum execution time of a node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#max_execution_time DataartsFactoryJob#max_execution_time} + */ + readonly maxExecutionTime?: number; + /** + * Node name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#name DataartsFactoryJob#name} + */ + readonly name: string; + /** + * Interval at which node running results are checked. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#polling_interval DataartsFactoryJob#polling_interval} + */ + readonly pollingInterval?: number; + /** + * Name of the previous node on which the current node depends. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#pre_node_name DataartsFactoryJob#pre_node_name} + */ + readonly preNodeName?: string[]; + /** + * Interval at which a retry is performed upon a failure. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#retry_interval DataartsFactoryJob#retry_interval} + */ + readonly retryInterval?: number; + /** + * Number of the node retries. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#retry_times DataartsFactoryJob#retry_times} + */ + readonly retryTimes?: number; + /** + * Node type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#type DataartsFactoryJob#type} + */ + readonly type: string; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#conditions DataartsFactoryJob#conditions} + */ + readonly conditions?: DataartsFactoryJobNodesConditions[] | cdktf.IResolvable; + /** + * cron_trigger block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#cron_trigger DataartsFactoryJob#cron_trigger} + */ + readonly cronTrigger?: DataartsFactoryJobNodesCronTrigger; + /** + * event_trigger block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#event_trigger DataartsFactoryJob#event_trigger} + */ + readonly eventTrigger?: DataartsFactoryJobNodesEventTrigger; + /** + * location block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#location DataartsFactoryJob#location} + */ + readonly location: DataartsFactoryJobNodesLocation; + /** + * properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#properties DataartsFactoryJob#properties} + */ + readonly properties: DataartsFactoryJobNodesProperties[] | cdktf.IResolvable; +} + +export function dataartsFactoryJobNodesToTerraform(struct?: DataartsFactoryJobNodes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + fail_policy: cdktf.stringToTerraform(struct!.failPolicy), + max_execution_time: cdktf.numberToTerraform(struct!.maxExecutionTime), + name: cdktf.stringToTerraform(struct!.name), + polling_interval: cdktf.numberToTerraform(struct!.pollingInterval), + pre_node_name: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.preNodeName), + retry_interval: cdktf.numberToTerraform(struct!.retryInterval), + retry_times: cdktf.numberToTerraform(struct!.retryTimes), + type: cdktf.stringToTerraform(struct!.type), + conditions: cdktf.listMapper(dataartsFactoryJobNodesConditionsToTerraform, true)(struct!.conditions), + cron_trigger: dataartsFactoryJobNodesCronTriggerToTerraform(struct!.cronTrigger), + event_trigger: dataartsFactoryJobNodesEventTriggerToTerraform(struct!.eventTrigger), + location: dataartsFactoryJobNodesLocationToTerraform(struct!.location), + properties: cdktf.listMapper(dataartsFactoryJobNodesPropertiesToTerraform, true)(struct!.properties), + } +} + + +export function dataartsFactoryJobNodesToHclTerraform(struct?: DataartsFactoryJobNodes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + fail_policy: { + value: cdktf.stringToHclTerraform(struct!.failPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_execution_time: { + value: cdktf.numberToHclTerraform(struct!.maxExecutionTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + polling_interval: { + value: cdktf.numberToHclTerraform(struct!.pollingInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + pre_node_name: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.preNodeName), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + retry_interval: { + value: cdktf.numberToHclTerraform(struct!.retryInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + retry_times: { + value: cdktf.numberToHclTerraform(struct!.retryTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conditions: { + value: cdktf.listMapperHcl(dataartsFactoryJobNodesConditionsToHclTerraform, true)(struct!.conditions), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesConditionsList", + }, + cron_trigger: { + value: dataartsFactoryJobNodesCronTriggerToHclTerraform(struct!.cronTrigger), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesCronTriggerList", + }, + event_trigger: { + value: dataartsFactoryJobNodesEventTriggerToHclTerraform(struct!.eventTrigger), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesEventTriggerList", + }, + location: { + value: dataartsFactoryJobNodesLocationToHclTerraform(struct!.location), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesLocationList", + }, + properties: { + value: cdktf.listMapperHcl(dataartsFactoryJobNodesPropertiesToHclTerraform, true)(struct!.properties), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesPropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsFactoryJobNodes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._failPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.failPolicy = this._failPolicy; + } + if (this._maxExecutionTime !== undefined) { + hasAnyValues = true; + internalValueResult.maxExecutionTime = this._maxExecutionTime; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._pollingInterval !== undefined) { + hasAnyValues = true; + internalValueResult.pollingInterval = this._pollingInterval; + } + if (this._preNodeName !== undefined) { + hasAnyValues = true; + internalValueResult.preNodeName = this._preNodeName; + } + if (this._retryInterval !== undefined) { + hasAnyValues = true; + internalValueResult.retryInterval = this._retryInterval; + } + if (this._retryTimes !== undefined) { + hasAnyValues = true; + internalValueResult.retryTimes = this._retryTimes; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._conditions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.conditions = this._conditions?.internalValue; + } + if (this._cronTrigger?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cronTrigger = this._cronTrigger?.internalValue; + } + if (this._eventTrigger?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.eventTrigger = this._eventTrigger?.internalValue; + } + if (this._location?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location?.internalValue; + } + if (this._properties?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.properties = this._properties?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobNodes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._failPolicy = undefined; + this._maxExecutionTime = undefined; + this._name = undefined; + this._pollingInterval = undefined; + this._preNodeName = undefined; + this._retryInterval = undefined; + this._retryTimes = undefined; + this._type = undefined; + this._conditions.internalValue = undefined; + this._cronTrigger.internalValue = undefined; + this._eventTrigger.internalValue = undefined; + this._location.internalValue = undefined; + this._properties.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._failPolicy = value.failPolicy; + this._maxExecutionTime = value.maxExecutionTime; + this._name = value.name; + this._pollingInterval = value.pollingInterval; + this._preNodeName = value.preNodeName; + this._retryInterval = value.retryInterval; + this._retryTimes = value.retryTimes; + this._type = value.type; + this._conditions.internalValue = value.conditions; + this._cronTrigger.internalValue = value.cronTrigger; + this._eventTrigger.internalValue = value.eventTrigger; + this._location.internalValue = value.location; + this._properties.internalValue = value.properties; + } + } + + // fail_policy - computed: true, optional: true, required: false + private _failPolicy?: string; + public get failPolicy() { + return this.getStringAttribute('fail_policy'); + } + public set failPolicy(value: string) { + this._failPolicy = value; + } + public resetFailPolicy() { + this._failPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get failPolicyInput() { + return this._failPolicy; + } + + // max_execution_time - computed: true, optional: true, required: false + private _maxExecutionTime?: number; + public get maxExecutionTime() { + return this.getNumberAttribute('max_execution_time'); + } + public set maxExecutionTime(value: number) { + this._maxExecutionTime = value; + } + public resetMaxExecutionTime() { + this._maxExecutionTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxExecutionTimeInput() { + return this._maxExecutionTime; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // polling_interval - computed: true, optional: true, required: false + private _pollingInterval?: number; + public get pollingInterval() { + return this.getNumberAttribute('polling_interval'); + } + public set pollingInterval(value: number) { + this._pollingInterval = value; + } + public resetPollingInterval() { + this._pollingInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get pollingIntervalInput() { + return this._pollingInterval; + } + + // pre_node_name - computed: true, optional: true, required: false + private _preNodeName?: string[]; + public get preNodeName() { + return this.getListAttribute('pre_node_name'); + } + public set preNodeName(value: string[]) { + this._preNodeName = value; + } + public resetPreNodeName() { + this._preNodeName = undefined; + } + // Temporarily expose input value. Use with caution. + public get preNodeNameInput() { + return this._preNodeName; + } + + // retry_interval - computed: true, optional: true, required: false + private _retryInterval?: number; + public get retryInterval() { + return this.getNumberAttribute('retry_interval'); + } + public set retryInterval(value: number) { + this._retryInterval = value; + } + public resetRetryInterval() { + this._retryInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryIntervalInput() { + return this._retryInterval; + } + + // retry_times - computed: true, optional: true, required: false + private _retryTimes?: number; + public get retryTimes() { + return this.getNumberAttribute('retry_times'); + } + public set retryTimes(value: number) { + this._retryTimes = value; + } + public resetRetryTimes() { + this._retryTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryTimesInput() { + return this._retryTimes; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // conditions - computed: false, optional: true, required: false + private _conditions = new DataartsFactoryJobNodesConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: DataartsFactoryJobNodesConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + public resetConditions() { + this._conditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // cron_trigger - computed: false, optional: true, required: false + private _cronTrigger = new DataartsFactoryJobNodesCronTriggerOutputReference(this, "cron_trigger"); + public get cronTrigger() { + return this._cronTrigger; + } + public putCronTrigger(value: DataartsFactoryJobNodesCronTrigger) { + this._cronTrigger.internalValue = value; + } + public resetCronTrigger() { + this._cronTrigger.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronTriggerInput() { + return this._cronTrigger.internalValue; + } + + // event_trigger - computed: false, optional: true, required: false + private _eventTrigger = new DataartsFactoryJobNodesEventTriggerOutputReference(this, "event_trigger"); + public get eventTrigger() { + return this._eventTrigger; + } + public putEventTrigger(value: DataartsFactoryJobNodesEventTrigger) { + this._eventTrigger.internalValue = value; + } + public resetEventTrigger() { + this._eventTrigger.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventTriggerInput() { + return this._eventTrigger.internalValue; + } + + // location - computed: false, optional: false, required: true + private _location = new DataartsFactoryJobNodesLocationOutputReference(this, "location"); + public get location() { + return this._location; + } + public putLocation(value: DataartsFactoryJobNodesLocation) { + this._location.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location.internalValue; + } + + // properties - computed: false, optional: false, required: true + private _properties = new DataartsFactoryJobNodesPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + public putProperties(value: DataartsFactoryJobNodesProperties[] | cdktf.IResolvable) { + this._properties.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties.internalValue; + } +} + +export class DataartsFactoryJobNodesList extends cdktf.ComplexList { + public internalValue? : DataartsFactoryJobNodes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsFactoryJobNodesOutputReference { + return new DataartsFactoryJobNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsFactoryJobParams { + /** + * Name of a parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#name DataartsFactoryJob#name} + */ + readonly name: string; + /** + * Parameter type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#type DataartsFactoryJob#type} + */ + readonly type?: string; + /** + * Value of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#value DataartsFactoryJob#value} + */ + readonly value: string; +} + +export function dataartsFactoryJobParamsToTerraform(struct?: DataartsFactoryJobParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dataartsFactoryJobParamsToHclTerraform(struct?: DataartsFactoryJobParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsFactoryJobParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DataartsFactoryJobParamsList extends cdktf.ComplexList { + public internalValue? : DataartsFactoryJobParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsFactoryJobParamsOutputReference { + return new DataartsFactoryJobParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DataartsFactoryJobScheduleCronDependJobs { + /** + * Dependency job failure policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_fail_policy DataartsFactoryJob#depend_fail_policy} + */ + readonly dependFailPolicy?: string; + /** + * Dependency period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_period DataartsFactoryJob#depend_period} + */ + readonly dependPeriod?: string; + /** + * A list of dependent jobs. Only the existing jobs can be depended on. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#jobs DataartsFactoryJob#jobs} + */ + readonly jobs: string[]; +} + +export function dataartsFactoryJobScheduleCronDependJobsToTerraform(struct?: DataartsFactoryJobScheduleCronDependJobsOutputReference | DataartsFactoryJobScheduleCronDependJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + depend_fail_policy: cdktf.stringToTerraform(struct!.dependFailPolicy), + depend_period: cdktf.stringToTerraform(struct!.dependPeriod), + jobs: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.jobs), + } +} + + +export function dataartsFactoryJobScheduleCronDependJobsToHclTerraform(struct?: DataartsFactoryJobScheduleCronDependJobsOutputReference | DataartsFactoryJobScheduleCronDependJobs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + depend_fail_policy: { + value: cdktf.stringToHclTerraform(struct!.dependFailPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + depend_period: { + value: cdktf.stringToHclTerraform(struct!.dependPeriod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + jobs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.jobs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobScheduleCronDependJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobScheduleCronDependJobs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dependFailPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.dependFailPolicy = this._dependFailPolicy; + } + if (this._dependPeriod !== undefined) { + hasAnyValues = true; + internalValueResult.dependPeriod = this._dependPeriod; + } + if (this._jobs !== undefined) { + hasAnyValues = true; + internalValueResult.jobs = this._jobs; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobScheduleCronDependJobs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dependFailPolicy = undefined; + this._dependPeriod = undefined; + this._jobs = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dependFailPolicy = value.dependFailPolicy; + this._dependPeriod = value.dependPeriod; + this._jobs = value.jobs; + } + } + + // depend_fail_policy - computed: true, optional: true, required: false + private _dependFailPolicy?: string; + public get dependFailPolicy() { + return this.getStringAttribute('depend_fail_policy'); + } + public set dependFailPolicy(value: string) { + this._dependFailPolicy = value; + } + public resetDependFailPolicy() { + this._dependFailPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependFailPolicyInput() { + return this._dependFailPolicy; + } + + // depend_period - computed: true, optional: true, required: false + private _dependPeriod?: string; + public get dependPeriod() { + return this.getStringAttribute('depend_period'); + } + public set dependPeriod(value: string) { + this._dependPeriod = value; + } + public resetDependPeriod() { + this._dependPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependPeriodInput() { + return this._dependPeriod; + } + + // jobs - computed: false, optional: false, required: true + private _jobs?: string[]; + public get jobs() { + return this.getListAttribute('jobs'); + } + public set jobs(value: string[]) { + this._jobs = value; + } + // Temporarily expose input value. Use with caution. + public get jobsInput() { + return this._jobs; + } +} +export interface DataartsFactoryJobScheduleCron { + /** + * Indicates whether to depend on the execution result of + * the current job's dependent job in the previous scheduling period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_pre_period DataartsFactoryJob#depend_pre_period} + */ + readonly dependPrePeriod?: boolean | cdktf.IResolvable; + /** + * Scheduling end time in the format of **yyyy-MM-dd'T'HH:mm:ssZ**, + * which is an ISO 8601 time format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#end_time DataartsFactoryJob#end_time} + */ + readonly endTime?: string; + /** + * Cron expression in the format of ****. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#expression DataartsFactoryJob#expression} + */ + readonly expression: string; + /** + * Time zone corresponding to the Cron expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#expression_time_zone DataartsFactoryJob#expression_time_zone} + */ + readonly expressionTimeZone?: string; + /** + * Scheduling start time in the format of **yyyy-MM-dd'T'HH:mm:ssZ**, + * which is an ISO 8601 time format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#start_time DataartsFactoryJob#start_time} + */ + readonly startTime: string; + /** + * depend_jobs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#depend_jobs DataartsFactoryJob#depend_jobs} + */ + readonly dependJobs?: DataartsFactoryJobScheduleCronDependJobs; +} + +export function dataartsFactoryJobScheduleCronToTerraform(struct?: DataartsFactoryJobScheduleCronOutputReference | DataartsFactoryJobScheduleCron): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + depend_pre_period: cdktf.booleanToTerraform(struct!.dependPrePeriod), + end_time: cdktf.stringToTerraform(struct!.endTime), + expression: cdktf.stringToTerraform(struct!.expression), + expression_time_zone: cdktf.stringToTerraform(struct!.expressionTimeZone), + start_time: cdktf.stringToTerraform(struct!.startTime), + depend_jobs: dataartsFactoryJobScheduleCronDependJobsToTerraform(struct!.dependJobs), + } +} + + +export function dataartsFactoryJobScheduleCronToHclTerraform(struct?: DataartsFactoryJobScheduleCronOutputReference | DataartsFactoryJobScheduleCron): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + depend_pre_period: { + value: cdktf.booleanToHclTerraform(struct!.dependPrePeriod), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(struct!.expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression_time_zone: { + value: cdktf.stringToHclTerraform(struct!.expressionTimeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + depend_jobs: { + value: dataartsFactoryJobScheduleCronDependJobsToHclTerraform(struct!.dependJobs), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobScheduleCronDependJobsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobScheduleCronOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobScheduleCron | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dependPrePeriod !== undefined) { + hasAnyValues = true; + internalValueResult.dependPrePeriod = this._dependPrePeriod; + } + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._expression !== undefined) { + hasAnyValues = true; + internalValueResult.expression = this._expression; + } + if (this._expressionTimeZone !== undefined) { + hasAnyValues = true; + internalValueResult.expressionTimeZone = this._expressionTimeZone; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + if (this._dependJobs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dependJobs = this._dependJobs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobScheduleCron | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dependPrePeriod = undefined; + this._endTime = undefined; + this._expression = undefined; + this._expressionTimeZone = undefined; + this._startTime = undefined; + this._dependJobs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dependPrePeriod = value.dependPrePeriod; + this._endTime = value.endTime; + this._expression = value.expression; + this._expressionTimeZone = value.expressionTimeZone; + this._startTime = value.startTime; + this._dependJobs.internalValue = value.dependJobs; + } + } + + // depend_pre_period - computed: true, optional: true, required: false + private _dependPrePeriod?: boolean | cdktf.IResolvable; + public get dependPrePeriod() { + return this.getBooleanAttribute('depend_pre_period'); + } + public set dependPrePeriod(value: boolean | cdktf.IResolvable) { + this._dependPrePeriod = value; + } + public resetDependPrePeriod() { + this._dependPrePeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependPrePeriodInput() { + return this._dependPrePeriod; + } + + // end_time - computed: true, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // expression_time_zone - computed: true, optional: true, required: false + private _expressionTimeZone?: string; + public get expressionTimeZone() { + return this.getStringAttribute('expression_time_zone'); + } + public set expressionTimeZone(value: string) { + this._expressionTimeZone = value; + } + public resetExpressionTimeZone() { + this._expressionTimeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get expressionTimeZoneInput() { + return this._expressionTimeZone; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // depend_jobs - computed: false, optional: true, required: false + private _dependJobs = new DataartsFactoryJobScheduleCronDependJobsOutputReference(this, "depend_jobs"); + public get dependJobs() { + return this._dependJobs; + } + public putDependJobs(value: DataartsFactoryJobScheduleCronDependJobs) { + this._dependJobs.internalValue = value; + } + public resetDependJobs() { + this._dependJobs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependJobsInput() { + return this._dependJobs.internalValue; + } +} +export interface DataartsFactoryJobScheduleEvent { + /** + * DIS stream name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#channel DataartsFactoryJob#channel} + */ + readonly channel: string; + /** + * Number of the concurrently scheduled jobs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#concurrent DataartsFactoryJob#concurrent} + */ + readonly concurrent?: number; + /** + * Event type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#event_type DataartsFactoryJob#event_type} + */ + readonly eventType: string; + /** + * Job failure policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#fail_policy DataartsFactoryJob#fail_policy} + */ + readonly failPolicy?: string; + /** + * Access policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#read_policy DataartsFactoryJob#read_policy} + */ + readonly readPolicy?: string; +} + +export function dataartsFactoryJobScheduleEventToTerraform(struct?: DataartsFactoryJobScheduleEventOutputReference | DataartsFactoryJobScheduleEvent): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + channel: cdktf.stringToTerraform(struct!.channel), + concurrent: cdktf.numberToTerraform(struct!.concurrent), + event_type: cdktf.stringToTerraform(struct!.eventType), + fail_policy: cdktf.stringToTerraform(struct!.failPolicy), + read_policy: cdktf.stringToTerraform(struct!.readPolicy), + } +} + + +export function dataartsFactoryJobScheduleEventToHclTerraform(struct?: DataartsFactoryJobScheduleEventOutputReference | DataartsFactoryJobScheduleEvent): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + channel: { + value: cdktf.stringToHclTerraform(struct!.channel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + concurrent: { + value: cdktf.numberToHclTerraform(struct!.concurrent), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + event_type: { + value: cdktf.stringToHclTerraform(struct!.eventType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fail_policy: { + value: cdktf.stringToHclTerraform(struct!.failPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_policy: { + value: cdktf.stringToHclTerraform(struct!.readPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobScheduleEventOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobScheduleEvent | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._channel !== undefined) { + hasAnyValues = true; + internalValueResult.channel = this._channel; + } + if (this._concurrent !== undefined) { + hasAnyValues = true; + internalValueResult.concurrent = this._concurrent; + } + if (this._eventType !== undefined) { + hasAnyValues = true; + internalValueResult.eventType = this._eventType; + } + if (this._failPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.failPolicy = this._failPolicy; + } + if (this._readPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.readPolicy = this._readPolicy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobScheduleEvent | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._channel = undefined; + this._concurrent = undefined; + this._eventType = undefined; + this._failPolicy = undefined; + this._readPolicy = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._channel = value.channel; + this._concurrent = value.concurrent; + this._eventType = value.eventType; + this._failPolicy = value.failPolicy; + this._readPolicy = value.readPolicy; + } + } + + // channel - computed: false, optional: false, required: true + private _channel?: string; + public get channel() { + return this.getStringAttribute('channel'); + } + public set channel(value: string) { + this._channel = value; + } + // Temporarily expose input value. Use with caution. + public get channelInput() { + return this._channel; + } + + // concurrent - computed: true, optional: true, required: false + private _concurrent?: number; + public get concurrent() { + return this.getNumberAttribute('concurrent'); + } + public set concurrent(value: number) { + this._concurrent = value; + } + public resetConcurrent() { + this._concurrent = undefined; + } + // Temporarily expose input value. Use with caution. + public get concurrentInput() { + return this._concurrent; + } + + // event_type - computed: false, optional: false, required: true + private _eventType?: string; + public get eventType() { + return this.getStringAttribute('event_type'); + } + public set eventType(value: string) { + this._eventType = value; + } + // Temporarily expose input value. Use with caution. + public get eventTypeInput() { + return this._eventType; + } + + // fail_policy - computed: true, optional: true, required: false + private _failPolicy?: string; + public get failPolicy() { + return this.getStringAttribute('fail_policy'); + } + public set failPolicy(value: string) { + this._failPolicy = value; + } + public resetFailPolicy() { + this._failPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get failPolicyInput() { + return this._failPolicy; + } + + // read_policy - computed: true, optional: true, required: false + private _readPolicy?: string; + public get readPolicy() { + return this.getStringAttribute('read_policy'); + } + public set readPolicy(value: string) { + this._readPolicy = value; + } + public resetReadPolicy() { + this._readPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get readPolicyInput() { + return this._readPolicy; + } +} +export interface DataartsFactoryJobSchedule { + /** + * Scheduling type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#type DataartsFactoryJob#type} + */ + readonly type: string; + /** + * cron block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#cron DataartsFactoryJob#cron} + */ + readonly cron?: DataartsFactoryJobScheduleCron; + /** + * event block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#event DataartsFactoryJob#event} + */ + readonly event?: DataartsFactoryJobScheduleEvent; +} + +export function dataartsFactoryJobScheduleToTerraform(struct?: DataartsFactoryJobScheduleOutputReference | DataartsFactoryJobSchedule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + cron: dataartsFactoryJobScheduleCronToTerraform(struct!.cron), + event: dataartsFactoryJobScheduleEventToTerraform(struct!.event), + } +} + + +export function dataartsFactoryJobScheduleToHclTerraform(struct?: DataartsFactoryJobScheduleOutputReference | DataartsFactoryJobSchedule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cron: { + value: dataartsFactoryJobScheduleCronToHclTerraform(struct!.cron), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobScheduleCronList", + }, + event: { + value: dataartsFactoryJobScheduleEventToHclTerraform(struct!.event), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobScheduleEventList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryJobScheduleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DataartsFactoryJobSchedule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._cron?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cron = this._cron?.internalValue; + } + if (this._event?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.event = this._event?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryJobSchedule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._cron.internalValue = undefined; + this._event.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._cron.internalValue = value.cron; + this._event.internalValue = value.event; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // cron - computed: false, optional: true, required: false + private _cron = new DataartsFactoryJobScheduleCronOutputReference(this, "cron"); + public get cron() { + return this._cron; + } + public putCron(value: DataartsFactoryJobScheduleCron) { + this._cron.internalValue = value; + } + public resetCron() { + this._cron.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronInput() { + return this._cron.internalValue; + } + + // event - computed: false, optional: true, required: false + private _event = new DataartsFactoryJobScheduleEventOutputReference(this, "event"); + public get event() { + return this._event; + } + public putEvent(value: DataartsFactoryJobScheduleEvent) { + this._event.internalValue = value; + } + public resetEvent() { + this._event.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventInput() { + return this._event.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job huaweicloud_dataarts_factory_job} +*/ +export class DataartsFactoryJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_factory_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsFactoryJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsFactoryJob to import + * @param importFromId The id of the existing DataartsFactoryJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsFactoryJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_factory_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_job huaweicloud_dataarts_factory_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsFactoryJobConfig + */ + public constructor(scope: Construct, id: string, config: DataartsFactoryJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_factory_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._directory = config.directory; + this._id = config.id; + this._logPath = config.logPath; + this._name = config.name; + this._processType = config.processType; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._basicConfig.internalValue = config.basicConfig; + this._nodes.internalValue = config.nodes; + this._params.internalValue = config.params; + this._schedule.internalValue = config.schedule; + } + + // ========== + // ATTRIBUTES + // ========== + + // directory - computed: true, optional: true, required: false + private _directory?: string; + public get directory() { + return this.getStringAttribute('directory'); + } + public set directory(value: string) { + this._directory = value; + } + public resetDirectory() { + this._directory = undefined; + } + // Temporarily expose input value. Use with caution. + public get directoryInput() { + return this._directory; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_path - computed: true, optional: true, required: false + private _logPath?: string; + public get logPath() { + return this.getStringAttribute('log_path'); + } + public set logPath(value: string) { + this._logPath = value; + } + public resetLogPath() { + this._logPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get logPathInput() { + return this._logPath; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // process_type - computed: false, optional: false, required: true + private _processType?: string; + public get processType() { + return this.getStringAttribute('process_type'); + } + public set processType(value: string) { + this._processType = value; + } + // Temporarily expose input value. Use with caution. + public get processTypeInput() { + return this._processType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: true, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // basic_config - computed: false, optional: true, required: false + private _basicConfig = new DataartsFactoryJobBasicConfigOutputReference(this, "basic_config"); + public get basicConfig() { + return this._basicConfig; + } + public putBasicConfig(value: DataartsFactoryJobBasicConfig) { + this._basicConfig.internalValue = value; + } + public resetBasicConfig() { + this._basicConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get basicConfigInput() { + return this._basicConfig.internalValue; + } + + // nodes - computed: false, optional: false, required: true + private _nodes = new DataartsFactoryJobNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + public putNodes(value: DataartsFactoryJobNodes[] | cdktf.IResolvable) { + this._nodes.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nodesInput() { + return this._nodes.internalValue; + } + + // params - computed: false, optional: true, required: false + private _params = new DataartsFactoryJobParamsList(this, "params", false); + public get params() { + return this._params; + } + public putParams(value: DataartsFactoryJobParams[] | cdktf.IResolvable) { + this._params.internalValue = value; + } + public resetParams() { + this._params.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params.internalValue; + } + + // schedule - computed: false, optional: false, required: true + private _schedule = new DataartsFactoryJobScheduleOutputReference(this, "schedule"); + public get schedule() { + return this._schedule; + } + public putSchedule(value: DataartsFactoryJobSchedule) { + this._schedule.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get scheduleInput() { + return this._schedule.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + directory: cdktf.stringToTerraform(this._directory), + id: cdktf.stringToTerraform(this._id), + log_path: cdktf.stringToTerraform(this._logPath), + name: cdktf.stringToTerraform(this._name), + process_type: cdktf.stringToTerraform(this._processType), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + basic_config: dataartsFactoryJobBasicConfigToTerraform(this._basicConfig.internalValue), + nodes: cdktf.listMapper(dataartsFactoryJobNodesToTerraform, true)(this._nodes.internalValue), + params: cdktf.listMapper(dataartsFactoryJobParamsToTerraform, true)(this._params.internalValue), + schedule: dataartsFactoryJobScheduleToTerraform(this._schedule.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + directory: { + value: cdktf.stringToHclTerraform(this._directory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_path: { + value: cdktf.stringToHclTerraform(this._logPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + process_type: { + value: cdktf.stringToHclTerraform(this._processType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + basic_config: { + value: dataartsFactoryJobBasicConfigToHclTerraform(this._basicConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobBasicConfigList", + }, + nodes: { + value: cdktf.listMapperHcl(dataartsFactoryJobNodesToHclTerraform, true)(this._nodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobNodesList", + }, + params: { + value: cdktf.listMapperHcl(dataartsFactoryJobParamsToHclTerraform, true)(this._params.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobParamsList", + }, + schedule: { + value: dataartsFactoryJobScheduleToHclTerraform(this._schedule.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryJobScheduleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-resource/README.md b/src/constructs/providers/huaweicloud/dataarts-factory-resource/README.md new file mode 100644 index 00000000..abca3caf --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-resource/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_factory_resource` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_factory_resource`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource). diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-resource/index.ts b/src/constructs/providers/huaweicloud/dataarts-factory-resource/index.ts new file mode 100644 index 00000000..6ac6af7f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-resource/index.ts @@ -0,0 +1,470 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsFactoryResourceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#description DataartsFactoryResource#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#directory DataartsFactoryResource#directory} + */ + readonly directory: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#id DataartsFactoryResource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#location DataartsFactoryResource#location} + */ + readonly location: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#name DataartsFactoryResource#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#region DataartsFactoryResource#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#type DataartsFactoryResource#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#workspace_id DataartsFactoryResource#workspace_id} + */ + readonly workspaceId: string; + /** + * depend_packages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#depend_packages DataartsFactoryResource#depend_packages} + */ + readonly dependPackages?: DataartsFactoryResourceDependPackages[] | cdktf.IResolvable; +} +export interface DataartsFactoryResourceDependPackages { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#location DataartsFactoryResource#location} + */ + readonly location: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#type DataartsFactoryResource#type} + */ + readonly type: string; +} + +export function dataartsFactoryResourceDependPackagesToTerraform(struct?: DataartsFactoryResourceDependPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + location: cdktf.stringToTerraform(struct!.location), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dataartsFactoryResourceDependPackagesToHclTerraform(struct?: DataartsFactoryResourceDependPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + location: { + value: cdktf.stringToHclTerraform(struct!.location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryResourceDependPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsFactoryResourceDependPackages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._location !== undefined) { + hasAnyValues = true; + internalValueResult.location = this._location; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryResourceDependPackages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._location = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._location = value.location; + this._type = value.type; + } + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DataartsFactoryResourceDependPackagesList extends cdktf.ComplexList { + public internalValue? : DataartsFactoryResourceDependPackages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsFactoryResourceDependPackagesOutputReference { + return new DataartsFactoryResourceDependPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource huaweicloud_dataarts_factory_resource} +*/ +export class DataartsFactoryResource extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_factory_resource"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsFactoryResource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsFactoryResource to import + * @param importFromId The id of the existing DataartsFactoryResource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsFactoryResource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_factory_resource", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_resource huaweicloud_dataarts_factory_resource} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsFactoryResourceConfig + */ + public constructor(scope: Construct, id: string, config: DataartsFactoryResourceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_factory_resource', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._directory = config.directory; + this._id = config.id; + this._location = config.location; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + this._dependPackages.internalValue = config.dependPackages; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // directory - computed: false, optional: false, required: true + private _directory?: string; + public get directory() { + return this.getStringAttribute('directory'); + } + public set directory(value: string) { + this._directory = value; + } + // Temporarily expose input value. Use with caution. + public get directoryInput() { + return this._directory; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // location - computed: false, optional: false, required: true + private _location?: string; + public get location() { + return this.getStringAttribute('location'); + } + public set location(value: string) { + this._location = value; + } + // Temporarily expose input value. Use with caution. + public get locationInput() { + return this._location; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // depend_packages - computed: false, optional: true, required: false + private _dependPackages = new DataartsFactoryResourceDependPackagesList(this, "depend_packages", false); + public get dependPackages() { + return this._dependPackages; + } + public putDependPackages(value: DataartsFactoryResourceDependPackages[] | cdktf.IResolvable) { + this._dependPackages.internalValue = value; + } + public resetDependPackages() { + this._dependPackages.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependPackagesInput() { + return this._dependPackages.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + directory: cdktf.stringToTerraform(this._directory), + id: cdktf.stringToTerraform(this._id), + location: cdktf.stringToTerraform(this._location), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + depend_packages: cdktf.listMapper(dataartsFactoryResourceDependPackagesToTerraform, true)(this._dependPackages.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + directory: { + value: cdktf.stringToHclTerraform(this._directory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + location: { + value: cdktf.stringToHclTerraform(this._location), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + depend_packages: { + value: cdktf.listMapperHcl(dataartsFactoryResourceDependPackagesToHclTerraform, true)(this._dependPackages.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryResourceDependPackagesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-script/README.md b/src/constructs/providers/huaweicloud/dataarts-factory-script/README.md new file mode 100644 index 00000000..37fff33c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-script/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_factory_script` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_factory_script`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script). diff --git a/src/constructs/providers/huaweicloud/dataarts-factory-script/index.ts b/src/constructs/providers/huaweicloud/dataarts-factory-script/index.ts new file mode 100644 index 00000000..972d3e01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-factory-script/index.ts @@ -0,0 +1,590 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsFactoryScriptConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#configuration DataartsFactoryScript#configuration} + */ + readonly configuration?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#connection_name DataartsFactoryScript#connection_name} + */ + readonly connectionName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#content DataartsFactoryScript#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#database DataartsFactoryScript#database} + */ + readonly database?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#description DataartsFactoryScript#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#directory DataartsFactoryScript#directory} + */ + readonly directory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#id DataartsFactoryScript#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#name DataartsFactoryScript#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#queue_name DataartsFactoryScript#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#region DataartsFactoryScript#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#target_status DataartsFactoryScript#target_status} + */ + readonly targetStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#type DataartsFactoryScript#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#workspace_id DataartsFactoryScript#workspace_id} + */ + readonly workspaceId: string; + /** + * approvers block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#approvers DataartsFactoryScript#approvers} + */ + readonly approvers?: DataartsFactoryScriptApprovers[] | cdktf.IResolvable; +} +export interface DataartsFactoryScriptApprovers { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#approver_name DataartsFactoryScript#approver_name} + */ + readonly approverName: string; +} + +export function dataartsFactoryScriptApproversToTerraform(struct?: DataartsFactoryScriptApprovers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + approver_name: cdktf.stringToTerraform(struct!.approverName), + } +} + + +export function dataartsFactoryScriptApproversToHclTerraform(struct?: DataartsFactoryScriptApprovers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + approver_name: { + value: cdktf.stringToHclTerraform(struct!.approverName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsFactoryScriptApproversOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DataartsFactoryScriptApprovers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._approverName !== undefined) { + hasAnyValues = true; + internalValueResult.approverName = this._approverName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsFactoryScriptApprovers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._approverName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._approverName = value.approverName; + } + } + + // approver_name - computed: false, optional: false, required: true + private _approverName?: string; + public get approverName() { + return this.getStringAttribute('approver_name'); + } + public set approverName(value: string) { + this._approverName = value; + } + // Temporarily expose input value. Use with caution. + public get approverNameInput() { + return this._approverName; + } +} + +export class DataartsFactoryScriptApproversList extends cdktf.ComplexList { + public internalValue? : DataartsFactoryScriptApprovers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DataartsFactoryScriptApproversOutputReference { + return new DataartsFactoryScriptApproversOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script huaweicloud_dataarts_factory_script} +*/ +export class DataartsFactoryScript extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_factory_script"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsFactoryScript resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsFactoryScript to import + * @param importFromId The id of the existing DataartsFactoryScript that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsFactoryScript to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_factory_script", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_factory_script huaweicloud_dataarts_factory_script} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsFactoryScriptConfig + */ + public constructor(scope: Construct, id: string, config: DataartsFactoryScriptConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_factory_script', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configuration = config.configuration; + this._connectionName = config.connectionName; + this._content = config.content; + this._database = config.database; + this._description = config.description; + this._directory = config.directory; + this._id = config.id; + this._name = config.name; + this._queueName = config.queueName; + this._region = config.region; + this._targetStatus = config.targetStatus; + this._type = config.type; + this._workspaceId = config.workspaceId; + this._approvers.internalValue = config.approvers; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_acquire_lock - computed: true, optional: false, required: false + public get autoAcquireLock() { + return this.getBooleanAttribute('auto_acquire_lock'); + } + + // configuration - computed: true, optional: true, required: false + private _configuration?: { [key: string]: string }; + public get configuration() { + return this.getStringMapAttribute('configuration'); + } + public set configuration(value: { [key: string]: string }) { + this._configuration = value; + } + public resetConfiguration() { + this._configuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration; + } + + // connection_name - computed: false, optional: false, required: true + private _connectionName?: string; + public get connectionName() { + return this.getStringAttribute('connection_name'); + } + public set connectionName(value: string) { + this._connectionName = value; + } + // Temporarily expose input value. Use with caution. + public get connectionNameInput() { + return this._connectionName; + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // database - computed: false, optional: true, required: false + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + public resetDatabase() { + this._database = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // directory - computed: false, optional: true, required: false + private _directory?: string; + public get directory() { + return this.getStringAttribute('directory'); + } + public set directory(value: string) { + this._directory = value; + } + public resetDirectory() { + this._directory = undefined; + } + // Temporarily expose input value. Use with caution. + public get directoryInput() { + return this._directory; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // queue_name - computed: false, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_status - computed: false, optional: true, required: false + private _targetStatus?: string; + public get targetStatus() { + return this.getStringAttribute('target_status'); + } + public set targetStatus(value: string) { + this._targetStatus = value; + } + public resetTargetStatus() { + this._targetStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetStatusInput() { + return this._targetStatus; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // approvers - computed: false, optional: true, required: false + private _approvers = new DataartsFactoryScriptApproversList(this, "approvers", false); + public get approvers() { + return this._approvers; + } + public putApprovers(value: DataartsFactoryScriptApprovers[] | cdktf.IResolvable) { + this._approvers.internalValue = value; + } + public resetApprovers() { + this._approvers.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get approversInput() { + return this._approvers.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration: cdktf.hashMapper(cdktf.stringToTerraform)(this._configuration), + connection_name: cdktf.stringToTerraform(this._connectionName), + content: cdktf.stringToTerraform(this._content), + database: cdktf.stringToTerraform(this._database), + description: cdktf.stringToTerraform(this._description), + directory: cdktf.stringToTerraform(this._directory), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + target_status: cdktf.stringToTerraform(this._targetStatus), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + approvers: cdktf.listMapper(dataartsFactoryScriptApproversToTerraform, true)(this._approvers.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._configuration), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + connection_name: { + value: cdktf.stringToHclTerraform(this._connectionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database: { + value: cdktf.stringToHclTerraform(this._database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + directory: { + value: cdktf.stringToHclTerraform(this._directory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_status: { + value: cdktf.stringToHclTerraform(this._targetStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + approvers: { + value: cdktf.listMapperHcl(dataartsFactoryScriptApproversToHclTerraform, true)(this._approvers.internalValue), + isBlock: true, + type: "list", + storageClassType: "DataartsFactoryScriptApproversList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/README.md b/src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/README.md new file mode 100644 index 00000000..694bec18 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_security_data_recognition_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_security_data_recognition_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule). diff --git a/src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/index.ts b/src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/index.ts new file mode 100644 index 00000000..73ed25be --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-data-recognition-rule/index.ts @@ -0,0 +1,475 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsSecurityDataRecognitionRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#builtin_rule_id DataartsSecurityDataRecognitionRule#builtin_rule_id} + */ + readonly builtinRuleId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#category_id DataartsSecurityDataRecognitionRule#category_id} + */ + readonly categoryId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#column_expression DataartsSecurityDataRecognitionRule#column_expression} + */ + readonly columnExpression?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#comment_expression DataartsSecurityDataRecognitionRule#comment_expression} + */ + readonly commentExpression?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#content_expression DataartsSecurityDataRecognitionRule#content_expression} + */ + readonly contentExpression?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#description DataartsSecurityDataRecognitionRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#id DataartsSecurityDataRecognitionRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#method DataartsSecurityDataRecognitionRule#method} + */ + readonly method?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#name DataartsSecurityDataRecognitionRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#region DataartsSecurityDataRecognitionRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#rule_type DataartsSecurityDataRecognitionRule#rule_type} + */ + readonly ruleType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#secrecy_level_id DataartsSecurityDataRecognitionRule#secrecy_level_id} + */ + readonly secrecyLevelId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#workspace_id DataartsSecurityDataRecognitionRule#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule huaweicloud_dataarts_security_data_recognition_rule} +*/ +export class DataartsSecurityDataRecognitionRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_security_data_recognition_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsSecurityDataRecognitionRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsSecurityDataRecognitionRule to import + * @param importFromId The id of the existing DataartsSecurityDataRecognitionRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsSecurityDataRecognitionRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_security_data_recognition_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_recognition_rule huaweicloud_dataarts_security_data_recognition_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsSecurityDataRecognitionRuleConfig + */ + public constructor(scope: Construct, id: string, config: DataartsSecurityDataRecognitionRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_security_data_recognition_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._builtinRuleId = config.builtinRuleId; + this._categoryId = config.categoryId; + this._columnExpression = config.columnExpression; + this._commentExpression = config.commentExpression; + this._contentExpression = config.contentExpression; + this._description = config.description; + this._id = config.id; + this._method = config.method; + this._name = config.name; + this._region = config.region; + this._ruleType = config.ruleType; + this._secrecyLevelId = config.secrecyLevelId; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // builtin_rule_id - computed: false, optional: true, required: false + private _builtinRuleId?: string; + public get builtinRuleId() { + return this.getStringAttribute('builtin_rule_id'); + } + public set builtinRuleId(value: string) { + this._builtinRuleId = value; + } + public resetBuiltinRuleId() { + this._builtinRuleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get builtinRuleIdInput() { + return this._builtinRuleId; + } + + // category_id - computed: false, optional: true, required: false + private _categoryId?: string; + public get categoryId() { + return this.getStringAttribute('category_id'); + } + public set categoryId(value: string) { + this._categoryId = value; + } + public resetCategoryId() { + this._categoryId = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryIdInput() { + return this._categoryId; + } + + // column_expression - computed: false, optional: true, required: false + private _columnExpression?: string; + public get columnExpression() { + return this.getStringAttribute('column_expression'); + } + public set columnExpression(value: string) { + this._columnExpression = value; + } + public resetColumnExpression() { + this._columnExpression = undefined; + } + // Temporarily expose input value. Use with caution. + public get columnExpressionInput() { + return this._columnExpression; + } + + // comment_expression - computed: false, optional: true, required: false + private _commentExpression?: string; + public get commentExpression() { + return this.getStringAttribute('comment_expression'); + } + public set commentExpression(value: string) { + this._commentExpression = value; + } + public resetCommentExpression() { + this._commentExpression = undefined; + } + // Temporarily expose input value. Use with caution. + public get commentExpressionInput() { + return this._commentExpression; + } + + // content_expression - computed: false, optional: true, required: false + private _contentExpression?: string; + public get contentExpression() { + return this.getStringAttribute('content_expression'); + } + public set contentExpression(value: string) { + this._contentExpression = value; + } + public resetContentExpression() { + this._contentExpression = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentExpressionInput() { + return this._contentExpression; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getBooleanAttribute('enable'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // method - computed: true, optional: true, required: false + private _method?: string; + public get method() { + return this.getStringAttribute('method'); + } + public set method(value: string) { + this._method = value; + } + public resetMethod() { + this._method = undefined; + } + // Temporarily expose input value. Use with caution. + public get methodInput() { + return this._method; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_type - computed: false, optional: false, required: true + private _ruleType?: string; + public get ruleType() { + return this.getStringAttribute('rule_type'); + } + public set ruleType(value: string) { + this._ruleType = value; + } + // Temporarily expose input value. Use with caution. + public get ruleTypeInput() { + return this._ruleType; + } + + // secrecy_level - computed: true, optional: false, required: false + public get secrecyLevel() { + return this.getStringAttribute('secrecy_level'); + } + + // secrecy_level_id - computed: false, optional: false, required: true + private _secrecyLevelId?: string; + public get secrecyLevelId() { + return this.getStringAttribute('secrecy_level_id'); + } + public set secrecyLevelId(value: string) { + this._secrecyLevelId = value; + } + // Temporarily expose input value. Use with caution. + public get secrecyLevelIdInput() { + return this._secrecyLevelId; + } + + // secrecy_level_num - computed: true, optional: false, required: false + public get secrecyLevelNum() { + return this.getNumberAttribute('secrecy_level_num'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + builtin_rule_id: cdktf.stringToTerraform(this._builtinRuleId), + category_id: cdktf.stringToTerraform(this._categoryId), + column_expression: cdktf.stringToTerraform(this._columnExpression), + comment_expression: cdktf.stringToTerraform(this._commentExpression), + content_expression: cdktf.stringToTerraform(this._contentExpression), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + method: cdktf.stringToTerraform(this._method), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rule_type: cdktf.stringToTerraform(this._ruleType), + secrecy_level_id: cdktf.stringToTerraform(this._secrecyLevelId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + builtin_rule_id: { + value: cdktf.stringToHclTerraform(this._builtinRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + category_id: { + value: cdktf.stringToHclTerraform(this._categoryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + column_expression: { + value: cdktf.stringToHclTerraform(this._columnExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + comment_expression: { + value: cdktf.stringToHclTerraform(this._commentExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content_expression: { + value: cdktf.stringToHclTerraform(this._contentExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + method: { + value: cdktf.stringToHclTerraform(this._method), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_type: { + value: cdktf.stringToHclTerraform(this._ruleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secrecy_level_id: { + value: cdktf.stringToHclTerraform(this._secrecyLevelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/README.md b/src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/README.md new file mode 100644 index 00000000..fa531ad4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_security_data_secrecy_level` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_security_data_secrecy_level`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level). diff --git a/src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/index.ts b/src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/index.ts new file mode 100644 index 00000000..b5428f01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-data-secrecy-level/index.ts @@ -0,0 +1,247 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsSecurityDataSecrecyLevelConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level#description DataartsSecurityDataSecrecyLevel#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level#id DataartsSecurityDataSecrecyLevel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level#name DataartsSecurityDataSecrecyLevel#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level#region DataartsSecurityDataSecrecyLevel#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level#workspace_id DataartsSecurityDataSecrecyLevel#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level huaweicloud_dataarts_security_data_secrecy_level} +*/ +export class DataartsSecurityDataSecrecyLevel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_security_data_secrecy_level"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsSecurityDataSecrecyLevel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsSecurityDataSecrecyLevel to import + * @param importFromId The id of the existing DataartsSecurityDataSecrecyLevel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsSecurityDataSecrecyLevel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_security_data_secrecy_level", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_data_secrecy_level huaweicloud_dataarts_security_data_secrecy_level} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsSecurityDataSecrecyLevelConfig + */ + public constructor(scope: Construct, id: string, config: DataartsSecurityDataSecrecyLevelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_security_data_secrecy_level', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level_number - computed: true, optional: false, required: false + public get levelNumber() { + return this.getNumberAttribute('level_number'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/README.md b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/README.md new file mode 100644 index 00000000..e935b163 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_security_permission_set_member` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_security_permission_set_member`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member). diff --git a/src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/index.ts b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/index.ts new file mode 100644 index 00000000..103453ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-member/index.ts @@ -0,0 +1,274 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsSecurityPermissionSetMemberConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#id DataartsSecurityPermissionSetMember#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#name DataartsSecurityPermissionSetMember#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#object_id DataartsSecurityPermissionSetMember#object_id} + */ + readonly objectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#permission_set_id DataartsSecurityPermissionSetMember#permission_set_id} + */ + readonly permissionSetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#region DataartsSecurityPermissionSetMember#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#type DataartsSecurityPermissionSetMember#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#workspace_id DataartsSecurityPermissionSetMember#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member huaweicloud_dataarts_security_permission_set_member} +*/ +export class DataartsSecurityPermissionSetMember extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_security_permission_set_member"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsSecurityPermissionSetMember resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsSecurityPermissionSetMember to import + * @param importFromId The id of the existing DataartsSecurityPermissionSetMember that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsSecurityPermissionSetMember to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_security_permission_set_member", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_member huaweicloud_dataarts_security_permission_set_member} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsSecurityPermissionSetMemberConfig + */ + public constructor(scope: Construct, id: string, config: DataartsSecurityPermissionSetMemberConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_security_permission_set_member', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._objectId = config.objectId; + this._permissionSetId = config.permissionSetId; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // member_id - computed: true, optional: false, required: false + public get memberId() { + return this.getStringAttribute('member_id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // permission_set_id - computed: false, optional: false, required: true + private _permissionSetId?: string; + public get permissionSetId() { + return this.getStringAttribute('permission_set_id'); + } + public set permissionSetId(value: string) { + this._permissionSetId = value; + } + // Temporarily expose input value. Use with caution. + public get permissionSetIdInput() { + return this._permissionSetId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + object_id: cdktf.stringToTerraform(this._objectId), + permission_set_id: cdktf.stringToTerraform(this._permissionSetId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_id: { + value: cdktf.stringToHclTerraform(this._objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_set_id: { + value: cdktf.stringToHclTerraform(this._permissionSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/README.md b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/README.md new file mode 100644 index 00000000..680d36d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_security_permission_set_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_security_permission_set_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege). diff --git a/src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/index.ts b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/index.ts new file mode 100644 index 00000000..3c864ca0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-permission-set-privilege/index.ts @@ -0,0 +1,500 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsSecurityPermissionSetPrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#actions DataartsSecurityPermissionSetPrivilege#actions} + */ + readonly actions: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#cluster_id DataartsSecurityPermissionSetPrivilege#cluster_id} + */ + readonly clusterId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#cluster_name DataartsSecurityPermissionSetPrivilege#cluster_name} + */ + readonly clusterName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#column_name DataartsSecurityPermissionSetPrivilege#column_name} + */ + readonly columnName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#connection_id DataartsSecurityPermissionSetPrivilege#connection_id} + */ + readonly connectionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#database_name DataartsSecurityPermissionSetPrivilege#database_name} + */ + readonly databaseName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#database_url DataartsSecurityPermissionSetPrivilege#database_url} + */ + readonly databaseUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#datasource_type DataartsSecurityPermissionSetPrivilege#datasource_type} + */ + readonly datasourceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#id DataartsSecurityPermissionSetPrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#permission_set_id DataartsSecurityPermissionSetPrivilege#permission_set_id} + */ + readonly permissionSetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#region DataartsSecurityPermissionSetPrivilege#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#schema_name DataartsSecurityPermissionSetPrivilege#schema_name} + */ + readonly schemaName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#table_name DataartsSecurityPermissionSetPrivilege#table_name} + */ + readonly tableName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#type DataartsSecurityPermissionSetPrivilege#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#workspace_id DataartsSecurityPermissionSetPrivilege#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege huaweicloud_dataarts_security_permission_set_privilege} +*/ +export class DataartsSecurityPermissionSetPrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_security_permission_set_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsSecurityPermissionSetPrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsSecurityPermissionSetPrivilege to import + * @param importFromId The id of the existing DataartsSecurityPermissionSetPrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsSecurityPermissionSetPrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_security_permission_set_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set_privilege huaweicloud_dataarts_security_permission_set_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsSecurityPermissionSetPrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: DataartsSecurityPermissionSetPrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_security_permission_set_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actions = config.actions; + this._clusterId = config.clusterId; + this._clusterName = config.clusterName; + this._columnName = config.columnName; + this._connectionId = config.connectionId; + this._databaseName = config.databaseName; + this._databaseUrl = config.databaseUrl; + this._datasourceType = config.datasourceType; + this._id = config.id; + this._permissionSetId = config.permissionSetId; + this._region = config.region; + this._schemaName = config.schemaName; + this._tableName = config.tableName; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // actions - computed: false, optional: false, required: true + private _actions?: string[]; + public get actions() { + return cdktf.Fn.tolist(this.getListAttribute('actions')); + } + public set actions(value: string[]) { + this._actions = value; + } + // Temporarily expose input value. Use with caution. + public get actionsInput() { + return this._actions; + } + + // cluster_id - computed: true, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: false, optional: false, required: true + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // column_name - computed: false, optional: true, required: false + private _columnName?: string; + public get columnName() { + return this.getStringAttribute('column_name'); + } + public set columnName(value: string) { + this._columnName = value; + } + public resetColumnName() { + this._columnName = undefined; + } + // Temporarily expose input value. Use with caution. + public get columnNameInput() { + return this._columnName; + } + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // database_name - computed: false, optional: true, required: false + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // database_url - computed: false, optional: true, required: false + private _databaseUrl?: string; + public get databaseUrl() { + return this.getStringAttribute('database_url'); + } + public set databaseUrl(value: string) { + this._databaseUrl = value; + } + public resetDatabaseUrl() { + this._databaseUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseUrlInput() { + return this._databaseUrl; + } + + // datasource_type - computed: false, optional: false, required: true + private _datasourceType?: string; + public get datasourceType() { + return this.getStringAttribute('datasource_type'); + } + public set datasourceType(value: string) { + this._datasourceType = value; + } + // Temporarily expose input value. Use with caution. + public get datasourceTypeInput() { + return this._datasourceType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // permission_set_id - computed: false, optional: false, required: true + private _permissionSetId?: string; + public get permissionSetId() { + return this.getStringAttribute('permission_set_id'); + } + public set permissionSetId(value: string) { + this._permissionSetId = value; + } + // Temporarily expose input value. Use with caution. + public get permissionSetIdInput() { + return this._permissionSetId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schema_name - computed: false, optional: true, required: false + private _schemaName?: string; + public get schemaName() { + return this.getStringAttribute('schema_name'); + } + public set schemaName(value: string) { + this._schemaName = value; + } + public resetSchemaName() { + this._schemaName = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemaNameInput() { + return this._schemaName; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // sync_msg - computed: true, optional: false, required: false + public get syncMsg() { + return this.getStringAttribute('sync_msg'); + } + + // table_name - computed: false, optional: true, required: false + private _tableName?: string; + public get tableName() { + return this.getStringAttribute('table_name'); + } + public set tableName(value: string) { + this._tableName = value; + } + public resetTableName() { + this._tableName = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableNameInput() { + return this._tableName; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + actions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._actions), + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_name: cdktf.stringToTerraform(this._clusterName), + column_name: cdktf.stringToTerraform(this._columnName), + connection_id: cdktf.stringToTerraform(this._connectionId), + database_name: cdktf.stringToTerraform(this._databaseName), + database_url: cdktf.stringToTerraform(this._databaseUrl), + datasource_type: cdktf.stringToTerraform(this._datasourceType), + id: cdktf.stringToTerraform(this._id), + permission_set_id: cdktf.stringToTerraform(this._permissionSetId), + region: cdktf.stringToTerraform(this._region), + schema_name: cdktf.stringToTerraform(this._schemaName), + table_name: cdktf.stringToTerraform(this._tableName), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + actions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._actions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + column_name: { + value: cdktf.stringToHclTerraform(this._columnName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_url: { + value: cdktf.stringToHclTerraform(this._databaseUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + datasource_type: { + value: cdktf.stringToHclTerraform(this._datasourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_set_id: { + value: cdktf.stringToHclTerraform(this._permissionSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schema_name: { + value: cdktf.stringToHclTerraform(this._schemaName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_name: { + value: cdktf.stringToHclTerraform(this._tableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-security-permission-set/README.md b/src/constructs/providers/huaweicloud/dataarts-security-permission-set/README.md new file mode 100644 index 00000000..7be5f79d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-permission-set/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_security_permission_set` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_security_permission_set`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set). diff --git a/src/constructs/providers/huaweicloud/dataarts-security-permission-set/index.ts b/src/constructs/providers/huaweicloud/dataarts-security-permission-set/index.ts new file mode 100644 index 00000000..fb129e74 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-security-permission-set/index.ts @@ -0,0 +1,363 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsSecurityPermissionSetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#description DataartsSecurityPermissionSet#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#id DataartsSecurityPermissionSet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#manager_id DataartsSecurityPermissionSet#manager_id} + */ + readonly managerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#manager_name DataartsSecurityPermissionSet#manager_name} + */ + readonly managerName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#manager_type DataartsSecurityPermissionSet#manager_type} + */ + readonly managerType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#name DataartsSecurityPermissionSet#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#parent_id DataartsSecurityPermissionSet#parent_id} + */ + readonly parentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#region DataartsSecurityPermissionSet#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#workspace_id DataartsSecurityPermissionSet#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set huaweicloud_dataarts_security_permission_set} +*/ +export class DataartsSecurityPermissionSet extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_security_permission_set"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsSecurityPermissionSet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsSecurityPermissionSet to import + * @param importFromId The id of the existing DataartsSecurityPermissionSet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsSecurityPermissionSet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_security_permission_set", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_security_permission_set huaweicloud_dataarts_security_permission_set} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsSecurityPermissionSetConfig + */ + public constructor(scope: Construct, id: string, config: DataartsSecurityPermissionSetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_security_permission_set', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._managerId = config.managerId; + this._managerName = config.managerName; + this._managerType = config.managerType; + this._name = config.name; + this._parentId = config.parentId; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // datasource_type - computed: true, optional: false, required: false + public get datasourceType() { + return this.getStringAttribute('datasource_type'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // manager_id - computed: false, optional: false, required: true + private _managerId?: string; + public get managerId() { + return this.getStringAttribute('manager_id'); + } + public set managerId(value: string) { + this._managerId = value; + } + // Temporarily expose input value. Use with caution. + public get managerIdInput() { + return this._managerId; + } + + // manager_name - computed: false, optional: true, required: false + private _managerName?: string; + public get managerName() { + return this.getStringAttribute('manager_name'); + } + public set managerName(value: string) { + this._managerName = value; + } + public resetManagerName() { + this._managerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerNameInput() { + return this._managerName; + } + + // manager_type - computed: false, optional: true, required: false + private _managerType?: string; + public get managerType() { + return this.getStringAttribute('manager_type'); + } + public set managerType(value: string) { + this._managerType = value; + } + public resetManagerType() { + this._managerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerTypeInput() { + return this._managerType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: false, optional: false, required: true + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // updated_by - computed: true, optional: false, required: false + public get updatedBy() { + return this.getStringAttribute('updated_by'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + manager_id: cdktf.stringToTerraform(this._managerId), + manager_name: cdktf.stringToTerraform(this._managerName), + manager_type: cdktf.stringToTerraform(this._managerType), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_id: { + value: cdktf.stringToHclTerraform(this._managerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_name: { + value: cdktf.stringToHclTerraform(this._managerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_type: { + value: cdktf.stringToHclTerraform(this._managerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-studio-data-connection/README.md b/src/constructs/providers/huaweicloud/dataarts-studio-data-connection/README.md new file mode 100644 index 00000000..e99c0a40 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-studio-data-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_studio_data_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_studio_data_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection). diff --git a/src/constructs/providers/huaweicloud/dataarts-studio-data-connection/index.ts b/src/constructs/providers/huaweicloud/dataarts-studio-data-connection/index.ts new file mode 100644 index 00000000..a029ac81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-studio-data-connection/index.ts @@ -0,0 +1,362 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsStudioDataConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * The agent ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#agent_id DataartsStudioDataConnection#agent_id} + */ + readonly agentId?: string; + /** + * The agent name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#agent_name DataartsStudioDataConnection#agent_name} + */ + readonly agentName?: string; + /** + * The dynamic configuration for the specified type of data connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#config DataartsStudioDataConnection#config} + */ + readonly config?: string; + /** + * The data connection mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#env_type DataartsStudioDataConnection#env_type} + */ + readonly envType?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#id DataartsStudioDataConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The data connection name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#name DataartsStudioDataConnection#name} + */ + readonly name: string; + /** + * The region where the data connection is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#region DataartsStudioDataConnection#region} + */ + readonly region?: string; + /** + * The data connection type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#type DataartsStudioDataConnection#type} + */ + readonly type: string; + /** + * The ID of the workspace to which the data connection belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#workspace_id DataartsStudioDataConnection#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection huaweicloud_dataarts_studio_data_connection} +*/ +export class DataartsStudioDataConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_studio_data_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsStudioDataConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsStudioDataConnection to import + * @param importFromId The id of the existing DataartsStudioDataConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsStudioDataConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_studio_data_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_data_connection huaweicloud_dataarts_studio_data_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsStudioDataConnectionConfig + */ + public constructor(scope: Construct, id: string, config: DataartsStudioDataConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_studio_data_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agentId = config.agentId; + this._agentName = config.agentName; + this._config = config.config; + this._envType = config.envType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_id - computed: true, optional: true, required: false + private _agentId?: string; + public get agentId() { + return this.getStringAttribute('agent_id'); + } + public set agentId(value: string) { + this._agentId = value; + } + public resetAgentId() { + this._agentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentIdInput() { + return this._agentId; + } + + // agent_name - computed: true, optional: true, required: false + private _agentName?: string; + public get agentName() { + return this.getStringAttribute('agent_name'); + } + public set agentName(value: string) { + this._agentName = value; + } + public resetAgentName() { + this._agentName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentNameInput() { + return this._agentName; + } + + // config - computed: false, optional: true, required: false + private _config?: string; + public get config() { + return this.getStringAttribute('config'); + } + public set config(value: string) { + this._config = value; + } + public resetConfig() { + this._config = undefined; + } + // Temporarily expose input value. Use with caution. + public get configInput() { + return this._config; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // env_type - computed: true, optional: true, required: false + private _envType?: number; + public get envType() { + return this.getNumberAttribute('env_type'); + } + public set envType(value: number) { + this._envType = value; + } + public resetEnvType() { + this._envType = undefined; + } + // Temporarily expose input value. Use with caution. + public get envTypeInput() { + return this._envType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // qualified_name - computed: true, optional: false, required: false + public get qualifiedName() { + return this.getStringAttribute('qualified_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agent_id: cdktf.stringToTerraform(this._agentId), + agent_name: cdktf.stringToTerraform(this._agentName), + config: cdktf.stringToTerraform(this._config), + env_type: cdktf.numberToTerraform(this._envType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agent_id: { + value: cdktf.stringToHclTerraform(this._agentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agent_name: { + value: cdktf.stringToHclTerraform(this._agentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + config: { + value: cdktf.stringToHclTerraform(this._config), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_type: { + value: cdktf.numberToHclTerraform(this._envType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dataarts-studio-instance/README.md b/src/constructs/providers/huaweicloud/dataarts-studio-instance/README.md new file mode 100644 index 00000000..59c0614d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-studio-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dataarts_studio_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dataarts_studio_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance). diff --git a/src/constructs/providers/huaweicloud/dataarts-studio-instance/index.ts b/src/constructs/providers/huaweicloud/dataarts-studio-instance/index.ts new file mode 100644 index 00000000..dab8863d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dataarts-studio-instance/index.ts @@ -0,0 +1,605 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DataartsStudioInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#auto_renew DataartsStudioInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#availability_zone DataartsStudioInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#enterprise_project_id DataartsStudioInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#id DataartsStudioInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#name DataartsStudioInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#period DataartsStudioInstance#period} + */ + readonly period: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#period_unit DataartsStudioInstance#period_unit} + */ + readonly periodUnit: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#region DataartsStudioInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#security_group_id DataartsStudioInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#subnet_id DataartsStudioInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#tags DataartsStudioInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#version DataartsStudioInstance#version} + */ + readonly version: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#vpc_id DataartsStudioInstance#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#timeouts DataartsStudioInstance#timeouts} + */ + readonly timeouts?: DataartsStudioInstanceTimeouts; +} +export interface DataartsStudioInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#create DataartsStudioInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#delete DataartsStudioInstance#delete} + */ + readonly delete?: string; +} + +export function dataartsStudioInstanceTimeoutsToTerraform(struct?: DataartsStudioInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dataartsStudioInstanceTimeoutsToHclTerraform(struct?: DataartsStudioInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DataartsStudioInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DataartsStudioInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DataartsStudioInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance huaweicloud_dataarts_studio_instance} +*/ +export class DataartsStudioInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dataarts_studio_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DataartsStudioInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DataartsStudioInstance to import + * @param importFromId The id of the existing DataartsStudioInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DataartsStudioInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dataarts_studio_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dataarts_studio_instance huaweicloud_dataarts_studio_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DataartsStudioInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DataartsStudioInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dataarts_studio_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._version = config.version; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expire_days - computed: true, optional: false, required: false + public get expireDays() { + return this.getStringAttribute('expire_days'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DataartsStudioInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DataartsStudioInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + version: cdktf.stringToTerraform(this._version), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: dataartsStudioInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dataartsStudioInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DataartsStudioInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/README.md b/src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/README.md new file mode 100644 index 00000000..fecbdfa1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dbss_audit_risk_rule_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_dbss_audit_risk_rule_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action). diff --git a/src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/index.ts b/src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/index.ts new file mode 100644 index 00000000..072cdbb4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-audit-risk-rule-action/index.ts @@ -0,0 +1,224 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DbssAuditRiskRuleActionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action#action DbssAuditRiskRuleAction#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action#id DbssAuditRiskRuleAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action#instance_id DbssAuditRiskRuleAction#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action#region DbssAuditRiskRuleAction#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action#risk_ids DbssAuditRiskRuleAction#risk_ids} + */ + readonly riskIds: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action huaweicloud_dbss_audit_risk_rule_action} +*/ +export class DbssAuditRiskRuleAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_audit_risk_rule_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DbssAuditRiskRuleAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DbssAuditRiskRuleAction to import + * @param importFromId The id of the existing DbssAuditRiskRuleAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DbssAuditRiskRuleAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_audit_risk_rule_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_audit_risk_rule_action huaweicloud_dbss_audit_risk_rule_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DbssAuditRiskRuleActionConfig + */ + public constructor(scope: Construct, id: string, config: DbssAuditRiskRuleActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_audit_risk_rule_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._riskIds = config.riskIds; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // risk_ids - computed: false, optional: false, required: true + private _riskIds?: string; + public get riskIds() { + return this.getStringAttribute('risk_ids'); + } + public set riskIds(value: string) { + this._riskIds = value; + } + // Temporarily expose input value. Use with caution. + public get riskIdsInput() { + return this._riskIds; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + risk_ids: cdktf.stringToTerraform(this._riskIds), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + risk_ids: { + value: cdktf.stringToHclTerraform(this._riskIds), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dbss-ecs-database/README.md b/src/constructs/providers/huaweicloud/dbss-ecs-database/README.md new file mode 100644 index 00000000..122128ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-ecs-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dbss_ecs_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_dbss_ecs_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database). diff --git a/src/constructs/providers/huaweicloud/dbss-ecs-database/index.ts b/src/constructs/providers/huaweicloud/dbss-ecs-database/index.ts new file mode 100644 index 00000000..29890f8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-ecs-database/index.ts @@ -0,0 +1,446 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DbssEcsDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#charset DbssEcsDatabase#charset} + */ + readonly charset?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#id DbssEcsDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#instance_id DbssEcsDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#instance_name DbssEcsDatabase#instance_name} + */ + readonly instanceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#ip DbssEcsDatabase#ip} + */ + readonly ip: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#lts_audit_switch DbssEcsDatabase#lts_audit_switch} + */ + readonly ltsAuditSwitch?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#name DbssEcsDatabase#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#os DbssEcsDatabase#os} + */ + readonly os: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#port DbssEcsDatabase#port} + */ + readonly port: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#region DbssEcsDatabase#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#status DbssEcsDatabase#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#type DbssEcsDatabase#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#version DbssEcsDatabase#version} + */ + readonly version: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database huaweicloud_dbss_ecs_database} +*/ +export class DbssEcsDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_ecs_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DbssEcsDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DbssEcsDatabase to import + * @param importFromId The id of the existing DbssEcsDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DbssEcsDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_ecs_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_ecs_database huaweicloud_dbss_ecs_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DbssEcsDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: DbssEcsDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_ecs_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._charset = config.charset; + this._id = config.id; + this._instanceId = config.instanceId; + this._instanceName = config.instanceName; + this._ip = config.ip; + this._ltsAuditSwitch = config.ltsAuditSwitch; + this._name = config.name; + this._os = config.os; + this._port = config.port; + this._region = config.region; + this._status = config.status; + this._type = config.type; + this._version = config.version; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_url - computed: true, optional: false, required: false + public get agentUrl() { + return this.getListAttribute('agent_url'); + } + + // audit_status - computed: true, optional: false, required: false + public get auditStatus() { + return this.getStringAttribute('audit_status'); + } + + // charset - computed: true, optional: true, required: false + private _charset?: string; + public get charset() { + return this.getStringAttribute('charset'); + } + public set charset(value: string) { + this._charset = value; + } + public resetCharset() { + this._charset = undefined; + } + // Temporarily expose input value. Use with caution. + public get charsetInput() { + return this._charset; + } + + // db_classification - computed: true, optional: false, required: false + public get dbClassification() { + return this.getStringAttribute('db_classification'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: true, optional: true, required: false + private _instanceName?: string; + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + public set instanceName(value: string) { + this._instanceName = value; + } + public resetInstanceName() { + this._instanceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNameInput() { + return this._instanceName; + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // lts_audit_switch - computed: false, optional: true, required: false + private _ltsAuditSwitch?: number; + public get ltsAuditSwitch() { + return this.getNumberAttribute('lts_audit_switch'); + } + public set ltsAuditSwitch(value: number) { + this._ltsAuditSwitch = value; + } + public resetLtsAuditSwitch() { + this._ltsAuditSwitch = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsAuditSwitchInput() { + return this._ltsAuditSwitch; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os - computed: false, optional: false, required: true + private _os?: string; + public get os() { + return this.getStringAttribute('os'); + } + public set os(value: string) { + this._os = value; + } + // Temporarily expose input value. Use with caution. + public get osInput() { + return this._os; + } + + // port - computed: false, optional: false, required: true + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + charset: cdktf.stringToTerraform(this._charset), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + instance_name: cdktf.stringToTerraform(this._instanceName), + ip: cdktf.stringToTerraform(this._ip), + lts_audit_switch: cdktf.numberToTerraform(this._ltsAuditSwitch), + name: cdktf.stringToTerraform(this._name), + os: cdktf.stringToTerraform(this._os), + port: cdktf.stringToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + charset: { + value: cdktf.stringToHclTerraform(this._charset), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_name: { + value: cdktf.stringToHclTerraform(this._instanceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(this._ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_audit_switch: { + value: cdktf.numberToHclTerraform(this._ltsAuditSwitch), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os: { + value: cdktf.stringToHclTerraform(this._os), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dbss-instance/README.md b/src/constructs/providers/huaweicloud/dbss-instance/README.md new file mode 100644 index 00000000..2527e8db --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dbss_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dbss_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance). diff --git a/src/constructs/providers/huaweicloud/dbss-instance/index.ts b/src/constructs/providers/huaweicloud/dbss-instance/index.ts new file mode 100644 index 00000000..78b7fdd4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-instance/index.ts @@ -0,0 +1,873 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DbssInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#action DbssInstance#action} + */ + readonly action?: string; + /** + * Whether auto renew is enabled. Valid values are "true" and "false". + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#auto_renew DbssInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * The availability zone to which the instnce belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#availability_zone DbssInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Billing mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#charging_mode DbssInstance#charging_mode} + */ + readonly chargingMode: string; + /** + * The description of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#description DbssInstance#description} + */ + readonly description?: string; + /** + * Enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#enterprise_project_id DbssInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the flavor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#flavor DbssInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#id DbssInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#ip_address DbssInstance#ip_address} + */ + readonly ipAddress?: string; + /** + * The instance name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#name DbssInstance#name} + */ + readonly name: string; + /** + * The charging period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#period DbssInstance#period} + */ + readonly period: number; + /** + * The charging period unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#period_unit DbssInstance#period_unit} + */ + readonly periodUnit: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#product_id DbssInstance#product_id} + */ + readonly productId?: string; + /** + * schema: Required; The product specification description in json string format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#product_spec_desc DbssInstance#product_spec_desc} + */ + readonly productSpecDesc?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#region DbssInstance#region} + */ + readonly region?: string; + /** + * The resource specifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#resource_spec_code DbssInstance#resource_spec_code} + */ + readonly resourceSpecCode: string; + /** + * The security group to which the instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#security_group_id DbssInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * The subnet ID of the NIC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#subnet_id DbssInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#tags DbssInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#vpc_id DbssInstance#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#timeouts DbssInstance#timeouts} + */ + readonly timeouts?: DbssInstanceTimeouts; +} +export interface DbssInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#create DbssInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#delete DbssInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#update DbssInstance#update} + */ + readonly update?: string; +} + +export function dbssInstanceTimeoutsToTerraform(struct?: DbssInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dbssInstanceTimeoutsToHclTerraform(struct?: DbssInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DbssInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DbssInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DbssInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance huaweicloud_dbss_instance} +*/ +export class DbssInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DbssInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DbssInstance to import + * @param importFromId The id of the existing DbssInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DbssInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_instance huaweicloud_dbss_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DbssInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DbssInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._productId = config.productId; + this._productSpecDesc = config.productSpecDesc; + this._region = config.region; + this._resourceSpecCode = config.resourceSpecCode; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // connect_ip - computed: true, optional: false, required: false + public get connectIp() { + return this.getStringAttribute('connect_ip'); + } + + // connect_ipv6 - computed: true, optional: false, required: false + public get connectIpv6() { + return this.getStringAttribute('connect_ipv6'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // product_spec_desc - computed: false, optional: true, required: false + private _productSpecDesc?: string; + public get productSpecDesc() { + return this.getStringAttribute('product_spec_desc'); + } + public set productSpecDesc(value: string) { + this._productSpecDesc = value; + } + public resetProductSpecDesc() { + this._productSpecDesc = undefined; + } + // Temporarily expose input value. Use with caution. + public get productSpecDescInput() { + return this._productSpecDesc; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: false, optional: false, required: true + private _resourceSpecCode?: string; + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + public set resourceSpecCode(value: string) { + this._resourceSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get resourceSpecCodeInput() { + return this._resourceSpecCode; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DbssInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DbssInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + product_id: cdktf.stringToTerraform(this._productId), + product_spec_desc: cdktf.stringToTerraform(this._productSpecDesc), + region: cdktf.stringToTerraform(this._region), + resource_spec_code: cdktf.stringToTerraform(this._resourceSpecCode), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: dbssInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_spec_desc: { + value: cdktf.stringToHclTerraform(this._productSpecDesc), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_spec_code: { + value: cdktf.stringToHclTerraform(this._resourceSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dbssInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DbssInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dbss-rds-database/README.md b/src/constructs/providers/huaweicloud/dbss-rds-database/README.md new file mode 100644 index 00000000..c3d4713c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-rds-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dbss_rds_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_dbss_rds_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database). diff --git a/src/constructs/providers/huaweicloud/dbss-rds-database/index.ts b/src/constructs/providers/huaweicloud/dbss-rds-database/index.ts new file mode 100644 index 00000000..278033e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dbss-rds-database/index.ts @@ -0,0 +1,335 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DbssRdsDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#id DbssRdsDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#instance_id DbssRdsDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#lts_audit_switch DbssRdsDatabase#lts_audit_switch} + */ + readonly ltsAuditSwitch?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#rds_id DbssRdsDatabase#rds_id} + */ + readonly rdsId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#region DbssRdsDatabase#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#status DbssRdsDatabase#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#type DbssRdsDatabase#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database huaweicloud_dbss_rds_database} +*/ +export class DbssRdsDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dbss_rds_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DbssRdsDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DbssRdsDatabase to import + * @param importFromId The id of the existing DbssRdsDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DbssRdsDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dbss_rds_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dbss_rds_database huaweicloud_dbss_rds_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DbssRdsDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: DbssRdsDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dbss_rds_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._ltsAuditSwitch = config.ltsAuditSwitch; + this._rdsId = config.rdsId; + this._region = config.region; + this._status = config.status; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_url - computed: true, optional: false, required: false + public get agentUrl() { + return this.getListAttribute('agent_url'); + } + + // audit_status - computed: true, optional: false, required: false + public get auditStatus() { + return this.getStringAttribute('audit_status'); + } + + // charset - computed: true, optional: false, required: false + public get charset() { + return this.getStringAttribute('charset'); + } + + // db_classification - computed: true, optional: false, required: false + public get dbClassification() { + return this.getStringAttribute('db_classification'); + } + + // db_id - computed: true, optional: false, required: false + public get dbId() { + return this.getStringAttribute('db_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // lts_audit_switch - computed: false, optional: true, required: false + private _ltsAuditSwitch?: number; + public get ltsAuditSwitch() { + return this.getNumberAttribute('lts_audit_switch'); + } + public set ltsAuditSwitch(value: number) { + this._ltsAuditSwitch = value; + } + public resetLtsAuditSwitch() { + this._ltsAuditSwitch = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsAuditSwitchInput() { + return this._ltsAuditSwitch; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // os - computed: true, optional: false, required: false + public get os() { + return this.getStringAttribute('os'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // rds_audit_switch_mismatch - computed: true, optional: false, required: false + public get rdsAuditSwitchMismatch() { + return this.getBooleanAttribute('rds_audit_switch_mismatch'); + } + + // rds_id - computed: false, optional: false, required: true + private _rdsId?: string; + public get rdsId() { + return this.getStringAttribute('rds_id'); + } + public set rdsId(value: string) { + this._rdsId = value; + } + // Temporarily expose input value. Use with caution. + public get rdsIdInput() { + return this._rdsId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lts_audit_switch: cdktf.numberToTerraform(this._ltsAuditSwitch), + rds_id: cdktf.stringToTerraform(this._rdsId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_audit_switch: { + value: cdktf.numberToHclTerraform(this._ltsAuditSwitch), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rds_id: { + value: cdktf.stringToHclTerraform(this._rdsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dc-hosted-connect/README.md b/src/constructs/providers/huaweicloud/dc-hosted-connect/README.md new file mode 100644 index 00000000..29605c85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-hosted-connect/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dc_hosted_connect` + +Refer to the Terraform Registry for docs: [`huaweicloud_dc_hosted_connect`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect). diff --git a/src/constructs/providers/huaweicloud/dc-hosted-connect/index.ts b/src/constructs/providers/huaweicloud/dc-hosted-connect/index.ts new file mode 100644 index 00000000..144ba27d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-hosted-connect/index.ts @@ -0,0 +1,537 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcHostedConnectConfig extends cdktf.TerraformMetaArguments { + /** + * The bandwidth size of the hosted connect in Mbit/s. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#bandwidth DcHostedConnect#bandwidth} + */ + readonly bandwidth: number; + /** + * The description of the hosted connect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#description DcHostedConnect#description} + */ + readonly description?: string; + /** + * The ID of the operations connection on which the hosted connect is created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#hosting_id DcHostedConnect#hosting_id} + */ + readonly hostingId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#id DcHostedConnect#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the hosted connect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#name DcHostedConnect#name} + */ + readonly name?: string; + /** + * The location of the on-premises facility at the other end of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#peer_location DcHostedConnect#peer_location} + */ + readonly peerLocation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#region DcHostedConnect#region} + */ + readonly region?: string; + /** + * The tenant ID for whom a hosted connect is to be created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#resource_tenant_id DcHostedConnect#resource_tenant_id} + */ + readonly resourceTenantId: string; + /** + * The VLAN allocated to the hosted connect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#vlan DcHostedConnect#vlan} + */ + readonly vlan: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#timeouts DcHostedConnect#timeouts} + */ + readonly timeouts?: DcHostedConnectTimeouts; +} +export interface DcHostedConnectTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#create DcHostedConnect#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#delete DcHostedConnect#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#update DcHostedConnect#update} + */ + readonly update?: string; +} + +export function dcHostedConnectTimeoutsToTerraform(struct?: DcHostedConnectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dcHostedConnectTimeoutsToHclTerraform(struct?: DcHostedConnectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcHostedConnectTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcHostedConnectTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcHostedConnectTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect huaweicloud_dc_hosted_connect} +*/ +export class DcHostedConnect extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_hosted_connect"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcHostedConnect resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcHostedConnect to import + * @param importFromId The id of the existing DcHostedConnect that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcHostedConnect to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_hosted_connect", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_hosted_connect huaweicloud_dc_hosted_connect} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcHostedConnectConfig + */ + public constructor(scope: Construct, id: string, config: DcHostedConnectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_hosted_connect', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidth = config.bandwidth; + this._description = config.description; + this._hostingId = config.hostingId; + this._id = config.id; + this._name = config.name; + this._peerLocation = config.peerLocation; + this._region = config.region; + this._resourceTenantId = config.resourceTenantId; + this._vlan = config.vlan; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // hosting_id - computed: false, optional: false, required: true + private _hostingId?: string; + public get hostingId() { + return this.getStringAttribute('hosting_id'); + } + public set hostingId(value: string) { + this._hostingId = value; + } + // Temporarily expose input value. Use with caution. + public get hostingIdInput() { + return this._hostingId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_location - computed: true, optional: true, required: false + private _peerLocation?: string; + public get peerLocation() { + return this.getStringAttribute('peer_location'); + } + public set peerLocation(value: string) { + this._peerLocation = value; + } + public resetPeerLocation() { + this._peerLocation = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerLocationInput() { + return this._peerLocation; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_tenant_id - computed: false, optional: false, required: true + private _resourceTenantId?: string; + public get resourceTenantId() { + return this.getStringAttribute('resource_tenant_id'); + } + public set resourceTenantId(value: string) { + this._resourceTenantId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTenantIdInput() { + return this._resourceTenantId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vlan - computed: false, optional: false, required: true + private _vlan?: number; + public get vlan() { + return this.getNumberAttribute('vlan'); + } + public set vlan(value: number) { + this._vlan = value; + } + // Temporarily expose input value. Use with caution. + public get vlanInput() { + return this._vlan; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcHostedConnectTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcHostedConnectTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth: cdktf.numberToTerraform(this._bandwidth), + description: cdktf.stringToTerraform(this._description), + hosting_id: cdktf.stringToTerraform(this._hostingId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + peer_location: cdktf.stringToTerraform(this._peerLocation), + region: cdktf.stringToTerraform(this._region), + resource_tenant_id: cdktf.stringToTerraform(this._resourceTenantId), + vlan: cdktf.numberToTerraform(this._vlan), + timeouts: dcHostedConnectTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth: { + value: cdktf.numberToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hosting_id: { + value: cdktf.stringToHclTerraform(this._hostingId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_location: { + value: cdktf.stringToHclTerraform(this._peerLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_tenant_id: { + value: cdktf.stringToHclTerraform(this._resourceTenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vlan: { + value: cdktf.numberToHclTerraform(this._vlan), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: dcHostedConnectTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcHostedConnectTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dc-virtual-gateway/README.md b/src/constructs/providers/huaweicloud/dc-virtual-gateway/README.md new file mode 100644 index 00000000..28d3a3f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-virtual-gateway/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dc_virtual_gateway` + +Refer to the Terraform Registry for docs: [`huaweicloud_dc_virtual_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway). diff --git a/src/constructs/providers/huaweicloud/dc-virtual-gateway/index.ts b/src/constructs/providers/huaweicloud/dc-virtual-gateway/index.ts new file mode 100644 index 00000000..83c49999 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-virtual-gateway/index.ts @@ -0,0 +1,350 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcVirtualGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * The local BGP ASN of the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#asn DcVirtualGateway#asn} + */ + readonly asn?: number; + /** + * The description of the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#description DcVirtualGateway#description} + */ + readonly description?: string; + /** + * The enterprise project ID to which the virtual gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#enterprise_project_id DcVirtualGateway#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#id DcVirtualGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The list of IPv6 subnets from the virtual gateway to access cloud services, which is usually the CIDR block of the VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#local_ep_group DcVirtualGateway#local_ep_group} + */ + readonly localEpGroup: string[]; + /** + * The name of the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#name DcVirtualGateway#name} + */ + readonly name: string; + /** + * The region where the virtual gateway is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#region DcVirtualGateway#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#tags DcVirtualGateway#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC connected to the virtual gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#vpc_id DcVirtualGateway#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway huaweicloud_dc_virtual_gateway} +*/ +export class DcVirtualGateway extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_virtual_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcVirtualGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcVirtualGateway to import + * @param importFromId The id of the existing DcVirtualGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcVirtualGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_virtual_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_gateway huaweicloud_dc_virtual_gateway} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcVirtualGatewayConfig + */ + public constructor(scope: Construct, id: string, config: DcVirtualGatewayConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_virtual_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._asn = config.asn; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._localEpGroup = config.localEpGroup; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // asn - computed: true, optional: true, required: false + private _asn?: number; + public get asn() { + return this.getNumberAttribute('asn'); + } + public set asn(value: number) { + this._asn = value; + } + public resetAsn() { + this._asn = undefined; + } + // Temporarily expose input value. Use with caution. + public get asnInput() { + return this._asn; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // local_ep_group - computed: false, optional: false, required: true + private _localEpGroup?: string[]; + public get localEpGroup() { + return this.getListAttribute('local_ep_group'); + } + public set localEpGroup(value: string[]) { + this._localEpGroup = value; + } + // Temporarily expose input value. Use with caution. + public get localEpGroupInput() { + return this._localEpGroup; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + asn: cdktf.numberToTerraform(this._asn), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + local_ep_group: cdktf.listMapper(cdktf.stringToTerraform, false)(this._localEpGroup), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + asn: { + value: cdktf.numberToHclTerraform(this._asn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_ep_group: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._localEpGroup), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/README.md b/src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/README.md new file mode 100644 index 00000000..090ad9ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dc_virtual_interface_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_dc_virtual_interface_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter). diff --git a/src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/index.ts b/src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/index.ts new file mode 100644 index 00000000..4a1c9e10 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-virtual-interface-accepter/index.ts @@ -0,0 +1,322 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcVirtualInterfaceAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action on virtual interfaces shared by other accounts. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#action DcVirtualInterfaceAccepter#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#id DcVirtualInterfaceAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#region DcVirtualInterfaceAccepter#region} + */ + readonly region?: string; + /** + * Specifies the virtual interface ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#virtual_interface_id DcVirtualInterfaceAccepter#virtual_interface_id} + */ + readonly virtualInterfaceId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#timeouts DcVirtualInterfaceAccepter#timeouts} + */ + readonly timeouts?: DcVirtualInterfaceAccepterTimeouts; +} +export interface DcVirtualInterfaceAccepterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#create DcVirtualInterfaceAccepter#create} + */ + readonly create?: string; +} + +export function dcVirtualInterfaceAccepterTimeoutsToTerraform(struct?: DcVirtualInterfaceAccepterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dcVirtualInterfaceAccepterTimeoutsToHclTerraform(struct?: DcVirtualInterfaceAccepterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcVirtualInterfaceAccepterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcVirtualInterfaceAccepterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcVirtualInterfaceAccepterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter huaweicloud_dc_virtual_interface_accepter} +*/ +export class DcVirtualInterfaceAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_virtual_interface_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcVirtualInterfaceAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcVirtualInterfaceAccepter to import + * @param importFromId The id of the existing DcVirtualInterfaceAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcVirtualInterfaceAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_virtual_interface_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface_accepter huaweicloud_dc_virtual_interface_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcVirtualInterfaceAccepterConfig + */ + public constructor(scope: Construct, id: string, config: DcVirtualInterfaceAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_virtual_interface_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._region = config.region; + this._virtualInterfaceId = config.virtualInterfaceId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // virtual_interface_id - computed: false, optional: false, required: true + private _virtualInterfaceId?: string; + public get virtualInterfaceId() { + return this.getStringAttribute('virtual_interface_id'); + } + public set virtualInterfaceId(value: string) { + this._virtualInterfaceId = value; + } + // Temporarily expose input value. Use with caution. + public get virtualInterfaceIdInput() { + return this._virtualInterfaceId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcVirtualInterfaceAccepterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcVirtualInterfaceAccepterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + virtual_interface_id: cdktf.stringToTerraform(this._virtualInterfaceId), + timeouts: dcVirtualInterfaceAccepterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + virtual_interface_id: { + value: cdktf.stringToHclTerraform(this._virtualInterfaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcVirtualInterfaceAccepterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcVirtualInterfaceAccepterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dc-virtual-interface/README.md b/src/constructs/providers/huaweicloud/dc-virtual-interface/README.md new file mode 100644 index 00000000..45a45832 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-virtual-interface/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dc_virtual_interface` + +Refer to the Terraform Registry for docs: [`huaweicloud_dc_virtual_interface`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface). diff --git a/src/constructs/providers/huaweicloud/dc-virtual-interface/index.ts b/src/constructs/providers/huaweicloud/dc-virtual-interface/index.ts new file mode 100644 index 00000000..db09b798 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dc-virtual-interface/index.ts @@ -0,0 +1,991 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcVirtualInterfaceConfig extends cdktf.TerraformMetaArguments { + /** + * The address family type of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#address_family DcVirtualInterface#address_family} + */ + readonly addressFamily?: string; + /** + * The local BGP ASN in client side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#asn DcVirtualInterface#asn} + */ + readonly asn?: number; + /** + * The ingress bandwidth size of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#bandwidth DcVirtualInterface#bandwidth} + */ + readonly bandwidth: number; + /** + * The (MD5) password for the local BGP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#bgp_md5 DcVirtualInterface#bgp_md5} + */ + readonly bgpMd5?: string; + /** + * The description of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#description DcVirtualInterface#description} + */ + readonly description?: string; + /** + * The ID of the direct connection associated with the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#direct_connect_id DcVirtualInterface#direct_connect_id} + */ + readonly directConnectId: string; + /** + * Whether to enable the Bidirectional Forwarding Detection (BFD) function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#enable_bfd DcVirtualInterface#enable_bfd} + */ + readonly enableBfd?: boolean | cdktf.IResolvable; + /** + * Whether to enable the Network Quality Analysis (NQA) function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#enable_nqa DcVirtualInterface#enable_nqa} + */ + readonly enableNqa?: boolean | cdktf.IResolvable; + /** + * The enterprise project ID to which the virtual interface belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#enterprise_project_id DcVirtualInterface#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#id DcVirtualInterface#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the link aggregation group (LAG) associated with the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#lag_id DcVirtualInterface#lag_id} + */ + readonly lagId?: string; + /** + * The IPv4 address of the virtual interface in cloud side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#local_gateway_v4_ip DcVirtualInterface#local_gateway_v4_ip} + */ + readonly localGatewayV4Ip?: string; + /** + * The IPv6 address of the virtual interface in cloud side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#local_gateway_v6_ip DcVirtualInterface#local_gateway_v6_ip} + */ + readonly localGatewayV6Ip?: string; + /** + * The name of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#name DcVirtualInterface#name} + */ + readonly name: string; + /** + * The region where the virtual interface is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#region DcVirtualInterface#region} + */ + readonly region?: string; + /** + * The CIDR list of remote subnets. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#remote_ep_group DcVirtualInterface#remote_ep_group} + */ + readonly remoteEpGroup: string[]; + /** + * The IPv4 address of the virtual interface in client side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#remote_gateway_v4_ip DcVirtualInterface#remote_gateway_v4_ip} + */ + readonly remoteGatewayV4Ip?: string; + /** + * The IPv6 address of the virtual interface in client side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#remote_gateway_v6_ip DcVirtualInterface#remote_gateway_v6_ip} + */ + readonly remoteGatewayV6Ip?: string; + /** + * The project ID of another tenant which is used to create virtual interface across tenant. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#resource_tenant_id DcVirtualInterface#resource_tenant_id} + */ + readonly resourceTenantId?: string; + /** + * The route mode of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#route_mode DcVirtualInterface#route_mode} + */ + readonly routeMode: string; + /** + * The service type of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#service_type DcVirtualInterface#service_type} + */ + readonly serviceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#tags DcVirtualInterface#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The type of the virtual interface. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#type DcVirtualInterface#type} + */ + readonly type: string; + /** + * The ID of the virtual gateway to which the virtual interface is connected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#vgw_id DcVirtualInterface#vgw_id} + */ + readonly vgwId: string; + /** + * The VLAN for constom side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#vlan DcVirtualInterface#vlan} + */ + readonly vlan: number; +} +export interface DcVirtualInterfaceVifPeers { +} + +export function dcVirtualInterfaceVifPeersToTerraform(struct?: DcVirtualInterfaceVifPeers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcVirtualInterfaceVifPeersToHclTerraform(struct?: DcVirtualInterfaceVifPeers): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcVirtualInterfaceVifPeersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcVirtualInterfaceVifPeers | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcVirtualInterfaceVifPeers | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address_family - computed: true, optional: false, required: false + public get addressFamily() { + return this.getStringAttribute('address_family'); + } + + // bgp_asn - computed: true, optional: false, required: false + public get bgpAsn() { + return this.getNumberAttribute('bgp_asn'); + } + + // bgp_md5 - computed: true, optional: false, required: false + public get bgpMd5() { + return this.getStringAttribute('bgp_md5'); + } + + // bgp_route_limit - computed: true, optional: false, required: false + public get bgpRouteLimit() { + return this.getNumberAttribute('bgp_route_limit'); + } + + // bgp_status - computed: true, optional: false, required: false + public get bgpStatus() { + return this.getStringAttribute('bgp_status'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // enable_bfd - computed: true, optional: false, required: false + public get enableBfd() { + return this.getBooleanAttribute('enable_bfd'); + } + + // enable_nqa - computed: true, optional: false, required: false + public get enableNqa() { + return this.getBooleanAttribute('enable_nqa'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // local_gateway_ip - computed: true, optional: false, required: false + public get localGatewayIp() { + return this.getStringAttribute('local_gateway_ip'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // receive_route_num - computed: true, optional: false, required: false + public get receiveRouteNum() { + return this.getNumberAttribute('receive_route_num'); + } + + // remote_ep_group - computed: true, optional: false, required: false + public get remoteEpGroup() { + return this.getListAttribute('remote_ep_group'); + } + + // remote_gateway_ip - computed: true, optional: false, required: false + public get remoteGatewayIp() { + return this.getStringAttribute('remote_gateway_ip'); + } + + // route_mode - computed: true, optional: false, required: false + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vif_id - computed: true, optional: false, required: false + public get vifId() { + return this.getStringAttribute('vif_id'); + } +} + +export class DcVirtualInterfaceVifPeersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcVirtualInterfaceVifPeersOutputReference { + return new DcVirtualInterfaceVifPeersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface huaweicloud_dc_virtual_interface} +*/ +export class DcVirtualInterface extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dc_virtual_interface"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcVirtualInterface resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcVirtualInterface to import + * @param importFromId The id of the existing DcVirtualInterface that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcVirtualInterface to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dc_virtual_interface", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dc_virtual_interface huaweicloud_dc_virtual_interface} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcVirtualInterfaceConfig + */ + public constructor(scope: Construct, id: string, config: DcVirtualInterfaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dc_virtual_interface', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._addressFamily = config.addressFamily; + this._asn = config.asn; + this._bandwidth = config.bandwidth; + this._bgpMd5 = config.bgpMd5; + this._description = config.description; + this._directConnectId = config.directConnectId; + this._enableBfd = config.enableBfd; + this._enableNqa = config.enableNqa; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._lagId = config.lagId; + this._localGatewayV4Ip = config.localGatewayV4Ip; + this._localGatewayV6Ip = config.localGatewayV6Ip; + this._name = config.name; + this._region = config.region; + this._remoteEpGroup = config.remoteEpGroup; + this._remoteGatewayV4Ip = config.remoteGatewayV4Ip; + this._remoteGatewayV6Ip = config.remoteGatewayV6Ip; + this._resourceTenantId = config.resourceTenantId; + this._routeMode = config.routeMode; + this._serviceType = config.serviceType; + this._tags = config.tags; + this._type = config.type; + this._vgwId = config.vgwId; + this._vlan = config.vlan; + } + + // ========== + // ATTRIBUTES + // ========== + + // address_family - computed: false, optional: true, required: false + private _addressFamily?: string; + public get addressFamily() { + return this.getStringAttribute('address_family'); + } + public set addressFamily(value: string) { + this._addressFamily = value; + } + public resetAddressFamily() { + this._addressFamily = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressFamilyInput() { + return this._addressFamily; + } + + // asn - computed: true, optional: true, required: false + private _asn?: number; + public get asn() { + return this.getNumberAttribute('asn'); + } + public set asn(value: number) { + this._asn = value; + } + public resetAsn() { + this._asn = undefined; + } + // Temporarily expose input value. Use with caution. + public get asnInput() { + return this._asn; + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth?: number; + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + public set bandwidth(value: number) { + this._bandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // bgp_md5 - computed: true, optional: true, required: false + private _bgpMd5?: string; + public get bgpMd5() { + return this.getStringAttribute('bgp_md5'); + } + public set bgpMd5(value: string) { + this._bgpMd5 = value; + } + public resetBgpMd5() { + this._bgpMd5 = undefined; + } + // Temporarily expose input value. Use with caution. + public get bgpMd5Input() { + return this._bgpMd5; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // direct_connect_id - computed: false, optional: false, required: true + private _directConnectId?: string; + public get directConnectId() { + return this.getStringAttribute('direct_connect_id'); + } + public set directConnectId(value: string) { + this._directConnectId = value; + } + // Temporarily expose input value. Use with caution. + public get directConnectIdInput() { + return this._directConnectId; + } + + // enable_bfd - computed: true, optional: true, required: false + private _enableBfd?: boolean | cdktf.IResolvable; + public get enableBfd() { + return this.getBooleanAttribute('enable_bfd'); + } + public set enableBfd(value: boolean | cdktf.IResolvable) { + this._enableBfd = value; + } + public resetEnableBfd() { + this._enableBfd = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableBfdInput() { + return this._enableBfd; + } + + // enable_nqa - computed: true, optional: true, required: false + private _enableNqa?: boolean | cdktf.IResolvable; + public get enableNqa() { + return this.getBooleanAttribute('enable_nqa'); + } + public set enableNqa(value: boolean | cdktf.IResolvable) { + this._enableNqa = value; + } + public resetEnableNqa() { + this._enableNqa = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableNqaInput() { + return this._enableNqa; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lag_id - computed: true, optional: true, required: false + private _lagId?: string; + public get lagId() { + return this.getStringAttribute('lag_id'); + } + public set lagId(value: string) { + this._lagId = value; + } + public resetLagId() { + this._lagId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lagIdInput() { + return this._lagId; + } + + // local_gateway_v4_ip - computed: false, optional: true, required: false + private _localGatewayV4Ip?: string; + public get localGatewayV4Ip() { + return this.getStringAttribute('local_gateway_v4_ip'); + } + public set localGatewayV4Ip(value: string) { + this._localGatewayV4Ip = value; + } + public resetLocalGatewayV4Ip() { + this._localGatewayV4Ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get localGatewayV4IpInput() { + return this._localGatewayV4Ip; + } + + // local_gateway_v6_ip - computed: false, optional: true, required: false + private _localGatewayV6Ip?: string; + public get localGatewayV6Ip() { + return this.getStringAttribute('local_gateway_v6_ip'); + } + public set localGatewayV6Ip(value: string) { + this._localGatewayV6Ip = value; + } + public resetLocalGatewayV6Ip() { + this._localGatewayV6Ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get localGatewayV6IpInput() { + return this._localGatewayV6Ip; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_ep_group - computed: false, optional: false, required: true + private _remoteEpGroup?: string[]; + public get remoteEpGroup() { + return this.getListAttribute('remote_ep_group'); + } + public set remoteEpGroup(value: string[]) { + this._remoteEpGroup = value; + } + // Temporarily expose input value. Use with caution. + public get remoteEpGroupInput() { + return this._remoteEpGroup; + } + + // remote_gateway_v4_ip - computed: false, optional: true, required: false + private _remoteGatewayV4Ip?: string; + public get remoteGatewayV4Ip() { + return this.getStringAttribute('remote_gateway_v4_ip'); + } + public set remoteGatewayV4Ip(value: string) { + this._remoteGatewayV4Ip = value; + } + public resetRemoteGatewayV4Ip() { + this._remoteGatewayV4Ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteGatewayV4IpInput() { + return this._remoteGatewayV4Ip; + } + + // remote_gateway_v6_ip - computed: false, optional: true, required: false + private _remoteGatewayV6Ip?: string; + public get remoteGatewayV6Ip() { + return this.getStringAttribute('remote_gateway_v6_ip'); + } + public set remoteGatewayV6Ip(value: string) { + this._remoteGatewayV6Ip = value; + } + public resetRemoteGatewayV6Ip() { + this._remoteGatewayV6Ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteGatewayV6IpInput() { + return this._remoteGatewayV6Ip; + } + + // resource_tenant_id - computed: false, optional: true, required: false + private _resourceTenantId?: string; + public get resourceTenantId() { + return this.getStringAttribute('resource_tenant_id'); + } + public set resourceTenantId(value: string) { + this._resourceTenantId = value; + } + public resetResourceTenantId() { + this._resourceTenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTenantIdInput() { + return this._resourceTenantId; + } + + // route_mode - computed: false, optional: false, required: true + private _routeMode?: string; + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + public set routeMode(value: string) { + this._routeMode = value; + } + // Temporarily expose input value. Use with caution. + public get routeModeInput() { + return this._routeMode; + } + + // service_type - computed: true, optional: true, required: false + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vgw_id - computed: false, optional: false, required: true + private _vgwId?: string; + public get vgwId() { + return this.getStringAttribute('vgw_id'); + } + public set vgwId(value: string) { + this._vgwId = value; + } + // Temporarily expose input value. Use with caution. + public get vgwIdInput() { + return this._vgwId; + } + + // vif_peers - computed: true, optional: false, required: false + private _vifPeers = new DcVirtualInterfaceVifPeersList(this, "vif_peers", false); + public get vifPeers() { + return this._vifPeers; + } + + // vlan - computed: false, optional: false, required: true + private _vlan?: number; + public get vlan() { + return this.getNumberAttribute('vlan'); + } + public set vlan(value: number) { + this._vlan = value; + } + // Temporarily expose input value. Use with caution. + public get vlanInput() { + return this._vlan; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address_family: cdktf.stringToTerraform(this._addressFamily), + asn: cdktf.numberToTerraform(this._asn), + bandwidth: cdktf.numberToTerraform(this._bandwidth), + bgp_md5: cdktf.stringToTerraform(this._bgpMd5), + description: cdktf.stringToTerraform(this._description), + direct_connect_id: cdktf.stringToTerraform(this._directConnectId), + enable_bfd: cdktf.booleanToTerraform(this._enableBfd), + enable_nqa: cdktf.booleanToTerraform(this._enableNqa), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + lag_id: cdktf.stringToTerraform(this._lagId), + local_gateway_v4_ip: cdktf.stringToTerraform(this._localGatewayV4Ip), + local_gateway_v6_ip: cdktf.stringToTerraform(this._localGatewayV6Ip), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + remote_ep_group: cdktf.listMapper(cdktf.stringToTerraform, false)(this._remoteEpGroup), + remote_gateway_v4_ip: cdktf.stringToTerraform(this._remoteGatewayV4Ip), + remote_gateway_v6_ip: cdktf.stringToTerraform(this._remoteGatewayV6Ip), + resource_tenant_id: cdktf.stringToTerraform(this._resourceTenantId), + route_mode: cdktf.stringToTerraform(this._routeMode), + service_type: cdktf.stringToTerraform(this._serviceType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + vgw_id: cdktf.stringToTerraform(this._vgwId), + vlan: cdktf.numberToTerraform(this._vlan), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address_family: { + value: cdktf.stringToHclTerraform(this._addressFamily), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + asn: { + value: cdktf.numberToHclTerraform(this._asn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + bandwidth: { + value: cdktf.numberToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + bgp_md5: { + value: cdktf.stringToHclTerraform(this._bgpMd5), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direct_connect_id: { + value: cdktf.stringToHclTerraform(this._directConnectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_bfd: { + value: cdktf.booleanToHclTerraform(this._enableBfd), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_nqa: { + value: cdktf.booleanToHclTerraform(this._enableNqa), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lag_id: { + value: cdktf.stringToHclTerraform(this._lagId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_gateway_v4_ip: { + value: cdktf.stringToHclTerraform(this._localGatewayV4Ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_gateway_v6_ip: { + value: cdktf.stringToHclTerraform(this._localGatewayV6Ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_ep_group: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._remoteEpGroup), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + remote_gateway_v4_ip: { + value: cdktf.stringToHclTerraform(this._remoteGatewayV4Ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_gateway_v6_ip: { + value: cdktf.stringToHclTerraform(this._remoteGatewayV6Ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_tenant_id: { + value: cdktf.stringToHclTerraform(this._resourceTenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_mode: { + value: cdktf.stringToHclTerraform(this._routeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vgw_id: { + value: cdktf.stringToHclTerraform(this._vgwId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vlan: { + value: cdktf.numberToHclTerraform(this._vlan), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-account/README.md b/src/constructs/providers/huaweicloud/dcs-account/README.md new file mode 100644 index 00000000..f28bfe79 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account). diff --git a/src/constructs/providers/huaweicloud/dcs-account/index.ts b/src/constructs/providers/huaweicloud/dcs-account/index.ts new file mode 100644 index 00000000..c7ef75b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-account/index.ts @@ -0,0 +1,482 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#account_name DcsAccount#account_name} + */ + readonly accountName: string; + /** + * Specifies the password of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#account_password DcsAccount#account_password} + */ + readonly accountPassword: string; + /** + * Specifies the role of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#account_role DcsAccount#account_role} + */ + readonly accountRole: string; + /** + * Specifies the description of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#description DcsAccount#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#id DcsAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#instance_id DcsAccount#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#region DcsAccount#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#timeouts DcsAccount#timeouts} + */ + readonly timeouts?: DcsAccountTimeouts; +} +export interface DcsAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#create DcsAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#delete DcsAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#update DcsAccount#update} + */ + readonly update?: string; +} + +export function dcsAccountTimeoutsToTerraform(struct?: DcsAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dcsAccountTimeoutsToHclTerraform(struct?: DcsAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account huaweicloud_dcs_account} +*/ +export class DcsAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsAccount to import + * @param importFromId The id of the existing DcsAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_account huaweicloud_dcs_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsAccountConfig + */ + public constructor(scope: Construct, id: string, config: DcsAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountName = config.accountName; + this._accountPassword = config.accountPassword; + this._accountRole = config.accountRole; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_name - computed: false, optional: false, required: true + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // account_password - computed: false, optional: false, required: true + private _accountPassword?: string; + public get accountPassword() { + return this.getStringAttribute('account_password'); + } + public set accountPassword(value: string) { + this._accountPassword = value; + } + // Temporarily expose input value. Use with caution. + public get accountPasswordInput() { + return this._accountPassword; + } + + // account_role - computed: false, optional: false, required: true + private _accountRole?: string; + public get accountRole() { + return this.getStringAttribute('account_role'); + } + public set accountRole(value: string) { + this._accountRole = value; + } + // Temporarily expose input value. Use with caution. + public get accountRoleInput() { + return this._accountRole; + } + + // account_type - computed: true, optional: false, required: false + public get accountType() { + return this.getStringAttribute('account_type'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_name: cdktf.stringToTerraform(this._accountName), + account_password: cdktf.stringToTerraform(this._accountPassword), + account_role: cdktf.stringToTerraform(this._accountRole), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_password: { + value: cdktf.stringToHclTerraform(this._accountPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_role: { + value: cdktf.stringToHclTerraform(this._accountRole), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-backup/README.md b/src/constructs/providers/huaweicloud/dcs-backup/README.md new file mode 100644 index 00000000..65efe679 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup). diff --git a/src/constructs/providers/huaweicloud/dcs-backup/index.ts b/src/constructs/providers/huaweicloud/dcs-backup/index.ts new file mode 100644 index 00000000..d88fa6c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-backup/index.ts @@ -0,0 +1,428 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the format of the DCS instance backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#backup_format DcsBackup#backup_format} + */ + readonly backupFormat?: string; + /** + * Specifies the description of DCS instance backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#description DcsBackup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#id DcsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#instance_id DcsBackup#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#region DcsBackup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#timeouts DcsBackup#timeouts} + */ + readonly timeouts?: DcsBackupTimeouts; +} +export interface DcsBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#create DcsBackup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#delete DcsBackup#delete} + */ + readonly delete?: string; +} + +export function dcsBackupTimeoutsToTerraform(struct?: DcsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dcsBackupTimeoutsToHclTerraform(struct?: DcsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup huaweicloud_dcs_backup} +*/ +export class DcsBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsBackup to import + * @param importFromId The id of the existing DcsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_backup huaweicloud_dcs_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsBackupConfig + */ + public constructor(scope: Construct, id: string, config: DcsBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupFormat = config.backupFormat; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_format - computed: true, optional: true, required: false + private _backupFormat?: string; + public get backupFormat() { + return this.getStringAttribute('backup_format'); + } + public set backupFormat(value: string) { + this._backupFormat = value; + } + public resetBackupFormat() { + this._backupFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupFormatInput() { + return this._backupFormat; + } + + // backup_id - computed: true, optional: false, required: false + public get backupId() { + return this.getStringAttribute('backup_id'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_support_restore - computed: true, optional: false, required: false + public get isSupportRestore() { + return this.getStringAttribute('is_support_restore'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_format: cdktf.stringToTerraform(this._backupFormat), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_format: { + value: cdktf.stringToHclTerraform(this._backupFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-bigkey-analysis/README.md b/src/constructs/providers/huaweicloud/dcs-bigkey-analysis/README.md new file mode 100644 index 00000000..c38ac610 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-bigkey-analysis/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_bigkey_analysis` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_bigkey_analysis`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis). diff --git a/src/constructs/providers/huaweicloud/dcs-bigkey-analysis/index.ts b/src/constructs/providers/huaweicloud/dcs-bigkey-analysis/index.ts new file mode 100644 index 00000000..7affadad --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-bigkey-analysis/index.ts @@ -0,0 +1,431 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsBigkeyAnalysisConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis#id DcsBigkeyAnalysis#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis#instance_id DcsBigkeyAnalysis#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis#region DcsBigkeyAnalysis#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis#timeouts DcsBigkeyAnalysis#timeouts} + */ + readonly timeouts?: DcsBigkeyAnalysisTimeouts; +} +export interface DcsBigkeyAnalysisKeys { +} + +export function dcsBigkeyAnalysisKeysToTerraform(struct?: DcsBigkeyAnalysisKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsBigkeyAnalysisKeysToHclTerraform(struct?: DcsBigkeyAnalysisKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsBigkeyAnalysisKeysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsBigkeyAnalysisKeys | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsBigkeyAnalysisKeys | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // shard - computed: true, optional: false, required: false + public get shard() { + return this.getStringAttribute('shard'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } +} + +export class DcsBigkeyAnalysisKeysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsBigkeyAnalysisKeysOutputReference { + return new DcsBigkeyAnalysisKeysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsBigkeyAnalysisTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis#create DcsBigkeyAnalysis#create} + */ + readonly create?: string; +} + +export function dcsBigkeyAnalysisTimeoutsToTerraform(struct?: DcsBigkeyAnalysisTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dcsBigkeyAnalysisTimeoutsToHclTerraform(struct?: DcsBigkeyAnalysisTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsBigkeyAnalysisTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsBigkeyAnalysisTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsBigkeyAnalysisTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis huaweicloud_dcs_bigkey_analysis} +*/ +export class DcsBigkeyAnalysis extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_bigkey_analysis"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsBigkeyAnalysis resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsBigkeyAnalysis to import + * @param importFromId The id of the existing DcsBigkeyAnalysis that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsBigkeyAnalysis to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_bigkey_analysis", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_bigkey_analysis huaweicloud_dcs_bigkey_analysis} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsBigkeyAnalysisConfig + */ + public constructor(scope: Construct, id: string, config: DcsBigkeyAnalysisConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_bigkey_analysis', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keys - computed: true, optional: false, required: false + private _keys = new DcsBigkeyAnalysisKeysList(this, "keys", false); + public get keys() { + return this._keys; + } + + // num - computed: true, optional: false, required: false + public get num() { + return this.getNumberAttribute('num'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scan_type - computed: true, optional: false, required: false + public get scanType() { + return this.getStringAttribute('scan_type'); + } + + // started_at - computed: true, optional: false, required: false + public get startedAt() { + return this.getStringAttribute('started_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsBigkeyAnalysisTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsBigkeyAnalysisTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsBigkeyAnalysisTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsBigkeyAnalysisTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsBigkeyAnalysisTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-custom-template/README.md b/src/constructs/providers/huaweicloud/dcs-custom-template/README.md new file mode 100644 index 00000000..66991cf1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-custom-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_custom_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_custom_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template). diff --git a/src/constructs/providers/huaweicloud/dcs-custom-template/index.ts b/src/constructs/providers/huaweicloud/dcs-custom-template/index.ts new file mode 100644 index 00000000..f33e4af9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-custom-template/index.ts @@ -0,0 +1,494 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsCustomTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#description DcsCustomTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#id DcsCustomTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#name DcsCustomTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#region DcsCustomTemplate#region} + */ + readonly region?: string; + /** + * Specifies the type of the source template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#source_type DcsCustomTemplate#source_type} + */ + readonly sourceType: string; + /** + * Specifies the ID of the source template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#template_id DcsCustomTemplate#template_id} + */ + readonly templateId: string; + /** + * params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#params DcsCustomTemplate#params} + */ + readonly params: DcsCustomTemplateParams[] | cdktf.IResolvable; +} +export interface DcsCustomTemplateParams { + /** + * Indicates the name of the param. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#param_name DcsCustomTemplate#param_name} + */ + readonly paramName: string; + /** + * Indicates the value of the param. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#param_value DcsCustomTemplate#param_value} + */ + readonly paramValue: string; +} + +export function dcsCustomTemplateParamsToTerraform(struct?: DcsCustomTemplateParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + param_name: cdktf.stringToTerraform(struct!.paramName), + param_value: cdktf.stringToTerraform(struct!.paramValue), + } +} + + +export function dcsCustomTemplateParamsToHclTerraform(struct?: DcsCustomTemplateParams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + param_name: { + value: cdktf.stringToHclTerraform(struct!.paramName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param_value: { + value: cdktf.stringToHclTerraform(struct!.paramValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsCustomTemplateParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsCustomTemplateParams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._paramName !== undefined) { + hasAnyValues = true; + internalValueResult.paramName = this._paramName; + } + if (this._paramValue !== undefined) { + hasAnyValues = true; + internalValueResult.paramValue = this._paramValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsCustomTemplateParams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._paramName = undefined; + this._paramValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._paramName = value.paramName; + this._paramValue = value.paramValue; + } + } + + // default_value - computed: true, optional: false, required: false + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // need_restart - computed: true, optional: false, required: false + public get needRestart() { + return this.getBooleanAttribute('need_restart'); + } + + // param_id - computed: true, optional: false, required: false + public get paramId() { + return this.getStringAttribute('param_id'); + } + + // param_name - computed: false, optional: false, required: true + private _paramName?: string; + public get paramName() { + return this.getStringAttribute('param_name'); + } + public set paramName(value: string) { + this._paramName = value; + } + // Temporarily expose input value. Use with caution. + public get paramNameInput() { + return this._paramName; + } + + // param_value - computed: false, optional: false, required: true + private _paramValue?: string; + public get paramValue() { + return this.getStringAttribute('param_value'); + } + public set paramValue(value: string) { + this._paramValue = value; + } + // Temporarily expose input value. Use with caution. + public get paramValueInput() { + return this._paramValue; + } + + // value_range - computed: true, optional: false, required: false + public get valueRange() { + return this.getStringAttribute('value_range'); + } + + // value_type - computed: true, optional: false, required: false + public get valueType() { + return this.getStringAttribute('value_type'); + } +} + +export class DcsCustomTemplateParamsList extends cdktf.ComplexList { + public internalValue? : DcsCustomTemplateParams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsCustomTemplateParamsOutputReference { + return new DcsCustomTemplateParamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template huaweicloud_dcs_custom_template} +*/ +export class DcsCustomTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_custom_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsCustomTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsCustomTemplate to import + * @param importFromId The id of the existing DcsCustomTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsCustomTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_custom_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_custom_template huaweicloud_dcs_custom_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsCustomTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DcsCustomTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_custom_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sourceType = config.sourceType; + this._templateId = config.templateId; + this._params.internalValue = config.params; + } + + // ========== + // ATTRIBUTES + // ========== + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // product_type - computed: true, optional: false, required: false + public get productType() { + return this.getStringAttribute('product_type'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // storage_type - computed: true, optional: false, required: false + public get storageType() { + return this.getStringAttribute('storage_type'); + } + + // template_id - computed: false, optional: false, required: true + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // params - computed: false, optional: false, required: true + private _params = new DcsCustomTemplateParamsList(this, "params", true); + public get params() { + return this._params; + } + public putParams(value: DcsCustomTemplateParams[] | cdktf.IResolvable) { + this._params.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_type: cdktf.stringToTerraform(this._sourceType), + template_id: cdktf.stringToTerraform(this._templateId), + params: cdktf.listMapper(dcsCustomTemplateParamsToTerraform, true)(this._params.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + params: { + value: cdktf.listMapperHcl(dcsCustomTemplateParamsToHclTerraform, true)(this._params.internalValue), + isBlock: true, + type: "set", + storageClassType: "DcsCustomTemplateParamsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-diagnosis-task/README.md b/src/constructs/providers/huaweicloud/dcs-diagnosis-task/README.md new file mode 100644 index 00000000..4379ef1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-diagnosis-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_diagnosis_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_diagnosis_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task). diff --git a/src/constructs/providers/huaweicloud/dcs-diagnosis-task/index.ts b/src/constructs/providers/huaweicloud/dcs-diagnosis-task/index.ts new file mode 100644 index 00000000..0c1fbff1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-diagnosis-task/index.ts @@ -0,0 +1,1140 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsDiagnosisTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the start time of the diagnosis task, in RFC3339 format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#begin_time DcsDiagnosisTask#begin_time} + */ + readonly beginTime: string; + /** + * Specifies the end time of the diagnosis task, in RFC3339 format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#end_time DcsDiagnosisTask#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#id DcsDiagnosisTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#instance_id DcsDiagnosisTask#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the IP addresses of diagnosed nodes. By default, all nodes are diagnosed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#node_ip_list DcsDiagnosisTask#node_ip_list} + */ + readonly nodeIpList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#region DcsDiagnosisTask#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#timeouts DcsDiagnosisTask#timeouts} + */ + readonly timeouts?: DcsDiagnosisTaskTimeouts; +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStruct { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // average_usec - computed: true, optional: false, required: false + public get averageUsec() { + return this.getNumberAttribute('average_usec'); + } + + // calls_sum - computed: true, optional: false, required: false + public get callsSum() { + return this.getNumberAttribute('calls_sum'); + } + + // command_name - computed: true, optional: false, required: false + public get commandName() { + return this.getStringAttribute('command_name'); + } + + // per_usec - computed: true, optional: false, required: false + public get perUsec() { + return this.getStringAttribute('per_usec'); + } + + // usec_sum - computed: true, optional: false, required: false + public get usecSum() { + return this.getNumberAttribute('usec_sum'); + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStruct { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // command_list - computed: true, optional: false, required: false + private _commandList = new DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListCommandListStructList(this, "command_list", false); + public get commandList() { + return this._commandList; + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // total_num - computed: true, optional: false, required: false + public get totalNum() { + return this.getNumberAttribute('total_num'); + } + + // total_usec_sum - computed: true, optional: false, required: false + public get totalUsecSum() { + return this.getNumberAttribute('total_usec_sum'); + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIds { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIds | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIds | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // params - computed: true, optional: false, required: false + private _params = new cdktf.StringMap(this, "params"); + public get params() { + return this._params; + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIds { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIds | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIds | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // params - computed: true, optional: false, required: false + private _params = new cdktf.StringMap(this, "params"); + public get params() { + return this._params; + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIds { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIds | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIds | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // params - computed: true, optional: false, required: false + private _params = new cdktf.StringMap(this, "params"); + public get params() { + return this._params; + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStruct { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advice_ids - computed: true, optional: false, required: false + private _adviceIds = new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListAdviceIdsList(this, "advice_ids", false); + public get adviceIds() { + return this._adviceIds; + } + + // cause_ids - computed: true, optional: false, required: false + private _causeIds = new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListCauseIdsList(this, "cause_ids", false); + public get causeIds() { + return this._causeIds; + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // impact_ids - computed: true, optional: false, required: false + private _impactIds = new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListImpactIdsList(this, "impact_ids", false); + public get impactIds() { + return this._impactIds; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStruct { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // abnormal_num - computed: true, optional: false, required: false + public get abnormalNum() { + return this.getNumberAttribute('abnormal_num'); + } + + // diagnosis_item_list - computed: true, optional: false, required: false + private _diagnosisItemList = new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListDiagnosisItemListStructList(this, "diagnosis_item_list", false); + public get diagnosisItemList() { + return this._diagnosisItemList; + } + + // failed_num - computed: true, optional: false, required: false + public get failedNum() { + return this.getNumberAttribute('failed_num'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskDiagnosisNodeReportListStruct { +} + +export function dcsDiagnosisTaskDiagnosisNodeReportListStructToTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsDiagnosisTaskDiagnosisNodeReportListStructToHclTerraform(struct?: DcsDiagnosisTaskDiagnosisNodeReportListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsDiagnosisTaskDiagnosisNodeReportListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskDiagnosisNodeReportListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // abnormal_sum - computed: true, optional: false, required: false + public get abnormalSum() { + return this.getNumberAttribute('abnormal_sum'); + } + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // command_time_taken_list - computed: true, optional: false, required: false + private _commandTimeTakenList = new DcsDiagnosisTaskDiagnosisNodeReportListCommandTimeTakenListStructList(this, "command_time_taken_list", false); + public get commandTimeTakenList() { + return this._commandTimeTakenList; + } + + // diagnosis_dimension_list - computed: true, optional: false, required: false + private _diagnosisDimensionList = new DcsDiagnosisTaskDiagnosisNodeReportListDiagnosisDimensionListStructList(this, "diagnosis_dimension_list", false); + public get diagnosisDimensionList() { + return this._diagnosisDimensionList; + } + + // failed_sum - computed: true, optional: false, required: false + public get failedSum() { + return this.getNumberAttribute('failed_sum'); + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // is_faulted - computed: true, optional: false, required: false + public get isFaulted() { + return this.getBooleanAttribute('is_faulted'); + } + + // node_ip - computed: true, optional: false, required: false + public get nodeIp() { + return this.getStringAttribute('node_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } +} + +export class DcsDiagnosisTaskDiagnosisNodeReportListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsDiagnosisTaskDiagnosisNodeReportListStructOutputReference { + return new DcsDiagnosisTaskDiagnosisNodeReportListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsDiagnosisTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#create DcsDiagnosisTask#create} + */ + readonly create?: string; +} + +export function dcsDiagnosisTaskTimeoutsToTerraform(struct?: DcsDiagnosisTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dcsDiagnosisTaskTimeoutsToHclTerraform(struct?: DcsDiagnosisTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsDiagnosisTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsDiagnosisTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsDiagnosisTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task huaweicloud_dcs_diagnosis_task} +*/ +export class DcsDiagnosisTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_diagnosis_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsDiagnosisTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsDiagnosisTask to import + * @param importFromId The id of the existing DcsDiagnosisTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsDiagnosisTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_diagnosis_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_diagnosis_task huaweicloud_dcs_diagnosis_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsDiagnosisTaskConfig + */ + public constructor(scope: Construct, id: string, config: DcsDiagnosisTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_diagnosis_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._beginTime = config.beginTime; + this._endTime = config.endTime; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeIpList = config.nodeIpList; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // abnormal_item_sum - computed: true, optional: false, required: false + public get abnormalItemSum() { + return this.getNumberAttribute('abnormal_item_sum'); + } + + // begin_time - computed: false, optional: false, required: true + private _beginTime?: string; + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + public set beginTime(value: string) { + this._beginTime = value; + } + // Temporarily expose input value. Use with caution. + public get beginTimeInput() { + return this._beginTime; + } + + // diagnosis_node_report_list - computed: true, optional: false, required: false + private _diagnosisNodeReportList = new DcsDiagnosisTaskDiagnosisNodeReportListStructList(this, "diagnosis_node_report_list", false); + public get diagnosisNodeReportList() { + return this._diagnosisNodeReportList; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // failed_item_sum - computed: true, optional: false, required: false + public get failedItemSum() { + return this.getNumberAttribute('failed_item_sum'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_ip_list - computed: true, optional: true, required: false + private _nodeIpList?: string[]; + public get nodeIpList() { + return cdktf.Fn.tolist(this.getListAttribute('node_ip_list')); + } + public set nodeIpList(value: string[]) { + this._nodeIpList = value; + } + public resetNodeIpList() { + this._nodeIpList = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIpListInput() { + return this._nodeIpList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsDiagnosisTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsDiagnosisTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + begin_time: cdktf.stringToTerraform(this._beginTime), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_ip_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._nodeIpList), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsDiagnosisTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + begin_time: { + value: cdktf.stringToHclTerraform(this._beginTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_ip_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._nodeIpList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsDiagnosisTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsDiagnosisTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-hotkey-analysis/README.md b/src/constructs/providers/huaweicloud/dcs-hotkey-analysis/README.md new file mode 100644 index 00000000..c4a16dbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-hotkey-analysis/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_hotkey_analysis` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_hotkey_analysis`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis). diff --git a/src/constructs/providers/huaweicloud/dcs-hotkey-analysis/index.ts b/src/constructs/providers/huaweicloud/dcs-hotkey-analysis/index.ts new file mode 100644 index 00000000..cff83129 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-hotkey-analysis/index.ts @@ -0,0 +1,436 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsHotkeyAnalysisConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis#id DcsHotkeyAnalysis#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis#instance_id DcsHotkeyAnalysis#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis#region DcsHotkeyAnalysis#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis#timeouts DcsHotkeyAnalysis#timeouts} + */ + readonly timeouts?: DcsHotkeyAnalysisTimeouts; +} +export interface DcsHotkeyAnalysisKeys { +} + +export function dcsHotkeyAnalysisKeysToTerraform(struct?: DcsHotkeyAnalysisKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsHotkeyAnalysisKeysToHclTerraform(struct?: DcsHotkeyAnalysisKeys): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsHotkeyAnalysisKeysOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsHotkeyAnalysisKeys | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsHotkeyAnalysisKeys | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db - computed: true, optional: false, required: false + public get db() { + return this.getNumberAttribute('db'); + } + + // freq - computed: true, optional: false, required: false + public get freq() { + return this.getNumberAttribute('freq'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // shard - computed: true, optional: false, required: false + public get shard() { + return this.getStringAttribute('shard'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // unit - computed: true, optional: false, required: false + public get unit() { + return this.getStringAttribute('unit'); + } +} + +export class DcsHotkeyAnalysisKeysList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsHotkeyAnalysisKeysOutputReference { + return new DcsHotkeyAnalysisKeysOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsHotkeyAnalysisTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis#create DcsHotkeyAnalysis#create} + */ + readonly create?: string; +} + +export function dcsHotkeyAnalysisTimeoutsToTerraform(struct?: DcsHotkeyAnalysisTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dcsHotkeyAnalysisTimeoutsToHclTerraform(struct?: DcsHotkeyAnalysisTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsHotkeyAnalysisTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsHotkeyAnalysisTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsHotkeyAnalysisTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis huaweicloud_dcs_hotkey_analysis} +*/ +export class DcsHotkeyAnalysis extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_hotkey_analysis"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsHotkeyAnalysis resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsHotkeyAnalysis to import + * @param importFromId The id of the existing DcsHotkeyAnalysis that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsHotkeyAnalysis to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_hotkey_analysis", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_hotkey_analysis huaweicloud_dcs_hotkey_analysis} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsHotkeyAnalysisConfig + */ + public constructor(scope: Construct, id: string, config: DcsHotkeyAnalysisConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_hotkey_analysis', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keys - computed: true, optional: false, required: false + private _keys = new DcsHotkeyAnalysisKeysList(this, "keys", false); + public get keys() { + return this._keys; + } + + // num - computed: true, optional: false, required: false + public get num() { + return this.getNumberAttribute('num'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scan_type - computed: true, optional: false, required: false + public get scanType() { + return this.getStringAttribute('scan_type'); + } + + // started_at - computed: true, optional: false, required: false + public get startedAt() { + return this.getStringAttribute('started_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsHotkeyAnalysisTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsHotkeyAnalysisTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsHotkeyAnalysisTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsHotkeyAnalysisTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsHotkeyAnalysisTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-instance-restore/README.md b/src/constructs/providers/huaweicloud/dcs-instance-restore/README.md new file mode 100644 index 00000000..99ed0397 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-instance-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_instance_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_instance_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore). diff --git a/src/constructs/providers/huaweicloud/dcs-instance-restore/index.ts b/src/constructs/providers/huaweicloud/dcs-instance-restore/index.ts new file mode 100644 index 00000000..914f2d81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-instance-restore/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsInstanceRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the backup ID used to restore the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#backup_id DcsInstanceRestore#backup_id} + */ + readonly backupId: string; + /** + * Specifies the description of the DCS instance restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#description DcsInstanceRestore#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#id DcsInstanceRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance to be restored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#instance_id DcsInstanceRestore#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#region DcsInstanceRestore#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#timeouts DcsInstanceRestore#timeouts} + */ + readonly timeouts?: DcsInstanceRestoreTimeouts; +} +export interface DcsInstanceRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#create DcsInstanceRestore#create} + */ + readonly create?: string; +} + +export function dcsInstanceRestoreTimeoutsToTerraform(struct?: DcsInstanceRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dcsInstanceRestoreTimeoutsToHclTerraform(struct?: DcsInstanceRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsInstanceRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore huaweicloud_dcs_instance_restore} +*/ +export class DcsInstanceRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_instance_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsInstanceRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsInstanceRestore to import + * @param importFromId The id of the existing DcsInstanceRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsInstanceRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_instance_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_restore huaweicloud_dcs_instance_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsInstanceRestoreConfig + */ + public constructor(scope: Construct, id: string, config: DcsInstanceRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_instance_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_name - computed: true, optional: false, required: false + public get restoreName() { + return this.getStringAttribute('restore_name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsInstanceRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsInstanceRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsInstanceRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsInstanceRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsInstanceRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-instance-v1/README.md b/src/constructs/providers/huaweicloud/dcs-instance-v1/README.md new file mode 100644 index 00000000..8e6afe72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-instance-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_instance_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_instance_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1). diff --git a/src/constructs/providers/huaweicloud/dcs-instance-v1/index.ts b/src/constructs/providers/huaweicloud/dcs-instance-v1/index.ts new file mode 100644 index 00000000..277c09fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-instance-v1/index.ts @@ -0,0 +1,2214 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsInstanceV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#access_user DcsInstanceV1#access_user} + */ + readonly accessUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#auto_pay DcsInstanceV1#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#auto_renew DcsInstanceV1#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#availability_zones DcsInstanceV1#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#available_zones DcsInstanceV1#available_zones} + */ + readonly availableZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#backup_at DcsInstanceV1#backup_at} + */ + readonly backupAt?: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#backup_type DcsInstanceV1#backup_type} + */ + readonly backupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#begin_at DcsInstanceV1#begin_at} + */ + readonly beginAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#capacity DcsInstanceV1#capacity} + */ + readonly capacity: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#charging_mode DcsInstanceV1#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#deleted_nodes DcsInstanceV1#deleted_nodes} + */ + readonly deletedNodes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#description DcsInstanceV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#engine DcsInstanceV1#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#engine_version DcsInstanceV1#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#enterprise_project_id DcsInstanceV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#enterprise_project_name DcsInstanceV1#enterprise_project_name} + */ + readonly enterpriseProjectName?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#flavor DcsInstanceV1#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#id DcsInstanceV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#maintain_begin DcsInstanceV1#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#maintain_end DcsInstanceV1#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#name DcsInstanceV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#password DcsInstanceV1#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#period DcsInstanceV1#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#period_type DcsInstanceV1#period_type} + */ + readonly periodType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#period_unit DcsInstanceV1#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#port DcsInstanceV1#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#private_ip DcsInstanceV1#private_ip} + */ + readonly privateIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#product_id DcsInstanceV1#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#region DcsInstanceV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#rename_commands DcsInstanceV1#rename_commands} + */ + readonly renameCommands?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#reserved_ips DcsInstanceV1#reserved_ips} + */ + readonly reservedIps?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#save_days DcsInstanceV1#save_days} + */ + readonly saveDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#security_group_id DcsInstanceV1#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#ssl_enable DcsInstanceV1#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#subnet_id DcsInstanceV1#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#tags DcsInstanceV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#template_id DcsInstanceV1#template_id} + */ + readonly templateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#vpc_id DcsInstanceV1#vpc_id} + */ + readonly vpcId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#whitelist_enable DcsInstanceV1#whitelist_enable} + */ + readonly whitelistEnable?: boolean | cdktf.IResolvable; + /** + * backup_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#backup_policy DcsInstanceV1#backup_policy} + */ + readonly backupPolicy?: DcsInstanceV1BackupPolicy; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#parameters DcsInstanceV1#parameters} + */ + readonly parameters?: DcsInstanceV1Parameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#timeouts DcsInstanceV1#timeouts} + */ + readonly timeouts?: DcsInstanceV1Timeouts; + /** + * whitelists block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#whitelists DcsInstanceV1#whitelists} + */ + readonly whitelists?: DcsInstanceV1Whitelists[] | cdktf.IResolvable; +} +export interface DcsInstanceV1BandwidthInfo { +} + +export function dcsInstanceV1BandwidthInfoToTerraform(struct?: DcsInstanceV1BandwidthInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsInstanceV1BandwidthInfoToHclTerraform(struct?: DcsInstanceV1BandwidthInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsInstanceV1BandwidthInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsInstanceV1BandwidthInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceV1BandwidthInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // current_time - computed: true, optional: false, required: false + public get currentTime() { + return this.getStringAttribute('current_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // expand_count - computed: true, optional: false, required: false + public get expandCount() { + return this.getNumberAttribute('expand_count'); + } + + // expand_effect_time - computed: true, optional: false, required: false + public get expandEffectTime() { + return this.getNumberAttribute('expand_effect_time'); + } + + // expand_interval_time - computed: true, optional: false, required: false + public get expandIntervalTime() { + return this.getNumberAttribute('expand_interval_time'); + } + + // max_expand_count - computed: true, optional: false, required: false + public get maxExpandCount() { + return this.getNumberAttribute('max_expand_count'); + } + + // next_expand_time - computed: true, optional: false, required: false + public get nextExpandTime() { + return this.getStringAttribute('next_expand_time'); + } + + // task_running - computed: true, optional: false, required: false + public get taskRunning() { + return this.getBooleanAttribute('task_running'); + } +} + +export class DcsInstanceV1BandwidthInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsInstanceV1BandwidthInfoOutputReference { + return new DcsInstanceV1BandwidthInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsInstanceV1BackupPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#backup_at DcsInstanceV1#backup_at} + */ + readonly backupAt: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#backup_type DcsInstanceV1#backup_type} + */ + readonly backupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#begin_at DcsInstanceV1#begin_at} + */ + readonly beginAt: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#period_type DcsInstanceV1#period_type} + */ + readonly periodType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#save_days DcsInstanceV1#save_days} + */ + readonly saveDays?: number; +} + +export function dcsInstanceV1BackupPolicyToTerraform(struct?: DcsInstanceV1BackupPolicyOutputReference | DcsInstanceV1BackupPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backup_at: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.backupAt), + backup_type: cdktf.stringToTerraform(struct!.backupType), + begin_at: cdktf.stringToTerraform(struct!.beginAt), + period_type: cdktf.stringToTerraform(struct!.periodType), + save_days: cdktf.numberToTerraform(struct!.saveDays), + } +} + + +export function dcsInstanceV1BackupPolicyToHclTerraform(struct?: DcsInstanceV1BackupPolicyOutputReference | DcsInstanceV1BackupPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backup_at: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.backupAt), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + backup_type: { + value: cdktf.stringToHclTerraform(struct!.backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_at: { + value: cdktf.stringToHclTerraform(struct!.beginAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period_type: { + value: cdktf.stringToHclTerraform(struct!.periodType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + save_days: { + value: cdktf.numberToHclTerraform(struct!.saveDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceV1BackupPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DcsInstanceV1BackupPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backupAt !== undefined) { + hasAnyValues = true; + internalValueResult.backupAt = this._backupAt; + } + if (this._backupType !== undefined) { + hasAnyValues = true; + internalValueResult.backupType = this._backupType; + } + if (this._beginAt !== undefined) { + hasAnyValues = true; + internalValueResult.beginAt = this._beginAt; + } + if (this._periodType !== undefined) { + hasAnyValues = true; + internalValueResult.periodType = this._periodType; + } + if (this._saveDays !== undefined) { + hasAnyValues = true; + internalValueResult.saveDays = this._saveDays; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceV1BackupPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._backupAt = undefined; + this._backupType = undefined; + this._beginAt = undefined; + this._periodType = undefined; + this._saveDays = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._backupAt = value.backupAt; + this._backupType = value.backupType; + this._beginAt = value.beginAt; + this._periodType = value.periodType; + this._saveDays = value.saveDays; + } + } + + // backup_at - computed: false, optional: false, required: true + private _backupAt?: number[]; + public get backupAt() { + return this.getNumberListAttribute('backup_at'); + } + public set backupAt(value: number[]) { + this._backupAt = value; + } + // Temporarily expose input value. Use with caution. + public get backupAtInput() { + return this._backupAt; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // begin_at - computed: false, optional: false, required: true + private _beginAt?: string; + public get beginAt() { + return this.getStringAttribute('begin_at'); + } + public set beginAt(value: string) { + this._beginAt = value; + } + // Temporarily expose input value. Use with caution. + public get beginAtInput() { + return this._beginAt; + } + + // period_type - computed: false, optional: true, required: false + private _periodType?: string; + public get periodType() { + return this.getStringAttribute('period_type'); + } + public set periodType(value: string) { + this._periodType = value; + } + public resetPeriodType() { + this._periodType = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodTypeInput() { + return this._periodType; + } + + // save_days - computed: false, optional: true, required: false + private _saveDays?: number; + public get saveDays() { + return this.getNumberAttribute('save_days'); + } + public set saveDays(value: number) { + this._saveDays = value; + } + public resetSaveDays() { + this._saveDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get saveDaysInput() { + return this._saveDays; + } +} +export interface DcsInstanceV1Parameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#id DcsInstanceV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#name DcsInstanceV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#value DcsInstanceV1#value} + */ + readonly value: string; +} + +export function dcsInstanceV1ParametersToTerraform(struct?: DcsInstanceV1Parameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dcsInstanceV1ParametersToHclTerraform(struct?: DcsInstanceV1Parameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceV1ParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsInstanceV1Parameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceV1Parameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._name = value.name; + this._value = value.value; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DcsInstanceV1ParametersList extends cdktf.ComplexList { + public internalValue? : DcsInstanceV1Parameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsInstanceV1ParametersOutputReference { + return new DcsInstanceV1ParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsInstanceV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#create DcsInstanceV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#delete DcsInstanceV1#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#update DcsInstanceV1#update} + */ + readonly update?: string; +} + +export function dcsInstanceV1TimeoutsToTerraform(struct?: DcsInstanceV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dcsInstanceV1TimeoutsToHclTerraform(struct?: DcsInstanceV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsInstanceV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface DcsInstanceV1Whitelists { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#group_name DcsInstanceV1#group_name} + */ + readonly groupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#ip_address DcsInstanceV1#ip_address} + */ + readonly ipAddress: string[]; +} + +export function dcsInstanceV1WhitelistsToTerraform(struct?: DcsInstanceV1Whitelists | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_name: cdktf.stringToTerraform(struct!.groupName), + ip_address: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.ipAddress), + } +} + + +export function dcsInstanceV1WhitelistsToHclTerraform(struct?: DcsInstanceV1Whitelists | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.ipAddress), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceV1WhitelistsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsInstanceV1Whitelists | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceV1Whitelists | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._groupName = undefined; + this._ipAddress = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._groupName = value.groupName; + this._ipAddress = value.ipAddress; + } + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string[]; + public get ipAddress() { + return this.getListAttribute('ip_address'); + } + public set ipAddress(value: string[]) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } +} + +export class DcsInstanceV1WhitelistsList extends cdktf.ComplexList { + public internalValue? : DcsInstanceV1Whitelists[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsInstanceV1WhitelistsOutputReference { + return new DcsInstanceV1WhitelistsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1 huaweicloud_dcs_instance_v1} +*/ +export class DcsInstanceV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_instance_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsInstanceV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsInstanceV1 to import + * @param importFromId The id of the existing DcsInstanceV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsInstanceV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_instance_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance_v1 huaweicloud_dcs_instance_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsInstanceV1Config + */ + public constructor(scope: Construct, id: string, config: DcsInstanceV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_instance_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessUser = config.accessUser; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._backupAt = config.backupAt; + this._backupType = config.backupType; + this._beginAt = config.beginAt; + this._capacity = config.capacity; + this._chargingMode = config.chargingMode; + this._deletedNodes = config.deletedNodes; + this._description = config.description; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._enterpriseProjectName = config.enterpriseProjectName; + this._flavor = config.flavor; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodType = config.periodType; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._privateIp = config.privateIp; + this._productId = config.productId; + this._region = config.region; + this._renameCommands = config.renameCommands; + this._reservedIps = config.reservedIps; + this._saveDays = config.saveDays; + this._securityGroupId = config.securityGroupId; + this._sslEnable = config.sslEnable; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._templateId = config.templateId; + this._vpcId = config.vpcId; + this._whitelistEnable = config.whitelistEnable; + this._backupPolicy.internalValue = config.backupPolicy; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + this._whitelists.internalValue = config.whitelists; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_user - computed: true, optional: true, required: false + private _accessUser?: string; + public get accessUser() { + return this.getStringAttribute('access_user'); + } + public set accessUser(value: string) { + this._accessUser = value; + } + public resetAccessUser() { + this._accessUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessUserInput() { + return this._accessUser; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: false, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // backup_at - computed: false, optional: true, required: false + private _backupAt?: number[]; + public get backupAt() { + return this.getNumberListAttribute('backup_at'); + } + public set backupAt(value: number[]) { + this._backupAt = value; + } + public resetBackupAt() { + this._backupAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupAtInput() { + return this._backupAt; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // bandwidth_info - computed: true, optional: false, required: false + private _bandwidthInfo = new DcsInstanceV1BandwidthInfoList(this, "bandwidth_info", false); + public get bandwidthInfo() { + return this._bandwidthInfo; + } + + // begin_at - computed: false, optional: true, required: false + private _beginAt?: string; + public get beginAt() { + return this.getStringAttribute('begin_at'); + } + public set beginAt(value: string) { + this._beginAt = value; + } + public resetBeginAt() { + this._beginAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginAtInput() { + return this._beginAt; + } + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // capacity - computed: false, optional: false, required: true + private _capacity?: number; + public get capacity() { + return this.getNumberAttribute('capacity'); + } + public set capacity(value: number) { + this._capacity = value; + } + // Temporarily expose input value. Use with caution. + public get capacityInput() { + return this._capacity; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cpu_type - computed: true, optional: false, required: false + public get cpuType() { + return this.getStringAttribute('cpu_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // deleted_nodes - computed: false, optional: true, required: false + private _deletedNodes?: string[]; + public get deletedNodes() { + return this.getListAttribute('deleted_nodes'); + } + public set deletedNodes(value: string[]) { + this._deletedNodes = value; + } + public resetDeletedNodes() { + this._deletedNodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletedNodesInput() { + return this._deletedNodes; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // enterprise_project_name - computed: true, optional: true, required: false + private _enterpriseProjectName?: string; + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + public set enterpriseProjectName(value: string) { + this._enterpriseProjectName = value; + } + public resetEnterpriseProjectName() { + this._enterpriseProjectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectNameInput() { + return this._enterpriseProjectName; + } + + // flavor - computed: true, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_version - computed: true, optional: false, required: false + public get internalVersion() { + return this.getStringAttribute('internal_version'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // launched_at - computed: true, optional: false, required: false + public get launchedAt() { + return this.getStringAttribute('launched_at'); + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // max_memory - computed: true, optional: false, required: false + public get maxMemory() { + return this.getNumberAttribute('max_memory'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_type - computed: false, optional: true, required: false + private _periodType?: string; + public get periodType() { + return this.getStringAttribute('period_type'); + } + public set periodType(value: string) { + this._periodType = value; + } + public resetPeriodType() { + this._periodType = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodTypeInput() { + return this._periodType; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_ip - computed: true, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // product_id - computed: true, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // product_type - computed: true, optional: false, required: false + public get productType() { + return this.getStringAttribute('product_type'); + } + + // readonly_domain_name - computed: true, optional: false, required: false + public get readonlyDomainName() { + return this.getStringAttribute('readonly_domain_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rename_commands - computed: false, optional: true, required: false + private _renameCommands?: { [key: string]: string }; + public get renameCommands() { + return this.getStringMapAttribute('rename_commands'); + } + public set renameCommands(value: { [key: string]: string }) { + this._renameCommands = value; + } + public resetRenameCommands() { + this._renameCommands = undefined; + } + // Temporarily expose input value. Use with caution. + public get renameCommandsInput() { + return this._renameCommands; + } + + // replica_count - computed: true, optional: false, required: false + public get replicaCount() { + return this.getNumberAttribute('replica_count'); + } + + // reserved_ips - computed: false, optional: true, required: false + private _reservedIps?: string[]; + public get reservedIps() { + return this.getListAttribute('reserved_ips'); + } + public set reservedIps(value: string[]) { + this._reservedIps = value; + } + public resetReservedIps() { + this._reservedIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get reservedIpsInput() { + return this._reservedIps; + } + + // save_days - computed: false, optional: true, required: false + private _saveDays?: number; + public get saveDays() { + return this.getNumberAttribute('save_days'); + } + public set saveDays(value: number) { + this._saveDays = value; + } + public resetSaveDays() { + this._saveDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get saveDaysInput() { + return this._saveDays; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_group_name - computed: true, optional: false, required: false + public get securityGroupName() { + return this.getStringAttribute('security_group_name'); + } + + // sharding_count - computed: true, optional: false, required: false + public get shardingCount() { + return this.getNumberAttribute('sharding_count'); + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_cidr - computed: true, optional: false, required: false + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // subnet_name - computed: true, optional: false, required: false + public get subnetName() { + return this.getStringAttribute('subnet_name'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // transparent_client_ip_enable - computed: true, optional: false, required: false + public get transparentClientIpEnable() { + return this.getBooleanAttribute('transparent_client_ip_enable'); + } + + // used_memory - computed: true, optional: false, required: false + public get usedMemory() { + return this.getNumberAttribute('used_memory'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } + + // whitelist_enable - computed: false, optional: true, required: false + private _whitelistEnable?: boolean | cdktf.IResolvable; + public get whitelistEnable() { + return this.getBooleanAttribute('whitelist_enable'); + } + public set whitelistEnable(value: boolean | cdktf.IResolvable) { + this._whitelistEnable = value; + } + public resetWhitelistEnable() { + this._whitelistEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistEnableInput() { + return this._whitelistEnable; + } + + // backup_policy - computed: false, optional: true, required: false + private _backupPolicy = new DcsInstanceV1BackupPolicyOutputReference(this, "backup_policy"); + public get backupPolicy() { + return this._backupPolicy; + } + public putBackupPolicy(value: DcsInstanceV1BackupPolicy) { + this._backupPolicy.internalValue = value; + } + public resetBackupPolicy() { + this._backupPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupPolicyInput() { + return this._backupPolicy.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new DcsInstanceV1ParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: DcsInstanceV1Parameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsInstanceV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsInstanceV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // whitelists - computed: false, optional: true, required: false + private _whitelists = new DcsInstanceV1WhitelistsList(this, "whitelists", true); + public get whitelists() { + return this._whitelists; + } + public putWhitelists(value: DcsInstanceV1Whitelists[] | cdktf.IResolvable) { + this._whitelists.internalValue = value; + } + public resetWhitelists() { + this._whitelists.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistsInput() { + return this._whitelists.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_user: cdktf.stringToTerraform(this._accessUser), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + backup_at: cdktf.listMapper(cdktf.numberToTerraform, false)(this._backupAt), + backup_type: cdktf.stringToTerraform(this._backupType), + begin_at: cdktf.stringToTerraform(this._beginAt), + capacity: cdktf.numberToTerraform(this._capacity), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + deleted_nodes: cdktf.listMapper(cdktf.stringToTerraform, false)(this._deletedNodes), + description: cdktf.stringToTerraform(this._description), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + enterprise_project_name: cdktf.stringToTerraform(this._enterpriseProjectName), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_type: cdktf.stringToTerraform(this._periodType), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.numberToTerraform(this._port), + private_ip: cdktf.stringToTerraform(this._privateIp), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + rename_commands: cdktf.hashMapper(cdktf.stringToTerraform)(this._renameCommands), + reserved_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._reservedIps), + save_days: cdktf.numberToTerraform(this._saveDays), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + template_id: cdktf.stringToTerraform(this._templateId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + whitelist_enable: cdktf.booleanToTerraform(this._whitelistEnable), + backup_policy: dcsInstanceV1BackupPolicyToTerraform(this._backupPolicy.internalValue), + parameters: cdktf.listMapper(dcsInstanceV1ParametersToTerraform, true)(this._parameters.internalValue), + timeouts: dcsInstanceV1TimeoutsToTerraform(this._timeouts.internalValue), + whitelists: cdktf.listMapper(dcsInstanceV1WhitelistsToTerraform, true)(this._whitelists.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_user: { + value: cdktf.stringToHclTerraform(this._accessUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + backup_at: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(this._backupAt), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_at: { + value: cdktf.stringToHclTerraform(this._beginAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + capacity: { + value: cdktf.numberToHclTerraform(this._capacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deleted_nodes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._deletedNodes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_name: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_type: { + value: cdktf.stringToHclTerraform(this._periodType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rename_commands: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._renameCommands), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + reserved_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._reservedIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + save_days: { + value: cdktf.numberToHclTerraform(this._saveDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist_enable: { + value: cdktf.booleanToHclTerraform(this._whitelistEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + backup_policy: { + value: dcsInstanceV1BackupPolicyToHclTerraform(this._backupPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "DcsInstanceV1BackupPolicyList", + }, + parameters: { + value: cdktf.listMapperHcl(dcsInstanceV1ParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "DcsInstanceV1ParametersList", + }, + timeouts: { + value: dcsInstanceV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsInstanceV1Timeouts", + }, + whitelists: { + value: cdktf.listMapperHcl(dcsInstanceV1WhitelistsToHclTerraform, true)(this._whitelists.internalValue), + isBlock: true, + type: "set", + storageClassType: "DcsInstanceV1WhitelistsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-instance/README.md b/src/constructs/providers/huaweicloud/dcs-instance/README.md new file mode 100644 index 00000000..dd1f69ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance). diff --git a/src/constructs/providers/huaweicloud/dcs-instance/index.ts b/src/constructs/providers/huaweicloud/dcs-instance/index.ts new file mode 100644 index 00000000..759a75de --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-instance/index.ts @@ -0,0 +1,2214 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#access_user DcsInstance#access_user} + */ + readonly accessUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#auto_pay DcsInstance#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#auto_renew DcsInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#availability_zones DcsInstance#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#available_zones DcsInstance#available_zones} + */ + readonly availableZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#backup_at DcsInstance#backup_at} + */ + readonly backupAt?: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#backup_type DcsInstance#backup_type} + */ + readonly backupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#begin_at DcsInstance#begin_at} + */ + readonly beginAt?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#capacity DcsInstance#capacity} + */ + readonly capacity: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#charging_mode DcsInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#deleted_nodes DcsInstance#deleted_nodes} + */ + readonly deletedNodes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#description DcsInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#engine DcsInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#engine_version DcsInstance#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#enterprise_project_id DcsInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#enterprise_project_name DcsInstance#enterprise_project_name} + */ + readonly enterpriseProjectName?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#flavor DcsInstance#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#id DcsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#maintain_begin DcsInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#maintain_end DcsInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#name DcsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#password DcsInstance#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#period DcsInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#period_type DcsInstance#period_type} + */ + readonly periodType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#period_unit DcsInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#port DcsInstance#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#private_ip DcsInstance#private_ip} + */ + readonly privateIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#product_id DcsInstance#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#region DcsInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#rename_commands DcsInstance#rename_commands} + */ + readonly renameCommands?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#reserved_ips DcsInstance#reserved_ips} + */ + readonly reservedIps?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#save_days DcsInstance#save_days} + */ + readonly saveDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#security_group_id DcsInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#ssl_enable DcsInstance#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#subnet_id DcsInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#tags DcsInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#template_id DcsInstance#template_id} + */ + readonly templateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#vpc_id DcsInstance#vpc_id} + */ + readonly vpcId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#whitelist_enable DcsInstance#whitelist_enable} + */ + readonly whitelistEnable?: boolean | cdktf.IResolvable; + /** + * backup_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#backup_policy DcsInstance#backup_policy} + */ + readonly backupPolicy?: DcsInstanceBackupPolicy; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#parameters DcsInstance#parameters} + */ + readonly parameters?: DcsInstanceParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#timeouts DcsInstance#timeouts} + */ + readonly timeouts?: DcsInstanceTimeouts; + /** + * whitelists block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#whitelists DcsInstance#whitelists} + */ + readonly whitelists?: DcsInstanceWhitelists[] | cdktf.IResolvable; +} +export interface DcsInstanceBandwidthInfo { +} + +export function dcsInstanceBandwidthInfoToTerraform(struct?: DcsInstanceBandwidthInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dcsInstanceBandwidthInfoToHclTerraform(struct?: DcsInstanceBandwidthInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DcsInstanceBandwidthInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsInstanceBandwidthInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceBandwidthInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // bandwidth - computed: true, optional: false, required: false + public get bandwidth() { + return this.getNumberAttribute('bandwidth'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // current_time - computed: true, optional: false, required: false + public get currentTime() { + return this.getStringAttribute('current_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // expand_count - computed: true, optional: false, required: false + public get expandCount() { + return this.getNumberAttribute('expand_count'); + } + + // expand_effect_time - computed: true, optional: false, required: false + public get expandEffectTime() { + return this.getNumberAttribute('expand_effect_time'); + } + + // expand_interval_time - computed: true, optional: false, required: false + public get expandIntervalTime() { + return this.getNumberAttribute('expand_interval_time'); + } + + // max_expand_count - computed: true, optional: false, required: false + public get maxExpandCount() { + return this.getNumberAttribute('max_expand_count'); + } + + // next_expand_time - computed: true, optional: false, required: false + public get nextExpandTime() { + return this.getStringAttribute('next_expand_time'); + } + + // task_running - computed: true, optional: false, required: false + public get taskRunning() { + return this.getBooleanAttribute('task_running'); + } +} + +export class DcsInstanceBandwidthInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsInstanceBandwidthInfoOutputReference { + return new DcsInstanceBandwidthInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsInstanceBackupPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#backup_at DcsInstance#backup_at} + */ + readonly backupAt: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#backup_type DcsInstance#backup_type} + */ + readonly backupType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#begin_at DcsInstance#begin_at} + */ + readonly beginAt: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#period_type DcsInstance#period_type} + */ + readonly periodType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#save_days DcsInstance#save_days} + */ + readonly saveDays?: number; +} + +export function dcsInstanceBackupPolicyToTerraform(struct?: DcsInstanceBackupPolicyOutputReference | DcsInstanceBackupPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backup_at: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.backupAt), + backup_type: cdktf.stringToTerraform(struct!.backupType), + begin_at: cdktf.stringToTerraform(struct!.beginAt), + period_type: cdktf.stringToTerraform(struct!.periodType), + save_days: cdktf.numberToTerraform(struct!.saveDays), + } +} + + +export function dcsInstanceBackupPolicyToHclTerraform(struct?: DcsInstanceBackupPolicyOutputReference | DcsInstanceBackupPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backup_at: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.backupAt), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + backup_type: { + value: cdktf.stringToHclTerraform(struct!.backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_at: { + value: cdktf.stringToHclTerraform(struct!.beginAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period_type: { + value: cdktf.stringToHclTerraform(struct!.periodType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + save_days: { + value: cdktf.numberToHclTerraform(struct!.saveDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceBackupPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DcsInstanceBackupPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backupAt !== undefined) { + hasAnyValues = true; + internalValueResult.backupAt = this._backupAt; + } + if (this._backupType !== undefined) { + hasAnyValues = true; + internalValueResult.backupType = this._backupType; + } + if (this._beginAt !== undefined) { + hasAnyValues = true; + internalValueResult.beginAt = this._beginAt; + } + if (this._periodType !== undefined) { + hasAnyValues = true; + internalValueResult.periodType = this._periodType; + } + if (this._saveDays !== undefined) { + hasAnyValues = true; + internalValueResult.saveDays = this._saveDays; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceBackupPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._backupAt = undefined; + this._backupType = undefined; + this._beginAt = undefined; + this._periodType = undefined; + this._saveDays = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._backupAt = value.backupAt; + this._backupType = value.backupType; + this._beginAt = value.beginAt; + this._periodType = value.periodType; + this._saveDays = value.saveDays; + } + } + + // backup_at - computed: false, optional: false, required: true + private _backupAt?: number[]; + public get backupAt() { + return this.getNumberListAttribute('backup_at'); + } + public set backupAt(value: number[]) { + this._backupAt = value; + } + // Temporarily expose input value. Use with caution. + public get backupAtInput() { + return this._backupAt; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // begin_at - computed: false, optional: false, required: true + private _beginAt?: string; + public get beginAt() { + return this.getStringAttribute('begin_at'); + } + public set beginAt(value: string) { + this._beginAt = value; + } + // Temporarily expose input value. Use with caution. + public get beginAtInput() { + return this._beginAt; + } + + // period_type - computed: false, optional: true, required: false + private _periodType?: string; + public get periodType() { + return this.getStringAttribute('period_type'); + } + public set periodType(value: string) { + this._periodType = value; + } + public resetPeriodType() { + this._periodType = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodTypeInput() { + return this._periodType; + } + + // save_days - computed: false, optional: true, required: false + private _saveDays?: number; + public get saveDays() { + return this.getNumberAttribute('save_days'); + } + public set saveDays(value: number) { + this._saveDays = value; + } + public resetSaveDays() { + this._saveDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get saveDaysInput() { + return this._saveDays; + } +} +export interface DcsInstanceParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#id DcsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#name DcsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#value DcsInstance#value} + */ + readonly value: string; +} + +export function dcsInstanceParametersToTerraform(struct?: DcsInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dcsInstanceParametersToHclTerraform(struct?: DcsInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsInstanceParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._name = value.name; + this._value = value.value; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DcsInstanceParametersList extends cdktf.ComplexList { + public internalValue? : DcsInstanceParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsInstanceParametersOutputReference { + return new DcsInstanceParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DcsInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#create DcsInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#delete DcsInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#update DcsInstance#update} + */ + readonly update?: string; +} + +export function dcsInstanceTimeoutsToTerraform(struct?: DcsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dcsInstanceTimeoutsToHclTerraform(struct?: DcsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface DcsInstanceWhitelists { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#group_name DcsInstance#group_name} + */ + readonly groupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#ip_address DcsInstance#ip_address} + */ + readonly ipAddress: string[]; +} + +export function dcsInstanceWhitelistsToTerraform(struct?: DcsInstanceWhitelists | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_name: cdktf.stringToTerraform(struct!.groupName), + ip_address: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.ipAddress), + } +} + + +export function dcsInstanceWhitelistsToHclTerraform(struct?: DcsInstanceWhitelists | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.ipAddress), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsInstanceWhitelistsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DcsInstanceWhitelists | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsInstanceWhitelists | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._groupName = undefined; + this._ipAddress = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._groupName = value.groupName; + this._ipAddress = value.ipAddress; + } + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string[]; + public get ipAddress() { + return this.getListAttribute('ip_address'); + } + public set ipAddress(value: string[]) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } +} + +export class DcsInstanceWhitelistsList extends cdktf.ComplexList { + public internalValue? : DcsInstanceWhitelists[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DcsInstanceWhitelistsOutputReference { + return new DcsInstanceWhitelistsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance huaweicloud_dcs_instance} +*/ +export class DcsInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsInstance to import + * @param importFromId The id of the existing DcsInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_instance huaweicloud_dcs_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DcsInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessUser = config.accessUser; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._backupAt = config.backupAt; + this._backupType = config.backupType; + this._beginAt = config.beginAt; + this._capacity = config.capacity; + this._chargingMode = config.chargingMode; + this._deletedNodes = config.deletedNodes; + this._description = config.description; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._enterpriseProjectName = config.enterpriseProjectName; + this._flavor = config.flavor; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodType = config.periodType; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._privateIp = config.privateIp; + this._productId = config.productId; + this._region = config.region; + this._renameCommands = config.renameCommands; + this._reservedIps = config.reservedIps; + this._saveDays = config.saveDays; + this._securityGroupId = config.securityGroupId; + this._sslEnable = config.sslEnable; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._templateId = config.templateId; + this._vpcId = config.vpcId; + this._whitelistEnable = config.whitelistEnable; + this._backupPolicy.internalValue = config.backupPolicy; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + this._whitelists.internalValue = config.whitelists; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_user - computed: true, optional: true, required: false + private _accessUser?: string; + public get accessUser() { + return this.getStringAttribute('access_user'); + } + public set accessUser(value: string) { + this._accessUser = value; + } + public resetAccessUser() { + this._accessUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessUserInput() { + return this._accessUser; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: false, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // backup_at - computed: false, optional: true, required: false + private _backupAt?: number[]; + public get backupAt() { + return this.getNumberListAttribute('backup_at'); + } + public set backupAt(value: number[]) { + this._backupAt = value; + } + public resetBackupAt() { + this._backupAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupAtInput() { + return this._backupAt; + } + + // backup_type - computed: false, optional: true, required: false + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + public resetBackupType() { + this._backupType = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // bandwidth_info - computed: true, optional: false, required: false + private _bandwidthInfo = new DcsInstanceBandwidthInfoList(this, "bandwidth_info", false); + public get bandwidthInfo() { + return this._bandwidthInfo; + } + + // begin_at - computed: false, optional: true, required: false + private _beginAt?: string; + public get beginAt() { + return this.getStringAttribute('begin_at'); + } + public set beginAt(value: string) { + this._beginAt = value; + } + public resetBeginAt() { + this._beginAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get beginAtInput() { + return this._beginAt; + } + + // cache_mode - computed: true, optional: false, required: false + public get cacheMode() { + return this.getStringAttribute('cache_mode'); + } + + // capacity - computed: false, optional: false, required: true + private _capacity?: number; + public get capacity() { + return this.getNumberAttribute('capacity'); + } + public set capacity(value: number) { + this._capacity = value; + } + // Temporarily expose input value. Use with caution. + public get capacityInput() { + return this._capacity; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cpu_type - computed: true, optional: false, required: false + public get cpuType() { + return this.getStringAttribute('cpu_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // deleted_nodes - computed: false, optional: true, required: false + private _deletedNodes?: string[]; + public get deletedNodes() { + return this.getListAttribute('deleted_nodes'); + } + public set deletedNodes(value: string[]) { + this._deletedNodes = value; + } + public resetDeletedNodes() { + this._deletedNodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletedNodesInput() { + return this._deletedNodes; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_name - computed: true, optional: false, required: false + public get domainName() { + return this.getStringAttribute('domain_name'); + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // enterprise_project_name - computed: true, optional: true, required: false + private _enterpriseProjectName?: string; + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + public set enterpriseProjectName(value: string) { + this._enterpriseProjectName = value; + } + public resetEnterpriseProjectName() { + this._enterpriseProjectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectNameInput() { + return this._enterpriseProjectName; + } + + // flavor - computed: true, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_version - computed: true, optional: false, required: false + public get internalVersion() { + return this.getStringAttribute('internal_version'); + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // launched_at - computed: true, optional: false, required: false + public get launchedAt() { + return this.getStringAttribute('launched_at'); + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // max_memory - computed: true, optional: false, required: false + public get maxMemory() { + return this.getNumberAttribute('max_memory'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_type - computed: false, optional: true, required: false + private _periodType?: string; + public get periodType() { + return this.getStringAttribute('period_type'); + } + public set periodType(value: string) { + this._periodType = value; + } + public resetPeriodType() { + this._periodType = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodTypeInput() { + return this._periodType; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_ip - computed: true, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // product_id - computed: true, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // product_type - computed: true, optional: false, required: false + public get productType() { + return this.getStringAttribute('product_type'); + } + + // readonly_domain_name - computed: true, optional: false, required: false + public get readonlyDomainName() { + return this.getStringAttribute('readonly_domain_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rename_commands - computed: false, optional: true, required: false + private _renameCommands?: { [key: string]: string }; + public get renameCommands() { + return this.getStringMapAttribute('rename_commands'); + } + public set renameCommands(value: { [key: string]: string }) { + this._renameCommands = value; + } + public resetRenameCommands() { + this._renameCommands = undefined; + } + // Temporarily expose input value. Use with caution. + public get renameCommandsInput() { + return this._renameCommands; + } + + // replica_count - computed: true, optional: false, required: false + public get replicaCount() { + return this.getNumberAttribute('replica_count'); + } + + // reserved_ips - computed: false, optional: true, required: false + private _reservedIps?: string[]; + public get reservedIps() { + return this.getListAttribute('reserved_ips'); + } + public set reservedIps(value: string[]) { + this._reservedIps = value; + } + public resetReservedIps() { + this._reservedIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get reservedIpsInput() { + return this._reservedIps; + } + + // save_days - computed: false, optional: true, required: false + private _saveDays?: number; + public get saveDays() { + return this.getNumberAttribute('save_days'); + } + public set saveDays(value: number) { + this._saveDays = value; + } + public resetSaveDays() { + this._saveDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get saveDaysInput() { + return this._saveDays; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_group_name - computed: true, optional: false, required: false + public get securityGroupName() { + return this.getStringAttribute('security_group_name'); + } + + // sharding_count - computed: true, optional: false, required: false + public get shardingCount() { + return this.getNumberAttribute('sharding_count'); + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_cidr - computed: true, optional: false, required: false + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // subnet_name - computed: true, optional: false, required: false + public get subnetName() { + return this.getStringAttribute('subnet_name'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // transparent_client_ip_enable - computed: true, optional: false, required: false + public get transparentClientIpEnable() { + return this.getBooleanAttribute('transparent_client_ip_enable'); + } + + // used_memory - computed: true, optional: false, required: false + public get usedMemory() { + return this.getNumberAttribute('used_memory'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } + + // whitelist_enable - computed: false, optional: true, required: false + private _whitelistEnable?: boolean | cdktf.IResolvable; + public get whitelistEnable() { + return this.getBooleanAttribute('whitelist_enable'); + } + public set whitelistEnable(value: boolean | cdktf.IResolvable) { + this._whitelistEnable = value; + } + public resetWhitelistEnable() { + this._whitelistEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistEnableInput() { + return this._whitelistEnable; + } + + // backup_policy - computed: false, optional: true, required: false + private _backupPolicy = new DcsInstanceBackupPolicyOutputReference(this, "backup_policy"); + public get backupPolicy() { + return this._backupPolicy; + } + public putBackupPolicy(value: DcsInstanceBackupPolicy) { + this._backupPolicy.internalValue = value; + } + public resetBackupPolicy() { + this._backupPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupPolicyInput() { + return this._backupPolicy.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new DcsInstanceParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: DcsInstanceParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // whitelists - computed: false, optional: true, required: false + private _whitelists = new DcsInstanceWhitelistsList(this, "whitelists", true); + public get whitelists() { + return this._whitelists; + } + public putWhitelists(value: DcsInstanceWhitelists[] | cdktf.IResolvable) { + this._whitelists.internalValue = value; + } + public resetWhitelists() { + this._whitelists.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistsInput() { + return this._whitelists.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_user: cdktf.stringToTerraform(this._accessUser), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + backup_at: cdktf.listMapper(cdktf.numberToTerraform, false)(this._backupAt), + backup_type: cdktf.stringToTerraform(this._backupType), + begin_at: cdktf.stringToTerraform(this._beginAt), + capacity: cdktf.numberToTerraform(this._capacity), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + deleted_nodes: cdktf.listMapper(cdktf.stringToTerraform, false)(this._deletedNodes), + description: cdktf.stringToTerraform(this._description), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + enterprise_project_name: cdktf.stringToTerraform(this._enterpriseProjectName), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_type: cdktf.stringToTerraform(this._periodType), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.numberToTerraform(this._port), + private_ip: cdktf.stringToTerraform(this._privateIp), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + rename_commands: cdktf.hashMapper(cdktf.stringToTerraform)(this._renameCommands), + reserved_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._reservedIps), + save_days: cdktf.numberToTerraform(this._saveDays), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + template_id: cdktf.stringToTerraform(this._templateId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + whitelist_enable: cdktf.booleanToTerraform(this._whitelistEnable), + backup_policy: dcsInstanceBackupPolicyToTerraform(this._backupPolicy.internalValue), + parameters: cdktf.listMapper(dcsInstanceParametersToTerraform, true)(this._parameters.internalValue), + timeouts: dcsInstanceTimeoutsToTerraform(this._timeouts.internalValue), + whitelists: cdktf.listMapper(dcsInstanceWhitelistsToTerraform, true)(this._whitelists.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_user: { + value: cdktf.stringToHclTerraform(this._accessUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + backup_at: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(this._backupAt), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + begin_at: { + value: cdktf.stringToHclTerraform(this._beginAt), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + capacity: { + value: cdktf.numberToHclTerraform(this._capacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deleted_nodes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._deletedNodes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_name: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_type: { + value: cdktf.stringToHclTerraform(this._periodType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rename_commands: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._renameCommands), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + reserved_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._reservedIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + save_days: { + value: cdktf.numberToHclTerraform(this._saveDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist_enable: { + value: cdktf.booleanToHclTerraform(this._whitelistEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + backup_policy: { + value: dcsInstanceBackupPolicyToHclTerraform(this._backupPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "DcsInstanceBackupPolicyList", + }, + parameters: { + value: cdktf.listMapperHcl(dcsInstanceParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "DcsInstanceParametersList", + }, + timeouts: { + value: dcsInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsInstanceTimeouts", + }, + whitelists: { + value: cdktf.listMapperHcl(dcsInstanceWhitelistsToHclTerraform, true)(this._whitelists.internalValue), + isBlock: true, + type: "set", + storageClassType: "DcsInstanceWhitelistsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dcs-isntance-restore/README.md b/src/constructs/providers/huaweicloud/dcs-isntance-restore/README.md new file mode 100644 index 00000000..0971a947 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-isntance-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dcs_isntance_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_dcs_isntance_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore). diff --git a/src/constructs/providers/huaweicloud/dcs-isntance-restore/index.ts b/src/constructs/providers/huaweicloud/dcs-isntance-restore/index.ts new file mode 100644 index 00000000..31ee3236 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dcs-isntance-restore/index.ts @@ -0,0 +1,367 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DcsIsntanceRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the backup ID used to restore the DCS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#backup_id DcsIsntanceRestore#backup_id} + */ + readonly backupId: string; + /** + * Specifies the description of the DCS instance restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#description DcsIsntanceRestore#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#id DcsIsntanceRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DCS instance to be restored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#instance_id DcsIsntanceRestore#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#region DcsIsntanceRestore#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#timeouts DcsIsntanceRestore#timeouts} + */ + readonly timeouts?: DcsIsntanceRestoreTimeouts; +} +export interface DcsIsntanceRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#create DcsIsntanceRestore#create} + */ + readonly create?: string; +} + +export function dcsIsntanceRestoreTimeoutsToTerraform(struct?: DcsIsntanceRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dcsIsntanceRestoreTimeoutsToHclTerraform(struct?: DcsIsntanceRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DcsIsntanceRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DcsIsntanceRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DcsIsntanceRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore huaweicloud_dcs_isntance_restore} +*/ +export class DcsIsntanceRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dcs_isntance_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DcsIsntanceRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DcsIsntanceRestore to import + * @param importFromId The id of the existing DcsIsntanceRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DcsIsntanceRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dcs_isntance_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dcs_isntance_restore huaweicloud_dcs_isntance_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DcsIsntanceRestoreConfig + */ + public constructor(scope: Construct, id: string, config: DcsIsntanceRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dcs_isntance_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_name - computed: true, optional: false, required: false + public get restoreName() { + return this.getStringAttribute('restore_name'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DcsIsntanceRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DcsIsntanceRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dcsIsntanceRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dcsIsntanceRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DcsIsntanceRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-account/README.md b/src/constructs/providers/huaweicloud/ddm-account/README.md new file mode 100644 index 00000000..3431891c --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account). diff --git a/src/constructs/providers/huaweicloud/ddm-account/index.ts b/src/constructs/providers/huaweicloud/ddm-account/index.ts new file mode 100644 index 00000000..c281af46 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-account/index.ts @@ -0,0 +1,630 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the DDM account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#description DdmAccount#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#id DdmAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#instance_id DdmAccount#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the DDM account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#name DdmAccount#name} + */ + readonly name: string; + /** + * Specifies the DDM account password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#password DdmAccount#password} + */ + readonly password: string; + /** + * Specifies the basic permissions of the DDM account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#permissions DdmAccount#permissions} + */ + readonly permissions: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#region DdmAccount#region} + */ + readonly region?: string; + /** + * schemas block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#schemas DdmAccount#schemas} + */ + readonly schemas?: DdmAccountSchemas[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#timeouts DdmAccount#timeouts} + */ + readonly timeouts?: DdmAccountTimeouts; +} +export interface DdmAccountSchemas { + /** + * Specifies the name of the associated schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#name DdmAccount#name} + */ + readonly name?: string; +} + +export function ddmAccountSchemasToTerraform(struct?: DdmAccountSchemas | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function ddmAccountSchemasToHclTerraform(struct?: DdmAccountSchemas | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmAccountSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdmAccountSchemas | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmAccountSchemas | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DdmAccountSchemasList extends cdktf.ComplexList { + public internalValue? : DdmAccountSchemas[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdmAccountSchemasOutputReference { + return new DdmAccountSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdmAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#create DdmAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#delete DdmAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#update DdmAccount#update} + */ + readonly update?: string; +} + +export function ddmAccountTimeoutsToTerraform(struct?: DdmAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddmAccountTimeoutsToHclTerraform(struct?: DdmAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdmAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account huaweicloud_ddm_account} +*/ +export class DdmAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmAccount to import + * @param importFromId The id of the existing DdmAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_account huaweicloud_ddm_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmAccountConfig + */ + public constructor(scope: Construct, id: string, config: DdmAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._permissions = config.permissions; + this._region = config.region; + this._schemas.internalValue = config.schemas; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // permissions - computed: false, optional: false, required: true + private _permissions?: string[]; + public get permissions() { + return cdktf.Fn.tolist(this.getListAttribute('permissions')); + } + public set permissions(value: string[]) { + this._permissions = value; + } + // Temporarily expose input value. Use with caution. + public get permissionsInput() { + return this._permissions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // schemas - computed: false, optional: true, required: false + private _schemas = new DdmAccountSchemasList(this, "schemas", true); + public get schemas() { + return this._schemas; + } + public putSchemas(value: DdmAccountSchemas[] | cdktf.IResolvable) { + this._schemas.internalValue = value; + } + public resetSchemas() { + this._schemas.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemasInput() { + return this._schemas.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdmAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdmAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + permissions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._permissions), + region: cdktf.stringToTerraform(this._region), + schemas: cdktf.listMapper(ddmAccountSchemasToTerraform, true)(this._schemas.internalValue), + timeouts: ddmAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permissions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._permissions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schemas: { + value: cdktf.listMapperHcl(ddmAccountSchemasToHclTerraform, true)(this._schemas.internalValue), + isBlock: true, + type: "set", + storageClassType: "DdmAccountSchemasList", + }, + timeouts: { + value: ddmAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdmAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-instance-read-strategy/README.md b/src/constructs/providers/huaweicloud/ddm-instance-read-strategy/README.md new file mode 100644 index 00000000..94a2900f --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-read-strategy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_instance_read_strategy` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_instance_read_strategy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy). diff --git a/src/constructs/providers/huaweicloud/ddm-instance-read-strategy/index.ts b/src/constructs/providers/huaweicloud/ddm-instance-read-strategy/index.ts new file mode 100644 index 00000000..21aca4e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-read-strategy/index.ts @@ -0,0 +1,345 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmInstanceReadStrategyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#id DdmInstanceReadStrategy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#instance_id DdmInstanceReadStrategy#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#region DdmInstanceReadStrategy#region} + */ + readonly region?: string; + /** + * read_weights block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#read_weights DdmInstanceReadStrategy#read_weights} + */ + readonly readWeights: DdmInstanceReadStrategyReadWeights[] | cdktf.IResolvable; +} +export interface DdmInstanceReadStrategyReadWeights { + /** + * Specifies the ID of the DB instance associated with the DDM schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#db_id DdmInstanceReadStrategy#db_id} + */ + readonly dbId: string; + /** + * Specifies read weight of the DB instance associated with the DDM schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#weight DdmInstanceReadStrategy#weight} + */ + readonly weight: number; +} + +export function ddmInstanceReadStrategyReadWeightsToTerraform(struct?: DdmInstanceReadStrategyReadWeights | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + db_id: cdktf.stringToTerraform(struct!.dbId), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function ddmInstanceReadStrategyReadWeightsToHclTerraform(struct?: DdmInstanceReadStrategyReadWeights | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + db_id: { + value: cdktf.stringToHclTerraform(struct!.dbId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmInstanceReadStrategyReadWeightsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdmInstanceReadStrategyReadWeights | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dbId !== undefined) { + hasAnyValues = true; + internalValueResult.dbId = this._dbId; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceReadStrategyReadWeights | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dbId = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dbId = value.dbId; + this._weight = value.weight; + } + } + + // db_id - computed: false, optional: false, required: true + private _dbId?: string; + public get dbId() { + return this.getStringAttribute('db_id'); + } + public set dbId(value: string) { + this._dbId = value; + } + // Temporarily expose input value. Use with caution. + public get dbIdInput() { + return this._dbId; + } + + // weight - computed: false, optional: false, required: true + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class DdmInstanceReadStrategyReadWeightsList extends cdktf.ComplexList { + public internalValue? : DdmInstanceReadStrategyReadWeights[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdmInstanceReadStrategyReadWeightsOutputReference { + return new DdmInstanceReadStrategyReadWeightsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy huaweicloud_ddm_instance_read_strategy} +*/ +export class DdmInstanceReadStrategy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_read_strategy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmInstanceReadStrategy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmInstanceReadStrategy to import + * @param importFromId The id of the existing DdmInstanceReadStrategy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmInstanceReadStrategy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_read_strategy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_read_strategy huaweicloud_ddm_instance_read_strategy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmInstanceReadStrategyConfig + */ + public constructor(scope: Construct, id: string, config: DdmInstanceReadStrategyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_read_strategy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._readWeights.internalValue = config.readWeights; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // read_weights - computed: false, optional: false, required: true + private _readWeights = new DdmInstanceReadStrategyReadWeightsList(this, "read_weights", true); + public get readWeights() { + return this._readWeights; + } + public putReadWeights(value: DdmInstanceReadStrategyReadWeights[] | cdktf.IResolvable) { + this._readWeights.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get readWeightsInput() { + return this._readWeights.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + read_weights: cdktf.listMapper(ddmInstanceReadStrategyReadWeightsToTerraform, true)(this._readWeights.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_weights: { + value: cdktf.listMapperHcl(ddmInstanceReadStrategyReadWeightsToHclTerraform, true)(this._readWeights.internalValue), + isBlock: true, + type: "set", + storageClassType: "DdmInstanceReadStrategyReadWeightsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-instance-restart/README.md b/src/constructs/providers/huaweicloud/ddm-instance-restart/README.md new file mode 100644 index 00000000..b608e9e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_instance_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_instance_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart). diff --git a/src/constructs/providers/huaweicloud/ddm-instance-restart/index.ts b/src/constructs/providers/huaweicloud/ddm-instance-restart/index.ts new file mode 100644 index 00000000..1ed0a6f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-restart/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmInstanceRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#id DdmInstanceRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#instance_id DdmInstanceRestart#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#region DdmInstanceRestart#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#type DdmInstanceRestart#type} + */ + readonly type?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#timeouts DdmInstanceRestart#timeouts} + */ + readonly timeouts?: DdmInstanceRestartTimeouts; +} +export interface DdmInstanceRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#create DdmInstanceRestart#create} + */ + readonly create?: string; +} + +export function ddmInstanceRestartTimeoutsToTerraform(struct?: DdmInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddmInstanceRestartTimeoutsToHclTerraform(struct?: DdmInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmInstanceRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdmInstanceRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart huaweicloud_ddm_instance_restart} +*/ +export class DdmInstanceRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmInstanceRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmInstanceRestart to import + * @param importFromId The id of the existing DdmInstanceRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmInstanceRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_restart huaweicloud_ddm_instance_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmInstanceRestartConfig + */ + public constructor(scope: Construct, id: string, config: DdmInstanceRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdmInstanceRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdmInstanceRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + timeouts: ddmInstanceRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddmInstanceRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdmInstanceRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-instance-rollback/README.md b/src/constructs/providers/huaweicloud/ddm-instance-rollback/README.md new file mode 100644 index 00000000..b5c3b1de --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-rollback/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_instance_rollback` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_instance_rollback`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback). diff --git a/src/constructs/providers/huaweicloud/ddm-instance-rollback/index.ts b/src/constructs/providers/huaweicloud/ddm-instance-rollback/index.ts new file mode 100644 index 00000000..ab513481 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-rollback/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmInstanceRollbackConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback#id DdmInstanceRollback#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback#instance_id DdmInstanceRollback#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback#region DdmInstanceRollback#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback#timeouts DdmInstanceRollback#timeouts} + */ + readonly timeouts?: DdmInstanceRollbackTimeouts; +} +export interface DdmInstanceRollbackTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback#create DdmInstanceRollback#create} + */ + readonly create?: string; +} + +export function ddmInstanceRollbackTimeoutsToTerraform(struct?: DdmInstanceRollbackTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddmInstanceRollbackTimeoutsToHclTerraform(struct?: DdmInstanceRollbackTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmInstanceRollbackTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdmInstanceRollbackTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceRollbackTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback huaweicloud_ddm_instance_rollback} +*/ +export class DdmInstanceRollback extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_rollback"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmInstanceRollback resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmInstanceRollback to import + * @param importFromId The id of the existing DdmInstanceRollback that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmInstanceRollback to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_rollback", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_rollback huaweicloud_ddm_instance_rollback} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmInstanceRollbackConfig + */ + public constructor(scope: Construct, id: string, config: DdmInstanceRollbackConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_rollback', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdmInstanceRollbackTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdmInstanceRollbackTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: ddmInstanceRollbackTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddmInstanceRollbackTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdmInstanceRollbackTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-instance-upgrade/README.md b/src/constructs/providers/huaweicloud/ddm-instance-upgrade/README.md new file mode 100644 index 00000000..8005e9ab --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-upgrade/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_instance_upgrade` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_instance_upgrade`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade). diff --git a/src/constructs/providers/huaweicloud/ddm-instance-upgrade/index.ts b/src/constructs/providers/huaweicloud/ddm-instance-upgrade/index.ts new file mode 100644 index 00000000..165a97c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance-upgrade/index.ts @@ -0,0 +1,318 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmInstanceUpgradeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#id DdmInstanceUpgrade#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#instance_id DdmInstanceUpgrade#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#region DdmInstanceUpgrade#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#target_version DdmInstanceUpgrade#target_version} + */ + readonly targetVersion: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#timeouts DdmInstanceUpgrade#timeouts} + */ + readonly timeouts?: DdmInstanceUpgradeTimeouts; +} +export interface DdmInstanceUpgradeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#create DdmInstanceUpgrade#create} + */ + readonly create?: string; +} + +export function ddmInstanceUpgradeTimeoutsToTerraform(struct?: DdmInstanceUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddmInstanceUpgradeTimeoutsToHclTerraform(struct?: DdmInstanceUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmInstanceUpgradeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdmInstanceUpgradeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceUpgradeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade huaweicloud_ddm_instance_upgrade} +*/ +export class DdmInstanceUpgrade extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance_upgrade"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmInstanceUpgrade resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmInstanceUpgrade to import + * @param importFromId The id of the existing DdmInstanceUpgrade that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmInstanceUpgrade to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance_upgrade", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance_upgrade huaweicloud_ddm_instance_upgrade} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmInstanceUpgradeConfig + */ + public constructor(scope: Construct, id: string, config: DdmInstanceUpgradeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance_upgrade', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._targetVersion = config.targetVersion; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_version - computed: false, optional: false, required: true + private _targetVersion?: string; + public get targetVersion() { + return this.getStringAttribute('target_version'); + } + public set targetVersion(value: string) { + this._targetVersion = value; + } + // Temporarily expose input value. Use with caution. + public get targetVersionInput() { + return this._targetVersion; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdmInstanceUpgradeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdmInstanceUpgradeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + target_version: cdktf.stringToTerraform(this._targetVersion), + timeouts: ddmInstanceUpgradeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_version: { + value: cdktf.stringToHclTerraform(this._targetVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddmInstanceUpgradeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdmInstanceUpgradeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-instance/README.md b/src/constructs/providers/huaweicloud/ddm-instance/README.md new file mode 100644 index 00000000..286b5d8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance). diff --git a/src/constructs/providers/huaweicloud/ddm-instance/index.ts b/src/constructs/providers/huaweicloud/ddm-instance/index.ts new file mode 100644 index 00000000..be709456 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-instance/index.ts @@ -0,0 +1,1126 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the password of the administrator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#admin_password DdmInstance#admin_password} + */ + readonly adminPassword?: string; + /** + * Specifies the username of the administrator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#admin_user DdmInstance#admin_user} + */ + readonly adminUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#auto_renew DdmInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Specifies the list of availability zones. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#availability_zones DdmInstance#availability_zones} + */ + readonly availabilityZones: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#charging_mode DdmInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Specifies whether data stored on the associated DB instances is deleted + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#delete_rds_data DdmInstance#delete_rds_data} + */ + readonly deleteRdsData?: string; + /** + * Specifies the ID of an Engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#engine_id DdmInstance#engine_id} + */ + readonly engineId: string; + /** + * Specifies the enterprise project id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#enterprise_project_id DdmInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the ID of a product. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#flavor_id DdmInstance#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#id DdmInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#name DdmInstance#name} + */ + readonly name: string; + /** + * Specifies the number of nodes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#node_num DdmInstance#node_num} + */ + readonly nodeNum: number; + /** + * Specifies the ID of parameter group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#param_group_id DdmInstance#param_group_id} + */ + readonly paramGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#period DdmInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#period_unit DdmInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#region DdmInstance#region} + */ + readonly region?: string; + /** + * Specifies the ID of a security group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#security_group_id DdmInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Specifies the ID of a subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#subnet_id DdmInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Specifies the time zone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#time_zone DdmInstance#time_zone} + */ + readonly timeZone?: string; + /** + * Specifies the ID of a VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#vpc_id DdmInstance#vpc_id} + */ + readonly vpcId: string; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#parameters DdmInstance#parameters} + */ + readonly parameters?: DdmInstanceParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#timeouts DdmInstance#timeouts} + */ + readonly timeouts?: DdmInstanceTimeouts; +} +export interface DdmInstanceNodes { +} + +export function ddmInstanceNodesToTerraform(struct?: DdmInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddmInstanceNodesToHclTerraform(struct?: DdmInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdmInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdmInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ip - computed: true, optional: false, required: false + public get ip() { + return this.getStringAttribute('ip'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DdmInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdmInstanceNodesOutputReference { + return new DdmInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdmInstanceParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#name DdmInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#value DdmInstance#value} + */ + readonly value: string; +} + +export function ddmInstanceParametersToTerraform(struct?: DdmInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ddmInstanceParametersToHclTerraform(struct?: DdmInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmInstanceParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdmInstanceParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DdmInstanceParametersList extends cdktf.ComplexList { + public internalValue? : DdmInstanceParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdmInstanceParametersOutputReference { + return new DdmInstanceParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdmInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#create DdmInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#delete DdmInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#update DdmInstance#update} + */ + readonly update?: string; +} + +export function ddmInstanceTimeoutsToTerraform(struct?: DdmInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddmInstanceTimeoutsToHclTerraform(struct?: DdmInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdmInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance huaweicloud_ddm_instance} +*/ +export class DdmInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmInstance to import + * @param importFromId The id of the existing DdmInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_instance huaweicloud_ddm_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DdmInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPassword = config.adminPassword; + this._adminUser = config.adminUser; + this._autoRenew = config.autoRenew; + this._availabilityZones = config.availabilityZones; + this._chargingMode = config.chargingMode; + this._deleteRdsData = config.deleteRdsData; + this._engineId = config.engineId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._name = config.name; + this._nodeNum = config.nodeNum; + this._paramGroupId = config.paramGroupId; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._timeZone = config.timeZone; + this._vpcId = config.vpcId; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_ip - computed: true, optional: false, required: false + public get accessIp() { + return this.getStringAttribute('access_ip'); + } + + // access_port - computed: true, optional: false, required: false + public get accessPort() { + return this.getStringAttribute('access_port'); + } + + // admin_password - computed: true, optional: true, required: false + private _adminPassword?: string; + public get adminPassword() { + return this.getStringAttribute('admin_password'); + } + public set adminPassword(value: string) { + this._adminPassword = value; + } + public resetAdminPassword() { + this._adminPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPasswordInput() { + return this._adminPassword; + } + + // admin_user - computed: true, optional: true, required: false + private _adminUser?: string; + public get adminUser() { + return this.getStringAttribute('admin_user'); + } + public set adminUser(value: string) { + this._adminUser = value; + } + public resetAdminUser() { + this._adminUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminUserInput() { + return this._adminUser; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zones - computed: false, optional: false, required: true + private _availabilityZones?: string[]; + public get availabilityZones() { + return cdktf.Fn.tolist(this.getListAttribute('availability_zones')); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // delete_rds_data - computed: true, optional: true, required: false + private _deleteRdsData?: string; + public get deleteRdsData() { + return this.getStringAttribute('delete_rds_data'); + } + public set deleteRdsData(value: string) { + this._deleteRdsData = value; + } + public resetDeleteRdsData() { + this._deleteRdsData = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteRdsDataInput() { + return this._deleteRdsData; + } + + // engine_id - computed: false, optional: false, required: true + private _engineId?: string; + public get engineId() { + return this.getStringAttribute('engine_id'); + } + public set engineId(value: string) { + this._engineId = value; + } + // Temporarily expose input value. Use with caution. + public get engineIdInput() { + return this._engineId; + } + + // engine_version - computed: true, optional: false, required: false + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: false, optional: false, required: true + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DdmInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // param_group_id - computed: true, optional: true, required: false + private _paramGroupId?: string; + public get paramGroupId() { + return this.getStringAttribute('param_group_id'); + } + public set paramGroupId(value: string) { + this._paramGroupId = value; + } + public resetParamGroupId() { + this._paramGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramGroupIdInput() { + return this._paramGroupId; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // time_zone - computed: true, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new DdmInstanceParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: DdmInstanceParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdmInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdmInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_password: cdktf.stringToTerraform(this._adminPassword), + admin_user: cdktf.stringToTerraform(this._adminUser), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + delete_rds_data: cdktf.stringToTerraform(this._deleteRdsData), + engine_id: cdktf.stringToTerraform(this._engineId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_num: cdktf.numberToTerraform(this._nodeNum), + param_group_id: cdktf.stringToTerraform(this._paramGroupId), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + time_zone: cdktf.stringToTerraform(this._timeZone), + vpc_id: cdktf.stringToTerraform(this._vpcId), + parameters: cdktf.listMapper(ddmInstanceParametersToTerraform, true)(this._parameters.internalValue), + timeouts: ddmInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_password: { + value: cdktf.stringToHclTerraform(this._adminPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_user: { + value: cdktf.stringToHclTerraform(this._adminUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_rds_data: { + value: cdktf.stringToHclTerraform(this._deleteRdsData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_id: { + value: cdktf.stringToHclTerraform(this._engineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + param_group_id: { + value: cdktf.stringToHclTerraform(this._paramGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.listMapperHcl(ddmInstanceParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "DdmInstanceParametersList", + }, + timeouts: { + value: ddmInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdmInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/README.md b/src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/README.md new file mode 100644 index 00000000..ce2387cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_logical_sessions_kill` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_logical_sessions_kill`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill). diff --git a/src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/index.ts b/src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/index.ts new file mode 100644 index 00000000..939eb84c --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-logical-sessions-kill/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmLogicalSessionsKillConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill#id DdmLogicalSessionsKill#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill#instance_id DdmLogicalSessionsKill#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill#process_ids DdmLogicalSessionsKill#process_ids} + */ + readonly processIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill#region DdmLogicalSessionsKill#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill huaweicloud_ddm_logical_sessions_kill} +*/ +export class DdmLogicalSessionsKill extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_logical_sessions_kill"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmLogicalSessionsKill resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmLogicalSessionsKill to import + * @param importFromId The id of the existing DdmLogicalSessionsKill that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmLogicalSessionsKill to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_logical_sessions_kill", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_logical_sessions_kill huaweicloud_ddm_logical_sessions_kill} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmLogicalSessionsKillConfig + */ + public constructor(scope: Construct, id: string, config: DdmLogicalSessionsKillConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_logical_sessions_kill', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._processIds = config.processIds; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // process_ids - computed: false, optional: false, required: true + private _processIds?: string[]; + public get processIds() { + return this.getListAttribute('process_ids'); + } + public set processIds(value: string[]) { + this._processIds = value; + } + // Temporarily expose input value. Use with caution. + public get processIdsInput() { + return this._processIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + process_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._processIds), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + process_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._processIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/README.md b/src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/README.md new file mode 100644 index 00000000..056595f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_physical_sessions_kill` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_physical_sessions_kill`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill). diff --git a/src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/index.ts b/src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/index.ts new file mode 100644 index 00000000..de1fd6a8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-physical-sessions-kill/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmPhysicalSessionsKillConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill#id DdmPhysicalSessionsKill#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill#instance_id DdmPhysicalSessionsKill#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill#process_ids DdmPhysicalSessionsKill#process_ids} + */ + readonly processIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill#region DdmPhysicalSessionsKill#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill huaweicloud_ddm_physical_sessions_kill} +*/ +export class DdmPhysicalSessionsKill extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_physical_sessions_kill"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmPhysicalSessionsKill resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmPhysicalSessionsKill to import + * @param importFromId The id of the existing DdmPhysicalSessionsKill that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmPhysicalSessionsKill to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_physical_sessions_kill", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_physical_sessions_kill huaweicloud_ddm_physical_sessions_kill} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmPhysicalSessionsKillConfig + */ + public constructor(scope: Construct, id: string, config: DdmPhysicalSessionsKillConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_physical_sessions_kill', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._processIds = config.processIds; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // process_ids - computed: false, optional: false, required: true + private _processIds?: string[]; + public get processIds() { + return this.getListAttribute('process_ids'); + } + public set processIds(value: string[]) { + this._processIds = value; + } + // Temporarily expose input value. Use with caution. + public get processIdsInput() { + return this._processIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + process_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._processIds), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + process_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._processIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ddm-schema/README.md b/src/constructs/providers/huaweicloud/ddm-schema/README.md new file mode 100644 index 00000000..fed35d9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-schema/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ddm_schema` + +Refer to the Terraform Registry for docs: [`huaweicloud_ddm_schema`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema). diff --git a/src/constructs/providers/huaweicloud/ddm-schema/index.ts b/src/constructs/providers/huaweicloud/ddm-schema/index.ts new file mode 100644 index 00000000..c0e38558 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ddm-schema/index.ts @@ -0,0 +1,764 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdmSchemaConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether data stored on the associated DB instances is deleted + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#delete_rds_data DdmSchema#delete_rds_data} + */ + readonly deleteRdsData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#id DdmSchema#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a DDM instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#instance_id DdmSchema#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the DDM schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#name DdmSchema#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#region DdmSchema#region} + */ + readonly region?: string; + /** + * Specifies the sharding mode of the schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#shard_mode DdmSchema#shard_mode} + */ + readonly shardMode: string; + /** + * Specifies the number of shards in the same working mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#shard_number DdmSchema#shard_number} + */ + readonly shardNumber: number; + /** + * data_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#data_nodes DdmSchema#data_nodes} + */ + readonly dataNodes: DdmSchemaDataNodes[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#timeouts DdmSchema#timeouts} + */ + readonly timeouts?: DdmSchemaTimeouts; +} +export interface DdmSchemaShards { +} + +export function ddmSchemaShardsToTerraform(struct?: DdmSchemaShards): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddmSchemaShardsToHclTerraform(struct?: DdmSchemaShards): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdmSchemaShardsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdmSchemaShards | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmSchemaShards | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // db_slot - computed: true, optional: false, required: false + public get dbSlot() { + return this.getNumberAttribute('db_slot'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DdmSchemaShardsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdmSchemaShardsOutputReference { + return new DdmSchemaShardsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdmSchemaDataNodes { + /** + * Specifies the password for logging in to the associated RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#admin_password DdmSchema#admin_password} + */ + readonly adminPassword: string; + /** + * Specifies the username for logging in to the associated RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#admin_user DdmSchema#admin_user} + */ + readonly adminUser: string; + /** + * Specifies the ID of the RDS instance associated with the schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#id DdmSchema#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function ddmSchemaDataNodesToTerraform(struct?: DdmSchemaDataNodes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + admin_password: cdktf.stringToTerraform(struct!.adminPassword), + admin_user: cdktf.stringToTerraform(struct!.adminUser), + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function ddmSchemaDataNodesToHclTerraform(struct?: DdmSchemaDataNodes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + admin_password: { + value: cdktf.stringToHclTerraform(struct!.adminPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_user: { + value: cdktf.stringToHclTerraform(struct!.adminUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmSchemaDataNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdmSchemaDataNodes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._adminPassword !== undefined) { + hasAnyValues = true; + internalValueResult.adminPassword = this._adminPassword; + } + if (this._adminUser !== undefined) { + hasAnyValues = true; + internalValueResult.adminUser = this._adminUser; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmSchemaDataNodes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._adminPassword = undefined; + this._adminUser = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._adminPassword = value.adminPassword; + this._adminUser = value.adminUser; + this._id = value.id; + } + } + + // admin_password - computed: false, optional: false, required: true + private _adminPassword?: string; + public get adminPassword() { + return this.getStringAttribute('admin_password'); + } + public set adminPassword(value: string) { + this._adminPassword = value; + } + // Temporarily expose input value. Use with caution. + public get adminPasswordInput() { + return this._adminPassword; + } + + // admin_user - computed: false, optional: false, required: true + private _adminUser?: string; + public get adminUser() { + return this.getStringAttribute('admin_user'); + } + public set adminUser(value: string) { + this._adminUser = value; + } + // Temporarily expose input value. Use with caution. + public get adminUserInput() { + return this._adminUser; + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DdmSchemaDataNodesList extends cdktf.ComplexList { + public internalValue? : DdmSchemaDataNodes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdmSchemaDataNodesOutputReference { + return new DdmSchemaDataNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdmSchemaTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#create DdmSchema#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#delete DdmSchema#delete} + */ + readonly delete?: string; +} + +export function ddmSchemaTimeoutsToTerraform(struct?: DdmSchemaTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ddmSchemaTimeoutsToHclTerraform(struct?: DdmSchemaTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdmSchemaTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdmSchemaTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdmSchemaTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema huaweicloud_ddm_schema} +*/ +export class DdmSchema extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ddm_schema"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdmSchema resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdmSchema to import + * @param importFromId The id of the existing DdmSchema that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdmSchema to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ddm_schema", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ddm_schema huaweicloud_ddm_schema} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdmSchemaConfig + */ + public constructor(scope: Construct, id: string, config: DdmSchemaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ddm_schema', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteRdsData = config.deleteRdsData; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._shardMode = config.shardMode; + this._shardNumber = config.shardNumber; + this._dataNodes.internalValue = config.dataNodes; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_vips - computed: true, optional: false, required: false + public get dataVips() { + return this.getListAttribute('data_vips'); + } + + // delete_rds_data - computed: true, optional: true, required: false + private _deleteRdsData?: string; + public get deleteRdsData() { + return this.getStringAttribute('delete_rds_data'); + } + public set deleteRdsData(value: string) { + this._deleteRdsData = value; + } + public resetDeleteRdsData() { + this._deleteRdsData = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteRdsDataInput() { + return this._deleteRdsData; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // shard_mode - computed: false, optional: false, required: true + private _shardMode?: string; + public get shardMode() { + return this.getStringAttribute('shard_mode'); + } + public set shardMode(value: string) { + this._shardMode = value; + } + // Temporarily expose input value. Use with caution. + public get shardModeInput() { + return this._shardMode; + } + + // shard_number - computed: false, optional: false, required: true + private _shardNumber?: number; + public get shardNumber() { + return this.getNumberAttribute('shard_number'); + } + public set shardNumber(value: number) { + this._shardNumber = value; + } + // Temporarily expose input value. Use with caution. + public get shardNumberInput() { + return this._shardNumber; + } + + // shards - computed: true, optional: false, required: false + private _shards = new DdmSchemaShardsList(this, "shards", false); + public get shards() { + return this._shards; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // data_nodes - computed: false, optional: false, required: true + private _dataNodes = new DdmSchemaDataNodesList(this, "data_nodes", false); + public get dataNodes() { + return this._dataNodes; + } + public putDataNodes(value: DdmSchemaDataNodes[] | cdktf.IResolvable) { + this._dataNodes.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dataNodesInput() { + return this._dataNodes.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdmSchemaTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdmSchemaTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_rds_data: cdktf.stringToTerraform(this._deleteRdsData), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + shard_mode: cdktf.stringToTerraform(this._shardMode), + shard_number: cdktf.numberToTerraform(this._shardNumber), + data_nodes: cdktf.listMapper(ddmSchemaDataNodesToTerraform, true)(this._dataNodes.internalValue), + timeouts: ddmSchemaTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_rds_data: { + value: cdktf.stringToHclTerraform(this._deleteRdsData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shard_mode: { + value: cdktf.stringToHclTerraform(this._shardMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shard_number: { + value: cdktf.numberToHclTerraform(this._shardNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_nodes: { + value: cdktf.listMapperHcl(ddmSchemaDataNodesToHclTerraform, true)(this._dataNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdmSchemaDataNodesList", + }, + timeouts: { + value: ddmSchemaTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdmSchemaTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-audit-log-delete/README.md b/src/constructs/providers/huaweicloud/dds-audit-log-delete/README.md new file mode 100644 index 00000000..b7e000f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-audit-log-delete/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_audit_log_delete` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_audit_log_delete`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete). diff --git a/src/constructs/providers/huaweicloud/dds-audit-log-delete/index.ts b/src/constructs/providers/huaweicloud/dds-audit-log-delete/index.ts new file mode 100644 index 00000000..0727590a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-audit-log-delete/index.ts @@ -0,0 +1,318 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsAuditLogDeleteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#file_names DdsAuditLogDelete#file_names} + */ + readonly fileNames: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#id DdsAuditLogDelete#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#instance_id DdsAuditLogDelete#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#region DdsAuditLogDelete#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#timeouts DdsAuditLogDelete#timeouts} + */ + readonly timeouts?: DdsAuditLogDeleteTimeouts; +} +export interface DdsAuditLogDeleteTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#create DdsAuditLogDelete#create} + */ + readonly create?: string; +} + +export function ddsAuditLogDeleteTimeoutsToTerraform(struct?: DdsAuditLogDeleteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsAuditLogDeleteTimeoutsToHclTerraform(struct?: DdsAuditLogDeleteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsAuditLogDeleteTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsAuditLogDeleteTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsAuditLogDeleteTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete huaweicloud_dds_audit_log_delete} +*/ +export class DdsAuditLogDelete extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_audit_log_delete"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsAuditLogDelete resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsAuditLogDelete to import + * @param importFromId The id of the existing DdsAuditLogDelete that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsAuditLogDelete to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_audit_log_delete", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_delete huaweicloud_dds_audit_log_delete} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsAuditLogDeleteConfig + */ + public constructor(scope: Construct, id: string, config: DdsAuditLogDeleteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_audit_log_delete', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fileNames = config.fileNames; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // file_names - computed: false, optional: false, required: true + private _fileNames?: string[]; + public get fileNames() { + return this.getListAttribute('file_names'); + } + public set fileNames(value: string[]) { + this._fileNames = value; + } + // Temporarily expose input value. Use with caution. + public get fileNamesInput() { + return this._fileNames; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsAuditLogDeleteTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsAuditLogDeleteTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + file_names: cdktf.listMapper(cdktf.stringToTerraform, false)(this._fileNames), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsAuditLogDeleteTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + file_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._fileNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsAuditLogDeleteTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsAuditLogDeleteTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-audit-log-policy/README.md b/src/constructs/providers/huaweicloud/dds-audit-log-policy/README.md new file mode 100644 index 00000000..8f87b7e1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-audit-log-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_audit_log_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_audit_log_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy). diff --git a/src/constructs/providers/huaweicloud/dds-audit-log-policy/index.ts b/src/constructs/providers/huaweicloud/dds-audit-log-policy/index.ts new file mode 100644 index 00000000..6cccbd34 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-audit-log-policy/index.ts @@ -0,0 +1,478 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsAuditLogPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the audit scope. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#audit_scope DdsAuditLogPolicy#audit_scope} + */ + readonly auditScope?: string; + /** + * Specifies the audit type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#audit_types DdsAuditLogPolicy#audit_types} + */ + readonly auditTypes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#id DdsAuditLogPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#instance_id DdsAuditLogPolicy#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the number of days for storing audit logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#keep_days DdsAuditLogPolicy#keep_days} + */ + readonly keepDays: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#region DdsAuditLogPolicy#region} + */ + readonly region?: string; + /** + * Specifies whether the historical audit logs are retained when SQL audit is disabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#reserve_auditlogs DdsAuditLogPolicy#reserve_auditlogs} + */ + readonly reserveAuditlogs?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#timeouts DdsAuditLogPolicy#timeouts} + */ + readonly timeouts?: DdsAuditLogPolicyTimeouts; +} +export interface DdsAuditLogPolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#create DdsAuditLogPolicy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#delete DdsAuditLogPolicy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#update DdsAuditLogPolicy#update} + */ + readonly update?: string; +} + +export function ddsAuditLogPolicyTimeoutsToTerraform(struct?: DdsAuditLogPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddsAuditLogPolicyTimeoutsToHclTerraform(struct?: DdsAuditLogPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsAuditLogPolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsAuditLogPolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsAuditLogPolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy huaweicloud_dds_audit_log_policy} +*/ +export class DdsAuditLogPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_audit_log_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsAuditLogPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsAuditLogPolicy to import + * @param importFromId The id of the existing DdsAuditLogPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsAuditLogPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_audit_log_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_audit_log_policy huaweicloud_dds_audit_log_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsAuditLogPolicyConfig + */ + public constructor(scope: Construct, id: string, config: DdsAuditLogPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_audit_log_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._auditScope = config.auditScope; + this._auditTypes = config.auditTypes; + this._id = config.id; + this._instanceId = config.instanceId; + this._keepDays = config.keepDays; + this._region = config.region; + this._reserveAuditlogs = config.reserveAuditlogs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // audit_scope - computed: true, optional: true, required: false + private _auditScope?: string; + public get auditScope() { + return this.getStringAttribute('audit_scope'); + } + public set auditScope(value: string) { + this._auditScope = value; + } + public resetAuditScope() { + this._auditScope = undefined; + } + // Temporarily expose input value. Use with caution. + public get auditScopeInput() { + return this._auditScope; + } + + // audit_types - computed: true, optional: true, required: false + private _auditTypes?: string[]; + public get auditTypes() { + return this.getListAttribute('audit_types'); + } + public set auditTypes(value: string[]) { + this._auditTypes = value; + } + public resetAuditTypes() { + this._auditTypes = undefined; + } + // Temporarily expose input value. Use with caution. + public get auditTypesInput() { + return this._auditTypes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keep_days - computed: false, optional: false, required: true + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reserve_auditlogs - computed: true, optional: true, required: false + private _reserveAuditlogs?: string; + public get reserveAuditlogs() { + return this.getStringAttribute('reserve_auditlogs'); + } + public set reserveAuditlogs(value: string) { + this._reserveAuditlogs = value; + } + public resetReserveAuditlogs() { + this._reserveAuditlogs = undefined; + } + // Temporarily expose input value. Use with caution. + public get reserveAuditlogsInput() { + return this._reserveAuditlogs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsAuditLogPolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsAuditLogPolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + audit_scope: cdktf.stringToTerraform(this._auditScope), + audit_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._auditTypes), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keep_days: cdktf.numberToTerraform(this._keepDays), + region: cdktf.stringToTerraform(this._region), + reserve_auditlogs: cdktf.stringToTerraform(this._reserveAuditlogs), + timeouts: ddsAuditLogPolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + audit_scope: { + value: cdktf.stringToHclTerraform(this._auditScope), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + audit_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._auditTypes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_days: { + value: cdktf.numberToHclTerraform(this._keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_auditlogs: { + value: cdktf.stringToHclTerraform(this._reserveAuditlogs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsAuditLogPolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsAuditLogPolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-backup/README.md b/src/constructs/providers/huaweicloud/dds-backup/README.md new file mode 100644 index 00000000..29c29437 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup). diff --git a/src/constructs/providers/huaweicloud/dds-backup/index.ts b/src/constructs/providers/huaweicloud/dds-backup/index.ts new file mode 100644 index 00000000..22f8a235 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-backup/index.ts @@ -0,0 +1,501 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the manual backup description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#description DdsBackup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#id DdsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a DDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#instance_id DdsBackup#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the manual backup name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#name DdsBackup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#region DdsBackup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#timeouts DdsBackup#timeouts} + */ + readonly timeouts?: DdsBackupTimeouts; +} +export interface DdsBackupDatastore { +} + +export function ddsBackupDatastoreToTerraform(struct?: DdsBackupDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsBackupDatastoreToHclTerraform(struct?: DdsBackupDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsBackupDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsBackupDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsBackupDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class DdsBackupDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsBackupDatastoreOutputReference { + return new DdsBackupDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#create DdsBackup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#delete DdsBackup#delete} + */ + readonly delete?: string; +} + +export function ddsBackupTimeoutsToTerraform(struct?: DdsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ddsBackupTimeoutsToHclTerraform(struct?: DdsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup huaweicloud_dds_backup} +*/ +export class DdsBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsBackup to import + * @param importFromId The id of the existing DdsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_backup huaweicloud_dds_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsBackupConfig + */ + public constructor(scope: Construct, id: string, config: DdsBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new DdsBackupDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-collection-restore/README.md b/src/constructs/providers/huaweicloud/dds-collection-restore/README.md new file mode 100644 index 00000000..43800f8d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-collection-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_collection_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_collection_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore). diff --git a/src/constructs/providers/huaweicloud/dds-collection-restore/index.ts b/src/constructs/providers/huaweicloud/dds-collection-restore/index.ts new file mode 100644 index 00000000..822708f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-collection-restore/index.ts @@ -0,0 +1,677 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsCollectionRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#id DdsCollectionRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#instance_id DdsCollectionRestore#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#region DdsCollectionRestore#region} + */ + readonly region?: string; + /** + * restore_collections block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#restore_collections DdsCollectionRestore#restore_collections} + */ + readonly restoreCollections: DdsCollectionRestoreRestoreCollections[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#timeouts DdsCollectionRestore#timeouts} + */ + readonly timeouts?: DdsCollectionRestoreTimeouts; +} +export interface DdsCollectionRestoreRestoreCollectionsCollections { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#new_name DdsCollectionRestore#new_name} + */ + readonly newName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#old_name DdsCollectionRestore#old_name} + */ + readonly oldName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#restore_collection_time DdsCollectionRestore#restore_collection_time} + */ + readonly restoreCollectionTime: string; +} + +export function ddsCollectionRestoreRestoreCollectionsCollectionsToTerraform(struct?: DdsCollectionRestoreRestoreCollectionsCollections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + new_name: cdktf.stringToTerraform(struct!.newName), + old_name: cdktf.stringToTerraform(struct!.oldName), + restore_collection_time: cdktf.stringToTerraform(struct!.restoreCollectionTime), + } +} + + +export function ddsCollectionRestoreRestoreCollectionsCollectionsToHclTerraform(struct?: DdsCollectionRestoreRestoreCollectionsCollections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + new_name: { + value: cdktf.stringToHclTerraform(struct!.newName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + old_name: { + value: cdktf.stringToHclTerraform(struct!.oldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_collection_time: { + value: cdktf.stringToHclTerraform(struct!.restoreCollectionTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsCollectionRestoreRestoreCollectionsCollectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsCollectionRestoreRestoreCollectionsCollections | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._newName !== undefined) { + hasAnyValues = true; + internalValueResult.newName = this._newName; + } + if (this._oldName !== undefined) { + hasAnyValues = true; + internalValueResult.oldName = this._oldName; + } + if (this._restoreCollectionTime !== undefined) { + hasAnyValues = true; + internalValueResult.restoreCollectionTime = this._restoreCollectionTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsCollectionRestoreRestoreCollectionsCollections | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._newName = undefined; + this._oldName = undefined; + this._restoreCollectionTime = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._newName = value.newName; + this._oldName = value.oldName; + this._restoreCollectionTime = value.restoreCollectionTime; + } + } + + // new_name - computed: false, optional: true, required: false + private _newName?: string; + public get newName() { + return this.getStringAttribute('new_name'); + } + public set newName(value: string) { + this._newName = value; + } + public resetNewName() { + this._newName = undefined; + } + // Temporarily expose input value. Use with caution. + public get newNameInput() { + return this._newName; + } + + // old_name - computed: false, optional: false, required: true + private _oldName?: string; + public get oldName() { + return this.getStringAttribute('old_name'); + } + public set oldName(value: string) { + this._oldName = value; + } + // Temporarily expose input value. Use with caution. + public get oldNameInput() { + return this._oldName; + } + + // restore_collection_time - computed: false, optional: false, required: true + private _restoreCollectionTime?: string; + public get restoreCollectionTime() { + return this.getStringAttribute('restore_collection_time'); + } + public set restoreCollectionTime(value: string) { + this._restoreCollectionTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreCollectionTimeInput() { + return this._restoreCollectionTime; + } +} + +export class DdsCollectionRestoreRestoreCollectionsCollectionsList extends cdktf.ComplexList { + public internalValue? : DdsCollectionRestoreRestoreCollectionsCollections[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsCollectionRestoreRestoreCollectionsCollectionsOutputReference { + return new DdsCollectionRestoreRestoreCollectionsCollectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsCollectionRestoreRestoreCollections { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#database DdsCollectionRestore#database} + */ + readonly database: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#restore_database_time DdsCollectionRestore#restore_database_time} + */ + readonly restoreDatabaseTime?: string; + /** + * collections block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#collections DdsCollectionRestore#collections} + */ + readonly collections?: DdsCollectionRestoreRestoreCollectionsCollections[] | cdktf.IResolvable; +} + +export function ddsCollectionRestoreRestoreCollectionsToTerraform(struct?: DdsCollectionRestoreRestoreCollections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + database: cdktf.stringToTerraform(struct!.database), + restore_database_time: cdktf.stringToTerraform(struct!.restoreDatabaseTime), + collections: cdktf.listMapper(ddsCollectionRestoreRestoreCollectionsCollectionsToTerraform, true)(struct!.collections), + } +} + + +export function ddsCollectionRestoreRestoreCollectionsToHclTerraform(struct?: DdsCollectionRestoreRestoreCollections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + database: { + value: cdktf.stringToHclTerraform(struct!.database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_database_time: { + value: cdktf.stringToHclTerraform(struct!.restoreDatabaseTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + collections: { + value: cdktf.listMapperHcl(ddsCollectionRestoreRestoreCollectionsCollectionsToHclTerraform, true)(struct!.collections), + isBlock: true, + type: "list", + storageClassType: "DdsCollectionRestoreRestoreCollectionsCollectionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsCollectionRestoreRestoreCollectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsCollectionRestoreRestoreCollections | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._database !== undefined) { + hasAnyValues = true; + internalValueResult.database = this._database; + } + if (this._restoreDatabaseTime !== undefined) { + hasAnyValues = true; + internalValueResult.restoreDatabaseTime = this._restoreDatabaseTime; + } + if (this._collections?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.collections = this._collections?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsCollectionRestoreRestoreCollections | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._database = undefined; + this._restoreDatabaseTime = undefined; + this._collections.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._database = value.database; + this._restoreDatabaseTime = value.restoreDatabaseTime; + this._collections.internalValue = value.collections; + } + } + + // database - computed: false, optional: false, required: true + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // restore_database_time - computed: false, optional: true, required: false + private _restoreDatabaseTime?: string; + public get restoreDatabaseTime() { + return this.getStringAttribute('restore_database_time'); + } + public set restoreDatabaseTime(value: string) { + this._restoreDatabaseTime = value; + } + public resetRestoreDatabaseTime() { + this._restoreDatabaseTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreDatabaseTimeInput() { + return this._restoreDatabaseTime; + } + + // collections - computed: false, optional: true, required: false + private _collections = new DdsCollectionRestoreRestoreCollectionsCollectionsList(this, "collections", false); + public get collections() { + return this._collections; + } + public putCollections(value: DdsCollectionRestoreRestoreCollectionsCollections[] | cdktf.IResolvable) { + this._collections.internalValue = value; + } + public resetCollections() { + this._collections.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get collectionsInput() { + return this._collections.internalValue; + } +} + +export class DdsCollectionRestoreRestoreCollectionsList extends cdktf.ComplexList { + public internalValue? : DdsCollectionRestoreRestoreCollections[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsCollectionRestoreRestoreCollectionsOutputReference { + return new DdsCollectionRestoreRestoreCollectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsCollectionRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#create DdsCollectionRestore#create} + */ + readonly create?: string; +} + +export function ddsCollectionRestoreTimeoutsToTerraform(struct?: DdsCollectionRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsCollectionRestoreTimeoutsToHclTerraform(struct?: DdsCollectionRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsCollectionRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsCollectionRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsCollectionRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore huaweicloud_dds_collection_restore} +*/ +export class DdsCollectionRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_collection_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsCollectionRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsCollectionRestore to import + * @param importFromId The id of the existing DdsCollectionRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsCollectionRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_collection_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_collection_restore huaweicloud_dds_collection_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsCollectionRestoreConfig + */ + public constructor(scope: Construct, id: string, config: DdsCollectionRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_collection_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._restoreCollections.internalValue = config.restoreCollections; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_collections - computed: false, optional: false, required: true + private _restoreCollections = new DdsCollectionRestoreRestoreCollectionsList(this, "restore_collections", false); + public get restoreCollections() { + return this._restoreCollections; + } + public putRestoreCollections(value: DdsCollectionRestoreRestoreCollections[] | cdktf.IResolvable) { + this._restoreCollections.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get restoreCollectionsInput() { + return this._restoreCollections.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsCollectionRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsCollectionRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + restore_collections: cdktf.listMapper(ddsCollectionRestoreRestoreCollectionsToTerraform, true)(this._restoreCollections.internalValue), + timeouts: ddsCollectionRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_collections: { + value: cdktf.listMapperHcl(ddsCollectionRestoreRestoreCollectionsToHclTerraform, true)(this._restoreCollections.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsCollectionRestoreRestoreCollectionsList", + }, + timeouts: { + value: ddsCollectionRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsCollectionRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-database-role/README.md b/src/constructs/providers/huaweicloud/dds-database-role/README.md new file mode 100644 index 00000000..6636577d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-database-role/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_database_role` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_database_role`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role). diff --git a/src/constructs/providers/huaweicloud/dds-database-role/index.ts b/src/constructs/providers/huaweicloud/dds-database-role/index.ts new file mode 100644 index 00000000..1c320d78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-database-role/index.ts @@ -0,0 +1,883 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsDatabaseRoleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#db_name DdsDatabaseRole#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#id DdsDatabaseRole#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#instance_id DdsDatabaseRole#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#name DdsDatabaseRole#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#region DdsDatabaseRole#region} + */ + readonly region?: string; + /** + * roles block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#roles DdsDatabaseRole#roles} + */ + readonly roles?: DdsDatabaseRoleRoles[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#timeouts DdsDatabaseRole#timeouts} + */ + readonly timeouts?: DdsDatabaseRoleTimeouts; +} +export interface DdsDatabaseRoleInheritedPrivilegesResources { +} + +export function ddsDatabaseRoleInheritedPrivilegesResourcesToTerraform(struct?: DdsDatabaseRoleInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseRoleInheritedPrivilegesResourcesToHclTerraform(struct?: DdsDatabaseRoleInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseRoleInheritedPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseRoleInheritedPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseRoleInheritedPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DdsDatabaseRoleInheritedPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseRoleInheritedPrivilegesResourcesOutputReference { + return new DdsDatabaseRoleInheritedPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseRoleInheritedPrivileges { +} + +export function ddsDatabaseRoleInheritedPrivilegesToTerraform(struct?: DdsDatabaseRoleInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseRoleInheritedPrivilegesToHclTerraform(struct?: DdsDatabaseRoleInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseRoleInheritedPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseRoleInheritedPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseRoleInheritedPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DdsDatabaseRoleInheritedPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DdsDatabaseRoleInheritedPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseRoleInheritedPrivilegesOutputReference { + return new DdsDatabaseRoleInheritedPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseRolePrivilegesResources { +} + +export function ddsDatabaseRolePrivilegesResourcesToTerraform(struct?: DdsDatabaseRolePrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseRolePrivilegesResourcesToHclTerraform(struct?: DdsDatabaseRolePrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseRolePrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseRolePrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseRolePrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DdsDatabaseRolePrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseRolePrivilegesResourcesOutputReference { + return new DdsDatabaseRolePrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseRolePrivileges { +} + +export function ddsDatabaseRolePrivilegesToTerraform(struct?: DdsDatabaseRolePrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseRolePrivilegesToHclTerraform(struct?: DdsDatabaseRolePrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseRolePrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseRolePrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseRolePrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DdsDatabaseRolePrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DdsDatabaseRolePrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseRolePrivilegesOutputReference { + return new DdsDatabaseRolePrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseRoleRoles { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#db_name DdsDatabaseRole#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#name DdsDatabaseRole#name} + */ + readonly name: string; +} + +export function ddsDatabaseRoleRolesToTerraform(struct?: DdsDatabaseRoleRoles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + db_name: cdktf.stringToTerraform(struct!.dbName), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function ddsDatabaseRoleRolesToHclTerraform(struct?: DdsDatabaseRoleRoles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(struct!.dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsDatabaseRoleRolesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseRoleRoles | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dbName !== undefined) { + hasAnyValues = true; + internalValueResult.dbName = this._dbName; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseRoleRoles | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dbName = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dbName = value.dbName; + this._name = value.name; + } + } + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DdsDatabaseRoleRolesList extends cdktf.ComplexList { + public internalValue? : DdsDatabaseRoleRoles[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseRoleRolesOutputReference { + return new DdsDatabaseRoleRolesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseRoleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#create DdsDatabaseRole#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#delete DdsDatabaseRole#delete} + */ + readonly delete?: string; +} + +export function ddsDatabaseRoleTimeoutsToTerraform(struct?: DdsDatabaseRoleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ddsDatabaseRoleTimeoutsToHclTerraform(struct?: DdsDatabaseRoleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsDatabaseRoleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsDatabaseRoleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseRoleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role huaweicloud_dds_database_role} +*/ +export class DdsDatabaseRole extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_database_role"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsDatabaseRole resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsDatabaseRole to import + * @param importFromId The id of the existing DdsDatabaseRole that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsDatabaseRole to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_database_role", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_role huaweicloud_dds_database_role} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsDatabaseRoleConfig + */ + public constructor(scope: Construct, id: string, config: DdsDatabaseRoleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_database_role', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._roles.internalValue = config.roles; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inherited_privileges - computed: true, optional: false, required: false + private _inheritedPrivileges = new DdsDatabaseRoleInheritedPrivilegesList(this, "inherited_privileges", false); + public get inheritedPrivileges() { + return this._inheritedPrivileges; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // privileges - computed: true, optional: false, required: false + private _privileges = new DdsDatabaseRolePrivilegesList(this, "privileges", false); + public get privileges() { + return this._privileges; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roles - computed: false, optional: true, required: false + private _roles = new DdsDatabaseRoleRolesList(this, "roles", false); + public get roles() { + return this._roles; + } + public putRoles(value: DdsDatabaseRoleRoles[] | cdktf.IResolvable) { + this._roles.internalValue = value; + } + public resetRoles() { + this._roles.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsDatabaseRoleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsDatabaseRoleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + roles: cdktf.listMapper(ddsDatabaseRoleRolesToTerraform, true)(this._roles.internalValue), + timeouts: ddsDatabaseRoleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(ddsDatabaseRoleRolesToHclTerraform, true)(this._roles.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsDatabaseRoleRolesList", + }, + timeouts: { + value: ddsDatabaseRoleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsDatabaseRoleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-database-user/README.md b/src/constructs/providers/huaweicloud/dds-database-user/README.md new file mode 100644 index 00000000..1dc61591 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-database-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_database_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_database_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user). diff --git a/src/constructs/providers/huaweicloud/dds-database-user/index.ts b/src/constructs/providers/huaweicloud/dds-database-user/index.ts new file mode 100644 index 00000000..fb7902f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-database-user/index.ts @@ -0,0 +1,938 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsDatabaseUserConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#db_name DdsDatabaseUser#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#id DdsDatabaseUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#instance_id DdsDatabaseUser#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#name DdsDatabaseUser#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#password DdsDatabaseUser#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#region DdsDatabaseUser#region} + */ + readonly region?: string; + /** + * roles block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#roles DdsDatabaseUser#roles} + */ + readonly roles: DdsDatabaseUserRoles[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#timeouts DdsDatabaseUser#timeouts} + */ + readonly timeouts?: DdsDatabaseUserTimeouts; +} +export interface DdsDatabaseUserInheritedPrivilegesResources { +} + +export function ddsDatabaseUserInheritedPrivilegesResourcesToTerraform(struct?: DdsDatabaseUserInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseUserInheritedPrivilegesResourcesToHclTerraform(struct?: DdsDatabaseUserInheritedPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseUserInheritedPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseUserInheritedPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseUserInheritedPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DdsDatabaseUserInheritedPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseUserInheritedPrivilegesResourcesOutputReference { + return new DdsDatabaseUserInheritedPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseUserInheritedPrivileges { +} + +export function ddsDatabaseUserInheritedPrivilegesToTerraform(struct?: DdsDatabaseUserInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseUserInheritedPrivilegesToHclTerraform(struct?: DdsDatabaseUserInheritedPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseUserInheritedPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseUserInheritedPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseUserInheritedPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DdsDatabaseUserInheritedPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DdsDatabaseUserInheritedPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseUserInheritedPrivilegesOutputReference { + return new DdsDatabaseUserInheritedPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseUserPrivilegesResources { +} + +export function ddsDatabaseUserPrivilegesResourcesToTerraform(struct?: DdsDatabaseUserPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseUserPrivilegesResourcesToHclTerraform(struct?: DdsDatabaseUserPrivilegesResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseUserPrivilegesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseUserPrivilegesResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseUserPrivilegesResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // collection - computed: true, optional: false, required: false + public get collection() { + return this.getStringAttribute('collection'); + } + + // db_name - computed: true, optional: false, required: false + public get dbName() { + return this.getStringAttribute('db_name'); + } +} + +export class DdsDatabaseUserPrivilegesResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseUserPrivilegesResourcesOutputReference { + return new DdsDatabaseUserPrivilegesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseUserPrivileges { +} + +export function ddsDatabaseUserPrivilegesToTerraform(struct?: DdsDatabaseUserPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsDatabaseUserPrivilegesToHclTerraform(struct?: DdsDatabaseUserPrivileges): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsDatabaseUserPrivilegesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseUserPrivileges | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseUserPrivileges | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // actions - computed: true, optional: false, required: false + public get actions() { + return this.getListAttribute('actions'); + } + + // resources - computed: true, optional: false, required: false + private _resources = new DdsDatabaseUserPrivilegesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } +} + +export class DdsDatabaseUserPrivilegesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseUserPrivilegesOutputReference { + return new DdsDatabaseUserPrivilegesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseUserRoles { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#db_name DdsDatabaseUser#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#name DdsDatabaseUser#name} + */ + readonly name: string; +} + +export function ddsDatabaseUserRolesToTerraform(struct?: DdsDatabaseUserRoles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + db_name: cdktf.stringToTerraform(struct!.dbName), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function ddsDatabaseUserRolesToHclTerraform(struct?: DdsDatabaseUserRoles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(struct!.dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsDatabaseUserRolesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsDatabaseUserRoles | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dbName !== undefined) { + hasAnyValues = true; + internalValueResult.dbName = this._dbName; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseUserRoles | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._dbName = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._dbName = value.dbName; + this._name = value.name; + } + } + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DdsDatabaseUserRolesList extends cdktf.ComplexList { + public internalValue? : DdsDatabaseUserRoles[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsDatabaseUserRolesOutputReference { + return new DdsDatabaseUserRolesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsDatabaseUserTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#create DdsDatabaseUser#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#delete DdsDatabaseUser#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#update DdsDatabaseUser#update} + */ + readonly update?: string; +} + +export function ddsDatabaseUserTimeoutsToTerraform(struct?: DdsDatabaseUserTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddsDatabaseUserTimeoutsToHclTerraform(struct?: DdsDatabaseUserTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsDatabaseUserTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsDatabaseUserTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsDatabaseUserTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user huaweicloud_dds_database_user} +*/ +export class DdsDatabaseUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_database_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsDatabaseUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsDatabaseUser to import + * @param importFromId The id of the existing DdsDatabaseUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsDatabaseUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_database_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_database_user huaweicloud_dds_database_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsDatabaseUserConfig + */ + public constructor(scope: Construct, id: string, config: DdsDatabaseUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_database_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._roles.internalValue = config.roles; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inherited_privileges - computed: true, optional: false, required: false + private _inheritedPrivileges = new DdsDatabaseUserInheritedPrivilegesList(this, "inherited_privileges", false); + public get inheritedPrivileges() { + return this._inheritedPrivileges; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // privileges - computed: true, optional: false, required: false + private _privileges = new DdsDatabaseUserPrivilegesList(this, "privileges", false); + public get privileges() { + return this._privileges; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roles - computed: false, optional: false, required: true + private _roles = new DdsDatabaseUserRolesList(this, "roles", false); + public get roles() { + return this._roles; + } + public putRoles(value: DdsDatabaseUserRoles[] | cdktf.IResolvable) { + this._roles.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsDatabaseUserTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsDatabaseUserTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + roles: cdktf.listMapper(ddsDatabaseUserRolesToTerraform, true)(this._roles.internalValue), + timeouts: ddsDatabaseUserTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(ddsDatabaseUserRolesToHclTerraform, true)(this._roles.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsDatabaseUserRolesList", + }, + timeouts: { + value: ddsDatabaseUserTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsDatabaseUserTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-eip-associate/README.md b/src/constructs/providers/huaweicloud/dds-instance-eip-associate/README.md new file mode 100644 index 00000000..6bb2b164 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate). diff --git a/src/constructs/providers/huaweicloud/dds-instance-eip-associate/index.ts b/src/constructs/providers/huaweicloud/dds-instance-eip-associate/index.ts new file mode 100644 index 00000000..4935127c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-eip-associate/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#id DdsInstanceEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#instance_id DdsInstanceEipAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#node_id DdsInstanceEipAssociate#node_id} + */ + readonly nodeId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#public_ip DdsInstanceEipAssociate#public_ip} + */ + readonly publicIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#region DdsInstanceEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#timeouts DdsInstanceEipAssociate#timeouts} + */ + readonly timeouts?: DdsInstanceEipAssociateTimeouts; +} +export interface DdsInstanceEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#create DdsInstanceEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#delete DdsInstanceEipAssociate#delete} + */ + readonly delete?: string; +} + +export function ddsInstanceEipAssociateTimeoutsToTerraform(struct?: DdsInstanceEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ddsInstanceEipAssociateTimeoutsToHclTerraform(struct?: DdsInstanceEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate huaweicloud_dds_instance_eip_associate} +*/ +export class DdsInstanceEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceEipAssociate to import + * @param importFromId The id of the existing DdsInstanceEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_eip_associate huaweicloud_dds_instance_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._publicIp = config.publicIp; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsInstanceEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsInstanceEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/README.md b/src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/README.md new file mode 100644 index 00000000..bf3435f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_internal_ip_modify` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_internal_ip_modify`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify). diff --git a/src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/index.ts b/src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/index.ts new file mode 100644 index 00000000..1e5a405c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-internal-ip-modify/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceInternalIpModifyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#id DdsInstanceInternalIpModify#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#instance_id DdsInstanceInternalIpModify#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#new_ip DdsInstanceInternalIpModify#new_ip} + */ + readonly newIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#node_id DdsInstanceInternalIpModify#node_id} + */ + readonly nodeId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#region DdsInstanceInternalIpModify#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#timeouts DdsInstanceInternalIpModify#timeouts} + */ + readonly timeouts?: DdsInstanceInternalIpModifyTimeouts; +} +export interface DdsInstanceInternalIpModifyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#create DdsInstanceInternalIpModify#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#update DdsInstanceInternalIpModify#update} + */ + readonly update?: string; +} + +export function ddsInstanceInternalIpModifyTimeoutsToTerraform(struct?: DdsInstanceInternalIpModifyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddsInstanceInternalIpModifyTimeoutsToHclTerraform(struct?: DdsInstanceInternalIpModifyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceInternalIpModifyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceInternalIpModifyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceInternalIpModifyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify huaweicloud_dds_instance_internal_ip_modify} +*/ +export class DdsInstanceInternalIpModify extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_internal_ip_modify"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceInternalIpModify resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceInternalIpModify to import + * @param importFromId The id of the existing DdsInstanceInternalIpModify that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceInternalIpModify to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_internal_ip_modify", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_internal_ip_modify huaweicloud_dds_instance_internal_ip_modify} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceInternalIpModifyConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceInternalIpModifyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_internal_ip_modify', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._newIp = config.newIp; + this._nodeId = config.nodeId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // new_ip - computed: false, optional: false, required: true + private _newIp?: string; + public get newIp() { + return this.getStringAttribute('new_ip'); + } + public set newIp(value: string) { + this._newIp = value; + } + // Temporarily expose input value. Use with caution. + public get newIpInput() { + return this._newIp; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceInternalIpModifyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceInternalIpModifyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + new_ip: cdktf.stringToTerraform(this._newIp), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsInstanceInternalIpModifyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + new_ip: { + value: cdktf.stringToHclTerraform(this._newIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsInstanceInternalIpModifyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceInternalIpModifyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-parameters-modify/README.md b/src/constructs/providers/huaweicloud/dds-instance-parameters-modify/README.md new file mode 100644 index 00000000..da0debfe --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-parameters-modify/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_parameters_modify` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_parameters_modify`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify). diff --git a/src/constructs/providers/huaweicloud/dds-instance-parameters-modify/index.ts b/src/constructs/providers/huaweicloud/dds-instance-parameters-modify/index.ts new file mode 100644 index 00000000..bd814ae2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-parameters-modify/index.ts @@ -0,0 +1,524 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceParametersModifyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#entity_id DdsInstanceParametersModify#entity_id} + */ + readonly entityId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#id DdsInstanceParametersModify#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#instance_id DdsInstanceParametersModify#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#region DdsInstanceParametersModify#region} + */ + readonly region?: string; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#parameters DdsInstanceParametersModify#parameters} + */ + readonly parameters: DdsInstanceParametersModifyParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#timeouts DdsInstanceParametersModify#timeouts} + */ + readonly timeouts?: DdsInstanceParametersModifyTimeouts; +} +export interface DdsInstanceParametersModifyParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#name DdsInstanceParametersModify#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#value DdsInstanceParametersModify#value} + */ + readonly value: string; +} + +export function ddsInstanceParametersModifyParametersToTerraform(struct?: DdsInstanceParametersModifyParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ddsInstanceParametersModifyParametersToHclTerraform(struct?: DdsInstanceParametersModifyParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceParametersModifyParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceParametersModifyParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceParametersModifyParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DdsInstanceParametersModifyParametersList extends cdktf.ComplexList { + public internalValue? : DdsInstanceParametersModifyParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceParametersModifyParametersOutputReference { + return new DdsInstanceParametersModifyParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceParametersModifyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#create DdsInstanceParametersModify#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#update DdsInstanceParametersModify#update} + */ + readonly update?: string; +} + +export function ddsInstanceParametersModifyTimeoutsToTerraform(struct?: DdsInstanceParametersModifyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddsInstanceParametersModifyTimeoutsToHclTerraform(struct?: DdsInstanceParametersModifyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceParametersModifyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceParametersModifyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceParametersModifyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify huaweicloud_dds_instance_parameters_modify} +*/ +export class DdsInstanceParametersModify extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_parameters_modify"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceParametersModify resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceParametersModify to import + * @param importFromId The id of the existing DdsInstanceParametersModify that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceParametersModify to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_parameters_modify", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_parameters_modify huaweicloud_dds_instance_parameters_modify} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceParametersModifyConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceParametersModifyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_parameters_modify', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._entityId = config.entityId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // entity_id - computed: false, optional: true, required: false + private _entityId?: string; + public get entityId() { + return this.getStringAttribute('entity_id'); + } + public set entityId(value: string) { + this._entityId = value; + } + public resetEntityId() { + this._entityId = undefined; + } + // Temporarily expose input value. Use with caution. + public get entityIdInput() { + return this._entityId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // parameters - computed: false, optional: false, required: true + private _parameters = new DdsInstanceParametersModifyParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: DdsInstanceParametersModifyParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceParametersModifyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceParametersModifyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + entity_id: cdktf.stringToTerraform(this._entityId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + parameters: cdktf.listMapper(ddsInstanceParametersModifyParametersToTerraform, true)(this._parameters.internalValue), + timeouts: ddsInstanceParametersModifyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + entity_id: { + value: cdktf.stringToHclTerraform(this._entityId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.listMapperHcl(ddsInstanceParametersModifyParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "DdsInstanceParametersModifyParametersList", + }, + timeouts: { + value: ddsInstanceParametersModifyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceParametersModifyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-recovery/README.md b/src/constructs/providers/huaweicloud/dds-instance-recovery/README.md new file mode 100644 index 00000000..159038c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-recovery/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_recovery` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_recovery`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery). diff --git a/src/constructs/providers/huaweicloud/dds-instance-recovery/index.ts b/src/constructs/providers/huaweicloud/dds-instance-recovery/index.ts new file mode 100644 index 00000000..62ccf7b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-recovery/index.ts @@ -0,0 +1,374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceRecoveryConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#backup_id DdsInstanceRecovery#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#id DdsInstanceRecovery#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#region DdsInstanceRecovery#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#restore_time DdsInstanceRecovery#restore_time} + */ + readonly restoreTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#source_id DdsInstanceRecovery#source_id} + */ + readonly sourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#target_id DdsInstanceRecovery#target_id} + */ + readonly targetId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#timeouts DdsInstanceRecovery#timeouts} + */ + readonly timeouts?: DdsInstanceRecoveryTimeouts; +} +export interface DdsInstanceRecoveryTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#create DdsInstanceRecovery#create} + */ + readonly create?: string; +} + +export function ddsInstanceRecoveryTimeoutsToTerraform(struct?: DdsInstanceRecoveryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsInstanceRecoveryTimeoutsToHclTerraform(struct?: DdsInstanceRecoveryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceRecoveryTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceRecoveryTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceRecoveryTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery huaweicloud_dds_instance_recovery} +*/ +export class DdsInstanceRecovery extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_recovery"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceRecovery resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceRecovery to import + * @param importFromId The id of the existing DdsInstanceRecovery that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceRecovery to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_recovery", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_recovery huaweicloud_dds_instance_recovery} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceRecoveryConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceRecoveryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_recovery', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._id = config.id; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._sourceId = config.sourceId; + this._targetId = config.targetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: true, required: false + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + public resetRestoreTime() { + this._restoreTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // source_id - computed: false, optional: false, required: true + private _sourceId?: string; + public get sourceId() { + return this.getStringAttribute('source_id'); + } + public set sourceId(value: string) { + this._sourceId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceIdInput() { + return this._sourceId; + } + + // target_id - computed: false, optional: false, required: true + private _targetId?: string; + public get targetId() { + return this.getStringAttribute('target_id'); + } + public set targetId(value: string) { + this._targetId = value; + } + // Temporarily expose input value. Use with caution. + public get targetIdInput() { + return this._targetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceRecoveryTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceRecoveryTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + source_id: cdktf.stringToTerraform(this._sourceId), + target_id: cdktf.stringToTerraform(this._targetId), + timeouts: ddsInstanceRecoveryTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_id: { + value: cdktf.stringToHclTerraform(this._sourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_id: { + value: cdktf.stringToHclTerraform(this._targetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsInstanceRecoveryTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceRecoveryTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-restart/README.md b/src/constructs/providers/huaweicloud/dds-instance-restart/README.md new file mode 100644 index 00000000..9b65cf59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart). diff --git a/src/constructs/providers/huaweicloud/dds-instance-restart/index.ts b/src/constructs/providers/huaweicloud/dds-instance-restart/index.ts new file mode 100644 index 00000000..8a6fff97 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-restart/index.ts @@ -0,0 +1,349 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#id DdsInstanceRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#instance_id DdsInstanceRestart#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#region DdsInstanceRestart#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#target_id DdsInstanceRestart#target_id} + */ + readonly targetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#target_type DdsInstanceRestart#target_type} + */ + readonly targetType?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#timeouts DdsInstanceRestart#timeouts} + */ + readonly timeouts?: DdsInstanceRestartTimeouts; +} +export interface DdsInstanceRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#create DdsInstanceRestart#create} + */ + readonly create?: string; +} + +export function ddsInstanceRestartTimeoutsToTerraform(struct?: DdsInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsInstanceRestartTimeoutsToHclTerraform(struct?: DdsInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart huaweicloud_dds_instance_restart} +*/ +export class DdsInstanceRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceRestart to import + * @param importFromId The id of the existing DdsInstanceRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restart huaweicloud_dds_instance_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceRestartConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._targetId = config.targetId; + this._targetType = config.targetType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // target_id - computed: false, optional: true, required: false + private _targetId?: string; + public get targetId() { + return this.getStringAttribute('target_id'); + } + public set targetId(value: string) { + this._targetId = value; + } + public resetTargetId() { + this._targetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetIdInput() { + return this._targetId; + } + + // target_type - computed: false, optional: true, required: false + private _targetType?: string; + public get targetType() { + return this.getStringAttribute('target_type'); + } + public set targetType(value: string) { + this._targetType = value; + } + public resetTargetType() { + this._targetType = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetTypeInput() { + return this._targetType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + target_id: cdktf.stringToTerraform(this._targetId), + target_type: cdktf.stringToTerraform(this._targetType), + timeouts: ddsInstanceRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_id: { + value: cdktf.stringToHclTerraform(this._targetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_type: { + value: cdktf.stringToHclTerraform(this._targetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsInstanceRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-restore/README.md b/src/constructs/providers/huaweicloud/dds-instance-restore/README.md new file mode 100644 index 00000000..b14b1324 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore). diff --git a/src/constructs/providers/huaweicloud/dds-instance-restore/index.ts b/src/constructs/providers/huaweicloud/dds-instance-restore/index.ts new file mode 100644 index 00000000..ec34d8d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-restore/index.ts @@ -0,0 +1,374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#backup_id DdsInstanceRestore#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#id DdsInstanceRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#region DdsInstanceRestore#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#restore_time DdsInstanceRestore#restore_time} + */ + readonly restoreTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#source_id DdsInstanceRestore#source_id} + */ + readonly sourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#target_id DdsInstanceRestore#target_id} + */ + readonly targetId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#timeouts DdsInstanceRestore#timeouts} + */ + readonly timeouts?: DdsInstanceRestoreTimeouts; +} +export interface DdsInstanceRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#create DdsInstanceRestore#create} + */ + readonly create?: string; +} + +export function ddsInstanceRestoreTimeoutsToTerraform(struct?: DdsInstanceRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsInstanceRestoreTimeoutsToHclTerraform(struct?: DdsInstanceRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore huaweicloud_dds_instance_restore} +*/ +export class DdsInstanceRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceRestore to import + * @param importFromId The id of the existing DdsInstanceRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_restore huaweicloud_dds_instance_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceRestoreConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._id = config.id; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._sourceId = config.sourceId; + this._targetId = config.targetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: true, required: false + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + public resetRestoreTime() { + this._restoreTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // source_id - computed: false, optional: false, required: true + private _sourceId?: string; + public get sourceId() { + return this.getStringAttribute('source_id'); + } + public set sourceId(value: string) { + this._sourceId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceIdInput() { + return this._sourceId; + } + + // target_id - computed: false, optional: false, required: true + private _targetId?: string; + public get targetId() { + return this.getStringAttribute('target_id'); + } + public set targetId(value: string) { + this._targetId = value; + } + // Temporarily expose input value. Use with caution. + public get targetIdInput() { + return this._targetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + source_id: cdktf.stringToTerraform(this._sourceId), + target_id: cdktf.stringToTerraform(this._targetId), + timeouts: ddsInstanceRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_id: { + value: cdktf.stringToHclTerraform(this._sourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_id: { + value: cdktf.stringToHclTerraform(this._targetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsInstanceRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance-v3/README.md b/src/constructs/providers/huaweicloud/dds-instance-v3/README.md new file mode 100644 index 00000000..3bb6e695 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3). diff --git a/src/constructs/providers/huaweicloud/dds-instance-v3/index.ts b/src/constructs/providers/huaweicloud/dds-instance-v3/index.ts new file mode 100644 index 00000000..85bac183 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance-v3/index.ts @@ -0,0 +1,2212 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#auto_pay DdsInstanceV3#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#auto_renew DdsInstanceV3#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#availability_zone DdsInstanceV3#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#balancer_active_begin DdsInstanceV3#balancer_active_begin} + */ + readonly balancerActiveBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#balancer_active_end DdsInstanceV3#balancer_active_end} + */ + readonly balancerActiveEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#balancer_status DdsInstanceV3#balancer_status} + */ + readonly balancerStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#charging_mode DdsInstanceV3#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#client_network_ranges DdsInstanceV3#client_network_ranges} + */ + readonly clientNetworkRanges?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#description DdsInstanceV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#disk_encryption_id DdsInstanceV3#disk_encryption_id} + */ + readonly diskEncryptionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#enterprise_project_id DdsInstanceV3#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#id DdsInstanceV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#maintain_begin DdsInstanceV3#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#maintain_end DdsInstanceV3#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#mode DdsInstanceV3#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#name DdsInstanceV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#password DdsInstanceV3#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#period DdsInstanceV3#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#period_unit DdsInstanceV3#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#port DdsInstanceV3#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#region DdsInstanceV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#replica_set_name DdsInstanceV3#replica_set_name} + */ + readonly replicaSetName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#second_level_monitoring_enabled DdsInstanceV3#second_level_monitoring_enabled} + */ + readonly secondLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#security_group_id DdsInstanceV3#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#slow_log_desensitization DdsInstanceV3#slow_log_desensitization} + */ + readonly slowLogDesensitization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#ssl DdsInstanceV3#ssl} + */ + readonly ssl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#subnet_id DdsInstanceV3#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#tags DdsInstanceV3#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#vpc_id DdsInstanceV3#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#backup_strategy DdsInstanceV3#backup_strategy} + */ + readonly backupStrategy?: DdsInstanceV3BackupStrategy; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#configuration DdsInstanceV3#configuration} + */ + readonly configuration?: DdsInstanceV3Configuration[] | cdktf.IResolvable; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#datastore DdsInstanceV3#datastore} + */ + readonly datastore: DdsInstanceV3Datastore; + /** + * flavor block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#flavor DdsInstanceV3#flavor} + */ + readonly flavor: DdsInstanceV3Flavor[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#timeouts DdsInstanceV3#timeouts} + */ + readonly timeouts?: DdsInstanceV3Timeouts; +} +export interface DdsInstanceV3GroupsNodes { +} + +export function ddsInstanceV3GroupsNodesToTerraform(struct?: DdsInstanceV3GroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsInstanceV3GroupsNodesToHclTerraform(struct?: DdsInstanceV3GroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsInstanceV3GroupsNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceV3GroupsNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3GroupsNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DdsInstanceV3GroupsNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceV3GroupsNodesOutputReference { + return new DdsInstanceV3GroupsNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceV3Groups { +} + +export function ddsInstanceV3GroupsToTerraform(struct?: DdsInstanceV3Groups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsInstanceV3GroupsToHclTerraform(struct?: DdsInstanceV3Groups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsInstanceV3GroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceV3Groups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3Groups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DdsInstanceV3GroupsNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getStringAttribute('used'); + } +} + +export class DdsInstanceV3GroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceV3GroupsOutputReference { + return new DdsInstanceV3GroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceV3Nodes { +} + +export function ddsInstanceV3NodesToTerraform(struct?: DdsInstanceV3Nodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsInstanceV3NodesToHclTerraform(struct?: DdsInstanceV3Nodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsInstanceV3NodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceV3Nodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3Nodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DdsInstanceV3NodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceV3NodesOutputReference { + return new DdsInstanceV3NodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceV3BackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#keep_days DdsInstanceV3#keep_days} + */ + readonly keepDays: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#period DdsInstanceV3#period} + */ + readonly period?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#start_time DdsInstanceV3#start_time} + */ + readonly startTime: string; +} + +export function ddsInstanceV3BackupStrategyToTerraform(struct?: DdsInstanceV3BackupStrategyOutputReference | DdsInstanceV3BackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + period: cdktf.stringToTerraform(struct!.period), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function ddsInstanceV3BackupStrategyToHclTerraform(struct?: DdsInstanceV3BackupStrategyOutputReference | DdsInstanceV3BackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period: { + value: cdktf.stringToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceV3BackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DdsInstanceV3BackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3BackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._period = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._period = value.period; + this._startTime = value.startTime; + } + } + + // keep_days - computed: false, optional: false, required: true + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // period - computed: true, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface DdsInstanceV3Configuration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#id DdsInstanceV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#type DdsInstanceV3#type} + */ + readonly type: string; +} + +export function ddsInstanceV3ConfigurationToTerraform(struct?: DdsInstanceV3Configuration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ddsInstanceV3ConfigurationToHclTerraform(struct?: DdsInstanceV3Configuration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceV3ConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceV3Configuration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3Configuration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DdsInstanceV3ConfigurationList extends cdktf.ComplexList { + public internalValue? : DdsInstanceV3Configuration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceV3ConfigurationOutputReference { + return new DdsInstanceV3ConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceV3Datastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#storage_engine DdsInstanceV3#storage_engine} + */ + readonly storageEngine?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#type DdsInstanceV3#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#version DdsInstanceV3#version} + */ + readonly version: string; +} + +export function ddsInstanceV3DatastoreToTerraform(struct?: DdsInstanceV3DatastoreOutputReference | DdsInstanceV3Datastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + storage_engine: cdktf.stringToTerraform(struct!.storageEngine), + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function ddsInstanceV3DatastoreToHclTerraform(struct?: DdsInstanceV3DatastoreOutputReference | DdsInstanceV3Datastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + storage_engine: { + value: cdktf.stringToHclTerraform(struct!.storageEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceV3DatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DdsInstanceV3Datastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._storageEngine !== undefined) { + hasAnyValues = true; + internalValueResult.storageEngine = this._storageEngine; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3Datastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._storageEngine = undefined; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._storageEngine = value.storageEngine; + this._type = value.type; + this._version = value.version; + } + } + + // storage_engine - computed: false, optional: true, required: false + private _storageEngine?: string; + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + public set storageEngine(value: string) { + this._storageEngine = value; + } + public resetStorageEngine() { + this._storageEngine = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageEngineInput() { + return this._storageEngine; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface DdsInstanceV3Flavor { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#num DdsInstanceV3#num} + */ + readonly num: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#size DdsInstanceV3#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#spec_code DdsInstanceV3#spec_code} + */ + readonly specCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#storage DdsInstanceV3#storage} + */ + readonly storage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#type DdsInstanceV3#type} + */ + readonly type: string; +} + +export function ddsInstanceV3FlavorToTerraform(struct?: DdsInstanceV3Flavor | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + num: cdktf.numberToTerraform(struct!.num), + size: cdktf.numberToTerraform(struct!.size), + spec_code: cdktf.stringToTerraform(struct!.specCode), + storage: cdktf.stringToTerraform(struct!.storage), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ddsInstanceV3FlavorToHclTerraform(struct?: DdsInstanceV3Flavor | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + num: { + value: cdktf.numberToHclTerraform(struct!.num), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spec_code: { + value: cdktf.stringToHclTerraform(struct!.specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage: { + value: cdktf.stringToHclTerraform(struct!.storage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceV3FlavorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceV3Flavor | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._num !== undefined) { + hasAnyValues = true; + internalValueResult.num = this._num; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._specCode !== undefined) { + hasAnyValues = true; + internalValueResult.specCode = this._specCode; + } + if (this._storage !== undefined) { + hasAnyValues = true; + internalValueResult.storage = this._storage; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3Flavor | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._num = undefined; + this._size = undefined; + this._specCode = undefined; + this._storage = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._num = value.num; + this._size = value.size; + this._specCode = value.specCode; + this._storage = value.storage; + this._type = value.type; + } + } + + // num - computed: false, optional: false, required: true + private _num?: number; + public get num() { + return this.getNumberAttribute('num'); + } + public set num(value: number) { + this._num = value; + } + // Temporarily expose input value. Use with caution. + public get numInput() { + return this._num; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // spec_code - computed: false, optional: false, required: true + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // storage - computed: false, optional: true, required: false + private _storage?: string; + public get storage() { + return this.getStringAttribute('storage'); + } + public set storage(value: string) { + this._storage = value; + } + public resetStorage() { + this._storage = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DdsInstanceV3FlavorList extends cdktf.ComplexList { + public internalValue? : DdsInstanceV3Flavor[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceV3FlavorOutputReference { + return new DdsInstanceV3FlavorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceV3Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#create DdsInstanceV3#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#delete DdsInstanceV3#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#update DdsInstanceV3#update} + */ + readonly update?: string; +} + +export function ddsInstanceV3TimeoutsToTerraform(struct?: DdsInstanceV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddsInstanceV3TimeoutsToHclTerraform(struct?: DdsInstanceV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceV3TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceV3Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceV3Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3 huaweicloud_dds_instance_v3} +*/ +export class DdsInstanceV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstanceV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstanceV3 to import + * @param importFromId The id of the existing DdsInstanceV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstanceV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance_v3 huaweicloud_dds_instance_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceV3Config + */ + public constructor(scope: Construct, id: string, config: DdsInstanceV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._balancerActiveBegin = config.balancerActiveBegin; + this._balancerActiveEnd = config.balancerActiveEnd; + this._balancerStatus = config.balancerStatus; + this._chargingMode = config.chargingMode; + this._clientNetworkRanges = config.clientNetworkRanges; + this._description = config.description; + this._diskEncryptionId = config.diskEncryptionId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._mode = config.mode; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._region = config.region; + this._replicaSetName = config.replicaSetName; + this._secondLevelMonitoringEnabled = config.secondLevelMonitoringEnabled; + this._securityGroupId = config.securityGroupId; + this._slowLogDesensitization = config.slowLogDesensitization; + this._ssl = config.ssl; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._configuration.internalValue = config.configuration; + this._datastore.internalValue = config.datastore; + this._flavor.internalValue = config.flavor; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // balancer_active_begin - computed: false, optional: true, required: false + private _balancerActiveBegin?: string; + public get balancerActiveBegin() { + return this.getStringAttribute('balancer_active_begin'); + } + public set balancerActiveBegin(value: string) { + this._balancerActiveBegin = value; + } + public resetBalancerActiveBegin() { + this._balancerActiveBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get balancerActiveBeginInput() { + return this._balancerActiveBegin; + } + + // balancer_active_end - computed: false, optional: true, required: false + private _balancerActiveEnd?: string; + public get balancerActiveEnd() { + return this.getStringAttribute('balancer_active_end'); + } + public set balancerActiveEnd(value: string) { + this._balancerActiveEnd = value; + } + public resetBalancerActiveEnd() { + this._balancerActiveEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get balancerActiveEndInput() { + return this._balancerActiveEnd; + } + + // balancer_status - computed: true, optional: true, required: false + private _balancerStatus?: string; + public get balancerStatus() { + return this.getStringAttribute('balancer_status'); + } + public set balancerStatus(value: string) { + this._balancerStatus = value; + } + public resetBalancerStatus() { + this._balancerStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get balancerStatusInput() { + return this._balancerStatus; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // client_network_ranges - computed: false, optional: true, required: false + private _clientNetworkRanges?: string[]; + public get clientNetworkRanges() { + return cdktf.Fn.tolist(this.getListAttribute('client_network_ranges')); + } + public set clientNetworkRanges(value: string[]) { + this._clientNetworkRanges = value; + } + public resetClientNetworkRanges() { + this._clientNetworkRanges = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientNetworkRangesInput() { + return this._clientNetworkRanges; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // db_username - computed: true, optional: false, required: false + public get dbUsername() { + return this.getStringAttribute('db_username'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_encryption_id - computed: false, optional: true, required: false + private _diskEncryptionId?: string; + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + public set diskEncryptionId(value: string) { + this._diskEncryptionId = value; + } + public resetDiskEncryptionId() { + this._diskEncryptionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskEncryptionIdInput() { + return this._diskEncryptionId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DdsInstanceV3GroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DdsInstanceV3NodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replica_set_name - computed: true, optional: true, required: false + private _replicaSetName?: string; + public get replicaSetName() { + return this.getStringAttribute('replica_set_name'); + } + public set replicaSetName(value: string) { + this._replicaSetName = value; + } + public resetReplicaSetName() { + this._replicaSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicaSetNameInput() { + return this._replicaSetName; + } + + // second_level_monitoring_enabled - computed: true, optional: true, required: false + private _secondLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + public get secondLevelMonitoringEnabled() { + return this.getBooleanAttribute('second_level_monitoring_enabled'); + } + public set secondLevelMonitoringEnabled(value: boolean | cdktf.IResolvable) { + this._secondLevelMonitoringEnabled = value; + } + public resetSecondLevelMonitoringEnabled() { + this._secondLevelMonitoringEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondLevelMonitoringEnabledInput() { + return this._secondLevelMonitoringEnabled; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // slow_log_desensitization - computed: true, optional: true, required: false + private _slowLogDesensitization?: string; + public get slowLogDesensitization() { + return this.getStringAttribute('slow_log_desensitization'); + } + public set slowLogDesensitization(value: string) { + this._slowLogDesensitization = value; + } + public resetSlowLogDesensitization() { + this._slowLogDesensitization = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowLogDesensitizationInput() { + return this._slowLogDesensitization; + } + + // ssl - computed: false, optional: true, required: false + private _ssl?: boolean | cdktf.IResolvable; + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + public set ssl(value: boolean | cdktf.IResolvable) { + this._ssl = value; + } + public resetSsl() { + this._ssl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslInput() { + return this._ssl; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new DdsInstanceV3BackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: DdsInstanceV3BackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // configuration - computed: false, optional: true, required: false + private _configuration = new DdsInstanceV3ConfigurationList(this, "configuration", false); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: DdsInstanceV3Configuration[] | cdktf.IResolvable) { + this._configuration.internalValue = value; + } + public resetConfiguration() { + this._configuration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } + + // datastore - computed: false, optional: false, required: true + private _datastore = new DdsInstanceV3DatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: DdsInstanceV3Datastore) { + this._datastore.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // flavor - computed: false, optional: false, required: true + private _flavor = new DdsInstanceV3FlavorList(this, "flavor", false); + public get flavor() { + return this._flavor; + } + public putFlavor(value: DdsInstanceV3Flavor[] | cdktf.IResolvable) { + this._flavor.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceV3TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceV3Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + balancer_active_begin: cdktf.stringToTerraform(this._balancerActiveBegin), + balancer_active_end: cdktf.stringToTerraform(this._balancerActiveEnd), + balancer_status: cdktf.stringToTerraform(this._balancerStatus), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + client_network_ranges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._clientNetworkRanges), + description: cdktf.stringToTerraform(this._description), + disk_encryption_id: cdktf.stringToTerraform(this._diskEncryptionId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + mode: cdktf.stringToTerraform(this._mode), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + replica_set_name: cdktf.stringToTerraform(this._replicaSetName), + second_level_monitoring_enabled: cdktf.booleanToTerraform(this._secondLevelMonitoringEnabled), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + slow_log_desensitization: cdktf.stringToTerraform(this._slowLogDesensitization), + ssl: cdktf.booleanToTerraform(this._ssl), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: ddsInstanceV3BackupStrategyToTerraform(this._backupStrategy.internalValue), + configuration: cdktf.listMapper(ddsInstanceV3ConfigurationToTerraform, true)(this._configuration.internalValue), + datastore: ddsInstanceV3DatastoreToTerraform(this._datastore.internalValue), + flavor: cdktf.listMapper(ddsInstanceV3FlavorToTerraform, true)(this._flavor.internalValue), + timeouts: ddsInstanceV3TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + balancer_active_begin: { + value: cdktf.stringToHclTerraform(this._balancerActiveBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + balancer_active_end: { + value: cdktf.stringToHclTerraform(this._balancerActiveEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + balancer_status: { + value: cdktf.stringToHclTerraform(this._balancerStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_network_ranges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._clientNetworkRanges), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk_encryption_id: { + value: cdktf.stringToHclTerraform(this._diskEncryptionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replica_set_name: { + value: cdktf.stringToHclTerraform(this._replicaSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + second_level_monitoring_enabled: { + value: cdktf.booleanToHclTerraform(this._secondLevelMonitoringEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slow_log_desensitization: { + value: cdktf.stringToHclTerraform(this._slowLogDesensitization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl: { + value: cdktf.booleanToHclTerraform(this._ssl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: ddsInstanceV3BackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceV3BackupStrategyList", + }, + configuration: { + value: cdktf.listMapperHcl(ddsInstanceV3ConfigurationToHclTerraform, true)(this._configuration.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceV3ConfigurationList", + }, + datastore: { + value: ddsInstanceV3DatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceV3DatastoreList", + }, + flavor: { + value: cdktf.listMapperHcl(ddsInstanceV3FlavorToHclTerraform, true)(this._flavor.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceV3FlavorList", + }, + timeouts: { + value: ddsInstanceV3TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceV3Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-instance/README.md b/src/constructs/providers/huaweicloud/dds-instance/README.md new file mode 100644 index 00000000..500ae212 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance). diff --git a/src/constructs/providers/huaweicloud/dds-instance/index.ts b/src/constructs/providers/huaweicloud/dds-instance/index.ts new file mode 100644 index 00000000..99274cdf --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-instance/index.ts @@ -0,0 +1,2212 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#auto_pay DdsInstance#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#auto_renew DdsInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#availability_zone DdsInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#balancer_active_begin DdsInstance#balancer_active_begin} + */ + readonly balancerActiveBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#balancer_active_end DdsInstance#balancer_active_end} + */ + readonly balancerActiveEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#balancer_status DdsInstance#balancer_status} + */ + readonly balancerStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#charging_mode DdsInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#client_network_ranges DdsInstance#client_network_ranges} + */ + readonly clientNetworkRanges?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#description DdsInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#disk_encryption_id DdsInstance#disk_encryption_id} + */ + readonly diskEncryptionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#enterprise_project_id DdsInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#id DdsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#maintain_begin DdsInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#maintain_end DdsInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#mode DdsInstance#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#name DdsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#password DdsInstance#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#period DdsInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#period_unit DdsInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#port DdsInstance#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#region DdsInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#replica_set_name DdsInstance#replica_set_name} + */ + readonly replicaSetName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#second_level_monitoring_enabled DdsInstance#second_level_monitoring_enabled} + */ + readonly secondLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#security_group_id DdsInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#slow_log_desensitization DdsInstance#slow_log_desensitization} + */ + readonly slowLogDesensitization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#ssl DdsInstance#ssl} + */ + readonly ssl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#subnet_id DdsInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#tags DdsInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#vpc_id DdsInstance#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#backup_strategy DdsInstance#backup_strategy} + */ + readonly backupStrategy?: DdsInstanceBackupStrategy; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#configuration DdsInstance#configuration} + */ + readonly configuration?: DdsInstanceConfiguration[] | cdktf.IResolvable; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#datastore DdsInstance#datastore} + */ + readonly datastore: DdsInstanceDatastore; + /** + * flavor block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#flavor DdsInstance#flavor} + */ + readonly flavor: DdsInstanceFlavor[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#timeouts DdsInstance#timeouts} + */ + readonly timeouts?: DdsInstanceTimeouts; +} +export interface DdsInstanceGroupsNodes { +} + +export function ddsInstanceGroupsNodesToTerraform(struct?: DdsInstanceGroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsInstanceGroupsNodesToHclTerraform(struct?: DdsInstanceGroupsNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsInstanceGroupsNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceGroupsNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceGroupsNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DdsInstanceGroupsNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceGroupsNodesOutputReference { + return new DdsInstanceGroupsNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceGroups { +} + +export function ddsInstanceGroupsToTerraform(struct?: DdsInstanceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsInstanceGroupsToHclTerraform(struct?: DdsInstanceGroups): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsInstanceGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceGroups | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceGroups | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DdsInstanceGroupsNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used - computed: true, optional: false, required: false + public get used() { + return this.getStringAttribute('used'); + } +} + +export class DdsInstanceGroupsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceGroupsOutputReference { + return new DdsInstanceGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceNodes { +} + +export function ddsInstanceNodesToTerraform(struct?: DdsInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsInstanceNodesToHclTerraform(struct?: DdsInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class DdsInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceNodesOutputReference { + return new DdsInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#keep_days DdsInstance#keep_days} + */ + readonly keepDays: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#period DdsInstance#period} + */ + readonly period?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#start_time DdsInstance#start_time} + */ + readonly startTime: string; +} + +export function ddsInstanceBackupStrategyToTerraform(struct?: DdsInstanceBackupStrategyOutputReference | DdsInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + period: cdktf.stringToTerraform(struct!.period), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function ddsInstanceBackupStrategyToHclTerraform(struct?: DdsInstanceBackupStrategyOutputReference | DdsInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period: { + value: cdktf.stringToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DdsInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._period = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._period = value.period; + this._startTime = value.startTime; + } + } + + // keep_days - computed: false, optional: false, required: true + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // period - computed: true, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface DdsInstanceConfiguration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#id DdsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#type DdsInstance#type} + */ + readonly type: string; +} + +export function ddsInstanceConfigurationToTerraform(struct?: DdsInstanceConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ddsInstanceConfigurationToHclTerraform(struct?: DdsInstanceConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceConfiguration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceConfiguration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DdsInstanceConfigurationList extends cdktf.ComplexList { + public internalValue? : DdsInstanceConfiguration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceConfigurationOutputReference { + return new DdsInstanceConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#storage_engine DdsInstance#storage_engine} + */ + readonly storageEngine?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#type DdsInstance#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#version DdsInstance#version} + */ + readonly version: string; +} + +export function ddsInstanceDatastoreToTerraform(struct?: DdsInstanceDatastoreOutputReference | DdsInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + storage_engine: cdktf.stringToTerraform(struct!.storageEngine), + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function ddsInstanceDatastoreToHclTerraform(struct?: DdsInstanceDatastoreOutputReference | DdsInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + storage_engine: { + value: cdktf.stringToHclTerraform(struct!.storageEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DdsInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._storageEngine !== undefined) { + hasAnyValues = true; + internalValueResult.storageEngine = this._storageEngine; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._storageEngine = undefined; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._storageEngine = value.storageEngine; + this._type = value.type; + this._version = value.version; + } + } + + // storage_engine - computed: false, optional: true, required: false + private _storageEngine?: string; + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + public set storageEngine(value: string) { + this._storageEngine = value; + } + public resetStorageEngine() { + this._storageEngine = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageEngineInput() { + return this._storageEngine; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface DdsInstanceFlavor { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#num DdsInstance#num} + */ + readonly num: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#size DdsInstance#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#spec_code DdsInstance#spec_code} + */ + readonly specCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#storage DdsInstance#storage} + */ + readonly storage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#type DdsInstance#type} + */ + readonly type: string; +} + +export function ddsInstanceFlavorToTerraform(struct?: DdsInstanceFlavor | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + num: cdktf.numberToTerraform(struct!.num), + size: cdktf.numberToTerraform(struct!.size), + spec_code: cdktf.stringToTerraform(struct!.specCode), + storage: cdktf.stringToTerraform(struct!.storage), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ddsInstanceFlavorToHclTerraform(struct?: DdsInstanceFlavor | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + num: { + value: cdktf.numberToHclTerraform(struct!.num), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spec_code: { + value: cdktf.stringToHclTerraform(struct!.specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage: { + value: cdktf.stringToHclTerraform(struct!.storage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceFlavorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsInstanceFlavor | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._num !== undefined) { + hasAnyValues = true; + internalValueResult.num = this._num; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._specCode !== undefined) { + hasAnyValues = true; + internalValueResult.specCode = this._specCode; + } + if (this._storage !== undefined) { + hasAnyValues = true; + internalValueResult.storage = this._storage; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceFlavor | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._num = undefined; + this._size = undefined; + this._specCode = undefined; + this._storage = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._num = value.num; + this._size = value.size; + this._specCode = value.specCode; + this._storage = value.storage; + this._type = value.type; + } + } + + // num - computed: false, optional: false, required: true + private _num?: number; + public get num() { + return this.getNumberAttribute('num'); + } + public set num(value: number) { + this._num = value; + } + // Temporarily expose input value. Use with caution. + public get numInput() { + return this._num; + } + + // size - computed: false, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // spec_code - computed: false, optional: false, required: true + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // storage - computed: false, optional: true, required: false + private _storage?: string; + public get storage() { + return this.getStringAttribute('storage'); + } + public set storage(value: string) { + this._storage = value; + } + public resetStorage() { + this._storage = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DdsInstanceFlavorList extends cdktf.ComplexList { + public internalValue? : DdsInstanceFlavor[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsInstanceFlavorOutputReference { + return new DdsInstanceFlavorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DdsInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#create DdsInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#delete DdsInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#update DdsInstance#update} + */ + readonly update?: string; +} + +export function ddsInstanceTimeoutsToTerraform(struct?: DdsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ddsInstanceTimeoutsToHclTerraform(struct?: DdsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance huaweicloud_dds_instance} +*/ +export class DdsInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsInstance to import + * @param importFromId The id of the existing DdsInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_instance huaweicloud_dds_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DdsInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._balancerActiveBegin = config.balancerActiveBegin; + this._balancerActiveEnd = config.balancerActiveEnd; + this._balancerStatus = config.balancerStatus; + this._chargingMode = config.chargingMode; + this._clientNetworkRanges = config.clientNetworkRanges; + this._description = config.description; + this._diskEncryptionId = config.diskEncryptionId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._mode = config.mode; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._region = config.region; + this._replicaSetName = config.replicaSetName; + this._secondLevelMonitoringEnabled = config.secondLevelMonitoringEnabled; + this._securityGroupId = config.securityGroupId; + this._slowLogDesensitization = config.slowLogDesensitization; + this._ssl = config.ssl; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._configuration.internalValue = config.configuration; + this._datastore.internalValue = config.datastore; + this._flavor.internalValue = config.flavor; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // balancer_active_begin - computed: false, optional: true, required: false + private _balancerActiveBegin?: string; + public get balancerActiveBegin() { + return this.getStringAttribute('balancer_active_begin'); + } + public set balancerActiveBegin(value: string) { + this._balancerActiveBegin = value; + } + public resetBalancerActiveBegin() { + this._balancerActiveBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get balancerActiveBeginInput() { + return this._balancerActiveBegin; + } + + // balancer_active_end - computed: false, optional: true, required: false + private _balancerActiveEnd?: string; + public get balancerActiveEnd() { + return this.getStringAttribute('balancer_active_end'); + } + public set balancerActiveEnd(value: string) { + this._balancerActiveEnd = value; + } + public resetBalancerActiveEnd() { + this._balancerActiveEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get balancerActiveEndInput() { + return this._balancerActiveEnd; + } + + // balancer_status - computed: true, optional: true, required: false + private _balancerStatus?: string; + public get balancerStatus() { + return this.getStringAttribute('balancer_status'); + } + public set balancerStatus(value: string) { + this._balancerStatus = value; + } + public resetBalancerStatus() { + this._balancerStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get balancerStatusInput() { + return this._balancerStatus; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // client_network_ranges - computed: false, optional: true, required: false + private _clientNetworkRanges?: string[]; + public get clientNetworkRanges() { + return cdktf.Fn.tolist(this.getListAttribute('client_network_ranges')); + } + public set clientNetworkRanges(value: string[]) { + this._clientNetworkRanges = value; + } + public resetClientNetworkRanges() { + this._clientNetworkRanges = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientNetworkRangesInput() { + return this._clientNetworkRanges; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // db_username - computed: true, optional: false, required: false + public get dbUsername() { + return this.getStringAttribute('db_username'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_encryption_id - computed: false, optional: true, required: false + private _diskEncryptionId?: string; + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + public set diskEncryptionId(value: string) { + this._diskEncryptionId = value; + } + public resetDiskEncryptionId() { + this._diskEncryptionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskEncryptionIdInput() { + return this._diskEncryptionId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // groups - computed: true, optional: false, required: false + private _groups = new DdsInstanceGroupsList(this, "groups", false); + public get groups() { + return this._groups; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new DdsInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replica_set_name - computed: true, optional: true, required: false + private _replicaSetName?: string; + public get replicaSetName() { + return this.getStringAttribute('replica_set_name'); + } + public set replicaSetName(value: string) { + this._replicaSetName = value; + } + public resetReplicaSetName() { + this._replicaSetName = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicaSetNameInput() { + return this._replicaSetName; + } + + // second_level_monitoring_enabled - computed: true, optional: true, required: false + private _secondLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + public get secondLevelMonitoringEnabled() { + return this.getBooleanAttribute('second_level_monitoring_enabled'); + } + public set secondLevelMonitoringEnabled(value: boolean | cdktf.IResolvable) { + this._secondLevelMonitoringEnabled = value; + } + public resetSecondLevelMonitoringEnabled() { + this._secondLevelMonitoringEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondLevelMonitoringEnabledInput() { + return this._secondLevelMonitoringEnabled; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // slow_log_desensitization - computed: true, optional: true, required: false + private _slowLogDesensitization?: string; + public get slowLogDesensitization() { + return this.getStringAttribute('slow_log_desensitization'); + } + public set slowLogDesensitization(value: string) { + this._slowLogDesensitization = value; + } + public resetSlowLogDesensitization() { + this._slowLogDesensitization = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowLogDesensitizationInput() { + return this._slowLogDesensitization; + } + + // ssl - computed: false, optional: true, required: false + private _ssl?: boolean | cdktf.IResolvable; + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + public set ssl(value: boolean | cdktf.IResolvable) { + this._ssl = value; + } + public resetSsl() { + this._ssl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslInput() { + return this._ssl; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // time_zone - computed: true, optional: false, required: false + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new DdsInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: DdsInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // configuration - computed: false, optional: true, required: false + private _configuration = new DdsInstanceConfigurationList(this, "configuration", false); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: DdsInstanceConfiguration[] | cdktf.IResolvable) { + this._configuration.internalValue = value; + } + public resetConfiguration() { + this._configuration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } + + // datastore - computed: false, optional: false, required: true + private _datastore = new DdsInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: DdsInstanceDatastore) { + this._datastore.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // flavor - computed: false, optional: false, required: true + private _flavor = new DdsInstanceFlavorList(this, "flavor", false); + public get flavor() { + return this._flavor; + } + public putFlavor(value: DdsInstanceFlavor[] | cdktf.IResolvable) { + this._flavor.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + balancer_active_begin: cdktf.stringToTerraform(this._balancerActiveBegin), + balancer_active_end: cdktf.stringToTerraform(this._balancerActiveEnd), + balancer_status: cdktf.stringToTerraform(this._balancerStatus), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + client_network_ranges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._clientNetworkRanges), + description: cdktf.stringToTerraform(this._description), + disk_encryption_id: cdktf.stringToTerraform(this._diskEncryptionId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + mode: cdktf.stringToTerraform(this._mode), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + replica_set_name: cdktf.stringToTerraform(this._replicaSetName), + second_level_monitoring_enabled: cdktf.booleanToTerraform(this._secondLevelMonitoringEnabled), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + slow_log_desensitization: cdktf.stringToTerraform(this._slowLogDesensitization), + ssl: cdktf.booleanToTerraform(this._ssl), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: ddsInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + configuration: cdktf.listMapper(ddsInstanceConfigurationToTerraform, true)(this._configuration.internalValue), + datastore: ddsInstanceDatastoreToTerraform(this._datastore.internalValue), + flavor: cdktf.listMapper(ddsInstanceFlavorToTerraform, true)(this._flavor.internalValue), + timeouts: ddsInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + balancer_active_begin: { + value: cdktf.stringToHclTerraform(this._balancerActiveBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + balancer_active_end: { + value: cdktf.stringToHclTerraform(this._balancerActiveEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + balancer_status: { + value: cdktf.stringToHclTerraform(this._balancerStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_network_ranges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._clientNetworkRanges), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk_encryption_id: { + value: cdktf.stringToHclTerraform(this._diskEncryptionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replica_set_name: { + value: cdktf.stringToHclTerraform(this._replicaSetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + second_level_monitoring_enabled: { + value: cdktf.booleanToHclTerraform(this._secondLevelMonitoringEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slow_log_desensitization: { + value: cdktf.stringToHclTerraform(this._slowLogDesensitization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl: { + value: cdktf.booleanToHclTerraform(this._ssl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: ddsInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceBackupStrategyList", + }, + configuration: { + value: cdktf.listMapperHcl(ddsInstanceConfigurationToHclTerraform, true)(this._configuration.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceConfigurationList", + }, + datastore: { + value: ddsInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceDatastoreList", + }, + flavor: { + value: cdktf.listMapperHcl(ddsInstanceFlavorToHclTerraform, true)(this._flavor.internalValue), + isBlock: true, + type: "list", + storageClassType: "DdsInstanceFlavorList", + }, + timeouts: { + value: ddsInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-lts-log/README.md b/src/constructs/providers/huaweicloud/dds-lts-log/README.md new file mode 100644 index 00000000..86342499 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-lts-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_lts_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_lts_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log). diff --git a/src/constructs/providers/huaweicloud/dds-lts-log/index.ts b/src/constructs/providers/huaweicloud/dds-lts-log/index.ts new file mode 100644 index 00000000..8df752f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-lts-log/index.ts @@ -0,0 +1,409 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsLtsLogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#id DdsLtsLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the DDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#instance_id DdsLtsLog#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the type of the LTS log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#log_type DdsLtsLog#log_type} + */ + readonly logType: string; + /** + * Specifies the ID of the LTS log group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#lts_group_id DdsLtsLog#lts_group_id} + */ + readonly ltsGroupId: string; + /** + * Specifies the ID of the LTS log stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#lts_stream_id DdsLtsLog#lts_stream_id} + */ + readonly ltsStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#region DdsLtsLog#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#timeouts DdsLtsLog#timeouts} + */ + readonly timeouts?: DdsLtsLogTimeouts; +} +export interface DdsLtsLogTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#create DdsLtsLog#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#delete DdsLtsLog#delete} + */ + readonly delete?: string; +} + +export function ddsLtsLogTimeoutsToTerraform(struct?: DdsLtsLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function ddsLtsLogTimeoutsToHclTerraform(struct?: DdsLtsLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsLtsLogTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsLtsLogTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsLtsLogTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log huaweicloud_dds_lts_log} +*/ +export class DdsLtsLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_lts_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsLtsLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsLtsLog to import + * @param importFromId The id of the existing DdsLtsLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsLtsLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_lts_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_lts_log huaweicloud_dds_lts_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsLtsLogConfig + */ + public constructor(scope: Construct, id: string, config: DdsLtsLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_lts_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._logType = config.logType; + this._ltsGroupId = config.ltsGroupId; + this._ltsStreamId = config.ltsStreamId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // log_type - computed: false, optional: false, required: true + private _logType?: string; + public get logType() { + return this.getStringAttribute('log_type'); + } + public set logType(value: string) { + this._logType = value; + } + // Temporarily expose input value. Use with caution. + public get logTypeInput() { + return this._logType; + } + + // lts_group_id - computed: false, optional: false, required: true + private _ltsGroupId?: string; + public get ltsGroupId() { + return this.getStringAttribute('lts_group_id'); + } + public set ltsGroupId(value: string) { + this._ltsGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsGroupIdInput() { + return this._ltsGroupId; + } + + // lts_stream_id - computed: false, optional: false, required: true + private _ltsStreamId?: string; + public get ltsStreamId() { + return this.getStringAttribute('lts_stream_id'); + } + public set ltsStreamId(value: string) { + this._ltsStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsStreamIdInput() { + return this._ltsStreamId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsLtsLogTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsLtsLogTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + log_type: cdktf.stringToTerraform(this._logType), + lts_group_id: cdktf.stringToTerraform(this._ltsGroupId), + lts_stream_id: cdktf.stringToTerraform(this._ltsStreamId), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsLtsLogTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_type: { + value: cdktf.stringToHclTerraform(this._logType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_group_id: { + value: cdktf.stringToHclTerraform(this._ltsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsLtsLogTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsLtsLogTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-apply/README.md b/src/constructs/providers/huaweicloud/dds-parameter-template-apply/README.md new file mode 100644 index 00000000..4891cc78 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-apply/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_parameter_template_apply` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_parameter_template_apply`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply). diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-apply/index.ts b/src/constructs/providers/huaweicloud/dds-parameter-template-apply/index.ts new file mode 100644 index 00000000..fbc3b761 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-apply/index.ts @@ -0,0 +1,322 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsParameterTemplateApplyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#configuration_id DdsParameterTemplateApply#configuration_id} + */ + readonly configurationId: string; + /** + * Specifies the entity IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#entity_ids DdsParameterTemplateApply#entity_ids} + */ + readonly entityIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#id DdsParameterTemplateApply#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#region DdsParameterTemplateApply#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#timeouts DdsParameterTemplateApply#timeouts} + */ + readonly timeouts?: DdsParameterTemplateApplyTimeouts; +} +export interface DdsParameterTemplateApplyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#create DdsParameterTemplateApply#create} + */ + readonly create?: string; +} + +export function ddsParameterTemplateApplyTimeoutsToTerraform(struct?: DdsParameterTemplateApplyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsParameterTemplateApplyTimeoutsToHclTerraform(struct?: DdsParameterTemplateApplyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsParameterTemplateApplyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsParameterTemplateApplyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsParameterTemplateApplyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply huaweicloud_dds_parameter_template_apply} +*/ +export class DdsParameterTemplateApply extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_parameter_template_apply"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsParameterTemplateApply resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsParameterTemplateApply to import + * @param importFromId The id of the existing DdsParameterTemplateApply that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsParameterTemplateApply to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_parameter_template_apply", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_apply huaweicloud_dds_parameter_template_apply} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsParameterTemplateApplyConfig + */ + public constructor(scope: Construct, id: string, config: DdsParameterTemplateApplyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_parameter_template_apply', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._entityIds = config.entityIds; + this._id = config.id; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // entity_ids - computed: false, optional: false, required: true + private _entityIds?: string[]; + public get entityIds() { + return this.getListAttribute('entity_ids'); + } + public set entityIds(value: string[]) { + this._entityIds = value; + } + // Temporarily expose input value. Use with caution. + public get entityIdsInput() { + return this._entityIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsParameterTemplateApplyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsParameterTemplateApplyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + entity_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._entityIds), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsParameterTemplateApplyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + entity_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._entityIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsParameterTemplateApplyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsParameterTemplateApplyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-compare/README.md b/src/constructs/providers/huaweicloud/dds-parameter-template-compare/README.md new file mode 100644 index 00000000..4cd9a090 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-compare/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_parameter_template_compare` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_parameter_template_compare`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare). diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-compare/index.ts b/src/constructs/providers/huaweicloud/dds-parameter-template-compare/index.ts new file mode 100644 index 00000000..f0ecd149 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-compare/index.ts @@ -0,0 +1,285 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsParameterTemplateCompareConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare#id DdsParameterTemplateCompare#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare#region DdsParameterTemplateCompare#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare#source_configuration_id DdsParameterTemplateCompare#source_configuration_id} + */ + readonly sourceConfigurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare#target_configuration_id DdsParameterTemplateCompare#target_configuration_id} + */ + readonly targetConfigurationId: string; +} +export interface DdsParameterTemplateCompareDifferences { +} + +export function ddsParameterTemplateCompareDifferencesToTerraform(struct?: DdsParameterTemplateCompareDifferences): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsParameterTemplateCompareDifferencesToHclTerraform(struct?: DdsParameterTemplateCompareDifferences): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsParameterTemplateCompareDifferencesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsParameterTemplateCompareDifferences | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsParameterTemplateCompareDifferences | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // parameter_name - computed: true, optional: false, required: false + public get parameterName() { + return this.getStringAttribute('parameter_name'); + } + + // source_value - computed: true, optional: false, required: false + public get sourceValue() { + return this.getStringAttribute('source_value'); + } + + // target_value - computed: true, optional: false, required: false + public get targetValue() { + return this.getStringAttribute('target_value'); + } +} + +export class DdsParameterTemplateCompareDifferencesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsParameterTemplateCompareDifferencesOutputReference { + return new DdsParameterTemplateCompareDifferencesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare huaweicloud_dds_parameter_template_compare} +*/ +export class DdsParameterTemplateCompare extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_parameter_template_compare"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsParameterTemplateCompare resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsParameterTemplateCompare to import + * @param importFromId The id of the existing DdsParameterTemplateCompare that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsParameterTemplateCompare to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_parameter_template_compare", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_compare huaweicloud_dds_parameter_template_compare} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsParameterTemplateCompareConfig + */ + public constructor(scope: Construct, id: string, config: DdsParameterTemplateCompareConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_parameter_template_compare', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._sourceConfigurationId = config.sourceConfigurationId; + this._targetConfigurationId = config.targetConfigurationId; + } + + // ========== + // ATTRIBUTES + // ========== + + // differences - computed: true, optional: false, required: false + private _differences = new DdsParameterTemplateCompareDifferencesList(this, "differences", false); + public get differences() { + return this._differences; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_configuration_id - computed: false, optional: false, required: true + private _sourceConfigurationId?: string; + public get sourceConfigurationId() { + return this.getStringAttribute('source_configuration_id'); + } + public set sourceConfigurationId(value: string) { + this._sourceConfigurationId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceConfigurationIdInput() { + return this._sourceConfigurationId; + } + + // target_configuration_id - computed: false, optional: false, required: true + private _targetConfigurationId?: string; + public get targetConfigurationId() { + return this.getStringAttribute('target_configuration_id'); + } + public set targetConfigurationId(value: string) { + this._targetConfigurationId = value; + } + // Temporarily expose input value. Use with caution. + public get targetConfigurationIdInput() { + return this._targetConfigurationId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + source_configuration_id: cdktf.stringToTerraform(this._sourceConfigurationId), + target_configuration_id: cdktf.stringToTerraform(this._targetConfigurationId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_configuration_id: { + value: cdktf.stringToHclTerraform(this._sourceConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_configuration_id: { + value: cdktf.stringToHclTerraform(this._targetConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-copy/README.md b/src/constructs/providers/huaweicloud/dds-parameter-template-copy/README.md new file mode 100644 index 00000000..9f86af69 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-copy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_parameter_template_copy` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_parameter_template_copy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy). diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-copy/index.ts b/src/constructs/providers/huaweicloud/dds-parameter-template-copy/index.ts new file mode 100644 index 00000000..fd2221e4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-copy/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsParameterTemplateCopyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy#configuration_id DdsParameterTemplateCopy#configuration_id} + */ + readonly configurationId: string; + /** + * Specifies the description of replicated parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy#description DdsParameterTemplateCopy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy#id DdsParameterTemplateCopy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of replicated parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy#name DdsParameterTemplateCopy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy#region DdsParameterTemplateCopy#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy huaweicloud_dds_parameter_template_copy} +*/ +export class DdsParameterTemplateCopy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_parameter_template_copy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsParameterTemplateCopy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsParameterTemplateCopy to import + * @param importFromId The id of the existing DdsParameterTemplateCopy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsParameterTemplateCopy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_parameter_template_copy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_copy huaweicloud_dds_parameter_template_copy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsParameterTemplateCopyConfig + */ + public constructor(scope: Construct, id: string, config: DdsParameterTemplateCopyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_parameter_template_copy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-reset/README.md b/src/constructs/providers/huaweicloud/dds-parameter-template-reset/README.md new file mode 100644 index 00000000..4aea7de9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-reset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_parameter_template_reset` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_parameter_template_reset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset). diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template-reset/index.ts b/src/constructs/providers/huaweicloud/dds-parameter-template-reset/index.ts new file mode 100644 index 00000000..827bdf24 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template-reset/index.ts @@ -0,0 +1,171 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsParameterTemplateResetConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset#configuration_id DdsParameterTemplateReset#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset#id DdsParameterTemplateReset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset#region DdsParameterTemplateReset#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset huaweicloud_dds_parameter_template_reset} +*/ +export class DdsParameterTemplateReset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_parameter_template_reset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsParameterTemplateReset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsParameterTemplateReset to import + * @param importFromId The id of the existing DdsParameterTemplateReset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsParameterTemplateReset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_parameter_template_reset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template_reset huaweicloud_dds_parameter_template_reset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsParameterTemplateResetConfig + */ + public constructor(scope: Construct, id: string, config: DdsParameterTemplateResetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_parameter_template_reset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template/README.md b/src/constructs/providers/huaweicloud/dds-parameter-template/README.md new file mode 100644 index 00000000..59747052 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_parameter_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_parameter_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template). diff --git a/src/constructs/providers/huaweicloud/dds-parameter-template/index.ts b/src/constructs/providers/huaweicloud/dds-parameter-template/index.ts new file mode 100644 index 00000000..6b547734 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-parameter-template/index.ts @@ -0,0 +1,406 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsParameterTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#description DdsParameterTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#id DdsParameterTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the parameter template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#name DdsParameterTemplate#name} + */ + readonly name: string; + /** + * Specifies the node type of parameter template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#node_type DdsParameterTemplate#node_type} + */ + readonly nodeType: string; + /** + * Specifies the database version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#node_version DdsParameterTemplate#node_version} + */ + readonly nodeVersion: string; + /** + * Specifies the mapping between parameter names and parameter values. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#parameter_values DdsParameterTemplate#parameter_values} + */ + readonly parameterValues?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#region DdsParameterTemplate#region} + */ + readonly region?: string; +} +export interface DdsParameterTemplateParameters { +} + +export function ddsParameterTemplateParametersToTerraform(struct?: DdsParameterTemplateParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ddsParameterTemplateParametersToHclTerraform(struct?: DdsParameterTemplateParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DdsParameterTemplateParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DdsParameterTemplateParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsParameterTemplateParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + + // restart_required - computed: true, optional: false, required: false + public get restartRequired() { + return this.getBooleanAttribute('restart_required'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } + + // value_range - computed: true, optional: false, required: false + public get valueRange() { + return this.getStringAttribute('value_range'); + } +} + +export class DdsParameterTemplateParametersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DdsParameterTemplateParametersOutputReference { + return new DdsParameterTemplateParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template huaweicloud_dds_parameter_template} +*/ +export class DdsParameterTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_parameter_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsParameterTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsParameterTemplate to import + * @param importFromId The id of the existing DdsParameterTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsParameterTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_parameter_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_parameter_template huaweicloud_dds_parameter_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsParameterTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DdsParameterTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_parameter_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._nodeType = config.nodeType; + this._nodeVersion = config.nodeVersion; + this._parameterValues = config.parameterValues; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_type - computed: false, optional: false, required: true + private _nodeType?: string; + public get nodeType() { + return this.getStringAttribute('node_type'); + } + public set nodeType(value: string) { + this._nodeType = value; + } + // Temporarily expose input value. Use with caution. + public get nodeTypeInput() { + return this._nodeType; + } + + // node_version - computed: false, optional: false, required: true + private _nodeVersion?: string; + public get nodeVersion() { + return this.getStringAttribute('node_version'); + } + public set nodeVersion(value: string) { + this._nodeVersion = value; + } + // Temporarily expose input value. Use with caution. + public get nodeVersionInput() { + return this._nodeVersion; + } + + // parameter_values - computed: false, optional: true, required: false + private _parameterValues?: { [key: string]: string }; + public get parameterValues() { + return this.getStringMapAttribute('parameter_values'); + } + public set parameterValues(value: { [key: string]: string }) { + this._parameterValues = value; + } + public resetParameterValues() { + this._parameterValues = undefined; + } + // Temporarily expose input value. Use with caution. + public get parameterValuesInput() { + return this._parameterValues; + } + + // parameters - computed: true, optional: false, required: false + private _parameters = new DdsParameterTemplateParametersList(this, "parameters", false); + public get parameters() { + return this._parameters; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_type: cdktf.stringToTerraform(this._nodeType), + node_version: cdktf.stringToTerraform(this._nodeVersion), + parameter_values: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameterValues), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_type: { + value: cdktf.stringToHclTerraform(this._nodeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_version: { + value: cdktf.stringToHclTerraform(this._nodeVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameter_values: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._parameterValues), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-primary-standby-switch/README.md b/src/constructs/providers/huaweicloud/dds-primary-standby-switch/README.md new file mode 100644 index 00000000..0f632e92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-primary-standby-switch/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_primary_standby_switch` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_primary_standby_switch`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch). diff --git a/src/constructs/providers/huaweicloud/dds-primary-standby-switch/index.ts b/src/constructs/providers/huaweicloud/dds-primary-standby-switch/index.ts new file mode 100644 index 00000000..e5c8f4a4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-primary-standby-switch/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsPrimaryStandbySwitchConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#id DdsPrimaryStandbySwitch#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#instance_id DdsPrimaryStandbySwitch#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#node_id DdsPrimaryStandbySwitch#node_id} + */ + readonly nodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#region DdsPrimaryStandbySwitch#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#timeouts DdsPrimaryStandbySwitch#timeouts} + */ + readonly timeouts?: DdsPrimaryStandbySwitchTimeouts; +} +export interface DdsPrimaryStandbySwitchTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#create DdsPrimaryStandbySwitch#create} + */ + readonly create?: string; +} + +export function ddsPrimaryStandbySwitchTimeoutsToTerraform(struct?: DdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function ddsPrimaryStandbySwitchTimeoutsToHclTerraform(struct?: DdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DdsPrimaryStandbySwitchTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch huaweicloud_dds_primary_standby_switch} +*/ +export class DdsPrimaryStandbySwitch extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_primary_standby_switch"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsPrimaryStandbySwitch resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsPrimaryStandbySwitch to import + * @param importFromId The id of the existing DdsPrimaryStandbySwitch that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsPrimaryStandbySwitch to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_primary_standby_switch", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_primary_standby_switch huaweicloud_dds_primary_standby_switch} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsPrimaryStandbySwitchConfig + */ + public constructor(scope: Construct, id: string, config: DdsPrimaryStandbySwitchConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_primary_standby_switch', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DdsPrimaryStandbySwitchTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DdsPrimaryStandbySwitchTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + timeouts: ddsPrimaryStandbySwitchTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: ddsPrimaryStandbySwitchTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DdsPrimaryStandbySwitchTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-recycle-policy/README.md b/src/constructs/providers/huaweicloud/dds-recycle-policy/README.md new file mode 100644 index 00000000..dd44e300 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-recycle-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_recycle_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_recycle_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy). diff --git a/src/constructs/providers/huaweicloud/dds-recycle-policy/index.ts b/src/constructs/providers/huaweicloud/dds-recycle-policy/index.ts new file mode 100644 index 00000000..aeefd1a8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-recycle-policy/index.ts @@ -0,0 +1,169 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsRecyclePolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy#id DdsRecyclePolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy#region DdsRecyclePolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy#retention_period_in_days DdsRecyclePolicy#retention_period_in_days} + */ + readonly retentionPeriodInDays: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy huaweicloud_dds_recycle_policy} +*/ +export class DdsRecyclePolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_recycle_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsRecyclePolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsRecyclePolicy to import + * @param importFromId The id of the existing DdsRecyclePolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsRecyclePolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_recycle_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_recycle_policy huaweicloud_dds_recycle_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsRecyclePolicyConfig + */ + public constructor(scope: Construct, id: string, config: DdsRecyclePolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_recycle_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._retentionPeriodInDays = config.retentionPeriodInDays; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retention_period_in_days - computed: false, optional: false, required: true + private _retentionPeriodInDays?: number; + public get retentionPeriodInDays() { + return this.getNumberAttribute('retention_period_in_days'); + } + public set retentionPeriodInDays(value: number) { + this._retentionPeriodInDays = value; + } + // Temporarily expose input value. Use with caution. + public get retentionPeriodInDaysInput() { + return this._retentionPeriodInDays; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + retention_period_in_days: cdktf.numberToTerraform(this._retentionPeriodInDays), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_period_in_days: { + value: cdktf.numberToHclTerraform(this._retentionPeriodInDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/README.md b/src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/README.md new file mode 100644 index 00000000..b1544c19 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dds_scheduled_task_cancel` + +Refer to the Terraform Registry for docs: [`huaweicloud_dds_scheduled_task_cancel`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel). diff --git a/src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/index.ts b/src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/index.ts new file mode 100644 index 00000000..227ff25a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dds-scheduled-task-cancel/index.ts @@ -0,0 +1,211 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DdsScheduledTaskCancelConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel#id DdsScheduledTaskCancel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the task ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel#job_id DdsScheduledTaskCancel#job_id} + */ + readonly jobId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel#region DdsScheduledTaskCancel#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel huaweicloud_dds_scheduled_task_cancel} +*/ +export class DdsScheduledTaskCancel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dds_scheduled_task_cancel"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DdsScheduledTaskCancel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DdsScheduledTaskCancel to import + * @param importFromId The id of the existing DdsScheduledTaskCancel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DdsScheduledTaskCancel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dds_scheduled_task_cancel", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dds_scheduled_task_cancel huaweicloud_dds_scheduled_task_cancel} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DdsScheduledTaskCancelConfig + */ + public constructor(scope: Construct, id: string, config: DdsScheduledTaskCancelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dds_scheduled_task_cancel', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._jobId = config.jobId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_status - computed: true, optional: false, required: false + public get instanceStatus() { + return this.getStringAttribute('instance_status'); + } + + // job_id - computed: false, optional: false, required: true + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // job_name - computed: true, optional: false, required: false + public get jobName() { + return this.getStringAttribute('job_name'); + } + + // job_status - computed: true, optional: false, required: false + public get jobStatus() { + return this.getStringAttribute('job_status'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dis-stream-v2/README.md b/src/constructs/providers/huaweicloud/dis-stream-v2/README.md new file mode 100644 index 00000000..06a94f59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dis-stream-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dis_stream_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_dis_stream_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2). diff --git a/src/constructs/providers/huaweicloud/dis-stream-v2/index.ts b/src/constructs/providers/huaweicloud/dis-stream-v2/index.ts new file mode 100644 index 00000000..d8f1d565 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dis-stream-v2/index.ts @@ -0,0 +1,719 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DisStreamV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#auto_scale_max_partition_count DisStreamV2#auto_scale_max_partition_count} + */ + readonly autoScaleMaxPartitionCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#auto_scale_min_partition_count DisStreamV2#auto_scale_min_partition_count} + */ + readonly autoScaleMinPartitionCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#compression_format DisStreamV2#compression_format} + */ + readonly compressionFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#csv_delimiter DisStreamV2#csv_delimiter} + */ + readonly csvDelimiter?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#data_schema DisStreamV2#data_schema} + */ + readonly dataSchema?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#data_type DisStreamV2#data_type} + */ + readonly dataType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#enterprise_project_id DisStreamV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#id DisStreamV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#partition_count DisStreamV2#partition_count} + */ + readonly partitionCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#region DisStreamV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#retention_period DisStreamV2#retention_period} + */ + readonly retentionPeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#stream_name DisStreamV2#stream_name} + */ + readonly streamName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#stream_type DisStreamV2#stream_type} + */ + readonly streamType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#tags DisStreamV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#timeouts DisStreamV2#timeouts} + */ + readonly timeouts?: DisStreamV2Timeouts; +} +export interface DisStreamV2Partitions { +} + +export function disStreamV2PartitionsToTerraform(struct?: DisStreamV2Partitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function disStreamV2PartitionsToHclTerraform(struct?: DisStreamV2Partitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DisStreamV2PartitionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DisStreamV2Partitions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DisStreamV2Partitions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // hash_range - computed: true, optional: false, required: false + public get hashRange() { + return this.getStringAttribute('hash_range'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // sequence_number_range - computed: true, optional: false, required: false + public get sequenceNumberRange() { + return this.getStringAttribute('sequence_number_range'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DisStreamV2PartitionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DisStreamV2PartitionsOutputReference { + return new DisStreamV2PartitionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DisStreamV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#update DisStreamV2#update} + */ + readonly update?: string; +} + +export function disStreamV2TimeoutsToTerraform(struct?: DisStreamV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function disStreamV2TimeoutsToHclTerraform(struct?: DisStreamV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DisStreamV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DisStreamV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DisStreamV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._update = value.update; + } + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2 huaweicloud_dis_stream_v2} +*/ +export class DisStreamV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dis_stream_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DisStreamV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DisStreamV2 to import + * @param importFromId The id of the existing DisStreamV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DisStreamV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dis_stream_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream_v2 huaweicloud_dis_stream_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DisStreamV2Config + */ + public constructor(scope: Construct, id: string, config: DisStreamV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dis_stream_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoScaleMaxPartitionCount = config.autoScaleMaxPartitionCount; + this._autoScaleMinPartitionCount = config.autoScaleMinPartitionCount; + this._compressionFormat = config.compressionFormat; + this._csvDelimiter = config.csvDelimiter; + this._dataSchema = config.dataSchema; + this._dataType = config.dataType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._partitionCount = config.partitionCount; + this._region = config.region; + this._retentionPeriod = config.retentionPeriod; + this._streamName = config.streamName; + this._streamType = config.streamType; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_scale_max_partition_count - computed: true, optional: true, required: false + private _autoScaleMaxPartitionCount?: number; + public get autoScaleMaxPartitionCount() { + return this.getNumberAttribute('auto_scale_max_partition_count'); + } + public set autoScaleMaxPartitionCount(value: number) { + this._autoScaleMaxPartitionCount = value; + } + public resetAutoScaleMaxPartitionCount() { + this._autoScaleMaxPartitionCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoScaleMaxPartitionCountInput() { + return this._autoScaleMaxPartitionCount; + } + + // auto_scale_min_partition_count - computed: true, optional: true, required: false + private _autoScaleMinPartitionCount?: number; + public get autoScaleMinPartitionCount() { + return this.getNumberAttribute('auto_scale_min_partition_count'); + } + public set autoScaleMinPartitionCount(value: number) { + this._autoScaleMinPartitionCount = value; + } + public resetAutoScaleMinPartitionCount() { + this._autoScaleMinPartitionCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoScaleMinPartitionCountInput() { + return this._autoScaleMinPartitionCount; + } + + // compression_format - computed: true, optional: true, required: false + private _compressionFormat?: string; + public get compressionFormat() { + return this.getStringAttribute('compression_format'); + } + public set compressionFormat(value: string) { + this._compressionFormat = value; + } + public resetCompressionFormat() { + this._compressionFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressionFormatInput() { + return this._compressionFormat; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getNumberAttribute('created'); + } + + // csv_delimiter - computed: true, optional: true, required: false + private _csvDelimiter?: string; + public get csvDelimiter() { + return this.getStringAttribute('csv_delimiter'); + } + public set csvDelimiter(value: string) { + this._csvDelimiter = value; + } + public resetCsvDelimiter() { + this._csvDelimiter = undefined; + } + // Temporarily expose input value. Use with caution. + public get csvDelimiterInput() { + return this._csvDelimiter; + } + + // data_schema - computed: true, optional: true, required: false + private _dataSchema?: string; + public get dataSchema() { + return this.getStringAttribute('data_schema'); + } + public set dataSchema(value: string) { + this._dataSchema = value; + } + public resetDataSchema() { + this._dataSchema = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataSchemaInput() { + return this._dataSchema; + } + + // data_type - computed: true, optional: true, required: false + private _dataType?: string; + public get dataType() { + return this.getStringAttribute('data_type'); + } + public set dataType(value: string) { + this._dataType = value; + } + public resetDataType() { + this._dataType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataTypeInput() { + return this._dataType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // partition_count - computed: false, optional: false, required: true + private _partitionCount?: number; + public get partitionCount() { + return this.getNumberAttribute('partition_count'); + } + public set partitionCount(value: number) { + this._partitionCount = value; + } + // Temporarily expose input value. Use with caution. + public get partitionCountInput() { + return this._partitionCount; + } + + // partitions - computed: true, optional: false, required: false + private _partitions = new DisStreamV2PartitionsList(this, "partitions", false); + public get partitions() { + return this._partitions; + } + + // readable_partition_count - computed: true, optional: false, required: false + public get readablePartitionCount() { + return this.getNumberAttribute('readable_partition_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retention_period - computed: false, optional: true, required: false + private _retentionPeriod?: number; + public get retentionPeriod() { + return this.getNumberAttribute('retention_period'); + } + public set retentionPeriod(value: number) { + this._retentionPeriod = value; + } + public resetRetentionPeriod() { + this._retentionPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionPeriodInput() { + return this._retentionPeriod; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stream_id - computed: true, optional: false, required: false + public get streamId() { + return this.getStringAttribute('stream_id'); + } + + // stream_name - computed: false, optional: false, required: true + private _streamName?: string; + public get streamName() { + return this.getStringAttribute('stream_name'); + } + public set streamName(value: string) { + this._streamName = value; + } + // Temporarily expose input value. Use with caution. + public get streamNameInput() { + return this._streamName; + } + + // stream_type - computed: true, optional: true, required: false + private _streamType?: string; + public get streamType() { + return this.getStringAttribute('stream_type'); + } + public set streamType(value: string) { + this._streamType = value; + } + public resetStreamType() { + this._streamType = undefined; + } + // Temporarily expose input value. Use with caution. + public get streamTypeInput() { + return this._streamType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // writable_partition_count - computed: true, optional: false, required: false + public get writablePartitionCount() { + return this.getNumberAttribute('writable_partition_count'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DisStreamV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DisStreamV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_scale_max_partition_count: cdktf.numberToTerraform(this._autoScaleMaxPartitionCount), + auto_scale_min_partition_count: cdktf.numberToTerraform(this._autoScaleMinPartitionCount), + compression_format: cdktf.stringToTerraform(this._compressionFormat), + csv_delimiter: cdktf.stringToTerraform(this._csvDelimiter), + data_schema: cdktf.stringToTerraform(this._dataSchema), + data_type: cdktf.stringToTerraform(this._dataType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + partition_count: cdktf.numberToTerraform(this._partitionCount), + region: cdktf.stringToTerraform(this._region), + retention_period: cdktf.numberToTerraform(this._retentionPeriod), + stream_name: cdktf.stringToTerraform(this._streamName), + stream_type: cdktf.stringToTerraform(this._streamType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: disStreamV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_scale_max_partition_count: { + value: cdktf.numberToHclTerraform(this._autoScaleMaxPartitionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + auto_scale_min_partition_count: { + value: cdktf.numberToHclTerraform(this._autoScaleMinPartitionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + compression_format: { + value: cdktf.stringToHclTerraform(this._compressionFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + csv_delimiter: { + value: cdktf.stringToHclTerraform(this._csvDelimiter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_schema: { + value: cdktf.stringToHclTerraform(this._dataSchema), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_type: { + value: cdktf.stringToHclTerraform(this._dataType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_count: { + value: cdktf.numberToHclTerraform(this._partitionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_period: { + value: cdktf.numberToHclTerraform(this._retentionPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + stream_name: { + value: cdktf.stringToHclTerraform(this._streamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stream_type: { + value: cdktf.stringToHclTerraform(this._streamType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: disStreamV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DisStreamV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dis-stream/README.md b/src/constructs/providers/huaweicloud/dis-stream/README.md new file mode 100644 index 00000000..a5f8af91 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dis-stream/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dis_stream` + +Refer to the Terraform Registry for docs: [`huaweicloud_dis_stream`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream). diff --git a/src/constructs/providers/huaweicloud/dis-stream/index.ts b/src/constructs/providers/huaweicloud/dis-stream/index.ts new file mode 100644 index 00000000..7927bc75 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dis-stream/index.ts @@ -0,0 +1,719 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DisStreamConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#auto_scale_max_partition_count DisStream#auto_scale_max_partition_count} + */ + readonly autoScaleMaxPartitionCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#auto_scale_min_partition_count DisStream#auto_scale_min_partition_count} + */ + readonly autoScaleMinPartitionCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#compression_format DisStream#compression_format} + */ + readonly compressionFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#csv_delimiter DisStream#csv_delimiter} + */ + readonly csvDelimiter?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#data_schema DisStream#data_schema} + */ + readonly dataSchema?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#data_type DisStream#data_type} + */ + readonly dataType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#enterprise_project_id DisStream#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#id DisStream#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#partition_count DisStream#partition_count} + */ + readonly partitionCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#region DisStream#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#retention_period DisStream#retention_period} + */ + readonly retentionPeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#stream_name DisStream#stream_name} + */ + readonly streamName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#stream_type DisStream#stream_type} + */ + readonly streamType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#tags DisStream#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#timeouts DisStream#timeouts} + */ + readonly timeouts?: DisStreamTimeouts; +} +export interface DisStreamPartitions { +} + +export function disStreamPartitionsToTerraform(struct?: DisStreamPartitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function disStreamPartitionsToHclTerraform(struct?: DisStreamPartitions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DisStreamPartitionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DisStreamPartitions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DisStreamPartitions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // hash_range - computed: true, optional: false, required: false + public get hashRange() { + return this.getStringAttribute('hash_range'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // sequence_number_range - computed: true, optional: false, required: false + public get sequenceNumberRange() { + return this.getStringAttribute('sequence_number_range'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DisStreamPartitionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DisStreamPartitionsOutputReference { + return new DisStreamPartitionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DisStreamTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#update DisStream#update} + */ + readonly update?: string; +} + +export function disStreamTimeoutsToTerraform(struct?: DisStreamTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function disStreamTimeoutsToHclTerraform(struct?: DisStreamTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DisStreamTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DisStreamTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DisStreamTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._update = value.update; + } + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream huaweicloud_dis_stream} +*/ +export class DisStream extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dis_stream"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DisStream resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DisStream to import + * @param importFromId The id of the existing DisStream that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DisStream to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dis_stream", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dis_stream huaweicloud_dis_stream} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DisStreamConfig + */ + public constructor(scope: Construct, id: string, config: DisStreamConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dis_stream', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoScaleMaxPartitionCount = config.autoScaleMaxPartitionCount; + this._autoScaleMinPartitionCount = config.autoScaleMinPartitionCount; + this._compressionFormat = config.compressionFormat; + this._csvDelimiter = config.csvDelimiter; + this._dataSchema = config.dataSchema; + this._dataType = config.dataType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._partitionCount = config.partitionCount; + this._region = config.region; + this._retentionPeriod = config.retentionPeriod; + this._streamName = config.streamName; + this._streamType = config.streamType; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_scale_max_partition_count - computed: true, optional: true, required: false + private _autoScaleMaxPartitionCount?: number; + public get autoScaleMaxPartitionCount() { + return this.getNumberAttribute('auto_scale_max_partition_count'); + } + public set autoScaleMaxPartitionCount(value: number) { + this._autoScaleMaxPartitionCount = value; + } + public resetAutoScaleMaxPartitionCount() { + this._autoScaleMaxPartitionCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoScaleMaxPartitionCountInput() { + return this._autoScaleMaxPartitionCount; + } + + // auto_scale_min_partition_count - computed: true, optional: true, required: false + private _autoScaleMinPartitionCount?: number; + public get autoScaleMinPartitionCount() { + return this.getNumberAttribute('auto_scale_min_partition_count'); + } + public set autoScaleMinPartitionCount(value: number) { + this._autoScaleMinPartitionCount = value; + } + public resetAutoScaleMinPartitionCount() { + this._autoScaleMinPartitionCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoScaleMinPartitionCountInput() { + return this._autoScaleMinPartitionCount; + } + + // compression_format - computed: true, optional: true, required: false + private _compressionFormat?: string; + public get compressionFormat() { + return this.getStringAttribute('compression_format'); + } + public set compressionFormat(value: string) { + this._compressionFormat = value; + } + public resetCompressionFormat() { + this._compressionFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressionFormatInput() { + return this._compressionFormat; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getNumberAttribute('created'); + } + + // csv_delimiter - computed: true, optional: true, required: false + private _csvDelimiter?: string; + public get csvDelimiter() { + return this.getStringAttribute('csv_delimiter'); + } + public set csvDelimiter(value: string) { + this._csvDelimiter = value; + } + public resetCsvDelimiter() { + this._csvDelimiter = undefined; + } + // Temporarily expose input value. Use with caution. + public get csvDelimiterInput() { + return this._csvDelimiter; + } + + // data_schema - computed: true, optional: true, required: false + private _dataSchema?: string; + public get dataSchema() { + return this.getStringAttribute('data_schema'); + } + public set dataSchema(value: string) { + this._dataSchema = value; + } + public resetDataSchema() { + this._dataSchema = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataSchemaInput() { + return this._dataSchema; + } + + // data_type - computed: true, optional: true, required: false + private _dataType?: string; + public get dataType() { + return this.getStringAttribute('data_type'); + } + public set dataType(value: string) { + this._dataType = value; + } + public resetDataType() { + this._dataType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataTypeInput() { + return this._dataType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // partition_count - computed: false, optional: false, required: true + private _partitionCount?: number; + public get partitionCount() { + return this.getNumberAttribute('partition_count'); + } + public set partitionCount(value: number) { + this._partitionCount = value; + } + // Temporarily expose input value. Use with caution. + public get partitionCountInput() { + return this._partitionCount; + } + + // partitions - computed: true, optional: false, required: false + private _partitions = new DisStreamPartitionsList(this, "partitions", false); + public get partitions() { + return this._partitions; + } + + // readable_partition_count - computed: true, optional: false, required: false + public get readablePartitionCount() { + return this.getNumberAttribute('readable_partition_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retention_period - computed: false, optional: true, required: false + private _retentionPeriod?: number; + public get retentionPeriod() { + return this.getNumberAttribute('retention_period'); + } + public set retentionPeriod(value: number) { + this._retentionPeriod = value; + } + public resetRetentionPeriod() { + this._retentionPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionPeriodInput() { + return this._retentionPeriod; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stream_id - computed: true, optional: false, required: false + public get streamId() { + return this.getStringAttribute('stream_id'); + } + + // stream_name - computed: false, optional: false, required: true + private _streamName?: string; + public get streamName() { + return this.getStringAttribute('stream_name'); + } + public set streamName(value: string) { + this._streamName = value; + } + // Temporarily expose input value. Use with caution. + public get streamNameInput() { + return this._streamName; + } + + // stream_type - computed: true, optional: true, required: false + private _streamType?: string; + public get streamType() { + return this.getStringAttribute('stream_type'); + } + public set streamType(value: string) { + this._streamType = value; + } + public resetStreamType() { + this._streamType = undefined; + } + // Temporarily expose input value. Use with caution. + public get streamTypeInput() { + return this._streamType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // writable_partition_count - computed: true, optional: false, required: false + public get writablePartitionCount() { + return this.getNumberAttribute('writable_partition_count'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DisStreamTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DisStreamTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_scale_max_partition_count: cdktf.numberToTerraform(this._autoScaleMaxPartitionCount), + auto_scale_min_partition_count: cdktf.numberToTerraform(this._autoScaleMinPartitionCount), + compression_format: cdktf.stringToTerraform(this._compressionFormat), + csv_delimiter: cdktf.stringToTerraform(this._csvDelimiter), + data_schema: cdktf.stringToTerraform(this._dataSchema), + data_type: cdktf.stringToTerraform(this._dataType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + partition_count: cdktf.numberToTerraform(this._partitionCount), + region: cdktf.stringToTerraform(this._region), + retention_period: cdktf.numberToTerraform(this._retentionPeriod), + stream_name: cdktf.stringToTerraform(this._streamName), + stream_type: cdktf.stringToTerraform(this._streamType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: disStreamTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_scale_max_partition_count: { + value: cdktf.numberToHclTerraform(this._autoScaleMaxPartitionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + auto_scale_min_partition_count: { + value: cdktf.numberToHclTerraform(this._autoScaleMinPartitionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + compression_format: { + value: cdktf.stringToHclTerraform(this._compressionFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + csv_delimiter: { + value: cdktf.stringToHclTerraform(this._csvDelimiter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_schema: { + value: cdktf.stringToHclTerraform(this._dataSchema), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_type: { + value: cdktf.stringToHclTerraform(this._dataType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_count: { + value: cdktf.numberToHclTerraform(this._partitionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_period: { + value: cdktf.numberToHclTerraform(this._retentionPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + stream_name: { + value: cdktf.stringToHclTerraform(this._streamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stream_type: { + value: cdktf.stringToHclTerraform(this._streamType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: disStreamTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DisStreamTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-agency/README.md b/src/constructs/providers/huaweicloud/dli-agency/README.md new file mode 100644 index 00000000..6bdafb2f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-agency/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_agency` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_agency`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency). diff --git a/src/constructs/providers/huaweicloud/dli-agency/index.ts b/src/constructs/providers/huaweicloud/dli-agency/index.ts new file mode 100644 index 00000000..671e3f32 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-agency/index.ts @@ -0,0 +1,176 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliAgencyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency#id DliAgency#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency#region DliAgency#region} + */ + readonly region?: string; + /** + * The list of roles. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency#roles DliAgency#roles} + */ + readonly roles: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency huaweicloud_dli_agency} +*/ +export class DliAgency extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_agency"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliAgency resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliAgency to import + * @param importFromId The id of the existing DliAgency that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliAgency to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_agency", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_agency huaweicloud_dli_agency} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliAgencyConfig + */ + public constructor(scope: Construct, id: string, config: DliAgencyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_agency', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._roles = config.roles; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roles - computed: false, optional: false, required: true + private _roles?: string[]; + public get roles() { + return cdktf.Fn.tolist(this.getListAttribute('roles')); + } + public set roles(value: string[]) { + this._roles = value; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._roles), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._roles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-database-privilege/README.md b/src/constructs/providers/huaweicloud/dli-database-privilege/README.md new file mode 100644 index 00000000..dd72ff17 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-database-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_database_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_database_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege). diff --git a/src/constructs/providers/huaweicloud/dli-database-privilege/index.ts b/src/constructs/providers/huaweicloud/dli-database-privilege/index.ts new file mode 100644 index 00000000..4042c5b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-database-privilege/index.ts @@ -0,0 +1,230 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliDatabasePrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege#id DliDatabasePrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The authorization object definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege#object DliDatabasePrivilege#object} + */ + readonly object: string; + /** + * The list of permissions granted to the database or data table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege#privileges DliDatabasePrivilege#privileges} + */ + readonly privileges?: string[]; + /** + * The region in which to create the resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege#region DliDatabasePrivilege#region} + */ + readonly region?: string; + /** + * The name of the authorized (IAM) user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege#user_name DliDatabasePrivilege#user_name} + */ + readonly userName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege huaweicloud_dli_database_privilege} +*/ +export class DliDatabasePrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_database_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliDatabasePrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliDatabasePrivilege to import + * @param importFromId The id of the existing DliDatabasePrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliDatabasePrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_database_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database_privilege huaweicloud_dli_database_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliDatabasePrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: DliDatabasePrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_database_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._object = config.object; + this._privileges = config.privileges; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // object - computed: false, optional: false, required: true + private _object?: string; + public get object() { + return this.getStringAttribute('object'); + } + public set object(value: string) { + this._object = value; + } + // Temporarily expose input value. Use with caution. + public get objectInput() { + return this._object; + } + + // privileges - computed: true, optional: true, required: false + private _privileges?: string[]; + public get privileges() { + return cdktf.Fn.tolist(this.getListAttribute('privileges')); + } + public set privileges(value: string[]) { + this._privileges = value; + } + public resetPrivileges() { + this._privileges = undefined; + } + // Temporarily expose input value. Use with caution. + public get privilegesInput() { + return this._privileges; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + object: cdktf.stringToTerraform(this._object), + privileges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._privileges), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object: { + value: cdktf.stringToHclTerraform(this._object), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + privileges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._privileges), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-database/README.md b/src/constructs/providers/huaweicloud/dli-database/README.md new file mode 100644 index 00000000..5330213d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database). diff --git a/src/constructs/providers/huaweicloud/dli-database/index.ts b/src/constructs/providers/huaweicloud/dli-database/index.ts new file mode 100644 index 00000000..ab611f45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-database/index.ts @@ -0,0 +1,438 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#description DliDatabase#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#enterprise_project_id DliDatabase#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#id DliDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#name DliDatabase#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#owner DliDatabase#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#region DliDatabase#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#tags DliDatabase#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#timeouts DliDatabase#timeouts} + */ + readonly timeouts?: DliDatabaseTimeouts; +} +export interface DliDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#create DliDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#delete DliDatabase#delete} + */ + readonly delete?: string; +} + +export function dliDatabaseTimeoutsToTerraform(struct?: DliDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dliDatabaseTimeoutsToHclTerraform(struct?: DliDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database huaweicloud_dli_database} +*/ +export class DliDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliDatabase to import + * @param importFromId The id of the existing DliDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_database huaweicloud_dli_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: DliDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._owner = config.owner; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: dliDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: dliDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-datasource-auth/README.md b/src/constructs/providers/huaweicloud/dli-datasource-auth/README.md new file mode 100644 index 00000000..43458617 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-auth/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_datasource_auth` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_datasource_auth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth). diff --git a/src/constructs/providers/huaweicloud/dli-datasource-auth/index.ts b/src/constructs/providers/huaweicloud/dli-datasource-auth/index.ts new file mode 100644 index 00000000..94860887 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-auth/index.ts @@ -0,0 +1,533 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliDatasourceAuthConfig extends cdktf.TerraformMetaArguments { + /** + * The OBS path of the security cluster certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#certificate_location DliDatasourceAuth#certificate_location} + */ + readonly certificateLocation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#id DliDatasourceAuth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The key password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#key_password DliDatasourceAuth#key_password} + */ + readonly keyPassword?: string; + /** + * The OBS path of the **keystore** configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#keystore_location DliDatasourceAuth#keystore_location} + */ + readonly keystoreLocation?: string; + /** + * The password of the **keystore ** configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#keystore_password DliDatasourceAuth#keystore_password} + */ + readonly keystorePassword?: string; + /** + * The OBS path of the **keytab** configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#keytab DliDatasourceAuth#keytab} + */ + readonly keytab?: string; + /** + * The OBS path of the **krb5** configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#krb5_conf DliDatasourceAuth#krb5_conf} + */ + readonly krb5Conf?: string; + /** + * The name of a datasource authentication. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#name DliDatasourceAuth#name} + */ + readonly name: string; + /** + * The password for accessing the security cluster or datasource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#password DliDatasourceAuth#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#region DliDatasourceAuth#region} + */ + readonly region?: string; + /** + * The OBS path of the **truststore** configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#truststore_location DliDatasourceAuth#truststore_location} + */ + readonly truststoreLocation?: string; + /** + * The password of the **truststore** configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#truststore_password DliDatasourceAuth#truststore_password} + */ + readonly truststorePassword?: string; + /** + * Data source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#type DliDatasourceAuth#type} + */ + readonly type: string; + /** + * Username for accessing the security cluster or datasource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#user_name DliDatasourceAuth#user_name} + */ + readonly userName?: string; + /** + * Username for accessing the security cluster or datasource. Use 'user_name' instead. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#username DliDatasourceAuth#username} + */ + readonly username?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth huaweicloud_dli_datasource_auth} +*/ +export class DliDatasourceAuth extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_datasource_auth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliDatasourceAuth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliDatasourceAuth to import + * @param importFromId The id of the existing DliDatasourceAuth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliDatasourceAuth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_datasource_auth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_auth huaweicloud_dli_datasource_auth} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliDatasourceAuthConfig + */ + public constructor(scope: Construct, id: string, config: DliDatasourceAuthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_datasource_auth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateLocation = config.certificateLocation; + this._id = config.id; + this._keyPassword = config.keyPassword; + this._keystoreLocation = config.keystoreLocation; + this._keystorePassword = config.keystorePassword; + this._keytab = config.keytab; + this._krb5Conf = config.krb5Conf; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._truststoreLocation = config.truststoreLocation; + this._truststorePassword = config.truststorePassword; + this._type = config.type; + this._userName = config.userName; + this._username = config.username; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate_location - computed: true, optional: true, required: false + private _certificateLocation?: string; + public get certificateLocation() { + return this.getStringAttribute('certificate_location'); + } + public set certificateLocation(value: string) { + this._certificateLocation = value; + } + public resetCertificateLocation() { + this._certificateLocation = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateLocationInput() { + return this._certificateLocation; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_password - computed: true, optional: true, required: false + private _keyPassword?: string; + public get keyPassword() { + return this.getStringAttribute('key_password'); + } + public set keyPassword(value: string) { + this._keyPassword = value; + } + public resetKeyPassword() { + this._keyPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPasswordInput() { + return this._keyPassword; + } + + // keystore_location - computed: true, optional: true, required: false + private _keystoreLocation?: string; + public get keystoreLocation() { + return this.getStringAttribute('keystore_location'); + } + public set keystoreLocation(value: string) { + this._keystoreLocation = value; + } + public resetKeystoreLocation() { + this._keystoreLocation = undefined; + } + // Temporarily expose input value. Use with caution. + public get keystoreLocationInput() { + return this._keystoreLocation; + } + + // keystore_password - computed: true, optional: true, required: false + private _keystorePassword?: string; + public get keystorePassword() { + return this.getStringAttribute('keystore_password'); + } + public set keystorePassword(value: string) { + this._keystorePassword = value; + } + public resetKeystorePassword() { + this._keystorePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keystorePasswordInput() { + return this._keystorePassword; + } + + // keytab - computed: true, optional: true, required: false + private _keytab?: string; + public get keytab() { + return this.getStringAttribute('keytab'); + } + public set keytab(value: string) { + this._keytab = value; + } + public resetKeytab() { + this._keytab = undefined; + } + // Temporarily expose input value. Use with caution. + public get keytabInput() { + return this._keytab; + } + + // krb5_conf - computed: true, optional: true, required: false + private _krb5Conf?: string; + public get krb5Conf() { + return this.getStringAttribute('krb5_conf'); + } + public set krb5Conf(value: string) { + this._krb5Conf = value; + } + public resetKrb5Conf() { + this._krb5Conf = undefined; + } + // Temporarily expose input value. Use with caution. + public get krb5ConfInput() { + return this._krb5Conf; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // password - computed: true, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // truststore_location - computed: true, optional: true, required: false + private _truststoreLocation?: string; + public get truststoreLocation() { + return this.getStringAttribute('truststore_location'); + } + public set truststoreLocation(value: string) { + this._truststoreLocation = value; + } + public resetTruststoreLocation() { + this._truststoreLocation = undefined; + } + // Temporarily expose input value. Use with caution. + public get truststoreLocationInput() { + return this._truststoreLocation; + } + + // truststore_password - computed: true, optional: true, required: false + private _truststorePassword?: string; + public get truststorePassword() { + return this.getStringAttribute('truststore_password'); + } + public set truststorePassword(value: string) { + this._truststorePassword = value; + } + public resetTruststorePassword() { + this._truststorePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get truststorePasswordInput() { + return this._truststorePassword; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_name - computed: true, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // username - computed: true, optional: true, required: false + private _username?: string; + public get username() { + return this.getStringAttribute('username'); + } + public set username(value: string) { + this._username = value; + } + public resetUsername() { + this._username = undefined; + } + // Temporarily expose input value. Use with caution. + public get usernameInput() { + return this._username; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_location: cdktf.stringToTerraform(this._certificateLocation), + id: cdktf.stringToTerraform(this._id), + key_password: cdktf.stringToTerraform(this._keyPassword), + keystore_location: cdktf.stringToTerraform(this._keystoreLocation), + keystore_password: cdktf.stringToTerraform(this._keystorePassword), + keytab: cdktf.stringToTerraform(this._keytab), + krb5_conf: cdktf.stringToTerraform(this._krb5Conf), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + truststore_location: cdktf.stringToTerraform(this._truststoreLocation), + truststore_password: cdktf.stringToTerraform(this._truststorePassword), + type: cdktf.stringToTerraform(this._type), + user_name: cdktf.stringToTerraform(this._userName), + username: cdktf.stringToTerraform(this._username), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_location: { + value: cdktf.stringToHclTerraform(this._certificateLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_password: { + value: cdktf.stringToHclTerraform(this._keyPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keystore_location: { + value: cdktf.stringToHclTerraform(this._keystoreLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keystore_password: { + value: cdktf.stringToHclTerraform(this._keystorePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keytab: { + value: cdktf.stringToHclTerraform(this._keytab), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + krb5_conf: { + value: cdktf.stringToHclTerraform(this._krb5Conf), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + truststore_location: { + value: cdktf.stringToHclTerraform(this._truststoreLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + truststore_password: { + value: cdktf.stringToHclTerraform(this._truststorePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + username: { + value: cdktf.stringToHclTerraform(this._username), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-datasource-connection-associate/README.md b/src/constructs/providers/huaweicloud/dli-datasource-connection-associate/README.md new file mode 100644 index 00000000..ae4997e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-connection-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_datasource_connection_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_datasource_connection_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate). diff --git a/src/constructs/providers/huaweicloud/dli-datasource-connection-associate/index.ts b/src/constructs/providers/huaweicloud/dli-datasource-connection-associate/index.ts new file mode 100644 index 00000000..4999cdf5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-connection-associate/index.ts @@ -0,0 +1,200 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliDatasourceConnectionAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the datasource enhanced connection to be associated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate#connection_id DliDatasourceConnectionAssociate#connection_id} + */ + readonly connectionId: string; + /** + * The list of the elastic resource pool names. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate#elastic_resource_pools DliDatasourceConnectionAssociate#elastic_resource_pools} + */ + readonly elasticResourcePools: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate#id DliDatasourceConnectionAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the datasource enhanced connection and elastic resource pools are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate#region DliDatasourceConnectionAssociate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate huaweicloud_dli_datasource_connection_associate} +*/ +export class DliDatasourceConnectionAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_datasource_connection_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliDatasourceConnectionAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliDatasourceConnectionAssociate to import + * @param importFromId The id of the existing DliDatasourceConnectionAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliDatasourceConnectionAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_datasource_connection_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_associate huaweicloud_dli_datasource_connection_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliDatasourceConnectionAssociateConfig + */ + public constructor(scope: Construct, id: string, config: DliDatasourceConnectionAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_datasource_connection_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._elasticResourcePools = config.elasticResourcePools; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: false, required: true + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // elastic_resource_pools - computed: false, optional: false, required: true + private _elasticResourcePools?: string[]; + public get elasticResourcePools() { + return cdktf.Fn.tolist(this.getListAttribute('elastic_resource_pools')); + } + public set elasticResourcePools(value: string[]) { + this._elasticResourcePools = value; + } + // Temporarily expose input value. Use with caution. + public get elasticResourcePoolsInput() { + return this._elasticResourcePools; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + elastic_resource_pools: cdktf.listMapper(cdktf.stringToTerraform, false)(this._elasticResourcePools), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + elastic_resource_pools: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._elasticResourcePools), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/README.md b/src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/README.md new file mode 100644 index 00000000..7b596ed3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_datasource_connection_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_datasource_connection_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege). diff --git a/src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/index.ts b/src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/index.ts new file mode 100644 index 00000000..9ebecb02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-connection-privilege/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliDatasourceConnectionPrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the connection to be granted. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege#connection_id DliDatasourceConnectionPrivilege#connection_id} + */ + readonly connectionId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege#id DliDatasourceConnectionPrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The list of permissions granted to the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege#privileges DliDatasourceConnectionPrivilege#privileges} + */ + readonly privileges?: string[]; + /** + * The ID of the granted project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege#project_id DliDatasourceConnectionPrivilege#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege#region DliDatasourceConnectionPrivilege#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege huaweicloud_dli_datasource_connection_privilege} +*/ +export class DliDatasourceConnectionPrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_datasource_connection_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliDatasourceConnectionPrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliDatasourceConnectionPrivilege to import + * @param importFromId The id of the existing DliDatasourceConnectionPrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliDatasourceConnectionPrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_datasource_connection_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection_privilege huaweicloud_dli_datasource_connection_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliDatasourceConnectionPrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: DliDatasourceConnectionPrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_datasource_connection_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._id = config.id; + this._privileges = config.privileges; + this._projectId = config.projectId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: false, required: true + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // privileges - computed: true, optional: true, required: false + private _privileges?: string[]; + public get privileges() { + return cdktf.Fn.tolist(this.getListAttribute('privileges')); + } + public set privileges(value: string[]) { + this._privileges = value; + } + public resetPrivileges() { + this._privileges = undefined; + } + // Temporarily expose input value. Use with caution. + public get privilegesInput() { + return this._privileges; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + id: cdktf.stringToTerraform(this._id), + privileges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._privileges), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + privileges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._privileges), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-datasource-connection/README.md b/src/constructs/providers/huaweicloud/dli-datasource-connection/README.md new file mode 100644 index 00000000..e150144d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_datasource_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_datasource_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection). diff --git a/src/constructs/providers/huaweicloud/dli-datasource-connection/index.ts b/src/constructs/providers/huaweicloud/dli-datasource-connection/index.ts new file mode 100644 index 00000000..98596302 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-datasource-connection/index.ts @@ -0,0 +1,674 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliDatasourceConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#id DliDatasourceConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of a datasource connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#name DliDatasourceConnection#name} + */ + readonly name: string; + /** + * List of queue names that are available for datasource connections. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#queues DliDatasourceConnection#queues} + */ + readonly queues?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#region DliDatasourceConnection#region} + */ + readonly region?: string; + /** + * The route table ID associated with the subnet of the service to be connected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#route_table_id DliDatasourceConnection#route_table_id} + */ + readonly routeTableId?: string; + /** + * The subnet ID of the service to be connected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#subnet_id DliDatasourceConnection#subnet_id} + */ + readonly subnetId: string; + /** + * The key/value pairs to associate with the datasource connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#tags DliDatasourceConnection#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID of the service to be connected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#vpc_id DliDatasourceConnection#vpc_id} + */ + readonly vpcId: string; + /** + * hosts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#hosts DliDatasourceConnection#hosts} + */ + readonly hosts?: DliDatasourceConnectionHosts[] | cdktf.IResolvable; + /** + * routes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#routes DliDatasourceConnection#routes} + */ + readonly routes?: DliDatasourceConnectionRoutes[] | cdktf.IResolvable; +} +export interface DliDatasourceConnectionHosts { + /** + * IPv4 address of the host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#ip DliDatasourceConnection#ip} + */ + readonly ip: string; + /** + * The user-defined host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#name DliDatasourceConnection#name} + */ + readonly name: string; +} + +export function dliDatasourceConnectionHostsToTerraform(struct?: DliDatasourceConnectionHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip: cdktf.stringToTerraform(struct!.ip), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dliDatasourceConnectionHostsToHclTerraform(struct?: DliDatasourceConnectionHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliDatasourceConnectionHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliDatasourceConnectionHosts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliDatasourceConnectionHosts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ip = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ip = value.ip; + this._name = value.name; + } + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DliDatasourceConnectionHostsList extends cdktf.ComplexList { + public internalValue? : DliDatasourceConnectionHosts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliDatasourceConnectionHostsOutputReference { + return new DliDatasourceConnectionHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliDatasourceConnectionRoutes { + /** + * The CIDR of the route. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#cidr DliDatasourceConnection#cidr} + */ + readonly cidr: string; + /** + * The route Name + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#name DliDatasourceConnection#name} + */ + readonly name: string; +} + +export function dliDatasourceConnectionRoutesToTerraform(struct?: DliDatasourceConnectionRoutes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cidr: cdktf.stringToTerraform(struct!.cidr), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dliDatasourceConnectionRoutesToHclTerraform(struct?: DliDatasourceConnectionRoutes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(struct!.cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliDatasourceConnectionRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliDatasourceConnectionRoutes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cidr !== undefined) { + hasAnyValues = true; + internalValueResult.cidr = this._cidr; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliDatasourceConnectionRoutes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cidr = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cidr = value.cidr; + this._name = value.name; + } + } + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DliDatasourceConnectionRoutesList extends cdktf.ComplexList { + public internalValue? : DliDatasourceConnectionRoutes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliDatasourceConnectionRoutesOutputReference { + return new DliDatasourceConnectionRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection huaweicloud_dli_datasource_connection} +*/ +export class DliDatasourceConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_datasource_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliDatasourceConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliDatasourceConnection to import + * @param importFromId The id of the existing DliDatasourceConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliDatasourceConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_datasource_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_datasource_connection huaweicloud_dli_datasource_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliDatasourceConnectionConfig + */ + public constructor(scope: Construct, id: string, config: DliDatasourceConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_datasource_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._queues = config.queues; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._hosts.internalValue = config.hosts; + this._routes.internalValue = config.routes; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // queues - computed: true, optional: true, required: false + private _queues?: string[]; + public get queues() { + return cdktf.Fn.tolist(this.getListAttribute('queues')); + } + public set queues(value: string[]) { + this._queues = value; + } + public resetQueues() { + this._queues = undefined; + } + // Temporarily expose input value. Use with caution. + public get queuesInput() { + return this._queues; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: true, optional: true, required: false + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + public resetRouteTableId() { + this._routeTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // hosts - computed: false, optional: true, required: false + private _hosts = new DliDatasourceConnectionHostsList(this, "hosts", false); + public get hosts() { + return this._hosts; + } + public putHosts(value: DliDatasourceConnectionHosts[] | cdktf.IResolvable) { + this._hosts.internalValue = value; + } + public resetHosts() { + this._hosts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostsInput() { + return this._hosts.internalValue; + } + + // routes - computed: false, optional: true, required: false + private _routes = new DliDatasourceConnectionRoutesList(this, "routes", true); + public get routes() { + return this._routes; + } + public putRoutes(value: DliDatasourceConnectionRoutes[] | cdktf.IResolvable) { + this._routes.internalValue = value; + } + public resetRoutes() { + this._routes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routesInput() { + return this._routes.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + queues: cdktf.listMapper(cdktf.stringToTerraform, false)(this._queues), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + hosts: cdktf.listMapper(dliDatasourceConnectionHostsToTerraform, true)(this._hosts.internalValue), + routes: cdktf.listMapper(dliDatasourceConnectionRoutesToTerraform, true)(this._routes.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queues: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._queues), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hosts: { + value: cdktf.listMapperHcl(dliDatasourceConnectionHostsToHclTerraform, true)(this._hosts.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliDatasourceConnectionHostsList", + }, + routes: { + value: cdktf.listMapperHcl(dliDatasourceConnectionRoutesToHclTerraform, true)(this._routes.internalValue), + isBlock: true, + type: "set", + storageClassType: "DliDatasourceConnectionRoutesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-elastic-resource-pool/README.md b/src/constructs/providers/huaweicloud/dli-elastic-resource-pool/README.md new file mode 100644 index 00000000..1b1e0ff6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-elastic-resource-pool/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_elastic_resource_pool` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_elastic_resource_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool). diff --git a/src/constructs/providers/huaweicloud/dli-elastic-resource-pool/index.ts b/src/constructs/providers/huaweicloud/dli-elastic-resource-pool/index.ts new file mode 100644 index 00000000..0b5bdf84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-elastic-resource-pool/index.ts @@ -0,0 +1,522 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliElasticResourcePoolConfig extends cdktf.TerraformMetaArguments { + /** + * The CIDR block of network to associate with the elastic resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#cidr DliElasticResourcePool#cidr} + */ + readonly cidr?: string; + /** + * The description of the elastic resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#description DliElasticResourcePool#description} + */ + readonly description?: string; + /** + * The ID of the enterprise project to which the elastic resource pool belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#enterprise_project_id DliElasticResourcePool#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#id DliElasticResourcePool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The maximum number of CUs for elastic resource pool scaling. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#max_cu DliElasticResourcePool#max_cu} + */ + readonly maxCu: number; + /** + * The minimum number of CUs for elastic resource pool scaling. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#min_cu DliElasticResourcePool#min_cu} + */ + readonly minCu: number; + /** + * The name of the elastic resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#name DliElasticResourcePool#name} + */ + readonly name: string; + /** + * The region where the elastic resource pool is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#region DliElasticResourcePool#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#tags DliElasticResourcePool#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#timeouts DliElasticResourcePool#timeouts} + */ + readonly timeouts?: DliElasticResourcePoolTimeouts; +} +export interface DliElasticResourcePoolTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#default DliElasticResourcePool#default} + */ + readonly default?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#delete DliElasticResourcePool#delete} + */ + readonly delete?: string; +} + +export function dliElasticResourcePoolTimeoutsToTerraform(struct?: DliElasticResourcePoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default: cdktf.stringToTerraform(struct!.default), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dliElasticResourcePoolTimeoutsToHclTerraform(struct?: DliElasticResourcePoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default: { + value: cdktf.stringToHclTerraform(struct!.default), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliElasticResourcePoolTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliElasticResourcePoolTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._default !== undefined) { + hasAnyValues = true; + internalValueResult.default = this._default; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliElasticResourcePoolTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._default = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._default = value.default; + this._delete = value.delete; + } + } + + // default - computed: false, optional: true, required: false + private _default?: string; + public get default() { + return this.getStringAttribute('default'); + } + public set default(value: string) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool huaweicloud_dli_elastic_resource_pool} +*/ +export class DliElasticResourcePool extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_elastic_resource_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliElasticResourcePool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliElasticResourcePool to import + * @param importFromId The id of the existing DliElasticResourcePool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliElasticResourcePool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_elastic_resource_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_elastic_resource_pool huaweicloud_dli_elastic_resource_pool} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliElasticResourcePoolConfig + */ + public constructor(scope: Construct, id: string, config: DliElasticResourcePoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_elastic_resource_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._maxCu = config.maxCu; + this._minCu = config.minCu; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // actual_cu - computed: true, optional: false, required: false + public get actualCu() { + return this.getNumberAttribute('actual_cu'); + } + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_cu - computed: true, optional: false, required: false + public get currentCu() { + return this.getNumberAttribute('current_cu'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_cu - computed: false, optional: false, required: true + private _maxCu?: number; + public get maxCu() { + return this.getNumberAttribute('max_cu'); + } + public set maxCu(value: number) { + this._maxCu = value; + } + // Temporarily expose input value. Use with caution. + public get maxCuInput() { + return this._maxCu; + } + + // min_cu - computed: false, optional: false, required: true + private _minCu?: number; + public get minCu() { + return this.getNumberAttribute('min_cu'); + } + public set minCu(value: number) { + this._minCu = value; + } + // Temporarily expose input value. Use with caution. + public get minCuInput() { + return this._minCu; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliElasticResourcePoolTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliElasticResourcePoolTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + max_cu: cdktf.numberToTerraform(this._maxCu), + min_cu: cdktf.numberToTerraform(this._minCu), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: dliElasticResourcePoolTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_cu: { + value: cdktf.numberToHclTerraform(this._maxCu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_cu: { + value: cdktf.numberToHclTerraform(this._minCu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: dliElasticResourcePoolTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliElasticResourcePoolTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-flink-template/README.md b/src/constructs/providers/huaweicloud/dli-flink-template/README.md new file mode 100644 index 00000000..6c33d2bd --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-flink-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_flink_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_flink_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template). diff --git a/src/constructs/providers/huaweicloud/dli-flink-template/index.ts b/src/constructs/providers/huaweicloud/dli-flink-template/index.ts new file mode 100644 index 00000000..c5cb9eb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-flink-template/index.ts @@ -0,0 +1,291 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliFlinkTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#description DliFlinkTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#id DliFlinkTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#name DliFlinkTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#region DliFlinkTemplate#region} + */ + readonly region?: string; + /** + * The statement of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#sql DliFlinkTemplate#sql} + */ + readonly sql?: string; + /** + * The key/value pairs to associate with the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#tags DliFlinkTemplate#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The type of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#type DliFlinkTemplate#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template huaweicloud_dli_flink_template} +*/ +export class DliFlinkTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_flink_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliFlinkTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliFlinkTemplate to import + * @param importFromId The id of the existing DliFlinkTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliFlinkTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_flink_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flink_template huaweicloud_dli_flink_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliFlinkTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DliFlinkTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_flink_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sql = config.sql; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sql - computed: true, optional: true, required: false + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + public resetSql() { + this._sql = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sql: cdktf.stringToTerraform(this._sql), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-flinkjar-job/README.md b/src/constructs/providers/huaweicloud/dli-flinkjar-job/README.md new file mode 100644 index 00000000..168b2737 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-flinkjar-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_flinkjar_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_flinkjar_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job). diff --git a/src/constructs/providers/huaweicloud/dli-flinkjar-job/index.ts b/src/constructs/providers/huaweicloud/dli-flinkjar-job/index.ts new file mode 100644 index 00000000..73f1d7dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-flinkjar-job/index.ts @@ -0,0 +1,1036 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliFlinkjarJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#checkpoint_path DliFlinkjarJob#checkpoint_path} + */ + readonly checkpointPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#cu_num DliFlinkjarJob#cu_num} + */ + readonly cuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#dependency_files DliFlinkjarJob#dependency_files} + */ + readonly dependencyFiles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#dependency_jars DliFlinkjarJob#dependency_jars} + */ + readonly dependencyJars?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#description DliFlinkjarJob#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#entrypoint DliFlinkjarJob#entrypoint} + */ + readonly entrypoint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#entrypoint_args DliFlinkjarJob#entrypoint_args} + */ + readonly entrypointArgs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#feature DliFlinkjarJob#feature} + */ + readonly feature?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#flink_version DliFlinkjarJob#flink_version} + */ + readonly flinkVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#id DliFlinkjarJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#image DliFlinkjarJob#image} + */ + readonly image?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#log_enabled DliFlinkjarJob#log_enabled} + */ + readonly logEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#main_class DliFlinkjarJob#main_class} + */ + readonly mainClass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#manager_cu_num DliFlinkjarJob#manager_cu_num} + */ + readonly managerCuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#name DliFlinkjarJob#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#obs_bucket DliFlinkjarJob#obs_bucket} + */ + readonly obsBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#parallel_num DliFlinkjarJob#parallel_num} + */ + readonly parallelNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#queue_name DliFlinkjarJob#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#region DliFlinkjarJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#restart_when_exception DliFlinkjarJob#restart_when_exception} + */ + readonly restartWhenException?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#resume_checkpoint DliFlinkjarJob#resume_checkpoint} + */ + readonly resumeCheckpoint?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#resume_max_num DliFlinkjarJob#resume_max_num} + */ + readonly resumeMaxNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#runtime_config DliFlinkjarJob#runtime_config} + */ + readonly runtimeConfig?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#smn_topic DliFlinkjarJob#smn_topic} + */ + readonly smnTopic?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#tags DliFlinkjarJob#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#tm_cu_num DliFlinkjarJob#tm_cu_num} + */ + readonly tmCuNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#tm_slot_num DliFlinkjarJob#tm_slot_num} + */ + readonly tmSlotNum?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#timeouts DliFlinkjarJob#timeouts} + */ + readonly timeouts?: DliFlinkjarJobTimeouts; +} +export interface DliFlinkjarJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#create DliFlinkjarJob#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#delete DliFlinkjarJob#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#update DliFlinkjarJob#update} + */ + readonly update?: string; +} + +export function dliFlinkjarJobTimeoutsToTerraform(struct?: DliFlinkjarJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dliFlinkjarJobTimeoutsToHclTerraform(struct?: DliFlinkjarJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliFlinkjarJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliFlinkjarJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliFlinkjarJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job huaweicloud_dli_flinkjar_job} +*/ +export class DliFlinkjarJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_flinkjar_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliFlinkjarJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliFlinkjarJob to import + * @param importFromId The id of the existing DliFlinkjarJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliFlinkjarJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_flinkjar_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinkjar_job huaweicloud_dli_flinkjar_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliFlinkjarJobConfig + */ + public constructor(scope: Construct, id: string, config: DliFlinkjarJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_flinkjar_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._checkpointPath = config.checkpointPath; + this._cuNum = config.cuNum; + this._dependencyFiles = config.dependencyFiles; + this._dependencyJars = config.dependencyJars; + this._description = config.description; + this._entrypoint = config.entrypoint; + this._entrypointArgs = config.entrypointArgs; + this._feature = config.feature; + this._flinkVersion = config.flinkVersion; + this._id = config.id; + this._image = config.image; + this._logEnabled = config.logEnabled; + this._mainClass = config.mainClass; + this._managerCuNum = config.managerCuNum; + this._name = config.name; + this._obsBucket = config.obsBucket; + this._parallelNum = config.parallelNum; + this._queueName = config.queueName; + this._region = config.region; + this._restartWhenException = config.restartWhenException; + this._resumeCheckpoint = config.resumeCheckpoint; + this._resumeMaxNum = config.resumeMaxNum; + this._runtimeConfig = config.runtimeConfig; + this._smnTopic = config.smnTopic; + this._tags = config.tags; + this._tmCuNum = config.tmCuNum; + this._tmSlotNum = config.tmSlotNum; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // checkpoint_path - computed: false, optional: true, required: false + private _checkpointPath?: string; + public get checkpointPath() { + return this.getStringAttribute('checkpoint_path'); + } + public set checkpointPath(value: string) { + this._checkpointPath = value; + } + public resetCheckpointPath() { + this._checkpointPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get checkpointPathInput() { + return this._checkpointPath; + } + + // cu_num - computed: false, optional: true, required: false + private _cuNum?: number; + public get cuNum() { + return this.getNumberAttribute('cu_num'); + } + public set cuNum(value: number) { + this._cuNum = value; + } + public resetCuNum() { + this._cuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get cuNumInput() { + return this._cuNum; + } + + // dependency_files - computed: false, optional: true, required: false + private _dependencyFiles?: string[]; + public get dependencyFiles() { + return this.getListAttribute('dependency_files'); + } + public set dependencyFiles(value: string[]) { + this._dependencyFiles = value; + } + public resetDependencyFiles() { + this._dependencyFiles = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependencyFilesInput() { + return this._dependencyFiles; + } + + // dependency_jars - computed: false, optional: true, required: false + private _dependencyJars?: string[]; + public get dependencyJars() { + return this.getListAttribute('dependency_jars'); + } + public set dependencyJars(value: string[]) { + this._dependencyJars = value; + } + public resetDependencyJars() { + this._dependencyJars = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependencyJarsInput() { + return this._dependencyJars; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // entrypoint - computed: false, optional: true, required: false + private _entrypoint?: string; + public get entrypoint() { + return this.getStringAttribute('entrypoint'); + } + public set entrypoint(value: string) { + this._entrypoint = value; + } + public resetEntrypoint() { + this._entrypoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get entrypointInput() { + return this._entrypoint; + } + + // entrypoint_args - computed: false, optional: true, required: false + private _entrypointArgs?: string; + public get entrypointArgs() { + return this.getStringAttribute('entrypoint_args'); + } + public set entrypointArgs(value: string) { + this._entrypointArgs = value; + } + public resetEntrypointArgs() { + this._entrypointArgs = undefined; + } + // Temporarily expose input value. Use with caution. + public get entrypointArgsInput() { + return this._entrypointArgs; + } + + // feature - computed: true, optional: true, required: false + private _feature?: string; + public get feature() { + return this.getStringAttribute('feature'); + } + public set feature(value: string) { + this._feature = value; + } + public resetFeature() { + this._feature = undefined; + } + // Temporarily expose input value. Use with caution. + public get featureInput() { + return this._feature; + } + + // flink_version - computed: true, optional: true, required: false + private _flinkVersion?: string; + public get flinkVersion() { + return this.getStringAttribute('flink_version'); + } + public set flinkVersion(value: string) { + this._flinkVersion = value; + } + public resetFlinkVersion() { + this._flinkVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get flinkVersionInput() { + return this._flinkVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image - computed: false, optional: true, required: false + private _image?: string; + public get image() { + return this.getStringAttribute('image'); + } + public set image(value: string) { + this._image = value; + } + public resetImage() { + this._image = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageInput() { + return this._image; + } + + // log_enabled - computed: false, optional: true, required: false + private _logEnabled?: boolean | cdktf.IResolvable; + public get logEnabled() { + return this.getBooleanAttribute('log_enabled'); + } + public set logEnabled(value: boolean | cdktf.IResolvable) { + this._logEnabled = value; + } + public resetLogEnabled() { + this._logEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get logEnabledInput() { + return this._logEnabled; + } + + // main_class - computed: false, optional: true, required: false + private _mainClass?: string; + public get mainClass() { + return this.getStringAttribute('main_class'); + } + public set mainClass(value: string) { + this._mainClass = value; + } + public resetMainClass() { + this._mainClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get mainClassInput() { + return this._mainClass; + } + + // manager_cu_num - computed: false, optional: true, required: false + private _managerCuNum?: number; + public get managerCuNum() { + return this.getNumberAttribute('manager_cu_num'); + } + public set managerCuNum(value: number) { + this._managerCuNum = value; + } + public resetManagerCuNum() { + this._managerCuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerCuNumInput() { + return this._managerCuNum; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // obs_bucket - computed: false, optional: true, required: false + private _obsBucket?: string; + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + public set obsBucket(value: string) { + this._obsBucket = value; + } + public resetObsBucket() { + this._obsBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketInput() { + return this._obsBucket; + } + + // parallel_num - computed: false, optional: true, required: false + private _parallelNum?: number; + public get parallelNum() { + return this.getNumberAttribute('parallel_num'); + } + public set parallelNum(value: number) { + this._parallelNum = value; + } + public resetParallelNum() { + this._parallelNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get parallelNumInput() { + return this._parallelNum; + } + + // queue_name - computed: true, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restart_when_exception - computed: false, optional: true, required: false + private _restartWhenException?: boolean | cdktf.IResolvable; + public get restartWhenException() { + return this.getBooleanAttribute('restart_when_exception'); + } + public set restartWhenException(value: boolean | cdktf.IResolvable) { + this._restartWhenException = value; + } + public resetRestartWhenException() { + this._restartWhenException = undefined; + } + // Temporarily expose input value. Use with caution. + public get restartWhenExceptionInput() { + return this._restartWhenException; + } + + // resume_checkpoint - computed: false, optional: true, required: false + private _resumeCheckpoint?: boolean | cdktf.IResolvable; + public get resumeCheckpoint() { + return this.getBooleanAttribute('resume_checkpoint'); + } + public set resumeCheckpoint(value: boolean | cdktf.IResolvable) { + this._resumeCheckpoint = value; + } + public resetResumeCheckpoint() { + this._resumeCheckpoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get resumeCheckpointInput() { + return this._resumeCheckpoint; + } + + // resume_max_num - computed: false, optional: true, required: false + private _resumeMaxNum?: number; + public get resumeMaxNum() { + return this.getNumberAttribute('resume_max_num'); + } + public set resumeMaxNum(value: number) { + this._resumeMaxNum = value; + } + public resetResumeMaxNum() { + this._resumeMaxNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get resumeMaxNumInput() { + return this._resumeMaxNum; + } + + // runtime_config - computed: false, optional: true, required: false + private _runtimeConfig?: { [key: string]: string }; + public get runtimeConfig() { + return this.getStringMapAttribute('runtime_config'); + } + public set runtimeConfig(value: { [key: string]: string }) { + this._runtimeConfig = value; + } + public resetRuntimeConfig() { + this._runtimeConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeConfigInput() { + return this._runtimeConfig; + } + + // smn_topic - computed: false, optional: true, required: false + private _smnTopic?: string; + public get smnTopic() { + return this.getStringAttribute('smn_topic'); + } + public set smnTopic(value: string) { + this._smnTopic = value; + } + public resetSmnTopic() { + this._smnTopic = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnTopicInput() { + return this._smnTopic; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tm_cu_num - computed: false, optional: true, required: false + private _tmCuNum?: number; + public get tmCuNum() { + return this.getNumberAttribute('tm_cu_num'); + } + public set tmCuNum(value: number) { + this._tmCuNum = value; + } + public resetTmCuNum() { + this._tmCuNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmCuNumInput() { + return this._tmCuNum; + } + + // tm_slot_num - computed: true, optional: true, required: false + private _tmSlotNum?: number; + public get tmSlotNum() { + return this.getNumberAttribute('tm_slot_num'); + } + public set tmSlotNum(value: number) { + this._tmSlotNum = value; + } + public resetTmSlotNum() { + this._tmSlotNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmSlotNumInput() { + return this._tmSlotNum; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliFlinkjarJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliFlinkjarJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + checkpoint_path: cdktf.stringToTerraform(this._checkpointPath), + cu_num: cdktf.numberToTerraform(this._cuNum), + dependency_files: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dependencyFiles), + dependency_jars: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dependencyJars), + description: cdktf.stringToTerraform(this._description), + entrypoint: cdktf.stringToTerraform(this._entrypoint), + entrypoint_args: cdktf.stringToTerraform(this._entrypointArgs), + feature: cdktf.stringToTerraform(this._feature), + flink_version: cdktf.stringToTerraform(this._flinkVersion), + id: cdktf.stringToTerraform(this._id), + image: cdktf.stringToTerraform(this._image), + log_enabled: cdktf.booleanToTerraform(this._logEnabled), + main_class: cdktf.stringToTerraform(this._mainClass), + manager_cu_num: cdktf.numberToTerraform(this._managerCuNum), + name: cdktf.stringToTerraform(this._name), + obs_bucket: cdktf.stringToTerraform(this._obsBucket), + parallel_num: cdktf.numberToTerraform(this._parallelNum), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + restart_when_exception: cdktf.booleanToTerraform(this._restartWhenException), + resume_checkpoint: cdktf.booleanToTerraform(this._resumeCheckpoint), + resume_max_num: cdktf.numberToTerraform(this._resumeMaxNum), + runtime_config: cdktf.hashMapper(cdktf.stringToTerraform)(this._runtimeConfig), + smn_topic: cdktf.stringToTerraform(this._smnTopic), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tm_cu_num: cdktf.numberToTerraform(this._tmCuNum), + tm_slot_num: cdktf.numberToTerraform(this._tmSlotNum), + timeouts: dliFlinkjarJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + checkpoint_path: { + value: cdktf.stringToHclTerraform(this._checkpointPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cu_num: { + value: cdktf.numberToHclTerraform(this._cuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dependency_files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dependencyFiles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + dependency_jars: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dependencyJars), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + entrypoint: { + value: cdktf.stringToHclTerraform(this._entrypoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + entrypoint_args: { + value: cdktf.stringToHclTerraform(this._entrypointArgs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + feature: { + value: cdktf.stringToHclTerraform(this._feature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flink_version: { + value: cdktf.stringToHclTerraform(this._flinkVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image: { + value: cdktf.stringToHclTerraform(this._image), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_enabled: { + value: cdktf.booleanToHclTerraform(this._logEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + main_class: { + value: cdktf.stringToHclTerraform(this._mainClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_cu_num: { + value: cdktf.numberToHclTerraform(this._managerCuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket: { + value: cdktf.stringToHclTerraform(this._obsBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parallel_num: { + value: cdktf.numberToHclTerraform(this._parallelNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restart_when_exception: { + value: cdktf.booleanToHclTerraform(this._restartWhenException), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + resume_checkpoint: { + value: cdktf.booleanToHclTerraform(this._resumeCheckpoint), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + resume_max_num: { + value: cdktf.numberToHclTerraform(this._resumeMaxNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + runtime_config: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._runtimeConfig), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + smn_topic: { + value: cdktf.stringToHclTerraform(this._smnTopic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tm_cu_num: { + value: cdktf.numberToHclTerraform(this._tmCuNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tm_slot_num: { + value: cdktf.numberToHclTerraform(this._tmSlotNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: dliFlinkjarJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliFlinkjarJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-flinksql-job/README.md b/src/constructs/providers/huaweicloud/dli-flinksql-job/README.md new file mode 100644 index 00000000..9aaad58c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-flinksql-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_flinksql_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_flinksql_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job). diff --git a/src/constructs/providers/huaweicloud/dli-flinksql-job/index.ts b/src/constructs/providers/huaweicloud/dli-flinksql-job/index.ts new file mode 100644 index 00000000..cc7ac0ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-flinksql-job/index.ts @@ -0,0 +1,1209 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliFlinksqlJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#checkpoint_enabled DliFlinksqlJob#checkpoint_enabled} + */ + readonly checkpointEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#checkpoint_interval DliFlinksqlJob#checkpoint_interval} + */ + readonly checkpointInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#checkpoint_mode DliFlinksqlJob#checkpoint_mode} + */ + readonly checkpointMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#cu_number DliFlinksqlJob#cu_number} + */ + readonly cuNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#description DliFlinksqlJob#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#dirty_data_strategy DliFlinksqlJob#dirty_data_strategy} + */ + readonly dirtyDataStrategy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#edge_group_ids DliFlinksqlJob#edge_group_ids} + */ + readonly edgeGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#flink_version DliFlinksqlJob#flink_version} + */ + readonly flinkVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#graph_type DliFlinksqlJob#graph_type} + */ + readonly graphType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#id DliFlinksqlJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#idle_state_retention DliFlinksqlJob#idle_state_retention} + */ + readonly idleStateRetention?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#log_enabled DliFlinksqlJob#log_enabled} + */ + readonly logEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#manager_cu_number DliFlinksqlJob#manager_cu_number} + */ + readonly managerCuNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#name DliFlinksqlJob#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#obs_bucket DliFlinksqlJob#obs_bucket} + */ + readonly obsBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#operator_config DliFlinksqlJob#operator_config} + */ + readonly operatorConfig?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#parallel_number DliFlinksqlJob#parallel_number} + */ + readonly parallelNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#queue_name DliFlinksqlJob#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#region DliFlinksqlJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#restart_when_exception DliFlinksqlJob#restart_when_exception} + */ + readonly restartWhenException?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#resume_checkpoint DliFlinksqlJob#resume_checkpoint} + */ + readonly resumeCheckpoint?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#resume_max_num DliFlinksqlJob#resume_max_num} + */ + readonly resumeMaxNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#run_mode DliFlinksqlJob#run_mode} + */ + readonly runMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#runtime_config DliFlinksqlJob#runtime_config} + */ + readonly runtimeConfig?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#smn_topic DliFlinksqlJob#smn_topic} + */ + readonly smnTopic?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#sql DliFlinksqlJob#sql} + */ + readonly sql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#static_estimator DliFlinksqlJob#static_estimator} + */ + readonly staticEstimator?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#static_estimator_config DliFlinksqlJob#static_estimator_config} + */ + readonly staticEstimatorConfig?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#tags DliFlinksqlJob#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#tm_cus DliFlinksqlJob#tm_cus} + */ + readonly tmCus?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#tm_slot_num DliFlinksqlJob#tm_slot_num} + */ + readonly tmSlotNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#type DliFlinksqlJob#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#udf_jar_url DliFlinksqlJob#udf_jar_url} + */ + readonly udfJarUrl?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#timeouts DliFlinksqlJob#timeouts} + */ + readonly timeouts?: DliFlinksqlJobTimeouts; +} +export interface DliFlinksqlJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#create DliFlinksqlJob#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#delete DliFlinksqlJob#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#update DliFlinksqlJob#update} + */ + readonly update?: string; +} + +export function dliFlinksqlJobTimeoutsToTerraform(struct?: DliFlinksqlJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dliFlinksqlJobTimeoutsToHclTerraform(struct?: DliFlinksqlJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliFlinksqlJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliFlinksqlJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliFlinksqlJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job huaweicloud_dli_flinksql_job} +*/ +export class DliFlinksqlJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_flinksql_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliFlinksqlJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliFlinksqlJob to import + * @param importFromId The id of the existing DliFlinksqlJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliFlinksqlJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_flinksql_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_flinksql_job huaweicloud_dli_flinksql_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliFlinksqlJobConfig + */ + public constructor(scope: Construct, id: string, config: DliFlinksqlJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_flinksql_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._checkpointEnabled = config.checkpointEnabled; + this._checkpointInterval = config.checkpointInterval; + this._checkpointMode = config.checkpointMode; + this._cuNumber = config.cuNumber; + this._description = config.description; + this._dirtyDataStrategy = config.dirtyDataStrategy; + this._edgeGroupIds = config.edgeGroupIds; + this._flinkVersion = config.flinkVersion; + this._graphType = config.graphType; + this._id = config.id; + this._idleStateRetention = config.idleStateRetention; + this._logEnabled = config.logEnabled; + this._managerCuNumber = config.managerCuNumber; + this._name = config.name; + this._obsBucket = config.obsBucket; + this._operatorConfig = config.operatorConfig; + this._parallelNumber = config.parallelNumber; + this._queueName = config.queueName; + this._region = config.region; + this._restartWhenException = config.restartWhenException; + this._resumeCheckpoint = config.resumeCheckpoint; + this._resumeMaxNum = config.resumeMaxNum; + this._runMode = config.runMode; + this._runtimeConfig = config.runtimeConfig; + this._smnTopic = config.smnTopic; + this._sql = config.sql; + this._staticEstimator = config.staticEstimator; + this._staticEstimatorConfig = config.staticEstimatorConfig; + this._tags = config.tags; + this._tmCus = config.tmCus; + this._tmSlotNum = config.tmSlotNum; + this._type = config.type; + this._udfJarUrl = config.udfJarUrl; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // checkpoint_enabled - computed: false, optional: true, required: false + private _checkpointEnabled?: boolean | cdktf.IResolvable; + public get checkpointEnabled() { + return this.getBooleanAttribute('checkpoint_enabled'); + } + public set checkpointEnabled(value: boolean | cdktf.IResolvable) { + this._checkpointEnabled = value; + } + public resetCheckpointEnabled() { + this._checkpointEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get checkpointEnabledInput() { + return this._checkpointEnabled; + } + + // checkpoint_interval - computed: false, optional: true, required: false + private _checkpointInterval?: number; + public get checkpointInterval() { + return this.getNumberAttribute('checkpoint_interval'); + } + public set checkpointInterval(value: number) { + this._checkpointInterval = value; + } + public resetCheckpointInterval() { + this._checkpointInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get checkpointIntervalInput() { + return this._checkpointInterval; + } + + // checkpoint_mode - computed: false, optional: true, required: false + private _checkpointMode?: string; + public get checkpointMode() { + return this.getStringAttribute('checkpoint_mode'); + } + public set checkpointMode(value: string) { + this._checkpointMode = value; + } + public resetCheckpointMode() { + this._checkpointMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get checkpointModeInput() { + return this._checkpointMode; + } + + // cu_number - computed: false, optional: true, required: false + private _cuNumber?: number; + public get cuNumber() { + return this.getNumberAttribute('cu_number'); + } + public set cuNumber(value: number) { + this._cuNumber = value; + } + public resetCuNumber() { + this._cuNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get cuNumberInput() { + return this._cuNumber; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dirty_data_strategy - computed: false, optional: true, required: false + private _dirtyDataStrategy?: string; + public get dirtyDataStrategy() { + return this.getStringAttribute('dirty_data_strategy'); + } + public set dirtyDataStrategy(value: string) { + this._dirtyDataStrategy = value; + } + public resetDirtyDataStrategy() { + this._dirtyDataStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get dirtyDataStrategyInput() { + return this._dirtyDataStrategy; + } + + // edge_group_ids - computed: false, optional: true, required: false + private _edgeGroupIds?: string[]; + public get edgeGroupIds() { + return this.getListAttribute('edge_group_ids'); + } + public set edgeGroupIds(value: string[]) { + this._edgeGroupIds = value; + } + public resetEdgeGroupIds() { + this._edgeGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get edgeGroupIdsInput() { + return this._edgeGroupIds; + } + + // flink_version - computed: false, optional: true, required: false + private _flinkVersion?: string; + public get flinkVersion() { + return this.getStringAttribute('flink_version'); + } + public set flinkVersion(value: string) { + this._flinkVersion = value; + } + public resetFlinkVersion() { + this._flinkVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get flinkVersionInput() { + return this._flinkVersion; + } + + // graph_type - computed: false, optional: true, required: false + private _graphType?: string; + public get graphType() { + return this.getStringAttribute('graph_type'); + } + public set graphType(value: string) { + this._graphType = value; + } + public resetGraphType() { + this._graphType = undefined; + } + // Temporarily expose input value. Use with caution. + public get graphTypeInput() { + return this._graphType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // idle_state_retention - computed: false, optional: true, required: false + private _idleStateRetention?: number; + public get idleStateRetention() { + return this.getNumberAttribute('idle_state_retention'); + } + public set idleStateRetention(value: number) { + this._idleStateRetention = value; + } + public resetIdleStateRetention() { + this._idleStateRetention = undefined; + } + // Temporarily expose input value. Use with caution. + public get idleStateRetentionInput() { + return this._idleStateRetention; + } + + // log_enabled - computed: false, optional: true, required: false + private _logEnabled?: boolean | cdktf.IResolvable; + public get logEnabled() { + return this.getBooleanAttribute('log_enabled'); + } + public set logEnabled(value: boolean | cdktf.IResolvable) { + this._logEnabled = value; + } + public resetLogEnabled() { + this._logEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get logEnabledInput() { + return this._logEnabled; + } + + // manager_cu_number - computed: false, optional: true, required: false + private _managerCuNumber?: number; + public get managerCuNumber() { + return this.getNumberAttribute('manager_cu_number'); + } + public set managerCuNumber(value: number) { + this._managerCuNumber = value; + } + public resetManagerCuNumber() { + this._managerCuNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerCuNumberInput() { + return this._managerCuNumber; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // obs_bucket - computed: false, optional: true, required: false + private _obsBucket?: string; + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + public set obsBucket(value: string) { + this._obsBucket = value; + } + public resetObsBucket() { + this._obsBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketInput() { + return this._obsBucket; + } + + // operator_config - computed: false, optional: true, required: false + private _operatorConfig?: string; + public get operatorConfig() { + return this.getStringAttribute('operator_config'); + } + public set operatorConfig(value: string) { + this._operatorConfig = value; + } + public resetOperatorConfig() { + this._operatorConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get operatorConfigInput() { + return this._operatorConfig; + } + + // parallel_number - computed: false, optional: true, required: false + private _parallelNumber?: number; + public get parallelNumber() { + return this.getNumberAttribute('parallel_number'); + } + public set parallelNumber(value: number) { + this._parallelNumber = value; + } + public resetParallelNumber() { + this._parallelNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get parallelNumberInput() { + return this._parallelNumber; + } + + // queue_name - computed: true, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restart_when_exception - computed: false, optional: true, required: false + private _restartWhenException?: boolean | cdktf.IResolvable; + public get restartWhenException() { + return this.getBooleanAttribute('restart_when_exception'); + } + public set restartWhenException(value: boolean | cdktf.IResolvable) { + this._restartWhenException = value; + } + public resetRestartWhenException() { + this._restartWhenException = undefined; + } + // Temporarily expose input value. Use with caution. + public get restartWhenExceptionInput() { + return this._restartWhenException; + } + + // resume_checkpoint - computed: false, optional: true, required: false + private _resumeCheckpoint?: boolean | cdktf.IResolvable; + public get resumeCheckpoint() { + return this.getBooleanAttribute('resume_checkpoint'); + } + public set resumeCheckpoint(value: boolean | cdktf.IResolvable) { + this._resumeCheckpoint = value; + } + public resetResumeCheckpoint() { + this._resumeCheckpoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get resumeCheckpointInput() { + return this._resumeCheckpoint; + } + + // resume_max_num - computed: false, optional: true, required: false + private _resumeMaxNum?: number; + public get resumeMaxNum() { + return this.getNumberAttribute('resume_max_num'); + } + public set resumeMaxNum(value: number) { + this._resumeMaxNum = value; + } + public resetResumeMaxNum() { + this._resumeMaxNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get resumeMaxNumInput() { + return this._resumeMaxNum; + } + + // run_mode - computed: false, optional: true, required: false + private _runMode?: string; + public get runMode() { + return this.getStringAttribute('run_mode'); + } + public set runMode(value: string) { + this._runMode = value; + } + public resetRunMode() { + this._runMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get runModeInput() { + return this._runMode; + } + + // runtime_config - computed: false, optional: true, required: false + private _runtimeConfig?: { [key: string]: string }; + public get runtimeConfig() { + return this.getStringMapAttribute('runtime_config'); + } + public set runtimeConfig(value: { [key: string]: string }) { + this._runtimeConfig = value; + } + public resetRuntimeConfig() { + this._runtimeConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeConfigInput() { + return this._runtimeConfig; + } + + // smn_topic - computed: false, optional: true, required: false + private _smnTopic?: string; + public get smnTopic() { + return this.getStringAttribute('smn_topic'); + } + public set smnTopic(value: string) { + this._smnTopic = value; + } + public resetSmnTopic() { + this._smnTopic = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnTopicInput() { + return this._smnTopic; + } + + // sql - computed: false, optional: true, required: false + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + public resetSql() { + this._sql = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // static_estimator - computed: false, optional: true, required: false + private _staticEstimator?: boolean | cdktf.IResolvable; + public get staticEstimator() { + return this.getBooleanAttribute('static_estimator'); + } + public set staticEstimator(value: boolean | cdktf.IResolvable) { + this._staticEstimator = value; + } + public resetStaticEstimator() { + this._staticEstimator = undefined; + } + // Temporarily expose input value. Use with caution. + public get staticEstimatorInput() { + return this._staticEstimator; + } + + // static_estimator_config - computed: false, optional: true, required: false + private _staticEstimatorConfig?: string; + public get staticEstimatorConfig() { + return this.getStringAttribute('static_estimator_config'); + } + public set staticEstimatorConfig(value: string) { + this._staticEstimatorConfig = value; + } + public resetStaticEstimatorConfig() { + this._staticEstimatorConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get staticEstimatorConfigInput() { + return this._staticEstimatorConfig; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // stream_graph - computed: true, optional: false, required: false + public get streamGraph() { + return this.getStringAttribute('stream_graph'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tm_cus - computed: false, optional: true, required: false + private _tmCus?: number; + public get tmCus() { + return this.getNumberAttribute('tm_cus'); + } + public set tmCus(value: number) { + this._tmCus = value; + } + public resetTmCus() { + this._tmCus = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmCusInput() { + return this._tmCus; + } + + // tm_slot_num - computed: true, optional: true, required: false + private _tmSlotNum?: number; + public get tmSlotNum() { + return this.getNumberAttribute('tm_slot_num'); + } + public set tmSlotNum(value: number) { + this._tmSlotNum = value; + } + public resetTmSlotNum() { + this._tmSlotNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get tmSlotNumInput() { + return this._tmSlotNum; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // udf_jar_url - computed: true, optional: true, required: false + private _udfJarUrl?: string; + public get udfJarUrl() { + return this.getStringAttribute('udf_jar_url'); + } + public set udfJarUrl(value: string) { + this._udfJarUrl = value; + } + public resetUdfJarUrl() { + this._udfJarUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get udfJarUrlInput() { + return this._udfJarUrl; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliFlinksqlJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliFlinksqlJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + checkpoint_enabled: cdktf.booleanToTerraform(this._checkpointEnabled), + checkpoint_interval: cdktf.numberToTerraform(this._checkpointInterval), + checkpoint_mode: cdktf.stringToTerraform(this._checkpointMode), + cu_number: cdktf.numberToTerraform(this._cuNumber), + description: cdktf.stringToTerraform(this._description), + dirty_data_strategy: cdktf.stringToTerraform(this._dirtyDataStrategy), + edge_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._edgeGroupIds), + flink_version: cdktf.stringToTerraform(this._flinkVersion), + graph_type: cdktf.stringToTerraform(this._graphType), + id: cdktf.stringToTerraform(this._id), + idle_state_retention: cdktf.numberToTerraform(this._idleStateRetention), + log_enabled: cdktf.booleanToTerraform(this._logEnabled), + manager_cu_number: cdktf.numberToTerraform(this._managerCuNumber), + name: cdktf.stringToTerraform(this._name), + obs_bucket: cdktf.stringToTerraform(this._obsBucket), + operator_config: cdktf.stringToTerraform(this._operatorConfig), + parallel_number: cdktf.numberToTerraform(this._parallelNumber), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + restart_when_exception: cdktf.booleanToTerraform(this._restartWhenException), + resume_checkpoint: cdktf.booleanToTerraform(this._resumeCheckpoint), + resume_max_num: cdktf.numberToTerraform(this._resumeMaxNum), + run_mode: cdktf.stringToTerraform(this._runMode), + runtime_config: cdktf.hashMapper(cdktf.stringToTerraform)(this._runtimeConfig), + smn_topic: cdktf.stringToTerraform(this._smnTopic), + sql: cdktf.stringToTerraform(this._sql), + static_estimator: cdktf.booleanToTerraform(this._staticEstimator), + static_estimator_config: cdktf.stringToTerraform(this._staticEstimatorConfig), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tm_cus: cdktf.numberToTerraform(this._tmCus), + tm_slot_num: cdktf.numberToTerraform(this._tmSlotNum), + type: cdktf.stringToTerraform(this._type), + udf_jar_url: cdktf.stringToTerraform(this._udfJarUrl), + timeouts: dliFlinksqlJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + checkpoint_enabled: { + value: cdktf.booleanToHclTerraform(this._checkpointEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + checkpoint_interval: { + value: cdktf.numberToHclTerraform(this._checkpointInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + checkpoint_mode: { + value: cdktf.stringToHclTerraform(this._checkpointMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cu_number: { + value: cdktf.numberToHclTerraform(this._cuNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dirty_data_strategy: { + value: cdktf.stringToHclTerraform(this._dirtyDataStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + edge_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._edgeGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + flink_version: { + value: cdktf.stringToHclTerraform(this._flinkVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + graph_type: { + value: cdktf.stringToHclTerraform(this._graphType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + idle_state_retention: { + value: cdktf.numberToHclTerraform(this._idleStateRetention), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + log_enabled: { + value: cdktf.booleanToHclTerraform(this._logEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + manager_cu_number: { + value: cdktf.numberToHclTerraform(this._managerCuNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket: { + value: cdktf.stringToHclTerraform(this._obsBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator_config: { + value: cdktf.stringToHclTerraform(this._operatorConfig), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parallel_number: { + value: cdktf.numberToHclTerraform(this._parallelNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restart_when_exception: { + value: cdktf.booleanToHclTerraform(this._restartWhenException), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + resume_checkpoint: { + value: cdktf.booleanToHclTerraform(this._resumeCheckpoint), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + resume_max_num: { + value: cdktf.numberToHclTerraform(this._resumeMaxNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + run_mode: { + value: cdktf.stringToHclTerraform(this._runMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_config: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._runtimeConfig), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + smn_topic: { + value: cdktf.stringToHclTerraform(this._smnTopic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + static_estimator: { + value: cdktf.booleanToHclTerraform(this._staticEstimator), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + static_estimator_config: { + value: cdktf.stringToHclTerraform(this._staticEstimatorConfig), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tm_cus: { + value: cdktf.numberToHclTerraform(this._tmCus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tm_slot_num: { + value: cdktf.numberToHclTerraform(this._tmSlotNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + udf_jar_url: { + value: cdktf.stringToHclTerraform(this._udfJarUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dliFlinksqlJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliFlinksqlJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-global-variable/README.md b/src/constructs/providers/huaweicloud/dli-global-variable/README.md new file mode 100644 index 00000000..18e9c89e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-global-variable/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_global_variable` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_global_variable`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable). diff --git a/src/constructs/providers/huaweicloud/dli-global-variable/index.ts b/src/constructs/providers/huaweicloud/dli-global-variable/index.ts new file mode 100644 index 00000000..baf0bc1b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-global-variable/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliGlobalVariableConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable#id DliGlobalVariable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to set a variable as a sensitive variable. The default value is **false**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable#is_sensitive DliGlobalVariable#is_sensitive} + */ + readonly isSensitive?: boolean | cdktf.IResolvable; + /** + * The name of a Global variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable#name DliGlobalVariable#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable#region DliGlobalVariable#region} + */ + readonly region?: string; + /** + * The value of Global variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable#value DliGlobalVariable#value} + */ + readonly value: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable huaweicloud_dli_global_variable} +*/ +export class DliGlobalVariable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_global_variable"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliGlobalVariable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliGlobalVariable to import + * @param importFromId The id of the existing DliGlobalVariable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliGlobalVariable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_global_variable", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_global_variable huaweicloud_dli_global_variable} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliGlobalVariableConfig + */ + public constructor(scope: Construct, id: string, config: DliGlobalVariableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_global_variable', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._isSensitive = config.isSensitive; + this._name = config.name; + this._region = config.region; + this._value = config.value; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_sensitive - computed: true, optional: true, required: false + private _isSensitive?: boolean | cdktf.IResolvable; + public get isSensitive() { + return this.getBooleanAttribute('is_sensitive'); + } + public set isSensitive(value: boolean | cdktf.IResolvable) { + this._isSensitive = value; + } + public resetIsSensitive() { + this._isSensitive = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSensitiveInput() { + return this._isSensitive; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + is_sensitive: cdktf.booleanToTerraform(this._isSensitive), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + value: cdktf.stringToTerraform(this._value), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_sensitive: { + value: cdktf.booleanToHclTerraform(this._isSensitive), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-package/README.md b/src/constructs/providers/huaweicloud/dli-package/README.md new file mode 100644 index 00000000..2954b42a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-package/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_package` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_package`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package). diff --git a/src/constructs/providers/huaweicloud/dli-package/index.ts b/src/constructs/providers/huaweicloud/dli-package/index.ts new file mode 100644 index 00000000..ac3587d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-package/index.ts @@ -0,0 +1,326 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliPackageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#group_name DliPackage#group_name} + */ + readonly groupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#id DliPackage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#is_async DliPackage#is_async} + */ + readonly isAsync?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#object_path DliPackage#object_path} + */ + readonly objectPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#owner DliPackage#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#region DliPackage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#tags DliPackage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#type DliPackage#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package huaweicloud_dli_package} +*/ +export class DliPackage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_package"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliPackage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliPackage to import + * @param importFromId The id of the existing DliPackage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliPackage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_package", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_package huaweicloud_dli_package} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliPackageConfig + */ + public constructor(scope: Construct, id: string, config: DliPackageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_package', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupName = config.groupName; + this._id = config.id; + this._isAsync = config.isAsync; + this._objectPath = config.objectPath; + this._owner = config.owner; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // group_name - computed: false, optional: true, required: false + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + public resetGroupName() { + this._groupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_async - computed: true, optional: true, required: false + private _isAsync?: boolean | cdktf.IResolvable; + public get isAsync() { + return this.getBooleanAttribute('is_async'); + } + public set isAsync(value: boolean | cdktf.IResolvable) { + this._isAsync = value; + } + public resetIsAsync() { + this._isAsync = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAsyncInput() { + return this._isAsync; + } + + // object_name - computed: true, optional: false, required: false + public get objectName() { + return this.getStringAttribute('object_name'); + } + + // object_path - computed: false, optional: false, required: true + private _objectPath?: string; + public get objectPath() { + return this.getStringAttribute('object_path'); + } + public set objectPath(value: string) { + this._objectPath = value; + } + // Temporarily expose input value. Use with caution. + public get objectPathInput() { + return this._objectPath; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_name: cdktf.stringToTerraform(this._groupName), + id: cdktf.stringToTerraform(this._id), + is_async: cdktf.booleanToTerraform(this._isAsync), + object_path: cdktf.stringToTerraform(this._objectPath), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(this._groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_async: { + value: cdktf.booleanToHclTerraform(this._isAsync), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + object_path: { + value: cdktf.stringToHclTerraform(this._objectPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-permission/README.md b/src/constructs/providers/huaweicloud/dli-permission/README.md new file mode 100644 index 00000000..85cd2736 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-permission/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_permission` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_permission`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission). diff --git a/src/constructs/providers/huaweicloud/dli-permission/index.ts b/src/constructs/providers/huaweicloud/dli-permission/index.ts new file mode 100644 index 00000000..4c0f4118 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-permission/index.ts @@ -0,0 +1,224 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliPermissionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission#id DliPermission#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission#object DliPermission#object} + */ + readonly object: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission#privileges DliPermission#privileges} + */ + readonly privileges: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission#region DliPermission#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission#user_name DliPermission#user_name} + */ + readonly userName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission huaweicloud_dli_permission} +*/ +export class DliPermission extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_permission"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliPermission resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliPermission to import + * @param importFromId The id of the existing DliPermission that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliPermission to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_permission", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_permission huaweicloud_dli_permission} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliPermissionConfig + */ + public constructor(scope: Construct, id: string, config: DliPermissionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_permission', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._object = config.object; + this._privileges = config.privileges; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_admin - computed: true, optional: false, required: false + public get isAdmin() { + return this.getBooleanAttribute('is_admin'); + } + + // object - computed: false, optional: false, required: true + private _object?: string; + public get object() { + return this.getStringAttribute('object'); + } + public set object(value: string) { + this._object = value; + } + // Temporarily expose input value. Use with caution. + public get objectInput() { + return this._object; + } + + // privileges - computed: false, optional: false, required: true + private _privileges?: string[]; + public get privileges() { + return this.getListAttribute('privileges'); + } + public set privileges(value: string[]) { + this._privileges = value; + } + // Temporarily expose input value. Use with caution. + public get privilegesInput() { + return this._privileges; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + object: cdktf.stringToTerraform(this._object), + privileges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._privileges), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object: { + value: cdktf.stringToHclTerraform(this._object), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + privileges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._privileges), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-queue-v1/README.md b/src/constructs/providers/huaweicloud/dli-queue-v1/README.md new file mode 100644 index 00000000..221d8f7f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-queue-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_queue_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_queue_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1). diff --git a/src/constructs/providers/huaweicloud/dli-queue-v1/index.ts b/src/constructs/providers/huaweicloud/dli-queue-v1/index.ts new file mode 100644 index 00000000..517b9266 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-queue-v1/index.ts @@ -0,0 +1,1080 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliQueueV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#cu_count DliQueueV1#cu_count} + */ + readonly cuCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#description DliQueueV1#description} + */ + readonly description?: string; + /** + * The name of the elastic resource pool to which the queue belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#elastic_resource_pool_name DliQueueV1#elastic_resource_pool_name} + */ + readonly elasticResourcePoolName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#enterprise_project_id DliQueueV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#feature DliQueueV1#feature} + */ + readonly feature?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#id DliQueueV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#management_subnet_cidr DliQueueV1#management_subnet_cidr} + */ + readonly managementSubnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#name DliQueueV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#platform DliQueueV1#platform} + */ + readonly platform?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#queue_type DliQueueV1#queue_type} + */ + readonly queueType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#region DliQueueV1#region} + */ + readonly region?: string; + /** + * The queue resource mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#resource_mode DliQueueV1#resource_mode} + */ + readonly resourceMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#subnet_cidr DliQueueV1#subnet_cidr} + */ + readonly subnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#tags DliQueueV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The CIDR block of the queue. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#vpc_cidr DliQueueV1#vpc_cidr} + */ + readonly vpcCidr?: string; + /** + * scaling_policies block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#scaling_policies DliQueueV1#scaling_policies} + */ + readonly scalingPolicies?: DliQueueV1ScalingPolicies[] | cdktf.IResolvable; + /** + * spark_driver block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#spark_driver DliQueueV1#spark_driver} + */ + readonly sparkDriver?: DliQueueV1SparkDriver; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#timeouts DliQueueV1#timeouts} + */ + readonly timeouts?: DliQueueV1Timeouts; +} +export interface DliQueueV1ScalingPolicies { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#impact_start_time DliQueueV1#impact_start_time} + */ + readonly impactStartTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#impact_stop_time DliQueueV1#impact_stop_time} + */ + readonly impactStopTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#max_cu DliQueueV1#max_cu} + */ + readonly maxCu: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#min_cu DliQueueV1#min_cu} + */ + readonly minCu: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#priority DliQueueV1#priority} + */ + readonly priority: number; +} + +export function dliQueueV1ScalingPoliciesToTerraform(struct?: DliQueueV1ScalingPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + impact_start_time: cdktf.stringToTerraform(struct!.impactStartTime), + impact_stop_time: cdktf.stringToTerraform(struct!.impactStopTime), + max_cu: cdktf.numberToTerraform(struct!.maxCu), + min_cu: cdktf.numberToTerraform(struct!.minCu), + priority: cdktf.numberToTerraform(struct!.priority), + } +} + + +export function dliQueueV1ScalingPoliciesToHclTerraform(struct?: DliQueueV1ScalingPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + impact_start_time: { + value: cdktf.stringToHclTerraform(struct!.impactStartTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + impact_stop_time: { + value: cdktf.stringToHclTerraform(struct!.impactStopTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_cu: { + value: cdktf.numberToHclTerraform(struct!.maxCu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_cu: { + value: cdktf.numberToHclTerraform(struct!.minCu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliQueueV1ScalingPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliQueueV1ScalingPolicies | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._impactStartTime !== undefined) { + hasAnyValues = true; + internalValueResult.impactStartTime = this._impactStartTime; + } + if (this._impactStopTime !== undefined) { + hasAnyValues = true; + internalValueResult.impactStopTime = this._impactStopTime; + } + if (this._maxCu !== undefined) { + hasAnyValues = true; + internalValueResult.maxCu = this._maxCu; + } + if (this._minCu !== undefined) { + hasAnyValues = true; + internalValueResult.minCu = this._minCu; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliQueueV1ScalingPolicies | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._impactStartTime = undefined; + this._impactStopTime = undefined; + this._maxCu = undefined; + this._minCu = undefined; + this._priority = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._impactStartTime = value.impactStartTime; + this._impactStopTime = value.impactStopTime; + this._maxCu = value.maxCu; + this._minCu = value.minCu; + this._priority = value.priority; + } + } + + // impact_start_time - computed: false, optional: false, required: true + private _impactStartTime?: string; + public get impactStartTime() { + return this.getStringAttribute('impact_start_time'); + } + public set impactStartTime(value: string) { + this._impactStartTime = value; + } + // Temporarily expose input value. Use with caution. + public get impactStartTimeInput() { + return this._impactStartTime; + } + + // impact_stop_time - computed: false, optional: false, required: true + private _impactStopTime?: string; + public get impactStopTime() { + return this.getStringAttribute('impact_stop_time'); + } + public set impactStopTime(value: string) { + this._impactStopTime = value; + } + // Temporarily expose input value. Use with caution. + public get impactStopTimeInput() { + return this._impactStopTime; + } + + // max_cu - computed: false, optional: false, required: true + private _maxCu?: number; + public get maxCu() { + return this.getNumberAttribute('max_cu'); + } + public set maxCu(value: number) { + this._maxCu = value; + } + // Temporarily expose input value. Use with caution. + public get maxCuInput() { + return this._maxCu; + } + + // min_cu - computed: false, optional: false, required: true + private _minCu?: number; + public get minCu() { + return this.getNumberAttribute('min_cu'); + } + public set minCu(value: number) { + this._minCu = value; + } + // Temporarily expose input value. Use with caution. + public get minCuInput() { + return this._minCu; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } +} + +export class DliQueueV1ScalingPoliciesList extends cdktf.ComplexList { + public internalValue? : DliQueueV1ScalingPolicies[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliQueueV1ScalingPoliciesOutputReference { + return new DliQueueV1ScalingPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliQueueV1SparkDriver { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#max_concurrent DliQueueV1#max_concurrent} + */ + readonly maxConcurrent?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#max_instance DliQueueV1#max_instance} + */ + readonly maxInstance?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#max_prefetch_instance DliQueueV1#max_prefetch_instance} + */ + readonly maxPrefetchInstance?: string; +} + +export function dliQueueV1SparkDriverToTerraform(struct?: DliQueueV1SparkDriverOutputReference | DliQueueV1SparkDriver): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + max_concurrent: cdktf.numberToTerraform(struct!.maxConcurrent), + max_instance: cdktf.numberToTerraform(struct!.maxInstance), + max_prefetch_instance: cdktf.stringToTerraform(struct!.maxPrefetchInstance), + } +} + + +export function dliQueueV1SparkDriverToHclTerraform(struct?: DliQueueV1SparkDriverOutputReference | DliQueueV1SparkDriver): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + max_concurrent: { + value: cdktf.numberToHclTerraform(struct!.maxConcurrent), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_instance: { + value: cdktf.numberToHclTerraform(struct!.maxInstance), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_prefetch_instance: { + value: cdktf.stringToHclTerraform(struct!.maxPrefetchInstance), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliQueueV1SparkDriverOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DliQueueV1SparkDriver | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._maxConcurrent !== undefined) { + hasAnyValues = true; + internalValueResult.maxConcurrent = this._maxConcurrent; + } + if (this._maxInstance !== undefined) { + hasAnyValues = true; + internalValueResult.maxInstance = this._maxInstance; + } + if (this._maxPrefetchInstance !== undefined) { + hasAnyValues = true; + internalValueResult.maxPrefetchInstance = this._maxPrefetchInstance; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliQueueV1SparkDriver | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._maxConcurrent = undefined; + this._maxInstance = undefined; + this._maxPrefetchInstance = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._maxConcurrent = value.maxConcurrent; + this._maxInstance = value.maxInstance; + this._maxPrefetchInstance = value.maxPrefetchInstance; + } + } + + // max_concurrent - computed: false, optional: true, required: false + private _maxConcurrent?: number; + public get maxConcurrent() { + return this.getNumberAttribute('max_concurrent'); + } + public set maxConcurrent(value: number) { + this._maxConcurrent = value; + } + public resetMaxConcurrent() { + this._maxConcurrent = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConcurrentInput() { + return this._maxConcurrent; + } + + // max_instance - computed: false, optional: true, required: false + private _maxInstance?: number; + public get maxInstance() { + return this.getNumberAttribute('max_instance'); + } + public set maxInstance(value: number) { + this._maxInstance = value; + } + public resetMaxInstance() { + this._maxInstance = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInstanceInput() { + return this._maxInstance; + } + + // max_prefetch_instance - computed: false, optional: true, required: false + private _maxPrefetchInstance?: string; + public get maxPrefetchInstance() { + return this.getStringAttribute('max_prefetch_instance'); + } + public set maxPrefetchInstance(value: string) { + this._maxPrefetchInstance = value; + } + public resetMaxPrefetchInstance() { + this._maxPrefetchInstance = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPrefetchInstanceInput() { + return this._maxPrefetchInstance; + } +} +export interface DliQueueV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#update DliQueueV1#update} + */ + readonly update?: string; +} + +export function dliQueueV1TimeoutsToTerraform(struct?: DliQueueV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dliQueueV1TimeoutsToHclTerraform(struct?: DliQueueV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliQueueV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliQueueV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliQueueV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._update = value.update; + } + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1 huaweicloud_dli_queue_v1} +*/ +export class DliQueueV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_queue_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliQueueV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliQueueV1 to import + * @param importFromId The id of the existing DliQueueV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliQueueV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_queue_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue_v1 huaweicloud_dli_queue_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliQueueV1Config + */ + public constructor(scope: Construct, id: string, config: DliQueueV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_queue_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cuCount = config.cuCount; + this._description = config.description; + this._elasticResourcePoolName = config.elasticResourcePoolName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._feature = config.feature; + this._id = config.id; + this._managementSubnetCidr = config.managementSubnetCidr; + this._name = config.name; + this._platform = config.platform; + this._queueType = config.queueType; + this._region = config.region; + this._resourceMode = config.resourceMode; + this._subnetCidr = config.subnetCidr; + this._tags = config.tags; + this._vpcCidr = config.vpcCidr; + this._scalingPolicies.internalValue = config.scalingPolicies; + this._sparkDriver.internalValue = config.sparkDriver; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getNumberAttribute('create_time'); + } + + // cu_count - computed: false, optional: false, required: true + private _cuCount?: number; + public get cuCount() { + return this.getNumberAttribute('cu_count'); + } + public set cuCount(value: number) { + this._cuCount = value; + } + // Temporarily expose input value. Use with caution. + public get cuCountInput() { + return this._cuCount; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // elastic_resource_pool_name - computed: true, optional: true, required: false + private _elasticResourcePoolName?: string; + public get elasticResourcePoolName() { + return this.getStringAttribute('elastic_resource_pool_name'); + } + public set elasticResourcePoolName(value: string) { + this._elasticResourcePoolName = value; + } + public resetElasticResourcePoolName() { + this._elasticResourcePoolName = undefined; + } + // Temporarily expose input value. Use with caution. + public get elasticResourcePoolNameInput() { + return this._elasticResourcePoolName; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // feature - computed: false, optional: true, required: false + private _feature?: string; + public get feature() { + return this.getStringAttribute('feature'); + } + public set feature(value: string) { + this._feature = value; + } + public resetFeature() { + this._feature = undefined; + } + // Temporarily expose input value. Use with caution. + public get featureInput() { + return this._feature; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // management_subnet_cidr - computed: false, optional: true, required: false + private _managementSubnetCidr?: string; + public get managementSubnetCidr() { + return this.getStringAttribute('management_subnet_cidr'); + } + public set managementSubnetCidr(value: string) { + this._managementSubnetCidr = value; + } + public resetManagementSubnetCidr() { + this._managementSubnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get managementSubnetCidrInput() { + return this._managementSubnetCidr; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // platform - computed: false, optional: true, required: false + private _platform?: string; + public get platform() { + return this.getStringAttribute('platform'); + } + public set platform(value: string) { + this._platform = value; + } + public resetPlatform() { + this._platform = undefined; + } + // Temporarily expose input value. Use with caution. + public get platformInput() { + return this._platform; + } + + // queue_type - computed: false, optional: true, required: false + private _queueType?: string; + public get queueType() { + return this.getStringAttribute('queue_type'); + } + public set queueType(value: string) { + this._queueType = value; + } + public resetQueueType() { + this._queueType = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueTypeInput() { + return this._queueType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_mode - computed: true, optional: true, required: false + private _resourceMode?: number; + public get resourceMode() { + return this.getNumberAttribute('resource_mode'); + } + public set resourceMode(value: number) { + this._resourceMode = value; + } + public resetResourceMode() { + this._resourceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceModeInput() { + return this._resourceMode; + } + + // subnet_cidr - computed: false, optional: true, required: false + private _subnetCidr?: string; + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + public set subnetCidr(value: string) { + this._subnetCidr = value; + } + public resetSubnetCidr() { + this._subnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetCidrInput() { + return this._subnetCidr; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_cidr - computed: true, optional: true, required: false + private _vpcCidr?: string; + public get vpcCidr() { + return this.getStringAttribute('vpc_cidr'); + } + public set vpcCidr(value: string) { + this._vpcCidr = value; + } + public resetVpcCidr() { + this._vpcCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcCidrInput() { + return this._vpcCidr; + } + + // scaling_policies - computed: false, optional: true, required: false + private _scalingPolicies = new DliQueueV1ScalingPoliciesList(this, "scaling_policies", true); + public get scalingPolicies() { + return this._scalingPolicies; + } + public putScalingPolicies(value: DliQueueV1ScalingPolicies[] | cdktf.IResolvable) { + this._scalingPolicies.internalValue = value; + } + public resetScalingPolicies() { + this._scalingPolicies.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPoliciesInput() { + return this._scalingPolicies.internalValue; + } + + // spark_driver - computed: false, optional: true, required: false + private _sparkDriver = new DliQueueV1SparkDriverOutputReference(this, "spark_driver"); + public get sparkDriver() { + return this._sparkDriver; + } + public putSparkDriver(value: DliQueueV1SparkDriver) { + this._sparkDriver.internalValue = value; + } + public resetSparkDriver() { + this._sparkDriver.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkDriverInput() { + return this._sparkDriver.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliQueueV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliQueueV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cu_count: cdktf.numberToTerraform(this._cuCount), + description: cdktf.stringToTerraform(this._description), + elastic_resource_pool_name: cdktf.stringToTerraform(this._elasticResourcePoolName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + feature: cdktf.stringToTerraform(this._feature), + id: cdktf.stringToTerraform(this._id), + management_subnet_cidr: cdktf.stringToTerraform(this._managementSubnetCidr), + name: cdktf.stringToTerraform(this._name), + platform: cdktf.stringToTerraform(this._platform), + queue_type: cdktf.stringToTerraform(this._queueType), + region: cdktf.stringToTerraform(this._region), + resource_mode: cdktf.numberToTerraform(this._resourceMode), + subnet_cidr: cdktf.stringToTerraform(this._subnetCidr), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_cidr: cdktf.stringToTerraform(this._vpcCidr), + scaling_policies: cdktf.listMapper(dliQueueV1ScalingPoliciesToTerraform, true)(this._scalingPolicies.internalValue), + spark_driver: dliQueueV1SparkDriverToTerraform(this._sparkDriver.internalValue), + timeouts: dliQueueV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cu_count: { + value: cdktf.numberToHclTerraform(this._cuCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + elastic_resource_pool_name: { + value: cdktf.stringToHclTerraform(this._elasticResourcePoolName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + feature: { + value: cdktf.stringToHclTerraform(this._feature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + management_subnet_cidr: { + value: cdktf.stringToHclTerraform(this._managementSubnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + platform: { + value: cdktf.stringToHclTerraform(this._platform), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_type: { + value: cdktf.stringToHclTerraform(this._queueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_mode: { + value: cdktf.numberToHclTerraform(this._resourceMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_cidr: { + value: cdktf.stringToHclTerraform(this._subnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_cidr: { + value: cdktf.stringToHclTerraform(this._vpcCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policies: { + value: cdktf.listMapperHcl(dliQueueV1ScalingPoliciesToHclTerraform, true)(this._scalingPolicies.internalValue), + isBlock: true, + type: "set", + storageClassType: "DliQueueV1ScalingPoliciesList", + }, + spark_driver: { + value: dliQueueV1SparkDriverToHclTerraform(this._sparkDriver.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliQueueV1SparkDriverList", + }, + timeouts: { + value: dliQueueV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliQueueV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-queue/README.md b/src/constructs/providers/huaweicloud/dli-queue/README.md new file mode 100644 index 00000000..e6d01e77 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-queue/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_queue` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_queue`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue). diff --git a/src/constructs/providers/huaweicloud/dli-queue/index.ts b/src/constructs/providers/huaweicloud/dli-queue/index.ts new file mode 100644 index 00000000..67c4c6d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-queue/index.ts @@ -0,0 +1,1080 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliQueueConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#cu_count DliQueue#cu_count} + */ + readonly cuCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#description DliQueue#description} + */ + readonly description?: string; + /** + * The name of the elastic resource pool to which the queue belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#elastic_resource_pool_name DliQueue#elastic_resource_pool_name} + */ + readonly elasticResourcePoolName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#enterprise_project_id DliQueue#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#feature DliQueue#feature} + */ + readonly feature?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#id DliQueue#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#management_subnet_cidr DliQueue#management_subnet_cidr} + */ + readonly managementSubnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#name DliQueue#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#platform DliQueue#platform} + */ + readonly platform?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#queue_type DliQueue#queue_type} + */ + readonly queueType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#region DliQueue#region} + */ + readonly region?: string; + /** + * The queue resource mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#resource_mode DliQueue#resource_mode} + */ + readonly resourceMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#subnet_cidr DliQueue#subnet_cidr} + */ + readonly subnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#tags DliQueue#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The CIDR block of the queue. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#vpc_cidr DliQueue#vpc_cidr} + */ + readonly vpcCidr?: string; + /** + * scaling_policies block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#scaling_policies DliQueue#scaling_policies} + */ + readonly scalingPolicies?: DliQueueScalingPolicies[] | cdktf.IResolvable; + /** + * spark_driver block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#spark_driver DliQueue#spark_driver} + */ + readonly sparkDriver?: DliQueueSparkDriver; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#timeouts DliQueue#timeouts} + */ + readonly timeouts?: DliQueueTimeouts; +} +export interface DliQueueScalingPolicies { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#impact_start_time DliQueue#impact_start_time} + */ + readonly impactStartTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#impact_stop_time DliQueue#impact_stop_time} + */ + readonly impactStopTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#max_cu DliQueue#max_cu} + */ + readonly maxCu: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#min_cu DliQueue#min_cu} + */ + readonly minCu: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#priority DliQueue#priority} + */ + readonly priority: number; +} + +export function dliQueueScalingPoliciesToTerraform(struct?: DliQueueScalingPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + impact_start_time: cdktf.stringToTerraform(struct!.impactStartTime), + impact_stop_time: cdktf.stringToTerraform(struct!.impactStopTime), + max_cu: cdktf.numberToTerraform(struct!.maxCu), + min_cu: cdktf.numberToTerraform(struct!.minCu), + priority: cdktf.numberToTerraform(struct!.priority), + } +} + + +export function dliQueueScalingPoliciesToHclTerraform(struct?: DliQueueScalingPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + impact_start_time: { + value: cdktf.stringToHclTerraform(struct!.impactStartTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + impact_stop_time: { + value: cdktf.stringToHclTerraform(struct!.impactStopTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_cu: { + value: cdktf.numberToHclTerraform(struct!.maxCu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_cu: { + value: cdktf.numberToHclTerraform(struct!.minCu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + priority: { + value: cdktf.numberToHclTerraform(struct!.priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliQueueScalingPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliQueueScalingPolicies | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._impactStartTime !== undefined) { + hasAnyValues = true; + internalValueResult.impactStartTime = this._impactStartTime; + } + if (this._impactStopTime !== undefined) { + hasAnyValues = true; + internalValueResult.impactStopTime = this._impactStopTime; + } + if (this._maxCu !== undefined) { + hasAnyValues = true; + internalValueResult.maxCu = this._maxCu; + } + if (this._minCu !== undefined) { + hasAnyValues = true; + internalValueResult.minCu = this._minCu; + } + if (this._priority !== undefined) { + hasAnyValues = true; + internalValueResult.priority = this._priority; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliQueueScalingPolicies | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._impactStartTime = undefined; + this._impactStopTime = undefined; + this._maxCu = undefined; + this._minCu = undefined; + this._priority = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._impactStartTime = value.impactStartTime; + this._impactStopTime = value.impactStopTime; + this._maxCu = value.maxCu; + this._minCu = value.minCu; + this._priority = value.priority; + } + } + + // impact_start_time - computed: false, optional: false, required: true + private _impactStartTime?: string; + public get impactStartTime() { + return this.getStringAttribute('impact_start_time'); + } + public set impactStartTime(value: string) { + this._impactStartTime = value; + } + // Temporarily expose input value. Use with caution. + public get impactStartTimeInput() { + return this._impactStartTime; + } + + // impact_stop_time - computed: false, optional: false, required: true + private _impactStopTime?: string; + public get impactStopTime() { + return this.getStringAttribute('impact_stop_time'); + } + public set impactStopTime(value: string) { + this._impactStopTime = value; + } + // Temporarily expose input value. Use with caution. + public get impactStopTimeInput() { + return this._impactStopTime; + } + + // max_cu - computed: false, optional: false, required: true + private _maxCu?: number; + public get maxCu() { + return this.getNumberAttribute('max_cu'); + } + public set maxCu(value: number) { + this._maxCu = value; + } + // Temporarily expose input value. Use with caution. + public get maxCuInput() { + return this._maxCu; + } + + // min_cu - computed: false, optional: false, required: true + private _minCu?: number; + public get minCu() { + return this.getNumberAttribute('min_cu'); + } + public set minCu(value: number) { + this._minCu = value; + } + // Temporarily expose input value. Use with caution. + public get minCuInput() { + return this._minCu; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } +} + +export class DliQueueScalingPoliciesList extends cdktf.ComplexList { + public internalValue? : DliQueueScalingPolicies[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliQueueScalingPoliciesOutputReference { + return new DliQueueScalingPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliQueueSparkDriver { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#max_concurrent DliQueue#max_concurrent} + */ + readonly maxConcurrent?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#max_instance DliQueue#max_instance} + */ + readonly maxInstance?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#max_prefetch_instance DliQueue#max_prefetch_instance} + */ + readonly maxPrefetchInstance?: string; +} + +export function dliQueueSparkDriverToTerraform(struct?: DliQueueSparkDriverOutputReference | DliQueueSparkDriver): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + max_concurrent: cdktf.numberToTerraform(struct!.maxConcurrent), + max_instance: cdktf.numberToTerraform(struct!.maxInstance), + max_prefetch_instance: cdktf.stringToTerraform(struct!.maxPrefetchInstance), + } +} + + +export function dliQueueSparkDriverToHclTerraform(struct?: DliQueueSparkDriverOutputReference | DliQueueSparkDriver): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + max_concurrent: { + value: cdktf.numberToHclTerraform(struct!.maxConcurrent), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_instance: { + value: cdktf.numberToHclTerraform(struct!.maxInstance), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_prefetch_instance: { + value: cdktf.stringToHclTerraform(struct!.maxPrefetchInstance), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliQueueSparkDriverOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DliQueueSparkDriver | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._maxConcurrent !== undefined) { + hasAnyValues = true; + internalValueResult.maxConcurrent = this._maxConcurrent; + } + if (this._maxInstance !== undefined) { + hasAnyValues = true; + internalValueResult.maxInstance = this._maxInstance; + } + if (this._maxPrefetchInstance !== undefined) { + hasAnyValues = true; + internalValueResult.maxPrefetchInstance = this._maxPrefetchInstance; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliQueueSparkDriver | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._maxConcurrent = undefined; + this._maxInstance = undefined; + this._maxPrefetchInstance = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._maxConcurrent = value.maxConcurrent; + this._maxInstance = value.maxInstance; + this._maxPrefetchInstance = value.maxPrefetchInstance; + } + } + + // max_concurrent - computed: false, optional: true, required: false + private _maxConcurrent?: number; + public get maxConcurrent() { + return this.getNumberAttribute('max_concurrent'); + } + public set maxConcurrent(value: number) { + this._maxConcurrent = value; + } + public resetMaxConcurrent() { + this._maxConcurrent = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConcurrentInput() { + return this._maxConcurrent; + } + + // max_instance - computed: false, optional: true, required: false + private _maxInstance?: number; + public get maxInstance() { + return this.getNumberAttribute('max_instance'); + } + public set maxInstance(value: number) { + this._maxInstance = value; + } + public resetMaxInstance() { + this._maxInstance = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInstanceInput() { + return this._maxInstance; + } + + // max_prefetch_instance - computed: false, optional: true, required: false + private _maxPrefetchInstance?: string; + public get maxPrefetchInstance() { + return this.getStringAttribute('max_prefetch_instance'); + } + public set maxPrefetchInstance(value: string) { + this._maxPrefetchInstance = value; + } + public resetMaxPrefetchInstance() { + this._maxPrefetchInstance = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxPrefetchInstanceInput() { + return this._maxPrefetchInstance; + } +} +export interface DliQueueTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#update DliQueue#update} + */ + readonly update?: string; +} + +export function dliQueueTimeoutsToTerraform(struct?: DliQueueTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dliQueueTimeoutsToHclTerraform(struct?: DliQueueTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliQueueTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliQueueTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliQueueTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._update = value.update; + } + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue huaweicloud_dli_queue} +*/ +export class DliQueue extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_queue"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliQueue resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliQueue to import + * @param importFromId The id of the existing DliQueue that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliQueue to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_queue", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_queue huaweicloud_dli_queue} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliQueueConfig + */ + public constructor(scope: Construct, id: string, config: DliQueueConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_queue', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cuCount = config.cuCount; + this._description = config.description; + this._elasticResourcePoolName = config.elasticResourcePoolName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._feature = config.feature; + this._id = config.id; + this._managementSubnetCidr = config.managementSubnetCidr; + this._name = config.name; + this._platform = config.platform; + this._queueType = config.queueType; + this._region = config.region; + this._resourceMode = config.resourceMode; + this._subnetCidr = config.subnetCidr; + this._tags = config.tags; + this._vpcCidr = config.vpcCidr; + this._scalingPolicies.internalValue = config.scalingPolicies; + this._sparkDriver.internalValue = config.sparkDriver; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getNumberAttribute('create_time'); + } + + // cu_count - computed: false, optional: false, required: true + private _cuCount?: number; + public get cuCount() { + return this.getNumberAttribute('cu_count'); + } + public set cuCount(value: number) { + this._cuCount = value; + } + // Temporarily expose input value. Use with caution. + public get cuCountInput() { + return this._cuCount; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // elastic_resource_pool_name - computed: true, optional: true, required: false + private _elasticResourcePoolName?: string; + public get elasticResourcePoolName() { + return this.getStringAttribute('elastic_resource_pool_name'); + } + public set elasticResourcePoolName(value: string) { + this._elasticResourcePoolName = value; + } + public resetElasticResourcePoolName() { + this._elasticResourcePoolName = undefined; + } + // Temporarily expose input value. Use with caution. + public get elasticResourcePoolNameInput() { + return this._elasticResourcePoolName; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // feature - computed: false, optional: true, required: false + private _feature?: string; + public get feature() { + return this.getStringAttribute('feature'); + } + public set feature(value: string) { + this._feature = value; + } + public resetFeature() { + this._feature = undefined; + } + // Temporarily expose input value. Use with caution. + public get featureInput() { + return this._feature; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // management_subnet_cidr - computed: false, optional: true, required: false + private _managementSubnetCidr?: string; + public get managementSubnetCidr() { + return this.getStringAttribute('management_subnet_cidr'); + } + public set managementSubnetCidr(value: string) { + this._managementSubnetCidr = value; + } + public resetManagementSubnetCidr() { + this._managementSubnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get managementSubnetCidrInput() { + return this._managementSubnetCidr; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // platform - computed: false, optional: true, required: false + private _platform?: string; + public get platform() { + return this.getStringAttribute('platform'); + } + public set platform(value: string) { + this._platform = value; + } + public resetPlatform() { + this._platform = undefined; + } + // Temporarily expose input value. Use with caution. + public get platformInput() { + return this._platform; + } + + // queue_type - computed: false, optional: true, required: false + private _queueType?: string; + public get queueType() { + return this.getStringAttribute('queue_type'); + } + public set queueType(value: string) { + this._queueType = value; + } + public resetQueueType() { + this._queueType = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueTypeInput() { + return this._queueType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_mode - computed: true, optional: true, required: false + private _resourceMode?: number; + public get resourceMode() { + return this.getNumberAttribute('resource_mode'); + } + public set resourceMode(value: number) { + this._resourceMode = value; + } + public resetResourceMode() { + this._resourceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceModeInput() { + return this._resourceMode; + } + + // subnet_cidr - computed: false, optional: true, required: false + private _subnetCidr?: string; + public get subnetCidr() { + return this.getStringAttribute('subnet_cidr'); + } + public set subnetCidr(value: string) { + this._subnetCidr = value; + } + public resetSubnetCidr() { + this._subnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetCidrInput() { + return this._subnetCidr; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_cidr - computed: true, optional: true, required: false + private _vpcCidr?: string; + public get vpcCidr() { + return this.getStringAttribute('vpc_cidr'); + } + public set vpcCidr(value: string) { + this._vpcCidr = value; + } + public resetVpcCidr() { + this._vpcCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcCidrInput() { + return this._vpcCidr; + } + + // scaling_policies - computed: false, optional: true, required: false + private _scalingPolicies = new DliQueueScalingPoliciesList(this, "scaling_policies", true); + public get scalingPolicies() { + return this._scalingPolicies; + } + public putScalingPolicies(value: DliQueueScalingPolicies[] | cdktf.IResolvable) { + this._scalingPolicies.internalValue = value; + } + public resetScalingPolicies() { + this._scalingPolicies.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scalingPoliciesInput() { + return this._scalingPolicies.internalValue; + } + + // spark_driver - computed: false, optional: true, required: false + private _sparkDriver = new DliQueueSparkDriverOutputReference(this, "spark_driver"); + public get sparkDriver() { + return this._sparkDriver; + } + public putSparkDriver(value: DliQueueSparkDriver) { + this._sparkDriver.internalValue = value; + } + public resetSparkDriver() { + this._sparkDriver.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkDriverInput() { + return this._sparkDriver.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliQueueTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliQueueTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cu_count: cdktf.numberToTerraform(this._cuCount), + description: cdktf.stringToTerraform(this._description), + elastic_resource_pool_name: cdktf.stringToTerraform(this._elasticResourcePoolName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + feature: cdktf.stringToTerraform(this._feature), + id: cdktf.stringToTerraform(this._id), + management_subnet_cidr: cdktf.stringToTerraform(this._managementSubnetCidr), + name: cdktf.stringToTerraform(this._name), + platform: cdktf.stringToTerraform(this._platform), + queue_type: cdktf.stringToTerraform(this._queueType), + region: cdktf.stringToTerraform(this._region), + resource_mode: cdktf.numberToTerraform(this._resourceMode), + subnet_cidr: cdktf.stringToTerraform(this._subnetCidr), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_cidr: cdktf.stringToTerraform(this._vpcCidr), + scaling_policies: cdktf.listMapper(dliQueueScalingPoliciesToTerraform, true)(this._scalingPolicies.internalValue), + spark_driver: dliQueueSparkDriverToTerraform(this._sparkDriver.internalValue), + timeouts: dliQueueTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cu_count: { + value: cdktf.numberToHclTerraform(this._cuCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + elastic_resource_pool_name: { + value: cdktf.stringToHclTerraform(this._elasticResourcePoolName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + feature: { + value: cdktf.stringToHclTerraform(this._feature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + management_subnet_cidr: { + value: cdktf.stringToHclTerraform(this._managementSubnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + platform: { + value: cdktf.stringToHclTerraform(this._platform), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_type: { + value: cdktf.stringToHclTerraform(this._queueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_mode: { + value: cdktf.numberToHclTerraform(this._resourceMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_cidr: { + value: cdktf.stringToHclTerraform(this._subnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_cidr: { + value: cdktf.stringToHclTerraform(this._vpcCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_policies: { + value: cdktf.listMapperHcl(dliQueueScalingPoliciesToHclTerraform, true)(this._scalingPolicies.internalValue), + isBlock: true, + type: "set", + storageClassType: "DliQueueScalingPoliciesList", + }, + spark_driver: { + value: dliQueueSparkDriverToHclTerraform(this._sparkDriver.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliQueueSparkDriverList", + }, + timeouts: { + value: dliQueueTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliQueueTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-spark-job/README.md b/src/constructs/providers/huaweicloud/dli-spark-job/README.md new file mode 100644 index 00000000..9f1c7696 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-spark-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_spark_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_spark_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job). diff --git a/src/constructs/providers/huaweicloud/dli-spark-job/index.ts b/src/constructs/providers/huaweicloud/dli-spark-job/index.ts new file mode 100644 index 00000000..456f5fb2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-spark-job/index.ts @@ -0,0 +1,1063 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliSparkJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#app_name DliSparkJob#app_name} + */ + readonly appName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#app_parameters DliSparkJob#app_parameters} + */ + readonly appParameters?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#configurations DliSparkJob#configurations} + */ + readonly configurations?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#driver_cores DliSparkJob#driver_cores} + */ + readonly driverCores?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#driver_memory DliSparkJob#driver_memory} + */ + readonly driverMemory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#executor_cores DliSparkJob#executor_cores} + */ + readonly executorCores?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#executor_memory DliSparkJob#executor_memory} + */ + readonly executorMemory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#executors DliSparkJob#executors} + */ + readonly executors?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#files DliSparkJob#files} + */ + readonly files?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#id DliSparkJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#jars DliSparkJob#jars} + */ + readonly jars?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#main_class DliSparkJob#main_class} + */ + readonly mainClass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#max_retries DliSparkJob#max_retries} + */ + readonly maxRetries?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#modules DliSparkJob#modules} + */ + readonly modules?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#name DliSparkJob#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#python_files DliSparkJob#python_files} + */ + readonly pythonFiles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#queue_name DliSparkJob#queue_name} + */ + readonly queueName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#region DliSparkJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#specification DliSparkJob#specification} + */ + readonly specification?: string; + /** + * dependent_packages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#dependent_packages DliSparkJob#dependent_packages} + */ + readonly dependentPackages?: DliSparkJobDependentPackages[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#timeouts DliSparkJob#timeouts} + */ + readonly timeouts?: DliSparkJobTimeouts; +} +export interface DliSparkJobDependentPackagesPackages { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#package_name DliSparkJob#package_name} + */ + readonly packageName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#type DliSparkJob#type} + */ + readonly type: string; +} + +export function dliSparkJobDependentPackagesPackagesToTerraform(struct?: DliSparkJobDependentPackagesPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + package_name: cdktf.stringToTerraform(struct!.packageName), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dliSparkJobDependentPackagesPackagesToHclTerraform(struct?: DliSparkJobDependentPackagesPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + package_name: { + value: cdktf.stringToHclTerraform(struct!.packageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkJobDependentPackagesPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliSparkJobDependentPackagesPackages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._packageName !== undefined) { + hasAnyValues = true; + internalValueResult.packageName = this._packageName; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkJobDependentPackagesPackages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._packageName = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._packageName = value.packageName; + this._type = value.type; + } + } + + // package_name - computed: false, optional: false, required: true + private _packageName?: string; + public get packageName() { + return this.getStringAttribute('package_name'); + } + public set packageName(value: string) { + this._packageName = value; + } + // Temporarily expose input value. Use with caution. + public get packageNameInput() { + return this._packageName; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DliSparkJobDependentPackagesPackagesList extends cdktf.ComplexList { + public internalValue? : DliSparkJobDependentPackagesPackages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliSparkJobDependentPackagesPackagesOutputReference { + return new DliSparkJobDependentPackagesPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliSparkJobDependentPackages { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#group_name DliSparkJob#group_name} + */ + readonly groupName: string; + /** + * packages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#packages DliSparkJob#packages} + */ + readonly packages: DliSparkJobDependentPackagesPackages[] | cdktf.IResolvable; +} + +export function dliSparkJobDependentPackagesToTerraform(struct?: DliSparkJobDependentPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_name: cdktf.stringToTerraform(struct!.groupName), + packages: cdktf.listMapper(dliSparkJobDependentPackagesPackagesToTerraform, true)(struct!.packages), + } +} + + +export function dliSparkJobDependentPackagesToHclTerraform(struct?: DliSparkJobDependentPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + packages: { + value: cdktf.listMapperHcl(dliSparkJobDependentPackagesPackagesToHclTerraform, true)(struct!.packages), + isBlock: true, + type: "list", + storageClassType: "DliSparkJobDependentPackagesPackagesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkJobDependentPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliSparkJobDependentPackages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._packages?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.packages = this._packages?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkJobDependentPackages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._groupName = undefined; + this._packages.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._groupName = value.groupName; + this._packages.internalValue = value.packages; + } + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // packages - computed: false, optional: false, required: true + private _packages = new DliSparkJobDependentPackagesPackagesList(this, "packages", false); + public get packages() { + return this._packages; + } + public putPackages(value: DliSparkJobDependentPackagesPackages[] | cdktf.IResolvable) { + this._packages.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get packagesInput() { + return this._packages.internalValue; + } +} + +export class DliSparkJobDependentPackagesList extends cdktf.ComplexList { + public internalValue? : DliSparkJobDependentPackages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliSparkJobDependentPackagesOutputReference { + return new DliSparkJobDependentPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliSparkJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#delete DliSparkJob#delete} + */ + readonly delete?: string; +} + +export function dliSparkJobTimeoutsToTerraform(struct?: DliSparkJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dliSparkJobTimeoutsToHclTerraform(struct?: DliSparkJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliSparkJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job huaweicloud_dli_spark_job} +*/ +export class DliSparkJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_spark_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliSparkJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliSparkJob to import + * @param importFromId The id of the existing DliSparkJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliSparkJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_spark_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_job huaweicloud_dli_spark_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliSparkJobConfig + */ + public constructor(scope: Construct, id: string, config: DliSparkJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_spark_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appName = config.appName; + this._appParameters = config.appParameters; + this._configurations = config.configurations; + this._driverCores = config.driverCores; + this._driverMemory = config.driverMemory; + this._executorCores = config.executorCores; + this._executorMemory = config.executorMemory; + this._executors = config.executors; + this._files = config.files; + this._id = config.id; + this._jars = config.jars; + this._mainClass = config.mainClass; + this._maxRetries = config.maxRetries; + this._modules = config.modules; + this._name = config.name; + this._pythonFiles = config.pythonFiles; + this._queueName = config.queueName; + this._region = config.region; + this._specification = config.specification; + this._dependentPackages.internalValue = config.dependentPackages; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_name - computed: false, optional: false, required: true + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // app_parameters - computed: false, optional: true, required: false + private _appParameters?: string; + public get appParameters() { + return this.getStringAttribute('app_parameters'); + } + public set appParameters(value: string) { + this._appParameters = value; + } + public resetAppParameters() { + this._appParameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get appParametersInput() { + return this._appParameters; + } + + // configurations - computed: false, optional: true, required: false + private _configurations?: { [key: string]: string }; + public get configurations() { + return this.getStringMapAttribute('configurations'); + } + public set configurations(value: { [key: string]: string }) { + this._configurations = value; + } + public resetConfigurations() { + this._configurations = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // driver_cores - computed: false, optional: true, required: false + private _driverCores?: number; + public get driverCores() { + return this.getNumberAttribute('driver_cores'); + } + public set driverCores(value: number) { + this._driverCores = value; + } + public resetDriverCores() { + this._driverCores = undefined; + } + // Temporarily expose input value. Use with caution. + public get driverCoresInput() { + return this._driverCores; + } + + // driver_memory - computed: false, optional: true, required: false + private _driverMemory?: string; + public get driverMemory() { + return this.getStringAttribute('driver_memory'); + } + public set driverMemory(value: string) { + this._driverMemory = value; + } + public resetDriverMemory() { + this._driverMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get driverMemoryInput() { + return this._driverMemory; + } + + // executor_cores - computed: false, optional: true, required: false + private _executorCores?: number; + public get executorCores() { + return this.getNumberAttribute('executor_cores'); + } + public set executorCores(value: number) { + this._executorCores = value; + } + public resetExecutorCores() { + this._executorCores = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorCoresInput() { + return this._executorCores; + } + + // executor_memory - computed: false, optional: true, required: false + private _executorMemory?: string; + public get executorMemory() { + return this.getStringAttribute('executor_memory'); + } + public set executorMemory(value: string) { + this._executorMemory = value; + } + public resetExecutorMemory() { + this._executorMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorMemoryInput() { + return this._executorMemory; + } + + // executors - computed: false, optional: true, required: false + private _executors?: number; + public get executors() { + return this.getNumberAttribute('executors'); + } + public set executors(value: number) { + this._executors = value; + } + public resetExecutors() { + this._executors = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorsInput() { + return this._executors; + } + + // files - computed: false, optional: true, required: false + private _files?: string[]; + public get files() { + return this.getListAttribute('files'); + } + public set files(value: string[]) { + this._files = value; + } + public resetFiles() { + this._files = undefined; + } + // Temporarily expose input value. Use with caution. + public get filesInput() { + return this._files; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // jars - computed: false, optional: true, required: false + private _jars?: string[]; + public get jars() { + return this.getListAttribute('jars'); + } + public set jars(value: string[]) { + this._jars = value; + } + public resetJars() { + this._jars = undefined; + } + // Temporarily expose input value. Use with caution. + public get jarsInput() { + return this._jars; + } + + // main_class - computed: false, optional: true, required: false + private _mainClass?: string; + public get mainClass() { + return this.getStringAttribute('main_class'); + } + public set mainClass(value: string) { + this._mainClass = value; + } + public resetMainClass() { + this._mainClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get mainClassInput() { + return this._mainClass; + } + + // max_retries - computed: false, optional: true, required: false + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + public resetMaxRetries() { + this._maxRetries = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // modules - computed: false, optional: true, required: false + private _modules?: string[]; + public get modules() { + return this.getListAttribute('modules'); + } + public set modules(value: string[]) { + this._modules = value; + } + public resetModules() { + this._modules = undefined; + } + // Temporarily expose input value. Use with caution. + public get modulesInput() { + return this._modules; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // python_files - computed: false, optional: true, required: false + private _pythonFiles?: string[]; + public get pythonFiles() { + return this.getListAttribute('python_files'); + } + public set pythonFiles(value: string[]) { + this._pythonFiles = value; + } + public resetPythonFiles() { + this._pythonFiles = undefined; + } + // Temporarily expose input value. Use with caution. + public get pythonFilesInput() { + return this._pythonFiles; + } + + // queue_name - computed: false, optional: false, required: true + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // specification - computed: false, optional: true, required: false + private _specification?: string; + public get specification() { + return this.getStringAttribute('specification'); + } + public set specification(value: string) { + this._specification = value; + } + public resetSpecification() { + this._specification = undefined; + } + // Temporarily expose input value. Use with caution. + public get specificationInput() { + return this._specification; + } + + // dependent_packages - computed: false, optional: true, required: false + private _dependentPackages = new DliSparkJobDependentPackagesList(this, "dependent_packages", false); + public get dependentPackages() { + return this._dependentPackages; + } + public putDependentPackages(value: DliSparkJobDependentPackages[] | cdktf.IResolvable) { + this._dependentPackages.internalValue = value; + } + public resetDependentPackages() { + this._dependentPackages.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependentPackagesInput() { + return this._dependentPackages.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliSparkJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliSparkJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_name: cdktf.stringToTerraform(this._appName), + app_parameters: cdktf.stringToTerraform(this._appParameters), + configurations: cdktf.hashMapper(cdktf.stringToTerraform)(this._configurations), + driver_cores: cdktf.numberToTerraform(this._driverCores), + driver_memory: cdktf.stringToTerraform(this._driverMemory), + executor_cores: cdktf.numberToTerraform(this._executorCores), + executor_memory: cdktf.stringToTerraform(this._executorMemory), + executors: cdktf.numberToTerraform(this._executors), + files: cdktf.listMapper(cdktf.stringToTerraform, false)(this._files), + id: cdktf.stringToTerraform(this._id), + jars: cdktf.listMapper(cdktf.stringToTerraform, false)(this._jars), + main_class: cdktf.stringToTerraform(this._mainClass), + max_retries: cdktf.numberToTerraform(this._maxRetries), + modules: cdktf.listMapper(cdktf.stringToTerraform, false)(this._modules), + name: cdktf.stringToTerraform(this._name), + python_files: cdktf.listMapper(cdktf.stringToTerraform, false)(this._pythonFiles), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + specification: cdktf.stringToTerraform(this._specification), + dependent_packages: cdktf.listMapper(dliSparkJobDependentPackagesToTerraform, true)(this._dependentPackages.internalValue), + timeouts: dliSparkJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_name: { + value: cdktf.stringToHclTerraform(this._appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_parameters: { + value: cdktf.stringToHclTerraform(this._appParameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configurations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._configurations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + driver_cores: { + value: cdktf.numberToHclTerraform(this._driverCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + driver_memory: { + value: cdktf.stringToHclTerraform(this._driverMemory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + executor_cores: { + value: cdktf.numberToHclTerraform(this._executorCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + executor_memory: { + value: cdktf.stringToHclTerraform(this._executorMemory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + executors: { + value: cdktf.numberToHclTerraform(this._executors), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._files), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + jars: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._jars), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + main_class: { + value: cdktf.stringToHclTerraform(this._mainClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + modules: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._modules), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + python_files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._pythonFiles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specification: { + value: cdktf.stringToHclTerraform(this._specification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dependent_packages: { + value: cdktf.listMapperHcl(dliSparkJobDependentPackagesToHclTerraform, true)(this._dependentPackages.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliSparkJobDependentPackagesList", + }, + timeouts: { + value: dliSparkJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliSparkJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-spark-template/README.md b/src/constructs/providers/huaweicloud/dli-spark-template/README.md new file mode 100644 index 00000000..74f96a98 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-spark-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_spark_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_spark_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template). diff --git a/src/constructs/providers/huaweicloud/dli-spark-template/index.ts b/src/constructs/providers/huaweicloud/dli-spark-template/index.ts new file mode 100644 index 00000000..c3cf0b62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-spark-template/index.ts @@ -0,0 +1,1503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliSparkTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the spark template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#description DliSparkTemplate#description} + */ + readonly description?: string; + /** + * The group of the spark template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#group DliSparkTemplate#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#id DliSparkTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the spark template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#name DliSparkTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#region DliSparkTemplate#region} + */ + readonly region?: string; + /** + * body block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#body DliSparkTemplate#body} + */ + readonly body: DliSparkTemplateBody; +} +export interface DliSparkTemplateBodyDependentPackagesResources { + /** + * Resource name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#name DliSparkTemplate#name} + */ + readonly name?: string; + /** + * Resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#type DliSparkTemplate#type} + */ + readonly type?: string; +} + +export function dliSparkTemplateBodyDependentPackagesResourcesToTerraform(struct?: DliSparkTemplateBodyDependentPackagesResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dliSparkTemplateBodyDependentPackagesResourcesToHclTerraform(struct?: DliSparkTemplateBodyDependentPackagesResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkTemplateBodyDependentPackagesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliSparkTemplateBodyDependentPackagesResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkTemplateBodyDependentPackagesResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DliSparkTemplateBodyDependentPackagesResourcesList extends cdktf.ComplexList { + public internalValue? : DliSparkTemplateBodyDependentPackagesResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliSparkTemplateBodyDependentPackagesResourcesOutputReference { + return new DliSparkTemplateBodyDependentPackagesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliSparkTemplateBodyDependentPackages { + /** + * User group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#name DliSparkTemplate#name} + */ + readonly name?: string; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#resources DliSparkTemplate#resources} + */ + readonly resources?: DliSparkTemplateBodyDependentPackagesResources[] | cdktf.IResolvable; +} + +export function dliSparkTemplateBodyDependentPackagesToTerraform(struct?: DliSparkTemplateBodyDependentPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + resources: cdktf.listMapper(dliSparkTemplateBodyDependentPackagesResourcesToTerraform, true)(struct!.resources), + } +} + + +export function dliSparkTemplateBodyDependentPackagesToHclTerraform(struct?: DliSparkTemplateBodyDependentPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resources: { + value: cdktf.listMapperHcl(dliSparkTemplateBodyDependentPackagesResourcesToHclTerraform, true)(struct!.resources), + isBlock: true, + type: "list", + storageClassType: "DliSparkTemplateBodyDependentPackagesResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkTemplateBodyDependentPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliSparkTemplateBodyDependentPackages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._resources?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.resources = this._resources?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkTemplateBodyDependentPackages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._resources.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._resources.internalValue = value.resources; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // resources - computed: false, optional: true, required: false + private _resources = new DliSparkTemplateBodyDependentPackagesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: DliSparkTemplateBodyDependentPackagesResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } +} + +export class DliSparkTemplateBodyDependentPackagesList extends cdktf.ComplexList { + public internalValue? : DliSparkTemplateBodyDependentPackages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliSparkTemplateBodyDependentPackagesOutputReference { + return new DliSparkTemplateBodyDependentPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliSparkTemplateBodyResources { + /** + * Resource name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#name DliSparkTemplate#name} + */ + readonly name?: string; + /** + * Resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#type DliSparkTemplate#type} + */ + readonly type?: string; +} + +export function dliSparkTemplateBodyResourcesToTerraform(struct?: DliSparkTemplateBodyResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dliSparkTemplateBodyResourcesToHclTerraform(struct?: DliSparkTemplateBodyResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkTemplateBodyResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliSparkTemplateBodyResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkTemplateBodyResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DliSparkTemplateBodyResourcesList extends cdktf.ComplexList { + public internalValue? : DliSparkTemplateBodyResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliSparkTemplateBodyResourcesOutputReference { + return new DliSparkTemplateBodyResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliSparkTemplateBody { + /** + * Name of the package that is of the JAR or pyFile type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#app_name DliSparkTemplate#app_name} + */ + readonly appName?: string; + /** + * Input parameters of the main class, that is application parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#app_parameters DliSparkTemplate#app_parameters} + */ + readonly appParameters?: string[]; + /** + * Whether to enable the retry function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#auto_recovery DliSparkTemplate#auto_recovery} + */ + readonly autoRecovery?: boolean | cdktf.IResolvable; + /** + * The configuration items of the DLI spark. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#configurations DliSparkTemplate#configurations} + */ + readonly configurations?: { [key: string]: string }; + /** + * Number of CPU cores of the Spark application driver. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#driver_cores DliSparkTemplate#driver_cores} + */ + readonly driverCores?: number; + /** + * Driver memory of the Spark application, for example, 2 GB and 2048 MB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#driver_memory DliSparkTemplate#driver_memory} + */ + readonly driverMemory?: string; + /** + * Number of CPU cores of each Executor in the Spark application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#executor_cores DliSparkTemplate#executor_cores} + */ + readonly executorCores?: number; + /** + * Executor memory of the Spark application, for example, 2 GB and 2048 MB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#executor_memory DliSparkTemplate#executor_memory} + */ + readonly executorMemory?: string; + /** + * Name of the package that is of the file type and has been uploaded to the DLI resource management system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#files DliSparkTemplate#files} + */ + readonly files?: string[]; + /** + * Name of the package that is of the JAR type and has been uploaded to the DLI resource management system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#jars DliSparkTemplate#jars} + */ + readonly jars?: string[]; + /** + * Java/Spark main class of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#main_class DliSparkTemplate#main_class} + */ + readonly mainClass?: string; + /** + * Maximum retry times. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#max_retry_times DliSparkTemplate#max_retry_times} + */ + readonly maxRetryTimes?: number; + /** + * Name of the dependent system resource module. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#modules DliSparkTemplate#modules} + */ + readonly modules?: string[]; + /** + * The spark job name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#name DliSparkTemplate#name} + */ + readonly name?: string; + /** + * Number of Executors in a Spark application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#num_executors DliSparkTemplate#num_executors} + */ + readonly numExecutors?: number; + /** + * OBS bucket for storing the Spark jobs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#obs_bucket DliSparkTemplate#obs_bucket} + */ + readonly obsBucket?: string; + /** + * Name of the package that is of the PyFile type and has been uploaded to the DLI resource management system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#python_files DliSparkTemplate#python_files} + */ + readonly pythonFiles?: string[]; + /** + * The DLI queue name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#queue_name DliSparkTemplate#queue_name} + */ + readonly queueName?: string; + /** + * Compute resource type. Currently, resource types A, B, and C are available. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#specification DliSparkTemplate#specification} + */ + readonly specification?: string; + /** + * dependent_packages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#dependent_packages DliSparkTemplate#dependent_packages} + */ + readonly dependentPackages?: DliSparkTemplateBodyDependentPackages[] | cdktf.IResolvable; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#resources DliSparkTemplate#resources} + */ + readonly resources?: DliSparkTemplateBodyResources[] | cdktf.IResolvable; +} + +export function dliSparkTemplateBodyToTerraform(struct?: DliSparkTemplateBodyOutputReference | DliSparkTemplateBody): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + app_name: cdktf.stringToTerraform(struct!.appName), + app_parameters: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.appParameters), + auto_recovery: cdktf.booleanToTerraform(struct!.autoRecovery), + configurations: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.configurations), + driver_cores: cdktf.numberToTerraform(struct!.driverCores), + driver_memory: cdktf.stringToTerraform(struct!.driverMemory), + executor_cores: cdktf.numberToTerraform(struct!.executorCores), + executor_memory: cdktf.stringToTerraform(struct!.executorMemory), + files: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.files), + jars: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.jars), + main_class: cdktf.stringToTerraform(struct!.mainClass), + max_retry_times: cdktf.numberToTerraform(struct!.maxRetryTimes), + modules: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.modules), + name: cdktf.stringToTerraform(struct!.name), + num_executors: cdktf.numberToTerraform(struct!.numExecutors), + obs_bucket: cdktf.stringToTerraform(struct!.obsBucket), + python_files: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.pythonFiles), + queue_name: cdktf.stringToTerraform(struct!.queueName), + specification: cdktf.stringToTerraform(struct!.specification), + dependent_packages: cdktf.listMapper(dliSparkTemplateBodyDependentPackagesToTerraform, true)(struct!.dependentPackages), + resources: cdktf.listMapper(dliSparkTemplateBodyResourcesToTerraform, true)(struct!.resources), + } +} + + +export function dliSparkTemplateBodyToHclTerraform(struct?: DliSparkTemplateBodyOutputReference | DliSparkTemplateBody): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + app_name: { + value: cdktf.stringToHclTerraform(struct!.appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_parameters: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.appParameters), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + auto_recovery: { + value: cdktf.booleanToHclTerraform(struct!.autoRecovery), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + configurations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.configurations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + driver_cores: { + value: cdktf.numberToHclTerraform(struct!.driverCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + driver_memory: { + value: cdktf.stringToHclTerraform(struct!.driverMemory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + executor_cores: { + value: cdktf.numberToHclTerraform(struct!.executorCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + executor_memory: { + value: cdktf.stringToHclTerraform(struct!.executorMemory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.files), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + jars: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.jars), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + main_class: { + value: cdktf.stringToHclTerraform(struct!.mainClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retry_times: { + value: cdktf.numberToHclTerraform(struct!.maxRetryTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + modules: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.modules), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + num_executors: { + value: cdktf.numberToHclTerraform(struct!.numExecutors), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + obs_bucket: { + value: cdktf.stringToHclTerraform(struct!.obsBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + python_files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.pythonFiles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + queue_name: { + value: cdktf.stringToHclTerraform(struct!.queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specification: { + value: cdktf.stringToHclTerraform(struct!.specification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dependent_packages: { + value: cdktf.listMapperHcl(dliSparkTemplateBodyDependentPackagesToHclTerraform, true)(struct!.dependentPackages), + isBlock: true, + type: "list", + storageClassType: "DliSparkTemplateBodyDependentPackagesList", + }, + resources: { + value: cdktf.listMapperHcl(dliSparkTemplateBodyResourcesToHclTerraform, true)(struct!.resources), + isBlock: true, + type: "list", + storageClassType: "DliSparkTemplateBodyResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSparkTemplateBodyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DliSparkTemplateBody | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._appName !== undefined) { + hasAnyValues = true; + internalValueResult.appName = this._appName; + } + if (this._appParameters !== undefined) { + hasAnyValues = true; + internalValueResult.appParameters = this._appParameters; + } + if (this._autoRecovery !== undefined) { + hasAnyValues = true; + internalValueResult.autoRecovery = this._autoRecovery; + } + if (this._configurations !== undefined) { + hasAnyValues = true; + internalValueResult.configurations = this._configurations; + } + if (this._driverCores !== undefined) { + hasAnyValues = true; + internalValueResult.driverCores = this._driverCores; + } + if (this._driverMemory !== undefined) { + hasAnyValues = true; + internalValueResult.driverMemory = this._driverMemory; + } + if (this._executorCores !== undefined) { + hasAnyValues = true; + internalValueResult.executorCores = this._executorCores; + } + if (this._executorMemory !== undefined) { + hasAnyValues = true; + internalValueResult.executorMemory = this._executorMemory; + } + if (this._files !== undefined) { + hasAnyValues = true; + internalValueResult.files = this._files; + } + if (this._jars !== undefined) { + hasAnyValues = true; + internalValueResult.jars = this._jars; + } + if (this._mainClass !== undefined) { + hasAnyValues = true; + internalValueResult.mainClass = this._mainClass; + } + if (this._maxRetryTimes !== undefined) { + hasAnyValues = true; + internalValueResult.maxRetryTimes = this._maxRetryTimes; + } + if (this._modules !== undefined) { + hasAnyValues = true; + internalValueResult.modules = this._modules; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._numExecutors !== undefined) { + hasAnyValues = true; + internalValueResult.numExecutors = this._numExecutors; + } + if (this._obsBucket !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucket = this._obsBucket; + } + if (this._pythonFiles !== undefined) { + hasAnyValues = true; + internalValueResult.pythonFiles = this._pythonFiles; + } + if (this._queueName !== undefined) { + hasAnyValues = true; + internalValueResult.queueName = this._queueName; + } + if (this._specification !== undefined) { + hasAnyValues = true; + internalValueResult.specification = this._specification; + } + if (this._dependentPackages?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dependentPackages = this._dependentPackages?.internalValue; + } + if (this._resources?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.resources = this._resources?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSparkTemplateBody | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._appName = undefined; + this._appParameters = undefined; + this._autoRecovery = undefined; + this._configurations = undefined; + this._driverCores = undefined; + this._driverMemory = undefined; + this._executorCores = undefined; + this._executorMemory = undefined; + this._files = undefined; + this._jars = undefined; + this._mainClass = undefined; + this._maxRetryTimes = undefined; + this._modules = undefined; + this._name = undefined; + this._numExecutors = undefined; + this._obsBucket = undefined; + this._pythonFiles = undefined; + this._queueName = undefined; + this._specification = undefined; + this._dependentPackages.internalValue = undefined; + this._resources.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._appName = value.appName; + this._appParameters = value.appParameters; + this._autoRecovery = value.autoRecovery; + this._configurations = value.configurations; + this._driverCores = value.driverCores; + this._driverMemory = value.driverMemory; + this._executorCores = value.executorCores; + this._executorMemory = value.executorMemory; + this._files = value.files; + this._jars = value.jars; + this._mainClass = value.mainClass; + this._maxRetryTimes = value.maxRetryTimes; + this._modules = value.modules; + this._name = value.name; + this._numExecutors = value.numExecutors; + this._obsBucket = value.obsBucket; + this._pythonFiles = value.pythonFiles; + this._queueName = value.queueName; + this._specification = value.specification; + this._dependentPackages.internalValue = value.dependentPackages; + this._resources.internalValue = value.resources; + } + } + + // app_name - computed: true, optional: true, required: false + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + public resetAppName() { + this._appName = undefined; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // app_parameters - computed: true, optional: true, required: false + private _appParameters?: string[]; + public get appParameters() { + return this.getListAttribute('app_parameters'); + } + public set appParameters(value: string[]) { + this._appParameters = value; + } + public resetAppParameters() { + this._appParameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get appParametersInput() { + return this._appParameters; + } + + // auto_recovery - computed: true, optional: true, required: false + private _autoRecovery?: boolean | cdktf.IResolvable; + public get autoRecovery() { + return this.getBooleanAttribute('auto_recovery'); + } + public set autoRecovery(value: boolean | cdktf.IResolvable) { + this._autoRecovery = value; + } + public resetAutoRecovery() { + this._autoRecovery = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRecoveryInput() { + return this._autoRecovery; + } + + // configurations - computed: true, optional: true, required: false + private _configurations?: { [key: string]: string }; + public get configurations() { + return this.getStringMapAttribute('configurations'); + } + public set configurations(value: { [key: string]: string }) { + this._configurations = value; + } + public resetConfigurations() { + this._configurations = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations; + } + + // driver_cores - computed: true, optional: true, required: false + private _driverCores?: number; + public get driverCores() { + return this.getNumberAttribute('driver_cores'); + } + public set driverCores(value: number) { + this._driverCores = value; + } + public resetDriverCores() { + this._driverCores = undefined; + } + // Temporarily expose input value. Use with caution. + public get driverCoresInput() { + return this._driverCores; + } + + // driver_memory - computed: true, optional: true, required: false + private _driverMemory?: string; + public get driverMemory() { + return this.getStringAttribute('driver_memory'); + } + public set driverMemory(value: string) { + this._driverMemory = value; + } + public resetDriverMemory() { + this._driverMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get driverMemoryInput() { + return this._driverMemory; + } + + // executor_cores - computed: true, optional: true, required: false + private _executorCores?: number; + public get executorCores() { + return this.getNumberAttribute('executor_cores'); + } + public set executorCores(value: number) { + this._executorCores = value; + } + public resetExecutorCores() { + this._executorCores = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorCoresInput() { + return this._executorCores; + } + + // executor_memory - computed: true, optional: true, required: false + private _executorMemory?: string; + public get executorMemory() { + return this.getStringAttribute('executor_memory'); + } + public set executorMemory(value: string) { + this._executorMemory = value; + } + public resetExecutorMemory() { + this._executorMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorMemoryInput() { + return this._executorMemory; + } + + // files - computed: true, optional: true, required: false + private _files?: string[]; + public get files() { + return this.getListAttribute('files'); + } + public set files(value: string[]) { + this._files = value; + } + public resetFiles() { + this._files = undefined; + } + // Temporarily expose input value. Use with caution. + public get filesInput() { + return this._files; + } + + // jars - computed: true, optional: true, required: false + private _jars?: string[]; + public get jars() { + return this.getListAttribute('jars'); + } + public set jars(value: string[]) { + this._jars = value; + } + public resetJars() { + this._jars = undefined; + } + // Temporarily expose input value. Use with caution. + public get jarsInput() { + return this._jars; + } + + // main_class - computed: true, optional: true, required: false + private _mainClass?: string; + public get mainClass() { + return this.getStringAttribute('main_class'); + } + public set mainClass(value: string) { + this._mainClass = value; + } + public resetMainClass() { + this._mainClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get mainClassInput() { + return this._mainClass; + } + + // max_retry_times - computed: true, optional: true, required: false + private _maxRetryTimes?: number; + public get maxRetryTimes() { + return this.getNumberAttribute('max_retry_times'); + } + public set maxRetryTimes(value: number) { + this._maxRetryTimes = value; + } + public resetMaxRetryTimes() { + this._maxRetryTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetryTimesInput() { + return this._maxRetryTimes; + } + + // modules - computed: true, optional: true, required: false + private _modules?: string[]; + public get modules() { + return this.getListAttribute('modules'); + } + public set modules(value: string[]) { + this._modules = value; + } + public resetModules() { + this._modules = undefined; + } + // Temporarily expose input value. Use with caution. + public get modulesInput() { + return this._modules; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // num_executors - computed: true, optional: true, required: false + private _numExecutors?: number; + public get numExecutors() { + return this.getNumberAttribute('num_executors'); + } + public set numExecutors(value: number) { + this._numExecutors = value; + } + public resetNumExecutors() { + this._numExecutors = undefined; + } + // Temporarily expose input value. Use with caution. + public get numExecutorsInput() { + return this._numExecutors; + } + + // obs_bucket - computed: true, optional: true, required: false + private _obsBucket?: string; + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + public set obsBucket(value: string) { + this._obsBucket = value; + } + public resetObsBucket() { + this._obsBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketInput() { + return this._obsBucket; + } + + // python_files - computed: true, optional: true, required: false + private _pythonFiles?: string[]; + public get pythonFiles() { + return this.getListAttribute('python_files'); + } + public set pythonFiles(value: string[]) { + this._pythonFiles = value; + } + public resetPythonFiles() { + this._pythonFiles = undefined; + } + // Temporarily expose input value. Use with caution. + public get pythonFilesInput() { + return this._pythonFiles; + } + + // queue_name - computed: true, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // specification - computed: true, optional: true, required: false + private _specification?: string; + public get specification() { + return this.getStringAttribute('specification'); + } + public set specification(value: string) { + this._specification = value; + } + public resetSpecification() { + this._specification = undefined; + } + // Temporarily expose input value. Use with caution. + public get specificationInput() { + return this._specification; + } + + // dependent_packages - computed: false, optional: true, required: false + private _dependentPackages = new DliSparkTemplateBodyDependentPackagesList(this, "dependent_packages", false); + public get dependentPackages() { + return this._dependentPackages; + } + public putDependentPackages(value: DliSparkTemplateBodyDependentPackages[] | cdktf.IResolvable) { + this._dependentPackages.internalValue = value; + } + public resetDependentPackages() { + this._dependentPackages.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependentPackagesInput() { + return this._dependentPackages.internalValue; + } + + // resources - computed: false, optional: true, required: false + private _resources = new DliSparkTemplateBodyResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: DliSparkTemplateBodyResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template huaweicloud_dli_spark_template} +*/ +export class DliSparkTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_spark_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliSparkTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliSparkTemplate to import + * @param importFromId The id of the existing DliSparkTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliSparkTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_spark_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_spark_template huaweicloud_dli_spark_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliSparkTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DliSparkTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_spark_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._group = config.group; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._body.internalValue = config.body; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group - computed: true, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // body - computed: false, optional: false, required: true + private _body = new DliSparkTemplateBodyOutputReference(this, "body"); + public get body() { + return this._body; + } + public putBody(value: DliSparkTemplateBody) { + this._body.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bodyInput() { + return this._body.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + body: dliSparkTemplateBodyToTerraform(this._body.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + body: { + value: dliSparkTemplateBodyToHclTerraform(this._body.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliSparkTemplateBodyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-sql-job/README.md b/src/constructs/providers/huaweicloud/dli-sql-job/README.md new file mode 100644 index 00000000..0fd3631d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-sql-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_sql_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_sql_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job). diff --git a/src/constructs/providers/huaweicloud/dli-sql-job/index.ts b/src/constructs/providers/huaweicloud/dli-sql-job/index.ts new file mode 100644 index 00000000..21a91ea8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-sql-job/index.ts @@ -0,0 +1,792 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliSqlJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#database_name DliSqlJob#database_name} + */ + readonly databaseName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#id DliSqlJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#queue_name DliSqlJob#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#region DliSqlJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#sql DliSqlJob#sql} + */ + readonly sql: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#tags DliSqlJob#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * conf block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#conf DliSqlJob#conf} + */ + readonly conf?: DliSqlJobConf; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#timeouts DliSqlJob#timeouts} + */ + readonly timeouts?: DliSqlJobTimeouts; +} +export interface DliSqlJobConf { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#dli_sql_job_timeout DliSqlJob#dli_sql_job_timeout} + */ + readonly dliSqlJobTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#dli_sql_sqlasync_enabled DliSqlJob#dli_sql_sqlasync_enabled} + */ + readonly dliSqlSqlasyncEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#spark_sql_auto_broadcast_join_threshold DliSqlJob#spark_sql_auto_broadcast_join_threshold} + */ + readonly sparkSqlAutoBroadcastJoinThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#spark_sql_bad_records_path DliSqlJob#spark_sql_bad_records_path} + */ + readonly sparkSqlBadRecordsPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#spark_sql_dynamic_partition_overwrite_enabled DliSqlJob#spark_sql_dynamic_partition_overwrite_enabled} + */ + readonly sparkSqlDynamicPartitionOverwriteEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#spark_sql_files_max_partition_bytes DliSqlJob#spark_sql_files_max_partition_bytes} + */ + readonly sparkSqlFilesMaxPartitionBytes?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#spark_sql_max_records_per_file DliSqlJob#spark_sql_max_records_per_file} + */ + readonly sparkSqlMaxRecordsPerFile?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#spark_sql_shuffle_partitions DliSqlJob#spark_sql_shuffle_partitions} + */ + readonly sparkSqlShufflePartitions?: number; +} + +export function dliSqlJobConfToTerraform(struct?: DliSqlJobConfOutputReference | DliSqlJobConf): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dli_sql_job_timeout: cdktf.numberToTerraform(struct!.dliSqlJobTimeout), + dli_sql_sqlasync_enabled: cdktf.booleanToTerraform(struct!.dliSqlSqlasyncEnabled), + spark_sql_auto_broadcast_join_threshold: cdktf.numberToTerraform(struct!.sparkSqlAutoBroadcastJoinThreshold), + spark_sql_bad_records_path: cdktf.stringToTerraform(struct!.sparkSqlBadRecordsPath), + spark_sql_dynamic_partition_overwrite_enabled: cdktf.booleanToTerraform(struct!.sparkSqlDynamicPartitionOverwriteEnabled), + spark_sql_files_max_partition_bytes: cdktf.numberToTerraform(struct!.sparkSqlFilesMaxPartitionBytes), + spark_sql_max_records_per_file: cdktf.numberToTerraform(struct!.sparkSqlMaxRecordsPerFile), + spark_sql_shuffle_partitions: cdktf.numberToTerraform(struct!.sparkSqlShufflePartitions), + } +} + + +export function dliSqlJobConfToHclTerraform(struct?: DliSqlJobConfOutputReference | DliSqlJobConf): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dli_sql_job_timeout: { + value: cdktf.numberToHclTerraform(struct!.dliSqlJobTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dli_sql_sqlasync_enabled: { + value: cdktf.booleanToHclTerraform(struct!.dliSqlSqlasyncEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + spark_sql_auto_broadcast_join_threshold: { + value: cdktf.numberToHclTerraform(struct!.sparkSqlAutoBroadcastJoinThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spark_sql_bad_records_path: { + value: cdktf.stringToHclTerraform(struct!.sparkSqlBadRecordsPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spark_sql_dynamic_partition_overwrite_enabled: { + value: cdktf.booleanToHclTerraform(struct!.sparkSqlDynamicPartitionOverwriteEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + spark_sql_files_max_partition_bytes: { + value: cdktf.numberToHclTerraform(struct!.sparkSqlFilesMaxPartitionBytes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spark_sql_max_records_per_file: { + value: cdktf.numberToHclTerraform(struct!.sparkSqlMaxRecordsPerFile), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + spark_sql_shuffle_partitions: { + value: cdktf.numberToHclTerraform(struct!.sparkSqlShufflePartitions), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSqlJobConfOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DliSqlJobConf | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dliSqlJobTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.dliSqlJobTimeout = this._dliSqlJobTimeout; + } + if (this._dliSqlSqlasyncEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.dliSqlSqlasyncEnabled = this._dliSqlSqlasyncEnabled; + } + if (this._sparkSqlAutoBroadcastJoinThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.sparkSqlAutoBroadcastJoinThreshold = this._sparkSqlAutoBroadcastJoinThreshold; + } + if (this._sparkSqlBadRecordsPath !== undefined) { + hasAnyValues = true; + internalValueResult.sparkSqlBadRecordsPath = this._sparkSqlBadRecordsPath; + } + if (this._sparkSqlDynamicPartitionOverwriteEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.sparkSqlDynamicPartitionOverwriteEnabled = this._sparkSqlDynamicPartitionOverwriteEnabled; + } + if (this._sparkSqlFilesMaxPartitionBytes !== undefined) { + hasAnyValues = true; + internalValueResult.sparkSqlFilesMaxPartitionBytes = this._sparkSqlFilesMaxPartitionBytes; + } + if (this._sparkSqlMaxRecordsPerFile !== undefined) { + hasAnyValues = true; + internalValueResult.sparkSqlMaxRecordsPerFile = this._sparkSqlMaxRecordsPerFile; + } + if (this._sparkSqlShufflePartitions !== undefined) { + hasAnyValues = true; + internalValueResult.sparkSqlShufflePartitions = this._sparkSqlShufflePartitions; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSqlJobConf | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dliSqlJobTimeout = undefined; + this._dliSqlSqlasyncEnabled = undefined; + this._sparkSqlAutoBroadcastJoinThreshold = undefined; + this._sparkSqlBadRecordsPath = undefined; + this._sparkSqlDynamicPartitionOverwriteEnabled = undefined; + this._sparkSqlFilesMaxPartitionBytes = undefined; + this._sparkSqlMaxRecordsPerFile = undefined; + this._sparkSqlShufflePartitions = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dliSqlJobTimeout = value.dliSqlJobTimeout; + this._dliSqlSqlasyncEnabled = value.dliSqlSqlasyncEnabled; + this._sparkSqlAutoBroadcastJoinThreshold = value.sparkSqlAutoBroadcastJoinThreshold; + this._sparkSqlBadRecordsPath = value.sparkSqlBadRecordsPath; + this._sparkSqlDynamicPartitionOverwriteEnabled = value.sparkSqlDynamicPartitionOverwriteEnabled; + this._sparkSqlFilesMaxPartitionBytes = value.sparkSqlFilesMaxPartitionBytes; + this._sparkSqlMaxRecordsPerFile = value.sparkSqlMaxRecordsPerFile; + this._sparkSqlShufflePartitions = value.sparkSqlShufflePartitions; + } + } + + // dli_sql_job_timeout - computed: false, optional: true, required: false + private _dliSqlJobTimeout?: number; + public get dliSqlJobTimeout() { + return this.getNumberAttribute('dli_sql_job_timeout'); + } + public set dliSqlJobTimeout(value: number) { + this._dliSqlJobTimeout = value; + } + public resetDliSqlJobTimeout() { + this._dliSqlJobTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get dliSqlJobTimeoutInput() { + return this._dliSqlJobTimeout; + } + + // dli_sql_sqlasync_enabled - computed: false, optional: true, required: false + private _dliSqlSqlasyncEnabled?: boolean | cdktf.IResolvable; + public get dliSqlSqlasyncEnabled() { + return this.getBooleanAttribute('dli_sql_sqlasync_enabled'); + } + public set dliSqlSqlasyncEnabled(value: boolean | cdktf.IResolvable) { + this._dliSqlSqlasyncEnabled = value; + } + public resetDliSqlSqlasyncEnabled() { + this._dliSqlSqlasyncEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get dliSqlSqlasyncEnabledInput() { + return this._dliSqlSqlasyncEnabled; + } + + // spark_sql_auto_broadcast_join_threshold - computed: false, optional: true, required: false + private _sparkSqlAutoBroadcastJoinThreshold?: number; + public get sparkSqlAutoBroadcastJoinThreshold() { + return this.getNumberAttribute('spark_sql_auto_broadcast_join_threshold'); + } + public set sparkSqlAutoBroadcastJoinThreshold(value: number) { + this._sparkSqlAutoBroadcastJoinThreshold = value; + } + public resetSparkSqlAutoBroadcastJoinThreshold() { + this._sparkSqlAutoBroadcastJoinThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkSqlAutoBroadcastJoinThresholdInput() { + return this._sparkSqlAutoBroadcastJoinThreshold; + } + + // spark_sql_bad_records_path - computed: false, optional: true, required: false + private _sparkSqlBadRecordsPath?: string; + public get sparkSqlBadRecordsPath() { + return this.getStringAttribute('spark_sql_bad_records_path'); + } + public set sparkSqlBadRecordsPath(value: string) { + this._sparkSqlBadRecordsPath = value; + } + public resetSparkSqlBadRecordsPath() { + this._sparkSqlBadRecordsPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkSqlBadRecordsPathInput() { + return this._sparkSqlBadRecordsPath; + } + + // spark_sql_dynamic_partition_overwrite_enabled - computed: false, optional: true, required: false + private _sparkSqlDynamicPartitionOverwriteEnabled?: boolean | cdktf.IResolvable; + public get sparkSqlDynamicPartitionOverwriteEnabled() { + return this.getBooleanAttribute('spark_sql_dynamic_partition_overwrite_enabled'); + } + public set sparkSqlDynamicPartitionOverwriteEnabled(value: boolean | cdktf.IResolvable) { + this._sparkSqlDynamicPartitionOverwriteEnabled = value; + } + public resetSparkSqlDynamicPartitionOverwriteEnabled() { + this._sparkSqlDynamicPartitionOverwriteEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkSqlDynamicPartitionOverwriteEnabledInput() { + return this._sparkSqlDynamicPartitionOverwriteEnabled; + } + + // spark_sql_files_max_partition_bytes - computed: false, optional: true, required: false + private _sparkSqlFilesMaxPartitionBytes?: number; + public get sparkSqlFilesMaxPartitionBytes() { + return this.getNumberAttribute('spark_sql_files_max_partition_bytes'); + } + public set sparkSqlFilesMaxPartitionBytes(value: number) { + this._sparkSqlFilesMaxPartitionBytes = value; + } + public resetSparkSqlFilesMaxPartitionBytes() { + this._sparkSqlFilesMaxPartitionBytes = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkSqlFilesMaxPartitionBytesInput() { + return this._sparkSqlFilesMaxPartitionBytes; + } + + // spark_sql_max_records_per_file - computed: false, optional: true, required: false + private _sparkSqlMaxRecordsPerFile?: number; + public get sparkSqlMaxRecordsPerFile() { + return this.getNumberAttribute('spark_sql_max_records_per_file'); + } + public set sparkSqlMaxRecordsPerFile(value: number) { + this._sparkSqlMaxRecordsPerFile = value; + } + public resetSparkSqlMaxRecordsPerFile() { + this._sparkSqlMaxRecordsPerFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkSqlMaxRecordsPerFileInput() { + return this._sparkSqlMaxRecordsPerFile; + } + + // spark_sql_shuffle_partitions - computed: false, optional: true, required: false + private _sparkSqlShufflePartitions?: number; + public get sparkSqlShufflePartitions() { + return this.getNumberAttribute('spark_sql_shuffle_partitions'); + } + public set sparkSqlShufflePartitions(value: number) { + this._sparkSqlShufflePartitions = value; + } + public resetSparkSqlShufflePartitions() { + this._sparkSqlShufflePartitions = undefined; + } + // Temporarily expose input value. Use with caution. + public get sparkSqlShufflePartitionsInput() { + return this._sparkSqlShufflePartitions; + } +} +export interface DliSqlJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#create DliSqlJob#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#delete DliSqlJob#delete} + */ + readonly delete?: string; +} + +export function dliSqlJobTimeoutsToTerraform(struct?: DliSqlJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dliSqlJobTimeoutsToHclTerraform(struct?: DliSqlJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliSqlJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliSqlJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliSqlJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job huaweicloud_dli_sql_job} +*/ +export class DliSqlJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_sql_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliSqlJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliSqlJob to import + * @param importFromId The id of the existing DliSqlJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliSqlJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_sql_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_job huaweicloud_dli_sql_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliSqlJobConfig + */ + public constructor(scope: Construct, id: string, config: DliSqlJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_sql_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseName = config.databaseName; + this._id = config.id; + this._queueName = config.queueName; + this._region = config.region; + this._sql = config.sql; + this._tags = config.tags; + this._conf.internalValue = config.conf; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_name - computed: false, optional: true, required: false + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getNumberAttribute('duration'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_type - computed: true, optional: false, required: false + public get jobType() { + return this.getStringAttribute('job_type'); + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // queue_name - computed: true, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rows - computed: true, optional: false, required: false + private _rows = new cdktf.StringListList(this, "rows", false); + public get rows() { + return this._rows; + } + + // schema - computed: true, optional: false, required: false + private _schema = new cdktf.StringMapList(this, "schema", false); + public get schema() { + return this._schema; + } + + // sql - computed: false, optional: false, required: true + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // conf - computed: false, optional: true, required: false + private _conf = new DliSqlJobConfOutputReference(this, "conf"); + public get conf() { + return this._conf; + } + public putConf(value: DliSqlJobConf) { + this._conf.internalValue = value; + } + public resetConf() { + this._conf.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get confInput() { + return this._conf.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliSqlJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliSqlJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name: cdktf.stringToTerraform(this._databaseName), + id: cdktf.stringToTerraform(this._id), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + sql: cdktf.stringToTerraform(this._sql), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + conf: dliSqlJobConfToTerraform(this._conf.internalValue), + timeouts: dliSqlJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + conf: { + value: dliSqlJobConfToHclTerraform(this._conf.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliSqlJobConfList", + }, + timeouts: { + value: dliSqlJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliSqlJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-sql-template/README.md b/src/constructs/providers/huaweicloud/dli-sql-template/README.md new file mode 100644 index 00000000..b03c8f8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-sql-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_sql_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_sql_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template). diff --git a/src/constructs/providers/huaweicloud/dli-sql-template/index.ts b/src/constructs/providers/huaweicloud/dli-sql-template/index.ts new file mode 100644 index 00000000..c8064b02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-sql-template/index.ts @@ -0,0 +1,263 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliSqlTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#description DliSqlTemplate#description} + */ + readonly description?: string; + /** + * The group of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#group DliSqlTemplate#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#id DliSqlTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#name DliSqlTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#region DliSqlTemplate#region} + */ + readonly region?: string; + /** + * The statement of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#sql DliSqlTemplate#sql} + */ + readonly sql: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template huaweicloud_dli_sql_template} +*/ +export class DliSqlTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_sql_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliSqlTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliSqlTemplate to import + * @param importFromId The id of the existing DliSqlTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliSqlTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_sql_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_sql_template huaweicloud_dli_sql_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliSqlTemplateConfig + */ + public constructor(scope: Construct, id: string, config: DliSqlTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_sql_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._group = config.group; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sql = config.sql; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group - computed: true, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sql - computed: false, optional: false, required: true + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sql: cdktf.stringToTerraform(this._sql), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-table/README.md b/src/constructs/providers/huaweicloud/dli-table/README.md new file mode 100644 index 00000000..cbb1a772 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-table/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_table` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_table`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table). diff --git a/src/constructs/providers/huaweicloud/dli-table/index.ts b/src/constructs/providers/huaweicloud/dli-table/index.ts new file mode 100644 index 00000000..d22fbd7b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-table/index.ts @@ -0,0 +1,867 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliTableConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#bucket_location DliTable#bucket_location} + */ + readonly bucketLocation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#data_format DliTable#data_format} + */ + readonly dataFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#data_location DliTable#data_location} + */ + readonly dataLocation: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#database_name DliTable#database_name} + */ + readonly databaseName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#date_format DliTable#date_format} + */ + readonly dateFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#delimiter DliTable#delimiter} + */ + readonly delimiter?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#description DliTable#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#escape_char DliTable#escape_char} + */ + readonly escapeChar?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#id DliTable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#name DliTable#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#quote_char DliTable#quote_char} + */ + readonly quoteChar?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#region DliTable#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#timestamp_format DliTable#timestamp_format} + */ + readonly timestampFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#with_column_header DliTable#with_column_header} + */ + readonly withColumnHeader?: boolean | cdktf.IResolvable; + /** + * columns block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#columns DliTable#columns} + */ + readonly columns?: DliTableColumns[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#timeouts DliTable#timeouts} + */ + readonly timeouts?: DliTableTimeouts; +} +export interface DliTableColumns { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#description DliTable#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#is_partition DliTable#is_partition} + */ + readonly isPartition?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#name DliTable#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#type DliTable#type} + */ + readonly type: string; +} + +export function dliTableColumnsToTerraform(struct?: DliTableColumns | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + is_partition: cdktf.booleanToTerraform(struct!.isPartition), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dliTableColumnsToHclTerraform(struct?: DliTableColumns | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_partition: { + value: cdktf.booleanToHclTerraform(struct!.isPartition), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliTableColumnsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliTableColumns | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._isPartition !== undefined) { + hasAnyValues = true; + internalValueResult.isPartition = this._isPartition; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliTableColumns | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._isPartition = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._isPartition = value.isPartition; + this._name = value.name; + this._type = value.type; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // is_partition - computed: false, optional: true, required: false + private _isPartition?: boolean | cdktf.IResolvable; + public get isPartition() { + return this.getBooleanAttribute('is_partition'); + } + public set isPartition(value: boolean | cdktf.IResolvable) { + this._isPartition = value; + } + public resetIsPartition() { + this._isPartition = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPartitionInput() { + return this._isPartition; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DliTableColumnsList extends cdktf.ComplexList { + public internalValue? : DliTableColumns[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliTableColumnsOutputReference { + return new DliTableColumnsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliTableTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#create DliTable#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#delete DliTable#delete} + */ + readonly delete?: string; +} + +export function dliTableTimeoutsToTerraform(struct?: DliTableTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dliTableTimeoutsToHclTerraform(struct?: DliTableTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliTableTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DliTableTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliTableTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table huaweicloud_dli_table} +*/ +export class DliTable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_table"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliTable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliTable to import + * @param importFromId The id of the existing DliTable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliTable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_table", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_table huaweicloud_dli_table} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliTableConfig + */ + public constructor(scope: Construct, id: string, config: DliTableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_table', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketLocation = config.bucketLocation; + this._dataFormat = config.dataFormat; + this._dataLocation = config.dataLocation; + this._databaseName = config.databaseName; + this._dateFormat = config.dateFormat; + this._delimiter = config.delimiter; + this._description = config.description; + this._escapeChar = config.escapeChar; + this._id = config.id; + this._name = config.name; + this._quoteChar = config.quoteChar; + this._region = config.region; + this._timestampFormat = config.timestampFormat; + this._withColumnHeader = config.withColumnHeader; + this._columns.internalValue = config.columns; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_location - computed: true, optional: true, required: false + private _bucketLocation?: string; + public get bucketLocation() { + return this.getStringAttribute('bucket_location'); + } + public set bucketLocation(value: string) { + this._bucketLocation = value; + } + public resetBucketLocation() { + this._bucketLocation = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketLocationInput() { + return this._bucketLocation; + } + + // data_format - computed: true, optional: true, required: false + private _dataFormat?: string; + public get dataFormat() { + return this.getStringAttribute('data_format'); + } + public set dataFormat(value: string) { + this._dataFormat = value; + } + public resetDataFormat() { + this._dataFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataFormatInput() { + return this._dataFormat; + } + + // data_location - computed: false, optional: false, required: true + private _dataLocation?: string; + public get dataLocation() { + return this.getStringAttribute('data_location'); + } + public set dataLocation(value: string) { + this._dataLocation = value; + } + // Temporarily expose input value. Use with caution. + public get dataLocationInput() { + return this._dataLocation; + } + + // database_name - computed: false, optional: false, required: true + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // date_format - computed: true, optional: true, required: false + private _dateFormat?: string; + public get dateFormat() { + return this.getStringAttribute('date_format'); + } + public set dateFormat(value: string) { + this._dateFormat = value; + } + public resetDateFormat() { + this._dateFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get dateFormatInput() { + return this._dateFormat; + } + + // delimiter - computed: true, optional: true, required: false + private _delimiter?: string; + public get delimiter() { + return this.getStringAttribute('delimiter'); + } + public set delimiter(value: string) { + this._delimiter = value; + } + public resetDelimiter() { + this._delimiter = undefined; + } + // Temporarily expose input value. Use with caution. + public get delimiterInput() { + return this._delimiter; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // escape_char - computed: true, optional: true, required: false + private _escapeChar?: string; + public get escapeChar() { + return this.getStringAttribute('escape_char'); + } + public set escapeChar(value: string) { + this._escapeChar = value; + } + public resetEscapeChar() { + this._escapeChar = undefined; + } + // Temporarily expose input value. Use with caution. + public get escapeCharInput() { + return this._escapeChar; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // quote_char - computed: true, optional: true, required: false + private _quoteChar?: string; + public get quoteChar() { + return this.getStringAttribute('quote_char'); + } + public set quoteChar(value: string) { + this._quoteChar = value; + } + public resetQuoteChar() { + this._quoteChar = undefined; + } + // Temporarily expose input value. Use with caution. + public get quoteCharInput() { + return this._quoteChar; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timestamp_format - computed: true, optional: true, required: false + private _timestampFormat?: string; + public get timestampFormat() { + return this.getStringAttribute('timestamp_format'); + } + public set timestampFormat(value: string) { + this._timestampFormat = value; + } + public resetTimestampFormat() { + this._timestampFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get timestampFormatInput() { + return this._timestampFormat; + } + + // with_column_header - computed: true, optional: true, required: false + private _withColumnHeader?: boolean | cdktf.IResolvable; + public get withColumnHeader() { + return this.getBooleanAttribute('with_column_header'); + } + public set withColumnHeader(value: boolean | cdktf.IResolvable) { + this._withColumnHeader = value; + } + public resetWithColumnHeader() { + this._withColumnHeader = undefined; + } + // Temporarily expose input value. Use with caution. + public get withColumnHeaderInput() { + return this._withColumnHeader; + } + + // columns - computed: false, optional: true, required: false + private _columns = new DliTableColumnsList(this, "columns", false); + public get columns() { + return this._columns; + } + public putColumns(value: DliTableColumns[] | cdktf.IResolvable) { + this._columns.internalValue = value; + } + public resetColumns() { + this._columns.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get columnsInput() { + return this._columns.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DliTableTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DliTableTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_location: cdktf.stringToTerraform(this._bucketLocation), + data_format: cdktf.stringToTerraform(this._dataFormat), + data_location: cdktf.stringToTerraform(this._dataLocation), + database_name: cdktf.stringToTerraform(this._databaseName), + date_format: cdktf.stringToTerraform(this._dateFormat), + delimiter: cdktf.stringToTerraform(this._delimiter), + description: cdktf.stringToTerraform(this._description), + escape_char: cdktf.stringToTerraform(this._escapeChar), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + quote_char: cdktf.stringToTerraform(this._quoteChar), + region: cdktf.stringToTerraform(this._region), + timestamp_format: cdktf.stringToTerraform(this._timestampFormat), + with_column_header: cdktf.booleanToTerraform(this._withColumnHeader), + columns: cdktf.listMapper(dliTableColumnsToTerraform, true)(this._columns.internalValue), + timeouts: dliTableTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_location: { + value: cdktf.stringToHclTerraform(this._bucketLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_format: { + value: cdktf.stringToHclTerraform(this._dataFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_location: { + value: cdktf.stringToHclTerraform(this._dataLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + date_format: { + value: cdktf.stringToHclTerraform(this._dateFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delimiter: { + value: cdktf.stringToHclTerraform(this._delimiter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + escape_char: { + value: cdktf.stringToHclTerraform(this._escapeChar), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quote_char: { + value: cdktf.stringToHclTerraform(this._quoteChar), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timestamp_format: { + value: cdktf.stringToHclTerraform(this._timestampFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + with_column_header: { + value: cdktf.booleanToHclTerraform(this._withColumnHeader), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + columns: { + value: cdktf.listMapperHcl(dliTableColumnsToHclTerraform, true)(this._columns.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliTableColumnsList", + }, + timeouts: { + value: dliTableTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DliTableTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-template-flink/README.md b/src/constructs/providers/huaweicloud/dli-template-flink/README.md new file mode 100644 index 00000000..7222d376 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-template-flink/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_template_flink` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_template_flink`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink). diff --git a/src/constructs/providers/huaweicloud/dli-template-flink/index.ts b/src/constructs/providers/huaweicloud/dli-template-flink/index.ts new file mode 100644 index 00000000..c1b922eb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-template-flink/index.ts @@ -0,0 +1,291 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliTemplateFlinkConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#description DliTemplateFlink#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#id DliTemplateFlink#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#name DliTemplateFlink#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#region DliTemplateFlink#region} + */ + readonly region?: string; + /** + * The statement of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#sql DliTemplateFlink#sql} + */ + readonly sql?: string; + /** + * The key/value pairs to associate with the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#tags DliTemplateFlink#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The type of the flink template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#type DliTemplateFlink#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink huaweicloud_dli_template_flink} +*/ +export class DliTemplateFlink extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_template_flink"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliTemplateFlink resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliTemplateFlink to import + * @param importFromId The id of the existing DliTemplateFlink that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliTemplateFlink to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_template_flink", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_flink huaweicloud_dli_template_flink} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliTemplateFlinkConfig + */ + public constructor(scope: Construct, id: string, config: DliTemplateFlinkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_template_flink', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sql = config.sql; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sql - computed: true, optional: true, required: false + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + public resetSql() { + this._sql = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sql: cdktf.stringToTerraform(this._sql), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-template-spark/README.md b/src/constructs/providers/huaweicloud/dli-template-spark/README.md new file mode 100644 index 00000000..1b72edbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-template-spark/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_template_spark` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_template_spark`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark). diff --git a/src/constructs/providers/huaweicloud/dli-template-spark/index.ts b/src/constructs/providers/huaweicloud/dli-template-spark/index.ts new file mode 100644 index 00000000..7c654584 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-template-spark/index.ts @@ -0,0 +1,1503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliTemplateSparkConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the spark template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#description DliTemplateSpark#description} + */ + readonly description?: string; + /** + * The group of the spark template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#group DliTemplateSpark#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#id DliTemplateSpark#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the spark template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#name DliTemplateSpark#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#region DliTemplateSpark#region} + */ + readonly region?: string; + /** + * body block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#body DliTemplateSpark#body} + */ + readonly body: DliTemplateSparkBody; +} +export interface DliTemplateSparkBodyDependentPackagesResources { + /** + * Resource name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#name DliTemplateSpark#name} + */ + readonly name?: string; + /** + * Resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#type DliTemplateSpark#type} + */ + readonly type?: string; +} + +export function dliTemplateSparkBodyDependentPackagesResourcesToTerraform(struct?: DliTemplateSparkBodyDependentPackagesResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dliTemplateSparkBodyDependentPackagesResourcesToHclTerraform(struct?: DliTemplateSparkBodyDependentPackagesResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliTemplateSparkBodyDependentPackagesResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliTemplateSparkBodyDependentPackagesResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliTemplateSparkBodyDependentPackagesResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DliTemplateSparkBodyDependentPackagesResourcesList extends cdktf.ComplexList { + public internalValue? : DliTemplateSparkBodyDependentPackagesResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliTemplateSparkBodyDependentPackagesResourcesOutputReference { + return new DliTemplateSparkBodyDependentPackagesResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliTemplateSparkBodyDependentPackages { + /** + * User group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#name DliTemplateSpark#name} + */ + readonly name?: string; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#resources DliTemplateSpark#resources} + */ + readonly resources?: DliTemplateSparkBodyDependentPackagesResources[] | cdktf.IResolvable; +} + +export function dliTemplateSparkBodyDependentPackagesToTerraform(struct?: DliTemplateSparkBodyDependentPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + resources: cdktf.listMapper(dliTemplateSparkBodyDependentPackagesResourcesToTerraform, true)(struct!.resources), + } +} + + +export function dliTemplateSparkBodyDependentPackagesToHclTerraform(struct?: DliTemplateSparkBodyDependentPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resources: { + value: cdktf.listMapperHcl(dliTemplateSparkBodyDependentPackagesResourcesToHclTerraform, true)(struct!.resources), + isBlock: true, + type: "list", + storageClassType: "DliTemplateSparkBodyDependentPackagesResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliTemplateSparkBodyDependentPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliTemplateSparkBodyDependentPackages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._resources?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.resources = this._resources?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliTemplateSparkBodyDependentPackages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._resources.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._resources.internalValue = value.resources; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // resources - computed: false, optional: true, required: false + private _resources = new DliTemplateSparkBodyDependentPackagesResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: DliTemplateSparkBodyDependentPackagesResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } +} + +export class DliTemplateSparkBodyDependentPackagesList extends cdktf.ComplexList { + public internalValue? : DliTemplateSparkBodyDependentPackages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliTemplateSparkBodyDependentPackagesOutputReference { + return new DliTemplateSparkBodyDependentPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliTemplateSparkBodyResources { + /** + * Resource name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#name DliTemplateSpark#name} + */ + readonly name?: string; + /** + * Resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#type DliTemplateSpark#type} + */ + readonly type?: string; +} + +export function dliTemplateSparkBodyResourcesToTerraform(struct?: DliTemplateSparkBodyResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dliTemplateSparkBodyResourcesToHclTerraform(struct?: DliTemplateSparkBodyResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliTemplateSparkBodyResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DliTemplateSparkBodyResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliTemplateSparkBodyResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DliTemplateSparkBodyResourcesList extends cdktf.ComplexList { + public internalValue? : DliTemplateSparkBodyResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DliTemplateSparkBodyResourcesOutputReference { + return new DliTemplateSparkBodyResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DliTemplateSparkBody { + /** + * Name of the package that is of the JAR or pyFile type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#app_name DliTemplateSpark#app_name} + */ + readonly appName?: string; + /** + * Input parameters of the main class, that is application parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#app_parameters DliTemplateSpark#app_parameters} + */ + readonly appParameters?: string[]; + /** + * Whether to enable the retry function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#auto_recovery DliTemplateSpark#auto_recovery} + */ + readonly autoRecovery?: boolean | cdktf.IResolvable; + /** + * The configuration items of the DLI spark. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#configurations DliTemplateSpark#configurations} + */ + readonly configurations?: { [key: string]: string }; + /** + * Number of CPU cores of the Spark application driver. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#driver_cores DliTemplateSpark#driver_cores} + */ + readonly driverCores?: number; + /** + * Driver memory of the Spark application, for example, 2 GB and 2048 MB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#driver_memory DliTemplateSpark#driver_memory} + */ + readonly driverMemory?: string; + /** + * Number of CPU cores of each Executor in the Spark application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#executor_cores DliTemplateSpark#executor_cores} + */ + readonly executorCores?: number; + /** + * Executor memory of the Spark application, for example, 2 GB and 2048 MB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#executor_memory DliTemplateSpark#executor_memory} + */ + readonly executorMemory?: string; + /** + * Name of the package that is of the file type and has been uploaded to the DLI resource management system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#files DliTemplateSpark#files} + */ + readonly files?: string[]; + /** + * Name of the package that is of the JAR type and has been uploaded to the DLI resource management system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#jars DliTemplateSpark#jars} + */ + readonly jars?: string[]; + /** + * Java/Spark main class of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#main_class DliTemplateSpark#main_class} + */ + readonly mainClass?: string; + /** + * Maximum retry times. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#max_retry_times DliTemplateSpark#max_retry_times} + */ + readonly maxRetryTimes?: number; + /** + * Name of the dependent system resource module. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#modules DliTemplateSpark#modules} + */ + readonly modules?: string[]; + /** + * The spark job name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#name DliTemplateSpark#name} + */ + readonly name?: string; + /** + * Number of Executors in a Spark application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#num_executors DliTemplateSpark#num_executors} + */ + readonly numExecutors?: number; + /** + * OBS bucket for storing the Spark jobs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#obs_bucket DliTemplateSpark#obs_bucket} + */ + readonly obsBucket?: string; + /** + * Name of the package that is of the PyFile type and has been uploaded to the DLI resource management system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#python_files DliTemplateSpark#python_files} + */ + readonly pythonFiles?: string[]; + /** + * The DLI queue name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#queue_name DliTemplateSpark#queue_name} + */ + readonly queueName?: string; + /** + * Compute resource type. Currently, resource types A, B, and C are available. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#specification DliTemplateSpark#specification} + */ + readonly specification?: string; + /** + * dependent_packages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#dependent_packages DliTemplateSpark#dependent_packages} + */ + readonly dependentPackages?: DliTemplateSparkBodyDependentPackages[] | cdktf.IResolvable; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#resources DliTemplateSpark#resources} + */ + readonly resources?: DliTemplateSparkBodyResources[] | cdktf.IResolvable; +} + +export function dliTemplateSparkBodyToTerraform(struct?: DliTemplateSparkBodyOutputReference | DliTemplateSparkBody): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + app_name: cdktf.stringToTerraform(struct!.appName), + app_parameters: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.appParameters), + auto_recovery: cdktf.booleanToTerraform(struct!.autoRecovery), + configurations: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.configurations), + driver_cores: cdktf.numberToTerraform(struct!.driverCores), + driver_memory: cdktf.stringToTerraform(struct!.driverMemory), + executor_cores: cdktf.numberToTerraform(struct!.executorCores), + executor_memory: cdktf.stringToTerraform(struct!.executorMemory), + files: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.files), + jars: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.jars), + main_class: cdktf.stringToTerraform(struct!.mainClass), + max_retry_times: cdktf.numberToTerraform(struct!.maxRetryTimes), + modules: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.modules), + name: cdktf.stringToTerraform(struct!.name), + num_executors: cdktf.numberToTerraform(struct!.numExecutors), + obs_bucket: cdktf.stringToTerraform(struct!.obsBucket), + python_files: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.pythonFiles), + queue_name: cdktf.stringToTerraform(struct!.queueName), + specification: cdktf.stringToTerraform(struct!.specification), + dependent_packages: cdktf.listMapper(dliTemplateSparkBodyDependentPackagesToTerraform, true)(struct!.dependentPackages), + resources: cdktf.listMapper(dliTemplateSparkBodyResourcesToTerraform, true)(struct!.resources), + } +} + + +export function dliTemplateSparkBodyToHclTerraform(struct?: DliTemplateSparkBodyOutputReference | DliTemplateSparkBody): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + app_name: { + value: cdktf.stringToHclTerraform(struct!.appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_parameters: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.appParameters), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + auto_recovery: { + value: cdktf.booleanToHclTerraform(struct!.autoRecovery), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + configurations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.configurations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + driver_cores: { + value: cdktf.numberToHclTerraform(struct!.driverCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + driver_memory: { + value: cdktf.stringToHclTerraform(struct!.driverMemory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + executor_cores: { + value: cdktf.numberToHclTerraform(struct!.executorCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + executor_memory: { + value: cdktf.stringToHclTerraform(struct!.executorMemory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.files), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + jars: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.jars), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + main_class: { + value: cdktf.stringToHclTerraform(struct!.mainClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retry_times: { + value: cdktf.numberToHclTerraform(struct!.maxRetryTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + modules: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.modules), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + num_executors: { + value: cdktf.numberToHclTerraform(struct!.numExecutors), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + obs_bucket: { + value: cdktf.stringToHclTerraform(struct!.obsBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + python_files: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.pythonFiles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + queue_name: { + value: cdktf.stringToHclTerraform(struct!.queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specification: { + value: cdktf.stringToHclTerraform(struct!.specification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dependent_packages: { + value: cdktf.listMapperHcl(dliTemplateSparkBodyDependentPackagesToHclTerraform, true)(struct!.dependentPackages), + isBlock: true, + type: "list", + storageClassType: "DliTemplateSparkBodyDependentPackagesList", + }, + resources: { + value: cdktf.listMapperHcl(dliTemplateSparkBodyResourcesToHclTerraform, true)(struct!.resources), + isBlock: true, + type: "list", + storageClassType: "DliTemplateSparkBodyResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DliTemplateSparkBodyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DliTemplateSparkBody | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._appName !== undefined) { + hasAnyValues = true; + internalValueResult.appName = this._appName; + } + if (this._appParameters !== undefined) { + hasAnyValues = true; + internalValueResult.appParameters = this._appParameters; + } + if (this._autoRecovery !== undefined) { + hasAnyValues = true; + internalValueResult.autoRecovery = this._autoRecovery; + } + if (this._configurations !== undefined) { + hasAnyValues = true; + internalValueResult.configurations = this._configurations; + } + if (this._driverCores !== undefined) { + hasAnyValues = true; + internalValueResult.driverCores = this._driverCores; + } + if (this._driverMemory !== undefined) { + hasAnyValues = true; + internalValueResult.driverMemory = this._driverMemory; + } + if (this._executorCores !== undefined) { + hasAnyValues = true; + internalValueResult.executorCores = this._executorCores; + } + if (this._executorMemory !== undefined) { + hasAnyValues = true; + internalValueResult.executorMemory = this._executorMemory; + } + if (this._files !== undefined) { + hasAnyValues = true; + internalValueResult.files = this._files; + } + if (this._jars !== undefined) { + hasAnyValues = true; + internalValueResult.jars = this._jars; + } + if (this._mainClass !== undefined) { + hasAnyValues = true; + internalValueResult.mainClass = this._mainClass; + } + if (this._maxRetryTimes !== undefined) { + hasAnyValues = true; + internalValueResult.maxRetryTimes = this._maxRetryTimes; + } + if (this._modules !== undefined) { + hasAnyValues = true; + internalValueResult.modules = this._modules; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._numExecutors !== undefined) { + hasAnyValues = true; + internalValueResult.numExecutors = this._numExecutors; + } + if (this._obsBucket !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucket = this._obsBucket; + } + if (this._pythonFiles !== undefined) { + hasAnyValues = true; + internalValueResult.pythonFiles = this._pythonFiles; + } + if (this._queueName !== undefined) { + hasAnyValues = true; + internalValueResult.queueName = this._queueName; + } + if (this._specification !== undefined) { + hasAnyValues = true; + internalValueResult.specification = this._specification; + } + if (this._dependentPackages?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dependentPackages = this._dependentPackages?.internalValue; + } + if (this._resources?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.resources = this._resources?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DliTemplateSparkBody | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._appName = undefined; + this._appParameters = undefined; + this._autoRecovery = undefined; + this._configurations = undefined; + this._driverCores = undefined; + this._driverMemory = undefined; + this._executorCores = undefined; + this._executorMemory = undefined; + this._files = undefined; + this._jars = undefined; + this._mainClass = undefined; + this._maxRetryTimes = undefined; + this._modules = undefined; + this._name = undefined; + this._numExecutors = undefined; + this._obsBucket = undefined; + this._pythonFiles = undefined; + this._queueName = undefined; + this._specification = undefined; + this._dependentPackages.internalValue = undefined; + this._resources.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._appName = value.appName; + this._appParameters = value.appParameters; + this._autoRecovery = value.autoRecovery; + this._configurations = value.configurations; + this._driverCores = value.driverCores; + this._driverMemory = value.driverMemory; + this._executorCores = value.executorCores; + this._executorMemory = value.executorMemory; + this._files = value.files; + this._jars = value.jars; + this._mainClass = value.mainClass; + this._maxRetryTimes = value.maxRetryTimes; + this._modules = value.modules; + this._name = value.name; + this._numExecutors = value.numExecutors; + this._obsBucket = value.obsBucket; + this._pythonFiles = value.pythonFiles; + this._queueName = value.queueName; + this._specification = value.specification; + this._dependentPackages.internalValue = value.dependentPackages; + this._resources.internalValue = value.resources; + } + } + + // app_name - computed: true, optional: true, required: false + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + public resetAppName() { + this._appName = undefined; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // app_parameters - computed: true, optional: true, required: false + private _appParameters?: string[]; + public get appParameters() { + return this.getListAttribute('app_parameters'); + } + public set appParameters(value: string[]) { + this._appParameters = value; + } + public resetAppParameters() { + this._appParameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get appParametersInput() { + return this._appParameters; + } + + // auto_recovery - computed: true, optional: true, required: false + private _autoRecovery?: boolean | cdktf.IResolvable; + public get autoRecovery() { + return this.getBooleanAttribute('auto_recovery'); + } + public set autoRecovery(value: boolean | cdktf.IResolvable) { + this._autoRecovery = value; + } + public resetAutoRecovery() { + this._autoRecovery = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRecoveryInput() { + return this._autoRecovery; + } + + // configurations - computed: true, optional: true, required: false + private _configurations?: { [key: string]: string }; + public get configurations() { + return this.getStringMapAttribute('configurations'); + } + public set configurations(value: { [key: string]: string }) { + this._configurations = value; + } + public resetConfigurations() { + this._configurations = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations; + } + + // driver_cores - computed: true, optional: true, required: false + private _driverCores?: number; + public get driverCores() { + return this.getNumberAttribute('driver_cores'); + } + public set driverCores(value: number) { + this._driverCores = value; + } + public resetDriverCores() { + this._driverCores = undefined; + } + // Temporarily expose input value. Use with caution. + public get driverCoresInput() { + return this._driverCores; + } + + // driver_memory - computed: true, optional: true, required: false + private _driverMemory?: string; + public get driverMemory() { + return this.getStringAttribute('driver_memory'); + } + public set driverMemory(value: string) { + this._driverMemory = value; + } + public resetDriverMemory() { + this._driverMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get driverMemoryInput() { + return this._driverMemory; + } + + // executor_cores - computed: true, optional: true, required: false + private _executorCores?: number; + public get executorCores() { + return this.getNumberAttribute('executor_cores'); + } + public set executorCores(value: number) { + this._executorCores = value; + } + public resetExecutorCores() { + this._executorCores = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorCoresInput() { + return this._executorCores; + } + + // executor_memory - computed: true, optional: true, required: false + private _executorMemory?: string; + public get executorMemory() { + return this.getStringAttribute('executor_memory'); + } + public set executorMemory(value: string) { + this._executorMemory = value; + } + public resetExecutorMemory() { + this._executorMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get executorMemoryInput() { + return this._executorMemory; + } + + // files - computed: true, optional: true, required: false + private _files?: string[]; + public get files() { + return this.getListAttribute('files'); + } + public set files(value: string[]) { + this._files = value; + } + public resetFiles() { + this._files = undefined; + } + // Temporarily expose input value. Use with caution. + public get filesInput() { + return this._files; + } + + // jars - computed: true, optional: true, required: false + private _jars?: string[]; + public get jars() { + return this.getListAttribute('jars'); + } + public set jars(value: string[]) { + this._jars = value; + } + public resetJars() { + this._jars = undefined; + } + // Temporarily expose input value. Use with caution. + public get jarsInput() { + return this._jars; + } + + // main_class - computed: true, optional: true, required: false + private _mainClass?: string; + public get mainClass() { + return this.getStringAttribute('main_class'); + } + public set mainClass(value: string) { + this._mainClass = value; + } + public resetMainClass() { + this._mainClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get mainClassInput() { + return this._mainClass; + } + + // max_retry_times - computed: true, optional: true, required: false + private _maxRetryTimes?: number; + public get maxRetryTimes() { + return this.getNumberAttribute('max_retry_times'); + } + public set maxRetryTimes(value: number) { + this._maxRetryTimes = value; + } + public resetMaxRetryTimes() { + this._maxRetryTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetryTimesInput() { + return this._maxRetryTimes; + } + + // modules - computed: true, optional: true, required: false + private _modules?: string[]; + public get modules() { + return this.getListAttribute('modules'); + } + public set modules(value: string[]) { + this._modules = value; + } + public resetModules() { + this._modules = undefined; + } + // Temporarily expose input value. Use with caution. + public get modulesInput() { + return this._modules; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // num_executors - computed: true, optional: true, required: false + private _numExecutors?: number; + public get numExecutors() { + return this.getNumberAttribute('num_executors'); + } + public set numExecutors(value: number) { + this._numExecutors = value; + } + public resetNumExecutors() { + this._numExecutors = undefined; + } + // Temporarily expose input value. Use with caution. + public get numExecutorsInput() { + return this._numExecutors; + } + + // obs_bucket - computed: true, optional: true, required: false + private _obsBucket?: string; + public get obsBucket() { + return this.getStringAttribute('obs_bucket'); + } + public set obsBucket(value: string) { + this._obsBucket = value; + } + public resetObsBucket() { + this._obsBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketInput() { + return this._obsBucket; + } + + // python_files - computed: true, optional: true, required: false + private _pythonFiles?: string[]; + public get pythonFiles() { + return this.getListAttribute('python_files'); + } + public set pythonFiles(value: string[]) { + this._pythonFiles = value; + } + public resetPythonFiles() { + this._pythonFiles = undefined; + } + // Temporarily expose input value. Use with caution. + public get pythonFilesInput() { + return this._pythonFiles; + } + + // queue_name - computed: true, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // specification - computed: true, optional: true, required: false + private _specification?: string; + public get specification() { + return this.getStringAttribute('specification'); + } + public set specification(value: string) { + this._specification = value; + } + public resetSpecification() { + this._specification = undefined; + } + // Temporarily expose input value. Use with caution. + public get specificationInput() { + return this._specification; + } + + // dependent_packages - computed: false, optional: true, required: false + private _dependentPackages = new DliTemplateSparkBodyDependentPackagesList(this, "dependent_packages", false); + public get dependentPackages() { + return this._dependentPackages; + } + public putDependentPackages(value: DliTemplateSparkBodyDependentPackages[] | cdktf.IResolvable) { + this._dependentPackages.internalValue = value; + } + public resetDependentPackages() { + this._dependentPackages.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependentPackagesInput() { + return this._dependentPackages.internalValue; + } + + // resources - computed: false, optional: true, required: false + private _resources = new DliTemplateSparkBodyResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: DliTemplateSparkBodyResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + public resetResources() { + this._resources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark huaweicloud_dli_template_spark} +*/ +export class DliTemplateSpark extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_template_spark"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliTemplateSpark resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliTemplateSpark to import + * @param importFromId The id of the existing DliTemplateSpark that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliTemplateSpark to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_template_spark", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_spark huaweicloud_dli_template_spark} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliTemplateSparkConfig + */ + public constructor(scope: Construct, id: string, config: DliTemplateSparkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_template_spark', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._group = config.group; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._body.internalValue = config.body; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group - computed: true, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // body - computed: false, optional: false, required: true + private _body = new DliTemplateSparkBodyOutputReference(this, "body"); + public get body() { + return this._body; + } + public putBody(value: DliTemplateSparkBody) { + this._body.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bodyInput() { + return this._body.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + body: dliTemplateSparkBodyToTerraform(this._body.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + body: { + value: dliTemplateSparkBodyToHclTerraform(this._body.internalValue), + isBlock: true, + type: "list", + storageClassType: "DliTemplateSparkBodyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dli-template-sql/README.md b/src/constructs/providers/huaweicloud/dli-template-sql/README.md new file mode 100644 index 00000000..293215a4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-template-sql/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dli_template_sql` + +Refer to the Terraform Registry for docs: [`huaweicloud_dli_template_sql`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql). diff --git a/src/constructs/providers/huaweicloud/dli-template-sql/index.ts b/src/constructs/providers/huaweicloud/dli-template-sql/index.ts new file mode 100644 index 00000000..bbf73461 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dli-template-sql/index.ts @@ -0,0 +1,263 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DliTemplateSqlConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#description DliTemplateSql#description} + */ + readonly description?: string; + /** + * The group of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#group DliTemplateSql#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#id DliTemplateSql#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#name DliTemplateSql#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#region DliTemplateSql#region} + */ + readonly region?: string; + /** + * The statement of the SQL template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#sql DliTemplateSql#sql} + */ + readonly sql: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql huaweicloud_dli_template_sql} +*/ +export class DliTemplateSql extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dli_template_sql"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DliTemplateSql resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DliTemplateSql to import + * @param importFromId The id of the existing DliTemplateSql that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DliTemplateSql to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dli_template_sql", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dli_template_sql huaweicloud_dli_template_sql} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DliTemplateSqlConfig + */ + public constructor(scope: Construct, id: string, config: DliTemplateSqlConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dli_template_sql', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._group = config.group; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sql = config.sql; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group - computed: true, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sql - computed: false, optional: false, required: true + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sql: cdktf.stringToTerraform(this._sql), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-group-v1/README.md b/src/constructs/providers/huaweicloud/dms-group-v1/README.md new file mode 100644 index 00000000..3377c1f1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-group-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_group_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_group_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1). diff --git a/src/constructs/providers/huaweicloud/dms-group-v1/index.ts b/src/constructs/providers/huaweicloud/dms-group-v1/index.ts new file mode 100644 index 00000000..7f70442e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-group-v1/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsGroupV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1#id DmsGroupV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1#name DmsGroupV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1#queue_id DmsGroupV1#queue_id} + */ + readonly queueId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1#region DmsGroupV1#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1 huaweicloud_dms_group_v1} +*/ +export class DmsGroupV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_group_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsGroupV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsGroupV1 to import + * @param importFromId The id of the existing DmsGroupV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsGroupV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_group_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group_v1 huaweicloud_dms_group_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsGroupV1Config + */ + public constructor(scope: Construct, id: string, config: DmsGroupV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_group_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._queueId = config.queueId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // available_deadletters - computed: true, optional: false, required: false + public get availableDeadletters() { + return this.getNumberAttribute('available_deadletters'); + } + + // available_messages - computed: true, optional: false, required: false + public get availableMessages() { + return this.getNumberAttribute('available_messages'); + } + + // consumed_messages - computed: true, optional: false, required: false + public get consumedMessages() { + return this.getNumberAttribute('consumed_messages'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // produced_deadletters - computed: true, optional: false, required: false + public get producedDeadletters() { + return this.getNumberAttribute('produced_deadletters'); + } + + // produced_messages - computed: true, optional: false, required: false + public get producedMessages() { + return this.getNumberAttribute('produced_messages'); + } + + // queue_id - computed: false, optional: false, required: true + private _queueId?: string; + public get queueId() { + return this.getStringAttribute('queue_id'); + } + public set queueId(value: string) { + this._queueId = value; + } + // Temporarily expose input value. Use with caution. + public get queueIdInput() { + return this._queueId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + queue_id: cdktf.stringToTerraform(this._queueId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_id: { + value: cdktf.stringToHclTerraform(this._queueId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-group/README.md b/src/constructs/providers/huaweicloud/dms-group/README.md new file mode 100644 index 00000000..ebb35eec --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group). diff --git a/src/constructs/providers/huaweicloud/dms-group/index.ts b/src/constructs/providers/huaweicloud/dms-group/index.ts new file mode 100644 index 00000000..0243f721 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-group/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group#id DmsGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group#name DmsGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group#queue_id DmsGroup#queue_id} + */ + readonly queueId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group#region DmsGroup#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group huaweicloud_dms_group} +*/ +export class DmsGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsGroup to import + * @param importFromId The id of the existing DmsGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_group huaweicloud_dms_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsGroupConfig + */ + public constructor(scope: Construct, id: string, config: DmsGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._queueId = config.queueId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // available_deadletters - computed: true, optional: false, required: false + public get availableDeadletters() { + return this.getNumberAttribute('available_deadletters'); + } + + // available_messages - computed: true, optional: false, required: false + public get availableMessages() { + return this.getNumberAttribute('available_messages'); + } + + // consumed_messages - computed: true, optional: false, required: false + public get consumedMessages() { + return this.getNumberAttribute('consumed_messages'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // produced_deadletters - computed: true, optional: false, required: false + public get producedDeadletters() { + return this.getNumberAttribute('produced_deadletters'); + } + + // produced_messages - computed: true, optional: false, required: false + public get producedMessages() { + return this.getNumberAttribute('produced_messages'); + } + + // queue_id - computed: false, optional: false, required: true + private _queueId?: string; + public get queueId() { + return this.getStringAttribute('queue_id'); + } + public set queueId(value: string) { + this._queueId = value; + } + // Temporarily expose input value. Use with caution. + public get queueIdInput() { + return this._queueId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + queue_id: cdktf.stringToTerraform(this._queueId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_id: { + value: cdktf.stringToHclTerraform(this._queueId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-instance-v1/README.md b/src/constructs/providers/huaweicloud/dms-instance-v1/README.md new file mode 100644 index 00000000..e99688a3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-instance-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_instance_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_instance_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1). diff --git a/src/constructs/providers/huaweicloud/dms-instance-v1/index.ts b/src/constructs/providers/huaweicloud/dms-instance-v1/index.ts new file mode 100644 index 00000000..d0215b9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-instance-v1/index.ts @@ -0,0 +1,681 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsInstanceV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#access_user DmsInstanceV1#access_user} + */ + readonly accessUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#available_zones DmsInstanceV1#available_zones} + */ + readonly availableZones: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#description DmsInstanceV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#engine DmsInstanceV1#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#engine_version DmsInstanceV1#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#id DmsInstanceV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#maintain_begin DmsInstanceV1#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#maintain_end DmsInstanceV1#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#name DmsInstanceV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#partition_num DmsInstanceV1#partition_num} + */ + readonly partitionNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#password DmsInstanceV1#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#product_id DmsInstanceV1#product_id} + */ + readonly productId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#region DmsInstanceV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#security_group_id DmsInstanceV1#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#specification DmsInstanceV1#specification} + */ + readonly specification?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#storage_space DmsInstanceV1#storage_space} + */ + readonly storageSpace: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#storage_spec_code DmsInstanceV1#storage_spec_code} + */ + readonly storageSpecCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#subnet_id DmsInstanceV1#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#tags DmsInstanceV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#vpc_id DmsInstanceV1#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1 huaweicloud_dms_instance_v1} +*/ +export class DmsInstanceV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_instance_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsInstanceV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsInstanceV1 to import + * @param importFromId The id of the existing DmsInstanceV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsInstanceV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_instance_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance_v1 huaweicloud_dms_instance_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsInstanceV1Config + */ + public constructor(scope: Construct, id: string, config: DmsInstanceV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_instance_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessUser = config.accessUser; + this._availableZones = config.availableZones; + this._description = config.description; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._partitionNum = config.partitionNum; + this._password = config.password; + this._productId = config.productId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._specification = config.specification; + this._storageSpace = config.storageSpace; + this._storageSpecCode = config.storageSpecCode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_user - computed: false, optional: true, required: false + private _accessUser?: string; + public get accessUser() { + return this.getStringAttribute('access_user'); + } + public set accessUser(value: string) { + this._accessUser = value; + } + public resetAccessUser() { + this._accessUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessUserInput() { + return this._accessUser; + } + + // available_zones - computed: false, optional: false, required: true + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // connect_address - computed: true, optional: false, required: false + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // partition_num - computed: false, optional: true, required: false + private _partitionNum?: number; + public get partitionNum() { + return this.getNumberAttribute('partition_num'); + } + public set partitionNum(value: number) { + this._partitionNum = value; + } + public resetPartitionNum() { + this._partitionNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionNumInput() { + return this._partitionNum; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // product_id - computed: false, optional: false, required: true + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_group_name - computed: true, optional: false, required: false + public get securityGroupName() { + return this.getStringAttribute('security_group_name'); + } + + // specification - computed: true, optional: true, required: false + private _specification?: string; + public get specification() { + return this.getStringAttribute('specification'); + } + public set specification(value: string) { + this._specification = value; + } + public resetSpecification() { + this._specification = undefined; + } + // Temporarily expose input value. Use with caution. + public get specificationInput() { + return this._specification; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_space - computed: false, optional: false, required: true + private _storageSpace?: number; + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + public set storageSpace(value: number) { + this._storageSpace = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpaceInput() { + return this._storageSpace; + } + + // storage_spec_code - computed: false, optional: false, required: true + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // subnet_name - computed: true, optional: false, required: false + public get subnetName() { + return this.getStringAttribute('subnet_name'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_user: cdktf.stringToTerraform(this._accessUser), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + description: cdktf.stringToTerraform(this._description), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + partition_num: cdktf.numberToTerraform(this._partitionNum), + password: cdktf.stringToTerraform(this._password), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + specification: cdktf.stringToTerraform(this._specification), + storage_space: cdktf.numberToTerraform(this._storageSpace), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_user: { + value: cdktf.stringToHclTerraform(this._accessUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_num: { + value: cdktf.numberToHclTerraform(this._partitionNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specification: { + value: cdktf.stringToHclTerraform(this._specification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_space: { + value: cdktf.numberToHclTerraform(this._storageSpace), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-instance/README.md b/src/constructs/providers/huaweicloud/dms-instance/README.md new file mode 100644 index 00000000..a96a7144 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance). diff --git a/src/constructs/providers/huaweicloud/dms-instance/index.ts b/src/constructs/providers/huaweicloud/dms-instance/index.ts new file mode 100644 index 00000000..fe76de48 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-instance/index.ts @@ -0,0 +1,681 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#access_user DmsInstance#access_user} + */ + readonly accessUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#available_zones DmsInstance#available_zones} + */ + readonly availableZones: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#description DmsInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#engine DmsInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#engine_version DmsInstance#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#id DmsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#maintain_begin DmsInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#maintain_end DmsInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#name DmsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#partition_num DmsInstance#partition_num} + */ + readonly partitionNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#password DmsInstance#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#product_id DmsInstance#product_id} + */ + readonly productId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#region DmsInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#security_group_id DmsInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#specification DmsInstance#specification} + */ + readonly specification?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#storage_space DmsInstance#storage_space} + */ + readonly storageSpace: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#storage_spec_code DmsInstance#storage_spec_code} + */ + readonly storageSpecCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#subnet_id DmsInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#tags DmsInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#vpc_id DmsInstance#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance huaweicloud_dms_instance} +*/ +export class DmsInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsInstance to import + * @param importFromId The id of the existing DmsInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_instance huaweicloud_dms_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DmsInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessUser = config.accessUser; + this._availableZones = config.availableZones; + this._description = config.description; + this._engine = config.engine; + this._engineVersion = config.engineVersion; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._partitionNum = config.partitionNum; + this._password = config.password; + this._productId = config.productId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._specification = config.specification; + this._storageSpace = config.storageSpace; + this._storageSpecCode = config.storageSpecCode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_user - computed: false, optional: true, required: false + private _accessUser?: string; + public get accessUser() { + return this.getStringAttribute('access_user'); + } + public set accessUser(value: string) { + this._accessUser = value; + } + public resetAccessUser() { + this._accessUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessUserInput() { + return this._accessUser; + } + + // available_zones - computed: false, optional: false, required: true + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // connect_address - computed: true, optional: false, required: false + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // partition_num - computed: false, optional: true, required: false + private _partitionNum?: number; + public get partitionNum() { + return this.getNumberAttribute('partition_num'); + } + public set partitionNum(value: number) { + this._partitionNum = value; + } + public resetPartitionNum() { + this._partitionNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionNumInput() { + return this._partitionNum; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } + + // product_id - computed: false, optional: false, required: true + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_group_name - computed: true, optional: false, required: false + public get securityGroupName() { + return this.getStringAttribute('security_group_name'); + } + + // specification - computed: true, optional: true, required: false + private _specification?: string; + public get specification() { + return this.getStringAttribute('specification'); + } + public set specification(value: string) { + this._specification = value; + } + public resetSpecification() { + this._specification = undefined; + } + // Temporarily expose input value. Use with caution. + public get specificationInput() { + return this._specification; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_space - computed: false, optional: false, required: true + private _storageSpace?: number; + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + public set storageSpace(value: number) { + this._storageSpace = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpaceInput() { + return this._storageSpace; + } + + // storage_spec_code - computed: false, optional: false, required: true + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // subnet_name - computed: true, optional: false, required: false + public get subnetName() { + return this.getStringAttribute('subnet_name'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_user: cdktf.stringToTerraform(this._accessUser), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + description: cdktf.stringToTerraform(this._description), + engine: cdktf.stringToTerraform(this._engine), + engine_version: cdktf.stringToTerraform(this._engineVersion), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + partition_num: cdktf.numberToTerraform(this._partitionNum), + password: cdktf.stringToTerraform(this._password), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + specification: cdktf.stringToTerraform(this._specification), + storage_space: cdktf.numberToTerraform(this._storageSpace), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_user: { + value: cdktf.stringToHclTerraform(this._accessUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_num: { + value: cdktf.numberToHclTerraform(this._partitionNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specification: { + value: cdktf.stringToHclTerraform(this._specification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_space: { + value: cdktf.numberToHclTerraform(this._storageSpace), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/README.md b/src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/README.md new file mode 100644 index 00000000..fe433e35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_background_task_delete` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_background_task_delete`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/index.ts new file mode 100644 index 00000000..059f84cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-background-task-delete/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaBackgroundTaskDeleteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete#id DmsKafkaBackgroundTaskDelete#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete#instance_id DmsKafkaBackgroundTaskDelete#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete#region DmsKafkaBackgroundTaskDelete#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete#task_id DmsKafkaBackgroundTaskDelete#task_id} + */ + readonly taskId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete huaweicloud_dms_kafka_background_task_delete} +*/ +export class DmsKafkaBackgroundTaskDelete extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_background_task_delete"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaBackgroundTaskDelete resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaBackgroundTaskDelete to import + * @param importFromId The id of the existing DmsKafkaBackgroundTaskDelete that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaBackgroundTaskDelete to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_background_task_delete", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_background_task_delete huaweicloud_dms_kafka_background_task_delete} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaBackgroundTaskDeleteConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaBackgroundTaskDeleteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_background_task_delete', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._taskId = config.taskId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // task_id - computed: false, optional: false, required: true + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + task_id: cdktf.stringToTerraform(this._taskId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-consumer-group/README.md b/src/constructs/providers/huaweicloud/dms-kafka-consumer-group/README.md new file mode 100644 index 00000000..7b3759e0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-consumer-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_consumer_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_consumer_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-consumer-group/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-consumer-group/index.ts new file mode 100644 index 00000000..953bc0bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-consumer-group/index.ts @@ -0,0 +1,248 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaConsumerGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group#description DmsKafkaConsumerGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group#id DmsKafkaConsumerGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the Kafka instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group#instance_id DmsKafkaConsumerGroup#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group#name DmsKafkaConsumerGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group#region DmsKafkaConsumerGroup#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group huaweicloud_dms_kafka_consumer_group} +*/ +export class DmsKafkaConsumerGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_consumer_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaConsumerGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaConsumerGroup to import + * @param importFromId The id of the existing DmsKafkaConsumerGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaConsumerGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_consumer_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_consumer_group huaweicloud_dms_kafka_consumer_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaConsumerGroupConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaConsumerGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_consumer_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // coordinator_id - computed: true, optional: false, required: false + public get coordinatorId() { + return this.getNumberAttribute('coordinator_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lag - computed: true, optional: false, required: false + public get lag() { + return this.getNumberAttribute('lag'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-instance-restart/README.md b/src/constructs/providers/huaweicloud/dms-kafka-instance-restart/README.md new file mode 100644 index 00000000..f9ddf25b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-instance-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_instance_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_instance_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-instance-restart/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-instance-restart/index.ts new file mode 100644 index 00000000..122cb833 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-instance-restart/index.ts @@ -0,0 +1,295 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaInstanceRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart#id DmsKafkaInstanceRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the Kafka instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart#instance_id DmsKafkaInstanceRestart#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart#region DmsKafkaInstanceRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart#timeouts DmsKafkaInstanceRestart#timeouts} + */ + readonly timeouts?: DmsKafkaInstanceRestartTimeouts; +} +export interface DmsKafkaInstanceRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart#create DmsKafkaInstanceRestart#create} + */ + readonly create?: string; +} + +export function dmsKafkaInstanceRestartTimeoutsToTerraform(struct?: DmsKafkaInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dmsKafkaInstanceRestartTimeoutsToHclTerraform(struct?: DmsKafkaInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaInstanceRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaInstanceRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaInstanceRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart huaweicloud_dms_kafka_instance_restart} +*/ +export class DmsKafkaInstanceRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_instance_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaInstanceRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaInstanceRestart to import + * @param importFromId The id of the existing DmsKafkaInstanceRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaInstanceRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_instance_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance_restart huaweicloud_dms_kafka_instance_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaInstanceRestartConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaInstanceRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_instance_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaInstanceRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaInstanceRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: dmsKafkaInstanceRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsKafkaInstanceRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaInstanceRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-instance/README.md b/src/constructs/providers/huaweicloud/dms-kafka-instance/README.md new file mode 100644 index 00000000..80bec3a1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-instance/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-instance/index.ts new file mode 100644 index 00000000..260ee081 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-instance/index.ts @@ -0,0 +1,1833 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#access_user DmsKafkaInstance#access_user} + */ + readonly accessUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#arch_type DmsKafkaInstance#arch_type} + */ + readonly archType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#auto_renew DmsKafkaInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#availability_zones DmsKafkaInstance#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#available_zones DmsKafkaInstance#available_zones} + */ + readonly availableZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#bandwidth DmsKafkaInstance#bandwidth} + */ + readonly bandwidth?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#broker_num DmsKafkaInstance#broker_num} + */ + readonly brokerNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#charging_mode DmsKafkaInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#description DmsKafkaInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#dumping DmsKafkaInstance#dumping} + */ + readonly dumping?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#enable_auto_topic DmsKafkaInstance#enable_auto_topic} + */ + readonly enableAutoTopic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#enabled_mechanisms DmsKafkaInstance#enabled_mechanisms} + */ + readonly enabledMechanisms?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#engine_version DmsKafkaInstance#engine_version} + */ + readonly engineVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#enterprise_project_id DmsKafkaInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#flavor_id DmsKafkaInstance#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#id DmsKafkaInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#ipv6_enable DmsKafkaInstance#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#maintain_begin DmsKafkaInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#maintain_end DmsKafkaInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#manager_password DmsKafkaInstance#manager_password} + */ + readonly managerPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#manager_user DmsKafkaInstance#manager_user} + */ + readonly managerUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#name DmsKafkaInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#network_id DmsKafkaInstance#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#new_tenant_ips DmsKafkaInstance#new_tenant_ips} + */ + readonly newTenantIps?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#password DmsKafkaInstance#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#period DmsKafkaInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#period_unit DmsKafkaInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#product_id DmsKafkaInstance#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#public_ip_ids DmsKafkaInstance#public_ip_ids} + */ + readonly publicIpIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#region DmsKafkaInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#retention_policy DmsKafkaInstance#retention_policy} + */ + readonly retentionPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#security_group_id DmsKafkaInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#security_protocol DmsKafkaInstance#security_protocol} + */ + readonly securityProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#ssl_enable DmsKafkaInstance#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#storage_space DmsKafkaInstance#storage_space} + */ + readonly storageSpace?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#storage_spec_code DmsKafkaInstance#storage_spec_code} + */ + readonly storageSpecCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#tags DmsKafkaInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#vpc_client_plain DmsKafkaInstance#vpc_client_plain} + */ + readonly vpcClientPlain?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#vpc_id DmsKafkaInstance#vpc_id} + */ + readonly vpcId: string; + /** + * cross_vpc_accesses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#cross_vpc_accesses DmsKafkaInstance#cross_vpc_accesses} + */ + readonly crossVpcAccesses?: DmsKafkaInstanceCrossVpcAccesses[] | cdktf.IResolvable; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#parameters DmsKafkaInstance#parameters} + */ + readonly parameters?: DmsKafkaInstanceParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#timeouts DmsKafkaInstance#timeouts} + */ + readonly timeouts?: DmsKafkaInstanceTimeouts; +} +export interface DmsKafkaInstanceCrossVpcAccesses { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#advertised_ip DmsKafkaInstance#advertised_ip} + */ + readonly advertisedIp?: string; +} + +export function dmsKafkaInstanceCrossVpcAccessesToTerraform(struct?: DmsKafkaInstanceCrossVpcAccesses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + advertised_ip: cdktf.stringToTerraform(struct!.advertisedIp), + } +} + + +export function dmsKafkaInstanceCrossVpcAccessesToHclTerraform(struct?: DmsKafkaInstanceCrossVpcAccesses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + advertised_ip: { + value: cdktf.stringToHclTerraform(struct!.advertisedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaInstanceCrossVpcAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaInstanceCrossVpcAccesses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._advertisedIp !== undefined) { + hasAnyValues = true; + internalValueResult.advertisedIp = this._advertisedIp; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaInstanceCrossVpcAccesses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._advertisedIp = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._advertisedIp = value.advertisedIp; + } + } + + // advertised_ip - computed: true, optional: true, required: false + private _advertisedIp?: string; + public get advertisedIp() { + return this.getStringAttribute('advertised_ip'); + } + public set advertisedIp(value: string) { + this._advertisedIp = value; + } + public resetAdvertisedIp() { + this._advertisedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get advertisedIpInput() { + return this._advertisedIp; + } + + // lisenter_ip - computed: true, optional: false, required: false + public get lisenterIp() { + return this.getStringAttribute('lisenter_ip'); + } + + // listener_ip - computed: true, optional: false, required: false + public get listenerIp() { + return this.getStringAttribute('listener_ip'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } +} + +export class DmsKafkaInstanceCrossVpcAccessesList extends cdktf.ComplexList { + public internalValue? : DmsKafkaInstanceCrossVpcAccesses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaInstanceCrossVpcAccessesOutputReference { + return new DmsKafkaInstanceCrossVpcAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaInstanceParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#name DmsKafkaInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#value DmsKafkaInstance#value} + */ + readonly value: string; +} + +export function dmsKafkaInstanceParametersToTerraform(struct?: DmsKafkaInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dmsKafkaInstanceParametersToHclTerraform(struct?: DmsKafkaInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaInstanceParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaInstanceParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaInstanceParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DmsKafkaInstanceParametersList extends cdktf.ComplexList { + public internalValue? : DmsKafkaInstanceParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaInstanceParametersOutputReference { + return new DmsKafkaInstanceParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#create DmsKafkaInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#delete DmsKafkaInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#update DmsKafkaInstance#update} + */ + readonly update?: string; +} + +export function dmsKafkaInstanceTimeoutsToTerraform(struct?: DmsKafkaInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dmsKafkaInstanceTimeoutsToHclTerraform(struct?: DmsKafkaInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance huaweicloud_dms_kafka_instance} +*/ +export class DmsKafkaInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaInstance to import + * @param importFromId The id of the existing DmsKafkaInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_instance huaweicloud_dms_kafka_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessUser = config.accessUser; + this._archType = config.archType; + this._autoRenew = config.autoRenew; + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._bandwidth = config.bandwidth; + this._brokerNum = config.brokerNum; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._dumping = config.dumping; + this._enableAutoTopic = config.enableAutoTopic; + this._enabledMechanisms = config.enabledMechanisms; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._managerPassword = config.managerPassword; + this._managerUser = config.managerUser; + this._name = config.name; + this._networkId = config.networkId; + this._newTenantIps = config.newTenantIps; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._productId = config.productId; + this._publicIpIds = config.publicIpIds; + this._region = config.region; + this._retentionPolicy = config.retentionPolicy; + this._securityGroupId = config.securityGroupId; + this._securityProtocol = config.securityProtocol; + this._sslEnable = config.sslEnable; + this._storageSpace = config.storageSpace; + this._storageSpecCode = config.storageSpecCode; + this._tags = config.tags; + this._vpcClientPlain = config.vpcClientPlain; + this._vpcId = config.vpcId; + this._crossVpcAccesses.internalValue = config.crossVpcAccesses; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_user - computed: false, optional: true, required: false + private _accessUser?: string; + public get accessUser() { + return this.getStringAttribute('access_user'); + } + public set accessUser(value: string) { + this._accessUser = value; + } + public resetAccessUser() { + this._accessUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessUserInput() { + return this._accessUser; + } + + // arch_type - computed: false, optional: true, required: false + private _archType?: string; + public get archType() { + return this.getStringAttribute('arch_type'); + } + public set archType(value: string) { + this._archType = value; + } + public resetArchType() { + this._archType = undefined; + } + // Temporarily expose input value. Use with caution. + public get archTypeInput() { + return this._archType; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return cdktf.Fn.tolist(this.getListAttribute('availability_zones')); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: true, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // bandwidth - computed: true, optional: true, required: false + private _bandwidth?: string; + public get bandwidth() { + return this.getStringAttribute('bandwidth'); + } + public set bandwidth(value: string) { + this._bandwidth = value; + } + public resetBandwidth() { + this._bandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // broker_num - computed: true, optional: true, required: false + private _brokerNum?: number; + public get brokerNum() { + return this.getNumberAttribute('broker_num'); + } + public set brokerNum(value: number) { + this._brokerNum = value; + } + public resetBrokerNum() { + this._brokerNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokerNumInput() { + return this._brokerNum; + } + + // cert_replaced - computed: true, optional: false, required: false + public get certReplaced() { + return this.getBooleanAttribute('cert_replaced'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // connect_address - computed: true, optional: false, required: false + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + + // connector_id - computed: true, optional: false, required: false + public get connectorId() { + return this.getStringAttribute('connector_id'); + } + + // connector_node_num - computed: true, optional: false, required: false + public get connectorNodeNum() { + return this.getNumberAttribute('connector_node_num'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dumping - computed: true, optional: true, required: false + private _dumping?: boolean | cdktf.IResolvable; + public get dumping() { + return this.getBooleanAttribute('dumping'); + } + public set dumping(value: boolean | cdktf.IResolvable) { + this._dumping = value; + } + public resetDumping() { + this._dumping = undefined; + } + // Temporarily expose input value. Use with caution. + public get dumpingInput() { + return this._dumping; + } + + // enable_auto_topic - computed: true, optional: true, required: false + private _enableAutoTopic?: boolean | cdktf.IResolvable; + public get enableAutoTopic() { + return this.getBooleanAttribute('enable_auto_topic'); + } + public set enableAutoTopic(value: boolean | cdktf.IResolvable) { + this._enableAutoTopic = value; + } + public resetEnableAutoTopic() { + this._enableAutoTopic = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAutoTopicInput() { + return this._enableAutoTopic; + } + + // enable_public_ip - computed: true, optional: false, required: false + public get enablePublicIp() { + return this.getBooleanAttribute('enable_public_ip'); + } + + // enabled_mechanisms - computed: false, optional: true, required: false + private _enabledMechanisms?: string[]; + public get enabledMechanisms() { + return cdktf.Fn.tolist(this.getListAttribute('enabled_mechanisms')); + } + public set enabledMechanisms(value: string[]) { + this._enabledMechanisms = value; + } + public resetEnabledMechanisms() { + this._enabledMechanisms = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledMechanismsInput() { + return this._enabledMechanisms; + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: false, optional: false, required: true + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_times - computed: true, optional: false, required: false + public get extendTimes() { + return this.getNumberAttribute('extend_times'); + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_connect_addresses - computed: true, optional: false, required: false + public get ipv6ConnectAddresses() { + return this.getListAttribute('ipv6_connect_addresses'); + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // is_logical_volume - computed: true, optional: false, required: false + public get isLogicalVolume() { + return this.getBooleanAttribute('is_logical_volume'); + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // management_connect_address - computed: true, optional: false, required: false + public get managementConnectAddress() { + return this.getStringAttribute('management_connect_address'); + } + + // manager_password - computed: false, optional: true, required: false + private _managerPassword?: string; + public get managerPassword() { + return this.getStringAttribute('manager_password'); + } + public set managerPassword(value: string) { + this._managerPassword = value; + } + public resetManagerPassword() { + this._managerPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerPasswordInput() { + return this._managerPassword; + } + + // manager_user - computed: false, optional: true, required: false + private _managerUser?: string; + public get managerUser() { + return this.getStringAttribute('manager_user'); + } + public set managerUser(value: string) { + this._managerUser = value; + } + public resetManagerUser() { + this._managerUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get managerUserInput() { + return this._managerUser; + } + + // manegement_connect_address - computed: true, optional: false, required: false + public get manegementConnectAddress() { + return this.getStringAttribute('manegement_connect_address'); + } + + // message_query_inst_enable - computed: true, optional: false, required: false + public get messageQueryInstEnable() { + return this.getBooleanAttribute('message_query_inst_enable'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // new_tenant_ips - computed: false, optional: true, required: false + private _newTenantIps?: string[]; + public get newTenantIps() { + return this.getListAttribute('new_tenant_ips'); + } + public set newTenantIps(value: string[]) { + this._newTenantIps = value; + } + public resetNewTenantIps() { + this._newTenantIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get newTenantIpsInput() { + return this._newTenantIps; + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // partition_num - computed: true, optional: false, required: false + public get partitionNum() { + return this.getNumberAttribute('partition_num'); + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // pod_connect_address - computed: true, optional: false, required: false + public get podConnectAddress() { + return this.getStringAttribute('pod_connect_address'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // public_bandwidth - computed: true, optional: false, required: false + public get publicBandwidth() { + return this.getNumberAttribute('public_bandwidth'); + } + + // public_ip_address - computed: true, optional: false, required: false + public get publicIpAddress() { + return this.getListAttribute('public_ip_address'); + } + + // public_ip_ids - computed: false, optional: true, required: false + private _publicIpIds?: string[]; + public get publicIpIds() { + return cdktf.Fn.tolist(this.getListAttribute('public_ip_ids')); + } + public set publicIpIds(value: string[]) { + this._publicIpIds = value; + } + public resetPublicIpIds() { + this._publicIpIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpIdsInput() { + return this._publicIpIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // retention_policy - computed: true, optional: true, required: false + private _retentionPolicy?: string; + public get retentionPolicy() { + return this.getStringAttribute('retention_policy'); + } + public set retentionPolicy(value: string) { + this._retentionPolicy = value; + } + public resetRetentionPolicy() { + this._retentionPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionPolicyInput() { + return this._retentionPolicy; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // security_protocol - computed: false, optional: true, required: false + private _securityProtocol?: string; + public get securityProtocol() { + return this.getStringAttribute('security_protocol'); + } + public set securityProtocol(value: string) { + this._securityProtocol = value; + } + public resetSecurityProtocol() { + this._securityProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityProtocolInput() { + return this._securityProtocol; + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // ssl_two_way_enable - computed: true, optional: false, required: false + public get sslTwoWayEnable() { + return this.getBooleanAttribute('ssl_two_way_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_resource_id - computed: true, optional: false, required: false + public get storageResourceId() { + return this.getStringAttribute('storage_resource_id'); + } + + // storage_space - computed: true, optional: true, required: false + private _storageSpace?: number; + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + public set storageSpace(value: number) { + this._storageSpace = value; + } + public resetStorageSpace() { + this._storageSpace = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpaceInput() { + return this._storageSpace; + } + + // storage_spec_code - computed: false, optional: false, required: true + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // storage_type - computed: true, optional: false, required: false + public get storageType() { + return this.getStringAttribute('storage_type'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // vpc_client_plain - computed: true, optional: true, required: false + private _vpcClientPlain?: boolean | cdktf.IResolvable; + public get vpcClientPlain() { + return this.getBooleanAttribute('vpc_client_plain'); + } + public set vpcClientPlain(value: boolean | cdktf.IResolvable) { + this._vpcClientPlain = value; + } + public resetVpcClientPlain() { + this._vpcClientPlain = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcClientPlainInput() { + return this._vpcClientPlain; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // cross_vpc_accesses - computed: false, optional: true, required: false + private _crossVpcAccesses = new DmsKafkaInstanceCrossVpcAccessesList(this, "cross_vpc_accesses", false); + public get crossVpcAccesses() { + return this._crossVpcAccesses; + } + public putCrossVpcAccesses(value: DmsKafkaInstanceCrossVpcAccesses[] | cdktf.IResolvable) { + this._crossVpcAccesses.internalValue = value; + } + public resetCrossVpcAccesses() { + this._crossVpcAccesses.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get crossVpcAccessesInput() { + return this._crossVpcAccesses.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new DmsKafkaInstanceParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: DmsKafkaInstanceParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_user: cdktf.stringToTerraform(this._accessUser), + arch_type: cdktf.stringToTerraform(this._archType), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + bandwidth: cdktf.stringToTerraform(this._bandwidth), + broker_num: cdktf.numberToTerraform(this._brokerNum), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + dumping: cdktf.booleanToTerraform(this._dumping), + enable_auto_topic: cdktf.booleanToTerraform(this._enableAutoTopic), + enabled_mechanisms: cdktf.listMapper(cdktf.stringToTerraform, false)(this._enabledMechanisms), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + manager_password: cdktf.stringToTerraform(this._managerPassword), + manager_user: cdktf.stringToTerraform(this._managerUser), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + new_tenant_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._newTenantIps), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + product_id: cdktf.stringToTerraform(this._productId), + public_ip_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._publicIpIds), + region: cdktf.stringToTerraform(this._region), + retention_policy: cdktf.stringToTerraform(this._retentionPolicy), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + security_protocol: cdktf.stringToTerraform(this._securityProtocol), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + storage_space: cdktf.numberToTerraform(this._storageSpace), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_client_plain: cdktf.booleanToTerraform(this._vpcClientPlain), + vpc_id: cdktf.stringToTerraform(this._vpcId), + cross_vpc_accesses: cdktf.listMapper(dmsKafkaInstanceCrossVpcAccessesToTerraform, true)(this._crossVpcAccesses.internalValue), + parameters: cdktf.listMapper(dmsKafkaInstanceParametersToTerraform, true)(this._parameters.internalValue), + timeouts: dmsKafkaInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_user: { + value: cdktf.stringToHclTerraform(this._accessUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + arch_type: { + value: cdktf.stringToHclTerraform(this._archType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + bandwidth: { + value: cdktf.stringToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + broker_num: { + value: cdktf.numberToHclTerraform(this._brokerNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dumping: { + value: cdktf.booleanToHclTerraform(this._dumping), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_auto_topic: { + value: cdktf.booleanToHclTerraform(this._enableAutoTopic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enabled_mechanisms: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._enabledMechanisms), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_password: { + value: cdktf.stringToHclTerraform(this._managerPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manager_user: { + value: cdktf.stringToHclTerraform(this._managerUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + new_tenant_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._newTenantIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._publicIpIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_policy: { + value: cdktf.stringToHclTerraform(this._retentionPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_protocol: { + value: cdktf.stringToHclTerraform(this._securityProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + storage_space: { + value: cdktf.numberToHclTerraform(this._storageSpace), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_client_plain: { + value: cdktf.booleanToHclTerraform(this._vpcClientPlain), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cross_vpc_accesses: { + value: cdktf.listMapperHcl(dmsKafkaInstanceCrossVpcAccessesToHclTerraform, true)(this._crossVpcAccesses.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsKafkaInstanceCrossVpcAccessesList", + }, + parameters: { + value: cdktf.listMapperHcl(dmsKafkaInstanceParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "DmsKafkaInstanceParametersList", + }, + timeouts: { + value: dmsKafkaInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/README.md b/src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/README.md new file mode 100644 index 00000000..f9bb13f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_message_diagnosis_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_message_diagnosis_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/index.ts new file mode 100644 index 00000000..749360d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-message-diagnosis-task/index.ts @@ -0,0 +1,729 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaMessageDiagnosisTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#group_name DmsKafkaMessageDiagnosisTask#group_name} + */ + readonly groupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#id DmsKafkaMessageDiagnosisTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#instance_id DmsKafkaMessageDiagnosisTask#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#region DmsKafkaMessageDiagnosisTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#topic_name DmsKafkaMessageDiagnosisTask#topic_name} + */ + readonly topicName: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#timeouts DmsKafkaMessageDiagnosisTask#timeouts} + */ + readonly timeouts?: DmsKafkaMessageDiagnosisTaskTimeouts; +} +export interface DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIds { +} + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsToTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsToHclTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIds | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIds | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // params - computed: true, optional: false, required: false + private _params = new cdktf.StringMap(this, "params"); + public get params() { + return this._params; + } +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsOutputReference { + return new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIds { +} + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsToTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsToHclTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIds): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIds | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIds | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getNumberAttribute('id'); + } + + // params - computed: true, optional: false, required: false + private _params = new cdktf.StringMap(this, "params"); + public get params() { + return this._params; + } +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsOutputReference { + return new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStruct { +} + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructToTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructToHclTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advice_ids - computed: true, optional: false, required: false + private _adviceIds = new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListAdviceIdsList(this, "advice_ids", false); + public get adviceIds() { + return this._adviceIds; + } + + // broker_ids - computed: true, optional: false, required: false + public get brokerIds() { + return this.getNumberListAttribute('broker_ids'); + } + + // cause_ids - computed: true, optional: false, required: false + private _causeIds = new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListCauseIdsList(this, "cause_ids", false); + public get causeIds() { + return this._causeIds; + } + + // failed_partitions - computed: true, optional: false, required: false + public get failedPartitions() { + return this.getNumberListAttribute('failed_partitions'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // partitions - computed: true, optional: false, required: false + public get partitions() { + return this.getNumberListAttribute('partitions'); + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructOutputReference { + return new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStruct { +} + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructToTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructToHclTerraform(struct?: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStruct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStruct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStruct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // abnormal_num - computed: true, optional: false, required: false + public get abnormalNum() { + return this.getNumberAttribute('abnormal_num'); + } + + // diagnosis_item_list - computed: true, optional: false, required: false + private _diagnosisItemList = new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListDiagnosisItemListStructList(this, "diagnosis_item_list", false); + public get diagnosisItemList() { + return this._diagnosisItemList; + } + + // failed_num - computed: true, optional: false, required: false + public get failedNum() { + return this.getNumberAttribute('failed_num'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructOutputReference { + return new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaMessageDiagnosisTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#create DmsKafkaMessageDiagnosisTask#create} + */ + readonly create?: string; +} + +export function dmsKafkaMessageDiagnosisTaskTimeoutsToTerraform(struct?: DmsKafkaMessageDiagnosisTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dmsKafkaMessageDiagnosisTaskTimeoutsToHclTerraform(struct?: DmsKafkaMessageDiagnosisTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaMessageDiagnosisTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaMessageDiagnosisTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageDiagnosisTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task huaweicloud_dms_kafka_message_diagnosis_task} +*/ +export class DmsKafkaMessageDiagnosisTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_message_diagnosis_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaMessageDiagnosisTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaMessageDiagnosisTask to import + * @param importFromId The id of the existing DmsKafkaMessageDiagnosisTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaMessageDiagnosisTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_message_diagnosis_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_diagnosis_task huaweicloud_dms_kafka_message_diagnosis_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaMessageDiagnosisTaskConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaMessageDiagnosisTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_message_diagnosis_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupName = config.groupName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topicName = config.topicName; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // accumulated_partitions - computed: true, optional: false, required: false + public get accumulatedPartitions() { + return this.getNumberAttribute('accumulated_partitions'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // diagnosis_dimension_list - computed: true, optional: false, required: false + private _diagnosisDimensionList = new DmsKafkaMessageDiagnosisTaskDiagnosisDimensionListStructList(this, "diagnosis_dimension_list", false); + public get diagnosisDimensionList() { + return this._diagnosisDimensionList; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // topic_name - computed: false, optional: false, required: true + private _topicName?: string; + public get topicName() { + return this.getStringAttribute('topic_name'); + } + public set topicName(value: string) { + this._topicName = value; + } + // Temporarily expose input value. Use with caution. + public get topicNameInput() { + return this._topicName; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaMessageDiagnosisTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaMessageDiagnosisTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_name: cdktf.stringToTerraform(this._groupName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic_name: cdktf.stringToTerraform(this._topicName), + timeouts: dmsKafkaMessageDiagnosisTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_name: { + value: cdktf.stringToHclTerraform(this._groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name: { + value: cdktf.stringToHclTerraform(this._topicName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsKafkaMessageDiagnosisTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaMessageDiagnosisTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/README.md b/src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/README.md new file mode 100644 index 00000000..687780c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_message_offset_reset` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_message_offset_reset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/index.ts new file mode 100644 index 00000000..61eb75b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-message-offset-reset/index.ts @@ -0,0 +1,441 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaMessageOffsetResetConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#group DmsKafkaMessageOffsetReset#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#id DmsKafkaMessageOffsetReset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#instance_id DmsKafkaMessageOffsetReset#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the message offset. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#message_offset DmsKafkaMessageOffsetReset#message_offset} + */ + readonly messageOffset?: string; + /** + * Specifies the partition number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#partition DmsKafkaMessageOffsetReset#partition} + */ + readonly partition: number; + /** + * Specifies the region in which to query the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#region DmsKafkaMessageOffsetReset#region} + */ + readonly region?: string; + /** + * Specifies the message offset. The value is a Unix timestamp, in millisecond + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#timestamp DmsKafkaMessageOffsetReset#timestamp} + */ + readonly timestamp?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#topic DmsKafkaMessageOffsetReset#topic} + */ + readonly topic?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#timeouts DmsKafkaMessageOffsetReset#timeouts} + */ + readonly timeouts?: DmsKafkaMessageOffsetResetTimeouts; +} +export interface DmsKafkaMessageOffsetResetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#create DmsKafkaMessageOffsetReset#create} + */ + readonly create?: string; +} + +export function dmsKafkaMessageOffsetResetTimeoutsToTerraform(struct?: DmsKafkaMessageOffsetResetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dmsKafkaMessageOffsetResetTimeoutsToHclTerraform(struct?: DmsKafkaMessageOffsetResetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaMessageOffsetResetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaMessageOffsetResetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageOffsetResetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset huaweicloud_dms_kafka_message_offset_reset} +*/ +export class DmsKafkaMessageOffsetReset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_message_offset_reset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaMessageOffsetReset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaMessageOffsetReset to import + * @param importFromId The id of the existing DmsKafkaMessageOffsetReset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaMessageOffsetReset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_message_offset_reset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_offset_reset huaweicloud_dms_kafka_message_offset_reset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaMessageOffsetResetConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaMessageOffsetResetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_message_offset_reset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._instanceId = config.instanceId; + this._messageOffset = config.messageOffset; + this._partition = config.partition; + this._region = config.region; + this._timestamp = config.timestamp; + this._topic = config.topic; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // message_offset - computed: false, optional: true, required: false + private _messageOffset?: string; + public get messageOffset() { + return this.getStringAttribute('message_offset'); + } + public set messageOffset(value: string) { + this._messageOffset = value; + } + public resetMessageOffset() { + this._messageOffset = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageOffsetInput() { + return this._messageOffset; + } + + // partition - computed: false, optional: false, required: true + private _partition?: number; + public get partition() { + return this.getNumberAttribute('partition'); + } + public set partition(value: number) { + this._partition = value; + } + // Temporarily expose input value. Use with caution. + public get partitionInput() { + return this._partition; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timestamp - computed: false, optional: true, required: false + private _timestamp?: string; + public get timestamp() { + return this.getStringAttribute('timestamp'); + } + public set timestamp(value: string) { + this._timestamp = value; + } + public resetTimestamp() { + this._timestamp = undefined; + } + // Temporarily expose input value. Use with caution. + public get timestampInput() { + return this._timestamp; + } + + // topic - computed: false, optional: true, required: false + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + public resetTopic() { + this._topic = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaMessageOffsetResetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaMessageOffsetResetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + message_offset: cdktf.stringToTerraform(this._messageOffset), + partition: cdktf.numberToTerraform(this._partition), + region: cdktf.stringToTerraform(this._region), + timestamp: cdktf.stringToTerraform(this._timestamp), + topic: cdktf.stringToTerraform(this._topic), + timeouts: dmsKafkaMessageOffsetResetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_offset: { + value: cdktf.stringToHclTerraform(this._messageOffset), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition: { + value: cdktf.numberToHclTerraform(this._partition), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timestamp: { + value: cdktf.stringToHclTerraform(this._timestamp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsKafkaMessageOffsetResetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaMessageOffsetResetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-message-produce/README.md b/src/constructs/providers/huaweicloud/dms-kafka-message-produce/README.md new file mode 100644 index 00000000..875c5d04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-message-produce/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_message_produce` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_message_produce`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-message-produce/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-message-produce/index.ts new file mode 100644 index 00000000..bfa09e54 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-message-produce/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaMessageProduceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#body DmsKafkaMessageProduce#body} + */ + readonly body: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#id DmsKafkaMessageProduce#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#instance_id DmsKafkaMessageProduce#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#region DmsKafkaMessageProduce#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#topic DmsKafkaMessageProduce#topic} + */ + readonly topic: string; + /** + * property_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#property_list DmsKafkaMessageProduce#property_list} + */ + readonly propertyList?: DmsKafkaMessageProducePropertyListStruct[] | cdktf.IResolvable; +} +export interface DmsKafkaMessageProducePropertyListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#name DmsKafkaMessageProduce#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#value DmsKafkaMessageProduce#value} + */ + readonly value: string; +} + +export function dmsKafkaMessageProducePropertyListStructToTerraform(struct?: DmsKafkaMessageProducePropertyListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dmsKafkaMessageProducePropertyListStructToHclTerraform(struct?: DmsKafkaMessageProducePropertyListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaMessageProducePropertyListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaMessageProducePropertyListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaMessageProducePropertyListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DmsKafkaMessageProducePropertyListStructList extends cdktf.ComplexList { + public internalValue? : DmsKafkaMessageProducePropertyListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaMessageProducePropertyListStructOutputReference { + return new DmsKafkaMessageProducePropertyListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce huaweicloud_dms_kafka_message_produce} +*/ +export class DmsKafkaMessageProduce extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_message_produce"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaMessageProduce resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaMessageProduce to import + * @param importFromId The id of the existing DmsKafkaMessageProduce that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaMessageProduce to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_message_produce", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_message_produce huaweicloud_dms_kafka_message_produce} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaMessageProduceConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaMessageProduceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_message_produce', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._body = config.body; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topic = config.topic; + this._propertyList.internalValue = config.propertyList; + } + + // ========== + // ATTRIBUTES + // ========== + + // body - computed: false, optional: false, required: true + private _body?: string; + public get body() { + return this.getStringAttribute('body'); + } + public set body(value: string) { + this._body = value; + } + // Temporarily expose input value. Use with caution. + public get bodyInput() { + return this._body; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // property_list - computed: false, optional: true, required: false + private _propertyList = new DmsKafkaMessageProducePropertyListStructList(this, "property_list", false); + public get propertyList() { + return this._propertyList; + } + public putPropertyList(value: DmsKafkaMessageProducePropertyListStruct[] | cdktf.IResolvable) { + this._propertyList.internalValue = value; + } + public resetPropertyList() { + this._propertyList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertyListInput() { + return this._propertyList.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + body: cdktf.stringToTerraform(this._body), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + property_list: cdktf.listMapper(dmsKafkaMessageProducePropertyListStructToTerraform, true)(this._propertyList.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + body: { + value: cdktf.stringToHclTerraform(this._body), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property_list: { + value: cdktf.listMapperHcl(dmsKafkaMessageProducePropertyListStructToHclTerraform, true)(this._propertyList.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsKafkaMessageProducePropertyListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/README.md b/src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/README.md new file mode 100644 index 00000000..1ea6c61a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_partition_reassign` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_partition_reassign`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/index.ts new file mode 100644 index 00000000..17f537fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-partition-reassign/index.ts @@ -0,0 +1,805 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaPartitionReassignConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#execute_at DmsKafkaPartitionReassign#execute_at} + */ + readonly executeAt?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#id DmsKafkaPartitionReassign#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#instance_id DmsKafkaPartitionReassign#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#is_schedule DmsKafkaPartitionReassign#is_schedule} + */ + readonly isSchedule?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#region DmsKafkaPartitionReassign#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#throttle DmsKafkaPartitionReassign#throttle} + */ + readonly throttle?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#time_estimate DmsKafkaPartitionReassign#time_estimate} + */ + readonly timeEstimate?: boolean | cdktf.IResolvable; + /** + * reassignments block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#reassignments DmsKafkaPartitionReassign#reassignments} + */ + readonly reassignments: DmsKafkaPartitionReassignReassignments[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#timeouts DmsKafkaPartitionReassign#timeouts} + */ + readonly timeouts?: DmsKafkaPartitionReassignTimeouts; +} +export interface DmsKafkaPartitionReassignReassignmentsAssignment { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#partition DmsKafkaPartitionReassign#partition} + */ + readonly partition?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#partition_brokers DmsKafkaPartitionReassign#partition_brokers} + */ + readonly partitionBrokers?: number[]; +} + +export function dmsKafkaPartitionReassignReassignmentsAssignmentToTerraform(struct?: DmsKafkaPartitionReassignReassignmentsAssignment | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + partition: cdktf.numberToTerraform(struct!.partition), + partition_brokers: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.partitionBrokers), + } +} + + +export function dmsKafkaPartitionReassignReassignmentsAssignmentToHclTerraform(struct?: DmsKafkaPartitionReassignReassignmentsAssignment | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + partition: { + value: cdktf.numberToHclTerraform(struct!.partition), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + partition_brokers: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.partitionBrokers), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaPartitionReassignReassignmentsAssignmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaPartitionReassignReassignmentsAssignment | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._partition !== undefined) { + hasAnyValues = true; + internalValueResult.partition = this._partition; + } + if (this._partitionBrokers !== undefined) { + hasAnyValues = true; + internalValueResult.partitionBrokers = this._partitionBrokers; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaPartitionReassignReassignmentsAssignment | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._partition = undefined; + this._partitionBrokers = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._partition = value.partition; + this._partitionBrokers = value.partitionBrokers; + } + } + + // partition - computed: false, optional: true, required: false + private _partition?: number; + public get partition() { + return this.getNumberAttribute('partition'); + } + public set partition(value: number) { + this._partition = value; + } + public resetPartition() { + this._partition = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionInput() { + return this._partition; + } + + // partition_brokers - computed: false, optional: true, required: false + private _partitionBrokers?: number[]; + public get partitionBrokers() { + return this.getNumberListAttribute('partition_brokers'); + } + public set partitionBrokers(value: number[]) { + this._partitionBrokers = value; + } + public resetPartitionBrokers() { + this._partitionBrokers = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionBrokersInput() { + return this._partitionBrokers; + } +} + +export class DmsKafkaPartitionReassignReassignmentsAssignmentList extends cdktf.ComplexList { + public internalValue? : DmsKafkaPartitionReassignReassignmentsAssignment[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaPartitionReassignReassignmentsAssignmentOutputReference { + return new DmsKafkaPartitionReassignReassignmentsAssignmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaPartitionReassignReassignments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#brokers DmsKafkaPartitionReassign#brokers} + */ + readonly brokers?: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#replication_factor DmsKafkaPartitionReassign#replication_factor} + */ + readonly replicationFactor?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#topic DmsKafkaPartitionReassign#topic} + */ + readonly topic: string; + /** + * assignment block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#assignment DmsKafkaPartitionReassign#assignment} + */ + readonly assignment?: DmsKafkaPartitionReassignReassignmentsAssignment[] | cdktf.IResolvable; +} + +export function dmsKafkaPartitionReassignReassignmentsToTerraform(struct?: DmsKafkaPartitionReassignReassignments | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + brokers: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.brokers), + replication_factor: cdktf.numberToTerraform(struct!.replicationFactor), + topic: cdktf.stringToTerraform(struct!.topic), + assignment: cdktf.listMapper(dmsKafkaPartitionReassignReassignmentsAssignmentToTerraform, true)(struct!.assignment), + } +} + + +export function dmsKafkaPartitionReassignReassignmentsToHclTerraform(struct?: DmsKafkaPartitionReassignReassignments | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + brokers: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.brokers), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + replication_factor: { + value: cdktf.numberToHclTerraform(struct!.replicationFactor), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + topic: { + value: cdktf.stringToHclTerraform(struct!.topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + assignment: { + value: cdktf.listMapperHcl(dmsKafkaPartitionReassignReassignmentsAssignmentToHclTerraform, true)(struct!.assignment), + isBlock: true, + type: "list", + storageClassType: "DmsKafkaPartitionReassignReassignmentsAssignmentList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaPartitionReassignReassignmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaPartitionReassignReassignments | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._brokers !== undefined) { + hasAnyValues = true; + internalValueResult.brokers = this._brokers; + } + if (this._replicationFactor !== undefined) { + hasAnyValues = true; + internalValueResult.replicationFactor = this._replicationFactor; + } + if (this._topic !== undefined) { + hasAnyValues = true; + internalValueResult.topic = this._topic; + } + if (this._assignment?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.assignment = this._assignment?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaPartitionReassignReassignments | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._brokers = undefined; + this._replicationFactor = undefined; + this._topic = undefined; + this._assignment.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._brokers = value.brokers; + this._replicationFactor = value.replicationFactor; + this._topic = value.topic; + this._assignment.internalValue = value.assignment; + } + } + + // brokers - computed: false, optional: true, required: false + private _brokers?: number[]; + public get brokers() { + return this.getNumberListAttribute('brokers'); + } + public set brokers(value: number[]) { + this._brokers = value; + } + public resetBrokers() { + this._brokers = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokersInput() { + return this._brokers; + } + + // replication_factor - computed: false, optional: true, required: false + private _replicationFactor?: number; + public get replicationFactor() { + return this.getNumberAttribute('replication_factor'); + } + public set replicationFactor(value: number) { + this._replicationFactor = value; + } + public resetReplicationFactor() { + this._replicationFactor = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicationFactorInput() { + return this._replicationFactor; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // assignment - computed: false, optional: true, required: false + private _assignment = new DmsKafkaPartitionReassignReassignmentsAssignmentList(this, "assignment", false); + public get assignment() { + return this._assignment; + } + public putAssignment(value: DmsKafkaPartitionReassignReassignmentsAssignment[] | cdktf.IResolvable) { + this._assignment.internalValue = value; + } + public resetAssignment() { + this._assignment.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignmentInput() { + return this._assignment.internalValue; + } +} + +export class DmsKafkaPartitionReassignReassignmentsList extends cdktf.ComplexList { + public internalValue? : DmsKafkaPartitionReassignReassignments[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaPartitionReassignReassignmentsOutputReference { + return new DmsKafkaPartitionReassignReassignmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaPartitionReassignTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#create DmsKafkaPartitionReassign#create} + */ + readonly create?: string; +} + +export function dmsKafkaPartitionReassignTimeoutsToTerraform(struct?: DmsKafkaPartitionReassignTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dmsKafkaPartitionReassignTimeoutsToHclTerraform(struct?: DmsKafkaPartitionReassignTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaPartitionReassignTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaPartitionReassignTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaPartitionReassignTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign huaweicloud_dms_kafka_partition_reassign} +*/ +export class DmsKafkaPartitionReassign extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_partition_reassign"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaPartitionReassign resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaPartitionReassign to import + * @param importFromId The id of the existing DmsKafkaPartitionReassign that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaPartitionReassign to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_partition_reassign", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_partition_reassign huaweicloud_dms_kafka_partition_reassign} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaPartitionReassignConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaPartitionReassignConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_partition_reassign', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._executeAt = config.executeAt; + this._id = config.id; + this._instanceId = config.instanceId; + this._isSchedule = config.isSchedule; + this._region = config.region; + this._throttle = config.throttle; + this._timeEstimate = config.timeEstimate; + this._reassignments.internalValue = config.reassignments; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // execute_at - computed: false, optional: true, required: false + private _executeAt?: number; + public get executeAt() { + return this.getNumberAttribute('execute_at'); + } + public set executeAt(value: number) { + this._executeAt = value; + } + public resetExecuteAt() { + this._executeAt = undefined; + } + // Temporarily expose input value. Use with caution. + public get executeAtInput() { + return this._executeAt; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_schedule - computed: false, optional: true, required: false + private _isSchedule?: boolean | cdktf.IResolvable; + public get isSchedule() { + return this.getBooleanAttribute('is_schedule'); + } + public set isSchedule(value: boolean | cdktf.IResolvable) { + this._isSchedule = value; + } + public resetIsSchedule() { + this._isSchedule = undefined; + } + // Temporarily expose input value. Use with caution. + public get isScheduleInput() { + return this._isSchedule; + } + + // reassignment_time - computed: true, optional: false, required: false + public get reassignmentTime() { + return this.getNumberAttribute('reassignment_time'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // task_id - computed: true, optional: false, required: false + public get taskId() { + return this.getStringAttribute('task_id'); + } + + // throttle - computed: false, optional: true, required: false + private _throttle?: number; + public get throttle() { + return this.getNumberAttribute('throttle'); + } + public set throttle(value: number) { + this._throttle = value; + } + public resetThrottle() { + this._throttle = undefined; + } + // Temporarily expose input value. Use with caution. + public get throttleInput() { + return this._throttle; + } + + // time_estimate - computed: false, optional: true, required: false + private _timeEstimate?: boolean | cdktf.IResolvable; + public get timeEstimate() { + return this.getBooleanAttribute('time_estimate'); + } + public set timeEstimate(value: boolean | cdktf.IResolvable) { + this._timeEstimate = value; + } + public resetTimeEstimate() { + this._timeEstimate = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeEstimateInput() { + return this._timeEstimate; + } + + // reassignments - computed: false, optional: false, required: true + private _reassignments = new DmsKafkaPartitionReassignReassignmentsList(this, "reassignments", false); + public get reassignments() { + return this._reassignments; + } + public putReassignments(value: DmsKafkaPartitionReassignReassignments[] | cdktf.IResolvable) { + this._reassignments.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get reassignmentsInput() { + return this._reassignments.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaPartitionReassignTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaPartitionReassignTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + execute_at: cdktf.numberToTerraform(this._executeAt), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_schedule: cdktf.booleanToTerraform(this._isSchedule), + region: cdktf.stringToTerraform(this._region), + throttle: cdktf.numberToTerraform(this._throttle), + time_estimate: cdktf.booleanToTerraform(this._timeEstimate), + reassignments: cdktf.listMapper(dmsKafkaPartitionReassignReassignmentsToTerraform, true)(this._reassignments.internalValue), + timeouts: dmsKafkaPartitionReassignTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + execute_at: { + value: cdktf.numberToHclTerraform(this._executeAt), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_schedule: { + value: cdktf.booleanToHclTerraform(this._isSchedule), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + throttle: { + value: cdktf.numberToHclTerraform(this._throttle), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_estimate: { + value: cdktf.booleanToHclTerraform(this._timeEstimate), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + reassignments: { + value: cdktf.listMapperHcl(dmsKafkaPartitionReassignReassignmentsToHclTerraform, true)(this._reassignments.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsKafkaPartitionReassignReassignmentsList", + }, + timeouts: { + value: dmsKafkaPartitionReassignTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaPartitionReassignTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-permissions/README.md b/src/constructs/providers/huaweicloud/dms-kafka-permissions/README.md new file mode 100644 index 00000000..5cb39661 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-permissions/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_permissions` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-permissions/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-permissions/index.ts new file mode 100644 index 00000000..dac235df --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-permissions/index.ts @@ -0,0 +1,521 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaPermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#id DmsKafkaPermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#instance_id DmsKafkaPermissions#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#region DmsKafkaPermissions#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#topic_name DmsKafkaPermissions#topic_name} + */ + readonly topicName: string; + /** + * policies block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#policies DmsKafkaPermissions#policies} + */ + readonly policies: DmsKafkaPermissionsPolicies[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#timeouts DmsKafkaPermissions#timeouts} + */ + readonly timeouts?: DmsKafkaPermissionsTimeouts; +} +export interface DmsKafkaPermissionsPolicies { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#access_policy DmsKafkaPermissions#access_policy} + */ + readonly accessPolicy: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#user_name DmsKafkaPermissions#user_name} + */ + readonly userName: string; +} + +export function dmsKafkaPermissionsPoliciesToTerraform(struct?: DmsKafkaPermissionsPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_policy: cdktf.stringToTerraform(struct!.accessPolicy), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function dmsKafkaPermissionsPoliciesToHclTerraform(struct?: DmsKafkaPermissionsPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_policy: { + value: cdktf.stringToHclTerraform(struct!.accessPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaPermissionsPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaPermissionsPolicies | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.accessPolicy = this._accessPolicy; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaPermissionsPolicies | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accessPolicy = undefined; + this._userName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accessPolicy = value.accessPolicy; + this._userName = value.userName; + } + } + + // access_policy - computed: false, optional: false, required: true + private _accessPolicy?: string; + public get accessPolicy() { + return this.getStringAttribute('access_policy'); + } + public set accessPolicy(value: string) { + this._accessPolicy = value; + } + // Temporarily expose input value. Use with caution. + public get accessPolicyInput() { + return this._accessPolicy; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} + +export class DmsKafkaPermissionsPoliciesList extends cdktf.ComplexList { + public internalValue? : DmsKafkaPermissionsPolicies[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaPermissionsPoliciesOutputReference { + return new DmsKafkaPermissionsPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsKafkaPermissionsTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#create DmsKafkaPermissions#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#delete DmsKafkaPermissions#delete} + */ + readonly delete?: string; +} + +export function dmsKafkaPermissionsTimeoutsToTerraform(struct?: DmsKafkaPermissionsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dmsKafkaPermissionsTimeoutsToHclTerraform(struct?: DmsKafkaPermissionsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaPermissionsTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaPermissionsTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaPermissionsTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions huaweicloud_dms_kafka_permissions} +*/ +export class DmsKafkaPermissions extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaPermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaPermissions to import + * @param importFromId The id of the existing DmsKafkaPermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaPermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_permissions huaweicloud_dms_kafka_permissions} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaPermissionsConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaPermissionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._topicName = config.topicName; + this._policies.internalValue = config.policies; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_name - computed: false, optional: false, required: true + private _topicName?: string; + public get topicName() { + return this.getStringAttribute('topic_name'); + } + public set topicName(value: string) { + this._topicName = value; + } + // Temporarily expose input value. Use with caution. + public get topicNameInput() { + return this._topicName; + } + + // policies - computed: false, optional: false, required: true + private _policies = new DmsKafkaPermissionsPoliciesList(this, "policies", false); + public get policies() { + return this._policies; + } + public putPolicies(value: DmsKafkaPermissionsPolicies[] | cdktf.IResolvable) { + this._policies.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get policiesInput() { + return this._policies.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaPermissionsTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaPermissionsTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + topic_name: cdktf.stringToTerraform(this._topicName), + policies: cdktf.listMapper(dmsKafkaPermissionsPoliciesToTerraform, true)(this._policies.internalValue), + timeouts: dmsKafkaPermissionsTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name: { + value: cdktf.stringToHclTerraform(this._topicName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policies: { + value: cdktf.listMapperHcl(dmsKafkaPermissionsPoliciesToHclTerraform, true)(this._policies.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsKafkaPermissionsPoliciesList", + }, + timeouts: { + value: dmsKafkaPermissionsTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaPermissionsTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/README.md b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/README.md new file mode 100644 index 00000000..418be06b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_smart_connect_task_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_smart_connect_task_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/index.ts new file mode 100644 index 00000000..5f1ece7c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task-action/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaSmartConnectTaskActionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the source type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#action DmsKafkaSmartConnectTaskAction#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#id DmsKafkaSmartConnectTaskAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the kafka instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#instance_id DmsKafkaSmartConnectTaskAction#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#region DmsKafkaSmartConnectTaskAction#region} + */ + readonly region?: string; + /** + * Specifies the smart connect task ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#task_id DmsKafkaSmartConnectTaskAction#task_id} + */ + readonly taskId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#timeouts DmsKafkaSmartConnectTaskAction#timeouts} + */ + readonly timeouts?: DmsKafkaSmartConnectTaskActionTimeouts; +} +export interface DmsKafkaSmartConnectTaskActionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#create DmsKafkaSmartConnectTaskAction#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#update DmsKafkaSmartConnectTaskAction#update} + */ + readonly update?: string; +} + +export function dmsKafkaSmartConnectTaskActionTimeoutsToTerraform(struct?: DmsKafkaSmartConnectTaskActionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dmsKafkaSmartConnectTaskActionTimeoutsToHclTerraform(struct?: DmsKafkaSmartConnectTaskActionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaSmartConnectTaskActionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaSmartConnectTaskActionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaSmartConnectTaskActionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action huaweicloud_dms_kafka_smart_connect_task_action} +*/ +export class DmsKafkaSmartConnectTaskAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_smart_connect_task_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaSmartConnectTaskAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaSmartConnectTaskAction to import + * @param importFromId The id of the existing DmsKafkaSmartConnectTaskAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaSmartConnectTaskAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_smart_connect_task_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task_action huaweicloud_dms_kafka_smart_connect_task_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaSmartConnectTaskActionConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaSmartConnectTaskActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_smart_connect_task_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._taskId = config.taskId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // task_id - computed: false, optional: false, required: true + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaSmartConnectTaskActionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaSmartConnectTaskActionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + task_id: cdktf.stringToTerraform(this._taskId), + timeouts: dmsKafkaSmartConnectTaskActionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsKafkaSmartConnectTaskActionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaSmartConnectTaskActionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/README.md b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/README.md new file mode 100644 index 00000000..b38e4ba8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_smart_connect_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_smart_connect_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/index.ts new file mode 100644 index 00000000..9d0ef4bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect-task/index.ts @@ -0,0 +1,698 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaSmartConnectTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the access key used to access the OBS bucket. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#access_key DmsKafkaSmartConnectTask#access_key} + */ + readonly accessKey: string; + /** + * Specifies the connector id of the kafka instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#connector_id DmsKafkaSmartConnectTask#connector_id} + */ + readonly connectorId: string; + /** + * Specifies the consumer strategy of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#consumer_strategy DmsKafkaSmartConnectTask#consumer_strategy} + */ + readonly consumerStrategy: string; + /** + * Specifies the deliver time interval of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#deliver_time_interval DmsKafkaSmartConnectTask#deliver_time_interval} + */ + readonly deliverTimeInterval: number; + /** + * Specifies the destination file type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#destination_file_type DmsKafkaSmartConnectTask#destination_file_type} + */ + readonly destinationFileType?: string; + /** + * Specifies the destination type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#destination_type DmsKafkaSmartConnectTask#destination_type} + */ + readonly destinationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#id DmsKafkaSmartConnectTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the obs bucket name of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#obs_bucket_name DmsKafkaSmartConnectTask#obs_bucket_name} + */ + readonly obsBucketName: string; + /** + * Specifies the obs path of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#obs_path DmsKafkaSmartConnectTask#obs_path} + */ + readonly obsPath?: string; + /** + * Specifies the partiton format of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#partition_format DmsKafkaSmartConnectTask#partition_format} + */ + readonly partitionFormat: string; + /** + * Specifies the record delimiter of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#record_delimiter DmsKafkaSmartConnectTask#record_delimiter} + */ + readonly recordDelimiter?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#region DmsKafkaSmartConnectTask#region} + */ + readonly region?: string; + /** + * Specifies the secret access key used to access the OBS bucket. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#secret_key DmsKafkaSmartConnectTask#secret_key} + */ + readonly secretKey: string; + /** + * Specifies the source type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#source_type DmsKafkaSmartConnectTask#source_type} + */ + readonly sourceType: string; + /** + * Specifies the name of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#task_name DmsKafkaSmartConnectTask#task_name} + */ + readonly taskName: string; + /** + * Specifies the topics of the task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#topics DmsKafkaSmartConnectTask#topics} + */ + readonly topics?: string; + /** + * Specifies the topics regular expression of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#topics_regex DmsKafkaSmartConnectTask#topics_regex} + */ + readonly topicsRegex?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#timeouts DmsKafkaSmartConnectTask#timeouts} + */ + readonly timeouts?: DmsKafkaSmartConnectTaskTimeouts; +} +export interface DmsKafkaSmartConnectTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#create DmsKafkaSmartConnectTask#create} + */ + readonly create?: string; +} + +export function dmsKafkaSmartConnectTaskTimeoutsToTerraform(struct?: DmsKafkaSmartConnectTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dmsKafkaSmartConnectTaskTimeoutsToHclTerraform(struct?: DmsKafkaSmartConnectTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaSmartConnectTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaSmartConnectTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaSmartConnectTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task huaweicloud_dms_kafka_smart_connect_task} +*/ +export class DmsKafkaSmartConnectTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_smart_connect_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaSmartConnectTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaSmartConnectTask to import + * @param importFromId The id of the existing DmsKafkaSmartConnectTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaSmartConnectTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_smart_connect_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect_task huaweicloud_dms_kafka_smart_connect_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaSmartConnectTaskConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaSmartConnectTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_smart_connect_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessKey = config.accessKey; + this._connectorId = config.connectorId; + this._consumerStrategy = config.consumerStrategy; + this._deliverTimeInterval = config.deliverTimeInterval; + this._destinationFileType = config.destinationFileType; + this._destinationType = config.destinationType; + this._id = config.id; + this._obsBucketName = config.obsBucketName; + this._obsPath = config.obsPath; + this._partitionFormat = config.partitionFormat; + this._recordDelimiter = config.recordDelimiter; + this._region = config.region; + this._secretKey = config.secretKey; + this._sourceType = config.sourceType; + this._taskName = config.taskName; + this._topics = config.topics; + this._topicsRegex = config.topicsRegex; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: false, optional: false, required: true + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // connector_id - computed: false, optional: false, required: true + private _connectorId?: string; + public get connectorId() { + return this.getStringAttribute('connector_id'); + } + public set connectorId(value: string) { + this._connectorId = value; + } + // Temporarily expose input value. Use with caution. + public get connectorIdInput() { + return this._connectorId; + } + + // consumer_strategy - computed: false, optional: false, required: true + private _consumerStrategy?: string; + public get consumerStrategy() { + return this.getStringAttribute('consumer_strategy'); + } + public set consumerStrategy(value: string) { + this._consumerStrategy = value; + } + // Temporarily expose input value. Use with caution. + public get consumerStrategyInput() { + return this._consumerStrategy; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // deliver_time_interval - computed: false, optional: false, required: true + private _deliverTimeInterval?: number; + public get deliverTimeInterval() { + return this.getNumberAttribute('deliver_time_interval'); + } + public set deliverTimeInterval(value: number) { + this._deliverTimeInterval = value; + } + // Temporarily expose input value. Use with caution. + public get deliverTimeIntervalInput() { + return this._deliverTimeInterval; + } + + // destination_file_type - computed: false, optional: true, required: false + private _destinationFileType?: string; + public get destinationFileType() { + return this.getStringAttribute('destination_file_type'); + } + public set destinationFileType(value: string) { + this._destinationFileType = value; + } + public resetDestinationFileType() { + this._destinationFileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationFileTypeInput() { + return this._destinationFileType; + } + + // destination_type - computed: false, optional: false, required: true + private _destinationType?: string; + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + public set destinationType(value: string) { + this._destinationType = value; + } + // Temporarily expose input value. Use with caution. + public get destinationTypeInput() { + return this._destinationType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // obs_bucket_name - computed: false, optional: false, required: true + private _obsBucketName?: string; + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + public set obsBucketName(value: string) { + this._obsBucketName = value; + } + // Temporarily expose input value. Use with caution. + public get obsBucketNameInput() { + return this._obsBucketName; + } + + // obs_path - computed: false, optional: true, required: false + private _obsPath?: string; + public get obsPath() { + return this.getStringAttribute('obs_path'); + } + public set obsPath(value: string) { + this._obsPath = value; + } + public resetObsPath() { + this._obsPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsPathInput() { + return this._obsPath; + } + + // partition_format - computed: false, optional: false, required: true + private _partitionFormat?: string; + public get partitionFormat() { + return this.getStringAttribute('partition_format'); + } + public set partitionFormat(value: string) { + this._partitionFormat = value; + } + // Temporarily expose input value. Use with caution. + public get partitionFormatInput() { + return this._partitionFormat; + } + + // record_delimiter - computed: false, optional: true, required: false + private _recordDelimiter?: string; + public get recordDelimiter() { + return this.getStringAttribute('record_delimiter'); + } + public set recordDelimiter(value: string) { + this._recordDelimiter = value; + } + public resetRecordDelimiter() { + this._recordDelimiter = undefined; + } + // Temporarily expose input value. Use with caution. + public get recordDelimiterInput() { + return this._recordDelimiter; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_key - computed: false, optional: false, required: true + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // task_name - computed: false, optional: false, required: true + private _taskName?: string; + public get taskName() { + return this.getStringAttribute('task_name'); + } + public set taskName(value: string) { + this._taskName = value; + } + // Temporarily expose input value. Use with caution. + public get taskNameInput() { + return this._taskName; + } + + // topics - computed: false, optional: true, required: false + private _topics?: string; + public get topics() { + return this.getStringAttribute('topics'); + } + public set topics(value: string) { + this._topics = value; + } + public resetTopics() { + this._topics = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicsInput() { + return this._topics; + } + + // topics_regex - computed: false, optional: true, required: false + private _topicsRegex?: string; + public get topicsRegex() { + return this.getStringAttribute('topics_regex'); + } + public set topicsRegex(value: string) { + this._topicsRegex = value; + } + public resetTopicsRegex() { + this._topicsRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicsRegexInput() { + return this._topicsRegex; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaSmartConnectTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaSmartConnectTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_key: cdktf.stringToTerraform(this._accessKey), + connector_id: cdktf.stringToTerraform(this._connectorId), + consumer_strategy: cdktf.stringToTerraform(this._consumerStrategy), + deliver_time_interval: cdktf.numberToTerraform(this._deliverTimeInterval), + destination_file_type: cdktf.stringToTerraform(this._destinationFileType), + destination_type: cdktf.stringToTerraform(this._destinationType), + id: cdktf.stringToTerraform(this._id), + obs_bucket_name: cdktf.stringToTerraform(this._obsBucketName), + obs_path: cdktf.stringToTerraform(this._obsPath), + partition_format: cdktf.stringToTerraform(this._partitionFormat), + record_delimiter: cdktf.stringToTerraform(this._recordDelimiter), + region: cdktf.stringToTerraform(this._region), + secret_key: cdktf.stringToTerraform(this._secretKey), + source_type: cdktf.stringToTerraform(this._sourceType), + task_name: cdktf.stringToTerraform(this._taskName), + topics: cdktf.stringToTerraform(this._topics), + topics_regex: cdktf.stringToTerraform(this._topicsRegex), + timeouts: dmsKafkaSmartConnectTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(this._accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connector_id: { + value: cdktf.stringToHclTerraform(this._connectorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consumer_strategy: { + value: cdktf.stringToHclTerraform(this._consumerStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deliver_time_interval: { + value: cdktf.numberToHclTerraform(this._deliverTimeInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + destination_file_type: { + value: cdktf.stringToHclTerraform(this._destinationFileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_type: { + value: cdktf.stringToHclTerraform(this._destinationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket_name: { + value: cdktf.stringToHclTerraform(this._obsBucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_path: { + value: cdktf.stringToHclTerraform(this._obsPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_format: { + value: cdktf.stringToHclTerraform(this._partitionFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + record_delimiter: { + value: cdktf.stringToHclTerraform(this._recordDelimiter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(this._secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_name: { + value: cdktf.stringToHclTerraform(this._taskName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topics: { + value: cdktf.stringToHclTerraform(this._topics), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topics_regex: { + value: cdktf.stringToHclTerraform(this._topicsRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsKafkaSmartConnectTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaSmartConnectTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-smart-connect/README.md b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect/README.md new file mode 100644 index 00000000..8bb15cdb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_smart_connect` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_smart_connect`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-smart-connect/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect/index.ts new file mode 100644 index 00000000..62ff95ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-smart-connect/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaSmartConnectConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the bandwidth of the smart connect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#bandwidth DmsKafkaSmartConnect#bandwidth} + */ + readonly bandwidth?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#id DmsKafkaSmartConnect#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the Kafka instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#instance_id DmsKafkaSmartConnect#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the node count of the smart connect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#node_count DmsKafkaSmartConnect#node_count} + */ + readonly nodeCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#region DmsKafkaSmartConnect#region} + */ + readonly region?: string; + /** + * Specifies the specification code of the smart connect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#storage_spec_code DmsKafkaSmartConnect#storage_spec_code} + */ + readonly storageSpecCode: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#timeouts DmsKafkaSmartConnect#timeouts} + */ + readonly timeouts?: DmsKafkaSmartConnectTimeouts; +} +export interface DmsKafkaSmartConnectTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#create DmsKafkaSmartConnect#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#delete DmsKafkaSmartConnect#delete} + */ + readonly delete?: string; +} + +export function dmsKafkaSmartConnectTimeoutsToTerraform(struct?: DmsKafkaSmartConnectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dmsKafkaSmartConnectTimeoutsToHclTerraform(struct?: DmsKafkaSmartConnectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaSmartConnectTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaSmartConnectTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaSmartConnectTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect huaweicloud_dms_kafka_smart_connect} +*/ +export class DmsKafkaSmartConnect extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_smart_connect"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaSmartConnect resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaSmartConnect to import + * @param importFromId The id of the existing DmsKafkaSmartConnect that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaSmartConnect to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_smart_connect", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_smart_connect huaweicloud_dms_kafka_smart_connect} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaSmartConnectConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaSmartConnectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_smart_connect', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidth = config.bandwidth; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeCount = config.nodeCount; + this._region = config.region; + this._storageSpecCode = config.storageSpecCode; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth - computed: false, optional: true, required: false + private _bandwidth?: string; + public get bandwidth() { + return this.getStringAttribute('bandwidth'); + } + public set bandwidth(value: string) { + this._bandwidth = value; + } + public resetBandwidth() { + this._bandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_count - computed: false, optional: true, required: false + private _nodeCount?: number; + public get nodeCount() { + return this.getNumberAttribute('node_count'); + } + public set nodeCount(value: number) { + this._nodeCount = value; + } + public resetNodeCount() { + this._nodeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeCountInput() { + return this._nodeCount; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_spec_code - computed: false, optional: false, required: true + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaSmartConnectTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaSmartConnectTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth: cdktf.stringToTerraform(this._bandwidth), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_count: cdktf.numberToTerraform(this._nodeCount), + region: cdktf.stringToTerraform(this._region), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + timeouts: dmsKafkaSmartConnectTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth: { + value: cdktf.stringToHclTerraform(this._bandwidth), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_count: { + value: cdktf.numberToHclTerraform(this._nodeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsKafkaSmartConnectTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaSmartConnectTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-topic/README.md b/src/constructs/providers/huaweicloud/dms-kafka-topic/README.md new file mode 100644 index 00000000..d14b42fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-topic/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_topic` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_topic`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-topic/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-topic/index.ts new file mode 100644 index 00000000..b261ebcc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-topic/index.ts @@ -0,0 +1,575 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaTopicConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#aging_time DmsKafkaTopic#aging_time} + */ + readonly agingTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#description DmsKafkaTopic#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#id DmsKafkaTopic#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#instance_id DmsKafkaTopic#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#name DmsKafkaTopic#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#new_partition_brokers DmsKafkaTopic#new_partition_brokers} + */ + readonly newPartitionBrokers?: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#partitions DmsKafkaTopic#partitions} + */ + readonly partitions: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#region DmsKafkaTopic#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#replicas DmsKafkaTopic#replicas} + */ + readonly replicas?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#sync_flushing DmsKafkaTopic#sync_flushing} + */ + readonly syncFlushing?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#sync_replication DmsKafkaTopic#sync_replication} + */ + readonly syncReplication?: boolean | cdktf.IResolvable; + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#configs DmsKafkaTopic#configs} + */ + readonly configs?: DmsKafkaTopicConfigs[] | cdktf.IResolvable; +} +export interface DmsKafkaTopicConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#name DmsKafkaTopic#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#value DmsKafkaTopic#value} + */ + readonly value: string; +} + +export function dmsKafkaTopicConfigsToTerraform(struct?: DmsKafkaTopicConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dmsKafkaTopicConfigsToHclTerraform(struct?: DmsKafkaTopicConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaTopicConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsKafkaTopicConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaTopicConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DmsKafkaTopicConfigsList extends cdktf.ComplexList { + public internalValue? : DmsKafkaTopicConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsKafkaTopicConfigsOutputReference { + return new DmsKafkaTopicConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic huaweicloud_dms_kafka_topic} +*/ +export class DmsKafkaTopic extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_topic"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaTopic resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaTopic to import + * @param importFromId The id of the existing DmsKafkaTopic that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaTopic to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_topic", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_topic huaweicloud_dms_kafka_topic} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaTopicConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaTopicConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_topic', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agingTime = config.agingTime; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._newPartitionBrokers = config.newPartitionBrokers; + this._partitions = config.partitions; + this._region = config.region; + this._replicas = config.replicas; + this._syncFlushing = config.syncFlushing; + this._syncReplication = config.syncReplication; + this._configs.internalValue = config.configs; + } + + // ========== + // ATTRIBUTES + // ========== + + // aging_time - computed: true, optional: true, required: false + private _agingTime?: number; + public get agingTime() { + return this.getNumberAttribute('aging_time'); + } + public set agingTime(value: number) { + this._agingTime = value; + } + public resetAgingTime() { + this._agingTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get agingTimeInput() { + return this._agingTime; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // new_partition_brokers - computed: false, optional: true, required: false + private _newPartitionBrokers?: number[]; + public get newPartitionBrokers() { + return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('new_partition_brokers'))); + } + public set newPartitionBrokers(value: number[]) { + this._newPartitionBrokers = value; + } + public resetNewPartitionBrokers() { + this._newPartitionBrokers = undefined; + } + // Temporarily expose input value. Use with caution. + public get newPartitionBrokersInput() { + return this._newPartitionBrokers; + } + + // partitions - computed: false, optional: false, required: true + private _partitions?: number; + public get partitions() { + return this.getNumberAttribute('partitions'); + } + public set partitions(value: number) { + this._partitions = value; + } + // Temporarily expose input value. Use with caution. + public get partitionsInput() { + return this._partitions; + } + + // policies_only - computed: true, optional: false, required: false + public get policiesOnly() { + return this.getBooleanAttribute('policies_only'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replicas - computed: true, optional: true, required: false + private _replicas?: number; + public get replicas() { + return this.getNumberAttribute('replicas'); + } + public set replicas(value: number) { + this._replicas = value; + } + public resetReplicas() { + this._replicas = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicasInput() { + return this._replicas; + } + + // sync_flushing - computed: true, optional: true, required: false + private _syncFlushing?: boolean | cdktf.IResolvable; + public get syncFlushing() { + return this.getBooleanAttribute('sync_flushing'); + } + public set syncFlushing(value: boolean | cdktf.IResolvable) { + this._syncFlushing = value; + } + public resetSyncFlushing() { + this._syncFlushing = undefined; + } + // Temporarily expose input value. Use with caution. + public get syncFlushingInput() { + return this._syncFlushing; + } + + // sync_replication - computed: true, optional: true, required: false + private _syncReplication?: boolean | cdktf.IResolvable; + public get syncReplication() { + return this.getBooleanAttribute('sync_replication'); + } + public set syncReplication(value: boolean | cdktf.IResolvable) { + this._syncReplication = value; + } + public resetSyncReplication() { + this._syncReplication = undefined; + } + // Temporarily expose input value. Use with caution. + public get syncReplicationInput() { + return this._syncReplication; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // configs - computed: false, optional: true, required: false + private _configs = new DmsKafkaTopicConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: DmsKafkaTopicConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + public resetConfigs() { + this._configs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + aging_time: cdktf.numberToTerraform(this._agingTime), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + new_partition_brokers: cdktf.listMapper(cdktf.numberToTerraform, false)(this._newPartitionBrokers), + partitions: cdktf.numberToTerraform(this._partitions), + region: cdktf.stringToTerraform(this._region), + replicas: cdktf.numberToTerraform(this._replicas), + sync_flushing: cdktf.booleanToTerraform(this._syncFlushing), + sync_replication: cdktf.booleanToTerraform(this._syncReplication), + configs: cdktf.listMapper(dmsKafkaTopicConfigsToTerraform, true)(this._configs.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + aging_time: { + value: cdktf.numberToHclTerraform(this._agingTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + new_partition_brokers: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(this._newPartitionBrokers), + isBlock: false, + type: "set", + storageClassType: "numberList", + }, + partitions: { + value: cdktf.numberToHclTerraform(this._partitions), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replicas: { + value: cdktf.numberToHclTerraform(this._replicas), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sync_flushing: { + value: cdktf.booleanToHclTerraform(this._syncFlushing), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + sync_replication: { + value: cdktf.booleanToHclTerraform(this._syncReplication), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + configs: { + value: cdktf.listMapperHcl(dmsKafkaTopicConfigsToHclTerraform, true)(this._configs.internalValue), + isBlock: true, + type: "set", + storageClassType: "DmsKafkaTopicConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/README.md b/src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/README.md new file mode 100644 index 00000000..ef222f59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_user_client_quota` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_user_client_quota`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/index.ts new file mode 100644 index 00000000..17e9a4df --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-user-client-quota/index.ts @@ -0,0 +1,541 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaUserClientQuotaConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the client to which the quota applies. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#client DmsKafkaUserClientQuota#client} + */ + readonly client?: string; + /** + * Specifies the client default configuration of the quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#client_default DmsKafkaUserClientQuota#client_default} + */ + readonly clientDefault?: boolean | cdktf.IResolvable; + /** + * Specifies an upper limit on the consumption rate. The unit is B/s. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#consumer_byte_rate DmsKafkaUserClientQuota#consumer_byte_rate} + */ + readonly consumerByteRate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#id DmsKafkaUserClientQuota#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the Kafka instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#instance_id DmsKafkaUserClientQuota#instance_id} + */ + readonly instanceId: string; + /** + * Specifies an upper limit on the prodction rate. The unit is B/s. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#producer_byte_rate DmsKafkaUserClientQuota#producer_byte_rate} + */ + readonly producerByteRate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#region DmsKafkaUserClientQuota#region} + */ + readonly region?: string; + /** + * Specifies the user name to apply the quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#user DmsKafkaUserClientQuota#user} + */ + readonly user?: string; + /** + * Specifies the user default configuration of the quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#user_default DmsKafkaUserClientQuota#user_default} + */ + readonly userDefault?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#timeouts DmsKafkaUserClientQuota#timeouts} + */ + readonly timeouts?: DmsKafkaUserClientQuotaTimeouts; +} +export interface DmsKafkaUserClientQuotaTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#create DmsKafkaUserClientQuota#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#delete DmsKafkaUserClientQuota#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#update DmsKafkaUserClientQuota#update} + */ + readonly update?: string; +} + +export function dmsKafkaUserClientQuotaTimeoutsToTerraform(struct?: DmsKafkaUserClientQuotaTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dmsKafkaUserClientQuotaTimeoutsToHclTerraform(struct?: DmsKafkaUserClientQuotaTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkaUserClientQuotaTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkaUserClientQuotaTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkaUserClientQuotaTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota huaweicloud_dms_kafka_user_client_quota} +*/ +export class DmsKafkaUserClientQuota extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_user_client_quota"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaUserClientQuota resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaUserClientQuota to import + * @param importFromId The id of the existing DmsKafkaUserClientQuota that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaUserClientQuota to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_user_client_quota", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user_client_quota huaweicloud_dms_kafka_user_client_quota} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaUserClientQuotaConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaUserClientQuotaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_user_client_quota', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._client = config.client; + this._clientDefault = config.clientDefault; + this._consumerByteRate = config.consumerByteRate; + this._id = config.id; + this._instanceId = config.instanceId; + this._producerByteRate = config.producerByteRate; + this._region = config.region; + this._user = config.user; + this._userDefault = config.userDefault; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // client - computed: false, optional: true, required: false + private _client?: string; + public get client() { + return this.getStringAttribute('client'); + } + public set client(value: string) { + this._client = value; + } + public resetClient() { + this._client = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientInput() { + return this._client; + } + + // client_default - computed: false, optional: true, required: false + private _clientDefault?: boolean | cdktf.IResolvable; + public get clientDefault() { + return this.getBooleanAttribute('client_default'); + } + public set clientDefault(value: boolean | cdktf.IResolvable) { + this._clientDefault = value; + } + public resetClientDefault() { + this._clientDefault = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientDefaultInput() { + return this._clientDefault; + } + + // consumer_byte_rate - computed: true, optional: true, required: false + private _consumerByteRate?: number; + public get consumerByteRate() { + return this.getNumberAttribute('consumer_byte_rate'); + } + public set consumerByteRate(value: number) { + this._consumerByteRate = value; + } + public resetConsumerByteRate() { + this._consumerByteRate = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumerByteRateInput() { + return this._consumerByteRate; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // producer_byte_rate - computed: true, optional: true, required: false + private _producerByteRate?: number; + public get producerByteRate() { + return this.getNumberAttribute('producer_byte_rate'); + } + public set producerByteRate(value: number) { + this._producerByteRate = value; + } + public resetProducerByteRate() { + this._producerByteRate = undefined; + } + // Temporarily expose input value. Use with caution. + public get producerByteRateInput() { + return this._producerByteRate; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // user_default - computed: false, optional: true, required: false + private _userDefault?: boolean | cdktf.IResolvable; + public get userDefault() { + return this.getBooleanAttribute('user_default'); + } + public set userDefault(value: boolean | cdktf.IResolvable) { + this._userDefault = value; + } + public resetUserDefault() { + this._userDefault = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDefaultInput() { + return this._userDefault; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkaUserClientQuotaTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkaUserClientQuotaTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + client: cdktf.stringToTerraform(this._client), + client_default: cdktf.booleanToTerraform(this._clientDefault), + consumer_byte_rate: cdktf.numberToTerraform(this._consumerByteRate), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + producer_byte_rate: cdktf.numberToTerraform(this._producerByteRate), + region: cdktf.stringToTerraform(this._region), + user: cdktf.stringToTerraform(this._user), + user_default: cdktf.booleanToTerraform(this._userDefault), + timeouts: dmsKafkaUserClientQuotaTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + client: { + value: cdktf.stringToHclTerraform(this._client), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_default: { + value: cdktf.booleanToHclTerraform(this._clientDefault), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + consumer_byte_rate: { + value: cdktf.numberToHclTerraform(this._consumerByteRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + producer_byte_rate: { + value: cdktf.numberToHclTerraform(this._producerByteRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(this._user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_default: { + value: cdktf.booleanToHclTerraform(this._userDefault), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: dmsKafkaUserClientQuotaTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkaUserClientQuotaTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafka-user/README.md b/src/constructs/providers/huaweicloud/dms-kafka-user/README.md new file mode 100644 index 00000000..215398b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafka_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafka_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user). diff --git a/src/constructs/providers/huaweicloud/dms-kafka-user/index.ts b/src/constructs/providers/huaweicloud/dms-kafka-user/index.ts new file mode 100644 index 00000000..596a80cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafka-user/index.ts @@ -0,0 +1,262 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkaUserConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#description DmsKafkaUser#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#id DmsKafkaUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#instance_id DmsKafkaUser#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#name DmsKafkaUser#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#password DmsKafkaUser#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#region DmsKafkaUser#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user huaweicloud_dms_kafka_user} +*/ +export class DmsKafkaUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafka_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkaUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkaUser to import + * @param importFromId The id of the existing DmsKafkaUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkaUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafka_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafka_user huaweicloud_dms_kafka_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkaUserConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkaUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafka_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_app - computed: true, optional: false, required: false + public get defaultApp() { + return this.getBooleanAttribute('default_app'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/README.md b/src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/README.md new file mode 100644 index 00000000..1c2d05f6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_kafkav2_smart_connect_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_kafkav2_smart_connect_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task). diff --git a/src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/index.ts b/src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/index.ts new file mode 100644 index 00000000..3c756873 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-kafkav2-smart-connect-task/index.ts @@ -0,0 +1,1629 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsKafkav2SmartConnectTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the destination type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#destination_type DmsKafkav2SmartConnectTask#destination_type} + */ + readonly destinationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#id DmsKafkav2SmartConnectTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the kafka instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#instance_id DmsKafkav2SmartConnectTask#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#region DmsKafkav2SmartConnectTask#region} + */ + readonly region?: string; + /** + * Specifies the source type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#source_type DmsKafkav2SmartConnectTask#source_type} + */ + readonly sourceType?: string; + /** + * Specifies whether to start a task later. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#start_later DmsKafkav2SmartConnectTask#start_later} + */ + readonly startLater?: boolean | cdktf.IResolvable; + /** + * Specifies the smart connect task name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#task_name DmsKafkav2SmartConnectTask#task_name} + */ + readonly taskName: string; + /** + * Specifies the topics list of the task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#topics DmsKafkav2SmartConnectTask#topics} + */ + readonly topics?: string[]; + /** + * Specifies the topics regular expression of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#topics_regex DmsKafkav2SmartConnectTask#topics_regex} + */ + readonly topicsRegex?: string; + /** + * destination_task block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#destination_task DmsKafkav2SmartConnectTask#destination_task} + */ + readonly destinationTask?: DmsKafkav2SmartConnectTaskDestinationTask; + /** + * source_task block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#source_task DmsKafkav2SmartConnectTask#source_task} + */ + readonly sourceTask?: DmsKafkav2SmartConnectTaskSourceTask; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#timeouts DmsKafkav2SmartConnectTask#timeouts} + */ + readonly timeouts?: DmsKafkav2SmartConnectTaskTimeouts; +} +export interface DmsKafkav2SmartConnectTaskDestinationTask { + /** + * Specifies the access key used to access the OBS bucket. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#access_key DmsKafkav2SmartConnectTask#access_key} + */ + readonly accessKey?: string; + /** + * Specifies the consumer strategy of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#consumer_strategy DmsKafkav2SmartConnectTask#consumer_strategy} + */ + readonly consumerStrategy?: string; + /** + * Specifies the deliver time interval of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#deliver_time_interval DmsKafkav2SmartConnectTask#deliver_time_interval} + */ + readonly deliverTimeInterval?: number; + /** + * Specifies the destination file type of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#destination_file_type DmsKafkav2SmartConnectTask#destination_file_type} + */ + readonly destinationFileType?: string; + /** + * Specifies the obs bucket name of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#obs_bucket_name DmsKafkav2SmartConnectTask#obs_bucket_name} + */ + readonly obsBucketName?: string; + /** + * Specifies the obs path of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#obs_path DmsKafkav2SmartConnectTask#obs_path} + */ + readonly obsPath?: string; + /** + * Specifies the partiton format of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#partition_format DmsKafkav2SmartConnectTask#partition_format} + */ + readonly partitionFormat?: string; + /** + * Specifies the record delimiter of the smart connect task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#record_delimiter DmsKafkav2SmartConnectTask#record_delimiter} + */ + readonly recordDelimiter?: string; + /** + * Specifies the secret access key used to access the OBS bucket. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#secret_key DmsKafkav2SmartConnectTask#secret_key} + */ + readonly secretKey?: string; + /** + * Specifies whether to store keys. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#store_keys DmsKafkav2SmartConnectTask#store_keys} + */ + readonly storeKeys?: boolean | cdktf.IResolvable; +} + +export function dmsKafkav2SmartConnectTaskDestinationTaskToTerraform(struct?: DmsKafkav2SmartConnectTaskDestinationTaskOutputReference | DmsKafkav2SmartConnectTaskDestinationTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_key: cdktf.stringToTerraform(struct!.accessKey), + consumer_strategy: cdktf.stringToTerraform(struct!.consumerStrategy), + deliver_time_interval: cdktf.numberToTerraform(struct!.deliverTimeInterval), + destination_file_type: cdktf.stringToTerraform(struct!.destinationFileType), + obs_bucket_name: cdktf.stringToTerraform(struct!.obsBucketName), + obs_path: cdktf.stringToTerraform(struct!.obsPath), + partition_format: cdktf.stringToTerraform(struct!.partitionFormat), + record_delimiter: cdktf.stringToTerraform(struct!.recordDelimiter), + secret_key: cdktf.stringToTerraform(struct!.secretKey), + store_keys: cdktf.booleanToTerraform(struct!.storeKeys), + } +} + + +export function dmsKafkav2SmartConnectTaskDestinationTaskToHclTerraform(struct?: DmsKafkav2SmartConnectTaskDestinationTaskOutputReference | DmsKafkav2SmartConnectTaskDestinationTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(struct!.accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consumer_strategy: { + value: cdktf.stringToHclTerraform(struct!.consumerStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deliver_time_interval: { + value: cdktf.numberToHclTerraform(struct!.deliverTimeInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + destination_file_type: { + value: cdktf.stringToHclTerraform(struct!.destinationFileType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket_name: { + value: cdktf.stringToHclTerraform(struct!.obsBucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_path: { + value: cdktf.stringToHclTerraform(struct!.obsPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_format: { + value: cdktf.stringToHclTerraform(struct!.partitionFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + record_delimiter: { + value: cdktf.stringToHclTerraform(struct!.recordDelimiter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(struct!.secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + store_keys: { + value: cdktf.booleanToHclTerraform(struct!.storeKeys), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkav2SmartConnectTaskDestinationTaskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DmsKafkav2SmartConnectTaskDestinationTask | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessKey !== undefined) { + hasAnyValues = true; + internalValueResult.accessKey = this._accessKey; + } + if (this._consumerStrategy !== undefined) { + hasAnyValues = true; + internalValueResult.consumerStrategy = this._consumerStrategy; + } + if (this._deliverTimeInterval !== undefined) { + hasAnyValues = true; + internalValueResult.deliverTimeInterval = this._deliverTimeInterval; + } + if (this._destinationFileType !== undefined) { + hasAnyValues = true; + internalValueResult.destinationFileType = this._destinationFileType; + } + if (this._obsBucketName !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketName = this._obsBucketName; + } + if (this._obsPath !== undefined) { + hasAnyValues = true; + internalValueResult.obsPath = this._obsPath; + } + if (this._partitionFormat !== undefined) { + hasAnyValues = true; + internalValueResult.partitionFormat = this._partitionFormat; + } + if (this._recordDelimiter !== undefined) { + hasAnyValues = true; + internalValueResult.recordDelimiter = this._recordDelimiter; + } + if (this._secretKey !== undefined) { + hasAnyValues = true; + internalValueResult.secretKey = this._secretKey; + } + if (this._storeKeys !== undefined) { + hasAnyValues = true; + internalValueResult.storeKeys = this._storeKeys; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkav2SmartConnectTaskDestinationTask | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessKey = undefined; + this._consumerStrategy = undefined; + this._deliverTimeInterval = undefined; + this._destinationFileType = undefined; + this._obsBucketName = undefined; + this._obsPath = undefined; + this._partitionFormat = undefined; + this._recordDelimiter = undefined; + this._secretKey = undefined; + this._storeKeys = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessKey = value.accessKey; + this._consumerStrategy = value.consumerStrategy; + this._deliverTimeInterval = value.deliverTimeInterval; + this._destinationFileType = value.destinationFileType; + this._obsBucketName = value.obsBucketName; + this._obsPath = value.obsPath; + this._partitionFormat = value.partitionFormat; + this._recordDelimiter = value.recordDelimiter; + this._secretKey = value.secretKey; + this._storeKeys = value.storeKeys; + } + } + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // consumer_strategy - computed: false, optional: true, required: false + private _consumerStrategy?: string; + public get consumerStrategy() { + return this.getStringAttribute('consumer_strategy'); + } + public set consumerStrategy(value: string) { + this._consumerStrategy = value; + } + public resetConsumerStrategy() { + this._consumerStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumerStrategyInput() { + return this._consumerStrategy; + } + + // deliver_time_interval - computed: false, optional: true, required: false + private _deliverTimeInterval?: number; + public get deliverTimeInterval() { + return this.getNumberAttribute('deliver_time_interval'); + } + public set deliverTimeInterval(value: number) { + this._deliverTimeInterval = value; + } + public resetDeliverTimeInterval() { + this._deliverTimeInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get deliverTimeIntervalInput() { + return this._deliverTimeInterval; + } + + // destination_file_type - computed: false, optional: true, required: false + private _destinationFileType?: string; + public get destinationFileType() { + return this.getStringAttribute('destination_file_type'); + } + public set destinationFileType(value: string) { + this._destinationFileType = value; + } + public resetDestinationFileType() { + this._destinationFileType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationFileTypeInput() { + return this._destinationFileType; + } + + // flush_size - computed: true, optional: false, required: false + public get flushSize() { + return this.getNumberAttribute('flush_size'); + } + + // key_converter - computed: true, optional: false, required: false + public get keyConverter() { + return this.getStringAttribute('key_converter'); + } + + // kv_delimiter - computed: true, optional: false, required: false + public get kvDelimiter() { + return this.getStringAttribute('kv_delimiter'); + } + + // obs_bucket_name - computed: false, optional: true, required: false + private _obsBucketName?: string; + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + public set obsBucketName(value: string) { + this._obsBucketName = value; + } + public resetObsBucketName() { + this._obsBucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketNameInput() { + return this._obsBucketName; + } + + // obs_part_size - computed: true, optional: false, required: false + public get obsPartSize() { + return this.getNumberAttribute('obs_part_size'); + } + + // obs_path - computed: false, optional: true, required: false + private _obsPath?: string; + public get obsPath() { + return this.getStringAttribute('obs_path'); + } + public set obsPath(value: string) { + this._obsPath = value; + } + public resetObsPath() { + this._obsPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsPathInput() { + return this._obsPath; + } + + // partition_format - computed: false, optional: true, required: false + private _partitionFormat?: string; + public get partitionFormat() { + return this.getStringAttribute('partition_format'); + } + public set partitionFormat(value: string) { + this._partitionFormat = value; + } + public resetPartitionFormat() { + this._partitionFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionFormatInput() { + return this._partitionFormat; + } + + // partitioner_class - computed: true, optional: false, required: false + public get partitionerClass() { + return this.getStringAttribute('partitioner_class'); + } + + // record_delimiter - computed: false, optional: true, required: false + private _recordDelimiter?: string; + public get recordDelimiter() { + return this.getStringAttribute('record_delimiter'); + } + public set recordDelimiter(value: string) { + this._recordDelimiter = value; + } + public resetRecordDelimiter() { + this._recordDelimiter = undefined; + } + // Temporarily expose input value. Use with caution. + public get recordDelimiterInput() { + return this._recordDelimiter; + } + + // schema_generator_class - computed: true, optional: false, required: false + public get schemaGeneratorClass() { + return this.getStringAttribute('schema_generator_class'); + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // store_keys - computed: false, optional: true, required: false + private _storeKeys?: boolean | cdktf.IResolvable; + public get storeKeys() { + return this.getBooleanAttribute('store_keys'); + } + public set storeKeys(value: boolean | cdktf.IResolvable) { + this._storeKeys = value; + } + public resetStoreKeys() { + this._storeKeys = undefined; + } + // Temporarily expose input value. Use with caution. + public get storeKeysInput() { + return this._storeKeys; + } + + // timezone - computed: true, optional: false, required: false + public get timezone() { + return this.getStringAttribute('timezone'); + } + + // value_converter - computed: true, optional: false, required: false + public get valueConverter() { + return this.getStringAttribute('value_converter'); + } +} +export interface DmsKafkav2SmartConnectTaskSourceTask { + /** + * Specifies the compression algorithm to use for copying messages. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#compression_type DmsKafkav2SmartConnectTask#compression_type} + */ + readonly compressionType?: string; + /** + * Specifies the start offset. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#consumer_strategy DmsKafkav2SmartConnectTask#consumer_strategy} + */ + readonly consumerStrategy?: string; + /** + * Specifies the current Kafka instance alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#current_instance_alias DmsKafkav2SmartConnectTask#current_instance_alias} + */ + readonly currentInstanceAlias?: string; + /** + * Specifies the sync direction. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#direction DmsKafkav2SmartConnectTask#direction} + */ + readonly direction?: string; + /** + * Specifies the peer Kafka user password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#password DmsKafkav2SmartConnectTask#password} + */ + readonly password?: string; + /** + * Specifies the peer Kafka instance address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#peer_instance_address DmsKafkav2SmartConnectTask#peer_instance_address} + */ + readonly peerInstanceAddress?: string[]; + /** + * Specifies the peer Kafka instance alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#peer_instance_alias DmsKafkav2SmartConnectTask#peer_instance_alias} + */ + readonly peerInstanceAlias?: string; + /** + * Specifies the peer Kafka instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#peer_instance_id DmsKafkav2SmartConnectTask#peer_instance_id} + */ + readonly peerInstanceId?: string; + /** + * Specifies whether the message header contains the message source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#provenance_header_enabled DmsKafkav2SmartConnectTask#provenance_header_enabled} + */ + readonly provenanceHeaderEnabled?: boolean | cdktf.IResolvable; + /** + * Specifies whether to rename the topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#rename_topic_enabled DmsKafkav2SmartConnectTask#rename_topic_enabled} + */ + readonly renameTopicEnabled?: boolean | cdktf.IResolvable; + /** + * Specifies the number of topic replicas. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#replication_factor DmsKafkav2SmartConnectTask#replication_factor} + */ + readonly replicationFactor?: number; + /** + * Specifies the peer Kafka authentication mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#sasl_mechanism DmsKafkav2SmartConnectTask#sasl_mechanism} + */ + readonly saslMechanism?: string; + /** + * Specifies the peer Kafka authentication. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#security_protocol DmsKafkav2SmartConnectTask#security_protocol} + */ + readonly securityProtocol?: string; + /** + * Specifies whether to sync the consumption progress. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#sync_consumer_offsets_enabled DmsKafkav2SmartConnectTask#sync_consumer_offsets_enabled} + */ + readonly syncConsumerOffsetsEnabled?: boolean | cdktf.IResolvable; + /** + * Specifies the number of data replication tasks. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#task_num DmsKafkav2SmartConnectTask#task_num} + */ + readonly taskNum?: number; + /** + * Specifies the topic mapping, which is used to customize the target topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#topics_mapping DmsKafkav2SmartConnectTask#topics_mapping} + */ + readonly topicsMapping?: string[]; + /** + * Specifies the peer Kafka username. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#user_name DmsKafkav2SmartConnectTask#user_name} + */ + readonly userName?: string; +} + +export function dmsKafkav2SmartConnectTaskSourceTaskToTerraform(struct?: DmsKafkav2SmartConnectTaskSourceTaskOutputReference | DmsKafkav2SmartConnectTaskSourceTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + compression_type: cdktf.stringToTerraform(struct!.compressionType), + consumer_strategy: cdktf.stringToTerraform(struct!.consumerStrategy), + current_instance_alias: cdktf.stringToTerraform(struct!.currentInstanceAlias), + direction: cdktf.stringToTerraform(struct!.direction), + password: cdktf.stringToTerraform(struct!.password), + peer_instance_address: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.peerInstanceAddress), + peer_instance_alias: cdktf.stringToTerraform(struct!.peerInstanceAlias), + peer_instance_id: cdktf.stringToTerraform(struct!.peerInstanceId), + provenance_header_enabled: cdktf.booleanToTerraform(struct!.provenanceHeaderEnabled), + rename_topic_enabled: cdktf.booleanToTerraform(struct!.renameTopicEnabled), + replication_factor: cdktf.numberToTerraform(struct!.replicationFactor), + sasl_mechanism: cdktf.stringToTerraform(struct!.saslMechanism), + security_protocol: cdktf.stringToTerraform(struct!.securityProtocol), + sync_consumer_offsets_enabled: cdktf.booleanToTerraform(struct!.syncConsumerOffsetsEnabled), + task_num: cdktf.numberToTerraform(struct!.taskNum), + topics_mapping: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.topicsMapping), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function dmsKafkav2SmartConnectTaskSourceTaskToHclTerraform(struct?: DmsKafkav2SmartConnectTaskSourceTaskOutputReference | DmsKafkav2SmartConnectTaskSourceTask): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + compression_type: { + value: cdktf.stringToHclTerraform(struct!.compressionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consumer_strategy: { + value: cdktf.stringToHclTerraform(struct!.consumerStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + current_instance_alias: { + value: cdktf.stringToHclTerraform(struct!.currentInstanceAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(struct!.direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_instance_address: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.peerInstanceAddress), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + peer_instance_alias: { + value: cdktf.stringToHclTerraform(struct!.peerInstanceAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_instance_id: { + value: cdktf.stringToHclTerraform(struct!.peerInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provenance_header_enabled: { + value: cdktf.booleanToHclTerraform(struct!.provenanceHeaderEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + rename_topic_enabled: { + value: cdktf.booleanToHclTerraform(struct!.renameTopicEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + replication_factor: { + value: cdktf.numberToHclTerraform(struct!.replicationFactor), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sasl_mechanism: { + value: cdktf.stringToHclTerraform(struct!.saslMechanism), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_protocol: { + value: cdktf.stringToHclTerraform(struct!.securityProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sync_consumer_offsets_enabled: { + value: cdktf.booleanToHclTerraform(struct!.syncConsumerOffsetsEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + task_num: { + value: cdktf.numberToHclTerraform(struct!.taskNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + topics_mapping: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.topicsMapping), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkav2SmartConnectTaskSourceTaskOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DmsKafkav2SmartConnectTaskSourceTask | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._compressionType !== undefined) { + hasAnyValues = true; + internalValueResult.compressionType = this._compressionType; + } + if (this._consumerStrategy !== undefined) { + hasAnyValues = true; + internalValueResult.consumerStrategy = this._consumerStrategy; + } + if (this._currentInstanceAlias !== undefined) { + hasAnyValues = true; + internalValueResult.currentInstanceAlias = this._currentInstanceAlias; + } + if (this._direction !== undefined) { + hasAnyValues = true; + internalValueResult.direction = this._direction; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._peerInstanceAddress !== undefined) { + hasAnyValues = true; + internalValueResult.peerInstanceAddress = this._peerInstanceAddress; + } + if (this._peerInstanceAlias !== undefined) { + hasAnyValues = true; + internalValueResult.peerInstanceAlias = this._peerInstanceAlias; + } + if (this._peerInstanceId !== undefined) { + hasAnyValues = true; + internalValueResult.peerInstanceId = this._peerInstanceId; + } + if (this._provenanceHeaderEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.provenanceHeaderEnabled = this._provenanceHeaderEnabled; + } + if (this._renameTopicEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.renameTopicEnabled = this._renameTopicEnabled; + } + if (this._replicationFactor !== undefined) { + hasAnyValues = true; + internalValueResult.replicationFactor = this._replicationFactor; + } + if (this._saslMechanism !== undefined) { + hasAnyValues = true; + internalValueResult.saslMechanism = this._saslMechanism; + } + if (this._securityProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.securityProtocol = this._securityProtocol; + } + if (this._syncConsumerOffsetsEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.syncConsumerOffsetsEnabled = this._syncConsumerOffsetsEnabled; + } + if (this._taskNum !== undefined) { + hasAnyValues = true; + internalValueResult.taskNum = this._taskNum; + } + if (this._topicsMapping !== undefined) { + hasAnyValues = true; + internalValueResult.topicsMapping = this._topicsMapping; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkav2SmartConnectTaskSourceTask | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._compressionType = undefined; + this._consumerStrategy = undefined; + this._currentInstanceAlias = undefined; + this._direction = undefined; + this._password = undefined; + this._peerInstanceAddress = undefined; + this._peerInstanceAlias = undefined; + this._peerInstanceId = undefined; + this._provenanceHeaderEnabled = undefined; + this._renameTopicEnabled = undefined; + this._replicationFactor = undefined; + this._saslMechanism = undefined; + this._securityProtocol = undefined; + this._syncConsumerOffsetsEnabled = undefined; + this._taskNum = undefined; + this._topicsMapping = undefined; + this._userName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._compressionType = value.compressionType; + this._consumerStrategy = value.consumerStrategy; + this._currentInstanceAlias = value.currentInstanceAlias; + this._direction = value.direction; + this._password = value.password; + this._peerInstanceAddress = value.peerInstanceAddress; + this._peerInstanceAlias = value.peerInstanceAlias; + this._peerInstanceId = value.peerInstanceId; + this._provenanceHeaderEnabled = value.provenanceHeaderEnabled; + this._renameTopicEnabled = value.renameTopicEnabled; + this._replicationFactor = value.replicationFactor; + this._saslMechanism = value.saslMechanism; + this._securityProtocol = value.securityProtocol; + this._syncConsumerOffsetsEnabled = value.syncConsumerOffsetsEnabled; + this._taskNum = value.taskNum; + this._topicsMapping = value.topicsMapping; + this._userName = value.userName; + } + } + + // compression_type - computed: true, optional: true, required: false + private _compressionType?: string; + public get compressionType() { + return this.getStringAttribute('compression_type'); + } + public set compressionType(value: string) { + this._compressionType = value; + } + public resetCompressionType() { + this._compressionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get compressionTypeInput() { + return this._compressionType; + } + + // consumer_strategy - computed: true, optional: true, required: false + private _consumerStrategy?: string; + public get consumerStrategy() { + return this.getStringAttribute('consumer_strategy'); + } + public set consumerStrategy(value: string) { + this._consumerStrategy = value; + } + public resetConsumerStrategy() { + this._consumerStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumerStrategyInput() { + return this._consumerStrategy; + } + + // current_instance_alias - computed: true, optional: true, required: false + private _currentInstanceAlias?: string; + public get currentInstanceAlias() { + return this.getStringAttribute('current_instance_alias'); + } + public set currentInstanceAlias(value: string) { + this._currentInstanceAlias = value; + } + public resetCurrentInstanceAlias() { + this._currentInstanceAlias = undefined; + } + // Temporarily expose input value. Use with caution. + public get currentInstanceAliasInput() { + return this._currentInstanceAlias; + } + + // direction - computed: true, optional: true, required: false + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + public resetDirection() { + this._direction = undefined; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // peer_instance_address - computed: true, optional: true, required: false + private _peerInstanceAddress?: string[]; + public get peerInstanceAddress() { + return cdktf.Fn.tolist(this.getListAttribute('peer_instance_address')); + } + public set peerInstanceAddress(value: string[]) { + this._peerInstanceAddress = value; + } + public resetPeerInstanceAddress() { + this._peerInstanceAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerInstanceAddressInput() { + return this._peerInstanceAddress; + } + + // peer_instance_alias - computed: true, optional: true, required: false + private _peerInstanceAlias?: string; + public get peerInstanceAlias() { + return this.getStringAttribute('peer_instance_alias'); + } + public set peerInstanceAlias(value: string) { + this._peerInstanceAlias = value; + } + public resetPeerInstanceAlias() { + this._peerInstanceAlias = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerInstanceAliasInput() { + return this._peerInstanceAlias; + } + + // peer_instance_id - computed: false, optional: true, required: false + private _peerInstanceId?: string; + public get peerInstanceId() { + return this.getStringAttribute('peer_instance_id'); + } + public set peerInstanceId(value: string) { + this._peerInstanceId = value; + } + public resetPeerInstanceId() { + this._peerInstanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerInstanceIdInput() { + return this._peerInstanceId; + } + + // provenance_header_enabled - computed: true, optional: true, required: false + private _provenanceHeaderEnabled?: boolean | cdktf.IResolvable; + public get provenanceHeaderEnabled() { + return this.getBooleanAttribute('provenance_header_enabled'); + } + public set provenanceHeaderEnabled(value: boolean | cdktf.IResolvable) { + this._provenanceHeaderEnabled = value; + } + public resetProvenanceHeaderEnabled() { + this._provenanceHeaderEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get provenanceHeaderEnabledInput() { + return this._provenanceHeaderEnabled; + } + + // rename_topic_enabled - computed: true, optional: true, required: false + private _renameTopicEnabled?: boolean | cdktf.IResolvable; + public get renameTopicEnabled() { + return this.getBooleanAttribute('rename_topic_enabled'); + } + public set renameTopicEnabled(value: boolean | cdktf.IResolvable) { + this._renameTopicEnabled = value; + } + public resetRenameTopicEnabled() { + this._renameTopicEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get renameTopicEnabledInput() { + return this._renameTopicEnabled; + } + + // replication_factor - computed: false, optional: true, required: false + private _replicationFactor?: number; + public get replicationFactor() { + return this.getNumberAttribute('replication_factor'); + } + public set replicationFactor(value: number) { + this._replicationFactor = value; + } + public resetReplicationFactor() { + this._replicationFactor = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicationFactorInput() { + return this._replicationFactor; + } + + // sasl_mechanism - computed: true, optional: true, required: false + private _saslMechanism?: string; + public get saslMechanism() { + return this.getStringAttribute('sasl_mechanism'); + } + public set saslMechanism(value: string) { + this._saslMechanism = value; + } + public resetSaslMechanism() { + this._saslMechanism = undefined; + } + // Temporarily expose input value. Use with caution. + public get saslMechanismInput() { + return this._saslMechanism; + } + + // security_protocol - computed: true, optional: true, required: false + private _securityProtocol?: string; + public get securityProtocol() { + return this.getStringAttribute('security_protocol'); + } + public set securityProtocol(value: string) { + this._securityProtocol = value; + } + public resetSecurityProtocol() { + this._securityProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityProtocolInput() { + return this._securityProtocol; + } + + // sync_consumer_offsets_enabled - computed: true, optional: true, required: false + private _syncConsumerOffsetsEnabled?: boolean | cdktf.IResolvable; + public get syncConsumerOffsetsEnabled() { + return this.getBooleanAttribute('sync_consumer_offsets_enabled'); + } + public set syncConsumerOffsetsEnabled(value: boolean | cdktf.IResolvable) { + this._syncConsumerOffsetsEnabled = value; + } + public resetSyncConsumerOffsetsEnabled() { + this._syncConsumerOffsetsEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get syncConsumerOffsetsEnabledInput() { + return this._syncConsumerOffsetsEnabled; + } + + // task_num - computed: false, optional: true, required: false + private _taskNum?: number; + public get taskNum() { + return this.getNumberAttribute('task_num'); + } + public set taskNum(value: number) { + this._taskNum = value; + } + public resetTaskNum() { + this._taskNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get taskNumInput() { + return this._taskNum; + } + + // topics_mapping - computed: false, optional: true, required: false + private _topicsMapping?: string[]; + public get topicsMapping() { + return cdktf.Fn.tolist(this.getListAttribute('topics_mapping')); + } + public set topicsMapping(value: string[]) { + this._topicsMapping = value; + } + public resetTopicsMapping() { + this._topicsMapping = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicsMappingInput() { + return this._topicsMapping; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} +export interface DmsKafkav2SmartConnectTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#create DmsKafkav2SmartConnectTask#create} + */ + readonly create?: string; +} + +export function dmsKafkav2SmartConnectTaskTimeoutsToTerraform(struct?: DmsKafkav2SmartConnectTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dmsKafkav2SmartConnectTaskTimeoutsToHclTerraform(struct?: DmsKafkav2SmartConnectTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsKafkav2SmartConnectTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsKafkav2SmartConnectTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsKafkav2SmartConnectTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task huaweicloud_dms_kafkav2_smart_connect_task} +*/ +export class DmsKafkav2SmartConnectTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_kafkav2_smart_connect_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsKafkav2SmartConnectTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsKafkav2SmartConnectTask to import + * @param importFromId The id of the existing DmsKafkav2SmartConnectTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsKafkav2SmartConnectTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_kafkav2_smart_connect_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_kafkav2_smart_connect_task huaweicloud_dms_kafkav2_smart_connect_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsKafkav2SmartConnectTaskConfig + */ + public constructor(scope: Construct, id: string, config: DmsKafkav2SmartConnectTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_kafkav2_smart_connect_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destinationType = config.destinationType; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._sourceType = config.sourceType; + this._startLater = config.startLater; + this._taskName = config.taskName; + this._topics = config.topics; + this._topicsRegex = config.topicsRegex; + this._destinationTask.internalValue = config.destinationTask; + this._sourceTask.internalValue = config.sourceTask; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // destination_type - computed: true, optional: true, required: false + private _destinationType?: string; + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + public set destinationType(value: string) { + this._destinationType = value; + } + public resetDestinationType() { + this._destinationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationTypeInput() { + return this._destinationType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_type - computed: true, optional: true, required: false + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // start_later - computed: false, optional: true, required: false + private _startLater?: boolean | cdktf.IResolvable; + public get startLater() { + return this.getBooleanAttribute('start_later'); + } + public set startLater(value: boolean | cdktf.IResolvable) { + this._startLater = value; + } + public resetStartLater() { + this._startLater = undefined; + } + // Temporarily expose input value. Use with caution. + public get startLaterInput() { + return this._startLater; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // task_name - computed: false, optional: false, required: true + private _taskName?: string; + public get taskName() { + return this.getStringAttribute('task_name'); + } + public set taskName(value: string) { + this._taskName = value; + } + // Temporarily expose input value. Use with caution. + public get taskNameInput() { + return this._taskName; + } + + // topics - computed: false, optional: true, required: false + private _topics?: string[]; + public get topics() { + return cdktf.Fn.tolist(this.getListAttribute('topics')); + } + public set topics(value: string[]) { + this._topics = value; + } + public resetTopics() { + this._topics = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicsInput() { + return this._topics; + } + + // topics_regex - computed: false, optional: true, required: false + private _topicsRegex?: string; + public get topicsRegex() { + return this.getStringAttribute('topics_regex'); + } + public set topicsRegex(value: string) { + this._topicsRegex = value; + } + public resetTopicsRegex() { + this._topicsRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicsRegexInput() { + return this._topicsRegex; + } + + // destination_task - computed: false, optional: true, required: false + private _destinationTask = new DmsKafkav2SmartConnectTaskDestinationTaskOutputReference(this, "destination_task"); + public get destinationTask() { + return this._destinationTask; + } + public putDestinationTask(value: DmsKafkav2SmartConnectTaskDestinationTask) { + this._destinationTask.internalValue = value; + } + public resetDestinationTask() { + this._destinationTask.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationTaskInput() { + return this._destinationTask.internalValue; + } + + // source_task - computed: false, optional: true, required: false + private _sourceTask = new DmsKafkav2SmartConnectTaskSourceTaskOutputReference(this, "source_task"); + public get sourceTask() { + return this._sourceTask; + } + public putSourceTask(value: DmsKafkav2SmartConnectTaskSourceTask) { + this._sourceTask.internalValue = value; + } + public resetSourceTask() { + this._sourceTask.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTaskInput() { + return this._sourceTask.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsKafkav2SmartConnectTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsKafkav2SmartConnectTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination_type: cdktf.stringToTerraform(this._destinationType), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + source_type: cdktf.stringToTerraform(this._sourceType), + start_later: cdktf.booleanToTerraform(this._startLater), + task_name: cdktf.stringToTerraform(this._taskName), + topics: cdktf.listMapper(cdktf.stringToTerraform, false)(this._topics), + topics_regex: cdktf.stringToTerraform(this._topicsRegex), + destination_task: dmsKafkav2SmartConnectTaskDestinationTaskToTerraform(this._destinationTask.internalValue), + source_task: dmsKafkav2SmartConnectTaskSourceTaskToTerraform(this._sourceTask.internalValue), + timeouts: dmsKafkav2SmartConnectTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination_type: { + value: cdktf.stringToHclTerraform(this._destinationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_later: { + value: cdktf.booleanToHclTerraform(this._startLater), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + task_name: { + value: cdktf.stringToHclTerraform(this._taskName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topics: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._topics), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + topics_regex: { + value: cdktf.stringToHclTerraform(this._topicsRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_task: { + value: dmsKafkav2SmartConnectTaskDestinationTaskToHclTerraform(this._destinationTask.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsKafkav2SmartConnectTaskDestinationTaskList", + }, + source_task: { + value: dmsKafkav2SmartConnectTaskSourceTaskToHclTerraform(this._sourceTask.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsKafkav2SmartConnectTaskSourceTaskList", + }, + timeouts: { + value: dmsKafkav2SmartConnectTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsKafkav2SmartConnectTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-queue-v1/README.md b/src/constructs/providers/huaweicloud/dms-queue-v1/README.md new file mode 100644 index 00000000..b45f4091 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-queue-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_queue_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_queue_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1). diff --git a/src/constructs/providers/huaweicloud/dms-queue-v1/index.ts b/src/constructs/providers/huaweicloud/dms-queue-v1/index.ts new file mode 100644 index 00000000..f539e2b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-queue-v1/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsQueueV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#description DmsQueueV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#id DmsQueueV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#max_consume_count DmsQueueV1#max_consume_count} + */ + readonly maxConsumeCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#name DmsQueueV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#queue_mode DmsQueueV1#queue_mode} + */ + readonly queueMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#redrive_policy DmsQueueV1#redrive_policy} + */ + readonly redrivePolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#region DmsQueueV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#retention_hours DmsQueueV1#retention_hours} + */ + readonly retentionHours?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1 huaweicloud_dms_queue_v1} +*/ +export class DmsQueueV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_queue_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsQueueV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsQueueV1 to import + * @param importFromId The id of the existing DmsQueueV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsQueueV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_queue_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue_v1 huaweicloud_dms_queue_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsQueueV1Config + */ + public constructor(scope: Construct, id: string, config: DmsQueueV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_queue_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._maxConsumeCount = config.maxConsumeCount; + this._name = config.name; + this._queueMode = config.queueMode; + this._redrivePolicy = config.redrivePolicy; + this._region = config.region; + this._retentionHours = config.retentionHours; + } + + // ========== + // ATTRIBUTES + // ========== + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group_count - computed: true, optional: false, required: false + public get groupCount() { + return this.getNumberAttribute('group_count'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_consume_count - computed: true, optional: true, required: false + private _maxConsumeCount?: number; + public get maxConsumeCount() { + return this.getNumberAttribute('max_consume_count'); + } + public set maxConsumeCount(value: number) { + this._maxConsumeCount = value; + } + public resetMaxConsumeCount() { + this._maxConsumeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConsumeCountInput() { + return this._maxConsumeCount; + } + + // max_msg_size_byte - computed: true, optional: false, required: false + public get maxMsgSizeByte() { + return this.getNumberAttribute('max_msg_size_byte'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // produced_messages - computed: true, optional: false, required: false + public get producedMessages() { + return this.getNumberAttribute('produced_messages'); + } + + // queue_mode - computed: true, optional: true, required: false + private _queueMode?: string; + public get queueMode() { + return this.getStringAttribute('queue_mode'); + } + public set queueMode(value: string) { + this._queueMode = value; + } + public resetQueueMode() { + this._queueMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueModeInput() { + return this._queueMode; + } + + // redrive_policy - computed: true, optional: true, required: false + private _redrivePolicy?: string; + public get redrivePolicy() { + return this.getStringAttribute('redrive_policy'); + } + public set redrivePolicy(value: string) { + this._redrivePolicy = value; + } + public resetRedrivePolicy() { + this._redrivePolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get redrivePolicyInput() { + return this._redrivePolicy; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reservation - computed: true, optional: false, required: false + public get reservation() { + return this.getNumberAttribute('reservation'); + } + + // retention_hours - computed: true, optional: true, required: false + private _retentionHours?: number; + public get retentionHours() { + return this.getNumberAttribute('retention_hours'); + } + public set retentionHours(value: number) { + this._retentionHours = value; + } + public resetRetentionHours() { + this._retentionHours = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionHoursInput() { + return this._retentionHours; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + max_consume_count: cdktf.numberToTerraform(this._maxConsumeCount), + name: cdktf.stringToTerraform(this._name), + queue_mode: cdktf.stringToTerraform(this._queueMode), + redrive_policy: cdktf.stringToTerraform(this._redrivePolicy), + region: cdktf.stringToTerraform(this._region), + retention_hours: cdktf.numberToTerraform(this._retentionHours), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_consume_count: { + value: cdktf.numberToHclTerraform(this._maxConsumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_mode: { + value: cdktf.stringToHclTerraform(this._queueMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redrive_policy: { + value: cdktf.stringToHclTerraform(this._redrivePolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_hours: { + value: cdktf.numberToHclTerraform(this._retentionHours), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-queue/README.md b/src/constructs/providers/huaweicloud/dms-queue/README.md new file mode 100644 index 00000000..51e6bd0d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-queue/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_queue` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_queue`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue). diff --git a/src/constructs/providers/huaweicloud/dms-queue/index.ts b/src/constructs/providers/huaweicloud/dms-queue/index.ts new file mode 100644 index 00000000..6a8052e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-queue/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsQueueConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#description DmsQueue#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#id DmsQueue#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#max_consume_count DmsQueue#max_consume_count} + */ + readonly maxConsumeCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#name DmsQueue#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#queue_mode DmsQueue#queue_mode} + */ + readonly queueMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#redrive_policy DmsQueue#redrive_policy} + */ + readonly redrivePolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#region DmsQueue#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#retention_hours DmsQueue#retention_hours} + */ + readonly retentionHours?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue huaweicloud_dms_queue} +*/ +export class DmsQueue extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_queue"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsQueue resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsQueue to import + * @param importFromId The id of the existing DmsQueue that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsQueue to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_queue", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_queue huaweicloud_dms_queue} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsQueueConfig + */ + public constructor(scope: Construct, id: string, config: DmsQueueConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_queue', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._maxConsumeCount = config.maxConsumeCount; + this._name = config.name; + this._queueMode = config.queueMode; + this._redrivePolicy = config.redrivePolicy; + this._region = config.region; + this._retentionHours = config.retentionHours; + } + + // ========== + // ATTRIBUTES + // ========== + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group_count - computed: true, optional: false, required: false + public get groupCount() { + return this.getNumberAttribute('group_count'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_consume_count - computed: true, optional: true, required: false + private _maxConsumeCount?: number; + public get maxConsumeCount() { + return this.getNumberAttribute('max_consume_count'); + } + public set maxConsumeCount(value: number) { + this._maxConsumeCount = value; + } + public resetMaxConsumeCount() { + this._maxConsumeCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConsumeCountInput() { + return this._maxConsumeCount; + } + + // max_msg_size_byte - computed: true, optional: false, required: false + public get maxMsgSizeByte() { + return this.getNumberAttribute('max_msg_size_byte'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // produced_messages - computed: true, optional: false, required: false + public get producedMessages() { + return this.getNumberAttribute('produced_messages'); + } + + // queue_mode - computed: true, optional: true, required: false + private _queueMode?: string; + public get queueMode() { + return this.getStringAttribute('queue_mode'); + } + public set queueMode(value: string) { + this._queueMode = value; + } + public resetQueueMode() { + this._queueMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueModeInput() { + return this._queueMode; + } + + // redrive_policy - computed: true, optional: true, required: false + private _redrivePolicy?: string; + public get redrivePolicy() { + return this.getStringAttribute('redrive_policy'); + } + public set redrivePolicy(value: string) { + this._redrivePolicy = value; + } + public resetRedrivePolicy() { + this._redrivePolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get redrivePolicyInput() { + return this._redrivePolicy; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reservation - computed: true, optional: false, required: false + public get reservation() { + return this.getNumberAttribute('reservation'); + } + + // retention_hours - computed: true, optional: true, required: false + private _retentionHours?: number; + public get retentionHours() { + return this.getNumberAttribute('retention_hours'); + } + public set retentionHours(value: number) { + this._retentionHours = value; + } + public resetRetentionHours() { + this._retentionHours = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionHoursInput() { + return this._retentionHours; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + max_consume_count: cdktf.numberToTerraform(this._maxConsumeCount), + name: cdktf.stringToTerraform(this._name), + queue_mode: cdktf.stringToTerraform(this._queueMode), + redrive_policy: cdktf.stringToTerraform(this._redrivePolicy), + region: cdktf.stringToTerraform(this._region), + retention_hours: cdktf.numberToTerraform(this._retentionHours), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_consume_count: { + value: cdktf.numberToHclTerraform(this._maxConsumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_mode: { + value: cdktf.stringToHclTerraform(this._queueMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redrive_policy: { + value: cdktf.stringToHclTerraform(this._redrivePolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_hours: { + value: cdktf.numberToHclTerraform(this._retentionHours), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/README.md new file mode 100644 index 00000000..30457548 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_background_task_delete` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_background_task_delete`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/index.ts new file mode 100644 index 00000000..c9f187b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-background-task-delete/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqBackgroundTaskDeleteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete#id DmsRabbitmqBackgroundTaskDelete#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete#instance_id DmsRabbitmqBackgroundTaskDelete#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete#region DmsRabbitmqBackgroundTaskDelete#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete#task_id DmsRabbitmqBackgroundTaskDelete#task_id} + */ + readonly taskId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete huaweicloud_dms_rabbitmq_background_task_delete} +*/ +export class DmsRabbitmqBackgroundTaskDelete extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_background_task_delete"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqBackgroundTaskDelete resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqBackgroundTaskDelete to import + * @param importFromId The id of the existing DmsRabbitmqBackgroundTaskDelete that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqBackgroundTaskDelete to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_background_task_delete", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_background_task_delete huaweicloud_dms_rabbitmq_background_task_delete} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqBackgroundTaskDeleteConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqBackgroundTaskDeleteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_background_task_delete', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._taskId = config.taskId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // task_id - computed: false, optional: false, required: true + private _taskId?: string; + public get taskId() { + return this.getStringAttribute('task_id'); + } + public set taskId(value: string) { + this._taskId = value; + } + // Temporarily expose input value. Use with caution. + public get taskIdInput() { + return this._taskId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + task_id: cdktf.stringToTerraform(this._taskId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + task_id: { + value: cdktf.stringToHclTerraform(this._taskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/README.md new file mode 100644 index 00000000..0fa2f5eb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_exchange_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_exchange_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/index.ts new file mode 100644 index 00000000..94b1b0a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange-associate/index.ts @@ -0,0 +1,302 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqExchangeAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#destination DmsRabbitmqExchangeAssociate#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#destination_type DmsRabbitmqExchangeAssociate#destination_type} + */ + readonly destinationType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#exchange DmsRabbitmqExchangeAssociate#exchange} + */ + readonly exchange: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#id DmsRabbitmqExchangeAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#instance_id DmsRabbitmqExchangeAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#region DmsRabbitmqExchangeAssociate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#routing_key DmsRabbitmqExchangeAssociate#routing_key} + */ + readonly routingKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#vhost DmsRabbitmqExchangeAssociate#vhost} + */ + readonly vhost: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate huaweicloud_dms_rabbitmq_exchange_associate} +*/ +export class DmsRabbitmqExchangeAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_exchange_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqExchangeAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqExchangeAssociate to import + * @param importFromId The id of the existing DmsRabbitmqExchangeAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqExchangeAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_exchange_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange_associate huaweicloud_dms_rabbitmq_exchange_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqExchangeAssociateConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqExchangeAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_exchange_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destination = config.destination; + this._destinationType = config.destinationType; + this._exchange = config.exchange; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._routingKey = config.routingKey; + this._vhost = config.vhost; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // destination_type - computed: false, optional: false, required: true + private _destinationType?: string; + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + public set destinationType(value: string) { + this._destinationType = value; + } + // Temporarily expose input value. Use with caution. + public get destinationTypeInput() { + return this._destinationType; + } + + // exchange - computed: false, optional: false, required: true + private _exchange?: string; + public get exchange() { + return this.getStringAttribute('exchange'); + } + public set exchange(value: string) { + this._exchange = value; + } + // Temporarily expose input value. Use with caution. + public get exchangeInput() { + return this._exchange; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // properties_key - computed: true, optional: false, required: false + public get propertiesKey() { + return this.getStringAttribute('properties_key'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routing_key - computed: false, optional: true, required: false + private _routingKey?: string; + public get routingKey() { + return this.getStringAttribute('routing_key'); + } + public set routingKey(value: string) { + this._routingKey = value; + } + public resetRoutingKey() { + this._routingKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get routingKeyInput() { + return this._routingKey; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination: cdktf.stringToTerraform(this._destination), + destination_type: cdktf.stringToTerraform(this._destinationType), + exchange: cdktf.stringToTerraform(this._exchange), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + routing_key: cdktf.stringToTerraform(this._routingKey), + vhost: cdktf.stringToTerraform(this._vhost), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_type: { + value: cdktf.stringToHclTerraform(this._destinationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exchange: { + value: cdktf.stringToHclTerraform(this._exchange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + routing_key: { + value: cdktf.stringToHclTerraform(this._routingKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(this._vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/README.md new file mode 100644 index 00000000..53566ad7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_exchange` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_exchange`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/index.ts new file mode 100644 index 00000000..ab5b8ec6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-exchange/index.ts @@ -0,0 +1,421 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqExchangeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#auto_delete DmsRabbitmqExchange#auto_delete} + */ + readonly autoDelete: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#durable DmsRabbitmqExchange#durable} + */ + readonly durable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#id DmsRabbitmqExchange#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#instance_id DmsRabbitmqExchange#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#internal DmsRabbitmqExchange#internal} + */ + readonly internal?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#name DmsRabbitmqExchange#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#region DmsRabbitmqExchange#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#type DmsRabbitmqExchange#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#vhost DmsRabbitmqExchange#vhost} + */ + readonly vhost: string; +} +export interface DmsRabbitmqExchangeBindings { +} + +export function dmsRabbitmqExchangeBindingsToTerraform(struct?: DmsRabbitmqExchangeBindings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRabbitmqExchangeBindingsToHclTerraform(struct?: DmsRabbitmqExchangeBindings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRabbitmqExchangeBindingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRabbitmqExchangeBindings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqExchangeBindings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // destination_type - computed: true, optional: false, required: false + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + + // properties_key - computed: true, optional: false, required: false + public get propertiesKey() { + return this.getStringAttribute('properties_key'); + } + + // routing_key - computed: true, optional: false, required: false + public get routingKey() { + return this.getStringAttribute('routing_key'); + } +} + +export class DmsRabbitmqExchangeBindingsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRabbitmqExchangeBindingsOutputReference { + return new DmsRabbitmqExchangeBindingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange huaweicloud_dms_rabbitmq_exchange} +*/ +export class DmsRabbitmqExchange extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_exchange"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqExchange resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqExchange to import + * @param importFromId The id of the existing DmsRabbitmqExchange that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqExchange to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_exchange", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_exchange huaweicloud_dms_rabbitmq_exchange} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqExchangeConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqExchangeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_exchange', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoDelete = config.autoDelete; + this._durable = config.durable; + this._id = config.id; + this._instanceId = config.instanceId; + this._internal = config.internal; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._vhost = config.vhost; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_delete - computed: false, optional: false, required: true + private _autoDelete?: boolean | cdktf.IResolvable; + public get autoDelete() { + return this.getBooleanAttribute('auto_delete'); + } + public set autoDelete(value: boolean | cdktf.IResolvable) { + this._autoDelete = value; + } + // Temporarily expose input value. Use with caution. + public get autoDeleteInput() { + return this._autoDelete; + } + + // bindings - computed: true, optional: false, required: false + private _bindings = new DmsRabbitmqExchangeBindingsList(this, "bindings", false); + public get bindings() { + return this._bindings; + } + + // durable - computed: true, optional: true, required: false + private _durable?: boolean | cdktf.IResolvable; + public get durable() { + return this.getBooleanAttribute('durable'); + } + public set durable(value: boolean | cdktf.IResolvable) { + this._durable = value; + } + public resetDurable() { + this._durable = undefined; + } + // Temporarily expose input value. Use with caution. + public get durableInput() { + return this._durable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // internal - computed: true, optional: true, required: false + private _internal?: boolean | cdktf.IResolvable; + public get internal() { + return this.getBooleanAttribute('internal'); + } + public set internal(value: boolean | cdktf.IResolvable) { + this._internal = value; + } + public resetInternal() { + this._internal = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalInput() { + return this._internal; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_delete: cdktf.booleanToTerraform(this._autoDelete), + durable: cdktf.booleanToTerraform(this._durable), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + internal: cdktf.booleanToTerraform(this._internal), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vhost: cdktf.stringToTerraform(this._vhost), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_delete: { + value: cdktf.booleanToHclTerraform(this._autoDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + durable: { + value: cdktf.booleanToHclTerraform(this._durable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal: { + value: cdktf.booleanToHclTerraform(this._internal), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(this._vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-instance/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-instance/README.md new file mode 100644 index 00000000..289463cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-instance/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-instance/index.ts new file mode 100644 index 00000000..f15bca4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-instance/index.ts @@ -0,0 +1,1134 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#access_user DmsRabbitmqInstance#access_user} + */ + readonly accessUser?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#auto_renew DmsRabbitmqInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#availability_zones DmsRabbitmqInstance#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#available_zones DmsRabbitmqInstance#available_zones} + */ + readonly availableZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#broker_num DmsRabbitmqInstance#broker_num} + */ + readonly brokerNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#charging_mode DmsRabbitmqInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#description DmsRabbitmqInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#enable_acl DmsRabbitmqInstance#enable_acl} + */ + readonly enableAcl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#engine_version DmsRabbitmqInstance#engine_version} + */ + readonly engineVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#enterprise_project_id DmsRabbitmqInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#flavor_id DmsRabbitmqInstance#flavor_id} + */ + readonly flavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#id DmsRabbitmqInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#maintain_begin DmsRabbitmqInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#maintain_end DmsRabbitmqInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#name DmsRabbitmqInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#network_id DmsRabbitmqInstance#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#password DmsRabbitmqInstance#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#period DmsRabbitmqInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#period_unit DmsRabbitmqInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#product_id DmsRabbitmqInstance#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#public_ip_id DmsRabbitmqInstance#public_ip_id} + */ + readonly publicIpId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#region DmsRabbitmqInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#security_group_id DmsRabbitmqInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#ssl_enable DmsRabbitmqInstance#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#storage_space DmsRabbitmqInstance#storage_space} + */ + readonly storageSpace?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#storage_spec_code DmsRabbitmqInstance#storage_spec_code} + */ + readonly storageSpecCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#tags DmsRabbitmqInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#vpc_id DmsRabbitmqInstance#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#timeouts DmsRabbitmqInstance#timeouts} + */ + readonly timeouts?: DmsRabbitmqInstanceTimeouts; +} +export interface DmsRabbitmqInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#create DmsRabbitmqInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#delete DmsRabbitmqInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#update DmsRabbitmqInstance#update} + */ + readonly update?: string; +} + +export function dmsRabbitmqInstanceTimeoutsToTerraform(struct?: DmsRabbitmqInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dmsRabbitmqInstanceTimeoutsToHclTerraform(struct?: DmsRabbitmqInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRabbitmqInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsRabbitmqInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance huaweicloud_dms_rabbitmq_instance} +*/ +export class DmsRabbitmqInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqInstance to import + * @param importFromId The id of the existing DmsRabbitmqInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_instance huaweicloud_dms_rabbitmq_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessUser = config.accessUser; + this._autoRenew = config.autoRenew; + this._availabilityZones = config.availabilityZones; + this._availableZones = config.availableZones; + this._brokerNum = config.brokerNum; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enableAcl = config.enableAcl; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._networkId = config.networkId; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._productId = config.productId; + this._publicIpId = config.publicIpId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._sslEnable = config.sslEnable; + this._storageSpace = config.storageSpace; + this._storageSpecCode = config.storageSpecCode; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_user - computed: false, optional: true, required: false + private _accessUser?: string; + public get accessUser() { + return this.getStringAttribute('access_user'); + } + public set accessUser(value: string) { + this._accessUser = value; + } + public resetAccessUser() { + this._accessUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessUserInput() { + return this._accessUser; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return cdktf.Fn.tolist(this.getListAttribute('availability_zones')); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // available_zones - computed: true, optional: true, required: false + private _availableZones?: string[]; + public get availableZones() { + return this.getListAttribute('available_zones'); + } + public set availableZones(value: string[]) { + this._availableZones = value; + } + public resetAvailableZones() { + this._availableZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availableZonesInput() { + return this._availableZones; + } + + // broker_num - computed: true, optional: true, required: false + private _brokerNum?: number; + public get brokerNum() { + return this.getNumberAttribute('broker_num'); + } + public set brokerNum(value: number) { + this._brokerNum = value; + } + public resetBrokerNum() { + this._brokerNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokerNumInput() { + return this._brokerNum; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // connect_address - computed: true, optional: false, required: false + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_acl - computed: true, optional: true, required: false + private _enableAcl?: boolean | cdktf.IResolvable; + public get enableAcl() { + return this.getBooleanAttribute('enable_acl'); + } + public set enableAcl(value: boolean | cdktf.IResolvable) { + this._enableAcl = value; + } + public resetEnableAcl() { + this._enableAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAclInput() { + return this._enableAcl; + } + + // enable_public_ip - computed: true, optional: false, required: false + public get enablePublicIp() { + return this.getBooleanAttribute('enable_public_ip'); + } + + // engine - computed: true, optional: false, required: false + public get engine() { + return this.getStringAttribute('engine'); + } + + // engine_version - computed: false, optional: true, required: false + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + public resetEngineVersion() { + this._engineVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extend_times - computed: true, optional: false, required: false + public get extendTimes() { + return this.getNumberAttribute('extend_times'); + } + + // flavor_id - computed: false, optional: true, required: false + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + public resetFlavorId() { + this._flavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_logical_volume - computed: true, optional: false, required: false + public get isLogicalVolume() { + return this.getBooleanAttribute('is_logical_volume'); + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // management_connect_address - computed: true, optional: false, required: false + public get managementConnectAddress() { + return this.getStringAttribute('management_connect_address'); + } + + // manegement_connect_address - computed: true, optional: false, required: false + public get manegementConnectAddress() { + return this.getStringAttribute('manegement_connect_address'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // public_ip_address - computed: true, optional: false, required: false + public get publicIpAddress() { + return this.getStringAttribute('public_ip_address'); + } + + // public_ip_id - computed: false, optional: true, required: false + private _publicIpId?: string; + public get publicIpId() { + return this.getStringAttribute('public_ip_id'); + } + public set publicIpId(value: string) { + this._publicIpId = value; + } + public resetPublicIpId() { + this._publicIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpIdInput() { + return this._publicIpId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // specification - computed: true, optional: false, required: false + public get specification() { + return this.getStringAttribute('specification'); + } + + // ssl_enable - computed: false, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_space - computed: true, optional: true, required: false + private _storageSpace?: number; + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + public set storageSpace(value: number) { + this._storageSpace = value; + } + public resetStorageSpace() { + this._storageSpace = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageSpaceInput() { + return this._storageSpace; + } + + // storage_spec_code - computed: false, optional: false, required: true + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsRabbitmqInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsRabbitmqInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_user: cdktf.stringToTerraform(this._accessUser), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + available_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availableZones), + broker_num: cdktf.numberToTerraform(this._brokerNum), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enable_acl: cdktf.booleanToTerraform(this._enableAcl), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + product_id: cdktf.stringToTerraform(this._productId), + public_ip_id: cdktf.stringToTerraform(this._publicIpId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + storage_space: cdktf.numberToTerraform(this._storageSpace), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: dmsRabbitmqInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_user: { + value: cdktf.stringToHclTerraform(this._accessUser), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + available_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availableZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + broker_num: { + value: cdktf.numberToHclTerraform(this._brokerNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_acl: { + value: cdktf.booleanToHclTerraform(this._enableAcl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip_id: { + value: cdktf.stringToHclTerraform(this._publicIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + storage_space: { + value: cdktf.numberToHclTerraform(this._storageSpace), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsRabbitmqInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsRabbitmqInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/README.md new file mode 100644 index 00000000..dd9b0cab --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_plugin` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_plugin`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/index.ts new file mode 100644 index 00000000..d3f7f4ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-plugin/index.ts @@ -0,0 +1,370 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqPluginConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#id DmsRabbitmqPlugin#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RabbitMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#instance_id DmsRabbitmqPlugin#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the plugin. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#name DmsRabbitmqPlugin#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#region DmsRabbitmqPlugin#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#timeouts DmsRabbitmqPlugin#timeouts} + */ + readonly timeouts?: DmsRabbitmqPluginTimeouts; +} +export interface DmsRabbitmqPluginTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#create DmsRabbitmqPlugin#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#delete DmsRabbitmqPlugin#delete} + */ + readonly delete?: string; +} + +export function dmsRabbitmqPluginTimeoutsToTerraform(struct?: DmsRabbitmqPluginTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dmsRabbitmqPluginTimeoutsToHclTerraform(struct?: DmsRabbitmqPluginTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRabbitmqPluginTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsRabbitmqPluginTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqPluginTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin huaweicloud_dms_rabbitmq_plugin} +*/ +export class DmsRabbitmqPlugin extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_plugin"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqPlugin resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqPlugin to import + * @param importFromId The id of the existing DmsRabbitmqPlugin that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqPlugin to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_plugin", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_plugin huaweicloud_dms_rabbitmq_plugin} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqPluginConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqPluginConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_plugin', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable - computed: true, optional: false, required: false + public get enable() { + return this.getBooleanAttribute('enable'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // running - computed: true, optional: false, required: false + public get running() { + return this.getBooleanAttribute('running'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsRabbitmqPluginTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsRabbitmqPluginTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: dmsRabbitmqPluginTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dmsRabbitmqPluginTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsRabbitmqPluginTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/README.md new file mode 100644 index 00000000..9dfeeac5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_queue_message_clear` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_queue_message_clear`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/index.ts new file mode 100644 index 00000000..20acb3e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue-message-clear/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqQueueMessageClearConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear#id DmsRabbitmqQueueMessageClear#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear#instance_id DmsRabbitmqQueueMessageClear#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear#queue DmsRabbitmqQueueMessageClear#queue} + */ + readonly queue: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear#region DmsRabbitmqQueueMessageClear#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear#vhost DmsRabbitmqQueueMessageClear#vhost} + */ + readonly vhost: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear huaweicloud_dms_rabbitmq_queue_message_clear} +*/ +export class DmsRabbitmqQueueMessageClear extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_queue_message_clear"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqQueueMessageClear resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqQueueMessageClear to import + * @param importFromId The id of the existing DmsRabbitmqQueueMessageClear that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqQueueMessageClear to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_queue_message_clear", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue_message_clear huaweicloud_dms_rabbitmq_queue_message_clear} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqQueueMessageClearConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqQueueMessageClearConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_queue_message_clear', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._queue = config.queue; + this._region = config.region; + this._vhost = config.vhost; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // queue - computed: false, optional: false, required: true + private _queue?: string; + public get queue() { + return this.getStringAttribute('queue'); + } + public set queue(value: string) { + this._queue = value; + } + // Temporarily expose input value. Use with caution. + public get queueInput() { + return this._queue; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + queue: cdktf.stringToTerraform(this._queue), + region: cdktf.stringToTerraform(this._region), + vhost: cdktf.stringToTerraform(this._vhost), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue: { + value: cdktf.stringToHclTerraform(this._queue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(this._vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-queue/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue/README.md new file mode 100644 index 00000000..e314026e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_queue` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_queue`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-queue/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue/index.ts new file mode 100644 index 00000000..23871fd9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-queue/index.ts @@ -0,0 +1,697 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqQueueConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#auto_delete DmsRabbitmqQueue#auto_delete} + */ + readonly autoDelete: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#dead_letter_exchange DmsRabbitmqQueue#dead_letter_exchange} + */ + readonly deadLetterExchange?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#dead_letter_routing_key DmsRabbitmqQueue#dead_letter_routing_key} + */ + readonly deadLetterRoutingKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#durable DmsRabbitmqQueue#durable} + */ + readonly durable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#id DmsRabbitmqQueue#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#instance_id DmsRabbitmqQueue#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#lazy_mode DmsRabbitmqQueue#lazy_mode} + */ + readonly lazyMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#message_ttl DmsRabbitmqQueue#message_ttl} + */ + readonly messageTtl?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#name DmsRabbitmqQueue#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#region DmsRabbitmqQueue#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#vhost DmsRabbitmqQueue#vhost} + */ + readonly vhost: string; +} +export interface DmsRabbitmqQueueConsumerDetailsChannelDetails { +} + +export function dmsRabbitmqQueueConsumerDetailsChannelDetailsToTerraform(struct?: DmsRabbitmqQueueConsumerDetailsChannelDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRabbitmqQueueConsumerDetailsChannelDetailsToHclTerraform(struct?: DmsRabbitmqQueueConsumerDetailsChannelDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRabbitmqQueueConsumerDetailsChannelDetailsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRabbitmqQueueConsumerDetailsChannelDetails | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqQueueConsumerDetailsChannelDetails | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connection_name - computed: true, optional: false, required: false + public get connectionName() { + return this.getStringAttribute('connection_name'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // number - computed: true, optional: false, required: false + public get number() { + return this.getNumberAttribute('number'); + } + + // peer_host - computed: true, optional: false, required: false + public get peerHost() { + return this.getStringAttribute('peer_host'); + } + + // peer_port - computed: true, optional: false, required: false + public get peerPort() { + return this.getNumberAttribute('peer_port'); + } + + // user - computed: true, optional: false, required: false + public get user() { + return this.getStringAttribute('user'); + } +} + +export class DmsRabbitmqQueueConsumerDetailsChannelDetailsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRabbitmqQueueConsumerDetailsChannelDetailsOutputReference { + return new DmsRabbitmqQueueConsumerDetailsChannelDetailsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRabbitmqQueueConsumerDetails { +} + +export function dmsRabbitmqQueueConsumerDetailsToTerraform(struct?: DmsRabbitmqQueueConsumerDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRabbitmqQueueConsumerDetailsToHclTerraform(struct?: DmsRabbitmqQueueConsumerDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRabbitmqQueueConsumerDetailsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRabbitmqQueueConsumerDetails | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqQueueConsumerDetails | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // ack_required - computed: true, optional: false, required: false + public get ackRequired() { + return this.getBooleanAttribute('ack_required'); + } + + // channel_details - computed: true, optional: false, required: false + private _channelDetails = new DmsRabbitmqQueueConsumerDetailsChannelDetailsList(this, "channel_details", false); + public get channelDetails() { + return this._channelDetails; + } + + // consumer_tag - computed: true, optional: false, required: false + public get consumerTag() { + return this.getStringAttribute('consumer_tag'); + } + + // prefetch_count - computed: true, optional: false, required: false + public get prefetchCount() { + return this.getNumberAttribute('prefetch_count'); + } +} + +export class DmsRabbitmqQueueConsumerDetailsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRabbitmqQueueConsumerDetailsOutputReference { + return new DmsRabbitmqQueueConsumerDetailsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRabbitmqQueueQueueBindings { +} + +export function dmsRabbitmqQueueQueueBindingsToTerraform(struct?: DmsRabbitmqQueueQueueBindings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRabbitmqQueueQueueBindingsToHclTerraform(struct?: DmsRabbitmqQueueQueueBindings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRabbitmqQueueQueueBindingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRabbitmqQueueQueueBindings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqQueueQueueBindings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // destination_type - computed: true, optional: false, required: false + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + + // properties_key - computed: true, optional: false, required: false + public get propertiesKey() { + return this.getStringAttribute('properties_key'); + } + + // routing_key - computed: true, optional: false, required: false + public get routingKey() { + return this.getStringAttribute('routing_key'); + } + + // source - computed: true, optional: false, required: false + public get source() { + return this.getStringAttribute('source'); + } +} + +export class DmsRabbitmqQueueQueueBindingsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRabbitmqQueueQueueBindingsOutputReference { + return new DmsRabbitmqQueueQueueBindingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue huaweicloud_dms_rabbitmq_queue} +*/ +export class DmsRabbitmqQueue extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_queue"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqQueue resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqQueue to import + * @param importFromId The id of the existing DmsRabbitmqQueue that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqQueue to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_queue", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_queue huaweicloud_dms_rabbitmq_queue} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqQueueConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqQueueConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_queue', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoDelete = config.autoDelete; + this._deadLetterExchange = config.deadLetterExchange; + this._deadLetterRoutingKey = config.deadLetterRoutingKey; + this._durable = config.durable; + this._id = config.id; + this._instanceId = config.instanceId; + this._lazyMode = config.lazyMode; + this._messageTtl = config.messageTtl; + this._name = config.name; + this._region = config.region; + this._vhost = config.vhost; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_delete - computed: false, optional: false, required: true + private _autoDelete?: boolean | cdktf.IResolvable; + public get autoDelete() { + return this.getBooleanAttribute('auto_delete'); + } + public set autoDelete(value: boolean | cdktf.IResolvable) { + this._autoDelete = value; + } + // Temporarily expose input value. Use with caution. + public get autoDeleteInput() { + return this._autoDelete; + } + + // consumer_details - computed: true, optional: false, required: false + private _consumerDetails = new DmsRabbitmqQueueConsumerDetailsList(this, "consumer_details", false); + public get consumerDetails() { + return this._consumerDetails; + } + + // consumers - computed: true, optional: false, required: false + public get consumers() { + return this.getNumberAttribute('consumers'); + } + + // dead_letter_exchange - computed: false, optional: true, required: false + private _deadLetterExchange?: string; + public get deadLetterExchange() { + return this.getStringAttribute('dead_letter_exchange'); + } + public set deadLetterExchange(value: string) { + this._deadLetterExchange = value; + } + public resetDeadLetterExchange() { + this._deadLetterExchange = undefined; + } + // Temporarily expose input value. Use with caution. + public get deadLetterExchangeInput() { + return this._deadLetterExchange; + } + + // dead_letter_routing_key - computed: false, optional: true, required: false + private _deadLetterRoutingKey?: string; + public get deadLetterRoutingKey() { + return this.getStringAttribute('dead_letter_routing_key'); + } + public set deadLetterRoutingKey(value: string) { + this._deadLetterRoutingKey = value; + } + public resetDeadLetterRoutingKey() { + this._deadLetterRoutingKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get deadLetterRoutingKeyInput() { + return this._deadLetterRoutingKey; + } + + // durable - computed: true, optional: true, required: false + private _durable?: boolean | cdktf.IResolvable; + public get durable() { + return this.getBooleanAttribute('durable'); + } + public set durable(value: boolean | cdktf.IResolvable) { + this._durable = value; + } + public resetDurable() { + this._durable = undefined; + } + // Temporarily expose input value. Use with caution. + public get durableInput() { + return this._durable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lazy_mode - computed: false, optional: true, required: false + private _lazyMode?: string; + public get lazyMode() { + return this.getStringAttribute('lazy_mode'); + } + public set lazyMode(value: string) { + this._lazyMode = value; + } + public resetLazyMode() { + this._lazyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get lazyModeInput() { + return this._lazyMode; + } + + // message_ttl - computed: false, optional: true, required: false + private _messageTtl?: number; + public get messageTtl() { + return this.getNumberAttribute('message_ttl'); + } + public set messageTtl(value: number) { + this._messageTtl = value; + } + public resetMessageTtl() { + this._messageTtl = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageTtlInput() { + return this._messageTtl; + } + + // messages - computed: true, optional: false, required: false + public get messages() { + return this.getNumberAttribute('messages'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy - computed: true, optional: false, required: false + public get policy() { + return this.getStringAttribute('policy'); + } + + // queue_bindings - computed: true, optional: false, required: false + private _queueBindings = new DmsRabbitmqQueueQueueBindingsList(this, "queue_bindings", false); + public get queueBindings() { + return this._queueBindings; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_delete: cdktf.booleanToTerraform(this._autoDelete), + dead_letter_exchange: cdktf.stringToTerraform(this._deadLetterExchange), + dead_letter_routing_key: cdktf.stringToTerraform(this._deadLetterRoutingKey), + durable: cdktf.booleanToTerraform(this._durable), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lazy_mode: cdktf.stringToTerraform(this._lazyMode), + message_ttl: cdktf.numberToTerraform(this._messageTtl), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vhost: cdktf.stringToTerraform(this._vhost), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_delete: { + value: cdktf.booleanToHclTerraform(this._autoDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dead_letter_exchange: { + value: cdktf.stringToHclTerraform(this._deadLetterExchange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dead_letter_routing_key: { + value: cdktf.stringToHclTerraform(this._deadLetterRoutingKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + durable: { + value: cdktf.booleanToHclTerraform(this._durable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lazy_mode: { + value: cdktf.stringToHclTerraform(this._lazyMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_ttl: { + value: cdktf.numberToHclTerraform(this._messageTtl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(this._vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-user/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-user/README.md new file mode 100644 index 00000000..30616bba --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-user/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-user/index.ts new file mode 100644 index 00000000..d50468d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-user/index.ts @@ -0,0 +1,449 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqUserConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#access_key DmsRabbitmqUser#access_key} + */ + readonly accessKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#id DmsRabbitmqUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#instance_id DmsRabbitmqUser#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#region DmsRabbitmqUser#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#secret_key DmsRabbitmqUser#secret_key} + */ + readonly secretKey: string; + /** + * vhosts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#vhosts DmsRabbitmqUser#vhosts} + */ + readonly vhosts: DmsRabbitmqUserVhosts[] | cdktf.IResolvable; +} +export interface DmsRabbitmqUserVhosts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#conf DmsRabbitmqUser#conf} + */ + readonly conf: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#read DmsRabbitmqUser#read} + */ + readonly read: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#vhost DmsRabbitmqUser#vhost} + */ + readonly vhost: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#write DmsRabbitmqUser#write} + */ + readonly write: string; +} + +export function dmsRabbitmqUserVhostsToTerraform(struct?: DmsRabbitmqUserVhosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + conf: cdktf.stringToTerraform(struct!.conf), + read: cdktf.stringToTerraform(struct!.read), + vhost: cdktf.stringToTerraform(struct!.vhost), + write: cdktf.stringToTerraform(struct!.write), + } +} + + +export function dmsRabbitmqUserVhostsToHclTerraform(struct?: DmsRabbitmqUserVhosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + conf: { + value: cdktf.stringToHclTerraform(struct!.conf), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read: { + value: cdktf.stringToHclTerraform(struct!.read), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(struct!.vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + write: { + value: cdktf.stringToHclTerraform(struct!.write), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRabbitmqUserVhostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRabbitmqUserVhosts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._conf !== undefined) { + hasAnyValues = true; + internalValueResult.conf = this._conf; + } + if (this._read !== undefined) { + hasAnyValues = true; + internalValueResult.read = this._read; + } + if (this._vhost !== undefined) { + hasAnyValues = true; + internalValueResult.vhost = this._vhost; + } + if (this._write !== undefined) { + hasAnyValues = true; + internalValueResult.write = this._write; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRabbitmqUserVhosts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._conf = undefined; + this._read = undefined; + this._vhost = undefined; + this._write = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._conf = value.conf; + this._read = value.read; + this._vhost = value.vhost; + this._write = value.write; + } + } + + // conf - computed: false, optional: false, required: true + private _conf?: string; + public get conf() { + return this.getStringAttribute('conf'); + } + public set conf(value: string) { + this._conf = value; + } + // Temporarily expose input value. Use with caution. + public get confInput() { + return this._conf; + } + + // read - computed: false, optional: false, required: true + private _read?: string; + public get read() { + return this.getStringAttribute('read'); + } + public set read(value: string) { + this._read = value; + } + // Temporarily expose input value. Use with caution. + public get readInput() { + return this._read; + } + + // vhost - computed: false, optional: false, required: true + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } + + // write - computed: false, optional: false, required: true + private _write?: string; + public get write() { + return this.getStringAttribute('write'); + } + public set write(value: string) { + this._write = value; + } + // Temporarily expose input value. Use with caution. + public get writeInput() { + return this._write; + } +} + +export class DmsRabbitmqUserVhostsList extends cdktf.ComplexList { + public internalValue? : DmsRabbitmqUserVhosts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRabbitmqUserVhostsOutputReference { + return new DmsRabbitmqUserVhostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user huaweicloud_dms_rabbitmq_user} +*/ +export class DmsRabbitmqUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqUser to import + * @param importFromId The id of the existing DmsRabbitmqUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_user huaweicloud_dms_rabbitmq_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqUserConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessKey = config.accessKey; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._secretKey = config.secretKey; + this._vhosts.internalValue = config.vhosts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: false, optional: false, required: true + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_key - computed: false, optional: false, required: true + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // vhosts - computed: false, optional: false, required: true + private _vhosts = new DmsRabbitmqUserVhostsList(this, "vhosts", true); + public get vhosts() { + return this._vhosts; + } + public putVhosts(value: DmsRabbitmqUserVhosts[] | cdktf.IResolvable) { + this._vhosts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get vhostsInput() { + return this._vhosts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_key: cdktf.stringToTerraform(this._accessKey), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + secret_key: cdktf.stringToTerraform(this._secretKey), + vhosts: cdktf.listMapper(dmsRabbitmqUserVhostsToTerraform, true)(this._vhosts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(this._accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(this._secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhosts: { + value: cdktf.listMapperHcl(dmsRabbitmqUserVhostsToHclTerraform, true)(this._vhosts.internalValue), + isBlock: true, + type: "set", + storageClassType: "DmsRabbitmqUserVhostsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/README.md b/src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/README.md new file mode 100644 index 00000000..0c5d231c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rabbitmq_vhost` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rabbitmq_vhost`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost). diff --git a/src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/index.ts b/src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/index.ts new file mode 100644 index 00000000..0254d743 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rabbitmq-vhost/index.ts @@ -0,0 +1,199 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRabbitmqVhostConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost#id DmsRabbitmqVhost#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost#instance_id DmsRabbitmqVhost#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost#name DmsRabbitmqVhost#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost#region DmsRabbitmqVhost#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost huaweicloud_dms_rabbitmq_vhost} +*/ +export class DmsRabbitmqVhost extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rabbitmq_vhost"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRabbitmqVhost resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRabbitmqVhost to import + * @param importFromId The id of the existing DmsRabbitmqVhost that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRabbitmqVhost to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rabbitmq_vhost", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rabbitmq_vhost huaweicloud_dms_rabbitmq_vhost} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRabbitmqVhostConfig + */ + public constructor(scope: Construct, id: string, config: DmsRabbitmqVhostConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rabbitmq_vhost', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tracing - computed: true, optional: false, required: false + public get tracing() { + return this.getBooleanAttribute('tracing'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/README.md new file mode 100644 index 00000000..ade79756 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_consumer_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_consumer_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/index.ts new file mode 100644 index 00000000..a3d8f44b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-consumer-group/index.ts @@ -0,0 +1,375 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqConsumerGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to broadcast of the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#broadcast DmsRocketmqConsumerGroup#broadcast} + */ + readonly broadcast?: boolean | cdktf.IResolvable; + /** + * Specifies the list of associated brokers of the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#brokers DmsRocketmqConsumerGroup#brokers} + */ + readonly brokers?: string[]; + /** + * Specifies whether to consume orderly. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#consume_orderly DmsRocketmqConsumerGroup#consume_orderly} + */ + readonly consumeOrderly?: boolean | cdktf.IResolvable; + /** + * Specifies the description of the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#description DmsRocketmqConsumerGroup#description} + */ + readonly description?: string; + /** + * Specifies the consumer group is enabled or not. Default to true. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#enabled DmsRocketmqConsumerGroup#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#id DmsRocketmqConsumerGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the rocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#instance_id DmsRocketmqConsumerGroup#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#name DmsRocketmqConsumerGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#region DmsRocketmqConsumerGroup#region} + */ + readonly region?: string; + /** + * Specifies the maximum number of retry times. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#retry_max_times DmsRocketmqConsumerGroup#retry_max_times} + */ + readonly retryMaxTimes: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group huaweicloud_dms_rocketmq_consumer_group} +*/ +export class DmsRocketmqConsumerGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_consumer_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqConsumerGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqConsumerGroup to import + * @param importFromId The id of the existing DmsRocketmqConsumerGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqConsumerGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_consumer_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumer_group huaweicloud_dms_rocketmq_consumer_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqConsumerGroupConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqConsumerGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_consumer_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._broadcast = config.broadcast; + this._brokers = config.brokers; + this._consumeOrderly = config.consumeOrderly; + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._retryMaxTimes = config.retryMaxTimes; + } + + // ========== + // ATTRIBUTES + // ========== + + // broadcast - computed: true, optional: true, required: false + private _broadcast?: boolean | cdktf.IResolvable; + public get broadcast() { + return this.getBooleanAttribute('broadcast'); + } + public set broadcast(value: boolean | cdktf.IResolvable) { + this._broadcast = value; + } + public resetBroadcast() { + this._broadcast = undefined; + } + // Temporarily expose input value. Use with caution. + public get broadcastInput() { + return this._broadcast; + } + + // brokers - computed: true, optional: true, required: false + private _brokers?: string[]; + public get brokers() { + return cdktf.Fn.tolist(this.getListAttribute('brokers')); + } + public set brokers(value: string[]) { + this._brokers = value; + } + public resetBrokers() { + this._brokers = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokersInput() { + return this._brokers; + } + + // consume_orderly - computed: true, optional: true, required: false + private _consumeOrderly?: boolean | cdktf.IResolvable; + public get consumeOrderly() { + return this.getBooleanAttribute('consume_orderly'); + } + public set consumeOrderly(value: boolean | cdktf.IResolvable) { + this._consumeOrderly = value; + } + public resetConsumeOrderly() { + this._consumeOrderly = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumeOrderlyInput() { + return this._consumeOrderly; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retry_max_times - computed: false, optional: false, required: true + private _retryMaxTimes?: number; + public get retryMaxTimes() { + return this.getNumberAttribute('retry_max_times'); + } + public set retryMaxTimes(value: number) { + this._retryMaxTimes = value; + } + // Temporarily expose input value. Use with caution. + public get retryMaxTimesInput() { + return this._retryMaxTimes; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + broadcast: cdktf.booleanToTerraform(this._broadcast), + brokers: cdktf.listMapper(cdktf.stringToTerraform, false)(this._brokers), + consume_orderly: cdktf.booleanToTerraform(this._consumeOrderly), + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + retry_max_times: cdktf.numberToTerraform(this._retryMaxTimes), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + broadcast: { + value: cdktf.booleanToHclTerraform(this._broadcast), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + brokers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._brokers), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + consume_orderly: { + value: cdktf.booleanToHclTerraform(this._consumeOrderly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retry_max_times: { + value: cdktf.numberToHclTerraform(this._retryMaxTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/README.md new file mode 100644 index 00000000..2ea3949b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_consumption_verify` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_consumption_verify`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/index.ts new file mode 100644 index 00000000..c057bd03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-consumption-verify/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqConsumptionVerifyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#client_id DmsRocketmqConsumptionVerify#client_id} + */ + readonly clientId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#group DmsRocketmqConsumptionVerify#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#id DmsRocketmqConsumptionVerify#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#instance_id DmsRocketmqConsumptionVerify#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#message_id_list DmsRocketmqConsumptionVerify#message_id_list} + */ + readonly messageIdList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#region DmsRocketmqConsumptionVerify#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#topic DmsRocketmqConsumptionVerify#topic} + */ + readonly topic?: string; +} +export interface DmsRocketmqConsumptionVerifyResendResults { +} + +export function dmsRocketmqConsumptionVerifyResendResultsToTerraform(struct?: DmsRocketmqConsumptionVerifyResendResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRocketmqConsumptionVerifyResendResultsToHclTerraform(struct?: DmsRocketmqConsumptionVerifyResendResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRocketmqConsumptionVerifyResendResultsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqConsumptionVerifyResendResults | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqConsumptionVerifyResendResults | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // error_message - computed: true, optional: false, required: false + public get errorMessage() { + return this.getStringAttribute('error_message'); + } + + // message_id - computed: true, optional: false, required: false + public get messageId() { + return this.getStringAttribute('message_id'); + } +} + +export class DmsRocketmqConsumptionVerifyResendResultsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqConsumptionVerifyResendResultsOutputReference { + return new DmsRocketmqConsumptionVerifyResendResultsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify huaweicloud_dms_rocketmq_consumption_verify} +*/ +export class DmsRocketmqConsumptionVerify extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_consumption_verify"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqConsumptionVerify resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqConsumptionVerify to import + * @param importFromId The id of the existing DmsRocketmqConsumptionVerify that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqConsumptionVerify to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_consumption_verify", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_consumption_verify huaweicloud_dms_rocketmq_consumption_verify} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqConsumptionVerifyConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqConsumptionVerifyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_consumption_verify', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clientId = config.clientId; + this._group = config.group; + this._id = config.id; + this._instanceId = config.instanceId; + this._messageIdList = config.messageIdList; + this._region = config.region; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // client_id - computed: false, optional: true, required: false + private _clientId?: string; + public get clientId() { + return this.getStringAttribute('client_id'); + } + public set clientId(value: string) { + this._clientId = value; + } + public resetClientId() { + this._clientId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientIdInput() { + return this._clientId; + } + + // group - computed: false, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // message_id_list - computed: false, optional: true, required: false + private _messageIdList?: string[]; + public get messageIdList() { + return this.getListAttribute('message_id_list'); + } + public set messageIdList(value: string[]) { + this._messageIdList = value; + } + public resetMessageIdList() { + this._messageIdList = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageIdListInput() { + return this._messageIdList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resend_results - computed: true, optional: false, required: false + private _resendResults = new DmsRocketmqConsumptionVerifyResendResultsList(this, "resend_results", false); + public get resendResults() { + return this._resendResults; + } + + // topic - computed: false, optional: true, required: false + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + public resetTopic() { + this._topic = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + client_id: cdktf.stringToTerraform(this._clientId), + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + message_id_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._messageIdList), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + client_id: { + value: cdktf.stringToHclTerraform(this._clientId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_id_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._messageIdList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/README.md new file mode 100644 index 00000000..bbe1a5cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_dead_letter_resend` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_dead_letter_resend`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/index.ts new file mode 100644 index 00000000..eadcc7dd --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-dead-letter-resend/index.ts @@ -0,0 +1,310 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqDeadLetterResendConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend#id DmsRocketmqDeadLetterResend#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend#instance_id DmsRocketmqDeadLetterResend#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend#message_id_list DmsRocketmqDeadLetterResend#message_id_list} + */ + readonly messageIdList: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend#region DmsRocketmqDeadLetterResend#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend#topic DmsRocketmqDeadLetterResend#topic} + */ + readonly topic: string; +} +export interface DmsRocketmqDeadLetterResendResendResults { +} + +export function dmsRocketmqDeadLetterResendResendResultsToTerraform(struct?: DmsRocketmqDeadLetterResendResendResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRocketmqDeadLetterResendResendResultsToHclTerraform(struct?: DmsRocketmqDeadLetterResendResendResults): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRocketmqDeadLetterResendResendResultsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqDeadLetterResendResendResults | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqDeadLetterResendResendResults | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // error_message - computed: true, optional: false, required: false + public get errorMessage() { + return this.getStringAttribute('error_message'); + } + + // message_id - computed: true, optional: false, required: false + public get messageId() { + return this.getStringAttribute('message_id'); + } +} + +export class DmsRocketmqDeadLetterResendResendResultsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqDeadLetterResendResendResultsOutputReference { + return new DmsRocketmqDeadLetterResendResendResultsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend huaweicloud_dms_rocketmq_dead_letter_resend} +*/ +export class DmsRocketmqDeadLetterResend extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_dead_letter_resend"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqDeadLetterResend resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqDeadLetterResend to import + * @param importFromId The id of the existing DmsRocketmqDeadLetterResend that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqDeadLetterResend to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_dead_letter_resend", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_dead_letter_resend huaweicloud_dms_rocketmq_dead_letter_resend} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqDeadLetterResendConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqDeadLetterResendConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_dead_letter_resend', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._messageIdList = config.messageIdList; + this._region = config.region; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // message_id_list - computed: false, optional: false, required: true + private _messageIdList?: string[]; + public get messageIdList() { + return this.getListAttribute('message_id_list'); + } + public set messageIdList(value: string[]) { + this._messageIdList = value; + } + // Temporarily expose input value. Use with caution. + public get messageIdListInput() { + return this._messageIdList; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resend_results - computed: true, optional: false, required: false + private _resendResults = new DmsRocketmqDeadLetterResendResendResultsList(this, "resend_results", false); + public get resendResults() { + return this._resendResults; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + message_id_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._messageIdList), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_id_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._messageIdList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-instance/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-instance/README.md new file mode 100644 index 00000000..31498e04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-instance/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-instance/index.ts new file mode 100644 index 00000000..ff863852 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-instance/index.ts @@ -0,0 +1,1331 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#auto_renew DmsRocketmqInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Specifies the list of availability zone names + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#availability_zones DmsRocketmqInstance#availability_zones} + */ + readonly availabilityZones: string[]; + /** + * Specifies the broker numbers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#broker_num DmsRocketmqInstance#broker_num} + */ + readonly brokerNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#charging_mode DmsRocketmqInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Specifies the description of the DMS RocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#description DmsRocketmqInstance#description} + */ + readonly description?: string; + /** + * Specifies whether access control is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#enable_acl DmsRocketmqInstance#enable_acl} + */ + readonly enableAcl?: boolean | cdktf.IResolvable; + /** + * Specifies whether to enable public access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#enable_publicip DmsRocketmqInstance#enable_publicip} + */ + readonly enablePublicip?: boolean | cdktf.IResolvable; + /** + * Specifies the version of the RocketMQ engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#engine_version DmsRocketmqInstance#engine_version} + */ + readonly engineVersion: string; + /** + * Specifies the enterprise project id of the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#enterprise_project_id DmsRocketmqInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies a product ID + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#flavor_id DmsRocketmqInstance#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#id DmsRocketmqInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether to support IPv6 + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#ipv6_enable DmsRocketmqInstance#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Specifies the name of the DMS RocketMQ instance + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#name DmsRocketmqInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#period DmsRocketmqInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#period_unit DmsRocketmqInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Specifies the ID of the EIP bound to the instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#publicip_id DmsRocketmqInstance#publicip_id} + */ + readonly publicipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#region DmsRocketmqInstance#region} + */ + readonly region?: string; + /** + * Specifies whether access control is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#retention_policy DmsRocketmqInstance#retention_policy} + */ + readonly retentionPolicy?: boolean | cdktf.IResolvable; + /** + * Specifies the ID of a security group + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#security_group_id DmsRocketmqInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Specifies whether the RocketMQ SASL_SSL is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#ssl_enable DmsRocketmqInstance#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Specifies the message storage capacity, Unit: GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#storage_space DmsRocketmqInstance#storage_space} + */ + readonly storageSpace: number; + /** + * Specifies the storage I/O specification + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#storage_spec_code DmsRocketmqInstance#storage_spec_code} + */ + readonly storageSpecCode: string; + /** + * Specifies the ID of a subnet + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#subnet_id DmsRocketmqInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#tags DmsRocketmqInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the ID of a VPC + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#vpc_id DmsRocketmqInstance#vpc_id} + */ + readonly vpcId: string; + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#configs DmsRocketmqInstance#configs} + */ + readonly configs?: DmsRocketmqInstanceConfigs[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#timeouts DmsRocketmqInstance#timeouts} + */ + readonly timeouts?: DmsRocketmqInstanceTimeouts; +} +export interface DmsRocketmqInstanceCrossVpcAccesses { +} + +export function dmsRocketmqInstanceCrossVpcAccessesToTerraform(struct?: DmsRocketmqInstanceCrossVpcAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dmsRocketmqInstanceCrossVpcAccessesToHclTerraform(struct?: DmsRocketmqInstanceCrossVpcAccesses): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DmsRocketmqInstanceCrossVpcAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqInstanceCrossVpcAccesses | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqInstanceCrossVpcAccesses | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // advertised_ip - computed: true, optional: false, required: false + public get advertisedIp() { + return this.getStringAttribute('advertised_ip'); + } + + // lisenter_ip - computed: true, optional: false, required: false + public get lisenterIp() { + return this.getStringAttribute('lisenter_ip'); + } + + // listener_ip - computed: true, optional: false, required: false + public get listenerIp() { + return this.getStringAttribute('listener_ip'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } +} + +export class DmsRocketmqInstanceCrossVpcAccessesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqInstanceCrossVpcAccessesOutputReference { + return new DmsRocketmqInstanceCrossVpcAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqInstanceConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#name DmsRocketmqInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#value DmsRocketmqInstance#value} + */ + readonly value: string; +} + +export function dmsRocketmqInstanceConfigsToTerraform(struct?: DmsRocketmqInstanceConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dmsRocketmqInstanceConfigsToHclTerraform(struct?: DmsRocketmqInstanceConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqInstanceConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqInstanceConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqInstanceConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DmsRocketmqInstanceConfigsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqInstanceConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqInstanceConfigsOutputReference { + return new DmsRocketmqInstanceConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#create DmsRocketmqInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#delete DmsRocketmqInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#update DmsRocketmqInstance#update} + */ + readonly update?: string; +} + +export function dmsRocketmqInstanceTimeoutsToTerraform(struct?: DmsRocketmqInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dmsRocketmqInstanceTimeoutsToHclTerraform(struct?: DmsRocketmqInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsRocketmqInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance huaweicloud_dms_rocketmq_instance} +*/ +export class DmsRocketmqInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqInstance to import + * @param importFromId The id of the existing DmsRocketmqInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_instance huaweicloud_dms_rocketmq_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZones = config.availabilityZones; + this._brokerNum = config.brokerNum; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enableAcl = config.enableAcl; + this._enablePublicip = config.enablePublicip; + this._engineVersion = config.engineVersion; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._publicipId = config.publicipId; + this._region = config.region; + this._retentionPolicy = config.retentionPolicy; + this._securityGroupId = config.securityGroupId; + this._sslEnable = config.sslEnable; + this._storageSpace = config.storageSpace; + this._storageSpecCode = config.storageSpecCode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._configs.internalValue = config.configs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zones - computed: false, optional: false, required: true + private _availabilityZones?: string[]; + public get availabilityZones() { + return cdktf.Fn.tolist(this.getListAttribute('availability_zones')); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // broker_address - computed: true, optional: false, required: false + public get brokerAddress() { + return this.getStringAttribute('broker_address'); + } + + // broker_num - computed: false, optional: true, required: false + private _brokerNum?: number; + public get brokerNum() { + return this.getNumberAttribute('broker_num'); + } + public set brokerNum(value: number) { + this._brokerNum = value; + } + public resetBrokerNum() { + this._brokerNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokerNumInput() { + return this._brokerNum; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cross_vpc_accesses - computed: true, optional: false, required: false + private _crossVpcAccesses = new DmsRocketmqInstanceCrossVpcAccessesList(this, "cross_vpc_accesses", false); + public get crossVpcAccesses() { + return this._crossVpcAccesses; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_acl - computed: true, optional: true, required: false + private _enableAcl?: boolean | cdktf.IResolvable; + public get enableAcl() { + return this.getBooleanAttribute('enable_acl'); + } + public set enableAcl(value: boolean | cdktf.IResolvable) { + this._enableAcl = value; + } + public resetEnableAcl() { + this._enableAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAclInput() { + return this._enableAcl; + } + + // enable_publicip - computed: false, optional: true, required: false + private _enablePublicip?: boolean | cdktf.IResolvable; + public get enablePublicip() { + return this.getBooleanAttribute('enable_publicip'); + } + public set enablePublicip(value: boolean | cdktf.IResolvable) { + this._enablePublicip = value; + } + public resetEnablePublicip() { + this._enablePublicip = undefined; + } + // Temporarily expose input value. Use with caution. + public get enablePublicipInput() { + return this._enablePublicip; + } + + // engine_version - computed: false, optional: false, required: true + private _engineVersion?: string; + public get engineVersion() { + return this.getStringAttribute('engine_version'); + } + public set engineVersion(value: string) { + this._engineVersion = value; + } + // Temporarily expose input value. Use with caution. + public get engineVersionInput() { + return this._engineVersion; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // maintain_begin - computed: true, optional: false, required: false + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + + // maintain_end - computed: true, optional: false, required: false + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namesrv_address - computed: true, optional: false, required: false + public get namesrvAddress() { + return this.getStringAttribute('namesrv_address'); + } + + // new_spec_billing_enable - computed: true, optional: false, required: false + public get newSpecBillingEnable() { + return this.getBooleanAttribute('new_spec_billing_enable'); + } + + // node_num - computed: true, optional: false, required: false + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // public_broker_address - computed: true, optional: false, required: false + public get publicBrokerAddress() { + return this.getStringAttribute('public_broker_address'); + } + + // public_namesrv_address - computed: true, optional: false, required: false + public get publicNamesrvAddress() { + return this.getStringAttribute('public_namesrv_address'); + } + + // publicip_address - computed: true, optional: false, required: false + public get publicipAddress() { + return this.getStringAttribute('publicip_address'); + } + + // publicip_id - computed: false, optional: true, required: false + private _publicipId?: string; + public get publicipId() { + return this.getStringAttribute('publicip_id'); + } + public set publicipId(value: string) { + this._publicipId = value; + } + public resetPublicipId() { + this._publicipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicipIdInput() { + return this._publicipId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: true, optional: false, required: false + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + + // retention_policy - computed: true, optional: true, required: false + private _retentionPolicy?: boolean | cdktf.IResolvable; + public get retentionPolicy() { + return this.getBooleanAttribute('retention_policy'); + } + public set retentionPolicy(value: boolean | cdktf.IResolvable) { + this._retentionPolicy = value; + } + public resetRetentionPolicy() { + this._retentionPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionPolicyInput() { + return this._retentionPolicy; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // specification - computed: true, optional: false, required: false + public get specification() { + return this.getStringAttribute('specification'); + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_space - computed: false, optional: false, required: true + private _storageSpace?: number; + public get storageSpace() { + return this.getNumberAttribute('storage_space'); + } + public set storageSpace(value: number) { + this._storageSpace = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpaceInput() { + return this._storageSpace; + } + + // storage_spec_code - computed: false, optional: false, required: true + private _storageSpecCode?: string; + public get storageSpecCode() { + return this.getStringAttribute('storage_spec_code'); + } + public set storageSpecCode(value: string) { + this._storageSpecCode = value; + } + // Temporarily expose input value. Use with caution. + public get storageSpecCodeInput() { + return this._storageSpecCode; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // used_storage_space - computed: true, optional: false, required: false + public get usedStorageSpace() { + return this.getNumberAttribute('used_storage_space'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // configs - computed: false, optional: true, required: false + private _configs = new DmsRocketmqInstanceConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: DmsRocketmqInstanceConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + public resetConfigs() { + this._configs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsRocketmqInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsRocketmqInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + broker_num: cdktf.numberToTerraform(this._brokerNum), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enable_acl: cdktf.booleanToTerraform(this._enableAcl), + enable_publicip: cdktf.booleanToTerraform(this._enablePublicip), + engine_version: cdktf.stringToTerraform(this._engineVersion), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + publicip_id: cdktf.stringToTerraform(this._publicipId), + region: cdktf.stringToTerraform(this._region), + retention_policy: cdktf.booleanToTerraform(this._retentionPolicy), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + storage_space: cdktf.numberToTerraform(this._storageSpace), + storage_spec_code: cdktf.stringToTerraform(this._storageSpecCode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + configs: cdktf.listMapper(dmsRocketmqInstanceConfigsToTerraform, true)(this._configs.internalValue), + timeouts: dmsRocketmqInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + broker_num: { + value: cdktf.numberToHclTerraform(this._brokerNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_acl: { + value: cdktf.booleanToHclTerraform(this._enableAcl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_publicip: { + value: cdktf.booleanToHclTerraform(this._enablePublicip), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + engine_version: { + value: cdktf.stringToHclTerraform(this._engineVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publicip_id: { + value: cdktf.stringToHclTerraform(this._publicipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_policy: { + value: cdktf.booleanToHclTerraform(this._retentionPolicy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + storage_space: { + value: cdktf.numberToHclTerraform(this._storageSpace), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_spec_code: { + value: cdktf.stringToHclTerraform(this._storageSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configs: { + value: cdktf.listMapperHcl(dmsRocketmqInstanceConfigsToHclTerraform, true)(this._configs.internalValue), + isBlock: true, + type: "set", + storageClassType: "DmsRocketmqInstanceConfigsList", + }, + timeouts: { + value: dmsRocketmqInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsRocketmqInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/README.md new file mode 100644 index 00000000..bf9dd90b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_message_offset_reset` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_message_offset_reset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/index.ts new file mode 100644 index 00000000..d558517a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-message-offset-reset/index.ts @@ -0,0 +1,244 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqMessageOffsetResetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#group DmsRocketmqMessageOffsetReset#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#id DmsRocketmqMessageOffsetReset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#instance_id DmsRocketmqMessageOffsetReset#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#region DmsRocketmqMessageOffsetReset#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#timestamp DmsRocketmqMessageOffsetReset#timestamp} + */ + readonly timestamp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#topic DmsRocketmqMessageOffsetReset#topic} + */ + readonly topic: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset huaweicloud_dms_rocketmq_message_offset_reset} +*/ +export class DmsRocketmqMessageOffsetReset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_message_offset_reset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqMessageOffsetReset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqMessageOffsetReset to import + * @param importFromId The id of the existing DmsRocketmqMessageOffsetReset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqMessageOffsetReset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_message_offset_reset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_message_offset_reset huaweicloud_dms_rocketmq_message_offset_reset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqMessageOffsetResetConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqMessageOffsetResetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_message_offset_reset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timestamp = config.timestamp; + this._topic = config.topic; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timestamp - computed: false, optional: false, required: true + private _timestamp?: string; + public get timestamp() { + return this.getStringAttribute('timestamp'); + } + public set timestamp(value: string) { + this._timestamp = value; + } + // Temporarily expose input value. Use with caution. + public get timestampInput() { + return this._timestamp; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timestamp: cdktf.stringToTerraform(this._timestamp), + topic: cdktf.stringToTerraform(this._topic), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timestamp: { + value: cdktf.stringToHclTerraform(this._timestamp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/README.md new file mode 100644 index 00000000..9fdf5c70 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_migration_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_migration_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/index.ts new file mode 100644 index 00000000..9e53b598 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-migration-task/index.ts @@ -0,0 +1,2071 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqMigrationTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#id DmsRocketmqMigrationTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#instance_id DmsRocketmqMigrationTask#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the migration task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#name DmsRocketmqMigrationTask#name} + */ + readonly name: string; + /** + * Specifies whether to overwrite configurations with the same name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#overwrite DmsRocketmqMigrationTask#overwrite} + */ + readonly overwrite: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#region DmsRocketmqMigrationTask#region} + */ + readonly region?: string; + /** + * Specifies the migration task type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#type DmsRocketmqMigrationTask#type} + */ + readonly type: string; + /** + * bindings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#bindings DmsRocketmqMigrationTask#bindings} + */ + readonly bindings?: DmsRocketmqMigrationTaskBindings[] | cdktf.IResolvable; + /** + * exchanges block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#exchanges DmsRocketmqMigrationTask#exchanges} + */ + readonly exchanges?: DmsRocketmqMigrationTaskExchanges[] | cdktf.IResolvable; + /** + * queues block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#queues DmsRocketmqMigrationTask#queues} + */ + readonly queues?: DmsRocketmqMigrationTaskQueues[] | cdktf.IResolvable; + /** + * subscription_groups block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#subscription_groups DmsRocketmqMigrationTask#subscription_groups} + */ + readonly subscriptionGroups?: DmsRocketmqMigrationTaskSubscriptionGroups[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#timeouts DmsRocketmqMigrationTask#timeouts} + */ + readonly timeouts?: DmsRocketmqMigrationTaskTimeouts; + /** + * topic_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#topic_configs DmsRocketmqMigrationTask#topic_configs} + */ + readonly topicConfigs?: DmsRocketmqMigrationTaskTopicConfigs[] | cdktf.IResolvable; + /** + * vhosts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#vhosts DmsRocketmqMigrationTask#vhosts} + */ + readonly vhosts?: DmsRocketmqMigrationTaskVhosts[] | cdktf.IResolvable; +} +export interface DmsRocketmqMigrationTaskBindings { + /** + * Specifies the message target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#destination DmsRocketmqMigrationTask#destination} + */ + readonly destination?: string; + /** + * Specifies the message target type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#destination_type DmsRocketmqMigrationTask#destination_type} + */ + readonly destinationType?: string; + /** + * Specifies the routing key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#routing_key DmsRocketmqMigrationTask#routing_key} + */ + readonly routingKey?: string; + /** + * Specifies the message source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#source DmsRocketmqMigrationTask#source} + */ + readonly source?: string; + /** + * Specifies the virtual host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#vhost DmsRocketmqMigrationTask#vhost} + */ + readonly vhost?: string; +} + +export function dmsRocketmqMigrationTaskBindingsToTerraform(struct?: DmsRocketmqMigrationTaskBindings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + destination: cdktf.stringToTerraform(struct!.destination), + destination_type: cdktf.stringToTerraform(struct!.destinationType), + routing_key: cdktf.stringToTerraform(struct!.routingKey), + source: cdktf.stringToTerraform(struct!.source), + vhost: cdktf.stringToTerraform(struct!.vhost), + } +} + + +export function dmsRocketmqMigrationTaskBindingsToHclTerraform(struct?: DmsRocketmqMigrationTaskBindings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(struct!.destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_type: { + value: cdktf.stringToHclTerraform(struct!.destinationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + routing_key: { + value: cdktf.stringToHclTerraform(struct!.routingKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(struct!.source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(struct!.vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskBindingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqMigrationTaskBindings | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destination !== undefined) { + hasAnyValues = true; + internalValueResult.destination = this._destination; + } + if (this._destinationType !== undefined) { + hasAnyValues = true; + internalValueResult.destinationType = this._destinationType; + } + if (this._routingKey !== undefined) { + hasAnyValues = true; + internalValueResult.routingKey = this._routingKey; + } + if (this._source !== undefined) { + hasAnyValues = true; + internalValueResult.source = this._source; + } + if (this._vhost !== undefined) { + hasAnyValues = true; + internalValueResult.vhost = this._vhost; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskBindings | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destination = undefined; + this._destinationType = undefined; + this._routingKey = undefined; + this._source = undefined; + this._vhost = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destination = value.destination; + this._destinationType = value.destinationType; + this._routingKey = value.routingKey; + this._source = value.source; + this._vhost = value.vhost; + } + } + + // destination - computed: false, optional: true, required: false + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // destination_type - computed: true, optional: true, required: false + private _destinationType?: string; + public get destinationType() { + return this.getStringAttribute('destination_type'); + } + public set destinationType(value: string) { + this._destinationType = value; + } + public resetDestinationType() { + this._destinationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationTypeInput() { + return this._destinationType; + } + + // routing_key - computed: true, optional: true, required: false + private _routingKey?: string; + public get routingKey() { + return this.getStringAttribute('routing_key'); + } + public set routingKey(value: string) { + this._routingKey = value; + } + public resetRoutingKey() { + this._routingKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get routingKeyInput() { + return this._routingKey; + } + + // source - computed: true, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // vhost - computed: true, optional: true, required: false + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + public resetVhost() { + this._vhost = undefined; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } +} + +export class DmsRocketmqMigrationTaskBindingsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqMigrationTaskBindings[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqMigrationTaskBindingsOutputReference { + return new DmsRocketmqMigrationTaskBindingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqMigrationTaskExchanges { + /** + * Specifies whether to enable data persistence. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#durable DmsRocketmqMigrationTask#durable} + */ + readonly durable?: boolean | cdktf.IResolvable; + /** + * Specifies the switch name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#name DmsRocketmqMigrationTask#name} + */ + readonly name?: string; + /** + * Specifies the exchange type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#type DmsRocketmqMigrationTask#type} + */ + readonly type?: string; + /** + * Specifies the virtual host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#vhost DmsRocketmqMigrationTask#vhost} + */ + readonly vhost?: string; +} + +export function dmsRocketmqMigrationTaskExchangesToTerraform(struct?: DmsRocketmqMigrationTaskExchanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + durable: cdktf.booleanToTerraform(struct!.durable), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + vhost: cdktf.stringToTerraform(struct!.vhost), + } +} + + +export function dmsRocketmqMigrationTaskExchangesToHclTerraform(struct?: DmsRocketmqMigrationTaskExchanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + durable: { + value: cdktf.booleanToHclTerraform(struct!.durable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(struct!.vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskExchangesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqMigrationTaskExchanges | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._durable !== undefined) { + hasAnyValues = true; + internalValueResult.durable = this._durable; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._vhost !== undefined) { + hasAnyValues = true; + internalValueResult.vhost = this._vhost; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskExchanges | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._durable = undefined; + this._name = undefined; + this._type = undefined; + this._vhost = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._durable = value.durable; + this._name = value.name; + this._type = value.type; + this._vhost = value.vhost; + } + } + + // durable - computed: true, optional: true, required: false + private _durable?: boolean | cdktf.IResolvable; + public get durable() { + return this.getBooleanAttribute('durable'); + } + public set durable(value: boolean | cdktf.IResolvable) { + this._durable = value; + } + public resetDurable() { + this._durable = undefined; + } + // Temporarily expose input value. Use with caution. + public get durableInput() { + return this._durable; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vhost - computed: true, optional: true, required: false + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + public resetVhost() { + this._vhost = undefined; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } +} + +export class DmsRocketmqMigrationTaskExchangesList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqMigrationTaskExchanges[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqMigrationTaskExchangesOutputReference { + return new DmsRocketmqMigrationTaskExchangesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqMigrationTaskQueues { + /** + * Specifies whether to enable data persistence. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#durable DmsRocketmqMigrationTask#durable} + */ + readonly durable?: boolean | cdktf.IResolvable; + /** + * Specifies the queue name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#name DmsRocketmqMigrationTask#name} + */ + readonly name?: string; + /** + * Specifies the virtual host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#vhost DmsRocketmqMigrationTask#vhost} + */ + readonly vhost?: string; +} + +export function dmsRocketmqMigrationTaskQueuesToTerraform(struct?: DmsRocketmqMigrationTaskQueues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + durable: cdktf.booleanToTerraform(struct!.durable), + name: cdktf.stringToTerraform(struct!.name), + vhost: cdktf.stringToTerraform(struct!.vhost), + } +} + + +export function dmsRocketmqMigrationTaskQueuesToHclTerraform(struct?: DmsRocketmqMigrationTaskQueues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + durable: { + value: cdktf.booleanToHclTerraform(struct!.durable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vhost: { + value: cdktf.stringToHclTerraform(struct!.vhost), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqMigrationTaskQueues | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._durable !== undefined) { + hasAnyValues = true; + internalValueResult.durable = this._durable; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._vhost !== undefined) { + hasAnyValues = true; + internalValueResult.vhost = this._vhost; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskQueues | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._durable = undefined; + this._name = undefined; + this._vhost = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._durable = value.durable; + this._name = value.name; + this._vhost = value.vhost; + } + } + + // durable - computed: true, optional: true, required: false + private _durable?: boolean | cdktf.IResolvable; + public get durable() { + return this.getBooleanAttribute('durable'); + } + public set durable(value: boolean | cdktf.IResolvable) { + this._durable = value; + } + public resetDurable() { + this._durable = undefined; + } + // Temporarily expose input value. Use with caution. + public get durableInput() { + return this._durable; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // vhost - computed: true, optional: true, required: false + private _vhost?: string; + public get vhost() { + return this.getStringAttribute('vhost'); + } + public set vhost(value: string) { + this._vhost = value; + } + public resetVhost() { + this._vhost = undefined; + } + // Temporarily expose input value. Use with caution. + public get vhostInput() { + return this._vhost; + } +} + +export class DmsRocketmqMigrationTaskQueuesList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqMigrationTaskQueues[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqMigrationTaskQueuesOutputReference { + return new DmsRocketmqMigrationTaskQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqMigrationTaskSubscriptionGroups { + /** + * Specifies whether to enable broadcast. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#consume_broadcast_enable DmsRocketmqMigrationTask#consume_broadcast_enable} + */ + readonly consumeBroadcastEnable?: boolean | cdktf.IResolvable; + /** + * Specifies whether to enable consumption. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#consume_enable DmsRocketmqMigrationTask#consume_enable} + */ + readonly consumeEnable?: boolean | cdktf.IResolvable; + /** + * Specifies whether to enable consumption from the earliest offset. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#consume_from_min_enable DmsRocketmqMigrationTask#consume_from_min_enable} + */ + readonly consumeFromMinEnable?: boolean | cdktf.IResolvable; + /** + * Specifies the name of a consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#group_name DmsRocketmqMigrationTask#group_name} + */ + readonly groupName: string; + /** + * Specifies whether to notify changes of consumer IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#notify_consumerids_changed_enable DmsRocketmqMigrationTask#notify_consumerids_changed_enable} + */ + readonly notifyConsumeridsChangedEnable?: boolean | cdktf.IResolvable; + /** + * Specifies the maximum number of consumption retries. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#retry_max_times DmsRocketmqMigrationTask#retry_max_times} + */ + readonly retryMaxTimes?: number; + /** + * Specifies the number of retry queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#retry_queue_num DmsRocketmqMigrationTask#retry_queue_num} + */ + readonly retryQueueNum?: number; + /** + * Specifies the ID of the broker selected for slow consumption. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#which_broker_when_consume_slow DmsRocketmqMigrationTask#which_broker_when_consume_slow} + */ + readonly whichBrokerWhenConsumeSlow?: number; +} + +export function dmsRocketmqMigrationTaskSubscriptionGroupsToTerraform(struct?: DmsRocketmqMigrationTaskSubscriptionGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + consume_broadcast_enable: cdktf.booleanToTerraform(struct!.consumeBroadcastEnable), + consume_enable: cdktf.booleanToTerraform(struct!.consumeEnable), + consume_from_min_enable: cdktf.booleanToTerraform(struct!.consumeFromMinEnable), + group_name: cdktf.stringToTerraform(struct!.groupName), + notify_consumerids_changed_enable: cdktf.booleanToTerraform(struct!.notifyConsumeridsChangedEnable), + retry_max_times: cdktf.numberToTerraform(struct!.retryMaxTimes), + retry_queue_num: cdktf.numberToTerraform(struct!.retryQueueNum), + which_broker_when_consume_slow: cdktf.numberToTerraform(struct!.whichBrokerWhenConsumeSlow), + } +} + + +export function dmsRocketmqMigrationTaskSubscriptionGroupsToHclTerraform(struct?: DmsRocketmqMigrationTaskSubscriptionGroups | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + consume_broadcast_enable: { + value: cdktf.booleanToHclTerraform(struct!.consumeBroadcastEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + consume_enable: { + value: cdktf.booleanToHclTerraform(struct!.consumeEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + consume_from_min_enable: { + value: cdktf.booleanToHclTerraform(struct!.consumeFromMinEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notify_consumerids_changed_enable: { + value: cdktf.booleanToHclTerraform(struct!.notifyConsumeridsChangedEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + retry_max_times: { + value: cdktf.numberToHclTerraform(struct!.retryMaxTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + retry_queue_num: { + value: cdktf.numberToHclTerraform(struct!.retryQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + which_broker_when_consume_slow: { + value: cdktf.numberToHclTerraform(struct!.whichBrokerWhenConsumeSlow), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskSubscriptionGroupsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqMigrationTaskSubscriptionGroups | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._consumeBroadcastEnable !== undefined) { + hasAnyValues = true; + internalValueResult.consumeBroadcastEnable = this._consumeBroadcastEnable; + } + if (this._consumeEnable !== undefined) { + hasAnyValues = true; + internalValueResult.consumeEnable = this._consumeEnable; + } + if (this._consumeFromMinEnable !== undefined) { + hasAnyValues = true; + internalValueResult.consumeFromMinEnable = this._consumeFromMinEnable; + } + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._notifyConsumeridsChangedEnable !== undefined) { + hasAnyValues = true; + internalValueResult.notifyConsumeridsChangedEnable = this._notifyConsumeridsChangedEnable; + } + if (this._retryMaxTimes !== undefined) { + hasAnyValues = true; + internalValueResult.retryMaxTimes = this._retryMaxTimes; + } + if (this._retryQueueNum !== undefined) { + hasAnyValues = true; + internalValueResult.retryQueueNum = this._retryQueueNum; + } + if (this._whichBrokerWhenConsumeSlow !== undefined) { + hasAnyValues = true; + internalValueResult.whichBrokerWhenConsumeSlow = this._whichBrokerWhenConsumeSlow; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskSubscriptionGroups | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._consumeBroadcastEnable = undefined; + this._consumeEnable = undefined; + this._consumeFromMinEnable = undefined; + this._groupName = undefined; + this._notifyConsumeridsChangedEnable = undefined; + this._retryMaxTimes = undefined; + this._retryQueueNum = undefined; + this._whichBrokerWhenConsumeSlow = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._consumeBroadcastEnable = value.consumeBroadcastEnable; + this._consumeEnable = value.consumeEnable; + this._consumeFromMinEnable = value.consumeFromMinEnable; + this._groupName = value.groupName; + this._notifyConsumeridsChangedEnable = value.notifyConsumeridsChangedEnable; + this._retryMaxTimes = value.retryMaxTimes; + this._retryQueueNum = value.retryQueueNum; + this._whichBrokerWhenConsumeSlow = value.whichBrokerWhenConsumeSlow; + } + } + + // consume_broadcast_enable - computed: true, optional: true, required: false + private _consumeBroadcastEnable?: boolean | cdktf.IResolvable; + public get consumeBroadcastEnable() { + return this.getBooleanAttribute('consume_broadcast_enable'); + } + public set consumeBroadcastEnable(value: boolean | cdktf.IResolvable) { + this._consumeBroadcastEnable = value; + } + public resetConsumeBroadcastEnable() { + this._consumeBroadcastEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumeBroadcastEnableInput() { + return this._consumeBroadcastEnable; + } + + // consume_enable - computed: true, optional: true, required: false + private _consumeEnable?: boolean | cdktf.IResolvable; + public get consumeEnable() { + return this.getBooleanAttribute('consume_enable'); + } + public set consumeEnable(value: boolean | cdktf.IResolvable) { + this._consumeEnable = value; + } + public resetConsumeEnable() { + this._consumeEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumeEnableInput() { + return this._consumeEnable; + } + + // consume_from_min_enable - computed: true, optional: true, required: false + private _consumeFromMinEnable?: boolean | cdktf.IResolvable; + public get consumeFromMinEnable() { + return this.getBooleanAttribute('consume_from_min_enable'); + } + public set consumeFromMinEnable(value: boolean | cdktf.IResolvable) { + this._consumeFromMinEnable = value; + } + public resetConsumeFromMinEnable() { + this._consumeFromMinEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get consumeFromMinEnableInput() { + return this._consumeFromMinEnable; + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // notify_consumerids_changed_enable - computed: true, optional: true, required: false + private _notifyConsumeridsChangedEnable?: boolean | cdktf.IResolvable; + public get notifyConsumeridsChangedEnable() { + return this.getBooleanAttribute('notify_consumerids_changed_enable'); + } + public set notifyConsumeridsChangedEnable(value: boolean | cdktf.IResolvable) { + this._notifyConsumeridsChangedEnable = value; + } + public resetNotifyConsumeridsChangedEnable() { + this._notifyConsumeridsChangedEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get notifyConsumeridsChangedEnableInput() { + return this._notifyConsumeridsChangedEnable; + } + + // retry_max_times - computed: true, optional: true, required: false + private _retryMaxTimes?: number; + public get retryMaxTimes() { + return this.getNumberAttribute('retry_max_times'); + } + public set retryMaxTimes(value: number) { + this._retryMaxTimes = value; + } + public resetRetryMaxTimes() { + this._retryMaxTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryMaxTimesInput() { + return this._retryMaxTimes; + } + + // retry_queue_num - computed: true, optional: true, required: false + private _retryQueueNum?: number; + public get retryQueueNum() { + return this.getNumberAttribute('retry_queue_num'); + } + public set retryQueueNum(value: number) { + this._retryQueueNum = value; + } + public resetRetryQueueNum() { + this._retryQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryQueueNumInput() { + return this._retryQueueNum; + } + + // which_broker_when_consume_slow - computed: true, optional: true, required: false + private _whichBrokerWhenConsumeSlow?: number; + public get whichBrokerWhenConsumeSlow() { + return this.getNumberAttribute('which_broker_when_consume_slow'); + } + public set whichBrokerWhenConsumeSlow(value: number) { + this._whichBrokerWhenConsumeSlow = value; + } + public resetWhichBrokerWhenConsumeSlow() { + this._whichBrokerWhenConsumeSlow = undefined; + } + // Temporarily expose input value. Use with caution. + public get whichBrokerWhenConsumeSlowInput() { + return this._whichBrokerWhenConsumeSlow; + } +} + +export class DmsRocketmqMigrationTaskSubscriptionGroupsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqMigrationTaskSubscriptionGroups[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqMigrationTaskSubscriptionGroupsOutputReference { + return new DmsRocketmqMigrationTaskSubscriptionGroupsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqMigrationTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#create DmsRocketmqMigrationTask#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#delete DmsRocketmqMigrationTask#delete} + */ + readonly delete?: string; +} + +export function dmsRocketmqMigrationTaskTimeoutsToTerraform(struct?: DmsRocketmqMigrationTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dmsRocketmqMigrationTaskTimeoutsToHclTerraform(struct?: DmsRocketmqMigrationTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DmsRocketmqMigrationTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} +export interface DmsRocketmqMigrationTaskTopicConfigs { + /** + * Specifies whether a message is an ordered message. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#order DmsRocketmqMigrationTask#order} + */ + readonly order?: boolean | cdktf.IResolvable; + /** + * Specifies the number of permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#perm DmsRocketmqMigrationTask#perm} + */ + readonly perm?: number; + /** + * Specifies the number of read queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#read_queue_num DmsRocketmqMigrationTask#read_queue_num} + */ + readonly readQueueNum?: number; + /** + * Specifies the filter type of a topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#topic_filter_type DmsRocketmqMigrationTask#topic_filter_type} + */ + readonly topicFilterType?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#topic_name DmsRocketmqMigrationTask#topic_name} + */ + readonly topicName: string; + /** + * Specifies the system flag of a topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#topic_sys_flag DmsRocketmqMigrationTask#topic_sys_flag} + */ + readonly topicSysFlag?: number; + /** + * Specifies the number of write queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#write_queue_num DmsRocketmqMigrationTask#write_queue_num} + */ + readonly writeQueueNum?: number; +} + +export function dmsRocketmqMigrationTaskTopicConfigsToTerraform(struct?: DmsRocketmqMigrationTaskTopicConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + order: cdktf.booleanToTerraform(struct!.order), + perm: cdktf.numberToTerraform(struct!.perm), + read_queue_num: cdktf.numberToTerraform(struct!.readQueueNum), + topic_filter_type: cdktf.stringToTerraform(struct!.topicFilterType), + topic_name: cdktf.stringToTerraform(struct!.topicName), + topic_sys_flag: cdktf.numberToTerraform(struct!.topicSysFlag), + write_queue_num: cdktf.numberToTerraform(struct!.writeQueueNum), + } +} + + +export function dmsRocketmqMigrationTaskTopicConfigsToHclTerraform(struct?: DmsRocketmqMigrationTaskTopicConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + order: { + value: cdktf.booleanToHclTerraform(struct!.order), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + perm: { + value: cdktf.numberToHclTerraform(struct!.perm), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + read_queue_num: { + value: cdktf.numberToHclTerraform(struct!.readQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + topic_filter_type: { + value: cdktf.stringToHclTerraform(struct!.topicFilterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name: { + value: cdktf.stringToHclTerraform(struct!.topicName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_sys_flag: { + value: cdktf.numberToHclTerraform(struct!.topicSysFlag), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + write_queue_num: { + value: cdktf.numberToHclTerraform(struct!.writeQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskTopicConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqMigrationTaskTopicConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._order !== undefined) { + hasAnyValues = true; + internalValueResult.order = this._order; + } + if (this._perm !== undefined) { + hasAnyValues = true; + internalValueResult.perm = this._perm; + } + if (this._readQueueNum !== undefined) { + hasAnyValues = true; + internalValueResult.readQueueNum = this._readQueueNum; + } + if (this._topicFilterType !== undefined) { + hasAnyValues = true; + internalValueResult.topicFilterType = this._topicFilterType; + } + if (this._topicName !== undefined) { + hasAnyValues = true; + internalValueResult.topicName = this._topicName; + } + if (this._topicSysFlag !== undefined) { + hasAnyValues = true; + internalValueResult.topicSysFlag = this._topicSysFlag; + } + if (this._writeQueueNum !== undefined) { + hasAnyValues = true; + internalValueResult.writeQueueNum = this._writeQueueNum; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskTopicConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._order = undefined; + this._perm = undefined; + this._readQueueNum = undefined; + this._topicFilterType = undefined; + this._topicName = undefined; + this._topicSysFlag = undefined; + this._writeQueueNum = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._order = value.order; + this._perm = value.perm; + this._readQueueNum = value.readQueueNum; + this._topicFilterType = value.topicFilterType; + this._topicName = value.topicName; + this._topicSysFlag = value.topicSysFlag; + this._writeQueueNum = value.writeQueueNum; + } + } + + // order - computed: true, optional: true, required: false + private _order?: boolean | cdktf.IResolvable; + public get order() { + return this.getBooleanAttribute('order'); + } + public set order(value: boolean | cdktf.IResolvable) { + this._order = value; + } + public resetOrder() { + this._order = undefined; + } + // Temporarily expose input value. Use with caution. + public get orderInput() { + return this._order; + } + + // perm - computed: true, optional: true, required: false + private _perm?: number; + public get perm() { + return this.getNumberAttribute('perm'); + } + public set perm(value: number) { + this._perm = value; + } + public resetPerm() { + this._perm = undefined; + } + // Temporarily expose input value. Use with caution. + public get permInput() { + return this._perm; + } + + // read_queue_num - computed: true, optional: true, required: false + private _readQueueNum?: number; + public get readQueueNum() { + return this.getNumberAttribute('read_queue_num'); + } + public set readQueueNum(value: number) { + this._readQueueNum = value; + } + public resetReadQueueNum() { + this._readQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get readQueueNumInput() { + return this._readQueueNum; + } + + // topic_filter_type - computed: true, optional: true, required: false + private _topicFilterType?: string; + public get topicFilterType() { + return this.getStringAttribute('topic_filter_type'); + } + public set topicFilterType(value: string) { + this._topicFilterType = value; + } + public resetTopicFilterType() { + this._topicFilterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicFilterTypeInput() { + return this._topicFilterType; + } + + // topic_name - computed: false, optional: false, required: true + private _topicName?: string; + public get topicName() { + return this.getStringAttribute('topic_name'); + } + public set topicName(value: string) { + this._topicName = value; + } + // Temporarily expose input value. Use with caution. + public get topicNameInput() { + return this._topicName; + } + + // topic_sys_flag - computed: true, optional: true, required: false + private _topicSysFlag?: number; + public get topicSysFlag() { + return this.getNumberAttribute('topic_sys_flag'); + } + public set topicSysFlag(value: number) { + this._topicSysFlag = value; + } + public resetTopicSysFlag() { + this._topicSysFlag = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicSysFlagInput() { + return this._topicSysFlag; + } + + // write_queue_num - computed: true, optional: true, required: false + private _writeQueueNum?: number; + public get writeQueueNum() { + return this.getNumberAttribute('write_queue_num'); + } + public set writeQueueNum(value: number) { + this._writeQueueNum = value; + } + public resetWriteQueueNum() { + this._writeQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get writeQueueNumInput() { + return this._writeQueueNum; + } +} + +export class DmsRocketmqMigrationTaskTopicConfigsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqMigrationTaskTopicConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqMigrationTaskTopicConfigsOutputReference { + return new DmsRocketmqMigrationTaskTopicConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqMigrationTaskVhosts { + /** + * Specifies the virtual host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#name DmsRocketmqMigrationTask#name} + */ + readonly name?: string; +} + +export function dmsRocketmqMigrationTaskVhostsToTerraform(struct?: DmsRocketmqMigrationTaskVhosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dmsRocketmqMigrationTaskVhostsToHclTerraform(struct?: DmsRocketmqMigrationTaskVhosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqMigrationTaskVhostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqMigrationTaskVhosts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqMigrationTaskVhosts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class DmsRocketmqMigrationTaskVhostsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqMigrationTaskVhosts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqMigrationTaskVhostsOutputReference { + return new DmsRocketmqMigrationTaskVhostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task huaweicloud_dms_rocketmq_migration_task} +*/ +export class DmsRocketmqMigrationTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_migration_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqMigrationTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqMigrationTask to import + * @param importFromId The id of the existing DmsRocketmqMigrationTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqMigrationTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_migration_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_migration_task huaweicloud_dms_rocketmq_migration_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqMigrationTaskConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqMigrationTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_migration_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._overwrite = config.overwrite; + this._region = config.region; + this._type = config.type; + this._bindings.internalValue = config.bindings; + this._exchanges.internalValue = config.exchanges; + this._queues.internalValue = config.queues; + this._subscriptionGroups.internalValue = config.subscriptionGroups; + this._timeouts.internalValue = config.timeouts; + this._topicConfigs.internalValue = config.topicConfigs; + this._vhosts.internalValue = config.vhosts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // overwrite - computed: false, optional: false, required: true + private _overwrite?: string; + public get overwrite() { + return this.getStringAttribute('overwrite'); + } + public set overwrite(value: string) { + this._overwrite = value; + } + // Temporarily expose input value. Use with caution. + public get overwriteInput() { + return this._overwrite; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_date - computed: true, optional: false, required: false + public get startDate() { + return this.getStringAttribute('start_date'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // bindings - computed: false, optional: true, required: false + private _bindings = new DmsRocketmqMigrationTaskBindingsList(this, "bindings", false); + public get bindings() { + return this._bindings; + } + public putBindings(value: DmsRocketmqMigrationTaskBindings[] | cdktf.IResolvable) { + this._bindings.internalValue = value; + } + public resetBindings() { + this._bindings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindingsInput() { + return this._bindings.internalValue; + } + + // exchanges - computed: false, optional: true, required: false + private _exchanges = new DmsRocketmqMigrationTaskExchangesList(this, "exchanges", false); + public get exchanges() { + return this._exchanges; + } + public putExchanges(value: DmsRocketmqMigrationTaskExchanges[] | cdktf.IResolvable) { + this._exchanges.internalValue = value; + } + public resetExchanges() { + this._exchanges.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get exchangesInput() { + return this._exchanges.internalValue; + } + + // queues - computed: false, optional: true, required: false + private _queues = new DmsRocketmqMigrationTaskQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + public putQueues(value: DmsRocketmqMigrationTaskQueues[] | cdktf.IResolvable) { + this._queues.internalValue = value; + } + public resetQueues() { + this._queues.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get queuesInput() { + return this._queues.internalValue; + } + + // subscription_groups - computed: false, optional: true, required: false + private _subscriptionGroups = new DmsRocketmqMigrationTaskSubscriptionGroupsList(this, "subscription_groups", false); + public get subscriptionGroups() { + return this._subscriptionGroups; + } + public putSubscriptionGroups(value: DmsRocketmqMigrationTaskSubscriptionGroups[] | cdktf.IResolvable) { + this._subscriptionGroups.internalValue = value; + } + public resetSubscriptionGroups() { + this._subscriptionGroups.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get subscriptionGroupsInput() { + return this._subscriptionGroups.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DmsRocketmqMigrationTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DmsRocketmqMigrationTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // topic_configs - computed: false, optional: true, required: false + private _topicConfigs = new DmsRocketmqMigrationTaskTopicConfigsList(this, "topic_configs", false); + public get topicConfigs() { + return this._topicConfigs; + } + public putTopicConfigs(value: DmsRocketmqMigrationTaskTopicConfigs[] | cdktf.IResolvable) { + this._topicConfigs.internalValue = value; + } + public resetTopicConfigs() { + this._topicConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicConfigsInput() { + return this._topicConfigs.internalValue; + } + + // vhosts - computed: false, optional: true, required: false + private _vhosts = new DmsRocketmqMigrationTaskVhostsList(this, "vhosts", false); + public get vhosts() { + return this._vhosts; + } + public putVhosts(value: DmsRocketmqMigrationTaskVhosts[] | cdktf.IResolvable) { + this._vhosts.internalValue = value; + } + public resetVhosts() { + this._vhosts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get vhostsInput() { + return this._vhosts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + overwrite: cdktf.stringToTerraform(this._overwrite), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + bindings: cdktf.listMapper(dmsRocketmqMigrationTaskBindingsToTerraform, true)(this._bindings.internalValue), + exchanges: cdktf.listMapper(dmsRocketmqMigrationTaskExchangesToTerraform, true)(this._exchanges.internalValue), + queues: cdktf.listMapper(dmsRocketmqMigrationTaskQueuesToTerraform, true)(this._queues.internalValue), + subscription_groups: cdktf.listMapper(dmsRocketmqMigrationTaskSubscriptionGroupsToTerraform, true)(this._subscriptionGroups.internalValue), + timeouts: dmsRocketmqMigrationTaskTimeoutsToTerraform(this._timeouts.internalValue), + topic_configs: cdktf.listMapper(dmsRocketmqMigrationTaskTopicConfigsToTerraform, true)(this._topicConfigs.internalValue), + vhosts: cdktf.listMapper(dmsRocketmqMigrationTaskVhostsToTerraform, true)(this._vhosts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + overwrite: { + value: cdktf.stringToHclTerraform(this._overwrite), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bindings: { + value: cdktf.listMapperHcl(dmsRocketmqMigrationTaskBindingsToHclTerraform, true)(this._bindings.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqMigrationTaskBindingsList", + }, + exchanges: { + value: cdktf.listMapperHcl(dmsRocketmqMigrationTaskExchangesToHclTerraform, true)(this._exchanges.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqMigrationTaskExchangesList", + }, + queues: { + value: cdktf.listMapperHcl(dmsRocketmqMigrationTaskQueuesToHclTerraform, true)(this._queues.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqMigrationTaskQueuesList", + }, + subscription_groups: { + value: cdktf.listMapperHcl(dmsRocketmqMigrationTaskSubscriptionGroupsToHclTerraform, true)(this._subscriptionGroups.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqMigrationTaskSubscriptionGroupsList", + }, + timeouts: { + value: dmsRocketmqMigrationTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DmsRocketmqMigrationTaskTimeouts", + }, + topic_configs: { + value: cdktf.listMapperHcl(dmsRocketmqMigrationTaskTopicConfigsToHclTerraform, true)(this._topicConfigs.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqMigrationTaskTopicConfigsList", + }, + vhosts: { + value: cdktf.listMapperHcl(dmsRocketmqMigrationTaskVhostsToHclTerraform, true)(this._vhosts.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqMigrationTaskVhostsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-topic/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-topic/README.md new file mode 100644 index 00000000..64223b7a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-topic/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_topic` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_topic`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-topic/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-topic/index.ts new file mode 100644 index 00000000..fbff58fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-topic/index.ts @@ -0,0 +1,687 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqTopicConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#id DmsRocketmqTopic#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#instance_id DmsRocketmqTopic#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the message type of the topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#message_type DmsRocketmqTopic#message_type} + */ + readonly messageType?: string; + /** + * Specifies the name of the topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#name DmsRocketmqTopic#name} + */ + readonly name: string; + /** + * Specifies the permissions of the topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#permission DmsRocketmqTopic#permission} + */ + readonly permission?: string; + /** + * Specifies the number of queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#queue_num DmsRocketmqTopic#queue_num} + */ + readonly queueNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#region DmsRocketmqTopic#region} + */ + readonly region?: string; + /** + * Specifies the total number of read queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#total_read_queue_num DmsRocketmqTopic#total_read_queue_num} + */ + readonly totalReadQueueNum?: number; + /** + * Specifies the total number of write queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#total_write_queue_num DmsRocketmqTopic#total_write_queue_num} + */ + readonly totalWriteQueueNum?: number; + /** + * brokers block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#brokers DmsRocketmqTopic#brokers} + */ + readonly brokers?: DmsRocketmqTopicBrokers[] | cdktf.IResolvable; + /** + * queues block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#queues DmsRocketmqTopic#queues} + */ + readonly queues?: DmsRocketmqTopicQueues[] | cdktf.IResolvable; +} +export interface DmsRocketmqTopicBrokers { + /** + * Indicates the name of the broker. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#name DmsRocketmqTopic#name} + */ + readonly name?: string; +} + +export function dmsRocketmqTopicBrokersToTerraform(struct?: DmsRocketmqTopicBrokers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function dmsRocketmqTopicBrokersToHclTerraform(struct?: DmsRocketmqTopicBrokers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqTopicBrokersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqTopicBrokers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqTopicBrokers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // read_queue_num - computed: true, optional: false, required: false + public get readQueueNum() { + return this.getNumberAttribute('read_queue_num'); + } + + // write_queue_num - computed: true, optional: false, required: false + public get writeQueueNum() { + return this.getNumberAttribute('write_queue_num'); + } +} + +export class DmsRocketmqTopicBrokersList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqTopicBrokers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqTopicBrokersOutputReference { + return new DmsRocketmqTopicBrokersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqTopicQueues { + /** + * Specifies the associated broker. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#broker DmsRocketmqTopic#broker} + */ + readonly broker?: string; + /** + * Specifies the number of the queues. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#queue_num DmsRocketmqTopic#queue_num} + */ + readonly queueNum?: number; +} + +export function dmsRocketmqTopicQueuesToTerraform(struct?: DmsRocketmqTopicQueues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + broker: cdktf.stringToTerraform(struct!.broker), + queue_num: cdktf.numberToTerraform(struct!.queueNum), + } +} + + +export function dmsRocketmqTopicQueuesToHclTerraform(struct?: DmsRocketmqTopicQueues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + broker: { + value: cdktf.stringToHclTerraform(struct!.broker), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_num: { + value: cdktf.numberToHclTerraform(struct!.queueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqTopicQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqTopicQueues | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._broker !== undefined) { + hasAnyValues = true; + internalValueResult.broker = this._broker; + } + if (this._queueNum !== undefined) { + hasAnyValues = true; + internalValueResult.queueNum = this._queueNum; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqTopicQueues | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._broker = undefined; + this._queueNum = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._broker = value.broker; + this._queueNum = value.queueNum; + } + } + + // broker - computed: false, optional: true, required: false + private _broker?: string; + public get broker() { + return this.getStringAttribute('broker'); + } + public set broker(value: string) { + this._broker = value; + } + public resetBroker() { + this._broker = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokerInput() { + return this._broker; + } + + // queue_num - computed: false, optional: true, required: false + private _queueNum?: number; + public get queueNum() { + return this.getNumberAttribute('queue_num'); + } + public set queueNum(value: number) { + this._queueNum = value; + } + public resetQueueNum() { + this._queueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNumInput() { + return this._queueNum; + } +} + +export class DmsRocketmqTopicQueuesList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqTopicQueues[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqTopicQueuesOutputReference { + return new DmsRocketmqTopicQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic huaweicloud_dms_rocketmq_topic} +*/ +export class DmsRocketmqTopic extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_topic"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqTopic resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqTopic to import + * @param importFromId The id of the existing DmsRocketmqTopic that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqTopic to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_topic", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_topic huaweicloud_dms_rocketmq_topic} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqTopicConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqTopicConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_topic', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._messageType = config.messageType; + this._name = config.name; + this._permission = config.permission; + this._queueNum = config.queueNum; + this._region = config.region; + this._totalReadQueueNum = config.totalReadQueueNum; + this._totalWriteQueueNum = config.totalWriteQueueNum; + this._brokers.internalValue = config.brokers; + this._queues.internalValue = config.queues; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // message_type - computed: true, optional: true, required: false + private _messageType?: string; + public get messageType() { + return this.getStringAttribute('message_type'); + } + public set messageType(value: string) { + this._messageType = value; + } + public resetMessageType() { + this._messageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageTypeInput() { + return this._messageType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permission - computed: true, optional: true, required: false + private _permission?: string; + public get permission() { + return this.getStringAttribute('permission'); + } + public set permission(value: string) { + this._permission = value; + } + public resetPermission() { + this._permission = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionInput() { + return this._permission; + } + + // queue_num - computed: true, optional: true, required: false + private _queueNum?: number; + public get queueNum() { + return this.getNumberAttribute('queue_num'); + } + public set queueNum(value: number) { + this._queueNum = value; + } + public resetQueueNum() { + this._queueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNumInput() { + return this._queueNum; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // total_read_queue_num - computed: true, optional: true, required: false + private _totalReadQueueNum?: number; + public get totalReadQueueNum() { + return this.getNumberAttribute('total_read_queue_num'); + } + public set totalReadQueueNum(value: number) { + this._totalReadQueueNum = value; + } + public resetTotalReadQueueNum() { + this._totalReadQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get totalReadQueueNumInput() { + return this._totalReadQueueNum; + } + + // total_write_queue_num - computed: true, optional: true, required: false + private _totalWriteQueueNum?: number; + public get totalWriteQueueNum() { + return this.getNumberAttribute('total_write_queue_num'); + } + public set totalWriteQueueNum(value: number) { + this._totalWriteQueueNum = value; + } + public resetTotalWriteQueueNum() { + this._totalWriteQueueNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get totalWriteQueueNumInput() { + return this._totalWriteQueueNum; + } + + // brokers - computed: false, optional: true, required: false + private _brokers = new DmsRocketmqTopicBrokersList(this, "brokers", false); + public get brokers() { + return this._brokers; + } + public putBrokers(value: DmsRocketmqTopicBrokers[] | cdktf.IResolvable) { + this._brokers.internalValue = value; + } + public resetBrokers() { + this._brokers.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get brokersInput() { + return this._brokers.internalValue; + } + + // queues - computed: false, optional: true, required: false + private _queues = new DmsRocketmqTopicQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + public putQueues(value: DmsRocketmqTopicQueues[] | cdktf.IResolvable) { + this._queues.internalValue = value; + } + public resetQueues() { + this._queues.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get queuesInput() { + return this._queues.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + message_type: cdktf.stringToTerraform(this._messageType), + name: cdktf.stringToTerraform(this._name), + permission: cdktf.stringToTerraform(this._permission), + queue_num: cdktf.numberToTerraform(this._queueNum), + region: cdktf.stringToTerraform(this._region), + total_read_queue_num: cdktf.numberToTerraform(this._totalReadQueueNum), + total_write_queue_num: cdktf.numberToTerraform(this._totalWriteQueueNum), + brokers: cdktf.listMapper(dmsRocketmqTopicBrokersToTerraform, true)(this._brokers.internalValue), + queues: cdktf.listMapper(dmsRocketmqTopicQueuesToTerraform, true)(this._queues.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_type: { + value: cdktf.stringToHclTerraform(this._messageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission: { + value: cdktf.stringToHclTerraform(this._permission), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_num: { + value: cdktf.numberToHclTerraform(this._queueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + total_read_queue_num: { + value: cdktf.numberToHclTerraform(this._totalReadQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + total_write_queue_num: { + value: cdktf.numberToHclTerraform(this._totalWriteQueueNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + brokers: { + value: cdktf.listMapperHcl(dmsRocketmqTopicBrokersToHclTerraform, true)(this._brokers.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqTopicBrokersList", + }, + queues: { + value: cdktf.listMapperHcl(dmsRocketmqTopicQueuesToHclTerraform, true)(this._queues.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqTopicQueuesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-user/README.md b/src/constructs/providers/huaweicloud/dms-rocketmq-user/README.md new file mode 100644 index 00000000..5059b29f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dms_rocketmq_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_dms_rocketmq_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user). diff --git a/src/constructs/providers/huaweicloud/dms-rocketmq-user/index.ts b/src/constructs/providers/huaweicloud/dms-rocketmq-user/index.ts new file mode 100644 index 00000000..53baf655 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dms-rocketmq-user/index.ts @@ -0,0 +1,715 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DmsRocketmqUserConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the access key of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#access_key DmsRocketmqUser#access_key} + */ + readonly accessKey: string; + /** + * Specifies whether the user is an administrator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#admin DmsRocketmqUser#admin} + */ + readonly admin?: boolean | cdktf.IResolvable; + /** + * Specifies the default consumer group permissions. + * Value options: **PUB|SUB**, **PUB**, **SUB**, **DENY**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#default_group_perm DmsRocketmqUser#default_group_perm} + */ + readonly defaultGroupPerm?: string; + /** + * Specifies the default topic permissions. + * Value options: **PUB|SUB**, **PUB**, **SUB**, **DENY**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#default_topic_perm DmsRocketmqUser#default_topic_perm} + */ + readonly defaultTopicPerm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#id DmsRocketmqUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the rocketMQ instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#instance_id DmsRocketmqUser#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#region DmsRocketmqUser#region} + */ + readonly region?: string; + /** + * Specifies the secret key of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#secret_key DmsRocketmqUser#secret_key} + */ + readonly secretKey: string; + /** + * Specifies the IP address whitelist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#white_remote_address DmsRocketmqUser#white_remote_address} + */ + readonly whiteRemoteAddress?: string; + /** + * group_perms block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#group_perms DmsRocketmqUser#group_perms} + */ + readonly groupPerms?: DmsRocketmqUserGroupPerms[] | cdktf.IResolvable; + /** + * topic_perms block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#topic_perms DmsRocketmqUser#topic_perms} + */ + readonly topicPerms?: DmsRocketmqUserTopicPerms[] | cdktf.IResolvable; +} +export interface DmsRocketmqUserGroupPerms { + /** + * Indicates the name of a topic or consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#name DmsRocketmqUser#name} + */ + readonly name?: string; + /** + * Indicates the permissions of the topic or consumer group. + * Value options: **PUB|SUB**, **PUB**, **SUB**, **DENY**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#perm DmsRocketmqUser#perm} + */ + readonly perm?: string; +} + +export function dmsRocketmqUserGroupPermsToTerraform(struct?: DmsRocketmqUserGroupPerms | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + perm: cdktf.stringToTerraform(struct!.perm), + } +} + + +export function dmsRocketmqUserGroupPermsToHclTerraform(struct?: DmsRocketmqUserGroupPerms | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + perm: { + value: cdktf.stringToHclTerraform(struct!.perm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqUserGroupPermsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqUserGroupPerms | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._perm !== undefined) { + hasAnyValues = true; + internalValueResult.perm = this._perm; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqUserGroupPerms | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._perm = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._perm = value.perm; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // perm - computed: true, optional: true, required: false + private _perm?: string; + public get perm() { + return this.getStringAttribute('perm'); + } + public set perm(value: string) { + this._perm = value; + } + public resetPerm() { + this._perm = undefined; + } + // Temporarily expose input value. Use with caution. + public get permInput() { + return this._perm; + } +} + +export class DmsRocketmqUserGroupPermsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqUserGroupPerms[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqUserGroupPermsOutputReference { + return new DmsRocketmqUserGroupPermsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DmsRocketmqUserTopicPerms { + /** + * Indicates the name of a topic or consumer group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#name DmsRocketmqUser#name} + */ + readonly name?: string; + /** + * Indicates the permissions of the topic or consumer group. + * Value options: **PUB|SUB**, **PUB**, **SUB**, **DENY**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#perm DmsRocketmqUser#perm} + */ + readonly perm?: string; +} + +export function dmsRocketmqUserTopicPermsToTerraform(struct?: DmsRocketmqUserTopicPerms | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + perm: cdktf.stringToTerraform(struct!.perm), + } +} + + +export function dmsRocketmqUserTopicPermsToHclTerraform(struct?: DmsRocketmqUserTopicPerms | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + perm: { + value: cdktf.stringToHclTerraform(struct!.perm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DmsRocketmqUserTopicPermsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DmsRocketmqUserTopicPerms | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._perm !== undefined) { + hasAnyValues = true; + internalValueResult.perm = this._perm; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DmsRocketmqUserTopicPerms | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._perm = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._perm = value.perm; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // perm - computed: true, optional: true, required: false + private _perm?: string; + public get perm() { + return this.getStringAttribute('perm'); + } + public set perm(value: string) { + this._perm = value; + } + public resetPerm() { + this._perm = undefined; + } + // Temporarily expose input value. Use with caution. + public get permInput() { + return this._perm; + } +} + +export class DmsRocketmqUserTopicPermsList extends cdktf.ComplexList { + public internalValue? : DmsRocketmqUserTopicPerms[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DmsRocketmqUserTopicPermsOutputReference { + return new DmsRocketmqUserTopicPermsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user huaweicloud_dms_rocketmq_user} +*/ +export class DmsRocketmqUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dms_rocketmq_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DmsRocketmqUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DmsRocketmqUser to import + * @param importFromId The id of the existing DmsRocketmqUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DmsRocketmqUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dms_rocketmq_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dms_rocketmq_user huaweicloud_dms_rocketmq_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DmsRocketmqUserConfig + */ + public constructor(scope: Construct, id: string, config: DmsRocketmqUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dms_rocketmq_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessKey = config.accessKey; + this._admin = config.admin; + this._defaultGroupPerm = config.defaultGroupPerm; + this._defaultTopicPerm = config.defaultTopicPerm; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._secretKey = config.secretKey; + this._whiteRemoteAddress = config.whiteRemoteAddress; + this._groupPerms.internalValue = config.groupPerms; + this._topicPerms.internalValue = config.topicPerms; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: false, optional: false, required: true + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // admin - computed: true, optional: true, required: false + private _admin?: boolean | cdktf.IResolvable; + public get admin() { + return this.getBooleanAttribute('admin'); + } + public set admin(value: boolean | cdktf.IResolvable) { + this._admin = value; + } + public resetAdmin() { + this._admin = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminInput() { + return this._admin; + } + + // default_group_perm - computed: true, optional: true, required: false + private _defaultGroupPerm?: string; + public get defaultGroupPerm() { + return this.getStringAttribute('default_group_perm'); + } + public set defaultGroupPerm(value: string) { + this._defaultGroupPerm = value; + } + public resetDefaultGroupPerm() { + this._defaultGroupPerm = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultGroupPermInput() { + return this._defaultGroupPerm; + } + + // default_topic_perm - computed: true, optional: true, required: false + private _defaultTopicPerm?: string; + public get defaultTopicPerm() { + return this.getStringAttribute('default_topic_perm'); + } + public set defaultTopicPerm(value: string) { + this._defaultTopicPerm = value; + } + public resetDefaultTopicPerm() { + this._defaultTopicPerm = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultTopicPermInput() { + return this._defaultTopicPerm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_key - computed: false, optional: false, required: true + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // white_remote_address - computed: true, optional: true, required: false + private _whiteRemoteAddress?: string; + public get whiteRemoteAddress() { + return this.getStringAttribute('white_remote_address'); + } + public set whiteRemoteAddress(value: string) { + this._whiteRemoteAddress = value; + } + public resetWhiteRemoteAddress() { + this._whiteRemoteAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get whiteRemoteAddressInput() { + return this._whiteRemoteAddress; + } + + // group_perms - computed: false, optional: true, required: false + private _groupPerms = new DmsRocketmqUserGroupPermsList(this, "group_perms", false); + public get groupPerms() { + return this._groupPerms; + } + public putGroupPerms(value: DmsRocketmqUserGroupPerms[] | cdktf.IResolvable) { + this._groupPerms.internalValue = value; + } + public resetGroupPerms() { + this._groupPerms.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupPermsInput() { + return this._groupPerms.internalValue; + } + + // topic_perms - computed: false, optional: true, required: false + private _topicPerms = new DmsRocketmqUserTopicPermsList(this, "topic_perms", false); + public get topicPerms() { + return this._topicPerms; + } + public putTopicPerms(value: DmsRocketmqUserTopicPerms[] | cdktf.IResolvable) { + this._topicPerms.internalValue = value; + } + public resetTopicPerms() { + this._topicPerms.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicPermsInput() { + return this._topicPerms.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_key: cdktf.stringToTerraform(this._accessKey), + admin: cdktf.booleanToTerraform(this._admin), + default_group_perm: cdktf.stringToTerraform(this._defaultGroupPerm), + default_topic_perm: cdktf.stringToTerraform(this._defaultTopicPerm), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + secret_key: cdktf.stringToTerraform(this._secretKey), + white_remote_address: cdktf.stringToTerraform(this._whiteRemoteAddress), + group_perms: cdktf.listMapper(dmsRocketmqUserGroupPermsToTerraform, true)(this._groupPerms.internalValue), + topic_perms: cdktf.listMapper(dmsRocketmqUserTopicPermsToTerraform, true)(this._topicPerms.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(this._accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin: { + value: cdktf.booleanToHclTerraform(this._admin), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + default_group_perm: { + value: cdktf.stringToHclTerraform(this._defaultGroupPerm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default_topic_perm: { + value: cdktf.stringToHclTerraform(this._defaultTopicPerm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(this._secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + white_remote_address: { + value: cdktf.stringToHclTerraform(this._whiteRemoteAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_perms: { + value: cdktf.listMapperHcl(dmsRocketmqUserGroupPermsToHclTerraform, true)(this._groupPerms.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqUserGroupPermsList", + }, + topic_perms: { + value: cdktf.listMapperHcl(dmsRocketmqUserTopicPermsToHclTerraform, true)(this._topicPerms.internalValue), + isBlock: true, + type: "list", + storageClassType: "DmsRocketmqUserTopicPermsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-custom-line/README.md b/src/constructs/providers/huaweicloud/dns-custom-line/README.md new file mode 100644 index 00000000..6b32d826 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-custom-line/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_custom_line` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_custom_line`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line). diff --git a/src/constructs/providers/huaweicloud/dns-custom-line/index.ts b/src/constructs/providers/huaweicloud/dns-custom-line/index.ts new file mode 100644 index 00000000..4f11eee7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-custom-line/index.ts @@ -0,0 +1,423 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsCustomLineConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the custom line description. A maximum of 255 characters are allowed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#description DnsCustomLine#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#id DnsCustomLine#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP address range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#ip_segments DnsCustomLine#ip_segments} + */ + readonly ipSegments: string[]; + /** + * Specifies the custom line name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#name DnsCustomLine#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#region DnsCustomLine#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#timeouts DnsCustomLine#timeouts} + */ + readonly timeouts?: DnsCustomLineTimeouts; +} +export interface DnsCustomLineTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#create DnsCustomLine#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#delete DnsCustomLine#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#update DnsCustomLine#update} + */ + readonly update?: string; +} + +export function dnsCustomLineTimeoutsToTerraform(struct?: DnsCustomLineTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsCustomLineTimeoutsToHclTerraform(struct?: DnsCustomLineTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsCustomLineTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsCustomLineTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsCustomLineTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line huaweicloud_dns_custom_line} +*/ +export class DnsCustomLine extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_custom_line"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsCustomLine resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsCustomLine to import + * @param importFromId The id of the existing DnsCustomLine that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsCustomLine to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_custom_line", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_custom_line huaweicloud_dns_custom_line} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsCustomLineConfig + */ + public constructor(scope: Construct, id: string, config: DnsCustomLineConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_custom_line', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._ipSegments = config.ipSegments; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_segments - computed: false, optional: false, required: true + private _ipSegments?: string[]; + public get ipSegments() { + return this.getListAttribute('ip_segments'); + } + public set ipSegments(value: string[]) { + this._ipSegments = value; + } + // Temporarily expose input value. Use with caution. + public get ipSegmentsInput() { + return this._ipSegments; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsCustomLineTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsCustomLineTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ip_segments: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ipSegments), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: dnsCustomLineTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_segments: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ipSegments), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dnsCustomLineTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsCustomLineTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-endpoint/README.md b/src/constructs/providers/huaweicloud/dns-endpoint/README.md new file mode 100644 index 00000000..de7c28f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-endpoint/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_endpoint` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_endpoint`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint). diff --git a/src/constructs/providers/huaweicloud/dns-endpoint/index.ts b/src/constructs/providers/huaweicloud/dns-endpoint/index.ts new file mode 100644 index 00000000..c9675c35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-endpoint/index.ts @@ -0,0 +1,602 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsEndpointConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#direction DnsEndpoint#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#id DnsEndpoint#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#name DnsEndpoint#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#region DnsEndpoint#region} + */ + readonly region?: string; + /** + * ip_addresses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#ip_addresses DnsEndpoint#ip_addresses} + */ + readonly ipAddresses: DnsEndpointIpAddresses[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#timeouts DnsEndpoint#timeouts} + */ + readonly timeouts?: DnsEndpointTimeouts; +} +export interface DnsEndpointIpAddresses { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#ip DnsEndpoint#ip} + */ + readonly ip?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#subnet_id DnsEndpoint#subnet_id} + */ + readonly subnetId: string; +} + +export function dnsEndpointIpAddressesToTerraform(struct?: DnsEndpointIpAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip: cdktf.stringToTerraform(struct!.ip), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function dnsEndpointIpAddressesToHclTerraform(struct?: DnsEndpointIpAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsEndpointIpAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DnsEndpointIpAddresses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsEndpointIpAddresses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ip = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ip = value.ip; + this._subnetId = value.subnetId; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // ip - computed: true, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // ip_address_id - computed: true, optional: false, required: false + public get ipAddressId() { + return this.getStringAttribute('ip_address_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class DnsEndpointIpAddressesList extends cdktf.ComplexList { + public internalValue? : DnsEndpointIpAddresses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DnsEndpointIpAddressesOutputReference { + return new DnsEndpointIpAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DnsEndpointTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#create DnsEndpoint#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#delete DnsEndpoint#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#update DnsEndpoint#update} + */ + readonly update?: string; +} + +export function dnsEndpointTimeoutsToTerraform(struct?: DnsEndpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsEndpointTimeoutsToHclTerraform(struct?: DnsEndpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsEndpointTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsEndpointTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsEndpointTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint huaweicloud_dns_endpoint} +*/ +export class DnsEndpoint extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_endpoint"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsEndpoint resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsEndpoint to import + * @param importFromId The id of the existing DnsEndpoint that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsEndpoint to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_endpoint", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_endpoint huaweicloud_dns_endpoint} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsEndpointConfig + */ + public constructor(scope: Construct, id: string, config: DnsEndpointConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_endpoint', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._direction = config.direction; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._ipAddresses.internalValue = config.ipAddresses; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resolver_rule_count - computed: true, optional: false, required: false + public get resolverRuleCount() { + return this.getNumberAttribute('resolver_rule_count'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // ip_addresses - computed: false, optional: false, required: true + private _ipAddresses = new DnsEndpointIpAddressesList(this, "ip_addresses", false); + public get ipAddresses() { + return this._ipAddresses; + } + public putIpAddresses(value: DnsEndpointIpAddresses[] | cdktf.IResolvable) { + this._ipAddresses.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressesInput() { + return this._ipAddresses.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsEndpointTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsEndpointTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + direction: cdktf.stringToTerraform(this._direction), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + ip_addresses: cdktf.listMapper(dnsEndpointIpAddressesToTerraform, true)(this._ipAddresses.internalValue), + timeouts: dnsEndpointTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_addresses: { + value: cdktf.listMapperHcl(dnsEndpointIpAddressesToHclTerraform, true)(this._ipAddresses.internalValue), + isBlock: true, + type: "list", + storageClassType: "DnsEndpointIpAddressesList", + }, + timeouts: { + value: dnsEndpointTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsEndpointTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-line-group/README.md b/src/constructs/providers/huaweicloud/dns-line-group/README.md new file mode 100644 index 00000000..b8ffe883 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-line-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_line_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_line_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group). diff --git a/src/constructs/providers/huaweicloud/dns-line-group/index.ts b/src/constructs/providers/huaweicloud/dns-line-group/index.ts new file mode 100644 index 00000000..0a4fcf0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-line-group/index.ts @@ -0,0 +1,433 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsLineGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the line group description. A maximum of 255 characters are allowed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#description DnsLineGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#id DnsLineGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the lines. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#lines DnsLineGroup#lines} + */ + readonly lines: string[]; + /** + * Specifies the line group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#name DnsLineGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#region DnsLineGroup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#timeouts DnsLineGroup#timeouts} + */ + readonly timeouts?: DnsLineGroupTimeouts; +} +export interface DnsLineGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#create DnsLineGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#delete DnsLineGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#update DnsLineGroup#update} + */ + readonly update?: string; +} + +export function dnsLineGroupTimeoutsToTerraform(struct?: DnsLineGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsLineGroupTimeoutsToHclTerraform(struct?: DnsLineGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsLineGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsLineGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsLineGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group huaweicloud_dns_line_group} +*/ +export class DnsLineGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_line_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsLineGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsLineGroup to import + * @param importFromId The id of the existing DnsLineGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsLineGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_line_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_line_group huaweicloud_dns_line_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsLineGroupConfig + */ + public constructor(scope: Construct, id: string, config: DnsLineGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_line_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._lines = config.lines; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lines - computed: false, optional: false, required: true + private _lines?: string[]; + public get lines() { + return cdktf.Fn.tolist(this.getListAttribute('lines')); + } + public set lines(value: string[]) { + this._lines = value; + } + // Temporarily expose input value. Use with caution. + public get linesInput() { + return this._lines; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsLineGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsLineGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + lines: cdktf.listMapper(cdktf.stringToTerraform, false)(this._lines), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: dnsLineGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lines: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._lines), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dnsLineGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsLineGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-ptrrecord-v2/README.md b/src/constructs/providers/huaweicloud/dns-ptrrecord-v2/README.md new file mode 100644 index 00000000..2117108f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-ptrrecord-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_ptrrecord_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_ptrrecord_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2). diff --git a/src/constructs/providers/huaweicloud/dns-ptrrecord-v2/index.ts b/src/constructs/providers/huaweicloud/dns-ptrrecord-v2/index.ts new file mode 100644 index 00000000..7d0e7c6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-ptrrecord-v2/index.ts @@ -0,0 +1,501 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsPtrrecordV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#description DnsPtrrecordV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#enterprise_project_id DnsPtrrecordV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#floatingip_id DnsPtrrecordV2#floatingip_id} + */ + readonly floatingipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#id DnsPtrrecordV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#name DnsPtrrecordV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#region DnsPtrrecordV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#tags DnsPtrrecordV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#ttl DnsPtrrecordV2#ttl} + */ + readonly ttl?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#timeouts DnsPtrrecordV2#timeouts} + */ + readonly timeouts?: DnsPtrrecordV2Timeouts; +} +export interface DnsPtrrecordV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#create DnsPtrrecordV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#delete DnsPtrrecordV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#update DnsPtrrecordV2#update} + */ + readonly update?: string; +} + +export function dnsPtrrecordV2TimeoutsToTerraform(struct?: DnsPtrrecordV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsPtrrecordV2TimeoutsToHclTerraform(struct?: DnsPtrrecordV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsPtrrecordV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsPtrrecordV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsPtrrecordV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2 huaweicloud_dns_ptrrecord_v2} +*/ +export class DnsPtrrecordV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_ptrrecord_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsPtrrecordV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsPtrrecordV2 to import + * @param importFromId The id of the existing DnsPtrrecordV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsPtrrecordV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_ptrrecord_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord_v2 huaweicloud_dns_ptrrecord_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsPtrrecordV2Config + */ + public constructor(scope: Construct, id: string, config: DnsPtrrecordV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_ptrrecord_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._floatingipId = config.floatingipId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._ttl = config.ttl; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // floatingip_id - computed: false, optional: false, required: true + private _floatingipId?: string; + public get floatingipId() { + return this.getStringAttribute('floatingip_id'); + } + public set floatingipId(value: string) { + this._floatingipId = value; + } + // Temporarily expose input value. Use with caution. + public get floatingipIdInput() { + return this._floatingipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsPtrrecordV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsPtrrecordV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + floatingip_id: cdktf.stringToTerraform(this._floatingipId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl: cdktf.numberToTerraform(this._ttl), + timeouts: dnsPtrrecordV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floatingip_id: { + value: cdktf.stringToHclTerraform(this._floatingipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: dnsPtrrecordV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsPtrrecordV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-ptrrecord/README.md b/src/constructs/providers/huaweicloud/dns-ptrrecord/README.md new file mode 100644 index 00000000..aa432707 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-ptrrecord/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_ptrrecord` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_ptrrecord`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord). diff --git a/src/constructs/providers/huaweicloud/dns-ptrrecord/index.ts b/src/constructs/providers/huaweicloud/dns-ptrrecord/index.ts new file mode 100644 index 00000000..515b2608 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-ptrrecord/index.ts @@ -0,0 +1,501 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsPtrrecordConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#description DnsPtrrecord#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#enterprise_project_id DnsPtrrecord#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#floatingip_id DnsPtrrecord#floatingip_id} + */ + readonly floatingipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#id DnsPtrrecord#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#name DnsPtrrecord#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#region DnsPtrrecord#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#tags DnsPtrrecord#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#ttl DnsPtrrecord#ttl} + */ + readonly ttl?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#timeouts DnsPtrrecord#timeouts} + */ + readonly timeouts?: DnsPtrrecordTimeouts; +} +export interface DnsPtrrecordTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#create DnsPtrrecord#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#delete DnsPtrrecord#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#update DnsPtrrecord#update} + */ + readonly update?: string; +} + +export function dnsPtrrecordTimeoutsToTerraform(struct?: DnsPtrrecordTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsPtrrecordTimeoutsToHclTerraform(struct?: DnsPtrrecordTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsPtrrecordTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsPtrrecordTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsPtrrecordTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord huaweicloud_dns_ptrrecord} +*/ +export class DnsPtrrecord extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_ptrrecord"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsPtrrecord resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsPtrrecord to import + * @param importFromId The id of the existing DnsPtrrecord that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsPtrrecord to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_ptrrecord", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_ptrrecord huaweicloud_dns_ptrrecord} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsPtrrecordConfig + */ + public constructor(scope: Construct, id: string, config: DnsPtrrecordConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_ptrrecord', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._floatingipId = config.floatingipId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._ttl = config.ttl; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // floatingip_id - computed: false, optional: false, required: true + private _floatingipId?: string; + public get floatingipId() { + return this.getStringAttribute('floatingip_id'); + } + public set floatingipId(value: string) { + this._floatingipId = value; + } + // Temporarily expose input value. Use with caution. + public get floatingipIdInput() { + return this._floatingipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsPtrrecordTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsPtrrecordTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + floatingip_id: cdktf.stringToTerraform(this._floatingipId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl: cdktf.numberToTerraform(this._ttl), + timeouts: dnsPtrrecordTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floatingip_id: { + value: cdktf.stringToHclTerraform(this._floatingipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: dnsPtrrecordTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsPtrrecordTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-recordset-v2/README.md b/src/constructs/providers/huaweicloud/dns-recordset-v2/README.md new file mode 100644 index 00000000..6973de7d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-recordset-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_recordset_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_recordset_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2). diff --git a/src/constructs/providers/huaweicloud/dns-recordset-v2/index.ts b/src/constructs/providers/huaweicloud/dns-recordset-v2/index.ts new file mode 100644 index 00000000..ae237568 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-recordset-v2/index.ts @@ -0,0 +1,518 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsRecordsetV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#description DnsRecordsetV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#id DnsRecordsetV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#name DnsRecordsetV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#records DnsRecordsetV2#records} + */ + readonly records: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#region DnsRecordsetV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#tags DnsRecordsetV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#ttl DnsRecordsetV2#ttl} + */ + readonly ttl?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#type DnsRecordsetV2#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#zone_id DnsRecordsetV2#zone_id} + */ + readonly zoneId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#timeouts DnsRecordsetV2#timeouts} + */ + readonly timeouts?: DnsRecordsetV2Timeouts; +} +export interface DnsRecordsetV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#create DnsRecordsetV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#delete DnsRecordsetV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#update DnsRecordsetV2#update} + */ + readonly update?: string; +} + +export function dnsRecordsetV2TimeoutsToTerraform(struct?: DnsRecordsetV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsRecordsetV2TimeoutsToHclTerraform(struct?: DnsRecordsetV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsRecordsetV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsRecordsetV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsRecordsetV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2 huaweicloud_dns_recordset_v2} +*/ +export class DnsRecordsetV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_recordset_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsRecordsetV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsRecordsetV2 to import + * @param importFromId The id of the existing DnsRecordsetV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsRecordsetV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_recordset_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset_v2 huaweicloud_dns_recordset_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsRecordsetV2Config + */ + public constructor(scope: Construct, id: string, config: DnsRecordsetV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_recordset_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._records = config.records; + this._region = config.region; + this._tags = config.tags; + this._ttl = config.ttl; + this._type = config.type; + this._zoneId = config.zoneId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // records - computed: false, optional: false, required: true + private _records?: string[]; + public get records() { + return this.getListAttribute('records'); + } + public set records(value: string[]) { + this._records = value; + } + // Temporarily expose input value. Use with caution. + public get recordsInput() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // zone_id - computed: false, optional: false, required: true + private _zoneId?: string; + public get zoneId() { + return this.getStringAttribute('zone_id'); + } + public set zoneId(value: string) { + this._zoneId = value; + } + // Temporarily expose input value. Use with caution. + public get zoneIdInput() { + return this._zoneId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsRecordsetV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsRecordsetV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + records: cdktf.listMapper(cdktf.stringToTerraform, false)(this._records), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl: cdktf.numberToTerraform(this._ttl), + type: cdktf.stringToTerraform(this._type), + zone_id: cdktf.stringToTerraform(this._zoneId), + timeouts: dnsRecordsetV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + records: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._records), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + zone_id: { + value: cdktf.stringToHclTerraform(this._zoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dnsRecordsetV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsRecordsetV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-recordset/README.md b/src/constructs/providers/huaweicloud/dns-recordset/README.md new file mode 100644 index 00000000..de710853 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-recordset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_recordset` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_recordset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset). diff --git a/src/constructs/providers/huaweicloud/dns-recordset/index.ts b/src/constructs/providers/huaweicloud/dns-recordset/index.ts new file mode 100644 index 00000000..9895fe90 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-recordset/index.ts @@ -0,0 +1,631 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsRecordsetConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the record set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#description DnsRecordset#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#id DnsRecordset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the resolution line ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#line_id DnsRecordset#line_id} + */ + readonly lineId?: string; + /** + * Specifies the name of the record set. The name suffixed with a zone name, which is a + * complete host name ended with a dot. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#name DnsRecordset#name} + */ + readonly name: string; + /** + * Specifies an array of DNS records. The value rules vary depending on the record set type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#records DnsRecordset#records} + */ + readonly records: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#region DnsRecordset#region} + */ + readonly region?: string; + /** + * Specifies the status of the record set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#status DnsRecordset#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#tags DnsRecordset#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the time to live (TTL) of the record set (in seconds). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#ttl DnsRecordset#ttl} + */ + readonly ttl?: number; + /** + * Specifies the type of the record set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#type DnsRecordset#type} + */ + readonly type: string; + /** + * Specifies the weight of the record set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#weight DnsRecordset#weight} + */ + readonly weight?: number; + /** + * Specifies the zone ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#zone_id DnsRecordset#zone_id} + */ + readonly zoneId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#timeouts DnsRecordset#timeouts} + */ + readonly timeouts?: DnsRecordsetTimeouts; +} +export interface DnsRecordsetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#create DnsRecordset#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#delete DnsRecordset#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#update DnsRecordset#update} + */ + readonly update?: string; +} + +export function dnsRecordsetTimeoutsToTerraform(struct?: DnsRecordsetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsRecordsetTimeoutsToHclTerraform(struct?: DnsRecordsetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsRecordsetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsRecordsetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsRecordsetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset huaweicloud_dns_recordset} +*/ +export class DnsRecordset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_recordset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsRecordset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsRecordset to import + * @param importFromId The id of the existing DnsRecordset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsRecordset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_recordset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_recordset huaweicloud_dns_recordset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsRecordsetConfig + */ + public constructor(scope: Construct, id: string, config: DnsRecordsetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_recordset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._lineId = config.lineId; + this._name = config.name; + this._records = config.records; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + this._ttl = config.ttl; + this._type = config.type; + this._weight = config.weight; + this._zoneId = config.zoneId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // line_id - computed: true, optional: true, required: false + private _lineId?: string; + public get lineId() { + return this.getStringAttribute('line_id'); + } + public set lineId(value: string) { + this._lineId = value; + } + public resetLineId() { + this._lineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lineIdInput() { + return this._lineId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // records - computed: false, optional: false, required: true + private _records?: string[]; + public get records() { + return this.getListAttribute('records'); + } + public set records(value: string[]) { + this._records = value; + } + // Temporarily expose input value. Use with caution. + public get recordsInput() { + return this._records; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // zone_id - computed: false, optional: false, required: true + private _zoneId?: string; + public get zoneId() { + return this.getStringAttribute('zone_id'); + } + public set zoneId(value: string) { + this._zoneId = value; + } + // Temporarily expose input value. Use with caution. + public get zoneIdInput() { + return this._zoneId; + } + + // zone_name - computed: true, optional: false, required: false + public get zoneName() { + return this.getStringAttribute('zone_name'); + } + + // zone_type - computed: true, optional: false, required: false + public get zoneType() { + return this.getStringAttribute('zone_type'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsRecordsetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsRecordsetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + line_id: cdktf.stringToTerraform(this._lineId), + name: cdktf.stringToTerraform(this._name), + records: cdktf.listMapper(cdktf.stringToTerraform, false)(this._records), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl: cdktf.numberToTerraform(this._ttl), + type: cdktf.stringToTerraform(this._type), + weight: cdktf.numberToTerraform(this._weight), + zone_id: cdktf.stringToTerraform(this._zoneId), + timeouts: dnsRecordsetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + line_id: { + value: cdktf.stringToHclTerraform(this._lineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + records: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._records), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(this._weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + zone_id: { + value: cdktf.stringToHclTerraform(this._zoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dnsRecordsetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsRecordsetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-resolver-rule-associate/README.md b/src/constructs/providers/huaweicloud/dns-resolver-rule-associate/README.md new file mode 100644 index 00000000..0edcc348 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-resolver-rule-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_resolver_rule_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_resolver_rule_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate). diff --git a/src/constructs/providers/huaweicloud/dns-resolver-rule-associate/index.ts b/src/constructs/providers/huaweicloud/dns-resolver-rule-associate/index.ts new file mode 100644 index 00000000..d196fca0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-resolver-rule-associate/index.ts @@ -0,0 +1,356 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsResolverRuleAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#id DnsResolverRuleAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#region DnsResolverRuleAssociate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#resolver_rule_id DnsResolverRuleAssociate#resolver_rule_id} + */ + readonly resolverRuleId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#vpc_id DnsResolverRuleAssociate#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#timeouts DnsResolverRuleAssociate#timeouts} + */ + readonly timeouts?: DnsResolverRuleAssociateTimeouts; +} +export interface DnsResolverRuleAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#create DnsResolverRuleAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#delete DnsResolverRuleAssociate#delete} + */ + readonly delete?: string; +} + +export function dnsResolverRuleAssociateTimeoutsToTerraform(struct?: DnsResolverRuleAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dnsResolverRuleAssociateTimeoutsToHclTerraform(struct?: DnsResolverRuleAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsResolverRuleAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsResolverRuleAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsResolverRuleAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate huaweicloud_dns_resolver_rule_associate} +*/ +export class DnsResolverRuleAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_resolver_rule_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsResolverRuleAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsResolverRuleAssociate to import + * @param importFromId The id of the existing DnsResolverRuleAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsResolverRuleAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_resolver_rule_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule_associate huaweicloud_dns_resolver_rule_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsResolverRuleAssociateConfig + */ + public constructor(scope: Construct, id: string, config: DnsResolverRuleAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_resolver_rule_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._resolverRuleId = config.resolverRuleId; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resolver_rule_id - computed: false, optional: false, required: true + private _resolverRuleId?: string; + public get resolverRuleId() { + return this.getStringAttribute('resolver_rule_id'); + } + public set resolverRuleId(value: string) { + this._resolverRuleId = value; + } + // Temporarily expose input value. Use with caution. + public get resolverRuleIdInput() { + return this._resolverRuleId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsResolverRuleAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsResolverRuleAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resolver_rule_id: cdktf.stringToTerraform(this._resolverRuleId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: dnsResolverRuleAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resolver_rule_id: { + value: cdktf.stringToHclTerraform(this._resolverRuleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dnsResolverRuleAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsResolverRuleAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-resolver-rule/README.md b/src/constructs/providers/huaweicloud/dns-resolver-rule/README.md new file mode 100644 index 00000000..dfaa806c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-resolver-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_resolver_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_resolver_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule). diff --git a/src/constructs/providers/huaweicloud/dns-resolver-rule/index.ts b/src/constructs/providers/huaweicloud/dns-resolver-rule/index.ts new file mode 100644 index 00000000..affc0530 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-resolver-rule/index.ts @@ -0,0 +1,663 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsResolverRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#domain_name DnsResolverRule#domain_name} + */ + readonly domainName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#endpoint_id DnsResolverRule#endpoint_id} + */ + readonly endpointId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#id DnsResolverRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#name DnsResolverRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#region DnsResolverRule#region} + */ + readonly region?: string; + /** + * ip_addresses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#ip_addresses DnsResolverRule#ip_addresses} + */ + readonly ipAddresses: DnsResolverRuleIpAddresses[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#timeouts DnsResolverRule#timeouts} + */ + readonly timeouts?: DnsResolverRuleTimeouts; +} +export interface DnsResolverRuleVpcs { +} + +export function dnsResolverRuleVpcsToTerraform(struct?: DnsResolverRuleVpcs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dnsResolverRuleVpcsToHclTerraform(struct?: DnsResolverRuleVpcs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DnsResolverRuleVpcsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DnsResolverRuleVpcs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsResolverRuleVpcs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // vpc_region - computed: true, optional: false, required: false + public get vpcRegion() { + return this.getStringAttribute('vpc_region'); + } +} + +export class DnsResolverRuleVpcsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DnsResolverRuleVpcsOutputReference { + return new DnsResolverRuleVpcsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DnsResolverRuleIpAddresses { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#ip DnsResolverRule#ip} + */ + readonly ip?: string; +} + +export function dnsResolverRuleIpAddressesToTerraform(struct?: DnsResolverRuleIpAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip: cdktf.stringToTerraform(struct!.ip), + } +} + + +export function dnsResolverRuleIpAddressesToHclTerraform(struct?: DnsResolverRuleIpAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsResolverRuleIpAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DnsResolverRuleIpAddresses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsResolverRuleIpAddresses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ip = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ip = value.ip; + } + } + + // ip - computed: false, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } +} + +export class DnsResolverRuleIpAddressesList extends cdktf.ComplexList { + public internalValue? : DnsResolverRuleIpAddresses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DnsResolverRuleIpAddressesOutputReference { + return new DnsResolverRuleIpAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DnsResolverRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#create DnsResolverRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#delete DnsResolverRule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#update DnsResolverRule#update} + */ + readonly update?: string; +} + +export function dnsResolverRuleTimeoutsToTerraform(struct?: DnsResolverRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsResolverRuleTimeoutsToHclTerraform(struct?: DnsResolverRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsResolverRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsResolverRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsResolverRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule huaweicloud_dns_resolver_rule} +*/ +export class DnsResolverRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_resolver_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsResolverRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsResolverRule to import + * @param importFromId The id of the existing DnsResolverRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsResolverRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_resolver_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_resolver_rule huaweicloud_dns_resolver_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsResolverRuleConfig + */ + public constructor(scope: Construct, id: string, config: DnsResolverRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_resolver_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainName = config.domainName; + this._endpointId = config.endpointId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._ipAddresses.internalValue = config.ipAddresses; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // endpoint_id - computed: false, optional: false, required: true + private _endpointId?: string; + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + public set endpointId(value: string) { + this._endpointId = value; + } + // Temporarily expose input value. Use with caution. + public get endpointIdInput() { + return this._endpointId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_type - computed: true, optional: false, required: false + public get ruleType() { + return this.getStringAttribute('rule_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpcs - computed: true, optional: false, required: false + private _vpcs = new DnsResolverRuleVpcsList(this, "vpcs", false); + public get vpcs() { + return this._vpcs; + } + + // ip_addresses - computed: false, optional: false, required: true + private _ipAddresses = new DnsResolverRuleIpAddressesList(this, "ip_addresses", false); + public get ipAddresses() { + return this._ipAddresses; + } + public putIpAddresses(value: DnsResolverRuleIpAddresses[] | cdktf.IResolvable) { + this._ipAddresses.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressesInput() { + return this._ipAddresses.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsResolverRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsResolverRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_name: cdktf.stringToTerraform(this._domainName), + endpoint_id: cdktf.stringToTerraform(this._endpointId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + ip_addresses: cdktf.listMapper(dnsResolverRuleIpAddressesToTerraform, true)(this._ipAddresses.internalValue), + timeouts: dnsResolverRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint_id: { + value: cdktf.stringToHclTerraform(this._endpointId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_addresses: { + value: cdktf.listMapperHcl(dnsResolverRuleIpAddressesToHclTerraform, true)(this._ipAddresses.internalValue), + isBlock: true, + type: "list", + storageClassType: "DnsResolverRuleIpAddressesList", + }, + timeouts: { + value: dnsResolverRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsResolverRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-zone-v2/README.md b/src/constructs/providers/huaweicloud/dns-zone-v2/README.md new file mode 100644 index 00000000..d796095c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-zone-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_zone_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_zone_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2). diff --git a/src/constructs/providers/huaweicloud/dns-zone-v2/index.ts b/src/constructs/providers/huaweicloud/dns-zone-v2/index.ts new file mode 100644 index 00000000..6822fe3c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-zone-v2/index.ts @@ -0,0 +1,738 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsZoneV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#description DnsZoneV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#email DnsZoneV2#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#enterprise_project_id DnsZoneV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#id DnsZoneV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#name DnsZoneV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#region DnsZoneV2#region} + */ + readonly region?: string; + /** + * Specifies the status of the public zone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#status DnsZoneV2#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#tags DnsZoneV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#ttl DnsZoneV2#ttl} + */ + readonly ttl?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#zone_type DnsZoneV2#zone_type} + */ + readonly zoneType?: string; + /** + * router block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#router DnsZoneV2#router} + */ + readonly router?: DnsZoneV2Router[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#timeouts DnsZoneV2#timeouts} + */ + readonly timeouts?: DnsZoneV2Timeouts; +} +export interface DnsZoneV2Router { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#router_id DnsZoneV2#router_id} + */ + readonly routerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#router_region DnsZoneV2#router_region} + */ + readonly routerRegion?: string; +} + +export function dnsZoneV2RouterToTerraform(struct?: DnsZoneV2Router | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + router_id: cdktf.stringToTerraform(struct!.routerId), + router_region: cdktf.stringToTerraform(struct!.routerRegion), + } +} + + +export function dnsZoneV2RouterToHclTerraform(struct?: DnsZoneV2Router | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + router_id: { + value: cdktf.stringToHclTerraform(struct!.routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_region: { + value: cdktf.stringToHclTerraform(struct!.routerRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsZoneV2RouterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DnsZoneV2Router | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._routerId !== undefined) { + hasAnyValues = true; + internalValueResult.routerId = this._routerId; + } + if (this._routerRegion !== undefined) { + hasAnyValues = true; + internalValueResult.routerRegion = this._routerRegion; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsZoneV2Router | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._routerId = undefined; + this._routerRegion = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._routerId = value.routerId; + this._routerRegion = value.routerRegion; + } + } + + // router_id - computed: false, optional: false, required: true + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // router_region - computed: false, optional: true, required: false + private _routerRegion?: string; + public get routerRegion() { + return this.getStringAttribute('router_region'); + } + public set routerRegion(value: string) { + this._routerRegion = value; + } + public resetRouterRegion() { + this._routerRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get routerRegionInput() { + return this._routerRegion; + } +} + +export class DnsZoneV2RouterList extends cdktf.ComplexList { + public internalValue? : DnsZoneV2Router[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DnsZoneV2RouterOutputReference { + return new DnsZoneV2RouterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DnsZoneV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#create DnsZoneV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#delete DnsZoneV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#update DnsZoneV2#update} + */ + readonly update?: string; +} + +export function dnsZoneV2TimeoutsToTerraform(struct?: DnsZoneV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsZoneV2TimeoutsToHclTerraform(struct?: DnsZoneV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsZoneV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsZoneV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsZoneV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2 huaweicloud_dns_zone_v2} +*/ +export class DnsZoneV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_zone_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsZoneV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsZoneV2 to import + * @param importFromId The id of the existing DnsZoneV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsZoneV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_zone_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone_v2 huaweicloud_dns_zone_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsZoneV2Config + */ + public constructor(scope: Construct, id: string, config: DnsZoneV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_zone_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._email = config.email; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + this._ttl = config.ttl; + this._zoneType = config.zoneType; + this._router.internalValue = config.router; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // email - computed: true, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // masters - computed: true, optional: false, required: false + public get masters() { + return cdktf.Fn.tolist(this.getListAttribute('masters')); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // zone_type - computed: false, optional: true, required: false + private _zoneType?: string; + public get zoneType() { + return this.getStringAttribute('zone_type'); + } + public set zoneType(value: string) { + this._zoneType = value; + } + public resetZoneType() { + this._zoneType = undefined; + } + // Temporarily expose input value. Use with caution. + public get zoneTypeInput() { + return this._zoneType; + } + + // router - computed: false, optional: true, required: false + private _router = new DnsZoneV2RouterList(this, "router", true); + public get router() { + return this._router; + } + public putRouter(value: DnsZoneV2Router[] | cdktf.IResolvable) { + this._router.internalValue = value; + } + public resetRouter() { + this._router.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routerInput() { + return this._router.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsZoneV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsZoneV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + email: cdktf.stringToTerraform(this._email), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl: cdktf.numberToTerraform(this._ttl), + zone_type: cdktf.stringToTerraform(this._zoneType), + router: cdktf.listMapper(dnsZoneV2RouterToTerraform, true)(this._router.internalValue), + timeouts: dnsZoneV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + zone_type: { + value: cdktf.stringToHclTerraform(this._zoneType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router: { + value: cdktf.listMapperHcl(dnsZoneV2RouterToHclTerraform, true)(this._router.internalValue), + isBlock: true, + type: "set", + storageClassType: "DnsZoneV2RouterList", + }, + timeouts: { + value: dnsZoneV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsZoneV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dns-zone/README.md b/src/constructs/providers/huaweicloud/dns-zone/README.md new file mode 100644 index 00000000..86a3eba9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-zone/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dns_zone` + +Refer to the Terraform Registry for docs: [`huaweicloud_dns_zone`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone). diff --git a/src/constructs/providers/huaweicloud/dns-zone/index.ts b/src/constructs/providers/huaweicloud/dns-zone/index.ts new file mode 100644 index 00000000..8a1be895 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dns-zone/index.ts @@ -0,0 +1,738 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DnsZoneConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#description DnsZone#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#email DnsZone#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#enterprise_project_id DnsZone#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#id DnsZone#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#name DnsZone#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#region DnsZone#region} + */ + readonly region?: string; + /** + * Specifies the status of the public zone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#status DnsZone#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#tags DnsZone#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#ttl DnsZone#ttl} + */ + readonly ttl?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#zone_type DnsZone#zone_type} + */ + readonly zoneType?: string; + /** + * router block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#router DnsZone#router} + */ + readonly router?: DnsZoneRouter[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#timeouts DnsZone#timeouts} + */ + readonly timeouts?: DnsZoneTimeouts; +} +export interface DnsZoneRouter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#router_id DnsZone#router_id} + */ + readonly routerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#router_region DnsZone#router_region} + */ + readonly routerRegion?: string; +} + +export function dnsZoneRouterToTerraform(struct?: DnsZoneRouter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + router_id: cdktf.stringToTerraform(struct!.routerId), + router_region: cdktf.stringToTerraform(struct!.routerRegion), + } +} + + +export function dnsZoneRouterToHclTerraform(struct?: DnsZoneRouter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + router_id: { + value: cdktf.stringToHclTerraform(struct!.routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_region: { + value: cdktf.stringToHclTerraform(struct!.routerRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsZoneRouterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DnsZoneRouter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._routerId !== undefined) { + hasAnyValues = true; + internalValueResult.routerId = this._routerId; + } + if (this._routerRegion !== undefined) { + hasAnyValues = true; + internalValueResult.routerRegion = this._routerRegion; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsZoneRouter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._routerId = undefined; + this._routerRegion = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._routerId = value.routerId; + this._routerRegion = value.routerRegion; + } + } + + // router_id - computed: false, optional: false, required: true + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // router_region - computed: false, optional: true, required: false + private _routerRegion?: string; + public get routerRegion() { + return this.getStringAttribute('router_region'); + } + public set routerRegion(value: string) { + this._routerRegion = value; + } + public resetRouterRegion() { + this._routerRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get routerRegionInput() { + return this._routerRegion; + } +} + +export class DnsZoneRouterList extends cdktf.ComplexList { + public internalValue? : DnsZoneRouter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DnsZoneRouterOutputReference { + return new DnsZoneRouterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DnsZoneTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#create DnsZone#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#delete DnsZone#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#update DnsZone#update} + */ + readonly update?: string; +} + +export function dnsZoneTimeoutsToTerraform(struct?: DnsZoneTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dnsZoneTimeoutsToHclTerraform(struct?: DnsZoneTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DnsZoneTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DnsZoneTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DnsZoneTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone huaweicloud_dns_zone} +*/ +export class DnsZone extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dns_zone"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DnsZone resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DnsZone to import + * @param importFromId The id of the existing DnsZone that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DnsZone to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dns_zone", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dns_zone huaweicloud_dns_zone} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DnsZoneConfig + */ + public constructor(scope: Construct, id: string, config: DnsZoneConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dns_zone', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._email = config.email; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._tags = config.tags; + this._ttl = config.ttl; + this._zoneType = config.zoneType; + this._router.internalValue = config.router; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // email - computed: true, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // masters - computed: true, optional: false, required: false + public get masters() { + return cdktf.Fn.tolist(this.getListAttribute('masters')); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // zone_type - computed: false, optional: true, required: false + private _zoneType?: string; + public get zoneType() { + return this.getStringAttribute('zone_type'); + } + public set zoneType(value: string) { + this._zoneType = value; + } + public resetZoneType() { + this._zoneType = undefined; + } + // Temporarily expose input value. Use with caution. + public get zoneTypeInput() { + return this._zoneType; + } + + // router - computed: false, optional: true, required: false + private _router = new DnsZoneRouterList(this, "router", true); + public get router() { + return this._router; + } + public putRouter(value: DnsZoneRouter[] | cdktf.IResolvable) { + this._router.internalValue = value; + } + public resetRouter() { + this._router.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routerInput() { + return this._router.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DnsZoneTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DnsZoneTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + email: cdktf.stringToTerraform(this._email), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl: cdktf.numberToTerraform(this._ttl), + zone_type: cdktf.stringToTerraform(this._zoneType), + router: cdktf.listMapper(dnsZoneRouterToTerraform, true)(this._router.internalValue), + timeouts: dnsZoneTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + zone_type: { + value: cdktf.stringToHclTerraform(this._zoneType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router: { + value: cdktf.listMapperHcl(dnsZoneRouterToHclTerraform, true)(this._router.internalValue), + isBlock: true, + type: "set", + storageClassType: "DnsZoneRouterList", + }, + timeouts: { + value: dnsZoneTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DnsZoneTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/README.md b/src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/README.md new file mode 100644 index 00000000..4ebf0314 --- /dev/null +++ b/src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_drs_job_primary_standby_switch` + +Refer to the Terraform Registry for docs: [`huaweicloud_drs_job_primary_standby_switch`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch). diff --git a/src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/index.ts b/src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/index.ts new file mode 100644 index 00000000..4d153537 --- /dev/null +++ b/src/constructs/providers/huaweicloud/drs-job-primary-standby-switch/index.ts @@ -0,0 +1,293 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DrsJobPrimaryStandbySwitchConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch#id DrsJobPrimaryStandbySwitch#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch#job_id DrsJobPrimaryStandbySwitch#job_id} + */ + readonly jobId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch#region DrsJobPrimaryStandbySwitch#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch#timeouts DrsJobPrimaryStandbySwitch#timeouts} + */ + readonly timeouts?: DrsJobPrimaryStandbySwitchTimeouts; +} +export interface DrsJobPrimaryStandbySwitchTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch#create DrsJobPrimaryStandbySwitch#create} + */ + readonly create?: string; +} + +export function drsJobPrimaryStandbySwitchTimeoutsToTerraform(struct?: DrsJobPrimaryStandbySwitchTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function drsJobPrimaryStandbySwitchTimeoutsToHclTerraform(struct?: DrsJobPrimaryStandbySwitchTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobPrimaryStandbySwitchTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DrsJobPrimaryStandbySwitchTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobPrimaryStandbySwitchTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch huaweicloud_drs_job_primary_standby_switch} +*/ +export class DrsJobPrimaryStandbySwitch extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_drs_job_primary_standby_switch"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DrsJobPrimaryStandbySwitch resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DrsJobPrimaryStandbySwitch to import + * @param importFromId The id of the existing DrsJobPrimaryStandbySwitch that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DrsJobPrimaryStandbySwitch to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_drs_job_primary_standby_switch", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job_primary_standby_switch huaweicloud_drs_job_primary_standby_switch} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DrsJobPrimaryStandbySwitchConfig + */ + public constructor(scope: Construct, id: string, config: DrsJobPrimaryStandbySwitchConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_drs_job_primary_standby_switch', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._jobId = config.jobId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: false, required: true + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DrsJobPrimaryStandbySwitchTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DrsJobPrimaryStandbySwitchTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + region: cdktf.stringToTerraform(this._region), + timeouts: drsJobPrimaryStandbySwitchTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: drsJobPrimaryStandbySwitchTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DrsJobPrimaryStandbySwitchTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/drs-job/README.md b/src/constructs/providers/huaweicloud/drs-job/README.md new file mode 100644 index 00000000..68b2efb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/drs-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_drs_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_drs_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job). diff --git a/src/constructs/providers/huaweicloud/drs-job/index.ts b/src/constructs/providers/huaweicloud/drs-job/index.ts new file mode 100644 index 00000000..bb4555f0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/drs-job/index.ts @@ -0,0 +1,4693 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DrsJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#action DrsJob#action} + */ + readonly action?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#auto_renew DrsJob#auto_renew} + */ + readonly autoRenew?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#charging_mode DrsJob#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#databases DrsJob#databases} + */ + readonly databases?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#description DrsJob#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#destination_db_readnoly DrsJob#destination_db_readnoly} + */ + readonly destinationDbReadnoly?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#direction DrsJob#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#engine_type DrsJob#engine_type} + */ + readonly engineType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#enterprise_project_id DrsJob#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#expired_days DrsJob#expired_days} + */ + readonly expiredDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#force_destroy DrsJob#force_destroy} + */ + readonly forceDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#id DrsJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#is_open_fast_clean DrsJob#is_open_fast_clean} + */ + readonly isOpenFastClean?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#is_sync_re_edit DrsJob#is_sync_re_edit} + */ + readonly isSyncReEdit?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#master_az DrsJob#master_az} + */ + readonly masterAz?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#migrate_definer DrsJob#migrate_definer} + */ + readonly migrateDefiner?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#migration_type DrsJob#migration_type} + */ + readonly migrationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#multi_write DrsJob#multi_write} + */ + readonly multiWrite?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#name DrsJob#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#net_type DrsJob#net_type} + */ + readonly netType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#node_type DrsJob#node_type} + */ + readonly nodeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#pause_mode DrsJob#pause_mode} + */ + readonly pauseMode?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#period DrsJob#period} + */ + readonly period?: number; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#period_unit DrsJob#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#region DrsJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#slave_az DrsJob#slave_az} + */ + readonly slaveAz?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#start_time DrsJob#start_time} + */ + readonly startTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#tags DrsJob#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#type DrsJob#type} + */ + readonly type: string; + /** + * alarm_notify block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#alarm_notify DrsJob#alarm_notify} + */ + readonly alarmNotify?: DrsJobAlarmNotify; + /** + * destination_db block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#destination_db DrsJob#destination_db} + */ + readonly destinationDb: DrsJobDestinationDb; + /** + * limit_speed block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#limit_speed DrsJob#limit_speed} + */ + readonly limitSpeed?: DrsJobLimitSpeed[] | cdktf.IResolvable; + /** + * policy_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#policy_config DrsJob#policy_config} + */ + readonly policyConfig?: DrsJobPolicyConfig; + /** + * public_ip_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#public_ip_list DrsJob#public_ip_list} + */ + readonly publicIpList?: DrsJobPublicIpListStruct[] | cdktf.IResolvable; + /** + * source_db block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#source_db DrsJob#source_db} + */ + readonly sourceDb: DrsJobSourceDb; + /** + * tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#tables DrsJob#tables} + */ + readonly tables?: DrsJobTables[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#timeouts DrsJob#timeouts} + */ + readonly timeouts?: DrsJobTimeouts; +} +export interface DrsJobAlarmNotify { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#delay_time DrsJob#delay_time} + */ + readonly delayTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#rpo_delay DrsJob#rpo_delay} + */ + readonly rpoDelay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#rto_delay DrsJob#rto_delay} + */ + readonly rtoDelay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#topic_urn DrsJob#topic_urn} + */ + readonly topicUrn: string; +} + +export function drsJobAlarmNotifyToTerraform(struct?: DrsJobAlarmNotifyOutputReference | DrsJobAlarmNotify): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delay_time: cdktf.numberToTerraform(struct!.delayTime), + rpo_delay: cdktf.numberToTerraform(struct!.rpoDelay), + rto_delay: cdktf.numberToTerraform(struct!.rtoDelay), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function drsJobAlarmNotifyToHclTerraform(struct?: DrsJobAlarmNotifyOutputReference | DrsJobAlarmNotify): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delay_time: { + value: cdktf.numberToHclTerraform(struct!.delayTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rpo_delay: { + value: cdktf.numberToHclTerraform(struct!.rpoDelay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rto_delay: { + value: cdktf.numberToHclTerraform(struct!.rtoDelay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobAlarmNotifyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DrsJobAlarmNotify | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delayTime !== undefined) { + hasAnyValues = true; + internalValueResult.delayTime = this._delayTime; + } + if (this._rpoDelay !== undefined) { + hasAnyValues = true; + internalValueResult.rpoDelay = this._rpoDelay; + } + if (this._rtoDelay !== undefined) { + hasAnyValues = true; + internalValueResult.rtoDelay = this._rtoDelay; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobAlarmNotify | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delayTime = undefined; + this._rpoDelay = undefined; + this._rtoDelay = undefined; + this._topicUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delayTime = value.delayTime; + this._rpoDelay = value.rpoDelay; + this._rtoDelay = value.rtoDelay; + this._topicUrn = value.topicUrn; + } + } + + // delay_time - computed: true, optional: true, required: false + private _delayTime?: number; + public get delayTime() { + return this.getNumberAttribute('delay_time'); + } + public set delayTime(value: number) { + this._delayTime = value; + } + public resetDelayTime() { + this._delayTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get delayTimeInput() { + return this._delayTime; + } + + // rpo_delay - computed: true, optional: true, required: false + private _rpoDelay?: number; + public get rpoDelay() { + return this.getNumberAttribute('rpo_delay'); + } + public set rpoDelay(value: number) { + this._rpoDelay = value; + } + public resetRpoDelay() { + this._rpoDelay = undefined; + } + // Temporarily expose input value. Use with caution. + public get rpoDelayInput() { + return this._rpoDelay; + } + + // rto_delay - computed: true, optional: true, required: false + private _rtoDelay?: number; + public get rtoDelay() { + return this.getNumberAttribute('rto_delay'); + } + public set rtoDelay(value: number) { + this._rtoDelay = value; + } + public resetRtoDelay() { + this._rtoDelay = undefined; + } + // Temporarily expose input value. Use with caution. + public get rtoDelayInput() { + return this._rtoDelay; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} +export interface DrsJobDestinationDbKafkaSecurityConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#delegation_tokens DrsJob#delegation_tokens} + */ + readonly delegationTokens?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#enable_key_store DrsJob#enable_key_store} + */ + readonly enableKeyStore?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#endpoint_algorithm DrsJob#endpoint_algorithm} + */ + readonly endpointAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_password DrsJob#key_password} + */ + readonly keyPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_store_key DrsJob#key_store_key} + */ + readonly keyStoreKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_store_key_name DrsJob#key_store_key_name} + */ + readonly keyStoreKeyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_store_password DrsJob#key_store_password} + */ + readonly keyStorePassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#sasl_mechanism DrsJob#sasl_mechanism} + */ + readonly saslMechanism?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#set_private_key_password DrsJob#set_private_key_password} + */ + readonly setPrivateKeyPassword?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#trust_store_key DrsJob#trust_store_key} + */ + readonly trustStoreKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#trust_store_key_name DrsJob#trust_store_key_name} + */ + readonly trustStoreKeyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#trust_store_password DrsJob#trust_store_password} + */ + readonly trustStorePassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#type DrsJob#type} + */ + readonly type?: string; +} + +export function drsJobDestinationDbKafkaSecurityConfigToTerraform(struct?: DrsJobDestinationDbKafkaSecurityConfigOutputReference | DrsJobDestinationDbKafkaSecurityConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delegation_tokens: cdktf.booleanToTerraform(struct!.delegationTokens), + enable_key_store: cdktf.booleanToTerraform(struct!.enableKeyStore), + endpoint_algorithm: cdktf.stringToTerraform(struct!.endpointAlgorithm), + key_password: cdktf.stringToTerraform(struct!.keyPassword), + key_store_key: cdktf.stringToTerraform(struct!.keyStoreKey), + key_store_key_name: cdktf.stringToTerraform(struct!.keyStoreKeyName), + key_store_password: cdktf.stringToTerraform(struct!.keyStorePassword), + sasl_mechanism: cdktf.stringToTerraform(struct!.saslMechanism), + set_private_key_password: cdktf.booleanToTerraform(struct!.setPrivateKeyPassword), + trust_store_key: cdktf.stringToTerraform(struct!.trustStoreKey), + trust_store_key_name: cdktf.stringToTerraform(struct!.trustStoreKeyName), + trust_store_password: cdktf.stringToTerraform(struct!.trustStorePassword), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function drsJobDestinationDbKafkaSecurityConfigToHclTerraform(struct?: DrsJobDestinationDbKafkaSecurityConfigOutputReference | DrsJobDestinationDbKafkaSecurityConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delegation_tokens: { + value: cdktf.booleanToHclTerraform(struct!.delegationTokens), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_key_store: { + value: cdktf.booleanToHclTerraform(struct!.enableKeyStore), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + endpoint_algorithm: { + value: cdktf.stringToHclTerraform(struct!.endpointAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_password: { + value: cdktf.stringToHclTerraform(struct!.keyPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_store_key: { + value: cdktf.stringToHclTerraform(struct!.keyStoreKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_store_key_name: { + value: cdktf.stringToHclTerraform(struct!.keyStoreKeyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_store_password: { + value: cdktf.stringToHclTerraform(struct!.keyStorePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sasl_mechanism: { + value: cdktf.stringToHclTerraform(struct!.saslMechanism), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + set_private_key_password: { + value: cdktf.booleanToHclTerraform(struct!.setPrivateKeyPassword), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + trust_store_key: { + value: cdktf.stringToHclTerraform(struct!.trustStoreKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trust_store_key_name: { + value: cdktf.stringToHclTerraform(struct!.trustStoreKeyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trust_store_password: { + value: cdktf.stringToHclTerraform(struct!.trustStorePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobDestinationDbKafkaSecurityConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DrsJobDestinationDbKafkaSecurityConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delegationTokens !== undefined) { + hasAnyValues = true; + internalValueResult.delegationTokens = this._delegationTokens; + } + if (this._enableKeyStore !== undefined) { + hasAnyValues = true; + internalValueResult.enableKeyStore = this._enableKeyStore; + } + if (this._endpointAlgorithm !== undefined) { + hasAnyValues = true; + internalValueResult.endpointAlgorithm = this._endpointAlgorithm; + } + if (this._keyPassword !== undefined) { + hasAnyValues = true; + internalValueResult.keyPassword = this._keyPassword; + } + if (this._keyStoreKey !== undefined) { + hasAnyValues = true; + internalValueResult.keyStoreKey = this._keyStoreKey; + } + if (this._keyStoreKeyName !== undefined) { + hasAnyValues = true; + internalValueResult.keyStoreKeyName = this._keyStoreKeyName; + } + if (this._keyStorePassword !== undefined) { + hasAnyValues = true; + internalValueResult.keyStorePassword = this._keyStorePassword; + } + if (this._saslMechanism !== undefined) { + hasAnyValues = true; + internalValueResult.saslMechanism = this._saslMechanism; + } + if (this._setPrivateKeyPassword !== undefined) { + hasAnyValues = true; + internalValueResult.setPrivateKeyPassword = this._setPrivateKeyPassword; + } + if (this._trustStoreKey !== undefined) { + hasAnyValues = true; + internalValueResult.trustStoreKey = this._trustStoreKey; + } + if (this._trustStoreKeyName !== undefined) { + hasAnyValues = true; + internalValueResult.trustStoreKeyName = this._trustStoreKeyName; + } + if (this._trustStorePassword !== undefined) { + hasAnyValues = true; + internalValueResult.trustStorePassword = this._trustStorePassword; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobDestinationDbKafkaSecurityConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delegationTokens = undefined; + this._enableKeyStore = undefined; + this._endpointAlgorithm = undefined; + this._keyPassword = undefined; + this._keyStoreKey = undefined; + this._keyStoreKeyName = undefined; + this._keyStorePassword = undefined; + this._saslMechanism = undefined; + this._setPrivateKeyPassword = undefined; + this._trustStoreKey = undefined; + this._trustStoreKeyName = undefined; + this._trustStorePassword = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delegationTokens = value.delegationTokens; + this._enableKeyStore = value.enableKeyStore; + this._endpointAlgorithm = value.endpointAlgorithm; + this._keyPassword = value.keyPassword; + this._keyStoreKey = value.keyStoreKey; + this._keyStoreKeyName = value.keyStoreKeyName; + this._keyStorePassword = value.keyStorePassword; + this._saslMechanism = value.saslMechanism; + this._setPrivateKeyPassword = value.setPrivateKeyPassword; + this._trustStoreKey = value.trustStoreKey; + this._trustStoreKeyName = value.trustStoreKeyName; + this._trustStorePassword = value.trustStorePassword; + this._type = value.type; + } + } + + // delegation_tokens - computed: false, optional: true, required: false + private _delegationTokens?: boolean | cdktf.IResolvable; + public get delegationTokens() { + return this.getBooleanAttribute('delegation_tokens'); + } + public set delegationTokens(value: boolean | cdktf.IResolvable) { + this._delegationTokens = value; + } + public resetDelegationTokens() { + this._delegationTokens = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegationTokensInput() { + return this._delegationTokens; + } + + // enable_key_store - computed: false, optional: true, required: false + private _enableKeyStore?: boolean | cdktf.IResolvable; + public get enableKeyStore() { + return this.getBooleanAttribute('enable_key_store'); + } + public set enableKeyStore(value: boolean | cdktf.IResolvable) { + this._enableKeyStore = value; + } + public resetEnableKeyStore() { + this._enableKeyStore = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableKeyStoreInput() { + return this._enableKeyStore; + } + + // endpoint_algorithm - computed: false, optional: true, required: false + private _endpointAlgorithm?: string; + public get endpointAlgorithm() { + return this.getStringAttribute('endpoint_algorithm'); + } + public set endpointAlgorithm(value: string) { + this._endpointAlgorithm = value; + } + public resetEndpointAlgorithm() { + this._endpointAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointAlgorithmInput() { + return this._endpointAlgorithm; + } + + // key_password - computed: false, optional: true, required: false + private _keyPassword?: string; + public get keyPassword() { + return this.getStringAttribute('key_password'); + } + public set keyPassword(value: string) { + this._keyPassword = value; + } + public resetKeyPassword() { + this._keyPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPasswordInput() { + return this._keyPassword; + } + + // key_store_key - computed: false, optional: true, required: false + private _keyStoreKey?: string; + public get keyStoreKey() { + return this.getStringAttribute('key_store_key'); + } + public set keyStoreKey(value: string) { + this._keyStoreKey = value; + } + public resetKeyStoreKey() { + this._keyStoreKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStoreKeyInput() { + return this._keyStoreKey; + } + + // key_store_key_name - computed: false, optional: true, required: false + private _keyStoreKeyName?: string; + public get keyStoreKeyName() { + return this.getStringAttribute('key_store_key_name'); + } + public set keyStoreKeyName(value: string) { + this._keyStoreKeyName = value; + } + public resetKeyStoreKeyName() { + this._keyStoreKeyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStoreKeyNameInput() { + return this._keyStoreKeyName; + } + + // key_store_password - computed: false, optional: true, required: false + private _keyStorePassword?: string; + public get keyStorePassword() { + return this.getStringAttribute('key_store_password'); + } + public set keyStorePassword(value: string) { + this._keyStorePassword = value; + } + public resetKeyStorePassword() { + this._keyStorePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStorePasswordInput() { + return this._keyStorePassword; + } + + // sasl_mechanism - computed: false, optional: true, required: false + private _saslMechanism?: string; + public get saslMechanism() { + return this.getStringAttribute('sasl_mechanism'); + } + public set saslMechanism(value: string) { + this._saslMechanism = value; + } + public resetSaslMechanism() { + this._saslMechanism = undefined; + } + // Temporarily expose input value. Use with caution. + public get saslMechanismInput() { + return this._saslMechanism; + } + + // set_private_key_password - computed: false, optional: true, required: false + private _setPrivateKeyPassword?: boolean | cdktf.IResolvable; + public get setPrivateKeyPassword() { + return this.getBooleanAttribute('set_private_key_password'); + } + public set setPrivateKeyPassword(value: boolean | cdktf.IResolvable) { + this._setPrivateKeyPassword = value; + } + public resetSetPrivateKeyPassword() { + this._setPrivateKeyPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get setPrivateKeyPasswordInput() { + return this._setPrivateKeyPassword; + } + + // trust_store_key - computed: false, optional: true, required: false + private _trustStoreKey?: string; + public get trustStoreKey() { + return this.getStringAttribute('trust_store_key'); + } + public set trustStoreKey(value: string) { + this._trustStoreKey = value; + } + public resetTrustStoreKey() { + this._trustStoreKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustStoreKeyInput() { + return this._trustStoreKey; + } + + // trust_store_key_name - computed: false, optional: true, required: false + private _trustStoreKeyName?: string; + public get trustStoreKeyName() { + return this.getStringAttribute('trust_store_key_name'); + } + public set trustStoreKeyName(value: string) { + this._trustStoreKeyName = value; + } + public resetTrustStoreKeyName() { + this._trustStoreKeyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustStoreKeyNameInput() { + return this._trustStoreKeyName; + } + + // trust_store_password - computed: false, optional: true, required: false + private _trustStorePassword?: string; + public get trustStorePassword() { + return this.getStringAttribute('trust_store_password'); + } + public set trustStorePassword(value: string) { + this._trustStorePassword = value; + } + public resetTrustStorePassword() { + this._trustStorePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustStorePasswordInput() { + return this._trustStorePassword; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface DrsJobDestinationDb { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#engine_type DrsJob#engine_type} + */ + readonly engineType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#instance_id DrsJob#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ip DrsJob#ip} + */ + readonly ip: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#name DrsJob#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#password DrsJob#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#port DrsJob#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#region DrsJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_check_sum DrsJob#ssl_cert_check_sum} + */ + readonly sslCertCheckSum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_key DrsJob#ssl_cert_key} + */ + readonly sslCertKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_name DrsJob#ssl_cert_name} + */ + readonly sslCertName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_password DrsJob#ssl_cert_password} + */ + readonly sslCertPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_enabled DrsJob#ssl_enabled} + */ + readonly sslEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#subnet_id DrsJob#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#user DrsJob#user} + */ + readonly user?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#vpc_id DrsJob#vpc_id} + */ + readonly vpcId?: string; + /** + * kafka_security_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#kafka_security_config DrsJob#kafka_security_config} + */ + readonly kafkaSecurityConfig?: DrsJobDestinationDbKafkaSecurityConfig; +} + +export function drsJobDestinationDbToTerraform(struct?: DrsJobDestinationDbOutputReference | DrsJobDestinationDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine_type: cdktf.stringToTerraform(struct!.engineType), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + ip: cdktf.stringToTerraform(struct!.ip), + name: cdktf.stringToTerraform(struct!.name), + password: cdktf.stringToTerraform(struct!.password), + port: cdktf.numberToTerraform(struct!.port), + region: cdktf.stringToTerraform(struct!.region), + ssl_cert_check_sum: cdktf.stringToTerraform(struct!.sslCertCheckSum), + ssl_cert_key: cdktf.stringToTerraform(struct!.sslCertKey), + ssl_cert_name: cdktf.stringToTerraform(struct!.sslCertName), + ssl_cert_password: cdktf.stringToTerraform(struct!.sslCertPassword), + ssl_enabled: cdktf.booleanToTerraform(struct!.sslEnabled), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + user: cdktf.stringToTerraform(struct!.user), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + kafka_security_config: drsJobDestinationDbKafkaSecurityConfigToTerraform(struct!.kafkaSecurityConfig), + } +} + + +export function drsJobDestinationDbToHclTerraform(struct?: DrsJobDestinationDbOutputReference | DrsJobDestinationDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine_type: { + value: cdktf.stringToHclTerraform(struct!.engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_check_sum: { + value: cdktf.stringToHclTerraform(struct!.sslCertCheckSum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_key: { + value: cdktf.stringToHclTerraform(struct!.sslCertKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_name: { + value: cdktf.stringToHclTerraform(struct!.sslCertName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_password: { + value: cdktf.stringToHclTerraform(struct!.sslCertPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enabled: { + value: cdktf.booleanToHclTerraform(struct!.sslEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(struct!.user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka_security_config: { + value: drsJobDestinationDbKafkaSecurityConfigToHclTerraform(struct!.kafkaSecurityConfig), + isBlock: true, + type: "list", + storageClassType: "DrsJobDestinationDbKafkaSecurityConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobDestinationDbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DrsJobDestinationDb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engineType !== undefined) { + hasAnyValues = true; + internalValueResult.engineType = this._engineType; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._sslCertCheckSum !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertCheckSum = this._sslCertCheckSum; + } + if (this._sslCertKey !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertKey = this._sslCertKey; + } + if (this._sslCertName !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertName = this._sslCertName; + } + if (this._sslCertPassword !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertPassword = this._sslCertPassword; + } + if (this._sslEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.sslEnabled = this._sslEnabled; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._user !== undefined) { + hasAnyValues = true; + internalValueResult.user = this._user; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + if (this._kafkaSecurityConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.kafkaSecurityConfig = this._kafkaSecurityConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobDestinationDb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engineType = undefined; + this._instanceId = undefined; + this._ip = undefined; + this._name = undefined; + this._password = undefined; + this._port = undefined; + this._region = undefined; + this._sslCertCheckSum = undefined; + this._sslCertKey = undefined; + this._sslCertName = undefined; + this._sslCertPassword = undefined; + this._sslEnabled = undefined; + this._subnetId = undefined; + this._user = undefined; + this._vpcId = undefined; + this._kafkaSecurityConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engineType = value.engineType; + this._instanceId = value.instanceId; + this._ip = value.ip; + this._name = value.name; + this._password = value.password; + this._port = value.port; + this._region = value.region; + this._sslCertCheckSum = value.sslCertCheckSum; + this._sslCertKey = value.sslCertKey; + this._sslCertName = value.sslCertName; + this._sslCertPassword = value.sslCertPassword; + this._sslEnabled = value.sslEnabled; + this._subnetId = value.subnetId; + this._user = value.user; + this._vpcId = value.vpcId; + this._kafkaSecurityConfig.internalValue = value.kafkaSecurityConfig; + } + } + + // engine_type - computed: false, optional: false, required: true + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // ssl_cert_check_sum - computed: false, optional: true, required: false + private _sslCertCheckSum?: string; + public get sslCertCheckSum() { + return this.getStringAttribute('ssl_cert_check_sum'); + } + public set sslCertCheckSum(value: string) { + this._sslCertCheckSum = value; + } + public resetSslCertCheckSum() { + this._sslCertCheckSum = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertCheckSumInput() { + return this._sslCertCheckSum; + } + + // ssl_cert_key - computed: false, optional: true, required: false + private _sslCertKey?: string; + public get sslCertKey() { + return this.getStringAttribute('ssl_cert_key'); + } + public set sslCertKey(value: string) { + this._sslCertKey = value; + } + public resetSslCertKey() { + this._sslCertKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertKeyInput() { + return this._sslCertKey; + } + + // ssl_cert_name - computed: false, optional: true, required: false + private _sslCertName?: string; + public get sslCertName() { + return this.getStringAttribute('ssl_cert_name'); + } + public set sslCertName(value: string) { + this._sslCertName = value; + } + public resetSslCertName() { + this._sslCertName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertNameInput() { + return this._sslCertName; + } + + // ssl_cert_password - computed: false, optional: true, required: false + private _sslCertPassword?: string; + public get sslCertPassword() { + return this.getStringAttribute('ssl_cert_password'); + } + public set sslCertPassword(value: string) { + this._sslCertPassword = value; + } + public resetSslCertPassword() { + this._sslCertPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertPasswordInput() { + return this._sslCertPassword; + } + + // ssl_enabled - computed: false, optional: true, required: false + private _sslEnabled?: boolean | cdktf.IResolvable; + public get sslEnabled() { + return this.getBooleanAttribute('ssl_enabled'); + } + public set sslEnabled(value: boolean | cdktf.IResolvable) { + this._sslEnabled = value; + } + public resetSslEnabled() { + this._sslEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnabledInput() { + return this._sslEnabled; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // kafka_security_config - computed: false, optional: true, required: false + private _kafkaSecurityConfig = new DrsJobDestinationDbKafkaSecurityConfigOutputReference(this, "kafka_security_config"); + public get kafkaSecurityConfig() { + return this._kafkaSecurityConfig; + } + public putKafkaSecurityConfig(value: DrsJobDestinationDbKafkaSecurityConfig) { + this._kafkaSecurityConfig.internalValue = value; + } + public resetKafkaSecurityConfig() { + this._kafkaSecurityConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaSecurityConfigInput() { + return this._kafkaSecurityConfig.internalValue; + } +} +export interface DrsJobLimitSpeed { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#end_time DrsJob#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#speed DrsJob#speed} + */ + readonly speed: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#start_time DrsJob#start_time} + */ + readonly startTime: string; +} + +export function drsJobLimitSpeedToTerraform(struct?: DrsJobLimitSpeed | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + speed: cdktf.stringToTerraform(struct!.speed), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function drsJobLimitSpeedToHclTerraform(struct?: DrsJobLimitSpeed | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + speed: { + value: cdktf.stringToHclTerraform(struct!.speed), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobLimitSpeedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DrsJobLimitSpeed | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._speed !== undefined) { + hasAnyValues = true; + internalValueResult.speed = this._speed; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobLimitSpeed | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._endTime = undefined; + this._speed = undefined; + this._startTime = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._endTime = value.endTime; + this._speed = value.speed; + this._startTime = value.startTime; + } + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // speed - computed: false, optional: false, required: true + private _speed?: string; + public get speed() { + return this.getStringAttribute('speed'); + } + public set speed(value: string) { + this._speed = value; + } + // Temporarily expose input value. Use with caution. + public get speedInput() { + return this._speed; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +export class DrsJobLimitSpeedList extends cdktf.ComplexList { + public internalValue? : DrsJobLimitSpeed[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DrsJobLimitSpeedOutputReference { + return new DrsJobLimitSpeedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DrsJobPolicyConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#conflict_policy DrsJob#conflict_policy} + */ + readonly conflictPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#export_snapshot DrsJob#export_snapshot} + */ + readonly exportSnapshot?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#file_and_position DrsJob#file_and_position} + */ + readonly fileAndPosition?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#filter_ddl_policy DrsJob#filter_ddl_policy} + */ + readonly filterDdlPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#gtid_set DrsJob#gtid_set} + */ + readonly gtidSet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#index_trans DrsJob#index_trans} + */ + readonly indexTrans?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#is_fill_materialized_view DrsJob#is_fill_materialized_view} + */ + readonly isFillMaterializedView?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#kafka_data_format DrsJob#kafka_data_format} + */ + readonly kafkaDataFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#partition_policy DrsJob#partition_policy} + */ + readonly partitionPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#partitions_num DrsJob#partitions_num} + */ + readonly partitionsNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#replication_factor DrsJob#replication_factor} + */ + readonly replicationFactor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#slot_name DrsJob#slot_name} + */ + readonly slotName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#topic DrsJob#topic} + */ + readonly topic?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#topic_name_format DrsJob#topic_name_format} + */ + readonly topicNameFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#topic_policy DrsJob#topic_policy} + */ + readonly topicPolicy?: string; +} + +export function drsJobPolicyConfigToTerraform(struct?: DrsJobPolicyConfigOutputReference | DrsJobPolicyConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + conflict_policy: cdktf.stringToTerraform(struct!.conflictPolicy), + export_snapshot: cdktf.booleanToTerraform(struct!.exportSnapshot), + file_and_position: cdktf.stringToTerraform(struct!.fileAndPosition), + filter_ddl_policy: cdktf.stringToTerraform(struct!.filterDdlPolicy), + gtid_set: cdktf.stringToTerraform(struct!.gtidSet), + index_trans: cdktf.booleanToTerraform(struct!.indexTrans), + is_fill_materialized_view: cdktf.booleanToTerraform(struct!.isFillMaterializedView), + kafka_data_format: cdktf.stringToTerraform(struct!.kafkaDataFormat), + partition_policy: cdktf.stringToTerraform(struct!.partitionPolicy), + partitions_num: cdktf.stringToTerraform(struct!.partitionsNum), + replication_factor: cdktf.stringToTerraform(struct!.replicationFactor), + slot_name: cdktf.stringToTerraform(struct!.slotName), + topic: cdktf.stringToTerraform(struct!.topic), + topic_name_format: cdktf.stringToTerraform(struct!.topicNameFormat), + topic_policy: cdktf.stringToTerraform(struct!.topicPolicy), + } +} + + +export function drsJobPolicyConfigToHclTerraform(struct?: DrsJobPolicyConfigOutputReference | DrsJobPolicyConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + conflict_policy: { + value: cdktf.stringToHclTerraform(struct!.conflictPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + export_snapshot: { + value: cdktf.booleanToHclTerraform(struct!.exportSnapshot), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + file_and_position: { + value: cdktf.stringToHclTerraform(struct!.fileAndPosition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_ddl_policy: { + value: cdktf.stringToHclTerraform(struct!.filterDdlPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gtid_set: { + value: cdktf.stringToHclTerraform(struct!.gtidSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + index_trans: { + value: cdktf.booleanToHclTerraform(struct!.indexTrans), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_fill_materialized_view: { + value: cdktf.booleanToHclTerraform(struct!.isFillMaterializedView), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + kafka_data_format: { + value: cdktf.stringToHclTerraform(struct!.kafkaDataFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partition_policy: { + value: cdktf.stringToHclTerraform(struct!.partitionPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + partitions_num: { + value: cdktf.stringToHclTerraform(struct!.partitionsNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replication_factor: { + value: cdktf.stringToHclTerraform(struct!.replicationFactor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slot_name: { + value: cdktf.stringToHclTerraform(struct!.slotName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(struct!.topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name_format: { + value: cdktf.stringToHclTerraform(struct!.topicNameFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_policy: { + value: cdktf.stringToHclTerraform(struct!.topicPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobPolicyConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DrsJobPolicyConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._conflictPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.conflictPolicy = this._conflictPolicy; + } + if (this._exportSnapshot !== undefined) { + hasAnyValues = true; + internalValueResult.exportSnapshot = this._exportSnapshot; + } + if (this._fileAndPosition !== undefined) { + hasAnyValues = true; + internalValueResult.fileAndPosition = this._fileAndPosition; + } + if (this._filterDdlPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.filterDdlPolicy = this._filterDdlPolicy; + } + if (this._gtidSet !== undefined) { + hasAnyValues = true; + internalValueResult.gtidSet = this._gtidSet; + } + if (this._indexTrans !== undefined) { + hasAnyValues = true; + internalValueResult.indexTrans = this._indexTrans; + } + if (this._isFillMaterializedView !== undefined) { + hasAnyValues = true; + internalValueResult.isFillMaterializedView = this._isFillMaterializedView; + } + if (this._kafkaDataFormat !== undefined) { + hasAnyValues = true; + internalValueResult.kafkaDataFormat = this._kafkaDataFormat; + } + if (this._partitionPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.partitionPolicy = this._partitionPolicy; + } + if (this._partitionsNum !== undefined) { + hasAnyValues = true; + internalValueResult.partitionsNum = this._partitionsNum; + } + if (this._replicationFactor !== undefined) { + hasAnyValues = true; + internalValueResult.replicationFactor = this._replicationFactor; + } + if (this._slotName !== undefined) { + hasAnyValues = true; + internalValueResult.slotName = this._slotName; + } + if (this._topic !== undefined) { + hasAnyValues = true; + internalValueResult.topic = this._topic; + } + if (this._topicNameFormat !== undefined) { + hasAnyValues = true; + internalValueResult.topicNameFormat = this._topicNameFormat; + } + if (this._topicPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.topicPolicy = this._topicPolicy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobPolicyConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._conflictPolicy = undefined; + this._exportSnapshot = undefined; + this._fileAndPosition = undefined; + this._filterDdlPolicy = undefined; + this._gtidSet = undefined; + this._indexTrans = undefined; + this._isFillMaterializedView = undefined; + this._kafkaDataFormat = undefined; + this._partitionPolicy = undefined; + this._partitionsNum = undefined; + this._replicationFactor = undefined; + this._slotName = undefined; + this._topic = undefined; + this._topicNameFormat = undefined; + this._topicPolicy = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._conflictPolicy = value.conflictPolicy; + this._exportSnapshot = value.exportSnapshot; + this._fileAndPosition = value.fileAndPosition; + this._filterDdlPolicy = value.filterDdlPolicy; + this._gtidSet = value.gtidSet; + this._indexTrans = value.indexTrans; + this._isFillMaterializedView = value.isFillMaterializedView; + this._kafkaDataFormat = value.kafkaDataFormat; + this._partitionPolicy = value.partitionPolicy; + this._partitionsNum = value.partitionsNum; + this._replicationFactor = value.replicationFactor; + this._slotName = value.slotName; + this._topic = value.topic; + this._topicNameFormat = value.topicNameFormat; + this._topicPolicy = value.topicPolicy; + } + } + + // conflict_policy - computed: false, optional: true, required: false + private _conflictPolicy?: string; + public get conflictPolicy() { + return this.getStringAttribute('conflict_policy'); + } + public set conflictPolicy(value: string) { + this._conflictPolicy = value; + } + public resetConflictPolicy() { + this._conflictPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get conflictPolicyInput() { + return this._conflictPolicy; + } + + // export_snapshot - computed: false, optional: true, required: false + private _exportSnapshot?: boolean | cdktf.IResolvable; + public get exportSnapshot() { + return this.getBooleanAttribute('export_snapshot'); + } + public set exportSnapshot(value: boolean | cdktf.IResolvable) { + this._exportSnapshot = value; + } + public resetExportSnapshot() { + this._exportSnapshot = undefined; + } + // Temporarily expose input value. Use with caution. + public get exportSnapshotInput() { + return this._exportSnapshot; + } + + // file_and_position - computed: false, optional: true, required: false + private _fileAndPosition?: string; + public get fileAndPosition() { + return this.getStringAttribute('file_and_position'); + } + public set fileAndPosition(value: string) { + this._fileAndPosition = value; + } + public resetFileAndPosition() { + this._fileAndPosition = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileAndPositionInput() { + return this._fileAndPosition; + } + + // filter_ddl_policy - computed: false, optional: true, required: false + private _filterDdlPolicy?: string; + public get filterDdlPolicy() { + return this.getStringAttribute('filter_ddl_policy'); + } + public set filterDdlPolicy(value: string) { + this._filterDdlPolicy = value; + } + public resetFilterDdlPolicy() { + this._filterDdlPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterDdlPolicyInput() { + return this._filterDdlPolicy; + } + + // gtid_set - computed: false, optional: true, required: false + private _gtidSet?: string; + public get gtidSet() { + return this.getStringAttribute('gtid_set'); + } + public set gtidSet(value: string) { + this._gtidSet = value; + } + public resetGtidSet() { + this._gtidSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get gtidSetInput() { + return this._gtidSet; + } + + // index_trans - computed: false, optional: true, required: false + private _indexTrans?: boolean | cdktf.IResolvable; + public get indexTrans() { + return this.getBooleanAttribute('index_trans'); + } + public set indexTrans(value: boolean | cdktf.IResolvable) { + this._indexTrans = value; + } + public resetIndexTrans() { + this._indexTrans = undefined; + } + // Temporarily expose input value. Use with caution. + public get indexTransInput() { + return this._indexTrans; + } + + // is_fill_materialized_view - computed: false, optional: true, required: false + private _isFillMaterializedView?: boolean | cdktf.IResolvable; + public get isFillMaterializedView() { + return this.getBooleanAttribute('is_fill_materialized_view'); + } + public set isFillMaterializedView(value: boolean | cdktf.IResolvable) { + this._isFillMaterializedView = value; + } + public resetIsFillMaterializedView() { + this._isFillMaterializedView = undefined; + } + // Temporarily expose input value. Use with caution. + public get isFillMaterializedViewInput() { + return this._isFillMaterializedView; + } + + // kafka_data_format - computed: false, optional: true, required: false + private _kafkaDataFormat?: string; + public get kafkaDataFormat() { + return this.getStringAttribute('kafka_data_format'); + } + public set kafkaDataFormat(value: string) { + this._kafkaDataFormat = value; + } + public resetKafkaDataFormat() { + this._kafkaDataFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaDataFormatInput() { + return this._kafkaDataFormat; + } + + // partition_policy - computed: false, optional: true, required: false + private _partitionPolicy?: string; + public get partitionPolicy() { + return this.getStringAttribute('partition_policy'); + } + public set partitionPolicy(value: string) { + this._partitionPolicy = value; + } + public resetPartitionPolicy() { + this._partitionPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionPolicyInput() { + return this._partitionPolicy; + } + + // partitions_num - computed: false, optional: true, required: false + private _partitionsNum?: string; + public get partitionsNum() { + return this.getStringAttribute('partitions_num'); + } + public set partitionsNum(value: string) { + this._partitionsNum = value; + } + public resetPartitionsNum() { + this._partitionsNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get partitionsNumInput() { + return this._partitionsNum; + } + + // replication_factor - computed: false, optional: true, required: false + private _replicationFactor?: string; + public get replicationFactor() { + return this.getStringAttribute('replication_factor'); + } + public set replicationFactor(value: string) { + this._replicationFactor = value; + } + public resetReplicationFactor() { + this._replicationFactor = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicationFactorInput() { + return this._replicationFactor; + } + + // slot_name - computed: false, optional: true, required: false + private _slotName?: string; + public get slotName() { + return this.getStringAttribute('slot_name'); + } + public set slotName(value: string) { + this._slotName = value; + } + public resetSlotName() { + this._slotName = undefined; + } + // Temporarily expose input value. Use with caution. + public get slotNameInput() { + return this._slotName; + } + + // topic - computed: false, optional: true, required: false + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + public resetTopic() { + this._topic = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // topic_name_format - computed: false, optional: true, required: false + private _topicNameFormat?: string; + public get topicNameFormat() { + return this.getStringAttribute('topic_name_format'); + } + public set topicNameFormat(value: string) { + this._topicNameFormat = value; + } + public resetTopicNameFormat() { + this._topicNameFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicNameFormatInput() { + return this._topicNameFormat; + } + + // topic_policy - computed: false, optional: true, required: false + private _topicPolicy?: string; + public get topicPolicy() { + return this.getStringAttribute('topic_policy'); + } + public set topicPolicy(value: string) { + this._topicPolicy = value; + } + public resetTopicPolicy() { + this._topicPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicPolicyInput() { + return this._topicPolicy; + } +} +export interface DrsJobPublicIpListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#id DrsJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#public_ip DrsJob#public_ip} + */ + readonly publicIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#type DrsJob#type} + */ + readonly type: string; +} + +export function drsJobPublicIpListStructToTerraform(struct?: DrsJobPublicIpListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + public_ip: cdktf.stringToTerraform(struct!.publicIp), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function drsJobPublicIpListStructToHclTerraform(struct?: DrsJobPublicIpListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(struct!.publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobPublicIpListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DrsJobPublicIpListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._publicIp !== undefined) { + hasAnyValues = true; + internalValueResult.publicIp = this._publicIp; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobPublicIpListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._publicIp = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._publicIp = value.publicIp; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class DrsJobPublicIpListStructList extends cdktf.ComplexList { + public internalValue? : DrsJobPublicIpListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DrsJobPublicIpListStructOutputReference { + return new DrsJobPublicIpListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DrsJobSourceDbKafkaSecurityConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#delegation_tokens DrsJob#delegation_tokens} + */ + readonly delegationTokens?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#enable_key_store DrsJob#enable_key_store} + */ + readonly enableKeyStore?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#endpoint_algorithm DrsJob#endpoint_algorithm} + */ + readonly endpointAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_password DrsJob#key_password} + */ + readonly keyPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_store_key DrsJob#key_store_key} + */ + readonly keyStoreKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_store_key_name DrsJob#key_store_key_name} + */ + readonly keyStoreKeyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#key_store_password DrsJob#key_store_password} + */ + readonly keyStorePassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#sasl_mechanism DrsJob#sasl_mechanism} + */ + readonly saslMechanism?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#set_private_key_password DrsJob#set_private_key_password} + */ + readonly setPrivateKeyPassword?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#trust_store_key DrsJob#trust_store_key} + */ + readonly trustStoreKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#trust_store_key_name DrsJob#trust_store_key_name} + */ + readonly trustStoreKeyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#trust_store_password DrsJob#trust_store_password} + */ + readonly trustStorePassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#type DrsJob#type} + */ + readonly type?: string; +} + +export function drsJobSourceDbKafkaSecurityConfigToTerraform(struct?: DrsJobSourceDbKafkaSecurityConfigOutputReference | DrsJobSourceDbKafkaSecurityConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delegation_tokens: cdktf.booleanToTerraform(struct!.delegationTokens), + enable_key_store: cdktf.booleanToTerraform(struct!.enableKeyStore), + endpoint_algorithm: cdktf.stringToTerraform(struct!.endpointAlgorithm), + key_password: cdktf.stringToTerraform(struct!.keyPassword), + key_store_key: cdktf.stringToTerraform(struct!.keyStoreKey), + key_store_key_name: cdktf.stringToTerraform(struct!.keyStoreKeyName), + key_store_password: cdktf.stringToTerraform(struct!.keyStorePassword), + sasl_mechanism: cdktf.stringToTerraform(struct!.saslMechanism), + set_private_key_password: cdktf.booleanToTerraform(struct!.setPrivateKeyPassword), + trust_store_key: cdktf.stringToTerraform(struct!.trustStoreKey), + trust_store_key_name: cdktf.stringToTerraform(struct!.trustStoreKeyName), + trust_store_password: cdktf.stringToTerraform(struct!.trustStorePassword), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function drsJobSourceDbKafkaSecurityConfigToHclTerraform(struct?: DrsJobSourceDbKafkaSecurityConfigOutputReference | DrsJobSourceDbKafkaSecurityConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delegation_tokens: { + value: cdktf.booleanToHclTerraform(struct!.delegationTokens), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_key_store: { + value: cdktf.booleanToHclTerraform(struct!.enableKeyStore), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + endpoint_algorithm: { + value: cdktf.stringToHclTerraform(struct!.endpointAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_password: { + value: cdktf.stringToHclTerraform(struct!.keyPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_store_key: { + value: cdktf.stringToHclTerraform(struct!.keyStoreKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_store_key_name: { + value: cdktf.stringToHclTerraform(struct!.keyStoreKeyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_store_password: { + value: cdktf.stringToHclTerraform(struct!.keyStorePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sasl_mechanism: { + value: cdktf.stringToHclTerraform(struct!.saslMechanism), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + set_private_key_password: { + value: cdktf.booleanToHclTerraform(struct!.setPrivateKeyPassword), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + trust_store_key: { + value: cdktf.stringToHclTerraform(struct!.trustStoreKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trust_store_key_name: { + value: cdktf.stringToHclTerraform(struct!.trustStoreKeyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trust_store_password: { + value: cdktf.stringToHclTerraform(struct!.trustStorePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobSourceDbKafkaSecurityConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DrsJobSourceDbKafkaSecurityConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delegationTokens !== undefined) { + hasAnyValues = true; + internalValueResult.delegationTokens = this._delegationTokens; + } + if (this._enableKeyStore !== undefined) { + hasAnyValues = true; + internalValueResult.enableKeyStore = this._enableKeyStore; + } + if (this._endpointAlgorithm !== undefined) { + hasAnyValues = true; + internalValueResult.endpointAlgorithm = this._endpointAlgorithm; + } + if (this._keyPassword !== undefined) { + hasAnyValues = true; + internalValueResult.keyPassword = this._keyPassword; + } + if (this._keyStoreKey !== undefined) { + hasAnyValues = true; + internalValueResult.keyStoreKey = this._keyStoreKey; + } + if (this._keyStoreKeyName !== undefined) { + hasAnyValues = true; + internalValueResult.keyStoreKeyName = this._keyStoreKeyName; + } + if (this._keyStorePassword !== undefined) { + hasAnyValues = true; + internalValueResult.keyStorePassword = this._keyStorePassword; + } + if (this._saslMechanism !== undefined) { + hasAnyValues = true; + internalValueResult.saslMechanism = this._saslMechanism; + } + if (this._setPrivateKeyPassword !== undefined) { + hasAnyValues = true; + internalValueResult.setPrivateKeyPassword = this._setPrivateKeyPassword; + } + if (this._trustStoreKey !== undefined) { + hasAnyValues = true; + internalValueResult.trustStoreKey = this._trustStoreKey; + } + if (this._trustStoreKeyName !== undefined) { + hasAnyValues = true; + internalValueResult.trustStoreKeyName = this._trustStoreKeyName; + } + if (this._trustStorePassword !== undefined) { + hasAnyValues = true; + internalValueResult.trustStorePassword = this._trustStorePassword; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobSourceDbKafkaSecurityConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delegationTokens = undefined; + this._enableKeyStore = undefined; + this._endpointAlgorithm = undefined; + this._keyPassword = undefined; + this._keyStoreKey = undefined; + this._keyStoreKeyName = undefined; + this._keyStorePassword = undefined; + this._saslMechanism = undefined; + this._setPrivateKeyPassword = undefined; + this._trustStoreKey = undefined; + this._trustStoreKeyName = undefined; + this._trustStorePassword = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delegationTokens = value.delegationTokens; + this._enableKeyStore = value.enableKeyStore; + this._endpointAlgorithm = value.endpointAlgorithm; + this._keyPassword = value.keyPassword; + this._keyStoreKey = value.keyStoreKey; + this._keyStoreKeyName = value.keyStoreKeyName; + this._keyStorePassword = value.keyStorePassword; + this._saslMechanism = value.saslMechanism; + this._setPrivateKeyPassword = value.setPrivateKeyPassword; + this._trustStoreKey = value.trustStoreKey; + this._trustStoreKeyName = value.trustStoreKeyName; + this._trustStorePassword = value.trustStorePassword; + this._type = value.type; + } + } + + // delegation_tokens - computed: false, optional: true, required: false + private _delegationTokens?: boolean | cdktf.IResolvable; + public get delegationTokens() { + return this.getBooleanAttribute('delegation_tokens'); + } + public set delegationTokens(value: boolean | cdktf.IResolvable) { + this._delegationTokens = value; + } + public resetDelegationTokens() { + this._delegationTokens = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegationTokensInput() { + return this._delegationTokens; + } + + // enable_key_store - computed: false, optional: true, required: false + private _enableKeyStore?: boolean | cdktf.IResolvable; + public get enableKeyStore() { + return this.getBooleanAttribute('enable_key_store'); + } + public set enableKeyStore(value: boolean | cdktf.IResolvable) { + this._enableKeyStore = value; + } + public resetEnableKeyStore() { + this._enableKeyStore = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableKeyStoreInput() { + return this._enableKeyStore; + } + + // endpoint_algorithm - computed: false, optional: true, required: false + private _endpointAlgorithm?: string; + public get endpointAlgorithm() { + return this.getStringAttribute('endpoint_algorithm'); + } + public set endpointAlgorithm(value: string) { + this._endpointAlgorithm = value; + } + public resetEndpointAlgorithm() { + this._endpointAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointAlgorithmInput() { + return this._endpointAlgorithm; + } + + // key_password - computed: false, optional: true, required: false + private _keyPassword?: string; + public get keyPassword() { + return this.getStringAttribute('key_password'); + } + public set keyPassword(value: string) { + this._keyPassword = value; + } + public resetKeyPassword() { + this._keyPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPasswordInput() { + return this._keyPassword; + } + + // key_store_key - computed: false, optional: true, required: false + private _keyStoreKey?: string; + public get keyStoreKey() { + return this.getStringAttribute('key_store_key'); + } + public set keyStoreKey(value: string) { + this._keyStoreKey = value; + } + public resetKeyStoreKey() { + this._keyStoreKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStoreKeyInput() { + return this._keyStoreKey; + } + + // key_store_key_name - computed: false, optional: true, required: false + private _keyStoreKeyName?: string; + public get keyStoreKeyName() { + return this.getStringAttribute('key_store_key_name'); + } + public set keyStoreKeyName(value: string) { + this._keyStoreKeyName = value; + } + public resetKeyStoreKeyName() { + this._keyStoreKeyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStoreKeyNameInput() { + return this._keyStoreKeyName; + } + + // key_store_password - computed: false, optional: true, required: false + private _keyStorePassword?: string; + public get keyStorePassword() { + return this.getStringAttribute('key_store_password'); + } + public set keyStorePassword(value: string) { + this._keyStorePassword = value; + } + public resetKeyStorePassword() { + this._keyStorePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyStorePasswordInput() { + return this._keyStorePassword; + } + + // sasl_mechanism - computed: false, optional: true, required: false + private _saslMechanism?: string; + public get saslMechanism() { + return this.getStringAttribute('sasl_mechanism'); + } + public set saslMechanism(value: string) { + this._saslMechanism = value; + } + public resetSaslMechanism() { + this._saslMechanism = undefined; + } + // Temporarily expose input value. Use with caution. + public get saslMechanismInput() { + return this._saslMechanism; + } + + // set_private_key_password - computed: false, optional: true, required: false + private _setPrivateKeyPassword?: boolean | cdktf.IResolvable; + public get setPrivateKeyPassword() { + return this.getBooleanAttribute('set_private_key_password'); + } + public set setPrivateKeyPassword(value: boolean | cdktf.IResolvable) { + this._setPrivateKeyPassword = value; + } + public resetSetPrivateKeyPassword() { + this._setPrivateKeyPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get setPrivateKeyPasswordInput() { + return this._setPrivateKeyPassword; + } + + // trust_store_key - computed: false, optional: true, required: false + private _trustStoreKey?: string; + public get trustStoreKey() { + return this.getStringAttribute('trust_store_key'); + } + public set trustStoreKey(value: string) { + this._trustStoreKey = value; + } + public resetTrustStoreKey() { + this._trustStoreKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustStoreKeyInput() { + return this._trustStoreKey; + } + + // trust_store_key_name - computed: false, optional: true, required: false + private _trustStoreKeyName?: string; + public get trustStoreKeyName() { + return this.getStringAttribute('trust_store_key_name'); + } + public set trustStoreKeyName(value: string) { + this._trustStoreKeyName = value; + } + public resetTrustStoreKeyName() { + this._trustStoreKeyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustStoreKeyNameInput() { + return this._trustStoreKeyName; + } + + // trust_store_password - computed: false, optional: true, required: false + private _trustStorePassword?: string; + public get trustStorePassword() { + return this.getStringAttribute('trust_store_password'); + } + public set trustStorePassword(value: string) { + this._trustStorePassword = value; + } + public resetTrustStorePassword() { + this._trustStorePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get trustStorePasswordInput() { + return this._trustStorePassword; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface DrsJobSourceDb { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#engine_type DrsJob#engine_type} + */ + readonly engineType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#instance_id DrsJob#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ip DrsJob#ip} + */ + readonly ip: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#name DrsJob#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#password DrsJob#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#port DrsJob#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#region DrsJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_check_sum DrsJob#ssl_cert_check_sum} + */ + readonly sslCertCheckSum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_key DrsJob#ssl_cert_key} + */ + readonly sslCertKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_name DrsJob#ssl_cert_name} + */ + readonly sslCertName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_cert_password DrsJob#ssl_cert_password} + */ + readonly sslCertPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#ssl_enabled DrsJob#ssl_enabled} + */ + readonly sslEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#subnet_id DrsJob#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#user DrsJob#user} + */ + readonly user?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#vpc_id DrsJob#vpc_id} + */ + readonly vpcId?: string; + /** + * kafka_security_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#kafka_security_config DrsJob#kafka_security_config} + */ + readonly kafkaSecurityConfig?: DrsJobSourceDbKafkaSecurityConfig; +} + +export function drsJobSourceDbToTerraform(struct?: DrsJobSourceDbOutputReference | DrsJobSourceDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine_type: cdktf.stringToTerraform(struct!.engineType), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + ip: cdktf.stringToTerraform(struct!.ip), + name: cdktf.stringToTerraform(struct!.name), + password: cdktf.stringToTerraform(struct!.password), + port: cdktf.numberToTerraform(struct!.port), + region: cdktf.stringToTerraform(struct!.region), + ssl_cert_check_sum: cdktf.stringToTerraform(struct!.sslCertCheckSum), + ssl_cert_key: cdktf.stringToTerraform(struct!.sslCertKey), + ssl_cert_name: cdktf.stringToTerraform(struct!.sslCertName), + ssl_cert_password: cdktf.stringToTerraform(struct!.sslCertPassword), + ssl_enabled: cdktf.booleanToTerraform(struct!.sslEnabled), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + user: cdktf.stringToTerraform(struct!.user), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + kafka_security_config: drsJobSourceDbKafkaSecurityConfigToTerraform(struct!.kafkaSecurityConfig), + } +} + + +export function drsJobSourceDbToHclTerraform(struct?: DrsJobSourceDbOutputReference | DrsJobSourceDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine_type: { + value: cdktf.stringToHclTerraform(struct!.engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_check_sum: { + value: cdktf.stringToHclTerraform(struct!.sslCertCheckSum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_key: { + value: cdktf.stringToHclTerraform(struct!.sslCertKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_name: { + value: cdktf.stringToHclTerraform(struct!.sslCertName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_cert_password: { + value: cdktf.stringToHclTerraform(struct!.sslCertPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enabled: { + value: cdktf.booleanToHclTerraform(struct!.sslEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(struct!.user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka_security_config: { + value: drsJobSourceDbKafkaSecurityConfigToHclTerraform(struct!.kafkaSecurityConfig), + isBlock: true, + type: "list", + storageClassType: "DrsJobSourceDbKafkaSecurityConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobSourceDbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DrsJobSourceDb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engineType !== undefined) { + hasAnyValues = true; + internalValueResult.engineType = this._engineType; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._sslCertCheckSum !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertCheckSum = this._sslCertCheckSum; + } + if (this._sslCertKey !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertKey = this._sslCertKey; + } + if (this._sslCertName !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertName = this._sslCertName; + } + if (this._sslCertPassword !== undefined) { + hasAnyValues = true; + internalValueResult.sslCertPassword = this._sslCertPassword; + } + if (this._sslEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.sslEnabled = this._sslEnabled; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._user !== undefined) { + hasAnyValues = true; + internalValueResult.user = this._user; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + if (this._kafkaSecurityConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.kafkaSecurityConfig = this._kafkaSecurityConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobSourceDb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engineType = undefined; + this._instanceId = undefined; + this._ip = undefined; + this._name = undefined; + this._password = undefined; + this._port = undefined; + this._region = undefined; + this._sslCertCheckSum = undefined; + this._sslCertKey = undefined; + this._sslCertName = undefined; + this._sslCertPassword = undefined; + this._sslEnabled = undefined; + this._subnetId = undefined; + this._user = undefined; + this._vpcId = undefined; + this._kafkaSecurityConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engineType = value.engineType; + this._instanceId = value.instanceId; + this._ip = value.ip; + this._name = value.name; + this._password = value.password; + this._port = value.port; + this._region = value.region; + this._sslCertCheckSum = value.sslCertCheckSum; + this._sslCertKey = value.sslCertKey; + this._sslCertName = value.sslCertName; + this._sslCertPassword = value.sslCertPassword; + this._sslEnabled = value.sslEnabled; + this._subnetId = value.subnetId; + this._user = value.user; + this._vpcId = value.vpcId; + this._kafkaSecurityConfig.internalValue = value.kafkaSecurityConfig; + } + } + + // engine_type - computed: false, optional: false, required: true + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // ssl_cert_check_sum - computed: false, optional: true, required: false + private _sslCertCheckSum?: string; + public get sslCertCheckSum() { + return this.getStringAttribute('ssl_cert_check_sum'); + } + public set sslCertCheckSum(value: string) { + this._sslCertCheckSum = value; + } + public resetSslCertCheckSum() { + this._sslCertCheckSum = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertCheckSumInput() { + return this._sslCertCheckSum; + } + + // ssl_cert_key - computed: false, optional: true, required: false + private _sslCertKey?: string; + public get sslCertKey() { + return this.getStringAttribute('ssl_cert_key'); + } + public set sslCertKey(value: string) { + this._sslCertKey = value; + } + public resetSslCertKey() { + this._sslCertKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertKeyInput() { + return this._sslCertKey; + } + + // ssl_cert_name - computed: false, optional: true, required: false + private _sslCertName?: string; + public get sslCertName() { + return this.getStringAttribute('ssl_cert_name'); + } + public set sslCertName(value: string) { + this._sslCertName = value; + } + public resetSslCertName() { + this._sslCertName = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertNameInput() { + return this._sslCertName; + } + + // ssl_cert_password - computed: false, optional: true, required: false + private _sslCertPassword?: string; + public get sslCertPassword() { + return this.getStringAttribute('ssl_cert_password'); + } + public set sslCertPassword(value: string) { + this._sslCertPassword = value; + } + public resetSslCertPassword() { + this._sslCertPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslCertPasswordInput() { + return this._sslCertPassword; + } + + // ssl_enabled - computed: false, optional: true, required: false + private _sslEnabled?: boolean | cdktf.IResolvable; + public get sslEnabled() { + return this.getBooleanAttribute('ssl_enabled'); + } + public set sslEnabled(value: boolean | cdktf.IResolvable) { + this._sslEnabled = value; + } + public resetSslEnabled() { + this._sslEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnabledInput() { + return this._sslEnabled; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // user - computed: false, optional: true, required: false + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + public resetUser() { + this._user = undefined; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // kafka_security_config - computed: false, optional: true, required: false + private _kafkaSecurityConfig = new DrsJobSourceDbKafkaSecurityConfigOutputReference(this, "kafka_security_config"); + public get kafkaSecurityConfig() { + return this._kafkaSecurityConfig; + } + public putKafkaSecurityConfig(value: DrsJobSourceDbKafkaSecurityConfig) { + this._kafkaSecurityConfig.internalValue = value; + } + public resetKafkaSecurityConfig() { + this._kafkaSecurityConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaSecurityConfigInput() { + return this._kafkaSecurityConfig.internalValue; + } +} +export interface DrsJobTables { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#database DrsJob#database} + */ + readonly database: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#table_names DrsJob#table_names} + */ + readonly tableNames: string[]; +} + +export function drsJobTablesToTerraform(struct?: DrsJobTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + database: cdktf.stringToTerraform(struct!.database), + table_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.tableNames), + } +} + + +export function drsJobTablesToHclTerraform(struct?: DrsJobTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + database: { + value: cdktf.stringToHclTerraform(struct!.database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.tableNames), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DrsJobTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._database !== undefined) { + hasAnyValues = true; + internalValueResult.database = this._database; + } + if (this._tableNames !== undefined) { + hasAnyValues = true; + internalValueResult.tableNames = this._tableNames; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._database = undefined; + this._tableNames = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._database = value.database; + this._tableNames = value.tableNames; + } + } + + // database - computed: false, optional: false, required: true + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // table_names - computed: false, optional: false, required: true + private _tableNames?: string[]; + public get tableNames() { + return cdktf.Fn.tolist(this.getListAttribute('table_names')); + } + public set tableNames(value: string[]) { + this._tableNames = value; + } + // Temporarily expose input value. Use with caution. + public get tableNamesInput() { + return this._tableNames; + } +} + +export class DrsJobTablesList extends cdktf.ComplexList { + public internalValue? : DrsJobTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DrsJobTablesOutputReference { + return new DrsJobTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DrsJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#create DrsJob#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#delete DrsJob#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#update DrsJob#update} + */ + readonly update?: string; +} + +export function drsJobTimeoutsToTerraform(struct?: DrsJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function drsJobTimeoutsToHclTerraform(struct?: DrsJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DrsJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DrsJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DrsJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job huaweicloud_drs_job} +*/ +export class DrsJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_drs_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DrsJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DrsJob to import + * @param importFromId The id of the existing DrsJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DrsJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_drs_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/drs_job huaweicloud_drs_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DrsJobConfig + */ + public constructor(scope: Construct, id: string, config: DrsJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_drs_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._databases = config.databases; + this._description = config.description; + this._destinationDbReadnoly = config.destinationDbReadnoly; + this._direction = config.direction; + this._engineType = config.engineType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._expiredDays = config.expiredDays; + this._forceDestroy = config.forceDestroy; + this._id = config.id; + this._isOpenFastClean = config.isOpenFastClean; + this._isSyncReEdit = config.isSyncReEdit; + this._masterAz = config.masterAz; + this._migrateDefiner = config.migrateDefiner; + this._migrationType = config.migrationType; + this._multiWrite = config.multiWrite; + this._name = config.name; + this._netType = config.netType; + this._nodeType = config.nodeType; + this._pauseMode = config.pauseMode; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._slaveAz = config.slaveAz; + this._startTime = config.startTime; + this._tags = config.tags; + this._type = config.type; + this._alarmNotify.internalValue = config.alarmNotify; + this._destinationDb.internalValue = config.destinationDb; + this._limitSpeed.internalValue = config.limitSpeed; + this._policyConfig.internalValue = config.policyConfig; + this._publicIpList.internalValue = config.publicIpList; + this._sourceDb.internalValue = config.sourceDb; + this._tables.internalValue = config.tables; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // databases - computed: false, optional: true, required: false + private _databases?: string[]; + public get databases() { + return cdktf.Fn.tolist(this.getListAttribute('databases')); + } + public set databases(value: string[]) { + this._databases = value; + } + public resetDatabases() { + this._databases = undefined; + } + // Temporarily expose input value. Use with caution. + public get databasesInput() { + return this._databases; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_db_readnoly - computed: false, optional: true, required: false + private _destinationDbReadnoly?: boolean | cdktf.IResolvable; + public get destinationDbReadnoly() { + return this.getBooleanAttribute('destination_db_readnoly'); + } + public set destinationDbReadnoly(value: boolean | cdktf.IResolvable) { + this._destinationDbReadnoly = value; + } + public resetDestinationDbReadnoly() { + this._destinationDbReadnoly = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationDbReadnolyInput() { + return this._destinationDbReadnoly; + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // engine_type - computed: false, optional: false, required: true + private _engineType?: string; + public get engineType() { + return this.getStringAttribute('engine_type'); + } + public set engineType(value: string) { + this._engineType = value; + } + // Temporarily expose input value. Use with caution. + public get engineTypeInput() { + return this._engineType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expired_days - computed: false, optional: true, required: false + private _expiredDays?: number; + public get expiredDays() { + return this.getNumberAttribute('expired_days'); + } + public set expiredDays(value: number) { + this._expiredDays = value; + } + public resetExpiredDays() { + this._expiredDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get expiredDaysInput() { + return this._expiredDays; + } + + // force_destroy - computed: false, optional: true, required: false + private _forceDestroy?: boolean | cdktf.IResolvable; + public get forceDestroy() { + return this.getBooleanAttribute('force_destroy'); + } + public set forceDestroy(value: boolean | cdktf.IResolvable) { + this._forceDestroy = value; + } + public resetForceDestroy() { + this._forceDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDestroyInput() { + return this._forceDestroy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_open_fast_clean - computed: true, optional: true, required: false + private _isOpenFastClean?: boolean | cdktf.IResolvable; + public get isOpenFastClean() { + return this.getBooleanAttribute('is_open_fast_clean'); + } + public set isOpenFastClean(value: boolean | cdktf.IResolvable) { + this._isOpenFastClean = value; + } + public resetIsOpenFastClean() { + this._isOpenFastClean = undefined; + } + // Temporarily expose input value. Use with caution. + public get isOpenFastCleanInput() { + return this._isOpenFastClean; + } + + // is_sync_re_edit - computed: false, optional: true, required: false + private _isSyncReEdit?: boolean | cdktf.IResolvable; + public get isSyncReEdit() { + return this.getBooleanAttribute('is_sync_re_edit'); + } + public set isSyncReEdit(value: boolean | cdktf.IResolvable) { + this._isSyncReEdit = value; + } + public resetIsSyncReEdit() { + this._isSyncReEdit = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSyncReEditInput() { + return this._isSyncReEdit; + } + + // master_az - computed: false, optional: true, required: false + private _masterAz?: string; + public get masterAz() { + return this.getStringAttribute('master_az'); + } + public set masterAz(value: string) { + this._masterAz = value; + } + public resetMasterAz() { + this._masterAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterAzInput() { + return this._masterAz; + } + + // master_job_id - computed: true, optional: false, required: false + public get masterJobId() { + return this.getStringAttribute('master_job_id'); + } + + // migrate_definer - computed: false, optional: true, required: false + private _migrateDefiner?: boolean | cdktf.IResolvable; + public get migrateDefiner() { + return this.getBooleanAttribute('migrate_definer'); + } + public set migrateDefiner(value: boolean | cdktf.IResolvable) { + this._migrateDefiner = value; + } + public resetMigrateDefiner() { + this._migrateDefiner = undefined; + } + // Temporarily expose input value. Use with caution. + public get migrateDefinerInput() { + return this._migrateDefiner; + } + + // migration_type - computed: false, optional: true, required: false + private _migrationType?: string; + public get migrationType() { + return this.getStringAttribute('migration_type'); + } + public set migrationType(value: string) { + this._migrationType = value; + } + public resetMigrationType() { + this._migrationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get migrationTypeInput() { + return this._migrationType; + } + + // multi_write - computed: false, optional: true, required: false + private _multiWrite?: boolean | cdktf.IResolvable; + public get multiWrite() { + return this.getBooleanAttribute('multi_write'); + } + public set multiWrite(value: boolean | cdktf.IResolvable) { + this._multiWrite = value; + } + public resetMultiWrite() { + this._multiWrite = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiWriteInput() { + return this._multiWrite; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // net_type - computed: false, optional: true, required: false + private _netType?: string; + public get netType() { + return this.getStringAttribute('net_type'); + } + public set netType(value: string) { + this._netType = value; + } + public resetNetType() { + this._netType = undefined; + } + // Temporarily expose input value. Use with caution. + public get netTypeInput() { + return this._netType; + } + + // node_type - computed: false, optional: true, required: false + private _nodeType?: string; + public get nodeType() { + return this.getStringAttribute('node_type'); + } + public set nodeType(value: string) { + this._nodeType = value; + } + public resetNodeType() { + this._nodeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeTypeInput() { + return this._nodeType; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // original_job_direction - computed: true, optional: false, required: false + public get originalJobDirection() { + return this.getStringAttribute('original_job_direction'); + } + + // pause_mode - computed: false, optional: true, required: false + private _pauseMode?: string; + public get pauseMode() { + return this.getStringAttribute('pause_mode'); + } + public set pauseMode(value: string) { + this._pauseMode = value; + } + public resetPauseMode() { + this._pauseMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get pauseModeInput() { + return this._pauseMode; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getStringAttribute('progress'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + + // slave_az - computed: false, optional: true, required: false + private _slaveAz?: string; + public get slaveAz() { + return this.getStringAttribute('slave_az'); + } + public set slaveAz(value: string) { + this._slaveAz = value; + } + public resetSlaveAz() { + this._slaveAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get slaveAzInput() { + return this._slaveAz; + } + + // slave_job_id - computed: true, optional: false, required: false + public get slaveJobId() { + return this.getStringAttribute('slave_job_id'); + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // alarm_notify - computed: false, optional: true, required: false + private _alarmNotify = new DrsJobAlarmNotifyOutputReference(this, "alarm_notify"); + public get alarmNotify() { + return this._alarmNotify; + } + public putAlarmNotify(value: DrsJobAlarmNotify) { + this._alarmNotify.internalValue = value; + } + public resetAlarmNotify() { + this._alarmNotify.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmNotifyInput() { + return this._alarmNotify.internalValue; + } + + // destination_db - computed: false, optional: false, required: true + private _destinationDb = new DrsJobDestinationDbOutputReference(this, "destination_db"); + public get destinationDb() { + return this._destinationDb; + } + public putDestinationDb(value: DrsJobDestinationDb) { + this._destinationDb.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get destinationDbInput() { + return this._destinationDb.internalValue; + } + + // limit_speed - computed: false, optional: true, required: false + private _limitSpeed = new DrsJobLimitSpeedList(this, "limit_speed", true); + public get limitSpeed() { + return this._limitSpeed; + } + public putLimitSpeed(value: DrsJobLimitSpeed[] | cdktf.IResolvable) { + this._limitSpeed.internalValue = value; + } + public resetLimitSpeed() { + this._limitSpeed.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitSpeedInput() { + return this._limitSpeed.internalValue; + } + + // policy_config - computed: false, optional: true, required: false + private _policyConfig = new DrsJobPolicyConfigOutputReference(this, "policy_config"); + public get policyConfig() { + return this._policyConfig; + } + public putPolicyConfig(value: DrsJobPolicyConfig) { + this._policyConfig.internalValue = value; + } + public resetPolicyConfig() { + this._policyConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyConfigInput() { + return this._policyConfig.internalValue; + } + + // public_ip_list - computed: false, optional: true, required: false + private _publicIpList = new DrsJobPublicIpListStructList(this, "public_ip_list", false); + public get publicIpList() { + return this._publicIpList; + } + public putPublicIpList(value: DrsJobPublicIpListStruct[] | cdktf.IResolvable) { + this._publicIpList.internalValue = value; + } + public resetPublicIpList() { + this._publicIpList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpListInput() { + return this._publicIpList.internalValue; + } + + // source_db - computed: false, optional: false, required: true + private _sourceDb = new DrsJobSourceDbOutputReference(this, "source_db"); + public get sourceDb() { + return this._sourceDb; + } + public putSourceDb(value: DrsJobSourceDb) { + this._sourceDb.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceDbInput() { + return this._sourceDb.internalValue; + } + + // tables - computed: false, optional: true, required: false + private _tables = new DrsJobTablesList(this, "tables", true); + public get tables() { + return this._tables; + } + public putTables(value: DrsJobTables[] | cdktf.IResolvable) { + this._tables.internalValue = value; + } + public resetTables() { + this._tables.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tablesInput() { + return this._tables.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DrsJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DrsJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + databases: cdktf.listMapper(cdktf.stringToTerraform, false)(this._databases), + description: cdktf.stringToTerraform(this._description), + destination_db_readnoly: cdktf.booleanToTerraform(this._destinationDbReadnoly), + direction: cdktf.stringToTerraform(this._direction), + engine_type: cdktf.stringToTerraform(this._engineType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + expired_days: cdktf.numberToTerraform(this._expiredDays), + force_destroy: cdktf.booleanToTerraform(this._forceDestroy), + id: cdktf.stringToTerraform(this._id), + is_open_fast_clean: cdktf.booleanToTerraform(this._isOpenFastClean), + is_sync_re_edit: cdktf.booleanToTerraform(this._isSyncReEdit), + master_az: cdktf.stringToTerraform(this._masterAz), + migrate_definer: cdktf.booleanToTerraform(this._migrateDefiner), + migration_type: cdktf.stringToTerraform(this._migrationType), + multi_write: cdktf.booleanToTerraform(this._multiWrite), + name: cdktf.stringToTerraform(this._name), + net_type: cdktf.stringToTerraform(this._netType), + node_type: cdktf.stringToTerraform(this._nodeType), + pause_mode: cdktf.stringToTerraform(this._pauseMode), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + slave_az: cdktf.stringToTerraform(this._slaveAz), + start_time: cdktf.stringToTerraform(this._startTime), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + alarm_notify: drsJobAlarmNotifyToTerraform(this._alarmNotify.internalValue), + destination_db: drsJobDestinationDbToTerraform(this._destinationDb.internalValue), + limit_speed: cdktf.listMapper(drsJobLimitSpeedToTerraform, true)(this._limitSpeed.internalValue), + policy_config: drsJobPolicyConfigToTerraform(this._policyConfig.internalValue), + public_ip_list: cdktf.listMapper(drsJobPublicIpListStructToTerraform, true)(this._publicIpList.internalValue), + source_db: drsJobSourceDbToTerraform(this._sourceDb.internalValue), + tables: cdktf.listMapper(drsJobTablesToTerraform, true)(this._tables.internalValue), + timeouts: drsJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + databases: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._databases), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_db_readnoly: { + value: cdktf.booleanToHclTerraform(this._destinationDbReadnoly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + engine_type: { + value: cdktf.stringToHclTerraform(this._engineType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expired_days: { + value: cdktf.numberToHclTerraform(this._expiredDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + force_destroy: { + value: cdktf.booleanToHclTerraform(this._forceDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_open_fast_clean: { + value: cdktf.booleanToHclTerraform(this._isOpenFastClean), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_sync_re_edit: { + value: cdktf.booleanToHclTerraform(this._isSyncReEdit), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + master_az: { + value: cdktf.stringToHclTerraform(this._masterAz), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + migrate_definer: { + value: cdktf.booleanToHclTerraform(this._migrateDefiner), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + migration_type: { + value: cdktf.stringToHclTerraform(this._migrationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multi_write: { + value: cdktf.booleanToHclTerraform(this._multiWrite), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + net_type: { + value: cdktf.stringToHclTerraform(this._netType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_type: { + value: cdktf.stringToHclTerraform(this._nodeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pause_mode: { + value: cdktf.stringToHclTerraform(this._pauseMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slave_az: { + value: cdktf.stringToHclTerraform(this._slaveAz), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alarm_notify: { + value: drsJobAlarmNotifyToHclTerraform(this._alarmNotify.internalValue), + isBlock: true, + type: "list", + storageClassType: "DrsJobAlarmNotifyList", + }, + destination_db: { + value: drsJobDestinationDbToHclTerraform(this._destinationDb.internalValue), + isBlock: true, + type: "list", + storageClassType: "DrsJobDestinationDbList", + }, + limit_speed: { + value: cdktf.listMapperHcl(drsJobLimitSpeedToHclTerraform, true)(this._limitSpeed.internalValue), + isBlock: true, + type: "set", + storageClassType: "DrsJobLimitSpeedList", + }, + policy_config: { + value: drsJobPolicyConfigToHclTerraform(this._policyConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "DrsJobPolicyConfigList", + }, + public_ip_list: { + value: cdktf.listMapperHcl(drsJobPublicIpListStructToHclTerraform, true)(this._publicIpList.internalValue), + isBlock: true, + type: "list", + storageClassType: "DrsJobPublicIpListStructList", + }, + source_db: { + value: drsJobSourceDbToHclTerraform(this._sourceDb.internalValue), + isBlock: true, + type: "list", + storageClassType: "DrsJobSourceDbList", + }, + tables: { + value: cdktf.listMapperHcl(drsJobTablesToHclTerraform, true)(this._tables.internalValue), + isBlock: true, + type: "set", + storageClassType: "DrsJobTablesList", + }, + timeouts: { + value: drsJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DrsJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dsc-alarm-notification/README.md b/src/constructs/providers/huaweicloud/dsc-alarm-notification/README.md new file mode 100644 index 00000000..6dd48751 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dsc-alarm-notification/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dsc_alarm_notification` + +Refer to the Terraform Registry for docs: [`huaweicloud_dsc_alarm_notification`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification). diff --git a/src/constructs/providers/huaweicloud/dsc-alarm-notification/index.ts b/src/constructs/providers/huaweicloud/dsc-alarm-notification/index.ts new file mode 100644 index 00000000..555cca4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dsc-alarm-notification/index.ts @@ -0,0 +1,227 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DscAlarmNotificationConfig extends cdktf.TerraformMetaArguments { + /** + * The alarm topic ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification#alarm_topic_id DscAlarmNotification#alarm_topic_id} + */ + readonly alarmTopicId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification#id DscAlarmNotification#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification#region DscAlarmNotification#region} + */ + readonly region?: string; + /** + * The alarm notification status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification#status DscAlarmNotification#status} + */ + readonly status: number; + /** + * The unique resource identifier of an SMN topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification#topic_urn DscAlarmNotification#topic_urn} + */ + readonly topicUrn: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification huaweicloud_dsc_alarm_notification} +*/ +export class DscAlarmNotification extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dsc_alarm_notification"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DscAlarmNotification resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DscAlarmNotification to import + * @param importFromId The id of the existing DscAlarmNotification that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DscAlarmNotification to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dsc_alarm_notification", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_alarm_notification huaweicloud_dsc_alarm_notification} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DscAlarmNotificationConfig + */ + public constructor(scope: Construct, id: string, config: DscAlarmNotificationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dsc_alarm_notification', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmTopicId = config.alarmTopicId; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._topicUrn = config.topicUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_topic_id - computed: false, optional: false, required: true + private _alarmTopicId?: string; + public get alarmTopicId() { + return this.getStringAttribute('alarm_topic_id'); + } + public set alarmTopicId(value: string) { + this._alarmTopicId = value; + } + // Temporarily expose input value. Use with caution. + public get alarmTopicIdInput() { + return this._alarmTopicId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: false, required: true + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_topic_id: cdktf.stringToTerraform(this._alarmTopicId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.numberToTerraform(this._status), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_topic_id: { + value: cdktf.stringToHclTerraform(this._alarmTopicId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dsc-asset-obs/README.md b/src/constructs/providers/huaweicloud/dsc-asset-obs/README.md new file mode 100644 index 00000000..974bfa9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dsc-asset-obs/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dsc_asset_obs` + +Refer to the Terraform Registry for docs: [`huaweicloud_dsc_asset_obs`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs). diff --git a/src/constructs/providers/huaweicloud/dsc-asset-obs/index.ts b/src/constructs/providers/huaweicloud/dsc-asset-obs/index.ts new file mode 100644 index 00000000..a035bce1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dsc-asset-obs/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DscAssetObsConfig extends cdktf.TerraformMetaArguments { + /** + * The bucket name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs#bucket_name DscAssetObs#bucket_name} + */ + readonly bucketName: string; + /** + * The bucket policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs#bucket_policy DscAssetObs#bucket_policy} + */ + readonly bucketPolicy: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs#id DscAssetObs#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of asset. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs#name DscAssetObs#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs#region DscAssetObs#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs huaweicloud_dsc_asset_obs} +*/ +export class DscAssetObs extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dsc_asset_obs"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DscAssetObs resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DscAssetObs to import + * @param importFromId The id of the existing DscAssetObs that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DscAssetObs to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dsc_asset_obs", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_asset_obs huaweicloud_dsc_asset_obs} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DscAssetObsConfig + */ + public constructor(scope: Construct, id: string, config: DscAssetObsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dsc_asset_obs', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketName = config.bucketName; + this._bucketPolicy = config.bucketPolicy; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_name - computed: false, optional: false, required: true + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // bucket_policy - computed: false, optional: false, required: true + private _bucketPolicy?: string; + public get bucketPolicy() { + return this.getStringAttribute('bucket_policy'); + } + public set bucketPolicy(value: string) { + this._bucketPolicy = value; + } + // Temporarily expose input value. Use with caution. + public get bucketPolicyInput() { + return this._bucketPolicy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_name: cdktf.stringToTerraform(this._bucketName), + bucket_policy: cdktf.stringToTerraform(this._bucketPolicy), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(this._bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket_policy: { + value: cdktf.stringToHclTerraform(this._bucketPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dsc-instance/README.md b/src/constructs/providers/huaweicloud/dsc-instance/README.md new file mode 100644 index 00000000..f9cea974 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dsc-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dsc_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_dsc_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance). diff --git a/src/constructs/providers/huaweicloud/dsc-instance/index.ts b/src/constructs/providers/huaweicloud/dsc-instance/index.ts new file mode 100644 index 00000000..07b779d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dsc-instance/index.ts @@ -0,0 +1,342 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DscInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Whether auto renew is enabled. Valid values are "true" and "false". + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#auto_renew DscInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Billing mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#charging_mode DscInstance#charging_mode} + */ + readonly chargingMode: string; + /** + * Purchase database expansion packages. One expansion package offers one database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#database_expansion_package DscInstance#database_expansion_package} + */ + readonly databaseExpansionPackage?: number; + /** + * The edition of DSC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#edition DscInstance#edition} + */ + readonly edition: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#id DscInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Purchase OBS expansion packages. One OBS expansion package offers 1 TB of OBS storage. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#obs_expansion_package DscInstance#obs_expansion_package} + */ + readonly obsExpansionPackage?: number; + /** + * The charging period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#period DscInstance#period} + */ + readonly period: number; + /** + * The charging period unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#period_unit DscInstance#period_unit} + */ + readonly periodUnit: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#region DscInstance#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance huaweicloud_dsc_instance} +*/ +export class DscInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dsc_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DscInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DscInstance to import + * @param importFromId The id of the existing DscInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DscInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dsc_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dsc_instance huaweicloud_dsc_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DscInstanceConfig + */ + public constructor(scope: Construct, id: string, config: DscInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dsc_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._databaseExpansionPackage = config.databaseExpansionPackage; + this._edition = config.edition; + this._id = config.id; + this._obsExpansionPackage = config.obsExpansionPackage; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // database_expansion_package - computed: true, optional: true, required: false + private _databaseExpansionPackage?: number; + public get databaseExpansionPackage() { + return this.getNumberAttribute('database_expansion_package'); + } + public set databaseExpansionPackage(value: number) { + this._databaseExpansionPackage = value; + } + public resetDatabaseExpansionPackage() { + this._databaseExpansionPackage = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseExpansionPackageInput() { + return this._databaseExpansionPackage; + } + + // edition - computed: false, optional: false, required: true + private _edition?: string; + public get edition() { + return this.getStringAttribute('edition'); + } + public set edition(value: string) { + this._edition = value; + } + // Temporarily expose input value. Use with caution. + public get editionInput() { + return this._edition; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // obs_expansion_package - computed: true, optional: true, required: false + private _obsExpansionPackage?: number; + public get obsExpansionPackage() { + return this.getNumberAttribute('obs_expansion_package'); + } + public set obsExpansionPackage(value: number) { + this._obsExpansionPackage = value; + } + public resetObsExpansionPackage() { + this._obsExpansionPackage = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsExpansionPackageInput() { + return this._obsExpansionPackage; + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + database_expansion_package: cdktf.numberToTerraform(this._databaseExpansionPackage), + edition: cdktf.stringToTerraform(this._edition), + id: cdktf.stringToTerraform(this._id), + obs_expansion_package: cdktf.numberToTerraform(this._obsExpansionPackage), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_expansion_package: { + value: cdktf.numberToHclTerraform(this._databaseExpansionPackage), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + edition: { + value: cdktf.stringToHclTerraform(this._edition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_expansion_package: { + value: cdktf.numberToHclTerraform(this._obsExpansionPackage), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-alarm-subscription/README.md b/src/constructs/providers/huaweicloud/dws-alarm-subscription/README.md new file mode 100644 index 00000000..be4c333d --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-alarm-subscription/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_alarm_subscription` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_alarm_subscription`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription). diff --git a/src/constructs/providers/huaweicloud/dws-alarm-subscription/index.ts b/src/constructs/providers/huaweicloud/dws-alarm-subscription/index.ts new file mode 100644 index 00000000..c8fe9f72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-alarm-subscription/index.ts @@ -0,0 +1,337 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsAlarmSubscriptionConfig extends cdktf.TerraformMetaArguments { + /** + * The level of alarm. separate multiple alarm levels with commas (,). + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#alarm_level DwsAlarmSubscription#alarm_level} + */ + readonly alarmLevel?: string; + /** + * whether the alarm subscription is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#enable DwsAlarmSubscription#enable} + */ + readonly enable: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#id DwsAlarmSubscription#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the alarm subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#name DwsAlarmSubscription#name} + */ + readonly name: string; + /** + * The notification target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#notification_target DwsAlarmSubscription#notification_target} + */ + readonly notificationTarget: string; + /** + * The name of notification target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#notification_target_name DwsAlarmSubscription#notification_target_name} + */ + readonly notificationTargetName: string; + /** + * The type of notification target. Currently only **SMN** is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#notification_target_type DwsAlarmSubscription#notification_target_type} + */ + readonly notificationTargetType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#region DwsAlarmSubscription#region} + */ + readonly region?: string; + /** + * The time_zone of the alarm subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#time_zone DwsAlarmSubscription#time_zone} + */ + readonly timeZone: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription huaweicloud_dws_alarm_subscription} +*/ +export class DwsAlarmSubscription extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_alarm_subscription"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsAlarmSubscription resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsAlarmSubscription to import + * @param importFromId The id of the existing DwsAlarmSubscription that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsAlarmSubscription to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_alarm_subscription", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_alarm_subscription huaweicloud_dws_alarm_subscription} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsAlarmSubscriptionConfig + */ + public constructor(scope: Construct, id: string, config: DwsAlarmSubscriptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_alarm_subscription', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmLevel = config.alarmLevel; + this._enable = config.enable; + this._id = config.id; + this._name = config.name; + this._notificationTarget = config.notificationTarget; + this._notificationTargetName = config.notificationTargetName; + this._notificationTargetType = config.notificationTargetType; + this._region = config.region; + this._timeZone = config.timeZone; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_level - computed: true, optional: true, required: false + private _alarmLevel?: string; + public get alarmLevel() { + return this.getStringAttribute('alarm_level'); + } + public set alarmLevel(value: string) { + this._alarmLevel = value; + } + public resetAlarmLevel() { + this._alarmLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // enable - computed: false, optional: false, required: true + private _enable?: number; + public get enable() { + return this.getNumberAttribute('enable'); + } + public set enable(value: number) { + this._enable = value; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_target - computed: false, optional: false, required: true + private _notificationTarget?: string; + public get notificationTarget() { + return this.getStringAttribute('notification_target'); + } + public set notificationTarget(value: string) { + this._notificationTarget = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetInput() { + return this._notificationTarget; + } + + // notification_target_name - computed: false, optional: false, required: true + private _notificationTargetName?: string; + public get notificationTargetName() { + return this.getStringAttribute('notification_target_name'); + } + public set notificationTargetName(value: string) { + this._notificationTargetName = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetNameInput() { + return this._notificationTargetName; + } + + // notification_target_type - computed: false, optional: false, required: true + private _notificationTargetType?: string; + public get notificationTargetType() { + return this.getStringAttribute('notification_target_type'); + } + public set notificationTargetType(value: string) { + this._notificationTargetType = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetTypeInput() { + return this._notificationTargetType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // time_zone - computed: false, optional: false, required: true + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_level: cdktf.stringToTerraform(this._alarmLevel), + enable: cdktf.numberToTerraform(this._enable), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_target: cdktf.stringToTerraform(this._notificationTarget), + notification_target_name: cdktf.stringToTerraform(this._notificationTargetName), + notification_target_type: cdktf.stringToTerraform(this._notificationTargetType), + region: cdktf.stringToTerraform(this._region), + time_zone: cdktf.stringToTerraform(this._timeZone), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_level: { + value: cdktf.stringToHclTerraform(this._alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.numberToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target: { + value: cdktf.stringToHclTerraform(this._notificationTarget), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_name: { + value: cdktf.stringToHclTerraform(this._notificationTargetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_type: { + value: cdktf.stringToHclTerraform(this._notificationTargetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-cluster-restart/README.md b/src/constructs/providers/huaweicloud/dws-cluster-restart/README.md new file mode 100644 index 00000000..45a58faf --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-cluster-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_cluster_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_cluster_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart). diff --git a/src/constructs/providers/huaweicloud/dws-cluster-restart/index.ts b/src/constructs/providers/huaweicloud/dws-cluster-restart/index.ts new file mode 100644 index 00000000..b9f94b80 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-cluster-restart/index.ts @@ -0,0 +1,295 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsClusterRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the DWS cluster to be restarted. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart#cluster_id DwsClusterRestart#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart#id DwsClusterRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart#region DwsClusterRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart#timeouts DwsClusterRestart#timeouts} + */ + readonly timeouts?: DwsClusterRestartTimeouts; +} +export interface DwsClusterRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart#create DwsClusterRestart#create} + */ + readonly create?: string; +} + +export function dwsClusterRestartTimeoutsToTerraform(struct?: DwsClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dwsClusterRestartTimeoutsToHclTerraform(struct?: DwsClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsClusterRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsClusterRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart huaweicloud_dws_cluster_restart} +*/ +export class DwsClusterRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsClusterRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsClusterRestart to import + * @param importFromId The id of the existing DwsClusterRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsClusterRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster_restart huaweicloud_dws_cluster_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsClusterRestartConfig + */ + public constructor(scope: Construct, id: string, config: DwsClusterRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsClusterRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsClusterRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + timeouts: dwsClusterRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dwsClusterRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsClusterRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-cluster/README.md b/src/constructs/providers/huaweicloud/dws-cluster/README.md new file mode 100644 index 00000000..fc2c36ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster). diff --git a/src/constructs/providers/huaweicloud/dws-cluster/index.ts b/src/constructs/providers/huaweicloud/dws-cluster/index.ts new file mode 100644 index 00000000..236e6909 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-cluster/index.ts @@ -0,0 +1,1648 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsClusterConfig extends cdktf.TerraformMetaArguments { + /** + * The availability zone in which to create the cluster instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#availability_zone DwsCluster#availability_zone} + */ + readonly availabilityZone: string; + /** + * The description of the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#description DwsCluster#description} + */ + readonly description?: string; + /** + * Dedicated storage pool ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#dss_pool_id DwsCluster#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * The ID of the ELB load balancer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#elb_id DwsCluster#elb_id} + */ + readonly elbId?: string; + /** + * The enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#enterprise_project_id DwsCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#id DwsCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The number of latest manual snapshots that need to be retained when deleting the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#keep_last_manual_snapshot DwsCluster#keep_last_manual_snapshot} + */ + readonly keepLastManualSnapshot?: number; + /** + * The KMS key ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#kms_key_id DwsCluster#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Whether to enable logical cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#logical_cluster_enable DwsCluster#logical_cluster_enable} + */ + readonly logicalClusterEnable?: boolean | cdktf.IResolvable; + /** + * Whether to enable LTS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#lts_enable DwsCluster#lts_enable} + */ + readonly ltsEnable?: boolean | cdktf.IResolvable; + /** + * The cluster name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#name DwsCluster#name} + */ + readonly name: string; + /** + * The subnet ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#network_id DwsCluster#network_id} + */ + readonly networkId: string; + /** + * The flavor of the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#node_type DwsCluster#node_type} + */ + readonly nodeType: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#number_of_cn DwsCluster#number_of_cn} + */ + readonly numberOfCn?: number; + /** + * Number of nodes in a cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#number_of_node DwsCluster#number_of_node} + */ + readonly numberOfNode: number; + /** + * Service port of a cluster (8000 to 10000). The default value is 8000. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#port DwsCluster#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#region DwsCluster#region} + */ + readonly region?: string; + /** + * The security group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#security_group_id DwsCluster#security_group_id} + */ + readonly securityGroupId: string; + /** + * The key/value pairs to associate with the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#tags DwsCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Administrator username for logging in to a data warehouse cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#user_name DwsCluster#user_name} + */ + readonly userName: string; + /** + * Administrator password for logging in to a data warehouse cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#user_pwd DwsCluster#user_pwd} + */ + readonly userPwd: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#version DwsCluster#version} + */ + readonly version?: string; + /** + * The VPC ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#vpc_id DwsCluster#vpc_id} + */ + readonly vpcId: string; + /** + * public_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#public_ip DwsCluster#public_ip} + */ + readonly publicIp?: DwsClusterPublicIp; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#timeouts DwsCluster#timeouts} + */ + readonly timeouts?: DwsClusterTimeouts; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#volume DwsCluster#volume} + */ + readonly volume?: DwsClusterVolume; +} +export interface DwsClusterElb { +} + +export function dwsClusterElbToTerraform(struct?: DwsClusterElb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsClusterElbToHclTerraform(struct?: DwsClusterElb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsClusterElbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsClusterElb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterElb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_endpoint - computed: true, optional: false, required: false + public get privateEndpoint() { + return this.getStringAttribute('private_endpoint'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // private_ip_v6 - computed: true, optional: false, required: false + public get privateIpV6() { + return this.getStringAttribute('private_ip_v6'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } +} + +export class DwsClusterElbList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsClusterElbOutputReference { + return new DwsClusterElbOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsClusterEndpoints { +} + +export function dwsClusterEndpointsToTerraform(struct?: DwsClusterEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsClusterEndpointsToHclTerraform(struct?: DwsClusterEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsClusterEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsClusterEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // connect_info - computed: true, optional: false, required: false + public get connectInfo() { + return this.getStringAttribute('connect_info'); + } + + // jdbc_url - computed: true, optional: false, required: false + public get jdbcUrl() { + return this.getStringAttribute('jdbc_url'); + } +} + +export class DwsClusterEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsClusterEndpointsOutputReference { + return new DwsClusterEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsClusterMaintainWindow { +} + +export function dwsClusterMaintainWindowToTerraform(struct?: DwsClusterMaintainWindow): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsClusterMaintainWindowToHclTerraform(struct?: DwsClusterMaintainWindow): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsClusterMaintainWindowOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsClusterMaintainWindow | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterMaintainWindow | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // day - computed: true, optional: false, required: false + public get day() { + return this.getStringAttribute('day'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } +} + +export class DwsClusterMaintainWindowList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsClusterMaintainWindowOutputReference { + return new DwsClusterMaintainWindowOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsClusterPublicEndpoints { +} + +export function dwsClusterPublicEndpointsToTerraform(struct?: DwsClusterPublicEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsClusterPublicEndpointsToHclTerraform(struct?: DwsClusterPublicEndpoints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsClusterPublicEndpointsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsClusterPublicEndpoints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterPublicEndpoints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // jdbc_url - computed: true, optional: false, required: false + public get jdbcUrl() { + return this.getStringAttribute('jdbc_url'); + } + + // public_connect_info - computed: true, optional: false, required: false + public get publicConnectInfo() { + return this.getStringAttribute('public_connect_info'); + } +} + +export class DwsClusterPublicEndpointsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsClusterPublicEndpointsOutputReference { + return new DwsClusterPublicEndpointsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsClusterPublicIp { + /** + * The EIP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#eip_id DwsCluster#eip_id} + */ + readonly eipId?: string; + /** + * The bind type of public IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#public_bind_type DwsCluster#public_bind_type} + */ + readonly publicBindType?: string; +} + +export function dwsClusterPublicIpToTerraform(struct?: DwsClusterPublicIpOutputReference | DwsClusterPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + eip_id: cdktf.stringToTerraform(struct!.eipId), + public_bind_type: cdktf.stringToTerraform(struct!.publicBindType), + } +} + + +export function dwsClusterPublicIpToHclTerraform(struct?: DwsClusterPublicIpOutputReference | DwsClusterPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + eip_id: { + value: cdktf.stringToHclTerraform(struct!.eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_bind_type: { + value: cdktf.stringToHclTerraform(struct!.publicBindType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsClusterPublicIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DwsClusterPublicIp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._eipId !== undefined) { + hasAnyValues = true; + internalValueResult.eipId = this._eipId; + } + if (this._publicBindType !== undefined) { + hasAnyValues = true; + internalValueResult.publicBindType = this._publicBindType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterPublicIp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._eipId = undefined; + this._publicBindType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._eipId = value.eipId; + this._publicBindType = value.publicBindType; + } + } + + // eip_id - computed: false, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // public_bind_type - computed: true, optional: true, required: false + private _publicBindType?: string; + public get publicBindType() { + return this.getStringAttribute('public_bind_type'); + } + public set publicBindType(value: string) { + this._publicBindType = value; + } + public resetPublicBindType() { + this._publicBindType = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicBindTypeInput() { + return this._publicBindType; + } +} +export interface DwsClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#create DwsCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#delete DwsCluster#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#update DwsCluster#update} + */ + readonly update?: string; +} + +export function dwsClusterTimeoutsToTerraform(struct?: DwsClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dwsClusterTimeoutsToHclTerraform(struct?: DwsClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface DwsClusterVolume { + /** + * The capacity size, in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#capacity DwsCluster#capacity} + */ + readonly capacity?: string; + /** + * The volume type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#type DwsCluster#type} + */ + readonly type?: string; +} + +export function dwsClusterVolumeToTerraform(struct?: DwsClusterVolumeOutputReference | DwsClusterVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + capacity: cdktf.stringToTerraform(struct!.capacity), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function dwsClusterVolumeToHclTerraform(struct?: DwsClusterVolumeOutputReference | DwsClusterVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + capacity: { + value: cdktf.stringToHclTerraform(struct!.capacity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsClusterVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): DwsClusterVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._capacity !== undefined) { + hasAnyValues = true; + internalValueResult.capacity = this._capacity; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsClusterVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._capacity = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._capacity = value.capacity; + this._type = value.type; + } + } + + // capacity - computed: true, optional: true, required: false + private _capacity?: string; + public get capacity() { + return this.getStringAttribute('capacity'); + } + public set capacity(value: string) { + this._capacity = value; + } + public resetCapacity() { + this._capacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get capacityInput() { + return this._capacity; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster huaweicloud_dws_cluster} +*/ +export class DwsCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsCluster to import + * @param importFromId The id of the existing DwsCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_cluster huaweicloud_dws_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsClusterConfig + */ + public constructor(scope: Construct, id: string, config: DwsClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._description = config.description; + this._dssPoolId = config.dssPoolId; + this._elbId = config.elbId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._keepLastManualSnapshot = config.keepLastManualSnapshot; + this._kmsKeyId = config.kmsKeyId; + this._logicalClusterEnable = config.logicalClusterEnable; + this._ltsEnable = config.ltsEnable; + this._name = config.name; + this._networkId = config.networkId; + this._nodeType = config.nodeType; + this._numberOfCn = config.numberOfCn; + this._numberOfNode = config.numberOfNode; + this._port = config.port; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._tags = config.tags; + this._userName = config.userName; + this._userPwd = config.userPwd; + this._version = config.version; + this._vpcId = config.vpcId; + this._publicIp.internalValue = config.publicIp; + this._timeouts.internalValue = config.timeouts; + this._volume.internalValue = config.volume; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dss_pool_id - computed: true, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // elb - computed: true, optional: false, required: false + private _elb = new DwsClusterElbList(this, "elb", false); + public get elb() { + return this._elb; + } + + // elb_id - computed: false, optional: true, required: false + private _elbId?: string; + public get elbId() { + return this.getStringAttribute('elb_id'); + } + public set elbId(value: string) { + this._elbId = value; + } + public resetElbId() { + this._elbId = undefined; + } + // Temporarily expose input value. Use with caution. + public get elbIdInput() { + return this._elbId; + } + + // endpoints - computed: true, optional: false, required: false + private _endpoints = new DwsClusterEndpointsList(this, "endpoints", false); + public get endpoints() { + return this._endpoints; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keep_last_manual_snapshot - computed: false, optional: true, required: false + private _keepLastManualSnapshot?: number; + public get keepLastManualSnapshot() { + return this.getNumberAttribute('keep_last_manual_snapshot'); + } + public set keepLastManualSnapshot(value: number) { + this._keepLastManualSnapshot = value; + } + public resetKeepLastManualSnapshot() { + this._keepLastManualSnapshot = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepLastManualSnapshotInput() { + return this._keepLastManualSnapshot; + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // logical_cluster_enable - computed: false, optional: true, required: false + private _logicalClusterEnable?: boolean | cdktf.IResolvable; + public get logicalClusterEnable() { + return this.getBooleanAttribute('logical_cluster_enable'); + } + public set logicalClusterEnable(value: boolean | cdktf.IResolvable) { + this._logicalClusterEnable = value; + } + public resetLogicalClusterEnable() { + this._logicalClusterEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterEnableInput() { + return this._logicalClusterEnable; + } + + // lts_enable - computed: false, optional: true, required: false + private _ltsEnable?: boolean | cdktf.IResolvable; + public get ltsEnable() { + return this.getBooleanAttribute('lts_enable'); + } + public set ltsEnable(value: boolean | cdktf.IResolvable) { + this._ltsEnable = value; + } + public resetLtsEnable() { + this._ltsEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsEnableInput() { + return this._ltsEnable; + } + + // maintain_window - computed: true, optional: false, required: false + private _maintainWindow = new DwsClusterMaintainWindowList(this, "maintain_window", false); + public get maintainWindow() { + return this._maintainWindow; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // node_type - computed: false, optional: false, required: true + private _nodeType?: string; + public get nodeType() { + return this.getStringAttribute('node_type'); + } + public set nodeType(value: string) { + this._nodeType = value; + } + // Temporarily expose input value. Use with caution. + public get nodeTypeInput() { + return this._nodeType; + } + + // number_of_cn - computed: false, optional: true, required: false + private _numberOfCn?: number; + public get numberOfCn() { + return this.getNumberAttribute('number_of_cn'); + } + public set numberOfCn(value: number) { + this._numberOfCn = value; + } + public resetNumberOfCn() { + this._numberOfCn = undefined; + } + // Temporarily expose input value. Use with caution. + public get numberOfCnInput() { + return this._numberOfCn; + } + + // number_of_node - computed: false, optional: false, required: true + private _numberOfNode?: number; + public get numberOfNode() { + return this.getNumberAttribute('number_of_node'); + } + public set numberOfNode(value: number) { + this._numberOfNode = value; + } + // Temporarily expose input value. Use with caution. + public get numberOfNodeInput() { + return this._numberOfNode; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getListAttribute('private_ip'); + } + + // public_endpoints - computed: true, optional: false, required: false + private _publicEndpoints = new DwsClusterPublicEndpointsList(this, "public_endpoints", false); + public get publicEndpoints() { + return this._publicEndpoints; + } + + // recent_event - computed: true, optional: false, required: false + public get recentEvent() { + return this.getNumberAttribute('recent_event'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // sub_status - computed: true, optional: false, required: false + public get subStatus() { + return this.getStringAttribute('sub_status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // task_status - computed: true, optional: false, required: false + public get taskStatus() { + return this.getStringAttribute('task_status'); + } + + // updated - computed: true, optional: false, required: false + public get updated() { + return this.getStringAttribute('updated'); + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // user_pwd - computed: false, optional: false, required: true + private _userPwd?: string; + public get userPwd() { + return this.getStringAttribute('user_pwd'); + } + public set userPwd(value: string) { + this._userPwd = value; + } + // Temporarily expose input value. Use with caution. + public get userPwdInput() { + return this._userPwd; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp = new DwsClusterPublicIpOutputReference(this, "public_ip"); + public get publicIp() { + return this._publicIp; + } + public putPublicIp(value: DwsClusterPublicIp) { + this._publicIp.internalValue = value; + } + public resetPublicIp() { + this._publicIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // volume - computed: false, optional: true, required: false + private _volume = new DwsClusterVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: DwsClusterVolume) { + this._volume.internalValue = value; + } + public resetVolume() { + this._volume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + description: cdktf.stringToTerraform(this._description), + dss_pool_id: cdktf.stringToTerraform(this._dssPoolId), + elb_id: cdktf.stringToTerraform(this._elbId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + keep_last_manual_snapshot: cdktf.numberToTerraform(this._keepLastManualSnapshot), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + logical_cluster_enable: cdktf.booleanToTerraform(this._logicalClusterEnable), + lts_enable: cdktf.booleanToTerraform(this._ltsEnable), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + node_type: cdktf.stringToTerraform(this._nodeType), + number_of_cn: cdktf.numberToTerraform(this._numberOfCn), + number_of_node: cdktf.numberToTerraform(this._numberOfNode), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_name: cdktf.stringToTerraform(this._userName), + user_pwd: cdktf.stringToTerraform(this._userPwd), + version: cdktf.stringToTerraform(this._version), + vpc_id: cdktf.stringToTerraform(this._vpcId), + public_ip: dwsClusterPublicIpToTerraform(this._publicIp.internalValue), + timeouts: dwsClusterTimeoutsToTerraform(this._timeouts.internalValue), + volume: dwsClusterVolumeToTerraform(this._volume.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dss_pool_id: { + value: cdktf.stringToHclTerraform(this._dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + elb_id: { + value: cdktf.stringToHclTerraform(this._elbId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_last_manual_snapshot: { + value: cdktf.numberToHclTerraform(this._keepLastManualSnapshot), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_enable: { + value: cdktf.booleanToHclTerraform(this._logicalClusterEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + lts_enable: { + value: cdktf.booleanToHclTerraform(this._ltsEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_type: { + value: cdktf.stringToHclTerraform(this._nodeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + number_of_cn: { + value: cdktf.numberToHclTerraform(this._numberOfCn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + number_of_node: { + value: cdktf.numberToHclTerraform(this._numberOfNode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_pwd: { + value: cdktf.stringToHclTerraform(this._userPwd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: dwsClusterPublicIpToHclTerraform(this._publicIp.internalValue), + isBlock: true, + type: "list", + storageClassType: "DwsClusterPublicIpList", + }, + timeouts: { + value: dwsClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsClusterTimeouts", + }, + volume: { + value: dwsClusterVolumeToHclTerraform(this._volume.internalValue), + isBlock: true, + type: "list", + storageClassType: "DwsClusterVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-disaster-recovery-task/README.md b/src/constructs/providers/huaweicloud/dws-disaster-recovery-task/README.md new file mode 100644 index 00000000..3a13f993 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-disaster-recovery-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_disaster_recovery_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_disaster_recovery_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task). diff --git a/src/constructs/providers/huaweicloud/dws-disaster-recovery-task/index.ts b/src/constructs/providers/huaweicloud/dws-disaster-recovery-task/index.ts new file mode 100644 index 00000000..cc5ff1f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-disaster-recovery-task/index.ts @@ -0,0 +1,744 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsDisasterRecoveryTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#action DwsDisasterRecoveryTask#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#dr_sync_period DwsDisasterRecoveryTask#dr_sync_period} + */ + readonly drSyncPeriod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#dr_type DwsDisasterRecoveryTask#dr_type} + */ + readonly drType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#id DwsDisasterRecoveryTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#name DwsDisasterRecoveryTask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#primary_cluster_id DwsDisasterRecoveryTask#primary_cluster_id} + */ + readonly primaryClusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#region DwsDisasterRecoveryTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#standby_cluster_id DwsDisasterRecoveryTask#standby_cluster_id} + */ + readonly standbyClusterId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#timeouts DwsDisasterRecoveryTask#timeouts} + */ + readonly timeouts?: DwsDisasterRecoveryTaskTimeouts; +} +export interface DwsDisasterRecoveryTaskPrimaryCluster { +} + +export function dwsDisasterRecoveryTaskPrimaryClusterToTerraform(struct?: DwsDisasterRecoveryTaskPrimaryCluster): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsDisasterRecoveryTaskPrimaryClusterToHclTerraform(struct?: DwsDisasterRecoveryTaskPrimaryCluster): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsDisasterRecoveryTaskPrimaryClusterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsDisasterRecoveryTaskPrimaryCluster | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsDisasterRecoveryTaskPrimaryCluster | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster_az - computed: true, optional: false, required: false + public get clusterAz() { + return this.getStringAttribute('cluster_az'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // last_success_at - computed: true, optional: false, required: false + public get lastSuccessAt() { + return this.getStringAttribute('last_success_at'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // obs_bucket_name - computed: true, optional: false, required: false + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getStringAttribute('progress'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DwsDisasterRecoveryTaskPrimaryClusterList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsDisasterRecoveryTaskPrimaryClusterOutputReference { + return new DwsDisasterRecoveryTaskPrimaryClusterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsDisasterRecoveryTaskStandbyCluster { +} + +export function dwsDisasterRecoveryTaskStandbyClusterToTerraform(struct?: DwsDisasterRecoveryTaskStandbyCluster): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsDisasterRecoveryTaskStandbyClusterToHclTerraform(struct?: DwsDisasterRecoveryTaskStandbyCluster): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsDisasterRecoveryTaskStandbyClusterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsDisasterRecoveryTaskStandbyCluster | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsDisasterRecoveryTaskStandbyCluster | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // cluster_az - computed: true, optional: false, required: false + public get clusterAz() { + return this.getStringAttribute('cluster_az'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // last_success_at - computed: true, optional: false, required: false + public get lastSuccessAt() { + return this.getStringAttribute('last_success_at'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // obs_bucket_name - computed: true, optional: false, required: false + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + + // progress - computed: true, optional: false, required: false + public get progress() { + return this.getStringAttribute('progress'); + } + + // region - computed: true, optional: false, required: false + public get region() { + return this.getStringAttribute('region'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class DwsDisasterRecoveryTaskStandbyClusterList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsDisasterRecoveryTaskStandbyClusterOutputReference { + return new DwsDisasterRecoveryTaskStandbyClusterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsDisasterRecoveryTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#create DwsDisasterRecoveryTask#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#delete DwsDisasterRecoveryTask#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#update DwsDisasterRecoveryTask#update} + */ + readonly update?: string; +} + +export function dwsDisasterRecoveryTaskTimeoutsToTerraform(struct?: DwsDisasterRecoveryTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dwsDisasterRecoveryTaskTimeoutsToHclTerraform(struct?: DwsDisasterRecoveryTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsDisasterRecoveryTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsDisasterRecoveryTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsDisasterRecoveryTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task huaweicloud_dws_disaster_recovery_task} +*/ +export class DwsDisasterRecoveryTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_disaster_recovery_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsDisasterRecoveryTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsDisasterRecoveryTask to import + * @param importFromId The id of the existing DwsDisasterRecoveryTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsDisasterRecoveryTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_disaster_recovery_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_disaster_recovery_task huaweicloud_dws_disaster_recovery_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsDisasterRecoveryTaskConfig + */ + public constructor(scope: Construct, id: string, config: DwsDisasterRecoveryTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_disaster_recovery_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._drSyncPeriod = config.drSyncPeriod; + this._drType = config.drType; + this._id = config.id; + this._name = config.name; + this._primaryClusterId = config.primaryClusterId; + this._region = config.region; + this._standbyClusterId = config.standbyClusterId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dr_sync_period - computed: false, optional: false, required: true + private _drSyncPeriod?: string; + public get drSyncPeriod() { + return this.getStringAttribute('dr_sync_period'); + } + public set drSyncPeriod(value: string) { + this._drSyncPeriod = value; + } + // Temporarily expose input value. Use with caution. + public get drSyncPeriodInput() { + return this._drSyncPeriod; + } + + // dr_type - computed: false, optional: false, required: true + private _drType?: string; + public get drType() { + return this.getStringAttribute('dr_type'); + } + public set drType(value: string) { + this._drType = value; + } + // Temporarily expose input value. Use with caution. + public get drTypeInput() { + return this._drType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // primary_cluster - computed: true, optional: false, required: false + private _primaryCluster = new DwsDisasterRecoveryTaskPrimaryClusterList(this, "primary_cluster", false); + public get primaryCluster() { + return this._primaryCluster; + } + + // primary_cluster_id - computed: false, optional: false, required: true + private _primaryClusterId?: string; + public get primaryClusterId() { + return this.getStringAttribute('primary_cluster_id'); + } + public set primaryClusterId(value: string) { + this._primaryClusterId = value; + } + // Temporarily expose input value. Use with caution. + public get primaryClusterIdInput() { + return this._primaryClusterId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // standby_cluster - computed: true, optional: false, required: false + private _standbyCluster = new DwsDisasterRecoveryTaskStandbyClusterList(this, "standby_cluster", false); + public get standbyCluster() { + return this._standbyCluster; + } + + // standby_cluster_id - computed: false, optional: false, required: true + private _standbyClusterId?: string; + public get standbyClusterId() { + return this.getStringAttribute('standby_cluster_id'); + } + public set standbyClusterId(value: string) { + this._standbyClusterId = value; + } + // Temporarily expose input value. Use with caution. + public get standbyClusterIdInput() { + return this._standbyClusterId; + } + + // started_at - computed: true, optional: false, required: false + public get startedAt() { + return this.getStringAttribute('started_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsDisasterRecoveryTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsDisasterRecoveryTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + dr_sync_period: cdktf.stringToTerraform(this._drSyncPeriod), + dr_type: cdktf.stringToTerraform(this._drType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + primary_cluster_id: cdktf.stringToTerraform(this._primaryClusterId), + region: cdktf.stringToTerraform(this._region), + standby_cluster_id: cdktf.stringToTerraform(this._standbyClusterId), + timeouts: dwsDisasterRecoveryTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dr_sync_period: { + value: cdktf.stringToHclTerraform(this._drSyncPeriod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dr_type: { + value: cdktf.stringToHclTerraform(this._drType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_cluster_id: { + value: cdktf.stringToHclTerraform(this._primaryClusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby_cluster_id: { + value: cdktf.stringToHclTerraform(this._standbyClusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dwsDisasterRecoveryTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsDisasterRecoveryTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-event-subscription/README.md b/src/constructs/providers/huaweicloud/dws-event-subscription/README.md new file mode 100644 index 00000000..27b36978 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-event-subscription/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_event_subscription` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_event_subscription`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription). diff --git a/src/constructs/providers/huaweicloud/dws-event-subscription/index.ts b/src/constructs/providers/huaweicloud/dws-event-subscription/index.ts new file mode 100644 index 00000000..804ce229 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-event-subscription/index.ts @@ -0,0 +1,429 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsEventSubscriptionConfig extends cdktf.TerraformMetaArguments { + /** + * The category of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#category DwsEventSubscription#category} + */ + readonly category?: string; + /** + * whether the event subscription is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#enable DwsEventSubscription#enable} + */ + readonly enable: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#id DwsEventSubscription#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the event subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#name DwsEventSubscription#name} + */ + readonly name: string; + /** + * The notification target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#notification_target DwsEventSubscription#notification_target} + */ + readonly notificationTarget: string; + /** + * The name of notification target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#notification_target_name DwsEventSubscription#notification_target_name} + */ + readonly notificationTargetName: string; + /** + * The type of notification target. Currently only **SMN** is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#notification_target_type DwsEventSubscription#notification_target_type} + */ + readonly notificationTargetType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#region DwsEventSubscription#region} + */ + readonly region?: string; + /** + * The severity of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#severity DwsEventSubscription#severity} + */ + readonly severity?: string; + /** + * ID of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#source_id DwsEventSubscription#source_id} + */ + readonly sourceId?: string; + /** + * The type of source event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#source_type DwsEventSubscription#source_type} + */ + readonly sourceType?: string; + /** + * The time_zone of the event subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#time_zone DwsEventSubscription#time_zone} + */ + readonly timeZone?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription huaweicloud_dws_event_subscription} +*/ +export class DwsEventSubscription extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_event_subscription"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsEventSubscription resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsEventSubscription to import + * @param importFromId The id of the existing DwsEventSubscription that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsEventSubscription to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_event_subscription", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_event_subscription huaweicloud_dws_event_subscription} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsEventSubscriptionConfig + */ + public constructor(scope: Construct, id: string, config: DwsEventSubscriptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_event_subscription', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._enable = config.enable; + this._id = config.id; + this._name = config.name; + this._notificationTarget = config.notificationTarget; + this._notificationTargetName = config.notificationTargetName; + this._notificationTargetType = config.notificationTargetType; + this._region = config.region; + this._severity = config.severity; + this._sourceId = config.sourceId; + this._sourceType = config.sourceType; + this._timeZone = config.timeZone; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: true, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // enable - computed: false, optional: false, required: true + private _enable?: string; + public get enable() { + return this.getStringAttribute('enable'); + } + public set enable(value: string) { + this._enable = value; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // notification_target - computed: false, optional: false, required: true + private _notificationTarget?: string; + public get notificationTarget() { + return this.getStringAttribute('notification_target'); + } + public set notificationTarget(value: string) { + this._notificationTarget = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetInput() { + return this._notificationTarget; + } + + // notification_target_name - computed: false, optional: false, required: true + private _notificationTargetName?: string; + public get notificationTargetName() { + return this.getStringAttribute('notification_target_name'); + } + public set notificationTargetName(value: string) { + this._notificationTargetName = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetNameInput() { + return this._notificationTargetName; + } + + // notification_target_type - computed: false, optional: false, required: true + private _notificationTargetType?: string; + public get notificationTargetType() { + return this.getStringAttribute('notification_target_type'); + } + public set notificationTargetType(value: string) { + this._notificationTargetType = value; + } + // Temporarily expose input value. Use with caution. + public get notificationTargetTypeInput() { + return this._notificationTargetType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // severity - computed: true, optional: true, required: false + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + public resetSeverity() { + this._severity = undefined; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // source_id - computed: true, optional: true, required: false + private _sourceId?: string; + public get sourceId() { + return this.getStringAttribute('source_id'); + } + public set sourceId(value: string) { + this._sourceId = value; + } + public resetSourceId() { + this._sourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIdInput() { + return this._sourceId; + } + + // source_type - computed: true, optional: true, required: false + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // time_zone - computed: true, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + enable: cdktf.stringToTerraform(this._enable), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + notification_target: cdktf.stringToTerraform(this._notificationTarget), + notification_target_name: cdktf.stringToTerraform(this._notificationTargetName), + notification_target_type: cdktf.stringToTerraform(this._notificationTargetType), + region: cdktf.stringToTerraform(this._region), + severity: cdktf.stringToTerraform(this._severity), + source_id: cdktf.stringToTerraform(this._sourceId), + source_type: cdktf.stringToTerraform(this._sourceType), + time_zone: cdktf.stringToTerraform(this._timeZone), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.stringToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target: { + value: cdktf.stringToHclTerraform(this._notificationTarget), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_name: { + value: cdktf.stringToHclTerraform(this._notificationTargetName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notification_target_type: { + value: cdktf.stringToHclTerraform(this._notificationTargetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(this._severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_id: { + value: cdktf.stringToHclTerraform(this._sourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-ext-data-source/README.md b/src/constructs/providers/huaweicloud/dws-ext-data-source/README.md new file mode 100644 index 00000000..7a88f877 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-ext-data-source/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_ext_data_source` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_ext_data_source`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source). diff --git a/src/constructs/providers/huaweicloud/dws-ext-data-source/index.ts b/src/constructs/providers/huaweicloud/dws-ext-data-source/index.ts new file mode 100644 index 00000000..6efff219 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-ext-data-source/index.ts @@ -0,0 +1,610 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsExtDataSourceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#cluster_id DwsExtDataSource#cluster_id} + */ + readonly clusterId: string; + /** + * The connection information of the external data source. It is mandatory when **type** is **OBS**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#connect_info DwsExtDataSource#connect_info} + */ + readonly connectInfo?: string; + /** + * ID of the external data source. It is mandatory when **type** is **MRS**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#data_source_id DwsExtDataSource#data_source_id} + */ + readonly dataSourceId?: string; + /** + * The description of the external data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#description DwsExtDataSource#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#id DwsExtDataSource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the external data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#name DwsExtDataSource#name} + */ + readonly name: string; + /** + * Whether to reboot the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#reboot DwsExtDataSource#reboot} + */ + readonly reboot?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#region DwsExtDataSource#region} + */ + readonly region?: string; + /** + * The type of the external data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#type DwsExtDataSource#type} + */ + readonly type: string; + /** + * The user name of the external data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#user_name DwsExtDataSource#user_name} + */ + readonly userName: string; + /** + * The password of the external data source. It is mandatory when **type** is **MRS**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#user_pwd DwsExtDataSource#user_pwd} + */ + readonly userPwd?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#timeouts DwsExtDataSource#timeouts} + */ + readonly timeouts?: DwsExtDataSourceTimeouts; +} +export interface DwsExtDataSourceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#create DwsExtDataSource#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#delete DwsExtDataSource#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#update DwsExtDataSource#update} + */ + readonly update?: string; +} + +export function dwsExtDataSourceTimeoutsToTerraform(struct?: DwsExtDataSourceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dwsExtDataSourceTimeoutsToHclTerraform(struct?: DwsExtDataSourceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsExtDataSourceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsExtDataSourceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsExtDataSourceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source huaweicloud_dws_ext_data_source} +*/ +export class DwsExtDataSource extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_ext_data_source"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsExtDataSource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsExtDataSource to import + * @param importFromId The id of the existing DwsExtDataSource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsExtDataSource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_ext_data_source", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_ext_data_source huaweicloud_dws_ext_data_source} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsExtDataSourceConfig + */ + public constructor(scope: Construct, id: string, config: DwsExtDataSourceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_ext_data_source', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._connectInfo = config.connectInfo; + this._dataSourceId = config.dataSourceId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._reboot = config.reboot; + this._region = config.region; + this._type = config.type; + this._userName = config.userName; + this._userPwd = config.userPwd; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // configure_status - computed: true, optional: false, required: false + public get configureStatus() { + return this.getStringAttribute('configure_status'); + } + + // connect_info - computed: true, optional: true, required: false + private _connectInfo?: string; + public get connectInfo() { + return this.getStringAttribute('connect_info'); + } + public set connectInfo(value: string) { + this._connectInfo = value; + } + public resetConnectInfo() { + this._connectInfo = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectInfoInput() { + return this._connectInfo; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_source_id - computed: true, optional: true, required: false + private _dataSourceId?: string; + public get dataSourceId() { + return this.getStringAttribute('data_source_id'); + } + public set dataSourceId(value: string) { + this._dataSourceId = value; + } + public resetDataSourceId() { + this._dataSourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataSourceIdInput() { + return this._dataSourceId; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // reboot - computed: false, optional: true, required: false + private _reboot?: boolean | cdktf.IResolvable; + public get reboot() { + return this.getBooleanAttribute('reboot'); + } + public set reboot(value: boolean | cdktf.IResolvable) { + this._reboot = value; + } + public resetReboot() { + this._reboot = undefined; + } + // Temporarily expose input value. Use with caution. + public get rebootInput() { + return this._reboot; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // user_pwd - computed: false, optional: true, required: false + private _userPwd?: string; + public get userPwd() { + return this.getStringAttribute('user_pwd'); + } + public set userPwd(value: string) { + this._userPwd = value; + } + public resetUserPwd() { + this._userPwd = undefined; + } + // Temporarily expose input value. Use with caution. + public get userPwdInput() { + return this._userPwd; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsExtDataSourceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsExtDataSourceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + connect_info: cdktf.stringToTerraform(this._connectInfo), + data_source_id: cdktf.stringToTerraform(this._dataSourceId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + reboot: cdktf.booleanToTerraform(this._reboot), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + user_name: cdktf.stringToTerraform(this._userName), + user_pwd: cdktf.stringToTerraform(this._userPwd), + timeouts: dwsExtDataSourceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connect_info: { + value: cdktf.stringToHclTerraform(this._connectInfo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source_id: { + value: cdktf.stringToHclTerraform(this._dataSourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reboot: { + value: cdktf.booleanToHclTerraform(this._reboot), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_pwd: { + value: cdktf.stringToHclTerraform(this._userPwd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dwsExtDataSourceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsExtDataSourceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-logical-cluster-restart/README.md b/src/constructs/providers/huaweicloud/dws-logical-cluster-restart/README.md new file mode 100644 index 00000000..940d69b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-logical-cluster-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_logical_cluster_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_logical_cluster_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart). diff --git a/src/constructs/providers/huaweicloud/dws-logical-cluster-restart/index.ts b/src/constructs/providers/huaweicloud/dws-logical-cluster-restart/index.ts new file mode 100644 index 00000000..cf518c0b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-logical-cluster-restart/index.ts @@ -0,0 +1,322 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsLogicalClusterRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the logical cluster belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#cluster_id DwsLogicalClusterRestart#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#id DwsLogicalClusterRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the logical cluster to be restarted. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#logical_cluster_id DwsLogicalClusterRestart#logical_cluster_id} + */ + readonly logicalClusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#region DwsLogicalClusterRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#timeouts DwsLogicalClusterRestart#timeouts} + */ + readonly timeouts?: DwsLogicalClusterRestartTimeouts; +} +export interface DwsLogicalClusterRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#create DwsLogicalClusterRestart#create} + */ + readonly create?: string; +} + +export function dwsLogicalClusterRestartTimeoutsToTerraform(struct?: DwsLogicalClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dwsLogicalClusterRestartTimeoutsToHclTerraform(struct?: DwsLogicalClusterRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsLogicalClusterRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsLogicalClusterRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsLogicalClusterRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart huaweicloud_dws_logical_cluster_restart} +*/ +export class DwsLogicalClusterRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_logical_cluster_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsLogicalClusterRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsLogicalClusterRestart to import + * @param importFromId The id of the existing DwsLogicalClusterRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsLogicalClusterRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_logical_cluster_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster_restart huaweicloud_dws_logical_cluster_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsLogicalClusterRestartConfig + */ + public constructor(scope: Construct, id: string, config: DwsLogicalClusterRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_logical_cluster_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._logicalClusterId = config.logicalClusterId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_cluster_id - computed: false, optional: false, required: true + private _logicalClusterId?: string; + public get logicalClusterId() { + return this.getStringAttribute('logical_cluster_id'); + } + public set logicalClusterId(value: string) { + this._logicalClusterId = value; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterIdInput() { + return this._logicalClusterId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsLogicalClusterRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsLogicalClusterRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + logical_cluster_id: cdktf.stringToTerraform(this._logicalClusterId), + region: cdktf.stringToTerraform(this._region), + timeouts: dwsLogicalClusterRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_id: { + value: cdktf.stringToHclTerraform(this._logicalClusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dwsLogicalClusterRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsLogicalClusterRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-logical-cluster/README.md b/src/constructs/providers/huaweicloud/dws-logical-cluster/README.md new file mode 100644 index 00000000..4c029d37 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-logical-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_logical_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_logical_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster). diff --git a/src/constructs/providers/huaweicloud/dws-logical-cluster/index.ts b/src/constructs/providers/huaweicloud/dws-logical-cluster/index.ts new file mode 100644 index 00000000..6257aee1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-logical-cluster/index.ts @@ -0,0 +1,765 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsLogicalClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#cluster_id DwsLogicalCluster#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#id DwsLogicalCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the logical cluster name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#logical_cluster_name DwsLogicalCluster#logical_cluster_name} + */ + readonly logicalClusterName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#region DwsLogicalCluster#region} + */ + readonly region?: string; + /** + * cluster_rings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#cluster_rings DwsLogicalCluster#cluster_rings} + */ + readonly clusterRings: DwsLogicalClusterClusterRings[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#timeouts DwsLogicalCluster#timeouts} + */ + readonly timeouts?: DwsLogicalClusterTimeouts; +} +export interface DwsLogicalClusterClusterRingsRingHosts { + /** + * Specifies the backend IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#back_ip DwsLogicalCluster#back_ip} + */ + readonly backIp: string; + /** + * Specifies the number of CPU cores. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#cpu_cores DwsLogicalCluster#cpu_cores} + */ + readonly cpuCores: number; + /** + * Specifies the host disk size. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#disk_size DwsLogicalCluster#disk_size} + */ + readonly diskSize: number; + /** + * Specifies the host name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#host_name DwsLogicalCluster#host_name} + */ + readonly hostName: string; + /** + * Specifies the host memory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#memory DwsLogicalCluster#memory} + */ + readonly memory: number; +} + +export function dwsLogicalClusterClusterRingsRingHostsToTerraform(struct?: DwsLogicalClusterClusterRingsRingHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + back_ip: cdktf.stringToTerraform(struct!.backIp), + cpu_cores: cdktf.numberToTerraform(struct!.cpuCores), + disk_size: cdktf.numberToTerraform(struct!.diskSize), + host_name: cdktf.stringToTerraform(struct!.hostName), + memory: cdktf.numberToTerraform(struct!.memory), + } +} + + +export function dwsLogicalClusterClusterRingsRingHostsToHclTerraform(struct?: DwsLogicalClusterClusterRingsRingHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + back_ip: { + value: cdktf.stringToHclTerraform(struct!.backIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_cores: { + value: cdktf.numberToHclTerraform(struct!.cpuCores), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + disk_size: { + value: cdktf.numberToHclTerraform(struct!.diskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + host_name: { + value: cdktf.stringToHclTerraform(struct!.hostName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory: { + value: cdktf.numberToHclTerraform(struct!.memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsLogicalClusterClusterRingsRingHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsLogicalClusterClusterRingsRingHosts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backIp !== undefined) { + hasAnyValues = true; + internalValueResult.backIp = this._backIp; + } + if (this._cpuCores !== undefined) { + hasAnyValues = true; + internalValueResult.cpuCores = this._cpuCores; + } + if (this._diskSize !== undefined) { + hasAnyValues = true; + internalValueResult.diskSize = this._diskSize; + } + if (this._hostName !== undefined) { + hasAnyValues = true; + internalValueResult.hostName = this._hostName; + } + if (this._memory !== undefined) { + hasAnyValues = true; + internalValueResult.memory = this._memory; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsLogicalClusterClusterRingsRingHosts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._backIp = undefined; + this._cpuCores = undefined; + this._diskSize = undefined; + this._hostName = undefined; + this._memory = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._backIp = value.backIp; + this._cpuCores = value.cpuCores; + this._diskSize = value.diskSize; + this._hostName = value.hostName; + this._memory = value.memory; + } + } + + // back_ip - computed: false, optional: false, required: true + private _backIp?: string; + public get backIp() { + return this.getStringAttribute('back_ip'); + } + public set backIp(value: string) { + this._backIp = value; + } + // Temporarily expose input value. Use with caution. + public get backIpInput() { + return this._backIp; + } + + // cpu_cores - computed: false, optional: false, required: true + private _cpuCores?: number; + public get cpuCores() { + return this.getNumberAttribute('cpu_cores'); + } + public set cpuCores(value: number) { + this._cpuCores = value; + } + // Temporarily expose input value. Use with caution. + public get cpuCoresInput() { + return this._cpuCores; + } + + // disk_size - computed: false, optional: false, required: true + private _diskSize?: number; + public get diskSize() { + return this.getNumberAttribute('disk_size'); + } + public set diskSize(value: number) { + this._diskSize = value; + } + // Temporarily expose input value. Use with caution. + public get diskSizeInput() { + return this._diskSize; + } + + // host_name - computed: false, optional: false, required: true + private _hostName?: string; + public get hostName() { + return this.getStringAttribute('host_name'); + } + public set hostName(value: string) { + this._hostName = value; + } + // Temporarily expose input value. Use with caution. + public get hostNameInput() { + return this._hostName; + } + + // memory - computed: false, optional: false, required: true + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } +} + +export class DwsLogicalClusterClusterRingsRingHostsList extends cdktf.ComplexList { + public internalValue? : DwsLogicalClusterClusterRingsRingHosts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsLogicalClusterClusterRingsRingHostsOutputReference { + return new DwsLogicalClusterClusterRingsRingHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsLogicalClusterClusterRings { + /** + * ring_hosts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#ring_hosts DwsLogicalCluster#ring_hosts} + */ + readonly ringHosts: DwsLogicalClusterClusterRingsRingHosts[] | cdktf.IResolvable; +} + +export function dwsLogicalClusterClusterRingsToTerraform(struct?: DwsLogicalClusterClusterRings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ring_hosts: cdktf.listMapper(dwsLogicalClusterClusterRingsRingHostsToTerraform, true)(struct!.ringHosts), + } +} + + +export function dwsLogicalClusterClusterRingsToHclTerraform(struct?: DwsLogicalClusterClusterRings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ring_hosts: { + value: cdktf.listMapperHcl(dwsLogicalClusterClusterRingsRingHostsToHclTerraform, true)(struct!.ringHosts), + isBlock: true, + type: "set", + storageClassType: "DwsLogicalClusterClusterRingsRingHostsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsLogicalClusterClusterRingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsLogicalClusterClusterRings | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ringHosts?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.ringHosts = this._ringHosts?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsLogicalClusterClusterRings | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ringHosts.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ringHosts.internalValue = value.ringHosts; + } + } + + // ring_hosts - computed: false, optional: false, required: true + private _ringHosts = new DwsLogicalClusterClusterRingsRingHostsList(this, "ring_hosts", true); + public get ringHosts() { + return this._ringHosts; + } + public putRingHosts(value: DwsLogicalClusterClusterRingsRingHosts[] | cdktf.IResolvable) { + this._ringHosts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get ringHostsInput() { + return this._ringHosts.internalValue; + } +} + +export class DwsLogicalClusterClusterRingsList extends cdktf.ComplexList { + public internalValue? : DwsLogicalClusterClusterRings[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsLogicalClusterClusterRingsOutputReference { + return new DwsLogicalClusterClusterRingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsLogicalClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#create DwsLogicalCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#delete DwsLogicalCluster#delete} + */ + readonly delete?: string; +} + +export function dwsLogicalClusterTimeoutsToTerraform(struct?: DwsLogicalClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function dwsLogicalClusterTimeoutsToHclTerraform(struct?: DwsLogicalClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsLogicalClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsLogicalClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsLogicalClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster huaweicloud_dws_logical_cluster} +*/ +export class DwsLogicalCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_logical_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsLogicalCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsLogicalCluster to import + * @param importFromId The id of the existing DwsLogicalCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsLogicalCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_logical_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_logical_cluster huaweicloud_dws_logical_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsLogicalClusterConfig + */ + public constructor(scope: Construct, id: string, config: DwsLogicalClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_logical_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._logicalClusterName = config.logicalClusterName; + this._region = config.region; + this._clusterRings.internalValue = config.clusterRings; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // delete_enable - computed: true, optional: false, required: false + public get deleteEnable() { + return this.getBooleanAttribute('delete_enable'); + } + + // edit_enable - computed: true, optional: false, required: false + public get editEnable() { + return this.getBooleanAttribute('edit_enable'); + } + + // first_logical_cluster - computed: true, optional: false, required: false + public get firstLogicalCluster() { + return this.getBooleanAttribute('first_logical_cluster'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_cluster_name - computed: false, optional: false, required: true + private _logicalClusterName?: string; + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + public set logicalClusterName(value: string) { + this._logicalClusterName = value; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterNameInput() { + return this._logicalClusterName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restart_enable - computed: true, optional: false, required: false + public get restartEnable() { + return this.getBooleanAttribute('restart_enable'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // cluster_rings - computed: false, optional: false, required: true + private _clusterRings = new DwsLogicalClusterClusterRingsList(this, "cluster_rings", true); + public get clusterRings() { + return this._clusterRings; + } + public putClusterRings(value: DwsLogicalClusterClusterRings[] | cdktf.IResolvable) { + this._clusterRings.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get clusterRingsInput() { + return this._clusterRings.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsLogicalClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsLogicalClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + logical_cluster_name: cdktf.stringToTerraform(this._logicalClusterName), + region: cdktf.stringToTerraform(this._region), + cluster_rings: cdktf.listMapper(dwsLogicalClusterClusterRingsToTerraform, true)(this._clusterRings.internalValue), + timeouts: dwsLogicalClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_name: { + value: cdktf.stringToHclTerraform(this._logicalClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_rings: { + value: cdktf.listMapperHcl(dwsLogicalClusterClusterRingsToHclTerraform, true)(this._clusterRings.internalValue), + isBlock: true, + type: "set", + storageClassType: "DwsLogicalClusterClusterRingsList", + }, + timeouts: { + value: dwsLogicalClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsLogicalClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-om-account-action/README.md b/src/constructs/providers/huaweicloud/dws-om-account-action/README.md new file mode 100644 index 00000000..60bef742 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-om-account-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_om_account_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_om_account_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action). diff --git a/src/constructs/providers/huaweicloud/dws-om-account-action/index.ts b/src/constructs/providers/huaweicloud/dws-om-account-action/index.ts new file mode 100644 index 00000000..531a2955 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-om-account-action/index.ts @@ -0,0 +1,198 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsOmAccountActionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action#cluster_id DwsOmAccountAction#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action#id DwsOmAccountAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the operation type of the OM account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action#operation DwsOmAccountAction#operation} + */ + readonly operation: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action#region DwsOmAccountAction#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action huaweicloud_dws_om_account_action} +*/ +export class DwsOmAccountAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_om_account_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsOmAccountAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsOmAccountAction to import + * @param importFromId The id of the existing DwsOmAccountAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsOmAccountAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_om_account_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_om_account_action huaweicloud_dws_om_account_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsOmAccountActionConfig + */ + public constructor(scope: Construct, id: string, config: DwsOmAccountActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_om_account_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._operation = config.operation; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // operation - computed: false, optional: false, required: true + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + operation: cdktf.stringToTerraform(this._operation), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation: { + value: cdktf.stringToHclTerraform(this._operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-parameter-configurations/README.md b/src/constructs/providers/huaweicloud/dws-parameter-configurations/README.md new file mode 100644 index 00000000..480ab5f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-parameter-configurations/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_parameter_configurations` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_parameter_configurations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations). diff --git a/src/constructs/providers/huaweicloud/dws-parameter-configurations/index.ts b/src/constructs/providers/huaweicloud/dws-parameter-configurations/index.ts new file mode 100644 index 00000000..50a80a84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-parameter-configurations/index.ts @@ -0,0 +1,534 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsParameterConfigurationsConfig extends cdktf.TerraformMetaArguments { + /** + * The DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#cluster_id DwsParameterConfigurations#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#id DwsParameterConfigurations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#region DwsParameterConfigurations#region} + */ + readonly region?: string; + /** + * configurations block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#configurations DwsParameterConfigurations#configurations} + */ + readonly configurations: DwsParameterConfigurationsConfigurations[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#timeouts DwsParameterConfigurations#timeouts} + */ + readonly timeouts?: DwsParameterConfigurationsTimeouts; +} +export interface DwsParameterConfigurationsConfigurations { + /** + * The name of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#name DwsParameterConfigurations#name} + */ + readonly name: string; + /** + * The type of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#type DwsParameterConfigurations#type} + */ + readonly type: string; + /** + * The value of the parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#value DwsParameterConfigurations#value} + */ + readonly value: string; +} + +export function dwsParameterConfigurationsConfigurationsToTerraform(struct?: DwsParameterConfigurationsConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function dwsParameterConfigurationsConfigurationsToHclTerraform(struct?: DwsParameterConfigurationsConfigurations | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsParameterConfigurationsConfigurationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsParameterConfigurationsConfigurations | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsParameterConfigurationsConfigurations | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class DwsParameterConfigurationsConfigurationsList extends cdktf.ComplexList { + public internalValue? : DwsParameterConfigurationsConfigurations[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsParameterConfigurationsConfigurationsOutputReference { + return new DwsParameterConfigurationsConfigurationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsParameterConfigurationsTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#create DwsParameterConfigurations#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#update DwsParameterConfigurations#update} + */ + readonly update?: string; +} + +export function dwsParameterConfigurationsTimeoutsToTerraform(struct?: DwsParameterConfigurationsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function dwsParameterConfigurationsTimeoutsToHclTerraform(struct?: DwsParameterConfigurationsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsParameterConfigurationsTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsParameterConfigurationsTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsParameterConfigurationsTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations huaweicloud_dws_parameter_configurations} +*/ +export class DwsParameterConfigurations extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_parameter_configurations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsParameterConfigurations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsParameterConfigurations to import + * @param importFromId The id of the existing DwsParameterConfigurations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsParameterConfigurations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_parameter_configurations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_parameter_configurations huaweicloud_dws_parameter_configurations} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsParameterConfigurationsConfig + */ + public constructor(scope: Construct, id: string, config: DwsParameterConfigurationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_parameter_configurations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._region = config.region; + this._configurations.internalValue = config.configurations; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // configurations - computed: false, optional: false, required: true + private _configurations = new DwsParameterConfigurationsConfigurationsList(this, "configurations", false); + public get configurations() { + return this._configurations; + } + public putConfigurations(value: DwsParameterConfigurationsConfigurations[] | cdktf.IResolvable) { + this._configurations.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configurationsInput() { + return this._configurations.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsParameterConfigurationsTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsParameterConfigurationsTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + configurations: cdktf.listMapper(dwsParameterConfigurationsConfigurationsToTerraform, true)(this._configurations.internalValue), + timeouts: dwsParameterConfigurationsTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configurations: { + value: cdktf.listMapperHcl(dwsParameterConfigurationsConfigurationsToHclTerraform, true)(this._configurations.internalValue), + isBlock: true, + type: "list", + storageClassType: "DwsParameterConfigurationsConfigurationsList", + }, + timeouts: { + value: dwsParameterConfigurationsTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsParameterConfigurationsTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-public-domain-associate/README.md b/src/constructs/providers/huaweicloud/dws-public-domain-associate/README.md new file mode 100644 index 00000000..f57f5b0c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-public-domain-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_public_domain_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_public_domain_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate). diff --git a/src/constructs/providers/huaweicloud/dws-public-domain-associate/index.ts b/src/constructs/providers/huaweicloud/dws-public-domain-associate/index.ts new file mode 100644 index 00000000..341c870b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-public-domain-associate/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsPublicDomainAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID to which the public domain name to be associated belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate#cluster_id DwsPublicDomainAssociate#cluster_id} + */ + readonly clusterId: string; + /** + * Specifies the public domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate#domain_name DwsPublicDomainAssociate#domain_name} + */ + readonly domainName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate#id DwsPublicDomainAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate#region DwsPublicDomainAssociate#region} + */ + readonly region?: string; + /** + * Specifies cache period of the SOA record set, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate#ttl DwsPublicDomainAssociate#ttl} + */ + readonly ttl?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate huaweicloud_dws_public_domain_associate} +*/ +export class DwsPublicDomainAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_public_domain_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsPublicDomainAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsPublicDomainAssociate to import + * @param importFromId The id of the existing DwsPublicDomainAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsPublicDomainAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_public_domain_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_public_domain_associate huaweicloud_dws_public_domain_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsPublicDomainAssociateConfig + */ + public constructor(scope: Construct, id: string, config: DwsPublicDomainAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_public_domain_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._domainName = config.domainName; + this._id = config.id; + this._region = config.region; + this._ttl = config.ttl; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: number; + public get ttl() { + return this.getNumberAttribute('ttl'); + } + public set ttl(value: number) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + domain_name: cdktf.stringToTerraform(this._domainName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + ttl: cdktf.numberToTerraform(this._ttl), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ttl: { + value: cdktf.numberToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-snapshot-copy/README.md b/src/constructs/providers/huaweicloud/dws-snapshot-copy/README.md new file mode 100644 index 00000000..5eb49e0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-snapshot-copy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_snapshot_copy` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_snapshot_copy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy). diff --git a/src/constructs/providers/huaweicloud/dws-snapshot-copy/index.ts b/src/constructs/providers/huaweicloud/dws-snapshot-copy/index.ts new file mode 100644 index 00000000..a325fd8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-snapshot-copy/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsSnapshotCopyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the copy snapshot. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy#description DwsSnapshotCopy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy#id DwsSnapshotCopy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the copy snapshot. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy#name DwsSnapshotCopy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy#region DwsSnapshotCopy#region} + */ + readonly region?: string; + /** + * Specifies the ID of the automated snapshot to be copied. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy#snapshot_id DwsSnapshotCopy#snapshot_id} + */ + readonly snapshotId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy huaweicloud_dws_snapshot_copy} +*/ +export class DwsSnapshotCopy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_snapshot_copy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsSnapshotCopy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsSnapshotCopy to import + * @param importFromId The id of the existing DwsSnapshotCopy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsSnapshotCopy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_snapshot_copy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_copy huaweicloud_dws_snapshot_copy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsSnapshotCopyConfig + */ + public constructor(scope: Construct, id: string, config: DwsSnapshotCopyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_snapshot_copy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._snapshotId = config.snapshotId; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // snapshot_id - computed: false, optional: false, required: true + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-snapshot-policy/README.md b/src/constructs/providers/huaweicloud/dws-snapshot-policy/README.md new file mode 100644 index 00000000..35e18a80 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-snapshot-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_snapshot_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_snapshot_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy). diff --git a/src/constructs/providers/huaweicloud/dws-snapshot-policy/index.ts b/src/constructs/providers/huaweicloud/dws-snapshot-policy/index.ts new file mode 100644 index 00000000..9eaa864b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-snapshot-policy/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsSnapshotPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The cluster ID of which the automated snapshot policy belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#cluster_id DwsSnapshotPolicy#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#id DwsSnapshotPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the automated snapshot policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#name DwsSnapshotPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#region DwsSnapshotPolicy#region} + */ + readonly region?: string; + /** + * The strategy of the automated snapshot policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#strategy DwsSnapshotPolicy#strategy} + */ + readonly strategy: string; + /** + * The type of the automated snapshot policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#type DwsSnapshotPolicy#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy huaweicloud_dws_snapshot_policy} +*/ +export class DwsSnapshotPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_snapshot_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsSnapshotPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsSnapshotPolicy to import + * @param importFromId The id of the existing DwsSnapshotPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsSnapshotPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_snapshot_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot_policy huaweicloud_dws_snapshot_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsSnapshotPolicyConfig + */ + public constructor(scope: Construct, id: string, config: DwsSnapshotPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_snapshot_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._strategy = config.strategy; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // strategy - computed: false, optional: false, required: true + private _strategy?: string; + public get strategy() { + return this.getStringAttribute('strategy'); + } + public set strategy(value: string) { + this._strategy = value; + } + // Temporarily expose input value. Use with caution. + public get strategyInput() { + return this._strategy; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + strategy: cdktf.stringToTerraform(this._strategy), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + strategy: { + value: cdktf.stringToHclTerraform(this._strategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-snapshot/README.md b/src/constructs/providers/huaweicloud/dws-snapshot/README.md new file mode 100644 index 00000000..97daf88b --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-snapshot/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_snapshot` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_snapshot`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot). diff --git a/src/constructs/providers/huaweicloud/dws-snapshot/index.ts b/src/constructs/providers/huaweicloud/dws-snapshot/index.ts new file mode 100644 index 00000000..8c2bcbcb --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-snapshot/index.ts @@ -0,0 +1,377 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsSnapshotConfig extends cdktf.TerraformMetaArguments { + /** + * ID of the cluster for which you want to create a snapshot. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#cluster_id DwsSnapshot#cluster_id} + */ + readonly clusterId: string; + /** + * Snapshot description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#description DwsSnapshot#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#id DwsSnapshot#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Snapshot name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#name DwsSnapshot#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#region DwsSnapshot#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#timeouts DwsSnapshot#timeouts} + */ + readonly timeouts?: DwsSnapshotTimeouts; +} +export interface DwsSnapshotTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#create DwsSnapshot#create} + */ + readonly create?: string; +} + +export function dwsSnapshotTimeoutsToTerraform(struct?: DwsSnapshotTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function dwsSnapshotTimeoutsToHclTerraform(struct?: DwsSnapshotTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsSnapshotTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): DwsSnapshotTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsSnapshotTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot huaweicloud_dws_snapshot} +*/ +export class DwsSnapshot extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_snapshot"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsSnapshot resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsSnapshot to import + * @param importFromId The id of the existing DwsSnapshot that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsSnapshot to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_snapshot", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_snapshot huaweicloud_dws_snapshot} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsSnapshotConfig + */ + public constructor(scope: Construct, id: string, config: DwsSnapshotConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_snapshot', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // finished_at - computed: true, optional: false, required: false + public get finishedAt() { + return this.getStringAttribute('finished_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // started_at - computed: true, optional: false, required: false + public get startedAt() { + return this.getStringAttribute('started_at'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new DwsSnapshotTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: DwsSnapshotTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: dwsSnapshotTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: dwsSnapshotTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "DwsSnapshotTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-workload-configuration/README.md b/src/constructs/providers/huaweicloud/dws-workload-configuration/README.md new file mode 100644 index 00000000..637f4ced --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_workload_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_workload_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration). diff --git a/src/constructs/providers/huaweicloud/dws-workload-configuration/index.ts b/src/constructs/providers/huaweicloud/dws-workload-configuration/index.ts new file mode 100644 index 00000000..d037d8a1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-configuration/index.ts @@ -0,0 +1,228 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsWorkloadConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration#cluster_id DwsWorkloadConfiguration#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration#id DwsWorkloadConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the maximum number of concurrent tasks on a single CN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration#max_concurrency_num DwsWorkloadConfiguration#max_concurrency_num} + */ + readonly maxConcurrencyNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration#region DwsWorkloadConfiguration#region} + */ + readonly region?: string; + /** + * Specifies the workload management switch. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration#workload_switch DwsWorkloadConfiguration#workload_switch} + */ + readonly workloadSwitch: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration huaweicloud_dws_workload_configuration} +*/ +export class DwsWorkloadConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsWorkloadConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsWorkloadConfiguration to import + * @param importFromId The id of the existing DwsWorkloadConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsWorkloadConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_configuration huaweicloud_dws_workload_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsWorkloadConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: DwsWorkloadConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._maxConcurrencyNum = config.maxConcurrencyNum; + this._region = config.region; + this._workloadSwitch = config.workloadSwitch; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_concurrency_num - computed: true, optional: true, required: false + private _maxConcurrencyNum?: string; + public get maxConcurrencyNum() { + return this.getStringAttribute('max_concurrency_num'); + } + public set maxConcurrencyNum(value: string) { + this._maxConcurrencyNum = value; + } + public resetMaxConcurrencyNum() { + this._maxConcurrencyNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConcurrencyNumInput() { + return this._maxConcurrencyNum; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workload_switch - computed: false, optional: false, required: true + private _workloadSwitch?: string; + public get workloadSwitch() { + return this.getStringAttribute('workload_switch'); + } + public set workloadSwitch(value: string) { + this._workloadSwitch = value; + } + // Temporarily expose input value. Use with caution. + public get workloadSwitchInput() { + return this._workloadSwitch; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + max_concurrency_num: cdktf.stringToTerraform(this._maxConcurrencyNum), + region: cdktf.stringToTerraform(this._region), + workload_switch: cdktf.stringToTerraform(this._workloadSwitch), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_concurrency_num: { + value: cdktf.stringToHclTerraform(this._maxConcurrencyNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workload_switch: { + value: cdktf.stringToHclTerraform(this._workloadSwitch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-workload-plan-execution/README.md b/src/constructs/providers/huaweicloud/dws-workload-plan-execution/README.md new file mode 100644 index 00000000..ab15a443 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-plan-execution/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_workload_plan_execution` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_workload_plan_execution`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution). diff --git a/src/constructs/providers/huaweicloud/dws-workload-plan-execution/index.ts b/src/constructs/providers/huaweicloud/dws-workload-plan-execution/index.ts new file mode 100644 index 00000000..9510ac7f --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-plan-execution/index.ts @@ -0,0 +1,222 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsWorkloadPlanExecutionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution#cluster_id DwsWorkloadPlanExecution#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution#id DwsWorkloadPlanExecution#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution#plan_id DwsWorkloadPlanExecution#plan_id} + */ + readonly planId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution#region DwsWorkloadPlanExecution#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution#stage_id DwsWorkloadPlanExecution#stage_id} + */ + readonly stageId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution huaweicloud_dws_workload_plan_execution} +*/ +export class DwsWorkloadPlanExecution extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_plan_execution"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsWorkloadPlanExecution resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsWorkloadPlanExecution to import + * @param importFromId The id of the existing DwsWorkloadPlanExecution that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsWorkloadPlanExecution to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_plan_execution", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_execution huaweicloud_dws_workload_plan_execution} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsWorkloadPlanExecutionConfig + */ + public constructor(scope: Construct, id: string, config: DwsWorkloadPlanExecutionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_plan_execution', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._planId = config.planId; + this._region = config.region; + this._stageId = config.stageId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // plan_id - computed: false, optional: false, required: true + private _planId?: string; + public get planId() { + return this.getStringAttribute('plan_id'); + } + public set planId(value: string) { + this._planId = value; + } + // Temporarily expose input value. Use with caution. + public get planIdInput() { + return this._planId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stage_id - computed: false, optional: true, required: false + private _stageId?: string; + public get stageId() { + return this.getStringAttribute('stage_id'); + } + public set stageId(value: string) { + this._stageId = value; + } + public resetStageId() { + this._stageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get stageIdInput() { + return this._stageId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + plan_id: cdktf.stringToTerraform(this._planId), + region: cdktf.stringToTerraform(this._region), + stage_id: cdktf.stringToTerraform(this._stageId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + plan_id: { + value: cdktf.stringToHclTerraform(this._planId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stage_id: { + value: cdktf.stringToHclTerraform(this._stageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-workload-plan-stage/README.md b/src/constructs/providers/huaweicloud/dws-workload-plan-stage/README.md new file mode 100644 index 00000000..9f161745 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-plan-stage/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_workload_plan_stage` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_workload_plan_stage`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage). diff --git a/src/constructs/providers/huaweicloud/dws-workload-plan-stage/index.ts b/src/constructs/providers/huaweicloud/dws-workload-plan-stage/index.ts new file mode 100644 index 00000000..f8865f86 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-plan-stage/index.ts @@ -0,0 +1,706 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsWorkloadPlanStageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#cluster_id DwsWorkloadPlanStage#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#day DwsWorkloadPlanStage#day} + */ + readonly day?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#end_time DwsWorkloadPlanStage#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#id DwsWorkloadPlanStage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#month DwsWorkloadPlanStage#month} + */ + readonly month?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#name DwsWorkloadPlanStage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#plan_id DwsWorkloadPlanStage#plan_id} + */ + readonly planId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#region DwsWorkloadPlanStage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#start_time DwsWorkloadPlanStage#start_time} + */ + readonly startTime: string; + /** + * queues block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#queues DwsWorkloadPlanStage#queues} + */ + readonly queues: DwsWorkloadPlanStageQueues[] | cdktf.IResolvable; +} +export interface DwsWorkloadPlanStageQueuesConfiguration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#resource_description DwsWorkloadPlanStage#resource_description} + */ + readonly resourceDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#resource_name DwsWorkloadPlanStage#resource_name} + */ + readonly resourceName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#resource_value DwsWorkloadPlanStage#resource_value} + */ + readonly resourceValue: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#value_unit DwsWorkloadPlanStage#value_unit} + */ + readonly valueUnit?: string; +} + +export function dwsWorkloadPlanStageQueuesConfigurationToTerraform(struct?: DwsWorkloadPlanStageQueuesConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_description: cdktf.stringToTerraform(struct!.resourceDescription), + resource_name: cdktf.stringToTerraform(struct!.resourceName), + resource_value: cdktf.numberToTerraform(struct!.resourceValue), + value_unit: cdktf.stringToTerraform(struct!.valueUnit), + } +} + + +export function dwsWorkloadPlanStageQueuesConfigurationToHclTerraform(struct?: DwsWorkloadPlanStageQueuesConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_description: { + value: cdktf.stringToHclTerraform(struct!.resourceDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_name: { + value: cdktf.stringToHclTerraform(struct!.resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_value: { + value: cdktf.numberToHclTerraform(struct!.resourceValue), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + value_unit: { + value: cdktf.stringToHclTerraform(struct!.valueUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsWorkloadPlanStageQueuesConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsWorkloadPlanStageQueuesConfiguration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceDescription !== undefined) { + hasAnyValues = true; + internalValueResult.resourceDescription = this._resourceDescription; + } + if (this._resourceName !== undefined) { + hasAnyValues = true; + internalValueResult.resourceName = this._resourceName; + } + if (this._resourceValue !== undefined) { + hasAnyValues = true; + internalValueResult.resourceValue = this._resourceValue; + } + if (this._valueUnit !== undefined) { + hasAnyValues = true; + internalValueResult.valueUnit = this._valueUnit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsWorkloadPlanStageQueuesConfiguration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._resourceDescription = undefined; + this._resourceName = undefined; + this._resourceValue = undefined; + this._valueUnit = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._resourceDescription = value.resourceDescription; + this._resourceName = value.resourceName; + this._resourceValue = value.resourceValue; + this._valueUnit = value.valueUnit; + } + } + + // resource_description - computed: false, optional: true, required: false + private _resourceDescription?: string; + public get resourceDescription() { + return this.getStringAttribute('resource_description'); + } + public set resourceDescription(value: string) { + this._resourceDescription = value; + } + public resetResourceDescription() { + this._resourceDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceDescriptionInput() { + return this._resourceDescription; + } + + // resource_name - computed: false, optional: false, required: true + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // resource_value - computed: false, optional: false, required: true + private _resourceValue?: number; + public get resourceValue() { + return this.getNumberAttribute('resource_value'); + } + public set resourceValue(value: number) { + this._resourceValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourceValueInput() { + return this._resourceValue; + } + + // value_unit - computed: false, optional: true, required: false + private _valueUnit?: string; + public get valueUnit() { + return this.getStringAttribute('value_unit'); + } + public set valueUnit(value: string) { + this._valueUnit = value; + } + public resetValueUnit() { + this._valueUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueUnitInput() { + return this._valueUnit; + } +} + +export class DwsWorkloadPlanStageQueuesConfigurationList extends cdktf.ComplexList { + public internalValue? : DwsWorkloadPlanStageQueuesConfiguration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsWorkloadPlanStageQueuesConfigurationOutputReference { + return new DwsWorkloadPlanStageQueuesConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface DwsWorkloadPlanStageQueues { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#name DwsWorkloadPlanStage#name} + */ + readonly name: string; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#configuration DwsWorkloadPlanStage#configuration} + */ + readonly configuration: DwsWorkloadPlanStageQueuesConfiguration[] | cdktf.IResolvable; +} + +export function dwsWorkloadPlanStageQueuesToTerraform(struct?: DwsWorkloadPlanStageQueues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + configuration: cdktf.listMapper(dwsWorkloadPlanStageQueuesConfigurationToTerraform, true)(struct!.configuration), + } +} + + +export function dwsWorkloadPlanStageQueuesToHclTerraform(struct?: DwsWorkloadPlanStageQueues | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration: { + value: cdktf.listMapperHcl(dwsWorkloadPlanStageQueuesConfigurationToHclTerraform, true)(struct!.configuration), + isBlock: true, + type: "set", + storageClassType: "DwsWorkloadPlanStageQueuesConfigurationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsWorkloadPlanStageQueuesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsWorkloadPlanStageQueues | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._configuration?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configuration = this._configuration?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsWorkloadPlanStageQueues | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._configuration.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._configuration.internalValue = value.configuration; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // configuration - computed: false, optional: false, required: true + private _configuration = new DwsWorkloadPlanStageQueuesConfigurationList(this, "configuration", true); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: DwsWorkloadPlanStageQueuesConfiguration[] | cdktf.IResolvable) { + this._configuration.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } +} + +export class DwsWorkloadPlanStageQueuesList extends cdktf.ComplexList { + public internalValue? : DwsWorkloadPlanStageQueues[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsWorkloadPlanStageQueuesOutputReference { + return new DwsWorkloadPlanStageQueuesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage huaweicloud_dws_workload_plan_stage} +*/ +export class DwsWorkloadPlanStage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_plan_stage"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsWorkloadPlanStage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsWorkloadPlanStage to import + * @param importFromId The id of the existing DwsWorkloadPlanStage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsWorkloadPlanStage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_plan_stage", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan_stage huaweicloud_dws_workload_plan_stage} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsWorkloadPlanStageConfig + */ + public constructor(scope: Construct, id: string, config: DwsWorkloadPlanStageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_plan_stage', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._day = config.day; + this._endTime = config.endTime; + this._id = config.id; + this._month = config.month; + this._name = config.name; + this._planId = config.planId; + this._region = config.region; + this._startTime = config.startTime; + this._queues.internalValue = config.queues; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // day - computed: true, optional: true, required: false + private _day?: string; + public get day() { + return this.getStringAttribute('day'); + } + public set day(value: string) { + this._day = value; + } + public resetDay() { + this._day = undefined; + } + // Temporarily expose input value. Use with caution. + public get dayInput() { + return this._day; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // month - computed: true, optional: true, required: false + private _month?: string; + public get month() { + return this.getStringAttribute('month'); + } + public set month(value: string) { + this._month = value; + } + public resetMonth() { + this._month = undefined; + } + // Temporarily expose input value. Use with caution. + public get monthInput() { + return this._month; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // plan_id - computed: false, optional: false, required: true + private _planId?: string; + public get planId() { + return this.getStringAttribute('plan_id'); + } + public set planId(value: string) { + this._planId = value; + } + // Temporarily expose input value. Use with caution. + public get planIdInput() { + return this._planId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // queues - computed: false, optional: false, required: true + private _queues = new DwsWorkloadPlanStageQueuesList(this, "queues", false); + public get queues() { + return this._queues; + } + public putQueues(value: DwsWorkloadPlanStageQueues[] | cdktf.IResolvable) { + this._queues.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get queuesInput() { + return this._queues.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + day: cdktf.stringToTerraform(this._day), + end_time: cdktf.stringToTerraform(this._endTime), + id: cdktf.stringToTerraform(this._id), + month: cdktf.stringToTerraform(this._month), + name: cdktf.stringToTerraform(this._name), + plan_id: cdktf.stringToTerraform(this._planId), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + queues: cdktf.listMapper(dwsWorkloadPlanStageQueuesToTerraform, true)(this._queues.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + day: { + value: cdktf.stringToHclTerraform(this._day), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + month: { + value: cdktf.stringToHclTerraform(this._month), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + plan_id: { + value: cdktf.stringToHclTerraform(this._planId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queues: { + value: cdktf.listMapperHcl(dwsWorkloadPlanStageQueuesToHclTerraform, true)(this._queues.internalValue), + isBlock: true, + type: "list", + storageClassType: "DwsWorkloadPlanStageQueuesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-workload-plan/README.md b/src/constructs/providers/huaweicloud/dws-workload-plan/README.md new file mode 100644 index 00000000..4bbcfecc --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-plan/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_workload_plan` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_workload_plan`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan). diff --git a/src/constructs/providers/huaweicloud/dws-workload-plan/index.ts b/src/constructs/providers/huaweicloud/dws-workload-plan/index.ts new file mode 100644 index 00000000..c2568c25 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-plan/index.ts @@ -0,0 +1,318 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsWorkloadPlanConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan#cluster_id DwsWorkloadPlan#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan#id DwsWorkloadPlan#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan#logical_cluster_name DwsWorkloadPlan#logical_cluster_name} + */ + readonly logicalClusterName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan#name DwsWorkloadPlan#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan#region DwsWorkloadPlan#region} + */ + readonly region?: string; +} +export interface DwsWorkloadPlanStages { +} + +export function dwsWorkloadPlanStagesToTerraform(struct?: DwsWorkloadPlanStages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function dwsWorkloadPlanStagesToHclTerraform(struct?: DwsWorkloadPlanStages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class DwsWorkloadPlanStagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsWorkloadPlanStages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsWorkloadPlanStages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class DwsWorkloadPlanStagesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsWorkloadPlanStagesOutputReference { + return new DwsWorkloadPlanStagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan huaweicloud_dws_workload_plan} +*/ +export class DwsWorkloadPlan extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_plan"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsWorkloadPlan resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsWorkloadPlan to import + * @param importFromId The id of the existing DwsWorkloadPlan that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsWorkloadPlan to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_plan", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_plan huaweicloud_dws_workload_plan} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsWorkloadPlanConfig + */ + public constructor(scope: Construct, id: string, config: DwsWorkloadPlanConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_plan', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._logicalClusterName = config.logicalClusterName; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // current_stage_name - computed: true, optional: false, required: false + public get currentStageName() { + return this.getStringAttribute('current_stage_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_cluster_name - computed: false, optional: true, required: false + private _logicalClusterName?: string; + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + public set logicalClusterName(value: string) { + this._logicalClusterName = value; + } + public resetLogicalClusterName() { + this._logicalClusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterNameInput() { + return this._logicalClusterName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stages - computed: true, optional: false, required: false + private _stages = new DwsWorkloadPlanStagesList(this, "stages", false); + public get stages() { + return this._stages; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + logical_cluster_name: cdktf.stringToTerraform(this._logicalClusterName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_name: { + value: cdktf.stringToHclTerraform(this._logicalClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/README.md b/src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/README.md new file mode 100644 index 00000000..e3a12d13 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_workload_queue_user_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_workload_queue_user_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate). diff --git a/src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/index.ts b/src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/index.ts new file mode 100644 index 00000000..ec4f45ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-queue-user-associate/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsWorkloadQueueUserAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DWS cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate#cluster_id DwsWorkloadQueueUserAssociate#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate#id DwsWorkloadQueueUserAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the workload queue name to associate with the users. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate#queue_name DwsWorkloadQueueUserAssociate#queue_name} + */ + readonly queueName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate#region DwsWorkloadQueueUserAssociate#region} + */ + readonly region?: string; + /** + * Specifies the user names bound to the workload queue. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate#user_names DwsWorkloadQueueUserAssociate#user_names} + */ + readonly userNames: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate huaweicloud_dws_workload_queue_user_associate} +*/ +export class DwsWorkloadQueueUserAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_queue_user_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsWorkloadQueueUserAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsWorkloadQueueUserAssociate to import + * @param importFromId The id of the existing DwsWorkloadQueueUserAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsWorkloadQueueUserAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_queue_user_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue_user_associate huaweicloud_dws_workload_queue_user_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsWorkloadQueueUserAssociateConfig + */ + public constructor(scope: Construct, id: string, config: DwsWorkloadQueueUserAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_queue_user_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._queueName = config.queueName; + this._region = config.region; + this._userNames = config.userNames; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // queue_name - computed: false, optional: false, required: true + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_names - computed: false, optional: false, required: true + private _userNames?: string[]; + public get userNames() { + return cdktf.Fn.tolist(this.getListAttribute('user_names')); + } + public set userNames(value: string[]) { + this._userNames = value; + } + // Temporarily expose input value. Use with caution. + public get userNamesInput() { + return this._userNames; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + queue_name: cdktf.stringToTerraform(this._queueName), + region: cdktf.stringToTerraform(this._region), + user_names: cdktf.listMapper(cdktf.stringToTerraform, false)(this._userNames), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(this._queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._userNames), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/dws-workload-queue/README.md b/src/constructs/providers/huaweicloud/dws-workload-queue/README.md new file mode 100644 index 00000000..e085b261 --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-queue/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_dws_workload_queue` + +Refer to the Terraform Registry for docs: [`huaweicloud_dws_workload_queue`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue). diff --git a/src/constructs/providers/huaweicloud/dws-workload-queue/index.ts b/src/constructs/providers/huaweicloud/dws-workload-queue/index.ts new file mode 100644 index 00000000..78e7006c --- /dev/null +++ b/src/constructs/providers/huaweicloud/dws-workload-queue/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface DwsWorkloadQueueConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#cluster_id DwsWorkloadQueue#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#id DwsWorkloadQueue#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#logical_cluster_name DwsWorkloadQueue#logical_cluster_name} + */ + readonly logicalClusterName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#name DwsWorkloadQueue#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#region DwsWorkloadQueue#region} + */ + readonly region?: string; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#configuration DwsWorkloadQueue#configuration} + */ + readonly configuration: DwsWorkloadQueueConfiguration[] | cdktf.IResolvable; +} +export interface DwsWorkloadQueueConfiguration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#resource_name DwsWorkloadQueue#resource_name} + */ + readonly resourceName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#resource_value DwsWorkloadQueue#resource_value} + */ + readonly resourceValue: number; +} + +export function dwsWorkloadQueueConfigurationToTerraform(struct?: DwsWorkloadQueueConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_name: cdktf.stringToTerraform(struct!.resourceName), + resource_value: cdktf.numberToTerraform(struct!.resourceValue), + } +} + + +export function dwsWorkloadQueueConfigurationToHclTerraform(struct?: DwsWorkloadQueueConfiguration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_name: { + value: cdktf.stringToHclTerraform(struct!.resourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_value: { + value: cdktf.numberToHclTerraform(struct!.resourceValue), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class DwsWorkloadQueueConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): DwsWorkloadQueueConfiguration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceName !== undefined) { + hasAnyValues = true; + internalValueResult.resourceName = this._resourceName; + } + if (this._resourceValue !== undefined) { + hasAnyValues = true; + internalValueResult.resourceValue = this._resourceValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: DwsWorkloadQueueConfiguration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._resourceName = undefined; + this._resourceValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._resourceName = value.resourceName; + this._resourceValue = value.resourceValue; + } + } + + // resource_name - computed: false, optional: false, required: true + private _resourceName?: string; + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + public set resourceName(value: string) { + this._resourceName = value; + } + // Temporarily expose input value. Use with caution. + public get resourceNameInput() { + return this._resourceName; + } + + // resource_value - computed: false, optional: false, required: true + private _resourceValue?: number; + public get resourceValue() { + return this.getNumberAttribute('resource_value'); + } + public set resourceValue(value: number) { + this._resourceValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourceValueInput() { + return this._resourceValue; + } +} + +export class DwsWorkloadQueueConfigurationList extends cdktf.ComplexList { + public internalValue? : DwsWorkloadQueueConfiguration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): DwsWorkloadQueueConfigurationOutputReference { + return new DwsWorkloadQueueConfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue huaweicloud_dws_workload_queue} +*/ +export class DwsWorkloadQueue extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_dws_workload_queue"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a DwsWorkloadQueue resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the DwsWorkloadQueue to import + * @param importFromId The id of the existing DwsWorkloadQueue that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the DwsWorkloadQueue to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_dws_workload_queue", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/dws_workload_queue huaweicloud_dws_workload_queue} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options DwsWorkloadQueueConfig + */ + public constructor(scope: Construct, id: string, config: DwsWorkloadQueueConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_dws_workload_queue', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._logicalClusterName = config.logicalClusterName; + this._name = config.name; + this._region = config.region; + this._configuration.internalValue = config.configuration; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logical_cluster_name - computed: false, optional: true, required: false + private _logicalClusterName?: string; + public get logicalClusterName() { + return this.getStringAttribute('logical_cluster_name'); + } + public set logicalClusterName(value: string) { + this._logicalClusterName = value; + } + public resetLogicalClusterName() { + this._logicalClusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicalClusterNameInput() { + return this._logicalClusterName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // configuration - computed: false, optional: false, required: true + private _configuration = new DwsWorkloadQueueConfigurationList(this, "configuration", true); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: DwsWorkloadQueueConfiguration[] | cdktf.IResolvable) { + this._configuration.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + logical_cluster_name: cdktf.stringToTerraform(this._logicalClusterName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + configuration: cdktf.listMapper(dwsWorkloadQueueConfigurationToTerraform, true)(this._configuration.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logical_cluster_name: { + value: cdktf.stringToHclTerraform(this._logicalClusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration: { + value: cdktf.listMapperHcl(dwsWorkloadQueueConfigurationToHclTerraform, true)(this._configuration.internalValue), + isBlock: true, + type: "set", + storageClassType: "DwsWorkloadQueueConfigurationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ecs-instance-v1/README.md b/src/constructs/providers/huaweicloud/ecs-instance-v1/README.md new file mode 100644 index 00000000..9e806019 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ecs-instance-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ecs_instance_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_ecs_instance_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1). diff --git a/src/constructs/providers/huaweicloud/ecs-instance-v1/index.ts b/src/constructs/providers/huaweicloud/ecs-instance-v1/index.ts new file mode 100644 index 00000000..0851de0d --- /dev/null +++ b/src/constructs/providers/huaweicloud/ecs-instance-v1/index.ts @@ -0,0 +1,1240 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EcsInstanceV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#auto_recovery EcsInstanceV1#auto_recovery} + */ + readonly autoRecovery?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#auto_renew EcsInstanceV1#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#availability_zone EcsInstanceV1#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#charging_mode EcsInstanceV1#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#delete_disks_on_termination EcsInstanceV1#delete_disks_on_termination} + */ + readonly deleteDisksOnTermination?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#enterprise_project_id EcsInstanceV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#flavor EcsInstanceV1#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#id EcsInstanceV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#image_id EcsInstanceV1#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#key_name EcsInstanceV1#key_name} + */ + readonly keyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#name EcsInstanceV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#op_svc_userid EcsInstanceV1#op_svc_userid} + */ + readonly opSvcUserid?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#password EcsInstanceV1#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#period EcsInstanceV1#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#period_unit EcsInstanceV1#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#security_groups EcsInstanceV1#security_groups} + */ + readonly securityGroups?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#system_disk_size EcsInstanceV1#system_disk_size} + */ + readonly systemDiskSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#system_disk_type EcsInstanceV1#system_disk_type} + */ + readonly systemDiskType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#tags EcsInstanceV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#user_data EcsInstanceV1#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#vpc_id EcsInstanceV1#vpc_id} + */ + readonly vpcId: string; + /** + * data_disks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#data_disks EcsInstanceV1#data_disks} + */ + readonly dataDisks?: EcsInstanceV1DataDisks[] | cdktf.IResolvable; + /** + * nics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#nics EcsInstanceV1#nics} + */ + readonly nics: EcsInstanceV1Nics[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#timeouts EcsInstanceV1#timeouts} + */ + readonly timeouts?: EcsInstanceV1Timeouts; +} +export interface EcsInstanceV1DataDisks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#size EcsInstanceV1#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#snapshot_id EcsInstanceV1#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#type EcsInstanceV1#type} + */ + readonly type: string; +} + +export function ecsInstanceV1DataDisksToTerraform(struct?: EcsInstanceV1DataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + snapshot_id: cdktf.stringToTerraform(struct!.snapshotId), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ecsInstanceV1DataDisksToHclTerraform(struct?: EcsInstanceV1DataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(struct!.snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EcsInstanceV1DataDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): EcsInstanceV1DataDisks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._snapshotId !== undefined) { + hasAnyValues = true; + internalValueResult.snapshotId = this._snapshotId; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EcsInstanceV1DataDisks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._size = undefined; + this._snapshotId = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._size = value.size; + this._snapshotId = value.snapshotId; + this._type = value.type; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: false, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class EcsInstanceV1DataDisksList extends cdktf.ComplexList { + public internalValue? : EcsInstanceV1DataDisks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): EcsInstanceV1DataDisksOutputReference { + return new EcsInstanceV1DataDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface EcsInstanceV1Nics { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#ip_address EcsInstanceV1#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#network_id EcsInstanceV1#network_id} + */ + readonly networkId: string; +} + +export function ecsInstanceV1NicsToTerraform(struct?: EcsInstanceV1Nics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + network_id: cdktf.stringToTerraform(struct!.networkId), + } +} + + +export function ecsInstanceV1NicsToHclTerraform(struct?: EcsInstanceV1Nics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(struct!.networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EcsInstanceV1NicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): EcsInstanceV1Nics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._networkId !== undefined) { + hasAnyValues = true; + internalValueResult.networkId = this._networkId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EcsInstanceV1Nics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._networkId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._networkId = value.networkId; + } + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } +} + +export class EcsInstanceV1NicsList extends cdktf.ComplexList { + public internalValue? : EcsInstanceV1Nics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): EcsInstanceV1NicsOutputReference { + return new EcsInstanceV1NicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface EcsInstanceV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#create EcsInstanceV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#delete EcsInstanceV1#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#update EcsInstanceV1#update} + */ + readonly update?: string; +} + +export function ecsInstanceV1TimeoutsToTerraform(struct?: EcsInstanceV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ecsInstanceV1TimeoutsToHclTerraform(struct?: EcsInstanceV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EcsInstanceV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): EcsInstanceV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EcsInstanceV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1 huaweicloud_ecs_instance_v1} +*/ +export class EcsInstanceV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ecs_instance_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EcsInstanceV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EcsInstanceV1 to import + * @param importFromId The id of the existing EcsInstanceV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EcsInstanceV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ecs_instance_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ecs_instance_v1 huaweicloud_ecs_instance_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EcsInstanceV1Config + */ + public constructor(scope: Construct, id: string, config: EcsInstanceV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ecs_instance_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRecovery = config.autoRecovery; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._deleteDisksOnTermination = config.deleteDisksOnTermination; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._id = config.id; + this._imageId = config.imageId; + this._keyName = config.keyName; + this._name = config.name; + this._opSvcUserid = config.opSvcUserid; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._securityGroups = config.securityGroups; + this._systemDiskSize = config.systemDiskSize; + this._systemDiskType = config.systemDiskType; + this._tags = config.tags; + this._userData = config.userData; + this._vpcId = config.vpcId; + this._dataDisks.internalValue = config.dataDisks; + this._nics.internalValue = config.nics; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_recovery - computed: true, optional: true, required: false + private _autoRecovery?: boolean | cdktf.IResolvable; + public get autoRecovery() { + return this.getBooleanAttribute('auto_recovery'); + } + public set autoRecovery(value: boolean | cdktf.IResolvable) { + this._autoRecovery = value; + } + public resetAutoRecovery() { + this._autoRecovery = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRecoveryInput() { + return this._autoRecovery; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // delete_disks_on_termination - computed: false, optional: true, required: false + private _deleteDisksOnTermination?: boolean | cdktf.IResolvable; + public get deleteDisksOnTermination() { + return this.getBooleanAttribute('delete_disks_on_termination'); + } + public set deleteDisksOnTermination(value: boolean | cdktf.IResolvable) { + this._deleteDisksOnTermination = value; + } + public resetDeleteDisksOnTermination() { + this._deleteDisksOnTermination = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteDisksOnTerminationInput() { + return this._deleteDisksOnTermination; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // key_name - computed: false, optional: true, required: false + private _keyName?: string; + public get keyName() { + return this.getStringAttribute('key_name'); + } + public set keyName(value: string) { + this._keyName = value; + } + public resetKeyName() { + this._keyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyNameInput() { + return this._keyName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // op_svc_userid - computed: false, optional: true, required: false + private _opSvcUserid?: string; + public get opSvcUserid() { + return this.getStringAttribute('op_svc_userid'); + } + public set opSvcUserid(value: string) { + this._opSvcUserid = value; + } + public resetOpSvcUserid() { + this._opSvcUserid = undefined; + } + // Temporarily expose input value. Use with caution. + public get opSvcUseridInput() { + return this._opSvcUserid; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // security_groups - computed: true, optional: true, required: false + private _securityGroups?: string[]; + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + public resetSecurityGroups() { + this._securityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // system_disk_size - computed: false, optional: true, required: false + private _systemDiskSize?: number; + public get systemDiskSize() { + return this.getNumberAttribute('system_disk_size'); + } + public set systemDiskSize(value: number) { + this._systemDiskSize = value; + } + public resetSystemDiskSize() { + this._systemDiskSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskSizeInput() { + return this._systemDiskSize; + } + + // system_disk_type - computed: false, optional: true, required: false + private _systemDiskType?: string; + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + public set systemDiskType(value: string) { + this._systemDiskType = value; + } + public resetSystemDiskType() { + this._systemDiskType = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemDiskTypeInput() { + return this._systemDiskType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // data_disks - computed: false, optional: true, required: false + private _dataDisks = new EcsInstanceV1DataDisksList(this, "data_disks", false); + public get dataDisks() { + return this._dataDisks; + } + public putDataDisks(value: EcsInstanceV1DataDisks[] | cdktf.IResolvable) { + this._dataDisks.internalValue = value; + } + public resetDataDisks() { + this._dataDisks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDisksInput() { + return this._dataDisks.internalValue; + } + + // nics - computed: false, optional: false, required: true + private _nics = new EcsInstanceV1NicsList(this, "nics", false); + public get nics() { + return this._nics; + } + public putNics(value: EcsInstanceV1Nics[] | cdktf.IResolvable) { + this._nics.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get nicsInput() { + return this._nics.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new EcsInstanceV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: EcsInstanceV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_recovery: cdktf.booleanToTerraform(this._autoRecovery), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + delete_disks_on_termination: cdktf.booleanToTerraform(this._deleteDisksOnTermination), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + key_name: cdktf.stringToTerraform(this._keyName), + name: cdktf.stringToTerraform(this._name), + op_svc_userid: cdktf.stringToTerraform(this._opSvcUserid), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + system_disk_size: cdktf.numberToTerraform(this._systemDiskSize), + system_disk_type: cdktf.stringToTerraform(this._systemDiskType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_data: cdktf.stringToTerraform(this._userData), + vpc_id: cdktf.stringToTerraform(this._vpcId), + data_disks: cdktf.listMapper(ecsInstanceV1DataDisksToTerraform, true)(this._dataDisks.internalValue), + nics: cdktf.listMapper(ecsInstanceV1NicsToTerraform, true)(this._nics.internalValue), + timeouts: ecsInstanceV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_recovery: { + value: cdktf.booleanToHclTerraform(this._autoRecovery), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_disks_on_termination: { + value: cdktf.booleanToHclTerraform(this._deleteDisksOnTermination), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_name: { + value: cdktf.stringToHclTerraform(this._keyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + op_svc_userid: { + value: cdktf.stringToHclTerraform(this._opSvcUserid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + system_disk_size: { + value: cdktf.numberToHclTerraform(this._systemDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_type: { + value: cdktf.stringToHclTerraform(this._systemDiskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_disks: { + value: cdktf.listMapperHcl(ecsInstanceV1DataDisksToHclTerraform, true)(this._dataDisks.internalValue), + isBlock: true, + type: "list", + storageClassType: "EcsInstanceV1DataDisksList", + }, + nics: { + value: cdktf.listMapperHcl(ecsInstanceV1NicsToHclTerraform, true)(this._nics.internalValue), + isBlock: true, + type: "list", + storageClassType: "EcsInstanceV1NicsList", + }, + timeouts: { + value: ecsInstanceV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "EcsInstanceV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/eg-connection/README.md b/src/constructs/providers/huaweicloud/eg-connection/README.md new file mode 100644 index 00000000..68e9a40a --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_eg_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_eg_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection). diff --git a/src/constructs/providers/huaweicloud/eg-connection/index.ts b/src/constructs/providers/huaweicloud/eg-connection/index.ts new file mode 100644 index 00000000..4f2fbb0f --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-connection/index.ts @@ -0,0 +1,551 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EgConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#description EgConnection#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#id EgConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#name EgConnection#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#region EgConnection#region} + */ + readonly region?: string; + /** + * Specifies the ID of the subnet to which the connection belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#subnet_id EgConnection#subnet_id} + */ + readonly subnetId: string; + /** + * Specifies the type of the connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#type EgConnection#type} + */ + readonly type?: string; + /** + * Specifies the ID of the VPC to which the connection belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#vpc_id EgConnection#vpc_id} + */ + readonly vpcId: string; + /** + * kafka_detail block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#kafka_detail EgConnection#kafka_detail} + */ + readonly kafkaDetail?: EgConnectionKafkaDetail; +} +export interface EgConnectionKafkaDetail { + /** + * Specifies the number of confirmation signals the procuder + * needs to receive to consider the message sent successfully. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#acks EgConnection#acks} + */ + readonly acks?: string; + /** + * Specifies the IP address of the kafka intance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#connect_address EgConnection#connect_address} + */ + readonly connectAddress: string; + /** + * Specifies the ID of the kafka intance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#instance_id EgConnection#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the password of the kafka intance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#password EgConnection#password} + */ + readonly password?: string; + /** + * Specifies the user name of the kafka intance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#user_name EgConnection#user_name} + */ + readonly userName?: string; +} + +export function egConnectionKafkaDetailToTerraform(struct?: EgConnectionKafkaDetailOutputReference | EgConnectionKafkaDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + acks: cdktf.stringToTerraform(struct!.acks), + connect_address: cdktf.stringToTerraform(struct!.connectAddress), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + password: cdktf.stringToTerraform(struct!.password), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function egConnectionKafkaDetailToHclTerraform(struct?: EgConnectionKafkaDetailOutputReference | EgConnectionKafkaDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + acks: { + value: cdktf.stringToHclTerraform(struct!.acks), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connect_address: { + value: cdktf.stringToHclTerraform(struct!.connectAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgConnectionKafkaDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgConnectionKafkaDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._acks !== undefined) { + hasAnyValues = true; + internalValueResult.acks = this._acks; + } + if (this._connectAddress !== undefined) { + hasAnyValues = true; + internalValueResult.connectAddress = this._connectAddress; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgConnectionKafkaDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._acks = undefined; + this._connectAddress = undefined; + this._instanceId = undefined; + this._password = undefined; + this._userName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._acks = value.acks; + this._connectAddress = value.connectAddress; + this._instanceId = value.instanceId; + this._password = value.password; + this._userName = value.userName; + } + } + + // acks - computed: true, optional: true, required: false + private _acks?: string; + public get acks() { + return this.getStringAttribute('acks'); + } + public set acks(value: string) { + this._acks = value; + } + public resetAcks() { + this._acks = undefined; + } + // Temporarily expose input value. Use with caution. + public get acksInput() { + return this._acks; + } + + // connect_address - computed: false, optional: false, required: true + private _connectAddress?: string; + public get connectAddress() { + return this.getStringAttribute('connect_address'); + } + public set connectAddress(value: string) { + this._connectAddress = value; + } + // Temporarily expose input value. Use with caution. + public get connectAddressInput() { + return this._connectAddress; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // password - computed: true, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // user_name - computed: true, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection huaweicloud_eg_connection} +*/ +export class EgConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EgConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EgConnection to import + * @param importFromId The id of the existing EgConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EgConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_connection huaweicloud_eg_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EgConnectionConfig + */ + public constructor(scope: Construct, id: string, config: EgConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._type = config.type; + this._vpcId = config.vpcId; + this._kafkaDetail.internalValue = config.kafkaDetail; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // kafka_detail - computed: false, optional: true, required: false + private _kafkaDetail = new EgConnectionKafkaDetailOutputReference(this, "kafka_detail"); + public get kafkaDetail() { + return this._kafkaDetail; + } + public putKafkaDetail(value: EgConnectionKafkaDetail) { + this._kafkaDetail.internalValue = value; + } + public resetKafkaDetail() { + this._kafkaDetail.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaDetailInput() { + return this._kafkaDetail.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + kafka_detail: egConnectionKafkaDetailToTerraform(this._kafkaDetail.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka_detail: { + value: egConnectionKafkaDetailToHclTerraform(this._kafkaDetail.internalValue), + isBlock: true, + type: "list", + storageClassType: "EgConnectionKafkaDetailList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/eg-custom-event-channel/README.md b/src/constructs/providers/huaweicloud/eg-custom-event-channel/README.md new file mode 100644 index 00000000..c1318818 --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-custom-event-channel/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_eg_custom_event_channel` + +Refer to the Terraform Registry for docs: [`huaweicloud_eg_custom_event_channel`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel). diff --git a/src/constructs/providers/huaweicloud/eg-custom-event-channel/index.ts b/src/constructs/providers/huaweicloud/eg-custom-event-channel/index.ts new file mode 100644 index 00000000..8c84c1de --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-custom-event-channel/index.ts @@ -0,0 +1,273 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EgCustomEventChannelConfig extends cdktf.TerraformMetaArguments { + /** + * The list of domain IDs (other tenants) for the cross-account policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#cross_account_ids EgCustomEventChannel#cross_account_ids} + */ + readonly crossAccountIds?: string[]; + /** + * The description of the custom event channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#description EgCustomEventChannel#description} + */ + readonly description?: string; + /** + * The ID of the enterprise project to which the custom event channel belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#enterprise_project_id EgCustomEventChannel#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#id EgCustomEventChannel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the custom event channel. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#name EgCustomEventChannel#name} + */ + readonly name: string; + /** + * The region where the custom event channel is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#region EgCustomEventChannel#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel huaweicloud_eg_custom_event_channel} +*/ +export class EgCustomEventChannel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_custom_event_channel"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EgCustomEventChannel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EgCustomEventChannel to import + * @param importFromId The id of the existing EgCustomEventChannel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EgCustomEventChannel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_custom_event_channel", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_channel huaweicloud_eg_custom_event_channel} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EgCustomEventChannelConfig + */ + public constructor(scope: Construct, id: string, config: EgCustomEventChannelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_custom_event_channel', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._crossAccountIds = config.crossAccountIds; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // cross_account_ids - computed: false, optional: true, required: false + private _crossAccountIds?: string[]; + public get crossAccountIds() { + return cdktf.Fn.tolist(this.getListAttribute('cross_account_ids')); + } + public set crossAccountIds(value: string[]) { + this._crossAccountIds = value; + } + public resetCrossAccountIds() { + this._crossAccountIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get crossAccountIdsInput() { + return this._crossAccountIds; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cross_account_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._crossAccountIds), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cross_account_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._crossAccountIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/eg-custom-event-source/README.md b/src/constructs/providers/huaweicloud/eg-custom-event-source/README.md new file mode 100644 index 00000000..4276e235 --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-custom-event-source/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_eg_custom_event_source` + +Refer to the Terraform Registry for docs: [`huaweicloud_eg_custom_event_source`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source). diff --git a/src/constructs/providers/huaweicloud/eg-custom-event-source/index.ts b/src/constructs/providers/huaweicloud/eg-custom-event-source/index.ts new file mode 100644 index 00000000..c1401b8c --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-custom-event-source/index.ts @@ -0,0 +1,305 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EgCustomEventSourceConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the custom event channel to which the custom event source belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#channel_id EgCustomEventSource#channel_id} + */ + readonly channelId: string; + /** + * The description of the custom event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#description EgCustomEventSource#description} + */ + readonly description?: string; + /** + * The configuration detail of the event source, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#detail EgCustomEventSource#detail} + */ + readonly detail?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#id EgCustomEventSource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the custom event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#name EgCustomEventSource#name} + */ + readonly name: string; + /** + * The region where the custom event source is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#region EgCustomEventSource#region} + */ + readonly region?: string; + /** + * The type of the custom event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#type EgCustomEventSource#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source huaweicloud_eg_custom_event_source} +*/ +export class EgCustomEventSource extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_custom_event_source"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EgCustomEventSource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EgCustomEventSource to import + * @param importFromId The id of the existing EgCustomEventSource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EgCustomEventSource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_custom_event_source", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_custom_event_source huaweicloud_eg_custom_event_source} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EgCustomEventSourceConfig + */ + public constructor(scope: Construct, id: string, config: EgCustomEventSourceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_custom_event_source', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._channelId = config.channelId; + this._description = config.description; + this._detail = config.detail; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // channel_id - computed: false, optional: false, required: true + private _channelId?: string; + public get channelId() { + return this.getStringAttribute('channel_id'); + } + public set channelId(value: string) { + this._channelId = value; + } + // Temporarily expose input value. Use with caution. + public get channelIdInput() { + return this._channelId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // detail - computed: true, optional: true, required: false + private _detail?: string; + public get detail() { + return this.getStringAttribute('detail'); + } + public set detail(value: string) { + this._detail = value; + } + public resetDetail() { + this._detail = undefined; + } + // Temporarily expose input value. Use with caution. + public get detailInput() { + return this._detail; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + channel_id: cdktf.stringToTerraform(this._channelId), + description: cdktf.stringToTerraform(this._description), + detail: cdktf.stringToTerraform(this._detail), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + channel_id: { + value: cdktf.stringToHclTerraform(this._channelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detail: { + value: cdktf.stringToHclTerraform(this._detail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/eg-endpoint/README.md b/src/constructs/providers/huaweicloud/eg-endpoint/README.md new file mode 100644 index 00000000..1d9c442e --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-endpoint/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_eg_endpoint` + +Refer to the Terraform Registry for docs: [`huaweicloud_eg_endpoint`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint). diff --git a/src/constructs/providers/huaweicloud/eg-endpoint/index.ts b/src/constructs/providers/huaweicloud/eg-endpoint/index.ts new file mode 100644 index 00000000..37473ce0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-endpoint/index.ts @@ -0,0 +1,276 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EgEndpointConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#description EgEndpoint#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#id EgEndpoint#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the endpoint. + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#name EgEndpoint#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#region EgEndpoint#region} + */ + readonly region?: string; + /** + * Specifies the ID of the subnet to which the endpoint belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#subnet_id EgEndpoint#subnet_id} + */ + readonly subnetId: string; + /** + * Specifies the ID of the VPC to which the endpoint belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#vpc_id EgEndpoint#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint huaweicloud_eg_endpoint} +*/ +export class EgEndpoint extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_endpoint"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EgEndpoint resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EgEndpoint to import + * @param importFromId The id of the existing EgEndpoint that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EgEndpoint to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_endpoint", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_endpoint huaweicloud_eg_endpoint} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EgEndpointConfig + */ + public constructor(scope: Construct, id: string, config: EgEndpointConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_endpoint', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/eg-event-stream/README.md b/src/constructs/providers/huaweicloud/eg-event-stream/README.md new file mode 100644 index 00000000..4daec5df --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-event-stream/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_eg_event_stream` + +Refer to the Terraform Registry for docs: [`huaweicloud_eg_event_stream`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream). diff --git a/src/constructs/providers/huaweicloud/eg-event-stream/index.ts b/src/constructs/providers/huaweicloud/eg-event-stream/index.ts new file mode 100644 index 00000000..e50ca826 --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-event-stream/index.ts @@ -0,0 +1,1271 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EgEventStreamConfig extends cdktf.TerraformMetaArguments { + /** + * The desired running status of the event stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#action EgEventStream#action} + */ + readonly action?: string; + /** + * The description of the event stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#description EgEventStream#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#id EgEventStream#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the event stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#name EgEventStream#name} + */ + readonly name: string; + /** + * The region where the event stream is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#region EgEventStream#region} + */ + readonly region?: string; + /** + * option block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#option EgEventStream#option} + */ + readonly option: EgEventStreamOption; + /** + * rule_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#rule_config EgEventStream#rule_config} + */ + readonly ruleConfig: EgEventStreamRuleConfig; + /** + * sink block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#sink EgEventStream#sink} + */ + readonly sink: EgEventStreamSink; + /** + * source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#source EgEventStream#source} + */ + readonly source: EgEventStreamSource; +} +export interface EgEventStreamOptionBatchWindow { + /** + * The number of items pushed in batches. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#count EgEventStream#count} + */ + readonly count: number; + /** + * The interval of the batch push. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#interval EgEventStream#interval} + */ + readonly interval?: number; + /** + * The number of retries. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#time EgEventStream#time} + */ + readonly time?: number; +} + +export function egEventStreamOptionBatchWindowToTerraform(struct?: EgEventStreamOptionBatchWindowOutputReference | EgEventStreamOptionBatchWindow): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + interval: cdktf.numberToTerraform(struct!.interval), + time: cdktf.numberToTerraform(struct!.time), + } +} + + +export function egEventStreamOptionBatchWindowToHclTerraform(struct?: EgEventStreamOptionBatchWindowOutputReference | EgEventStreamOptionBatchWindow): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time: { + value: cdktf.numberToHclTerraform(struct!.time), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventStreamOptionBatchWindowOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgEventStreamOptionBatchWindow | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._time !== undefined) { + hasAnyValues = true; + internalValueResult.time = this._time; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventStreamOptionBatchWindow | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._count = undefined; + this._interval = undefined; + this._time = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._count = value.count; + this._interval = value.interval; + this._time = value.time; + } + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // interval - computed: true, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // time - computed: true, optional: true, required: false + private _time?: number; + public get time() { + return this.getNumberAttribute('time'); + } + public set time(value: number) { + this._time = value; + } + public resetTime() { + this._time = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeInput() { + return this._time; + } +} +export interface EgEventStreamOption { + /** + * The number of concurrent threads. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#thread_num EgEventStream#thread_num} + */ + readonly threadNum: number; + /** + * batch_window block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#batch_window EgEventStream#batch_window} + */ + readonly batchWindow: EgEventStreamOptionBatchWindow; +} + +export function egEventStreamOptionToTerraform(struct?: EgEventStreamOptionOutputReference | EgEventStreamOption): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + thread_num: cdktf.numberToTerraform(struct!.threadNum), + batch_window: egEventStreamOptionBatchWindowToTerraform(struct!.batchWindow), + } +} + + +export function egEventStreamOptionToHclTerraform(struct?: EgEventStreamOptionOutputReference | EgEventStreamOption): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + thread_num: { + value: cdktf.numberToHclTerraform(struct!.threadNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + batch_window: { + value: egEventStreamOptionBatchWindowToHclTerraform(struct!.batchWindow), + isBlock: true, + type: "list", + storageClassType: "EgEventStreamOptionBatchWindowList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventStreamOptionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgEventStreamOption | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._threadNum !== undefined) { + hasAnyValues = true; + internalValueResult.threadNum = this._threadNum; + } + if (this._batchWindow?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.batchWindow = this._batchWindow?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventStreamOption | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._threadNum = undefined; + this._batchWindow.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._threadNum = value.threadNum; + this._batchWindow.internalValue = value.batchWindow; + } + } + + // thread_num - computed: false, optional: false, required: true + private _threadNum?: number; + public get threadNum() { + return this.getNumberAttribute('thread_num'); + } + public set threadNum(value: number) { + this._threadNum = value; + } + // Temporarily expose input value. Use with caution. + public get threadNumInput() { + return this._threadNum; + } + + // batch_window - computed: false, optional: false, required: true + private _batchWindow = new EgEventStreamOptionBatchWindowOutputReference(this, "batch_window"); + public get batchWindow() { + return this._batchWindow; + } + public putBatchWindow(value: EgEventStreamOptionBatchWindow) { + this._batchWindow.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get batchWindowInput() { + return this._batchWindow.internalValue; + } +} +export interface EgEventStreamRuleConfigTransform { + /** + * The template definition of the rule content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#template EgEventStream#template} + */ + readonly template?: string; + /** + * The type of transform rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#type EgEventStream#type} + */ + readonly type: string; + /** + * The rule content definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#value EgEventStream#value} + */ + readonly value?: string; +} + +export function egEventStreamRuleConfigTransformToTerraform(struct?: EgEventStreamRuleConfigTransformOutputReference | EgEventStreamRuleConfigTransform): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + template: cdktf.stringToTerraform(struct!.template), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function egEventStreamRuleConfigTransformToHclTerraform(struct?: EgEventStreamRuleConfigTransformOutputReference | EgEventStreamRuleConfigTransform): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + template: { + value: cdktf.stringToHclTerraform(struct!.template), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventStreamRuleConfigTransformOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgEventStreamRuleConfigTransform | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._template !== undefined) { + hasAnyValues = true; + internalValueResult.template = this._template; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventStreamRuleConfigTransform | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._template = undefined; + this._type = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._template = value.template; + this._type = value.type; + this._value = value.value; + } + } + + // template - computed: true, optional: true, required: false + private _template?: string; + public get template() { + return this.getStringAttribute('template'); + } + public set template(value: string) { + this._template = value; + } + public resetTemplate() { + this._template = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateInput() { + return this._template; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface EgEventStreamRuleConfig { + /** + * The configuration detail of the filter rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#filter EgEventStream#filter} + */ + readonly filter?: string; + /** + * transform block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#transform EgEventStream#transform} + */ + readonly transform: EgEventStreamRuleConfigTransform; +} + +export function egEventStreamRuleConfigToTerraform(struct?: EgEventStreamRuleConfigOutputReference | EgEventStreamRuleConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + filter: cdktf.stringToTerraform(struct!.filter), + transform: egEventStreamRuleConfigTransformToTerraform(struct!.transform), + } +} + + +export function egEventStreamRuleConfigToHclTerraform(struct?: EgEventStreamRuleConfigOutputReference | EgEventStreamRuleConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + filter: { + value: cdktf.stringToHclTerraform(struct!.filter), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transform: { + value: egEventStreamRuleConfigTransformToHclTerraform(struct!.transform), + isBlock: true, + type: "list", + storageClassType: "EgEventStreamRuleConfigTransformList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventStreamRuleConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgEventStreamRuleConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._filter !== undefined) { + hasAnyValues = true; + internalValueResult.filter = this._filter; + } + if (this._transform?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.transform = this._transform?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventStreamRuleConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._filter = undefined; + this._transform.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._filter = value.filter; + this._transform.internalValue = value.transform; + } + } + + // filter - computed: true, optional: true, required: false + private _filter?: string; + public get filter() { + return this.getStringAttribute('filter'); + } + public set filter(value: string) { + this._filter = value; + } + public resetFilter() { + this._filter = undefined; + } + // Temporarily expose input value. Use with caution. + public get filterInput() { + return this._filter; + } + + // transform - computed: false, optional: false, required: true + private _transform = new EgEventStreamRuleConfigTransformOutputReference(this, "transform"); + public get transform() { + return this._transform; + } + public putTransform(value: EgEventStreamRuleConfigTransform) { + this._transform.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get transformInput() { + return this._transform.internalValue; + } +} +export interface EgEventStreamSink { + /** + * The event target configuration detail for FunctionGraph type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#functiongraph EgEventStream#functiongraph} + */ + readonly functiongraph?: string; + /** + * The event target configuration detail for DMS Kafka type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#kafka EgEventStream#kafka} + */ + readonly kafka?: string; + /** + * The name of the event target type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#name EgEventStream#name} + */ + readonly name: string; +} + +export function egEventStreamSinkToTerraform(struct?: EgEventStreamSinkOutputReference | EgEventStreamSink): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + functiongraph: cdktf.stringToTerraform(struct!.functiongraph), + kafka: cdktf.stringToTerraform(struct!.kafka), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function egEventStreamSinkToHclTerraform(struct?: EgEventStreamSinkOutputReference | EgEventStreamSink): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + functiongraph: { + value: cdktf.stringToHclTerraform(struct!.functiongraph), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka: { + value: cdktf.stringToHclTerraform(struct!.kafka), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventStreamSinkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgEventStreamSink | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._functiongraph !== undefined) { + hasAnyValues = true; + internalValueResult.functiongraph = this._functiongraph; + } + if (this._kafka !== undefined) { + hasAnyValues = true; + internalValueResult.kafka = this._kafka; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventStreamSink | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._functiongraph = undefined; + this._kafka = undefined; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._functiongraph = value.functiongraph; + this._kafka = value.kafka; + this._name = value.name; + } + } + + // functiongraph - computed: false, optional: true, required: false + private _functiongraph?: string; + public get functiongraph() { + return this.getStringAttribute('functiongraph'); + } + public set functiongraph(value: string) { + this._functiongraph = value; + } + public resetFunctiongraph() { + this._functiongraph = undefined; + } + // Temporarily expose input value. Use with caution. + public get functiongraphInput() { + return this._functiongraph; + } + + // kafka - computed: false, optional: true, required: false + private _kafka?: string; + public get kafka() { + return this.getStringAttribute('kafka'); + } + public set kafka(value: string) { + this._kafka = value; + } + public resetKafka() { + this._kafka = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaInput() { + return this._kafka; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} +export interface EgEventStreamSource { + /** + * The event source configuration detail for community RocketMQ type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#community_rocketmq EgEventStream#community_rocketmq} + */ + readonly communityRocketmq?: string; + /** + * The event source configuration detail for DMS RocketMQ type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#dms_rocketmq EgEventStream#dms_rocketmq} + */ + readonly dmsRocketmq?: string; + /** + * The event source configuration detail for DMS Kafka type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#kafka EgEventStream#kafka} + */ + readonly kafka?: string; + /** + * The event source configuration detail for mobile RocketMQ type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#mobile_rocketmq EgEventStream#mobile_rocketmq} + */ + readonly mobileRocketmq?: string; + /** + * The name of the event source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#name EgEventStream#name} + */ + readonly name: string; +} + +export function egEventStreamSourceToTerraform(struct?: EgEventStreamSourceOutputReference | EgEventStreamSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + community_rocketmq: cdktf.stringToTerraform(struct!.communityRocketmq), + dms_rocketmq: cdktf.stringToTerraform(struct!.dmsRocketmq), + kafka: cdktf.stringToTerraform(struct!.kafka), + mobile_rocketmq: cdktf.stringToTerraform(struct!.mobileRocketmq), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function egEventStreamSourceToHclTerraform(struct?: EgEventStreamSourceOutputReference | EgEventStreamSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + community_rocketmq: { + value: cdktf.stringToHclTerraform(struct!.communityRocketmq), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dms_rocketmq: { + value: cdktf.stringToHclTerraform(struct!.dmsRocketmq), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka: { + value: cdktf.stringToHclTerraform(struct!.kafka), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mobile_rocketmq: { + value: cdktf.stringToHclTerraform(struct!.mobileRocketmq), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventStreamSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): EgEventStreamSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._communityRocketmq !== undefined) { + hasAnyValues = true; + internalValueResult.communityRocketmq = this._communityRocketmq; + } + if (this._dmsRocketmq !== undefined) { + hasAnyValues = true; + internalValueResult.dmsRocketmq = this._dmsRocketmq; + } + if (this._kafka !== undefined) { + hasAnyValues = true; + internalValueResult.kafka = this._kafka; + } + if (this._mobileRocketmq !== undefined) { + hasAnyValues = true; + internalValueResult.mobileRocketmq = this._mobileRocketmq; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventStreamSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._communityRocketmq = undefined; + this._dmsRocketmq = undefined; + this._kafka = undefined; + this._mobileRocketmq = undefined; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._communityRocketmq = value.communityRocketmq; + this._dmsRocketmq = value.dmsRocketmq; + this._kafka = value.kafka; + this._mobileRocketmq = value.mobileRocketmq; + this._name = value.name; + } + } + + // community_rocketmq - computed: false, optional: true, required: false + private _communityRocketmq?: string; + public get communityRocketmq() { + return this.getStringAttribute('community_rocketmq'); + } + public set communityRocketmq(value: string) { + this._communityRocketmq = value; + } + public resetCommunityRocketmq() { + this._communityRocketmq = undefined; + } + // Temporarily expose input value. Use with caution. + public get communityRocketmqInput() { + return this._communityRocketmq; + } + + // dms_rocketmq - computed: false, optional: true, required: false + private _dmsRocketmq?: string; + public get dmsRocketmq() { + return this.getStringAttribute('dms_rocketmq'); + } + public set dmsRocketmq(value: string) { + this._dmsRocketmq = value; + } + public resetDmsRocketmq() { + this._dmsRocketmq = undefined; + } + // Temporarily expose input value. Use with caution. + public get dmsRocketmqInput() { + return this._dmsRocketmq; + } + + // kafka - computed: false, optional: true, required: false + private _kafka?: string; + public get kafka() { + return this.getStringAttribute('kafka'); + } + public set kafka(value: string) { + this._kafka = value; + } + public resetKafka() { + this._kafka = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaInput() { + return this._kafka; + } + + // mobile_rocketmq - computed: false, optional: true, required: false + private _mobileRocketmq?: string; + public get mobileRocketmq() { + return this.getStringAttribute('mobile_rocketmq'); + } + public set mobileRocketmq(value: string) { + this._mobileRocketmq = value; + } + public resetMobileRocketmq() { + this._mobileRocketmq = undefined; + } + // Temporarily expose input value. Use with caution. + public get mobileRocketmqInput() { + return this._mobileRocketmq; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream huaweicloud_eg_event_stream} +*/ +export class EgEventStream extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_event_stream"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EgEventStream resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EgEventStream to import + * @param importFromId The id of the existing EgEventStream that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EgEventStream to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_event_stream", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_stream huaweicloud_eg_event_stream} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EgEventStreamConfig + */ + public constructor(scope: Construct, id: string, config: EgEventStreamConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_event_stream', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._option.internalValue = config.option; + this._ruleConfig.internalValue = config.ruleConfig; + this._sink.internalValue = config.sink; + this._source.internalValue = config.source; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // option - computed: false, optional: false, required: true + private _option = new EgEventStreamOptionOutputReference(this, "option"); + public get option() { + return this._option; + } + public putOption(value: EgEventStreamOption) { + this._option.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get optionInput() { + return this._option.internalValue; + } + + // rule_config - computed: false, optional: false, required: true + private _ruleConfig = new EgEventStreamRuleConfigOutputReference(this, "rule_config"); + public get ruleConfig() { + return this._ruleConfig; + } + public putRuleConfig(value: EgEventStreamRuleConfig) { + this._ruleConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get ruleConfigInput() { + return this._ruleConfig.internalValue; + } + + // sink - computed: false, optional: false, required: true + private _sink = new EgEventStreamSinkOutputReference(this, "sink"); + public get sink() { + return this._sink; + } + public putSink(value: EgEventStreamSink) { + this._sink.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sinkInput() { + return this._sink.internalValue; + } + + // source - computed: false, optional: false, required: true + private _source = new EgEventStreamSourceOutputReference(this, "source"); + public get source() { + return this._source; + } + public putSource(value: EgEventStreamSource) { + this._source.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + option: egEventStreamOptionToTerraform(this._option.internalValue), + rule_config: egEventStreamRuleConfigToTerraform(this._ruleConfig.internalValue), + sink: egEventStreamSinkToTerraform(this._sink.internalValue), + source: egEventStreamSourceToTerraform(this._source.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + option: { + value: egEventStreamOptionToHclTerraform(this._option.internalValue), + isBlock: true, + type: "list", + storageClassType: "EgEventStreamOptionList", + }, + rule_config: { + value: egEventStreamRuleConfigToHclTerraform(this._ruleConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "EgEventStreamRuleConfigList", + }, + sink: { + value: egEventStreamSinkToHclTerraform(this._sink.internalValue), + isBlock: true, + type: "list", + storageClassType: "EgEventStreamSinkList", + }, + source: { + value: egEventStreamSourceToHclTerraform(this._source.internalValue), + isBlock: true, + type: "list", + storageClassType: "EgEventStreamSourceList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/eg-event-subscription/README.md b/src/constructs/providers/huaweicloud/eg-event-subscription/README.md new file mode 100644 index 00000000..c68ecb45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-event-subscription/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_eg_event_subscription` + +Refer to the Terraform Registry for docs: [`huaweicloud_eg_event_subscription`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription). diff --git a/src/constructs/providers/huaweicloud/eg-event-subscription/index.ts b/src/constructs/providers/huaweicloud/eg-event-subscription/index.ts new file mode 100644 index 00000000..fda125b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/eg-event-subscription/index.ts @@ -0,0 +1,957 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EgEventSubscriptionConfig extends cdktf.TerraformMetaArguments { + /** + * The channel ID to which the event subscription belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#channel_id EgEventSubscription#channel_id} + */ + readonly channelId: string; + /** + * The description of the event subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#description EgEventSubscription#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#id EgEventSubscription#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the event subscription. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#name EgEventSubscription#name} + */ + readonly name: string; + /** + * The region where the event subscription is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#region EgEventSubscription#region} + */ + readonly region?: string; + /** + * sources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#sources EgEventSubscription#sources} + */ + readonly sources: EgEventSubscriptionSources[] | cdktf.IResolvable; + /** + * targets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#targets EgEventSubscription#targets} + */ + readonly targets: EgEventSubscriptionTargets[] | cdktf.IResolvable; +} +export interface EgEventSubscriptionSources { + /** + * The configuration source of the event target, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#detail EgEventSubscription#detail} + */ + readonly detail?: string; + /** + * The name (key) of the source configuration detail. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#detail_name EgEventSubscription#detail_name} + */ + readonly detailName?: string; + /** + * The filter rule of the event source + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#filter_rule EgEventSubscription#filter_rule} + */ + readonly filterRule: string; + /** + * The ID of the event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#id EgEventSubscription#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#name EgEventSubscription#name} + */ + readonly name: string; + /** + * The provider type of the event source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#provider_type EgEventSubscription#provider_type} + */ + readonly providerType: string; +} + +export function egEventSubscriptionSourcesToTerraform(struct?: EgEventSubscriptionSources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + detail: cdktf.stringToTerraform(struct!.detail), + detail_name: cdktf.stringToTerraform(struct!.detailName), + filter_rule: cdktf.stringToTerraform(struct!.filterRule), + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + provider_type: cdktf.stringToTerraform(struct!.providerType), + } +} + + +export function egEventSubscriptionSourcesToHclTerraform(struct?: EgEventSubscriptionSources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + detail: { + value: cdktf.stringToHclTerraform(struct!.detail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detail_name: { + value: cdktf.stringToHclTerraform(struct!.detailName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_rule: { + value: cdktf.stringToHclTerraform(struct!.filterRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_type: { + value: cdktf.stringToHclTerraform(struct!.providerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventSubscriptionSourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): EgEventSubscriptionSources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._detail !== undefined) { + hasAnyValues = true; + internalValueResult.detail = this._detail; + } + if (this._detailName !== undefined) { + hasAnyValues = true; + internalValueResult.detailName = this._detailName; + } + if (this._filterRule !== undefined) { + hasAnyValues = true; + internalValueResult.filterRule = this._filterRule; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._providerType !== undefined) { + hasAnyValues = true; + internalValueResult.providerType = this._providerType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventSubscriptionSources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._detail = undefined; + this._detailName = undefined; + this._filterRule = undefined; + this._id = undefined; + this._name = undefined; + this._providerType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._detail = value.detail; + this._detailName = value.detailName; + this._filterRule = value.filterRule; + this._id = value.id; + this._name = value.name; + this._providerType = value.providerType; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // detail - computed: false, optional: true, required: false + private _detail?: string; + public get detail() { + return this.getStringAttribute('detail'); + } + public set detail(value: string) { + this._detail = value; + } + public resetDetail() { + this._detail = undefined; + } + // Temporarily expose input value. Use with caution. + public get detailInput() { + return this._detail; + } + + // detail_name - computed: false, optional: true, required: false + private _detailName?: string; + public get detailName() { + return this.getStringAttribute('detail_name'); + } + public set detailName(value: string) { + this._detailName = value; + } + public resetDetailName() { + this._detailName = undefined; + } + // Temporarily expose input value. Use with caution. + public get detailNameInput() { + return this._detailName; + } + + // filter_rule - computed: false, optional: false, required: true + private _filterRule?: string; + public get filterRule() { + return this.getStringAttribute('filter_rule'); + } + public set filterRule(value: string) { + this._filterRule = value; + } + // Temporarily expose input value. Use with caution. + public get filterRuleInput() { + return this._filterRule; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_type - computed: false, optional: false, required: true + private _providerType?: string; + public get providerType() { + return this.getStringAttribute('provider_type'); + } + public set providerType(value: string) { + this._providerType = value; + } + // Temporarily expose input value. Use with caution. + public get providerTypeInput() { + return this._providerType; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class EgEventSubscriptionSourcesList extends cdktf.ComplexList { + public internalValue? : EgEventSubscriptionSources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): EgEventSubscriptionSourcesOutputReference { + return new EgEventSubscriptionSourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface EgEventSubscriptionTargets { + /** + * The connection ID of the EG event target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#connection_id EgEventSubscription#connection_id} + */ + readonly connectionId?: string; + /** + * The specified queue to which failure events sent, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#dead_letter_queue EgEventSubscription#dead_letter_queue} + */ + readonly deadLetterQueue?: string; + /** + * The configuration detail of the event target, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#detail EgEventSubscription#detail} + */ + readonly detail: string; + /** + * The name (key) of the target configuration detail. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#detail_name EgEventSubscription#detail_name} + */ + readonly detailName: string; + /** + * The ID of the event target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#id EgEventSubscription#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the event target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#name EgEventSubscription#name} + */ + readonly name: string; + /** + * The provider type of the event target. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#provider_type EgEventSubscription#provider_type} + */ + readonly providerType: string; + /** + * The transform configuration of the event target, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#transform EgEventSubscription#transform} + */ + readonly transform: string; +} + +export function egEventSubscriptionTargetsToTerraform(struct?: EgEventSubscriptionTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + connection_id: cdktf.stringToTerraform(struct!.connectionId), + dead_letter_queue: cdktf.stringToTerraform(struct!.deadLetterQueue), + detail: cdktf.stringToTerraform(struct!.detail), + detail_name: cdktf.stringToTerraform(struct!.detailName), + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + provider_type: cdktf.stringToTerraform(struct!.providerType), + transform: cdktf.stringToTerraform(struct!.transform), + } +} + + +export function egEventSubscriptionTargetsToHclTerraform(struct?: EgEventSubscriptionTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(struct!.connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dead_letter_queue: { + value: cdktf.stringToHclTerraform(struct!.deadLetterQueue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detail: { + value: cdktf.stringToHclTerraform(struct!.detail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + detail_name: { + value: cdktf.stringToHclTerraform(struct!.detailName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_type: { + value: cdktf.stringToHclTerraform(struct!.providerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transform: { + value: cdktf.stringToHclTerraform(struct!.transform), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EgEventSubscriptionTargetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): EgEventSubscriptionTargets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._connectionId !== undefined) { + hasAnyValues = true; + internalValueResult.connectionId = this._connectionId; + } + if (this._deadLetterQueue !== undefined) { + hasAnyValues = true; + internalValueResult.deadLetterQueue = this._deadLetterQueue; + } + if (this._detail !== undefined) { + hasAnyValues = true; + internalValueResult.detail = this._detail; + } + if (this._detailName !== undefined) { + hasAnyValues = true; + internalValueResult.detailName = this._detailName; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._providerType !== undefined) { + hasAnyValues = true; + internalValueResult.providerType = this._providerType; + } + if (this._transform !== undefined) { + hasAnyValues = true; + internalValueResult.transform = this._transform; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EgEventSubscriptionTargets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._connectionId = undefined; + this._deadLetterQueue = undefined; + this._detail = undefined; + this._detailName = undefined; + this._id = undefined; + this._name = undefined; + this._providerType = undefined; + this._transform = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._connectionId = value.connectionId; + this._deadLetterQueue = value.deadLetterQueue; + this._detail = value.detail; + this._detailName = value.detailName; + this._id = value.id; + this._name = value.name; + this._providerType = value.providerType; + this._transform = value.transform; + } + } + + // connection_id - computed: false, optional: true, required: false + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + public resetConnectionId() { + this._connectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dead_letter_queue - computed: true, optional: true, required: false + private _deadLetterQueue?: string; + public get deadLetterQueue() { + return this.getStringAttribute('dead_letter_queue'); + } + public set deadLetterQueue(value: string) { + this._deadLetterQueue = value; + } + public resetDeadLetterQueue() { + this._deadLetterQueue = undefined; + } + // Temporarily expose input value. Use with caution. + public get deadLetterQueueInput() { + return this._deadLetterQueue; + } + + // detail - computed: false, optional: false, required: true + private _detail?: string; + public get detail() { + return this.getStringAttribute('detail'); + } + public set detail(value: string) { + this._detail = value; + } + // Temporarily expose input value. Use with caution. + public get detailInput() { + return this._detail; + } + + // detail_name - computed: false, optional: false, required: true + private _detailName?: string; + public get detailName() { + return this.getStringAttribute('detail_name'); + } + public set detailName(value: string) { + this._detailName = value; + } + // Temporarily expose input value. Use with caution. + public get detailNameInput() { + return this._detailName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_type - computed: false, optional: false, required: true + private _providerType?: string; + public get providerType() { + return this.getStringAttribute('provider_type'); + } + public set providerType(value: string) { + this._providerType = value; + } + // Temporarily expose input value. Use with caution. + public get providerTypeInput() { + return this._providerType; + } + + // transform - computed: false, optional: false, required: true + private _transform?: string; + public get transform() { + return this.getStringAttribute('transform'); + } + public set transform(value: string) { + this._transform = value; + } + // Temporarily expose input value. Use with caution. + public get transformInput() { + return this._transform; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} + +export class EgEventSubscriptionTargetsList extends cdktf.ComplexList { + public internalValue? : EgEventSubscriptionTargets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): EgEventSubscriptionTargetsOutputReference { + return new EgEventSubscriptionTargetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription huaweicloud_eg_event_subscription} +*/ +export class EgEventSubscription extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_eg_event_subscription"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EgEventSubscription resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EgEventSubscription to import + * @param importFromId The id of the existing EgEventSubscription that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EgEventSubscription to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_eg_event_subscription", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/eg_event_subscription huaweicloud_eg_event_subscription} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EgEventSubscriptionConfig + */ + public constructor(scope: Construct, id: string, config: EgEventSubscriptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_eg_event_subscription', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._channelId = config.channelId; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sources.internalValue = config.sources; + this._targets.internalValue = config.targets; + } + + // ========== + // ATTRIBUTES + // ========== + + // channel_id - computed: false, optional: false, required: true + private _channelId?: string; + public get channelId() { + return this.getStringAttribute('channel_id'); + } + public set channelId(value: string) { + this._channelId = value; + } + // Temporarily expose input value. Use with caution. + public get channelIdInput() { + return this._channelId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // sources - computed: false, optional: false, required: true + private _sources = new EgEventSubscriptionSourcesList(this, "sources", true); + public get sources() { + return this._sources; + } + public putSources(value: EgEventSubscriptionSources[] | cdktf.IResolvable) { + this._sources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourcesInput() { + return this._sources.internalValue; + } + + // targets - computed: false, optional: false, required: true + private _targets = new EgEventSubscriptionTargetsList(this, "targets", true); + public get targets() { + return this._targets; + } + public putTargets(value: EgEventSubscriptionTargets[] | cdktf.IResolvable) { + this._targets.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get targetsInput() { + return this._targets.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + channel_id: cdktf.stringToTerraform(this._channelId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sources: cdktf.listMapper(egEventSubscriptionSourcesToTerraform, true)(this._sources.internalValue), + targets: cdktf.listMapper(egEventSubscriptionTargetsToTerraform, true)(this._targets.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + channel_id: { + value: cdktf.stringToHclTerraform(this._channelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sources: { + value: cdktf.listMapperHcl(egEventSubscriptionSourcesToHclTerraform, true)(this._sources.internalValue), + isBlock: true, + type: "set", + storageClassType: "EgEventSubscriptionSourcesList", + }, + targets: { + value: cdktf.listMapperHcl(egEventSubscriptionTargetsToHclTerraform, true)(this._targets.internalValue), + isBlock: true, + type: "set", + storageClassType: "EgEventSubscriptionTargetsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-active-standby-pool/README.md b/src/constructs/providers/huaweicloud/elb-active-standby-pool/README.md new file mode 100644 index 00000000..b62838c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-active-standby-pool/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_active_standby_pool` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_active_standby_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool). diff --git a/src/constructs/providers/huaweicloud/elb-active-standby-pool/index.ts b/src/constructs/providers/huaweicloud/elb-active-standby-pool/index.ts new file mode 100644 index 00000000..a69f92b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-active-standby-pool/index.ts @@ -0,0 +1,1344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbActiveStandbyPoolConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#any_port_enable ElbActiveStandbyPool#any_port_enable} + */ + readonly anyPortEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#connection_drain_enabled ElbActiveStandbyPool#connection_drain_enabled} + */ + readonly connectionDrainEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#connection_drain_timeout ElbActiveStandbyPool#connection_drain_timeout} + */ + readonly connectionDrainTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#description ElbActiveStandbyPool#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#id ElbActiveStandbyPool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#ip_version ElbActiveStandbyPool#ip_version} + */ + readonly ipVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#listener_id ElbActiveStandbyPool#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#loadbalancer_id ElbActiveStandbyPool#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#name ElbActiveStandbyPool#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#protocol ElbActiveStandbyPool#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#region ElbActiveStandbyPool#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#type ElbActiveStandbyPool#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#vpc_id ElbActiveStandbyPool#vpc_id} + */ + readonly vpcId?: string; + /** + * healthmonitor block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#healthmonitor ElbActiveStandbyPool#healthmonitor} + */ + readonly healthmonitor: ElbActiveStandbyPoolHealthmonitor; + /** + * members block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#members ElbActiveStandbyPool#members} + */ + readonly members: ElbActiveStandbyPoolMembers[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#timeouts ElbActiveStandbyPool#timeouts} + */ + readonly timeouts?: ElbActiveStandbyPoolTimeouts; +} +export interface ElbActiveStandbyPoolHealthmonitor { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#delay ElbActiveStandbyPool#delay} + */ + readonly delay: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#domain_name ElbActiveStandbyPool#domain_name} + */ + readonly domainName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#expected_codes ElbActiveStandbyPool#expected_codes} + */ + readonly expectedCodes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#http_method ElbActiveStandbyPool#http_method} + */ + readonly httpMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#max_retries ElbActiveStandbyPool#max_retries} + */ + readonly maxRetries: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#max_retries_down ElbActiveStandbyPool#max_retries_down} + */ + readonly maxRetriesDown?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#monitor_port ElbActiveStandbyPool#monitor_port} + */ + readonly monitorPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#name ElbActiveStandbyPool#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#timeout ElbActiveStandbyPool#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#type ElbActiveStandbyPool#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#url_path ElbActiveStandbyPool#url_path} + */ + readonly urlPath?: string; +} + +export function elbActiveStandbyPoolHealthmonitorToTerraform(struct?: ElbActiveStandbyPoolHealthmonitorOutputReference | ElbActiveStandbyPoolHealthmonitor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delay: cdktf.numberToTerraform(struct!.delay), + domain_name: cdktf.stringToTerraform(struct!.domainName), + expected_codes: cdktf.stringToTerraform(struct!.expectedCodes), + http_method: cdktf.stringToTerraform(struct!.httpMethod), + max_retries: cdktf.numberToTerraform(struct!.maxRetries), + max_retries_down: cdktf.numberToTerraform(struct!.maxRetriesDown), + monitor_port: cdktf.numberToTerraform(struct!.monitorPort), + name: cdktf.stringToTerraform(struct!.name), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + url_path: cdktf.stringToTerraform(struct!.urlPath), + } +} + + +export function elbActiveStandbyPoolHealthmonitorToHclTerraform(struct?: ElbActiveStandbyPoolHealthmonitorOutputReference | ElbActiveStandbyPoolHealthmonitor): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delay: { + value: cdktf.numberToHclTerraform(struct!.delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + domain_name: { + value: cdktf.stringToHclTerraform(struct!.domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expected_codes: { + value: cdktf.stringToHclTerraform(struct!.expectedCodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_method: { + value: cdktf.stringToHclTerraform(struct!.httpMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retries: { + value: cdktf.numberToHclTerraform(struct!.maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries_down: { + value: cdktf.numberToHclTerraform(struct!.maxRetriesDown), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + monitor_port: { + value: cdktf.numberToHclTerraform(struct!.monitorPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_path: { + value: cdktf.stringToHclTerraform(struct!.urlPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbActiveStandbyPoolHealthmonitorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbActiveStandbyPoolHealthmonitor | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delay !== undefined) { + hasAnyValues = true; + internalValueResult.delay = this._delay; + } + if (this._domainName !== undefined) { + hasAnyValues = true; + internalValueResult.domainName = this._domainName; + } + if (this._expectedCodes !== undefined) { + hasAnyValues = true; + internalValueResult.expectedCodes = this._expectedCodes; + } + if (this._httpMethod !== undefined) { + hasAnyValues = true; + internalValueResult.httpMethod = this._httpMethod; + } + if (this._maxRetries !== undefined) { + hasAnyValues = true; + internalValueResult.maxRetries = this._maxRetries; + } + if (this._maxRetriesDown !== undefined) { + hasAnyValues = true; + internalValueResult.maxRetriesDown = this._maxRetriesDown; + } + if (this._monitorPort !== undefined) { + hasAnyValues = true; + internalValueResult.monitorPort = this._monitorPort; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._urlPath !== undefined) { + hasAnyValues = true; + internalValueResult.urlPath = this._urlPath; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbActiveStandbyPoolHealthmonitor | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delay = undefined; + this._domainName = undefined; + this._expectedCodes = undefined; + this._httpMethod = undefined; + this._maxRetries = undefined; + this._maxRetriesDown = undefined; + this._monitorPort = undefined; + this._name = undefined; + this._timeout = undefined; + this._type = undefined; + this._urlPath = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delay = value.delay; + this._domainName = value.domainName; + this._expectedCodes = value.expectedCodes; + this._httpMethod = value.httpMethod; + this._maxRetries = value.maxRetries; + this._maxRetriesDown = value.maxRetriesDown; + this._monitorPort = value.monitorPort; + this._name = value.name; + this._timeout = value.timeout; + this._type = value.type; + this._urlPath = value.urlPath; + } + } + + // delay - computed: false, optional: false, required: true + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // domain_name - computed: true, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // expected_codes - computed: true, optional: true, required: false + private _expectedCodes?: string; + public get expectedCodes() { + return this.getStringAttribute('expected_codes'); + } + public set expectedCodes(value: string) { + this._expectedCodes = value; + } + public resetExpectedCodes() { + this._expectedCodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get expectedCodesInput() { + return this._expectedCodes; + } + + // http_method - computed: true, optional: true, required: false + private _httpMethod?: string; + public get httpMethod() { + return this.getStringAttribute('http_method'); + } + public set httpMethod(value: string) { + this._httpMethod = value; + } + public resetHttpMethod() { + this._httpMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpMethodInput() { + return this._httpMethod; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_retries - computed: false, optional: false, required: true + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // max_retries_down - computed: true, optional: true, required: false + private _maxRetriesDown?: number; + public get maxRetriesDown() { + return this.getNumberAttribute('max_retries_down'); + } + public set maxRetriesDown(value: number) { + this._maxRetriesDown = value; + } + public resetMaxRetriesDown() { + this._maxRetriesDown = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesDownInput() { + return this._maxRetriesDown; + } + + // monitor_port - computed: true, optional: true, required: false + private _monitorPort?: number; + public get monitorPort() { + return this.getNumberAttribute('monitor_port'); + } + public set monitorPort(value: number) { + this._monitorPort = value; + } + public resetMonitorPort() { + this._monitorPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorPortInput() { + return this._monitorPort; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url_path - computed: true, optional: true, required: false + private _urlPath?: string; + public get urlPath() { + return this.getStringAttribute('url_path'); + } + public set urlPath(value: string) { + this._urlPath = value; + } + public resetUrlPath() { + this._urlPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlPathInput() { + return this._urlPath; + } +} +export interface ElbActiveStandbyPoolMembers { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#address ElbActiveStandbyPool#address} + */ + readonly address: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#name ElbActiveStandbyPool#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#protocol_port ElbActiveStandbyPool#protocol_port} + */ + readonly protocolPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#role ElbActiveStandbyPool#role} + */ + readonly role: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#subnet_id ElbActiveStandbyPool#subnet_id} + */ + readonly subnetId?: string; +} + +export function elbActiveStandbyPoolMembersToTerraform(struct?: ElbActiveStandbyPoolMembers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + name: cdktf.stringToTerraform(struct!.name), + protocol_port: cdktf.numberToTerraform(struct!.protocolPort), + role: cdktf.stringToTerraform(struct!.role), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function elbActiveStandbyPoolMembersToHclTerraform(struct?: ElbActiveStandbyPoolMembers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(struct!.protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + role: { + value: cdktf.stringToHclTerraform(struct!.role), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbActiveStandbyPoolMembersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbActiveStandbyPoolMembers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._protocolPort !== undefined) { + hasAnyValues = true; + internalValueResult.protocolPort = this._protocolPort; + } + if (this._role !== undefined) { + hasAnyValues = true; + internalValueResult.role = this._role; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbActiveStandbyPoolMembers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._name = undefined; + this._protocolPort = undefined; + this._role = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._name = value.name; + this._protocolPort = value.protocolPort; + this._role = value.role; + this._subnetId = value.subnetId; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + + // member_type - computed: true, optional: false, required: false + public get memberType() { + return this.getStringAttribute('member_type'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operating_status - computed: true, optional: false, required: false + public get operatingStatus() { + return this.getStringAttribute('operating_status'); + } + + // protocol_port - computed: true, optional: true, required: false + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + public resetProtocolPort() { + this._protocolPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // role - computed: false, optional: false, required: true + private _role?: string; + public get role() { + return this.getStringAttribute('role'); + } + public set role(value: string) { + this._role = value; + } + // Temporarily expose input value. Use with caution. + public get roleInput() { + return this._role; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class ElbActiveStandbyPoolMembersList extends cdktf.ComplexList { + public internalValue? : ElbActiveStandbyPoolMembers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbActiveStandbyPoolMembersOutputReference { + return new ElbActiveStandbyPoolMembersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbActiveStandbyPoolTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#create ElbActiveStandbyPool#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#delete ElbActiveStandbyPool#delete} + */ + readonly delete?: string; +} + +export function elbActiveStandbyPoolTimeoutsToTerraform(struct?: ElbActiveStandbyPoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function elbActiveStandbyPoolTimeoutsToHclTerraform(struct?: ElbActiveStandbyPoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbActiveStandbyPoolTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbActiveStandbyPoolTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbActiveStandbyPoolTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool huaweicloud_elb_active_standby_pool} +*/ +export class ElbActiveStandbyPool extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_active_standby_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbActiveStandbyPool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbActiveStandbyPool to import + * @param importFromId The id of the existing ElbActiveStandbyPool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbActiveStandbyPool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_active_standby_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_active_standby_pool huaweicloud_elb_active_standby_pool} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbActiveStandbyPoolConfig + */ + public constructor(scope: Construct, id: string, config: ElbActiveStandbyPoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_active_standby_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._anyPortEnable = config.anyPortEnable; + this._connectionDrainEnabled = config.connectionDrainEnabled; + this._connectionDrainTimeout = config.connectionDrainTimeout; + this._description = config.description; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + this._type = config.type; + this._vpcId = config.vpcId; + this._healthmonitor.internalValue = config.healthmonitor; + this._members.internalValue = config.members; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // any_port_enable - computed: true, optional: true, required: false + private _anyPortEnable?: boolean | cdktf.IResolvable; + public get anyPortEnable() { + return this.getBooleanAttribute('any_port_enable'); + } + public set anyPortEnable(value: boolean | cdktf.IResolvable) { + this._anyPortEnable = value; + } + public resetAnyPortEnable() { + this._anyPortEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get anyPortEnableInput() { + return this._anyPortEnable; + } + + // connection_drain_enabled - computed: true, optional: true, required: false + private _connectionDrainEnabled?: boolean | cdktf.IResolvable; + public get connectionDrainEnabled() { + return this.getBooleanAttribute('connection_drain_enabled'); + } + public set connectionDrainEnabled(value: boolean | cdktf.IResolvable) { + this._connectionDrainEnabled = value; + } + public resetConnectionDrainEnabled() { + this._connectionDrainEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionDrainEnabledInput() { + return this._connectionDrainEnabled; + } + + // connection_drain_timeout - computed: true, optional: true, required: false + private _connectionDrainTimeout?: number; + public get connectionDrainTimeout() { + return this.getNumberAttribute('connection_drain_timeout'); + } + public set connectionDrainTimeout(value: number) { + this._connectionDrainTimeout = value; + } + public resetConnectionDrainTimeout() { + this._connectionDrainTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionDrainTimeoutInput() { + return this._connectionDrainTimeout; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: string; + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + public set ipVersion(value: string) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // listener_id - computed: true, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // loadbalancer_id - computed: true, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // healthmonitor - computed: false, optional: false, required: true + private _healthmonitor = new ElbActiveStandbyPoolHealthmonitorOutputReference(this, "healthmonitor"); + public get healthmonitor() { + return this._healthmonitor; + } + public putHealthmonitor(value: ElbActiveStandbyPoolHealthmonitor) { + this._healthmonitor.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get healthmonitorInput() { + return this._healthmonitor.internalValue; + } + + // members - computed: false, optional: false, required: true + private _members = new ElbActiveStandbyPoolMembersList(this, "members", true); + public get members() { + return this._members; + } + public putMembers(value: ElbActiveStandbyPoolMembers[] | cdktf.IResolvable) { + this._members.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get membersInput() { + return this._members.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbActiveStandbyPoolTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbActiveStandbyPoolTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + any_port_enable: cdktf.booleanToTerraform(this._anyPortEnable), + connection_drain_enabled: cdktf.booleanToTerraform(this._connectionDrainEnabled), + connection_drain_timeout: cdktf.numberToTerraform(this._connectionDrainTimeout), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.stringToTerraform(this._ipVersion), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + healthmonitor: elbActiveStandbyPoolHealthmonitorToTerraform(this._healthmonitor.internalValue), + members: cdktf.listMapper(elbActiveStandbyPoolMembersToTerraform, true)(this._members.internalValue), + timeouts: elbActiveStandbyPoolTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + any_port_enable: { + value: cdktf.booleanToHclTerraform(this._anyPortEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + connection_drain_enabled: { + value: cdktf.booleanToHclTerraform(this._connectionDrainEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + connection_drain_timeout: { + value: cdktf.numberToHclTerraform(this._connectionDrainTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.stringToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + healthmonitor: { + value: elbActiveStandbyPoolHealthmonitorToHclTerraform(this._healthmonitor.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbActiveStandbyPoolHealthmonitorList", + }, + members: { + value: cdktf.listMapperHcl(elbActiveStandbyPoolMembersToHclTerraform, true)(this._members.internalValue), + isBlock: true, + type: "set", + storageClassType: "ElbActiveStandbyPoolMembersList", + }, + timeouts: { + value: elbActiveStandbyPoolTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbActiveStandbyPoolTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/README.md b/src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/README.md new file mode 100644 index 00000000..b9276461 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_certificate_private_key_echo` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_certificate_private_key_echo`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo). diff --git a/src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/index.ts b/src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/index.ts new file mode 100644 index 00000000..bf17d3ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-certificate-private-key-echo/index.ts @@ -0,0 +1,144 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbCertificatePrivateKeyEchoConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo#id ElbCertificatePrivateKeyEcho#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo#region ElbCertificatePrivateKeyEcho#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo huaweicloud_elb_certificate_private_key_echo} +*/ +export class ElbCertificatePrivateKeyEcho extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_certificate_private_key_echo"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbCertificatePrivateKeyEcho resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbCertificatePrivateKeyEcho to import + * @param importFromId The id of the existing ElbCertificatePrivateKeyEcho that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbCertificatePrivateKeyEcho to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_certificate_private_key_echo", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate_private_key_echo huaweicloud_elb_certificate_private_key_echo} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbCertificatePrivateKeyEchoConfig = {} + */ + public constructor(scope: Construct, id: string, config: ElbCertificatePrivateKeyEchoConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_certificate_private_key_echo', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-certificate/README.md b/src/constructs/providers/huaweicloud/elb-certificate/README.md new file mode 100644 index 00000000..8f7ee66a --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate). diff --git a/src/constructs/providers/huaweicloud/elb-certificate/index.ts b/src/constructs/providers/huaweicloud/elb-certificate/index.ts new file mode 100644 index 00000000..01dbdfca --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-certificate/index.ts @@ -0,0 +1,352 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#certificate ElbCertificate#certificate} + */ + readonly certificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#description ElbCertificate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#domain ElbCertificate#domain} + */ + readonly domain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#enterprise_project_id ElbCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#id ElbCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#name ElbCertificate#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#private_key ElbCertificate#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#region ElbCertificate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#type ElbCertificate#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate huaweicloud_elb_certificate} +*/ +export class ElbCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbCertificate to import + * @param importFromId The id of the existing ElbCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_certificate huaweicloud_elb_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbCertificateConfig + */ + public constructor(scope: Construct, id: string, config: ElbCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificate = config.certificate; + this._description = config.description; + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate - computed: false, optional: false, required: true + private _certificate?: string; + public get certificate() { + return this.getStringAttribute('certificate'); + } + public set certificate(value: string) { + this._certificate = value; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate: cdktf.stringToTerraform(this._certificate), + description: cdktf.stringToTerraform(this._description), + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate: { + value: cdktf.stringToHclTerraform(this._certificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-ipgroup/README.md b/src/constructs/providers/huaweicloud/elb-ipgroup/README.md new file mode 100644 index 00000000..4f3eb2bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-ipgroup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_ipgroup` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_ipgroup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup). diff --git a/src/constructs/providers/huaweicloud/elb-ipgroup/index.ts b/src/constructs/providers/huaweicloud/elb-ipgroup/index.ts new file mode 100644 index 00000000..8449a312 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-ipgroup/index.ts @@ -0,0 +1,413 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbIpgroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#description ElbIpgroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#enterprise_project_id ElbIpgroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#id ElbIpgroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#name ElbIpgroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#region ElbIpgroup#region} + */ + readonly region?: string; + /** + * ip_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#ip_list ElbIpgroup#ip_list} + */ + readonly ipList: ElbIpgroupIpListStruct[] | cdktf.IResolvable; +} +export interface ElbIpgroupIpListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#description ElbIpgroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#ip ElbIpgroup#ip} + */ + readonly ip: string; +} + +export function elbIpgroupIpListStructToTerraform(struct?: ElbIpgroupIpListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + ip: cdktf.stringToTerraform(struct!.ip), + } +} + + +export function elbIpgroupIpListStructToHclTerraform(struct?: ElbIpgroupIpListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbIpgroupIpListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbIpgroupIpListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbIpgroupIpListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._ip = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._ip = value.ip; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } +} + +export class ElbIpgroupIpListStructList extends cdktf.ComplexList { + public internalValue? : ElbIpgroupIpListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbIpgroupIpListStructOutputReference { + return new ElbIpgroupIpListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup huaweicloud_elb_ipgroup} +*/ +export class ElbIpgroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_ipgroup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbIpgroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbIpgroup to import + * @param importFromId The id of the existing ElbIpgroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbIpgroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_ipgroup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_ipgroup huaweicloud_elb_ipgroup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbIpgroupConfig + */ + public constructor(scope: Construct, id: string, config: ElbIpgroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_ipgroup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._ipList.internalValue = config.ipList; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_ids - computed: true, optional: false, required: false + public get listenerIds() { + return this.getListAttribute('listener_ids'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ip_list - computed: false, optional: false, required: true + private _ipList = new ElbIpgroupIpListStructList(this, "ip_list", false); + public get ipList() { + return this._ipList; + } + public putIpList(value: ElbIpgroupIpListStruct[] | cdktf.IResolvable) { + this._ipList.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get ipListInput() { + return this._ipList.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + ip_list: cdktf.listMapper(elbIpgroupIpListStructToTerraform, true)(this._ipList.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_list: { + value: cdktf.listMapperHcl(elbIpgroupIpListStructToHclTerraform, true)(this._ipList.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbIpgroupIpListStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-l7policy/README.md b/src/constructs/providers/huaweicloud/elb-l7policy/README.md new file mode 100644 index 00000000..ad4bf6e0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-l7policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_l7policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_l7policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy). diff --git a/src/constructs/providers/huaweicloud/elb-l7policy/index.ts b/src/constructs/providers/huaweicloud/elb-l7policy/index.ts new file mode 100644 index 00000000..97bc192e --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-l7policy/index.ts @@ -0,0 +1,3553 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbL7PolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#action ElbL7Policy#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#description ElbL7Policy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#id ElbL7Policy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#listener_id ElbL7Policy#listener_id} + */ + readonly listenerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#name ElbL7Policy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#priority ElbL7Policy#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#redirect_listener_id ElbL7Policy#redirect_listener_id} + */ + readonly redirectListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#redirect_pool_id ElbL7Policy#redirect_pool_id} + */ + readonly redirectPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#region ElbL7Policy#region} + */ + readonly region?: string; + /** + * fixed_response_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#fixed_response_config ElbL7Policy#fixed_response_config} + */ + readonly fixedResponseConfig?: ElbL7PolicyFixedResponseConfig; + /** + * redirect_pools_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#redirect_pools_config ElbL7Policy#redirect_pools_config} + */ + readonly redirectPoolsConfig?: ElbL7PolicyRedirectPoolsConfig[] | cdktf.IResolvable; + /** + * redirect_pools_extend_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#redirect_pools_extend_config ElbL7Policy#redirect_pools_extend_config} + */ + readonly redirectPoolsExtendConfig?: ElbL7PolicyRedirectPoolsExtendConfig; + /** + * redirect_pools_sticky_session_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#redirect_pools_sticky_session_config ElbL7Policy#redirect_pools_sticky_session_config} + */ + readonly redirectPoolsStickySessionConfig?: ElbL7PolicyRedirectPoolsStickySessionConfig; + /** + * redirect_url_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#redirect_url_config ElbL7Policy#redirect_url_config} + */ + readonly redirectUrlConfig?: ElbL7PolicyRedirectUrlConfig; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#timeouts ElbL7Policy#timeouts} + */ + readonly timeouts?: ElbL7PolicyTimeouts; +} +export interface ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#key ElbL7Policy#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#value ElbL7Policy#value} + */ + readonly value: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#value_type ElbL7Policy#value_type} + */ + readonly valueType: string; +} + +export function elbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsToTerraform(struct?: ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + value_type: cdktf.stringToTerraform(struct!.valueType), + } +} + + +export function elbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsToHclTerraform(struct?: ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_type: { + value: cdktf.stringToHclTerraform(struct!.valueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + if (this._valueType !== undefined) { + hasAnyValues = true; + internalValueResult.valueType = this._valueType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + this._valueType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + this._valueType = value.valueType; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // value_type - computed: false, optional: false, required: true + private _valueType?: string; + public get valueType() { + return this.getStringAttribute('value_type'); + } + public set valueType(value: string) { + this._valueType = value; + } + // Temporarily expose input value. Use with caution. + public get valueTypeInput() { + return this._valueType; + } +} + +export class ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsOutputReference { + return new ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyFixedResponseConfigInsertHeadersConfig { + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#configs ElbL7Policy#configs} + */ + readonly configs: ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable; +} + +export function elbL7PolicyFixedResponseConfigInsertHeadersConfigToTerraform(struct?: ElbL7PolicyFixedResponseConfigInsertHeadersConfigOutputReference | ElbL7PolicyFixedResponseConfigInsertHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configs: cdktf.listMapper(elbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsToTerraform, true)(struct!.configs), + } +} + + +export function elbL7PolicyFixedResponseConfigInsertHeadersConfigToHclTerraform(struct?: ElbL7PolicyFixedResponseConfigInsertHeadersConfigOutputReference | ElbL7PolicyFixedResponseConfigInsertHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configs: { + value: cdktf.listMapperHcl(elbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyFixedResponseConfigInsertHeadersConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyFixedResponseConfigInsertHeadersConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyFixedResponseConfigInsertHeadersConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._configs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._configs.internalValue = value.configs; + } + } + + // configs - computed: false, optional: false, required: true + private _configs = new ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: ElbL7PolicyFixedResponseConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} +export interface ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#key ElbL7Policy#key} + */ + readonly key: string; +} + +export function elbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsToTerraform(struct?: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + } +} + + +export function elbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsToHclTerraform(struct?: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } +} + +export class ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsOutputReference { + return new ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyFixedResponseConfigRemoveHeadersConfig { + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#configs ElbL7Policy#configs} + */ + readonly configs: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable; +} + +export function elbL7PolicyFixedResponseConfigRemoveHeadersConfigToTerraform(struct?: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigOutputReference | ElbL7PolicyFixedResponseConfigRemoveHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configs: cdktf.listMapper(elbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsToTerraform, true)(struct!.configs), + } +} + + +export function elbL7PolicyFixedResponseConfigRemoveHeadersConfigToHclTerraform(struct?: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigOutputReference | ElbL7PolicyFixedResponseConfigRemoveHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configs: { + value: cdktf.listMapperHcl(elbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyFixedResponseConfigRemoveHeadersConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyFixedResponseConfigRemoveHeadersConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyFixedResponseConfigRemoveHeadersConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._configs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._configs.internalValue = value.configs; + } + } + + // configs - computed: false, optional: false, required: true + private _configs = new ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: ElbL7PolicyFixedResponseConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} +export interface ElbL7PolicyFixedResponseConfigTrafficLimitConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#burst ElbL7Policy#burst} + */ + readonly burst?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#per_source_ip_qps ElbL7Policy#per_source_ip_qps} + */ + readonly perSourceIpQps?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#qps ElbL7Policy#qps} + */ + readonly qps?: number; +} + +export function elbL7PolicyFixedResponseConfigTrafficLimitConfigToTerraform(struct?: ElbL7PolicyFixedResponseConfigTrafficLimitConfigOutputReference | ElbL7PolicyFixedResponseConfigTrafficLimitConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + burst: cdktf.numberToTerraform(struct!.burst), + per_source_ip_qps: cdktf.numberToTerraform(struct!.perSourceIpQps), + qps: cdktf.numberToTerraform(struct!.qps), + } +} + + +export function elbL7PolicyFixedResponseConfigTrafficLimitConfigToHclTerraform(struct?: ElbL7PolicyFixedResponseConfigTrafficLimitConfigOutputReference | ElbL7PolicyFixedResponseConfigTrafficLimitConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + burst: { + value: cdktf.numberToHclTerraform(struct!.burst), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + per_source_ip_qps: { + value: cdktf.numberToHclTerraform(struct!.perSourceIpQps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + qps: { + value: cdktf.numberToHclTerraform(struct!.qps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyFixedResponseConfigTrafficLimitConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyFixedResponseConfigTrafficLimitConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._burst !== undefined) { + hasAnyValues = true; + internalValueResult.burst = this._burst; + } + if (this._perSourceIpQps !== undefined) { + hasAnyValues = true; + internalValueResult.perSourceIpQps = this._perSourceIpQps; + } + if (this._qps !== undefined) { + hasAnyValues = true; + internalValueResult.qps = this._qps; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyFixedResponseConfigTrafficLimitConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._burst = undefined; + this._perSourceIpQps = undefined; + this._qps = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._burst = value.burst; + this._perSourceIpQps = value.perSourceIpQps; + this._qps = value.qps; + } + } + + // burst - computed: false, optional: true, required: false + private _burst?: number; + public get burst() { + return this.getNumberAttribute('burst'); + } + public set burst(value: number) { + this._burst = value; + } + public resetBurst() { + this._burst = undefined; + } + // Temporarily expose input value. Use with caution. + public get burstInput() { + return this._burst; + } + + // per_source_ip_qps - computed: false, optional: true, required: false + private _perSourceIpQps?: number; + public get perSourceIpQps() { + return this.getNumberAttribute('per_source_ip_qps'); + } + public set perSourceIpQps(value: number) { + this._perSourceIpQps = value; + } + public resetPerSourceIpQps() { + this._perSourceIpQps = undefined; + } + // Temporarily expose input value. Use with caution. + public get perSourceIpQpsInput() { + return this._perSourceIpQps; + } + + // qps - computed: false, optional: true, required: false + private _qps?: number; + public get qps() { + return this.getNumberAttribute('qps'); + } + public set qps(value: number) { + this._qps = value; + } + public resetQps() { + this._qps = undefined; + } + // Temporarily expose input value. Use with caution. + public get qpsInput() { + return this._qps; + } +} +export interface ElbL7PolicyFixedResponseConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#content_type ElbL7Policy#content_type} + */ + readonly contentType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#message_body ElbL7Policy#message_body} + */ + readonly messageBody?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#status_code ElbL7Policy#status_code} + */ + readonly statusCode: string; + /** + * insert_headers_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#insert_headers_config ElbL7Policy#insert_headers_config} + */ + readonly insertHeadersConfig?: ElbL7PolicyFixedResponseConfigInsertHeadersConfig; + /** + * remove_headers_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#remove_headers_config ElbL7Policy#remove_headers_config} + */ + readonly removeHeadersConfig?: ElbL7PolicyFixedResponseConfigRemoveHeadersConfig; + /** + * traffic_limit_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#traffic_limit_config ElbL7Policy#traffic_limit_config} + */ + readonly trafficLimitConfig?: ElbL7PolicyFixedResponseConfigTrafficLimitConfig; +} + +export function elbL7PolicyFixedResponseConfigToTerraform(struct?: ElbL7PolicyFixedResponseConfigOutputReference | ElbL7PolicyFixedResponseConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content_type: cdktf.stringToTerraform(struct!.contentType), + message_body: cdktf.stringToTerraform(struct!.messageBody), + status_code: cdktf.stringToTerraform(struct!.statusCode), + insert_headers_config: elbL7PolicyFixedResponseConfigInsertHeadersConfigToTerraform(struct!.insertHeadersConfig), + remove_headers_config: elbL7PolicyFixedResponseConfigRemoveHeadersConfigToTerraform(struct!.removeHeadersConfig), + traffic_limit_config: elbL7PolicyFixedResponseConfigTrafficLimitConfigToTerraform(struct!.trafficLimitConfig), + } +} + + +export function elbL7PolicyFixedResponseConfigToHclTerraform(struct?: ElbL7PolicyFixedResponseConfigOutputReference | ElbL7PolicyFixedResponseConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content_type: { + value: cdktf.stringToHclTerraform(struct!.contentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_body: { + value: cdktf.stringToHclTerraform(struct!.messageBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.stringToHclTerraform(struct!.statusCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + insert_headers_config: { + value: elbL7PolicyFixedResponseConfigInsertHeadersConfigToHclTerraform(struct!.insertHeadersConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyFixedResponseConfigInsertHeadersConfigList", + }, + remove_headers_config: { + value: elbL7PolicyFixedResponseConfigRemoveHeadersConfigToHclTerraform(struct!.removeHeadersConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyFixedResponseConfigRemoveHeadersConfigList", + }, + traffic_limit_config: { + value: elbL7PolicyFixedResponseConfigTrafficLimitConfigToHclTerraform(struct!.trafficLimitConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyFixedResponseConfigTrafficLimitConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyFixedResponseConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyFixedResponseConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._contentType !== undefined) { + hasAnyValues = true; + internalValueResult.contentType = this._contentType; + } + if (this._messageBody !== undefined) { + hasAnyValues = true; + internalValueResult.messageBody = this._messageBody; + } + if (this._statusCode !== undefined) { + hasAnyValues = true; + internalValueResult.statusCode = this._statusCode; + } + if (this._insertHeadersConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.insertHeadersConfig = this._insertHeadersConfig?.internalValue; + } + if (this._removeHeadersConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.removeHeadersConfig = this._removeHeadersConfig?.internalValue; + } + if (this._trafficLimitConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.trafficLimitConfig = this._trafficLimitConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyFixedResponseConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._contentType = undefined; + this._messageBody = undefined; + this._statusCode = undefined; + this._insertHeadersConfig.internalValue = undefined; + this._removeHeadersConfig.internalValue = undefined; + this._trafficLimitConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._contentType = value.contentType; + this._messageBody = value.messageBody; + this._statusCode = value.statusCode; + this._insertHeadersConfig.internalValue = value.insertHeadersConfig; + this._removeHeadersConfig.internalValue = value.removeHeadersConfig; + this._trafficLimitConfig.internalValue = value.trafficLimitConfig; + } + } + + // content_type - computed: true, optional: true, required: false + private _contentType?: string; + public get contentType() { + return this.getStringAttribute('content_type'); + } + public set contentType(value: string) { + this._contentType = value; + } + public resetContentType() { + this._contentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentTypeInput() { + return this._contentType; + } + + // message_body - computed: false, optional: true, required: false + private _messageBody?: string; + public get messageBody() { + return this.getStringAttribute('message_body'); + } + public set messageBody(value: string) { + this._messageBody = value; + } + public resetMessageBody() { + this._messageBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageBodyInput() { + return this._messageBody; + } + + // status_code - computed: false, optional: false, required: true + private _statusCode?: string; + public get statusCode() { + return this.getStringAttribute('status_code'); + } + public set statusCode(value: string) { + this._statusCode = value; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } + + // insert_headers_config - computed: false, optional: true, required: false + private _insertHeadersConfig = new ElbL7PolicyFixedResponseConfigInsertHeadersConfigOutputReference(this, "insert_headers_config"); + public get insertHeadersConfig() { + return this._insertHeadersConfig; + } + public putInsertHeadersConfig(value: ElbL7PolicyFixedResponseConfigInsertHeadersConfig) { + this._insertHeadersConfig.internalValue = value; + } + public resetInsertHeadersConfig() { + this._insertHeadersConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get insertHeadersConfigInput() { + return this._insertHeadersConfig.internalValue; + } + + // remove_headers_config - computed: false, optional: true, required: false + private _removeHeadersConfig = new ElbL7PolicyFixedResponseConfigRemoveHeadersConfigOutputReference(this, "remove_headers_config"); + public get removeHeadersConfig() { + return this._removeHeadersConfig; + } + public putRemoveHeadersConfig(value: ElbL7PolicyFixedResponseConfigRemoveHeadersConfig) { + this._removeHeadersConfig.internalValue = value; + } + public resetRemoveHeadersConfig() { + this._removeHeadersConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get removeHeadersConfigInput() { + return this._removeHeadersConfig.internalValue; + } + + // traffic_limit_config - computed: false, optional: true, required: false + private _trafficLimitConfig = new ElbL7PolicyFixedResponseConfigTrafficLimitConfigOutputReference(this, "traffic_limit_config"); + public get trafficLimitConfig() { + return this._trafficLimitConfig; + } + public putTrafficLimitConfig(value: ElbL7PolicyFixedResponseConfigTrafficLimitConfig) { + this._trafficLimitConfig.internalValue = value; + } + public resetTrafficLimitConfig() { + this._trafficLimitConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficLimitConfigInput() { + return this._trafficLimitConfig.internalValue; + } +} +export interface ElbL7PolicyRedirectPoolsConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#pool_id ElbL7Policy#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#weight ElbL7Policy#weight} + */ + readonly weight?: number; +} + +export function elbL7PolicyRedirectPoolsConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsConfig | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + pool_id: cdktf.stringToTerraform(struct!.poolId), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function elbL7PolicyRedirectPoolsConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsConfig | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + pool_id: { + value: cdktf.stringToHclTerraform(struct!.poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsConfig | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._poolId !== undefined) { + hasAnyValues = true; + internalValueResult.poolId = this._poolId; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsConfig | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._poolId = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._poolId = value.poolId; + this._weight = value.weight; + } + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class ElbL7PolicyRedirectPoolsConfigList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyRedirectPoolsConfig[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyRedirectPoolsConfigOutputReference { + return new ElbL7PolicyRedirectPoolsConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#key ElbL7Policy#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#value ElbL7Policy#value} + */ + readonly value: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#value_type ElbL7Policy#value_type} + */ + readonly valueType: string; +} + +export function elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + value_type: cdktf.stringToTerraform(struct!.valueType), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_type: { + value: cdktf.stringToHclTerraform(struct!.valueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + if (this._valueType !== undefined) { + hasAnyValues = true; + internalValueResult.valueType = this._valueType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + this._valueType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + this._valueType = value.valueType; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // value_type - computed: false, optional: false, required: true + private _valueType?: string; + public get valueType() { + return this.getStringAttribute('value_type'); + } + public set valueType(value: string) { + this._valueType = value; + } + // Temporarily expose input value. Use with caution. + public get valueTypeInput() { + return this._valueType; + } +} + +export class ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsOutputReference { + return new ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig { + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#configs ElbL7Policy#configs} + */ + readonly configs: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable; +} + +export function elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configs: cdktf.listMapper(elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsToTerraform, true)(struct!.configs), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configs: { + value: cdktf.listMapperHcl(elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._configs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._configs.internalValue = value.configs; + } + } + + // configs - computed: false, optional: false, required: true + private _configs = new ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#key ElbL7Policy#key} + */ + readonly key: string; +} + +export function elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } +} + +export class ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsOutputReference { + return new ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig { + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#configs ElbL7Policy#configs} + */ + readonly configs: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable; +} + +export function elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configs: cdktf.listMapper(elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsToTerraform, true)(struct!.configs), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configs: { + value: cdktf.listMapperHcl(elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._configs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._configs.internalValue = value.configs; + } + } + + // configs - computed: false, optional: false, required: true + private _configs = new ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#host ElbL7Policy#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#path ElbL7Policy#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#query ElbL7Policy#query} + */ + readonly query?: string; +} + +export function elbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + query: cdktf.stringToTerraform(struct!.query), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query: { + value: cdktf.stringToHclTerraform(struct!.query), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._query !== undefined) { + hasAnyValues = true; + internalValueResult.query = this._query; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._host = undefined; + this._path = undefined; + this._query = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._host = value.host; + this._path = value.path; + this._query = value.query; + } + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // query - computed: false, optional: true, required: false + private _query?: string; + public get query() { + return this.getStringAttribute('query'); + } + public set query(value: string) { + this._query = value; + } + public resetQuery() { + this._query = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryInput() { + return this._query; + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#burst ElbL7Policy#burst} + */ + readonly burst?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#per_source_ip_qps ElbL7Policy#per_source_ip_qps} + */ + readonly perSourceIpQps?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#qps ElbL7Policy#qps} + */ + readonly qps?: number; +} + +export function elbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + burst: cdktf.numberToTerraform(struct!.burst), + per_source_ip_qps: cdktf.numberToTerraform(struct!.perSourceIpQps), + qps: cdktf.numberToTerraform(struct!.qps), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + burst: { + value: cdktf.numberToHclTerraform(struct!.burst), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + per_source_ip_qps: { + value: cdktf.numberToHclTerraform(struct!.perSourceIpQps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + qps: { + value: cdktf.numberToHclTerraform(struct!.qps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._burst !== undefined) { + hasAnyValues = true; + internalValueResult.burst = this._burst; + } + if (this._perSourceIpQps !== undefined) { + hasAnyValues = true; + internalValueResult.perSourceIpQps = this._perSourceIpQps; + } + if (this._qps !== undefined) { + hasAnyValues = true; + internalValueResult.qps = this._qps; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._burst = undefined; + this._perSourceIpQps = undefined; + this._qps = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._burst = value.burst; + this._perSourceIpQps = value.perSourceIpQps; + this._qps = value.qps; + } + } + + // burst - computed: false, optional: true, required: false + private _burst?: number; + public get burst() { + return this.getNumberAttribute('burst'); + } + public set burst(value: number) { + this._burst = value; + } + public resetBurst() { + this._burst = undefined; + } + // Temporarily expose input value. Use with caution. + public get burstInput() { + return this._burst; + } + + // per_source_ip_qps - computed: false, optional: true, required: false + private _perSourceIpQps?: number; + public get perSourceIpQps() { + return this.getNumberAttribute('per_source_ip_qps'); + } + public set perSourceIpQps(value: number) { + this._perSourceIpQps = value; + } + public resetPerSourceIpQps() { + this._perSourceIpQps = undefined; + } + // Temporarily expose input value. Use with caution. + public get perSourceIpQpsInput() { + return this._perSourceIpQps; + } + + // qps - computed: false, optional: true, required: false + private _qps?: number; + public get qps() { + return this.getNumberAttribute('qps'); + } + public set qps(value: number) { + this._qps = value; + } + public resetQps() { + this._qps = undefined; + } + // Temporarily expose input value. Use with caution. + public get qpsInput() { + return this._qps; + } +} +export interface ElbL7PolicyRedirectPoolsExtendConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#rewrite_url_enabled ElbL7Policy#rewrite_url_enabled} + */ + readonly rewriteUrlEnabled?: boolean | cdktf.IResolvable; + /** + * insert_headers_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#insert_headers_config ElbL7Policy#insert_headers_config} + */ + readonly insertHeadersConfig?: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig; + /** + * remove_headers_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#remove_headers_config ElbL7Policy#remove_headers_config} + */ + readonly removeHeadersConfig?: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig; + /** + * rewrite_url_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#rewrite_url_config ElbL7Policy#rewrite_url_config} + */ + readonly rewriteUrlConfig?: ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig; + /** + * traffic_limit_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#traffic_limit_config ElbL7Policy#traffic_limit_config} + */ + readonly trafficLimitConfig?: ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig; +} + +export function elbL7PolicyRedirectPoolsExtendConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + rewrite_url_enabled: cdktf.booleanToTerraform(struct!.rewriteUrlEnabled), + insert_headers_config: elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigToTerraform(struct!.insertHeadersConfig), + remove_headers_config: elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigToTerraform(struct!.removeHeadersConfig), + rewrite_url_config: elbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigToTerraform(struct!.rewriteUrlConfig), + traffic_limit_config: elbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigToTerraform(struct!.trafficLimitConfig), + } +} + + +export function elbL7PolicyRedirectPoolsExtendConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsExtendConfigOutputReference | ElbL7PolicyRedirectPoolsExtendConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + rewrite_url_enabled: { + value: cdktf.booleanToHclTerraform(struct!.rewriteUrlEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + insert_headers_config: { + value: elbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigToHclTerraform(struct!.insertHeadersConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigList", + }, + remove_headers_config: { + value: elbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigToHclTerraform(struct!.removeHeadersConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigList", + }, + rewrite_url_config: { + value: elbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigToHclTerraform(struct!.rewriteUrlConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigList", + }, + traffic_limit_config: { + value: elbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigToHclTerraform(struct!.trafficLimitConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsExtendConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsExtendConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._rewriteUrlEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.rewriteUrlEnabled = this._rewriteUrlEnabled; + } + if (this._insertHeadersConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.insertHeadersConfig = this._insertHeadersConfig?.internalValue; + } + if (this._removeHeadersConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.removeHeadersConfig = this._removeHeadersConfig?.internalValue; + } + if (this._rewriteUrlConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.rewriteUrlConfig = this._rewriteUrlConfig?.internalValue; + } + if (this._trafficLimitConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.trafficLimitConfig = this._trafficLimitConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsExtendConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._rewriteUrlEnabled = undefined; + this._insertHeadersConfig.internalValue = undefined; + this._removeHeadersConfig.internalValue = undefined; + this._rewriteUrlConfig.internalValue = undefined; + this._trafficLimitConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._rewriteUrlEnabled = value.rewriteUrlEnabled; + this._insertHeadersConfig.internalValue = value.insertHeadersConfig; + this._removeHeadersConfig.internalValue = value.removeHeadersConfig; + this._rewriteUrlConfig.internalValue = value.rewriteUrlConfig; + this._trafficLimitConfig.internalValue = value.trafficLimitConfig; + } + } + + // rewrite_url_enabled - computed: true, optional: true, required: false + private _rewriteUrlEnabled?: boolean | cdktf.IResolvable; + public get rewriteUrlEnabled() { + return this.getBooleanAttribute('rewrite_url_enabled'); + } + public set rewriteUrlEnabled(value: boolean | cdktf.IResolvable) { + this._rewriteUrlEnabled = value; + } + public resetRewriteUrlEnabled() { + this._rewriteUrlEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get rewriteUrlEnabledInput() { + return this._rewriteUrlEnabled; + } + + // insert_headers_config - computed: false, optional: true, required: false + private _insertHeadersConfig = new ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfigOutputReference(this, "insert_headers_config"); + public get insertHeadersConfig() { + return this._insertHeadersConfig; + } + public putInsertHeadersConfig(value: ElbL7PolicyRedirectPoolsExtendConfigInsertHeadersConfig) { + this._insertHeadersConfig.internalValue = value; + } + public resetInsertHeadersConfig() { + this._insertHeadersConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get insertHeadersConfigInput() { + return this._insertHeadersConfig.internalValue; + } + + // remove_headers_config - computed: false, optional: true, required: false + private _removeHeadersConfig = new ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfigOutputReference(this, "remove_headers_config"); + public get removeHeadersConfig() { + return this._removeHeadersConfig; + } + public putRemoveHeadersConfig(value: ElbL7PolicyRedirectPoolsExtendConfigRemoveHeadersConfig) { + this._removeHeadersConfig.internalValue = value; + } + public resetRemoveHeadersConfig() { + this._removeHeadersConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get removeHeadersConfigInput() { + return this._removeHeadersConfig.internalValue; + } + + // rewrite_url_config - computed: false, optional: true, required: false + private _rewriteUrlConfig = new ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfigOutputReference(this, "rewrite_url_config"); + public get rewriteUrlConfig() { + return this._rewriteUrlConfig; + } + public putRewriteUrlConfig(value: ElbL7PolicyRedirectPoolsExtendConfigRewriteUrlConfig) { + this._rewriteUrlConfig.internalValue = value; + } + public resetRewriteUrlConfig() { + this._rewriteUrlConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get rewriteUrlConfigInput() { + return this._rewriteUrlConfig.internalValue; + } + + // traffic_limit_config - computed: false, optional: true, required: false + private _trafficLimitConfig = new ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfigOutputReference(this, "traffic_limit_config"); + public get trafficLimitConfig() { + return this._trafficLimitConfig; + } + public putTrafficLimitConfig(value: ElbL7PolicyRedirectPoolsExtendConfigTrafficLimitConfig) { + this._trafficLimitConfig.internalValue = value; + } + public resetTrafficLimitConfig() { + this._trafficLimitConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficLimitConfigInput() { + return this._trafficLimitConfig.internalValue; + } +} +export interface ElbL7PolicyRedirectPoolsStickySessionConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#enable ElbL7Policy#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#timeout ElbL7Policy#timeout} + */ + readonly timeout?: number; +} + +export function elbL7PolicyRedirectPoolsStickySessionConfigToTerraform(struct?: ElbL7PolicyRedirectPoolsStickySessionConfigOutputReference | ElbL7PolicyRedirectPoolsStickySessionConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable: cdktf.booleanToTerraform(struct!.enable), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function elbL7PolicyRedirectPoolsStickySessionConfigToHclTerraform(struct?: ElbL7PolicyRedirectPoolsStickySessionConfigOutputReference | ElbL7PolicyRedirectPoolsStickySessionConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectPoolsStickySessionConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectPoolsStickySessionConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectPoolsStickySessionConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enable = undefined; + this._timeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enable = value.enable; + this._timeout = value.timeout; + } + } + + // enable - computed: true, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} +export interface ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#key ElbL7Policy#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#value ElbL7Policy#value} + */ + readonly value: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#value_type ElbL7Policy#value_type} + */ + readonly valueType: string; +} + +export function elbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsToTerraform(struct?: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + value_type: cdktf.stringToTerraform(struct!.valueType), + } +} + + +export function elbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsToHclTerraform(struct?: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_type: { + value: cdktf.stringToHclTerraform(struct!.valueType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + if (this._valueType !== undefined) { + hasAnyValues = true; + internalValueResult.valueType = this._valueType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + this._valueType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + this._valueType = value.valueType; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // value_type - computed: false, optional: false, required: true + private _valueType?: string; + public get valueType() { + return this.getStringAttribute('value_type'); + } + public set valueType(value: string) { + this._valueType = value; + } + // Temporarily expose input value. Use with caution. + public get valueTypeInput() { + return this._valueType; + } +} + +export class ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsOutputReference { + return new ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyRedirectUrlConfigInsertHeadersConfig { + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#configs ElbL7Policy#configs} + */ + readonly configs: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable; +} + +export function elbL7PolicyRedirectUrlConfigInsertHeadersConfigToTerraform(struct?: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigOutputReference | ElbL7PolicyRedirectUrlConfigInsertHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configs: cdktf.listMapper(elbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsToTerraform, true)(struct!.configs), + } +} + + +export function elbL7PolicyRedirectUrlConfigInsertHeadersConfigToHclTerraform(struct?: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigOutputReference | ElbL7PolicyRedirectUrlConfigInsertHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configs: { + value: cdktf.listMapperHcl(elbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectUrlConfigInsertHeadersConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectUrlConfigInsertHeadersConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectUrlConfigInsertHeadersConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._configs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._configs.internalValue = value.configs; + } + } + + // configs - computed: false, optional: false, required: true + private _configs = new ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: ElbL7PolicyRedirectUrlConfigInsertHeadersConfigConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} +export interface ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#key ElbL7Policy#key} + */ + readonly key: string; +} + +export function elbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsToTerraform(struct?: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + } +} + + +export function elbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsToHclTerraform(struct?: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } +} + +export class ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsList extends cdktf.ComplexList { + public internalValue? : ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsOutputReference { + return new ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig { + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#configs ElbL7Policy#configs} + */ + readonly configs: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable; +} + +export function elbL7PolicyRedirectUrlConfigRemoveHeadersConfigToTerraform(struct?: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigOutputReference | ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + configs: cdktf.listMapper(elbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsToTerraform, true)(struct!.configs), + } +} + + +export function elbL7PolicyRedirectUrlConfigRemoveHeadersConfigToHclTerraform(struct?: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigOutputReference | ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + configs: { + value: cdktf.listMapperHcl(elbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._configs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._configs.internalValue = value.configs; + } + } + + // configs - computed: false, optional: false, required: true + private _configs = new ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigsList(this, "configs", true); + public get configs() { + return this._configs; + } + public putConfigs(value: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} +export interface ElbL7PolicyRedirectUrlConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#host ElbL7Policy#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#path ElbL7Policy#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#port ElbL7Policy#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#protocol ElbL7Policy#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#query ElbL7Policy#query} + */ + readonly query?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#status_code ElbL7Policy#status_code} + */ + readonly statusCode: string; + /** + * insert_headers_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#insert_headers_config ElbL7Policy#insert_headers_config} + */ + readonly insertHeadersConfig?: ElbL7PolicyRedirectUrlConfigInsertHeadersConfig; + /** + * remove_headers_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#remove_headers_config ElbL7Policy#remove_headers_config} + */ + readonly removeHeadersConfig?: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig; +} + +export function elbL7PolicyRedirectUrlConfigToTerraform(struct?: ElbL7PolicyRedirectUrlConfigOutputReference | ElbL7PolicyRedirectUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.stringToTerraform(struct!.port), + protocol: cdktf.stringToTerraform(struct!.protocol), + query: cdktf.stringToTerraform(struct!.query), + status_code: cdktf.stringToTerraform(struct!.statusCode), + insert_headers_config: elbL7PolicyRedirectUrlConfigInsertHeadersConfigToTerraform(struct!.insertHeadersConfig), + remove_headers_config: elbL7PolicyRedirectUrlConfigRemoveHeadersConfigToTerraform(struct!.removeHeadersConfig), + } +} + + +export function elbL7PolicyRedirectUrlConfigToHclTerraform(struct?: ElbL7PolicyRedirectUrlConfigOutputReference | ElbL7PolicyRedirectUrlConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query: { + value: cdktf.stringToHclTerraform(struct!.query), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.stringToHclTerraform(struct!.statusCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + insert_headers_config: { + value: elbL7PolicyRedirectUrlConfigInsertHeadersConfigToHclTerraform(struct!.insertHeadersConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectUrlConfigInsertHeadersConfigList", + }, + remove_headers_config: { + value: elbL7PolicyRedirectUrlConfigRemoveHeadersConfigToHclTerraform(struct!.removeHeadersConfig), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyRedirectUrlConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbL7PolicyRedirectUrlConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._query !== undefined) { + hasAnyValues = true; + internalValueResult.query = this._query; + } + if (this._statusCode !== undefined) { + hasAnyValues = true; + internalValueResult.statusCode = this._statusCode; + } + if (this._insertHeadersConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.insertHeadersConfig = this._insertHeadersConfig?.internalValue; + } + if (this._removeHeadersConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.removeHeadersConfig = this._removeHeadersConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyRedirectUrlConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._protocol = undefined; + this._query = undefined; + this._statusCode = undefined; + this._insertHeadersConfig.internalValue = undefined; + this._removeHeadersConfig.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._protocol = value.protocol; + this._query = value.query; + this._statusCode = value.statusCode; + this._insertHeadersConfig.internalValue = value.insertHeadersConfig; + this._removeHeadersConfig.internalValue = value.removeHeadersConfig; + } + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: true, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // query - computed: false, optional: true, required: false + private _query?: string; + public get query() { + return this.getStringAttribute('query'); + } + public set query(value: string) { + this._query = value; + } + public resetQuery() { + this._query = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryInput() { + return this._query; + } + + // status_code - computed: false, optional: false, required: true + private _statusCode?: string; + public get statusCode() { + return this.getStringAttribute('status_code'); + } + public set statusCode(value: string) { + this._statusCode = value; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } + + // insert_headers_config - computed: false, optional: true, required: false + private _insertHeadersConfig = new ElbL7PolicyRedirectUrlConfigInsertHeadersConfigOutputReference(this, "insert_headers_config"); + public get insertHeadersConfig() { + return this._insertHeadersConfig; + } + public putInsertHeadersConfig(value: ElbL7PolicyRedirectUrlConfigInsertHeadersConfig) { + this._insertHeadersConfig.internalValue = value; + } + public resetInsertHeadersConfig() { + this._insertHeadersConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get insertHeadersConfigInput() { + return this._insertHeadersConfig.internalValue; + } + + // remove_headers_config - computed: false, optional: true, required: false + private _removeHeadersConfig = new ElbL7PolicyRedirectUrlConfigRemoveHeadersConfigOutputReference(this, "remove_headers_config"); + public get removeHeadersConfig() { + return this._removeHeadersConfig; + } + public putRemoveHeadersConfig(value: ElbL7PolicyRedirectUrlConfigRemoveHeadersConfig) { + this._removeHeadersConfig.internalValue = value; + } + public resetRemoveHeadersConfig() { + this._removeHeadersConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get removeHeadersConfigInput() { + return this._removeHeadersConfig.internalValue; + } +} +export interface ElbL7PolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#create ElbL7Policy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#delete ElbL7Policy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#update ElbL7Policy#update} + */ + readonly update?: string; +} + +export function elbL7PolicyTimeoutsToTerraform(struct?: ElbL7PolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function elbL7PolicyTimeoutsToHclTerraform(struct?: ElbL7PolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7PolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbL7PolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7PolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy huaweicloud_elb_l7policy} +*/ +export class ElbL7Policy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_l7policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbL7Policy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbL7Policy to import + * @param importFromId The id of the existing ElbL7Policy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbL7Policy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_l7policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7policy huaweicloud_elb_l7policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbL7PolicyConfig + */ + public constructor(scope: Construct, id: string, config: ElbL7PolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_l7policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._id = config.id; + this._listenerId = config.listenerId; + this._name = config.name; + this._priority = config.priority; + this._redirectListenerId = config.redirectListenerId; + this._redirectPoolId = config.redirectPoolId; + this._region = config.region; + this._fixedResponseConfig.internalValue = config.fixedResponseConfig; + this._redirectPoolsConfig.internalValue = config.redirectPoolsConfig; + this._redirectPoolsExtendConfig.internalValue = config.redirectPoolsExtendConfig; + this._redirectPoolsStickySessionConfig.internalValue = config.redirectPoolsStickySessionConfig; + this._redirectUrlConfig.internalValue = config.redirectUrlConfig; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: false, required: true + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // provisioning_status - computed: true, optional: false, required: false + public get provisioningStatus() { + return this.getStringAttribute('provisioning_status'); + } + + // redirect_listener_id - computed: true, optional: true, required: false + private _redirectListenerId?: string; + public get redirectListenerId() { + return this.getStringAttribute('redirect_listener_id'); + } + public set redirectListenerId(value: string) { + this._redirectListenerId = value; + } + public resetRedirectListenerId() { + this._redirectListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectListenerIdInput() { + return this._redirectListenerId; + } + + // redirect_pool_id - computed: true, optional: true, required: false + private _redirectPoolId?: string; + public get redirectPoolId() { + return this.getStringAttribute('redirect_pool_id'); + } + public set redirectPoolId(value: string) { + this._redirectPoolId = value; + } + public resetRedirectPoolId() { + this._redirectPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolIdInput() { + return this._redirectPoolId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // fixed_response_config - computed: false, optional: true, required: false + private _fixedResponseConfig = new ElbL7PolicyFixedResponseConfigOutputReference(this, "fixed_response_config"); + public get fixedResponseConfig() { + return this._fixedResponseConfig; + } + public putFixedResponseConfig(value: ElbL7PolicyFixedResponseConfig) { + this._fixedResponseConfig.internalValue = value; + } + public resetFixedResponseConfig() { + this._fixedResponseConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedResponseConfigInput() { + return this._fixedResponseConfig.internalValue; + } + + // redirect_pools_config - computed: false, optional: true, required: false + private _redirectPoolsConfig = new ElbL7PolicyRedirectPoolsConfigList(this, "redirect_pools_config", true); + public get redirectPoolsConfig() { + return this._redirectPoolsConfig; + } + public putRedirectPoolsConfig(value: ElbL7PolicyRedirectPoolsConfig[] | cdktf.IResolvable) { + this._redirectPoolsConfig.internalValue = value; + } + public resetRedirectPoolsConfig() { + this._redirectPoolsConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolsConfigInput() { + return this._redirectPoolsConfig.internalValue; + } + + // redirect_pools_extend_config - computed: false, optional: true, required: false + private _redirectPoolsExtendConfig = new ElbL7PolicyRedirectPoolsExtendConfigOutputReference(this, "redirect_pools_extend_config"); + public get redirectPoolsExtendConfig() { + return this._redirectPoolsExtendConfig; + } + public putRedirectPoolsExtendConfig(value: ElbL7PolicyRedirectPoolsExtendConfig) { + this._redirectPoolsExtendConfig.internalValue = value; + } + public resetRedirectPoolsExtendConfig() { + this._redirectPoolsExtendConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolsExtendConfigInput() { + return this._redirectPoolsExtendConfig.internalValue; + } + + // redirect_pools_sticky_session_config - computed: false, optional: true, required: false + private _redirectPoolsStickySessionConfig = new ElbL7PolicyRedirectPoolsStickySessionConfigOutputReference(this, "redirect_pools_sticky_session_config"); + public get redirectPoolsStickySessionConfig() { + return this._redirectPoolsStickySessionConfig; + } + public putRedirectPoolsStickySessionConfig(value: ElbL7PolicyRedirectPoolsStickySessionConfig) { + this._redirectPoolsStickySessionConfig.internalValue = value; + } + public resetRedirectPoolsStickySessionConfig() { + this._redirectPoolsStickySessionConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolsStickySessionConfigInput() { + return this._redirectPoolsStickySessionConfig.internalValue; + } + + // redirect_url_config - computed: false, optional: true, required: false + private _redirectUrlConfig = new ElbL7PolicyRedirectUrlConfigOutputReference(this, "redirect_url_config"); + public get redirectUrlConfig() { + return this._redirectUrlConfig; + } + public putRedirectUrlConfig(value: ElbL7PolicyRedirectUrlConfig) { + this._redirectUrlConfig.internalValue = value; + } + public resetRedirectUrlConfig() { + this._redirectUrlConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectUrlConfigInput() { + return this._redirectUrlConfig.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbL7PolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbL7PolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + priority: cdktf.numberToTerraform(this._priority), + redirect_listener_id: cdktf.stringToTerraform(this._redirectListenerId), + redirect_pool_id: cdktf.stringToTerraform(this._redirectPoolId), + region: cdktf.stringToTerraform(this._region), + fixed_response_config: elbL7PolicyFixedResponseConfigToTerraform(this._fixedResponseConfig.internalValue), + redirect_pools_config: cdktf.listMapper(elbL7PolicyRedirectPoolsConfigToTerraform, true)(this._redirectPoolsConfig.internalValue), + redirect_pools_extend_config: elbL7PolicyRedirectPoolsExtendConfigToTerraform(this._redirectPoolsExtendConfig.internalValue), + redirect_pools_sticky_session_config: elbL7PolicyRedirectPoolsStickySessionConfigToTerraform(this._redirectPoolsStickySessionConfig.internalValue), + redirect_url_config: elbL7PolicyRedirectUrlConfigToTerraform(this._redirectUrlConfig.internalValue), + timeouts: elbL7PolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + redirect_listener_id: { + value: cdktf.stringToHclTerraform(this._redirectListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redirect_pool_id: { + value: cdktf.stringToHclTerraform(this._redirectPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_response_config: { + value: elbL7PolicyFixedResponseConfigToHclTerraform(this._fixedResponseConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyFixedResponseConfigList", + }, + redirect_pools_config: { + value: cdktf.listMapperHcl(elbL7PolicyRedirectPoolsConfigToHclTerraform, true)(this._redirectPoolsConfig.internalValue), + isBlock: true, + type: "set", + storageClassType: "ElbL7PolicyRedirectPoolsConfigList", + }, + redirect_pools_extend_config: { + value: elbL7PolicyRedirectPoolsExtendConfigToHclTerraform(this._redirectPoolsExtendConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectPoolsExtendConfigList", + }, + redirect_pools_sticky_session_config: { + value: elbL7PolicyRedirectPoolsStickySessionConfigToHclTerraform(this._redirectPoolsStickySessionConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectPoolsStickySessionConfigList", + }, + redirect_url_config: { + value: elbL7PolicyRedirectUrlConfigToHclTerraform(this._redirectUrlConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbL7PolicyRedirectUrlConfigList", + }, + timeouts: { + value: elbL7PolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbL7PolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-l7rule/README.md b/src/constructs/providers/huaweicloud/elb-l7rule/README.md new file mode 100644 index 00000000..81b1d363 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-l7rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_l7rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_l7rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule). diff --git a/src/constructs/providers/huaweicloud/elb-l7rule/index.ts b/src/constructs/providers/huaweicloud/elb-l7rule/index.ts new file mode 100644 index 00000000..1101b5c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-l7rule/index.ts @@ -0,0 +1,590 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbL7RuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#compare_type ElbL7Rule#compare_type} + */ + readonly compareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#id ElbL7Rule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#l7policy_id ElbL7Rule#l7policy_id} + */ + readonly l7PolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#region ElbL7Rule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#type ElbL7Rule#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#value ElbL7Rule#value} + */ + readonly value?: string; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#conditions ElbL7Rule#conditions} + */ + readonly conditions?: ElbL7RuleConditions[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#timeouts ElbL7Rule#timeouts} + */ + readonly timeouts?: ElbL7RuleTimeouts; +} +export interface ElbL7RuleConditions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#key ElbL7Rule#key} + */ + readonly key?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#value ElbL7Rule#value} + */ + readonly value: string; +} + +export function elbL7RuleConditionsToTerraform(struct?: ElbL7RuleConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function elbL7RuleConditionsToHclTerraform(struct?: ElbL7RuleConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7RuleConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbL7RuleConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7RuleConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ElbL7RuleConditionsList extends cdktf.ComplexList { + public internalValue? : ElbL7RuleConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbL7RuleConditionsOutputReference { + return new ElbL7RuleConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbL7RuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#delete ElbL7Rule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#update ElbL7Rule#update} + */ + readonly update?: string; +} + +export function elbL7RuleTimeoutsToTerraform(struct?: ElbL7RuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function elbL7RuleTimeoutsToHclTerraform(struct?: ElbL7RuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbL7RuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbL7RuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbL7RuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + this._update = value.update; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule huaweicloud_elb_l7rule} +*/ +export class ElbL7Rule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_l7rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbL7Rule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbL7Rule to import + * @param importFromId The id of the existing ElbL7Rule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbL7Rule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_l7rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_l7rule huaweicloud_elb_l7rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbL7RuleConfig + */ + public constructor(scope: Construct, id: string, config: ElbL7RuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_l7rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._compareType = config.compareType; + this._id = config.id; + this._l7PolicyId = config.l7PolicyId; + this._region = config.region; + this._type = config.type; + this._value = config.value; + this._conditions.internalValue = config.conditions; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // compare_type - computed: false, optional: false, required: true + private _compareType?: string; + public get compareType() { + return this.getStringAttribute('compare_type'); + } + public set compareType(value: string) { + this._compareType = value; + } + // Temporarily expose input value. Use with caution. + public get compareTypeInput() { + return this._compareType; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // l7policy_id - computed: false, optional: false, required: true + private _l7PolicyId?: string; + public get l7PolicyId() { + return this.getStringAttribute('l7policy_id'); + } + public set l7PolicyId(value: string) { + this._l7PolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get l7PolicyIdInput() { + return this._l7PolicyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // conditions - computed: false, optional: true, required: false + private _conditions = new ElbL7RuleConditionsList(this, "conditions", true); + public get conditions() { + return this._conditions; + } + public putConditions(value: ElbL7RuleConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + public resetConditions() { + this._conditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbL7RuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbL7RuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + compare_type: cdktf.stringToTerraform(this._compareType), + id: cdktf.stringToTerraform(this._id), + l7policy_id: cdktf.stringToTerraform(this._l7PolicyId), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + value: cdktf.stringToTerraform(this._value), + conditions: cdktf.listMapper(elbL7RuleConditionsToTerraform, true)(this._conditions.internalValue), + timeouts: elbL7RuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + compare_type: { + value: cdktf.stringToHclTerraform(this._compareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7policy_id: { + value: cdktf.stringToHclTerraform(this._l7PolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conditions: { + value: cdktf.listMapperHcl(elbL7RuleConditionsToHclTerraform, true)(this._conditions.internalValue), + isBlock: true, + type: "set", + storageClassType: "ElbL7RuleConditionsList", + }, + timeouts: { + value: elbL7RuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbL7RuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-listener/README.md b/src/constructs/providers/huaweicloud/elb-listener/README.md new file mode 100644 index 00000000..011f0cd2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-listener/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_listener` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_listener`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener). diff --git a/src/constructs/providers/huaweicloud/elb-listener/index.ts b/src/constructs/providers/huaweicloud/elb-listener/index.ts new file mode 100644 index 00000000..a9ad11c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-listener/index.ts @@ -0,0 +1,1575 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbListenerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#access_policy ElbListener#access_policy} + */ + readonly accessPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#advanced_forwarding_enabled ElbListener#advanced_forwarding_enabled} + */ + readonly advancedForwardingEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#ca_certificate ElbListener#ca_certificate} + */ + readonly caCertificate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#default_pool_id ElbListener#default_pool_id} + */ + readonly defaultPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#description ElbListener#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#enable_member_retry ElbListener#enable_member_retry} + */ + readonly enableMemberRetry?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#force_delete ElbListener#force_delete} + */ + readonly forceDelete?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_eip ElbListener#forward_eip} + */ + readonly forwardEip?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_elb ElbListener#forward_elb} + */ + readonly forwardElb?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_host ElbListener#forward_host} + */ + readonly forwardHost?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_port ElbListener#forward_port} + */ + readonly forwardPort?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_proto ElbListener#forward_proto} + */ + readonly forwardProto?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_request_port ElbListener#forward_request_port} + */ + readonly forwardRequestPort?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_tls_certificate ElbListener#forward_tls_certificate} + */ + readonly forwardTlsCertificate?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_tls_cipher ElbListener#forward_tls_cipher} + */ + readonly forwardTlsCipher?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#forward_tls_protocol ElbListener#forward_tls_protocol} + */ + readonly forwardTlsProtocol?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#gzip_enable ElbListener#gzip_enable} + */ + readonly gzipEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#http2_enable ElbListener#http2_enable} + */ + readonly http2Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#id ElbListener#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#idle_timeout ElbListener#idle_timeout} + */ + readonly idleTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#ip_group ElbListener#ip_group} + */ + readonly ipGroup?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#loadbalancer_id ElbListener#loadbalancer_id} + */ + readonly loadbalancerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#name ElbListener#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#protection_reason ElbListener#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#protection_status ElbListener#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#protocol ElbListener#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#protocol_port ElbListener#protocol_port} + */ + readonly protocolPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#proxy_protocol_enable ElbListener#proxy_protocol_enable} + */ + readonly proxyProtocolEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#quic_listener_id ElbListener#quic_listener_id} + */ + readonly quicListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#real_ip ElbListener#real_ip} + */ + readonly realIp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#region ElbListener#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#request_timeout ElbListener#request_timeout} + */ + readonly requestTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#response_timeout ElbListener#response_timeout} + */ + readonly responseTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#security_policy_id ElbListener#security_policy_id} + */ + readonly securityPolicyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#server_certificate ElbListener#server_certificate} + */ + readonly serverCertificate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#sni_certificate ElbListener#sni_certificate} + */ + readonly sniCertificate?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#sni_match_algo ElbListener#sni_match_algo} + */ + readonly sniMatchAlgo?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#ssl_early_data_enable ElbListener#ssl_early_data_enable} + */ + readonly sslEarlyDataEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#tags ElbListener#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#tls_ciphers_policy ElbListener#tls_ciphers_policy} + */ + readonly tlsCiphersPolicy?: string; + /** + * port_ranges block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#port_ranges ElbListener#port_ranges} + */ + readonly portRanges?: ElbListenerPortRanges[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#timeouts ElbListener#timeouts} + */ + readonly timeouts?: ElbListenerTimeouts; +} +export interface ElbListenerPortRanges { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#end_port ElbListener#end_port} + */ + readonly endPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#start_port ElbListener#start_port} + */ + readonly startPort: number; +} + +export function elbListenerPortRangesToTerraform(struct?: ElbListenerPortRanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_port: cdktf.numberToTerraform(struct!.endPort), + start_port: cdktf.numberToTerraform(struct!.startPort), + } +} + + +export function elbListenerPortRangesToHclTerraform(struct?: ElbListenerPortRanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_port: { + value: cdktf.numberToHclTerraform(struct!.endPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_port: { + value: cdktf.numberToHclTerraform(struct!.startPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbListenerPortRangesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbListenerPortRanges | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endPort !== undefined) { + hasAnyValues = true; + internalValueResult.endPort = this._endPort; + } + if (this._startPort !== undefined) { + hasAnyValues = true; + internalValueResult.startPort = this._startPort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbListenerPortRanges | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._endPort = undefined; + this._startPort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._endPort = value.endPort; + this._startPort = value.startPort; + } + } + + // end_port - computed: false, optional: false, required: true + private _endPort?: number; + public get endPort() { + return this.getNumberAttribute('end_port'); + } + public set endPort(value: number) { + this._endPort = value; + } + // Temporarily expose input value. Use with caution. + public get endPortInput() { + return this._endPort; + } + + // start_port - computed: false, optional: false, required: true + private _startPort?: number; + public get startPort() { + return this.getNumberAttribute('start_port'); + } + public set startPort(value: number) { + this._startPort = value; + } + // Temporarily expose input value. Use with caution. + public get startPortInput() { + return this._startPort; + } +} + +export class ElbListenerPortRangesList extends cdktf.ComplexList { + public internalValue? : ElbListenerPortRanges[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbListenerPortRangesOutputReference { + return new ElbListenerPortRangesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ElbListenerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#create ElbListener#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#delete ElbListener#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#update ElbListener#update} + */ + readonly update?: string; +} + +export function elbListenerTimeoutsToTerraform(struct?: ElbListenerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function elbListenerTimeoutsToHclTerraform(struct?: ElbListenerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbListenerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbListenerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbListenerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener huaweicloud_elb_listener} +*/ +export class ElbListener extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_listener"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbListener resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbListener to import + * @param importFromId The id of the existing ElbListener that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbListener to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_listener", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_listener huaweicloud_elb_listener} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbListenerConfig + */ + public constructor(scope: Construct, id: string, config: ElbListenerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_listener', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessPolicy = config.accessPolicy; + this._advancedForwardingEnabled = config.advancedForwardingEnabled; + this._caCertificate = config.caCertificate; + this._defaultPoolId = config.defaultPoolId; + this._description = config.description; + this._enableMemberRetry = config.enableMemberRetry; + this._forceDelete = config.forceDelete; + this._forwardEip = config.forwardEip; + this._forwardElb = config.forwardElb; + this._forwardHost = config.forwardHost; + this._forwardPort = config.forwardPort; + this._forwardProto = config.forwardProto; + this._forwardRequestPort = config.forwardRequestPort; + this._forwardTlsCertificate = config.forwardTlsCertificate; + this._forwardTlsCipher = config.forwardTlsCipher; + this._forwardTlsProtocol = config.forwardTlsProtocol; + this._gzipEnable = config.gzipEnable; + this._http2Enable = config.http2Enable; + this._id = config.id; + this._idleTimeout = config.idleTimeout; + this._ipGroup = config.ipGroup; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._protocol = config.protocol; + this._protocolPort = config.protocolPort; + this._proxyProtocolEnable = config.proxyProtocolEnable; + this._quicListenerId = config.quicListenerId; + this._realIp = config.realIp; + this._region = config.region; + this._requestTimeout = config.requestTimeout; + this._responseTimeout = config.responseTimeout; + this._securityPolicyId = config.securityPolicyId; + this._serverCertificate = config.serverCertificate; + this._sniCertificate = config.sniCertificate; + this._sniMatchAlgo = config.sniMatchAlgo; + this._sslEarlyDataEnable = config.sslEarlyDataEnable; + this._tags = config.tags; + this._tlsCiphersPolicy = config.tlsCiphersPolicy; + this._portRanges.internalValue = config.portRanges; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_policy - computed: false, optional: true, required: false + private _accessPolicy?: string; + public get accessPolicy() { + return this.getStringAttribute('access_policy'); + } + public set accessPolicy(value: string) { + this._accessPolicy = value; + } + public resetAccessPolicy() { + this._accessPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessPolicyInput() { + return this._accessPolicy; + } + + // advanced_forwarding_enabled - computed: true, optional: true, required: false + private _advancedForwardingEnabled?: boolean | cdktf.IResolvable; + public get advancedForwardingEnabled() { + return this.getBooleanAttribute('advanced_forwarding_enabled'); + } + public set advancedForwardingEnabled(value: boolean | cdktf.IResolvable) { + this._advancedForwardingEnabled = value; + } + public resetAdvancedForwardingEnabled() { + this._advancedForwardingEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get advancedForwardingEnabledInput() { + return this._advancedForwardingEnabled; + } + + // ca_certificate - computed: false, optional: true, required: false + private _caCertificate?: string; + public get caCertificate() { + return this.getStringAttribute('ca_certificate'); + } + public set caCertificate(value: string) { + this._caCertificate = value; + } + public resetCaCertificate() { + this._caCertificate = undefined; + } + // Temporarily expose input value. Use with caution. + public get caCertificateInput() { + return this._caCertificate; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_pool_id - computed: true, optional: true, required: false + private _defaultPoolId?: string; + public get defaultPoolId() { + return this.getStringAttribute('default_pool_id'); + } + public set defaultPoolId(value: string) { + this._defaultPoolId = value; + } + public resetDefaultPoolId() { + this._defaultPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultPoolIdInput() { + return this._defaultPoolId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_member_retry - computed: true, optional: true, required: false + private _enableMemberRetry?: boolean | cdktf.IResolvable; + public get enableMemberRetry() { + return this.getBooleanAttribute('enable_member_retry'); + } + public set enableMemberRetry(value: boolean | cdktf.IResolvable) { + this._enableMemberRetry = value; + } + public resetEnableMemberRetry() { + this._enableMemberRetry = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableMemberRetryInput() { + return this._enableMemberRetry; + } + + // force_delete - computed: false, optional: true, required: false + private _forceDelete?: boolean | cdktf.IResolvable; + public get forceDelete() { + return this.getBooleanAttribute('force_delete'); + } + public set forceDelete(value: boolean | cdktf.IResolvable) { + this._forceDelete = value; + } + public resetForceDelete() { + this._forceDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDeleteInput() { + return this._forceDelete; + } + + // forward_eip - computed: true, optional: true, required: false + private _forwardEip?: boolean | cdktf.IResolvable; + public get forwardEip() { + return this.getBooleanAttribute('forward_eip'); + } + public set forwardEip(value: boolean | cdktf.IResolvable) { + this._forwardEip = value; + } + public resetForwardEip() { + this._forwardEip = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardEipInput() { + return this._forwardEip; + } + + // forward_elb - computed: true, optional: true, required: false + private _forwardElb?: boolean | cdktf.IResolvable; + public get forwardElb() { + return this.getBooleanAttribute('forward_elb'); + } + public set forwardElb(value: boolean | cdktf.IResolvable) { + this._forwardElb = value; + } + public resetForwardElb() { + this._forwardElb = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardElbInput() { + return this._forwardElb; + } + + // forward_host - computed: false, optional: true, required: false + private _forwardHost?: boolean | cdktf.IResolvable; + public get forwardHost() { + return this.getBooleanAttribute('forward_host'); + } + public set forwardHost(value: boolean | cdktf.IResolvable) { + this._forwardHost = value; + } + public resetForwardHost() { + this._forwardHost = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardHostInput() { + return this._forwardHost; + } + + // forward_port - computed: true, optional: true, required: false + private _forwardPort?: boolean | cdktf.IResolvable; + public get forwardPort() { + return this.getBooleanAttribute('forward_port'); + } + public set forwardPort(value: boolean | cdktf.IResolvable) { + this._forwardPort = value; + } + public resetForwardPort() { + this._forwardPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardPortInput() { + return this._forwardPort; + } + + // forward_proto - computed: true, optional: true, required: false + private _forwardProto?: boolean | cdktf.IResolvable; + public get forwardProto() { + return this.getBooleanAttribute('forward_proto'); + } + public set forwardProto(value: boolean | cdktf.IResolvable) { + this._forwardProto = value; + } + public resetForwardProto() { + this._forwardProto = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardProtoInput() { + return this._forwardProto; + } + + // forward_request_port - computed: true, optional: true, required: false + private _forwardRequestPort?: boolean | cdktf.IResolvable; + public get forwardRequestPort() { + return this.getBooleanAttribute('forward_request_port'); + } + public set forwardRequestPort(value: boolean | cdktf.IResolvable) { + this._forwardRequestPort = value; + } + public resetForwardRequestPort() { + this._forwardRequestPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardRequestPortInput() { + return this._forwardRequestPort; + } + + // forward_tls_certificate - computed: true, optional: true, required: false + private _forwardTlsCertificate?: boolean | cdktf.IResolvable; + public get forwardTlsCertificate() { + return this.getBooleanAttribute('forward_tls_certificate'); + } + public set forwardTlsCertificate(value: boolean | cdktf.IResolvable) { + this._forwardTlsCertificate = value; + } + public resetForwardTlsCertificate() { + this._forwardTlsCertificate = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardTlsCertificateInput() { + return this._forwardTlsCertificate; + } + + // forward_tls_cipher - computed: true, optional: true, required: false + private _forwardTlsCipher?: boolean | cdktf.IResolvable; + public get forwardTlsCipher() { + return this.getBooleanAttribute('forward_tls_cipher'); + } + public set forwardTlsCipher(value: boolean | cdktf.IResolvable) { + this._forwardTlsCipher = value; + } + public resetForwardTlsCipher() { + this._forwardTlsCipher = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardTlsCipherInput() { + return this._forwardTlsCipher; + } + + // forward_tls_protocol - computed: true, optional: true, required: false + private _forwardTlsProtocol?: boolean | cdktf.IResolvable; + public get forwardTlsProtocol() { + return this.getBooleanAttribute('forward_tls_protocol'); + } + public set forwardTlsProtocol(value: boolean | cdktf.IResolvable) { + this._forwardTlsProtocol = value; + } + public resetForwardTlsProtocol() { + this._forwardTlsProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardTlsProtocolInput() { + return this._forwardTlsProtocol; + } + + // gzip_enable - computed: true, optional: true, required: false + private _gzipEnable?: boolean | cdktf.IResolvable; + public get gzipEnable() { + return this.getBooleanAttribute('gzip_enable'); + } + public set gzipEnable(value: boolean | cdktf.IResolvable) { + this._gzipEnable = value; + } + public resetGzipEnable() { + this._gzipEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get gzipEnableInput() { + return this._gzipEnable; + } + + // http2_enable - computed: true, optional: true, required: false + private _http2Enable?: boolean | cdktf.IResolvable; + public get http2Enable() { + return this.getBooleanAttribute('http2_enable'); + } + public set http2Enable(value: boolean | cdktf.IResolvable) { + this._http2Enable = value; + } + public resetHttp2Enable() { + this._http2Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get http2EnableInput() { + return this._http2Enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // idle_timeout - computed: true, optional: true, required: false + private _idleTimeout?: number; + public get idleTimeout() { + return this.getNumberAttribute('idle_timeout'); + } + public set idleTimeout(value: number) { + this._idleTimeout = value; + } + public resetIdleTimeout() { + this._idleTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get idleTimeoutInput() { + return this._idleTimeout; + } + + // ip_group - computed: false, optional: true, required: false + private _ipGroup?: string; + public get ipGroup() { + return this.getStringAttribute('ip_group'); + } + public set ipGroup(value: string) { + this._ipGroup = value; + } + public resetIpGroup() { + this._ipGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipGroupInput() { + return this._ipGroup; + } + + // loadbalancer_id - computed: false, optional: false, required: true + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // protocol_port - computed: true, optional: true, required: false + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + public resetProtocolPort() { + this._protocolPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // proxy_protocol_enable - computed: true, optional: true, required: false + private _proxyProtocolEnable?: boolean | cdktf.IResolvable; + public get proxyProtocolEnable() { + return this.getBooleanAttribute('proxy_protocol_enable'); + } + public set proxyProtocolEnable(value: boolean | cdktf.IResolvable) { + this._proxyProtocolEnable = value; + } + public resetProxyProtocolEnable() { + this._proxyProtocolEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyProtocolEnableInput() { + return this._proxyProtocolEnable; + } + + // quic_listener_id - computed: false, optional: true, required: false + private _quicListenerId?: string; + public get quicListenerId() { + return this.getStringAttribute('quic_listener_id'); + } + public set quicListenerId(value: string) { + this._quicListenerId = value; + } + public resetQuicListenerId() { + this._quicListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get quicListenerIdInput() { + return this._quicListenerId; + } + + // real_ip - computed: true, optional: true, required: false + private _realIp?: boolean | cdktf.IResolvable; + public get realIp() { + return this.getBooleanAttribute('real_ip'); + } + public set realIp(value: boolean | cdktf.IResolvable) { + this._realIp = value; + } + public resetRealIp() { + this._realIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get realIpInput() { + return this._realIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_timeout - computed: true, optional: true, required: false + private _requestTimeout?: number; + public get requestTimeout() { + return this.getNumberAttribute('request_timeout'); + } + public set requestTimeout(value: number) { + this._requestTimeout = value; + } + public resetRequestTimeout() { + this._requestTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestTimeoutInput() { + return this._requestTimeout; + } + + // response_timeout - computed: true, optional: true, required: false + private _responseTimeout?: number; + public get responseTimeout() { + return this.getNumberAttribute('response_timeout'); + } + public set responseTimeout(value: number) { + this._responseTimeout = value; + } + public resetResponseTimeout() { + this._responseTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseTimeoutInput() { + return this._responseTimeout; + } + + // security_policy_id - computed: false, optional: true, required: false + private _securityPolicyId?: string; + public get securityPolicyId() { + return this.getStringAttribute('security_policy_id'); + } + public set securityPolicyId(value: string) { + this._securityPolicyId = value; + } + public resetSecurityPolicyId() { + this._securityPolicyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityPolicyIdInput() { + return this._securityPolicyId; + } + + // server_certificate - computed: false, optional: true, required: false + private _serverCertificate?: string; + public get serverCertificate() { + return this.getStringAttribute('server_certificate'); + } + public set serverCertificate(value: string) { + this._serverCertificate = value; + } + public resetServerCertificate() { + this._serverCertificate = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverCertificateInput() { + return this._serverCertificate; + } + + // sni_certificate - computed: false, optional: true, required: false + private _sniCertificate?: string[]; + public get sniCertificate() { + return this.getListAttribute('sni_certificate'); + } + public set sniCertificate(value: string[]) { + this._sniCertificate = value; + } + public resetSniCertificate() { + this._sniCertificate = undefined; + } + // Temporarily expose input value. Use with caution. + public get sniCertificateInput() { + return this._sniCertificate; + } + + // sni_match_algo - computed: true, optional: true, required: false + private _sniMatchAlgo?: string; + public get sniMatchAlgo() { + return this.getStringAttribute('sni_match_algo'); + } + public set sniMatchAlgo(value: string) { + this._sniMatchAlgo = value; + } + public resetSniMatchAlgo() { + this._sniMatchAlgo = undefined; + } + // Temporarily expose input value. Use with caution. + public get sniMatchAlgoInput() { + return this._sniMatchAlgo; + } + + // ssl_early_data_enable - computed: false, optional: true, required: false + private _sslEarlyDataEnable?: boolean | cdktf.IResolvable; + public get sslEarlyDataEnable() { + return this.getBooleanAttribute('ssl_early_data_enable'); + } + public set sslEarlyDataEnable(value: boolean | cdktf.IResolvable) { + this._sslEarlyDataEnable = value; + } + public resetSslEarlyDataEnable() { + this._sslEarlyDataEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEarlyDataEnableInput() { + return this._sslEarlyDataEnable; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tls_ciphers_policy - computed: true, optional: true, required: false + private _tlsCiphersPolicy?: string; + public get tlsCiphersPolicy() { + return this.getStringAttribute('tls_ciphers_policy'); + } + public set tlsCiphersPolicy(value: string) { + this._tlsCiphersPolicy = value; + } + public resetTlsCiphersPolicy() { + this._tlsCiphersPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tlsCiphersPolicyInput() { + return this._tlsCiphersPolicy; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // port_ranges - computed: false, optional: true, required: false + private _portRanges = new ElbListenerPortRangesList(this, "port_ranges", true); + public get portRanges() { + return this._portRanges; + } + public putPortRanges(value: ElbListenerPortRanges[] | cdktf.IResolvable) { + this._portRanges.internalValue = value; + } + public resetPortRanges() { + this._portRanges.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangesInput() { + return this._portRanges.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbListenerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbListenerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_policy: cdktf.stringToTerraform(this._accessPolicy), + advanced_forwarding_enabled: cdktf.booleanToTerraform(this._advancedForwardingEnabled), + ca_certificate: cdktf.stringToTerraform(this._caCertificate), + default_pool_id: cdktf.stringToTerraform(this._defaultPoolId), + description: cdktf.stringToTerraform(this._description), + enable_member_retry: cdktf.booleanToTerraform(this._enableMemberRetry), + force_delete: cdktf.booleanToTerraform(this._forceDelete), + forward_eip: cdktf.booleanToTerraform(this._forwardEip), + forward_elb: cdktf.booleanToTerraform(this._forwardElb), + forward_host: cdktf.booleanToTerraform(this._forwardHost), + forward_port: cdktf.booleanToTerraform(this._forwardPort), + forward_proto: cdktf.booleanToTerraform(this._forwardProto), + forward_request_port: cdktf.booleanToTerraform(this._forwardRequestPort), + forward_tls_certificate: cdktf.booleanToTerraform(this._forwardTlsCertificate), + forward_tls_cipher: cdktf.booleanToTerraform(this._forwardTlsCipher), + forward_tls_protocol: cdktf.booleanToTerraform(this._forwardTlsProtocol), + gzip_enable: cdktf.booleanToTerraform(this._gzipEnable), + http2_enable: cdktf.booleanToTerraform(this._http2Enable), + id: cdktf.stringToTerraform(this._id), + idle_timeout: cdktf.numberToTerraform(this._idleTimeout), + ip_group: cdktf.stringToTerraform(this._ipGroup), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + protocol: cdktf.stringToTerraform(this._protocol), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + proxy_protocol_enable: cdktf.booleanToTerraform(this._proxyProtocolEnable), + quic_listener_id: cdktf.stringToTerraform(this._quicListenerId), + real_ip: cdktf.booleanToTerraform(this._realIp), + region: cdktf.stringToTerraform(this._region), + request_timeout: cdktf.numberToTerraform(this._requestTimeout), + response_timeout: cdktf.numberToTerraform(this._responseTimeout), + security_policy_id: cdktf.stringToTerraform(this._securityPolicyId), + server_certificate: cdktf.stringToTerraform(this._serverCertificate), + sni_certificate: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sniCertificate), + sni_match_algo: cdktf.stringToTerraform(this._sniMatchAlgo), + ssl_early_data_enable: cdktf.booleanToTerraform(this._sslEarlyDataEnable), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tls_ciphers_policy: cdktf.stringToTerraform(this._tlsCiphersPolicy), + port_ranges: cdktf.listMapper(elbListenerPortRangesToTerraform, true)(this._portRanges.internalValue), + timeouts: elbListenerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_policy: { + value: cdktf.stringToHclTerraform(this._accessPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + advanced_forwarding_enabled: { + value: cdktf.booleanToHclTerraform(this._advancedForwardingEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ca_certificate: { + value: cdktf.stringToHclTerraform(this._caCertificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default_pool_id: { + value: cdktf.stringToHclTerraform(this._defaultPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_member_retry: { + value: cdktf.booleanToHclTerraform(this._enableMemberRetry), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + force_delete: { + value: cdktf.booleanToHclTerraform(this._forceDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_eip: { + value: cdktf.booleanToHclTerraform(this._forwardEip), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_elb: { + value: cdktf.booleanToHclTerraform(this._forwardElb), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_host: { + value: cdktf.booleanToHclTerraform(this._forwardHost), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_port: { + value: cdktf.booleanToHclTerraform(this._forwardPort), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_proto: { + value: cdktf.booleanToHclTerraform(this._forwardProto), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_request_port: { + value: cdktf.booleanToHclTerraform(this._forwardRequestPort), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_tls_certificate: { + value: cdktf.booleanToHclTerraform(this._forwardTlsCertificate), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_tls_cipher: { + value: cdktf.booleanToHclTerraform(this._forwardTlsCipher), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + forward_tls_protocol: { + value: cdktf.booleanToHclTerraform(this._forwardTlsProtocol), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + gzip_enable: { + value: cdktf.booleanToHclTerraform(this._gzipEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + http2_enable: { + value: cdktf.booleanToHclTerraform(this._http2Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + idle_timeout: { + value: cdktf.numberToHclTerraform(this._idleTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ip_group: { + value: cdktf.stringToHclTerraform(this._ipGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + proxy_protocol_enable: { + value: cdktf.booleanToHclTerraform(this._proxyProtocolEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + quic_listener_id: { + value: cdktf.stringToHclTerraform(this._quicListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + real_ip: { + value: cdktf.booleanToHclTerraform(this._realIp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_timeout: { + value: cdktf.numberToHclTerraform(this._requestTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + response_timeout: { + value: cdktf.numberToHclTerraform(this._responseTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_policy_id: { + value: cdktf.stringToHclTerraform(this._securityPolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_certificate: { + value: cdktf.stringToHclTerraform(this._serverCertificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sni_certificate: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sniCertificate), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + sni_match_algo: { + value: cdktf.stringToHclTerraform(this._sniMatchAlgo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_early_data_enable: { + value: cdktf.booleanToHclTerraform(this._sslEarlyDataEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tls_ciphers_policy: { + value: cdktf.stringToHclTerraform(this._tlsCiphersPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_ranges: { + value: cdktf.listMapperHcl(elbListenerPortRangesToHclTerraform, true)(this._portRanges.internalValue), + isBlock: true, + type: "set", + storageClassType: "ElbListenerPortRangesList", + }, + timeouts: { + value: elbListenerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbListenerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-loadbalancer/README.md b/src/constructs/providers/huaweicloud/elb-loadbalancer/README.md new file mode 100644 index 00000000..c20af47a --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-loadbalancer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_loadbalancer` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_loadbalancer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer). diff --git a/src/constructs/providers/huaweicloud/elb-loadbalancer/index.ts b/src/constructs/providers/huaweicloud/elb-loadbalancer/index.ts new file mode 100644 index 00000000..c70f6a87 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-loadbalancer/index.ts @@ -0,0 +1,1329 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbLoadbalancerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#auto_pay ElbLoadbalancer#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#auto_renew ElbLoadbalancer#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#autoscaling_enabled ElbLoadbalancer#autoscaling_enabled} + */ + readonly autoscalingEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#availability_zone ElbLoadbalancer#availability_zone} + */ + readonly availabilityZone: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#backend_subnets ElbLoadbalancer#backend_subnets} + */ + readonly backendSubnets?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#bandwidth_charge_mode ElbLoadbalancer#bandwidth_charge_mode} + */ + readonly bandwidthChargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#bandwidth_id ElbLoadbalancer#bandwidth_id} + */ + readonly bandwidthId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#bandwidth_size ElbLoadbalancer#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#charging_mode ElbLoadbalancer#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#cross_vpc_backend ElbLoadbalancer#cross_vpc_backend} + */ + readonly crossVpcBackend?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#deletion_protection_enable ElbLoadbalancer#deletion_protection_enable} + */ + readonly deletionProtectionEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#description ElbLoadbalancer#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#enterprise_project_id ElbLoadbalancer#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#force_delete ElbLoadbalancer#force_delete} + */ + readonly forceDelete?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#id ElbLoadbalancer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#iptype ElbLoadbalancer#iptype} + */ + readonly iptype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#ipv4_address ElbLoadbalancer#ipv4_address} + */ + readonly ipv4Address?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#ipv4_eip_id ElbLoadbalancer#ipv4_eip_id} + */ + readonly ipv4EipId?: string; + /** + * the IPv4 subnet ID of the subnet where the load balancer resides + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#ipv4_subnet_id ElbLoadbalancer#ipv4_subnet_id} + */ + readonly ipv4SubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#ipv6_address ElbLoadbalancer#ipv6_address} + */ + readonly ipv6Address?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#ipv6_bandwidth_id ElbLoadbalancer#ipv6_bandwidth_id} + */ + readonly ipv6BandwidthId?: string; + /** + * the ID of the subnet where the load balancer resides + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#ipv6_network_id ElbLoadbalancer#ipv6_network_id} + */ + readonly ipv6NetworkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#l4_flavor_id ElbLoadbalancer#l4_flavor_id} + */ + readonly l4FlavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#l7_flavor_id ElbLoadbalancer#l7_flavor_id} + */ + readonly l7FlavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#loadbalancer_type ElbLoadbalancer#loadbalancer_type} + */ + readonly loadbalancerType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#min_l7_flavor_id ElbLoadbalancer#min_l7_flavor_id} + */ + readonly minL7FlavorId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#name ElbLoadbalancer#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#period ElbLoadbalancer#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#period_unit ElbLoadbalancer#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#protection_reason ElbLoadbalancer#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#protection_status ElbLoadbalancer#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#region ElbLoadbalancer#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#sharetype ElbLoadbalancer#sharetype} + */ + readonly sharetype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#tags ElbLoadbalancer#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#vpc_id ElbLoadbalancer#vpc_id} + */ + readonly vpcId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#waf_failure_action ElbLoadbalancer#waf_failure_action} + */ + readonly wafFailureAction?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#timeouts ElbLoadbalancer#timeouts} + */ + readonly timeouts?: ElbLoadbalancerTimeouts; +} +export interface ElbLoadbalancerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#create ElbLoadbalancer#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#delete ElbLoadbalancer#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#update ElbLoadbalancer#update} + */ + readonly update?: string; +} + +export function elbLoadbalancerTimeoutsToTerraform(struct?: ElbLoadbalancerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function elbLoadbalancerTimeoutsToHclTerraform(struct?: ElbLoadbalancerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbLoadbalancerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbLoadbalancerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbLoadbalancerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer huaweicloud_elb_loadbalancer} +*/ +export class ElbLoadbalancer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_loadbalancer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbLoadbalancer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbLoadbalancer to import + * @param importFromId The id of the existing ElbLoadbalancer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbLoadbalancer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_loadbalancer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_loadbalancer huaweicloud_elb_loadbalancer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbLoadbalancerConfig + */ + public constructor(scope: Construct, id: string, config: ElbLoadbalancerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_loadbalancer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._autoscalingEnabled = config.autoscalingEnabled; + this._availabilityZone = config.availabilityZone; + this._backendSubnets = config.backendSubnets; + this._bandwidthChargeMode = config.bandwidthChargeMode; + this._bandwidthId = config.bandwidthId; + this._bandwidthSize = config.bandwidthSize; + this._chargingMode = config.chargingMode; + this._crossVpcBackend = config.crossVpcBackend; + this._deletionProtectionEnable = config.deletionProtectionEnable; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forceDelete = config.forceDelete; + this._id = config.id; + this._iptype = config.iptype; + this._ipv4Address = config.ipv4Address; + this._ipv4EipId = config.ipv4EipId; + this._ipv4SubnetId = config.ipv4SubnetId; + this._ipv6Address = config.ipv6Address; + this._ipv6BandwidthId = config.ipv6BandwidthId; + this._ipv6NetworkId = config.ipv6NetworkId; + this._l4FlavorId = config.l4FlavorId; + this._l7FlavorId = config.l7FlavorId; + this._loadbalancerType = config.loadbalancerType; + this._minL7FlavorId = config.minL7FlavorId; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._region = config.region; + this._sharetype = config.sharetype; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._wafFailureAction = config.wafFailureAction; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // autoscaling_enabled - computed: true, optional: true, required: false + private _autoscalingEnabled?: boolean | cdktf.IResolvable; + public get autoscalingEnabled() { + return this.getBooleanAttribute('autoscaling_enabled'); + } + public set autoscalingEnabled(value: boolean | cdktf.IResolvable) { + this._autoscalingEnabled = value; + } + public resetAutoscalingEnabled() { + this._autoscalingEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoscalingEnabledInput() { + return this._autoscalingEnabled; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string[]; + public get availabilityZone() { + return cdktf.Fn.tolist(this.getListAttribute('availability_zone')); + } + public set availabilityZone(value: string[]) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // backend_subnets - computed: true, optional: true, required: false + private _backendSubnets?: string[]; + public get backendSubnets() { + return cdktf.Fn.tolist(this.getListAttribute('backend_subnets')); + } + public set backendSubnets(value: string[]) { + this._backendSubnets = value; + } + public resetBackendSubnets() { + this._backendSubnets = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendSubnetsInput() { + return this._backendSubnets; + } + + // bandwidth_charge_mode - computed: true, optional: true, required: false + private _bandwidthChargeMode?: string; + public get bandwidthChargeMode() { + return this.getStringAttribute('bandwidth_charge_mode'); + } + public set bandwidthChargeMode(value: string) { + this._bandwidthChargeMode = value; + } + public resetBandwidthChargeMode() { + this._bandwidthChargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthChargeModeInput() { + return this._bandwidthChargeMode; + } + + // bandwidth_id - computed: true, optional: true, required: false + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + public resetBandwidthId() { + this._bandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // bandwidth_size - computed: true, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // cross_vpc_backend - computed: true, optional: true, required: false + private _crossVpcBackend?: boolean | cdktf.IResolvable; + public get crossVpcBackend() { + return this.getBooleanAttribute('cross_vpc_backend'); + } + public set crossVpcBackend(value: boolean | cdktf.IResolvable) { + this._crossVpcBackend = value; + } + public resetCrossVpcBackend() { + this._crossVpcBackend = undefined; + } + // Temporarily expose input value. Use with caution. + public get crossVpcBackendInput() { + return this._crossVpcBackend; + } + + // deletion_protection_enable - computed: false, optional: true, required: false + private _deletionProtectionEnable?: boolean | cdktf.IResolvable; + public get deletionProtectionEnable() { + return this.getBooleanAttribute('deletion_protection_enable'); + } + public set deletionProtectionEnable(value: boolean | cdktf.IResolvable) { + this._deletionProtectionEnable = value; + } + public resetDeletionProtectionEnable() { + this._deletionProtectionEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletionProtectionEnableInput() { + return this._deletionProtectionEnable; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // force_delete - computed: false, optional: true, required: false + private _forceDelete?: boolean | cdktf.IResolvable; + public get forceDelete() { + return this.getBooleanAttribute('force_delete'); + } + public set forceDelete(value: boolean | cdktf.IResolvable) { + this._forceDelete = value; + } + public resetForceDelete() { + this._forceDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDeleteInput() { + return this._forceDelete; + } + + // guaranteed - computed: true, optional: false, required: false + public get guaranteed() { + return this.getBooleanAttribute('guaranteed'); + } + + // gw_flavor_id - computed: true, optional: false, required: false + public get gwFlavorId() { + return this.getStringAttribute('gw_flavor_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // iptype - computed: true, optional: true, required: false + private _iptype?: string; + public get iptype() { + return this.getStringAttribute('iptype'); + } + public set iptype(value: string) { + this._iptype = value; + } + public resetIptype() { + this._iptype = undefined; + } + // Temporarily expose input value. Use with caution. + public get iptypeInput() { + return this._iptype; + } + + // ipv4_address - computed: true, optional: true, required: false + private _ipv4Address?: string; + public get ipv4Address() { + return this.getStringAttribute('ipv4_address'); + } + public set ipv4Address(value: string) { + this._ipv4Address = value; + } + public resetIpv4Address() { + this._ipv4Address = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv4AddressInput() { + return this._ipv4Address; + } + + // ipv4_eip - computed: true, optional: false, required: false + public get ipv4Eip() { + return this.getStringAttribute('ipv4_eip'); + } + + // ipv4_eip_id - computed: true, optional: true, required: false + private _ipv4EipId?: string; + public get ipv4EipId() { + return this.getStringAttribute('ipv4_eip_id'); + } + public set ipv4EipId(value: string) { + this._ipv4EipId = value; + } + public resetIpv4EipId() { + this._ipv4EipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv4EipIdInput() { + return this._ipv4EipId; + } + + // ipv4_port_id - computed: true, optional: false, required: false + public get ipv4PortId() { + return this.getStringAttribute('ipv4_port_id'); + } + + // ipv4_subnet_id - computed: false, optional: true, required: false + private _ipv4SubnetId?: string; + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + public set ipv4SubnetId(value: string) { + this._ipv4SubnetId = value; + } + public resetIpv4SubnetId() { + this._ipv4SubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv4SubnetIdInput() { + return this._ipv4SubnetId; + } + + // ipv6_address - computed: true, optional: true, required: false + private _ipv6Address?: string; + public get ipv6Address() { + return this.getStringAttribute('ipv6_address'); + } + public set ipv6Address(value: string) { + this._ipv6Address = value; + } + public resetIpv6Address() { + this._ipv6Address = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6AddressInput() { + return this._ipv6Address; + } + + // ipv6_bandwidth_id - computed: false, optional: true, required: false + private _ipv6BandwidthId?: string; + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + public set ipv6BandwidthId(value: string) { + this._ipv6BandwidthId = value; + } + public resetIpv6BandwidthId() { + this._ipv6BandwidthId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6BandwidthIdInput() { + return this._ipv6BandwidthId; + } + + // ipv6_eip - computed: true, optional: false, required: false + public get ipv6Eip() { + return this.getStringAttribute('ipv6_eip'); + } + + // ipv6_eip_id - computed: true, optional: false, required: false + public get ipv6EipId() { + return this.getStringAttribute('ipv6_eip_id'); + } + + // ipv6_network_id - computed: false, optional: true, required: false + private _ipv6NetworkId?: string; + public get ipv6NetworkId() { + return this.getStringAttribute('ipv6_network_id'); + } + public set ipv6NetworkId(value: string) { + this._ipv6NetworkId = value; + } + public resetIpv6NetworkId() { + this._ipv6NetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6NetworkIdInput() { + return this._ipv6NetworkId; + } + + // l4_flavor_id - computed: true, optional: true, required: false + private _l4FlavorId?: string; + public get l4FlavorId() { + return this.getStringAttribute('l4_flavor_id'); + } + public set l4FlavorId(value: string) { + this._l4FlavorId = value; + } + public resetL4FlavorId() { + this._l4FlavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get l4FlavorIdInput() { + return this._l4FlavorId; + } + + // l7_flavor_id - computed: true, optional: true, required: false + private _l7FlavorId?: string; + public get l7FlavorId() { + return this.getStringAttribute('l7_flavor_id'); + } + public set l7FlavorId(value: string) { + this._l7FlavorId = value; + } + public resetL7FlavorId() { + this._l7FlavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get l7FlavorIdInput() { + return this._l7FlavorId; + } + + // loadbalancer_type - computed: true, optional: true, required: false + private _loadbalancerType?: string; + public get loadbalancerType() { + return this.getStringAttribute('loadbalancer_type'); + } + public set loadbalancerType(value: string) { + this._loadbalancerType = value; + } + public resetLoadbalancerType() { + this._loadbalancerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerTypeInput() { + return this._loadbalancerType; + } + + // min_l7_flavor_id - computed: true, optional: true, required: false + private _minL7FlavorId?: string; + public get minL7FlavorId() { + return this.getStringAttribute('min_l7_flavor_id'); + } + public set minL7FlavorId(value: string) { + this._minL7FlavorId = value; + } + public resetMinL7FlavorId() { + this._minL7FlavorId = undefined; + } + // Temporarily expose input value. Use with caution. + public get minL7FlavorIdInput() { + return this._minL7FlavorId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sharetype - computed: true, optional: true, required: false + private _sharetype?: string; + public get sharetype() { + return this.getStringAttribute('sharetype'); + } + public set sharetype(value: string) { + this._sharetype = value; + } + public resetSharetype() { + this._sharetype = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharetypeInput() { + return this._sharetype; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // waf_failure_action - computed: true, optional: true, required: false + private _wafFailureAction?: string; + public get wafFailureAction() { + return this.getStringAttribute('waf_failure_action'); + } + public set wafFailureAction(value: string) { + this._wafFailureAction = value; + } + public resetWafFailureAction() { + this._wafFailureAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get wafFailureActionInput() { + return this._wafFailureAction; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbLoadbalancerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbLoadbalancerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + autoscaling_enabled: cdktf.booleanToTerraform(this._autoscalingEnabled), + availability_zone: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZone), + backend_subnets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._backendSubnets), + bandwidth_charge_mode: cdktf.stringToTerraform(this._bandwidthChargeMode), + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cross_vpc_backend: cdktf.booleanToTerraform(this._crossVpcBackend), + deletion_protection_enable: cdktf.booleanToTerraform(this._deletionProtectionEnable), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + force_delete: cdktf.booleanToTerraform(this._forceDelete), + id: cdktf.stringToTerraform(this._id), + iptype: cdktf.stringToTerraform(this._iptype), + ipv4_address: cdktf.stringToTerraform(this._ipv4Address), + ipv4_eip_id: cdktf.stringToTerraform(this._ipv4EipId), + ipv4_subnet_id: cdktf.stringToTerraform(this._ipv4SubnetId), + ipv6_address: cdktf.stringToTerraform(this._ipv6Address), + ipv6_bandwidth_id: cdktf.stringToTerraform(this._ipv6BandwidthId), + ipv6_network_id: cdktf.stringToTerraform(this._ipv6NetworkId), + l4_flavor_id: cdktf.stringToTerraform(this._l4FlavorId), + l7_flavor_id: cdktf.stringToTerraform(this._l7FlavorId), + loadbalancer_type: cdktf.stringToTerraform(this._loadbalancerType), + min_l7_flavor_id: cdktf.stringToTerraform(this._minL7FlavorId), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + region: cdktf.stringToTerraform(this._region), + sharetype: cdktf.stringToTerraform(this._sharetype), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + waf_failure_action: cdktf.stringToTerraform(this._wafFailureAction), + timeouts: elbLoadbalancerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + autoscaling_enabled: { + value: cdktf.booleanToHclTerraform(this._autoscalingEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + availability_zone: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZone), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + backend_subnets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._backendSubnets), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + bandwidth_charge_mode: { + value: cdktf.stringToHclTerraform(this._bandwidthChargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cross_vpc_backend: { + value: cdktf.booleanToHclTerraform(this._crossVpcBackend), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + deletion_protection_enable: { + value: cdktf.booleanToHclTerraform(this._deletionProtectionEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_delete: { + value: cdktf.booleanToHclTerraform(this._forceDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iptype: { + value: cdktf.stringToHclTerraform(this._iptype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv4_address: { + value: cdktf.stringToHclTerraform(this._ipv4Address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv4_eip_id: { + value: cdktf.stringToHclTerraform(this._ipv4EipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv4_subnet_id: { + value: cdktf.stringToHclTerraform(this._ipv4SubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_address: { + value: cdktf.stringToHclTerraform(this._ipv6Address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._ipv6BandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_network_id: { + value: cdktf.stringToHclTerraform(this._ipv6NetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l4_flavor_id: { + value: cdktf.stringToHclTerraform(this._l4FlavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7_flavor_id: { + value: cdktf.stringToHclTerraform(this._l7FlavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_type: { + value: cdktf.stringToHclTerraform(this._loadbalancerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + min_l7_flavor_id: { + value: cdktf.stringToHclTerraform(this._minL7FlavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sharetype: { + value: cdktf.stringToHclTerraform(this._sharetype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + waf_failure_action: { + value: cdktf.stringToHclTerraform(this._wafFailureAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: elbLoadbalancerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbLoadbalancerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-log/README.md b/src/constructs/providers/huaweicloud/elb-log/README.md new file mode 100644 index 00000000..cf363073 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log). diff --git a/src/constructs/providers/huaweicloud/elb-log/index.ts b/src/constructs/providers/huaweicloud/elb-log/index.ts new file mode 100644 index 00000000..90a63e18 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-log/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbLogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log#id ElbLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log#loadbalancer_id ElbLog#loadbalancer_id} + */ + readonly loadbalancerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log#log_group_id ElbLog#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log#log_topic_id ElbLog#log_topic_id} + */ + readonly logTopicId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log#region ElbLog#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log huaweicloud_elb_log} +*/ +export class ElbLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbLog to import + * @param importFromId The id of the existing ElbLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_log huaweicloud_elb_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbLogConfig + */ + public constructor(scope: Construct, id: string, config: ElbLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._loadbalancerId = config.loadbalancerId; + this._logGroupId = config.logGroupId; + this._logTopicId = config.logTopicId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_id - computed: false, optional: false, required: true + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_topic_id - computed: false, optional: false, required: true + private _logTopicId?: string; + public get logTopicId() { + return this.getStringAttribute('log_topic_id'); + } + public set logTopicId(value: string) { + this._logTopicId = value; + } + // Temporarily expose input value. Use with caution. + public get logTopicIdInput() { + return this._logTopicId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_topic_id: cdktf.stringToTerraform(this._logTopicId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_topic_id: { + value: cdktf.stringToHclTerraform(this._logTopicId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-logtank/README.md b/src/constructs/providers/huaweicloud/elb-logtank/README.md new file mode 100644 index 00000000..c811e434 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-logtank/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_logtank` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_logtank`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank). diff --git a/src/constructs/providers/huaweicloud/elb-logtank/index.ts b/src/constructs/providers/huaweicloud/elb-logtank/index.ts new file mode 100644 index 00000000..20c8c169 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-logtank/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbLogtankConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank#id ElbLogtank#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank#loadbalancer_id ElbLogtank#loadbalancer_id} + */ + readonly loadbalancerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank#log_group_id ElbLogtank#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank#log_topic_id ElbLogtank#log_topic_id} + */ + readonly logTopicId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank#region ElbLogtank#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank huaweicloud_elb_logtank} +*/ +export class ElbLogtank extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_logtank"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbLogtank resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbLogtank to import + * @param importFromId The id of the existing ElbLogtank that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbLogtank to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_logtank", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_logtank huaweicloud_elb_logtank} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbLogtankConfig + */ + public constructor(scope: Construct, id: string, config: ElbLogtankConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_logtank', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._loadbalancerId = config.loadbalancerId; + this._logGroupId = config.logGroupId; + this._logTopicId = config.logTopicId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_id - computed: false, optional: false, required: true + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_topic_id - computed: false, optional: false, required: true + private _logTopicId?: string; + public get logTopicId() { + return this.getStringAttribute('log_topic_id'); + } + public set logTopicId(value: string) { + this._logTopicId = value; + } + // Temporarily expose input value. Use with caution. + public get logTopicIdInput() { + return this._logTopicId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_topic_id: cdktf.stringToTerraform(this._logTopicId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_topic_id: { + value: cdktf.stringToHclTerraform(this._logTopicId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-member/README.md b/src/constructs/providers/huaweicloud/elb-member/README.md new file mode 100644 index 00000000..7f35f2bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-member/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_member` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_member`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member). diff --git a/src/constructs/providers/huaweicloud/elb-member/index.ts b/src/constructs/providers/huaweicloud/elb-member/index.ts new file mode 100644 index 00000000..97707973 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-member/index.ts @@ -0,0 +1,498 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbMemberConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#address ElbMember#address} + */ + readonly address: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#id ElbMember#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#name ElbMember#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#pool_id ElbMember#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#protocol_port ElbMember#protocol_port} + */ + readonly protocolPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#region ElbMember#region} + */ + readonly region?: string; + /** + * The IPv4 or IPv6 subnet ID of the subnet in which to access the member + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#subnet_id ElbMember#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#weight ElbMember#weight} + */ + readonly weight?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#timeouts ElbMember#timeouts} + */ + readonly timeouts?: ElbMemberTimeouts; +} +export interface ElbMemberTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#create ElbMember#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#delete ElbMember#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#update ElbMember#update} + */ + readonly update?: string; +} + +export function elbMemberTimeoutsToTerraform(struct?: ElbMemberTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function elbMemberTimeoutsToHclTerraform(struct?: ElbMemberTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbMemberTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbMemberTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbMemberTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member huaweicloud_elb_member} +*/ +export class ElbMember extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_member"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbMember resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbMember to import + * @param importFromId The id of the existing ElbMember that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbMember to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_member", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_member huaweicloud_elb_member} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbMemberConfig + */ + public constructor(scope: Construct, id: string, config: ElbMemberConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_member', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._id = config.id; + this._name = config.name; + this._poolId = config.poolId; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._subnetId = config.subnetId; + this._weight = config.weight; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // protocol_port - computed: true, optional: true, required: false + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + public resetProtocolPort() { + this._protocolPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbMemberTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbMemberTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + weight: cdktf.numberToTerraform(this._weight), + timeouts: elbMemberTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(this._weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: elbMemberTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbMemberTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-monitor/README.md b/src/constructs/providers/huaweicloud/elb-monitor/README.md new file mode 100644 index 00000000..2cd8cf25 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-monitor/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_monitor` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_monitor`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor). diff --git a/src/constructs/providers/huaweicloud/elb-monitor/index.ts b/src/constructs/providers/huaweicloud/elb-monitor/index.ts new file mode 100644 index 00000000..4148eadc --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-monitor/index.ts @@ -0,0 +1,503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbMonitorConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#domain_name ElbMonitor#domain_name} + */ + readonly domainName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#enabled ElbMonitor#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#http_method ElbMonitor#http_method} + */ + readonly httpMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#id ElbMonitor#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#interval ElbMonitor#interval} + */ + readonly interval: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#max_retries ElbMonitor#max_retries} + */ + readonly maxRetries: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#max_retries_down ElbMonitor#max_retries_down} + */ + readonly maxRetriesDown?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#name ElbMonitor#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#pool_id ElbMonitor#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#port ElbMonitor#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#protocol ElbMonitor#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#region ElbMonitor#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#status_code ElbMonitor#status_code} + */ + readonly statusCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#timeout ElbMonitor#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#url_path ElbMonitor#url_path} + */ + readonly urlPath?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor huaweicloud_elb_monitor} +*/ +export class ElbMonitor extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_monitor"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbMonitor resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbMonitor to import + * @param importFromId The id of the existing ElbMonitor that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbMonitor to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_monitor", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_monitor huaweicloud_elb_monitor} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbMonitorConfig + */ + public constructor(scope: Construct, id: string, config: ElbMonitorConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_monitor', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainName = config.domainName; + this._enabled = config.enabled; + this._httpMethod = config.httpMethod; + this._id = config.id; + this._interval = config.interval; + this._maxRetries = config.maxRetries; + this._maxRetriesDown = config.maxRetriesDown; + this._name = config.name; + this._poolId = config.poolId; + this._port = config.port; + this._protocol = config.protocol; + this._region = config.region; + this._statusCode = config.statusCode; + this._timeout = config.timeout; + this._urlPath = config.urlPath; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // domain_name - computed: true, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // http_method - computed: true, optional: true, required: false + private _httpMethod?: string; + public get httpMethod() { + return this.getStringAttribute('http_method'); + } + public set httpMethod(value: string) { + this._httpMethod = value; + } + public resetHttpMethod() { + this._httpMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpMethodInput() { + return this._httpMethod; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interval - computed: false, optional: false, required: true + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // max_retries - computed: false, optional: false, required: true + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // max_retries_down - computed: true, optional: true, required: false + private _maxRetriesDown?: number; + public get maxRetriesDown() { + return this.getNumberAttribute('max_retries_down'); + } + public set maxRetriesDown(value: number) { + this._maxRetriesDown = value; + } + public resetMaxRetriesDown() { + this._maxRetriesDown = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesDownInput() { + return this._maxRetriesDown; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status_code - computed: true, optional: true, required: false + private _statusCode?: string; + public get statusCode() { + return this.getStringAttribute('status_code'); + } + public set statusCode(value: string) { + this._statusCode = value; + } + public resetStatusCode() { + this._statusCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusCodeInput() { + return this._statusCode; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // url_path - computed: true, optional: true, required: false + private _urlPath?: string; + public get urlPath() { + return this.getStringAttribute('url_path'); + } + public set urlPath(value: string) { + this._urlPath = value; + } + public resetUrlPath() { + this._urlPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlPathInput() { + return this._urlPath; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_name: cdktf.stringToTerraform(this._domainName), + enabled: cdktf.booleanToTerraform(this._enabled), + http_method: cdktf.stringToTerraform(this._httpMethod), + id: cdktf.stringToTerraform(this._id), + interval: cdktf.numberToTerraform(this._interval), + max_retries: cdktf.numberToTerraform(this._maxRetries), + max_retries_down: cdktf.numberToTerraform(this._maxRetriesDown), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + port: cdktf.numberToTerraform(this._port), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + status_code: cdktf.stringToTerraform(this._statusCode), + timeout: cdktf.numberToTerraform(this._timeout), + url_path: cdktf.stringToTerraform(this._urlPath), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + http_method: { + value: cdktf.stringToHclTerraform(this._httpMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(this._interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries_down: { + value: cdktf.numberToHclTerraform(this._maxRetriesDown), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_code: { + value: cdktf.stringToHclTerraform(this._statusCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + url_path: { + value: cdktf.stringToHclTerraform(this._urlPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-pool/README.md b/src/constructs/providers/huaweicloud/elb-pool/README.md new file mode 100644 index 00000000..31561ea8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-pool/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_pool` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool). diff --git a/src/constructs/providers/huaweicloud/elb-pool/index.ts b/src/constructs/providers/huaweicloud/elb-pool/index.ts new file mode 100644 index 00000000..c0c2be34 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-pool/index.ts @@ -0,0 +1,1024 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbPoolConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#any_port_enable ElbPool#any_port_enable} + */ + readonly anyPortEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#connection_drain_enabled ElbPool#connection_drain_enabled} + */ + readonly connectionDrainEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#connection_drain_timeout ElbPool#connection_drain_timeout} + */ + readonly connectionDrainTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#deletion_protection_enable ElbPool#deletion_protection_enable} + */ + readonly deletionProtectionEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#description ElbPool#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#id ElbPool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#ip_version ElbPool#ip_version} + */ + readonly ipVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#lb_method ElbPool#lb_method} + */ + readonly lbMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#listener_id ElbPool#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#loadbalancer_id ElbPool#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#minimum_healthy_member_count ElbPool#minimum_healthy_member_count} + */ + readonly minimumHealthyMemberCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#name ElbPool#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#protection_reason ElbPool#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#protection_status ElbPool#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#protocol ElbPool#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#region ElbPool#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#slow_start_duration ElbPool#slow_start_duration} + */ + readonly slowStartDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#slow_start_enabled ElbPool#slow_start_enabled} + */ + readonly slowStartEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#type ElbPool#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#vpc_id ElbPool#vpc_id} + */ + readonly vpcId?: string; + /** + * persistence block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#persistence ElbPool#persistence} + */ + readonly persistence?: ElbPoolPersistence; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#timeouts ElbPool#timeouts} + */ + readonly timeouts?: ElbPoolTimeouts; +} +export interface ElbPoolPersistence { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#cookie_name ElbPool#cookie_name} + */ + readonly cookieName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#timeout ElbPool#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#type ElbPool#type} + */ + readonly type: string; +} + +export function elbPoolPersistenceToTerraform(struct?: ElbPoolPersistenceOutputReference | ElbPoolPersistence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cookie_name: cdktf.stringToTerraform(struct!.cookieName), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function elbPoolPersistenceToHclTerraform(struct?: ElbPoolPersistenceOutputReference | ElbPoolPersistence): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cookie_name: { + value: cdktf.stringToHclTerraform(struct!.cookieName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbPoolPersistenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ElbPoolPersistence | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cookieName !== undefined) { + hasAnyValues = true; + internalValueResult.cookieName = this._cookieName; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbPoolPersistence | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cookieName = undefined; + this._timeout = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cookieName = value.cookieName; + this._timeout = value.timeout; + this._type = value.type; + } + } + + // cookie_name - computed: false, optional: true, required: false + private _cookieName?: string; + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + public set cookieName(value: string) { + this._cookieName = value; + } + public resetCookieName() { + this._cookieName = undefined; + } + // Temporarily expose input value. Use with caution. + public get cookieNameInput() { + return this._cookieName; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface ElbPoolTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#create ElbPool#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#delete ElbPool#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#update ElbPool#update} + */ + readonly update?: string; +} + +export function elbPoolTimeoutsToTerraform(struct?: ElbPoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function elbPoolTimeoutsToHclTerraform(struct?: ElbPoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ElbPoolTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ElbPoolTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbPoolTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool huaweicloud_elb_pool} +*/ +export class ElbPool extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbPool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbPool to import + * @param importFromId The id of the existing ElbPool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbPool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_pool huaweicloud_elb_pool} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbPoolConfig + */ + public constructor(scope: Construct, id: string, config: ElbPoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._anyPortEnable = config.anyPortEnable; + this._connectionDrainEnabled = config.connectionDrainEnabled; + this._connectionDrainTimeout = config.connectionDrainTimeout; + this._deletionProtectionEnable = config.deletionProtectionEnable; + this._description = config.description; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._lbMethod = config.lbMethod; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._minimumHealthyMemberCount = config.minimumHealthyMemberCount; + this._name = config.name; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._protocol = config.protocol; + this._region = config.region; + this._slowStartDuration = config.slowStartDuration; + this._slowStartEnabled = config.slowStartEnabled; + this._type = config.type; + this._vpcId = config.vpcId; + this._persistence.internalValue = config.persistence; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // any_port_enable - computed: true, optional: true, required: false + private _anyPortEnable?: boolean | cdktf.IResolvable; + public get anyPortEnable() { + return this.getBooleanAttribute('any_port_enable'); + } + public set anyPortEnable(value: boolean | cdktf.IResolvable) { + this._anyPortEnable = value; + } + public resetAnyPortEnable() { + this._anyPortEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get anyPortEnableInput() { + return this._anyPortEnable; + } + + // connection_drain_enabled - computed: true, optional: true, required: false + private _connectionDrainEnabled?: boolean | cdktf.IResolvable; + public get connectionDrainEnabled() { + return this.getBooleanAttribute('connection_drain_enabled'); + } + public set connectionDrainEnabled(value: boolean | cdktf.IResolvable) { + this._connectionDrainEnabled = value; + } + public resetConnectionDrainEnabled() { + this._connectionDrainEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionDrainEnabledInput() { + return this._connectionDrainEnabled; + } + + // connection_drain_timeout - computed: true, optional: true, required: false + private _connectionDrainTimeout?: number; + public get connectionDrainTimeout() { + return this.getNumberAttribute('connection_drain_timeout'); + } + public set connectionDrainTimeout(value: number) { + this._connectionDrainTimeout = value; + } + public resetConnectionDrainTimeout() { + this._connectionDrainTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionDrainTimeoutInput() { + return this._connectionDrainTimeout; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // deletion_protection_enable - computed: false, optional: true, required: false + private _deletionProtectionEnable?: boolean | cdktf.IResolvable; + public get deletionProtectionEnable() { + return this.getBooleanAttribute('deletion_protection_enable'); + } + public set deletionProtectionEnable(value: boolean | cdktf.IResolvable) { + this._deletionProtectionEnable = value; + } + public resetDeletionProtectionEnable() { + this._deletionProtectionEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get deletionProtectionEnableInput() { + return this._deletionProtectionEnable; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: string; + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + public set ipVersion(value: string) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // lb_method - computed: false, optional: false, required: true + private _lbMethod?: string; + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + public set lbMethod(value: string) { + this._lbMethod = value; + } + // Temporarily expose input value. Use with caution. + public get lbMethodInput() { + return this._lbMethod; + } + + // listener_id - computed: true, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // loadbalancer_id - computed: true, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // minimum_healthy_member_count - computed: true, optional: true, required: false + private _minimumHealthyMemberCount?: number; + public get minimumHealthyMemberCount() { + return this.getNumberAttribute('minimum_healthy_member_count'); + } + public set minimumHealthyMemberCount(value: number) { + this._minimumHealthyMemberCount = value; + } + public resetMinimumHealthyMemberCount() { + this._minimumHealthyMemberCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get minimumHealthyMemberCountInput() { + return this._minimumHealthyMemberCount; + } + + // monitor_id - computed: true, optional: false, required: false + public get monitorId() { + return this.getStringAttribute('monitor_id'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // slow_start_duration - computed: true, optional: true, required: false + private _slowStartDuration?: number; + public get slowStartDuration() { + return this.getNumberAttribute('slow_start_duration'); + } + public set slowStartDuration(value: number) { + this._slowStartDuration = value; + } + public resetSlowStartDuration() { + this._slowStartDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowStartDurationInput() { + return this._slowStartDuration; + } + + // slow_start_enabled - computed: true, optional: true, required: false + private _slowStartEnabled?: boolean | cdktf.IResolvable; + public get slowStartEnabled() { + return this.getBooleanAttribute('slow_start_enabled'); + } + public set slowStartEnabled(value: boolean | cdktf.IResolvable) { + this._slowStartEnabled = value; + } + public resetSlowStartEnabled() { + this._slowStartEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowStartEnabledInput() { + return this._slowStartEnabled; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // persistence - computed: false, optional: true, required: false + private _persistence = new ElbPoolPersistenceOutputReference(this, "persistence"); + public get persistence() { + return this._persistence; + } + public putPersistence(value: ElbPoolPersistence) { + this._persistence.internalValue = value; + } + public resetPersistence() { + this._persistence.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get persistenceInput() { + return this._persistence.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ElbPoolTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ElbPoolTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + any_port_enable: cdktf.booleanToTerraform(this._anyPortEnable), + connection_drain_enabled: cdktf.booleanToTerraform(this._connectionDrainEnabled), + connection_drain_timeout: cdktf.numberToTerraform(this._connectionDrainTimeout), + deletion_protection_enable: cdktf.booleanToTerraform(this._deletionProtectionEnable), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.stringToTerraform(this._ipVersion), + lb_method: cdktf.stringToTerraform(this._lbMethod), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + minimum_healthy_member_count: cdktf.numberToTerraform(this._minimumHealthyMemberCount), + name: cdktf.stringToTerraform(this._name), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + slow_start_duration: cdktf.numberToTerraform(this._slowStartDuration), + slow_start_enabled: cdktf.booleanToTerraform(this._slowStartEnabled), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + persistence: elbPoolPersistenceToTerraform(this._persistence.internalValue), + timeouts: elbPoolTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + any_port_enable: { + value: cdktf.booleanToHclTerraform(this._anyPortEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + connection_drain_enabled: { + value: cdktf.booleanToHclTerraform(this._connectionDrainEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + connection_drain_timeout: { + value: cdktf.numberToHclTerraform(this._connectionDrainTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + deletion_protection_enable: { + value: cdktf.booleanToHclTerraform(this._deletionProtectionEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.stringToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_method: { + value: cdktf.stringToHclTerraform(this._lbMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + minimum_healthy_member_count: { + value: cdktf.numberToHclTerraform(this._minimumHealthyMemberCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slow_start_duration: { + value: cdktf.numberToHclTerraform(this._slowStartDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + slow_start_enabled: { + value: cdktf.booleanToHclTerraform(this._slowStartEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + persistence: { + value: elbPoolPersistenceToHclTerraform(this._persistence.internalValue), + isBlock: true, + type: "list", + storageClassType: "ElbPoolPersistenceList", + }, + timeouts: { + value: elbPoolTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ElbPoolTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/elb-security-policy/README.md b/src/constructs/providers/huaweicloud/elb-security-policy/README.md new file mode 100644 index 00000000..4d42d88d --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-security-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_elb_security_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_elb_security_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy). diff --git a/src/constructs/providers/huaweicloud/elb-security-policy/index.ts b/src/constructs/providers/huaweicloud/elb-security-policy/index.ts new file mode 100644 index 00000000..31361013 --- /dev/null +++ b/src/constructs/providers/huaweicloud/elb-security-policy/index.ts @@ -0,0 +1,379 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ElbSecurityPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cipher suite list of the security policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#ciphers ElbSecurityPolicy#ciphers} + */ + readonly ciphers: string[]; + /** + * Specifies the description of the ELB security policy + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#description ElbSecurityPolicy#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID to which the Enterprise router belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#enterprise_project_id ElbSecurityPolicy#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#id ElbSecurityPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ELB security policy name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#name ElbSecurityPolicy#name} + */ + readonly name?: string; + /** + * Specifies the TSL protocol list which the security policy select. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#protocols ElbSecurityPolicy#protocols} + */ + readonly protocols: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#region ElbSecurityPolicy#region} + */ + readonly region?: string; +} +export interface ElbSecurityPolicyListeners { +} + +export function elbSecurityPolicyListenersToTerraform(struct?: ElbSecurityPolicyListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function elbSecurityPolicyListenersToHclTerraform(struct?: ElbSecurityPolicyListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ElbSecurityPolicyListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ElbSecurityPolicyListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ElbSecurityPolicyListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } +} + +export class ElbSecurityPolicyListenersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ElbSecurityPolicyListenersOutputReference { + return new ElbSecurityPolicyListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy huaweicloud_elb_security_policy} +*/ +export class ElbSecurityPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_elb_security_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ElbSecurityPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ElbSecurityPolicy to import + * @param importFromId The id of the existing ElbSecurityPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ElbSecurityPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_elb_security_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/elb_security_policy huaweicloud_elb_security_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ElbSecurityPolicyConfig + */ + public constructor(scope: Construct, id: string, config: ElbSecurityPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_elb_security_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._ciphers = config.ciphers; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._protocols = config.protocols; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // ciphers - computed: false, optional: false, required: true + private _ciphers?: string[]; + public get ciphers() { + return this.getListAttribute('ciphers'); + } + public set ciphers(value: string[]) { + this._ciphers = value; + } + // Temporarily expose input value. Use with caution. + public get ciphersInput() { + return this._ciphers; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listeners - computed: true, optional: false, required: false + private _listeners = new ElbSecurityPolicyListenersList(this, "listeners", false); + public get listeners() { + return this._listeners; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocols - computed: false, optional: false, required: true + private _protocols?: string[]; + public get protocols() { + return this.getListAttribute('protocols'); + } + public set protocols(value: string[]) { + this._protocols = value; + } + // Temporarily expose input value. Use with caution. + public get protocolsInput() { + return this._protocols; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + ciphers: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ciphers), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocols: cdktf.listMapper(cdktf.stringToTerraform, false)(this._protocols), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + ciphers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ciphers), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocols: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._protocols), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/enterprise-project-authority/README.md b/src/constructs/providers/huaweicloud/enterprise-project-authority/README.md new file mode 100644 index 00000000..33e37d9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/enterprise-project-authority/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_enterprise_project_authority` + +Refer to the Terraform Registry for docs: [`huaweicloud_enterprise_project_authority`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project_authority). diff --git a/src/constructs/providers/huaweicloud/enterprise-project-authority/index.ts b/src/constructs/providers/huaweicloud/enterprise-project-authority/index.ts new file mode 100644 index 00000000..014321fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/enterprise-project-authority/index.ts @@ -0,0 +1,116 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project_authority +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EnterpriseProjectAuthorityConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project_authority#id EnterpriseProjectAuthority#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project_authority huaweicloud_enterprise_project_authority} +*/ +export class EnterpriseProjectAuthority extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_enterprise_project_authority"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EnterpriseProjectAuthority resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EnterpriseProjectAuthority to import + * @param importFromId The id of the existing EnterpriseProjectAuthority that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project_authority#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EnterpriseProjectAuthority to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_enterprise_project_authority", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project_authority huaweicloud_enterprise_project_authority} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EnterpriseProjectAuthorityConfig = {} + */ + public constructor(scope: Construct, id: string, config: EnterpriseProjectAuthorityConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_enterprise_project_authority', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/enterprise-project/README.md b/src/constructs/providers/huaweicloud/enterprise-project/README.md new file mode 100644 index 00000000..9fd8605d --- /dev/null +++ b/src/constructs/providers/huaweicloud/enterprise-project/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_enterprise_project` + +Refer to the Terraform Registry for docs: [`huaweicloud_enterprise_project`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project). diff --git a/src/constructs/providers/huaweicloud/enterprise-project/index.ts b/src/constructs/providers/huaweicloud/enterprise-project/index.ts new file mode 100644 index 00000000..3563ec84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/enterprise-project/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EnterpriseProjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#description EnterpriseProject#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#enable EnterpriseProject#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#id EnterpriseProject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#name EnterpriseProject#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#skip_disable_on_destroy EnterpriseProject#skip_disable_on_destroy} + */ + readonly skipDisableOnDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#type EnterpriseProject#type} + */ + readonly type?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#timeouts EnterpriseProject#timeouts} + */ + readonly timeouts?: EnterpriseProjectTimeouts; +} +export interface EnterpriseProjectTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#create EnterpriseProject#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#delete EnterpriseProject#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#update EnterpriseProject#update} + */ + readonly update?: string; +} + +export function enterpriseProjectTimeoutsToTerraform(struct?: EnterpriseProjectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function enterpriseProjectTimeoutsToHclTerraform(struct?: EnterpriseProjectTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EnterpriseProjectTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): EnterpriseProjectTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EnterpriseProjectTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project huaweicloud_enterprise_project} +*/ +export class EnterpriseProject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_enterprise_project"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EnterpriseProject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EnterpriseProject to import + * @param importFromId The id of the existing EnterpriseProject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EnterpriseProject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_enterprise_project", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/enterprise_project huaweicloud_enterprise_project} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EnterpriseProjectConfig + */ + public constructor(scope: Construct, id: string, config: EnterpriseProjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_enterprise_project', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enable = config.enable; + this._id = config.id; + this._name = config.name; + this._skipDisableOnDestroy = config.skipDisableOnDestroy; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // skip_disable_on_destroy - computed: false, optional: true, required: false + private _skipDisableOnDestroy?: boolean | cdktf.IResolvable; + public get skipDisableOnDestroy() { + return this.getBooleanAttribute('skip_disable_on_destroy'); + } + public set skipDisableOnDestroy(value: boolean | cdktf.IResolvable) { + this._skipDisableOnDestroy = value; + } + public resetSkipDisableOnDestroy() { + this._skipDisableOnDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get skipDisableOnDestroyInput() { + return this._skipDisableOnDestroy; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new EnterpriseProjectTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: EnterpriseProjectTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable: cdktf.booleanToTerraform(this._enable), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + skip_disable_on_destroy: cdktf.booleanToTerraform(this._skipDisableOnDestroy), + type: cdktf.stringToTerraform(this._type), + timeouts: enterpriseProjectTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.booleanToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + skip_disable_on_destroy: { + value: cdktf.booleanToHclTerraform(this._skipDisableOnDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: enterpriseProjectTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "EnterpriseProjectTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-association/README.md b/src/constructs/providers/huaweicloud/er-association/README.md new file mode 100644 index 00000000..6700b70e --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-association/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_association` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_association`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association). diff --git a/src/constructs/providers/huaweicloud/er-association/index.ts b/src/constructs/providers/huaweicloud/er-association/index.ts new file mode 100644 index 00000000..e8333a74 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-association/index.ts @@ -0,0 +1,404 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErAssociationConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the attachment corresponding to the association. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#attachment_id ErAssociation#attachment_id} + */ + readonly attachmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#id ErAssociation#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the ER instance to which the route table and the attachment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#instance_id ErAssociation#instance_id} + */ + readonly instanceId: string; + /** + * The region where the ER instance and route table are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#region ErAssociation#region} + */ + readonly region?: string; + /** + * The ID of the route table to which the association belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#route_table_id ErAssociation#route_table_id} + */ + readonly routeTableId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#timeouts ErAssociation#timeouts} + */ + readonly timeouts?: ErAssociationTimeouts; +} +export interface ErAssociationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#create ErAssociation#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#delete ErAssociation#delete} + */ + readonly delete?: string; +} + +export function erAssociationTimeoutsToTerraform(struct?: ErAssociationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function erAssociationTimeoutsToHclTerraform(struct?: ErAssociationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErAssociationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErAssociationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErAssociationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association huaweicloud_er_association} +*/ +export class ErAssociation extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_association"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErAssociation resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErAssociation to import + * @param importFromId The id of the existing ErAssociation that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErAssociation to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_association", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_association huaweicloud_er_association} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErAssociationConfig + */ + public constructor(scope: Construct, id: string, config: ErAssociationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_association', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_id - computed: false, optional: false, required: true + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: false, required: true + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErAssociationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErAssociationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + timeouts: erAssociationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: erAssociationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErAssociationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-flow-log/README.md b/src/constructs/providers/huaweicloud/er-flow-log/README.md new file mode 100644 index 00000000..0c8fa8dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-flow-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_flow_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_flow_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log). diff --git a/src/constructs/providers/huaweicloud/er-flow-log/index.ts b/src/constructs/providers/huaweicloud/er-flow-log/index.ts new file mode 100644 index 00000000..1b4221f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-flow-log/index.ts @@ -0,0 +1,580 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErFlowLogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#description ErFlowLog#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#enabled ErFlowLog#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#id ErFlowLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#instance_id ErFlowLog#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#log_group_id ErFlowLog#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#log_store_type ErFlowLog#log_store_type} + */ + readonly logStoreType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#log_stream_id ErFlowLog#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#name ErFlowLog#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#region ErFlowLog#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#resource_id ErFlowLog#resource_id} + */ + readonly resourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#resource_type ErFlowLog#resource_type} + */ + readonly resourceType: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#timeouts ErFlowLog#timeouts} + */ + readonly timeouts?: ErFlowLogTimeouts; +} +export interface ErFlowLogTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#create ErFlowLog#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#delete ErFlowLog#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#update ErFlowLog#update} + */ + readonly update?: string; +} + +export function erFlowLogTimeoutsToTerraform(struct?: ErFlowLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function erFlowLogTimeoutsToHclTerraform(struct?: ErFlowLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErFlowLogTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErFlowLogTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErFlowLogTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log huaweicloud_er_flow_log} +*/ +export class ErFlowLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_flow_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErFlowLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErFlowLog to import + * @param importFromId The id of the existing ErFlowLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErFlowLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_flow_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_flow_log huaweicloud_er_flow_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErFlowLogConfig + */ + public constructor(scope: Construct, id: string, config: ErFlowLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_flow_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._instanceId = config.instanceId; + this._logGroupId = config.logGroupId; + this._logStoreType = config.logStoreType; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_store_type - computed: false, optional: false, required: true + private _logStoreType?: string; + public get logStoreType() { + return this.getStringAttribute('log_store_type'); + } + public set logStoreType(value: string) { + this._logStoreType = value; + } + // Temporarily expose input value. Use with caution. + public get logStoreTypeInput() { + return this._logStoreType; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErFlowLogTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErFlowLogTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_store_type: cdktf.stringToTerraform(this._logStoreType), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + timeouts: erFlowLogTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_store_type: { + value: cdktf.stringToHclTerraform(this._logStoreType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: erFlowLogTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErFlowLogTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-instance/README.md b/src/constructs/providers/huaweicloud/er-instance/README.md new file mode 100644 index 00000000..74abc43b --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance). diff --git a/src/constructs/providers/huaweicloud/er-instance/index.ts b/src/constructs/providers/huaweicloud/er-instance/index.ts new file mode 100644 index 00000000..d60ff6b0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-instance/index.ts @@ -0,0 +1,668 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * The BGP AS number of the Enterprise router. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#asn ErInstance#asn} + */ + readonly asn: number; + /** + * Whether to automatically accept the creation of shared attachment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#auto_accept_shared_attachments ErInstance#auto_accept_shared_attachments} + */ + readonly autoAcceptSharedAttachments?: boolean | cdktf.IResolvable; + /** + * The availability zone list where the Enterprise router is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#availability_zones ErInstance#availability_zones} + */ + readonly availabilityZones: string[]; + /** + * The ID of the default association route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#default_association_route_table_id ErInstance#default_association_route_table_id} + */ + readonly defaultAssociationRouteTableId?: string; + /** + * The ID of the default propagation route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#default_propagation_route_table_id ErInstance#default_propagation_route_table_id} + */ + readonly defaultPropagationRouteTableId?: string; + /** + * The description of the Enterprise router. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#description ErInstance#description} + */ + readonly description?: string; + /** + * Whether to enable the association of the default route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#enable_default_association ErInstance#enable_default_association} + */ + readonly enableDefaultAssociation?: boolean | cdktf.IResolvable; + /** + * Whether to enable the propagation of the default route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#enable_default_propagation ErInstance#enable_default_propagation} + */ + readonly enableDefaultPropagation?: boolean | cdktf.IResolvable; + /** + * The enterprise project ID to which the Enterprise router belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#enterprise_project_id ErInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#id ErInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The router name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#name ErInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#region ErInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#tags ErInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#timeouts ErInstance#timeouts} + */ + readonly timeouts?: ErInstanceTimeouts; +} +export interface ErInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#create ErInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#delete ErInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#update ErInstance#update} + */ + readonly update?: string; +} + +export function erInstanceTimeoutsToTerraform(struct?: ErInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function erInstanceTimeoutsToHclTerraform(struct?: ErInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance huaweicloud_er_instance} +*/ +export class ErInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErInstance to import + * @param importFromId The id of the existing ErInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_instance huaweicloud_er_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErInstanceConfig + */ + public constructor(scope: Construct, id: string, config: ErInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._asn = config.asn; + this._autoAcceptSharedAttachments = config.autoAcceptSharedAttachments; + this._availabilityZones = config.availabilityZones; + this._defaultAssociationRouteTableId = config.defaultAssociationRouteTableId; + this._defaultPropagationRouteTableId = config.defaultPropagationRouteTableId; + this._description = config.description; + this._enableDefaultAssociation = config.enableDefaultAssociation; + this._enableDefaultPropagation = config.enableDefaultPropagation; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // asn - computed: false, optional: false, required: true + private _asn?: number; + public get asn() { + return this.getNumberAttribute('asn'); + } + public set asn(value: number) { + this._asn = value; + } + // Temporarily expose input value. Use with caution. + public get asnInput() { + return this._asn; + } + + // auto_accept_shared_attachments - computed: false, optional: true, required: false + private _autoAcceptSharedAttachments?: boolean | cdktf.IResolvable; + public get autoAcceptSharedAttachments() { + return this.getBooleanAttribute('auto_accept_shared_attachments'); + } + public set autoAcceptSharedAttachments(value: boolean | cdktf.IResolvable) { + this._autoAcceptSharedAttachments = value; + } + public resetAutoAcceptSharedAttachments() { + this._autoAcceptSharedAttachments = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoAcceptSharedAttachmentsInput() { + return this._autoAcceptSharedAttachments; + } + + // availability_zones - computed: false, optional: false, required: true + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_association_route_table_id - computed: true, optional: true, required: false + private _defaultAssociationRouteTableId?: string; + public get defaultAssociationRouteTableId() { + return this.getStringAttribute('default_association_route_table_id'); + } + public set defaultAssociationRouteTableId(value: string) { + this._defaultAssociationRouteTableId = value; + } + public resetDefaultAssociationRouteTableId() { + this._defaultAssociationRouteTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultAssociationRouteTableIdInput() { + return this._defaultAssociationRouteTableId; + } + + // default_propagation_route_table_id - computed: true, optional: true, required: false + private _defaultPropagationRouteTableId?: string; + public get defaultPropagationRouteTableId() { + return this.getStringAttribute('default_propagation_route_table_id'); + } + public set defaultPropagationRouteTableId(value: string) { + this._defaultPropagationRouteTableId = value; + } + public resetDefaultPropagationRouteTableId() { + this._defaultPropagationRouteTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultPropagationRouteTableIdInput() { + return this._defaultPropagationRouteTableId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_default_association - computed: false, optional: true, required: false + private _enableDefaultAssociation?: boolean | cdktf.IResolvable; + public get enableDefaultAssociation() { + return this.getBooleanAttribute('enable_default_association'); + } + public set enableDefaultAssociation(value: boolean | cdktf.IResolvable) { + this._enableDefaultAssociation = value; + } + public resetEnableDefaultAssociation() { + this._enableDefaultAssociation = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDefaultAssociationInput() { + return this._enableDefaultAssociation; + } + + // enable_default_propagation - computed: false, optional: true, required: false + private _enableDefaultPropagation?: boolean | cdktf.IResolvable; + public get enableDefaultPropagation() { + return this.getBooleanAttribute('enable_default_propagation'); + } + public set enableDefaultPropagation(value: boolean | cdktf.IResolvable) { + this._enableDefaultPropagation = value; + } + public resetEnableDefaultPropagation() { + this._enableDefaultPropagation = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDefaultPropagationInput() { + return this._enableDefaultPropagation; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + asn: cdktf.numberToTerraform(this._asn), + auto_accept_shared_attachments: cdktf.booleanToTerraform(this._autoAcceptSharedAttachments), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + default_association_route_table_id: cdktf.stringToTerraform(this._defaultAssociationRouteTableId), + default_propagation_route_table_id: cdktf.stringToTerraform(this._defaultPropagationRouteTableId), + description: cdktf.stringToTerraform(this._description), + enable_default_association: cdktf.booleanToTerraform(this._enableDefaultAssociation), + enable_default_propagation: cdktf.booleanToTerraform(this._enableDefaultPropagation), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: erInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + asn: { + value: cdktf.numberToHclTerraform(this._asn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + auto_accept_shared_attachments: { + value: cdktf.booleanToHclTerraform(this._autoAcceptSharedAttachments), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + default_association_route_table_id: { + value: cdktf.stringToHclTerraform(this._defaultAssociationRouteTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default_propagation_route_table_id: { + value: cdktf.stringToHclTerraform(this._defaultPropagationRouteTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_default_association: { + value: cdktf.booleanToHclTerraform(this._enableDefaultAssociation), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_default_propagation: { + value: cdktf.booleanToHclTerraform(this._enableDefaultPropagation), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: erInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-propagation/README.md b/src/constructs/providers/huaweicloud/er-propagation/README.md new file mode 100644 index 00000000..aaea6d8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-propagation/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_propagation` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_propagation`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation). diff --git a/src/constructs/providers/huaweicloud/er-propagation/index.ts b/src/constructs/providers/huaweicloud/er-propagation/index.ts new file mode 100644 index 00000000..8aa5b929 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-propagation/index.ts @@ -0,0 +1,404 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErPropagationConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the attachment corresponding to the propagation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#attachment_id ErPropagation#attachment_id} + */ + readonly attachmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#id ErPropagation#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the ER instance to which the route table and the attachment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#instance_id ErPropagation#instance_id} + */ + readonly instanceId: string; + /** + * The region where the ER instance and route table are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#region ErPropagation#region} + */ + readonly region?: string; + /** + * The ID of the route table to which the propagation belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#route_table_id ErPropagation#route_table_id} + */ + readonly routeTableId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#timeouts ErPropagation#timeouts} + */ + readonly timeouts?: ErPropagationTimeouts; +} +export interface ErPropagationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#create ErPropagation#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#delete ErPropagation#delete} + */ + readonly delete?: string; +} + +export function erPropagationTimeoutsToTerraform(struct?: ErPropagationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function erPropagationTimeoutsToHclTerraform(struct?: ErPropagationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErPropagationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErPropagationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErPropagationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation huaweicloud_er_propagation} +*/ +export class ErPropagation extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_propagation"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErPropagation resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErPropagation to import + * @param importFromId The id of the existing ErPropagation that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErPropagation to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_propagation", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_propagation huaweicloud_er_propagation} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErPropagationConfig + */ + public constructor(scope: Construct, id: string, config: ErPropagationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_propagation', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_id - computed: false, optional: false, required: true + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // attachment_type - computed: true, optional: false, required: false + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: false, required: true + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErPropagationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErPropagationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + timeouts: erPropagationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: erPropagationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErPropagationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-route-table/README.md b/src/constructs/providers/huaweicloud/er-route-table/README.md new file mode 100644 index 00000000..e48e3266 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-route-table/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_route_table` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_route_table`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table). diff --git a/src/constructs/providers/huaweicloud/er-route-table/index.ts b/src/constructs/providers/huaweicloud/er-route-table/index.ts new file mode 100644 index 00000000..1189abde --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-route-table/index.ts @@ -0,0 +1,473 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErRouteTableConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the ER route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#description ErRouteTable#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#id ErRouteTable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the ER instance to which the route table belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#instance_id ErRouteTable#instance_id} + */ + readonly instanceId: string; + /** + * The name of the route table. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#name ErRouteTable#name} + */ + readonly name: string; + /** + * The region where the ER instance and route table are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#region ErRouteTable#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#tags ErRouteTable#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#timeouts ErRouteTable#timeouts} + */ + readonly timeouts?: ErRouteTableTimeouts; +} +export interface ErRouteTableTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#create ErRouteTable#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#delete ErRouteTable#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#update ErRouteTable#update} + */ + readonly update?: string; +} + +export function erRouteTableTimeoutsToTerraform(struct?: ErRouteTableTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function erRouteTableTimeoutsToHclTerraform(struct?: ErRouteTableTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErRouteTableTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErRouteTableTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErRouteTableTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table huaweicloud_er_route_table} +*/ +export class ErRouteTable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_route_table"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErRouteTable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErRouteTable to import + * @param importFromId The id of the existing ErRouteTable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErRouteTable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_route_table", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_route_table huaweicloud_er_route_table} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErRouteTableConfig + */ + public constructor(scope: Construct, id: string, config: ErRouteTableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_route_table', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_default_association - computed: true, optional: false, required: false + public get isDefaultAssociation() { + return this.getBooleanAttribute('is_default_association'); + } + + // is_default_propagation - computed: true, optional: false, required: false + public get isDefaultPropagation() { + return this.getBooleanAttribute('is_default_propagation'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErRouteTableTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErRouteTableTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: erRouteTableTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: erRouteTableTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErRouteTableTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-static-route/README.md b/src/constructs/providers/huaweicloud/er-static-route/README.md new file mode 100644 index 00000000..d371f883 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-static-route/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_static_route` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_static_route`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route). diff --git a/src/constructs/providers/huaweicloud/er-static-route/index.ts b/src/constructs/providers/huaweicloud/er-static-route/index.ts new file mode 100644 index 00000000..5d6d4ebe --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-static-route/index.ts @@ -0,0 +1,470 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErStaticRouteConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the corresponding attachment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#attachment_id ErStaticRoute#attachment_id} + */ + readonly attachmentId?: string; + /** + * The destination of the static route. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#destination ErStaticRoute#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#id ErStaticRoute#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether route is the black hole route. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#is_blackhole ErStaticRoute#is_blackhole} + */ + readonly isBlackhole?: boolean | cdktf.IResolvable; + /** + * The region where the static route and related route table are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#region ErStaticRoute#region} + */ + readonly region?: string; + /** + * The ID of the route table to which the static route belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#route_table_id ErStaticRoute#route_table_id} + */ + readonly routeTableId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#timeouts ErStaticRoute#timeouts} + */ + readonly timeouts?: ErStaticRouteTimeouts; +} +export interface ErStaticRouteTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#create ErStaticRoute#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#delete ErStaticRoute#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#update ErStaticRoute#update} + */ + readonly update?: string; +} + +export function erStaticRouteTimeoutsToTerraform(struct?: ErStaticRouteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function erStaticRouteTimeoutsToHclTerraform(struct?: ErStaticRouteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErStaticRouteTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErStaticRouteTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErStaticRouteTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route huaweicloud_er_static_route} +*/ +export class ErStaticRoute extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_static_route"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErStaticRoute resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErStaticRoute to import + * @param importFromId The id of the existing ErStaticRoute that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErStaticRoute to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_static_route", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_static_route huaweicloud_er_static_route} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErStaticRouteConfig + */ + public constructor(scope: Construct, id: string, config: ErStaticRouteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_static_route', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachmentId = config.attachmentId; + this._destination = config.destination; + this._id = config.id; + this._isBlackhole = config.isBlackhole; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_id - computed: false, optional: true, required: false + private _attachmentId?: string; + public get attachmentId() { + return this.getStringAttribute('attachment_id'); + } + public set attachmentId(value: string) { + this._attachmentId = value; + } + public resetAttachmentId() { + this._attachmentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentIdInput() { + return this._attachmentId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_blackhole - computed: false, optional: true, required: false + private _isBlackhole?: boolean | cdktf.IResolvable; + public get isBlackhole() { + return this.getBooleanAttribute('is_blackhole'); + } + public set isBlackhole(value: boolean | cdktf.IResolvable) { + this._isBlackhole = value; + } + public resetIsBlackhole() { + this._isBlackhole = undefined; + } + // Temporarily expose input value. Use with caution. + public get isBlackholeInput() { + return this._isBlackhole; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: false, optional: false, required: true + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErStaticRouteTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErStaticRouteTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attachment_id: cdktf.stringToTerraform(this._attachmentId), + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + is_blackhole: cdktf.booleanToTerraform(this._isBlackhole), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + timeouts: erStaticRouteTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attachment_id: { + value: cdktf.stringToHclTerraform(this._attachmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_blackhole: { + value: cdktf.booleanToHclTerraform(this._isBlackhole), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: erStaticRouteTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErStaticRouteTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/er-vpc-attachment/README.md b/src/constructs/providers/huaweicloud/er-vpc-attachment/README.md new file mode 100644 index 00000000..a0449d80 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-vpc-attachment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_er_vpc_attachment` + +Refer to the Terraform Registry for docs: [`huaweicloud_er_vpc_attachment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment). diff --git a/src/constructs/providers/huaweicloud/er-vpc-attachment/index.ts b/src/constructs/providers/huaweicloud/er-vpc-attachment/index.ts new file mode 100644 index 00000000..7056ee84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/er-vpc-attachment/index.ts @@ -0,0 +1,547 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ErVpcAttachmentConfig extends cdktf.TerraformMetaArguments { + /** + * Whether to automatically configure routes for the VPC which pointing to the ER instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#auto_create_vpc_routes ErVpcAttachment#auto_create_vpc_routes} + */ + readonly autoCreateVpcRoutes?: boolean | cdktf.IResolvable; + /** + * The description of the VPC attachment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#description ErVpcAttachment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#id ErVpcAttachment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The ID of the ER instance to which the VPC attachment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#instance_id ErVpcAttachment#instance_id} + */ + readonly instanceId: string; + /** + * The name of the VPC attachment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#name ErVpcAttachment#name} + */ + readonly name: string; + /** + * The region where the ER instance and the VPC attachment are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#region ErVpcAttachment#region} + */ + readonly region?: string; + /** + * The ID of the VPC subnet to which the VPC attachment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#subnet_id ErVpcAttachment#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#tags ErVpcAttachment#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC to which the VPC attachment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#vpc_id ErVpcAttachment#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#timeouts ErVpcAttachment#timeouts} + */ + readonly timeouts?: ErVpcAttachmentTimeouts; +} +export interface ErVpcAttachmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#create ErVpcAttachment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#delete ErVpcAttachment#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#update ErVpcAttachment#update} + */ + readonly update?: string; +} + +export function erVpcAttachmentTimeoutsToTerraform(struct?: ErVpcAttachmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function erVpcAttachmentTimeoutsToHclTerraform(struct?: ErVpcAttachmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ErVpcAttachmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ErVpcAttachmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ErVpcAttachmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment huaweicloud_er_vpc_attachment} +*/ +export class ErVpcAttachment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_er_vpc_attachment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ErVpcAttachment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ErVpcAttachment to import + * @param importFromId The id of the existing ErVpcAttachment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ErVpcAttachment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_er_vpc_attachment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/er_vpc_attachment huaweicloud_er_vpc_attachment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ErVpcAttachmentConfig + */ + public constructor(scope: Construct, id: string, config: ErVpcAttachmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_er_vpc_attachment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoCreateVpcRoutes = config.autoCreateVpcRoutes; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_create_vpc_routes - computed: true, optional: true, required: false + private _autoCreateVpcRoutes?: boolean | cdktf.IResolvable; + public get autoCreateVpcRoutes() { + return this.getBooleanAttribute('auto_create_vpc_routes'); + } + public set autoCreateVpcRoutes(value: boolean | cdktf.IResolvable) { + this._autoCreateVpcRoutes = value; + } + public resetAutoCreateVpcRoutes() { + this._autoCreateVpcRoutes = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoCreateVpcRoutesInput() { + return this._autoCreateVpcRoutes; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ErVpcAttachmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ErVpcAttachmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_create_vpc_routes: cdktf.booleanToTerraform(this._autoCreateVpcRoutes), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: erVpcAttachmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_create_vpc_routes: { + value: cdktf.booleanToHclTerraform(this._autoCreateVpcRoutes), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: erVpcAttachmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ErVpcAttachmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/evs-snapshot-rollback/README.md b/src/constructs/providers/huaweicloud/evs-snapshot-rollback/README.md new file mode 100644 index 00000000..ae62c608 --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-snapshot-rollback/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_evs_snapshot_rollback` + +Refer to the Terraform Registry for docs: [`huaweicloud_evs_snapshot_rollback`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback). diff --git a/src/constructs/providers/huaweicloud/evs-snapshot-rollback/index.ts b/src/constructs/providers/huaweicloud/evs-snapshot-rollback/index.ts new file mode 100644 index 00000000..ab81abc2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-snapshot-rollback/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EvsSnapshotRollbackConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback#id EvsSnapshotRollback#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback#region EvsSnapshotRollback#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback#snapshot_id EvsSnapshotRollback#snapshot_id} + */ + readonly snapshotId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback#volume_id EvsSnapshotRollback#volume_id} + */ + readonly volumeId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback huaweicloud_evs_snapshot_rollback} +*/ +export class EvsSnapshotRollback extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_snapshot_rollback"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EvsSnapshotRollback resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EvsSnapshotRollback to import + * @param importFromId The id of the existing EvsSnapshotRollback that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EvsSnapshotRollback to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_snapshot_rollback", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot_rollback huaweicloud_evs_snapshot_rollback} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EvsSnapshotRollbackConfig + */ + public constructor(scope: Construct, id: string, config: EvsSnapshotRollbackConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_snapshot_rollback', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._snapshotId = config.snapshotId; + this._volumeId = config.volumeId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // snapshot_id - computed: false, optional: false, required: true + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + volume_id: cdktf.stringToTerraform(this._volumeId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/evs-snapshot/README.md b/src/constructs/providers/huaweicloud/evs-snapshot/README.md new file mode 100644 index 00000000..628b366d --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-snapshot/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_evs_snapshot` + +Refer to the Terraform Registry for docs: [`huaweicloud_evs_snapshot`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot). diff --git a/src/constructs/providers/huaweicloud/evs-snapshot/index.ts b/src/constructs/providers/huaweicloud/evs-snapshot/index.ts new file mode 100644 index 00000000..252b618a --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-snapshot/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EvsSnapshotConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#description EvsSnapshot#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#force EvsSnapshot#force} + */ + readonly force?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#id EvsSnapshot#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#metadata EvsSnapshot#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#name EvsSnapshot#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#region EvsSnapshot#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#volume_id EvsSnapshot#volume_id} + */ + readonly volumeId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#timeouts EvsSnapshot#timeouts} + */ + readonly timeouts?: EvsSnapshotTimeouts; +} +export interface EvsSnapshotTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#create EvsSnapshot#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#delete EvsSnapshot#delete} + */ + readonly delete?: string; +} + +export function evsSnapshotTimeoutsToTerraform(struct?: EvsSnapshotTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function evsSnapshotTimeoutsToHclTerraform(struct?: EvsSnapshotTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EvsSnapshotTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): EvsSnapshotTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EvsSnapshotTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot huaweicloud_evs_snapshot} +*/ +export class EvsSnapshot extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_snapshot"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EvsSnapshot resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EvsSnapshot to import + * @param importFromId The id of the existing EvsSnapshot that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EvsSnapshot to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_snapshot", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_snapshot huaweicloud_evs_snapshot} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EvsSnapshotConfig + */ + public constructor(scope: Construct, id: string, config: EvsSnapshotConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_snapshot', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._force = config.force; + this._id = config.id; + this._metadata = config.metadata; + this._name = config.name; + this._region = config.region; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // force - computed: false, optional: true, required: false + private _force?: boolean | cdktf.IResolvable; + public get force() { + return this.getBooleanAttribute('force'); + } + public set force(value: boolean | cdktf.IResolvable) { + this._force = value; + } + public resetForce() { + this._force = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceInput() { + return this._force; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new EvsSnapshotTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: EvsSnapshotTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + force: cdktf.booleanToTerraform(this._force), + id: cdktf.stringToTerraform(this._id), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: evsSnapshotTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force: { + value: cdktf.booleanToHclTerraform(this._force), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: evsSnapshotTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "EvsSnapshotTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/README.md b/src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/README.md new file mode 100644 index 00000000..689d01d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_evs_volume_transfer_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_evs_volume_transfer_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter). diff --git a/src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/index.ts b/src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/index.ts new file mode 100644 index 00000000..efd2632f --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-volume-transfer-accepter/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EvsVolumeTransferAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter#auth_key EvsVolumeTransferAccepter#auth_key} + */ + readonly authKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter#id EvsVolumeTransferAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter#region EvsVolumeTransferAccepter#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter#transfer_id EvsVolumeTransferAccepter#transfer_id} + */ + readonly transferId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter huaweicloud_evs_volume_transfer_accepter} +*/ +export class EvsVolumeTransferAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_volume_transfer_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EvsVolumeTransferAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EvsVolumeTransferAccepter to import + * @param importFromId The id of the existing EvsVolumeTransferAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EvsVolumeTransferAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_volume_transfer_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer_accepter huaweicloud_evs_volume_transfer_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EvsVolumeTransferAccepterConfig + */ + public constructor(scope: Construct, id: string, config: EvsVolumeTransferAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_volume_transfer_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authKey = config.authKey; + this._id = config.id; + this._region = config.region; + this._transferId = config.transferId; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_key - computed: false, optional: false, required: true + private _authKey?: string; + public get authKey() { + return this.getStringAttribute('auth_key'); + } + public set authKey(value: string) { + this._authKey = value; + } + // Temporarily expose input value. Use with caution. + public get authKeyInput() { + return this._authKey; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // transfer_id - computed: false, optional: false, required: true + private _transferId?: string; + public get transferId() { + return this.getStringAttribute('transfer_id'); + } + public set transferId(value: string) { + this._transferId = value; + } + // Temporarily expose input value. Use with caution. + public get transferIdInput() { + return this._transferId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_key: cdktf.stringToTerraform(this._authKey), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + transfer_id: cdktf.stringToTerraform(this._transferId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_key: { + value: cdktf.stringToHclTerraform(this._authKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transfer_id: { + value: cdktf.stringToHclTerraform(this._transferId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/evs-volume-transfer/README.md b/src/constructs/providers/huaweicloud/evs-volume-transfer/README.md new file mode 100644 index 00000000..6f98cccf --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-volume-transfer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_evs_volume_transfer` + +Refer to the Terraform Registry for docs: [`huaweicloud_evs_volume_transfer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer). diff --git a/src/constructs/providers/huaweicloud/evs-volume-transfer/index.ts b/src/constructs/providers/huaweicloud/evs-volume-transfer/index.ts new file mode 100644 index 00000000..08c0cb6c --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-volume-transfer/index.ts @@ -0,0 +1,204 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EvsVolumeTransferConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer#id EvsVolumeTransfer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer#name EvsVolumeTransfer#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer#region EvsVolumeTransfer#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer#volume_id EvsVolumeTransfer#volume_id} + */ + readonly volumeId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer huaweicloud_evs_volume_transfer} +*/ +export class EvsVolumeTransfer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_volume_transfer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EvsVolumeTransfer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EvsVolumeTransfer to import + * @param importFromId The id of the existing EvsVolumeTransfer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EvsVolumeTransfer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_volume_transfer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume_transfer huaweicloud_evs_volume_transfer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EvsVolumeTransferConfig + */ + public constructor(scope: Construct, id: string, config: EvsVolumeTransferConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_volume_transfer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._volumeId = config.volumeId; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_key - computed: true, optional: false, required: false + public get authKey() { + return this.getStringAttribute('auth_key'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + volume_id: cdktf.stringToTerraform(this._volumeId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/evs-volume/README.md b/src/constructs/providers/huaweicloud/evs-volume/README.md new file mode 100644 index 00000000..6f9c44e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-volume/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_evs_volume` + +Refer to the Terraform Registry for docs: [`huaweicloud_evs_volume`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume). diff --git a/src/constructs/providers/huaweicloud/evs-volume/index.ts b/src/constructs/providers/huaweicloud/evs-volume/index.ts new file mode 100644 index 00000000..cc8ebc03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/evs-volume/index.ts @@ -0,0 +1,1073 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface EvsVolumeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#auto_pay EvsVolume#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#auto_renew EvsVolume#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#availability_zone EvsVolume#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#backup_id EvsVolume#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#cascade EvsVolume#cascade} + */ + readonly cascade?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#charging_mode EvsVolume#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#dedicated_storage_id EvsVolume#dedicated_storage_id} + */ + readonly dedicatedStorageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#description EvsVolume#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#device_type EvsVolume#device_type} + */ + readonly deviceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#enterprise_project_id EvsVolume#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#id EvsVolume#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#image_id EvsVolume#image_id} + */ + readonly imageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#iops EvsVolume#iops} + */ + readonly iops?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#kms_id EvsVolume#kms_id} + */ + readonly kmsId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#multiattach EvsVolume#multiattach} + */ + readonly multiattach?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#name EvsVolume#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#period EvsVolume#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#period_unit EvsVolume#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#region EvsVolume#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#server_id EvsVolume#server_id} + */ + readonly serverId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#size EvsVolume#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#snapshot_id EvsVolume#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#tags EvsVolume#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#throughput EvsVolume#throughput} + */ + readonly throughput?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#volume_type EvsVolume#volume_type} + */ + readonly volumeType: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#timeouts EvsVolume#timeouts} + */ + readonly timeouts?: EvsVolumeTimeouts; +} +export interface EvsVolumeAttachment { +} + +export function evsVolumeAttachmentToTerraform(struct?: EvsVolumeAttachment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function evsVolumeAttachmentToHclTerraform(struct?: EvsVolumeAttachment): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class EvsVolumeAttachmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): EvsVolumeAttachment | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EvsVolumeAttachment | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } +} + +export class EvsVolumeAttachmentList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): EvsVolumeAttachmentOutputReference { + return new EvsVolumeAttachmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface EvsVolumeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#create EvsVolume#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#delete EvsVolume#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#update EvsVolume#update} + */ + readonly update?: string; +} + +export function evsVolumeTimeoutsToTerraform(struct?: EvsVolumeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function evsVolumeTimeoutsToHclTerraform(struct?: EvsVolumeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class EvsVolumeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): EvsVolumeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: EvsVolumeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume huaweicloud_evs_volume} +*/ +export class EvsVolume extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_evs_volume"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a EvsVolume resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the EvsVolume to import + * @param importFromId The id of the existing EvsVolume that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the EvsVolume to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_evs_volume", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/evs_volume huaweicloud_evs_volume} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options EvsVolumeConfig + */ + public constructor(scope: Construct, id: string, config: EvsVolumeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_evs_volume', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._backupId = config.backupId; + this._cascade = config.cascade; + this._chargingMode = config.chargingMode; + this._dedicatedStorageId = config.dedicatedStorageId; + this._description = config.description; + this._deviceType = config.deviceType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._imageId = config.imageId; + this._iops = config.iops; + this._kmsId = config.kmsId; + this._multiattach = config.multiattach; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._serverId = config.serverId; + this._size = config.size; + this._snapshotId = config.snapshotId; + this._tags = config.tags; + this._throughput = config.throughput; + this._volumeType = config.volumeType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment - computed: true, optional: false, required: false + private _attachment = new EvsVolumeAttachmentList(this, "attachment", true); + public get attachment() { + return this._attachment; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // cascade - computed: false, optional: true, required: false + private _cascade?: boolean | cdktf.IResolvable; + public get cascade() { + return this.getBooleanAttribute('cascade'); + } + public set cascade(value: boolean | cdktf.IResolvable) { + this._cascade = value; + } + public resetCascade() { + this._cascade = undefined; + } + // Temporarily expose input value. Use with caution. + public get cascadeInput() { + return this._cascade; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // dedicated_storage_id - computed: false, optional: true, required: false + private _dedicatedStorageId?: string; + public get dedicatedStorageId() { + return this.getStringAttribute('dedicated_storage_id'); + } + public set dedicatedStorageId(value: string) { + this._dedicatedStorageId = value; + } + public resetDedicatedStorageId() { + this._dedicatedStorageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedStorageIdInput() { + return this._dedicatedStorageId; + } + + // dedicated_storage_name - computed: true, optional: false, required: false + public get dedicatedStorageName() { + return this.getStringAttribute('dedicated_storage_name'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // device_type - computed: false, optional: true, required: false + private _deviceType?: string; + public get deviceType() { + return this.getStringAttribute('device_type'); + } + public set deviceType(value: string) { + this._deviceType = value; + } + public resetDeviceType() { + this._deviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceTypeInput() { + return this._deviceType; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: true, required: false + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + public resetImageId() { + this._imageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // iops - computed: true, optional: true, required: false + private _iops?: number; + public get iops() { + return this.getNumberAttribute('iops'); + } + public set iops(value: number) { + this._iops = value; + } + public resetIops() { + this._iops = undefined; + } + // Temporarily expose input value. Use with caution. + public get iopsInput() { + return this._iops; + } + + // kms_id - computed: false, optional: true, required: false + private _kmsId?: string; + public get kmsId() { + return this.getStringAttribute('kms_id'); + } + public set kmsId(value: string) { + this._kmsId = value; + } + public resetKmsId() { + this._kmsId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsIdInput() { + return this._kmsId; + } + + // multiattach - computed: false, optional: true, required: false + private _multiattach?: boolean | cdktf.IResolvable; + public get multiattach() { + return this.getBooleanAttribute('multiattach'); + } + public set multiattach(value: boolean | cdktf.IResolvable) { + this._multiattach = value; + } + public resetMultiattach() { + this._multiattach = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiattachInput() { + return this._multiattach; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: true, required: false + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + public resetServerId() { + this._serverId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // snapshot_id - computed: false, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // throughput - computed: true, optional: true, required: false + private _throughput?: number; + public get throughput() { + return this.getNumberAttribute('throughput'); + } + public set throughput(value: number) { + this._throughput = value; + } + public resetThroughput() { + this._throughput = undefined; + } + // Temporarily expose input value. Use with caution. + public get throughputInput() { + return this._throughput; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // wwn - computed: true, optional: false, required: false + public get wwn() { + return this.getStringAttribute('wwn'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new EvsVolumeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: EvsVolumeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + backup_id: cdktf.stringToTerraform(this._backupId), + cascade: cdktf.booleanToTerraform(this._cascade), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + dedicated_storage_id: cdktf.stringToTerraform(this._dedicatedStorageId), + description: cdktf.stringToTerraform(this._description), + device_type: cdktf.stringToTerraform(this._deviceType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + iops: cdktf.numberToTerraform(this._iops), + kms_id: cdktf.stringToTerraform(this._kmsId), + multiattach: cdktf.booleanToTerraform(this._multiattach), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + size: cdktf.numberToTerraform(this._size), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + throughput: cdktf.numberToTerraform(this._throughput), + volume_type: cdktf.stringToTerraform(this._volumeType), + timeouts: evsVolumeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cascade: { + value: cdktf.booleanToHclTerraform(this._cascade), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_storage_id: { + value: cdktf.stringToHclTerraform(this._dedicatedStorageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_type: { + value: cdktf.stringToHclTerraform(this._deviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iops: { + value: cdktf.numberToHclTerraform(this._iops), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + kms_id: { + value: cdktf.stringToHclTerraform(this._kmsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multiattach: { + value: cdktf.booleanToHclTerraform(this._multiattach), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + throughput: { + value: cdktf.numberToHclTerraform(this._throughput), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: evsVolumeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "EvsVolumeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-application/README.md b/src/constructs/providers/huaweicloud/fgs-application/README.md new file mode 100644 index 00000000..690a0214 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application). diff --git a/src/constructs/providers/huaweicloud/fgs-application/index.ts b/src/constructs/providers/huaweicloud/fgs-application/index.ts new file mode 100644 index 00000000..15a28816 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-application/index.ts @@ -0,0 +1,672 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * The agency name used by the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#agency_name FgsApplication#agency_name} + */ + readonly agencyName?: string; + /** + * The description of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#description FgsApplication#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#id FgsApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The application name + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#name FgsApplication#name} + */ + readonly name: string; + /** + * The template parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#params FgsApplication#params} + */ + readonly params?: string; + /** + * The region where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#region FgsApplication#region} + */ + readonly region?: string; + /** + * The ID of the template used by the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#template_id FgsApplication#template_id} + */ + readonly templateId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#timeouts FgsApplication#timeouts} + */ + readonly timeouts?: FgsApplicationTimeouts; +} +export interface FgsApplicationRepository { +} + +export function fgsApplicationRepositoryToTerraform(struct?: FgsApplicationRepository): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function fgsApplicationRepositoryToHclTerraform(struct?: FgsApplicationRepository): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class FgsApplicationRepositoryOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsApplicationRepository | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsApplicationRepository | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // https_url - computed: true, optional: false, required: false + public get httpsUrl() { + return this.getStringAttribute('https_url'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // web_url - computed: true, optional: false, required: false + public get webUrl() { + return this.getStringAttribute('web_url'); + } +} + +export class FgsApplicationRepositoryList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsApplicationRepositoryOutputReference { + return new FgsApplicationRepositoryOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsApplicationStackResources { +} + +export function fgsApplicationStackResourcesToTerraform(struct?: FgsApplicationStackResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function fgsApplicationStackResourcesToHclTerraform(struct?: FgsApplicationStackResources): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class FgsApplicationStackResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsApplicationStackResources | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsApplicationStackResources | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // display_name - computed: true, optional: false, required: false + public get displayName() { + return this.getStringAttribute('display_name'); + } + + // href - computed: true, optional: false, required: false + public get href() { + return this.getStringAttribute('href'); + } + + // logical_resource_name - computed: true, optional: false, required: false + public get logicalResourceName() { + return this.getStringAttribute('logical_resource_name'); + } + + // logical_resource_type - computed: true, optional: false, required: false + public get logicalResourceType() { + return this.getStringAttribute('logical_resource_type'); + } + + // physical_resource_id - computed: true, optional: false, required: false + public get physicalResourceId() { + return this.getStringAttribute('physical_resource_id'); + } + + // physical_resource_name - computed: true, optional: false, required: false + public get physicalResourceName() { + return this.getStringAttribute('physical_resource_name'); + } + + // resource_status - computed: true, optional: false, required: false + public get resourceStatus() { + return this.getStringAttribute('resource_status'); + } + + // status_message - computed: true, optional: false, required: false + public get statusMessage() { + return this.getStringAttribute('status_message'); + } +} + +export class FgsApplicationStackResourcesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsApplicationStackResourcesOutputReference { + return new FgsApplicationStackResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsApplicationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#create FgsApplication#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#delete FgsApplication#delete} + */ + readonly delete?: string; +} + +export function fgsApplicationTimeoutsToTerraform(struct?: FgsApplicationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function fgsApplicationTimeoutsToHclTerraform(struct?: FgsApplicationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsApplicationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FgsApplicationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsApplicationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application huaweicloud_fgs_application} +*/ +export class FgsApplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsApplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsApplication to import + * @param importFromId The id of the existing FgsApplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsApplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_application huaweicloud_fgs_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsApplicationConfig + */ + public constructor(scope: Construct, id: string, config: FgsApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._params = config.params; + this._region = config.region; + this._templateId = config.templateId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // params - computed: false, optional: true, required: false + private _params?: string; + public get params() { + return this.getStringAttribute('params'); + } + public set params(value: string) { + this._params = value; + } + public resetParams() { + this._params = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramsInput() { + return this._params; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: true, optional: false, required: false + private _repository = new FgsApplicationRepositoryList(this, "repository", false); + public get repository() { + return this._repository; + } + + // stack_id - computed: true, optional: false, required: false + public get stackId() { + return this.getStringAttribute('stack_id'); + } + + // stack_resources - computed: true, optional: false, required: false + private _stackResources = new FgsApplicationStackResourcesList(this, "stack_resources", false); + public get stackResources() { + return this._stackResources; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FgsApplicationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FgsApplicationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + params: cdktf.stringToTerraform(this._params), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + timeouts: fgsApplicationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + params: { + value: cdktf.stringToHclTerraform(this._params), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: fgsApplicationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FgsApplicationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/README.md b/src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/README.md new file mode 100644 index 00000000..f66d4fa1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_async_invoke_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_async_invoke_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration). diff --git a/src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/index.ts b/src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/index.ts new file mode 100644 index 00000000..ebc525c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-async-invoke-configuration/index.ts @@ -0,0 +1,557 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsAsyncInvokeConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Whether to enable asynchronous invocation status persistence. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#enable_async_status_log FgsAsyncInvokeConfiguration#enable_async_status_log} + */ + readonly enableAsyncStatusLog?: boolean | cdktf.IResolvable; + /** + * The function URN to which the asynchronous invocation belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#function_urn FgsAsyncInvokeConfiguration#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#id FgsAsyncInvokeConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The maximum validity period of a message. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#max_async_event_age_in_seconds FgsAsyncInvokeConfiguration#max_async_event_age_in_seconds} + */ + readonly maxAsyncEventAgeInSeconds: number; + /** + * The maximum number of retry attempts to be made if asynchronous invocation fails. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#max_async_retry_attempts FgsAsyncInvokeConfiguration#max_async_retry_attempts} + */ + readonly maxAsyncRetryAttempts: number; + /** + * The region in which to configure the asynchronous invocation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#region FgsAsyncInvokeConfiguration#region} + */ + readonly region?: string; + /** + * on_failure block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#on_failure FgsAsyncInvokeConfiguration#on_failure} + */ + readonly onFailure?: FgsAsyncInvokeConfigurationOnFailure; + /** + * on_success block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#on_success FgsAsyncInvokeConfiguration#on_success} + */ + readonly onSuccess?: FgsAsyncInvokeConfigurationOnSuccess; +} +export interface FgsAsyncInvokeConfigurationOnFailure { + /** + * The object type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#destination FgsAsyncInvokeConfiguration#destination} + */ + readonly destination: string; + /** + * The parameters (in JSON format) corresponding to the target service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#param FgsAsyncInvokeConfiguration#param} + */ + readonly param: string; +} + +export function fgsAsyncInvokeConfigurationOnFailureToTerraform(struct?: FgsAsyncInvokeConfigurationOnFailureOutputReference | FgsAsyncInvokeConfigurationOnFailure): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + destination: cdktf.stringToTerraform(struct!.destination), + param: cdktf.stringToTerraform(struct!.param), + } +} + + +export function fgsAsyncInvokeConfigurationOnFailureToHclTerraform(struct?: FgsAsyncInvokeConfigurationOnFailureOutputReference | FgsAsyncInvokeConfigurationOnFailure): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(struct!.destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param: { + value: cdktf.stringToHclTerraform(struct!.param), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsAsyncInvokeConfigurationOnFailureOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsAsyncInvokeConfigurationOnFailure | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destination !== undefined) { + hasAnyValues = true; + internalValueResult.destination = this._destination; + } + if (this._param !== undefined) { + hasAnyValues = true; + internalValueResult.param = this._param; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsAsyncInvokeConfigurationOnFailure | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._destination = undefined; + this._param = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._destination = value.destination; + this._param = value.param; + } + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // param - computed: false, optional: false, required: true + private _param?: string; + public get param() { + return this.getStringAttribute('param'); + } + public set param(value: string) { + this._param = value; + } + // Temporarily expose input value. Use with caution. + public get paramInput() { + return this._param; + } +} +export interface FgsAsyncInvokeConfigurationOnSuccess { + /** + * The object type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#destination FgsAsyncInvokeConfiguration#destination} + */ + readonly destination: string; + /** + * The parameters (in JSON format) corresponding to the target service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#param FgsAsyncInvokeConfiguration#param} + */ + readonly param: string; +} + +export function fgsAsyncInvokeConfigurationOnSuccessToTerraform(struct?: FgsAsyncInvokeConfigurationOnSuccessOutputReference | FgsAsyncInvokeConfigurationOnSuccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + destination: cdktf.stringToTerraform(struct!.destination), + param: cdktf.stringToTerraform(struct!.param), + } +} + + +export function fgsAsyncInvokeConfigurationOnSuccessToHclTerraform(struct?: FgsAsyncInvokeConfigurationOnSuccessOutputReference | FgsAsyncInvokeConfigurationOnSuccess): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(struct!.destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param: { + value: cdktf.stringToHclTerraform(struct!.param), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsAsyncInvokeConfigurationOnSuccessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsAsyncInvokeConfigurationOnSuccess | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destination !== undefined) { + hasAnyValues = true; + internalValueResult.destination = this._destination; + } + if (this._param !== undefined) { + hasAnyValues = true; + internalValueResult.param = this._param; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsAsyncInvokeConfigurationOnSuccess | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._destination = undefined; + this._param = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._destination = value.destination; + this._param = value.param; + } + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // param - computed: false, optional: false, required: true + private _param?: string; + public get param() { + return this.getStringAttribute('param'); + } + public set param(value: string) { + this._param = value; + } + // Temporarily expose input value. Use with caution. + public get paramInput() { + return this._param; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration huaweicloud_fgs_async_invoke_configuration} +*/ +export class FgsAsyncInvokeConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_async_invoke_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsAsyncInvokeConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsAsyncInvokeConfiguration to import + * @param importFromId The id of the existing FgsAsyncInvokeConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsAsyncInvokeConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_async_invoke_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_async_invoke_configuration huaweicloud_fgs_async_invoke_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsAsyncInvokeConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: FgsAsyncInvokeConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_async_invoke_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableAsyncStatusLog = config.enableAsyncStatusLog; + this._functionUrn = config.functionUrn; + this._id = config.id; + this._maxAsyncEventAgeInSeconds = config.maxAsyncEventAgeInSeconds; + this._maxAsyncRetryAttempts = config.maxAsyncRetryAttempts; + this._region = config.region; + this._onFailure.internalValue = config.onFailure; + this._onSuccess.internalValue = config.onSuccess; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_async_status_log - computed: false, optional: true, required: false + private _enableAsyncStatusLog?: boolean | cdktf.IResolvable; + public get enableAsyncStatusLog() { + return this.getBooleanAttribute('enable_async_status_log'); + } + public set enableAsyncStatusLog(value: boolean | cdktf.IResolvable) { + this._enableAsyncStatusLog = value; + } + public resetEnableAsyncStatusLog() { + this._enableAsyncStatusLog = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAsyncStatusLogInput() { + return this._enableAsyncStatusLog; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_async_event_age_in_seconds - computed: false, optional: false, required: true + private _maxAsyncEventAgeInSeconds?: number; + public get maxAsyncEventAgeInSeconds() { + return this.getNumberAttribute('max_async_event_age_in_seconds'); + } + public set maxAsyncEventAgeInSeconds(value: number) { + this._maxAsyncEventAgeInSeconds = value; + } + // Temporarily expose input value. Use with caution. + public get maxAsyncEventAgeInSecondsInput() { + return this._maxAsyncEventAgeInSeconds; + } + + // max_async_retry_attempts - computed: false, optional: false, required: true + private _maxAsyncRetryAttempts?: number; + public get maxAsyncRetryAttempts() { + return this.getNumberAttribute('max_async_retry_attempts'); + } + public set maxAsyncRetryAttempts(value: number) { + this._maxAsyncRetryAttempts = value; + } + // Temporarily expose input value. Use with caution. + public get maxAsyncRetryAttemptsInput() { + return this._maxAsyncRetryAttempts; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // on_failure - computed: false, optional: true, required: false + private _onFailure = new FgsAsyncInvokeConfigurationOnFailureOutputReference(this, "on_failure"); + public get onFailure() { + return this._onFailure; + } + public putOnFailure(value: FgsAsyncInvokeConfigurationOnFailure) { + this._onFailure.internalValue = value; + } + public resetOnFailure() { + this._onFailure.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get onFailureInput() { + return this._onFailure.internalValue; + } + + // on_success - computed: false, optional: true, required: false + private _onSuccess = new FgsAsyncInvokeConfigurationOnSuccessOutputReference(this, "on_success"); + public get onSuccess() { + return this._onSuccess; + } + public putOnSuccess(value: FgsAsyncInvokeConfigurationOnSuccess) { + this._onSuccess.internalValue = value; + } + public resetOnSuccess() { + this._onSuccess.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get onSuccessInput() { + return this._onSuccess.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_async_status_log: cdktf.booleanToTerraform(this._enableAsyncStatusLog), + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + max_async_event_age_in_seconds: cdktf.numberToTerraform(this._maxAsyncEventAgeInSeconds), + max_async_retry_attempts: cdktf.numberToTerraform(this._maxAsyncRetryAttempts), + region: cdktf.stringToTerraform(this._region), + on_failure: fgsAsyncInvokeConfigurationOnFailureToTerraform(this._onFailure.internalValue), + on_success: fgsAsyncInvokeConfigurationOnSuccessToTerraform(this._onSuccess.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_async_status_log: { + value: cdktf.booleanToHclTerraform(this._enableAsyncStatusLog), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_async_event_age_in_seconds: { + value: cdktf.numberToHclTerraform(this._maxAsyncEventAgeInSeconds), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_async_retry_attempts: { + value: cdktf.numberToHclTerraform(this._maxAsyncRetryAttempts), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + on_failure: { + value: fgsAsyncInvokeConfigurationOnFailureToHclTerraform(this._onFailure.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsAsyncInvokeConfigurationOnFailureList", + }, + on_success: { + value: fgsAsyncInvokeConfigurationOnSuccessToHclTerraform(this._onSuccess.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsAsyncInvokeConfigurationOnSuccessList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-dependency-version/README.md b/src/constructs/providers/huaweicloud/fgs-dependency-version/README.md new file mode 100644 index 00000000..32da4688 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-dependency-version/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_dependency_version` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_dependency_version`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version). diff --git a/src/constructs/providers/huaweicloud/fgs-dependency-version/index.ts b/src/constructs/providers/huaweicloud/fgs-dependency-version/index.ts new file mode 100644 index 00000000..83403bee --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-dependency-version/index.ts @@ -0,0 +1,287 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsDependencyVersionConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the custom dependency version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#description FgsDependencyVersion#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#id FgsDependencyVersion#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The OBS bucket path where the dependency package is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#link FgsDependencyVersion#link} + */ + readonly link: string; + /** + * The name of the custom dependency package to which the version belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#name FgsDependencyVersion#name} + */ + readonly name: string; + /** + * The region where the custom dependency version is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#region FgsDependencyVersion#region} + */ + readonly region?: string; + /** + * The runtime of the custom dependency package version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#runtime FgsDependencyVersion#runtime} + */ + readonly runtime: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version huaweicloud_fgs_dependency_version} +*/ +export class FgsDependencyVersion extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_dependency_version"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsDependencyVersion resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsDependencyVersion to import + * @param importFromId The id of the existing FgsDependencyVersion that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsDependencyVersion to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_dependency_version", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency_version huaweicloud_fgs_dependency_version} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsDependencyVersionConfig + */ + public constructor(scope: Construct, id: string, config: FgsDependencyVersionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_dependency_version', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._link = config.link; + this._name = config.name; + this._region = config.region; + this._runtime = config.runtime; + } + + // ========== + // ATTRIBUTES + // ========== + + // dependency_id - computed: true, optional: false, required: false + public get dependencyId() { + return this.getStringAttribute('dependency_id'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // etag - computed: true, optional: false, required: false + public get etag() { + return this.getStringAttribute('etag'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // link - computed: false, optional: false, required: true + private _link?: string; + public get link() { + return this.getStringAttribute('link'); + } + public set link(value: string) { + this._link = value; + } + // Temporarily expose input value. Use with caution. + public get linkInput() { + return this._link; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: false, required: true + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + link: cdktf.stringToTerraform(this._link), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + link: { + value: cdktf.stringToHclTerraform(this._link), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-dependency/README.md b/src/constructs/providers/huaweicloud/fgs-dependency/README.md new file mode 100644 index 00000000..6f7e2b1c --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-dependency/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_dependency` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_dependency`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency). diff --git a/src/constructs/providers/huaweicloud/fgs-dependency/index.ts b/src/constructs/providers/huaweicloud/fgs-dependency/index.ts new file mode 100644 index 00000000..43fe519b --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-dependency/index.ts @@ -0,0 +1,267 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsDependencyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#description FgsDependency#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#id FgsDependency#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#link FgsDependency#link} + */ + readonly link: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#name FgsDependency#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#region FgsDependency#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#runtime FgsDependency#runtime} + */ + readonly runtime: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency huaweicloud_fgs_dependency} +*/ +export class FgsDependency extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_dependency"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsDependency resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsDependency to import + * @param importFromId The id of the existing FgsDependency that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsDependency to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_dependency", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_dependency huaweicloud_fgs_dependency} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsDependencyConfig + */ + public constructor(scope: Construct, id: string, config: FgsDependencyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_dependency', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._link = config.link; + this._name = config.name; + this._region = config.region; + this._runtime = config.runtime; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // etag - computed: true, optional: false, required: false + public get etag() { + return this.getStringAttribute('etag'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // link - computed: false, optional: false, required: true + private _link?: string; + public get link() { + return this.getStringAttribute('link'); + } + public set link(value: string) { + this._link = value; + } + // Temporarily expose input value. Use with caution. + public get linkInput() { + return this._link; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: false, required: true + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getNumberAttribute('version'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + link: cdktf.stringToTerraform(this._link), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + link: { + value: cdktf.stringToHclTerraform(this._link), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-function-event/README.md b/src/constructs/providers/huaweicloud/fgs-function-event/README.md new file mode 100644 index 00000000..63b5b1ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function-event/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_function_event` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_function_event`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event). diff --git a/src/constructs/providers/huaweicloud/fgs-function-event/index.ts b/src/constructs/providers/huaweicloud/fgs-function-event/index.ts new file mode 100644 index 00000000..178fba9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function-event/index.ts @@ -0,0 +1,232 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsFunctionEventConfig extends cdktf.TerraformMetaArguments { + /** + * The function event content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event#content FgsFunctionEvent#content} + */ + readonly content: string; + /** + * The URN of the function to which the event blongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event#function_urn FgsFunctionEvent#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event#id FgsFunctionEvent#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The function event name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event#name FgsFunctionEvent#name} + */ + readonly name: string; + /** + * The region where the function event is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event#region FgsFunctionEvent#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event huaweicloud_fgs_function_event} +*/ +export class FgsFunctionEvent extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_function_event"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsFunctionEvent resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsFunctionEvent to import + * @param importFromId The id of the existing FgsFunctionEvent that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsFunctionEvent to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_function_event", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_event huaweicloud_fgs_function_event} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsFunctionEventConfig + */ + public constructor(scope: Construct, id: string, config: FgsFunctionEventConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_function_event', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._functionUrn = config.functionUrn; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-function-trigger/README.md b/src/constructs/providers/huaweicloud/fgs-function-trigger/README.md new file mode 100644 index 00000000..3553bc96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function-trigger/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_function_trigger` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_function_trigger`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger). diff --git a/src/constructs/providers/huaweicloud/fgs-function-trigger/index.ts b/src/constructs/providers/huaweicloud/fgs-function-trigger/index.ts new file mode 100644 index 00000000..95328db9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function-trigger/index.ts @@ -0,0 +1,424 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsFunctionTriggerConfig extends cdktf.TerraformMetaArguments { + /** + * The detailed configuration of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#event_data FgsFunctionTrigger#event_data} + */ + readonly eventData: string; + /** + * The function URN to which the function trigger belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#function_urn FgsFunctionTrigger#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#id FgsFunctionTrigger#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the function trigger is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#region FgsFunctionTrigger#region} + */ + readonly region?: string; + /** + * The expected status of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#status FgsFunctionTrigger#status} + */ + readonly status?: string; + /** + * The type of the function trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#type FgsFunctionTrigger#type} + */ + readonly type: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#timeouts FgsFunctionTrigger#timeouts} + */ + readonly timeouts?: FgsFunctionTriggerTimeouts; +} +export interface FgsFunctionTriggerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#delete FgsFunctionTrigger#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#update FgsFunctionTrigger#update} + */ + readonly update?: string; +} + +export function fgsFunctionTriggerTimeoutsToTerraform(struct?: FgsFunctionTriggerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function fgsFunctionTriggerTimeoutsToHclTerraform(struct?: FgsFunctionTriggerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionTriggerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FgsFunctionTriggerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionTriggerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + this._update = value.update; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger huaweicloud_fgs_function_trigger} +*/ +export class FgsFunctionTrigger extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_function_trigger"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsFunctionTrigger resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsFunctionTrigger to import + * @param importFromId The id of the existing FgsFunctionTrigger that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsFunctionTrigger to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_function_trigger", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_trigger huaweicloud_fgs_function_trigger} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsFunctionTriggerConfig + */ + public constructor(scope: Construct, id: string, config: FgsFunctionTriggerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_function_trigger', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._eventData = config.eventData; + this._functionUrn = config.functionUrn; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // event_data - computed: false, optional: false, required: true + private _eventData?: string; + public get eventData() { + return this.getStringAttribute('event_data'); + } + public set eventData(value: string) { + this._eventData = value; + } + // Temporarily expose input value. Use with caution. + public get eventDataInput() { + return this._eventData; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FgsFunctionTriggerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FgsFunctionTriggerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + event_data: cdktf.stringToTerraform(this._eventData), + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + timeouts: fgsFunctionTriggerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + event_data: { + value: cdktf.stringToHclTerraform(this._eventData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: fgsFunctionTriggerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FgsFunctionTriggerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-function-v2/README.md b/src/constructs/providers/huaweicloud/fgs-function-v2/README.md new file mode 100644 index 00000000..7d0a8a23 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_function_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_function_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2). diff --git a/src/constructs/providers/huaweicloud/fgs-function-v2/index.ts b/src/constructs/providers/huaweicloud/fgs-function-v2/index.ts new file mode 100644 index 00000000..2f3f27f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function-v2/index.ts @@ -0,0 +1,3025 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsFunctionV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#agency FgsFunctionV2#agency} + */ + readonly agency?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#app FgsFunctionV2#app} + */ + readonly app?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#app_agency FgsFunctionV2#app_agency} + */ + readonly appAgency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#code_filename FgsFunctionV2#code_filename} + */ + readonly codeFilename?: string; + /** + * The code type of the function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#code_type FgsFunctionV2#code_type} + */ + readonly codeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#code_url FgsFunctionV2#code_url} + */ + readonly codeUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#concurrency_num FgsFunctionV2#concurrency_num} + */ + readonly concurrencyNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#depend_list FgsFunctionV2#depend_list} + */ + readonly dependList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#description FgsFunctionV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#dns_list FgsFunctionV2#dns_list} + */ + readonly dnsList?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#encrypted_user_data FgsFunctionV2#encrypted_user_data} + */ + readonly encryptedUserData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#enterprise_project_id FgsFunctionV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#func_code FgsFunctionV2#func_code} + */ + readonly funcCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#functiongraph_version FgsFunctionV2#functiongraph_version} + */ + readonly functiongraphVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#gpu_memory FgsFunctionV2#gpu_memory} + */ + readonly gpuMemory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#gpu_type FgsFunctionV2#gpu_type} + */ + readonly gpuType?: string; + /** + * schema: Required; The entry point of the function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#handler FgsFunctionV2#handler} + */ + readonly handler?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#id FgsFunctionV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#initializer_handler FgsFunctionV2#initializer_handler} + */ + readonly initializerHandler?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#initializer_timeout FgsFunctionV2#initializer_timeout} + */ + readonly initializerTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#log_group_id FgsFunctionV2#log_group_id} + */ + readonly logGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#log_group_name FgsFunctionV2#log_group_name} + */ + readonly logGroupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#log_stream_id FgsFunctionV2#log_stream_id} + */ + readonly logStreamId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#log_stream_name FgsFunctionV2#log_stream_name} + */ + readonly logStreamName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#max_instance_num FgsFunctionV2#max_instance_num} + */ + readonly maxInstanceNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#memory_size FgsFunctionV2#memory_size} + */ + readonly memorySize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#mount_user_group_id FgsFunctionV2#mount_user_group_id} + */ + readonly mountUserGroupId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#mount_user_id FgsFunctionV2#mount_user_id} + */ + readonly mountUserId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#name FgsFunctionV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#network_id FgsFunctionV2#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#package FgsFunctionV2#package} + */ + readonly package?: string; + /** + * schema: Internal; Specifies the pre-stop handler of a function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#pre_stop_handler FgsFunctionV2#pre_stop_handler} + */ + readonly preStopHandler?: string; + /** + * schema: Internal; Specifies the maximum duration that the function can be initialized. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#pre_stop_timeout FgsFunctionV2#pre_stop_timeout} + */ + readonly preStopTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#region FgsFunctionV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#runtime FgsFunctionV2#runtime} + */ + readonly runtime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#tags FgsFunctionV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#timeout FgsFunctionV2#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#user_data FgsFunctionV2#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#vpc_id FgsFunctionV2#vpc_id} + */ + readonly vpcId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#xrole FgsFunctionV2#xrole} + */ + readonly xrole?: string; + /** + * custom_image block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#custom_image FgsFunctionV2#custom_image} + */ + readonly customImage?: FgsFunctionV2CustomImage; + /** + * func_mounts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#func_mounts FgsFunctionV2#func_mounts} + */ + readonly funcMounts?: FgsFunctionV2FuncMounts[] | cdktf.IResolvable; + /** + * reserved_instances block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#reserved_instances FgsFunctionV2#reserved_instances} + */ + readonly reservedInstances?: FgsFunctionV2ReservedInstances[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#timeouts FgsFunctionV2#timeouts} + */ + readonly timeouts?: FgsFunctionV2Timeouts; + /** + * versions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#versions FgsFunctionV2#versions} + */ + readonly versions?: FgsFunctionV2Versions[] | cdktf.IResolvable; +} +export interface FgsFunctionV2CustomImage { + /** + * Specifies the command line arguments used to start the SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#args FgsFunctionV2#args} + */ + readonly args?: string; + /** + * Specifies the startup commands of the SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#command FgsFunctionV2#command} + */ + readonly command?: string; + /** + * Specifies the URL of SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#url FgsFunctionV2#url} + */ + readonly url: string; + /** + * schema: Internal; Specifies the user group ID for running the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#user_group_id FgsFunctionV2#user_group_id} + */ + readonly userGroupId?: string; + /** + * schema: Internal; Specifies the user ID for running the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#user_id FgsFunctionV2#user_id} + */ + readonly userId?: string; + /** + * Specifies the working directory of the SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#working_dir FgsFunctionV2#working_dir} + */ + readonly workingDir?: string; +} + +export function fgsFunctionV2CustomImageToTerraform(struct?: FgsFunctionV2CustomImageOutputReference | FgsFunctionV2CustomImage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + args: cdktf.stringToTerraform(struct!.args), + command: cdktf.stringToTerraform(struct!.command), + url: cdktf.stringToTerraform(struct!.url), + user_group_id: cdktf.stringToTerraform(struct!.userGroupId), + user_id: cdktf.stringToTerraform(struct!.userId), + working_dir: cdktf.stringToTerraform(struct!.workingDir), + } +} + + +export function fgsFunctionV2CustomImageToHclTerraform(struct?: FgsFunctionV2CustomImageOutputReference | FgsFunctionV2CustomImage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + args: { + value: cdktf.stringToHclTerraform(struct!.args), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command: { + value: cdktf.stringToHclTerraform(struct!.command), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(struct!.url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_group_id: { + value: cdktf.stringToHclTerraform(struct!.userGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(struct!.userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + working_dir: { + value: cdktf.stringToHclTerraform(struct!.workingDir), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2CustomImageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsFunctionV2CustomImage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._args !== undefined) { + hasAnyValues = true; + internalValueResult.args = this._args; + } + if (this._command !== undefined) { + hasAnyValues = true; + internalValueResult.command = this._command; + } + if (this._url !== undefined) { + hasAnyValues = true; + internalValueResult.url = this._url; + } + if (this._userGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.userGroupId = this._userGroupId; + } + if (this._userId !== undefined) { + hasAnyValues = true; + internalValueResult.userId = this._userId; + } + if (this._workingDir !== undefined) { + hasAnyValues = true; + internalValueResult.workingDir = this._workingDir; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2CustomImage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._args = undefined; + this._command = undefined; + this._url = undefined; + this._userGroupId = undefined; + this._userId = undefined; + this._workingDir = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._args = value.args; + this._command = value.command; + this._url = value.url; + this._userGroupId = value.userGroupId; + this._userId = value.userId; + this._workingDir = value.workingDir; + } + } + + // args - computed: false, optional: true, required: false + private _args?: string; + public get args() { + return this.getStringAttribute('args'); + } + public set args(value: string) { + this._args = value; + } + public resetArgs() { + this._args = undefined; + } + // Temporarily expose input value. Use with caution. + public get argsInput() { + return this._args; + } + + // command - computed: false, optional: true, required: false + private _command?: string; + public get command() { + return this.getStringAttribute('command'); + } + public set command(value: string) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // user_group_id - computed: false, optional: true, required: false + private _userGroupId?: string; + public get userGroupId() { + return this.getStringAttribute('user_group_id'); + } + public set userGroupId(value: string) { + this._userGroupId = value; + } + public resetUserGroupId() { + this._userGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userGroupIdInput() { + return this._userGroupId; + } + + // user_id - computed: false, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // working_dir - computed: true, optional: true, required: false + private _workingDir?: string; + public get workingDir() { + return this.getStringAttribute('working_dir'); + } + public set workingDir(value: string) { + this._workingDir = value; + } + public resetWorkingDir() { + this._workingDir = undefined; + } + // Temporarily expose input value. Use with caution. + public get workingDirInput() { + return this._workingDir; + } +} +export interface FgsFunctionV2FuncMounts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#local_mount_path FgsFunctionV2#local_mount_path} + */ + readonly localMountPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#mount_resource FgsFunctionV2#mount_resource} + */ + readonly mountResource: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#mount_share_path FgsFunctionV2#mount_share_path} + */ + readonly mountSharePath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#mount_type FgsFunctionV2#mount_type} + */ + readonly mountType: string; +} + +export function fgsFunctionV2FuncMountsToTerraform(struct?: FgsFunctionV2FuncMounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + local_mount_path: cdktf.stringToTerraform(struct!.localMountPath), + mount_resource: cdktf.stringToTerraform(struct!.mountResource), + mount_share_path: cdktf.stringToTerraform(struct!.mountSharePath), + mount_type: cdktf.stringToTerraform(struct!.mountType), + } +} + + +export function fgsFunctionV2FuncMountsToHclTerraform(struct?: FgsFunctionV2FuncMounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + local_mount_path: { + value: cdktf.stringToHclTerraform(struct!.localMountPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_resource: { + value: cdktf.stringToHclTerraform(struct!.mountResource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_share_path: { + value: cdktf.stringToHclTerraform(struct!.mountSharePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_type: { + value: cdktf.stringToHclTerraform(struct!.mountType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2FuncMountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionV2FuncMounts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._localMountPath !== undefined) { + hasAnyValues = true; + internalValueResult.localMountPath = this._localMountPath; + } + if (this._mountResource !== undefined) { + hasAnyValues = true; + internalValueResult.mountResource = this._mountResource; + } + if (this._mountSharePath !== undefined) { + hasAnyValues = true; + internalValueResult.mountSharePath = this._mountSharePath; + } + if (this._mountType !== undefined) { + hasAnyValues = true; + internalValueResult.mountType = this._mountType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2FuncMounts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._localMountPath = undefined; + this._mountResource = undefined; + this._mountSharePath = undefined; + this._mountType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._localMountPath = value.localMountPath; + this._mountResource = value.mountResource; + this._mountSharePath = value.mountSharePath; + this._mountType = value.mountType; + } + } + + // local_mount_path - computed: false, optional: false, required: true + private _localMountPath?: string; + public get localMountPath() { + return this.getStringAttribute('local_mount_path'); + } + public set localMountPath(value: string) { + this._localMountPath = value; + } + // Temporarily expose input value. Use with caution. + public get localMountPathInput() { + return this._localMountPath; + } + + // mount_resource - computed: false, optional: false, required: true + private _mountResource?: string; + public get mountResource() { + return this.getStringAttribute('mount_resource'); + } + public set mountResource(value: string) { + this._mountResource = value; + } + // Temporarily expose input value. Use with caution. + public get mountResourceInput() { + return this._mountResource; + } + + // mount_share_path - computed: false, optional: false, required: true + private _mountSharePath?: string; + public get mountSharePath() { + return this.getStringAttribute('mount_share_path'); + } + public set mountSharePath(value: string) { + this._mountSharePath = value; + } + // Temporarily expose input value. Use with caution. + public get mountSharePathInput() { + return this._mountSharePath; + } + + // mount_type - computed: false, optional: false, required: true + private _mountType?: string; + public get mountType() { + return this.getStringAttribute('mount_type'); + } + public set mountType(value: string) { + this._mountType = value; + } + // Temporarily expose input value. Use with caution. + public get mountTypeInput() { + return this._mountType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class FgsFunctionV2FuncMountsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionV2FuncMounts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionV2FuncMountsOutputReference { + return new FgsFunctionV2FuncMountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#count FgsFunctionV2#count} + */ + readonly count: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#cron FgsFunctionV2#cron} + */ + readonly cron: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#expired_time FgsFunctionV2#expired_time} + */ + readonly expiredTime: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#name FgsFunctionV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#start_time FgsFunctionV2#start_time} + */ + readonly startTime: number; +} + +export function fgsFunctionV2ReservedInstancesTacticsConfigCronConfigsToTerraform(struct?: FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + cron: cdktf.stringToTerraform(struct!.cron), + expired_time: cdktf.numberToTerraform(struct!.expiredTime), + name: cdktf.stringToTerraform(struct!.name), + start_time: cdktf.numberToTerraform(struct!.startTime), + } +} + + +export function fgsFunctionV2ReservedInstancesTacticsConfigCronConfigsToHclTerraform(struct?: FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cron: { + value: cdktf.stringToHclTerraform(struct!.cron), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expired_time: { + value: cdktf.numberToHclTerraform(struct!.expiredTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.numberToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2ReservedInstancesTacticsConfigCronConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._cron !== undefined) { + hasAnyValues = true; + internalValueResult.cron = this._cron; + } + if (this._expiredTime !== undefined) { + hasAnyValues = true; + internalValueResult.expiredTime = this._expiredTime; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._count = undefined; + this._cron = undefined; + this._expiredTime = undefined; + this._name = undefined; + this._startTime = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._count = value.count; + this._cron = value.cron; + this._expiredTime = value.expiredTime; + this._name = value.name; + this._startTime = value.startTime; + } + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // cron - computed: false, optional: false, required: true + private _cron?: string; + public get cron() { + return this.getStringAttribute('cron'); + } + public set cron(value: string) { + this._cron = value; + } + // Temporarily expose input value. Use with caution. + public get cronInput() { + return this._cron; + } + + // expired_time - computed: false, optional: false, required: true + private _expiredTime?: number; + public get expiredTime() { + return this.getNumberAttribute('expired_time'); + } + public set expiredTime(value: number) { + this._expiredTime = value; + } + // Temporarily expose input value. Use with caution. + public get expiredTimeInput() { + return this._expiredTime; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: number; + public get startTime() { + return this.getNumberAttribute('start_time'); + } + public set startTime(value: number) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +export class FgsFunctionV2ReservedInstancesTacticsConfigCronConfigsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionV2ReservedInstancesTacticsConfigCronConfigsOutputReference { + return new FgsFunctionV2ReservedInstancesTacticsConfigCronConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#min FgsFunctionV2#min} + */ + readonly min: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#name FgsFunctionV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#threshold FgsFunctionV2#threshold} + */ + readonly threshold: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#type FgsFunctionV2#type} + */ + readonly type: string; +} + +export function fgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsToTerraform(struct?: FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + min: cdktf.numberToTerraform(struct!.min), + name: cdktf.stringToTerraform(struct!.name), + threshold: cdktf.numberToTerraform(struct!.threshold), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function fgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsToHclTerraform(struct?: FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + min: { + value: cdktf.numberToHclTerraform(struct!.min), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + threshold: { + value: cdktf.numberToHclTerraform(struct!.threshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._min !== undefined) { + hasAnyValues = true; + internalValueResult.min = this._min; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._threshold !== undefined) { + hasAnyValues = true; + internalValueResult.threshold = this._threshold; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._min = undefined; + this._name = undefined; + this._threshold = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._min = value.min; + this._name = value.name; + this._threshold = value.threshold; + this._type = value.type; + } + } + + // min - computed: false, optional: false, required: true + private _min?: number; + public get min() { + return this.getNumberAttribute('min'); + } + public set min(value: number) { + this._min = value; + } + // Temporarily expose input value. Use with caution. + public get minInput() { + return this._min; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // threshold - computed: false, optional: false, required: true + private _threshold?: number; + public get threshold() { + return this.getNumberAttribute('threshold'); + } + public set threshold(value: number) { + this._threshold = value; + } + // Temporarily expose input value. Use with caution. + public get thresholdInput() { + return this._threshold; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsOutputReference { + return new FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionV2ReservedInstancesTacticsConfig { + /** + * cron_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#cron_configs FgsFunctionV2#cron_configs} + */ + readonly cronConfigs?: FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs[] | cdktf.IResolvable; + /** + * metric_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#metric_configs FgsFunctionV2#metric_configs} + */ + readonly metricConfigs?: FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs[] | cdktf.IResolvable; +} + +export function fgsFunctionV2ReservedInstancesTacticsConfigToTerraform(struct?: FgsFunctionV2ReservedInstancesTacticsConfigOutputReference | FgsFunctionV2ReservedInstancesTacticsConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cron_configs: cdktf.listMapper(fgsFunctionV2ReservedInstancesTacticsConfigCronConfigsToTerraform, true)(struct!.cronConfigs), + metric_configs: cdktf.listMapper(fgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsToTerraform, true)(struct!.metricConfigs), + } +} + + +export function fgsFunctionV2ReservedInstancesTacticsConfigToHclTerraform(struct?: FgsFunctionV2ReservedInstancesTacticsConfigOutputReference | FgsFunctionV2ReservedInstancesTacticsConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cron_configs: { + value: cdktf.listMapperHcl(fgsFunctionV2ReservedInstancesTacticsConfigCronConfigsToHclTerraform, true)(struct!.cronConfigs), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionV2ReservedInstancesTacticsConfigCronConfigsList", + }, + metric_configs: { + value: cdktf.listMapperHcl(fgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsToHclTerraform, true)(struct!.metricConfigs), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2ReservedInstancesTacticsConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsFunctionV2ReservedInstancesTacticsConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cronConfigs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cronConfigs = this._cronConfigs?.internalValue; + } + if (this._metricConfigs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.metricConfigs = this._metricConfigs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2ReservedInstancesTacticsConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cronConfigs.internalValue = undefined; + this._metricConfigs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cronConfigs.internalValue = value.cronConfigs; + this._metricConfigs.internalValue = value.metricConfigs; + } + } + + // cron_configs - computed: false, optional: true, required: false + private _cronConfigs = new FgsFunctionV2ReservedInstancesTacticsConfigCronConfigsList(this, "cron_configs", false); + public get cronConfigs() { + return this._cronConfigs; + } + public putCronConfigs(value: FgsFunctionV2ReservedInstancesTacticsConfigCronConfigs[] | cdktf.IResolvable) { + this._cronConfigs.internalValue = value; + } + public resetCronConfigs() { + this._cronConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronConfigsInput() { + return this._cronConfigs.internalValue; + } + + // metric_configs - computed: false, optional: true, required: false + private _metricConfigs = new FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigsList(this, "metric_configs", false); + public get metricConfigs() { + return this._metricConfigs; + } + public putMetricConfigs(value: FgsFunctionV2ReservedInstancesTacticsConfigMetricConfigs[] | cdktf.IResolvable) { + this._metricConfigs.internalValue = value; + } + public resetMetricConfigs() { + this._metricConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricConfigsInput() { + return this._metricConfigs.internalValue; + } +} +export interface FgsFunctionV2ReservedInstances { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#count FgsFunctionV2#count} + */ + readonly count: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#idle_mode FgsFunctionV2#idle_mode} + */ + readonly idleMode?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#qualifier_name FgsFunctionV2#qualifier_name} + */ + readonly qualifierName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#qualifier_type FgsFunctionV2#qualifier_type} + */ + readonly qualifierType: string; + /** + * tactics_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#tactics_config FgsFunctionV2#tactics_config} + */ + readonly tacticsConfig?: FgsFunctionV2ReservedInstancesTacticsConfig; +} + +export function fgsFunctionV2ReservedInstancesToTerraform(struct?: FgsFunctionV2ReservedInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + idle_mode: cdktf.booleanToTerraform(struct!.idleMode), + qualifier_name: cdktf.stringToTerraform(struct!.qualifierName), + qualifier_type: cdktf.stringToTerraform(struct!.qualifierType), + tactics_config: fgsFunctionV2ReservedInstancesTacticsConfigToTerraform(struct!.tacticsConfig), + } +} + + +export function fgsFunctionV2ReservedInstancesToHclTerraform(struct?: FgsFunctionV2ReservedInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + idle_mode: { + value: cdktf.booleanToHclTerraform(struct!.idleMode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + qualifier_name: { + value: cdktf.stringToHclTerraform(struct!.qualifierName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + qualifier_type: { + value: cdktf.stringToHclTerraform(struct!.qualifierType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tactics_config: { + value: fgsFunctionV2ReservedInstancesTacticsConfigToHclTerraform(struct!.tacticsConfig), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionV2ReservedInstancesTacticsConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2ReservedInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionV2ReservedInstances | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._idleMode !== undefined) { + hasAnyValues = true; + internalValueResult.idleMode = this._idleMode; + } + if (this._qualifierName !== undefined) { + hasAnyValues = true; + internalValueResult.qualifierName = this._qualifierName; + } + if (this._qualifierType !== undefined) { + hasAnyValues = true; + internalValueResult.qualifierType = this._qualifierType; + } + if (this._tacticsConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.tacticsConfig = this._tacticsConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2ReservedInstances | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._count = undefined; + this._idleMode = undefined; + this._qualifierName = undefined; + this._qualifierType = undefined; + this._tacticsConfig.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._count = value.count; + this._idleMode = value.idleMode; + this._qualifierName = value.qualifierName; + this._qualifierType = value.qualifierType; + this._tacticsConfig.internalValue = value.tacticsConfig; + } + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // idle_mode - computed: false, optional: true, required: false + private _idleMode?: boolean | cdktf.IResolvable; + public get idleMode() { + return this.getBooleanAttribute('idle_mode'); + } + public set idleMode(value: boolean | cdktf.IResolvable) { + this._idleMode = value; + } + public resetIdleMode() { + this._idleMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get idleModeInput() { + return this._idleMode; + } + + // qualifier_name - computed: false, optional: false, required: true + private _qualifierName?: string; + public get qualifierName() { + return this.getStringAttribute('qualifier_name'); + } + public set qualifierName(value: string) { + this._qualifierName = value; + } + // Temporarily expose input value. Use with caution. + public get qualifierNameInput() { + return this._qualifierName; + } + + // qualifier_type - computed: false, optional: false, required: true + private _qualifierType?: string; + public get qualifierType() { + return this.getStringAttribute('qualifier_type'); + } + public set qualifierType(value: string) { + this._qualifierType = value; + } + // Temporarily expose input value. Use with caution. + public get qualifierTypeInput() { + return this._qualifierType; + } + + // tactics_config - computed: false, optional: true, required: false + private _tacticsConfig = new FgsFunctionV2ReservedInstancesTacticsConfigOutputReference(this, "tactics_config"); + public get tacticsConfig() { + return this._tacticsConfig; + } + public putTacticsConfig(value: FgsFunctionV2ReservedInstancesTacticsConfig) { + this._tacticsConfig.internalValue = value; + } + public resetTacticsConfig() { + this._tacticsConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tacticsConfigInput() { + return this._tacticsConfig.internalValue; + } +} + +export class FgsFunctionV2ReservedInstancesList extends cdktf.ComplexList { + public internalValue? : FgsFunctionV2ReservedInstances[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionV2ReservedInstancesOutputReference { + return new FgsFunctionV2ReservedInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#create FgsFunctionV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#delete FgsFunctionV2#delete} + */ + readonly delete?: string; +} + +export function fgsFunctionV2TimeoutsToTerraform(struct?: FgsFunctionV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function fgsFunctionV2TimeoutsToHclTerraform(struct?: FgsFunctionV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FgsFunctionV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} +export interface FgsFunctionV2VersionsAliases { + /** + * The description of the version alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#description FgsFunctionV2#description} + */ + readonly description?: string; + /** + * The name of the version alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#name FgsFunctionV2#name} + */ + readonly name: string; +} + +export function fgsFunctionV2VersionsAliasesToTerraform(struct?: FgsFunctionV2VersionsAliasesOutputReference | FgsFunctionV2VersionsAliases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function fgsFunctionV2VersionsAliasesToHclTerraform(struct?: FgsFunctionV2VersionsAliasesOutputReference | FgsFunctionV2VersionsAliases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2VersionsAliasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsFunctionV2VersionsAliases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2VersionsAliases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._name = value.name; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} +export interface FgsFunctionV2Versions { + /** + * The version name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#name FgsFunctionV2#name} + */ + readonly name: string; + /** + * aliases block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#aliases FgsFunctionV2#aliases} + */ + readonly aliases?: FgsFunctionV2VersionsAliases; +} + +export function fgsFunctionV2VersionsToTerraform(struct?: FgsFunctionV2Versions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + aliases: fgsFunctionV2VersionsAliasesToTerraform(struct!.aliases), + } +} + + +export function fgsFunctionV2VersionsToHclTerraform(struct?: FgsFunctionV2Versions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aliases: { + value: fgsFunctionV2VersionsAliasesToHclTerraform(struct!.aliases), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionV2VersionsAliasesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionV2VersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionV2Versions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._aliases?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.aliases = this._aliases?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionV2Versions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._aliases.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._aliases.internalValue = value.aliases; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // aliases - computed: false, optional: true, required: false + private _aliases = new FgsFunctionV2VersionsAliasesOutputReference(this, "aliases"); + public get aliases() { + return this._aliases; + } + public putAliases(value: FgsFunctionV2VersionsAliases) { + this._aliases.internalValue = value; + } + public resetAliases() { + this._aliases.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasesInput() { + return this._aliases.internalValue; + } +} + +export class FgsFunctionV2VersionsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionV2Versions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionV2VersionsOutputReference { + return new FgsFunctionV2VersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2 huaweicloud_fgs_function_v2} +*/ +export class FgsFunctionV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_function_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsFunctionV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsFunctionV2 to import + * @param importFromId The id of the existing FgsFunctionV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsFunctionV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_function_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function_v2 huaweicloud_fgs_function_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsFunctionV2Config + */ + public constructor(scope: Construct, id: string, config: FgsFunctionV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_function_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._app = config.app; + this._appAgency = config.appAgency; + this._codeFilename = config.codeFilename; + this._codeType = config.codeType; + this._codeUrl = config.codeUrl; + this._concurrencyNum = config.concurrencyNum; + this._dependList = config.dependList; + this._description = config.description; + this._dnsList = config.dnsList; + this._encryptedUserData = config.encryptedUserData; + this._enterpriseProjectId = config.enterpriseProjectId; + this._funcCode = config.funcCode; + this._functiongraphVersion = config.functiongraphVersion; + this._gpuMemory = config.gpuMemory; + this._gpuType = config.gpuType; + this._handler = config.handler; + this._id = config.id; + this._initializerHandler = config.initializerHandler; + this._initializerTimeout = config.initializerTimeout; + this._logGroupId = config.logGroupId; + this._logGroupName = config.logGroupName; + this._logStreamId = config.logStreamId; + this._logStreamName = config.logStreamName; + this._maxInstanceNum = config.maxInstanceNum; + this._memorySize = config.memorySize; + this._mountUserGroupId = config.mountUserGroupId; + this._mountUserId = config.mountUserId; + this._name = config.name; + this._networkId = config.networkId; + this._package = config.package; + this._preStopHandler = config.preStopHandler; + this._preStopTimeout = config.preStopTimeout; + this._region = config.region; + this._runtime = config.runtime; + this._tags = config.tags; + this._timeout = config.timeout; + this._userData = config.userData; + this._vpcId = config.vpcId; + this._xrole = config.xrole; + this._customImage.internalValue = config.customImage; + this._funcMounts.internalValue = config.funcMounts; + this._reservedInstances.internalValue = config.reservedInstances; + this._timeouts.internalValue = config.timeouts; + this._versions.internalValue = config.versions; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: true, required: false + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + public resetAgency() { + this._agency = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // app - computed: false, optional: true, required: false + private _app?: string; + public get app() { + return this.getStringAttribute('app'); + } + public set app(value: string) { + this._app = value; + } + public resetApp() { + this._app = undefined; + } + // Temporarily expose input value. Use with caution. + public get appInput() { + return this._app; + } + + // app_agency - computed: true, optional: true, required: false + private _appAgency?: string; + public get appAgency() { + return this.getStringAttribute('app_agency'); + } + public set appAgency(value: string) { + this._appAgency = value; + } + public resetAppAgency() { + this._appAgency = undefined; + } + // Temporarily expose input value. Use with caution. + public get appAgencyInput() { + return this._appAgency; + } + + // code_filename - computed: true, optional: true, required: false + private _codeFilename?: string; + public get codeFilename() { + return this.getStringAttribute('code_filename'); + } + public set codeFilename(value: string) { + this._codeFilename = value; + } + public resetCodeFilename() { + this._codeFilename = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeFilenameInput() { + return this._codeFilename; + } + + // code_type - computed: true, optional: true, required: false + private _codeType?: string; + public get codeType() { + return this.getStringAttribute('code_type'); + } + public set codeType(value: string) { + this._codeType = value; + } + public resetCodeType() { + this._codeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeTypeInput() { + return this._codeType; + } + + // code_url - computed: false, optional: true, required: false + private _codeUrl?: string; + public get codeUrl() { + return this.getStringAttribute('code_url'); + } + public set codeUrl(value: string) { + this._codeUrl = value; + } + public resetCodeUrl() { + this._codeUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeUrlInput() { + return this._codeUrl; + } + + // concurrency_num - computed: true, optional: true, required: false + private _concurrencyNum?: number; + public get concurrencyNum() { + return this.getNumberAttribute('concurrency_num'); + } + public set concurrencyNum(value: number) { + this._concurrencyNum = value; + } + public resetConcurrencyNum() { + this._concurrencyNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get concurrencyNumInput() { + return this._concurrencyNum; + } + + // depend_list - computed: true, optional: true, required: false + private _dependList?: string[]; + public get dependList() { + return cdktf.Fn.tolist(this.getListAttribute('depend_list')); + } + public set dependList(value: string[]) { + this._dependList = value; + } + public resetDependList() { + this._dependList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependListInput() { + return this._dependList; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dns_list - computed: true, optional: true, required: false + private _dnsList?: string; + public get dnsList() { + return this.getStringAttribute('dns_list'); + } + public set dnsList(value: string) { + this._dnsList = value; + } + public resetDnsList() { + this._dnsList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dnsListInput() { + return this._dnsList; + } + + // encrypted_user_data - computed: false, optional: true, required: false + private _encryptedUserData?: string; + public get encryptedUserData() { + return this.getStringAttribute('encrypted_user_data'); + } + public set encryptedUserData(value: string) { + this._encryptedUserData = value; + } + public resetEncryptedUserData() { + this._encryptedUserData = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptedUserDataInput() { + return this._encryptedUserData; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // func_code - computed: false, optional: true, required: false + private _funcCode?: string; + public get funcCode() { + return this.getStringAttribute('func_code'); + } + public set funcCode(value: string) { + this._funcCode = value; + } + public resetFuncCode() { + this._funcCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get funcCodeInput() { + return this._funcCode; + } + + // functiongraph_version - computed: true, optional: true, required: false + private _functiongraphVersion?: string; + public get functiongraphVersion() { + return this.getStringAttribute('functiongraph_version'); + } + public set functiongraphVersion(value: string) { + this._functiongraphVersion = value; + } + public resetFunctiongraphVersion() { + this._functiongraphVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get functiongraphVersionInput() { + return this._functiongraphVersion; + } + + // gpu_memory - computed: false, optional: true, required: false + private _gpuMemory?: number; + public get gpuMemory() { + return this.getNumberAttribute('gpu_memory'); + } + public set gpuMemory(value: number) { + this._gpuMemory = value; + } + public resetGpuMemory() { + this._gpuMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get gpuMemoryInput() { + return this._gpuMemory; + } + + // gpu_type - computed: false, optional: true, required: false + private _gpuType?: string; + public get gpuType() { + return this.getStringAttribute('gpu_type'); + } + public set gpuType(value: string) { + this._gpuType = value; + } + public resetGpuType() { + this._gpuType = undefined; + } + // Temporarily expose input value. Use with caution. + public get gpuTypeInput() { + return this._gpuType; + } + + // handler - computed: true, optional: true, required: false + private _handler?: string; + public get handler() { + return this.getStringAttribute('handler'); + } + public set handler(value: string) { + this._handler = value; + } + public resetHandler() { + this._handler = undefined; + } + // Temporarily expose input value. Use with caution. + public get handlerInput() { + return this._handler; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // initializer_handler - computed: true, optional: true, required: false + private _initializerHandler?: string; + public get initializerHandler() { + return this.getStringAttribute('initializer_handler'); + } + public set initializerHandler(value: string) { + this._initializerHandler = value; + } + public resetInitializerHandler() { + this._initializerHandler = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializerHandlerInput() { + return this._initializerHandler; + } + + // initializer_timeout - computed: true, optional: true, required: false + private _initializerTimeout?: number; + public get initializerTimeout() { + return this.getNumberAttribute('initializer_timeout'); + } + public set initializerTimeout(value: number) { + this._initializerTimeout = value; + } + public resetInitializerTimeout() { + this._initializerTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializerTimeoutInput() { + return this._initializerTimeout; + } + + // log_group_id - computed: true, optional: true, required: false + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + public resetLogGroupId() { + this._logGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: true, optional: true, required: false + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + public resetLogGroupName() { + this._logGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_id - computed: true, optional: true, required: false + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + public resetLogStreamId() { + this._logStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: true, optional: true, required: false + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + public resetLogStreamName() { + this._logStreamName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // max_instance_num - computed: true, optional: true, required: false + private _maxInstanceNum?: string; + public get maxInstanceNum() { + return this.getStringAttribute('max_instance_num'); + } + public set maxInstanceNum(value: string) { + this._maxInstanceNum = value; + } + public resetMaxInstanceNum() { + this._maxInstanceNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInstanceNumInput() { + return this._maxInstanceNum; + } + + // memory_size - computed: false, optional: false, required: true + private _memorySize?: number; + public get memorySize() { + return this.getNumberAttribute('memory_size'); + } + public set memorySize(value: number) { + this._memorySize = value; + } + // Temporarily expose input value. Use with caution. + public get memorySizeInput() { + return this._memorySize; + } + + // mount_user_group_id - computed: true, optional: true, required: false + private _mountUserGroupId?: number; + public get mountUserGroupId() { + return this.getNumberAttribute('mount_user_group_id'); + } + public set mountUserGroupId(value: number) { + this._mountUserGroupId = value; + } + public resetMountUserGroupId() { + this._mountUserGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get mountUserGroupIdInput() { + return this._mountUserGroupId; + } + + // mount_user_id - computed: true, optional: true, required: false + private _mountUserId?: number; + public get mountUserId() { + return this.getNumberAttribute('mount_user_id'); + } + public set mountUserId(value: number) { + this._mountUserId = value; + } + public resetMountUserId() { + this._mountUserId = undefined; + } + // Temporarily expose input value. Use with caution. + public get mountUserIdInput() { + return this._mountUserId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // package - computed: false, optional: true, required: false + private _package?: string; + public get package() { + return this.getStringAttribute('package'); + } + public set package(value: string) { + this._package = value; + } + public resetPackage() { + this._package = undefined; + } + // Temporarily expose input value. Use with caution. + public get packageInput() { + return this._package; + } + + // pre_stop_handler - computed: false, optional: true, required: false + private _preStopHandler?: string; + public get preStopHandler() { + return this.getStringAttribute('pre_stop_handler'); + } + public set preStopHandler(value: string) { + this._preStopHandler = value; + } + public resetPreStopHandler() { + this._preStopHandler = undefined; + } + // Temporarily expose input value. Use with caution. + public get preStopHandlerInput() { + return this._preStopHandler; + } + + // pre_stop_timeout - computed: false, optional: true, required: false + private _preStopTimeout?: number; + public get preStopTimeout() { + return this.getNumberAttribute('pre_stop_timeout'); + } + public set preStopTimeout(value: number) { + this._preStopTimeout = value; + } + public resetPreStopTimeout() { + this._preStopTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get preStopTimeoutInput() { + return this._preStopTimeout; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: false, required: true + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // xrole - computed: false, optional: true, required: false + private _xrole?: string; + public get xrole() { + return this.getStringAttribute('xrole'); + } + public set xrole(value: string) { + this._xrole = value; + } + public resetXrole() { + this._xrole = undefined; + } + // Temporarily expose input value. Use with caution. + public get xroleInput() { + return this._xrole; + } + + // custom_image - computed: false, optional: true, required: false + private _customImage = new FgsFunctionV2CustomImageOutputReference(this, "custom_image"); + public get customImage() { + return this._customImage; + } + public putCustomImage(value: FgsFunctionV2CustomImage) { + this._customImage.internalValue = value; + } + public resetCustomImage() { + this._customImage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customImageInput() { + return this._customImage.internalValue; + } + + // func_mounts - computed: false, optional: true, required: false + private _funcMounts = new FgsFunctionV2FuncMountsList(this, "func_mounts", false); + public get funcMounts() { + return this._funcMounts; + } + public putFuncMounts(value: FgsFunctionV2FuncMounts[] | cdktf.IResolvable) { + this._funcMounts.internalValue = value; + } + public resetFuncMounts() { + this._funcMounts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get funcMountsInput() { + return this._funcMounts.internalValue; + } + + // reserved_instances - computed: false, optional: true, required: false + private _reservedInstances = new FgsFunctionV2ReservedInstancesList(this, "reserved_instances", true); + public get reservedInstances() { + return this._reservedInstances; + } + public putReservedInstances(value: FgsFunctionV2ReservedInstances[] | cdktf.IResolvable) { + this._reservedInstances.internalValue = value; + } + public resetReservedInstances() { + this._reservedInstances.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get reservedInstancesInput() { + return this._reservedInstances.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FgsFunctionV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FgsFunctionV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // versions - computed: false, optional: true, required: false + private _versions = new FgsFunctionV2VersionsList(this, "versions", true); + public get versions() { + return this._versions; + } + public putVersions(value: FgsFunctionV2Versions[] | cdktf.IResolvable) { + this._versions.internalValue = value; + } + public resetVersions() { + this._versions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionsInput() { + return this._versions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + app: cdktf.stringToTerraform(this._app), + app_agency: cdktf.stringToTerraform(this._appAgency), + code_filename: cdktf.stringToTerraform(this._codeFilename), + code_type: cdktf.stringToTerraform(this._codeType), + code_url: cdktf.stringToTerraform(this._codeUrl), + concurrency_num: cdktf.numberToTerraform(this._concurrencyNum), + depend_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dependList), + description: cdktf.stringToTerraform(this._description), + dns_list: cdktf.stringToTerraform(this._dnsList), + encrypted_user_data: cdktf.stringToTerraform(this._encryptedUserData), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + func_code: cdktf.stringToTerraform(this._funcCode), + functiongraph_version: cdktf.stringToTerraform(this._functiongraphVersion), + gpu_memory: cdktf.numberToTerraform(this._gpuMemory), + gpu_type: cdktf.stringToTerraform(this._gpuType), + handler: cdktf.stringToTerraform(this._handler), + id: cdktf.stringToTerraform(this._id), + initializer_handler: cdktf.stringToTerraform(this._initializerHandler), + initializer_timeout: cdktf.numberToTerraform(this._initializerTimeout), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + max_instance_num: cdktf.stringToTerraform(this._maxInstanceNum), + memory_size: cdktf.numberToTerraform(this._memorySize), + mount_user_group_id: cdktf.numberToTerraform(this._mountUserGroupId), + mount_user_id: cdktf.numberToTerraform(this._mountUserId), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + package: cdktf.stringToTerraform(this._package), + pre_stop_handler: cdktf.stringToTerraform(this._preStopHandler), + pre_stop_timeout: cdktf.numberToTerraform(this._preStopTimeout), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeout: cdktf.numberToTerraform(this._timeout), + user_data: cdktf.stringToTerraform(this._userData), + vpc_id: cdktf.stringToTerraform(this._vpcId), + xrole: cdktf.stringToTerraform(this._xrole), + custom_image: fgsFunctionV2CustomImageToTerraform(this._customImage.internalValue), + func_mounts: cdktf.listMapper(fgsFunctionV2FuncMountsToTerraform, true)(this._funcMounts.internalValue), + reserved_instances: cdktf.listMapper(fgsFunctionV2ReservedInstancesToTerraform, true)(this._reservedInstances.internalValue), + timeouts: fgsFunctionV2TimeoutsToTerraform(this._timeouts.internalValue), + versions: cdktf.listMapper(fgsFunctionV2VersionsToTerraform, true)(this._versions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app: { + value: cdktf.stringToHclTerraform(this._app), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_agency: { + value: cdktf.stringToHclTerraform(this._appAgency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code_filename: { + value: cdktf.stringToHclTerraform(this._codeFilename), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code_type: { + value: cdktf.stringToHclTerraform(this._codeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code_url: { + value: cdktf.stringToHclTerraform(this._codeUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + concurrency_num: { + value: cdktf.numberToHclTerraform(this._concurrencyNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + depend_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dependList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dns_list: { + value: cdktf.stringToHclTerraform(this._dnsList), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encrypted_user_data: { + value: cdktf.stringToHclTerraform(this._encryptedUserData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + func_code: { + value: cdktf.stringToHclTerraform(this._funcCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + functiongraph_version: { + value: cdktf.stringToHclTerraform(this._functiongraphVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gpu_memory: { + value: cdktf.numberToHclTerraform(this._gpuMemory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + gpu_type: { + value: cdktf.stringToHclTerraform(this._gpuType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + handler: { + value: cdktf.stringToHclTerraform(this._handler), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initializer_handler: { + value: cdktf.stringToHclTerraform(this._initializerHandler), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initializer_timeout: { + value: cdktf.numberToHclTerraform(this._initializerTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_instance_num: { + value: cdktf.stringToHclTerraform(this._maxInstanceNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory_size: { + value: cdktf.numberToHclTerraform(this._memorySize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mount_user_group_id: { + value: cdktf.numberToHclTerraform(this._mountUserGroupId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mount_user_id: { + value: cdktf.numberToHclTerraform(this._mountUserId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package: { + value: cdktf.stringToHclTerraform(this._package), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pre_stop_handler: { + value: cdktf.stringToHclTerraform(this._preStopHandler), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pre_stop_timeout: { + value: cdktf.numberToHclTerraform(this._preStopTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + xrole: { + value: cdktf.stringToHclTerraform(this._xrole), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_image: { + value: fgsFunctionV2CustomImageToHclTerraform(this._customImage.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionV2CustomImageList", + }, + func_mounts: { + value: cdktf.listMapperHcl(fgsFunctionV2FuncMountsToHclTerraform, true)(this._funcMounts.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionV2FuncMountsList", + }, + reserved_instances: { + value: cdktf.listMapperHcl(fgsFunctionV2ReservedInstancesToHclTerraform, true)(this._reservedInstances.internalValue), + isBlock: true, + type: "set", + storageClassType: "FgsFunctionV2ReservedInstancesList", + }, + timeouts: { + value: fgsFunctionV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FgsFunctionV2Timeouts", + }, + versions: { + value: cdktf.listMapperHcl(fgsFunctionV2VersionsToHclTerraform, true)(this._versions.internalValue), + isBlock: true, + type: "set", + storageClassType: "FgsFunctionV2VersionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-function/README.md b/src/constructs/providers/huaweicloud/fgs-function/README.md new file mode 100644 index 00000000..63623509 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_function` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_function`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function). diff --git a/src/constructs/providers/huaweicloud/fgs-function/index.ts b/src/constructs/providers/huaweicloud/fgs-function/index.ts new file mode 100644 index 00000000..727e73d1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-function/index.ts @@ -0,0 +1,3025 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsFunctionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#agency FgsFunction#agency} + */ + readonly agency?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#app FgsFunction#app} + */ + readonly app?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#app_agency FgsFunction#app_agency} + */ + readonly appAgency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#code_filename FgsFunction#code_filename} + */ + readonly codeFilename?: string; + /** + * The code type of the function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#code_type FgsFunction#code_type} + */ + readonly codeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#code_url FgsFunction#code_url} + */ + readonly codeUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#concurrency_num FgsFunction#concurrency_num} + */ + readonly concurrencyNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#depend_list FgsFunction#depend_list} + */ + readonly dependList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#description FgsFunction#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#dns_list FgsFunction#dns_list} + */ + readonly dnsList?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#encrypted_user_data FgsFunction#encrypted_user_data} + */ + readonly encryptedUserData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#enterprise_project_id FgsFunction#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#func_code FgsFunction#func_code} + */ + readonly funcCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#functiongraph_version FgsFunction#functiongraph_version} + */ + readonly functiongraphVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#gpu_memory FgsFunction#gpu_memory} + */ + readonly gpuMemory?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#gpu_type FgsFunction#gpu_type} + */ + readonly gpuType?: string; + /** + * schema: Required; The entry point of the function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#handler FgsFunction#handler} + */ + readonly handler?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#id FgsFunction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#initializer_handler FgsFunction#initializer_handler} + */ + readonly initializerHandler?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#initializer_timeout FgsFunction#initializer_timeout} + */ + readonly initializerTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#log_group_id FgsFunction#log_group_id} + */ + readonly logGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#log_group_name FgsFunction#log_group_name} + */ + readonly logGroupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#log_stream_id FgsFunction#log_stream_id} + */ + readonly logStreamId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#log_stream_name FgsFunction#log_stream_name} + */ + readonly logStreamName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#max_instance_num FgsFunction#max_instance_num} + */ + readonly maxInstanceNum?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#memory_size FgsFunction#memory_size} + */ + readonly memorySize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#mount_user_group_id FgsFunction#mount_user_group_id} + */ + readonly mountUserGroupId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#mount_user_id FgsFunction#mount_user_id} + */ + readonly mountUserId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#name FgsFunction#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#network_id FgsFunction#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#package FgsFunction#package} + */ + readonly package?: string; + /** + * schema: Internal; Specifies the pre-stop handler of a function. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#pre_stop_handler FgsFunction#pre_stop_handler} + */ + readonly preStopHandler?: string; + /** + * schema: Internal; Specifies the maximum duration that the function can be initialized. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#pre_stop_timeout FgsFunction#pre_stop_timeout} + */ + readonly preStopTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#region FgsFunction#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#runtime FgsFunction#runtime} + */ + readonly runtime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#tags FgsFunction#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#timeout FgsFunction#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#user_data FgsFunction#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#vpc_id FgsFunction#vpc_id} + */ + readonly vpcId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#xrole FgsFunction#xrole} + */ + readonly xrole?: string; + /** + * custom_image block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#custom_image FgsFunction#custom_image} + */ + readonly customImage?: FgsFunctionCustomImage; + /** + * func_mounts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#func_mounts FgsFunction#func_mounts} + */ + readonly funcMounts?: FgsFunctionFuncMounts[] | cdktf.IResolvable; + /** + * reserved_instances block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#reserved_instances FgsFunction#reserved_instances} + */ + readonly reservedInstances?: FgsFunctionReservedInstances[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#timeouts FgsFunction#timeouts} + */ + readonly timeouts?: FgsFunctionTimeouts; + /** + * versions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#versions FgsFunction#versions} + */ + readonly versions?: FgsFunctionVersions[] | cdktf.IResolvable; +} +export interface FgsFunctionCustomImage { + /** + * Specifies the command line arguments used to start the SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#args FgsFunction#args} + */ + readonly args?: string; + /** + * Specifies the startup commands of the SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#command FgsFunction#command} + */ + readonly command?: string; + /** + * Specifies the URL of SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#url FgsFunction#url} + */ + readonly url: string; + /** + * schema: Internal; Specifies the user group ID for running the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#user_group_id FgsFunction#user_group_id} + */ + readonly userGroupId?: string; + /** + * schema: Internal; Specifies the user ID for running the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#user_id FgsFunction#user_id} + */ + readonly userId?: string; + /** + * Specifies the working directory of the SWR image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#working_dir FgsFunction#working_dir} + */ + readonly workingDir?: string; +} + +export function fgsFunctionCustomImageToTerraform(struct?: FgsFunctionCustomImageOutputReference | FgsFunctionCustomImage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + args: cdktf.stringToTerraform(struct!.args), + command: cdktf.stringToTerraform(struct!.command), + url: cdktf.stringToTerraform(struct!.url), + user_group_id: cdktf.stringToTerraform(struct!.userGroupId), + user_id: cdktf.stringToTerraform(struct!.userId), + working_dir: cdktf.stringToTerraform(struct!.workingDir), + } +} + + +export function fgsFunctionCustomImageToHclTerraform(struct?: FgsFunctionCustomImageOutputReference | FgsFunctionCustomImage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + args: { + value: cdktf.stringToHclTerraform(struct!.args), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command: { + value: cdktf.stringToHclTerraform(struct!.command), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(struct!.url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_group_id: { + value: cdktf.stringToHclTerraform(struct!.userGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(struct!.userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + working_dir: { + value: cdktf.stringToHclTerraform(struct!.workingDir), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionCustomImageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsFunctionCustomImage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._args !== undefined) { + hasAnyValues = true; + internalValueResult.args = this._args; + } + if (this._command !== undefined) { + hasAnyValues = true; + internalValueResult.command = this._command; + } + if (this._url !== undefined) { + hasAnyValues = true; + internalValueResult.url = this._url; + } + if (this._userGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.userGroupId = this._userGroupId; + } + if (this._userId !== undefined) { + hasAnyValues = true; + internalValueResult.userId = this._userId; + } + if (this._workingDir !== undefined) { + hasAnyValues = true; + internalValueResult.workingDir = this._workingDir; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionCustomImage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._args = undefined; + this._command = undefined; + this._url = undefined; + this._userGroupId = undefined; + this._userId = undefined; + this._workingDir = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._args = value.args; + this._command = value.command; + this._url = value.url; + this._userGroupId = value.userGroupId; + this._userId = value.userId; + this._workingDir = value.workingDir; + } + } + + // args - computed: false, optional: true, required: false + private _args?: string; + public get args() { + return this.getStringAttribute('args'); + } + public set args(value: string) { + this._args = value; + } + public resetArgs() { + this._args = undefined; + } + // Temporarily expose input value. Use with caution. + public get argsInput() { + return this._args; + } + + // command - computed: false, optional: true, required: false + private _command?: string; + public get command() { + return this.getStringAttribute('command'); + } + public set command(value: string) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // user_group_id - computed: false, optional: true, required: false + private _userGroupId?: string; + public get userGroupId() { + return this.getStringAttribute('user_group_id'); + } + public set userGroupId(value: string) { + this._userGroupId = value; + } + public resetUserGroupId() { + this._userGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userGroupIdInput() { + return this._userGroupId; + } + + // user_id - computed: false, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // working_dir - computed: true, optional: true, required: false + private _workingDir?: string; + public get workingDir() { + return this.getStringAttribute('working_dir'); + } + public set workingDir(value: string) { + this._workingDir = value; + } + public resetWorkingDir() { + this._workingDir = undefined; + } + // Temporarily expose input value. Use with caution. + public get workingDirInput() { + return this._workingDir; + } +} +export interface FgsFunctionFuncMounts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#local_mount_path FgsFunction#local_mount_path} + */ + readonly localMountPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#mount_resource FgsFunction#mount_resource} + */ + readonly mountResource: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#mount_share_path FgsFunction#mount_share_path} + */ + readonly mountSharePath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#mount_type FgsFunction#mount_type} + */ + readonly mountType: string; +} + +export function fgsFunctionFuncMountsToTerraform(struct?: FgsFunctionFuncMounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + local_mount_path: cdktf.stringToTerraform(struct!.localMountPath), + mount_resource: cdktf.stringToTerraform(struct!.mountResource), + mount_share_path: cdktf.stringToTerraform(struct!.mountSharePath), + mount_type: cdktf.stringToTerraform(struct!.mountType), + } +} + + +export function fgsFunctionFuncMountsToHclTerraform(struct?: FgsFunctionFuncMounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + local_mount_path: { + value: cdktf.stringToHclTerraform(struct!.localMountPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_resource: { + value: cdktf.stringToHclTerraform(struct!.mountResource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_share_path: { + value: cdktf.stringToHclTerraform(struct!.mountSharePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_type: { + value: cdktf.stringToHclTerraform(struct!.mountType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionFuncMountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionFuncMounts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._localMountPath !== undefined) { + hasAnyValues = true; + internalValueResult.localMountPath = this._localMountPath; + } + if (this._mountResource !== undefined) { + hasAnyValues = true; + internalValueResult.mountResource = this._mountResource; + } + if (this._mountSharePath !== undefined) { + hasAnyValues = true; + internalValueResult.mountSharePath = this._mountSharePath; + } + if (this._mountType !== undefined) { + hasAnyValues = true; + internalValueResult.mountType = this._mountType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionFuncMounts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._localMountPath = undefined; + this._mountResource = undefined; + this._mountSharePath = undefined; + this._mountType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._localMountPath = value.localMountPath; + this._mountResource = value.mountResource; + this._mountSharePath = value.mountSharePath; + this._mountType = value.mountType; + } + } + + // local_mount_path - computed: false, optional: false, required: true + private _localMountPath?: string; + public get localMountPath() { + return this.getStringAttribute('local_mount_path'); + } + public set localMountPath(value: string) { + this._localMountPath = value; + } + // Temporarily expose input value. Use with caution. + public get localMountPathInput() { + return this._localMountPath; + } + + // mount_resource - computed: false, optional: false, required: true + private _mountResource?: string; + public get mountResource() { + return this.getStringAttribute('mount_resource'); + } + public set mountResource(value: string) { + this._mountResource = value; + } + // Temporarily expose input value. Use with caution. + public get mountResourceInput() { + return this._mountResource; + } + + // mount_share_path - computed: false, optional: false, required: true + private _mountSharePath?: string; + public get mountSharePath() { + return this.getStringAttribute('mount_share_path'); + } + public set mountSharePath(value: string) { + this._mountSharePath = value; + } + // Temporarily expose input value. Use with caution. + public get mountSharePathInput() { + return this._mountSharePath; + } + + // mount_type - computed: false, optional: false, required: true + private _mountType?: string; + public get mountType() { + return this.getStringAttribute('mount_type'); + } + public set mountType(value: string) { + this._mountType = value; + } + // Temporarily expose input value. Use with caution. + public get mountTypeInput() { + return this._mountType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class FgsFunctionFuncMountsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionFuncMounts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionFuncMountsOutputReference { + return new FgsFunctionFuncMountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionReservedInstancesTacticsConfigCronConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#count FgsFunction#count} + */ + readonly count: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#cron FgsFunction#cron} + */ + readonly cron: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#expired_time FgsFunction#expired_time} + */ + readonly expiredTime: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#name FgsFunction#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#start_time FgsFunction#start_time} + */ + readonly startTime: number; +} + +export function fgsFunctionReservedInstancesTacticsConfigCronConfigsToTerraform(struct?: FgsFunctionReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + cron: cdktf.stringToTerraform(struct!.cron), + expired_time: cdktf.numberToTerraform(struct!.expiredTime), + name: cdktf.stringToTerraform(struct!.name), + start_time: cdktf.numberToTerraform(struct!.startTime), + } +} + + +export function fgsFunctionReservedInstancesTacticsConfigCronConfigsToHclTerraform(struct?: FgsFunctionReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cron: { + value: cdktf.stringToHclTerraform(struct!.cron), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expired_time: { + value: cdktf.numberToHclTerraform(struct!.expiredTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.numberToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionReservedInstancesTacticsConfigCronConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._cron !== undefined) { + hasAnyValues = true; + internalValueResult.cron = this._cron; + } + if (this._expiredTime !== undefined) { + hasAnyValues = true; + internalValueResult.expiredTime = this._expiredTime; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionReservedInstancesTacticsConfigCronConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._count = undefined; + this._cron = undefined; + this._expiredTime = undefined; + this._name = undefined; + this._startTime = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._count = value.count; + this._cron = value.cron; + this._expiredTime = value.expiredTime; + this._name = value.name; + this._startTime = value.startTime; + } + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // cron - computed: false, optional: false, required: true + private _cron?: string; + public get cron() { + return this.getStringAttribute('cron'); + } + public set cron(value: string) { + this._cron = value; + } + // Temporarily expose input value. Use with caution. + public get cronInput() { + return this._cron; + } + + // expired_time - computed: false, optional: false, required: true + private _expiredTime?: number; + public get expiredTime() { + return this.getNumberAttribute('expired_time'); + } + public set expiredTime(value: number) { + this._expiredTime = value; + } + // Temporarily expose input value. Use with caution. + public get expiredTimeInput() { + return this._expiredTime; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: number; + public get startTime() { + return this.getNumberAttribute('start_time'); + } + public set startTime(value: number) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +export class FgsFunctionReservedInstancesTacticsConfigCronConfigsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionReservedInstancesTacticsConfigCronConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionReservedInstancesTacticsConfigCronConfigsOutputReference { + return new FgsFunctionReservedInstancesTacticsConfigCronConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionReservedInstancesTacticsConfigMetricConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#min FgsFunction#min} + */ + readonly min: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#name FgsFunction#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#threshold FgsFunction#threshold} + */ + readonly threshold: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#type FgsFunction#type} + */ + readonly type: string; +} + +export function fgsFunctionReservedInstancesTacticsConfigMetricConfigsToTerraform(struct?: FgsFunctionReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + min: cdktf.numberToTerraform(struct!.min), + name: cdktf.stringToTerraform(struct!.name), + threshold: cdktf.numberToTerraform(struct!.threshold), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function fgsFunctionReservedInstancesTacticsConfigMetricConfigsToHclTerraform(struct?: FgsFunctionReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + min: { + value: cdktf.numberToHclTerraform(struct!.min), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + threshold: { + value: cdktf.numberToHclTerraform(struct!.threshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionReservedInstancesTacticsConfigMetricConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._min !== undefined) { + hasAnyValues = true; + internalValueResult.min = this._min; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._threshold !== undefined) { + hasAnyValues = true; + internalValueResult.threshold = this._threshold; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionReservedInstancesTacticsConfigMetricConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._min = undefined; + this._name = undefined; + this._threshold = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._min = value.min; + this._name = value.name; + this._threshold = value.threshold; + this._type = value.type; + } + } + + // min - computed: false, optional: false, required: true + private _min?: number; + public get min() { + return this.getNumberAttribute('min'); + } + public set min(value: number) { + this._min = value; + } + // Temporarily expose input value. Use with caution. + public get minInput() { + return this._min; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // threshold - computed: false, optional: false, required: true + private _threshold?: number; + public get threshold() { + return this.getNumberAttribute('threshold'); + } + public set threshold(value: number) { + this._threshold = value; + } + // Temporarily expose input value. Use with caution. + public get thresholdInput() { + return this._threshold; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class FgsFunctionReservedInstancesTacticsConfigMetricConfigsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionReservedInstancesTacticsConfigMetricConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionReservedInstancesTacticsConfigMetricConfigsOutputReference { + return new FgsFunctionReservedInstancesTacticsConfigMetricConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionReservedInstancesTacticsConfig { + /** + * cron_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#cron_configs FgsFunction#cron_configs} + */ + readonly cronConfigs?: FgsFunctionReservedInstancesTacticsConfigCronConfigs[] | cdktf.IResolvable; + /** + * metric_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#metric_configs FgsFunction#metric_configs} + */ + readonly metricConfigs?: FgsFunctionReservedInstancesTacticsConfigMetricConfigs[] | cdktf.IResolvable; +} + +export function fgsFunctionReservedInstancesTacticsConfigToTerraform(struct?: FgsFunctionReservedInstancesTacticsConfigOutputReference | FgsFunctionReservedInstancesTacticsConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cron_configs: cdktf.listMapper(fgsFunctionReservedInstancesTacticsConfigCronConfigsToTerraform, true)(struct!.cronConfigs), + metric_configs: cdktf.listMapper(fgsFunctionReservedInstancesTacticsConfigMetricConfigsToTerraform, true)(struct!.metricConfigs), + } +} + + +export function fgsFunctionReservedInstancesTacticsConfigToHclTerraform(struct?: FgsFunctionReservedInstancesTacticsConfigOutputReference | FgsFunctionReservedInstancesTacticsConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cron_configs: { + value: cdktf.listMapperHcl(fgsFunctionReservedInstancesTacticsConfigCronConfigsToHclTerraform, true)(struct!.cronConfigs), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionReservedInstancesTacticsConfigCronConfigsList", + }, + metric_configs: { + value: cdktf.listMapperHcl(fgsFunctionReservedInstancesTacticsConfigMetricConfigsToHclTerraform, true)(struct!.metricConfigs), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionReservedInstancesTacticsConfigMetricConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionReservedInstancesTacticsConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsFunctionReservedInstancesTacticsConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cronConfigs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.cronConfigs = this._cronConfigs?.internalValue; + } + if (this._metricConfigs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.metricConfigs = this._metricConfigs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionReservedInstancesTacticsConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cronConfigs.internalValue = undefined; + this._metricConfigs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cronConfigs.internalValue = value.cronConfigs; + this._metricConfigs.internalValue = value.metricConfigs; + } + } + + // cron_configs - computed: false, optional: true, required: false + private _cronConfigs = new FgsFunctionReservedInstancesTacticsConfigCronConfigsList(this, "cron_configs", false); + public get cronConfigs() { + return this._cronConfigs; + } + public putCronConfigs(value: FgsFunctionReservedInstancesTacticsConfigCronConfigs[] | cdktf.IResolvable) { + this._cronConfigs.internalValue = value; + } + public resetCronConfigs() { + this._cronConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronConfigsInput() { + return this._cronConfigs.internalValue; + } + + // metric_configs - computed: false, optional: true, required: false + private _metricConfigs = new FgsFunctionReservedInstancesTacticsConfigMetricConfigsList(this, "metric_configs", false); + public get metricConfigs() { + return this._metricConfigs; + } + public putMetricConfigs(value: FgsFunctionReservedInstancesTacticsConfigMetricConfigs[] | cdktf.IResolvable) { + this._metricConfigs.internalValue = value; + } + public resetMetricConfigs() { + this._metricConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricConfigsInput() { + return this._metricConfigs.internalValue; + } +} +export interface FgsFunctionReservedInstances { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#count FgsFunction#count} + */ + readonly count: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#idle_mode FgsFunction#idle_mode} + */ + readonly idleMode?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#qualifier_name FgsFunction#qualifier_name} + */ + readonly qualifierName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#qualifier_type FgsFunction#qualifier_type} + */ + readonly qualifierType: string; + /** + * tactics_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#tactics_config FgsFunction#tactics_config} + */ + readonly tacticsConfig?: FgsFunctionReservedInstancesTacticsConfig; +} + +export function fgsFunctionReservedInstancesToTerraform(struct?: FgsFunctionReservedInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + idle_mode: cdktf.booleanToTerraform(struct!.idleMode), + qualifier_name: cdktf.stringToTerraform(struct!.qualifierName), + qualifier_type: cdktf.stringToTerraform(struct!.qualifierType), + tactics_config: fgsFunctionReservedInstancesTacticsConfigToTerraform(struct!.tacticsConfig), + } +} + + +export function fgsFunctionReservedInstancesToHclTerraform(struct?: FgsFunctionReservedInstances | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + idle_mode: { + value: cdktf.booleanToHclTerraform(struct!.idleMode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + qualifier_name: { + value: cdktf.stringToHclTerraform(struct!.qualifierName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + qualifier_type: { + value: cdktf.stringToHclTerraform(struct!.qualifierType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tactics_config: { + value: fgsFunctionReservedInstancesTacticsConfigToHclTerraform(struct!.tacticsConfig), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionReservedInstancesTacticsConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionReservedInstancesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionReservedInstances | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._idleMode !== undefined) { + hasAnyValues = true; + internalValueResult.idleMode = this._idleMode; + } + if (this._qualifierName !== undefined) { + hasAnyValues = true; + internalValueResult.qualifierName = this._qualifierName; + } + if (this._qualifierType !== undefined) { + hasAnyValues = true; + internalValueResult.qualifierType = this._qualifierType; + } + if (this._tacticsConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.tacticsConfig = this._tacticsConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionReservedInstances | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._count = undefined; + this._idleMode = undefined; + this._qualifierName = undefined; + this._qualifierType = undefined; + this._tacticsConfig.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._count = value.count; + this._idleMode = value.idleMode; + this._qualifierName = value.qualifierName; + this._qualifierType = value.qualifierType; + this._tacticsConfig.internalValue = value.tacticsConfig; + } + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // idle_mode - computed: false, optional: true, required: false + private _idleMode?: boolean | cdktf.IResolvable; + public get idleMode() { + return this.getBooleanAttribute('idle_mode'); + } + public set idleMode(value: boolean | cdktf.IResolvable) { + this._idleMode = value; + } + public resetIdleMode() { + this._idleMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get idleModeInput() { + return this._idleMode; + } + + // qualifier_name - computed: false, optional: false, required: true + private _qualifierName?: string; + public get qualifierName() { + return this.getStringAttribute('qualifier_name'); + } + public set qualifierName(value: string) { + this._qualifierName = value; + } + // Temporarily expose input value. Use with caution. + public get qualifierNameInput() { + return this._qualifierName; + } + + // qualifier_type - computed: false, optional: false, required: true + private _qualifierType?: string; + public get qualifierType() { + return this.getStringAttribute('qualifier_type'); + } + public set qualifierType(value: string) { + this._qualifierType = value; + } + // Temporarily expose input value. Use with caution. + public get qualifierTypeInput() { + return this._qualifierType; + } + + // tactics_config - computed: false, optional: true, required: false + private _tacticsConfig = new FgsFunctionReservedInstancesTacticsConfigOutputReference(this, "tactics_config"); + public get tacticsConfig() { + return this._tacticsConfig; + } + public putTacticsConfig(value: FgsFunctionReservedInstancesTacticsConfig) { + this._tacticsConfig.internalValue = value; + } + public resetTacticsConfig() { + this._tacticsConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tacticsConfigInput() { + return this._tacticsConfig.internalValue; + } +} + +export class FgsFunctionReservedInstancesList extends cdktf.ComplexList { + public internalValue? : FgsFunctionReservedInstances[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionReservedInstancesOutputReference { + return new FgsFunctionReservedInstancesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface FgsFunctionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#create FgsFunction#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#delete FgsFunction#delete} + */ + readonly delete?: string; +} + +export function fgsFunctionTimeoutsToTerraform(struct?: FgsFunctionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function fgsFunctionTimeoutsToHclTerraform(struct?: FgsFunctionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FgsFunctionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} +export interface FgsFunctionVersionsAliases { + /** + * The description of the version alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#description FgsFunction#description} + */ + readonly description?: string; + /** + * The name of the version alias. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#name FgsFunction#name} + */ + readonly name: string; +} + +export function fgsFunctionVersionsAliasesToTerraform(struct?: FgsFunctionVersionsAliasesOutputReference | FgsFunctionVersionsAliases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function fgsFunctionVersionsAliasesToHclTerraform(struct?: FgsFunctionVersionsAliasesOutputReference | FgsFunctionVersionsAliases): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionVersionsAliasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsFunctionVersionsAliases | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionVersionsAliases | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._name = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._name = value.name; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} +export interface FgsFunctionVersions { + /** + * The version name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#name FgsFunction#name} + */ + readonly name: string; + /** + * aliases block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#aliases FgsFunction#aliases} + */ + readonly aliases?: FgsFunctionVersionsAliases; +} + +export function fgsFunctionVersionsToTerraform(struct?: FgsFunctionVersions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + aliases: fgsFunctionVersionsAliasesToTerraform(struct!.aliases), + } +} + + +export function fgsFunctionVersionsToHclTerraform(struct?: FgsFunctionVersions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aliases: { + value: fgsFunctionVersionsAliasesToHclTerraform(struct!.aliases), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionVersionsAliasesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsFunctionVersionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): FgsFunctionVersions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._aliases?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.aliases = this._aliases?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsFunctionVersions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._aliases.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._aliases.internalValue = value.aliases; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // aliases - computed: false, optional: true, required: false + private _aliases = new FgsFunctionVersionsAliasesOutputReference(this, "aliases"); + public get aliases() { + return this._aliases; + } + public putAliases(value: FgsFunctionVersionsAliases) { + this._aliases.internalValue = value; + } + public resetAliases() { + this._aliases.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasesInput() { + return this._aliases.internalValue; + } +} + +export class FgsFunctionVersionsList extends cdktf.ComplexList { + public internalValue? : FgsFunctionVersions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): FgsFunctionVersionsOutputReference { + return new FgsFunctionVersionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function huaweicloud_fgs_function} +*/ +export class FgsFunction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_function"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsFunction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsFunction to import + * @param importFromId The id of the existing FgsFunction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsFunction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_function", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_function huaweicloud_fgs_function} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsFunctionConfig + */ + public constructor(scope: Construct, id: string, config: FgsFunctionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_function', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._app = config.app; + this._appAgency = config.appAgency; + this._codeFilename = config.codeFilename; + this._codeType = config.codeType; + this._codeUrl = config.codeUrl; + this._concurrencyNum = config.concurrencyNum; + this._dependList = config.dependList; + this._description = config.description; + this._dnsList = config.dnsList; + this._encryptedUserData = config.encryptedUserData; + this._enterpriseProjectId = config.enterpriseProjectId; + this._funcCode = config.funcCode; + this._functiongraphVersion = config.functiongraphVersion; + this._gpuMemory = config.gpuMemory; + this._gpuType = config.gpuType; + this._handler = config.handler; + this._id = config.id; + this._initializerHandler = config.initializerHandler; + this._initializerTimeout = config.initializerTimeout; + this._logGroupId = config.logGroupId; + this._logGroupName = config.logGroupName; + this._logStreamId = config.logStreamId; + this._logStreamName = config.logStreamName; + this._maxInstanceNum = config.maxInstanceNum; + this._memorySize = config.memorySize; + this._mountUserGroupId = config.mountUserGroupId; + this._mountUserId = config.mountUserId; + this._name = config.name; + this._networkId = config.networkId; + this._package = config.package; + this._preStopHandler = config.preStopHandler; + this._preStopTimeout = config.preStopTimeout; + this._region = config.region; + this._runtime = config.runtime; + this._tags = config.tags; + this._timeout = config.timeout; + this._userData = config.userData; + this._vpcId = config.vpcId; + this._xrole = config.xrole; + this._customImage.internalValue = config.customImage; + this._funcMounts.internalValue = config.funcMounts; + this._reservedInstances.internalValue = config.reservedInstances; + this._timeouts.internalValue = config.timeouts; + this._versions.internalValue = config.versions; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: true, required: false + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + public resetAgency() { + this._agency = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // app - computed: false, optional: true, required: false + private _app?: string; + public get app() { + return this.getStringAttribute('app'); + } + public set app(value: string) { + this._app = value; + } + public resetApp() { + this._app = undefined; + } + // Temporarily expose input value. Use with caution. + public get appInput() { + return this._app; + } + + // app_agency - computed: true, optional: true, required: false + private _appAgency?: string; + public get appAgency() { + return this.getStringAttribute('app_agency'); + } + public set appAgency(value: string) { + this._appAgency = value; + } + public resetAppAgency() { + this._appAgency = undefined; + } + // Temporarily expose input value. Use with caution. + public get appAgencyInput() { + return this._appAgency; + } + + // code_filename - computed: true, optional: true, required: false + private _codeFilename?: string; + public get codeFilename() { + return this.getStringAttribute('code_filename'); + } + public set codeFilename(value: string) { + this._codeFilename = value; + } + public resetCodeFilename() { + this._codeFilename = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeFilenameInput() { + return this._codeFilename; + } + + // code_type - computed: true, optional: true, required: false + private _codeType?: string; + public get codeType() { + return this.getStringAttribute('code_type'); + } + public set codeType(value: string) { + this._codeType = value; + } + public resetCodeType() { + this._codeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeTypeInput() { + return this._codeType; + } + + // code_url - computed: false, optional: true, required: false + private _codeUrl?: string; + public get codeUrl() { + return this.getStringAttribute('code_url'); + } + public set codeUrl(value: string) { + this._codeUrl = value; + } + public resetCodeUrl() { + this._codeUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get codeUrlInput() { + return this._codeUrl; + } + + // concurrency_num - computed: true, optional: true, required: false + private _concurrencyNum?: number; + public get concurrencyNum() { + return this.getNumberAttribute('concurrency_num'); + } + public set concurrencyNum(value: number) { + this._concurrencyNum = value; + } + public resetConcurrencyNum() { + this._concurrencyNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get concurrencyNumInput() { + return this._concurrencyNum; + } + + // depend_list - computed: true, optional: true, required: false + private _dependList?: string[]; + public get dependList() { + return cdktf.Fn.tolist(this.getListAttribute('depend_list')); + } + public set dependList(value: string[]) { + this._dependList = value; + } + public resetDependList() { + this._dependList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependListInput() { + return this._dependList; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dns_list - computed: true, optional: true, required: false + private _dnsList?: string; + public get dnsList() { + return this.getStringAttribute('dns_list'); + } + public set dnsList(value: string) { + this._dnsList = value; + } + public resetDnsList() { + this._dnsList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dnsListInput() { + return this._dnsList; + } + + // encrypted_user_data - computed: false, optional: true, required: false + private _encryptedUserData?: string; + public get encryptedUserData() { + return this.getStringAttribute('encrypted_user_data'); + } + public set encryptedUserData(value: string) { + this._encryptedUserData = value; + } + public resetEncryptedUserData() { + this._encryptedUserData = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptedUserDataInput() { + return this._encryptedUserData; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // func_code - computed: false, optional: true, required: false + private _funcCode?: string; + public get funcCode() { + return this.getStringAttribute('func_code'); + } + public set funcCode(value: string) { + this._funcCode = value; + } + public resetFuncCode() { + this._funcCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get funcCodeInput() { + return this._funcCode; + } + + // functiongraph_version - computed: true, optional: true, required: false + private _functiongraphVersion?: string; + public get functiongraphVersion() { + return this.getStringAttribute('functiongraph_version'); + } + public set functiongraphVersion(value: string) { + this._functiongraphVersion = value; + } + public resetFunctiongraphVersion() { + this._functiongraphVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get functiongraphVersionInput() { + return this._functiongraphVersion; + } + + // gpu_memory - computed: false, optional: true, required: false + private _gpuMemory?: number; + public get gpuMemory() { + return this.getNumberAttribute('gpu_memory'); + } + public set gpuMemory(value: number) { + this._gpuMemory = value; + } + public resetGpuMemory() { + this._gpuMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get gpuMemoryInput() { + return this._gpuMemory; + } + + // gpu_type - computed: false, optional: true, required: false + private _gpuType?: string; + public get gpuType() { + return this.getStringAttribute('gpu_type'); + } + public set gpuType(value: string) { + this._gpuType = value; + } + public resetGpuType() { + this._gpuType = undefined; + } + // Temporarily expose input value. Use with caution. + public get gpuTypeInput() { + return this._gpuType; + } + + // handler - computed: true, optional: true, required: false + private _handler?: string; + public get handler() { + return this.getStringAttribute('handler'); + } + public set handler(value: string) { + this._handler = value; + } + public resetHandler() { + this._handler = undefined; + } + // Temporarily expose input value. Use with caution. + public get handlerInput() { + return this._handler; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // initializer_handler - computed: true, optional: true, required: false + private _initializerHandler?: string; + public get initializerHandler() { + return this.getStringAttribute('initializer_handler'); + } + public set initializerHandler(value: string) { + this._initializerHandler = value; + } + public resetInitializerHandler() { + this._initializerHandler = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializerHandlerInput() { + return this._initializerHandler; + } + + // initializer_timeout - computed: true, optional: true, required: false + private _initializerTimeout?: number; + public get initializerTimeout() { + return this.getNumberAttribute('initializer_timeout'); + } + public set initializerTimeout(value: number) { + this._initializerTimeout = value; + } + public resetInitializerTimeout() { + this._initializerTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get initializerTimeoutInput() { + return this._initializerTimeout; + } + + // log_group_id - computed: true, optional: true, required: false + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + public resetLogGroupId() { + this._logGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: true, optional: true, required: false + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + public resetLogGroupName() { + this._logGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_id - computed: true, optional: true, required: false + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + public resetLogStreamId() { + this._logStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: true, optional: true, required: false + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + public resetLogStreamName() { + this._logStreamName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // max_instance_num - computed: true, optional: true, required: false + private _maxInstanceNum?: string; + public get maxInstanceNum() { + return this.getStringAttribute('max_instance_num'); + } + public set maxInstanceNum(value: string) { + this._maxInstanceNum = value; + } + public resetMaxInstanceNum() { + this._maxInstanceNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInstanceNumInput() { + return this._maxInstanceNum; + } + + // memory_size - computed: false, optional: false, required: true + private _memorySize?: number; + public get memorySize() { + return this.getNumberAttribute('memory_size'); + } + public set memorySize(value: number) { + this._memorySize = value; + } + // Temporarily expose input value. Use with caution. + public get memorySizeInput() { + return this._memorySize; + } + + // mount_user_group_id - computed: true, optional: true, required: false + private _mountUserGroupId?: number; + public get mountUserGroupId() { + return this.getNumberAttribute('mount_user_group_id'); + } + public set mountUserGroupId(value: number) { + this._mountUserGroupId = value; + } + public resetMountUserGroupId() { + this._mountUserGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get mountUserGroupIdInput() { + return this._mountUserGroupId; + } + + // mount_user_id - computed: true, optional: true, required: false + private _mountUserId?: number; + public get mountUserId() { + return this.getNumberAttribute('mount_user_id'); + } + public set mountUserId(value: number) { + this._mountUserId = value; + } + public resetMountUserId() { + this._mountUserId = undefined; + } + // Temporarily expose input value. Use with caution. + public get mountUserIdInput() { + return this._mountUserId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // package - computed: false, optional: true, required: false + private _package?: string; + public get package() { + return this.getStringAttribute('package'); + } + public set package(value: string) { + this._package = value; + } + public resetPackage() { + this._package = undefined; + } + // Temporarily expose input value. Use with caution. + public get packageInput() { + return this._package; + } + + // pre_stop_handler - computed: false, optional: true, required: false + private _preStopHandler?: string; + public get preStopHandler() { + return this.getStringAttribute('pre_stop_handler'); + } + public set preStopHandler(value: string) { + this._preStopHandler = value; + } + public resetPreStopHandler() { + this._preStopHandler = undefined; + } + // Temporarily expose input value. Use with caution. + public get preStopHandlerInput() { + return this._preStopHandler; + } + + // pre_stop_timeout - computed: false, optional: true, required: false + private _preStopTimeout?: number; + public get preStopTimeout() { + return this.getNumberAttribute('pre_stop_timeout'); + } + public set preStopTimeout(value: number) { + this._preStopTimeout = value; + } + public resetPreStopTimeout() { + this._preStopTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get preStopTimeoutInput() { + return this._preStopTimeout; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: false, required: true + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: false, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // xrole - computed: false, optional: true, required: false + private _xrole?: string; + public get xrole() { + return this.getStringAttribute('xrole'); + } + public set xrole(value: string) { + this._xrole = value; + } + public resetXrole() { + this._xrole = undefined; + } + // Temporarily expose input value. Use with caution. + public get xroleInput() { + return this._xrole; + } + + // custom_image - computed: false, optional: true, required: false + private _customImage = new FgsFunctionCustomImageOutputReference(this, "custom_image"); + public get customImage() { + return this._customImage; + } + public putCustomImage(value: FgsFunctionCustomImage) { + this._customImage.internalValue = value; + } + public resetCustomImage() { + this._customImage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customImageInput() { + return this._customImage.internalValue; + } + + // func_mounts - computed: false, optional: true, required: false + private _funcMounts = new FgsFunctionFuncMountsList(this, "func_mounts", false); + public get funcMounts() { + return this._funcMounts; + } + public putFuncMounts(value: FgsFunctionFuncMounts[] | cdktf.IResolvable) { + this._funcMounts.internalValue = value; + } + public resetFuncMounts() { + this._funcMounts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get funcMountsInput() { + return this._funcMounts.internalValue; + } + + // reserved_instances - computed: false, optional: true, required: false + private _reservedInstances = new FgsFunctionReservedInstancesList(this, "reserved_instances", true); + public get reservedInstances() { + return this._reservedInstances; + } + public putReservedInstances(value: FgsFunctionReservedInstances[] | cdktf.IResolvable) { + this._reservedInstances.internalValue = value; + } + public resetReservedInstances() { + this._reservedInstances.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get reservedInstancesInput() { + return this._reservedInstances.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FgsFunctionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FgsFunctionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // versions - computed: false, optional: true, required: false + private _versions = new FgsFunctionVersionsList(this, "versions", true); + public get versions() { + return this._versions; + } + public putVersions(value: FgsFunctionVersions[] | cdktf.IResolvable) { + this._versions.internalValue = value; + } + public resetVersions() { + this._versions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionsInput() { + return this._versions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + app: cdktf.stringToTerraform(this._app), + app_agency: cdktf.stringToTerraform(this._appAgency), + code_filename: cdktf.stringToTerraform(this._codeFilename), + code_type: cdktf.stringToTerraform(this._codeType), + code_url: cdktf.stringToTerraform(this._codeUrl), + concurrency_num: cdktf.numberToTerraform(this._concurrencyNum), + depend_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dependList), + description: cdktf.stringToTerraform(this._description), + dns_list: cdktf.stringToTerraform(this._dnsList), + encrypted_user_data: cdktf.stringToTerraform(this._encryptedUserData), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + func_code: cdktf.stringToTerraform(this._funcCode), + functiongraph_version: cdktf.stringToTerraform(this._functiongraphVersion), + gpu_memory: cdktf.numberToTerraform(this._gpuMemory), + gpu_type: cdktf.stringToTerraform(this._gpuType), + handler: cdktf.stringToTerraform(this._handler), + id: cdktf.stringToTerraform(this._id), + initializer_handler: cdktf.stringToTerraform(this._initializerHandler), + initializer_timeout: cdktf.numberToTerraform(this._initializerTimeout), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + max_instance_num: cdktf.stringToTerraform(this._maxInstanceNum), + memory_size: cdktf.numberToTerraform(this._memorySize), + mount_user_group_id: cdktf.numberToTerraform(this._mountUserGroupId), + mount_user_id: cdktf.numberToTerraform(this._mountUserId), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + package: cdktf.stringToTerraform(this._package), + pre_stop_handler: cdktf.stringToTerraform(this._preStopHandler), + pre_stop_timeout: cdktf.numberToTerraform(this._preStopTimeout), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeout: cdktf.numberToTerraform(this._timeout), + user_data: cdktf.stringToTerraform(this._userData), + vpc_id: cdktf.stringToTerraform(this._vpcId), + xrole: cdktf.stringToTerraform(this._xrole), + custom_image: fgsFunctionCustomImageToTerraform(this._customImage.internalValue), + func_mounts: cdktf.listMapper(fgsFunctionFuncMountsToTerraform, true)(this._funcMounts.internalValue), + reserved_instances: cdktf.listMapper(fgsFunctionReservedInstancesToTerraform, true)(this._reservedInstances.internalValue), + timeouts: fgsFunctionTimeoutsToTerraform(this._timeouts.internalValue), + versions: cdktf.listMapper(fgsFunctionVersionsToTerraform, true)(this._versions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app: { + value: cdktf.stringToHclTerraform(this._app), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_agency: { + value: cdktf.stringToHclTerraform(this._appAgency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code_filename: { + value: cdktf.stringToHclTerraform(this._codeFilename), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code_type: { + value: cdktf.stringToHclTerraform(this._codeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + code_url: { + value: cdktf.stringToHclTerraform(this._codeUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + concurrency_num: { + value: cdktf.numberToHclTerraform(this._concurrencyNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + depend_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dependList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dns_list: { + value: cdktf.stringToHclTerraform(this._dnsList), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encrypted_user_data: { + value: cdktf.stringToHclTerraform(this._encryptedUserData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + func_code: { + value: cdktf.stringToHclTerraform(this._funcCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + functiongraph_version: { + value: cdktf.stringToHclTerraform(this._functiongraphVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gpu_memory: { + value: cdktf.numberToHclTerraform(this._gpuMemory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + gpu_type: { + value: cdktf.stringToHclTerraform(this._gpuType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + handler: { + value: cdktf.stringToHclTerraform(this._handler), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initializer_handler: { + value: cdktf.stringToHclTerraform(this._initializerHandler), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initializer_timeout: { + value: cdktf.numberToHclTerraform(this._initializerTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_instance_num: { + value: cdktf.stringToHclTerraform(this._maxInstanceNum), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memory_size: { + value: cdktf.numberToHclTerraform(this._memorySize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mount_user_group_id: { + value: cdktf.numberToHclTerraform(this._mountUserGroupId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mount_user_id: { + value: cdktf.numberToHclTerraform(this._mountUserId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package: { + value: cdktf.stringToHclTerraform(this._package), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pre_stop_handler: { + value: cdktf.stringToHclTerraform(this._preStopHandler), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pre_stop_timeout: { + value: cdktf.numberToHclTerraform(this._preStopTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + xrole: { + value: cdktf.stringToHclTerraform(this._xrole), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_image: { + value: fgsFunctionCustomImageToHclTerraform(this._customImage.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionCustomImageList", + }, + func_mounts: { + value: cdktf.listMapperHcl(fgsFunctionFuncMountsToHclTerraform, true)(this._funcMounts.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsFunctionFuncMountsList", + }, + reserved_instances: { + value: cdktf.listMapperHcl(fgsFunctionReservedInstancesToHclTerraform, true)(this._reservedInstances.internalValue), + isBlock: true, + type: "set", + storageClassType: "FgsFunctionReservedInstancesList", + }, + timeouts: { + value: fgsFunctionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FgsFunctionTimeouts", + }, + versions: { + value: cdktf.listMapperHcl(fgsFunctionVersionsToHclTerraform, true)(this._versions.internalValue), + isBlock: true, + type: "set", + storageClassType: "FgsFunctionVersionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fgs-trigger/README.md b/src/constructs/providers/huaweicloud/fgs-trigger/README.md new file mode 100644 index 00000000..1e35fa85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-trigger/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fgs_trigger` + +Refer to the Terraform Registry for docs: [`huaweicloud_fgs_trigger`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger). diff --git a/src/constructs/providers/huaweicloud/fgs-trigger/index.ts b/src/constructs/providers/huaweicloud/fgs-trigger/index.ts new file mode 100644 index 00000000..5c2d16e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fgs-trigger/index.ts @@ -0,0 +1,1813 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FgsTriggerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#function_urn FgsTrigger#function_urn} + */ + readonly functionUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#id FgsTrigger#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#region FgsTrigger#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#status FgsTrigger#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#type FgsTrigger#type} + */ + readonly type: string; + /** + * apig block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#apig FgsTrigger#apig} + */ + readonly apig?: FgsTriggerApig; + /** + * dis block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#dis FgsTrigger#dis} + */ + readonly dis?: FgsTriggerDis; + /** + * kafka block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#kafka FgsTrigger#kafka} + */ + readonly kafka?: FgsTriggerKafka; + /** + * lts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#lts FgsTrigger#lts} + */ + readonly lts?: FgsTriggerLts; + /** + * obs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#obs FgsTrigger#obs} + */ + readonly obs?: FgsTriggerObs; + /** + * smn block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#smn FgsTrigger#smn} + */ + readonly smn?: FgsTriggerSmn; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#timeouts FgsTrigger#timeouts} + */ + readonly timeouts?: FgsTriggerTimeouts; + /** + * timer block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#timer FgsTrigger#timer} + */ + readonly timer?: FgsTriggerTimer; +} +export interface FgsTriggerApig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#api_name FgsTrigger#api_name} + */ + readonly apiName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#env_name FgsTrigger#env_name} + */ + readonly envName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#group_id FgsTrigger#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#instance_id FgsTrigger#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#request_protocol FgsTrigger#request_protocol} + */ + readonly requestProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#security_authentication FgsTrigger#security_authentication} + */ + readonly securityAuthentication?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#timeout FgsTrigger#timeout} + */ + readonly timeout?: number; +} + +export function fgsTriggerApigToTerraform(struct?: FgsTriggerApigOutputReference | FgsTriggerApig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + api_name: cdktf.stringToTerraform(struct!.apiName), + env_name: cdktf.stringToTerraform(struct!.envName), + group_id: cdktf.stringToTerraform(struct!.groupId), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + request_protocol: cdktf.stringToTerraform(struct!.requestProtocol), + security_authentication: cdktf.stringToTerraform(struct!.securityAuthentication), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function fgsTriggerApigToHclTerraform(struct?: FgsTriggerApigOutputReference | FgsTriggerApig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + api_name: { + value: cdktf.stringToHclTerraform(struct!.apiName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + env_name: { + value: cdktf.stringToHclTerraform(struct!.envName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(struct!.groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_protocol: { + value: cdktf.stringToHclTerraform(struct!.requestProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_authentication: { + value: cdktf.stringToHclTerraform(struct!.securityAuthentication), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerApigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerApig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._apiName !== undefined) { + hasAnyValues = true; + internalValueResult.apiName = this._apiName; + } + if (this._envName !== undefined) { + hasAnyValues = true; + internalValueResult.envName = this._envName; + } + if (this._groupId !== undefined) { + hasAnyValues = true; + internalValueResult.groupId = this._groupId; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._requestProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.requestProtocol = this._requestProtocol; + } + if (this._securityAuthentication !== undefined) { + hasAnyValues = true; + internalValueResult.securityAuthentication = this._securityAuthentication; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerApig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._apiName = undefined; + this._envName = undefined; + this._groupId = undefined; + this._instanceId = undefined; + this._requestProtocol = undefined; + this._securityAuthentication = undefined; + this._timeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._apiName = value.apiName; + this._envName = value.envName; + this._groupId = value.groupId; + this._instanceId = value.instanceId; + this._requestProtocol = value.requestProtocol; + this._securityAuthentication = value.securityAuthentication; + this._timeout = value.timeout; + } + } + + // api_name - computed: false, optional: false, required: true + private _apiName?: string; + public get apiName() { + return this.getStringAttribute('api_name'); + } + public set apiName(value: string) { + this._apiName = value; + } + // Temporarily expose input value. Use with caution. + public get apiNameInput() { + return this._apiName; + } + + // env_name - computed: false, optional: false, required: true + private _envName?: string; + public get envName() { + return this.getStringAttribute('env_name'); + } + public set envName(value: string) { + this._envName = value; + } + // Temporarily expose input value. Use with caution. + public get envNameInput() { + return this._envName; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // request_protocol - computed: false, optional: true, required: false + private _requestProtocol?: string; + public get requestProtocol() { + return this.getStringAttribute('request_protocol'); + } + public set requestProtocol(value: string) { + this._requestProtocol = value; + } + public resetRequestProtocol() { + this._requestProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestProtocolInput() { + return this._requestProtocol; + } + + // security_authentication - computed: false, optional: true, required: false + private _securityAuthentication?: string; + public get securityAuthentication() { + return this.getStringAttribute('security_authentication'); + } + public set securityAuthentication(value: string) { + this._securityAuthentication = value; + } + public resetSecurityAuthentication() { + this._securityAuthentication = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityAuthenticationInput() { + return this._securityAuthentication; + } + + // timeout - computed: false, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} +export interface FgsTriggerDis { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#max_fetch_bytes FgsTrigger#max_fetch_bytes} + */ + readonly maxFetchBytes: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#pull_period FgsTrigger#pull_period} + */ + readonly pullPeriod: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#serial_enable FgsTrigger#serial_enable} + */ + readonly serialEnable: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#starting_position FgsTrigger#starting_position} + */ + readonly startingPosition: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#stream_name FgsTrigger#stream_name} + */ + readonly streamName: string; +} + +export function fgsTriggerDisToTerraform(struct?: FgsTriggerDisOutputReference | FgsTriggerDis): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + max_fetch_bytes: cdktf.numberToTerraform(struct!.maxFetchBytes), + pull_period: cdktf.numberToTerraform(struct!.pullPeriod), + serial_enable: cdktf.booleanToTerraform(struct!.serialEnable), + starting_position: cdktf.stringToTerraform(struct!.startingPosition), + stream_name: cdktf.stringToTerraform(struct!.streamName), + } +} + + +export function fgsTriggerDisToHclTerraform(struct?: FgsTriggerDisOutputReference | FgsTriggerDis): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + max_fetch_bytes: { + value: cdktf.numberToHclTerraform(struct!.maxFetchBytes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + pull_period: { + value: cdktf.numberToHclTerraform(struct!.pullPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + serial_enable: { + value: cdktf.booleanToHclTerraform(struct!.serialEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + starting_position: { + value: cdktf.stringToHclTerraform(struct!.startingPosition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stream_name: { + value: cdktf.stringToHclTerraform(struct!.streamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerDisOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerDis | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._maxFetchBytes !== undefined) { + hasAnyValues = true; + internalValueResult.maxFetchBytes = this._maxFetchBytes; + } + if (this._pullPeriod !== undefined) { + hasAnyValues = true; + internalValueResult.pullPeriod = this._pullPeriod; + } + if (this._serialEnable !== undefined) { + hasAnyValues = true; + internalValueResult.serialEnable = this._serialEnable; + } + if (this._startingPosition !== undefined) { + hasAnyValues = true; + internalValueResult.startingPosition = this._startingPosition; + } + if (this._streamName !== undefined) { + hasAnyValues = true; + internalValueResult.streamName = this._streamName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerDis | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._maxFetchBytes = undefined; + this._pullPeriod = undefined; + this._serialEnable = undefined; + this._startingPosition = undefined; + this._streamName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._maxFetchBytes = value.maxFetchBytes; + this._pullPeriod = value.pullPeriod; + this._serialEnable = value.serialEnable; + this._startingPosition = value.startingPosition; + this._streamName = value.streamName; + } + } + + // max_fetch_bytes - computed: false, optional: false, required: true + private _maxFetchBytes?: number; + public get maxFetchBytes() { + return this.getNumberAttribute('max_fetch_bytes'); + } + public set maxFetchBytes(value: number) { + this._maxFetchBytes = value; + } + // Temporarily expose input value. Use with caution. + public get maxFetchBytesInput() { + return this._maxFetchBytes; + } + + // pull_period - computed: false, optional: false, required: true + private _pullPeriod?: number; + public get pullPeriod() { + return this.getNumberAttribute('pull_period'); + } + public set pullPeriod(value: number) { + this._pullPeriod = value; + } + // Temporarily expose input value. Use with caution. + public get pullPeriodInput() { + return this._pullPeriod; + } + + // serial_enable - computed: false, optional: false, required: true + private _serialEnable?: boolean | cdktf.IResolvable; + public get serialEnable() { + return this.getBooleanAttribute('serial_enable'); + } + public set serialEnable(value: boolean | cdktf.IResolvable) { + this._serialEnable = value; + } + // Temporarily expose input value. Use with caution. + public get serialEnableInput() { + return this._serialEnable; + } + + // starting_position - computed: false, optional: false, required: true + private _startingPosition?: string; + public get startingPosition() { + return this.getStringAttribute('starting_position'); + } + public set startingPosition(value: string) { + this._startingPosition = value; + } + // Temporarily expose input value. Use with caution. + public get startingPositionInput() { + return this._startingPosition; + } + + // stream_name - computed: false, optional: false, required: true + private _streamName?: string; + public get streamName() { + return this.getStringAttribute('stream_name'); + } + public set streamName(value: string) { + this._streamName = value; + } + // Temporarily expose input value. Use with caution. + public get streamNameInput() { + return this._streamName; + } +} +export interface FgsTriggerKafka { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#batch_size FgsTrigger#batch_size} + */ + readonly batchSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#instance_id FgsTrigger#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#password FgsTrigger#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#topic_ids FgsTrigger#topic_ids} + */ + readonly topicIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#user_name FgsTrigger#user_name} + */ + readonly userName?: string; +} + +export function fgsTriggerKafkaToTerraform(struct?: FgsTriggerKafkaOutputReference | FgsTriggerKafka): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + batch_size: cdktf.numberToTerraform(struct!.batchSize), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + password: cdktf.stringToTerraform(struct!.password), + topic_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.topicIds), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function fgsTriggerKafkaToHclTerraform(struct?: FgsTriggerKafkaOutputReference | FgsTriggerKafka): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + batch_size: { + value: cdktf.numberToHclTerraform(struct!.batchSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.topicIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerKafkaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerKafka | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._batchSize !== undefined) { + hasAnyValues = true; + internalValueResult.batchSize = this._batchSize; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._topicIds !== undefined) { + hasAnyValues = true; + internalValueResult.topicIds = this._topicIds; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerKafka | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._batchSize = undefined; + this._instanceId = undefined; + this._password = undefined; + this._topicIds = undefined; + this._userName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._batchSize = value.batchSize; + this._instanceId = value.instanceId; + this._password = value.password; + this._topicIds = value.topicIds; + this._userName = value.userName; + } + } + + // batch_size - computed: false, optional: true, required: false + private _batchSize?: number; + public get batchSize() { + return this.getNumberAttribute('batch_size'); + } + public set batchSize(value: number) { + this._batchSize = value; + } + public resetBatchSize() { + this._batchSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get batchSizeInput() { + return this._batchSize; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // topic_ids - computed: false, optional: false, required: true + private _topicIds?: string[]; + public get topicIds() { + return cdktf.Fn.tolist(this.getListAttribute('topic_ids')); + } + public set topicIds(value: string[]) { + this._topicIds = value; + } + // Temporarily expose input value. Use with caution. + public get topicIdsInput() { + return this._topicIds; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} +export interface FgsTriggerLts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#log_group_id FgsTrigger#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#log_topic_id FgsTrigger#log_topic_id} + */ + readonly logTopicId: string; +} + +export function fgsTriggerLtsToTerraform(struct?: FgsTriggerLtsOutputReference | FgsTriggerLts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + log_group_id: cdktf.stringToTerraform(struct!.logGroupId), + log_topic_id: cdktf.stringToTerraform(struct!.logTopicId), + } +} + + +export function fgsTriggerLtsToHclTerraform(struct?: FgsTriggerLtsOutputReference | FgsTriggerLts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + log_group_id: { + value: cdktf.stringToHclTerraform(struct!.logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_topic_id: { + value: cdktf.stringToHclTerraform(struct!.logTopicId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerLtsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerLts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.logGroupId = this._logGroupId; + } + if (this._logTopicId !== undefined) { + hasAnyValues = true; + internalValueResult.logTopicId = this._logTopicId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerLts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._logGroupId = undefined; + this._logTopicId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._logGroupId = value.logGroupId; + this._logTopicId = value.logTopicId; + } + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_topic_id - computed: false, optional: false, required: true + private _logTopicId?: string; + public get logTopicId() { + return this.getStringAttribute('log_topic_id'); + } + public set logTopicId(value: string) { + this._logTopicId = value; + } + // Temporarily expose input value. Use with caution. + public get logTopicIdInput() { + return this._logTopicId; + } +} +export interface FgsTriggerObs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#bucket_name FgsTrigger#bucket_name} + */ + readonly bucketName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#event_notification_name FgsTrigger#event_notification_name} + */ + readonly eventNotificationName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#events FgsTrigger#events} + */ + readonly events: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#prefix FgsTrigger#prefix} + */ + readonly prefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#suffix FgsTrigger#suffix} + */ + readonly suffix?: string; +} + +export function fgsTriggerObsToTerraform(struct?: FgsTriggerObsOutputReference | FgsTriggerObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket_name: cdktf.stringToTerraform(struct!.bucketName), + event_notification_name: cdktf.stringToTerraform(struct!.eventNotificationName), + events: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.events), + prefix: cdktf.stringToTerraform(struct!.prefix), + suffix: cdktf.stringToTerraform(struct!.suffix), + } +} + + +export function fgsTriggerObsToHclTerraform(struct?: FgsTriggerObsOutputReference | FgsTriggerObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(struct!.bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_notification_name: { + value: cdktf.stringToHclTerraform(struct!.eventNotificationName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + events: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.events), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + prefix: { + value: cdktf.stringToHclTerraform(struct!.prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + suffix: { + value: cdktf.stringToHclTerraform(struct!.suffix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerObsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerObs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucketName !== undefined) { + hasAnyValues = true; + internalValueResult.bucketName = this._bucketName; + } + if (this._eventNotificationName !== undefined) { + hasAnyValues = true; + internalValueResult.eventNotificationName = this._eventNotificationName; + } + if (this._events !== undefined) { + hasAnyValues = true; + internalValueResult.events = this._events; + } + if (this._prefix !== undefined) { + hasAnyValues = true; + internalValueResult.prefix = this._prefix; + } + if (this._suffix !== undefined) { + hasAnyValues = true; + internalValueResult.suffix = this._suffix; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerObs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucketName = undefined; + this._eventNotificationName = undefined; + this._events = undefined; + this._prefix = undefined; + this._suffix = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucketName = value.bucketName; + this._eventNotificationName = value.eventNotificationName; + this._events = value.events; + this._prefix = value.prefix; + this._suffix = value.suffix; + } + } + + // bucket_name - computed: false, optional: false, required: true + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // event_notification_name - computed: false, optional: false, required: true + private _eventNotificationName?: string; + public get eventNotificationName() { + return this.getStringAttribute('event_notification_name'); + } + public set eventNotificationName(value: string) { + this._eventNotificationName = value; + } + // Temporarily expose input value. Use with caution. + public get eventNotificationNameInput() { + return this._eventNotificationName; + } + + // events - computed: false, optional: false, required: true + private _events?: string[]; + public get events() { + return cdktf.Fn.tolist(this.getListAttribute('events')); + } + public set events(value: string[]) { + this._events = value; + } + // Temporarily expose input value. Use with caution. + public get eventsInput() { + return this._events; + } + + // prefix - computed: false, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // suffix - computed: false, optional: true, required: false + private _suffix?: string; + public get suffix() { + return this.getStringAttribute('suffix'); + } + public set suffix(value: string) { + this._suffix = value; + } + public resetSuffix() { + this._suffix = undefined; + } + // Temporarily expose input value. Use with caution. + public get suffixInput() { + return this._suffix; + } +} +export interface FgsTriggerSmn { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#topic_urn FgsTrigger#topic_urn} + */ + readonly topicUrn: string; +} + +export function fgsTriggerSmnToTerraform(struct?: FgsTriggerSmnOutputReference | FgsTriggerSmn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function fgsTriggerSmnToHclTerraform(struct?: FgsTriggerSmnOutputReference | FgsTriggerSmn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerSmnOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerSmn | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerSmn | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._topicUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._topicUrn = value.topicUrn; + } + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} +export interface FgsTriggerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#update FgsTrigger#update} + */ + readonly update?: string; +} + +export function fgsTriggerTimeoutsToTerraform(struct?: FgsTriggerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function fgsTriggerTimeoutsToHclTerraform(struct?: FgsTriggerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FgsTriggerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._update = value.update; + } + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface FgsTriggerTimer { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#additional_information FgsTrigger#additional_information} + */ + readonly additionalInformation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#name FgsTrigger#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#schedule FgsTrigger#schedule} + */ + readonly schedule: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#schedule_type FgsTrigger#schedule_type} + */ + readonly scheduleType: string; +} + +export function fgsTriggerTimerToTerraform(struct?: FgsTriggerTimerOutputReference | FgsTriggerTimer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + additional_information: cdktf.stringToTerraform(struct!.additionalInformation), + name: cdktf.stringToTerraform(struct!.name), + schedule: cdktf.stringToTerraform(struct!.schedule), + schedule_type: cdktf.stringToTerraform(struct!.scheduleType), + } +} + + +export function fgsTriggerTimerToHclTerraform(struct?: FgsTriggerTimerOutputReference | FgsTriggerTimer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + additional_information: { + value: cdktf.stringToHclTerraform(struct!.additionalInformation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule: { + value: cdktf.stringToHclTerraform(struct!.schedule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_type: { + value: cdktf.stringToHclTerraform(struct!.scheduleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FgsTriggerTimerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): FgsTriggerTimer | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._additionalInformation !== undefined) { + hasAnyValues = true; + internalValueResult.additionalInformation = this._additionalInformation; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._schedule !== undefined) { + hasAnyValues = true; + internalValueResult.schedule = this._schedule; + } + if (this._scheduleType !== undefined) { + hasAnyValues = true; + internalValueResult.scheduleType = this._scheduleType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FgsTriggerTimer | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._additionalInformation = undefined; + this._name = undefined; + this._schedule = undefined; + this._scheduleType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._additionalInformation = value.additionalInformation; + this._name = value.name; + this._schedule = value.schedule; + this._scheduleType = value.scheduleType; + } + } + + // additional_information - computed: false, optional: true, required: false + private _additionalInformation?: string; + public get additionalInformation() { + return this.getStringAttribute('additional_information'); + } + public set additionalInformation(value: string) { + this._additionalInformation = value; + } + public resetAdditionalInformation() { + this._additionalInformation = undefined; + } + // Temporarily expose input value. Use with caution. + public get additionalInformationInput() { + return this._additionalInformation; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // schedule - computed: false, optional: false, required: true + private _schedule?: string; + public get schedule() { + return this.getStringAttribute('schedule'); + } + public set schedule(value: string) { + this._schedule = value; + } + // Temporarily expose input value. Use with caution. + public get scheduleInput() { + return this._schedule; + } + + // schedule_type - computed: false, optional: false, required: true + private _scheduleType?: string; + public get scheduleType() { + return this.getStringAttribute('schedule_type'); + } + public set scheduleType(value: string) { + this._scheduleType = value; + } + // Temporarily expose input value. Use with caution. + public get scheduleTypeInput() { + return this._scheduleType; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger huaweicloud_fgs_trigger} +*/ +export class FgsTrigger extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fgs_trigger"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FgsTrigger resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FgsTrigger to import + * @param importFromId The id of the existing FgsTrigger that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FgsTrigger to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fgs_trigger", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fgs_trigger huaweicloud_fgs_trigger} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FgsTriggerConfig + */ + public constructor(scope: Construct, id: string, config: FgsTriggerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fgs_trigger', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._functionUrn = config.functionUrn; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._type = config.type; + this._apig.internalValue = config.apig; + this._dis.internalValue = config.dis; + this._kafka.internalValue = config.kafka; + this._lts.internalValue = config.lts; + this._obs.internalValue = config.obs; + this._smn.internalValue = config.smn; + this._timeouts.internalValue = config.timeouts; + this._timer.internalValue = config.timer; + } + + // ========== + // ATTRIBUTES + // ========== + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // apig - computed: false, optional: true, required: false + private _apig = new FgsTriggerApigOutputReference(this, "apig"); + public get apig() { + return this._apig; + } + public putApig(value: FgsTriggerApig) { + this._apig.internalValue = value; + } + public resetApig() { + this._apig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get apigInput() { + return this._apig.internalValue; + } + + // dis - computed: false, optional: true, required: false + private _dis = new FgsTriggerDisOutputReference(this, "dis"); + public get dis() { + return this._dis; + } + public putDis(value: FgsTriggerDis) { + this._dis.internalValue = value; + } + public resetDis() { + this._dis.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get disInput() { + return this._dis.internalValue; + } + + // kafka - computed: false, optional: true, required: false + private _kafka = new FgsTriggerKafkaOutputReference(this, "kafka"); + public get kafka() { + return this._kafka; + } + public putKafka(value: FgsTriggerKafka) { + this._kafka.internalValue = value; + } + public resetKafka() { + this._kafka.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaInput() { + return this._kafka.internalValue; + } + + // lts - computed: false, optional: true, required: false + private _lts = new FgsTriggerLtsOutputReference(this, "lts"); + public get lts() { + return this._lts; + } + public putLts(value: FgsTriggerLts) { + this._lts.internalValue = value; + } + public resetLts() { + this._lts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsInput() { + return this._lts.internalValue; + } + + // obs - computed: false, optional: true, required: false + private _obs = new FgsTriggerObsOutputReference(this, "obs"); + public get obs() { + return this._obs; + } + public putObs(value: FgsTriggerObs) { + this._obs.internalValue = value; + } + public resetObs() { + this._obs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsInput() { + return this._obs.internalValue; + } + + // smn - computed: false, optional: true, required: false + private _smn = new FgsTriggerSmnOutputReference(this, "smn"); + public get smn() { + return this._smn; + } + public putSmn(value: FgsTriggerSmn) { + this._smn.internalValue = value; + } + public resetSmn() { + this._smn.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnInput() { + return this._smn.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FgsTriggerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FgsTriggerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // timer - computed: false, optional: true, required: false + private _timer = new FgsTriggerTimerOutputReference(this, "timer"); + public get timer() { + return this._timer; + } + public putTimer(value: FgsTriggerTimer) { + this._timer.internalValue = value; + } + public resetTimer() { + this._timer.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timerInput() { + return this._timer.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + apig: fgsTriggerApigToTerraform(this._apig.internalValue), + dis: fgsTriggerDisToTerraform(this._dis.internalValue), + kafka: fgsTriggerKafkaToTerraform(this._kafka.internalValue), + lts: fgsTriggerLtsToTerraform(this._lts.internalValue), + obs: fgsTriggerObsToTerraform(this._obs.internalValue), + smn: fgsTriggerSmnToTerraform(this._smn.internalValue), + timeouts: fgsTriggerTimeoutsToTerraform(this._timeouts.internalValue), + timer: fgsTriggerTimerToTerraform(this._timer.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + apig: { + value: fgsTriggerApigToHclTerraform(this._apig.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerApigList", + }, + dis: { + value: fgsTriggerDisToHclTerraform(this._dis.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerDisList", + }, + kafka: { + value: fgsTriggerKafkaToHclTerraform(this._kafka.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerKafkaList", + }, + lts: { + value: fgsTriggerLtsToHclTerraform(this._lts.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerLtsList", + }, + obs: { + value: fgsTriggerObsToHclTerraform(this._obs.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerObsList", + }, + smn: { + value: fgsTriggerSmnToHclTerraform(this._smn.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerSmnList", + }, + timeouts: { + value: fgsTriggerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FgsTriggerTimeouts", + }, + timer: { + value: fgsTriggerTimerToHclTerraform(this._timer.internalValue), + isBlock: true, + type: "list", + storageClassType: "FgsTriggerTimerList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fw-firewall-group-v2/README.md b/src/constructs/providers/huaweicloud/fw-firewall-group-v2/README.md new file mode 100644 index 00000000..0ed71298 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fw-firewall-group-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fw_firewall_group_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_fw_firewall_group_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2). diff --git a/src/constructs/providers/huaweicloud/fw-firewall-group-v2/index.ts b/src/constructs/providers/huaweicloud/fw-firewall-group-v2/index.ts new file mode 100644 index 00000000..32ac2473 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fw-firewall-group-v2/index.ts @@ -0,0 +1,558 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FwFirewallGroupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#admin_state_up FwFirewallGroupV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#description FwFirewallGroupV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#egress_policy_id FwFirewallGroupV2#egress_policy_id} + */ + readonly egressPolicyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#id FwFirewallGroupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#ingress_policy_id FwFirewallGroupV2#ingress_policy_id} + */ + readonly ingressPolicyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#name FwFirewallGroupV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#ports FwFirewallGroupV2#ports} + */ + readonly ports?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#region FwFirewallGroupV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#tenant_id FwFirewallGroupV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#value_specs FwFirewallGroupV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#timeouts FwFirewallGroupV2#timeouts} + */ + readonly timeouts?: FwFirewallGroupV2Timeouts; +} +export interface FwFirewallGroupV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#create FwFirewallGroupV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#delete FwFirewallGroupV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#update FwFirewallGroupV2#update} + */ + readonly update?: string; +} + +export function fwFirewallGroupV2TimeoutsToTerraform(struct?: FwFirewallGroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function fwFirewallGroupV2TimeoutsToHclTerraform(struct?: FwFirewallGroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FwFirewallGroupV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FwFirewallGroupV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FwFirewallGroupV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2 huaweicloud_fw_firewall_group_v2} +*/ +export class FwFirewallGroupV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fw_firewall_group_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FwFirewallGroupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FwFirewallGroupV2 to import + * @param importFromId The id of the existing FwFirewallGroupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FwFirewallGroupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fw_firewall_group_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_firewall_group_v2 huaweicloud_fw_firewall_group_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FwFirewallGroupV2Config = {} + */ + public constructor(scope: Construct, id: string, config: FwFirewallGroupV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fw_firewall_group_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._egressPolicyId = config.egressPolicyId; + this._id = config.id; + this._ingressPolicyId = config.ingressPolicyId; + this._name = config.name; + this._ports = config.ports; + this._region = config.region; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // egress_policy_id - computed: false, optional: true, required: false + private _egressPolicyId?: string; + public get egressPolicyId() { + return this.getStringAttribute('egress_policy_id'); + } + public set egressPolicyId(value: string) { + this._egressPolicyId = value; + } + public resetEgressPolicyId() { + this._egressPolicyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get egressPolicyIdInput() { + return this._egressPolicyId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ingress_policy_id - computed: false, optional: true, required: false + private _ingressPolicyId?: string; + public get ingressPolicyId() { + return this.getStringAttribute('ingress_policy_id'); + } + public set ingressPolicyId(value: string) { + this._ingressPolicyId = value; + } + public resetIngressPolicyId() { + this._ingressPolicyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ingressPolicyIdInput() { + return this._ingressPolicyId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ports - computed: true, optional: true, required: false + private _ports?: string[]; + public get ports() { + return cdktf.Fn.tolist(this.getListAttribute('ports')); + } + public set ports(value: string[]) { + this._ports = value; + } + public resetPorts() { + this._ports = undefined; + } + // Temporarily expose input value. Use with caution. + public get portsInput() { + return this._ports; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FwFirewallGroupV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FwFirewallGroupV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + egress_policy_id: cdktf.stringToTerraform(this._egressPolicyId), + id: cdktf.stringToTerraform(this._id), + ingress_policy_id: cdktf.stringToTerraform(this._ingressPolicyId), + name: cdktf.stringToTerraform(this._name), + ports: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ports), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: fwFirewallGroupV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + egress_policy_id: { + value: cdktf.stringToHclTerraform(this._egressPolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ingress_policy_id: { + value: cdktf.stringToHclTerraform(this._ingressPolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ports: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ports), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: fwFirewallGroupV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FwFirewallGroupV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fw-policy-v2/README.md b/src/constructs/providers/huaweicloud/fw-policy-v2/README.md new file mode 100644 index 00000000..01bacf49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fw-policy-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fw_policy_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_fw_policy_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2). diff --git a/src/constructs/providers/huaweicloud/fw-policy-v2/index.ts b/src/constructs/providers/huaweicloud/fw-policy-v2/index.ts new file mode 100644 index 00000000..7b447c51 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fw-policy-v2/index.ts @@ -0,0 +1,464 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FwPolicyV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#audited FwPolicyV2#audited} + */ + readonly audited?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#description FwPolicyV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#id FwPolicyV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#name FwPolicyV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#region FwPolicyV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#rules FwPolicyV2#rules} + */ + readonly rules?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#shared FwPolicyV2#shared} + */ + readonly shared?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#tenant_id FwPolicyV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#value_specs FwPolicyV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#timeouts FwPolicyV2#timeouts} + */ + readonly timeouts?: FwPolicyV2Timeouts; +} +export interface FwPolicyV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#create FwPolicyV2#create} + */ + readonly create?: string; +} + +export function fwPolicyV2TimeoutsToTerraform(struct?: FwPolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function fwPolicyV2TimeoutsToHclTerraform(struct?: FwPolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class FwPolicyV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): FwPolicyV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: FwPolicyV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2 huaweicloud_fw_policy_v2} +*/ +export class FwPolicyV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fw_policy_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FwPolicyV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FwPolicyV2 to import + * @param importFromId The id of the existing FwPolicyV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FwPolicyV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fw_policy_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_policy_v2 huaweicloud_fw_policy_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FwPolicyV2Config = {} + */ + public constructor(scope: Construct, id: string, config: FwPolicyV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fw_policy_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._audited = config.audited; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._rules = config.rules; + this._shared = config.shared; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // audited - computed: false, optional: true, required: false + private _audited?: boolean | cdktf.IResolvable; + public get audited() { + return this.getBooleanAttribute('audited'); + } + public set audited(value: boolean | cdktf.IResolvable) { + this._audited = value; + } + public resetAudited() { + this._audited = undefined; + } + // Temporarily expose input value. Use with caution. + public get auditedInput() { + return this._audited; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: false, optional: true, required: false + private _rules?: string[]; + public get rules() { + return this.getListAttribute('rules'); + } + public set rules(value: string[]) { + this._rules = value; + } + public resetRules() { + this._rules = undefined; + } + // Temporarily expose input value. Use with caution. + public get rulesInput() { + return this._rules; + } + + // shared - computed: false, optional: true, required: false + private _shared?: boolean | cdktf.IResolvable; + public get shared() { + return this.getBooleanAttribute('shared'); + } + public set shared(value: boolean | cdktf.IResolvable) { + this._shared = value; + } + public resetShared() { + this._shared = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharedInput() { + return this._shared; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new FwPolicyV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: FwPolicyV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + audited: cdktf.booleanToTerraform(this._audited), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rules: cdktf.listMapper(cdktf.stringToTerraform, false)(this._rules), + shared: cdktf.booleanToTerraform(this._shared), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: fwPolicyV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + audited: { + value: cdktf.booleanToHclTerraform(this._audited), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rules: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._rules), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + shared: { + value: cdktf.booleanToHclTerraform(this._shared), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: fwPolicyV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "FwPolicyV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/fw-rule-v2/README.md b/src/constructs/providers/huaweicloud/fw-rule-v2/README.md new file mode 100644 index 00000000..c6a82646 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fw-rule-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_fw_rule_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_fw_rule_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2). diff --git a/src/constructs/providers/huaweicloud/fw-rule-v2/index.ts b/src/constructs/providers/huaweicloud/fw-rule-v2/index.ts new file mode 100644 index 00000000..c6ff0203 --- /dev/null +++ b/src/constructs/providers/huaweicloud/fw-rule-v2/index.ts @@ -0,0 +1,474 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface FwRuleV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#action FwRuleV2#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#description FwRuleV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#destination_ip_address FwRuleV2#destination_ip_address} + */ + readonly destinationIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#destination_port FwRuleV2#destination_port} + */ + readonly destinationPort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#enabled FwRuleV2#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#id FwRuleV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#ip_version FwRuleV2#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#name FwRuleV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#protocol FwRuleV2#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#region FwRuleV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#source_ip_address FwRuleV2#source_ip_address} + */ + readonly sourceIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#source_port FwRuleV2#source_port} + */ + readonly sourcePort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#tenant_id FwRuleV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#value_specs FwRuleV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2 huaweicloud_fw_rule_v2} +*/ +export class FwRuleV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_fw_rule_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a FwRuleV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the FwRuleV2 to import + * @param importFromId The id of the existing FwRuleV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the FwRuleV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_fw_rule_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/fw_rule_v2 huaweicloud_fw_rule_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options FwRuleV2Config + */ + public constructor(scope: Construct, id: string, config: FwRuleV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_fw_rule_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._destinationIpAddress = config.destinationIpAddress; + this._destinationPort = config.destinationPort; + this._enabled = config.enabled; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + this._sourceIpAddress = config.sourceIpAddress; + this._sourcePort = config.sourcePort; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_ip_address - computed: false, optional: true, required: false + private _destinationIpAddress?: string; + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + public set destinationIpAddress(value: string) { + this._destinationIpAddress = value; + } + public resetDestinationIpAddress() { + this._destinationIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressInput() { + return this._destinationIpAddress; + } + + // destination_port - computed: false, optional: true, required: false + private _destinationPort?: string; + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + public set destinationPort(value: string) { + this._destinationPort = value; + } + public resetDestinationPort() { + this._destinationPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortInput() { + return this._destinationPort; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_ip_address - computed: false, optional: true, required: false + private _sourceIpAddress?: string; + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + public set sourceIpAddress(value: string) { + this._sourceIpAddress = value; + } + public resetSourceIpAddress() { + this._sourceIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressInput() { + return this._sourceIpAddress; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // tenant_id - computed: false, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + destination_ip_address: cdktf.stringToTerraform(this._destinationIpAddress), + destination_port: cdktf.stringToTerraform(this._destinationPort), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + source_ip_address: cdktf.stringToTerraform(this._sourceIpAddress), + source_port: cdktf.stringToTerraform(this._sourcePort), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address: { + value: cdktf.stringToHclTerraform(this._destinationIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port: { + value: cdktf.stringToHclTerraform(this._destinationPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address: { + value: cdktf.stringToHclTerraform(this._sourceIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(this._sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ga-accelerator/README.md b/src/constructs/providers/huaweicloud/ga-accelerator/README.md new file mode 100644 index 00000000..9abe0c44 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-accelerator/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ga_accelerator` + +Refer to the Terraform Registry for docs: [`huaweicloud_ga_accelerator`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator). diff --git a/src/constructs/providers/huaweicloud/ga-accelerator/index.ts b/src/constructs/providers/huaweicloud/ga-accelerator/index.ts new file mode 100644 index 00000000..9fd2ae9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-accelerator/index.ts @@ -0,0 +1,688 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaAcceleratorConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description about the global accelerator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#description GaAccelerator#description} + */ + readonly description?: string; + /** + * |- + * Specifies the enterprise project ID of the tenant. The value is **0** or a string that + * contains a maximum of 36 characters in UUID format with hyphens (-). **0** indicates the + * default enterprise project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#enterprise_project_id GaAccelerator#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#id GaAccelerator#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the global accelerator name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#name GaAccelerator#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#tags GaAccelerator#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * ip_sets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#ip_sets GaAccelerator#ip_sets} + */ + readonly ipSets: GaAcceleratorIpSets; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#timeouts GaAccelerator#timeouts} + */ + readonly timeouts?: GaAcceleratorTimeouts; +} +export interface GaAcceleratorFrozenInfo { +} + +export function gaAcceleratorFrozenInfoToTerraform(struct?: GaAcceleratorFrozenInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaAcceleratorFrozenInfoToHclTerraform(struct?: GaAcceleratorFrozenInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaAcceleratorFrozenInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaAcceleratorFrozenInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaAcceleratorFrozenInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // effect - computed: true, optional: false, required: false + public get effect() { + return this.getNumberAttribute('effect'); + } + + // scene - computed: true, optional: false, required: false + public get scene() { + return this.getListAttribute('scene'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } +} + +export class GaAcceleratorFrozenInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaAcceleratorFrozenInfoOutputReference { + return new GaAcceleratorFrozenInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaAcceleratorIpSets { + /** + * |- + * Specifies the acceleration area. The value can be one of the following: + * - **OUTOFCM**: Outside the Chinese mainland + * - **CM**: Chinese mainland + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#area GaAccelerator#area} + */ + readonly area: string; + /** + * Specifies the IP address version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#ip_type GaAccelerator#ip_type} + */ + readonly ipType?: string; +} + +export function gaAcceleratorIpSetsToTerraform(struct?: GaAcceleratorIpSetsOutputReference | GaAcceleratorIpSets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + area: cdktf.stringToTerraform(struct!.area), + ip_type: cdktf.stringToTerraform(struct!.ipType), + } +} + + +export function gaAcceleratorIpSetsToHclTerraform(struct?: GaAcceleratorIpSetsOutputReference | GaAcceleratorIpSets): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + area: { + value: cdktf.stringToHclTerraform(struct!.area), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_type: { + value: cdktf.stringToHclTerraform(struct!.ipType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaAcceleratorIpSetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaAcceleratorIpSets | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._area !== undefined) { + hasAnyValues = true; + internalValueResult.area = this._area; + } + if (this._ipType !== undefined) { + hasAnyValues = true; + internalValueResult.ipType = this._ipType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaAcceleratorIpSets | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._area = undefined; + this._ipType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._area = value.area; + this._ipType = value.ipType; + } + } + + // area - computed: false, optional: false, required: true + private _area?: string; + public get area() { + return this.getStringAttribute('area'); + } + public set area(value: string) { + this._area = value; + } + // Temporarily expose input value. Use with caution. + public get areaInput() { + return this._area; + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_type - computed: false, optional: true, required: false + private _ipType?: string; + public get ipType() { + return this.getStringAttribute('ip_type'); + } + public set ipType(value: string) { + this._ipType = value; + } + public resetIpType() { + this._ipType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipTypeInput() { + return this._ipType; + } +} +export interface GaAcceleratorTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#create GaAccelerator#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#delete GaAccelerator#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#update GaAccelerator#update} + */ + readonly update?: string; +} + +export function gaAcceleratorTimeoutsToTerraform(struct?: GaAcceleratorTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaAcceleratorTimeoutsToHclTerraform(struct?: GaAcceleratorTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaAcceleratorTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaAcceleratorTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaAcceleratorTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator huaweicloud_ga_accelerator} +*/ +export class GaAccelerator extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_accelerator"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaAccelerator resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaAccelerator to import + * @param importFromId The id of the existing GaAccelerator that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaAccelerator to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_accelerator", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_accelerator huaweicloud_ga_accelerator} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaAcceleratorConfig + */ + public constructor(scope: Construct, id: string, config: GaAcceleratorConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_accelerator', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._tags = config.tags; + this._ipSets.internalValue = config.ipSets; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: true, optional: false, required: false + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + + // frozen_info - computed: true, optional: false, required: false + private _frozenInfo = new GaAcceleratorFrozenInfoList(this, "frozen_info", false); + public get frozenInfo() { + return this._frozenInfo; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ip_sets - computed: false, optional: false, required: true + private _ipSets = new GaAcceleratorIpSetsOutputReference(this, "ip_sets"); + public get ipSets() { + return this._ipSets; + } + public putIpSets(value: GaAcceleratorIpSets) { + this._ipSets.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get ipSetsInput() { + return this._ipSets.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaAcceleratorTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaAcceleratorTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ip_sets: gaAcceleratorIpSetsToTerraform(this._ipSets.internalValue), + timeouts: gaAcceleratorTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ip_sets: { + value: gaAcceleratorIpSetsToHclTerraform(this._ipSets.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaAcceleratorIpSetsList", + }, + timeouts: { + value: gaAcceleratorTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaAcceleratorTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ga-address-group/README.md b/src/constructs/providers/huaweicloud/ga-address-group/README.md new file mode 100644 index 00000000..7e5457d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-address-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ga_address_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_ga_address_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group). diff --git a/src/constructs/providers/huaweicloud/ga-address-group/index.ts b/src/constructs/providers/huaweicloud/ga-address-group/index.ts new file mode 100644 index 00000000..3a606e89 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-address-group/index.ts @@ -0,0 +1,731 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaAddressGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#description GaAddressGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#id GaAddressGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#name GaAddressGroup#name} + */ + readonly name: string; + /** + * ip_addresses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#ip_addresses GaAddressGroup#ip_addresses} + */ + readonly ipAddresses?: GaAddressGroupIpAddresses[] | cdktf.IResolvable; + /** + * listeners block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#listeners GaAddressGroup#listeners} + */ + readonly listeners?: GaAddressGroupListeners[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#timeouts GaAddressGroup#timeouts} + */ + readonly timeouts?: GaAddressGroupTimeouts; +} +export interface GaAddressGroupIpAddresses { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#cidr GaAddressGroup#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#description GaAddressGroup#description} + */ + readonly description?: string; +} + +export function gaAddressGroupIpAddressesToTerraform(struct?: GaAddressGroupIpAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cidr: cdktf.stringToTerraform(struct!.cidr), + description: cdktf.stringToTerraform(struct!.description), + } +} + + +export function gaAddressGroupIpAddressesToHclTerraform(struct?: GaAddressGroupIpAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(struct!.cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaAddressGroupIpAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaAddressGroupIpAddresses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cidr !== undefined) { + hasAnyValues = true; + internalValueResult.cidr = this._cidr; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaAddressGroupIpAddresses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cidr = undefined; + this._description = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cidr = value.cidr; + this._description = value.description; + } + } + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } +} + +export class GaAddressGroupIpAddressesList extends cdktf.ComplexList { + public internalValue? : GaAddressGroupIpAddresses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaAddressGroupIpAddressesOutputReference { + return new GaAddressGroupIpAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaAddressGroupListeners { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#id GaAddressGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#type GaAddressGroup#type} + */ + readonly type: string; +} + +export function gaAddressGroupListenersToTerraform(struct?: GaAddressGroupListeners | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function gaAddressGroupListenersToHclTerraform(struct?: GaAddressGroupListeners | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaAddressGroupListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaAddressGroupListeners | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaAddressGroupListeners | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class GaAddressGroupListenersList extends cdktf.ComplexList { + public internalValue? : GaAddressGroupListeners[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaAddressGroupListenersOutputReference { + return new GaAddressGroupListenersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaAddressGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#create GaAddressGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#delete GaAddressGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#update GaAddressGroup#update} + */ + readonly update?: string; +} + +export function gaAddressGroupTimeoutsToTerraform(struct?: GaAddressGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaAddressGroupTimeoutsToHclTerraform(struct?: GaAddressGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaAddressGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaAddressGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaAddressGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group huaweicloud_ga_address_group} +*/ +export class GaAddressGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_address_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaAddressGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaAddressGroup to import + * @param importFromId The id of the existing GaAddressGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaAddressGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_address_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_address_group huaweicloud_ga_address_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaAddressGroupConfig + */ + public constructor(scope: Construct, id: string, config: GaAddressGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_address_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._ipAddresses.internalValue = config.ipAddresses; + this._listeners.internalValue = config.listeners; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ip_addresses - computed: false, optional: true, required: false + private _ipAddresses = new GaAddressGroupIpAddressesList(this, "ip_addresses", true); + public get ipAddresses() { + return this._ipAddresses; + } + public putIpAddresses(value: GaAddressGroupIpAddresses[] | cdktf.IResolvable) { + this._ipAddresses.internalValue = value; + } + public resetIpAddresses() { + this._ipAddresses.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressesInput() { + return this._ipAddresses.internalValue; + } + + // listeners - computed: false, optional: true, required: false + private _listeners = new GaAddressGroupListenersList(this, "listeners", true); + public get listeners() { + return this._listeners; + } + public putListeners(value: GaAddressGroupListeners[] | cdktf.IResolvable) { + this._listeners.internalValue = value; + } + public resetListeners() { + this._listeners.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenersInput() { + return this._listeners.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaAddressGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaAddressGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + ip_addresses: cdktf.listMapper(gaAddressGroupIpAddressesToTerraform, true)(this._ipAddresses.internalValue), + listeners: cdktf.listMapper(gaAddressGroupListenersToTerraform, true)(this._listeners.internalValue), + timeouts: gaAddressGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_addresses: { + value: cdktf.listMapperHcl(gaAddressGroupIpAddressesToHclTerraform, true)(this._ipAddresses.internalValue), + isBlock: true, + type: "set", + storageClassType: "GaAddressGroupIpAddressesList", + }, + listeners: { + value: cdktf.listMapperHcl(gaAddressGroupListenersToHclTerraform, true)(this._listeners.internalValue), + isBlock: true, + type: "set", + storageClassType: "GaAddressGroupListenersList", + }, + timeouts: { + value: gaAddressGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaAddressGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ga-endpoint-group/README.md b/src/constructs/providers/huaweicloud/ga-endpoint-group/README.md new file mode 100644 index 00000000..316d7035 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-endpoint-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ga_endpoint_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_ga_endpoint_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group). diff --git a/src/constructs/providers/huaweicloud/ga-endpoint-group/index.ts b/src/constructs/providers/huaweicloud/ga-endpoint-group/index.ts new file mode 100644 index 00000000..2ee7cacd --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-endpoint-group/index.ts @@ -0,0 +1,548 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaEndpointGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the information about the endpoint group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#description GaEndpointGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#id GaEndpointGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the endpoint group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#name GaEndpointGroup#name} + */ + readonly name: string; + /** + * Specifies the region where the endpoint group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#region_id GaEndpointGroup#region_id} + */ + readonly regionId: string; + /** + * Specifies the percentage of traffic distributed to the endpoint group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#traffic_dial_percentage GaEndpointGroup#traffic_dial_percentage} + */ + readonly trafficDialPercentage?: number; + /** + * listeners block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#listeners GaEndpointGroup#listeners} + */ + readonly listeners: GaEndpointGroupListeners; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#timeouts GaEndpointGroup#timeouts} + */ + readonly timeouts?: GaEndpointGroupTimeouts; +} +export interface GaEndpointGroupListeners { + /** + * Specifies the ID of the associated listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#id GaEndpointGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function gaEndpointGroupListenersToTerraform(struct?: GaEndpointGroupListenersOutputReference | GaEndpointGroupListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function gaEndpointGroupListenersToHclTerraform(struct?: GaEndpointGroupListenersOutputReference | GaEndpointGroupListeners): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaEndpointGroupListenersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaEndpointGroupListeners | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaEndpointGroupListeners | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._id = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._id = value.id; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } +} +export interface GaEndpointGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#create GaEndpointGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#delete GaEndpointGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#update GaEndpointGroup#update} + */ + readonly update?: string; +} + +export function gaEndpointGroupTimeoutsToTerraform(struct?: GaEndpointGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaEndpointGroupTimeoutsToHclTerraform(struct?: GaEndpointGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaEndpointGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaEndpointGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaEndpointGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group huaweicloud_ga_endpoint_group} +*/ +export class GaEndpointGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_endpoint_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaEndpointGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaEndpointGroup to import + * @param importFromId The id of the existing GaEndpointGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaEndpointGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_endpoint_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint_group huaweicloud_ga_endpoint_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaEndpointGroupConfig + */ + public constructor(scope: Construct, id: string, config: GaEndpointGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_endpoint_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._regionId = config.regionId; + this._trafficDialPercentage = config.trafficDialPercentage; + this._listeners.internalValue = config.listeners; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region_id - computed: false, optional: false, required: true + private _regionId?: string; + public get regionId() { + return this.getStringAttribute('region_id'); + } + public set regionId(value: string) { + this._regionId = value; + } + // Temporarily expose input value. Use with caution. + public get regionIdInput() { + return this._regionId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_dial_percentage - computed: true, optional: true, required: false + private _trafficDialPercentage?: number; + public get trafficDialPercentage() { + return this.getNumberAttribute('traffic_dial_percentage'); + } + public set trafficDialPercentage(value: number) { + this._trafficDialPercentage = value; + } + public resetTrafficDialPercentage() { + this._trafficDialPercentage = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficDialPercentageInput() { + return this._trafficDialPercentage; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // listeners - computed: false, optional: false, required: true + private _listeners = new GaEndpointGroupListenersOutputReference(this, "listeners"); + public get listeners() { + return this._listeners; + } + public putListeners(value: GaEndpointGroupListeners) { + this._listeners.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get listenersInput() { + return this._listeners.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaEndpointGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaEndpointGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region_id: cdktf.stringToTerraform(this._regionId), + traffic_dial_percentage: cdktf.numberToTerraform(this._trafficDialPercentage), + listeners: gaEndpointGroupListenersToTerraform(this._listeners.internalValue), + timeouts: gaEndpointGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region_id: { + value: cdktf.stringToHclTerraform(this._regionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_dial_percentage: { + value: cdktf.numberToHclTerraform(this._trafficDialPercentage), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + listeners: { + value: gaEndpointGroupListenersToHclTerraform(this._listeners.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaEndpointGroupListenersList", + }, + timeouts: { + value: gaEndpointGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaEndpointGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ga-endpoint/README.md b/src/constructs/providers/huaweicloud/ga-endpoint/README.md new file mode 100644 index 00000000..57c349b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-endpoint/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ga_endpoint` + +Refer to the Terraform Registry for docs: [`huaweicloud_ga_endpoint`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint). diff --git a/src/constructs/providers/huaweicloud/ga-endpoint/index.ts b/src/constructs/providers/huaweicloud/ga-endpoint/index.ts new file mode 100644 index 00000000..9424d8bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-endpoint/index.ts @@ -0,0 +1,467 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaEndpointConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the endpoint group to which the endpoint belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#endpoint_group_id GaEndpoint#endpoint_group_id} + */ + readonly endpointGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#id GaEndpoint#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP address of the endpoint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#ip_address GaEndpoint#ip_address} + */ + readonly ipAddress: string; + /** + * Specifies the endpoint ID, for example, EIP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#resource_id GaEndpoint#resource_id} + */ + readonly resourceId: string; + /** + * Specifies the endpoint type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#resource_type GaEndpoint#resource_type} + */ + readonly resourceType?: string; + /** + * Specifies the weight of the endpoint based on which the listener distributes traffic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#weight GaEndpoint#weight} + */ + readonly weight?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#timeouts GaEndpoint#timeouts} + */ + readonly timeouts?: GaEndpointTimeouts; +} +export interface GaEndpointTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#create GaEndpoint#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#delete GaEndpoint#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#update GaEndpoint#update} + */ + readonly update?: string; +} + +export function gaEndpointTimeoutsToTerraform(struct?: GaEndpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaEndpointTimeoutsToHclTerraform(struct?: GaEndpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaEndpointTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaEndpointTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaEndpointTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint huaweicloud_ga_endpoint} +*/ +export class GaEndpoint extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_endpoint"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaEndpoint resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaEndpoint to import + * @param importFromId The id of the existing GaEndpoint that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaEndpoint to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_endpoint", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_endpoint huaweicloud_ga_endpoint} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaEndpointConfig + */ + public constructor(scope: Construct, id: string, config: GaEndpointConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_endpoint', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpointGroupId = config.endpointGroupId; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._weight = config.weight; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // endpoint_group_id - computed: false, optional: false, required: true + private _endpointGroupId?: string; + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + public set endpointGroupId(value: string) { + this._endpointGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get endpointGroupIdInput() { + return this._endpointGroupId; + } + + // health_state - computed: true, optional: false, required: false + public get healthState() { + return this.getStringAttribute('health_state'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaEndpointTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaEndpointTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint_group_id: cdktf.stringToTerraform(this._endpointGroupId), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + weight: cdktf.numberToTerraform(this._weight), + timeouts: gaEndpointTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint_group_id: { + value: cdktf.stringToHclTerraform(this._endpointGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(this._weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: gaEndpointTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaEndpointTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ga-health-check/README.md b/src/constructs/providers/huaweicloud/ga-health-check/README.md new file mode 100644 index 00000000..a23d4fc3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-health-check/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ga_health_check` + +Refer to the Terraform Registry for docs: [`huaweicloud_ga_health_check`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check). diff --git a/src/constructs/providers/huaweicloud/ga-health-check/index.ts b/src/constructs/providers/huaweicloud/ga-health-check/index.ts new file mode 100644 index 00000000..fe9d9de2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-health-check/index.ts @@ -0,0 +1,541 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaHealthCheckConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to enable health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#enabled GaHealthCheck#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Specifies the endpoint group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#endpoint_group_id GaHealthCheck#endpoint_group_id} + */ + readonly endpointGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#id GaHealthCheck#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the health check interval, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#interval GaHealthCheck#interval} + */ + readonly interval: number; + /** + * Specifies the maximum number of retries. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#max_retries GaHealthCheck#max_retries} + */ + readonly maxRetries: number; + /** + * Specifies the port used for the health check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#port GaHealthCheck#port} + */ + readonly port: number; + /** + * Specifies the health check protocol. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#protocol GaHealthCheck#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#region GaHealthCheck#region} + */ + readonly region?: string; + /** + * Specifies the timeout duration of the health check, in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#timeout GaHealthCheck#timeout} + */ + readonly timeout: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#timeouts GaHealthCheck#timeouts} + */ + readonly timeouts?: GaHealthCheckTimeouts; +} +export interface GaHealthCheckTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#create GaHealthCheck#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#delete GaHealthCheck#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#update GaHealthCheck#update} + */ + readonly update?: string; +} + +export function gaHealthCheckTimeoutsToTerraform(struct?: GaHealthCheckTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaHealthCheckTimeoutsToHclTerraform(struct?: GaHealthCheckTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaHealthCheckTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaHealthCheckTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaHealthCheckTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check huaweicloud_ga_health_check} +*/ +export class GaHealthCheck extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_health_check"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaHealthCheck resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaHealthCheck to import + * @param importFromId The id of the existing GaHealthCheck that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaHealthCheck to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_health_check", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_health_check huaweicloud_ga_health_check} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaHealthCheckConfig + */ + public constructor(scope: Construct, id: string, config: GaHealthCheckConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_health_check', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._endpointGroupId = config.endpointGroupId; + this._id = config.id; + this._interval = config.interval; + this._maxRetries = config.maxRetries; + this._port = config.port; + this._protocol = config.protocol; + this._region = config.region; + this._timeout = config.timeout; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // endpoint_group_id - computed: false, optional: false, required: true + private _endpointGroupId?: string; + public get endpointGroupId() { + return this.getStringAttribute('endpoint_group_id'); + } + public set endpointGroupId(value: string) { + this._endpointGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get endpointGroupIdInput() { + return this._endpointGroupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // interval - computed: false, optional: false, required: true + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // max_retries - computed: false, optional: false, required: true + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaHealthCheckTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaHealthCheckTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.booleanToTerraform(this._enabled), + endpoint_group_id: cdktf.stringToTerraform(this._endpointGroupId), + id: cdktf.stringToTerraform(this._id), + interval: cdktf.numberToTerraform(this._interval), + max_retries: cdktf.numberToTerraform(this._maxRetries), + port: cdktf.numberToTerraform(this._port), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + timeout: cdktf.numberToTerraform(this._timeout), + timeouts: gaHealthCheckTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + endpoint_group_id: { + value: cdktf.stringToHclTerraform(this._endpointGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(this._interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: gaHealthCheckTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaHealthCheckTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ga-listener/README.md b/src/constructs/providers/huaweicloud/ga-listener/README.md new file mode 100644 index 00000000..d3a14258 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-listener/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ga_listener` + +Refer to the Terraform Registry for docs: [`huaweicloud_ga_listener`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener). diff --git a/src/constructs/providers/huaweicloud/ga-listener/index.ts b/src/constructs/providers/huaweicloud/ga-listener/index.ts new file mode 100644 index 00000000..6cdd1a24 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ga-listener/index.ts @@ -0,0 +1,671 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaListenerConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the global accelerator associated with the listener. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#accelerator_id GaListener#accelerator_id} + */ + readonly acceleratorId: string; + /** + * |- + * Specifies the client affinity. The value can be one of the following: + * - **Source IP address**: Requests from the same IP address are forwarded to the same endpoint. + * - **NONE**: Requests are evenly forwarded across the endpoints. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#client_affinity GaListener#client_affinity} + */ + readonly clientAffinity?: string; + /** + * |- + * Specifies the information about the listener. The value can contain 0 to 255 characters. + * The following characters are not allowed: <> + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#description GaListener#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#id GaListener#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * |- + * Specifies the listener name. The name can contain 1 to 64 characters. + * Only letters, digits, and hyphens (-) are allowed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#name GaListener#name} + */ + readonly name: string; + /** + * Specifies the protocol used by the listener to forward requests. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#protocol GaListener#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#tags GaListener#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * port_ranges block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#port_ranges GaListener#port_ranges} + */ + readonly portRanges: GaListenerPortRanges[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#timeouts GaListener#timeouts} + */ + readonly timeouts?: GaListenerTimeouts; +} +export interface GaListenerPortRanges { + /** + * Specifies the start port number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#from_port GaListener#from_port} + */ + readonly fromPort: number; + /** + * Specifies the end port number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#to_port GaListener#to_port} + */ + readonly toPort: number; +} + +export function gaListenerPortRangesToTerraform(struct?: GaListenerPortRanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + from_port: cdktf.numberToTerraform(struct!.fromPort), + to_port: cdktf.numberToTerraform(struct!.toPort), + } +} + + +export function gaListenerPortRangesToHclTerraform(struct?: GaListenerPortRanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + from_port: { + value: cdktf.numberToHclTerraform(struct!.fromPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + to_port: { + value: cdktf.numberToHclTerraform(struct!.toPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaListenerPortRangesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaListenerPortRanges | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fromPort !== undefined) { + hasAnyValues = true; + internalValueResult.fromPort = this._fromPort; + } + if (this._toPort !== undefined) { + hasAnyValues = true; + internalValueResult.toPort = this._toPort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaListenerPortRanges | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fromPort = undefined; + this._toPort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fromPort = value.fromPort; + this._toPort = value.toPort; + } + } + + // from_port - computed: false, optional: false, required: true + private _fromPort?: number; + public get fromPort() { + return this.getNumberAttribute('from_port'); + } + public set fromPort(value: number) { + this._fromPort = value; + } + // Temporarily expose input value. Use with caution. + public get fromPortInput() { + return this._fromPort; + } + + // to_port - computed: false, optional: false, required: true + private _toPort?: number; + public get toPort() { + return this.getNumberAttribute('to_port'); + } + public set toPort(value: number) { + this._toPort = value; + } + // Temporarily expose input value. Use with caution. + public get toPortInput() { + return this._toPort; + } +} + +export class GaListenerPortRangesList extends cdktf.ComplexList { + public internalValue? : GaListenerPortRanges[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaListenerPortRangesOutputReference { + return new GaListenerPortRangesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaListenerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#create GaListener#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#delete GaListener#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#update GaListener#update} + */ + readonly update?: string; +} + +export function gaListenerTimeoutsToTerraform(struct?: GaListenerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaListenerTimeoutsToHclTerraform(struct?: GaListenerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaListenerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaListenerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaListenerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener huaweicloud_ga_listener} +*/ +export class GaListener extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ga_listener"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaListener resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaListener to import + * @param importFromId The id of the existing GaListener that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaListener to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ga_listener", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ga_listener huaweicloud_ga_listener} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaListenerConfig + */ + public constructor(scope: Construct, id: string, config: GaListenerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ga_listener', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._acceleratorId = config.acceleratorId; + this._clientAffinity = config.clientAffinity; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._protocol = config.protocol; + this._tags = config.tags; + this._portRanges.internalValue = config.portRanges; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // accelerator_id - computed: false, optional: false, required: true + private _acceleratorId?: string; + public get acceleratorId() { + return this.getStringAttribute('accelerator_id'); + } + public set acceleratorId(value: string) { + this._acceleratorId = value; + } + // Temporarily expose input value. Use with caution. + public get acceleratorIdInput() { + return this._acceleratorId; + } + + // client_affinity - computed: true, optional: true, required: false + private _clientAffinity?: string; + public get clientAffinity() { + return this.getStringAttribute('client_affinity'); + } + public set clientAffinity(value: string) { + this._clientAffinity = value; + } + public resetClientAffinity() { + this._clientAffinity = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientAffinityInput() { + return this._clientAffinity; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // port_ranges - computed: false, optional: false, required: true + private _portRanges = new GaListenerPortRangesList(this, "port_ranges", false); + public get portRanges() { + return this._portRanges; + } + public putPortRanges(value: GaListenerPortRanges[] | cdktf.IResolvable) { + this._portRanges.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get portRangesInput() { + return this._portRanges.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaListenerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaListenerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + accelerator_id: cdktf.stringToTerraform(this._acceleratorId), + client_affinity: cdktf.stringToTerraform(this._clientAffinity), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + port_ranges: cdktf.listMapper(gaListenerPortRangesToTerraform, true)(this._portRanges.internalValue), + timeouts: gaListenerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + accelerator_id: { + value: cdktf.stringToHclTerraform(this._acceleratorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_affinity: { + value: cdktf.stringToHclTerraform(this._clientAffinity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + port_ranges: { + value: cdktf.listMapperHcl(gaListenerPortRangesToHclTerraform, true)(this._portRanges.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaListenerPortRangesList", + }, + timeouts: { + value: gaListenerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaListenerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/README.md b/src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/README.md new file mode 100644 index 00000000..163360f2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_cassandra_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_cassandra_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance). diff --git a/src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/index.ts b/src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/index.ts new file mode 100644 index 00000000..460283f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-cassandra-instance/index.ts @@ -0,0 +1,1324 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbCassandraInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#auto_renew GaussdbCassandraInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#availability_zone GaussdbCassandraInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#charging_mode GaussdbCassandraInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#configuration_id GaussdbCassandraInstance#configuration_id} + */ + readonly configurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#dedicated_resource_id GaussdbCassandraInstance#dedicated_resource_id} + */ + readonly dedicatedResourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#dedicated_resource_name GaussdbCassandraInstance#dedicated_resource_name} + */ + readonly dedicatedResourceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#enterprise_project_id GaussdbCassandraInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#flavor GaussdbCassandraInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#force_import GaussdbCassandraInstance#force_import} + */ + readonly forceImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#id GaussdbCassandraInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#name GaussdbCassandraInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#node_num GaussdbCassandraInstance#node_num} + */ + readonly nodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#password GaussdbCassandraInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#period GaussdbCassandraInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#period_unit GaussdbCassandraInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#region GaussdbCassandraInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#security_group_id GaussdbCassandraInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#ssl GaussdbCassandraInstance#ssl} + */ + readonly ssl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#subnet_id GaussdbCassandraInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#tags GaussdbCassandraInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#volume_size GaussdbCassandraInstance#volume_size} + */ + readonly volumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#vpc_id GaussdbCassandraInstance#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#backup_strategy GaussdbCassandraInstance#backup_strategy} + */ + readonly backupStrategy?: GaussdbCassandraInstanceBackupStrategy; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#datastore GaussdbCassandraInstance#datastore} + */ + readonly datastore?: GaussdbCassandraInstanceDatastore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#timeouts GaussdbCassandraInstance#timeouts} + */ + readonly timeouts?: GaussdbCassandraInstanceTimeouts; +} +export interface GaussdbCassandraInstanceNodes { +} + +export function gaussdbCassandraInstanceNodesToTerraform(struct?: GaussdbCassandraInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbCassandraInstanceNodesToHclTerraform(struct?: GaussdbCassandraInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbCassandraInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbCassandraInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbCassandraInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class GaussdbCassandraInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbCassandraInstanceNodesOutputReference { + return new GaussdbCassandraInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbCassandraInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#keep_days GaussdbCassandraInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#start_time GaussdbCassandraInstance#start_time} + */ + readonly startTime: string; +} + +export function gaussdbCassandraInstanceBackupStrategyToTerraform(struct?: GaussdbCassandraInstanceBackupStrategyOutputReference | GaussdbCassandraInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function gaussdbCassandraInstanceBackupStrategyToHclTerraform(struct?: GaussdbCassandraInstanceBackupStrategyOutputReference | GaussdbCassandraInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbCassandraInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbCassandraInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbCassandraInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._startTime = value.startTime; + } + } + + // keep_days - computed: true, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface GaussdbCassandraInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#engine GaussdbCassandraInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#storage_engine GaussdbCassandraInstance#storage_engine} + */ + readonly storageEngine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#version GaussdbCassandraInstance#version} + */ + readonly version: string; +} + +export function gaussdbCassandraInstanceDatastoreToTerraform(struct?: GaussdbCassandraInstanceDatastoreOutputReference | GaussdbCassandraInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine: cdktf.stringToTerraform(struct!.engine), + storage_engine: cdktf.stringToTerraform(struct!.storageEngine), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function gaussdbCassandraInstanceDatastoreToHclTerraform(struct?: GaussdbCassandraInstanceDatastoreOutputReference | GaussdbCassandraInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(struct!.engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_engine: { + value: cdktf.stringToHclTerraform(struct!.storageEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbCassandraInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbCassandraInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engine !== undefined) { + hasAnyValues = true; + internalValueResult.engine = this._engine; + } + if (this._storageEngine !== undefined) { + hasAnyValues = true; + internalValueResult.storageEngine = this._storageEngine; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbCassandraInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engine = undefined; + this._storageEngine = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engine = value.engine; + this._storageEngine = value.storageEngine; + this._version = value.version; + } + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // storage_engine - computed: false, optional: false, required: true + private _storageEngine?: string; + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + public set storageEngine(value: string) { + this._storageEngine = value; + } + // Temporarily expose input value. Use with caution. + public get storageEngineInput() { + return this._storageEngine; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface GaussdbCassandraInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#create GaussdbCassandraInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#delete GaussdbCassandraInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#update GaussdbCassandraInstance#update} + */ + readonly update?: string; +} + +export function gaussdbCassandraInstanceTimeoutsToTerraform(struct?: GaussdbCassandraInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbCassandraInstanceTimeoutsToHclTerraform(struct?: GaussdbCassandraInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbCassandraInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbCassandraInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbCassandraInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance huaweicloud_gaussdb_cassandra_instance} +*/ +export class GaussdbCassandraInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_cassandra_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbCassandraInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbCassandraInstance to import + * @param importFromId The id of the existing GaussdbCassandraInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbCassandraInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_cassandra_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_cassandra_instance huaweicloud_gaussdb_cassandra_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbCassandraInstanceConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbCassandraInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_cassandra_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._configurationId = config.configurationId; + this._dedicatedResourceId = config.dedicatedResourceId; + this._dedicatedResourceName = config.dedicatedResourceName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._forceImport = config.forceImport; + this._id = config.id; + this._name = config.name; + this._nodeNum = config.nodeNum; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._ssl = config.ssl; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._volumeSize = config.volumeSize; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._datastore.internalValue = config.datastore; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // configuration_id - computed: true, optional: true, required: false + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + public resetConfigurationId() { + this._configurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // dedicated_resource_id - computed: true, optional: true, required: false + private _dedicatedResourceId?: string; + public get dedicatedResourceId() { + return this.getStringAttribute('dedicated_resource_id'); + } + public set dedicatedResourceId(value: string) { + this._dedicatedResourceId = value; + } + public resetDedicatedResourceId() { + this._dedicatedResourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceIdInput() { + return this._dedicatedResourceId; + } + + // dedicated_resource_name - computed: true, optional: true, required: false + private _dedicatedResourceName?: string; + public get dedicatedResourceName() { + return this.getStringAttribute('dedicated_resource_name'); + } + public set dedicatedResourceName(value: string) { + this._dedicatedResourceName = value; + } + public resetDedicatedResourceName() { + this._dedicatedResourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceNameInput() { + return this._dedicatedResourceName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // force_import - computed: false, optional: true, required: false + private _forceImport?: boolean | cdktf.IResolvable; + public get forceImport() { + return this.getBooleanAttribute('force_import'); + } + public set forceImport(value: boolean | cdktf.IResolvable) { + this._forceImport = value; + } + public resetForceImport() { + this._forceImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceImportInput() { + return this._forceImport; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_ip_address - computed: true, optional: false, required: false + public get lbIpAddress() { + return this.getStringAttribute('lb_ip_address'); + } + + // lb_port - computed: true, optional: false, required: false + public get lbPort() { + return this.getStringAttribute('lb_port'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: false, optional: true, required: false + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbCassandraInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // ssl - computed: false, optional: true, required: false + private _ssl?: boolean | cdktf.IResolvable; + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + public set ssl(value: boolean | cdktf.IResolvable) { + this._ssl = value; + } + public resetSsl() { + this._ssl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslInput() { + return this._ssl; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // volume_size - computed: false, optional: false, required: true + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new GaussdbCassandraInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: GaussdbCassandraInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // datastore - computed: false, optional: true, required: false + private _datastore = new GaussdbCassandraInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: GaussdbCassandraInstanceDatastore) { + this._datastore.internalValue = value; + } + public resetDatastore() { + this._datastore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbCassandraInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbCassandraInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + configuration_id: cdktf.stringToTerraform(this._configurationId), + dedicated_resource_id: cdktf.stringToTerraform(this._dedicatedResourceId), + dedicated_resource_name: cdktf.stringToTerraform(this._dedicatedResourceName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + force_import: cdktf.booleanToTerraform(this._forceImport), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_num: cdktf.numberToTerraform(this._nodeNum), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl: cdktf.booleanToTerraform(this._ssl), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_size: cdktf.numberToTerraform(this._volumeSize), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: gaussdbCassandraInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + datastore: gaussdbCassandraInstanceDatastoreToTerraform(this._datastore.internalValue), + timeouts: gaussdbCassandraInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_id: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_name: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_import: { + value: cdktf.booleanToHclTerraform(this._forceImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl: { + value: cdktf.booleanToHclTerraform(this._ssl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: gaussdbCassandraInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbCassandraInstanceBackupStrategyList", + }, + datastore: { + value: gaussdbCassandraInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbCassandraInstanceDatastoreList", + }, + timeouts: { + value: gaussdbCassandraInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbCassandraInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-influx-instance/README.md b/src/constructs/providers/huaweicloud/gaussdb-influx-instance/README.md new file mode 100644 index 00000000..cb147c4a --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-influx-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_influx_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_influx_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance). diff --git a/src/constructs/providers/huaweicloud/gaussdb-influx-instance/index.ts b/src/constructs/providers/huaweicloud/gaussdb-influx-instance/index.ts new file mode 100644 index 00000000..5fc7c82c --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-influx-instance/index.ts @@ -0,0 +1,1324 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbInfluxInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#auto_renew GaussdbInfluxInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#availability_zone GaussdbInfluxInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#charging_mode GaussdbInfluxInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#configuration_id GaussdbInfluxInstance#configuration_id} + */ + readonly configurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#dedicated_resource_id GaussdbInfluxInstance#dedicated_resource_id} + */ + readonly dedicatedResourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#dedicated_resource_name GaussdbInfluxInstance#dedicated_resource_name} + */ + readonly dedicatedResourceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#enterprise_project_id GaussdbInfluxInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#flavor GaussdbInfluxInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#force_import GaussdbInfluxInstance#force_import} + */ + readonly forceImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#id GaussdbInfluxInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#name GaussdbInfluxInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#node_num GaussdbInfluxInstance#node_num} + */ + readonly nodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#password GaussdbInfluxInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#period GaussdbInfluxInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#period_unit GaussdbInfluxInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#region GaussdbInfluxInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#security_group_id GaussdbInfluxInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#ssl GaussdbInfluxInstance#ssl} + */ + readonly ssl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#subnet_id GaussdbInfluxInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#tags GaussdbInfluxInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#volume_size GaussdbInfluxInstance#volume_size} + */ + readonly volumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#vpc_id GaussdbInfluxInstance#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#backup_strategy GaussdbInfluxInstance#backup_strategy} + */ + readonly backupStrategy?: GaussdbInfluxInstanceBackupStrategy; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#datastore GaussdbInfluxInstance#datastore} + */ + readonly datastore?: GaussdbInfluxInstanceDatastore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#timeouts GaussdbInfluxInstance#timeouts} + */ + readonly timeouts?: GaussdbInfluxInstanceTimeouts; +} +export interface GaussdbInfluxInstanceNodes { +} + +export function gaussdbInfluxInstanceNodesToTerraform(struct?: GaussdbInfluxInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbInfluxInstanceNodesToHclTerraform(struct?: GaussdbInfluxInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbInfluxInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbInfluxInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbInfluxInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class GaussdbInfluxInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbInfluxInstanceNodesOutputReference { + return new GaussdbInfluxInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbInfluxInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#keep_days GaussdbInfluxInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#start_time GaussdbInfluxInstance#start_time} + */ + readonly startTime: string; +} + +export function gaussdbInfluxInstanceBackupStrategyToTerraform(struct?: GaussdbInfluxInstanceBackupStrategyOutputReference | GaussdbInfluxInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function gaussdbInfluxInstanceBackupStrategyToHclTerraform(struct?: GaussdbInfluxInstanceBackupStrategyOutputReference | GaussdbInfluxInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbInfluxInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbInfluxInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbInfluxInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._startTime = value.startTime; + } + } + + // keep_days - computed: true, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface GaussdbInfluxInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#engine GaussdbInfluxInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#storage_engine GaussdbInfluxInstance#storage_engine} + */ + readonly storageEngine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#version GaussdbInfluxInstance#version} + */ + readonly version: string; +} + +export function gaussdbInfluxInstanceDatastoreToTerraform(struct?: GaussdbInfluxInstanceDatastoreOutputReference | GaussdbInfluxInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine: cdktf.stringToTerraform(struct!.engine), + storage_engine: cdktf.stringToTerraform(struct!.storageEngine), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function gaussdbInfluxInstanceDatastoreToHclTerraform(struct?: GaussdbInfluxInstanceDatastoreOutputReference | GaussdbInfluxInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(struct!.engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_engine: { + value: cdktf.stringToHclTerraform(struct!.storageEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbInfluxInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbInfluxInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engine !== undefined) { + hasAnyValues = true; + internalValueResult.engine = this._engine; + } + if (this._storageEngine !== undefined) { + hasAnyValues = true; + internalValueResult.storageEngine = this._storageEngine; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbInfluxInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engine = undefined; + this._storageEngine = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engine = value.engine; + this._storageEngine = value.storageEngine; + this._version = value.version; + } + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // storage_engine - computed: false, optional: false, required: true + private _storageEngine?: string; + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + public set storageEngine(value: string) { + this._storageEngine = value; + } + // Temporarily expose input value. Use with caution. + public get storageEngineInput() { + return this._storageEngine; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface GaussdbInfluxInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#create GaussdbInfluxInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#delete GaussdbInfluxInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#update GaussdbInfluxInstance#update} + */ + readonly update?: string; +} + +export function gaussdbInfluxInstanceTimeoutsToTerraform(struct?: GaussdbInfluxInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbInfluxInstanceTimeoutsToHclTerraform(struct?: GaussdbInfluxInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbInfluxInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbInfluxInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbInfluxInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance huaweicloud_gaussdb_influx_instance} +*/ +export class GaussdbInfluxInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_influx_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbInfluxInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbInfluxInstance to import + * @param importFromId The id of the existing GaussdbInfluxInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbInfluxInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_influx_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_influx_instance huaweicloud_gaussdb_influx_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbInfluxInstanceConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbInfluxInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_influx_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._configurationId = config.configurationId; + this._dedicatedResourceId = config.dedicatedResourceId; + this._dedicatedResourceName = config.dedicatedResourceName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._forceImport = config.forceImport; + this._id = config.id; + this._name = config.name; + this._nodeNum = config.nodeNum; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._ssl = config.ssl; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._volumeSize = config.volumeSize; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._datastore.internalValue = config.datastore; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // configuration_id - computed: true, optional: true, required: false + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + public resetConfigurationId() { + this._configurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // dedicated_resource_id - computed: true, optional: true, required: false + private _dedicatedResourceId?: string; + public get dedicatedResourceId() { + return this.getStringAttribute('dedicated_resource_id'); + } + public set dedicatedResourceId(value: string) { + this._dedicatedResourceId = value; + } + public resetDedicatedResourceId() { + this._dedicatedResourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceIdInput() { + return this._dedicatedResourceId; + } + + // dedicated_resource_name - computed: true, optional: true, required: false + private _dedicatedResourceName?: string; + public get dedicatedResourceName() { + return this.getStringAttribute('dedicated_resource_name'); + } + public set dedicatedResourceName(value: string) { + this._dedicatedResourceName = value; + } + public resetDedicatedResourceName() { + this._dedicatedResourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceNameInput() { + return this._dedicatedResourceName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // force_import - computed: false, optional: true, required: false + private _forceImport?: boolean | cdktf.IResolvable; + public get forceImport() { + return this.getBooleanAttribute('force_import'); + } + public set forceImport(value: boolean | cdktf.IResolvable) { + this._forceImport = value; + } + public resetForceImport() { + this._forceImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceImportInput() { + return this._forceImport; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_ip_address - computed: true, optional: false, required: false + public get lbIpAddress() { + return this.getStringAttribute('lb_ip_address'); + } + + // lb_port - computed: true, optional: false, required: false + public get lbPort() { + return this.getStringAttribute('lb_port'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: false, optional: true, required: false + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbInfluxInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // ssl - computed: false, optional: true, required: false + private _ssl?: boolean | cdktf.IResolvable; + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + public set ssl(value: boolean | cdktf.IResolvable) { + this._ssl = value; + } + public resetSsl() { + this._ssl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslInput() { + return this._ssl; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // volume_size - computed: false, optional: false, required: true + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new GaussdbInfluxInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: GaussdbInfluxInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // datastore - computed: false, optional: true, required: false + private _datastore = new GaussdbInfluxInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: GaussdbInfluxInstanceDatastore) { + this._datastore.internalValue = value; + } + public resetDatastore() { + this._datastore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbInfluxInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbInfluxInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + configuration_id: cdktf.stringToTerraform(this._configurationId), + dedicated_resource_id: cdktf.stringToTerraform(this._dedicatedResourceId), + dedicated_resource_name: cdktf.stringToTerraform(this._dedicatedResourceName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + force_import: cdktf.booleanToTerraform(this._forceImport), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_num: cdktf.numberToTerraform(this._nodeNum), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl: cdktf.booleanToTerraform(this._ssl), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_size: cdktf.numberToTerraform(this._volumeSize), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: gaussdbInfluxInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + datastore: gaussdbInfluxInstanceDatastoreToTerraform(this._datastore.internalValue), + timeouts: gaussdbInfluxInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_id: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_name: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_import: { + value: cdktf.booleanToHclTerraform(this._forceImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl: { + value: cdktf.booleanToHclTerraform(this._ssl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: gaussdbInfluxInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbInfluxInstanceBackupStrategyList", + }, + datastore: { + value: gaussdbInfluxInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbInfluxInstanceDatastoreList", + }, + timeouts: { + value: gaussdbInfluxInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbInfluxInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mongo-instance/README.md b/src/constructs/providers/huaweicloud/gaussdb-mongo-instance/README.md new file mode 100644 index 00000000..7a495b44 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mongo-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mongo_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mongo_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mongo-instance/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mongo-instance/index.ts new file mode 100644 index 00000000..646a525d --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mongo-instance/index.ts @@ -0,0 +1,1324 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMongoInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#auto_renew GaussdbMongoInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#availability_zone GaussdbMongoInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#charging_mode GaussdbMongoInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#configuration_id GaussdbMongoInstance#configuration_id} + */ + readonly configurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#dedicated_resource_id GaussdbMongoInstance#dedicated_resource_id} + */ + readonly dedicatedResourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#dedicated_resource_name GaussdbMongoInstance#dedicated_resource_name} + */ + readonly dedicatedResourceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#enterprise_project_id GaussdbMongoInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#flavor GaussdbMongoInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#force_import GaussdbMongoInstance#force_import} + */ + readonly forceImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#id GaussdbMongoInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#name GaussdbMongoInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#node_num GaussdbMongoInstance#node_num} + */ + readonly nodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#password GaussdbMongoInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#period GaussdbMongoInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#period_unit GaussdbMongoInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#region GaussdbMongoInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#security_group_id GaussdbMongoInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#ssl GaussdbMongoInstance#ssl} + */ + readonly ssl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#subnet_id GaussdbMongoInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#tags GaussdbMongoInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#volume_size GaussdbMongoInstance#volume_size} + */ + readonly volumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#vpc_id GaussdbMongoInstance#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#backup_strategy GaussdbMongoInstance#backup_strategy} + */ + readonly backupStrategy?: GaussdbMongoInstanceBackupStrategy; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#datastore GaussdbMongoInstance#datastore} + */ + readonly datastore?: GaussdbMongoInstanceDatastore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#timeouts GaussdbMongoInstance#timeouts} + */ + readonly timeouts?: GaussdbMongoInstanceTimeouts; +} +export interface GaussdbMongoInstanceNodes { +} + +export function gaussdbMongoInstanceNodesToTerraform(struct?: GaussdbMongoInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbMongoInstanceNodesToHclTerraform(struct?: GaussdbMongoInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbMongoInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMongoInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMongoInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class GaussdbMongoInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMongoInstanceNodesOutputReference { + return new GaussdbMongoInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMongoInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#keep_days GaussdbMongoInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#start_time GaussdbMongoInstance#start_time} + */ + readonly startTime: string; +} + +export function gaussdbMongoInstanceBackupStrategyToTerraform(struct?: GaussdbMongoInstanceBackupStrategyOutputReference | GaussdbMongoInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function gaussdbMongoInstanceBackupStrategyToHclTerraform(struct?: GaussdbMongoInstanceBackupStrategyOutputReference | GaussdbMongoInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMongoInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMongoInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMongoInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._startTime = value.startTime; + } + } + + // keep_days - computed: true, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface GaussdbMongoInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#engine GaussdbMongoInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#storage_engine GaussdbMongoInstance#storage_engine} + */ + readonly storageEngine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#version GaussdbMongoInstance#version} + */ + readonly version: string; +} + +export function gaussdbMongoInstanceDatastoreToTerraform(struct?: GaussdbMongoInstanceDatastoreOutputReference | GaussdbMongoInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine: cdktf.stringToTerraform(struct!.engine), + storage_engine: cdktf.stringToTerraform(struct!.storageEngine), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function gaussdbMongoInstanceDatastoreToHclTerraform(struct?: GaussdbMongoInstanceDatastoreOutputReference | GaussdbMongoInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(struct!.engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_engine: { + value: cdktf.stringToHclTerraform(struct!.storageEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMongoInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMongoInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engine !== undefined) { + hasAnyValues = true; + internalValueResult.engine = this._engine; + } + if (this._storageEngine !== undefined) { + hasAnyValues = true; + internalValueResult.storageEngine = this._storageEngine; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMongoInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engine = undefined; + this._storageEngine = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engine = value.engine; + this._storageEngine = value.storageEngine; + this._version = value.version; + } + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // storage_engine - computed: false, optional: false, required: true + private _storageEngine?: string; + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + public set storageEngine(value: string) { + this._storageEngine = value; + } + // Temporarily expose input value. Use with caution. + public get storageEngineInput() { + return this._storageEngine; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface GaussdbMongoInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#create GaussdbMongoInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#delete GaussdbMongoInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#update GaussdbMongoInstance#update} + */ + readonly update?: string; +} + +export function gaussdbMongoInstanceTimeoutsToTerraform(struct?: GaussdbMongoInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMongoInstanceTimeoutsToHclTerraform(struct?: GaussdbMongoInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMongoInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMongoInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMongoInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance huaweicloud_gaussdb_mongo_instance} +*/ +export class GaussdbMongoInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mongo_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMongoInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMongoInstance to import + * @param importFromId The id of the existing GaussdbMongoInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMongoInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mongo_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mongo_instance huaweicloud_gaussdb_mongo_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMongoInstanceConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMongoInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mongo_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._configurationId = config.configurationId; + this._dedicatedResourceId = config.dedicatedResourceId; + this._dedicatedResourceName = config.dedicatedResourceName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._forceImport = config.forceImport; + this._id = config.id; + this._name = config.name; + this._nodeNum = config.nodeNum; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._ssl = config.ssl; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._volumeSize = config.volumeSize; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._datastore.internalValue = config.datastore; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // configuration_id - computed: true, optional: true, required: false + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + public resetConfigurationId() { + this._configurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // dedicated_resource_id - computed: true, optional: true, required: false + private _dedicatedResourceId?: string; + public get dedicatedResourceId() { + return this.getStringAttribute('dedicated_resource_id'); + } + public set dedicatedResourceId(value: string) { + this._dedicatedResourceId = value; + } + public resetDedicatedResourceId() { + this._dedicatedResourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceIdInput() { + return this._dedicatedResourceId; + } + + // dedicated_resource_name - computed: true, optional: true, required: false + private _dedicatedResourceName?: string; + public get dedicatedResourceName() { + return this.getStringAttribute('dedicated_resource_name'); + } + public set dedicatedResourceName(value: string) { + this._dedicatedResourceName = value; + } + public resetDedicatedResourceName() { + this._dedicatedResourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceNameInput() { + return this._dedicatedResourceName; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // force_import - computed: false, optional: true, required: false + private _forceImport?: boolean | cdktf.IResolvable; + public get forceImport() { + return this.getBooleanAttribute('force_import'); + } + public set forceImport(value: boolean | cdktf.IResolvable) { + this._forceImport = value; + } + public resetForceImport() { + this._forceImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceImportInput() { + return this._forceImport; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_ip_address - computed: true, optional: false, required: false + public get lbIpAddress() { + return this.getStringAttribute('lb_ip_address'); + } + + // lb_port - computed: true, optional: false, required: false + public get lbPort() { + return this.getStringAttribute('lb_port'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: false, optional: true, required: false + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbMongoInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // ssl - computed: false, optional: true, required: false + private _ssl?: boolean | cdktf.IResolvable; + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + public set ssl(value: boolean | cdktf.IResolvable) { + this._ssl = value; + } + public resetSsl() { + this._ssl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslInput() { + return this._ssl; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // volume_size - computed: false, optional: false, required: true + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new GaussdbMongoInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: GaussdbMongoInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // datastore - computed: false, optional: true, required: false + private _datastore = new GaussdbMongoInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: GaussdbMongoInstanceDatastore) { + this._datastore.internalValue = value; + } + public resetDatastore() { + this._datastore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMongoInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMongoInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + configuration_id: cdktf.stringToTerraform(this._configurationId), + dedicated_resource_id: cdktf.stringToTerraform(this._dedicatedResourceId), + dedicated_resource_name: cdktf.stringToTerraform(this._dedicatedResourceName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + force_import: cdktf.booleanToTerraform(this._forceImport), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_num: cdktf.numberToTerraform(this._nodeNum), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl: cdktf.booleanToTerraform(this._ssl), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_size: cdktf.numberToTerraform(this._volumeSize), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: gaussdbMongoInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + datastore: gaussdbMongoInstanceDatastoreToTerraform(this._datastore.internalValue), + timeouts: gaussdbMongoInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_id: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_name: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_import: { + value: cdktf.booleanToHclTerraform(this._forceImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl: { + value: cdktf.booleanToHclTerraform(this._ssl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: gaussdbMongoInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMongoInstanceBackupStrategyList", + }, + datastore: { + value: gaussdbMongoInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMongoInstanceDatastoreList", + }, + timeouts: { + value: gaussdbMongoInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMongoInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/README.md new file mode 100644 index 00000000..f3a7e93b --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_account_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_account_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/index.ts new file mode 100644 index 00000000..93f25f35 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-account-privilege/index.ts @@ -0,0 +1,557 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlAccountPrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database username. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#account_name GaussdbMysqlAccountPrivilege#account_name} + */ + readonly accountName: string; + /** + * Specifies the host IP address which allow database users to connect to the database + * on the current host + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#host GaussdbMysqlAccountPrivilege#host} + */ + readonly host: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#id GaussdbMysqlAccountPrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#instance_id GaussdbMysqlAccountPrivilege#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#region GaussdbMysqlAccountPrivilege#region} + */ + readonly region?: string; + /** + * databases block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#databases GaussdbMysqlAccountPrivilege#databases} + */ + readonly databases: GaussdbMysqlAccountPrivilegeDatabases[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#timeouts GaussdbMysqlAccountPrivilege#timeouts} + */ + readonly timeouts?: GaussdbMysqlAccountPrivilegeTimeouts; +} +export interface GaussdbMysqlAccountPrivilegeDatabases { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#name GaussdbMysqlAccountPrivilege#name} + */ + readonly name: string; + /** + * Specifies whether the database permission is read-only. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#readonly GaussdbMysqlAccountPrivilege#readonly} + */ + readonly readonly: boolean | cdktf.IResolvable; +} + +export function gaussdbMysqlAccountPrivilegeDatabasesToTerraform(struct?: GaussdbMysqlAccountPrivilegeDatabases | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + readonly: cdktf.booleanToTerraform(struct!.readonly), + } +} + + +export function gaussdbMysqlAccountPrivilegeDatabasesToHclTerraform(struct?: GaussdbMysqlAccountPrivilegeDatabases | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(struct!.readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlAccountPrivilegeDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlAccountPrivilegeDatabases | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._readonly !== undefined) { + hasAnyValues = true; + internalValueResult.readonly = this._readonly; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlAccountPrivilegeDatabases | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._readonly = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._readonly = value.readonly; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // readonly - computed: false, optional: false, required: true + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } +} + +export class GaussdbMysqlAccountPrivilegeDatabasesList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlAccountPrivilegeDatabases[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlAccountPrivilegeDatabasesOutputReference { + return new GaussdbMysqlAccountPrivilegeDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlAccountPrivilegeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#create GaussdbMysqlAccountPrivilege#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#update GaussdbMysqlAccountPrivilege#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlAccountPrivilegeTimeoutsToTerraform(struct?: GaussdbMysqlAccountPrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlAccountPrivilegeTimeoutsToHclTerraform(struct?: GaussdbMysqlAccountPrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlAccountPrivilegeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlAccountPrivilegeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlAccountPrivilegeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege huaweicloud_gaussdb_mysql_account_privilege} +*/ +export class GaussdbMysqlAccountPrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_account_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlAccountPrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlAccountPrivilege to import + * @param importFromId The id of the existing GaussdbMysqlAccountPrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlAccountPrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_account_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account_privilege huaweicloud_gaussdb_mysql_account_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlAccountPrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlAccountPrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_account_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountName = config.accountName; + this._host = config.host; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._databases.internalValue = config.databases; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_name - computed: false, optional: false, required: true + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // host - computed: false, optional: false, required: true + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // databases - computed: false, optional: false, required: true + private _databases = new GaussdbMysqlAccountPrivilegeDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + public putDatabases(value: GaussdbMysqlAccountPrivilegeDatabases[] | cdktf.IResolvable) { + this._databases.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get databasesInput() { + return this._databases.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlAccountPrivilegeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlAccountPrivilegeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_name: cdktf.stringToTerraform(this._accountName), + host: cdktf.stringToTerraform(this._host), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + databases: cdktf.listMapper(gaussdbMysqlAccountPrivilegeDatabasesToTerraform, true)(this._databases.internalValue), + timeouts: gaussdbMysqlAccountPrivilegeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host: { + value: cdktf.stringToHclTerraform(this._host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + databases: { + value: cdktf.listMapperHcl(gaussdbMysqlAccountPrivilegeDatabasesToHclTerraform, true)(this._databases.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlAccountPrivilegeDatabasesList", + }, + timeouts: { + value: gaussdbMysqlAccountPrivilegeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlAccountPrivilegeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-account/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-account/README.md new file mode 100644 index 00000000..957b4e60 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-account/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-account/index.ts new file mode 100644 index 00000000..0fb3d315 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-account/index.ts @@ -0,0 +1,475 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database user remarks. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#description GaussdbMysqlAccount#description} + */ + readonly description?: string; + /** + * Specifies the host IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#host GaussdbMysqlAccount#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#id GaussdbMysqlAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#instance_id GaussdbMysqlAccount#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database username. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#name GaussdbMysqlAccount#name} + */ + readonly name: string; + /** + * Specifies the password of the database user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#password GaussdbMysqlAccount#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#region GaussdbMysqlAccount#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#timeouts GaussdbMysqlAccount#timeouts} + */ + readonly timeouts?: GaussdbMysqlAccountTimeouts; +} +export interface GaussdbMysqlAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#create GaussdbMysqlAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#delete GaussdbMysqlAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#update GaussdbMysqlAccount#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlAccountTimeoutsToTerraform(struct?: GaussdbMysqlAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlAccountTimeoutsToHclTerraform(struct?: GaussdbMysqlAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account huaweicloud_gaussdb_mysql_account} +*/ +export class GaussdbMysqlAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlAccount to import + * @param importFromId The id of the existing GaussdbMysqlAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_account huaweicloud_gaussdb_mysql_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlAccountConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._host = config.host; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + host: cdktf.stringToTerraform(this._host), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host: { + value: cdktf.stringToHclTerraform(this._host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-backup/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-backup/README.md new file mode 100644 index 00000000..31e0c166 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-backup/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-backup/index.ts new file mode 100644 index 00000000..c4390e0a --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-backup/index.ts @@ -0,0 +1,458 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#description GaussdbMysqlBackup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#id GaussdbMysqlBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#instance_id GaussdbMysqlBackup#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#name GaussdbMysqlBackup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#region GaussdbMysqlBackup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#timeouts GaussdbMysqlBackup#timeouts} + */ + readonly timeouts?: GaussdbMysqlBackupTimeouts; +} +export interface GaussdbMysqlBackupDatastore { +} + +export function gaussdbMysqlBackupDatastoreToTerraform(struct?: GaussdbMysqlBackupDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbMysqlBackupDatastoreToHclTerraform(struct?: GaussdbMysqlBackupDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbMysqlBackupDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlBackupDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlBackupDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} + +export class GaussdbMysqlBackupDatastoreList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlBackupDatastoreOutputReference { + return new GaussdbMysqlBackupDatastoreOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#create GaussdbMysqlBackup#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlBackupTimeoutsToTerraform(struct?: GaussdbMysqlBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlBackupTimeoutsToHclTerraform(struct?: GaussdbMysqlBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup huaweicloud_gaussdb_mysql_backup} +*/ +export class GaussdbMysqlBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlBackup to import + * @param importFromId The id of the existing GaussdbMysqlBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_backup huaweicloud_gaussdb_mysql_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlBackupConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // datastore - computed: true, optional: false, required: false + private _datastore = new GaussdbMysqlBackupDatastoreList(this, "datastore", false); + public get datastore() { + return this._datastore; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // take_up_time - computed: true, optional: false, required: false + public get takeUpTime() { + return this.getNumberAttribute('take_up_time'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-database/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-database/README.md new file mode 100644 index 00000000..9691b7c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-database/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-database/index.ts new file mode 100644 index 00000000..94a865b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-database/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database character set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#character_set GaussdbMysqlDatabase#character_set} + */ + readonly characterSet: string; + /** + * Specifies the database remarks. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#description GaussdbMysqlDatabase#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#id GaussdbMysqlDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#instance_id GaussdbMysqlDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#name GaussdbMysqlDatabase#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#region GaussdbMysqlDatabase#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#timeouts GaussdbMysqlDatabase#timeouts} + */ + readonly timeouts?: GaussdbMysqlDatabaseTimeouts; +} +export interface GaussdbMysqlDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#create GaussdbMysqlDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#delete GaussdbMysqlDatabase#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#update GaussdbMysqlDatabase#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlDatabaseTimeoutsToTerraform(struct?: GaussdbMysqlDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlDatabaseTimeoutsToHclTerraform(struct?: GaussdbMysqlDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database huaweicloud_gaussdb_mysql_database} +*/ +export class GaussdbMysqlDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlDatabase to import + * @param importFromId The id of the existing GaussdbMysqlDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_database huaweicloud_gaussdb_mysql_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: false, required: true + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/README.md new file mode 100644 index 00000000..dcbd4779 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/index.ts new file mode 100644 index 00000000..29ed85d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-eip-associate/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#id GaussdbMysqlEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#instance_id GaussdbMysqlEipAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the EIP address to be bound. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#public_ip GaussdbMysqlEipAssociate#public_ip} + */ + readonly publicIp: string; + /** + * Specifies the ID of the EIP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#public_ip_id GaussdbMysqlEipAssociate#public_ip_id} + */ + readonly publicIpId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#region GaussdbMysqlEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#timeouts GaussdbMysqlEipAssociate#timeouts} + */ + readonly timeouts?: GaussdbMysqlEipAssociateTimeouts; +} +export interface GaussdbMysqlEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#create GaussdbMysqlEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#delete GaussdbMysqlEipAssociate#delete} + */ + readonly delete?: string; +} + +export function gaussdbMysqlEipAssociateTimeoutsToTerraform(struct?: GaussdbMysqlEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function gaussdbMysqlEipAssociateTimeoutsToHclTerraform(struct?: GaussdbMysqlEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate huaweicloud_gaussdb_mysql_eip_associate} +*/ +export class GaussdbMysqlEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlEipAssociate to import + * @param importFromId The id of the existing GaussdbMysqlEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_eip_associate huaweicloud_gaussdb_mysql_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._publicIp = config.publicIp; + this._publicIpId = config.publicIpId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // public_ip_id - computed: false, optional: false, required: true + private _publicIpId?: string; + public get publicIpId() { + return this.getStringAttribute('public_ip_id'); + } + public set publicIpId(value: string) { + this._publicIpId = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpIdInput() { + return this._publicIpId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + public_ip: cdktf.stringToTerraform(this._publicIp), + public_ip_id: cdktf.stringToTerraform(this._publicIpId), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip_id: { + value: cdktf.stringToHclTerraform(this._publicIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/README.md new file mode 100644 index 00000000..e5537488 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_instance_node_config` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_instance_node_config`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/index.ts new file mode 100644 index 00000000..20f4993a --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-node-config/index.ts @@ -0,0 +1,407 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlInstanceNodeConfigConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#id GaussdbMysqlInstanceNodeConfig#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#instance_id GaussdbMysqlInstanceNodeConfig#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#name GaussdbMysqlInstanceNodeConfig#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#node_id GaussdbMysqlInstanceNodeConfig#node_id} + */ + readonly nodeId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#priority GaussdbMysqlInstanceNodeConfig#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#region GaussdbMysqlInstanceNodeConfig#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#timeouts GaussdbMysqlInstanceNodeConfig#timeouts} + */ + readonly timeouts?: GaussdbMysqlInstanceNodeConfigTimeouts; +} +export interface GaussdbMysqlInstanceNodeConfigTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#create GaussdbMysqlInstanceNodeConfig#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#update GaussdbMysqlInstanceNodeConfig#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlInstanceNodeConfigTimeoutsToTerraform(struct?: GaussdbMysqlInstanceNodeConfigTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlInstanceNodeConfigTimeoutsToHclTerraform(struct?: GaussdbMysqlInstanceNodeConfigTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceNodeConfigTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlInstanceNodeConfigTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceNodeConfigTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config huaweicloud_gaussdb_mysql_instance_node_config} +*/ +export class GaussdbMysqlInstanceNodeConfig extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instance_node_config"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlInstanceNodeConfig resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlInstanceNodeConfig to import + * @param importFromId The id of the existing GaussdbMysqlInstanceNodeConfig that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlInstanceNodeConfig to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instance_node_config", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_node_config huaweicloud_gaussdb_mysql_instance_node_config} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlInstanceNodeConfigConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlInstanceNodeConfigConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instance_node_config', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._nodeId = config.nodeId; + this._priority = config.priority; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlInstanceNodeConfigTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlInstanceNodeConfigTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + node_id: cdktf.stringToTerraform(this._nodeId), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlInstanceNodeConfigTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlInstanceNodeConfigTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlInstanceNodeConfigTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/README.md new file mode 100644 index 00000000..5aa585e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_instance_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_instance_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/index.ts new file mode 100644 index 00000000..77c37b04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-restart/index.ts @@ -0,0 +1,349 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlInstanceRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#delay GaussdbMysqlInstanceRestart#delay} + */ + readonly delay?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#id GaussdbMysqlInstanceRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#instance_id GaussdbMysqlInstanceRestart#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#node_id GaussdbMysqlInstanceRestart#node_id} + */ + readonly nodeId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#region GaussdbMysqlInstanceRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#timeouts GaussdbMysqlInstanceRestart#timeouts} + */ + readonly timeouts?: GaussdbMysqlInstanceRestartTimeouts; +} +export interface GaussdbMysqlInstanceRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#create GaussdbMysqlInstanceRestart#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlInstanceRestartTimeoutsToTerraform(struct?: GaussdbMysqlInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlInstanceRestartTimeoutsToHclTerraform(struct?: GaussdbMysqlInstanceRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlInstanceRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart huaweicloud_gaussdb_mysql_instance_restart} +*/ +export class GaussdbMysqlInstanceRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instance_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlInstanceRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlInstanceRestart to import + * @param importFromId The id of the existing GaussdbMysqlInstanceRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlInstanceRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instance_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_restart huaweicloud_gaussdb_mysql_instance_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlInstanceRestartConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlInstanceRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instance_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._delay = config.delay; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // delay - computed: false, optional: true, required: false + private _delay?: boolean | cdktf.IResolvable; + public get delay() { + return this.getBooleanAttribute('delay'); + } + public set delay(value: boolean | cdktf.IResolvable) { + this._delay = value; + } + public resetDelay() { + this._delay = undefined; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_id - computed: false, optional: true, required: false + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + public resetNodeId() { + this._nodeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlInstanceRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlInstanceRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delay: cdktf.booleanToTerraform(this._delay), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlInstanceRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delay: { + value: cdktf.booleanToHclTerraform(this._delay), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlInstanceRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlInstanceRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/README.md new file mode 100644 index 00000000..cca24da5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_instance_upgrade` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_instance_upgrade`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/index.ts new file mode 100644 index 00000000..28ad1336 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance-upgrade/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlInstanceUpgradeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#delay GaussdbMysqlInstanceUpgrade#delay} + */ + readonly delay?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#id GaussdbMysqlInstanceUpgrade#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#instance_id GaussdbMysqlInstanceUpgrade#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#region GaussdbMysqlInstanceUpgrade#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#timeouts GaussdbMysqlInstanceUpgrade#timeouts} + */ + readonly timeouts?: GaussdbMysqlInstanceUpgradeTimeouts; +} +export interface GaussdbMysqlInstanceUpgradeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#create GaussdbMysqlInstanceUpgrade#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlInstanceUpgradeTimeoutsToTerraform(struct?: GaussdbMysqlInstanceUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlInstanceUpgradeTimeoutsToHclTerraform(struct?: GaussdbMysqlInstanceUpgradeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceUpgradeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlInstanceUpgradeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceUpgradeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade huaweicloud_gaussdb_mysql_instance_upgrade} +*/ +export class GaussdbMysqlInstanceUpgrade extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instance_upgrade"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlInstanceUpgrade resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlInstanceUpgrade to import + * @param importFromId The id of the existing GaussdbMysqlInstanceUpgrade that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlInstanceUpgrade to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instance_upgrade", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance_upgrade huaweicloud_gaussdb_mysql_instance_upgrade} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlInstanceUpgradeConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlInstanceUpgradeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instance_upgrade', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._delay = config.delay; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // delay - computed: false, optional: true, required: false + private _delay?: boolean | cdktf.IResolvable; + public get delay() { + return this.getBooleanAttribute('delay'); + } + public set delay(value: boolean | cdktf.IResolvable) { + this._delay = value; + } + public resetDelay() { + this._delay = undefined; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlInstanceUpgradeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlInstanceUpgradeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delay: cdktf.booleanToTerraform(this._delay), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlInstanceUpgradeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delay: { + value: cdktf.booleanToHclTerraform(this._delay), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlInstanceUpgradeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlInstanceUpgradeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance/README.md new file mode 100644 index 00000000..39d9fdcf --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instance/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance/index.ts new file mode 100644 index 00000000..517d3363 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instance/index.ts @@ -0,0 +1,2591 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#audit_log_enabled GaussdbMysqlInstance#audit_log_enabled} + */ + readonly auditLogEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#auto_pay GaussdbMysqlInstance#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#auto_renew GaussdbMysqlInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#availability_zone_mode GaussdbMysqlInstance#availability_zone_mode} + */ + readonly availabilityZoneMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#charging_mode GaussdbMysqlInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#configuration_id GaussdbMysqlInstance#configuration_id} + */ + readonly configurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#configuration_name GaussdbMysqlInstance#configuration_name} + */ + readonly configurationName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#dedicated_resource_id GaussdbMysqlInstance#dedicated_resource_id} + */ + readonly dedicatedResourceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#dedicated_resource_name GaussdbMysqlInstance#dedicated_resource_name} + */ + readonly dedicatedResourceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#description GaussdbMysqlInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#encryption_status GaussdbMysqlInstance#encryption_status} + */ + readonly encryptionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#encryption_type GaussdbMysqlInstance#encryption_type} + */ + readonly encryptionType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#enterprise_project_id GaussdbMysqlInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#flavor GaussdbMysqlInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#force_import GaussdbMysqlInstance#force_import} + */ + readonly forceImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#id GaussdbMysqlInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#kms_key_id GaussdbMysqlInstance#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#maintain_begin GaussdbMysqlInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#maintain_end GaussdbMysqlInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#master_availability_zone GaussdbMysqlInstance#master_availability_zone} + */ + readonly masterAvailabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#name GaussdbMysqlInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#password GaussdbMysqlInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#period GaussdbMysqlInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#period_unit GaussdbMysqlInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#port GaussdbMysqlInstance#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#private_dns_name_prefix GaussdbMysqlInstance#private_dns_name_prefix} + */ + readonly privateDnsNamePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#private_write_ip GaussdbMysqlInstance#private_write_ip} + */ + readonly privateWriteIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#proxy_flavor GaussdbMysqlInstance#proxy_flavor} + */ + readonly proxyFlavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#proxy_node_num GaussdbMysqlInstance#proxy_node_num} + */ + readonly proxyNodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#read_replicas GaussdbMysqlInstance#read_replicas} + */ + readonly readReplicas?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#region GaussdbMysqlInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#seconds_level_monitoring_enabled GaussdbMysqlInstance#seconds_level_monitoring_enabled} + */ + readonly secondsLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#seconds_level_monitoring_period GaussdbMysqlInstance#seconds_level_monitoring_period} + */ + readonly secondsLevelMonitoringPeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#security_group_id GaussdbMysqlInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#slow_log_show_original_switch GaussdbMysqlInstance#slow_log_show_original_switch} + */ + readonly slowLogShowOriginalSwitch?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#sql_filter_enabled GaussdbMysqlInstance#sql_filter_enabled} + */ + readonly sqlFilterEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#ssl_option GaussdbMysqlInstance#ssl_option} + */ + readonly sslOption?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#subnet_id GaussdbMysqlInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#table_name_case_sensitivity GaussdbMysqlInstance#table_name_case_sensitivity} + */ + readonly tableNameCaseSensitivity?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#tags GaussdbMysqlInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#time_zone GaussdbMysqlInstance#time_zone} + */ + readonly timeZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#volume_size GaussdbMysqlInstance#volume_size} + */ + readonly volumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#vpc_id GaussdbMysqlInstance#vpc_id} + */ + readonly vpcId: string; + /** + * auto_scaling block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#auto_scaling GaussdbMysqlInstance#auto_scaling} + */ + readonly autoScaling?: GaussdbMysqlInstanceAutoScaling; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#backup_strategy GaussdbMysqlInstance#backup_strategy} + */ + readonly backupStrategy?: GaussdbMysqlInstanceBackupStrategy; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#datastore GaussdbMysqlInstance#datastore} + */ + readonly datastore?: GaussdbMysqlInstanceDatastore; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#parameters GaussdbMysqlInstance#parameters} + */ + readonly parameters?: GaussdbMysqlInstanceParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#timeouts GaussdbMysqlInstance#timeouts} + */ + readonly timeouts?: GaussdbMysqlInstanceTimeouts; +} +export interface GaussdbMysqlInstanceNodes { +} + +export function gaussdbMysqlInstanceNodesToTerraform(struct?: GaussdbMysqlInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbMysqlInstanceNodesToHclTerraform(struct?: GaussdbMysqlInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbMysqlInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_read_ip - computed: true, optional: false, required: false + public get privateReadIp() { + return this.getStringAttribute('private_read_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class GaussdbMysqlInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlInstanceNodesOutputReference { + return new GaussdbMysqlInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlInstanceAutoScalingScalingStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#flavor_switch GaussdbMysqlInstance#flavor_switch} + */ + readonly flavorSwitch: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#read_only_switch GaussdbMysqlInstance#read_only_switch} + */ + readonly readOnlySwitch: string; +} + +export function gaussdbMysqlInstanceAutoScalingScalingStrategyToTerraform(struct?: GaussdbMysqlInstanceAutoScalingScalingStrategyOutputReference | GaussdbMysqlInstanceAutoScalingScalingStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + flavor_switch: cdktf.stringToTerraform(struct!.flavorSwitch), + read_only_switch: cdktf.stringToTerraform(struct!.readOnlySwitch), + } +} + + +export function gaussdbMysqlInstanceAutoScalingScalingStrategyToHclTerraform(struct?: GaussdbMysqlInstanceAutoScalingScalingStrategyOutputReference | GaussdbMysqlInstanceAutoScalingScalingStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + flavor_switch: { + value: cdktf.stringToHclTerraform(struct!.flavorSwitch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_only_switch: { + value: cdktf.stringToHclTerraform(struct!.readOnlySwitch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceAutoScalingScalingStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMysqlInstanceAutoScalingScalingStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._flavorSwitch !== undefined) { + hasAnyValues = true; + internalValueResult.flavorSwitch = this._flavorSwitch; + } + if (this._readOnlySwitch !== undefined) { + hasAnyValues = true; + internalValueResult.readOnlySwitch = this._readOnlySwitch; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceAutoScalingScalingStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._flavorSwitch = undefined; + this._readOnlySwitch = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._flavorSwitch = value.flavorSwitch; + this._readOnlySwitch = value.readOnlySwitch; + } + } + + // flavor_switch - computed: false, optional: false, required: true + private _flavorSwitch?: string; + public get flavorSwitch() { + return this.getStringAttribute('flavor_switch'); + } + public set flavorSwitch(value: string) { + this._flavorSwitch = value; + } + // Temporarily expose input value. Use with caution. + public get flavorSwitchInput() { + return this._flavorSwitch; + } + + // read_only_switch - computed: false, optional: false, required: true + private _readOnlySwitch?: string; + public get readOnlySwitch() { + return this.getStringAttribute('read_only_switch'); + } + public set readOnlySwitch(value: string) { + this._readOnlySwitch = value; + } + // Temporarily expose input value. Use with caution. + public get readOnlySwitchInput() { + return this._readOnlySwitch; + } +} +export interface GaussdbMysqlInstanceAutoScaling { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#enlarge_threshold GaussdbMysqlInstance#enlarge_threshold} + */ + readonly enlargeThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#max_flavor GaussdbMysqlInstance#max_flavor} + */ + readonly maxFlavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#max_read_only_count GaussdbMysqlInstance#max_read_only_count} + */ + readonly maxReadOnlyCount?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#monitor_cycle GaussdbMysqlInstance#monitor_cycle} + */ + readonly monitorCycle?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#read_only_weight GaussdbMysqlInstance#read_only_weight} + */ + readonly readOnlyWeight?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#reduce_enabled GaussdbMysqlInstance#reduce_enabled} + */ + readonly reduceEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#silence_cycle GaussdbMysqlInstance#silence_cycle} + */ + readonly silenceCycle?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#status GaussdbMysqlInstance#status} + */ + readonly status: string; + /** + * scaling_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#scaling_strategy GaussdbMysqlInstance#scaling_strategy} + */ + readonly scalingStrategy: GaussdbMysqlInstanceAutoScalingScalingStrategy; +} + +export function gaussdbMysqlInstanceAutoScalingToTerraform(struct?: GaussdbMysqlInstanceAutoScalingOutputReference | GaussdbMysqlInstanceAutoScaling): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enlarge_threshold: cdktf.numberToTerraform(struct!.enlargeThreshold), + max_flavor: cdktf.stringToTerraform(struct!.maxFlavor), + max_read_only_count: cdktf.numberToTerraform(struct!.maxReadOnlyCount), + monitor_cycle: cdktf.numberToTerraform(struct!.monitorCycle), + read_only_weight: cdktf.numberToTerraform(struct!.readOnlyWeight), + reduce_enabled: cdktf.booleanToTerraform(struct!.reduceEnabled), + silence_cycle: cdktf.numberToTerraform(struct!.silenceCycle), + status: cdktf.stringToTerraform(struct!.status), + scaling_strategy: gaussdbMysqlInstanceAutoScalingScalingStrategyToTerraform(struct!.scalingStrategy), + } +} + + +export function gaussdbMysqlInstanceAutoScalingToHclTerraform(struct?: GaussdbMysqlInstanceAutoScalingOutputReference | GaussdbMysqlInstanceAutoScaling): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enlarge_threshold: { + value: cdktf.numberToHclTerraform(struct!.enlargeThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_flavor: { + value: cdktf.stringToHclTerraform(struct!.maxFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_read_only_count: { + value: cdktf.numberToHclTerraform(struct!.maxReadOnlyCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + monitor_cycle: { + value: cdktf.numberToHclTerraform(struct!.monitorCycle), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + read_only_weight: { + value: cdktf.numberToHclTerraform(struct!.readOnlyWeight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + reduce_enabled: { + value: cdktf.booleanToHclTerraform(struct!.reduceEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + silence_cycle: { + value: cdktf.numberToHclTerraform(struct!.silenceCycle), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.stringToHclTerraform(struct!.status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_strategy: { + value: gaussdbMysqlInstanceAutoScalingScalingStrategyToHclTerraform(struct!.scalingStrategy), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlInstanceAutoScalingScalingStrategyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceAutoScalingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMysqlInstanceAutoScaling | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enlargeThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.enlargeThreshold = this._enlargeThreshold; + } + if (this._maxFlavor !== undefined) { + hasAnyValues = true; + internalValueResult.maxFlavor = this._maxFlavor; + } + if (this._maxReadOnlyCount !== undefined) { + hasAnyValues = true; + internalValueResult.maxReadOnlyCount = this._maxReadOnlyCount; + } + if (this._monitorCycle !== undefined) { + hasAnyValues = true; + internalValueResult.monitorCycle = this._monitorCycle; + } + if (this._readOnlyWeight !== undefined) { + hasAnyValues = true; + internalValueResult.readOnlyWeight = this._readOnlyWeight; + } + if (this._reduceEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.reduceEnabled = this._reduceEnabled; + } + if (this._silenceCycle !== undefined) { + hasAnyValues = true; + internalValueResult.silenceCycle = this._silenceCycle; + } + if (this._status !== undefined) { + hasAnyValues = true; + internalValueResult.status = this._status; + } + if (this._scalingStrategy?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.scalingStrategy = this._scalingStrategy?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceAutoScaling | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enlargeThreshold = undefined; + this._maxFlavor = undefined; + this._maxReadOnlyCount = undefined; + this._monitorCycle = undefined; + this._readOnlyWeight = undefined; + this._reduceEnabled = undefined; + this._silenceCycle = undefined; + this._status = undefined; + this._scalingStrategy.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enlargeThreshold = value.enlargeThreshold; + this._maxFlavor = value.maxFlavor; + this._maxReadOnlyCount = value.maxReadOnlyCount; + this._monitorCycle = value.monitorCycle; + this._readOnlyWeight = value.readOnlyWeight; + this._reduceEnabled = value.reduceEnabled; + this._silenceCycle = value.silenceCycle; + this._status = value.status; + this._scalingStrategy.internalValue = value.scalingStrategy; + } + } + + // enlarge_threshold - computed: true, optional: true, required: false + private _enlargeThreshold?: number; + public get enlargeThreshold() { + return this.getNumberAttribute('enlarge_threshold'); + } + public set enlargeThreshold(value: number) { + this._enlargeThreshold = value; + } + public resetEnlargeThreshold() { + this._enlargeThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get enlargeThresholdInput() { + return this._enlargeThreshold; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // max_flavor - computed: true, optional: true, required: false + private _maxFlavor?: string; + public get maxFlavor() { + return this.getStringAttribute('max_flavor'); + } + public set maxFlavor(value: string) { + this._maxFlavor = value; + } + public resetMaxFlavor() { + this._maxFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxFlavorInput() { + return this._maxFlavor; + } + + // max_read_only_count - computed: true, optional: true, required: false + private _maxReadOnlyCount?: number; + public get maxReadOnlyCount() { + return this.getNumberAttribute('max_read_only_count'); + } + public set maxReadOnlyCount(value: number) { + this._maxReadOnlyCount = value; + } + public resetMaxReadOnlyCount() { + this._maxReadOnlyCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxReadOnlyCountInput() { + return this._maxReadOnlyCount; + } + + // min_flavor - computed: true, optional: false, required: false + public get minFlavor() { + return this.getStringAttribute('min_flavor'); + } + + // min_read_only_count - computed: true, optional: false, required: false + public get minReadOnlyCount() { + return this.getNumberAttribute('min_read_only_count'); + } + + // monitor_cycle - computed: true, optional: true, required: false + private _monitorCycle?: number; + public get monitorCycle() { + return this.getNumberAttribute('monitor_cycle'); + } + public set monitorCycle(value: number) { + this._monitorCycle = value; + } + public resetMonitorCycle() { + this._monitorCycle = undefined; + } + // Temporarily expose input value. Use with caution. + public get monitorCycleInput() { + return this._monitorCycle; + } + + // read_only_weight - computed: true, optional: true, required: false + private _readOnlyWeight?: number; + public get readOnlyWeight() { + return this.getNumberAttribute('read_only_weight'); + } + public set readOnlyWeight(value: number) { + this._readOnlyWeight = value; + } + public resetReadOnlyWeight() { + this._readOnlyWeight = undefined; + } + // Temporarily expose input value. Use with caution. + public get readOnlyWeightInput() { + return this._readOnlyWeight; + } + + // reduce_enabled - computed: true, optional: true, required: false + private _reduceEnabled?: boolean | cdktf.IResolvable; + public get reduceEnabled() { + return this.getBooleanAttribute('reduce_enabled'); + } + public set reduceEnabled(value: boolean | cdktf.IResolvable) { + this._reduceEnabled = value; + } + public resetReduceEnabled() { + this._reduceEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get reduceEnabledInput() { + return this._reduceEnabled; + } + + // silence_cycle - computed: true, optional: true, required: false + private _silenceCycle?: number; + public get silenceCycle() { + return this.getNumberAttribute('silence_cycle'); + } + public set silenceCycle(value: number) { + this._silenceCycle = value; + } + public resetSilenceCycle() { + this._silenceCycle = undefined; + } + // Temporarily expose input value. Use with caution. + public get silenceCycleInput() { + return this._silenceCycle; + } + + // silence_start_at - computed: true, optional: false, required: false + public get silenceStartAt() { + return this.getStringAttribute('silence_start_at'); + } + + // status - computed: false, optional: false, required: true + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // scaling_strategy - computed: false, optional: false, required: true + private _scalingStrategy = new GaussdbMysqlInstanceAutoScalingScalingStrategyOutputReference(this, "scaling_strategy"); + public get scalingStrategy() { + return this._scalingStrategy; + } + public putScalingStrategy(value: GaussdbMysqlInstanceAutoScalingScalingStrategy) { + this._scalingStrategy.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get scalingStrategyInput() { + return this._scalingStrategy.internalValue; + } +} +export interface GaussdbMysqlInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#keep_days GaussdbMysqlInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#start_time GaussdbMysqlInstance#start_time} + */ + readonly startTime: string; +} + +export function gaussdbMysqlInstanceBackupStrategyToTerraform(struct?: GaussdbMysqlInstanceBackupStrategyOutputReference | GaussdbMysqlInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function gaussdbMysqlInstanceBackupStrategyToHclTerraform(struct?: GaussdbMysqlInstanceBackupStrategyOutputReference | GaussdbMysqlInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMysqlInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._startTime = value.startTime; + } + } + + // keep_days - computed: false, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface GaussdbMysqlInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#engine GaussdbMysqlInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#version GaussdbMysqlInstance#version} + */ + readonly version: string; +} + +export function gaussdbMysqlInstanceDatastoreToTerraform(struct?: GaussdbMysqlInstanceDatastoreOutputReference | GaussdbMysqlInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine: cdktf.stringToTerraform(struct!.engine), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function gaussdbMysqlInstanceDatastoreToHclTerraform(struct?: GaussdbMysqlInstanceDatastoreOutputReference | GaussdbMysqlInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(struct!.engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMysqlInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engine !== undefined) { + hasAnyValues = true; + internalValueResult.engine = this._engine; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engine = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engine = value.engine; + this._version = value.version; + } + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface GaussdbMysqlInstanceParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#name GaussdbMysqlInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#value GaussdbMysqlInstance#value} + */ + readonly value: string; +} + +export function gaussdbMysqlInstanceParametersToTerraform(struct?: GaussdbMysqlInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function gaussdbMysqlInstanceParametersToHclTerraform(struct?: GaussdbMysqlInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlInstanceParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class GaussdbMysqlInstanceParametersList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlInstanceParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlInstanceParametersOutputReference { + return new GaussdbMysqlInstanceParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#create GaussdbMysqlInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#delete GaussdbMysqlInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#update GaussdbMysqlInstance#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlInstanceTimeoutsToTerraform(struct?: GaussdbMysqlInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlInstanceTimeoutsToHclTerraform(struct?: GaussdbMysqlInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance huaweicloud_gaussdb_mysql_instance} +*/ +export class GaussdbMysqlInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlInstance to import + * @param importFromId The id of the existing GaussdbMysqlInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instance huaweicloud_gaussdb_mysql_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlInstanceConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._auditLogEnabled = config.auditLogEnabled; + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZoneMode = config.availabilityZoneMode; + this._chargingMode = config.chargingMode; + this._configurationId = config.configurationId; + this._configurationName = config.configurationName; + this._dedicatedResourceId = config.dedicatedResourceId; + this._dedicatedResourceName = config.dedicatedResourceName; + this._description = config.description; + this._encryptionStatus = config.encryptionStatus; + this._encryptionType = config.encryptionType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._forceImport = config.forceImport; + this._id = config.id; + this._kmsKeyId = config.kmsKeyId; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._masterAvailabilityZone = config.masterAvailabilityZone; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._privateDnsNamePrefix = config.privateDnsNamePrefix; + this._privateWriteIp = config.privateWriteIp; + this._proxyFlavor = config.proxyFlavor; + this._proxyNodeNum = config.proxyNodeNum; + this._readReplicas = config.readReplicas; + this._region = config.region; + this._secondsLevelMonitoringEnabled = config.secondsLevelMonitoringEnabled; + this._secondsLevelMonitoringPeriod = config.secondsLevelMonitoringPeriod; + this._securityGroupId = config.securityGroupId; + this._slowLogShowOriginalSwitch = config.slowLogShowOriginalSwitch; + this._sqlFilterEnabled = config.sqlFilterEnabled; + this._sslOption = config.sslOption; + this._subnetId = config.subnetId; + this._tableNameCaseSensitivity = config.tableNameCaseSensitivity; + this._tags = config.tags; + this._timeZone = config.timeZone; + this._volumeSize = config.volumeSize; + this._vpcId = config.vpcId; + this._autoScaling.internalValue = config.autoScaling; + this._backupStrategy.internalValue = config.backupStrategy; + this._datastore.internalValue = config.datastore; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // audit_log_enabled - computed: true, optional: true, required: false + private _auditLogEnabled?: boolean | cdktf.IResolvable; + public get auditLogEnabled() { + return this.getBooleanAttribute('audit_log_enabled'); + } + public set auditLogEnabled(value: boolean | cdktf.IResolvable) { + this._auditLogEnabled = value; + } + public resetAuditLogEnabled() { + this._auditLogEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get auditLogEnabledInput() { + return this._auditLogEnabled; + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone_mode - computed: false, optional: true, required: false + private _availabilityZoneMode?: string; + public get availabilityZoneMode() { + return this.getStringAttribute('availability_zone_mode'); + } + public set availabilityZoneMode(value: string) { + this._availabilityZoneMode = value; + } + public resetAvailabilityZoneMode() { + this._availabilityZoneMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneModeInput() { + return this._availabilityZoneMode; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // configuration_id - computed: true, optional: true, required: false + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + public resetConfigurationId() { + this._configurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // configuration_name - computed: true, optional: true, required: false + private _configurationName?: string; + public get configurationName() { + return this.getStringAttribute('configuration_name'); + } + public set configurationName(value: string) { + this._configurationName = value; + } + public resetConfigurationName() { + this._configurationName = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationNameInput() { + return this._configurationName; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // current_kernel_version - computed: true, optional: false, required: false + public get currentKernelVersion() { + return this.getStringAttribute('current_kernel_version'); + } + + // current_version - computed: true, optional: false, required: false + public get currentVersion() { + return this.getStringAttribute('current_version'); + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // dedicated_resource_id - computed: true, optional: true, required: false + private _dedicatedResourceId?: string; + public get dedicatedResourceId() { + return this.getStringAttribute('dedicated_resource_id'); + } + public set dedicatedResourceId(value: string) { + this._dedicatedResourceId = value; + } + public resetDedicatedResourceId() { + this._dedicatedResourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceIdInput() { + return this._dedicatedResourceId; + } + + // dedicated_resource_name - computed: true, optional: true, required: false + private _dedicatedResourceName?: string; + public get dedicatedResourceName() { + return this.getStringAttribute('dedicated_resource_name'); + } + public set dedicatedResourceName(value: string) { + this._dedicatedResourceName = value; + } + public resetDedicatedResourceName() { + this._dedicatedResourceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedResourceNameInput() { + return this._dedicatedResourceName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encryption_status - computed: true, optional: true, required: false + private _encryptionStatus?: string; + public get encryptionStatus() { + return this.getStringAttribute('encryption_status'); + } + public set encryptionStatus(value: string) { + this._encryptionStatus = value; + } + public resetEncryptionStatus() { + this._encryptionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionStatusInput() { + return this._encryptionStatus; + } + + // encryption_type - computed: false, optional: true, required: false + private _encryptionType?: string; + public get encryptionType() { + return this.getStringAttribute('encryption_type'); + } + public set encryptionType(value: string) { + this._encryptionType = value; + } + public resetEncryptionType() { + this._encryptionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionTypeInput() { + return this._encryptionType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // force_import - computed: false, optional: true, required: false + private _forceImport?: boolean | cdktf.IResolvable; + public get forceImport() { + return this.getBooleanAttribute('force_import'); + } + public set forceImport(value: boolean | cdktf.IResolvable) { + this._forceImport = value; + } + public resetForceImport() { + this._forceImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceImportInput() { + return this._forceImport; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kms_key_id - computed: false, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // master_availability_zone - computed: true, optional: true, required: false + private _masterAvailabilityZone?: string; + public get masterAvailabilityZone() { + return this.getStringAttribute('master_availability_zone'); + } + public set masterAvailabilityZone(value: string) { + this._masterAvailabilityZone = value; + } + public resetMasterAvailabilityZone() { + this._masterAvailabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterAvailabilityZoneInput() { + return this._masterAvailabilityZone; + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbMysqlInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_dns_name - computed: true, optional: false, required: false + public get privateDnsName() { + return this.getStringAttribute('private_dns_name'); + } + + // private_dns_name_prefix - computed: true, optional: true, required: false + private _privateDnsNamePrefix?: string; + public get privateDnsNamePrefix() { + return this.getStringAttribute('private_dns_name_prefix'); + } + public set privateDnsNamePrefix(value: string) { + this._privateDnsNamePrefix = value; + } + public resetPrivateDnsNamePrefix() { + this._privateDnsNamePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateDnsNamePrefixInput() { + return this._privateDnsNamePrefix; + } + + // private_write_ip - computed: true, optional: true, required: false + private _privateWriteIp?: string; + public get privateWriteIp() { + return this.getStringAttribute('private_write_ip'); + } + public set privateWriteIp(value: string) { + this._privateWriteIp = value; + } + public resetPrivateWriteIp() { + this._privateWriteIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateWriteIpInput() { + return this._privateWriteIp; + } + + // proxy_address - computed: true, optional: false, required: false + public get proxyAddress() { + return this.getStringAttribute('proxy_address'); + } + + // proxy_flavor - computed: true, optional: true, required: false + private _proxyFlavor?: string; + public get proxyFlavor() { + return this.getStringAttribute('proxy_flavor'); + } + public set proxyFlavor(value: string) { + this._proxyFlavor = value; + } + public resetProxyFlavor() { + this._proxyFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyFlavorInput() { + return this._proxyFlavor; + } + + // proxy_node_num - computed: true, optional: true, required: false + private _proxyNodeNum?: number; + public get proxyNodeNum() { + return this.getNumberAttribute('proxy_node_num'); + } + public set proxyNodeNum(value: number) { + this._proxyNodeNum = value; + } + public resetProxyNodeNum() { + this._proxyNodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyNodeNumInput() { + return this._proxyNodeNum; + } + + // proxy_port - computed: true, optional: false, required: false + public get proxyPort() { + return this.getNumberAttribute('proxy_port'); + } + + // read_replicas - computed: false, optional: true, required: false + private _readReplicas?: number; + public get readReplicas() { + return this.getNumberAttribute('read_replicas'); + } + public set readReplicas(value: number) { + this._readReplicas = value; + } + public resetReadReplicas() { + this._readReplicas = undefined; + } + // Temporarily expose input value. Use with caution. + public get readReplicasInput() { + return this._readReplicas; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // seconds_level_monitoring_enabled - computed: true, optional: true, required: false + private _secondsLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + public get secondsLevelMonitoringEnabled() { + return this.getBooleanAttribute('seconds_level_monitoring_enabled'); + } + public set secondsLevelMonitoringEnabled(value: boolean | cdktf.IResolvable) { + this._secondsLevelMonitoringEnabled = value; + } + public resetSecondsLevelMonitoringEnabled() { + this._secondsLevelMonitoringEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondsLevelMonitoringEnabledInput() { + return this._secondsLevelMonitoringEnabled; + } + + // seconds_level_monitoring_period - computed: false, optional: true, required: false + private _secondsLevelMonitoringPeriod?: number; + public get secondsLevelMonitoringPeriod() { + return this.getNumberAttribute('seconds_level_monitoring_period'); + } + public set secondsLevelMonitoringPeriod(value: number) { + this._secondsLevelMonitoringPeriod = value; + } + public resetSecondsLevelMonitoringPeriod() { + this._secondsLevelMonitoringPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondsLevelMonitoringPeriodInput() { + return this._secondsLevelMonitoringPeriod; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // slow_log_show_original_switch - computed: true, optional: true, required: false + private _slowLogShowOriginalSwitch?: boolean | cdktf.IResolvable; + public get slowLogShowOriginalSwitch() { + return this.getBooleanAttribute('slow_log_show_original_switch'); + } + public set slowLogShowOriginalSwitch(value: boolean | cdktf.IResolvable) { + this._slowLogShowOriginalSwitch = value; + } + public resetSlowLogShowOriginalSwitch() { + this._slowLogShowOriginalSwitch = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowLogShowOriginalSwitchInput() { + return this._slowLogShowOriginalSwitch; + } + + // sql_filter_enabled - computed: true, optional: true, required: false + private _sqlFilterEnabled?: boolean | cdktf.IResolvable; + public get sqlFilterEnabled() { + return this.getBooleanAttribute('sql_filter_enabled'); + } + public set sqlFilterEnabled(value: boolean | cdktf.IResolvable) { + this._sqlFilterEnabled = value; + } + public resetSqlFilterEnabled() { + this._sqlFilterEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlFilterEnabledInput() { + return this._sqlFilterEnabled; + } + + // ssl_option - computed: false, optional: true, required: false + private _sslOption?: string; + public get sslOption() { + return this.getStringAttribute('ssl_option'); + } + public set sslOption(value: string) { + this._sslOption = value; + } + public resetSslOption() { + this._sslOption = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslOptionInput() { + return this._sslOption; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // table_name_case_sensitivity - computed: false, optional: true, required: false + private _tableNameCaseSensitivity?: boolean | cdktf.IResolvable; + public get tableNameCaseSensitivity() { + return this.getBooleanAttribute('table_name_case_sensitivity'); + } + public set tableNameCaseSensitivity(value: boolean | cdktf.IResolvable) { + this._tableNameCaseSensitivity = value; + } + public resetTableNameCaseSensitivity() { + this._tableNameCaseSensitivity = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableNameCaseSensitivityInput() { + return this._tableNameCaseSensitivity; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // time_zone - computed: false, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // upgrade_flag - computed: true, optional: false, required: false + public get upgradeFlag() { + return this.getBooleanAttribute('upgrade_flag'); + } + + // volume_size - computed: true, optional: true, required: false + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + public resetVolumeSize() { + this._volumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // auto_scaling - computed: false, optional: true, required: false + private _autoScaling = new GaussdbMysqlInstanceAutoScalingOutputReference(this, "auto_scaling"); + public get autoScaling() { + return this._autoScaling; + } + public putAutoScaling(value: GaussdbMysqlInstanceAutoScaling) { + this._autoScaling.internalValue = value; + } + public resetAutoScaling() { + this._autoScaling.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoScalingInput() { + return this._autoScaling.internalValue; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new GaussdbMysqlInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: GaussdbMysqlInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // datastore - computed: false, optional: true, required: false + private _datastore = new GaussdbMysqlInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: GaussdbMysqlInstanceDatastore) { + this._datastore.internalValue = value; + } + public resetDatastore() { + this._datastore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new GaussdbMysqlInstanceParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: GaussdbMysqlInstanceParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + audit_log_enabled: cdktf.booleanToTerraform(this._auditLogEnabled), + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone_mode: cdktf.stringToTerraform(this._availabilityZoneMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + configuration_id: cdktf.stringToTerraform(this._configurationId), + configuration_name: cdktf.stringToTerraform(this._configurationName), + dedicated_resource_id: cdktf.stringToTerraform(this._dedicatedResourceId), + dedicated_resource_name: cdktf.stringToTerraform(this._dedicatedResourceName), + description: cdktf.stringToTerraform(this._description), + encryption_status: cdktf.stringToTerraform(this._encryptionStatus), + encryption_type: cdktf.stringToTerraform(this._encryptionType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + force_import: cdktf.booleanToTerraform(this._forceImport), + id: cdktf.stringToTerraform(this._id), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + master_availability_zone: cdktf.stringToTerraform(this._masterAvailabilityZone), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.numberToTerraform(this._port), + private_dns_name_prefix: cdktf.stringToTerraform(this._privateDnsNamePrefix), + private_write_ip: cdktf.stringToTerraform(this._privateWriteIp), + proxy_flavor: cdktf.stringToTerraform(this._proxyFlavor), + proxy_node_num: cdktf.numberToTerraform(this._proxyNodeNum), + read_replicas: cdktf.numberToTerraform(this._readReplicas), + region: cdktf.stringToTerraform(this._region), + seconds_level_monitoring_enabled: cdktf.booleanToTerraform(this._secondsLevelMonitoringEnabled), + seconds_level_monitoring_period: cdktf.numberToTerraform(this._secondsLevelMonitoringPeriod), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + slow_log_show_original_switch: cdktf.booleanToTerraform(this._slowLogShowOriginalSwitch), + sql_filter_enabled: cdktf.booleanToTerraform(this._sqlFilterEnabled), + ssl_option: cdktf.stringToTerraform(this._sslOption), + subnet_id: cdktf.stringToTerraform(this._subnetId), + table_name_case_sensitivity: cdktf.booleanToTerraform(this._tableNameCaseSensitivity), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + time_zone: cdktf.stringToTerraform(this._timeZone), + volume_size: cdktf.numberToTerraform(this._volumeSize), + vpc_id: cdktf.stringToTerraform(this._vpcId), + auto_scaling: gaussdbMysqlInstanceAutoScalingToTerraform(this._autoScaling.internalValue), + backup_strategy: gaussdbMysqlInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + datastore: gaussdbMysqlInstanceDatastoreToTerraform(this._datastore.internalValue), + parameters: cdktf.listMapper(gaussdbMysqlInstanceParametersToTerraform, true)(this._parameters.internalValue), + timeouts: gaussdbMysqlInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + audit_log_enabled: { + value: cdktf.booleanToHclTerraform(this._auditLogEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone_mode: { + value: cdktf.stringToHclTerraform(this._availabilityZoneMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_name: { + value: cdktf.stringToHclTerraform(this._configurationName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_id: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_resource_name: { + value: cdktf.stringToHclTerraform(this._dedicatedResourceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_status: { + value: cdktf.stringToHclTerraform(this._encryptionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_type: { + value: cdktf.stringToHclTerraform(this._encryptionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_import: { + value: cdktf.booleanToHclTerraform(this._forceImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + master_availability_zone: { + value: cdktf.stringToHclTerraform(this._masterAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + private_dns_name_prefix: { + value: cdktf.stringToHclTerraform(this._privateDnsNamePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_write_ip: { + value: cdktf.stringToHclTerraform(this._privateWriteIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_flavor: { + value: cdktf.stringToHclTerraform(this._proxyFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_node_num: { + value: cdktf.numberToHclTerraform(this._proxyNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + read_replicas: { + value: cdktf.numberToHclTerraform(this._readReplicas), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + seconds_level_monitoring_enabled: { + value: cdktf.booleanToHclTerraform(this._secondsLevelMonitoringEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + seconds_level_monitoring_period: { + value: cdktf.numberToHclTerraform(this._secondsLevelMonitoringPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slow_log_show_original_switch: { + value: cdktf.booleanToHclTerraform(this._slowLogShowOriginalSwitch), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + sql_filter_enabled: { + value: cdktf.booleanToHclTerraform(this._sqlFilterEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ssl_option: { + value: cdktf.stringToHclTerraform(this._sslOption), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_name_case_sensitivity: { + value: cdktf.booleanToHclTerraform(this._tableNameCaseSensitivity), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_scaling: { + value: gaussdbMysqlInstanceAutoScalingToHclTerraform(this._autoScaling.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlInstanceAutoScalingList", + }, + backup_strategy: { + value: gaussdbMysqlInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlInstanceBackupStrategyList", + }, + datastore: { + value: gaussdbMysqlInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlInstanceDatastoreList", + }, + parameters: { + value: cdktf.listMapperHcl(gaussdbMysqlInstanceParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "GaussdbMysqlInstanceParametersList", + }, + timeouts: { + value: gaussdbMysqlInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/README.md new file mode 100644 index 00000000..9e4d2579 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_instant_task_delete` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_instant_task_delete`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/index.ts new file mode 100644 index 00000000..97c03a5b --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-instant-task-delete/index.ts @@ -0,0 +1,169 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlInstantTaskDeleteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete#id GaussdbMysqlInstantTaskDelete#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete#job_id GaussdbMysqlInstantTaskDelete#job_id} + */ + readonly jobId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete#region GaussdbMysqlInstantTaskDelete#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete huaweicloud_gaussdb_mysql_instant_task_delete} +*/ +export class GaussdbMysqlInstantTaskDelete extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_instant_task_delete"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlInstantTaskDelete resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlInstantTaskDelete to import + * @param importFromId The id of the existing GaussdbMysqlInstantTaskDelete that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlInstantTaskDelete to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_instant_task_delete", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_instant_task_delete huaweicloud_gaussdb_mysql_instant_task_delete} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlInstantTaskDeleteConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlInstantTaskDeleteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_instant_task_delete', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._jobId = config.jobId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // job_id - computed: false, optional: false, required: true + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/README.md new file mode 100644 index 00000000..fdafd1df --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_lts_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_lts_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/index.ts new file mode 100644 index 00000000..9572d819 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-lts-log/index.ts @@ -0,0 +1,409 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlLtsLogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#id GaussdbMysqlLtsLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#instance_id GaussdbMysqlLtsLog#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the type of the LTS log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#log_type GaussdbMysqlLtsLog#log_type} + */ + readonly logType: string; + /** + * Specifies the ID of the LTS log group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#lts_group_id GaussdbMysqlLtsLog#lts_group_id} + */ + readonly ltsGroupId: string; + /** + * Specifies the ID of the LTS log stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#lts_stream_id GaussdbMysqlLtsLog#lts_stream_id} + */ + readonly ltsStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#region GaussdbMysqlLtsLog#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#timeouts GaussdbMysqlLtsLog#timeouts} + */ + readonly timeouts?: GaussdbMysqlLtsLogTimeouts; +} +export interface GaussdbMysqlLtsLogTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#create GaussdbMysqlLtsLog#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#delete GaussdbMysqlLtsLog#delete} + */ + readonly delete?: string; +} + +export function gaussdbMysqlLtsLogTimeoutsToTerraform(struct?: GaussdbMysqlLtsLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function gaussdbMysqlLtsLogTimeoutsToHclTerraform(struct?: GaussdbMysqlLtsLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlLtsLogTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlLtsLogTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlLtsLogTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log huaweicloud_gaussdb_mysql_lts_log} +*/ +export class GaussdbMysqlLtsLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_lts_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlLtsLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlLtsLog to import + * @param importFromId The id of the existing GaussdbMysqlLtsLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlLtsLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_lts_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_lts_log huaweicloud_gaussdb_mysql_lts_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlLtsLogConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlLtsLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_lts_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._logType = config.logType; + this._ltsGroupId = config.ltsGroupId; + this._ltsStreamId = config.ltsStreamId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // log_type - computed: false, optional: false, required: true + private _logType?: string; + public get logType() { + return this.getStringAttribute('log_type'); + } + public set logType(value: string) { + this._logType = value; + } + // Temporarily expose input value. Use with caution. + public get logTypeInput() { + return this._logType; + } + + // lts_group_id - computed: false, optional: false, required: true + private _ltsGroupId?: string; + public get ltsGroupId() { + return this.getStringAttribute('lts_group_id'); + } + public set ltsGroupId(value: string) { + this._ltsGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsGroupIdInput() { + return this._ltsGroupId; + } + + // lts_stream_id - computed: false, optional: false, required: true + private _ltsStreamId?: string; + public get ltsStreamId() { + return this.getStringAttribute('lts_stream_id'); + } + public set ltsStreamId(value: string) { + this._ltsStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsStreamIdInput() { + return this._ltsStreamId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlLtsLogTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlLtsLogTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + log_type: cdktf.stringToTerraform(this._logType), + lts_group_id: cdktf.stringToTerraform(this._ltsGroupId), + lts_stream_id: cdktf.stringToTerraform(this._ltsStreamId), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlLtsLogTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_type: { + value: cdktf.stringToHclTerraform(this._logType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_group_id: { + value: cdktf.stringToHclTerraform(this._ltsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlLtsLogTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlLtsLogTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/README.md new file mode 100644 index 00000000..33dc3879 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_parameter_template_apply` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_parameter_template_apply`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/index.ts new file mode 100644 index 00000000..2bda8621 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-apply/index.ts @@ -0,0 +1,322 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlParameterTemplateApplyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#configuration_id GaussdbMysqlParameterTemplateApply#configuration_id} + */ + readonly configurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#id GaussdbMysqlParameterTemplateApply#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#instance_id GaussdbMysqlParameterTemplateApply#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#region GaussdbMysqlParameterTemplateApply#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#timeouts GaussdbMysqlParameterTemplateApply#timeouts} + */ + readonly timeouts?: GaussdbMysqlParameterTemplateApplyTimeouts; +} +export interface GaussdbMysqlParameterTemplateApplyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#create GaussdbMysqlParameterTemplateApply#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlParameterTemplateApplyTimeoutsToTerraform(struct?: GaussdbMysqlParameterTemplateApplyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlParameterTemplateApplyTimeoutsToHclTerraform(struct?: GaussdbMysqlParameterTemplateApplyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlParameterTemplateApplyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlParameterTemplateApplyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlParameterTemplateApplyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply huaweicloud_gaussdb_mysql_parameter_template_apply} +*/ +export class GaussdbMysqlParameterTemplateApply extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_parameter_template_apply"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlParameterTemplateApply resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlParameterTemplateApply to import + * @param importFromId The id of the existing GaussdbMysqlParameterTemplateApply that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlParameterTemplateApply to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_parameter_template_apply", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_apply huaweicloud_gaussdb_mysql_parameter_template_apply} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlParameterTemplateApplyConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlParameterTemplateApplyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_parameter_template_apply', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._configurationId = config.configurationId; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_id - computed: false, optional: false, required: true + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlParameterTemplateApplyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlParameterTemplateApplyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + configuration_id: cdktf.stringToTerraform(this._configurationId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlParameterTemplateApplyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlParameterTemplateApplyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlParameterTemplateApplyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/README.md new file mode 100644 index 00000000..ba77e654 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_parameter_template_compare` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_parameter_template_compare`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/index.ts new file mode 100644 index 00000000..18521c80 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template-compare/index.ts @@ -0,0 +1,409 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlParameterTemplateCompareConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#id GaussdbMysqlParameterTemplateCompare#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#region GaussdbMysqlParameterTemplateCompare#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#source_configuration_id GaussdbMysqlParameterTemplateCompare#source_configuration_id} + */ + readonly sourceConfigurationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#target_configuration_id GaussdbMysqlParameterTemplateCompare#target_configuration_id} + */ + readonly targetConfigurationId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#timeouts GaussdbMysqlParameterTemplateCompare#timeouts} + */ + readonly timeouts?: GaussdbMysqlParameterTemplateCompareTimeouts; +} +export interface GaussdbMysqlParameterTemplateCompareDifferences { +} + +export function gaussdbMysqlParameterTemplateCompareDifferencesToTerraform(struct?: GaussdbMysqlParameterTemplateCompareDifferences): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbMysqlParameterTemplateCompareDifferencesToHclTerraform(struct?: GaussdbMysqlParameterTemplateCompareDifferences): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbMysqlParameterTemplateCompareDifferencesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlParameterTemplateCompareDifferences | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlParameterTemplateCompareDifferences | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // parameter_name - computed: true, optional: false, required: false + public get parameterName() { + return this.getStringAttribute('parameter_name'); + } + + // source_value - computed: true, optional: false, required: false + public get sourceValue() { + return this.getStringAttribute('source_value'); + } + + // target_value - computed: true, optional: false, required: false + public get targetValue() { + return this.getStringAttribute('target_value'); + } +} + +export class GaussdbMysqlParameterTemplateCompareDifferencesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlParameterTemplateCompareDifferencesOutputReference { + return new GaussdbMysqlParameterTemplateCompareDifferencesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlParameterTemplateCompareTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#create GaussdbMysqlParameterTemplateCompare#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlParameterTemplateCompareTimeoutsToTerraform(struct?: GaussdbMysqlParameterTemplateCompareTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlParameterTemplateCompareTimeoutsToHclTerraform(struct?: GaussdbMysqlParameterTemplateCompareTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlParameterTemplateCompareTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlParameterTemplateCompareTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlParameterTemplateCompareTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare huaweicloud_gaussdb_mysql_parameter_template_compare} +*/ +export class GaussdbMysqlParameterTemplateCompare extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_parameter_template_compare"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlParameterTemplateCompare resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlParameterTemplateCompare to import + * @param importFromId The id of the existing GaussdbMysqlParameterTemplateCompare that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlParameterTemplateCompare to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_parameter_template_compare", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template_compare huaweicloud_gaussdb_mysql_parameter_template_compare} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlParameterTemplateCompareConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlParameterTemplateCompareConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_parameter_template_compare', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._sourceConfigurationId = config.sourceConfigurationId; + this._targetConfigurationId = config.targetConfigurationId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // differences - computed: true, optional: false, required: false + private _differences = new GaussdbMysqlParameterTemplateCompareDifferencesList(this, "differences", false); + public get differences() { + return this._differences; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_configuration_id - computed: false, optional: false, required: true + private _sourceConfigurationId?: string; + public get sourceConfigurationId() { + return this.getStringAttribute('source_configuration_id'); + } + public set sourceConfigurationId(value: string) { + this._sourceConfigurationId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceConfigurationIdInput() { + return this._sourceConfigurationId; + } + + // target_configuration_id - computed: false, optional: false, required: true + private _targetConfigurationId?: string; + public get targetConfigurationId() { + return this.getStringAttribute('target_configuration_id'); + } + public set targetConfigurationId(value: string) { + this._targetConfigurationId = value; + } + // Temporarily expose input value. Use with caution. + public get targetConfigurationIdInput() { + return this._targetConfigurationId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlParameterTemplateCompareTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlParameterTemplateCompareTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + source_configuration_id: cdktf.stringToTerraform(this._sourceConfigurationId), + target_configuration_id: cdktf.stringToTerraform(this._targetConfigurationId), + timeouts: gaussdbMysqlParameterTemplateCompareTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_configuration_id: { + value: cdktf.stringToHclTerraform(this._sourceConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_configuration_id: { + value: cdktf.stringToHclTerraform(this._targetConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlParameterTemplateCompareTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlParameterTemplateCompareTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/README.md new file mode 100644 index 00000000..8f112e31 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_parameter_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_parameter_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/index.ts new file mode 100644 index 00000000..0c302c3b --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-parameter-template/index.ts @@ -0,0 +1,391 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlParameterTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the DB engine. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#datastore_engine GaussdbMysqlParameterTemplate#datastore_engine} + */ + readonly datastoreEngine?: string; + /** + * Specifies the DB version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#datastore_version GaussdbMysqlParameterTemplate#datastore_version} + */ + readonly datastoreVersion?: string; + /** + * Specifies the parameter template description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#description GaussdbMysqlParameterTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#id GaussdbMysqlParameterTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the parameter template ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#instance_configuration_id GaussdbMysqlParameterTemplate#instance_configuration_id} + */ + readonly instanceConfigurationId?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#instance_id GaussdbMysqlParameterTemplate#instance_id} + */ + readonly instanceId?: string; + /** + * Specifies the parameter template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#name GaussdbMysqlParameterTemplate#name} + */ + readonly name: string; + /** + * Specifies the mapping between parameter names and parameter values. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#parameter_values GaussdbMysqlParameterTemplate#parameter_values} + */ + readonly parameterValues?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#region GaussdbMysqlParameterTemplate#region} + */ + readonly region?: string; + /** + * Specifies the source parameter template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#source_configuration_id GaussdbMysqlParameterTemplate#source_configuration_id} + */ + readonly sourceConfigurationId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template huaweicloud_gaussdb_mysql_parameter_template} +*/ +export class GaussdbMysqlParameterTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_parameter_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlParameterTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlParameterTemplate to import + * @param importFromId The id of the existing GaussdbMysqlParameterTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlParameterTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_parameter_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_parameter_template huaweicloud_gaussdb_mysql_parameter_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlParameterTemplateConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlParameterTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_parameter_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datastoreEngine = config.datastoreEngine; + this._datastoreVersion = config.datastoreVersion; + this._description = config.description; + this._id = config.id; + this._instanceConfigurationId = config.instanceConfigurationId; + this._instanceId = config.instanceId; + this._name = config.name; + this._parameterValues = config.parameterValues; + this._region = config.region; + this._sourceConfigurationId = config.sourceConfigurationId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // datastore_engine - computed: true, optional: true, required: false + private _datastoreEngine?: string; + public get datastoreEngine() { + return this.getStringAttribute('datastore_engine'); + } + public set datastoreEngine(value: string) { + this._datastoreEngine = value; + } + public resetDatastoreEngine() { + this._datastoreEngine = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreEngineInput() { + return this._datastoreEngine; + } + + // datastore_version - computed: true, optional: true, required: false + private _datastoreVersion?: string; + public get datastoreVersion() { + return this.getStringAttribute('datastore_version'); + } + public set datastoreVersion(value: string) { + this._datastoreVersion = value; + } + public resetDatastoreVersion() { + this._datastoreVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreVersionInput() { + return this._datastoreVersion; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_configuration_id - computed: false, optional: true, required: false + private _instanceConfigurationId?: string; + public get instanceConfigurationId() { + return this.getStringAttribute('instance_configuration_id'); + } + public set instanceConfigurationId(value: string) { + this._instanceConfigurationId = value; + } + public resetInstanceConfigurationId() { + this._instanceConfigurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceConfigurationIdInput() { + return this._instanceConfigurationId; + } + + // instance_id - computed: false, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parameter_values - computed: true, optional: true, required: false + private _parameterValues?: { [key: string]: string }; + public get parameterValues() { + return this.getStringMapAttribute('parameter_values'); + } + public set parameterValues(value: { [key: string]: string }) { + this._parameterValues = value; + } + public resetParameterValues() { + this._parameterValues = undefined; + } + // Temporarily expose input value. Use with caution. + public get parameterValuesInput() { + return this._parameterValues; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_configuration_id - computed: false, optional: true, required: false + private _sourceConfigurationId?: string; + public get sourceConfigurationId() { + return this.getStringAttribute('source_configuration_id'); + } + public set sourceConfigurationId(value: string) { + this._sourceConfigurationId = value; + } + public resetSourceConfigurationId() { + this._sourceConfigurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceConfigurationIdInput() { + return this._sourceConfigurationId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + datastore_engine: cdktf.stringToTerraform(this._datastoreEngine), + datastore_version: cdktf.stringToTerraform(this._datastoreVersion), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_configuration_id: cdktf.stringToTerraform(this._instanceConfigurationId), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + parameter_values: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameterValues), + region: cdktf.stringToTerraform(this._region), + source_configuration_id: cdktf.stringToTerraform(this._sourceConfigurationId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + datastore_engine: { + value: cdktf.stringToHclTerraform(this._datastoreEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + datastore_version: { + value: cdktf.stringToHclTerraform(this._datastoreVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_configuration_id: { + value: cdktf.stringToHclTerraform(this._instanceConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameter_values: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._parameterValues), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_configuration_id: { + value: cdktf.stringToHclTerraform(this._sourceConfigurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/README.md new file mode 100644 index 00000000..eb2b6fd8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_proxy_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_proxy_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/index.ts new file mode 100644 index 00000000..23a14435 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy-restart/index.ts @@ -0,0 +1,318 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlProxyRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#id GaussdbMysqlProxyRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#instance_id GaussdbMysqlProxyRestart#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#proxy_id GaussdbMysqlProxyRestart#proxy_id} + */ + readonly proxyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#region GaussdbMysqlProxyRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#timeouts GaussdbMysqlProxyRestart#timeouts} + */ + readonly timeouts?: GaussdbMysqlProxyRestartTimeouts; +} +export interface GaussdbMysqlProxyRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#create GaussdbMysqlProxyRestart#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlProxyRestartTimeoutsToTerraform(struct?: GaussdbMysqlProxyRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlProxyRestartTimeoutsToHclTerraform(struct?: GaussdbMysqlProxyRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlProxyRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlProxyRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart huaweicloud_gaussdb_mysql_proxy_restart} +*/ +export class GaussdbMysqlProxyRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_proxy_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlProxyRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlProxyRestart to import + * @param importFromId The id of the existing GaussdbMysqlProxyRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlProxyRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_proxy_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy_restart huaweicloud_gaussdb_mysql_proxy_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlProxyRestartConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlProxyRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_proxy_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._proxyId = config.proxyId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // proxy_id - computed: false, optional: false, required: true + private _proxyId?: string; + public get proxyId() { + return this.getStringAttribute('proxy_id'); + } + public set proxyId(value: string) { + this._proxyId = value; + } + // Temporarily expose input value. Use with caution. + public get proxyIdInput() { + return this._proxyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlProxyRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlProxyRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + proxy_id: cdktf.stringToTerraform(this._proxyId), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbMysqlProxyRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_id: { + value: cdktf.stringToHclTerraform(this._proxyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlProxyRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlProxyRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/README.md new file mode 100644 index 00000000..edf59326 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_proxy` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_proxy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/index.ts new file mode 100644 index 00000000..c476ace9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-proxy/index.ts @@ -0,0 +1,1570 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlProxyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#access_control_type GaussdbMysqlProxy#access_control_type} + */ + readonly accessControlType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#connection_pool_type GaussdbMysqlProxy#connection_pool_type} + */ + readonly connectionPoolType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#consistence_mode GaussdbMysqlProxy#consistence_mode} + */ + readonly consistenceMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#flavor GaussdbMysqlProxy#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#id GaussdbMysqlProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#instance_id GaussdbMysqlProxy#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#new_node_auto_add_status GaussdbMysqlProxy#new_node_auto_add_status} + */ + readonly newNodeAutoAddStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#new_node_weight GaussdbMysqlProxy#new_node_weight} + */ + readonly newNodeWeight?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#node_num GaussdbMysqlProxy#node_num} + */ + readonly nodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#open_access_control GaussdbMysqlProxy#open_access_control} + */ + readonly openAccessControl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#port GaussdbMysqlProxy#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#proxy_mode GaussdbMysqlProxy#proxy_mode} + */ + readonly proxyMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#proxy_name GaussdbMysqlProxy#proxy_name} + */ + readonly proxyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#region GaussdbMysqlProxy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#route_mode GaussdbMysqlProxy#route_mode} + */ + readonly routeMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#subnet_id GaussdbMysqlProxy#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#transaction_split GaussdbMysqlProxy#transaction_split} + */ + readonly transactionSplit?: string; + /** + * access_control_ip_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#access_control_ip_list GaussdbMysqlProxy#access_control_ip_list} + */ + readonly accessControlIpList?: GaussdbMysqlProxyAccessControlIpListStruct[] | cdktf.IResolvable; + /** + * master_node_weight block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#master_node_weight GaussdbMysqlProxy#master_node_weight} + */ + readonly masterNodeWeight?: GaussdbMysqlProxyMasterNodeWeight; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#parameters GaussdbMysqlProxy#parameters} + */ + readonly parameters?: GaussdbMysqlProxyParameters[] | cdktf.IResolvable; + /** + * readonly_nodes_weight block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#readonly_nodes_weight GaussdbMysqlProxy#readonly_nodes_weight} + */ + readonly readonlyNodesWeight?: GaussdbMysqlProxyReadonlyNodesWeight[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#timeouts GaussdbMysqlProxy#timeouts} + */ + readonly timeouts?: GaussdbMysqlProxyTimeouts; +} +export interface GaussdbMysqlProxyNodes { +} + +export function gaussdbMysqlProxyNodesToTerraform(struct?: GaussdbMysqlProxyNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbMysqlProxyNodesToHclTerraform(struct?: GaussdbMysqlProxyNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbMysqlProxyNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlProxyNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // frozen_flag - computed: true, optional: false, required: false + public get frozenFlag() { + return this.getNumberAttribute('frozen_flag'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class GaussdbMysqlProxyNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlProxyNodesOutputReference { + return new GaussdbMysqlProxyNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlProxyAccessControlIpListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#description GaussdbMysqlProxy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#ip GaussdbMysqlProxy#ip} + */ + readonly ip: string; +} + +export function gaussdbMysqlProxyAccessControlIpListStructToTerraform(struct?: GaussdbMysqlProxyAccessControlIpListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + ip: cdktf.stringToTerraform(struct!.ip), + } +} + + +export function gaussdbMysqlProxyAccessControlIpListStructToHclTerraform(struct?: GaussdbMysqlProxyAccessControlIpListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlProxyAccessControlIpListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlProxyAccessControlIpListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyAccessControlIpListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._ip = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._ip = value.ip; + } + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } +} + +export class GaussdbMysqlProxyAccessControlIpListStructList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlProxyAccessControlIpListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlProxyAccessControlIpListStructOutputReference { + return new GaussdbMysqlProxyAccessControlIpListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlProxyMasterNodeWeight { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#id GaussdbMysqlProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#weight GaussdbMysqlProxy#weight} + */ + readonly weight: number; +} + +export function gaussdbMysqlProxyMasterNodeWeightToTerraform(struct?: GaussdbMysqlProxyMasterNodeWeightOutputReference | GaussdbMysqlProxyMasterNodeWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function gaussdbMysqlProxyMasterNodeWeightToHclTerraform(struct?: GaussdbMysqlProxyMasterNodeWeightOutputReference | GaussdbMysqlProxyMasterNodeWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlProxyMasterNodeWeightOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbMysqlProxyMasterNodeWeight | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyMasterNodeWeight | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._id = undefined; + this._weight = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._id = value.id; + this._weight = value.weight; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // weight - computed: false, optional: false, required: true + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} +export interface GaussdbMysqlProxyParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#elem_type GaussdbMysqlProxy#elem_type} + */ + readonly elemType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#name GaussdbMysqlProxy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#value GaussdbMysqlProxy#value} + */ + readonly value: string; +} + +export function gaussdbMysqlProxyParametersToTerraform(struct?: GaussdbMysqlProxyParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + elem_type: cdktf.stringToTerraform(struct!.elemType), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function gaussdbMysqlProxyParametersToHclTerraform(struct?: GaussdbMysqlProxyParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + elem_type: { + value: cdktf.stringToHclTerraform(struct!.elemType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlProxyParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlProxyParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._elemType !== undefined) { + hasAnyValues = true; + internalValueResult.elemType = this._elemType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._elemType = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._elemType = value.elemType; + this._name = value.name; + this._value = value.value; + } + } + + // elem_type - computed: false, optional: false, required: true + private _elemType?: string; + public get elemType() { + return this.getStringAttribute('elem_type'); + } + public set elemType(value: string) { + this._elemType = value; + } + // Temporarily expose input value. Use with caution. + public get elemTypeInput() { + return this._elemType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class GaussdbMysqlProxyParametersList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlProxyParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlProxyParametersOutputReference { + return new GaussdbMysqlProxyParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlProxyReadonlyNodesWeight { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#id GaussdbMysqlProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#weight GaussdbMysqlProxy#weight} + */ + readonly weight: number; +} + +export function gaussdbMysqlProxyReadonlyNodesWeightToTerraform(struct?: GaussdbMysqlProxyReadonlyNodesWeight | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function gaussdbMysqlProxyReadonlyNodesWeightToHclTerraform(struct?: GaussdbMysqlProxyReadonlyNodesWeight | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlProxyReadonlyNodesWeightOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlProxyReadonlyNodesWeight | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyReadonlyNodesWeight | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._weight = value.weight; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // weight - computed: false, optional: false, required: true + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class GaussdbMysqlProxyReadonlyNodesWeightList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlProxyReadonlyNodesWeight[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlProxyReadonlyNodesWeightOutputReference { + return new GaussdbMysqlProxyReadonlyNodesWeightOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlProxyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#create GaussdbMysqlProxy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#delete GaussdbMysqlProxy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#update GaussdbMysqlProxy#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlProxyTimeoutsToTerraform(struct?: GaussdbMysqlProxyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlProxyTimeoutsToHclTerraform(struct?: GaussdbMysqlProxyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlProxyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlProxyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlProxyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy huaweicloud_gaussdb_mysql_proxy} +*/ +export class GaussdbMysqlProxy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_proxy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlProxy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlProxy to import + * @param importFromId The id of the existing GaussdbMysqlProxy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlProxy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_proxy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_proxy huaweicloud_gaussdb_mysql_proxy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlProxyConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlProxyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_proxy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessControlType = config.accessControlType; + this._connectionPoolType = config.connectionPoolType; + this._consistenceMode = config.consistenceMode; + this._flavor = config.flavor; + this._id = config.id; + this._instanceId = config.instanceId; + this._newNodeAutoAddStatus = config.newNodeAutoAddStatus; + this._newNodeWeight = config.newNodeWeight; + this._nodeNum = config.nodeNum; + this._openAccessControl = config.openAccessControl; + this._port = config.port; + this._proxyMode = config.proxyMode; + this._proxyName = config.proxyName; + this._region = config.region; + this._routeMode = config.routeMode; + this._subnetId = config.subnetId; + this._transactionSplit = config.transactionSplit; + this._accessControlIpList.internalValue = config.accessControlIpList; + this._masterNodeWeight.internalValue = config.masterNodeWeight; + this._parameters.internalValue = config.parameters; + this._readonlyNodesWeight.internalValue = config.readonlyNodesWeight; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_control_type - computed: true, optional: true, required: false + private _accessControlType?: string; + public get accessControlType() { + return this.getStringAttribute('access_control_type'); + } + public set accessControlType(value: string) { + this._accessControlType = value; + } + public resetAccessControlType() { + this._accessControlType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessControlTypeInput() { + return this._accessControlType; + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // can_upgrade - computed: true, optional: false, required: false + public get canUpgrade() { + return this.getBooleanAttribute('can_upgrade'); + } + + // connection_pool_type - computed: true, optional: true, required: false + private _connectionPoolType?: string; + public get connectionPoolType() { + return this.getStringAttribute('connection_pool_type'); + } + public set connectionPoolType(value: string) { + this._connectionPoolType = value; + } + public resetConnectionPoolType() { + this._connectionPoolType = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionPoolTypeInput() { + return this._connectionPoolType; + } + + // consistence_mode - computed: true, optional: true, required: false + private _consistenceMode?: string; + public get consistenceMode() { + return this.getStringAttribute('consistence_mode'); + } + public set consistenceMode(value: string) { + this._consistenceMode = value; + } + public resetConsistenceMode() { + this._consistenceMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistenceModeInput() { + return this._consistenceMode; + } + + // current_version - computed: true, optional: false, required: false + public get currentVersion() { + return this.getStringAttribute('current_version'); + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // new_node_auto_add_status - computed: true, optional: true, required: false + private _newNodeAutoAddStatus?: string; + public get newNodeAutoAddStatus() { + return this.getStringAttribute('new_node_auto_add_status'); + } + public set newNodeAutoAddStatus(value: string) { + this._newNodeAutoAddStatus = value; + } + public resetNewNodeAutoAddStatus() { + this._newNodeAutoAddStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get newNodeAutoAddStatusInput() { + return this._newNodeAutoAddStatus; + } + + // new_node_weight - computed: false, optional: true, required: false + private _newNodeWeight?: number; + public get newNodeWeight() { + return this.getNumberAttribute('new_node_weight'); + } + public set newNodeWeight(value: number) { + this._newNodeWeight = value; + } + public resetNewNodeWeight() { + this._newNodeWeight = undefined; + } + // Temporarily expose input value. Use with caution. + public get newNodeWeightInput() { + return this._newNodeWeight; + } + + // node_num - computed: false, optional: false, required: true + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbMysqlProxyNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // open_access_control - computed: true, optional: true, required: false + private _openAccessControl?: boolean | cdktf.IResolvable; + public get openAccessControl() { + return this.getBooleanAttribute('open_access_control'); + } + public set openAccessControl(value: boolean | cdktf.IResolvable) { + this._openAccessControl = value; + } + public resetOpenAccessControl() { + this._openAccessControl = undefined; + } + // Temporarily expose input value. Use with caution. + public get openAccessControlInput() { + return this._openAccessControl; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // proxy_mode - computed: false, optional: true, required: false + private _proxyMode?: string; + public get proxyMode() { + return this.getStringAttribute('proxy_mode'); + } + public set proxyMode(value: string) { + this._proxyMode = value; + } + public resetProxyMode() { + this._proxyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyModeInput() { + return this._proxyMode; + } + + // proxy_name - computed: true, optional: true, required: false + private _proxyName?: string; + public get proxyName() { + return this.getStringAttribute('proxy_name'); + } + public set proxyName(value: string) { + this._proxyName = value; + } + public resetProxyName() { + this._proxyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyNameInput() { + return this._proxyName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_mode - computed: true, optional: true, required: false + private _routeMode?: number; + public get routeMode() { + return this.getNumberAttribute('route_mode'); + } + public set routeMode(value: number) { + this._routeMode = value; + } + public resetRouteMode() { + this._routeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeModeInput() { + return this._routeMode; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // switch_connection_pool_type_enabled - computed: true, optional: false, required: false + public get switchConnectionPoolTypeEnabled() { + return this.getBooleanAttribute('switch_connection_pool_type_enabled'); + } + + // transaction_split - computed: true, optional: true, required: false + private _transactionSplit?: string; + public get transactionSplit() { + return this.getStringAttribute('transaction_split'); + } + public set transactionSplit(value: string) { + this._transactionSplit = value; + } + public resetTransactionSplit() { + this._transactionSplit = undefined; + } + // Temporarily expose input value. Use with caution. + public get transactionSplitInput() { + return this._transactionSplit; + } + + // access_control_ip_list - computed: false, optional: true, required: false + private _accessControlIpList = new GaussdbMysqlProxyAccessControlIpListStructList(this, "access_control_ip_list", true); + public get accessControlIpList() { + return this._accessControlIpList; + } + public putAccessControlIpList(value: GaussdbMysqlProxyAccessControlIpListStruct[] | cdktf.IResolvable) { + this._accessControlIpList.internalValue = value; + } + public resetAccessControlIpList() { + this._accessControlIpList.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessControlIpListInput() { + return this._accessControlIpList.internalValue; + } + + // master_node_weight - computed: false, optional: true, required: false + private _masterNodeWeight = new GaussdbMysqlProxyMasterNodeWeightOutputReference(this, "master_node_weight"); + public get masterNodeWeight() { + return this._masterNodeWeight; + } + public putMasterNodeWeight(value: GaussdbMysqlProxyMasterNodeWeight) { + this._masterNodeWeight.internalValue = value; + } + public resetMasterNodeWeight() { + this._masterNodeWeight.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterNodeWeightInput() { + return this._masterNodeWeight.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new GaussdbMysqlProxyParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: GaussdbMysqlProxyParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // readonly_nodes_weight - computed: false, optional: true, required: false + private _readonlyNodesWeight = new GaussdbMysqlProxyReadonlyNodesWeightList(this, "readonly_nodes_weight", true); + public get readonlyNodesWeight() { + return this._readonlyNodesWeight; + } + public putReadonlyNodesWeight(value: GaussdbMysqlProxyReadonlyNodesWeight[] | cdktf.IResolvable) { + this._readonlyNodesWeight.internalValue = value; + } + public resetReadonlyNodesWeight() { + this._readonlyNodesWeight.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyNodesWeightInput() { + return this._readonlyNodesWeight.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlProxyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlProxyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_control_type: cdktf.stringToTerraform(this._accessControlType), + connection_pool_type: cdktf.stringToTerraform(this._connectionPoolType), + consistence_mode: cdktf.stringToTerraform(this._consistenceMode), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + new_node_auto_add_status: cdktf.stringToTerraform(this._newNodeAutoAddStatus), + new_node_weight: cdktf.numberToTerraform(this._newNodeWeight), + node_num: cdktf.numberToTerraform(this._nodeNum), + open_access_control: cdktf.booleanToTerraform(this._openAccessControl), + port: cdktf.numberToTerraform(this._port), + proxy_mode: cdktf.stringToTerraform(this._proxyMode), + proxy_name: cdktf.stringToTerraform(this._proxyName), + region: cdktf.stringToTerraform(this._region), + route_mode: cdktf.numberToTerraform(this._routeMode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + transaction_split: cdktf.stringToTerraform(this._transactionSplit), + access_control_ip_list: cdktf.listMapper(gaussdbMysqlProxyAccessControlIpListStructToTerraform, true)(this._accessControlIpList.internalValue), + master_node_weight: gaussdbMysqlProxyMasterNodeWeightToTerraform(this._masterNodeWeight.internalValue), + parameters: cdktf.listMapper(gaussdbMysqlProxyParametersToTerraform, true)(this._parameters.internalValue), + readonly_nodes_weight: cdktf.listMapper(gaussdbMysqlProxyReadonlyNodesWeightToTerraform, true)(this._readonlyNodesWeight.internalValue), + timeouts: gaussdbMysqlProxyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_control_type: { + value: cdktf.stringToHclTerraform(this._accessControlType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_pool_type: { + value: cdktf.stringToHclTerraform(this._connectionPoolType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consistence_mode: { + value: cdktf.stringToHclTerraform(this._consistenceMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + new_node_auto_add_status: { + value: cdktf.stringToHclTerraform(this._newNodeAutoAddStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + new_node_weight: { + value: cdktf.numberToHclTerraform(this._newNodeWeight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + open_access_control: { + value: cdktf.booleanToHclTerraform(this._openAccessControl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + proxy_mode: { + value: cdktf.stringToHclTerraform(this._proxyMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_name: { + value: cdktf.stringToHclTerraform(this._proxyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_mode: { + value: cdktf.numberToHclTerraform(this._routeMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transaction_split: { + value: cdktf.stringToHclTerraform(this._transactionSplit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_control_ip_list: { + value: cdktf.listMapperHcl(gaussdbMysqlProxyAccessControlIpListStructToHclTerraform, true)(this._accessControlIpList.internalValue), + isBlock: true, + type: "set", + storageClassType: "GaussdbMysqlProxyAccessControlIpListStructList", + }, + master_node_weight: { + value: gaussdbMysqlProxyMasterNodeWeightToHclTerraform(this._masterNodeWeight.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlProxyMasterNodeWeightList", + }, + parameters: { + value: cdktf.listMapperHcl(gaussdbMysqlProxyParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "GaussdbMysqlProxyParametersList", + }, + readonly_nodes_weight: { + value: cdktf.listMapperHcl(gaussdbMysqlProxyReadonlyNodesWeightToHclTerraform, true)(this._readonlyNodesWeight.internalValue), + isBlock: true, + type: "set", + storageClassType: "GaussdbMysqlProxyReadonlyNodesWeightList", + }, + timeouts: { + value: gaussdbMysqlProxyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlProxyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-quota/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-quota/README.md new file mode 100644 index 00000000..0fa9789a --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-quota/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_quota` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_quota`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-quota/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-quota/index.ts new file mode 100644 index 00000000..d3d736c4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-quota/index.ts @@ -0,0 +1,273 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlQuotaConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#enterprise_project_id GaussdbMysqlQuota#enterprise_project_id} + */ + readonly enterpriseProjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#id GaussdbMysqlQuota#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#instance_quota GaussdbMysqlQuota#instance_quota} + */ + readonly instanceQuota?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#ram_quota GaussdbMysqlQuota#ram_quota} + */ + readonly ramQuota?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#region GaussdbMysqlQuota#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#vcpus_quota GaussdbMysqlQuota#vcpus_quota} + */ + readonly vcpusQuota?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota huaweicloud_gaussdb_mysql_quota} +*/ +export class GaussdbMysqlQuota extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_quota"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlQuota resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlQuota to import + * @param importFromId The id of the existing GaussdbMysqlQuota that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlQuota to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_quota", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_quota huaweicloud_gaussdb_mysql_quota} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlQuotaConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlQuotaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_quota', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceQuota = config.instanceQuota; + this._ramQuota = config.ramQuota; + this._region = config.region; + this._vcpusQuota = config.vcpusQuota; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_instance_quota - computed: true, optional: false, required: false + public get availabilityInstanceQuota() { + return this.getNumberAttribute('availability_instance_quota'); + } + + // availability_ram_quota - computed: true, optional: false, required: false + public get availabilityRamQuota() { + return this.getNumberAttribute('availability_ram_quota'); + } + + // availability_vcpus_quota - computed: true, optional: false, required: false + public get availabilityVcpusQuota() { + return this.getNumberAttribute('availability_vcpus_quota'); + } + + // enterprise_project_id - computed: false, optional: false, required: true + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // enterprise_project_name - computed: true, optional: false, required: false + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_quota - computed: false, optional: true, required: false + private _instanceQuota?: number; + public get instanceQuota() { + return this.getNumberAttribute('instance_quota'); + } + public set instanceQuota(value: number) { + this._instanceQuota = value; + } + public resetInstanceQuota() { + this._instanceQuota = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceQuotaInput() { + return this._instanceQuota; + } + + // ram_quota - computed: false, optional: true, required: false + private _ramQuota?: number; + public get ramQuota() { + return this.getNumberAttribute('ram_quota'); + } + public set ramQuota(value: number) { + this._ramQuota = value; + } + public resetRamQuota() { + this._ramQuota = undefined; + } + // Temporarily expose input value. Use with caution. + public get ramQuotaInput() { + return this._ramQuota; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vcpus_quota - computed: false, optional: true, required: false + private _vcpusQuota?: number; + public get vcpusQuota() { + return this.getNumberAttribute('vcpus_quota'); + } + public set vcpusQuota(value: number) { + this._vcpusQuota = value; + } + public resetVcpusQuota() { + this._vcpusQuota = undefined; + } + // Temporarily expose input value. Use with caution. + public get vcpusQuotaInput() { + return this._vcpusQuota; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_quota: cdktf.numberToTerraform(this._instanceQuota), + ram_quota: cdktf.numberToTerraform(this._ramQuota), + region: cdktf.stringToTerraform(this._region), + vcpus_quota: cdktf.numberToTerraform(this._vcpusQuota), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_quota: { + value: cdktf.numberToHclTerraform(this._instanceQuota), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ram_quota: { + value: cdktf.numberToHclTerraform(this._ramQuota), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vcpus_quota: { + value: cdktf.numberToHclTerraform(this._vcpusQuota), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/README.md new file mode 100644 index 00000000..91fda85f --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_recycling_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_recycling_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/index.ts new file mode 100644 index 00000000..988cb6fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-recycling-policy/index.ts @@ -0,0 +1,169 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlRecyclingPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy#id GaussdbMysqlRecyclingPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy#region GaussdbMysqlRecyclingPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy#retention_period_in_days GaussdbMysqlRecyclingPolicy#retention_period_in_days} + */ + readonly retentionPeriodInDays: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy huaweicloud_gaussdb_mysql_recycling_policy} +*/ +export class GaussdbMysqlRecyclingPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_recycling_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlRecyclingPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlRecyclingPolicy to import + * @param importFromId The id of the existing GaussdbMysqlRecyclingPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlRecyclingPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_recycling_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_recycling_policy huaweicloud_gaussdb_mysql_recycling_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlRecyclingPolicyConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlRecyclingPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_recycling_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._retentionPeriodInDays = config.retentionPeriodInDays; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retention_period_in_days - computed: false, optional: false, required: true + private _retentionPeriodInDays?: string; + public get retentionPeriodInDays() { + return this.getStringAttribute('retention_period_in_days'); + } + public set retentionPeriodInDays(value: string) { + this._retentionPeriodInDays = value; + } + // Temporarily expose input value. Use with caution. + public get retentionPeriodInDaysInput() { + return this._retentionPeriodInDays; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + retention_period_in_days: cdktf.stringToTerraform(this._retentionPeriodInDays), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_period_in_days: { + value: cdktf.stringToHclTerraform(this._retentionPeriodInDays), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-restore/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-restore/README.md new file mode 100644 index 00000000..c17afd49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-restore/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-restore/index.ts new file mode 100644 index 00000000..d151ae83 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-restore/index.ts @@ -0,0 +1,409 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the backup to be restored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#backup_id GaussdbMysqlRestore#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#id GaussdbMysqlRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#region GaussdbMysqlRestore#region} + */ + readonly region?: string; + /** + * Specifies the time point of data restoration in the UNIX timestamp format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#restore_time GaussdbMysqlRestore#restore_time} + */ + readonly restoreTime?: number; + /** + * Specifies the source instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#source_instance_id GaussdbMysqlRestore#source_instance_id} + */ + readonly sourceInstanceId: string; + /** + * Specifies the target instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#target_instance_id GaussdbMysqlRestore#target_instance_id} + */ + readonly targetInstanceId: string; + /** + * Specifies the restoration type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#type GaussdbMysqlRestore#type} + */ + readonly type: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#timeouts GaussdbMysqlRestore#timeouts} + */ + readonly timeouts?: GaussdbMysqlRestoreTimeouts; +} +export interface GaussdbMysqlRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#create GaussdbMysqlRestore#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlRestoreTimeoutsToTerraform(struct?: GaussdbMysqlRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlRestoreTimeoutsToHclTerraform(struct?: GaussdbMysqlRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore huaweicloud_gaussdb_mysql_restore} +*/ +export class GaussdbMysqlRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlRestore to import + * @param importFromId The id of the existing GaussdbMysqlRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_restore huaweicloud_gaussdb_mysql_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlRestoreConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._id = config.id; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._sourceInstanceId = config.sourceInstanceId; + this._targetInstanceId = config.targetInstanceId; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: true, required: false + private _restoreTime?: number; + public get restoreTime() { + return this.getNumberAttribute('restore_time'); + } + public set restoreTime(value: number) { + this._restoreTime = value; + } + public resetRestoreTime() { + this._restoreTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // source_instance_id - computed: false, optional: false, required: true + private _sourceInstanceId?: string; + public get sourceInstanceId() { + return this.getStringAttribute('source_instance_id'); + } + public set sourceInstanceId(value: string) { + this._sourceInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInstanceIdInput() { + return this._sourceInstanceId; + } + + // target_instance_id - computed: false, optional: false, required: true + private _targetInstanceId?: string; + public get targetInstanceId() { + return this.getStringAttribute('target_instance_id'); + } + public set targetInstanceId(value: string) { + this._targetInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get targetInstanceIdInput() { + return this._targetInstanceId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.numberToTerraform(this._restoreTime), + source_instance_id: cdktf.stringToTerraform(this._sourceInstanceId), + target_instance_id: cdktf.stringToTerraform(this._targetInstanceId), + type: cdktf.stringToTerraform(this._type), + timeouts: gaussdbMysqlRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.numberToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_instance_id: { + value: cdktf.stringToHclTerraform(this._sourceInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_instance_id: { + value: cdktf.stringToHclTerraform(this._targetInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/README.md new file mode 100644 index 00000000..d27ee9fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_scheduled_task_cancel` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_scheduled_task_cancel`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/index.ts new file mode 100644 index 00000000..dd97c931 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-cancel/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlScheduledTaskCancelConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel#id GaussdbMysqlScheduledTaskCancel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel#job_id GaussdbMysqlScheduledTaskCancel#job_id} + */ + readonly jobId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel#region GaussdbMysqlScheduledTaskCancel#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel huaweicloud_gaussdb_mysql_scheduled_task_cancel} +*/ +export class GaussdbMysqlScheduledTaskCancel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_scheduled_task_cancel"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlScheduledTaskCancel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlScheduledTaskCancel to import + * @param importFromId The id of the existing GaussdbMysqlScheduledTaskCancel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlScheduledTaskCancel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_scheduled_task_cancel", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_cancel huaweicloud_gaussdb_mysql_scheduled_task_cancel} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlScheduledTaskCancelConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlScheduledTaskCancelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_scheduled_task_cancel', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._jobId = config.jobId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // datastore_type - computed: true, optional: false, required: false + public get datastoreType() { + return this.getStringAttribute('datastore_type'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_name - computed: true, optional: false, required: false + public get instanceName() { + return this.getStringAttribute('instance_name'); + } + + // instance_status - computed: true, optional: false, required: false + public get instanceStatus() { + return this.getStringAttribute('instance_status'); + } + + // job_id - computed: false, optional: false, required: true + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // job_name - computed: true, optional: false, required: false + public get jobName() { + return this.getStringAttribute('job_name'); + } + + // job_status - computed: true, optional: false, required: false + public get jobStatus() { + return this.getStringAttribute('job_status'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + job_id: cdktf.stringToTerraform(this._jobId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/README.md new file mode 100644 index 00000000..0b550fda --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_scheduled_task_delete` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_scheduled_task_delete`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/index.ts new file mode 100644 index 00000000..23f07f0d --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-scheduled-task-delete/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlScheduledTaskDeleteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete#id GaussdbMysqlScheduledTaskDelete#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete#instance_id GaussdbMysqlScheduledTaskDelete#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete#job_id GaussdbMysqlScheduledTaskDelete#job_id} + */ + readonly jobId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete#region GaussdbMysqlScheduledTaskDelete#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete huaweicloud_gaussdb_mysql_scheduled_task_delete} +*/ +export class GaussdbMysqlScheduledTaskDelete extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_scheduled_task_delete"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlScheduledTaskDelete resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlScheduledTaskDelete to import + * @param importFromId The id of the existing GaussdbMysqlScheduledTaskDelete that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlScheduledTaskDelete to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_scheduled_task_delete", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_scheduled_task_delete huaweicloud_gaussdb_mysql_scheduled_task_delete} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlScheduledTaskDeleteConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlScheduledTaskDeleteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_scheduled_task_delete', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._jobId = config.jobId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // job_id - computed: false, optional: false, required: true + private _jobId?: string; + public get jobId() { + return this.getStringAttribute('job_id'); + } + public set jobId(value: string) { + this._jobId = value; + } + // Temporarily expose input value. Use with caution. + public get jobIdInput() { + return this._jobId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + job_id: cdktf.stringToTerraform(this._jobId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_id: { + value: cdktf.stringToHclTerraform(this._jobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/README.md new file mode 100644 index 00000000..bc4def68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_sql_control_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_sql_control_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/index.ts new file mode 100644 index 00000000..eb0e901e --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-sql-control-rule/index.ts @@ -0,0 +1,469 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlSqlControlRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#id GaussdbMysqlSqlControlRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#instance_id GaussdbMysqlSqlControlRule#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the maximum number of concurrent SQL statements. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#max_concurrency GaussdbMysqlSqlControlRule#max_concurrency} + */ + readonly maxConcurrency: number; + /** + * Specifies ID of the GaussDB MySQL node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#node_id GaussdbMysqlSqlControlRule#node_id} + */ + readonly nodeId: string; + /** + * Specifies the concurrency control rule of SQL statements. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#pattern GaussdbMysqlSqlControlRule#pattern} + */ + readonly pattern: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#region GaussdbMysqlSqlControlRule#region} + */ + readonly region?: string; + /** + * Specifies SQL statement type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#sql_type GaussdbMysqlSqlControlRule#sql_type} + */ + readonly sqlType: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#timeouts GaussdbMysqlSqlControlRule#timeouts} + */ + readonly timeouts?: GaussdbMysqlSqlControlRuleTimeouts; +} +export interface GaussdbMysqlSqlControlRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#create GaussdbMysqlSqlControlRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#delete GaussdbMysqlSqlControlRule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#update GaussdbMysqlSqlControlRule#update} + */ + readonly update?: string; +} + +export function gaussdbMysqlSqlControlRuleTimeoutsToTerraform(struct?: GaussdbMysqlSqlControlRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbMysqlSqlControlRuleTimeoutsToHclTerraform(struct?: GaussdbMysqlSqlControlRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlSqlControlRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlSqlControlRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlSqlControlRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule huaweicloud_gaussdb_mysql_sql_control_rule} +*/ +export class GaussdbMysqlSqlControlRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_sql_control_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlSqlControlRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlSqlControlRule to import + * @param importFromId The id of the existing GaussdbMysqlSqlControlRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlSqlControlRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_sql_control_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_sql_control_rule huaweicloud_gaussdb_mysql_sql_control_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlSqlControlRuleConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlSqlControlRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_sql_control_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._maxConcurrency = config.maxConcurrency; + this._nodeId = config.nodeId; + this._pattern = config.pattern; + this._region = config.region; + this._sqlType = config.sqlType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // max_concurrency - computed: false, optional: false, required: true + private _maxConcurrency?: number; + public get maxConcurrency() { + return this.getNumberAttribute('max_concurrency'); + } + public set maxConcurrency(value: number) { + this._maxConcurrency = value; + } + // Temporarily expose input value. Use with caution. + public get maxConcurrencyInput() { + return this._maxConcurrency; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // pattern - computed: false, optional: false, required: true + private _pattern?: string; + public get pattern() { + return this.getStringAttribute('pattern'); + } + public set pattern(value: string) { + this._pattern = value; + } + // Temporarily expose input value. Use with caution. + public get patternInput() { + return this._pattern; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sql_type - computed: false, optional: false, required: true + private _sqlType?: string; + public get sqlType() { + return this.getStringAttribute('sql_type'); + } + public set sqlType(value: string) { + this._sqlType = value; + } + // Temporarily expose input value. Use with caution. + public get sqlTypeInput() { + return this._sqlType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlSqlControlRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlSqlControlRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + max_concurrency: cdktf.numberToTerraform(this._maxConcurrency), + node_id: cdktf.stringToTerraform(this._nodeId), + pattern: cdktf.stringToTerraform(this._pattern), + region: cdktf.stringToTerraform(this._region), + sql_type: cdktf.stringToTerraform(this._sqlType), + timeouts: gaussdbMysqlSqlControlRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_concurrency: { + value: cdktf.numberToHclTerraform(this._maxConcurrency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pattern: { + value: cdktf.stringToHclTerraform(this._pattern), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql_type: { + value: cdktf.stringToHclTerraform(this._sqlType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbMysqlSqlControlRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlSqlControlRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/README.md b/src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/README.md new file mode 100644 index 00000000..d570428a --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_mysql_table_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_mysql_table_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore). diff --git a/src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/index.ts b/src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/index.ts new file mode 100644 index 00000000..6c6164c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-mysql-table-restore/index.ts @@ -0,0 +1,661 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbMysqlTableRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#id GaussdbMysqlTableRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#instance_id GaussdbMysqlTableRestore#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#last_table_info GaussdbMysqlTableRestore#last_table_info} + */ + readonly lastTableInfo?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#region GaussdbMysqlTableRestore#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#restore_time GaussdbMysqlTableRestore#restore_time} + */ + readonly restoreTime: string; + /** + * restore_tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#restore_tables GaussdbMysqlTableRestore#restore_tables} + */ + readonly restoreTables: GaussdbMysqlTableRestoreRestoreTables[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#timeouts GaussdbMysqlTableRestore#timeouts} + */ + readonly timeouts?: GaussdbMysqlTableRestoreTimeouts; +} +export interface GaussdbMysqlTableRestoreRestoreTablesTables { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#new_name GaussdbMysqlTableRestore#new_name} + */ + readonly newName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#old_name GaussdbMysqlTableRestore#old_name} + */ + readonly oldName: string; +} + +export function gaussdbMysqlTableRestoreRestoreTablesTablesToTerraform(struct?: GaussdbMysqlTableRestoreRestoreTablesTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + new_name: cdktf.stringToTerraform(struct!.newName), + old_name: cdktf.stringToTerraform(struct!.oldName), + } +} + + +export function gaussdbMysqlTableRestoreRestoreTablesTablesToHclTerraform(struct?: GaussdbMysqlTableRestoreRestoreTablesTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + new_name: { + value: cdktf.stringToHclTerraform(struct!.newName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + old_name: { + value: cdktf.stringToHclTerraform(struct!.oldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlTableRestoreRestoreTablesTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlTableRestoreRestoreTablesTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._newName !== undefined) { + hasAnyValues = true; + internalValueResult.newName = this._newName; + } + if (this._oldName !== undefined) { + hasAnyValues = true; + internalValueResult.oldName = this._oldName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlTableRestoreRestoreTablesTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._newName = undefined; + this._oldName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._newName = value.newName; + this._oldName = value.oldName; + } + } + + // new_name - computed: false, optional: false, required: true + private _newName?: string; + public get newName() { + return this.getStringAttribute('new_name'); + } + public set newName(value: string) { + this._newName = value; + } + // Temporarily expose input value. Use with caution. + public get newNameInput() { + return this._newName; + } + + // old_name - computed: false, optional: false, required: true + private _oldName?: string; + public get oldName() { + return this.getStringAttribute('old_name'); + } + public set oldName(value: string) { + this._oldName = value; + } + // Temporarily expose input value. Use with caution. + public get oldNameInput() { + return this._oldName; + } +} + +export class GaussdbMysqlTableRestoreRestoreTablesTablesList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlTableRestoreRestoreTablesTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlTableRestoreRestoreTablesTablesOutputReference { + return new GaussdbMysqlTableRestoreRestoreTablesTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlTableRestoreRestoreTables { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#database GaussdbMysqlTableRestore#database} + */ + readonly database: string; + /** + * tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#tables GaussdbMysqlTableRestore#tables} + */ + readonly tables: GaussdbMysqlTableRestoreRestoreTablesTables[] | cdktf.IResolvable; +} + +export function gaussdbMysqlTableRestoreRestoreTablesToTerraform(struct?: GaussdbMysqlTableRestoreRestoreTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + database: cdktf.stringToTerraform(struct!.database), + tables: cdktf.listMapper(gaussdbMysqlTableRestoreRestoreTablesTablesToTerraform, true)(struct!.tables), + } +} + + +export function gaussdbMysqlTableRestoreRestoreTablesToHclTerraform(struct?: GaussdbMysqlTableRestoreRestoreTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + database: { + value: cdktf.stringToHclTerraform(struct!.database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tables: { + value: cdktf.listMapperHcl(gaussdbMysqlTableRestoreRestoreTablesTablesToHclTerraform, true)(struct!.tables), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlTableRestoreRestoreTablesTablesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlTableRestoreRestoreTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbMysqlTableRestoreRestoreTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._database !== undefined) { + hasAnyValues = true; + internalValueResult.database = this._database; + } + if (this._tables?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.tables = this._tables?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlTableRestoreRestoreTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._database = undefined; + this._tables.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._database = value.database; + this._tables.internalValue = value.tables; + } + } + + // database - computed: false, optional: false, required: true + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // tables - computed: false, optional: false, required: true + private _tables = new GaussdbMysqlTableRestoreRestoreTablesTablesList(this, "tables", false); + public get tables() { + return this._tables; + } + public putTables(value: GaussdbMysqlTableRestoreRestoreTablesTables[] | cdktf.IResolvable) { + this._tables.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get tablesInput() { + return this._tables.internalValue; + } +} + +export class GaussdbMysqlTableRestoreRestoreTablesList extends cdktf.ComplexList { + public internalValue? : GaussdbMysqlTableRestoreRestoreTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbMysqlTableRestoreRestoreTablesOutputReference { + return new GaussdbMysqlTableRestoreRestoreTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbMysqlTableRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#create GaussdbMysqlTableRestore#create} + */ + readonly create?: string; +} + +export function gaussdbMysqlTableRestoreTimeoutsToTerraform(struct?: GaussdbMysqlTableRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gaussdbMysqlTableRestoreTimeoutsToHclTerraform(struct?: GaussdbMysqlTableRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbMysqlTableRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbMysqlTableRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbMysqlTableRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore huaweicloud_gaussdb_mysql_table_restore} +*/ +export class GaussdbMysqlTableRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_mysql_table_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbMysqlTableRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbMysqlTableRestore to import + * @param importFromId The id of the existing GaussdbMysqlTableRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbMysqlTableRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_mysql_table_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_mysql_table_restore huaweicloud_gaussdb_mysql_table_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbMysqlTableRestoreConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbMysqlTableRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_mysql_table_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._lastTableInfo = config.lastTableInfo; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._restoreTables.internalValue = config.restoreTables; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // last_table_info - computed: false, optional: true, required: false + private _lastTableInfo?: string; + public get lastTableInfo() { + return this.getStringAttribute('last_table_info'); + } + public set lastTableInfo(value: string) { + this._lastTableInfo = value; + } + public resetLastTableInfo() { + this._lastTableInfo = undefined; + } + // Temporarily expose input value. Use with caution. + public get lastTableInfoInput() { + return this._lastTableInfo; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: string; + public get restoreTime() { + return this.getStringAttribute('restore_time'); + } + public set restoreTime(value: string) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // restore_tables - computed: false, optional: false, required: true + private _restoreTables = new GaussdbMysqlTableRestoreRestoreTablesList(this, "restore_tables", false); + public get restoreTables() { + return this._restoreTables; + } + public putRestoreTables(value: GaussdbMysqlTableRestoreRestoreTables[] | cdktf.IResolvable) { + this._restoreTables.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTablesInput() { + return this._restoreTables.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbMysqlTableRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbMysqlTableRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + last_table_info: cdktf.stringToTerraform(this._lastTableInfo), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.stringToTerraform(this._restoreTime), + restore_tables: cdktf.listMapper(gaussdbMysqlTableRestoreRestoreTablesToTerraform, true)(this._restoreTables.internalValue), + timeouts: gaussdbMysqlTableRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_table_info: { + value: cdktf.stringToHclTerraform(this._lastTableInfo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.stringToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_tables: { + value: cdktf.listMapperHcl(gaussdbMysqlTableRestoreRestoreTablesToHclTerraform, true)(this._restoreTables.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbMysqlTableRestoreRestoreTablesList", + }, + timeouts: { + value: gaussdbMysqlTableRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbMysqlTableRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-opengauss-database/README.md b/src/constructs/providers/huaweicloud/gaussdb-opengauss-database/README.md new file mode 100644 index 00000000..bb0dbea9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-opengauss-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_opengauss_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_opengauss_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database). diff --git a/src/constructs/providers/huaweicloud/gaussdb-opengauss-database/index.ts b/src/constructs/providers/huaweicloud/gaussdb-opengauss-database/index.ts new file mode 100644 index 00000000..c2faa178 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-opengauss-database/index.ts @@ -0,0 +1,515 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbOpengaussDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database character set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#character_set GaussdbOpengaussDatabase#character_set} + */ + readonly characterSet?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#id GaussdbOpengaussDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the GaussDB instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#instance_id GaussdbOpengaussDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database collation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#lc_collate GaussdbOpengaussDatabase#lc_collate} + */ + readonly lcCollate?: string; + /** + * Specifies the database classification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#lc_ctype GaussdbOpengaussDatabase#lc_ctype} + */ + readonly lcCtype?: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#name GaussdbOpengaussDatabase#name} + */ + readonly name: string; + /** + * Specifies the database user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#owner GaussdbOpengaussDatabase#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#region GaussdbOpengaussDatabase#region} + */ + readonly region?: string; + /** + * Specifies the name of the database template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#template GaussdbOpengaussDatabase#template} + */ + readonly template?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#timeouts GaussdbOpengaussDatabase#timeouts} + */ + readonly timeouts?: GaussdbOpengaussDatabaseTimeouts; +} +export interface GaussdbOpengaussDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#create GaussdbOpengaussDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#delete GaussdbOpengaussDatabase#delete} + */ + readonly delete?: string; +} + +export function gaussdbOpengaussDatabaseTimeoutsToTerraform(struct?: GaussdbOpengaussDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function gaussdbOpengaussDatabaseTimeoutsToHclTerraform(struct?: GaussdbOpengaussDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbOpengaussDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbOpengaussDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database huaweicloud_gaussdb_opengauss_database} +*/ +export class GaussdbOpengaussDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_opengauss_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbOpengaussDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbOpengaussDatabase to import + * @param importFromId The id of the existing GaussdbOpengaussDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbOpengaussDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_opengauss_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_database huaweicloud_gaussdb_opengauss_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbOpengaussDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbOpengaussDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_opengauss_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._id = config.id; + this._instanceId = config.instanceId; + this._lcCollate = config.lcCollate; + this._lcCtype = config.lcCtype; + this._name = config.name; + this._owner = config.owner; + this._region = config.region; + this._template = config.template; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: true, optional: true, required: false + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + public resetCharacterSet() { + this._characterSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // compatibility_type - computed: true, optional: false, required: false + public get compatibilityType() { + return this.getStringAttribute('compatibility_type'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // lc_collate - computed: true, optional: true, required: false + private _lcCollate?: string; + public get lcCollate() { + return this.getStringAttribute('lc_collate'); + } + public set lcCollate(value: string) { + this._lcCollate = value; + } + public resetLcCollate() { + this._lcCollate = undefined; + } + // Temporarily expose input value. Use with caution. + public get lcCollateInput() { + return this._lcCollate; + } + + // lc_ctype - computed: true, optional: true, required: false + private _lcCtype?: string; + public get lcCtype() { + return this.getStringAttribute('lc_ctype'); + } + public set lcCtype(value: string) { + this._lcCtype = value; + } + public resetLcCtype() { + this._lcCtype = undefined; + } + // Temporarily expose input value. Use with caution. + public get lcCtypeInput() { + return this._lcCtype; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getStringAttribute('size'); + } + + // template - computed: false, optional: true, required: false + private _template?: string; + public get template() { + return this.getStringAttribute('template'); + } + public set template(value: string) { + this._template = value; + } + public resetTemplate() { + this._template = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateInput() { + return this._template; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbOpengaussDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbOpengaussDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + lc_collate: cdktf.stringToTerraform(this._lcCollate), + lc_ctype: cdktf.stringToTerraform(this._lcCtype), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + template: cdktf.stringToTerraform(this._template), + timeouts: gaussdbOpengaussDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lc_collate: { + value: cdktf.stringToHclTerraform(this._lcCollate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lc_ctype: { + value: cdktf.stringToHclTerraform(this._lcCtype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template: { + value: cdktf.stringToHclTerraform(this._template), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbOpengaussDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbOpengaussDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/README.md b/src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/README.md new file mode 100644 index 00000000..7291e68e --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_opengauss_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_opengauss_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance). diff --git a/src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/index.ts b/src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/index.ts new file mode 100644 index 00000000..f87cb9d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-opengauss-instance/index.ts @@ -0,0 +1,1586 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbOpengaussInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#auto_renew GaussdbOpengaussInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#availability_zone GaussdbOpengaussInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#charging_mode GaussdbOpengaussInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#configuration_id GaussdbOpengaussInstance#configuration_id} + */ + readonly configurationId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#coordinator_num GaussdbOpengaussInstance#coordinator_num} + */ + readonly coordinatorNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#enterprise_project_id GaussdbOpengaussInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#flavor GaussdbOpengaussInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#force_import GaussdbOpengaussInstance#force_import} + */ + readonly forceImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#id GaussdbOpengaussInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#name GaussdbOpengaussInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#password GaussdbOpengaussInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#period GaussdbOpengaussInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#period_unit GaussdbOpengaussInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#port GaussdbOpengaussInstance#port} + */ + readonly port?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#region GaussdbOpengaussInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#replica_num GaussdbOpengaussInstance#replica_num} + */ + readonly replicaNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#security_group_id GaussdbOpengaussInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#sharding_num GaussdbOpengaussInstance#sharding_num} + */ + readonly shardingNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#subnet_id GaussdbOpengaussInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#time_zone GaussdbOpengaussInstance#time_zone} + */ + readonly timeZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#vpc_id GaussdbOpengaussInstance#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#backup_strategy GaussdbOpengaussInstance#backup_strategy} + */ + readonly backupStrategy?: GaussdbOpengaussInstanceBackupStrategy; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#datastore GaussdbOpengaussInstance#datastore} + */ + readonly datastore?: GaussdbOpengaussInstanceDatastore; + /** + * ha block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#ha GaussdbOpengaussInstance#ha} + */ + readonly ha: GaussdbOpengaussInstanceHa; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#timeouts GaussdbOpengaussInstance#timeouts} + */ + readonly timeouts?: GaussdbOpengaussInstanceTimeouts; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#volume GaussdbOpengaussInstance#volume} + */ + readonly volume: GaussdbOpengaussInstanceVolume; +} +export interface GaussdbOpengaussInstanceNodes { +} + +export function gaussdbOpengaussInstanceNodesToTerraform(struct?: GaussdbOpengaussInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbOpengaussInstanceNodesToHclTerraform(struct?: GaussdbOpengaussInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbOpengaussInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbOpengaussInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class GaussdbOpengaussInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbOpengaussInstanceNodesOutputReference { + return new GaussdbOpengaussInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbOpengaussInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#keep_days GaussdbOpengaussInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#start_time GaussdbOpengaussInstance#start_time} + */ + readonly startTime: string; +} + +export function gaussdbOpengaussInstanceBackupStrategyToTerraform(struct?: GaussdbOpengaussInstanceBackupStrategyOutputReference | GaussdbOpengaussInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function gaussdbOpengaussInstanceBackupStrategyToHclTerraform(struct?: GaussdbOpengaussInstanceBackupStrategyOutputReference | GaussdbOpengaussInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbOpengaussInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbOpengaussInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._startTime = value.startTime; + } + } + + // keep_days - computed: false, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface GaussdbOpengaussInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#engine GaussdbOpengaussInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#version GaussdbOpengaussInstance#version} + */ + readonly version?: string; +} + +export function gaussdbOpengaussInstanceDatastoreToTerraform(struct?: GaussdbOpengaussInstanceDatastoreOutputReference | GaussdbOpengaussInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine: cdktf.stringToTerraform(struct!.engine), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function gaussdbOpengaussInstanceDatastoreToHclTerraform(struct?: GaussdbOpengaussInstanceDatastoreOutputReference | GaussdbOpengaussInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(struct!.engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbOpengaussInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbOpengaussInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engine !== undefined) { + hasAnyValues = true; + internalValueResult.engine = this._engine; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engine = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engine = value.engine; + this._version = value.version; + } + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface GaussdbOpengaussInstanceHa { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#consistency GaussdbOpengaussInstance#consistency} + */ + readonly consistency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#mode GaussdbOpengaussInstance#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#replication_mode GaussdbOpengaussInstance#replication_mode} + */ + readonly replicationMode: string; +} + +export function gaussdbOpengaussInstanceHaToTerraform(struct?: GaussdbOpengaussInstanceHaOutputReference | GaussdbOpengaussInstanceHa): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + consistency: cdktf.stringToTerraform(struct!.consistency), + mode: cdktf.stringToTerraform(struct!.mode), + replication_mode: cdktf.stringToTerraform(struct!.replicationMode), + } +} + + +export function gaussdbOpengaussInstanceHaToHclTerraform(struct?: GaussdbOpengaussInstanceHaOutputReference | GaussdbOpengaussInstanceHa): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + consistency: { + value: cdktf.stringToHclTerraform(struct!.consistency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replication_mode: { + value: cdktf.stringToHclTerraform(struct!.replicationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbOpengaussInstanceHaOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbOpengaussInstanceHa | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._consistency !== undefined) { + hasAnyValues = true; + internalValueResult.consistency = this._consistency; + } + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._replicationMode !== undefined) { + hasAnyValues = true; + internalValueResult.replicationMode = this._replicationMode; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussInstanceHa | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._consistency = undefined; + this._mode = undefined; + this._replicationMode = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._consistency = value.consistency; + this._mode = value.mode; + this._replicationMode = value.replicationMode; + } + } + + // consistency - computed: false, optional: true, required: false + private _consistency?: string; + public get consistency() { + return this.getStringAttribute('consistency'); + } + public set consistency(value: string) { + this._consistency = value; + } + public resetConsistency() { + this._consistency = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistencyInput() { + return this._consistency; + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // replication_mode - computed: false, optional: false, required: true + private _replicationMode?: string; + public get replicationMode() { + return this.getStringAttribute('replication_mode'); + } + public set replicationMode(value: string) { + this._replicationMode = value; + } + // Temporarily expose input value. Use with caution. + public get replicationModeInput() { + return this._replicationMode; + } +} +export interface GaussdbOpengaussInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#create GaussdbOpengaussInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#delete GaussdbOpengaussInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#update GaussdbOpengaussInstance#update} + */ + readonly update?: string; +} + +export function gaussdbOpengaussInstanceTimeoutsToTerraform(struct?: GaussdbOpengaussInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbOpengaussInstanceTimeoutsToHclTerraform(struct?: GaussdbOpengaussInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbOpengaussInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbOpengaussInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface GaussdbOpengaussInstanceVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#size GaussdbOpengaussInstance#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#type GaussdbOpengaussInstance#type} + */ + readonly type: string; +} + +export function gaussdbOpengaussInstanceVolumeToTerraform(struct?: GaussdbOpengaussInstanceVolumeOutputReference | GaussdbOpengaussInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function gaussdbOpengaussInstanceVolumeToHclTerraform(struct?: GaussdbOpengaussInstanceVolumeOutputReference | GaussdbOpengaussInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbOpengaussInstanceVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbOpengaussInstanceVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbOpengaussInstanceVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._type = value.type; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance huaweicloud_gaussdb_opengauss_instance} +*/ +export class GaussdbOpengaussInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_opengauss_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbOpengaussInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbOpengaussInstance to import + * @param importFromId The id of the existing GaussdbOpengaussInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbOpengaussInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_opengauss_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_opengauss_instance huaweicloud_gaussdb_opengauss_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbOpengaussInstanceConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbOpengaussInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_opengauss_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._configurationId = config.configurationId; + this._coordinatorNum = config.coordinatorNum; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._forceImport = config.forceImport; + this._id = config.id; + this._name = config.name; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._region = config.region; + this._replicaNum = config.replicaNum; + this._securityGroupId = config.securityGroupId; + this._shardingNum = config.shardingNum; + this._subnetId = config.subnetId; + this._timeZone = config.timeZone; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._datastore.internalValue = config.datastore; + this._ha.internalValue = config.ha; + this._timeouts.internalValue = config.timeouts; + this._volume.internalValue = config.volume; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // configuration_id - computed: false, optional: true, required: false + private _configurationId?: string; + public get configurationId() { + return this.getStringAttribute('configuration_id'); + } + public set configurationId(value: string) { + this._configurationId = value; + } + public resetConfigurationId() { + this._configurationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationIdInput() { + return this._configurationId; + } + + // coordinator_num - computed: false, optional: true, required: false + private _coordinatorNum?: number; + public get coordinatorNum() { + return this.getNumberAttribute('coordinator_num'); + } + public set coordinatorNum(value: number) { + this._coordinatorNum = value; + } + public resetCoordinatorNum() { + this._coordinatorNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get coordinatorNumInput() { + return this._coordinatorNum; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // endpoints - computed: true, optional: false, required: false + public get endpoints() { + return this.getListAttribute('endpoints'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // force_import - computed: false, optional: true, required: false + private _forceImport?: boolean | cdktf.IResolvable; + public get forceImport() { + return this.getBooleanAttribute('force_import'); + } + public set forceImport(value: boolean | cdktf.IResolvable) { + this._forceImport = value; + } + public resetForceImport() { + this._forceImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceImportInput() { + return this._forceImport; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintenance_window - computed: true, optional: false, required: false + public get maintenanceWindow() { + return this.getStringAttribute('maintenance_window'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbOpengaussInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: string; + public get port() { + return this.getStringAttribute('port'); + } + public set port(value: string) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replica_num - computed: false, optional: true, required: false + private _replicaNum?: number; + public get replicaNum() { + return this.getNumberAttribute('replica_num'); + } + public set replicaNum(value: number) { + this._replicaNum = value; + } + public resetReplicaNum() { + this._replicaNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicaNumInput() { + return this._replicaNum; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // sharding_num - computed: false, optional: true, required: false + private _shardingNum?: number; + public get shardingNum() { + return this.getNumberAttribute('sharding_num'); + } + public set shardingNum(value: number) { + this._shardingNum = value; + } + public resetShardingNum() { + this._shardingNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get shardingNumInput() { + return this._shardingNum; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // switch_strategy - computed: true, optional: false, required: false + public get switchStrategy() { + return this.getStringAttribute('switch_strategy'); + } + + // time_zone - computed: false, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new GaussdbOpengaussInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: GaussdbOpengaussInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // datastore - computed: false, optional: true, required: false + private _datastore = new GaussdbOpengaussInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: GaussdbOpengaussInstanceDatastore) { + this._datastore.internalValue = value; + } + public resetDatastore() { + this._datastore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // ha - computed: false, optional: false, required: true + private _ha = new GaussdbOpengaussInstanceHaOutputReference(this, "ha"); + public get ha() { + return this._ha; + } + public putHa(value: GaussdbOpengaussInstanceHa) { + this._ha.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get haInput() { + return this._ha.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbOpengaussInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbOpengaussInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // volume - computed: false, optional: false, required: true + private _volume = new GaussdbOpengaussInstanceVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: GaussdbOpengaussInstanceVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + configuration_id: cdktf.stringToTerraform(this._configurationId), + coordinator_num: cdktf.numberToTerraform(this._coordinatorNum), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + force_import: cdktf.booleanToTerraform(this._forceImport), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.stringToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + replica_num: cdktf.numberToTerraform(this._replicaNum), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + sharding_num: cdktf.numberToTerraform(this._shardingNum), + subnet_id: cdktf.stringToTerraform(this._subnetId), + time_zone: cdktf.stringToTerraform(this._timeZone), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: gaussdbOpengaussInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + datastore: gaussdbOpengaussInstanceDatastoreToTerraform(this._datastore.internalValue), + ha: gaussdbOpengaussInstanceHaToTerraform(this._ha.internalValue), + timeouts: gaussdbOpengaussInstanceTimeoutsToTerraform(this._timeouts.internalValue), + volume: gaussdbOpengaussInstanceVolumeToTerraform(this._volume.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration_id: { + value: cdktf.stringToHclTerraform(this._configurationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + coordinator_num: { + value: cdktf.numberToHclTerraform(this._coordinatorNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_import: { + value: cdktf.booleanToHclTerraform(this._forceImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.stringToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replica_num: { + value: cdktf.numberToHclTerraform(this._replicaNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sharding_num: { + value: cdktf.numberToHclTerraform(this._shardingNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: gaussdbOpengaussInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbOpengaussInstanceBackupStrategyList", + }, + datastore: { + value: gaussdbOpengaussInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbOpengaussInstanceDatastoreList", + }, + ha: { + value: gaussdbOpengaussInstanceHaToHclTerraform(this._ha.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbOpengaussInstanceHaList", + }, + timeouts: { + value: gaussdbOpengaussInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbOpengaussInstanceTimeouts", + }, + volume: { + value: gaussdbOpengaussInstanceVolumeToHclTerraform(this._volume.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbOpengaussInstanceVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/README.md b/src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/README.md new file mode 100644 index 00000000..a3154490 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_redis_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_redis_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate). diff --git a/src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/index.ts b/src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/index.ts new file mode 100644 index 00000000..806b94db --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-redis-eip-associate/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbRedisEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#id GaussdbRedisEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of a GaussDB Redis instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#instance_id GaussdbRedisEipAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of a GaussDB Redis node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#node_id GaussdbRedisEipAssociate#node_id} + */ + readonly nodeId: string; + /** + * Indicates the EIP address to associate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#public_ip GaussdbRedisEipAssociate#public_ip} + */ + readonly publicIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#region GaussdbRedisEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#timeouts GaussdbRedisEipAssociate#timeouts} + */ + readonly timeouts?: GaussdbRedisEipAssociateTimeouts; +} +export interface GaussdbRedisEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#create GaussdbRedisEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#delete GaussdbRedisEipAssociate#delete} + */ + readonly delete?: string; +} + +export function gaussdbRedisEipAssociateTimeoutsToTerraform(struct?: GaussdbRedisEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function gaussdbRedisEipAssociateTimeoutsToHclTerraform(struct?: GaussdbRedisEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbRedisEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbRedisEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbRedisEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate huaweicloud_gaussdb_redis_eip_associate} +*/ +export class GaussdbRedisEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_redis_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbRedisEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbRedisEipAssociate to import + * @param importFromId The id of the existing GaussdbRedisEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbRedisEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_redis_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_eip_associate huaweicloud_gaussdb_redis_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbRedisEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbRedisEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_redis_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeId = config.nodeId; + this._publicIp = config.publicIp; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbRedisEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbRedisEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_id: cdktf.stringToTerraform(this._nodeId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + timeouts: gaussdbRedisEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gaussdbRedisEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbRedisEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/gaussdb-redis-instance/README.md b/src/constructs/providers/huaweicloud/gaussdb-redis-instance/README.md new file mode 100644 index 00000000..f95c9fa7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-redis-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_gaussdb_redis_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_gaussdb_redis_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance). diff --git a/src/constructs/providers/huaweicloud/gaussdb-redis-instance/index.ts b/src/constructs/providers/huaweicloud/gaussdb-redis-instance/index.ts new file mode 100644 index 00000000..add5a220 --- /dev/null +++ b/src/constructs/providers/huaweicloud/gaussdb-redis-instance/index.ts @@ -0,0 +1,1460 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GaussdbRedisInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#auto_pay GaussdbRedisInstance#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#auto_renew GaussdbRedisInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#availability_zone GaussdbRedisInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#charging_mode GaussdbRedisInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#enterprise_project_id GaussdbRedisInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#flavor GaussdbRedisInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#force_import GaussdbRedisInstance#force_import} + */ + readonly forceImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#id GaussdbRedisInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#mode GaussdbRedisInstance#mode} + */ + readonly mode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#name GaussdbRedisInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#node_num GaussdbRedisInstance#node_num} + */ + readonly nodeNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#password GaussdbRedisInstance#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#period GaussdbRedisInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#period_unit GaussdbRedisInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#port GaussdbRedisInstance#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#region GaussdbRedisInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#security_group_id GaussdbRedisInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#ssl GaussdbRedisInstance#ssl} + */ + readonly ssl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#subnet_id GaussdbRedisInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#tags GaussdbRedisInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#volume_size GaussdbRedisInstance#volume_size} + */ + readonly volumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#vpc_id GaussdbRedisInstance#vpc_id} + */ + readonly vpcId: string; + /** + * availability_zone_detail block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#availability_zone_detail GaussdbRedisInstance#availability_zone_detail} + */ + readonly availabilityZoneDetail?: GaussdbRedisInstanceAvailabilityZoneDetail; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#backup_strategy GaussdbRedisInstance#backup_strategy} + */ + readonly backupStrategy?: GaussdbRedisInstanceBackupStrategy; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#datastore GaussdbRedisInstance#datastore} + */ + readonly datastore?: GaussdbRedisInstanceDatastore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#timeouts GaussdbRedisInstance#timeouts} + */ + readonly timeouts?: GaussdbRedisInstanceTimeouts; +} +export interface GaussdbRedisInstanceNodes { +} + +export function gaussdbRedisInstanceNodesToTerraform(struct?: GaussdbRedisInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function gaussdbRedisInstanceNodesToHclTerraform(struct?: GaussdbRedisInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class GaussdbRedisInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GaussdbRedisInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbRedisInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // support_reduce - computed: true, optional: false, required: false + public get supportReduce() { + return this.getBooleanAttribute('support_reduce'); + } +} + +export class GaussdbRedisInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GaussdbRedisInstanceNodesOutputReference { + return new GaussdbRedisInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GaussdbRedisInstanceAvailabilityZoneDetail { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#primary_availability_zone GaussdbRedisInstance#primary_availability_zone} + */ + readonly primaryAvailabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#secondary_availability_zone GaussdbRedisInstance#secondary_availability_zone} + */ + readonly secondaryAvailabilityZone: string; +} + +export function gaussdbRedisInstanceAvailabilityZoneDetailToTerraform(struct?: GaussdbRedisInstanceAvailabilityZoneDetailOutputReference | GaussdbRedisInstanceAvailabilityZoneDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + primary_availability_zone: cdktf.stringToTerraform(struct!.primaryAvailabilityZone), + secondary_availability_zone: cdktf.stringToTerraform(struct!.secondaryAvailabilityZone), + } +} + + +export function gaussdbRedisInstanceAvailabilityZoneDetailToHclTerraform(struct?: GaussdbRedisInstanceAvailabilityZoneDetailOutputReference | GaussdbRedisInstanceAvailabilityZoneDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + primary_availability_zone: { + value: cdktf.stringToHclTerraform(struct!.primaryAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_availability_zone: { + value: cdktf.stringToHclTerraform(struct!.secondaryAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbRedisInstanceAvailabilityZoneDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbRedisInstanceAvailabilityZoneDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._primaryAvailabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.primaryAvailabilityZone = this._primaryAvailabilityZone; + } + if (this._secondaryAvailabilityZone !== undefined) { + hasAnyValues = true; + internalValueResult.secondaryAvailabilityZone = this._secondaryAvailabilityZone; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbRedisInstanceAvailabilityZoneDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._primaryAvailabilityZone = undefined; + this._secondaryAvailabilityZone = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._primaryAvailabilityZone = value.primaryAvailabilityZone; + this._secondaryAvailabilityZone = value.secondaryAvailabilityZone; + } + } + + // primary_availability_zone - computed: false, optional: false, required: true + private _primaryAvailabilityZone?: string; + public get primaryAvailabilityZone() { + return this.getStringAttribute('primary_availability_zone'); + } + public set primaryAvailabilityZone(value: string) { + this._primaryAvailabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get primaryAvailabilityZoneInput() { + return this._primaryAvailabilityZone; + } + + // secondary_availability_zone - computed: false, optional: false, required: true + private _secondaryAvailabilityZone?: string; + public get secondaryAvailabilityZone() { + return this.getStringAttribute('secondary_availability_zone'); + } + public set secondaryAvailabilityZone(value: string) { + this._secondaryAvailabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get secondaryAvailabilityZoneInput() { + return this._secondaryAvailabilityZone; + } +} +export interface GaussdbRedisInstanceBackupStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#keep_days GaussdbRedisInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#start_time GaussdbRedisInstance#start_time} + */ + readonly startTime: string; +} + +export function gaussdbRedisInstanceBackupStrategyToTerraform(struct?: GaussdbRedisInstanceBackupStrategyOutputReference | GaussdbRedisInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function gaussdbRedisInstanceBackupStrategyToHclTerraform(struct?: GaussdbRedisInstanceBackupStrategyOutputReference | GaussdbRedisInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbRedisInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbRedisInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbRedisInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._startTime = value.startTime; + } + } + + // keep_days - computed: true, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface GaussdbRedisInstanceDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#engine GaussdbRedisInstance#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#storage_engine GaussdbRedisInstance#storage_engine} + */ + readonly storageEngine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#version GaussdbRedisInstance#version} + */ + readonly version: string; +} + +export function gaussdbRedisInstanceDatastoreToTerraform(struct?: GaussdbRedisInstanceDatastoreOutputReference | GaussdbRedisInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + engine: cdktf.stringToTerraform(struct!.engine), + storage_engine: cdktf.stringToTerraform(struct!.storageEngine), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function gaussdbRedisInstanceDatastoreToHclTerraform(struct?: GaussdbRedisInstanceDatastoreOutputReference | GaussdbRedisInstanceDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(struct!.engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_engine: { + value: cdktf.stringToHclTerraform(struct!.storageEngine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbRedisInstanceDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GaussdbRedisInstanceDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._engine !== undefined) { + hasAnyValues = true; + internalValueResult.engine = this._engine; + } + if (this._storageEngine !== undefined) { + hasAnyValues = true; + internalValueResult.storageEngine = this._storageEngine; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbRedisInstanceDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._engine = undefined; + this._storageEngine = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._engine = value.engine; + this._storageEngine = value.storageEngine; + this._version = value.version; + } + } + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // storage_engine - computed: false, optional: false, required: true + private _storageEngine?: string; + public get storageEngine() { + return this.getStringAttribute('storage_engine'); + } + public set storageEngine(value: string) { + this._storageEngine = value; + } + // Temporarily expose input value. Use with caution. + public get storageEngineInput() { + return this._storageEngine; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface GaussdbRedisInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#create GaussdbRedisInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#delete GaussdbRedisInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#update GaussdbRedisInstance#update} + */ + readonly update?: string; +} + +export function gaussdbRedisInstanceTimeoutsToTerraform(struct?: GaussdbRedisInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gaussdbRedisInstanceTimeoutsToHclTerraform(struct?: GaussdbRedisInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GaussdbRedisInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GaussdbRedisInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GaussdbRedisInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance huaweicloud_gaussdb_redis_instance} +*/ +export class GaussdbRedisInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_gaussdb_redis_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GaussdbRedisInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GaussdbRedisInstance to import + * @param importFromId The id of the existing GaussdbRedisInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GaussdbRedisInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_gaussdb_redis_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/gaussdb_redis_instance huaweicloud_gaussdb_redis_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GaussdbRedisInstanceConfig + */ + public constructor(scope: Construct, id: string, config: GaussdbRedisInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_gaussdb_redis_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._forceImport = config.forceImport; + this._id = config.id; + this._mode = config.mode; + this._name = config.name; + this._nodeNum = config.nodeNum; + this._password = config.password; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._port = config.port; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._ssl = config.ssl; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._volumeSize = config.volumeSize; + this._vpcId = config.vpcId; + this._availabilityZoneDetail.internalValue = config.availabilityZoneDetail; + this._backupStrategy.internalValue = config.backupStrategy; + this._datastore.internalValue = config.datastore; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // db_user_name - computed: true, optional: false, required: false + public get dbUserName() { + return this.getStringAttribute('db_user_name'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // force_import - computed: false, optional: true, required: false + private _forceImport?: boolean | cdktf.IResolvable; + public get forceImport() { + return this.getBooleanAttribute('force_import'); + } + public set forceImport(value: boolean | cdktf.IResolvable) { + this._forceImport = value; + } + public resetForceImport() { + this._forceImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceImportInput() { + return this._forceImport; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_ip_address - computed: true, optional: false, required: false + public get lbIpAddress() { + return this.getStringAttribute('lb_ip_address'); + } + + // lb_port - computed: true, optional: false, required: false + public get lbPort() { + return this.getStringAttribute('lb_port'); + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_num - computed: false, optional: true, required: false + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + public resetNodeNum() { + this._nodeNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new GaussdbRedisInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // ssl - computed: false, optional: true, required: false + private _ssl?: boolean | cdktf.IResolvable; + public get ssl() { + return this.getBooleanAttribute('ssl'); + } + public set ssl(value: boolean | cdktf.IResolvable) { + this._ssl = value; + } + public resetSsl() { + this._ssl = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslInput() { + return this._ssl; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // volume_size - computed: false, optional: false, required: true + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // availability_zone_detail - computed: false, optional: true, required: false + private _availabilityZoneDetail = new GaussdbRedisInstanceAvailabilityZoneDetailOutputReference(this, "availability_zone_detail"); + public get availabilityZoneDetail() { + return this._availabilityZoneDetail; + } + public putAvailabilityZoneDetail(value: GaussdbRedisInstanceAvailabilityZoneDetail) { + this._availabilityZoneDetail.internalValue = value; + } + public resetAvailabilityZoneDetail() { + this._availabilityZoneDetail.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneDetailInput() { + return this._availabilityZoneDetail.internalValue; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new GaussdbRedisInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: GaussdbRedisInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // datastore - computed: false, optional: true, required: false + private _datastore = new GaussdbRedisInstanceDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: GaussdbRedisInstanceDatastore) { + this._datastore.internalValue = value; + } + public resetDatastore() { + this._datastore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GaussdbRedisInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GaussdbRedisInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + force_import: cdktf.booleanToTerraform(this._forceImport), + id: cdktf.stringToTerraform(this._id), + mode: cdktf.stringToTerraform(this._mode), + name: cdktf.stringToTerraform(this._name), + node_num: cdktf.numberToTerraform(this._nodeNum), + password: cdktf.stringToTerraform(this._password), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl: cdktf.booleanToTerraform(this._ssl), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_size: cdktf.numberToTerraform(this._volumeSize), + vpc_id: cdktf.stringToTerraform(this._vpcId), + availability_zone_detail: gaussdbRedisInstanceAvailabilityZoneDetailToTerraform(this._availabilityZoneDetail.internalValue), + backup_strategy: gaussdbRedisInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + datastore: gaussdbRedisInstanceDatastoreToTerraform(this._datastore.internalValue), + timeouts: gaussdbRedisInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_import: { + value: cdktf.booleanToHclTerraform(this._forceImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl: { + value: cdktf.booleanToHclTerraform(this._ssl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone_detail: { + value: gaussdbRedisInstanceAvailabilityZoneDetailToHclTerraform(this._availabilityZoneDetail.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbRedisInstanceAvailabilityZoneDetailList", + }, + backup_strategy: { + value: gaussdbRedisInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbRedisInstanceBackupStrategyList", + }, + datastore: { + value: gaussdbRedisInstanceDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "GaussdbRedisInstanceDatastoreList", + }, + timeouts: { + value: gaussdbRedisInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GaussdbRedisInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ges-backup/README.md b/src/constructs/providers/huaweicloud/ges-backup/README.md new file mode 100644 index 00000000..9595f5e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ges-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ges_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_ges_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup). diff --git a/src/constructs/providers/huaweicloud/ges-backup/index.ts b/src/constructs/providers/huaweicloud/ges-backup/index.ts new file mode 100644 index 00000000..6df8d99c --- /dev/null +++ b/src/constructs/providers/huaweicloud/ges-backup/index.ts @@ -0,0 +1,333 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GesBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup#graph_id GesBackup#graph_id} + */ + readonly graphId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup#id GesBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup#region GesBackup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup#timeouts GesBackup#timeouts} + */ + readonly timeouts?: GesBackupTimeouts; +} +export interface GesBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup#create GesBackup#create} + */ + readonly create?: string; +} + +export function gesBackupTimeoutsToTerraform(struct?: GesBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function gesBackupTimeoutsToHclTerraform(struct?: GesBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GesBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup huaweicloud_ges_backup} +*/ +export class GesBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ges_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GesBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GesBackup to import + * @param importFromId The id of the existing GesBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GesBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ges_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_backup huaweicloud_ges_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GesBackupConfig + */ + public constructor(scope: Construct, id: string, config: GesBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ges_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._graphId = config.graphId; + this._id = config.id; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_method - computed: true, optional: false, required: false + public get backupMethod() { + return this.getStringAttribute('backup_method'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getNumberAttribute('duration'); + } + + // encrypted - computed: true, optional: false, required: false + public get encrypted() { + return this.getBooleanAttribute('encrypted'); + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // graph_id - computed: false, optional: false, required: true + private _graphId?: string; + public get graphId() { + return this.getStringAttribute('graph_id'); + } + public set graphId(value: string) { + this._graphId = value; + } + // Temporarily expose input value. Use with caution. + public get graphIdInput() { + return this._graphId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GesBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GesBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + graph_id: cdktf.stringToTerraform(this._graphId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + timeouts: gesBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + graph_id: { + value: cdktf.stringToHclTerraform(this._graphId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: gesBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GesBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ges-graph/README.md b/src/constructs/providers/huaweicloud/ges-graph/README.md new file mode 100644 index 00000000..81a99305 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ges-graph/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ges_graph` + +Refer to the Terraform Registry for docs: [`huaweicloud_ges_graph`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph). diff --git a/src/constructs/providers/huaweicloud/ges-graph/index.ts b/src/constructs/providers/huaweicloud/ges-graph/index.ts new file mode 100644 index 00000000..9bd23ca6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ges-graph/index.ts @@ -0,0 +1,1445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GesGraphConfig extends cdktf.TerraformMetaArguments { + /** + * Graph instance's CPU architecture type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#cpu_arch GesGraph#cpu_arch} + */ + readonly cpuArch?: string; + /** + * Graph instance cryptography algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#crypt_algorithm GesGraph#crypt_algorithm} + */ + readonly cryptAlgorithm: string; + /** + * Whether to enable full-text index control for the created graph. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable_full_text_index GesGraph#enable_full_text_index} + */ + readonly enableFullTextIndex?: boolean | cdktf.IResolvable; + /** + * Whether to enable the security mode. This mode may damage GES performance greatly. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable_https GesGraph#enable_https} + */ + readonly enableHttps: boolean | cdktf.IResolvable; + /** + * Whether to enable HyG for the graph. This parameter is available for database edition graphs only. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable_hyg GesGraph#enable_hyg} + */ + readonly enableHyg?: boolean | cdktf.IResolvable; + /** + * Whether the created graph supports the cross-AZ mode. The default value is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable_multi_az GesGraph#enable_multi_az} + */ + readonly enableMultiAz?: boolean | cdktf.IResolvable; + /** + * Whether to enable granular permission control for the created graph. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable_rbac GesGraph#enable_rbac} + */ + readonly enableRbac?: boolean | cdktf.IResolvable; + /** + * The enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enterprise_project_id GesGraph#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Graph size type index. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#graph_size_type_index GesGraph#graph_size_type_index} + */ + readonly graphSizeTypeIndex: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#id GesGraph#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to retain the backups of a graph after it is deleted. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#keep_backup GesGraph#keep_backup} + */ + readonly keepBackup?: boolean | cdktf.IResolvable; + /** + * The graph name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#name GesGraph#name} + */ + readonly name: string; + /** + * Graph product type + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#product_type GesGraph#product_type} + */ + readonly productType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#region GesGraph#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#replication GesGraph#replication} + */ + readonly replication?: number; + /** + * The security group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#security_group_id GesGraph#security_group_id} + */ + readonly securityGroupId: string; + /** + * The subnet ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#subnet_id GesGraph#subnet_id} + */ + readonly subnetId: string; + /** + * The key/value pairs to associate with the graph. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#tags GesGraph#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#vpc_id GesGraph#vpc_id} + */ + readonly vpcId: string; + /** + * encryption block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#encryption GesGraph#encryption} + */ + readonly encryption?: GesGraphEncryption; + /** + * lts_operation_trace block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#lts_operation_trace GesGraph#lts_operation_trace} + */ + readonly ltsOperationTrace?: GesGraphLtsOperationTrace; + /** + * public_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#public_ip GesGraph#public_ip} + */ + readonly publicIp?: GesGraphPublicIp; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#timeouts GesGraph#timeouts} + */ + readonly timeouts?: GesGraphTimeouts; + /** + * vertex_id_type block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#vertex_id_type GesGraph#vertex_id_type} + */ + readonly vertexIdType?: GesGraphVertexIdType; +} +export interface GesGraphEncryption { + /** + * Whether to enable data encryption The value can be true or false. The default value is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable GesGraph#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * ID of the customer master key created by DEW in the project corresponding to the graph creation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#master_key_id GesGraph#master_key_id} + */ + readonly masterKeyId?: string; +} + +export function gesGraphEncryptionToTerraform(struct?: GesGraphEncryptionOutputReference | GesGraphEncryption): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable: cdktf.booleanToTerraform(struct!.enable), + master_key_id: cdktf.stringToTerraform(struct!.masterKeyId), + } +} + + +export function gesGraphEncryptionToHclTerraform(struct?: GesGraphEncryptionOutputReference | GesGraphEncryption): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + master_key_id: { + value: cdktf.stringToHclTerraform(struct!.masterKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesGraphEncryptionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GesGraphEncryption | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + if (this._masterKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.masterKeyId = this._masterKeyId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesGraphEncryption | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enable = undefined; + this._masterKeyId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enable = value.enable; + this._masterKeyId = value.masterKeyId; + } + } + + // enable - computed: true, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // master_key_id - computed: true, optional: true, required: false + private _masterKeyId?: string; + public get masterKeyId() { + return this.getStringAttribute('master_key_id'); + } + public set masterKeyId(value: string) { + this._masterKeyId = value; + } + public resetMasterKeyId() { + this._masterKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterKeyIdInput() { + return this._masterKeyId; + } +} +export interface GesGraphLtsOperationTrace { + /** + * LTS log group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#audit_log_group_name GesGraph#audit_log_group_name} + */ + readonly auditLogGroupName?: string; + /** + * Whether to enable graph audit. The default value is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#enable_audit GesGraph#enable_audit} + */ + readonly enableAudit?: boolean | cdktf.IResolvable; +} + +export function gesGraphLtsOperationTraceToTerraform(struct?: GesGraphLtsOperationTraceOutputReference | GesGraphLtsOperationTrace): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + audit_log_group_name: cdktf.stringToTerraform(struct!.auditLogGroupName), + enable_audit: cdktf.booleanToTerraform(struct!.enableAudit), + } +} + + +export function gesGraphLtsOperationTraceToHclTerraform(struct?: GesGraphLtsOperationTraceOutputReference | GesGraphLtsOperationTrace): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + audit_log_group_name: { + value: cdktf.stringToHclTerraform(struct!.auditLogGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_audit: { + value: cdktf.booleanToHclTerraform(struct!.enableAudit), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesGraphLtsOperationTraceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GesGraphLtsOperationTrace | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._auditLogGroupName !== undefined) { + hasAnyValues = true; + internalValueResult.auditLogGroupName = this._auditLogGroupName; + } + if (this._enableAudit !== undefined) { + hasAnyValues = true; + internalValueResult.enableAudit = this._enableAudit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesGraphLtsOperationTrace | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._auditLogGroupName = undefined; + this._enableAudit = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._auditLogGroupName = value.auditLogGroupName; + this._enableAudit = value.enableAudit; + } + } + + // audit_log_group_name - computed: true, optional: true, required: false + private _auditLogGroupName?: string; + public get auditLogGroupName() { + return this.getStringAttribute('audit_log_group_name'); + } + public set auditLogGroupName(value: string) { + this._auditLogGroupName = value; + } + public resetAuditLogGroupName() { + this._auditLogGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get auditLogGroupNameInput() { + return this._auditLogGroupName; + } + + // enable_audit - computed: true, optional: true, required: false + private _enableAudit?: boolean | cdktf.IResolvable; + public get enableAudit() { + return this.getBooleanAttribute('enable_audit'); + } + public set enableAudit(value: boolean | cdktf.IResolvable) { + this._enableAudit = value; + } + public resetEnableAudit() { + this._enableAudit = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAuditInput() { + return this._enableAudit; + } +} +export interface GesGraphPublicIp { + /** + * The EIP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#eip_id GesGraph#eip_id} + */ + readonly eipId?: string; + /** + * The bind type of public IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#public_bind_type GesGraph#public_bind_type} + */ + readonly publicBindType?: string; +} + +export function gesGraphPublicIpToTerraform(struct?: GesGraphPublicIpOutputReference | GesGraphPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + eip_id: cdktf.stringToTerraform(struct!.eipId), + public_bind_type: cdktf.stringToTerraform(struct!.publicBindType), + } +} + + +export function gesGraphPublicIpToHclTerraform(struct?: GesGraphPublicIpOutputReference | GesGraphPublicIp): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + eip_id: { + value: cdktf.stringToHclTerraform(struct!.eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_bind_type: { + value: cdktf.stringToHclTerraform(struct!.publicBindType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesGraphPublicIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GesGraphPublicIp | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._eipId !== undefined) { + hasAnyValues = true; + internalValueResult.eipId = this._eipId; + } + if (this._publicBindType !== undefined) { + hasAnyValues = true; + internalValueResult.publicBindType = this._publicBindType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesGraphPublicIp | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._eipId = undefined; + this._publicBindType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._eipId = value.eipId; + this._publicBindType = value.publicBindType; + } + } + + // eip_id - computed: true, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // public_bind_type - computed: true, optional: true, required: false + private _publicBindType?: string; + public get publicBindType() { + return this.getStringAttribute('public_bind_type'); + } + public set publicBindType(value: string) { + this._publicBindType = value; + } + public resetPublicBindType() { + this._publicBindType = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicBindTypeInput() { + return this._publicBindType; + } +} +export interface GesGraphTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#create GesGraph#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#delete GesGraph#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#update GesGraph#update} + */ + readonly update?: string; +} + +export function gesGraphTimeoutsToTerraform(struct?: GesGraphTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function gesGraphTimeoutsToHclTerraform(struct?: GesGraphTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesGraphTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GesGraphTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesGraphTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface GesGraphVertexIdType { + /** + * The length of ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#id_length GesGraph#id_length} + */ + readonly idLength?: number; + /** + * Vertex ID type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#id_type GesGraph#id_type} + */ + readonly idType?: string; +} + +export function gesGraphVertexIdTypeToTerraform(struct?: GesGraphVertexIdTypeOutputReference | GesGraphVertexIdType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id_length: cdktf.numberToTerraform(struct!.idLength), + id_type: cdktf.stringToTerraform(struct!.idType), + } +} + + +export function gesGraphVertexIdTypeToHclTerraform(struct?: GesGraphVertexIdTypeOutputReference | GesGraphVertexIdType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id_length: { + value: cdktf.numberToHclTerraform(struct!.idLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id_type: { + value: cdktf.stringToHclTerraform(struct!.idType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesGraphVertexIdTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GesGraphVertexIdType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._idLength !== undefined) { + hasAnyValues = true; + internalValueResult.idLength = this._idLength; + } + if (this._idType !== undefined) { + hasAnyValues = true; + internalValueResult.idType = this._idType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesGraphVertexIdType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._idLength = undefined; + this._idType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._idLength = value.idLength; + this._idType = value.idType; + } + } + + // id_length - computed: true, optional: true, required: false + private _idLength?: number; + public get idLength() { + return this.getNumberAttribute('id_length'); + } + public set idLength(value: number) { + this._idLength = value; + } + public resetIdLength() { + this._idLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get idLengthInput() { + return this._idLength; + } + + // id_type - computed: true, optional: true, required: false + private _idType?: string; + public get idType() { + return this.getStringAttribute('id_type'); + } + public set idType(value: string) { + this._idType = value; + } + public resetIdType() { + this._idType = undefined; + } + // Temporarily expose input value. Use with caution. + public get idTypeInput() { + return this._idType; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph huaweicloud_ges_graph} +*/ +export class GesGraph extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ges_graph"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GesGraph resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GesGraph to import + * @param importFromId The id of the existing GesGraph that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GesGraph to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ges_graph", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_graph huaweicloud_ges_graph} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GesGraphConfig + */ + public constructor(scope: Construct, id: string, config: GesGraphConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ges_graph', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cpuArch = config.cpuArch; + this._cryptAlgorithm = config.cryptAlgorithm; + this._enableFullTextIndex = config.enableFullTextIndex; + this._enableHttps = config.enableHttps; + this._enableHyg = config.enableHyg; + this._enableMultiAz = config.enableMultiAz; + this._enableRbac = config.enableRbac; + this._enterpriseProjectId = config.enterpriseProjectId; + this._graphSizeTypeIndex = config.graphSizeTypeIndex; + this._id = config.id; + this._keepBackup = config.keepBackup; + this._name = config.name; + this._productType = config.productType; + this._region = config.region; + this._replication = config.replication; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._encryption.internalValue = config.encryption; + this._ltsOperationTrace.internalValue = config.ltsOperationTrace; + this._publicIp.internalValue = config.publicIp; + this._timeouts.internalValue = config.timeouts; + this._vertexIdType.internalValue = config.vertexIdType; + } + + // ========== + // ATTRIBUTES + // ========== + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // cpu_arch - computed: true, optional: true, required: false + private _cpuArch?: string; + public get cpuArch() { + return this.getStringAttribute('cpu_arch'); + } + public set cpuArch(value: string) { + this._cpuArch = value; + } + public resetCpuArch() { + this._cpuArch = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuArchInput() { + return this._cpuArch; + } + + // crypt_algorithm - computed: false, optional: false, required: true + private _cryptAlgorithm?: string; + public get cryptAlgorithm() { + return this.getStringAttribute('crypt_algorithm'); + } + public set cryptAlgorithm(value: string) { + this._cryptAlgorithm = value; + } + // Temporarily expose input value. Use with caution. + public get cryptAlgorithmInput() { + return this._cryptAlgorithm; + } + + // enable_full_text_index - computed: true, optional: true, required: false + private _enableFullTextIndex?: boolean | cdktf.IResolvable; + public get enableFullTextIndex() { + return this.getBooleanAttribute('enable_full_text_index'); + } + public set enableFullTextIndex(value: boolean | cdktf.IResolvable) { + this._enableFullTextIndex = value; + } + public resetEnableFullTextIndex() { + this._enableFullTextIndex = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableFullTextIndexInput() { + return this._enableFullTextIndex; + } + + // enable_https - computed: false, optional: false, required: true + private _enableHttps?: boolean | cdktf.IResolvable; + public get enableHttps() { + return this.getBooleanAttribute('enable_https'); + } + public set enableHttps(value: boolean | cdktf.IResolvable) { + this._enableHttps = value; + } + // Temporarily expose input value. Use with caution. + public get enableHttpsInput() { + return this._enableHttps; + } + + // enable_hyg - computed: true, optional: true, required: false + private _enableHyg?: boolean | cdktf.IResolvable; + public get enableHyg() { + return this.getBooleanAttribute('enable_hyg'); + } + public set enableHyg(value: boolean | cdktf.IResolvable) { + this._enableHyg = value; + } + public resetEnableHyg() { + this._enableHyg = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableHygInput() { + return this._enableHyg; + } + + // enable_multi_az - computed: true, optional: true, required: false + private _enableMultiAz?: boolean | cdktf.IResolvable; + public get enableMultiAz() { + return this.getBooleanAttribute('enable_multi_az'); + } + public set enableMultiAz(value: boolean | cdktf.IResolvable) { + this._enableMultiAz = value; + } + public resetEnableMultiAz() { + this._enableMultiAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableMultiAzInput() { + return this._enableMultiAz; + } + + // enable_rbac - computed: true, optional: true, required: false + private _enableRbac?: boolean | cdktf.IResolvable; + public get enableRbac() { + return this.getBooleanAttribute('enable_rbac'); + } + public set enableRbac(value: boolean | cdktf.IResolvable) { + this._enableRbac = value; + } + public resetEnableRbac() { + this._enableRbac = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableRbacInput() { + return this._enableRbac; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // graph_size_type_index - computed: false, optional: false, required: true + private _graphSizeTypeIndex?: string; + public get graphSizeTypeIndex() { + return this.getStringAttribute('graph_size_type_index'); + } + public set graphSizeTypeIndex(value: string) { + this._graphSizeTypeIndex = value; + } + // Temporarily expose input value. Use with caution. + public get graphSizeTypeIndexInput() { + return this._graphSizeTypeIndex; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keep_backup - computed: true, optional: true, required: false + private _keepBackup?: boolean | cdktf.IResolvable; + public get keepBackup() { + return this.getBooleanAttribute('keep_backup'); + } + public set keepBackup(value: boolean | cdktf.IResolvable) { + this._keepBackup = value; + } + public resetKeepBackup() { + this._keepBackup = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepBackupInput() { + return this._keepBackup; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // product_type - computed: true, optional: true, required: false + private _productType?: string; + public get productType() { + return this.getStringAttribute('product_type'); + } + public set productType(value: string) { + this._productType = value; + } + public resetProductType() { + this._productType = undefined; + } + // Temporarily expose input value. Use with caution. + public get productTypeInput() { + return this._productType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replication - computed: true, optional: true, required: false + private _replication?: number; + public get replication() { + return this.getNumberAttribute('replication'); + } + public set replication(value: number) { + this._replication = value; + } + public resetReplication() { + this._replication = undefined; + } + // Temporarily expose input value. Use with caution. + public get replicationInput() { + return this._replication; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // traffic_ip_list - computed: true, optional: false, required: false + public get trafficIpList() { + return this.getListAttribute('traffic_ip_list'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // encryption - computed: false, optional: true, required: false + private _encryption = new GesGraphEncryptionOutputReference(this, "encryption"); + public get encryption() { + return this._encryption; + } + public putEncryption(value: GesGraphEncryption) { + this._encryption.internalValue = value; + } + public resetEncryption() { + this._encryption.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionInput() { + return this._encryption.internalValue; + } + + // lts_operation_trace - computed: false, optional: true, required: false + private _ltsOperationTrace = new GesGraphLtsOperationTraceOutputReference(this, "lts_operation_trace"); + public get ltsOperationTrace() { + return this._ltsOperationTrace; + } + public putLtsOperationTrace(value: GesGraphLtsOperationTrace) { + this._ltsOperationTrace.internalValue = value; + } + public resetLtsOperationTrace() { + this._ltsOperationTrace.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsOperationTraceInput() { + return this._ltsOperationTrace.internalValue; + } + + // public_ip - computed: false, optional: true, required: false + private _publicIp = new GesGraphPublicIpOutputReference(this, "public_ip"); + public get publicIp() { + return this._publicIp; + } + public putPublicIp(value: GesGraphPublicIp) { + this._publicIp.internalValue = value; + } + public resetPublicIp() { + this._publicIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GesGraphTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GesGraphTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // vertex_id_type - computed: false, optional: true, required: false + private _vertexIdType = new GesGraphVertexIdTypeOutputReference(this, "vertex_id_type"); + public get vertexIdType() { + return this._vertexIdType; + } + public putVertexIdType(value: GesGraphVertexIdType) { + this._vertexIdType.internalValue = value; + } + public resetVertexIdType() { + this._vertexIdType.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get vertexIdTypeInput() { + return this._vertexIdType.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cpu_arch: cdktf.stringToTerraform(this._cpuArch), + crypt_algorithm: cdktf.stringToTerraform(this._cryptAlgorithm), + enable_full_text_index: cdktf.booleanToTerraform(this._enableFullTextIndex), + enable_https: cdktf.booleanToTerraform(this._enableHttps), + enable_hyg: cdktf.booleanToTerraform(this._enableHyg), + enable_multi_az: cdktf.booleanToTerraform(this._enableMultiAz), + enable_rbac: cdktf.booleanToTerraform(this._enableRbac), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + graph_size_type_index: cdktf.stringToTerraform(this._graphSizeTypeIndex), + id: cdktf.stringToTerraform(this._id), + keep_backup: cdktf.booleanToTerraform(this._keepBackup), + name: cdktf.stringToTerraform(this._name), + product_type: cdktf.stringToTerraform(this._productType), + region: cdktf.stringToTerraform(this._region), + replication: cdktf.numberToTerraform(this._replication), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + encryption: gesGraphEncryptionToTerraform(this._encryption.internalValue), + lts_operation_trace: gesGraphLtsOperationTraceToTerraform(this._ltsOperationTrace.internalValue), + public_ip: gesGraphPublicIpToTerraform(this._publicIp.internalValue), + timeouts: gesGraphTimeoutsToTerraform(this._timeouts.internalValue), + vertex_id_type: gesGraphVertexIdTypeToTerraform(this._vertexIdType.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cpu_arch: { + value: cdktf.stringToHclTerraform(this._cpuArch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + crypt_algorithm: { + value: cdktf.stringToHclTerraform(this._cryptAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_full_text_index: { + value: cdktf.booleanToHclTerraform(this._enableFullTextIndex), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_https: { + value: cdktf.booleanToHclTerraform(this._enableHttps), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_hyg: { + value: cdktf.booleanToHclTerraform(this._enableHyg), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_multi_az: { + value: cdktf.booleanToHclTerraform(this._enableMultiAz), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_rbac: { + value: cdktf.booleanToHclTerraform(this._enableRbac), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + graph_size_type_index: { + value: cdktf.stringToHclTerraform(this._graphSizeTypeIndex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_backup: { + value: cdktf.booleanToHclTerraform(this._keepBackup), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_type: { + value: cdktf.stringToHclTerraform(this._productType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replication: { + value: cdktf.numberToHclTerraform(this._replication), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption: { + value: gesGraphEncryptionToHclTerraform(this._encryption.internalValue), + isBlock: true, + type: "list", + storageClassType: "GesGraphEncryptionList", + }, + lts_operation_trace: { + value: gesGraphLtsOperationTraceToHclTerraform(this._ltsOperationTrace.internalValue), + isBlock: true, + type: "list", + storageClassType: "GesGraphLtsOperationTraceList", + }, + public_ip: { + value: gesGraphPublicIpToHclTerraform(this._publicIp.internalValue), + isBlock: true, + type: "list", + storageClassType: "GesGraphPublicIpList", + }, + timeouts: { + value: gesGraphTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GesGraphTimeouts", + }, + vertex_id_type: { + value: gesGraphVertexIdTypeToHclTerraform(this._vertexIdType.internalValue), + isBlock: true, + type: "list", + storageClassType: "GesGraphVertexIdTypeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ges-metadata/README.md b/src/constructs/providers/huaweicloud/ges-metadata/README.md new file mode 100644 index 00000000..9dae910a --- /dev/null +++ b/src/constructs/providers/huaweicloud/ges-metadata/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ges_metadata` + +Refer to the Terraform Registry for docs: [`huaweicloud_ges_metadata`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata). diff --git a/src/constructs/providers/huaweicloud/ges-metadata/index.ts b/src/constructs/providers/huaweicloud/ges-metadata/index.ts new file mode 100644 index 00000000..477acb07 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ges-metadata/index.ts @@ -0,0 +1,645 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GesMetadataConfig extends cdktf.TerraformMetaArguments { + /** + * Metadata description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#description GesMetadata#description} + */ + readonly description: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#id GesMetadata#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * OBS Path for storing the metadata. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#metadata_path GesMetadata#metadata_path} + */ + readonly metadataPath: string; + /** + * Metadata name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#name GesMetadata#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#region GesMetadata#region} + */ + readonly region?: string; + /** + * encryption block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#encryption GesMetadata#encryption} + */ + readonly encryption?: GesMetadataEncryption; + /** + * ges_metadata block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#ges_metadata GesMetadata#ges_metadata} + */ + readonly gesMetadata: GesMetadataGesMetadata; +} +export interface GesMetadataEncryption { + /** + * Whether to enable data encryption The value can be true or false. The default value is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#enable GesMetadata#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * ID of the customer master key created by DEW in the project where the graph is created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#master_key_id GesMetadata#master_key_id} + */ + readonly masterKeyId?: string; +} + +export function gesMetadataEncryptionToTerraform(struct?: GesMetadataEncryptionOutputReference | GesMetadataEncryption): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable: cdktf.booleanToTerraform(struct!.enable), + master_key_id: cdktf.stringToTerraform(struct!.masterKeyId), + } +} + + +export function gesMetadataEncryptionToHclTerraform(struct?: GesMetadataEncryptionOutputReference | GesMetadataEncryption): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + master_key_id: { + value: cdktf.stringToHclTerraform(struct!.masterKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesMetadataEncryptionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GesMetadataEncryption | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + if (this._masterKeyId !== undefined) { + hasAnyValues = true; + internalValueResult.masterKeyId = this._masterKeyId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesMetadataEncryption | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enable = undefined; + this._masterKeyId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enable = value.enable; + this._masterKeyId = value.masterKeyId; + } + } + + // enable - computed: true, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // master_key_id - computed: true, optional: true, required: false + private _masterKeyId?: string; + public get masterKeyId() { + return this.getStringAttribute('master_key_id'); + } + public set masterKeyId(value: string) { + this._masterKeyId = value; + } + public resetMasterKeyId() { + this._masterKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterKeyIdInput() { + return this._masterKeyId; + } +} +export interface GesMetadataGesMetadataLabels { + /** + * Name of a label. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#name GesMetadata#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#properties GesMetadata#properties} + */ + readonly properties?: { [key: string]: string }[] | cdktf.IResolvable; +} + +export function gesMetadataGesMetadataLabelsToTerraform(struct?: GesMetadataGesMetadataLabels | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + properties: cdktf.listMapper(cdktf.hashMapper(cdktf.stringToTerraform), false)(struct!.properties), + } +} + + +export function gesMetadataGesMetadataLabelsToHclTerraform(struct?: GesMetadataGesMetadataLabels | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + properties: { + value: cdktf.listMapperHcl(cdktf.hashMapperHcl(cdktf.stringToHclTerraform), false)(struct!.properties), + isBlock: false, + type: "list", + storageClassType: "stringMapList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesMetadataGesMetadataLabelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): GesMetadataGesMetadataLabels | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._properties !== undefined) { + hasAnyValues = true; + internalValueResult.properties = this._properties; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesMetadataGesMetadataLabels | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._properties = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._properties = value.properties; + } + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // properties - computed: true, optional: true, required: false + private _properties?: { [key: string]: string }[] | cdktf.IResolvable; + public get properties() { + return this.interpolationForAttribute('properties'); + } + public set properties(value: { [key: string]: string }[] | cdktf.IResolvable) { + this._properties = value; + } + public resetProperties() { + this._properties = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties; + } +} + +export class GesMetadataGesMetadataLabelsList extends cdktf.ComplexList { + public internalValue? : GesMetadataGesMetadataLabels[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): GesMetadataGesMetadataLabelsOutputReference { + return new GesMetadataGesMetadataLabelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface GesMetadataGesMetadata { + /** + * labels block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#labels GesMetadata#labels} + */ + readonly labels?: GesMetadataGesMetadataLabels[] | cdktf.IResolvable; +} + +export function gesMetadataGesMetadataToTerraform(struct?: GesMetadataGesMetadataOutputReference | GesMetadataGesMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + labels: cdktf.listMapper(gesMetadataGesMetadataLabelsToTerraform, true)(struct!.labels), + } +} + + +export function gesMetadataGesMetadataToHclTerraform(struct?: GesMetadataGesMetadataOutputReference | GesMetadataGesMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + labels: { + value: cdktf.listMapperHcl(gesMetadataGesMetadataLabelsToHclTerraform, true)(struct!.labels), + isBlock: true, + type: "list", + storageClassType: "GesMetadataGesMetadataLabelsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GesMetadataGesMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GesMetadataGesMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._labels?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.labels = this._labels?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GesMetadataGesMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._labels.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._labels.internalValue = value.labels; + } + } + + // labels - computed: false, optional: true, required: false + private _labels = new GesMetadataGesMetadataLabelsList(this, "labels", false); + public get labels() { + return this._labels; + } + public putLabels(value: GesMetadataGesMetadataLabels[] | cdktf.IResolvable) { + this._labels.internalValue = value; + } + public resetLabels() { + this._labels.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata huaweicloud_ges_metadata} +*/ +export class GesMetadata extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ges_metadata"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GesMetadata resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GesMetadata to import + * @param importFromId The id of the existing GesMetadata that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GesMetadata to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ges_metadata", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ges_metadata huaweicloud_ges_metadata} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GesMetadataConfig + */ + public constructor(scope: Construct, id: string, config: GesMetadataConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ges_metadata', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._metadataPath = config.metadataPath; + this._name = config.name; + this._region = config.region; + this._encryption.internalValue = config.encryption; + this._gesMetadata.internalValue = config.gesMetadata; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // metadata_path - computed: false, optional: false, required: true + private _metadataPath?: string; + public get metadataPath() { + return this.getStringAttribute('metadata_path'); + } + public set metadataPath(value: string) { + this._metadataPath = value; + } + // Temporarily expose input value. Use with caution. + public get metadataPathInput() { + return this._metadataPath; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // encryption - computed: false, optional: true, required: false + private _encryption = new GesMetadataEncryptionOutputReference(this, "encryption"); + public get encryption() { + return this._encryption; + } + public putEncryption(value: GesMetadataEncryption) { + this._encryption.internalValue = value; + } + public resetEncryption() { + this._encryption.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionInput() { + return this._encryption.internalValue; + } + + // ges_metadata - computed: false, optional: false, required: true + private _gesMetadata = new GesMetadataGesMetadataOutputReference(this, "ges_metadata"); + public get gesMetadata() { + return this._gesMetadata; + } + public putGesMetadata(value: GesMetadataGesMetadata) { + this._gesMetadata.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get gesMetadataInput() { + return this._gesMetadata.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + metadata_path: cdktf.stringToTerraform(this._metadataPath), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + encryption: gesMetadataEncryptionToTerraform(this._encryption.internalValue), + ges_metadata: gesMetadataGesMetadataToTerraform(this._gesMetadata.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata_path: { + value: cdktf.stringToHclTerraform(this._metadataPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption: { + value: gesMetadataEncryptionToHclTerraform(this._encryption.internalValue), + isBlock: true, + type: "list", + storageClassType: "GesMetadataEncryptionList", + }, + ges_metadata: { + value: gesMetadataGesMetadataToHclTerraform(this._gesMetadata.internalValue), + isBlock: true, + type: "list", + storageClassType: "GesMetadataGesMetadataList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/global-eip-associate/README.md b/src/constructs/providers/huaweicloud/global-eip-associate/README.md new file mode 100644 index 00000000..c0fe7d16 --- /dev/null +++ b/src/constructs/providers/huaweicloud/global-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_global_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_global_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate). diff --git a/src/constructs/providers/huaweicloud/global-eip-associate/index.ts b/src/constructs/providers/huaweicloud/global-eip-associate/index.ts new file mode 100644 index 00000000..dc471970 --- /dev/null +++ b/src/constructs/providers/huaweicloud/global-eip-associate/index.ts @@ -0,0 +1,902 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GlobalEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#global_eip_id GlobalEipAssociate#global_eip_id} + */ + readonly globalEipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#id GlobalEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#is_reserve_gcb GlobalEipAssociate#is_reserve_gcb} + */ + readonly isReserveGcb: boolean | cdktf.IResolvable; + /** + * associate_instance block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#associate_instance GlobalEipAssociate#associate_instance} + */ + readonly associateInstance: GlobalEipAssociateAssociateInstance; + /** + * gc_bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#gc_bandwidth GlobalEipAssociate#gc_bandwidth} + */ + readonly gcBandwidth?: GlobalEipAssociateGcBandwidth; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#timeouts GlobalEipAssociate#timeouts} + */ + readonly timeouts?: GlobalEipAssociateTimeouts; +} +export interface GlobalEipAssociateAssociateInstance { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#instance_id GlobalEipAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#instance_type GlobalEipAssociate#instance_type} + */ + readonly instanceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#project_id GlobalEipAssociate#project_id} + */ + readonly projectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#region GlobalEipAssociate#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#service_id GlobalEipAssociate#service_id} + */ + readonly serviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#service_type GlobalEipAssociate#service_type} + */ + readonly serviceType?: string; +} + +export function globalEipAssociateAssociateInstanceToTerraform(struct?: GlobalEipAssociateAssociateInstanceOutputReference | GlobalEipAssociateAssociateInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + instance_id: cdktf.stringToTerraform(struct!.instanceId), + instance_type: cdktf.stringToTerraform(struct!.instanceType), + project_id: cdktf.stringToTerraform(struct!.projectId), + region: cdktf.stringToTerraform(struct!.region), + service_id: cdktf.stringToTerraform(struct!.serviceId), + service_type: cdktf.stringToTerraform(struct!.serviceType), + } +} + + +export function globalEipAssociateAssociateInstanceToHclTerraform(struct?: GlobalEipAssociateAssociateInstanceOutputReference | GlobalEipAssociateAssociateInstance): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_type: { + value: cdktf.stringToHclTerraform(struct!.instanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(struct!.serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(struct!.serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GlobalEipAssociateAssociateInstanceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GlobalEipAssociateAssociateInstance | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + if (this._instanceType !== undefined) { + hasAnyValues = true; + internalValueResult.instanceType = this._instanceType; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._serviceId !== undefined) { + hasAnyValues = true; + internalValueResult.serviceId = this._serviceId; + } + if (this._serviceType !== undefined) { + hasAnyValues = true; + internalValueResult.serviceType = this._serviceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GlobalEipAssociateAssociateInstance | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._instanceId = undefined; + this._instanceType = undefined; + this._projectId = undefined; + this._region = undefined; + this._serviceId = undefined; + this._serviceType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._instanceId = value.instanceId; + this._instanceType = value.instanceType; + this._projectId = value.projectId; + this._region = value.region; + this._serviceId = value.serviceId; + this._serviceType = value.serviceType; + } + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // instance_type - computed: false, optional: false, required: true + private _instanceType?: string; + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + public set instanceType(value: string) { + this._instanceType = value; + } + // Temporarily expose input value. Use with caution. + public get instanceTypeInput() { + return this._instanceType; + } + + // project_id - computed: false, optional: false, required: true + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_id - computed: true, optional: true, required: false + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + public resetServiceId() { + this._serviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // service_type - computed: true, optional: true, required: false + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } +} +export interface GlobalEipAssociateGcBandwidth { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#charge_mode GlobalEipAssociate#charge_mode} + */ + readonly chargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#description GlobalEipAssociate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#enterprise_project_id GlobalEipAssociate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#id GlobalEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#name GlobalEipAssociate#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#size GlobalEipAssociate#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#tags GlobalEipAssociate#tags} + */ + readonly tags?: { [key: string]: string }; +} + +export function globalEipAssociateGcBandwidthToTerraform(struct?: GlobalEipAssociateGcBandwidthOutputReference | GlobalEipAssociateGcBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + description: cdktf.stringToTerraform(struct!.description), + enterprise_project_id: cdktf.stringToTerraform(struct!.enterpriseProjectId), + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + size: cdktf.numberToTerraform(struct!.size), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.tags), + } +} + + +export function globalEipAssociateGcBandwidthToHclTerraform(struct?: GlobalEipAssociateGcBandwidthOutputReference | GlobalEipAssociateGcBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(struct!.enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GlobalEipAssociateGcBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): GlobalEipAssociateGcBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enterpriseProjectId !== undefined) { + hasAnyValues = true; + internalValueResult.enterpriseProjectId = this._enterpriseProjectId; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._tags !== undefined) { + hasAnyValues = true; + internalValueResult.tags = this._tags; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GlobalEipAssociateGcBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargeMode = undefined; + this._description = undefined; + this._enterpriseProjectId = undefined; + this._id = undefined; + this._name = undefined; + this._size = undefined; + this._tags = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargeMode = value.chargeMode; + this._description = value.description; + this._enterpriseProjectId = value.enterpriseProjectId; + this._id = value.id; + this._name = value.name; + this._size = value.size; + this._tags = value.tags; + } + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } +} +export interface GlobalEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#create GlobalEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#delete GlobalEipAssociate#delete} + */ + readonly delete?: string; +} + +export function globalEipAssociateTimeoutsToTerraform(struct?: GlobalEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function globalEipAssociateTimeoutsToHclTerraform(struct?: GlobalEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class GlobalEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): GlobalEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: GlobalEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate huaweicloud_global_eip_associate} +*/ +export class GlobalEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GlobalEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GlobalEipAssociate to import + * @param importFromId The id of the existing GlobalEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GlobalEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip_associate huaweicloud_global_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GlobalEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: GlobalEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._globalEipId = config.globalEipId; + this._id = config.id; + this._isReserveGcb = config.isReserveGcb; + this._associateInstance.internalValue = config.associateInstance; + this._gcBandwidth.internalValue = config.gcBandwidth; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // global_eip_id - computed: false, optional: false, required: true + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_reserve_gcb - computed: false, optional: false, required: true + private _isReserveGcb?: boolean | cdktf.IResolvable; + public get isReserveGcb() { + return this.getBooleanAttribute('is_reserve_gcb'); + } + public set isReserveGcb(value: boolean | cdktf.IResolvable) { + this._isReserveGcb = value; + } + // Temporarily expose input value. Use with caution. + public get isReserveGcbInput() { + return this._isReserveGcb; + } + + // associate_instance - computed: false, optional: false, required: true + private _associateInstance = new GlobalEipAssociateAssociateInstanceOutputReference(this, "associate_instance"); + public get associateInstance() { + return this._associateInstance; + } + public putAssociateInstance(value: GlobalEipAssociateAssociateInstance) { + this._associateInstance.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get associateInstanceInput() { + return this._associateInstance.internalValue; + } + + // gc_bandwidth - computed: false, optional: true, required: false + private _gcBandwidth = new GlobalEipAssociateGcBandwidthOutputReference(this, "gc_bandwidth"); + public get gcBandwidth() { + return this._gcBandwidth; + } + public putGcBandwidth(value: GlobalEipAssociateGcBandwidth) { + this._gcBandwidth.internalValue = value; + } + public resetGcBandwidth() { + this._gcBandwidth.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get gcBandwidthInput() { + return this._gcBandwidth.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new GlobalEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: GlobalEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + is_reserve_gcb: cdktf.booleanToTerraform(this._isReserveGcb), + associate_instance: globalEipAssociateAssociateInstanceToTerraform(this._associateInstance.internalValue), + gc_bandwidth: globalEipAssociateGcBandwidthToTerraform(this._gcBandwidth.internalValue), + timeouts: globalEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_reserve_gcb: { + value: cdktf.booleanToHclTerraform(this._isReserveGcb), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + associate_instance: { + value: globalEipAssociateAssociateInstanceToHclTerraform(this._associateInstance.internalValue), + isBlock: true, + type: "list", + storageClassType: "GlobalEipAssociateAssociateInstanceList", + }, + gc_bandwidth: { + value: globalEipAssociateGcBandwidthToHclTerraform(this._gcBandwidth.internalValue), + isBlock: true, + type: "list", + storageClassType: "GlobalEipAssociateGcBandwidthList", + }, + timeouts: { + value: globalEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "GlobalEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/global-eip/README.md b/src/constructs/providers/huaweicloud/global-eip/README.md new file mode 100644 index 00000000..cef1e9df --- /dev/null +++ b/src/constructs/providers/huaweicloud/global-eip/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_global_eip` + +Refer to the Terraform Registry for docs: [`huaweicloud_global_eip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip). diff --git a/src/constructs/providers/huaweicloud/global-eip/index.ts b/src/constructs/providers/huaweicloud/global-eip/index.ts new file mode 100644 index 00000000..32147fca --- /dev/null +++ b/src/constructs/providers/huaweicloud/global-eip/index.ts @@ -0,0 +1,373 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GlobalEipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#access_site GlobalEip#access_site} + */ + readonly accessSite: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#description GlobalEip#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#enterprise_project_id GlobalEip#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#geip_pool_name GlobalEip#geip_pool_name} + */ + readonly geipPoolName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#id GlobalEip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#internet_bandwidth_id GlobalEip#internet_bandwidth_id} + */ + readonly internetBandwidthId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#name GlobalEip#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#tags GlobalEip#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip huaweicloud_global_eip} +*/ +export class GlobalEip extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_eip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GlobalEip resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GlobalEip to import + * @param importFromId The id of the existing GlobalEip that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GlobalEip to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_eip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_eip huaweicloud_global_eip} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GlobalEipConfig + */ + public constructor(scope: Construct, id: string, config: GlobalEipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_eip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessSite = config.accessSite; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._geipPoolName = config.geipPoolName; + this._id = config.id; + this._internetBandwidthId = config.internetBandwidthId; + this._name = config.name; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_site - computed: false, optional: false, required: true + private _accessSite?: string; + public get accessSite() { + return this.getStringAttribute('access_site'); + } + public set accessSite(value: string) { + this._accessSite = value; + } + // Temporarily expose input value. Use with caution. + public get accessSiteInput() { + return this._accessSite; + } + + // associate_instance_id - computed: true, optional: false, required: false + public get associateInstanceId() { + return this.getStringAttribute('associate_instance_id'); + } + + // associate_instance_region - computed: true, optional: false, required: false + public get associateInstanceRegion() { + return this.getStringAttribute('associate_instance_region'); + } + + // associate_instance_type - computed: true, optional: false, required: false + public get associateInstanceType() { + return this.getStringAttribute('associate_instance_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // frozen - computed: true, optional: false, required: false + public get frozen() { + return this.getBooleanAttribute('frozen'); + } + + // frozen_info - computed: true, optional: false, required: false + public get frozenInfo() { + return this.getStringAttribute('frozen_info'); + } + + // geip_pool_name - computed: false, optional: false, required: true + private _geipPoolName?: string; + public get geipPoolName() { + return this.getStringAttribute('geip_pool_name'); + } + public set geipPoolName(value: string) { + this._geipPoolName = value; + } + // Temporarily expose input value. Use with caution. + public get geipPoolNameInput() { + return this._geipPoolName; + } + + // global_connection_bandwidth_id - computed: true, optional: false, required: false + public get globalConnectionBandwidthId() { + return this.getStringAttribute('global_connection_bandwidth_id'); + } + + // global_connection_bandwidth_type - computed: true, optional: false, required: false + public get globalConnectionBandwidthType() { + return this.getStringAttribute('global_connection_bandwidth_type'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internet_bandwidth_id - computed: false, optional: false, required: true + private _internetBandwidthId?: string; + public get internetBandwidthId() { + return this.getStringAttribute('internet_bandwidth_id'); + } + public set internetBandwidthId(value: string) { + this._internetBandwidthId = value; + } + // Temporarily expose input value. Use with caution. + public get internetBandwidthIdInput() { + return this._internetBandwidthId; + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // isp - computed: true, optional: false, required: false + public get isp() { + return this.getStringAttribute('isp'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // polluted - computed: true, optional: false, required: false + public get polluted() { + return this.getBooleanAttribute('polluted'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_site: cdktf.stringToTerraform(this._accessSite), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + geip_pool_name: cdktf.stringToTerraform(this._geipPoolName), + id: cdktf.stringToTerraform(this._id), + internet_bandwidth_id: cdktf.stringToTerraform(this._internetBandwidthId), + name: cdktf.stringToTerraform(this._name), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_site: { + value: cdktf.stringToHclTerraform(this._accessSite), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + geip_pool_name: { + value: cdktf.stringToHclTerraform(this._geipPoolName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internet_bandwidth_id: { + value: cdktf.stringToHclTerraform(this._internetBandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/global-internet-bandwidth/README.md b/src/constructs/providers/huaweicloud/global-internet-bandwidth/README.md new file mode 100644 index 00000000..8b9e7164 --- /dev/null +++ b/src/constructs/providers/huaweicloud/global-internet-bandwidth/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_global_internet_bandwidth` + +Refer to the Terraform Registry for docs: [`huaweicloud_global_internet_bandwidth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth). diff --git a/src/constructs/providers/huaweicloud/global-internet-bandwidth/index.ts b/src/constructs/providers/huaweicloud/global-internet-bandwidth/index.ts new file mode 100644 index 00000000..d8d41a1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/global-internet-bandwidth/index.ts @@ -0,0 +1,409 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface GlobalInternetBandwidthConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#access_site GlobalInternetBandwidth#access_site} + */ + readonly accessSite: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#charge_mode GlobalInternetBandwidth#charge_mode} + */ + readonly chargeMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#description GlobalInternetBandwidth#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#enterprise_project_id GlobalInternetBandwidth#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#id GlobalInternetBandwidth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#ingress_size GlobalInternetBandwidth#ingress_size} + */ + readonly ingressSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#isp GlobalInternetBandwidth#isp} + */ + readonly isp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#name GlobalInternetBandwidth#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#size GlobalInternetBandwidth#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#tags GlobalInternetBandwidth#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#type GlobalInternetBandwidth#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth huaweicloud_global_internet_bandwidth} +*/ +export class GlobalInternetBandwidth extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_global_internet_bandwidth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a GlobalInternetBandwidth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the GlobalInternetBandwidth to import + * @param importFromId The id of the existing GlobalInternetBandwidth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the GlobalInternetBandwidth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_global_internet_bandwidth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/global_internet_bandwidth huaweicloud_global_internet_bandwidth} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options GlobalInternetBandwidthConfig + */ + public constructor(scope: Construct, id: string, config: GlobalInternetBandwidthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_global_internet_bandwidth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessSite = config.accessSite; + this._chargeMode = config.chargeMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ingressSize = config.ingressSize; + this._isp = config.isp; + this._name = config.name; + this._size = config.size; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_site - computed: false, optional: false, required: true + private _accessSite?: string; + public get accessSite() { + return this.getStringAttribute('access_site'); + } + public set accessSite(value: string) { + this._accessSite = value; + } + // Temporarily expose input value. Use with caution. + public get accessSiteInput() { + return this._accessSite; + } + + // charge_mode - computed: false, optional: false, required: true + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // frozen_info - computed: true, optional: false, required: false + public get frozenInfo() { + return this.getStringAttribute('frozen_info'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ingress_size - computed: true, optional: true, required: false + private _ingressSize?: number; + public get ingressSize() { + return this.getNumberAttribute('ingress_size'); + } + public set ingressSize(value: number) { + this._ingressSize = value; + } + public resetIngressSize() { + this._ingressSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get ingressSizeInput() { + return this._ingressSize; + } + + // isp - computed: false, optional: false, required: true + private _isp?: string; + public get isp() { + return this.getStringAttribute('isp'); + } + public set isp(value: string) { + this._isp = value; + } + // Temporarily expose input value. Use with caution. + public get ispInput() { + return this._isp; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ratio_95peak - computed: true, optional: false, required: false + public get ratio95Peak() { + return this.getNumberAttribute('ratio_95peak'); + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: true, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_site: cdktf.stringToTerraform(this._accessSite), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ingress_size: cdktf.numberToTerraform(this._ingressSize), + isp: cdktf.stringToTerraform(this._isp), + name: cdktf.stringToTerraform(this._name), + size: cdktf.numberToTerraform(this._size), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_site: { + value: cdktf.stringToHclTerraform(this._accessSite), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ingress_size: { + value: cdktf.numberToHclTerraform(this._ingressSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + isp: { + value: cdktf.stringToHclTerraform(this._isp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/hss-cce-protection/README.md b/src/constructs/providers/huaweicloud/hss-cce-protection/README.md new file mode 100644 index 00000000..5f3ade9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-cce-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_hss_cce_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_hss_cce_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection). diff --git a/src/constructs/providers/huaweicloud/hss-cce-protection/index.ts b/src/constructs/providers/huaweicloud/hss-cce-protection/index.ts new file mode 100644 index 00000000..5d4c2b8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-cce-protection/index.ts @@ -0,0 +1,919 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface HssCceProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the agent version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#agent_version HssCceProtection#agent_version} + */ + readonly agentVersion?: string; + /** + * Specifies whether to enable automatic agent upgrade. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#auto_upgrade HssCceProtection#auto_upgrade} + */ + readonly autoUpgrade?: boolean | cdktf.IResolvable; + /** + * Specifies the CCE protection type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#cce_protection_type HssCceProtection#cce_protection_type} + */ + readonly cceProtectionType: string; + /** + * Specifies the charging mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#charging_mode HssCceProtection#charging_mode} + */ + readonly chargingMode: string; + /** + * Specifies the CCE cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#cluster_id HssCceProtection#cluster_id} + */ + readonly clusterId: string; + /** + * Specifies the CCE cluster name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#cluster_name HssCceProtection#cluster_name} + */ + readonly clusterName: string; + /** + * Specifies the CCE cluster type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#cluster_type HssCceProtection#cluster_type} + */ + readonly clusterType: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#enterprise_project_id HssCceProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#id HssCceProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the invoked service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#invoked_service HssCceProtection#invoked_service} + */ + readonly invokedService?: string; + /** + * Specifies whether to prefer the package period quota. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#prefer_packet_cycle HssCceProtection#prefer_packet_cycle} + */ + readonly preferPacketCycle?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#region HssCceProtection#region} + */ + readonly region?: string; + /** + * runtime_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#runtime_info HssCceProtection#runtime_info} + */ + readonly runtimeInfo?: HssCceProtectionRuntimeInfo[] | cdktf.IResolvable; + /** + * schedule_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#schedule_info HssCceProtection#schedule_info} + */ + readonly scheduleInfo?: HssCceProtectionScheduleInfo; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#timeouts HssCceProtection#timeouts} + */ + readonly timeouts?: HssCceProtectionTimeouts; +} +export interface HssCceProtectionRuntimeInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#runtime_name HssCceProtection#runtime_name} + */ + readonly runtimeName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#runtime_path HssCceProtection#runtime_path} + */ + readonly runtimePath?: string; +} + +export function hssCceProtectionRuntimeInfoToTerraform(struct?: HssCceProtectionRuntimeInfo | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + runtime_name: cdktf.stringToTerraform(struct!.runtimeName), + runtime_path: cdktf.stringToTerraform(struct!.runtimePath), + } +} + + +export function hssCceProtectionRuntimeInfoToHclTerraform(struct?: HssCceProtectionRuntimeInfo | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + runtime_name: { + value: cdktf.stringToHclTerraform(struct!.runtimeName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_path: { + value: cdktf.stringToHclTerraform(struct!.runtimePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class HssCceProtectionRuntimeInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): HssCceProtectionRuntimeInfo | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._runtimeName !== undefined) { + hasAnyValues = true; + internalValueResult.runtimeName = this._runtimeName; + } + if (this._runtimePath !== undefined) { + hasAnyValues = true; + internalValueResult.runtimePath = this._runtimePath; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: HssCceProtectionRuntimeInfo | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._runtimeName = undefined; + this._runtimePath = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._runtimeName = value.runtimeName; + this._runtimePath = value.runtimePath; + } + } + + // runtime_name - computed: false, optional: true, required: false + private _runtimeName?: string; + public get runtimeName() { + return this.getStringAttribute('runtime_name'); + } + public set runtimeName(value: string) { + this._runtimeName = value; + } + public resetRuntimeName() { + this._runtimeName = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeNameInput() { + return this._runtimeName; + } + + // runtime_path - computed: false, optional: true, required: false + private _runtimePath?: string; + public get runtimePath() { + return this.getStringAttribute('runtime_path'); + } + public set runtimePath(value: string) { + this._runtimePath = value; + } + public resetRuntimePath() { + this._runtimePath = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimePathInput() { + return this._runtimePath; + } +} + +export class HssCceProtectionRuntimeInfoList extends cdktf.ComplexList { + public internalValue? : HssCceProtectionRuntimeInfo[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): HssCceProtectionRuntimeInfoOutputReference { + return new HssCceProtectionRuntimeInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface HssCceProtectionScheduleInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#node_selector HssCceProtection#node_selector} + */ + readonly nodeSelector?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#pod_tolerances HssCceProtection#pod_tolerances} + */ + readonly podTolerances?: string[]; +} + +export function hssCceProtectionScheduleInfoToTerraform(struct?: HssCceProtectionScheduleInfoOutputReference | HssCceProtectionScheduleInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + node_selector: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.nodeSelector), + pod_tolerances: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.podTolerances), + } +} + + +export function hssCceProtectionScheduleInfoToHclTerraform(struct?: HssCceProtectionScheduleInfoOutputReference | HssCceProtectionScheduleInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + node_selector: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.nodeSelector), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + pod_tolerances: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.podTolerances), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class HssCceProtectionScheduleInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): HssCceProtectionScheduleInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._nodeSelector !== undefined) { + hasAnyValues = true; + internalValueResult.nodeSelector = this._nodeSelector; + } + if (this._podTolerances !== undefined) { + hasAnyValues = true; + internalValueResult.podTolerances = this._podTolerances; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: HssCceProtectionScheduleInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._nodeSelector = undefined; + this._podTolerances = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._nodeSelector = value.nodeSelector; + this._podTolerances = value.podTolerances; + } + } + + // node_selector - computed: false, optional: true, required: false + private _nodeSelector?: string[]; + public get nodeSelector() { + return this.getListAttribute('node_selector'); + } + public set nodeSelector(value: string[]) { + this._nodeSelector = value; + } + public resetNodeSelector() { + this._nodeSelector = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeSelectorInput() { + return this._nodeSelector; + } + + // pod_tolerances - computed: false, optional: true, required: false + private _podTolerances?: string[]; + public get podTolerances() { + return this.getListAttribute('pod_tolerances'); + } + public set podTolerances(value: string[]) { + this._podTolerances = value; + } + public resetPodTolerances() { + this._podTolerances = undefined; + } + // Temporarily expose input value. Use with caution. + public get podTolerancesInput() { + return this._podTolerances; + } +} +export interface HssCceProtectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#create HssCceProtection#create} + */ + readonly create?: string; +} + +export function hssCceProtectionTimeoutsToTerraform(struct?: HssCceProtectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function hssCceProtectionTimeoutsToHclTerraform(struct?: HssCceProtectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class HssCceProtectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): HssCceProtectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: HssCceProtectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection huaweicloud_hss_cce_protection} +*/ +export class HssCceProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_cce_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a HssCceProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the HssCceProtection to import + * @param importFromId The id of the existing HssCceProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the HssCceProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_cce_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_cce_protection huaweicloud_hss_cce_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options HssCceProtectionConfig + */ + public constructor(scope: Construct, id: string, config: HssCceProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_cce_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agentVersion = config.agentVersion; + this._autoUpgrade = config.autoUpgrade; + this._cceProtectionType = config.cceProtectionType; + this._chargingMode = config.chargingMode; + this._clusterId = config.clusterId; + this._clusterName = config.clusterName; + this._clusterType = config.clusterType; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._invokedService = config.invokedService; + this._preferPacketCycle = config.preferPacketCycle; + this._region = config.region; + this._runtimeInfo.internalValue = config.runtimeInfo; + this._scheduleInfo.internalValue = config.scheduleInfo; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_version - computed: false, optional: true, required: false + private _agentVersion?: string; + public get agentVersion() { + return this.getStringAttribute('agent_version'); + } + public set agentVersion(value: string) { + this._agentVersion = value; + } + public resetAgentVersion() { + this._agentVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentVersionInput() { + return this._agentVersion; + } + + // auto_upgrade - computed: true, optional: true, required: false + private _autoUpgrade?: boolean | cdktf.IResolvable; + public get autoUpgrade() { + return this.getBooleanAttribute('auto_upgrade'); + } + public set autoUpgrade(value: boolean | cdktf.IResolvable) { + this._autoUpgrade = value; + } + public resetAutoUpgrade() { + this._autoUpgrade = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoUpgradeInput() { + return this._autoUpgrade; + } + + // cce_protection_type - computed: false, optional: false, required: true + private _cceProtectionType?: string; + public get cceProtectionType() { + return this.getStringAttribute('cce_protection_type'); + } + public set cceProtectionType(value: string) { + this._cceProtectionType = value; + } + // Temporarily expose input value. Use with caution. + public get cceProtectionTypeInput() { + return this._cceProtectionType; + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: false, optional: false, required: true + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // cluster_type - computed: false, optional: false, required: true + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fail_reason - computed: true, optional: false, required: false + public get failReason() { + return this.getStringAttribute('fail_reason'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // invoked_service - computed: false, optional: true, required: false + private _invokedService?: string; + public get invokedService() { + return this.getStringAttribute('invoked_service'); + } + public set invokedService(value: string) { + this._invokedService = value; + } + public resetInvokedService() { + this._invokedService = undefined; + } + // Temporarily expose input value. Use with caution. + public get invokedServiceInput() { + return this._invokedService; + } + + // node_total_num - computed: true, optional: false, required: false + public get nodeTotalNum() { + return this.getNumberAttribute('node_total_num'); + } + + // prefer_packet_cycle - computed: true, optional: true, required: false + private _preferPacketCycle?: boolean | cdktf.IResolvable; + public get preferPacketCycle() { + return this.getBooleanAttribute('prefer_packet_cycle'); + } + public set preferPacketCycle(value: boolean | cdktf.IResolvable) { + this._preferPacketCycle = value; + } + public resetPreferPacketCycle() { + this._preferPacketCycle = undefined; + } + // Temporarily expose input value. Use with caution. + public get preferPacketCycleInput() { + return this._preferPacketCycle; + } + + // protect_interrupt_node_num - computed: true, optional: false, required: false + public get protectInterruptNodeNum() { + return this.getNumberAttribute('protect_interrupt_node_num'); + } + + // protect_node_num - computed: true, optional: false, required: false + public get protectNodeNum() { + return this.getNumberAttribute('protect_node_num'); + } + + // protect_status - computed: true, optional: false, required: false + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + + // protect_type - computed: true, optional: false, required: false + public get protectType() { + return this.getStringAttribute('protect_type'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // unprotect_node_num - computed: true, optional: false, required: false + public get unprotectNodeNum() { + return this.getNumberAttribute('unprotect_node_num'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // runtime_info - computed: false, optional: true, required: false + private _runtimeInfo = new HssCceProtectionRuntimeInfoList(this, "runtime_info", false); + public get runtimeInfo() { + return this._runtimeInfo; + } + public putRuntimeInfo(value: HssCceProtectionRuntimeInfo[] | cdktf.IResolvable) { + this._runtimeInfo.internalValue = value; + } + public resetRuntimeInfo() { + this._runtimeInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInfoInput() { + return this._runtimeInfo.internalValue; + } + + // schedule_info - computed: false, optional: true, required: false + private _scheduleInfo = new HssCceProtectionScheduleInfoOutputReference(this, "schedule_info"); + public get scheduleInfo() { + return this._scheduleInfo; + } + public putScheduleInfo(value: HssCceProtectionScheduleInfo) { + this._scheduleInfo.internalValue = value; + } + public resetScheduleInfo() { + this._scheduleInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleInfoInput() { + return this._scheduleInfo.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new HssCceProtectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: HssCceProtectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agent_version: cdktf.stringToTerraform(this._agentVersion), + auto_upgrade: cdktf.booleanToTerraform(this._autoUpgrade), + cce_protection_type: cdktf.stringToTerraform(this._cceProtectionType), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_name: cdktf.stringToTerraform(this._clusterName), + cluster_type: cdktf.stringToTerraform(this._clusterType), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + invoked_service: cdktf.stringToTerraform(this._invokedService), + prefer_packet_cycle: cdktf.booleanToTerraform(this._preferPacketCycle), + region: cdktf.stringToTerraform(this._region), + runtime_info: cdktf.listMapper(hssCceProtectionRuntimeInfoToTerraform, true)(this._runtimeInfo.internalValue), + schedule_info: hssCceProtectionScheduleInfoToTerraform(this._scheduleInfo.internalValue), + timeouts: hssCceProtectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agent_version: { + value: cdktf.stringToHclTerraform(this._agentVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_upgrade: { + value: cdktf.booleanToHclTerraform(this._autoUpgrade), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + cce_protection_type: { + value: cdktf.stringToHclTerraform(this._cceProtectionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invoked_service: { + value: cdktf.stringToHclTerraform(this._invokedService), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prefer_packet_cycle: { + value: cdktf.booleanToHclTerraform(this._preferPacketCycle), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime_info: { + value: cdktf.listMapperHcl(hssCceProtectionRuntimeInfoToHclTerraform, true)(this._runtimeInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "HssCceProtectionRuntimeInfoList", + }, + schedule_info: { + value: hssCceProtectionScheduleInfoToHclTerraform(this._scheduleInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "HssCceProtectionScheduleInfoList", + }, + timeouts: { + value: hssCceProtectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "HssCceProtectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/hss-host-group/README.md b/src/constructs/providers/huaweicloud/hss-host-group/README.md new file mode 100644 index 00000000..9e786ca6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-host-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_hss_host_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_hss_host_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group). diff --git a/src/constructs/providers/huaweicloud/hss-host-group/index.ts b/src/constructs/providers/huaweicloud/hss-host-group/index.ts new file mode 100644 index 00000000..983d20c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-host-group/index.ts @@ -0,0 +1,410 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface HssHostGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the host group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#enterprise_project_id HssHostGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Required; The list of host IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#host_ids HssHostGroup#host_ids} + */ + readonly hostIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#id HssHostGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#name HssHostGroup#name} + */ + readonly name: string; + /** + * The region where the host group is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#region HssHostGroup#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#timeouts HssHostGroup#timeouts} + */ + readonly timeouts?: HssHostGroupTimeouts; +} +export interface HssHostGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#create HssHostGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#update HssHostGroup#update} + */ + readonly update?: string; +} + +export function hssHostGroupTimeoutsToTerraform(struct?: HssHostGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function hssHostGroupTimeoutsToHclTerraform(struct?: HssHostGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class HssHostGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): HssHostGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: HssHostGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group huaweicloud_hss_host_group} +*/ +export class HssHostGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_host_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a HssHostGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the HssHostGroup to import + * @param importFromId The id of the existing HssHostGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the HssHostGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_host_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_group huaweicloud_hss_host_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options HssHostGroupConfig + */ + public constructor(scope: Construct, id: string, config: HssHostGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_host_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._hostIds = config.hostIds; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // host_ids - computed: false, optional: true, required: false + private _hostIds?: string[]; + public get hostIds() { + return cdktf.Fn.tolist(this.getListAttribute('host_ids')); + } + public set hostIds(value: string[]) { + this._hostIds = value; + } + public resetHostIds() { + this._hostIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostIdsInput() { + return this._hostIds; + } + + // host_num - computed: true, optional: false, required: false + public get hostNum() { + return this.getNumberAttribute('host_num'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // risk_host_num - computed: true, optional: false, required: false + public get riskHostNum() { + return this.getNumberAttribute('risk_host_num'); + } + + // unprotect_host_ids - computed: true, optional: false, required: false + public get unprotectHostIds() { + return this.getListAttribute('unprotect_host_ids'); + } + + // unprotect_host_num - computed: true, optional: false, required: false + public get unprotectHostNum() { + return this.getNumberAttribute('unprotect_host_num'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new HssHostGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: HssHostGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + host_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._hostIds), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: hssHostGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._hostIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: hssHostGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "HssHostGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/hss-host-protection/README.md b/src/constructs/providers/huaweicloud/hss-host-protection/README.md new file mode 100644 index 00000000..2e0596b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-host-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_hss_host_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_hss_host_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection). diff --git a/src/constructs/providers/huaweicloud/hss-host-protection/index.ts b/src/constructs/providers/huaweicloud/hss-host-protection/index.ts new file mode 100644 index 00000000..e23597cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-host-protection/index.ts @@ -0,0 +1,477 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface HssHostProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#charging_mode HssHostProtection#charging_mode} + */ + readonly chargingMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#enterprise_project_id HssHostProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#host_id HssHostProtection#host_id} + */ + readonly hostId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#id HssHostProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#is_wait_host_available HssHostProtection#is_wait_host_available} + */ + readonly isWaitHostAvailable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#quota_id HssHostProtection#quota_id} + */ + readonly quotaId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#region HssHostProtection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#version HssHostProtection#version} + */ + readonly version: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#timeouts HssHostProtection#timeouts} + */ + readonly timeouts?: HssHostProtectionTimeouts; +} +export interface HssHostProtectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#create HssHostProtection#create} + */ + readonly create?: string; +} + +export function hssHostProtectionTimeoutsToTerraform(struct?: HssHostProtectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function hssHostProtectionTimeoutsToHclTerraform(struct?: HssHostProtectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class HssHostProtectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): HssHostProtectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: HssHostProtectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection huaweicloud_hss_host_protection} +*/ +export class HssHostProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_host_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a HssHostProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the HssHostProtection to import + * @param importFromId The id of the existing HssHostProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the HssHostProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_host_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_host_protection huaweicloud_hss_host_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options HssHostProtectionConfig + */ + public constructor(scope: Construct, id: string, config: HssHostProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_host_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._hostId = config.hostId; + this._id = config.id; + this._isWaitHostAvailable = config.isWaitHostAvailable; + this._quotaId = config.quotaId; + this._region = config.region; + this._version = config.version; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_id - computed: true, optional: false, required: false + public get agentId() { + return this.getStringAttribute('agent_id'); + } + + // agent_status - computed: true, optional: false, required: false + public get agentStatus() { + return this.getStringAttribute('agent_status'); + } + + // asset_value - computed: true, optional: false, required: false + public get assetValue() { + return this.getStringAttribute('asset_value'); + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // detect_result - computed: true, optional: false, required: false + public get detectResult() { + return this.getStringAttribute('detect_result'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // host_id - computed: false, optional: false, required: true + private _hostId?: string; + public get hostId() { + return this.getStringAttribute('host_id'); + } + public set hostId(value: string) { + this._hostId = value; + } + // Temporarily expose input value. Use with caution. + public get hostIdInput() { + return this._hostId; + } + + // host_name - computed: true, optional: false, required: false + public get hostName() { + return this.getStringAttribute('host_name'); + } + + // host_status - computed: true, optional: false, required: false + public get hostStatus() { + return this.getStringAttribute('host_status'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_wait_host_available - computed: false, optional: true, required: false + private _isWaitHostAvailable?: boolean | cdktf.IResolvable; + public get isWaitHostAvailable() { + return this.getBooleanAttribute('is_wait_host_available'); + } + public set isWaitHostAvailable(value: boolean | cdktf.IResolvable) { + this._isWaitHostAvailable = value; + } + public resetIsWaitHostAvailable() { + this._isWaitHostAvailable = undefined; + } + // Temporarily expose input value. Use with caution. + public get isWaitHostAvailableInput() { + return this._isWaitHostAvailable; + } + + // open_time - computed: true, optional: false, required: false + public get openTime() { + return this.getStringAttribute('open_time'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // quota_id - computed: false, optional: true, required: false + private _quotaId?: string; + public get quotaId() { + return this.getStringAttribute('quota_id'); + } + public set quotaId(value: string) { + this._quotaId = value; + } + public resetQuotaId() { + this._quotaId = undefined; + } + // Temporarily expose input value. Use with caution. + public get quotaIdInput() { + return this._quotaId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new HssHostProtectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: HssHostProtectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + host_id: cdktf.stringToTerraform(this._hostId), + id: cdktf.stringToTerraform(this._id), + is_wait_host_available: cdktf.booleanToTerraform(this._isWaitHostAvailable), + quota_id: cdktf.stringToTerraform(this._quotaId), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + timeouts: hssHostProtectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_id: { + value: cdktf.stringToHclTerraform(this._hostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_wait_host_available: { + value: cdktf.booleanToHclTerraform(this._isWaitHostAvailable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + quota_id: { + value: cdktf.stringToHclTerraform(this._quotaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: hssHostProtectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "HssHostProtectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/hss-quota/README.md b/src/constructs/providers/huaweicloud/hss-quota/README.md new file mode 100644 index 00000000..a9a0f7dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-quota/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_hss_quota` + +Refer to the Terraform Registry for docs: [`huaweicloud_hss_quota`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota). diff --git a/src/constructs/providers/huaweicloud/hss-quota/index.ts b/src/constructs/providers/huaweicloud/hss-quota/index.ts new file mode 100644 index 00000000..1125a76d --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-quota/index.ts @@ -0,0 +1,505 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface HssQuotaConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#auto_renew HssQuota#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#enterprise_project_id HssQuota#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#id HssQuota#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#period HssQuota#period} + */ + readonly period: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#period_unit HssQuota#period_unit} + */ + readonly periodUnit: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#region HssQuota#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#tags HssQuota#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#version HssQuota#version} + */ + readonly version: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#timeouts HssQuota#timeouts} + */ + readonly timeouts?: HssQuotaTimeouts; +} +export interface HssQuotaTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#create HssQuota#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#delete HssQuota#delete} + */ + readonly delete?: string; +} + +export function hssQuotaTimeoutsToTerraform(struct?: HssQuotaTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function hssQuotaTimeoutsToHclTerraform(struct?: HssQuotaTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class HssQuotaTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): HssQuotaTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: HssQuotaTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota huaweicloud_hss_quota} +*/ +export class HssQuota extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_quota"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a HssQuota resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the HssQuota to import + * @param importFromId The id of the existing HssQuota that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the HssQuota to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_quota", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_quota huaweicloud_hss_quota} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options HssQuotaConfig + */ + public constructor(scope: Construct, id: string, config: HssQuotaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_quota', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._tags = config.tags; + this._version = config.version; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: false, required: false + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // enterprise_project_name - computed: true, optional: false, required: false + public get enterpriseProjectName() { + return this.getStringAttribute('enterprise_project_name'); + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getNumberAttribute('expire_time'); + } + + // host_id - computed: true, optional: false, required: false + public get hostId() { + return this.getStringAttribute('host_id'); + } + + // host_name - computed: true, optional: false, required: false + public get hostName() { + return this.getStringAttribute('host_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_trial_quota - computed: true, optional: false, required: false + public get isTrialQuota() { + return this.getBooleanAttribute('is_trial_quota'); + } + + // period - computed: false, optional: false, required: true + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: false, required: true + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // shared_quota - computed: true, optional: false, required: false + public get sharedQuota() { + return this.getStringAttribute('shared_quota'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // used_status - computed: true, optional: false, required: false + public get usedStatus() { + return this.getStringAttribute('used_status'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new HssQuotaTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: HssQuotaTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + version: cdktf.stringToTerraform(this._version), + timeouts: hssQuotaTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: hssQuotaTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "HssQuotaTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/hss-webtamper-protection/README.md b/src/constructs/providers/huaweicloud/hss-webtamper-protection/README.md new file mode 100644 index 00000000..56e91f91 --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-webtamper-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_hss_webtamper_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_hss_webtamper_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection). diff --git a/src/constructs/providers/huaweicloud/hss-webtamper-protection/index.ts b/src/constructs/providers/huaweicloud/hss-webtamper-protection/index.ts new file mode 100644 index 00000000..c443fddd --- /dev/null +++ b/src/constructs/providers/huaweicloud/hss-webtamper-protection/index.ts @@ -0,0 +1,303 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface HssWebtamperProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#enterprise_project_id HssWebtamperProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#host_id HssWebtamperProtection#host_id} + */ + readonly hostId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#id HssWebtamperProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#is_dynamics_protect HssWebtamperProtection#is_dynamics_protect} + */ + readonly isDynamicsProtect?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#quota_id HssWebtamperProtection#quota_id} + */ + readonly quotaId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#region HssWebtamperProtection#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection huaweicloud_hss_webtamper_protection} +*/ +export class HssWebtamperProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_hss_webtamper_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a HssWebtamperProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the HssWebtamperProtection to import + * @param importFromId The id of the existing HssWebtamperProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the HssWebtamperProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_hss_webtamper_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/hss_webtamper_protection huaweicloud_hss_webtamper_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options HssWebtamperProtectionConfig + */ + public constructor(scope: Construct, id: string, config: HssWebtamperProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_hss_webtamper_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._hostId = config.hostId; + this._id = config.id; + this._isDynamicsProtect = config.isDynamicsProtect; + this._quotaId = config.quotaId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // anti_tampering_times - computed: true, optional: false, required: false + public get antiTamperingTimes() { + return this.getNumberAttribute('anti_tampering_times'); + } + + // detect_tampering_times - computed: true, optional: false, required: false + public get detectTamperingTimes() { + return this.getNumberAttribute('detect_tampering_times'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_name - computed: true, optional: false, required: false + public get groupName() { + return this.getStringAttribute('group_name'); + } + + // host_id - computed: false, optional: false, required: true + private _hostId?: string; + public get hostId() { + return this.getStringAttribute('host_id'); + } + public set hostId(value: string) { + this._hostId = value; + } + // Temporarily expose input value. Use with caution. + public get hostIdInput() { + return this._hostId; + } + + // host_name - computed: true, optional: false, required: false + public get hostName() { + return this.getStringAttribute('host_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_dynamics_protect - computed: false, optional: true, required: false + private _isDynamicsProtect?: boolean | cdktf.IResolvable; + public get isDynamicsProtect() { + return this.getBooleanAttribute('is_dynamics_protect'); + } + public set isDynamicsProtect(value: boolean | cdktf.IResolvable) { + this._isDynamicsProtect = value; + } + public resetIsDynamicsProtect() { + this._isDynamicsProtect = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDynamicsProtectInput() { + return this._isDynamicsProtect; + } + + // os_bit - computed: true, optional: false, required: false + public get osBit() { + return this.getStringAttribute('os_bit'); + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // protect_status - computed: true, optional: false, required: false + public get protectStatus() { + return this.getStringAttribute('protect_status'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // quota_id - computed: false, optional: true, required: false + private _quotaId?: string; + public get quotaId() { + return this.getStringAttribute('quota_id'); + } + public set quotaId(value: string) { + this._quotaId = value; + } + public resetQuotaId() { + this._quotaId = undefined; + } + // Temporarily expose input value. Use with caution. + public get quotaIdInput() { + return this._quotaId; + } + + // rasp_protect_status - computed: true, optional: false, required: false + public get raspProtectStatus() { + return this.getStringAttribute('rasp_protect_status'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + host_id: cdktf.stringToTerraform(this._hostId), + id: cdktf.stringToTerraform(this._id), + is_dynamics_protect: cdktf.booleanToTerraform(this._isDynamicsProtect), + quota_id: cdktf.stringToTerraform(this._quotaId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_id: { + value: cdktf.stringToHclTerraform(this._hostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_dynamics_protect: { + value: cdktf.booleanToHclTerraform(this._isDynamicsProtect), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + quota_id: { + value: cdktf.stringToHclTerraform(this._quotaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iam-agency-v3/README.md b/src/constructs/providers/huaweicloud/iam-agency-v3/README.md new file mode 100644 index 00000000..a0775945 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iam-agency-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iam_agency_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_iam_agency_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3). diff --git a/src/constructs/providers/huaweicloud/iam-agency-v3/index.ts b/src/constructs/providers/huaweicloud/iam-agency-v3/index.ts new file mode 100644 index 00000000..3d91b45e --- /dev/null +++ b/src/constructs/providers/huaweicloud/iam-agency-v3/index.ts @@ -0,0 +1,496 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IamAgencyV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#all_resources_roles IamAgencyV3#all_resources_roles} + */ + readonly allResourcesRoles?: string[]; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#delegated_domain_name IamAgencyV3#delegated_domain_name} + */ + readonly delegatedDomainName?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#delegated_service_name IamAgencyV3#delegated_service_name} + */ + readonly delegatedServiceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#description IamAgencyV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#domain_roles IamAgencyV3#domain_roles} + */ + readonly domainRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#duration IamAgencyV3#duration} + */ + readonly duration?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#id IamAgencyV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#name IamAgencyV3#name} + */ + readonly name: string; + /** + * project_role block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#project_role IamAgencyV3#project_role} + */ + readonly projectRole?: IamAgencyV3ProjectRole[] | cdktf.IResolvable; +} +export interface IamAgencyV3ProjectRole { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#project IamAgencyV3#project} + */ + readonly project: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#roles IamAgencyV3#roles} + */ + readonly roles: string[]; +} + +export function iamAgencyV3ProjectRoleToTerraform(struct?: IamAgencyV3ProjectRole | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project: cdktf.stringToTerraform(struct!.project), + roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.roles), + } +} + + +export function iamAgencyV3ProjectRoleToHclTerraform(struct?: IamAgencyV3ProjectRole | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project: { + value: cdktf.stringToHclTerraform(struct!.project), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.roles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IamAgencyV3ProjectRoleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IamAgencyV3ProjectRole | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._project !== undefined) { + hasAnyValues = true; + internalValueResult.project = this._project; + } + if (this._roles !== undefined) { + hasAnyValues = true; + internalValueResult.roles = this._roles; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IamAgencyV3ProjectRole | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._project = undefined; + this._roles = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._project = value.project; + this._roles = value.roles; + } + } + + // project - computed: false, optional: false, required: true + private _project?: string; + public get project() { + return this.getStringAttribute('project'); + } + public set project(value: string) { + this._project = value; + } + // Temporarily expose input value. Use with caution. + public get projectInput() { + return this._project; + } + + // roles - computed: false, optional: false, required: true + private _roles?: string[]; + public get roles() { + return cdktf.Fn.tolist(this.getListAttribute('roles')); + } + public set roles(value: string[]) { + this._roles = value; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles; + } +} + +export class IamAgencyV3ProjectRoleList extends cdktf.ComplexList { + public internalValue? : IamAgencyV3ProjectRole[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IamAgencyV3ProjectRoleOutputReference { + return new IamAgencyV3ProjectRoleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3 huaweicloud_iam_agency_v3} +*/ +export class IamAgencyV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iam_agency_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IamAgencyV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IamAgencyV3 to import + * @param importFromId The id of the existing IamAgencyV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IamAgencyV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iam_agency_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency_v3 huaweicloud_iam_agency_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IamAgencyV3Config + */ + public constructor(scope: Construct, id: string, config: IamAgencyV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iam_agency_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allResourcesRoles = config.allResourcesRoles; + this._delegatedDomainName = config.delegatedDomainName; + this._delegatedServiceName = config.delegatedServiceName; + this._description = config.description; + this._domainRoles = config.domainRoles; + this._duration = config.duration; + this._id = config.id; + this._name = config.name; + this._projectRole.internalValue = config.projectRole; + } + + // ========== + // ATTRIBUTES + // ========== + + // all_resources_roles - computed: false, optional: true, required: false + private _allResourcesRoles?: string[]; + public get allResourcesRoles() { + return cdktf.Fn.tolist(this.getListAttribute('all_resources_roles')); + } + public set allResourcesRoles(value: string[]) { + this._allResourcesRoles = value; + } + public resetAllResourcesRoles() { + this._allResourcesRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get allResourcesRolesInput() { + return this._allResourcesRoles; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // delegated_domain_name - computed: false, optional: true, required: false + private _delegatedDomainName?: string; + public get delegatedDomainName() { + return this.getStringAttribute('delegated_domain_name'); + } + public set delegatedDomainName(value: string) { + this._delegatedDomainName = value; + } + public resetDelegatedDomainName() { + this._delegatedDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedDomainNameInput() { + return this._delegatedDomainName; + } + + // delegated_service_name - computed: false, optional: true, required: false + private _delegatedServiceName?: string; + public get delegatedServiceName() { + return this.getStringAttribute('delegated_service_name'); + } + public set delegatedServiceName(value: string) { + this._delegatedServiceName = value; + } + public resetDelegatedServiceName() { + this._delegatedServiceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedServiceNameInput() { + return this._delegatedServiceName; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_roles - computed: false, optional: true, required: false + private _domainRoles?: string[]; + public get domainRoles() { + return cdktf.Fn.tolist(this.getListAttribute('domain_roles')); + } + public set domainRoles(value: string[]) { + this._domainRoles = value; + } + public resetDomainRoles() { + this._domainRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainRolesInput() { + return this._domainRoles; + } + + // duration - computed: false, optional: true, required: false + private _duration?: string; + public get duration() { + return this.getStringAttribute('duration'); + } + public set duration(value: string) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_role - computed: false, optional: true, required: false + private _projectRole = new IamAgencyV3ProjectRoleList(this, "project_role", true); + public get projectRole() { + return this._projectRole; + } + public putProjectRole(value: IamAgencyV3ProjectRole[] | cdktf.IResolvable) { + this._projectRole.internalValue = value; + } + public resetProjectRole() { + this._projectRole.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectRoleInput() { + return this._projectRole.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + all_resources_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._allResourcesRoles), + delegated_domain_name: cdktf.stringToTerraform(this._delegatedDomainName), + delegated_service_name: cdktf.stringToTerraform(this._delegatedServiceName), + description: cdktf.stringToTerraform(this._description), + domain_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._domainRoles), + duration: cdktf.stringToTerraform(this._duration), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + project_role: cdktf.listMapper(iamAgencyV3ProjectRoleToTerraform, true)(this._projectRole.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + all_resources_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._allResourcesRoles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + delegated_domain_name: { + value: cdktf.stringToHclTerraform(this._delegatedDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delegated_service_name: { + value: cdktf.stringToHclTerraform(this._delegatedServiceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._domainRoles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + duration: { + value: cdktf.stringToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_role: { + value: cdktf.listMapperHcl(iamAgencyV3ProjectRoleToHclTerraform, true)(this._projectRole.internalValue), + isBlock: true, + type: "set", + storageClassType: "IamAgencyV3ProjectRoleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iam-agency/README.md b/src/constructs/providers/huaweicloud/iam-agency/README.md new file mode 100644 index 00000000..bfde5b8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/iam-agency/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iam_agency` + +Refer to the Terraform Registry for docs: [`huaweicloud_iam_agency`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency). diff --git a/src/constructs/providers/huaweicloud/iam-agency/index.ts b/src/constructs/providers/huaweicloud/iam-agency/index.ts new file mode 100644 index 00000000..b4ebf9ed --- /dev/null +++ b/src/constructs/providers/huaweicloud/iam-agency/index.ts @@ -0,0 +1,496 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IamAgencyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#all_resources_roles IamAgency#all_resources_roles} + */ + readonly allResourcesRoles?: string[]; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#delegated_domain_name IamAgency#delegated_domain_name} + */ + readonly delegatedDomainName?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#delegated_service_name IamAgency#delegated_service_name} + */ + readonly delegatedServiceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#description IamAgency#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#domain_roles IamAgency#domain_roles} + */ + readonly domainRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#duration IamAgency#duration} + */ + readonly duration?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#id IamAgency#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#name IamAgency#name} + */ + readonly name: string; + /** + * project_role block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#project_role IamAgency#project_role} + */ + readonly projectRole?: IamAgencyProjectRole[] | cdktf.IResolvable; +} +export interface IamAgencyProjectRole { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#project IamAgency#project} + */ + readonly project: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#roles IamAgency#roles} + */ + readonly roles: string[]; +} + +export function iamAgencyProjectRoleToTerraform(struct?: IamAgencyProjectRole | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project: cdktf.stringToTerraform(struct!.project), + roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.roles), + } +} + + +export function iamAgencyProjectRoleToHclTerraform(struct?: IamAgencyProjectRole | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project: { + value: cdktf.stringToHclTerraform(struct!.project), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.roles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IamAgencyProjectRoleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IamAgencyProjectRole | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._project !== undefined) { + hasAnyValues = true; + internalValueResult.project = this._project; + } + if (this._roles !== undefined) { + hasAnyValues = true; + internalValueResult.roles = this._roles; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IamAgencyProjectRole | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._project = undefined; + this._roles = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._project = value.project; + this._roles = value.roles; + } + } + + // project - computed: false, optional: false, required: true + private _project?: string; + public get project() { + return this.getStringAttribute('project'); + } + public set project(value: string) { + this._project = value; + } + // Temporarily expose input value. Use with caution. + public get projectInput() { + return this._project; + } + + // roles - computed: false, optional: false, required: true + private _roles?: string[]; + public get roles() { + return cdktf.Fn.tolist(this.getListAttribute('roles')); + } + public set roles(value: string[]) { + this._roles = value; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles; + } +} + +export class IamAgencyProjectRoleList extends cdktf.ComplexList { + public internalValue? : IamAgencyProjectRole[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IamAgencyProjectRoleOutputReference { + return new IamAgencyProjectRoleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency huaweicloud_iam_agency} +*/ +export class IamAgency extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iam_agency"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IamAgency resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IamAgency to import + * @param importFromId The id of the existing IamAgency that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IamAgency to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iam_agency", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iam_agency huaweicloud_iam_agency} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IamAgencyConfig + */ + public constructor(scope: Construct, id: string, config: IamAgencyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iam_agency', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allResourcesRoles = config.allResourcesRoles; + this._delegatedDomainName = config.delegatedDomainName; + this._delegatedServiceName = config.delegatedServiceName; + this._description = config.description; + this._domainRoles = config.domainRoles; + this._duration = config.duration; + this._id = config.id; + this._name = config.name; + this._projectRole.internalValue = config.projectRole; + } + + // ========== + // ATTRIBUTES + // ========== + + // all_resources_roles - computed: false, optional: true, required: false + private _allResourcesRoles?: string[]; + public get allResourcesRoles() { + return cdktf.Fn.tolist(this.getListAttribute('all_resources_roles')); + } + public set allResourcesRoles(value: string[]) { + this._allResourcesRoles = value; + } + public resetAllResourcesRoles() { + this._allResourcesRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get allResourcesRolesInput() { + return this._allResourcesRoles; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // delegated_domain_name - computed: false, optional: true, required: false + private _delegatedDomainName?: string; + public get delegatedDomainName() { + return this.getStringAttribute('delegated_domain_name'); + } + public set delegatedDomainName(value: string) { + this._delegatedDomainName = value; + } + public resetDelegatedDomainName() { + this._delegatedDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedDomainNameInput() { + return this._delegatedDomainName; + } + + // delegated_service_name - computed: false, optional: true, required: false + private _delegatedServiceName?: string; + public get delegatedServiceName() { + return this.getStringAttribute('delegated_service_name'); + } + public set delegatedServiceName(value: string) { + this._delegatedServiceName = value; + } + public resetDelegatedServiceName() { + this._delegatedServiceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedServiceNameInput() { + return this._delegatedServiceName; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_roles - computed: false, optional: true, required: false + private _domainRoles?: string[]; + public get domainRoles() { + return cdktf.Fn.tolist(this.getListAttribute('domain_roles')); + } + public set domainRoles(value: string[]) { + this._domainRoles = value; + } + public resetDomainRoles() { + this._domainRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainRolesInput() { + return this._domainRoles; + } + + // duration - computed: false, optional: true, required: false + private _duration?: string; + public get duration() { + return this.getStringAttribute('duration'); + } + public set duration(value: string) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_role - computed: false, optional: true, required: false + private _projectRole = new IamAgencyProjectRoleList(this, "project_role", true); + public get projectRole() { + return this._projectRole; + } + public putProjectRole(value: IamAgencyProjectRole[] | cdktf.IResolvable) { + this._projectRole.internalValue = value; + } + public resetProjectRole() { + this._projectRole.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectRoleInput() { + return this._projectRole.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + all_resources_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._allResourcesRoles), + delegated_domain_name: cdktf.stringToTerraform(this._delegatedDomainName), + delegated_service_name: cdktf.stringToTerraform(this._delegatedServiceName), + description: cdktf.stringToTerraform(this._description), + domain_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._domainRoles), + duration: cdktf.stringToTerraform(this._duration), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + project_role: cdktf.listMapper(iamAgencyProjectRoleToTerraform, true)(this._projectRole.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + all_resources_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._allResourcesRoles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + delegated_domain_name: { + value: cdktf.stringToHclTerraform(this._delegatedDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delegated_service_name: { + value: cdktf.stringToHclTerraform(this._delegatedServiceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._domainRoles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + duration: { + value: cdktf.stringToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_role: { + value: cdktf.listMapperHcl(iamAgencyProjectRoleToHclTerraform, true)(this._projectRole.internalValue), + isBlock: true, + type: "set", + storageClassType: "IamAgencyProjectRoleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-access-key/README.md b/src/constructs/providers/huaweicloud/identity-access-key/README.md new file mode 100644 index 00000000..22e5e086 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-access-key/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_access_key` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_access_key`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key). diff --git a/src/constructs/providers/huaweicloud/identity-access-key/index.ts b/src/constructs/providers/huaweicloud/identity-access-key/index.ts new file mode 100644 index 00000000..f668eb5c --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-access-key/index.ts @@ -0,0 +1,278 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityAccessKeyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#description IdentityAccessKey#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#id IdentityAccessKey#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#pgp_key IdentityAccessKey#pgp_key} + */ + readonly pgpKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#secret_file IdentityAccessKey#secret_file} + */ + readonly secretFile?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#status IdentityAccessKey#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#user_id IdentityAccessKey#user_id} + */ + readonly userId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key huaweicloud_identity_access_key} +*/ +export class IdentityAccessKey extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_access_key"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityAccessKey resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityAccessKey to import + * @param importFromId The id of the existing IdentityAccessKey that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityAccessKey to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_access_key", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_access_key huaweicloud_identity_access_key} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityAccessKeyConfig + */ + public constructor(scope: Construct, id: string, config: IdentityAccessKeyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_access_key', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._pgpKey = config.pgpKey; + this._secretFile = config.secretFile; + this._status = config.status; + this._userId = config.userId; + } + + // ========== + // ATTRIBUTES + // ========== + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encrypted_secret - computed: true, optional: false, required: false + public get encryptedSecret() { + return this.getStringAttribute('encrypted_secret'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_fingerprint - computed: true, optional: false, required: false + public get keyFingerprint() { + return this.getStringAttribute('key_fingerprint'); + } + + // pgp_key - computed: false, optional: true, required: false + private _pgpKey?: string; + public get pgpKey() { + return this.getStringAttribute('pgp_key'); + } + public set pgpKey(value: string) { + this._pgpKey = value; + } + public resetPgpKey() { + this._pgpKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get pgpKeyInput() { + return this._pgpKey; + } + + // secret - computed: true, optional: false, required: false + public get secret() { + return this.getStringAttribute('secret'); + } + + // secret_file - computed: false, optional: true, required: false + private _secretFile?: string; + public get secretFile() { + return this.getStringAttribute('secret_file'); + } + public set secretFile(value: string) { + this._secretFile = value; + } + public resetSecretFile() { + this._secretFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretFileInput() { + return this._secretFile; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + pgp_key: cdktf.stringToTerraform(this._pgpKey), + secret_file: cdktf.stringToTerraform(this._secretFile), + status: cdktf.stringToTerraform(this._status), + user_id: cdktf.stringToTerraform(this._userId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pgp_key: { + value: cdktf.stringToHclTerraform(this._pgpKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_file: { + value: cdktf.stringToHclTerraform(this._secretFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-acl/README.md b/src/constructs/providers/huaweicloud/identity-acl/README.md new file mode 100644 index 00000000..72749e90 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl). diff --git a/src/constructs/providers/huaweicloud/identity-acl/index.ts b/src/constructs/providers/huaweicloud/identity-acl/index.ts new file mode 100644 index 00000000..7dc43524 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-acl/index.ts @@ -0,0 +1,493 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityAclConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#id IdentityAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#type IdentityAcl#type} + */ + readonly type: string; + /** + * ip_cidrs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#ip_cidrs IdentityAcl#ip_cidrs} + */ + readonly ipCidrs?: IdentityAclIpCidrs[] | cdktf.IResolvable; + /** + * ip_ranges block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#ip_ranges IdentityAcl#ip_ranges} + */ + readonly ipRanges?: IdentityAclIpRanges[] | cdktf.IResolvable; +} +export interface IdentityAclIpCidrs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#cidr IdentityAcl#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#description IdentityAcl#description} + */ + readonly description?: string; +} + +export function identityAclIpCidrsToTerraform(struct?: IdentityAclIpCidrs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cidr: cdktf.stringToTerraform(struct!.cidr), + description: cdktf.stringToTerraform(struct!.description), + } +} + + +export function identityAclIpCidrsToHclTerraform(struct?: IdentityAclIpCidrs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(struct!.cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityAclIpCidrsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityAclIpCidrs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cidr !== undefined) { + hasAnyValues = true; + internalValueResult.cidr = this._cidr; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityAclIpCidrs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cidr = undefined; + this._description = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cidr = value.cidr; + this._description = value.description; + } + } + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } +} + +export class IdentityAclIpCidrsList extends cdktf.ComplexList { + public internalValue? : IdentityAclIpCidrs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityAclIpCidrsOutputReference { + return new IdentityAclIpCidrsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IdentityAclIpRanges { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#description IdentityAcl#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#range IdentityAcl#range} + */ + readonly range: string; +} + +export function identityAclIpRangesToTerraform(struct?: IdentityAclIpRanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + range: cdktf.stringToTerraform(struct!.range), + } +} + + +export function identityAclIpRangesToHclTerraform(struct?: IdentityAclIpRanges | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + range: { + value: cdktf.stringToHclTerraform(struct!.range), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityAclIpRangesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityAclIpRanges | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._range !== undefined) { + hasAnyValues = true; + internalValueResult.range = this._range; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityAclIpRanges | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._range = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._range = value.range; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // range - computed: false, optional: false, required: true + private _range?: string; + public get range() { + return this.getStringAttribute('range'); + } + public set range(value: string) { + this._range = value; + } + // Temporarily expose input value. Use with caution. + public get rangeInput() { + return this._range; + } +} + +export class IdentityAclIpRangesList extends cdktf.ComplexList { + public internalValue? : IdentityAclIpRanges[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityAclIpRangesOutputReference { + return new IdentityAclIpRangesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl huaweicloud_identity_acl} +*/ +export class IdentityAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityAcl to import + * @param importFromId The id of the existing IdentityAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_acl huaweicloud_identity_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityAclConfig + */ + public constructor(scope: Construct, id: string, config: IdentityAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._type = config.type; + this._ipCidrs.internalValue = config.ipCidrs; + this._ipRanges.internalValue = config.ipRanges; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ip_cidrs - computed: false, optional: true, required: false + private _ipCidrs = new IdentityAclIpCidrsList(this, "ip_cidrs", true); + public get ipCidrs() { + return this._ipCidrs; + } + public putIpCidrs(value: IdentityAclIpCidrs[] | cdktf.IResolvable) { + this._ipCidrs.internalValue = value; + } + public resetIpCidrs() { + this._ipCidrs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipCidrsInput() { + return this._ipCidrs.internalValue; + } + + // ip_ranges - computed: false, optional: true, required: false + private _ipRanges = new IdentityAclIpRangesList(this, "ip_ranges", true); + public get ipRanges() { + return this._ipRanges; + } + public putIpRanges(value: IdentityAclIpRanges[] | cdktf.IResolvable) { + this._ipRanges.internalValue = value; + } + public resetIpRanges() { + this._ipRanges.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipRangesInput() { + return this._ipRanges.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + type: cdktf.stringToTerraform(this._type), + ip_cidrs: cdktf.listMapper(identityAclIpCidrsToTerraform, true)(this._ipCidrs.internalValue), + ip_ranges: cdktf.listMapper(identityAclIpRangesToTerraform, true)(this._ipRanges.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_cidrs: { + value: cdktf.listMapperHcl(identityAclIpCidrsToHclTerraform, true)(this._ipCidrs.internalValue), + isBlock: true, + type: "set", + storageClassType: "IdentityAclIpCidrsList", + }, + ip_ranges: { + value: cdktf.listMapperHcl(identityAclIpRangesToHclTerraform, true)(this._ipRanges.internalValue), + isBlock: true, + type: "set", + storageClassType: "IdentityAclIpRangesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-agency/README.md b/src/constructs/providers/huaweicloud/identity-agency/README.md new file mode 100644 index 00000000..d270788c --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-agency/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_agency` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_agency`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency). diff --git a/src/constructs/providers/huaweicloud/identity-agency/index.ts b/src/constructs/providers/huaweicloud/identity-agency/index.ts new file mode 100644 index 00000000..2ea1f696 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-agency/index.ts @@ -0,0 +1,496 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityAgencyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#all_resources_roles IdentityAgency#all_resources_roles} + */ + readonly allResourcesRoles?: string[]; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#delegated_domain_name IdentityAgency#delegated_domain_name} + */ + readonly delegatedDomainName?: string; + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#delegated_service_name IdentityAgency#delegated_service_name} + */ + readonly delegatedServiceName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#description IdentityAgency#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#domain_roles IdentityAgency#domain_roles} + */ + readonly domainRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#duration IdentityAgency#duration} + */ + readonly duration?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#id IdentityAgency#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#name IdentityAgency#name} + */ + readonly name: string; + /** + * project_role block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#project_role IdentityAgency#project_role} + */ + readonly projectRole?: IdentityAgencyProjectRole[] | cdktf.IResolvable; +} +export interface IdentityAgencyProjectRole { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#project IdentityAgency#project} + */ + readonly project: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#roles IdentityAgency#roles} + */ + readonly roles: string[]; +} + +export function identityAgencyProjectRoleToTerraform(struct?: IdentityAgencyProjectRole | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project: cdktf.stringToTerraform(struct!.project), + roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.roles), + } +} + + +export function identityAgencyProjectRoleToHclTerraform(struct?: IdentityAgencyProjectRole | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project: { + value: cdktf.stringToHclTerraform(struct!.project), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.roles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityAgencyProjectRoleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityAgencyProjectRole | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._project !== undefined) { + hasAnyValues = true; + internalValueResult.project = this._project; + } + if (this._roles !== undefined) { + hasAnyValues = true; + internalValueResult.roles = this._roles; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityAgencyProjectRole | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._project = undefined; + this._roles = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._project = value.project; + this._roles = value.roles; + } + } + + // project - computed: false, optional: false, required: true + private _project?: string; + public get project() { + return this.getStringAttribute('project'); + } + public set project(value: string) { + this._project = value; + } + // Temporarily expose input value. Use with caution. + public get projectInput() { + return this._project; + } + + // roles - computed: false, optional: false, required: true + private _roles?: string[]; + public get roles() { + return cdktf.Fn.tolist(this.getListAttribute('roles')); + } + public set roles(value: string[]) { + this._roles = value; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles; + } +} + +export class IdentityAgencyProjectRoleList extends cdktf.ComplexList { + public internalValue? : IdentityAgencyProjectRole[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityAgencyProjectRoleOutputReference { + return new IdentityAgencyProjectRoleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency huaweicloud_identity_agency} +*/ +export class IdentityAgency extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_agency"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityAgency resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityAgency to import + * @param importFromId The id of the existing IdentityAgency that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityAgency to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_agency", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_agency huaweicloud_identity_agency} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityAgencyConfig + */ + public constructor(scope: Construct, id: string, config: IdentityAgencyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_agency', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allResourcesRoles = config.allResourcesRoles; + this._delegatedDomainName = config.delegatedDomainName; + this._delegatedServiceName = config.delegatedServiceName; + this._description = config.description; + this._domainRoles = config.domainRoles; + this._duration = config.duration; + this._id = config.id; + this._name = config.name; + this._projectRole.internalValue = config.projectRole; + } + + // ========== + // ATTRIBUTES + // ========== + + // all_resources_roles - computed: false, optional: true, required: false + private _allResourcesRoles?: string[]; + public get allResourcesRoles() { + return cdktf.Fn.tolist(this.getListAttribute('all_resources_roles')); + } + public set allResourcesRoles(value: string[]) { + this._allResourcesRoles = value; + } + public resetAllResourcesRoles() { + this._allResourcesRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get allResourcesRolesInput() { + return this._allResourcesRoles; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // delegated_domain_name - computed: false, optional: true, required: false + private _delegatedDomainName?: string; + public get delegatedDomainName() { + return this.getStringAttribute('delegated_domain_name'); + } + public set delegatedDomainName(value: string) { + this._delegatedDomainName = value; + } + public resetDelegatedDomainName() { + this._delegatedDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedDomainNameInput() { + return this._delegatedDomainName; + } + + // delegated_service_name - computed: false, optional: true, required: false + private _delegatedServiceName?: string; + public get delegatedServiceName() { + return this.getStringAttribute('delegated_service_name'); + } + public set delegatedServiceName(value: string) { + this._delegatedServiceName = value; + } + public resetDelegatedServiceName() { + this._delegatedServiceName = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedServiceNameInput() { + return this._delegatedServiceName; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_roles - computed: false, optional: true, required: false + private _domainRoles?: string[]; + public get domainRoles() { + return cdktf.Fn.tolist(this.getListAttribute('domain_roles')); + } + public set domainRoles(value: string[]) { + this._domainRoles = value; + } + public resetDomainRoles() { + this._domainRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainRolesInput() { + return this._domainRoles; + } + + // duration - computed: false, optional: true, required: false + private _duration?: string; + public get duration() { + return this.getStringAttribute('duration'); + } + public set duration(value: string) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_role - computed: false, optional: true, required: false + private _projectRole = new IdentityAgencyProjectRoleList(this, "project_role", true); + public get projectRole() { + return this._projectRole; + } + public putProjectRole(value: IdentityAgencyProjectRole[] | cdktf.IResolvable) { + this._projectRole.internalValue = value; + } + public resetProjectRole() { + this._projectRole.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectRoleInput() { + return this._projectRole.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + all_resources_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._allResourcesRoles), + delegated_domain_name: cdktf.stringToTerraform(this._delegatedDomainName), + delegated_service_name: cdktf.stringToTerraform(this._delegatedServiceName), + description: cdktf.stringToTerraform(this._description), + domain_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._domainRoles), + duration: cdktf.stringToTerraform(this._duration), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + project_role: cdktf.listMapper(identityAgencyProjectRoleToTerraform, true)(this._projectRole.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + all_resources_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._allResourcesRoles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + delegated_domain_name: { + value: cdktf.stringToHclTerraform(this._delegatedDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delegated_service_name: { + value: cdktf.stringToHclTerraform(this._delegatedServiceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._domainRoles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + duration: { + value: cdktf.stringToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_role: { + value: cdktf.listMapperHcl(identityAgencyProjectRoleToHclTerraform, true)(this._projectRole.internalValue), + isBlock: true, + type: "set", + storageClassType: "IdentityAgencyProjectRoleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-group-membership-v3/README.md b/src/constructs/providers/huaweicloud/identity-group-membership-v3/README.md new file mode 100644 index 00000000..5a49ed01 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-membership-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_group_membership_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_group_membership_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3). diff --git a/src/constructs/providers/huaweicloud/identity-group-membership-v3/index.ts b/src/constructs/providers/huaweicloud/identity-group-membership-v3/index.ts new file mode 100644 index 00000000..d07e7ac4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-membership-v3/index.ts @@ -0,0 +1,166 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityGroupMembershipV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3#group IdentityGroupMembershipV3#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3#id IdentityGroupMembershipV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3#users IdentityGroupMembershipV3#users} + */ + readonly users: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3 huaweicloud_identity_group_membership_v3} +*/ +export class IdentityGroupMembershipV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_group_membership_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityGroupMembershipV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityGroupMembershipV3 to import + * @param importFromId The id of the existing IdentityGroupMembershipV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityGroupMembershipV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_group_membership_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership_v3 huaweicloud_identity_group_membership_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityGroupMembershipV3Config + */ + public constructor(scope: Construct, id: string, config: IdentityGroupMembershipV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_group_membership_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._users = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // users - computed: false, optional: false, required: true + private _users?: string[]; + public get users() { + return cdktf.Fn.tolist(this.getListAttribute('users')); + } + public set users(value: string[]) { + this._users = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + users: cdktf.listMapper(cdktf.stringToTerraform, false)(this._users), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._users), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-group-membership/README.md b/src/constructs/providers/huaweicloud/identity-group-membership/README.md new file mode 100644 index 00000000..9b1c5504 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-membership/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_group_membership` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_group_membership`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership). diff --git a/src/constructs/providers/huaweicloud/identity-group-membership/index.ts b/src/constructs/providers/huaweicloud/identity-group-membership/index.ts new file mode 100644 index 00000000..222e7505 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-membership/index.ts @@ -0,0 +1,166 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityGroupMembershipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership#group IdentityGroupMembership#group} + */ + readonly group: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership#id IdentityGroupMembership#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership#users IdentityGroupMembership#users} + */ + readonly users: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership huaweicloud_identity_group_membership} +*/ +export class IdentityGroupMembership extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_group_membership"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityGroupMembership resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityGroupMembership to import + * @param importFromId The id of the existing IdentityGroupMembership that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityGroupMembership to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_group_membership", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_membership huaweicloud_identity_group_membership} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityGroupMembershipConfig + */ + public constructor(scope: Construct, id: string, config: IdentityGroupMembershipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_group_membership', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._group = config.group; + this._id = config.id; + this._users = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // group - computed: false, optional: false, required: true + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // users - computed: false, optional: false, required: true + private _users?: string[]; + public get users() { + return cdktf.Fn.tolist(this.getListAttribute('users')); + } + public set users(value: string[]) { + this._users = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group: cdktf.stringToTerraform(this._group), + id: cdktf.stringToTerraform(this._id), + users: cdktf.listMapper(cdktf.stringToTerraform, false)(this._users), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group: { + value: cdktf.stringToHclTerraform(this._group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._users), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-group-role-assignment/README.md b/src/constructs/providers/huaweicloud/identity-group-role-assignment/README.md new file mode 100644 index 00000000..b306aaba --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-role-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_group_role_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_group_role_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment). diff --git a/src/constructs/providers/huaweicloud/identity-group-role-assignment/index.ts b/src/constructs/providers/huaweicloud/identity-group-role-assignment/index.ts new file mode 100644 index 00000000..4cb06a8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-role-assignment/index.ts @@ -0,0 +1,250 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityGroupRoleAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#domain_id IdentityGroupRoleAssignment#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#enterprise_project_id IdentityGroupRoleAssignment#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#group_id IdentityGroupRoleAssignment#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#id IdentityGroupRoleAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#project_id IdentityGroupRoleAssignment#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#role_id IdentityGroupRoleAssignment#role_id} + */ + readonly roleId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment huaweicloud_identity_group_role_assignment} +*/ +export class IdentityGroupRoleAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_group_role_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityGroupRoleAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityGroupRoleAssignment to import + * @param importFromId The id of the existing IdentityGroupRoleAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityGroupRoleAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_group_role_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_role_assignment huaweicloud_identity_group_role_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityGroupRoleAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentityGroupRoleAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_group_role_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainId = config.domainId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._id = config.id; + this._projectId = config.projectId; + this._roleId = config.roleId; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_id - computed: false, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // role_id - computed: false, optional: false, required: true + private _roleId?: string; + public get roleId() { + return this.getStringAttribute('role_id'); + } + public set roleId(value: string) { + this._roleId = value; + } + // Temporarily expose input value. Use with caution. + public get roleIdInput() { + return this._roleId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_id: cdktf.stringToTerraform(this._domainId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + project_id: cdktf.stringToTerraform(this._projectId), + role_id: cdktf.stringToTerraform(this._roleId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role_id: { + value: cdktf.stringToHclTerraform(this._roleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-group-v3/README.md b/src/constructs/providers/huaweicloud/identity-group-v3/README.md new file mode 100644 index 00000000..daacb6a8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_group_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_group_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3). diff --git a/src/constructs/providers/huaweicloud/identity-group-v3/index.ts b/src/constructs/providers/huaweicloud/identity-group-v3/index.ts new file mode 100644 index 00000000..5ca8c635 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group-v3/index.ts @@ -0,0 +1,169 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityGroupV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3#description IdentityGroupV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3#id IdentityGroupV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3#name IdentityGroupV3#name} + */ + readonly name: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3 huaweicloud_identity_group_v3} +*/ +export class IdentityGroupV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_group_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityGroupV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityGroupV3 to import + * @param importFromId The id of the existing IdentityGroupV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityGroupV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_group_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group_v3 huaweicloud_identity_group_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityGroupV3Config + */ + public constructor(scope: Construct, id: string, config: IdentityGroupV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_group_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-group/README.md b/src/constructs/providers/huaweicloud/identity-group/README.md new file mode 100644 index 00000000..7e64a8b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group). diff --git a/src/constructs/providers/huaweicloud/identity-group/index.ts b/src/constructs/providers/huaweicloud/identity-group/index.ts new file mode 100644 index 00000000..dbb4db43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-group/index.ts @@ -0,0 +1,169 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group#description IdentityGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group#id IdentityGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group#name IdentityGroup#name} + */ + readonly name: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group huaweicloud_identity_group} +*/ +export class IdentityGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityGroup to import + * @param importFromId The id of the existing IdentityGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_group huaweicloud_identity_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityGroupConfig + */ + public constructor(scope: Construct, id: string, config: IdentityGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-login-policy/README.md b/src/constructs/providers/huaweicloud/identity-login-policy/README.md new file mode 100644 index 00000000..069bfb65 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-login-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_login_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_login_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy). diff --git a/src/constructs/providers/huaweicloud/identity-login-policy/index.ts b/src/constructs/providers/huaweicloud/identity-login-policy/index.ts new file mode 100644 index 00000000..0a1e7faf --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-login-policy/index.ts @@ -0,0 +1,312 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityLoginPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#account_validity_period IdentityLoginPolicy#account_validity_period} + */ + readonly accountValidityPeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#custom_info_for_login IdentityLoginPolicy#custom_info_for_login} + */ + readonly customInfoForLogin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#id IdentityLoginPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#lockout_duration IdentityLoginPolicy#lockout_duration} + */ + readonly lockoutDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#login_failed_times IdentityLoginPolicy#login_failed_times} + */ + readonly loginFailedTimes?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#period_with_login_failures IdentityLoginPolicy#period_with_login_failures} + */ + readonly periodWithLoginFailures?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#session_timeout IdentityLoginPolicy#session_timeout} + */ + readonly sessionTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#show_recent_login_info IdentityLoginPolicy#show_recent_login_info} + */ + readonly showRecentLoginInfo?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy huaweicloud_identity_login_policy} +*/ +export class IdentityLoginPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_login_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityLoginPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityLoginPolicy to import + * @param importFromId The id of the existing IdentityLoginPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityLoginPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_login_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_login_policy huaweicloud_identity_login_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityLoginPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: IdentityLoginPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_login_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountValidityPeriod = config.accountValidityPeriod; + this._customInfoForLogin = config.customInfoForLogin; + this._id = config.id; + this._lockoutDuration = config.lockoutDuration; + this._loginFailedTimes = config.loginFailedTimes; + this._periodWithLoginFailures = config.periodWithLoginFailures; + this._sessionTimeout = config.sessionTimeout; + this._showRecentLoginInfo = config.showRecentLoginInfo; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_validity_period - computed: true, optional: true, required: false + private _accountValidityPeriod?: number; + public get accountValidityPeriod() { + return this.getNumberAttribute('account_validity_period'); + } + public set accountValidityPeriod(value: number) { + this._accountValidityPeriod = value; + } + public resetAccountValidityPeriod() { + this._accountValidityPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountValidityPeriodInput() { + return this._accountValidityPeriod; + } + + // custom_info_for_login - computed: false, optional: true, required: false + private _customInfoForLogin?: string; + public get customInfoForLogin() { + return this.getStringAttribute('custom_info_for_login'); + } + public set customInfoForLogin(value: string) { + this._customInfoForLogin = value; + } + public resetCustomInfoForLogin() { + this._customInfoForLogin = undefined; + } + // Temporarily expose input value. Use with caution. + public get customInfoForLoginInput() { + return this._customInfoForLogin; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lockout_duration - computed: false, optional: true, required: false + private _lockoutDuration?: number; + public get lockoutDuration() { + return this.getNumberAttribute('lockout_duration'); + } + public set lockoutDuration(value: number) { + this._lockoutDuration = value; + } + public resetLockoutDuration() { + this._lockoutDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get lockoutDurationInput() { + return this._lockoutDuration; + } + + // login_failed_times - computed: false, optional: true, required: false + private _loginFailedTimes?: number; + public get loginFailedTimes() { + return this.getNumberAttribute('login_failed_times'); + } + public set loginFailedTimes(value: number) { + this._loginFailedTimes = value; + } + public resetLoginFailedTimes() { + this._loginFailedTimes = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginFailedTimesInput() { + return this._loginFailedTimes; + } + + // period_with_login_failures - computed: false, optional: true, required: false + private _periodWithLoginFailures?: number; + public get periodWithLoginFailures() { + return this.getNumberAttribute('period_with_login_failures'); + } + public set periodWithLoginFailures(value: number) { + this._periodWithLoginFailures = value; + } + public resetPeriodWithLoginFailures() { + this._periodWithLoginFailures = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodWithLoginFailuresInput() { + return this._periodWithLoginFailures; + } + + // session_timeout - computed: false, optional: true, required: false + private _sessionTimeout?: number; + public get sessionTimeout() { + return this.getNumberAttribute('session_timeout'); + } + public set sessionTimeout(value: number) { + this._sessionTimeout = value; + } + public resetSessionTimeout() { + this._sessionTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get sessionTimeoutInput() { + return this._sessionTimeout; + } + + // show_recent_login_info - computed: false, optional: true, required: false + private _showRecentLoginInfo?: boolean | cdktf.IResolvable; + public get showRecentLoginInfo() { + return this.getBooleanAttribute('show_recent_login_info'); + } + public set showRecentLoginInfo(value: boolean | cdktf.IResolvable) { + this._showRecentLoginInfo = value; + } + public resetShowRecentLoginInfo() { + this._showRecentLoginInfo = undefined; + } + // Temporarily expose input value. Use with caution. + public get showRecentLoginInfoInput() { + return this._showRecentLoginInfo; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_validity_period: cdktf.numberToTerraform(this._accountValidityPeriod), + custom_info_for_login: cdktf.stringToTerraform(this._customInfoForLogin), + id: cdktf.stringToTerraform(this._id), + lockout_duration: cdktf.numberToTerraform(this._lockoutDuration), + login_failed_times: cdktf.numberToTerraform(this._loginFailedTimes), + period_with_login_failures: cdktf.numberToTerraform(this._periodWithLoginFailures), + session_timeout: cdktf.numberToTerraform(this._sessionTimeout), + show_recent_login_info: cdktf.booleanToTerraform(this._showRecentLoginInfo), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_validity_period: { + value: cdktf.numberToHclTerraform(this._accountValidityPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + custom_info_for_login: { + value: cdktf.stringToHclTerraform(this._customInfoForLogin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lockout_duration: { + value: cdktf.numberToHclTerraform(this._lockoutDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + login_failed_times: { + value: cdktf.numberToHclTerraform(this._loginFailedTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_with_login_failures: { + value: cdktf.numberToHclTerraform(this._periodWithLoginFailures), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + session_timeout: { + value: cdktf.numberToHclTerraform(this._sessionTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + show_recent_login_info: { + value: cdktf.booleanToHclTerraform(this._showRecentLoginInfo), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-password-policy/README.md b/src/constructs/providers/huaweicloud/identity-password-policy/README.md new file mode 100644 index 00000000..ccdcbeb8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-password-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_password_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_password_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy). diff --git a/src/constructs/providers/huaweicloud/identity-password-policy/index.ts b/src/constructs/providers/huaweicloud/identity-password-policy/index.ts new file mode 100644 index 00000000..71b21666 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-password-policy/index.ts @@ -0,0 +1,317 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityPasswordPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#id IdentityPasswordPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#maximum_consecutive_identical_chars IdentityPasswordPolicy#maximum_consecutive_identical_chars} + */ + readonly maximumConsecutiveIdenticalChars?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#minimum_password_age IdentityPasswordPolicy#minimum_password_age} + */ + readonly minimumPasswordAge?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#minimum_password_length IdentityPasswordPolicy#minimum_password_length} + */ + readonly minimumPasswordLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#number_of_recent_passwords_disallowed IdentityPasswordPolicy#number_of_recent_passwords_disallowed} + */ + readonly numberOfRecentPasswordsDisallowed?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#password_char_combination IdentityPasswordPolicy#password_char_combination} + */ + readonly passwordCharCombination?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#password_not_username_or_invert IdentityPasswordPolicy#password_not_username_or_invert} + */ + readonly passwordNotUsernameOrInvert?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#password_validity_period IdentityPasswordPolicy#password_validity_period} + */ + readonly passwordValidityPeriod?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy huaweicloud_identity_password_policy} +*/ +export class IdentityPasswordPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_password_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityPasswordPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityPasswordPolicy to import + * @param importFromId The id of the existing IdentityPasswordPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityPasswordPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_password_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_password_policy huaweicloud_identity_password_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityPasswordPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: IdentityPasswordPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_password_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._maximumConsecutiveIdenticalChars = config.maximumConsecutiveIdenticalChars; + this._minimumPasswordAge = config.minimumPasswordAge; + this._minimumPasswordLength = config.minimumPasswordLength; + this._numberOfRecentPasswordsDisallowed = config.numberOfRecentPasswordsDisallowed; + this._passwordCharCombination = config.passwordCharCombination; + this._passwordNotUsernameOrInvert = config.passwordNotUsernameOrInvert; + this._passwordValidityPeriod = config.passwordValidityPeriod; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maximum_consecutive_identical_chars - computed: true, optional: true, required: false + private _maximumConsecutiveIdenticalChars?: number; + public get maximumConsecutiveIdenticalChars() { + return this.getNumberAttribute('maximum_consecutive_identical_chars'); + } + public set maximumConsecutiveIdenticalChars(value: number) { + this._maximumConsecutiveIdenticalChars = value; + } + public resetMaximumConsecutiveIdenticalChars() { + this._maximumConsecutiveIdenticalChars = undefined; + } + // Temporarily expose input value. Use with caution. + public get maximumConsecutiveIdenticalCharsInput() { + return this._maximumConsecutiveIdenticalChars; + } + + // maximum_password_length - computed: true, optional: false, required: false + public get maximumPasswordLength() { + return this.getNumberAttribute('maximum_password_length'); + } + + // minimum_password_age - computed: true, optional: true, required: false + private _minimumPasswordAge?: number; + public get minimumPasswordAge() { + return this.getNumberAttribute('minimum_password_age'); + } + public set minimumPasswordAge(value: number) { + this._minimumPasswordAge = value; + } + public resetMinimumPasswordAge() { + this._minimumPasswordAge = undefined; + } + // Temporarily expose input value. Use with caution. + public get minimumPasswordAgeInput() { + return this._minimumPasswordAge; + } + + // minimum_password_length - computed: false, optional: true, required: false + private _minimumPasswordLength?: number; + public get minimumPasswordLength() { + return this.getNumberAttribute('minimum_password_length'); + } + public set minimumPasswordLength(value: number) { + this._minimumPasswordLength = value; + } + public resetMinimumPasswordLength() { + this._minimumPasswordLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get minimumPasswordLengthInput() { + return this._minimumPasswordLength; + } + + // number_of_recent_passwords_disallowed - computed: false, optional: true, required: false + private _numberOfRecentPasswordsDisallowed?: number; + public get numberOfRecentPasswordsDisallowed() { + return this.getNumberAttribute('number_of_recent_passwords_disallowed'); + } + public set numberOfRecentPasswordsDisallowed(value: number) { + this._numberOfRecentPasswordsDisallowed = value; + } + public resetNumberOfRecentPasswordsDisallowed() { + this._numberOfRecentPasswordsDisallowed = undefined; + } + // Temporarily expose input value. Use with caution. + public get numberOfRecentPasswordsDisallowedInput() { + return this._numberOfRecentPasswordsDisallowed; + } + + // password_char_combination - computed: false, optional: true, required: false + private _passwordCharCombination?: number; + public get passwordCharCombination() { + return this.getNumberAttribute('password_char_combination'); + } + public set passwordCharCombination(value: number) { + this._passwordCharCombination = value; + } + public resetPasswordCharCombination() { + this._passwordCharCombination = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordCharCombinationInput() { + return this._passwordCharCombination; + } + + // password_not_username_or_invert - computed: false, optional: true, required: false + private _passwordNotUsernameOrInvert?: boolean | cdktf.IResolvable; + public get passwordNotUsernameOrInvert() { + return this.getBooleanAttribute('password_not_username_or_invert'); + } + public set passwordNotUsernameOrInvert(value: boolean | cdktf.IResolvable) { + this._passwordNotUsernameOrInvert = value; + } + public resetPasswordNotUsernameOrInvert() { + this._passwordNotUsernameOrInvert = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordNotUsernameOrInvertInput() { + return this._passwordNotUsernameOrInvert; + } + + // password_validity_period - computed: true, optional: true, required: false + private _passwordValidityPeriod?: number; + public get passwordValidityPeriod() { + return this.getNumberAttribute('password_validity_period'); + } + public set passwordValidityPeriod(value: number) { + this._passwordValidityPeriod = value; + } + public resetPasswordValidityPeriod() { + this._passwordValidityPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordValidityPeriodInput() { + return this._passwordValidityPeriod; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + maximum_consecutive_identical_chars: cdktf.numberToTerraform(this._maximumConsecutiveIdenticalChars), + minimum_password_age: cdktf.numberToTerraform(this._minimumPasswordAge), + minimum_password_length: cdktf.numberToTerraform(this._minimumPasswordLength), + number_of_recent_passwords_disallowed: cdktf.numberToTerraform(this._numberOfRecentPasswordsDisallowed), + password_char_combination: cdktf.numberToTerraform(this._passwordCharCombination), + password_not_username_or_invert: cdktf.booleanToTerraform(this._passwordNotUsernameOrInvert), + password_validity_period: cdktf.numberToTerraform(this._passwordValidityPeriod), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maximum_consecutive_identical_chars: { + value: cdktf.numberToHclTerraform(this._maximumConsecutiveIdenticalChars), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + minimum_password_age: { + value: cdktf.numberToHclTerraform(this._minimumPasswordAge), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + minimum_password_length: { + value: cdktf.numberToHclTerraform(this._minimumPasswordLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + number_of_recent_passwords_disallowed: { + value: cdktf.numberToHclTerraform(this._numberOfRecentPasswordsDisallowed), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password_char_combination: { + value: cdktf.numberToHclTerraform(this._passwordCharCombination), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password_not_username_or_invert: { + value: cdktf.booleanToHclTerraform(this._passwordNotUsernameOrInvert), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + password_validity_period: { + value: cdktf.numberToHclTerraform(this._passwordValidityPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-policy/README.md b/src/constructs/providers/huaweicloud/identity-policy/README.md new file mode 100644 index 00000000..acb06246 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy). diff --git a/src/constructs/providers/huaweicloud/identity-policy/index.ts b/src/constructs/providers/huaweicloud/identity-policy/index.ts new file mode 100644 index 00000000..d4b88a75 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-policy/index.ts @@ -0,0 +1,285 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#description IdentityPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#id IdentityPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#name IdentityPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#path IdentityPolicy#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#policy_document IdentityPolicy#policy_document} + */ + readonly policyDocument: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#version_to_delete IdentityPolicy#version_to_delete} + */ + readonly versionToDelete?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy huaweicloud_identity_policy} +*/ +export class IdentityPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityPolicy to import + * @param importFromId The id of the existing IdentityPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_policy huaweicloud_identity_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityPolicyConfig + */ + public constructor(scope: Construct, id: string, config: IdentityPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._path = config.path; + this._policyDocument = config.policyDocument; + this._versionToDelete = config.versionToDelete; + } + + // ========== + // ATTRIBUTES + // ========== + + // attachment_count - computed: true, optional: false, required: false + public get attachmentCount() { + return this.getNumberAttribute('attachment_count'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // default_version_id - computed: true, optional: false, required: false + public get defaultVersionId() { + return this.getStringAttribute('default_version_id'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // policy_document - computed: false, optional: false, required: true + private _policyDocument?: string; + public get policyDocument() { + return this.getStringAttribute('policy_document'); + } + public set policyDocument(value: string) { + this._policyDocument = value; + } + // Temporarily expose input value. Use with caution. + public get policyDocumentInput() { + return this._policyDocument; + } + + // policy_type - computed: true, optional: false, required: false + public get policyType() { + return this.getStringAttribute('policy_type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // version_ids - computed: true, optional: false, required: false + public get versionIds() { + return this.getListAttribute('version_ids'); + } + + // version_to_delete - computed: false, optional: true, required: false + private _versionToDelete?: string; + public get versionToDelete() { + return this.getStringAttribute('version_to_delete'); + } + public set versionToDelete(value: string) { + this._versionToDelete = value; + } + public resetVersionToDelete() { + this._versionToDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionToDeleteInput() { + return this._versionToDelete; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + path: cdktf.stringToTerraform(this._path), + policy_document: cdktf.stringToTerraform(this._policyDocument), + version_to_delete: cdktf.stringToTerraform(this._versionToDelete), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_document: { + value: cdktf.stringToHclTerraform(this._policyDocument), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_to_delete: { + value: cdktf.stringToHclTerraform(this._versionToDelete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-project-v3/README.md b/src/constructs/providers/huaweicloud/identity-project-v3/README.md new file mode 100644 index 00000000..6f11c871 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-project-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_project_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_project_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3). diff --git a/src/constructs/providers/huaweicloud/identity-project-v3/index.ts b/src/constructs/providers/huaweicloud/identity-project-v3/index.ts new file mode 100644 index 00000000..9809df92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-project-v3/index.ts @@ -0,0 +1,207 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityProjectV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3#description IdentityProjectV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3#id IdentityProjectV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3#name IdentityProjectV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3#status IdentityProjectV3#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3 huaweicloud_identity_project_v3} +*/ +export class IdentityProjectV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_project_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityProjectV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityProjectV3 to import + * @param importFromId The id of the existing IdentityProjectV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityProjectV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_project_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project_v3 huaweicloud_identity_project_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityProjectV3Config + */ + public constructor(scope: Construct, id: string, config: IdentityProjectV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_project_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: true, optional: false, required: false + public get parentId() { + return this.getStringAttribute('parent_id'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-project/README.md b/src/constructs/providers/huaweicloud/identity-project/README.md new file mode 100644 index 00000000..66fb355e --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-project/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_project` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_project`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project). diff --git a/src/constructs/providers/huaweicloud/identity-project/index.ts b/src/constructs/providers/huaweicloud/identity-project/index.ts new file mode 100644 index 00000000..a7b93023 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-project/index.ts @@ -0,0 +1,207 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityProjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project#description IdentityProject#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project#id IdentityProject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project#name IdentityProject#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project#status IdentityProject#status} + */ + readonly status?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project huaweicloud_identity_project} +*/ +export class IdentityProject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_project"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityProject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityProject to import + * @param importFromId The id of the existing IdentityProject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityProject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_project", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_project huaweicloud_identity_project} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityProjectConfig + */ + public constructor(scope: Construct, id: string, config: IdentityProjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_project', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: true, optional: false, required: false + public get parentId() { + return this.getStringAttribute('parent_id'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + status: cdktf.stringToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-protection-policy/README.md b/src/constructs/providers/huaweicloud/identity-protection-policy/README.md new file mode 100644 index 00000000..e236172e --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-protection-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_protection_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_protection_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy). diff --git a/src/constructs/providers/huaweicloud/identity-protection-policy/index.ts b/src/constructs/providers/huaweicloud/identity-protection-policy/index.ts new file mode 100644 index 00000000..5b2c0158 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-protection-policy/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityProtectionPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#id IdentityProtectionPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#protection_enabled IdentityProtectionPolicy#protection_enabled} + */ + readonly protectionEnabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#verification_email IdentityProtectionPolicy#verification_email} + */ + readonly verificationEmail?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#verification_mobile IdentityProtectionPolicy#verification_mobile} + */ + readonly verificationMobile?: string; + /** + * self_management block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#self_management IdentityProtectionPolicy#self_management} + */ + readonly selfManagement?: IdentityProtectionPolicySelfManagement; +} +export interface IdentityProtectionPolicySelfManagement { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#access_key IdentityProtectionPolicy#access_key} + */ + readonly accessKey?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#email IdentityProtectionPolicy#email} + */ + readonly email?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#mobile IdentityProtectionPolicy#mobile} + */ + readonly mobile?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#password IdentityProtectionPolicy#password} + */ + readonly password?: boolean | cdktf.IResolvable; +} + +export function identityProtectionPolicySelfManagementToTerraform(struct?: IdentityProtectionPolicySelfManagementOutputReference | IdentityProtectionPolicySelfManagement): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_key: cdktf.booleanToTerraform(struct!.accessKey), + email: cdktf.booleanToTerraform(struct!.email), + mobile: cdktf.booleanToTerraform(struct!.mobile), + password: cdktf.booleanToTerraform(struct!.password), + } +} + + +export function identityProtectionPolicySelfManagementToHclTerraform(struct?: IdentityProtectionPolicySelfManagementOutputReference | IdentityProtectionPolicySelfManagement): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_key: { + value: cdktf.booleanToHclTerraform(struct!.accessKey), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + email: { + value: cdktf.booleanToHclTerraform(struct!.email), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + mobile: { + value: cdktf.booleanToHclTerraform(struct!.mobile), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + password: { + value: cdktf.booleanToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityProtectionPolicySelfManagementOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IdentityProtectionPolicySelfManagement | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessKey !== undefined) { + hasAnyValues = true; + internalValueResult.accessKey = this._accessKey; + } + if (this._email !== undefined) { + hasAnyValues = true; + internalValueResult.email = this._email; + } + if (this._mobile !== undefined) { + hasAnyValues = true; + internalValueResult.mobile = this._mobile; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProtectionPolicySelfManagement | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessKey = undefined; + this._email = undefined; + this._mobile = undefined; + this._password = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessKey = value.accessKey; + this._email = value.email; + this._mobile = value.mobile; + this._password = value.password; + } + } + + // access_key - computed: false, optional: true, required: false + private _accessKey?: boolean | cdktf.IResolvable; + public get accessKey() { + return this.getBooleanAttribute('access_key'); + } + public set accessKey(value: boolean | cdktf.IResolvable) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // email - computed: false, optional: true, required: false + private _email?: boolean | cdktf.IResolvable; + public get email() { + return this.getBooleanAttribute('email'); + } + public set email(value: boolean | cdktf.IResolvable) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // mobile - computed: false, optional: true, required: false + private _mobile?: boolean | cdktf.IResolvable; + public get mobile() { + return this.getBooleanAttribute('mobile'); + } + public set mobile(value: boolean | cdktf.IResolvable) { + this._mobile = value; + } + public resetMobile() { + this._mobile = undefined; + } + // Temporarily expose input value. Use with caution. + public get mobileInput() { + return this._mobile; + } + + // password - computed: false, optional: true, required: false + private _password?: boolean | cdktf.IResolvable; + public get password() { + return this.getBooleanAttribute('password'); + } + public set password(value: boolean | cdktf.IResolvable) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy huaweicloud_identity_protection_policy} +*/ +export class IdentityProtectionPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_protection_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityProtectionPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityProtectionPolicy to import + * @param importFromId The id of the existing IdentityProtectionPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityProtectionPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_protection_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_protection_policy huaweicloud_identity_protection_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityProtectionPolicyConfig + */ + public constructor(scope: Construct, id: string, config: IdentityProtectionPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_protection_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._protectionEnabled = config.protectionEnabled; + this._verificationEmail = config.verificationEmail; + this._verificationMobile = config.verificationMobile; + this._selfManagement.internalValue = config.selfManagement; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // protection_enabled - computed: false, optional: false, required: true + private _protectionEnabled?: boolean | cdktf.IResolvable; + public get protectionEnabled() { + return this.getBooleanAttribute('protection_enabled'); + } + public set protectionEnabled(value: boolean | cdktf.IResolvable) { + this._protectionEnabled = value; + } + // Temporarily expose input value. Use with caution. + public get protectionEnabledInput() { + return this._protectionEnabled; + } + + // self_verification - computed: true, optional: false, required: false + public get selfVerification() { + return this.getBooleanAttribute('self_verification'); + } + + // verification_email - computed: false, optional: true, required: false + private _verificationEmail?: string; + public get verificationEmail() { + return this.getStringAttribute('verification_email'); + } + public set verificationEmail(value: string) { + this._verificationEmail = value; + } + public resetVerificationEmail() { + this._verificationEmail = undefined; + } + // Temporarily expose input value. Use with caution. + public get verificationEmailInput() { + return this._verificationEmail; + } + + // verification_mobile - computed: false, optional: true, required: false + private _verificationMobile?: string; + public get verificationMobile() { + return this.getStringAttribute('verification_mobile'); + } + public set verificationMobile(value: string) { + this._verificationMobile = value; + } + public resetVerificationMobile() { + this._verificationMobile = undefined; + } + // Temporarily expose input value. Use with caution. + public get verificationMobileInput() { + return this._verificationMobile; + } + + // self_management - computed: false, optional: true, required: false + private _selfManagement = new IdentityProtectionPolicySelfManagementOutputReference(this, "self_management"); + public get selfManagement() { + return this._selfManagement; + } + public putSelfManagement(value: IdentityProtectionPolicySelfManagement) { + this._selfManagement.internalValue = value; + } + public resetSelfManagement() { + this._selfManagement.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get selfManagementInput() { + return this._selfManagement.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + protection_enabled: cdktf.booleanToTerraform(this._protectionEnabled), + verification_email: cdktf.stringToTerraform(this._verificationEmail), + verification_mobile: cdktf.stringToTerraform(this._verificationMobile), + self_management: identityProtectionPolicySelfManagementToTerraform(this._selfManagement.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_enabled: { + value: cdktf.booleanToHclTerraform(this._protectionEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + verification_email: { + value: cdktf.stringToHclTerraform(this._verificationEmail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + verification_mobile: { + value: cdktf.stringToHclTerraform(this._verificationMobile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + self_management: { + value: identityProtectionPolicySelfManagementToHclTerraform(this._selfManagement.internalValue), + isBlock: true, + type: "list", + storageClassType: "IdentityProtectionPolicySelfManagementList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-provider-conversion/README.md b/src/constructs/providers/huaweicloud/identity-provider-conversion/README.md new file mode 100644 index 00000000..212f8c8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-provider-conversion/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_provider_conversion` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_provider_conversion`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion). diff --git a/src/constructs/providers/huaweicloud/identity-provider-conversion/index.ts b/src/constructs/providers/huaweicloud/identity-provider-conversion/index.ts new file mode 100644 index 00000000..eba0b5ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-provider-conversion/index.ts @@ -0,0 +1,643 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityProviderConversionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#id IdentityProviderConversion#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#provider_id IdentityProviderConversion#provider_id} + */ + readonly providerId: string; + /** + * conversion_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#conversion_rules IdentityProviderConversion#conversion_rules} + */ + readonly conversionRules: IdentityProviderConversionConversionRules[] | cdktf.IResolvable; +} +export interface IdentityProviderConversionConversionRulesLocal { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#group IdentityProviderConversion#group} + */ + readonly group?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#username IdentityProviderConversion#username} + */ + readonly username?: string; +} + +export function identityProviderConversionConversionRulesLocalToTerraform(struct?: IdentityProviderConversionConversionRulesLocal | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group: cdktf.stringToTerraform(struct!.group), + username: cdktf.stringToTerraform(struct!.username), + } +} + + +export function identityProviderConversionConversionRulesLocalToHclTerraform(struct?: IdentityProviderConversionConversionRulesLocal | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group: { + value: cdktf.stringToHclTerraform(struct!.group), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + username: { + value: cdktf.stringToHclTerraform(struct!.username), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityProviderConversionConversionRulesLocalOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityProviderConversionConversionRulesLocal | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._group !== undefined) { + hasAnyValues = true; + internalValueResult.group = this._group; + } + if (this._username !== undefined) { + hasAnyValues = true; + internalValueResult.username = this._username; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderConversionConversionRulesLocal | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._group = undefined; + this._username = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._group = value.group; + this._username = value.username; + } + } + + // group - computed: false, optional: true, required: false + private _group?: string; + public get group() { + return this.getStringAttribute('group'); + } + public set group(value: string) { + this._group = value; + } + public resetGroup() { + this._group = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupInput() { + return this._group; + } + + // username - computed: false, optional: true, required: false + private _username?: string; + public get username() { + return this.getStringAttribute('username'); + } + public set username(value: string) { + this._username = value; + } + public resetUsername() { + this._username = undefined; + } + // Temporarily expose input value. Use with caution. + public get usernameInput() { + return this._username; + } +} + +export class IdentityProviderConversionConversionRulesLocalList extends cdktf.ComplexList { + public internalValue? : IdentityProviderConversionConversionRulesLocal[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityProviderConversionConversionRulesLocalOutputReference { + return new IdentityProviderConversionConversionRulesLocalOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IdentityProviderConversionConversionRulesRemote { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#attribute IdentityProviderConversion#attribute} + */ + readonly attribute: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#condition IdentityProviderConversion#condition} + */ + readonly condition?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#value IdentityProviderConversion#value} + */ + readonly value?: string[]; +} + +export function identityProviderConversionConversionRulesRemoteToTerraform(struct?: IdentityProviderConversionConversionRulesRemote | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + attribute: cdktf.stringToTerraform(struct!.attribute), + condition: cdktf.stringToTerraform(struct!.condition), + value: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.value), + } +} + + +export function identityProviderConversionConversionRulesRemoteToHclTerraform(struct?: IdentityProviderConversionConversionRulesRemote | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + attribute: { + value: cdktf.stringToHclTerraform(struct!.attribute), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition: { + value: cdktf.stringToHclTerraform(struct!.condition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.value), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityProviderConversionConversionRulesRemoteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityProviderConversionConversionRulesRemote | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._attribute !== undefined) { + hasAnyValues = true; + internalValueResult.attribute = this._attribute; + } + if (this._condition !== undefined) { + hasAnyValues = true; + internalValueResult.condition = this._condition; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderConversionConversionRulesRemote | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._attribute = undefined; + this._condition = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._attribute = value.attribute; + this._condition = value.condition; + this._value = value.value; + } + } + + // attribute - computed: false, optional: false, required: true + private _attribute?: string; + public get attribute() { + return this.getStringAttribute('attribute'); + } + public set attribute(value: string) { + this._attribute = value; + } + // Temporarily expose input value. Use with caution. + public get attributeInput() { + return this._attribute; + } + + // condition - computed: false, optional: true, required: false + private _condition?: string; + public get condition() { + return this.getStringAttribute('condition'); + } + public set condition(value: string) { + this._condition = value; + } + public resetCondition() { + this._condition = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // value - computed: false, optional: true, required: false + private _value?: string[]; + public get value() { + return this.getListAttribute('value'); + } + public set value(value: string[]) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class IdentityProviderConversionConversionRulesRemoteList extends cdktf.ComplexList { + public internalValue? : IdentityProviderConversionConversionRulesRemote[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityProviderConversionConversionRulesRemoteOutputReference { + return new IdentityProviderConversionConversionRulesRemoteOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IdentityProviderConversionConversionRules { + /** + * local block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#local IdentityProviderConversion#local} + */ + readonly local: IdentityProviderConversionConversionRulesLocal[] | cdktf.IResolvable; + /** + * remote block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#remote IdentityProviderConversion#remote} + */ + readonly remote: IdentityProviderConversionConversionRulesRemote[] | cdktf.IResolvable; +} + +export function identityProviderConversionConversionRulesToTerraform(struct?: IdentityProviderConversionConversionRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + local: cdktf.listMapper(identityProviderConversionConversionRulesLocalToTerraform, true)(struct!.local), + remote: cdktf.listMapper(identityProviderConversionConversionRulesRemoteToTerraform, true)(struct!.remote), + } +} + + +export function identityProviderConversionConversionRulesToHclTerraform(struct?: IdentityProviderConversionConversionRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + local: { + value: cdktf.listMapperHcl(identityProviderConversionConversionRulesLocalToHclTerraform, true)(struct!.local), + isBlock: true, + type: "list", + storageClassType: "IdentityProviderConversionConversionRulesLocalList", + }, + remote: { + value: cdktf.listMapperHcl(identityProviderConversionConversionRulesRemoteToHclTerraform, true)(struct!.remote), + isBlock: true, + type: "list", + storageClassType: "IdentityProviderConversionConversionRulesRemoteList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityProviderConversionConversionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityProviderConversionConversionRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._local?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.local = this._local?.internalValue; + } + if (this._remote?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.remote = this._remote?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderConversionConversionRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._local.internalValue = undefined; + this._remote.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._local.internalValue = value.local; + this._remote.internalValue = value.remote; + } + } + + // local - computed: false, optional: false, required: true + private _local = new IdentityProviderConversionConversionRulesLocalList(this, "local", false); + public get local() { + return this._local; + } + public putLocal(value: IdentityProviderConversionConversionRulesLocal[] | cdktf.IResolvable) { + this._local.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get localInput() { + return this._local.internalValue; + } + + // remote - computed: false, optional: false, required: true + private _remote = new IdentityProviderConversionConversionRulesRemoteList(this, "remote", false); + public get remote() { + return this._remote; + } + public putRemote(value: IdentityProviderConversionConversionRulesRemote[] | cdktf.IResolvable) { + this._remote.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get remoteInput() { + return this._remote.internalValue; + } +} + +export class IdentityProviderConversionConversionRulesList extends cdktf.ComplexList { + public internalValue? : IdentityProviderConversionConversionRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityProviderConversionConversionRulesOutputReference { + return new IdentityProviderConversionConversionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion huaweicloud_identity_provider_conversion} +*/ +export class IdentityProviderConversion extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_provider_conversion"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityProviderConversion resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityProviderConversion to import + * @param importFromId The id of the existing IdentityProviderConversion that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityProviderConversion to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_provider_conversion", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider_conversion huaweicloud_identity_provider_conversion} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityProviderConversionConfig + */ + public constructor(scope: Construct, id: string, config: IdentityProviderConversionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_provider_conversion', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._providerId = config.providerId; + this._conversionRules.internalValue = config.conversionRules; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // provider_id - computed: false, optional: false, required: true + private _providerId?: string; + public get providerId() { + return this.getStringAttribute('provider_id'); + } + public set providerId(value: string) { + this._providerId = value; + } + // Temporarily expose input value. Use with caution. + public get providerIdInput() { + return this._providerId; + } + + // conversion_rules - computed: false, optional: false, required: true + private _conversionRules = new IdentityProviderConversionConversionRulesList(this, "conversion_rules", false); + public get conversionRules() { + return this._conversionRules; + } + public putConversionRules(value: IdentityProviderConversionConversionRules[] | cdktf.IResolvable) { + this._conversionRules.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conversionRulesInput() { + return this._conversionRules.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + provider_id: cdktf.stringToTerraform(this._providerId), + conversion_rules: cdktf.listMapper(identityProviderConversionConversionRulesToTerraform, true)(this._conversionRules.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_id: { + value: cdktf.stringToHclTerraform(this._providerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conversion_rules: { + value: cdktf.listMapperHcl(identityProviderConversionConversionRulesToHclTerraform, true)(this._conversionRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "IdentityProviderConversionConversionRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-provider/README.md b/src/constructs/providers/huaweicloud/identity-provider/README.md new file mode 100644 index 00000000..517fb379 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-provider/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_provider` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_provider`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider). diff --git a/src/constructs/providers/huaweicloud/identity-provider/index.ts b/src/constructs/providers/huaweicloud/identity-provider/index.ts new file mode 100644 index 00000000..a0b5f706 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-provider/index.ts @@ -0,0 +1,869 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityProviderConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#description IdentityProvider#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#id IdentityProvider#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#metadata IdentityProvider#metadata} + */ + readonly metadata?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#name IdentityProvider#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#protocol IdentityProvider#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#sso_type IdentityProvider#sso_type} + */ + readonly ssoType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#status IdentityProvider#status} + */ + readonly status?: boolean | cdktf.IResolvable; + /** + * access_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#access_config IdentityProvider#access_config} + */ + readonly accessConfig?: IdentityProviderAccessConfig; +} +export interface IdentityProviderConversionRulesLocal { +} + +export function identityProviderConversionRulesLocalToTerraform(struct?: IdentityProviderConversionRulesLocal): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function identityProviderConversionRulesLocalToHclTerraform(struct?: IdentityProviderConversionRulesLocal): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IdentityProviderConversionRulesLocalOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityProviderConversionRulesLocal | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderConversionRulesLocal | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // group - computed: true, optional: false, required: false + public get group() { + return this.getStringAttribute('group'); + } + + // username - computed: true, optional: false, required: false + public get username() { + return this.getStringAttribute('username'); + } +} + +export class IdentityProviderConversionRulesLocalList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityProviderConversionRulesLocalOutputReference { + return new IdentityProviderConversionRulesLocalOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IdentityProviderConversionRulesRemote { +} + +export function identityProviderConversionRulesRemoteToTerraform(struct?: IdentityProviderConversionRulesRemote): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function identityProviderConversionRulesRemoteToHclTerraform(struct?: IdentityProviderConversionRulesRemote): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IdentityProviderConversionRulesRemoteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityProviderConversionRulesRemote | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderConversionRulesRemote | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // attribute - computed: true, optional: false, required: false + public get attribute() { + return this.getStringAttribute('attribute'); + } + + // condition - computed: true, optional: false, required: false + public get condition() { + return this.getStringAttribute('condition'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getListAttribute('value'); + } +} + +export class IdentityProviderConversionRulesRemoteList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityProviderConversionRulesRemoteOutputReference { + return new IdentityProviderConversionRulesRemoteOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IdentityProviderConversionRules { +} + +export function identityProviderConversionRulesToTerraform(struct?: IdentityProviderConversionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function identityProviderConversionRulesToHclTerraform(struct?: IdentityProviderConversionRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IdentityProviderConversionRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentityProviderConversionRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderConversionRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // local - computed: true, optional: false, required: false + private _local = new IdentityProviderConversionRulesLocalList(this, "local", false); + public get local() { + return this._local; + } + + // remote - computed: true, optional: false, required: false + private _remote = new IdentityProviderConversionRulesRemoteList(this, "remote", false); + public get remote() { + return this._remote; + } +} + +export class IdentityProviderConversionRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentityProviderConversionRulesOutputReference { + return new IdentityProviderConversionRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IdentityProviderAccessConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#access_type IdentityProvider#access_type} + */ + readonly accessType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#authorization_endpoint IdentityProvider#authorization_endpoint} + */ + readonly authorizationEndpoint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#client_id IdentityProvider#client_id} + */ + readonly clientId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#provider_url IdentityProvider#provider_url} + */ + readonly providerUrl: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#response_mode IdentityProvider#response_mode} + */ + readonly responseMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#response_type IdentityProvider#response_type} + */ + readonly responseType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#scopes IdentityProvider#scopes} + */ + readonly scopes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#signing_key IdentityProvider#signing_key} + */ + readonly signingKey: string; +} + +export function identityProviderAccessConfigToTerraform(struct?: IdentityProviderAccessConfigOutputReference | IdentityProviderAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_type: cdktf.stringToTerraform(struct!.accessType), + authorization_endpoint: cdktf.stringToTerraform(struct!.authorizationEndpoint), + client_id: cdktf.stringToTerraform(struct!.clientId), + provider_url: cdktf.stringToTerraform(struct!.providerUrl), + response_mode: cdktf.stringToTerraform(struct!.responseMode), + response_type: cdktf.stringToTerraform(struct!.responseType), + scopes: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.scopes), + signing_key: cdktf.stringToTerraform(struct!.signingKey), + } +} + + +export function identityProviderAccessConfigToHclTerraform(struct?: IdentityProviderAccessConfigOutputReference | IdentityProviderAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_type: { + value: cdktf.stringToHclTerraform(struct!.accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authorization_endpoint: { + value: cdktf.stringToHclTerraform(struct!.authorizationEndpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_id: { + value: cdktf.stringToHclTerraform(struct!.clientId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_url: { + value: cdktf.stringToHclTerraform(struct!.providerUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_mode: { + value: cdktf.stringToHclTerraform(struct!.responseMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_type: { + value: cdktf.stringToHclTerraform(struct!.responseType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scopes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.scopes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + signing_key: { + value: cdktf.stringToHclTerraform(struct!.signingKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentityProviderAccessConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IdentityProviderAccessConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessType !== undefined) { + hasAnyValues = true; + internalValueResult.accessType = this._accessType; + } + if (this._authorizationEndpoint !== undefined) { + hasAnyValues = true; + internalValueResult.authorizationEndpoint = this._authorizationEndpoint; + } + if (this._clientId !== undefined) { + hasAnyValues = true; + internalValueResult.clientId = this._clientId; + } + if (this._providerUrl !== undefined) { + hasAnyValues = true; + internalValueResult.providerUrl = this._providerUrl; + } + if (this._responseMode !== undefined) { + hasAnyValues = true; + internalValueResult.responseMode = this._responseMode; + } + if (this._responseType !== undefined) { + hasAnyValues = true; + internalValueResult.responseType = this._responseType; + } + if (this._scopes !== undefined) { + hasAnyValues = true; + internalValueResult.scopes = this._scopes; + } + if (this._signingKey !== undefined) { + hasAnyValues = true; + internalValueResult.signingKey = this._signingKey; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentityProviderAccessConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessType = undefined; + this._authorizationEndpoint = undefined; + this._clientId = undefined; + this._providerUrl = undefined; + this._responseMode = undefined; + this._responseType = undefined; + this._scopes = undefined; + this._signingKey = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessType = value.accessType; + this._authorizationEndpoint = value.authorizationEndpoint; + this._clientId = value.clientId; + this._providerUrl = value.providerUrl; + this._responseMode = value.responseMode; + this._responseType = value.responseType; + this._scopes = value.scopes; + this._signingKey = value.signingKey; + } + } + + // access_type - computed: false, optional: false, required: true + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // authorization_endpoint - computed: true, optional: true, required: false + private _authorizationEndpoint?: string; + public get authorizationEndpoint() { + return this.getStringAttribute('authorization_endpoint'); + } + public set authorizationEndpoint(value: string) { + this._authorizationEndpoint = value; + } + public resetAuthorizationEndpoint() { + this._authorizationEndpoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizationEndpointInput() { + return this._authorizationEndpoint; + } + + // client_id - computed: false, optional: false, required: true + private _clientId?: string; + public get clientId() { + return this.getStringAttribute('client_id'); + } + public set clientId(value: string) { + this._clientId = value; + } + // Temporarily expose input value. Use with caution. + public get clientIdInput() { + return this._clientId; + } + + // provider_url - computed: false, optional: false, required: true + private _providerUrl?: string; + public get providerUrl() { + return this.getStringAttribute('provider_url'); + } + public set providerUrl(value: string) { + this._providerUrl = value; + } + // Temporarily expose input value. Use with caution. + public get providerUrlInput() { + return this._providerUrl; + } + + // response_mode - computed: false, optional: true, required: false + private _responseMode?: string; + public get responseMode() { + return this.getStringAttribute('response_mode'); + } + public set responseMode(value: string) { + this._responseMode = value; + } + public resetResponseMode() { + this._responseMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseModeInput() { + return this._responseMode; + } + + // response_type - computed: false, optional: true, required: false + private _responseType?: string; + public get responseType() { + return this.getStringAttribute('response_type'); + } + public set responseType(value: string) { + this._responseType = value; + } + public resetResponseType() { + this._responseType = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseTypeInput() { + return this._responseType; + } + + // scopes - computed: true, optional: true, required: false + private _scopes?: string[]; + public get scopes() { + return this.getListAttribute('scopes'); + } + public set scopes(value: string[]) { + this._scopes = value; + } + public resetScopes() { + this._scopes = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopesInput() { + return this._scopes; + } + + // signing_key - computed: false, optional: false, required: true + private _signingKey?: string; + public get signingKey() { + return this.getStringAttribute('signing_key'); + } + public set signingKey(value: string) { + this._signingKey = value; + } + // Temporarily expose input value. Use with caution. + public get signingKeyInput() { + return this._signingKey; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider huaweicloud_identity_provider} +*/ +export class IdentityProvider extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_provider"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityProvider resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityProvider to import + * @param importFromId The id of the existing IdentityProvider that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityProvider to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_provider", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_provider huaweicloud_identity_provider} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityProviderConfig + */ + public constructor(scope: Construct, id: string, config: IdentityProviderConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_provider', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._metadata = config.metadata; + this._name = config.name; + this._protocol = config.protocol; + this._ssoType = config.ssoType; + this._status = config.status; + this._accessConfig.internalValue = config.accessConfig; + } + + // ========== + // ATTRIBUTES + // ========== + + // conversion_rules - computed: true, optional: false, required: false + private _conversionRules = new IdentityProviderConversionRulesList(this, "conversion_rules", false); + public get conversionRules() { + return this._conversionRules; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // login_link - computed: true, optional: false, required: false + public get loginLink() { + return this.getStringAttribute('login_link'); + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: string; + public get metadata() { + return this.getStringAttribute('metadata'); + } + public set metadata(value: string) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // sso_type - computed: true, optional: true, required: false + private _ssoType?: string; + public get ssoType() { + return this.getStringAttribute('sso_type'); + } + public set ssoType(value: string) { + this._ssoType = value; + } + public resetSsoType() { + this._ssoType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ssoTypeInput() { + return this._ssoType; + } + + // status - computed: false, optional: true, required: false + private _status?: boolean | cdktf.IResolvable; + public get status() { + return this.getBooleanAttribute('status'); + } + public set status(value: boolean | cdktf.IResolvable) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // access_config - computed: false, optional: true, required: false + private _accessConfig = new IdentityProviderAccessConfigOutputReference(this, "access_config"); + public get accessConfig() { + return this._accessConfig; + } + public putAccessConfig(value: IdentityProviderAccessConfig) { + this._accessConfig.internalValue = value; + } + public resetAccessConfig() { + this._accessConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessConfigInput() { + return this._accessConfig.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + metadata: cdktf.stringToTerraform(this._metadata), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + sso_type: cdktf.stringToTerraform(this._ssoType), + status: cdktf.booleanToTerraform(this._status), + access_config: identityProviderAccessConfigToTerraform(this._accessConfig.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metadata: { + value: cdktf.stringToHclTerraform(this._metadata), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sso_type: { + value: cdktf.stringToHclTerraform(this._ssoType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.booleanToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + access_config: { + value: identityProviderAccessConfigToHclTerraform(this._accessConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "IdentityProviderAccessConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-role-assignment-v3/README.md b/src/constructs/providers/huaweicloud/identity-role-assignment-v3/README.md new file mode 100644 index 00000000..31c36897 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-role-assignment-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_role_assignment_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_role_assignment_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3). diff --git a/src/constructs/providers/huaweicloud/identity-role-assignment-v3/index.ts b/src/constructs/providers/huaweicloud/identity-role-assignment-v3/index.ts new file mode 100644 index 00000000..360f9487 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-role-assignment-v3/index.ts @@ -0,0 +1,250 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityRoleAssignmentV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#domain_id IdentityRoleAssignmentV3#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#enterprise_project_id IdentityRoleAssignmentV3#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#group_id IdentityRoleAssignmentV3#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#id IdentityRoleAssignmentV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#project_id IdentityRoleAssignmentV3#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#role_id IdentityRoleAssignmentV3#role_id} + */ + readonly roleId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3 huaweicloud_identity_role_assignment_v3} +*/ +export class IdentityRoleAssignmentV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_role_assignment_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityRoleAssignmentV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityRoleAssignmentV3 to import + * @param importFromId The id of the existing IdentityRoleAssignmentV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityRoleAssignmentV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_role_assignment_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment_v3 huaweicloud_identity_role_assignment_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityRoleAssignmentV3Config + */ + public constructor(scope: Construct, id: string, config: IdentityRoleAssignmentV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_role_assignment_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainId = config.domainId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._id = config.id; + this._projectId = config.projectId; + this._roleId = config.roleId; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_id - computed: false, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // role_id - computed: false, optional: false, required: true + private _roleId?: string; + public get roleId() { + return this.getStringAttribute('role_id'); + } + public set roleId(value: string) { + this._roleId = value; + } + // Temporarily expose input value. Use with caution. + public get roleIdInput() { + return this._roleId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_id: cdktf.stringToTerraform(this._domainId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + project_id: cdktf.stringToTerraform(this._projectId), + role_id: cdktf.stringToTerraform(this._roleId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role_id: { + value: cdktf.stringToHclTerraform(this._roleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-role-assignment/README.md b/src/constructs/providers/huaweicloud/identity-role-assignment/README.md new file mode 100644 index 00000000..d33a4104 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-role-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_role_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_role_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment). diff --git a/src/constructs/providers/huaweicloud/identity-role-assignment/index.ts b/src/constructs/providers/huaweicloud/identity-role-assignment/index.ts new file mode 100644 index 00000000..98a4b9c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-role-assignment/index.ts @@ -0,0 +1,250 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityRoleAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#domain_id IdentityRoleAssignment#domain_id} + */ + readonly domainId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#enterprise_project_id IdentityRoleAssignment#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#group_id IdentityRoleAssignment#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#id IdentityRoleAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#project_id IdentityRoleAssignment#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#role_id IdentityRoleAssignment#role_id} + */ + readonly roleId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment huaweicloud_identity_role_assignment} +*/ +export class IdentityRoleAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_role_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityRoleAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityRoleAssignment to import + * @param importFromId The id of the existing IdentityRoleAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityRoleAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_role_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role_assignment huaweicloud_identity_role_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityRoleAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentityRoleAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_role_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainId = config.domainId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._id = config.id; + this._projectId = config.projectId; + this._roleId = config.roleId; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_id - computed: false, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // role_id - computed: false, optional: false, required: true + private _roleId?: string; + public get roleId() { + return this.getStringAttribute('role_id'); + } + public set roleId(value: string) { + this._roleId = value; + } + // Temporarily expose input value. Use with caution. + public get roleIdInput() { + return this._roleId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_id: cdktf.stringToTerraform(this._domainId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + project_id: cdktf.stringToTerraform(this._projectId), + role_id: cdktf.stringToTerraform(this._roleId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role_id: { + value: cdktf.stringToHclTerraform(this._roleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-role/README.md b/src/constructs/providers/huaweicloud/identity-role/README.md new file mode 100644 index 00000000..88650137 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-role/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_role` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_role`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role). diff --git a/src/constructs/providers/huaweicloud/identity-role/index.ts b/src/constructs/providers/huaweicloud/identity-role/index.ts new file mode 100644 index 00000000..b7d90abc --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-role/index.ts @@ -0,0 +1,221 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityRoleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role#description IdentityRole#description} + */ + readonly description: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role#id IdentityRole#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role#name IdentityRole#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role#policy IdentityRole#policy} + */ + readonly policy: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role#type IdentityRole#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role huaweicloud_identity_role} +*/ +export class IdentityRole extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_role"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityRole resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityRole to import + * @param importFromId The id of the existing IdentityRole that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityRole to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_role", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_role huaweicloud_identity_role} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityRoleConfig + */ + public constructor(scope: Construct, id: string, config: IdentityRoleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_role', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._policy = config.policy; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy - computed: false, optional: false, required: true + private _policy?: string; + public get policy() { + return this.getStringAttribute('policy'); + } + public set policy(value: string) { + this._policy = value; + } + // Temporarily expose input value. Use with caution. + public get policyInput() { + return this._policy; + } + + // references - computed: true, optional: false, required: false + public get references() { + return this.getNumberAttribute('references'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy: cdktf.stringToTerraform(this._policy), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy: { + value: cdktf.stringToHclTerraform(this._policy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-service-agency/README.md b/src/constructs/providers/huaweicloud/identity-service-agency/README.md new file mode 100644 index 00000000..801aceb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-service-agency/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_service_agency` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_service_agency`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency). diff --git a/src/constructs/providers/huaweicloud/identity-service-agency/index.ts b/src/constructs/providers/huaweicloud/identity-service-agency/index.ts new file mode 100644 index 00000000..d93883e6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-service-agency/index.ts @@ -0,0 +1,318 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityServiceAgencyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#delegated_service_name IdentityServiceAgency#delegated_service_name} + */ + readonly delegatedServiceName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#description IdentityServiceAgency#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#duration IdentityServiceAgency#duration} + */ + readonly duration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#id IdentityServiceAgency#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#name IdentityServiceAgency#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#path IdentityServiceAgency#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#policy_names IdentityServiceAgency#policy_names} + */ + readonly policyNames: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#tags IdentityServiceAgency#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency huaweicloud_identity_service_agency} +*/ +export class IdentityServiceAgency extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_service_agency"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityServiceAgency resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityServiceAgency to import + * @param importFromId The id of the existing IdentityServiceAgency that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityServiceAgency to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_service_agency", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_service_agency huaweicloud_identity_service_agency} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityServiceAgencyConfig + */ + public constructor(scope: Construct, id: string, config: IdentityServiceAgencyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_service_agency', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._delegatedServiceName = config.delegatedServiceName; + this._description = config.description; + this._duration = config.duration; + this._id = config.id; + this._name = config.name; + this._path = config.path; + this._policyNames = config.policyNames; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delegated_service_name - computed: false, optional: false, required: true + private _delegatedServiceName?: string; + public get delegatedServiceName() { + return this.getStringAttribute('delegated_service_name'); + } + public set delegatedServiceName(value: string) { + this._delegatedServiceName = value; + } + // Temporarily expose input value. Use with caution. + public get delegatedServiceNameInput() { + return this._delegatedServiceName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // duration - computed: true, optional: true, required: false + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // policy_names - computed: false, optional: false, required: true + private _policyNames?: string[]; + public get policyNames() { + return cdktf.Fn.tolist(this.getListAttribute('policy_names')); + } + public set policyNames(value: string[]) { + this._policyNames = value; + } + // Temporarily expose input value. Use with caution. + public get policyNamesInput() { + return this._policyNames; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // trust_policy - computed: true, optional: false, required: false + public get trustPolicy() { + return this.getStringAttribute('trust_policy'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delegated_service_name: cdktf.stringToTerraform(this._delegatedServiceName), + description: cdktf.stringToTerraform(this._description), + duration: cdktf.numberToTerraform(this._duration), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + path: cdktf.stringToTerraform(this._path), + policy_names: cdktf.listMapper(cdktf.stringToTerraform, false)(this._policyNames), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delegated_service_name: { + value: cdktf.stringToHclTerraform(this._delegatedServiceName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + duration: { + value: cdktf.numberToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._policyNames), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-trust-agency/README.md b/src/constructs/providers/huaweicloud/identity-trust-agency/README.md new file mode 100644 index 00000000..09ca216b --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-trust-agency/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_trust_agency` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_trust_agency`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency). diff --git a/src/constructs/providers/huaweicloud/identity-trust-agency/index.ts b/src/constructs/providers/huaweicloud/identity-trust-agency/index.ts new file mode 100644 index 00000000..2cedc748 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-trust-agency/index.ts @@ -0,0 +1,313 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityTrustAgencyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#description IdentityTrustAgency#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#duration IdentityTrustAgency#duration} + */ + readonly duration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#id IdentityTrustAgency#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#name IdentityTrustAgency#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#path IdentityTrustAgency#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#policy_names IdentityTrustAgency#policy_names} + */ + readonly policyNames: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#tags IdentityTrustAgency#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#trust_policy IdentityTrustAgency#trust_policy} + */ + readonly trustPolicy: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency huaweicloud_identity_trust_agency} +*/ +export class IdentityTrustAgency extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_trust_agency"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityTrustAgency resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityTrustAgency to import + * @param importFromId The id of the existing IdentityTrustAgency that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityTrustAgency to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_trust_agency", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_trust_agency huaweicloud_identity_trust_agency} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityTrustAgencyConfig + */ + public constructor(scope: Construct, id: string, config: IdentityTrustAgencyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_trust_agency', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._duration = config.duration; + this._id = config.id; + this._name = config.name; + this._path = config.path; + this._policyNames = config.policyNames; + this._tags = config.tags; + this._trustPolicy = config.trustPolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // duration - computed: true, optional: true, required: false + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // policy_names - computed: false, optional: false, required: true + private _policyNames?: string[]; + public get policyNames() { + return cdktf.Fn.tolist(this.getListAttribute('policy_names')); + } + public set policyNames(value: string[]) { + this._policyNames = value; + } + // Temporarily expose input value. Use with caution. + public get policyNamesInput() { + return this._policyNames; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // trust_policy - computed: false, optional: false, required: true + private _trustPolicy?: string; + public get trustPolicy() { + return this.getStringAttribute('trust_policy'); + } + public set trustPolicy(value: string) { + this._trustPolicy = value; + } + // Temporarily expose input value. Use with caution. + public get trustPolicyInput() { + return this._trustPolicy; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + duration: cdktf.numberToTerraform(this._duration), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + path: cdktf.stringToTerraform(this._path), + policy_names: cdktf.listMapper(cdktf.stringToTerraform, false)(this._policyNames), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + trust_policy: cdktf.stringToTerraform(this._trustPolicy), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + duration: { + value: cdktf.numberToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._policyNames), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + trust_policy: { + value: cdktf.stringToHclTerraform(this._trustPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-user-role-assignment/README.md b/src/constructs/providers/huaweicloud/identity-user-role-assignment/README.md new file mode 100644 index 00000000..93a66887 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user-role-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_user_role_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_user_role_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment). diff --git a/src/constructs/providers/huaweicloud/identity-user-role-assignment/index.ts b/src/constructs/providers/huaweicloud/identity-user-role-assignment/index.ts new file mode 100644 index 00000000..94e29687 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user-role-assignment/index.ts @@ -0,0 +1,191 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityUserRoleAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment#enterprise_project_id IdentityUserRoleAssignment#enterprise_project_id} + */ + readonly enterpriseProjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment#id IdentityUserRoleAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment#role_id IdentityUserRoleAssignment#role_id} + */ + readonly roleId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment#user_id IdentityUserRoleAssignment#user_id} + */ + readonly userId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment huaweicloud_identity_user_role_assignment} +*/ +export class IdentityUserRoleAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_user_role_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityUserRoleAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityUserRoleAssignment to import + * @param importFromId The id of the existing IdentityUserRoleAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityUserRoleAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_user_role_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_role_assignment huaweicloud_identity_user_role_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityUserRoleAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentityUserRoleAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_user_role_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._roleId = config.roleId; + this._userId = config.userId; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: false, required: true + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // role_id - computed: false, optional: false, required: true + private _roleId?: string; + public get roleId() { + return this.getStringAttribute('role_id'); + } + public set roleId(value: string) { + this._roleId = value; + } + // Temporarily expose input value. Use with caution. + public get roleIdInput() { + return this._roleId; + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + role_id: cdktf.stringToTerraform(this._roleId), + user_id: cdktf.stringToTerraform(this._userId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role_id: { + value: cdktf.stringToHclTerraform(this._roleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-user-token/README.md b/src/constructs/providers/huaweicloud/identity-user-token/README.md new file mode 100644 index 00000000..865079b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user-token/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_user_token` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_user_token`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token). diff --git a/src/constructs/providers/huaweicloud/identity-user-token/index.ts b/src/constructs/providers/huaweicloud/identity-user-token/index.ts new file mode 100644 index 00000000..91bb5c61 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user-token/index.ts @@ -0,0 +1,229 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityUserTokenConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token#account_name IdentityUserToken#account_name} + */ + readonly accountName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token#id IdentityUserToken#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token#password IdentityUserToken#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token#project_name IdentityUserToken#project_name} + */ + readonly projectName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token#user_name IdentityUserToken#user_name} + */ + readonly userName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token huaweicloud_identity_user_token} +*/ +export class IdentityUserToken extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_user_token"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityUserToken resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityUserToken to import + * @param importFromId The id of the existing IdentityUserToken that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityUserToken to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_user_token", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_token huaweicloud_identity_user_token} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityUserTokenConfig + */ + public constructor(scope: Construct, id: string, config: IdentityUserTokenConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_user_token', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountName = config.accountName; + this._id = config.id; + this._password = config.password; + this._projectName = config.projectName; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_name - computed: false, optional: false, required: true + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // expires_at - computed: true, optional: false, required: false + public get expiresAt() { + return this.getStringAttribute('expires_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // project_name - computed: false, optional: true, required: false + private _projectName?: string; + public get projectName() { + return this.getStringAttribute('project_name'); + } + public set projectName(value: string) { + this._projectName = value; + } + public resetProjectName() { + this._projectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectNameInput() { + return this._projectName; + } + + // token - computed: true, optional: false, required: false + public get token() { + return this.getStringAttribute('token'); + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_name: cdktf.stringToTerraform(this._accountName), + id: cdktf.stringToTerraform(this._id), + password: cdktf.stringToTerraform(this._password), + project_name: cdktf.stringToTerraform(this._projectName), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_name: { + value: cdktf.stringToHclTerraform(this._projectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-user-v3/README.md b/src/constructs/providers/huaweicloud/identity-user-v3/README.md new file mode 100644 index 00000000..5715bff1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_user_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_user_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3). diff --git a/src/constructs/providers/huaweicloud/identity-user-v3/index.ts b/src/constructs/providers/huaweicloud/identity-user-v3/index.ts new file mode 100644 index 00000000..8e3f3381 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user-v3/index.ts @@ -0,0 +1,464 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityUserV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#access_type IdentityUserV3#access_type} + */ + readonly accessType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#country_code IdentityUserV3#country_code} + */ + readonly countryCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#description IdentityUserV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#email IdentityUserV3#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#enabled IdentityUserV3#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#external_identity_id IdentityUserV3#external_identity_id} + */ + readonly externalIdentityId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#external_identity_type IdentityUserV3#external_identity_type} + */ + readonly externalIdentityType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#id IdentityUserV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#login_protect_verification_method IdentityUserV3#login_protect_verification_method} + */ + readonly loginProtectVerificationMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#name IdentityUserV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#password IdentityUserV3#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#phone IdentityUserV3#phone} + */ + readonly phone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#pwd_reset IdentityUserV3#pwd_reset} + */ + readonly pwdReset?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3 huaweicloud_identity_user_v3} +*/ +export class IdentityUserV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_user_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityUserV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityUserV3 to import + * @param importFromId The id of the existing IdentityUserV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityUserV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_user_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user_v3 huaweicloud_identity_user_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityUserV3Config + */ + public constructor(scope: Construct, id: string, config: IdentityUserV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_user_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessType = config.accessType; + this._countryCode = config.countryCode; + this._description = config.description; + this._email = config.email; + this._enabled = config.enabled; + this._externalIdentityId = config.externalIdentityId; + this._externalIdentityType = config.externalIdentityType; + this._id = config.id; + this._loginProtectVerificationMethod = config.loginProtectVerificationMethod; + this._name = config.name; + this._password = config.password; + this._phone = config.phone; + this._pwdReset = config.pwdReset; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_type - computed: true, optional: true, required: false + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + public resetAccessType() { + this._accessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // country_code - computed: false, optional: true, required: false + private _countryCode?: string; + public get countryCode() { + return this.getStringAttribute('country_code'); + } + public set countryCode(value: string) { + this._countryCode = value; + } + public resetCountryCode() { + this._countryCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryCodeInput() { + return this._countryCode; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // email - computed: false, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // external_identity_id - computed: false, optional: true, required: false + private _externalIdentityId?: string; + public get externalIdentityId() { + return this.getStringAttribute('external_identity_id'); + } + public set externalIdentityId(value: string) { + this._externalIdentityId = value; + } + public resetExternalIdentityId() { + this._externalIdentityId = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalIdentityIdInput() { + return this._externalIdentityId; + } + + // external_identity_type - computed: true, optional: true, required: false + private _externalIdentityType?: string; + public get externalIdentityType() { + return this.getStringAttribute('external_identity_type'); + } + public set externalIdentityType(value: string) { + this._externalIdentityType = value; + } + public resetExternalIdentityType() { + this._externalIdentityType = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalIdentityTypeInput() { + return this._externalIdentityType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // last_login - computed: true, optional: false, required: false + public get lastLogin() { + return this.getStringAttribute('last_login'); + } + + // login_protect_verification_method - computed: false, optional: true, required: false + private _loginProtectVerificationMethod?: string; + public get loginProtectVerificationMethod() { + return this.getStringAttribute('login_protect_verification_method'); + } + public set loginProtectVerificationMethod(value: string) { + this._loginProtectVerificationMethod = value; + } + public resetLoginProtectVerificationMethod() { + this._loginProtectVerificationMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginProtectVerificationMethodInput() { + return this._loginProtectVerificationMethod; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // password_strength - computed: true, optional: false, required: false + public get passwordStrength() { + return this.getStringAttribute('password_strength'); + } + + // phone - computed: false, optional: true, required: false + private _phone?: string; + public get phone() { + return this.getStringAttribute('phone'); + } + public set phone(value: string) { + this._phone = value; + } + public resetPhone() { + this._phone = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneInput() { + return this._phone; + } + + // pwd_reset - computed: false, optional: true, required: false + private _pwdReset?: boolean | cdktf.IResolvable; + public get pwdReset() { + return this.getBooleanAttribute('pwd_reset'); + } + public set pwdReset(value: boolean | cdktf.IResolvable) { + this._pwdReset = value; + } + public resetPwdReset() { + this._pwdReset = undefined; + } + // Temporarily expose input value. Use with caution. + public get pwdResetInput() { + return this._pwdReset; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_type: cdktf.stringToTerraform(this._accessType), + country_code: cdktf.stringToTerraform(this._countryCode), + description: cdktf.stringToTerraform(this._description), + email: cdktf.stringToTerraform(this._email), + enabled: cdktf.booleanToTerraform(this._enabled), + external_identity_id: cdktf.stringToTerraform(this._externalIdentityId), + external_identity_type: cdktf.stringToTerraform(this._externalIdentityType), + id: cdktf.stringToTerraform(this._id), + login_protect_verification_method: cdktf.stringToTerraform(this._loginProtectVerificationMethod), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + phone: cdktf.stringToTerraform(this._phone), + pwd_reset: cdktf.booleanToTerraform(this._pwdReset), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_type: { + value: cdktf.stringToHclTerraform(this._accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country_code: { + value: cdktf.stringToHclTerraform(this._countryCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + external_identity_id: { + value: cdktf.stringToHclTerraform(this._externalIdentityId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + external_identity_type: { + value: cdktf.stringToHclTerraform(this._externalIdentityType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + login_protect_verification_method: { + value: cdktf.stringToHclTerraform(this._loginProtectVerificationMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone: { + value: cdktf.stringToHclTerraform(this._phone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pwd_reset: { + value: cdktf.booleanToHclTerraform(this._pwdReset), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-user/README.md b/src/constructs/providers/huaweicloud/identity-user/README.md new file mode 100644 index 00000000..9cf404d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user). diff --git a/src/constructs/providers/huaweicloud/identity-user/index.ts b/src/constructs/providers/huaweicloud/identity-user/index.ts new file mode 100644 index 00000000..81b85fa2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-user/index.ts @@ -0,0 +1,464 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityUserConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#access_type IdentityUser#access_type} + */ + readonly accessType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#country_code IdentityUser#country_code} + */ + readonly countryCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#description IdentityUser#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#email IdentityUser#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#enabled IdentityUser#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#external_identity_id IdentityUser#external_identity_id} + */ + readonly externalIdentityId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#external_identity_type IdentityUser#external_identity_type} + */ + readonly externalIdentityType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#id IdentityUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#login_protect_verification_method IdentityUser#login_protect_verification_method} + */ + readonly loginProtectVerificationMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#name IdentityUser#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#password IdentityUser#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#phone IdentityUser#phone} + */ + readonly phone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#pwd_reset IdentityUser#pwd_reset} + */ + readonly pwdReset?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user huaweicloud_identity_user} +*/ +export class IdentityUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityUser to import + * @param importFromId The id of the existing IdentityUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_user huaweicloud_identity_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityUserConfig + */ + public constructor(scope: Construct, id: string, config: IdentityUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessType = config.accessType; + this._countryCode = config.countryCode; + this._description = config.description; + this._email = config.email; + this._enabled = config.enabled; + this._externalIdentityId = config.externalIdentityId; + this._externalIdentityType = config.externalIdentityType; + this._id = config.id; + this._loginProtectVerificationMethod = config.loginProtectVerificationMethod; + this._name = config.name; + this._password = config.password; + this._phone = config.phone; + this._pwdReset = config.pwdReset; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_type - computed: true, optional: true, required: false + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + public resetAccessType() { + this._accessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // country_code - computed: false, optional: true, required: false + private _countryCode?: string; + public get countryCode() { + return this.getStringAttribute('country_code'); + } + public set countryCode(value: string) { + this._countryCode = value; + } + public resetCountryCode() { + this._countryCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryCodeInput() { + return this._countryCode; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // email - computed: false, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // external_identity_id - computed: false, optional: true, required: false + private _externalIdentityId?: string; + public get externalIdentityId() { + return this.getStringAttribute('external_identity_id'); + } + public set externalIdentityId(value: string) { + this._externalIdentityId = value; + } + public resetExternalIdentityId() { + this._externalIdentityId = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalIdentityIdInput() { + return this._externalIdentityId; + } + + // external_identity_type - computed: true, optional: true, required: false + private _externalIdentityType?: string; + public get externalIdentityType() { + return this.getStringAttribute('external_identity_type'); + } + public set externalIdentityType(value: string) { + this._externalIdentityType = value; + } + public resetExternalIdentityType() { + this._externalIdentityType = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalIdentityTypeInput() { + return this._externalIdentityType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // last_login - computed: true, optional: false, required: false + public get lastLogin() { + return this.getStringAttribute('last_login'); + } + + // login_protect_verification_method - computed: false, optional: true, required: false + private _loginProtectVerificationMethod?: string; + public get loginProtectVerificationMethod() { + return this.getStringAttribute('login_protect_verification_method'); + } + public set loginProtectVerificationMethod(value: string) { + this._loginProtectVerificationMethod = value; + } + public resetLoginProtectVerificationMethod() { + this._loginProtectVerificationMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get loginProtectVerificationMethodInput() { + return this._loginProtectVerificationMethod; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // password_strength - computed: true, optional: false, required: false + public get passwordStrength() { + return this.getStringAttribute('password_strength'); + } + + // phone - computed: false, optional: true, required: false + private _phone?: string; + public get phone() { + return this.getStringAttribute('phone'); + } + public set phone(value: string) { + this._phone = value; + } + public resetPhone() { + this._phone = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneInput() { + return this._phone; + } + + // pwd_reset - computed: false, optional: true, required: false + private _pwdReset?: boolean | cdktf.IResolvable; + public get pwdReset() { + return this.getBooleanAttribute('pwd_reset'); + } + public set pwdReset(value: boolean | cdktf.IResolvable) { + this._pwdReset = value; + } + public resetPwdReset() { + this._pwdReset = undefined; + } + // Temporarily expose input value. Use with caution. + public get pwdResetInput() { + return this._pwdReset; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_type: cdktf.stringToTerraform(this._accessType), + country_code: cdktf.stringToTerraform(this._countryCode), + description: cdktf.stringToTerraform(this._description), + email: cdktf.stringToTerraform(this._email), + enabled: cdktf.booleanToTerraform(this._enabled), + external_identity_id: cdktf.stringToTerraform(this._externalIdentityId), + external_identity_type: cdktf.stringToTerraform(this._externalIdentityType), + id: cdktf.stringToTerraform(this._id), + login_protect_verification_method: cdktf.stringToTerraform(this._loginProtectVerificationMethod), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + phone: cdktf.stringToTerraform(this._phone), + pwd_reset: cdktf.booleanToTerraform(this._pwdReset), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_type: { + value: cdktf.stringToHclTerraform(this._accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country_code: { + value: cdktf.stringToHclTerraform(this._countryCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + external_identity_id: { + value: cdktf.stringToHclTerraform(this._externalIdentityId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + external_identity_type: { + value: cdktf.stringToHclTerraform(this._externalIdentityType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + login_protect_verification_method: { + value: cdktf.stringToHclTerraform(this._loginProtectVerificationMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone: { + value: cdktf.stringToHclTerraform(this._phone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pwd_reset: { + value: cdktf.booleanToHclTerraform(this._pwdReset), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identity-virtual-mfa-device/README.md b/src/constructs/providers/huaweicloud/identity-virtual-mfa-device/README.md new file mode 100644 index 00000000..4d0b765a --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-virtual-mfa-device/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identity_virtual_mfa_device` + +Refer to the Terraform Registry for docs: [`huaweicloud_identity_virtual_mfa_device`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device). diff --git a/src/constructs/providers/huaweicloud/identity-virtual-mfa-device/index.ts b/src/constructs/providers/huaweicloud/identity-virtual-mfa-device/index.ts new file mode 100644 index 00000000..cc9692f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identity-virtual-mfa-device/index.ts @@ -0,0 +1,176 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentityVirtualMfaDeviceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device#id IdentityVirtualMfaDevice#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device#name IdentityVirtualMfaDevice#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device#user_id IdentityVirtualMfaDevice#user_id} + */ + readonly userId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device huaweicloud_identity_virtual_mfa_device} +*/ +export class IdentityVirtualMfaDevice extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identity_virtual_mfa_device"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentityVirtualMfaDevice resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentityVirtualMfaDevice to import + * @param importFromId The id of the existing IdentityVirtualMfaDevice that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentityVirtualMfaDevice to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identity_virtual_mfa_device", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identity_virtual_mfa_device huaweicloud_identity_virtual_mfa_device} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentityVirtualMfaDeviceConfig + */ + public constructor(scope: Construct, id: string, config: IdentityVirtualMfaDeviceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identity_virtual_mfa_device', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._userId = config.userId; + } + + // ========== + // ATTRIBUTES + // ========== + + // base32_string_seed - computed: true, optional: false, required: false + public get base32StringSeed() { + return this.getStringAttribute('base32_string_seed'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // qr_code_png - computed: true, optional: false, required: false + public get qrCodePng() { + return this.getStringAttribute('qr_code_png'); + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + user_id: cdktf.stringToTerraform(this._userId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-account-assignment/README.md b/src/constructs/providers/huaweicloud/identitycenter-account-assignment/README.md new file mode 100644 index 00000000..3bcd6539 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-account-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_account_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_account_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment). diff --git a/src/constructs/providers/huaweicloud/identitycenter-account-assignment/index.ts b/src/constructs/providers/huaweicloud/identitycenter-account-assignment/index.ts new file mode 100644 index 00000000..154fbf9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-account-assignment/index.ts @@ -0,0 +1,435 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterAccountAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#id IdentitycenterAccountAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the Identity Center instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#instance_id IdentitycenterAccountAssignment#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the permission set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#permission_set_id IdentitycenterAccountAssignment#permission_set_id} + */ + readonly permissionSetId: string; + /** + * Specifies the ID of the user or user group that belongs to IAM Identity Center. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#principal_id IdentitycenterAccountAssignment#principal_id} + */ + readonly principalId: string; + /** + * Specifies the type of the user or user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#principal_type IdentitycenterAccountAssignment#principal_type} + */ + readonly principalType: string; + /** + * Specifies the ID of the target to be bound. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#target_id IdentitycenterAccountAssignment#target_id} + */ + readonly targetId: string; + /** + * Specifies the type of the target to be bound. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#target_type IdentitycenterAccountAssignment#target_type} + */ + readonly targetType: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#timeouts IdentitycenterAccountAssignment#timeouts} + */ + readonly timeouts?: IdentitycenterAccountAssignmentTimeouts; +} +export interface IdentitycenterAccountAssignmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#create IdentitycenterAccountAssignment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#delete IdentitycenterAccountAssignment#delete} + */ + readonly delete?: string; +} + +export function identitycenterAccountAssignmentTimeoutsToTerraform(struct?: IdentitycenterAccountAssignmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function identitycenterAccountAssignmentTimeoutsToHclTerraform(struct?: IdentitycenterAccountAssignmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IdentitycenterAccountAssignmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IdentitycenterAccountAssignmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentitycenterAccountAssignmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment huaweicloud_identitycenter_account_assignment} +*/ +export class IdentitycenterAccountAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_account_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterAccountAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterAccountAssignment to import + * @param importFromId The id of the existing IdentitycenterAccountAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterAccountAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_account_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_account_assignment huaweicloud_identitycenter_account_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterAccountAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterAccountAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_account_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._permissionSetId = config.permissionSetId; + this._principalId = config.principalId; + this._principalType = config.principalType; + this._targetId = config.targetId; + this._targetType = config.targetType; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // permission_set_id - computed: false, optional: false, required: true + private _permissionSetId?: string; + public get permissionSetId() { + return this.getStringAttribute('permission_set_id'); + } + public set permissionSetId(value: string) { + this._permissionSetId = value; + } + // Temporarily expose input value. Use with caution. + public get permissionSetIdInput() { + return this._permissionSetId; + } + + // principal_id - computed: false, optional: false, required: true + private _principalId?: string; + public get principalId() { + return this.getStringAttribute('principal_id'); + } + public set principalId(value: string) { + this._principalId = value; + } + // Temporarily expose input value. Use with caution. + public get principalIdInput() { + return this._principalId; + } + + // principal_type - computed: false, optional: false, required: true + private _principalType?: string; + public get principalType() { + return this.getStringAttribute('principal_type'); + } + public set principalType(value: string) { + this._principalType = value; + } + // Temporarily expose input value. Use with caution. + public get principalTypeInput() { + return this._principalType; + } + + // target_id - computed: false, optional: false, required: true + private _targetId?: string; + public get targetId() { + return this.getStringAttribute('target_id'); + } + public set targetId(value: string) { + this._targetId = value; + } + // Temporarily expose input value. Use with caution. + public get targetIdInput() { + return this._targetId; + } + + // target_type - computed: false, optional: false, required: true + private _targetType?: string; + public get targetType() { + return this.getStringAttribute('target_type'); + } + public set targetType(value: string) { + this._targetType = value; + } + // Temporarily expose input value. Use with caution. + public get targetTypeInput() { + return this._targetType; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IdentitycenterAccountAssignmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IdentitycenterAccountAssignmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + permission_set_id: cdktf.stringToTerraform(this._permissionSetId), + principal_id: cdktf.stringToTerraform(this._principalId), + principal_type: cdktf.stringToTerraform(this._principalType), + target_id: cdktf.stringToTerraform(this._targetId), + target_type: cdktf.stringToTerraform(this._targetType), + timeouts: identitycenterAccountAssignmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_set_id: { + value: cdktf.stringToHclTerraform(this._permissionSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + principal_id: { + value: cdktf.stringToHclTerraform(this._principalId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + principal_type: { + value: cdktf.stringToHclTerraform(this._principalType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_id: { + value: cdktf.stringToHclTerraform(this._targetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_type: { + value: cdktf.stringToHclTerraform(this._targetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: identitycenterAccountAssignmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IdentitycenterAccountAssignmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/README.md b/src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/README.md new file mode 100644 index 00000000..c40208d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_custom_policy_attachment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_custom_policy_attachment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment). diff --git a/src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/index.ts b/src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/index.ts new file mode 100644 index 00000000..b4a28314 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-custom-policy-attachment/index.ts @@ -0,0 +1,197 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterCustomPolicyAttachmentConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the custom policy to attach to a permission set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment#custom_policy IdentitycenterCustomPolicyAttachment#custom_policy} + */ + readonly customPolicy: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment#id IdentitycenterCustomPolicyAttachment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the IAM Identity Center instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment#instance_id IdentitycenterCustomPolicyAttachment#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the IAM Identity Center permission set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment#permission_set_id IdentitycenterCustomPolicyAttachment#permission_set_id} + */ + readonly permissionSetId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment huaweicloud_identitycenter_custom_policy_attachment} +*/ +export class IdentitycenterCustomPolicyAttachment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_custom_policy_attachment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterCustomPolicyAttachment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterCustomPolicyAttachment to import + * @param importFromId The id of the existing IdentitycenterCustomPolicyAttachment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterCustomPolicyAttachment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_custom_policy_attachment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_policy_attachment huaweicloud_identitycenter_custom_policy_attachment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterCustomPolicyAttachmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterCustomPolicyAttachmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_custom_policy_attachment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._customPolicy = config.customPolicy; + this._id = config.id; + this._instanceId = config.instanceId; + this._permissionSetId = config.permissionSetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // custom_policy - computed: false, optional: false, required: true + private _customPolicy?: string; + public get customPolicy() { + return this.getStringAttribute('custom_policy'); + } + public set customPolicy(value: string) { + this._customPolicy = value; + } + // Temporarily expose input value. Use with caution. + public get customPolicyInput() { + return this._customPolicy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // permission_set_id - computed: false, optional: false, required: true + private _permissionSetId?: string; + public get permissionSetId() { + return this.getStringAttribute('permission_set_id'); + } + public set permissionSetId(value: string) { + this._permissionSetId = value; + } + // Temporarily expose input value. Use with caution. + public get permissionSetIdInput() { + return this._permissionSetId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + custom_policy: cdktf.stringToTerraform(this._customPolicy), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + permission_set_id: cdktf.stringToTerraform(this._permissionSetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + custom_policy: { + value: cdktf.stringToHclTerraform(this._customPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_set_id: { + value: cdktf.stringToHclTerraform(this._permissionSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/README.md b/src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/README.md new file mode 100644 index 00000000..b015bcae --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_custom_role_attachment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_custom_role_attachment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment). diff --git a/src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/index.ts b/src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/index.ts new file mode 100644 index 00000000..a760ba3d --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-custom-role-attachment/index.ts @@ -0,0 +1,197 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterCustomRoleAttachmentConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the custom role to attach to a permission set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment#custom_role IdentitycenterCustomRoleAttachment#custom_role} + */ + readonly customRole: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment#id IdentitycenterCustomRoleAttachment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the IAM Identity Center instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment#instance_id IdentitycenterCustomRoleAttachment#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the ID of the IAM Identity Center permission set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment#permission_set_id IdentitycenterCustomRoleAttachment#permission_set_id} + */ + readonly permissionSetId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment huaweicloud_identitycenter_custom_role_attachment} +*/ +export class IdentitycenterCustomRoleAttachment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_custom_role_attachment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterCustomRoleAttachment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterCustomRoleAttachment to import + * @param importFromId The id of the existing IdentitycenterCustomRoleAttachment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterCustomRoleAttachment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_custom_role_attachment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_custom_role_attachment huaweicloud_identitycenter_custom_role_attachment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterCustomRoleAttachmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterCustomRoleAttachmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_custom_role_attachment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._customRole = config.customRole; + this._id = config.id; + this._instanceId = config.instanceId; + this._permissionSetId = config.permissionSetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // custom_role - computed: false, optional: false, required: true + private _customRole?: string; + public get customRole() { + return this.getStringAttribute('custom_role'); + } + public set customRole(value: string) { + this._customRole = value; + } + // Temporarily expose input value. Use with caution. + public get customRoleInput() { + return this._customRole; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // permission_set_id - computed: false, optional: false, required: true + private _permissionSetId?: string; + public get permissionSetId() { + return this.getStringAttribute('permission_set_id'); + } + public set permissionSetId(value: string) { + this._permissionSetId = value; + } + // Temporarily expose input value. Use with caution. + public get permissionSetIdInput() { + return this._permissionSetId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + custom_role: cdktf.stringToTerraform(this._customRole), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + permission_set_id: cdktf.stringToTerraform(this._permissionSetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + custom_role: { + value: cdktf.stringToHclTerraform(this._customRole), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_set_id: { + value: cdktf.stringToHclTerraform(this._permissionSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-group-membership/README.md b/src/constructs/providers/huaweicloud/identitycenter-group-membership/README.md new file mode 100644 index 00000000..bcbe7021 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-group-membership/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_group_membership` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_group_membership`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership). diff --git a/src/constructs/providers/huaweicloud/identitycenter-group-membership/index.ts b/src/constructs/providers/huaweicloud/identitycenter-group-membership/index.ts new file mode 100644 index 00000000..009a3376 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-group-membership/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterGroupMembershipConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership#group_id IdentitycenterGroupMembership#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership#id IdentitycenterGroupMembership#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the identity store. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership#identity_store_id IdentitycenterGroupMembership#identity_store_id} + */ + readonly identityStoreId: string; + /** + * Specifies the ID of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership#member_id IdentitycenterGroupMembership#member_id} + */ + readonly memberId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership#region IdentitycenterGroupMembership#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership huaweicloud_identitycenter_group_membership} +*/ +export class IdentitycenterGroupMembership extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_group_membership"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterGroupMembership resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterGroupMembership to import + * @param importFromId The id of the existing IdentitycenterGroupMembership that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterGroupMembership to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_group_membership", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group_membership huaweicloud_identitycenter_group_membership} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterGroupMembershipConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterGroupMembershipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_group_membership', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupId = config.groupId; + this._id = config.id; + this._identityStoreId = config.identityStoreId; + this._memberId = config.memberId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_id - computed: false, optional: false, required: true + private _identityStoreId?: string; + public get identityStoreId() { + return this.getStringAttribute('identity_store_id'); + } + public set identityStoreId(value: string) { + this._identityStoreId = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreIdInput() { + return this._identityStoreId; + } + + // member_id - computed: false, optional: false, required: true + private _memberId?: string; + public get memberId() { + return this.getStringAttribute('member_id'); + } + public set memberId(value: string) { + this._memberId = value; + } + // Temporarily expose input value. Use with caution. + public get memberIdInput() { + return this._memberId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + identity_store_id: cdktf.stringToTerraform(this._identityStoreId), + member_id: cdktf.stringToTerraform(this._memberId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_id: { + value: cdktf.stringToHclTerraform(this._identityStoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_id: { + value: cdktf.stringToHclTerraform(this._memberId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-group/README.md b/src/constructs/providers/huaweicloud/identitycenter-group/README.md new file mode 100644 index 00000000..b56d0b58 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group). diff --git a/src/constructs/providers/huaweicloud/identitycenter-group/index.ts b/src/constructs/providers/huaweicloud/identitycenter-group/index.ts new file mode 100644 index 00000000..1326fb8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-group/index.ts @@ -0,0 +1,238 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group#description IdentitycenterGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group#id IdentitycenterGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the identity store. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group#identity_store_id IdentitycenterGroup#identity_store_id} + */ + readonly identityStoreId: string; + /** + * Specifies the name of the group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group#name IdentitycenterGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group#region IdentitycenterGroup#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group huaweicloud_identitycenter_group} +*/ +export class IdentitycenterGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterGroup to import + * @param importFromId The id of the existing IdentitycenterGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_group huaweicloud_identitycenter_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterGroupConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._identityStoreId = config.identityStoreId; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_id - computed: false, optional: false, required: true + private _identityStoreId?: string; + public get identityStoreId() { + return this.getStringAttribute('identity_store_id'); + } + public set identityStoreId(value: string) { + this._identityStoreId = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreIdInput() { + return this._identityStoreId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + identity_store_id: cdktf.stringToTerraform(this._identityStoreId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_id: { + value: cdktf.stringToHclTerraform(this._identityStoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-permission-set/README.md b/src/constructs/providers/huaweicloud/identitycenter-permission-set/README.md new file mode 100644 index 00000000..4ae8ec2e --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-permission-set/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_permission_set` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_permission_set`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set). diff --git a/src/constructs/providers/huaweicloud/identitycenter-permission-set/index.ts b/src/constructs/providers/huaweicloud/identitycenter-permission-set/index.ts new file mode 100644 index 00000000..76350c71 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-permission-set/index.ts @@ -0,0 +1,262 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterPermissionSetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#description IdentitycenterPermissionSet#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#id IdentitycenterPermissionSet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#instance_id IdentitycenterPermissionSet#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#name IdentitycenterPermissionSet#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#relay_state IdentitycenterPermissionSet#relay_state} + */ + readonly relayState?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#session_duration IdentitycenterPermissionSet#session_duration} + */ + readonly sessionDuration: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set huaweicloud_identitycenter_permission_set} +*/ +export class IdentitycenterPermissionSet extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_permission_set"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterPermissionSet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterPermissionSet to import + * @param importFromId The id of the existing IdentitycenterPermissionSet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterPermissionSet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_permission_set", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_permission_set huaweicloud_identitycenter_permission_set} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterPermissionSetConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterPermissionSetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_permission_set', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._relayState = config.relayState; + this._sessionDuration = config.sessionDuration; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_ids - computed: true, optional: false, required: false + public get accountIds() { + return this.getListAttribute('account_ids'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // relay_state - computed: true, optional: true, required: false + private _relayState?: string; + public get relayState() { + return this.getStringAttribute('relay_state'); + } + public set relayState(value: string) { + this._relayState = value; + } + public resetRelayState() { + this._relayState = undefined; + } + // Temporarily expose input value. Use with caution. + public get relayStateInput() { + return this._relayState; + } + + // session_duration - computed: false, optional: false, required: true + private _sessionDuration?: string; + public get sessionDuration() { + return this.getStringAttribute('session_duration'); + } + public set sessionDuration(value: string) { + this._sessionDuration = value; + } + // Temporarily expose input value. Use with caution. + public get sessionDurationInput() { + return this._sessionDuration; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + relay_state: cdktf.stringToTerraform(this._relayState), + session_duration: cdktf.stringToTerraform(this._sessionDuration), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + relay_state: { + value: cdktf.stringToHclTerraform(this._relayState), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + session_duration: { + value: cdktf.stringToHclTerraform(this._sessionDuration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/README.md b/src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/README.md new file mode 100644 index 00000000..70a71215 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_system_policy_attachment` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_system_policy_attachment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment). diff --git a/src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/index.ts b/src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/index.ts new file mode 100644 index 00000000..2a086c6c --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-system-policy-attachment/index.ts @@ -0,0 +1,277 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterSystemPolicyAttachmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment#id IdentitycenterSystemPolicyAttachment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment#instance_id IdentitycenterSystemPolicyAttachment#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment#permission_set_id IdentitycenterSystemPolicyAttachment#permission_set_id} + */ + readonly permissionSetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment#policy_ids IdentitycenterSystemPolicyAttachment#policy_ids} + */ + readonly policyIds: string[]; +} +export interface IdentitycenterSystemPolicyAttachmentAttachedPolicies { +} + +export function identitycenterSystemPolicyAttachmentAttachedPoliciesToTerraform(struct?: IdentitycenterSystemPolicyAttachmentAttachedPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function identitycenterSystemPolicyAttachmentAttachedPoliciesToHclTerraform(struct?: IdentitycenterSystemPolicyAttachmentAttachedPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IdentitycenterSystemPolicyAttachmentAttachedPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IdentitycenterSystemPolicyAttachmentAttachedPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IdentitycenterSystemPolicyAttachmentAttachedPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class IdentitycenterSystemPolicyAttachmentAttachedPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IdentitycenterSystemPolicyAttachmentAttachedPoliciesOutputReference { + return new IdentitycenterSystemPolicyAttachmentAttachedPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment huaweicloud_identitycenter_system_policy_attachment} +*/ +export class IdentitycenterSystemPolicyAttachment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_system_policy_attachment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterSystemPolicyAttachment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterSystemPolicyAttachment to import + * @param importFromId The id of the existing IdentitycenterSystemPolicyAttachment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterSystemPolicyAttachment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_system_policy_attachment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_system_policy_attachment huaweicloud_identitycenter_system_policy_attachment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterSystemPolicyAttachmentConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterSystemPolicyAttachmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_system_policy_attachment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._permissionSetId = config.permissionSetId; + this._policyIds = config.policyIds; + } + + // ========== + // ATTRIBUTES + // ========== + + // attached_policies - computed: true, optional: false, required: false + private _attachedPolicies = new IdentitycenterSystemPolicyAttachmentAttachedPoliciesList(this, "attached_policies", false); + public get attachedPolicies() { + return this._attachedPolicies; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // permission_set_id - computed: false, optional: false, required: true + private _permissionSetId?: string; + public get permissionSetId() { + return this.getStringAttribute('permission_set_id'); + } + public set permissionSetId(value: string) { + this._permissionSetId = value; + } + // Temporarily expose input value. Use with caution. + public get permissionSetIdInput() { + return this._permissionSetId; + } + + // policy_ids - computed: false, optional: false, required: true + private _policyIds?: string[]; + public get policyIds() { + return cdktf.Fn.tolist(this.getListAttribute('policy_ids')); + } + public set policyIds(value: string[]) { + this._policyIds = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdsInput() { + return this._policyIds; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + permission_set_id: cdktf.stringToTerraform(this._permissionSetId), + policy_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._policyIds), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_set_id: { + value: cdktf.stringToHclTerraform(this._permissionSetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._policyIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/identitycenter-user/README.md b/src/constructs/providers/huaweicloud/identitycenter-user/README.md new file mode 100644 index 00000000..eba95a6e --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_identitycenter_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_identitycenter_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user). diff --git a/src/constructs/providers/huaweicloud/identitycenter-user/index.ts b/src/constructs/providers/huaweicloud/identitycenter-user/index.ts new file mode 100644 index 00000000..4411b528 --- /dev/null +++ b/src/constructs/providers/huaweicloud/identitycenter-user/index.ts @@ -0,0 +1,333 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IdentitycenterUserConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the display name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#display_name IdentitycenterUser#display_name} + */ + readonly displayName: string; + /** + * Specifies the email of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#email IdentitycenterUser#email} + */ + readonly email: string; + /** + * Specifies the family name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#family_name IdentitycenterUser#family_name} + */ + readonly familyName: string; + /** + * Specifies the given name of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#given_name IdentitycenterUser#given_name} + */ + readonly givenName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#id IdentitycenterUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the identity store + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#identity_store_id IdentitycenterUser#identity_store_id} + */ + readonly identityStoreId: string; + /** + * Specifies the initialize password mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#password_mode IdentitycenterUser#password_mode} + */ + readonly passwordMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#region IdentitycenterUser#region} + */ + readonly region?: string; + /** + * Specifies the username of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#user_name IdentitycenterUser#user_name} + */ + readonly userName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user huaweicloud_identitycenter_user} +*/ +export class IdentitycenterUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_identitycenter_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IdentitycenterUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IdentitycenterUser to import + * @param importFromId The id of the existing IdentitycenterUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IdentitycenterUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_identitycenter_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/identitycenter_user huaweicloud_identitycenter_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IdentitycenterUserConfig + */ + public constructor(scope: Construct, id: string, config: IdentitycenterUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_identitycenter_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._displayName = config.displayName; + this._email = config.email; + this._familyName = config.familyName; + this._givenName = config.givenName; + this._id = config.id; + this._identityStoreId = config.identityStoreId; + this._passwordMode = config.passwordMode; + this._region = config.region; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // display_name - computed: false, optional: false, required: true + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // email - computed: false, optional: false, required: true + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // family_name - computed: false, optional: false, required: true + private _familyName?: string; + public get familyName() { + return this.getStringAttribute('family_name'); + } + public set familyName(value: string) { + this._familyName = value; + } + // Temporarily expose input value. Use with caution. + public get familyNameInput() { + return this._familyName; + } + + // given_name - computed: false, optional: false, required: true + private _givenName?: string; + public get givenName() { + return this.getStringAttribute('given_name'); + } + public set givenName(value: string) { + this._givenName = value; + } + // Temporarily expose input value. Use with caution. + public get givenNameInput() { + return this._givenName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_id - computed: false, optional: false, required: true + private _identityStoreId?: string; + public get identityStoreId() { + return this.getStringAttribute('identity_store_id'); + } + public set identityStoreId(value: string) { + this._identityStoreId = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreIdInput() { + return this._identityStoreId; + } + + // password_mode - computed: false, optional: false, required: true + private _passwordMode?: string; + public get passwordMode() { + return this.getStringAttribute('password_mode'); + } + public set passwordMode(value: string) { + this._passwordMode = value; + } + // Temporarily expose input value. Use with caution. + public get passwordModeInput() { + return this._passwordMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + display_name: cdktf.stringToTerraform(this._displayName), + email: cdktf.stringToTerraform(this._email), + family_name: cdktf.stringToTerraform(this._familyName), + given_name: cdktf.stringToTerraform(this._givenName), + id: cdktf.stringToTerraform(this._id), + identity_store_id: cdktf.stringToTerraform(this._identityStoreId), + password_mode: cdktf.stringToTerraform(this._passwordMode), + region: cdktf.stringToTerraform(this._region), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + family_name: { + value: cdktf.stringToHclTerraform(this._familyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + given_name: { + value: cdktf.stringToHclTerraform(this._givenName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_id: { + value: cdktf.stringToHclTerraform(this._identityStoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password_mode: { + value: cdktf.stringToHclTerraform(this._passwordMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-eip/README.md b/src/constructs/providers/huaweicloud/iec-eip/README.md new file mode 100644 index 00000000..2a93859f --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-eip/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_eip` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_eip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip). diff --git a/src/constructs/providers/huaweicloud/iec-eip/index.ts b/src/constructs/providers/huaweicloud/iec-eip/index.ts new file mode 100644 index 00000000..a00e9f5c --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-eip/index.ts @@ -0,0 +1,452 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecEipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#id IecEip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#ip_version IecEip#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#line_id IecEip#line_id} + */ + readonly lineId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#port_id IecEip#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#region IecEip#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#site_id IecEip#site_id} + */ + readonly siteId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#timeouts IecEip#timeouts} + */ + readonly timeouts?: IecEipTimeouts; +} +export interface IecEipTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#create IecEip#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#delete IecEip#delete} + */ + readonly delete?: string; +} + +export function iecEipTimeoutsToTerraform(struct?: IecEipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function iecEipTimeoutsToHclTerraform(struct?: IecEipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecEipTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecEipTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecEipTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip huaweicloud_iec_eip} +*/ +export class IecEip extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_eip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecEip resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecEip to import + * @param importFromId The id of the existing IecEip that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecEip to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_eip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_eip huaweicloud_iec_eip} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecEipConfig + */ + public constructor(scope: Construct, id: string, config: IecEipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_eip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ipVersion = config.ipVersion; + this._lineId = config.lineId; + this._portId = config.portId; + this._region = config.region; + this._siteId = config.siteId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_share_type - computed: true, optional: false, required: false + public get bandwidthShareType() { + return this.getStringAttribute('bandwidth_share_type'); + } + + // bandwidth_size - computed: true, optional: false, required: false + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // line_id - computed: true, optional: true, required: false + private _lineId?: string; + public get lineId() { + return this.getStringAttribute('line_id'); + } + public set lineId(value: string) { + this._lineId = value; + } + public resetLineId() { + this._lineId = undefined; + } + // Temporarily expose input value. Use with caution. + public get lineIdInput() { + return this._lineId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // site_id - computed: false, optional: false, required: true + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } + + // site_info - computed: true, optional: false, required: false + public get siteInfo() { + return this.getStringAttribute('site_info'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecEipTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecEipTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + line_id: cdktf.stringToTerraform(this._lineId), + port_id: cdktf.stringToTerraform(this._portId), + region: cdktf.stringToTerraform(this._region), + site_id: cdktf.stringToTerraform(this._siteId), + timeouts: iecEipTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + line_id: { + value: cdktf.stringToHclTerraform(this._lineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(this._siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: iecEipTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecEipTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-keypair/README.md b/src/constructs/providers/huaweicloud/iec-keypair/README.md new file mode 100644 index 00000000..10ee395a --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-keypair/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_keypair` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_keypair`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair). diff --git a/src/constructs/providers/huaweicloud/iec-keypair/index.ts b/src/constructs/providers/huaweicloud/iec-keypair/index.ts new file mode 100644 index 00000000..1ffd3e72 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-keypair/index.ts @@ -0,0 +1,202 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecKeypairConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair#id IecKeypair#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair#name IecKeypair#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair#public_key IecKeypair#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair#region IecKeypair#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair huaweicloud_iec_keypair} +*/ +export class IecKeypair extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_keypair"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecKeypair resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecKeypair to import + * @param importFromId The id of the existing IecKeypair that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecKeypair to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_keypair", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_keypair huaweicloud_iec_keypair} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecKeypairConfig + */ + public constructor(scope: Construct, id: string, config: IecKeypairConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_keypair', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._publicKey = config.publicKey; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // fingerprint - computed: true, optional: false, required: false + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // public_key - computed: true, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-network-acl-rule/README.md b/src/constructs/providers/huaweicloud/iec-network-acl-rule/README.md new file mode 100644 index 00000000..607b68c4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-network-acl-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_network_acl_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_network_acl_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule). diff --git a/src/constructs/providers/huaweicloud/iec-network-acl-rule/index.ts b/src/constructs/providers/huaweicloud/iec-network-acl-rule/index.ts new file mode 100644 index 00000000..32e4c782 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-network-acl-rule/index.ts @@ -0,0 +1,425 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecNetworkAclRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#action IecNetworkAclRule#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#description IecNetworkAclRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#destination_ip_address IecNetworkAclRule#destination_ip_address} + */ + readonly destinationIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#destination_port IecNetworkAclRule#destination_port} + */ + readonly destinationPort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#direction IecNetworkAclRule#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#enabled IecNetworkAclRule#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#id IecNetworkAclRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#ip_version IecNetworkAclRule#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#network_acl_id IecNetworkAclRule#network_acl_id} + */ + readonly networkAclId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#protocol IecNetworkAclRule#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#source_ip_address IecNetworkAclRule#source_ip_address} + */ + readonly sourceIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#source_port IecNetworkAclRule#source_port} + */ + readonly sourcePort?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule huaweicloud_iec_network_acl_rule} +*/ +export class IecNetworkAclRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_network_acl_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecNetworkAclRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecNetworkAclRule to import + * @param importFromId The id of the existing IecNetworkAclRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecNetworkAclRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_network_acl_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl_rule huaweicloud_iec_network_acl_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecNetworkAclRuleConfig + */ + public constructor(scope: Construct, id: string, config: IecNetworkAclRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_network_acl_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._destinationIpAddress = config.destinationIpAddress; + this._destinationPort = config.destinationPort; + this._direction = config.direction; + this._enabled = config.enabled; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._networkAclId = config.networkAclId; + this._protocol = config.protocol; + this._sourceIpAddress = config.sourceIpAddress; + this._sourcePort = config.sourcePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_ip_address - computed: false, optional: true, required: false + private _destinationIpAddress?: string; + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + public set destinationIpAddress(value: string) { + this._destinationIpAddress = value; + } + public resetDestinationIpAddress() { + this._destinationIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressInput() { + return this._destinationIpAddress; + } + + // destination_port - computed: false, optional: true, required: false + private _destinationPort?: string; + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + public set destinationPort(value: string) { + this._destinationPort = value; + } + public resetDestinationPort() { + this._destinationPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortInput() { + return this._destinationPort; + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // network_acl_id - computed: false, optional: false, required: true + private _networkAclId?: string; + public get networkAclId() { + return this.getStringAttribute('network_acl_id'); + } + public set networkAclId(value: string) { + this._networkAclId = value; + } + // Temporarily expose input value. Use with caution. + public get networkAclIdInput() { + return this._networkAclId; + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // source_ip_address - computed: false, optional: true, required: false + private _sourceIpAddress?: string; + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + public set sourceIpAddress(value: string) { + this._sourceIpAddress = value; + } + public resetSourceIpAddress() { + this._sourceIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressInput() { + return this._sourceIpAddress; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + destination_ip_address: cdktf.stringToTerraform(this._destinationIpAddress), + destination_port: cdktf.stringToTerraform(this._destinationPort), + direction: cdktf.stringToTerraform(this._direction), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + network_acl_id: cdktf.stringToTerraform(this._networkAclId), + protocol: cdktf.stringToTerraform(this._protocol), + source_ip_address: cdktf.stringToTerraform(this._sourceIpAddress), + source_port: cdktf.stringToTerraform(this._sourcePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address: { + value: cdktf.stringToHclTerraform(this._destinationIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port: { + value: cdktf.stringToHclTerraform(this._destinationPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + network_acl_id: { + value: cdktf.stringToHclTerraform(this._networkAclId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address: { + value: cdktf.stringToHclTerraform(this._sourceIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(this._sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-network-acl/README.md b/src/constructs/providers/huaweicloud/iec-network-acl/README.md new file mode 100644 index 00000000..d81f6a42 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-network-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_network_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_network_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl). diff --git a/src/constructs/providers/huaweicloud/iec-network-acl/index.ts b/src/constructs/providers/huaweicloud/iec-network-acl/index.ts new file mode 100644 index 00000000..091c48b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-network-acl/index.ts @@ -0,0 +1,547 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecNetworkAclConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#description IecNetworkAcl#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#id IecNetworkAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#name IecNetworkAcl#name} + */ + readonly name: string; + /** + * networks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#networks IecNetworkAcl#networks} + */ + readonly networks?: IecNetworkAclNetworks[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#timeouts IecNetworkAcl#timeouts} + */ + readonly timeouts?: IecNetworkAclTimeouts; +} +export interface IecNetworkAclNetworks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#subnet_id IecNetworkAcl#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#vpc_id IecNetworkAcl#vpc_id} + */ + readonly vpcId: string; +} + +export function iecNetworkAclNetworksToTerraform(struct?: IecNetworkAclNetworks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function iecNetworkAclNetworksToHclTerraform(struct?: IecNetworkAclNetworks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecNetworkAclNetworksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IecNetworkAclNetworks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecNetworkAclNetworks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._subnetId = undefined; + this._vpcId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._subnetId = value.subnetId; + this._vpcId = value.vpcId; + } + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} + +export class IecNetworkAclNetworksList extends cdktf.ComplexList { + public internalValue? : IecNetworkAclNetworks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IecNetworkAclNetworksOutputReference { + return new IecNetworkAclNetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IecNetworkAclTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#create IecNetworkAcl#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#delete IecNetworkAcl#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#update IecNetworkAcl#update} + */ + readonly update?: string; +} + +export function iecNetworkAclTimeoutsToTerraform(struct?: IecNetworkAclTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function iecNetworkAclTimeoutsToHclTerraform(struct?: IecNetworkAclTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecNetworkAclTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecNetworkAclTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecNetworkAclTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl huaweicloud_iec_network_acl} +*/ +export class IecNetworkAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_network_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecNetworkAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecNetworkAcl to import + * @param importFromId The id of the existing IecNetworkAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecNetworkAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_network_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_network_acl huaweicloud_iec_network_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecNetworkAclConfig + */ + public constructor(scope: Construct, id: string, config: IecNetworkAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_network_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._networks.internalValue = config.networks; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inbound_rules - computed: true, optional: false, required: false + public get inboundRules() { + return this.getListAttribute('inbound_rules'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // outbound_rules - computed: true, optional: false, required: false + public get outboundRules() { + return this.getListAttribute('outbound_rules'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // networks - computed: false, optional: true, required: false + private _networks = new IecNetworkAclNetworksList(this, "networks", true); + public get networks() { + return this._networks; + } + public putNetworks(value: IecNetworkAclNetworks[] | cdktf.IResolvable) { + this._networks.internalValue = value; + } + public resetNetworks() { + this._networks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get networksInput() { + return this._networks.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecNetworkAclTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecNetworkAclTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + networks: cdktf.listMapper(iecNetworkAclNetworksToTerraform, true)(this._networks.internalValue), + timeouts: iecNetworkAclTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + networks: { + value: cdktf.listMapperHcl(iecNetworkAclNetworksToHclTerraform, true)(this._networks.internalValue), + isBlock: true, + type: "set", + storageClassType: "IecNetworkAclNetworksList", + }, + timeouts: { + value: iecNetworkAclTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecNetworkAclTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-security-group-rule/README.md b/src/constructs/providers/huaweicloud/iec-security-group-rule/README.md new file mode 100644 index 00000000..b572db05 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-security-group-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_security_group_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_security_group_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule). diff --git a/src/constructs/providers/huaweicloud/iec-security-group-rule/index.ts b/src/constructs/providers/huaweicloud/iec-security-group-rule/index.ts new file mode 100644 index 00000000..1441db4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-security-group-rule/index.ts @@ -0,0 +1,516 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecSecurityGroupRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#description IecSecurityGroupRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#direction IecSecurityGroupRule#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#ethertype IecSecurityGroupRule#ethertype} + */ + readonly ethertype?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#id IecSecurityGroupRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#port_range_max IecSecurityGroupRule#port_range_max} + */ + readonly portRangeMax?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#port_range_min IecSecurityGroupRule#port_range_min} + */ + readonly portRangeMin?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#protocol IecSecurityGroupRule#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#remote_group_id IecSecurityGroupRule#remote_group_id} + */ + readonly remoteGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#remote_ip_prefix IecSecurityGroupRule#remote_ip_prefix} + */ + readonly remoteIpPrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#security_group_id IecSecurityGroupRule#security_group_id} + */ + readonly securityGroupId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#timeouts IecSecurityGroupRule#timeouts} + */ + readonly timeouts?: IecSecurityGroupRuleTimeouts; +} +export interface IecSecurityGroupRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#create IecSecurityGroupRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#delete IecSecurityGroupRule#delete} + */ + readonly delete?: string; +} + +export function iecSecurityGroupRuleTimeoutsToTerraform(struct?: IecSecurityGroupRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function iecSecurityGroupRuleTimeoutsToHclTerraform(struct?: IecSecurityGroupRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecSecurityGroupRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecSecurityGroupRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecSecurityGroupRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule huaweicloud_iec_security_group_rule} +*/ +export class IecSecurityGroupRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_security_group_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecSecurityGroupRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecSecurityGroupRule to import + * @param importFromId The id of the existing IecSecurityGroupRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecSecurityGroupRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_security_group_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group_rule huaweicloud_iec_security_group_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecSecurityGroupRuleConfig + */ + public constructor(scope: Construct, id: string, config: IecSecurityGroupRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_security_group_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._direction = config.direction; + this._ethertype = config.ethertype; + this._id = config.id; + this._portRangeMax = config.portRangeMax; + this._portRangeMin = config.portRangeMin; + this._protocol = config.protocol; + this._remoteGroupId = config.remoteGroupId; + this._remoteIpPrefix = config.remoteIpPrefix; + this._securityGroupId = config.securityGroupId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // ethertype - computed: false, optional: true, required: false + private _ethertype?: string; + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + public set ethertype(value: string) { + this._ethertype = value; + } + public resetEthertype() { + this._ethertype = undefined; + } + // Temporarily expose input value. Use with caution. + public get ethertypeInput() { + return this._ethertype; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // port_range_max - computed: false, optional: true, required: false + private _portRangeMax?: number; + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + public set portRangeMax(value: number) { + this._portRangeMax = value; + } + public resetPortRangeMax() { + this._portRangeMax = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangeMaxInput() { + return this._portRangeMax; + } + + // port_range_min - computed: false, optional: true, required: false + private _portRangeMin?: number; + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + public set portRangeMin(value: number) { + this._portRangeMin = value; + } + public resetPortRangeMin() { + this._portRangeMin = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangeMinInput() { + return this._portRangeMin; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // remote_group_id - computed: false, optional: true, required: false + private _remoteGroupId?: string; + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + public set remoteGroupId(value: string) { + this._remoteGroupId = value; + } + public resetRemoteGroupId() { + this._remoteGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteGroupIdInput() { + return this._remoteGroupId; + } + + // remote_ip_prefix - computed: false, optional: true, required: false + private _remoteIpPrefix?: string; + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } + public set remoteIpPrefix(value: string) { + this._remoteIpPrefix = value; + } + public resetRemoteIpPrefix() { + this._remoteIpPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteIpPrefixInput() { + return this._remoteIpPrefix; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecSecurityGroupRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecSecurityGroupRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + direction: cdktf.stringToTerraform(this._direction), + ethertype: cdktf.stringToTerraform(this._ethertype), + id: cdktf.stringToTerraform(this._id), + port_range_max: cdktf.numberToTerraform(this._portRangeMax), + port_range_min: cdktf.numberToTerraform(this._portRangeMin), + protocol: cdktf.stringToTerraform(this._protocol), + remote_group_id: cdktf.stringToTerraform(this._remoteGroupId), + remote_ip_prefix: cdktf.stringToTerraform(this._remoteIpPrefix), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + timeouts: iecSecurityGroupRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ethertype: { + value: cdktf.stringToHclTerraform(this._ethertype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_range_max: { + value: cdktf.numberToHclTerraform(this._portRangeMax), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port_range_min: { + value: cdktf.numberToHclTerraform(this._portRangeMin), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_group_id: { + value: cdktf.stringToHclTerraform(this._remoteGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_ip_prefix: { + value: cdktf.stringToHclTerraform(this._remoteIpPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: iecSecurityGroupRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecSecurityGroupRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-security-group/README.md b/src/constructs/providers/huaweicloud/iec-security-group/README.md new file mode 100644 index 00000000..fdd2fd5c --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-security-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_security_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_security_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group). diff --git a/src/constructs/providers/huaweicloud/iec-security-group/index.ts b/src/constructs/providers/huaweicloud/iec-security-group/index.ts new file mode 100644 index 00000000..7e6fd408 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-security-group/index.ts @@ -0,0 +1,452 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecSecurityGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#description IecSecurityGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#id IecSecurityGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#name IecSecurityGroup#name} + */ + readonly name: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#timeouts IecSecurityGroup#timeouts} + */ + readonly timeouts?: IecSecurityGroupTimeouts; +} +export interface IecSecurityGroupSecurityGroupRules { +} + +export function iecSecurityGroupSecurityGroupRulesToTerraform(struct?: IecSecurityGroupSecurityGroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iecSecurityGroupSecurityGroupRulesToHclTerraform(struct?: IecSecurityGroupSecurityGroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IecSecurityGroupSecurityGroupRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IecSecurityGroupSecurityGroupRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecSecurityGroupSecurityGroupRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port_range_max - computed: true, optional: false, required: false + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + + // port_range_min - computed: true, optional: false, required: false + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } + + // security_group_id - computed: true, optional: false, required: false + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } +} + +export class IecSecurityGroupSecurityGroupRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IecSecurityGroupSecurityGroupRulesOutputReference { + return new IecSecurityGroupSecurityGroupRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IecSecurityGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#create IecSecurityGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#delete IecSecurityGroup#delete} + */ + readonly delete?: string; +} + +export function iecSecurityGroupTimeoutsToTerraform(struct?: IecSecurityGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function iecSecurityGroupTimeoutsToHclTerraform(struct?: IecSecurityGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecSecurityGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecSecurityGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecSecurityGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group huaweicloud_iec_security_group} +*/ +export class IecSecurityGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_security_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecSecurityGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecSecurityGroup to import + * @param importFromId The id of the existing IecSecurityGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecSecurityGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_security_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_security_group huaweicloud_iec_security_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecSecurityGroupConfig + */ + public constructor(scope: Construct, id: string, config: IecSecurityGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_security_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // security_group_rules - computed: true, optional: false, required: false + private _securityGroupRules = new IecSecurityGroupSecurityGroupRulesList(this, "security_group_rules", false); + public get securityGroupRules() { + return this._securityGroupRules; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecSecurityGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecSecurityGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + timeouts: iecSecurityGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: iecSecurityGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecSecurityGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-server/README.md b/src/constructs/providers/huaweicloud/iec-server/README.md new file mode 100644 index 00000000..0d31fec2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-server/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_server` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_server`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server). diff --git a/src/constructs/providers/huaweicloud/iec-server/index.ts b/src/constructs/providers/huaweicloud/iec-server/index.ts new file mode 100644 index 00000000..eba39ccc --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-server/index.ts @@ -0,0 +1,1249 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecServerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#admin_pass IecServer#admin_pass} + */ + readonly adminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#bind_eip IecServer#bind_eip} + */ + readonly bindEip?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#coverage_level IecServer#coverage_level} + */ + readonly coverageLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#coverage_policy IecServer#coverage_policy} + */ + readonly coveragePolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#flavor_id IecServer#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#id IecServer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#image_id IecServer#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#key_pair IecServer#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#name IecServer#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#security_groups IecServer#security_groups} + */ + readonly securityGroups: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#subnet_ids IecServer#subnet_ids} + */ + readonly subnetIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#system_disk_size IecServer#system_disk_size} + */ + readonly systemDiskSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#system_disk_type IecServer#system_disk_type} + */ + readonly systemDiskType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#user_data IecServer#user_data} + */ + readonly userData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#vpc_id IecServer#vpc_id} + */ + readonly vpcId: string; + /** + * coverage_sites block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#coverage_sites IecServer#coverage_sites} + */ + readonly coverageSites: IecServerCoverageSites[] | cdktf.IResolvable; + /** + * data_disks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#data_disks IecServer#data_disks} + */ + readonly dataDisks?: IecServerDataDisks[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#timeouts IecServer#timeouts} + */ + readonly timeouts?: IecServerTimeouts; +} +export interface IecServerNics { +} + +export function iecServerNicsToTerraform(struct?: IecServerNics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iecServerNicsToHclTerraform(struct?: IecServerNics): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IecServerNicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IecServerNics | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecServerNics | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // mac - computed: true, optional: false, required: false + public get mac() { + return this.getStringAttribute('mac'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getStringAttribute('port'); + } +} + +export class IecServerNicsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IecServerNicsOutputReference { + return new IecServerNicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IecServerVolumeAttached { +} + +export function iecServerVolumeAttachedToTerraform(struct?: IecServerVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iecServerVolumeAttachedToHclTerraform(struct?: IecServerVolumeAttached): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IecServerVolumeAttachedOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IecServerVolumeAttached | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecServerVolumeAttached | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // boot_index - computed: true, optional: false, required: false + public get bootIndex() { + return this.getStringAttribute('boot_index'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // volume_id - computed: true, optional: false, required: false + public get volumeId() { + return this.getStringAttribute('volume_id'); + } +} + +export class IecServerVolumeAttachedList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IecServerVolumeAttachedOutputReference { + return new IecServerVolumeAttachedOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IecServerCoverageSites { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#operator IecServer#operator} + */ + readonly operator: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#site_id IecServer#site_id} + */ + readonly siteId: string; +} + +export function iecServerCoverageSitesToTerraform(struct?: IecServerCoverageSites | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + operator: cdktf.stringToTerraform(struct!.operator), + site_id: cdktf.stringToTerraform(struct!.siteId), + } +} + + +export function iecServerCoverageSitesToHclTerraform(struct?: IecServerCoverageSites | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(struct!.siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecServerCoverageSitesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IecServerCoverageSites | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._siteId !== undefined) { + hasAnyValues = true; + internalValueResult.siteId = this._siteId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecServerCoverageSites | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._operator = undefined; + this._siteId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._operator = value.operator; + this._siteId = value.siteId; + } + } + + // operator - computed: false, optional: false, required: true + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // site_id - computed: false, optional: false, required: true + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } +} + +export class IecServerCoverageSitesList extends cdktf.ComplexList { + public internalValue? : IecServerCoverageSites[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IecServerCoverageSitesOutputReference { + return new IecServerCoverageSitesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IecServerDataDisks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#size IecServer#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#type IecServer#type} + */ + readonly type: string; +} + +export function iecServerDataDisksToTerraform(struct?: IecServerDataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function iecServerDataDisksToHclTerraform(struct?: IecServerDataDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecServerDataDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IecServerDataDisks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecServerDataDisks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._size = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._size = value.size; + this._type = value.type; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class IecServerDataDisksList extends cdktf.ComplexList { + public internalValue? : IecServerDataDisks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IecServerDataDisksOutputReference { + return new IecServerDataDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IecServerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#create IecServer#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#delete IecServer#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#update IecServer#update} + */ + readonly update?: string; +} + +export function iecServerTimeoutsToTerraform(struct?: IecServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function iecServerTimeoutsToHclTerraform(struct?: IecServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecServerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecServerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecServerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server huaweicloud_iec_server} +*/ +export class IecServer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_server"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecServer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecServer to import + * @param importFromId The id of the existing IecServer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecServer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_server", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_server huaweicloud_iec_server} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecServerConfig + */ + public constructor(scope: Construct, id: string, config: IecServerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_server', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminPass = config.adminPass; + this._bindEip = config.bindEip; + this._coverageLevel = config.coverageLevel; + this._coveragePolicy = config.coveragePolicy; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._keyPair = config.keyPair; + this._name = config.name; + this._securityGroups = config.securityGroups; + this._subnetIds = config.subnetIds; + this._systemDiskSize = config.systemDiskSize; + this._systemDiskType = config.systemDiskType; + this._userData = config.userData; + this._vpcId = config.vpcId; + this._coverageSites.internalValue = config.coverageSites; + this._dataDisks.internalValue = config.dataDisks; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_pass - computed: false, optional: true, required: false + private _adminPass?: string; + public get adminPass() { + return this.getStringAttribute('admin_pass'); + } + public set adminPass(value: string) { + this._adminPass = value; + } + public resetAdminPass() { + this._adminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminPassInput() { + return this._adminPass; + } + + // bind_eip - computed: false, optional: true, required: false + private _bindEip?: boolean | cdktf.IResolvable; + public get bindEip() { + return this.getBooleanAttribute('bind_eip'); + } + public set bindEip(value: boolean | cdktf.IResolvable) { + this._bindEip = value; + } + public resetBindEip() { + this._bindEip = undefined; + } + // Temporarily expose input value. Use with caution. + public get bindEipInput() { + return this._bindEip; + } + + // coverage_level - computed: false, optional: true, required: false + private _coverageLevel?: string; + public get coverageLevel() { + return this.getStringAttribute('coverage_level'); + } + public set coverageLevel(value: string) { + this._coverageLevel = value; + } + public resetCoverageLevel() { + this._coverageLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get coverageLevelInput() { + return this._coverageLevel; + } + + // coverage_policy - computed: false, optional: true, required: false + private _coveragePolicy?: string; + public get coveragePolicy() { + return this.getStringAttribute('coverage_policy'); + } + public set coveragePolicy(value: string) { + this._coveragePolicy = value; + } + public resetCoveragePolicy() { + this._coveragePolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get coveragePolicyInput() { + return this._coveragePolicy; + } + + // edgecloud_id - computed: true, optional: false, required: false + public get edgecloudId() { + return this.getStringAttribute('edgecloud_id'); + } + + // edgecloud_name - computed: true, optional: false, required: false + public get edgecloudName() { + return this.getStringAttribute('edgecloud_name'); + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // flavor_name - computed: true, optional: false, required: false + public get flavorName() { + return this.getStringAttribute('flavor_name'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nics - computed: true, optional: false, required: false + private _nics = new IecServerNicsList(this, "nics", false); + public get nics() { + return this._nics; + } + + // origin_server_id - computed: true, optional: false, required: false + public get originServerId() { + return this.getStringAttribute('origin_server_id'); + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // security_groups - computed: false, optional: false, required: true + private _securityGroups?: string[]; + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_ids - computed: false, optional: false, required: true + private _subnetIds?: string[]; + public get subnetIds() { + return this.getListAttribute('subnet_ids'); + } + public set subnetIds(value: string[]) { + this._subnetIds = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdsInput() { + return this._subnetIds; + } + + // system_disk_id - computed: true, optional: false, required: false + public get systemDiskId() { + return this.getStringAttribute('system_disk_id'); + } + + // system_disk_size - computed: false, optional: false, required: true + private _systemDiskSize?: number; + public get systemDiskSize() { + return this.getNumberAttribute('system_disk_size'); + } + public set systemDiskSize(value: number) { + this._systemDiskSize = value; + } + // Temporarily expose input value. Use with caution. + public get systemDiskSizeInput() { + return this._systemDiskSize; + } + + // system_disk_type - computed: false, optional: false, required: true + private _systemDiskType?: string; + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + public set systemDiskType(value: string) { + this._systemDiskType = value; + } + // Temporarily expose input value. Use with caution. + public get systemDiskTypeInput() { + return this._systemDiskType; + } + + // user_data - computed: false, optional: true, required: false + private _userData?: string; + public get userData() { + return this.getStringAttribute('user_data'); + } + public set userData(value: string) { + this._userData = value; + } + public resetUserData() { + this._userData = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDataInput() { + return this._userData; + } + + // volume_attached - computed: true, optional: false, required: false + private _volumeAttached = new IecServerVolumeAttachedList(this, "volume_attached", false); + public get volumeAttached() { + return this._volumeAttached; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // coverage_sites - computed: false, optional: false, required: true + private _coverageSites = new IecServerCoverageSitesList(this, "coverage_sites", false); + public get coverageSites() { + return this._coverageSites; + } + public putCoverageSites(value: IecServerCoverageSites[] | cdktf.IResolvable) { + this._coverageSites.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get coverageSitesInput() { + return this._coverageSites.internalValue; + } + + // data_disks - computed: false, optional: true, required: false + private _dataDisks = new IecServerDataDisksList(this, "data_disks", false); + public get dataDisks() { + return this._dataDisks; + } + public putDataDisks(value: IecServerDataDisks[] | cdktf.IResolvable) { + this._dataDisks.internalValue = value; + } + public resetDataDisks() { + this._dataDisks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataDisksInput() { + return this._dataDisks.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecServerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecServerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_pass: cdktf.stringToTerraform(this._adminPass), + bind_eip: cdktf.booleanToTerraform(this._bindEip), + coverage_level: cdktf.stringToTerraform(this._coverageLevel), + coverage_policy: cdktf.stringToTerraform(this._coveragePolicy), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + key_pair: cdktf.stringToTerraform(this._keyPair), + name: cdktf.stringToTerraform(this._name), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + subnet_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._subnetIds), + system_disk_size: cdktf.numberToTerraform(this._systemDiskSize), + system_disk_type: cdktf.stringToTerraform(this._systemDiskType), + user_data: cdktf.stringToTerraform(this._userData), + vpc_id: cdktf.stringToTerraform(this._vpcId), + coverage_sites: cdktf.listMapper(iecServerCoverageSitesToTerraform, true)(this._coverageSites.internalValue), + data_disks: cdktf.listMapper(iecServerDataDisksToTerraform, true)(this._dataDisks.internalValue), + timeouts: iecServerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_pass: { + value: cdktf.stringToHclTerraform(this._adminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bind_eip: { + value: cdktf.booleanToHclTerraform(this._bindEip), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + coverage_level: { + value: cdktf.stringToHclTerraform(this._coverageLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + coverage_policy: { + value: cdktf.stringToHclTerraform(this._coveragePolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + subnet_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._subnetIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + system_disk_size: { + value: cdktf.numberToHclTerraform(this._systemDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_type: { + value: cdktf.stringToHclTerraform(this._systemDiskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_data: { + value: cdktf.stringToHclTerraform(this._userData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + coverage_sites: { + value: cdktf.listMapperHcl(iecServerCoverageSitesToHclTerraform, true)(this._coverageSites.internalValue), + isBlock: true, + type: "list", + storageClassType: "IecServerCoverageSitesList", + }, + data_disks: { + value: cdktf.listMapperHcl(iecServerDataDisksToHclTerraform, true)(this._dataDisks.internalValue), + isBlock: true, + type: "list", + storageClassType: "IecServerDataDisksList", + }, + timeouts: { + value: iecServerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecServerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-vip/README.md b/src/constructs/providers/huaweicloud/iec-vip/README.md new file mode 100644 index 00000000..bfa5435b --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-vip/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_vip` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_vip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip). diff --git a/src/constructs/providers/huaweicloud/iec-vip/index.ts b/src/constructs/providers/huaweicloud/iec-vip/index.ts new file mode 100644 index 00000000..f247c296 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-vip/index.ts @@ -0,0 +1,364 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecVipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#id IecVip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#ip_address IecVip#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#port_ids IecVip#port_ids} + */ + readonly portIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#subnet_id IecVip#subnet_id} + */ + readonly subnetId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#timeouts IecVip#timeouts} + */ + readonly timeouts?: IecVipTimeouts; +} +export interface IecVipTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#create IecVip#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#delete IecVip#delete} + */ + readonly delete?: string; +} + +export function iecVipTimeoutsToTerraform(struct?: IecVipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function iecVipTimeoutsToHclTerraform(struct?: IecVipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecVipTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecVipTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecVipTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip huaweicloud_iec_vip} +*/ +export class IecVip extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_vip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecVip resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecVip to import + * @param importFromId The id of the existing IecVip that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecVip to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_vip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vip huaweicloud_iec_vip} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecVipConfig + */ + public constructor(scope: Construct, id: string, config: IecVipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_vip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ipAddress = config.ipAddress; + this._portIds = config.portIds; + this._subnetId = config.subnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // allowed_addresses - computed: true, optional: false, required: false + public get allowedAddresses() { + return this.getListAttribute('allowed_addresses'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // port_ids - computed: false, optional: true, required: false + private _portIds?: string[]; + public get portIds() { + return this.getListAttribute('port_ids'); + } + public set portIds(value: string[]) { + this._portIds = value; + } + public resetPortIds() { + this._portIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdsInput() { + return this._portIds; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecVipTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecVipTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + port_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._portIds), + subnet_id: cdktf.stringToTerraform(this._subnetId), + timeouts: iecVipTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._portIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: iecVipTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecVipTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-vpc-subnet/README.md b/src/constructs/providers/huaweicloud/iec-vpc-subnet/README.md new file mode 100644 index 00000000..9cc97aed --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-vpc-subnet/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_vpc_subnet` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_vpc_subnet`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet). diff --git a/src/constructs/providers/huaweicloud/iec-vpc-subnet/index.ts b/src/constructs/providers/huaweicloud/iec-vpc-subnet/index.ts new file mode 100644 index 00000000..ec688817 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-vpc-subnet/index.ts @@ -0,0 +1,492 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecVpcSubnetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#cidr IecVpcSubnet#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#dhcp_enable IecVpcSubnet#dhcp_enable} + */ + readonly dhcpEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#dns_list IecVpcSubnet#dns_list} + */ + readonly dnsList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#gateway_ip IecVpcSubnet#gateway_ip} + */ + readonly gatewayIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#id IecVpcSubnet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#name IecVpcSubnet#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#region IecVpcSubnet#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#site_id IecVpcSubnet#site_id} + */ + readonly siteId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#vpc_id IecVpcSubnet#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#timeouts IecVpcSubnet#timeouts} + */ + readonly timeouts?: IecVpcSubnetTimeouts; +} +export interface IecVpcSubnetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#create IecVpcSubnet#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#delete IecVpcSubnet#delete} + */ + readonly delete?: string; +} + +export function iecVpcSubnetTimeoutsToTerraform(struct?: IecVpcSubnetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function iecVpcSubnetTimeoutsToHclTerraform(struct?: IecVpcSubnetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecVpcSubnetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecVpcSubnetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecVpcSubnetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet huaweicloud_iec_vpc_subnet} +*/ +export class IecVpcSubnet extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_vpc_subnet"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecVpcSubnet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecVpcSubnet to import + * @param importFromId The id of the existing IecVpcSubnet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecVpcSubnet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_vpc_subnet", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc_subnet huaweicloud_iec_vpc_subnet} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecVpcSubnetConfig + */ + public constructor(scope: Construct, id: string, config: IecVpcSubnetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_vpc_subnet', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._dhcpEnable = config.dhcpEnable; + this._dnsList = config.dnsList; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._siteId = config.siteId; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // dhcp_enable - computed: false, optional: true, required: false + private _dhcpEnable?: boolean | cdktf.IResolvable; + public get dhcpEnable() { + return this.getBooleanAttribute('dhcp_enable'); + } + public set dhcpEnable(value: boolean | cdktf.IResolvable) { + this._dhcpEnable = value; + } + public resetDhcpEnable() { + this._dhcpEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpEnableInput() { + return this._dhcpEnable; + } + + // dns_list - computed: true, optional: true, required: false + private _dnsList?: string[]; + public get dnsList() { + return this.getListAttribute('dns_list'); + } + public set dnsList(value: string[]) { + this._dnsList = value; + } + public resetDnsList() { + this._dnsList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dnsListInput() { + return this._dnsList; + } + + // gateway_ip - computed: false, optional: false, required: true + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // site_id - computed: false, optional: false, required: true + private _siteId?: string; + public get siteId() { + return this.getStringAttribute('site_id'); + } + public set siteId(value: string) { + this._siteId = value; + } + // Temporarily expose input value. Use with caution. + public get siteIdInput() { + return this._siteId; + } + + // site_info - computed: true, optional: false, required: false + public get siteInfo() { + return this.getStringAttribute('site_info'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecVpcSubnetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecVpcSubnetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + dhcp_enable: cdktf.booleanToTerraform(this._dhcpEnable), + dns_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dnsList), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + site_id: cdktf.stringToTerraform(this._siteId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: iecVpcSubnetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dhcp_enable: { + value: cdktf.booleanToHclTerraform(this._dhcpEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dns_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dnsList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + site_id: { + value: cdktf.stringToHclTerraform(this._siteId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: iecVpcSubnetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecVpcSubnetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iec-vpc/README.md b/src/constructs/providers/huaweicloud/iec-vpc/README.md new file mode 100644 index 00000000..17628a45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-vpc/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iec_vpc` + +Refer to the Terraform Registry for docs: [`huaweicloud_iec_vpc`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc). diff --git a/src/constructs/providers/huaweicloud/iec-vpc/index.ts b/src/constructs/providers/huaweicloud/iec-vpc/index.ts new file mode 100644 index 00000000..7651c8c4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iec-vpc/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IecVpcConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#cidr IecVpc#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#id IecVpc#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#mode IecVpc#mode} + */ + readonly mode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#name IecVpc#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#region IecVpc#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#timeouts IecVpc#timeouts} + */ + readonly timeouts?: IecVpcTimeouts; +} +export interface IecVpcTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#create IecVpc#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#delete IecVpc#delete} + */ + readonly delete?: string; +} + +export function iecVpcTimeoutsToTerraform(struct?: IecVpcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function iecVpcTimeoutsToHclTerraform(struct?: IecVpcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IecVpcTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IecVpcTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IecVpcTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc huaweicloud_iec_vpc} +*/ +export class IecVpc extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iec_vpc"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IecVpc resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IecVpc to import + * @param importFromId The id of the existing IecVpc that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IecVpc to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iec_vpc", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iec_vpc huaweicloud_iec_vpc} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IecVpcConfig + */ + public constructor(scope: Construct, id: string, config: IecVpcConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iec_vpc', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._id = config.id; + this._mode = config.mode; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_num - computed: true, optional: false, required: false + public get subnetNum() { + return this.getNumberAttribute('subnet_num'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IecVpcTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IecVpcTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + id: cdktf.stringToTerraform(this._id), + mode: cdktf.stringToTerraform(this._mode), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: iecVpcTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: iecVpcTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IecVpcTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/images-image-copy/README.md b/src/constructs/providers/huaweicloud/images-image-copy/README.md new file mode 100644 index 00000000..2a33465b --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-copy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_images_image_copy` + +Refer to the Terraform Registry for docs: [`huaweicloud_images_image_copy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy). diff --git a/src/constructs/providers/huaweicloud/images-image-copy/index.ts b/src/constructs/providers/huaweicloud/images-image-copy/index.ts new file mode 100644 index 00000000..60519775 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-copy/index.ts @@ -0,0 +1,679 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImagesImageCopyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the agency name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#agency_name ImagesImageCopy#agency_name} + */ + readonly agencyName?: string; + /** + * Specifies the description of the copy image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#description ImagesImageCopy#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project id of the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#enterprise_project_id ImagesImageCopy#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#id ImagesImageCopy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the master key used for encrypting an image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#kms_key_id ImagesImageCopy#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#max_ram ImagesImageCopy#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#min_ram ImagesImageCopy#min_ram} + */ + readonly minRam?: number; + /** + * Specifies the name of the copy image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#name ImagesImageCopy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#region ImagesImageCopy#region} + */ + readonly region?: string; + /** + * Specifies the ID of the source image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#source_image_id ImagesImageCopy#source_image_id} + */ + readonly sourceImageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#tags ImagesImageCopy#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the target region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#target_region ImagesImageCopy#target_region} + */ + readonly targetRegion?: string; + /** + * Specifies the ID of the vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#vault_id ImagesImageCopy#vault_id} + */ + readonly vaultId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#timeouts ImagesImageCopy#timeouts} + */ + readonly timeouts?: ImagesImageCopyTimeouts; +} +export interface ImagesImageCopyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#create ImagesImageCopy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#delete ImagesImageCopy#delete} + */ + readonly delete?: string; +} + +export function imagesImageCopyTimeoutsToTerraform(struct?: ImagesImageCopyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imagesImageCopyTimeoutsToHclTerraform(struct?: ImagesImageCopyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImagesImageCopyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImagesImageCopyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImagesImageCopyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy huaweicloud_images_image_copy} +*/ +export class ImagesImageCopy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image_copy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImagesImageCopy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImagesImageCopy to import + * @param importFromId The id of the existing ImagesImageCopy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImagesImageCopy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image_copy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_copy huaweicloud_images_image_copy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImagesImageCopyConfig + */ + public constructor(scope: Construct, id: string, config: ImagesImageCopyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image_copy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._kmsKeyId = config.kmsKeyId; + this._maxRam = config.maxRam; + this._minRam = config.minRam; + this._name = config.name; + this._region = config.region; + this._sourceImageId = config.sourceImageId; + this._tags = config.tags; + this._targetRegion = config.targetRegion; + this._vaultId = config.vaultId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // kms_key_id - computed: true, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: true, optional: false, required: false + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_image_id - computed: false, optional: false, required: true + private _sourceImageId?: string; + public get sourceImageId() { + return this.getStringAttribute('source_image_id'); + } + public set sourceImageId(value: string) { + this._sourceImageId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceImageIdInput() { + return this._sourceImageId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // target_region - computed: true, optional: true, required: false + private _targetRegion?: string; + public get targetRegion() { + return this.getStringAttribute('target_region'); + } + public set targetRegion(value: string) { + this._targetRegion = value; + } + public resetTargetRegion() { + this._targetRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetRegionInput() { + return this._targetRegion; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vault_id - computed: true, optional: true, required: false + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + public resetVaultId() { + this._vaultId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImagesImageCopyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImagesImageCopyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_image_id: cdktf.stringToTerraform(this._sourceImageId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + target_region: cdktf.stringToTerraform(this._targetRegion), + vault_id: cdktf.stringToTerraform(this._vaultId), + timeouts: imagesImageCopyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_image_id: { + value: cdktf.stringToHclTerraform(this._sourceImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + target_region: { + value: cdktf.stringToHclTerraform(this._targetRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imagesImageCopyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImagesImageCopyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/images-image-share-accepter/README.md b/src/constructs/providers/huaweicloud/images-image-share-accepter/README.md new file mode 100644 index 00000000..0a07cac2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-share-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_images_image_share_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_images_image_share_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter). diff --git a/src/constructs/providers/huaweicloud/images-image-share-accepter/index.ts b/src/constructs/providers/huaweicloud/images-image-share-accepter/index.ts new file mode 100644 index 00000000..6a645dd9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-share-accepter/index.ts @@ -0,0 +1,358 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImagesImageShareAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#id ImagesImageShareAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#image_id ImagesImageShareAccepter#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#region ImagesImageShareAccepter#region} + */ + readonly region?: string; + /** + * Specifies the ID of a vault. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#vault_id ImagesImageShareAccepter#vault_id} + */ + readonly vaultId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#timeouts ImagesImageShareAccepter#timeouts} + */ + readonly timeouts?: ImagesImageShareAccepterTimeouts; +} +export interface ImagesImageShareAccepterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#create ImagesImageShareAccepter#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#delete ImagesImageShareAccepter#delete} + */ + readonly delete?: string; +} + +export function imagesImageShareAccepterTimeoutsToTerraform(struct?: ImagesImageShareAccepterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imagesImageShareAccepterTimeoutsToHclTerraform(struct?: ImagesImageShareAccepterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImagesImageShareAccepterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImagesImageShareAccepterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImagesImageShareAccepterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter huaweicloud_images_image_share_accepter} +*/ +export class ImagesImageShareAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image_share_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImagesImageShareAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImagesImageShareAccepter to import + * @param importFromId The id of the existing ImagesImageShareAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImagesImageShareAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image_share_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share_accepter huaweicloud_images_image_share_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImagesImageShareAccepterConfig + */ + public constructor(scope: Construct, id: string, config: ImagesImageShareAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image_share_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._imageId = config.imageId; + this._region = config.region; + this._vaultId = config.vaultId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vault_id - computed: true, optional: true, required: false + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + public resetVaultId() { + this._vaultId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImagesImageShareAccepterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImagesImageShareAccepterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + region: cdktf.stringToTerraform(this._region), + vault_id: cdktf.stringToTerraform(this._vaultId), + timeouts: imagesImageShareAccepterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imagesImageShareAccepterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImagesImageShareAccepterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/images-image-share/README.md b/src/constructs/providers/huaweicloud/images-image-share/README.md new file mode 100644 index 00000000..39b79b8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-share/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_images_image_share` + +Refer to the Terraform Registry for docs: [`huaweicloud_images_image_share`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share). diff --git a/src/constructs/providers/huaweicloud/images-image-share/index.ts b/src/constructs/providers/huaweicloud/images-image-share/index.ts new file mode 100644 index 00000000..639e02d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-share/index.ts @@ -0,0 +1,355 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImagesImageShareConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#id ImagesImageShare#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#region ImagesImageShare#region} + */ + readonly region?: string; + /** + * Specifies the ID of the source image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#source_image_id ImagesImageShare#source_image_id} + */ + readonly sourceImageId: string; + /** + * Specifies the IDs of the target projects. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#target_project_ids ImagesImageShare#target_project_ids} + */ + readonly targetProjectIds: string[]; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#timeouts ImagesImageShare#timeouts} + */ + readonly timeouts?: ImagesImageShareTimeouts; +} +export interface ImagesImageShareTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#create ImagesImageShare#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#delete ImagesImageShare#delete} + */ + readonly delete?: string; +} + +export function imagesImageShareTimeoutsToTerraform(struct?: ImagesImageShareTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imagesImageShareTimeoutsToHclTerraform(struct?: ImagesImageShareTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImagesImageShareTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImagesImageShareTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImagesImageShareTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share huaweicloud_images_image_share} +*/ +export class ImagesImageShare extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image_share"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImagesImageShare resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImagesImageShare to import + * @param importFromId The id of the existing ImagesImageShare that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImagesImageShare to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image_share", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_share huaweicloud_images_image_share} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImagesImageShareConfig + */ + public constructor(scope: Construct, id: string, config: ImagesImageShareConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image_share', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._sourceImageId = config.sourceImageId; + this._targetProjectIds = config.targetProjectIds; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_image_id - computed: false, optional: false, required: true + private _sourceImageId?: string; + public get sourceImageId() { + return this.getStringAttribute('source_image_id'); + } + public set sourceImageId(value: string) { + this._sourceImageId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceImageIdInput() { + return this._sourceImageId; + } + + // target_project_ids - computed: false, optional: false, required: true + private _targetProjectIds?: string[]; + public get targetProjectIds() { + return cdktf.Fn.tolist(this.getListAttribute('target_project_ids')); + } + public set targetProjectIds(value: string[]) { + this._targetProjectIds = value; + } + // Temporarily expose input value. Use with caution. + public get targetProjectIdsInput() { + return this._targetProjectIds; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImagesImageShareTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImagesImageShareTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + source_image_id: cdktf.stringToTerraform(this._sourceImageId), + target_project_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._targetProjectIds), + timeouts: imagesImageShareTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_image_id: { + value: cdktf.stringToHclTerraform(this._sourceImageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_project_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._targetProjectIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + timeouts: { + value: imagesImageShareTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImagesImageShareTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/images-image-v2/README.md b/src/constructs/providers/huaweicloud/images-image-v2/README.md new file mode 100644 index 00000000..cfc49331 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_images_image_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_images_image_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2). diff --git a/src/constructs/providers/huaweicloud/images-image-v2/index.ts b/src/constructs/providers/huaweicloud/images-image-v2/index.ts new file mode 100644 index 00000000..66dabfe5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image-v2/index.ts @@ -0,0 +1,613 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImagesImageV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#container_format ImagesImageV2#container_format} + */ + readonly containerFormat: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#disk_format ImagesImageV2#disk_format} + */ + readonly diskFormat: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#id ImagesImageV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#image_cache_path ImagesImageV2#image_cache_path} + */ + readonly imageCachePath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#image_source_url ImagesImageV2#image_source_url} + */ + readonly imageSourceUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#local_file_path ImagesImageV2#local_file_path} + */ + readonly localFilePath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#min_disk_gb ImagesImageV2#min_disk_gb} + */ + readonly minDiskGb?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#min_ram_mb ImagesImageV2#min_ram_mb} + */ + readonly minRamMb?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#name ImagesImageV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#protected ImagesImageV2#protected} + */ + readonly protected?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#region ImagesImageV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#tags ImagesImageV2#tags} + */ + readonly tags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#visibility ImagesImageV2#visibility} + */ + readonly visibility?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#timeouts ImagesImageV2#timeouts} + */ + readonly timeouts?: ImagesImageV2Timeouts; +} +export interface ImagesImageV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#create ImagesImageV2#create} + */ + readonly create?: string; +} + +export function imagesImageV2TimeoutsToTerraform(struct?: ImagesImageV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function imagesImageV2TimeoutsToHclTerraform(struct?: ImagesImageV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImagesImageV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImagesImageV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImagesImageV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2 huaweicloud_images_image_v2} +*/ +export class ImagesImageV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImagesImageV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImagesImageV2 to import + * @param importFromId The id of the existing ImagesImageV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImagesImageV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image_v2 huaweicloud_images_image_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImagesImageV2Config + */ + public constructor(scope: Construct, id: string, config: ImagesImageV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._containerFormat = config.containerFormat; + this._diskFormat = config.diskFormat; + this._id = config.id; + this._imageCachePath = config.imageCachePath; + this._imageSourceUrl = config.imageSourceUrl; + this._localFilePath = config.localFilePath; + this._minDiskGb = config.minDiskGb; + this._minRamMb = config.minRamMb; + this._name = config.name; + this._protected = config.protected; + this._region = config.region; + this._tags = config.tags; + this._visibility = config.visibility; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // container_format - computed: false, optional: false, required: true + private _containerFormat?: string; + public get containerFormat() { + return this.getStringAttribute('container_format'); + } + public set containerFormat(value: string) { + this._containerFormat = value; + } + // Temporarily expose input value. Use with caution. + public get containerFormatInput() { + return this._containerFormat; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // disk_format - computed: false, optional: false, required: true + private _diskFormat?: string; + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + public set diskFormat(value: string) { + this._diskFormat = value; + } + // Temporarily expose input value. Use with caution. + public get diskFormatInput() { + return this._diskFormat; + } + + // file - computed: true, optional: false, required: false + public get file() { + return this.getStringAttribute('file'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_cache_path - computed: false, optional: true, required: false + private _imageCachePath?: string; + public get imageCachePath() { + return this.getStringAttribute('image_cache_path'); + } + public set imageCachePath(value: string) { + this._imageCachePath = value; + } + public resetImageCachePath() { + this._imageCachePath = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageCachePathInput() { + return this._imageCachePath; + } + + // image_source_url - computed: false, optional: true, required: false + private _imageSourceUrl?: string; + public get imageSourceUrl() { + return this.getStringAttribute('image_source_url'); + } + public set imageSourceUrl(value: string) { + this._imageSourceUrl = value; + } + public resetImageSourceUrl() { + this._imageSourceUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageSourceUrlInput() { + return this._imageSourceUrl; + } + + // local_file_path - computed: false, optional: true, required: false + private _localFilePath?: string; + public get localFilePath() { + return this.getStringAttribute('local_file_path'); + } + public set localFilePath(value: string) { + this._localFilePath = value; + } + public resetLocalFilePath() { + this._localFilePath = undefined; + } + // Temporarily expose input value. Use with caution. + public get localFilePathInput() { + return this._localFilePath; + } + + // metadata - computed: true, optional: false, required: false + private _metadata = new cdktf.StringMap(this, "metadata"); + public get metadata() { + return this._metadata; + } + + // min_disk_gb - computed: false, optional: true, required: false + private _minDiskGb?: number; + public get minDiskGb() { + return this.getNumberAttribute('min_disk_gb'); + } + public set minDiskGb(value: number) { + this._minDiskGb = value; + } + public resetMinDiskGb() { + this._minDiskGb = undefined; + } + // Temporarily expose input value. Use with caution. + public get minDiskGbInput() { + return this._minDiskGb; + } + + // min_ram_mb - computed: false, optional: true, required: false + private _minRamMb?: number; + public get minRamMb() { + return this.getNumberAttribute('min_ram_mb'); + } + public set minRamMb(value: number) { + this._minRamMb = value; + } + public resetMinRamMb() { + this._minRamMb = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamMbInput() { + return this._minRamMb; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // protected - computed: false, optional: true, required: false + private _protected?: boolean | cdktf.IResolvable; + public get protected() { + return this.getBooleanAttribute('protected'); + } + public set protected(value: boolean | cdktf.IResolvable) { + this._protected = value; + } + public resetProtected() { + this._protected = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectedInput() { + return this._protected; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // schema - computed: true, optional: false, required: false + public get schema() { + return this.getStringAttribute('schema'); + } + + // size_bytes - computed: true, optional: false, required: false + public get sizeBytes() { + return this.getNumberAttribute('size_bytes'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: string[]; + public get tags() { + return cdktf.Fn.tolist(this.getListAttribute('tags')); + } + public set tags(value: string[]) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } + + // visibility - computed: false, optional: true, required: false + private _visibility?: string; + public get visibility() { + return this.getStringAttribute('visibility'); + } + public set visibility(value: string) { + this._visibility = value; + } + public resetVisibility() { + this._visibility = undefined; + } + // Temporarily expose input value. Use with caution. + public get visibilityInput() { + return this._visibility; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImagesImageV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImagesImageV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + container_format: cdktf.stringToTerraform(this._containerFormat), + disk_format: cdktf.stringToTerraform(this._diskFormat), + id: cdktf.stringToTerraform(this._id), + image_cache_path: cdktf.stringToTerraform(this._imageCachePath), + image_source_url: cdktf.stringToTerraform(this._imageSourceUrl), + local_file_path: cdktf.stringToTerraform(this._localFilePath), + min_disk_gb: cdktf.numberToTerraform(this._minDiskGb), + min_ram_mb: cdktf.numberToTerraform(this._minRamMb), + name: cdktf.stringToTerraform(this._name), + protected: cdktf.booleanToTerraform(this._protected), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.listMapper(cdktf.stringToTerraform, false)(this._tags), + visibility: cdktf.stringToTerraform(this._visibility), + timeouts: imagesImageV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + container_format: { + value: cdktf.stringToHclTerraform(this._containerFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk_format: { + value: cdktf.stringToHclTerraform(this._diskFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_cache_path: { + value: cdktf.stringToHclTerraform(this._imageCachePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_source_url: { + value: cdktf.stringToHclTerraform(this._imageSourceUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_file_path: { + value: cdktf.stringToHclTerraform(this._localFilePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + min_disk_gb: { + value: cdktf.numberToHclTerraform(this._minDiskGb), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram_mb: { + value: cdktf.numberToHclTerraform(this._minRamMb), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protected: { + value: cdktf.booleanToHclTerraform(this._protected), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._tags), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + visibility: { + value: cdktf.stringToHclTerraform(this._visibility), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imagesImageV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImagesImageV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/images-image/README.md b/src/constructs/providers/huaweicloud/images-image/README.md new file mode 100644 index 00000000..a4b5d089 --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_images_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_images_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image). diff --git a/src/constructs/providers/huaweicloud/images-image/index.ts b/src/constructs/providers/huaweicloud/images-image/index.ts new file mode 100644 index 00000000..f2f0c48e --- /dev/null +++ b/src/constructs/providers/huaweicloud/images-image/index.ts @@ -0,0 +1,776 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImagesImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#backup_id ImagesImage#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#cmk_id ImagesImage#cmk_id} + */ + readonly cmkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#description ImagesImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#enterprise_project_id ImagesImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#id ImagesImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#image_url ImagesImage#image_url} + */ + readonly imageUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#instance_id ImagesImage#instance_id} + */ + readonly instanceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#is_config ImagesImage#is_config} + */ + readonly isConfig?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#max_ram ImagesImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#min_disk ImagesImage#min_disk} + */ + readonly minDisk?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#min_ram ImagesImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#name ImagesImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#os_version ImagesImage#os_version} + */ + readonly osVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#region ImagesImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#tags ImagesImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#type ImagesImage#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#vault_id ImagesImage#vault_id} + */ + readonly vaultId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#volume_id ImagesImage#volume_id} + */ + readonly volumeId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#timeouts ImagesImage#timeouts} + */ + readonly timeouts?: ImagesImageTimeouts; +} +export interface ImagesImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#create ImagesImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#delete ImagesImage#delete} + */ + readonly delete?: string; +} + +export function imagesImageTimeoutsToTerraform(struct?: ImagesImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imagesImageTimeoutsToHclTerraform(struct?: ImagesImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImagesImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImagesImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImagesImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image huaweicloud_images_image} +*/ +export class ImagesImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_images_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImagesImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImagesImage to import + * @param importFromId The id of the existing ImagesImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImagesImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_images_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/images_image huaweicloud_images_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImagesImageConfig + */ + public constructor(scope: Construct, id: string, config: ImagesImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_images_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._cmkId = config.cmkId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._imageUrl = config.imageUrl; + this._instanceId = config.instanceId; + this._isConfig = config.isConfig; + this._maxRam = config.maxRam; + this._minDisk = config.minDisk; + this._minRam = config.minRam; + this._name = config.name; + this._osVersion = config.osVersion; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + this._vaultId = config.vaultId; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: true, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // checksum - computed: true, optional: false, required: false + public get checksum() { + return this.getStringAttribute('checksum'); + } + + // cmk_id - computed: false, optional: true, required: false + private _cmkId?: string; + public get cmkId() { + return this.getStringAttribute('cmk_id'); + } + public set cmkId(value: string) { + this._cmkId = value; + } + public resetCmkId() { + this._cmkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cmkIdInput() { + return this._cmkId; + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // image_url - computed: false, optional: true, required: false + private _imageUrl?: string; + public get imageUrl() { + return this.getStringAttribute('image_url'); + } + public set imageUrl(value: string) { + this._imageUrl = value; + } + public resetImageUrl() { + this._imageUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageUrlInput() { + return this._imageUrl; + } + + // instance_id - computed: true, optional: true, required: false + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + public resetInstanceId() { + this._instanceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_config - computed: false, optional: true, required: false + private _isConfig?: boolean | cdktf.IResolvable; + public get isConfig() { + return this.getBooleanAttribute('is_config'); + } + public set isConfig(value: boolean | cdktf.IResolvable) { + this._isConfig = value; + } + public resetIsConfig() { + this._isConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get isConfigInput() { + return this._isConfig; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: false, optional: true, required: false + private _minDisk?: number; + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + public set minDisk(value: number) { + this._minDisk = value; + } + public resetMinDisk() { + this._minDisk = undefined; + } + // Temporarily expose input value. Use with caution. + public get minDiskInput() { + return this._minDisk; + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_version - computed: true, optional: true, required: false + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + public resetOsVersion() { + this._osVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vault_id - computed: false, optional: true, required: false + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + public resetVaultId() { + this._vaultId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // volume_id - computed: true, optional: true, required: false + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + public resetVolumeId() { + this._volumeId = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImagesImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImagesImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + cmk_id: cdktf.stringToTerraform(this._cmkId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + image_url: cdktf.stringToTerraform(this._imageUrl), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_config: cdktf.booleanToTerraform(this._isConfig), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_disk: cdktf.numberToTerraform(this._minDisk), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + os_version: cdktf.stringToTerraform(this._osVersion), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + vault_id: cdktf.stringToTerraform(this._vaultId), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: imagesImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cmk_id: { + value: cdktf.stringToHclTerraform(this._cmkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_url: { + value: cdktf.stringToHclTerraform(this._imageUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_config: { + value: cdktf.booleanToHclTerraform(this._isConfig), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_disk: { + value: cdktf.numberToHclTerraform(this._minDisk), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imagesImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImagesImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-cbr-whole-image/README.md b/src/constructs/providers/huaweicloud/ims-cbr-whole-image/README.md new file mode 100644 index 00000000..d98edf9f --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-cbr-whole-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_cbr_whole_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_cbr_whole_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image). diff --git a/src/constructs/providers/huaweicloud/ims-cbr-whole-image/index.ts b/src/constructs/providers/huaweicloud/ims-cbr-whole-image/index.ts new file mode 100644 index 00000000..a52f7c00 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-cbr-whole-image/index.ts @@ -0,0 +1,564 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsCbrWholeImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#backup_id ImsCbrWholeImage#backup_id} + */ + readonly backupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#description ImsCbrWholeImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#enterprise_project_id ImsCbrWholeImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#id ImsCbrWholeImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#is_delete_backup ImsCbrWholeImage#is_delete_backup} + */ + readonly isDeleteBackup?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#max_ram ImsCbrWholeImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#min_ram ImsCbrWholeImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#name ImsCbrWholeImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#region ImsCbrWholeImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#tags ImsCbrWholeImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#timeouts ImsCbrWholeImage#timeouts} + */ + readonly timeouts?: ImsCbrWholeImageTimeouts; +} +export interface ImsCbrWholeImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#create ImsCbrWholeImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#delete ImsCbrWholeImage#delete} + */ + readonly delete?: string; +} + +export function imsCbrWholeImageTimeoutsToTerraform(struct?: ImsCbrWholeImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsCbrWholeImageTimeoutsToHclTerraform(struct?: ImsCbrWholeImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsCbrWholeImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsCbrWholeImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsCbrWholeImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image huaweicloud_ims_cbr_whole_image} +*/ +export class ImsCbrWholeImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_cbr_whole_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsCbrWholeImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsCbrWholeImage to import + * @param importFromId The id of the existing ImsCbrWholeImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsCbrWholeImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_cbr_whole_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_cbr_whole_image huaweicloud_ims_cbr_whole_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsCbrWholeImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsCbrWholeImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_cbr_whole_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isDeleteBackup = config.isDeleteBackup; + this._maxRam = config.maxRam; + this._minRam = config.minRam; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_delete_backup - computed: false, optional: true, required: false + private _isDeleteBackup?: boolean | cdktf.IResolvable; + public get isDeleteBackup() { + return this.getBooleanAttribute('is_delete_backup'); + } + public set isDeleteBackup(value: boolean | cdktf.IResolvable) { + this._isDeleteBackup = value; + } + public resetIsDeleteBackup() { + this._isDeleteBackup = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDeleteBackupInput() { + return this._isDeleteBackup; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: true, optional: false, required: false + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsCbrWholeImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsCbrWholeImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_delete_backup: cdktf.booleanToTerraform(this._isDeleteBackup), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: imsCbrWholeImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_delete_backup: { + value: cdktf.booleanToHclTerraform(this._isDeleteBackup), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: imsCbrWholeImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsCbrWholeImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-ecs-system-image/README.md b/src/constructs/providers/huaweicloud/ims-ecs-system-image/README.md new file mode 100644 index 00000000..42f7eb8d --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-ecs-system-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_ecs_system_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_ecs_system_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image). diff --git a/src/constructs/providers/huaweicloud/ims-ecs-system-image/index.ts b/src/constructs/providers/huaweicloud/ims-ecs-system-image/index.ts new file mode 100644 index 00000000..a37e9b23 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-ecs-system-image/index.ts @@ -0,0 +1,541 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsEcsSystemImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#description ImsEcsSystemImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#enterprise_project_id ImsEcsSystemImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#id ImsEcsSystemImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#instance_id ImsEcsSystemImage#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#max_ram ImsEcsSystemImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#min_ram ImsEcsSystemImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#name ImsEcsSystemImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#region ImsEcsSystemImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#tags ImsEcsSystemImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#timeouts ImsEcsSystemImage#timeouts} + */ + readonly timeouts?: ImsEcsSystemImageTimeouts; +} +export interface ImsEcsSystemImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#create ImsEcsSystemImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#delete ImsEcsSystemImage#delete} + */ + readonly delete?: string; +} + +export function imsEcsSystemImageTimeoutsToTerraform(struct?: ImsEcsSystemImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsEcsSystemImageTimeoutsToHclTerraform(struct?: ImsEcsSystemImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsEcsSystemImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsEcsSystemImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsEcsSystemImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image huaweicloud_ims_ecs_system_image} +*/ +export class ImsEcsSystemImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_ecs_system_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsEcsSystemImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsEcsSystemImage to import + * @param importFromId The id of the existing ImsEcsSystemImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsEcsSystemImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_ecs_system_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_system_image huaweicloud_ims_ecs_system_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsEcsSystemImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsEcsSystemImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_ecs_system_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceId = config.instanceId; + this._maxRam = config.maxRam; + this._minRam = config.minRam; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: true, optional: false, required: false + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsEcsSystemImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsEcsSystemImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: imsEcsSystemImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: imsEcsSystemImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsEcsSystemImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-ecs-whole-image/README.md b/src/constructs/providers/huaweicloud/ims-ecs-whole-image/README.md new file mode 100644 index 00000000..66d06a18 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-ecs-whole-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_ecs_whole_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_ecs_whole_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image). diff --git a/src/constructs/providers/huaweicloud/ims-ecs-whole-image/index.ts b/src/constructs/providers/huaweicloud/ims-ecs-whole-image/index.ts new file mode 100644 index 00000000..764fd206 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-ecs-whole-image/index.ts @@ -0,0 +1,594 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsEcsWholeImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#description ImsEcsWholeImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#enterprise_project_id ImsEcsWholeImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#id ImsEcsWholeImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#instance_id ImsEcsWholeImage#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#is_delete_backup ImsEcsWholeImage#is_delete_backup} + */ + readonly isDeleteBackup?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#max_ram ImsEcsWholeImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#min_ram ImsEcsWholeImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#name ImsEcsWholeImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#region ImsEcsWholeImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#tags ImsEcsWholeImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#vault_id ImsEcsWholeImage#vault_id} + */ + readonly vaultId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#timeouts ImsEcsWholeImage#timeouts} + */ + readonly timeouts?: ImsEcsWholeImageTimeouts; +} +export interface ImsEcsWholeImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#create ImsEcsWholeImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#delete ImsEcsWholeImage#delete} + */ + readonly delete?: string; +} + +export function imsEcsWholeImageTimeoutsToTerraform(struct?: ImsEcsWholeImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsEcsWholeImageTimeoutsToHclTerraform(struct?: ImsEcsWholeImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsEcsWholeImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsEcsWholeImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsEcsWholeImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image huaweicloud_ims_ecs_whole_image} +*/ +export class ImsEcsWholeImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_ecs_whole_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsEcsWholeImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsEcsWholeImage to import + * @param importFromId The id of the existing ImsEcsWholeImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsEcsWholeImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_ecs_whole_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_ecs_whole_image huaweicloud_ims_ecs_whole_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsEcsWholeImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsEcsWholeImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_ecs_whole_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._instanceId = config.instanceId; + this._isDeleteBackup = config.isDeleteBackup; + this._maxRam = config.maxRam; + this._minRam = config.minRam; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._vaultId = config.vaultId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // backup_id - computed: true, optional: false, required: false + public get backupId() { + return this.getStringAttribute('backup_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_delete_backup - computed: false, optional: true, required: false + private _isDeleteBackup?: boolean | cdktf.IResolvable; + public get isDeleteBackup() { + return this.getBooleanAttribute('is_delete_backup'); + } + public set isDeleteBackup(value: boolean | cdktf.IResolvable) { + this._isDeleteBackup = value; + } + public resetIsDeleteBackup() { + this._isDeleteBackup = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDeleteBackupInput() { + return this._isDeleteBackup; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: true, optional: false, required: false + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_version - computed: true, optional: false, required: false + public get osVersion() { + return this.getStringAttribute('os_version'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vault_id - computed: false, optional: false, required: true + private _vaultId?: string; + public get vaultId() { + return this.getStringAttribute('vault_id'); + } + public set vaultId(value: string) { + this._vaultId = value; + } + // Temporarily expose input value. Use with caution. + public get vaultIdInput() { + return this._vaultId; + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsEcsWholeImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsEcsWholeImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_delete_backup: cdktf.booleanToTerraform(this._isDeleteBackup), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vault_id: cdktf.stringToTerraform(this._vaultId), + timeouts: imsEcsWholeImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_delete_backup: { + value: cdktf.booleanToHclTerraform(this._isDeleteBackup), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vault_id: { + value: cdktf.stringToHclTerraform(this._vaultId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imsEcsWholeImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsEcsWholeImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-evs-data-image/README.md b/src/constructs/providers/huaweicloud/ims-evs-data-image/README.md new file mode 100644 index 00000000..bfd1511c --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-evs-data-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_evs_data_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_evs_data_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image). diff --git a/src/constructs/providers/huaweicloud/ims-evs-data-image/index.ts b/src/constructs/providers/huaweicloud/ims-evs-data-image/index.ts new file mode 100644 index 00000000..01633e15 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-evs-data-image/index.ts @@ -0,0 +1,485 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsEvsDataImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#description ImsEvsDataImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#enterprise_project_id ImsEvsDataImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#id ImsEvsDataImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#name ImsEvsDataImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#region ImsEvsDataImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#tags ImsEvsDataImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#volume_id ImsEvsDataImage#volume_id} + */ + readonly volumeId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#timeouts ImsEvsDataImage#timeouts} + */ + readonly timeouts?: ImsEvsDataImageTimeouts; +} +export interface ImsEvsDataImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#create ImsEvsDataImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#delete ImsEvsDataImage#delete} + */ + readonly delete?: string; +} + +export function imsEvsDataImageTimeoutsToTerraform(struct?: ImsEvsDataImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsEvsDataImageTimeoutsToHclTerraform(struct?: ImsEvsDataImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsEvsDataImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsEvsDataImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsEvsDataImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image huaweicloud_ims_evs_data_image} +*/ +export class ImsEvsDataImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_evs_data_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsEvsDataImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsEvsDataImage to import + * @param importFromId The id of the existing ImsEvsDataImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsEvsDataImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_evs_data_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_data_image huaweicloud_ims_evs_data_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsEvsDataImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsEvsDataImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_evs_data_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // min_disk - computed: true, optional: false, required: false + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsEvsDataImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsEvsDataImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: imsEvsDataImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imsEvsDataImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsEvsDataImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-evs-system-image/README.md b/src/constructs/providers/huaweicloud/ims-evs-system-image/README.md new file mode 100644 index 00000000..05b4da26 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-evs-system-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_evs_system_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_evs_system_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image). diff --git a/src/constructs/providers/huaweicloud/ims-evs-system-image/index.ts b/src/constructs/providers/huaweicloud/ims-evs-system-image/index.ts new file mode 100644 index 00000000..79af046e --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-evs-system-image/index.ts @@ -0,0 +1,594 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsEvsSystemImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#description ImsEvsSystemImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#enterprise_project_id ImsEvsSystemImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#id ImsEvsSystemImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#max_ram ImsEvsSystemImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#min_ram ImsEvsSystemImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#name ImsEvsSystemImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#os_version ImsEvsSystemImage#os_version} + */ + readonly osVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#region ImsEvsSystemImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#tags ImsEvsSystemImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#type ImsEvsSystemImage#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#volume_id ImsEvsSystemImage#volume_id} + */ + readonly volumeId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#timeouts ImsEvsSystemImage#timeouts} + */ + readonly timeouts?: ImsEvsSystemImageTimeouts; +} +export interface ImsEvsSystemImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#create ImsEvsSystemImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#delete ImsEvsSystemImage#delete} + */ + readonly delete?: string; +} + +export function imsEvsSystemImageTimeoutsToTerraform(struct?: ImsEvsSystemImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsEvsSystemImageTimeoutsToHclTerraform(struct?: ImsEvsSystemImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsEvsSystemImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsEvsSystemImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsEvsSystemImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image huaweicloud_ims_evs_system_image} +*/ +export class ImsEvsSystemImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_evs_system_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsEvsSystemImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsEvsSystemImage to import + * @param importFromId The id of the existing ImsEvsSystemImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsEvsSystemImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_evs_system_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_evs_system_image huaweicloud_ims_evs_system_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsEvsSystemImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsEvsSystemImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_evs_system_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._maxRam = config.maxRam; + this._minRam = config.minRam; + this._name = config.name; + this._osVersion = config.osVersion; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: true, optional: false, required: false + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // os_version - computed: false, optional: false, required: true + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsEvsSystemImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsEvsSystemImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + os_version: cdktf.stringToTerraform(this._osVersion), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: imsEvsSystemImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imsEvsSystemImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsEvsSystemImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-image-export/README.md b/src/constructs/providers/huaweicloud/ims-image-export/README.md new file mode 100644 index 00000000..917191de --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-image-export/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_image_export` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_image_export`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export). diff --git a/src/constructs/providers/huaweicloud/ims-image-export/index.ts b/src/constructs/providers/huaweicloud/ims-image-export/index.ts new file mode 100644 index 00000000..1cc9acdb --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-image-export/index.ts @@ -0,0 +1,374 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsImageExportConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#bucket_url ImsImageExport#bucket_url} + */ + readonly bucketUrl: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#file_format ImsImageExport#file_format} + */ + readonly fileFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#id ImsImageExport#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#image_id ImsImageExport#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#is_quick_export ImsImageExport#is_quick_export} + */ + readonly isQuickExport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#region ImsImageExport#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#timeouts ImsImageExport#timeouts} + */ + readonly timeouts?: ImsImageExportTimeouts; +} +export interface ImsImageExportTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#create ImsImageExport#create} + */ + readonly create?: string; +} + +export function imsImageExportTimeoutsToTerraform(struct?: ImsImageExportTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function imsImageExportTimeoutsToHclTerraform(struct?: ImsImageExportTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsImageExportTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsImageExportTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsImageExportTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export huaweicloud_ims_image_export} +*/ +export class ImsImageExport extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_image_export"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsImageExport resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsImageExport to import + * @param importFromId The id of the existing ImsImageExport that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsImageExport to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_image_export", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_image_export huaweicloud_ims_image_export} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsImageExportConfig + */ + public constructor(scope: Construct, id: string, config: ImsImageExportConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_image_export', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucketUrl = config.bucketUrl; + this._fileFormat = config.fileFormat; + this._id = config.id; + this._imageId = config.imageId; + this._isQuickExport = config.isQuickExport; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket_url - computed: false, optional: false, required: true + private _bucketUrl?: string; + public get bucketUrl() { + return this.getStringAttribute('bucket_url'); + } + public set bucketUrl(value: string) { + this._bucketUrl = value; + } + // Temporarily expose input value. Use with caution. + public get bucketUrlInput() { + return this._bucketUrl; + } + + // file_format - computed: false, optional: true, required: false + private _fileFormat?: string; + public get fileFormat() { + return this.getStringAttribute('file_format'); + } + public set fileFormat(value: string) { + this._fileFormat = value; + } + public resetFileFormat() { + this._fileFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileFormatInput() { + return this._fileFormat; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // is_quick_export - computed: false, optional: true, required: false + private _isQuickExport?: boolean | cdktf.IResolvable; + public get isQuickExport() { + return this.getBooleanAttribute('is_quick_export'); + } + public set isQuickExport(value: boolean | cdktf.IResolvable) { + this._isQuickExport = value; + } + public resetIsQuickExport() { + this._isQuickExport = undefined; + } + // Temporarily expose input value. Use with caution. + public get isQuickExportInput() { + return this._isQuickExport; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsImageExportTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsImageExportTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket_url: cdktf.stringToTerraform(this._bucketUrl), + file_format: cdktf.stringToTerraform(this._fileFormat), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + is_quick_export: cdktf.booleanToTerraform(this._isQuickExport), + region: cdktf.stringToTerraform(this._region), + timeouts: imsImageExportTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket_url: { + value: cdktf.stringToHclTerraform(this._bucketUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_format: { + value: cdktf.stringToHclTerraform(this._fileFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_quick_export: { + value: cdktf.booleanToHclTerraform(this._isQuickExport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imsImageExportTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsImageExportTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-obs-data-image/README.md b/src/constructs/providers/huaweicloud/ims-obs-data-image/README.md new file mode 100644 index 00000000..5dd2f0d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-obs-data-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_obs_data_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_obs_data_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image). diff --git a/src/constructs/providers/huaweicloud/ims-obs-data-image/index.ts b/src/constructs/providers/huaweicloud/ims-obs-data-image/index.ts new file mode 100644 index 00000000..62e9a6b7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-obs-data-image/index.ts @@ -0,0 +1,556 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsObsDataImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#cmk_id ImsObsDataImage#cmk_id} + */ + readonly cmkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#description ImsObsDataImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#enterprise_project_id ImsObsDataImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#id ImsObsDataImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#image_url ImsObsDataImage#image_url} + */ + readonly imageUrl: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#min_disk ImsObsDataImage#min_disk} + */ + readonly minDisk: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#name ImsObsDataImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#os_type ImsObsDataImage#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#region ImsObsDataImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#tags ImsObsDataImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#timeouts ImsObsDataImage#timeouts} + */ + readonly timeouts?: ImsObsDataImageTimeouts; +} +export interface ImsObsDataImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#create ImsObsDataImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#delete ImsObsDataImage#delete} + */ + readonly delete?: string; +} + +export function imsObsDataImageTimeoutsToTerraform(struct?: ImsObsDataImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsObsDataImageTimeoutsToHclTerraform(struct?: ImsObsDataImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsObsDataImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsObsDataImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsObsDataImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image huaweicloud_ims_obs_data_image} +*/ +export class ImsObsDataImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_obs_data_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsObsDataImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsObsDataImage to import + * @param importFromId The id of the existing ImsObsDataImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsObsDataImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_obs_data_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_data_image huaweicloud_ims_obs_data_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsObsDataImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsObsDataImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_obs_data_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cmkId = config.cmkId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._imageUrl = config.imageUrl; + this._minDisk = config.minDisk; + this._name = config.name; + this._osType = config.osType; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // cmk_id - computed: true, optional: true, required: false + private _cmkId?: string; + public get cmkId() { + return this.getStringAttribute('cmk_id'); + } + public set cmkId(value: string) { + this._cmkId = value; + } + public resetCmkId() { + this._cmkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cmkIdInput() { + return this._cmkId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // image_url - computed: false, optional: false, required: true + private _imageUrl?: string; + public get imageUrl() { + return this.getStringAttribute('image_url'); + } + public set imageUrl(value: string) { + this._imageUrl = value; + } + // Temporarily expose input value. Use with caution. + public get imageUrlInput() { + return this._imageUrl; + } + + // min_disk - computed: false, optional: false, required: true + private _minDisk?: number; + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + public set minDisk(value: number) { + this._minDisk = value; + } + // Temporarily expose input value. Use with caution. + public get minDiskInput() { + return this._minDisk; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: true, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsObsDataImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsObsDataImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cmk_id: cdktf.stringToTerraform(this._cmkId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + image_url: cdktf.stringToTerraform(this._imageUrl), + min_disk: cdktf.numberToTerraform(this._minDisk), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: imsObsDataImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cmk_id: { + value: cdktf.stringToHclTerraform(this._cmkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_url: { + value: cdktf.stringToHclTerraform(this._imageUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + min_disk: { + value: cdktf.numberToHclTerraform(this._minDisk), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: imsObsDataImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsObsDataImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-obs-iso-image/README.md b/src/constructs/providers/huaweicloud/ims-obs-iso-image/README.md new file mode 100644 index 00000000..3a2cb59e --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-obs-iso-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_obs_iso_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_obs_iso_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image). diff --git a/src/constructs/providers/huaweicloud/ims-obs-iso-image/index.ts b/src/constructs/providers/huaweicloud/ims-obs-iso-image/index.ts new file mode 100644 index 00000000..ba1736c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-obs-iso-image/index.ts @@ -0,0 +1,670 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsObsIsoImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#architecture ImsObsIsoImage#architecture} + */ + readonly architecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#cmk_id ImsObsIsoImage#cmk_id} + */ + readonly cmkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#description ImsObsIsoImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#enterprise_project_id ImsObsIsoImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#id ImsObsIsoImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#image_url ImsObsIsoImage#image_url} + */ + readonly imageUrl: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#is_config ImsObsIsoImage#is_config} + */ + readonly isConfig?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#max_ram ImsObsIsoImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#min_disk ImsObsIsoImage#min_disk} + */ + readonly minDisk: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#min_ram ImsObsIsoImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#name ImsObsIsoImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#os_version ImsObsIsoImage#os_version} + */ + readonly osVersion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#region ImsObsIsoImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#tags ImsObsIsoImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#timeouts ImsObsIsoImage#timeouts} + */ + readonly timeouts?: ImsObsIsoImageTimeouts; +} +export interface ImsObsIsoImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#create ImsObsIsoImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#delete ImsObsIsoImage#delete} + */ + readonly delete?: string; +} + +export function imsObsIsoImageTimeoutsToTerraform(struct?: ImsObsIsoImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsObsIsoImageTimeoutsToHclTerraform(struct?: ImsObsIsoImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsObsIsoImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsObsIsoImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsObsIsoImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image huaweicloud_ims_obs_iso_image} +*/ +export class ImsObsIsoImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_obs_iso_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsObsIsoImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsObsIsoImage to import + * @param importFromId The id of the existing ImsObsIsoImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsObsIsoImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_obs_iso_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_iso_image huaweicloud_ims_obs_iso_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsObsIsoImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsObsIsoImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_obs_iso_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._architecture = config.architecture; + this._cmkId = config.cmkId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._imageUrl = config.imageUrl; + this._isConfig = config.isConfig; + this._maxRam = config.maxRam; + this._minDisk = config.minDisk; + this._minRam = config.minRam; + this._name = config.name; + this._osVersion = config.osVersion; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // architecture - computed: true, optional: true, required: false + private _architecture?: string; + public get architecture() { + return this.getStringAttribute('architecture'); + } + public set architecture(value: string) { + this._architecture = value; + } + public resetArchitecture() { + this._architecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get architectureInput() { + return this._architecture; + } + + // cmk_id - computed: true, optional: true, required: false + private _cmkId?: string; + public get cmkId() { + return this.getStringAttribute('cmk_id'); + } + public set cmkId(value: string) { + this._cmkId = value; + } + public resetCmkId() { + this._cmkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cmkIdInput() { + return this._cmkId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // image_url - computed: false, optional: false, required: true + private _imageUrl?: string; + public get imageUrl() { + return this.getStringAttribute('image_url'); + } + public set imageUrl(value: string) { + this._imageUrl = value; + } + // Temporarily expose input value. Use with caution. + public get imageUrlInput() { + return this._imageUrl; + } + + // is_config - computed: false, optional: true, required: false + private _isConfig?: boolean | cdktf.IResolvable; + public get isConfig() { + return this.getBooleanAttribute('is_config'); + } + public set isConfig(value: boolean | cdktf.IResolvable) { + this._isConfig = value; + } + public resetIsConfig() { + this._isConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get isConfigInput() { + return this._isConfig; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: false, optional: false, required: true + private _minDisk?: number; + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + public set minDisk(value: number) { + this._minDisk = value; + } + // Temporarily expose input value. Use with caution. + public get minDiskInput() { + return this._minDisk; + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: true, optional: false, required: false + public get osType() { + return this.getStringAttribute('os_type'); + } + + // os_version - computed: false, optional: false, required: true + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsObsIsoImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsObsIsoImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + architecture: cdktf.stringToTerraform(this._architecture), + cmk_id: cdktf.stringToTerraform(this._cmkId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + image_url: cdktf.stringToTerraform(this._imageUrl), + is_config: cdktf.booleanToTerraform(this._isConfig), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_disk: cdktf.numberToTerraform(this._minDisk), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + os_version: cdktf.stringToTerraform(this._osVersion), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: imsObsIsoImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + architecture: { + value: cdktf.stringToHclTerraform(this._architecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cmk_id: { + value: cdktf.stringToHclTerraform(this._cmkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_url: { + value: cdktf.stringToHclTerraform(this._imageUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_config: { + value: cdktf.booleanToHclTerraform(this._isConfig), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_disk: { + value: cdktf.numberToHclTerraform(this._minDisk), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: imsObsIsoImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsObsIsoImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ims-obs-system-image/README.md b/src/constructs/providers/huaweicloud/ims-obs-system-image/README.md new file mode 100644 index 00000000..c1ce4538 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-obs-system-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ims_obs_system_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_ims_obs_system_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image). diff --git a/src/constructs/providers/huaweicloud/ims-obs-system-image/index.ts b/src/constructs/providers/huaweicloud/ims-obs-system-image/index.ts new file mode 100644 index 00000000..8562bfad --- /dev/null +++ b/src/constructs/providers/huaweicloud/ims-obs-system-image/index.ts @@ -0,0 +1,752 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ImsObsSystemImageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#architecture ImsObsSystemImage#architecture} + */ + readonly architecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#cmk_id ImsObsSystemImage#cmk_id} + */ + readonly cmkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#description ImsObsSystemImage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#enterprise_project_id ImsObsSystemImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#id ImsObsSystemImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#image_url ImsObsSystemImage#image_url} + */ + readonly imageUrl: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#is_config ImsObsSystemImage#is_config} + */ + readonly isConfig?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#is_quick_import ImsObsSystemImage#is_quick_import} + */ + readonly isQuickImport?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#max_ram ImsObsSystemImage#max_ram} + */ + readonly maxRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#min_disk ImsObsSystemImage#min_disk} + */ + readonly minDisk: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#min_ram ImsObsSystemImage#min_ram} + */ + readonly minRam?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#name ImsObsSystemImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#os_type ImsObsSystemImage#os_type} + */ + readonly osType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#os_version ImsObsSystemImage#os_version} + */ + readonly osVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#region ImsObsSystemImage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#tags ImsObsSystemImage#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#type ImsObsSystemImage#type} + */ + readonly type?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#timeouts ImsObsSystemImage#timeouts} + */ + readonly timeouts?: ImsObsSystemImageTimeouts; +} +export interface ImsObsSystemImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#create ImsObsSystemImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#delete ImsObsSystemImage#delete} + */ + readonly delete?: string; +} + +export function imsObsSystemImageTimeoutsToTerraform(struct?: ImsObsSystemImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function imsObsSystemImageTimeoutsToHclTerraform(struct?: ImsObsSystemImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ImsObsSystemImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ImsObsSystemImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ImsObsSystemImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image huaweicloud_ims_obs_system_image} +*/ +export class ImsObsSystemImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ims_obs_system_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ImsObsSystemImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ImsObsSystemImage to import + * @param importFromId The id of the existing ImsObsSystemImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ImsObsSystemImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ims_obs_system_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ims_obs_system_image huaweicloud_ims_obs_system_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ImsObsSystemImageConfig + */ + public constructor(scope: Construct, id: string, config: ImsObsSystemImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ims_obs_system_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._architecture = config.architecture; + this._cmkId = config.cmkId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._imageUrl = config.imageUrl; + this._isConfig = config.isConfig; + this._isQuickImport = config.isQuickImport; + this._maxRam = config.maxRam; + this._minDisk = config.minDisk; + this._minRam = config.minRam; + this._name = config.name; + this._osType = config.osType; + this._osVersion = config.osVersion; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_at - computed: true, optional: false, required: false + public get activeAt() { + return this.getStringAttribute('active_at'); + } + + // architecture - computed: true, optional: true, required: false + private _architecture?: string; + public get architecture() { + return this.getStringAttribute('architecture'); + } + public set architecture(value: string) { + this._architecture = value; + } + public resetArchitecture() { + this._architecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get architectureInput() { + return this._architecture; + } + + // cmk_id - computed: true, optional: true, required: false + private _cmkId?: string; + public get cmkId() { + return this.getStringAttribute('cmk_id'); + } + public set cmkId(value: string) { + this._cmkId = value; + } + public resetCmkId() { + this._cmkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cmkIdInput() { + return this._cmkId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_origin - computed: true, optional: false, required: false + public get dataOrigin() { + return this.getStringAttribute('data_origin'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disk_format - computed: true, optional: false, required: false + public get diskFormat() { + return this.getStringAttribute('disk_format'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_size - computed: true, optional: false, required: false + public get imageSize() { + return this.getStringAttribute('image_size'); + } + + // image_url - computed: false, optional: false, required: true + private _imageUrl?: string; + public get imageUrl() { + return this.getStringAttribute('image_url'); + } + public set imageUrl(value: string) { + this._imageUrl = value; + } + // Temporarily expose input value. Use with caution. + public get imageUrlInput() { + return this._imageUrl; + } + + // is_config - computed: false, optional: true, required: false + private _isConfig?: boolean | cdktf.IResolvable; + public get isConfig() { + return this.getBooleanAttribute('is_config'); + } + public set isConfig(value: boolean | cdktf.IResolvable) { + this._isConfig = value; + } + public resetIsConfig() { + this._isConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get isConfigInput() { + return this._isConfig; + } + + // is_quick_import - computed: false, optional: true, required: false + private _isQuickImport?: boolean | cdktf.IResolvable; + public get isQuickImport() { + return this.getBooleanAttribute('is_quick_import'); + } + public set isQuickImport(value: boolean | cdktf.IResolvable) { + this._isQuickImport = value; + } + public resetIsQuickImport() { + this._isQuickImport = undefined; + } + // Temporarily expose input value. Use with caution. + public get isQuickImportInput() { + return this._isQuickImport; + } + + // max_ram - computed: true, optional: true, required: false + private _maxRam?: number; + public get maxRam() { + return this.getNumberAttribute('max_ram'); + } + public set maxRam(value: number) { + this._maxRam = value; + } + public resetMaxRam() { + this._maxRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRamInput() { + return this._maxRam; + } + + // min_disk - computed: false, optional: false, required: true + private _minDisk?: number; + public get minDisk() { + return this.getNumberAttribute('min_disk'); + } + public set minDisk(value: number) { + this._minDisk = value; + } + // Temporarily expose input value. Use with caution. + public get minDiskInput() { + return this._minDisk; + } + + // min_ram - computed: true, optional: true, required: false + private _minRam?: number; + public get minRam() { + return this.getNumberAttribute('min_ram'); + } + public set minRam(value: number) { + this._minRam = value; + } + public resetMinRam() { + this._minRam = undefined; + } + // Temporarily expose input value. Use with caution. + public get minRamInput() { + return this._minRam; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: true, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // os_version - computed: true, optional: true, required: false + private _osVersion?: string; + public get osVersion() { + return this.getStringAttribute('os_version'); + } + public set osVersion(value: string) { + this._osVersion = value; + } + public resetOsVersion() { + this._osVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get osVersionInput() { + return this._osVersion; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // visibility - computed: true, optional: false, required: false + public get visibility() { + return this.getStringAttribute('visibility'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ImsObsSystemImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ImsObsSystemImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + architecture: cdktf.stringToTerraform(this._architecture), + cmk_id: cdktf.stringToTerraform(this._cmkId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + image_url: cdktf.stringToTerraform(this._imageUrl), + is_config: cdktf.booleanToTerraform(this._isConfig), + is_quick_import: cdktf.booleanToTerraform(this._isQuickImport), + max_ram: cdktf.numberToTerraform(this._maxRam), + min_disk: cdktf.numberToTerraform(this._minDisk), + min_ram: cdktf.numberToTerraform(this._minRam), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + os_version: cdktf.stringToTerraform(this._osVersion), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + timeouts: imsObsSystemImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + architecture: { + value: cdktf.stringToHclTerraform(this._architecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cmk_id: { + value: cdktf.stringToHclTerraform(this._cmkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_url: { + value: cdktf.stringToHclTerraform(this._imageUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_config: { + value: cdktf.booleanToHclTerraform(this._isConfig), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_quick_import: { + value: cdktf.booleanToHclTerraform(this._isQuickImport), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + max_ram: { + value: cdktf.numberToHclTerraform(this._maxRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_disk: { + value: cdktf.numberToHclTerraform(this._minDisk), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_ram: { + value: cdktf.numberToHclTerraform(this._minRam), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_version: { + value: cdktf.stringToHclTerraform(this._osVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: imsObsSystemImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ImsObsSystemImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/index.ts b/src/constructs/providers/huaweicloud/index.ts new file mode 100644 index 00000000..49f999b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/index.ts @@ -0,0 +1,1697 @@ +// generated by cdktf get +export * as aadForwardRule from './aad-forward-rule'; +export * as accessAnalyzer from './access-analyzer'; +export * as accessAnalyzerArchiveRule from './access-analyzer-archive-rule'; +export * as antiddosBasic from './antiddos-basic'; +export * as antiddosDefaultProtectionPolicy from './antiddos-default-protection-policy'; +export * as aomAlarmActionRule from './aom-alarm-action-rule'; +export * as aomAlarmGroupRule from './aom-alarm-group-rule'; +export * as aomAlarmPolicy from './aom-alarm-policy'; +export * as aomAlarmRule from './aom-alarm-rule'; +export * as aomAlarmRulesTemplate from './aom-alarm-rules-template'; +export * as aomAlarmSilenceRule from './aom-alarm-silence-rule'; +export * as aomApplication from './aom-application'; +export * as aomCloudServiceAccess from './aom-cloud-service-access'; +export * as aomCmdbApplication from './aom-cmdb-application'; +export * as aomCmdbComponent from './aom-cmdb-component'; +export * as aomCmdbEnvironment from './aom-cmdb-environment'; +export * as aomCmdbResourceRelationships from './aom-cmdb-resource-relationships'; +export * as aomComponent from './aom-component'; +export * as aomDashboard from './aom-dashboard'; +export * as aomDashboardsFolder from './aom-dashboards-folder'; +export * as aomEnvironment from './aom-environment'; +export * as aomEventAlarmRule from './aom-event-alarm-rule'; +export * as aomMessageTemplate from './aom-message-template'; +export * as aomMultiAccountAggregationRule from './aom-multi-account-aggregation-rule'; +export * as aomPromInstance from './aom-prom-instance'; +export * as aomPrometheusInstance from './aom-prometheus-instance'; +export * as aomServiceDiscoveryRule from './aom-service-discovery-rule'; +export * as aomv4AlarmRule from './aomv4-alarm-rule'; +export * as apiGatewayApi from './api-gateway-api'; +export * as apiGatewayEnvironment from './api-gateway-environment'; +export * as apiGatewayGroup from './api-gateway-group'; +export * as apigAclPolicy from './apig-acl-policy'; +export * as apigAclPolicyAssociate from './apig-acl-policy-associate'; +export * as apigApi from './apig-api'; +export * as apigApiPublishment from './apig-api-publishment'; +export * as apigAppcode from './apig-appcode'; +export * as apigApplication from './apig-application'; +export * as apigApplicationAcl from './apig-application-acl'; +export * as apigApplicationAuthorization from './apig-application-authorization'; +export * as apigApplicationQuota from './apig-application-quota'; +export * as apigApplicationQuotaAssociate from './apig-application-quota-associate'; +export * as apigCertificate from './apig-certificate'; +export * as apigChannel from './apig-channel'; +export * as apigCustomAuthorizer from './apig-custom-authorizer'; +export * as apigEndpointConnectionManagement from './apig-endpoint-connection-management'; +export * as apigEndpointWhitelist from './apig-endpoint-whitelist'; +export * as apigEnvironment from './apig-environment'; +export * as apigEnvironmentVariable from './apig-environment-variable'; +export * as apigGroup from './apig-group'; +export * as apigInstance from './apig-instance'; +export * as apigInstanceFeature from './apig-instance-feature'; +export * as apigInstanceRoutes from './apig-instance-routes'; +export * as apigPlugin from './apig-plugin'; +export * as apigPluginAssociate from './apig-plugin-associate'; +export * as apigResponse from './apig-response'; +export * as apigSignature from './apig-signature'; +export * as apigSignatureAssociate from './apig-signature-associate'; +export * as apigThrottlingPolicy from './apig-throttling-policy'; +export * as apigThrottlingPolicyAssociate from './apig-throttling-policy-associate'; +export * as apigVpcChannel from './apig-vpc-channel'; +export * as apmAksk from './apm-aksk'; +export * as asBandwidthPolicy from './as-bandwidth-policy'; +export * as asConfiguration from './as-configuration'; +export * as asConfigurationV1 from './as-configuration-v1'; +export * as asGroup from './as-group'; +export * as asGroupV1 from './as-group-v1'; +export * as asInstanceAttach from './as-instance-attach'; +export * as asLifecycleHook from './as-lifecycle-hook'; +export * as asLifecycleHookCallback from './as-lifecycle-hook-callback'; +export * as asNotification from './as-notification'; +export * as asPlannedTask from './as-planned-task'; +export * as asPolicy from './as-policy'; +export * as asPolicyV1 from './as-policy-v1'; +export * as asmMesh from './asm-mesh'; +export * as bcsInstance from './bcs-instance'; +export * as blockstorageVolumeV2 from './blockstorage-volume-v2'; +export * as bmsInstance from './bms-instance'; +export * as caeComponent from './cae-component'; +export * as caeComponentConfigurations from './cae-component-configurations'; +export * as caeComponentDeployment from './cae-component-deployment'; +export * as cbhAssetAgencyAuthorization from './cbh-asset-agency-authorization'; +export * as cbhHaInstance from './cbh-ha-instance'; +export * as cbhInstance from './cbh-instance'; +export * as cbrBackupShare from './cbr-backup-share'; +export * as cbrBackupShareAccepter from './cbr-backup-share-accepter'; +export * as cbrCheckpoint from './cbr-checkpoint'; +export * as cbrPolicy from './cbr-policy'; +export * as cbrVault from './cbr-vault'; +export * as ccAuthorization from './cc-authorization'; +export * as ccBandwidthPackage from './cc-bandwidth-package'; +export * as ccCentralNetwork from './cc-central-network'; +export * as ccCentralNetworkAttachment from './cc-central-network-attachment'; +export * as ccCentralNetworkConnectionBandwidthAssociate from './cc-central-network-connection-bandwidth-associate'; +export * as ccCentralNetworkPolicy from './cc-central-network-policy'; +export * as ccCentralNetworkPolicyApply from './cc-central-network-policy-apply'; +export * as ccConnection from './cc-connection'; +export * as ccGlobalConnectionBandwidth from './cc-global-connection-bandwidth'; +export * as ccGlobalConnectionBandwidthAssociate from './cc-global-connection-bandwidth-associate'; +export * as ccInterRegionBandwidth from './cc-inter-region-bandwidth'; +export * as ccNetworkInstance from './cc-network-instance'; +export * as cceAddon from './cce-addon'; +export * as cceAutopilotAddon from './cce-autopilot-addon'; +export * as cceAutopilotCluster from './cce-autopilot-cluster'; +export * as cceChart from './cce-chart'; +export * as cceCluster from './cce-cluster'; +export * as cceClusterLogConfig from './cce-cluster-log-config'; +export * as cceClusterUpgrade from './cce-cluster-upgrade'; +export * as cceClusterV3 from './cce-cluster-v3'; +export * as cceNamespace from './cce-namespace'; +export * as cceNode from './cce-node'; +export * as cceNodeAttach from './cce-node-attach'; +export * as cceNodePool from './cce-node-pool'; +export * as cceNodePoolNodesAdd from './cce-node-pool-nodes-add'; +export * as cceNodeV3 from './cce-node-v3'; +export * as ccePartition from './cce-partition'; +export * as ccePvc from './cce-pvc'; +export * as cciNamespace from './cci-namespace'; +export * as cciNetwork from './cci-network'; +export * as cciPvc from './cci-pvc'; +export * as ccmCertificate from './ccm-certificate'; +export * as ccmCertificateApply from './ccm-certificate-apply'; +export * as ccmCertificateDeploy from './ccm-certificate-deploy'; +export * as ccmCertificateImport from './ccm-certificate-import'; +export * as ccmCertificatePush from './ccm-certificate-push'; +export * as ccmPrivateCa from './ccm-private-ca'; +export * as ccmPrivateCaRestore from './ccm-private-ca-restore'; +export * as ccmPrivateCaRevoke from './ccm-private-ca-revoke'; +export * as ccmPrivateCertificate from './ccm-private-certificate'; +export * as ccmPrivateCertificateRevoke from './ccm-private-certificate-revoke'; +export * as cdmCluster from './cdm-cluster'; +export * as cdmClusterAction from './cdm-cluster-action'; +export * as cdmClusterV1 from './cdm-cluster-v1'; +export * as cdmJob from './cdm-job'; +export * as cdmLink from './cdm-link'; +export * as cdnBillingOption from './cdn-billing-option'; +export * as cdnCachePreheat from './cdn-cache-preheat'; +export * as cdnCacheRefresh from './cdn-cache-refresh'; +export * as cdnDomain from './cdn-domain'; +export * as cdnDomainV1 from './cdn-domain-v1'; +export * as cesAlarmTemplate from './ces-alarm-template'; +export * as cesAlarmrule from './ces-alarmrule'; +export * as cesDashboard from './ces-dashboard'; +export * as cesDashboardWidget from './ces-dashboard-widget'; +export * as cesEventReport from './ces-event-report'; +export * as cesOneClickAlarm from './ces-one-click-alarm'; +export * as cesResourceGroup from './ces-resource-group'; +export * as cfwAclRule from './cfw-acl-rule'; +export * as cfwAddressGroup from './cfw-address-group'; +export * as cfwAddressGroupMember from './cfw-address-group-member'; +export * as cfwBlackWhiteList from './cfw-black-white-list'; +export * as cfwCaptureTask from './cfw-capture-task'; +export * as cfwDnsResolution from './cfw-dns-resolution'; +export * as cfwDomainNameGroup from './cfw-domain-name-group'; +export * as cfwEipProtection from './cfw-eip-protection'; +export * as cfwFirewall from './cfw-firewall'; +export * as cfwLtsLog from './cfw-lts-log'; +export * as cfwProtectionRule from './cfw-protection-rule'; +export * as cfwServiceGroup from './cfw-service-group'; +export * as cfwServiceGroupMember from './cfw-service-group-member'; +export * as cloudtableCluster from './cloudtable-cluster'; +export * as cnadAdvancedBlackWhiteList from './cnad-advanced-black-white-list'; +export * as cnadAdvancedPolicy from './cnad-advanced-policy'; +export * as cnadAdvancedPolicyAssociate from './cnad-advanced-policy-associate'; +export * as cnadAdvancedProtectedObject from './cnad-advanced-protected-object'; +export * as cocScript from './coc-script'; +export * as cocScriptExecute from './coc-script-execute'; +export * as codeartsDeployApplication from './codearts-deploy-application'; +export * as codeartsDeployGroup from './codearts-deploy-group'; +export * as codeartsDeployHost from './codearts-deploy-host'; +export * as codeartsInspectorWebsite from './codearts-inspector-website'; +export * as codeartsInspectorWebsiteScan from './codearts-inspector-website-scan'; +export * as codeartsProject from './codearts-project'; +export * as codeartsRepository from './codearts-repository'; +export * as codehubRepository from './codehub-repository'; +export * as computeAutoLaunchGroup from './compute-auto-launch-group'; +export * as computeEipAssociate from './compute-eip-associate'; +export * as computeFloatingipAssociateV2 from './compute-floatingip-associate-v2'; +export * as computeFloatingipV2 from './compute-floatingip-v2'; +export * as computeInstance from './compute-instance'; +export * as computeInstanceV2 from './compute-instance-v2'; +export * as computeInterfaceAttach from './compute-interface-attach'; +export * as computeInterfaceAttachV2 from './compute-interface-attach-v2'; +export * as computeKeypair from './compute-keypair'; +export * as computeKeypairV2 from './compute-keypair-v2'; +export * as computeSecgroupV2 from './compute-secgroup-v2'; +export * as computeServergroup from './compute-servergroup'; +export * as computeServergroupV2 from './compute-servergroup-v2'; +export * as computeVolumeAttach from './compute-volume-attach'; +export * as computeVolumeAttachV2 from './compute-volume-attach-v2'; +export * as cphAdbCommand from './cph-adb-command'; +export * as cphPhoneProperty from './cph-phone-property'; +export * as cphPhoneReset from './cph-phone-reset'; +export * as cphPhoneRestart from './cph-phone-restart'; +export * as cphPhoneStop from './cph-phone-stop'; +export * as cphServer from './cph-server'; +export * as cphServerRestart from './cph-server-restart'; +export * as cphShareApp from './cph-share-app'; +export * as cptsProject from './cpts-project'; +export * as cptsTask from './cpts-task'; +export * as csCluster from './cs-cluster'; +export * as csClusterV1 from './cs-cluster-v1'; +export * as csPeeringConnect from './cs-peering-connect'; +export * as csPeeringConnectV1 from './cs-peering-connect-v1'; +export * as csRoute from './cs-route'; +export * as csRouteV1 from './cs-route-v1'; +export * as csbsBackup from './csbs-backup'; +export * as csbsBackupPolicy from './csbs-backup-policy'; +export * as csbsBackupPolicyV1 from './csbs-backup-policy-v1'; +export * as csbsBackupV1 from './csbs-backup-v1'; +export * as cseMicroservice from './cse-microservice'; +export * as cseMicroserviceEngine from './cse-microservice-engine'; +export * as cseMicroserviceEngineConfiguration from './cse-microservice-engine-configuration'; +export * as cseMicroserviceInstance from './cse-microservice-instance'; +export * as csmsEvent from './csms-event'; +export * as csmsSecret from './csms-secret'; +export * as csmsSecretVersionState from './csms-secret-version-state'; +export * as cssCluster from './css-cluster'; +export * as cssClusterAzMigrate from './css-cluster-az-migrate'; +export * as cssClusterNodeReplace from './css-cluster-node-replace'; +export * as cssClusterRestart from './css-cluster-restart'; +export * as cssClusterV1 from './css-cluster-v1'; +export * as cssConfiguration from './css-configuration'; +export * as cssEsCoreUpgrade from './css-es-core-upgrade'; +export * as cssEsLoadbalancerConfig from './css-es-loadbalancer-config'; +export * as cssLogSetting from './css-log-setting'; +export * as cssLogstashCluster from './css-logstash-cluster'; +export * as cssLogstashClusterRestart from './css-logstash-cluster-restart'; +export * as cssLogstashConfiguration from './css-logstash-configuration'; +export * as cssLogstashConnectivity from './css-logstash-connectivity'; +export * as cssLogstashCustomCertificate from './css-logstash-custom-certificate'; +export * as cssLogstashCustomTemplate from './css-logstash-custom-template'; +export * as cssLogstashPipeline from './css-logstash-pipeline'; +export * as cssManualLogBackup from './css-manual-log-backup'; +export * as cssScanTask from './css-scan-task'; +export * as cssSnapshot from './css-snapshot'; +export * as cssThesaurus from './css-thesaurus'; +export * as ctsDataTracker from './cts-data-tracker'; +export * as ctsNotification from './cts-notification'; +export * as ctsTracker from './cts-tracker'; +export * as dataartsArchitectureBatchPublish from './dataarts-architecture-batch-publish'; +export * as dataartsArchitectureBatchPublishment from './dataarts-architecture-batch-publishment'; +export * as dataartsArchitectureBatchUnpublish from './dataarts-architecture-batch-unpublish'; +export * as dataartsArchitectureBusinessMetric from './dataarts-architecture-business-metric'; +export * as dataartsArchitectureCodeTable from './dataarts-architecture-code-table'; +export * as dataartsArchitectureCodeTableValues from './dataarts-architecture-code-table-values'; +export * as dataartsArchitectureDataStandard from './dataarts-architecture-data-standard'; +export * as dataartsArchitectureDataStandardTemplate from './dataarts-architecture-data-standard-template'; +export * as dataartsArchitectureDirectory from './dataarts-architecture-directory'; +export * as dataartsArchitectureModel from './dataarts-architecture-model'; +export * as dataartsArchitectureProcess from './dataarts-architecture-process'; +export * as dataartsArchitectureReviewer from './dataarts-architecture-reviewer'; +export * as dataartsArchitectureSubject from './dataarts-architecture-subject'; +export * as dataartsArchitectureTableModel from './dataarts-architecture-table-model'; +export * as dataartsDataserviceApi from './dataarts-dataservice-api'; +export * as dataartsDataserviceApiAction from './dataarts-dataservice-api-action'; +export * as dataartsDataserviceApiAuth from './dataarts-dataservice-api-auth'; +export * as dataartsDataserviceApiAuthAction from './dataarts-dataservice-api-auth-action'; +export * as dataartsDataserviceApiDebug from './dataarts-dataservice-api-debug'; +export * as dataartsDataserviceApiPublish from './dataarts-dataservice-api-publish'; +export * as dataartsDataserviceApiPublishment from './dataarts-dataservice-api-publishment'; +export * as dataartsDataserviceApp from './dataarts-dataservice-app'; +export * as dataartsDataserviceCatalog from './dataarts-dataservice-catalog'; +export * as dataartsDataserviceMessageApprove from './dataarts-dataservice-message-approve'; +export * as dataartsFactoryJob from './dataarts-factory-job'; +export * as dataartsFactoryJobAction from './dataarts-factory-job-action'; +export * as dataartsFactoryResource from './dataarts-factory-resource'; +export * as dataartsFactoryScript from './dataarts-factory-script'; +export * as dataartsSecurityDataRecognitionRule from './dataarts-security-data-recognition-rule'; +export * as dataartsSecurityDataSecrecyLevel from './dataarts-security-data-secrecy-level'; +export * as dataartsSecurityPermissionSet from './dataarts-security-permission-set'; +export * as dataartsSecurityPermissionSetMember from './dataarts-security-permission-set-member'; +export * as dataartsSecurityPermissionSetPrivilege from './dataarts-security-permission-set-privilege'; +export * as dataartsStudioDataConnection from './dataarts-studio-data-connection'; +export * as dataartsStudioInstance from './dataarts-studio-instance'; +export * as dbssAuditRiskRuleAction from './dbss-audit-risk-rule-action'; +export * as dbssEcsDatabase from './dbss-ecs-database'; +export * as dbssInstance from './dbss-instance'; +export * as dbssRdsDatabase from './dbss-rds-database'; +export * as dcHostedConnect from './dc-hosted-connect'; +export * as dcVirtualGateway from './dc-virtual-gateway'; +export * as dcVirtualInterface from './dc-virtual-interface'; +export * as dcVirtualInterfaceAccepter from './dc-virtual-interface-accepter'; +export * as dcsAccount from './dcs-account'; +export * as dcsBackup from './dcs-backup'; +export * as dcsBigkeyAnalysis from './dcs-bigkey-analysis'; +export * as dcsCustomTemplate from './dcs-custom-template'; +export * as dcsDiagnosisTask from './dcs-diagnosis-task'; +export * as dcsHotkeyAnalysis from './dcs-hotkey-analysis'; +export * as dcsInstance from './dcs-instance'; +export * as dcsInstanceRestore from './dcs-instance-restore'; +export * as dcsInstanceV1 from './dcs-instance-v1'; +export * as dcsIsntanceRestore from './dcs-isntance-restore'; +export * as ddmAccount from './ddm-account'; +export * as ddmInstance from './ddm-instance'; +export * as ddmInstanceReadStrategy from './ddm-instance-read-strategy'; +export * as ddmInstanceRestart from './ddm-instance-restart'; +export * as ddmInstanceRollback from './ddm-instance-rollback'; +export * as ddmInstanceUpgrade from './ddm-instance-upgrade'; +export * as ddmLogicalSessionsKill from './ddm-logical-sessions-kill'; +export * as ddmPhysicalSessionsKill from './ddm-physical-sessions-kill'; +export * as ddmSchema from './ddm-schema'; +export * as ddsAuditLogDelete from './dds-audit-log-delete'; +export * as ddsAuditLogPolicy from './dds-audit-log-policy'; +export * as ddsBackup from './dds-backup'; +export * as ddsCollectionRestore from './dds-collection-restore'; +export * as ddsDatabaseRole from './dds-database-role'; +export * as ddsDatabaseUser from './dds-database-user'; +export * as ddsInstance from './dds-instance'; +export * as ddsInstanceEipAssociate from './dds-instance-eip-associate'; +export * as ddsInstanceInternalIpModify from './dds-instance-internal-ip-modify'; +export * as ddsInstanceParametersModify from './dds-instance-parameters-modify'; +export * as ddsInstanceRecovery from './dds-instance-recovery'; +export * as ddsInstanceRestart from './dds-instance-restart'; +export * as ddsInstanceRestore from './dds-instance-restore'; +export * as ddsInstanceV3 from './dds-instance-v3'; +export * as ddsLtsLog from './dds-lts-log'; +export * as ddsParameterTemplate from './dds-parameter-template'; +export * as ddsParameterTemplateApply from './dds-parameter-template-apply'; +export * as ddsParameterTemplateCompare from './dds-parameter-template-compare'; +export * as ddsParameterTemplateCopy from './dds-parameter-template-copy'; +export * as ddsParameterTemplateReset from './dds-parameter-template-reset'; +export * as ddsPrimaryStandbySwitch from './dds-primary-standby-switch'; +export * as ddsRecyclePolicy from './dds-recycle-policy'; +export * as ddsScheduledTaskCancel from './dds-scheduled-task-cancel'; +export * as disStream from './dis-stream'; +export * as disStreamV2 from './dis-stream-v2'; +export * as dliAgency from './dli-agency'; +export * as dliDatabase from './dli-database'; +export * as dliDatabasePrivilege from './dli-database-privilege'; +export * as dliDatasourceAuth from './dli-datasource-auth'; +export * as dliDatasourceConnection from './dli-datasource-connection'; +export * as dliDatasourceConnectionAssociate from './dli-datasource-connection-associate'; +export * as dliDatasourceConnectionPrivilege from './dli-datasource-connection-privilege'; +export * as dliElasticResourcePool from './dli-elastic-resource-pool'; +export * as dliFlinkTemplate from './dli-flink-template'; +export * as dliFlinkjarJob from './dli-flinkjar-job'; +export * as dliFlinksqlJob from './dli-flinksql-job'; +export * as dliGlobalVariable from './dli-global-variable'; +export * as dliPackage from './dli-package'; +export * as dliPermission from './dli-permission'; +export * as dliQueue from './dli-queue'; +export * as dliQueueV1 from './dli-queue-v1'; +export * as dliSparkJob from './dli-spark-job'; +export * as dliSparkTemplate from './dli-spark-template'; +export * as dliSqlJob from './dli-sql-job'; +export * as dliSqlTemplate from './dli-sql-template'; +export * as dliTable from './dli-table'; +export * as dliTemplateFlink from './dli-template-flink'; +export * as dliTemplateSpark from './dli-template-spark'; +export * as dliTemplateSql from './dli-template-sql'; +export * as dmsGroup from './dms-group'; +export * as dmsGroupV1 from './dms-group-v1'; +export * as dmsInstance from './dms-instance'; +export * as dmsInstanceV1 from './dms-instance-v1'; +export * as dmsKafkaBackgroundTaskDelete from './dms-kafka-background-task-delete'; +export * as dmsKafkaConsumerGroup from './dms-kafka-consumer-group'; +export * as dmsKafkaInstance from './dms-kafka-instance'; +export * as dmsKafkaInstanceRestart from './dms-kafka-instance-restart'; +export * as dmsKafkaMessageDiagnosisTask from './dms-kafka-message-diagnosis-task'; +export * as dmsKafkaMessageOffsetReset from './dms-kafka-message-offset-reset'; +export * as dmsKafkaMessageProduce from './dms-kafka-message-produce'; +export * as dmsKafkaPartitionReassign from './dms-kafka-partition-reassign'; +export * as dmsKafkaPermissions from './dms-kafka-permissions'; +export * as dmsKafkaSmartConnect from './dms-kafka-smart-connect'; +export * as dmsKafkaSmartConnectTask from './dms-kafka-smart-connect-task'; +export * as dmsKafkaSmartConnectTaskAction from './dms-kafka-smart-connect-task-action'; +export * as dmsKafkaTopic from './dms-kafka-topic'; +export * as dmsKafkaUser from './dms-kafka-user'; +export * as dmsKafkaUserClientQuota from './dms-kafka-user-client-quota'; +export * as dmsKafkav2SmartConnectTask from './dms-kafkav2-smart-connect-task'; +export * as dmsQueue from './dms-queue'; +export * as dmsQueueV1 from './dms-queue-v1'; +export * as dmsRabbitmqBackgroundTaskDelete from './dms-rabbitmq-background-task-delete'; +export * as dmsRabbitmqExchange from './dms-rabbitmq-exchange'; +export * as dmsRabbitmqExchangeAssociate from './dms-rabbitmq-exchange-associate'; +export * as dmsRabbitmqInstance from './dms-rabbitmq-instance'; +export * as dmsRabbitmqPlugin from './dms-rabbitmq-plugin'; +export * as dmsRabbitmqQueue from './dms-rabbitmq-queue'; +export * as dmsRabbitmqQueueMessageClear from './dms-rabbitmq-queue-message-clear'; +export * as dmsRabbitmqUser from './dms-rabbitmq-user'; +export * as dmsRabbitmqVhost from './dms-rabbitmq-vhost'; +export * as dmsRocketmqConsumerGroup from './dms-rocketmq-consumer-group'; +export * as dmsRocketmqConsumptionVerify from './dms-rocketmq-consumption-verify'; +export * as dmsRocketmqDeadLetterResend from './dms-rocketmq-dead-letter-resend'; +export * as dmsRocketmqInstance from './dms-rocketmq-instance'; +export * as dmsRocketmqMessageOffsetReset from './dms-rocketmq-message-offset-reset'; +export * as dmsRocketmqMigrationTask from './dms-rocketmq-migration-task'; +export * as dmsRocketmqTopic from './dms-rocketmq-topic'; +export * as dmsRocketmqUser from './dms-rocketmq-user'; +export * as dnsCustomLine from './dns-custom-line'; +export * as dnsEndpoint from './dns-endpoint'; +export * as dnsLineGroup from './dns-line-group'; +export * as dnsPtrrecord from './dns-ptrrecord'; +export * as dnsPtrrecordV2 from './dns-ptrrecord-v2'; +export * as dnsRecordset from './dns-recordset'; +export * as dnsRecordsetV2 from './dns-recordset-v2'; +export * as dnsResolverRule from './dns-resolver-rule'; +export * as dnsResolverRuleAssociate from './dns-resolver-rule-associate'; +export * as dnsZone from './dns-zone'; +export * as dnsZoneV2 from './dns-zone-v2'; +export * as drsJob from './drs-job'; +export * as drsJobPrimaryStandbySwitch from './drs-job-primary-standby-switch'; +export * as dscAlarmNotification from './dsc-alarm-notification'; +export * as dscAssetObs from './dsc-asset-obs'; +export * as dscInstance from './dsc-instance'; +export * as dwsAlarmSubscription from './dws-alarm-subscription'; +export * as dwsCluster from './dws-cluster'; +export * as dwsClusterRestart from './dws-cluster-restart'; +export * as dwsDisasterRecoveryTask from './dws-disaster-recovery-task'; +export * as dwsEventSubscription from './dws-event-subscription'; +export * as dwsExtDataSource from './dws-ext-data-source'; +export * as dwsLogicalCluster from './dws-logical-cluster'; +export * as dwsLogicalClusterRestart from './dws-logical-cluster-restart'; +export * as dwsOmAccountAction from './dws-om-account-action'; +export * as dwsParameterConfigurations from './dws-parameter-configurations'; +export * as dwsPublicDomainAssociate from './dws-public-domain-associate'; +export * as dwsSnapshot from './dws-snapshot'; +export * as dwsSnapshotCopy from './dws-snapshot-copy'; +export * as dwsSnapshotPolicy from './dws-snapshot-policy'; +export * as dwsWorkloadConfiguration from './dws-workload-configuration'; +export * as dwsWorkloadPlan from './dws-workload-plan'; +export * as dwsWorkloadPlanExecution from './dws-workload-plan-execution'; +export * as dwsWorkloadPlanStage from './dws-workload-plan-stage'; +export * as dwsWorkloadQueue from './dws-workload-queue'; +export * as dwsWorkloadQueueUserAssociate from './dws-workload-queue-user-associate'; +export * as ecsInstanceV1 from './ecs-instance-v1'; +export * as egConnection from './eg-connection'; +export * as egCustomEventChannel from './eg-custom-event-channel'; +export * as egCustomEventSource from './eg-custom-event-source'; +export * as egEndpoint from './eg-endpoint'; +export * as egEventStream from './eg-event-stream'; +export * as egEventSubscription from './eg-event-subscription'; +export * as elbActiveStandbyPool from './elb-active-standby-pool'; +export * as elbCertificate from './elb-certificate'; +export * as elbCertificatePrivateKeyEcho from './elb-certificate-private-key-echo'; +export * as elbIpgroup from './elb-ipgroup'; +export * as elbL7Policy from './elb-l7policy'; +export * as elbL7Rule from './elb-l7rule'; +export * as elbListener from './elb-listener'; +export * as elbLoadbalancer from './elb-loadbalancer'; +export * as elbLog from './elb-log'; +export * as elbLogtank from './elb-logtank'; +export * as elbMember from './elb-member'; +export * as elbMonitor from './elb-monitor'; +export * as elbPool from './elb-pool'; +export * as elbSecurityPolicy from './elb-security-policy'; +export * as enterpriseProject from './enterprise-project'; +export * as enterpriseProjectAuthority from './enterprise-project-authority'; +export * as erAssociation from './er-association'; +export * as erFlowLog from './er-flow-log'; +export * as erInstance from './er-instance'; +export * as erPropagation from './er-propagation'; +export * as erRouteTable from './er-route-table'; +export * as erStaticRoute from './er-static-route'; +export * as erVpcAttachment from './er-vpc-attachment'; +export * as evsSnapshot from './evs-snapshot'; +export * as evsSnapshotRollback from './evs-snapshot-rollback'; +export * as evsVolume from './evs-volume'; +export * as evsVolumeTransfer from './evs-volume-transfer'; +export * as evsVolumeTransferAccepter from './evs-volume-transfer-accepter'; +export * as fgsApplication from './fgs-application'; +export * as fgsAsyncInvokeConfiguration from './fgs-async-invoke-configuration'; +export * as fgsDependency from './fgs-dependency'; +export * as fgsDependencyVersion from './fgs-dependency-version'; +export * as fgsFunction from './fgs-function'; +export * as fgsFunctionEvent from './fgs-function-event'; +export * as fgsFunctionTrigger from './fgs-function-trigger'; +export * as fgsFunctionV2 from './fgs-function-v2'; +export * as fgsTrigger from './fgs-trigger'; +export * as fwFirewallGroupV2 from './fw-firewall-group-v2'; +export * as fwPolicyV2 from './fw-policy-v2'; +export * as fwRuleV2 from './fw-rule-v2'; +export * as gaAccelerator from './ga-accelerator'; +export * as gaAddressGroup from './ga-address-group'; +export * as gaEndpoint from './ga-endpoint'; +export * as gaEndpointGroup from './ga-endpoint-group'; +export * as gaHealthCheck from './ga-health-check'; +export * as gaListener from './ga-listener'; +export * as gaussdbCassandraInstance from './gaussdb-cassandra-instance'; +export * as gaussdbInfluxInstance from './gaussdb-influx-instance'; +export * as gaussdbMongoInstance from './gaussdb-mongo-instance'; +export * as gaussdbMysqlAccount from './gaussdb-mysql-account'; +export * as gaussdbMysqlAccountPrivilege from './gaussdb-mysql-account-privilege'; +export * as gaussdbMysqlBackup from './gaussdb-mysql-backup'; +export * as gaussdbMysqlDatabase from './gaussdb-mysql-database'; +export * as gaussdbMysqlEipAssociate from './gaussdb-mysql-eip-associate'; +export * as gaussdbMysqlInstance from './gaussdb-mysql-instance'; +export * as gaussdbMysqlInstanceNodeConfig from './gaussdb-mysql-instance-node-config'; +export * as gaussdbMysqlInstanceRestart from './gaussdb-mysql-instance-restart'; +export * as gaussdbMysqlInstanceUpgrade from './gaussdb-mysql-instance-upgrade'; +export * as gaussdbMysqlInstantTaskDelete from './gaussdb-mysql-instant-task-delete'; +export * as gaussdbMysqlLtsLog from './gaussdb-mysql-lts-log'; +export * as gaussdbMysqlParameterTemplate from './gaussdb-mysql-parameter-template'; +export * as gaussdbMysqlParameterTemplateApply from './gaussdb-mysql-parameter-template-apply'; +export * as gaussdbMysqlParameterTemplateCompare from './gaussdb-mysql-parameter-template-compare'; +export * as gaussdbMysqlProxy from './gaussdb-mysql-proxy'; +export * as gaussdbMysqlProxyRestart from './gaussdb-mysql-proxy-restart'; +export * as gaussdbMysqlQuota from './gaussdb-mysql-quota'; +export * as gaussdbMysqlRecyclingPolicy from './gaussdb-mysql-recycling-policy'; +export * as gaussdbMysqlRestore from './gaussdb-mysql-restore'; +export * as gaussdbMysqlScheduledTaskCancel from './gaussdb-mysql-scheduled-task-cancel'; +export * as gaussdbMysqlScheduledTaskDelete from './gaussdb-mysql-scheduled-task-delete'; +export * as gaussdbMysqlSqlControlRule from './gaussdb-mysql-sql-control-rule'; +export * as gaussdbMysqlTableRestore from './gaussdb-mysql-table-restore'; +export * as gaussdbOpengaussDatabase from './gaussdb-opengauss-database'; +export * as gaussdbOpengaussInstance from './gaussdb-opengauss-instance'; +export * as gaussdbRedisEipAssociate from './gaussdb-redis-eip-associate'; +export * as gaussdbRedisInstance from './gaussdb-redis-instance'; +export * as gesBackup from './ges-backup'; +export * as gesGraph from './ges-graph'; +export * as gesMetadata from './ges-metadata'; +export * as globalEip from './global-eip'; +export * as globalEipAssociate from './global-eip-associate'; +export * as globalInternetBandwidth from './global-internet-bandwidth'; +export * as hssCceProtection from './hss-cce-protection'; +export * as hssHostGroup from './hss-host-group'; +export * as hssHostProtection from './hss-host-protection'; +export * as hssQuota from './hss-quota'; +export * as hssWebtamperProtection from './hss-webtamper-protection'; +export * as iamAgency from './iam-agency'; +export * as iamAgencyV3 from './iam-agency-v3'; +export * as identityAccessKey from './identity-access-key'; +export * as identityAcl from './identity-acl'; +export * as identityAgency from './identity-agency'; +export * as identityGroup from './identity-group'; +export * as identityGroupMembership from './identity-group-membership'; +export * as identityGroupMembershipV3 from './identity-group-membership-v3'; +export * as identityGroupRoleAssignment from './identity-group-role-assignment'; +export * as identityGroupV3 from './identity-group-v3'; +export * as identityLoginPolicy from './identity-login-policy'; +export * as identityPasswordPolicy from './identity-password-policy'; +export * as identityPolicy from './identity-policy'; +export * as identityProject from './identity-project'; +export * as identityProjectV3 from './identity-project-v3'; +export * as identityProtectionPolicy from './identity-protection-policy'; +export * as identityProvider from './identity-provider'; +export * as identityProviderConversion from './identity-provider-conversion'; +export * as identityRole from './identity-role'; +export * as identityRoleAssignment from './identity-role-assignment'; +export * as identityRoleAssignmentV3 from './identity-role-assignment-v3'; +export * as identityServiceAgency from './identity-service-agency'; +export * as identityTrustAgency from './identity-trust-agency'; +export * as identityUser from './identity-user'; +export * as identityUserRoleAssignment from './identity-user-role-assignment'; +export * as identityUserToken from './identity-user-token'; +export * as identityUserV3 from './identity-user-v3'; +export * as identityVirtualMfaDevice from './identity-virtual-mfa-device'; +export * as identitycenterAccountAssignment from './identitycenter-account-assignment'; +export * as identitycenterCustomPolicyAttachment from './identitycenter-custom-policy-attachment'; +export * as identitycenterCustomRoleAttachment from './identitycenter-custom-role-attachment'; +export * as identitycenterGroup from './identitycenter-group'; +export * as identitycenterGroupMembership from './identitycenter-group-membership'; +export * as identitycenterPermissionSet from './identitycenter-permission-set'; +export * as identitycenterSystemPolicyAttachment from './identitycenter-system-policy-attachment'; +export * as identitycenterUser from './identitycenter-user'; +export * as iecEip from './iec-eip'; +export * as iecKeypair from './iec-keypair'; +export * as iecNetworkAcl from './iec-network-acl'; +export * as iecNetworkAclRule from './iec-network-acl-rule'; +export * as iecSecurityGroup from './iec-security-group'; +export * as iecSecurityGroupRule from './iec-security-group-rule'; +export * as iecServer from './iec-server'; +export * as iecVip from './iec-vip'; +export * as iecVpc from './iec-vpc'; +export * as iecVpcSubnet from './iec-vpc-subnet'; +export * as imagesImage from './images-image'; +export * as imagesImageCopy from './images-image-copy'; +export * as imagesImageShare from './images-image-share'; +export * as imagesImageShareAccepter from './images-image-share-accepter'; +export * as imagesImageV2 from './images-image-v2'; +export * as imsCbrWholeImage from './ims-cbr-whole-image'; +export * as imsEcsSystemImage from './ims-ecs-system-image'; +export * as imsEcsWholeImage from './ims-ecs-whole-image'; +export * as imsEvsDataImage from './ims-evs-data-image'; +export * as imsEvsSystemImage from './ims-evs-system-image'; +export * as imsImageExport from './ims-image-export'; +export * as imsObsDataImage from './ims-obs-data-image'; +export * as imsObsIsoImage from './ims-obs-iso-image'; +export * as imsObsSystemImage from './ims-obs-system-image'; +export * as iotdaAccessCredential from './iotda-access-credential'; +export * as iotdaAmqp from './iotda-amqp'; +export * as iotdaBatchtask from './iotda-batchtask'; +export * as iotdaBatchtaskFile from './iotda-batchtask-file'; +export * as iotdaDataBacklogPolicy from './iotda-data-backlog-policy'; +export * as iotdaDataFlowControlPolicy from './iotda-data-flow-control-policy'; +export * as iotdaDataforwardingRule from './iotda-dataforwarding-rule'; +export * as iotdaDevice from './iotda-device'; +export * as iotdaDeviceAsyncCommand from './iotda-device-async-command'; +export * as iotdaDeviceCertificate from './iotda-device-certificate'; +export * as iotdaDeviceGroup from './iotda-device-group'; +export * as iotdaDeviceLinkageRule from './iotda-device-linkage-rule'; +export * as iotdaDeviceMessage from './iotda-device-message'; +export * as iotdaDeviceProxy from './iotda-device-proxy'; +export * as iotdaProduct from './iotda-product'; +export * as iotdaSpace from './iotda-space'; +export * as iotdaUpgradePackage from './iotda-upgrade-package'; +export * as kmsDataEncryptDecrypt from './kms-data-encrypt-decrypt'; +export * as kmsDedicatedKeystore from './kms-dedicated-keystore'; +export * as kmsGrant from './kms-grant'; +export * as kmsKey from './kms-key'; +export * as kmsKeyMaterial from './kms-key-material'; +export * as kmsKeyV1 from './kms-key-v1'; +export * as kpsKeypair from './kps-keypair'; +export * as lbCertificate from './lb-certificate'; +export * as lbCertificateV2 from './lb-certificate-v2'; +export * as lbL7Policy from './lb-l7policy'; +export * as lbL7PolicyV2 from './lb-l7policy-v2'; +export * as lbL7Rule from './lb-l7rule'; +export * as lbL7RuleV2 from './lb-l7rule-v2'; +export * as lbListener from './lb-listener'; +export * as lbListenerV2 from './lb-listener-v2'; +export * as lbLoadbalancer from './lb-loadbalancer'; +export * as lbLoadbalancerV2 from './lb-loadbalancer-v2'; +export * as lbMember from './lb-member'; +export * as lbMemberV2 from './lb-member-v2'; +export * as lbMonitor from './lb-monitor'; +export * as lbMonitorV2 from './lb-monitor-v2'; +export * as lbPool from './lb-pool'; +export * as lbPoolV2 from './lb-pool-v2'; +export * as lbWhitelist from './lb-whitelist'; +export * as lbWhitelistV2 from './lb-whitelist-v2'; +export * as liveBucketAuthorization from './live-bucket-authorization'; +export * as liveDomain from './live-domain'; +export * as liveRecordCallback from './live-record-callback'; +export * as liveRecording from './live-recording'; +export * as liveSnapshot from './live-snapshot'; +export * as liveTranscoding from './live-transcoding'; +export * as ltsAccessRule from './lts-access-rule'; +export * as ltsAomAccess from './lts-aom-access'; +export * as ltsCceAccess from './lts-cce-access'; +export * as ltsCrossAccountAccess from './lts-cross-account-access'; +export * as ltsDashboard from './lts-dashboard'; +export * as ltsGroup from './lts-group'; +export * as ltsHostAccess from './lts-host-access'; +export * as ltsHostGroup from './lts-host-group'; +export * as ltsKeywordsAlarmRule from './lts-keywords-alarm-rule'; +export * as ltsLogConverge from './lts-log-converge'; +export * as ltsLogConvergeSwitch from './lts-log-converge-switch'; +export * as ltsNotificationTemplate from './lts-notification-template'; +export * as ltsSearchCriteria from './lts-search-criteria'; +export * as ltsSqlAlarmRule from './lts-sql-alarm-rule'; +export * as ltsStream from './lts-stream'; +export * as ltsStructTemplate from './lts-struct-template'; +export * as ltsStructingTemplate from './lts-structing-template'; +export * as ltsStructuringConfiguration from './lts-structuring-configuration'; +export * as ltsStructuringCustomConfiguration from './lts-structuring-custom-configuration'; +export * as ltsTransfer from './lts-transfer'; +export * as ltsWafAccess from './lts-waf-access'; +export * as mapreduceCluster from './mapreduce-cluster'; +export * as mapreduceDataConnection from './mapreduce-data-connection'; +export * as mapreduceJob from './mapreduce-job'; +export * as mapreduceScalingPolicy from './mapreduce-scaling-policy'; +export * as meetingAdminAssignment from './meeting-admin-assignment'; +export * as meetingConference from './meeting-conference'; +export * as meetingUser from './meeting-user'; +export * as modelartsAuthorization from './modelarts-authorization'; +export * as modelartsDataset from './modelarts-dataset'; +export * as modelartsDatasetVersion from './modelarts-dataset-version'; +export * as modelartsModel from './modelarts-model'; +export * as modelartsNetwork from './modelarts-network'; +export * as modelartsNotebook from './modelarts-notebook'; +export * as modelartsNotebookMountStorage from './modelarts-notebook-mount-storage'; +export * as modelartsResourcePool from './modelarts-resource-pool'; +export * as modelartsService from './modelarts-service'; +export * as modelartsWorkspace from './modelarts-workspace'; +export * as mpcTranscodingTemplate from './mpc-transcoding-template'; +export * as mpcTranscodingTemplateGroup from './mpc-transcoding-template-group'; +export * as mrsCluster from './mrs-cluster'; +export * as mrsClusterV1 from './mrs-cluster-v1'; +export * as mrsJob from './mrs-job'; +export * as mrsJobV1 from './mrs-job-v1'; +export * as natDnatRule from './nat-dnat-rule'; +export * as natDnatRuleV2 from './nat-dnat-rule-v2'; +export * as natGateway from './nat-gateway'; +export * as natGatewayV2 from './nat-gateway-v2'; +export * as natPrivateDnatRule from './nat-private-dnat-rule'; +export * as natPrivateGateway from './nat-private-gateway'; +export * as natPrivateSnatRule from './nat-private-snat-rule'; +export * as natPrivateTransitIp from './nat-private-transit-ip'; +export * as natSnatRule from './nat-snat-rule'; +export * as natSnatRuleV2 from './nat-snat-rule-v2'; +export * as networkAcl from './network-acl'; +export * as networkAclRule from './network-acl-rule'; +export * as networkingEipAssociate from './networking-eip-associate'; +export * as networkingFloatingipV2 from './networking-floatingip-v2'; +export * as networkingNetworkV2 from './networking-network-v2'; +export * as networkingPort from './networking-port'; +export * as networkingPortV2 from './networking-port-v2'; +export * as networkingRouterInterfaceV2 from './networking-router-interface-v2'; +export * as networkingRouterRouteV2 from './networking-router-route-v2'; +export * as networkingRouterV2 from './networking-router-v2'; +export * as networkingSecgroup from './networking-secgroup'; +export * as networkingSecgroupRule from './networking-secgroup-rule'; +export * as networkingSecgroupRuleV2 from './networking-secgroup-rule-v2'; +export * as networkingSecgroupV2 from './networking-secgroup-v2'; +export * as networkingSubnetV2 from './networking-subnet-v2'; +export * as networkingVip from './networking-vip'; +export * as networkingVipAssociate from './networking-vip-associate'; +export * as networkingVipAssociateV2 from './networking-vip-associate-v2'; +export * as networkingVipV2 from './networking-vip-v2'; +export * as obsBucket from './obs-bucket'; +export * as obsBucketAcl from './obs-bucket-acl'; +export * as obsBucketObject from './obs-bucket-object'; +export * as obsBucketObjectAcl from './obs-bucket-object-acl'; +export * as obsBucketPolicy from './obs-bucket-policy'; +export * as obsBucketReplication from './obs-bucket-replication'; +export * as omsMigrationSyncTask from './oms-migration-sync-task'; +export * as omsMigrationTask from './oms-migration-task'; +export * as omsMigrationTaskGroup from './oms-migration-task-group'; +export * as omsTask from './oms-task'; +export * as organizationsAccount from './organizations-account'; +export * as organizationsAccountAssociate from './organizations-account-associate'; +export * as organizationsAccountInvite from './organizations-account-invite'; +export * as organizationsAccountInviteAccepter from './organizations-account-invite-accepter'; +export * as organizationsAccountInviteDecliner from './organizations-account-invite-decliner'; +export * as organizationsDelegatedAdministrator from './organizations-delegated-administrator'; +export * as organizationsOrganization from './organizations-organization'; +export * as organizationsOrganizationalUnit from './organizations-organizational-unit'; +export * as organizationsPolicy from './organizations-policy'; +export * as organizationsPolicyAttach from './organizations-policy-attach'; +export * as organizationsTrustedService from './organizations-trusted-service'; +export * as projectmanProject from './projectman-project'; +export * as ramOrganization from './ram-organization'; +export * as ramResourceShare from './ram-resource-share'; +export * as ramResourceShareAccepter from './ram-resource-share-accepter'; +export * as rdsAccount from './rds-account'; +export * as rdsBackup from './rds-backup'; +export * as rdsCrossRegionBackupStrategy from './rds-cross-region-backup-strategy'; +export * as rdsDatabase from './rds-database'; +export * as rdsDatabaseLogsShrinking from './rds-database-logs-shrinking'; +export * as rdsDatabasePrivilege from './rds-database-privilege'; +export * as rdsExtendLogLink from './rds-extend-log-link'; +export * as rdsInstance from './rds-instance'; +export * as rdsInstanceEipAssociate from './rds-instance-eip-associate'; +export * as rdsInstanceV3 from './rds-instance-v3'; +export * as rdsLtsLog from './rds-lts-log'; +export * as rdsMysqlAccount from './rds-mysql-account'; +export * as rdsMysqlBinlog from './rds-mysql-binlog'; +export * as rdsMysqlDatabase from './rds-mysql-database'; +export * as rdsMysqlDatabasePrivilege from './rds-mysql-database-privilege'; +export * as rdsMysqlDatabaseTableRestore from './rds-mysql-database-table-restore'; +export * as rdsMysqlProxy from './rds-mysql-proxy'; +export * as rdsMysqlProxyRestart from './rds-mysql-proxy-restart'; +export * as rdsParametergroup from './rds-parametergroup'; +export * as rdsParametergroupV3 from './rds-parametergroup-v3'; +export * as rdsPgAccount from './rds-pg-account'; +export * as rdsPgAccountPrivileges from './rds-pg-account-privileges'; +export * as rdsPgAccountRoles from './rds-pg-account-roles'; +export * as rdsPgDatabase from './rds-pg-database'; +export * as rdsPgDatabasePrivilege from './rds-pg-database-privilege'; +export * as rdsPgHba from './rds-pg-hba'; +export * as rdsPgPlugin from './rds-pg-plugin'; +export * as rdsPgPluginParameter from './rds-pg-plugin-parameter'; +export * as rdsPgPluginUpdate from './rds-pg-plugin-update'; +export * as rdsPgSqlLimit from './rds-pg-sql-limit'; +export * as rdsPrimaryStandbySwitch from './rds-primary-standby-switch'; +export * as rdsReadReplicaInstance from './rds-read-replica-instance'; +export * as rdsRecyclingPolicy from './rds-recycling-policy'; +export * as rdsRestore from './rds-restore'; +export * as rdsSqlAudit from './rds-sql-audit'; +export * as rdsSqlserverAccount from './rds-sqlserver-account'; +export * as rdsSqlserverDatabase from './rds-sqlserver-database'; +export * as rdsSqlserverDatabasePrivilege from './rds-sqlserver-database-privilege'; +export * as rfStack from './rf-stack'; +export * as rfsExecutionPlan from './rfs-execution-plan'; +export * as rfsPrivateHook from './rfs-private-hook'; +export * as rfsStack from './rfs-stack'; +export * as rgcAccount from './rgc-account'; +export * as rmsAdvancedQuery from './rms-advanced-query'; +export * as rmsAssignmentPackage from './rms-assignment-package'; +export * as rmsOrganizationalAssignmentPackage from './rms-organizational-assignment-package'; +export * as rmsOrganizationalPolicyAssignment from './rms-organizational-policy-assignment'; +export * as rmsPolicyAssignment from './rms-policy-assignment'; +export * as rmsPolicyAssignmentEvaluate from './rms-policy-assignment-evaluate'; +export * as rmsRemediationConfiguration from './rms-remediation-configuration'; +export * as rmsRemediationException from './rms-remediation-exception'; +export * as rmsRemediationExecution from './rms-remediation-execution'; +export * as rmsResourceAggregationAuthorization from './rms-resource-aggregation-authorization'; +export * as rmsResourceAggregator from './rms-resource-aggregator'; +export * as rmsResourceRecorder from './rms-resource-recorder'; +export * as scmCertificate from './scm-certificate'; +export * as sdrsDrill from './sdrs-drill'; +export * as sdrsProtectedInstance from './sdrs-protected-instance'; +export * as sdrsProtectionGroup from './sdrs-protection-group'; +export * as sdrsReplicationAttach from './sdrs-replication-attach'; +export * as sdrsReplicationPair from './sdrs-replication-pair'; +export * as secmasterAlert from './secmaster-alert'; +export * as secmasterAlertRule from './secmaster-alert-rule'; +export * as secmasterDataObjectRelations from './secmaster-data-object-relations'; +export * as secmasterIncident from './secmaster-incident'; +export * as secmasterIndicator from './secmaster-indicator'; +export * as secmasterPlaybook from './secmaster-playbook'; +export * as secmasterPlaybookAction from './secmaster-playbook-action'; +export * as secmasterPlaybookApproval from './secmaster-playbook-approval'; +export * as secmasterPlaybookEnable from './secmaster-playbook-enable'; +export * as secmasterPlaybookInstanceOperation from './secmaster-playbook-instance-operation'; +export * as secmasterPlaybookRule from './secmaster-playbook-rule'; +export * as secmasterPlaybookVersion from './secmaster-playbook-version'; +export * as secmasterPlaybookVersionAction from './secmaster-playbook-version-action'; +export * as servicestageApplication from './servicestage-application'; +export * as servicestageComponent from './servicestage-component'; +export * as servicestageComponentInstance from './servicestage-component-instance'; +export * as servicestageEnvironment from './servicestage-environment'; +export * as servicestageRepoPasswordAuthorization from './servicestage-repo-password-authorization'; +export * as servicestageRepoTokenAuthorization from './servicestage-repo-token-authorization'; +export * as servicestagev3Application from './servicestagev3-application'; +export * as servicestagev3Component from './servicestagev3-component'; +export * as servicestagev3Environment from './servicestagev3-environment'; +export * as servicestagev3EnvironmentAssociate from './servicestagev3-environment-associate'; +export * as sfsAccessRule from './sfs-access-rule'; +export * as sfsAccessRuleV2 from './sfs-access-rule-v2'; +export * as sfsFileSystem from './sfs-file-system'; +export * as sfsFileSystemV2 from './sfs-file-system-v2'; +export * as sfsTurbo from './sfs-turbo'; +export * as sfsTurboDataTask from './sfs-turbo-data-task'; +export * as sfsTurboDir from './sfs-turbo-dir'; +export * as sfsTurboDirQuota from './sfs-turbo-dir-quota'; +export * as sfsTurboDuTask from './sfs-turbo-du-task'; +export * as sfsTurboObsTarget from './sfs-turbo-obs-target'; +export * as sfsTurboPermRule from './sfs-turbo-perm-rule'; +export * as smnLogtank from './smn-logtank'; +export * as smnMessageDetection from './smn-message-detection'; +export * as smnMessagePublish from './smn-message-publish'; +export * as smnMessageTemplate from './smn-message-template'; +export * as smnSubscription from './smn-subscription'; +export * as smnSubscriptionFilterPolicy from './smn-subscription-filter-policy'; +export * as smnSubscriptionV2 from './smn-subscription-v2'; +export * as smnTopic from './smn-topic'; +export * as smnTopicV2 from './smn-topic-v2'; +export * as smsServerTemplate from './sms-server-template'; +export * as smsTask from './sms-task'; +export * as swrImageAutoSync from './swr-image-auto-sync'; +export * as swrImagePermissions from './swr-image-permissions'; +export * as swrImageRetentionPolicy from './swr-image-retention-policy'; +export * as swrImageTrigger from './swr-image-trigger'; +export * as swrOrganization from './swr-organization'; +export * as swrOrganizationPermissions from './swr-organization-permissions'; +export * as swrRepository from './swr-repository'; +export * as swrRepositorySharing from './swr-repository-sharing'; +export * as tmsResourceTags from './tms-resource-tags'; +export * as tmsTags from './tms-tags'; +export * as ucsCluster from './ucs-cluster'; +export * as ucsFleet from './ucs-fleet'; +export * as ucsPolicy from './ucs-policy'; +export * as vbsBackup from './vbs-backup'; +export * as vbsBackupPolicy from './vbs-backup-policy'; +export * as vbsBackupPolicyV2 from './vbs-backup-policy-v2'; +export * as vbsBackupV2 from './vbs-backup-v2'; +export * as vodMediaAsset from './vod-media-asset'; +export * as vodMediaCategory from './vod-media-category'; +export * as vodTranscodingTemplateGroup from './vod-transcoding-template-group'; +export * as vodWatermarkTemplate from './vod-watermark-template'; +export * as vpc from './vpc'; +export * as vpcAddressGroup from './vpc-address-group'; +export * as vpcBandwidth from './vpc-bandwidth'; +export * as vpcBandwidthAssociate from './vpc-bandwidth-associate'; +export * as vpcBandwidthV2 from './vpc-bandwidth-v2'; +export * as vpcEip from './vpc-eip'; +export * as vpcEipAssociate from './vpc-eip-associate'; +export * as vpcEipV1 from './vpc-eip-v1'; +export * as vpcEipv3Associate from './vpc-eipv3-associate'; +export * as vpcFlowLog from './vpc-flow-log'; +export * as vpcInternetGateway from './vpc-internet-gateway'; +export * as vpcNetworkAcl from './vpc-network-acl'; +export * as vpcNetworkInterface from './vpc-network-interface'; +export * as vpcPeeringConnection from './vpc-peering-connection'; +export * as vpcPeeringConnectionAccepter from './vpc-peering-connection-accepter'; +export * as vpcPeeringConnectionAccepterV2 from './vpc-peering-connection-accepter-v2'; +export * as vpcPeeringConnectionV2 from './vpc-peering-connection-v2'; +export * as vpcRoute from './vpc-route'; +export * as vpcRouteTable from './vpc-route-table'; +export * as vpcRouteV2 from './vpc-route-v2'; +export * as vpcSubNetworkInterface from './vpc-sub-network-interface'; +export * as vpcSubnet from './vpc-subnet'; +export * as vpcSubnetV1 from './vpc-subnet-v1'; +export * as vpcTrafficMirrorFilter from './vpc-traffic-mirror-filter'; +export * as vpcTrafficMirrorFilterRule from './vpc-traffic-mirror-filter-rule'; +export * as vpcTrafficMirrorSession from './vpc-traffic-mirror-session'; +export * as vpcV1 from './vpc-v1'; +export * as vpcepApproval from './vpcep-approval'; +export * as vpcepEndpoint from './vpcep-endpoint'; +export * as vpcepService from './vpcep-service'; +export * as vpnAccessPolicy from './vpn-access-policy'; +export * as vpnClientCaCertificate from './vpn-client-ca-certificate'; +export * as vpnConnection from './vpn-connection'; +export * as vpnConnectionHealthCheck from './vpn-connection-health-check'; +export * as vpnCustomerGateway from './vpn-customer-gateway'; +export * as vpnGateway from './vpn-gateway'; +export * as vpnUser from './vpn-user'; +export * as vpnUserGroup from './vpn-user-group'; +export * as vpnaasEndpointGroup from './vpnaas-endpoint-group'; +export * as vpnaasEndpointGroupV2 from './vpnaas-endpoint-group-v2'; +export * as vpnaasIkePolicy from './vpnaas-ike-policy'; +export * as vpnaasIkePolicyV2 from './vpnaas-ike-policy-v2'; +export * as vpnaasIpsecPolicy from './vpnaas-ipsec-policy'; +export * as vpnaasIpsecPolicyV2 from './vpnaas-ipsec-policy-v2'; +export * as vpnaasService from './vpnaas-service'; +export * as vpnaasServiceV2 from './vpnaas-service-v2'; +export * as vpnaasSiteConnection from './vpnaas-site-connection'; +export * as vpnaasSiteConnectionV2 from './vpnaas-site-connection-v2'; +export * as wafAddressGroup from './waf-address-group'; +export * as wafCertificate from './waf-certificate'; +export * as wafCloudInstance from './waf-cloud-instance'; +export * as wafDedicatedDomain from './waf-dedicated-domain'; +export * as wafDedicatedInstance from './waf-dedicated-instance'; +export * as wafDomain from './waf-domain'; +export * as wafInstanceGroup from './waf-instance-group'; +export * as wafInstanceGroupAssociate from './waf-instance-group-associate'; +export * as wafPolicy from './waf-policy'; +export * as wafReferenceTable from './waf-reference-table'; +export * as wafRuleAntiCrawler from './waf-rule-anti-crawler'; +export * as wafRuleBlacklist from './waf-rule-blacklist'; +export * as wafRuleCcProtection from './waf-rule-cc-protection'; +export * as wafRuleDataMasking from './waf-rule-data-masking'; +export * as wafRuleGeolocationAccessControl from './waf-rule-geolocation-access-control'; +export * as wafRuleGlobalProtectionWhitelist from './waf-rule-global-protection-whitelist'; +export * as wafRuleInformationLeakagePrevention from './waf-rule-information-leakage-prevention'; +export * as wafRuleKnownAttackSource from './waf-rule-known-attack-source'; +export * as wafRulePreciseProtection from './waf-rule-precise-protection'; +export * as wafRuleWebTamperProtection from './waf-rule-web-tamper-protection'; +export * as workspaceAccessPolicy from './workspace-access-policy'; +export * as workspaceAppGroup from './workspace-app-group'; +export * as workspaceAppGroupAuthorization from './workspace-app-group-authorization'; +export * as workspaceAppImage from './workspace-app-image'; +export * as workspaceAppImageServer from './workspace-app-image-server'; +export * as workspaceAppNasStorage from './workspace-app-nas-storage'; +export * as workspaceAppPersonalFolders from './workspace-app-personal-folders'; +export * as workspaceAppPolicyGroup from './workspace-app-policy-group'; +export * as workspaceAppPublishment from './workspace-app-publishment'; +export * as workspaceAppServer from './workspace-app-server'; +export * as workspaceAppServerGroup from './workspace-app-server-group'; +export * as workspaceAppSharedFolder from './workspace-app-shared-folder'; +export * as workspaceAppStoragePolicy from './workspace-app-storage-policy'; +export * as workspaceAppWarehouseApp from './workspace-app-warehouse-app'; +export * as workspaceDesktop from './workspace-desktop'; +export * as workspaceDesktopNameRule from './workspace-desktop-name-rule'; +export * as workspaceEipAssociate from './workspace-eip-associate'; +export * as workspacePolicyGroup from './workspace-policy-group'; +export * as workspaceService from './workspace-service'; +export * as workspaceTerminalBinding from './workspace-terminal-binding'; +export * as workspaceUser from './workspace-user'; +export * as workspaceUserGroup from './workspace-user-group'; +export * as dataHuaweicloudAccount from './data-huaweicloud-account'; +export * as dataHuaweicloudAntiddos from './data-huaweicloud-antiddos'; +export * as dataHuaweicloudAntiddosConfigRanges from './data-huaweicloud-antiddos-config-ranges'; +export * as dataHuaweicloudAntiddosEipDefenseStatuses from './data-huaweicloud-antiddos-eip-defense-statuses'; +export * as dataHuaweicloudAntiddosV1 from './data-huaweicloud-antiddos-v1'; +export * as dataHuaweicloudAntiddosWeeklyProtectionStatistics from './data-huaweicloud-antiddos-weekly-protection-statistics'; +export * as dataHuaweicloudAomAggregationMetrics from './data-huaweicloud-aom-aggregation-metrics'; +export * as dataHuaweicloudAomAlarmActionRules from './data-huaweicloud-aom-alarm-action-rules'; +export * as dataHuaweicloudAomAlarmGroupRules from './data-huaweicloud-aom-alarm-group-rules'; +export * as dataHuaweicloudAomAlarmRules from './data-huaweicloud-aom-alarm-rules'; +export * as dataHuaweicloudAomAlarmRulesTemplates from './data-huaweicloud-aom-alarm-rules-templates'; +export * as dataHuaweicloudAomAlarmSilenceRules from './data-huaweicloud-aom-alarm-silence-rules'; +export * as dataHuaweicloudAomDashboards from './data-huaweicloud-aom-dashboards'; +export * as dataHuaweicloudAomDashboardsFolders from './data-huaweicloud-aom-dashboards-folders'; +export * as dataHuaweicloudAomMessageTemplates from './data-huaweicloud-aom-message-templates'; +export * as dataHuaweicloudAomMultiAccountAggregationRules from './data-huaweicloud-aom-multi-account-aggregation-rules'; +export * as dataHuaweicloudAomOrganizationAccounts from './data-huaweicloud-aom-organization-accounts'; +export * as dataHuaweicloudAomPromInstances from './data-huaweicloud-aom-prom-instances'; +export * as dataHuaweicloudAomServiceDiscoveryRules from './data-huaweicloud-aom-service-discovery-rules'; +export * as dataHuaweicloudApigAclPolicies from './data-huaweicloud-apig-acl-policies'; +export * as dataHuaweicloudApigApi from './data-huaweicloud-apig-api'; +export * as dataHuaweicloudApigApiAssociatedAclPolicies from './data-huaweicloud-apig-api-associated-acl-policies'; +export * as dataHuaweicloudApigApiAssociatedApplications from './data-huaweicloud-apig-api-associated-applications'; +export * as dataHuaweicloudApigApiAssociatedPlugins from './data-huaweicloud-apig-api-associated-plugins'; +export * as dataHuaweicloudApigApiAssociatedSignatures from './data-huaweicloud-apig-api-associated-signatures'; +export * as dataHuaweicloudApigApiAssociatedThrottlingPolicies from './data-huaweicloud-apig-api-associated-throttling-policies'; +export * as dataHuaweicloudApigApiBasicConfigurations from './data-huaweicloud-apig-api-basic-configurations'; +export * as dataHuaweicloudApigAppcodes from './data-huaweicloud-apig-appcodes'; +export * as dataHuaweicloudApigApplicationAcl from './data-huaweicloud-apig-application-acl'; +export * as dataHuaweicloudApigApplicationQuotas from './data-huaweicloud-apig-application-quotas'; +export * as dataHuaweicloudApigApplications from './data-huaweicloud-apig-applications'; +export * as dataHuaweicloudApigChannels from './data-huaweicloud-apig-channels'; +export * as dataHuaweicloudApigCustomAuthorizers from './data-huaweicloud-apig-custom-authorizers'; +export * as dataHuaweicloudApigEndpointConnections from './data-huaweicloud-apig-endpoint-connections'; +export * as dataHuaweicloudApigEnvironmentVariables from './data-huaweicloud-apig-environment-variables'; +export * as dataHuaweicloudApigEnvironments from './data-huaweicloud-apig-environments'; +export * as dataHuaweicloudApigGroups from './data-huaweicloud-apig-groups'; +export * as dataHuaweicloudApigInstanceFeatures from './data-huaweicloud-apig-instance-features'; +export * as dataHuaweicloudApigInstanceSupportedFeatures from './data-huaweicloud-apig-instance-supported-features'; +export * as dataHuaweicloudApigInstances from './data-huaweicloud-apig-instances'; +export * as dataHuaweicloudApigSignatures from './data-huaweicloud-apig-signatures'; +export * as dataHuaweicloudApigThrottlingPolicies from './data-huaweicloud-apig-throttling-policies'; +export * as dataHuaweicloudAsActivityLogs from './data-huaweicloud-as-activity-logs'; +export * as dataHuaweicloudAsConfigurations from './data-huaweicloud-as-configurations'; +export * as dataHuaweicloudAsGroupQuotas from './data-huaweicloud-as-group-quotas'; +export * as dataHuaweicloudAsGroups from './data-huaweicloud-as-groups'; +export * as dataHuaweicloudAsHookInstances from './data-huaweicloud-as-hook-instances'; +export * as dataHuaweicloudAsInstances from './data-huaweicloud-as-instances'; +export * as dataHuaweicloudAsLifecycleHooks from './data-huaweicloud-as-lifecycle-hooks'; +export * as dataHuaweicloudAsNotifications from './data-huaweicloud-as-notifications'; +export * as dataHuaweicloudAsPlannedTasks from './data-huaweicloud-as-planned-tasks'; +export * as dataHuaweicloudAsPolicies from './data-huaweicloud-as-policies'; +export * as dataHuaweicloudAsPolicyExecuteLogs from './data-huaweicloud-as-policy-execute-logs'; +export * as dataHuaweicloudAsQuotas from './data-huaweicloud-as-quotas'; +export * as dataHuaweicloudAvailabilityZones from './data-huaweicloud-availability-zones'; +export * as dataHuaweicloudBmsFlavors from './data-huaweicloud-bms-flavors'; +export * as dataHuaweicloudBmsInstances from './data-huaweicloud-bms-instances'; +export * as dataHuaweicloudCaeApplications from './data-huaweicloud-cae-applications'; +export * as dataHuaweicloudCaeEnvironments from './data-huaweicloud-cae-environments'; +export * as dataHuaweicloudCbhAvailabilityZones from './data-huaweicloud-cbh-availability-zones'; +export * as dataHuaweicloudCbhFlavors from './data-huaweicloud-cbh-flavors'; +export * as dataHuaweicloudCbhInstances from './data-huaweicloud-cbh-instances'; +export * as dataHuaweicloudCbrBackup from './data-huaweicloud-cbr-backup'; +export * as dataHuaweicloudCbrPolicies from './data-huaweicloud-cbr-policies'; +export * as dataHuaweicloudCbrVaults from './data-huaweicloud-cbr-vaults'; +export * as dataHuaweicloudCcAuthorizations from './data-huaweicloud-cc-authorizations'; +export * as dataHuaweicloudCcBandwidthPackages from './data-huaweicloud-cc-bandwidth-packages'; +export * as dataHuaweicloudCcCentralNetworkAttachments from './data-huaweicloud-cc-central-network-attachments'; +export * as dataHuaweicloudCcCentralNetworkCapabilities from './data-huaweicloud-cc-central-network-capabilities'; +export * as dataHuaweicloudCcCentralNetworkConnections from './data-huaweicloud-cc-central-network-connections'; +export * as dataHuaweicloudCcCentralNetworkPolicies from './data-huaweicloud-cc-central-network-policies'; +export * as dataHuaweicloudCcCentralNetworkPoliciesChangeSet from './data-huaweicloud-cc-central-network-policies-change-set'; +export * as dataHuaweicloudCcCentralNetworkQuotas from './data-huaweicloud-cc-central-network-quotas'; +export * as dataHuaweicloudCcCentralNetworks from './data-huaweicloud-cc-central-networks'; +export * as dataHuaweicloudCcConnectionRoutes from './data-huaweicloud-cc-connection-routes'; +export * as dataHuaweicloudCcConnectionTags from './data-huaweicloud-cc-connection-tags'; +export * as dataHuaweicloudCcConnections from './data-huaweicloud-cc-connections'; +export * as dataHuaweicloudCcGlobalConnectionBandwidthLineLevels from './data-huaweicloud-cc-global-connection-bandwidth-line-levels'; +export * as dataHuaweicloudCcGlobalConnectionBandwidthSites from './data-huaweicloud-cc-global-connection-bandwidth-sites'; +export * as dataHuaweicloudCcGlobalConnectionBandwidthSpecCodes from './data-huaweicloud-cc-global-connection-bandwidth-spec-codes'; +export * as dataHuaweicloudCcGlobalConnectionBandwidths from './data-huaweicloud-cc-global-connection-bandwidths'; +export * as dataHuaweicloudCcInterRegionBandwidths from './data-huaweicloud-cc-inter-region-bandwidths'; +export * as dataHuaweicloudCcNetworkInstances from './data-huaweicloud-cc-network-instances'; +export * as dataHuaweicloudCcPermissions from './data-huaweicloud-cc-permissions'; +export * as dataHuaweicloudCcSupportBindingGlobalConnectionBandwidths from './data-huaweicloud-cc-support-binding-global-connection-bandwidths'; +export * as dataHuaweicloudCceAddonTemplate from './data-huaweicloud-cce-addon-template'; +export * as dataHuaweicloudCceCluster from './data-huaweicloud-cce-cluster'; +export * as dataHuaweicloudCceClusterCertificate from './data-huaweicloud-cce-cluster-certificate'; +export * as dataHuaweicloudCceClusterOpenidJwks from './data-huaweicloud-cce-cluster-openid-jwks'; +export * as dataHuaweicloudCceClusterV3 from './data-huaweicloud-cce-cluster-v3'; +export * as dataHuaweicloudCceClusters from './data-huaweicloud-cce-clusters'; +export * as dataHuaweicloudCceNode from './data-huaweicloud-cce-node'; +export * as dataHuaweicloudCceNodePool from './data-huaweicloud-cce-node-pool'; +export * as dataHuaweicloudCceNodeV3 from './data-huaweicloud-cce-node-v3'; +export * as dataHuaweicloudCceNodes from './data-huaweicloud-cce-nodes'; +export * as dataHuaweicloudCciNamespaces from './data-huaweicloud-cci-namespaces'; +export * as dataHuaweicloudCcmCertificateExport from './data-huaweicloud-ccm-certificate-export'; +export * as dataHuaweicloudCcmCertificates from './data-huaweicloud-ccm-certificates'; +export * as dataHuaweicloudCcmPrivateCaExport from './data-huaweicloud-ccm-private-ca-export'; +export * as dataHuaweicloudCcmPrivateCas from './data-huaweicloud-ccm-private-cas'; +export * as dataHuaweicloudCcmPrivateCertificateExport from './data-huaweicloud-ccm-private-certificate-export'; +export * as dataHuaweicloudCcmPrivateCertificates from './data-huaweicloud-ccm-private-certificates'; +export * as dataHuaweicloudCdmClusters from './data-huaweicloud-cdm-clusters'; +export * as dataHuaweicloudCdmFlavors from './data-huaweicloud-cdm-flavors'; +export * as dataHuaweicloudCdmFlavorsV1 from './data-huaweicloud-cdm-flavors-v1'; +export * as dataHuaweicloudCdmJobExecutionRecords from './data-huaweicloud-cdm-job-execution-records'; +export * as dataHuaweicloudCdnAnalytics from './data-huaweicloud-cdn-analytics'; +export * as dataHuaweicloudCdnBillingOption from './data-huaweicloud-cdn-billing-option'; +export * as dataHuaweicloudCdnCacheHistoryTasks from './data-huaweicloud-cdn-cache-history-tasks'; +export * as dataHuaweicloudCdnCacheUrlTasks from './data-huaweicloud-cdn-cache-url-tasks'; +export * as dataHuaweicloudCdnDomainCertificates from './data-huaweicloud-cdn-domain-certificates'; +export * as dataHuaweicloudCdnDomainStatistics from './data-huaweicloud-cdn-domain-statistics'; +export * as dataHuaweicloudCdnDomains from './data-huaweicloud-cdn-domains'; +export * as dataHuaweicloudCdnLogs from './data-huaweicloud-cdn-logs'; +export * as dataHuaweicloudCesAgentDimensions from './data-huaweicloud-ces-agent-dimensions'; +export * as dataHuaweicloudCesAlarmTemplates from './data-huaweicloud-ces-alarm-templates'; +export * as dataHuaweicloudCesAlarmrules from './data-huaweicloud-ces-alarmrules'; +export * as dataHuaweicloudCesDashboardWidgets from './data-huaweicloud-ces-dashboard-widgets'; +export * as dataHuaweicloudCesDashboards from './data-huaweicloud-ces-dashboards'; +export * as dataHuaweicloudCesEventDetails from './data-huaweicloud-ces-event-details'; +export * as dataHuaweicloudCesEvents from './data-huaweicloud-ces-events'; +export * as dataHuaweicloudCesMetrics from './data-huaweicloud-ces-metrics'; +export * as dataHuaweicloudCesOneClickAlarmRules from './data-huaweicloud-ces-one-click-alarm-rules'; +export * as dataHuaweicloudCesOneClickAlarms from './data-huaweicloud-ces-one-click-alarms'; +export * as dataHuaweicloudCesResourceGroupServiceResources from './data-huaweicloud-ces-resource-group-service-resources'; +export * as dataHuaweicloudCesResourceGroups from './data-huaweicloud-ces-resource-groups'; +export * as dataHuaweicloudCfwAccessControlLogs from './data-huaweicloud-cfw-access-control-logs'; +export * as dataHuaweicloudCfwAddressGroupMembers from './data-huaweicloud-cfw-address-group-members'; +export * as dataHuaweicloudCfwAddressGroups from './data-huaweicloud-cfw-address-groups'; +export * as dataHuaweicloudCfwAttackLogs from './data-huaweicloud-cfw-attack-logs'; +export * as dataHuaweicloudCfwBlackWhiteLists from './data-huaweicloud-cfw-black-white-lists'; +export * as dataHuaweicloudCfwCaptureTaskResults from './data-huaweicloud-cfw-capture-task-results'; +export * as dataHuaweicloudCfwCaptureTasks from './data-huaweicloud-cfw-capture-tasks'; +export * as dataHuaweicloudCfwDomainNameGroups from './data-huaweicloud-cfw-domain-name-groups'; +export * as dataHuaweicloudCfwFirewalls from './data-huaweicloud-cfw-firewalls'; +export * as dataHuaweicloudCfwFlowLogs from './data-huaweicloud-cfw-flow-logs'; +export * as dataHuaweicloudCfwProtectionRules from './data-huaweicloud-cfw-protection-rules'; +export * as dataHuaweicloudCfwServiceGroupMembers from './data-huaweicloud-cfw-service-group-members'; +export * as dataHuaweicloudCfwServiceGroups from './data-huaweicloud-cfw-service-groups'; +export * as dataHuaweicloudCnadAdvancedAvailableObjects from './data-huaweicloud-cnad-advanced-available-objects'; +export * as dataHuaweicloudCnadAdvancedInstances from './data-huaweicloud-cnad-advanced-instances'; +export * as dataHuaweicloudCnadAdvancedProtectedObjects from './data-huaweicloud-cnad-advanced-protected-objects'; +export * as dataHuaweicloudComputeAvailabilityZonesV2 from './data-huaweicloud-compute-availability-zones-v2'; +export * as dataHuaweicloudComputeFlavors from './data-huaweicloud-compute-flavors'; +export * as dataHuaweicloudComputeInstance from './data-huaweicloud-compute-instance'; +export * as dataHuaweicloudComputeInstanceRemoteConsole from './data-huaweicloud-compute-instance-remote-console'; +export * as dataHuaweicloudComputeInstances from './data-huaweicloud-compute-instances'; +export * as dataHuaweicloudComputeServergroups from './data-huaweicloud-compute-servergroups'; +export * as dataHuaweicloudCphEncodeServers from './data-huaweicloud-cph-encode-servers'; +export * as dataHuaweicloudCphPhoneCustomImages from './data-huaweicloud-cph-phone-custom-images'; +export * as dataHuaweicloudCphPhoneFlavors from './data-huaweicloud-cph-phone-flavors'; +export * as dataHuaweicloudCphPhoneImages from './data-huaweicloud-cph-phone-images'; +export * as dataHuaweicloudCphPhones from './data-huaweicloud-cph-phones'; +export * as dataHuaweicloudCphServerBandwidths from './data-huaweicloud-cph-server-bandwidths'; +export * as dataHuaweicloudCphServerFlavors from './data-huaweicloud-cph-server-flavors'; +export * as dataHuaweicloudCphServers from './data-huaweicloud-cph-servers'; +export * as dataHuaweicloudCsbsBackup from './data-huaweicloud-csbs-backup'; +export * as dataHuaweicloudCsbsBackupPolicy from './data-huaweicloud-csbs-backup-policy'; +export * as dataHuaweicloudCsbsBackupPolicyV1 from './data-huaweicloud-csbs-backup-policy-v1'; +export * as dataHuaweicloudCsbsBackupV1 from './data-huaweicloud-csbs-backup-v1'; +export * as dataHuaweicloudCseMicroserviceEngineFlavors from './data-huaweicloud-cse-microservice-engine-flavors'; +export * as dataHuaweicloudCseMicroserviceEngines from './data-huaweicloud-cse-microservice-engines'; +export * as dataHuaweicloudCsmsEvents from './data-huaweicloud-csms-events'; +export * as dataHuaweicloudCsmsSecretVersion from './data-huaweicloud-csms-secret-version'; +export * as dataHuaweicloudCsmsSecretVersions from './data-huaweicloud-csms-secret-versions'; +export * as dataHuaweicloudCsmsSecrets from './data-huaweicloud-csms-secrets'; +export * as dataHuaweicloudCssClusterTags from './data-huaweicloud-css-cluster-tags'; +export * as dataHuaweicloudCssClusters from './data-huaweicloud-css-clusters'; +export * as dataHuaweicloudCssElbLoadbalancers from './data-huaweicloud-css-elb-loadbalancers'; +export * as dataHuaweicloudCssFlavors from './data-huaweicloud-css-flavors'; +export * as dataHuaweicloudCssLogBackupRecords from './data-huaweicloud-css-log-backup-records'; +export * as dataHuaweicloudCssLogstashCertificates from './data-huaweicloud-css-logstash-certificates'; +export * as dataHuaweicloudCssLogstashConfigurations from './data-huaweicloud-css-logstash-configurations'; +export * as dataHuaweicloudCssLogstashPipelineActions from './data-huaweicloud-css-logstash-pipeline-actions'; +export * as dataHuaweicloudCssLogstashPipelines from './data-huaweicloud-css-logstash-pipelines'; +export * as dataHuaweicloudCssLogstashTemplates from './data-huaweicloud-css-logstash-templates'; +export * as dataHuaweicloudCssScanTasks from './data-huaweicloud-css-scan-tasks'; +export * as dataHuaweicloudCssSnapshots from './data-huaweicloud-css-snapshots'; +export * as dataHuaweicloudCssUpgradeTargetImages from './data-huaweicloud-css-upgrade-target-images'; +export * as dataHuaweicloudCtsNotifications from './data-huaweicloud-cts-notifications'; +export * as dataHuaweicloudCtsTraces from './data-huaweicloud-cts-traces'; +export * as dataHuaweicloudCtsTracker from './data-huaweicloud-cts-tracker'; +export * as dataHuaweicloudCtsTrackers from './data-huaweicloud-cts-trackers'; +export * as dataHuaweicloudDataartsArchitectureDsTemplateOptionals from './data-huaweicloud-dataarts-architecture-ds-template-optionals'; +export * as dataHuaweicloudDataartsArchitectureModelStatistic from './data-huaweicloud-dataarts-architecture-model-statistic'; +export * as dataHuaweicloudDataartsArchitectureTableModels from './data-huaweicloud-dataarts-architecture-table-models'; +export * as dataHuaweicloudDataartsDataserviceApis from './data-huaweicloud-dataarts-dataservice-apis'; +export * as dataHuaweicloudDataartsDataserviceApps from './data-huaweicloud-dataarts-dataservice-apps'; +export * as dataHuaweicloudDataartsDataserviceAuthorizedApps from './data-huaweicloud-dataarts-dataservice-authorized-apps'; +export * as dataHuaweicloudDataartsDataserviceInstances from './data-huaweicloud-dataarts-dataservice-instances'; +export * as dataHuaweicloudDataartsDataserviceMessages from './data-huaweicloud-dataarts-dataservice-messages'; +export * as dataHuaweicloudDataartsFactoryJobs from './data-huaweicloud-dataarts-factory-jobs'; +export * as dataHuaweicloudDataartsQualityTasks from './data-huaweicloud-dataarts-quality-tasks'; +export * as dataHuaweicloudDataartsStudioDataConnections from './data-huaweicloud-dataarts-studio-data-connections'; +export * as dataHuaweicloudDataartsStudioWorkspaces from './data-huaweicloud-dataarts-studio-workspaces'; +export * as dataHuaweicloudDbssAuditDataMaskingRules from './data-huaweicloud-dbss-audit-data-masking-rules'; +export * as dataHuaweicloudDbssAuditRiskRules from './data-huaweicloud-dbss-audit-risk-rules'; +export * as dataHuaweicloudDbssAuditRuleScopes from './data-huaweicloud-dbss-audit-rule-scopes'; +export * as dataHuaweicloudDbssAuditSqlInjectionRules from './data-huaweicloud-dbss-audit-sql-injection-rules'; +export * as dataHuaweicloudDbssAvailabilityZones from './data-huaweicloud-dbss-availability-zones'; +export * as dataHuaweicloudDbssDatabases from './data-huaweicloud-dbss-databases'; +export * as dataHuaweicloudDbssFlavors from './data-huaweicloud-dbss-flavors'; +export * as dataHuaweicloudDbssInstances from './data-huaweicloud-dbss-instances'; +export * as dataHuaweicloudDbssOperationLogs from './data-huaweicloud-dbss-operation-logs'; +export * as dataHuaweicloudDbssRdsDatabases from './data-huaweicloud-dbss-rds-databases'; +export * as dataHuaweicloudDcConnections from './data-huaweicloud-dc-connections'; +export * as dataHuaweicloudDcQuotas from './data-huaweicloud-dc-quotas'; +export * as dataHuaweicloudDcVirtualGateways from './data-huaweicloud-dc-virtual-gateways'; +export * as dataHuaweicloudDcVirtualInterfaces from './data-huaweicloud-dc-virtual-interfaces'; +export * as dataHuaweicloudDcsAccounts from './data-huaweicloud-dcs-accounts'; +export * as dataHuaweicloudDcsAz from './data-huaweicloud-dcs-az'; +export * as dataHuaweicloudDcsAzV1 from './data-huaweicloud-dcs-az-v1'; +export * as dataHuaweicloudDcsBackups from './data-huaweicloud-dcs-backups'; +export * as dataHuaweicloudDcsBigkeyAnalyses from './data-huaweicloud-dcs-bigkey-analyses'; +export * as dataHuaweicloudDcsDiagnosisTasks from './data-huaweicloud-dcs-diagnosis-tasks'; +export * as dataHuaweicloudDcsFlavors from './data-huaweicloud-dcs-flavors'; +export * as dataHuaweicloudDcsHotkeyAnalyses from './data-huaweicloud-dcs-hotkey-analyses'; +export * as dataHuaweicloudDcsInstances from './data-huaweicloud-dcs-instances'; +export * as dataHuaweicloudDcsMaintainwindow from './data-huaweicloud-dcs-maintainwindow'; +export * as dataHuaweicloudDcsMaintainwindowV1 from './data-huaweicloud-dcs-maintainwindow-v1'; +export * as dataHuaweicloudDcsProduct from './data-huaweicloud-dcs-product'; +export * as dataHuaweicloudDcsProductV1 from './data-huaweicloud-dcs-product-v1'; +export * as dataHuaweicloudDcsTemplateDetail from './data-huaweicloud-dcs-template-detail'; +export * as dataHuaweicloudDcsTemplates from './data-huaweicloud-dcs-templates'; +export * as dataHuaweicloudDdmAccounts from './data-huaweicloud-ddm-accounts'; +export * as dataHuaweicloudDdmEngines from './data-huaweicloud-ddm-engines'; +export * as dataHuaweicloudDdmFlavors from './data-huaweicloud-ddm-flavors'; +export * as dataHuaweicloudDdmInstanceAvailableVersions from './data-huaweicloud-ddm-instance-available-versions'; +export * as dataHuaweicloudDdmInstanceGroups from './data-huaweicloud-ddm-instance-groups'; +export * as dataHuaweicloudDdmInstanceNodes from './data-huaweicloud-ddm-instance-nodes'; +export * as dataHuaweicloudDdmInstances from './data-huaweicloud-ddm-instances'; +export * as dataHuaweicloudDdmKillingSessionsAuditLogs from './data-huaweicloud-ddm-killing-sessions-audit-logs'; +export * as dataHuaweicloudDdmLogicalSessions from './data-huaweicloud-ddm-logical-sessions'; +export * as dataHuaweicloudDdmPhysicalSessions from './data-huaweicloud-ddm-physical-sessions'; +export * as dataHuaweicloudDdmSchemas from './data-huaweicloud-ddm-schemas'; +export * as dataHuaweicloudDdsAuditLogLinks from './data-huaweicloud-dds-audit-log-links'; +export * as dataHuaweicloudDdsAuditLogs from './data-huaweicloud-dds-audit-logs'; +export * as dataHuaweicloudDdsBackupDownloadLinks from './data-huaweicloud-dds-backup-download-links'; +export * as dataHuaweicloudDdsBackups from './data-huaweicloud-dds-backups'; +export * as dataHuaweicloudDdsDatabaseRoles from './data-huaweicloud-dds-database-roles'; +export * as dataHuaweicloudDdsDatabaseUsers from './data-huaweicloud-dds-database-users'; +export * as dataHuaweicloudDdsDatabaseVersions from './data-huaweicloud-dds-database-versions'; +export * as dataHuaweicloudDdsDatabases from './data-huaweicloud-dds-databases'; +export * as dataHuaweicloudDdsErrorLogLinks from './data-huaweicloud-dds-error-log-links'; +export * as dataHuaweicloudDdsErrorLogs from './data-huaweicloud-dds-error-logs'; +export * as dataHuaweicloudDdsFlavors from './data-huaweicloud-dds-flavors'; +export * as dataHuaweicloudDdsFlavorsV3 from './data-huaweicloud-dds-flavors-v3'; +export * as dataHuaweicloudDdsInstances from './data-huaweicloud-dds-instances'; +export * as dataHuaweicloudDdsInstantTasks from './data-huaweicloud-dds-instant-tasks'; +export * as dataHuaweicloudDdsMigrateAvailabilityZones from './data-huaweicloud-dds-migrate-availability-zones'; +export * as dataHuaweicloudDdsParameterTemplates from './data-huaweicloud-dds-parameter-templates'; +export * as dataHuaweicloudDdsPtApplicableInstances from './data-huaweicloud-dds-pt-applicable-instances'; +export * as dataHuaweicloudDdsPtApplicationRecords from './data-huaweicloud-dds-pt-application-records'; +export * as dataHuaweicloudDdsPtModificationRecords from './data-huaweicloud-dds-pt-modification-records'; +export * as dataHuaweicloudDdsQuotas from './data-huaweicloud-dds-quotas'; +export * as dataHuaweicloudDdsRecycleInstances from './data-huaweicloud-dds-recycle-instances'; +export * as dataHuaweicloudDdsRestoreCollections from './data-huaweicloud-dds-restore-collections'; +export * as dataHuaweicloudDdsRestoreDatabases from './data-huaweicloud-dds-restore-databases'; +export * as dataHuaweicloudDdsRestoreTimeRanges from './data-huaweicloud-dds-restore-time-ranges'; +export * as dataHuaweicloudDdsScheduledTasks from './data-huaweicloud-dds-scheduled-tasks'; +export * as dataHuaweicloudDdsSlowLogLinks from './data-huaweicloud-dds-slow-log-links'; +export * as dataHuaweicloudDdsSlowLogs from './data-huaweicloud-dds-slow-logs'; +export * as dataHuaweicloudDdsSslCertDownloadLinks from './data-huaweicloud-dds-ssl-cert-download-links'; +export * as dataHuaweicloudDdsStorageTypes from './data-huaweicloud-dds-storage-types'; +export * as dataHuaweicloudDliDatasourceAuths from './data-huaweicloud-dli-datasource-auths'; +export * as dataHuaweicloudDliDatasourceConnections from './data-huaweicloud-dli-datasource-connections'; +export * as dataHuaweicloudDliElasticResourcePools from './data-huaweicloud-dli-elastic-resource-pools'; +export * as dataHuaweicloudDliFlinkTemplates from './data-huaweicloud-dli-flink-templates'; +export * as dataHuaweicloudDliFlinkjarJobs from './data-huaweicloud-dli-flinkjar-jobs'; +export * as dataHuaweicloudDliFlinksqlJobs from './data-huaweicloud-dli-flinksql-jobs'; +export * as dataHuaweicloudDliQuotas from './data-huaweicloud-dli-quotas'; +export * as dataHuaweicloudDliSparkTemplates from './data-huaweicloud-dli-spark-templates'; +export * as dataHuaweicloudDliSqlJobs from './data-huaweicloud-dli-sql-jobs'; +export * as dataHuaweicloudDliSqlTemplates from './data-huaweicloud-dli-sql-templates'; +export * as dataHuaweicloudDmsAz from './data-huaweicloud-dms-az'; +export * as dataHuaweicloudDmsAzV1 from './data-huaweicloud-dms-az-v1'; +export * as dataHuaweicloudDmsKafkaBackgroundTasks from './data-huaweicloud-dms-kafka-background-tasks'; +export * as dataHuaweicloudDmsKafkaConsumerGroups from './data-huaweicloud-dms-kafka-consumer-groups'; +export * as dataHuaweicloudDmsKafkaExtendFlavors from './data-huaweicloud-dms-kafka-extend-flavors'; +export * as dataHuaweicloudDmsKafkaFlavors from './data-huaweicloud-dms-kafka-flavors'; +export * as dataHuaweicloudDmsKafkaInstances from './data-huaweicloud-dms-kafka-instances'; +export * as dataHuaweicloudDmsKafkaMessageDiagnosisTasks from './data-huaweicloud-dms-kafka-message-diagnosis-tasks'; +export * as dataHuaweicloudDmsKafkaMessages from './data-huaweicloud-dms-kafka-messages'; +export * as dataHuaweicloudDmsKafkaSmartConnectTasks from './data-huaweicloud-dms-kafka-smart-connect-tasks'; +export * as dataHuaweicloudDmsKafkaTopicPartitions from './data-huaweicloud-dms-kafka-topic-partitions'; +export * as dataHuaweicloudDmsKafkaTopicProducers from './data-huaweicloud-dms-kafka-topic-producers'; +export * as dataHuaweicloudDmsKafkaTopics from './data-huaweicloud-dms-kafka-topics'; +export * as dataHuaweicloudDmsKafkaUserClientQuotas from './data-huaweicloud-dms-kafka-user-client-quotas'; +export * as dataHuaweicloudDmsKafkaUsers from './data-huaweicloud-dms-kafka-users'; +export * as dataHuaweicloudDmsKafkav2SmartConnectTasks from './data-huaweicloud-dms-kafkav2-smart-connect-tasks'; +export * as dataHuaweicloudDmsMaintainwindow from './data-huaweicloud-dms-maintainwindow'; +export * as dataHuaweicloudDmsMaintainwindowV1 from './data-huaweicloud-dms-maintainwindow-v1'; +export * as dataHuaweicloudDmsProduct from './data-huaweicloud-dms-product'; +export * as dataHuaweicloudDmsProductV1 from './data-huaweicloud-dms-product-v1'; +export * as dataHuaweicloudDmsRabbitmqBackgroundTasks from './data-huaweicloud-dms-rabbitmq-background-tasks'; +export * as dataHuaweicloudDmsRabbitmqExchanges from './data-huaweicloud-dms-rabbitmq-exchanges'; +export * as dataHuaweicloudDmsRabbitmqExtendFlavors from './data-huaweicloud-dms-rabbitmq-extend-flavors'; +export * as dataHuaweicloudDmsRabbitmqFlavors from './data-huaweicloud-dms-rabbitmq-flavors'; +export * as dataHuaweicloudDmsRabbitmqInstances from './data-huaweicloud-dms-rabbitmq-instances'; +export * as dataHuaweicloudDmsRabbitmqPlugins from './data-huaweicloud-dms-rabbitmq-plugins'; +export * as dataHuaweicloudDmsRabbitmqQueues from './data-huaweicloud-dms-rabbitmq-queues'; +export * as dataHuaweicloudDmsRabbitmqUsers from './data-huaweicloud-dms-rabbitmq-users'; +export * as dataHuaweicloudDmsRabbitmqVhosts from './data-huaweicloud-dms-rabbitmq-vhosts'; +export * as dataHuaweicloudDmsRocketmqBroker from './data-huaweicloud-dms-rocketmq-broker'; +export * as dataHuaweicloudDmsRocketmqConsumerGroupAccessUsers from './data-huaweicloud-dms-rocketmq-consumer-group-access-users'; +export * as dataHuaweicloudDmsRocketmqConsumerGroups from './data-huaweicloud-dms-rocketmq-consumer-groups'; +export * as dataHuaweicloudDmsRocketmqConsumers from './data-huaweicloud-dms-rocketmq-consumers'; +export * as dataHuaweicloudDmsRocketmqExtendFlavors from './data-huaweicloud-dms-rocketmq-extend-flavors'; +export * as dataHuaweicloudDmsRocketmqFlavors from './data-huaweicloud-dms-rocketmq-flavors'; +export * as dataHuaweicloudDmsRocketmqInstances from './data-huaweicloud-dms-rocketmq-instances'; +export * as dataHuaweicloudDmsRocketmqMessageTraces from './data-huaweicloud-dms-rocketmq-message-traces'; +export * as dataHuaweicloudDmsRocketmqMessages from './data-huaweicloud-dms-rocketmq-messages'; +export * as dataHuaweicloudDmsRocketmqMigrationTasks from './data-huaweicloud-dms-rocketmq-migration-tasks'; +export * as dataHuaweicloudDmsRocketmqTopicAccessUsers from './data-huaweicloud-dms-rocketmq-topic-access-users'; +export * as dataHuaweicloudDmsRocketmqTopicConsumerGroups from './data-huaweicloud-dms-rocketmq-topic-consumer-groups'; +export * as dataHuaweicloudDmsRocketmqTopics from './data-huaweicloud-dms-rocketmq-topics'; +export * as dataHuaweicloudDmsRocketmqUsers from './data-huaweicloud-dms-rocketmq-users'; +export * as dataHuaweicloudDnsCustomLines from './data-huaweicloud-dns-custom-lines'; +export * as dataHuaweicloudDnsFloatingPtrrecords from './data-huaweicloud-dns-floating-ptrrecords'; +export * as dataHuaweicloudDnsLineGroups from './data-huaweicloud-dns-line-groups'; +export * as dataHuaweicloudDnsNameservers from './data-huaweicloud-dns-nameservers'; +export * as dataHuaweicloudDnsQuotas from './data-huaweicloud-dns-quotas'; +export * as dataHuaweicloudDnsRecordsets from './data-huaweicloud-dns-recordsets'; +export * as dataHuaweicloudDnsZones from './data-huaweicloud-dns-zones'; +export * as dataHuaweicloudDrsAvailabilityZones from './data-huaweicloud-drs-availability-zones'; +export * as dataHuaweicloudDrsNodeTypes from './data-huaweicloud-drs-node-types'; +export * as dataHuaweicloudDwsAlarmSubscriptions from './data-huaweicloud-dws-alarm-subscriptions'; +export * as dataHuaweicloudDwsAvailabilityZones from './data-huaweicloud-dws-availability-zones'; +export * as dataHuaweicloudDwsClusterCns from './data-huaweicloud-dws-cluster-cns'; +export * as dataHuaweicloudDwsClusterLogs from './data-huaweicloud-dws-cluster-logs'; +export * as dataHuaweicloudDwsClusterNodes from './data-huaweicloud-dws-cluster-nodes'; +export * as dataHuaweicloudDwsClusterParameters from './data-huaweicloud-dws-cluster-parameters'; +export * as dataHuaweicloudDwsClusterSnapshotStatistics from './data-huaweicloud-dws-cluster-snapshot-statistics'; +export * as dataHuaweicloudDwsClusterTopoRings from './data-huaweicloud-dws-cluster-topo-rings'; +export * as dataHuaweicloudDwsClusters from './data-huaweicloud-dws-clusters'; +export * as dataHuaweicloudDwsDisasterRecoveryTasks from './data-huaweicloud-dws-disaster-recovery-tasks'; +export * as dataHuaweicloudDwsEventSubscriptions from './data-huaweicloud-dws-event-subscriptions'; +export * as dataHuaweicloudDwsFlavors from './data-huaweicloud-dws-flavors'; +export * as dataHuaweicloudDwsLogicalClusterRings from './data-huaweicloud-dws-logical-cluster-rings'; +export * as dataHuaweicloudDwsLogicalClusterVolumes from './data-huaweicloud-dws-logical-cluster-volumes'; +export * as dataHuaweicloudDwsLogicalClusters from './data-huaweicloud-dws-logical-clusters'; +export * as dataHuaweicloudDwsOmAccountConfiguration from './data-huaweicloud-dws-om-account-configuration'; +export * as dataHuaweicloudDwsQuotas from './data-huaweicloud-dws-quotas'; +export * as dataHuaweicloudDwsSnapshotPolicies from './data-huaweicloud-dws-snapshot-policies'; +export * as dataHuaweicloudDwsSnapshots from './data-huaweicloud-dws-snapshots'; +export * as dataHuaweicloudDwsStatistics from './data-huaweicloud-dws-statistics'; +export * as dataHuaweicloudDwsWorkloadPlans from './data-huaweicloud-dws-workload-plans'; +export * as dataHuaweicloudDwsWorkloadQueueAssociatedUsers from './data-huaweicloud-dws-workload-queue-associated-users'; +export * as dataHuaweicloudDwsWorkloadQueues from './data-huaweicloud-dws-workload-queues'; +export * as dataHuaweicloudEgCustomEventChannels from './data-huaweicloud-eg-custom-event-channels'; +export * as dataHuaweicloudEgCustomEventSources from './data-huaweicloud-eg-custom-event-sources'; +export * as dataHuaweicloudEgEventChannels from './data-huaweicloud-eg-event-channels'; +export * as dataHuaweicloudEgEventSources from './data-huaweicloud-eg-event-sources'; +export * as dataHuaweicloudElbActiveStandbyPools from './data-huaweicloud-elb-active-standby-pools'; +export * as dataHuaweicloudElbCertificate from './data-huaweicloud-elb-certificate'; +export * as dataHuaweicloudElbFlavors from './data-huaweicloud-elb-flavors'; +export * as dataHuaweicloudElbIpgroups from './data-huaweicloud-elb-ipgroups'; +export * as dataHuaweicloudElbL7Policies from './data-huaweicloud-elb-l7policies'; +export * as dataHuaweicloudElbL7Rules from './data-huaweicloud-elb-l7rules'; +export * as dataHuaweicloudElbListeners from './data-huaweicloud-elb-listeners'; +export * as dataHuaweicloudElbLoadbalancers from './data-huaweicloud-elb-loadbalancers'; +export * as dataHuaweicloudElbLogtanks from './data-huaweicloud-elb-logtanks'; +export * as dataHuaweicloudElbMembers from './data-huaweicloud-elb-members'; +export * as dataHuaweicloudElbMonitors from './data-huaweicloud-elb-monitors'; +export * as dataHuaweicloudElbPools from './data-huaweicloud-elb-pools'; +export * as dataHuaweicloudElbSecurityPolicies from './data-huaweicloud-elb-security-policies'; +export * as dataHuaweicloudEnterpriseProject from './data-huaweicloud-enterprise-project'; +export * as dataHuaweicloudEnterpriseProjects from './data-huaweicloud-enterprise-projects'; +export * as dataHuaweicloudErAssociations from './data-huaweicloud-er-associations'; +export * as dataHuaweicloudErAttachments from './data-huaweicloud-er-attachments'; +export * as dataHuaweicloudErAvailabilityZones from './data-huaweicloud-er-availability-zones'; +export * as dataHuaweicloudErAvailableRoutes from './data-huaweicloud-er-available-routes'; +export * as dataHuaweicloudErFlowLogs from './data-huaweicloud-er-flow-logs'; +export * as dataHuaweicloudErInstances from './data-huaweicloud-er-instances'; +export * as dataHuaweicloudErPropagations from './data-huaweicloud-er-propagations'; +export * as dataHuaweicloudErQuotas from './data-huaweicloud-er-quotas'; +export * as dataHuaweicloudErRouteTables from './data-huaweicloud-er-route-tables'; +export * as dataHuaweicloudEvsAvailabilityZones from './data-huaweicloud-evs-availability-zones'; +export * as dataHuaweicloudEvsSnapshots from './data-huaweicloud-evs-snapshots'; +export * as dataHuaweicloudEvsVolumeTransfers from './data-huaweicloud-evs-volume-transfers'; +export * as dataHuaweicloudEvsVolumeTypes from './data-huaweicloud-evs-volume-types'; +export * as dataHuaweicloudEvsVolumes from './data-huaweicloud-evs-volumes'; +export * as dataHuaweicloudFgsApplicationTemplates from './data-huaweicloud-fgs-application-templates'; +export * as dataHuaweicloudFgsApplications from './data-huaweicloud-fgs-applications'; +export * as dataHuaweicloudFgsDependencies from './data-huaweicloud-fgs-dependencies'; +export * as dataHuaweicloudFgsDependencyVersions from './data-huaweicloud-fgs-dependency-versions'; +export * as dataHuaweicloudFgsFunctionEvents from './data-huaweicloud-fgs-function-events'; +export * as dataHuaweicloudFgsFunctionTriggers from './data-huaweicloud-fgs-function-triggers'; +export * as dataHuaweicloudFgsFunctions from './data-huaweicloud-fgs-functions'; +export * as dataHuaweicloudFgsQuotas from './data-huaweicloud-fgs-quotas'; +export * as dataHuaweicloudGaAccelerators from './data-huaweicloud-ga-accelerators'; +export * as dataHuaweicloudGaAddressGroups from './data-huaweicloud-ga-address-groups'; +export * as dataHuaweicloudGaAvailabilityZones from './data-huaweicloud-ga-availability-zones'; +export * as dataHuaweicloudGaEndpointGroups from './data-huaweicloud-ga-endpoint-groups'; +export * as dataHuaweicloudGaEndpoints from './data-huaweicloud-ga-endpoints'; +export * as dataHuaweicloudGaHealthChecks from './data-huaweicloud-ga-health-checks'; +export * as dataHuaweicloudGaListeners from './data-huaweicloud-ga-listeners'; +export * as dataHuaweicloudGaussdbCassandraDedicatedResource from './data-huaweicloud-gaussdb-cassandra-dedicated-resource'; +export * as dataHuaweicloudGaussdbCassandraFlavors from './data-huaweicloud-gaussdb-cassandra-flavors'; +export * as dataHuaweicloudGaussdbCassandraInstance from './data-huaweicloud-gaussdb-cassandra-instance'; +export * as dataHuaweicloudGaussdbCassandraInstances from './data-huaweicloud-gaussdb-cassandra-instances'; +export * as dataHuaweicloudGaussdbInfluxInstances from './data-huaweicloud-gaussdb-influx-instances'; +export * as dataHuaweicloudGaussdbMysqlAuditLogDownloadLinks from './data-huaweicloud-gaussdb-mysql-audit-log-download-links'; +export * as dataHuaweicloudGaussdbMysqlAutoScalingRecords from './data-huaweicloud-gaussdb-mysql-auto-scaling-records'; +export * as dataHuaweicloudGaussdbMysqlBackups from './data-huaweicloud-gaussdb-mysql-backups'; +export * as dataHuaweicloudGaussdbMysqlConfiguration from './data-huaweicloud-gaussdb-mysql-configuration'; +export * as dataHuaweicloudGaussdbMysqlConfigurations from './data-huaweicloud-gaussdb-mysql-configurations'; +export * as dataHuaweicloudGaussdbMysqlDatabaseCharacterSet from './data-huaweicloud-gaussdb-mysql-database-character-set'; +export * as dataHuaweicloudGaussdbMysqlDatabases from './data-huaweicloud-gaussdb-mysql-databases'; +export * as dataHuaweicloudGaussdbMysqlDedicatedResource from './data-huaweicloud-gaussdb-mysql-dedicated-resource'; +export * as dataHuaweicloudGaussdbMysqlDiagnosisInstances from './data-huaweicloud-gaussdb-mysql-diagnosis-instances'; +export * as dataHuaweicloudGaussdbMysqlDiagnosisStatistics from './data-huaweicloud-gaussdb-mysql-diagnosis-statistics'; +export * as dataHuaweicloudGaussdbMysqlEngineVersions from './data-huaweicloud-gaussdb-mysql-engine-versions'; +export * as dataHuaweicloudGaussdbMysqlErrorLogs from './data-huaweicloud-gaussdb-mysql-error-logs'; +export * as dataHuaweicloudGaussdbMysqlFlavors from './data-huaweicloud-gaussdb-mysql-flavors'; +export * as dataHuaweicloudGaussdbMysqlIncrementalBackups from './data-huaweicloud-gaussdb-mysql-incremental-backups'; +export * as dataHuaweicloudGaussdbMysqlInstance from './data-huaweicloud-gaussdb-mysql-instance'; +export * as dataHuaweicloudGaussdbMysqlInstances from './data-huaweicloud-gaussdb-mysql-instances'; +export * as dataHuaweicloudGaussdbMysqlInstantTasks from './data-huaweicloud-gaussdb-mysql-instant-tasks'; +export * as dataHuaweicloudGaussdbMysqlProjectQuotas from './data-huaweicloud-gaussdb-mysql-project-quotas'; +export * as dataHuaweicloudGaussdbMysqlProxies from './data-huaweicloud-gaussdb-mysql-proxies'; +export * as dataHuaweicloudGaussdbMysqlProxyFlavors from './data-huaweicloud-gaussdb-mysql-proxy-flavors'; +export * as dataHuaweicloudGaussdbMysqlPtApplicableInstances from './data-huaweicloud-gaussdb-mysql-pt-applicable-instances'; +export * as dataHuaweicloudGaussdbMysqlPtApplyRecords from './data-huaweicloud-gaussdb-mysql-pt-apply-records'; +export * as dataHuaweicloudGaussdbMysqlPtModifyRecords from './data-huaweicloud-gaussdb-mysql-pt-modify-records'; +export * as dataHuaweicloudGaussdbMysqlRecyclingInstances from './data-huaweicloud-gaussdb-mysql-recycling-instances'; +export * as dataHuaweicloudGaussdbMysqlRestoreTimeRanges from './data-huaweicloud-gaussdb-mysql-restore-time-ranges'; +export * as dataHuaweicloudGaussdbMysqlRestoredTables from './data-huaweicloud-gaussdb-mysql-restored-tables'; +export * as dataHuaweicloudGaussdbMysqlScheduledTasks from './data-huaweicloud-gaussdb-mysql-scheduled-tasks'; +export * as dataHuaweicloudGaussdbMysqlSlowLogs from './data-huaweicloud-gaussdb-mysql-slow-logs'; +export * as dataHuaweicloudGaussdbNosqlFlavors from './data-huaweicloud-gaussdb-nosql-flavors'; +export * as dataHuaweicloudGaussdbOpengaussInstance from './data-huaweicloud-gaussdb-opengauss-instance'; +export * as dataHuaweicloudGaussdbOpengaussInstances from './data-huaweicloud-gaussdb-opengauss-instances'; +export * as dataHuaweicloudGaussdbRedisFlavors from './data-huaweicloud-gaussdb-redis-flavors'; +export * as dataHuaweicloudGaussdbRedisInstance from './data-huaweicloud-gaussdb-redis-instance'; +export * as dataHuaweicloudGlobalEipAccessSites from './data-huaweicloud-global-eip-access-sites'; +export * as dataHuaweicloudGlobalEipPools from './data-huaweicloud-global-eip-pools'; +export * as dataHuaweicloudGlobalEips from './data-huaweicloud-global-eips'; +export * as dataHuaweicloudGlobalInternetBandwidths from './data-huaweicloud-global-internet-bandwidths'; +export * as dataHuaweicloudHssHostGroups from './data-huaweicloud-hss-host-groups'; +export * as dataHuaweicloudHssHosts from './data-huaweicloud-hss-hosts'; +export * as dataHuaweicloudHssQuotas from './data-huaweicloud-hss-quotas'; +export * as dataHuaweicloudHssRansomwareProtectionPolicies from './data-huaweicloud-hss-ransomware-protection-policies'; +export * as dataHuaweicloudHssWebtamperHosts from './data-huaweicloud-hss-webtamper-hosts'; +export * as dataHuaweicloudIdentityAgencies from './data-huaweicloud-identity-agencies'; +export * as dataHuaweicloudIdentityCustomRole from './data-huaweicloud-identity-custom-role'; +export * as dataHuaweicloudIdentityGroup from './data-huaweicloud-identity-group'; +export * as dataHuaweicloudIdentityPermissions from './data-huaweicloud-identity-permissions'; +export * as dataHuaweicloudIdentityProjects from './data-huaweicloud-identity-projects'; +export * as dataHuaweicloudIdentityProviders from './data-huaweicloud-identity-providers'; +export * as dataHuaweicloudIdentityRole from './data-huaweicloud-identity-role'; +export * as dataHuaweicloudIdentityRoleV3 from './data-huaweicloud-identity-role-v3'; +export * as dataHuaweicloudIdentityUsers from './data-huaweicloud-identity-users'; +export * as dataHuaweicloudIdentityVirtualMfaDevices from './data-huaweicloud-identity-virtual-mfa-devices'; +export * as dataHuaweicloudIdentitycenterGroups from './data-huaweicloud-identitycenter-groups'; +export * as dataHuaweicloudIdentitycenterInstance from './data-huaweicloud-identitycenter-instance'; +export * as dataHuaweicloudIdentitycenterUsers from './data-huaweicloud-identitycenter-users'; +export * as dataHuaweicloudIecBandwidths from './data-huaweicloud-iec-bandwidths'; +export * as dataHuaweicloudIecEips from './data-huaweicloud-iec-eips'; +export * as dataHuaweicloudIecFlavors from './data-huaweicloud-iec-flavors'; +export * as dataHuaweicloudIecImages from './data-huaweicloud-iec-images'; +export * as dataHuaweicloudIecKeypair from './data-huaweicloud-iec-keypair'; +export * as dataHuaweicloudIecNetworkAcl from './data-huaweicloud-iec-network-acl'; +export * as dataHuaweicloudIecPort from './data-huaweicloud-iec-port'; +export * as dataHuaweicloudIecSecurityGroup from './data-huaweicloud-iec-security-group'; +export * as dataHuaweicloudIecServer from './data-huaweicloud-iec-server'; +export * as dataHuaweicloudIecSites from './data-huaweicloud-iec-sites'; +export * as dataHuaweicloudIecVpc from './data-huaweicloud-iec-vpc'; +export * as dataHuaweicloudIecVpcSubnets from './data-huaweicloud-iec-vpc-subnets'; +export * as dataHuaweicloudImagesImage from './data-huaweicloud-images-image'; +export * as dataHuaweicloudImagesImageV2 from './data-huaweicloud-images-image-v2'; +export * as dataHuaweicloudImagesImages from './data-huaweicloud-images-images'; +export * as dataHuaweicloudImsOsVersions from './data-huaweicloud-ims-os-versions'; +export * as dataHuaweicloudImsQuotas from './data-huaweicloud-ims-quotas'; +export * as dataHuaweicloudIotdaAmqps from './data-huaweicloud-iotda-amqps'; +export * as dataHuaweicloudIotdaBatchtasks from './data-huaweicloud-iotda-batchtasks'; +export * as dataHuaweicloudIotdaDataBacklogPolicies from './data-huaweicloud-iotda-data-backlog-policies'; +export * as dataHuaweicloudIotdaDataFlowControlPolicies from './data-huaweicloud-iotda-data-flow-control-policies'; +export * as dataHuaweicloudIotdaDataforwardingRules from './data-huaweicloud-iotda-dataforwarding-rules'; +export * as dataHuaweicloudIotdaDeviceBindingGroups from './data-huaweicloud-iotda-device-binding-groups'; +export * as dataHuaweicloudIotdaDeviceCertificates from './data-huaweicloud-iotda-device-certificates'; +export * as dataHuaweicloudIotdaDeviceGroups from './data-huaweicloud-iotda-device-groups'; +export * as dataHuaweicloudIotdaDeviceLinkageRules from './data-huaweicloud-iotda-device-linkage-rules'; +export * as dataHuaweicloudIotdaDeviceMessages from './data-huaweicloud-iotda-device-messages'; +export * as dataHuaweicloudIotdaDeviceProxies from './data-huaweicloud-iotda-device-proxies'; +export * as dataHuaweicloudIotdaDevices from './data-huaweicloud-iotda-devices'; +export * as dataHuaweicloudIotdaProducts from './data-huaweicloud-iotda-products'; +export * as dataHuaweicloudIotdaSpaces from './data-huaweicloud-iotda-spaces'; +export * as dataHuaweicloudIotdaUpgradePackages from './data-huaweicloud-iotda-upgrade-packages'; +export * as dataHuaweicloudKmsDataKey from './data-huaweicloud-kms-data-key'; +export * as dataHuaweicloudKmsDataKeyV1 from './data-huaweicloud-kms-data-key-v1'; +export * as dataHuaweicloudKmsGrants from './data-huaweicloud-kms-grants'; +export * as dataHuaweicloudKmsKey from './data-huaweicloud-kms-key'; +export * as dataHuaweicloudKmsKeyV1 from './data-huaweicloud-kms-key-v1'; +export * as dataHuaweicloudKmsKeys from './data-huaweicloud-kms-keys'; +export * as dataHuaweicloudKoogalleryAssets from './data-huaweicloud-koogallery-assets'; +export * as dataHuaweicloudKpsFailedTasks from './data-huaweicloud-kps-failed-tasks'; +export * as dataHuaweicloudKpsKeypairs from './data-huaweicloud-kps-keypairs'; +export * as dataHuaweicloudKpsRunningTasks from './data-huaweicloud-kps-running-tasks'; +export * as dataHuaweicloudLbCertificate from './data-huaweicloud-lb-certificate'; +export * as dataHuaweicloudLbListeners from './data-huaweicloud-lb-listeners'; +export * as dataHuaweicloudLbLoadbalancer from './data-huaweicloud-lb-loadbalancer'; +export * as dataHuaweicloudLbPools from './data-huaweicloud-lb-pools'; +export * as dataHuaweicloudLiveDomains from './data-huaweicloud-live-domains'; +export * as dataHuaweicloudLtsAomAccesses from './data-huaweicloud-lts-aom-accesses'; +export * as dataHuaweicloudLtsCceAccesses from './data-huaweicloud-lts-cce-accesses'; +export * as dataHuaweicloudLtsGroups from './data-huaweicloud-lts-groups'; +export * as dataHuaweicloudLtsHostGroups from './data-huaweicloud-lts-host-groups'; +export * as dataHuaweicloudLtsNotificationTemplates from './data-huaweicloud-lts-notification-templates'; +export * as dataHuaweicloudLtsSearchCriteria from './data-huaweicloud-lts-search-criteria'; +export * as dataHuaweicloudLtsStreams from './data-huaweicloud-lts-streams'; +export * as dataHuaweicloudLtsStructuringCustomTemplates from './data-huaweicloud-lts-structuring-custom-templates'; +export * as dataHuaweicloudLtsTransfers from './data-huaweicloud-lts-transfers'; +export * as dataHuaweicloudMapreduceClusters from './data-huaweicloud-mapreduce-clusters'; +export * as dataHuaweicloudMapreduceVersions from './data-huaweicloud-mapreduce-versions'; +export * as dataHuaweicloudModelartsDatasetVersions from './data-huaweicloud-modelarts-dataset-versions'; +export * as dataHuaweicloudModelartsDatasets from './data-huaweicloud-modelarts-datasets'; +export * as dataHuaweicloudModelartsModelTemplates from './data-huaweicloud-modelarts-model-templates'; +export * as dataHuaweicloudModelartsModels from './data-huaweicloud-modelarts-models'; +export * as dataHuaweicloudModelartsNotebookFlavors from './data-huaweicloud-modelarts-notebook-flavors'; +export * as dataHuaweicloudModelartsNotebookImages from './data-huaweicloud-modelarts-notebook-images'; +export * as dataHuaweicloudModelartsResourceFlavors from './data-huaweicloud-modelarts-resource-flavors'; +export * as dataHuaweicloudModelartsServiceFlavors from './data-huaweicloud-modelarts-service-flavors'; +export * as dataHuaweicloudModelartsServices from './data-huaweicloud-modelarts-services'; +export * as dataHuaweicloudModelartsWorkspaces from './data-huaweicloud-modelarts-workspaces'; +export * as dataHuaweicloudNatDnatRules from './data-huaweicloud-nat-dnat-rules'; +export * as dataHuaweicloudNatGateway from './data-huaweicloud-nat-gateway'; +export * as dataHuaweicloudNatGateways from './data-huaweicloud-nat-gateways'; +export * as dataHuaweicloudNatPrivateDnatRules from './data-huaweicloud-nat-private-dnat-rules'; +export * as dataHuaweicloudNatPrivateGateways from './data-huaweicloud-nat-private-gateways'; +export * as dataHuaweicloudNatPrivateSnatRules from './data-huaweicloud-nat-private-snat-rules'; +export * as dataHuaweicloudNatPrivateTransitIps from './data-huaweicloud-nat-private-transit-ips'; +export * as dataHuaweicloudNatSnatRules from './data-huaweicloud-nat-snat-rules'; +export * as dataHuaweicloudNetworkingNetworkV2 from './data-huaweicloud-networking-network-v2'; +export * as dataHuaweicloudNetworkingPort from './data-huaweicloud-networking-port'; +export * as dataHuaweicloudNetworkingPortV2 from './data-huaweicloud-networking-port-v2'; +export * as dataHuaweicloudNetworkingSecgroup from './data-huaweicloud-networking-secgroup'; +export * as dataHuaweicloudNetworkingSecgroupRules from './data-huaweicloud-networking-secgroup-rules'; +export * as dataHuaweicloudNetworkingSecgroupV2 from './data-huaweicloud-networking-secgroup-v2'; +export * as dataHuaweicloudNetworkingSecgroups from './data-huaweicloud-networking-secgroups'; +export * as dataHuaweicloudNetworkingSubnetV2 from './data-huaweicloud-networking-subnet-v2'; +export * as dataHuaweicloudObsBucketObject from './data-huaweicloud-obs-bucket-object'; +export * as dataHuaweicloudObsBuckets from './data-huaweicloud-obs-buckets'; +export * as dataHuaweicloudOrganizationsAccounts from './data-huaweicloud-organizations-accounts'; +export * as dataHuaweicloudOrganizationsEffectivePolicies from './data-huaweicloud-organizations-effective-policies'; +export * as dataHuaweicloudOrganizationsOrganization from './data-huaweicloud-organizations-organization'; +export * as dataHuaweicloudOrganizationsOrganizationalUnits from './data-huaweicloud-organizations-organizational-units'; +export * as dataHuaweicloudOrganizationsPolicies from './data-huaweicloud-organizations-policies'; +export * as dataHuaweicloudOrganizationsReceivedInvitations from './data-huaweicloud-organizations-received-invitations'; +export * as dataHuaweicloudOrganizationsResourceInstances from './data-huaweicloud-organizations-resource-instances'; +export * as dataHuaweicloudOrganizationsResourceTags from './data-huaweicloud-organizations-resource-tags'; +export * as dataHuaweicloudOrganizationsSentInvitations from './data-huaweicloud-organizations-sent-invitations'; +export * as dataHuaweicloudOrganizationsServices from './data-huaweicloud-organizations-services'; +export * as dataHuaweicloudOrganizationsTagPolicyServices from './data-huaweicloud-organizations-tag-policy-services'; +export * as dataHuaweicloudOrganizationsTrustedServices from './data-huaweicloud-organizations-trusted-services'; +export * as dataHuaweicloudRamResourcePermissions from './data-huaweicloud-ram-resource-permissions'; +export * as dataHuaweicloudRamResourceShareAssociatedPermissions from './data-huaweicloud-ram-resource-share-associated-permissions'; +export * as dataHuaweicloudRamResourceShareAssociations from './data-huaweicloud-ram-resource-share-associations'; +export * as dataHuaweicloudRamResourceShareInvitations from './data-huaweicloud-ram-resource-share-invitations'; +export * as dataHuaweicloudRamResourceShares from './data-huaweicloud-ram-resource-shares'; +export * as dataHuaweicloudRamSharedPrincipals from './data-huaweicloud-ram-shared-principals'; +export * as dataHuaweicloudRamSharedResources from './data-huaweicloud-ram-shared-resources'; +export * as dataHuaweicloudRdsBackups from './data-huaweicloud-rds-backups'; +export * as dataHuaweicloudRdsCrossRegionBackupInstances from './data-huaweicloud-rds-cross-region-backup-instances'; +export * as dataHuaweicloudRdsCrossRegionBackups from './data-huaweicloud-rds-cross-region-backups'; +export * as dataHuaweicloudRdsEngineVersions from './data-huaweicloud-rds-engine-versions'; +export * as dataHuaweicloudRdsErrorLogLink from './data-huaweicloud-rds-error-log-link'; +export * as dataHuaweicloudRdsErrorLogs from './data-huaweicloud-rds-error-logs'; +export * as dataHuaweicloudRdsExtendLogFiles from './data-huaweicloud-rds-extend-log-files'; +export * as dataHuaweicloudRdsExtendLogLinks from './data-huaweicloud-rds-extend-log-links'; +export * as dataHuaweicloudRdsFlavors from './data-huaweicloud-rds-flavors'; +export * as dataHuaweicloudRdsFlavorsV3 from './data-huaweicloud-rds-flavors-v3'; +export * as dataHuaweicloudRdsInstances from './data-huaweicloud-rds-instances'; +export * as dataHuaweicloudRdsMysqlAccounts from './data-huaweicloud-rds-mysql-accounts'; +export * as dataHuaweicloudRdsMysqlBinlog from './data-huaweicloud-rds-mysql-binlog'; +export * as dataHuaweicloudRdsMysqlDatabasePrivileges from './data-huaweicloud-rds-mysql-database-privileges'; +export * as dataHuaweicloudRdsMysqlDatabases from './data-huaweicloud-rds-mysql-databases'; +export * as dataHuaweicloudRdsMysqlProxies from './data-huaweicloud-rds-mysql-proxies'; +export * as dataHuaweicloudRdsMysqlProxyFlavors from './data-huaweicloud-rds-mysql-proxy-flavors'; +export * as dataHuaweicloudRdsParametergroups from './data-huaweicloud-rds-parametergroups'; +export * as dataHuaweicloudRdsPgAccounts from './data-huaweicloud-rds-pg-accounts'; +export * as dataHuaweicloudRdsPgDatabases from './data-huaweicloud-rds-pg-databases'; +export * as dataHuaweicloudRdsPgPluginParameterValueRange from './data-huaweicloud-rds-pg-plugin-parameter-value-range'; +export * as dataHuaweicloudRdsPgPluginParameterValues from './data-huaweicloud-rds-pg-plugin-parameter-values'; +export * as dataHuaweicloudRdsPgPlugins from './data-huaweicloud-rds-pg-plugins'; +export * as dataHuaweicloudRdsPgRoles from './data-huaweicloud-rds-pg-roles'; +export * as dataHuaweicloudRdsPgSqlLimits from './data-huaweicloud-rds-pg-sql-limits'; +export * as dataHuaweicloudRdsRecyclingInstances from './data-huaweicloud-rds-recycling-instances'; +export * as dataHuaweicloudRdsRestoreTimeRanges from './data-huaweicloud-rds-restore-time-ranges'; +export * as dataHuaweicloudRdsRestoredDatabases from './data-huaweicloud-rds-restored-databases'; +export * as dataHuaweicloudRdsRestoredTables from './data-huaweicloud-rds-restored-tables'; +export * as dataHuaweicloudRdsSlowLogFiles from './data-huaweicloud-rds-slow-log-files'; +export * as dataHuaweicloudRdsSlowLogLink from './data-huaweicloud-rds-slow-log-link'; +export * as dataHuaweicloudRdsSlowLogs from './data-huaweicloud-rds-slow-logs'; +export * as dataHuaweicloudRdsSqlAuditLogLinks from './data-huaweicloud-rds-sql-audit-log-links'; +export * as dataHuaweicloudRdsSqlAuditLogs from './data-huaweicloud-rds-sql-audit-logs'; +export * as dataHuaweicloudRdsSqlAuditOperations from './data-huaweicloud-rds-sql-audit-operations'; +export * as dataHuaweicloudRdsSqlserverAccounts from './data-huaweicloud-rds-sqlserver-accounts'; +export * as dataHuaweicloudRdsSqlserverCollations from './data-huaweicloud-rds-sqlserver-collations'; +export * as dataHuaweicloudRdsSqlserverDatabasePrivileges from './data-huaweicloud-rds-sqlserver-database-privileges'; +export * as dataHuaweicloudRdsSqlserverDatabases from './data-huaweicloud-rds-sqlserver-databases'; +export * as dataHuaweicloudRdsStorageTypes from './data-huaweicloud-rds-storage-types'; +export * as dataHuaweicloudRmsAdvancedQueries from './data-huaweicloud-rms-advanced-queries'; +export * as dataHuaweicloudRmsAdvancedQuery from './data-huaweicloud-rms-advanced-query'; +export * as dataHuaweicloudRmsAdvancedQuerySchemas from './data-huaweicloud-rms-advanced-query-schemas'; +export * as dataHuaweicloudRmsAssignmentPackageResults from './data-huaweicloud-rms-assignment-package-results'; +export * as dataHuaweicloudRmsAssignmentPackageScores from './data-huaweicloud-rms-assignment-package-scores'; +export * as dataHuaweicloudRmsAssignmentPackageTemplates from './data-huaweicloud-rms-assignment-package-templates'; +export * as dataHuaweicloudRmsAssignmentPackages from './data-huaweicloud-rms-assignment-packages'; +export * as dataHuaweicloudRmsOrganizationalAssignmentPackages from './data-huaweicloud-rms-organizational-assignment-packages'; +export * as dataHuaweicloudRmsOrganizationalPolicyAssignments from './data-huaweicloud-rms-organizational-policy-assignments'; +export * as dataHuaweicloudRmsPolicyAssignments from './data-huaweicloud-rms-policy-assignments'; +export * as dataHuaweicloudRmsPolicyDefinitions from './data-huaweicloud-rms-policy-definitions'; +export * as dataHuaweicloudRmsPolicyStates from './data-huaweicloud-rms-policy-states'; +export * as dataHuaweicloudRmsRegions from './data-huaweicloud-rms-regions'; +export * as dataHuaweicloudRmsResourceAggregationPendingRequests from './data-huaweicloud-rms-resource-aggregation-pending-requests'; +export * as dataHuaweicloudRmsResourceAggregatorAdvancedQuery from './data-huaweicloud-rms-resource-aggregator-advanced-query'; +export * as dataHuaweicloudRmsResourceAggregatorDiscoveredResources from './data-huaweicloud-rms-resource-aggregator-discovered-resources'; +export * as dataHuaweicloudRmsResourceAggregatorPolicyAssignments from './data-huaweicloud-rms-resource-aggregator-policy-assignments'; +export * as dataHuaweicloudRmsResourceAggregatorPolicyStates from './data-huaweicloud-rms-resource-aggregator-policy-states'; +export * as dataHuaweicloudRmsResourceAggregatorSourceStatuses from './data-huaweicloud-rms-resource-aggregator-source-statuses'; +export * as dataHuaweicloudRmsResourceAggregators from './data-huaweicloud-rms-resource-aggregators'; +export * as dataHuaweicloudRmsResourceHistories from './data-huaweicloud-rms-resource-histories'; +export * as dataHuaweicloudRmsResourceRelationsDetails from './data-huaweicloud-rms-resource-relations-details'; +export * as dataHuaweicloudRmsResources from './data-huaweicloud-rms-resources'; +export * as dataHuaweicloudRmsResourcesSummary from './data-huaweicloud-rms-resources-summary'; +export * as dataHuaweicloudRmsServices from './data-huaweicloud-rms-services'; +export * as dataHuaweicloudScmCertificates from './data-huaweicloud-scm-certificates'; +export * as dataHuaweicloudSdrsDomain from './data-huaweicloud-sdrs-domain'; +export * as dataHuaweicloudSecmasterAlertRuleTemplates from './data-huaweicloud-secmaster-alert-rule-templates'; +export * as dataHuaweicloudSecmasterAlertRules from './data-huaweicloud-secmaster-alert-rules'; +export * as dataHuaweicloudSecmasterAlerts from './data-huaweicloud-secmaster-alerts'; +export * as dataHuaweicloudSecmasterBaselineCheckResults from './data-huaweicloud-secmaster-baseline-check-results'; +export * as dataHuaweicloudSecmasterDataClassFields from './data-huaweicloud-secmaster-data-class-fields'; +export * as dataHuaweicloudSecmasterDataClasses from './data-huaweicloud-secmaster-data-classes'; +export * as dataHuaweicloudSecmasterIncidents from './data-huaweicloud-secmaster-incidents'; +export * as dataHuaweicloudSecmasterIndicators from './data-huaweicloud-secmaster-indicators'; +export * as dataHuaweicloudSecmasterMetricResults from './data-huaweicloud-secmaster-metric-results'; +export * as dataHuaweicloudSecmasterPlaybookActionInstances from './data-huaweicloud-secmaster-playbook-action-instances'; +export * as dataHuaweicloudSecmasterPlaybookAuditLogs from './data-huaweicloud-secmaster-playbook-audit-logs'; +export * as dataHuaweicloudSecmasterPlaybookInstances from './data-huaweicloud-secmaster-playbook-instances'; +export * as dataHuaweicloudSecmasterPlaybookMonitors from './data-huaweicloud-secmaster-playbook-monitors'; +export * as dataHuaweicloudSecmasterPlaybookStatistics from './data-huaweicloud-secmaster-playbook-statistics'; +export * as dataHuaweicloudSecmasterPlaybookVersions from './data-huaweicloud-secmaster-playbook-versions'; +export * as dataHuaweicloudSecmasterPlaybooks from './data-huaweicloud-secmaster-playbooks'; +export * as dataHuaweicloudSecmasterWorkflows from './data-huaweicloud-secmaster-workflows'; +export * as dataHuaweicloudSecmasterWorkspaces from './data-huaweicloud-secmaster-workspaces'; +export * as dataHuaweicloudServicestageComponentRuntimes from './data-huaweicloud-servicestage-component-runtimes'; +export * as dataHuaweicloudServicestagev3Applications from './data-huaweicloud-servicestagev3-applications'; +export * as dataHuaweicloudServicestagev3Environments from './data-huaweicloud-servicestagev3-environments'; +export * as dataHuaweicloudServicestagev3RuntimeStacks from './data-huaweicloud-servicestagev3-runtime-stacks'; +export * as dataHuaweicloudSfsFileSystem from './data-huaweicloud-sfs-file-system'; +export * as dataHuaweicloudSfsFileSystemV2 from './data-huaweicloud-sfs-file-system-v2'; +export * as dataHuaweicloudSfsTurboDataTasks from './data-huaweicloud-sfs-turbo-data-tasks'; +export * as dataHuaweicloudSfsTurboDuTasks from './data-huaweicloud-sfs-turbo-du-tasks'; +export * as dataHuaweicloudSfsTurboObsTargets from './data-huaweicloud-sfs-turbo-obs-targets'; +export * as dataHuaweicloudSfsTurboPermRules from './data-huaweicloud-sfs-turbo-perm-rules'; +export * as dataHuaweicloudSfsTurbos from './data-huaweicloud-sfs-turbos'; +export * as dataHuaweicloudSmnLogtanks from './data-huaweicloud-smn-logtanks'; +export * as dataHuaweicloudSmnMessageTemplates from './data-huaweicloud-smn-message-templates'; +export * as dataHuaweicloudSmnSubscriptions from './data-huaweicloud-smn-subscriptions'; +export * as dataHuaweicloudSmnTopicSubscriptions from './data-huaweicloud-smn-topic-subscriptions'; +export * as dataHuaweicloudSmnTopics from './data-huaweicloud-smn-topics'; +export * as dataHuaweicloudSmsSourceServers from './data-huaweicloud-sms-source-servers'; +export * as dataHuaweicloudSwrImageRetentionHistories from './data-huaweicloud-swr-image-retention-histories'; +export * as dataHuaweicloudSwrImageRetentionPolicies from './data-huaweicloud-swr-image-retention-policies'; +export * as dataHuaweicloudSwrImageTags from './data-huaweicloud-swr-image-tags'; +export * as dataHuaweicloudSwrImageTriggers from './data-huaweicloud-swr-image-triggers'; +export * as dataHuaweicloudSwrOrganizations from './data-huaweicloud-swr-organizations'; +export * as dataHuaweicloudSwrRepositories from './data-huaweicloud-swr-repositories'; +export * as dataHuaweicloudSwrSharedAccounts from './data-huaweicloud-swr-shared-accounts'; +export * as dataHuaweicloudSwrSharedRepositories from './data-huaweicloud-swr-shared-repositories'; +export * as dataHuaweicloudTmsResourceTypes from './data-huaweicloud-tms-resource-types'; +export * as dataHuaweicloudVbsBackup from './data-huaweicloud-vbs-backup'; +export * as dataHuaweicloudVbsBackupPolicy from './data-huaweicloud-vbs-backup-policy'; +export * as dataHuaweicloudVbsBackupPolicyV2 from './data-huaweicloud-vbs-backup-policy-v2'; +export * as dataHuaweicloudVbsBackupV2 from './data-huaweicloud-vbs-backup-v2'; +export * as dataHuaweicloudVpc from './data-huaweicloud-vpc'; +export * as dataHuaweicloudVpcAddressGroups from './data-huaweicloud-vpc-address-groups'; +export * as dataHuaweicloudVpcBandwidth from './data-huaweicloud-vpc-bandwidth'; +export * as dataHuaweicloudVpcBandwidths from './data-huaweicloud-vpc-bandwidths'; +export * as dataHuaweicloudVpcEip from './data-huaweicloud-vpc-eip'; +export * as dataHuaweicloudVpcEips from './data-huaweicloud-vpc-eips'; +export * as dataHuaweicloudVpcFlowLogs from './data-huaweicloud-vpc-flow-logs'; +export * as dataHuaweicloudVpcIds from './data-huaweicloud-vpc-ids'; +export * as dataHuaweicloudVpcIdsV1 from './data-huaweicloud-vpc-ids-v1'; +export * as dataHuaweicloudVpcInternetGateways from './data-huaweicloud-vpc-internet-gateways'; +export * as dataHuaweicloudVpcNetworkAcls from './data-huaweicloud-vpc-network-acls'; +export * as dataHuaweicloudVpcPeeringConnection from './data-huaweicloud-vpc-peering-connection'; +export * as dataHuaweicloudVpcPeeringConnectionV2 from './data-huaweicloud-vpc-peering-connection-v2'; +export * as dataHuaweicloudVpcRoute from './data-huaweicloud-vpc-route'; +export * as dataHuaweicloudVpcRouteIds from './data-huaweicloud-vpc-route-ids'; +export * as dataHuaweicloudVpcRouteIdsV2 from './data-huaweicloud-vpc-route-ids-v2'; +export * as dataHuaweicloudVpcRouteTable from './data-huaweicloud-vpc-route-table'; +export * as dataHuaweicloudVpcRouteV2 from './data-huaweicloud-vpc-route-v2'; +export * as dataHuaweicloudVpcRoutes from './data-huaweicloud-vpc-routes'; +export * as dataHuaweicloudVpcSubNetworkInterfaces from './data-huaweicloud-vpc-sub-network-interfaces'; +export * as dataHuaweicloudVpcSubnet from './data-huaweicloud-vpc-subnet'; +export * as dataHuaweicloudVpcSubnetIds from './data-huaweicloud-vpc-subnet-ids'; +export * as dataHuaweicloudVpcSubnetIdsV1 from './data-huaweicloud-vpc-subnet-ids-v1'; +export * as dataHuaweicloudVpcSubnetV1 from './data-huaweicloud-vpc-subnet-v1'; +export * as dataHuaweicloudVpcSubnets from './data-huaweicloud-vpc-subnets'; +export * as dataHuaweicloudVpcTrafficMirrorFilterRules from './data-huaweicloud-vpc-traffic-mirror-filter-rules'; +export * as dataHuaweicloudVpcTrafficMirrorFilters from './data-huaweicloud-vpc-traffic-mirror-filters'; +export * as dataHuaweicloudVpcTrafficMirrorSessions from './data-huaweicloud-vpc-traffic-mirror-sessions'; +export * as dataHuaweicloudVpcV1 from './data-huaweicloud-vpc-v1'; +export * as dataHuaweicloudVpcepEndpoints from './data-huaweicloud-vpcep-endpoints'; +export * as dataHuaweicloudVpcepPublicServices from './data-huaweicloud-vpcep-public-services'; +export * as dataHuaweicloudVpcepQuotas from './data-huaweicloud-vpcep-quotas'; +export * as dataHuaweicloudVpcepServiceConnections from './data-huaweicloud-vpcep-service-connections'; +export * as dataHuaweicloudVpcepServicePermissions from './data-huaweicloud-vpcep-service-permissions'; +export * as dataHuaweicloudVpcepServiceSummary from './data-huaweicloud-vpcep-service-summary'; +export * as dataHuaweicloudVpcepServices from './data-huaweicloud-vpcep-services'; +export * as dataHuaweicloudVpcs from './data-huaweicloud-vpcs'; +export * as dataHuaweicloudVpnAccessPolicies from './data-huaweicloud-vpn-access-policies'; +export * as dataHuaweicloudVpnConnectionHealthChecks from './data-huaweicloud-vpn-connection-health-checks'; +export * as dataHuaweicloudVpnConnections from './data-huaweicloud-vpn-connections'; +export * as dataHuaweicloudVpnCustomerGateways from './data-huaweicloud-vpn-customer-gateways'; +export * as dataHuaweicloudVpnGatewayAvailabilityZones from './data-huaweicloud-vpn-gateway-availability-zones'; +export * as dataHuaweicloudVpnGateways from './data-huaweicloud-vpn-gateways'; +export * as dataHuaweicloudVpnP2CGatewayAvailabilityZones from './data-huaweicloud-vpn-p2c-gateway-availability-zones'; +export * as dataHuaweicloudVpnP2CGatewayConnections from './data-huaweicloud-vpn-p2c-gateway-connections'; +export * as dataHuaweicloudVpnP2CGateways from './data-huaweicloud-vpn-p2c-gateways'; +export * as dataHuaweicloudVpnServers from './data-huaweicloud-vpn-servers'; +export * as dataHuaweicloudVpnUserGroups from './data-huaweicloud-vpn-user-groups'; +export * as dataHuaweicloudVpnUsers from './data-huaweicloud-vpn-users'; +export * as dataHuaweicloudWafAddressGroups from './data-huaweicloud-waf-address-groups'; +export * as dataHuaweicloudWafCertificate from './data-huaweicloud-waf-certificate'; +export * as dataHuaweicloudWafCertificates from './data-huaweicloud-waf-certificates'; +export * as dataHuaweicloudWafDedicatedDomains from './data-huaweicloud-waf-dedicated-domains'; +export * as dataHuaweicloudWafDedicatedInstances from './data-huaweicloud-waf-dedicated-instances'; +export * as dataHuaweicloudWafDomains from './data-huaweicloud-waf-domains'; +export * as dataHuaweicloudWafInstanceGroups from './data-huaweicloud-waf-instance-groups'; +export * as dataHuaweicloudWafPolicies from './data-huaweicloud-waf-policies'; +export * as dataHuaweicloudWafReferenceTables from './data-huaweicloud-waf-reference-tables'; +export * as dataHuaweicloudWafRulesAntiCrawler from './data-huaweicloud-waf-rules-anti-crawler'; +export * as dataHuaweicloudWafRulesBlacklist from './data-huaweicloud-waf-rules-blacklist'; +export * as dataHuaweicloudWafRulesCcProtection from './data-huaweicloud-waf-rules-cc-protection'; +export * as dataHuaweicloudWafRulesDataMasking from './data-huaweicloud-waf-rules-data-masking'; +export * as dataHuaweicloudWafRulesGeolocationAccessControl from './data-huaweicloud-waf-rules-geolocation-access-control'; +export * as dataHuaweicloudWafRulesGlobalProtectionWhitelist from './data-huaweicloud-waf-rules-global-protection-whitelist'; +export * as dataHuaweicloudWafRulesInformationLeakagePrevention from './data-huaweicloud-waf-rules-information-leakage-prevention'; +export * as dataHuaweicloudWafRulesKnownAttackSource from './data-huaweicloud-waf-rules-known-attack-source'; +export * as dataHuaweicloudWafRulesPreciseProtection from './data-huaweicloud-waf-rules-precise-protection'; +export * as dataHuaweicloudWafRulesWebTamperProtection from './data-huaweicloud-waf-rules-web-tamper-protection'; +export * as dataHuaweicloudWafSourceIps from './data-huaweicloud-waf-source-ips'; +export * as dataHuaweicloudWorkspaceAppGroups from './data-huaweicloud-workspace-app-groups'; +export * as dataHuaweicloudWorkspaceAppNasStorages from './data-huaweicloud-workspace-app-nas-storages'; +export * as dataHuaweicloudWorkspaceAppPublishableApps from './data-huaweicloud-workspace-app-publishable-apps'; +export * as dataHuaweicloudWorkspaceAppStoragePolicies from './data-huaweicloud-workspace-app-storage-policies'; +export * as dataHuaweicloudWorkspaceDesktops from './data-huaweicloud-workspace-desktops'; +export * as dataHuaweicloudWorkspaceFlavors from './data-huaweicloud-workspace-flavors'; +export * as provider from './provider'; + diff --git a/src/constructs/providers/huaweicloud/iotda-access-credential/README.md b/src/constructs/providers/huaweicloud/iotda-access-credential/README.md new file mode 100644 index 00000000..930b1f64 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-access-credential/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_access_credential` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_access_credential`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential). diff --git a/src/constructs/providers/huaweicloud/iotda-access-credential/index.ts b/src/constructs/providers/huaweicloud/iotda-access-credential/index.ts new file mode 100644 index 00000000..d7dd27bd --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-access-credential/index.ts @@ -0,0 +1,210 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaAccessCredentialConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential#force_disconnect IotdaAccessCredential#force_disconnect} + */ + readonly forceDisconnect?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential#id IotdaAccessCredential#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential#region IotdaAccessCredential#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential#type IotdaAccessCredential#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential huaweicloud_iotda_access_credential} +*/ +export class IotdaAccessCredential extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_access_credential"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaAccessCredential resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaAccessCredential to import + * @param importFromId The id of the existing IotdaAccessCredential that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaAccessCredential to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_access_credential", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_access_credential huaweicloud_iotda_access_credential} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaAccessCredentialConfig = {} + */ + public constructor(scope: Construct, id: string, config: IotdaAccessCredentialConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_access_credential', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._forceDisconnect = config.forceDisconnect; + this._id = config.id; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_code - computed: true, optional: false, required: false + public get accessCode() { + return this.getStringAttribute('access_code'); + } + + // access_key - computed: true, optional: false, required: false + public get accessKey() { + return this.getStringAttribute('access_key'); + } + + // force_disconnect - computed: false, optional: true, required: false + private _forceDisconnect?: boolean | cdktf.IResolvable; + public get forceDisconnect() { + return this.getBooleanAttribute('force_disconnect'); + } + public set forceDisconnect(value: boolean | cdktf.IResolvable) { + this._forceDisconnect = value; + } + public resetForceDisconnect() { + this._forceDisconnect = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDisconnectInput() { + return this._forceDisconnect; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + force_disconnect: cdktf.booleanToTerraform(this._forceDisconnect), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + force_disconnect: { + value: cdktf.booleanToHclTerraform(this._forceDisconnect), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-amqp/README.md b/src/constructs/providers/huaweicloud/iotda-amqp/README.md new file mode 100644 index 00000000..d44017ef --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-amqp/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_amqp` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_amqp`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp). diff --git a/src/constructs/providers/huaweicloud/iotda-amqp/index.ts b/src/constructs/providers/huaweicloud/iotda-amqp/index.ts new file mode 100644 index 00000000..91bf20e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-amqp/index.ts @@ -0,0 +1,169 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaAmqpConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp#id IotdaAmqp#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp#name IotdaAmqp#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp#region IotdaAmqp#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp huaweicloud_iotda_amqp} +*/ +export class IotdaAmqp extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_amqp"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaAmqp resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaAmqp to import + * @param importFromId The id of the existing IotdaAmqp that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaAmqp to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_amqp", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_amqp huaweicloud_iotda_amqp} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaAmqpConfig + */ + public constructor(scope: Construct, id: string, config: IotdaAmqpConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_amqp', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-batchtask-file/README.md b/src/constructs/providers/huaweicloud/iotda-batchtask-file/README.md new file mode 100644 index 00000000..f39c6148 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-batchtask-file/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_batchtask_file` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_batchtask_file`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file). diff --git a/src/constructs/providers/huaweicloud/iotda-batchtask-file/index.ts b/src/constructs/providers/huaweicloud/iotda-batchtask-file/index.ts new file mode 100644 index 00000000..e97fcd02 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-batchtask-file/index.ts @@ -0,0 +1,179 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaBatchtaskFileConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file#content IotdaBatchtaskFile#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file#id IotdaBatchtaskFile#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file#region IotdaBatchtaskFile#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file huaweicloud_iotda_batchtask_file} +*/ +export class IotdaBatchtaskFile extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_batchtask_file"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaBatchtaskFile resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaBatchtaskFile to import + * @param importFromId The id of the existing IotdaBatchtaskFile that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaBatchtaskFile to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_batchtask_file", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask_file huaweicloud_iotda_batchtask_file} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaBatchtaskFileConfig + */ + public constructor(scope: Construct, id: string, config: IotdaBatchtaskFileConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_batchtask_file', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-batchtask/README.md b/src/constructs/providers/huaweicloud/iotda-batchtask/README.md new file mode 100644 index 00000000..0f777efa --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-batchtask/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_batchtask` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_batchtask`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask). diff --git a/src/constructs/providers/huaweicloud/iotda-batchtask/index.ts b/src/constructs/providers/huaweicloud/iotda-batchtask/index.ts new file mode 100644 index 00000000..5cbed8c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-batchtask/index.ts @@ -0,0 +1,828 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaBatchtaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#id IotdaBatchtask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#name IotdaBatchtask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#region IotdaBatchtask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#space_id IotdaBatchtask#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#targets IotdaBatchtask#targets} + */ + readonly targets?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#targets_file IotdaBatchtask#targets_file} + */ + readonly targetsFile?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#type IotdaBatchtask#type} + */ + readonly type: string; + /** + * targets_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#targets_filter IotdaBatchtask#targets_filter} + */ + readonly targetsFilter?: IotdaBatchtaskTargetsFilter[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#timeouts IotdaBatchtask#timeouts} + */ + readonly timeouts?: IotdaBatchtaskTimeouts; +} +export interface IotdaBatchtaskTaskDetailsError { +} + +export function iotdaBatchtaskTaskDetailsErrorToTerraform(struct?: IotdaBatchtaskTaskDetailsError): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iotdaBatchtaskTaskDetailsErrorToHclTerraform(struct?: IotdaBatchtaskTaskDetailsError): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IotdaBatchtaskTaskDetailsErrorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaBatchtaskTaskDetailsError | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaBatchtaskTaskDetailsError | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } +} + +export class IotdaBatchtaskTaskDetailsErrorList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaBatchtaskTaskDetailsErrorOutputReference { + return new IotdaBatchtaskTaskDetailsErrorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaBatchtaskTaskDetails { +} + +export function iotdaBatchtaskTaskDetailsToTerraform(struct?: IotdaBatchtaskTaskDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iotdaBatchtaskTaskDetailsToHclTerraform(struct?: IotdaBatchtaskTaskDetails): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IotdaBatchtaskTaskDetailsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaBatchtaskTaskDetails | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaBatchtaskTaskDetails | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error - computed: true, optional: false, required: false + private _error = new IotdaBatchtaskTaskDetailsErrorList(this, "error", false); + public get error() { + return this._error; + } + + // output - computed: true, optional: false, required: false + public get output() { + return this.getStringAttribute('output'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // target - computed: true, optional: false, required: false + public get target() { + return this.getStringAttribute('target'); + } +} + +export class IotdaBatchtaskTaskDetailsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaBatchtaskTaskDetailsOutputReference { + return new IotdaBatchtaskTaskDetailsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaBatchtaskTaskProgress { +} + +export function iotdaBatchtaskTaskProgressToTerraform(struct?: IotdaBatchtaskTaskProgress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iotdaBatchtaskTaskProgressToHclTerraform(struct?: IotdaBatchtaskTaskProgress): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IotdaBatchtaskTaskProgressOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaBatchtaskTaskProgress | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaBatchtaskTaskProgress | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // fail - computed: true, optional: false, required: false + public get fail() { + return this.getNumberAttribute('fail'); + } + + // success - computed: true, optional: false, required: false + public get success() { + return this.getNumberAttribute('success'); + } + + // total - computed: true, optional: false, required: false + public get total() { + return this.getNumberAttribute('total'); + } +} + +export class IotdaBatchtaskTaskProgressList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaBatchtaskTaskProgressOutputReference { + return new IotdaBatchtaskTaskProgressOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaBatchtaskTargetsFilter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#group_ids IotdaBatchtask#group_ids} + */ + readonly groupIds: string[]; +} + +export function iotdaBatchtaskTargetsFilterToTerraform(struct?: IotdaBatchtaskTargetsFilter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.groupIds), + } +} + + +export function iotdaBatchtaskTargetsFilterToHclTerraform(struct?: IotdaBatchtaskTargetsFilter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.groupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaBatchtaskTargetsFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaBatchtaskTargetsFilter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._groupIds !== undefined) { + hasAnyValues = true; + internalValueResult.groupIds = this._groupIds; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaBatchtaskTargetsFilter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._groupIds = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._groupIds = value.groupIds; + } + } + + // group_ids - computed: false, optional: false, required: true + private _groupIds?: string[]; + public get groupIds() { + return this.getListAttribute('group_ids'); + } + public set groupIds(value: string[]) { + this._groupIds = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdsInput() { + return this._groupIds; + } +} + +export class IotdaBatchtaskTargetsFilterList extends cdktf.ComplexList { + public internalValue? : IotdaBatchtaskTargetsFilter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaBatchtaskTargetsFilterOutputReference { + return new IotdaBatchtaskTargetsFilterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaBatchtaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#create IotdaBatchtask#create} + */ + readonly create?: string; +} + +export function iotdaBatchtaskTimeoutsToTerraform(struct?: IotdaBatchtaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function iotdaBatchtaskTimeoutsToHclTerraform(struct?: IotdaBatchtaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaBatchtaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): IotdaBatchtaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaBatchtaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask huaweicloud_iotda_batchtask} +*/ +export class IotdaBatchtask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_batchtask"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaBatchtask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaBatchtask to import + * @param importFromId The id of the existing IotdaBatchtask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaBatchtask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_batchtask", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_batchtask huaweicloud_iotda_batchtask} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaBatchtaskConfig + */ + public constructor(scope: Construct, id: string, config: IotdaBatchtaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_batchtask', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spaceId = config.spaceId; + this._targets = config.targets; + this._targetsFile = config.targetsFile; + this._type = config.type; + this._targetsFilter.internalValue = config.targetsFilter; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: true, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_desc - computed: true, optional: false, required: false + public get statusDesc() { + return this.getStringAttribute('status_desc'); + } + + // targets - computed: false, optional: true, required: false + private _targets?: string[]; + public get targets() { + return this.getListAttribute('targets'); + } + public set targets(value: string[]) { + this._targets = value; + } + public resetTargets() { + this._targets = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetsInput() { + return this._targets; + } + + // targets_file - computed: false, optional: true, required: false + private _targetsFile?: string; + public get targetsFile() { + return this.getStringAttribute('targets_file'); + } + public set targetsFile(value: string) { + this._targetsFile = value; + } + public resetTargetsFile() { + this._targetsFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetsFileInput() { + return this._targetsFile; + } + + // task_details - computed: true, optional: false, required: false + private _taskDetails = new IotdaBatchtaskTaskDetailsList(this, "task_details", false); + public get taskDetails() { + return this._taskDetails; + } + + // task_progress - computed: true, optional: false, required: false + private _taskProgress = new IotdaBatchtaskTaskProgressList(this, "task_progress", false); + public get taskProgress() { + return this._taskProgress; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // targets_filter - computed: false, optional: true, required: false + private _targetsFilter = new IotdaBatchtaskTargetsFilterList(this, "targets_filter", false); + public get targetsFilter() { + return this._targetsFilter; + } + public putTargetsFilter(value: IotdaBatchtaskTargetsFilter[] | cdktf.IResolvable) { + this._targetsFilter.internalValue = value; + } + public resetTargetsFilter() { + this._targetsFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetsFilterInput() { + return this._targetsFilter.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new IotdaBatchtaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: IotdaBatchtaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + targets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._targets), + targets_file: cdktf.stringToTerraform(this._targetsFile), + type: cdktf.stringToTerraform(this._type), + targets_filter: cdktf.listMapper(iotdaBatchtaskTargetsFilterToTerraform, true)(this._targetsFilter.internalValue), + timeouts: iotdaBatchtaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + targets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._targets), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + targets_file: { + value: cdktf.stringToHclTerraform(this._targetsFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + targets_filter: { + value: cdktf.listMapperHcl(iotdaBatchtaskTargetsFilterToHclTerraform, true)(this._targetsFilter.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaBatchtaskTargetsFilterList", + }, + timeouts: { + value: iotdaBatchtaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "IotdaBatchtaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-data-backlog-policy/README.md b/src/constructs/providers/huaweicloud/iotda-data-backlog-policy/README.md new file mode 100644 index 00000000..0f933470 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-data-backlog-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_data_backlog_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_data_backlog_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy). diff --git a/src/constructs/providers/huaweicloud/iotda-data-backlog-policy/index.ts b/src/constructs/providers/huaweicloud/iotda-data-backlog-policy/index.ts new file mode 100644 index 00000000..991f5c38 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-data-backlog-policy/index.ts @@ -0,0 +1,256 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDataBacklogPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#backlog_size IotdaDataBacklogPolicy#backlog_size} + */ + readonly backlogSize?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#backlog_time IotdaDataBacklogPolicy#backlog_time} + */ + readonly backlogTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#description IotdaDataBacklogPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#id IotdaDataBacklogPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#name IotdaDataBacklogPolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#region IotdaDataBacklogPolicy#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy huaweicloud_iotda_data_backlog_policy} +*/ +export class IotdaDataBacklogPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_data_backlog_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDataBacklogPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDataBacklogPolicy to import + * @param importFromId The id of the existing IotdaDataBacklogPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDataBacklogPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_data_backlog_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_backlog_policy huaweicloud_iotda_data_backlog_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDataBacklogPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: IotdaDataBacklogPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_data_backlog_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backlogSize = config.backlogSize; + this._backlogTime = config.backlogTime; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // backlog_size - computed: true, optional: true, required: false + private _backlogSize?: string; + public get backlogSize() { + return this.getStringAttribute('backlog_size'); + } + public set backlogSize(value: string) { + this._backlogSize = value; + } + public resetBacklogSize() { + this._backlogSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get backlogSizeInput() { + return this._backlogSize; + } + + // backlog_time - computed: true, optional: true, required: false + private _backlogTime?: string; + public get backlogTime() { + return this.getStringAttribute('backlog_time'); + } + public set backlogTime(value: string) { + this._backlogTime = value; + } + public resetBacklogTime() { + this._backlogTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get backlogTimeInput() { + return this._backlogTime; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backlog_size: cdktf.stringToTerraform(this._backlogSize), + backlog_time: cdktf.stringToTerraform(this._backlogTime), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backlog_size: { + value: cdktf.stringToHclTerraform(this._backlogSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backlog_time: { + value: cdktf.stringToHclTerraform(this._backlogTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/README.md b/src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/README.md new file mode 100644 index 00000000..e22c1749 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_data_flow_control_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_data_flow_control_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy). diff --git a/src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/index.ts b/src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/index.ts new file mode 100644 index 00000000..ed8b2071 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-data-flow-control-policy/index.ts @@ -0,0 +1,284 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDataFlowControlPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#description IotdaDataFlowControlPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#id IotdaDataFlowControlPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#limit IotdaDataFlowControlPolicy#limit} + */ + readonly limit?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#name IotdaDataFlowControlPolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#region IotdaDataFlowControlPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#scope IotdaDataFlowControlPolicy#scope} + */ + readonly scope?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#scope_value IotdaDataFlowControlPolicy#scope_value} + */ + readonly scopeValue?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy huaweicloud_iotda_data_flow_control_policy} +*/ +export class IotdaDataFlowControlPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_data_flow_control_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDataFlowControlPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDataFlowControlPolicy to import + * @param importFromId The id of the existing IotdaDataFlowControlPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDataFlowControlPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_data_flow_control_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_data_flow_control_policy huaweicloud_iotda_data_flow_control_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDataFlowControlPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: IotdaDataFlowControlPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_data_flow_control_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._limit = config.limit; + this._name = config.name; + this._region = config.region; + this._scope = config.scope; + this._scopeValue = config.scopeValue; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // limit - computed: true, optional: true, required: false + private _limit?: number; + public get limit() { + return this.getNumberAttribute('limit'); + } + public set limit(value: number) { + this._limit = value; + } + public resetLimit() { + this._limit = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitInput() { + return this._limit; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scope - computed: true, optional: true, required: false + private _scope?: string; + public get scope() { + return this.getStringAttribute('scope'); + } + public set scope(value: string) { + this._scope = value; + } + public resetScope() { + this._scope = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeInput() { + return this._scope; + } + + // scope_value - computed: true, optional: true, required: false + private _scopeValue?: string; + public get scopeValue() { + return this.getStringAttribute('scope_value'); + } + public set scopeValue(value: string) { + this._scopeValue = value; + } + public resetScopeValue() { + this._scopeValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeValueInput() { + return this._scopeValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + limit: cdktf.numberToTerraform(this._limit), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + scope: cdktf.stringToTerraform(this._scope), + scope_value: cdktf.stringToTerraform(this._scopeValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + limit: { + value: cdktf.numberToHclTerraform(this._limit), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scope: { + value: cdktf.stringToHclTerraform(this._scope), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scope_value: { + value: cdktf.stringToHclTerraform(this._scopeValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/README.md b/src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/README.md new file mode 100644 index 00000000..1ec2ae0d --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_dataforwarding_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_dataforwarding_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule). diff --git a/src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/index.ts b/src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/index.ts new file mode 100644 index 00000000..a61b3887 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-dataforwarding-rule/index.ts @@ -0,0 +1,1707 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDataforwardingRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#description IotdaDataforwardingRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#enabled IotdaDataforwardingRule#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#id IotdaDataforwardingRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#name IotdaDataforwardingRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#region IotdaDataforwardingRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#select IotdaDataforwardingRule#select} + */ + readonly select?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#space_id IotdaDataforwardingRule#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#trigger IotdaDataforwardingRule#trigger} + */ + readonly trigger: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#where IotdaDataforwardingRule#where} + */ + readonly where?: string; + /** + * targets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#targets IotdaDataforwardingRule#targets} + */ + readonly targets?: IotdaDataforwardingRuleTargets[] | cdktf.IResolvable; +} +export interface IotdaDataforwardingRuleTargetsAmqpForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#queue_name IotdaDataforwardingRule#queue_name} + */ + readonly queueName: string; +} + +export function iotdaDataforwardingRuleTargetsAmqpForwardingToTerraform(struct?: IotdaDataforwardingRuleTargetsAmqpForwardingOutputReference | IotdaDataforwardingRuleTargetsAmqpForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + queue_name: cdktf.stringToTerraform(struct!.queueName), + } +} + + +export function iotdaDataforwardingRuleTargetsAmqpForwardingToHclTerraform(struct?: IotdaDataforwardingRuleTargetsAmqpForwardingOutputReference | IotdaDataforwardingRuleTargetsAmqpForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + queue_name: { + value: cdktf.stringToHclTerraform(struct!.queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsAmqpForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsAmqpForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._queueName !== undefined) { + hasAnyValues = true; + internalValueResult.queueName = this._queueName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsAmqpForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._queueName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._queueName = value.queueName; + } + } + + // queue_name - computed: false, optional: false, required: true + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } +} +export interface IotdaDataforwardingRuleTargetsDisForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#project_id IotdaDataforwardingRule#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#region IotdaDataforwardingRule#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#stream_id IotdaDataforwardingRule#stream_id} + */ + readonly streamId: string; +} + +export function iotdaDataforwardingRuleTargetsDisForwardingToTerraform(struct?: IotdaDataforwardingRuleTargetsDisForwardingOutputReference | IotdaDataforwardingRuleTargetsDisForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project_id: cdktf.stringToTerraform(struct!.projectId), + region: cdktf.stringToTerraform(struct!.region), + stream_id: cdktf.stringToTerraform(struct!.streamId), + } +} + + +export function iotdaDataforwardingRuleTargetsDisForwardingToHclTerraform(struct?: IotdaDataforwardingRuleTargetsDisForwardingOutputReference | IotdaDataforwardingRuleTargetsDisForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stream_id: { + value: cdktf.stringToHclTerraform(struct!.streamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsDisForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsDisForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._streamId !== undefined) { + hasAnyValues = true; + internalValueResult.streamId = this._streamId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsDisForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._projectId = undefined; + this._region = undefined; + this._streamId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._projectId = value.projectId; + this._region = value.region; + this._streamId = value.streamId; + } + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stream_id - computed: false, optional: false, required: true + private _streamId?: string; + public get streamId() { + return this.getStringAttribute('stream_id'); + } + public set streamId(value: string) { + this._streamId = value; + } + // Temporarily expose input value. Use with caution. + public get streamIdInput() { + return this._streamId; + } +} +export interface IotdaDataforwardingRuleTargetsFgsForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#func_name IotdaDataforwardingRule#func_name} + */ + readonly funcName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#func_urn IotdaDataforwardingRule#func_urn} + */ + readonly funcUrn: string; +} + +export function iotdaDataforwardingRuleTargetsFgsForwardingToTerraform(struct?: IotdaDataforwardingRuleTargetsFgsForwardingOutputReference | IotdaDataforwardingRuleTargetsFgsForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + func_name: cdktf.stringToTerraform(struct!.funcName), + func_urn: cdktf.stringToTerraform(struct!.funcUrn), + } +} + + +export function iotdaDataforwardingRuleTargetsFgsForwardingToHclTerraform(struct?: IotdaDataforwardingRuleTargetsFgsForwardingOutputReference | IotdaDataforwardingRuleTargetsFgsForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + func_name: { + value: cdktf.stringToHclTerraform(struct!.funcName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + func_urn: { + value: cdktf.stringToHclTerraform(struct!.funcUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsFgsForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsFgsForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._funcName !== undefined) { + hasAnyValues = true; + internalValueResult.funcName = this._funcName; + } + if (this._funcUrn !== undefined) { + hasAnyValues = true; + internalValueResult.funcUrn = this._funcUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsFgsForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._funcName = undefined; + this._funcUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._funcName = value.funcName; + this._funcUrn = value.funcUrn; + } + } + + // func_name - computed: false, optional: false, required: true + private _funcName?: string; + public get funcName() { + return this.getStringAttribute('func_name'); + } + public set funcName(value: string) { + this._funcName = value; + } + // Temporarily expose input value. Use with caution. + public get funcNameInput() { + return this._funcName; + } + + // func_urn - computed: false, optional: false, required: true + private _funcUrn?: string; + public get funcUrn() { + return this.getStringAttribute('func_urn'); + } + public set funcUrn(value: string) { + this._funcUrn = value; + } + // Temporarily expose input value. Use with caution. + public get funcUrnInput() { + return this._funcUrn; + } +} +export interface IotdaDataforwardingRuleTargetsHttpForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#url IotdaDataforwardingRule#url} + */ + readonly url: string; +} + +export function iotdaDataforwardingRuleTargetsHttpForwardingToTerraform(struct?: IotdaDataforwardingRuleTargetsHttpForwardingOutputReference | IotdaDataforwardingRuleTargetsHttpForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + url: cdktf.stringToTerraform(struct!.url), + } +} + + +export function iotdaDataforwardingRuleTargetsHttpForwardingToHclTerraform(struct?: IotdaDataforwardingRuleTargetsHttpForwardingOutputReference | IotdaDataforwardingRuleTargetsHttpForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + url: { + value: cdktf.stringToHclTerraform(struct!.url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsHttpForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsHttpForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._url !== undefined) { + hasAnyValues = true; + internalValueResult.url = this._url; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsHttpForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._url = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._url = value.url; + } + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } +} +export interface IotdaDataforwardingRuleTargetsKafkaForwardingAddresses { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#domain IotdaDataforwardingRule#domain} + */ + readonly domain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#ip IotdaDataforwardingRule#ip} + */ + readonly ip?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#port IotdaDataforwardingRule#port} + */ + readonly port: number; +} + +export function iotdaDataforwardingRuleTargetsKafkaForwardingAddressesToTerraform(struct?: IotdaDataforwardingRuleTargetsKafkaForwardingAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + domain: cdktf.stringToTerraform(struct!.domain), + ip: cdktf.stringToTerraform(struct!.ip), + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function iotdaDataforwardingRuleTargetsKafkaForwardingAddressesToHclTerraform(struct?: IotdaDataforwardingRuleTargetsKafkaForwardingAddresses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + domain: { + value: cdktf.stringToHclTerraform(struct!.domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsKafkaForwardingAddressesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsKafkaForwardingAddresses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._domain !== undefined) { + hasAnyValues = true; + internalValueResult.domain = this._domain; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsKafkaForwardingAddresses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._domain = undefined; + this._ip = undefined; + this._port = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._domain = value.domain; + this._ip = value.ip; + this._port = value.port; + } + } + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // ip - computed: false, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} + +export class IotdaDataforwardingRuleTargetsKafkaForwardingAddressesList extends cdktf.ComplexList { + public internalValue? : IotdaDataforwardingRuleTargetsKafkaForwardingAddresses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDataforwardingRuleTargetsKafkaForwardingAddressesOutputReference { + return new IotdaDataforwardingRuleTargetsKafkaForwardingAddressesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaDataforwardingRuleTargetsKafkaForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#password IotdaDataforwardingRule#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#project_id IotdaDataforwardingRule#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#region IotdaDataforwardingRule#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#topic IotdaDataforwardingRule#topic} + */ + readonly topic: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#user_name IotdaDataforwardingRule#user_name} + */ + readonly userName?: string; + /** + * addresses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#addresses IotdaDataforwardingRule#addresses} + */ + readonly addresses: IotdaDataforwardingRuleTargetsKafkaForwardingAddresses[] | cdktf.IResolvable; +} + +export function iotdaDataforwardingRuleTargetsKafkaForwardingToTerraform(struct?: IotdaDataforwardingRuleTargetsKafkaForwardingOutputReference | IotdaDataforwardingRuleTargetsKafkaForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + password: cdktf.stringToTerraform(struct!.password), + project_id: cdktf.stringToTerraform(struct!.projectId), + region: cdktf.stringToTerraform(struct!.region), + topic: cdktf.stringToTerraform(struct!.topic), + user_name: cdktf.stringToTerraform(struct!.userName), + addresses: cdktf.listMapper(iotdaDataforwardingRuleTargetsKafkaForwardingAddressesToTerraform, true)(struct!.addresses), + } +} + + +export function iotdaDataforwardingRuleTargetsKafkaForwardingToHclTerraform(struct?: IotdaDataforwardingRuleTargetsKafkaForwardingOutputReference | IotdaDataforwardingRuleTargetsKafkaForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(struct!.topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + addresses: { + value: cdktf.listMapperHcl(iotdaDataforwardingRuleTargetsKafkaForwardingAddressesToHclTerraform, true)(struct!.addresses), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsKafkaForwardingAddressesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsKafkaForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsKafkaForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._topic !== undefined) { + hasAnyValues = true; + internalValueResult.topic = this._topic; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + if (this._addresses?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.addresses = this._addresses?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsKafkaForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._password = undefined; + this._projectId = undefined; + this._region = undefined; + this._topic = undefined; + this._userName = undefined; + this._addresses.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._password = value.password; + this._projectId = value.projectId; + this._region = value.region; + this._topic = value.topic; + this._userName = value.userName; + this._addresses.internalValue = value.addresses; + } + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // addresses - computed: false, optional: false, required: true + private _addresses = new IotdaDataforwardingRuleTargetsKafkaForwardingAddressesList(this, "addresses", false); + public get addresses() { + return this._addresses; + } + public putAddresses(value: IotdaDataforwardingRuleTargetsKafkaForwardingAddresses[] | cdktf.IResolvable) { + this._addresses.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get addressesInput() { + return this._addresses.internalValue; + } +} +export interface IotdaDataforwardingRuleTargetsObsForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#bucket IotdaDataforwardingRule#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#custom_directory IotdaDataforwardingRule#custom_directory} + */ + readonly customDirectory?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#project_id IotdaDataforwardingRule#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#region IotdaDataforwardingRule#region} + */ + readonly region: string; +} + +export function iotdaDataforwardingRuleTargetsObsForwardingToTerraform(struct?: IotdaDataforwardingRuleTargetsObsForwardingOutputReference | IotdaDataforwardingRuleTargetsObsForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket: cdktf.stringToTerraform(struct!.bucket), + custom_directory: cdktf.stringToTerraform(struct!.customDirectory), + project_id: cdktf.stringToTerraform(struct!.projectId), + region: cdktf.stringToTerraform(struct!.region), + } +} + + +export function iotdaDataforwardingRuleTargetsObsForwardingToHclTerraform(struct?: IotdaDataforwardingRuleTargetsObsForwardingOutputReference | IotdaDataforwardingRuleTargetsObsForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_directory: { + value: cdktf.stringToHclTerraform(struct!.customDirectory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsObsForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDataforwardingRuleTargetsObsForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._customDirectory !== undefined) { + hasAnyValues = true; + internalValueResult.customDirectory = this._customDirectory; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargetsObsForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucket = undefined; + this._customDirectory = undefined; + this._projectId = undefined; + this._region = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucket = value.bucket; + this._customDirectory = value.customDirectory; + this._projectId = value.projectId; + this._region = value.region; + } + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // custom_directory - computed: true, optional: true, required: false + private _customDirectory?: string; + public get customDirectory() { + return this.getStringAttribute('custom_directory'); + } + public set customDirectory(value: string) { + this._customDirectory = value; + } + public resetCustomDirectory() { + this._customDirectory = undefined; + } + // Temporarily expose input value. Use with caution. + public get customDirectoryInput() { + return this._customDirectory; + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } +} +export interface IotdaDataforwardingRuleTargets { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#type IotdaDataforwardingRule#type} + */ + readonly type: string; + /** + * amqp_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#amqp_forwarding IotdaDataforwardingRule#amqp_forwarding} + */ + readonly amqpForwarding?: IotdaDataforwardingRuleTargetsAmqpForwarding; + /** + * dis_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#dis_forwarding IotdaDataforwardingRule#dis_forwarding} + */ + readonly disForwarding?: IotdaDataforwardingRuleTargetsDisForwarding; + /** + * fgs_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#fgs_forwarding IotdaDataforwardingRule#fgs_forwarding} + */ + readonly fgsForwarding?: IotdaDataforwardingRuleTargetsFgsForwarding; + /** + * http_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#http_forwarding IotdaDataforwardingRule#http_forwarding} + */ + readonly httpForwarding?: IotdaDataforwardingRuleTargetsHttpForwarding; + /** + * kafka_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#kafka_forwarding IotdaDataforwardingRule#kafka_forwarding} + */ + readonly kafkaForwarding?: IotdaDataforwardingRuleTargetsKafkaForwarding; + /** + * obs_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#obs_forwarding IotdaDataforwardingRule#obs_forwarding} + */ + readonly obsForwarding?: IotdaDataforwardingRuleTargetsObsForwarding; +} + +export function iotdaDataforwardingRuleTargetsToTerraform(struct?: IotdaDataforwardingRuleTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + amqp_forwarding: iotdaDataforwardingRuleTargetsAmqpForwardingToTerraform(struct!.amqpForwarding), + dis_forwarding: iotdaDataforwardingRuleTargetsDisForwardingToTerraform(struct!.disForwarding), + fgs_forwarding: iotdaDataforwardingRuleTargetsFgsForwardingToTerraform(struct!.fgsForwarding), + http_forwarding: iotdaDataforwardingRuleTargetsHttpForwardingToTerraform(struct!.httpForwarding), + kafka_forwarding: iotdaDataforwardingRuleTargetsKafkaForwardingToTerraform(struct!.kafkaForwarding), + obs_forwarding: iotdaDataforwardingRuleTargetsObsForwardingToTerraform(struct!.obsForwarding), + } +} + + +export function iotdaDataforwardingRuleTargetsToHclTerraform(struct?: IotdaDataforwardingRuleTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + amqp_forwarding: { + value: iotdaDataforwardingRuleTargetsAmqpForwardingToHclTerraform(struct!.amqpForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsAmqpForwardingList", + }, + dis_forwarding: { + value: iotdaDataforwardingRuleTargetsDisForwardingToHclTerraform(struct!.disForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsDisForwardingList", + }, + fgs_forwarding: { + value: iotdaDataforwardingRuleTargetsFgsForwardingToHclTerraform(struct!.fgsForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsFgsForwardingList", + }, + http_forwarding: { + value: iotdaDataforwardingRuleTargetsHttpForwardingToHclTerraform(struct!.httpForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsHttpForwardingList", + }, + kafka_forwarding: { + value: iotdaDataforwardingRuleTargetsKafkaForwardingToHclTerraform(struct!.kafkaForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsKafkaForwardingList", + }, + obs_forwarding: { + value: iotdaDataforwardingRuleTargetsObsForwardingToHclTerraform(struct!.obsForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDataforwardingRuleTargetsObsForwardingList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDataforwardingRuleTargetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDataforwardingRuleTargets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._amqpForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.amqpForwarding = this._amqpForwarding?.internalValue; + } + if (this._disForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.disForwarding = this._disForwarding?.internalValue; + } + if (this._fgsForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.fgsForwarding = this._fgsForwarding?.internalValue; + } + if (this._httpForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpForwarding = this._httpForwarding?.internalValue; + } + if (this._kafkaForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.kafkaForwarding = this._kafkaForwarding?.internalValue; + } + if (this._obsForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.obsForwarding = this._obsForwarding?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDataforwardingRuleTargets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._type = undefined; + this._amqpForwarding.internalValue = undefined; + this._disForwarding.internalValue = undefined; + this._fgsForwarding.internalValue = undefined; + this._httpForwarding.internalValue = undefined; + this._kafkaForwarding.internalValue = undefined; + this._obsForwarding.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._type = value.type; + this._amqpForwarding.internalValue = value.amqpForwarding; + this._disForwarding.internalValue = value.disForwarding; + this._fgsForwarding.internalValue = value.fgsForwarding; + this._httpForwarding.internalValue = value.httpForwarding; + this._kafkaForwarding.internalValue = value.kafkaForwarding; + this._obsForwarding.internalValue = value.obsForwarding; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // amqp_forwarding - computed: false, optional: true, required: false + private _amqpForwarding = new IotdaDataforwardingRuleTargetsAmqpForwardingOutputReference(this, "amqp_forwarding"); + public get amqpForwarding() { + return this._amqpForwarding; + } + public putAmqpForwarding(value: IotdaDataforwardingRuleTargetsAmqpForwarding) { + this._amqpForwarding.internalValue = value; + } + public resetAmqpForwarding() { + this._amqpForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get amqpForwardingInput() { + return this._amqpForwarding.internalValue; + } + + // dis_forwarding - computed: false, optional: true, required: false + private _disForwarding = new IotdaDataforwardingRuleTargetsDisForwardingOutputReference(this, "dis_forwarding"); + public get disForwarding() { + return this._disForwarding; + } + public putDisForwarding(value: IotdaDataforwardingRuleTargetsDisForwarding) { + this._disForwarding.internalValue = value; + } + public resetDisForwarding() { + this._disForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get disForwardingInput() { + return this._disForwarding.internalValue; + } + + // fgs_forwarding - computed: false, optional: true, required: false + private _fgsForwarding = new IotdaDataforwardingRuleTargetsFgsForwardingOutputReference(this, "fgs_forwarding"); + public get fgsForwarding() { + return this._fgsForwarding; + } + public putFgsForwarding(value: IotdaDataforwardingRuleTargetsFgsForwarding) { + this._fgsForwarding.internalValue = value; + } + public resetFgsForwarding() { + this._fgsForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get fgsForwardingInput() { + return this._fgsForwarding.internalValue; + } + + // http_forwarding - computed: false, optional: true, required: false + private _httpForwarding = new IotdaDataforwardingRuleTargetsHttpForwardingOutputReference(this, "http_forwarding"); + public get httpForwarding() { + return this._httpForwarding; + } + public putHttpForwarding(value: IotdaDataforwardingRuleTargetsHttpForwarding) { + this._httpForwarding.internalValue = value; + } + public resetHttpForwarding() { + this._httpForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpForwardingInput() { + return this._httpForwarding.internalValue; + } + + // kafka_forwarding - computed: false, optional: true, required: false + private _kafkaForwarding = new IotdaDataforwardingRuleTargetsKafkaForwardingOutputReference(this, "kafka_forwarding"); + public get kafkaForwarding() { + return this._kafkaForwarding; + } + public putKafkaForwarding(value: IotdaDataforwardingRuleTargetsKafkaForwarding) { + this._kafkaForwarding.internalValue = value; + } + public resetKafkaForwarding() { + this._kafkaForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaForwardingInput() { + return this._kafkaForwarding.internalValue; + } + + // obs_forwarding - computed: false, optional: true, required: false + private _obsForwarding = new IotdaDataforwardingRuleTargetsObsForwardingOutputReference(this, "obs_forwarding"); + public get obsForwarding() { + return this._obsForwarding; + } + public putObsForwarding(value: IotdaDataforwardingRuleTargetsObsForwarding) { + this._obsForwarding.internalValue = value; + } + public resetObsForwarding() { + this._obsForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsForwardingInput() { + return this._obsForwarding.internalValue; + } +} + +export class IotdaDataforwardingRuleTargetsList extends cdktf.ComplexList { + public internalValue? : IotdaDataforwardingRuleTargets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDataforwardingRuleTargetsOutputReference { + return new IotdaDataforwardingRuleTargetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule huaweicloud_iotda_dataforwarding_rule} +*/ +export class IotdaDataforwardingRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_dataforwarding_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDataforwardingRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDataforwardingRule to import + * @param importFromId The id of the existing IotdaDataforwardingRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDataforwardingRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_dataforwarding_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_dataforwarding_rule huaweicloud_iotda_dataforwarding_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDataforwardingRuleConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDataforwardingRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_dataforwarding_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._select = config.select; + this._spaceId = config.spaceId; + this._trigger = config.trigger; + this._where = config.where; + this._targets.internalValue = config.targets; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // select - computed: false, optional: true, required: false + private _select?: string; + public get select() { + return this.getStringAttribute('select'); + } + public set select(value: string) { + this._select = value; + } + public resetSelect() { + this._select = undefined; + } + // Temporarily expose input value. Use with caution. + public get selectInput() { + return this._select; + } + + // space_id - computed: true, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // trigger - computed: false, optional: false, required: true + private _trigger?: string; + public get trigger() { + return this.getStringAttribute('trigger'); + } + public set trigger(value: string) { + this._trigger = value; + } + // Temporarily expose input value. Use with caution. + public get triggerInput() { + return this._trigger; + } + + // where - computed: false, optional: true, required: false + private _where?: string; + public get where() { + return this.getStringAttribute('where'); + } + public set where(value: string) { + this._where = value; + } + public resetWhere() { + this._where = undefined; + } + // Temporarily expose input value. Use with caution. + public get whereInput() { + return this._where; + } + + // targets - computed: false, optional: true, required: false + private _targets = new IotdaDataforwardingRuleTargetsList(this, "targets", true); + public get targets() { + return this._targets; + } + public putTargets(value: IotdaDataforwardingRuleTargets[] | cdktf.IResolvable) { + this._targets.internalValue = value; + } + public resetTargets() { + this._targets.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetsInput() { + return this._targets.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + select: cdktf.stringToTerraform(this._select), + space_id: cdktf.stringToTerraform(this._spaceId), + trigger: cdktf.stringToTerraform(this._trigger), + where: cdktf.stringToTerraform(this._where), + targets: cdktf.listMapper(iotdaDataforwardingRuleTargetsToTerraform, true)(this._targets.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + select: { + value: cdktf.stringToHclTerraform(this._select), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger: { + value: cdktf.stringToHclTerraform(this._trigger), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + where: { + value: cdktf.stringToHclTerraform(this._where), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + targets: { + value: cdktf.listMapperHcl(iotdaDataforwardingRuleTargetsToHclTerraform, true)(this._targets.internalValue), + isBlock: true, + type: "set", + storageClassType: "IotdaDataforwardingRuleTargetsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device-async-command/README.md b/src/constructs/providers/huaweicloud/iotda-device-async-command/README.md new file mode 100644 index 00000000..6601c43a --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-async-command/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device_async_command` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device_async_command`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command). diff --git a/src/constructs/providers/huaweicloud/iotda-device-async-command/index.ts b/src/constructs/providers/huaweicloud/iotda-device-async-command/index.ts new file mode 100644 index 00000000..34d753fb --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-async-command/index.ts @@ -0,0 +1,337 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceAsyncCommandConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#device_id IotdaDeviceAsyncCommand#device_id} + */ + readonly deviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#expire_time IotdaDeviceAsyncCommand#expire_time} + */ + readonly expireTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#id IotdaDeviceAsyncCommand#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#name IotdaDeviceAsyncCommand#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#paras IotdaDeviceAsyncCommand#paras} + */ + readonly paras?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#region IotdaDeviceAsyncCommand#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#send_strategy IotdaDeviceAsyncCommand#send_strategy} + */ + readonly sendStrategy: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#service_id IotdaDeviceAsyncCommand#service_id} + */ + readonly serviceId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command huaweicloud_iotda_device_async_command} +*/ +export class IotdaDeviceAsyncCommand extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_async_command"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDeviceAsyncCommand resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDeviceAsyncCommand to import + * @param importFromId The id of the existing IotdaDeviceAsyncCommand that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDeviceAsyncCommand to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_async_command", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_async_command huaweicloud_iotda_device_async_command} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceAsyncCommandConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceAsyncCommandConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_async_command', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceId = config.deviceId; + this._expireTime = config.expireTime; + this._id = config.id; + this._name = config.name; + this._paras = config.paras; + this._region = config.region; + this._sendStrategy = config.sendStrategy; + this._serviceId = config.serviceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delivered_time - computed: true, optional: false, required: false + public get deliveredTime() { + return this.getStringAttribute('delivered_time'); + } + + // device_id - computed: false, optional: false, required: true + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // expire_time - computed: true, optional: true, required: false + private _expireTime?: number; + public get expireTime() { + return this.getNumberAttribute('expire_time'); + } + public set expireTime(value: number) { + this._expireTime = value; + } + public resetExpireTime() { + this._expireTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get expireTimeInput() { + return this._expireTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // paras - computed: false, optional: true, required: false + private _paras?: { [key: string]: string }; + public get paras() { + return this.getStringMapAttribute('paras'); + } + public set paras(value: { [key: string]: string }) { + this._paras = value; + } + public resetParas() { + this._paras = undefined; + } + // Temporarily expose input value. Use with caution. + public get parasInput() { + return this._paras; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // response_time - computed: true, optional: false, required: false + public get responseTime() { + return this.getStringAttribute('response_time'); + } + + // result - computed: true, optional: false, required: false + private _result = new cdktf.StringMap(this, "result"); + public get result() { + return this._result; + } + + // send_strategy - computed: false, optional: false, required: true + private _sendStrategy?: string; + public get sendStrategy() { + return this.getStringAttribute('send_strategy'); + } + public set sendStrategy(value: string) { + this._sendStrategy = value; + } + // Temporarily expose input value. Use with caution. + public get sendStrategyInput() { + return this._sendStrategy; + } + + // sent_time - computed: true, optional: false, required: false + public get sentTime() { + return this.getStringAttribute('sent_time'); + } + + // service_id - computed: true, optional: true, required: false + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + public resetServiceId() { + this._serviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_id: cdktf.stringToTerraform(this._deviceId), + expire_time: cdktf.numberToTerraform(this._expireTime), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + paras: cdktf.hashMapper(cdktf.stringToTerraform)(this._paras), + region: cdktf.stringToTerraform(this._region), + send_strategy: cdktf.stringToTerraform(this._sendStrategy), + service_id: cdktf.stringToTerraform(this._serviceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expire_time: { + value: cdktf.numberToHclTerraform(this._expireTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + paras: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._paras), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + send_strategy: { + value: cdktf.stringToHclTerraform(this._sendStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device-certificate/README.md b/src/constructs/providers/huaweicloud/iotda-device-certificate/README.md new file mode 100644 index 00000000..173761e8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate). diff --git a/src/constructs/providers/huaweicloud/iotda-device-certificate/index.ts b/src/constructs/providers/huaweicloud/iotda-device-certificate/index.ts new file mode 100644 index 00000000..1f5c641b --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-certificate/index.ts @@ -0,0 +1,255 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate#content IotdaDeviceCertificate#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate#id IotdaDeviceCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate#region IotdaDeviceCertificate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate#space_id IotdaDeviceCertificate#space_id} + */ + readonly spaceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate#verify_content IotdaDeviceCertificate#verify_content} + */ + readonly verifyContent?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate huaweicloud_iotda_device_certificate} +*/ +export class IotdaDeviceCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDeviceCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDeviceCertificate to import + * @param importFromId The id of the existing IotdaDeviceCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDeviceCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_certificate huaweicloud_iotda_device_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceCertificateConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._region = config.region; + this._spaceId = config.spaceId; + this._verifyContent = config.verifyContent; + } + + // ========== + // ATTRIBUTES + // ========== + + // cn - computed: true, optional: false, required: false + public get cn() { + return this.getStringAttribute('cn'); + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // effective_date - computed: true, optional: false, required: false + public get effectiveDate() { + return this.getStringAttribute('effective_date'); + } + + // expiry_date - computed: true, optional: false, required: false + public get expiryDate() { + return this.getStringAttribute('expiry_date'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // verify_code - computed: true, optional: false, required: false + public get verifyCode() { + return this.getStringAttribute('verify_code'); + } + + // verify_content - computed: false, optional: true, required: false + private _verifyContent?: string; + public get verifyContent() { + return this.getStringAttribute('verify_content'); + } + public set verifyContent(value: string) { + this._verifyContent = value; + } + public resetVerifyContent() { + this._verifyContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get verifyContentInput() { + return this._verifyContent; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + verify_content: cdktf.stringToTerraform(this._verifyContent), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + verify_content: { + value: cdktf.stringToHclTerraform(this._verifyContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device-group/README.md b/src/constructs/providers/huaweicloud/iotda-device-group/README.md new file mode 100644 index 00000000..49e96216 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group). diff --git a/src/constructs/providers/huaweicloud/iotda-device-group/index.ts b/src/constructs/providers/huaweicloud/iotda-device-group/index.ts new file mode 100644 index 00000000..29f1988b --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-group/index.ts @@ -0,0 +1,334 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#description IotdaDeviceGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#device_ids IotdaDeviceGroup#device_ids} + */ + readonly deviceIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#dynamic_group_rule IotdaDeviceGroup#dynamic_group_rule} + */ + readonly dynamicGroupRule?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#id IotdaDeviceGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#name IotdaDeviceGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#parent_group_id IotdaDeviceGroup#parent_group_id} + */ + readonly parentGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#region IotdaDeviceGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#space_id IotdaDeviceGroup#space_id} + */ + readonly spaceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#type IotdaDeviceGroup#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group huaweicloud_iotda_device_group} +*/ +export class IotdaDeviceGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDeviceGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDeviceGroup to import + * @param importFromId The id of the existing IotdaDeviceGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDeviceGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_group huaweicloud_iotda_device_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceGroupConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._deviceIds = config.deviceIds; + this._dynamicGroupRule = config.dynamicGroupRule; + this._id = config.id; + this._name = config.name; + this._parentGroupId = config.parentGroupId; + this._region = config.region; + this._spaceId = config.spaceId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // device_ids - computed: true, optional: true, required: false + private _deviceIds?: string[]; + public get deviceIds() { + return cdktf.Fn.tolist(this.getListAttribute('device_ids')); + } + public set deviceIds(value: string[]) { + this._deviceIds = value; + } + public resetDeviceIds() { + this._deviceIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdsInput() { + return this._deviceIds; + } + + // dynamic_group_rule - computed: true, optional: true, required: false + private _dynamicGroupRule?: string; + public get dynamicGroupRule() { + return this.getStringAttribute('dynamic_group_rule'); + } + public set dynamicGroupRule(value: string) { + this._dynamicGroupRule = value; + } + public resetDynamicGroupRule() { + this._dynamicGroupRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get dynamicGroupRuleInput() { + return this._dynamicGroupRule; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_group_id - computed: true, optional: true, required: false + private _parentGroupId?: string; + public get parentGroupId() { + return this.getStringAttribute('parent_group_id'); + } + public set parentGroupId(value: string) { + this._parentGroupId = value; + } + public resetParentGroupId() { + this._parentGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentGroupIdInput() { + return this._parentGroupId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: false, required: true + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + device_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._deviceIds), + dynamic_group_rule: cdktf.stringToTerraform(this._dynamicGroupRule), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_group_id: cdktf.stringToTerraform(this._parentGroupId), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._deviceIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + dynamic_group_rule: { + value: cdktf.stringToHclTerraform(this._dynamicGroupRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_group_id: { + value: cdktf.stringToHclTerraform(this._parentGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device-linkage-rule/README.md b/src/constructs/providers/huaweicloud/iotda-device-linkage-rule/README.md new file mode 100644 index 00000000..847fab8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-linkage-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device_linkage_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device_linkage_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule). diff --git a/src/constructs/providers/huaweicloud/iotda-device-linkage-rule/index.ts b/src/constructs/providers/huaweicloud/iotda-device-linkage-rule/index.ts new file mode 100644 index 00000000..7de97b0d --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-linkage-rule/index.ts @@ -0,0 +1,2471 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceLinkageRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#description IotdaDeviceLinkageRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#enabled IotdaDeviceLinkageRule#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#id IotdaDeviceLinkageRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#name IotdaDeviceLinkageRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#region IotdaDeviceLinkageRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#space_id IotdaDeviceLinkageRule#space_id} + */ + readonly spaceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#trigger_logic IotdaDeviceLinkageRule#trigger_logic} + */ + readonly triggerLogic?: string; + /** + * actions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#actions IotdaDeviceLinkageRule#actions} + */ + readonly actions: IotdaDeviceLinkageRuleActions[] | cdktf.IResolvable; + /** + * effective_period block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#effective_period IotdaDeviceLinkageRule#effective_period} + */ + readonly effectivePeriod?: IotdaDeviceLinkageRuleEffectivePeriod; + /** + * triggers block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#triggers IotdaDeviceLinkageRule#triggers} + */ + readonly triggers: IotdaDeviceLinkageRuleTriggers[] | cdktf.IResolvable; +} +export interface IotdaDeviceLinkageRuleActionsDeviceAlarm { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#description IotdaDeviceLinkageRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#dimension IotdaDeviceLinkageRule#dimension} + */ + readonly dimension?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#name IotdaDeviceLinkageRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#severity IotdaDeviceLinkageRule#severity} + */ + readonly severity: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#type IotdaDeviceLinkageRule#type} + */ + readonly type: string; +} + +export function iotdaDeviceLinkageRuleActionsDeviceAlarmToTerraform(struct?: IotdaDeviceLinkageRuleActionsDeviceAlarmOutputReference | IotdaDeviceLinkageRuleActionsDeviceAlarm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + dimension: cdktf.stringToTerraform(struct!.dimension), + name: cdktf.stringToTerraform(struct!.name), + severity: cdktf.stringToTerraform(struct!.severity), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function iotdaDeviceLinkageRuleActionsDeviceAlarmToHclTerraform(struct?: IotdaDeviceLinkageRuleActionsDeviceAlarmOutputReference | IotdaDeviceLinkageRuleActionsDeviceAlarm): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dimension: { + value: cdktf.stringToHclTerraform(struct!.dimension), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(struct!.severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleActionsDeviceAlarmOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleActionsDeviceAlarm | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._dimension !== undefined) { + hasAnyValues = true; + internalValueResult.dimension = this._dimension; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._severity !== undefined) { + hasAnyValues = true; + internalValueResult.severity = this._severity; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleActionsDeviceAlarm | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._description = undefined; + this._dimension = undefined; + this._name = undefined; + this._severity = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._description = value.description; + this._dimension = value.dimension; + this._name = value.name; + this._severity = value.severity; + this._type = value.type; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dimension - computed: false, optional: true, required: false + private _dimension?: string; + public get dimension() { + return this.getStringAttribute('dimension'); + } + public set dimension(value: string) { + this._dimension = value; + } + public resetDimension() { + this._dimension = undefined; + } + // Temporarily expose input value. Use with caution. + public get dimensionInput() { + return this._dimension; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // severity - computed: false, optional: false, required: true + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface IotdaDeviceLinkageRuleActionsDeviceCommand { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#buffer_timeout IotdaDeviceLinkageRule#buffer_timeout} + */ + readonly bufferTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#command_body IotdaDeviceLinkageRule#command_body} + */ + readonly commandBody: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#command_name IotdaDeviceLinkageRule#command_name} + */ + readonly commandName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_id IotdaDeviceLinkageRule#device_id} + */ + readonly deviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#mode IotdaDeviceLinkageRule#mode} + */ + readonly mode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#response_timeout IotdaDeviceLinkageRule#response_timeout} + */ + readonly responseTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#service_id IotdaDeviceLinkageRule#service_id} + */ + readonly serviceId: string; +} + +export function iotdaDeviceLinkageRuleActionsDeviceCommandToTerraform(struct?: IotdaDeviceLinkageRuleActionsDeviceCommandOutputReference | IotdaDeviceLinkageRuleActionsDeviceCommand): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + buffer_timeout: cdktf.numberToTerraform(struct!.bufferTimeout), + command_body: cdktf.stringToTerraform(struct!.commandBody), + command_name: cdktf.stringToTerraform(struct!.commandName), + device_id: cdktf.stringToTerraform(struct!.deviceId), + mode: cdktf.stringToTerraform(struct!.mode), + response_timeout: cdktf.numberToTerraform(struct!.responseTimeout), + service_id: cdktf.stringToTerraform(struct!.serviceId), + } +} + + +export function iotdaDeviceLinkageRuleActionsDeviceCommandToHclTerraform(struct?: IotdaDeviceLinkageRuleActionsDeviceCommandOutputReference | IotdaDeviceLinkageRuleActionsDeviceCommand): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + buffer_timeout: { + value: cdktf.numberToHclTerraform(struct!.bufferTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + command_body: { + value: cdktf.stringToHclTerraform(struct!.commandBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command_name: { + value: cdktf.stringToHclTerraform(struct!.commandName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_id: { + value: cdktf.stringToHclTerraform(struct!.deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_timeout: { + value: cdktf.numberToHclTerraform(struct!.responseTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + service_id: { + value: cdktf.stringToHclTerraform(struct!.serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleActionsDeviceCommandOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleActionsDeviceCommand | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bufferTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.bufferTimeout = this._bufferTimeout; + } + if (this._commandBody !== undefined) { + hasAnyValues = true; + internalValueResult.commandBody = this._commandBody; + } + if (this._commandName !== undefined) { + hasAnyValues = true; + internalValueResult.commandName = this._commandName; + } + if (this._deviceId !== undefined) { + hasAnyValues = true; + internalValueResult.deviceId = this._deviceId; + } + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._responseTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.responseTimeout = this._responseTimeout; + } + if (this._serviceId !== undefined) { + hasAnyValues = true; + internalValueResult.serviceId = this._serviceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleActionsDeviceCommand | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bufferTimeout = undefined; + this._commandBody = undefined; + this._commandName = undefined; + this._deviceId = undefined; + this._mode = undefined; + this._responseTimeout = undefined; + this._serviceId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bufferTimeout = value.bufferTimeout; + this._commandBody = value.commandBody; + this._commandName = value.commandName; + this._deviceId = value.deviceId; + this._mode = value.mode; + this._responseTimeout = value.responseTimeout; + this._serviceId = value.serviceId; + } + } + + // buffer_timeout - computed: false, optional: true, required: false + private _bufferTimeout?: number; + public get bufferTimeout() { + return this.getNumberAttribute('buffer_timeout'); + } + public set bufferTimeout(value: number) { + this._bufferTimeout = value; + } + public resetBufferTimeout() { + this._bufferTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get bufferTimeoutInput() { + return this._bufferTimeout; + } + + // command_body - computed: false, optional: false, required: true + private _commandBody?: string; + public get commandBody() { + return this.getStringAttribute('command_body'); + } + public set commandBody(value: string) { + this._commandBody = value; + } + // Temporarily expose input value. Use with caution. + public get commandBodyInput() { + return this._commandBody; + } + + // command_name - computed: false, optional: false, required: true + private _commandName?: string; + public get commandName() { + return this.getStringAttribute('command_name'); + } + public set commandName(value: string) { + this._commandName = value; + } + // Temporarily expose input value. Use with caution. + public get commandNameInput() { + return this._commandName; + } + + // device_id - computed: false, optional: false, required: true + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // mode - computed: false, optional: true, required: false + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // response_timeout - computed: false, optional: true, required: false + private _responseTimeout?: number; + public get responseTimeout() { + return this.getNumberAttribute('response_timeout'); + } + public set responseTimeout(value: number) { + this._responseTimeout = value; + } + public resetResponseTimeout() { + this._responseTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseTimeoutInput() { + return this._responseTimeout; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } +} +export interface IotdaDeviceLinkageRuleActionsSmnForwarding { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#message_content IotdaDeviceLinkageRule#message_content} + */ + readonly messageContent?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#message_template_name IotdaDeviceLinkageRule#message_template_name} + */ + readonly messageTemplateName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#message_title IotdaDeviceLinkageRule#message_title} + */ + readonly messageTitle: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#project_id IotdaDeviceLinkageRule#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#region IotdaDeviceLinkageRule#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#topic_name IotdaDeviceLinkageRule#topic_name} + */ + readonly topicName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#topic_urn IotdaDeviceLinkageRule#topic_urn} + */ + readonly topicUrn: string; +} + +export function iotdaDeviceLinkageRuleActionsSmnForwardingToTerraform(struct?: IotdaDeviceLinkageRuleActionsSmnForwardingOutputReference | IotdaDeviceLinkageRuleActionsSmnForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + message_content: cdktf.stringToTerraform(struct!.messageContent), + message_template_name: cdktf.stringToTerraform(struct!.messageTemplateName), + message_title: cdktf.stringToTerraform(struct!.messageTitle), + project_id: cdktf.stringToTerraform(struct!.projectId), + region: cdktf.stringToTerraform(struct!.region), + topic_name: cdktf.stringToTerraform(struct!.topicName), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function iotdaDeviceLinkageRuleActionsSmnForwardingToHclTerraform(struct?: IotdaDeviceLinkageRuleActionsSmnForwardingOutputReference | IotdaDeviceLinkageRuleActionsSmnForwarding): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + message_content: { + value: cdktf.stringToHclTerraform(struct!.messageContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_template_name: { + value: cdktf.stringToHclTerraform(struct!.messageTemplateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_title: { + value: cdktf.stringToHclTerraform(struct!.messageTitle), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_name: { + value: cdktf.stringToHclTerraform(struct!.topicName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleActionsSmnForwardingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleActionsSmnForwarding | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._messageContent !== undefined) { + hasAnyValues = true; + internalValueResult.messageContent = this._messageContent; + } + if (this._messageTemplateName !== undefined) { + hasAnyValues = true; + internalValueResult.messageTemplateName = this._messageTemplateName; + } + if (this._messageTitle !== undefined) { + hasAnyValues = true; + internalValueResult.messageTitle = this._messageTitle; + } + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._topicName !== undefined) { + hasAnyValues = true; + internalValueResult.topicName = this._topicName; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleActionsSmnForwarding | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._messageContent = undefined; + this._messageTemplateName = undefined; + this._messageTitle = undefined; + this._projectId = undefined; + this._region = undefined; + this._topicName = undefined; + this._topicUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._messageContent = value.messageContent; + this._messageTemplateName = value.messageTemplateName; + this._messageTitle = value.messageTitle; + this._projectId = value.projectId; + this._region = value.region; + this._topicName = value.topicName; + this._topicUrn = value.topicUrn; + } + } + + // message_content - computed: true, optional: true, required: false + private _messageContent?: string; + public get messageContent() { + return this.getStringAttribute('message_content'); + } + public set messageContent(value: string) { + this._messageContent = value; + } + public resetMessageContent() { + this._messageContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageContentInput() { + return this._messageContent; + } + + // message_template_name - computed: true, optional: true, required: false + private _messageTemplateName?: string; + public get messageTemplateName() { + return this.getStringAttribute('message_template_name'); + } + public set messageTemplateName(value: string) { + this._messageTemplateName = value; + } + public resetMessageTemplateName() { + this._messageTemplateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageTemplateNameInput() { + return this._messageTemplateName; + } + + // message_title - computed: false, optional: false, required: true + private _messageTitle?: string; + public get messageTitle() { + return this.getStringAttribute('message_title'); + } + public set messageTitle(value: string) { + this._messageTitle = value; + } + // Temporarily expose input value. Use with caution. + public get messageTitleInput() { + return this._messageTitle; + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_name - computed: false, optional: false, required: true + private _topicName?: string; + public get topicName() { + return this.getStringAttribute('topic_name'); + } + public set topicName(value: string) { + this._topicName = value; + } + // Temporarily expose input value. Use with caution. + public get topicNameInput() { + return this._topicName; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} +export interface IotdaDeviceLinkageRuleActions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#type IotdaDeviceLinkageRule#type} + */ + readonly type: string; + /** + * device_alarm block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_alarm IotdaDeviceLinkageRule#device_alarm} + */ + readonly deviceAlarm?: IotdaDeviceLinkageRuleActionsDeviceAlarm; + /** + * device_command block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_command IotdaDeviceLinkageRule#device_command} + */ + readonly deviceCommand?: IotdaDeviceLinkageRuleActionsDeviceCommand; + /** + * smn_forwarding block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#smn_forwarding IotdaDeviceLinkageRule#smn_forwarding} + */ + readonly smnForwarding?: IotdaDeviceLinkageRuleActionsSmnForwarding; +} + +export function iotdaDeviceLinkageRuleActionsToTerraform(struct?: IotdaDeviceLinkageRuleActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + device_alarm: iotdaDeviceLinkageRuleActionsDeviceAlarmToTerraform(struct!.deviceAlarm), + device_command: iotdaDeviceLinkageRuleActionsDeviceCommandToTerraform(struct!.deviceCommand), + smn_forwarding: iotdaDeviceLinkageRuleActionsSmnForwardingToTerraform(struct!.smnForwarding), + } +} + + +export function iotdaDeviceLinkageRuleActionsToHclTerraform(struct?: IotdaDeviceLinkageRuleActions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_alarm: { + value: iotdaDeviceLinkageRuleActionsDeviceAlarmToHclTerraform(struct!.deviceAlarm), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleActionsDeviceAlarmList", + }, + device_command: { + value: iotdaDeviceLinkageRuleActionsDeviceCommandToHclTerraform(struct!.deviceCommand), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleActionsDeviceCommandList", + }, + smn_forwarding: { + value: iotdaDeviceLinkageRuleActionsSmnForwardingToHclTerraform(struct!.smnForwarding), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleActionsSmnForwardingList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleActionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDeviceLinkageRuleActions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._deviceAlarm?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.deviceAlarm = this._deviceAlarm?.internalValue; + } + if (this._deviceCommand?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.deviceCommand = this._deviceCommand?.internalValue; + } + if (this._smnForwarding?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.smnForwarding = this._smnForwarding?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleActions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._type = undefined; + this._deviceAlarm.internalValue = undefined; + this._deviceCommand.internalValue = undefined; + this._smnForwarding.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._type = value.type; + this._deviceAlarm.internalValue = value.deviceAlarm; + this._deviceCommand.internalValue = value.deviceCommand; + this._smnForwarding.internalValue = value.smnForwarding; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // device_alarm - computed: false, optional: true, required: false + private _deviceAlarm = new IotdaDeviceLinkageRuleActionsDeviceAlarmOutputReference(this, "device_alarm"); + public get deviceAlarm() { + return this._deviceAlarm; + } + public putDeviceAlarm(value: IotdaDeviceLinkageRuleActionsDeviceAlarm) { + this._deviceAlarm.internalValue = value; + } + public resetDeviceAlarm() { + this._deviceAlarm.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceAlarmInput() { + return this._deviceAlarm.internalValue; + } + + // device_command - computed: false, optional: true, required: false + private _deviceCommand = new IotdaDeviceLinkageRuleActionsDeviceCommandOutputReference(this, "device_command"); + public get deviceCommand() { + return this._deviceCommand; + } + public putDeviceCommand(value: IotdaDeviceLinkageRuleActionsDeviceCommand) { + this._deviceCommand.internalValue = value; + } + public resetDeviceCommand() { + this._deviceCommand.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceCommandInput() { + return this._deviceCommand.internalValue; + } + + // smn_forwarding - computed: false, optional: true, required: false + private _smnForwarding = new IotdaDeviceLinkageRuleActionsSmnForwardingOutputReference(this, "smn_forwarding"); + public get smnForwarding() { + return this._smnForwarding; + } + public putSmnForwarding(value: IotdaDeviceLinkageRuleActionsSmnForwarding) { + this._smnForwarding.internalValue = value; + } + public resetSmnForwarding() { + this._smnForwarding.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnForwardingInput() { + return this._smnForwarding.internalValue; + } +} + +export class IotdaDeviceLinkageRuleActionsList extends cdktf.ComplexList { + public internalValue? : IotdaDeviceLinkageRuleActions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDeviceLinkageRuleActionsOutputReference { + return new IotdaDeviceLinkageRuleActionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaDeviceLinkageRuleEffectivePeriod { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#days_of_week IotdaDeviceLinkageRule#days_of_week} + */ + readonly daysOfWeek?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#end_time IotdaDeviceLinkageRule#end_time} + */ + readonly endTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#start_time IotdaDeviceLinkageRule#start_time} + */ + readonly startTime: string; +} + +export function iotdaDeviceLinkageRuleEffectivePeriodToTerraform(struct?: IotdaDeviceLinkageRuleEffectivePeriodOutputReference | IotdaDeviceLinkageRuleEffectivePeriod): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days_of_week: cdktf.stringToTerraform(struct!.daysOfWeek), + end_time: cdktf.stringToTerraform(struct!.endTime), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function iotdaDeviceLinkageRuleEffectivePeriodToHclTerraform(struct?: IotdaDeviceLinkageRuleEffectivePeriodOutputReference | IotdaDeviceLinkageRuleEffectivePeriod): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days_of_week: { + value: cdktf.stringToHclTerraform(struct!.daysOfWeek), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleEffectivePeriodOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleEffectivePeriod | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._daysOfWeek !== undefined) { + hasAnyValues = true; + internalValueResult.daysOfWeek = this._daysOfWeek; + } + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleEffectivePeriod | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._daysOfWeek = undefined; + this._endTime = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._daysOfWeek = value.daysOfWeek; + this._endTime = value.endTime; + this._startTime = value.startTime; + } + } + + // days_of_week - computed: true, optional: true, required: false + private _daysOfWeek?: string; + public get daysOfWeek() { + return this.getStringAttribute('days_of_week'); + } + public set daysOfWeek(value: string) { + this._daysOfWeek = value; + } + public resetDaysOfWeek() { + this._daysOfWeek = undefined; + } + // Temporarily expose input value. Use with caution. + public get daysOfWeekInput() { + return this._daysOfWeek; + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface IotdaDeviceLinkageRuleTriggersDailyTimerCondition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#days_of_week IotdaDeviceLinkageRule#days_of_week} + */ + readonly daysOfWeek?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#start_time IotdaDeviceLinkageRule#start_time} + */ + readonly startTime: string; +} + +export function iotdaDeviceLinkageRuleTriggersDailyTimerConditionToTerraform(struct?: IotdaDeviceLinkageRuleTriggersDailyTimerConditionOutputReference | IotdaDeviceLinkageRuleTriggersDailyTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days_of_week: cdktf.stringToTerraform(struct!.daysOfWeek), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function iotdaDeviceLinkageRuleTriggersDailyTimerConditionToHclTerraform(struct?: IotdaDeviceLinkageRuleTriggersDailyTimerConditionOutputReference | IotdaDeviceLinkageRuleTriggersDailyTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days_of_week: { + value: cdktf.stringToHclTerraform(struct!.daysOfWeek), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleTriggersDailyTimerConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleTriggersDailyTimerCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._daysOfWeek !== undefined) { + hasAnyValues = true; + internalValueResult.daysOfWeek = this._daysOfWeek; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleTriggersDailyTimerCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._daysOfWeek = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._daysOfWeek = value.daysOfWeek; + this._startTime = value.startTime; + } + } + + // days_of_week - computed: true, optional: true, required: false + private _daysOfWeek?: string; + public get daysOfWeek() { + return this.getStringAttribute('days_of_week'); + } + public set daysOfWeek(value: string) { + this._daysOfWeek = value; + } + public resetDaysOfWeek() { + this._daysOfWeek = undefined; + } + // Temporarily expose input value. Use with caution. + public get daysOfWeekInput() { + return this._daysOfWeek; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface IotdaDeviceLinkageRuleTriggersDeviceDataCondition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#data_validatiy_period IotdaDeviceLinkageRule#data_validatiy_period} + */ + readonly dataValidatiyPeriod?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_id IotdaDeviceLinkageRule#device_id} + */ + readonly deviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#in_values IotdaDeviceLinkageRule#in_values} + */ + readonly inValues?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#operator IotdaDeviceLinkageRule#operator} + */ + readonly operator: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#path IotdaDeviceLinkageRule#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#product_id IotdaDeviceLinkageRule#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#trigger_strategy IotdaDeviceLinkageRule#trigger_strategy} + */ + readonly triggerStrategy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#value IotdaDeviceLinkageRule#value} + */ + readonly value?: string; +} + +export function iotdaDeviceLinkageRuleTriggersDeviceDataConditionToTerraform(struct?: IotdaDeviceLinkageRuleTriggersDeviceDataConditionOutputReference | IotdaDeviceLinkageRuleTriggersDeviceDataCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data_validatiy_period: cdktf.numberToTerraform(struct!.dataValidatiyPeriod), + device_id: cdktf.stringToTerraform(struct!.deviceId), + in_values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.inValues), + operator: cdktf.stringToTerraform(struct!.operator), + path: cdktf.stringToTerraform(struct!.path), + product_id: cdktf.stringToTerraform(struct!.productId), + trigger_strategy: cdktf.stringToTerraform(struct!.triggerStrategy), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function iotdaDeviceLinkageRuleTriggersDeviceDataConditionToHclTerraform(struct?: IotdaDeviceLinkageRuleTriggersDeviceDataConditionOutputReference | IotdaDeviceLinkageRuleTriggersDeviceDataCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data_validatiy_period: { + value: cdktf.numberToHclTerraform(struct!.dataValidatiyPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + device_id: { + value: cdktf.stringToHclTerraform(struct!.deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + in_values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.inValues), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(struct!.productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_strategy: { + value: cdktf.stringToHclTerraform(struct!.triggerStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleTriggersDeviceDataConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleTriggersDeviceDataCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dataValidatiyPeriod !== undefined) { + hasAnyValues = true; + internalValueResult.dataValidatiyPeriod = this._dataValidatiyPeriod; + } + if (this._deviceId !== undefined) { + hasAnyValues = true; + internalValueResult.deviceId = this._deviceId; + } + if (this._inValues !== undefined) { + hasAnyValues = true; + internalValueResult.inValues = this._inValues; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._productId !== undefined) { + hasAnyValues = true; + internalValueResult.productId = this._productId; + } + if (this._triggerStrategy !== undefined) { + hasAnyValues = true; + internalValueResult.triggerStrategy = this._triggerStrategy; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleTriggersDeviceDataCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dataValidatiyPeriod = undefined; + this._deviceId = undefined; + this._inValues = undefined; + this._operator = undefined; + this._path = undefined; + this._productId = undefined; + this._triggerStrategy = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dataValidatiyPeriod = value.dataValidatiyPeriod; + this._deviceId = value.deviceId; + this._inValues = value.inValues; + this._operator = value.operator; + this._path = value.path; + this._productId = value.productId; + this._triggerStrategy = value.triggerStrategy; + this._value = value.value; + } + } + + // data_validatiy_period - computed: false, optional: true, required: false + private _dataValidatiyPeriod?: number; + public get dataValidatiyPeriod() { + return this.getNumberAttribute('data_validatiy_period'); + } + public set dataValidatiyPeriod(value: number) { + this._dataValidatiyPeriod = value; + } + public resetDataValidatiyPeriod() { + this._dataValidatiyPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataValidatiyPeriodInput() { + return this._dataValidatiyPeriod; + } + + // device_id - computed: false, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // in_values - computed: false, optional: true, required: false + private _inValues?: string[]; + public get inValues() { + return this.getListAttribute('in_values'); + } + public set inValues(value: string[]) { + this._inValues = value; + } + public resetInValues() { + this._inValues = undefined; + } + // Temporarily expose input value. Use with caution. + public get inValuesInput() { + return this._inValues; + } + + // operator - computed: false, optional: false, required: true + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // trigger_strategy - computed: true, optional: true, required: false + private _triggerStrategy?: string; + public get triggerStrategy() { + return this.getStringAttribute('trigger_strategy'); + } + public set triggerStrategy(value: string) { + this._triggerStrategy = value; + } + public resetTriggerStrategy() { + this._triggerStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerStrategyInput() { + return this._triggerStrategy; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_id IotdaDeviceLinkageRule#device_id} + */ + readonly deviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#duration IotdaDeviceLinkageRule#duration} + */ + readonly duration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#product_id IotdaDeviceLinkageRule#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#status_list IotdaDeviceLinkageRule#status_list} + */ + readonly statusList?: string[]; +} + +export function iotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionToTerraform(struct?: IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionOutputReference | IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + device_id: cdktf.stringToTerraform(struct!.deviceId), + duration: cdktf.numberToTerraform(struct!.duration), + product_id: cdktf.stringToTerraform(struct!.productId), + status_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.statusList), + } +} + + +export function iotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionToHclTerraform(struct?: IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionOutputReference | IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + device_id: { + value: cdktf.stringToHclTerraform(struct!.deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + duration: { + value: cdktf.numberToHclTerraform(struct!.duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + product_id: { + value: cdktf.stringToHclTerraform(struct!.productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.statusList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._deviceId !== undefined) { + hasAnyValues = true; + internalValueResult.deviceId = this._deviceId; + } + if (this._duration !== undefined) { + hasAnyValues = true; + internalValueResult.duration = this._duration; + } + if (this._productId !== undefined) { + hasAnyValues = true; + internalValueResult.productId = this._productId; + } + if (this._statusList !== undefined) { + hasAnyValues = true; + internalValueResult.statusList = this._statusList; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._deviceId = undefined; + this._duration = undefined; + this._productId = undefined; + this._statusList = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._deviceId = value.deviceId; + this._duration = value.duration; + this._productId = value.productId; + this._statusList = value.statusList; + } + } + + // device_id - computed: true, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // duration - computed: true, optional: true, required: false + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // product_id - computed: false, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // status_list - computed: true, optional: true, required: false + private _statusList?: string[]; + public get statusList() { + return this.getListAttribute('status_list'); + } + public set statusList(value: string[]) { + this._statusList = value; + } + public resetStatusList() { + this._statusList = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusListInput() { + return this._statusList; + } +} +export interface IotdaDeviceLinkageRuleTriggersSimpleTimerCondition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#repeat_count IotdaDeviceLinkageRule#repeat_count} + */ + readonly repeatCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#repeat_interval IotdaDeviceLinkageRule#repeat_interval} + */ + readonly repeatInterval: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#start_time IotdaDeviceLinkageRule#start_time} + */ + readonly startTime: string; +} + +export function iotdaDeviceLinkageRuleTriggersSimpleTimerConditionToTerraform(struct?: IotdaDeviceLinkageRuleTriggersSimpleTimerConditionOutputReference | IotdaDeviceLinkageRuleTriggersSimpleTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + repeat_count: cdktf.numberToTerraform(struct!.repeatCount), + repeat_interval: cdktf.numberToTerraform(struct!.repeatInterval), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function iotdaDeviceLinkageRuleTriggersSimpleTimerConditionToHclTerraform(struct?: IotdaDeviceLinkageRuleTriggersSimpleTimerConditionOutputReference | IotdaDeviceLinkageRuleTriggersSimpleTimerCondition): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + repeat_count: { + value: cdktf.numberToHclTerraform(struct!.repeatCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + repeat_interval: { + value: cdktf.numberToHclTerraform(struct!.repeatInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleTriggersSimpleTimerConditionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceLinkageRuleTriggersSimpleTimerCondition | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._repeatCount !== undefined) { + hasAnyValues = true; + internalValueResult.repeatCount = this._repeatCount; + } + if (this._repeatInterval !== undefined) { + hasAnyValues = true; + internalValueResult.repeatInterval = this._repeatInterval; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleTriggersSimpleTimerCondition | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._repeatCount = undefined; + this._repeatInterval = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._repeatCount = value.repeatCount; + this._repeatInterval = value.repeatInterval; + this._startTime = value.startTime; + } + } + + // repeat_count - computed: false, optional: false, required: true + private _repeatCount?: number; + public get repeatCount() { + return this.getNumberAttribute('repeat_count'); + } + public set repeatCount(value: number) { + this._repeatCount = value; + } + // Temporarily expose input value. Use with caution. + public get repeatCountInput() { + return this._repeatCount; + } + + // repeat_interval - computed: false, optional: false, required: true + private _repeatInterval?: number; + public get repeatInterval() { + return this.getNumberAttribute('repeat_interval'); + } + public set repeatInterval(value: number) { + this._repeatInterval = value; + } + // Temporarily expose input value. Use with caution. + public get repeatIntervalInput() { + return this._repeatInterval; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface IotdaDeviceLinkageRuleTriggers { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#type IotdaDeviceLinkageRule#type} + */ + readonly type: string; + /** + * daily_timer_condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#daily_timer_condition IotdaDeviceLinkageRule#daily_timer_condition} + */ + readonly dailyTimerCondition?: IotdaDeviceLinkageRuleTriggersDailyTimerCondition; + /** + * device_data_condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_data_condition IotdaDeviceLinkageRule#device_data_condition} + */ + readonly deviceDataCondition?: IotdaDeviceLinkageRuleTriggersDeviceDataCondition; + /** + * device_linkage_status_condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#device_linkage_status_condition IotdaDeviceLinkageRule#device_linkage_status_condition} + */ + readonly deviceLinkageStatusCondition?: IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition; + /** + * simple_timer_condition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#simple_timer_condition IotdaDeviceLinkageRule#simple_timer_condition} + */ + readonly simpleTimerCondition?: IotdaDeviceLinkageRuleTriggersSimpleTimerCondition; +} + +export function iotdaDeviceLinkageRuleTriggersToTerraform(struct?: IotdaDeviceLinkageRuleTriggers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + daily_timer_condition: iotdaDeviceLinkageRuleTriggersDailyTimerConditionToTerraform(struct!.dailyTimerCondition), + device_data_condition: iotdaDeviceLinkageRuleTriggersDeviceDataConditionToTerraform(struct!.deviceDataCondition), + device_linkage_status_condition: iotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionToTerraform(struct!.deviceLinkageStatusCondition), + simple_timer_condition: iotdaDeviceLinkageRuleTriggersSimpleTimerConditionToTerraform(struct!.simpleTimerCondition), + } +} + + +export function iotdaDeviceLinkageRuleTriggersToHclTerraform(struct?: IotdaDeviceLinkageRuleTriggers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + daily_timer_condition: { + value: iotdaDeviceLinkageRuleTriggersDailyTimerConditionToHclTerraform(struct!.dailyTimerCondition), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleTriggersDailyTimerConditionList", + }, + device_data_condition: { + value: iotdaDeviceLinkageRuleTriggersDeviceDataConditionToHclTerraform(struct!.deviceDataCondition), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleTriggersDeviceDataConditionList", + }, + device_linkage_status_condition: { + value: iotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionToHclTerraform(struct!.deviceLinkageStatusCondition), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionList", + }, + simple_timer_condition: { + value: iotdaDeviceLinkageRuleTriggersSimpleTimerConditionToHclTerraform(struct!.simpleTimerCondition), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleTriggersSimpleTimerConditionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceLinkageRuleTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDeviceLinkageRuleTriggers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._dailyTimerCondition?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dailyTimerCondition = this._dailyTimerCondition?.internalValue; + } + if (this._deviceDataCondition?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.deviceDataCondition = this._deviceDataCondition?.internalValue; + } + if (this._deviceLinkageStatusCondition?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.deviceLinkageStatusCondition = this._deviceLinkageStatusCondition?.internalValue; + } + if (this._simpleTimerCondition?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.simpleTimerCondition = this._simpleTimerCondition?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceLinkageRuleTriggers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._type = undefined; + this._dailyTimerCondition.internalValue = undefined; + this._deviceDataCondition.internalValue = undefined; + this._deviceLinkageStatusCondition.internalValue = undefined; + this._simpleTimerCondition.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._type = value.type; + this._dailyTimerCondition.internalValue = value.dailyTimerCondition; + this._deviceDataCondition.internalValue = value.deviceDataCondition; + this._deviceLinkageStatusCondition.internalValue = value.deviceLinkageStatusCondition; + this._simpleTimerCondition.internalValue = value.simpleTimerCondition; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // daily_timer_condition - computed: false, optional: true, required: false + private _dailyTimerCondition = new IotdaDeviceLinkageRuleTriggersDailyTimerConditionOutputReference(this, "daily_timer_condition"); + public get dailyTimerCondition() { + return this._dailyTimerCondition; + } + public putDailyTimerCondition(value: IotdaDeviceLinkageRuleTriggersDailyTimerCondition) { + this._dailyTimerCondition.internalValue = value; + } + public resetDailyTimerCondition() { + this._dailyTimerCondition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dailyTimerConditionInput() { + return this._dailyTimerCondition.internalValue; + } + + // device_data_condition - computed: false, optional: true, required: false + private _deviceDataCondition = new IotdaDeviceLinkageRuleTriggersDeviceDataConditionOutputReference(this, "device_data_condition"); + public get deviceDataCondition() { + return this._deviceDataCondition; + } + public putDeviceDataCondition(value: IotdaDeviceLinkageRuleTriggersDeviceDataCondition) { + this._deviceDataCondition.internalValue = value; + } + public resetDeviceDataCondition() { + this._deviceDataCondition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceDataConditionInput() { + return this._deviceDataCondition.internalValue; + } + + // device_linkage_status_condition - computed: false, optional: true, required: false + private _deviceLinkageStatusCondition = new IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusConditionOutputReference(this, "device_linkage_status_condition"); + public get deviceLinkageStatusCondition() { + return this._deviceLinkageStatusCondition; + } + public putDeviceLinkageStatusCondition(value: IotdaDeviceLinkageRuleTriggersDeviceLinkageStatusCondition) { + this._deviceLinkageStatusCondition.internalValue = value; + } + public resetDeviceLinkageStatusCondition() { + this._deviceLinkageStatusCondition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceLinkageStatusConditionInput() { + return this._deviceLinkageStatusCondition.internalValue; + } + + // simple_timer_condition - computed: false, optional: true, required: false + private _simpleTimerCondition = new IotdaDeviceLinkageRuleTriggersSimpleTimerConditionOutputReference(this, "simple_timer_condition"); + public get simpleTimerCondition() { + return this._simpleTimerCondition; + } + public putSimpleTimerCondition(value: IotdaDeviceLinkageRuleTriggersSimpleTimerCondition) { + this._simpleTimerCondition.internalValue = value; + } + public resetSimpleTimerCondition() { + this._simpleTimerCondition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get simpleTimerConditionInput() { + return this._simpleTimerCondition.internalValue; + } +} + +export class IotdaDeviceLinkageRuleTriggersList extends cdktf.ComplexList { + public internalValue? : IotdaDeviceLinkageRuleTriggers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDeviceLinkageRuleTriggersOutputReference { + return new IotdaDeviceLinkageRuleTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule huaweicloud_iotda_device_linkage_rule} +*/ +export class IotdaDeviceLinkageRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_linkage_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDeviceLinkageRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDeviceLinkageRule to import + * @param importFromId The id of the existing IotdaDeviceLinkageRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDeviceLinkageRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_linkage_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_linkage_rule huaweicloud_iotda_device_linkage_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceLinkageRuleConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceLinkageRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_linkage_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spaceId = config.spaceId; + this._triggerLogic = config.triggerLogic; + this._actions.internalValue = config.actions; + this._effectivePeriod.internalValue = config.effectivePeriod; + this._triggers.internalValue = config.triggers; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: false, required: true + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // trigger_logic - computed: false, optional: true, required: false + private _triggerLogic?: string; + public get triggerLogic() { + return this.getStringAttribute('trigger_logic'); + } + public set triggerLogic(value: string) { + this._triggerLogic = value; + } + public resetTriggerLogic() { + this._triggerLogic = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerLogicInput() { + return this._triggerLogic; + } + + // actions - computed: false, optional: false, required: true + private _actions = new IotdaDeviceLinkageRuleActionsList(this, "actions", true); + public get actions() { + return this._actions; + } + public putActions(value: IotdaDeviceLinkageRuleActions[] | cdktf.IResolvable) { + this._actions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get actionsInput() { + return this._actions.internalValue; + } + + // effective_period - computed: false, optional: true, required: false + private _effectivePeriod = new IotdaDeviceLinkageRuleEffectivePeriodOutputReference(this, "effective_period"); + public get effectivePeriod() { + return this._effectivePeriod; + } + public putEffectivePeriod(value: IotdaDeviceLinkageRuleEffectivePeriod) { + this._effectivePeriod.internalValue = value; + } + public resetEffectivePeriod() { + this._effectivePeriod.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get effectivePeriodInput() { + return this._effectivePeriod.internalValue; + } + + // triggers - computed: false, optional: false, required: true + private _triggers = new IotdaDeviceLinkageRuleTriggersList(this, "triggers", true); + public get triggers() { + return this._triggers; + } + public putTriggers(value: IotdaDeviceLinkageRuleTriggers[] | cdktf.IResolvable) { + this._triggers.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get triggersInput() { + return this._triggers.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + trigger_logic: cdktf.stringToTerraform(this._triggerLogic), + actions: cdktf.listMapper(iotdaDeviceLinkageRuleActionsToTerraform, true)(this._actions.internalValue), + effective_period: iotdaDeviceLinkageRuleEffectivePeriodToTerraform(this._effectivePeriod.internalValue), + triggers: cdktf.listMapper(iotdaDeviceLinkageRuleTriggersToTerraform, true)(this._triggers.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_logic: { + value: cdktf.stringToHclTerraform(this._triggerLogic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + actions: { + value: cdktf.listMapperHcl(iotdaDeviceLinkageRuleActionsToHclTerraform, true)(this._actions.internalValue), + isBlock: true, + type: "set", + storageClassType: "IotdaDeviceLinkageRuleActionsList", + }, + effective_period: { + value: iotdaDeviceLinkageRuleEffectivePeriodToHclTerraform(this._effectivePeriod.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceLinkageRuleEffectivePeriodList", + }, + triggers: { + value: cdktf.listMapperHcl(iotdaDeviceLinkageRuleTriggersToHclTerraform, true)(this._triggers.internalValue), + isBlock: true, + type: "set", + storageClassType: "IotdaDeviceLinkageRuleTriggersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device-message/README.md b/src/constructs/providers/huaweicloud/iotda-device-message/README.md new file mode 100644 index 00000000..7569307b --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-message/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device_message` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device_message`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message). diff --git a/src/constructs/providers/huaweicloud/iotda-device-message/index.ts b/src/constructs/providers/huaweicloud/iotda-device-message/index.ts new file mode 100644 index 00000000..d4c63fea --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-message/index.ts @@ -0,0 +1,822 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceMessageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#device_id IotdaDeviceMessage#device_id} + */ + readonly deviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#encoding IotdaDeviceMessage#encoding} + */ + readonly encoding?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#id IotdaDeviceMessage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#message IotdaDeviceMessage#message} + */ + readonly message: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#message_id IotdaDeviceMessage#message_id} + */ + readonly messageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#name IotdaDeviceMessage#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#payload_format IotdaDeviceMessage#payload_format} + */ + readonly payloadFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#region IotdaDeviceMessage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#topic IotdaDeviceMessage#topic} + */ + readonly topic?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#topic_full_name IotdaDeviceMessage#topic_full_name} + */ + readonly topicFullName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#ttl IotdaDeviceMessage#ttl} + */ + readonly ttl?: string; + /** + * properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#properties IotdaDeviceMessage#properties} + */ + readonly properties?: IotdaDeviceMessageProperties; +} +export interface IotdaDeviceMessageErrorInfo { +} + +export function iotdaDeviceMessageErrorInfoToTerraform(struct?: IotdaDeviceMessageErrorInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function iotdaDeviceMessageErrorInfoToHclTerraform(struct?: IotdaDeviceMessageErrorInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class IotdaDeviceMessageErrorInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDeviceMessageErrorInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceMessageErrorInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // error_code - computed: true, optional: false, required: false + public get errorCode() { + return this.getStringAttribute('error_code'); + } + + // error_msg - computed: true, optional: false, required: false + public get errorMsg() { + return this.getStringAttribute('error_msg'); + } +} + +export class IotdaDeviceMessageErrorInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDeviceMessageErrorInfoOutputReference { + return new IotdaDeviceMessageErrorInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaDeviceMessagePropertiesUserProperties { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#prop_key IotdaDeviceMessage#prop_key} + */ + readonly propKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#prop_value IotdaDeviceMessage#prop_value} + */ + readonly propValue?: string; +} + +export function iotdaDeviceMessagePropertiesUserPropertiesToTerraform(struct?: IotdaDeviceMessagePropertiesUserProperties | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + prop_key: cdktf.stringToTerraform(struct!.propKey), + prop_value: cdktf.stringToTerraform(struct!.propValue), + } +} + + +export function iotdaDeviceMessagePropertiesUserPropertiesToHclTerraform(struct?: IotdaDeviceMessagePropertiesUserProperties | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + prop_key: { + value: cdktf.stringToHclTerraform(struct!.propKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prop_value: { + value: cdktf.stringToHclTerraform(struct!.propValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceMessagePropertiesUserPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDeviceMessagePropertiesUserProperties | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._propKey !== undefined) { + hasAnyValues = true; + internalValueResult.propKey = this._propKey; + } + if (this._propValue !== undefined) { + hasAnyValues = true; + internalValueResult.propValue = this._propValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceMessagePropertiesUserProperties | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._propKey = undefined; + this._propValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._propKey = value.propKey; + this._propValue = value.propValue; + } + } + + // prop_key - computed: true, optional: true, required: false + private _propKey?: string; + public get propKey() { + return this.getStringAttribute('prop_key'); + } + public set propKey(value: string) { + this._propKey = value; + } + public resetPropKey() { + this._propKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get propKeyInput() { + return this._propKey; + } + + // prop_value - computed: true, optional: true, required: false + private _propValue?: string; + public get propValue() { + return this.getStringAttribute('prop_value'); + } + public set propValue(value: string) { + this._propValue = value; + } + public resetPropValue() { + this._propValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propValueInput() { + return this._propValue; + } +} + +export class IotdaDeviceMessagePropertiesUserPropertiesList extends cdktf.ComplexList { + public internalValue? : IotdaDeviceMessagePropertiesUserProperties[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDeviceMessagePropertiesUserPropertiesOutputReference { + return new IotdaDeviceMessagePropertiesUserPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaDeviceMessageProperties { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#correlation_data IotdaDeviceMessage#correlation_data} + */ + readonly correlationData?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#response_topic IotdaDeviceMessage#response_topic} + */ + readonly responseTopic?: string; + /** + * user_properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#user_properties IotdaDeviceMessage#user_properties} + */ + readonly userProperties?: IotdaDeviceMessagePropertiesUserProperties[] | cdktf.IResolvable; +} + +export function iotdaDeviceMessagePropertiesToTerraform(struct?: IotdaDeviceMessagePropertiesOutputReference | IotdaDeviceMessageProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + correlation_data: cdktf.stringToTerraform(struct!.correlationData), + response_topic: cdktf.stringToTerraform(struct!.responseTopic), + user_properties: cdktf.listMapper(iotdaDeviceMessagePropertiesUserPropertiesToTerraform, true)(struct!.userProperties), + } +} + + +export function iotdaDeviceMessagePropertiesToHclTerraform(struct?: IotdaDeviceMessagePropertiesOutputReference | IotdaDeviceMessageProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + correlation_data: { + value: cdktf.stringToHclTerraform(struct!.correlationData), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + response_topic: { + value: cdktf.stringToHclTerraform(struct!.responseTopic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_properties: { + value: cdktf.listMapperHcl(iotdaDeviceMessagePropertiesUserPropertiesToHclTerraform, true)(struct!.userProperties), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceMessagePropertiesUserPropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceMessagePropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceMessageProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._correlationData !== undefined) { + hasAnyValues = true; + internalValueResult.correlationData = this._correlationData; + } + if (this._responseTopic !== undefined) { + hasAnyValues = true; + internalValueResult.responseTopic = this._responseTopic; + } + if (this._userProperties?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.userProperties = this._userProperties?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceMessageProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._correlationData = undefined; + this._responseTopic = undefined; + this._userProperties.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._correlationData = value.correlationData; + this._responseTopic = value.responseTopic; + this._userProperties.internalValue = value.userProperties; + } + } + + // correlation_data - computed: true, optional: true, required: false + private _correlationData?: string; + public get correlationData() { + return this.getStringAttribute('correlation_data'); + } + public set correlationData(value: string) { + this._correlationData = value; + } + public resetCorrelationData() { + this._correlationData = undefined; + } + // Temporarily expose input value. Use with caution. + public get correlationDataInput() { + return this._correlationData; + } + + // response_topic - computed: true, optional: true, required: false + private _responseTopic?: string; + public get responseTopic() { + return this.getStringAttribute('response_topic'); + } + public set responseTopic(value: string) { + this._responseTopic = value; + } + public resetResponseTopic() { + this._responseTopic = undefined; + } + // Temporarily expose input value. Use with caution. + public get responseTopicInput() { + return this._responseTopic; + } + + // user_properties - computed: false, optional: true, required: false + private _userProperties = new IotdaDeviceMessagePropertiesUserPropertiesList(this, "user_properties", false); + public get userProperties() { + return this._userProperties; + } + public putUserProperties(value: IotdaDeviceMessagePropertiesUserProperties[] | cdktf.IResolvable) { + this._userProperties.internalValue = value; + } + public resetUserProperties() { + this._userProperties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get userPropertiesInput() { + return this._userProperties.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message huaweicloud_iotda_device_message} +*/ +export class IotdaDeviceMessage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_message"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDeviceMessage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDeviceMessage to import + * @param importFromId The id of the existing IotdaDeviceMessage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDeviceMessage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_message", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_message huaweicloud_iotda_device_message} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceMessageConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceMessageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_message', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deviceId = config.deviceId; + this._encoding = config.encoding; + this._id = config.id; + this._message = config.message; + this._messageId = config.messageId; + this._name = config.name; + this._payloadFormat = config.payloadFormat; + this._region = config.region; + this._topic = config.topic; + this._topicFullName = config.topicFullName; + this._ttl = config.ttl; + this._properties.internalValue = config.properties; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_time - computed: true, optional: false, required: false + public get createdTime() { + return this.getStringAttribute('created_time'); + } + + // device_id - computed: false, optional: false, required: true + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // encoding - computed: true, optional: true, required: false + private _encoding?: string; + public get encoding() { + return this.getStringAttribute('encoding'); + } + public set encoding(value: string) { + this._encoding = value; + } + public resetEncoding() { + this._encoding = undefined; + } + // Temporarily expose input value. Use with caution. + public get encodingInput() { + return this._encoding; + } + + // error_info - computed: true, optional: false, required: false + private _errorInfo = new IotdaDeviceMessageErrorInfoList(this, "error_info", false); + public get errorInfo() { + return this._errorInfo; + } + + // finished_time - computed: true, optional: false, required: false + public get finishedTime() { + return this.getStringAttribute('finished_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // message - computed: false, optional: false, required: true + private _message?: string; + public get message() { + return this.getStringAttribute('message'); + } + public set message(value: string) { + this._message = value; + } + // Temporarily expose input value. Use with caution. + public get messageInput() { + return this._message; + } + + // message_id - computed: true, optional: true, required: false + private _messageId?: string; + public get messageId() { + return this.getStringAttribute('message_id'); + } + public set messageId(value: string) { + this._messageId = value; + } + public resetMessageId() { + this._messageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageIdInput() { + return this._messageId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // payload_format - computed: true, optional: true, required: false + private _payloadFormat?: string; + public get payloadFormat() { + return this.getStringAttribute('payload_format'); + } + public set payloadFormat(value: string) { + this._payloadFormat = value; + } + public resetPayloadFormat() { + this._payloadFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get payloadFormatInput() { + return this._payloadFormat; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // topic - computed: true, optional: true, required: false + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + public resetTopic() { + this._topic = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // topic_full_name - computed: true, optional: true, required: false + private _topicFullName?: string; + public get topicFullName() { + return this.getStringAttribute('topic_full_name'); + } + public set topicFullName(value: string) { + this._topicFullName = value; + } + public resetTopicFullName() { + this._topicFullName = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicFullNameInput() { + return this._topicFullName; + } + + // ttl - computed: false, optional: true, required: false + private _ttl?: string; + public get ttl() { + return this.getStringAttribute('ttl'); + } + public set ttl(value: string) { + this._ttl = value; + } + public resetTtl() { + this._ttl = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInput() { + return this._ttl; + } + + // properties - computed: false, optional: true, required: false + private _properties = new IotdaDeviceMessagePropertiesOutputReference(this, "properties"); + public get properties() { + return this._properties; + } + public putProperties(value: IotdaDeviceMessageProperties) { + this._properties.internalValue = value; + } + public resetProperties() { + this._properties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device_id: cdktf.stringToTerraform(this._deviceId), + encoding: cdktf.stringToTerraform(this._encoding), + id: cdktf.stringToTerraform(this._id), + message: cdktf.stringToTerraform(this._message), + message_id: cdktf.stringToTerraform(this._messageId), + name: cdktf.stringToTerraform(this._name), + payload_format: cdktf.stringToTerraform(this._payloadFormat), + region: cdktf.stringToTerraform(this._region), + topic: cdktf.stringToTerraform(this._topic), + topic_full_name: cdktf.stringToTerraform(this._topicFullName), + ttl: cdktf.stringToTerraform(this._ttl), + properties: iotdaDeviceMessagePropertiesToTerraform(this._properties.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encoding: { + value: cdktf.stringToHclTerraform(this._encoding), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message: { + value: cdktf.stringToHclTerraform(this._message), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_id: { + value: cdktf.stringToHclTerraform(this._messageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + payload_format: { + value: cdktf.stringToHclTerraform(this._payloadFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_full_name: { + value: cdktf.stringToHclTerraform(this._topicFullName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ttl: { + value: cdktf.stringToHclTerraform(this._ttl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + properties: { + value: iotdaDeviceMessagePropertiesToHclTerraform(this._properties.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceMessagePropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device-proxy/README.md b/src/constructs/providers/huaweicloud/iotda-device-proxy/README.md new file mode 100644 index 00000000..f2bd56a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-proxy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device_proxy` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device_proxy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy). diff --git a/src/constructs/providers/huaweicloud/iotda-device-proxy/index.ts b/src/constructs/providers/huaweicloud/iotda-device-proxy/index.ts new file mode 100644 index 00000000..29247191 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device-proxy/index.ts @@ -0,0 +1,363 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceProxyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#devices IotdaDeviceProxy#devices} + */ + readonly devices: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#id IotdaDeviceProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#name IotdaDeviceProxy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#region IotdaDeviceProxy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#space_id IotdaDeviceProxy#space_id} + */ + readonly spaceId: string; + /** + * effective_time_range block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#effective_time_range IotdaDeviceProxy#effective_time_range} + */ + readonly effectiveTimeRange: IotdaDeviceProxyEffectiveTimeRange; +} +export interface IotdaDeviceProxyEffectiveTimeRange { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#end_time IotdaDeviceProxy#end_time} + */ + readonly endTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#start_time IotdaDeviceProxy#start_time} + */ + readonly startTime?: string; +} + +export function iotdaDeviceProxyEffectiveTimeRangeToTerraform(struct?: IotdaDeviceProxyEffectiveTimeRangeOutputReference | IotdaDeviceProxyEffectiveTimeRange): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function iotdaDeviceProxyEffectiveTimeRangeToHclTerraform(struct?: IotdaDeviceProxyEffectiveTimeRangeOutputReference | IotdaDeviceProxyEffectiveTimeRange): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceProxyEffectiveTimeRangeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaDeviceProxyEffectiveTimeRange | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceProxyEffectiveTimeRange | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._endTime = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._endTime = value.endTime; + this._startTime = value.startTime; + } + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy huaweicloud_iotda_device_proxy} +*/ +export class IotdaDeviceProxy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device_proxy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDeviceProxy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDeviceProxy to import + * @param importFromId The id of the existing IotdaDeviceProxy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDeviceProxy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device_proxy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device_proxy huaweicloud_iotda_device_proxy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceProxyConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceProxyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device_proxy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._devices = config.devices; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spaceId = config.spaceId; + this._effectiveTimeRange.internalValue = config.effectiveTimeRange; + } + + // ========== + // ATTRIBUTES + // ========== + + // devices - computed: false, optional: false, required: true + private _devices?: string[]; + public get devices() { + return cdktf.Fn.tolist(this.getListAttribute('devices')); + } + public set devices(value: string[]) { + this._devices = value; + } + // Temporarily expose input value. Use with caution. + public get devicesInput() { + return this._devices; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: false, required: true + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // effective_time_range - computed: false, optional: false, required: true + private _effectiveTimeRange = new IotdaDeviceProxyEffectiveTimeRangeOutputReference(this, "effective_time_range"); + public get effectiveTimeRange() { + return this._effectiveTimeRange; + } + public putEffectiveTimeRange(value: IotdaDeviceProxyEffectiveTimeRange) { + this._effectiveTimeRange.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get effectiveTimeRangeInput() { + return this._effectiveTimeRange.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + devices: cdktf.listMapper(cdktf.stringToTerraform, false)(this._devices), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + effective_time_range: iotdaDeviceProxyEffectiveTimeRangeToTerraform(this._effectiveTimeRange.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + devices: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._devices), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + effective_time_range: { + value: iotdaDeviceProxyEffectiveTimeRangeToHclTerraform(this._effectiveTimeRange.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceProxyEffectiveTimeRangeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-device/README.md b/src/constructs/providers/huaweicloud/iotda-device/README.md new file mode 100644 index 00000000..17f9b35d --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_device` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_device`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device). diff --git a/src/constructs/providers/huaweicloud/iotda-device/index.ts b/src/constructs/providers/huaweicloud/iotda-device/index.ts new file mode 100644 index 00000000..d1eb2457 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-device/index.ts @@ -0,0 +1,768 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaDeviceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#description IotdaDevice#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#device_id IotdaDevice#device_id} + */ + readonly deviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#extension_info IotdaDevice#extension_info} + */ + readonly extensionInfo?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#fingerprint IotdaDevice#fingerprint} + */ + readonly fingerprint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#force_disconnect IotdaDevice#force_disconnect} + */ + readonly forceDisconnect?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#frozen IotdaDevice#frozen} + */ + readonly frozen?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#gateway_id IotdaDevice#gateway_id} + */ + readonly gatewayId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#id IotdaDevice#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#name IotdaDevice#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#node_id IotdaDevice#node_id} + */ + readonly nodeId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#product_id IotdaDevice#product_id} + */ + readonly productId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#region IotdaDevice#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#secondary_fingerprint IotdaDevice#secondary_fingerprint} + */ + readonly secondaryFingerprint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#secondary_secret IotdaDevice#secondary_secret} + */ + readonly secondarySecret?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#secret IotdaDevice#secret} + */ + readonly secret?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#secure_access IotdaDevice#secure_access} + */ + readonly secureAccess?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#space_id IotdaDevice#space_id} + */ + readonly spaceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#tags IotdaDevice#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * shadow block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#shadow IotdaDevice#shadow} + */ + readonly shadow?: IotdaDeviceShadow[] | cdktf.IResolvable; +} +export interface IotdaDeviceShadow { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#desired IotdaDevice#desired} + */ + readonly desired: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#service_id IotdaDevice#service_id} + */ + readonly serviceId: string; +} + +export function iotdaDeviceShadowToTerraform(struct?: IotdaDeviceShadow | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + desired: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.desired), + service_id: cdktf.stringToTerraform(struct!.serviceId), + } +} + + +export function iotdaDeviceShadowToHclTerraform(struct?: IotdaDeviceShadow | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + desired: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.desired), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + service_id: { + value: cdktf.stringToHclTerraform(struct!.serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaDeviceShadowOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaDeviceShadow | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._desired !== undefined) { + hasAnyValues = true; + internalValueResult.desired = this._desired; + } + if (this._serviceId !== undefined) { + hasAnyValues = true; + internalValueResult.serviceId = this._serviceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaDeviceShadow | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._desired = undefined; + this._serviceId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._desired = value.desired; + this._serviceId = value.serviceId; + } + } + + // desired - computed: false, optional: false, required: true + private _desired?: { [key: string]: string }; + public get desired() { + return this.getStringMapAttribute('desired'); + } + public set desired(value: { [key: string]: string }) { + this._desired = value; + } + // Temporarily expose input value. Use with caution. + public get desiredInput() { + return this._desired; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } +} + +export class IotdaDeviceShadowList extends cdktf.ComplexList { + public internalValue? : IotdaDeviceShadow[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaDeviceShadowOutputReference { + return new IotdaDeviceShadowOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device huaweicloud_iotda_device} +*/ +export class IotdaDevice extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_device"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaDevice resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaDevice to import + * @param importFromId The id of the existing IotdaDevice that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaDevice to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_device", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_device huaweicloud_iotda_device} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaDeviceConfig + */ + public constructor(scope: Construct, id: string, config: IotdaDeviceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_device', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._deviceId = config.deviceId; + this._extensionInfo = config.extensionInfo; + this._fingerprint = config.fingerprint; + this._forceDisconnect = config.forceDisconnect; + this._frozen = config.frozen; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._name = config.name; + this._nodeId = config.nodeId; + this._productId = config.productId; + this._region = config.region; + this._secondaryFingerprint = config.secondaryFingerprint; + this._secondarySecret = config.secondarySecret; + this._secret = config.secret; + this._secureAccess = config.secureAccess; + this._spaceId = config.spaceId; + this._tags = config.tags; + this._shadow.internalValue = config.shadow; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_type - computed: true, optional: false, required: false + public get authType() { + return this.getStringAttribute('auth_type'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // device_id - computed: true, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // extension_info - computed: false, optional: true, required: false + private _extensionInfo?: { [key: string]: string }; + public get extensionInfo() { + return this.getStringMapAttribute('extension_info'); + } + public set extensionInfo(value: { [key: string]: string }) { + this._extensionInfo = value; + } + public resetExtensionInfo() { + this._extensionInfo = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionInfoInput() { + return this._extensionInfo; + } + + // fingerprint - computed: true, optional: true, required: false + private _fingerprint?: string; + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + public set fingerprint(value: string) { + this._fingerprint = value; + } + public resetFingerprint() { + this._fingerprint = undefined; + } + // Temporarily expose input value. Use with caution. + public get fingerprintInput() { + return this._fingerprint; + } + + // force_disconnect - computed: false, optional: true, required: false + private _forceDisconnect?: boolean | cdktf.IResolvable; + public get forceDisconnect() { + return this.getBooleanAttribute('force_disconnect'); + } + public set forceDisconnect(value: boolean | cdktf.IResolvable) { + this._forceDisconnect = value; + } + public resetForceDisconnect() { + this._forceDisconnect = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDisconnectInput() { + return this._forceDisconnect; + } + + // frozen - computed: true, optional: true, required: false + private _frozen?: boolean | cdktf.IResolvable; + public get frozen() { + return this.getBooleanAttribute('frozen'); + } + public set frozen(value: boolean | cdktf.IResolvable) { + this._frozen = value; + } + public resetFrozen() { + this._frozen = undefined; + } + // Temporarily expose input value. Use with caution. + public get frozenInput() { + return this._frozen; + } + + // gateway_id - computed: true, optional: true, required: false + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + public resetGatewayId() { + this._gatewayId = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_id - computed: false, optional: false, required: true + private _nodeId?: string; + public get nodeId() { + return this.getStringAttribute('node_id'); + } + public set nodeId(value: string) { + this._nodeId = value; + } + // Temporarily expose input value. Use with caution. + public get nodeIdInput() { + return this._nodeId; + } + + // node_type - computed: true, optional: false, required: false + public get nodeType() { + return this.getStringAttribute('node_type'); + } + + // product_id - computed: false, optional: false, required: true + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secondary_fingerprint - computed: true, optional: true, required: false + private _secondaryFingerprint?: string; + public get secondaryFingerprint() { + return this.getStringAttribute('secondary_fingerprint'); + } + public set secondaryFingerprint(value: string) { + this._secondaryFingerprint = value; + } + public resetSecondaryFingerprint() { + this._secondaryFingerprint = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryFingerprintInput() { + return this._secondaryFingerprint; + } + + // secondary_secret - computed: true, optional: true, required: false + private _secondarySecret?: string; + public get secondarySecret() { + return this.getStringAttribute('secondary_secret'); + } + public set secondarySecret(value: string) { + this._secondarySecret = value; + } + public resetSecondarySecret() { + this._secondarySecret = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondarySecretInput() { + return this._secondarySecret; + } + + // secret - computed: true, optional: true, required: false + private _secret?: string; + public get secret() { + return this.getStringAttribute('secret'); + } + public set secret(value: string) { + this._secret = value; + } + public resetSecret() { + this._secret = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretInput() { + return this._secret; + } + + // secure_access - computed: true, optional: true, required: false + private _secureAccess?: boolean | cdktf.IResolvable; + public get secureAccess() { + return this.getBooleanAttribute('secure_access'); + } + public set secureAccess(value: boolean | cdktf.IResolvable) { + this._secureAccess = value; + } + public resetSecureAccess() { + this._secureAccess = undefined; + } + // Temporarily expose input value. Use with caution. + public get secureAccessInput() { + return this._secureAccess; + } + + // space_id - computed: false, optional: false, required: true + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // shadow - computed: false, optional: true, required: false + private _shadow = new IotdaDeviceShadowList(this, "shadow", false); + public get shadow() { + return this._shadow; + } + public putShadow(value: IotdaDeviceShadow[] | cdktf.IResolvable) { + this._shadow.internalValue = value; + } + public resetShadow() { + this._shadow.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get shadowInput() { + return this._shadow.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + device_id: cdktf.stringToTerraform(this._deviceId), + extension_info: cdktf.hashMapper(cdktf.stringToTerraform)(this._extensionInfo), + fingerprint: cdktf.stringToTerraform(this._fingerprint), + force_disconnect: cdktf.booleanToTerraform(this._forceDisconnect), + frozen: cdktf.booleanToTerraform(this._frozen), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + node_id: cdktf.stringToTerraform(this._nodeId), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + secondary_fingerprint: cdktf.stringToTerraform(this._secondaryFingerprint), + secondary_secret: cdktf.stringToTerraform(this._secondarySecret), + secret: cdktf.stringToTerraform(this._secret), + secure_access: cdktf.booleanToTerraform(this._secureAccess), + space_id: cdktf.stringToTerraform(this._spaceId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + shadow: cdktf.listMapper(iotdaDeviceShadowToTerraform, true)(this._shadow.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extension_info: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extensionInfo), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + fingerprint: { + value: cdktf.stringToHclTerraform(this._fingerprint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_disconnect: { + value: cdktf.booleanToHclTerraform(this._forceDisconnect), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + frozen: { + value: cdktf.booleanToHclTerraform(this._frozen), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_id: { + value: cdktf.stringToHclTerraform(this._nodeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_fingerprint: { + value: cdktf.stringToHclTerraform(this._secondaryFingerprint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_secret: { + value: cdktf.stringToHclTerraform(this._secondarySecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret: { + value: cdktf.stringToHclTerraform(this._secret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secure_access: { + value: cdktf.booleanToHclTerraform(this._secureAccess), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + shadow: { + value: cdktf.listMapperHcl(iotdaDeviceShadowToHclTerraform, true)(this._shadow.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaDeviceShadowList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-product/README.md b/src/constructs/providers/huaweicloud/iotda-product/README.md new file mode 100644 index 00000000..5ad8c813 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-product/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_product` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_product`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product). diff --git a/src/constructs/providers/huaweicloud/iotda-product/index.ts b/src/constructs/providers/huaweicloud/iotda-product/index.ts new file mode 100644 index 00000000..bd45e222 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-product/index.ts @@ -0,0 +1,2229 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaProductConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#data_type IotdaProduct#data_type} + */ + readonly dataType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#description IotdaProduct#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#device_type IotdaProduct#device_type} + */ + readonly deviceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#id IotdaProduct#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#industry IotdaProduct#industry} + */ + readonly industry?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#manufacturer_name IotdaProduct#manufacturer_name} + */ + readonly manufacturerName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#name IotdaProduct#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#product_id IotdaProduct#product_id} + */ + readonly productId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#protocol IotdaProduct#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#region IotdaProduct#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#space_id IotdaProduct#space_id} + */ + readonly spaceId?: string; + /** + * services block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#services IotdaProduct#services} + */ + readonly services: IotdaProductServices[] | cdktf.IResolvable; +} +export interface IotdaProductServicesCommandsParas { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#default_value IotdaProduct#default_value} + */ + readonly defaultValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#description IotdaProduct#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#enum_list IotdaProduct#enum_list} + */ + readonly enumList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#max IotdaProduct#max} + */ + readonly max?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#max_length IotdaProduct#max_length} + */ + readonly maxLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#min IotdaProduct#min} + */ + readonly min?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#name IotdaProduct#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#required IotdaProduct#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#step IotdaProduct#step} + */ + readonly step?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#type IotdaProduct#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#unit IotdaProduct#unit} + */ + readonly unit?: string; +} + +export function iotdaProductServicesCommandsParasToTerraform(struct?: IotdaProductServicesCommandsParas | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default_value: cdktf.stringToTerraform(struct!.defaultValue), + description: cdktf.stringToTerraform(struct!.description), + enum_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.enumList), + max: cdktf.stringToTerraform(struct!.max), + max_length: cdktf.numberToTerraform(struct!.maxLength), + min: cdktf.stringToTerraform(struct!.min), + name: cdktf.stringToTerraform(struct!.name), + required: cdktf.booleanToTerraform(struct!.required), + step: cdktf.numberToTerraform(struct!.step), + type: cdktf.stringToTerraform(struct!.type), + unit: cdktf.stringToTerraform(struct!.unit), + } +} + + +export function iotdaProductServicesCommandsParasToHclTerraform(struct?: IotdaProductServicesCommandsParas | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default_value: { + value: cdktf.stringToHclTerraform(struct!.defaultValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enum_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.enumList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + max: { + value: cdktf.stringToHclTerraform(struct!.max), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_length: { + value: cdktf.numberToHclTerraform(struct!.maxLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min: { + value: cdktf.stringToHclTerraform(struct!.min), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + step: { + value: cdktf.numberToHclTerraform(struct!.step), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unit: { + value: cdktf.stringToHclTerraform(struct!.unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaProductServicesCommandsParasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaProductServicesCommandsParas | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._defaultValue !== undefined) { + hasAnyValues = true; + internalValueResult.defaultValue = this._defaultValue; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enumList !== undefined) { + hasAnyValues = true; + internalValueResult.enumList = this._enumList; + } + if (this._max !== undefined) { + hasAnyValues = true; + internalValueResult.max = this._max; + } + if (this._maxLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxLength = this._maxLength; + } + if (this._min !== undefined) { + hasAnyValues = true; + internalValueResult.min = this._min; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._step !== undefined) { + hasAnyValues = true; + internalValueResult.step = this._step; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._unit !== undefined) { + hasAnyValues = true; + internalValueResult.unit = this._unit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaProductServicesCommandsParas | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._defaultValue = undefined; + this._description = undefined; + this._enumList = undefined; + this._max = undefined; + this._maxLength = undefined; + this._min = undefined; + this._name = undefined; + this._required = undefined; + this._step = undefined; + this._type = undefined; + this._unit = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._defaultValue = value.defaultValue; + this._description = value.description; + this._enumList = value.enumList; + this._max = value.max; + this._maxLength = value.maxLength; + this._min = value.min; + this._name = value.name; + this._required = value.required; + this._step = value.step; + this._type = value.type; + this._unit = value.unit; + } + } + + // default_value - computed: true, optional: true, required: false + private _defaultValue?: string; + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + public set defaultValue(value: string) { + this._defaultValue = value; + } + public resetDefaultValue() { + this._defaultValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultValueInput() { + return this._defaultValue; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enum_list - computed: true, optional: true, required: false + private _enumList?: string[]; + public get enumList() { + return this.getListAttribute('enum_list'); + } + public set enumList(value: string[]) { + this._enumList = value; + } + public resetEnumList() { + this._enumList = undefined; + } + // Temporarily expose input value. Use with caution. + public get enumListInput() { + return this._enumList; + } + + // max - computed: false, optional: true, required: false + private _max?: string; + public get max() { + return this.getStringAttribute('max'); + } + public set max(value: string) { + this._max = value; + } + public resetMax() { + this._max = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInput() { + return this._max; + } + + // max_length - computed: true, optional: true, required: false + private _maxLength?: number; + public get maxLength() { + return this.getNumberAttribute('max_length'); + } + public set maxLength(value: number) { + this._maxLength = value; + } + public resetMaxLength() { + this._maxLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxLengthInput() { + return this._maxLength; + } + + // min - computed: false, optional: true, required: false + private _min?: string; + public get min() { + return this.getStringAttribute('min'); + } + public set min(value: string) { + this._min = value; + } + public resetMin() { + this._min = undefined; + } + // Temporarily expose input value. Use with caution. + public get minInput() { + return this._min; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // required - computed: false, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // step - computed: true, optional: true, required: false + private _step?: number; + public get step() { + return this.getNumberAttribute('step'); + } + public set step(value: number) { + this._step = value; + } + public resetStep() { + this._step = undefined; + } + // Temporarily expose input value. Use with caution. + public get stepInput() { + return this._step; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // unit - computed: true, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } +} + +export class IotdaProductServicesCommandsParasList extends cdktf.ComplexList { + public internalValue? : IotdaProductServicesCommandsParas[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaProductServicesCommandsParasOutputReference { + return new IotdaProductServicesCommandsParasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaProductServicesCommandsResponses { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#default_value IotdaProduct#default_value} + */ + readonly defaultValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#description IotdaProduct#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#enum_list IotdaProduct#enum_list} + */ + readonly enumList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#max IotdaProduct#max} + */ + readonly max?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#max_length IotdaProduct#max_length} + */ + readonly maxLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#min IotdaProduct#min} + */ + readonly min?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#name IotdaProduct#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#required IotdaProduct#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#step IotdaProduct#step} + */ + readonly step?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#type IotdaProduct#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#unit IotdaProduct#unit} + */ + readonly unit?: string; +} + +export function iotdaProductServicesCommandsResponsesToTerraform(struct?: IotdaProductServicesCommandsResponses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default_value: cdktf.stringToTerraform(struct!.defaultValue), + description: cdktf.stringToTerraform(struct!.description), + enum_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.enumList), + max: cdktf.stringToTerraform(struct!.max), + max_length: cdktf.numberToTerraform(struct!.maxLength), + min: cdktf.stringToTerraform(struct!.min), + name: cdktf.stringToTerraform(struct!.name), + required: cdktf.booleanToTerraform(struct!.required), + step: cdktf.numberToTerraform(struct!.step), + type: cdktf.stringToTerraform(struct!.type), + unit: cdktf.stringToTerraform(struct!.unit), + } +} + + +export function iotdaProductServicesCommandsResponsesToHclTerraform(struct?: IotdaProductServicesCommandsResponses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default_value: { + value: cdktf.stringToHclTerraform(struct!.defaultValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enum_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.enumList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + max: { + value: cdktf.stringToHclTerraform(struct!.max), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_length: { + value: cdktf.numberToHclTerraform(struct!.maxLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min: { + value: cdktf.stringToHclTerraform(struct!.min), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + step: { + value: cdktf.numberToHclTerraform(struct!.step), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unit: { + value: cdktf.stringToHclTerraform(struct!.unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaProductServicesCommandsResponsesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaProductServicesCommandsResponses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._defaultValue !== undefined) { + hasAnyValues = true; + internalValueResult.defaultValue = this._defaultValue; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enumList !== undefined) { + hasAnyValues = true; + internalValueResult.enumList = this._enumList; + } + if (this._max !== undefined) { + hasAnyValues = true; + internalValueResult.max = this._max; + } + if (this._maxLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxLength = this._maxLength; + } + if (this._min !== undefined) { + hasAnyValues = true; + internalValueResult.min = this._min; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._step !== undefined) { + hasAnyValues = true; + internalValueResult.step = this._step; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._unit !== undefined) { + hasAnyValues = true; + internalValueResult.unit = this._unit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaProductServicesCommandsResponses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._defaultValue = undefined; + this._description = undefined; + this._enumList = undefined; + this._max = undefined; + this._maxLength = undefined; + this._min = undefined; + this._name = undefined; + this._required = undefined; + this._step = undefined; + this._type = undefined; + this._unit = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._defaultValue = value.defaultValue; + this._description = value.description; + this._enumList = value.enumList; + this._max = value.max; + this._maxLength = value.maxLength; + this._min = value.min; + this._name = value.name; + this._required = value.required; + this._step = value.step; + this._type = value.type; + this._unit = value.unit; + } + } + + // default_value - computed: true, optional: true, required: false + private _defaultValue?: string; + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + public set defaultValue(value: string) { + this._defaultValue = value; + } + public resetDefaultValue() { + this._defaultValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultValueInput() { + return this._defaultValue; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enum_list - computed: true, optional: true, required: false + private _enumList?: string[]; + public get enumList() { + return this.getListAttribute('enum_list'); + } + public set enumList(value: string[]) { + this._enumList = value; + } + public resetEnumList() { + this._enumList = undefined; + } + // Temporarily expose input value. Use with caution. + public get enumListInput() { + return this._enumList; + } + + // max - computed: false, optional: true, required: false + private _max?: string; + public get max() { + return this.getStringAttribute('max'); + } + public set max(value: string) { + this._max = value; + } + public resetMax() { + this._max = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInput() { + return this._max; + } + + // max_length - computed: true, optional: true, required: false + private _maxLength?: number; + public get maxLength() { + return this.getNumberAttribute('max_length'); + } + public set maxLength(value: number) { + this._maxLength = value; + } + public resetMaxLength() { + this._maxLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxLengthInput() { + return this._maxLength; + } + + // min - computed: false, optional: true, required: false + private _min?: string; + public get min() { + return this.getStringAttribute('min'); + } + public set min(value: string) { + this._min = value; + } + public resetMin() { + this._min = undefined; + } + // Temporarily expose input value. Use with caution. + public get minInput() { + return this._min; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // required - computed: false, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // step - computed: true, optional: true, required: false + private _step?: number; + public get step() { + return this.getNumberAttribute('step'); + } + public set step(value: number) { + this._step = value; + } + public resetStep() { + this._step = undefined; + } + // Temporarily expose input value. Use with caution. + public get stepInput() { + return this._step; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // unit - computed: true, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } +} + +export class IotdaProductServicesCommandsResponsesList extends cdktf.ComplexList { + public internalValue? : IotdaProductServicesCommandsResponses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaProductServicesCommandsResponsesOutputReference { + return new IotdaProductServicesCommandsResponsesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaProductServicesCommands { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#name IotdaProduct#name} + */ + readonly name: string; + /** + * paras block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#paras IotdaProduct#paras} + */ + readonly paras?: IotdaProductServicesCommandsParas[] | cdktf.IResolvable; + /** + * responses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#responses IotdaProduct#responses} + */ + readonly responses?: IotdaProductServicesCommandsResponses[] | cdktf.IResolvable; +} + +export function iotdaProductServicesCommandsToTerraform(struct?: IotdaProductServicesCommands | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + paras: cdktf.listMapper(iotdaProductServicesCommandsParasToTerraform, true)(struct!.paras), + responses: cdktf.listMapper(iotdaProductServicesCommandsResponsesToTerraform, true)(struct!.responses), + } +} + + +export function iotdaProductServicesCommandsToHclTerraform(struct?: IotdaProductServicesCommands | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + paras: { + value: cdktf.listMapperHcl(iotdaProductServicesCommandsParasToHclTerraform, true)(struct!.paras), + isBlock: true, + type: "list", + storageClassType: "IotdaProductServicesCommandsParasList", + }, + responses: { + value: cdktf.listMapperHcl(iotdaProductServicesCommandsResponsesToHclTerraform, true)(struct!.responses), + isBlock: true, + type: "list", + storageClassType: "IotdaProductServicesCommandsResponsesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaProductServicesCommandsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaProductServicesCommands | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._paras?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.paras = this._paras?.internalValue; + } + if (this._responses?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.responses = this._responses?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaProductServicesCommands | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._paras.internalValue = undefined; + this._responses.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._paras.internalValue = value.paras; + this._responses.internalValue = value.responses; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // paras - computed: false, optional: true, required: false + private _paras = new IotdaProductServicesCommandsParasList(this, "paras", false); + public get paras() { + return this._paras; + } + public putParas(value: IotdaProductServicesCommandsParas[] | cdktf.IResolvable) { + this._paras.internalValue = value; + } + public resetParas() { + this._paras.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parasInput() { + return this._paras.internalValue; + } + + // responses - computed: false, optional: true, required: false + private _responses = new IotdaProductServicesCommandsResponsesList(this, "responses", false); + public get responses() { + return this._responses; + } + public putResponses(value: IotdaProductServicesCommandsResponses[] | cdktf.IResolvable) { + this._responses.internalValue = value; + } + public resetResponses() { + this._responses.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get responsesInput() { + return this._responses.internalValue; + } +} + +export class IotdaProductServicesCommandsList extends cdktf.ComplexList { + public internalValue? : IotdaProductServicesCommands[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaProductServicesCommandsOutputReference { + return new IotdaProductServicesCommandsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaProductServicesProperties { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#default_value IotdaProduct#default_value} + */ + readonly defaultValue?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#description IotdaProduct#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#enum_list IotdaProduct#enum_list} + */ + readonly enumList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#max IotdaProduct#max} + */ + readonly max?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#max_length IotdaProduct#max_length} + */ + readonly maxLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#method IotdaProduct#method} + */ + readonly method: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#min IotdaProduct#min} + */ + readonly min?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#name IotdaProduct#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#required IotdaProduct#required} + */ + readonly required?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#step IotdaProduct#step} + */ + readonly step?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#type IotdaProduct#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#unit IotdaProduct#unit} + */ + readonly unit?: string; +} + +export function iotdaProductServicesPropertiesToTerraform(struct?: IotdaProductServicesProperties | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default_value: cdktf.stringToTerraform(struct!.defaultValue), + description: cdktf.stringToTerraform(struct!.description), + enum_list: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.enumList), + max: cdktf.stringToTerraform(struct!.max), + max_length: cdktf.numberToTerraform(struct!.maxLength), + method: cdktf.stringToTerraform(struct!.method), + min: cdktf.stringToTerraform(struct!.min), + name: cdktf.stringToTerraform(struct!.name), + required: cdktf.booleanToTerraform(struct!.required), + step: cdktf.numberToTerraform(struct!.step), + type: cdktf.stringToTerraform(struct!.type), + unit: cdktf.stringToTerraform(struct!.unit), + } +} + + +export function iotdaProductServicesPropertiesToHclTerraform(struct?: IotdaProductServicesProperties | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default_value: { + value: cdktf.stringToHclTerraform(struct!.defaultValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enum_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.enumList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + max: { + value: cdktf.stringToHclTerraform(struct!.max), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_length: { + value: cdktf.numberToHclTerraform(struct!.maxLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + method: { + value: cdktf.stringToHclTerraform(struct!.method), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + min: { + value: cdktf.stringToHclTerraform(struct!.min), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + required: { + value: cdktf.booleanToHclTerraform(struct!.required), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + step: { + value: cdktf.numberToHclTerraform(struct!.step), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + unit: { + value: cdktf.stringToHclTerraform(struct!.unit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaProductServicesPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaProductServicesProperties | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._defaultValue !== undefined) { + hasAnyValues = true; + internalValueResult.defaultValue = this._defaultValue; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._enumList !== undefined) { + hasAnyValues = true; + internalValueResult.enumList = this._enumList; + } + if (this._max !== undefined) { + hasAnyValues = true; + internalValueResult.max = this._max; + } + if (this._maxLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxLength = this._maxLength; + } + if (this._method !== undefined) { + hasAnyValues = true; + internalValueResult.method = this._method; + } + if (this._min !== undefined) { + hasAnyValues = true; + internalValueResult.min = this._min; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._required !== undefined) { + hasAnyValues = true; + internalValueResult.required = this._required; + } + if (this._step !== undefined) { + hasAnyValues = true; + internalValueResult.step = this._step; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._unit !== undefined) { + hasAnyValues = true; + internalValueResult.unit = this._unit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaProductServicesProperties | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._defaultValue = undefined; + this._description = undefined; + this._enumList = undefined; + this._max = undefined; + this._maxLength = undefined; + this._method = undefined; + this._min = undefined; + this._name = undefined; + this._required = undefined; + this._step = undefined; + this._type = undefined; + this._unit = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._defaultValue = value.defaultValue; + this._description = value.description; + this._enumList = value.enumList; + this._max = value.max; + this._maxLength = value.maxLength; + this._method = value.method; + this._min = value.min; + this._name = value.name; + this._required = value.required; + this._step = value.step; + this._type = value.type; + this._unit = value.unit; + } + } + + // default_value - computed: true, optional: true, required: false + private _defaultValue?: string; + public get defaultValue() { + return this.getStringAttribute('default_value'); + } + public set defaultValue(value: string) { + this._defaultValue = value; + } + public resetDefaultValue() { + this._defaultValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultValueInput() { + return this._defaultValue; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enum_list - computed: true, optional: true, required: false + private _enumList?: string[]; + public get enumList() { + return this.getListAttribute('enum_list'); + } + public set enumList(value: string[]) { + this._enumList = value; + } + public resetEnumList() { + this._enumList = undefined; + } + // Temporarily expose input value. Use with caution. + public get enumListInput() { + return this._enumList; + } + + // max - computed: false, optional: true, required: false + private _max?: string; + public get max() { + return this.getStringAttribute('max'); + } + public set max(value: string) { + this._max = value; + } + public resetMax() { + this._max = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxInput() { + return this._max; + } + + // max_length - computed: true, optional: true, required: false + private _maxLength?: number; + public get maxLength() { + return this.getNumberAttribute('max_length'); + } + public set maxLength(value: number) { + this._maxLength = value; + } + public resetMaxLength() { + this._maxLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxLengthInput() { + return this._maxLength; + } + + // method - computed: false, optional: false, required: true + private _method?: string; + public get method() { + return this.getStringAttribute('method'); + } + public set method(value: string) { + this._method = value; + } + // Temporarily expose input value. Use with caution. + public get methodInput() { + return this._method; + } + + // min - computed: false, optional: true, required: false + private _min?: string; + public get min() { + return this.getStringAttribute('min'); + } + public set min(value: string) { + this._min = value; + } + public resetMin() { + this._min = undefined; + } + // Temporarily expose input value. Use with caution. + public get minInput() { + return this._min; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // required - computed: false, optional: true, required: false + private _required?: boolean | cdktf.IResolvable; + public get required() { + return this.getBooleanAttribute('required'); + } + public set required(value: boolean | cdktf.IResolvable) { + this._required = value; + } + public resetRequired() { + this._required = undefined; + } + // Temporarily expose input value. Use with caution. + public get requiredInput() { + return this._required; + } + + // step - computed: true, optional: true, required: false + private _step?: number; + public get step() { + return this.getNumberAttribute('step'); + } + public set step(value: number) { + this._step = value; + } + public resetStep() { + this._step = undefined; + } + // Temporarily expose input value. Use with caution. + public get stepInput() { + return this._step; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // unit - computed: true, optional: true, required: false + private _unit?: string; + public get unit() { + return this.getStringAttribute('unit'); + } + public set unit(value: string) { + this._unit = value; + } + public resetUnit() { + this._unit = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitInput() { + return this._unit; + } +} + +export class IotdaProductServicesPropertiesList extends cdktf.ComplexList { + public internalValue? : IotdaProductServicesProperties[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaProductServicesPropertiesOutputReference { + return new IotdaProductServicesPropertiesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface IotdaProductServices { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#description IotdaProduct#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#id IotdaProduct#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#option IotdaProduct#option} + */ + readonly option?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#type IotdaProduct#type} + */ + readonly type?: string; + /** + * commands block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#commands IotdaProduct#commands} + */ + readonly commands?: IotdaProductServicesCommands[] | cdktf.IResolvable; + /** + * properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#properties IotdaProduct#properties} + */ + readonly properties?: IotdaProductServicesProperties[] | cdktf.IResolvable; +} + +export function iotdaProductServicesToTerraform(struct?: IotdaProductServices | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + id: cdktf.stringToTerraform(struct!.id), + option: cdktf.stringToTerraform(struct!.option), + type: cdktf.stringToTerraform(struct!.type), + commands: cdktf.listMapper(iotdaProductServicesCommandsToTerraform, true)(struct!.commands), + properties: cdktf.listMapper(iotdaProductServicesPropertiesToTerraform, true)(struct!.properties), + } +} + + +export function iotdaProductServicesToHclTerraform(struct?: IotdaProductServices | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + option: { + value: cdktf.stringToHclTerraform(struct!.option), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + commands: { + value: cdktf.listMapperHcl(iotdaProductServicesCommandsToHclTerraform, true)(struct!.commands), + isBlock: true, + type: "list", + storageClassType: "IotdaProductServicesCommandsList", + }, + properties: { + value: cdktf.listMapperHcl(iotdaProductServicesPropertiesToHclTerraform, true)(struct!.properties), + isBlock: true, + type: "list", + storageClassType: "IotdaProductServicesPropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaProductServicesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaProductServices | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._option !== undefined) { + hasAnyValues = true; + internalValueResult.option = this._option; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._commands?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.commands = this._commands?.internalValue; + } + if (this._properties?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.properties = this._properties?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaProductServices | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._id = undefined; + this._option = undefined; + this._type = undefined; + this._commands.internalValue = undefined; + this._properties.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._id = value.id; + this._option = value.option; + this._type = value.type; + this._commands.internalValue = value.commands; + this._properties.internalValue = value.properties; + } + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // option - computed: true, optional: true, required: false + private _option?: string; + public get option() { + return this.getStringAttribute('option'); + } + public set option(value: string) { + this._option = value; + } + public resetOption() { + this._option = undefined; + } + // Temporarily expose input value. Use with caution. + public get optionInput() { + return this._option; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // commands - computed: false, optional: true, required: false + private _commands = new IotdaProductServicesCommandsList(this, "commands", false); + public get commands() { + return this._commands; + } + public putCommands(value: IotdaProductServicesCommands[] | cdktf.IResolvable) { + this._commands.internalValue = value; + } + public resetCommands() { + this._commands.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandsInput() { + return this._commands.internalValue; + } + + // properties - computed: false, optional: true, required: false + private _properties = new IotdaProductServicesPropertiesList(this, "properties", false); + public get properties() { + return this._properties; + } + public putProperties(value: IotdaProductServicesProperties[] | cdktf.IResolvable) { + this._properties.internalValue = value; + } + public resetProperties() { + this._properties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties.internalValue; + } +} + +export class IotdaProductServicesList extends cdktf.ComplexList { + public internalValue? : IotdaProductServices[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaProductServicesOutputReference { + return new IotdaProductServicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product huaweicloud_iotda_product} +*/ +export class IotdaProduct extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_product"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaProduct resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaProduct to import + * @param importFromId The id of the existing IotdaProduct that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaProduct to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_product", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_product huaweicloud_iotda_product} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaProductConfig + */ + public constructor(scope: Construct, id: string, config: IotdaProductConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_product', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataType = config.dataType; + this._description = config.description; + this._deviceType = config.deviceType; + this._id = config.id; + this._industry = config.industry; + this._manufacturerName = config.manufacturerName; + this._name = config.name; + this._productId = config.productId; + this._protocol = config.protocol; + this._region = config.region; + this._spaceId = config.spaceId; + this._services.internalValue = config.services; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_type - computed: false, optional: false, required: true + private _dataType?: string; + public get dataType() { + return this.getStringAttribute('data_type'); + } + public set dataType(value: string) { + this._dataType = value; + } + // Temporarily expose input value. Use with caution. + public get dataTypeInput() { + return this._dataType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // device_type - computed: false, optional: false, required: true + private _deviceType?: string; + public get deviceType() { + return this.getStringAttribute('device_type'); + } + public set deviceType(value: string) { + this._deviceType = value; + } + // Temporarily expose input value. Use with caution. + public get deviceTypeInput() { + return this._deviceType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // industry - computed: true, optional: true, required: false + private _industry?: string; + public get industry() { + return this.getStringAttribute('industry'); + } + public set industry(value: string) { + this._industry = value; + } + public resetIndustry() { + this._industry = undefined; + } + // Temporarily expose input value. Use with caution. + public get industryInput() { + return this._industry; + } + + // manufacturer_name - computed: true, optional: true, required: false + private _manufacturerName?: string; + public get manufacturerName() { + return this.getStringAttribute('manufacturer_name'); + } + public set manufacturerName(value: string) { + this._manufacturerName = value; + } + public resetManufacturerName() { + this._manufacturerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get manufacturerNameInput() { + return this._manufacturerName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // product_id - computed: true, optional: true, required: false + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + public resetProductId() { + this._productId = undefined; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: true, optional: true, required: false + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + public resetSpaceId() { + this._spaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // services - computed: false, optional: false, required: true + private _services = new IotdaProductServicesList(this, "services", false); + public get services() { + return this._services; + } + public putServices(value: IotdaProductServices[] | cdktf.IResolvable) { + this._services.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get servicesInput() { + return this._services.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_type: cdktf.stringToTerraform(this._dataType), + description: cdktf.stringToTerraform(this._description), + device_type: cdktf.stringToTerraform(this._deviceType), + id: cdktf.stringToTerraform(this._id), + industry: cdktf.stringToTerraform(this._industry), + manufacturer_name: cdktf.stringToTerraform(this._manufacturerName), + name: cdktf.stringToTerraform(this._name), + product_id: cdktf.stringToTerraform(this._productId), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + services: cdktf.listMapper(iotdaProductServicesToTerraform, true)(this._services.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_type: { + value: cdktf.stringToHclTerraform(this._dataType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_type: { + value: cdktf.stringToHclTerraform(this._deviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + industry: { + value: cdktf.stringToHclTerraform(this._industry), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + manufacturer_name: { + value: cdktf.stringToHclTerraform(this._manufacturerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + services: { + value: cdktf.listMapperHcl(iotdaProductServicesToHclTerraform, true)(this._services.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaProductServicesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-space/README.md b/src/constructs/providers/huaweicloud/iotda-space/README.md new file mode 100644 index 00000000..94c8bb71 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-space/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_space` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_space`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space). diff --git a/src/constructs/providers/huaweicloud/iotda-space/index.ts b/src/constructs/providers/huaweicloud/iotda-space/index.ts new file mode 100644 index 00000000..1a299ab4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-space/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaSpaceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space#id IotdaSpace#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space#name IotdaSpace#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space#region IotdaSpace#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space huaweicloud_iotda_space} +*/ +export class IotdaSpace extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_space"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaSpace resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaSpace to import + * @param importFromId The id of the existing IotdaSpace that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaSpace to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_space", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_space huaweicloud_iotda_space} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaSpaceConfig + */ + public constructor(scope: Construct, id: string, config: IotdaSpaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_space', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_default - computed: true, optional: false, required: false + public get isDefault() { + return this.getBooleanAttribute('is_default'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/iotda-upgrade-package/README.md b/src/constructs/providers/huaweicloud/iotda-upgrade-package/README.md new file mode 100644 index 00000000..778c48db --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-upgrade-package/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_iotda_upgrade_package` + +Refer to the Terraform Registry for docs: [`huaweicloud_iotda_upgrade_package`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package). diff --git a/src/constructs/providers/huaweicloud/iotda-upgrade-package/index.ts b/src/constructs/providers/huaweicloud/iotda-upgrade-package/index.ts new file mode 100644 index 00000000..0bae4644 --- /dev/null +++ b/src/constructs/providers/huaweicloud/iotda-upgrade-package/index.ts @@ -0,0 +1,652 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface IotdaUpgradePackageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#custom_info IotdaUpgradePackage#custom_info} + */ + readonly customInfo?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#description IotdaUpgradePackage#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#id IotdaUpgradePackage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#product_id IotdaUpgradePackage#product_id} + */ + readonly productId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#region IotdaUpgradePackage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#space_id IotdaUpgradePackage#space_id} + */ + readonly spaceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#support_source_versions IotdaUpgradePackage#support_source_versions} + */ + readonly supportSourceVersions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#type IotdaUpgradePackage#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#version IotdaUpgradePackage#version} + */ + readonly version: string; + /** + * file_location block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#file_location IotdaUpgradePackage#file_location} + */ + readonly fileLocation: IotdaUpgradePackageFileLocation[] | cdktf.IResolvable; +} +export interface IotdaUpgradePackageFileLocationObsLocation { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#bucket_name IotdaUpgradePackage#bucket_name} + */ + readonly bucketName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#object_key IotdaUpgradePackage#object_key} + */ + readonly objectKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#region IotdaUpgradePackage#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#sign IotdaUpgradePackage#sign} + */ + readonly sign?: string; +} + +export function iotdaUpgradePackageFileLocationObsLocationToTerraform(struct?: IotdaUpgradePackageFileLocationObsLocationOutputReference | IotdaUpgradePackageFileLocationObsLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket_name: cdktf.stringToTerraform(struct!.bucketName), + object_key: cdktf.stringToTerraform(struct!.objectKey), + region: cdktf.stringToTerraform(struct!.region), + sign: cdktf.stringToTerraform(struct!.sign), + } +} + + +export function iotdaUpgradePackageFileLocationObsLocationToHclTerraform(struct?: IotdaUpgradePackageFileLocationObsLocationOutputReference | IotdaUpgradePackageFileLocationObsLocation): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket_name: { + value: cdktf.stringToHclTerraform(struct!.bucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_key: { + value: cdktf.stringToHclTerraform(struct!.objectKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign: { + value: cdktf.stringToHclTerraform(struct!.sign), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaUpgradePackageFileLocationObsLocationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): IotdaUpgradePackageFileLocationObsLocation | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucketName !== undefined) { + hasAnyValues = true; + internalValueResult.bucketName = this._bucketName; + } + if (this._objectKey !== undefined) { + hasAnyValues = true; + internalValueResult.objectKey = this._objectKey; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._sign !== undefined) { + hasAnyValues = true; + internalValueResult.sign = this._sign; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaUpgradePackageFileLocationObsLocation | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucketName = undefined; + this._objectKey = undefined; + this._region = undefined; + this._sign = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucketName = value.bucketName; + this._objectKey = value.objectKey; + this._region = value.region; + this._sign = value.sign; + } + } + + // bucket_name - computed: false, optional: false, required: true + private _bucketName?: string; + public get bucketName() { + return this.getStringAttribute('bucket_name'); + } + public set bucketName(value: string) { + this._bucketName = value; + } + // Temporarily expose input value. Use with caution. + public get bucketNameInput() { + return this._bucketName; + } + + // object_key - computed: false, optional: false, required: true + private _objectKey?: string; + public get objectKey() { + return this.getStringAttribute('object_key'); + } + public set objectKey(value: string) { + this._objectKey = value; + } + // Temporarily expose input value. Use with caution. + public get objectKeyInput() { + return this._objectKey; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sign - computed: true, optional: true, required: false + private _sign?: string; + public get sign() { + return this.getStringAttribute('sign'); + } + public set sign(value: string) { + this._sign = value; + } + public resetSign() { + this._sign = undefined; + } + // Temporarily expose input value. Use with caution. + public get signInput() { + return this._sign; + } +} +export interface IotdaUpgradePackageFileLocation { + /** + * obs_location block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#obs_location IotdaUpgradePackage#obs_location} + */ + readonly obsLocation?: IotdaUpgradePackageFileLocationObsLocation; +} + +export function iotdaUpgradePackageFileLocationToTerraform(struct?: IotdaUpgradePackageFileLocation | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + obs_location: iotdaUpgradePackageFileLocationObsLocationToTerraform(struct!.obsLocation), + } +} + + +export function iotdaUpgradePackageFileLocationToHclTerraform(struct?: IotdaUpgradePackageFileLocation | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + obs_location: { + value: iotdaUpgradePackageFileLocationObsLocationToHclTerraform(struct!.obsLocation), + isBlock: true, + type: "list", + storageClassType: "IotdaUpgradePackageFileLocationObsLocationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class IotdaUpgradePackageFileLocationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): IotdaUpgradePackageFileLocation | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._obsLocation?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.obsLocation = this._obsLocation?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: IotdaUpgradePackageFileLocation | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._obsLocation.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._obsLocation.internalValue = value.obsLocation; + } + } + + // obs_location - computed: false, optional: true, required: false + private _obsLocation = new IotdaUpgradePackageFileLocationObsLocationOutputReference(this, "obs_location"); + public get obsLocation() { + return this._obsLocation; + } + public putObsLocation(value: IotdaUpgradePackageFileLocationObsLocation) { + this._obsLocation.internalValue = value; + } + public resetObsLocation() { + this._obsLocation.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsLocationInput() { + return this._obsLocation.internalValue; + } +} + +export class IotdaUpgradePackageFileLocationList extends cdktf.ComplexList { + public internalValue? : IotdaUpgradePackageFileLocation[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): IotdaUpgradePackageFileLocationOutputReference { + return new IotdaUpgradePackageFileLocationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package huaweicloud_iotda_upgrade_package} +*/ +export class IotdaUpgradePackage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_iotda_upgrade_package"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a IotdaUpgradePackage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the IotdaUpgradePackage to import + * @param importFromId The id of the existing IotdaUpgradePackage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the IotdaUpgradePackage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_iotda_upgrade_package", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/iotda_upgrade_package huaweicloud_iotda_upgrade_package} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options IotdaUpgradePackageConfig + */ + public constructor(scope: Construct, id: string, config: IotdaUpgradePackageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_iotda_upgrade_package', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._customInfo = config.customInfo; + this._description = config.description; + this._id = config.id; + this._productId = config.productId; + this._region = config.region; + this._spaceId = config.spaceId; + this._supportSourceVersions = config.supportSourceVersions; + this._type = config.type; + this._version = config.version; + this._fileLocation.internalValue = config.fileLocation; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // custom_info - computed: false, optional: true, required: false + private _customInfo?: string; + public get customInfo() { + return this.getStringAttribute('custom_info'); + } + public set customInfo(value: string) { + this._customInfo = value; + } + public resetCustomInfo() { + this._customInfo = undefined; + } + // Temporarily expose input value. Use with caution. + public get customInfoInput() { + return this._customInfo; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // product_id - computed: false, optional: false, required: true + private _productId?: string; + public get productId() { + return this.getStringAttribute('product_id'); + } + public set productId(value: string) { + this._productId = value; + } + // Temporarily expose input value. Use with caution. + public get productIdInput() { + return this._productId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // space_id - computed: false, optional: false, required: true + private _spaceId?: string; + public get spaceId() { + return this.getStringAttribute('space_id'); + } + public set spaceId(value: string) { + this._spaceId = value; + } + // Temporarily expose input value. Use with caution. + public get spaceIdInput() { + return this._spaceId; + } + + // support_source_versions - computed: false, optional: true, required: false + private _supportSourceVersions?: string[]; + public get supportSourceVersions() { + return this.getListAttribute('support_source_versions'); + } + public set supportSourceVersions(value: string[]) { + this._supportSourceVersions = value; + } + public resetSupportSourceVersions() { + this._supportSourceVersions = undefined; + } + // Temporarily expose input value. Use with caution. + public get supportSourceVersionsInput() { + return this._supportSourceVersions; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // file_location - computed: false, optional: false, required: true + private _fileLocation = new IotdaUpgradePackageFileLocationList(this, "file_location", false); + public get fileLocation() { + return this._fileLocation; + } + public putFileLocation(value: IotdaUpgradePackageFileLocation[] | cdktf.IResolvable) { + this._fileLocation.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get fileLocationInput() { + return this._fileLocation.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + custom_info: cdktf.stringToTerraform(this._customInfo), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + product_id: cdktf.stringToTerraform(this._productId), + region: cdktf.stringToTerraform(this._region), + space_id: cdktf.stringToTerraform(this._spaceId), + support_source_versions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._supportSourceVersions), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + file_location: cdktf.listMapper(iotdaUpgradePackageFileLocationToTerraform, true)(this._fileLocation.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + custom_info: { + value: cdktf.stringToHclTerraform(this._customInfo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_id: { + value: cdktf.stringToHclTerraform(this._productId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + space_id: { + value: cdktf.stringToHclTerraform(this._spaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + support_source_versions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._supportSourceVersions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_location: { + value: cdktf.listMapperHcl(iotdaUpgradePackageFileLocationToHclTerraform, true)(this._fileLocation.internalValue), + isBlock: true, + type: "list", + storageClassType: "IotdaUpgradePackageFileLocationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/README.md b/src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/README.md new file mode 100644 index 00000000..ba6f17fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kms_data_encrypt_decrypt` + +Refer to the Terraform Registry for docs: [`huaweicloud_kms_data_encrypt_decrypt`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt). diff --git a/src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/index.ts b/src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/index.ts new file mode 100644 index 00000000..cee4a761 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-data-encrypt-decrypt/index.ts @@ -0,0 +1,296 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KmsDataEncryptDecryptConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#action KmsDataEncryptDecrypt#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#cipher_text KmsDataEncryptDecrypt#cipher_text} + */ + readonly cipherText?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#encryption_algorithm KmsDataEncryptDecrypt#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#id KmsDataEncryptDecrypt#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#key_id KmsDataEncryptDecrypt#key_id} + */ + readonly keyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#plain_text KmsDataEncryptDecrypt#plain_text} + */ + readonly plainText?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#region KmsDataEncryptDecrypt#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt huaweicloud_kms_data_encrypt_decrypt} +*/ +export class KmsDataEncryptDecrypt extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_data_encrypt_decrypt"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KmsDataEncryptDecrypt resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KmsDataEncryptDecrypt to import + * @param importFromId The id of the existing KmsDataEncryptDecrypt that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KmsDataEncryptDecrypt to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_data_encrypt_decrypt", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_data_encrypt_decrypt huaweicloud_kms_data_encrypt_decrypt} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KmsDataEncryptDecryptConfig + */ + public constructor(scope: Construct, id: string, config: KmsDataEncryptDecryptConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_data_encrypt_decrypt', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._cipherText = config.cipherText; + this._encryptionAlgorithm = config.encryptionAlgorithm; + this._id = config.id; + this._keyId = config.keyId; + this._plainText = config.plainText; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // cipher_data - computed: true, optional: false, required: false + public get cipherData() { + return this.getStringAttribute('cipher_data'); + } + + // cipher_text - computed: false, optional: true, required: false + private _cipherText?: string; + public get cipherText() { + return this.getStringAttribute('cipher_text'); + } + public set cipherText(value: string) { + this._cipherText = value; + } + public resetCipherText() { + this._cipherText = undefined; + } + // Temporarily expose input value. Use with caution. + public get cipherTextInput() { + return this._cipherText; + } + + // encryption_algorithm - computed: false, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_id - computed: false, optional: true, required: false + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + public resetKeyId() { + this._keyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // plain_data - computed: true, optional: false, required: false + public get plainData() { + return this.getStringAttribute('plain_data'); + } + + // plain_text - computed: false, optional: true, required: false + private _plainText?: string; + public get plainText() { + return this.getStringAttribute('plain_text'); + } + public set plainText(value: string) { + this._plainText = value; + } + public resetPlainText() { + this._plainText = undefined; + } + // Temporarily expose input value. Use with caution. + public get plainTextInput() { + return this._plainText; + } + + // plain_text_base64 - computed: true, optional: false, required: false + public get plainTextBase64() { + return this.getStringAttribute('plain_text_base64'); + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + cipher_text: cdktf.stringToTerraform(this._cipherText), + encryption_algorithm: cdktf.stringToTerraform(this._encryptionAlgorithm), + id: cdktf.stringToTerraform(this._id), + key_id: cdktf.stringToTerraform(this._keyId), + plain_text: cdktf.stringToTerraform(this._plainText), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cipher_text: { + value: cdktf.stringToHclTerraform(this._cipherText), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(this._encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + plain_text: { + value: cdktf.stringToHclTerraform(this._plainText), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kms-dedicated-keystore/README.md b/src/constructs/providers/huaweicloud/kms-dedicated-keystore/README.md new file mode 100644 index 00000000..b1db9dfe --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-dedicated-keystore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kms_dedicated_keystore` + +Refer to the Terraform Registry for docs: [`huaweicloud_kms_dedicated_keystore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore). diff --git a/src/constructs/providers/huaweicloud/kms-dedicated-keystore/index.ts b/src/constructs/providers/huaweicloud/kms-dedicated-keystore/index.ts new file mode 100644 index 00000000..b69927bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-dedicated-keystore/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KmsDedicatedKeystoreConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the alias of a dedicated keystore. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore#alias KmsDedicatedKeystore#alias} + */ + readonly alias: string; + /** + * Specifies the CA certificate of the dedicated HSM cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore#hsm_ca_cert KmsDedicatedKeystore#hsm_ca_cert} + */ + readonly hsmCaCert: string; + /** + * Specifies the ID of a dedicated HSM cluster that has no dedicated keystore. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore#hsm_cluster_id KmsDedicatedKeystore#hsm_cluster_id} + */ + readonly hsmClusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore#id KmsDedicatedKeystore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore#region KmsDedicatedKeystore#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore huaweicloud_kms_dedicated_keystore} +*/ +export class KmsDedicatedKeystore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_dedicated_keystore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KmsDedicatedKeystore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KmsDedicatedKeystore to import + * @param importFromId The id of the existing KmsDedicatedKeystore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KmsDedicatedKeystore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_dedicated_keystore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_dedicated_keystore huaweicloud_kms_dedicated_keystore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KmsDedicatedKeystoreConfig + */ + public constructor(scope: Construct, id: string, config: KmsDedicatedKeystoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_dedicated_keystore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alias = config.alias; + this._hsmCaCert = config.hsmCaCert; + this._hsmClusterId = config.hsmClusterId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // alias - computed: false, optional: false, required: true + private _alias?: string; + public get alias() { + return this.getStringAttribute('alias'); + } + public set alias(value: string) { + this._alias = value; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // hsm_ca_cert - computed: false, optional: false, required: true + private _hsmCaCert?: string; + public get hsmCaCert() { + return this.getStringAttribute('hsm_ca_cert'); + } + public set hsmCaCert(value: string) { + this._hsmCaCert = value; + } + // Temporarily expose input value. Use with caution. + public get hsmCaCertInput() { + return this._hsmCaCert; + } + + // hsm_cluster_id - computed: false, optional: false, required: true + private _hsmClusterId?: string; + public get hsmClusterId() { + return this.getStringAttribute('hsm_cluster_id'); + } + public set hsmClusterId(value: string) { + this._hsmClusterId = value; + } + // Temporarily expose input value. Use with caution. + public get hsmClusterIdInput() { + return this._hsmClusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alias: cdktf.stringToTerraform(this._alias), + hsm_ca_cert: cdktf.stringToTerraform(this._hsmCaCert), + hsm_cluster_id: cdktf.stringToTerraform(this._hsmClusterId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alias: { + value: cdktf.stringToHclTerraform(this._alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hsm_ca_cert: { + value: cdktf.stringToHclTerraform(this._hsmCaCert), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hsm_cluster_id: { + value: cdktf.stringToHclTerraform(this._hsmClusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kms-grant/README.md b/src/constructs/providers/huaweicloud/kms-grant/README.md new file mode 100644 index 00000000..a037aad4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-grant/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kms_grant` + +Refer to the Terraform Registry for docs: [`huaweicloud_kms_grant`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant). diff --git a/src/constructs/providers/huaweicloud/kms-grant/index.ts b/src/constructs/providers/huaweicloud/kms-grant/index.ts new file mode 100644 index 00000000..f2e95ea4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-grant/index.ts @@ -0,0 +1,321 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KmsGrantConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the authorized user or account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#grantee_principal KmsGrant#grantee_principal} + */ + readonly granteePrincipal: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#id KmsGrant#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Key ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#key_id KmsGrant#key_id} + */ + readonly keyId: string; + /** + * Grant name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#name KmsGrant#name} + */ + readonly name?: string; + /** + * List of granted operations. + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#operations KmsGrant#operations} + */ + readonly operations: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#region KmsGrant#region} + */ + readonly region?: string; + /** + * The ID of the retiring user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#retiring_principal KmsGrant#retiring_principal} + */ + readonly retiringPrincipal?: string; + /** + * Authorization type. The options are: **user**, **domain**. The default value is **user**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#type KmsGrant#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant huaweicloud_kms_grant} +*/ +export class KmsGrant extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_grant"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KmsGrant resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KmsGrant to import + * @param importFromId The id of the existing KmsGrant that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KmsGrant to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_grant", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_grant huaweicloud_kms_grant} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KmsGrantConfig + */ + public constructor(scope: Construct, id: string, config: KmsGrantConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_grant', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._granteePrincipal = config.granteePrincipal; + this._id = config.id; + this._keyId = config.keyId; + this._name = config.name; + this._operations = config.operations; + this._region = config.region; + this._retiringPrincipal = config.retiringPrincipal; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // grantee_principal - computed: false, optional: false, required: true + private _granteePrincipal?: string; + public get granteePrincipal() { + return this.getStringAttribute('grantee_principal'); + } + public set granteePrincipal(value: string) { + this._granteePrincipal = value; + } + // Temporarily expose input value. Use with caution. + public get granteePrincipalInput() { + return this._granteePrincipal; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key_id - computed: false, optional: false, required: true + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operations - computed: false, optional: false, required: true + private _operations?: string[]; + public get operations() { + return cdktf.Fn.tolist(this.getListAttribute('operations')); + } + public set operations(value: string[]) { + this._operations = value; + } + // Temporarily expose input value. Use with caution. + public get operationsInput() { + return this._operations; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retiring_principal - computed: true, optional: true, required: false + private _retiringPrincipal?: string; + public get retiringPrincipal() { + return this.getStringAttribute('retiring_principal'); + } + public set retiringPrincipal(value: string) { + this._retiringPrincipal = value; + } + public resetRetiringPrincipal() { + this._retiringPrincipal = undefined; + } + // Temporarily expose input value. Use with caution. + public get retiringPrincipalInput() { + return this._retiringPrincipal; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + grantee_principal: cdktf.stringToTerraform(this._granteePrincipal), + id: cdktf.stringToTerraform(this._id), + key_id: cdktf.stringToTerraform(this._keyId), + name: cdktf.stringToTerraform(this._name), + operations: cdktf.listMapper(cdktf.stringToTerraform, false)(this._operations), + region: cdktf.stringToTerraform(this._region), + retiring_principal: cdktf.stringToTerraform(this._retiringPrincipal), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + grantee_principal: { + value: cdktf.stringToHclTerraform(this._granteePrincipal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operations: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._operations), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retiring_principal: { + value: cdktf.stringToHclTerraform(this._retiringPrincipal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kms-key-material/README.md b/src/constructs/providers/huaweicloud/kms-key-material/README.md new file mode 100644 index 00000000..caa83ed7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-key-material/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kms_key_material` + +Refer to the Terraform Registry for docs: [`huaweicloud_kms_key_material`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material). diff --git a/src/constructs/providers/huaweicloud/kms-key-material/index.ts b/src/constructs/providers/huaweicloud/kms-key-material/index.ts new file mode 100644 index 00000000..73eba468 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-key-material/index.ts @@ -0,0 +1,285 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KmsKeyMaterialConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#encrypted_key_material KmsKeyMaterial#encrypted_key_material} + */ + readonly encryptedKeyMaterial: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#encrypted_privatekey KmsKeyMaterial#encrypted_privatekey} + */ + readonly encryptedPrivatekey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#expiration_time KmsKeyMaterial#expiration_time} + */ + readonly expirationTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#id KmsKeyMaterial#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#import_token KmsKeyMaterial#import_token} + */ + readonly importToken: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#key_id KmsKeyMaterial#key_id} + */ + readonly keyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#region KmsKeyMaterial#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material huaweicloud_kms_key_material} +*/ +export class KmsKeyMaterial extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_key_material"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KmsKeyMaterial resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KmsKeyMaterial to import + * @param importFromId The id of the existing KmsKeyMaterial that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KmsKeyMaterial to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_key_material", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_material huaweicloud_kms_key_material} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KmsKeyMaterialConfig + */ + public constructor(scope: Construct, id: string, config: KmsKeyMaterialConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_key_material', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._encryptedKeyMaterial = config.encryptedKeyMaterial; + this._encryptedPrivatekey = config.encryptedPrivatekey; + this._expirationTime = config.expirationTime; + this._id = config.id; + this._importToken = config.importToken; + this._keyId = config.keyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // encrypted_key_material - computed: false, optional: false, required: true + private _encryptedKeyMaterial?: string; + public get encryptedKeyMaterial() { + return this.getStringAttribute('encrypted_key_material'); + } + public set encryptedKeyMaterial(value: string) { + this._encryptedKeyMaterial = value; + } + // Temporarily expose input value. Use with caution. + public get encryptedKeyMaterialInput() { + return this._encryptedKeyMaterial; + } + + // encrypted_privatekey - computed: false, optional: true, required: false + private _encryptedPrivatekey?: string; + public get encryptedPrivatekey() { + return this.getStringAttribute('encrypted_privatekey'); + } + public set encryptedPrivatekey(value: string) { + this._encryptedPrivatekey = value; + } + public resetEncryptedPrivatekey() { + this._encryptedPrivatekey = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptedPrivatekeyInput() { + return this._encryptedPrivatekey; + } + + // expiration_time - computed: true, optional: true, required: false + private _expirationTime?: string; + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + public set expirationTime(value: string) { + this._expirationTime = value; + } + public resetExpirationTime() { + this._expirationTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get expirationTimeInput() { + return this._expirationTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // import_token - computed: false, optional: false, required: true + private _importToken?: string; + public get importToken() { + return this.getStringAttribute('import_token'); + } + public set importToken(value: string) { + this._importToken = value; + } + // Temporarily expose input value. Use with caution. + public get importTokenInput() { + return this._importToken; + } + + // key_id - computed: false, optional: false, required: true + private _keyId?: string; + public get keyId() { + return this.getStringAttribute('key_id'); + } + public set keyId(value: string) { + this._keyId = value; + } + // Temporarily expose input value. Use with caution. + public get keyIdInput() { + return this._keyId; + } + + // key_state - computed: true, optional: false, required: false + public get keyState() { + return this.getStringAttribute('key_state'); + } + + // key_usage - computed: true, optional: false, required: false + public get keyUsage() { + return this.getStringAttribute('key_usage'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + encrypted_key_material: cdktf.stringToTerraform(this._encryptedKeyMaterial), + encrypted_privatekey: cdktf.stringToTerraform(this._encryptedPrivatekey), + expiration_time: cdktf.stringToTerraform(this._expirationTime), + id: cdktf.stringToTerraform(this._id), + import_token: cdktf.stringToTerraform(this._importToken), + key_id: cdktf.stringToTerraform(this._keyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + encrypted_key_material: { + value: cdktf.stringToHclTerraform(this._encryptedKeyMaterial), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encrypted_privatekey: { + value: cdktf.stringToHclTerraform(this._encryptedPrivatekey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expiration_time: { + value: cdktf.stringToHclTerraform(this._expirationTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + import_token: { + value: cdktf.stringToHclTerraform(this._importToken), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_id: { + value: cdktf.stringToHclTerraform(this._keyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kms-key-v1/README.md b/src/constructs/providers/huaweicloud/kms-key-v1/README.md new file mode 100644 index 00000000..40f096e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-key-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kms_key_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_kms_key_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1). diff --git a/src/constructs/providers/huaweicloud/kms-key-v1/index.ts b/src/constructs/providers/huaweicloud/kms-key-v1/index.ts new file mode 100644 index 00000000..fe2ecd11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-key-v1/index.ts @@ -0,0 +1,517 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KmsKeyV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#enterprise_project_id KmsKeyV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#id KmsKeyV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#is_enabled KmsKeyV1#is_enabled} + */ + readonly isEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#key_algorithm KmsKeyV1#key_algorithm} + */ + readonly keyAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#key_alias KmsKeyV1#key_alias} + */ + readonly keyAlias: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#key_description KmsKeyV1#key_description} + */ + readonly keyDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#key_usage KmsKeyV1#key_usage} + */ + readonly keyUsage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#keystore_id KmsKeyV1#keystore_id} + */ + readonly keystoreId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#origin KmsKeyV1#origin} + */ + readonly origin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#pending_days KmsKeyV1#pending_days} + */ + readonly pendingDays?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#region KmsKeyV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#rotation_enabled KmsKeyV1#rotation_enabled} + */ + readonly rotationEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#rotation_interval KmsKeyV1#rotation_interval} + */ + readonly rotationInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#tags KmsKeyV1#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1 huaweicloud_kms_key_v1} +*/ +export class KmsKeyV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_key_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KmsKeyV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KmsKeyV1 to import + * @param importFromId The id of the existing KmsKeyV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KmsKeyV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_key_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key_v1 huaweicloud_kms_key_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KmsKeyV1Config + */ + public constructor(scope: Construct, id: string, config: KmsKeyV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_key_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isEnabled = config.isEnabled; + this._keyAlgorithm = config.keyAlgorithm; + this._keyAlias = config.keyAlias; + this._keyDescription = config.keyDescription; + this._keyUsage = config.keyUsage; + this._keystoreId = config.keystoreId; + this._origin = config.origin; + this._pendingDays = config.pendingDays; + this._region = config.region; + this._rotationEnabled = config.rotationEnabled; + this._rotationInterval = config.rotationInterval; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // creation_date - computed: true, optional: false, required: false + public get creationDate() { + return this.getStringAttribute('creation_date'); + } + + // default_key_flag - computed: true, optional: false, required: false + public get defaultKeyFlag() { + return this.getStringAttribute('default_key_flag'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_enabled - computed: false, optional: true, required: false + private _isEnabled?: boolean | cdktf.IResolvable; + public get isEnabled() { + return this.getBooleanAttribute('is_enabled'); + } + public set isEnabled(value: boolean | cdktf.IResolvable) { + this._isEnabled = value; + } + public resetIsEnabled() { + this._isEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get isEnabledInput() { + return this._isEnabled; + } + + // key_algorithm - computed: true, optional: true, required: false + private _keyAlgorithm?: string; + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + public set keyAlgorithm(value: string) { + this._keyAlgorithm = value; + } + public resetKeyAlgorithm() { + this._keyAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyAlgorithmInput() { + return this._keyAlgorithm; + } + + // key_alias - computed: false, optional: false, required: true + private _keyAlias?: string; + public get keyAlias() { + return this.getStringAttribute('key_alias'); + } + public set keyAlias(value: string) { + this._keyAlias = value; + } + // Temporarily expose input value. Use with caution. + public get keyAliasInput() { + return this._keyAlias; + } + + // key_description - computed: false, optional: true, required: false + private _keyDescription?: string; + public get keyDescription() { + return this.getStringAttribute('key_description'); + } + public set keyDescription(value: string) { + this._keyDescription = value; + } + public resetKeyDescription() { + this._keyDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyDescriptionInput() { + return this._keyDescription; + } + + // key_id - computed: true, optional: false, required: false + public get keyId() { + return this.getStringAttribute('key_id'); + } + + // key_state - computed: true, optional: false, required: false + public get keyState() { + return this.getStringAttribute('key_state'); + } + + // key_usage - computed: true, optional: true, required: false + private _keyUsage?: string; + public get keyUsage() { + return this.getStringAttribute('key_usage'); + } + public set keyUsage(value: string) { + this._keyUsage = value; + } + public resetKeyUsage() { + this._keyUsage = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyUsageInput() { + return this._keyUsage; + } + + // keystore_id - computed: true, optional: true, required: false + private _keystoreId?: string; + public get keystoreId() { + return this.getStringAttribute('keystore_id'); + } + public set keystoreId(value: string) { + this._keystoreId = value; + } + public resetKeystoreId() { + this._keystoreId = undefined; + } + // Temporarily expose input value. Use with caution. + public get keystoreIdInput() { + return this._keystoreId; + } + + // origin - computed: true, optional: true, required: false + private _origin?: string; + public get origin() { + return this.getStringAttribute('origin'); + } + public set origin(value: string) { + this._origin = value; + } + public resetOrigin() { + this._origin = undefined; + } + // Temporarily expose input value. Use with caution. + public get originInput() { + return this._origin; + } + + // pending_days - computed: false, optional: true, required: false + private _pendingDays?: string; + public get pendingDays() { + return this.getStringAttribute('pending_days'); + } + public set pendingDays(value: string) { + this._pendingDays = value; + } + public resetPendingDays() { + this._pendingDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get pendingDaysInput() { + return this._pendingDays; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rotation_enabled - computed: false, optional: true, required: false + private _rotationEnabled?: boolean | cdktf.IResolvable; + public get rotationEnabled() { + return this.getBooleanAttribute('rotation_enabled'); + } + public set rotationEnabled(value: boolean | cdktf.IResolvable) { + this._rotationEnabled = value; + } + public resetRotationEnabled() { + this._rotationEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get rotationEnabledInput() { + return this._rotationEnabled; + } + + // rotation_interval - computed: true, optional: true, required: false + private _rotationInterval?: number; + public get rotationInterval() { + return this.getNumberAttribute('rotation_interval'); + } + public set rotationInterval(value: number) { + this._rotationInterval = value; + } + public resetRotationInterval() { + this._rotationInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get rotationIntervalInput() { + return this._rotationInterval; + } + + // rotation_number - computed: true, optional: false, required: false + public get rotationNumber() { + return this.getNumberAttribute('rotation_number'); + } + + // scheduled_deletion_date - computed: true, optional: false, required: false + public get scheduledDeletionDate() { + return this.getStringAttribute('scheduled_deletion_date'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_enabled: cdktf.booleanToTerraform(this._isEnabled), + key_algorithm: cdktf.stringToTerraform(this._keyAlgorithm), + key_alias: cdktf.stringToTerraform(this._keyAlias), + key_description: cdktf.stringToTerraform(this._keyDescription), + key_usage: cdktf.stringToTerraform(this._keyUsage), + keystore_id: cdktf.stringToTerraform(this._keystoreId), + origin: cdktf.stringToTerraform(this._origin), + pending_days: cdktf.stringToTerraform(this._pendingDays), + region: cdktf.stringToTerraform(this._region), + rotation_enabled: cdktf.booleanToTerraform(this._rotationEnabled), + rotation_interval: cdktf.numberToTerraform(this._rotationInterval), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_enabled: { + value: cdktf.booleanToHclTerraform(this._isEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + key_algorithm: { + value: cdktf.stringToHclTerraform(this._keyAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_alias: { + value: cdktf.stringToHclTerraform(this._keyAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_description: { + value: cdktf.stringToHclTerraform(this._keyDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_usage: { + value: cdktf.stringToHclTerraform(this._keyUsage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keystore_id: { + value: cdktf.stringToHclTerraform(this._keystoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin: { + value: cdktf.stringToHclTerraform(this._origin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pending_days: { + value: cdktf.stringToHclTerraform(this._pendingDays), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rotation_enabled: { + value: cdktf.booleanToHclTerraform(this._rotationEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + rotation_interval: { + value: cdktf.numberToHclTerraform(this._rotationInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kms-key/README.md b/src/constructs/providers/huaweicloud/kms-key/README.md new file mode 100644 index 00000000..886c3a31 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-key/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kms_key` + +Refer to the Terraform Registry for docs: [`huaweicloud_kms_key`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key). diff --git a/src/constructs/providers/huaweicloud/kms-key/index.ts b/src/constructs/providers/huaweicloud/kms-key/index.ts new file mode 100644 index 00000000..f00a2015 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kms-key/index.ts @@ -0,0 +1,517 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KmsKeyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#enterprise_project_id KmsKey#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#id KmsKey#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#is_enabled KmsKey#is_enabled} + */ + readonly isEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#key_algorithm KmsKey#key_algorithm} + */ + readonly keyAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#key_alias KmsKey#key_alias} + */ + readonly keyAlias: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#key_description KmsKey#key_description} + */ + readonly keyDescription?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#key_usage KmsKey#key_usage} + */ + readonly keyUsage?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#keystore_id KmsKey#keystore_id} + */ + readonly keystoreId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#origin KmsKey#origin} + */ + readonly origin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#pending_days KmsKey#pending_days} + */ + readonly pendingDays?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#region KmsKey#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#rotation_enabled KmsKey#rotation_enabled} + */ + readonly rotationEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#rotation_interval KmsKey#rotation_interval} + */ + readonly rotationInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#tags KmsKey#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key huaweicloud_kms_key} +*/ +export class KmsKey extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kms_key"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KmsKey resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KmsKey to import + * @param importFromId The id of the existing KmsKey that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KmsKey to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kms_key", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kms_key huaweicloud_kms_key} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KmsKeyConfig + */ + public constructor(scope: Construct, id: string, config: KmsKeyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kms_key', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isEnabled = config.isEnabled; + this._keyAlgorithm = config.keyAlgorithm; + this._keyAlias = config.keyAlias; + this._keyDescription = config.keyDescription; + this._keyUsage = config.keyUsage; + this._keystoreId = config.keystoreId; + this._origin = config.origin; + this._pendingDays = config.pendingDays; + this._region = config.region; + this._rotationEnabled = config.rotationEnabled; + this._rotationInterval = config.rotationInterval; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // creation_date - computed: true, optional: false, required: false + public get creationDate() { + return this.getStringAttribute('creation_date'); + } + + // default_key_flag - computed: true, optional: false, required: false + public get defaultKeyFlag() { + return this.getStringAttribute('default_key_flag'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_enabled - computed: false, optional: true, required: false + private _isEnabled?: boolean | cdktf.IResolvable; + public get isEnabled() { + return this.getBooleanAttribute('is_enabled'); + } + public set isEnabled(value: boolean | cdktf.IResolvable) { + this._isEnabled = value; + } + public resetIsEnabled() { + this._isEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get isEnabledInput() { + return this._isEnabled; + } + + // key_algorithm - computed: true, optional: true, required: false + private _keyAlgorithm?: string; + public get keyAlgorithm() { + return this.getStringAttribute('key_algorithm'); + } + public set keyAlgorithm(value: string) { + this._keyAlgorithm = value; + } + public resetKeyAlgorithm() { + this._keyAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyAlgorithmInput() { + return this._keyAlgorithm; + } + + // key_alias - computed: false, optional: false, required: true + private _keyAlias?: string; + public get keyAlias() { + return this.getStringAttribute('key_alias'); + } + public set keyAlias(value: string) { + this._keyAlias = value; + } + // Temporarily expose input value. Use with caution. + public get keyAliasInput() { + return this._keyAlias; + } + + // key_description - computed: false, optional: true, required: false + private _keyDescription?: string; + public get keyDescription() { + return this.getStringAttribute('key_description'); + } + public set keyDescription(value: string) { + this._keyDescription = value; + } + public resetKeyDescription() { + this._keyDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyDescriptionInput() { + return this._keyDescription; + } + + // key_id - computed: true, optional: false, required: false + public get keyId() { + return this.getStringAttribute('key_id'); + } + + // key_state - computed: true, optional: false, required: false + public get keyState() { + return this.getStringAttribute('key_state'); + } + + // key_usage - computed: true, optional: true, required: false + private _keyUsage?: string; + public get keyUsage() { + return this.getStringAttribute('key_usage'); + } + public set keyUsage(value: string) { + this._keyUsage = value; + } + public resetKeyUsage() { + this._keyUsage = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyUsageInput() { + return this._keyUsage; + } + + // keystore_id - computed: true, optional: true, required: false + private _keystoreId?: string; + public get keystoreId() { + return this.getStringAttribute('keystore_id'); + } + public set keystoreId(value: string) { + this._keystoreId = value; + } + public resetKeystoreId() { + this._keystoreId = undefined; + } + // Temporarily expose input value. Use with caution. + public get keystoreIdInput() { + return this._keystoreId; + } + + // origin - computed: true, optional: true, required: false + private _origin?: string; + public get origin() { + return this.getStringAttribute('origin'); + } + public set origin(value: string) { + this._origin = value; + } + public resetOrigin() { + this._origin = undefined; + } + // Temporarily expose input value. Use with caution. + public get originInput() { + return this._origin; + } + + // pending_days - computed: false, optional: true, required: false + private _pendingDays?: string; + public get pendingDays() { + return this.getStringAttribute('pending_days'); + } + public set pendingDays(value: string) { + this._pendingDays = value; + } + public resetPendingDays() { + this._pendingDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get pendingDaysInput() { + return this._pendingDays; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rotation_enabled - computed: false, optional: true, required: false + private _rotationEnabled?: boolean | cdktf.IResolvable; + public get rotationEnabled() { + return this.getBooleanAttribute('rotation_enabled'); + } + public set rotationEnabled(value: boolean | cdktf.IResolvable) { + this._rotationEnabled = value; + } + public resetRotationEnabled() { + this._rotationEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get rotationEnabledInput() { + return this._rotationEnabled; + } + + // rotation_interval - computed: true, optional: true, required: false + private _rotationInterval?: number; + public get rotationInterval() { + return this.getNumberAttribute('rotation_interval'); + } + public set rotationInterval(value: number) { + this._rotationInterval = value; + } + public resetRotationInterval() { + this._rotationInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get rotationIntervalInput() { + return this._rotationInterval; + } + + // rotation_number - computed: true, optional: false, required: false + public get rotationNumber() { + return this.getNumberAttribute('rotation_number'); + } + + // scheduled_deletion_date - computed: true, optional: false, required: false + public get scheduledDeletionDate() { + return this.getStringAttribute('scheduled_deletion_date'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_enabled: cdktf.booleanToTerraform(this._isEnabled), + key_algorithm: cdktf.stringToTerraform(this._keyAlgorithm), + key_alias: cdktf.stringToTerraform(this._keyAlias), + key_description: cdktf.stringToTerraform(this._keyDescription), + key_usage: cdktf.stringToTerraform(this._keyUsage), + keystore_id: cdktf.stringToTerraform(this._keystoreId), + origin: cdktf.stringToTerraform(this._origin), + pending_days: cdktf.stringToTerraform(this._pendingDays), + region: cdktf.stringToTerraform(this._region), + rotation_enabled: cdktf.booleanToTerraform(this._rotationEnabled), + rotation_interval: cdktf.numberToTerraform(this._rotationInterval), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_enabled: { + value: cdktf.booleanToHclTerraform(this._isEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + key_algorithm: { + value: cdktf.stringToHclTerraform(this._keyAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_alias: { + value: cdktf.stringToHclTerraform(this._keyAlias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_description: { + value: cdktf.stringToHclTerraform(this._keyDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_usage: { + value: cdktf.stringToHclTerraform(this._keyUsage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keystore_id: { + value: cdktf.stringToHclTerraform(this._keystoreId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + origin: { + value: cdktf.stringToHclTerraform(this._origin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pending_days: { + value: cdktf.stringToHclTerraform(this._pendingDays), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rotation_enabled: { + value: cdktf.booleanToHclTerraform(this._rotationEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + rotation_interval: { + value: cdktf.numberToHclTerraform(this._rotationInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/kps-keypair/README.md b/src/constructs/providers/huaweicloud/kps-keypair/README.md new file mode 100644 index 00000000..a42a4fb6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kps-keypair/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_kps_keypair` + +Refer to the Terraform Registry for docs: [`huaweicloud_kps_keypair`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair). diff --git a/src/constructs/providers/huaweicloud/kps-keypair/index.ts b/src/constructs/providers/huaweicloud/kps-keypair/index.ts new file mode 100644 index 00000000..151ef6a8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/kps-keypair/index.ts @@ -0,0 +1,626 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface KpsKeypairConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#description KpsKeypair#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#encryption_type KpsKeypair#encryption_type} + */ + readonly encryptionType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#id KpsKeypair#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#key_file KpsKeypair#key_file} + */ + readonly keyFile?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#kms_key_id KpsKeypair#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#kms_key_name KpsKeypair#kms_key_name} + */ + readonly kmsKeyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#name KpsKeypair#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#private_key KpsKeypair#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#public_key KpsKeypair#public_key} + */ + readonly publicKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#region KpsKeypair#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#scope KpsKeypair#scope} + */ + readonly scope?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#user_id KpsKeypair#user_id} + */ + readonly userId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#timeouts KpsKeypair#timeouts} + */ + readonly timeouts?: KpsKeypairTimeouts; +} +export interface KpsKeypairTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#create KpsKeypair#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#delete KpsKeypair#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#update KpsKeypair#update} + */ + readonly update?: string; +} + +export function kpsKeypairTimeoutsToTerraform(struct?: KpsKeypairTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function kpsKeypairTimeoutsToHclTerraform(struct?: KpsKeypairTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class KpsKeypairTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): KpsKeypairTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: KpsKeypairTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair huaweicloud_kps_keypair} +*/ +export class KpsKeypair extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_kps_keypair"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a KpsKeypair resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the KpsKeypair to import + * @param importFromId The id of the existing KpsKeypair that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the KpsKeypair to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_kps_keypair", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/kps_keypair huaweicloud_kps_keypair} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options KpsKeypairConfig + */ + public constructor(scope: Construct, id: string, config: KpsKeypairConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_kps_keypair', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._encryptionType = config.encryptionType; + this._id = config.id; + this._keyFile = config.keyFile; + this._kmsKeyId = config.kmsKeyId; + this._kmsKeyName = config.kmsKeyName; + this._name = config.name; + this._privateKey = config.privateKey; + this._publicKey = config.publicKey; + this._region = config.region; + this._scope = config.scope; + this._userId = config.userId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encryption_type - computed: true, optional: true, required: false + private _encryptionType?: string; + public get encryptionType() { + return this.getStringAttribute('encryption_type'); + } + public set encryptionType(value: string) { + this._encryptionType = value; + } + public resetEncryptionType() { + this._encryptionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionTypeInput() { + return this._encryptionType; + } + + // fingerprint - computed: true, optional: false, required: false + public get fingerprint() { + return this.getStringAttribute('fingerprint'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_managed - computed: true, optional: false, required: false + public get isManaged() { + return this.getBooleanAttribute('is_managed'); + } + + // key_file - computed: true, optional: true, required: false + private _keyFile?: string; + public get keyFile() { + return this.getStringAttribute('key_file'); + } + public set keyFile(value: string) { + this._keyFile = value; + } + public resetKeyFile() { + this._keyFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyFileInput() { + return this._keyFile; + } + + // kms_key_id - computed: false, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // kms_key_name - computed: false, optional: true, required: false + private _kmsKeyName?: string; + public get kmsKeyName() { + return this.getStringAttribute('kms_key_name'); + } + public set kmsKeyName(value: string) { + this._kmsKeyName = value; + } + public resetKmsKeyName() { + this._kmsKeyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyNameInput() { + return this._kmsKeyName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // public_key - computed: true, optional: true, required: false + private _publicKey?: string; + public get publicKey() { + return this.getStringAttribute('public_key'); + } + public set publicKey(value: string) { + this._publicKey = value; + } + public resetPublicKey() { + this._publicKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicKeyInput() { + return this._publicKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // scope - computed: true, optional: true, required: false + private _scope?: string; + public get scope() { + return this.getStringAttribute('scope'); + } + public set scope(value: string) { + this._scope = value; + } + public resetScope() { + this._scope = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeInput() { + return this._scope; + } + + // user_id - computed: true, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new KpsKeypairTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: KpsKeypairTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + encryption_type: cdktf.stringToTerraform(this._encryptionType), + id: cdktf.stringToTerraform(this._id), + key_file: cdktf.stringToTerraform(this._keyFile), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + kms_key_name: cdktf.stringToTerraform(this._kmsKeyName), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + public_key: cdktf.stringToTerraform(this._publicKey), + region: cdktf.stringToTerraform(this._region), + scope: cdktf.stringToTerraform(this._scope), + user_id: cdktf.stringToTerraform(this._userId), + timeouts: kpsKeypairTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_type: { + value: cdktf.stringToHclTerraform(this._encryptionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_file: { + value: cdktf.stringToHclTerraform(this._keyFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_name: { + value: cdktf.stringToHclTerraform(this._kmsKeyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_key: { + value: cdktf.stringToHclTerraform(this._publicKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scope: { + value: cdktf.stringToHclTerraform(this._scope), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: kpsKeypairTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "KpsKeypairTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lazy-index.ts b/src/constructs/providers/huaweicloud/lazy-index.ts new file mode 100644 index 00000000..068dc429 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lazy-index.ts @@ -0,0 +1,1697 @@ +// generated by cdktf get +Object.defineProperty(exports, 'aadForwardRule', { get: function () { return require('./aad-forward-rule'); } }); +Object.defineProperty(exports, 'accessAnalyzer', { get: function () { return require('./access-analyzer'); } }); +Object.defineProperty(exports, 'accessAnalyzerArchiveRule', { get: function () { return require('./access-analyzer-archive-rule'); } }); +Object.defineProperty(exports, 'antiddosBasic', { get: function () { return require('./antiddos-basic'); } }); +Object.defineProperty(exports, 'antiddosDefaultProtectionPolicy', { get: function () { return require('./antiddos-default-protection-policy'); } }); +Object.defineProperty(exports, 'aomAlarmActionRule', { get: function () { return require('./aom-alarm-action-rule'); } }); +Object.defineProperty(exports, 'aomAlarmGroupRule', { get: function () { return require('./aom-alarm-group-rule'); } }); +Object.defineProperty(exports, 'aomAlarmPolicy', { get: function () { return require('./aom-alarm-policy'); } }); +Object.defineProperty(exports, 'aomAlarmRule', { get: function () { return require('./aom-alarm-rule'); } }); +Object.defineProperty(exports, 'aomAlarmRulesTemplate', { get: function () { return require('./aom-alarm-rules-template'); } }); +Object.defineProperty(exports, 'aomAlarmSilenceRule', { get: function () { return require('./aom-alarm-silence-rule'); } }); +Object.defineProperty(exports, 'aomApplication', { get: function () { return require('./aom-application'); } }); +Object.defineProperty(exports, 'aomCloudServiceAccess', { get: function () { return require('./aom-cloud-service-access'); } }); +Object.defineProperty(exports, 'aomCmdbApplication', { get: function () { return require('./aom-cmdb-application'); } }); +Object.defineProperty(exports, 'aomCmdbComponent', { get: function () { return require('./aom-cmdb-component'); } }); +Object.defineProperty(exports, 'aomCmdbEnvironment', { get: function () { return require('./aom-cmdb-environment'); } }); +Object.defineProperty(exports, 'aomCmdbResourceRelationships', { get: function () { return require('./aom-cmdb-resource-relationships'); } }); +Object.defineProperty(exports, 'aomComponent', { get: function () { return require('./aom-component'); } }); +Object.defineProperty(exports, 'aomDashboard', { get: function () { return require('./aom-dashboard'); } }); +Object.defineProperty(exports, 'aomDashboardsFolder', { get: function () { return require('./aom-dashboards-folder'); } }); +Object.defineProperty(exports, 'aomEnvironment', { get: function () { return require('./aom-environment'); } }); +Object.defineProperty(exports, 'aomEventAlarmRule', { get: function () { return require('./aom-event-alarm-rule'); } }); +Object.defineProperty(exports, 'aomMessageTemplate', { get: function () { return require('./aom-message-template'); } }); +Object.defineProperty(exports, 'aomMultiAccountAggregationRule', { get: function () { return require('./aom-multi-account-aggregation-rule'); } }); +Object.defineProperty(exports, 'aomPromInstance', { get: function () { return require('./aom-prom-instance'); } }); +Object.defineProperty(exports, 'aomPrometheusInstance', { get: function () { return require('./aom-prometheus-instance'); } }); +Object.defineProperty(exports, 'aomServiceDiscoveryRule', { get: function () { return require('./aom-service-discovery-rule'); } }); +Object.defineProperty(exports, 'aomv4AlarmRule', { get: function () { return require('./aomv4-alarm-rule'); } }); +Object.defineProperty(exports, 'apiGatewayApi', { get: function () { return require('./api-gateway-api'); } }); +Object.defineProperty(exports, 'apiGatewayEnvironment', { get: function () { return require('./api-gateway-environment'); } }); +Object.defineProperty(exports, 'apiGatewayGroup', { get: function () { return require('./api-gateway-group'); } }); +Object.defineProperty(exports, 'apigAclPolicy', { get: function () { return require('./apig-acl-policy'); } }); +Object.defineProperty(exports, 'apigAclPolicyAssociate', { get: function () { return require('./apig-acl-policy-associate'); } }); +Object.defineProperty(exports, 'apigApi', { get: function () { return require('./apig-api'); } }); +Object.defineProperty(exports, 'apigApiPublishment', { get: function () { return require('./apig-api-publishment'); } }); +Object.defineProperty(exports, 'apigAppcode', { get: function () { return require('./apig-appcode'); } }); +Object.defineProperty(exports, 'apigApplication', { get: function () { return require('./apig-application'); } }); +Object.defineProperty(exports, 'apigApplicationAcl', { get: function () { return require('./apig-application-acl'); } }); +Object.defineProperty(exports, 'apigApplicationAuthorization', { get: function () { return require('./apig-application-authorization'); } }); +Object.defineProperty(exports, 'apigApplicationQuota', { get: function () { return require('./apig-application-quota'); } }); +Object.defineProperty(exports, 'apigApplicationQuotaAssociate', { get: function () { return require('./apig-application-quota-associate'); } }); +Object.defineProperty(exports, 'apigCertificate', { get: function () { return require('./apig-certificate'); } }); +Object.defineProperty(exports, 'apigChannel', { get: function () { return require('./apig-channel'); } }); +Object.defineProperty(exports, 'apigCustomAuthorizer', { get: function () { return require('./apig-custom-authorizer'); } }); +Object.defineProperty(exports, 'apigEndpointConnectionManagement', { get: function () { return require('./apig-endpoint-connection-management'); } }); +Object.defineProperty(exports, 'apigEndpointWhitelist', { get: function () { return require('./apig-endpoint-whitelist'); } }); +Object.defineProperty(exports, 'apigEnvironment', { get: function () { return require('./apig-environment'); } }); +Object.defineProperty(exports, 'apigEnvironmentVariable', { get: function () { return require('./apig-environment-variable'); } }); +Object.defineProperty(exports, 'apigGroup', { get: function () { return require('./apig-group'); } }); +Object.defineProperty(exports, 'apigInstance', { get: function () { return require('./apig-instance'); } }); +Object.defineProperty(exports, 'apigInstanceFeature', { get: function () { return require('./apig-instance-feature'); } }); +Object.defineProperty(exports, 'apigInstanceRoutes', { get: function () { return require('./apig-instance-routes'); } }); +Object.defineProperty(exports, 'apigPlugin', { get: function () { return require('./apig-plugin'); } }); +Object.defineProperty(exports, 'apigPluginAssociate', { get: function () { return require('./apig-plugin-associate'); } }); +Object.defineProperty(exports, 'apigResponse', { get: function () { return require('./apig-response'); } }); +Object.defineProperty(exports, 'apigSignature', { get: function () { return require('./apig-signature'); } }); +Object.defineProperty(exports, 'apigSignatureAssociate', { get: function () { return require('./apig-signature-associate'); } }); +Object.defineProperty(exports, 'apigThrottlingPolicy', { get: function () { return require('./apig-throttling-policy'); } }); +Object.defineProperty(exports, 'apigThrottlingPolicyAssociate', { get: function () { return require('./apig-throttling-policy-associate'); } }); +Object.defineProperty(exports, 'apigVpcChannel', { get: function () { return require('./apig-vpc-channel'); } }); +Object.defineProperty(exports, 'apmAksk', { get: function () { return require('./apm-aksk'); } }); +Object.defineProperty(exports, 'asBandwidthPolicy', { get: function () { return require('./as-bandwidth-policy'); } }); +Object.defineProperty(exports, 'asConfiguration', { get: function () { return require('./as-configuration'); } }); +Object.defineProperty(exports, 'asConfigurationV1', { get: function () { return require('./as-configuration-v1'); } }); +Object.defineProperty(exports, 'asGroup', { get: function () { return require('./as-group'); } }); +Object.defineProperty(exports, 'asGroupV1', { get: function () { return require('./as-group-v1'); } }); +Object.defineProperty(exports, 'asInstanceAttach', { get: function () { return require('./as-instance-attach'); } }); +Object.defineProperty(exports, 'asLifecycleHook', { get: function () { return require('./as-lifecycle-hook'); } }); +Object.defineProperty(exports, 'asLifecycleHookCallback', { get: function () { return require('./as-lifecycle-hook-callback'); } }); +Object.defineProperty(exports, 'asNotification', { get: function () { return require('./as-notification'); } }); +Object.defineProperty(exports, 'asPlannedTask', { get: function () { return require('./as-planned-task'); } }); +Object.defineProperty(exports, 'asPolicy', { get: function () { return require('./as-policy'); } }); +Object.defineProperty(exports, 'asPolicyV1', { get: function () { return require('./as-policy-v1'); } }); +Object.defineProperty(exports, 'asmMesh', { get: function () { return require('./asm-mesh'); } }); +Object.defineProperty(exports, 'bcsInstance', { get: function () { return require('./bcs-instance'); } }); +Object.defineProperty(exports, 'blockstorageVolumeV2', { get: function () { return require('./blockstorage-volume-v2'); } }); +Object.defineProperty(exports, 'bmsInstance', { get: function () { return require('./bms-instance'); } }); +Object.defineProperty(exports, 'caeComponent', { get: function () { return require('./cae-component'); } }); +Object.defineProperty(exports, 'caeComponentConfigurations', { get: function () { return require('./cae-component-configurations'); } }); +Object.defineProperty(exports, 'caeComponentDeployment', { get: function () { return require('./cae-component-deployment'); } }); +Object.defineProperty(exports, 'cbhAssetAgencyAuthorization', { get: function () { return require('./cbh-asset-agency-authorization'); } }); +Object.defineProperty(exports, 'cbhHaInstance', { get: function () { return require('./cbh-ha-instance'); } }); +Object.defineProperty(exports, 'cbhInstance', { get: function () { return require('./cbh-instance'); } }); +Object.defineProperty(exports, 'cbrBackupShare', { get: function () { return require('./cbr-backup-share'); } }); +Object.defineProperty(exports, 'cbrBackupShareAccepter', { get: function () { return require('./cbr-backup-share-accepter'); } }); +Object.defineProperty(exports, 'cbrCheckpoint', { get: function () { return require('./cbr-checkpoint'); } }); +Object.defineProperty(exports, 'cbrPolicy', { get: function () { return require('./cbr-policy'); } }); +Object.defineProperty(exports, 'cbrVault', { get: function () { return require('./cbr-vault'); } }); +Object.defineProperty(exports, 'ccAuthorization', { get: function () { return require('./cc-authorization'); } }); +Object.defineProperty(exports, 'ccBandwidthPackage', { get: function () { return require('./cc-bandwidth-package'); } }); +Object.defineProperty(exports, 'ccCentralNetwork', { get: function () { return require('./cc-central-network'); } }); +Object.defineProperty(exports, 'ccCentralNetworkAttachment', { get: function () { return require('./cc-central-network-attachment'); } }); +Object.defineProperty(exports, 'ccCentralNetworkConnectionBandwidthAssociate', { get: function () { return require('./cc-central-network-connection-bandwidth-associate'); } }); +Object.defineProperty(exports, 'ccCentralNetworkPolicy', { get: function () { return require('./cc-central-network-policy'); } }); +Object.defineProperty(exports, 'ccCentralNetworkPolicyApply', { get: function () { return require('./cc-central-network-policy-apply'); } }); +Object.defineProperty(exports, 'ccConnection', { get: function () { return require('./cc-connection'); } }); +Object.defineProperty(exports, 'ccGlobalConnectionBandwidth', { get: function () { return require('./cc-global-connection-bandwidth'); } }); +Object.defineProperty(exports, 'ccGlobalConnectionBandwidthAssociate', { get: function () { return require('./cc-global-connection-bandwidth-associate'); } }); +Object.defineProperty(exports, 'ccInterRegionBandwidth', { get: function () { return require('./cc-inter-region-bandwidth'); } }); +Object.defineProperty(exports, 'ccNetworkInstance', { get: function () { return require('./cc-network-instance'); } }); +Object.defineProperty(exports, 'cceAddon', { get: function () { return require('./cce-addon'); } }); +Object.defineProperty(exports, 'cceAutopilotAddon', { get: function () { return require('./cce-autopilot-addon'); } }); +Object.defineProperty(exports, 'cceAutopilotCluster', { get: function () { return require('./cce-autopilot-cluster'); } }); +Object.defineProperty(exports, 'cceChart', { get: function () { return require('./cce-chart'); } }); +Object.defineProperty(exports, 'cceCluster', { get: function () { return require('./cce-cluster'); } }); +Object.defineProperty(exports, 'cceClusterLogConfig', { get: function () { return require('./cce-cluster-log-config'); } }); +Object.defineProperty(exports, 'cceClusterUpgrade', { get: function () { return require('./cce-cluster-upgrade'); } }); +Object.defineProperty(exports, 'cceClusterV3', { get: function () { return require('./cce-cluster-v3'); } }); +Object.defineProperty(exports, 'cceNamespace', { get: function () { return require('./cce-namespace'); } }); +Object.defineProperty(exports, 'cceNode', { get: function () { return require('./cce-node'); } }); +Object.defineProperty(exports, 'cceNodeAttach', { get: function () { return require('./cce-node-attach'); } }); +Object.defineProperty(exports, 'cceNodePool', { get: function () { return require('./cce-node-pool'); } }); +Object.defineProperty(exports, 'cceNodePoolNodesAdd', { get: function () { return require('./cce-node-pool-nodes-add'); } }); +Object.defineProperty(exports, 'cceNodeV3', { get: function () { return require('./cce-node-v3'); } }); +Object.defineProperty(exports, 'ccePartition', { get: function () { return require('./cce-partition'); } }); +Object.defineProperty(exports, 'ccePvc', { get: function () { return require('./cce-pvc'); } }); +Object.defineProperty(exports, 'cciNamespace', { get: function () { return require('./cci-namespace'); } }); +Object.defineProperty(exports, 'cciNetwork', { get: function () { return require('./cci-network'); } }); +Object.defineProperty(exports, 'cciPvc', { get: function () { return require('./cci-pvc'); } }); +Object.defineProperty(exports, 'ccmCertificate', { get: function () { return require('./ccm-certificate'); } }); +Object.defineProperty(exports, 'ccmCertificateApply', { get: function () { return require('./ccm-certificate-apply'); } }); +Object.defineProperty(exports, 'ccmCertificateDeploy', { get: function () { return require('./ccm-certificate-deploy'); } }); +Object.defineProperty(exports, 'ccmCertificateImport', { get: function () { return require('./ccm-certificate-import'); } }); +Object.defineProperty(exports, 'ccmCertificatePush', { get: function () { return require('./ccm-certificate-push'); } }); +Object.defineProperty(exports, 'ccmPrivateCa', { get: function () { return require('./ccm-private-ca'); } }); +Object.defineProperty(exports, 'ccmPrivateCaRestore', { get: function () { return require('./ccm-private-ca-restore'); } }); +Object.defineProperty(exports, 'ccmPrivateCaRevoke', { get: function () { return require('./ccm-private-ca-revoke'); } }); +Object.defineProperty(exports, 'ccmPrivateCertificate', { get: function () { return require('./ccm-private-certificate'); } }); +Object.defineProperty(exports, 'ccmPrivateCertificateRevoke', { get: function () { return require('./ccm-private-certificate-revoke'); } }); +Object.defineProperty(exports, 'cdmCluster', { get: function () { return require('./cdm-cluster'); } }); +Object.defineProperty(exports, 'cdmClusterAction', { get: function () { return require('./cdm-cluster-action'); } }); +Object.defineProperty(exports, 'cdmClusterV1', { get: function () { return require('./cdm-cluster-v1'); } }); +Object.defineProperty(exports, 'cdmJob', { get: function () { return require('./cdm-job'); } }); +Object.defineProperty(exports, 'cdmLink', { get: function () { return require('./cdm-link'); } }); +Object.defineProperty(exports, 'cdnBillingOption', { get: function () { return require('./cdn-billing-option'); } }); +Object.defineProperty(exports, 'cdnCachePreheat', { get: function () { return require('./cdn-cache-preheat'); } }); +Object.defineProperty(exports, 'cdnCacheRefresh', { get: function () { return require('./cdn-cache-refresh'); } }); +Object.defineProperty(exports, 'cdnDomain', { get: function () { return require('./cdn-domain'); } }); +Object.defineProperty(exports, 'cdnDomainV1', { get: function () { return require('./cdn-domain-v1'); } }); +Object.defineProperty(exports, 'cesAlarmTemplate', { get: function () { return require('./ces-alarm-template'); } }); +Object.defineProperty(exports, 'cesAlarmrule', { get: function () { return require('./ces-alarmrule'); } }); +Object.defineProperty(exports, 'cesDashboard', { get: function () { return require('./ces-dashboard'); } }); +Object.defineProperty(exports, 'cesDashboardWidget', { get: function () { return require('./ces-dashboard-widget'); } }); +Object.defineProperty(exports, 'cesEventReport', { get: function () { return require('./ces-event-report'); } }); +Object.defineProperty(exports, 'cesOneClickAlarm', { get: function () { return require('./ces-one-click-alarm'); } }); +Object.defineProperty(exports, 'cesResourceGroup', { get: function () { return require('./ces-resource-group'); } }); +Object.defineProperty(exports, 'cfwAclRule', { get: function () { return require('./cfw-acl-rule'); } }); +Object.defineProperty(exports, 'cfwAddressGroup', { get: function () { return require('./cfw-address-group'); } }); +Object.defineProperty(exports, 'cfwAddressGroupMember', { get: function () { return require('./cfw-address-group-member'); } }); +Object.defineProperty(exports, 'cfwBlackWhiteList', { get: function () { return require('./cfw-black-white-list'); } }); +Object.defineProperty(exports, 'cfwCaptureTask', { get: function () { return require('./cfw-capture-task'); } }); +Object.defineProperty(exports, 'cfwDnsResolution', { get: function () { return require('./cfw-dns-resolution'); } }); +Object.defineProperty(exports, 'cfwDomainNameGroup', { get: function () { return require('./cfw-domain-name-group'); } }); +Object.defineProperty(exports, 'cfwEipProtection', { get: function () { return require('./cfw-eip-protection'); } }); +Object.defineProperty(exports, 'cfwFirewall', { get: function () { return require('./cfw-firewall'); } }); +Object.defineProperty(exports, 'cfwLtsLog', { get: function () { return require('./cfw-lts-log'); } }); +Object.defineProperty(exports, 'cfwProtectionRule', { get: function () { return require('./cfw-protection-rule'); } }); +Object.defineProperty(exports, 'cfwServiceGroup', { get: function () { return require('./cfw-service-group'); } }); +Object.defineProperty(exports, 'cfwServiceGroupMember', { get: function () { return require('./cfw-service-group-member'); } }); +Object.defineProperty(exports, 'cloudtableCluster', { get: function () { return require('./cloudtable-cluster'); } }); +Object.defineProperty(exports, 'cnadAdvancedBlackWhiteList', { get: function () { return require('./cnad-advanced-black-white-list'); } }); +Object.defineProperty(exports, 'cnadAdvancedPolicy', { get: function () { return require('./cnad-advanced-policy'); } }); +Object.defineProperty(exports, 'cnadAdvancedPolicyAssociate', { get: function () { return require('./cnad-advanced-policy-associate'); } }); +Object.defineProperty(exports, 'cnadAdvancedProtectedObject', { get: function () { return require('./cnad-advanced-protected-object'); } }); +Object.defineProperty(exports, 'cocScript', { get: function () { return require('./coc-script'); } }); +Object.defineProperty(exports, 'cocScriptExecute', { get: function () { return require('./coc-script-execute'); } }); +Object.defineProperty(exports, 'codeartsDeployApplication', { get: function () { return require('./codearts-deploy-application'); } }); +Object.defineProperty(exports, 'codeartsDeployGroup', { get: function () { return require('./codearts-deploy-group'); } }); +Object.defineProperty(exports, 'codeartsDeployHost', { get: function () { return require('./codearts-deploy-host'); } }); +Object.defineProperty(exports, 'codeartsInspectorWebsite', { get: function () { return require('./codearts-inspector-website'); } }); +Object.defineProperty(exports, 'codeartsInspectorWebsiteScan', { get: function () { return require('./codearts-inspector-website-scan'); } }); +Object.defineProperty(exports, 'codeartsProject', { get: function () { return require('./codearts-project'); } }); +Object.defineProperty(exports, 'codeartsRepository', { get: function () { return require('./codearts-repository'); } }); +Object.defineProperty(exports, 'codehubRepository', { get: function () { return require('./codehub-repository'); } }); +Object.defineProperty(exports, 'computeAutoLaunchGroup', { get: function () { return require('./compute-auto-launch-group'); } }); +Object.defineProperty(exports, 'computeEipAssociate', { get: function () { return require('./compute-eip-associate'); } }); +Object.defineProperty(exports, 'computeFloatingipAssociateV2', { get: function () { return require('./compute-floatingip-associate-v2'); } }); +Object.defineProperty(exports, 'computeFloatingipV2', { get: function () { return require('./compute-floatingip-v2'); } }); +Object.defineProperty(exports, 'computeInstance', { get: function () { return require('./compute-instance'); } }); +Object.defineProperty(exports, 'computeInstanceV2', { get: function () { return require('./compute-instance-v2'); } }); +Object.defineProperty(exports, 'computeInterfaceAttach', { get: function () { return require('./compute-interface-attach'); } }); +Object.defineProperty(exports, 'computeInterfaceAttachV2', { get: function () { return require('./compute-interface-attach-v2'); } }); +Object.defineProperty(exports, 'computeKeypair', { get: function () { return require('./compute-keypair'); } }); +Object.defineProperty(exports, 'computeKeypairV2', { get: function () { return require('./compute-keypair-v2'); } }); +Object.defineProperty(exports, 'computeSecgroupV2', { get: function () { return require('./compute-secgroup-v2'); } }); +Object.defineProperty(exports, 'computeServergroup', { get: function () { return require('./compute-servergroup'); } }); +Object.defineProperty(exports, 'computeServergroupV2', { get: function () { return require('./compute-servergroup-v2'); } }); +Object.defineProperty(exports, 'computeVolumeAttach', { get: function () { return require('./compute-volume-attach'); } }); +Object.defineProperty(exports, 'computeVolumeAttachV2', { get: function () { return require('./compute-volume-attach-v2'); } }); +Object.defineProperty(exports, 'cphAdbCommand', { get: function () { return require('./cph-adb-command'); } }); +Object.defineProperty(exports, 'cphPhoneProperty', { get: function () { return require('./cph-phone-property'); } }); +Object.defineProperty(exports, 'cphPhoneReset', { get: function () { return require('./cph-phone-reset'); } }); +Object.defineProperty(exports, 'cphPhoneRestart', { get: function () { return require('./cph-phone-restart'); } }); +Object.defineProperty(exports, 'cphPhoneStop', { get: function () { return require('./cph-phone-stop'); } }); +Object.defineProperty(exports, 'cphServer', { get: function () { return require('./cph-server'); } }); +Object.defineProperty(exports, 'cphServerRestart', { get: function () { return require('./cph-server-restart'); } }); +Object.defineProperty(exports, 'cphShareApp', { get: function () { return require('./cph-share-app'); } }); +Object.defineProperty(exports, 'cptsProject', { get: function () { return require('./cpts-project'); } }); +Object.defineProperty(exports, 'cptsTask', { get: function () { return require('./cpts-task'); } }); +Object.defineProperty(exports, 'csCluster', { get: function () { return require('./cs-cluster'); } }); +Object.defineProperty(exports, 'csClusterV1', { get: function () { return require('./cs-cluster-v1'); } }); +Object.defineProperty(exports, 'csPeeringConnect', { get: function () { return require('./cs-peering-connect'); } }); +Object.defineProperty(exports, 'csPeeringConnectV1', { get: function () { return require('./cs-peering-connect-v1'); } }); +Object.defineProperty(exports, 'csRoute', { get: function () { return require('./cs-route'); } }); +Object.defineProperty(exports, 'csRouteV1', { get: function () { return require('./cs-route-v1'); } }); +Object.defineProperty(exports, 'csbsBackup', { get: function () { return require('./csbs-backup'); } }); +Object.defineProperty(exports, 'csbsBackupPolicy', { get: function () { return require('./csbs-backup-policy'); } }); +Object.defineProperty(exports, 'csbsBackupPolicyV1', { get: function () { return require('./csbs-backup-policy-v1'); } }); +Object.defineProperty(exports, 'csbsBackupV1', { get: function () { return require('./csbs-backup-v1'); } }); +Object.defineProperty(exports, 'cseMicroservice', { get: function () { return require('./cse-microservice'); } }); +Object.defineProperty(exports, 'cseMicroserviceEngine', { get: function () { return require('./cse-microservice-engine'); } }); +Object.defineProperty(exports, 'cseMicroserviceEngineConfiguration', { get: function () { return require('./cse-microservice-engine-configuration'); } }); +Object.defineProperty(exports, 'cseMicroserviceInstance', { get: function () { return require('./cse-microservice-instance'); } }); +Object.defineProperty(exports, 'csmsEvent', { get: function () { return require('./csms-event'); } }); +Object.defineProperty(exports, 'csmsSecret', { get: function () { return require('./csms-secret'); } }); +Object.defineProperty(exports, 'csmsSecretVersionState', { get: function () { return require('./csms-secret-version-state'); } }); +Object.defineProperty(exports, 'cssCluster', { get: function () { return require('./css-cluster'); } }); +Object.defineProperty(exports, 'cssClusterAzMigrate', { get: function () { return require('./css-cluster-az-migrate'); } }); +Object.defineProperty(exports, 'cssClusterNodeReplace', { get: function () { return require('./css-cluster-node-replace'); } }); +Object.defineProperty(exports, 'cssClusterRestart', { get: function () { return require('./css-cluster-restart'); } }); +Object.defineProperty(exports, 'cssClusterV1', { get: function () { return require('./css-cluster-v1'); } }); +Object.defineProperty(exports, 'cssConfiguration', { get: function () { return require('./css-configuration'); } }); +Object.defineProperty(exports, 'cssEsCoreUpgrade', { get: function () { return require('./css-es-core-upgrade'); } }); +Object.defineProperty(exports, 'cssEsLoadbalancerConfig', { get: function () { return require('./css-es-loadbalancer-config'); } }); +Object.defineProperty(exports, 'cssLogSetting', { get: function () { return require('./css-log-setting'); } }); +Object.defineProperty(exports, 'cssLogstashCluster', { get: function () { return require('./css-logstash-cluster'); } }); +Object.defineProperty(exports, 'cssLogstashClusterRestart', { get: function () { return require('./css-logstash-cluster-restart'); } }); +Object.defineProperty(exports, 'cssLogstashConfiguration', { get: function () { return require('./css-logstash-configuration'); } }); +Object.defineProperty(exports, 'cssLogstashConnectivity', { get: function () { return require('./css-logstash-connectivity'); } }); +Object.defineProperty(exports, 'cssLogstashCustomCertificate', { get: function () { return require('./css-logstash-custom-certificate'); } }); +Object.defineProperty(exports, 'cssLogstashCustomTemplate', { get: function () { return require('./css-logstash-custom-template'); } }); +Object.defineProperty(exports, 'cssLogstashPipeline', { get: function () { return require('./css-logstash-pipeline'); } }); +Object.defineProperty(exports, 'cssManualLogBackup', { get: function () { return require('./css-manual-log-backup'); } }); +Object.defineProperty(exports, 'cssScanTask', { get: function () { return require('./css-scan-task'); } }); +Object.defineProperty(exports, 'cssSnapshot', { get: function () { return require('./css-snapshot'); } }); +Object.defineProperty(exports, 'cssThesaurus', { get: function () { return require('./css-thesaurus'); } }); +Object.defineProperty(exports, 'ctsDataTracker', { get: function () { return require('./cts-data-tracker'); } }); +Object.defineProperty(exports, 'ctsNotification', { get: function () { return require('./cts-notification'); } }); +Object.defineProperty(exports, 'ctsTracker', { get: function () { return require('./cts-tracker'); } }); +Object.defineProperty(exports, 'dataartsArchitectureBatchPublish', { get: function () { return require('./dataarts-architecture-batch-publish'); } }); +Object.defineProperty(exports, 'dataartsArchitectureBatchPublishment', { get: function () { return require('./dataarts-architecture-batch-publishment'); } }); +Object.defineProperty(exports, 'dataartsArchitectureBatchUnpublish', { get: function () { return require('./dataarts-architecture-batch-unpublish'); } }); +Object.defineProperty(exports, 'dataartsArchitectureBusinessMetric', { get: function () { return require('./dataarts-architecture-business-metric'); } }); +Object.defineProperty(exports, 'dataartsArchitectureCodeTable', { get: function () { return require('./dataarts-architecture-code-table'); } }); +Object.defineProperty(exports, 'dataartsArchitectureCodeTableValues', { get: function () { return require('./dataarts-architecture-code-table-values'); } }); +Object.defineProperty(exports, 'dataartsArchitectureDataStandard', { get: function () { return require('./dataarts-architecture-data-standard'); } }); +Object.defineProperty(exports, 'dataartsArchitectureDataStandardTemplate', { get: function () { return require('./dataarts-architecture-data-standard-template'); } }); +Object.defineProperty(exports, 'dataartsArchitectureDirectory', { get: function () { return require('./dataarts-architecture-directory'); } }); +Object.defineProperty(exports, 'dataartsArchitectureModel', { get: function () { return require('./dataarts-architecture-model'); } }); +Object.defineProperty(exports, 'dataartsArchitectureProcess', { get: function () { return require('./dataarts-architecture-process'); } }); +Object.defineProperty(exports, 'dataartsArchitectureReviewer', { get: function () { return require('./dataarts-architecture-reviewer'); } }); +Object.defineProperty(exports, 'dataartsArchitectureSubject', { get: function () { return require('./dataarts-architecture-subject'); } }); +Object.defineProperty(exports, 'dataartsArchitectureTableModel', { get: function () { return require('./dataarts-architecture-table-model'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApi', { get: function () { return require('./dataarts-dataservice-api'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApiAction', { get: function () { return require('./dataarts-dataservice-api-action'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApiAuth', { get: function () { return require('./dataarts-dataservice-api-auth'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApiAuthAction', { get: function () { return require('./dataarts-dataservice-api-auth-action'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApiDebug', { get: function () { return require('./dataarts-dataservice-api-debug'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApiPublish', { get: function () { return require('./dataarts-dataservice-api-publish'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApiPublishment', { get: function () { return require('./dataarts-dataservice-api-publishment'); } }); +Object.defineProperty(exports, 'dataartsDataserviceApp', { get: function () { return require('./dataarts-dataservice-app'); } }); +Object.defineProperty(exports, 'dataartsDataserviceCatalog', { get: function () { return require('./dataarts-dataservice-catalog'); } }); +Object.defineProperty(exports, 'dataartsDataserviceMessageApprove', { get: function () { return require('./dataarts-dataservice-message-approve'); } }); +Object.defineProperty(exports, 'dataartsFactoryJob', { get: function () { return require('./dataarts-factory-job'); } }); +Object.defineProperty(exports, 'dataartsFactoryJobAction', { get: function () { return require('./dataarts-factory-job-action'); } }); +Object.defineProperty(exports, 'dataartsFactoryResource', { get: function () { return require('./dataarts-factory-resource'); } }); +Object.defineProperty(exports, 'dataartsFactoryScript', { get: function () { return require('./dataarts-factory-script'); } }); +Object.defineProperty(exports, 'dataartsSecurityDataRecognitionRule', { get: function () { return require('./dataarts-security-data-recognition-rule'); } }); +Object.defineProperty(exports, 'dataartsSecurityDataSecrecyLevel', { get: function () { return require('./dataarts-security-data-secrecy-level'); } }); +Object.defineProperty(exports, 'dataartsSecurityPermissionSet', { get: function () { return require('./dataarts-security-permission-set'); } }); +Object.defineProperty(exports, 'dataartsSecurityPermissionSetMember', { get: function () { return require('./dataarts-security-permission-set-member'); } }); +Object.defineProperty(exports, 'dataartsSecurityPermissionSetPrivilege', { get: function () { return require('./dataarts-security-permission-set-privilege'); } }); +Object.defineProperty(exports, 'dataartsStudioDataConnection', { get: function () { return require('./dataarts-studio-data-connection'); } }); +Object.defineProperty(exports, 'dataartsStudioInstance', { get: function () { return require('./dataarts-studio-instance'); } }); +Object.defineProperty(exports, 'dbssAuditRiskRuleAction', { get: function () { return require('./dbss-audit-risk-rule-action'); } }); +Object.defineProperty(exports, 'dbssEcsDatabase', { get: function () { return require('./dbss-ecs-database'); } }); +Object.defineProperty(exports, 'dbssInstance', { get: function () { return require('./dbss-instance'); } }); +Object.defineProperty(exports, 'dbssRdsDatabase', { get: function () { return require('./dbss-rds-database'); } }); +Object.defineProperty(exports, 'dcHostedConnect', { get: function () { return require('./dc-hosted-connect'); } }); +Object.defineProperty(exports, 'dcVirtualGateway', { get: function () { return require('./dc-virtual-gateway'); } }); +Object.defineProperty(exports, 'dcVirtualInterface', { get: function () { return require('./dc-virtual-interface'); } }); +Object.defineProperty(exports, 'dcVirtualInterfaceAccepter', { get: function () { return require('./dc-virtual-interface-accepter'); } }); +Object.defineProperty(exports, 'dcsAccount', { get: function () { return require('./dcs-account'); } }); +Object.defineProperty(exports, 'dcsBackup', { get: function () { return require('./dcs-backup'); } }); +Object.defineProperty(exports, 'dcsBigkeyAnalysis', { get: function () { return require('./dcs-bigkey-analysis'); } }); +Object.defineProperty(exports, 'dcsCustomTemplate', { get: function () { return require('./dcs-custom-template'); } }); +Object.defineProperty(exports, 'dcsDiagnosisTask', { get: function () { return require('./dcs-diagnosis-task'); } }); +Object.defineProperty(exports, 'dcsHotkeyAnalysis', { get: function () { return require('./dcs-hotkey-analysis'); } }); +Object.defineProperty(exports, 'dcsInstance', { get: function () { return require('./dcs-instance'); } }); +Object.defineProperty(exports, 'dcsInstanceRestore', { get: function () { return require('./dcs-instance-restore'); } }); +Object.defineProperty(exports, 'dcsInstanceV1', { get: function () { return require('./dcs-instance-v1'); } }); +Object.defineProperty(exports, 'dcsIsntanceRestore', { get: function () { return require('./dcs-isntance-restore'); } }); +Object.defineProperty(exports, 'ddmAccount', { get: function () { return require('./ddm-account'); } }); +Object.defineProperty(exports, 'ddmInstance', { get: function () { return require('./ddm-instance'); } }); +Object.defineProperty(exports, 'ddmInstanceReadStrategy', { get: function () { return require('./ddm-instance-read-strategy'); } }); +Object.defineProperty(exports, 'ddmInstanceRestart', { get: function () { return require('./ddm-instance-restart'); } }); +Object.defineProperty(exports, 'ddmInstanceRollback', { get: function () { return require('./ddm-instance-rollback'); } }); +Object.defineProperty(exports, 'ddmInstanceUpgrade', { get: function () { return require('./ddm-instance-upgrade'); } }); +Object.defineProperty(exports, 'ddmLogicalSessionsKill', { get: function () { return require('./ddm-logical-sessions-kill'); } }); +Object.defineProperty(exports, 'ddmPhysicalSessionsKill', { get: function () { return require('./ddm-physical-sessions-kill'); } }); +Object.defineProperty(exports, 'ddmSchema', { get: function () { return require('./ddm-schema'); } }); +Object.defineProperty(exports, 'ddsAuditLogDelete', { get: function () { return require('./dds-audit-log-delete'); } }); +Object.defineProperty(exports, 'ddsAuditLogPolicy', { get: function () { return require('./dds-audit-log-policy'); } }); +Object.defineProperty(exports, 'ddsBackup', { get: function () { return require('./dds-backup'); } }); +Object.defineProperty(exports, 'ddsCollectionRestore', { get: function () { return require('./dds-collection-restore'); } }); +Object.defineProperty(exports, 'ddsDatabaseRole', { get: function () { return require('./dds-database-role'); } }); +Object.defineProperty(exports, 'ddsDatabaseUser', { get: function () { return require('./dds-database-user'); } }); +Object.defineProperty(exports, 'ddsInstance', { get: function () { return require('./dds-instance'); } }); +Object.defineProperty(exports, 'ddsInstanceEipAssociate', { get: function () { return require('./dds-instance-eip-associate'); } }); +Object.defineProperty(exports, 'ddsInstanceInternalIpModify', { get: function () { return require('./dds-instance-internal-ip-modify'); } }); +Object.defineProperty(exports, 'ddsInstanceParametersModify', { get: function () { return require('./dds-instance-parameters-modify'); } }); +Object.defineProperty(exports, 'ddsInstanceRecovery', { get: function () { return require('./dds-instance-recovery'); } }); +Object.defineProperty(exports, 'ddsInstanceRestart', { get: function () { return require('./dds-instance-restart'); } }); +Object.defineProperty(exports, 'ddsInstanceRestore', { get: function () { return require('./dds-instance-restore'); } }); +Object.defineProperty(exports, 'ddsInstanceV3', { get: function () { return require('./dds-instance-v3'); } }); +Object.defineProperty(exports, 'ddsLtsLog', { get: function () { return require('./dds-lts-log'); } }); +Object.defineProperty(exports, 'ddsParameterTemplate', { get: function () { return require('./dds-parameter-template'); } }); +Object.defineProperty(exports, 'ddsParameterTemplateApply', { get: function () { return require('./dds-parameter-template-apply'); } }); +Object.defineProperty(exports, 'ddsParameterTemplateCompare', { get: function () { return require('./dds-parameter-template-compare'); } }); +Object.defineProperty(exports, 'ddsParameterTemplateCopy', { get: function () { return require('./dds-parameter-template-copy'); } }); +Object.defineProperty(exports, 'ddsParameterTemplateReset', { get: function () { return require('./dds-parameter-template-reset'); } }); +Object.defineProperty(exports, 'ddsPrimaryStandbySwitch', { get: function () { return require('./dds-primary-standby-switch'); } }); +Object.defineProperty(exports, 'ddsRecyclePolicy', { get: function () { return require('./dds-recycle-policy'); } }); +Object.defineProperty(exports, 'ddsScheduledTaskCancel', { get: function () { return require('./dds-scheduled-task-cancel'); } }); +Object.defineProperty(exports, 'disStream', { get: function () { return require('./dis-stream'); } }); +Object.defineProperty(exports, 'disStreamV2', { get: function () { return require('./dis-stream-v2'); } }); +Object.defineProperty(exports, 'dliAgency', { get: function () { return require('./dli-agency'); } }); +Object.defineProperty(exports, 'dliDatabase', { get: function () { return require('./dli-database'); } }); +Object.defineProperty(exports, 'dliDatabasePrivilege', { get: function () { return require('./dli-database-privilege'); } }); +Object.defineProperty(exports, 'dliDatasourceAuth', { get: function () { return require('./dli-datasource-auth'); } }); +Object.defineProperty(exports, 'dliDatasourceConnection', { get: function () { return require('./dli-datasource-connection'); } }); +Object.defineProperty(exports, 'dliDatasourceConnectionAssociate', { get: function () { return require('./dli-datasource-connection-associate'); } }); +Object.defineProperty(exports, 'dliDatasourceConnectionPrivilege', { get: function () { return require('./dli-datasource-connection-privilege'); } }); +Object.defineProperty(exports, 'dliElasticResourcePool', { get: function () { return require('./dli-elastic-resource-pool'); } }); +Object.defineProperty(exports, 'dliFlinkTemplate', { get: function () { return require('./dli-flink-template'); } }); +Object.defineProperty(exports, 'dliFlinkjarJob', { get: function () { return require('./dli-flinkjar-job'); } }); +Object.defineProperty(exports, 'dliFlinksqlJob', { get: function () { return require('./dli-flinksql-job'); } }); +Object.defineProperty(exports, 'dliGlobalVariable', { get: function () { return require('./dli-global-variable'); } }); +Object.defineProperty(exports, 'dliPackage', { get: function () { return require('./dli-package'); } }); +Object.defineProperty(exports, 'dliPermission', { get: function () { return require('./dli-permission'); } }); +Object.defineProperty(exports, 'dliQueue', { get: function () { return require('./dli-queue'); } }); +Object.defineProperty(exports, 'dliQueueV1', { get: function () { return require('./dli-queue-v1'); } }); +Object.defineProperty(exports, 'dliSparkJob', { get: function () { return require('./dli-spark-job'); } }); +Object.defineProperty(exports, 'dliSparkTemplate', { get: function () { return require('./dli-spark-template'); } }); +Object.defineProperty(exports, 'dliSqlJob', { get: function () { return require('./dli-sql-job'); } }); +Object.defineProperty(exports, 'dliSqlTemplate', { get: function () { return require('./dli-sql-template'); } }); +Object.defineProperty(exports, 'dliTable', { get: function () { return require('./dli-table'); } }); +Object.defineProperty(exports, 'dliTemplateFlink', { get: function () { return require('./dli-template-flink'); } }); +Object.defineProperty(exports, 'dliTemplateSpark', { get: function () { return require('./dli-template-spark'); } }); +Object.defineProperty(exports, 'dliTemplateSql', { get: function () { return require('./dli-template-sql'); } }); +Object.defineProperty(exports, 'dmsGroup', { get: function () { return require('./dms-group'); } }); +Object.defineProperty(exports, 'dmsGroupV1', { get: function () { return require('./dms-group-v1'); } }); +Object.defineProperty(exports, 'dmsInstance', { get: function () { return require('./dms-instance'); } }); +Object.defineProperty(exports, 'dmsInstanceV1', { get: function () { return require('./dms-instance-v1'); } }); +Object.defineProperty(exports, 'dmsKafkaBackgroundTaskDelete', { get: function () { return require('./dms-kafka-background-task-delete'); } }); +Object.defineProperty(exports, 'dmsKafkaConsumerGroup', { get: function () { return require('./dms-kafka-consumer-group'); } }); +Object.defineProperty(exports, 'dmsKafkaInstance', { get: function () { return require('./dms-kafka-instance'); } }); +Object.defineProperty(exports, 'dmsKafkaInstanceRestart', { get: function () { return require('./dms-kafka-instance-restart'); } }); +Object.defineProperty(exports, 'dmsKafkaMessageDiagnosisTask', { get: function () { return require('./dms-kafka-message-diagnosis-task'); } }); +Object.defineProperty(exports, 'dmsKafkaMessageOffsetReset', { get: function () { return require('./dms-kafka-message-offset-reset'); } }); +Object.defineProperty(exports, 'dmsKafkaMessageProduce', { get: function () { return require('./dms-kafka-message-produce'); } }); +Object.defineProperty(exports, 'dmsKafkaPartitionReassign', { get: function () { return require('./dms-kafka-partition-reassign'); } }); +Object.defineProperty(exports, 'dmsKafkaPermissions', { get: function () { return require('./dms-kafka-permissions'); } }); +Object.defineProperty(exports, 'dmsKafkaSmartConnect', { get: function () { return require('./dms-kafka-smart-connect'); } }); +Object.defineProperty(exports, 'dmsKafkaSmartConnectTask', { get: function () { return require('./dms-kafka-smart-connect-task'); } }); +Object.defineProperty(exports, 'dmsKafkaSmartConnectTaskAction', { get: function () { return require('./dms-kafka-smart-connect-task-action'); } }); +Object.defineProperty(exports, 'dmsKafkaTopic', { get: function () { return require('./dms-kafka-topic'); } }); +Object.defineProperty(exports, 'dmsKafkaUser', { get: function () { return require('./dms-kafka-user'); } }); +Object.defineProperty(exports, 'dmsKafkaUserClientQuota', { get: function () { return require('./dms-kafka-user-client-quota'); } }); +Object.defineProperty(exports, 'dmsKafkav2SmartConnectTask', { get: function () { return require('./dms-kafkav2-smart-connect-task'); } }); +Object.defineProperty(exports, 'dmsQueue', { get: function () { return require('./dms-queue'); } }); +Object.defineProperty(exports, 'dmsQueueV1', { get: function () { return require('./dms-queue-v1'); } }); +Object.defineProperty(exports, 'dmsRabbitmqBackgroundTaskDelete', { get: function () { return require('./dms-rabbitmq-background-task-delete'); } }); +Object.defineProperty(exports, 'dmsRabbitmqExchange', { get: function () { return require('./dms-rabbitmq-exchange'); } }); +Object.defineProperty(exports, 'dmsRabbitmqExchangeAssociate', { get: function () { return require('./dms-rabbitmq-exchange-associate'); } }); +Object.defineProperty(exports, 'dmsRabbitmqInstance', { get: function () { return require('./dms-rabbitmq-instance'); } }); +Object.defineProperty(exports, 'dmsRabbitmqPlugin', { get: function () { return require('./dms-rabbitmq-plugin'); } }); +Object.defineProperty(exports, 'dmsRabbitmqQueue', { get: function () { return require('./dms-rabbitmq-queue'); } }); +Object.defineProperty(exports, 'dmsRabbitmqQueueMessageClear', { get: function () { return require('./dms-rabbitmq-queue-message-clear'); } }); +Object.defineProperty(exports, 'dmsRabbitmqUser', { get: function () { return require('./dms-rabbitmq-user'); } }); +Object.defineProperty(exports, 'dmsRabbitmqVhost', { get: function () { return require('./dms-rabbitmq-vhost'); } }); +Object.defineProperty(exports, 'dmsRocketmqConsumerGroup', { get: function () { return require('./dms-rocketmq-consumer-group'); } }); +Object.defineProperty(exports, 'dmsRocketmqConsumptionVerify', { get: function () { return require('./dms-rocketmq-consumption-verify'); } }); +Object.defineProperty(exports, 'dmsRocketmqDeadLetterResend', { get: function () { return require('./dms-rocketmq-dead-letter-resend'); } }); +Object.defineProperty(exports, 'dmsRocketmqInstance', { get: function () { return require('./dms-rocketmq-instance'); } }); +Object.defineProperty(exports, 'dmsRocketmqMessageOffsetReset', { get: function () { return require('./dms-rocketmq-message-offset-reset'); } }); +Object.defineProperty(exports, 'dmsRocketmqMigrationTask', { get: function () { return require('./dms-rocketmq-migration-task'); } }); +Object.defineProperty(exports, 'dmsRocketmqTopic', { get: function () { return require('./dms-rocketmq-topic'); } }); +Object.defineProperty(exports, 'dmsRocketmqUser', { get: function () { return require('./dms-rocketmq-user'); } }); +Object.defineProperty(exports, 'dnsCustomLine', { get: function () { return require('./dns-custom-line'); } }); +Object.defineProperty(exports, 'dnsEndpoint', { get: function () { return require('./dns-endpoint'); } }); +Object.defineProperty(exports, 'dnsLineGroup', { get: function () { return require('./dns-line-group'); } }); +Object.defineProperty(exports, 'dnsPtrrecord', { get: function () { return require('./dns-ptrrecord'); } }); +Object.defineProperty(exports, 'dnsPtrrecordV2', { get: function () { return require('./dns-ptrrecord-v2'); } }); +Object.defineProperty(exports, 'dnsRecordset', { get: function () { return require('./dns-recordset'); } }); +Object.defineProperty(exports, 'dnsRecordsetV2', { get: function () { return require('./dns-recordset-v2'); } }); +Object.defineProperty(exports, 'dnsResolverRule', { get: function () { return require('./dns-resolver-rule'); } }); +Object.defineProperty(exports, 'dnsResolverRuleAssociate', { get: function () { return require('./dns-resolver-rule-associate'); } }); +Object.defineProperty(exports, 'dnsZone', { get: function () { return require('./dns-zone'); } }); +Object.defineProperty(exports, 'dnsZoneV2', { get: function () { return require('./dns-zone-v2'); } }); +Object.defineProperty(exports, 'drsJob', { get: function () { return require('./drs-job'); } }); +Object.defineProperty(exports, 'drsJobPrimaryStandbySwitch', { get: function () { return require('./drs-job-primary-standby-switch'); } }); +Object.defineProperty(exports, 'dscAlarmNotification', { get: function () { return require('./dsc-alarm-notification'); } }); +Object.defineProperty(exports, 'dscAssetObs', { get: function () { return require('./dsc-asset-obs'); } }); +Object.defineProperty(exports, 'dscInstance', { get: function () { return require('./dsc-instance'); } }); +Object.defineProperty(exports, 'dwsAlarmSubscription', { get: function () { return require('./dws-alarm-subscription'); } }); +Object.defineProperty(exports, 'dwsCluster', { get: function () { return require('./dws-cluster'); } }); +Object.defineProperty(exports, 'dwsClusterRestart', { get: function () { return require('./dws-cluster-restart'); } }); +Object.defineProperty(exports, 'dwsDisasterRecoveryTask', { get: function () { return require('./dws-disaster-recovery-task'); } }); +Object.defineProperty(exports, 'dwsEventSubscription', { get: function () { return require('./dws-event-subscription'); } }); +Object.defineProperty(exports, 'dwsExtDataSource', { get: function () { return require('./dws-ext-data-source'); } }); +Object.defineProperty(exports, 'dwsLogicalCluster', { get: function () { return require('./dws-logical-cluster'); } }); +Object.defineProperty(exports, 'dwsLogicalClusterRestart', { get: function () { return require('./dws-logical-cluster-restart'); } }); +Object.defineProperty(exports, 'dwsOmAccountAction', { get: function () { return require('./dws-om-account-action'); } }); +Object.defineProperty(exports, 'dwsParameterConfigurations', { get: function () { return require('./dws-parameter-configurations'); } }); +Object.defineProperty(exports, 'dwsPublicDomainAssociate', { get: function () { return require('./dws-public-domain-associate'); } }); +Object.defineProperty(exports, 'dwsSnapshot', { get: function () { return require('./dws-snapshot'); } }); +Object.defineProperty(exports, 'dwsSnapshotCopy', { get: function () { return require('./dws-snapshot-copy'); } }); +Object.defineProperty(exports, 'dwsSnapshotPolicy', { get: function () { return require('./dws-snapshot-policy'); } }); +Object.defineProperty(exports, 'dwsWorkloadConfiguration', { get: function () { return require('./dws-workload-configuration'); } }); +Object.defineProperty(exports, 'dwsWorkloadPlan', { get: function () { return require('./dws-workload-plan'); } }); +Object.defineProperty(exports, 'dwsWorkloadPlanExecution', { get: function () { return require('./dws-workload-plan-execution'); } }); +Object.defineProperty(exports, 'dwsWorkloadPlanStage', { get: function () { return require('./dws-workload-plan-stage'); } }); +Object.defineProperty(exports, 'dwsWorkloadQueue', { get: function () { return require('./dws-workload-queue'); } }); +Object.defineProperty(exports, 'dwsWorkloadQueueUserAssociate', { get: function () { return require('./dws-workload-queue-user-associate'); } }); +Object.defineProperty(exports, 'ecsInstanceV1', { get: function () { return require('./ecs-instance-v1'); } }); +Object.defineProperty(exports, 'egConnection', { get: function () { return require('./eg-connection'); } }); +Object.defineProperty(exports, 'egCustomEventChannel', { get: function () { return require('./eg-custom-event-channel'); } }); +Object.defineProperty(exports, 'egCustomEventSource', { get: function () { return require('./eg-custom-event-source'); } }); +Object.defineProperty(exports, 'egEndpoint', { get: function () { return require('./eg-endpoint'); } }); +Object.defineProperty(exports, 'egEventStream', { get: function () { return require('./eg-event-stream'); } }); +Object.defineProperty(exports, 'egEventSubscription', { get: function () { return require('./eg-event-subscription'); } }); +Object.defineProperty(exports, 'elbActiveStandbyPool', { get: function () { return require('./elb-active-standby-pool'); } }); +Object.defineProperty(exports, 'elbCertificate', { get: function () { return require('./elb-certificate'); } }); +Object.defineProperty(exports, 'elbCertificatePrivateKeyEcho', { get: function () { return require('./elb-certificate-private-key-echo'); } }); +Object.defineProperty(exports, 'elbIpgroup', { get: function () { return require('./elb-ipgroup'); } }); +Object.defineProperty(exports, 'elbL7Policy', { get: function () { return require('./elb-l7policy'); } }); +Object.defineProperty(exports, 'elbL7Rule', { get: function () { return require('./elb-l7rule'); } }); +Object.defineProperty(exports, 'elbListener', { get: function () { return require('./elb-listener'); } }); +Object.defineProperty(exports, 'elbLoadbalancer', { get: function () { return require('./elb-loadbalancer'); } }); +Object.defineProperty(exports, 'elbLog', { get: function () { return require('./elb-log'); } }); +Object.defineProperty(exports, 'elbLogtank', { get: function () { return require('./elb-logtank'); } }); +Object.defineProperty(exports, 'elbMember', { get: function () { return require('./elb-member'); } }); +Object.defineProperty(exports, 'elbMonitor', { get: function () { return require('./elb-monitor'); } }); +Object.defineProperty(exports, 'elbPool', { get: function () { return require('./elb-pool'); } }); +Object.defineProperty(exports, 'elbSecurityPolicy', { get: function () { return require('./elb-security-policy'); } }); +Object.defineProperty(exports, 'enterpriseProject', { get: function () { return require('./enterprise-project'); } }); +Object.defineProperty(exports, 'enterpriseProjectAuthority', { get: function () { return require('./enterprise-project-authority'); } }); +Object.defineProperty(exports, 'erAssociation', { get: function () { return require('./er-association'); } }); +Object.defineProperty(exports, 'erFlowLog', { get: function () { return require('./er-flow-log'); } }); +Object.defineProperty(exports, 'erInstance', { get: function () { return require('./er-instance'); } }); +Object.defineProperty(exports, 'erPropagation', { get: function () { return require('./er-propagation'); } }); +Object.defineProperty(exports, 'erRouteTable', { get: function () { return require('./er-route-table'); } }); +Object.defineProperty(exports, 'erStaticRoute', { get: function () { return require('./er-static-route'); } }); +Object.defineProperty(exports, 'erVpcAttachment', { get: function () { return require('./er-vpc-attachment'); } }); +Object.defineProperty(exports, 'evsSnapshot', { get: function () { return require('./evs-snapshot'); } }); +Object.defineProperty(exports, 'evsSnapshotRollback', { get: function () { return require('./evs-snapshot-rollback'); } }); +Object.defineProperty(exports, 'evsVolume', { get: function () { return require('./evs-volume'); } }); +Object.defineProperty(exports, 'evsVolumeTransfer', { get: function () { return require('./evs-volume-transfer'); } }); +Object.defineProperty(exports, 'evsVolumeTransferAccepter', { get: function () { return require('./evs-volume-transfer-accepter'); } }); +Object.defineProperty(exports, 'fgsApplication', { get: function () { return require('./fgs-application'); } }); +Object.defineProperty(exports, 'fgsAsyncInvokeConfiguration', { get: function () { return require('./fgs-async-invoke-configuration'); } }); +Object.defineProperty(exports, 'fgsDependency', { get: function () { return require('./fgs-dependency'); } }); +Object.defineProperty(exports, 'fgsDependencyVersion', { get: function () { return require('./fgs-dependency-version'); } }); +Object.defineProperty(exports, 'fgsFunction', { get: function () { return require('./fgs-function'); } }); +Object.defineProperty(exports, 'fgsFunctionEvent', { get: function () { return require('./fgs-function-event'); } }); +Object.defineProperty(exports, 'fgsFunctionTrigger', { get: function () { return require('./fgs-function-trigger'); } }); +Object.defineProperty(exports, 'fgsFunctionV2', { get: function () { return require('./fgs-function-v2'); } }); +Object.defineProperty(exports, 'fgsTrigger', { get: function () { return require('./fgs-trigger'); } }); +Object.defineProperty(exports, 'fwFirewallGroupV2', { get: function () { return require('./fw-firewall-group-v2'); } }); +Object.defineProperty(exports, 'fwPolicyV2', { get: function () { return require('./fw-policy-v2'); } }); +Object.defineProperty(exports, 'fwRuleV2', { get: function () { return require('./fw-rule-v2'); } }); +Object.defineProperty(exports, 'gaAccelerator', { get: function () { return require('./ga-accelerator'); } }); +Object.defineProperty(exports, 'gaAddressGroup', { get: function () { return require('./ga-address-group'); } }); +Object.defineProperty(exports, 'gaEndpoint', { get: function () { return require('./ga-endpoint'); } }); +Object.defineProperty(exports, 'gaEndpointGroup', { get: function () { return require('./ga-endpoint-group'); } }); +Object.defineProperty(exports, 'gaHealthCheck', { get: function () { return require('./ga-health-check'); } }); +Object.defineProperty(exports, 'gaListener', { get: function () { return require('./ga-listener'); } }); +Object.defineProperty(exports, 'gaussdbCassandraInstance', { get: function () { return require('./gaussdb-cassandra-instance'); } }); +Object.defineProperty(exports, 'gaussdbInfluxInstance', { get: function () { return require('./gaussdb-influx-instance'); } }); +Object.defineProperty(exports, 'gaussdbMongoInstance', { get: function () { return require('./gaussdb-mongo-instance'); } }); +Object.defineProperty(exports, 'gaussdbMysqlAccount', { get: function () { return require('./gaussdb-mysql-account'); } }); +Object.defineProperty(exports, 'gaussdbMysqlAccountPrivilege', { get: function () { return require('./gaussdb-mysql-account-privilege'); } }); +Object.defineProperty(exports, 'gaussdbMysqlBackup', { get: function () { return require('./gaussdb-mysql-backup'); } }); +Object.defineProperty(exports, 'gaussdbMysqlDatabase', { get: function () { return require('./gaussdb-mysql-database'); } }); +Object.defineProperty(exports, 'gaussdbMysqlEipAssociate', { get: function () { return require('./gaussdb-mysql-eip-associate'); } }); +Object.defineProperty(exports, 'gaussdbMysqlInstance', { get: function () { return require('./gaussdb-mysql-instance'); } }); +Object.defineProperty(exports, 'gaussdbMysqlInstanceNodeConfig', { get: function () { return require('./gaussdb-mysql-instance-node-config'); } }); +Object.defineProperty(exports, 'gaussdbMysqlInstanceRestart', { get: function () { return require('./gaussdb-mysql-instance-restart'); } }); +Object.defineProperty(exports, 'gaussdbMysqlInstanceUpgrade', { get: function () { return require('./gaussdb-mysql-instance-upgrade'); } }); +Object.defineProperty(exports, 'gaussdbMysqlInstantTaskDelete', { get: function () { return require('./gaussdb-mysql-instant-task-delete'); } }); +Object.defineProperty(exports, 'gaussdbMysqlLtsLog', { get: function () { return require('./gaussdb-mysql-lts-log'); } }); +Object.defineProperty(exports, 'gaussdbMysqlParameterTemplate', { get: function () { return require('./gaussdb-mysql-parameter-template'); } }); +Object.defineProperty(exports, 'gaussdbMysqlParameterTemplateApply', { get: function () { return require('./gaussdb-mysql-parameter-template-apply'); } }); +Object.defineProperty(exports, 'gaussdbMysqlParameterTemplateCompare', { get: function () { return require('./gaussdb-mysql-parameter-template-compare'); } }); +Object.defineProperty(exports, 'gaussdbMysqlProxy', { get: function () { return require('./gaussdb-mysql-proxy'); } }); +Object.defineProperty(exports, 'gaussdbMysqlProxyRestart', { get: function () { return require('./gaussdb-mysql-proxy-restart'); } }); +Object.defineProperty(exports, 'gaussdbMysqlQuota', { get: function () { return require('./gaussdb-mysql-quota'); } }); +Object.defineProperty(exports, 'gaussdbMysqlRecyclingPolicy', { get: function () { return require('./gaussdb-mysql-recycling-policy'); } }); +Object.defineProperty(exports, 'gaussdbMysqlRestore', { get: function () { return require('./gaussdb-mysql-restore'); } }); +Object.defineProperty(exports, 'gaussdbMysqlScheduledTaskCancel', { get: function () { return require('./gaussdb-mysql-scheduled-task-cancel'); } }); +Object.defineProperty(exports, 'gaussdbMysqlScheduledTaskDelete', { get: function () { return require('./gaussdb-mysql-scheduled-task-delete'); } }); +Object.defineProperty(exports, 'gaussdbMysqlSqlControlRule', { get: function () { return require('./gaussdb-mysql-sql-control-rule'); } }); +Object.defineProperty(exports, 'gaussdbMysqlTableRestore', { get: function () { return require('./gaussdb-mysql-table-restore'); } }); +Object.defineProperty(exports, 'gaussdbOpengaussDatabase', { get: function () { return require('./gaussdb-opengauss-database'); } }); +Object.defineProperty(exports, 'gaussdbOpengaussInstance', { get: function () { return require('./gaussdb-opengauss-instance'); } }); +Object.defineProperty(exports, 'gaussdbRedisEipAssociate', { get: function () { return require('./gaussdb-redis-eip-associate'); } }); +Object.defineProperty(exports, 'gaussdbRedisInstance', { get: function () { return require('./gaussdb-redis-instance'); } }); +Object.defineProperty(exports, 'gesBackup', { get: function () { return require('./ges-backup'); } }); +Object.defineProperty(exports, 'gesGraph', { get: function () { return require('./ges-graph'); } }); +Object.defineProperty(exports, 'gesMetadata', { get: function () { return require('./ges-metadata'); } }); +Object.defineProperty(exports, 'globalEip', { get: function () { return require('./global-eip'); } }); +Object.defineProperty(exports, 'globalEipAssociate', { get: function () { return require('./global-eip-associate'); } }); +Object.defineProperty(exports, 'globalInternetBandwidth', { get: function () { return require('./global-internet-bandwidth'); } }); +Object.defineProperty(exports, 'hssCceProtection', { get: function () { return require('./hss-cce-protection'); } }); +Object.defineProperty(exports, 'hssHostGroup', { get: function () { return require('./hss-host-group'); } }); +Object.defineProperty(exports, 'hssHostProtection', { get: function () { return require('./hss-host-protection'); } }); +Object.defineProperty(exports, 'hssQuota', { get: function () { return require('./hss-quota'); } }); +Object.defineProperty(exports, 'hssWebtamperProtection', { get: function () { return require('./hss-webtamper-protection'); } }); +Object.defineProperty(exports, 'iamAgency', { get: function () { return require('./iam-agency'); } }); +Object.defineProperty(exports, 'iamAgencyV3', { get: function () { return require('./iam-agency-v3'); } }); +Object.defineProperty(exports, 'identityAccessKey', { get: function () { return require('./identity-access-key'); } }); +Object.defineProperty(exports, 'identityAcl', { get: function () { return require('./identity-acl'); } }); +Object.defineProperty(exports, 'identityAgency', { get: function () { return require('./identity-agency'); } }); +Object.defineProperty(exports, 'identityGroup', { get: function () { return require('./identity-group'); } }); +Object.defineProperty(exports, 'identityGroupMembership', { get: function () { return require('./identity-group-membership'); } }); +Object.defineProperty(exports, 'identityGroupMembershipV3', { get: function () { return require('./identity-group-membership-v3'); } }); +Object.defineProperty(exports, 'identityGroupRoleAssignment', { get: function () { return require('./identity-group-role-assignment'); } }); +Object.defineProperty(exports, 'identityGroupV3', { get: function () { return require('./identity-group-v3'); } }); +Object.defineProperty(exports, 'identityLoginPolicy', { get: function () { return require('./identity-login-policy'); } }); +Object.defineProperty(exports, 'identityPasswordPolicy', { get: function () { return require('./identity-password-policy'); } }); +Object.defineProperty(exports, 'identityPolicy', { get: function () { return require('./identity-policy'); } }); +Object.defineProperty(exports, 'identityProject', { get: function () { return require('./identity-project'); } }); +Object.defineProperty(exports, 'identityProjectV3', { get: function () { return require('./identity-project-v3'); } }); +Object.defineProperty(exports, 'identityProtectionPolicy', { get: function () { return require('./identity-protection-policy'); } }); +Object.defineProperty(exports, 'identityProvider', { get: function () { return require('./identity-provider'); } }); +Object.defineProperty(exports, 'identityProviderConversion', { get: function () { return require('./identity-provider-conversion'); } }); +Object.defineProperty(exports, 'identityRole', { get: function () { return require('./identity-role'); } }); +Object.defineProperty(exports, 'identityRoleAssignment', { get: function () { return require('./identity-role-assignment'); } }); +Object.defineProperty(exports, 'identityRoleAssignmentV3', { get: function () { return require('./identity-role-assignment-v3'); } }); +Object.defineProperty(exports, 'identityServiceAgency', { get: function () { return require('./identity-service-agency'); } }); +Object.defineProperty(exports, 'identityTrustAgency', { get: function () { return require('./identity-trust-agency'); } }); +Object.defineProperty(exports, 'identityUser', { get: function () { return require('./identity-user'); } }); +Object.defineProperty(exports, 'identityUserRoleAssignment', { get: function () { return require('./identity-user-role-assignment'); } }); +Object.defineProperty(exports, 'identityUserToken', { get: function () { return require('./identity-user-token'); } }); +Object.defineProperty(exports, 'identityUserV3', { get: function () { return require('./identity-user-v3'); } }); +Object.defineProperty(exports, 'identityVirtualMfaDevice', { get: function () { return require('./identity-virtual-mfa-device'); } }); +Object.defineProperty(exports, 'identitycenterAccountAssignment', { get: function () { return require('./identitycenter-account-assignment'); } }); +Object.defineProperty(exports, 'identitycenterCustomPolicyAttachment', { get: function () { return require('./identitycenter-custom-policy-attachment'); } }); +Object.defineProperty(exports, 'identitycenterCustomRoleAttachment', { get: function () { return require('./identitycenter-custom-role-attachment'); } }); +Object.defineProperty(exports, 'identitycenterGroup', { get: function () { return require('./identitycenter-group'); } }); +Object.defineProperty(exports, 'identitycenterGroupMembership', { get: function () { return require('./identitycenter-group-membership'); } }); +Object.defineProperty(exports, 'identitycenterPermissionSet', { get: function () { return require('./identitycenter-permission-set'); } }); +Object.defineProperty(exports, 'identitycenterSystemPolicyAttachment', { get: function () { return require('./identitycenter-system-policy-attachment'); } }); +Object.defineProperty(exports, 'identitycenterUser', { get: function () { return require('./identitycenter-user'); } }); +Object.defineProperty(exports, 'iecEip', { get: function () { return require('./iec-eip'); } }); +Object.defineProperty(exports, 'iecKeypair', { get: function () { return require('./iec-keypair'); } }); +Object.defineProperty(exports, 'iecNetworkAcl', { get: function () { return require('./iec-network-acl'); } }); +Object.defineProperty(exports, 'iecNetworkAclRule', { get: function () { return require('./iec-network-acl-rule'); } }); +Object.defineProperty(exports, 'iecSecurityGroup', { get: function () { return require('./iec-security-group'); } }); +Object.defineProperty(exports, 'iecSecurityGroupRule', { get: function () { return require('./iec-security-group-rule'); } }); +Object.defineProperty(exports, 'iecServer', { get: function () { return require('./iec-server'); } }); +Object.defineProperty(exports, 'iecVip', { get: function () { return require('./iec-vip'); } }); +Object.defineProperty(exports, 'iecVpc', { get: function () { return require('./iec-vpc'); } }); +Object.defineProperty(exports, 'iecVpcSubnet', { get: function () { return require('./iec-vpc-subnet'); } }); +Object.defineProperty(exports, 'imagesImage', { get: function () { return require('./images-image'); } }); +Object.defineProperty(exports, 'imagesImageCopy', { get: function () { return require('./images-image-copy'); } }); +Object.defineProperty(exports, 'imagesImageShare', { get: function () { return require('./images-image-share'); } }); +Object.defineProperty(exports, 'imagesImageShareAccepter', { get: function () { return require('./images-image-share-accepter'); } }); +Object.defineProperty(exports, 'imagesImageV2', { get: function () { return require('./images-image-v2'); } }); +Object.defineProperty(exports, 'imsCbrWholeImage', { get: function () { return require('./ims-cbr-whole-image'); } }); +Object.defineProperty(exports, 'imsEcsSystemImage', { get: function () { return require('./ims-ecs-system-image'); } }); +Object.defineProperty(exports, 'imsEcsWholeImage', { get: function () { return require('./ims-ecs-whole-image'); } }); +Object.defineProperty(exports, 'imsEvsDataImage', { get: function () { return require('./ims-evs-data-image'); } }); +Object.defineProperty(exports, 'imsEvsSystemImage', { get: function () { return require('./ims-evs-system-image'); } }); +Object.defineProperty(exports, 'imsImageExport', { get: function () { return require('./ims-image-export'); } }); +Object.defineProperty(exports, 'imsObsDataImage', { get: function () { return require('./ims-obs-data-image'); } }); +Object.defineProperty(exports, 'imsObsIsoImage', { get: function () { return require('./ims-obs-iso-image'); } }); +Object.defineProperty(exports, 'imsObsSystemImage', { get: function () { return require('./ims-obs-system-image'); } }); +Object.defineProperty(exports, 'iotdaAccessCredential', { get: function () { return require('./iotda-access-credential'); } }); +Object.defineProperty(exports, 'iotdaAmqp', { get: function () { return require('./iotda-amqp'); } }); +Object.defineProperty(exports, 'iotdaBatchtask', { get: function () { return require('./iotda-batchtask'); } }); +Object.defineProperty(exports, 'iotdaBatchtaskFile', { get: function () { return require('./iotda-batchtask-file'); } }); +Object.defineProperty(exports, 'iotdaDataBacklogPolicy', { get: function () { return require('./iotda-data-backlog-policy'); } }); +Object.defineProperty(exports, 'iotdaDataFlowControlPolicy', { get: function () { return require('./iotda-data-flow-control-policy'); } }); +Object.defineProperty(exports, 'iotdaDataforwardingRule', { get: function () { return require('./iotda-dataforwarding-rule'); } }); +Object.defineProperty(exports, 'iotdaDevice', { get: function () { return require('./iotda-device'); } }); +Object.defineProperty(exports, 'iotdaDeviceAsyncCommand', { get: function () { return require('./iotda-device-async-command'); } }); +Object.defineProperty(exports, 'iotdaDeviceCertificate', { get: function () { return require('./iotda-device-certificate'); } }); +Object.defineProperty(exports, 'iotdaDeviceGroup', { get: function () { return require('./iotda-device-group'); } }); +Object.defineProperty(exports, 'iotdaDeviceLinkageRule', { get: function () { return require('./iotda-device-linkage-rule'); } }); +Object.defineProperty(exports, 'iotdaDeviceMessage', { get: function () { return require('./iotda-device-message'); } }); +Object.defineProperty(exports, 'iotdaDeviceProxy', { get: function () { return require('./iotda-device-proxy'); } }); +Object.defineProperty(exports, 'iotdaProduct', { get: function () { return require('./iotda-product'); } }); +Object.defineProperty(exports, 'iotdaSpace', { get: function () { return require('./iotda-space'); } }); +Object.defineProperty(exports, 'iotdaUpgradePackage', { get: function () { return require('./iotda-upgrade-package'); } }); +Object.defineProperty(exports, 'kmsDataEncryptDecrypt', { get: function () { return require('./kms-data-encrypt-decrypt'); } }); +Object.defineProperty(exports, 'kmsDedicatedKeystore', { get: function () { return require('./kms-dedicated-keystore'); } }); +Object.defineProperty(exports, 'kmsGrant', { get: function () { return require('./kms-grant'); } }); +Object.defineProperty(exports, 'kmsKey', { get: function () { return require('./kms-key'); } }); +Object.defineProperty(exports, 'kmsKeyMaterial', { get: function () { return require('./kms-key-material'); } }); +Object.defineProperty(exports, 'kmsKeyV1', { get: function () { return require('./kms-key-v1'); } }); +Object.defineProperty(exports, 'kpsKeypair', { get: function () { return require('./kps-keypair'); } }); +Object.defineProperty(exports, 'lbCertificate', { get: function () { return require('./lb-certificate'); } }); +Object.defineProperty(exports, 'lbCertificateV2', { get: function () { return require('./lb-certificate-v2'); } }); +Object.defineProperty(exports, 'lbL7Policy', { get: function () { return require('./lb-l7policy'); } }); +Object.defineProperty(exports, 'lbL7PolicyV2', { get: function () { return require('./lb-l7policy-v2'); } }); +Object.defineProperty(exports, 'lbL7Rule', { get: function () { return require('./lb-l7rule'); } }); +Object.defineProperty(exports, 'lbL7RuleV2', { get: function () { return require('./lb-l7rule-v2'); } }); +Object.defineProperty(exports, 'lbListener', { get: function () { return require('./lb-listener'); } }); +Object.defineProperty(exports, 'lbListenerV2', { get: function () { return require('./lb-listener-v2'); } }); +Object.defineProperty(exports, 'lbLoadbalancer', { get: function () { return require('./lb-loadbalancer'); } }); +Object.defineProperty(exports, 'lbLoadbalancerV2', { get: function () { return require('./lb-loadbalancer-v2'); } }); +Object.defineProperty(exports, 'lbMember', { get: function () { return require('./lb-member'); } }); +Object.defineProperty(exports, 'lbMemberV2', { get: function () { return require('./lb-member-v2'); } }); +Object.defineProperty(exports, 'lbMonitor', { get: function () { return require('./lb-monitor'); } }); +Object.defineProperty(exports, 'lbMonitorV2', { get: function () { return require('./lb-monitor-v2'); } }); +Object.defineProperty(exports, 'lbPool', { get: function () { return require('./lb-pool'); } }); +Object.defineProperty(exports, 'lbPoolV2', { get: function () { return require('./lb-pool-v2'); } }); +Object.defineProperty(exports, 'lbWhitelist', { get: function () { return require('./lb-whitelist'); } }); +Object.defineProperty(exports, 'lbWhitelistV2', { get: function () { return require('./lb-whitelist-v2'); } }); +Object.defineProperty(exports, 'liveBucketAuthorization', { get: function () { return require('./live-bucket-authorization'); } }); +Object.defineProperty(exports, 'liveDomain', { get: function () { return require('./live-domain'); } }); +Object.defineProperty(exports, 'liveRecordCallback', { get: function () { return require('./live-record-callback'); } }); +Object.defineProperty(exports, 'liveRecording', { get: function () { return require('./live-recording'); } }); +Object.defineProperty(exports, 'liveSnapshot', { get: function () { return require('./live-snapshot'); } }); +Object.defineProperty(exports, 'liveTranscoding', { get: function () { return require('./live-transcoding'); } }); +Object.defineProperty(exports, 'ltsAccessRule', { get: function () { return require('./lts-access-rule'); } }); +Object.defineProperty(exports, 'ltsAomAccess', { get: function () { return require('./lts-aom-access'); } }); +Object.defineProperty(exports, 'ltsCceAccess', { get: function () { return require('./lts-cce-access'); } }); +Object.defineProperty(exports, 'ltsCrossAccountAccess', { get: function () { return require('./lts-cross-account-access'); } }); +Object.defineProperty(exports, 'ltsDashboard', { get: function () { return require('./lts-dashboard'); } }); +Object.defineProperty(exports, 'ltsGroup', { get: function () { return require('./lts-group'); } }); +Object.defineProperty(exports, 'ltsHostAccess', { get: function () { return require('./lts-host-access'); } }); +Object.defineProperty(exports, 'ltsHostGroup', { get: function () { return require('./lts-host-group'); } }); +Object.defineProperty(exports, 'ltsKeywordsAlarmRule', { get: function () { return require('./lts-keywords-alarm-rule'); } }); +Object.defineProperty(exports, 'ltsLogConverge', { get: function () { return require('./lts-log-converge'); } }); +Object.defineProperty(exports, 'ltsLogConvergeSwitch', { get: function () { return require('./lts-log-converge-switch'); } }); +Object.defineProperty(exports, 'ltsNotificationTemplate', { get: function () { return require('./lts-notification-template'); } }); +Object.defineProperty(exports, 'ltsSearchCriteria', { get: function () { return require('./lts-search-criteria'); } }); +Object.defineProperty(exports, 'ltsSqlAlarmRule', { get: function () { return require('./lts-sql-alarm-rule'); } }); +Object.defineProperty(exports, 'ltsStream', { get: function () { return require('./lts-stream'); } }); +Object.defineProperty(exports, 'ltsStructTemplate', { get: function () { return require('./lts-struct-template'); } }); +Object.defineProperty(exports, 'ltsStructingTemplate', { get: function () { return require('./lts-structing-template'); } }); +Object.defineProperty(exports, 'ltsStructuringConfiguration', { get: function () { return require('./lts-structuring-configuration'); } }); +Object.defineProperty(exports, 'ltsStructuringCustomConfiguration', { get: function () { return require('./lts-structuring-custom-configuration'); } }); +Object.defineProperty(exports, 'ltsTransfer', { get: function () { return require('./lts-transfer'); } }); +Object.defineProperty(exports, 'ltsWafAccess', { get: function () { return require('./lts-waf-access'); } }); +Object.defineProperty(exports, 'mapreduceCluster', { get: function () { return require('./mapreduce-cluster'); } }); +Object.defineProperty(exports, 'mapreduceDataConnection', { get: function () { return require('./mapreduce-data-connection'); } }); +Object.defineProperty(exports, 'mapreduceJob', { get: function () { return require('./mapreduce-job'); } }); +Object.defineProperty(exports, 'mapreduceScalingPolicy', { get: function () { return require('./mapreduce-scaling-policy'); } }); +Object.defineProperty(exports, 'meetingAdminAssignment', { get: function () { return require('./meeting-admin-assignment'); } }); +Object.defineProperty(exports, 'meetingConference', { get: function () { return require('./meeting-conference'); } }); +Object.defineProperty(exports, 'meetingUser', { get: function () { return require('./meeting-user'); } }); +Object.defineProperty(exports, 'modelartsAuthorization', { get: function () { return require('./modelarts-authorization'); } }); +Object.defineProperty(exports, 'modelartsDataset', { get: function () { return require('./modelarts-dataset'); } }); +Object.defineProperty(exports, 'modelartsDatasetVersion', { get: function () { return require('./modelarts-dataset-version'); } }); +Object.defineProperty(exports, 'modelartsModel', { get: function () { return require('./modelarts-model'); } }); +Object.defineProperty(exports, 'modelartsNetwork', { get: function () { return require('./modelarts-network'); } }); +Object.defineProperty(exports, 'modelartsNotebook', { get: function () { return require('./modelarts-notebook'); } }); +Object.defineProperty(exports, 'modelartsNotebookMountStorage', { get: function () { return require('./modelarts-notebook-mount-storage'); } }); +Object.defineProperty(exports, 'modelartsResourcePool', { get: function () { return require('./modelarts-resource-pool'); } }); +Object.defineProperty(exports, 'modelartsService', { get: function () { return require('./modelarts-service'); } }); +Object.defineProperty(exports, 'modelartsWorkspace', { get: function () { return require('./modelarts-workspace'); } }); +Object.defineProperty(exports, 'mpcTranscodingTemplate', { get: function () { return require('./mpc-transcoding-template'); } }); +Object.defineProperty(exports, 'mpcTranscodingTemplateGroup', { get: function () { return require('./mpc-transcoding-template-group'); } }); +Object.defineProperty(exports, 'mrsCluster', { get: function () { return require('./mrs-cluster'); } }); +Object.defineProperty(exports, 'mrsClusterV1', { get: function () { return require('./mrs-cluster-v1'); } }); +Object.defineProperty(exports, 'mrsJob', { get: function () { return require('./mrs-job'); } }); +Object.defineProperty(exports, 'mrsJobV1', { get: function () { return require('./mrs-job-v1'); } }); +Object.defineProperty(exports, 'natDnatRule', { get: function () { return require('./nat-dnat-rule'); } }); +Object.defineProperty(exports, 'natDnatRuleV2', { get: function () { return require('./nat-dnat-rule-v2'); } }); +Object.defineProperty(exports, 'natGateway', { get: function () { return require('./nat-gateway'); } }); +Object.defineProperty(exports, 'natGatewayV2', { get: function () { return require('./nat-gateway-v2'); } }); +Object.defineProperty(exports, 'natPrivateDnatRule', { get: function () { return require('./nat-private-dnat-rule'); } }); +Object.defineProperty(exports, 'natPrivateGateway', { get: function () { return require('./nat-private-gateway'); } }); +Object.defineProperty(exports, 'natPrivateSnatRule', { get: function () { return require('./nat-private-snat-rule'); } }); +Object.defineProperty(exports, 'natPrivateTransitIp', { get: function () { return require('./nat-private-transit-ip'); } }); +Object.defineProperty(exports, 'natSnatRule', { get: function () { return require('./nat-snat-rule'); } }); +Object.defineProperty(exports, 'natSnatRuleV2', { get: function () { return require('./nat-snat-rule-v2'); } }); +Object.defineProperty(exports, 'networkAcl', { get: function () { return require('./network-acl'); } }); +Object.defineProperty(exports, 'networkAclRule', { get: function () { return require('./network-acl-rule'); } }); +Object.defineProperty(exports, 'networkingEipAssociate', { get: function () { return require('./networking-eip-associate'); } }); +Object.defineProperty(exports, 'networkingFloatingipV2', { get: function () { return require('./networking-floatingip-v2'); } }); +Object.defineProperty(exports, 'networkingNetworkV2', { get: function () { return require('./networking-network-v2'); } }); +Object.defineProperty(exports, 'networkingPort', { get: function () { return require('./networking-port'); } }); +Object.defineProperty(exports, 'networkingPortV2', { get: function () { return require('./networking-port-v2'); } }); +Object.defineProperty(exports, 'networkingRouterInterfaceV2', { get: function () { return require('./networking-router-interface-v2'); } }); +Object.defineProperty(exports, 'networkingRouterRouteV2', { get: function () { return require('./networking-router-route-v2'); } }); +Object.defineProperty(exports, 'networkingRouterV2', { get: function () { return require('./networking-router-v2'); } }); +Object.defineProperty(exports, 'networkingSecgroup', { get: function () { return require('./networking-secgroup'); } }); +Object.defineProperty(exports, 'networkingSecgroupRule', { get: function () { return require('./networking-secgroup-rule'); } }); +Object.defineProperty(exports, 'networkingSecgroupRuleV2', { get: function () { return require('./networking-secgroup-rule-v2'); } }); +Object.defineProperty(exports, 'networkingSecgroupV2', { get: function () { return require('./networking-secgroup-v2'); } }); +Object.defineProperty(exports, 'networkingSubnetV2', { get: function () { return require('./networking-subnet-v2'); } }); +Object.defineProperty(exports, 'networkingVip', { get: function () { return require('./networking-vip'); } }); +Object.defineProperty(exports, 'networkingVipAssociate', { get: function () { return require('./networking-vip-associate'); } }); +Object.defineProperty(exports, 'networkingVipAssociateV2', { get: function () { return require('./networking-vip-associate-v2'); } }); +Object.defineProperty(exports, 'networkingVipV2', { get: function () { return require('./networking-vip-v2'); } }); +Object.defineProperty(exports, 'obsBucket', { get: function () { return require('./obs-bucket'); } }); +Object.defineProperty(exports, 'obsBucketAcl', { get: function () { return require('./obs-bucket-acl'); } }); +Object.defineProperty(exports, 'obsBucketObject', { get: function () { return require('./obs-bucket-object'); } }); +Object.defineProperty(exports, 'obsBucketObjectAcl', { get: function () { return require('./obs-bucket-object-acl'); } }); +Object.defineProperty(exports, 'obsBucketPolicy', { get: function () { return require('./obs-bucket-policy'); } }); +Object.defineProperty(exports, 'obsBucketReplication', { get: function () { return require('./obs-bucket-replication'); } }); +Object.defineProperty(exports, 'omsMigrationSyncTask', { get: function () { return require('./oms-migration-sync-task'); } }); +Object.defineProperty(exports, 'omsMigrationTask', { get: function () { return require('./oms-migration-task'); } }); +Object.defineProperty(exports, 'omsMigrationTaskGroup', { get: function () { return require('./oms-migration-task-group'); } }); +Object.defineProperty(exports, 'omsTask', { get: function () { return require('./oms-task'); } }); +Object.defineProperty(exports, 'organizationsAccount', { get: function () { return require('./organizations-account'); } }); +Object.defineProperty(exports, 'organizationsAccountAssociate', { get: function () { return require('./organizations-account-associate'); } }); +Object.defineProperty(exports, 'organizationsAccountInvite', { get: function () { return require('./organizations-account-invite'); } }); +Object.defineProperty(exports, 'organizationsAccountInviteAccepter', { get: function () { return require('./organizations-account-invite-accepter'); } }); +Object.defineProperty(exports, 'organizationsAccountInviteDecliner', { get: function () { return require('./organizations-account-invite-decliner'); } }); +Object.defineProperty(exports, 'organizationsDelegatedAdministrator', { get: function () { return require('./organizations-delegated-administrator'); } }); +Object.defineProperty(exports, 'organizationsOrganization', { get: function () { return require('./organizations-organization'); } }); +Object.defineProperty(exports, 'organizationsOrganizationalUnit', { get: function () { return require('./organizations-organizational-unit'); } }); +Object.defineProperty(exports, 'organizationsPolicy', { get: function () { return require('./organizations-policy'); } }); +Object.defineProperty(exports, 'organizationsPolicyAttach', { get: function () { return require('./organizations-policy-attach'); } }); +Object.defineProperty(exports, 'organizationsTrustedService', { get: function () { return require('./organizations-trusted-service'); } }); +Object.defineProperty(exports, 'projectmanProject', { get: function () { return require('./projectman-project'); } }); +Object.defineProperty(exports, 'ramOrganization', { get: function () { return require('./ram-organization'); } }); +Object.defineProperty(exports, 'ramResourceShare', { get: function () { return require('./ram-resource-share'); } }); +Object.defineProperty(exports, 'ramResourceShareAccepter', { get: function () { return require('./ram-resource-share-accepter'); } }); +Object.defineProperty(exports, 'rdsAccount', { get: function () { return require('./rds-account'); } }); +Object.defineProperty(exports, 'rdsBackup', { get: function () { return require('./rds-backup'); } }); +Object.defineProperty(exports, 'rdsCrossRegionBackupStrategy', { get: function () { return require('./rds-cross-region-backup-strategy'); } }); +Object.defineProperty(exports, 'rdsDatabase', { get: function () { return require('./rds-database'); } }); +Object.defineProperty(exports, 'rdsDatabaseLogsShrinking', { get: function () { return require('./rds-database-logs-shrinking'); } }); +Object.defineProperty(exports, 'rdsDatabasePrivilege', { get: function () { return require('./rds-database-privilege'); } }); +Object.defineProperty(exports, 'rdsExtendLogLink', { get: function () { return require('./rds-extend-log-link'); } }); +Object.defineProperty(exports, 'rdsInstance', { get: function () { return require('./rds-instance'); } }); +Object.defineProperty(exports, 'rdsInstanceEipAssociate', { get: function () { return require('./rds-instance-eip-associate'); } }); +Object.defineProperty(exports, 'rdsInstanceV3', { get: function () { return require('./rds-instance-v3'); } }); +Object.defineProperty(exports, 'rdsLtsLog', { get: function () { return require('./rds-lts-log'); } }); +Object.defineProperty(exports, 'rdsMysqlAccount', { get: function () { return require('./rds-mysql-account'); } }); +Object.defineProperty(exports, 'rdsMysqlBinlog', { get: function () { return require('./rds-mysql-binlog'); } }); +Object.defineProperty(exports, 'rdsMysqlDatabase', { get: function () { return require('./rds-mysql-database'); } }); +Object.defineProperty(exports, 'rdsMysqlDatabasePrivilege', { get: function () { return require('./rds-mysql-database-privilege'); } }); +Object.defineProperty(exports, 'rdsMysqlDatabaseTableRestore', { get: function () { return require('./rds-mysql-database-table-restore'); } }); +Object.defineProperty(exports, 'rdsMysqlProxy', { get: function () { return require('./rds-mysql-proxy'); } }); +Object.defineProperty(exports, 'rdsMysqlProxyRestart', { get: function () { return require('./rds-mysql-proxy-restart'); } }); +Object.defineProperty(exports, 'rdsParametergroup', { get: function () { return require('./rds-parametergroup'); } }); +Object.defineProperty(exports, 'rdsParametergroupV3', { get: function () { return require('./rds-parametergroup-v3'); } }); +Object.defineProperty(exports, 'rdsPgAccount', { get: function () { return require('./rds-pg-account'); } }); +Object.defineProperty(exports, 'rdsPgAccountPrivileges', { get: function () { return require('./rds-pg-account-privileges'); } }); +Object.defineProperty(exports, 'rdsPgAccountRoles', { get: function () { return require('./rds-pg-account-roles'); } }); +Object.defineProperty(exports, 'rdsPgDatabase', { get: function () { return require('./rds-pg-database'); } }); +Object.defineProperty(exports, 'rdsPgDatabasePrivilege', { get: function () { return require('./rds-pg-database-privilege'); } }); +Object.defineProperty(exports, 'rdsPgHba', { get: function () { return require('./rds-pg-hba'); } }); +Object.defineProperty(exports, 'rdsPgPlugin', { get: function () { return require('./rds-pg-plugin'); } }); +Object.defineProperty(exports, 'rdsPgPluginParameter', { get: function () { return require('./rds-pg-plugin-parameter'); } }); +Object.defineProperty(exports, 'rdsPgPluginUpdate', { get: function () { return require('./rds-pg-plugin-update'); } }); +Object.defineProperty(exports, 'rdsPgSqlLimit', { get: function () { return require('./rds-pg-sql-limit'); } }); +Object.defineProperty(exports, 'rdsPrimaryStandbySwitch', { get: function () { return require('./rds-primary-standby-switch'); } }); +Object.defineProperty(exports, 'rdsReadReplicaInstance', { get: function () { return require('./rds-read-replica-instance'); } }); +Object.defineProperty(exports, 'rdsRecyclingPolicy', { get: function () { return require('./rds-recycling-policy'); } }); +Object.defineProperty(exports, 'rdsRestore', { get: function () { return require('./rds-restore'); } }); +Object.defineProperty(exports, 'rdsSqlAudit', { get: function () { return require('./rds-sql-audit'); } }); +Object.defineProperty(exports, 'rdsSqlserverAccount', { get: function () { return require('./rds-sqlserver-account'); } }); +Object.defineProperty(exports, 'rdsSqlserverDatabase', { get: function () { return require('./rds-sqlserver-database'); } }); +Object.defineProperty(exports, 'rdsSqlserverDatabasePrivilege', { get: function () { return require('./rds-sqlserver-database-privilege'); } }); +Object.defineProperty(exports, 'rfStack', { get: function () { return require('./rf-stack'); } }); +Object.defineProperty(exports, 'rfsExecutionPlan', { get: function () { return require('./rfs-execution-plan'); } }); +Object.defineProperty(exports, 'rfsPrivateHook', { get: function () { return require('./rfs-private-hook'); } }); +Object.defineProperty(exports, 'rfsStack', { get: function () { return require('./rfs-stack'); } }); +Object.defineProperty(exports, 'rgcAccount', { get: function () { return require('./rgc-account'); } }); +Object.defineProperty(exports, 'rmsAdvancedQuery', { get: function () { return require('./rms-advanced-query'); } }); +Object.defineProperty(exports, 'rmsAssignmentPackage', { get: function () { return require('./rms-assignment-package'); } }); +Object.defineProperty(exports, 'rmsOrganizationalAssignmentPackage', { get: function () { return require('./rms-organizational-assignment-package'); } }); +Object.defineProperty(exports, 'rmsOrganizationalPolicyAssignment', { get: function () { return require('./rms-organizational-policy-assignment'); } }); +Object.defineProperty(exports, 'rmsPolicyAssignment', { get: function () { return require('./rms-policy-assignment'); } }); +Object.defineProperty(exports, 'rmsPolicyAssignmentEvaluate', { get: function () { return require('./rms-policy-assignment-evaluate'); } }); +Object.defineProperty(exports, 'rmsRemediationConfiguration', { get: function () { return require('./rms-remediation-configuration'); } }); +Object.defineProperty(exports, 'rmsRemediationException', { get: function () { return require('./rms-remediation-exception'); } }); +Object.defineProperty(exports, 'rmsRemediationExecution', { get: function () { return require('./rms-remediation-execution'); } }); +Object.defineProperty(exports, 'rmsResourceAggregationAuthorization', { get: function () { return require('./rms-resource-aggregation-authorization'); } }); +Object.defineProperty(exports, 'rmsResourceAggregator', { get: function () { return require('./rms-resource-aggregator'); } }); +Object.defineProperty(exports, 'rmsResourceRecorder', { get: function () { return require('./rms-resource-recorder'); } }); +Object.defineProperty(exports, 'scmCertificate', { get: function () { return require('./scm-certificate'); } }); +Object.defineProperty(exports, 'sdrsDrill', { get: function () { return require('./sdrs-drill'); } }); +Object.defineProperty(exports, 'sdrsProtectedInstance', { get: function () { return require('./sdrs-protected-instance'); } }); +Object.defineProperty(exports, 'sdrsProtectionGroup', { get: function () { return require('./sdrs-protection-group'); } }); +Object.defineProperty(exports, 'sdrsReplicationAttach', { get: function () { return require('./sdrs-replication-attach'); } }); +Object.defineProperty(exports, 'sdrsReplicationPair', { get: function () { return require('./sdrs-replication-pair'); } }); +Object.defineProperty(exports, 'secmasterAlert', { get: function () { return require('./secmaster-alert'); } }); +Object.defineProperty(exports, 'secmasterAlertRule', { get: function () { return require('./secmaster-alert-rule'); } }); +Object.defineProperty(exports, 'secmasterDataObjectRelations', { get: function () { return require('./secmaster-data-object-relations'); } }); +Object.defineProperty(exports, 'secmasterIncident', { get: function () { return require('./secmaster-incident'); } }); +Object.defineProperty(exports, 'secmasterIndicator', { get: function () { return require('./secmaster-indicator'); } }); +Object.defineProperty(exports, 'secmasterPlaybook', { get: function () { return require('./secmaster-playbook'); } }); +Object.defineProperty(exports, 'secmasterPlaybookAction', { get: function () { return require('./secmaster-playbook-action'); } }); +Object.defineProperty(exports, 'secmasterPlaybookApproval', { get: function () { return require('./secmaster-playbook-approval'); } }); +Object.defineProperty(exports, 'secmasterPlaybookEnable', { get: function () { return require('./secmaster-playbook-enable'); } }); +Object.defineProperty(exports, 'secmasterPlaybookInstanceOperation', { get: function () { return require('./secmaster-playbook-instance-operation'); } }); +Object.defineProperty(exports, 'secmasterPlaybookRule', { get: function () { return require('./secmaster-playbook-rule'); } }); +Object.defineProperty(exports, 'secmasterPlaybookVersion', { get: function () { return require('./secmaster-playbook-version'); } }); +Object.defineProperty(exports, 'secmasterPlaybookVersionAction', { get: function () { return require('./secmaster-playbook-version-action'); } }); +Object.defineProperty(exports, 'servicestageApplication', { get: function () { return require('./servicestage-application'); } }); +Object.defineProperty(exports, 'servicestageComponent', { get: function () { return require('./servicestage-component'); } }); +Object.defineProperty(exports, 'servicestageComponentInstance', { get: function () { return require('./servicestage-component-instance'); } }); +Object.defineProperty(exports, 'servicestageEnvironment', { get: function () { return require('./servicestage-environment'); } }); +Object.defineProperty(exports, 'servicestageRepoPasswordAuthorization', { get: function () { return require('./servicestage-repo-password-authorization'); } }); +Object.defineProperty(exports, 'servicestageRepoTokenAuthorization', { get: function () { return require('./servicestage-repo-token-authorization'); } }); +Object.defineProperty(exports, 'servicestagev3Application', { get: function () { return require('./servicestagev3-application'); } }); +Object.defineProperty(exports, 'servicestagev3Component', { get: function () { return require('./servicestagev3-component'); } }); +Object.defineProperty(exports, 'servicestagev3Environment', { get: function () { return require('./servicestagev3-environment'); } }); +Object.defineProperty(exports, 'servicestagev3EnvironmentAssociate', { get: function () { return require('./servicestagev3-environment-associate'); } }); +Object.defineProperty(exports, 'sfsAccessRule', { get: function () { return require('./sfs-access-rule'); } }); +Object.defineProperty(exports, 'sfsAccessRuleV2', { get: function () { return require('./sfs-access-rule-v2'); } }); +Object.defineProperty(exports, 'sfsFileSystem', { get: function () { return require('./sfs-file-system'); } }); +Object.defineProperty(exports, 'sfsFileSystemV2', { get: function () { return require('./sfs-file-system-v2'); } }); +Object.defineProperty(exports, 'sfsTurbo', { get: function () { return require('./sfs-turbo'); } }); +Object.defineProperty(exports, 'sfsTurboDataTask', { get: function () { return require('./sfs-turbo-data-task'); } }); +Object.defineProperty(exports, 'sfsTurboDir', { get: function () { return require('./sfs-turbo-dir'); } }); +Object.defineProperty(exports, 'sfsTurboDirQuota', { get: function () { return require('./sfs-turbo-dir-quota'); } }); +Object.defineProperty(exports, 'sfsTurboDuTask', { get: function () { return require('./sfs-turbo-du-task'); } }); +Object.defineProperty(exports, 'sfsTurboObsTarget', { get: function () { return require('./sfs-turbo-obs-target'); } }); +Object.defineProperty(exports, 'sfsTurboPermRule', { get: function () { return require('./sfs-turbo-perm-rule'); } }); +Object.defineProperty(exports, 'smnLogtank', { get: function () { return require('./smn-logtank'); } }); +Object.defineProperty(exports, 'smnMessageDetection', { get: function () { return require('./smn-message-detection'); } }); +Object.defineProperty(exports, 'smnMessagePublish', { get: function () { return require('./smn-message-publish'); } }); +Object.defineProperty(exports, 'smnMessageTemplate', { get: function () { return require('./smn-message-template'); } }); +Object.defineProperty(exports, 'smnSubscription', { get: function () { return require('./smn-subscription'); } }); +Object.defineProperty(exports, 'smnSubscriptionFilterPolicy', { get: function () { return require('./smn-subscription-filter-policy'); } }); +Object.defineProperty(exports, 'smnSubscriptionV2', { get: function () { return require('./smn-subscription-v2'); } }); +Object.defineProperty(exports, 'smnTopic', { get: function () { return require('./smn-topic'); } }); +Object.defineProperty(exports, 'smnTopicV2', { get: function () { return require('./smn-topic-v2'); } }); +Object.defineProperty(exports, 'smsServerTemplate', { get: function () { return require('./sms-server-template'); } }); +Object.defineProperty(exports, 'smsTask', { get: function () { return require('./sms-task'); } }); +Object.defineProperty(exports, 'swrImageAutoSync', { get: function () { return require('./swr-image-auto-sync'); } }); +Object.defineProperty(exports, 'swrImagePermissions', { get: function () { return require('./swr-image-permissions'); } }); +Object.defineProperty(exports, 'swrImageRetentionPolicy', { get: function () { return require('./swr-image-retention-policy'); } }); +Object.defineProperty(exports, 'swrImageTrigger', { get: function () { return require('./swr-image-trigger'); } }); +Object.defineProperty(exports, 'swrOrganization', { get: function () { return require('./swr-organization'); } }); +Object.defineProperty(exports, 'swrOrganizationPermissions', { get: function () { return require('./swr-organization-permissions'); } }); +Object.defineProperty(exports, 'swrRepository', { get: function () { return require('./swr-repository'); } }); +Object.defineProperty(exports, 'swrRepositorySharing', { get: function () { return require('./swr-repository-sharing'); } }); +Object.defineProperty(exports, 'tmsResourceTags', { get: function () { return require('./tms-resource-tags'); } }); +Object.defineProperty(exports, 'tmsTags', { get: function () { return require('./tms-tags'); } }); +Object.defineProperty(exports, 'ucsCluster', { get: function () { return require('./ucs-cluster'); } }); +Object.defineProperty(exports, 'ucsFleet', { get: function () { return require('./ucs-fleet'); } }); +Object.defineProperty(exports, 'ucsPolicy', { get: function () { return require('./ucs-policy'); } }); +Object.defineProperty(exports, 'vbsBackup', { get: function () { return require('./vbs-backup'); } }); +Object.defineProperty(exports, 'vbsBackupPolicy', { get: function () { return require('./vbs-backup-policy'); } }); +Object.defineProperty(exports, 'vbsBackupPolicyV2', { get: function () { return require('./vbs-backup-policy-v2'); } }); +Object.defineProperty(exports, 'vbsBackupV2', { get: function () { return require('./vbs-backup-v2'); } }); +Object.defineProperty(exports, 'vodMediaAsset', { get: function () { return require('./vod-media-asset'); } }); +Object.defineProperty(exports, 'vodMediaCategory', { get: function () { return require('./vod-media-category'); } }); +Object.defineProperty(exports, 'vodTranscodingTemplateGroup', { get: function () { return require('./vod-transcoding-template-group'); } }); +Object.defineProperty(exports, 'vodWatermarkTemplate', { get: function () { return require('./vod-watermark-template'); } }); +Object.defineProperty(exports, 'vpc', { get: function () { return require('./vpc'); } }); +Object.defineProperty(exports, 'vpcAddressGroup', { get: function () { return require('./vpc-address-group'); } }); +Object.defineProperty(exports, 'vpcBandwidth', { get: function () { return require('./vpc-bandwidth'); } }); +Object.defineProperty(exports, 'vpcBandwidthAssociate', { get: function () { return require('./vpc-bandwidth-associate'); } }); +Object.defineProperty(exports, 'vpcBandwidthV2', { get: function () { return require('./vpc-bandwidth-v2'); } }); +Object.defineProperty(exports, 'vpcEip', { get: function () { return require('./vpc-eip'); } }); +Object.defineProperty(exports, 'vpcEipAssociate', { get: function () { return require('./vpc-eip-associate'); } }); +Object.defineProperty(exports, 'vpcEipV1', { get: function () { return require('./vpc-eip-v1'); } }); +Object.defineProperty(exports, 'vpcEipv3Associate', { get: function () { return require('./vpc-eipv3-associate'); } }); +Object.defineProperty(exports, 'vpcFlowLog', { get: function () { return require('./vpc-flow-log'); } }); +Object.defineProperty(exports, 'vpcInternetGateway', { get: function () { return require('./vpc-internet-gateway'); } }); +Object.defineProperty(exports, 'vpcNetworkAcl', { get: function () { return require('./vpc-network-acl'); } }); +Object.defineProperty(exports, 'vpcNetworkInterface', { get: function () { return require('./vpc-network-interface'); } }); +Object.defineProperty(exports, 'vpcPeeringConnection', { get: function () { return require('./vpc-peering-connection'); } }); +Object.defineProperty(exports, 'vpcPeeringConnectionAccepter', { get: function () { return require('./vpc-peering-connection-accepter'); } }); +Object.defineProperty(exports, 'vpcPeeringConnectionAccepterV2', { get: function () { return require('./vpc-peering-connection-accepter-v2'); } }); +Object.defineProperty(exports, 'vpcPeeringConnectionV2', { get: function () { return require('./vpc-peering-connection-v2'); } }); +Object.defineProperty(exports, 'vpcRoute', { get: function () { return require('./vpc-route'); } }); +Object.defineProperty(exports, 'vpcRouteTable', { get: function () { return require('./vpc-route-table'); } }); +Object.defineProperty(exports, 'vpcRouteV2', { get: function () { return require('./vpc-route-v2'); } }); +Object.defineProperty(exports, 'vpcSubNetworkInterface', { get: function () { return require('./vpc-sub-network-interface'); } }); +Object.defineProperty(exports, 'vpcSubnet', { get: function () { return require('./vpc-subnet'); } }); +Object.defineProperty(exports, 'vpcSubnetV1', { get: function () { return require('./vpc-subnet-v1'); } }); +Object.defineProperty(exports, 'vpcTrafficMirrorFilter', { get: function () { return require('./vpc-traffic-mirror-filter'); } }); +Object.defineProperty(exports, 'vpcTrafficMirrorFilterRule', { get: function () { return require('./vpc-traffic-mirror-filter-rule'); } }); +Object.defineProperty(exports, 'vpcTrafficMirrorSession', { get: function () { return require('./vpc-traffic-mirror-session'); } }); +Object.defineProperty(exports, 'vpcV1', { get: function () { return require('./vpc-v1'); } }); +Object.defineProperty(exports, 'vpcepApproval', { get: function () { return require('./vpcep-approval'); } }); +Object.defineProperty(exports, 'vpcepEndpoint', { get: function () { return require('./vpcep-endpoint'); } }); +Object.defineProperty(exports, 'vpcepService', { get: function () { return require('./vpcep-service'); } }); +Object.defineProperty(exports, 'vpnAccessPolicy', { get: function () { return require('./vpn-access-policy'); } }); +Object.defineProperty(exports, 'vpnClientCaCertificate', { get: function () { return require('./vpn-client-ca-certificate'); } }); +Object.defineProperty(exports, 'vpnConnection', { get: function () { return require('./vpn-connection'); } }); +Object.defineProperty(exports, 'vpnConnectionHealthCheck', { get: function () { return require('./vpn-connection-health-check'); } }); +Object.defineProperty(exports, 'vpnCustomerGateway', { get: function () { return require('./vpn-customer-gateway'); } }); +Object.defineProperty(exports, 'vpnGateway', { get: function () { return require('./vpn-gateway'); } }); +Object.defineProperty(exports, 'vpnUser', { get: function () { return require('./vpn-user'); } }); +Object.defineProperty(exports, 'vpnUserGroup', { get: function () { return require('./vpn-user-group'); } }); +Object.defineProperty(exports, 'vpnaasEndpointGroup', { get: function () { return require('./vpnaas-endpoint-group'); } }); +Object.defineProperty(exports, 'vpnaasEndpointGroupV2', { get: function () { return require('./vpnaas-endpoint-group-v2'); } }); +Object.defineProperty(exports, 'vpnaasIkePolicy', { get: function () { return require('./vpnaas-ike-policy'); } }); +Object.defineProperty(exports, 'vpnaasIkePolicyV2', { get: function () { return require('./vpnaas-ike-policy-v2'); } }); +Object.defineProperty(exports, 'vpnaasIpsecPolicy', { get: function () { return require('./vpnaas-ipsec-policy'); } }); +Object.defineProperty(exports, 'vpnaasIpsecPolicyV2', { get: function () { return require('./vpnaas-ipsec-policy-v2'); } }); +Object.defineProperty(exports, 'vpnaasService', { get: function () { return require('./vpnaas-service'); } }); +Object.defineProperty(exports, 'vpnaasServiceV2', { get: function () { return require('./vpnaas-service-v2'); } }); +Object.defineProperty(exports, 'vpnaasSiteConnection', { get: function () { return require('./vpnaas-site-connection'); } }); +Object.defineProperty(exports, 'vpnaasSiteConnectionV2', { get: function () { return require('./vpnaas-site-connection-v2'); } }); +Object.defineProperty(exports, 'wafAddressGroup', { get: function () { return require('./waf-address-group'); } }); +Object.defineProperty(exports, 'wafCertificate', { get: function () { return require('./waf-certificate'); } }); +Object.defineProperty(exports, 'wafCloudInstance', { get: function () { return require('./waf-cloud-instance'); } }); +Object.defineProperty(exports, 'wafDedicatedDomain', { get: function () { return require('./waf-dedicated-domain'); } }); +Object.defineProperty(exports, 'wafDedicatedInstance', { get: function () { return require('./waf-dedicated-instance'); } }); +Object.defineProperty(exports, 'wafDomain', { get: function () { return require('./waf-domain'); } }); +Object.defineProperty(exports, 'wafInstanceGroup', { get: function () { return require('./waf-instance-group'); } }); +Object.defineProperty(exports, 'wafInstanceGroupAssociate', { get: function () { return require('./waf-instance-group-associate'); } }); +Object.defineProperty(exports, 'wafPolicy', { get: function () { return require('./waf-policy'); } }); +Object.defineProperty(exports, 'wafReferenceTable', { get: function () { return require('./waf-reference-table'); } }); +Object.defineProperty(exports, 'wafRuleAntiCrawler', { get: function () { return require('./waf-rule-anti-crawler'); } }); +Object.defineProperty(exports, 'wafRuleBlacklist', { get: function () { return require('./waf-rule-blacklist'); } }); +Object.defineProperty(exports, 'wafRuleCcProtection', { get: function () { return require('./waf-rule-cc-protection'); } }); +Object.defineProperty(exports, 'wafRuleDataMasking', { get: function () { return require('./waf-rule-data-masking'); } }); +Object.defineProperty(exports, 'wafRuleGeolocationAccessControl', { get: function () { return require('./waf-rule-geolocation-access-control'); } }); +Object.defineProperty(exports, 'wafRuleGlobalProtectionWhitelist', { get: function () { return require('./waf-rule-global-protection-whitelist'); } }); +Object.defineProperty(exports, 'wafRuleInformationLeakagePrevention', { get: function () { return require('./waf-rule-information-leakage-prevention'); } }); +Object.defineProperty(exports, 'wafRuleKnownAttackSource', { get: function () { return require('./waf-rule-known-attack-source'); } }); +Object.defineProperty(exports, 'wafRulePreciseProtection', { get: function () { return require('./waf-rule-precise-protection'); } }); +Object.defineProperty(exports, 'wafRuleWebTamperProtection', { get: function () { return require('./waf-rule-web-tamper-protection'); } }); +Object.defineProperty(exports, 'workspaceAccessPolicy', { get: function () { return require('./workspace-access-policy'); } }); +Object.defineProperty(exports, 'workspaceAppGroup', { get: function () { return require('./workspace-app-group'); } }); +Object.defineProperty(exports, 'workspaceAppGroupAuthorization', { get: function () { return require('./workspace-app-group-authorization'); } }); +Object.defineProperty(exports, 'workspaceAppImage', { get: function () { return require('./workspace-app-image'); } }); +Object.defineProperty(exports, 'workspaceAppImageServer', { get: function () { return require('./workspace-app-image-server'); } }); +Object.defineProperty(exports, 'workspaceAppNasStorage', { get: function () { return require('./workspace-app-nas-storage'); } }); +Object.defineProperty(exports, 'workspaceAppPersonalFolders', { get: function () { return require('./workspace-app-personal-folders'); } }); +Object.defineProperty(exports, 'workspaceAppPolicyGroup', { get: function () { return require('./workspace-app-policy-group'); } }); +Object.defineProperty(exports, 'workspaceAppPublishment', { get: function () { return require('./workspace-app-publishment'); } }); +Object.defineProperty(exports, 'workspaceAppServer', { get: function () { return require('./workspace-app-server'); } }); +Object.defineProperty(exports, 'workspaceAppServerGroup', { get: function () { return require('./workspace-app-server-group'); } }); +Object.defineProperty(exports, 'workspaceAppSharedFolder', { get: function () { return require('./workspace-app-shared-folder'); } }); +Object.defineProperty(exports, 'workspaceAppStoragePolicy', { get: function () { return require('./workspace-app-storage-policy'); } }); +Object.defineProperty(exports, 'workspaceAppWarehouseApp', { get: function () { return require('./workspace-app-warehouse-app'); } }); +Object.defineProperty(exports, 'workspaceDesktop', { get: function () { return require('./workspace-desktop'); } }); +Object.defineProperty(exports, 'workspaceDesktopNameRule', { get: function () { return require('./workspace-desktop-name-rule'); } }); +Object.defineProperty(exports, 'workspaceEipAssociate', { get: function () { return require('./workspace-eip-associate'); } }); +Object.defineProperty(exports, 'workspacePolicyGroup', { get: function () { return require('./workspace-policy-group'); } }); +Object.defineProperty(exports, 'workspaceService', { get: function () { return require('./workspace-service'); } }); +Object.defineProperty(exports, 'workspaceTerminalBinding', { get: function () { return require('./workspace-terminal-binding'); } }); +Object.defineProperty(exports, 'workspaceUser', { get: function () { return require('./workspace-user'); } }); +Object.defineProperty(exports, 'workspaceUserGroup', { get: function () { return require('./workspace-user-group'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAccount', { get: function () { return require('./data-huaweicloud-account'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAntiddos', { get: function () { return require('./data-huaweicloud-antiddos'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAntiddosConfigRanges', { get: function () { return require('./data-huaweicloud-antiddos-config-ranges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAntiddosEipDefenseStatuses', { get: function () { return require('./data-huaweicloud-antiddos-eip-defense-statuses'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAntiddosV1', { get: function () { return require('./data-huaweicloud-antiddos-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAntiddosWeeklyProtectionStatistics', { get: function () { return require('./data-huaweicloud-antiddos-weekly-protection-statistics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomAggregationMetrics', { get: function () { return require('./data-huaweicloud-aom-aggregation-metrics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomAlarmActionRules', { get: function () { return require('./data-huaweicloud-aom-alarm-action-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomAlarmGroupRules', { get: function () { return require('./data-huaweicloud-aom-alarm-group-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomAlarmRules', { get: function () { return require('./data-huaweicloud-aom-alarm-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomAlarmRulesTemplates', { get: function () { return require('./data-huaweicloud-aom-alarm-rules-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomAlarmSilenceRules', { get: function () { return require('./data-huaweicloud-aom-alarm-silence-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomDashboards', { get: function () { return require('./data-huaweicloud-aom-dashboards'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomDashboardsFolders', { get: function () { return require('./data-huaweicloud-aom-dashboards-folders'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomMessageTemplates', { get: function () { return require('./data-huaweicloud-aom-message-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomMultiAccountAggregationRules', { get: function () { return require('./data-huaweicloud-aom-multi-account-aggregation-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomOrganizationAccounts', { get: function () { return require('./data-huaweicloud-aom-organization-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomPromInstances', { get: function () { return require('./data-huaweicloud-aom-prom-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAomServiceDiscoveryRules', { get: function () { return require('./data-huaweicloud-aom-service-discovery-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigAclPolicies', { get: function () { return require('./data-huaweicloud-apig-acl-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApi', { get: function () { return require('./data-huaweicloud-apig-api'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApiAssociatedAclPolicies', { get: function () { return require('./data-huaweicloud-apig-api-associated-acl-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApiAssociatedApplications', { get: function () { return require('./data-huaweicloud-apig-api-associated-applications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApiAssociatedPlugins', { get: function () { return require('./data-huaweicloud-apig-api-associated-plugins'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApiAssociatedSignatures', { get: function () { return require('./data-huaweicloud-apig-api-associated-signatures'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApiAssociatedThrottlingPolicies', { get: function () { return require('./data-huaweicloud-apig-api-associated-throttling-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApiBasicConfigurations', { get: function () { return require('./data-huaweicloud-apig-api-basic-configurations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigAppcodes', { get: function () { return require('./data-huaweicloud-apig-appcodes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApplicationAcl', { get: function () { return require('./data-huaweicloud-apig-application-acl'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApplicationQuotas', { get: function () { return require('./data-huaweicloud-apig-application-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigApplications', { get: function () { return require('./data-huaweicloud-apig-applications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigChannels', { get: function () { return require('./data-huaweicloud-apig-channels'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigCustomAuthorizers', { get: function () { return require('./data-huaweicloud-apig-custom-authorizers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigEndpointConnections', { get: function () { return require('./data-huaweicloud-apig-endpoint-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigEnvironmentVariables', { get: function () { return require('./data-huaweicloud-apig-environment-variables'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigEnvironments', { get: function () { return require('./data-huaweicloud-apig-environments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigGroups', { get: function () { return require('./data-huaweicloud-apig-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigInstanceFeatures', { get: function () { return require('./data-huaweicloud-apig-instance-features'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigInstanceSupportedFeatures', { get: function () { return require('./data-huaweicloud-apig-instance-supported-features'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigInstances', { get: function () { return require('./data-huaweicloud-apig-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigSignatures', { get: function () { return require('./data-huaweicloud-apig-signatures'); } }); +Object.defineProperty(exports, 'dataHuaweicloudApigThrottlingPolicies', { get: function () { return require('./data-huaweicloud-apig-throttling-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsActivityLogs', { get: function () { return require('./data-huaweicloud-as-activity-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsConfigurations', { get: function () { return require('./data-huaweicloud-as-configurations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsGroupQuotas', { get: function () { return require('./data-huaweicloud-as-group-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsGroups', { get: function () { return require('./data-huaweicloud-as-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsHookInstances', { get: function () { return require('./data-huaweicloud-as-hook-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsInstances', { get: function () { return require('./data-huaweicloud-as-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsLifecycleHooks', { get: function () { return require('./data-huaweicloud-as-lifecycle-hooks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsNotifications', { get: function () { return require('./data-huaweicloud-as-notifications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsPlannedTasks', { get: function () { return require('./data-huaweicloud-as-planned-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsPolicies', { get: function () { return require('./data-huaweicloud-as-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsPolicyExecuteLogs', { get: function () { return require('./data-huaweicloud-as-policy-execute-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAsQuotas', { get: function () { return require('./data-huaweicloud-as-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudAvailabilityZones', { get: function () { return require('./data-huaweicloud-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudBmsFlavors', { get: function () { return require('./data-huaweicloud-bms-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudBmsInstances', { get: function () { return require('./data-huaweicloud-bms-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCaeApplications', { get: function () { return require('./data-huaweicloud-cae-applications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCaeEnvironments', { get: function () { return require('./data-huaweicloud-cae-environments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCbhAvailabilityZones', { get: function () { return require('./data-huaweicloud-cbh-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCbhFlavors', { get: function () { return require('./data-huaweicloud-cbh-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCbhInstances', { get: function () { return require('./data-huaweicloud-cbh-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCbrBackup', { get: function () { return require('./data-huaweicloud-cbr-backup'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCbrPolicies', { get: function () { return require('./data-huaweicloud-cbr-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCbrVaults', { get: function () { return require('./data-huaweicloud-cbr-vaults'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcAuthorizations', { get: function () { return require('./data-huaweicloud-cc-authorizations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcBandwidthPackages', { get: function () { return require('./data-huaweicloud-cc-bandwidth-packages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworkAttachments', { get: function () { return require('./data-huaweicloud-cc-central-network-attachments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworkCapabilities', { get: function () { return require('./data-huaweicloud-cc-central-network-capabilities'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworkConnections', { get: function () { return require('./data-huaweicloud-cc-central-network-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworkPolicies', { get: function () { return require('./data-huaweicloud-cc-central-network-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworkPoliciesChangeSet', { get: function () { return require('./data-huaweicloud-cc-central-network-policies-change-set'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworkQuotas', { get: function () { return require('./data-huaweicloud-cc-central-network-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcCentralNetworks', { get: function () { return require('./data-huaweicloud-cc-central-networks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcConnectionRoutes', { get: function () { return require('./data-huaweicloud-cc-connection-routes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcConnectionTags', { get: function () { return require('./data-huaweicloud-cc-connection-tags'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcConnections', { get: function () { return require('./data-huaweicloud-cc-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcGlobalConnectionBandwidthLineLevels', { get: function () { return require('./data-huaweicloud-cc-global-connection-bandwidth-line-levels'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcGlobalConnectionBandwidthSites', { get: function () { return require('./data-huaweicloud-cc-global-connection-bandwidth-sites'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcGlobalConnectionBandwidthSpecCodes', { get: function () { return require('./data-huaweicloud-cc-global-connection-bandwidth-spec-codes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcGlobalConnectionBandwidths', { get: function () { return require('./data-huaweicloud-cc-global-connection-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcInterRegionBandwidths', { get: function () { return require('./data-huaweicloud-cc-inter-region-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcNetworkInstances', { get: function () { return require('./data-huaweicloud-cc-network-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcPermissions', { get: function () { return require('./data-huaweicloud-cc-permissions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcSupportBindingGlobalConnectionBandwidths', { get: function () { return require('./data-huaweicloud-cc-support-binding-global-connection-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceAddonTemplate', { get: function () { return require('./data-huaweicloud-cce-addon-template'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceCluster', { get: function () { return require('./data-huaweicloud-cce-cluster'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceClusterCertificate', { get: function () { return require('./data-huaweicloud-cce-cluster-certificate'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceClusterOpenidJwks', { get: function () { return require('./data-huaweicloud-cce-cluster-openid-jwks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceClusterV3', { get: function () { return require('./data-huaweicloud-cce-cluster-v3'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceClusters', { get: function () { return require('./data-huaweicloud-cce-clusters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceNode', { get: function () { return require('./data-huaweicloud-cce-node'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceNodePool', { get: function () { return require('./data-huaweicloud-cce-node-pool'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceNodeV3', { get: function () { return require('./data-huaweicloud-cce-node-v3'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCceNodes', { get: function () { return require('./data-huaweicloud-cce-nodes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCciNamespaces', { get: function () { return require('./data-huaweicloud-cci-namespaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcmCertificateExport', { get: function () { return require('./data-huaweicloud-ccm-certificate-export'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcmCertificates', { get: function () { return require('./data-huaweicloud-ccm-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcmPrivateCaExport', { get: function () { return require('./data-huaweicloud-ccm-private-ca-export'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcmPrivateCas', { get: function () { return require('./data-huaweicloud-ccm-private-cas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcmPrivateCertificateExport', { get: function () { return require('./data-huaweicloud-ccm-private-certificate-export'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCcmPrivateCertificates', { get: function () { return require('./data-huaweicloud-ccm-private-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdmClusters', { get: function () { return require('./data-huaweicloud-cdm-clusters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdmFlavors', { get: function () { return require('./data-huaweicloud-cdm-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdmFlavorsV1', { get: function () { return require('./data-huaweicloud-cdm-flavors-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdmJobExecutionRecords', { get: function () { return require('./data-huaweicloud-cdm-job-execution-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnAnalytics', { get: function () { return require('./data-huaweicloud-cdn-analytics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnBillingOption', { get: function () { return require('./data-huaweicloud-cdn-billing-option'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnCacheHistoryTasks', { get: function () { return require('./data-huaweicloud-cdn-cache-history-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnCacheUrlTasks', { get: function () { return require('./data-huaweicloud-cdn-cache-url-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnDomainCertificates', { get: function () { return require('./data-huaweicloud-cdn-domain-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnDomainStatistics', { get: function () { return require('./data-huaweicloud-cdn-domain-statistics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnDomains', { get: function () { return require('./data-huaweicloud-cdn-domains'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCdnLogs', { get: function () { return require('./data-huaweicloud-cdn-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesAgentDimensions', { get: function () { return require('./data-huaweicloud-ces-agent-dimensions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesAlarmTemplates', { get: function () { return require('./data-huaweicloud-ces-alarm-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesAlarmrules', { get: function () { return require('./data-huaweicloud-ces-alarmrules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesDashboardWidgets', { get: function () { return require('./data-huaweicloud-ces-dashboard-widgets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesDashboards', { get: function () { return require('./data-huaweicloud-ces-dashboards'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesEventDetails', { get: function () { return require('./data-huaweicloud-ces-event-details'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesEvents', { get: function () { return require('./data-huaweicloud-ces-events'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesMetrics', { get: function () { return require('./data-huaweicloud-ces-metrics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesOneClickAlarmRules', { get: function () { return require('./data-huaweicloud-ces-one-click-alarm-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesOneClickAlarms', { get: function () { return require('./data-huaweicloud-ces-one-click-alarms'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesResourceGroupServiceResources', { get: function () { return require('./data-huaweicloud-ces-resource-group-service-resources'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCesResourceGroups', { get: function () { return require('./data-huaweicloud-ces-resource-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwAccessControlLogs', { get: function () { return require('./data-huaweicloud-cfw-access-control-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwAddressGroupMembers', { get: function () { return require('./data-huaweicloud-cfw-address-group-members'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwAddressGroups', { get: function () { return require('./data-huaweicloud-cfw-address-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwAttackLogs', { get: function () { return require('./data-huaweicloud-cfw-attack-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwBlackWhiteLists', { get: function () { return require('./data-huaweicloud-cfw-black-white-lists'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwCaptureTaskResults', { get: function () { return require('./data-huaweicloud-cfw-capture-task-results'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwCaptureTasks', { get: function () { return require('./data-huaweicloud-cfw-capture-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwDomainNameGroups', { get: function () { return require('./data-huaweicloud-cfw-domain-name-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwFirewalls', { get: function () { return require('./data-huaweicloud-cfw-firewalls'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwFlowLogs', { get: function () { return require('./data-huaweicloud-cfw-flow-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwProtectionRules', { get: function () { return require('./data-huaweicloud-cfw-protection-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwServiceGroupMembers', { get: function () { return require('./data-huaweicloud-cfw-service-group-members'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCfwServiceGroups', { get: function () { return require('./data-huaweicloud-cfw-service-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCnadAdvancedAvailableObjects', { get: function () { return require('./data-huaweicloud-cnad-advanced-available-objects'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCnadAdvancedInstances', { get: function () { return require('./data-huaweicloud-cnad-advanced-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCnadAdvancedProtectedObjects', { get: function () { return require('./data-huaweicloud-cnad-advanced-protected-objects'); } }); +Object.defineProperty(exports, 'dataHuaweicloudComputeAvailabilityZonesV2', { get: function () { return require('./data-huaweicloud-compute-availability-zones-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudComputeFlavors', { get: function () { return require('./data-huaweicloud-compute-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudComputeInstance', { get: function () { return require('./data-huaweicloud-compute-instance'); } }); +Object.defineProperty(exports, 'dataHuaweicloudComputeInstanceRemoteConsole', { get: function () { return require('./data-huaweicloud-compute-instance-remote-console'); } }); +Object.defineProperty(exports, 'dataHuaweicloudComputeInstances', { get: function () { return require('./data-huaweicloud-compute-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudComputeServergroups', { get: function () { return require('./data-huaweicloud-compute-servergroups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphEncodeServers', { get: function () { return require('./data-huaweicloud-cph-encode-servers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphPhoneCustomImages', { get: function () { return require('./data-huaweicloud-cph-phone-custom-images'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphPhoneFlavors', { get: function () { return require('./data-huaweicloud-cph-phone-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphPhoneImages', { get: function () { return require('./data-huaweicloud-cph-phone-images'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphPhones', { get: function () { return require('./data-huaweicloud-cph-phones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphServerBandwidths', { get: function () { return require('./data-huaweicloud-cph-server-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphServerFlavors', { get: function () { return require('./data-huaweicloud-cph-server-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCphServers', { get: function () { return require('./data-huaweicloud-cph-servers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsbsBackup', { get: function () { return require('./data-huaweicloud-csbs-backup'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsbsBackupPolicy', { get: function () { return require('./data-huaweicloud-csbs-backup-policy'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsbsBackupPolicyV1', { get: function () { return require('./data-huaweicloud-csbs-backup-policy-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsbsBackupV1', { get: function () { return require('./data-huaweicloud-csbs-backup-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCseMicroserviceEngineFlavors', { get: function () { return require('./data-huaweicloud-cse-microservice-engine-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCseMicroserviceEngines', { get: function () { return require('./data-huaweicloud-cse-microservice-engines'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsmsEvents', { get: function () { return require('./data-huaweicloud-csms-events'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsmsSecretVersion', { get: function () { return require('./data-huaweicloud-csms-secret-version'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsmsSecretVersions', { get: function () { return require('./data-huaweicloud-csms-secret-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCsmsSecrets', { get: function () { return require('./data-huaweicloud-csms-secrets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssClusterTags', { get: function () { return require('./data-huaweicloud-css-cluster-tags'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssClusters', { get: function () { return require('./data-huaweicloud-css-clusters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssElbLoadbalancers', { get: function () { return require('./data-huaweicloud-css-elb-loadbalancers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssFlavors', { get: function () { return require('./data-huaweicloud-css-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssLogBackupRecords', { get: function () { return require('./data-huaweicloud-css-log-backup-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssLogstashCertificates', { get: function () { return require('./data-huaweicloud-css-logstash-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssLogstashConfigurations', { get: function () { return require('./data-huaweicloud-css-logstash-configurations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssLogstashPipelineActions', { get: function () { return require('./data-huaweicloud-css-logstash-pipeline-actions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssLogstashPipelines', { get: function () { return require('./data-huaweicloud-css-logstash-pipelines'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssLogstashTemplates', { get: function () { return require('./data-huaweicloud-css-logstash-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssScanTasks', { get: function () { return require('./data-huaweicloud-css-scan-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssSnapshots', { get: function () { return require('./data-huaweicloud-css-snapshots'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCssUpgradeTargetImages', { get: function () { return require('./data-huaweicloud-css-upgrade-target-images'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCtsNotifications', { get: function () { return require('./data-huaweicloud-cts-notifications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCtsTraces', { get: function () { return require('./data-huaweicloud-cts-traces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCtsTracker', { get: function () { return require('./data-huaweicloud-cts-tracker'); } }); +Object.defineProperty(exports, 'dataHuaweicloudCtsTrackers', { get: function () { return require('./data-huaweicloud-cts-trackers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsArchitectureDsTemplateOptionals', { get: function () { return require('./data-huaweicloud-dataarts-architecture-ds-template-optionals'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsArchitectureModelStatistic', { get: function () { return require('./data-huaweicloud-dataarts-architecture-model-statistic'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsArchitectureTableModels', { get: function () { return require('./data-huaweicloud-dataarts-architecture-table-models'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsDataserviceApis', { get: function () { return require('./data-huaweicloud-dataarts-dataservice-apis'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsDataserviceApps', { get: function () { return require('./data-huaweicloud-dataarts-dataservice-apps'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsDataserviceAuthorizedApps', { get: function () { return require('./data-huaweicloud-dataarts-dataservice-authorized-apps'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsDataserviceInstances', { get: function () { return require('./data-huaweicloud-dataarts-dataservice-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsDataserviceMessages', { get: function () { return require('./data-huaweicloud-dataarts-dataservice-messages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsFactoryJobs', { get: function () { return require('./data-huaweicloud-dataarts-factory-jobs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsQualityTasks', { get: function () { return require('./data-huaweicloud-dataarts-quality-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsStudioDataConnections', { get: function () { return require('./data-huaweicloud-dataarts-studio-data-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDataartsStudioWorkspaces', { get: function () { return require('./data-huaweicloud-dataarts-studio-workspaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssAuditDataMaskingRules', { get: function () { return require('./data-huaweicloud-dbss-audit-data-masking-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssAuditRiskRules', { get: function () { return require('./data-huaweicloud-dbss-audit-risk-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssAuditRuleScopes', { get: function () { return require('./data-huaweicloud-dbss-audit-rule-scopes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssAuditSqlInjectionRules', { get: function () { return require('./data-huaweicloud-dbss-audit-sql-injection-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssAvailabilityZones', { get: function () { return require('./data-huaweicloud-dbss-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssDatabases', { get: function () { return require('./data-huaweicloud-dbss-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssFlavors', { get: function () { return require('./data-huaweicloud-dbss-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssInstances', { get: function () { return require('./data-huaweicloud-dbss-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssOperationLogs', { get: function () { return require('./data-huaweicloud-dbss-operation-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDbssRdsDatabases', { get: function () { return require('./data-huaweicloud-dbss-rds-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcConnections', { get: function () { return require('./data-huaweicloud-dc-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcQuotas', { get: function () { return require('./data-huaweicloud-dc-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcVirtualGateways', { get: function () { return require('./data-huaweicloud-dc-virtual-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcVirtualInterfaces', { get: function () { return require('./data-huaweicloud-dc-virtual-interfaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsAccounts', { get: function () { return require('./data-huaweicloud-dcs-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsAz', { get: function () { return require('./data-huaweicloud-dcs-az'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsAzV1', { get: function () { return require('./data-huaweicloud-dcs-az-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsBackups', { get: function () { return require('./data-huaweicloud-dcs-backups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsBigkeyAnalyses', { get: function () { return require('./data-huaweicloud-dcs-bigkey-analyses'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsDiagnosisTasks', { get: function () { return require('./data-huaweicloud-dcs-diagnosis-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsFlavors', { get: function () { return require('./data-huaweicloud-dcs-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsHotkeyAnalyses', { get: function () { return require('./data-huaweicloud-dcs-hotkey-analyses'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsInstances', { get: function () { return require('./data-huaweicloud-dcs-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsMaintainwindow', { get: function () { return require('./data-huaweicloud-dcs-maintainwindow'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsMaintainwindowV1', { get: function () { return require('./data-huaweicloud-dcs-maintainwindow-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsProduct', { get: function () { return require('./data-huaweicloud-dcs-product'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsProductV1', { get: function () { return require('./data-huaweicloud-dcs-product-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsTemplateDetail', { get: function () { return require('./data-huaweicloud-dcs-template-detail'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDcsTemplates', { get: function () { return require('./data-huaweicloud-dcs-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmAccounts', { get: function () { return require('./data-huaweicloud-ddm-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmEngines', { get: function () { return require('./data-huaweicloud-ddm-engines'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmFlavors', { get: function () { return require('./data-huaweicloud-ddm-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmInstanceAvailableVersions', { get: function () { return require('./data-huaweicloud-ddm-instance-available-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmInstanceGroups', { get: function () { return require('./data-huaweicloud-ddm-instance-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmInstanceNodes', { get: function () { return require('./data-huaweicloud-ddm-instance-nodes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmInstances', { get: function () { return require('./data-huaweicloud-ddm-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmKillingSessionsAuditLogs', { get: function () { return require('./data-huaweicloud-ddm-killing-sessions-audit-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmLogicalSessions', { get: function () { return require('./data-huaweicloud-ddm-logical-sessions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmPhysicalSessions', { get: function () { return require('./data-huaweicloud-ddm-physical-sessions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdmSchemas', { get: function () { return require('./data-huaweicloud-ddm-schemas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsAuditLogLinks', { get: function () { return require('./data-huaweicloud-dds-audit-log-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsAuditLogs', { get: function () { return require('./data-huaweicloud-dds-audit-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsBackupDownloadLinks', { get: function () { return require('./data-huaweicloud-dds-backup-download-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsBackups', { get: function () { return require('./data-huaweicloud-dds-backups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsDatabaseRoles', { get: function () { return require('./data-huaweicloud-dds-database-roles'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsDatabaseUsers', { get: function () { return require('./data-huaweicloud-dds-database-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsDatabaseVersions', { get: function () { return require('./data-huaweicloud-dds-database-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsDatabases', { get: function () { return require('./data-huaweicloud-dds-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsErrorLogLinks', { get: function () { return require('./data-huaweicloud-dds-error-log-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsErrorLogs', { get: function () { return require('./data-huaweicloud-dds-error-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsFlavors', { get: function () { return require('./data-huaweicloud-dds-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsFlavorsV3', { get: function () { return require('./data-huaweicloud-dds-flavors-v3'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsInstances', { get: function () { return require('./data-huaweicloud-dds-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsInstantTasks', { get: function () { return require('./data-huaweicloud-dds-instant-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsMigrateAvailabilityZones', { get: function () { return require('./data-huaweicloud-dds-migrate-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsParameterTemplates', { get: function () { return require('./data-huaweicloud-dds-parameter-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsPtApplicableInstances', { get: function () { return require('./data-huaweicloud-dds-pt-applicable-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsPtApplicationRecords', { get: function () { return require('./data-huaweicloud-dds-pt-application-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsPtModificationRecords', { get: function () { return require('./data-huaweicloud-dds-pt-modification-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsQuotas', { get: function () { return require('./data-huaweicloud-dds-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsRecycleInstances', { get: function () { return require('./data-huaweicloud-dds-recycle-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsRestoreCollections', { get: function () { return require('./data-huaweicloud-dds-restore-collections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsRestoreDatabases', { get: function () { return require('./data-huaweicloud-dds-restore-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsRestoreTimeRanges', { get: function () { return require('./data-huaweicloud-dds-restore-time-ranges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsScheduledTasks', { get: function () { return require('./data-huaweicloud-dds-scheduled-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsSlowLogLinks', { get: function () { return require('./data-huaweicloud-dds-slow-log-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsSlowLogs', { get: function () { return require('./data-huaweicloud-dds-slow-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsSslCertDownloadLinks', { get: function () { return require('./data-huaweicloud-dds-ssl-cert-download-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDdsStorageTypes', { get: function () { return require('./data-huaweicloud-dds-storage-types'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliDatasourceAuths', { get: function () { return require('./data-huaweicloud-dli-datasource-auths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliDatasourceConnections', { get: function () { return require('./data-huaweicloud-dli-datasource-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliElasticResourcePools', { get: function () { return require('./data-huaweicloud-dli-elastic-resource-pools'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliFlinkTemplates', { get: function () { return require('./data-huaweicloud-dli-flink-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliFlinkjarJobs', { get: function () { return require('./data-huaweicloud-dli-flinkjar-jobs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliFlinksqlJobs', { get: function () { return require('./data-huaweicloud-dli-flinksql-jobs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliQuotas', { get: function () { return require('./data-huaweicloud-dli-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliSparkTemplates', { get: function () { return require('./data-huaweicloud-dli-spark-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliSqlJobs', { get: function () { return require('./data-huaweicloud-dli-sql-jobs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDliSqlTemplates', { get: function () { return require('./data-huaweicloud-dli-sql-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsAz', { get: function () { return require('./data-huaweicloud-dms-az'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsAzV1', { get: function () { return require('./data-huaweicloud-dms-az-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaBackgroundTasks', { get: function () { return require('./data-huaweicloud-dms-kafka-background-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaConsumerGroups', { get: function () { return require('./data-huaweicloud-dms-kafka-consumer-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaExtendFlavors', { get: function () { return require('./data-huaweicloud-dms-kafka-extend-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaFlavors', { get: function () { return require('./data-huaweicloud-dms-kafka-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaInstances', { get: function () { return require('./data-huaweicloud-dms-kafka-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaMessageDiagnosisTasks', { get: function () { return require('./data-huaweicloud-dms-kafka-message-diagnosis-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaMessages', { get: function () { return require('./data-huaweicloud-dms-kafka-messages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaSmartConnectTasks', { get: function () { return require('./data-huaweicloud-dms-kafka-smart-connect-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaTopicPartitions', { get: function () { return require('./data-huaweicloud-dms-kafka-topic-partitions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaTopicProducers', { get: function () { return require('./data-huaweicloud-dms-kafka-topic-producers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaTopics', { get: function () { return require('./data-huaweicloud-dms-kafka-topics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaUserClientQuotas', { get: function () { return require('./data-huaweicloud-dms-kafka-user-client-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkaUsers', { get: function () { return require('./data-huaweicloud-dms-kafka-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsKafkav2SmartConnectTasks', { get: function () { return require('./data-huaweicloud-dms-kafkav2-smart-connect-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsMaintainwindow', { get: function () { return require('./data-huaweicloud-dms-maintainwindow'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsMaintainwindowV1', { get: function () { return require('./data-huaweicloud-dms-maintainwindow-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsProduct', { get: function () { return require('./data-huaweicloud-dms-product'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsProductV1', { get: function () { return require('./data-huaweicloud-dms-product-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqBackgroundTasks', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-background-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqExchanges', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-exchanges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqExtendFlavors', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-extend-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqFlavors', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqInstances', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqPlugins', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-plugins'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqQueues', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-queues'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqUsers', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRabbitmqVhosts', { get: function () { return require('./data-huaweicloud-dms-rabbitmq-vhosts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqBroker', { get: function () { return require('./data-huaweicloud-dms-rocketmq-broker'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqConsumerGroupAccessUsers', { get: function () { return require('./data-huaweicloud-dms-rocketmq-consumer-group-access-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqConsumerGroups', { get: function () { return require('./data-huaweicloud-dms-rocketmq-consumer-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqConsumers', { get: function () { return require('./data-huaweicloud-dms-rocketmq-consumers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqExtendFlavors', { get: function () { return require('./data-huaweicloud-dms-rocketmq-extend-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqFlavors', { get: function () { return require('./data-huaweicloud-dms-rocketmq-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqInstances', { get: function () { return require('./data-huaweicloud-dms-rocketmq-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqMessageTraces', { get: function () { return require('./data-huaweicloud-dms-rocketmq-message-traces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqMessages', { get: function () { return require('./data-huaweicloud-dms-rocketmq-messages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqMigrationTasks', { get: function () { return require('./data-huaweicloud-dms-rocketmq-migration-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqTopicAccessUsers', { get: function () { return require('./data-huaweicloud-dms-rocketmq-topic-access-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqTopicConsumerGroups', { get: function () { return require('./data-huaweicloud-dms-rocketmq-topic-consumer-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqTopics', { get: function () { return require('./data-huaweicloud-dms-rocketmq-topics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDmsRocketmqUsers', { get: function () { return require('./data-huaweicloud-dms-rocketmq-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsCustomLines', { get: function () { return require('./data-huaweicloud-dns-custom-lines'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsFloatingPtrrecords', { get: function () { return require('./data-huaweicloud-dns-floating-ptrrecords'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsLineGroups', { get: function () { return require('./data-huaweicloud-dns-line-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsNameservers', { get: function () { return require('./data-huaweicloud-dns-nameservers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsQuotas', { get: function () { return require('./data-huaweicloud-dns-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsRecordsets', { get: function () { return require('./data-huaweicloud-dns-recordsets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDnsZones', { get: function () { return require('./data-huaweicloud-dns-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDrsAvailabilityZones', { get: function () { return require('./data-huaweicloud-drs-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDrsNodeTypes', { get: function () { return require('./data-huaweicloud-drs-node-types'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsAlarmSubscriptions', { get: function () { return require('./data-huaweicloud-dws-alarm-subscriptions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsAvailabilityZones', { get: function () { return require('./data-huaweicloud-dws-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusterCns', { get: function () { return require('./data-huaweicloud-dws-cluster-cns'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusterLogs', { get: function () { return require('./data-huaweicloud-dws-cluster-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusterNodes', { get: function () { return require('./data-huaweicloud-dws-cluster-nodes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusterParameters', { get: function () { return require('./data-huaweicloud-dws-cluster-parameters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusterSnapshotStatistics', { get: function () { return require('./data-huaweicloud-dws-cluster-snapshot-statistics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusterTopoRings', { get: function () { return require('./data-huaweicloud-dws-cluster-topo-rings'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsClusters', { get: function () { return require('./data-huaweicloud-dws-clusters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsDisasterRecoveryTasks', { get: function () { return require('./data-huaweicloud-dws-disaster-recovery-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsEventSubscriptions', { get: function () { return require('./data-huaweicloud-dws-event-subscriptions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsFlavors', { get: function () { return require('./data-huaweicloud-dws-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsLogicalClusterRings', { get: function () { return require('./data-huaweicloud-dws-logical-cluster-rings'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsLogicalClusterVolumes', { get: function () { return require('./data-huaweicloud-dws-logical-cluster-volumes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsLogicalClusters', { get: function () { return require('./data-huaweicloud-dws-logical-clusters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsOmAccountConfiguration', { get: function () { return require('./data-huaweicloud-dws-om-account-configuration'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsQuotas', { get: function () { return require('./data-huaweicloud-dws-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsSnapshotPolicies', { get: function () { return require('./data-huaweicloud-dws-snapshot-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsSnapshots', { get: function () { return require('./data-huaweicloud-dws-snapshots'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsStatistics', { get: function () { return require('./data-huaweicloud-dws-statistics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsWorkloadPlans', { get: function () { return require('./data-huaweicloud-dws-workload-plans'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsWorkloadQueueAssociatedUsers', { get: function () { return require('./data-huaweicloud-dws-workload-queue-associated-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudDwsWorkloadQueues', { get: function () { return require('./data-huaweicloud-dws-workload-queues'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEgCustomEventChannels', { get: function () { return require('./data-huaweicloud-eg-custom-event-channels'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEgCustomEventSources', { get: function () { return require('./data-huaweicloud-eg-custom-event-sources'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEgEventChannels', { get: function () { return require('./data-huaweicloud-eg-event-channels'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEgEventSources', { get: function () { return require('./data-huaweicloud-eg-event-sources'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbActiveStandbyPools', { get: function () { return require('./data-huaweicloud-elb-active-standby-pools'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbCertificate', { get: function () { return require('./data-huaweicloud-elb-certificate'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbFlavors', { get: function () { return require('./data-huaweicloud-elb-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbIpgroups', { get: function () { return require('./data-huaweicloud-elb-ipgroups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbL7Policies', { get: function () { return require('./data-huaweicloud-elb-l7policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbL7Rules', { get: function () { return require('./data-huaweicloud-elb-l7rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbListeners', { get: function () { return require('./data-huaweicloud-elb-listeners'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbLoadbalancers', { get: function () { return require('./data-huaweicloud-elb-loadbalancers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbLogtanks', { get: function () { return require('./data-huaweicloud-elb-logtanks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbMembers', { get: function () { return require('./data-huaweicloud-elb-members'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbMonitors', { get: function () { return require('./data-huaweicloud-elb-monitors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbPools', { get: function () { return require('./data-huaweicloud-elb-pools'); } }); +Object.defineProperty(exports, 'dataHuaweicloudElbSecurityPolicies', { get: function () { return require('./data-huaweicloud-elb-security-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEnterpriseProject', { get: function () { return require('./data-huaweicloud-enterprise-project'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEnterpriseProjects', { get: function () { return require('./data-huaweicloud-enterprise-projects'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErAssociations', { get: function () { return require('./data-huaweicloud-er-associations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErAttachments', { get: function () { return require('./data-huaweicloud-er-attachments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErAvailabilityZones', { get: function () { return require('./data-huaweicloud-er-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErAvailableRoutes', { get: function () { return require('./data-huaweicloud-er-available-routes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErFlowLogs', { get: function () { return require('./data-huaweicloud-er-flow-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErInstances', { get: function () { return require('./data-huaweicloud-er-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErPropagations', { get: function () { return require('./data-huaweicloud-er-propagations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErQuotas', { get: function () { return require('./data-huaweicloud-er-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudErRouteTables', { get: function () { return require('./data-huaweicloud-er-route-tables'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEvsAvailabilityZones', { get: function () { return require('./data-huaweicloud-evs-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEvsSnapshots', { get: function () { return require('./data-huaweicloud-evs-snapshots'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEvsVolumeTransfers', { get: function () { return require('./data-huaweicloud-evs-volume-transfers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEvsVolumeTypes', { get: function () { return require('./data-huaweicloud-evs-volume-types'); } }); +Object.defineProperty(exports, 'dataHuaweicloudEvsVolumes', { get: function () { return require('./data-huaweicloud-evs-volumes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsApplicationTemplates', { get: function () { return require('./data-huaweicloud-fgs-application-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsApplications', { get: function () { return require('./data-huaweicloud-fgs-applications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsDependencies', { get: function () { return require('./data-huaweicloud-fgs-dependencies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsDependencyVersions', { get: function () { return require('./data-huaweicloud-fgs-dependency-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsFunctionEvents', { get: function () { return require('./data-huaweicloud-fgs-function-events'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsFunctionTriggers', { get: function () { return require('./data-huaweicloud-fgs-function-triggers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsFunctions', { get: function () { return require('./data-huaweicloud-fgs-functions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudFgsQuotas', { get: function () { return require('./data-huaweicloud-fgs-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaAccelerators', { get: function () { return require('./data-huaweicloud-ga-accelerators'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaAddressGroups', { get: function () { return require('./data-huaweicloud-ga-address-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaAvailabilityZones', { get: function () { return require('./data-huaweicloud-ga-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaEndpointGroups', { get: function () { return require('./data-huaweicloud-ga-endpoint-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaEndpoints', { get: function () { return require('./data-huaweicloud-ga-endpoints'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaHealthChecks', { get: function () { return require('./data-huaweicloud-ga-health-checks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaListeners', { get: function () { return require('./data-huaweicloud-ga-listeners'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbCassandraDedicatedResource', { get: function () { return require('./data-huaweicloud-gaussdb-cassandra-dedicated-resource'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbCassandraFlavors', { get: function () { return require('./data-huaweicloud-gaussdb-cassandra-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbCassandraInstance', { get: function () { return require('./data-huaweicloud-gaussdb-cassandra-instance'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbCassandraInstances', { get: function () { return require('./data-huaweicloud-gaussdb-cassandra-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbInfluxInstances', { get: function () { return require('./data-huaweicloud-gaussdb-influx-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlAuditLogDownloadLinks', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-audit-log-download-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlAutoScalingRecords', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-auto-scaling-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlBackups', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-backups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlConfiguration', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-configuration'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlConfigurations', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-configurations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlDatabaseCharacterSet', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-database-character-set'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlDatabases', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlDedicatedResource', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-dedicated-resource'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlDiagnosisInstances', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-diagnosis-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlDiagnosisStatistics', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-diagnosis-statistics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlEngineVersions', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-engine-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlErrorLogs', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-error-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlFlavors', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlIncrementalBackups', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-incremental-backups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlInstance', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-instance'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlInstances', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlInstantTasks', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-instant-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlProjectQuotas', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-project-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlProxies', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-proxies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlProxyFlavors', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-proxy-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlPtApplicableInstances', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-pt-applicable-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlPtApplyRecords', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-pt-apply-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlPtModifyRecords', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-pt-modify-records'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlRecyclingInstances', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-recycling-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlRestoreTimeRanges', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-restore-time-ranges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlRestoredTables', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-restored-tables'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlScheduledTasks', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-scheduled-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbMysqlSlowLogs', { get: function () { return require('./data-huaweicloud-gaussdb-mysql-slow-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbNosqlFlavors', { get: function () { return require('./data-huaweicloud-gaussdb-nosql-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbOpengaussInstance', { get: function () { return require('./data-huaweicloud-gaussdb-opengauss-instance'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbOpengaussInstances', { get: function () { return require('./data-huaweicloud-gaussdb-opengauss-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbRedisFlavors', { get: function () { return require('./data-huaweicloud-gaussdb-redis-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGaussdbRedisInstance', { get: function () { return require('./data-huaweicloud-gaussdb-redis-instance'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGlobalEipAccessSites', { get: function () { return require('./data-huaweicloud-global-eip-access-sites'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGlobalEipPools', { get: function () { return require('./data-huaweicloud-global-eip-pools'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGlobalEips', { get: function () { return require('./data-huaweicloud-global-eips'); } }); +Object.defineProperty(exports, 'dataHuaweicloudGlobalInternetBandwidths', { get: function () { return require('./data-huaweicloud-global-internet-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudHssHostGroups', { get: function () { return require('./data-huaweicloud-hss-host-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudHssHosts', { get: function () { return require('./data-huaweicloud-hss-hosts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudHssQuotas', { get: function () { return require('./data-huaweicloud-hss-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudHssRansomwareProtectionPolicies', { get: function () { return require('./data-huaweicloud-hss-ransomware-protection-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudHssWebtamperHosts', { get: function () { return require('./data-huaweicloud-hss-webtamper-hosts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityAgencies', { get: function () { return require('./data-huaweicloud-identity-agencies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityCustomRole', { get: function () { return require('./data-huaweicloud-identity-custom-role'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityGroup', { get: function () { return require('./data-huaweicloud-identity-group'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityPermissions', { get: function () { return require('./data-huaweicloud-identity-permissions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityProjects', { get: function () { return require('./data-huaweicloud-identity-projects'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityProviders', { get: function () { return require('./data-huaweicloud-identity-providers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityRole', { get: function () { return require('./data-huaweicloud-identity-role'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityRoleV3', { get: function () { return require('./data-huaweicloud-identity-role-v3'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityUsers', { get: function () { return require('./data-huaweicloud-identity-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentityVirtualMfaDevices', { get: function () { return require('./data-huaweicloud-identity-virtual-mfa-devices'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentitycenterGroups', { get: function () { return require('./data-huaweicloud-identitycenter-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentitycenterInstance', { get: function () { return require('./data-huaweicloud-identitycenter-instance'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIdentitycenterUsers', { get: function () { return require('./data-huaweicloud-identitycenter-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecBandwidths', { get: function () { return require('./data-huaweicloud-iec-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecEips', { get: function () { return require('./data-huaweicloud-iec-eips'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecFlavors', { get: function () { return require('./data-huaweicloud-iec-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecImages', { get: function () { return require('./data-huaweicloud-iec-images'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecKeypair', { get: function () { return require('./data-huaweicloud-iec-keypair'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecNetworkAcl', { get: function () { return require('./data-huaweicloud-iec-network-acl'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecPort', { get: function () { return require('./data-huaweicloud-iec-port'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecSecurityGroup', { get: function () { return require('./data-huaweicloud-iec-security-group'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecServer', { get: function () { return require('./data-huaweicloud-iec-server'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecSites', { get: function () { return require('./data-huaweicloud-iec-sites'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecVpc', { get: function () { return require('./data-huaweicloud-iec-vpc'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIecVpcSubnets', { get: function () { return require('./data-huaweicloud-iec-vpc-subnets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudImagesImage', { get: function () { return require('./data-huaweicloud-images-image'); } }); +Object.defineProperty(exports, 'dataHuaweicloudImagesImageV2', { get: function () { return require('./data-huaweicloud-images-image-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudImagesImages', { get: function () { return require('./data-huaweicloud-images-images'); } }); +Object.defineProperty(exports, 'dataHuaweicloudImsOsVersions', { get: function () { return require('./data-huaweicloud-ims-os-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudImsQuotas', { get: function () { return require('./data-huaweicloud-ims-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaAmqps', { get: function () { return require('./data-huaweicloud-iotda-amqps'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaBatchtasks', { get: function () { return require('./data-huaweicloud-iotda-batchtasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDataBacklogPolicies', { get: function () { return require('./data-huaweicloud-iotda-data-backlog-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDataFlowControlPolicies', { get: function () { return require('./data-huaweicloud-iotda-data-flow-control-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDataforwardingRules', { get: function () { return require('./data-huaweicloud-iotda-dataforwarding-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDeviceBindingGroups', { get: function () { return require('./data-huaweicloud-iotda-device-binding-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDeviceCertificates', { get: function () { return require('./data-huaweicloud-iotda-device-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDeviceGroups', { get: function () { return require('./data-huaweicloud-iotda-device-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDeviceLinkageRules', { get: function () { return require('./data-huaweicloud-iotda-device-linkage-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDeviceMessages', { get: function () { return require('./data-huaweicloud-iotda-device-messages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDeviceProxies', { get: function () { return require('./data-huaweicloud-iotda-device-proxies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaDevices', { get: function () { return require('./data-huaweicloud-iotda-devices'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaProducts', { get: function () { return require('./data-huaweicloud-iotda-products'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaSpaces', { get: function () { return require('./data-huaweicloud-iotda-spaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudIotdaUpgradePackages', { get: function () { return require('./data-huaweicloud-iotda-upgrade-packages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKmsDataKey', { get: function () { return require('./data-huaweicloud-kms-data-key'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKmsDataKeyV1', { get: function () { return require('./data-huaweicloud-kms-data-key-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKmsGrants', { get: function () { return require('./data-huaweicloud-kms-grants'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKmsKey', { get: function () { return require('./data-huaweicloud-kms-key'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKmsKeyV1', { get: function () { return require('./data-huaweicloud-kms-key-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKmsKeys', { get: function () { return require('./data-huaweicloud-kms-keys'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKoogalleryAssets', { get: function () { return require('./data-huaweicloud-koogallery-assets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKpsFailedTasks', { get: function () { return require('./data-huaweicloud-kps-failed-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKpsKeypairs', { get: function () { return require('./data-huaweicloud-kps-keypairs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudKpsRunningTasks', { get: function () { return require('./data-huaweicloud-kps-running-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLbCertificate', { get: function () { return require('./data-huaweicloud-lb-certificate'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLbListeners', { get: function () { return require('./data-huaweicloud-lb-listeners'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLbLoadbalancer', { get: function () { return require('./data-huaweicloud-lb-loadbalancer'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLbPools', { get: function () { return require('./data-huaweicloud-lb-pools'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLiveDomains', { get: function () { return require('./data-huaweicloud-live-domains'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsAomAccesses', { get: function () { return require('./data-huaweicloud-lts-aom-accesses'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsCceAccesses', { get: function () { return require('./data-huaweicloud-lts-cce-accesses'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsGroups', { get: function () { return require('./data-huaweicloud-lts-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsHostGroups', { get: function () { return require('./data-huaweicloud-lts-host-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsNotificationTemplates', { get: function () { return require('./data-huaweicloud-lts-notification-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsSearchCriteria', { get: function () { return require('./data-huaweicloud-lts-search-criteria'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsStreams', { get: function () { return require('./data-huaweicloud-lts-streams'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsStructuringCustomTemplates', { get: function () { return require('./data-huaweicloud-lts-structuring-custom-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudLtsTransfers', { get: function () { return require('./data-huaweicloud-lts-transfers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudMapreduceClusters', { get: function () { return require('./data-huaweicloud-mapreduce-clusters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudMapreduceVersions', { get: function () { return require('./data-huaweicloud-mapreduce-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsDatasetVersions', { get: function () { return require('./data-huaweicloud-modelarts-dataset-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsDatasets', { get: function () { return require('./data-huaweicloud-modelarts-datasets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsModelTemplates', { get: function () { return require('./data-huaweicloud-modelarts-model-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsModels', { get: function () { return require('./data-huaweicloud-modelarts-models'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsNotebookFlavors', { get: function () { return require('./data-huaweicloud-modelarts-notebook-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsNotebookImages', { get: function () { return require('./data-huaweicloud-modelarts-notebook-images'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsResourceFlavors', { get: function () { return require('./data-huaweicloud-modelarts-resource-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsServiceFlavors', { get: function () { return require('./data-huaweicloud-modelarts-service-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsServices', { get: function () { return require('./data-huaweicloud-modelarts-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudModelartsWorkspaces', { get: function () { return require('./data-huaweicloud-modelarts-workspaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatDnatRules', { get: function () { return require('./data-huaweicloud-nat-dnat-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatGateway', { get: function () { return require('./data-huaweicloud-nat-gateway'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatGateways', { get: function () { return require('./data-huaweicloud-nat-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatPrivateDnatRules', { get: function () { return require('./data-huaweicloud-nat-private-dnat-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatPrivateGateways', { get: function () { return require('./data-huaweicloud-nat-private-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatPrivateSnatRules', { get: function () { return require('./data-huaweicloud-nat-private-snat-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatPrivateTransitIps', { get: function () { return require('./data-huaweicloud-nat-private-transit-ips'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNatSnatRules', { get: function () { return require('./data-huaweicloud-nat-snat-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingNetworkV2', { get: function () { return require('./data-huaweicloud-networking-network-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingPort', { get: function () { return require('./data-huaweicloud-networking-port'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingPortV2', { get: function () { return require('./data-huaweicloud-networking-port-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingSecgroup', { get: function () { return require('./data-huaweicloud-networking-secgroup'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingSecgroupRules', { get: function () { return require('./data-huaweicloud-networking-secgroup-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingSecgroupV2', { get: function () { return require('./data-huaweicloud-networking-secgroup-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingSecgroups', { get: function () { return require('./data-huaweicloud-networking-secgroups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudNetworkingSubnetV2', { get: function () { return require('./data-huaweicloud-networking-subnet-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudObsBucketObject', { get: function () { return require('./data-huaweicloud-obs-bucket-object'); } }); +Object.defineProperty(exports, 'dataHuaweicloudObsBuckets', { get: function () { return require('./data-huaweicloud-obs-buckets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsAccounts', { get: function () { return require('./data-huaweicloud-organizations-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsEffectivePolicies', { get: function () { return require('./data-huaweicloud-organizations-effective-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsOrganization', { get: function () { return require('./data-huaweicloud-organizations-organization'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsOrganizationalUnits', { get: function () { return require('./data-huaweicloud-organizations-organizational-units'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsPolicies', { get: function () { return require('./data-huaweicloud-organizations-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsReceivedInvitations', { get: function () { return require('./data-huaweicloud-organizations-received-invitations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsResourceInstances', { get: function () { return require('./data-huaweicloud-organizations-resource-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsResourceTags', { get: function () { return require('./data-huaweicloud-organizations-resource-tags'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsSentInvitations', { get: function () { return require('./data-huaweicloud-organizations-sent-invitations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsServices', { get: function () { return require('./data-huaweicloud-organizations-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsTagPolicyServices', { get: function () { return require('./data-huaweicloud-organizations-tag-policy-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudOrganizationsTrustedServices', { get: function () { return require('./data-huaweicloud-organizations-trusted-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamResourcePermissions', { get: function () { return require('./data-huaweicloud-ram-resource-permissions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamResourceShareAssociatedPermissions', { get: function () { return require('./data-huaweicloud-ram-resource-share-associated-permissions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamResourceShareAssociations', { get: function () { return require('./data-huaweicloud-ram-resource-share-associations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamResourceShareInvitations', { get: function () { return require('./data-huaweicloud-ram-resource-share-invitations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamResourceShares', { get: function () { return require('./data-huaweicloud-ram-resource-shares'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamSharedPrincipals', { get: function () { return require('./data-huaweicloud-ram-shared-principals'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRamSharedResources', { get: function () { return require('./data-huaweicloud-ram-shared-resources'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsBackups', { get: function () { return require('./data-huaweicloud-rds-backups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsCrossRegionBackupInstances', { get: function () { return require('./data-huaweicloud-rds-cross-region-backup-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsCrossRegionBackups', { get: function () { return require('./data-huaweicloud-rds-cross-region-backups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsEngineVersions', { get: function () { return require('./data-huaweicloud-rds-engine-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsErrorLogLink', { get: function () { return require('./data-huaweicloud-rds-error-log-link'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsErrorLogs', { get: function () { return require('./data-huaweicloud-rds-error-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsExtendLogFiles', { get: function () { return require('./data-huaweicloud-rds-extend-log-files'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsExtendLogLinks', { get: function () { return require('./data-huaweicloud-rds-extend-log-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsFlavors', { get: function () { return require('./data-huaweicloud-rds-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsFlavorsV3', { get: function () { return require('./data-huaweicloud-rds-flavors-v3'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsInstances', { get: function () { return require('./data-huaweicloud-rds-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsMysqlAccounts', { get: function () { return require('./data-huaweicloud-rds-mysql-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsMysqlBinlog', { get: function () { return require('./data-huaweicloud-rds-mysql-binlog'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsMysqlDatabasePrivileges', { get: function () { return require('./data-huaweicloud-rds-mysql-database-privileges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsMysqlDatabases', { get: function () { return require('./data-huaweicloud-rds-mysql-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsMysqlProxies', { get: function () { return require('./data-huaweicloud-rds-mysql-proxies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsMysqlProxyFlavors', { get: function () { return require('./data-huaweicloud-rds-mysql-proxy-flavors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsParametergroups', { get: function () { return require('./data-huaweicloud-rds-parametergroups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgAccounts', { get: function () { return require('./data-huaweicloud-rds-pg-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgDatabases', { get: function () { return require('./data-huaweicloud-rds-pg-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgPluginParameterValueRange', { get: function () { return require('./data-huaweicloud-rds-pg-plugin-parameter-value-range'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgPluginParameterValues', { get: function () { return require('./data-huaweicloud-rds-pg-plugin-parameter-values'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgPlugins', { get: function () { return require('./data-huaweicloud-rds-pg-plugins'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgRoles', { get: function () { return require('./data-huaweicloud-rds-pg-roles'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsPgSqlLimits', { get: function () { return require('./data-huaweicloud-rds-pg-sql-limits'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsRecyclingInstances', { get: function () { return require('./data-huaweicloud-rds-recycling-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsRestoreTimeRanges', { get: function () { return require('./data-huaweicloud-rds-restore-time-ranges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsRestoredDatabases', { get: function () { return require('./data-huaweicloud-rds-restored-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsRestoredTables', { get: function () { return require('./data-huaweicloud-rds-restored-tables'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSlowLogFiles', { get: function () { return require('./data-huaweicloud-rds-slow-log-files'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSlowLogLink', { get: function () { return require('./data-huaweicloud-rds-slow-log-link'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSlowLogs', { get: function () { return require('./data-huaweicloud-rds-slow-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlAuditLogLinks', { get: function () { return require('./data-huaweicloud-rds-sql-audit-log-links'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlAuditLogs', { get: function () { return require('./data-huaweicloud-rds-sql-audit-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlAuditOperations', { get: function () { return require('./data-huaweicloud-rds-sql-audit-operations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlserverAccounts', { get: function () { return require('./data-huaweicloud-rds-sqlserver-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlserverCollations', { get: function () { return require('./data-huaweicloud-rds-sqlserver-collations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlserverDatabasePrivileges', { get: function () { return require('./data-huaweicloud-rds-sqlserver-database-privileges'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsSqlserverDatabases', { get: function () { return require('./data-huaweicloud-rds-sqlserver-databases'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRdsStorageTypes', { get: function () { return require('./data-huaweicloud-rds-storage-types'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAdvancedQueries', { get: function () { return require('./data-huaweicloud-rms-advanced-queries'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAdvancedQuery', { get: function () { return require('./data-huaweicloud-rms-advanced-query'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAdvancedQuerySchemas', { get: function () { return require('./data-huaweicloud-rms-advanced-query-schemas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAssignmentPackageResults', { get: function () { return require('./data-huaweicloud-rms-assignment-package-results'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAssignmentPackageScores', { get: function () { return require('./data-huaweicloud-rms-assignment-package-scores'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAssignmentPackageTemplates', { get: function () { return require('./data-huaweicloud-rms-assignment-package-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsAssignmentPackages', { get: function () { return require('./data-huaweicloud-rms-assignment-packages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsOrganizationalAssignmentPackages', { get: function () { return require('./data-huaweicloud-rms-organizational-assignment-packages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsOrganizationalPolicyAssignments', { get: function () { return require('./data-huaweicloud-rms-organizational-policy-assignments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsPolicyAssignments', { get: function () { return require('./data-huaweicloud-rms-policy-assignments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsPolicyDefinitions', { get: function () { return require('./data-huaweicloud-rms-policy-definitions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsPolicyStates', { get: function () { return require('./data-huaweicloud-rms-policy-states'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsRegions', { get: function () { return require('./data-huaweicloud-rms-regions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregationPendingRequests', { get: function () { return require('./data-huaweicloud-rms-resource-aggregation-pending-requests'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregatorAdvancedQuery', { get: function () { return require('./data-huaweicloud-rms-resource-aggregator-advanced-query'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregatorDiscoveredResources', { get: function () { return require('./data-huaweicloud-rms-resource-aggregator-discovered-resources'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregatorPolicyAssignments', { get: function () { return require('./data-huaweicloud-rms-resource-aggregator-policy-assignments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregatorPolicyStates', { get: function () { return require('./data-huaweicloud-rms-resource-aggregator-policy-states'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregatorSourceStatuses', { get: function () { return require('./data-huaweicloud-rms-resource-aggregator-source-statuses'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceAggregators', { get: function () { return require('./data-huaweicloud-rms-resource-aggregators'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceHistories', { get: function () { return require('./data-huaweicloud-rms-resource-histories'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourceRelationsDetails', { get: function () { return require('./data-huaweicloud-rms-resource-relations-details'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResources', { get: function () { return require('./data-huaweicloud-rms-resources'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsResourcesSummary', { get: function () { return require('./data-huaweicloud-rms-resources-summary'); } }); +Object.defineProperty(exports, 'dataHuaweicloudRmsServices', { get: function () { return require('./data-huaweicloud-rms-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudScmCertificates', { get: function () { return require('./data-huaweicloud-scm-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSdrsDomain', { get: function () { return require('./data-huaweicloud-sdrs-domain'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterAlertRuleTemplates', { get: function () { return require('./data-huaweicloud-secmaster-alert-rule-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterAlertRules', { get: function () { return require('./data-huaweicloud-secmaster-alert-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterAlerts', { get: function () { return require('./data-huaweicloud-secmaster-alerts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterBaselineCheckResults', { get: function () { return require('./data-huaweicloud-secmaster-baseline-check-results'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterDataClassFields', { get: function () { return require('./data-huaweicloud-secmaster-data-class-fields'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterDataClasses', { get: function () { return require('./data-huaweicloud-secmaster-data-classes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterIncidents', { get: function () { return require('./data-huaweicloud-secmaster-incidents'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterIndicators', { get: function () { return require('./data-huaweicloud-secmaster-indicators'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterMetricResults', { get: function () { return require('./data-huaweicloud-secmaster-metric-results'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybookActionInstances', { get: function () { return require('./data-huaweicloud-secmaster-playbook-action-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybookAuditLogs', { get: function () { return require('./data-huaweicloud-secmaster-playbook-audit-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybookInstances', { get: function () { return require('./data-huaweicloud-secmaster-playbook-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybookMonitors', { get: function () { return require('./data-huaweicloud-secmaster-playbook-monitors'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybookStatistics', { get: function () { return require('./data-huaweicloud-secmaster-playbook-statistics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybookVersions', { get: function () { return require('./data-huaweicloud-secmaster-playbook-versions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterPlaybooks', { get: function () { return require('./data-huaweicloud-secmaster-playbooks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterWorkflows', { get: function () { return require('./data-huaweicloud-secmaster-workflows'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSecmasterWorkspaces', { get: function () { return require('./data-huaweicloud-secmaster-workspaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudServicestageComponentRuntimes', { get: function () { return require('./data-huaweicloud-servicestage-component-runtimes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudServicestagev3Applications', { get: function () { return require('./data-huaweicloud-servicestagev3-applications'); } }); +Object.defineProperty(exports, 'dataHuaweicloudServicestagev3Environments', { get: function () { return require('./data-huaweicloud-servicestagev3-environments'); } }); +Object.defineProperty(exports, 'dataHuaweicloudServicestagev3RuntimeStacks', { get: function () { return require('./data-huaweicloud-servicestagev3-runtime-stacks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsFileSystem', { get: function () { return require('./data-huaweicloud-sfs-file-system'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsFileSystemV2', { get: function () { return require('./data-huaweicloud-sfs-file-system-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsTurboDataTasks', { get: function () { return require('./data-huaweicloud-sfs-turbo-data-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsTurboDuTasks', { get: function () { return require('./data-huaweicloud-sfs-turbo-du-tasks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsTurboObsTargets', { get: function () { return require('./data-huaweicloud-sfs-turbo-obs-targets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsTurboPermRules', { get: function () { return require('./data-huaweicloud-sfs-turbo-perm-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSfsTurbos', { get: function () { return require('./data-huaweicloud-sfs-turbos'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSmnLogtanks', { get: function () { return require('./data-huaweicloud-smn-logtanks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSmnMessageTemplates', { get: function () { return require('./data-huaweicloud-smn-message-templates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSmnSubscriptions', { get: function () { return require('./data-huaweicloud-smn-subscriptions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSmnTopicSubscriptions', { get: function () { return require('./data-huaweicloud-smn-topic-subscriptions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSmnTopics', { get: function () { return require('./data-huaweicloud-smn-topics'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSmsSourceServers', { get: function () { return require('./data-huaweicloud-sms-source-servers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrImageRetentionHistories', { get: function () { return require('./data-huaweicloud-swr-image-retention-histories'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrImageRetentionPolicies', { get: function () { return require('./data-huaweicloud-swr-image-retention-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrImageTags', { get: function () { return require('./data-huaweicloud-swr-image-tags'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrImageTriggers', { get: function () { return require('./data-huaweicloud-swr-image-triggers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrOrganizations', { get: function () { return require('./data-huaweicloud-swr-organizations'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrRepositories', { get: function () { return require('./data-huaweicloud-swr-repositories'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrSharedAccounts', { get: function () { return require('./data-huaweicloud-swr-shared-accounts'); } }); +Object.defineProperty(exports, 'dataHuaweicloudSwrSharedRepositories', { get: function () { return require('./data-huaweicloud-swr-shared-repositories'); } }); +Object.defineProperty(exports, 'dataHuaweicloudTmsResourceTypes', { get: function () { return require('./data-huaweicloud-tms-resource-types'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVbsBackup', { get: function () { return require('./data-huaweicloud-vbs-backup'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVbsBackupPolicy', { get: function () { return require('./data-huaweicloud-vbs-backup-policy'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVbsBackupPolicyV2', { get: function () { return require('./data-huaweicloud-vbs-backup-policy-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVbsBackupV2', { get: function () { return require('./data-huaweicloud-vbs-backup-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpc', { get: function () { return require('./data-huaweicloud-vpc'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcAddressGroups', { get: function () { return require('./data-huaweicloud-vpc-address-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcBandwidth', { get: function () { return require('./data-huaweicloud-vpc-bandwidth'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcBandwidths', { get: function () { return require('./data-huaweicloud-vpc-bandwidths'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcEip', { get: function () { return require('./data-huaweicloud-vpc-eip'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcEips', { get: function () { return require('./data-huaweicloud-vpc-eips'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcFlowLogs', { get: function () { return require('./data-huaweicloud-vpc-flow-logs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcIds', { get: function () { return require('./data-huaweicloud-vpc-ids'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcIdsV1', { get: function () { return require('./data-huaweicloud-vpc-ids-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcInternetGateways', { get: function () { return require('./data-huaweicloud-vpc-internet-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcNetworkAcls', { get: function () { return require('./data-huaweicloud-vpc-network-acls'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcPeeringConnection', { get: function () { return require('./data-huaweicloud-vpc-peering-connection'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcPeeringConnectionV2', { get: function () { return require('./data-huaweicloud-vpc-peering-connection-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcRoute', { get: function () { return require('./data-huaweicloud-vpc-route'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcRouteIds', { get: function () { return require('./data-huaweicloud-vpc-route-ids'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcRouteIdsV2', { get: function () { return require('./data-huaweicloud-vpc-route-ids-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcRouteTable', { get: function () { return require('./data-huaweicloud-vpc-route-table'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcRouteV2', { get: function () { return require('./data-huaweicloud-vpc-route-v2'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcRoutes', { get: function () { return require('./data-huaweicloud-vpc-routes'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcSubNetworkInterfaces', { get: function () { return require('./data-huaweicloud-vpc-sub-network-interfaces'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcSubnet', { get: function () { return require('./data-huaweicloud-vpc-subnet'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcSubnetIds', { get: function () { return require('./data-huaweicloud-vpc-subnet-ids'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcSubnetIdsV1', { get: function () { return require('./data-huaweicloud-vpc-subnet-ids-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcSubnetV1', { get: function () { return require('./data-huaweicloud-vpc-subnet-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcSubnets', { get: function () { return require('./data-huaweicloud-vpc-subnets'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcTrafficMirrorFilterRules', { get: function () { return require('./data-huaweicloud-vpc-traffic-mirror-filter-rules'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcTrafficMirrorFilters', { get: function () { return require('./data-huaweicloud-vpc-traffic-mirror-filters'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcTrafficMirrorSessions', { get: function () { return require('./data-huaweicloud-vpc-traffic-mirror-sessions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcV1', { get: function () { return require('./data-huaweicloud-vpc-v1'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepEndpoints', { get: function () { return require('./data-huaweicloud-vpcep-endpoints'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepPublicServices', { get: function () { return require('./data-huaweicloud-vpcep-public-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepQuotas', { get: function () { return require('./data-huaweicloud-vpcep-quotas'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepServiceConnections', { get: function () { return require('./data-huaweicloud-vpcep-service-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepServicePermissions', { get: function () { return require('./data-huaweicloud-vpcep-service-permissions'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepServiceSummary', { get: function () { return require('./data-huaweicloud-vpcep-service-summary'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcepServices', { get: function () { return require('./data-huaweicloud-vpcep-services'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpcs', { get: function () { return require('./data-huaweicloud-vpcs'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnAccessPolicies', { get: function () { return require('./data-huaweicloud-vpn-access-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnConnectionHealthChecks', { get: function () { return require('./data-huaweicloud-vpn-connection-health-checks'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnConnections', { get: function () { return require('./data-huaweicloud-vpn-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnCustomerGateways', { get: function () { return require('./data-huaweicloud-vpn-customer-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnGatewayAvailabilityZones', { get: function () { return require('./data-huaweicloud-vpn-gateway-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnGateways', { get: function () { return require('./data-huaweicloud-vpn-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnP2CGatewayAvailabilityZones', { get: function () { return require('./data-huaweicloud-vpn-p2c-gateway-availability-zones'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnP2CGatewayConnections', { get: function () { return require('./data-huaweicloud-vpn-p2c-gateway-connections'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnP2CGateways', { get: function () { return require('./data-huaweicloud-vpn-p2c-gateways'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnServers', { get: function () { return require('./data-huaweicloud-vpn-servers'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnUserGroups', { get: function () { return require('./data-huaweicloud-vpn-user-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudVpnUsers', { get: function () { return require('./data-huaweicloud-vpn-users'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafAddressGroups', { get: function () { return require('./data-huaweicloud-waf-address-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafCertificate', { get: function () { return require('./data-huaweicloud-waf-certificate'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafCertificates', { get: function () { return require('./data-huaweicloud-waf-certificates'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafDedicatedDomains', { get: function () { return require('./data-huaweicloud-waf-dedicated-domains'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafDedicatedInstances', { get: function () { return require('./data-huaweicloud-waf-dedicated-instances'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafDomains', { get: function () { return require('./data-huaweicloud-waf-domains'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafInstanceGroups', { get: function () { return require('./data-huaweicloud-waf-instance-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafPolicies', { get: function () { return require('./data-huaweicloud-waf-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafReferenceTables', { get: function () { return require('./data-huaweicloud-waf-reference-tables'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesAntiCrawler', { get: function () { return require('./data-huaweicloud-waf-rules-anti-crawler'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesBlacklist', { get: function () { return require('./data-huaweicloud-waf-rules-blacklist'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesCcProtection', { get: function () { return require('./data-huaweicloud-waf-rules-cc-protection'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesDataMasking', { get: function () { return require('./data-huaweicloud-waf-rules-data-masking'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesGeolocationAccessControl', { get: function () { return require('./data-huaweicloud-waf-rules-geolocation-access-control'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesGlobalProtectionWhitelist', { get: function () { return require('./data-huaweicloud-waf-rules-global-protection-whitelist'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesInformationLeakagePrevention', { get: function () { return require('./data-huaweicloud-waf-rules-information-leakage-prevention'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesKnownAttackSource', { get: function () { return require('./data-huaweicloud-waf-rules-known-attack-source'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesPreciseProtection', { get: function () { return require('./data-huaweicloud-waf-rules-precise-protection'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafRulesWebTamperProtection', { get: function () { return require('./data-huaweicloud-waf-rules-web-tamper-protection'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWafSourceIps', { get: function () { return require('./data-huaweicloud-waf-source-ips'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWorkspaceAppGroups', { get: function () { return require('./data-huaweicloud-workspace-app-groups'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWorkspaceAppNasStorages', { get: function () { return require('./data-huaweicloud-workspace-app-nas-storages'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWorkspaceAppPublishableApps', { get: function () { return require('./data-huaweicloud-workspace-app-publishable-apps'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWorkspaceAppStoragePolicies', { get: function () { return require('./data-huaweicloud-workspace-app-storage-policies'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWorkspaceDesktops', { get: function () { return require('./data-huaweicloud-workspace-desktops'); } }); +Object.defineProperty(exports, 'dataHuaweicloudWorkspaceFlavors', { get: function () { return require('./data-huaweicloud-workspace-flavors'); } }); +Object.defineProperty(exports, 'provider', { get: function () { return require('./provider'); } }); + diff --git a/src/constructs/providers/huaweicloud/lb-certificate-v2/README.md b/src/constructs/providers/huaweicloud/lb-certificate-v2/README.md new file mode 100644 index 00000000..73780a6e --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-certificate-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_certificate_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_certificate_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2). diff --git a/src/constructs/providers/huaweicloud/lb-certificate-v2/index.ts b/src/constructs/providers/huaweicloud/lb-certificate-v2/index.ts new file mode 100644 index 00000000..1f5f74a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-certificate-v2/index.ts @@ -0,0 +1,542 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbCertificateV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#certificate LbCertificateV2#certificate} + */ + readonly certificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#description LbCertificateV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#domain LbCertificateV2#domain} + */ + readonly domain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#enterprise_project_id LbCertificateV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#id LbCertificateV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#name LbCertificateV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#private_key LbCertificateV2#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#region LbCertificateV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#type LbCertificateV2#type} + */ + readonly type?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#timeouts LbCertificateV2#timeouts} + */ + readonly timeouts?: LbCertificateV2Timeouts; +} +export interface LbCertificateV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#create LbCertificateV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#delete LbCertificateV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#update LbCertificateV2#update} + */ + readonly update?: string; +} + +export function lbCertificateV2TimeoutsToTerraform(struct?: LbCertificateV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbCertificateV2TimeoutsToHclTerraform(struct?: LbCertificateV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbCertificateV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbCertificateV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbCertificateV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2 huaweicloud_lb_certificate_v2} +*/ +export class LbCertificateV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_certificate_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbCertificateV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbCertificateV2 to import + * @param importFromId The id of the existing LbCertificateV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbCertificateV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_certificate_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate_v2 huaweicloud_lb_certificate_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbCertificateV2Config + */ + public constructor(scope: Construct, id: string, config: LbCertificateV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_certificate_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificate = config.certificate; + this._description = config.description; + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate - computed: false, optional: false, required: true + private _certificate?: string; + public get certificate() { + return this.getStringAttribute('certificate'); + } + public set certificate(value: string) { + this._certificate = value; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbCertificateV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbCertificateV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate: cdktf.stringToTerraform(this._certificate), + description: cdktf.stringToTerraform(this._description), + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + timeouts: lbCertificateV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate: { + value: cdktf.stringToHclTerraform(this._certificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbCertificateV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbCertificateV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-certificate/README.md b/src/constructs/providers/huaweicloud/lb-certificate/README.md new file mode 100644 index 00000000..12602d4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate). diff --git a/src/constructs/providers/huaweicloud/lb-certificate/index.ts b/src/constructs/providers/huaweicloud/lb-certificate/index.ts new file mode 100644 index 00000000..99be215f --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-certificate/index.ts @@ -0,0 +1,542 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#certificate LbCertificate#certificate} + */ + readonly certificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#description LbCertificate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#domain LbCertificate#domain} + */ + readonly domain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#enterprise_project_id LbCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#id LbCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#name LbCertificate#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#private_key LbCertificate#private_key} + */ + readonly privateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#region LbCertificate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#type LbCertificate#type} + */ + readonly type?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#timeouts LbCertificate#timeouts} + */ + readonly timeouts?: LbCertificateTimeouts; +} +export interface LbCertificateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#create LbCertificate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#delete LbCertificate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#update LbCertificate#update} + */ + readonly update?: string; +} + +export function lbCertificateTimeoutsToTerraform(struct?: LbCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbCertificateTimeoutsToHclTerraform(struct?: LbCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbCertificateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbCertificateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbCertificateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate huaweicloud_lb_certificate} +*/ +export class LbCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbCertificate to import + * @param importFromId The id of the existing LbCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_certificate huaweicloud_lb_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbCertificateConfig + */ + public constructor(scope: Construct, id: string, config: LbCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificate = config.certificate; + this._description = config.description; + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate - computed: false, optional: false, required: true + private _certificate?: string; + public get certificate() { + return this.getStringAttribute('certificate'); + } + public set certificate(value: string) { + this._certificate = value; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: true, required: false + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + public resetPrivateKey() { + this._privateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbCertificateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbCertificateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate: cdktf.stringToTerraform(this._certificate), + description: cdktf.stringToTerraform(this._description), + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + timeouts: lbCertificateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate: { + value: cdktf.stringToHclTerraform(this._certificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbCertificateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbCertificateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-l7policy-v2/README.md b/src/constructs/providers/huaweicloud/lb-l7policy-v2/README.md new file mode 100644 index 00000000..c24cf557 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7policy-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_l7policy_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_l7policy_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2). diff --git a/src/constructs/providers/huaweicloud/lb-l7policy-v2/index.ts b/src/constructs/providers/huaweicloud/lb-l7policy-v2/index.ts new file mode 100644 index 00000000..f68c0ead --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7policy-v2/index.ts @@ -0,0 +1,580 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbL7PolicyV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#action LbL7PolicyV2#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#admin_state_up LbL7PolicyV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#description LbL7PolicyV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#id LbL7PolicyV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#listener_id LbL7PolicyV2#listener_id} + */ + readonly listenerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#name LbL7PolicyV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#position LbL7PolicyV2#position} + */ + readonly position?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#redirect_listener_id LbL7PolicyV2#redirect_listener_id} + */ + readonly redirectListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#redirect_pool_id LbL7PolicyV2#redirect_pool_id} + */ + readonly redirectPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#region LbL7PolicyV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#tenant_id LbL7PolicyV2#tenant_id} + */ + readonly tenantId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#timeouts LbL7PolicyV2#timeouts} + */ + readonly timeouts?: LbL7PolicyV2Timeouts; +} +export interface LbL7PolicyV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#create LbL7PolicyV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#delete LbL7PolicyV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#update LbL7PolicyV2#update} + */ + readonly update?: string; +} + +export function lbL7PolicyV2TimeoutsToTerraform(struct?: LbL7PolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbL7PolicyV2TimeoutsToHclTerraform(struct?: LbL7PolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbL7PolicyV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbL7PolicyV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbL7PolicyV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2 huaweicloud_lb_l7policy_v2} +*/ +export class LbL7PolicyV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_l7policy_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbL7PolicyV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbL7PolicyV2 to import + * @param importFromId The id of the existing LbL7PolicyV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbL7PolicyV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_l7policy_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy_v2 huaweicloud_lb_l7policy_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbL7PolicyV2Config + */ + public constructor(scope: Construct, id: string, config: LbL7PolicyV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_l7policy_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._listenerId = config.listenerId; + this._name = config.name; + this._position = config.position; + this._redirectListenerId = config.redirectListenerId; + this._redirectPoolId = config.redirectPoolId; + this._region = config.region; + this._tenantId = config.tenantId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: false, required: true + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // position - computed: true, optional: true, required: false + private _position?: number; + public get position() { + return this.getNumberAttribute('position'); + } + public set position(value: number) { + this._position = value; + } + public resetPosition() { + this._position = undefined; + } + // Temporarily expose input value. Use with caution. + public get positionInput() { + return this._position; + } + + // redirect_listener_id - computed: false, optional: true, required: false + private _redirectListenerId?: string; + public get redirectListenerId() { + return this.getStringAttribute('redirect_listener_id'); + } + public set redirectListenerId(value: string) { + this._redirectListenerId = value; + } + public resetRedirectListenerId() { + this._redirectListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectListenerIdInput() { + return this._redirectListenerId; + } + + // redirect_pool_id - computed: false, optional: true, required: false + private _redirectPoolId?: string; + public get redirectPoolId() { + return this.getStringAttribute('redirect_pool_id'); + } + public set redirectPoolId(value: string) { + this._redirectPoolId = value; + } + public resetRedirectPoolId() { + this._redirectPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolIdInput() { + return this._redirectPoolId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbL7PolicyV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbL7PolicyV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + position: cdktf.numberToTerraform(this._position), + redirect_listener_id: cdktf.stringToTerraform(this._redirectListenerId), + redirect_pool_id: cdktf.stringToTerraform(this._redirectPoolId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + timeouts: lbL7PolicyV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + position: { + value: cdktf.numberToHclTerraform(this._position), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + redirect_listener_id: { + value: cdktf.stringToHclTerraform(this._redirectListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redirect_pool_id: { + value: cdktf.stringToHclTerraform(this._redirectPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbL7PolicyV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbL7PolicyV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-l7policy/README.md b/src/constructs/providers/huaweicloud/lb-l7policy/README.md new file mode 100644 index 00000000..bcfc3258 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_l7policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_l7policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy). diff --git a/src/constructs/providers/huaweicloud/lb-l7policy/index.ts b/src/constructs/providers/huaweicloud/lb-l7policy/index.ts new file mode 100644 index 00000000..0f51077d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7policy/index.ts @@ -0,0 +1,580 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbL7PolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#action LbL7Policy#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#admin_state_up LbL7Policy#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#description LbL7Policy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#id LbL7Policy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#listener_id LbL7Policy#listener_id} + */ + readonly listenerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#name LbL7Policy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#position LbL7Policy#position} + */ + readonly position?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#redirect_listener_id LbL7Policy#redirect_listener_id} + */ + readonly redirectListenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#redirect_pool_id LbL7Policy#redirect_pool_id} + */ + readonly redirectPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#region LbL7Policy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#tenant_id LbL7Policy#tenant_id} + */ + readonly tenantId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#timeouts LbL7Policy#timeouts} + */ + readonly timeouts?: LbL7PolicyTimeouts; +} +export interface LbL7PolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#create LbL7Policy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#delete LbL7Policy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#update LbL7Policy#update} + */ + readonly update?: string; +} + +export function lbL7PolicyTimeoutsToTerraform(struct?: LbL7PolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbL7PolicyTimeoutsToHclTerraform(struct?: LbL7PolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbL7PolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbL7PolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbL7PolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy huaweicloud_lb_l7policy} +*/ +export class LbL7Policy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_l7policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbL7Policy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbL7Policy to import + * @param importFromId The id of the existing LbL7Policy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbL7Policy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_l7policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7policy huaweicloud_lb_l7policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbL7PolicyConfig + */ + public constructor(scope: Construct, id: string, config: LbL7PolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_l7policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._listenerId = config.listenerId; + this._name = config.name; + this._position = config.position; + this._redirectListenerId = config.redirectListenerId; + this._redirectPoolId = config.redirectPoolId; + this._region = config.region; + this._tenantId = config.tenantId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: false, required: true + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // position - computed: true, optional: true, required: false + private _position?: number; + public get position() { + return this.getNumberAttribute('position'); + } + public set position(value: number) { + this._position = value; + } + public resetPosition() { + this._position = undefined; + } + // Temporarily expose input value. Use with caution. + public get positionInput() { + return this._position; + } + + // redirect_listener_id - computed: false, optional: true, required: false + private _redirectListenerId?: string; + public get redirectListenerId() { + return this.getStringAttribute('redirect_listener_id'); + } + public set redirectListenerId(value: string) { + this._redirectListenerId = value; + } + public resetRedirectListenerId() { + this._redirectListenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectListenerIdInput() { + return this._redirectListenerId; + } + + // redirect_pool_id - computed: false, optional: true, required: false + private _redirectPoolId?: string; + public get redirectPoolId() { + return this.getStringAttribute('redirect_pool_id'); + } + public set redirectPoolId(value: string) { + this._redirectPoolId = value; + } + public resetRedirectPoolId() { + this._redirectPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectPoolIdInput() { + return this._redirectPoolId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbL7PolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbL7PolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + name: cdktf.stringToTerraform(this._name), + position: cdktf.numberToTerraform(this._position), + redirect_listener_id: cdktf.stringToTerraform(this._redirectListenerId), + redirect_pool_id: cdktf.stringToTerraform(this._redirectPoolId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + timeouts: lbL7PolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + position: { + value: cdktf.numberToHclTerraform(this._position), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + redirect_listener_id: { + value: cdktf.stringToHclTerraform(this._redirectListenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redirect_pool_id: { + value: cdktf.stringToHclTerraform(this._redirectPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbL7PolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbL7PolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-l7rule-v2/README.md b/src/constructs/providers/huaweicloud/lb-l7rule-v2/README.md new file mode 100644 index 00000000..da0f6488 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7rule-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_l7rule_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_l7rule_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2). diff --git a/src/constructs/providers/huaweicloud/lb-l7rule-v2/index.ts b/src/constructs/providers/huaweicloud/lb-l7rule-v2/index.ts new file mode 100644 index 00000000..d72542b6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7rule-v2/index.ts @@ -0,0 +1,523 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbL7RuleV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#admin_state_up LbL7RuleV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#compare_type LbL7RuleV2#compare_type} + */ + readonly compareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#id LbL7RuleV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#key LbL7RuleV2#key} + */ + readonly key?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#l7policy_id LbL7RuleV2#l7policy_id} + */ + readonly l7PolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#region LbL7RuleV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#tenant_id LbL7RuleV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#type LbL7RuleV2#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#value LbL7RuleV2#value} + */ + readonly value: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#timeouts LbL7RuleV2#timeouts} + */ + readonly timeouts?: LbL7RuleV2Timeouts; +} +export interface LbL7RuleV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#create LbL7RuleV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#delete LbL7RuleV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#update LbL7RuleV2#update} + */ + readonly update?: string; +} + +export function lbL7RuleV2TimeoutsToTerraform(struct?: LbL7RuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbL7RuleV2TimeoutsToHclTerraform(struct?: LbL7RuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbL7RuleV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbL7RuleV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbL7RuleV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2 huaweicloud_lb_l7rule_v2} +*/ +export class LbL7RuleV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_l7rule_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbL7RuleV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbL7RuleV2 to import + * @param importFromId The id of the existing LbL7RuleV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbL7RuleV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_l7rule_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule_v2 huaweicloud_lb_l7rule_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbL7RuleV2Config + */ + public constructor(scope: Construct, id: string, config: LbL7RuleV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_l7rule_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._compareType = config.compareType; + this._id = config.id; + this._key = config.key; + this._l7PolicyId = config.l7PolicyId; + this._region = config.region; + this._tenantId = config.tenantId; + this._type = config.type; + this._value = config.value; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // compare_type - computed: false, optional: false, required: true + private _compareType?: string; + public get compareType() { + return this.getStringAttribute('compare_type'); + } + public set compareType(value: string) { + this._compareType = value; + } + // Temporarily expose input value. Use with caution. + public get compareTypeInput() { + return this._compareType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key - computed: false, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // l7policy_id - computed: false, optional: false, required: true + private _l7PolicyId?: string; + public get l7PolicyId() { + return this.getStringAttribute('l7policy_id'); + } + public set l7PolicyId(value: string) { + this._l7PolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get l7PolicyIdInput() { + return this._l7PolicyId; + } + + // listener_id - computed: true, optional: false, required: false + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbL7RuleV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbL7RuleV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + compare_type: cdktf.stringToTerraform(this._compareType), + id: cdktf.stringToTerraform(this._id), + key: cdktf.stringToTerraform(this._key), + l7policy_id: cdktf.stringToTerraform(this._l7PolicyId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + type: cdktf.stringToTerraform(this._type), + value: cdktf.stringToTerraform(this._value), + timeouts: lbL7RuleV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + compare_type: { + value: cdktf.stringToHclTerraform(this._compareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7policy_id: { + value: cdktf.stringToHclTerraform(this._l7PolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbL7RuleV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbL7RuleV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-l7rule/README.md b/src/constructs/providers/huaweicloud/lb-l7rule/README.md new file mode 100644 index 00000000..396a2f59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_l7rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_l7rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule). diff --git a/src/constructs/providers/huaweicloud/lb-l7rule/index.ts b/src/constructs/providers/huaweicloud/lb-l7rule/index.ts new file mode 100644 index 00000000..aae308bd --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-l7rule/index.ts @@ -0,0 +1,523 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbL7RuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#admin_state_up LbL7Rule#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#compare_type LbL7Rule#compare_type} + */ + readonly compareType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#id LbL7Rule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#key LbL7Rule#key} + */ + readonly key?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#l7policy_id LbL7Rule#l7policy_id} + */ + readonly l7PolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#region LbL7Rule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#tenant_id LbL7Rule#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#type LbL7Rule#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#value LbL7Rule#value} + */ + readonly value: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#timeouts LbL7Rule#timeouts} + */ + readonly timeouts?: LbL7RuleTimeouts; +} +export interface LbL7RuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#create LbL7Rule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#delete LbL7Rule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#update LbL7Rule#update} + */ + readonly update?: string; +} + +export function lbL7RuleTimeoutsToTerraform(struct?: LbL7RuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbL7RuleTimeoutsToHclTerraform(struct?: LbL7RuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbL7RuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbL7RuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbL7RuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule huaweicloud_lb_l7rule} +*/ +export class LbL7Rule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_l7rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbL7Rule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbL7Rule to import + * @param importFromId The id of the existing LbL7Rule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbL7Rule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_l7rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_l7rule huaweicloud_lb_l7rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbL7RuleConfig + */ + public constructor(scope: Construct, id: string, config: LbL7RuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_l7rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._compareType = config.compareType; + this._id = config.id; + this._key = config.key; + this._l7PolicyId = config.l7PolicyId; + this._region = config.region; + this._tenantId = config.tenantId; + this._type = config.type; + this._value = config.value; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // compare_type - computed: false, optional: false, required: true + private _compareType?: string; + public get compareType() { + return this.getStringAttribute('compare_type'); + } + public set compareType(value: string) { + this._compareType = value; + } + // Temporarily expose input value. Use with caution. + public get compareTypeInput() { + return this._compareType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key - computed: false, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // l7policy_id - computed: false, optional: false, required: true + private _l7PolicyId?: string; + public get l7PolicyId() { + return this.getStringAttribute('l7policy_id'); + } + public set l7PolicyId(value: string) { + this._l7PolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get l7PolicyIdInput() { + return this._l7PolicyId; + } + + // listener_id - computed: true, optional: false, required: false + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbL7RuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbL7RuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + compare_type: cdktf.stringToTerraform(this._compareType), + id: cdktf.stringToTerraform(this._id), + key: cdktf.stringToTerraform(this._key), + l7policy_id: cdktf.stringToTerraform(this._l7PolicyId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + type: cdktf.stringToTerraform(this._type), + value: cdktf.stringToTerraform(this._value), + timeouts: lbL7RuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + compare_type: { + value: cdktf.stringToHclTerraform(this._compareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + l7policy_id: { + value: cdktf.stringToHclTerraform(this._l7PolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbL7RuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbL7RuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-listener-v2/README.md b/src/constructs/providers/huaweicloud/lb-listener-v2/README.md new file mode 100644 index 00000000..fa7cffb0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-listener-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_listener_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_listener_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2). diff --git a/src/constructs/providers/huaweicloud/lb-listener-v2/index.ts b/src/constructs/providers/huaweicloud/lb-listener-v2/index.ts new file mode 100644 index 00000000..894fc565 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-listener-v2/index.ts @@ -0,0 +1,689 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbListenerV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#admin_state_up LbListenerV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#connection_limit LbListenerV2#connection_limit} + */ + readonly connectionLimit?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#default_pool_id LbListenerV2#default_pool_id} + */ + readonly defaultPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#default_tls_container_ref LbListenerV2#default_tls_container_ref} + */ + readonly defaultTlsContainerRef?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#description LbListenerV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#http2_enable LbListenerV2#http2_enable} + */ + readonly http2Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#id LbListenerV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#loadbalancer_id LbListenerV2#loadbalancer_id} + */ + readonly loadbalancerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#name LbListenerV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#protocol LbListenerV2#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#protocol_port LbListenerV2#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#region LbListenerV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#sni_container_refs LbListenerV2#sni_container_refs} + */ + readonly sniContainerRefs?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#tags LbListenerV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#tenant_id LbListenerV2#tenant_id} + */ + readonly tenantId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#timeouts LbListenerV2#timeouts} + */ + readonly timeouts?: LbListenerV2Timeouts; +} +export interface LbListenerV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#create LbListenerV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#delete LbListenerV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#update LbListenerV2#update} + */ + readonly update?: string; +} + +export function lbListenerV2TimeoutsToTerraform(struct?: LbListenerV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbListenerV2TimeoutsToHclTerraform(struct?: LbListenerV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbListenerV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbListenerV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbListenerV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2 huaweicloud_lb_listener_v2} +*/ +export class LbListenerV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_listener_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbListenerV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbListenerV2 to import + * @param importFromId The id of the existing LbListenerV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbListenerV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_listener_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener_v2 huaweicloud_lb_listener_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbListenerV2Config + */ + public constructor(scope: Construct, id: string, config: LbListenerV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_listener_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._connectionLimit = config.connectionLimit; + this._defaultPoolId = config.defaultPoolId; + this._defaultTlsContainerRef = config.defaultTlsContainerRef; + this._description = config.description; + this._http2Enable = config.http2Enable; + this._id = config.id; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protocol = config.protocol; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._sniContainerRefs = config.sniContainerRefs; + this._tags = config.tags; + this._tenantId = config.tenantId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // connection_limit - computed: true, optional: true, required: false + private _connectionLimit?: number; + public get connectionLimit() { + return this.getNumberAttribute('connection_limit'); + } + public set connectionLimit(value: number) { + this._connectionLimit = value; + } + public resetConnectionLimit() { + this._connectionLimit = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionLimitInput() { + return this._connectionLimit; + } + + // default_pool_id - computed: true, optional: true, required: false + private _defaultPoolId?: string; + public get defaultPoolId() { + return this.getStringAttribute('default_pool_id'); + } + public set defaultPoolId(value: string) { + this._defaultPoolId = value; + } + public resetDefaultPoolId() { + this._defaultPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultPoolIdInput() { + return this._defaultPoolId; + } + + // default_tls_container_ref - computed: false, optional: true, required: false + private _defaultTlsContainerRef?: string; + public get defaultTlsContainerRef() { + return this.getStringAttribute('default_tls_container_ref'); + } + public set defaultTlsContainerRef(value: string) { + this._defaultTlsContainerRef = value; + } + public resetDefaultTlsContainerRef() { + this._defaultTlsContainerRef = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultTlsContainerRefInput() { + return this._defaultTlsContainerRef; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // http2_enable - computed: false, optional: true, required: false + private _http2Enable?: boolean | cdktf.IResolvable; + public get http2Enable() { + return this.getBooleanAttribute('http2_enable'); + } + public set http2Enable(value: boolean | cdktf.IResolvable) { + this._http2Enable = value; + } + public resetHttp2Enable() { + this._http2Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get http2EnableInput() { + return this._http2Enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_id - computed: false, optional: false, required: true + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sni_container_refs - computed: false, optional: true, required: false + private _sniContainerRefs?: string[]; + public get sniContainerRefs() { + return this.getListAttribute('sni_container_refs'); + } + public set sniContainerRefs(value: string[]) { + this._sniContainerRefs = value; + } + public resetSniContainerRefs() { + this._sniContainerRefs = undefined; + } + // Temporarily expose input value. Use with caution. + public get sniContainerRefsInput() { + return this._sniContainerRefs; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbListenerV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbListenerV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + connection_limit: cdktf.numberToTerraform(this._connectionLimit), + default_pool_id: cdktf.stringToTerraform(this._defaultPoolId), + default_tls_container_ref: cdktf.stringToTerraform(this._defaultTlsContainerRef), + description: cdktf.stringToTerraform(this._description), + http2_enable: cdktf.booleanToTerraform(this._http2Enable), + id: cdktf.stringToTerraform(this._id), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + sni_container_refs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sniContainerRefs), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tenant_id: cdktf.stringToTerraform(this._tenantId), + timeouts: lbListenerV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + connection_limit: { + value: cdktf.numberToHclTerraform(this._connectionLimit), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + default_pool_id: { + value: cdktf.stringToHclTerraform(this._defaultPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default_tls_container_ref: { + value: cdktf.stringToHclTerraform(this._defaultTlsContainerRef), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http2_enable: { + value: cdktf.booleanToHclTerraform(this._http2Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sni_container_refs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sniContainerRefs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbListenerV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbListenerV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-listener/README.md b/src/constructs/providers/huaweicloud/lb-listener/README.md new file mode 100644 index 00000000..f27c1dca --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-listener/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_listener` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_listener`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener). diff --git a/src/constructs/providers/huaweicloud/lb-listener/index.ts b/src/constructs/providers/huaweicloud/lb-listener/index.ts new file mode 100644 index 00000000..d4c4104c --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-listener/index.ts @@ -0,0 +1,689 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbListenerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#admin_state_up LbListener#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#connection_limit LbListener#connection_limit} + */ + readonly connectionLimit?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#default_pool_id LbListener#default_pool_id} + */ + readonly defaultPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#default_tls_container_ref LbListener#default_tls_container_ref} + */ + readonly defaultTlsContainerRef?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#description LbListener#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#http2_enable LbListener#http2_enable} + */ + readonly http2Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#id LbListener#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#loadbalancer_id LbListener#loadbalancer_id} + */ + readonly loadbalancerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#name LbListener#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#protocol LbListener#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#protocol_port LbListener#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#region LbListener#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#sni_container_refs LbListener#sni_container_refs} + */ + readonly sniContainerRefs?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#tags LbListener#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#tenant_id LbListener#tenant_id} + */ + readonly tenantId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#timeouts LbListener#timeouts} + */ + readonly timeouts?: LbListenerTimeouts; +} +export interface LbListenerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#create LbListener#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#delete LbListener#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#update LbListener#update} + */ + readonly update?: string; +} + +export function lbListenerTimeoutsToTerraform(struct?: LbListenerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbListenerTimeoutsToHclTerraform(struct?: LbListenerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbListenerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbListenerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbListenerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener huaweicloud_lb_listener} +*/ +export class LbListener extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_listener"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbListener resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbListener to import + * @param importFromId The id of the existing LbListener that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbListener to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_listener", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_listener huaweicloud_lb_listener} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbListenerConfig + */ + public constructor(scope: Construct, id: string, config: LbListenerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_listener', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._connectionLimit = config.connectionLimit; + this._defaultPoolId = config.defaultPoolId; + this._defaultTlsContainerRef = config.defaultTlsContainerRef; + this._description = config.description; + this._http2Enable = config.http2Enable; + this._id = config.id; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protocol = config.protocol; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._sniContainerRefs = config.sniContainerRefs; + this._tags = config.tags; + this._tenantId = config.tenantId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // connection_limit - computed: true, optional: true, required: false + private _connectionLimit?: number; + public get connectionLimit() { + return this.getNumberAttribute('connection_limit'); + } + public set connectionLimit(value: number) { + this._connectionLimit = value; + } + public resetConnectionLimit() { + this._connectionLimit = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionLimitInput() { + return this._connectionLimit; + } + + // default_pool_id - computed: true, optional: true, required: false + private _defaultPoolId?: string; + public get defaultPoolId() { + return this.getStringAttribute('default_pool_id'); + } + public set defaultPoolId(value: string) { + this._defaultPoolId = value; + } + public resetDefaultPoolId() { + this._defaultPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultPoolIdInput() { + return this._defaultPoolId; + } + + // default_tls_container_ref - computed: false, optional: true, required: false + private _defaultTlsContainerRef?: string; + public get defaultTlsContainerRef() { + return this.getStringAttribute('default_tls_container_ref'); + } + public set defaultTlsContainerRef(value: string) { + this._defaultTlsContainerRef = value; + } + public resetDefaultTlsContainerRef() { + this._defaultTlsContainerRef = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultTlsContainerRefInput() { + return this._defaultTlsContainerRef; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // http2_enable - computed: false, optional: true, required: false + private _http2Enable?: boolean | cdktf.IResolvable; + public get http2Enable() { + return this.getBooleanAttribute('http2_enable'); + } + public set http2Enable(value: boolean | cdktf.IResolvable) { + this._http2Enable = value; + } + public resetHttp2Enable() { + this._http2Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get http2EnableInput() { + return this._http2Enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_id - computed: false, optional: false, required: true + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sni_container_refs - computed: false, optional: true, required: false + private _sniContainerRefs?: string[]; + public get sniContainerRefs() { + return this.getListAttribute('sni_container_refs'); + } + public set sniContainerRefs(value: string[]) { + this._sniContainerRefs = value; + } + public resetSniContainerRefs() { + this._sniContainerRefs = undefined; + } + // Temporarily expose input value. Use with caution. + public get sniContainerRefsInput() { + return this._sniContainerRefs; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbListenerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbListenerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + connection_limit: cdktf.numberToTerraform(this._connectionLimit), + default_pool_id: cdktf.stringToTerraform(this._defaultPoolId), + default_tls_container_ref: cdktf.stringToTerraform(this._defaultTlsContainerRef), + description: cdktf.stringToTerraform(this._description), + http2_enable: cdktf.booleanToTerraform(this._http2Enable), + id: cdktf.stringToTerraform(this._id), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + sni_container_refs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sniContainerRefs), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tenant_id: cdktf.stringToTerraform(this._tenantId), + timeouts: lbListenerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + connection_limit: { + value: cdktf.numberToHclTerraform(this._connectionLimit), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + default_pool_id: { + value: cdktf.stringToHclTerraform(this._defaultPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default_tls_container_ref: { + value: cdktf.stringToHclTerraform(this._defaultTlsContainerRef), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http2_enable: { + value: cdktf.booleanToHclTerraform(this._http2Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sni_container_refs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sniContainerRefs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbListenerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbListenerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-loadbalancer-v2/README.md b/src/constructs/providers/huaweicloud/lb-loadbalancer-v2/README.md new file mode 100644 index 00000000..a581b0c0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-loadbalancer-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_loadbalancer_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_loadbalancer_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2). diff --git a/src/constructs/providers/huaweicloud/lb-loadbalancer-v2/index.ts b/src/constructs/providers/huaweicloud/lb-loadbalancer-v2/index.ts new file mode 100644 index 00000000..71e817e0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-loadbalancer-v2/index.ts @@ -0,0 +1,847 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbLoadbalancerV2Config extends cdktf.TerraformMetaArguments { + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#admin_state_up LbLoadbalancerV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#auto_renew LbLoadbalancerV2#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#charging_mode LbLoadbalancerV2#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#description LbLoadbalancerV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#enterprise_project_id LbLoadbalancerV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#flavor LbLoadbalancerV2#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#id LbLoadbalancerV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#loadbalancer_provider LbLoadbalancerV2#loadbalancer_provider} + */ + readonly loadbalancerProvider?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#name LbLoadbalancerV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#period LbLoadbalancerV2#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#period_unit LbLoadbalancerV2#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#protection_reason LbLoadbalancerV2#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#protection_status LbLoadbalancerV2#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#region LbLoadbalancerV2#region} + */ + readonly region?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#security_group_ids LbLoadbalancerV2#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#tags LbLoadbalancerV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#tenant_id LbLoadbalancerV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#vip_address LbLoadbalancerV2#vip_address} + */ + readonly vipAddress?: string; + /** + * the IPv4 subnet ID of the subnet where the load balancer works + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#vip_subnet_id LbLoadbalancerV2#vip_subnet_id} + */ + readonly vipSubnetId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#timeouts LbLoadbalancerV2#timeouts} + */ + readonly timeouts?: LbLoadbalancerV2Timeouts; +} +export interface LbLoadbalancerV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#create LbLoadbalancerV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#delete LbLoadbalancerV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#update LbLoadbalancerV2#update} + */ + readonly update?: string; +} + +export function lbLoadbalancerV2TimeoutsToTerraform(struct?: LbLoadbalancerV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbLoadbalancerV2TimeoutsToHclTerraform(struct?: LbLoadbalancerV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbLoadbalancerV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbLoadbalancerV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbLoadbalancerV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2 huaweicloud_lb_loadbalancer_v2} +*/ +export class LbLoadbalancerV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_loadbalancer_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbLoadbalancerV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbLoadbalancerV2 to import + * @param importFromId The id of the existing LbLoadbalancerV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbLoadbalancerV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_loadbalancer_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer_v2 huaweicloud_lb_loadbalancer_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbLoadbalancerV2Config + */ + public constructor(scope: Construct, id: string, config: LbLoadbalancerV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_loadbalancer_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._id = config.id; + this._loadbalancerProvider = config.loadbalancerProvider; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._tags = config.tags; + this._tenantId = config.tenantId; + this._vipAddress = config.vipAddress; + this._vipSubnetId = config.vipSubnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // frozen_scene - computed: true, optional: false, required: false + public get frozenScene() { + return this.getStringAttribute('frozen_scene'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_provider - computed: true, optional: true, required: false + private _loadbalancerProvider?: string; + public get loadbalancerProvider() { + return this.getStringAttribute('loadbalancer_provider'); + } + public set loadbalancerProvider(value: string) { + this._loadbalancerProvider = value; + } + public resetLoadbalancerProvider() { + this._loadbalancerProvider = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerProviderInput() { + return this._loadbalancerProvider; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vip_address - computed: true, optional: true, required: false + private _vipAddress?: string; + public get vipAddress() { + return this.getStringAttribute('vip_address'); + } + public set vipAddress(value: string) { + this._vipAddress = value; + } + public resetVipAddress() { + this._vipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get vipAddressInput() { + return this._vipAddress; + } + + // vip_port_id - computed: true, optional: false, required: false + public get vipPortId() { + return this.getStringAttribute('vip_port_id'); + } + + // vip_subnet_id - computed: false, optional: false, required: true + private _vipSubnetId?: string; + public get vipSubnetId() { + return this.getStringAttribute('vip_subnet_id'); + } + public set vipSubnetId(value: string) { + this._vipSubnetId = value; + } + // Temporarily expose input value. Use with caution. + public get vipSubnetIdInput() { + return this._vipSubnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbLoadbalancerV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbLoadbalancerV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + loadbalancer_provider: cdktf.stringToTerraform(this._loadbalancerProvider), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tenant_id: cdktf.stringToTerraform(this._tenantId), + vip_address: cdktf.stringToTerraform(this._vipAddress), + vip_subnet_id: cdktf.stringToTerraform(this._vipSubnetId), + timeouts: lbLoadbalancerV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_provider: { + value: cdktf.stringToHclTerraform(this._loadbalancerProvider), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_address: { + value: cdktf.stringToHclTerraform(this._vipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_subnet_id: { + value: cdktf.stringToHclTerraform(this._vipSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbLoadbalancerV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbLoadbalancerV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-loadbalancer/README.md b/src/constructs/providers/huaweicloud/lb-loadbalancer/README.md new file mode 100644 index 00000000..c0bc1f88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-loadbalancer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_loadbalancer` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_loadbalancer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer). diff --git a/src/constructs/providers/huaweicloud/lb-loadbalancer/index.ts b/src/constructs/providers/huaweicloud/lb-loadbalancer/index.ts new file mode 100644 index 00000000..7eb5e578 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-loadbalancer/index.ts @@ -0,0 +1,847 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbLoadbalancerConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#admin_state_up LbLoadbalancer#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#auto_renew LbLoadbalancer#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#charging_mode LbLoadbalancer#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#description LbLoadbalancer#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#enterprise_project_id LbLoadbalancer#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#flavor LbLoadbalancer#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#id LbLoadbalancer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#loadbalancer_provider LbLoadbalancer#loadbalancer_provider} + */ + readonly loadbalancerProvider?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#name LbLoadbalancer#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#period LbLoadbalancer#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#period_unit LbLoadbalancer#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#protection_reason LbLoadbalancer#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#protection_status LbLoadbalancer#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#region LbLoadbalancer#region} + */ + readonly region?: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#security_group_ids LbLoadbalancer#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#tags LbLoadbalancer#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#tenant_id LbLoadbalancer#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#vip_address LbLoadbalancer#vip_address} + */ + readonly vipAddress?: string; + /** + * the IPv4 subnet ID of the subnet where the load balancer works + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#vip_subnet_id LbLoadbalancer#vip_subnet_id} + */ + readonly vipSubnetId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#timeouts LbLoadbalancer#timeouts} + */ + readonly timeouts?: LbLoadbalancerTimeouts; +} +export interface LbLoadbalancerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#create LbLoadbalancer#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#delete LbLoadbalancer#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#update LbLoadbalancer#update} + */ + readonly update?: string; +} + +export function lbLoadbalancerTimeoutsToTerraform(struct?: LbLoadbalancerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbLoadbalancerTimeoutsToHclTerraform(struct?: LbLoadbalancerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbLoadbalancerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbLoadbalancerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbLoadbalancerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer huaweicloud_lb_loadbalancer} +*/ +export class LbLoadbalancer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_loadbalancer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbLoadbalancer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbLoadbalancer to import + * @param importFromId The id of the existing LbLoadbalancer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbLoadbalancer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_loadbalancer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_loadbalancer huaweicloud_lb_loadbalancer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbLoadbalancerConfig + */ + public constructor(scope: Construct, id: string, config: LbLoadbalancerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_loadbalancer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavor = config.flavor; + this._id = config.id; + this._loadbalancerProvider = config.loadbalancerProvider; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._tags = config.tags; + this._tenantId = config.tenantId; + this._vipAddress = config.vipAddress; + this._vipSubnetId = config.vipSubnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charge_mode - computed: true, optional: false, required: false + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // frozen_scene - computed: true, optional: false, required: false + public get frozenScene() { + return this.getStringAttribute('frozen_scene'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // loadbalancer_provider - computed: true, optional: true, required: false + private _loadbalancerProvider?: string; + public get loadbalancerProvider() { + return this.getStringAttribute('loadbalancer_provider'); + } + public set loadbalancerProvider(value: string) { + this._loadbalancerProvider = value; + } + public resetLoadbalancerProvider() { + this._loadbalancerProvider = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerProviderInput() { + return this._loadbalancerProvider; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vip_address - computed: true, optional: true, required: false + private _vipAddress?: string; + public get vipAddress() { + return this.getStringAttribute('vip_address'); + } + public set vipAddress(value: string) { + this._vipAddress = value; + } + public resetVipAddress() { + this._vipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get vipAddressInput() { + return this._vipAddress; + } + + // vip_port_id - computed: true, optional: false, required: false + public get vipPortId() { + return this.getStringAttribute('vip_port_id'); + } + + // vip_subnet_id - computed: false, optional: false, required: true + private _vipSubnetId?: string; + public get vipSubnetId() { + return this.getStringAttribute('vip_subnet_id'); + } + public set vipSubnetId(value: string) { + this._vipSubnetId = value; + } + // Temporarily expose input value. Use with caution. + public get vipSubnetIdInput() { + return this._vipSubnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbLoadbalancerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbLoadbalancerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + loadbalancer_provider: cdktf.stringToTerraform(this._loadbalancerProvider), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tenant_id: cdktf.stringToTerraform(this._tenantId), + vip_address: cdktf.stringToTerraform(this._vipAddress), + vip_subnet_id: cdktf.stringToTerraform(this._vipSubnetId), + timeouts: lbLoadbalancerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_provider: { + value: cdktf.stringToHclTerraform(this._loadbalancerProvider), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_address: { + value: cdktf.stringToHclTerraform(this._vipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_subnet_id: { + value: cdktf.stringToHclTerraform(this._vipSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbLoadbalancerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbLoadbalancerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-member-v2/README.md b/src/constructs/providers/huaweicloud/lb-member-v2/README.md new file mode 100644 index 00000000..2f2d68f4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-member-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_member_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_member_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2). diff --git a/src/constructs/providers/huaweicloud/lb-member-v2/index.ts b/src/constructs/providers/huaweicloud/lb-member-v2/index.ts new file mode 100644 index 00000000..c3de5e95 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-member-v2/index.ts @@ -0,0 +1,560 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbMemberV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#address LbMemberV2#address} + */ + readonly address: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#admin_state_up LbMemberV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#id LbMemberV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#name LbMemberV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#pool_id LbMemberV2#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#protocol_port LbMemberV2#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#region LbMemberV2#region} + */ + readonly region?: string; + /** + * the IPv4 subnet ID of the subnet in which to access the member + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#subnet_id LbMemberV2#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#tenant_id LbMemberV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#weight LbMemberV2#weight} + */ + readonly weight?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#timeouts LbMemberV2#timeouts} + */ + readonly timeouts?: LbMemberV2Timeouts; +} +export interface LbMemberV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#create LbMemberV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#delete LbMemberV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#update LbMemberV2#update} + */ + readonly update?: string; +} + +export function lbMemberV2TimeoutsToTerraform(struct?: LbMemberV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbMemberV2TimeoutsToHclTerraform(struct?: LbMemberV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbMemberV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbMemberV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbMemberV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2 huaweicloud_lb_member_v2} +*/ +export class LbMemberV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_member_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbMemberV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbMemberV2 to import + * @param importFromId The id of the existing LbMemberV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbMemberV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_member_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member_v2 huaweicloud_lb_member_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbMemberV2Config + */ + public constructor(scope: Construct, id: string, config: LbMemberV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_member_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._adminStateUp = config.adminStateUp; + this._id = config.id; + this._name = config.name; + this._poolId = config.poolId; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._subnetId = config.subnetId; + this._tenantId = config.tenantId; + this._weight = config.weight; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // backend_server_status - computed: true, optional: false, required: false + public get backendServerStatus() { + return this.getBooleanAttribute('backend_server_status'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operating_status - computed: true, optional: false, required: false + public get operatingStatus() { + return this.getStringAttribute('operating_status'); + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbMemberV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbMemberV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tenant_id: cdktf.stringToTerraform(this._tenantId), + weight: cdktf.numberToTerraform(this._weight), + timeouts: lbMemberV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(this._weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: lbMemberV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbMemberV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-member/README.md b/src/constructs/providers/huaweicloud/lb-member/README.md new file mode 100644 index 00000000..15756c14 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-member/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_member` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_member`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member). diff --git a/src/constructs/providers/huaweicloud/lb-member/index.ts b/src/constructs/providers/huaweicloud/lb-member/index.ts new file mode 100644 index 00000000..ef2ae5bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-member/index.ts @@ -0,0 +1,560 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbMemberConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#address LbMember#address} + */ + readonly address: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#admin_state_up LbMember#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#id LbMember#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#name LbMember#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#pool_id LbMember#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#protocol_port LbMember#protocol_port} + */ + readonly protocolPort: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#region LbMember#region} + */ + readonly region?: string; + /** + * the IPv4 subnet ID of the subnet in which to access the member + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#subnet_id LbMember#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#tenant_id LbMember#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#weight LbMember#weight} + */ + readonly weight?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#timeouts LbMember#timeouts} + */ + readonly timeouts?: LbMemberTimeouts; +} +export interface LbMemberTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#create LbMember#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#delete LbMember#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#update LbMember#update} + */ + readonly update?: string; +} + +export function lbMemberTimeoutsToTerraform(struct?: LbMemberTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbMemberTimeoutsToHclTerraform(struct?: LbMemberTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbMemberTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbMemberTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbMemberTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member huaweicloud_lb_member} +*/ +export class LbMember extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_member"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbMember resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbMember to import + * @param importFromId The id of the existing LbMember that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbMember to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_member", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_member huaweicloud_lb_member} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbMemberConfig + */ + public constructor(scope: Construct, id: string, config: LbMemberConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_member', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._address = config.address; + this._adminStateUp = config.adminStateUp; + this._id = config.id; + this._name = config.name; + this._poolId = config.poolId; + this._protocolPort = config.protocolPort; + this._region = config.region; + this._subnetId = config.subnetId; + this._tenantId = config.tenantId; + this._weight = config.weight; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // backend_server_status - computed: true, optional: false, required: false + public get backendServerStatus() { + return this.getBooleanAttribute('backend_server_status'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // operating_status - computed: true, optional: false, required: false + public get operatingStatus() { + return this.getStringAttribute('operating_status'); + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // protocol_port - computed: false, optional: false, required: true + private _protocolPort?: number; + public get protocolPort() { + return this.getNumberAttribute('protocol_port'); + } + public set protocolPort(value: number) { + this._protocolPort = value; + } + // Temporarily expose input value. Use with caution. + public get protocolPortInput() { + return this._protocolPort; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbMemberTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbMemberTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + address: cdktf.stringToTerraform(this._address), + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + protocol_port: cdktf.numberToTerraform(this._protocolPort), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tenant_id: cdktf.stringToTerraform(this._tenantId), + weight: cdktf.numberToTerraform(this._weight), + timeouts: lbMemberTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + address: { + value: cdktf.stringToHclTerraform(this._address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol_port: { + value: cdktf.numberToHclTerraform(this._protocolPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(this._weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: lbMemberTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbMemberTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-monitor-v2/README.md b/src/constructs/providers/huaweicloud/lb-monitor-v2/README.md new file mode 100644 index 00000000..bf911b88 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-monitor-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_monitor_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_monitor_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2). diff --git a/src/constructs/providers/huaweicloud/lb-monitor-v2/index.ts b/src/constructs/providers/huaweicloud/lb-monitor-v2/index.ts new file mode 100644 index 00000000..6fc7e859 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-monitor-v2/index.ts @@ -0,0 +1,655 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbMonitorV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#admin_state_up LbMonitorV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#delay LbMonitorV2#delay} + */ + readonly delay: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#expected_codes LbMonitorV2#expected_codes} + */ + readonly expectedCodes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#http_method LbMonitorV2#http_method} + */ + readonly httpMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#id LbMonitorV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#max_retries LbMonitorV2#max_retries} + */ + readonly maxRetries: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#name LbMonitorV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#pool_id LbMonitorV2#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#port LbMonitorV2#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#region LbMonitorV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#tenant_id LbMonitorV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#timeout LbMonitorV2#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#type LbMonitorV2#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#url_path LbMonitorV2#url_path} + */ + readonly urlPath?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#timeouts LbMonitorV2#timeouts} + */ + readonly timeouts?: LbMonitorV2Timeouts; +} +export interface LbMonitorV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#create LbMonitorV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#delete LbMonitorV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#update LbMonitorV2#update} + */ + readonly update?: string; +} + +export function lbMonitorV2TimeoutsToTerraform(struct?: LbMonitorV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbMonitorV2TimeoutsToHclTerraform(struct?: LbMonitorV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbMonitorV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbMonitorV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbMonitorV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2 huaweicloud_lb_monitor_v2} +*/ +export class LbMonitorV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_monitor_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbMonitorV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbMonitorV2 to import + * @param importFromId The id of the existing LbMonitorV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbMonitorV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_monitor_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor_v2 huaweicloud_lb_monitor_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbMonitorV2Config + */ + public constructor(scope: Construct, id: string, config: LbMonitorV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_monitor_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._delay = config.delay; + this._expectedCodes = config.expectedCodes; + this._httpMethod = config.httpMethod; + this._id = config.id; + this._maxRetries = config.maxRetries; + this._name = config.name; + this._poolId = config.poolId; + this._port = config.port; + this._region = config.region; + this._tenantId = config.tenantId; + this._timeout = config.timeout; + this._type = config.type; + this._urlPath = config.urlPath; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // delay - computed: false, optional: false, required: true + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // expected_codes - computed: true, optional: true, required: false + private _expectedCodes?: string; + public get expectedCodes() { + return this.getStringAttribute('expected_codes'); + } + public set expectedCodes(value: string) { + this._expectedCodes = value; + } + public resetExpectedCodes() { + this._expectedCodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get expectedCodesInput() { + return this._expectedCodes; + } + + // http_method - computed: true, optional: true, required: false + private _httpMethod?: string; + public get httpMethod() { + return this.getStringAttribute('http_method'); + } + public set httpMethod(value: string) { + this._httpMethod = value; + } + public resetHttpMethod() { + this._httpMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpMethodInput() { + return this._httpMethod; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_retries - computed: false, optional: false, required: true + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url_path - computed: true, optional: true, required: false + private _urlPath?: string; + public get urlPath() { + return this.getStringAttribute('url_path'); + } + public set urlPath(value: string) { + this._urlPath = value; + } + public resetUrlPath() { + this._urlPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlPathInput() { + return this._urlPath; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbMonitorV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbMonitorV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + delay: cdktf.numberToTerraform(this._delay), + expected_codes: cdktf.stringToTerraform(this._expectedCodes), + http_method: cdktf.stringToTerraform(this._httpMethod), + id: cdktf.stringToTerraform(this._id), + max_retries: cdktf.numberToTerraform(this._maxRetries), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + timeout: cdktf.numberToTerraform(this._timeout), + type: cdktf.stringToTerraform(this._type), + url_path: cdktf.stringToTerraform(this._urlPath), + timeouts: lbMonitorV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delay: { + value: cdktf.numberToHclTerraform(this._delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + expected_codes: { + value: cdktf.stringToHclTerraform(this._expectedCodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_method: { + value: cdktf.stringToHclTerraform(this._httpMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_path: { + value: cdktf.stringToHclTerraform(this._urlPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbMonitorV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbMonitorV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-monitor/README.md b/src/constructs/providers/huaweicloud/lb-monitor/README.md new file mode 100644 index 00000000..71edb8ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-monitor/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_monitor` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_monitor`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor). diff --git a/src/constructs/providers/huaweicloud/lb-monitor/index.ts b/src/constructs/providers/huaweicloud/lb-monitor/index.ts new file mode 100644 index 00000000..d0720f1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-monitor/index.ts @@ -0,0 +1,655 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbMonitorConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#admin_state_up LbMonitor#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#delay LbMonitor#delay} + */ + readonly delay: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#expected_codes LbMonitor#expected_codes} + */ + readonly expectedCodes?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#http_method LbMonitor#http_method} + */ + readonly httpMethod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#id LbMonitor#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#max_retries LbMonitor#max_retries} + */ + readonly maxRetries: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#name LbMonitor#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#pool_id LbMonitor#pool_id} + */ + readonly poolId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#port LbMonitor#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#region LbMonitor#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#tenant_id LbMonitor#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#timeout LbMonitor#timeout} + */ + readonly timeout: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#type LbMonitor#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#url_path LbMonitor#url_path} + */ + readonly urlPath?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#timeouts LbMonitor#timeouts} + */ + readonly timeouts?: LbMonitorTimeouts; +} +export interface LbMonitorTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#create LbMonitor#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#delete LbMonitor#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#update LbMonitor#update} + */ + readonly update?: string; +} + +export function lbMonitorTimeoutsToTerraform(struct?: LbMonitorTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbMonitorTimeoutsToHclTerraform(struct?: LbMonitorTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbMonitorTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbMonitorTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbMonitorTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor huaweicloud_lb_monitor} +*/ +export class LbMonitor extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_monitor"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbMonitor resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbMonitor to import + * @param importFromId The id of the existing LbMonitor that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbMonitor to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_monitor", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_monitor huaweicloud_lb_monitor} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbMonitorConfig + */ + public constructor(scope: Construct, id: string, config: LbMonitorConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_monitor', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._delay = config.delay; + this._expectedCodes = config.expectedCodes; + this._httpMethod = config.httpMethod; + this._id = config.id; + this._maxRetries = config.maxRetries; + this._name = config.name; + this._poolId = config.poolId; + this._port = config.port; + this._region = config.region; + this._tenantId = config.tenantId; + this._timeout = config.timeout; + this._type = config.type; + this._urlPath = config.urlPath; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // delay - computed: false, optional: false, required: true + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // expected_codes - computed: true, optional: true, required: false + private _expectedCodes?: string; + public get expectedCodes() { + return this.getStringAttribute('expected_codes'); + } + public set expectedCodes(value: string) { + this._expectedCodes = value; + } + public resetExpectedCodes() { + this._expectedCodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get expectedCodesInput() { + return this._expectedCodes; + } + + // http_method - computed: true, optional: true, required: false + private _httpMethod?: string; + public get httpMethod() { + return this.getStringAttribute('http_method'); + } + public set httpMethod(value: string) { + this._httpMethod = value; + } + public resetHttpMethod() { + this._httpMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpMethodInput() { + return this._httpMethod; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_retries - computed: false, optional: false, required: true + private _maxRetries?: number; + public get maxRetries() { + return this.getNumberAttribute('max_retries'); + } + public set maxRetries(value: number) { + this._maxRetries = value; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: false, required: true + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url_path - computed: true, optional: true, required: false + private _urlPath?: string; + public get urlPath() { + return this.getStringAttribute('url_path'); + } + public set urlPath(value: string) { + this._urlPath = value; + } + public resetUrlPath() { + this._urlPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlPathInput() { + return this._urlPath; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbMonitorTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbMonitorTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + delay: cdktf.numberToTerraform(this._delay), + expected_codes: cdktf.stringToTerraform(this._expectedCodes), + http_method: cdktf.stringToTerraform(this._httpMethod), + id: cdktf.stringToTerraform(this._id), + max_retries: cdktf.numberToTerraform(this._maxRetries), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + port: cdktf.numberToTerraform(this._port), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + timeout: cdktf.numberToTerraform(this._timeout), + type: cdktf.stringToTerraform(this._type), + url_path: cdktf.stringToTerraform(this._urlPath), + timeouts: lbMonitorTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delay: { + value: cdktf.numberToHclTerraform(this._delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + expected_codes: { + value: cdktf.stringToHclTerraform(this._expectedCodes), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_method: { + value: cdktf.stringToHclTerraform(this._httpMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(this._port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(this._timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url_path: { + value: cdktf.stringToHclTerraform(this._urlPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbMonitorTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbMonitorTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-pool-v2/README.md b/src/constructs/providers/huaweicloud/lb-pool-v2/README.md new file mode 100644 index 00000000..f5a3f594 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-pool-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_pool_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_pool_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2). diff --git a/src/constructs/providers/huaweicloud/lb-pool-v2/index.ts b/src/constructs/providers/huaweicloud/lb-pool-v2/index.ts new file mode 100644 index 00000000..9d1151af --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-pool-v2/index.ts @@ -0,0 +1,822 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbPoolV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#admin_state_up LbPoolV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#description LbPoolV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#id LbPoolV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#lb_method LbPoolV2#lb_method} + */ + readonly lbMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#listener_id LbPoolV2#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#loadbalancer_id LbPoolV2#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#name LbPoolV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#protection_reason LbPoolV2#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#protection_status LbPoolV2#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#protocol LbPoolV2#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#region LbPoolV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#tenant_id LbPoolV2#tenant_id} + */ + readonly tenantId?: string; + /** + * persistence block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#persistence LbPoolV2#persistence} + */ + readonly persistence?: LbPoolV2Persistence[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#timeouts LbPoolV2#timeouts} + */ + readonly timeouts?: LbPoolV2Timeouts; +} +export interface LbPoolV2Persistence { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#cookie_name LbPoolV2#cookie_name} + */ + readonly cookieName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#timeout LbPoolV2#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#type LbPoolV2#type} + */ + readonly type: string; +} + +export function lbPoolV2PersistenceToTerraform(struct?: LbPoolV2Persistence | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cookie_name: cdktf.stringToTerraform(struct!.cookieName), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function lbPoolV2PersistenceToHclTerraform(struct?: LbPoolV2Persistence | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cookie_name: { + value: cdktf.stringToHclTerraform(struct!.cookieName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbPoolV2PersistenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LbPoolV2Persistence | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cookieName !== undefined) { + hasAnyValues = true; + internalValueResult.cookieName = this._cookieName; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbPoolV2Persistence | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cookieName = undefined; + this._timeout = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cookieName = value.cookieName; + this._timeout = value.timeout; + this._type = value.type; + } + } + + // cookie_name - computed: false, optional: true, required: false + private _cookieName?: string; + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + public set cookieName(value: string) { + this._cookieName = value; + } + public resetCookieName() { + this._cookieName = undefined; + } + // Temporarily expose input value. Use with caution. + public get cookieNameInput() { + return this._cookieName; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class LbPoolV2PersistenceList extends cdktf.ComplexList { + public internalValue? : LbPoolV2Persistence[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LbPoolV2PersistenceOutputReference { + return new LbPoolV2PersistenceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LbPoolV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#create LbPoolV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#delete LbPoolV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#update LbPoolV2#update} + */ + readonly update?: string; +} + +export function lbPoolV2TimeoutsToTerraform(struct?: LbPoolV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbPoolV2TimeoutsToHclTerraform(struct?: LbPoolV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbPoolV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbPoolV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbPoolV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2 huaweicloud_lb_pool_v2} +*/ +export class LbPoolV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_pool_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbPoolV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbPoolV2 to import + * @param importFromId The id of the existing LbPoolV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbPoolV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_pool_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool_v2 huaweicloud_lb_pool_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbPoolV2Config + */ + public constructor(scope: Construct, id: string, config: LbPoolV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_pool_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._lbMethod = config.lbMethod; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._protocol = config.protocol; + this._region = config.region; + this._tenantId = config.tenantId; + this._persistence.internalValue = config.persistence; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_method - computed: false, optional: false, required: true + private _lbMethod?: string; + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + public set lbMethod(value: string) { + this._lbMethod = value; + } + // Temporarily expose input value. Use with caution. + public get lbMethodInput() { + return this._lbMethod; + } + + // listener_id - computed: true, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // loadbalancer_id - computed: true, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // monitor_id - computed: true, optional: false, required: false + public get monitorId() { + return this.getStringAttribute('monitor_id'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // persistence - computed: false, optional: true, required: false + private _persistence = new LbPoolV2PersistenceList(this, "persistence", false); + public get persistence() { + return this._persistence; + } + public putPersistence(value: LbPoolV2Persistence[] | cdktf.IResolvable) { + this._persistence.internalValue = value; + } + public resetPersistence() { + this._persistence.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get persistenceInput() { + return this._persistence.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbPoolV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbPoolV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + lb_method: cdktf.stringToTerraform(this._lbMethod), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + persistence: cdktf.listMapper(lbPoolV2PersistenceToTerraform, true)(this._persistence.internalValue), + timeouts: lbPoolV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_method: { + value: cdktf.stringToHclTerraform(this._lbMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + persistence: { + value: cdktf.listMapperHcl(lbPoolV2PersistenceToHclTerraform, true)(this._persistence.internalValue), + isBlock: true, + type: "list", + storageClassType: "LbPoolV2PersistenceList", + }, + timeouts: { + value: lbPoolV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbPoolV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-pool/README.md b/src/constructs/providers/huaweicloud/lb-pool/README.md new file mode 100644 index 00000000..0dc7d79e --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-pool/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_pool` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool). diff --git a/src/constructs/providers/huaweicloud/lb-pool/index.ts b/src/constructs/providers/huaweicloud/lb-pool/index.ts new file mode 100644 index 00000000..0c9136e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-pool/index.ts @@ -0,0 +1,822 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbPoolConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#admin_state_up LbPool#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#description LbPool#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#id LbPool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#lb_method LbPool#lb_method} + */ + readonly lbMethod: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#listener_id LbPool#listener_id} + */ + readonly listenerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#loadbalancer_id LbPool#loadbalancer_id} + */ + readonly loadbalancerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#name LbPool#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#protection_reason LbPool#protection_reason} + */ + readonly protectionReason?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#protection_status LbPool#protection_status} + */ + readonly protectionStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#protocol LbPool#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#region LbPool#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#tenant_id LbPool#tenant_id} + */ + readonly tenantId?: string; + /** + * persistence block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#persistence LbPool#persistence} + */ + readonly persistence?: LbPoolPersistence[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#timeouts LbPool#timeouts} + */ + readonly timeouts?: LbPoolTimeouts; +} +export interface LbPoolPersistence { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#cookie_name LbPool#cookie_name} + */ + readonly cookieName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#timeout LbPool#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#type LbPool#type} + */ + readonly type: string; +} + +export function lbPoolPersistenceToTerraform(struct?: LbPoolPersistence | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cookie_name: cdktf.stringToTerraform(struct!.cookieName), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function lbPoolPersistenceToHclTerraform(struct?: LbPoolPersistence | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cookie_name: { + value: cdktf.stringToHclTerraform(struct!.cookieName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbPoolPersistenceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LbPoolPersistence | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cookieName !== undefined) { + hasAnyValues = true; + internalValueResult.cookieName = this._cookieName; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbPoolPersistence | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._cookieName = undefined; + this._timeout = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._cookieName = value.cookieName; + this._timeout = value.timeout; + this._type = value.type; + } + } + + // cookie_name - computed: false, optional: true, required: false + private _cookieName?: string; + public get cookieName() { + return this.getStringAttribute('cookie_name'); + } + public set cookieName(value: string) { + this._cookieName = value; + } + public resetCookieName() { + this._cookieName = undefined; + } + // Temporarily expose input value. Use with caution. + public get cookieNameInput() { + return this._cookieName; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class LbPoolPersistenceList extends cdktf.ComplexList { + public internalValue? : LbPoolPersistence[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LbPoolPersistenceOutputReference { + return new LbPoolPersistenceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LbPoolTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#create LbPool#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#delete LbPool#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#update LbPool#update} + */ + readonly update?: string; +} + +export function lbPoolTimeoutsToTerraform(struct?: LbPoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbPoolTimeoutsToHclTerraform(struct?: LbPoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbPoolTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbPoolTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbPoolTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool huaweicloud_lb_pool} +*/ +export class LbPool extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbPool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbPool to import + * @param importFromId The id of the existing LbPool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbPool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_pool huaweicloud_lb_pool} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbPoolConfig + */ + public constructor(scope: Construct, id: string, config: LbPoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._lbMethod = config.lbMethod; + this._listenerId = config.listenerId; + this._loadbalancerId = config.loadbalancerId; + this._name = config.name; + this._protectionReason = config.protectionReason; + this._protectionStatus = config.protectionStatus; + this._protocol = config.protocol; + this._region = config.region; + this._tenantId = config.tenantId; + this._persistence.internalValue = config.persistence; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lb_method - computed: false, optional: false, required: true + private _lbMethod?: string; + public get lbMethod() { + return this.getStringAttribute('lb_method'); + } + public set lbMethod(value: string) { + this._lbMethod = value; + } + // Temporarily expose input value. Use with caution. + public get lbMethodInput() { + return this._lbMethod; + } + + // listener_id - computed: true, optional: true, required: false + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + public resetListenerId() { + this._listenerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // loadbalancer_id - computed: true, optional: true, required: false + private _loadbalancerId?: string; + public get loadbalancerId() { + return this.getStringAttribute('loadbalancer_id'); + } + public set loadbalancerId(value: string) { + this._loadbalancerId = value; + } + public resetLoadbalancerId() { + this._loadbalancerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get loadbalancerIdInput() { + return this._loadbalancerId; + } + + // monitor_id - computed: true, optional: false, required: false + public get monitorId() { + return this.getStringAttribute('monitor_id'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protection_reason - computed: false, optional: true, required: false + private _protectionReason?: string; + public get protectionReason() { + return this.getStringAttribute('protection_reason'); + } + public set protectionReason(value: string) { + this._protectionReason = value; + } + public resetProtectionReason() { + this._protectionReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionReasonInput() { + return this._protectionReason; + } + + // protection_status - computed: true, optional: true, required: false + private _protectionStatus?: string; + public get protectionStatus() { + return this.getStringAttribute('protection_status'); + } + public set protectionStatus(value: string) { + this._protectionStatus = value; + } + public resetProtectionStatus() { + this._protectionStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionStatusInput() { + return this._protectionStatus; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // persistence - computed: false, optional: true, required: false + private _persistence = new LbPoolPersistenceList(this, "persistence", false); + public get persistence() { + return this._persistence; + } + public putPersistence(value: LbPoolPersistence[] | cdktf.IResolvable) { + this._persistence.internalValue = value; + } + public resetPersistence() { + this._persistence.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get persistenceInput() { + return this._persistence.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbPoolTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbPoolTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + lb_method: cdktf.stringToTerraform(this._lbMethod), + listener_id: cdktf.stringToTerraform(this._listenerId), + loadbalancer_id: cdktf.stringToTerraform(this._loadbalancerId), + name: cdktf.stringToTerraform(this._name), + protection_reason: cdktf.stringToTerraform(this._protectionReason), + protection_status: cdktf.stringToTerraform(this._protectionStatus), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + persistence: cdktf.listMapper(lbPoolPersistenceToTerraform, true)(this._persistence.internalValue), + timeouts: lbPoolTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lb_method: { + value: cdktf.stringToHclTerraform(this._lbMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + loadbalancer_id: { + value: cdktf.stringToHclTerraform(this._loadbalancerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_reason: { + value: cdktf.stringToHclTerraform(this._protectionReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_status: { + value: cdktf.stringToHclTerraform(this._protectionStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + persistence: { + value: cdktf.listMapperHcl(lbPoolPersistenceToHclTerraform, true)(this._persistence.internalValue), + isBlock: true, + type: "list", + storageClassType: "LbPoolPersistenceList", + }, + timeouts: { + value: lbPoolTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbPoolTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-whitelist-v2/README.md b/src/constructs/providers/huaweicloud/lb-whitelist-v2/README.md new file mode 100644 index 00000000..3561780d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-whitelist-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_whitelist_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_whitelist_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2). diff --git a/src/constructs/providers/huaweicloud/lb-whitelist-v2/index.ts b/src/constructs/providers/huaweicloud/lb-whitelist-v2/index.ts new file mode 100644 index 00000000..02cae59a --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-whitelist-v2/index.ts @@ -0,0 +1,443 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbWhitelistV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#enable_whitelist LbWhitelistV2#enable_whitelist} + */ + readonly enableWhitelist?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#id LbWhitelistV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#listener_id LbWhitelistV2#listener_id} + */ + readonly listenerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#region LbWhitelistV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#tenant_id LbWhitelistV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#whitelist LbWhitelistV2#whitelist} + */ + readonly whitelist?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#timeouts LbWhitelistV2#timeouts} + */ + readonly timeouts?: LbWhitelistV2Timeouts; +} +export interface LbWhitelistV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#create LbWhitelistV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#delete LbWhitelistV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#update LbWhitelistV2#update} + */ + readonly update?: string; +} + +export function lbWhitelistV2TimeoutsToTerraform(struct?: LbWhitelistV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbWhitelistV2TimeoutsToHclTerraform(struct?: LbWhitelistV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbWhitelistV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbWhitelistV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbWhitelistV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2 huaweicloud_lb_whitelist_v2} +*/ +export class LbWhitelistV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_whitelist_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbWhitelistV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbWhitelistV2 to import + * @param importFromId The id of the existing LbWhitelistV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbWhitelistV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_whitelist_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist_v2 huaweicloud_lb_whitelist_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbWhitelistV2Config + */ + public constructor(scope: Construct, id: string, config: LbWhitelistV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_whitelist_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableWhitelist = config.enableWhitelist; + this._id = config.id; + this._listenerId = config.listenerId; + this._region = config.region; + this._tenantId = config.tenantId; + this._whitelist = config.whitelist; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_whitelist - computed: false, optional: true, required: false + private _enableWhitelist?: boolean | cdktf.IResolvable; + public get enableWhitelist() { + return this.getBooleanAttribute('enable_whitelist'); + } + public set enableWhitelist(value: boolean | cdktf.IResolvable) { + this._enableWhitelist = value; + } + public resetEnableWhitelist() { + this._enableWhitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableWhitelistInput() { + return this._enableWhitelist; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: false, required: true + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string; + public get whitelist() { + return this.getStringAttribute('whitelist'); + } + public set whitelist(value: string) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbWhitelistV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbWhitelistV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_whitelist: cdktf.booleanToTerraform(this._enableWhitelist), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + whitelist: cdktf.stringToTerraform(this._whitelist), + timeouts: lbWhitelistV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_whitelist: { + value: cdktf.booleanToHclTerraform(this._enableWhitelist), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist: { + value: cdktf.stringToHclTerraform(this._whitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbWhitelistV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbWhitelistV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lb-whitelist/README.md b/src/constructs/providers/huaweicloud/lb-whitelist/README.md new file mode 100644 index 00000000..af73e19a --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-whitelist/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lb_whitelist` + +Refer to the Terraform Registry for docs: [`huaweicloud_lb_whitelist`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist). diff --git a/src/constructs/providers/huaweicloud/lb-whitelist/index.ts b/src/constructs/providers/huaweicloud/lb-whitelist/index.ts new file mode 100644 index 00000000..8f698534 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lb-whitelist/index.ts @@ -0,0 +1,443 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LbWhitelistConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#enable_whitelist LbWhitelist#enable_whitelist} + */ + readonly enableWhitelist?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#id LbWhitelist#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#listener_id LbWhitelist#listener_id} + */ + readonly listenerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#region LbWhitelist#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#tenant_id LbWhitelist#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#whitelist LbWhitelist#whitelist} + */ + readonly whitelist?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#timeouts LbWhitelist#timeouts} + */ + readonly timeouts?: LbWhitelistTimeouts; +} +export interface LbWhitelistTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#create LbWhitelist#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#delete LbWhitelist#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#update LbWhitelist#update} + */ + readonly update?: string; +} + +export function lbWhitelistTimeoutsToTerraform(struct?: LbWhitelistTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function lbWhitelistTimeoutsToHclTerraform(struct?: LbWhitelistTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LbWhitelistTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LbWhitelistTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LbWhitelistTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist huaweicloud_lb_whitelist} +*/ +export class LbWhitelist extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lb_whitelist"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LbWhitelist resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LbWhitelist to import + * @param importFromId The id of the existing LbWhitelist that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LbWhitelist to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lb_whitelist", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lb_whitelist huaweicloud_lb_whitelist} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LbWhitelistConfig + */ + public constructor(scope: Construct, id: string, config: LbWhitelistConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lb_whitelist', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableWhitelist = config.enableWhitelist; + this._id = config.id; + this._listenerId = config.listenerId; + this._region = config.region; + this._tenantId = config.tenantId; + this._whitelist = config.whitelist; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_whitelist - computed: false, optional: true, required: false + private _enableWhitelist?: boolean | cdktf.IResolvable; + public get enableWhitelist() { + return this.getBooleanAttribute('enable_whitelist'); + } + public set enableWhitelist(value: boolean | cdktf.IResolvable) { + this._enableWhitelist = value; + } + public resetEnableWhitelist() { + this._enableWhitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableWhitelistInput() { + return this._enableWhitelist; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // listener_id - computed: false, optional: false, required: true + private _listenerId?: string; + public get listenerId() { + return this.getStringAttribute('listener_id'); + } + public set listenerId(value: string) { + this._listenerId = value; + } + // Temporarily expose input value. Use with caution. + public get listenerIdInput() { + return this._listenerId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string; + public get whitelist() { + return this.getStringAttribute('whitelist'); + } + public set whitelist(value: string) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LbWhitelistTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LbWhitelistTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_whitelist: cdktf.booleanToTerraform(this._enableWhitelist), + id: cdktf.stringToTerraform(this._id), + listener_id: cdktf.stringToTerraform(this._listenerId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + whitelist: cdktf.stringToTerraform(this._whitelist), + timeouts: lbWhitelistTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_whitelist: { + value: cdktf.booleanToHclTerraform(this._enableWhitelist), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + listener_id: { + value: cdktf.stringToHclTerraform(this._listenerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist: { + value: cdktf.stringToHclTerraform(this._whitelist), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: lbWhitelistTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LbWhitelistTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/live-bucket-authorization/README.md b/src/constructs/providers/huaweicloud/live-bucket-authorization/README.md new file mode 100644 index 00000000..6e7b4a1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-bucket-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_live_bucket_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_live_bucket_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization). diff --git a/src/constructs/providers/huaweicloud/live-bucket-authorization/index.ts b/src/constructs/providers/huaweicloud/live-bucket-authorization/index.ts new file mode 100644 index 00000000..83a38c6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-bucket-authorization/index.ts @@ -0,0 +1,171 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LiveBucketAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the bucket name of the OBS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization#bucket LiveBucketAuthorization#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization#id LiveBucketAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization#region LiveBucketAuthorization#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization huaweicloud_live_bucket_authorization} +*/ +export class LiveBucketAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_bucket_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LiveBucketAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LiveBucketAuthorization to import + * @param importFromId The id of the existing LiveBucketAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LiveBucketAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_bucket_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_bucket_authorization huaweicloud_live_bucket_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LiveBucketAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: LiveBucketAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_bucket_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/live-domain/README.md b/src/constructs/providers/huaweicloud/live-domain/README.md new file mode 100644 index 00000000..a01a19fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-domain/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_live_domain` + +Refer to the Terraform Registry for docs: [`huaweicloud_live_domain`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain). diff --git a/src/constructs/providers/huaweicloud/live-domain/index.ts b/src/constructs/providers/huaweicloud/live-domain/index.ts new file mode 100644 index 00000000..6c7a3d81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-domain/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LiveDomainConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#id LiveDomain#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#ingest_domain_name LiveDomain#ingest_domain_name} + */ + readonly ingestDomainName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#name LiveDomain#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#region LiveDomain#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#status LiveDomain#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#type LiveDomain#type} + */ + readonly type: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#timeouts LiveDomain#timeouts} + */ + readonly timeouts?: LiveDomainTimeouts; +} +export interface LiveDomainTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#create LiveDomain#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#delete LiveDomain#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#update LiveDomain#update} + */ + readonly update?: string; +} + +export function liveDomainTimeoutsToTerraform(struct?: LiveDomainTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function liveDomainTimeoutsToHclTerraform(struct?: LiveDomainTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LiveDomainTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LiveDomainTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LiveDomainTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain huaweicloud_live_domain} +*/ +export class LiveDomain extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_domain"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LiveDomain resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LiveDomain to import + * @param importFromId The id of the existing LiveDomain that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LiveDomain to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_domain", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_domain huaweicloud_live_domain} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LiveDomainConfig + */ + public constructor(scope: Construct, id: string, config: LiveDomainConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_domain', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ingestDomainName = config.ingestDomainName; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cname - computed: true, optional: false, required: false + public get cname() { + return this.getStringAttribute('cname'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ingest_domain_name - computed: false, optional: true, required: false + private _ingestDomainName?: string; + public get ingestDomainName() { + return this.getStringAttribute('ingest_domain_name'); + } + public set ingestDomainName(value: string) { + this._ingestDomainName = value; + } + public resetIngestDomainName() { + this._ingestDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get ingestDomainNameInput() { + return this._ingestDomainName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LiveDomainTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LiveDomainTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ingest_domain_name: cdktf.stringToTerraform(this._ingestDomainName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + type: cdktf.stringToTerraform(this._type), + timeouts: liveDomainTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ingest_domain_name: { + value: cdktf.stringToHclTerraform(this._ingestDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: liveDomainTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LiveDomainTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/live-record-callback/README.md b/src/constructs/providers/huaweicloud/live-record-callback/README.md new file mode 100644 index 00000000..d864b4de --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-record-callback/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_live_record_callback` + +Refer to the Terraform Registry for docs: [`huaweicloud_live_record_callback`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback). diff --git a/src/constructs/providers/huaweicloud/live-record-callback/index.ts b/src/constructs/providers/huaweicloud/live-record-callback/index.ts new file mode 100644 index 00000000..b3e51751 --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-record-callback/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LiveRecordCallbackConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback#domain_name LiveRecordCallback#domain_name} + */ + readonly domainName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback#id LiveRecordCallback#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback#region LiveRecordCallback#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback#types LiveRecordCallback#types} + */ + readonly types: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback#url LiveRecordCallback#url} + */ + readonly url: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback huaweicloud_live_record_callback} +*/ +export class LiveRecordCallback extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_record_callback"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LiveRecordCallback resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LiveRecordCallback to import + * @param importFromId The id of the existing LiveRecordCallback that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LiveRecordCallback to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_record_callback", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_record_callback huaweicloud_live_record_callback} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LiveRecordCallbackConfig + */ + public constructor(scope: Construct, id: string, config: LiveRecordCallbackConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_record_callback', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._domainName = config.domainName; + this._id = config.id; + this._region = config.region; + this._types = config.types; + this._url = config.url; + } + + // ========== + // ATTRIBUTES + // ========== + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // types - computed: false, optional: false, required: true + private _types?: string[]; + public get types() { + return this.getListAttribute('types'); + } + public set types(value: string[]) { + this._types = value; + } + // Temporarily expose input value. Use with caution. + public get typesInput() { + return this._types; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + domain_name: cdktf.stringToTerraform(this._domainName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._types), + url: cdktf.stringToTerraform(this._url), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._types), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + url: { + value: cdktf.stringToHclTerraform(this._url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/live-recording/README.md b/src/constructs/providers/huaweicloud/live-recording/README.md new file mode 100644 index 00000000..5f61b07b --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-recording/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_live_recording` + +Refer to the Terraform Registry for docs: [`huaweicloud_live_recording`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording). diff --git a/src/constructs/providers/huaweicloud/live-recording/index.ts b/src/constructs/providers/huaweicloud/live-recording/index.ts new file mode 100644 index 00000000..cb700644 --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-recording/index.ts @@ -0,0 +1,982 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LiveRecordingConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#app_name LiveRecording#app_name} + */ + readonly appName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#domain_name LiveRecording#domain_name} + */ + readonly domainName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#id LiveRecording#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#region LiveRecording#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#stream_name LiveRecording#stream_name} + */ + readonly streamName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#type LiveRecording#type} + */ + readonly type?: string; + /** + * flv block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#flv LiveRecording#flv} + */ + readonly flv?: LiveRecordingFlv; + /** + * hls block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#hls LiveRecording#hls} + */ + readonly hls?: LiveRecordingHls; + /** + * mp4 block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#mp4 LiveRecording#mp4} + */ + readonly mp4?: LiveRecordingMp4; + /** + * obs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#obs LiveRecording#obs} + */ + readonly obs: LiveRecordingObs; +} +export interface LiveRecordingFlv { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#file_naming LiveRecording#file_naming} + */ + readonly fileNaming?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#max_stream_pause_length LiveRecording#max_stream_pause_length} + */ + readonly maxStreamPauseLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#recording_length LiveRecording#recording_length} + */ + readonly recordingLength: number; +} + +export function liveRecordingFlvToTerraform(struct?: LiveRecordingFlvOutputReference | LiveRecordingFlv): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + file_naming: cdktf.stringToTerraform(struct!.fileNaming), + max_stream_pause_length: cdktf.numberToTerraform(struct!.maxStreamPauseLength), + recording_length: cdktf.numberToTerraform(struct!.recordingLength), + } +} + + +export function liveRecordingFlvToHclTerraform(struct?: LiveRecordingFlvOutputReference | LiveRecordingFlv): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + file_naming: { + value: cdktf.stringToHclTerraform(struct!.fileNaming), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_stream_pause_length: { + value: cdktf.numberToHclTerraform(struct!.maxStreamPauseLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + recording_length: { + value: cdktf.numberToHclTerraform(struct!.recordingLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LiveRecordingFlvOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LiveRecordingFlv | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fileNaming !== undefined) { + hasAnyValues = true; + internalValueResult.fileNaming = this._fileNaming; + } + if (this._maxStreamPauseLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxStreamPauseLength = this._maxStreamPauseLength; + } + if (this._recordingLength !== undefined) { + hasAnyValues = true; + internalValueResult.recordingLength = this._recordingLength; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LiveRecordingFlv | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._fileNaming = undefined; + this._maxStreamPauseLength = undefined; + this._recordingLength = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._fileNaming = value.fileNaming; + this._maxStreamPauseLength = value.maxStreamPauseLength; + this._recordingLength = value.recordingLength; + } + } + + // file_naming - computed: true, optional: true, required: false + private _fileNaming?: string; + public get fileNaming() { + return this.getStringAttribute('file_naming'); + } + public set fileNaming(value: string) { + this._fileNaming = value; + } + public resetFileNaming() { + this._fileNaming = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNamingInput() { + return this._fileNaming; + } + + // max_stream_pause_length - computed: true, optional: true, required: false + private _maxStreamPauseLength?: number; + public get maxStreamPauseLength() { + return this.getNumberAttribute('max_stream_pause_length'); + } + public set maxStreamPauseLength(value: number) { + this._maxStreamPauseLength = value; + } + public resetMaxStreamPauseLength() { + this._maxStreamPauseLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxStreamPauseLengthInput() { + return this._maxStreamPauseLength; + } + + // recording_length - computed: false, optional: false, required: true + private _recordingLength?: number; + public get recordingLength() { + return this.getNumberAttribute('recording_length'); + } + public set recordingLength(value: number) { + this._recordingLength = value; + } + // Temporarily expose input value. Use with caution. + public get recordingLengthInput() { + return this._recordingLength; + } +} +export interface LiveRecordingHls { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#file_naming LiveRecording#file_naming} + */ + readonly fileNaming?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#max_stream_pause_length LiveRecording#max_stream_pause_length} + */ + readonly maxStreamPauseLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#recording_length LiveRecording#recording_length} + */ + readonly recordingLength: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#ts_file_naming LiveRecording#ts_file_naming} + */ + readonly tsFileNaming?: string; +} + +export function liveRecordingHlsToTerraform(struct?: LiveRecordingHlsOutputReference | LiveRecordingHls): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + file_naming: cdktf.stringToTerraform(struct!.fileNaming), + max_stream_pause_length: cdktf.numberToTerraform(struct!.maxStreamPauseLength), + recording_length: cdktf.numberToTerraform(struct!.recordingLength), + ts_file_naming: cdktf.stringToTerraform(struct!.tsFileNaming), + } +} + + +export function liveRecordingHlsToHclTerraform(struct?: LiveRecordingHlsOutputReference | LiveRecordingHls): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + file_naming: { + value: cdktf.stringToHclTerraform(struct!.fileNaming), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_stream_pause_length: { + value: cdktf.numberToHclTerraform(struct!.maxStreamPauseLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + recording_length: { + value: cdktf.numberToHclTerraform(struct!.recordingLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ts_file_naming: { + value: cdktf.stringToHclTerraform(struct!.tsFileNaming), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LiveRecordingHlsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LiveRecordingHls | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fileNaming !== undefined) { + hasAnyValues = true; + internalValueResult.fileNaming = this._fileNaming; + } + if (this._maxStreamPauseLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxStreamPauseLength = this._maxStreamPauseLength; + } + if (this._recordingLength !== undefined) { + hasAnyValues = true; + internalValueResult.recordingLength = this._recordingLength; + } + if (this._tsFileNaming !== undefined) { + hasAnyValues = true; + internalValueResult.tsFileNaming = this._tsFileNaming; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LiveRecordingHls | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._fileNaming = undefined; + this._maxStreamPauseLength = undefined; + this._recordingLength = undefined; + this._tsFileNaming = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._fileNaming = value.fileNaming; + this._maxStreamPauseLength = value.maxStreamPauseLength; + this._recordingLength = value.recordingLength; + this._tsFileNaming = value.tsFileNaming; + } + } + + // file_naming - computed: true, optional: true, required: false + private _fileNaming?: string; + public get fileNaming() { + return this.getStringAttribute('file_naming'); + } + public set fileNaming(value: string) { + this._fileNaming = value; + } + public resetFileNaming() { + this._fileNaming = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNamingInput() { + return this._fileNaming; + } + + // max_stream_pause_length - computed: true, optional: true, required: false + private _maxStreamPauseLength?: number; + public get maxStreamPauseLength() { + return this.getNumberAttribute('max_stream_pause_length'); + } + public set maxStreamPauseLength(value: number) { + this._maxStreamPauseLength = value; + } + public resetMaxStreamPauseLength() { + this._maxStreamPauseLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxStreamPauseLengthInput() { + return this._maxStreamPauseLength; + } + + // recording_length - computed: false, optional: false, required: true + private _recordingLength?: number; + public get recordingLength() { + return this.getNumberAttribute('recording_length'); + } + public set recordingLength(value: number) { + this._recordingLength = value; + } + // Temporarily expose input value. Use with caution. + public get recordingLengthInput() { + return this._recordingLength; + } + + // ts_file_naming - computed: true, optional: true, required: false + private _tsFileNaming?: string; + public get tsFileNaming() { + return this.getStringAttribute('ts_file_naming'); + } + public set tsFileNaming(value: string) { + this._tsFileNaming = value; + } + public resetTsFileNaming() { + this._tsFileNaming = undefined; + } + // Temporarily expose input value. Use with caution. + public get tsFileNamingInput() { + return this._tsFileNaming; + } +} +export interface LiveRecordingMp4 { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#file_naming LiveRecording#file_naming} + */ + readonly fileNaming?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#max_stream_pause_length LiveRecording#max_stream_pause_length} + */ + readonly maxStreamPauseLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#recording_length LiveRecording#recording_length} + */ + readonly recordingLength: number; +} + +export function liveRecordingMp4ToTerraform(struct?: LiveRecordingMp4OutputReference | LiveRecordingMp4): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + file_naming: cdktf.stringToTerraform(struct!.fileNaming), + max_stream_pause_length: cdktf.numberToTerraform(struct!.maxStreamPauseLength), + recording_length: cdktf.numberToTerraform(struct!.recordingLength), + } +} + + +export function liveRecordingMp4ToHclTerraform(struct?: LiveRecordingMp4OutputReference | LiveRecordingMp4): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + file_naming: { + value: cdktf.stringToHclTerraform(struct!.fileNaming), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_stream_pause_length: { + value: cdktf.numberToHclTerraform(struct!.maxStreamPauseLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + recording_length: { + value: cdktf.numberToHclTerraform(struct!.recordingLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LiveRecordingMp4OutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LiveRecordingMp4 | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fileNaming !== undefined) { + hasAnyValues = true; + internalValueResult.fileNaming = this._fileNaming; + } + if (this._maxStreamPauseLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxStreamPauseLength = this._maxStreamPauseLength; + } + if (this._recordingLength !== undefined) { + hasAnyValues = true; + internalValueResult.recordingLength = this._recordingLength; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LiveRecordingMp4 | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._fileNaming = undefined; + this._maxStreamPauseLength = undefined; + this._recordingLength = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._fileNaming = value.fileNaming; + this._maxStreamPauseLength = value.maxStreamPauseLength; + this._recordingLength = value.recordingLength; + } + } + + // file_naming - computed: true, optional: true, required: false + private _fileNaming?: string; + public get fileNaming() { + return this.getStringAttribute('file_naming'); + } + public set fileNaming(value: string) { + this._fileNaming = value; + } + public resetFileNaming() { + this._fileNaming = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileNamingInput() { + return this._fileNaming; + } + + // max_stream_pause_length - computed: true, optional: true, required: false + private _maxStreamPauseLength?: number; + public get maxStreamPauseLength() { + return this.getNumberAttribute('max_stream_pause_length'); + } + public set maxStreamPauseLength(value: number) { + this._maxStreamPauseLength = value; + } + public resetMaxStreamPauseLength() { + this._maxStreamPauseLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxStreamPauseLengthInput() { + return this._maxStreamPauseLength; + } + + // recording_length - computed: false, optional: false, required: true + private _recordingLength?: number; + public get recordingLength() { + return this.getNumberAttribute('recording_length'); + } + public set recordingLength(value: number) { + this._recordingLength = value; + } + // Temporarily expose input value. Use with caution. + public get recordingLengthInput() { + return this._recordingLength; + } +} +export interface LiveRecordingObs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#bucket LiveRecording#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#object LiveRecording#object} + */ + readonly object?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#region LiveRecording#region} + */ + readonly region: string; +} + +export function liveRecordingObsToTerraform(struct?: LiveRecordingObsOutputReference | LiveRecordingObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket: cdktf.stringToTerraform(struct!.bucket), + object: cdktf.stringToTerraform(struct!.object), + region: cdktf.stringToTerraform(struct!.region), + } +} + + +export function liveRecordingObsToHclTerraform(struct?: LiveRecordingObsOutputReference | LiveRecordingObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object: { + value: cdktf.stringToHclTerraform(struct!.object), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LiveRecordingObsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LiveRecordingObs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._object !== undefined) { + hasAnyValues = true; + internalValueResult.object = this._object; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LiveRecordingObs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucket = undefined; + this._object = undefined; + this._region = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucket = value.bucket; + this._object = value.object; + this._region = value.region; + } + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // object - computed: true, optional: true, required: false + private _object?: string; + public get object() { + return this.getStringAttribute('object'); + } + public set object(value: string) { + this._object = value; + } + public resetObject() { + this._object = undefined; + } + // Temporarily expose input value. Use with caution. + public get objectInput() { + return this._object; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording huaweicloud_live_recording} +*/ +export class LiveRecording extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_recording"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LiveRecording resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LiveRecording to import + * @param importFromId The id of the existing LiveRecording that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LiveRecording to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_recording", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_recording huaweicloud_live_recording} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LiveRecordingConfig + */ + public constructor(scope: Construct, id: string, config: LiveRecordingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_recording', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appName = config.appName; + this._domainName = config.domainName; + this._id = config.id; + this._region = config.region; + this._streamName = config.streamName; + this._type = config.type; + this._flv.internalValue = config.flv; + this._hls.internalValue = config.hls; + this._mp4.internalValue = config.mp4; + this._obs.internalValue = config.obs; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_name - computed: false, optional: false, required: true + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stream_name - computed: false, optional: false, required: true + private _streamName?: string; + public get streamName() { + return this.getStringAttribute('stream_name'); + } + public set streamName(value: string) { + this._streamName = value; + } + // Temporarily expose input value. Use with caution. + public get streamNameInput() { + return this._streamName; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // flv - computed: false, optional: true, required: false + private _flv = new LiveRecordingFlvOutputReference(this, "flv"); + public get flv() { + return this._flv; + } + public putFlv(value: LiveRecordingFlv) { + this._flv.internalValue = value; + } + public resetFlv() { + this._flv.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get flvInput() { + return this._flv.internalValue; + } + + // hls - computed: false, optional: true, required: false + private _hls = new LiveRecordingHlsOutputReference(this, "hls"); + public get hls() { + return this._hls; + } + public putHls(value: LiveRecordingHls) { + this._hls.internalValue = value; + } + public resetHls() { + this._hls.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hlsInput() { + return this._hls.internalValue; + } + + // mp4 - computed: false, optional: true, required: false + private _mp4 = new LiveRecordingMp4OutputReference(this, "mp4"); + public get mp4() { + return this._mp4; + } + public putMp4(value: LiveRecordingMp4) { + this._mp4.internalValue = value; + } + public resetMp4() { + this._mp4.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mp4Input() { + return this._mp4.internalValue; + } + + // obs - computed: false, optional: false, required: true + private _obs = new LiveRecordingObsOutputReference(this, "obs"); + public get obs() { + return this._obs; + } + public putObs(value: LiveRecordingObs) { + this._obs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get obsInput() { + return this._obs.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_name: cdktf.stringToTerraform(this._appName), + domain_name: cdktf.stringToTerraform(this._domainName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + stream_name: cdktf.stringToTerraform(this._streamName), + type: cdktf.stringToTerraform(this._type), + flv: liveRecordingFlvToTerraform(this._flv.internalValue), + hls: liveRecordingHlsToTerraform(this._hls.internalValue), + mp4: liveRecordingMp4ToTerraform(this._mp4.internalValue), + obs: liveRecordingObsToTerraform(this._obs.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_name: { + value: cdktf.stringToHclTerraform(this._appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stream_name: { + value: cdktf.stringToHclTerraform(this._streamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flv: { + value: liveRecordingFlvToHclTerraform(this._flv.internalValue), + isBlock: true, + type: "list", + storageClassType: "LiveRecordingFlvList", + }, + hls: { + value: liveRecordingHlsToHclTerraform(this._hls.internalValue), + isBlock: true, + type: "list", + storageClassType: "LiveRecordingHlsList", + }, + mp4: { + value: liveRecordingMp4ToHclTerraform(this._mp4.internalValue), + isBlock: true, + type: "list", + storageClassType: "LiveRecordingMp4List", + }, + obs: { + value: liveRecordingObsToHclTerraform(this._obs.internalValue), + isBlock: true, + type: "list", + storageClassType: "LiveRecordingObsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/live-snapshot/README.md b/src/constructs/providers/huaweicloud/live-snapshot/README.md new file mode 100644 index 00000000..04f9b53c --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-snapshot/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_live_snapshot` + +Refer to the Terraform Registry for docs: [`huaweicloud_live_snapshot`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot). diff --git a/src/constructs/providers/huaweicloud/live-snapshot/index.ts b/src/constructs/providers/huaweicloud/live-snapshot/index.ts new file mode 100644 index 00000000..bda5a9f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-snapshot/index.ts @@ -0,0 +1,396 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LiveSnapshotConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the application name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#app_name LiveSnapshot#app_name} + */ + readonly appName: string; + /** + * Specifies the callback authentication key value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#call_back_auth_key LiveSnapshot#call_back_auth_key} + */ + readonly callBackAuthKey?: string; + /** + * Specifies whether to enable callback notifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#call_back_enabled LiveSnapshot#call_back_enabled} + */ + readonly callBackEnabled?: string; + /** + * Specifies the notification server address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#call_back_url LiveSnapshot#call_back_url} + */ + readonly callBackUrl?: string; + /** + * Specifies the ingest domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#domain_name LiveSnapshot#domain_name} + */ + readonly domainName: string; + /** + * Specifies the screenshot frequency. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#frequency LiveSnapshot#frequency} + */ + readonly frequency: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#id LiveSnapshot#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#region LiveSnapshot#region} + */ + readonly region?: string; + /** + * Specifies the bucket name of the OBS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#storage_bucket LiveSnapshot#storage_bucket} + */ + readonly storageBucket: string; + /** + * Specifies the store mode in OBS bucket. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#storage_mode LiveSnapshot#storage_mode} + */ + readonly storageMode: number; + /** + * Specifies the path of OBS object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#storage_path LiveSnapshot#storage_path} + */ + readonly storagePath: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot huaweicloud_live_snapshot} +*/ +export class LiveSnapshot extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_snapshot"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LiveSnapshot resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LiveSnapshot to import + * @param importFromId The id of the existing LiveSnapshot that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LiveSnapshot to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_snapshot", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_snapshot huaweicloud_live_snapshot} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LiveSnapshotConfig + */ + public constructor(scope: Construct, id: string, config: LiveSnapshotConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_snapshot', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appName = config.appName; + this._callBackAuthKey = config.callBackAuthKey; + this._callBackEnabled = config.callBackEnabled; + this._callBackUrl = config.callBackUrl; + this._domainName = config.domainName; + this._frequency = config.frequency; + this._id = config.id; + this._region = config.region; + this._storageBucket = config.storageBucket; + this._storageMode = config.storageMode; + this._storagePath = config.storagePath; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_name - computed: false, optional: false, required: true + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // call_back_auth_key - computed: true, optional: true, required: false + private _callBackAuthKey?: string; + public get callBackAuthKey() { + return this.getStringAttribute('call_back_auth_key'); + } + public set callBackAuthKey(value: string) { + this._callBackAuthKey = value; + } + public resetCallBackAuthKey() { + this._callBackAuthKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get callBackAuthKeyInput() { + return this._callBackAuthKey; + } + + // call_back_enabled - computed: true, optional: true, required: false + private _callBackEnabled?: string; + public get callBackEnabled() { + return this.getStringAttribute('call_back_enabled'); + } + public set callBackEnabled(value: string) { + this._callBackEnabled = value; + } + public resetCallBackEnabled() { + this._callBackEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get callBackEnabledInput() { + return this._callBackEnabled; + } + + // call_back_url - computed: true, optional: true, required: false + private _callBackUrl?: string; + public get callBackUrl() { + return this.getStringAttribute('call_back_url'); + } + public set callBackUrl(value: string) { + this._callBackUrl = value; + } + public resetCallBackUrl() { + this._callBackUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get callBackUrlInput() { + return this._callBackUrl; + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // frequency - computed: false, optional: false, required: true + private _frequency?: number; + public get frequency() { + return this.getNumberAttribute('frequency'); + } + public set frequency(value: number) { + this._frequency = value; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_bucket - computed: false, optional: false, required: true + private _storageBucket?: string; + public get storageBucket() { + return this.getStringAttribute('storage_bucket'); + } + public set storageBucket(value: string) { + this._storageBucket = value; + } + // Temporarily expose input value. Use with caution. + public get storageBucketInput() { + return this._storageBucket; + } + + // storage_mode - computed: false, optional: false, required: true + private _storageMode?: number; + public get storageMode() { + return this.getNumberAttribute('storage_mode'); + } + public set storageMode(value: number) { + this._storageMode = value; + } + // Temporarily expose input value. Use with caution. + public get storageModeInput() { + return this._storageMode; + } + + // storage_path - computed: false, optional: false, required: true + private _storagePath?: string; + public get storagePath() { + return this.getStringAttribute('storage_path'); + } + public set storagePath(value: string) { + this._storagePath = value; + } + // Temporarily expose input value. Use with caution. + public get storagePathInput() { + return this._storagePath; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_name: cdktf.stringToTerraform(this._appName), + call_back_auth_key: cdktf.stringToTerraform(this._callBackAuthKey), + call_back_enabled: cdktf.stringToTerraform(this._callBackEnabled), + call_back_url: cdktf.stringToTerraform(this._callBackUrl), + domain_name: cdktf.stringToTerraform(this._domainName), + frequency: cdktf.numberToTerraform(this._frequency), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + storage_bucket: cdktf.stringToTerraform(this._storageBucket), + storage_mode: cdktf.numberToTerraform(this._storageMode), + storage_path: cdktf.stringToTerraform(this._storagePath), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_name: { + value: cdktf.stringToHclTerraform(this._appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + call_back_auth_key: { + value: cdktf.stringToHclTerraform(this._callBackAuthKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + call_back_enabled: { + value: cdktf.stringToHclTerraform(this._callBackEnabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + call_back_url: { + value: cdktf.stringToHclTerraform(this._callBackUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + frequency: { + value: cdktf.numberToHclTerraform(this._frequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_bucket: { + value: cdktf.stringToHclTerraform(this._storageBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_mode: { + value: cdktf.numberToHclTerraform(this._storageMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_path: { + value: cdktf.stringToHclTerraform(this._storagePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/live-transcoding/README.md b/src/constructs/providers/huaweicloud/live-transcoding/README.md new file mode 100644 index 00000000..f42e287d --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-transcoding/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_live_transcoding` + +Refer to the Terraform Registry for docs: [`huaweicloud_live_transcoding`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding). diff --git a/src/constructs/providers/huaweicloud/live-transcoding/index.ts b/src/constructs/providers/huaweicloud/live-transcoding/index.ts new file mode 100644 index 00000000..a74cc3ec --- /dev/null +++ b/src/constructs/providers/huaweicloud/live-transcoding/index.ts @@ -0,0 +1,510 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LiveTranscodingConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#app_name LiveTranscoding#app_name} + */ + readonly appName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#domain_name LiveTranscoding#domain_name} + */ + readonly domainName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#id LiveTranscoding#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#low_bitrate_hd LiveTranscoding#low_bitrate_hd} + */ + readonly lowBitrateHd?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#region LiveTranscoding#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#video_encoding LiveTranscoding#video_encoding} + */ + readonly videoEncoding: string; + /** + * templates block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#templates LiveTranscoding#templates} + */ + readonly templates: LiveTranscodingTemplates[] | cdktf.IResolvable; +} +export interface LiveTranscodingTemplates { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#bitrate LiveTranscoding#bitrate} + */ + readonly bitrate: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#frame_rate LiveTranscoding#frame_rate} + */ + readonly frameRate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#height LiveTranscoding#height} + */ + readonly height: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#name LiveTranscoding#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#width LiveTranscoding#width} + */ + readonly width: number; +} + +export function liveTranscodingTemplatesToTerraform(struct?: LiveTranscodingTemplates | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + frame_rate: cdktf.numberToTerraform(struct!.frameRate), + height: cdktf.numberToTerraform(struct!.height), + name: cdktf.stringToTerraform(struct!.name), + width: cdktf.numberToTerraform(struct!.width), + } +} + + +export function liveTranscodingTemplatesToHclTerraform(struct?: LiveTranscodingTemplates | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + frame_rate: { + value: cdktf.numberToHclTerraform(struct!.frameRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + height: { + value: cdktf.numberToHclTerraform(struct!.height), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + width: { + value: cdktf.numberToHclTerraform(struct!.width), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LiveTranscodingTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LiveTranscodingTemplates | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._frameRate !== undefined) { + hasAnyValues = true; + internalValueResult.frameRate = this._frameRate; + } + if (this._height !== undefined) { + hasAnyValues = true; + internalValueResult.height = this._height; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._width !== undefined) { + hasAnyValues = true; + internalValueResult.width = this._width; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LiveTranscodingTemplates | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bitrate = undefined; + this._frameRate = undefined; + this._height = undefined; + this._name = undefined; + this._width = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bitrate = value.bitrate; + this._frameRate = value.frameRate; + this._height = value.height; + this._name = value.name; + this._width = value.width; + } + } + + // bitrate - computed: false, optional: false, required: true + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // frame_rate - computed: true, optional: true, required: false + private _frameRate?: number; + public get frameRate() { + return this.getNumberAttribute('frame_rate'); + } + public set frameRate(value: number) { + this._frameRate = value; + } + public resetFrameRate() { + this._frameRate = undefined; + } + // Temporarily expose input value. Use with caution. + public get frameRateInput() { + return this._frameRate; + } + + // height - computed: false, optional: false, required: true + private _height?: number; + public get height() { + return this.getNumberAttribute('height'); + } + public set height(value: number) { + this._height = value; + } + // Temporarily expose input value. Use with caution. + public get heightInput() { + return this._height; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // width - computed: false, optional: false, required: true + private _width?: number; + public get width() { + return this.getNumberAttribute('width'); + } + public set width(value: number) { + this._width = value; + } + // Temporarily expose input value. Use with caution. + public get widthInput() { + return this._width; + } +} + +export class LiveTranscodingTemplatesList extends cdktf.ComplexList { + public internalValue? : LiveTranscodingTemplates[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LiveTranscodingTemplatesOutputReference { + return new LiveTranscodingTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding huaweicloud_live_transcoding} +*/ +export class LiveTranscoding extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_live_transcoding"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LiveTranscoding resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LiveTranscoding to import + * @param importFromId The id of the existing LiveTranscoding that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LiveTranscoding to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_live_transcoding", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/live_transcoding huaweicloud_live_transcoding} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LiveTranscodingConfig + */ + public constructor(scope: Construct, id: string, config: LiveTranscodingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_live_transcoding', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appName = config.appName; + this._domainName = config.domainName; + this._id = config.id; + this._lowBitrateHd = config.lowBitrateHd; + this._region = config.region; + this._videoEncoding = config.videoEncoding; + this._templates.internalValue = config.templates; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_name - computed: false, optional: false, required: true + private _appName?: string; + public get appName() { + return this.getStringAttribute('app_name'); + } + public set appName(value: string) { + this._appName = value; + } + // Temporarily expose input value. Use with caution. + public get appNameInput() { + return this._appName; + } + + // domain_name - computed: false, optional: false, required: true + private _domainName?: string; + public get domainName() { + return this.getStringAttribute('domain_name'); + } + public set domainName(value: string) { + this._domainName = value; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // low_bitrate_hd - computed: true, optional: true, required: false + private _lowBitrateHd?: boolean | cdktf.IResolvable; + public get lowBitrateHd() { + return this.getBooleanAttribute('low_bitrate_hd'); + } + public set lowBitrateHd(value: boolean | cdktf.IResolvable) { + this._lowBitrateHd = value; + } + public resetLowBitrateHd() { + this._lowBitrateHd = undefined; + } + // Temporarily expose input value. Use with caution. + public get lowBitrateHdInput() { + return this._lowBitrateHd; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // video_encoding - computed: false, optional: false, required: true + private _videoEncoding?: string; + public get videoEncoding() { + return this.getStringAttribute('video_encoding'); + } + public set videoEncoding(value: string) { + this._videoEncoding = value; + } + // Temporarily expose input value. Use with caution. + public get videoEncodingInput() { + return this._videoEncoding; + } + + // templates - computed: false, optional: false, required: true + private _templates = new LiveTranscodingTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + public putTemplates(value: LiveTranscodingTemplates[] | cdktf.IResolvable) { + this._templates.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get templatesInput() { + return this._templates.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_name: cdktf.stringToTerraform(this._appName), + domain_name: cdktf.stringToTerraform(this._domainName), + id: cdktf.stringToTerraform(this._id), + low_bitrate_hd: cdktf.booleanToTerraform(this._lowBitrateHd), + region: cdktf.stringToTerraform(this._region), + video_encoding: cdktf.stringToTerraform(this._videoEncoding), + templates: cdktf.listMapper(liveTranscodingTemplatesToTerraform, true)(this._templates.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_name: { + value: cdktf.stringToHclTerraform(this._appName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + low_bitrate_hd: { + value: cdktf.booleanToHclTerraform(this._lowBitrateHd), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + video_encoding: { + value: cdktf.stringToHclTerraform(this._videoEncoding), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + templates: { + value: cdktf.listMapperHcl(liveTranscodingTemplatesToHclTerraform, true)(this._templates.internalValue), + isBlock: true, + type: "list", + storageClassType: "LiveTranscodingTemplatesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-access-rule/README.md b/src/constructs/providers/huaweicloud/lts-access-rule/README.md new file mode 100644 index 00000000..bcc8190b --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-access-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_access_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_access_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule). diff --git a/src/constructs/providers/huaweicloud/lts-access-rule/index.ts b/src/constructs/providers/huaweicloud/lts-access-rule/index.ts new file mode 100644 index 00000000..451d3607 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-access-rule/index.ts @@ -0,0 +1,649 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsAccessRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#cluster_id LtsAccessRule#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#cluster_name LtsAccessRule#cluster_name} + */ + readonly clusterName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#deployments LtsAccessRule#deployments} + */ + readonly deployments: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#id LtsAccessRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#name_space LtsAccessRule#name_space} + */ + readonly nameSpace: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#region LtsAccessRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#rule_name LtsAccessRule#rule_name} + */ + readonly ruleName: string; + /** + * files block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#files LtsAccessRule#files} + */ + readonly files: LtsAccessRuleFiles[] | cdktf.IResolvable; +} +export interface LtsAccessRuleFilesLogStreamInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#target_log_group_id LtsAccessRule#target_log_group_id} + */ + readonly targetLogGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#target_log_group_name LtsAccessRule#target_log_group_name} + */ + readonly targetLogGroupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#target_log_stream_id LtsAccessRule#target_log_stream_id} + */ + readonly targetLogStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#target_log_stream_name LtsAccessRule#target_log_stream_name} + */ + readonly targetLogStreamName: string; +} + +export function ltsAccessRuleFilesLogStreamInfoToTerraform(struct?: LtsAccessRuleFilesLogStreamInfo | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + target_log_group_id: cdktf.stringToTerraform(struct!.targetLogGroupId), + target_log_group_name: cdktf.stringToTerraform(struct!.targetLogGroupName), + target_log_stream_id: cdktf.stringToTerraform(struct!.targetLogStreamId), + target_log_stream_name: cdktf.stringToTerraform(struct!.targetLogStreamName), + } +} + + +export function ltsAccessRuleFilesLogStreamInfoToHclTerraform(struct?: LtsAccessRuleFilesLogStreamInfo | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + target_log_group_id: { + value: cdktf.stringToHclTerraform(struct!.targetLogGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_group_name: { + value: cdktf.stringToHclTerraform(struct!.targetLogGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.targetLogStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_stream_name: { + value: cdktf.stringToHclTerraform(struct!.targetLogStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsAccessRuleFilesLogStreamInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsAccessRuleFilesLogStreamInfo | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._targetLogGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogGroupId = this._targetLogGroupId; + } + if (this._targetLogGroupName !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogGroupName = this._targetLogGroupName; + } + if (this._targetLogStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogStreamId = this._targetLogStreamId; + } + if (this._targetLogStreamName !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogStreamName = this._targetLogStreamName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsAccessRuleFilesLogStreamInfo | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._targetLogGroupId = undefined; + this._targetLogGroupName = undefined; + this._targetLogStreamId = undefined; + this._targetLogStreamName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._targetLogGroupId = value.targetLogGroupId; + this._targetLogGroupName = value.targetLogGroupName; + this._targetLogStreamId = value.targetLogStreamId; + this._targetLogStreamName = value.targetLogStreamName; + } + } + + // target_log_group_id - computed: false, optional: false, required: true + private _targetLogGroupId?: string; + public get targetLogGroupId() { + return this.getStringAttribute('target_log_group_id'); + } + public set targetLogGroupId(value: string) { + this._targetLogGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogGroupIdInput() { + return this._targetLogGroupId; + } + + // target_log_group_name - computed: false, optional: false, required: true + private _targetLogGroupName?: string; + public get targetLogGroupName() { + return this.getStringAttribute('target_log_group_name'); + } + public set targetLogGroupName(value: string) { + this._targetLogGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogGroupNameInput() { + return this._targetLogGroupName; + } + + // target_log_stream_id - computed: false, optional: false, required: true + private _targetLogStreamId?: string; + public get targetLogStreamId() { + return this.getStringAttribute('target_log_stream_id'); + } + public set targetLogStreamId(value: string) { + this._targetLogStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogStreamIdInput() { + return this._targetLogStreamId; + } + + // target_log_stream_name - computed: false, optional: false, required: true + private _targetLogStreamName?: string; + public get targetLogStreamName() { + return this.getStringAttribute('target_log_stream_name'); + } + public set targetLogStreamName(value: string) { + this._targetLogStreamName = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogStreamNameInput() { + return this._targetLogStreamName; + } +} + +export class LtsAccessRuleFilesLogStreamInfoList extends cdktf.ComplexList { + public internalValue? : LtsAccessRuleFilesLogStreamInfo[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsAccessRuleFilesLogStreamInfoOutputReference { + return new LtsAccessRuleFilesLogStreamInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsAccessRuleFiles { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#file_name LtsAccessRule#file_name} + */ + readonly fileName: string; + /** + * log_stream_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#log_stream_info LtsAccessRule#log_stream_info} + */ + readonly logStreamInfo: LtsAccessRuleFilesLogStreamInfo[] | cdktf.IResolvable; +} + +export function ltsAccessRuleFilesToTerraform(struct?: LtsAccessRuleFiles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + file_name: cdktf.stringToTerraform(struct!.fileName), + log_stream_info: cdktf.listMapper(ltsAccessRuleFilesLogStreamInfoToTerraform, true)(struct!.logStreamInfo), + } +} + + +export function ltsAccessRuleFilesToHclTerraform(struct?: LtsAccessRuleFiles | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + file_name: { + value: cdktf.stringToHclTerraform(struct!.fileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_info: { + value: cdktf.listMapperHcl(ltsAccessRuleFilesLogStreamInfoToHclTerraform, true)(struct!.logStreamInfo), + isBlock: true, + type: "list", + storageClassType: "LtsAccessRuleFilesLogStreamInfoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsAccessRuleFilesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsAccessRuleFiles | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fileName !== undefined) { + hasAnyValues = true; + internalValueResult.fileName = this._fileName; + } + if (this._logStreamInfo?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamInfo = this._logStreamInfo?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsAccessRuleFiles | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fileName = undefined; + this._logStreamInfo.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fileName = value.fileName; + this._logStreamInfo.internalValue = value.logStreamInfo; + } + } + + // file_name - computed: false, optional: false, required: true + private _fileName?: string; + public get fileName() { + return this.getStringAttribute('file_name'); + } + public set fileName(value: string) { + this._fileName = value; + } + // Temporarily expose input value. Use with caution. + public get fileNameInput() { + return this._fileName; + } + + // log_stream_info - computed: false, optional: false, required: true + private _logStreamInfo = new LtsAccessRuleFilesLogStreamInfoList(this, "log_stream_info", false); + public get logStreamInfo() { + return this._logStreamInfo; + } + public putLogStreamInfo(value: LtsAccessRuleFilesLogStreamInfo[] | cdktf.IResolvable) { + this._logStreamInfo.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamInfoInput() { + return this._logStreamInfo.internalValue; + } +} + +export class LtsAccessRuleFilesList extends cdktf.ComplexList { + public internalValue? : LtsAccessRuleFiles[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsAccessRuleFilesOutputReference { + return new LtsAccessRuleFilesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule huaweicloud_lts_access_rule} +*/ +export class LtsAccessRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_access_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsAccessRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsAccessRule to import + * @param importFromId The id of the existing LtsAccessRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsAccessRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_access_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_access_rule huaweicloud_lts_access_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsAccessRuleConfig + */ + public constructor(scope: Construct, id: string, config: LtsAccessRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_access_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._clusterName = config.clusterName; + this._deployments = config.deployments; + this._id = config.id; + this._nameSpace = config.nameSpace; + this._region = config.region; + this._ruleName = config.ruleName; + this._files.internalValue = config.files; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: false, optional: false, required: true + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // container_name - computed: true, optional: false, required: false + public get containerName() { + return this.getStringAttribute('container_name'); + } + + // deployments - computed: false, optional: false, required: true + private _deployments?: string[]; + public get deployments() { + return this.getListAttribute('deployments'); + } + public set deployments(value: string[]) { + this._deployments = value; + } + // Temporarily expose input value. Use with caution. + public get deploymentsInput() { + return this._deployments; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name_space - computed: false, optional: false, required: true + private _nameSpace?: string; + public get nameSpace() { + return this.getStringAttribute('name_space'); + } + public set nameSpace(value: string) { + this._nameSpace = value; + } + // Temporarily expose input value. Use with caution. + public get nameSpaceInput() { + return this._nameSpace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_name - computed: false, optional: false, required: true + private _ruleName?: string; + public get ruleName() { + return this.getStringAttribute('rule_name'); + } + public set ruleName(value: string) { + this._ruleName = value; + } + // Temporarily expose input value. Use with caution. + public get ruleNameInput() { + return this._ruleName; + } + + // files - computed: false, optional: false, required: true + private _files = new LtsAccessRuleFilesList(this, "files", false); + public get files() { + return this._files; + } + public putFiles(value: LtsAccessRuleFiles[] | cdktf.IResolvable) { + this._files.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get filesInput() { + return this._files.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_name: cdktf.stringToTerraform(this._clusterName), + deployments: cdktf.listMapper(cdktf.stringToTerraform, false)(this._deployments), + id: cdktf.stringToTerraform(this._id), + name_space: cdktf.stringToTerraform(this._nameSpace), + region: cdktf.stringToTerraform(this._region), + rule_name: cdktf.stringToTerraform(this._ruleName), + files: cdktf.listMapper(ltsAccessRuleFilesToTerraform, true)(this._files.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + deployments: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._deployments), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_space: { + value: cdktf.stringToHclTerraform(this._nameSpace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_name: { + value: cdktf.stringToHclTerraform(this._ruleName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + files: { + value: cdktf.listMapperHcl(ltsAccessRuleFilesToHclTerraform, true)(this._files.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsAccessRuleFilesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-aom-access/README.md b/src/constructs/providers/huaweicloud/lts-aom-access/README.md new file mode 100644 index 00000000..ae3a433f --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-aom-access/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_aom_access` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_aom_access`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access). diff --git a/src/constructs/providers/huaweicloud/lts-aom-access/index.ts b/src/constructs/providers/huaweicloud/lts-aom-access/index.ts new file mode 100644 index 00000000..f0e9429b --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-aom-access/index.ts @@ -0,0 +1,579 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsAomAccessConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#cluster_id LtsAomAccess#cluster_id} + */ + readonly clusterId: string; + /** + * Specifies the cluster name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#cluster_name LtsAomAccess#cluster_name} + */ + readonly clusterName: string; + /** + * Specifies the container name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#container_name LtsAomAccess#container_name} + */ + readonly containerName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#id LtsAomAccess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#name LtsAomAccess#name} + */ + readonly name: string; + /** + * Specifies the namespace. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#namespace LtsAomAccess#namespace} + */ + readonly namespace: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#region LtsAomAccess#region} + */ + readonly region?: string; + /** + * Specifies the deployments. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#workloads LtsAomAccess#workloads} + */ + readonly workloads: string[]; + /** + * access_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#access_rules LtsAomAccess#access_rules} + */ + readonly accessRules: LtsAomAccessAccessRules[] | cdktf.IResolvable; +} +export interface LtsAomAccessAccessRules { + /** + * Specifies the path name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#file_name LtsAomAccess#file_name} + */ + readonly fileName: string; + /** + * Specifies the log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#log_group_id LtsAomAccess#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the log group name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#log_group_name LtsAomAccess#log_group_name} + */ + readonly logGroupName: string; + /** + * Specifies the log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#log_stream_id LtsAomAccess#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies the log stream name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#log_stream_name LtsAomAccess#log_stream_name} + */ + readonly logStreamName: string; +} + +export function ltsAomAccessAccessRulesToTerraform(struct?: LtsAomAccessAccessRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + file_name: cdktf.stringToTerraform(struct!.fileName), + log_group_id: cdktf.stringToTerraform(struct!.logGroupId), + log_group_name: cdktf.stringToTerraform(struct!.logGroupName), + log_stream_id: cdktf.stringToTerraform(struct!.logStreamId), + log_stream_name: cdktf.stringToTerraform(struct!.logStreamName), + } +} + + +export function ltsAomAccessAccessRulesToHclTerraform(struct?: LtsAomAccessAccessRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + file_name: { + value: cdktf.stringToHclTerraform(struct!.fileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(struct!.logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(struct!.logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(struct!.logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsAomAccessAccessRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsAomAccessAccessRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fileName !== undefined) { + hasAnyValues = true; + internalValueResult.fileName = this._fileName; + } + if (this._logGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.logGroupId = this._logGroupId; + } + if (this._logGroupName !== undefined) { + hasAnyValues = true; + internalValueResult.logGroupName = this._logGroupName; + } + if (this._logStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamId = this._logStreamId; + } + if (this._logStreamName !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamName = this._logStreamName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsAomAccessAccessRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fileName = undefined; + this._logGroupId = undefined; + this._logGroupName = undefined; + this._logStreamId = undefined; + this._logStreamName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fileName = value.fileName; + this._logGroupId = value.logGroupId; + this._logGroupName = value.logGroupName; + this._logStreamId = value.logStreamId; + this._logStreamName = value.logStreamName; + } + } + + // file_name - computed: false, optional: false, required: true + private _fileName?: string; + public get fileName() { + return this.getStringAttribute('file_name'); + } + public set fileName(value: string) { + this._fileName = value; + } + // Temporarily expose input value. Use with caution. + public get fileNameInput() { + return this._fileName; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: false, optional: false, required: true + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: false, optional: false, required: true + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } +} + +export class LtsAomAccessAccessRulesList extends cdktf.ComplexList { + public internalValue? : LtsAomAccessAccessRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsAomAccessAccessRulesOutputReference { + return new LtsAomAccessAccessRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access huaweicloud_lts_aom_access} +*/ +export class LtsAomAccess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_aom_access"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsAomAccess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsAomAccess to import + * @param importFromId The id of the existing LtsAomAccess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsAomAccess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_aom_access", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_aom_access huaweicloud_lts_aom_access} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsAomAccessConfig + */ + public constructor(scope: Construct, id: string, config: LtsAomAccessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_aom_access', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._clusterName = config.clusterName; + this._containerName = config.containerName; + this._id = config.id; + this._name = config.name; + this._namespace = config.namespace; + this._region = config.region; + this._workloads = config.workloads; + this._accessRules.internalValue = config.accessRules; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: false, optional: false, required: true + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // container_name - computed: true, optional: true, required: false + private _containerName?: string; + public get containerName() { + return this.getStringAttribute('container_name'); + } + public set containerName(value: string) { + this._containerName = value; + } + public resetContainerName() { + this._containerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get containerNameInput() { + return this._containerName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workloads - computed: false, optional: false, required: true + private _workloads?: string[]; + public get workloads() { + return this.getListAttribute('workloads'); + } + public set workloads(value: string[]) { + this._workloads = value; + } + // Temporarily expose input value. Use with caution. + public get workloadsInput() { + return this._workloads; + } + + // access_rules - computed: false, optional: false, required: true + private _accessRules = new LtsAomAccessAccessRulesList(this, "access_rules", false); + public get accessRules() { + return this._accessRules; + } + public putAccessRules(value: LtsAomAccessAccessRules[] | cdktf.IResolvable) { + this._accessRules.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get accessRulesInput() { + return this._accessRules.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_name: cdktf.stringToTerraform(this._clusterName), + container_name: cdktf.stringToTerraform(this._containerName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + region: cdktf.stringToTerraform(this._region), + workloads: cdktf.listMapper(cdktf.stringToTerraform, false)(this._workloads), + access_rules: cdktf.listMapper(ltsAomAccessAccessRulesToTerraform, true)(this._accessRules.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_name: { + value: cdktf.stringToHclTerraform(this._containerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workloads: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._workloads), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_rules: { + value: cdktf.listMapperHcl(ltsAomAccessAccessRulesToHclTerraform, true)(this._accessRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsAomAccessAccessRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-cce-access/README.md b/src/constructs/providers/huaweicloud/lts-cce-access/README.md new file mode 100644 index 00000000..fb81868d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-cce-access/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_cce_access` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_cce_access`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access). diff --git a/src/constructs/providers/huaweicloud/lts-cce-access/index.ts b/src/constructs/providers/huaweicloud/lts-cce-access/index.ts new file mode 100644 index 00000000..968d3eea --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-cce-access/index.ts @@ -0,0 +1,1561 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsCceAccessConfig extends cdktf.TerraformMetaArguments { + /** + * Whether collect in binary format. Default is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#binary_collect LtsCceAccess#binary_collect} + */ + readonly binaryCollect?: boolean | cdktf.IResolvable; + /** + * The CCE cluster ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#cluster_id LtsCceAccess#cluster_id} + */ + readonly clusterId: string; + /** + * The log access host group ID list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#host_group_ids LtsCceAccess#host_group_ids} + */ + readonly hostGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#id LtsCceAccess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#log_group_id LtsCceAccess#log_group_id} + */ + readonly logGroupId: string; + /** + * Whether to split log. Default is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#log_split LtsCceAccess#log_split} + */ + readonly logSplit?: boolean | cdktf.IResolvable; + /** + * The log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#log_stream_id LtsCceAccess#log_stream_id} + */ + readonly logStreamId: string; + /** + * The name of the CCE access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#name LtsCceAccess#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#region LtsCceAccess#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#tags LtsCceAccess#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * access_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#access_config LtsCceAccess#access_config} + */ + readonly accessConfig: LtsCceAccessAccessConfig; +} +export interface LtsCceAccessAccessConfigMultiLogFormat { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#mode LtsCceAccess#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#value LtsCceAccess#value} + */ + readonly value: string; +} + +export function ltsCceAccessAccessConfigMultiLogFormatToTerraform(struct?: LtsCceAccessAccessConfigMultiLogFormatOutputReference | LtsCceAccessAccessConfigMultiLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + mode: cdktf.stringToTerraform(struct!.mode), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ltsCceAccessAccessConfigMultiLogFormatToHclTerraform(struct?: LtsCceAccessAccessConfigMultiLogFormatOutputReference | LtsCceAccessAccessConfigMultiLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsCceAccessAccessConfigMultiLogFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsCceAccessAccessConfigMultiLogFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsCceAccessAccessConfigMultiLogFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._mode = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._mode = value.mode; + this._value = value.value; + } + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface LtsCceAccessAccessConfigSingleLogFormat { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#mode LtsCceAccess#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#value LtsCceAccess#value} + */ + readonly value?: string; +} + +export function ltsCceAccessAccessConfigSingleLogFormatToTerraform(struct?: LtsCceAccessAccessConfigSingleLogFormatOutputReference | LtsCceAccessAccessConfigSingleLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + mode: cdktf.stringToTerraform(struct!.mode), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ltsCceAccessAccessConfigSingleLogFormatToHclTerraform(struct?: LtsCceAccessAccessConfigSingleLogFormatOutputReference | LtsCceAccessAccessConfigSingleLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsCceAccessAccessConfigSingleLogFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsCceAccessAccessConfigSingleLogFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsCceAccessAccessConfigSingleLogFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._mode = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._mode = value.mode; + this._value = value.value; + } + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface LtsCceAccessAccessConfigWindowsLogInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#categorys LtsCceAccess#categorys} + */ + readonly categorys: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#event_level LtsCceAccess#event_level} + */ + readonly eventLevel: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#time_offset LtsCceAccess#time_offset} + */ + readonly timeOffset: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#time_offset_unit LtsCceAccess#time_offset_unit} + */ + readonly timeOffsetUnit: string; +} + +export function ltsCceAccessAccessConfigWindowsLogInfoToTerraform(struct?: LtsCceAccessAccessConfigWindowsLogInfoOutputReference | LtsCceAccessAccessConfigWindowsLogInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + categorys: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.categorys), + event_level: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.eventLevel), + time_offset: cdktf.numberToTerraform(struct!.timeOffset), + time_offset_unit: cdktf.stringToTerraform(struct!.timeOffsetUnit), + } +} + + +export function ltsCceAccessAccessConfigWindowsLogInfoToHclTerraform(struct?: LtsCceAccessAccessConfigWindowsLogInfoOutputReference | LtsCceAccessAccessConfigWindowsLogInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + categorys: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.categorys), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + event_level: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.eventLevel), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + time_offset: { + value: cdktf.numberToHclTerraform(struct!.timeOffset), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_offset_unit: { + value: cdktf.stringToHclTerraform(struct!.timeOffsetUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsCceAccessAccessConfigWindowsLogInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsCceAccessAccessConfigWindowsLogInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._categorys !== undefined) { + hasAnyValues = true; + internalValueResult.categorys = this._categorys; + } + if (this._eventLevel !== undefined) { + hasAnyValues = true; + internalValueResult.eventLevel = this._eventLevel; + } + if (this._timeOffset !== undefined) { + hasAnyValues = true; + internalValueResult.timeOffset = this._timeOffset; + } + if (this._timeOffsetUnit !== undefined) { + hasAnyValues = true; + internalValueResult.timeOffsetUnit = this._timeOffsetUnit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsCceAccessAccessConfigWindowsLogInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._categorys = undefined; + this._eventLevel = undefined; + this._timeOffset = undefined; + this._timeOffsetUnit = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._categorys = value.categorys; + this._eventLevel = value.eventLevel; + this._timeOffset = value.timeOffset; + this._timeOffsetUnit = value.timeOffsetUnit; + } + } + + // categorys - computed: false, optional: false, required: true + private _categorys?: string[]; + public get categorys() { + return this.getListAttribute('categorys'); + } + public set categorys(value: string[]) { + this._categorys = value; + } + // Temporarily expose input value. Use with caution. + public get categorysInput() { + return this._categorys; + } + + // event_level - computed: false, optional: false, required: true + private _eventLevel?: string[]; + public get eventLevel() { + return this.getListAttribute('event_level'); + } + public set eventLevel(value: string[]) { + this._eventLevel = value; + } + // Temporarily expose input value. Use with caution. + public get eventLevelInput() { + return this._eventLevel; + } + + // time_offset - computed: false, optional: false, required: true + private _timeOffset?: number; + public get timeOffset() { + return this.getNumberAttribute('time_offset'); + } + public set timeOffset(value: number) { + this._timeOffset = value; + } + // Temporarily expose input value. Use with caution. + public get timeOffsetInput() { + return this._timeOffset; + } + + // time_offset_unit - computed: false, optional: false, required: true + private _timeOffsetUnit?: string; + public get timeOffsetUnit() { + return this.getStringAttribute('time_offset_unit'); + } + public set timeOffsetUnit(value: string) { + this._timeOffsetUnit = value; + } + // Temporarily expose input value. Use with caution. + public get timeOffsetUnitInput() { + return this._timeOffsetUnit; + } +} +export interface LtsCceAccessAccessConfig { + /** + * The collection path blacklist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#black_paths LtsCceAccess#black_paths} + */ + readonly blackPaths?: string[]; + /** + * The regular expression matching of kubernetes container names. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#container_name_regex LtsCceAccess#container_name_regex} + */ + readonly containerNameRegex?: string; + /** + * The environment variable blacklist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#exclude_envs LtsCceAccess#exclude_envs} + */ + readonly excludeEnvs?: { [key: string]: string }; + /** + * The kubernetes label blacklist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#exclude_k8s_labels LtsCceAccess#exclude_k8s_labels} + */ + readonly excludeK8SLabels?: { [key: string]: string }; + /** + * The container label blacklist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#exclude_labels LtsCceAccess#exclude_labels} + */ + readonly excludeLabels?: { [key: string]: string }; + /** + * The environment variable whitelist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#include_envs LtsCceAccess#include_envs} + */ + readonly includeEnvs?: { [key: string]: string }; + /** + * The kubernetes label whitelist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#include_k8s_labels LtsCceAccess#include_k8s_labels} + */ + readonly includeK8SLabels?: { [key: string]: string }; + /** + * The container label whitelist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#include_labels LtsCceAccess#include_labels} + */ + readonly includeLabels?: { [key: string]: string }; + /** + * The environment variable tag. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#log_envs LtsCceAccess#log_envs} + */ + readonly logEnvs?: { [key: string]: string }; + /** + * The kubernetes label log tag. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#log_k8s LtsCceAccess#log_k8s} + */ + readonly logK8S?: { [key: string]: string }; + /** + * The container label log tag. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#log_labels LtsCceAccess#log_labels} + */ + readonly logLabels?: { [key: string]: string }; + /** + * The regular expression matching of kubernetes namespaces. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#name_space_regex LtsCceAccess#name_space_regex} + */ + readonly nameSpaceRegex?: string; + /** + * The type of the CCE access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#path_type LtsCceAccess#path_type} + */ + readonly pathType: string; + /** + * The collection paths. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#paths LtsCceAccess#paths} + */ + readonly paths?: string[]; + /** + * The regular expression matching of kubernetes pods. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#pod_name_regex LtsCceAccess#pod_name_regex} + */ + readonly podNameRegex?: string; + /** + * Whether error output is standard. Default is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#stderr LtsCceAccess#stderr} + */ + readonly stderr?: boolean | cdktf.IResolvable; + /** + * Whether output is standard. Default is false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#stdout LtsCceAccess#stdout} + */ + readonly stdout?: boolean | cdktf.IResolvable; + /** + * multi_log_format block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#multi_log_format LtsCceAccess#multi_log_format} + */ + readonly multiLogFormat?: LtsCceAccessAccessConfigMultiLogFormat; + /** + * single_log_format block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#single_log_format LtsCceAccess#single_log_format} + */ + readonly singleLogFormat?: LtsCceAccessAccessConfigSingleLogFormat; + /** + * windows_log_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#windows_log_info LtsCceAccess#windows_log_info} + */ + readonly windowsLogInfo?: LtsCceAccessAccessConfigWindowsLogInfo; +} + +export function ltsCceAccessAccessConfigToTerraform(struct?: LtsCceAccessAccessConfigOutputReference | LtsCceAccessAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + black_paths: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.blackPaths), + container_name_regex: cdktf.stringToTerraform(struct!.containerNameRegex), + exclude_envs: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.excludeEnvs), + exclude_k8s_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.excludeK8SLabels), + exclude_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.excludeLabels), + include_envs: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.includeEnvs), + include_k8s_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.includeK8SLabels), + include_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.includeLabels), + log_envs: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.logEnvs), + log_k8s: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.logK8S), + log_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.logLabels), + name_space_regex: cdktf.stringToTerraform(struct!.nameSpaceRegex), + path_type: cdktf.stringToTerraform(struct!.pathType), + paths: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.paths), + pod_name_regex: cdktf.stringToTerraform(struct!.podNameRegex), + stderr: cdktf.booleanToTerraform(struct!.stderr), + stdout: cdktf.booleanToTerraform(struct!.stdout), + multi_log_format: ltsCceAccessAccessConfigMultiLogFormatToTerraform(struct!.multiLogFormat), + single_log_format: ltsCceAccessAccessConfigSingleLogFormatToTerraform(struct!.singleLogFormat), + windows_log_info: ltsCceAccessAccessConfigWindowsLogInfoToTerraform(struct!.windowsLogInfo), + } +} + + +export function ltsCceAccessAccessConfigToHclTerraform(struct?: LtsCceAccessAccessConfigOutputReference | LtsCceAccessAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + black_paths: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.blackPaths), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + container_name_regex: { + value: cdktf.stringToHclTerraform(struct!.containerNameRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exclude_envs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.excludeEnvs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + exclude_k8s_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.excludeK8SLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + exclude_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.excludeLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + include_envs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.includeEnvs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + include_k8s_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.includeK8SLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + include_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.includeLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + log_envs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.logEnvs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + log_k8s: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.logK8S), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + log_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.logLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name_space_regex: { + value: cdktf.stringToHclTerraform(struct!.nameSpaceRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path_type: { + value: cdktf.stringToHclTerraform(struct!.pathType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + paths: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.paths), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + pod_name_regex: { + value: cdktf.stringToHclTerraform(struct!.podNameRegex), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stderr: { + value: cdktf.booleanToHclTerraform(struct!.stderr), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + stdout: { + value: cdktf.booleanToHclTerraform(struct!.stdout), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + multi_log_format: { + value: ltsCceAccessAccessConfigMultiLogFormatToHclTerraform(struct!.multiLogFormat), + isBlock: true, + type: "list", + storageClassType: "LtsCceAccessAccessConfigMultiLogFormatList", + }, + single_log_format: { + value: ltsCceAccessAccessConfigSingleLogFormatToHclTerraform(struct!.singleLogFormat), + isBlock: true, + type: "list", + storageClassType: "LtsCceAccessAccessConfigSingleLogFormatList", + }, + windows_log_info: { + value: ltsCceAccessAccessConfigWindowsLogInfoToHclTerraform(struct!.windowsLogInfo), + isBlock: true, + type: "list", + storageClassType: "LtsCceAccessAccessConfigWindowsLogInfoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsCceAccessAccessConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsCceAccessAccessConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blackPaths !== undefined) { + hasAnyValues = true; + internalValueResult.blackPaths = this._blackPaths; + } + if (this._containerNameRegex !== undefined) { + hasAnyValues = true; + internalValueResult.containerNameRegex = this._containerNameRegex; + } + if (this._excludeEnvs !== undefined) { + hasAnyValues = true; + internalValueResult.excludeEnvs = this._excludeEnvs; + } + if (this._excludeK8SLabels !== undefined) { + hasAnyValues = true; + internalValueResult.excludeK8SLabels = this._excludeK8SLabels; + } + if (this._excludeLabels !== undefined) { + hasAnyValues = true; + internalValueResult.excludeLabels = this._excludeLabels; + } + if (this._includeEnvs !== undefined) { + hasAnyValues = true; + internalValueResult.includeEnvs = this._includeEnvs; + } + if (this._includeK8SLabels !== undefined) { + hasAnyValues = true; + internalValueResult.includeK8SLabels = this._includeK8SLabels; + } + if (this._includeLabels !== undefined) { + hasAnyValues = true; + internalValueResult.includeLabels = this._includeLabels; + } + if (this._logEnvs !== undefined) { + hasAnyValues = true; + internalValueResult.logEnvs = this._logEnvs; + } + if (this._logK8S !== undefined) { + hasAnyValues = true; + internalValueResult.logK8S = this._logK8S; + } + if (this._logLabels !== undefined) { + hasAnyValues = true; + internalValueResult.logLabels = this._logLabels; + } + if (this._nameSpaceRegex !== undefined) { + hasAnyValues = true; + internalValueResult.nameSpaceRegex = this._nameSpaceRegex; + } + if (this._pathType !== undefined) { + hasAnyValues = true; + internalValueResult.pathType = this._pathType; + } + if (this._paths !== undefined) { + hasAnyValues = true; + internalValueResult.paths = this._paths; + } + if (this._podNameRegex !== undefined) { + hasAnyValues = true; + internalValueResult.podNameRegex = this._podNameRegex; + } + if (this._stderr !== undefined) { + hasAnyValues = true; + internalValueResult.stderr = this._stderr; + } + if (this._stdout !== undefined) { + hasAnyValues = true; + internalValueResult.stdout = this._stdout; + } + if (this._multiLogFormat?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.multiLogFormat = this._multiLogFormat?.internalValue; + } + if (this._singleLogFormat?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.singleLogFormat = this._singleLogFormat?.internalValue; + } + if (this._windowsLogInfo?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.windowsLogInfo = this._windowsLogInfo?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsCceAccessAccessConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blackPaths = undefined; + this._containerNameRegex = undefined; + this._excludeEnvs = undefined; + this._excludeK8SLabels = undefined; + this._excludeLabels = undefined; + this._includeEnvs = undefined; + this._includeK8SLabels = undefined; + this._includeLabels = undefined; + this._logEnvs = undefined; + this._logK8S = undefined; + this._logLabels = undefined; + this._nameSpaceRegex = undefined; + this._pathType = undefined; + this._paths = undefined; + this._podNameRegex = undefined; + this._stderr = undefined; + this._stdout = undefined; + this._multiLogFormat.internalValue = undefined; + this._singleLogFormat.internalValue = undefined; + this._windowsLogInfo.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blackPaths = value.blackPaths; + this._containerNameRegex = value.containerNameRegex; + this._excludeEnvs = value.excludeEnvs; + this._excludeK8SLabels = value.excludeK8SLabels; + this._excludeLabels = value.excludeLabels; + this._includeEnvs = value.includeEnvs; + this._includeK8SLabels = value.includeK8SLabels; + this._includeLabels = value.includeLabels; + this._logEnvs = value.logEnvs; + this._logK8S = value.logK8S; + this._logLabels = value.logLabels; + this._nameSpaceRegex = value.nameSpaceRegex; + this._pathType = value.pathType; + this._paths = value.paths; + this._podNameRegex = value.podNameRegex; + this._stderr = value.stderr; + this._stdout = value.stdout; + this._multiLogFormat.internalValue = value.multiLogFormat; + this._singleLogFormat.internalValue = value.singleLogFormat; + this._windowsLogInfo.internalValue = value.windowsLogInfo; + } + } + + // black_paths - computed: false, optional: true, required: false + private _blackPaths?: string[]; + public get blackPaths() { + return this.getListAttribute('black_paths'); + } + public set blackPaths(value: string[]) { + this._blackPaths = value; + } + public resetBlackPaths() { + this._blackPaths = undefined; + } + // Temporarily expose input value. Use with caution. + public get blackPathsInput() { + return this._blackPaths; + } + + // container_name_regex - computed: false, optional: true, required: false + private _containerNameRegex?: string; + public get containerNameRegex() { + return this.getStringAttribute('container_name_regex'); + } + public set containerNameRegex(value: string) { + this._containerNameRegex = value; + } + public resetContainerNameRegex() { + this._containerNameRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get containerNameRegexInput() { + return this._containerNameRegex; + } + + // exclude_envs - computed: false, optional: true, required: false + private _excludeEnvs?: { [key: string]: string }; + public get excludeEnvs() { + return this.getStringMapAttribute('exclude_envs'); + } + public set excludeEnvs(value: { [key: string]: string }) { + this._excludeEnvs = value; + } + public resetExcludeEnvs() { + this._excludeEnvs = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludeEnvsInput() { + return this._excludeEnvs; + } + + // exclude_k8s_labels - computed: false, optional: true, required: false + private _excludeK8SLabels?: { [key: string]: string }; + public get excludeK8SLabels() { + return this.getStringMapAttribute('exclude_k8s_labels'); + } + public set excludeK8SLabels(value: { [key: string]: string }) { + this._excludeK8SLabels = value; + } + public resetExcludeK8SLabels() { + this._excludeK8SLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludeK8SLabelsInput() { + return this._excludeK8SLabels; + } + + // exclude_labels - computed: false, optional: true, required: false + private _excludeLabels?: { [key: string]: string }; + public get excludeLabels() { + return this.getStringMapAttribute('exclude_labels'); + } + public set excludeLabels(value: { [key: string]: string }) { + this._excludeLabels = value; + } + public resetExcludeLabels() { + this._excludeLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludeLabelsInput() { + return this._excludeLabels; + } + + // include_envs - computed: false, optional: true, required: false + private _includeEnvs?: { [key: string]: string }; + public get includeEnvs() { + return this.getStringMapAttribute('include_envs'); + } + public set includeEnvs(value: { [key: string]: string }) { + this._includeEnvs = value; + } + public resetIncludeEnvs() { + this._includeEnvs = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeEnvsInput() { + return this._includeEnvs; + } + + // include_k8s_labels - computed: false, optional: true, required: false + private _includeK8SLabels?: { [key: string]: string }; + public get includeK8SLabels() { + return this.getStringMapAttribute('include_k8s_labels'); + } + public set includeK8SLabels(value: { [key: string]: string }) { + this._includeK8SLabels = value; + } + public resetIncludeK8SLabels() { + this._includeK8SLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeK8SLabelsInput() { + return this._includeK8SLabels; + } + + // include_labels - computed: false, optional: true, required: false + private _includeLabels?: { [key: string]: string }; + public get includeLabels() { + return this.getStringMapAttribute('include_labels'); + } + public set includeLabels(value: { [key: string]: string }) { + this._includeLabels = value; + } + public resetIncludeLabels() { + this._includeLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get includeLabelsInput() { + return this._includeLabels; + } + + // log_envs - computed: false, optional: true, required: false + private _logEnvs?: { [key: string]: string }; + public get logEnvs() { + return this.getStringMapAttribute('log_envs'); + } + public set logEnvs(value: { [key: string]: string }) { + this._logEnvs = value; + } + public resetLogEnvs() { + this._logEnvs = undefined; + } + // Temporarily expose input value. Use with caution. + public get logEnvsInput() { + return this._logEnvs; + } + + // log_k8s - computed: false, optional: true, required: false + private _logK8S?: { [key: string]: string }; + public get logK8S() { + return this.getStringMapAttribute('log_k8s'); + } + public set logK8S(value: { [key: string]: string }) { + this._logK8S = value; + } + public resetLogK8S() { + this._logK8S = undefined; + } + // Temporarily expose input value. Use with caution. + public get logK8SInput() { + return this._logK8S; + } + + // log_labels - computed: false, optional: true, required: false + private _logLabels?: { [key: string]: string }; + public get logLabels() { + return this.getStringMapAttribute('log_labels'); + } + public set logLabels(value: { [key: string]: string }) { + this._logLabels = value; + } + public resetLogLabels() { + this._logLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get logLabelsInput() { + return this._logLabels; + } + + // name_space_regex - computed: false, optional: true, required: false + private _nameSpaceRegex?: string; + public get nameSpaceRegex() { + return this.getStringAttribute('name_space_regex'); + } + public set nameSpaceRegex(value: string) { + this._nameSpaceRegex = value; + } + public resetNameSpaceRegex() { + this._nameSpaceRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameSpaceRegexInput() { + return this._nameSpaceRegex; + } + + // path_type - computed: false, optional: false, required: true + private _pathType?: string; + public get pathType() { + return this.getStringAttribute('path_type'); + } + public set pathType(value: string) { + this._pathType = value; + } + // Temporarily expose input value. Use with caution. + public get pathTypeInput() { + return this._pathType; + } + + // paths - computed: false, optional: true, required: false + private _paths?: string[]; + public get paths() { + return this.getListAttribute('paths'); + } + public set paths(value: string[]) { + this._paths = value; + } + public resetPaths() { + this._paths = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathsInput() { + return this._paths; + } + + // pod_name_regex - computed: false, optional: true, required: false + private _podNameRegex?: string; + public get podNameRegex() { + return this.getStringAttribute('pod_name_regex'); + } + public set podNameRegex(value: string) { + this._podNameRegex = value; + } + public resetPodNameRegex() { + this._podNameRegex = undefined; + } + // Temporarily expose input value. Use with caution. + public get podNameRegexInput() { + return this._podNameRegex; + } + + // stderr - computed: true, optional: true, required: false + private _stderr?: boolean | cdktf.IResolvable; + public get stderr() { + return this.getBooleanAttribute('stderr'); + } + public set stderr(value: boolean | cdktf.IResolvable) { + this._stderr = value; + } + public resetStderr() { + this._stderr = undefined; + } + // Temporarily expose input value. Use with caution. + public get stderrInput() { + return this._stderr; + } + + // stdout - computed: true, optional: true, required: false + private _stdout?: boolean | cdktf.IResolvable; + public get stdout() { + return this.getBooleanAttribute('stdout'); + } + public set stdout(value: boolean | cdktf.IResolvable) { + this._stdout = value; + } + public resetStdout() { + this._stdout = undefined; + } + // Temporarily expose input value. Use with caution. + public get stdoutInput() { + return this._stdout; + } + + // multi_log_format - computed: false, optional: true, required: false + private _multiLogFormat = new LtsCceAccessAccessConfigMultiLogFormatOutputReference(this, "multi_log_format"); + public get multiLogFormat() { + return this._multiLogFormat; + } + public putMultiLogFormat(value: LtsCceAccessAccessConfigMultiLogFormat) { + this._multiLogFormat.internalValue = value; + } + public resetMultiLogFormat() { + this._multiLogFormat.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiLogFormatInput() { + return this._multiLogFormat.internalValue; + } + + // single_log_format - computed: false, optional: true, required: false + private _singleLogFormat = new LtsCceAccessAccessConfigSingleLogFormatOutputReference(this, "single_log_format"); + public get singleLogFormat() { + return this._singleLogFormat; + } + public putSingleLogFormat(value: LtsCceAccessAccessConfigSingleLogFormat) { + this._singleLogFormat.internalValue = value; + } + public resetSingleLogFormat() { + this._singleLogFormat.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get singleLogFormatInput() { + return this._singleLogFormat.internalValue; + } + + // windows_log_info - computed: false, optional: true, required: false + private _windowsLogInfo = new LtsCceAccessAccessConfigWindowsLogInfoOutputReference(this, "windows_log_info"); + public get windowsLogInfo() { + return this._windowsLogInfo; + } + public putWindowsLogInfo(value: LtsCceAccessAccessConfigWindowsLogInfo) { + this._windowsLogInfo.internalValue = value; + } + public resetWindowsLogInfo() { + this._windowsLogInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get windowsLogInfoInput() { + return this._windowsLogInfo.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access huaweicloud_lts_cce_access} +*/ +export class LtsCceAccess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_cce_access"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsCceAccess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsCceAccess to import + * @param importFromId The id of the existing LtsCceAccess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsCceAccess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_cce_access", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cce_access huaweicloud_lts_cce_access} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsCceAccessConfig + */ + public constructor(scope: Construct, id: string, config: LtsCceAccessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_cce_access', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._binaryCollect = config.binaryCollect; + this._clusterId = config.clusterId; + this._hostGroupIds = config.hostGroupIds; + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logSplit = config.logSplit; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._accessConfig.internalValue = config.accessConfig; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // binary_collect - computed: true, optional: true, required: false + private _binaryCollect?: boolean | cdktf.IResolvable; + public get binaryCollect() { + return this.getBooleanAttribute('binary_collect'); + } + public set binaryCollect(value: boolean | cdktf.IResolvable) { + this._binaryCollect = value; + } + public resetBinaryCollect() { + this._binaryCollect = undefined; + } + // Temporarily expose input value. Use with caution. + public get binaryCollectInput() { + return this._binaryCollect; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // host_group_ids - computed: true, optional: true, required: false + private _hostGroupIds?: string[]; + public get hostGroupIds() { + return this.getListAttribute('host_group_ids'); + } + public set hostGroupIds(value: string[]) { + this._hostGroupIds = value; + } + public resetHostGroupIds() { + this._hostGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostGroupIdsInput() { + return this._hostGroupIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // log_split - computed: true, optional: true, required: false + private _logSplit?: boolean | cdktf.IResolvable; + public get logSplit() { + return this.getBooleanAttribute('log_split'); + } + public set logSplit(value: boolean | cdktf.IResolvable) { + this._logSplit = value; + } + public resetLogSplit() { + this._logSplit = undefined; + } + // Temporarily expose input value. Use with caution. + public get logSplitInput() { + return this._logSplit; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: true, optional: false, required: false + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // access_config - computed: false, optional: false, required: true + private _accessConfig = new LtsCceAccessAccessConfigOutputReference(this, "access_config"); + public get accessConfig() { + return this._accessConfig; + } + public putAccessConfig(value: LtsCceAccessAccessConfig) { + this._accessConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get accessConfigInput() { + return this._accessConfig.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + binary_collect: cdktf.booleanToTerraform(this._binaryCollect), + cluster_id: cdktf.stringToTerraform(this._clusterId), + host_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._hostGroupIds), + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_split: cdktf.booleanToTerraform(this._logSplit), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + access_config: ltsCceAccessAccessConfigToTerraform(this._accessConfig.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + binary_collect: { + value: cdktf.booleanToHclTerraform(this._binaryCollect), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._hostGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_split: { + value: cdktf.booleanToHclTerraform(this._logSplit), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + access_config: { + value: ltsCceAccessAccessConfigToHclTerraform(this._accessConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsCceAccessAccessConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-cross-account-access/README.md b/src/constructs/providers/huaweicloud/lts-cross-account-access/README.md new file mode 100644 index 00000000..66194d03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-cross-account-access/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_cross_account_access` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_cross_account_access`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access). diff --git a/src/constructs/providers/huaweicloud/lts-cross-account-access/index.ts b/src/constructs/providers/huaweicloud/lts-cross-account-access/index.ts new file mode 100644 index 00000000..902dc39b --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-cross-account-access/index.ts @@ -0,0 +1,506 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsCrossAccountAccessConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the delegator account to verify the delegation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#agency_domain_name LtsCrossAccountAccess#agency_domain_name} + */ + readonly agencyDomainName: string; + /** + * Specifies the name of the agency created in IAM by the delegator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#agency_name LtsCrossAccountAccess#agency_name} + */ + readonly agencyName: string; + /** + * Specifies the delegator project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#agency_project_id LtsCrossAccountAccess#agency_project_id} + */ + readonly agencyProjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#id LtsCrossAccountAccess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specify the log group ID that already exists in the delegated account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_agencygroup_id LtsCrossAccountAccess#log_agencygroup_id} + */ + readonly logAgencygroupId: string; + /** + * Specify the log group name that already exists in the delegated account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_agencygroup_name LtsCrossAccountAccess#log_agencygroup_name} + */ + readonly logAgencygroupName: string; + /** + * Specifies the log stream ID that already exists in the delegated account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_agencystream_id LtsCrossAccountAccess#log_agencystream_id} + */ + readonly logAgencystreamId: string; + /** + * Specifies the log stream name that already exists in the delegated account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_agencystream_name LtsCrossAccountAccess#log_agencystream_name} + */ + readonly logAgencystreamName: string; + /** + * Specify the log group ID that already exists in the delegatee account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_group_id LtsCrossAccountAccess#log_group_id} + */ + readonly logGroupId: string; + /** + * Specify the log group name that already exists in the delegatee account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_group_name LtsCrossAccountAccess#log_group_name} + */ + readonly logGroupName: string; + /** + * Specifies the log stream ID that already exists in the delegatee account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_stream_id LtsCrossAccountAccess#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies the log stream name that already exists in the delegatee account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#log_stream_name LtsCrossAccountAccess#log_stream_name} + */ + readonly logStreamName: string; + /** + * Specifies the name of the cross account access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#name LtsCrossAccountAccess#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#region LtsCrossAccountAccess#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#tags LtsCrossAccountAccess#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access huaweicloud_lts_cross_account_access} +*/ +export class LtsCrossAccountAccess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_cross_account_access"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsCrossAccountAccess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsCrossAccountAccess to import + * @param importFromId The id of the existing LtsCrossAccountAccess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsCrossAccountAccess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_cross_account_access", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_cross_account_access huaweicloud_lts_cross_account_access} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsCrossAccountAccessConfig + */ + public constructor(scope: Construct, id: string, config: LtsCrossAccountAccessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_cross_account_access', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyDomainName = config.agencyDomainName; + this._agencyName = config.agencyName; + this._agencyProjectId = config.agencyProjectId; + this._id = config.id; + this._logAgencygroupId = config.logAgencygroupId; + this._logAgencygroupName = config.logAgencygroupName; + this._logAgencystreamId = config.logAgencystreamId; + this._logAgencystreamName = config.logAgencystreamName; + this._logGroupId = config.logGroupId; + this._logGroupName = config.logGroupName; + this._logStreamId = config.logStreamId; + this._logStreamName = config.logStreamName; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_config_type - computed: true, optional: false, required: false + public get accessConfigType() { + return this.getStringAttribute('access_config_type'); + } + + // agency_domain_name - computed: false, optional: false, required: true + private _agencyDomainName?: string; + public get agencyDomainName() { + return this.getStringAttribute('agency_domain_name'); + } + public set agencyDomainName(value: string) { + this._agencyDomainName = value; + } + // Temporarily expose input value. Use with caution. + public get agencyDomainNameInput() { + return this._agencyDomainName; + } + + // agency_name - computed: false, optional: false, required: true + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // agency_project_id - computed: false, optional: false, required: true + private _agencyProjectId?: string; + public get agencyProjectId() { + return this.getStringAttribute('agency_project_id'); + } + public set agencyProjectId(value: string) { + this._agencyProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get agencyProjectIdInput() { + return this._agencyProjectId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_agencygroup_id - computed: false, optional: false, required: true + private _logAgencygroupId?: string; + public get logAgencygroupId() { + return this.getStringAttribute('log_agencygroup_id'); + } + public set logAgencygroupId(value: string) { + this._logAgencygroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logAgencygroupIdInput() { + return this._logAgencygroupId; + } + + // log_agencygroup_name - computed: false, optional: false, required: true + private _logAgencygroupName?: string; + public get logAgencygroupName() { + return this.getStringAttribute('log_agencygroup_name'); + } + public set logAgencygroupName(value: string) { + this._logAgencygroupName = value; + } + // Temporarily expose input value. Use with caution. + public get logAgencygroupNameInput() { + return this._logAgencygroupName; + } + + // log_agencystream_id - computed: false, optional: false, required: true + private _logAgencystreamId?: string; + public get logAgencystreamId() { + return this.getStringAttribute('log_agencystream_id'); + } + public set logAgencystreamId(value: string) { + this._logAgencystreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logAgencystreamIdInput() { + return this._logAgencystreamId; + } + + // log_agencystream_name - computed: false, optional: false, required: true + private _logAgencystreamName?: string; + public get logAgencystreamName() { + return this.getStringAttribute('log_agencystream_name'); + } + public set logAgencystreamName(value: string) { + this._logAgencystreamName = value; + } + // Temporarily expose input value. Use with caution. + public get logAgencystreamNameInput() { + return this._logAgencystreamName; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: false, optional: false, required: true + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: false, optional: false, required: true + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_domain_name: cdktf.stringToTerraform(this._agencyDomainName), + agency_name: cdktf.stringToTerraform(this._agencyName), + agency_project_id: cdktf.stringToTerraform(this._agencyProjectId), + id: cdktf.stringToTerraform(this._id), + log_agencygroup_id: cdktf.stringToTerraform(this._logAgencygroupId), + log_agencygroup_name: cdktf.stringToTerraform(this._logAgencygroupName), + log_agencystream_id: cdktf.stringToTerraform(this._logAgencystreamId), + log_agencystream_name: cdktf.stringToTerraform(this._logAgencystreamName), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_domain_name: { + value: cdktf.stringToHclTerraform(this._agencyDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_project_id: { + value: cdktf.stringToHclTerraform(this._agencyProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_agencygroup_id: { + value: cdktf.stringToHclTerraform(this._logAgencygroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_agencygroup_name: { + value: cdktf.stringToHclTerraform(this._logAgencygroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_agencystream_id: { + value: cdktf.stringToHclTerraform(this._logAgencystreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_agencystream_name: { + value: cdktf.stringToHclTerraform(this._logAgencystreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-dashboard/README.md b/src/constructs/providers/huaweicloud/lts-dashboard/README.md new file mode 100644 index 00000000..856ece3b --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-dashboard/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_dashboard` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_dashboard`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard). diff --git a/src/constructs/providers/huaweicloud/lts-dashboard/index.ts b/src/constructs/providers/huaweicloud/lts-dashboard/index.ts new file mode 100644 index 00000000..b25a2742 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-dashboard/index.ts @@ -0,0 +1,437 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsDashboardConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#filters LtsDashboard#filters} + */ + readonly filters?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#group_name LtsDashboard#group_name} + */ + readonly groupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#id LtsDashboard#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#is_delete_charts LtsDashboard#is_delete_charts} + */ + readonly isDeleteCharts?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#last_update_time LtsDashboard#last_update_time} + */ + readonly lastUpdateTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#log_group_id LtsDashboard#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#log_group_name LtsDashboard#log_group_name} + */ + readonly logGroupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#log_stream_id LtsDashboard#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#log_stream_name LtsDashboard#log_stream_name} + */ + readonly logStreamName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#region LtsDashboard#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#template_title LtsDashboard#template_title} + */ + readonly templateTitle: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#template_type LtsDashboard#template_type} + */ + readonly templateType?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#title LtsDashboard#title} + */ + readonly title?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard huaweicloud_lts_dashboard} +*/ +export class LtsDashboard extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_dashboard"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsDashboard resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsDashboard to import + * @param importFromId The id of the existing LtsDashboard that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsDashboard to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_dashboard", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_dashboard huaweicloud_lts_dashboard} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsDashboardConfig + */ + public constructor(scope: Construct, id: string, config: LtsDashboardConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_dashboard', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._filters = config.filters; + this._groupName = config.groupName; + this._id = config.id; + this._isDeleteCharts = config.isDeleteCharts; + this._lastUpdateTime = config.lastUpdateTime; + this._logGroupId = config.logGroupId; + this._logGroupName = config.logGroupName; + this._logStreamId = config.logStreamId; + this._logStreamName = config.logStreamName; + this._region = config.region; + this._templateTitle = config.templateTitle; + this._templateType = config.templateType; + this._title = config.title; + } + + // ========== + // ATTRIBUTES + // ========== + + // filters - computed: false, optional: true, required: false + private _filters?: string[]; + public get filters() { + return this.getListAttribute('filters'); + } + public set filters(value: string[]) { + this._filters = value; + } + public resetFilters() { + this._filters = undefined; + } + // Temporarily expose input value. Use with caution. + public get filtersInput() { + return this._filters; + } + + // group_name - computed: false, optional: true, required: false + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + public resetGroupName() { + this._groupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_delete_charts - computed: false, optional: true, required: false + private _isDeleteCharts?: string; + public get isDeleteCharts() { + return this.getStringAttribute('is_delete_charts'); + } + public set isDeleteCharts(value: string) { + this._isDeleteCharts = value; + } + public resetIsDeleteCharts() { + this._isDeleteCharts = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDeleteChartsInput() { + return this._isDeleteCharts; + } + + // last_update_time - computed: false, optional: true, required: false + private _lastUpdateTime?: number; + public get lastUpdateTime() { + return this.getNumberAttribute('last_update_time'); + } + public set lastUpdateTime(value: number) { + this._lastUpdateTime = value; + } + public resetLastUpdateTime() { + this._lastUpdateTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get lastUpdateTimeInput() { + return this._lastUpdateTime; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: false, optional: false, required: true + private _logGroupName?: string; + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + public set logGroupName(value: string) { + this._logGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupNameInput() { + return this._logGroupName; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: false, optional: false, required: true + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_title - computed: false, optional: false, required: true + private _templateTitle?: string[]; + public get templateTitle() { + return this.getListAttribute('template_title'); + } + public set templateTitle(value: string[]) { + this._templateTitle = value; + } + // Temporarily expose input value. Use with caution. + public get templateTitleInput() { + return this._templateTitle; + } + + // template_type - computed: false, optional: true, required: false + private _templateType?: string[]; + public get templateType() { + return this.getListAttribute('template_type'); + } + public set templateType(value: string[]) { + this._templateType = value; + } + public resetTemplateType() { + this._templateType = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateTypeInput() { + return this._templateType; + } + + // title - computed: true, optional: true, required: false + private _title?: string; + public get title() { + return this.getStringAttribute('title'); + } + public set title(value: string) { + this._title = value; + } + public resetTitle() { + this._title = undefined; + } + // Temporarily expose input value. Use with caution. + public get titleInput() { + return this._title; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + filters: cdktf.listMapper(cdktf.stringToTerraform, false)(this._filters), + group_name: cdktf.stringToTerraform(this._groupName), + id: cdktf.stringToTerraform(this._id), + is_delete_charts: cdktf.stringToTerraform(this._isDeleteCharts), + last_update_time: cdktf.numberToTerraform(this._lastUpdateTime), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_group_name: cdktf.stringToTerraform(this._logGroupName), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + log_stream_name: cdktf.stringToTerraform(this._logStreamName), + region: cdktf.stringToTerraform(this._region), + template_title: cdktf.listMapper(cdktf.stringToTerraform, false)(this._templateTitle), + template_type: cdktf.listMapper(cdktf.stringToTerraform, false)(this._templateType), + title: cdktf.stringToTerraform(this._title), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + filters: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._filters), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + group_name: { + value: cdktf.stringToHclTerraform(this._groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_delete_charts: { + value: cdktf.stringToHclTerraform(this._isDeleteCharts), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_update_time: { + value: cdktf.numberToHclTerraform(this._lastUpdateTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_name: { + value: cdktf.stringToHclTerraform(this._logGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(this._logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_title: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._templateTitle), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + template_type: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._templateType), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + title: { + value: cdktf.stringToHclTerraform(this._title), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-group/README.md b/src/constructs/providers/huaweicloud/lts-group/README.md new file mode 100644 index 00000000..d05e3188 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group). diff --git a/src/constructs/providers/huaweicloud/lts-group/index.ts b/src/constructs/providers/huaweicloud/lts-group/index.ts new file mode 100644 index 00000000..14247491 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-group/index.ts @@ -0,0 +1,257 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The enterprise project ID to which the log group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#enterprise_project_id LtsGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#group_name LtsGroup#group_name} + */ + readonly groupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#id LtsGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#region LtsGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#tags LtsGroup#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#ttl_in_days LtsGroup#ttl_in_days} + */ + readonly ttlInDays: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group huaweicloud_lts_group} +*/ +export class LtsGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsGroup to import + * @param importFromId The id of the existing LtsGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_group huaweicloud_lts_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsGroupConfig + */ + public constructor(scope: Construct, id: string, config: LtsGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupName = config.groupName; + this._id = config.id; + this._region = config.region; + this._tags = config.tags; + this._ttlInDays = config.ttlInDays; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl_in_days - computed: false, optional: false, required: true + private _ttlInDays?: number; + public get ttlInDays() { + return this.getNumberAttribute('ttl_in_days'); + } + public set ttlInDays(value: number) { + this._ttlInDays = value; + } + // Temporarily expose input value. Use with caution. + public get ttlInDaysInput() { + return this._ttlInDays; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_name: cdktf.stringToTerraform(this._groupName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl_in_days: cdktf.numberToTerraform(this._ttlInDays), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_name: { + value: cdktf.stringToHclTerraform(this._groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl_in_days: { + value: cdktf.numberToHclTerraform(this._ttlInDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-host-access/README.md b/src/constructs/providers/huaweicloud/lts-host-access/README.md new file mode 100644 index 00000000..1b48c6fd --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-host-access/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_host_access` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_host_access`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access). diff --git a/src/constructs/providers/huaweicloud/lts-host-access/index.ts b/src/constructs/providers/huaweicloud/lts-host-access/index.ts new file mode 100644 index 00000000..895967ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-host-access/index.ts @@ -0,0 +1,932 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsHostAccessConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#host_group_ids LtsHostAccess#host_group_ids} + */ + readonly hostGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#id LtsHostAccess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#log_group_id LtsHostAccess#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#log_stream_id LtsHostAccess#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#name LtsHostAccess#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#region LtsHostAccess#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#tags LtsHostAccess#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * access_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#access_config LtsHostAccess#access_config} + */ + readonly accessConfig: LtsHostAccessAccessConfig; +} +export interface LtsHostAccessAccessConfigMultiLogFormat { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#mode LtsHostAccess#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#value LtsHostAccess#value} + */ + readonly value: string; +} + +export function ltsHostAccessAccessConfigMultiLogFormatToTerraform(struct?: LtsHostAccessAccessConfigMultiLogFormatOutputReference | LtsHostAccessAccessConfigMultiLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + mode: cdktf.stringToTerraform(struct!.mode), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ltsHostAccessAccessConfigMultiLogFormatToHclTerraform(struct?: LtsHostAccessAccessConfigMultiLogFormatOutputReference | LtsHostAccessAccessConfigMultiLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsHostAccessAccessConfigMultiLogFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsHostAccessAccessConfigMultiLogFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsHostAccessAccessConfigMultiLogFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._mode = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._mode = value.mode; + this._value = value.value; + } + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface LtsHostAccessAccessConfigSingleLogFormat { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#mode LtsHostAccess#mode} + */ + readonly mode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#value LtsHostAccess#value} + */ + readonly value?: string; +} + +export function ltsHostAccessAccessConfigSingleLogFormatToTerraform(struct?: LtsHostAccessAccessConfigSingleLogFormatOutputReference | LtsHostAccessAccessConfigSingleLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + mode: cdktf.stringToTerraform(struct!.mode), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function ltsHostAccessAccessConfigSingleLogFormatToHclTerraform(struct?: LtsHostAccessAccessConfigSingleLogFormatOutputReference | LtsHostAccessAccessConfigSingleLogFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsHostAccessAccessConfigSingleLogFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsHostAccessAccessConfigSingleLogFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsHostAccessAccessConfigSingleLogFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._mode = undefined; + this._value = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._mode = value.mode; + this._value = value.value; + } + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} +export interface LtsHostAccessAccessConfigWindowsLogInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#categorys LtsHostAccess#categorys} + */ + readonly categorys: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#event_level LtsHostAccess#event_level} + */ + readonly eventLevel: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#time_offset LtsHostAccess#time_offset} + */ + readonly timeOffset: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#time_offset_unit LtsHostAccess#time_offset_unit} + */ + readonly timeOffsetUnit: string; +} + +export function ltsHostAccessAccessConfigWindowsLogInfoToTerraform(struct?: LtsHostAccessAccessConfigWindowsLogInfoOutputReference | LtsHostAccessAccessConfigWindowsLogInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + categorys: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.categorys), + event_level: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.eventLevel), + time_offset: cdktf.numberToTerraform(struct!.timeOffset), + time_offset_unit: cdktf.stringToTerraform(struct!.timeOffsetUnit), + } +} + + +export function ltsHostAccessAccessConfigWindowsLogInfoToHclTerraform(struct?: LtsHostAccessAccessConfigWindowsLogInfoOutputReference | LtsHostAccessAccessConfigWindowsLogInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + categorys: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.categorys), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + event_level: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.eventLevel), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + time_offset: { + value: cdktf.numberToHclTerraform(struct!.timeOffset), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_offset_unit: { + value: cdktf.stringToHclTerraform(struct!.timeOffsetUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsHostAccessAccessConfigWindowsLogInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsHostAccessAccessConfigWindowsLogInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._categorys !== undefined) { + hasAnyValues = true; + internalValueResult.categorys = this._categorys; + } + if (this._eventLevel !== undefined) { + hasAnyValues = true; + internalValueResult.eventLevel = this._eventLevel; + } + if (this._timeOffset !== undefined) { + hasAnyValues = true; + internalValueResult.timeOffset = this._timeOffset; + } + if (this._timeOffsetUnit !== undefined) { + hasAnyValues = true; + internalValueResult.timeOffsetUnit = this._timeOffsetUnit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsHostAccessAccessConfigWindowsLogInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._categorys = undefined; + this._eventLevel = undefined; + this._timeOffset = undefined; + this._timeOffsetUnit = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._categorys = value.categorys; + this._eventLevel = value.eventLevel; + this._timeOffset = value.timeOffset; + this._timeOffsetUnit = value.timeOffsetUnit; + } + } + + // categorys - computed: false, optional: false, required: true + private _categorys?: string[]; + public get categorys() { + return this.getListAttribute('categorys'); + } + public set categorys(value: string[]) { + this._categorys = value; + } + // Temporarily expose input value. Use with caution. + public get categorysInput() { + return this._categorys; + } + + // event_level - computed: false, optional: false, required: true + private _eventLevel?: string[]; + public get eventLevel() { + return this.getListAttribute('event_level'); + } + public set eventLevel(value: string[]) { + this._eventLevel = value; + } + // Temporarily expose input value. Use with caution. + public get eventLevelInput() { + return this._eventLevel; + } + + // time_offset - computed: false, optional: false, required: true + private _timeOffset?: number; + public get timeOffset() { + return this.getNumberAttribute('time_offset'); + } + public set timeOffset(value: number) { + this._timeOffset = value; + } + // Temporarily expose input value. Use with caution. + public get timeOffsetInput() { + return this._timeOffset; + } + + // time_offset_unit - computed: false, optional: false, required: true + private _timeOffsetUnit?: string; + public get timeOffsetUnit() { + return this.getStringAttribute('time_offset_unit'); + } + public set timeOffsetUnit(value: string) { + this._timeOffsetUnit = value; + } + // Temporarily expose input value. Use with caution. + public get timeOffsetUnitInput() { + return this._timeOffsetUnit; + } +} +export interface LtsHostAccessAccessConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#black_paths LtsHostAccess#black_paths} + */ + readonly blackPaths?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#paths LtsHostAccess#paths} + */ + readonly paths: string[]; + /** + * multi_log_format block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#multi_log_format LtsHostAccess#multi_log_format} + */ + readonly multiLogFormat?: LtsHostAccessAccessConfigMultiLogFormat; + /** + * single_log_format block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#single_log_format LtsHostAccess#single_log_format} + */ + readonly singleLogFormat?: LtsHostAccessAccessConfigSingleLogFormat; + /** + * windows_log_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#windows_log_info LtsHostAccess#windows_log_info} + */ + readonly windowsLogInfo?: LtsHostAccessAccessConfigWindowsLogInfo; +} + +export function ltsHostAccessAccessConfigToTerraform(struct?: LtsHostAccessAccessConfigOutputReference | LtsHostAccessAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + black_paths: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.blackPaths), + paths: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.paths), + multi_log_format: ltsHostAccessAccessConfigMultiLogFormatToTerraform(struct!.multiLogFormat), + single_log_format: ltsHostAccessAccessConfigSingleLogFormatToTerraform(struct!.singleLogFormat), + windows_log_info: ltsHostAccessAccessConfigWindowsLogInfoToTerraform(struct!.windowsLogInfo), + } +} + + +export function ltsHostAccessAccessConfigToHclTerraform(struct?: LtsHostAccessAccessConfigOutputReference | LtsHostAccessAccessConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + black_paths: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.blackPaths), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + paths: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.paths), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + multi_log_format: { + value: ltsHostAccessAccessConfigMultiLogFormatToHclTerraform(struct!.multiLogFormat), + isBlock: true, + type: "list", + storageClassType: "LtsHostAccessAccessConfigMultiLogFormatList", + }, + single_log_format: { + value: ltsHostAccessAccessConfigSingleLogFormatToHclTerraform(struct!.singleLogFormat), + isBlock: true, + type: "list", + storageClassType: "LtsHostAccessAccessConfigSingleLogFormatList", + }, + windows_log_info: { + value: ltsHostAccessAccessConfigWindowsLogInfoToHclTerraform(struct!.windowsLogInfo), + isBlock: true, + type: "list", + storageClassType: "LtsHostAccessAccessConfigWindowsLogInfoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsHostAccessAccessConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsHostAccessAccessConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blackPaths !== undefined) { + hasAnyValues = true; + internalValueResult.blackPaths = this._blackPaths; + } + if (this._paths !== undefined) { + hasAnyValues = true; + internalValueResult.paths = this._paths; + } + if (this._multiLogFormat?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.multiLogFormat = this._multiLogFormat?.internalValue; + } + if (this._singleLogFormat?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.singleLogFormat = this._singleLogFormat?.internalValue; + } + if (this._windowsLogInfo?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.windowsLogInfo = this._windowsLogInfo?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsHostAccessAccessConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blackPaths = undefined; + this._paths = undefined; + this._multiLogFormat.internalValue = undefined; + this._singleLogFormat.internalValue = undefined; + this._windowsLogInfo.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blackPaths = value.blackPaths; + this._paths = value.paths; + this._multiLogFormat.internalValue = value.multiLogFormat; + this._singleLogFormat.internalValue = value.singleLogFormat; + this._windowsLogInfo.internalValue = value.windowsLogInfo; + } + } + + // black_paths - computed: true, optional: true, required: false + private _blackPaths?: string[]; + public get blackPaths() { + return this.getListAttribute('black_paths'); + } + public set blackPaths(value: string[]) { + this._blackPaths = value; + } + public resetBlackPaths() { + this._blackPaths = undefined; + } + // Temporarily expose input value. Use with caution. + public get blackPathsInput() { + return this._blackPaths; + } + + // paths - computed: false, optional: false, required: true + private _paths?: string[]; + public get paths() { + return this.getListAttribute('paths'); + } + public set paths(value: string[]) { + this._paths = value; + } + // Temporarily expose input value. Use with caution. + public get pathsInput() { + return this._paths; + } + + // multi_log_format - computed: false, optional: true, required: false + private _multiLogFormat = new LtsHostAccessAccessConfigMultiLogFormatOutputReference(this, "multi_log_format"); + public get multiLogFormat() { + return this._multiLogFormat; + } + public putMultiLogFormat(value: LtsHostAccessAccessConfigMultiLogFormat) { + this._multiLogFormat.internalValue = value; + } + public resetMultiLogFormat() { + this._multiLogFormat.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiLogFormatInput() { + return this._multiLogFormat.internalValue; + } + + // single_log_format - computed: false, optional: true, required: false + private _singleLogFormat = new LtsHostAccessAccessConfigSingleLogFormatOutputReference(this, "single_log_format"); + public get singleLogFormat() { + return this._singleLogFormat; + } + public putSingleLogFormat(value: LtsHostAccessAccessConfigSingleLogFormat) { + this._singleLogFormat.internalValue = value; + } + public resetSingleLogFormat() { + this._singleLogFormat.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get singleLogFormatInput() { + return this._singleLogFormat.internalValue; + } + + // windows_log_info - computed: false, optional: true, required: false + private _windowsLogInfo = new LtsHostAccessAccessConfigWindowsLogInfoOutputReference(this, "windows_log_info"); + public get windowsLogInfo() { + return this._windowsLogInfo; + } + public putWindowsLogInfo(value: LtsHostAccessAccessConfigWindowsLogInfo) { + this._windowsLogInfo.internalValue = value; + } + public resetWindowsLogInfo() { + this._windowsLogInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get windowsLogInfoInput() { + return this._windowsLogInfo.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access huaweicloud_lts_host_access} +*/ +export class LtsHostAccess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_host_access"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsHostAccess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsHostAccess to import + * @param importFromId The id of the existing LtsHostAccess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsHostAccess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_host_access", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_access huaweicloud_lts_host_access} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsHostAccessConfig + */ + public constructor(scope: Construct, id: string, config: LtsHostAccessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_host_access', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._hostGroupIds = config.hostGroupIds; + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._accessConfig.internalValue = config.accessConfig; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // host_group_ids - computed: true, optional: true, required: false + private _hostGroupIds?: string[]; + public get hostGroupIds() { + return this.getListAttribute('host_group_ids'); + } + public set hostGroupIds(value: string[]) { + this._hostGroupIds = value; + } + public resetHostGroupIds() { + this._hostGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostGroupIdsInput() { + return this._hostGroupIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: true, optional: false, required: false + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // access_config - computed: false, optional: false, required: true + private _accessConfig = new LtsHostAccessAccessConfigOutputReference(this, "access_config"); + public get accessConfig() { + return this._accessConfig; + } + public putAccessConfig(value: LtsHostAccessAccessConfig) { + this._accessConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get accessConfigInput() { + return this._accessConfig.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + host_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._hostGroupIds), + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + access_config: ltsHostAccessAccessConfigToTerraform(this._accessConfig.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + host_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._hostGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + access_config: { + value: ltsHostAccessAccessConfigToHclTerraform(this._accessConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsHostAccessAccessConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-host-group/README.md b/src/constructs/providers/huaweicloud/lts-host-group/README.md new file mode 100644 index 00000000..085999e9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-host-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_host_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_host_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group). diff --git a/src/constructs/providers/huaweicloud/lts-host-group/index.ts b/src/constructs/providers/huaweicloud/lts-host-group/index.ts new file mode 100644 index 00000000..acd17f22 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-host-group/index.ts @@ -0,0 +1,326 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsHostGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the type of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#agent_access_type LtsHostGroup#agent_access_type} + */ + readonly agentAccessType?: string; + /** + * Specifies the ID list of hosts to join the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#host_ids LtsHostGroup#host_ids} + */ + readonly hostIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#id LtsHostGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the custom label list of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#labels LtsHostGroup#labels} + */ + readonly labels?: string[]; + /** + * Specifies the name of the host group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#name LtsHostGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#region LtsHostGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#tags LtsHostGroup#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the type of the host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#type LtsHostGroup#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group huaweicloud_lts_host_group} +*/ +export class LtsHostGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_host_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsHostGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsHostGroup to import + * @param importFromId The id of the existing LtsHostGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsHostGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_host_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_host_group huaweicloud_lts_host_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsHostGroupConfig + */ + public constructor(scope: Construct, id: string, config: LtsHostGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_host_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agentAccessType = config.agentAccessType; + this._hostIds = config.hostIds; + this._id = config.id; + this._labels = config.labels; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // agent_access_type - computed: true, optional: true, required: false + private _agentAccessType?: string; + public get agentAccessType() { + return this.getStringAttribute('agent_access_type'); + } + public set agentAccessType(value: string) { + this._agentAccessType = value; + } + public resetAgentAccessType() { + this._agentAccessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get agentAccessTypeInput() { + return this._agentAccessType; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // host_ids - computed: false, optional: true, required: false + private _hostIds?: string[]; + public get hostIds() { + return cdktf.Fn.tolist(this.getListAttribute('host_ids')); + } + public set hostIds(value: string[]) { + this._hostIds = value; + } + public resetHostIds() { + this._hostIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostIdsInput() { + return this._hostIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // labels - computed: false, optional: true, required: false + private _labels?: string[]; + public get labels() { + return cdktf.Fn.tolist(this.getListAttribute('labels')); + } + public set labels(value: string[]) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agent_access_type: cdktf.stringToTerraform(this._agentAccessType), + host_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._hostIds), + id: cdktf.stringToTerraform(this._id), + labels: cdktf.listMapper(cdktf.stringToTerraform, false)(this._labels), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agent_access_type: { + value: cdktf.stringToHclTerraform(this._agentAccessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._hostIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._labels), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/README.md b/src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/README.md new file mode 100644 index 00000000..6ecefc77 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_keywords_alarm_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_keywords_alarm_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule). diff --git a/src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/index.ts b/src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/index.ts new file mode 100644 index 00000000..d718355a --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-keywords-alarm-rule/index.ts @@ -0,0 +1,1506 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsKeywordsAlarmRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the alarm level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#alarm_level LtsKeywordsAlarmRule#alarm_level} + */ + readonly alarmLevel: string; + /** + * Specifies the description of the keywords alarm rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#description LtsKeywordsAlarmRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#id LtsKeywordsAlarmRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the keywords alarm rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#name LtsKeywordsAlarmRule#name} + */ + readonly name: string; + /** + * Specifies the frequency to recover the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#recovery_frequency LtsKeywordsAlarmRule#recovery_frequency} + */ + readonly recoveryFrequency?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#region LtsKeywordsAlarmRule#region} + */ + readonly region?: string; + /** + * Specifies whether to send notifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#send_notifications LtsKeywordsAlarmRule#send_notifications} + */ + readonly sendNotifications?: boolean | cdktf.IResolvable; + /** + * Specifies whether to send recovery notifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#send_recovery_notifications LtsKeywordsAlarmRule#send_recovery_notifications} + */ + readonly sendRecoveryNotifications?: boolean | cdktf.IResolvable; + /** + * Specifies the status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#status LtsKeywordsAlarmRule#status} + */ + readonly status?: string; + /** + * Specifies the count to trigger the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#trigger_condition_count LtsKeywordsAlarmRule#trigger_condition_count} + */ + readonly triggerConditionCount?: number; + /** + * Specifies the frequency to trigger the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#trigger_condition_frequency LtsKeywordsAlarmRule#trigger_condition_frequency} + */ + readonly triggerConditionFrequency?: number; + /** + * frequency block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#frequency LtsKeywordsAlarmRule#frequency} + */ + readonly frequency: LtsKeywordsAlarmRuleFrequency; + /** + * keywords_requests block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#keywords_requests LtsKeywordsAlarmRule#keywords_requests} + */ + readonly keywordsRequests: LtsKeywordsAlarmRuleKeywordsRequests[] | cdktf.IResolvable; + /** + * notification_rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#notification_rule LtsKeywordsAlarmRule#notification_rule} + */ + readonly notificationRule?: LtsKeywordsAlarmRuleNotificationRule; +} +export interface LtsKeywordsAlarmRuleFrequency { + /** + * Specifies the cron expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#cron_expression LtsKeywordsAlarmRule#cron_expression} + */ + readonly cronExpression?: string; + /** + * Specifies the day of week. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#day_of_week LtsKeywordsAlarmRule#day_of_week} + */ + readonly dayOfWeek?: number; + /** + * Specifies the unit fixed rate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#fixed_rate LtsKeywordsAlarmRule#fixed_rate} + */ + readonly fixedRate?: number; + /** + * Specifies the unit of fixed rate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#fixed_rate_unit LtsKeywordsAlarmRule#fixed_rate_unit} + */ + readonly fixedRateUnit?: string; + /** + * Specifies the hour of day. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#hour_of_day LtsKeywordsAlarmRule#hour_of_day} + */ + readonly hourOfDay?: number; + /** + * Specifies the frequency type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#type LtsKeywordsAlarmRule#type} + */ + readonly type: string; +} + +export function ltsKeywordsAlarmRuleFrequencyToTerraform(struct?: LtsKeywordsAlarmRuleFrequencyOutputReference | LtsKeywordsAlarmRuleFrequency): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cron_expression: cdktf.stringToTerraform(struct!.cronExpression), + day_of_week: cdktf.numberToTerraform(struct!.dayOfWeek), + fixed_rate: cdktf.numberToTerraform(struct!.fixedRate), + fixed_rate_unit: cdktf.stringToTerraform(struct!.fixedRateUnit), + hour_of_day: cdktf.numberToTerraform(struct!.hourOfDay), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ltsKeywordsAlarmRuleFrequencyToHclTerraform(struct?: LtsKeywordsAlarmRuleFrequencyOutputReference | LtsKeywordsAlarmRuleFrequency): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cron_expression: { + value: cdktf.stringToHclTerraform(struct!.cronExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + day_of_week: { + value: cdktf.numberToHclTerraform(struct!.dayOfWeek), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fixed_rate: { + value: cdktf.numberToHclTerraform(struct!.fixedRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fixed_rate_unit: { + value: cdktf.stringToHclTerraform(struct!.fixedRateUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hour_of_day: { + value: cdktf.numberToHclTerraform(struct!.hourOfDay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsKeywordsAlarmRuleFrequencyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsKeywordsAlarmRuleFrequency | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cronExpression !== undefined) { + hasAnyValues = true; + internalValueResult.cronExpression = this._cronExpression; + } + if (this._dayOfWeek !== undefined) { + hasAnyValues = true; + internalValueResult.dayOfWeek = this._dayOfWeek; + } + if (this._fixedRate !== undefined) { + hasAnyValues = true; + internalValueResult.fixedRate = this._fixedRate; + } + if (this._fixedRateUnit !== undefined) { + hasAnyValues = true; + internalValueResult.fixedRateUnit = this._fixedRateUnit; + } + if (this._hourOfDay !== undefined) { + hasAnyValues = true; + internalValueResult.hourOfDay = this._hourOfDay; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsKeywordsAlarmRuleFrequency | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cronExpression = undefined; + this._dayOfWeek = undefined; + this._fixedRate = undefined; + this._fixedRateUnit = undefined; + this._hourOfDay = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cronExpression = value.cronExpression; + this._dayOfWeek = value.dayOfWeek; + this._fixedRate = value.fixedRate; + this._fixedRateUnit = value.fixedRateUnit; + this._hourOfDay = value.hourOfDay; + this._type = value.type; + } + } + + // cron_expression - computed: true, optional: true, required: false + private _cronExpression?: string; + public get cronExpression() { + return this.getStringAttribute('cron_expression'); + } + public set cronExpression(value: string) { + this._cronExpression = value; + } + public resetCronExpression() { + this._cronExpression = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronExpressionInput() { + return this._cronExpression; + } + + // day_of_week - computed: true, optional: true, required: false + private _dayOfWeek?: number; + public get dayOfWeek() { + return this.getNumberAttribute('day_of_week'); + } + public set dayOfWeek(value: number) { + this._dayOfWeek = value; + } + public resetDayOfWeek() { + this._dayOfWeek = undefined; + } + // Temporarily expose input value. Use with caution. + public get dayOfWeekInput() { + return this._dayOfWeek; + } + + // fixed_rate - computed: true, optional: true, required: false + private _fixedRate?: number; + public get fixedRate() { + return this.getNumberAttribute('fixed_rate'); + } + public set fixedRate(value: number) { + this._fixedRate = value; + } + public resetFixedRate() { + this._fixedRate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedRateInput() { + return this._fixedRate; + } + + // fixed_rate_unit - computed: true, optional: true, required: false + private _fixedRateUnit?: string; + public get fixedRateUnit() { + return this.getStringAttribute('fixed_rate_unit'); + } + public set fixedRateUnit(value: string) { + this._fixedRateUnit = value; + } + public resetFixedRateUnit() { + this._fixedRateUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedRateUnitInput() { + return this._fixedRateUnit; + } + + // hour_of_day - computed: true, optional: true, required: false + private _hourOfDay?: number; + public get hourOfDay() { + return this.getNumberAttribute('hour_of_day'); + } + public set hourOfDay(value: number) { + this._hourOfDay = value; + } + public resetHourOfDay() { + this._hourOfDay = undefined; + } + // Temporarily expose input value. Use with caution. + public get hourOfDayInput() { + return this._hourOfDay; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface LtsKeywordsAlarmRuleKeywordsRequests { + /** + * Specifies the keywords request condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#condition LtsKeywordsAlarmRule#condition} + */ + readonly condition: string; + /** + * Specifies the keywords. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#keywords LtsKeywordsAlarmRule#keywords} + */ + readonly keywords: string; + /** + * Specifies the log group id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#log_group_id LtsKeywordsAlarmRule#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the log stream id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#log_stream_id LtsKeywordsAlarmRule#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies the line number. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#number LtsKeywordsAlarmRule#number} + */ + readonly number: number; + /** + * Specifies the search time range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#search_time_range LtsKeywordsAlarmRule#search_time_range} + */ + readonly searchTimeRange: number; + /** + * Specifies the unit of search time range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#search_time_range_unit LtsKeywordsAlarmRule#search_time_range_unit} + */ + readonly searchTimeRangeUnit: string; +} + +export function ltsKeywordsAlarmRuleKeywordsRequestsToTerraform(struct?: LtsKeywordsAlarmRuleKeywordsRequests | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + condition: cdktf.stringToTerraform(struct!.condition), + keywords: cdktf.stringToTerraform(struct!.keywords), + log_group_id: cdktf.stringToTerraform(struct!.logGroupId), + log_stream_id: cdktf.stringToTerraform(struct!.logStreamId), + number: cdktf.numberToTerraform(struct!.number), + search_time_range: cdktf.numberToTerraform(struct!.searchTimeRange), + search_time_range_unit: cdktf.stringToTerraform(struct!.searchTimeRangeUnit), + } +} + + +export function ltsKeywordsAlarmRuleKeywordsRequestsToHclTerraform(struct?: LtsKeywordsAlarmRuleKeywordsRequests | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + condition: { + value: cdktf.stringToHclTerraform(struct!.condition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keywords: { + value: cdktf.stringToHclTerraform(struct!.keywords), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(struct!.logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + number: { + value: cdktf.numberToHclTerraform(struct!.number), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + search_time_range: { + value: cdktf.numberToHclTerraform(struct!.searchTimeRange), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + search_time_range_unit: { + value: cdktf.stringToHclTerraform(struct!.searchTimeRangeUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsKeywordsAlarmRuleKeywordsRequestsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsKeywordsAlarmRuleKeywordsRequests | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._condition !== undefined) { + hasAnyValues = true; + internalValueResult.condition = this._condition; + } + if (this._keywords !== undefined) { + hasAnyValues = true; + internalValueResult.keywords = this._keywords; + } + if (this._logGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.logGroupId = this._logGroupId; + } + if (this._logStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamId = this._logStreamId; + } + if (this._number !== undefined) { + hasAnyValues = true; + internalValueResult.number = this._number; + } + if (this._searchTimeRange !== undefined) { + hasAnyValues = true; + internalValueResult.searchTimeRange = this._searchTimeRange; + } + if (this._searchTimeRangeUnit !== undefined) { + hasAnyValues = true; + internalValueResult.searchTimeRangeUnit = this._searchTimeRangeUnit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsKeywordsAlarmRuleKeywordsRequests | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._condition = undefined; + this._keywords = undefined; + this._logGroupId = undefined; + this._logStreamId = undefined; + this._number = undefined; + this._searchTimeRange = undefined; + this._searchTimeRangeUnit = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._condition = value.condition; + this._keywords = value.keywords; + this._logGroupId = value.logGroupId; + this._logStreamId = value.logStreamId; + this._number = value.number; + this._searchTimeRange = value.searchTimeRange; + this._searchTimeRangeUnit = value.searchTimeRangeUnit; + } + } + + // condition - computed: false, optional: false, required: true + private _condition?: string; + public get condition() { + return this.getStringAttribute('condition'); + } + public set condition(value: string) { + this._condition = value; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // keywords - computed: false, optional: false, required: true + private _keywords?: string; + public get keywords() { + return this.getStringAttribute('keywords'); + } + public set keywords(value: string) { + this._keywords = value; + } + // Temporarily expose input value. Use with caution. + public get keywordsInput() { + return this._keywords; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // number - computed: false, optional: false, required: true + private _number?: number; + public get number() { + return this.getNumberAttribute('number'); + } + public set number(value: number) { + this._number = value; + } + // Temporarily expose input value. Use with caution. + public get numberInput() { + return this._number; + } + + // search_time_range - computed: false, optional: false, required: true + private _searchTimeRange?: number; + public get searchTimeRange() { + return this.getNumberAttribute('search_time_range'); + } + public set searchTimeRange(value: number) { + this._searchTimeRange = value; + } + // Temporarily expose input value. Use with caution. + public get searchTimeRangeInput() { + return this._searchTimeRange; + } + + // search_time_range_unit - computed: false, optional: false, required: true + private _searchTimeRangeUnit?: string; + public get searchTimeRangeUnit() { + return this.getStringAttribute('search_time_range_unit'); + } + public set searchTimeRangeUnit(value: string) { + this._searchTimeRangeUnit = value; + } + // Temporarily expose input value. Use with caution. + public get searchTimeRangeUnitInput() { + return this._searchTimeRangeUnit; + } +} + +export class LtsKeywordsAlarmRuleKeywordsRequestsList extends cdktf.ComplexList { + public internalValue? : LtsKeywordsAlarmRuleKeywordsRequests[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsKeywordsAlarmRuleKeywordsRequestsOutputReference { + return new LtsKeywordsAlarmRuleKeywordsRequestsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsKeywordsAlarmRuleNotificationRuleTopics { + /** + * Specifies the display name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#display_name LtsKeywordsAlarmRule#display_name} + */ + readonly displayName?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#name LtsKeywordsAlarmRule#name} + */ + readonly name: string; + /** + * Specifies the push policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#push_policy LtsKeywordsAlarmRule#push_policy} + */ + readonly pushPolicy?: string; + /** + * Specifies the topic URN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#topic_urn LtsKeywordsAlarmRule#topic_urn} + */ + readonly topicUrn: string; +} + +export function ltsKeywordsAlarmRuleNotificationRuleTopicsToTerraform(struct?: LtsKeywordsAlarmRuleNotificationRuleTopics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + display_name: cdktf.stringToTerraform(struct!.displayName), + name: cdktf.stringToTerraform(struct!.name), + push_policy: cdktf.stringToTerraform(struct!.pushPolicy), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function ltsKeywordsAlarmRuleNotificationRuleTopicsToHclTerraform(struct?: LtsKeywordsAlarmRuleNotificationRuleTopics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(struct!.displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + push_policy: { + value: cdktf.stringToHclTerraform(struct!.pushPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsKeywordsAlarmRuleNotificationRuleTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsKeywordsAlarmRuleNotificationRuleTopics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._displayName !== undefined) { + hasAnyValues = true; + internalValueResult.displayName = this._displayName; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._pushPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.pushPolicy = this._pushPolicy; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsKeywordsAlarmRuleNotificationRuleTopics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._displayName = undefined; + this._name = undefined; + this._pushPolicy = undefined; + this._topicUrn = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._displayName = value.displayName; + this._name = value.name; + this._pushPolicy = value.pushPolicy; + this._topicUrn = value.topicUrn; + } + } + + // display_name - computed: true, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // push_policy - computed: true, optional: true, required: false + private _pushPolicy?: string; + public get pushPolicy() { + return this.getStringAttribute('push_policy'); + } + public set pushPolicy(value: string) { + this._pushPolicy = value; + } + public resetPushPolicy() { + this._pushPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get pushPolicyInput() { + return this._pushPolicy; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} + +export class LtsKeywordsAlarmRuleNotificationRuleTopicsList extends cdktf.ComplexList { + public internalValue? : LtsKeywordsAlarmRuleNotificationRuleTopics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsKeywordsAlarmRuleNotificationRuleTopicsOutputReference { + return new LtsKeywordsAlarmRuleNotificationRuleTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsKeywordsAlarmRuleNotificationRule { + /** + * Specifies the notification language. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#language LtsKeywordsAlarmRule#language} + */ + readonly language?: string; + /** + * Specifies the notification template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#template_name LtsKeywordsAlarmRule#template_name} + */ + readonly templateName: string; + /** + * Specifies the timezone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#timezone LtsKeywordsAlarmRule#timezone} + */ + readonly timezone?: string; + /** + * Specifies the user name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#user_name LtsKeywordsAlarmRule#user_name} + */ + readonly userName: string; + /** + * topics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#topics LtsKeywordsAlarmRule#topics} + */ + readonly topics: LtsKeywordsAlarmRuleNotificationRuleTopics[] | cdktf.IResolvable; +} + +export function ltsKeywordsAlarmRuleNotificationRuleToTerraform(struct?: LtsKeywordsAlarmRuleNotificationRuleOutputReference | LtsKeywordsAlarmRuleNotificationRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + language: cdktf.stringToTerraform(struct!.language), + template_name: cdktf.stringToTerraform(struct!.templateName), + timezone: cdktf.stringToTerraform(struct!.timezone), + user_name: cdktf.stringToTerraform(struct!.userName), + topics: cdktf.listMapper(ltsKeywordsAlarmRuleNotificationRuleTopicsToTerraform, true)(struct!.topics), + } +} + + +export function ltsKeywordsAlarmRuleNotificationRuleToHclTerraform(struct?: LtsKeywordsAlarmRuleNotificationRuleOutputReference | LtsKeywordsAlarmRuleNotificationRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + language: { + value: cdktf.stringToHclTerraform(struct!.language), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_name: { + value: cdktf.stringToHclTerraform(struct!.templateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timezone: { + value: cdktf.stringToHclTerraform(struct!.timezone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topics: { + value: cdktf.listMapperHcl(ltsKeywordsAlarmRuleNotificationRuleTopicsToHclTerraform, true)(struct!.topics), + isBlock: true, + type: "list", + storageClassType: "LtsKeywordsAlarmRuleNotificationRuleTopicsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsKeywordsAlarmRuleNotificationRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsKeywordsAlarmRuleNotificationRule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._language !== undefined) { + hasAnyValues = true; + internalValueResult.language = this._language; + } + if (this._templateName !== undefined) { + hasAnyValues = true; + internalValueResult.templateName = this._templateName; + } + if (this._timezone !== undefined) { + hasAnyValues = true; + internalValueResult.timezone = this._timezone; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + if (this._topics?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.topics = this._topics?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsKeywordsAlarmRuleNotificationRule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._language = undefined; + this._templateName = undefined; + this._timezone = undefined; + this._userName = undefined; + this._topics.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._language = value.language; + this._templateName = value.templateName; + this._timezone = value.timezone; + this._userName = value.userName; + this._topics.internalValue = value.topics; + } + } + + // language - computed: true, optional: true, required: false + private _language?: string; + public get language() { + return this.getStringAttribute('language'); + } + public set language(value: string) { + this._language = value; + } + public resetLanguage() { + this._language = undefined; + } + // Temporarily expose input value. Use with caution. + public get languageInput() { + return this._language; + } + + // template_name - computed: false, optional: false, required: true + private _templateName?: string; + public get templateName() { + return this.getStringAttribute('template_name'); + } + public set templateName(value: string) { + this._templateName = value; + } + // Temporarily expose input value. Use with caution. + public get templateNameInput() { + return this._templateName; + } + + // timezone - computed: true, optional: true, required: false + private _timezone?: string; + public get timezone() { + return this.getStringAttribute('timezone'); + } + public set timezone(value: string) { + this._timezone = value; + } + public resetTimezone() { + this._timezone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timezoneInput() { + return this._timezone; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // topics - computed: false, optional: false, required: true + private _topics = new LtsKeywordsAlarmRuleNotificationRuleTopicsList(this, "topics", false); + public get topics() { + return this._topics; + } + public putTopics(value: LtsKeywordsAlarmRuleNotificationRuleTopics[] | cdktf.IResolvable) { + this._topics.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get topicsInput() { + return this._topics.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule huaweicloud_lts_keywords_alarm_rule} +*/ +export class LtsKeywordsAlarmRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_keywords_alarm_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsKeywordsAlarmRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsKeywordsAlarmRule to import + * @param importFromId The id of the existing LtsKeywordsAlarmRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsKeywordsAlarmRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_keywords_alarm_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_keywords_alarm_rule huaweicloud_lts_keywords_alarm_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsKeywordsAlarmRuleConfig + */ + public constructor(scope: Construct, id: string, config: LtsKeywordsAlarmRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_keywords_alarm_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmLevel = config.alarmLevel; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._recoveryFrequency = config.recoveryFrequency; + this._region = config.region; + this._sendNotifications = config.sendNotifications; + this._sendRecoveryNotifications = config.sendRecoveryNotifications; + this._status = config.status; + this._triggerConditionCount = config.triggerConditionCount; + this._triggerConditionFrequency = config.triggerConditionFrequency; + this._frequency.internalValue = config.frequency; + this._keywordsRequests.internalValue = config.keywordsRequests; + this._notificationRule.internalValue = config.notificationRule; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_level - computed: false, optional: false, required: true + private _alarmLevel?: string; + public get alarmLevel() { + return this.getStringAttribute('alarm_level'); + } + public set alarmLevel(value: string) { + this._alarmLevel = value; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // recovery_frequency - computed: true, optional: true, required: false + private _recoveryFrequency?: number; + public get recoveryFrequency() { + return this.getNumberAttribute('recovery_frequency'); + } + public set recoveryFrequency(value: number) { + this._recoveryFrequency = value; + } + public resetRecoveryFrequency() { + this._recoveryFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get recoveryFrequencyInput() { + return this._recoveryFrequency; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // send_notifications - computed: true, optional: true, required: false + private _sendNotifications?: boolean | cdktf.IResolvable; + public get sendNotifications() { + return this.getBooleanAttribute('send_notifications'); + } + public set sendNotifications(value: boolean | cdktf.IResolvable) { + this._sendNotifications = value; + } + public resetSendNotifications() { + this._sendNotifications = undefined; + } + // Temporarily expose input value. Use with caution. + public get sendNotificationsInput() { + return this._sendNotifications; + } + + // send_recovery_notifications - computed: true, optional: true, required: false + private _sendRecoveryNotifications?: boolean | cdktf.IResolvable; + public get sendRecoveryNotifications() { + return this.getBooleanAttribute('send_recovery_notifications'); + } + public set sendRecoveryNotifications(value: boolean | cdktf.IResolvable) { + this._sendRecoveryNotifications = value; + } + public resetSendRecoveryNotifications() { + this._sendRecoveryNotifications = undefined; + } + // Temporarily expose input value. Use with caution. + public get sendRecoveryNotificationsInput() { + return this._sendRecoveryNotifications; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // trigger_condition_count - computed: true, optional: true, required: false + private _triggerConditionCount?: number; + public get triggerConditionCount() { + return this.getNumberAttribute('trigger_condition_count'); + } + public set triggerConditionCount(value: number) { + this._triggerConditionCount = value; + } + public resetTriggerConditionCount() { + this._triggerConditionCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionCountInput() { + return this._triggerConditionCount; + } + + // trigger_condition_frequency - computed: true, optional: true, required: false + private _triggerConditionFrequency?: number; + public get triggerConditionFrequency() { + return this.getNumberAttribute('trigger_condition_frequency'); + } + public set triggerConditionFrequency(value: number) { + this._triggerConditionFrequency = value; + } + public resetTriggerConditionFrequency() { + this._triggerConditionFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionFrequencyInput() { + return this._triggerConditionFrequency; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // frequency - computed: false, optional: false, required: true + private _frequency = new LtsKeywordsAlarmRuleFrequencyOutputReference(this, "frequency"); + public get frequency() { + return this._frequency; + } + public putFrequency(value: LtsKeywordsAlarmRuleFrequency) { + this._frequency.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency.internalValue; + } + + // keywords_requests - computed: false, optional: false, required: true + private _keywordsRequests = new LtsKeywordsAlarmRuleKeywordsRequestsList(this, "keywords_requests", false); + public get keywordsRequests() { + return this._keywordsRequests; + } + public putKeywordsRequests(value: LtsKeywordsAlarmRuleKeywordsRequests[] | cdktf.IResolvable) { + this._keywordsRequests.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get keywordsRequestsInput() { + return this._keywordsRequests.internalValue; + } + + // notification_rule - computed: false, optional: true, required: false + private _notificationRule = new LtsKeywordsAlarmRuleNotificationRuleOutputReference(this, "notification_rule"); + public get notificationRule() { + return this._notificationRule; + } + public putNotificationRule(value: LtsKeywordsAlarmRuleNotificationRule) { + this._notificationRule.internalValue = value; + } + public resetNotificationRule() { + this._notificationRule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationRuleInput() { + return this._notificationRule.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_level: cdktf.stringToTerraform(this._alarmLevel), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + recovery_frequency: cdktf.numberToTerraform(this._recoveryFrequency), + region: cdktf.stringToTerraform(this._region), + send_notifications: cdktf.booleanToTerraform(this._sendNotifications), + send_recovery_notifications: cdktf.booleanToTerraform(this._sendRecoveryNotifications), + status: cdktf.stringToTerraform(this._status), + trigger_condition_count: cdktf.numberToTerraform(this._triggerConditionCount), + trigger_condition_frequency: cdktf.numberToTerraform(this._triggerConditionFrequency), + frequency: ltsKeywordsAlarmRuleFrequencyToTerraform(this._frequency.internalValue), + keywords_requests: cdktf.listMapper(ltsKeywordsAlarmRuleKeywordsRequestsToTerraform, true)(this._keywordsRequests.internalValue), + notification_rule: ltsKeywordsAlarmRuleNotificationRuleToTerraform(this._notificationRule.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_level: { + value: cdktf.stringToHclTerraform(this._alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recovery_frequency: { + value: cdktf.numberToHclTerraform(this._recoveryFrequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + send_notifications: { + value: cdktf.booleanToHclTerraform(this._sendNotifications), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + send_recovery_notifications: { + value: cdktf.booleanToHclTerraform(this._sendRecoveryNotifications), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_condition_count: { + value: cdktf.numberToHclTerraform(this._triggerConditionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_condition_frequency: { + value: cdktf.numberToHclTerraform(this._triggerConditionFrequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + frequency: { + value: ltsKeywordsAlarmRuleFrequencyToHclTerraform(this._frequency.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsKeywordsAlarmRuleFrequencyList", + }, + keywords_requests: { + value: cdktf.listMapperHcl(ltsKeywordsAlarmRuleKeywordsRequestsToHclTerraform, true)(this._keywordsRequests.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsKeywordsAlarmRuleKeywordsRequestsList", + }, + notification_rule: { + value: ltsKeywordsAlarmRuleNotificationRuleToHclTerraform(this._notificationRule.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsKeywordsAlarmRuleNotificationRuleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-log-converge-switch/README.md b/src/constructs/providers/huaweicloud/lts-log-converge-switch/README.md new file mode 100644 index 00000000..af3c3180 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-log-converge-switch/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_log_converge_switch` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_log_converge_switch`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch). diff --git a/src/constructs/providers/huaweicloud/lts-log-converge-switch/index.ts b/src/constructs/providers/huaweicloud/lts-log-converge-switch/index.ts new file mode 100644 index 00000000..7df69c5d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-log-converge-switch/index.ts @@ -0,0 +1,144 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsLogConvergeSwitchConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch#id LtsLogConvergeSwitch#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch#region LtsLogConvergeSwitch#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch huaweicloud_lts_log_converge_switch} +*/ +export class LtsLogConvergeSwitch extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_log_converge_switch"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsLogConvergeSwitch resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsLogConvergeSwitch to import + * @param importFromId The id of the existing LtsLogConvergeSwitch that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsLogConvergeSwitch to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_log_converge_switch", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge_switch huaweicloud_lts_log_converge_switch} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsLogConvergeSwitchConfig = {} + */ + public constructor(scope: Construct, id: string, config: LtsLogConvergeSwitchConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_log_converge_switch', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-log-converge/README.md b/src/constructs/providers/huaweicloud/lts-log-converge/README.md new file mode 100644 index 00000000..a7852910 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-log-converge/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_log_converge` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_log_converge`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge). diff --git a/src/constructs/providers/huaweicloud/lts-log-converge/index.ts b/src/constructs/providers/huaweicloud/lts-log-converge/index.ts new file mode 100644 index 00000000..b4253797 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-log-converge/index.ts @@ -0,0 +1,918 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsLogConvergeConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#id LtsLogConverge#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The administrator account ID used to manage log converge. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#management_account_id LtsLogConverge#management_account_id} + */ + readonly managementAccountId: string; + /** + * The administrator project ID that required for first-time use. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#management_project_id LtsLogConverge#management_project_id} + */ + readonly managementProjectId?: string; + /** + * The member account ID to which the converged logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#member_account_id LtsLogConverge#member_account_id} + */ + readonly memberAccountId: string; + /** + * The organization ID to which the converged logs belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#organization_id LtsLogConverge#organization_id} + */ + readonly organizationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#region LtsLogConverge#region} + */ + readonly region?: string; + /** + * log_mapping_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#log_mapping_config LtsLogConverge#log_mapping_config} + */ + readonly logMappingConfig: LtsLogConvergeLogMappingConfig[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#timeouts LtsLogConverge#timeouts} + */ + readonly timeouts?: LtsLogConvergeTimeouts; +} +export interface LtsLogConvergeLogMappingConfigLogStreamConfig { + /** + * The ID of the log stream for source side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#source_log_stream_id LtsLogConverge#source_log_stream_id} + */ + readonly sourceLogStreamId: string; + /** + * The ID of the log stream for target side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#target_log_stream_id LtsLogConverge#target_log_stream_id} + */ + readonly targetLogStreamId?: string; + /** + * The name of the log group for target side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#target_log_stream_name LtsLogConverge#target_log_stream_name} + */ + readonly targetLogStreamName: string; + /** + * The TTL of the log stream for target side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#target_log_stream_ttl LtsLogConverge#target_log_stream_ttl} + */ + readonly targetLogStreamTtl: number; +} + +export function ltsLogConvergeLogMappingConfigLogStreamConfigToTerraform(struct?: LtsLogConvergeLogMappingConfigLogStreamConfig | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + source_log_stream_id: cdktf.stringToTerraform(struct!.sourceLogStreamId), + target_log_stream_id: cdktf.stringToTerraform(struct!.targetLogStreamId), + target_log_stream_name: cdktf.stringToTerraform(struct!.targetLogStreamName), + target_log_stream_ttl: cdktf.numberToTerraform(struct!.targetLogStreamTtl), + } +} + + +export function ltsLogConvergeLogMappingConfigLogStreamConfigToHclTerraform(struct?: LtsLogConvergeLogMappingConfigLogStreamConfig | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + source_log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.sourceLogStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.targetLogStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_stream_name: { + value: cdktf.stringToHclTerraform(struct!.targetLogStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_stream_ttl: { + value: cdktf.numberToHclTerraform(struct!.targetLogStreamTtl), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsLogConvergeLogMappingConfigLogStreamConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsLogConvergeLogMappingConfigLogStreamConfig | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._sourceLogStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.sourceLogStreamId = this._sourceLogStreamId; + } + if (this._targetLogStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogStreamId = this._targetLogStreamId; + } + if (this._targetLogStreamName !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogStreamName = this._targetLogStreamName; + } + if (this._targetLogStreamTtl !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogStreamTtl = this._targetLogStreamTtl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsLogConvergeLogMappingConfigLogStreamConfig | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._sourceLogStreamId = undefined; + this._targetLogStreamId = undefined; + this._targetLogStreamName = undefined; + this._targetLogStreamTtl = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._sourceLogStreamId = value.sourceLogStreamId; + this._targetLogStreamId = value.targetLogStreamId; + this._targetLogStreamName = value.targetLogStreamName; + this._targetLogStreamTtl = value.targetLogStreamTtl; + } + } + + // source_log_stream_id - computed: false, optional: false, required: true + private _sourceLogStreamId?: string; + public get sourceLogStreamId() { + return this.getStringAttribute('source_log_stream_id'); + } + public set sourceLogStreamId(value: string) { + this._sourceLogStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceLogStreamIdInput() { + return this._sourceLogStreamId; + } + + // target_log_stream_eps_id - computed: true, optional: false, required: false + public get targetLogStreamEpsId() { + return this.getStringAttribute('target_log_stream_eps_id'); + } + + // target_log_stream_id - computed: true, optional: true, required: false + private _targetLogStreamId?: string; + public get targetLogStreamId() { + return this.getStringAttribute('target_log_stream_id'); + } + public set targetLogStreamId(value: string) { + this._targetLogStreamId = value; + } + public resetTargetLogStreamId() { + this._targetLogStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetLogStreamIdInput() { + return this._targetLogStreamId; + } + + // target_log_stream_name - computed: false, optional: false, required: true + private _targetLogStreamName?: string; + public get targetLogStreamName() { + return this.getStringAttribute('target_log_stream_name'); + } + public set targetLogStreamName(value: string) { + this._targetLogStreamName = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogStreamNameInput() { + return this._targetLogStreamName; + } + + // target_log_stream_ttl - computed: false, optional: false, required: true + private _targetLogStreamTtl?: number; + public get targetLogStreamTtl() { + return this.getNumberAttribute('target_log_stream_ttl'); + } + public set targetLogStreamTtl(value: number) { + this._targetLogStreamTtl = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogStreamTtlInput() { + return this._targetLogStreamTtl; + } +} + +export class LtsLogConvergeLogMappingConfigLogStreamConfigList extends cdktf.ComplexList { + public internalValue? : LtsLogConvergeLogMappingConfigLogStreamConfig[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsLogConvergeLogMappingConfigLogStreamConfigOutputReference { + return new LtsLogConvergeLogMappingConfigLogStreamConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsLogConvergeLogMappingConfig { + /** + * The ID of the log group for source side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#source_log_group_id LtsLogConverge#source_log_group_id} + */ + readonly sourceLogGroupId: string; + /** + * The ID of the log group for target side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#target_log_group_id LtsLogConverge#target_log_group_id} + */ + readonly targetLogGroupId?: string; + /** + * The name of the log group for target side. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#target_log_group_name LtsLogConverge#target_log_group_name} + */ + readonly targetLogGroupName: string; + /** + * log_stream_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#log_stream_config LtsLogConverge#log_stream_config} + */ + readonly logStreamConfig?: LtsLogConvergeLogMappingConfigLogStreamConfig[] | cdktf.IResolvable; +} + +export function ltsLogConvergeLogMappingConfigToTerraform(struct?: LtsLogConvergeLogMappingConfig | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + source_log_group_id: cdktf.stringToTerraform(struct!.sourceLogGroupId), + target_log_group_id: cdktf.stringToTerraform(struct!.targetLogGroupId), + target_log_group_name: cdktf.stringToTerraform(struct!.targetLogGroupName), + log_stream_config: cdktf.listMapper(ltsLogConvergeLogMappingConfigLogStreamConfigToTerraform, true)(struct!.logStreamConfig), + } +} + + +export function ltsLogConvergeLogMappingConfigToHclTerraform(struct?: LtsLogConvergeLogMappingConfig | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + source_log_group_id: { + value: cdktf.stringToHclTerraform(struct!.sourceLogGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_group_id: { + value: cdktf.stringToHclTerraform(struct!.targetLogGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_log_group_name: { + value: cdktf.stringToHclTerraform(struct!.targetLogGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_config: { + value: cdktf.listMapperHcl(ltsLogConvergeLogMappingConfigLogStreamConfigToHclTerraform, true)(struct!.logStreamConfig), + isBlock: true, + type: "set", + storageClassType: "LtsLogConvergeLogMappingConfigLogStreamConfigList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsLogConvergeLogMappingConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsLogConvergeLogMappingConfig | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._sourceLogGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.sourceLogGroupId = this._sourceLogGroupId; + } + if (this._targetLogGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogGroupId = this._targetLogGroupId; + } + if (this._targetLogGroupName !== undefined) { + hasAnyValues = true; + internalValueResult.targetLogGroupName = this._targetLogGroupName; + } + if (this._logStreamConfig?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamConfig = this._logStreamConfig?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsLogConvergeLogMappingConfig | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._sourceLogGroupId = undefined; + this._targetLogGroupId = undefined; + this._targetLogGroupName = undefined; + this._logStreamConfig.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._sourceLogGroupId = value.sourceLogGroupId; + this._targetLogGroupId = value.targetLogGroupId; + this._targetLogGroupName = value.targetLogGroupName; + this._logStreamConfig.internalValue = value.logStreamConfig; + } + } + + // source_log_group_id - computed: false, optional: false, required: true + private _sourceLogGroupId?: string; + public get sourceLogGroupId() { + return this.getStringAttribute('source_log_group_id'); + } + public set sourceLogGroupId(value: string) { + this._sourceLogGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceLogGroupIdInput() { + return this._sourceLogGroupId; + } + + // target_log_group_id - computed: true, optional: true, required: false + private _targetLogGroupId?: string; + public get targetLogGroupId() { + return this.getStringAttribute('target_log_group_id'); + } + public set targetLogGroupId(value: string) { + this._targetLogGroupId = value; + } + public resetTargetLogGroupId() { + this._targetLogGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetLogGroupIdInput() { + return this._targetLogGroupId; + } + + // target_log_group_name - computed: false, optional: false, required: true + private _targetLogGroupName?: string; + public get targetLogGroupName() { + return this.getStringAttribute('target_log_group_name'); + } + public set targetLogGroupName(value: string) { + this._targetLogGroupName = value; + } + // Temporarily expose input value. Use with caution. + public get targetLogGroupNameInput() { + return this._targetLogGroupName; + } + + // log_stream_config - computed: false, optional: true, required: false + private _logStreamConfig = new LtsLogConvergeLogMappingConfigLogStreamConfigList(this, "log_stream_config", true); + public get logStreamConfig() { + return this._logStreamConfig; + } + public putLogStreamConfig(value: LtsLogConvergeLogMappingConfigLogStreamConfig[] | cdktf.IResolvable) { + this._logStreamConfig.internalValue = value; + } + public resetLogStreamConfig() { + this._logStreamConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamConfigInput() { + return this._logStreamConfig.internalValue; + } +} + +export class LtsLogConvergeLogMappingConfigList extends cdktf.ComplexList { + public internalValue? : LtsLogConvergeLogMappingConfig[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsLogConvergeLogMappingConfigOutputReference { + return new LtsLogConvergeLogMappingConfigOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsLogConvergeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#create LtsLogConverge#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#delete LtsLogConverge#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#update LtsLogConverge#update} + */ + readonly update?: string; +} + +export function ltsLogConvergeTimeoutsToTerraform(struct?: LtsLogConvergeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function ltsLogConvergeTimeoutsToHclTerraform(struct?: LtsLogConvergeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsLogConvergeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): LtsLogConvergeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsLogConvergeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge huaweicloud_lts_log_converge} +*/ +export class LtsLogConverge extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_log_converge"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsLogConverge resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsLogConverge to import + * @param importFromId The id of the existing LtsLogConverge that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsLogConverge to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_log_converge", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_log_converge huaweicloud_lts_log_converge} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsLogConvergeConfig + */ + public constructor(scope: Construct, id: string, config: LtsLogConvergeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_log_converge', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._managementAccountId = config.managementAccountId; + this._managementProjectId = config.managementProjectId; + this._memberAccountId = config.memberAccountId; + this._organizationId = config.organizationId; + this._region = config.region; + this._logMappingConfig.internalValue = config.logMappingConfig; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // management_account_id - computed: false, optional: false, required: true + private _managementAccountId?: string; + public get managementAccountId() { + return this.getStringAttribute('management_account_id'); + } + public set managementAccountId(value: string) { + this._managementAccountId = value; + } + // Temporarily expose input value. Use with caution. + public get managementAccountIdInput() { + return this._managementAccountId; + } + + // management_project_id - computed: true, optional: true, required: false + private _managementProjectId?: string; + public get managementProjectId() { + return this.getStringAttribute('management_project_id'); + } + public set managementProjectId(value: string) { + this._managementProjectId = value; + } + public resetManagementProjectId() { + this._managementProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get managementProjectIdInput() { + return this._managementProjectId; + } + + // member_account_id - computed: false, optional: false, required: true + private _memberAccountId?: string; + public get memberAccountId() { + return this.getStringAttribute('member_account_id'); + } + public set memberAccountId(value: string) { + this._memberAccountId = value; + } + // Temporarily expose input value. Use with caution. + public get memberAccountIdInput() { + return this._memberAccountId; + } + + // organization_id - computed: false, optional: false, required: true + private _organizationId?: string; + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + public set organizationId(value: string) { + this._organizationId = value; + } + // Temporarily expose input value. Use with caution. + public get organizationIdInput() { + return this._organizationId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // log_mapping_config - computed: false, optional: false, required: true + private _logMappingConfig = new LtsLogConvergeLogMappingConfigList(this, "log_mapping_config", true); + public get logMappingConfig() { + return this._logMappingConfig; + } + public putLogMappingConfig(value: LtsLogConvergeLogMappingConfig[] | cdktf.IResolvable) { + this._logMappingConfig.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get logMappingConfigInput() { + return this._logMappingConfig.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new LtsLogConvergeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: LtsLogConvergeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + management_account_id: cdktf.stringToTerraform(this._managementAccountId), + management_project_id: cdktf.stringToTerraform(this._managementProjectId), + member_account_id: cdktf.stringToTerraform(this._memberAccountId), + organization_id: cdktf.stringToTerraform(this._organizationId), + region: cdktf.stringToTerraform(this._region), + log_mapping_config: cdktf.listMapper(ltsLogConvergeLogMappingConfigToTerraform, true)(this._logMappingConfig.internalValue), + timeouts: ltsLogConvergeTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + management_account_id: { + value: cdktf.stringToHclTerraform(this._managementAccountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + management_project_id: { + value: cdktf.stringToHclTerraform(this._managementProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + member_account_id: { + value: cdktf.stringToHclTerraform(this._memberAccountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_id: { + value: cdktf.stringToHclTerraform(this._organizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_mapping_config: { + value: cdktf.listMapperHcl(ltsLogConvergeLogMappingConfigToHclTerraform, true)(this._logMappingConfig.internalValue), + isBlock: true, + type: "set", + storageClassType: "LtsLogConvergeLogMappingConfigList", + }, + timeouts: { + value: ltsLogConvergeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "LtsLogConvergeTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-notification-template/README.md b/src/constructs/providers/huaweicloud/lts-notification-template/README.md new file mode 100644 index 00000000..9ccce134 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-notification-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_notification_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_notification_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template). diff --git a/src/constructs/providers/huaweicloud/lts-notification-template/index.ts b/src/constructs/providers/huaweicloud/lts-notification-template/index.ts new file mode 100644 index 00000000..a871b716 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-notification-template/index.ts @@ -0,0 +1,429 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsNotificationTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the notification template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#description LtsNotificationTemplate#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#id LtsNotificationTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Language. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#locale LtsNotificationTemplate#locale} + */ + readonly locale: string; + /** + * The name of the notification template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#name LtsNotificationTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#region LtsNotificationTemplate#region} + */ + readonly region?: string; + /** + * The source of the notification template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#source LtsNotificationTemplate#source} + */ + readonly source: string; + /** + * templates block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#templates LtsNotificationTemplate#templates} + */ + readonly templates: LtsNotificationTemplateTemplates[] | cdktf.IResolvable; +} +export interface LtsNotificationTemplateTemplates { + /** + * The content of the sub-template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#content LtsNotificationTemplate#content} + */ + readonly content: string; + /** + * The type of the sub-template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#sub_type LtsNotificationTemplate#sub_type} + */ + readonly subType: string; +} + +export function ltsNotificationTemplateTemplatesToTerraform(struct?: LtsNotificationTemplateTemplates | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + sub_type: cdktf.stringToTerraform(struct!.subType), + } +} + + +export function ltsNotificationTemplateTemplatesToHclTerraform(struct?: LtsNotificationTemplateTemplates | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sub_type: { + value: cdktf.stringToHclTerraform(struct!.subType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsNotificationTemplateTemplatesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsNotificationTemplateTemplates | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._subType !== undefined) { + hasAnyValues = true; + internalValueResult.subType = this._subType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsNotificationTemplateTemplates | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._subType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._subType = value.subType; + } + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // sub_type - computed: false, optional: false, required: true + private _subType?: string; + public get subType() { + return this.getStringAttribute('sub_type'); + } + public set subType(value: string) { + this._subType = value; + } + // Temporarily expose input value. Use with caution. + public get subTypeInput() { + return this._subType; + } +} + +export class LtsNotificationTemplateTemplatesList extends cdktf.ComplexList { + public internalValue? : LtsNotificationTemplateTemplates[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsNotificationTemplateTemplatesOutputReference { + return new LtsNotificationTemplateTemplatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template huaweicloud_lts_notification_template} +*/ +export class LtsNotificationTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_notification_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsNotificationTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsNotificationTemplate to import + * @param importFromId The id of the existing LtsNotificationTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsNotificationTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_notification_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_notification_template huaweicloud_lts_notification_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsNotificationTemplateConfig + */ + public constructor(scope: Construct, id: string, config: LtsNotificationTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_notification_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._locale = config.locale; + this._name = config.name; + this._region = config.region; + this._source = config.source; + this._templates.internalValue = config.templates; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // locale - computed: false, optional: false, required: true + private _locale?: string; + public get locale() { + return this.getStringAttribute('locale'); + } + public set locale(value: string) { + this._locale = value; + } + // Temporarily expose input value. Use with caution. + public get localeInput() { + return this._locale; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: false, optional: false, required: true + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // templates - computed: false, optional: false, required: true + private _templates = new LtsNotificationTemplateTemplatesList(this, "templates", false); + public get templates() { + return this._templates; + } + public putTemplates(value: LtsNotificationTemplateTemplates[] | cdktf.IResolvable) { + this._templates.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get templatesInput() { + return this._templates.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + locale: cdktf.stringToTerraform(this._locale), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + templates: cdktf.listMapper(ltsNotificationTemplateTemplatesToTerraform, true)(this._templates.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + locale: { + value: cdktf.stringToHclTerraform(this._locale), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + templates: { + value: cdktf.listMapperHcl(ltsNotificationTemplateTemplatesToHclTerraform, true)(this._templates.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsNotificationTemplateTemplatesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-search-criteria/README.md b/src/constructs/providers/huaweicloud/lts-search-criteria/README.md new file mode 100644 index 00000000..52ac2d98 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-search-criteria/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_search_criteria` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_search_criteria`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria). diff --git a/src/constructs/providers/huaweicloud/lts-search-criteria/index.ts b/src/constructs/providers/huaweicloud/lts-search-criteria/index.ts new file mode 100644 index 00000000..fbff55a4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-search-criteria/index.ts @@ -0,0 +1,297 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsSearchCriteriaConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#criteria LtsSearchCriteria#criteria} + */ + readonly criteria: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#enterprise_project_id LtsSearchCriteria#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#id LtsSearchCriteria#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#log_group_id LtsSearchCriteria#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#log_stream_id LtsSearchCriteria#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#name LtsSearchCriteria#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#region LtsSearchCriteria#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#type LtsSearchCriteria#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria huaweicloud_lts_search_criteria} +*/ +export class LtsSearchCriteria extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_search_criteria"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsSearchCriteria resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsSearchCriteria to import + * @param importFromId The id of the existing LtsSearchCriteria that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsSearchCriteria to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_search_criteria", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_search_criteria huaweicloud_lts_search_criteria} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsSearchCriteriaConfig + */ + public constructor(scope: Construct, id: string, config: LtsSearchCriteriaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_search_criteria', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._criteria = config.criteria; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // criteria - computed: false, optional: false, required: true + private _criteria?: string; + public get criteria() { + return this.getStringAttribute('criteria'); + } + public set criteria(value: string) { + this._criteria = value; + } + // Temporarily expose input value. Use with caution. + public get criteriaInput() { + return this._criteria; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + criteria: cdktf.stringToTerraform(this._criteria), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + criteria: { + value: cdktf.stringToHclTerraform(this._criteria), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-sql-alarm-rule/README.md b/src/constructs/providers/huaweicloud/lts-sql-alarm-rule/README.md new file mode 100644 index 00000000..f73dd69e --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-sql-alarm-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_sql_alarm_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_sql_alarm_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule). diff --git a/src/constructs/providers/huaweicloud/lts-sql-alarm-rule/index.ts b/src/constructs/providers/huaweicloud/lts-sql-alarm-rule/index.ts new file mode 100644 index 00000000..93cdbf9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-sql-alarm-rule/index.ts @@ -0,0 +1,1533 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsSqlAlarmRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the alarm level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#alarm_level LtsSqlAlarmRule#alarm_level} + */ + readonly alarmLevel: string; + /** + * Specifies the condition expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#condition_expression LtsSqlAlarmRule#condition_expression} + */ + readonly conditionExpression: string; + /** + * Specifies the description of the SQL alarm rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#description LtsSqlAlarmRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#id LtsSqlAlarmRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the SQL alarm rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#name LtsSqlAlarmRule#name} + */ + readonly name: string; + /** + * Specifies the frequency to recover the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#recovery_frequency LtsSqlAlarmRule#recovery_frequency} + */ + readonly recoveryFrequency?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#region LtsSqlAlarmRule#region} + */ + readonly region?: string; + /** + * Specifies whether to send notifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#send_notifications LtsSqlAlarmRule#send_notifications} + */ + readonly sendNotifications?: boolean | cdktf.IResolvable; + /** + * Specifies whether to send recovery notifications. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#send_recovery_notifications LtsSqlAlarmRule#send_recovery_notifications} + */ + readonly sendRecoveryNotifications?: boolean | cdktf.IResolvable; + /** + * Specifies the status of the alarm rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#status LtsSqlAlarmRule#status} + */ + readonly status?: string; + /** + * Specifies the count to trigger the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#trigger_condition_count LtsSqlAlarmRule#trigger_condition_count} + */ + readonly triggerConditionCount?: number; + /** + * Specifies the frequency to trigger the alarm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#trigger_condition_frequency LtsSqlAlarmRule#trigger_condition_frequency} + */ + readonly triggerConditionFrequency?: number; + /** + * frequency block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#frequency LtsSqlAlarmRule#frequency} + */ + readonly frequency: LtsSqlAlarmRuleFrequency; + /** + * notification_rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#notification_rule LtsSqlAlarmRule#notification_rule} + */ + readonly notificationRule?: LtsSqlAlarmRuleNotificationRule; + /** + * sql_requests block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#sql_requests LtsSqlAlarmRule#sql_requests} + */ + readonly sqlRequests: LtsSqlAlarmRuleSqlRequests[] | cdktf.IResolvable; +} +export interface LtsSqlAlarmRuleFrequency { + /** + * Specifies the cron expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#cron_expression LtsSqlAlarmRule#cron_expression} + */ + readonly cronExpression?: string; + /** + * Specifies the day of week. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#day_of_week LtsSqlAlarmRule#day_of_week} + */ + readonly dayOfWeek?: number; + /** + * Specifies the unit fixed rate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#fixed_rate LtsSqlAlarmRule#fixed_rate} + */ + readonly fixedRate?: number; + /** + * Specifies the unit of fixed rate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#fixed_rate_unit LtsSqlAlarmRule#fixed_rate_unit} + */ + readonly fixedRateUnit?: string; + /** + * Specifies the hour of day. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#hour_of_day LtsSqlAlarmRule#hour_of_day} + */ + readonly hourOfDay?: number; + /** + * Specifies the frequency type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#type LtsSqlAlarmRule#type} + */ + readonly type: string; +} + +export function ltsSqlAlarmRuleFrequencyToTerraform(struct?: LtsSqlAlarmRuleFrequencyOutputReference | LtsSqlAlarmRuleFrequency): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cron_expression: cdktf.stringToTerraform(struct!.cronExpression), + day_of_week: cdktf.numberToTerraform(struct!.dayOfWeek), + fixed_rate: cdktf.numberToTerraform(struct!.fixedRate), + fixed_rate_unit: cdktf.stringToTerraform(struct!.fixedRateUnit), + hour_of_day: cdktf.numberToTerraform(struct!.hourOfDay), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ltsSqlAlarmRuleFrequencyToHclTerraform(struct?: LtsSqlAlarmRuleFrequencyOutputReference | LtsSqlAlarmRuleFrequency): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cron_expression: { + value: cdktf.stringToHclTerraform(struct!.cronExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + day_of_week: { + value: cdktf.numberToHclTerraform(struct!.dayOfWeek), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fixed_rate: { + value: cdktf.numberToHclTerraform(struct!.fixedRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fixed_rate_unit: { + value: cdktf.stringToHclTerraform(struct!.fixedRateUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hour_of_day: { + value: cdktf.numberToHclTerraform(struct!.hourOfDay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsSqlAlarmRuleFrequencyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsSqlAlarmRuleFrequency | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cronExpression !== undefined) { + hasAnyValues = true; + internalValueResult.cronExpression = this._cronExpression; + } + if (this._dayOfWeek !== undefined) { + hasAnyValues = true; + internalValueResult.dayOfWeek = this._dayOfWeek; + } + if (this._fixedRate !== undefined) { + hasAnyValues = true; + internalValueResult.fixedRate = this._fixedRate; + } + if (this._fixedRateUnit !== undefined) { + hasAnyValues = true; + internalValueResult.fixedRateUnit = this._fixedRateUnit; + } + if (this._hourOfDay !== undefined) { + hasAnyValues = true; + internalValueResult.hourOfDay = this._hourOfDay; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsSqlAlarmRuleFrequency | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cronExpression = undefined; + this._dayOfWeek = undefined; + this._fixedRate = undefined; + this._fixedRateUnit = undefined; + this._hourOfDay = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cronExpression = value.cronExpression; + this._dayOfWeek = value.dayOfWeek; + this._fixedRate = value.fixedRate; + this._fixedRateUnit = value.fixedRateUnit; + this._hourOfDay = value.hourOfDay; + this._type = value.type; + } + } + + // cron_expression - computed: true, optional: true, required: false + private _cronExpression?: string; + public get cronExpression() { + return this.getStringAttribute('cron_expression'); + } + public set cronExpression(value: string) { + this._cronExpression = value; + } + public resetCronExpression() { + this._cronExpression = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronExpressionInput() { + return this._cronExpression; + } + + // day_of_week - computed: true, optional: true, required: false + private _dayOfWeek?: number; + public get dayOfWeek() { + return this.getNumberAttribute('day_of_week'); + } + public set dayOfWeek(value: number) { + this._dayOfWeek = value; + } + public resetDayOfWeek() { + this._dayOfWeek = undefined; + } + // Temporarily expose input value. Use with caution. + public get dayOfWeekInput() { + return this._dayOfWeek; + } + + // fixed_rate - computed: true, optional: true, required: false + private _fixedRate?: number; + public get fixedRate() { + return this.getNumberAttribute('fixed_rate'); + } + public set fixedRate(value: number) { + this._fixedRate = value; + } + public resetFixedRate() { + this._fixedRate = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedRateInput() { + return this._fixedRate; + } + + // fixed_rate_unit - computed: true, optional: true, required: false + private _fixedRateUnit?: string; + public get fixedRateUnit() { + return this.getStringAttribute('fixed_rate_unit'); + } + public set fixedRateUnit(value: string) { + this._fixedRateUnit = value; + } + public resetFixedRateUnit() { + this._fixedRateUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedRateUnitInput() { + return this._fixedRateUnit; + } + + // hour_of_day - computed: true, optional: true, required: false + private _hourOfDay?: number; + public get hourOfDay() { + return this.getNumberAttribute('hour_of_day'); + } + public set hourOfDay(value: number) { + this._hourOfDay = value; + } + public resetHourOfDay() { + this._hourOfDay = undefined; + } + // Temporarily expose input value. Use with caution. + public get hourOfDayInput() { + return this._hourOfDay; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface LtsSqlAlarmRuleNotificationRuleTopics { + /** + * Specifies the display name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#display_name LtsSqlAlarmRule#display_name} + */ + readonly displayName?: string; + /** + * Specifies the topic name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#name LtsSqlAlarmRule#name} + */ + readonly name: string; + /** + * Specifies the push policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#push_policy LtsSqlAlarmRule#push_policy} + */ + readonly pushPolicy?: string; + /** + * Specifies the topic URN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#topic_urn LtsSqlAlarmRule#topic_urn} + */ + readonly topicUrn: string; +} + +export function ltsSqlAlarmRuleNotificationRuleTopicsToTerraform(struct?: LtsSqlAlarmRuleNotificationRuleTopics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + display_name: cdktf.stringToTerraform(struct!.displayName), + name: cdktf.stringToTerraform(struct!.name), + push_policy: cdktf.stringToTerraform(struct!.pushPolicy), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function ltsSqlAlarmRuleNotificationRuleTopicsToHclTerraform(struct?: LtsSqlAlarmRuleNotificationRuleTopics | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + display_name: { + value: cdktf.stringToHclTerraform(struct!.displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + push_policy: { + value: cdktf.stringToHclTerraform(struct!.pushPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsSqlAlarmRuleNotificationRuleTopicsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsSqlAlarmRuleNotificationRuleTopics | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._displayName !== undefined) { + hasAnyValues = true; + internalValueResult.displayName = this._displayName; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._pushPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.pushPolicy = this._pushPolicy; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsSqlAlarmRuleNotificationRuleTopics | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._displayName = undefined; + this._name = undefined; + this._pushPolicy = undefined; + this._topicUrn = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._displayName = value.displayName; + this._name = value.name; + this._pushPolicy = value.pushPolicy; + this._topicUrn = value.topicUrn; + } + } + + // display_name - computed: true, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // push_policy - computed: true, optional: true, required: false + private _pushPolicy?: string; + public get pushPolicy() { + return this.getStringAttribute('push_policy'); + } + public set pushPolicy(value: string) { + this._pushPolicy = value; + } + public resetPushPolicy() { + this._pushPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get pushPolicyInput() { + return this._pushPolicy; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} + +export class LtsSqlAlarmRuleNotificationRuleTopicsList extends cdktf.ComplexList { + public internalValue? : LtsSqlAlarmRuleNotificationRuleTopics[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsSqlAlarmRuleNotificationRuleTopicsOutputReference { + return new LtsSqlAlarmRuleNotificationRuleTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsSqlAlarmRuleNotificationRule { + /** + * Specifies the notification language. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#language LtsSqlAlarmRule#language} + */ + readonly language: string; + /** + * Specifies the notification template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#template_name LtsSqlAlarmRule#template_name} + */ + readonly templateName: string; + /** + * Specifies the timezone. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#timezone LtsSqlAlarmRule#timezone} + */ + readonly timezone?: string; + /** + * Specifies the user name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#user_name LtsSqlAlarmRule#user_name} + */ + readonly userName: string; + /** + * topics block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#topics LtsSqlAlarmRule#topics} + */ + readonly topics: LtsSqlAlarmRuleNotificationRuleTopics[] | cdktf.IResolvable; +} + +export function ltsSqlAlarmRuleNotificationRuleToTerraform(struct?: LtsSqlAlarmRuleNotificationRuleOutputReference | LtsSqlAlarmRuleNotificationRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + language: cdktf.stringToTerraform(struct!.language), + template_name: cdktf.stringToTerraform(struct!.templateName), + timezone: cdktf.stringToTerraform(struct!.timezone), + user_name: cdktf.stringToTerraform(struct!.userName), + topics: cdktf.listMapper(ltsSqlAlarmRuleNotificationRuleTopicsToTerraform, true)(struct!.topics), + } +} + + +export function ltsSqlAlarmRuleNotificationRuleToHclTerraform(struct?: LtsSqlAlarmRuleNotificationRuleOutputReference | LtsSqlAlarmRuleNotificationRule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + language: { + value: cdktf.stringToHclTerraform(struct!.language), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_name: { + value: cdktf.stringToHclTerraform(struct!.templateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timezone: { + value: cdktf.stringToHclTerraform(struct!.timezone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topics: { + value: cdktf.listMapperHcl(ltsSqlAlarmRuleNotificationRuleTopicsToHclTerraform, true)(struct!.topics), + isBlock: true, + type: "list", + storageClassType: "LtsSqlAlarmRuleNotificationRuleTopicsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsSqlAlarmRuleNotificationRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsSqlAlarmRuleNotificationRule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._language !== undefined) { + hasAnyValues = true; + internalValueResult.language = this._language; + } + if (this._templateName !== undefined) { + hasAnyValues = true; + internalValueResult.templateName = this._templateName; + } + if (this._timezone !== undefined) { + hasAnyValues = true; + internalValueResult.timezone = this._timezone; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + if (this._topics?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.topics = this._topics?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsSqlAlarmRuleNotificationRule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._language = undefined; + this._templateName = undefined; + this._timezone = undefined; + this._userName = undefined; + this._topics.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._language = value.language; + this._templateName = value.templateName; + this._timezone = value.timezone; + this._userName = value.userName; + this._topics.internalValue = value.topics; + } + } + + // language - computed: false, optional: false, required: true + private _language?: string; + public get language() { + return this.getStringAttribute('language'); + } + public set language(value: string) { + this._language = value; + } + // Temporarily expose input value. Use with caution. + public get languageInput() { + return this._language; + } + + // template_name - computed: false, optional: false, required: true + private _templateName?: string; + public get templateName() { + return this.getStringAttribute('template_name'); + } + public set templateName(value: string) { + this._templateName = value; + } + // Temporarily expose input value. Use with caution. + public get templateNameInput() { + return this._templateName; + } + + // timezone - computed: true, optional: true, required: false + private _timezone?: string; + public get timezone() { + return this.getStringAttribute('timezone'); + } + public set timezone(value: string) { + this._timezone = value; + } + public resetTimezone() { + this._timezone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timezoneInput() { + return this._timezone; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // topics - computed: false, optional: false, required: true + private _topics = new LtsSqlAlarmRuleNotificationRuleTopicsList(this, "topics", false); + public get topics() { + return this._topics; + } + public putTopics(value: LtsSqlAlarmRuleNotificationRuleTopics[] | cdktf.IResolvable) { + this._topics.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get topicsInput() { + return this._topics.internalValue; + } +} +export interface LtsSqlAlarmRuleSqlRequests { + /** + * Specifies the SQL request is relative to time range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#is_time_range_relative LtsSqlAlarmRule#is_time_range_relative} + */ + readonly isTimeRangeRelative?: boolean | cdktf.IResolvable; + /** + * Specifies the log group id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#log_group_id LtsSqlAlarmRule#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the log stream id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#log_stream_id LtsSqlAlarmRule#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies the search time range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#search_time_range LtsSqlAlarmRule#search_time_range} + */ + readonly searchTimeRange: number; + /** + * Specifies the unit of search time range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#search_time_range_unit LtsSqlAlarmRule#search_time_range_unit} + */ + readonly searchTimeRangeUnit: string; + /** + * Specifies the SQL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#sql LtsSqlAlarmRule#sql} + */ + readonly sql: string; + /** + * Specifies the SQL request title. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#title LtsSqlAlarmRule#title} + */ + readonly title: string; +} + +export function ltsSqlAlarmRuleSqlRequestsToTerraform(struct?: LtsSqlAlarmRuleSqlRequests | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + is_time_range_relative: cdktf.booleanToTerraform(struct!.isTimeRangeRelative), + log_group_id: cdktf.stringToTerraform(struct!.logGroupId), + log_stream_id: cdktf.stringToTerraform(struct!.logStreamId), + search_time_range: cdktf.numberToTerraform(struct!.searchTimeRange), + search_time_range_unit: cdktf.stringToTerraform(struct!.searchTimeRangeUnit), + sql: cdktf.stringToTerraform(struct!.sql), + title: cdktf.stringToTerraform(struct!.title), + } +} + + +export function ltsSqlAlarmRuleSqlRequestsToHclTerraform(struct?: LtsSqlAlarmRuleSqlRequests | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + is_time_range_relative: { + value: cdktf.booleanToHclTerraform(struct!.isTimeRangeRelative), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(struct!.logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + search_time_range: { + value: cdktf.numberToHclTerraform(struct!.searchTimeRange), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + search_time_range_unit: { + value: cdktf.stringToHclTerraform(struct!.searchTimeRangeUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sql: { + value: cdktf.stringToHclTerraform(struct!.sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + title: { + value: cdktf.stringToHclTerraform(struct!.title), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsSqlAlarmRuleSqlRequestsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsSqlAlarmRuleSqlRequests | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._isTimeRangeRelative !== undefined) { + hasAnyValues = true; + internalValueResult.isTimeRangeRelative = this._isTimeRangeRelative; + } + if (this._logGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.logGroupId = this._logGroupId; + } + if (this._logStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamId = this._logStreamId; + } + if (this._searchTimeRange !== undefined) { + hasAnyValues = true; + internalValueResult.searchTimeRange = this._searchTimeRange; + } + if (this._searchTimeRangeUnit !== undefined) { + hasAnyValues = true; + internalValueResult.searchTimeRangeUnit = this._searchTimeRangeUnit; + } + if (this._sql !== undefined) { + hasAnyValues = true; + internalValueResult.sql = this._sql; + } + if (this._title !== undefined) { + hasAnyValues = true; + internalValueResult.title = this._title; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsSqlAlarmRuleSqlRequests | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._isTimeRangeRelative = undefined; + this._logGroupId = undefined; + this._logStreamId = undefined; + this._searchTimeRange = undefined; + this._searchTimeRangeUnit = undefined; + this._sql = undefined; + this._title = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._isTimeRangeRelative = value.isTimeRangeRelative; + this._logGroupId = value.logGroupId; + this._logStreamId = value.logStreamId; + this._searchTimeRange = value.searchTimeRange; + this._searchTimeRangeUnit = value.searchTimeRangeUnit; + this._sql = value.sql; + this._title = value.title; + } + } + + // is_time_range_relative - computed: true, optional: true, required: false + private _isTimeRangeRelative?: boolean | cdktf.IResolvable; + public get isTimeRangeRelative() { + return this.getBooleanAttribute('is_time_range_relative'); + } + public set isTimeRangeRelative(value: boolean | cdktf.IResolvable) { + this._isTimeRangeRelative = value; + } + public resetIsTimeRangeRelative() { + this._isTimeRangeRelative = undefined; + } + // Temporarily expose input value. Use with caution. + public get isTimeRangeRelativeInput() { + return this._isTimeRangeRelative; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // search_time_range - computed: false, optional: false, required: true + private _searchTimeRange?: number; + public get searchTimeRange() { + return this.getNumberAttribute('search_time_range'); + } + public set searchTimeRange(value: number) { + this._searchTimeRange = value; + } + // Temporarily expose input value. Use with caution. + public get searchTimeRangeInput() { + return this._searchTimeRange; + } + + // search_time_range_unit - computed: false, optional: false, required: true + private _searchTimeRangeUnit?: string; + public get searchTimeRangeUnit() { + return this.getStringAttribute('search_time_range_unit'); + } + public set searchTimeRangeUnit(value: string) { + this._searchTimeRangeUnit = value; + } + // Temporarily expose input value. Use with caution. + public get searchTimeRangeUnitInput() { + return this._searchTimeRangeUnit; + } + + // sql - computed: false, optional: false, required: true + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // title - computed: false, optional: false, required: true + private _title?: string; + public get title() { + return this.getStringAttribute('title'); + } + public set title(value: string) { + this._title = value; + } + // Temporarily expose input value. Use with caution. + public get titleInput() { + return this._title; + } +} + +export class LtsSqlAlarmRuleSqlRequestsList extends cdktf.ComplexList { + public internalValue? : LtsSqlAlarmRuleSqlRequests[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsSqlAlarmRuleSqlRequestsOutputReference { + return new LtsSqlAlarmRuleSqlRequestsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule huaweicloud_lts_sql_alarm_rule} +*/ +export class LtsSqlAlarmRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_sql_alarm_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsSqlAlarmRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsSqlAlarmRule to import + * @param importFromId The id of the existing LtsSqlAlarmRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsSqlAlarmRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_sql_alarm_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_sql_alarm_rule huaweicloud_lts_sql_alarm_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsSqlAlarmRuleConfig + */ + public constructor(scope: Construct, id: string, config: LtsSqlAlarmRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_sql_alarm_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._alarmLevel = config.alarmLevel; + this._conditionExpression = config.conditionExpression; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._recoveryFrequency = config.recoveryFrequency; + this._region = config.region; + this._sendNotifications = config.sendNotifications; + this._sendRecoveryNotifications = config.sendRecoveryNotifications; + this._status = config.status; + this._triggerConditionCount = config.triggerConditionCount; + this._triggerConditionFrequency = config.triggerConditionFrequency; + this._frequency.internalValue = config.frequency; + this._notificationRule.internalValue = config.notificationRule; + this._sqlRequests.internalValue = config.sqlRequests; + } + + // ========== + // ATTRIBUTES + // ========== + + // alarm_level - computed: false, optional: false, required: true + private _alarmLevel?: string; + public get alarmLevel() { + return this.getStringAttribute('alarm_level'); + } + public set alarmLevel(value: string) { + this._alarmLevel = value; + } + // Temporarily expose input value. Use with caution. + public get alarmLevelInput() { + return this._alarmLevel; + } + + // condition_expression - computed: false, optional: false, required: true + private _conditionExpression?: string; + public get conditionExpression() { + return this.getStringAttribute('condition_expression'); + } + public set conditionExpression(value: string) { + this._conditionExpression = value; + } + // Temporarily expose input value. Use with caution. + public get conditionExpressionInput() { + return this._conditionExpression; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // recovery_frequency - computed: true, optional: true, required: false + private _recoveryFrequency?: number; + public get recoveryFrequency() { + return this.getNumberAttribute('recovery_frequency'); + } + public set recoveryFrequency(value: number) { + this._recoveryFrequency = value; + } + public resetRecoveryFrequency() { + this._recoveryFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get recoveryFrequencyInput() { + return this._recoveryFrequency; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // send_notifications - computed: true, optional: true, required: false + private _sendNotifications?: boolean | cdktf.IResolvable; + public get sendNotifications() { + return this.getBooleanAttribute('send_notifications'); + } + public set sendNotifications(value: boolean | cdktf.IResolvable) { + this._sendNotifications = value; + } + public resetSendNotifications() { + this._sendNotifications = undefined; + } + // Temporarily expose input value. Use with caution. + public get sendNotificationsInput() { + return this._sendNotifications; + } + + // send_recovery_notifications - computed: true, optional: true, required: false + private _sendRecoveryNotifications?: boolean | cdktf.IResolvable; + public get sendRecoveryNotifications() { + return this.getBooleanAttribute('send_recovery_notifications'); + } + public set sendRecoveryNotifications(value: boolean | cdktf.IResolvable) { + this._sendRecoveryNotifications = value; + } + public resetSendRecoveryNotifications() { + this._sendRecoveryNotifications = undefined; + } + // Temporarily expose input value. Use with caution. + public get sendRecoveryNotificationsInput() { + return this._sendRecoveryNotifications; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // trigger_condition_count - computed: true, optional: true, required: false + private _triggerConditionCount?: number; + public get triggerConditionCount() { + return this.getNumberAttribute('trigger_condition_count'); + } + public set triggerConditionCount(value: number) { + this._triggerConditionCount = value; + } + public resetTriggerConditionCount() { + this._triggerConditionCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionCountInput() { + return this._triggerConditionCount; + } + + // trigger_condition_frequency - computed: true, optional: true, required: false + private _triggerConditionFrequency?: number; + public get triggerConditionFrequency() { + return this.getNumberAttribute('trigger_condition_frequency'); + } + public set triggerConditionFrequency(value: number) { + this._triggerConditionFrequency = value; + } + public resetTriggerConditionFrequency() { + this._triggerConditionFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionFrequencyInput() { + return this._triggerConditionFrequency; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // frequency - computed: false, optional: false, required: true + private _frequency = new LtsSqlAlarmRuleFrequencyOutputReference(this, "frequency"); + public get frequency() { + return this._frequency; + } + public putFrequency(value: LtsSqlAlarmRuleFrequency) { + this._frequency.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency.internalValue; + } + + // notification_rule - computed: false, optional: true, required: false + private _notificationRule = new LtsSqlAlarmRuleNotificationRuleOutputReference(this, "notification_rule"); + public get notificationRule() { + return this._notificationRule; + } + public putNotificationRule(value: LtsSqlAlarmRuleNotificationRule) { + this._notificationRule.internalValue = value; + } + public resetNotificationRule() { + this._notificationRule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get notificationRuleInput() { + return this._notificationRule.internalValue; + } + + // sql_requests - computed: false, optional: false, required: true + private _sqlRequests = new LtsSqlAlarmRuleSqlRequestsList(this, "sql_requests", false); + public get sqlRequests() { + return this._sqlRequests; + } + public putSqlRequests(value: LtsSqlAlarmRuleSqlRequests[] | cdktf.IResolvable) { + this._sqlRequests.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sqlRequestsInput() { + return this._sqlRequests.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + alarm_level: cdktf.stringToTerraform(this._alarmLevel), + condition_expression: cdktf.stringToTerraform(this._conditionExpression), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + recovery_frequency: cdktf.numberToTerraform(this._recoveryFrequency), + region: cdktf.stringToTerraform(this._region), + send_notifications: cdktf.booleanToTerraform(this._sendNotifications), + send_recovery_notifications: cdktf.booleanToTerraform(this._sendRecoveryNotifications), + status: cdktf.stringToTerraform(this._status), + trigger_condition_count: cdktf.numberToTerraform(this._triggerConditionCount), + trigger_condition_frequency: cdktf.numberToTerraform(this._triggerConditionFrequency), + frequency: ltsSqlAlarmRuleFrequencyToTerraform(this._frequency.internalValue), + notification_rule: ltsSqlAlarmRuleNotificationRuleToTerraform(this._notificationRule.internalValue), + sql_requests: cdktf.listMapper(ltsSqlAlarmRuleSqlRequestsToTerraform, true)(this._sqlRequests.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + alarm_level: { + value: cdktf.stringToHclTerraform(this._alarmLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition_expression: { + value: cdktf.stringToHclTerraform(this._conditionExpression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + recovery_frequency: { + value: cdktf.numberToHclTerraform(this._recoveryFrequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + send_notifications: { + value: cdktf.booleanToHclTerraform(this._sendNotifications), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + send_recovery_notifications: { + value: cdktf.booleanToHclTerraform(this._sendRecoveryNotifications), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_condition_count: { + value: cdktf.numberToHclTerraform(this._triggerConditionCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_condition_frequency: { + value: cdktf.numberToHclTerraform(this._triggerConditionFrequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + frequency: { + value: ltsSqlAlarmRuleFrequencyToHclTerraform(this._frequency.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsSqlAlarmRuleFrequencyList", + }, + notification_rule: { + value: ltsSqlAlarmRuleNotificationRuleToHclTerraform(this._notificationRule.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsSqlAlarmRuleNotificationRuleList", + }, + sql_requests: { + value: cdktf.listMapperHcl(ltsSqlAlarmRuleSqlRequestsToHclTerraform, true)(this._sqlRequests.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsSqlAlarmRuleSqlRequestsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-stream/README.md b/src/constructs/providers/huaweicloud/lts-stream/README.md new file mode 100644 index 00000000..b35ed596 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-stream/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_stream` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_stream`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream). diff --git a/src/constructs/providers/huaweicloud/lts-stream/index.ts b/src/constructs/providers/huaweicloud/lts-stream/index.ts new file mode 100644 index 00000000..72b7f162 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-stream/index.ts @@ -0,0 +1,288 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsStreamConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#enterprise_project_id LtsStream#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#group_id LtsStream#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#id LtsStream#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#region LtsStream#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#stream_name LtsStream#stream_name} + */ + readonly streamName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#tags LtsStream#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#ttl_in_days LtsStream#ttl_in_days} + */ + readonly ttlInDays?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream huaweicloud_lts_stream} +*/ +export class LtsStream extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_stream"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsStream resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsStream to import + * @param importFromId The id of the existing LtsStream that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsStream to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_stream", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_stream huaweicloud_lts_stream} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsStreamConfig + */ + public constructor(scope: Construct, id: string, config: LtsStreamConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_stream', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._id = config.id; + this._region = config.region; + this._streamName = config.streamName; + this._tags = config.tags; + this._ttlInDays = config.ttlInDays; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // filter_count - computed: true, optional: false, required: false + public get filterCount() { + return this.getNumberAttribute('filter_count'); + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stream_name - computed: false, optional: false, required: true + private _streamName?: string; + public get streamName() { + return this.getStringAttribute('stream_name'); + } + public set streamName(value: string) { + this._streamName = value; + } + // Temporarily expose input value. Use with caution. + public get streamNameInput() { + return this._streamName; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // ttl_in_days - computed: false, optional: true, required: false + private _ttlInDays?: number; + public get ttlInDays() { + return this.getNumberAttribute('ttl_in_days'); + } + public set ttlInDays(value: number) { + this._ttlInDays = value; + } + public resetTtlInDays() { + this._ttlInDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get ttlInDaysInput() { + return this._ttlInDays; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + stream_name: cdktf.stringToTerraform(this._streamName), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + ttl_in_days: cdktf.numberToTerraform(this._ttlInDays), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stream_name: { + value: cdktf.stringToHclTerraform(this._streamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + ttl_in_days: { + value: cdktf.numberToHclTerraform(this._ttlInDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-struct-template/README.md b/src/constructs/providers/huaweicloud/lts-struct-template/README.md new file mode 100644 index 00000000..6fba48ad --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-struct-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_struct_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_struct_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template). diff --git a/src/constructs/providers/huaweicloud/lts-struct-template/index.ts b/src/constructs/providers/huaweicloud/lts-struct-template/index.ts new file mode 100644 index 00000000..d5ce879a --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-struct-template/index.ts @@ -0,0 +1,892 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsStructTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#content LtsStructTemplate#content} + */ + readonly content?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#id LtsStructTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#log_group_id LtsStructTemplate#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#log_stream_id LtsStructTemplate#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#region LtsStructTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#template_id LtsStructTemplate#template_id} + */ + readonly templateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#template_name LtsStructTemplate#template_name} + */ + readonly templateName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#template_type LtsStructTemplate#template_type} + */ + readonly templateType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#tokenizer LtsStructTemplate#tokenizer} + */ + readonly tokenizer?: string; + /** + * demo_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#demo_fields LtsStructTemplate#demo_fields} + */ + readonly demoFields?: LtsStructTemplateDemoFields[] | cdktf.IResolvable; + /** + * tag_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#tag_fields LtsStructTemplate#tag_fields} + */ + readonly tagFields?: LtsStructTemplateTagFields[] | cdktf.IResolvable; +} +export interface LtsStructTemplateDemoFields { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#content LtsStructTemplate#content} + */ + readonly content?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#field_name LtsStructTemplate#field_name} + */ + readonly fieldName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#index LtsStructTemplate#index} + */ + readonly index?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#is_analysis LtsStructTemplate#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#type LtsStructTemplate#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#user_defined_name LtsStructTemplate#user_defined_name} + */ + readonly userDefinedName?: string; +} + +export function ltsStructTemplateDemoFieldsToTerraform(struct?: LtsStructTemplateDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field_name: cdktf.stringToTerraform(struct!.fieldName), + index: cdktf.numberToTerraform(struct!.index), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + type: cdktf.stringToTerraform(struct!.type), + user_defined_name: cdktf.stringToTerraform(struct!.userDefinedName), + } +} + + +export function ltsStructTemplateDemoFieldsToHclTerraform(struct?: LtsStructTemplateDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + index: { + value: cdktf.numberToHclTerraform(struct!.index), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_defined_name: { + value: cdktf.stringToHclTerraform(struct!.userDefinedName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructTemplateDemoFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructTemplateDemoFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._index !== undefined) { + hasAnyValues = true; + internalValueResult.index = this._index; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._userDefinedName !== undefined) { + hasAnyValues = true; + internalValueResult.userDefinedName = this._userDefinedName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructTemplateDemoFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._fieldName = undefined; + this._index = undefined; + this._isAnalysis = undefined; + this._type = undefined; + this._userDefinedName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._fieldName = value.fieldName; + this._index = value.index; + this._isAnalysis = value.isAnalysis; + this._type = value.type; + this._userDefinedName = value.userDefinedName; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field_name - computed: false, optional: true, required: false + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + public resetFieldName() { + this._fieldName = undefined; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // index - computed: false, optional: true, required: false + private _index?: number; + public get index() { + return this.getNumberAttribute('index'); + } + public set index(value: number) { + this._index = value; + } + public resetIndex() { + this._index = undefined; + } + // Temporarily expose input value. Use with caution. + public get indexInput() { + return this._index; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_defined_name - computed: false, optional: true, required: false + private _userDefinedName?: string; + public get userDefinedName() { + return this.getStringAttribute('user_defined_name'); + } + public set userDefinedName(value: string) { + this._userDefinedName = value; + } + public resetUserDefinedName() { + this._userDefinedName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDefinedNameInput() { + return this._userDefinedName; + } +} + +export class LtsStructTemplateDemoFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructTemplateDemoFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructTemplateDemoFieldsOutputReference { + return new LtsStructTemplateDemoFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsStructTemplateTagFields { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#content LtsStructTemplate#content} + */ + readonly content?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#field_name LtsStructTemplate#field_name} + */ + readonly fieldName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#is_analysis LtsStructTemplate#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#type LtsStructTemplate#type} + */ + readonly type?: string; +} + +export function ltsStructTemplateTagFieldsToTerraform(struct?: LtsStructTemplateTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ltsStructTemplateTagFieldsToHclTerraform(struct?: LtsStructTemplateTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructTemplateTagFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructTemplateTagFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructTemplateTagFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + this._type = value.type; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field_name - computed: false, optional: true, required: false + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + public resetFieldName() { + this._fieldName = undefined; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class LtsStructTemplateTagFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructTemplateTagFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructTemplateTagFieldsOutputReference { + return new LtsStructTemplateTagFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template huaweicloud_lts_struct_template} +*/ +export class LtsStructTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_struct_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsStructTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsStructTemplate to import + * @param importFromId The id of the existing LtsStructTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsStructTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_struct_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_struct_template huaweicloud_lts_struct_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsStructTemplateConfig + */ + public constructor(scope: Construct, id: string, config: LtsStructTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_struct_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._region = config.region; + this._templateId = config.templateId; + this._templateName = config.templateName; + this._templateType = config.templateType; + this._tokenizer = config.tokenizer; + this._demoFields.internalValue = config.demoFields; + this._tagFields.internalValue = config.tagFields; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // demo_log - computed: true, optional: false, required: false + public get demoLog() { + return this.getStringAttribute('demo_log'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // template_name - computed: false, optional: true, required: false + private _templateName?: string; + public get templateName() { + return this.getStringAttribute('template_name'); + } + public set templateName(value: string) { + this._templateName = value; + } + public resetTemplateName() { + this._templateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateNameInput() { + return this._templateName; + } + + // template_type - computed: false, optional: false, required: true + private _templateType?: string; + public get templateType() { + return this.getStringAttribute('template_type'); + } + public set templateType(value: string) { + this._templateType = value; + } + // Temporarily expose input value. Use with caution. + public get templateTypeInput() { + return this._templateType; + } + + // tokenizer - computed: false, optional: true, required: false + private _tokenizer?: string; + public get tokenizer() { + return this.getStringAttribute('tokenizer'); + } + public set tokenizer(value: string) { + this._tokenizer = value; + } + public resetTokenizer() { + this._tokenizer = undefined; + } + // Temporarily expose input value. Use with caution. + public get tokenizerInput() { + return this._tokenizer; + } + + // demo_fields - computed: false, optional: true, required: false + private _demoFields = new LtsStructTemplateDemoFieldsList(this, "demo_fields", false); + public get demoFields() { + return this._demoFields; + } + public putDemoFields(value: LtsStructTemplateDemoFields[] | cdktf.IResolvable) { + this._demoFields.internalValue = value; + } + public resetDemoFields() { + this._demoFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get demoFieldsInput() { + return this._demoFields.internalValue; + } + + // tag_fields - computed: false, optional: true, required: false + private _tagFields = new LtsStructTemplateTagFieldsList(this, "tag_fields", false); + public get tagFields() { + return this._tagFields; + } + public putTagFields(value: LtsStructTemplateTagFields[] | cdktf.IResolvable) { + this._tagFields.internalValue = value; + } + public resetTagFields() { + this._tagFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagFieldsInput() { + return this._tagFields.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + template_name: cdktf.stringToTerraform(this._templateName), + template_type: cdktf.stringToTerraform(this._templateType), + tokenizer: cdktf.stringToTerraform(this._tokenizer), + demo_fields: cdktf.listMapper(ltsStructTemplateDemoFieldsToTerraform, true)(this._demoFields.internalValue), + tag_fields: cdktf.listMapper(ltsStructTemplateTagFieldsToTerraform, true)(this._tagFields.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_name: { + value: cdktf.stringToHclTerraform(this._templateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_type: { + value: cdktf.stringToHclTerraform(this._templateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tokenizer: { + value: cdktf.stringToHclTerraform(this._tokenizer), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + demo_fields: { + value: cdktf.listMapperHcl(ltsStructTemplateDemoFieldsToHclTerraform, true)(this._demoFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructTemplateDemoFieldsList", + }, + tag_fields: { + value: cdktf.listMapperHcl(ltsStructTemplateTagFieldsToHclTerraform, true)(this._tagFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructTemplateTagFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-structing-template/README.md b/src/constructs/providers/huaweicloud/lts-structing-template/README.md new file mode 100644 index 00000000..7ebb039d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-structing-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_structing_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_structing_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template). diff --git a/src/constructs/providers/huaweicloud/lts-structing-template/index.ts b/src/constructs/providers/huaweicloud/lts-structing-template/index.ts new file mode 100644 index 00000000..f329b164 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-structing-template/index.ts @@ -0,0 +1,677 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsStructingTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#id LtsStructingTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#log_group_id LtsStructingTemplate#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#log_stream_id LtsStructingTemplate#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies whether to enable demo_fields and tag_fields quick analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#quick_analysis LtsStructingTemplate#quick_analysis} + */ + readonly quickAnalysis?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#region LtsStructingTemplate#region} + */ + readonly region?: string; + /** + * Specifies the template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#template_id LtsStructingTemplate#template_id} + */ + readonly templateId?: string; + /** + * Specifies the template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#template_name LtsStructingTemplate#template_name} + */ + readonly templateName: string; + /** + * Specifies the type of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#template_type LtsStructingTemplate#template_type} + */ + readonly templateType: string; + /** + * demo_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#demo_fields LtsStructingTemplate#demo_fields} + */ + readonly demoFields?: LtsStructingTemplateDemoFields[] | cdktf.IResolvable; + /** + * tag_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#tag_fields LtsStructingTemplate#tag_fields} + */ + readonly tagFields?: LtsStructingTemplateTagFields[] | cdktf.IResolvable; +} +export interface LtsStructingTemplateDemoFields { + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#field_name LtsStructingTemplate#field_name} + */ + readonly fieldName: string; + /** + * Specifies whether quick analysis is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#is_analysis LtsStructingTemplate#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; +} + +export function ltsStructingTemplateDemoFieldsToTerraform(struct?: LtsStructingTemplateDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + } +} + + +export function ltsStructingTemplateDemoFieldsToHclTerraform(struct?: LtsStructingTemplateDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructingTemplateDemoFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructingTemplateDemoFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructingTemplateDemoFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + } + } + + // field_name - computed: false, optional: false, required: true + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } +} + +export class LtsStructingTemplateDemoFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructingTemplateDemoFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructingTemplateDemoFieldsOutputReference { + return new LtsStructingTemplateDemoFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsStructingTemplateTagFields { + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#field_name LtsStructingTemplate#field_name} + */ + readonly fieldName: string; + /** + * Specifies whether quick analysis is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#is_analysis LtsStructingTemplate#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; +} + +export function ltsStructingTemplateTagFieldsToTerraform(struct?: LtsStructingTemplateTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + } +} + + +export function ltsStructingTemplateTagFieldsToHclTerraform(struct?: LtsStructingTemplateTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructingTemplateTagFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructingTemplateTagFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructingTemplateTagFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + } + } + + // field_name - computed: false, optional: false, required: true + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } +} + +export class LtsStructingTemplateTagFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructingTemplateTagFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructingTemplateTagFieldsOutputReference { + return new LtsStructingTemplateTagFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template huaweicloud_lts_structing_template} +*/ +export class LtsStructingTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_structing_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsStructingTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsStructingTemplate to import + * @param importFromId The id of the existing LtsStructingTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsStructingTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_structing_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structing_template huaweicloud_lts_structing_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsStructingTemplateConfig + */ + public constructor(scope: Construct, id: string, config: LtsStructingTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_structing_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._quickAnalysis = config.quickAnalysis; + this._region = config.region; + this._templateId = config.templateId; + this._templateName = config.templateName; + this._templateType = config.templateType; + this._demoFields.internalValue = config.demoFields; + this._tagFields.internalValue = config.tagFields; + } + + // ========== + // ATTRIBUTES + // ========== + + // demo_log - computed: true, optional: false, required: false + public get demoLog() { + return this.getStringAttribute('demo_log'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // quick_analysis - computed: false, optional: true, required: false + private _quickAnalysis?: boolean | cdktf.IResolvable; + public get quickAnalysis() { + return this.getBooleanAttribute('quick_analysis'); + } + public set quickAnalysis(value: boolean | cdktf.IResolvable) { + this._quickAnalysis = value; + } + public resetQuickAnalysis() { + this._quickAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get quickAnalysisInput() { + return this._quickAnalysis; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // template_name - computed: false, optional: false, required: true + private _templateName?: string; + public get templateName() { + return this.getStringAttribute('template_name'); + } + public set templateName(value: string) { + this._templateName = value; + } + // Temporarily expose input value. Use with caution. + public get templateNameInput() { + return this._templateName; + } + + // template_type - computed: false, optional: false, required: true + private _templateType?: string; + public get templateType() { + return this.getStringAttribute('template_type'); + } + public set templateType(value: string) { + this._templateType = value; + } + // Temporarily expose input value. Use with caution. + public get templateTypeInput() { + return this._templateType; + } + + // demo_fields - computed: false, optional: true, required: false + private _demoFields = new LtsStructingTemplateDemoFieldsList(this, "demo_fields", false); + public get demoFields() { + return this._demoFields; + } + public putDemoFields(value: LtsStructingTemplateDemoFields[] | cdktf.IResolvable) { + this._demoFields.internalValue = value; + } + public resetDemoFields() { + this._demoFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get demoFieldsInput() { + return this._demoFields.internalValue; + } + + // tag_fields - computed: false, optional: true, required: false + private _tagFields = new LtsStructingTemplateTagFieldsList(this, "tag_fields", false); + public get tagFields() { + return this._tagFields; + } + public putTagFields(value: LtsStructingTemplateTagFields[] | cdktf.IResolvable) { + this._tagFields.internalValue = value; + } + public resetTagFields() { + this._tagFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagFieldsInput() { + return this._tagFields.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + quick_analysis: cdktf.booleanToTerraform(this._quickAnalysis), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + template_name: cdktf.stringToTerraform(this._templateName), + template_type: cdktf.stringToTerraform(this._templateType), + demo_fields: cdktf.listMapper(ltsStructingTemplateDemoFieldsToTerraform, true)(this._demoFields.internalValue), + tag_fields: cdktf.listMapper(ltsStructingTemplateTagFieldsToTerraform, true)(this._tagFields.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quick_analysis: { + value: cdktf.booleanToHclTerraform(this._quickAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_name: { + value: cdktf.stringToHclTerraform(this._templateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_type: { + value: cdktf.stringToHclTerraform(this._templateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + demo_fields: { + value: cdktf.listMapperHcl(ltsStructingTemplateDemoFieldsToHclTerraform, true)(this._demoFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructingTemplateDemoFieldsList", + }, + tag_fields: { + value: cdktf.listMapperHcl(ltsStructingTemplateTagFieldsToHclTerraform, true)(this._tagFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructingTemplateTagFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-structuring-configuration/README.md b/src/constructs/providers/huaweicloud/lts-structuring-configuration/README.md new file mode 100644 index 00000000..73d5d5b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-structuring-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_structuring_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_structuring_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration). diff --git a/src/constructs/providers/huaweicloud/lts-structuring-configuration/index.ts b/src/constructs/providers/huaweicloud/lts-structuring-configuration/index.ts new file mode 100644 index 00000000..788a9796 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-structuring-configuration/index.ts @@ -0,0 +1,677 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsStructuringConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#id LtsStructuringConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#log_group_id LtsStructuringConfiguration#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#log_stream_id LtsStructuringConfiguration#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies whether to enable demo_fields and tag_fields quick analysis. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#quick_analysis LtsStructuringConfiguration#quick_analysis} + */ + readonly quickAnalysis?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#region LtsStructuringConfiguration#region} + */ + readonly region?: string; + /** + * Specifies the template ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#template_id LtsStructuringConfiguration#template_id} + */ + readonly templateId?: string; + /** + * Specifies the template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#template_name LtsStructuringConfiguration#template_name} + */ + readonly templateName: string; + /** + * Specifies the type of the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#template_type LtsStructuringConfiguration#template_type} + */ + readonly templateType: string; + /** + * demo_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#demo_fields LtsStructuringConfiguration#demo_fields} + */ + readonly demoFields?: LtsStructuringConfigurationDemoFields[] | cdktf.IResolvable; + /** + * tag_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#tag_fields LtsStructuringConfiguration#tag_fields} + */ + readonly tagFields?: LtsStructuringConfigurationTagFields[] | cdktf.IResolvable; +} +export interface LtsStructuringConfigurationDemoFields { + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#field_name LtsStructuringConfiguration#field_name} + */ + readonly fieldName: string; + /** + * Specifies whether quick analysis is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#is_analysis LtsStructuringConfiguration#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; +} + +export function ltsStructuringConfigurationDemoFieldsToTerraform(struct?: LtsStructuringConfigurationDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + } +} + + +export function ltsStructuringConfigurationDemoFieldsToHclTerraform(struct?: LtsStructuringConfigurationDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructuringConfigurationDemoFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructuringConfigurationDemoFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructuringConfigurationDemoFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + } + } + + // field_name - computed: false, optional: false, required: true + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } +} + +export class LtsStructuringConfigurationDemoFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructuringConfigurationDemoFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructuringConfigurationDemoFieldsOutputReference { + return new LtsStructuringConfigurationDemoFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsStructuringConfigurationTagFields { + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#field_name LtsStructuringConfiguration#field_name} + */ + readonly fieldName: string; + /** + * Specifies whether quick analysis is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#is_analysis LtsStructuringConfiguration#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; +} + +export function ltsStructuringConfigurationTagFieldsToTerraform(struct?: LtsStructuringConfigurationTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + } +} + + +export function ltsStructuringConfigurationTagFieldsToHclTerraform(struct?: LtsStructuringConfigurationTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructuringConfigurationTagFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructuringConfigurationTagFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructuringConfigurationTagFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + } + } + + // field_name - computed: false, optional: false, required: true + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } +} + +export class LtsStructuringConfigurationTagFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructuringConfigurationTagFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructuringConfigurationTagFieldsOutputReference { + return new LtsStructuringConfigurationTagFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration huaweicloud_lts_structuring_configuration} +*/ +export class LtsStructuringConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_structuring_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsStructuringConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsStructuringConfiguration to import + * @param importFromId The id of the existing LtsStructuringConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsStructuringConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_structuring_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_configuration huaweicloud_lts_structuring_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsStructuringConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: LtsStructuringConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_structuring_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._quickAnalysis = config.quickAnalysis; + this._region = config.region; + this._templateId = config.templateId; + this._templateName = config.templateName; + this._templateType = config.templateType; + this._demoFields.internalValue = config.demoFields; + this._tagFields.internalValue = config.tagFields; + } + + // ========== + // ATTRIBUTES + // ========== + + // demo_log - computed: true, optional: false, required: false + public get demoLog() { + return this.getStringAttribute('demo_log'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // quick_analysis - computed: false, optional: true, required: false + private _quickAnalysis?: boolean | cdktf.IResolvable; + public get quickAnalysis() { + return this.getBooleanAttribute('quick_analysis'); + } + public set quickAnalysis(value: boolean | cdktf.IResolvable) { + this._quickAnalysis = value; + } + public resetQuickAnalysis() { + this._quickAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get quickAnalysisInput() { + return this._quickAnalysis; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // template_name - computed: false, optional: false, required: true + private _templateName?: string; + public get templateName() { + return this.getStringAttribute('template_name'); + } + public set templateName(value: string) { + this._templateName = value; + } + // Temporarily expose input value. Use with caution. + public get templateNameInput() { + return this._templateName; + } + + // template_type - computed: false, optional: false, required: true + private _templateType?: string; + public get templateType() { + return this.getStringAttribute('template_type'); + } + public set templateType(value: string) { + this._templateType = value; + } + // Temporarily expose input value. Use with caution. + public get templateTypeInput() { + return this._templateType; + } + + // demo_fields - computed: false, optional: true, required: false + private _demoFields = new LtsStructuringConfigurationDemoFieldsList(this, "demo_fields", false); + public get demoFields() { + return this._demoFields; + } + public putDemoFields(value: LtsStructuringConfigurationDemoFields[] | cdktf.IResolvable) { + this._demoFields.internalValue = value; + } + public resetDemoFields() { + this._demoFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get demoFieldsInput() { + return this._demoFields.internalValue; + } + + // tag_fields - computed: false, optional: true, required: false + private _tagFields = new LtsStructuringConfigurationTagFieldsList(this, "tag_fields", false); + public get tagFields() { + return this._tagFields; + } + public putTagFields(value: LtsStructuringConfigurationTagFields[] | cdktf.IResolvable) { + this._tagFields.internalValue = value; + } + public resetTagFields() { + this._tagFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagFieldsInput() { + return this._tagFields.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + quick_analysis: cdktf.booleanToTerraform(this._quickAnalysis), + region: cdktf.stringToTerraform(this._region), + template_id: cdktf.stringToTerraform(this._templateId), + template_name: cdktf.stringToTerraform(this._templateName), + template_type: cdktf.stringToTerraform(this._templateType), + demo_fields: cdktf.listMapper(ltsStructuringConfigurationDemoFieldsToTerraform, true)(this._demoFields.internalValue), + tag_fields: cdktf.listMapper(ltsStructuringConfigurationTagFieldsToTerraform, true)(this._tagFields.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quick_analysis: { + value: cdktf.booleanToHclTerraform(this._quickAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_name: { + value: cdktf.stringToHclTerraform(this._templateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_type: { + value: cdktf.stringToHclTerraform(this._templateType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + demo_fields: { + value: cdktf.listMapperHcl(ltsStructuringConfigurationDemoFieldsToHclTerraform, true)(this._demoFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructuringConfigurationDemoFieldsList", + }, + tag_fields: { + value: cdktf.listMapperHcl(ltsStructuringConfigurationTagFieldsToHclTerraform, true)(this._tagFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructuringConfigurationTagFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/README.md b/src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/README.md new file mode 100644 index 00000000..c6bde358 --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_structuring_custom_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_structuring_custom_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration). diff --git a/src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/index.ts b/src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/index.ts new file mode 100644 index 00000000..f5113dbd --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-structuring-custom-configuration/index.ts @@ -0,0 +1,842 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsStructuringCustomConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies a sample log event. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#content LtsStructuringCustomConfiguration#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#id LtsStructuringCustomConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the maximum parsing layers. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#layers LtsStructuringCustomConfiguration#layers} + */ + readonly layers?: number; + /** + * Specifies the nginx configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#log_format LtsStructuringCustomConfiguration#log_format} + */ + readonly logFormat?: string; + /** + * Specifies the log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#log_group_id LtsStructuringCustomConfiguration#log_group_id} + */ + readonly logGroupId: string; + /** + * Specifies the log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#log_stream_id LtsStructuringCustomConfiguration#log_stream_id} + */ + readonly logStreamId: string; + /** + * Specifies the regular expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#regex_rules LtsStructuringCustomConfiguration#regex_rules} + */ + readonly regexRules?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#region LtsStructuringCustomConfiguration#region} + */ + readonly region?: string; + /** + * Specifies the delimiter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#tokenizer LtsStructuringCustomConfiguration#tokenizer} + */ + readonly tokenizer?: string; + /** + * demo_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#demo_fields LtsStructuringCustomConfiguration#demo_fields} + */ + readonly demoFields: LtsStructuringCustomConfigurationDemoFields[] | cdktf.IResolvable; + /** + * tag_fields block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#tag_fields LtsStructuringCustomConfiguration#tag_fields} + */ + readonly tagFields?: LtsStructuringCustomConfigurationTagFields[] | cdktf.IResolvable; +} +export interface LtsStructuringCustomConfigurationDemoFields { + /** + * Specifies the content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#content LtsStructuringCustomConfiguration#content} + */ + readonly content?: string; + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#field_name LtsStructuringCustomConfiguration#field_name} + */ + readonly fieldName?: string; + /** + * Specifies whether quick analysis is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#is_analysis LtsStructuringCustomConfiguration#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; + /** + * Specifies the field data type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#type LtsStructuringCustomConfiguration#type} + */ + readonly type?: string; +} + +export function ltsStructuringCustomConfigurationDemoFieldsToTerraform(struct?: LtsStructuringCustomConfigurationDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ltsStructuringCustomConfigurationDemoFieldsToHclTerraform(struct?: LtsStructuringCustomConfigurationDemoFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructuringCustomConfigurationDemoFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructuringCustomConfigurationDemoFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructuringCustomConfigurationDemoFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + this._type = value.type; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field_name - computed: false, optional: true, required: false + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + public resetFieldName() { + this._fieldName = undefined; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class LtsStructuringCustomConfigurationDemoFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructuringCustomConfigurationDemoFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructuringCustomConfigurationDemoFieldsOutputReference { + return new LtsStructuringCustomConfigurationDemoFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsStructuringCustomConfigurationTagFields { + /** + * Specifies the field content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#content LtsStructuringCustomConfiguration#content} + */ + readonly content?: string; + /** + * Specifies the field name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#field_name LtsStructuringCustomConfiguration#field_name} + */ + readonly fieldName: string; + /** + * Specifies whether quick analysis is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#is_analysis LtsStructuringCustomConfiguration#is_analysis} + */ + readonly isAnalysis?: boolean | cdktf.IResolvable; + /** + * Specifies the field data type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#type LtsStructuringCustomConfiguration#type} + */ + readonly type: string; +} + +export function ltsStructuringCustomConfigurationTagFieldsToTerraform(struct?: LtsStructuringCustomConfigurationTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field_name: cdktf.stringToTerraform(struct!.fieldName), + is_analysis: cdktf.booleanToTerraform(struct!.isAnalysis), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function ltsStructuringCustomConfigurationTagFieldsToHclTerraform(struct?: LtsStructuringCustomConfigurationTagFields | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field_name: { + value: cdktf.stringToHclTerraform(struct!.fieldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_analysis: { + value: cdktf.booleanToHclTerraform(struct!.isAnalysis), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsStructuringCustomConfigurationTagFieldsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsStructuringCustomConfigurationTagFields | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._fieldName !== undefined) { + hasAnyValues = true; + internalValueResult.fieldName = this._fieldName; + } + if (this._isAnalysis !== undefined) { + hasAnyValues = true; + internalValueResult.isAnalysis = this._isAnalysis; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsStructuringCustomConfigurationTagFields | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._fieldName = undefined; + this._isAnalysis = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._fieldName = value.fieldName; + this._isAnalysis = value.isAnalysis; + this._type = value.type; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field_name - computed: false, optional: false, required: true + private _fieldName?: string; + public get fieldName() { + return this.getStringAttribute('field_name'); + } + public set fieldName(value: string) { + this._fieldName = value; + } + // Temporarily expose input value. Use with caution. + public get fieldNameInput() { + return this._fieldName; + } + + // is_analysis - computed: false, optional: true, required: false + private _isAnalysis?: boolean | cdktf.IResolvable; + public get isAnalysis() { + return this.getBooleanAttribute('is_analysis'); + } + public set isAnalysis(value: boolean | cdktf.IResolvable) { + this._isAnalysis = value; + } + public resetIsAnalysis() { + this._isAnalysis = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAnalysisInput() { + return this._isAnalysis; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class LtsStructuringCustomConfigurationTagFieldsList extends cdktf.ComplexList { + public internalValue? : LtsStructuringCustomConfigurationTagFields[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsStructuringCustomConfigurationTagFieldsOutputReference { + return new LtsStructuringCustomConfigurationTagFieldsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration huaweicloud_lts_structuring_custom_configuration} +*/ +export class LtsStructuringCustomConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_structuring_custom_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsStructuringCustomConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsStructuringCustomConfiguration to import + * @param importFromId The id of the existing LtsStructuringCustomConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsStructuringCustomConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_structuring_custom_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_structuring_custom_configuration huaweicloud_lts_structuring_custom_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsStructuringCustomConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: LtsStructuringCustomConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_structuring_custom_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._layers = config.layers; + this._logFormat = config.logFormat; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._regexRules = config.regexRules; + this._region = config.region; + this._tokenizer = config.tokenizer; + this._demoFields.internalValue = config.demoFields; + this._tagFields.internalValue = config.tagFields; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // layers - computed: false, optional: true, required: false + private _layers?: number; + public get layers() { + return this.getNumberAttribute('layers'); + } + public set layers(value: number) { + this._layers = value; + } + public resetLayers() { + this._layers = undefined; + } + // Temporarily expose input value. Use with caution. + public get layersInput() { + return this._layers; + } + + // log_format - computed: false, optional: true, required: false + private _logFormat?: string; + public get logFormat() { + return this.getStringAttribute('log_format'); + } + public set logFormat(value: string) { + this._logFormat = value; + } + public resetLogFormat() { + this._logFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get logFormatInput() { + return this._logFormat; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // regex_rules - computed: false, optional: true, required: false + private _regexRules?: string; + public get regexRules() { + return this.getStringAttribute('regex_rules'); + } + public set regexRules(value: string) { + this._regexRules = value; + } + public resetRegexRules() { + this._regexRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get regexRulesInput() { + return this._regexRules; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tokenizer - computed: false, optional: true, required: false + private _tokenizer?: string; + public get tokenizer() { + return this.getStringAttribute('tokenizer'); + } + public set tokenizer(value: string) { + this._tokenizer = value; + } + public resetTokenizer() { + this._tokenizer = undefined; + } + // Temporarily expose input value. Use with caution. + public get tokenizerInput() { + return this._tokenizer; + } + + // demo_fields - computed: false, optional: false, required: true + private _demoFields = new LtsStructuringCustomConfigurationDemoFieldsList(this, "demo_fields", false); + public get demoFields() { + return this._demoFields; + } + public putDemoFields(value: LtsStructuringCustomConfigurationDemoFields[] | cdktf.IResolvable) { + this._demoFields.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get demoFieldsInput() { + return this._demoFields.internalValue; + } + + // tag_fields - computed: false, optional: true, required: false + private _tagFields = new LtsStructuringCustomConfigurationTagFieldsList(this, "tag_fields", false); + public get tagFields() { + return this._tagFields; + } + public putTagFields(value: LtsStructuringCustomConfigurationTagFields[] | cdktf.IResolvable) { + this._tagFields.internalValue = value; + } + public resetTagFields() { + this._tagFields.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagFieldsInput() { + return this._tagFields.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + layers: cdktf.numberToTerraform(this._layers), + log_format: cdktf.stringToTerraform(this._logFormat), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + regex_rules: cdktf.stringToTerraform(this._regexRules), + region: cdktf.stringToTerraform(this._region), + tokenizer: cdktf.stringToTerraform(this._tokenizer), + demo_fields: cdktf.listMapper(ltsStructuringCustomConfigurationDemoFieldsToTerraform, true)(this._demoFields.internalValue), + tag_fields: cdktf.listMapper(ltsStructuringCustomConfigurationTagFieldsToTerraform, true)(this._tagFields.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + layers: { + value: cdktf.numberToHclTerraform(this._layers), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + log_format: { + value: cdktf.stringToHclTerraform(this._logFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + regex_rules: { + value: cdktf.stringToHclTerraform(this._regexRules), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tokenizer: { + value: cdktf.stringToHclTerraform(this._tokenizer), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + demo_fields: { + value: cdktf.listMapperHcl(ltsStructuringCustomConfigurationDemoFieldsToHclTerraform, true)(this._demoFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructuringCustomConfigurationDemoFieldsList", + }, + tag_fields: { + value: cdktf.listMapperHcl(ltsStructuringCustomConfigurationTagFieldsToHclTerraform, true)(this._tagFields.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsStructuringCustomConfigurationTagFieldsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-transfer/README.md b/src/constructs/providers/huaweicloud/lts-transfer/README.md new file mode 100644 index 00000000..4fac79de --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-transfer/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_transfer` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_transfer`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer). diff --git a/src/constructs/providers/huaweicloud/lts-transfer/index.ts b/src/constructs/providers/huaweicloud/lts-transfer/index.ts new file mode 100644 index 00000000..2ab2b6dd --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-transfer/index.ts @@ -0,0 +1,1416 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsTransferConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#id LtsTransfer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_group_id LtsTransfer#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#region LtsTransfer#region} + */ + readonly region?: string; + /** + * log_streams block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_streams LtsTransfer#log_streams} + */ + readonly logStreams: LtsTransferLogStreams[] | cdktf.IResolvable; + /** + * log_transfer_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_transfer_info LtsTransfer#log_transfer_info} + */ + readonly logTransferInfo: LtsTransferLogTransferInfo; +} +export interface LtsTransferLogStreams { + /** + * Log stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_stream_id LtsTransfer#log_stream_id} + */ + readonly logStreamId: string; + /** + * Log stream name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_stream_name LtsTransfer#log_stream_name} + */ + readonly logStreamName?: string; +} + +export function ltsTransferLogStreamsToTerraform(struct?: LtsTransferLogStreams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + log_stream_id: cdktf.stringToTerraform(struct!.logStreamId), + log_stream_name: cdktf.stringToTerraform(struct!.logStreamName), + } +} + + +export function ltsTransferLogStreamsToHclTerraform(struct?: LtsTransferLogStreams | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + log_stream_id: { + value: cdktf.stringToHclTerraform(struct!.logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_name: { + value: cdktf.stringToHclTerraform(struct!.logStreamName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsTransferLogStreamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): LtsTransferLogStreams | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logStreamId !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamId = this._logStreamId; + } + if (this._logStreamName !== undefined) { + hasAnyValues = true; + internalValueResult.logStreamName = this._logStreamName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsTransferLogStreams | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._logStreamId = undefined; + this._logStreamName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._logStreamId = value.logStreamId; + this._logStreamName = value.logStreamName; + } + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // log_stream_name - computed: true, optional: true, required: false + private _logStreamName?: string; + public get logStreamName() { + return this.getStringAttribute('log_stream_name'); + } + public set logStreamName(value: string) { + this._logStreamName = value; + } + public resetLogStreamName() { + this._logStreamName = undefined; + } + // Temporarily expose input value. Use with caution. + public get logStreamNameInput() { + return this._logStreamName; + } +} + +export class LtsTransferLogStreamsList extends cdktf.ComplexList { + public internalValue? : LtsTransferLogStreams[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): LtsTransferLogStreamsOutputReference { + return new LtsTransferLogStreamsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface LtsTransferLogTransferInfoLogAgencyTransfer { + /** + * Delegator account ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#agency_domain_id LtsTransfer#agency_domain_id} + */ + readonly agencyDomainId: string; + /** + * Delegator account name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#agency_domain_name LtsTransfer#agency_domain_name} + */ + readonly agencyDomainName: string; + /** + * The agency name created by the delegator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#agency_name LtsTransfer#agency_name} + */ + readonly agencyName: string; + /** + * Project ID of the delegator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#agency_project_id LtsTransfer#agency_project_id} + */ + readonly agencyProjectId: string; +} + +export function ltsTransferLogTransferInfoLogAgencyTransferToTerraform(struct?: LtsTransferLogTransferInfoLogAgencyTransferOutputReference | LtsTransferLogTransferInfoLogAgencyTransfer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency_domain_id: cdktf.stringToTerraform(struct!.agencyDomainId), + agency_domain_name: cdktf.stringToTerraform(struct!.agencyDomainName), + agency_name: cdktf.stringToTerraform(struct!.agencyName), + agency_project_id: cdktf.stringToTerraform(struct!.agencyProjectId), + } +} + + +export function ltsTransferLogTransferInfoLogAgencyTransferToHclTerraform(struct?: LtsTransferLogTransferInfoLogAgencyTransferOutputReference | LtsTransferLogTransferInfoLogAgencyTransfer): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency_domain_id: { + value: cdktf.stringToHclTerraform(struct!.agencyDomainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_domain_name: { + value: cdktf.stringToHclTerraform(struct!.agencyDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_name: { + value: cdktf.stringToHclTerraform(struct!.agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_project_id: { + value: cdktf.stringToHclTerraform(struct!.agencyProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsTransferLogTransferInfoLogAgencyTransferOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsTransferLogTransferInfoLogAgencyTransfer | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agencyDomainId !== undefined) { + hasAnyValues = true; + internalValueResult.agencyDomainId = this._agencyDomainId; + } + if (this._agencyDomainName !== undefined) { + hasAnyValues = true; + internalValueResult.agencyDomainName = this._agencyDomainName; + } + if (this._agencyName !== undefined) { + hasAnyValues = true; + internalValueResult.agencyName = this._agencyName; + } + if (this._agencyProjectId !== undefined) { + hasAnyValues = true; + internalValueResult.agencyProjectId = this._agencyProjectId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsTransferLogTransferInfoLogAgencyTransfer | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._agencyDomainId = undefined; + this._agencyDomainName = undefined; + this._agencyName = undefined; + this._agencyProjectId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._agencyDomainId = value.agencyDomainId; + this._agencyDomainName = value.agencyDomainName; + this._agencyName = value.agencyName; + this._agencyProjectId = value.agencyProjectId; + } + } + + // agency_domain_id - computed: false, optional: false, required: true + private _agencyDomainId?: string; + public get agencyDomainId() { + return this.getStringAttribute('agency_domain_id'); + } + public set agencyDomainId(value: string) { + this._agencyDomainId = value; + } + // Temporarily expose input value. Use with caution. + public get agencyDomainIdInput() { + return this._agencyDomainId; + } + + // agency_domain_name - computed: false, optional: false, required: true + private _agencyDomainName?: string; + public get agencyDomainName() { + return this.getStringAttribute('agency_domain_name'); + } + public set agencyDomainName(value: string) { + this._agencyDomainName = value; + } + // Temporarily expose input value. Use with caution. + public get agencyDomainNameInput() { + return this._agencyDomainName; + } + + // agency_name - computed: false, optional: false, required: true + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // agency_project_id - computed: false, optional: false, required: true + private _agencyProjectId?: string; + public get agencyProjectId() { + return this.getStringAttribute('agency_project_id'); + } + public set agencyProjectId(value: string) { + this._agencyProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get agencyProjectIdInput() { + return this._agencyProjectId; + } +} +export interface LtsTransferLogTransferInfoLogTransferDetail { + /** + * The list of tag fields will be delivered when transferring. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#delivery_tags LtsTransfer#delivery_tags} + */ + readonly deliveryTags?: string[]; + /** + * DIS stream ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#dis_id LtsTransfer#dis_id} + */ + readonly disId?: string; + /** + * DIS stream name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#dis_name LtsTransfer#dis_name} + */ + readonly disName?: string; + /** + * Kafka ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#kafka_id LtsTransfer#kafka_id} + */ + readonly kafkaId?: string; + /** + * Kafka topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#kafka_topic LtsTransfer#kafka_topic} + */ + readonly kafkaTopic?: string; + /** + * OBS bucket name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_bucket_name LtsTransfer#obs_bucket_name} + */ + readonly obsBucketName?: string; + /** + * Custom transfer path of an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_dir_prefix_name LtsTransfer#obs_dir_prefix_name} + */ + readonly obsDirPrefixName?: string; + /** + * Whether OBS bucket encryption is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_encrypted_enable LtsTransfer#obs_encrypted_enable} + */ + readonly obsEncryptedEnable?: boolean | cdktf.IResolvable; + /** + * KMS key ID for an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_encrypted_id LtsTransfer#obs_encrypted_id} + */ + readonly obsEncryptedId?: string; + /** + * Enterprise project ID of an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_eps_id LtsTransfer#obs_eps_id} + */ + readonly obsEpsId?: string; + /** + * Length of the transfer interval for an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_period LtsTransfer#obs_period} + */ + readonly obsPeriod?: number; + /** + * Unit of the transfer interval for an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_period_unit LtsTransfer#obs_period_unit} + */ + readonly obsPeriodUnit?: string; + /** + * Transfer file prefix of an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_prefix_name LtsTransfer#obs_prefix_name} + */ + readonly obsPrefixName?: string; + /** + * Time zone for an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_time_zone LtsTransfer#obs_time_zone} + */ + readonly obsTimeZone?: string; + /** + * ID of the time zone for an OBS transfer task. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_time_zone_id LtsTransfer#obs_time_zone_id} + */ + readonly obsTimeZoneId?: string; + /** + * OBS bucket path, which is the log transfer destination. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#obs_transfer_path LtsTransfer#obs_transfer_path} + */ + readonly obsTransferPath?: string; +} + +export function ltsTransferLogTransferInfoLogTransferDetailToTerraform(struct?: LtsTransferLogTransferInfoLogTransferDetailOutputReference | LtsTransferLogTransferInfoLogTransferDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delivery_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.deliveryTags), + dis_id: cdktf.stringToTerraform(struct!.disId), + dis_name: cdktf.stringToTerraform(struct!.disName), + kafka_id: cdktf.stringToTerraform(struct!.kafkaId), + kafka_topic: cdktf.stringToTerraform(struct!.kafkaTopic), + obs_bucket_name: cdktf.stringToTerraform(struct!.obsBucketName), + obs_dir_prefix_name: cdktf.stringToTerraform(struct!.obsDirPrefixName), + obs_encrypted_enable: cdktf.booleanToTerraform(struct!.obsEncryptedEnable), + obs_encrypted_id: cdktf.stringToTerraform(struct!.obsEncryptedId), + obs_eps_id: cdktf.stringToTerraform(struct!.obsEpsId), + obs_period: cdktf.numberToTerraform(struct!.obsPeriod), + obs_period_unit: cdktf.stringToTerraform(struct!.obsPeriodUnit), + obs_prefix_name: cdktf.stringToTerraform(struct!.obsPrefixName), + obs_time_zone: cdktf.stringToTerraform(struct!.obsTimeZone), + obs_time_zone_id: cdktf.stringToTerraform(struct!.obsTimeZoneId), + obs_transfer_path: cdktf.stringToTerraform(struct!.obsTransferPath), + } +} + + +export function ltsTransferLogTransferInfoLogTransferDetailToHclTerraform(struct?: LtsTransferLogTransferInfoLogTransferDetailOutputReference | LtsTransferLogTransferInfoLogTransferDetail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delivery_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.deliveryTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + dis_id: { + value: cdktf.stringToHclTerraform(struct!.disId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dis_name: { + value: cdktf.stringToHclTerraform(struct!.disName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka_id: { + value: cdktf.stringToHclTerraform(struct!.kafkaId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kafka_topic: { + value: cdktf.stringToHclTerraform(struct!.kafkaTopic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_bucket_name: { + value: cdktf.stringToHclTerraform(struct!.obsBucketName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_dir_prefix_name: { + value: cdktf.stringToHclTerraform(struct!.obsDirPrefixName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_encrypted_enable: { + value: cdktf.booleanToHclTerraform(struct!.obsEncryptedEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + obs_encrypted_id: { + value: cdktf.stringToHclTerraform(struct!.obsEncryptedId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_eps_id: { + value: cdktf.stringToHclTerraform(struct!.obsEpsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_period: { + value: cdktf.numberToHclTerraform(struct!.obsPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + obs_period_unit: { + value: cdktf.stringToHclTerraform(struct!.obsPeriodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_prefix_name: { + value: cdktf.stringToHclTerraform(struct!.obsPrefixName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_time_zone: { + value: cdktf.stringToHclTerraform(struct!.obsTimeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_time_zone_id: { + value: cdktf.stringToHclTerraform(struct!.obsTimeZoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_transfer_path: { + value: cdktf.stringToHclTerraform(struct!.obsTransferPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsTransferLogTransferInfoLogTransferDetailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsTransferLogTransferInfoLogTransferDetail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._deliveryTags !== undefined) { + hasAnyValues = true; + internalValueResult.deliveryTags = this._deliveryTags; + } + if (this._disId !== undefined) { + hasAnyValues = true; + internalValueResult.disId = this._disId; + } + if (this._disName !== undefined) { + hasAnyValues = true; + internalValueResult.disName = this._disName; + } + if (this._kafkaId !== undefined) { + hasAnyValues = true; + internalValueResult.kafkaId = this._kafkaId; + } + if (this._kafkaTopic !== undefined) { + hasAnyValues = true; + internalValueResult.kafkaTopic = this._kafkaTopic; + } + if (this._obsBucketName !== undefined) { + hasAnyValues = true; + internalValueResult.obsBucketName = this._obsBucketName; + } + if (this._obsDirPrefixName !== undefined) { + hasAnyValues = true; + internalValueResult.obsDirPrefixName = this._obsDirPrefixName; + } + if (this._obsEncryptedEnable !== undefined) { + hasAnyValues = true; + internalValueResult.obsEncryptedEnable = this._obsEncryptedEnable; + } + if (this._obsEncryptedId !== undefined) { + hasAnyValues = true; + internalValueResult.obsEncryptedId = this._obsEncryptedId; + } + if (this._obsEpsId !== undefined) { + hasAnyValues = true; + internalValueResult.obsEpsId = this._obsEpsId; + } + if (this._obsPeriod !== undefined) { + hasAnyValues = true; + internalValueResult.obsPeriod = this._obsPeriod; + } + if (this._obsPeriodUnit !== undefined) { + hasAnyValues = true; + internalValueResult.obsPeriodUnit = this._obsPeriodUnit; + } + if (this._obsPrefixName !== undefined) { + hasAnyValues = true; + internalValueResult.obsPrefixName = this._obsPrefixName; + } + if (this._obsTimeZone !== undefined) { + hasAnyValues = true; + internalValueResult.obsTimeZone = this._obsTimeZone; + } + if (this._obsTimeZoneId !== undefined) { + hasAnyValues = true; + internalValueResult.obsTimeZoneId = this._obsTimeZoneId; + } + if (this._obsTransferPath !== undefined) { + hasAnyValues = true; + internalValueResult.obsTransferPath = this._obsTransferPath; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsTransferLogTransferInfoLogTransferDetail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._deliveryTags = undefined; + this._disId = undefined; + this._disName = undefined; + this._kafkaId = undefined; + this._kafkaTopic = undefined; + this._obsBucketName = undefined; + this._obsDirPrefixName = undefined; + this._obsEncryptedEnable = undefined; + this._obsEncryptedId = undefined; + this._obsEpsId = undefined; + this._obsPeriod = undefined; + this._obsPeriodUnit = undefined; + this._obsPrefixName = undefined; + this._obsTimeZone = undefined; + this._obsTimeZoneId = undefined; + this._obsTransferPath = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._deliveryTags = value.deliveryTags; + this._disId = value.disId; + this._disName = value.disName; + this._kafkaId = value.kafkaId; + this._kafkaTopic = value.kafkaTopic; + this._obsBucketName = value.obsBucketName; + this._obsDirPrefixName = value.obsDirPrefixName; + this._obsEncryptedEnable = value.obsEncryptedEnable; + this._obsEncryptedId = value.obsEncryptedId; + this._obsEpsId = value.obsEpsId; + this._obsPeriod = value.obsPeriod; + this._obsPeriodUnit = value.obsPeriodUnit; + this._obsPrefixName = value.obsPrefixName; + this._obsTimeZone = value.obsTimeZone; + this._obsTimeZoneId = value.obsTimeZoneId; + this._obsTransferPath = value.obsTransferPath; + } + } + + // delivery_tags - computed: true, optional: true, required: false + private _deliveryTags?: string[]; + public get deliveryTags() { + return this.getListAttribute('delivery_tags'); + } + public set deliveryTags(value: string[]) { + this._deliveryTags = value; + } + public resetDeliveryTags() { + this._deliveryTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get deliveryTagsInput() { + return this._deliveryTags; + } + + // dis_id - computed: true, optional: true, required: false + private _disId?: string; + public get disId() { + return this.getStringAttribute('dis_id'); + } + public set disId(value: string) { + this._disId = value; + } + public resetDisId() { + this._disId = undefined; + } + // Temporarily expose input value. Use with caution. + public get disIdInput() { + return this._disId; + } + + // dis_name - computed: true, optional: true, required: false + private _disName?: string; + public get disName() { + return this.getStringAttribute('dis_name'); + } + public set disName(value: string) { + this._disName = value; + } + public resetDisName() { + this._disName = undefined; + } + // Temporarily expose input value. Use with caution. + public get disNameInput() { + return this._disName; + } + + // kafka_id - computed: true, optional: true, required: false + private _kafkaId?: string; + public get kafkaId() { + return this.getStringAttribute('kafka_id'); + } + public set kafkaId(value: string) { + this._kafkaId = value; + } + public resetKafkaId() { + this._kafkaId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaIdInput() { + return this._kafkaId; + } + + // kafka_topic - computed: true, optional: true, required: false + private _kafkaTopic?: string; + public get kafkaTopic() { + return this.getStringAttribute('kafka_topic'); + } + public set kafkaTopic(value: string) { + this._kafkaTopic = value; + } + public resetKafkaTopic() { + this._kafkaTopic = undefined; + } + // Temporarily expose input value. Use with caution. + public get kafkaTopicInput() { + return this._kafkaTopic; + } + + // obs_bucket_name - computed: true, optional: true, required: false + private _obsBucketName?: string; + public get obsBucketName() { + return this.getStringAttribute('obs_bucket_name'); + } + public set obsBucketName(value: string) { + this._obsBucketName = value; + } + public resetObsBucketName() { + this._obsBucketName = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsBucketNameInput() { + return this._obsBucketName; + } + + // obs_dir_prefix_name - computed: true, optional: true, required: false + private _obsDirPrefixName?: string; + public get obsDirPrefixName() { + return this.getStringAttribute('obs_dir_prefix_name'); + } + public set obsDirPrefixName(value: string) { + this._obsDirPrefixName = value; + } + public resetObsDirPrefixName() { + this._obsDirPrefixName = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsDirPrefixNameInput() { + return this._obsDirPrefixName; + } + + // obs_encrypted_enable - computed: true, optional: true, required: false + private _obsEncryptedEnable?: boolean | cdktf.IResolvable; + public get obsEncryptedEnable() { + return this.getBooleanAttribute('obs_encrypted_enable'); + } + public set obsEncryptedEnable(value: boolean | cdktf.IResolvable) { + this._obsEncryptedEnable = value; + } + public resetObsEncryptedEnable() { + this._obsEncryptedEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsEncryptedEnableInput() { + return this._obsEncryptedEnable; + } + + // obs_encrypted_id - computed: true, optional: true, required: false + private _obsEncryptedId?: string; + public get obsEncryptedId() { + return this.getStringAttribute('obs_encrypted_id'); + } + public set obsEncryptedId(value: string) { + this._obsEncryptedId = value; + } + public resetObsEncryptedId() { + this._obsEncryptedId = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsEncryptedIdInput() { + return this._obsEncryptedId; + } + + // obs_eps_id - computed: true, optional: true, required: false + private _obsEpsId?: string; + public get obsEpsId() { + return this.getStringAttribute('obs_eps_id'); + } + public set obsEpsId(value: string) { + this._obsEpsId = value; + } + public resetObsEpsId() { + this._obsEpsId = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsEpsIdInput() { + return this._obsEpsId; + } + + // obs_period - computed: true, optional: true, required: false + private _obsPeriod?: number; + public get obsPeriod() { + return this.getNumberAttribute('obs_period'); + } + public set obsPeriod(value: number) { + this._obsPeriod = value; + } + public resetObsPeriod() { + this._obsPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsPeriodInput() { + return this._obsPeriod; + } + + // obs_period_unit - computed: true, optional: true, required: false + private _obsPeriodUnit?: string; + public get obsPeriodUnit() { + return this.getStringAttribute('obs_period_unit'); + } + public set obsPeriodUnit(value: string) { + this._obsPeriodUnit = value; + } + public resetObsPeriodUnit() { + this._obsPeriodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsPeriodUnitInput() { + return this._obsPeriodUnit; + } + + // obs_prefix_name - computed: true, optional: true, required: false + private _obsPrefixName?: string; + public get obsPrefixName() { + return this.getStringAttribute('obs_prefix_name'); + } + public set obsPrefixName(value: string) { + this._obsPrefixName = value; + } + public resetObsPrefixName() { + this._obsPrefixName = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsPrefixNameInput() { + return this._obsPrefixName; + } + + // obs_time_zone - computed: true, optional: true, required: false + private _obsTimeZone?: string; + public get obsTimeZone() { + return this.getStringAttribute('obs_time_zone'); + } + public set obsTimeZone(value: string) { + this._obsTimeZone = value; + } + public resetObsTimeZone() { + this._obsTimeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsTimeZoneInput() { + return this._obsTimeZone; + } + + // obs_time_zone_id - computed: true, optional: true, required: false + private _obsTimeZoneId?: string; + public get obsTimeZoneId() { + return this.getStringAttribute('obs_time_zone_id'); + } + public set obsTimeZoneId(value: string) { + this._obsTimeZoneId = value; + } + public resetObsTimeZoneId() { + this._obsTimeZoneId = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsTimeZoneIdInput() { + return this._obsTimeZoneId; + } + + // obs_transfer_path - computed: true, optional: true, required: false + private _obsTransferPath?: string; + public get obsTransferPath() { + return this.getStringAttribute('obs_transfer_path'); + } + public set obsTransferPath(value: string) { + this._obsTransferPath = value; + } + public resetObsTransferPath() { + this._obsTransferPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsTransferPathInput() { + return this._obsTransferPath; + } +} +export interface LtsTransferLogTransferInfo { + /** + * Log transfer format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_storage_format LtsTransfer#log_storage_format} + */ + readonly logStorageFormat: string; + /** + * Log transfer mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_transfer_mode LtsTransfer#log_transfer_mode} + */ + readonly logTransferMode: string; + /** + * Log transfer status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_transfer_status LtsTransfer#log_transfer_status} + */ + readonly logTransferStatus: string; + /** + * Log transfer type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_transfer_type LtsTransfer#log_transfer_type} + */ + readonly logTransferType: string; + /** + * log_agency_transfer block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_agency_transfer LtsTransfer#log_agency_transfer} + */ + readonly logAgencyTransfer?: LtsTransferLogTransferInfoLogAgencyTransfer; + /** + * log_transfer_detail block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#log_transfer_detail LtsTransfer#log_transfer_detail} + */ + readonly logTransferDetail: LtsTransferLogTransferInfoLogTransferDetail; +} + +export function ltsTransferLogTransferInfoToTerraform(struct?: LtsTransferLogTransferInfoOutputReference | LtsTransferLogTransferInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + log_storage_format: cdktf.stringToTerraform(struct!.logStorageFormat), + log_transfer_mode: cdktf.stringToTerraform(struct!.logTransferMode), + log_transfer_status: cdktf.stringToTerraform(struct!.logTransferStatus), + log_transfer_type: cdktf.stringToTerraform(struct!.logTransferType), + log_agency_transfer: ltsTransferLogTransferInfoLogAgencyTransferToTerraform(struct!.logAgencyTransfer), + log_transfer_detail: ltsTransferLogTransferInfoLogTransferDetailToTerraform(struct!.logTransferDetail), + } +} + + +export function ltsTransferLogTransferInfoToHclTerraform(struct?: LtsTransferLogTransferInfoOutputReference | LtsTransferLogTransferInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + log_storage_format: { + value: cdktf.stringToHclTerraform(struct!.logStorageFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_transfer_mode: { + value: cdktf.stringToHclTerraform(struct!.logTransferMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_transfer_status: { + value: cdktf.stringToHclTerraform(struct!.logTransferStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_transfer_type: { + value: cdktf.stringToHclTerraform(struct!.logTransferType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_agency_transfer: { + value: ltsTransferLogTransferInfoLogAgencyTransferToHclTerraform(struct!.logAgencyTransfer), + isBlock: true, + type: "list", + storageClassType: "LtsTransferLogTransferInfoLogAgencyTransferList", + }, + log_transfer_detail: { + value: ltsTransferLogTransferInfoLogTransferDetailToHclTerraform(struct!.logTransferDetail), + isBlock: true, + type: "list", + storageClassType: "LtsTransferLogTransferInfoLogTransferDetailList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class LtsTransferLogTransferInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): LtsTransferLogTransferInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logStorageFormat !== undefined) { + hasAnyValues = true; + internalValueResult.logStorageFormat = this._logStorageFormat; + } + if (this._logTransferMode !== undefined) { + hasAnyValues = true; + internalValueResult.logTransferMode = this._logTransferMode; + } + if (this._logTransferStatus !== undefined) { + hasAnyValues = true; + internalValueResult.logTransferStatus = this._logTransferStatus; + } + if (this._logTransferType !== undefined) { + hasAnyValues = true; + internalValueResult.logTransferType = this._logTransferType; + } + if (this._logAgencyTransfer?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.logAgencyTransfer = this._logAgencyTransfer?.internalValue; + } + if (this._logTransferDetail?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.logTransferDetail = this._logTransferDetail?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: LtsTransferLogTransferInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._logStorageFormat = undefined; + this._logTransferMode = undefined; + this._logTransferStatus = undefined; + this._logTransferType = undefined; + this._logAgencyTransfer.internalValue = undefined; + this._logTransferDetail.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._logStorageFormat = value.logStorageFormat; + this._logTransferMode = value.logTransferMode; + this._logTransferStatus = value.logTransferStatus; + this._logTransferType = value.logTransferType; + this._logAgencyTransfer.internalValue = value.logAgencyTransfer; + this._logTransferDetail.internalValue = value.logTransferDetail; + } + } + + // log_storage_format - computed: false, optional: false, required: true + private _logStorageFormat?: string; + public get logStorageFormat() { + return this.getStringAttribute('log_storage_format'); + } + public set logStorageFormat(value: string) { + this._logStorageFormat = value; + } + // Temporarily expose input value. Use with caution. + public get logStorageFormatInput() { + return this._logStorageFormat; + } + + // log_transfer_mode - computed: false, optional: false, required: true + private _logTransferMode?: string; + public get logTransferMode() { + return this.getStringAttribute('log_transfer_mode'); + } + public set logTransferMode(value: string) { + this._logTransferMode = value; + } + // Temporarily expose input value. Use with caution. + public get logTransferModeInput() { + return this._logTransferMode; + } + + // log_transfer_status - computed: false, optional: false, required: true + private _logTransferStatus?: string; + public get logTransferStatus() { + return this.getStringAttribute('log_transfer_status'); + } + public set logTransferStatus(value: string) { + this._logTransferStatus = value; + } + // Temporarily expose input value. Use with caution. + public get logTransferStatusInput() { + return this._logTransferStatus; + } + + // log_transfer_type - computed: false, optional: false, required: true + private _logTransferType?: string; + public get logTransferType() { + return this.getStringAttribute('log_transfer_type'); + } + public set logTransferType(value: string) { + this._logTransferType = value; + } + // Temporarily expose input value. Use with caution. + public get logTransferTypeInput() { + return this._logTransferType; + } + + // log_agency_transfer - computed: false, optional: true, required: false + private _logAgencyTransfer = new LtsTransferLogTransferInfoLogAgencyTransferOutputReference(this, "log_agency_transfer"); + public get logAgencyTransfer() { + return this._logAgencyTransfer; + } + public putLogAgencyTransfer(value: LtsTransferLogTransferInfoLogAgencyTransfer) { + this._logAgencyTransfer.internalValue = value; + } + public resetLogAgencyTransfer() { + this._logAgencyTransfer.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logAgencyTransferInput() { + return this._logAgencyTransfer.internalValue; + } + + // log_transfer_detail - computed: false, optional: false, required: true + private _logTransferDetail = new LtsTransferLogTransferInfoLogTransferDetailOutputReference(this, "log_transfer_detail"); + public get logTransferDetail() { + return this._logTransferDetail; + } + public putLogTransferDetail(value: LtsTransferLogTransferInfoLogTransferDetail) { + this._logTransferDetail.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get logTransferDetailInput() { + return this._logTransferDetail.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer huaweicloud_lts_transfer} +*/ +export class LtsTransfer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_transfer"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsTransfer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsTransfer to import + * @param importFromId The id of the existing LtsTransfer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsTransfer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_transfer", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_transfer huaweicloud_lts_transfer} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsTransferConfig + */ + public constructor(scope: Construct, id: string, config: LtsTransferConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_transfer', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupId = config.logGroupId; + this._region = config.region; + this._logStreams.internalValue = config.logStreams; + this._logTransferInfo.internalValue = config.logTransferInfo; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_group_name - computed: true, optional: false, required: false + public get logGroupName() { + return this.getStringAttribute('log_group_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // log_streams - computed: false, optional: false, required: true + private _logStreams = new LtsTransferLogStreamsList(this, "log_streams", false); + public get logStreams() { + return this._logStreams; + } + public putLogStreams(value: LtsTransferLogStreams[] | cdktf.IResolvable) { + this._logStreams.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamsInput() { + return this._logStreams.internalValue; + } + + // log_transfer_info - computed: false, optional: false, required: true + private _logTransferInfo = new LtsTransferLogTransferInfoOutputReference(this, "log_transfer_info"); + public get logTransferInfo() { + return this._logTransferInfo; + } + public putLogTransferInfo(value: LtsTransferLogTransferInfo) { + this._logTransferInfo.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get logTransferInfoInput() { + return this._logTransferInfo.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + region: cdktf.stringToTerraform(this._region), + log_streams: cdktf.listMapper(ltsTransferLogStreamsToTerraform, true)(this._logStreams.internalValue), + log_transfer_info: ltsTransferLogTransferInfoToTerraform(this._logTransferInfo.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_streams: { + value: cdktf.listMapperHcl(ltsTransferLogStreamsToHclTerraform, true)(this._logStreams.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsTransferLogStreamsList", + }, + log_transfer_info: { + value: ltsTransferLogTransferInfoToHclTerraform(this._logTransferInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "LtsTransferLogTransferInfoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/lts-waf-access/README.md b/src/constructs/providers/huaweicloud/lts-waf-access/README.md new file mode 100644 index 00000000..ec2c1c2d --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-waf-access/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_lts_waf_access` + +Refer to the Terraform Registry for docs: [`huaweicloud_lts_waf_access`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access). diff --git a/src/constructs/providers/huaweicloud/lts-waf-access/index.ts b/src/constructs/providers/huaweicloud/lts-waf-access/index.ts new file mode 100644 index 00000000..3832abfa --- /dev/null +++ b/src/constructs/providers/huaweicloud/lts-waf-access/index.ts @@ -0,0 +1,261 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface LtsWafAccessConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#enterprise_project_id LtsWafAccess#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#id LtsWafAccess#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the log stream ID for access logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#lts_access_stream_id LtsWafAccess#lts_access_stream_id} + */ + readonly ltsAccessStreamId?: string; + /** + * Specifies the log stream ID for attack logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#lts_attack_stream_id LtsWafAccess#lts_attack_stream_id} + */ + readonly ltsAttackStreamId?: string; + /** + * Specifies the log group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#lts_group_id LtsWafAccess#lts_group_id} + */ + readonly ltsGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#region LtsWafAccess#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access huaweicloud_lts_waf_access} +*/ +export class LtsWafAccess extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_lts_waf_access"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a LtsWafAccess resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the LtsWafAccess to import + * @param importFromId The id of the existing LtsWafAccess that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the LtsWafAccess to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_lts_waf_access", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/lts_waf_access huaweicloud_lts_waf_access} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options LtsWafAccessConfig + */ + public constructor(scope: Construct, id: string, config: LtsWafAccessConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_lts_waf_access', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ltsAccessStreamId = config.ltsAccessStreamId; + this._ltsAttackStreamId = config.ltsAttackStreamId; + this._ltsGroupId = config.ltsGroupId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lts_access_stream_id - computed: false, optional: true, required: false + private _ltsAccessStreamId?: string; + public get ltsAccessStreamId() { + return this.getStringAttribute('lts_access_stream_id'); + } + public set ltsAccessStreamId(value: string) { + this._ltsAccessStreamId = value; + } + public resetLtsAccessStreamId() { + this._ltsAccessStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsAccessStreamIdInput() { + return this._ltsAccessStreamId; + } + + // lts_attack_stream_id - computed: false, optional: true, required: false + private _ltsAttackStreamId?: string; + public get ltsAttackStreamId() { + return this.getStringAttribute('lts_attack_stream_id'); + } + public set ltsAttackStreamId(value: string) { + this._ltsAttackStreamId = value; + } + public resetLtsAttackStreamId() { + this._ltsAttackStreamId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ltsAttackStreamIdInput() { + return this._ltsAttackStreamId; + } + + // lts_group_id - computed: false, optional: false, required: true + private _ltsGroupId?: string; + public get ltsGroupId() { + return this.getStringAttribute('lts_group_id'); + } + public set ltsGroupId(value: string) { + this._ltsGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsGroupIdInput() { + return this._ltsGroupId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + lts_access_stream_id: cdktf.stringToTerraform(this._ltsAccessStreamId), + lts_attack_stream_id: cdktf.stringToTerraform(this._ltsAttackStreamId), + lts_group_id: cdktf.stringToTerraform(this._ltsGroupId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_access_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsAccessStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_attack_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsAttackStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_group_id: { + value: cdktf.stringToHclTerraform(this._ltsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mapreduce-cluster/README.md b/src/constructs/providers/huaweicloud/mapreduce-cluster/README.md new file mode 100644 index 00000000..6c3ad2d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mapreduce_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_mapreduce_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster). diff --git a/src/constructs/providers/huaweicloud/mapreduce-cluster/index.ts b/src/constructs/providers/huaweicloud/mapreduce-cluster/index.ts new file mode 100644 index 00000000..51595dfc --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-cluster/index.ts @@ -0,0 +1,4125 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MapreduceClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#availability_zone MapreduceCluster#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#charging_mode MapreduceCluster#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#component_list MapreduceCluster#component_list} + */ + readonly componentList: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#eip_id MapreduceCluster#eip_id} + */ + readonly eipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#enterprise_project_id MapreduceCluster#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#id MapreduceCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#log_collection MapreduceCluster#log_collection} + */ + readonly logCollection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#manager_admin_pass MapreduceCluster#manager_admin_pass} + */ + readonly managerAdminPass: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#name MapreduceCluster#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_admin_pass MapreduceCluster#node_admin_pass} + */ + readonly nodeAdminPass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_key_pair MapreduceCluster#node_key_pair} + */ + readonly nodeKeyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#period MapreduceCluster#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#period_unit MapreduceCluster#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#public_ip MapreduceCluster#public_ip} + */ + readonly publicIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#region MapreduceCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#safe_mode MapreduceCluster#safe_mode} + */ + readonly safeMode?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#security_group_ids MapreduceCluster#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#subnet_id MapreduceCluster#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#tags MapreduceCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#template_id MapreduceCluster#template_id} + */ + readonly templateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#type MapreduceCluster#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#version MapreduceCluster#version} + */ + readonly version: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#vpc_id MapreduceCluster#vpc_id} + */ + readonly vpcId: string; + /** + * analysis_core_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#analysis_core_nodes MapreduceCluster#analysis_core_nodes} + */ + readonly analysisCoreNodes?: MapreduceClusterAnalysisCoreNodes; + /** + * analysis_task_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#analysis_task_nodes MapreduceCluster#analysis_task_nodes} + */ + readonly analysisTaskNodes?: MapreduceClusterAnalysisTaskNodes; + /** + * bootstrap_scripts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#bootstrap_scripts MapreduceCluster#bootstrap_scripts} + */ + readonly bootstrapScripts?: MapreduceClusterBootstrapScripts[] | cdktf.IResolvable; + /** + * component_configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#component_configs MapreduceCluster#component_configs} + */ + readonly componentConfigs?: MapreduceClusterComponentConfigs[] | cdktf.IResolvable; + /** + * custom_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#custom_nodes MapreduceCluster#custom_nodes} + */ + readonly customNodes?: MapreduceClusterCustomNodes[] | cdktf.IResolvable; + /** + * external_datasources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#external_datasources MapreduceCluster#external_datasources} + */ + readonly externalDatasources?: MapreduceClusterExternalDatasources[] | cdktf.IResolvable; + /** + * master_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#master_nodes MapreduceCluster#master_nodes} + */ + readonly masterNodes: MapreduceClusterMasterNodes; + /** + * smn_notify block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#smn_notify MapreduceCluster#smn_notify} + */ + readonly smnNotify?: MapreduceClusterSmnNotify; + /** + * streaming_core_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#streaming_core_nodes MapreduceCluster#streaming_core_nodes} + */ + readonly streamingCoreNodes?: MapreduceClusterStreamingCoreNodes; + /** + * streaming_task_nodes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#streaming_task_nodes MapreduceCluster#streaming_task_nodes} + */ + readonly streamingTaskNodes?: MapreduceClusterStreamingTaskNodes; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#timeouts MapreduceCluster#timeouts} + */ + readonly timeouts?: MapreduceClusterTimeouts; +} +export interface MapreduceClusterAnalysisCoreNodes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#assigned_roles MapreduceCluster#assigned_roles} + */ + readonly assignedRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_count MapreduceCluster#data_volume_count} + */ + readonly dataVolumeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_size MapreduceCluster#data_volume_size} + */ + readonly dataVolumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_type MapreduceCluster#data_volume_type} + */ + readonly dataVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#flavor MapreduceCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_number MapreduceCluster#node_number} + */ + readonly nodeNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_size MapreduceCluster#root_volume_size} + */ + readonly rootVolumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_type MapreduceCluster#root_volume_type} + */ + readonly rootVolumeType: string; +} + +export function mapreduceClusterAnalysisCoreNodesToTerraform(struct?: MapreduceClusterAnalysisCoreNodesOutputReference | MapreduceClusterAnalysisCoreNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + assigned_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.assignedRoles), + data_volume_count: cdktf.numberToTerraform(struct!.dataVolumeCount), + data_volume_size: cdktf.numberToTerraform(struct!.dataVolumeSize), + data_volume_type: cdktf.stringToTerraform(struct!.dataVolumeType), + flavor: cdktf.stringToTerraform(struct!.flavor), + node_number: cdktf.numberToTerraform(struct!.nodeNumber), + root_volume_size: cdktf.numberToTerraform(struct!.rootVolumeSize), + root_volume_type: cdktf.stringToTerraform(struct!.rootVolumeType), + } +} + + +export function mapreduceClusterAnalysisCoreNodesToHclTerraform(struct?: MapreduceClusterAnalysisCoreNodesOutputReference | MapreduceClusterAnalysisCoreNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + assigned_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.assignedRoles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + data_volume_count: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_size: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_type: { + value: cdktf.stringToHclTerraform(struct!.dataVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_number: { + value: cdktf.numberToHclTerraform(struct!.nodeNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_size: { + value: cdktf.numberToHclTerraform(struct!.rootVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_type: { + value: cdktf.stringToHclTerraform(struct!.rootVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterAnalysisCoreNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceClusterAnalysisCoreNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._assignedRoles !== undefined) { + hasAnyValues = true; + internalValueResult.assignedRoles = this._assignedRoles; + } + if (this._dataVolumeCount !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeCount = this._dataVolumeCount; + } + if (this._dataVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeSize = this._dataVolumeSize; + } + if (this._dataVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeType = this._dataVolumeType; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._nodeNumber !== undefined) { + hasAnyValues = true; + internalValueResult.nodeNumber = this._nodeNumber; + } + if (this._rootVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeSize = this._rootVolumeSize; + } + if (this._rootVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeType = this._rootVolumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterAnalysisCoreNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._assignedRoles = undefined; + this._dataVolumeCount = undefined; + this._dataVolumeSize = undefined; + this._dataVolumeType = undefined; + this._flavor = undefined; + this._nodeNumber = undefined; + this._rootVolumeSize = undefined; + this._rootVolumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._assignedRoles = value.assignedRoles; + this._dataVolumeCount = value.dataVolumeCount; + this._dataVolumeSize = value.dataVolumeSize; + this._dataVolumeType = value.dataVolumeType; + this._flavor = value.flavor; + this._nodeNumber = value.nodeNumber; + this._rootVolumeSize = value.rootVolumeSize; + this._rootVolumeType = value.rootVolumeType; + } + } + + // assigned_roles - computed: false, optional: true, required: false + private _assignedRoles?: string[]; + public get assignedRoles() { + return this.getListAttribute('assigned_roles'); + } + public set assignedRoles(value: string[]) { + this._assignedRoles = value; + } + public resetAssignedRoles() { + this._assignedRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignedRolesInput() { + return this._assignedRoles; + } + + // data_volume_count - computed: false, optional: false, required: true + private _dataVolumeCount?: number; + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + public set dataVolumeCount(value: number) { + this._dataVolumeCount = value; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeCountInput() { + return this._dataVolumeCount; + } + + // data_volume_size - computed: false, optional: true, required: false + private _dataVolumeSize?: number; + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + public set dataVolumeSize(value: number) { + this._dataVolumeSize = value; + } + public resetDataVolumeSize() { + this._dataVolumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeSizeInput() { + return this._dataVolumeSize; + } + + // data_volume_type - computed: false, optional: true, required: false + private _dataVolumeType?: string; + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + public set dataVolumeType(value: string) { + this._dataVolumeType = value; + } + public resetDataVolumeType() { + this._dataVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeTypeInput() { + return this._dataVolumeType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // host_ips - computed: true, optional: false, required: false + public get hostIps() { + return this.getListAttribute('host_ips'); + } + + // node_number - computed: false, optional: false, required: true + private _nodeNumber?: number; + public get nodeNumber() { + return this.getNumberAttribute('node_number'); + } + public set nodeNumber(value: number) { + this._nodeNumber = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumberInput() { + return this._nodeNumber; + } + + // root_volume_size - computed: false, optional: false, required: true + private _rootVolumeSize?: number; + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + public set rootVolumeSize(value: number) { + this._rootVolumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeSizeInput() { + return this._rootVolumeSize; + } + + // root_volume_type - computed: false, optional: false, required: true + private _rootVolumeType?: string; + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + public set rootVolumeType(value: string) { + this._rootVolumeType = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeTypeInput() { + return this._rootVolumeType; + } +} +export interface MapreduceClusterAnalysisTaskNodes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#assigned_roles MapreduceCluster#assigned_roles} + */ + readonly assignedRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_count MapreduceCluster#data_volume_count} + */ + readonly dataVolumeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_size MapreduceCluster#data_volume_size} + */ + readonly dataVolumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_type MapreduceCluster#data_volume_type} + */ + readonly dataVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#flavor MapreduceCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_number MapreduceCluster#node_number} + */ + readonly nodeNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_size MapreduceCluster#root_volume_size} + */ + readonly rootVolumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_type MapreduceCluster#root_volume_type} + */ + readonly rootVolumeType: string; +} + +export function mapreduceClusterAnalysisTaskNodesToTerraform(struct?: MapreduceClusterAnalysisTaskNodesOutputReference | MapreduceClusterAnalysisTaskNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + assigned_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.assignedRoles), + data_volume_count: cdktf.numberToTerraform(struct!.dataVolumeCount), + data_volume_size: cdktf.numberToTerraform(struct!.dataVolumeSize), + data_volume_type: cdktf.stringToTerraform(struct!.dataVolumeType), + flavor: cdktf.stringToTerraform(struct!.flavor), + node_number: cdktf.numberToTerraform(struct!.nodeNumber), + root_volume_size: cdktf.numberToTerraform(struct!.rootVolumeSize), + root_volume_type: cdktf.stringToTerraform(struct!.rootVolumeType), + } +} + + +export function mapreduceClusterAnalysisTaskNodesToHclTerraform(struct?: MapreduceClusterAnalysisTaskNodesOutputReference | MapreduceClusterAnalysisTaskNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + assigned_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.assignedRoles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + data_volume_count: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_size: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_type: { + value: cdktf.stringToHclTerraform(struct!.dataVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_number: { + value: cdktf.numberToHclTerraform(struct!.nodeNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_size: { + value: cdktf.numberToHclTerraform(struct!.rootVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_type: { + value: cdktf.stringToHclTerraform(struct!.rootVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterAnalysisTaskNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceClusterAnalysisTaskNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._assignedRoles !== undefined) { + hasAnyValues = true; + internalValueResult.assignedRoles = this._assignedRoles; + } + if (this._dataVolumeCount !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeCount = this._dataVolumeCount; + } + if (this._dataVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeSize = this._dataVolumeSize; + } + if (this._dataVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeType = this._dataVolumeType; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._nodeNumber !== undefined) { + hasAnyValues = true; + internalValueResult.nodeNumber = this._nodeNumber; + } + if (this._rootVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeSize = this._rootVolumeSize; + } + if (this._rootVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeType = this._rootVolumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterAnalysisTaskNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._assignedRoles = undefined; + this._dataVolumeCount = undefined; + this._dataVolumeSize = undefined; + this._dataVolumeType = undefined; + this._flavor = undefined; + this._nodeNumber = undefined; + this._rootVolumeSize = undefined; + this._rootVolumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._assignedRoles = value.assignedRoles; + this._dataVolumeCount = value.dataVolumeCount; + this._dataVolumeSize = value.dataVolumeSize; + this._dataVolumeType = value.dataVolumeType; + this._flavor = value.flavor; + this._nodeNumber = value.nodeNumber; + this._rootVolumeSize = value.rootVolumeSize; + this._rootVolumeType = value.rootVolumeType; + } + } + + // assigned_roles - computed: false, optional: true, required: false + private _assignedRoles?: string[]; + public get assignedRoles() { + return this.getListAttribute('assigned_roles'); + } + public set assignedRoles(value: string[]) { + this._assignedRoles = value; + } + public resetAssignedRoles() { + this._assignedRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignedRolesInput() { + return this._assignedRoles; + } + + // data_volume_count - computed: false, optional: false, required: true + private _dataVolumeCount?: number; + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + public set dataVolumeCount(value: number) { + this._dataVolumeCount = value; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeCountInput() { + return this._dataVolumeCount; + } + + // data_volume_size - computed: false, optional: true, required: false + private _dataVolumeSize?: number; + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + public set dataVolumeSize(value: number) { + this._dataVolumeSize = value; + } + public resetDataVolumeSize() { + this._dataVolumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeSizeInput() { + return this._dataVolumeSize; + } + + // data_volume_type - computed: false, optional: true, required: false + private _dataVolumeType?: string; + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + public set dataVolumeType(value: string) { + this._dataVolumeType = value; + } + public resetDataVolumeType() { + this._dataVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeTypeInput() { + return this._dataVolumeType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // host_ips - computed: true, optional: false, required: false + public get hostIps() { + return this.getListAttribute('host_ips'); + } + + // node_number - computed: false, optional: false, required: true + private _nodeNumber?: number; + public get nodeNumber() { + return this.getNumberAttribute('node_number'); + } + public set nodeNumber(value: number) { + this._nodeNumber = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumberInput() { + return this._nodeNumber; + } + + // root_volume_size - computed: false, optional: false, required: true + private _rootVolumeSize?: number; + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + public set rootVolumeSize(value: number) { + this._rootVolumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeSizeInput() { + return this._rootVolumeSize; + } + + // root_volume_type - computed: false, optional: false, required: true + private _rootVolumeType?: string; + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + public set rootVolumeType(value: string) { + this._rootVolumeType = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeTypeInput() { + return this._rootVolumeType; + } +} +export interface MapreduceClusterBootstrapScripts { + /** + * Whether the bootstrap action script runs only on active master nodes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#active_master MapreduceCluster#active_master} + */ + readonly activeMaster?: boolean | cdktf.IResolvable; + /** + * Whether the bootstrap action script is executed before component start. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#before_component_start MapreduceCluster#before_component_start} + */ + readonly beforeComponentStart?: boolean | cdktf.IResolvable; + /** + * Whether the bootstrap action script involves root user operations. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#execute_need_sudo_root MapreduceCluster#execute_need_sudo_root} + */ + readonly executeNeedSudoRoot?: boolean | cdktf.IResolvable; + /** + * The action after the bootstrap action script fails to be executed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#fail_action MapreduceCluster#fail_action} + */ + readonly failAction: string; + /** + * Name of a bootstrap action script. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#name MapreduceCluster#name} + */ + readonly name: string; + /** + * Name of the node group where the bootstrap action script is executed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#nodes MapreduceCluster#nodes} + */ + readonly nodes: string[]; + /** + * Bootstrap action script parameters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#parameters MapreduceCluster#parameters} + */ + readonly parameters?: string; + /** + * Path of a bootstrap action script. Set this parameter to an OBS bucket path or a local VM path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#uri MapreduceCluster#uri} + */ + readonly uri: string; +} + +export function mapreduceClusterBootstrapScriptsToTerraform(struct?: MapreduceClusterBootstrapScripts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + active_master: cdktf.booleanToTerraform(struct!.activeMaster), + before_component_start: cdktf.booleanToTerraform(struct!.beforeComponentStart), + execute_need_sudo_root: cdktf.booleanToTerraform(struct!.executeNeedSudoRoot), + fail_action: cdktf.stringToTerraform(struct!.failAction), + name: cdktf.stringToTerraform(struct!.name), + nodes: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.nodes), + parameters: cdktf.stringToTerraform(struct!.parameters), + uri: cdktf.stringToTerraform(struct!.uri), + } +} + + +export function mapreduceClusterBootstrapScriptsToHclTerraform(struct?: MapreduceClusterBootstrapScripts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + active_master: { + value: cdktf.booleanToHclTerraform(struct!.activeMaster), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + before_component_start: { + value: cdktf.booleanToHclTerraform(struct!.beforeComponentStart), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + execute_need_sudo_root: { + value: cdktf.booleanToHclTerraform(struct!.executeNeedSudoRoot), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + fail_action: { + value: cdktf.stringToHclTerraform(struct!.failAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nodes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.nodes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + parameters: { + value: cdktf.stringToHclTerraform(struct!.parameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + uri: { + value: cdktf.stringToHclTerraform(struct!.uri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterBootstrapScriptsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceClusterBootstrapScripts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._activeMaster !== undefined) { + hasAnyValues = true; + internalValueResult.activeMaster = this._activeMaster; + } + if (this._beforeComponentStart !== undefined) { + hasAnyValues = true; + internalValueResult.beforeComponentStart = this._beforeComponentStart; + } + if (this._executeNeedSudoRoot !== undefined) { + hasAnyValues = true; + internalValueResult.executeNeedSudoRoot = this._executeNeedSudoRoot; + } + if (this._failAction !== undefined) { + hasAnyValues = true; + internalValueResult.failAction = this._failAction; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._nodes !== undefined) { + hasAnyValues = true; + internalValueResult.nodes = this._nodes; + } + if (this._parameters !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters; + } + if (this._uri !== undefined) { + hasAnyValues = true; + internalValueResult.uri = this._uri; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterBootstrapScripts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._activeMaster = undefined; + this._beforeComponentStart = undefined; + this._executeNeedSudoRoot = undefined; + this._failAction = undefined; + this._name = undefined; + this._nodes = undefined; + this._parameters = undefined; + this._uri = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._activeMaster = value.activeMaster; + this._beforeComponentStart = value.beforeComponentStart; + this._executeNeedSudoRoot = value.executeNeedSudoRoot; + this._failAction = value.failAction; + this._name = value.name; + this._nodes = value.nodes; + this._parameters = value.parameters; + this._uri = value.uri; + } + } + + // active_master - computed: true, optional: true, required: false + private _activeMaster?: boolean | cdktf.IResolvable; + public get activeMaster() { + return this.getBooleanAttribute('active_master'); + } + public set activeMaster(value: boolean | cdktf.IResolvable) { + this._activeMaster = value; + } + public resetActiveMaster() { + this._activeMaster = undefined; + } + // Temporarily expose input value. Use with caution. + public get activeMasterInput() { + return this._activeMaster; + } + + // before_component_start - computed: true, optional: true, required: false + private _beforeComponentStart?: boolean | cdktf.IResolvable; + public get beforeComponentStart() { + return this.getBooleanAttribute('before_component_start'); + } + public set beforeComponentStart(value: boolean | cdktf.IResolvable) { + this._beforeComponentStart = value; + } + public resetBeforeComponentStart() { + this._beforeComponentStart = undefined; + } + // Temporarily expose input value. Use with caution. + public get beforeComponentStartInput() { + return this._beforeComponentStart; + } + + // execute_need_sudo_root - computed: true, optional: true, required: false + private _executeNeedSudoRoot?: boolean | cdktf.IResolvable; + public get executeNeedSudoRoot() { + return this.getBooleanAttribute('execute_need_sudo_root'); + } + public set executeNeedSudoRoot(value: boolean | cdktf.IResolvable) { + this._executeNeedSudoRoot = value; + } + public resetExecuteNeedSudoRoot() { + this._executeNeedSudoRoot = undefined; + } + // Temporarily expose input value. Use with caution. + public get executeNeedSudoRootInput() { + return this._executeNeedSudoRoot; + } + + // fail_action - computed: false, optional: false, required: true + private _failAction?: string; + public get failAction() { + return this.getStringAttribute('fail_action'); + } + public set failAction(value: string) { + this._failAction = value; + } + // Temporarily expose input value. Use with caution. + public get failActionInput() { + return this._failAction; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: false, optional: false, required: true + private _nodes?: string[]; + public get nodes() { + return this.getListAttribute('nodes'); + } + public set nodes(value: string[]) { + this._nodes = value; + } + // Temporarily expose input value. Use with caution. + public get nodesInput() { + return this._nodes; + } + + // parameters - computed: false, optional: true, required: false + private _parameters?: string; + public get parameters() { + return this.getStringAttribute('parameters'); + } + public set parameters(value: string) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // uri - computed: false, optional: false, required: true + private _uri?: string; + public get uri() { + return this.getStringAttribute('uri'); + } + public set uri(value: string) { + this._uri = value; + } + // Temporarily expose input value. Use with caution. + public get uriInput() { + return this._uri; + } +} + +export class MapreduceClusterBootstrapScriptsList extends cdktf.ComplexList { + public internalValue? : MapreduceClusterBootstrapScripts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceClusterBootstrapScriptsOutputReference { + return new MapreduceClusterBootstrapScriptsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceClusterComponentConfigsConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#config_file_name MapreduceCluster#config_file_name} + */ + readonly configFileName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#key MapreduceCluster#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#value MapreduceCluster#value} + */ + readonly value: string; +} + +export function mapreduceClusterComponentConfigsConfigsToTerraform(struct?: MapreduceClusterComponentConfigsConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + config_file_name: cdktf.stringToTerraform(struct!.configFileName), + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function mapreduceClusterComponentConfigsConfigsToHclTerraform(struct?: MapreduceClusterComponentConfigsConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + config_file_name: { + value: cdktf.stringToHclTerraform(struct!.configFileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterComponentConfigsConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceClusterComponentConfigsConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._configFileName !== undefined) { + hasAnyValues = true; + internalValueResult.configFileName = this._configFileName; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterComponentConfigsConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._configFileName = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._configFileName = value.configFileName; + this._key = value.key; + this._value = value.value; + } + } + + // config_file_name - computed: false, optional: false, required: true + private _configFileName?: string; + public get configFileName() { + return this.getStringAttribute('config_file_name'); + } + public set configFileName(value: string) { + this._configFileName = value; + } + // Temporarily expose input value. Use with caution. + public get configFileNameInput() { + return this._configFileName; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class MapreduceClusterComponentConfigsConfigsList extends cdktf.ComplexList { + public internalValue? : MapreduceClusterComponentConfigsConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceClusterComponentConfigsConfigsOutputReference { + return new MapreduceClusterComponentConfigsConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceClusterComponentConfigs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#name MapreduceCluster#name} + */ + readonly name: string; + /** + * configs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#configs MapreduceCluster#configs} + */ + readonly configs: MapreduceClusterComponentConfigsConfigs[] | cdktf.IResolvable; +} + +export function mapreduceClusterComponentConfigsToTerraform(struct?: MapreduceClusterComponentConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + configs: cdktf.listMapper(mapreduceClusterComponentConfigsConfigsToTerraform, true)(struct!.configs), + } +} + + +export function mapreduceClusterComponentConfigsToHclTerraform(struct?: MapreduceClusterComponentConfigs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configs: { + value: cdktf.listMapperHcl(mapreduceClusterComponentConfigsConfigsToHclTerraform, true)(struct!.configs), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterComponentConfigsConfigsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterComponentConfigsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceClusterComponentConfigs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._configs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.configs = this._configs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterComponentConfigs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._configs.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._configs.internalValue = value.configs; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // configs - computed: false, optional: false, required: true + private _configs = new MapreduceClusterComponentConfigsConfigsList(this, "configs", false); + public get configs() { + return this._configs; + } + public putConfigs(value: MapreduceClusterComponentConfigsConfigs[] | cdktf.IResolvable) { + this._configs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configsInput() { + return this._configs.internalValue; + } +} + +export class MapreduceClusterComponentConfigsList extends cdktf.ComplexList { + public internalValue? : MapreduceClusterComponentConfigs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceClusterComponentConfigsOutputReference { + return new MapreduceClusterComponentConfigsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceClusterCustomNodes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#assigned_roles MapreduceCluster#assigned_roles} + */ + readonly assignedRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_count MapreduceCluster#data_volume_count} + */ + readonly dataVolumeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_size MapreduceCluster#data_volume_size} + */ + readonly dataVolumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_type MapreduceCluster#data_volume_type} + */ + readonly dataVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#flavor MapreduceCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#group_name MapreduceCluster#group_name} + */ + readonly groupName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_number MapreduceCluster#node_number} + */ + readonly nodeNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_size MapreduceCluster#root_volume_size} + */ + readonly rootVolumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_type MapreduceCluster#root_volume_type} + */ + readonly rootVolumeType: string; +} + +export function mapreduceClusterCustomNodesToTerraform(struct?: MapreduceClusterCustomNodes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + assigned_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.assignedRoles), + data_volume_count: cdktf.numberToTerraform(struct!.dataVolumeCount), + data_volume_size: cdktf.numberToTerraform(struct!.dataVolumeSize), + data_volume_type: cdktf.stringToTerraform(struct!.dataVolumeType), + flavor: cdktf.stringToTerraform(struct!.flavor), + group_name: cdktf.stringToTerraform(struct!.groupName), + node_number: cdktf.numberToTerraform(struct!.nodeNumber), + root_volume_size: cdktf.numberToTerraform(struct!.rootVolumeSize), + root_volume_type: cdktf.stringToTerraform(struct!.rootVolumeType), + } +} + + +export function mapreduceClusterCustomNodesToHclTerraform(struct?: MapreduceClusterCustomNodes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + assigned_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.assignedRoles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + data_volume_count: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_size: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_type: { + value: cdktf.stringToHclTerraform(struct!.dataVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_name: { + value: cdktf.stringToHclTerraform(struct!.groupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_number: { + value: cdktf.numberToHclTerraform(struct!.nodeNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_size: { + value: cdktf.numberToHclTerraform(struct!.rootVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_type: { + value: cdktf.stringToHclTerraform(struct!.rootVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterCustomNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceClusterCustomNodes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._assignedRoles !== undefined) { + hasAnyValues = true; + internalValueResult.assignedRoles = this._assignedRoles; + } + if (this._dataVolumeCount !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeCount = this._dataVolumeCount; + } + if (this._dataVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeSize = this._dataVolumeSize; + } + if (this._dataVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeType = this._dataVolumeType; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._groupName !== undefined) { + hasAnyValues = true; + internalValueResult.groupName = this._groupName; + } + if (this._nodeNumber !== undefined) { + hasAnyValues = true; + internalValueResult.nodeNumber = this._nodeNumber; + } + if (this._rootVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeSize = this._rootVolumeSize; + } + if (this._rootVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeType = this._rootVolumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterCustomNodes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._assignedRoles = undefined; + this._dataVolumeCount = undefined; + this._dataVolumeSize = undefined; + this._dataVolumeType = undefined; + this._flavor = undefined; + this._groupName = undefined; + this._nodeNumber = undefined; + this._rootVolumeSize = undefined; + this._rootVolumeType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._assignedRoles = value.assignedRoles; + this._dataVolumeCount = value.dataVolumeCount; + this._dataVolumeSize = value.dataVolumeSize; + this._dataVolumeType = value.dataVolumeType; + this._flavor = value.flavor; + this._groupName = value.groupName; + this._nodeNumber = value.nodeNumber; + this._rootVolumeSize = value.rootVolumeSize; + this._rootVolumeType = value.rootVolumeType; + } + } + + // assigned_roles - computed: false, optional: true, required: false + private _assignedRoles?: string[]; + public get assignedRoles() { + return this.getListAttribute('assigned_roles'); + } + public set assignedRoles(value: string[]) { + this._assignedRoles = value; + } + public resetAssignedRoles() { + this._assignedRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignedRolesInput() { + return this._assignedRoles; + } + + // data_volume_count - computed: false, optional: false, required: true + private _dataVolumeCount?: number; + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + public set dataVolumeCount(value: number) { + this._dataVolumeCount = value; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeCountInput() { + return this._dataVolumeCount; + } + + // data_volume_size - computed: false, optional: true, required: false + private _dataVolumeSize?: number; + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + public set dataVolumeSize(value: number) { + this._dataVolumeSize = value; + } + public resetDataVolumeSize() { + this._dataVolumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeSizeInput() { + return this._dataVolumeSize; + } + + // data_volume_type - computed: false, optional: true, required: false + private _dataVolumeType?: string; + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + public set dataVolumeType(value: string) { + this._dataVolumeType = value; + } + public resetDataVolumeType() { + this._dataVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeTypeInput() { + return this._dataVolumeType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // group_name - computed: false, optional: false, required: true + private _groupName?: string; + public get groupName() { + return this.getStringAttribute('group_name'); + } + public set groupName(value: string) { + this._groupName = value; + } + // Temporarily expose input value. Use with caution. + public get groupNameInput() { + return this._groupName; + } + + // host_ips - computed: true, optional: false, required: false + public get hostIps() { + return this.getListAttribute('host_ips'); + } + + // node_number - computed: false, optional: false, required: true + private _nodeNumber?: number; + public get nodeNumber() { + return this.getNumberAttribute('node_number'); + } + public set nodeNumber(value: number) { + this._nodeNumber = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumberInput() { + return this._nodeNumber; + } + + // root_volume_size - computed: false, optional: false, required: true + private _rootVolumeSize?: number; + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + public set rootVolumeSize(value: number) { + this._rootVolumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeSizeInput() { + return this._rootVolumeSize; + } + + // root_volume_type - computed: false, optional: false, required: true + private _rootVolumeType?: string; + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + public set rootVolumeType(value: string) { + this._rootVolumeType = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeTypeInput() { + return this._rootVolumeType; + } +} + +export class MapreduceClusterCustomNodesList extends cdktf.ComplexList { + public internalValue? : MapreduceClusterCustomNodes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceClusterCustomNodesOutputReference { + return new MapreduceClusterCustomNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceClusterExternalDatasources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#component_name MapreduceCluster#component_name} + */ + readonly componentName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_connection_id MapreduceCluster#data_connection_id} + */ + readonly dataConnectionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#role_type MapreduceCluster#role_type} + */ + readonly roleType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#source_type MapreduceCluster#source_type} + */ + readonly sourceType: string; +} + +export function mapreduceClusterExternalDatasourcesToTerraform(struct?: MapreduceClusterExternalDatasources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + component_name: cdktf.stringToTerraform(struct!.componentName), + data_connection_id: cdktf.stringToTerraform(struct!.dataConnectionId), + role_type: cdktf.stringToTerraform(struct!.roleType), + source_type: cdktf.stringToTerraform(struct!.sourceType), + } +} + + +export function mapreduceClusterExternalDatasourcesToHclTerraform(struct?: MapreduceClusterExternalDatasources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + component_name: { + value: cdktf.stringToHclTerraform(struct!.componentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_connection_id: { + value: cdktf.stringToHclTerraform(struct!.dataConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role_type: { + value: cdktf.stringToHclTerraform(struct!.roleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(struct!.sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterExternalDatasourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceClusterExternalDatasources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._componentName !== undefined) { + hasAnyValues = true; + internalValueResult.componentName = this._componentName; + } + if (this._dataConnectionId !== undefined) { + hasAnyValues = true; + internalValueResult.dataConnectionId = this._dataConnectionId; + } + if (this._roleType !== undefined) { + hasAnyValues = true; + internalValueResult.roleType = this._roleType; + } + if (this._sourceType !== undefined) { + hasAnyValues = true; + internalValueResult.sourceType = this._sourceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterExternalDatasources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._componentName = undefined; + this._dataConnectionId = undefined; + this._roleType = undefined; + this._sourceType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._componentName = value.componentName; + this._dataConnectionId = value.dataConnectionId; + this._roleType = value.roleType; + this._sourceType = value.sourceType; + } + } + + // component_name - computed: false, optional: false, required: true + private _componentName?: string; + public get componentName() { + return this.getStringAttribute('component_name'); + } + public set componentName(value: string) { + this._componentName = value; + } + // Temporarily expose input value. Use with caution. + public get componentNameInput() { + return this._componentName; + } + + // data_connection_id - computed: false, optional: true, required: false + private _dataConnectionId?: string; + public get dataConnectionId() { + return this.getStringAttribute('data_connection_id'); + } + public set dataConnectionId(value: string) { + this._dataConnectionId = value; + } + public resetDataConnectionId() { + this._dataConnectionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataConnectionIdInput() { + return this._dataConnectionId; + } + + // role_type - computed: false, optional: false, required: true + private _roleType?: string; + public get roleType() { + return this.getStringAttribute('role_type'); + } + public set roleType(value: string) { + this._roleType = value; + } + // Temporarily expose input value. Use with caution. + public get roleTypeInput() { + return this._roleType; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } +} + +export class MapreduceClusterExternalDatasourcesList extends cdktf.ComplexList { + public internalValue? : MapreduceClusterExternalDatasources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceClusterExternalDatasourcesOutputReference { + return new MapreduceClusterExternalDatasourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceClusterMasterNodes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#assigned_roles MapreduceCluster#assigned_roles} + */ + readonly assignedRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_count MapreduceCluster#data_volume_count} + */ + readonly dataVolumeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_size MapreduceCluster#data_volume_size} + */ + readonly dataVolumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_type MapreduceCluster#data_volume_type} + */ + readonly dataVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#flavor MapreduceCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_number MapreduceCluster#node_number} + */ + readonly nodeNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_size MapreduceCluster#root_volume_size} + */ + readonly rootVolumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_type MapreduceCluster#root_volume_type} + */ + readonly rootVolumeType: string; +} + +export function mapreduceClusterMasterNodesToTerraform(struct?: MapreduceClusterMasterNodesOutputReference | MapreduceClusterMasterNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + assigned_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.assignedRoles), + data_volume_count: cdktf.numberToTerraform(struct!.dataVolumeCount), + data_volume_size: cdktf.numberToTerraform(struct!.dataVolumeSize), + data_volume_type: cdktf.stringToTerraform(struct!.dataVolumeType), + flavor: cdktf.stringToTerraform(struct!.flavor), + node_number: cdktf.numberToTerraform(struct!.nodeNumber), + root_volume_size: cdktf.numberToTerraform(struct!.rootVolumeSize), + root_volume_type: cdktf.stringToTerraform(struct!.rootVolumeType), + } +} + + +export function mapreduceClusterMasterNodesToHclTerraform(struct?: MapreduceClusterMasterNodesOutputReference | MapreduceClusterMasterNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + assigned_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.assignedRoles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + data_volume_count: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_size: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_type: { + value: cdktf.stringToHclTerraform(struct!.dataVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_number: { + value: cdktf.numberToHclTerraform(struct!.nodeNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_size: { + value: cdktf.numberToHclTerraform(struct!.rootVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_type: { + value: cdktf.stringToHclTerraform(struct!.rootVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterMasterNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceClusterMasterNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._assignedRoles !== undefined) { + hasAnyValues = true; + internalValueResult.assignedRoles = this._assignedRoles; + } + if (this._dataVolumeCount !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeCount = this._dataVolumeCount; + } + if (this._dataVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeSize = this._dataVolumeSize; + } + if (this._dataVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeType = this._dataVolumeType; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._nodeNumber !== undefined) { + hasAnyValues = true; + internalValueResult.nodeNumber = this._nodeNumber; + } + if (this._rootVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeSize = this._rootVolumeSize; + } + if (this._rootVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeType = this._rootVolumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterMasterNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._assignedRoles = undefined; + this._dataVolumeCount = undefined; + this._dataVolumeSize = undefined; + this._dataVolumeType = undefined; + this._flavor = undefined; + this._nodeNumber = undefined; + this._rootVolumeSize = undefined; + this._rootVolumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._assignedRoles = value.assignedRoles; + this._dataVolumeCount = value.dataVolumeCount; + this._dataVolumeSize = value.dataVolumeSize; + this._dataVolumeType = value.dataVolumeType; + this._flavor = value.flavor; + this._nodeNumber = value.nodeNumber; + this._rootVolumeSize = value.rootVolumeSize; + this._rootVolumeType = value.rootVolumeType; + } + } + + // assigned_roles - computed: false, optional: true, required: false + private _assignedRoles?: string[]; + public get assignedRoles() { + return this.getListAttribute('assigned_roles'); + } + public set assignedRoles(value: string[]) { + this._assignedRoles = value; + } + public resetAssignedRoles() { + this._assignedRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignedRolesInput() { + return this._assignedRoles; + } + + // data_volume_count - computed: false, optional: false, required: true + private _dataVolumeCount?: number; + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + public set dataVolumeCount(value: number) { + this._dataVolumeCount = value; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeCountInput() { + return this._dataVolumeCount; + } + + // data_volume_size - computed: false, optional: true, required: false + private _dataVolumeSize?: number; + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + public set dataVolumeSize(value: number) { + this._dataVolumeSize = value; + } + public resetDataVolumeSize() { + this._dataVolumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeSizeInput() { + return this._dataVolumeSize; + } + + // data_volume_type - computed: false, optional: true, required: false + private _dataVolumeType?: string; + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + public set dataVolumeType(value: string) { + this._dataVolumeType = value; + } + public resetDataVolumeType() { + this._dataVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeTypeInput() { + return this._dataVolumeType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // host_ips - computed: true, optional: false, required: false + public get hostIps() { + return this.getListAttribute('host_ips'); + } + + // node_number - computed: false, optional: false, required: true + private _nodeNumber?: number; + public get nodeNumber() { + return this.getNumberAttribute('node_number'); + } + public set nodeNumber(value: number) { + this._nodeNumber = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumberInput() { + return this._nodeNumber; + } + + // root_volume_size - computed: false, optional: false, required: true + private _rootVolumeSize?: number; + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + public set rootVolumeSize(value: number) { + this._rootVolumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeSizeInput() { + return this._rootVolumeSize; + } + + // root_volume_type - computed: false, optional: false, required: true + private _rootVolumeType?: string; + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + public set rootVolumeType(value: string) { + this._rootVolumeType = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeTypeInput() { + return this._rootVolumeType; + } +} +export interface MapreduceClusterSmnNotify { + /** + * The subscription rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#subscription_name MapreduceCluster#subscription_name} + */ + readonly subscriptionName: string; + /** + * The Uniform Resource Name (URN) of the topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#topic_urn MapreduceCluster#topic_urn} + */ + readonly topicUrn: string; +} + +export function mapreduceClusterSmnNotifyToTerraform(struct?: MapreduceClusterSmnNotifyOutputReference | MapreduceClusterSmnNotify): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subscription_name: cdktf.stringToTerraform(struct!.subscriptionName), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function mapreduceClusterSmnNotifyToHclTerraform(struct?: MapreduceClusterSmnNotifyOutputReference | MapreduceClusterSmnNotify): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subscription_name: { + value: cdktf.stringToHclTerraform(struct!.subscriptionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterSmnNotifyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceClusterSmnNotify | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subscriptionName !== undefined) { + hasAnyValues = true; + internalValueResult.subscriptionName = this._subscriptionName; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterSmnNotify | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._subscriptionName = undefined; + this._topicUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._subscriptionName = value.subscriptionName; + this._topicUrn = value.topicUrn; + } + } + + // subscription_name - computed: false, optional: false, required: true + private _subscriptionName?: string; + public get subscriptionName() { + return this.getStringAttribute('subscription_name'); + } + public set subscriptionName(value: string) { + this._subscriptionName = value; + } + // Temporarily expose input value. Use with caution. + public get subscriptionNameInput() { + return this._subscriptionName; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} +export interface MapreduceClusterStreamingCoreNodes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#assigned_roles MapreduceCluster#assigned_roles} + */ + readonly assignedRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_count MapreduceCluster#data_volume_count} + */ + readonly dataVolumeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_size MapreduceCluster#data_volume_size} + */ + readonly dataVolumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_type MapreduceCluster#data_volume_type} + */ + readonly dataVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#flavor MapreduceCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_number MapreduceCluster#node_number} + */ + readonly nodeNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_size MapreduceCluster#root_volume_size} + */ + readonly rootVolumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_type MapreduceCluster#root_volume_type} + */ + readonly rootVolumeType: string; +} + +export function mapreduceClusterStreamingCoreNodesToTerraform(struct?: MapreduceClusterStreamingCoreNodesOutputReference | MapreduceClusterStreamingCoreNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + assigned_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.assignedRoles), + data_volume_count: cdktf.numberToTerraform(struct!.dataVolumeCount), + data_volume_size: cdktf.numberToTerraform(struct!.dataVolumeSize), + data_volume_type: cdktf.stringToTerraform(struct!.dataVolumeType), + flavor: cdktf.stringToTerraform(struct!.flavor), + node_number: cdktf.numberToTerraform(struct!.nodeNumber), + root_volume_size: cdktf.numberToTerraform(struct!.rootVolumeSize), + root_volume_type: cdktf.stringToTerraform(struct!.rootVolumeType), + } +} + + +export function mapreduceClusterStreamingCoreNodesToHclTerraform(struct?: MapreduceClusterStreamingCoreNodesOutputReference | MapreduceClusterStreamingCoreNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + assigned_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.assignedRoles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + data_volume_count: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_size: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_type: { + value: cdktf.stringToHclTerraform(struct!.dataVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_number: { + value: cdktf.numberToHclTerraform(struct!.nodeNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_size: { + value: cdktf.numberToHclTerraform(struct!.rootVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_type: { + value: cdktf.stringToHclTerraform(struct!.rootVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterStreamingCoreNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceClusterStreamingCoreNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._assignedRoles !== undefined) { + hasAnyValues = true; + internalValueResult.assignedRoles = this._assignedRoles; + } + if (this._dataVolumeCount !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeCount = this._dataVolumeCount; + } + if (this._dataVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeSize = this._dataVolumeSize; + } + if (this._dataVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeType = this._dataVolumeType; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._nodeNumber !== undefined) { + hasAnyValues = true; + internalValueResult.nodeNumber = this._nodeNumber; + } + if (this._rootVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeSize = this._rootVolumeSize; + } + if (this._rootVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeType = this._rootVolumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterStreamingCoreNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._assignedRoles = undefined; + this._dataVolumeCount = undefined; + this._dataVolumeSize = undefined; + this._dataVolumeType = undefined; + this._flavor = undefined; + this._nodeNumber = undefined; + this._rootVolumeSize = undefined; + this._rootVolumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._assignedRoles = value.assignedRoles; + this._dataVolumeCount = value.dataVolumeCount; + this._dataVolumeSize = value.dataVolumeSize; + this._dataVolumeType = value.dataVolumeType; + this._flavor = value.flavor; + this._nodeNumber = value.nodeNumber; + this._rootVolumeSize = value.rootVolumeSize; + this._rootVolumeType = value.rootVolumeType; + } + } + + // assigned_roles - computed: false, optional: true, required: false + private _assignedRoles?: string[]; + public get assignedRoles() { + return this.getListAttribute('assigned_roles'); + } + public set assignedRoles(value: string[]) { + this._assignedRoles = value; + } + public resetAssignedRoles() { + this._assignedRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignedRolesInput() { + return this._assignedRoles; + } + + // data_volume_count - computed: false, optional: false, required: true + private _dataVolumeCount?: number; + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + public set dataVolumeCount(value: number) { + this._dataVolumeCount = value; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeCountInput() { + return this._dataVolumeCount; + } + + // data_volume_size - computed: false, optional: true, required: false + private _dataVolumeSize?: number; + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + public set dataVolumeSize(value: number) { + this._dataVolumeSize = value; + } + public resetDataVolumeSize() { + this._dataVolumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeSizeInput() { + return this._dataVolumeSize; + } + + // data_volume_type - computed: false, optional: true, required: false + private _dataVolumeType?: string; + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + public set dataVolumeType(value: string) { + this._dataVolumeType = value; + } + public resetDataVolumeType() { + this._dataVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeTypeInput() { + return this._dataVolumeType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // host_ips - computed: true, optional: false, required: false + public get hostIps() { + return this.getListAttribute('host_ips'); + } + + // node_number - computed: false, optional: false, required: true + private _nodeNumber?: number; + public get nodeNumber() { + return this.getNumberAttribute('node_number'); + } + public set nodeNumber(value: number) { + this._nodeNumber = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumberInput() { + return this._nodeNumber; + } + + // root_volume_size - computed: false, optional: false, required: true + private _rootVolumeSize?: number; + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + public set rootVolumeSize(value: number) { + this._rootVolumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeSizeInput() { + return this._rootVolumeSize; + } + + // root_volume_type - computed: false, optional: false, required: true + private _rootVolumeType?: string; + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + public set rootVolumeType(value: string) { + this._rootVolumeType = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeTypeInput() { + return this._rootVolumeType; + } +} +export interface MapreduceClusterStreamingTaskNodes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#assigned_roles MapreduceCluster#assigned_roles} + */ + readonly assignedRoles?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_count MapreduceCluster#data_volume_count} + */ + readonly dataVolumeCount: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_size MapreduceCluster#data_volume_size} + */ + readonly dataVolumeSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#data_volume_type MapreduceCluster#data_volume_type} + */ + readonly dataVolumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#flavor MapreduceCluster#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#node_number MapreduceCluster#node_number} + */ + readonly nodeNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_size MapreduceCluster#root_volume_size} + */ + readonly rootVolumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#root_volume_type MapreduceCluster#root_volume_type} + */ + readonly rootVolumeType: string; +} + +export function mapreduceClusterStreamingTaskNodesToTerraform(struct?: MapreduceClusterStreamingTaskNodesOutputReference | MapreduceClusterStreamingTaskNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + assigned_roles: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.assignedRoles), + data_volume_count: cdktf.numberToTerraform(struct!.dataVolumeCount), + data_volume_size: cdktf.numberToTerraform(struct!.dataVolumeSize), + data_volume_type: cdktf.stringToTerraform(struct!.dataVolumeType), + flavor: cdktf.stringToTerraform(struct!.flavor), + node_number: cdktf.numberToTerraform(struct!.nodeNumber), + root_volume_size: cdktf.numberToTerraform(struct!.rootVolumeSize), + root_volume_type: cdktf.stringToTerraform(struct!.rootVolumeType), + } +} + + +export function mapreduceClusterStreamingTaskNodesToHclTerraform(struct?: MapreduceClusterStreamingTaskNodesOutputReference | MapreduceClusterStreamingTaskNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + assigned_roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.assignedRoles), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + data_volume_count: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_size: { + value: cdktf.numberToHclTerraform(struct!.dataVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_volume_type: { + value: cdktf.stringToHclTerraform(struct!.dataVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(struct!.flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_number: { + value: cdktf.numberToHclTerraform(struct!.nodeNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_size: { + value: cdktf.numberToHclTerraform(struct!.rootVolumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + root_volume_type: { + value: cdktf.stringToHclTerraform(struct!.rootVolumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterStreamingTaskNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceClusterStreamingTaskNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._assignedRoles !== undefined) { + hasAnyValues = true; + internalValueResult.assignedRoles = this._assignedRoles; + } + if (this._dataVolumeCount !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeCount = this._dataVolumeCount; + } + if (this._dataVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeSize = this._dataVolumeSize; + } + if (this._dataVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.dataVolumeType = this._dataVolumeType; + } + if (this._flavor !== undefined) { + hasAnyValues = true; + internalValueResult.flavor = this._flavor; + } + if (this._nodeNumber !== undefined) { + hasAnyValues = true; + internalValueResult.nodeNumber = this._nodeNumber; + } + if (this._rootVolumeSize !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeSize = this._rootVolumeSize; + } + if (this._rootVolumeType !== undefined) { + hasAnyValues = true; + internalValueResult.rootVolumeType = this._rootVolumeType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterStreamingTaskNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._assignedRoles = undefined; + this._dataVolumeCount = undefined; + this._dataVolumeSize = undefined; + this._dataVolumeType = undefined; + this._flavor = undefined; + this._nodeNumber = undefined; + this._rootVolumeSize = undefined; + this._rootVolumeType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._assignedRoles = value.assignedRoles; + this._dataVolumeCount = value.dataVolumeCount; + this._dataVolumeSize = value.dataVolumeSize; + this._dataVolumeType = value.dataVolumeType; + this._flavor = value.flavor; + this._nodeNumber = value.nodeNumber; + this._rootVolumeSize = value.rootVolumeSize; + this._rootVolumeType = value.rootVolumeType; + } + } + + // assigned_roles - computed: false, optional: true, required: false + private _assignedRoles?: string[]; + public get assignedRoles() { + return this.getListAttribute('assigned_roles'); + } + public set assignedRoles(value: string[]) { + this._assignedRoles = value; + } + public resetAssignedRoles() { + this._assignedRoles = undefined; + } + // Temporarily expose input value. Use with caution. + public get assignedRolesInput() { + return this._assignedRoles; + } + + // data_volume_count - computed: false, optional: false, required: true + private _dataVolumeCount?: number; + public get dataVolumeCount() { + return this.getNumberAttribute('data_volume_count'); + } + public set dataVolumeCount(value: number) { + this._dataVolumeCount = value; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeCountInput() { + return this._dataVolumeCount; + } + + // data_volume_size - computed: false, optional: true, required: false + private _dataVolumeSize?: number; + public get dataVolumeSize() { + return this.getNumberAttribute('data_volume_size'); + } + public set dataVolumeSize(value: number) { + this._dataVolumeSize = value; + } + public resetDataVolumeSize() { + this._dataVolumeSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeSizeInput() { + return this._dataVolumeSize; + } + + // data_volume_type - computed: false, optional: true, required: false + private _dataVolumeType?: string; + public get dataVolumeType() { + return this.getStringAttribute('data_volume_type'); + } + public set dataVolumeType(value: string) { + this._dataVolumeType = value; + } + public resetDataVolumeType() { + this._dataVolumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeTypeInput() { + return this._dataVolumeType; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // host_ips - computed: true, optional: false, required: false + public get hostIps() { + return this.getListAttribute('host_ips'); + } + + // node_number - computed: false, optional: false, required: true + private _nodeNumber?: number; + public get nodeNumber() { + return this.getNumberAttribute('node_number'); + } + public set nodeNumber(value: number) { + this._nodeNumber = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumberInput() { + return this._nodeNumber; + } + + // root_volume_size - computed: false, optional: false, required: true + private _rootVolumeSize?: number; + public get rootVolumeSize() { + return this.getNumberAttribute('root_volume_size'); + } + public set rootVolumeSize(value: number) { + this._rootVolumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeSizeInput() { + return this._rootVolumeSize; + } + + // root_volume_type - computed: false, optional: false, required: true + private _rootVolumeType?: string; + public get rootVolumeType() { + return this.getStringAttribute('root_volume_type'); + } + public set rootVolumeType(value: string) { + this._rootVolumeType = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeTypeInput() { + return this._rootVolumeType; + } +} +export interface MapreduceClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#create MapreduceCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#delete MapreduceCluster#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#update MapreduceCluster#update} + */ + readonly update?: string; +} + +export function mapreduceClusterTimeoutsToTerraform(struct?: MapreduceClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function mapreduceClusterTimeoutsToHclTerraform(struct?: MapreduceClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): MapreduceClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster huaweicloud_mapreduce_cluster} +*/ +export class MapreduceCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mapreduce_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MapreduceCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MapreduceCluster to import + * @param importFromId The id of the existing MapreduceCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MapreduceCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mapreduce_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_cluster huaweicloud_mapreduce_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MapreduceClusterConfig + */ + public constructor(scope: Construct, id: string, config: MapreduceClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mapreduce_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._componentList = config.componentList; + this._eipId = config.eipId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._logCollection = config.logCollection; + this._managerAdminPass = config.managerAdminPass; + this._name = config.name; + this._nodeAdminPass = config.nodeAdminPass; + this._nodeKeyPair = config.nodeKeyPair; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._publicIp = config.publicIp; + this._region = config.region; + this._safeMode = config.safeMode; + this._securityGroupIds = config.securityGroupIds; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._templateId = config.templateId; + this._type = config.type; + this._version = config.version; + this._vpcId = config.vpcId; + this._analysisCoreNodes.internalValue = config.analysisCoreNodes; + this._analysisTaskNodes.internalValue = config.analysisTaskNodes; + this._bootstrapScripts.internalValue = config.bootstrapScripts; + this._componentConfigs.internalValue = config.componentConfigs; + this._customNodes.internalValue = config.customNodes; + this._externalDatasources.internalValue = config.externalDatasources; + this._masterNodes.internalValue = config.masterNodes; + this._smnNotify.internalValue = config.smnNotify; + this._streamingCoreNodes.internalValue = config.streamingCoreNodes; + this._streamingTaskNodes.internalValue = config.streamingTaskNodes; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // charging_start_time - computed: true, optional: false, required: false + public get chargingStartTime() { + return this.getStringAttribute('charging_start_time'); + } + + // component_list - computed: false, optional: false, required: true + private _componentList?: string[]; + public get componentList() { + return cdktf.Fn.tolist(this.getListAttribute('component_list')); + } + public set componentList(value: string[]) { + this._componentList = value; + } + // Temporarily expose input value. Use with caution. + public get componentListInput() { + return this._componentList; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // eip_id - computed: true, optional: true, required: false + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + public resetEipId() { + this._eipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_collection - computed: false, optional: true, required: false + private _logCollection?: boolean | cdktf.IResolvable; + public get logCollection() { + return this.getBooleanAttribute('log_collection'); + } + public set logCollection(value: boolean | cdktf.IResolvable) { + this._logCollection = value; + } + public resetLogCollection() { + this._logCollection = undefined; + } + // Temporarily expose input value. Use with caution. + public get logCollectionInput() { + return this._logCollection; + } + + // manager_admin_pass - computed: false, optional: false, required: true + private _managerAdminPass?: string; + public get managerAdminPass() { + return this.getStringAttribute('manager_admin_pass'); + } + public set managerAdminPass(value: string) { + this._managerAdminPass = value; + } + // Temporarily expose input value. Use with caution. + public get managerAdminPassInput() { + return this._managerAdminPass; + } + + // master_node_ip - computed: true, optional: false, required: false + public get masterNodeIp() { + return this.getStringAttribute('master_node_ip'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // node_admin_pass - computed: false, optional: true, required: false + private _nodeAdminPass?: string; + public get nodeAdminPass() { + return this.getStringAttribute('node_admin_pass'); + } + public set nodeAdminPass(value: string) { + this._nodeAdminPass = value; + } + public resetNodeAdminPass() { + this._nodeAdminPass = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeAdminPassInput() { + return this._nodeAdminPass; + } + + // node_key_pair - computed: false, optional: true, required: false + private _nodeKeyPair?: string; + public get nodeKeyPair() { + return this.getStringAttribute('node_key_pair'); + } + public set nodeKeyPair(value: string) { + this._nodeKeyPair = value; + } + public resetNodeKeyPair() { + this._nodeKeyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeKeyPairInput() { + return this._nodeKeyPair; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // public_ip - computed: true, optional: true, required: false + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + public resetPublicIp() { + this._publicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // safe_mode - computed: false, optional: true, required: false + private _safeMode?: boolean | cdktf.IResolvable; + public get safeMode() { + return this.getBooleanAttribute('safe_mode'); + } + public set safeMode(value: boolean | cdktf.IResolvable) { + this._safeMode = value; + } + public resetSafeMode() { + this._safeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get safeModeInput() { + return this._safeMode; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // template_id - computed: false, optional: true, required: false + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // total_node_number - computed: true, optional: false, required: false + public get totalNodeNumber() { + return this.getNumberAttribute('total_node_number'); + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // analysis_core_nodes - computed: false, optional: true, required: false + private _analysisCoreNodes = new MapreduceClusterAnalysisCoreNodesOutputReference(this, "analysis_core_nodes"); + public get analysisCoreNodes() { + return this._analysisCoreNodes; + } + public putAnalysisCoreNodes(value: MapreduceClusterAnalysisCoreNodes) { + this._analysisCoreNodes.internalValue = value; + } + public resetAnalysisCoreNodes() { + this._analysisCoreNodes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get analysisCoreNodesInput() { + return this._analysisCoreNodes.internalValue; + } + + // analysis_task_nodes - computed: false, optional: true, required: false + private _analysisTaskNodes = new MapreduceClusterAnalysisTaskNodesOutputReference(this, "analysis_task_nodes"); + public get analysisTaskNodes() { + return this._analysisTaskNodes; + } + public putAnalysisTaskNodes(value: MapreduceClusterAnalysisTaskNodes) { + this._analysisTaskNodes.internalValue = value; + } + public resetAnalysisTaskNodes() { + this._analysisTaskNodes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get analysisTaskNodesInput() { + return this._analysisTaskNodes.internalValue; + } + + // bootstrap_scripts - computed: false, optional: true, required: false + private _bootstrapScripts = new MapreduceClusterBootstrapScriptsList(this, "bootstrap_scripts", true); + public get bootstrapScripts() { + return this._bootstrapScripts; + } + public putBootstrapScripts(value: MapreduceClusterBootstrapScripts[] | cdktf.IResolvable) { + this._bootstrapScripts.internalValue = value; + } + public resetBootstrapScripts() { + this._bootstrapScripts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bootstrapScriptsInput() { + return this._bootstrapScripts.internalValue; + } + + // component_configs - computed: false, optional: true, required: false + private _componentConfigs = new MapreduceClusterComponentConfigsList(this, "component_configs", false); + public get componentConfigs() { + return this._componentConfigs; + } + public putComponentConfigs(value: MapreduceClusterComponentConfigs[] | cdktf.IResolvable) { + this._componentConfigs.internalValue = value; + } + public resetComponentConfigs() { + this._componentConfigs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get componentConfigsInput() { + return this._componentConfigs.internalValue; + } + + // custom_nodes - computed: false, optional: true, required: false + private _customNodes = new MapreduceClusterCustomNodesList(this, "custom_nodes", false); + public get customNodes() { + return this._customNodes; + } + public putCustomNodes(value: MapreduceClusterCustomNodes[] | cdktf.IResolvable) { + this._customNodes.internalValue = value; + } + public resetCustomNodes() { + this._customNodes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customNodesInput() { + return this._customNodes.internalValue; + } + + // external_datasources - computed: false, optional: true, required: false + private _externalDatasources = new MapreduceClusterExternalDatasourcesList(this, "external_datasources", false); + public get externalDatasources() { + return this._externalDatasources; + } + public putExternalDatasources(value: MapreduceClusterExternalDatasources[] | cdktf.IResolvable) { + this._externalDatasources.internalValue = value; + } + public resetExternalDatasources() { + this._externalDatasources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalDatasourcesInput() { + return this._externalDatasources.internalValue; + } + + // master_nodes - computed: false, optional: false, required: true + private _masterNodes = new MapreduceClusterMasterNodesOutputReference(this, "master_nodes"); + public get masterNodes() { + return this._masterNodes; + } + public putMasterNodes(value: MapreduceClusterMasterNodes) { + this._masterNodes.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get masterNodesInput() { + return this._masterNodes.internalValue; + } + + // smn_notify - computed: false, optional: true, required: false + private _smnNotify = new MapreduceClusterSmnNotifyOutputReference(this, "smn_notify"); + public get smnNotify() { + return this._smnNotify; + } + public putSmnNotify(value: MapreduceClusterSmnNotify) { + this._smnNotify.internalValue = value; + } + public resetSmnNotify() { + this._smnNotify.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnNotifyInput() { + return this._smnNotify.internalValue; + } + + // streaming_core_nodes - computed: false, optional: true, required: false + private _streamingCoreNodes = new MapreduceClusterStreamingCoreNodesOutputReference(this, "streaming_core_nodes"); + public get streamingCoreNodes() { + return this._streamingCoreNodes; + } + public putStreamingCoreNodes(value: MapreduceClusterStreamingCoreNodes) { + this._streamingCoreNodes.internalValue = value; + } + public resetStreamingCoreNodes() { + this._streamingCoreNodes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get streamingCoreNodesInput() { + return this._streamingCoreNodes.internalValue; + } + + // streaming_task_nodes - computed: false, optional: true, required: false + private _streamingTaskNodes = new MapreduceClusterStreamingTaskNodesOutputReference(this, "streaming_task_nodes"); + public get streamingTaskNodes() { + return this._streamingTaskNodes; + } + public putStreamingTaskNodes(value: MapreduceClusterStreamingTaskNodes) { + this._streamingTaskNodes.internalValue = value; + } + public resetStreamingTaskNodes() { + this._streamingTaskNodes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get streamingTaskNodesInput() { + return this._streamingTaskNodes.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new MapreduceClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: MapreduceClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + component_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._componentList), + eip_id: cdktf.stringToTerraform(this._eipId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + log_collection: cdktf.booleanToTerraform(this._logCollection), + manager_admin_pass: cdktf.stringToTerraform(this._managerAdminPass), + name: cdktf.stringToTerraform(this._name), + node_admin_pass: cdktf.stringToTerraform(this._nodeAdminPass), + node_key_pair: cdktf.stringToTerraform(this._nodeKeyPair), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + safe_mode: cdktf.booleanToTerraform(this._safeMode), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + template_id: cdktf.stringToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + vpc_id: cdktf.stringToTerraform(this._vpcId), + analysis_core_nodes: mapreduceClusterAnalysisCoreNodesToTerraform(this._analysisCoreNodes.internalValue), + analysis_task_nodes: mapreduceClusterAnalysisTaskNodesToTerraform(this._analysisTaskNodes.internalValue), + bootstrap_scripts: cdktf.listMapper(mapreduceClusterBootstrapScriptsToTerraform, true)(this._bootstrapScripts.internalValue), + component_configs: cdktf.listMapper(mapreduceClusterComponentConfigsToTerraform, true)(this._componentConfigs.internalValue), + custom_nodes: cdktf.listMapper(mapreduceClusterCustomNodesToTerraform, true)(this._customNodes.internalValue), + external_datasources: cdktf.listMapper(mapreduceClusterExternalDatasourcesToTerraform, true)(this._externalDatasources.internalValue), + master_nodes: mapreduceClusterMasterNodesToTerraform(this._masterNodes.internalValue), + smn_notify: mapreduceClusterSmnNotifyToTerraform(this._smnNotify.internalValue), + streaming_core_nodes: mapreduceClusterStreamingCoreNodesToTerraform(this._streamingCoreNodes.internalValue), + streaming_task_nodes: mapreduceClusterStreamingTaskNodesToTerraform(this._streamingTaskNodes.internalValue), + timeouts: mapreduceClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._componentList), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_collection: { + value: cdktf.booleanToHclTerraform(this._logCollection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + manager_admin_pass: { + value: cdktf.stringToHclTerraform(this._managerAdminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_admin_pass: { + value: cdktf.stringToHclTerraform(this._nodeAdminPass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_key_pair: { + value: cdktf.stringToHclTerraform(this._nodeKeyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + safe_mode: { + value: cdktf.booleanToHclTerraform(this._safeMode), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + template_id: { + value: cdktf.stringToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + analysis_core_nodes: { + value: mapreduceClusterAnalysisCoreNodesToHclTerraform(this._analysisCoreNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterAnalysisCoreNodesList", + }, + analysis_task_nodes: { + value: mapreduceClusterAnalysisTaskNodesToHclTerraform(this._analysisTaskNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterAnalysisTaskNodesList", + }, + bootstrap_scripts: { + value: cdktf.listMapperHcl(mapreduceClusterBootstrapScriptsToHclTerraform, true)(this._bootstrapScripts.internalValue), + isBlock: true, + type: "set", + storageClassType: "MapreduceClusterBootstrapScriptsList", + }, + component_configs: { + value: cdktf.listMapperHcl(mapreduceClusterComponentConfigsToHclTerraform, true)(this._componentConfigs.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterComponentConfigsList", + }, + custom_nodes: { + value: cdktf.listMapperHcl(mapreduceClusterCustomNodesToHclTerraform, true)(this._customNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterCustomNodesList", + }, + external_datasources: { + value: cdktf.listMapperHcl(mapreduceClusterExternalDatasourcesToHclTerraform, true)(this._externalDatasources.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterExternalDatasourcesList", + }, + master_nodes: { + value: mapreduceClusterMasterNodesToHclTerraform(this._masterNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterMasterNodesList", + }, + smn_notify: { + value: mapreduceClusterSmnNotifyToHclTerraform(this._smnNotify.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterSmnNotifyList", + }, + streaming_core_nodes: { + value: mapreduceClusterStreamingCoreNodesToHclTerraform(this._streamingCoreNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterStreamingCoreNodesList", + }, + streaming_task_nodes: { + value: mapreduceClusterStreamingTaskNodesToHclTerraform(this._streamingTaskNodes.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceClusterStreamingTaskNodesList", + }, + timeouts: { + value: mapreduceClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "MapreduceClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mapreduce-data-connection/README.md b/src/constructs/providers/huaweicloud/mapreduce-data-connection/README.md new file mode 100644 index 00000000..6c673a14 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-data-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mapreduce_data_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_mapreduce_data_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection). diff --git a/src/constructs/providers/huaweicloud/mapreduce-data-connection/index.ts b/src/constructs/providers/huaweicloud/mapreduce-data-connection/index.ts new file mode 100644 index 00000000..b813db83 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-data-connection/index.ts @@ -0,0 +1,414 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MapreduceDataConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#id MapreduceDataConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The data connection name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#name MapreduceDataConnection#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#region MapreduceDataConnection#region} + */ + readonly region?: string; + /** + * The type of data source. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#source_type MapreduceDataConnection#source_type} + */ + readonly sourceType: string; + /** + * source_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#source_info MapreduceDataConnection#source_info} + */ + readonly sourceInfo: MapreduceDataConnectionSourceInfo; +} +export interface MapreduceDataConnectionSourceInfo { + /** + * The instance ID of database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#db_instance_id MapreduceDataConnection#db_instance_id} + */ + readonly dbInstanceId: string; + /** + * The name of database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#db_name MapreduceDataConnection#db_name} + */ + readonly dbName: string; + /** + * The password for logging in to the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#password MapreduceDataConnection#password} + */ + readonly password: string; + /** + * The user name for logging in to the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#user_name MapreduceDataConnection#user_name} + */ + readonly userName: string; +} + +export function mapreduceDataConnectionSourceInfoToTerraform(struct?: MapreduceDataConnectionSourceInfoOutputReference | MapreduceDataConnectionSourceInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + db_instance_id: cdktf.stringToTerraform(struct!.dbInstanceId), + db_name: cdktf.stringToTerraform(struct!.dbName), + password: cdktf.stringToTerraform(struct!.password), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function mapreduceDataConnectionSourceInfoToHclTerraform(struct?: MapreduceDataConnectionSourceInfoOutputReference | MapreduceDataConnectionSourceInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + db_instance_id: { + value: cdktf.stringToHclTerraform(struct!.dbInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + db_name: { + value: cdktf.stringToHclTerraform(struct!.dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceDataConnectionSourceInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceDataConnectionSourceInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dbInstanceId !== undefined) { + hasAnyValues = true; + internalValueResult.dbInstanceId = this._dbInstanceId; + } + if (this._dbName !== undefined) { + hasAnyValues = true; + internalValueResult.dbName = this._dbName; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceDataConnectionSourceInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dbInstanceId = undefined; + this._dbName = undefined; + this._password = undefined; + this._userName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dbInstanceId = value.dbInstanceId; + this._dbName = value.dbName; + this._password = value.password; + this._userName = value.userName; + } + } + + // db_instance_id - computed: false, optional: false, required: true + private _dbInstanceId?: string; + public get dbInstanceId() { + return this.getStringAttribute('db_instance_id'); + } + public set dbInstanceId(value: string) { + this._dbInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get dbInstanceIdInput() { + return this._dbInstanceId; + } + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection huaweicloud_mapreduce_data_connection} +*/ +export class MapreduceDataConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mapreduce_data_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MapreduceDataConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MapreduceDataConnection to import + * @param importFromId The id of the existing MapreduceDataConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MapreduceDataConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mapreduce_data_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_data_connection huaweicloud_mapreduce_data_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MapreduceDataConnectionConfig + */ + public constructor(scope: Construct, id: string, config: MapreduceDataConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mapreduce_data_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sourceType = config.sourceType; + this._sourceInfo.internalValue = config.sourceInfo; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // used_clusters - computed: true, optional: false, required: false + public get usedClusters() { + return this.getStringAttribute('used_clusters'); + } + + // source_info - computed: false, optional: false, required: true + private _sourceInfo = new MapreduceDataConnectionSourceInfoOutputReference(this, "source_info"); + public get sourceInfo() { + return this._sourceInfo; + } + public putSourceInfo(value: MapreduceDataConnectionSourceInfo) { + this._sourceInfo.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInfoInput() { + return this._sourceInfo.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_type: cdktf.stringToTerraform(this._sourceType), + source_info: mapreduceDataConnectionSourceInfoToTerraform(this._sourceInfo.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_info: { + value: mapreduceDataConnectionSourceInfoToHclTerraform(this._sourceInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceDataConnectionSourceInfoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mapreduce-job/README.md b/src/constructs/providers/huaweicloud/mapreduce-job/README.md new file mode 100644 index 00000000..15272199 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mapreduce_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_mapreduce_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job). diff --git a/src/constructs/providers/huaweicloud/mapreduce-job/index.ts b/src/constructs/providers/huaweicloud/mapreduce-job/index.ts new file mode 100644 index 00000000..303cc7a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-job/index.ts @@ -0,0 +1,503 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MapreduceJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#cluster_id MapreduceJob#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#id MapreduceJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#name MapreduceJob#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#parameters MapreduceJob#parameters} + */ + readonly parameters?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#program_parameters MapreduceJob#program_parameters} + */ + readonly programParameters?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#program_path MapreduceJob#program_path} + */ + readonly programPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#region MapreduceJob#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#service_parameters MapreduceJob#service_parameters} + */ + readonly serviceParameters?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#sql MapreduceJob#sql} + */ + readonly sql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#type MapreduceJob#type} + */ + readonly type: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#timeouts MapreduceJob#timeouts} + */ + readonly timeouts?: MapreduceJobTimeouts; +} +export interface MapreduceJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#create MapreduceJob#create} + */ + readonly create?: string; +} + +export function mapreduceJobTimeoutsToTerraform(struct?: MapreduceJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function mapreduceJobTimeoutsToHclTerraform(struct?: MapreduceJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): MapreduceJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job huaweicloud_mapreduce_job} +*/ +export class MapreduceJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mapreduce_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MapreduceJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MapreduceJob to import + * @param importFromId The id of the existing MapreduceJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MapreduceJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mapreduce_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_job huaweicloud_mapreduce_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MapreduceJobConfig + */ + public constructor(scope: Construct, id: string, config: MapreduceJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mapreduce_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._id = config.id; + this._name = config.name; + this._parameters = config.parameters; + this._programParameters = config.programParameters; + this._programPath = config.programPath; + this._region = config.region; + this._serviceParameters = config.serviceParameters; + this._sql = config.sql; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // finish_time - computed: true, optional: false, required: false + public get finishTime() { + return this.getStringAttribute('finish_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parameters - computed: false, optional: true, required: false + private _parameters?: string; + public get parameters() { + return this.getStringAttribute('parameters'); + } + public set parameters(value: string) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // program_parameters - computed: false, optional: true, required: false + private _programParameters?: { [key: string]: string }; + public get programParameters() { + return this.getStringMapAttribute('program_parameters'); + } + public set programParameters(value: { [key: string]: string }) { + this._programParameters = value; + } + public resetProgramParameters() { + this._programParameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get programParametersInput() { + return this._programParameters; + } + + // program_path - computed: false, optional: true, required: false + private _programPath?: string; + public get programPath() { + return this.getStringAttribute('program_path'); + } + public set programPath(value: string) { + this._programPath = value; + } + public resetProgramPath() { + this._programPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get programPathInput() { + return this._programPath; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_parameters - computed: false, optional: true, required: false + private _serviceParameters?: { [key: string]: string }; + public get serviceParameters() { + return this.getStringMapAttribute('service_parameters'); + } + public set serviceParameters(value: { [key: string]: string }) { + this._serviceParameters = value; + } + public resetServiceParameters() { + this._serviceParameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceParametersInput() { + return this._serviceParameters; + } + + // sql - computed: false, optional: true, required: false + private _sql?: string; + public get sql() { + return this.getStringAttribute('sql'); + } + public set sql(value: string) { + this._sql = value; + } + public resetSql() { + this._sql = undefined; + } + // Temporarily expose input value. Use with caution. + public get sqlInput() { + return this._sql; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // submit_time - computed: true, optional: false, required: false + public get submitTime() { + return this.getStringAttribute('submit_time'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new MapreduceJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: MapreduceJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parameters: cdktf.stringToTerraform(this._parameters), + program_parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._programParameters), + program_path: cdktf.stringToTerraform(this._programPath), + region: cdktf.stringToTerraform(this._region), + service_parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._serviceParameters), + sql: cdktf.stringToTerraform(this._sql), + type: cdktf.stringToTerraform(this._type), + timeouts: mapreduceJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.stringToHclTerraform(this._parameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + program_parameters: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._programParameters), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + program_path: { + value: cdktf.stringToHclTerraform(this._programPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_parameters: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._serviceParameters), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + sql: { + value: cdktf.stringToHclTerraform(this._sql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: mapreduceJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "MapreduceJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mapreduce-scaling-policy/README.md b/src/constructs/providers/huaweicloud/mapreduce-scaling-policy/README.md new file mode 100644 index 00000000..3bbe484a --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-scaling-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mapreduce_scaling_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_mapreduce_scaling_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy). diff --git a/src/constructs/providers/huaweicloud/mapreduce-scaling-policy/index.ts b/src/constructs/providers/huaweicloud/mapreduce-scaling-policy/index.ts new file mode 100644 index 00000000..407b4a9c --- /dev/null +++ b/src/constructs/providers/huaweicloud/mapreduce-scaling-policy/index.ts @@ -0,0 +1,1387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MapreduceScalingPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Whether to enable the auto scaling rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#auto_scaling_enable MapreduceScalingPolicy#auto_scaling_enable} + */ + readonly autoScalingEnable: boolean | cdktf.IResolvable; + /** + * The MRS cluster ID to which the auto scaling policy applies. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#cluster_id MapreduceScalingPolicy#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#id MapreduceScalingPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Maximum number of nodes in the node group. Value range: 0 to 500. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#max_capacity MapreduceScalingPolicy#max_capacity} + */ + readonly maxCapacity: number; + /** + * Minimum number of nodes in the node group. Value range: 0 to 500. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#min_capacity MapreduceScalingPolicy#min_capacity} + */ + readonly minCapacity: number; + /** + * Name of the node to which an auto scaling rule applies. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#node_group MapreduceScalingPolicy#node_group} + */ + readonly nodeGroup: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#region MapreduceScalingPolicy#region} + */ + readonly region?: string; + /** + * exec_scripts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#exec_scripts MapreduceScalingPolicy#exec_scripts} + */ + readonly execScripts?: MapreduceScalingPolicyExecScripts[] | cdktf.IResolvable; + /** + * resources_plans block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#resources_plans MapreduceScalingPolicy#resources_plans} + */ + readonly resourcesPlans?: MapreduceScalingPolicyResourcesPlans[] | cdktf.IResolvable; + /** + * rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#rules MapreduceScalingPolicy#rules} + */ + readonly rules?: MapreduceScalingPolicyRules[] | cdktf.IResolvable; +} +export interface MapreduceScalingPolicyExecScripts { + /** + * Time when a script is executed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#action_stage MapreduceScalingPolicy#action_stage} + */ + readonly actionStage: string; + /** + * Whether the custom automation script runs only on the active Master node. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#active_master MapreduceScalingPolicy#active_master} + */ + readonly activeMaster?: boolean | cdktf.IResolvable; + /** + * Whether to continue to execute subsequent scripts and create a cluster after + * the custom automation script fails to be executed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#fail_action MapreduceScalingPolicy#fail_action} + */ + readonly failAction: string; + /** + * Name of a custom automation script. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#name MapreduceScalingPolicy#name} + */ + readonly name: string; + /** + * Type of a node where the custom automation script is executed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#nodes MapreduceScalingPolicy#nodes} + */ + readonly nodes: string[]; + /** + * Parameters of a custom automation script. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#parameters MapreduceScalingPolicy#parameters} + */ + readonly parameters?: string; + /** + * Path of a custom automation script. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#uri MapreduceScalingPolicy#uri} + */ + readonly uri: string; +} + +export function mapreduceScalingPolicyExecScriptsToTerraform(struct?: MapreduceScalingPolicyExecScripts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action_stage: cdktf.stringToTerraform(struct!.actionStage), + active_master: cdktf.booleanToTerraform(struct!.activeMaster), + fail_action: cdktf.stringToTerraform(struct!.failAction), + name: cdktf.stringToTerraform(struct!.name), + nodes: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.nodes), + parameters: cdktf.stringToTerraform(struct!.parameters), + uri: cdktf.stringToTerraform(struct!.uri), + } +} + + +export function mapreduceScalingPolicyExecScriptsToHclTerraform(struct?: MapreduceScalingPolicyExecScripts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action_stage: { + value: cdktf.stringToHclTerraform(struct!.actionStage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + active_master: { + value: cdktf.booleanToHclTerraform(struct!.activeMaster), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + fail_action: { + value: cdktf.stringToHclTerraform(struct!.failAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nodes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.nodes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + parameters: { + value: cdktf.stringToHclTerraform(struct!.parameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + uri: { + value: cdktf.stringToHclTerraform(struct!.uri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceScalingPolicyExecScriptsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceScalingPolicyExecScripts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._actionStage !== undefined) { + hasAnyValues = true; + internalValueResult.actionStage = this._actionStage; + } + if (this._activeMaster !== undefined) { + hasAnyValues = true; + internalValueResult.activeMaster = this._activeMaster; + } + if (this._failAction !== undefined) { + hasAnyValues = true; + internalValueResult.failAction = this._failAction; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._nodes !== undefined) { + hasAnyValues = true; + internalValueResult.nodes = this._nodes; + } + if (this._parameters !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters; + } + if (this._uri !== undefined) { + hasAnyValues = true; + internalValueResult.uri = this._uri; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceScalingPolicyExecScripts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._actionStage = undefined; + this._activeMaster = undefined; + this._failAction = undefined; + this._name = undefined; + this._nodes = undefined; + this._parameters = undefined; + this._uri = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._actionStage = value.actionStage; + this._activeMaster = value.activeMaster; + this._failAction = value.failAction; + this._name = value.name; + this._nodes = value.nodes; + this._parameters = value.parameters; + this._uri = value.uri; + } + } + + // action_stage - computed: false, optional: false, required: true + private _actionStage?: string; + public get actionStage() { + return this.getStringAttribute('action_stage'); + } + public set actionStage(value: string) { + this._actionStage = value; + } + // Temporarily expose input value. Use with caution. + public get actionStageInput() { + return this._actionStage; + } + + // active_master - computed: true, optional: true, required: false + private _activeMaster?: boolean | cdktf.IResolvable; + public get activeMaster() { + return this.getBooleanAttribute('active_master'); + } + public set activeMaster(value: boolean | cdktf.IResolvable) { + this._activeMaster = value; + } + public resetActiveMaster() { + this._activeMaster = undefined; + } + // Temporarily expose input value. Use with caution. + public get activeMasterInput() { + return this._activeMaster; + } + + // fail_action - computed: false, optional: false, required: true + private _failAction?: string; + public get failAction() { + return this.getStringAttribute('fail_action'); + } + public set failAction(value: string) { + this._failAction = value; + } + // Temporarily expose input value. Use with caution. + public get failActionInput() { + return this._failAction; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: false, optional: false, required: true + private _nodes?: string[]; + public get nodes() { + return this.getListAttribute('nodes'); + } + public set nodes(value: string[]) { + this._nodes = value; + } + // Temporarily expose input value. Use with caution. + public get nodesInput() { + return this._nodes; + } + + // parameters - computed: true, optional: true, required: false + private _parameters?: string; + public get parameters() { + return this.getStringAttribute('parameters'); + } + public set parameters(value: string) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // uri - computed: false, optional: false, required: true + private _uri?: string; + public get uri() { + return this.getStringAttribute('uri'); + } + public set uri(value: string) { + this._uri = value; + } + // Temporarily expose input value. Use with caution. + public get uriInput() { + return this._uri; + } +} + +export class MapreduceScalingPolicyExecScriptsList extends cdktf.ComplexList { + public internalValue? : MapreduceScalingPolicyExecScripts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceScalingPolicyExecScriptsOutputReference { + return new MapreduceScalingPolicyExecScriptsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceScalingPolicyResourcesPlans { + /** + * End time of a resource plan. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#end_time MapreduceScalingPolicy#end_time} + */ + readonly endTime: string; + /** + * Maximum number of the preserved nodes in a node group in a resource plan. Value range: 0 to 500. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#max_capacity MapreduceScalingPolicy#max_capacity} + */ + readonly maxCapacity: number; + /** + * Minimum number of the preserved nodes in a node group in a resource plan. Value range: 0 to 500. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#min_capacity MapreduceScalingPolicy#min_capacity} + */ + readonly minCapacity: number; + /** + * Cycle type of a resource plan. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#period_type MapreduceScalingPolicy#period_type} + */ + readonly periodType: string; + /** + * The start time of a resource plan. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#start_time MapreduceScalingPolicy#start_time} + */ + readonly startTime: string; +} + +export function mapreduceScalingPolicyResourcesPlansToTerraform(struct?: MapreduceScalingPolicyResourcesPlans | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end_time: cdktf.stringToTerraform(struct!.endTime), + max_capacity: cdktf.numberToTerraform(struct!.maxCapacity), + min_capacity: cdktf.numberToTerraform(struct!.minCapacity), + period_type: cdktf.stringToTerraform(struct!.periodType), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function mapreduceScalingPolicyResourcesPlansToHclTerraform(struct?: MapreduceScalingPolicyResourcesPlans | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end_time: { + value: cdktf.stringToHclTerraform(struct!.endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_capacity: { + value: cdktf.numberToHclTerraform(struct!.maxCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_capacity: { + value: cdktf.numberToHclTerraform(struct!.minCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_type: { + value: cdktf.stringToHclTerraform(struct!.periodType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceScalingPolicyResourcesPlansOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceScalingPolicyResourcesPlans | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._endTime !== undefined) { + hasAnyValues = true; + internalValueResult.endTime = this._endTime; + } + if (this._maxCapacity !== undefined) { + hasAnyValues = true; + internalValueResult.maxCapacity = this._maxCapacity; + } + if (this._minCapacity !== undefined) { + hasAnyValues = true; + internalValueResult.minCapacity = this._minCapacity; + } + if (this._periodType !== undefined) { + hasAnyValues = true; + internalValueResult.periodType = this._periodType; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceScalingPolicyResourcesPlans | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._endTime = undefined; + this._maxCapacity = undefined; + this._minCapacity = undefined; + this._periodType = undefined; + this._startTime = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._endTime = value.endTime; + this._maxCapacity = value.maxCapacity; + this._minCapacity = value.minCapacity; + this._periodType = value.periodType; + this._startTime = value.startTime; + } + } + + // end_time - computed: false, optional: false, required: true + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // max_capacity - computed: false, optional: false, required: true + private _maxCapacity?: number; + public get maxCapacity() { + return this.getNumberAttribute('max_capacity'); + } + public set maxCapacity(value: number) { + this._maxCapacity = value; + } + // Temporarily expose input value. Use with caution. + public get maxCapacityInput() { + return this._maxCapacity; + } + + // min_capacity - computed: false, optional: false, required: true + private _minCapacity?: number; + public get minCapacity() { + return this.getNumberAttribute('min_capacity'); + } + public set minCapacity(value: number) { + this._minCapacity = value; + } + // Temporarily expose input value. Use with caution. + public get minCapacityInput() { + return this._minCapacity; + } + + // period_type - computed: false, optional: false, required: true + private _periodType?: string; + public get periodType() { + return this.getStringAttribute('period_type'); + } + public set periodType(value: string) { + this._periodType = value; + } + // Temporarily expose input value. Use with caution. + public get periodTypeInput() { + return this._periodType; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} + +export class MapreduceScalingPolicyResourcesPlansList extends cdktf.ComplexList { + public internalValue? : MapreduceScalingPolicyResourcesPlans[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceScalingPolicyResourcesPlansOutputReference { + return new MapreduceScalingPolicyResourcesPlansOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MapreduceScalingPolicyRulesTrigger { + /** + * Metric judgment logic operator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#comparison_operator MapreduceScalingPolicy#comparison_operator} + */ + readonly comparisonOperator?: string; + /** + * Number of consecutive five-minute periods, during which a metric threshold is reached. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#evaluation_periods MapreduceScalingPolicy#evaluation_periods} + */ + readonly evaluationPeriods: number; + /** + * Metric name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#metric_name MapreduceScalingPolicy#metric_name} + */ + readonly metricName: string; + /** + * Metric threshold to trigger a rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#metric_value MapreduceScalingPolicy#metric_value} + */ + readonly metricValue: string; +} + +export function mapreduceScalingPolicyRulesTriggerToTerraform(struct?: MapreduceScalingPolicyRulesTriggerOutputReference | MapreduceScalingPolicyRulesTrigger): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + comparison_operator: cdktf.stringToTerraform(struct!.comparisonOperator), + evaluation_periods: cdktf.numberToTerraform(struct!.evaluationPeriods), + metric_name: cdktf.stringToTerraform(struct!.metricName), + metric_value: cdktf.stringToTerraform(struct!.metricValue), + } +} + + +export function mapreduceScalingPolicyRulesTriggerToHclTerraform(struct?: MapreduceScalingPolicyRulesTriggerOutputReference | MapreduceScalingPolicyRulesTrigger): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + comparison_operator: { + value: cdktf.stringToHclTerraform(struct!.comparisonOperator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + evaluation_periods: { + value: cdktf.numberToHclTerraform(struct!.evaluationPeriods), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + metric_name: { + value: cdktf.stringToHclTerraform(struct!.metricName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + metric_value: { + value: cdktf.stringToHclTerraform(struct!.metricValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceScalingPolicyRulesTriggerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MapreduceScalingPolicyRulesTrigger | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._comparisonOperator !== undefined) { + hasAnyValues = true; + internalValueResult.comparisonOperator = this._comparisonOperator; + } + if (this._evaluationPeriods !== undefined) { + hasAnyValues = true; + internalValueResult.evaluationPeriods = this._evaluationPeriods; + } + if (this._metricName !== undefined) { + hasAnyValues = true; + internalValueResult.metricName = this._metricName; + } + if (this._metricValue !== undefined) { + hasAnyValues = true; + internalValueResult.metricValue = this._metricValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceScalingPolicyRulesTrigger | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._comparisonOperator = undefined; + this._evaluationPeriods = undefined; + this._metricName = undefined; + this._metricValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._comparisonOperator = value.comparisonOperator; + this._evaluationPeriods = value.evaluationPeriods; + this._metricName = value.metricName; + this._metricValue = value.metricValue; + } + } + + // comparison_operator - computed: true, optional: true, required: false + private _comparisonOperator?: string; + public get comparisonOperator() { + return this.getStringAttribute('comparison_operator'); + } + public set comparisonOperator(value: string) { + this._comparisonOperator = value; + } + public resetComparisonOperator() { + this._comparisonOperator = undefined; + } + // Temporarily expose input value. Use with caution. + public get comparisonOperatorInput() { + return this._comparisonOperator; + } + + // evaluation_periods - computed: false, optional: false, required: true + private _evaluationPeriods?: number; + public get evaluationPeriods() { + return this.getNumberAttribute('evaluation_periods'); + } + public set evaluationPeriods(value: number) { + this._evaluationPeriods = value; + } + // Temporarily expose input value. Use with caution. + public get evaluationPeriodsInput() { + return this._evaluationPeriods; + } + + // metric_name - computed: false, optional: false, required: true + private _metricName?: string; + public get metricName() { + return this.getStringAttribute('metric_name'); + } + public set metricName(value: string) { + this._metricName = value; + } + // Temporarily expose input value. Use with caution. + public get metricNameInput() { + return this._metricName; + } + + // metric_value - computed: false, optional: false, required: true + private _metricValue?: string; + public get metricValue() { + return this.getStringAttribute('metric_value'); + } + public set metricValue(value: string) { + this._metricValue = value; + } + // Temporarily expose input value. Use with caution. + public get metricValueInput() { + return this._metricValue; + } +} +export interface MapreduceScalingPolicyRules { + /** + * Auto scaling rule adjustment type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#adjustment_type MapreduceScalingPolicy#adjustment_type} + */ + readonly adjustmentType: string; + /** + * Cluster cooling time after an auto scaling rule is triggered, when no auto scaling + * operation is performed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#cool_down_minutes MapreduceScalingPolicy#cool_down_minutes} + */ + readonly coolDownMinutes: number; + /** + * Description about an auto scaling rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#description MapreduceScalingPolicy#description} + */ + readonly description?: string; + /** + * Name of an auto scaling rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#name MapreduceScalingPolicy#name} + */ + readonly name: string; + /** + * Number of nodes that can be adjusted once. Value range: 1 to 100. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#scaling_adjustment MapreduceScalingPolicy#scaling_adjustment} + */ + readonly scalingAdjustment: number; + /** + * trigger block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#trigger MapreduceScalingPolicy#trigger} + */ + readonly trigger: MapreduceScalingPolicyRulesTrigger; +} + +export function mapreduceScalingPolicyRulesToTerraform(struct?: MapreduceScalingPolicyRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + adjustment_type: cdktf.stringToTerraform(struct!.adjustmentType), + cool_down_minutes: cdktf.numberToTerraform(struct!.coolDownMinutes), + description: cdktf.stringToTerraform(struct!.description), + name: cdktf.stringToTerraform(struct!.name), + scaling_adjustment: cdktf.numberToTerraform(struct!.scalingAdjustment), + trigger: mapreduceScalingPolicyRulesTriggerToTerraform(struct!.trigger), + } +} + + +export function mapreduceScalingPolicyRulesToHclTerraform(struct?: MapreduceScalingPolicyRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + adjustment_type: { + value: cdktf.stringToHclTerraform(struct!.adjustmentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cool_down_minutes: { + value: cdktf.numberToHclTerraform(struct!.coolDownMinutes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scaling_adjustment: { + value: cdktf.numberToHclTerraform(struct!.scalingAdjustment), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger: { + value: mapreduceScalingPolicyRulesTriggerToHclTerraform(struct!.trigger), + isBlock: true, + type: "list", + storageClassType: "MapreduceScalingPolicyRulesTriggerList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MapreduceScalingPolicyRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MapreduceScalingPolicyRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._adjustmentType !== undefined) { + hasAnyValues = true; + internalValueResult.adjustmentType = this._adjustmentType; + } + if (this._coolDownMinutes !== undefined) { + hasAnyValues = true; + internalValueResult.coolDownMinutes = this._coolDownMinutes; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._scalingAdjustment !== undefined) { + hasAnyValues = true; + internalValueResult.scalingAdjustment = this._scalingAdjustment; + } + if (this._trigger?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.trigger = this._trigger?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MapreduceScalingPolicyRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._adjustmentType = undefined; + this._coolDownMinutes = undefined; + this._description = undefined; + this._name = undefined; + this._scalingAdjustment = undefined; + this._trigger.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._adjustmentType = value.adjustmentType; + this._coolDownMinutes = value.coolDownMinutes; + this._description = value.description; + this._name = value.name; + this._scalingAdjustment = value.scalingAdjustment; + this._trigger.internalValue = value.trigger; + } + } + + // adjustment_type - computed: false, optional: false, required: true + private _adjustmentType?: string; + public get adjustmentType() { + return this.getStringAttribute('adjustment_type'); + } + public set adjustmentType(value: string) { + this._adjustmentType = value; + } + // Temporarily expose input value. Use with caution. + public get adjustmentTypeInput() { + return this._adjustmentType; + } + + // cool_down_minutes - computed: false, optional: false, required: true + private _coolDownMinutes?: number; + public get coolDownMinutes() { + return this.getNumberAttribute('cool_down_minutes'); + } + public set coolDownMinutes(value: number) { + this._coolDownMinutes = value; + } + // Temporarily expose input value. Use with caution. + public get coolDownMinutesInput() { + return this._coolDownMinutes; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // scaling_adjustment - computed: false, optional: false, required: true + private _scalingAdjustment?: number; + public get scalingAdjustment() { + return this.getNumberAttribute('scaling_adjustment'); + } + public set scalingAdjustment(value: number) { + this._scalingAdjustment = value; + } + // Temporarily expose input value. Use with caution. + public get scalingAdjustmentInput() { + return this._scalingAdjustment; + } + + // trigger - computed: false, optional: false, required: true + private _trigger = new MapreduceScalingPolicyRulesTriggerOutputReference(this, "trigger"); + public get trigger() { + return this._trigger; + } + public putTrigger(value: MapreduceScalingPolicyRulesTrigger) { + this._trigger.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get triggerInput() { + return this._trigger.internalValue; + } +} + +export class MapreduceScalingPolicyRulesList extends cdktf.ComplexList { + public internalValue? : MapreduceScalingPolicyRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MapreduceScalingPolicyRulesOutputReference { + return new MapreduceScalingPolicyRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy huaweicloud_mapreduce_scaling_policy} +*/ +export class MapreduceScalingPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mapreduce_scaling_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MapreduceScalingPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MapreduceScalingPolicy to import + * @param importFromId The id of the existing MapreduceScalingPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MapreduceScalingPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mapreduce_scaling_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mapreduce_scaling_policy huaweicloud_mapreduce_scaling_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MapreduceScalingPolicyConfig + */ + public constructor(scope: Construct, id: string, config: MapreduceScalingPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mapreduce_scaling_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoScalingEnable = config.autoScalingEnable; + this._clusterId = config.clusterId; + this._id = config.id; + this._maxCapacity = config.maxCapacity; + this._minCapacity = config.minCapacity; + this._nodeGroup = config.nodeGroup; + this._region = config.region; + this._execScripts.internalValue = config.execScripts; + this._resourcesPlans.internalValue = config.resourcesPlans; + this._rules.internalValue = config.rules; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_scaling_enable - computed: false, optional: false, required: true + private _autoScalingEnable?: boolean | cdktf.IResolvable; + public get autoScalingEnable() { + return this.getBooleanAttribute('auto_scaling_enable'); + } + public set autoScalingEnable(value: boolean | cdktf.IResolvable) { + this._autoScalingEnable = value; + } + // Temporarily expose input value. Use with caution. + public get autoScalingEnableInput() { + return this._autoScalingEnable; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // max_capacity - computed: false, optional: false, required: true + private _maxCapacity?: number; + public get maxCapacity() { + return this.getNumberAttribute('max_capacity'); + } + public set maxCapacity(value: number) { + this._maxCapacity = value; + } + // Temporarily expose input value. Use with caution. + public get maxCapacityInput() { + return this._maxCapacity; + } + + // min_capacity - computed: false, optional: false, required: true + private _minCapacity?: number; + public get minCapacity() { + return this.getNumberAttribute('min_capacity'); + } + public set minCapacity(value: number) { + this._minCapacity = value; + } + // Temporarily expose input value. Use with caution. + public get minCapacityInput() { + return this._minCapacity; + } + + // node_group - computed: false, optional: false, required: true + private _nodeGroup?: string; + public get nodeGroup() { + return this.getStringAttribute('node_group'); + } + public set nodeGroup(value: string) { + this._nodeGroup = value; + } + // Temporarily expose input value. Use with caution. + public get nodeGroupInput() { + return this._nodeGroup; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // exec_scripts - computed: false, optional: true, required: false + private _execScripts = new MapreduceScalingPolicyExecScriptsList(this, "exec_scripts", false); + public get execScripts() { + return this._execScripts; + } + public putExecScripts(value: MapreduceScalingPolicyExecScripts[] | cdktf.IResolvable) { + this._execScripts.internalValue = value; + } + public resetExecScripts() { + this._execScripts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get execScriptsInput() { + return this._execScripts.internalValue; + } + + // resources_plans - computed: false, optional: true, required: false + private _resourcesPlans = new MapreduceScalingPolicyResourcesPlansList(this, "resources_plans", false); + public get resourcesPlans() { + return this._resourcesPlans; + } + public putResourcesPlans(value: MapreduceScalingPolicyResourcesPlans[] | cdktf.IResolvable) { + this._resourcesPlans.internalValue = value; + } + public resetResourcesPlans() { + this._resourcesPlans.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesPlansInput() { + return this._resourcesPlans.internalValue; + } + + // rules - computed: false, optional: true, required: false + private _rules = new MapreduceScalingPolicyRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + public putRules(value: MapreduceScalingPolicyRules[] | cdktf.IResolvable) { + this._rules.internalValue = value; + } + public resetRules() { + this._rules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get rulesInput() { + return this._rules.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_scaling_enable: cdktf.booleanToTerraform(this._autoScalingEnable), + cluster_id: cdktf.stringToTerraform(this._clusterId), + id: cdktf.stringToTerraform(this._id), + max_capacity: cdktf.numberToTerraform(this._maxCapacity), + min_capacity: cdktf.numberToTerraform(this._minCapacity), + node_group: cdktf.stringToTerraform(this._nodeGroup), + region: cdktf.stringToTerraform(this._region), + exec_scripts: cdktf.listMapper(mapreduceScalingPolicyExecScriptsToTerraform, true)(this._execScripts.internalValue), + resources_plans: cdktf.listMapper(mapreduceScalingPolicyResourcesPlansToTerraform, true)(this._resourcesPlans.internalValue), + rules: cdktf.listMapper(mapreduceScalingPolicyRulesToTerraform, true)(this._rules.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_scaling_enable: { + value: cdktf.booleanToHclTerraform(this._autoScalingEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_capacity: { + value: cdktf.numberToHclTerraform(this._maxCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + min_capacity: { + value: cdktf.numberToHclTerraform(this._minCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + node_group: { + value: cdktf.stringToHclTerraform(this._nodeGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exec_scripts: { + value: cdktf.listMapperHcl(mapreduceScalingPolicyExecScriptsToHclTerraform, true)(this._execScripts.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceScalingPolicyExecScriptsList", + }, + resources_plans: { + value: cdktf.listMapperHcl(mapreduceScalingPolicyResourcesPlansToHclTerraform, true)(this._resourcesPlans.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceScalingPolicyResourcesPlansList", + }, + rules: { + value: cdktf.listMapperHcl(mapreduceScalingPolicyRulesToHclTerraform, true)(this._rules.internalValue), + isBlock: true, + type: "list", + storageClassType: "MapreduceScalingPolicyRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/meeting-admin-assignment/README.md b/src/constructs/providers/huaweicloud/meeting-admin-assignment/README.md new file mode 100644 index 00000000..0006c2dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/meeting-admin-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_meeting_admin_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_meeting_admin_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment). diff --git a/src/constructs/providers/huaweicloud/meeting-admin-assignment/index.ts b/src/constructs/providers/huaweicloud/meeting-admin-assignment/index.ts new file mode 100644 index 00000000..a2dbe186 --- /dev/null +++ b/src/constructs/providers/huaweicloud/meeting-admin-assignment/index.ts @@ -0,0 +1,253 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MeetingAdminAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#account MeetingAdminAssignment#account} + */ + readonly account: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#account_name MeetingAdminAssignment#account_name} + */ + readonly accountName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#account_password MeetingAdminAssignment#account_password} + */ + readonly accountPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#app_id MeetingAdminAssignment#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#app_key MeetingAdminAssignment#app_key} + */ + readonly appKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#id MeetingAdminAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment huaweicloud_meeting_admin_assignment} +*/ +export class MeetingAdminAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_meeting_admin_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MeetingAdminAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MeetingAdminAssignment to import + * @param importFromId The id of the existing MeetingAdminAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MeetingAdminAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_meeting_admin_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_admin_assignment huaweicloud_meeting_admin_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MeetingAdminAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: MeetingAdminAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_meeting_admin_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._account = config.account; + this._accountName = config.accountName; + this._accountPassword = config.accountPassword; + this._appId = config.appId; + this._appKey = config.appKey; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // account - computed: false, optional: false, required: true + private _account?: string; + public get account() { + return this.getStringAttribute('account'); + } + public set account(value: string) { + this._account = value; + } + // Temporarily expose input value. Use with caution. + public get accountInput() { + return this._account; + } + + // account_name - computed: false, optional: true, required: false + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + public resetAccountName() { + this._accountName = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // account_password - computed: false, optional: true, required: false + private _accountPassword?: string; + public get accountPassword() { + return this.getStringAttribute('account_password'); + } + public set accountPassword(value: string) { + this._accountPassword = value; + } + public resetAccountPassword() { + this._accountPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountPasswordInput() { + return this._accountPassword; + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // app_key - computed: false, optional: true, required: false + private _appKey?: string; + public get appKey() { + return this.getStringAttribute('app_key'); + } + public set appKey(value: string) { + this._appKey = value; + } + public resetAppKey() { + this._appKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get appKeyInput() { + return this._appKey; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account: cdktf.stringToTerraform(this._account), + account_name: cdktf.stringToTerraform(this._accountName), + account_password: cdktf.stringToTerraform(this._accountPassword), + app_id: cdktf.stringToTerraform(this._appId), + app_key: cdktf.stringToTerraform(this._appKey), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account: { + value: cdktf.stringToHclTerraform(this._account), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_password: { + value: cdktf.stringToHclTerraform(this._accountPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_key: { + value: cdktf.stringToHclTerraform(this._appKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/meeting-conference/README.md b/src/constructs/providers/huaweicloud/meeting-conference/README.md new file mode 100644 index 00000000..dee9641b --- /dev/null +++ b/src/constructs/providers/huaweicloud/meeting-conference/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_meeting_conference` + +Refer to the Terraform Registry for docs: [`huaweicloud_meeting_conference`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference). diff --git a/src/constructs/providers/huaweicloud/meeting-conference/index.ts b/src/constructs/providers/huaweicloud/meeting-conference/index.ts new file mode 100644 index 00000000..1b0ab804 --- /dev/null +++ b/src/constructs/providers/huaweicloud/meeting-conference/index.ts @@ -0,0 +1,2263 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MeetingConferenceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#account_name MeetingConference#account_name} + */ + readonly accountName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#account_password MeetingConference#account_password} + */ + readonly accountPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#app_id MeetingConference#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#app_key MeetingConference#app_key} + */ + readonly appKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#aux_address MeetingConference#aux_address} + */ + readonly auxAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#corp_id MeetingConference#corp_id} + */ + readonly corpId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#duration MeetingConference#duration} + */ + readonly duration: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#encrypt_mode MeetingConference#encrypt_mode} + */ + readonly encryptMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#id MeetingConference#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_auto_record MeetingConference#is_auto_record} + */ + readonly isAutoRecord?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_record_aux_stream MeetingConference#is_record_aux_stream} + */ + readonly isRecordAuxStream?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#language MeetingConference#language} + */ + readonly language?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#live_address MeetingConference#live_address} + */ + readonly liveAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#media_types MeetingConference#media_types} + */ + readonly mediaTypes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#meeting_room_id MeetingConference#meeting_room_id} + */ + readonly meetingRoomId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#participant_number MeetingConference#participant_number} + */ + readonly participantNumber?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#record_auth_type MeetingConference#record_auth_type} + */ + readonly recordAuthType?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#record_type MeetingConference#record_type} + */ + readonly recordType?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#start_time MeetingConference#start_time} + */ + readonly startTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#timezone_id MeetingConference#timezone_id} + */ + readonly timezoneId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#topic MeetingConference#topic} + */ + readonly topic: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#user_id MeetingConference#user_id} + */ + readonly userId?: string; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#configuration MeetingConference#configuration} + */ + readonly configuration?: MeetingConferenceConfiguration; + /** + * cycle_params block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#cycle_params MeetingConference#cycle_params} + */ + readonly cycleParams?: MeetingConferenceCycleParams; + /** + * participant block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#participant MeetingConference#participant} + */ + readonly participant?: MeetingConferenceParticipant[] | cdktf.IResolvable; +} +export interface MeetingConferenceJoinPassword { +} + +export function meetingConferenceJoinPasswordToTerraform(struct?: MeetingConferenceJoinPassword): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function meetingConferenceJoinPasswordToHclTerraform(struct?: MeetingConferenceJoinPassword): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class MeetingConferenceJoinPasswordOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MeetingConferenceJoinPassword | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceJoinPassword | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // guest - computed: true, optional: false, required: false + public get guest() { + return this.getStringAttribute('guest'); + } + + // host - computed: true, optional: false, required: false + public get host() { + return this.getStringAttribute('host'); + } +} + +export class MeetingConferenceJoinPasswordList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MeetingConferenceJoinPasswordOutputReference { + return new MeetingConferenceJoinPasswordOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MeetingConferenceSubconferencesSubconfigurationShowAudiencePolicies { +} + +export function meetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesToTerraform(struct?: MeetingConferenceSubconferencesSubconfigurationShowAudiencePolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function meetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesToHclTerraform(struct?: MeetingConferenceSubconferencesSubconfigurationShowAudiencePolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class MeetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MeetingConferenceSubconferencesSubconfigurationShowAudiencePolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceSubconferencesSubconfigurationShowAudiencePolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // base_audience_count - computed: true, optional: false, required: false + public get baseAudienceCount() { + return this.getNumberAttribute('base_audience_count'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getNumberAttribute('mode'); + } + + // multiple - computed: true, optional: false, required: false + public get multiple() { + return this.getNumberAttribute('multiple'); + } +} + +export class MeetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MeetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesOutputReference { + return new MeetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MeetingConferenceSubconferencesSubconfiguration { +} + +export function meetingConferenceSubconferencesSubconfigurationToTerraform(struct?: MeetingConferenceSubconferencesSubconfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function meetingConferenceSubconferencesSubconfigurationToHclTerraform(struct?: MeetingConferenceSubconferencesSubconfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class MeetingConferenceSubconferencesSubconfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MeetingConferenceSubconferencesSubconfiguration | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceSubconferencesSubconfiguration | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // allow_guest_start - computed: true, optional: false, required: false + public get allowGuestStart() { + return this.getBooleanAttribute('allow_guest_start'); + } + + // audience_callin_restriction - computed: true, optional: false, required: false + public get audienceCallinRestriction() { + return this.getNumberAttribute('audience_callin_restriction'); + } + + // callin_restriction - computed: true, optional: false, required: false + public get callinRestriction() { + return this.getNumberAttribute('callin_restriction'); + } + + // show_audience_policies - computed: true, optional: false, required: false + private _showAudiencePolicies = new MeetingConferenceSubconferencesSubconfigurationShowAudiencePoliciesList(this, "show_audience_policies", false); + public get showAudiencePolicies() { + return this._showAudiencePolicies; + } + + // waiting_room_enabled - computed: true, optional: false, required: false + public get waitingRoomEnabled() { + return this.getBooleanAttribute('waiting_room_enabled'); + } +} + +export class MeetingConferenceSubconferencesSubconfigurationList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MeetingConferenceSubconferencesSubconfigurationOutputReference { + return new MeetingConferenceSubconferencesSubconfigurationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MeetingConferenceSubconferences { +} + +export function meetingConferenceSubconferencesToTerraform(struct?: MeetingConferenceSubconferences): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function meetingConferenceSubconferencesToHclTerraform(struct?: MeetingConferenceSubconferences): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class MeetingConferenceSubconferencesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MeetingConferenceSubconferences | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceSubconferences | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // is_auto_record - computed: true, optional: false, required: false + public get isAutoRecord() { + return this.getNumberAttribute('is_auto_record'); + } + + // media_types - computed: true, optional: false, required: false + public get mediaTypes() { + return this.getListAttribute('media_types'); + } + + // record_auth_type - computed: true, optional: false, required: false + public get recordAuthType() { + return this.getNumberAttribute('record_auth_type'); + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // subconfiguration - computed: true, optional: false, required: false + private _subconfiguration = new MeetingConferenceSubconferencesSubconfigurationList(this, "subconfiguration", false); + public get subconfiguration() { + return this._subconfiguration; + } +} + +export class MeetingConferenceSubconferencesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MeetingConferenceSubconferencesOutputReference { + return new MeetingConferenceSubconferencesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MeetingConferenceConfiguration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#allow_guest_start MeetingConference#allow_guest_start} + */ + readonly allowGuestStart?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#callin_restriction MeetingConference#callin_restriction} + */ + readonly callinRestriction?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#guest_password MeetingConference#guest_password} + */ + readonly guestPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_auto_mute MeetingConference#is_auto_mute} + */ + readonly isAutoMute?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_guest_free_password MeetingConference#is_guest_free_password} + */ + readonly isGuestFreePassword?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_hard_terminal_auto_mute MeetingConference#is_hard_terminal_auto_mute} + */ + readonly isHardTerminalAutoMute?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_send_calendar MeetingConference#is_send_calendar} + */ + readonly isSendCalendar?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_send_notify MeetingConference#is_send_notify} + */ + readonly isSendNotify?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_send_sms MeetingConference#is_send_sms} + */ + readonly isSendSms?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#prolong_time MeetingConference#prolong_time} + */ + readonly prolongTime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#waiting_room_enabled MeetingConference#waiting_room_enabled} + */ + readonly waitingRoomEnabled?: boolean | cdktf.IResolvable; +} + +export function meetingConferenceConfigurationToTerraform(struct?: MeetingConferenceConfigurationOutputReference | MeetingConferenceConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + allow_guest_start: cdktf.booleanToTerraform(struct!.allowGuestStart), + callin_restriction: cdktf.numberToTerraform(struct!.callinRestriction), + guest_password: cdktf.stringToTerraform(struct!.guestPassword), + is_auto_mute: cdktf.booleanToTerraform(struct!.isAutoMute), + is_guest_free_password: cdktf.booleanToTerraform(struct!.isGuestFreePassword), + is_hard_terminal_auto_mute: cdktf.booleanToTerraform(struct!.isHardTerminalAutoMute), + is_send_calendar: cdktf.booleanToTerraform(struct!.isSendCalendar), + is_send_notify: cdktf.booleanToTerraform(struct!.isSendNotify), + is_send_sms: cdktf.booleanToTerraform(struct!.isSendSms), + prolong_time: cdktf.numberToTerraform(struct!.prolongTime), + waiting_room_enabled: cdktf.booleanToTerraform(struct!.waitingRoomEnabled), + } +} + + +export function meetingConferenceConfigurationToHclTerraform(struct?: MeetingConferenceConfigurationOutputReference | MeetingConferenceConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + allow_guest_start: { + value: cdktf.booleanToHclTerraform(struct!.allowGuestStart), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + callin_restriction: { + value: cdktf.numberToHclTerraform(struct!.callinRestriction), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + guest_password: { + value: cdktf.stringToHclTerraform(struct!.guestPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_auto_mute: { + value: cdktf.booleanToHclTerraform(struct!.isAutoMute), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_guest_free_password: { + value: cdktf.booleanToHclTerraform(struct!.isGuestFreePassword), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_hard_terminal_auto_mute: { + value: cdktf.booleanToHclTerraform(struct!.isHardTerminalAutoMute), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_send_calendar: { + value: cdktf.booleanToHclTerraform(struct!.isSendCalendar), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_send_notify: { + value: cdktf.booleanToHclTerraform(struct!.isSendNotify), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_send_sms: { + value: cdktf.booleanToHclTerraform(struct!.isSendSms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + prolong_time: { + value: cdktf.numberToHclTerraform(struct!.prolongTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + waiting_room_enabled: { + value: cdktf.booleanToHclTerraform(struct!.waitingRoomEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MeetingConferenceConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MeetingConferenceConfiguration | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._allowGuestStart !== undefined) { + hasAnyValues = true; + internalValueResult.allowGuestStart = this._allowGuestStart; + } + if (this._callinRestriction !== undefined) { + hasAnyValues = true; + internalValueResult.callinRestriction = this._callinRestriction; + } + if (this._guestPassword !== undefined) { + hasAnyValues = true; + internalValueResult.guestPassword = this._guestPassword; + } + if (this._isAutoMute !== undefined) { + hasAnyValues = true; + internalValueResult.isAutoMute = this._isAutoMute; + } + if (this._isGuestFreePassword !== undefined) { + hasAnyValues = true; + internalValueResult.isGuestFreePassword = this._isGuestFreePassword; + } + if (this._isHardTerminalAutoMute !== undefined) { + hasAnyValues = true; + internalValueResult.isHardTerminalAutoMute = this._isHardTerminalAutoMute; + } + if (this._isSendCalendar !== undefined) { + hasAnyValues = true; + internalValueResult.isSendCalendar = this._isSendCalendar; + } + if (this._isSendNotify !== undefined) { + hasAnyValues = true; + internalValueResult.isSendNotify = this._isSendNotify; + } + if (this._isSendSms !== undefined) { + hasAnyValues = true; + internalValueResult.isSendSms = this._isSendSms; + } + if (this._prolongTime !== undefined) { + hasAnyValues = true; + internalValueResult.prolongTime = this._prolongTime; + } + if (this._waitingRoomEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.waitingRoomEnabled = this._waitingRoomEnabled; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceConfiguration | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._allowGuestStart = undefined; + this._callinRestriction = undefined; + this._guestPassword = undefined; + this._isAutoMute = undefined; + this._isGuestFreePassword = undefined; + this._isHardTerminalAutoMute = undefined; + this._isSendCalendar = undefined; + this._isSendNotify = undefined; + this._isSendSms = undefined; + this._prolongTime = undefined; + this._waitingRoomEnabled = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._allowGuestStart = value.allowGuestStart; + this._callinRestriction = value.callinRestriction; + this._guestPassword = value.guestPassword; + this._isAutoMute = value.isAutoMute; + this._isGuestFreePassword = value.isGuestFreePassword; + this._isHardTerminalAutoMute = value.isHardTerminalAutoMute; + this._isSendCalendar = value.isSendCalendar; + this._isSendNotify = value.isSendNotify; + this._isSendSms = value.isSendSms; + this._prolongTime = value.prolongTime; + this._waitingRoomEnabled = value.waitingRoomEnabled; + } + } + + // allow_guest_start - computed: true, optional: true, required: false + private _allowGuestStart?: boolean | cdktf.IResolvable; + public get allowGuestStart() { + return this.getBooleanAttribute('allow_guest_start'); + } + public set allowGuestStart(value: boolean | cdktf.IResolvable) { + this._allowGuestStart = value; + } + public resetAllowGuestStart() { + this._allowGuestStart = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowGuestStartInput() { + return this._allowGuestStart; + } + + // callin_restriction - computed: true, optional: true, required: false + private _callinRestriction?: number; + public get callinRestriction() { + return this.getNumberAttribute('callin_restriction'); + } + public set callinRestriction(value: number) { + this._callinRestriction = value; + } + public resetCallinRestriction() { + this._callinRestriction = undefined; + } + // Temporarily expose input value. Use with caution. + public get callinRestrictionInput() { + return this._callinRestriction; + } + + // guest_password - computed: true, optional: true, required: false + private _guestPassword?: string; + public get guestPassword() { + return this.getStringAttribute('guest_password'); + } + public set guestPassword(value: string) { + this._guestPassword = value; + } + public resetGuestPassword() { + this._guestPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get guestPasswordInput() { + return this._guestPassword; + } + + // is_auto_mute - computed: true, optional: true, required: false + private _isAutoMute?: boolean | cdktf.IResolvable; + public get isAutoMute() { + return this.getBooleanAttribute('is_auto_mute'); + } + public set isAutoMute(value: boolean | cdktf.IResolvable) { + this._isAutoMute = value; + } + public resetIsAutoMute() { + this._isAutoMute = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAutoMuteInput() { + return this._isAutoMute; + } + + // is_guest_free_password - computed: true, optional: true, required: false + private _isGuestFreePassword?: boolean | cdktf.IResolvable; + public get isGuestFreePassword() { + return this.getBooleanAttribute('is_guest_free_password'); + } + public set isGuestFreePassword(value: boolean | cdktf.IResolvable) { + this._isGuestFreePassword = value; + } + public resetIsGuestFreePassword() { + this._isGuestFreePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get isGuestFreePasswordInput() { + return this._isGuestFreePassword; + } + + // is_hard_terminal_auto_mute - computed: true, optional: true, required: false + private _isHardTerminalAutoMute?: boolean | cdktf.IResolvable; + public get isHardTerminalAutoMute() { + return this.getBooleanAttribute('is_hard_terminal_auto_mute'); + } + public set isHardTerminalAutoMute(value: boolean | cdktf.IResolvable) { + this._isHardTerminalAutoMute = value; + } + public resetIsHardTerminalAutoMute() { + this._isHardTerminalAutoMute = undefined; + } + // Temporarily expose input value. Use with caution. + public get isHardTerminalAutoMuteInput() { + return this._isHardTerminalAutoMute; + } + + // is_send_calendar - computed: true, optional: true, required: false + private _isSendCalendar?: boolean | cdktf.IResolvable; + public get isSendCalendar() { + return this.getBooleanAttribute('is_send_calendar'); + } + public set isSendCalendar(value: boolean | cdktf.IResolvable) { + this._isSendCalendar = value; + } + public resetIsSendCalendar() { + this._isSendCalendar = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSendCalendarInput() { + return this._isSendCalendar; + } + + // is_send_notify - computed: true, optional: true, required: false + private _isSendNotify?: boolean | cdktf.IResolvable; + public get isSendNotify() { + return this.getBooleanAttribute('is_send_notify'); + } + public set isSendNotify(value: boolean | cdktf.IResolvable) { + this._isSendNotify = value; + } + public resetIsSendNotify() { + this._isSendNotify = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSendNotifyInput() { + return this._isSendNotify; + } + + // is_send_sms - computed: true, optional: true, required: false + private _isSendSms?: boolean | cdktf.IResolvable; + public get isSendSms() { + return this.getBooleanAttribute('is_send_sms'); + } + public set isSendSms(value: boolean | cdktf.IResolvable) { + this._isSendSms = value; + } + public resetIsSendSms() { + this._isSendSms = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSendSmsInput() { + return this._isSendSms; + } + + // prolong_time - computed: true, optional: true, required: false + private _prolongTime?: number; + public get prolongTime() { + return this.getNumberAttribute('prolong_time'); + } + public set prolongTime(value: number) { + this._prolongTime = value; + } + public resetProlongTime() { + this._prolongTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get prolongTimeInput() { + return this._prolongTime; + } + + // waiting_room_enabled - computed: true, optional: true, required: false + private _waitingRoomEnabled?: boolean | cdktf.IResolvable; + public get waitingRoomEnabled() { + return this.getBooleanAttribute('waiting_room_enabled'); + } + public set waitingRoomEnabled(value: boolean | cdktf.IResolvable) { + this._waitingRoomEnabled = value; + } + public resetWaitingRoomEnabled() { + this._waitingRoomEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get waitingRoomEnabledInput() { + return this._waitingRoomEnabled; + } +} +export interface MeetingConferenceCycleParams { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#cycle MeetingConference#cycle} + */ + readonly cycle: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#end_date MeetingConference#end_date} + */ + readonly endDate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#interval MeetingConference#interval} + */ + readonly interval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#points MeetingConference#points} + */ + readonly points?: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#pre_remind MeetingConference#pre_remind} + */ + readonly preRemind: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#start_date MeetingConference#start_date} + */ + readonly startDate: string; +} + +export function meetingConferenceCycleParamsToTerraform(struct?: MeetingConferenceCycleParamsOutputReference | MeetingConferenceCycleParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cycle: cdktf.stringToTerraform(struct!.cycle), + end_date: cdktf.stringToTerraform(struct!.endDate), + interval: cdktf.numberToTerraform(struct!.interval), + points: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.points), + pre_remind: cdktf.numberToTerraform(struct!.preRemind), + start_date: cdktf.stringToTerraform(struct!.startDate), + } +} + + +export function meetingConferenceCycleParamsToHclTerraform(struct?: MeetingConferenceCycleParamsOutputReference | MeetingConferenceCycleParams): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cycle: { + value: cdktf.stringToHclTerraform(struct!.cycle), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_date: { + value: cdktf.stringToHclTerraform(struct!.endDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + points: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.points), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + pre_remind: { + value: cdktf.numberToHclTerraform(struct!.preRemind), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_date: { + value: cdktf.stringToHclTerraform(struct!.startDate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MeetingConferenceCycleParamsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MeetingConferenceCycleParams | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cycle !== undefined) { + hasAnyValues = true; + internalValueResult.cycle = this._cycle; + } + if (this._endDate !== undefined) { + hasAnyValues = true; + internalValueResult.endDate = this._endDate; + } + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._points !== undefined) { + hasAnyValues = true; + internalValueResult.points = this._points; + } + if (this._preRemind !== undefined) { + hasAnyValues = true; + internalValueResult.preRemind = this._preRemind; + } + if (this._startDate !== undefined) { + hasAnyValues = true; + internalValueResult.startDate = this._startDate; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceCycleParams | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cycle = undefined; + this._endDate = undefined; + this._interval = undefined; + this._points = undefined; + this._preRemind = undefined; + this._startDate = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cycle = value.cycle; + this._endDate = value.endDate; + this._interval = value.interval; + this._points = value.points; + this._preRemind = value.preRemind; + this._startDate = value.startDate; + } + } + + // cycle - computed: false, optional: false, required: true + private _cycle?: string; + public get cycle() { + return this.getStringAttribute('cycle'); + } + public set cycle(value: string) { + this._cycle = value; + } + // Temporarily expose input value. Use with caution. + public get cycleInput() { + return this._cycle; + } + + // end_date - computed: false, optional: false, required: true + private _endDate?: string; + public get endDate() { + return this.getStringAttribute('end_date'); + } + public set endDate(value: string) { + this._endDate = value; + } + // Temporarily expose input value. Use with caution. + public get endDateInput() { + return this._endDate; + } + + // interval - computed: true, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // points - computed: true, optional: true, required: false + private _points?: number[]; + public get points() { + return this.getNumberListAttribute('points'); + } + public set points(value: number[]) { + this._points = value; + } + public resetPoints() { + this._points = undefined; + } + // Temporarily expose input value. Use with caution. + public get pointsInput() { + return this._points; + } + + // pre_remind - computed: false, optional: false, required: true + private _preRemind?: number; + public get preRemind() { + return this.getNumberAttribute('pre_remind'); + } + public set preRemind(value: number) { + this._preRemind = value; + } + // Temporarily expose input value. Use with caution. + public get preRemindInput() { + return this._preRemind; + } + + // start_date - computed: false, optional: false, required: true + private _startDate?: string; + public get startDate() { + return this.getStringAttribute('start_date'); + } + public set startDate(value: string) { + this._startDate = value; + } + // Temporarily expose input value. Use with caution. + public get startDateInput() { + return this._startDate; + } +} +export interface MeetingConferenceParticipant { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#account_id MeetingConference#account_id} + */ + readonly accountId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#email MeetingConference#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_auto_invite MeetingConference#is_auto_invite} + */ + readonly isAutoInvite?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#is_mute MeetingConference#is_mute} + */ + readonly isMute?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#name MeetingConference#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#phone MeetingConference#phone} + */ + readonly phone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#role MeetingConference#role} + */ + readonly role?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#sms MeetingConference#sms} + */ + readonly sms?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#type MeetingConference#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#user_id MeetingConference#user_id} + */ + readonly userId?: string; +} + +export function meetingConferenceParticipantToTerraform(struct?: MeetingConferenceParticipant | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + account_id: cdktf.stringToTerraform(struct!.accountId), + email: cdktf.stringToTerraform(struct!.email), + is_auto_invite: cdktf.numberToTerraform(struct!.isAutoInvite), + is_mute: cdktf.numberToTerraform(struct!.isMute), + name: cdktf.stringToTerraform(struct!.name), + phone: cdktf.stringToTerraform(struct!.phone), + role: cdktf.numberToTerraform(struct!.role), + sms: cdktf.stringToTerraform(struct!.sms), + type: cdktf.stringToTerraform(struct!.type), + user_id: cdktf.stringToTerraform(struct!.userId), + } +} + + +export function meetingConferenceParticipantToHclTerraform(struct?: MeetingConferenceParticipant | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(struct!.accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(struct!.email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_auto_invite: { + value: cdktf.numberToHclTerraform(struct!.isAutoInvite), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + is_mute: { + value: cdktf.numberToHclTerraform(struct!.isMute), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone: { + value: cdktf.stringToHclTerraform(struct!.phone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role: { + value: cdktf.numberToHclTerraform(struct!.role), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sms: { + value: cdktf.stringToHclTerraform(struct!.sms), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(struct!.userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MeetingConferenceParticipantOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MeetingConferenceParticipant | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accountId !== undefined) { + hasAnyValues = true; + internalValueResult.accountId = this._accountId; + } + if (this._email !== undefined) { + hasAnyValues = true; + internalValueResult.email = this._email; + } + if (this._isAutoInvite !== undefined) { + hasAnyValues = true; + internalValueResult.isAutoInvite = this._isAutoInvite; + } + if (this._isMute !== undefined) { + hasAnyValues = true; + internalValueResult.isMute = this._isMute; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._phone !== undefined) { + hasAnyValues = true; + internalValueResult.phone = this._phone; + } + if (this._role !== undefined) { + hasAnyValues = true; + internalValueResult.role = this._role; + } + if (this._sms !== undefined) { + hasAnyValues = true; + internalValueResult.sms = this._sms; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._userId !== undefined) { + hasAnyValues = true; + internalValueResult.userId = this._userId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MeetingConferenceParticipant | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accountId = undefined; + this._email = undefined; + this._isAutoInvite = undefined; + this._isMute = undefined; + this._name = undefined; + this._phone = undefined; + this._role = undefined; + this._sms = undefined; + this._type = undefined; + this._userId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accountId = value.accountId; + this._email = value.email; + this._isAutoInvite = value.isAutoInvite; + this._isMute = value.isMute; + this._name = value.name; + this._phone = value.phone; + this._role = value.role; + this._sms = value.sms; + this._type = value.type; + this._userId = value.userId; + } + } + + // account_id - computed: true, optional: true, required: false + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + public resetAccountId() { + this._accountId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // email - computed: true, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // is_auto_invite - computed: true, optional: true, required: false + private _isAutoInvite?: number; + public get isAutoInvite() { + return this.getNumberAttribute('is_auto_invite'); + } + public set isAutoInvite(value: number) { + this._isAutoInvite = value; + } + public resetIsAutoInvite() { + this._isAutoInvite = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAutoInviteInput() { + return this._isAutoInvite; + } + + // is_mute - computed: true, optional: true, required: false + private _isMute?: number; + public get isMute() { + return this.getNumberAttribute('is_mute'); + } + public set isMute(value: number) { + this._isMute = value; + } + public resetIsMute() { + this._isMute = undefined; + } + // Temporarily expose input value. Use with caution. + public get isMuteInput() { + return this._isMute; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // phone - computed: true, optional: true, required: false + private _phone?: string; + public get phone() { + return this.getStringAttribute('phone'); + } + public set phone(value: string) { + this._phone = value; + } + public resetPhone() { + this._phone = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneInput() { + return this._phone; + } + + // role - computed: true, optional: true, required: false + private _role?: number; + public get role() { + return this.getNumberAttribute('role'); + } + public set role(value: number) { + this._role = value; + } + public resetRole() { + this._role = undefined; + } + // Temporarily expose input value. Use with caution. + public get roleInput() { + return this._role; + } + + // sms - computed: true, optional: true, required: false + private _sms?: string; + public get sms() { + return this.getStringAttribute('sms'); + } + public set sms(value: string) { + this._sms = value; + } + public resetSms() { + this._sms = undefined; + } + // Temporarily expose input value. Use with caution. + public get smsInput() { + return this._sms; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_id - computed: true, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } +} + +export class MeetingConferenceParticipantList extends cdktf.ComplexList { + public internalValue? : MeetingConferenceParticipant[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MeetingConferenceParticipantOutputReference { + return new MeetingConferenceParticipantOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference huaweicloud_meeting_conference} +*/ +export class MeetingConference extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_meeting_conference"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MeetingConference resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MeetingConference to import + * @param importFromId The id of the existing MeetingConference that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MeetingConference to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_meeting_conference", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_conference huaweicloud_meeting_conference} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MeetingConferenceConfig + */ + public constructor(scope: Construct, id: string, config: MeetingConferenceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_meeting_conference', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountName = config.accountName; + this._accountPassword = config.accountPassword; + this._appId = config.appId; + this._appKey = config.appKey; + this._auxAddress = config.auxAddress; + this._corpId = config.corpId; + this._duration = config.duration; + this._encryptMode = config.encryptMode; + this._id = config.id; + this._isAutoRecord = config.isAutoRecord; + this._isRecordAuxStream = config.isRecordAuxStream; + this._language = config.language; + this._liveAddress = config.liveAddress; + this._mediaTypes = config.mediaTypes; + this._meetingRoomId = config.meetingRoomId; + this._participantNumber = config.participantNumber; + this._recordAuthType = config.recordAuthType; + this._recordType = config.recordType; + this._startTime = config.startTime; + this._timezoneId = config.timezoneId; + this._topic = config.topic; + this._userId = config.userId; + this._configuration.internalValue = config.configuration; + this._cycleParams.internalValue = config.cycleParams; + this._participant.internalValue = config.participant; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_number - computed: true, optional: false, required: false + public get accessNumber() { + return this.getStringAttribute('access_number'); + } + + // account_name - computed: false, optional: true, required: false + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + public resetAccountName() { + this._accountName = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // account_password - computed: false, optional: true, required: false + private _accountPassword?: string; + public get accountPassword() { + return this.getStringAttribute('account_password'); + } + public set accountPassword(value: string) { + this._accountPassword = value; + } + public resetAccountPassword() { + this._accountPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountPasswordInput() { + return this._accountPassword; + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // app_key - computed: false, optional: true, required: false + private _appKey?: string; + public get appKey() { + return this.getStringAttribute('app_key'); + } + public set appKey(value: string) { + this._appKey = value; + } + public resetAppKey() { + this._appKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get appKeyInput() { + return this._appKey; + } + + // audience_join_uri - computed: true, optional: false, required: false + public get audienceJoinUri() { + return this.getStringAttribute('audience_join_uri'); + } + + // aux_address - computed: true, optional: true, required: false + private _auxAddress?: string; + public get auxAddress() { + return this.getStringAttribute('aux_address'); + } + public set auxAddress(value: string) { + this._auxAddress = value; + } + public resetAuxAddress() { + this._auxAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get auxAddressInput() { + return this._auxAddress; + } + + // chair_join_uri - computed: true, optional: false, required: false + public get chairJoinUri() { + return this.getStringAttribute('chair_join_uri'); + } + + // conference_type - computed: true, optional: false, required: false + public get conferenceType() { + return this.getStringAttribute('conference_type'); + } + + // conference_uuid - computed: true, optional: false, required: false + public get conferenceUuid() { + return this.getStringAttribute('conference_uuid'); + } + + // corp_id - computed: true, optional: true, required: false + private _corpId?: string; + public get corpId() { + return this.getStringAttribute('corp_id'); + } + public set corpId(value: string) { + this._corpId = value; + } + public resetCorpId() { + this._corpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get corpIdInput() { + return this._corpId; + } + + // duration - computed: false, optional: false, required: true + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // encrypt_mode - computed: true, optional: true, required: false + private _encryptMode?: number; + public get encryptMode() { + return this.getNumberAttribute('encrypt_mode'); + } + public set encryptMode(value: number) { + this._encryptMode = value; + } + public resetEncryptMode() { + this._encryptMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptModeInput() { + return this._encryptMode; + } + + // guest_join_uri - computed: true, optional: false, required: false + public get guestJoinUri() { + return this.getStringAttribute('guest_join_uri'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_auto_record - computed: true, optional: true, required: false + private _isAutoRecord?: number; + public get isAutoRecord() { + return this.getNumberAttribute('is_auto_record'); + } + public set isAutoRecord(value: number) { + this._isAutoRecord = value; + } + public resetIsAutoRecord() { + this._isAutoRecord = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAutoRecordInput() { + return this._isAutoRecord; + } + + // is_record_aux_stream - computed: true, optional: true, required: false + private _isRecordAuxStream?: number; + public get isRecordAuxStream() { + return this.getNumberAttribute('is_record_aux_stream'); + } + public set isRecordAuxStream(value: number) { + this._isRecordAuxStream = value; + } + public resetIsRecordAuxStream() { + this._isRecordAuxStream = undefined; + } + // Temporarily expose input value. Use with caution. + public get isRecordAuxStreamInput() { + return this._isRecordAuxStream; + } + + // join_password - computed: true, optional: false, required: false + private _joinPassword = new MeetingConferenceJoinPasswordList(this, "join_password", false); + public get joinPassword() { + return this._joinPassword; + } + + // language - computed: true, optional: true, required: false + private _language?: string; + public get language() { + return this.getStringAttribute('language'); + } + public set language(value: string) { + this._language = value; + } + public resetLanguage() { + this._language = undefined; + } + // Temporarily expose input value. Use with caution. + public get languageInput() { + return this._language; + } + + // live_address - computed: true, optional: true, required: false + private _liveAddress?: string; + public get liveAddress() { + return this.getStringAttribute('live_address'); + } + public set liveAddress(value: string) { + this._liveAddress = value; + } + public resetLiveAddress() { + this._liveAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get liveAddressInput() { + return this._liveAddress; + } + + // media_types - computed: true, optional: true, required: false + private _mediaTypes?: string[]; + public get mediaTypes() { + return cdktf.Fn.tolist(this.getListAttribute('media_types')); + } + public set mediaTypes(value: string[]) { + this._mediaTypes = value; + } + public resetMediaTypes() { + this._mediaTypes = undefined; + } + // Temporarily expose input value. Use with caution. + public get mediaTypesInput() { + return this._mediaTypes; + } + + // meeting_room_id - computed: false, optional: false, required: true + private _meetingRoomId?: string; + public get meetingRoomId() { + return this.getStringAttribute('meeting_room_id'); + } + public set meetingRoomId(value: string) { + this._meetingRoomId = value; + } + // Temporarily expose input value. Use with caution. + public get meetingRoomIdInput() { + return this._meetingRoomId; + } + + // participant_number - computed: false, optional: true, required: false + private _participantNumber?: number; + public get participantNumber() { + return this.getNumberAttribute('participant_number'); + } + public set participantNumber(value: number) { + this._participantNumber = value; + } + public resetParticipantNumber() { + this._participantNumber = undefined; + } + // Temporarily expose input value. Use with caution. + public get participantNumberInput() { + return this._participantNumber; + } + + // record_auth_type - computed: true, optional: true, required: false + private _recordAuthType?: number; + public get recordAuthType() { + return this.getNumberAttribute('record_auth_type'); + } + public set recordAuthType(value: number) { + this._recordAuthType = value; + } + public resetRecordAuthType() { + this._recordAuthType = undefined; + } + // Temporarily expose input value. Use with caution. + public get recordAuthTypeInput() { + return this._recordAuthType; + } + + // record_type - computed: true, optional: true, required: false + private _recordType?: number; + public get recordType() { + return this.getNumberAttribute('record_type'); + } + public set recordType(value: number) { + this._recordType = value; + } + public resetRecordType() { + this._recordType = undefined; + } + // Temporarily expose input value. Use with caution. + public get recordTypeInput() { + return this._recordType; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subconferences - computed: true, optional: false, required: false + private _subconferences = new MeetingConferenceSubconferencesList(this, "subconferences", false); + public get subconferences() { + return this._subconferences; + } + + // timezone_id - computed: true, optional: true, required: false + private _timezoneId?: number; + public get timezoneId() { + return this.getNumberAttribute('timezone_id'); + } + public set timezoneId(value: number) { + this._timezoneId = value; + } + public resetTimezoneId() { + this._timezoneId = undefined; + } + // Temporarily expose input value. Use with caution. + public get timezoneIdInput() { + return this._timezoneId; + } + + // topic - computed: false, optional: false, required: true + private _topic?: string; + public get topic() { + return this.getStringAttribute('topic'); + } + public set topic(value: string) { + this._topic = value; + } + // Temporarily expose input value. Use with caution. + public get topicInput() { + return this._topic; + } + + // user_id - computed: true, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // configuration - computed: false, optional: true, required: false + private _configuration = new MeetingConferenceConfigurationOutputReference(this, "configuration"); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: MeetingConferenceConfiguration) { + this._configuration.internalValue = value; + } + public resetConfiguration() { + this._configuration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } + + // cycle_params - computed: false, optional: true, required: false + private _cycleParams = new MeetingConferenceCycleParamsOutputReference(this, "cycle_params"); + public get cycleParams() { + return this._cycleParams; + } + public putCycleParams(value: MeetingConferenceCycleParams) { + this._cycleParams.internalValue = value; + } + public resetCycleParams() { + this._cycleParams.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get cycleParamsInput() { + return this._cycleParams.internalValue; + } + + // participant - computed: false, optional: true, required: false + private _participant = new MeetingConferenceParticipantList(this, "participant", false); + public get participant() { + return this._participant; + } + public putParticipant(value: MeetingConferenceParticipant[] | cdktf.IResolvable) { + this._participant.internalValue = value; + } + public resetParticipant() { + this._participant.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get participantInput() { + return this._participant.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_name: cdktf.stringToTerraform(this._accountName), + account_password: cdktf.stringToTerraform(this._accountPassword), + app_id: cdktf.stringToTerraform(this._appId), + app_key: cdktf.stringToTerraform(this._appKey), + aux_address: cdktf.stringToTerraform(this._auxAddress), + corp_id: cdktf.stringToTerraform(this._corpId), + duration: cdktf.numberToTerraform(this._duration), + encrypt_mode: cdktf.numberToTerraform(this._encryptMode), + id: cdktf.stringToTerraform(this._id), + is_auto_record: cdktf.numberToTerraform(this._isAutoRecord), + is_record_aux_stream: cdktf.numberToTerraform(this._isRecordAuxStream), + language: cdktf.stringToTerraform(this._language), + live_address: cdktf.stringToTerraform(this._liveAddress), + media_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._mediaTypes), + meeting_room_id: cdktf.stringToTerraform(this._meetingRoomId), + participant_number: cdktf.numberToTerraform(this._participantNumber), + record_auth_type: cdktf.numberToTerraform(this._recordAuthType), + record_type: cdktf.numberToTerraform(this._recordType), + start_time: cdktf.stringToTerraform(this._startTime), + timezone_id: cdktf.numberToTerraform(this._timezoneId), + topic: cdktf.stringToTerraform(this._topic), + user_id: cdktf.stringToTerraform(this._userId), + configuration: meetingConferenceConfigurationToTerraform(this._configuration.internalValue), + cycle_params: meetingConferenceCycleParamsToTerraform(this._cycleParams.internalValue), + participant: cdktf.listMapper(meetingConferenceParticipantToTerraform, true)(this._participant.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_password: { + value: cdktf.stringToHclTerraform(this._accountPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_key: { + value: cdktf.stringToHclTerraform(this._appKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + aux_address: { + value: cdktf.stringToHclTerraform(this._auxAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + corp_id: { + value: cdktf.stringToHclTerraform(this._corpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + duration: { + value: cdktf.numberToHclTerraform(this._duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + encrypt_mode: { + value: cdktf.numberToHclTerraform(this._encryptMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_auto_record: { + value: cdktf.numberToHclTerraform(this._isAutoRecord), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + is_record_aux_stream: { + value: cdktf.numberToHclTerraform(this._isRecordAuxStream), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + language: { + value: cdktf.stringToHclTerraform(this._language), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + live_address: { + value: cdktf.stringToHclTerraform(this._liveAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + media_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._mediaTypes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + meeting_room_id: { + value: cdktf.stringToHclTerraform(this._meetingRoomId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + participant_number: { + value: cdktf.numberToHclTerraform(this._participantNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + record_auth_type: { + value: cdktf.numberToHclTerraform(this._recordAuthType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + record_type: { + value: cdktf.numberToHclTerraform(this._recordType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timezone_id: { + value: cdktf.numberToHclTerraform(this._timezoneId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + topic: { + value: cdktf.stringToHclTerraform(this._topic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration: { + value: meetingConferenceConfigurationToHclTerraform(this._configuration.internalValue), + isBlock: true, + type: "list", + storageClassType: "MeetingConferenceConfigurationList", + }, + cycle_params: { + value: meetingConferenceCycleParamsToHclTerraform(this._cycleParams.internalValue), + isBlock: true, + type: "list", + storageClassType: "MeetingConferenceCycleParamsList", + }, + participant: { + value: cdktf.listMapperHcl(meetingConferenceParticipantToHclTerraform, true)(this._participant.internalValue), + isBlock: true, + type: "list", + storageClassType: "MeetingConferenceParticipantList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/meeting-user/README.md b/src/constructs/providers/huaweicloud/meeting-user/README.md new file mode 100644 index 00000000..da4e6fa3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/meeting-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_meeting_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_meeting_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user). diff --git a/src/constructs/providers/huaweicloud/meeting-user/index.ts b/src/constructs/providers/huaweicloud/meeting-user/index.ts new file mode 100644 index 00000000..89188193 --- /dev/null +++ b/src/constructs/providers/huaweicloud/meeting-user/index.ts @@ -0,0 +1,774 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MeetingUserConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#account MeetingUser#account} + */ + readonly account?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#account_name MeetingUser#account_name} + */ + readonly accountName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#account_password MeetingUser#account_password} + */ + readonly accountPassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#app_id MeetingUser#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#app_key MeetingUser#app_key} + */ + readonly appKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#corp_id MeetingUser#corp_id} + */ + readonly corpId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#country MeetingUser#country} + */ + readonly country?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#department_code MeetingUser#department_code} + */ + readonly departmentCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#description MeetingUser#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#email MeetingUser#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#english_name MeetingUser#english_name} + */ + readonly englishName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#hide_phone MeetingUser#hide_phone} + */ + readonly hidePhone?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#id MeetingUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#is_admin MeetingUser#is_admin} + */ + readonly isAdmin?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#is_send_notify MeetingUser#is_send_notify} + */ + readonly isSendNotify?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#name MeetingUser#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#password MeetingUser#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#phone MeetingUser#phone} + */ + readonly phone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#signature MeetingUser#signature} + */ + readonly signature?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#sort_level MeetingUser#sort_level} + */ + readonly sortLevel?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#status MeetingUser#status} + */ + readonly status?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#third_account MeetingUser#third_account} + */ + readonly thirdAccount?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#title MeetingUser#title} + */ + readonly title?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#user_id MeetingUser#user_id} + */ + readonly userId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user huaweicloud_meeting_user} +*/ +export class MeetingUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_meeting_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MeetingUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MeetingUser to import + * @param importFromId The id of the existing MeetingUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MeetingUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_meeting_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/meeting_user huaweicloud_meeting_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MeetingUserConfig + */ + public constructor(scope: Construct, id: string, config: MeetingUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_meeting_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._account = config.account; + this._accountName = config.accountName; + this._accountPassword = config.accountPassword; + this._appId = config.appId; + this._appKey = config.appKey; + this._corpId = config.corpId; + this._country = config.country; + this._departmentCode = config.departmentCode; + this._description = config.description; + this._email = config.email; + this._englishName = config.englishName; + this._hidePhone = config.hidePhone; + this._id = config.id; + this._isAdmin = config.isAdmin; + this._isSendNotify = config.isSendNotify; + this._name = config.name; + this._password = config.password; + this._phone = config.phone; + this._signature = config.signature; + this._sortLevel = config.sortLevel; + this._status = config.status; + this._thirdAccount = config.thirdAccount; + this._title = config.title; + this._userId = config.userId; + } + + // ========== + // ATTRIBUTES + // ========== + + // account - computed: true, optional: true, required: false + private _account?: string; + public get account() { + return this.getStringAttribute('account'); + } + public set account(value: string) { + this._account = value; + } + public resetAccount() { + this._account = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountInput() { + return this._account; + } + + // account_name - computed: false, optional: true, required: false + private _accountName?: string; + public get accountName() { + return this.getStringAttribute('account_name'); + } + public set accountName(value: string) { + this._accountName = value; + } + public resetAccountName() { + this._accountName = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountNameInput() { + return this._accountName; + } + + // account_password - computed: false, optional: true, required: false + private _accountPassword?: string; + public get accountPassword() { + return this.getStringAttribute('account_password'); + } + public set accountPassword(value: string) { + this._accountPassword = value; + } + public resetAccountPassword() { + this._accountPassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountPasswordInput() { + return this._accountPassword; + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // app_key - computed: false, optional: true, required: false + private _appKey?: string; + public get appKey() { + return this.getStringAttribute('app_key'); + } + public set appKey(value: string) { + this._appKey = value; + } + public resetAppKey() { + this._appKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get appKeyInput() { + return this._appKey; + } + + // corp_id - computed: true, optional: true, required: false + private _corpId?: string; + public get corpId() { + return this.getStringAttribute('corp_id'); + } + public set corpId(value: string) { + this._corpId = value; + } + public resetCorpId() { + this._corpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get corpIdInput() { + return this._corpId; + } + + // country - computed: true, optional: true, required: false + private _country?: string; + public get country() { + return this.getStringAttribute('country'); + } + public set country(value: string) { + this._country = value; + } + public resetCountry() { + this._country = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryInput() { + return this._country; + } + + // department_code - computed: true, optional: true, required: false + private _departmentCode?: string; + public get departmentCode() { + return this.getStringAttribute('department_code'); + } + public set departmentCode(value: string) { + this._departmentCode = value; + } + public resetDepartmentCode() { + this._departmentCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get departmentCodeInput() { + return this._departmentCode; + } + + // department_name - computed: true, optional: false, required: false + public get departmentName() { + return this.getStringAttribute('department_name'); + } + + // department_name_path - computed: true, optional: false, required: false + public get departmentNamePath() { + return this.getStringAttribute('department_name_path'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // email - computed: true, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // english_name - computed: true, optional: true, required: false + private _englishName?: string; + public get englishName() { + return this.getStringAttribute('english_name'); + } + public set englishName(value: string) { + this._englishName = value; + } + public resetEnglishName() { + this._englishName = undefined; + } + // Temporarily expose input value. Use with caution. + public get englishNameInput() { + return this._englishName; + } + + // hide_phone - computed: true, optional: true, required: false + private _hidePhone?: boolean | cdktf.IResolvable; + public get hidePhone() { + return this.getBooleanAttribute('hide_phone'); + } + public set hidePhone(value: boolean | cdktf.IResolvable) { + this._hidePhone = value; + } + public resetHidePhone() { + this._hidePhone = undefined; + } + // Temporarily expose input value. Use with caution. + public get hidePhoneInput() { + return this._hidePhone; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_admin - computed: true, optional: true, required: false + private _isAdmin?: boolean | cdktf.IResolvable; + public get isAdmin() { + return this.getBooleanAttribute('is_admin'); + } + public set isAdmin(value: boolean | cdktf.IResolvable) { + this._isAdmin = value; + } + public resetIsAdmin() { + this._isAdmin = undefined; + } + // Temporarily expose input value. Use with caution. + public get isAdminInput() { + return this._isAdmin; + } + + // is_send_notify - computed: false, optional: true, required: false + private _isSendNotify?: boolean | cdktf.IResolvable; + public get isSendNotify() { + return this.getBooleanAttribute('is_send_notify'); + } + public set isSendNotify(value: boolean | cdktf.IResolvable) { + this._isSendNotify = value; + } + public resetIsSendNotify() { + this._isSendNotify = undefined; + } + // Temporarily expose input value. Use with caution. + public get isSendNotifyInput() { + return this._isSendNotify; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // phone - computed: true, optional: true, required: false + private _phone?: string; + public get phone() { + return this.getStringAttribute('phone'); + } + public set phone(value: string) { + this._phone = value; + } + public resetPhone() { + this._phone = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneInput() { + return this._phone; + } + + // signature - computed: true, optional: true, required: false + private _signature?: string; + public get signature() { + return this.getStringAttribute('signature'); + } + public set signature(value: string) { + this._signature = value; + } + public resetSignature() { + this._signature = undefined; + } + // Temporarily expose input value. Use with caution. + public get signatureInput() { + return this._signature; + } + + // sip_number - computed: true, optional: false, required: false + public get sipNumber() { + return this.getStringAttribute('sip_number'); + } + + // sort_level - computed: true, optional: true, required: false + private _sortLevel?: number; + public get sortLevel() { + return this.getNumberAttribute('sort_level'); + } + public set sortLevel(value: number) { + this._sortLevel = value; + } + public resetSortLevel() { + this._sortLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortLevelInput() { + return this._sortLevel; + } + + // status - computed: true, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // third_account - computed: true, optional: true, required: false + private _thirdAccount?: string; + public get thirdAccount() { + return this.getStringAttribute('third_account'); + } + public set thirdAccount(value: string) { + this._thirdAccount = value; + } + public resetThirdAccount() { + this._thirdAccount = undefined; + } + // Temporarily expose input value. Use with caution. + public get thirdAccountInput() { + return this._thirdAccount; + } + + // title - computed: true, optional: true, required: false + private _title?: string; + public get title() { + return this.getStringAttribute('title'); + } + public set title(value: string) { + this._title = value; + } + public resetTitle() { + this._title = undefined; + } + // Temporarily expose input value. Use with caution. + public get titleInput() { + return this._title; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } + + // user_id - computed: true, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account: cdktf.stringToTerraform(this._account), + account_name: cdktf.stringToTerraform(this._accountName), + account_password: cdktf.stringToTerraform(this._accountPassword), + app_id: cdktf.stringToTerraform(this._appId), + app_key: cdktf.stringToTerraform(this._appKey), + corp_id: cdktf.stringToTerraform(this._corpId), + country: cdktf.stringToTerraform(this._country), + department_code: cdktf.stringToTerraform(this._departmentCode), + description: cdktf.stringToTerraform(this._description), + email: cdktf.stringToTerraform(this._email), + english_name: cdktf.stringToTerraform(this._englishName), + hide_phone: cdktf.booleanToTerraform(this._hidePhone), + id: cdktf.stringToTerraform(this._id), + is_admin: cdktf.booleanToTerraform(this._isAdmin), + is_send_notify: cdktf.booleanToTerraform(this._isSendNotify), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + phone: cdktf.stringToTerraform(this._phone), + signature: cdktf.stringToTerraform(this._signature), + sort_level: cdktf.numberToTerraform(this._sortLevel), + status: cdktf.numberToTerraform(this._status), + third_account: cdktf.stringToTerraform(this._thirdAccount), + title: cdktf.stringToTerraform(this._title), + user_id: cdktf.stringToTerraform(this._userId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account: { + value: cdktf.stringToHclTerraform(this._account), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_name: { + value: cdktf.stringToHclTerraform(this._accountName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_password: { + value: cdktf.stringToHclTerraform(this._accountPassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_key: { + value: cdktf.stringToHclTerraform(this._appKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + corp_id: { + value: cdktf.stringToHclTerraform(this._corpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country: { + value: cdktf.stringToHclTerraform(this._country), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + department_code: { + value: cdktf.stringToHclTerraform(this._departmentCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + english_name: { + value: cdktf.stringToHclTerraform(this._englishName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hide_phone: { + value: cdktf.booleanToHclTerraform(this._hidePhone), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_admin: { + value: cdktf.booleanToHclTerraform(this._isAdmin), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_send_notify: { + value: cdktf.booleanToHclTerraform(this._isSendNotify), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone: { + value: cdktf.stringToHclTerraform(this._phone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + signature: { + value: cdktf.stringToHclTerraform(this._signature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_level: { + value: cdktf.numberToHclTerraform(this._sortLevel), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + third_account: { + value: cdktf.stringToHclTerraform(this._thirdAccount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + title: { + value: cdktf.stringToHclTerraform(this._title), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-authorization/README.md b/src/constructs/providers/huaweicloud/modelarts-authorization/README.md new file mode 100644 index 00000000..ddef9c23 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization). diff --git a/src/constructs/providers/huaweicloud/modelarts-authorization/index.ts b/src/constructs/providers/huaweicloud/modelarts-authorization/index.ts new file mode 100644 index 00000000..2983a658 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-authorization/index.ts @@ -0,0 +1,230 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * Agency name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization#agency_name ModelartsAuthorization#agency_name} + */ + readonly agencyName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization#id ModelartsAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization#region ModelartsAuthorization#region} + */ + readonly region?: string; + /** + * Authorization type. The valid value is **agency**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization#type ModelartsAuthorization#type} + */ + readonly type: string; + /** + * User ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization#user_id ModelartsAuthorization#user_id} + */ + readonly userId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization huaweicloud_modelarts_authorization} +*/ +export class ModelartsAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsAuthorization to import + * @param importFromId The id of the existing ModelartsAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_authorization huaweicloud_modelarts_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._id = config.id; + this._region = config.region; + this._type = config.type; + this._userId = config.userId; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: false, optional: false, required: true + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + user_id: cdktf.stringToTerraform(this._userId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-dataset-version/README.md b/src/constructs/providers/huaweicloud/modelarts-dataset-version/README.md new file mode 100644 index 00000000..564cf52b --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-dataset-version/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_dataset_version` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_dataset_version`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version). diff --git a/src/constructs/providers/huaweicloud/modelarts-dataset-version/index.ts b/src/constructs/providers/huaweicloud/modelarts-dataset-version/index.ts new file mode 100644 index 00000000..b210215a --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-dataset-version/index.ts @@ -0,0 +1,447 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsDatasetVersionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#dataset_id ModelartsDatasetVersion#dataset_id} + */ + readonly datasetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#description ModelartsDatasetVersion#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#hard_example ModelartsDatasetVersion#hard_example} + */ + readonly hardExample?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#id ModelartsDatasetVersion#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#name ModelartsDatasetVersion#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#region ModelartsDatasetVersion#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#split_ratio ModelartsDatasetVersion#split_ratio} + */ + readonly splitRatio?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#timeouts ModelartsDatasetVersion#timeouts} + */ + readonly timeouts?: ModelartsDatasetVersionTimeouts; +} +export interface ModelartsDatasetVersionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#create ModelartsDatasetVersion#create} + */ + readonly create?: string; +} + +export function modelartsDatasetVersionTimeoutsToTerraform(struct?: ModelartsDatasetVersionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function modelartsDatasetVersionTimeoutsToHclTerraform(struct?: ModelartsDatasetVersionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsDatasetVersionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsDatasetVersionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsDatasetVersionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version huaweicloud_modelarts_dataset_version} +*/ +export class ModelartsDatasetVersion extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_dataset_version"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsDatasetVersion resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsDatasetVersion to import + * @param importFromId The id of the existing ModelartsDatasetVersion that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsDatasetVersion to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_dataset_version", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset_version huaweicloud_modelarts_dataset_version} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsDatasetVersionConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsDatasetVersionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_dataset_version', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._datasetId = config.datasetId; + this._description = config.description; + this._hardExample = config.hardExample; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._splitRatio = config.splitRatio; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dataset_id - computed: false, optional: false, required: true + private _datasetId?: string; + public get datasetId() { + return this.getStringAttribute('dataset_id'); + } + public set datasetId(value: string) { + this._datasetId = value; + } + // Temporarily expose input value. Use with caution. + public get datasetIdInput() { + return this._datasetId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // files - computed: true, optional: false, required: false + public get files() { + return this.getNumberAttribute('files'); + } + + // hard_example - computed: false, optional: true, required: false + private _hardExample?: boolean | cdktf.IResolvable; + public get hardExample() { + return this.getBooleanAttribute('hard_example'); + } + public set hardExample(value: boolean | cdktf.IResolvable) { + this._hardExample = value; + } + public resetHardExample() { + this._hardExample = undefined; + } + // Temporarily expose input value. Use with caution. + public get hardExampleInput() { + return this._hardExample; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_current - computed: true, optional: false, required: false + public get isCurrent() { + return this.getBooleanAttribute('is_current'); + } + + // labeling_type - computed: true, optional: false, required: false + public get labelingType() { + return this.getStringAttribute('labeling_type'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // split_ratio - computed: false, optional: true, required: false + private _splitRatio?: string; + public get splitRatio() { + return this.getStringAttribute('split_ratio'); + } + public set splitRatio(value: string) { + this._splitRatio = value; + } + public resetSplitRatio() { + this._splitRatio = undefined; + } + // Temporarily expose input value. Use with caution. + public get splitRatioInput() { + return this._splitRatio; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // storage_path - computed: true, optional: false, required: false + public get storagePath() { + return this.getStringAttribute('storage_path'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // verification - computed: true, optional: false, required: false + public get verification() { + return this.getBooleanAttribute('verification'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsDatasetVersionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsDatasetVersionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dataset_id: cdktf.stringToTerraform(this._datasetId), + description: cdktf.stringToTerraform(this._description), + hard_example: cdktf.booleanToTerraform(this._hardExample), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + split_ratio: cdktf.stringToTerraform(this._splitRatio), + timeouts: modelartsDatasetVersionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dataset_id: { + value: cdktf.stringToHclTerraform(this._datasetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hard_example: { + value: cdktf.booleanToHclTerraform(this._hardExample), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + split_ratio: { + value: cdktf.stringToHclTerraform(this._splitRatio), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: modelartsDatasetVersionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsDatasetVersionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-dataset/README.md b/src/constructs/providers/huaweicloud/modelarts-dataset/README.md new file mode 100644 index 00000000..d33fe1f0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-dataset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_dataset` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_dataset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset). diff --git a/src/constructs/providers/huaweicloud/modelarts-dataset/index.ts b/src/constructs/providers/huaweicloud/modelarts-dataset/index.ts new file mode 100644 index 00000000..d2b835ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-dataset/index.ts @@ -0,0 +1,1417 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsDatasetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#description ModelartsDataset#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#id ModelartsDataset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#import_labeled_enabled ModelartsDataset#import_labeled_enabled} + */ + readonly importLabeledEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#name ModelartsDataset#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#output_path ModelartsDataset#output_path} + */ + readonly outputPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#region ModelartsDataset#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#type ModelartsDataset#type} + */ + readonly type: number; + /** + * data_source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#data_source ModelartsDataset#data_source} + */ + readonly dataSource: ModelartsDatasetDataSource; + /** + * label_format block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#label_format ModelartsDataset#label_format} + */ + readonly labelFormat?: ModelartsDatasetLabelFormat; + /** + * labels block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#labels ModelartsDataset#labels} + */ + readonly labels?: ModelartsDatasetLabels[] | cdktf.IResolvable; + /** + * schemas block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#schemas ModelartsDataset#schemas} + */ + readonly schemas?: ModelartsDatasetSchemas[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#timeouts ModelartsDataset#timeouts} + */ + readonly timeouts?: ModelartsDatasetTimeouts; +} +export interface ModelartsDatasetDataSource { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#cluster_id ModelartsDataset#cluster_id} + */ + readonly clusterId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#data_type ModelartsDataset#data_type} + */ + readonly dataType?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#database_name ModelartsDataset#database_name} + */ + readonly databaseName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#password ModelartsDataset#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#path ModelartsDataset#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#queue_name ModelartsDataset#queue_name} + */ + readonly queueName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#table_name ModelartsDataset#table_name} + */ + readonly tableName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#user_name ModelartsDataset#user_name} + */ + readonly userName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#with_column_header ModelartsDataset#with_column_header} + */ + readonly withColumnHeader?: boolean | cdktf.IResolvable; +} + +export function modelartsDatasetDataSourceToTerraform(struct?: ModelartsDatasetDataSourceOutputReference | ModelartsDatasetDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cluster_id: cdktf.stringToTerraform(struct!.clusterId), + data_type: cdktf.numberToTerraform(struct!.dataType), + database_name: cdktf.stringToTerraform(struct!.databaseName), + password: cdktf.stringToTerraform(struct!.password), + path: cdktf.stringToTerraform(struct!.path), + queue_name: cdktf.stringToTerraform(struct!.queueName), + table_name: cdktf.stringToTerraform(struct!.tableName), + user_name: cdktf.stringToTerraform(struct!.userName), + with_column_header: cdktf.booleanToTerraform(struct!.withColumnHeader), + } +} + + +export function modelartsDatasetDataSourceToHclTerraform(struct?: ModelartsDatasetDataSourceOutputReference | ModelartsDatasetDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(struct!.clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_type: { + value: cdktf.numberToHclTerraform(struct!.dataType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + database_name: { + value: cdktf.stringToHclTerraform(struct!.databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + queue_name: { + value: cdktf.stringToHclTerraform(struct!.queueName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + table_name: { + value: cdktf.stringToHclTerraform(struct!.tableName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + with_column_header: { + value: cdktf.booleanToHclTerraform(struct!.withColumnHeader), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsDatasetDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsDatasetDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusterId !== undefined) { + hasAnyValues = true; + internalValueResult.clusterId = this._clusterId; + } + if (this._dataType !== undefined) { + hasAnyValues = true; + internalValueResult.dataType = this._dataType; + } + if (this._databaseName !== undefined) { + hasAnyValues = true; + internalValueResult.databaseName = this._databaseName; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._queueName !== undefined) { + hasAnyValues = true; + internalValueResult.queueName = this._queueName; + } + if (this._tableName !== undefined) { + hasAnyValues = true; + internalValueResult.tableName = this._tableName; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + if (this._withColumnHeader !== undefined) { + hasAnyValues = true; + internalValueResult.withColumnHeader = this._withColumnHeader; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsDatasetDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._clusterId = undefined; + this._dataType = undefined; + this._databaseName = undefined; + this._password = undefined; + this._path = undefined; + this._queueName = undefined; + this._tableName = undefined; + this._userName = undefined; + this._withColumnHeader = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._clusterId = value.clusterId; + this._dataType = value.dataType; + this._databaseName = value.databaseName; + this._password = value.password; + this._path = value.path; + this._queueName = value.queueName; + this._tableName = value.tableName; + this._userName = value.userName; + this._withColumnHeader = value.withColumnHeader; + } + } + + // cluster_id - computed: false, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // data_type - computed: false, optional: true, required: false + private _dataType?: number; + public get dataType() { + return this.getNumberAttribute('data_type'); + } + public set dataType(value: number) { + this._dataType = value; + } + public resetDataType() { + this._dataType = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataTypeInput() { + return this._dataType; + } + + // database_name - computed: false, optional: true, required: false + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // queue_name - computed: false, optional: true, required: false + private _queueName?: string; + public get queueName() { + return this.getStringAttribute('queue_name'); + } + public set queueName(value: string) { + this._queueName = value; + } + public resetQueueName() { + this._queueName = undefined; + } + // Temporarily expose input value. Use with caution. + public get queueNameInput() { + return this._queueName; + } + + // table_name - computed: false, optional: true, required: false + private _tableName?: string; + public get tableName() { + return this.getStringAttribute('table_name'); + } + public set tableName(value: string) { + this._tableName = value; + } + public resetTableName() { + this._tableName = undefined; + } + // Temporarily expose input value. Use with caution. + public get tableNameInput() { + return this._tableName; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // with_column_header - computed: false, optional: true, required: false + private _withColumnHeader?: boolean | cdktf.IResolvable; + public get withColumnHeader() { + return this.getBooleanAttribute('with_column_header'); + } + public set withColumnHeader(value: boolean | cdktf.IResolvable) { + this._withColumnHeader = value; + } + public resetWithColumnHeader() { + this._withColumnHeader = undefined; + } + // Temporarily expose input value. Use with caution. + public get withColumnHeaderInput() { + return this._withColumnHeader; + } +} +export interface ModelartsDatasetLabelFormat { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#label_separator ModelartsDataset#label_separator} + */ + readonly labelSeparator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#text_label_separator ModelartsDataset#text_label_separator} + */ + readonly textLabelSeparator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#type ModelartsDataset#type} + */ + readonly type?: string; +} + +export function modelartsDatasetLabelFormatToTerraform(struct?: ModelartsDatasetLabelFormatOutputReference | ModelartsDatasetLabelFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + label_separator: cdktf.stringToTerraform(struct!.labelSeparator), + text_label_separator: cdktf.stringToTerraform(struct!.textLabelSeparator), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function modelartsDatasetLabelFormatToHclTerraform(struct?: ModelartsDatasetLabelFormatOutputReference | ModelartsDatasetLabelFormat): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + label_separator: { + value: cdktf.stringToHclTerraform(struct!.labelSeparator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + text_label_separator: { + value: cdktf.stringToHclTerraform(struct!.textLabelSeparator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsDatasetLabelFormatOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsDatasetLabelFormat | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._labelSeparator !== undefined) { + hasAnyValues = true; + internalValueResult.labelSeparator = this._labelSeparator; + } + if (this._textLabelSeparator !== undefined) { + hasAnyValues = true; + internalValueResult.textLabelSeparator = this._textLabelSeparator; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsDatasetLabelFormat | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._labelSeparator = undefined; + this._textLabelSeparator = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._labelSeparator = value.labelSeparator; + this._textLabelSeparator = value.textLabelSeparator; + this._type = value.type; + } + } + + // label_separator - computed: false, optional: true, required: false + private _labelSeparator?: string; + public get labelSeparator() { + return this.getStringAttribute('label_separator'); + } + public set labelSeparator(value: string) { + this._labelSeparator = value; + } + public resetLabelSeparator() { + this._labelSeparator = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelSeparatorInput() { + return this._labelSeparator; + } + + // text_label_separator - computed: false, optional: true, required: false + private _textLabelSeparator?: string; + public get textLabelSeparator() { + return this.getStringAttribute('text_label_separator'); + } + public set textLabelSeparator(value: string) { + this._textLabelSeparator = value; + } + public resetTextLabelSeparator() { + this._textLabelSeparator = undefined; + } + // Temporarily expose input value. Use with caution. + public get textLabelSeparatorInput() { + return this._textLabelSeparator; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface ModelartsDatasetLabels { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#name ModelartsDataset#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#property_color ModelartsDataset#property_color} + */ + readonly propertyColor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#property_shape ModelartsDataset#property_shape} + */ + readonly propertyShape?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#property_shortcut ModelartsDataset#property_shortcut} + */ + readonly propertyShortcut?: string; +} + +export function modelartsDatasetLabelsToTerraform(struct?: ModelartsDatasetLabels | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + property_color: cdktf.stringToTerraform(struct!.propertyColor), + property_shape: cdktf.stringToTerraform(struct!.propertyShape), + property_shortcut: cdktf.stringToTerraform(struct!.propertyShortcut), + } +} + + +export function modelartsDatasetLabelsToHclTerraform(struct?: ModelartsDatasetLabels | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property_color: { + value: cdktf.stringToHclTerraform(struct!.propertyColor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property_shape: { + value: cdktf.stringToHclTerraform(struct!.propertyShape), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + property_shortcut: { + value: cdktf.stringToHclTerraform(struct!.propertyShortcut), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsDatasetLabelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsDatasetLabels | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._propertyColor !== undefined) { + hasAnyValues = true; + internalValueResult.propertyColor = this._propertyColor; + } + if (this._propertyShape !== undefined) { + hasAnyValues = true; + internalValueResult.propertyShape = this._propertyShape; + } + if (this._propertyShortcut !== undefined) { + hasAnyValues = true; + internalValueResult.propertyShortcut = this._propertyShortcut; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsDatasetLabels | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._propertyColor = undefined; + this._propertyShape = undefined; + this._propertyShortcut = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._propertyColor = value.propertyColor; + this._propertyShape = value.propertyShape; + this._propertyShortcut = value.propertyShortcut; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // property_color - computed: true, optional: true, required: false + private _propertyColor?: string; + public get propertyColor() { + return this.getStringAttribute('property_color'); + } + public set propertyColor(value: string) { + this._propertyColor = value; + } + public resetPropertyColor() { + this._propertyColor = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertyColorInput() { + return this._propertyColor; + } + + // property_shape - computed: true, optional: true, required: false + private _propertyShape?: string; + public get propertyShape() { + return this.getStringAttribute('property_shape'); + } + public set propertyShape(value: string) { + this._propertyShape = value; + } + public resetPropertyShape() { + this._propertyShape = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertyShapeInput() { + return this._propertyShape; + } + + // property_shortcut - computed: true, optional: true, required: false + private _propertyShortcut?: string; + public get propertyShortcut() { + return this.getStringAttribute('property_shortcut'); + } + public set propertyShortcut(value: string) { + this._propertyShortcut = value; + } + public resetPropertyShortcut() { + this._propertyShortcut = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertyShortcutInput() { + return this._propertyShortcut; + } +} + +export class ModelartsDatasetLabelsList extends cdktf.ComplexList { + public internalValue? : ModelartsDatasetLabels[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsDatasetLabelsOutputReference { + return new ModelartsDatasetLabelsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsDatasetSchemas { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#name ModelartsDataset#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#type ModelartsDataset#type} + */ + readonly type: string; +} + +export function modelartsDatasetSchemasToTerraform(struct?: ModelartsDatasetSchemas | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function modelartsDatasetSchemasToHclTerraform(struct?: ModelartsDatasetSchemas | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsDatasetSchemasOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsDatasetSchemas | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsDatasetSchemas | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ModelartsDatasetSchemasList extends cdktf.ComplexList { + public internalValue? : ModelartsDatasetSchemas[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsDatasetSchemasOutputReference { + return new ModelartsDatasetSchemasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsDatasetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#create ModelartsDataset#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#delete ModelartsDataset#delete} + */ + readonly delete?: string; +} + +export function modelartsDatasetTimeoutsToTerraform(struct?: ModelartsDatasetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function modelartsDatasetTimeoutsToHclTerraform(struct?: ModelartsDatasetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsDatasetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsDatasetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsDatasetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset huaweicloud_modelarts_dataset} +*/ +export class ModelartsDataset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_dataset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsDataset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsDataset to import + * @param importFromId The id of the existing ModelartsDataset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsDataset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_dataset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_dataset huaweicloud_modelarts_dataset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsDatasetConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsDatasetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_dataset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._importLabeledEnabled = config.importLabeledEnabled; + this._name = config.name; + this._outputPath = config.outputPath; + this._region = config.region; + this._type = config.type; + this._dataSource.internalValue = config.dataSource; + this._labelFormat.internalValue = config.labelFormat; + this._labels.internalValue = config.labels; + this._schemas.internalValue = config.schemas; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // data_format - computed: true, optional: false, required: false + public get dataFormat() { + return this.getStringAttribute('data_format'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // import_labeled_enabled - computed: false, optional: true, required: false + private _importLabeledEnabled?: boolean | cdktf.IResolvable; + public get importLabeledEnabled() { + return this.getBooleanAttribute('import_labeled_enabled'); + } + public set importLabeledEnabled(value: boolean | cdktf.IResolvable) { + this._importLabeledEnabled = value; + } + public resetImportLabeledEnabled() { + this._importLabeledEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get importLabeledEnabledInput() { + return this._importLabeledEnabled; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // output_path - computed: false, optional: false, required: true + private _outputPath?: string; + public get outputPath() { + return this.getStringAttribute('output_path'); + } + public set outputPath(value: string) { + this._outputPath = value; + } + // Temporarily expose input value. Use with caution. + public get outputPathInput() { + return this._outputPath; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // data_source - computed: false, optional: false, required: true + private _dataSource = new ModelartsDatasetDataSourceOutputReference(this, "data_source"); + public get dataSource() { + return this._dataSource; + } + public putDataSource(value: ModelartsDatasetDataSource) { + this._dataSource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource.internalValue; + } + + // label_format - computed: false, optional: true, required: false + private _labelFormat = new ModelartsDatasetLabelFormatOutputReference(this, "label_format"); + public get labelFormat() { + return this._labelFormat; + } + public putLabelFormat(value: ModelartsDatasetLabelFormat) { + this._labelFormat.internalValue = value; + } + public resetLabelFormat() { + this._labelFormat.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelFormatInput() { + return this._labelFormat.internalValue; + } + + // labels - computed: false, optional: true, required: false + private _labels = new ModelartsDatasetLabelsList(this, "labels", false); + public get labels() { + return this._labels; + } + public putLabels(value: ModelartsDatasetLabels[] | cdktf.IResolvable) { + this._labels.internalValue = value; + } + public resetLabels() { + this._labels.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels.internalValue; + } + + // schemas - computed: false, optional: true, required: false + private _schemas = new ModelartsDatasetSchemasList(this, "schemas", false); + public get schemas() { + return this._schemas; + } + public putSchemas(value: ModelartsDatasetSchemas[] | cdktf.IResolvable) { + this._schemas.internalValue = value; + } + public resetSchemas() { + this._schemas.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemasInput() { + return this._schemas.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsDatasetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsDatasetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + import_labeled_enabled: cdktf.booleanToTerraform(this._importLabeledEnabled), + name: cdktf.stringToTerraform(this._name), + output_path: cdktf.stringToTerraform(this._outputPath), + region: cdktf.stringToTerraform(this._region), + type: cdktf.numberToTerraform(this._type), + data_source: modelartsDatasetDataSourceToTerraform(this._dataSource.internalValue), + label_format: modelartsDatasetLabelFormatToTerraform(this._labelFormat.internalValue), + labels: cdktf.listMapper(modelartsDatasetLabelsToTerraform, true)(this._labels.internalValue), + schemas: cdktf.listMapper(modelartsDatasetSchemasToTerraform, true)(this._schemas.internalValue), + timeouts: modelartsDatasetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + import_labeled_enabled: { + value: cdktf.booleanToHclTerraform(this._importLabeledEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + output_path: { + value: cdktf.stringToHclTerraform(this._outputPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + data_source: { + value: modelartsDatasetDataSourceToHclTerraform(this._dataSource.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsDatasetDataSourceList", + }, + label_format: { + value: modelartsDatasetLabelFormatToHclTerraform(this._labelFormat.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsDatasetLabelFormatList", + }, + labels: { + value: cdktf.listMapperHcl(modelartsDatasetLabelsToHclTerraform, true)(this._labels.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsDatasetLabelsList", + }, + schemas: { + value: cdktf.listMapperHcl(modelartsDatasetSchemasToHclTerraform, true)(this._schemas.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsDatasetSchemasList", + }, + timeouts: { + value: modelartsDatasetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsDatasetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-model/README.md b/src/constructs/providers/huaweicloud/modelarts-model/README.md new file mode 100644 index 00000000..c8a7db94 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-model/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_model` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_model`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model). diff --git a/src/constructs/providers/huaweicloud/modelarts-model/index.ts b/src/constructs/providers/huaweicloud/modelarts-model/index.ts new file mode 100644 index 00000000..8cefd674 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-model/index.ts @@ -0,0 +1,1648 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsModelConfig extends cdktf.TerraformMetaArguments { + /** + * Model description that consists of 1 to 100 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#description ModelartsModel#description} + */ + readonly description?: string; + /** + * OBS path for storing the execution code. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#execution_code ModelartsModel#execution_code} + */ + readonly executionCode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#id ModelartsModel#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The model configuration file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#initial_config ModelartsModel#initial_config} + */ + readonly initialConfig?: string; + /** + * Deployment type. Only lowercase letters are supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#install_type ModelartsModel#install_type} + */ + readonly installType?: string[]; + /** + * Model precision. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#metrics ModelartsModel#metrics} + */ + readonly metrics?: string; + /** + * Model algorithm. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#model_algorithm ModelartsModel#model_algorithm} + */ + readonly modelAlgorithm?: string; + /** + * Model type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#model_type ModelartsModel#model_type} + */ + readonly modelType: string; + /** + * Model name, which consists of 1 to 64 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#name ModelartsModel#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#region ModelartsModel#region} + */ + readonly region?: string; + /** + * Model runtime environment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#runtime ModelartsModel#runtime} + */ + readonly runtime?: string; + /** + * Whether to enable image replication. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#source_copy ModelartsModel#source_copy} + */ + readonly sourceCopy?: string; + /** + * ID of the source training job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#source_job_id ModelartsModel#source_job_id} + */ + readonly sourceJobId?: string; + /** + * Version of the source training job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#source_job_version ModelartsModel#source_job_version} + */ + readonly sourceJobVersion?: string; + /** + * OBS path where the model is located or the SWR image location. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#source_location ModelartsModel#source_location} + */ + readonly sourceLocation: string; + /** + * Model source type + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#source_type ModelartsModel#source_type} + */ + readonly sourceType?: string; + /** + * Model version in the format of Digit.Digit.Digit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#version ModelartsModel#version} + */ + readonly version: string; + /** + * Workspace ID, which defaults to 0. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#workspace_id ModelartsModel#workspace_id} + */ + readonly workspaceId?: string; + /** + * dependencies block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#dependencies ModelartsModel#dependencies} + */ + readonly dependencies?: ModelartsModelDependencies[] | cdktf.IResolvable; + /** + * model_docs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#model_docs ModelartsModel#model_docs} + */ + readonly modelDocs?: ModelartsModelModelDocs[] | cdktf.IResolvable; + /** + * template block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#template ModelartsModel#template} + */ + readonly template?: ModelartsModelTemplate; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#timeouts ModelartsModel#timeouts} + */ + readonly timeouts?: ModelartsModelTimeouts; +} +export interface ModelartsModelDependenciesPackages { + /** + * Name of a dependency package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#package_name ModelartsModel#package_name} + */ + readonly packageName: string; + /** + * Version of a dependency package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#package_version ModelartsModel#package_version} + */ + readonly packageVersion?: string; + /** + * Version restriction, which can be **EXACT**, **ATLEAST**, or **ATMOST**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#restraint ModelartsModel#restraint} + */ + readonly restraint?: string; +} + +export function modelartsModelDependenciesPackagesToTerraform(struct?: ModelartsModelDependenciesPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + package_name: cdktf.stringToTerraform(struct!.packageName), + package_version: cdktf.stringToTerraform(struct!.packageVersion), + restraint: cdktf.stringToTerraform(struct!.restraint), + } +} + + +export function modelartsModelDependenciesPackagesToHclTerraform(struct?: ModelartsModelDependenciesPackages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + package_name: { + value: cdktf.stringToHclTerraform(struct!.packageName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + package_version: { + value: cdktf.stringToHclTerraform(struct!.packageVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restraint: { + value: cdktf.stringToHclTerraform(struct!.restraint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsModelDependenciesPackagesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsModelDependenciesPackages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._packageName !== undefined) { + hasAnyValues = true; + internalValueResult.packageName = this._packageName; + } + if (this._packageVersion !== undefined) { + hasAnyValues = true; + internalValueResult.packageVersion = this._packageVersion; + } + if (this._restraint !== undefined) { + hasAnyValues = true; + internalValueResult.restraint = this._restraint; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsModelDependenciesPackages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._packageName = undefined; + this._packageVersion = undefined; + this._restraint = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._packageName = value.packageName; + this._packageVersion = value.packageVersion; + this._restraint = value.restraint; + } + } + + // package_name - computed: false, optional: false, required: true + private _packageName?: string; + public get packageName() { + return this.getStringAttribute('package_name'); + } + public set packageName(value: string) { + this._packageName = value; + } + // Temporarily expose input value. Use with caution. + public get packageNameInput() { + return this._packageName; + } + + // package_version - computed: true, optional: true, required: false + private _packageVersion?: string; + public get packageVersion() { + return this.getStringAttribute('package_version'); + } + public set packageVersion(value: string) { + this._packageVersion = value; + } + public resetPackageVersion() { + this._packageVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get packageVersionInput() { + return this._packageVersion; + } + + // restraint - computed: true, optional: true, required: false + private _restraint?: string; + public get restraint() { + return this.getStringAttribute('restraint'); + } + public set restraint(value: string) { + this._restraint = value; + } + public resetRestraint() { + this._restraint = undefined; + } + // Temporarily expose input value. Use with caution. + public get restraintInput() { + return this._restraint; + } +} + +export class ModelartsModelDependenciesPackagesList extends cdktf.ComplexList { + public internalValue? : ModelartsModelDependenciesPackages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsModelDependenciesPackagesOutputReference { + return new ModelartsModelDependenciesPackagesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsModelDependencies { + /** + * Installation mode. Only **pip** is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#installer ModelartsModel#installer} + */ + readonly installer: string; + /** + * packages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#packages ModelartsModel#packages} + */ + readonly packages: ModelartsModelDependenciesPackages[] | cdktf.IResolvable; +} + +export function modelartsModelDependenciesToTerraform(struct?: ModelartsModelDependencies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + installer: cdktf.stringToTerraform(struct!.installer), + packages: cdktf.listMapper(modelartsModelDependenciesPackagesToTerraform, true)(struct!.packages), + } +} + + +export function modelartsModelDependenciesToHclTerraform(struct?: ModelartsModelDependencies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + installer: { + value: cdktf.stringToHclTerraform(struct!.installer), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + packages: { + value: cdktf.listMapperHcl(modelartsModelDependenciesPackagesToHclTerraform, true)(struct!.packages), + isBlock: true, + type: "list", + storageClassType: "ModelartsModelDependenciesPackagesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsModelDependenciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsModelDependencies | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._installer !== undefined) { + hasAnyValues = true; + internalValueResult.installer = this._installer; + } + if (this._packages?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.packages = this._packages?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsModelDependencies | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._installer = undefined; + this._packages.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._installer = value.installer; + this._packages.internalValue = value.packages; + } + } + + // installer - computed: false, optional: false, required: true + private _installer?: string; + public get installer() { + return this.getStringAttribute('installer'); + } + public set installer(value: string) { + this._installer = value; + } + // Temporarily expose input value. Use with caution. + public get installerInput() { + return this._installer; + } + + // packages - computed: false, optional: false, required: true + private _packages = new ModelartsModelDependenciesPackagesList(this, "packages", false); + public get packages() { + return this._packages; + } + public putPackages(value: ModelartsModelDependenciesPackages[] | cdktf.IResolvable) { + this._packages.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get packagesInput() { + return this._packages.internalValue; + } +} + +export class ModelartsModelDependenciesList extends cdktf.ComplexList { + public internalValue? : ModelartsModelDependencies[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsModelDependenciesOutputReference { + return new ModelartsModelDependenciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsModelModelDocs { + /** + * Document name, which must start with a letter. Enter 1 to 48 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#doc_name ModelartsModel#doc_name} + */ + readonly docName?: string; + /** + * HTTP(S) link of the document. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#doc_url ModelartsModel#doc_url} + */ + readonly docUrl?: string; +} + +export function modelartsModelModelDocsToTerraform(struct?: ModelartsModelModelDocs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + doc_name: cdktf.stringToTerraform(struct!.docName), + doc_url: cdktf.stringToTerraform(struct!.docUrl), + } +} + + +export function modelartsModelModelDocsToHclTerraform(struct?: ModelartsModelModelDocs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + doc_name: { + value: cdktf.stringToHclTerraform(struct!.docName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + doc_url: { + value: cdktf.stringToHclTerraform(struct!.docUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsModelModelDocsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsModelModelDocs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._docName !== undefined) { + hasAnyValues = true; + internalValueResult.docName = this._docName; + } + if (this._docUrl !== undefined) { + hasAnyValues = true; + internalValueResult.docUrl = this._docUrl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsModelModelDocs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._docName = undefined; + this._docUrl = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._docName = value.docName; + this._docUrl = value.docUrl; + } + } + + // doc_name - computed: true, optional: true, required: false + private _docName?: string; + public get docName() { + return this.getStringAttribute('doc_name'); + } + public set docName(value: string) { + this._docName = value; + } + public resetDocName() { + this._docName = undefined; + } + // Temporarily expose input value. Use with caution. + public get docNameInput() { + return this._docName; + } + + // doc_url - computed: true, optional: true, required: false + private _docUrl?: string; + public get docUrl() { + return this.getStringAttribute('doc_url'); + } + public set docUrl(value: string) { + this._docUrl = value; + } + public resetDocUrl() { + this._docUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get docUrlInput() { + return this._docUrl; + } +} + +export class ModelartsModelModelDocsList extends cdktf.ComplexList { + public internalValue? : ModelartsModelModelDocs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsModelModelDocsOutputReference { + return new ModelartsModelModelDocsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsModelTemplateTemplateInputs { + /** + * Template input path, which can be a path to an OBS file or directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#input ModelartsModel#input} + */ + readonly input: string; + /** + * Input item ID, which is obtained from template details. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#input_id ModelartsModel#input_id} + */ + readonly inputId: string; +} + +export function modelartsModelTemplateTemplateInputsToTerraform(struct?: ModelartsModelTemplateTemplateInputs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + input: cdktf.stringToTerraform(struct!.input), + input_id: cdktf.stringToTerraform(struct!.inputId), + } +} + + +export function modelartsModelTemplateTemplateInputsToHclTerraform(struct?: ModelartsModelTemplateTemplateInputs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + input: { + value: cdktf.stringToHclTerraform(struct!.input), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input_id: { + value: cdktf.stringToHclTerraform(struct!.inputId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsModelTemplateTemplateInputsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsModelTemplateTemplateInputs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._input !== undefined) { + hasAnyValues = true; + internalValueResult.input = this._input; + } + if (this._inputId !== undefined) { + hasAnyValues = true; + internalValueResult.inputId = this._inputId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsModelTemplateTemplateInputs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._input = undefined; + this._inputId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._input = value.input; + this._inputId = value.inputId; + } + } + + // input - computed: false, optional: false, required: true + private _input?: string; + public get input() { + return this.getStringAttribute('input'); + } + public set input(value: string) { + this._input = value; + } + // Temporarily expose input value. Use with caution. + public get inputInput() { + return this._input; + } + + // input_id - computed: false, optional: false, required: true + private _inputId?: string; + public get inputId() { + return this.getStringAttribute('input_id'); + } + public set inputId(value: string) { + this._inputId = value; + } + // Temporarily expose input value. Use with caution. + public get inputIdInput() { + return this._inputId; + } +} + +export class ModelartsModelTemplateTemplateInputsList extends cdktf.ComplexList { + public internalValue? : ModelartsModelTemplateTemplateInputs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsModelTemplateTemplateInputsOutputReference { + return new ModelartsModelTemplateTemplateInputsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsModelTemplate { + /** + * ID of the input and output mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#infer_format ModelartsModel#infer_format} + */ + readonly inferFormat?: string; + /** + * ID of the used template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#template_id ModelartsModel#template_id} + */ + readonly templateId: string; + /** + * template_inputs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#template_inputs ModelartsModel#template_inputs} + */ + readonly templateInputs: ModelartsModelTemplateTemplateInputs[] | cdktf.IResolvable; +} + +export function modelartsModelTemplateToTerraform(struct?: ModelartsModelTemplateOutputReference | ModelartsModelTemplate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + infer_format: cdktf.stringToTerraform(struct!.inferFormat), + template_id: cdktf.stringToTerraform(struct!.templateId), + template_inputs: cdktf.listMapper(modelartsModelTemplateTemplateInputsToTerraform, true)(struct!.templateInputs), + } +} + + +export function modelartsModelTemplateToHclTerraform(struct?: ModelartsModelTemplateOutputReference | ModelartsModelTemplate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + infer_format: { + value: cdktf.stringToHclTerraform(struct!.inferFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.stringToHclTerraform(struct!.templateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_inputs: { + value: cdktf.listMapperHcl(modelartsModelTemplateTemplateInputsToHclTerraform, true)(struct!.templateInputs), + isBlock: true, + type: "list", + storageClassType: "ModelartsModelTemplateTemplateInputsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsModelTemplateOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsModelTemplate | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._inferFormat !== undefined) { + hasAnyValues = true; + internalValueResult.inferFormat = this._inferFormat; + } + if (this._templateId !== undefined) { + hasAnyValues = true; + internalValueResult.templateId = this._templateId; + } + if (this._templateInputs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.templateInputs = this._templateInputs?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsModelTemplate | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._inferFormat = undefined; + this._templateId = undefined; + this._templateInputs.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._inferFormat = value.inferFormat; + this._templateId = value.templateId; + this._templateInputs.internalValue = value.templateInputs; + } + } + + // infer_format - computed: true, optional: true, required: false + private _inferFormat?: string; + public get inferFormat() { + return this.getStringAttribute('infer_format'); + } + public set inferFormat(value: string) { + this._inferFormat = value; + } + public resetInferFormat() { + this._inferFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get inferFormatInput() { + return this._inferFormat; + } + + // template_id - computed: false, optional: false, required: true + private _templateId?: string; + public get templateId() { + return this.getStringAttribute('template_id'); + } + public set templateId(value: string) { + this._templateId = value; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // template_inputs - computed: false, optional: false, required: true + private _templateInputs = new ModelartsModelTemplateTemplateInputsList(this, "template_inputs", false); + public get templateInputs() { + return this._templateInputs; + } + public putTemplateInputs(value: ModelartsModelTemplateTemplateInputs[] | cdktf.IResolvable) { + this._templateInputs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get templateInputsInput() { + return this._templateInputs.internalValue; + } +} +export interface ModelartsModelTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#create ModelartsModel#create} + */ + readonly create?: string; +} + +export function modelartsModelTimeoutsToTerraform(struct?: ModelartsModelTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function modelartsModelTimeoutsToHclTerraform(struct?: ModelartsModelTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsModelTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsModelTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsModelTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model huaweicloud_modelarts_model} +*/ +export class ModelartsModel extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_model"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsModel resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsModel to import + * @param importFromId The id of the existing ModelartsModel that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsModel to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_model", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_model huaweicloud_modelarts_model} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsModelConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsModelConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_model', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._executionCode = config.executionCode; + this._id = config.id; + this._initialConfig = config.initialConfig; + this._installType = config.installType; + this._metrics = config.metrics; + this._modelAlgorithm = config.modelAlgorithm; + this._modelType = config.modelType; + this._name = config.name; + this._region = config.region; + this._runtime = config.runtime; + this._sourceCopy = config.sourceCopy; + this._sourceJobId = config.sourceJobId; + this._sourceJobVersion = config.sourceJobVersion; + this._sourceLocation = config.sourceLocation; + this._sourceType = config.sourceType; + this._version = config.version; + this._workspaceId = config.workspaceId; + this._dependencies.internalValue = config.dependencies; + this._modelDocs.internalValue = config.modelDocs; + this._template.internalValue = config.template; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // execution_code - computed: true, optional: true, required: false + private _executionCode?: string; + public get executionCode() { + return this.getStringAttribute('execution_code'); + } + public set executionCode(value: string) { + this._executionCode = value; + } + public resetExecutionCode() { + this._executionCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get executionCodeInput() { + return this._executionCode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_address - computed: true, optional: false, required: false + public get imageAddress() { + return this.getStringAttribute('image_address'); + } + + // initial_config - computed: true, optional: true, required: false + private _initialConfig?: string; + public get initialConfig() { + return this.getStringAttribute('initial_config'); + } + public set initialConfig(value: string) { + this._initialConfig = value; + } + public resetInitialConfig() { + this._initialConfig = undefined; + } + // Temporarily expose input value. Use with caution. + public get initialConfigInput() { + return this._initialConfig; + } + + // install_type - computed: true, optional: true, required: false + private _installType?: string[]; + public get installType() { + return this.getListAttribute('install_type'); + } + public set installType(value: string[]) { + this._installType = value; + } + public resetInstallType() { + this._installType = undefined; + } + // Temporarily expose input value. Use with caution. + public get installTypeInput() { + return this._installType; + } + + // market_flag - computed: true, optional: false, required: false + public get marketFlag() { + return this.getBooleanAttribute('market_flag'); + } + + // metrics - computed: true, optional: true, required: false + private _metrics?: string; + public get metrics() { + return this.getStringAttribute('metrics'); + } + public set metrics(value: string) { + this._metrics = value; + } + public resetMetrics() { + this._metrics = undefined; + } + // Temporarily expose input value. Use with caution. + public get metricsInput() { + return this._metrics; + } + + // model_algorithm - computed: true, optional: true, required: false + private _modelAlgorithm?: string; + public get modelAlgorithm() { + return this.getStringAttribute('model_algorithm'); + } + public set modelAlgorithm(value: string) { + this._modelAlgorithm = value; + } + public resetModelAlgorithm() { + this._modelAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get modelAlgorithmInput() { + return this._modelAlgorithm; + } + + // model_size - computed: true, optional: false, required: false + public get modelSize() { + return this.getNumberAttribute('model_size'); + } + + // model_source - computed: true, optional: false, required: false + public get modelSource() { + return this.getStringAttribute('model_source'); + } + + // model_type - computed: false, optional: false, required: true + private _modelType?: string; + public get modelType() { + return this.getStringAttribute('model_type'); + } + public set modelType(value: string) { + this._modelType = value; + } + // Temporarily expose input value. Use with caution. + public get modelTypeInput() { + return this._modelType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // publishable_flag - computed: true, optional: false, required: false + public get publishableFlag() { + return this.getBooleanAttribute('publishable_flag'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: true, optional: true, required: false + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + public resetRuntime() { + this._runtime = undefined; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // schema_doc - computed: true, optional: false, required: false + public get schemaDoc() { + return this.getStringAttribute('schema_doc'); + } + + // source_copy - computed: true, optional: true, required: false + private _sourceCopy?: string; + public get sourceCopy() { + return this.getStringAttribute('source_copy'); + } + public set sourceCopy(value: string) { + this._sourceCopy = value; + } + public resetSourceCopy() { + this._sourceCopy = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceCopyInput() { + return this._sourceCopy; + } + + // source_job_id - computed: true, optional: true, required: false + private _sourceJobId?: string; + public get sourceJobId() { + return this.getStringAttribute('source_job_id'); + } + public set sourceJobId(value: string) { + this._sourceJobId = value; + } + public resetSourceJobId() { + this._sourceJobId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceJobIdInput() { + return this._sourceJobId; + } + + // source_job_version - computed: true, optional: true, required: false + private _sourceJobVersion?: string; + public get sourceJobVersion() { + return this.getStringAttribute('source_job_version'); + } + public set sourceJobVersion(value: string) { + this._sourceJobVersion = value; + } + public resetSourceJobVersion() { + this._sourceJobVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceJobVersionInput() { + return this._sourceJobVersion; + } + + // source_location - computed: false, optional: false, required: true + private _sourceLocation?: string; + public get sourceLocation() { + return this.getStringAttribute('source_location'); + } + public set sourceLocation(value: string) { + this._sourceLocation = value; + } + // Temporarily expose input value. Use with caution. + public get sourceLocationInput() { + return this._sourceLocation; + } + + // source_type - computed: true, optional: true, required: false + private _sourceType?: string; + public get sourceType() { + return this.getStringAttribute('source_type'); + } + public set sourceType(value: string) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tunable - computed: true, optional: false, required: false + public get tunable() { + return this.getBooleanAttribute('tunable'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // workspace_id - computed: true, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // dependencies - computed: false, optional: true, required: false + private _dependencies = new ModelartsModelDependenciesList(this, "dependencies", false); + public get dependencies() { + return this._dependencies; + } + public putDependencies(value: ModelartsModelDependencies[] | cdktf.IResolvable) { + this._dependencies.internalValue = value; + } + public resetDependencies() { + this._dependencies.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dependenciesInput() { + return this._dependencies.internalValue; + } + + // model_docs - computed: false, optional: true, required: false + private _modelDocs = new ModelartsModelModelDocsList(this, "model_docs", false); + public get modelDocs() { + return this._modelDocs; + } + public putModelDocs(value: ModelartsModelModelDocs[] | cdktf.IResolvable) { + this._modelDocs.internalValue = value; + } + public resetModelDocs() { + this._modelDocs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get modelDocsInput() { + return this._modelDocs.internalValue; + } + + // template - computed: false, optional: true, required: false + private _template = new ModelartsModelTemplateOutputReference(this, "template"); + public get template() { + return this._template; + } + public putTemplate(value: ModelartsModelTemplate) { + this._template.internalValue = value; + } + public resetTemplate() { + this._template.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateInput() { + return this._template.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsModelTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsModelTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + execution_code: cdktf.stringToTerraform(this._executionCode), + id: cdktf.stringToTerraform(this._id), + initial_config: cdktf.stringToTerraform(this._initialConfig), + install_type: cdktf.listMapper(cdktf.stringToTerraform, false)(this._installType), + metrics: cdktf.stringToTerraform(this._metrics), + model_algorithm: cdktf.stringToTerraform(this._modelAlgorithm), + model_type: cdktf.stringToTerraform(this._modelType), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + source_copy: cdktf.stringToTerraform(this._sourceCopy), + source_job_id: cdktf.stringToTerraform(this._sourceJobId), + source_job_version: cdktf.stringToTerraform(this._sourceJobVersion), + source_location: cdktf.stringToTerraform(this._sourceLocation), + source_type: cdktf.stringToTerraform(this._sourceType), + version: cdktf.stringToTerraform(this._version), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + dependencies: cdktf.listMapper(modelartsModelDependenciesToTerraform, true)(this._dependencies.internalValue), + model_docs: cdktf.listMapper(modelartsModelModelDocsToTerraform, true)(this._modelDocs.internalValue), + template: modelartsModelTemplateToTerraform(this._template.internalValue), + timeouts: modelartsModelTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + execution_code: { + value: cdktf.stringToHclTerraform(this._executionCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initial_config: { + value: cdktf.stringToHclTerraform(this._initialConfig), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + install_type: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._installType), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + metrics: { + value: cdktf.stringToHclTerraform(this._metrics), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_algorithm: { + value: cdktf.stringToHclTerraform(this._modelAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_type: { + value: cdktf.stringToHclTerraform(this._modelType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_copy: { + value: cdktf.stringToHclTerraform(this._sourceCopy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_job_id: { + value: cdktf.stringToHclTerraform(this._sourceJobId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_job_version: { + value: cdktf.stringToHclTerraform(this._sourceJobVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_location: { + value: cdktf.stringToHclTerraform(this._sourceLocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.stringToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dependencies: { + value: cdktf.listMapperHcl(modelartsModelDependenciesToHclTerraform, true)(this._dependencies.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsModelDependenciesList", + }, + model_docs: { + value: cdktf.listMapperHcl(modelartsModelModelDocsToHclTerraform, true)(this._modelDocs.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsModelModelDocsList", + }, + template: { + value: modelartsModelTemplateToHclTerraform(this._template.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsModelTemplateList", + }, + timeouts: { + value: modelartsModelTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsModelTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-network/README.md b/src/constructs/providers/huaweicloud/modelarts-network/README.md new file mode 100644 index 00000000..ec5b964a --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-network/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_network` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_network`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network). diff --git a/src/constructs/providers/huaweicloud/modelarts-network/index.ts b/src/constructs/providers/huaweicloud/modelarts-network/index.ts new file mode 100644 index 00000000..a5c89d4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-network/index.ts @@ -0,0 +1,600 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsNetworkConfig extends cdktf.TerraformMetaArguments { + /** + * Network CIDR. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#cidr ModelartsNetwork#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#id ModelartsNetwork#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#name ModelartsNetwork#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#region ModelartsNetwork#region} + */ + readonly region?: string; + /** + * Workspace ID, which defaults to 0. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#workspace_id ModelartsNetwork#workspace_id} + */ + readonly workspaceId?: string; + /** + * peer_connections block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#peer_connections ModelartsNetwork#peer_connections} + */ + readonly peerConnections?: ModelartsNetworkPeerConnections[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#timeouts ModelartsNetwork#timeouts} + */ + readonly timeouts?: ModelartsNetworkTimeouts; +} +export interface ModelartsNetworkPeerConnections { + /** + * ID of the peer subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#subnet_id ModelartsNetwork#subnet_id} + */ + readonly subnetId: string; + /** + * ID of the peer VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#vpc_id ModelartsNetwork#vpc_id} + */ + readonly vpcId: string; +} + +export function modelartsNetworkPeerConnectionsToTerraform(struct?: ModelartsNetworkPeerConnections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function modelartsNetworkPeerConnectionsToHclTerraform(struct?: ModelartsNetworkPeerConnections | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsNetworkPeerConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsNetworkPeerConnections | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsNetworkPeerConnections | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._subnetId = undefined; + this._vpcId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._subnetId = value.subnetId; + this._vpcId = value.vpcId; + } + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} + +export class ModelartsNetworkPeerConnectionsList extends cdktf.ComplexList { + public internalValue? : ModelartsNetworkPeerConnections[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsNetworkPeerConnectionsOutputReference { + return new ModelartsNetworkPeerConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsNetworkTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#create ModelartsNetwork#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#delete ModelartsNetwork#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#update ModelartsNetwork#update} + */ + readonly update?: string; +} + +export function modelartsNetworkTimeoutsToTerraform(struct?: ModelartsNetworkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function modelartsNetworkTimeoutsToHclTerraform(struct?: ModelartsNetworkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsNetworkTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsNetworkTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsNetworkTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network huaweicloud_modelarts_network} +*/ +export class ModelartsNetwork extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_network"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsNetwork resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsNetwork to import + * @param importFromId The id of the existing ModelartsNetwork that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsNetwork to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_network", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_network huaweicloud_modelarts_network} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsNetworkConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsNetworkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_network', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._peerConnections.internalValue = config.peerConnections; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // workspace_id - computed: true, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // peer_connections - computed: false, optional: true, required: false + private _peerConnections = new ModelartsNetworkPeerConnectionsList(this, "peer_connections", false); + public get peerConnections() { + return this._peerConnections; + } + public putPeerConnections(value: ModelartsNetworkPeerConnections[] | cdktf.IResolvable) { + this._peerConnections.internalValue = value; + } + public resetPeerConnections() { + this._peerConnections.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerConnectionsInput() { + return this._peerConnections.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsNetworkTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsNetworkTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + peer_connections: cdktf.listMapper(modelartsNetworkPeerConnectionsToTerraform, true)(this._peerConnections.internalValue), + timeouts: modelartsNetworkTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_connections: { + value: cdktf.listMapperHcl(modelartsNetworkPeerConnectionsToHclTerraform, true)(this._peerConnections.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsNetworkPeerConnectionsList", + }, + timeouts: { + value: modelartsNetworkTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsNetworkTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/README.md b/src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/README.md new file mode 100644 index 00000000..790251db --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_notebook_mount_storage` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_notebook_mount_storage`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage). diff --git a/src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/index.ts b/src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/index.ts new file mode 100644 index 00000000..dcb566a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-notebook-mount-storage/index.ts @@ -0,0 +1,234 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsNotebookMountStorageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage#id ModelartsNotebookMountStorage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage#local_mount_directory ModelartsNotebookMountStorage#local_mount_directory} + */ + readonly localMountDirectory: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage#notebook_id ModelartsNotebookMountStorage#notebook_id} + */ + readonly notebookId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage#region ModelartsNotebookMountStorage#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage#storage_path ModelartsNotebookMountStorage#storage_path} + */ + readonly storagePath: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage huaweicloud_modelarts_notebook_mount_storage} +*/ +export class ModelartsNotebookMountStorage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_notebook_mount_storage"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsNotebookMountStorage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsNotebookMountStorage to import + * @param importFromId The id of the existing ModelartsNotebookMountStorage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsNotebookMountStorage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_notebook_mount_storage", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook_mount_storage huaweicloud_modelarts_notebook_mount_storage} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsNotebookMountStorageConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsNotebookMountStorageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_notebook_mount_storage', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._localMountDirectory = config.localMountDirectory; + this._notebookId = config.notebookId; + this._region = config.region; + this._storagePath = config.storagePath; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // local_mount_directory - computed: false, optional: false, required: true + private _localMountDirectory?: string; + public get localMountDirectory() { + return this.getStringAttribute('local_mount_directory'); + } + public set localMountDirectory(value: string) { + this._localMountDirectory = value; + } + // Temporarily expose input value. Use with caution. + public get localMountDirectoryInput() { + return this._localMountDirectory; + } + + // mount_id - computed: true, optional: false, required: false + public get mountId() { + return this.getStringAttribute('mount_id'); + } + + // notebook_id - computed: false, optional: false, required: true + private _notebookId?: string; + public get notebookId() { + return this.getStringAttribute('notebook_id'); + } + public set notebookId(value: string) { + this._notebookId = value; + } + // Temporarily expose input value. Use with caution. + public get notebookIdInput() { + return this._notebookId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // storage_path - computed: false, optional: false, required: true + private _storagePath?: string; + public get storagePath() { + return this.getStringAttribute('storage_path'); + } + public set storagePath(value: string) { + this._storagePath = value; + } + // Temporarily expose input value. Use with caution. + public get storagePathInput() { + return this._storagePath; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + local_mount_directory: cdktf.stringToTerraform(this._localMountDirectory), + notebook_id: cdktf.stringToTerraform(this._notebookId), + region: cdktf.stringToTerraform(this._region), + storage_path: cdktf.stringToTerraform(this._storagePath), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_mount_directory: { + value: cdktf.stringToHclTerraform(this._localMountDirectory), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + notebook_id: { + value: cdktf.stringToHclTerraform(this._notebookId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_path: { + value: cdktf.stringToHclTerraform(this._storagePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-notebook/README.md b/src/constructs/providers/huaweicloud/modelarts-notebook/README.md new file mode 100644 index 00000000..dce6ae84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-notebook/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_notebook` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_notebook`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook). diff --git a/src/constructs/providers/huaweicloud/modelarts-notebook/index.ts b/src/constructs/providers/huaweicloud/modelarts-notebook/index.ts new file mode 100644 index 00000000..64260481 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-notebook/index.ts @@ -0,0 +1,788 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsNotebookConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#allowed_access_ips ModelartsNotebook#allowed_access_ips} + */ + readonly allowedAccessIps?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#description ModelartsNotebook#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#flavor_id ModelartsNotebook#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#id ModelartsNotebook#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#image_id ModelartsNotebook#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#key_pair ModelartsNotebook#key_pair} + */ + readonly keyPair?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#name ModelartsNotebook#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#pool_id ModelartsNotebook#pool_id} + */ + readonly poolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#region ModelartsNotebook#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#workspace_id ModelartsNotebook#workspace_id} + */ + readonly workspaceId?: string; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#volume ModelartsNotebook#volume} + */ + readonly volume: ModelartsNotebookVolume; +} +export interface ModelartsNotebookMountStorages { +} + +export function modelartsNotebookMountStoragesToTerraform(struct?: ModelartsNotebookMountStorages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function modelartsNotebookMountStoragesToHclTerraform(struct?: ModelartsNotebookMountStorages): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ModelartsNotebookMountStoragesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsNotebookMountStorages | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsNotebookMountStorages | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mount_path - computed: true, optional: false, required: false + public get mountPath() { + return this.getStringAttribute('mount_path'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class ModelartsNotebookMountStoragesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsNotebookMountStoragesOutputReference { + return new ModelartsNotebookMountStoragesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsNotebookVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#id ModelartsNotebook#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#mount_path ModelartsNotebook#mount_path} + */ + readonly mountPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#ownership ModelartsNotebook#ownership} + */ + readonly ownership?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#size ModelartsNotebook#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#type ModelartsNotebook#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#uri ModelartsNotebook#uri} + */ + readonly uri?: string; +} + +export function modelartsNotebookVolumeToTerraform(struct?: ModelartsNotebookVolumeOutputReference | ModelartsNotebookVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + mount_path: cdktf.stringToTerraform(struct!.mountPath), + ownership: cdktf.stringToTerraform(struct!.ownership), + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + uri: cdktf.stringToTerraform(struct!.uri), + } +} + + +export function modelartsNotebookVolumeToHclTerraform(struct?: ModelartsNotebookVolumeOutputReference | ModelartsNotebookVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount_path: { + value: cdktf.stringToHclTerraform(struct!.mountPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ownership: { + value: cdktf.stringToHclTerraform(struct!.ownership), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + uri: { + value: cdktf.stringToHclTerraform(struct!.uri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsNotebookVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsNotebookVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._mountPath !== undefined) { + hasAnyValues = true; + internalValueResult.mountPath = this._mountPath; + } + if (this._ownership !== undefined) { + hasAnyValues = true; + internalValueResult.ownership = this._ownership; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._uri !== undefined) { + hasAnyValues = true; + internalValueResult.uri = this._uri; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsNotebookVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._id = undefined; + this._mountPath = undefined; + this._ownership = undefined; + this._size = undefined; + this._type = undefined; + this._uri = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._id = value.id; + this._mountPath = value.mountPath; + this._ownership = value.ownership; + this._size = value.size; + this._type = value.type; + this._uri = value.uri; + } + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mount_path - computed: true, optional: true, required: false + private _mountPath?: string; + public get mountPath() { + return this.getStringAttribute('mount_path'); + } + public set mountPath(value: string) { + this._mountPath = value; + } + public resetMountPath() { + this._mountPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get mountPathInput() { + return this._mountPath; + } + + // ownership - computed: false, optional: true, required: false + private _ownership?: string; + public get ownership() { + return this.getStringAttribute('ownership'); + } + public set ownership(value: string) { + this._ownership = value; + } + public resetOwnership() { + this._ownership = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownershipInput() { + return this._ownership; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // uri - computed: false, optional: true, required: false + private _uri?: string; + public get uri() { + return this.getStringAttribute('uri'); + } + public set uri(value: string) { + this._uri = value; + } + public resetUri() { + this._uri = undefined; + } + // Temporarily expose input value. Use with caution. + public get uriInput() { + return this._uri; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook huaweicloud_modelarts_notebook} +*/ +export class ModelartsNotebook extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_notebook"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsNotebook resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsNotebook to import + * @param importFromId The id of the existing ModelartsNotebook that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsNotebook to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_notebook", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_notebook huaweicloud_modelarts_notebook} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsNotebookConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsNotebookConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_notebook', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allowedAccessIps = config.allowedAccessIps; + this._description = config.description; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._keyPair = config.keyPair; + this._name = config.name; + this._poolId = config.poolId; + this._region = config.region; + this._workspaceId = config.workspaceId; + this._volume.internalValue = config.volume; + } + + // ========== + // ATTRIBUTES + // ========== + + // allowed_access_ips - computed: false, optional: true, required: false + private _allowedAccessIps?: string[]; + public get allowedAccessIps() { + return this.getListAttribute('allowed_access_ips'); + } + public set allowedAccessIps(value: string[]) { + this._allowedAccessIps = value; + } + public resetAllowedAccessIps() { + this._allowedAccessIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowedAccessIpsInput() { + return this._allowedAccessIps; + } + + // auto_stop_enabled - computed: true, optional: false, required: false + public get autoStopEnabled() { + return this.getBooleanAttribute('auto_stop_enabled'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_name - computed: true, optional: false, required: false + public get imageName() { + return this.getStringAttribute('image_name'); + } + + // image_swr_path - computed: true, optional: false, required: false + public get imageSwrPath() { + return this.getStringAttribute('image_swr_path'); + } + + // image_type - computed: true, optional: false, required: false + public get imageType() { + return this.getStringAttribute('image_type'); + } + + // key_pair - computed: false, optional: true, required: false + private _keyPair?: string; + public get keyPair() { + return this.getStringAttribute('key_pair'); + } + public set keyPair(value: string) { + this._keyPair = value; + } + public resetKeyPair() { + this._keyPair = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairInput() { + return this._keyPair; + } + + // mount_storages - computed: true, optional: false, required: false + private _mountStorages = new ModelartsNotebookMountStoragesList(this, "mount_storages", false); + public get mountStorages() { + return this._mountStorages; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pool_id - computed: false, optional: true, required: false + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + public resetPoolId() { + this._poolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // pool_name - computed: true, optional: false, required: false + public get poolName() { + return this.getStringAttribute('pool_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ssh_uri - computed: true, optional: false, required: false + public get sshUri() { + return this.getStringAttribute('ssh_uri'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // url - computed: true, optional: false, required: false + public get url() { + return this.getStringAttribute('url'); + } + + // workspace_id - computed: true, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // volume - computed: false, optional: false, required: true + private _volume = new ModelartsNotebookVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: ModelartsNotebookVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + allowed_access_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._allowedAccessIps), + description: cdktf.stringToTerraform(this._description), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + key_pair: cdktf.stringToTerraform(this._keyPair), + name: cdktf.stringToTerraform(this._name), + pool_id: cdktf.stringToTerraform(this._poolId), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + volume: modelartsNotebookVolumeToTerraform(this._volume.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + allowed_access_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._allowedAccessIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key_pair: { + value: cdktf.stringToHclTerraform(this._keyPair), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume: { + value: modelartsNotebookVolumeToHclTerraform(this._volume.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsNotebookVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-resource-pool/README.md b/src/constructs/providers/huaweicloud/modelarts-resource-pool/README.md new file mode 100644 index 00000000..c03f3c62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-resource-pool/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_resource_pool` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_resource_pool`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool). diff --git a/src/constructs/providers/huaweicloud/modelarts-resource-pool/index.ts b/src/constructs/providers/huaweicloud/modelarts-resource-pool/index.ts new file mode 100644 index 00000000..38cec504 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-resource-pool/index.ts @@ -0,0 +1,1851 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsResourcePoolConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#auto_renew ModelartsResourcePool#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#charging_mode ModelartsResourcePool#charging_mode} + */ + readonly chargingMode?: string; + /** + * The description of the resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#description ModelartsResourcePool#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#id ModelartsResourcePool#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#name ModelartsResourcePool#name} + */ + readonly name: string; + /** + * The ModelArts network ID of the resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#network_id ModelartsResourcePool#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#period ModelartsResourcePool#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#period_unit ModelartsResourcePool#period_unit} + */ + readonly periodUnit?: string; + /** + * The prefix of the user-defined node name of the resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#prefix ModelartsResourcePool#prefix} + */ + readonly prefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#region ModelartsResourcePool#region} + */ + readonly region?: string; + /** + * List of job types supported by the resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#scope ModelartsResourcePool#scope} + */ + readonly scope?: string[]; + /** + * The network ID of a subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#subnet_id ModelartsResourcePool#subnet_id} + */ + readonly subnetId?: string; + /** + * The VPC ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#vpc_id ModelartsResourcePool#vpc_id} + */ + readonly vpcId?: string; + /** + * Workspace ID, which defaults to 0. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#workspace_id ModelartsResourcePool#workspace_id} + */ + readonly workspaceId?: string; + /** + * clusters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#clusters ModelartsResourcePool#clusters} + */ + readonly clusters?: ModelartsResourcePoolClusters[] | cdktf.IResolvable; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#resources ModelartsResourcePool#resources} + */ + readonly resources: ModelartsResourcePoolResources[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#timeouts ModelartsResourcePool#timeouts} + */ + readonly timeouts?: ModelartsResourcePoolTimeouts; + /** + * user_login block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#user_login ModelartsResourcePool#user_login} + */ + readonly userLogin?: ModelartsResourcePoolUserLogin; +} +export interface ModelartsResourcePoolClusters { + /** + * The ID of the CCE cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#provider_id ModelartsResourcePool#provider_id} + */ + readonly providerId: string; +} + +export function modelartsResourcePoolClustersToTerraform(struct?: ModelartsResourcePoolClusters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + provider_id: cdktf.stringToTerraform(struct!.providerId), + } +} + + +export function modelartsResourcePoolClustersToHclTerraform(struct?: ModelartsResourcePoolClusters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + provider_id: { + value: cdktf.stringToHclTerraform(struct!.providerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsResourcePoolClustersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsResourcePoolClusters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._providerId !== undefined) { + hasAnyValues = true; + internalValueResult.providerId = this._providerId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsResourcePoolClusters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._providerId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._providerId = value.providerId; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // provider_id - computed: false, optional: false, required: true + private _providerId?: string; + public get providerId() { + return this.getStringAttribute('provider_id'); + } + public set providerId(value: string) { + this._providerId = value; + } + // Temporarily expose input value. Use with caution. + public get providerIdInput() { + return this._providerId; + } +} + +export class ModelartsResourcePoolClustersList extends cdktf.ComplexList { + public internalValue? : ModelartsResourcePoolClusters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsResourcePoolClustersOutputReference { + return new ModelartsResourcePoolClustersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsResourcePoolResourcesAzs { + /** + * The AZ name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#az ModelartsResourcePool#az} + */ + readonly az?: string; + /** + * Number of nodes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#count ModelartsResourcePool#count} + */ + readonly count?: number; +} + +export function modelartsResourcePoolResourcesAzsToTerraform(struct?: ModelartsResourcePoolResourcesAzs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + az: cdktf.stringToTerraform(struct!.az), + count: cdktf.numberToTerraform(struct!.count), + } +} + + +export function modelartsResourcePoolResourcesAzsToHclTerraform(struct?: ModelartsResourcePoolResourcesAzs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + az: { + value: cdktf.stringToHclTerraform(struct!.az), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsResourcePoolResourcesAzsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsResourcePoolResourcesAzs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._az !== undefined) { + hasAnyValues = true; + internalValueResult.az = this._az; + } + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsResourcePoolResourcesAzs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._az = undefined; + this._count = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._az = value.az; + this._count = value.count; + } + } + + // az - computed: true, optional: true, required: false + private _az?: string; + public get az() { + return this.getStringAttribute('az'); + } + public set az(value: string) { + this._az = value; + } + public resetAz() { + this._az = undefined; + } + // Temporarily expose input value. Use with caution. + public get azInput() { + return this._az; + } + + // count - computed: true, optional: true, required: false + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + public resetCount() { + this._count = undefined; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } +} + +export class ModelartsResourcePoolResourcesAzsList extends cdktf.ComplexList { + public internalValue? : ModelartsResourcePoolResourcesAzs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsResourcePoolResourcesAzsOutputReference { + return new ModelartsResourcePoolResourcesAzsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsResourcePoolResourcesTaints { + /** + * The effect of the taint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#effect ModelartsResourcePool#effect} + */ + readonly effect: string; + /** + * The key of the taint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#key ModelartsResourcePool#key} + */ + readonly key: string; + /** + * The value of the taint. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#value ModelartsResourcePool#value} + */ + readonly value?: string; +} + +export function modelartsResourcePoolResourcesTaintsToTerraform(struct?: ModelartsResourcePoolResourcesTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + effect: cdktf.stringToTerraform(struct!.effect), + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function modelartsResourcePoolResourcesTaintsToHclTerraform(struct?: ModelartsResourcePoolResourcesTaints | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + effect: { + value: cdktf.stringToHclTerraform(struct!.effect), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsResourcePoolResourcesTaintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsResourcePoolResourcesTaints | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._effect !== undefined) { + hasAnyValues = true; + internalValueResult.effect = this._effect; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsResourcePoolResourcesTaints | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._effect = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._effect = value.effect; + this._key = value.key; + this._value = value.value; + } + } + + // effect - computed: false, optional: false, required: true + private _effect?: string; + public get effect() { + return this.getStringAttribute('effect'); + } + public set effect(value: string) { + this._effect = value; + } + // Temporarily expose input value. Use with caution. + public get effectInput() { + return this._effect; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: true, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ModelartsResourcePoolResourcesTaintsList extends cdktf.ComplexList { + public internalValue? : ModelartsResourcePoolResourcesTaints[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsResourcePoolResourcesTaintsOutputReference { + return new ModelartsResourcePoolResourcesTaintsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsResourcePoolResources { + /** + * Number of resources of the corresponding flavors. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#count ModelartsResourcePool#count} + */ + readonly count: number; + /** + * The resource flavor ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#flavor_id ModelartsResourcePool#flavor_id} + */ + readonly flavorId: string; + /** + * The labels of resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#labels ModelartsResourcePool#labels} + */ + readonly labels?: { [key: string]: string }; + /** + * The max number of resources of the corresponding flavors. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#max_count ModelartsResourcePool#max_count} + */ + readonly maxCount?: number; + /** + * The name of resource pool nodes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#node_pool ModelartsResourcePool#node_pool} + */ + readonly nodePool?: string; + /** + * The script to be executed after security. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#post_install ModelartsResourcePool#post_install} + */ + readonly postInstall?: string; + /** + * The security group IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#security_group_ids ModelartsResourcePool#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * The network ID of a subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#subnet_id ModelartsResourcePool#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#tags ModelartsResourcePool#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#vpc_id ModelartsResourcePool#vpc_id} + */ + readonly vpcId?: string; + /** + * azs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#azs ModelartsResourcePool#azs} + */ + readonly azs?: ModelartsResourcePoolResourcesAzs[] | cdktf.IResolvable; + /** + * taints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#taints ModelartsResourcePool#taints} + */ + readonly taints?: ModelartsResourcePoolResourcesTaints[] | cdktf.IResolvable; +} + +export function modelartsResourcePoolResourcesToTerraform(struct?: ModelartsResourcePoolResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + count: cdktf.numberToTerraform(struct!.count), + flavor_id: cdktf.stringToTerraform(struct!.flavorId), + labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.labels), + max_count: cdktf.numberToTerraform(struct!.maxCount), + node_pool: cdktf.stringToTerraform(struct!.nodePool), + post_install: cdktf.stringToTerraform(struct!.postInstall), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.securityGroupIds), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.tags), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + azs: cdktf.listMapper(modelartsResourcePoolResourcesAzsToTerraform, true)(struct!.azs), + taints: cdktf.listMapper(modelartsResourcePoolResourcesTaintsToTerraform, true)(struct!.taints), + } +} + + +export function modelartsResourcePoolResourcesToHclTerraform(struct?: ModelartsResourcePoolResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + count: { + value: cdktf.numberToHclTerraform(struct!.count), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(struct!.flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.labels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + max_count: { + value: cdktf.numberToHclTerraform(struct!.maxCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + node_pool: { + value: cdktf.stringToHclTerraform(struct!.nodePool), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + post_install: { + value: cdktf.stringToHclTerraform(struct!.postInstall), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + azs: { + value: cdktf.listMapperHcl(modelartsResourcePoolResourcesAzsToHclTerraform, true)(struct!.azs), + isBlock: true, + type: "list", + storageClassType: "ModelartsResourcePoolResourcesAzsList", + }, + taints: { + value: cdktf.listMapperHcl(modelartsResourcePoolResourcesTaintsToHclTerraform, true)(struct!.taints), + isBlock: true, + type: "list", + storageClassType: "ModelartsResourcePoolResourcesTaintsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsResourcePoolResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsResourcePoolResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._count !== undefined) { + hasAnyValues = true; + internalValueResult.count = this._count; + } + if (this._flavorId !== undefined) { + hasAnyValues = true; + internalValueResult.flavorId = this._flavorId; + } + if (this._labels !== undefined) { + hasAnyValues = true; + internalValueResult.labels = this._labels; + } + if (this._maxCount !== undefined) { + hasAnyValues = true; + internalValueResult.maxCount = this._maxCount; + } + if (this._nodePool !== undefined) { + hasAnyValues = true; + internalValueResult.nodePool = this._nodePool; + } + if (this._postInstall !== undefined) { + hasAnyValues = true; + internalValueResult.postInstall = this._postInstall; + } + if (this._securityGroupIds !== undefined) { + hasAnyValues = true; + internalValueResult.securityGroupIds = this._securityGroupIds; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + if (this._tags !== undefined) { + hasAnyValues = true; + internalValueResult.tags = this._tags; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + if (this._azs?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.azs = this._azs?.internalValue; + } + if (this._taints?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.taints = this._taints?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsResourcePoolResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._count = undefined; + this._flavorId = undefined; + this._labels = undefined; + this._maxCount = undefined; + this._nodePool = undefined; + this._postInstall = undefined; + this._securityGroupIds = undefined; + this._subnetId = undefined; + this._tags = undefined; + this._vpcId = undefined; + this._azs.internalValue = undefined; + this._taints.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._count = value.count; + this._flavorId = value.flavorId; + this._labels = value.labels; + this._maxCount = value.maxCount; + this._nodePool = value.nodePool; + this._postInstall = value.postInstall; + this._securityGroupIds = value.securityGroupIds; + this._subnetId = value.subnetId; + this._tags = value.tags; + this._vpcId = value.vpcId; + this._azs.internalValue = value.azs; + this._taints.internalValue = value.taints; + } + } + + // count - computed: false, optional: false, required: true + private _count?: number; + public get count() { + return this.getNumberAttribute('count'); + } + public set count(value: number) { + this._count = value; + } + // Temporarily expose input value. Use with caution. + public get countInput() { + return this._count; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // labels - computed: false, optional: true, required: false + private _labels?: { [key: string]: string }; + public get labels() { + return this.getStringMapAttribute('labels'); + } + public set labels(value: { [key: string]: string }) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // max_count - computed: true, optional: true, required: false + private _maxCount?: number; + public get maxCount() { + return this.getNumberAttribute('max_count'); + } + public set maxCount(value: number) { + this._maxCount = value; + } + public resetMaxCount() { + this._maxCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxCountInput() { + return this._maxCount; + } + + // node_pool - computed: true, optional: true, required: false + private _nodePool?: string; + public get nodePool() { + return this.getStringAttribute('node_pool'); + } + public set nodePool(value: string) { + this._nodePool = value; + } + public resetNodePool() { + this._nodePool = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodePoolInput() { + return this._nodePool; + } + + // post_install - computed: false, optional: true, required: false + private _postInstall?: string; + public get postInstall() { + return this.getStringAttribute('post_install'); + } + public set postInstall(value: string) { + this._postInstall = value; + } + public resetPostInstall() { + this._postInstall = undefined; + } + // Temporarily expose input value. Use with caution. + public get postInstallInput() { + return this._postInstall; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // azs - computed: false, optional: true, required: false + private _azs = new ModelartsResourcePoolResourcesAzsList(this, "azs", false); + public get azs() { + return this._azs; + } + public putAzs(value: ModelartsResourcePoolResourcesAzs[] | cdktf.IResolvable) { + this._azs.internalValue = value; + } + public resetAzs() { + this._azs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get azsInput() { + return this._azs.internalValue; + } + + // taints - computed: false, optional: true, required: false + private _taints = new ModelartsResourcePoolResourcesTaintsList(this, "taints", false); + public get taints() { + return this._taints; + } + public putTaints(value: ModelartsResourcePoolResourcesTaints[] | cdktf.IResolvable) { + this._taints.internalValue = value; + } + public resetTaints() { + this._taints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get taintsInput() { + return this._taints.internalValue; + } +} + +export class ModelartsResourcePoolResourcesList extends cdktf.ComplexList { + public internalValue? : ModelartsResourcePoolResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsResourcePoolResourcesOutputReference { + return new ModelartsResourcePoolResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsResourcePoolTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#create ModelartsResourcePool#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#delete ModelartsResourcePool#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#update ModelartsResourcePool#update} + */ + readonly update?: string; +} + +export function modelartsResourcePoolTimeoutsToTerraform(struct?: ModelartsResourcePoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function modelartsResourcePoolTimeoutsToHclTerraform(struct?: ModelartsResourcePoolTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsResourcePoolTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsResourcePoolTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsResourcePoolTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface ModelartsResourcePoolUserLogin { + /** + * The key pair name of the login user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#key_pair_name ModelartsResourcePool#key_pair_name} + */ + readonly keyPairName?: string; + /** + * The password of the login user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#password ModelartsResourcePool#password} + */ + readonly password?: string; +} + +export function modelartsResourcePoolUserLoginToTerraform(struct?: ModelartsResourcePoolUserLoginOutputReference | ModelartsResourcePoolUserLogin): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key_pair_name: cdktf.stringToTerraform(struct!.keyPairName), + password: cdktf.stringToTerraform(struct!.password), + } +} + + +export function modelartsResourcePoolUserLoginToHclTerraform(struct?: ModelartsResourcePoolUserLoginOutputReference | ModelartsResourcePoolUserLogin): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key_pair_name: { + value: cdktf.stringToHclTerraform(struct!.keyPairName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsResourcePoolUserLoginOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsResourcePoolUserLogin | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keyPairName !== undefined) { + hasAnyValues = true; + internalValueResult.keyPairName = this._keyPairName; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsResourcePoolUserLogin | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keyPairName = undefined; + this._password = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keyPairName = value.keyPairName; + this._password = value.password; + } + } + + // key_pair_name - computed: true, optional: true, required: false + private _keyPairName?: string; + public get keyPairName() { + return this.getStringAttribute('key_pair_name'); + } + public set keyPairName(value: string) { + this._keyPairName = value; + } + public resetKeyPairName() { + this._keyPairName = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyPairNameInput() { + return this._keyPairName; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool huaweicloud_modelarts_resource_pool} +*/ +export class ModelartsResourcePool extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_resource_pool"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsResourcePool resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsResourcePool to import + * @param importFromId The id of the existing ModelartsResourcePool that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsResourcePool to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_resource_pool", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_resource_pool huaweicloud_modelarts_resource_pool} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsResourcePoolConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsResourcePoolConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_resource_pool', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._networkId = config.networkId; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._prefix = config.prefix; + this._region = config.region; + this._scope = config.scope; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + this._workspaceId = config.workspaceId; + this._clusters.internalValue = config.clusters; + this._resources.internalValue = config.resources; + this._timeouts.internalValue = config.timeouts; + this._userLogin.internalValue = config.userLogin; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // prefix - computed: true, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_pool_id - computed: true, optional: false, required: false + public get resourcePoolId() { + return this.getStringAttribute('resource_pool_id'); + } + + // scope - computed: true, optional: true, required: false + private _scope?: string[]; + public get scope() { + return cdktf.Fn.tolist(this.getListAttribute('scope')); + } + public set scope(value: string[]) { + this._scope = value; + } + public resetScope() { + this._scope = undefined; + } + // Temporarily expose input value. Use with caution. + public get scopeInput() { + return this._scope; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // workspace_id - computed: true, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // clusters - computed: false, optional: true, required: false + private _clusters = new ModelartsResourcePoolClustersList(this, "clusters", false); + public get clusters() { + return this._clusters; + } + public putClusters(value: ModelartsResourcePoolClusters[] | cdktf.IResolvable) { + this._clusters.internalValue = value; + } + public resetClusters() { + this._clusters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get clustersInput() { + return this._clusters.internalValue; + } + + // resources - computed: false, optional: false, required: true + private _resources = new ModelartsResourcePoolResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: ModelartsResourcePoolResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsResourcePoolTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsResourcePoolTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // user_login - computed: false, optional: true, required: false + private _userLogin = new ModelartsResourcePoolUserLoginOutputReference(this, "user_login"); + public get userLogin() { + return this._userLogin; + } + public putUserLogin(value: ModelartsResourcePoolUserLogin) { + this._userLogin.internalValue = value; + } + public resetUserLogin() { + this._userLogin.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get userLoginInput() { + return this._userLogin.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + prefix: cdktf.stringToTerraform(this._prefix), + region: cdktf.stringToTerraform(this._region), + scope: cdktf.listMapper(cdktf.stringToTerraform, false)(this._scope), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + clusters: cdktf.listMapper(modelartsResourcePoolClustersToTerraform, true)(this._clusters.internalValue), + resources: cdktf.listMapper(modelartsResourcePoolResourcesToTerraform, true)(this._resources.internalValue), + timeouts: modelartsResourcePoolTimeoutsToTerraform(this._timeouts.internalValue), + user_login: modelartsResourcePoolUserLoginToTerraform(this._userLogin.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prefix: { + value: cdktf.stringToHclTerraform(this._prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + scope: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._scope), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + clusters: { + value: cdktf.listMapperHcl(modelartsResourcePoolClustersToHclTerraform, true)(this._clusters.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsResourcePoolClustersList", + }, + resources: { + value: cdktf.listMapperHcl(modelartsResourcePoolResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsResourcePoolResourcesList", + }, + timeouts: { + value: modelartsResourcePoolTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsResourcePoolTimeouts", + }, + user_login: { + value: modelartsResourcePoolUserLoginToHclTerraform(this._userLogin.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsResourcePoolUserLoginList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-service/README.md b/src/constructs/providers/huaweicloud/modelarts-service/README.md new file mode 100644 index 00000000..69d9b72f --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-service/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_service` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_service`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service). diff --git a/src/constructs/providers/huaweicloud/modelarts-service/index.ts b/src/constructs/providers/huaweicloud/modelarts-service/index.ts new file mode 100644 index 00000000..9c59f20b --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-service/index.ts @@ -0,0 +1,1974 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsServiceConfig extends cdktf.TerraformMetaArguments { + /** + * Which status you want to change the service to, the valid value can be **running** or **stopped**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#change_status_to ModelartsService#change_status_to} + */ + readonly changeStatusTo?: string; + /** + * The description of the service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#description ModelartsService#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#id ModelartsService#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Inference mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#infer_type ModelartsService#infer_type} + */ + readonly inferType: string; + /** + * Service name, which consists of 1 to 64 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#name ModelartsService#name} + */ + readonly name: string; + /** + * Specifies the ID of the new dedicated resource pool. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#pool_name ModelartsService#pool_name} + */ + readonly poolName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#region ModelartsService#region} + */ + readonly region?: string; + /** + * The security group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#security_group_id ModelartsService#security_group_id} + */ + readonly securityGroupId?: string; + /** + * The subnet ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#subnet_id ModelartsService#subnet_id} + */ + readonly subnetId?: string; + /** + * The VPC ID to which a real-time service instance is deployed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#vpc_id ModelartsService#vpc_id} + */ + readonly vpcId?: string; + /** + * ID of the workspace to which a service belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#workspace_id ModelartsService#workspace_id} + */ + readonly workspaceId?: string; + /** + * additional_properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#additional_properties ModelartsService#additional_properties} + */ + readonly additionalProperties?: ModelartsServiceAdditionalProperties; + /** + * config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#config ModelartsService#config} + */ + readonly config: ModelartsServiceConfigA[] | cdktf.IResolvable; + /** + * schedule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#schedule ModelartsService#schedule} + */ + readonly schedule?: ModelartsServiceSchedule; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#timeouts ModelartsService#timeouts} + */ + readonly timeouts?: ModelartsServiceTimeouts; +} +export interface ModelartsServiceAdditionalPropertiesLogReportChannels { + /** + * The type of log report channel. The valid value is **LTS**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#type ModelartsService#type} + */ + readonly type?: string; +} + +export function modelartsServiceAdditionalPropertiesLogReportChannelsToTerraform(struct?: ModelartsServiceAdditionalPropertiesLogReportChannelsOutputReference | ModelartsServiceAdditionalPropertiesLogReportChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function modelartsServiceAdditionalPropertiesLogReportChannelsToHclTerraform(struct?: ModelartsServiceAdditionalPropertiesLogReportChannelsOutputReference | ModelartsServiceAdditionalPropertiesLogReportChannels): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceAdditionalPropertiesLogReportChannelsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsServiceAdditionalPropertiesLogReportChannels | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceAdditionalPropertiesLogReportChannels | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + } + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface ModelartsServiceAdditionalPropertiesSmnNotification { + /** + * Event ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#events ModelartsService#events} + */ + readonly events?: number[]; + /** + * URN of an SMN topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#topic_urn ModelartsService#topic_urn} + */ + readonly topicUrn?: string; +} + +export function modelartsServiceAdditionalPropertiesSmnNotificationToTerraform(struct?: ModelartsServiceAdditionalPropertiesSmnNotificationOutputReference | ModelartsServiceAdditionalPropertiesSmnNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + events: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.events), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function modelartsServiceAdditionalPropertiesSmnNotificationToHclTerraform(struct?: ModelartsServiceAdditionalPropertiesSmnNotificationOutputReference | ModelartsServiceAdditionalPropertiesSmnNotification): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + events: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.events), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceAdditionalPropertiesSmnNotificationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsServiceAdditionalPropertiesSmnNotification | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._events !== undefined) { + hasAnyValues = true; + internalValueResult.events = this._events; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceAdditionalPropertiesSmnNotification | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._events = undefined; + this._topicUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._events = value.events; + this._topicUrn = value.topicUrn; + } + } + + // events - computed: true, optional: true, required: false + private _events?: number[]; + public get events() { + return this.getNumberListAttribute('events'); + } + public set events(value: number[]) { + this._events = value; + } + public resetEvents() { + this._events = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventsInput() { + return this._events; + } + + // topic_urn - computed: true, optional: true, required: false + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + public resetTopicUrn() { + this._topicUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} +export interface ModelartsServiceAdditionalProperties { + /** + * log_report_channels block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#log_report_channels ModelartsService#log_report_channels} + */ + readonly logReportChannels?: ModelartsServiceAdditionalPropertiesLogReportChannels; + /** + * smn_notification block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#smn_notification ModelartsService#smn_notification} + */ + readonly smnNotification?: ModelartsServiceAdditionalPropertiesSmnNotification; +} + +export function modelartsServiceAdditionalPropertiesToTerraform(struct?: ModelartsServiceAdditionalPropertiesOutputReference | ModelartsServiceAdditionalProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + log_report_channels: modelartsServiceAdditionalPropertiesLogReportChannelsToTerraform(struct!.logReportChannels), + smn_notification: modelartsServiceAdditionalPropertiesSmnNotificationToTerraform(struct!.smnNotification), + } +} + + +export function modelartsServiceAdditionalPropertiesToHclTerraform(struct?: ModelartsServiceAdditionalPropertiesOutputReference | ModelartsServiceAdditionalProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + log_report_channels: { + value: modelartsServiceAdditionalPropertiesLogReportChannelsToHclTerraform(struct!.logReportChannels), + isBlock: true, + type: "list", + storageClassType: "ModelartsServiceAdditionalPropertiesLogReportChannelsList", + }, + smn_notification: { + value: modelartsServiceAdditionalPropertiesSmnNotificationToHclTerraform(struct!.smnNotification), + isBlock: true, + type: "list", + storageClassType: "ModelartsServiceAdditionalPropertiesSmnNotificationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceAdditionalPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsServiceAdditionalProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._logReportChannels?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.logReportChannels = this._logReportChannels?.internalValue; + } + if (this._smnNotification?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.smnNotification = this._smnNotification?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceAdditionalProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._logReportChannels.internalValue = undefined; + this._smnNotification.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._logReportChannels.internalValue = value.logReportChannels; + this._smnNotification.internalValue = value.smnNotification; + } + } + + // log_report_channels - computed: false, optional: true, required: false + private _logReportChannels = new ModelartsServiceAdditionalPropertiesLogReportChannelsOutputReference(this, "log_report_channels"); + public get logReportChannels() { + return this._logReportChannels; + } + public putLogReportChannels(value: ModelartsServiceAdditionalPropertiesLogReportChannels) { + this._logReportChannels.internalValue = value; + } + public resetLogReportChannels() { + this._logReportChannels.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logReportChannelsInput() { + return this._logReportChannels.internalValue; + } + + // smn_notification - computed: false, optional: true, required: false + private _smnNotification = new ModelartsServiceAdditionalPropertiesSmnNotificationOutputReference(this, "smn_notification"); + public get smnNotification() { + return this._smnNotification; + } + public putSmnNotification(value: ModelartsServiceAdditionalPropertiesSmnNotification) { + this._smnNotification.internalValue = value; + } + public resetSmnNotification() { + this._smnNotification.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnNotificationInput() { + return this._smnNotification.internalValue; + } +} +export interface ModelartsServiceConfigCustomSpec { + /** + * Number of Ascend chips. Either this parameter or **gpu_p4** is configured. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#ascend_a310 ModelartsService#ascend_a310} + */ + readonly ascendA310?: number; + /** + * Number of CPU cores, which can be a decimal. The value cannot be smaller than 0.01. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#cpu ModelartsService#cpu} + */ + readonly cpu?: number; + /** + * Number of GPU cores, which can be a decimal. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#gpu_p4 ModelartsService#gpu_p4} + */ + readonly gpuP4?: number; + /** + * Memory in MB, which must be an integer. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#memory ModelartsService#memory} + */ + readonly memory?: number; +} + +export function modelartsServiceConfigCustomSpecToTerraform(struct?: ModelartsServiceConfigCustomSpecOutputReference | ModelartsServiceConfigCustomSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ascend_a310: cdktf.numberToTerraform(struct!.ascendA310), + cpu: cdktf.numberToTerraform(struct!.cpu), + gpu_p4: cdktf.numberToTerraform(struct!.gpuP4), + memory: cdktf.numberToTerraform(struct!.memory), + } +} + + +export function modelartsServiceConfigCustomSpecToHclTerraform(struct?: ModelartsServiceConfigCustomSpecOutputReference | ModelartsServiceConfigCustomSpec): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ascend_a310: { + value: cdktf.numberToHclTerraform(struct!.ascendA310), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cpu: { + value: cdktf.numberToHclTerraform(struct!.cpu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + gpu_p4: { + value: cdktf.numberToHclTerraform(struct!.gpuP4), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + memory: { + value: cdktf.numberToHclTerraform(struct!.memory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceConfigCustomSpecOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsServiceConfigCustomSpec | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ascendA310 !== undefined) { + hasAnyValues = true; + internalValueResult.ascendA310 = this._ascendA310; + } + if (this._cpu !== undefined) { + hasAnyValues = true; + internalValueResult.cpu = this._cpu; + } + if (this._gpuP4 !== undefined) { + hasAnyValues = true; + internalValueResult.gpuP4 = this._gpuP4; + } + if (this._memory !== undefined) { + hasAnyValues = true; + internalValueResult.memory = this._memory; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceConfigCustomSpec | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ascendA310 = undefined; + this._cpu = undefined; + this._gpuP4 = undefined; + this._memory = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ascendA310 = value.ascendA310; + this._cpu = value.cpu; + this._gpuP4 = value.gpuP4; + this._memory = value.memory; + } + } + + // ascend_a310 - computed: true, optional: true, required: false + private _ascendA310?: number; + public get ascendA310() { + return this.getNumberAttribute('ascend_a310'); + } + public set ascendA310(value: number) { + this._ascendA310 = value; + } + public resetAscendA310() { + this._ascendA310 = undefined; + } + // Temporarily expose input value. Use with caution. + public get ascendA310Input() { + return this._ascendA310; + } + + // cpu - computed: true, optional: true, required: false + private _cpu?: number; + public get cpu() { + return this.getNumberAttribute('cpu'); + } + public set cpu(value: number) { + this._cpu = value; + } + public resetCpu() { + this._cpu = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuInput() { + return this._cpu; + } + + // gpu_p4 - computed: true, optional: true, required: false + private _gpuP4?: number; + public get gpuP4() { + return this.getNumberAttribute('gpu_p4'); + } + public set gpuP4(value: number) { + this._gpuP4 = value; + } + public resetGpuP4() { + this._gpuP4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get gpuP4Input() { + return this._gpuP4; + } + + // memory - computed: true, optional: true, required: false + private _memory?: number; + public get memory() { + return this.getNumberAttribute('memory'); + } + public set memory(value: number) { + this._memory = value; + } + public resetMemory() { + this._memory = undefined; + } + // Temporarily expose input value. Use with caution. + public get memoryInput() { + return this._memory; + } +} +export interface ModelartsServiceConfigA { + /** + * OBS path to the output data of a batch job. Mandatory for batch services. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#dest_path ModelartsService#dest_path} + */ + readonly destPath?: string; + /** + * Environment variable key-value pair required for running a model. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#envs ModelartsService#envs} + */ + readonly envs?: { [key: string]: string }; + /** + * Number of instances deployed for a model. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#instance_count ModelartsService#instance_count} + */ + readonly instanceCount?: number; + /** + * Mapping between input parameters and CSV data. Optional for batch services. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#mapping_rule ModelartsService#mapping_rule} + */ + readonly mappingRule?: { [key: string]: string }; + /** + * Mapping type of the input data. Mandatory for batch services. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#mapping_type ModelartsService#mapping_type} + */ + readonly mappingType?: string; + /** + * Model ID, which can be obtained by calling the API for obtaining a model list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#model_id ModelartsService#model_id} + */ + readonly modelId?: string; + /** + * Edge node ID array. Mandatory for edge services. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#nodes ModelartsService#nodes} + */ + readonly nodes?: string[]; + /** + * ID of a dedicated resource pool. Optional for real-time services. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#pool_name ModelartsService#pool_name} + */ + readonly poolName?: string; + /** + * Inference API called in a batch task, which is the RESTful API exposed in the model image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#req_uri ModelartsService#req_uri} + */ + readonly reqUri?: string; + /** + * Resource flavors. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#specification ModelartsService#specification} + */ + readonly specification?: string; + /** + * OBS path to the input data of a batch job. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#src_path ModelartsService#src_path} + */ + readonly srcPath?: string; + /** + * Data source type, which can be ManifestFile. Mandatory for batch services. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#src_type ModelartsService#src_type} + */ + readonly srcType?: string; + /** + * Weight of traffic allocated to a model. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#weight ModelartsService#weight} + */ + readonly weight?: number; + /** + * custom_spec block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#custom_spec ModelartsService#custom_spec} + */ + readonly customSpec?: ModelartsServiceConfigCustomSpec; +} + +export function modelartsServiceConfigAToTerraform(struct?: ModelartsServiceConfigA | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dest_path: cdktf.stringToTerraform(struct!.destPath), + envs: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.envs), + instance_count: cdktf.numberToTerraform(struct!.instanceCount), + mapping_rule: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.mappingRule), + mapping_type: cdktf.stringToTerraform(struct!.mappingType), + model_id: cdktf.stringToTerraform(struct!.modelId), + nodes: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.nodes), + pool_name: cdktf.stringToTerraform(struct!.poolName), + req_uri: cdktf.stringToTerraform(struct!.reqUri), + specification: cdktf.stringToTerraform(struct!.specification), + src_path: cdktf.stringToTerraform(struct!.srcPath), + src_type: cdktf.stringToTerraform(struct!.srcType), + weight: cdktf.numberToTerraform(struct!.weight), + custom_spec: modelartsServiceConfigCustomSpecToTerraform(struct!.customSpec), + } +} + + +export function modelartsServiceConfigAToHclTerraform(struct?: ModelartsServiceConfigA | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dest_path: { + value: cdktf.stringToHclTerraform(struct!.destPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + envs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.envs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + instance_count: { + value: cdktf.numberToHclTerraform(struct!.instanceCount), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mapping_rule: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.mappingRule), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + mapping_type: { + value: cdktf.stringToHclTerraform(struct!.mappingType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + model_id: { + value: cdktf.stringToHclTerraform(struct!.modelId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nodes: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.nodes), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + pool_name: { + value: cdktf.stringToHclTerraform(struct!.poolName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + req_uri: { + value: cdktf.stringToHclTerraform(struct!.reqUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + specification: { + value: cdktf.stringToHclTerraform(struct!.specification), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_path: { + value: cdktf.stringToHclTerraform(struct!.srcPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_type: { + value: cdktf.stringToHclTerraform(struct!.srcType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + custom_spec: { + value: modelartsServiceConfigCustomSpecToHclTerraform(struct!.customSpec), + isBlock: true, + type: "list", + storageClassType: "ModelartsServiceConfigCustomSpecList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceConfigAOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsServiceConfigA | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destPath !== undefined) { + hasAnyValues = true; + internalValueResult.destPath = this._destPath; + } + if (this._envs !== undefined) { + hasAnyValues = true; + internalValueResult.envs = this._envs; + } + if (this._instanceCount !== undefined) { + hasAnyValues = true; + internalValueResult.instanceCount = this._instanceCount; + } + if (this._mappingRule !== undefined) { + hasAnyValues = true; + internalValueResult.mappingRule = this._mappingRule; + } + if (this._mappingType !== undefined) { + hasAnyValues = true; + internalValueResult.mappingType = this._mappingType; + } + if (this._modelId !== undefined) { + hasAnyValues = true; + internalValueResult.modelId = this._modelId; + } + if (this._nodes !== undefined) { + hasAnyValues = true; + internalValueResult.nodes = this._nodes; + } + if (this._poolName !== undefined) { + hasAnyValues = true; + internalValueResult.poolName = this._poolName; + } + if (this._reqUri !== undefined) { + hasAnyValues = true; + internalValueResult.reqUri = this._reqUri; + } + if (this._specification !== undefined) { + hasAnyValues = true; + internalValueResult.specification = this._specification; + } + if (this._srcPath !== undefined) { + hasAnyValues = true; + internalValueResult.srcPath = this._srcPath; + } + if (this._srcType !== undefined) { + hasAnyValues = true; + internalValueResult.srcType = this._srcType; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + if (this._customSpec?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.customSpec = this._customSpec?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceConfigA | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destPath = undefined; + this._envs = undefined; + this._instanceCount = undefined; + this._mappingRule = undefined; + this._mappingType = undefined; + this._modelId = undefined; + this._nodes = undefined; + this._poolName = undefined; + this._reqUri = undefined; + this._specification = undefined; + this._srcPath = undefined; + this._srcType = undefined; + this._weight = undefined; + this._customSpec.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destPath = value.destPath; + this._envs = value.envs; + this._instanceCount = value.instanceCount; + this._mappingRule = value.mappingRule; + this._mappingType = value.mappingType; + this._modelId = value.modelId; + this._nodes = value.nodes; + this._poolName = value.poolName; + this._reqUri = value.reqUri; + this._specification = value.specification; + this._srcPath = value.srcPath; + this._srcType = value.srcType; + this._weight = value.weight; + this._customSpec.internalValue = value.customSpec; + } + } + + // dest_path - computed: true, optional: true, required: false + private _destPath?: string; + public get destPath() { + return this.getStringAttribute('dest_path'); + } + public set destPath(value: string) { + this._destPath = value; + } + public resetDestPath() { + this._destPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get destPathInput() { + return this._destPath; + } + + // envs - computed: true, optional: true, required: false + private _envs?: { [key: string]: string }; + public get envs() { + return this.getStringMapAttribute('envs'); + } + public set envs(value: { [key: string]: string }) { + this._envs = value; + } + public resetEnvs() { + this._envs = undefined; + } + // Temporarily expose input value. Use with caution. + public get envsInput() { + return this._envs; + } + + // instance_count - computed: true, optional: true, required: false + private _instanceCount?: number; + public get instanceCount() { + return this.getNumberAttribute('instance_count'); + } + public set instanceCount(value: number) { + this._instanceCount = value; + } + public resetInstanceCount() { + this._instanceCount = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceCountInput() { + return this._instanceCount; + } + + // mapping_rule - computed: true, optional: true, required: false + private _mappingRule?: { [key: string]: string }; + public get mappingRule() { + return this.getStringMapAttribute('mapping_rule'); + } + public set mappingRule(value: { [key: string]: string }) { + this._mappingRule = value; + } + public resetMappingRule() { + this._mappingRule = undefined; + } + // Temporarily expose input value. Use with caution. + public get mappingRuleInput() { + return this._mappingRule; + } + + // mapping_type - computed: true, optional: true, required: false + private _mappingType?: string; + public get mappingType() { + return this.getStringAttribute('mapping_type'); + } + public set mappingType(value: string) { + this._mappingType = value; + } + public resetMappingType() { + this._mappingType = undefined; + } + // Temporarily expose input value. Use with caution. + public get mappingTypeInput() { + return this._mappingType; + } + + // model_id - computed: true, optional: true, required: false + private _modelId?: string; + public get modelId() { + return this.getStringAttribute('model_id'); + } + public set modelId(value: string) { + this._modelId = value; + } + public resetModelId() { + this._modelId = undefined; + } + // Temporarily expose input value. Use with caution. + public get modelIdInput() { + return this._modelId; + } + + // nodes - computed: true, optional: true, required: false + private _nodes?: string[]; + public get nodes() { + return this.getListAttribute('nodes'); + } + public set nodes(value: string[]) { + this._nodes = value; + } + public resetNodes() { + this._nodes = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodesInput() { + return this._nodes; + } + + // pool_name - computed: true, optional: true, required: false + private _poolName?: string; + public get poolName() { + return this.getStringAttribute('pool_name'); + } + public set poolName(value: string) { + this._poolName = value; + } + public resetPoolName() { + this._poolName = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolNameInput() { + return this._poolName; + } + + // req_uri - computed: true, optional: true, required: false + private _reqUri?: string; + public get reqUri() { + return this.getStringAttribute('req_uri'); + } + public set reqUri(value: string) { + this._reqUri = value; + } + public resetReqUri() { + this._reqUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get reqUriInput() { + return this._reqUri; + } + + // specification - computed: true, optional: true, required: false + private _specification?: string; + public get specification() { + return this.getStringAttribute('specification'); + } + public set specification(value: string) { + this._specification = value; + } + public resetSpecification() { + this._specification = undefined; + } + // Temporarily expose input value. Use with caution. + public get specificationInput() { + return this._specification; + } + + // src_path - computed: true, optional: true, required: false + private _srcPath?: string; + public get srcPath() { + return this.getStringAttribute('src_path'); + } + public set srcPath(value: string) { + this._srcPath = value; + } + public resetSrcPath() { + this._srcPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcPathInput() { + return this._srcPath; + } + + // src_type - computed: true, optional: true, required: false + private _srcType?: string; + public get srcType() { + return this.getStringAttribute('src_type'); + } + public set srcType(value: string) { + this._srcType = value; + } + public resetSrcType() { + this._srcType = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcTypeInput() { + return this._srcType; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // custom_spec - computed: false, optional: true, required: false + private _customSpec = new ModelartsServiceConfigCustomSpecOutputReference(this, "custom_spec"); + public get customSpec() { + return this._customSpec; + } + public putCustomSpec(value: ModelartsServiceConfigCustomSpec) { + this._customSpec.internalValue = value; + } + public resetCustomSpec() { + this._customSpec.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customSpecInput() { + return this._customSpec.internalValue; + } +} + +export class ModelartsServiceConfigAList extends cdktf.ComplexList { + public internalValue? : ModelartsServiceConfigA[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsServiceConfigAOutputReference { + return new ModelartsServiceConfigAOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsServiceSchedule { + /** + * Value mapping a time unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#duration ModelartsService#duration} + */ + readonly duration: number; + /** + * Scheduling time unit. Possible values are DAYS, HOURS, and MINUTES. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#time_unit ModelartsService#time_unit} + */ + readonly timeUnit: string; + /** + * Scheduling type. Only the value **stop** is supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#type ModelartsService#type} + */ + readonly type: string; +} + +export function modelartsServiceScheduleToTerraform(struct?: ModelartsServiceScheduleOutputReference | ModelartsServiceSchedule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + duration: cdktf.numberToTerraform(struct!.duration), + time_unit: cdktf.stringToTerraform(struct!.timeUnit), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function modelartsServiceScheduleToHclTerraform(struct?: ModelartsServiceScheduleOutputReference | ModelartsServiceSchedule): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + duration: { + value: cdktf.numberToHclTerraform(struct!.duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_unit: { + value: cdktf.stringToHclTerraform(struct!.timeUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceScheduleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ModelartsServiceSchedule | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._duration !== undefined) { + hasAnyValues = true; + internalValueResult.duration = this._duration; + } + if (this._timeUnit !== undefined) { + hasAnyValues = true; + internalValueResult.timeUnit = this._timeUnit; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceSchedule | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._duration = undefined; + this._timeUnit = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._duration = value.duration; + this._timeUnit = value.timeUnit; + this._type = value.type; + } + } + + // duration - computed: false, optional: false, required: true + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // time_unit - computed: false, optional: false, required: true + private _timeUnit?: string; + public get timeUnit() { + return this.getStringAttribute('time_unit'); + } + public set timeUnit(value: string) { + this._timeUnit = value; + } + // Temporarily expose input value. Use with caution. + public get timeUnitInput() { + return this._timeUnit; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface ModelartsServiceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#create ModelartsService#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#delete ModelartsService#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#update ModelartsService#update} + */ + readonly update?: string; +} + +export function modelartsServiceTimeoutsToTerraform(struct?: ModelartsServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function modelartsServiceTimeoutsToHclTerraform(struct?: ModelartsServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsServiceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsServiceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsServiceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service huaweicloud_modelarts_service} +*/ +export class ModelartsService extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_service"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsService resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsService to import + * @param importFromId The id of the existing ModelartsService that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsService to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_service", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_service huaweicloud_modelarts_service} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsServiceConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsServiceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_service', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._changeStatusTo = config.changeStatusTo; + this._description = config.description; + this._id = config.id; + this._inferType = config.inferType; + this._name = config.name; + this._poolName = config.poolName; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + this._workspaceId = config.workspaceId; + this._additionalProperties.internalValue = config.additionalProperties; + this._config.internalValue = config.config; + this._schedule.internalValue = config.schedule; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_address - computed: true, optional: false, required: false + public get accessAddress() { + return this.getStringAttribute('access_address'); + } + + // bind_access_address - computed: true, optional: false, required: false + public get bindAccessAddress() { + return this.getStringAttribute('bind_access_address'); + } + + // change_status_to - computed: true, optional: true, required: false + private _changeStatusTo?: string; + public get changeStatusTo() { + return this.getStringAttribute('change_status_to'); + } + public set changeStatusTo(value: string) { + this._changeStatusTo = value; + } + public resetChangeStatusTo() { + this._changeStatusTo = undefined; + } + // Temporarily expose input value. Use with caution. + public get changeStatusToInput() { + return this._changeStatusTo; + } + + // debug_url - computed: true, optional: false, required: false + public get debugUrl() { + return this.getStringAttribute('debug_url'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // failed_times - computed: true, optional: false, required: false + public get failedTimes() { + return this.getNumberAttribute('failed_times'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // infer_type - computed: false, optional: false, required: true + private _inferType?: string; + public get inferType() { + return this.getStringAttribute('infer_type'); + } + public set inferType(value: string) { + this._inferType = value; + } + // Temporarily expose input value. Use with caution. + public get inferTypeInput() { + return this._inferType; + } + + // invocation_times - computed: true, optional: false, required: false + public get invocationTimes() { + return this.getNumberAttribute('invocation_times'); + } + + // is_free - computed: true, optional: false, required: false + public get isFree() { + return this.getBooleanAttribute('is_free'); + } + + // is_shared - computed: true, optional: false, required: false + public get isShared() { + return this.getBooleanAttribute('is_shared'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // pool_name - computed: true, optional: true, required: false + private _poolName?: string; + public get poolName() { + return this.getStringAttribute('pool_name'); + } + public set poolName(value: string) { + this._poolName = value; + } + public resetPoolName() { + this._poolName = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolNameInput() { + return this._poolName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // shared_count - computed: true, optional: false, required: false + public get sharedCount() { + return this.getNumberAttribute('shared_count'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // workspace_id - computed: true, optional: true, required: false + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + public resetWorkspaceId() { + this._workspaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // additional_properties - computed: false, optional: true, required: false + private _additionalProperties = new ModelartsServiceAdditionalPropertiesOutputReference(this, "additional_properties"); + public get additionalProperties() { + return this._additionalProperties; + } + public putAdditionalProperties(value: ModelartsServiceAdditionalProperties) { + this._additionalProperties.internalValue = value; + } + public resetAdditionalProperties() { + this._additionalProperties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get additionalPropertiesInput() { + return this._additionalProperties.internalValue; + } + + // config - computed: false, optional: false, required: true + private _config = new ModelartsServiceConfigAList(this, "config", false); + public get config() { + return this._config; + } + public putConfig(value: ModelartsServiceConfigA[] | cdktf.IResolvable) { + this._config.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get configInput() { + return this._config.internalValue; + } + + // schedule - computed: false, optional: true, required: false + private _schedule = new ModelartsServiceScheduleOutputReference(this, "schedule"); + public get schedule() { + return this._schedule; + } + public putSchedule(value: ModelartsServiceSchedule) { + this._schedule.internalValue = value; + } + public resetSchedule() { + this._schedule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleInput() { + return this._schedule.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsServiceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsServiceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + change_status_to: cdktf.stringToTerraform(this._changeStatusTo), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + infer_type: cdktf.stringToTerraform(this._inferType), + name: cdktf.stringToTerraform(this._name), + pool_name: cdktf.stringToTerraform(this._poolName), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + additional_properties: modelartsServiceAdditionalPropertiesToTerraform(this._additionalProperties.internalValue), + config: cdktf.listMapper(modelartsServiceConfigAToTerraform, true)(this._config.internalValue), + schedule: modelartsServiceScheduleToTerraform(this._schedule.internalValue), + timeouts: modelartsServiceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + change_status_to: { + value: cdktf.stringToHclTerraform(this._changeStatusTo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + infer_type: { + value: cdktf.stringToHclTerraform(this._inferType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool_name: { + value: cdktf.stringToHclTerraform(this._poolName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + additional_properties: { + value: modelartsServiceAdditionalPropertiesToHclTerraform(this._additionalProperties.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsServiceAdditionalPropertiesList", + }, + config: { + value: cdktf.listMapperHcl(modelartsServiceConfigAToHclTerraform, true)(this._config.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsServiceConfigAList", + }, + schedule: { + value: modelartsServiceScheduleToHclTerraform(this._schedule.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsServiceScheduleList", + }, + timeouts: { + value: modelartsServiceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsServiceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/modelarts-workspace/README.md b/src/constructs/providers/huaweicloud/modelarts-workspace/README.md new file mode 100644 index 00000000..40459859 --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-workspace/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_modelarts_workspace` + +Refer to the Terraform Registry for docs: [`huaweicloud_modelarts_workspace`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace). diff --git a/src/constructs/providers/huaweicloud/modelarts-workspace/index.ts b/src/constructs/providers/huaweicloud/modelarts-workspace/index.ts new file mode 100644 index 00000000..26e76a6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/modelarts-workspace/index.ts @@ -0,0 +1,578 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ModelartsWorkspaceConfig extends cdktf.TerraformMetaArguments { + /** + * Inference mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#auth_type ModelartsWorkspace#auth_type} + */ + readonly authType?: string; + /** + * The description of the worksapce. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#description ModelartsWorkspace#description} + */ + readonly description?: string; + /** + * The enterprise project id of the worksapce. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#enterprise_project_id ModelartsWorkspace#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#id ModelartsWorkspace#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Workspace name, which consists of 4 to 64 characters. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#name ModelartsWorkspace#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#region ModelartsWorkspace#region} + */ + readonly region?: string; + /** + * grants block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#grants ModelartsWorkspace#grants} + */ + readonly grants?: ModelartsWorkspaceGrants[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#timeouts ModelartsWorkspace#timeouts} + */ + readonly timeouts?: ModelartsWorkspaceTimeouts; +} +export interface ModelartsWorkspaceGrants { + /** + * IAM user ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#user_id ModelartsWorkspace#user_id} + */ + readonly userId?: string; + /** + * IAM username. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#user_name ModelartsWorkspace#user_name} + */ + readonly userName?: string; +} + +export function modelartsWorkspaceGrantsToTerraform(struct?: ModelartsWorkspaceGrants | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + user_id: cdktf.stringToTerraform(struct!.userId), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function modelartsWorkspaceGrantsToHclTerraform(struct?: ModelartsWorkspaceGrants | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + user_id: { + value: cdktf.stringToHclTerraform(struct!.userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsWorkspaceGrantsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ModelartsWorkspaceGrants | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._userId !== undefined) { + hasAnyValues = true; + internalValueResult.userId = this._userId; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsWorkspaceGrants | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._userId = undefined; + this._userName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._userId = value.userId; + this._userName = value.userName; + } + } + + // user_id - computed: true, optional: true, required: false + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: true, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} + +export class ModelartsWorkspaceGrantsList extends cdktf.ComplexList { + public internalValue? : ModelartsWorkspaceGrants[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ModelartsWorkspaceGrantsOutputReference { + return new ModelartsWorkspaceGrantsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ModelartsWorkspaceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#delete ModelartsWorkspace#delete} + */ + readonly delete?: string; +} + +export function modelartsWorkspaceTimeoutsToTerraform(struct?: ModelartsWorkspaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function modelartsWorkspaceTimeoutsToHclTerraform(struct?: ModelartsWorkspaceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ModelartsWorkspaceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ModelartsWorkspaceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ModelartsWorkspaceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace huaweicloud_modelarts_workspace} +*/ +export class ModelartsWorkspace extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_modelarts_workspace"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ModelartsWorkspace resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ModelartsWorkspace to import + * @param importFromId The id of the existing ModelartsWorkspace that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ModelartsWorkspace to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_modelarts_workspace", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/modelarts_workspace huaweicloud_modelarts_workspace} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ModelartsWorkspaceConfig + */ + public constructor(scope: Construct, id: string, config: ModelartsWorkspaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_modelarts_workspace', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authType = config.authType; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._grants.internalValue = config.grants; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_type - computed: true, optional: true, required: false + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + public resetAuthType() { + this._authType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // status_info - computed: true, optional: false, required: false + public get statusInfo() { + return this.getStringAttribute('status_info'); + } + + // grants - computed: false, optional: true, required: false + private _grants = new ModelartsWorkspaceGrantsList(this, "grants", false); + public get grants() { + return this._grants; + } + public putGrants(value: ModelartsWorkspaceGrants[] | cdktf.IResolvable) { + this._grants.internalValue = value; + } + public resetGrants() { + this._grants.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get grantsInput() { + return this._grants.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ModelartsWorkspaceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ModelartsWorkspaceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_type: cdktf.stringToTerraform(this._authType), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + grants: cdktf.listMapper(modelartsWorkspaceGrantsToTerraform, true)(this._grants.internalValue), + timeouts: modelartsWorkspaceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + grants: { + value: cdktf.listMapperHcl(modelartsWorkspaceGrantsToHclTerraform, true)(this._grants.internalValue), + isBlock: true, + type: "list", + storageClassType: "ModelartsWorkspaceGrantsList", + }, + timeouts: { + value: modelartsWorkspaceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ModelartsWorkspaceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mpc-transcoding-template-group/README.md b/src/constructs/providers/huaweicloud/mpc-transcoding-template-group/README.md new file mode 100644 index 00000000..156198f0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mpc-transcoding-template-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mpc_transcoding_template_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_mpc_transcoding_template_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group). diff --git a/src/constructs/providers/huaweicloud/mpc-transcoding-template-group/index.ts b/src/constructs/providers/huaweicloud/mpc-transcoding-template-group/index.ts new file mode 100644 index 00000000..a650ef23 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mpc-transcoding-template-group/index.ts @@ -0,0 +1,1145 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MpcTranscodingTemplateGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#dash_segment_duration MpcTranscodingTemplateGroup#dash_segment_duration} + */ + readonly dashSegmentDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#hls_segment_duration MpcTranscodingTemplateGroup#hls_segment_duration} + */ + readonly hlsSegmentDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#id MpcTranscodingTemplateGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#low_bitrate_hd MpcTranscodingTemplateGroup#low_bitrate_hd} + */ + readonly lowBitrateHd?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#name MpcTranscodingTemplateGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#output_format MpcTranscodingTemplateGroup#output_format} + */ + readonly outputFormat: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#region MpcTranscodingTemplateGroup#region} + */ + readonly region?: string; + /** + * audio block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#audio MpcTranscodingTemplateGroup#audio} + */ + readonly audio?: MpcTranscodingTemplateGroupAudio; + /** + * video_common block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#video_common MpcTranscodingTemplateGroup#video_common} + */ + readonly videoCommon?: MpcTranscodingTemplateGroupVideoCommon; + /** + * videos block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#videos MpcTranscodingTemplateGroup#videos} + */ + readonly videos?: MpcTranscodingTemplateGroupVideos[] | cdktf.IResolvable; +} +export interface MpcTranscodingTemplateGroupAudio { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#bitrate MpcTranscodingTemplateGroup#bitrate} + */ + readonly bitrate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#channels MpcTranscodingTemplateGroup#channels} + */ + readonly channels: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#codec MpcTranscodingTemplateGroup#codec} + */ + readonly codec: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#output_policy MpcTranscodingTemplateGroup#output_policy} + */ + readonly outputPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#sample_rate MpcTranscodingTemplateGroup#sample_rate} + */ + readonly sampleRate: number; +} + +export function mpcTranscodingTemplateGroupAudioToTerraform(struct?: MpcTranscodingTemplateGroupAudioOutputReference | MpcTranscodingTemplateGroupAudio): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + channels: cdktf.numberToTerraform(struct!.channels), + codec: cdktf.numberToTerraform(struct!.codec), + output_policy: cdktf.stringToTerraform(struct!.outputPolicy), + sample_rate: cdktf.numberToTerraform(struct!.sampleRate), + } +} + + +export function mpcTranscodingTemplateGroupAudioToHclTerraform(struct?: MpcTranscodingTemplateGroupAudioOutputReference | MpcTranscodingTemplateGroupAudio): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + channels: { + value: cdktf.numberToHclTerraform(struct!.channels), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + codec: { + value: cdktf.numberToHclTerraform(struct!.codec), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output_policy: { + value: cdktf.stringToHclTerraform(struct!.outputPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sample_rate: { + value: cdktf.numberToHclTerraform(struct!.sampleRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MpcTranscodingTemplateGroupAudioOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MpcTranscodingTemplateGroupAudio | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._channels !== undefined) { + hasAnyValues = true; + internalValueResult.channels = this._channels; + } + if (this._codec !== undefined) { + hasAnyValues = true; + internalValueResult.codec = this._codec; + } + if (this._outputPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.outputPolicy = this._outputPolicy; + } + if (this._sampleRate !== undefined) { + hasAnyValues = true; + internalValueResult.sampleRate = this._sampleRate; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MpcTranscodingTemplateGroupAudio | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bitrate = undefined; + this._channels = undefined; + this._codec = undefined; + this._outputPolicy = undefined; + this._sampleRate = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bitrate = value.bitrate; + this._channels = value.channels; + this._codec = value.codec; + this._outputPolicy = value.outputPolicy; + this._sampleRate = value.sampleRate; + } + } + + // bitrate - computed: false, optional: true, required: false + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + public resetBitrate() { + this._bitrate = undefined; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // channels - computed: false, optional: false, required: true + private _channels?: number; + public get channels() { + return this.getNumberAttribute('channels'); + } + public set channels(value: number) { + this._channels = value; + } + // Temporarily expose input value. Use with caution. + public get channelsInput() { + return this._channels; + } + + // codec - computed: false, optional: false, required: true + private _codec?: number; + public get codec() { + return this.getNumberAttribute('codec'); + } + public set codec(value: number) { + this._codec = value; + } + // Temporarily expose input value. Use with caution. + public get codecInput() { + return this._codec; + } + + // output_policy - computed: false, optional: true, required: false + private _outputPolicy?: string; + public get outputPolicy() { + return this.getStringAttribute('output_policy'); + } + public set outputPolicy(value: string) { + this._outputPolicy = value; + } + public resetOutputPolicy() { + this._outputPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputPolicyInput() { + return this._outputPolicy; + } + + // sample_rate - computed: false, optional: false, required: true + private _sampleRate?: number; + public get sampleRate() { + return this.getNumberAttribute('sample_rate'); + } + public set sampleRate(value: number) { + this._sampleRate = value; + } + // Temporarily expose input value. Use with caution. + public get sampleRateInput() { + return this._sampleRate; + } +} +export interface MpcTranscodingTemplateGroupVideoCommon { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#black_bar_removal MpcTranscodingTemplateGroup#black_bar_removal} + */ + readonly blackBarRemoval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#codec MpcTranscodingTemplateGroup#codec} + */ + readonly codec?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#fps MpcTranscodingTemplateGroup#fps} + */ + readonly fps?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#level MpcTranscodingTemplateGroup#level} + */ + readonly level?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#max_consecutive_bframes MpcTranscodingTemplateGroup#max_consecutive_bframes} + */ + readonly maxConsecutiveBframes?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#max_iframes_interval MpcTranscodingTemplateGroup#max_iframes_interval} + */ + readonly maxIframesInterval?: number; + /** + * schema: Deprecated; the SDK does not support it + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#max_reference_frames MpcTranscodingTemplateGroup#max_reference_frames} + */ + readonly maxReferenceFrames?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#output_policy MpcTranscodingTemplateGroup#output_policy} + */ + readonly outputPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#profile MpcTranscodingTemplateGroup#profile} + */ + readonly profile?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#quality MpcTranscodingTemplateGroup#quality} + */ + readonly quality?: number; +} + +export function mpcTranscodingTemplateGroupVideoCommonToTerraform(struct?: MpcTranscodingTemplateGroupVideoCommonOutputReference | MpcTranscodingTemplateGroupVideoCommon): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + black_bar_removal: cdktf.numberToTerraform(struct!.blackBarRemoval), + codec: cdktf.numberToTerraform(struct!.codec), + fps: cdktf.numberToTerraform(struct!.fps), + level: cdktf.numberToTerraform(struct!.level), + max_consecutive_bframes: cdktf.numberToTerraform(struct!.maxConsecutiveBframes), + max_iframes_interval: cdktf.numberToTerraform(struct!.maxIframesInterval), + max_reference_frames: cdktf.numberToTerraform(struct!.maxReferenceFrames), + output_policy: cdktf.stringToTerraform(struct!.outputPolicy), + profile: cdktf.numberToTerraform(struct!.profile), + quality: cdktf.numberToTerraform(struct!.quality), + } +} + + +export function mpcTranscodingTemplateGroupVideoCommonToHclTerraform(struct?: MpcTranscodingTemplateGroupVideoCommonOutputReference | MpcTranscodingTemplateGroupVideoCommon): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + black_bar_removal: { + value: cdktf.numberToHclTerraform(struct!.blackBarRemoval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + codec: { + value: cdktf.numberToHclTerraform(struct!.codec), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fps: { + value: cdktf.numberToHclTerraform(struct!.fps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + level: { + value: cdktf.numberToHclTerraform(struct!.level), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_consecutive_bframes: { + value: cdktf.numberToHclTerraform(struct!.maxConsecutiveBframes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_iframes_interval: { + value: cdktf.numberToHclTerraform(struct!.maxIframesInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_reference_frames: { + value: cdktf.numberToHclTerraform(struct!.maxReferenceFrames), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output_policy: { + value: cdktf.stringToHclTerraform(struct!.outputPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + profile: { + value: cdktf.numberToHclTerraform(struct!.profile), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + quality: { + value: cdktf.numberToHclTerraform(struct!.quality), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MpcTranscodingTemplateGroupVideoCommonOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MpcTranscodingTemplateGroupVideoCommon | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blackBarRemoval !== undefined) { + hasAnyValues = true; + internalValueResult.blackBarRemoval = this._blackBarRemoval; + } + if (this._codec !== undefined) { + hasAnyValues = true; + internalValueResult.codec = this._codec; + } + if (this._fps !== undefined) { + hasAnyValues = true; + internalValueResult.fps = this._fps; + } + if (this._level !== undefined) { + hasAnyValues = true; + internalValueResult.level = this._level; + } + if (this._maxConsecutiveBframes !== undefined) { + hasAnyValues = true; + internalValueResult.maxConsecutiveBframes = this._maxConsecutiveBframes; + } + if (this._maxIframesInterval !== undefined) { + hasAnyValues = true; + internalValueResult.maxIframesInterval = this._maxIframesInterval; + } + if (this._maxReferenceFrames !== undefined) { + hasAnyValues = true; + internalValueResult.maxReferenceFrames = this._maxReferenceFrames; + } + if (this._outputPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.outputPolicy = this._outputPolicy; + } + if (this._profile !== undefined) { + hasAnyValues = true; + internalValueResult.profile = this._profile; + } + if (this._quality !== undefined) { + hasAnyValues = true; + internalValueResult.quality = this._quality; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MpcTranscodingTemplateGroupVideoCommon | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blackBarRemoval = undefined; + this._codec = undefined; + this._fps = undefined; + this._level = undefined; + this._maxConsecutiveBframes = undefined; + this._maxIframesInterval = undefined; + this._maxReferenceFrames = undefined; + this._outputPolicy = undefined; + this._profile = undefined; + this._quality = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blackBarRemoval = value.blackBarRemoval; + this._codec = value.codec; + this._fps = value.fps; + this._level = value.level; + this._maxConsecutiveBframes = value.maxConsecutiveBframes; + this._maxIframesInterval = value.maxIframesInterval; + this._maxReferenceFrames = value.maxReferenceFrames; + this._outputPolicy = value.outputPolicy; + this._profile = value.profile; + this._quality = value.quality; + } + } + + // black_bar_removal - computed: false, optional: true, required: false + private _blackBarRemoval?: number; + public get blackBarRemoval() { + return this.getNumberAttribute('black_bar_removal'); + } + public set blackBarRemoval(value: number) { + this._blackBarRemoval = value; + } + public resetBlackBarRemoval() { + this._blackBarRemoval = undefined; + } + // Temporarily expose input value. Use with caution. + public get blackBarRemovalInput() { + return this._blackBarRemoval; + } + + // codec - computed: false, optional: true, required: false + private _codec?: number; + public get codec() { + return this.getNumberAttribute('codec'); + } + public set codec(value: number) { + this._codec = value; + } + public resetCodec() { + this._codec = undefined; + } + // Temporarily expose input value. Use with caution. + public get codecInput() { + return this._codec; + } + + // fps - computed: false, optional: true, required: false + private _fps?: number; + public get fps() { + return this.getNumberAttribute('fps'); + } + public set fps(value: number) { + this._fps = value; + } + public resetFps() { + this._fps = undefined; + } + // Temporarily expose input value. Use with caution. + public get fpsInput() { + return this._fps; + } + + // level - computed: false, optional: true, required: false + private _level?: number; + public get level() { + return this.getNumberAttribute('level'); + } + public set level(value: number) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // max_consecutive_bframes - computed: false, optional: true, required: false + private _maxConsecutiveBframes?: number; + public get maxConsecutiveBframes() { + return this.getNumberAttribute('max_consecutive_bframes'); + } + public set maxConsecutiveBframes(value: number) { + this._maxConsecutiveBframes = value; + } + public resetMaxConsecutiveBframes() { + this._maxConsecutiveBframes = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConsecutiveBframesInput() { + return this._maxConsecutiveBframes; + } + + // max_iframes_interval - computed: false, optional: true, required: false + private _maxIframesInterval?: number; + public get maxIframesInterval() { + return this.getNumberAttribute('max_iframes_interval'); + } + public set maxIframesInterval(value: number) { + this._maxIframesInterval = value; + } + public resetMaxIframesInterval() { + this._maxIframesInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxIframesIntervalInput() { + return this._maxIframesInterval; + } + + // max_reference_frames - computed: true, optional: true, required: false + private _maxReferenceFrames?: number; + public get maxReferenceFrames() { + return this.getNumberAttribute('max_reference_frames'); + } + public set maxReferenceFrames(value: number) { + this._maxReferenceFrames = value; + } + public resetMaxReferenceFrames() { + this._maxReferenceFrames = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxReferenceFramesInput() { + return this._maxReferenceFrames; + } + + // output_policy - computed: false, optional: true, required: false + private _outputPolicy?: string; + public get outputPolicy() { + return this.getStringAttribute('output_policy'); + } + public set outputPolicy(value: string) { + this._outputPolicy = value; + } + public resetOutputPolicy() { + this._outputPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputPolicyInput() { + return this._outputPolicy; + } + + // profile - computed: false, optional: true, required: false + private _profile?: number; + public get profile() { + return this.getNumberAttribute('profile'); + } + public set profile(value: number) { + this._profile = value; + } + public resetProfile() { + this._profile = undefined; + } + // Temporarily expose input value. Use with caution. + public get profileInput() { + return this._profile; + } + + // quality - computed: false, optional: true, required: false + private _quality?: number; + public get quality() { + return this.getNumberAttribute('quality'); + } + public set quality(value: number) { + this._quality = value; + } + public resetQuality() { + this._quality = undefined; + } + // Temporarily expose input value. Use with caution. + public get qualityInput() { + return this._quality; + } +} +export interface MpcTranscodingTemplateGroupVideos { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#bitrate MpcTranscodingTemplateGroup#bitrate} + */ + readonly bitrate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#height MpcTranscodingTemplateGroup#height} + */ + readonly height?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#width MpcTranscodingTemplateGroup#width} + */ + readonly width?: number; +} + +export function mpcTranscodingTemplateGroupVideosToTerraform(struct?: MpcTranscodingTemplateGroupVideos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + height: cdktf.numberToTerraform(struct!.height), + width: cdktf.numberToTerraform(struct!.width), + } +} + + +export function mpcTranscodingTemplateGroupVideosToHclTerraform(struct?: MpcTranscodingTemplateGroupVideos | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + height: { + value: cdktf.numberToHclTerraform(struct!.height), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + width: { + value: cdktf.numberToHclTerraform(struct!.width), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MpcTranscodingTemplateGroupVideosOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MpcTranscodingTemplateGroupVideos | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._height !== undefined) { + hasAnyValues = true; + internalValueResult.height = this._height; + } + if (this._width !== undefined) { + hasAnyValues = true; + internalValueResult.width = this._width; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MpcTranscodingTemplateGroupVideos | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._bitrate = undefined; + this._height = undefined; + this._width = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._bitrate = value.bitrate; + this._height = value.height; + this._width = value.width; + } + } + + // bitrate - computed: false, optional: true, required: false + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + public resetBitrate() { + this._bitrate = undefined; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // height - computed: false, optional: true, required: false + private _height?: number; + public get height() { + return this.getNumberAttribute('height'); + } + public set height(value: number) { + this._height = value; + } + public resetHeight() { + this._height = undefined; + } + // Temporarily expose input value. Use with caution. + public get heightInput() { + return this._height; + } + + // width - computed: false, optional: true, required: false + private _width?: number; + public get width() { + return this.getNumberAttribute('width'); + } + public set width(value: number) { + this._width = value; + } + public resetWidth() { + this._width = undefined; + } + // Temporarily expose input value. Use with caution. + public get widthInput() { + return this._width; + } +} + +export class MpcTranscodingTemplateGroupVideosList extends cdktf.ComplexList { + public internalValue? : MpcTranscodingTemplateGroupVideos[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MpcTranscodingTemplateGroupVideosOutputReference { + return new MpcTranscodingTemplateGroupVideosOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group huaweicloud_mpc_transcoding_template_group} +*/ +export class MpcTranscodingTemplateGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mpc_transcoding_template_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MpcTranscodingTemplateGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MpcTranscodingTemplateGroup to import + * @param importFromId The id of the existing MpcTranscodingTemplateGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MpcTranscodingTemplateGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mpc_transcoding_template_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template_group huaweicloud_mpc_transcoding_template_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MpcTranscodingTemplateGroupConfig + */ + public constructor(scope: Construct, id: string, config: MpcTranscodingTemplateGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mpc_transcoding_template_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashSegmentDuration = config.dashSegmentDuration; + this._hlsSegmentDuration = config.hlsSegmentDuration; + this._id = config.id; + this._lowBitrateHd = config.lowBitrateHd; + this._name = config.name; + this._outputFormat = config.outputFormat; + this._region = config.region; + this._audio.internalValue = config.audio; + this._videoCommon.internalValue = config.videoCommon; + this._videos.internalValue = config.videos; + } + + // ========== + // ATTRIBUTES + // ========== + + // dash_segment_duration - computed: false, optional: true, required: false + private _dashSegmentDuration?: number; + public get dashSegmentDuration() { + return this.getNumberAttribute('dash_segment_duration'); + } + public set dashSegmentDuration(value: number) { + this._dashSegmentDuration = value; + } + public resetDashSegmentDuration() { + this._dashSegmentDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get dashSegmentDurationInput() { + return this._dashSegmentDuration; + } + + // hls_segment_duration - computed: false, optional: true, required: false + private _hlsSegmentDuration?: number; + public get hlsSegmentDuration() { + return this.getNumberAttribute('hls_segment_duration'); + } + public set hlsSegmentDuration(value: number) { + this._hlsSegmentDuration = value; + } + public resetHlsSegmentDuration() { + this._hlsSegmentDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get hlsSegmentDurationInput() { + return this._hlsSegmentDuration; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // low_bitrate_hd - computed: false, optional: true, required: false + private _lowBitrateHd?: boolean | cdktf.IResolvable; + public get lowBitrateHd() { + return this.getBooleanAttribute('low_bitrate_hd'); + } + public set lowBitrateHd(value: boolean | cdktf.IResolvable) { + this._lowBitrateHd = value; + } + public resetLowBitrateHd() { + this._lowBitrateHd = undefined; + } + // Temporarily expose input value. Use with caution. + public get lowBitrateHdInput() { + return this._lowBitrateHd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // output_format - computed: false, optional: false, required: true + private _outputFormat?: number; + public get outputFormat() { + return this.getNumberAttribute('output_format'); + } + public set outputFormat(value: number) { + this._outputFormat = value; + } + // Temporarily expose input value. Use with caution. + public get outputFormatInput() { + return this._outputFormat; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // template_ids - computed: true, optional: false, required: false + public get templateIds() { + return this.getListAttribute('template_ids'); + } + + // audio - computed: false, optional: true, required: false + private _audio = new MpcTranscodingTemplateGroupAudioOutputReference(this, "audio"); + public get audio() { + return this._audio; + } + public putAudio(value: MpcTranscodingTemplateGroupAudio) { + this._audio.internalValue = value; + } + public resetAudio() { + this._audio.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get audioInput() { + return this._audio.internalValue; + } + + // video_common - computed: false, optional: true, required: false + private _videoCommon = new MpcTranscodingTemplateGroupVideoCommonOutputReference(this, "video_common"); + public get videoCommon() { + return this._videoCommon; + } + public putVideoCommon(value: MpcTranscodingTemplateGroupVideoCommon) { + this._videoCommon.internalValue = value; + } + public resetVideoCommon() { + this._videoCommon.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get videoCommonInput() { + return this._videoCommon.internalValue; + } + + // videos - computed: false, optional: true, required: false + private _videos = new MpcTranscodingTemplateGroupVideosList(this, "videos", false); + public get videos() { + return this._videos; + } + public putVideos(value: MpcTranscodingTemplateGroupVideos[] | cdktf.IResolvable) { + this._videos.internalValue = value; + } + public resetVideos() { + this._videos.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get videosInput() { + return this._videos.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dash_segment_duration: cdktf.numberToTerraform(this._dashSegmentDuration), + hls_segment_duration: cdktf.numberToTerraform(this._hlsSegmentDuration), + id: cdktf.stringToTerraform(this._id), + low_bitrate_hd: cdktf.booleanToTerraform(this._lowBitrateHd), + name: cdktf.stringToTerraform(this._name), + output_format: cdktf.numberToTerraform(this._outputFormat), + region: cdktf.stringToTerraform(this._region), + audio: mpcTranscodingTemplateGroupAudioToTerraform(this._audio.internalValue), + video_common: mpcTranscodingTemplateGroupVideoCommonToTerraform(this._videoCommon.internalValue), + videos: cdktf.listMapper(mpcTranscodingTemplateGroupVideosToTerraform, true)(this._videos.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dash_segment_duration: { + value: cdktf.numberToHclTerraform(this._dashSegmentDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + hls_segment_duration: { + value: cdktf.numberToHclTerraform(this._hlsSegmentDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + low_bitrate_hd: { + value: cdktf.booleanToHclTerraform(this._lowBitrateHd), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + output_format: { + value: cdktf.numberToHclTerraform(this._outputFormat), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + audio: { + value: mpcTranscodingTemplateGroupAudioToHclTerraform(this._audio.internalValue), + isBlock: true, + type: "list", + storageClassType: "MpcTranscodingTemplateGroupAudioList", + }, + video_common: { + value: mpcTranscodingTemplateGroupVideoCommonToHclTerraform(this._videoCommon.internalValue), + isBlock: true, + type: "list", + storageClassType: "MpcTranscodingTemplateGroupVideoCommonList", + }, + videos: { + value: cdktf.listMapperHcl(mpcTranscodingTemplateGroupVideosToHclTerraform, true)(this._videos.internalValue), + isBlock: true, + type: "list", + storageClassType: "MpcTranscodingTemplateGroupVideosList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mpc-transcoding-template/README.md b/src/constructs/providers/huaweicloud/mpc-transcoding-template/README.md new file mode 100644 index 00000000..4d0716ef --- /dev/null +++ b/src/constructs/providers/huaweicloud/mpc-transcoding-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mpc_transcoding_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_mpc_transcoding_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template). diff --git a/src/constructs/providers/huaweicloud/mpc-transcoding-template/index.ts b/src/constructs/providers/huaweicloud/mpc-transcoding-template/index.ts new file mode 100644 index 00000000..217050cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/mpc-transcoding-template/index.ts @@ -0,0 +1,1027 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MpcTranscodingTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#dash_segment_duration MpcTranscodingTemplate#dash_segment_duration} + */ + readonly dashSegmentDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#hls_segment_duration MpcTranscodingTemplate#hls_segment_duration} + */ + readonly hlsSegmentDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#id MpcTranscodingTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#low_bitrate_hd MpcTranscodingTemplate#low_bitrate_hd} + */ + readonly lowBitrateHd?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#name MpcTranscodingTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#output_format MpcTranscodingTemplate#output_format} + */ + readonly outputFormat: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#region MpcTranscodingTemplate#region} + */ + readonly region?: string; + /** + * audio block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#audio MpcTranscodingTemplate#audio} + */ + readonly audio?: MpcTranscodingTemplateAudio; + /** + * video block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#video MpcTranscodingTemplate#video} + */ + readonly video?: MpcTranscodingTemplateVideo; +} +export interface MpcTranscodingTemplateAudio { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#bitrate MpcTranscodingTemplate#bitrate} + */ + readonly bitrate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#channels MpcTranscodingTemplate#channels} + */ + readonly channels: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#codec MpcTranscodingTemplate#codec} + */ + readonly codec: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#output_policy MpcTranscodingTemplate#output_policy} + */ + readonly outputPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#sample_rate MpcTranscodingTemplate#sample_rate} + */ + readonly sampleRate: number; +} + +export function mpcTranscodingTemplateAudioToTerraform(struct?: MpcTranscodingTemplateAudioOutputReference | MpcTranscodingTemplateAudio): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + channels: cdktf.numberToTerraform(struct!.channels), + codec: cdktf.numberToTerraform(struct!.codec), + output_policy: cdktf.stringToTerraform(struct!.outputPolicy), + sample_rate: cdktf.numberToTerraform(struct!.sampleRate), + } +} + + +export function mpcTranscodingTemplateAudioToHclTerraform(struct?: MpcTranscodingTemplateAudioOutputReference | MpcTranscodingTemplateAudio): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + channels: { + value: cdktf.numberToHclTerraform(struct!.channels), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + codec: { + value: cdktf.numberToHclTerraform(struct!.codec), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output_policy: { + value: cdktf.stringToHclTerraform(struct!.outputPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sample_rate: { + value: cdktf.numberToHclTerraform(struct!.sampleRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MpcTranscodingTemplateAudioOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MpcTranscodingTemplateAudio | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._channels !== undefined) { + hasAnyValues = true; + internalValueResult.channels = this._channels; + } + if (this._codec !== undefined) { + hasAnyValues = true; + internalValueResult.codec = this._codec; + } + if (this._outputPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.outputPolicy = this._outputPolicy; + } + if (this._sampleRate !== undefined) { + hasAnyValues = true; + internalValueResult.sampleRate = this._sampleRate; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MpcTranscodingTemplateAudio | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bitrate = undefined; + this._channels = undefined; + this._codec = undefined; + this._outputPolicy = undefined; + this._sampleRate = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bitrate = value.bitrate; + this._channels = value.channels; + this._codec = value.codec; + this._outputPolicy = value.outputPolicy; + this._sampleRate = value.sampleRate; + } + } + + // bitrate - computed: false, optional: true, required: false + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + public resetBitrate() { + this._bitrate = undefined; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // channels - computed: false, optional: false, required: true + private _channels?: number; + public get channels() { + return this.getNumberAttribute('channels'); + } + public set channels(value: number) { + this._channels = value; + } + // Temporarily expose input value. Use with caution. + public get channelsInput() { + return this._channels; + } + + // codec - computed: false, optional: false, required: true + private _codec?: number; + public get codec() { + return this.getNumberAttribute('codec'); + } + public set codec(value: number) { + this._codec = value; + } + // Temporarily expose input value. Use with caution. + public get codecInput() { + return this._codec; + } + + // output_policy - computed: false, optional: true, required: false + private _outputPolicy?: string; + public get outputPolicy() { + return this.getStringAttribute('output_policy'); + } + public set outputPolicy(value: string) { + this._outputPolicy = value; + } + public resetOutputPolicy() { + this._outputPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputPolicyInput() { + return this._outputPolicy; + } + + // sample_rate - computed: false, optional: false, required: true + private _sampleRate?: number; + public get sampleRate() { + return this.getNumberAttribute('sample_rate'); + } + public set sampleRate(value: number) { + this._sampleRate = value; + } + // Temporarily expose input value. Use with caution. + public get sampleRateInput() { + return this._sampleRate; + } +} +export interface MpcTranscodingTemplateVideo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#bitrate MpcTranscodingTemplate#bitrate} + */ + readonly bitrate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#black_bar_removal MpcTranscodingTemplate#black_bar_removal} + */ + readonly blackBarRemoval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#codec MpcTranscodingTemplate#codec} + */ + readonly codec?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#fps MpcTranscodingTemplate#fps} + */ + readonly fps?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#height MpcTranscodingTemplate#height} + */ + readonly height?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#level MpcTranscodingTemplate#level} + */ + readonly level?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#max_consecutive_bframes MpcTranscodingTemplate#max_consecutive_bframes} + */ + readonly maxConsecutiveBframes?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#max_iframes_interval MpcTranscodingTemplate#max_iframes_interval} + */ + readonly maxIframesInterval?: number; + /** + * schema: Deprecated; the SDK does not support it + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#max_reference_frames MpcTranscodingTemplate#max_reference_frames} + */ + readonly maxReferenceFrames?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#output_policy MpcTranscodingTemplate#output_policy} + */ + readonly outputPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#profile MpcTranscodingTemplate#profile} + */ + readonly profile?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#quality MpcTranscodingTemplate#quality} + */ + readonly quality?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#width MpcTranscodingTemplate#width} + */ + readonly width?: number; +} + +export function mpcTranscodingTemplateVideoToTerraform(struct?: MpcTranscodingTemplateVideoOutputReference | MpcTranscodingTemplateVideo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + black_bar_removal: cdktf.numberToTerraform(struct!.blackBarRemoval), + codec: cdktf.numberToTerraform(struct!.codec), + fps: cdktf.numberToTerraform(struct!.fps), + height: cdktf.numberToTerraform(struct!.height), + level: cdktf.numberToTerraform(struct!.level), + max_consecutive_bframes: cdktf.numberToTerraform(struct!.maxConsecutiveBframes), + max_iframes_interval: cdktf.numberToTerraform(struct!.maxIframesInterval), + max_reference_frames: cdktf.numberToTerraform(struct!.maxReferenceFrames), + output_policy: cdktf.stringToTerraform(struct!.outputPolicy), + profile: cdktf.numberToTerraform(struct!.profile), + quality: cdktf.numberToTerraform(struct!.quality), + width: cdktf.numberToTerraform(struct!.width), + } +} + + +export function mpcTranscodingTemplateVideoToHclTerraform(struct?: MpcTranscodingTemplateVideoOutputReference | MpcTranscodingTemplateVideo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + black_bar_removal: { + value: cdktf.numberToHclTerraform(struct!.blackBarRemoval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + codec: { + value: cdktf.numberToHclTerraform(struct!.codec), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + fps: { + value: cdktf.numberToHclTerraform(struct!.fps), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + height: { + value: cdktf.numberToHclTerraform(struct!.height), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + level: { + value: cdktf.numberToHclTerraform(struct!.level), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_consecutive_bframes: { + value: cdktf.numberToHclTerraform(struct!.maxConsecutiveBframes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_iframes_interval: { + value: cdktf.numberToHclTerraform(struct!.maxIframesInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_reference_frames: { + value: cdktf.numberToHclTerraform(struct!.maxReferenceFrames), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output_policy: { + value: cdktf.stringToHclTerraform(struct!.outputPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + profile: { + value: cdktf.numberToHclTerraform(struct!.profile), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + quality: { + value: cdktf.numberToHclTerraform(struct!.quality), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + width: { + value: cdktf.numberToHclTerraform(struct!.width), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MpcTranscodingTemplateVideoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): MpcTranscodingTemplateVideo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._blackBarRemoval !== undefined) { + hasAnyValues = true; + internalValueResult.blackBarRemoval = this._blackBarRemoval; + } + if (this._codec !== undefined) { + hasAnyValues = true; + internalValueResult.codec = this._codec; + } + if (this._fps !== undefined) { + hasAnyValues = true; + internalValueResult.fps = this._fps; + } + if (this._height !== undefined) { + hasAnyValues = true; + internalValueResult.height = this._height; + } + if (this._level !== undefined) { + hasAnyValues = true; + internalValueResult.level = this._level; + } + if (this._maxConsecutiveBframes !== undefined) { + hasAnyValues = true; + internalValueResult.maxConsecutiveBframes = this._maxConsecutiveBframes; + } + if (this._maxIframesInterval !== undefined) { + hasAnyValues = true; + internalValueResult.maxIframesInterval = this._maxIframesInterval; + } + if (this._maxReferenceFrames !== undefined) { + hasAnyValues = true; + internalValueResult.maxReferenceFrames = this._maxReferenceFrames; + } + if (this._outputPolicy !== undefined) { + hasAnyValues = true; + internalValueResult.outputPolicy = this._outputPolicy; + } + if (this._profile !== undefined) { + hasAnyValues = true; + internalValueResult.profile = this._profile; + } + if (this._quality !== undefined) { + hasAnyValues = true; + internalValueResult.quality = this._quality; + } + if (this._width !== undefined) { + hasAnyValues = true; + internalValueResult.width = this._width; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MpcTranscodingTemplateVideo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bitrate = undefined; + this._blackBarRemoval = undefined; + this._codec = undefined; + this._fps = undefined; + this._height = undefined; + this._level = undefined; + this._maxConsecutiveBframes = undefined; + this._maxIframesInterval = undefined; + this._maxReferenceFrames = undefined; + this._outputPolicy = undefined; + this._profile = undefined; + this._quality = undefined; + this._width = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bitrate = value.bitrate; + this._blackBarRemoval = value.blackBarRemoval; + this._codec = value.codec; + this._fps = value.fps; + this._height = value.height; + this._level = value.level; + this._maxConsecutiveBframes = value.maxConsecutiveBframes; + this._maxIframesInterval = value.maxIframesInterval; + this._maxReferenceFrames = value.maxReferenceFrames; + this._outputPolicy = value.outputPolicy; + this._profile = value.profile; + this._quality = value.quality; + this._width = value.width; + } + } + + // bitrate - computed: false, optional: true, required: false + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + public resetBitrate() { + this._bitrate = undefined; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // black_bar_removal - computed: false, optional: true, required: false + private _blackBarRemoval?: number; + public get blackBarRemoval() { + return this.getNumberAttribute('black_bar_removal'); + } + public set blackBarRemoval(value: number) { + this._blackBarRemoval = value; + } + public resetBlackBarRemoval() { + this._blackBarRemoval = undefined; + } + // Temporarily expose input value. Use with caution. + public get blackBarRemovalInput() { + return this._blackBarRemoval; + } + + // codec - computed: false, optional: true, required: false + private _codec?: number; + public get codec() { + return this.getNumberAttribute('codec'); + } + public set codec(value: number) { + this._codec = value; + } + public resetCodec() { + this._codec = undefined; + } + // Temporarily expose input value. Use with caution. + public get codecInput() { + return this._codec; + } + + // fps - computed: false, optional: true, required: false + private _fps?: number; + public get fps() { + return this.getNumberAttribute('fps'); + } + public set fps(value: number) { + this._fps = value; + } + public resetFps() { + this._fps = undefined; + } + // Temporarily expose input value. Use with caution. + public get fpsInput() { + return this._fps; + } + + // height - computed: false, optional: true, required: false + private _height?: number; + public get height() { + return this.getNumberAttribute('height'); + } + public set height(value: number) { + this._height = value; + } + public resetHeight() { + this._height = undefined; + } + // Temporarily expose input value. Use with caution. + public get heightInput() { + return this._height; + } + + // level - computed: false, optional: true, required: false + private _level?: number; + public get level() { + return this.getNumberAttribute('level'); + } + public set level(value: number) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // max_consecutive_bframes - computed: false, optional: true, required: false + private _maxConsecutiveBframes?: number; + public get maxConsecutiveBframes() { + return this.getNumberAttribute('max_consecutive_bframes'); + } + public set maxConsecutiveBframes(value: number) { + this._maxConsecutiveBframes = value; + } + public resetMaxConsecutiveBframes() { + this._maxConsecutiveBframes = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxConsecutiveBframesInput() { + return this._maxConsecutiveBframes; + } + + // max_iframes_interval - computed: false, optional: true, required: false + private _maxIframesInterval?: number; + public get maxIframesInterval() { + return this.getNumberAttribute('max_iframes_interval'); + } + public set maxIframesInterval(value: number) { + this._maxIframesInterval = value; + } + public resetMaxIframesInterval() { + this._maxIframesInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxIframesIntervalInput() { + return this._maxIframesInterval; + } + + // max_reference_frames - computed: true, optional: true, required: false + private _maxReferenceFrames?: number; + public get maxReferenceFrames() { + return this.getNumberAttribute('max_reference_frames'); + } + public set maxReferenceFrames(value: number) { + this._maxReferenceFrames = value; + } + public resetMaxReferenceFrames() { + this._maxReferenceFrames = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxReferenceFramesInput() { + return this._maxReferenceFrames; + } + + // output_policy - computed: false, optional: true, required: false + private _outputPolicy?: string; + public get outputPolicy() { + return this.getStringAttribute('output_policy'); + } + public set outputPolicy(value: string) { + this._outputPolicy = value; + } + public resetOutputPolicy() { + this._outputPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputPolicyInput() { + return this._outputPolicy; + } + + // profile - computed: false, optional: true, required: false + private _profile?: number; + public get profile() { + return this.getNumberAttribute('profile'); + } + public set profile(value: number) { + this._profile = value; + } + public resetProfile() { + this._profile = undefined; + } + // Temporarily expose input value. Use with caution. + public get profileInput() { + return this._profile; + } + + // quality - computed: false, optional: true, required: false + private _quality?: number; + public get quality() { + return this.getNumberAttribute('quality'); + } + public set quality(value: number) { + this._quality = value; + } + public resetQuality() { + this._quality = undefined; + } + // Temporarily expose input value. Use with caution. + public get qualityInput() { + return this._quality; + } + + // width - computed: false, optional: true, required: false + private _width?: number; + public get width() { + return this.getNumberAttribute('width'); + } + public set width(value: number) { + this._width = value; + } + public resetWidth() { + this._width = undefined; + } + // Temporarily expose input value. Use with caution. + public get widthInput() { + return this._width; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template huaweicloud_mpc_transcoding_template} +*/ +export class MpcTranscodingTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mpc_transcoding_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MpcTranscodingTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MpcTranscodingTemplate to import + * @param importFromId The id of the existing MpcTranscodingTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MpcTranscodingTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mpc_transcoding_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mpc_transcoding_template huaweicloud_mpc_transcoding_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MpcTranscodingTemplateConfig + */ + public constructor(scope: Construct, id: string, config: MpcTranscodingTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mpc_transcoding_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dashSegmentDuration = config.dashSegmentDuration; + this._hlsSegmentDuration = config.hlsSegmentDuration; + this._id = config.id; + this._lowBitrateHd = config.lowBitrateHd; + this._name = config.name; + this._outputFormat = config.outputFormat; + this._region = config.region; + this._audio.internalValue = config.audio; + this._video.internalValue = config.video; + } + + // ========== + // ATTRIBUTES + // ========== + + // dash_segment_duration - computed: false, optional: true, required: false + private _dashSegmentDuration?: number; + public get dashSegmentDuration() { + return this.getNumberAttribute('dash_segment_duration'); + } + public set dashSegmentDuration(value: number) { + this._dashSegmentDuration = value; + } + public resetDashSegmentDuration() { + this._dashSegmentDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get dashSegmentDurationInput() { + return this._dashSegmentDuration; + } + + // hls_segment_duration - computed: false, optional: true, required: false + private _hlsSegmentDuration?: number; + public get hlsSegmentDuration() { + return this.getNumberAttribute('hls_segment_duration'); + } + public set hlsSegmentDuration(value: number) { + this._hlsSegmentDuration = value; + } + public resetHlsSegmentDuration() { + this._hlsSegmentDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get hlsSegmentDurationInput() { + return this._hlsSegmentDuration; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // low_bitrate_hd - computed: false, optional: true, required: false + private _lowBitrateHd?: boolean | cdktf.IResolvable; + public get lowBitrateHd() { + return this.getBooleanAttribute('low_bitrate_hd'); + } + public set lowBitrateHd(value: boolean | cdktf.IResolvable) { + this._lowBitrateHd = value; + } + public resetLowBitrateHd() { + this._lowBitrateHd = undefined; + } + // Temporarily expose input value. Use with caution. + public get lowBitrateHdInput() { + return this._lowBitrateHd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // output_format - computed: false, optional: false, required: true + private _outputFormat?: number; + public get outputFormat() { + return this.getNumberAttribute('output_format'); + } + public set outputFormat(value: number) { + this._outputFormat = value; + } + // Temporarily expose input value. Use with caution. + public get outputFormatInput() { + return this._outputFormat; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // audio - computed: false, optional: true, required: false + private _audio = new MpcTranscodingTemplateAudioOutputReference(this, "audio"); + public get audio() { + return this._audio; + } + public putAudio(value: MpcTranscodingTemplateAudio) { + this._audio.internalValue = value; + } + public resetAudio() { + this._audio.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get audioInput() { + return this._audio.internalValue; + } + + // video - computed: false, optional: true, required: false + private _video = new MpcTranscodingTemplateVideoOutputReference(this, "video"); + public get video() { + return this._video; + } + public putVideo(value: MpcTranscodingTemplateVideo) { + this._video.internalValue = value; + } + public resetVideo() { + this._video.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get videoInput() { + return this._video.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dash_segment_duration: cdktf.numberToTerraform(this._dashSegmentDuration), + hls_segment_duration: cdktf.numberToTerraform(this._hlsSegmentDuration), + id: cdktf.stringToTerraform(this._id), + low_bitrate_hd: cdktf.booleanToTerraform(this._lowBitrateHd), + name: cdktf.stringToTerraform(this._name), + output_format: cdktf.numberToTerraform(this._outputFormat), + region: cdktf.stringToTerraform(this._region), + audio: mpcTranscodingTemplateAudioToTerraform(this._audio.internalValue), + video: mpcTranscodingTemplateVideoToTerraform(this._video.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dash_segment_duration: { + value: cdktf.numberToHclTerraform(this._dashSegmentDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + hls_segment_duration: { + value: cdktf.numberToHclTerraform(this._hlsSegmentDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + low_bitrate_hd: { + value: cdktf.booleanToHclTerraform(this._lowBitrateHd), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + output_format: { + value: cdktf.numberToHclTerraform(this._outputFormat), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + audio: { + value: mpcTranscodingTemplateAudioToHclTerraform(this._audio.internalValue), + isBlock: true, + type: "list", + storageClassType: "MpcTranscodingTemplateAudioList", + }, + video: { + value: mpcTranscodingTemplateVideoToHclTerraform(this._video.internalValue), + isBlock: true, + type: "list", + storageClassType: "MpcTranscodingTemplateVideoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mrs-cluster-v1/README.md b/src/constructs/providers/huaweicloud/mrs-cluster-v1/README.md new file mode 100644 index 00000000..e34cd5ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-cluster-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mrs_cluster_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_mrs_cluster_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1). diff --git a/src/constructs/providers/huaweicloud/mrs-cluster-v1/index.ts b/src/constructs/providers/huaweicloud/mrs-cluster-v1/index.ts new file mode 100644 index 00000000..430b361d --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-cluster-v1/index.ts @@ -0,0 +1,1571 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MrsClusterV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#available_zone_id MrsClusterV1#available_zone_id} + */ + readonly availableZoneId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#billing_type MrsClusterV1#billing_type} + */ + readonly billingType: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#cluster_admin_secret MrsClusterV1#cluster_admin_secret} + */ + readonly clusterAdminSecret: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#cluster_name MrsClusterV1#cluster_name} + */ + readonly clusterName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#cluster_type MrsClusterV1#cluster_type} + */ + readonly clusterType?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#cluster_version MrsClusterV1#cluster_version} + */ + readonly clusterVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#core_node_num MrsClusterV1#core_node_num} + */ + readonly coreNodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#core_node_size MrsClusterV1#core_node_size} + */ + readonly coreNodeSize: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#id MrsClusterV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#log_collection MrsClusterV1#log_collection} + */ + readonly logCollection?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#master_node_num MrsClusterV1#master_node_num} + */ + readonly masterNodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#master_node_size MrsClusterV1#master_node_size} + */ + readonly masterNodeSize: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#node_password MrsClusterV1#node_password} + */ + readonly nodePassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#node_public_cert_name MrsClusterV1#node_public_cert_name} + */ + readonly nodePublicCertName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#region MrsClusterV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#safe_mode MrsClusterV1#safe_mode} + */ + readonly safeMode: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#subnet_id MrsClusterV1#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#tags MrsClusterV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#volume_size MrsClusterV1#volume_size} + */ + readonly volumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#volume_type MrsClusterV1#volume_type} + */ + readonly volumeType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#vpc_id MrsClusterV1#vpc_id} + */ + readonly vpcId: string; + /** + * add_jobs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#add_jobs MrsClusterV1#add_jobs} + */ + readonly addJobs?: MrsClusterV1AddJobs[] | cdktf.IResolvable; + /** + * component_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#component_list MrsClusterV1#component_list} + */ + readonly componentList: MrsClusterV1ComponentListStruct[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#timeouts MrsClusterV1#timeouts} + */ + readonly timeouts?: MrsClusterV1Timeouts; +} +export interface MrsClusterV1AddJobs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#arguments MrsClusterV1#arguments} + */ + readonly arguments?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#file_action MrsClusterV1#file_action} + */ + readonly fileAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#hive_script_path MrsClusterV1#hive_script_path} + */ + readonly hiveScriptPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#hql MrsClusterV1#hql} + */ + readonly hql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#input MrsClusterV1#input} + */ + readonly input?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#jar_path MrsClusterV1#jar_path} + */ + readonly jarPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#job_log MrsClusterV1#job_log} + */ + readonly jobLog?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#job_name MrsClusterV1#job_name} + */ + readonly jobName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#job_type MrsClusterV1#job_type} + */ + readonly jobType: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#output MrsClusterV1#output} + */ + readonly output?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#shutdown_cluster MrsClusterV1#shutdown_cluster} + */ + readonly shutdownCluster?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#submit_job_once_cluster_run MrsClusterV1#submit_job_once_cluster_run} + */ + readonly submitJobOnceClusterRun: boolean | cdktf.IResolvable; +} + +export function mrsClusterV1AddJobsToTerraform(struct?: MrsClusterV1AddJobs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + arguments: cdktf.stringToTerraform(struct!.arguments), + file_action: cdktf.stringToTerraform(struct!.fileAction), + hive_script_path: cdktf.stringToTerraform(struct!.hiveScriptPath), + hql: cdktf.stringToTerraform(struct!.hql), + input: cdktf.stringToTerraform(struct!.input), + jar_path: cdktf.stringToTerraform(struct!.jarPath), + job_log: cdktf.stringToTerraform(struct!.jobLog), + job_name: cdktf.stringToTerraform(struct!.jobName), + job_type: cdktf.numberToTerraform(struct!.jobType), + output: cdktf.stringToTerraform(struct!.output), + shutdown_cluster: cdktf.booleanToTerraform(struct!.shutdownCluster), + submit_job_once_cluster_run: cdktf.booleanToTerraform(struct!.submitJobOnceClusterRun), + } +} + + +export function mrsClusterV1AddJobsToHclTerraform(struct?: MrsClusterV1AddJobs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + arguments: { + value: cdktf.stringToHclTerraform(struct!.arguments), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_action: { + value: cdktf.stringToHclTerraform(struct!.fileAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hive_script_path: { + value: cdktf.stringToHclTerraform(struct!.hiveScriptPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hql: { + value: cdktf.stringToHclTerraform(struct!.hql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input: { + value: cdktf.stringToHclTerraform(struct!.input), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + jar_path: { + value: cdktf.stringToHclTerraform(struct!.jarPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_log: { + value: cdktf.stringToHclTerraform(struct!.jobLog), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(struct!.jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_type: { + value: cdktf.numberToHclTerraform(struct!.jobType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output: { + value: cdktf.stringToHclTerraform(struct!.output), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shutdown_cluster: { + value: cdktf.booleanToHclTerraform(struct!.shutdownCluster), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + submit_job_once_cluster_run: { + value: cdktf.booleanToHclTerraform(struct!.submitJobOnceClusterRun), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsClusterV1AddJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MrsClusterV1AddJobs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._arguments !== undefined) { + hasAnyValues = true; + internalValueResult.arguments = this._arguments; + } + if (this._fileAction !== undefined) { + hasAnyValues = true; + internalValueResult.fileAction = this._fileAction; + } + if (this._hiveScriptPath !== undefined) { + hasAnyValues = true; + internalValueResult.hiveScriptPath = this._hiveScriptPath; + } + if (this._hql !== undefined) { + hasAnyValues = true; + internalValueResult.hql = this._hql; + } + if (this._input !== undefined) { + hasAnyValues = true; + internalValueResult.input = this._input; + } + if (this._jarPath !== undefined) { + hasAnyValues = true; + internalValueResult.jarPath = this._jarPath; + } + if (this._jobLog !== undefined) { + hasAnyValues = true; + internalValueResult.jobLog = this._jobLog; + } + if (this._jobName !== undefined) { + hasAnyValues = true; + internalValueResult.jobName = this._jobName; + } + if (this._jobType !== undefined) { + hasAnyValues = true; + internalValueResult.jobType = this._jobType; + } + if (this._output !== undefined) { + hasAnyValues = true; + internalValueResult.output = this._output; + } + if (this._shutdownCluster !== undefined) { + hasAnyValues = true; + internalValueResult.shutdownCluster = this._shutdownCluster; + } + if (this._submitJobOnceClusterRun !== undefined) { + hasAnyValues = true; + internalValueResult.submitJobOnceClusterRun = this._submitJobOnceClusterRun; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsClusterV1AddJobs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._arguments = undefined; + this._fileAction = undefined; + this._hiveScriptPath = undefined; + this._hql = undefined; + this._input = undefined; + this._jarPath = undefined; + this._jobLog = undefined; + this._jobName = undefined; + this._jobType = undefined; + this._output = undefined; + this._shutdownCluster = undefined; + this._submitJobOnceClusterRun = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._arguments = value.arguments; + this._fileAction = value.fileAction; + this._hiveScriptPath = value.hiveScriptPath; + this._hql = value.hql; + this._input = value.input; + this._jarPath = value.jarPath; + this._jobLog = value.jobLog; + this._jobName = value.jobName; + this._jobType = value.jobType; + this._output = value.output; + this._shutdownCluster = value.shutdownCluster; + this._submitJobOnceClusterRun = value.submitJobOnceClusterRun; + } + } + + // arguments - computed: true, optional: true, required: false + private _arguments?: string; + public get arguments() { + return this.getStringAttribute('arguments'); + } + public set arguments(value: string) { + this._arguments = value; + } + public resetArguments() { + this._arguments = undefined; + } + // Temporarily expose input value. Use with caution. + public get argumentsInput() { + return this._arguments; + } + + // file_action - computed: true, optional: true, required: false + private _fileAction?: string; + public get fileAction() { + return this.getStringAttribute('file_action'); + } + public set fileAction(value: string) { + this._fileAction = value; + } + public resetFileAction() { + this._fileAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileActionInput() { + return this._fileAction; + } + + // hive_script_path - computed: true, optional: true, required: false + private _hiveScriptPath?: string; + public get hiveScriptPath() { + return this.getStringAttribute('hive_script_path'); + } + public set hiveScriptPath(value: string) { + this._hiveScriptPath = value; + } + public resetHiveScriptPath() { + this._hiveScriptPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get hiveScriptPathInput() { + return this._hiveScriptPath; + } + + // hql - computed: true, optional: true, required: false + private _hql?: string; + public get hql() { + return this.getStringAttribute('hql'); + } + public set hql(value: string) { + this._hql = value; + } + public resetHql() { + this._hql = undefined; + } + // Temporarily expose input value. Use with caution. + public get hqlInput() { + return this._hql; + } + + // input - computed: true, optional: true, required: false + private _input?: string; + public get input() { + return this.getStringAttribute('input'); + } + public set input(value: string) { + this._input = value; + } + public resetInput() { + this._input = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputInput() { + return this._input; + } + + // jar_path - computed: false, optional: false, required: true + private _jarPath?: string; + public get jarPath() { + return this.getStringAttribute('jar_path'); + } + public set jarPath(value: string) { + this._jarPath = value; + } + // Temporarily expose input value. Use with caution. + public get jarPathInput() { + return this._jarPath; + } + + // job_log - computed: true, optional: true, required: false + private _jobLog?: string; + public get jobLog() { + return this.getStringAttribute('job_log'); + } + public set jobLog(value: string) { + this._jobLog = value; + } + public resetJobLog() { + this._jobLog = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobLogInput() { + return this._jobLog; + } + + // job_name - computed: false, optional: false, required: true + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // job_type - computed: false, optional: false, required: true + private _jobType?: number; + public get jobType() { + return this.getNumberAttribute('job_type'); + } + public set jobType(value: number) { + this._jobType = value; + } + // Temporarily expose input value. Use with caution. + public get jobTypeInput() { + return this._jobType; + } + + // output - computed: true, optional: true, required: false + private _output?: string; + public get output() { + return this.getStringAttribute('output'); + } + public set output(value: string) { + this._output = value; + } + public resetOutput() { + this._output = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputInput() { + return this._output; + } + + // shutdown_cluster - computed: true, optional: true, required: false + private _shutdownCluster?: boolean | cdktf.IResolvable; + public get shutdownCluster() { + return this.getBooleanAttribute('shutdown_cluster'); + } + public set shutdownCluster(value: boolean | cdktf.IResolvable) { + this._shutdownCluster = value; + } + public resetShutdownCluster() { + this._shutdownCluster = undefined; + } + // Temporarily expose input value. Use with caution. + public get shutdownClusterInput() { + return this._shutdownCluster; + } + + // submit_job_once_cluster_run - computed: false, optional: false, required: true + private _submitJobOnceClusterRun?: boolean | cdktf.IResolvable; + public get submitJobOnceClusterRun() { + return this.getBooleanAttribute('submit_job_once_cluster_run'); + } + public set submitJobOnceClusterRun(value: boolean | cdktf.IResolvable) { + this._submitJobOnceClusterRun = value; + } + // Temporarily expose input value. Use with caution. + public get submitJobOnceClusterRunInput() { + return this._submitJobOnceClusterRun; + } +} + +export class MrsClusterV1AddJobsList extends cdktf.ComplexList { + public internalValue? : MrsClusterV1AddJobs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MrsClusterV1AddJobsOutputReference { + return new MrsClusterV1AddJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MrsClusterV1ComponentListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#component_name MrsClusterV1#component_name} + */ + readonly componentName: string; +} + +export function mrsClusterV1ComponentListStructToTerraform(struct?: MrsClusterV1ComponentListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + component_name: cdktf.stringToTerraform(struct!.componentName), + } +} + + +export function mrsClusterV1ComponentListStructToHclTerraform(struct?: MrsClusterV1ComponentListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + component_name: { + value: cdktf.stringToHclTerraform(struct!.componentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsClusterV1ComponentListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MrsClusterV1ComponentListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._componentName !== undefined) { + hasAnyValues = true; + internalValueResult.componentName = this._componentName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsClusterV1ComponentListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._componentName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._componentName = value.componentName; + } + } + + // component_desc - computed: true, optional: false, required: false + public get componentDesc() { + return this.getStringAttribute('component_desc'); + } + + // component_id - computed: true, optional: false, required: false + public get componentId() { + return this.getStringAttribute('component_id'); + } + + // component_name - computed: false, optional: false, required: true + private _componentName?: string; + public get componentName() { + return this.getStringAttribute('component_name'); + } + public set componentName(value: string) { + this._componentName = value; + } + // Temporarily expose input value. Use with caution. + public get componentNameInput() { + return this._componentName; + } + + // component_version - computed: true, optional: false, required: false + public get componentVersion() { + return this.getStringAttribute('component_version'); + } +} + +export class MrsClusterV1ComponentListStructList extends cdktf.ComplexList { + public internalValue? : MrsClusterV1ComponentListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MrsClusterV1ComponentListStructOutputReference { + return new MrsClusterV1ComponentListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MrsClusterV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#create MrsClusterV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#delete MrsClusterV1#delete} + */ + readonly delete?: string; +} + +export function mrsClusterV1TimeoutsToTerraform(struct?: MrsClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function mrsClusterV1TimeoutsToHclTerraform(struct?: MrsClusterV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsClusterV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): MrsClusterV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsClusterV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1 huaweicloud_mrs_cluster_v1} +*/ +export class MrsClusterV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mrs_cluster_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MrsClusterV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MrsClusterV1 to import + * @param importFromId The id of the existing MrsClusterV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MrsClusterV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mrs_cluster_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster_v1 huaweicloud_mrs_cluster_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MrsClusterV1Config + */ + public constructor(scope: Construct, id: string, config: MrsClusterV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mrs_cluster_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availableZoneId = config.availableZoneId; + this._billingType = config.billingType; + this._clusterAdminSecret = config.clusterAdminSecret; + this._clusterName = config.clusterName; + this._clusterType = config.clusterType; + this._clusterVersion = config.clusterVersion; + this._coreNodeNum = config.coreNodeNum; + this._coreNodeSize = config.coreNodeSize; + this._id = config.id; + this._logCollection = config.logCollection; + this._masterNodeNum = config.masterNodeNum; + this._masterNodeSize = config.masterNodeSize; + this._nodePassword = config.nodePassword; + this._nodePublicCertName = config.nodePublicCertName; + this._region = config.region; + this._safeMode = config.safeMode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._volumeSize = config.volumeSize; + this._volumeType = config.volumeType; + this._vpcId = config.vpcId; + this._addJobs.internalValue = config.addJobs; + this._componentList.internalValue = config.componentList; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // available_zone_id - computed: false, optional: false, required: true + private _availableZoneId?: string; + public get availableZoneId() { + return this.getStringAttribute('available_zone_id'); + } + public set availableZoneId(value: string) { + this._availableZoneId = value; + } + // Temporarily expose input value. Use with caution. + public get availableZoneIdInput() { + return this._availableZoneId; + } + + // available_zone_name - computed: true, optional: false, required: false + public get availableZoneName() { + return this.getStringAttribute('available_zone_name'); + } + + // billing_type - computed: false, optional: false, required: true + private _billingType?: number; + public get billingType() { + return this.getNumberAttribute('billing_type'); + } + public set billingType(value: number) { + this._billingType = value; + } + // Temporarily expose input value. Use with caution. + public get billingTypeInput() { + return this._billingType; + } + + // charging_start_time - computed: true, optional: false, required: false + public get chargingStartTime() { + return this.getStringAttribute('charging_start_time'); + } + + // cluster_admin_secret - computed: false, optional: false, required: true + private _clusterAdminSecret?: string; + public get clusterAdminSecret() { + return this.getStringAttribute('cluster_admin_secret'); + } + public set clusterAdminSecret(value: string) { + this._clusterAdminSecret = value; + } + // Temporarily expose input value. Use with caution. + public get clusterAdminSecretInput() { + return this._clusterAdminSecret; + } + + // cluster_name - computed: false, optional: false, required: true + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // cluster_state - computed: true, optional: false, required: false + public get clusterState() { + return this.getStringAttribute('cluster_state'); + } + + // cluster_type - computed: true, optional: true, required: false + private _clusterType?: number; + public get clusterType() { + return this.getNumberAttribute('cluster_type'); + } + public set clusterType(value: number) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cluster_version - computed: true, optional: true, required: false + private _clusterVersion?: string; + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + public set clusterVersion(value: string) { + this._clusterVersion = value; + } + public resetClusterVersion() { + this._clusterVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterVersionInput() { + return this._clusterVersion; + } + + // core_node_num - computed: false, optional: false, required: true + private _coreNodeNum?: number; + public get coreNodeNum() { + return this.getNumberAttribute('core_node_num'); + } + public set coreNodeNum(value: number) { + this._coreNodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get coreNodeNumInput() { + return this._coreNodeNum; + } + + // core_node_product_id - computed: true, optional: false, required: false + public get coreNodeProductId() { + return this.getStringAttribute('core_node_product_id'); + } + + // core_node_size - computed: false, optional: false, required: true + private _coreNodeSize?: string; + public get coreNodeSize() { + return this.getStringAttribute('core_node_size'); + } + public set coreNodeSize(value: string) { + this._coreNodeSize = value; + } + // Temporarily expose input value. Use with caution. + public get coreNodeSizeInput() { + return this._coreNodeSize; + } + + // core_node_spec_id - computed: true, optional: false, required: false + public get coreNodeSpecId() { + return this.getStringAttribute('core_node_spec_id'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // deployment_id - computed: true, optional: false, required: false + public get deploymentId() { + return this.getStringAttribute('deployment_id'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getStringAttribute('duration'); + } + + // error_info - computed: true, optional: false, required: false + public get errorInfo() { + return this.getStringAttribute('error_info'); + } + + // external_alternate_ip - computed: true, optional: false, required: false + public get externalAlternateIp() { + return this.getStringAttribute('external_alternate_ip'); + } + + // external_ip - computed: true, optional: false, required: false + public get externalIp() { + return this.getStringAttribute('external_ip'); + } + + // fee - computed: true, optional: false, required: false + public get fee() { + return this.getStringAttribute('fee'); + } + + // hadoop_version - computed: true, optional: false, required: false + public get hadoopVersion() { + return this.getStringAttribute('hadoop_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // internal_ip - computed: true, optional: false, required: false + public get internalIp() { + return this.getStringAttribute('internal_ip'); + } + + // log_collection - computed: true, optional: true, required: false + private _logCollection?: number; + public get logCollection() { + return this.getNumberAttribute('log_collection'); + } + public set logCollection(value: number) { + this._logCollection = value; + } + public resetLogCollection() { + this._logCollection = undefined; + } + // Temporarily expose input value. Use with caution. + public get logCollectionInput() { + return this._logCollection; + } + + // master_node_ip - computed: true, optional: false, required: false + public get masterNodeIp() { + return this.getStringAttribute('master_node_ip'); + } + + // master_node_num - computed: false, optional: false, required: true + private _masterNodeNum?: number; + public get masterNodeNum() { + return this.getNumberAttribute('master_node_num'); + } + public set masterNodeNum(value: number) { + this._masterNodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get masterNodeNumInput() { + return this._masterNodeNum; + } + + // master_node_product_id - computed: true, optional: false, required: false + public get masterNodeProductId() { + return this.getStringAttribute('master_node_product_id'); + } + + // master_node_size - computed: false, optional: false, required: true + private _masterNodeSize?: string; + public get masterNodeSize() { + return this.getStringAttribute('master_node_size'); + } + public set masterNodeSize(value: string) { + this._masterNodeSize = value; + } + // Temporarily expose input value. Use with caution. + public get masterNodeSizeInput() { + return this._masterNodeSize; + } + + // master_node_spec_id - computed: true, optional: false, required: false + public get masterNodeSpecId() { + return this.getStringAttribute('master_node_spec_id'); + } + + // node_password - computed: false, optional: true, required: false + private _nodePassword?: string; + public get nodePassword() { + return this.getStringAttribute('node_password'); + } + public set nodePassword(value: string) { + this._nodePassword = value; + } + public resetNodePassword() { + this._nodePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodePasswordInput() { + return this._nodePassword; + } + + // node_public_cert_name - computed: false, optional: true, required: false + private _nodePublicCertName?: string; + public get nodePublicCertName() { + return this.getStringAttribute('node_public_cert_name'); + } + public set nodePublicCertName(value: string) { + this._nodePublicCertName = value; + } + public resetNodePublicCertName() { + this._nodePublicCertName = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodePublicCertNameInput() { + return this._nodePublicCertName; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // private_ip_first - computed: true, optional: false, required: false + public get privateIpFirst() { + return this.getStringAttribute('private_ip_first'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remark - computed: true, optional: false, required: false + public get remark() { + return this.getStringAttribute('remark'); + } + + // safe_mode - computed: false, optional: false, required: true + private _safeMode?: number; + public get safeMode() { + return this.getNumberAttribute('safe_mode'); + } + public set safeMode(value: number) { + this._safeMode = value; + } + // Temporarily expose input value. Use with caution. + public get safeModeInput() { + return this._safeMode; + } + + // security_groups_id - computed: true, optional: false, required: false + public get securityGroupsId() { + return this.getStringAttribute('security_groups_id'); + } + + // slave_security_groups_id - computed: true, optional: false, required: false + public get slaveSecurityGroupsId() { + return this.getStringAttribute('slave_security_groups_id'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } + + // vnc - computed: true, optional: false, required: false + public get vnc() { + return this.getStringAttribute('vnc'); + } + + // volume_size - computed: false, optional: false, required: true + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // add_jobs - computed: false, optional: true, required: false + private _addJobs = new MrsClusterV1AddJobsList(this, "add_jobs", true); + public get addJobs() { + return this._addJobs; + } + public putAddJobs(value: MrsClusterV1AddJobs[] | cdktf.IResolvable) { + this._addJobs.internalValue = value; + } + public resetAddJobs() { + this._addJobs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addJobsInput() { + return this._addJobs.internalValue; + } + + // component_list - computed: false, optional: false, required: true + private _componentList = new MrsClusterV1ComponentListStructList(this, "component_list", true); + public get componentList() { + return this._componentList; + } + public putComponentList(value: MrsClusterV1ComponentListStruct[] | cdktf.IResolvable) { + this._componentList.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get componentListInput() { + return this._componentList.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new MrsClusterV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: MrsClusterV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + available_zone_id: cdktf.stringToTerraform(this._availableZoneId), + billing_type: cdktf.numberToTerraform(this._billingType), + cluster_admin_secret: cdktf.stringToTerraform(this._clusterAdminSecret), + cluster_name: cdktf.stringToTerraform(this._clusterName), + cluster_type: cdktf.numberToTerraform(this._clusterType), + cluster_version: cdktf.stringToTerraform(this._clusterVersion), + core_node_num: cdktf.numberToTerraform(this._coreNodeNum), + core_node_size: cdktf.stringToTerraform(this._coreNodeSize), + id: cdktf.stringToTerraform(this._id), + log_collection: cdktf.numberToTerraform(this._logCollection), + master_node_num: cdktf.numberToTerraform(this._masterNodeNum), + master_node_size: cdktf.stringToTerraform(this._masterNodeSize), + node_password: cdktf.stringToTerraform(this._nodePassword), + node_public_cert_name: cdktf.stringToTerraform(this._nodePublicCertName), + region: cdktf.stringToTerraform(this._region), + safe_mode: cdktf.numberToTerraform(this._safeMode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_size: cdktf.numberToTerraform(this._volumeSize), + volume_type: cdktf.stringToTerraform(this._volumeType), + vpc_id: cdktf.stringToTerraform(this._vpcId), + add_jobs: cdktf.listMapper(mrsClusterV1AddJobsToTerraform, true)(this._addJobs.internalValue), + component_list: cdktf.listMapper(mrsClusterV1ComponentListStructToTerraform, true)(this._componentList.internalValue), + timeouts: mrsClusterV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + available_zone_id: { + value: cdktf.stringToHclTerraform(this._availableZoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + billing_type: { + value: cdktf.numberToHclTerraform(this._billingType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cluster_admin_secret: { + value: cdktf.stringToHclTerraform(this._clusterAdminSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.numberToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cluster_version: { + value: cdktf.stringToHclTerraform(this._clusterVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + core_node_num: { + value: cdktf.numberToHclTerraform(this._coreNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + core_node_size: { + value: cdktf.stringToHclTerraform(this._coreNodeSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_collection: { + value: cdktf.numberToHclTerraform(this._logCollection), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + master_node_num: { + value: cdktf.numberToHclTerraform(this._masterNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + master_node_size: { + value: cdktf.stringToHclTerraform(this._masterNodeSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_password: { + value: cdktf.stringToHclTerraform(this._nodePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_public_cert_name: { + value: cdktf.stringToHclTerraform(this._nodePublicCertName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + safe_mode: { + value: cdktf.numberToHclTerraform(this._safeMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + add_jobs: { + value: cdktf.listMapperHcl(mrsClusterV1AddJobsToHclTerraform, true)(this._addJobs.internalValue), + isBlock: true, + type: "set", + storageClassType: "MrsClusterV1AddJobsList", + }, + component_list: { + value: cdktf.listMapperHcl(mrsClusterV1ComponentListStructToHclTerraform, true)(this._componentList.internalValue), + isBlock: true, + type: "set", + storageClassType: "MrsClusterV1ComponentListStructList", + }, + timeouts: { + value: mrsClusterV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "MrsClusterV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mrs-cluster/README.md b/src/constructs/providers/huaweicloud/mrs-cluster/README.md new file mode 100644 index 00000000..41ed60b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mrs_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_mrs_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster). diff --git a/src/constructs/providers/huaweicloud/mrs-cluster/index.ts b/src/constructs/providers/huaweicloud/mrs-cluster/index.ts new file mode 100644 index 00000000..3e2be756 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-cluster/index.ts @@ -0,0 +1,1571 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MrsClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#available_zone_id MrsCluster#available_zone_id} + */ + readonly availableZoneId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#billing_type MrsCluster#billing_type} + */ + readonly billingType: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#cluster_admin_secret MrsCluster#cluster_admin_secret} + */ + readonly clusterAdminSecret: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#cluster_name MrsCluster#cluster_name} + */ + readonly clusterName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#cluster_type MrsCluster#cluster_type} + */ + readonly clusterType?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#cluster_version MrsCluster#cluster_version} + */ + readonly clusterVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#core_node_num MrsCluster#core_node_num} + */ + readonly coreNodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#core_node_size MrsCluster#core_node_size} + */ + readonly coreNodeSize: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#id MrsCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#log_collection MrsCluster#log_collection} + */ + readonly logCollection?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#master_node_num MrsCluster#master_node_num} + */ + readonly masterNodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#master_node_size MrsCluster#master_node_size} + */ + readonly masterNodeSize: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#node_password MrsCluster#node_password} + */ + readonly nodePassword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#node_public_cert_name MrsCluster#node_public_cert_name} + */ + readonly nodePublicCertName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#region MrsCluster#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#safe_mode MrsCluster#safe_mode} + */ + readonly safeMode: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#subnet_id MrsCluster#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#tags MrsCluster#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#volume_size MrsCluster#volume_size} + */ + readonly volumeSize: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#volume_type MrsCluster#volume_type} + */ + readonly volumeType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#vpc_id MrsCluster#vpc_id} + */ + readonly vpcId: string; + /** + * add_jobs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#add_jobs MrsCluster#add_jobs} + */ + readonly addJobs?: MrsClusterAddJobs[] | cdktf.IResolvable; + /** + * component_list block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#component_list MrsCluster#component_list} + */ + readonly componentList: MrsClusterComponentListStruct[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#timeouts MrsCluster#timeouts} + */ + readonly timeouts?: MrsClusterTimeouts; +} +export interface MrsClusterAddJobs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#arguments MrsCluster#arguments} + */ + readonly arguments?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#file_action MrsCluster#file_action} + */ + readonly fileAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#hive_script_path MrsCluster#hive_script_path} + */ + readonly hiveScriptPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#hql MrsCluster#hql} + */ + readonly hql?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#input MrsCluster#input} + */ + readonly input?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#jar_path MrsCluster#jar_path} + */ + readonly jarPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#job_log MrsCluster#job_log} + */ + readonly jobLog?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#job_name MrsCluster#job_name} + */ + readonly jobName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#job_type MrsCluster#job_type} + */ + readonly jobType: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#output MrsCluster#output} + */ + readonly output?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#shutdown_cluster MrsCluster#shutdown_cluster} + */ + readonly shutdownCluster?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#submit_job_once_cluster_run MrsCluster#submit_job_once_cluster_run} + */ + readonly submitJobOnceClusterRun: boolean | cdktf.IResolvable; +} + +export function mrsClusterAddJobsToTerraform(struct?: MrsClusterAddJobs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + arguments: cdktf.stringToTerraform(struct!.arguments), + file_action: cdktf.stringToTerraform(struct!.fileAction), + hive_script_path: cdktf.stringToTerraform(struct!.hiveScriptPath), + hql: cdktf.stringToTerraform(struct!.hql), + input: cdktf.stringToTerraform(struct!.input), + jar_path: cdktf.stringToTerraform(struct!.jarPath), + job_log: cdktf.stringToTerraform(struct!.jobLog), + job_name: cdktf.stringToTerraform(struct!.jobName), + job_type: cdktf.numberToTerraform(struct!.jobType), + output: cdktf.stringToTerraform(struct!.output), + shutdown_cluster: cdktf.booleanToTerraform(struct!.shutdownCluster), + submit_job_once_cluster_run: cdktf.booleanToTerraform(struct!.submitJobOnceClusterRun), + } +} + + +export function mrsClusterAddJobsToHclTerraform(struct?: MrsClusterAddJobs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + arguments: { + value: cdktf.stringToHclTerraform(struct!.arguments), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_action: { + value: cdktf.stringToHclTerraform(struct!.fileAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hive_script_path: { + value: cdktf.stringToHclTerraform(struct!.hiveScriptPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hql: { + value: cdktf.stringToHclTerraform(struct!.hql), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input: { + value: cdktf.stringToHclTerraform(struct!.input), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + jar_path: { + value: cdktf.stringToHclTerraform(struct!.jarPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_log: { + value: cdktf.stringToHclTerraform(struct!.jobLog), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(struct!.jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_type: { + value: cdktf.numberToHclTerraform(struct!.jobType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output: { + value: cdktf.stringToHclTerraform(struct!.output), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shutdown_cluster: { + value: cdktf.booleanToHclTerraform(struct!.shutdownCluster), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + submit_job_once_cluster_run: { + value: cdktf.booleanToHclTerraform(struct!.submitJobOnceClusterRun), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsClusterAddJobsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MrsClusterAddJobs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._arguments !== undefined) { + hasAnyValues = true; + internalValueResult.arguments = this._arguments; + } + if (this._fileAction !== undefined) { + hasAnyValues = true; + internalValueResult.fileAction = this._fileAction; + } + if (this._hiveScriptPath !== undefined) { + hasAnyValues = true; + internalValueResult.hiveScriptPath = this._hiveScriptPath; + } + if (this._hql !== undefined) { + hasAnyValues = true; + internalValueResult.hql = this._hql; + } + if (this._input !== undefined) { + hasAnyValues = true; + internalValueResult.input = this._input; + } + if (this._jarPath !== undefined) { + hasAnyValues = true; + internalValueResult.jarPath = this._jarPath; + } + if (this._jobLog !== undefined) { + hasAnyValues = true; + internalValueResult.jobLog = this._jobLog; + } + if (this._jobName !== undefined) { + hasAnyValues = true; + internalValueResult.jobName = this._jobName; + } + if (this._jobType !== undefined) { + hasAnyValues = true; + internalValueResult.jobType = this._jobType; + } + if (this._output !== undefined) { + hasAnyValues = true; + internalValueResult.output = this._output; + } + if (this._shutdownCluster !== undefined) { + hasAnyValues = true; + internalValueResult.shutdownCluster = this._shutdownCluster; + } + if (this._submitJobOnceClusterRun !== undefined) { + hasAnyValues = true; + internalValueResult.submitJobOnceClusterRun = this._submitJobOnceClusterRun; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsClusterAddJobs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._arguments = undefined; + this._fileAction = undefined; + this._hiveScriptPath = undefined; + this._hql = undefined; + this._input = undefined; + this._jarPath = undefined; + this._jobLog = undefined; + this._jobName = undefined; + this._jobType = undefined; + this._output = undefined; + this._shutdownCluster = undefined; + this._submitJobOnceClusterRun = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._arguments = value.arguments; + this._fileAction = value.fileAction; + this._hiveScriptPath = value.hiveScriptPath; + this._hql = value.hql; + this._input = value.input; + this._jarPath = value.jarPath; + this._jobLog = value.jobLog; + this._jobName = value.jobName; + this._jobType = value.jobType; + this._output = value.output; + this._shutdownCluster = value.shutdownCluster; + this._submitJobOnceClusterRun = value.submitJobOnceClusterRun; + } + } + + // arguments - computed: true, optional: true, required: false + private _arguments?: string; + public get arguments() { + return this.getStringAttribute('arguments'); + } + public set arguments(value: string) { + this._arguments = value; + } + public resetArguments() { + this._arguments = undefined; + } + // Temporarily expose input value. Use with caution. + public get argumentsInput() { + return this._arguments; + } + + // file_action - computed: true, optional: true, required: false + private _fileAction?: string; + public get fileAction() { + return this.getStringAttribute('file_action'); + } + public set fileAction(value: string) { + this._fileAction = value; + } + public resetFileAction() { + this._fileAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get fileActionInput() { + return this._fileAction; + } + + // hive_script_path - computed: true, optional: true, required: false + private _hiveScriptPath?: string; + public get hiveScriptPath() { + return this.getStringAttribute('hive_script_path'); + } + public set hiveScriptPath(value: string) { + this._hiveScriptPath = value; + } + public resetHiveScriptPath() { + this._hiveScriptPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get hiveScriptPathInput() { + return this._hiveScriptPath; + } + + // hql - computed: true, optional: true, required: false + private _hql?: string; + public get hql() { + return this.getStringAttribute('hql'); + } + public set hql(value: string) { + this._hql = value; + } + public resetHql() { + this._hql = undefined; + } + // Temporarily expose input value. Use with caution. + public get hqlInput() { + return this._hql; + } + + // input - computed: true, optional: true, required: false + private _input?: string; + public get input() { + return this.getStringAttribute('input'); + } + public set input(value: string) { + this._input = value; + } + public resetInput() { + this._input = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputInput() { + return this._input; + } + + // jar_path - computed: false, optional: false, required: true + private _jarPath?: string; + public get jarPath() { + return this.getStringAttribute('jar_path'); + } + public set jarPath(value: string) { + this._jarPath = value; + } + // Temporarily expose input value. Use with caution. + public get jarPathInput() { + return this._jarPath; + } + + // job_log - computed: true, optional: true, required: false + private _jobLog?: string; + public get jobLog() { + return this.getStringAttribute('job_log'); + } + public set jobLog(value: string) { + this._jobLog = value; + } + public resetJobLog() { + this._jobLog = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobLogInput() { + return this._jobLog; + } + + // job_name - computed: false, optional: false, required: true + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // job_type - computed: false, optional: false, required: true + private _jobType?: number; + public get jobType() { + return this.getNumberAttribute('job_type'); + } + public set jobType(value: number) { + this._jobType = value; + } + // Temporarily expose input value. Use with caution. + public get jobTypeInput() { + return this._jobType; + } + + // output - computed: true, optional: true, required: false + private _output?: string; + public get output() { + return this.getStringAttribute('output'); + } + public set output(value: string) { + this._output = value; + } + public resetOutput() { + this._output = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputInput() { + return this._output; + } + + // shutdown_cluster - computed: true, optional: true, required: false + private _shutdownCluster?: boolean | cdktf.IResolvable; + public get shutdownCluster() { + return this.getBooleanAttribute('shutdown_cluster'); + } + public set shutdownCluster(value: boolean | cdktf.IResolvable) { + this._shutdownCluster = value; + } + public resetShutdownCluster() { + this._shutdownCluster = undefined; + } + // Temporarily expose input value. Use with caution. + public get shutdownClusterInput() { + return this._shutdownCluster; + } + + // submit_job_once_cluster_run - computed: false, optional: false, required: true + private _submitJobOnceClusterRun?: boolean | cdktf.IResolvable; + public get submitJobOnceClusterRun() { + return this.getBooleanAttribute('submit_job_once_cluster_run'); + } + public set submitJobOnceClusterRun(value: boolean | cdktf.IResolvable) { + this._submitJobOnceClusterRun = value; + } + // Temporarily expose input value. Use with caution. + public get submitJobOnceClusterRunInput() { + return this._submitJobOnceClusterRun; + } +} + +export class MrsClusterAddJobsList extends cdktf.ComplexList { + public internalValue? : MrsClusterAddJobs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MrsClusterAddJobsOutputReference { + return new MrsClusterAddJobsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MrsClusterComponentListStruct { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#component_name MrsCluster#component_name} + */ + readonly componentName: string; +} + +export function mrsClusterComponentListStructToTerraform(struct?: MrsClusterComponentListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + component_name: cdktf.stringToTerraform(struct!.componentName), + } +} + + +export function mrsClusterComponentListStructToHclTerraform(struct?: MrsClusterComponentListStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + component_name: { + value: cdktf.stringToHclTerraform(struct!.componentName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsClusterComponentListStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): MrsClusterComponentListStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._componentName !== undefined) { + hasAnyValues = true; + internalValueResult.componentName = this._componentName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsClusterComponentListStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._componentName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._componentName = value.componentName; + } + } + + // component_desc - computed: true, optional: false, required: false + public get componentDesc() { + return this.getStringAttribute('component_desc'); + } + + // component_id - computed: true, optional: false, required: false + public get componentId() { + return this.getStringAttribute('component_id'); + } + + // component_name - computed: false, optional: false, required: true + private _componentName?: string; + public get componentName() { + return this.getStringAttribute('component_name'); + } + public set componentName(value: string) { + this._componentName = value; + } + // Temporarily expose input value. Use with caution. + public get componentNameInput() { + return this._componentName; + } + + // component_version - computed: true, optional: false, required: false + public get componentVersion() { + return this.getStringAttribute('component_version'); + } +} + +export class MrsClusterComponentListStructList extends cdktf.ComplexList { + public internalValue? : MrsClusterComponentListStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): MrsClusterComponentListStructOutputReference { + return new MrsClusterComponentListStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface MrsClusterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#create MrsCluster#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#delete MrsCluster#delete} + */ + readonly delete?: string; +} + +export function mrsClusterTimeoutsToTerraform(struct?: MrsClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function mrsClusterTimeoutsToHclTerraform(struct?: MrsClusterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsClusterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): MrsClusterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsClusterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster huaweicloud_mrs_cluster} +*/ +export class MrsCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mrs_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MrsCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MrsCluster to import + * @param importFromId The id of the existing MrsCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MrsCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mrs_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_cluster huaweicloud_mrs_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MrsClusterConfig + */ + public constructor(scope: Construct, id: string, config: MrsClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mrs_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availableZoneId = config.availableZoneId; + this._billingType = config.billingType; + this._clusterAdminSecret = config.clusterAdminSecret; + this._clusterName = config.clusterName; + this._clusterType = config.clusterType; + this._clusterVersion = config.clusterVersion; + this._coreNodeNum = config.coreNodeNum; + this._coreNodeSize = config.coreNodeSize; + this._id = config.id; + this._logCollection = config.logCollection; + this._masterNodeNum = config.masterNodeNum; + this._masterNodeSize = config.masterNodeSize; + this._nodePassword = config.nodePassword; + this._nodePublicCertName = config.nodePublicCertName; + this._region = config.region; + this._safeMode = config.safeMode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._volumeSize = config.volumeSize; + this._volumeType = config.volumeType; + this._vpcId = config.vpcId; + this._addJobs.internalValue = config.addJobs; + this._componentList.internalValue = config.componentList; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // available_zone_id - computed: false, optional: false, required: true + private _availableZoneId?: string; + public get availableZoneId() { + return this.getStringAttribute('available_zone_id'); + } + public set availableZoneId(value: string) { + this._availableZoneId = value; + } + // Temporarily expose input value. Use with caution. + public get availableZoneIdInput() { + return this._availableZoneId; + } + + // available_zone_name - computed: true, optional: false, required: false + public get availableZoneName() { + return this.getStringAttribute('available_zone_name'); + } + + // billing_type - computed: false, optional: false, required: true + private _billingType?: number; + public get billingType() { + return this.getNumberAttribute('billing_type'); + } + public set billingType(value: number) { + this._billingType = value; + } + // Temporarily expose input value. Use with caution. + public get billingTypeInput() { + return this._billingType; + } + + // charging_start_time - computed: true, optional: false, required: false + public get chargingStartTime() { + return this.getStringAttribute('charging_start_time'); + } + + // cluster_admin_secret - computed: false, optional: false, required: true + private _clusterAdminSecret?: string; + public get clusterAdminSecret() { + return this.getStringAttribute('cluster_admin_secret'); + } + public set clusterAdminSecret(value: string) { + this._clusterAdminSecret = value; + } + // Temporarily expose input value. Use with caution. + public get clusterAdminSecretInput() { + return this._clusterAdminSecret; + } + + // cluster_name - computed: false, optional: false, required: true + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // cluster_state - computed: true, optional: false, required: false + public get clusterState() { + return this.getStringAttribute('cluster_state'); + } + + // cluster_type - computed: true, optional: true, required: false + private _clusterType?: number; + public get clusterType() { + return this.getNumberAttribute('cluster_type'); + } + public set clusterType(value: number) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cluster_version - computed: true, optional: true, required: false + private _clusterVersion?: string; + public get clusterVersion() { + return this.getStringAttribute('cluster_version'); + } + public set clusterVersion(value: string) { + this._clusterVersion = value; + } + public resetClusterVersion() { + this._clusterVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterVersionInput() { + return this._clusterVersion; + } + + // core_node_num - computed: false, optional: false, required: true + private _coreNodeNum?: number; + public get coreNodeNum() { + return this.getNumberAttribute('core_node_num'); + } + public set coreNodeNum(value: number) { + this._coreNodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get coreNodeNumInput() { + return this._coreNodeNum; + } + + // core_node_product_id - computed: true, optional: false, required: false + public get coreNodeProductId() { + return this.getStringAttribute('core_node_product_id'); + } + + // core_node_size - computed: false, optional: false, required: true + private _coreNodeSize?: string; + public get coreNodeSize() { + return this.getStringAttribute('core_node_size'); + } + public set coreNodeSize(value: string) { + this._coreNodeSize = value; + } + // Temporarily expose input value. Use with caution. + public get coreNodeSizeInput() { + return this._coreNodeSize; + } + + // core_node_spec_id - computed: true, optional: false, required: false + public get coreNodeSpecId() { + return this.getStringAttribute('core_node_spec_id'); + } + + // create_at - computed: true, optional: false, required: false + public get createAt() { + return this.getStringAttribute('create_at'); + } + + // deployment_id - computed: true, optional: false, required: false + public get deploymentId() { + return this.getStringAttribute('deployment_id'); + } + + // duration - computed: true, optional: false, required: false + public get duration() { + return this.getStringAttribute('duration'); + } + + // error_info - computed: true, optional: false, required: false + public get errorInfo() { + return this.getStringAttribute('error_info'); + } + + // external_alternate_ip - computed: true, optional: false, required: false + public get externalAlternateIp() { + return this.getStringAttribute('external_alternate_ip'); + } + + // external_ip - computed: true, optional: false, required: false + public get externalIp() { + return this.getStringAttribute('external_ip'); + } + + // fee - computed: true, optional: false, required: false + public get fee() { + return this.getStringAttribute('fee'); + } + + // hadoop_version - computed: true, optional: false, required: false + public get hadoopVersion() { + return this.getStringAttribute('hadoop_version'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // internal_ip - computed: true, optional: false, required: false + public get internalIp() { + return this.getStringAttribute('internal_ip'); + } + + // log_collection - computed: true, optional: true, required: false + private _logCollection?: number; + public get logCollection() { + return this.getNumberAttribute('log_collection'); + } + public set logCollection(value: number) { + this._logCollection = value; + } + public resetLogCollection() { + this._logCollection = undefined; + } + // Temporarily expose input value. Use with caution. + public get logCollectionInput() { + return this._logCollection; + } + + // master_node_ip - computed: true, optional: false, required: false + public get masterNodeIp() { + return this.getStringAttribute('master_node_ip'); + } + + // master_node_num - computed: false, optional: false, required: true + private _masterNodeNum?: number; + public get masterNodeNum() { + return this.getNumberAttribute('master_node_num'); + } + public set masterNodeNum(value: number) { + this._masterNodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get masterNodeNumInput() { + return this._masterNodeNum; + } + + // master_node_product_id - computed: true, optional: false, required: false + public get masterNodeProductId() { + return this.getStringAttribute('master_node_product_id'); + } + + // master_node_size - computed: false, optional: false, required: true + private _masterNodeSize?: string; + public get masterNodeSize() { + return this.getStringAttribute('master_node_size'); + } + public set masterNodeSize(value: string) { + this._masterNodeSize = value; + } + // Temporarily expose input value. Use with caution. + public get masterNodeSizeInput() { + return this._masterNodeSize; + } + + // master_node_spec_id - computed: true, optional: false, required: false + public get masterNodeSpecId() { + return this.getStringAttribute('master_node_spec_id'); + } + + // node_password - computed: false, optional: true, required: false + private _nodePassword?: string; + public get nodePassword() { + return this.getStringAttribute('node_password'); + } + public set nodePassword(value: string) { + this._nodePassword = value; + } + public resetNodePassword() { + this._nodePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodePasswordInput() { + return this._nodePassword; + } + + // node_public_cert_name - computed: false, optional: true, required: false + private _nodePublicCertName?: string; + public get nodePublicCertName() { + return this.getStringAttribute('node_public_cert_name'); + } + public set nodePublicCertName(value: string) { + this._nodePublicCertName = value; + } + public resetNodePublicCertName() { + this._nodePublicCertName = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodePublicCertNameInput() { + return this._nodePublicCertName; + } + + // order_id - computed: true, optional: false, required: false + public get orderId() { + return this.getStringAttribute('order_id'); + } + + // private_ip_first - computed: true, optional: false, required: false + public get privateIpFirst() { + return this.getStringAttribute('private_ip_first'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remark - computed: true, optional: false, required: false + public get remark() { + return this.getStringAttribute('remark'); + } + + // safe_mode - computed: false, optional: false, required: true + private _safeMode?: number; + public get safeMode() { + return this.getNumberAttribute('safe_mode'); + } + public set safeMode(value: number) { + this._safeMode = value; + } + // Temporarily expose input value. Use with caution. + public get safeModeInput() { + return this._safeMode; + } + + // security_groups_id - computed: true, optional: false, required: false + public get securityGroupsId() { + return this.getStringAttribute('security_groups_id'); + } + + // slave_security_groups_id - computed: true, optional: false, required: false + public get slaveSecurityGroupsId() { + return this.getStringAttribute('slave_security_groups_id'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // update_at - computed: true, optional: false, required: false + public get updateAt() { + return this.getStringAttribute('update_at'); + } + + // vnc - computed: true, optional: false, required: false + public get vnc() { + return this.getStringAttribute('vnc'); + } + + // volume_size - computed: false, optional: false, required: true + private _volumeSize?: number; + public get volumeSize() { + return this.getNumberAttribute('volume_size'); + } + public set volumeSize(value: number) { + this._volumeSize = value; + } + // Temporarily expose input value. Use with caution. + public get volumeSizeInput() { + return this._volumeSize; + } + + // volume_type - computed: false, optional: false, required: true + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // add_jobs - computed: false, optional: true, required: false + private _addJobs = new MrsClusterAddJobsList(this, "add_jobs", true); + public get addJobs() { + return this._addJobs; + } + public putAddJobs(value: MrsClusterAddJobs[] | cdktf.IResolvable) { + this._addJobs.internalValue = value; + } + public resetAddJobs() { + this._addJobs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get addJobsInput() { + return this._addJobs.internalValue; + } + + // component_list - computed: false, optional: false, required: true + private _componentList = new MrsClusterComponentListStructList(this, "component_list", true); + public get componentList() { + return this._componentList; + } + public putComponentList(value: MrsClusterComponentListStruct[] | cdktf.IResolvable) { + this._componentList.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get componentListInput() { + return this._componentList.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new MrsClusterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: MrsClusterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + available_zone_id: cdktf.stringToTerraform(this._availableZoneId), + billing_type: cdktf.numberToTerraform(this._billingType), + cluster_admin_secret: cdktf.stringToTerraform(this._clusterAdminSecret), + cluster_name: cdktf.stringToTerraform(this._clusterName), + cluster_type: cdktf.numberToTerraform(this._clusterType), + cluster_version: cdktf.stringToTerraform(this._clusterVersion), + core_node_num: cdktf.numberToTerraform(this._coreNodeNum), + core_node_size: cdktf.stringToTerraform(this._coreNodeSize), + id: cdktf.stringToTerraform(this._id), + log_collection: cdktf.numberToTerraform(this._logCollection), + master_node_num: cdktf.numberToTerraform(this._masterNodeNum), + master_node_size: cdktf.stringToTerraform(this._masterNodeSize), + node_password: cdktf.stringToTerraform(this._nodePassword), + node_public_cert_name: cdktf.stringToTerraform(this._nodePublicCertName), + region: cdktf.stringToTerraform(this._region), + safe_mode: cdktf.numberToTerraform(this._safeMode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + volume_size: cdktf.numberToTerraform(this._volumeSize), + volume_type: cdktf.stringToTerraform(this._volumeType), + vpc_id: cdktf.stringToTerraform(this._vpcId), + add_jobs: cdktf.listMapper(mrsClusterAddJobsToTerraform, true)(this._addJobs.internalValue), + component_list: cdktf.listMapper(mrsClusterComponentListStructToTerraform, true)(this._componentList.internalValue), + timeouts: mrsClusterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + available_zone_id: { + value: cdktf.stringToHclTerraform(this._availableZoneId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + billing_type: { + value: cdktf.numberToHclTerraform(this._billingType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cluster_admin_secret: { + value: cdktf.stringToHclTerraform(this._clusterAdminSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.numberToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cluster_version: { + value: cdktf.stringToHclTerraform(this._clusterVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + core_node_num: { + value: cdktf.numberToHclTerraform(this._coreNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + core_node_size: { + value: cdktf.stringToHclTerraform(this._coreNodeSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_collection: { + value: cdktf.numberToHclTerraform(this._logCollection), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + master_node_num: { + value: cdktf.numberToHclTerraform(this._masterNodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + master_node_size: { + value: cdktf.stringToHclTerraform(this._masterNodeSize), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_password: { + value: cdktf.stringToHclTerraform(this._nodePassword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_public_cert_name: { + value: cdktf.stringToHclTerraform(this._nodePublicCertName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + safe_mode: { + value: cdktf.numberToHclTerraform(this._safeMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + volume_size: { + value: cdktf.numberToHclTerraform(this._volumeSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + add_jobs: { + value: cdktf.listMapperHcl(mrsClusterAddJobsToHclTerraform, true)(this._addJobs.internalValue), + isBlock: true, + type: "set", + storageClassType: "MrsClusterAddJobsList", + }, + component_list: { + value: cdktf.listMapperHcl(mrsClusterComponentListStructToHclTerraform, true)(this._componentList.internalValue), + isBlock: true, + type: "set", + storageClassType: "MrsClusterComponentListStructList", + }, + timeouts: { + value: mrsClusterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "MrsClusterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mrs-job-v1/README.md b/src/constructs/providers/huaweicloud/mrs-job-v1/README.md new file mode 100644 index 00000000..6a3e429d --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-job-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mrs_job_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_mrs_job_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1). diff --git a/src/constructs/providers/huaweicloud/mrs-job-v1/index.ts b/src/constructs/providers/huaweicloud/mrs-job-v1/index.ts new file mode 100644 index 00000000..d6b94a91 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-job-v1/index.ts @@ -0,0 +1,635 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MrsJobV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#arguments MrsJobV1#arguments} + */ + readonly arguments?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#cluster_id MrsJobV1#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#hive_script_path MrsJobV1#hive_script_path} + */ + readonly hiveScriptPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#id MrsJobV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#input MrsJobV1#input} + */ + readonly input?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#is_protected MrsJobV1#is_protected} + */ + readonly isProtected?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#is_public MrsJobV1#is_public} + */ + readonly isPublic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#jar_path MrsJobV1#jar_path} + */ + readonly jarPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#job_log MrsJobV1#job_log} + */ + readonly jobLog?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#job_name MrsJobV1#job_name} + */ + readonly jobName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#job_type MrsJobV1#job_type} + */ + readonly jobType: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#output MrsJobV1#output} + */ + readonly output?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#region MrsJobV1#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#timeouts MrsJobV1#timeouts} + */ + readonly timeouts?: MrsJobV1Timeouts; +} +export interface MrsJobV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#create MrsJobV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#delete MrsJobV1#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#update MrsJobV1#update} + */ + readonly update?: string; +} + +export function mrsJobV1TimeoutsToTerraform(struct?: MrsJobV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function mrsJobV1TimeoutsToHclTerraform(struct?: MrsJobV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsJobV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): MrsJobV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsJobV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1 huaweicloud_mrs_job_v1} +*/ +export class MrsJobV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mrs_job_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MrsJobV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MrsJobV1 to import + * @param importFromId The id of the existing MrsJobV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MrsJobV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mrs_job_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job_v1 huaweicloud_mrs_job_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MrsJobV1Config + */ + public constructor(scope: Construct, id: string, config: MrsJobV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mrs_job_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._arguments = config.arguments; + this._clusterId = config.clusterId; + this._hiveScriptPath = config.hiveScriptPath; + this._id = config.id; + this._input = config.input; + this._isProtected = config.isProtected; + this._isPublic = config.isPublic; + this._jarPath = config.jarPath; + this._jobLog = config.jobLog; + this._jobName = config.jobName; + this._jobType = config.jobType; + this._output = config.output; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // arguments - computed: true, optional: true, required: false + private _arguments?: string; + public get arguments() { + return this.getStringAttribute('arguments'); + } + public set arguments(value: string) { + this._arguments = value; + } + public resetArguments() { + this._arguments = undefined; + } + // Temporarily expose input value. Use with caution. + public get argumentsInput() { + return this._arguments; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // hive_script_path - computed: true, optional: true, required: false + private _hiveScriptPath?: string; + public get hiveScriptPath() { + return this.getStringAttribute('hive_script_path'); + } + public set hiveScriptPath(value: string) { + this._hiveScriptPath = value; + } + public resetHiveScriptPath() { + this._hiveScriptPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get hiveScriptPathInput() { + return this._hiveScriptPath; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // input - computed: true, optional: true, required: false + private _input?: string; + public get input() { + return this.getStringAttribute('input'); + } + public set input(value: string) { + this._input = value; + } + public resetInput() { + this._input = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputInput() { + return this._input; + } + + // is_protected - computed: true, optional: true, required: false + private _isProtected?: boolean | cdktf.IResolvable; + public get isProtected() { + return this.getBooleanAttribute('is_protected'); + } + public set isProtected(value: boolean | cdktf.IResolvable) { + this._isProtected = value; + } + public resetIsProtected() { + this._isProtected = undefined; + } + // Temporarily expose input value. Use with caution. + public get isProtectedInput() { + return this._isProtected; + } + + // is_public - computed: true, optional: true, required: false + private _isPublic?: boolean | cdktf.IResolvable; + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + public set isPublic(value: boolean | cdktf.IResolvable) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // jar_path - computed: false, optional: false, required: true + private _jarPath?: string; + public get jarPath() { + return this.getStringAttribute('jar_path'); + } + public set jarPath(value: string) { + this._jarPath = value; + } + // Temporarily expose input value. Use with caution. + public get jarPathInput() { + return this._jarPath; + } + + // job_log - computed: true, optional: true, required: false + private _jobLog?: string; + public get jobLog() { + return this.getStringAttribute('job_log'); + } + public set jobLog(value: string) { + this._jobLog = value; + } + public resetJobLog() { + this._jobLog = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobLogInput() { + return this._jobLog; + } + + // job_name - computed: false, optional: false, required: true + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // job_state - computed: true, optional: false, required: false + public get jobState() { + return this.getStringAttribute('job_state'); + } + + // job_type - computed: false, optional: false, required: true + private _jobType?: number; + public get jobType() { + return this.getNumberAttribute('job_type'); + } + public set jobType(value: number) { + this._jobType = value; + } + // Temporarily expose input value. Use with caution. + public get jobTypeInput() { + return this._jobType; + } + + // output - computed: true, optional: true, required: false + private _output?: string; + public get output() { + return this.getStringAttribute('output'); + } + public set output(value: string) { + this._output = value; + } + public resetOutput() { + this._output = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputInput() { + return this._output; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new MrsJobV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: MrsJobV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arguments: cdktf.stringToTerraform(this._arguments), + cluster_id: cdktf.stringToTerraform(this._clusterId), + hive_script_path: cdktf.stringToTerraform(this._hiveScriptPath), + id: cdktf.stringToTerraform(this._id), + input: cdktf.stringToTerraform(this._input), + is_protected: cdktf.booleanToTerraform(this._isProtected), + is_public: cdktf.booleanToTerraform(this._isPublic), + jar_path: cdktf.stringToTerraform(this._jarPath), + job_log: cdktf.stringToTerraform(this._jobLog), + job_name: cdktf.stringToTerraform(this._jobName), + job_type: cdktf.numberToTerraform(this._jobType), + output: cdktf.stringToTerraform(this._output), + region: cdktf.stringToTerraform(this._region), + timeouts: mrsJobV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arguments: { + value: cdktf.stringToHclTerraform(this._arguments), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hive_script_path: { + value: cdktf.stringToHclTerraform(this._hiveScriptPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input: { + value: cdktf.stringToHclTerraform(this._input), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_protected: { + value: cdktf.booleanToHclTerraform(this._isProtected), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_public: { + value: cdktf.booleanToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + jar_path: { + value: cdktf.stringToHclTerraform(this._jarPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_log: { + value: cdktf.stringToHclTerraform(this._jobLog), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_type: { + value: cdktf.numberToHclTerraform(this._jobType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output: { + value: cdktf.stringToHclTerraform(this._output), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: mrsJobV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "MrsJobV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/mrs-job/README.md b/src/constructs/providers/huaweicloud/mrs-job/README.md new file mode 100644 index 00000000..913f904a --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-job/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_mrs_job` + +Refer to the Terraform Registry for docs: [`huaweicloud_mrs_job`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job). diff --git a/src/constructs/providers/huaweicloud/mrs-job/index.ts b/src/constructs/providers/huaweicloud/mrs-job/index.ts new file mode 100644 index 00000000..784f8e53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/mrs-job/index.ts @@ -0,0 +1,635 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface MrsJobConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#arguments MrsJob#arguments} + */ + readonly arguments?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#cluster_id MrsJob#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#hive_script_path MrsJob#hive_script_path} + */ + readonly hiveScriptPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#id MrsJob#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#input MrsJob#input} + */ + readonly input?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#is_protected MrsJob#is_protected} + */ + readonly isProtected?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#is_public MrsJob#is_public} + */ + readonly isPublic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#jar_path MrsJob#jar_path} + */ + readonly jarPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#job_log MrsJob#job_log} + */ + readonly jobLog?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#job_name MrsJob#job_name} + */ + readonly jobName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#job_type MrsJob#job_type} + */ + readonly jobType: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#output MrsJob#output} + */ + readonly output?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#region MrsJob#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#timeouts MrsJob#timeouts} + */ + readonly timeouts?: MrsJobTimeouts; +} +export interface MrsJobTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#create MrsJob#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#delete MrsJob#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#update MrsJob#update} + */ + readonly update?: string; +} + +export function mrsJobTimeoutsToTerraform(struct?: MrsJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function mrsJobTimeoutsToHclTerraform(struct?: MrsJobTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class MrsJobTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): MrsJobTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: MrsJobTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job huaweicloud_mrs_job} +*/ +export class MrsJob extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_mrs_job"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a MrsJob resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the MrsJob to import + * @param importFromId The id of the existing MrsJob that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the MrsJob to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_mrs_job", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/mrs_job huaweicloud_mrs_job} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options MrsJobConfig + */ + public constructor(scope: Construct, id: string, config: MrsJobConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_mrs_job', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._arguments = config.arguments; + this._clusterId = config.clusterId; + this._hiveScriptPath = config.hiveScriptPath; + this._id = config.id; + this._input = config.input; + this._isProtected = config.isProtected; + this._isPublic = config.isPublic; + this._jarPath = config.jarPath; + this._jobLog = config.jobLog; + this._jobName = config.jobName; + this._jobType = config.jobType; + this._output = config.output; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // arguments - computed: true, optional: true, required: false + private _arguments?: string; + public get arguments() { + return this.getStringAttribute('arguments'); + } + public set arguments(value: string) { + this._arguments = value; + } + public resetArguments() { + this._arguments = undefined; + } + // Temporarily expose input value. Use with caution. + public get argumentsInput() { + return this._arguments; + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // hive_script_path - computed: true, optional: true, required: false + private _hiveScriptPath?: string; + public get hiveScriptPath() { + return this.getStringAttribute('hive_script_path'); + } + public set hiveScriptPath(value: string) { + this._hiveScriptPath = value; + } + public resetHiveScriptPath() { + this._hiveScriptPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get hiveScriptPathInput() { + return this._hiveScriptPath; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // input - computed: true, optional: true, required: false + private _input?: string; + public get input() { + return this.getStringAttribute('input'); + } + public set input(value: string) { + this._input = value; + } + public resetInput() { + this._input = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputInput() { + return this._input; + } + + // is_protected - computed: true, optional: true, required: false + private _isProtected?: boolean | cdktf.IResolvable; + public get isProtected() { + return this.getBooleanAttribute('is_protected'); + } + public set isProtected(value: boolean | cdktf.IResolvable) { + this._isProtected = value; + } + public resetIsProtected() { + this._isProtected = undefined; + } + // Temporarily expose input value. Use with caution. + public get isProtectedInput() { + return this._isProtected; + } + + // is_public - computed: true, optional: true, required: false + private _isPublic?: boolean | cdktf.IResolvable; + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + public set isPublic(value: boolean | cdktf.IResolvable) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // jar_path - computed: false, optional: false, required: true + private _jarPath?: string; + public get jarPath() { + return this.getStringAttribute('jar_path'); + } + public set jarPath(value: string) { + this._jarPath = value; + } + // Temporarily expose input value. Use with caution. + public get jarPathInput() { + return this._jarPath; + } + + // job_log - computed: true, optional: true, required: false + private _jobLog?: string; + public get jobLog() { + return this.getStringAttribute('job_log'); + } + public set jobLog(value: string) { + this._jobLog = value; + } + public resetJobLog() { + this._jobLog = undefined; + } + // Temporarily expose input value. Use with caution. + public get jobLogInput() { + return this._jobLog; + } + + // job_name - computed: false, optional: false, required: true + private _jobName?: string; + public get jobName() { + return this.getStringAttribute('job_name'); + } + public set jobName(value: string) { + this._jobName = value; + } + // Temporarily expose input value. Use with caution. + public get jobNameInput() { + return this._jobName; + } + + // job_state - computed: true, optional: false, required: false + public get jobState() { + return this.getStringAttribute('job_state'); + } + + // job_type - computed: false, optional: false, required: true + private _jobType?: number; + public get jobType() { + return this.getNumberAttribute('job_type'); + } + public set jobType(value: number) { + this._jobType = value; + } + // Temporarily expose input value. Use with caution. + public get jobTypeInput() { + return this._jobType; + } + + // output - computed: true, optional: true, required: false + private _output?: string; + public get output() { + return this.getStringAttribute('output'); + } + public set output(value: string) { + this._output = value; + } + public resetOutput() { + this._output = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputInput() { + return this._output; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new MrsJobTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: MrsJobTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + arguments: cdktf.stringToTerraform(this._arguments), + cluster_id: cdktf.stringToTerraform(this._clusterId), + hive_script_path: cdktf.stringToTerraform(this._hiveScriptPath), + id: cdktf.stringToTerraform(this._id), + input: cdktf.stringToTerraform(this._input), + is_protected: cdktf.booleanToTerraform(this._isProtected), + is_public: cdktf.booleanToTerraform(this._isPublic), + jar_path: cdktf.stringToTerraform(this._jarPath), + job_log: cdktf.stringToTerraform(this._jobLog), + job_name: cdktf.stringToTerraform(this._jobName), + job_type: cdktf.numberToTerraform(this._jobType), + output: cdktf.stringToTerraform(this._output), + region: cdktf.stringToTerraform(this._region), + timeouts: mrsJobTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + arguments: { + value: cdktf.stringToHclTerraform(this._arguments), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hive_script_path: { + value: cdktf.stringToHclTerraform(this._hiveScriptPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input: { + value: cdktf.stringToHclTerraform(this._input), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_protected: { + value: cdktf.booleanToHclTerraform(this._isProtected), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_public: { + value: cdktf.booleanToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + jar_path: { + value: cdktf.stringToHclTerraform(this._jarPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_log: { + value: cdktf.stringToHclTerraform(this._jobLog), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_name: { + value: cdktf.stringToHclTerraform(this._jobName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + job_type: { + value: cdktf.numberToHclTerraform(this._jobType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + output: { + value: cdktf.stringToHclTerraform(this._output), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: mrsJobTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "MrsJobTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-dnat-rule-v2/README.md b/src/constructs/providers/huaweicloud/nat-dnat-rule-v2/README.md new file mode 100644 index 00000000..5ac1bd58 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-dnat-rule-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_dnat_rule_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_dnat_rule_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2). diff --git a/src/constructs/providers/huaweicloud/nat-dnat-rule-v2/index.ts b/src/constructs/providers/huaweicloud/nat-dnat-rule-v2/index.ts new file mode 100644 index 00000000..b0c78766 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-dnat-rule-v2/index.ts @@ -0,0 +1,680 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatDnatRuleV2Config extends cdktf.TerraformMetaArguments { + /** + * The description of the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#description NatDnatRuleV2#description} + */ + readonly description?: string; + /** + * The port range used by Floating IP provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#external_service_port NatDnatRuleV2#external_service_port} + */ + readonly externalServicePort?: number; + /** + * The port range used by ECSs or BMSs to provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#external_service_port_range NatDnatRuleV2#external_service_port_range} + */ + readonly externalServicePortRange?: string; + /** + * The ID of the floating IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#floating_ip_id NatDnatRuleV2#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * The ID of the global EIP connected by the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#global_eip_id NatDnatRuleV2#global_eip_id} + */ + readonly globalEipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#id NatDnatRuleV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The port used by Floating IP provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#internal_service_port NatDnatRuleV2#internal_service_port} + */ + readonly internalServicePort?: number; + /** + * The port used by ECSs or BMSs to provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#internal_service_port_range NatDnatRuleV2#internal_service_port_range} + */ + readonly internalServicePortRange?: string; + /** + * The ID of the NAT gateway to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#nat_gateway_id NatDnatRuleV2#nat_gateway_id} + */ + readonly natGatewayId: string; + /** + * The port ID of network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#port_id NatDnatRuleV2#port_id} + */ + readonly portId?: string; + /** + * The private IP address of a user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#private_ip NatDnatRuleV2#private_ip} + */ + readonly privateIp?: string; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#protocol NatDnatRuleV2#protocol} + */ + readonly protocol: string; + /** + * The region where the DNAT rule is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#region NatDnatRuleV2#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#timeouts NatDnatRuleV2#timeouts} + */ + readonly timeouts?: NatDnatRuleV2Timeouts; +} +export interface NatDnatRuleV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#create NatDnatRuleV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#delete NatDnatRuleV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#update NatDnatRuleV2#update} + */ + readonly update?: string; +} + +export function natDnatRuleV2TimeoutsToTerraform(struct?: NatDnatRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function natDnatRuleV2TimeoutsToHclTerraform(struct?: NatDnatRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NatDnatRuleV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NatDnatRuleV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NatDnatRuleV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2 huaweicloud_nat_dnat_rule_v2} +*/ +export class NatDnatRuleV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_dnat_rule_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatDnatRuleV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatDnatRuleV2 to import + * @param importFromId The id of the existing NatDnatRuleV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatDnatRuleV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_dnat_rule_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule_v2 huaweicloud_nat_dnat_rule_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatDnatRuleV2Config + */ + public constructor(scope: Construct, id: string, config: NatDnatRuleV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_dnat_rule_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._externalServicePort = config.externalServicePort; + this._externalServicePortRange = config.externalServicePortRange; + this._floatingIpId = config.floatingIpId; + this._globalEipId = config.globalEipId; + this._id = config.id; + this._internalServicePort = config.internalServicePort; + this._internalServicePortRange = config.internalServicePortRange; + this._natGatewayId = config.natGatewayId; + this._portId = config.portId; + this._privateIp = config.privateIp; + this._protocol = config.protocol; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // external_service_port - computed: false, optional: true, required: false + private _externalServicePort?: number; + public get externalServicePort() { + return this.getNumberAttribute('external_service_port'); + } + public set externalServicePort(value: number) { + this._externalServicePort = value; + } + public resetExternalServicePort() { + this._externalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalServicePortInput() { + return this._externalServicePort; + } + + // external_service_port_range - computed: false, optional: true, required: false + private _externalServicePortRange?: string; + public get externalServicePortRange() { + return this.getStringAttribute('external_service_port_range'); + } + public set externalServicePortRange(value: string) { + this._externalServicePortRange = value; + } + public resetExternalServicePortRange() { + this._externalServicePortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalServicePortRangeInput() { + return this._externalServicePortRange; + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // floating_ip_id - computed: false, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // global_eip_address - computed: true, optional: false, required: false + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + + // global_eip_id - computed: false, optional: true, required: false + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + public resetGlobalEipId() { + this._globalEipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_service_port - computed: false, optional: true, required: false + private _internalServicePort?: number; + public get internalServicePort() { + return this.getNumberAttribute('internal_service_port'); + } + public set internalServicePort(value: number) { + this._internalServicePort = value; + } + public resetInternalServicePort() { + this._internalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortInput() { + return this._internalServicePort; + } + + // internal_service_port_range - computed: false, optional: true, required: false + private _internalServicePortRange?: string; + public get internalServicePortRange() { + return this.getStringAttribute('internal_service_port_range'); + } + public set internalServicePortRange(value: string) { + this._internalServicePortRange = value; + } + public resetInternalServicePortRange() { + this._internalServicePortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortRangeInput() { + return this._internalServicePortRange; + } + + // nat_gateway_id - computed: false, optional: false, required: true + private _natGatewayId?: string; + public get natGatewayId() { + return this.getStringAttribute('nat_gateway_id'); + } + public set natGatewayId(value: string) { + this._natGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get natGatewayIdInput() { + return this._natGatewayId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // private_ip - computed: true, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NatDnatRuleV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NatDnatRuleV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + external_service_port: cdktf.numberToTerraform(this._externalServicePort), + external_service_port_range: cdktf.stringToTerraform(this._externalServicePortRange), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + internal_service_port: cdktf.numberToTerraform(this._internalServicePort), + internal_service_port_range: cdktf.stringToTerraform(this._internalServicePortRange), + nat_gateway_id: cdktf.stringToTerraform(this._natGatewayId), + port_id: cdktf.stringToTerraform(this._portId), + private_ip: cdktf.stringToTerraform(this._privateIp), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + timeouts: natDnatRuleV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + external_service_port: { + value: cdktf.numberToHclTerraform(this._externalServicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + external_service_port_range: { + value: cdktf.stringToHclTerraform(this._externalServicePortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal_service_port: { + value: cdktf.numberToHclTerraform(this._internalServicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + internal_service_port_range: { + value: cdktf.stringToHclTerraform(this._internalServicePortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nat_gateway_id: { + value: cdktf.stringToHclTerraform(this._natGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: natDnatRuleV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NatDnatRuleV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-dnat-rule/README.md b/src/constructs/providers/huaweicloud/nat-dnat-rule/README.md new file mode 100644 index 00000000..8fe97b29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-dnat-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_dnat_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_dnat_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule). diff --git a/src/constructs/providers/huaweicloud/nat-dnat-rule/index.ts b/src/constructs/providers/huaweicloud/nat-dnat-rule/index.ts new file mode 100644 index 00000000..306c408d --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-dnat-rule/index.ts @@ -0,0 +1,680 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatDnatRuleConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#description NatDnatRule#description} + */ + readonly description?: string; + /** + * The port range used by Floating IP provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#external_service_port NatDnatRule#external_service_port} + */ + readonly externalServicePort?: number; + /** + * The port range used by ECSs or BMSs to provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#external_service_port_range NatDnatRule#external_service_port_range} + */ + readonly externalServicePortRange?: string; + /** + * The ID of the floating IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#floating_ip_id NatDnatRule#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * The ID of the global EIP connected by the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#global_eip_id NatDnatRule#global_eip_id} + */ + readonly globalEipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#id NatDnatRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The port used by Floating IP provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#internal_service_port NatDnatRule#internal_service_port} + */ + readonly internalServicePort?: number; + /** + * The port used by ECSs or BMSs to provide services for external systems. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#internal_service_port_range NatDnatRule#internal_service_port_range} + */ + readonly internalServicePortRange?: string; + /** + * The ID of the NAT gateway to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#nat_gateway_id NatDnatRule#nat_gateway_id} + */ + readonly natGatewayId: string; + /** + * The port ID of network. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#port_id NatDnatRule#port_id} + */ + readonly portId?: string; + /** + * The private IP address of a user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#private_ip NatDnatRule#private_ip} + */ + readonly privateIp?: string; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#protocol NatDnatRule#protocol} + */ + readonly protocol: string; + /** + * The region where the DNAT rule is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#region NatDnatRule#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#timeouts NatDnatRule#timeouts} + */ + readonly timeouts?: NatDnatRuleTimeouts; +} +export interface NatDnatRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#create NatDnatRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#delete NatDnatRule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#update NatDnatRule#update} + */ + readonly update?: string; +} + +export function natDnatRuleTimeoutsToTerraform(struct?: NatDnatRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function natDnatRuleTimeoutsToHclTerraform(struct?: NatDnatRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NatDnatRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NatDnatRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NatDnatRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule huaweicloud_nat_dnat_rule} +*/ +export class NatDnatRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_dnat_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatDnatRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatDnatRule to import + * @param importFromId The id of the existing NatDnatRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatDnatRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_dnat_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_dnat_rule huaweicloud_nat_dnat_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatDnatRuleConfig + */ + public constructor(scope: Construct, id: string, config: NatDnatRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_dnat_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._externalServicePort = config.externalServicePort; + this._externalServicePortRange = config.externalServicePortRange; + this._floatingIpId = config.floatingIpId; + this._globalEipId = config.globalEipId; + this._id = config.id; + this._internalServicePort = config.internalServicePort; + this._internalServicePortRange = config.internalServicePortRange; + this._natGatewayId = config.natGatewayId; + this._portId = config.portId; + this._privateIp = config.privateIp; + this._protocol = config.protocol; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // external_service_port - computed: false, optional: true, required: false + private _externalServicePort?: number; + public get externalServicePort() { + return this.getNumberAttribute('external_service_port'); + } + public set externalServicePort(value: number) { + this._externalServicePort = value; + } + public resetExternalServicePort() { + this._externalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalServicePortInput() { + return this._externalServicePort; + } + + // external_service_port_range - computed: false, optional: true, required: false + private _externalServicePortRange?: string; + public get externalServicePortRange() { + return this.getStringAttribute('external_service_port_range'); + } + public set externalServicePortRange(value: string) { + this._externalServicePortRange = value; + } + public resetExternalServicePortRange() { + this._externalServicePortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalServicePortRangeInput() { + return this._externalServicePortRange; + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // floating_ip_id - computed: false, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // global_eip_address - computed: true, optional: false, required: false + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + + // global_eip_id - computed: false, optional: true, required: false + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + public resetGlobalEipId() { + this._globalEipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_service_port - computed: false, optional: true, required: false + private _internalServicePort?: number; + public get internalServicePort() { + return this.getNumberAttribute('internal_service_port'); + } + public set internalServicePort(value: number) { + this._internalServicePort = value; + } + public resetInternalServicePort() { + this._internalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortInput() { + return this._internalServicePort; + } + + // internal_service_port_range - computed: false, optional: true, required: false + private _internalServicePortRange?: string; + public get internalServicePortRange() { + return this.getStringAttribute('internal_service_port_range'); + } + public set internalServicePortRange(value: string) { + this._internalServicePortRange = value; + } + public resetInternalServicePortRange() { + this._internalServicePortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortRangeInput() { + return this._internalServicePortRange; + } + + // nat_gateway_id - computed: false, optional: false, required: true + private _natGatewayId?: string; + public get natGatewayId() { + return this.getStringAttribute('nat_gateway_id'); + } + public set natGatewayId(value: string) { + this._natGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get natGatewayIdInput() { + return this._natGatewayId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // private_ip - computed: true, optional: true, required: false + private _privateIp?: string; + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + public set privateIp(value: string) { + this._privateIp = value; + } + public resetPrivateIp() { + this._privateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpInput() { + return this._privateIp; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NatDnatRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NatDnatRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + external_service_port: cdktf.numberToTerraform(this._externalServicePort), + external_service_port_range: cdktf.stringToTerraform(this._externalServicePortRange), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + internal_service_port: cdktf.numberToTerraform(this._internalServicePort), + internal_service_port_range: cdktf.stringToTerraform(this._internalServicePortRange), + nat_gateway_id: cdktf.stringToTerraform(this._natGatewayId), + port_id: cdktf.stringToTerraform(this._portId), + private_ip: cdktf.stringToTerraform(this._privateIp), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + timeouts: natDnatRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + external_service_port: { + value: cdktf.numberToHclTerraform(this._externalServicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + external_service_port_range: { + value: cdktf.stringToHclTerraform(this._externalServicePortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal_service_port: { + value: cdktf.numberToHclTerraform(this._internalServicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + internal_service_port_range: { + value: cdktf.stringToHclTerraform(this._internalServicePortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nat_gateway_id: { + value: cdktf.stringToHclTerraform(this._natGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_ip: { + value: cdktf.stringToHclTerraform(this._privateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: natDnatRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NatDnatRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-gateway-v2/README.md b/src/constructs/providers/huaweicloud/nat-gateway-v2/README.md new file mode 100644 index 00000000..be22287b --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-gateway-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_gateway_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_gateway_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2). diff --git a/src/constructs/providers/huaweicloud/nat-gateway-v2/index.ts b/src/constructs/providers/huaweicloud/nat-gateway-v2/index.ts new file mode 100644 index 00000000..1e15c50b --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-gateway-v2/index.ts @@ -0,0 +1,679 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatGatewayV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#auto_renew NatGatewayV2#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#charging_mode NatGatewayV2#charging_mode} + */ + readonly chargingMode?: string; + /** + * The description of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#description NatGatewayV2#description} + */ + readonly description?: string; + /** + * The enterprise project ID of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#enterprise_project_id NatGatewayV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#id NatGatewayV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The NAT gateway name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#name NatGatewayV2#name} + */ + readonly name: string; + /** + * The private IP address of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#ngport_ip_address NatGatewayV2#ngport_ip_address} + */ + readonly ngportIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#period NatGatewayV2#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#period_unit NatGatewayV2#period_unit} + */ + readonly periodUnit?: string; + /** + * The region where the NAT gateway is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#region NatGatewayV2#region} + */ + readonly region?: string; + /** + * The specification of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#spec NatGatewayV2#spec} + */ + readonly spec: string; + /** + * The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#subnet_id NatGatewayV2#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#tags NatGatewayV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC to which the NAT gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#vpc_id NatGatewayV2#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#timeouts NatGatewayV2#timeouts} + */ + readonly timeouts?: NatGatewayV2Timeouts; +} +export interface NatGatewayV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#create NatGatewayV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#delete NatGatewayV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#update NatGatewayV2#update} + */ + readonly update?: string; +} + +export function natGatewayV2TimeoutsToTerraform(struct?: NatGatewayV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function natGatewayV2TimeoutsToHclTerraform(struct?: NatGatewayV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NatGatewayV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NatGatewayV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NatGatewayV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2 huaweicloud_nat_gateway_v2} +*/ +export class NatGatewayV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_gateway_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatGatewayV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatGatewayV2 to import + * @param importFromId The id of the existing NatGatewayV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatGatewayV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_gateway_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway_v2 huaweicloud_nat_gateway_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatGatewayV2Config + */ + public constructor(scope: Construct, id: string, config: NatGatewayV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_gateway_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._ngportIpAddress = config.ngportIpAddress; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._spec = config.spec; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ngport_ip_address - computed: true, optional: true, required: false + private _ngportIpAddress?: string; + public get ngportIpAddress() { + return this.getStringAttribute('ngport_ip_address'); + } + public set ngportIpAddress(value: string) { + this._ngportIpAddress = value; + } + public resetNgportIpAddress() { + this._ngportIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ngportIpAddressInput() { + return this._ngportIpAddress; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: false, optional: false, required: true + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NatGatewayV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NatGatewayV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + ngport_ip_address: cdktf.stringToTerraform(this._ngportIpAddress), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + spec: cdktf.stringToTerraform(this._spec), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: natGatewayV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ngport_ip_address: { + value: cdktf.stringToHclTerraform(this._ngportIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: natGatewayV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NatGatewayV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-gateway/README.md b/src/constructs/providers/huaweicloud/nat-gateway/README.md new file mode 100644 index 00000000..92d8fd3a --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-gateway/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_gateway` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway). diff --git a/src/constructs/providers/huaweicloud/nat-gateway/index.ts b/src/constructs/providers/huaweicloud/nat-gateway/index.ts new file mode 100644 index 00000000..95cef66e --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-gateway/index.ts @@ -0,0 +1,679 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#auto_renew NatGateway#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#charging_mode NatGateway#charging_mode} + */ + readonly chargingMode?: string; + /** + * The description of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#description NatGateway#description} + */ + readonly description?: string; + /** + * The enterprise project ID of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#enterprise_project_id NatGateway#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#id NatGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The NAT gateway name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#name NatGateway#name} + */ + readonly name: string; + /** + * The private IP address of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#ngport_ip_address NatGateway#ngport_ip_address} + */ + readonly ngportIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#period NatGateway#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#period_unit NatGateway#period_unit} + */ + readonly periodUnit?: string; + /** + * The region where the NAT gateway is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#region NatGateway#region} + */ + readonly region?: string; + /** + * The specification of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#spec NatGateway#spec} + */ + readonly spec: string; + /** + * The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#subnet_id NatGateway#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#tags NatGateway#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC to which the NAT gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#vpc_id NatGateway#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#timeouts NatGateway#timeouts} + */ + readonly timeouts?: NatGatewayTimeouts; +} +export interface NatGatewayTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#create NatGateway#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#delete NatGateway#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#update NatGateway#update} + */ + readonly update?: string; +} + +export function natGatewayTimeoutsToTerraform(struct?: NatGatewayTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function natGatewayTimeoutsToHclTerraform(struct?: NatGatewayTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NatGatewayTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NatGatewayTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NatGatewayTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway huaweicloud_nat_gateway} +*/ +export class NatGateway extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatGateway to import + * @param importFromId The id of the existing NatGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_gateway huaweicloud_nat_gateway} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatGatewayConfig + */ + public constructor(scope: Construct, id: string, config: NatGatewayConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._ngportIpAddress = config.ngportIpAddress; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._spec = config.spec; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ngport_ip_address - computed: true, optional: true, required: false + private _ngportIpAddress?: string; + public get ngportIpAddress() { + return this.getStringAttribute('ngport_ip_address'); + } + public set ngportIpAddress(value: string) { + this._ngportIpAddress = value; + } + public resetNgportIpAddress() { + this._ngportIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ngportIpAddressInput() { + return this._ngportIpAddress; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: false, optional: false, required: true + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NatGatewayTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NatGatewayTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + ngport_ip_address: cdktf.stringToTerraform(this._ngportIpAddress), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + spec: cdktf.stringToTerraform(this._spec), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: natGatewayTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ngport_ip_address: { + value: cdktf.stringToHclTerraform(this._ngportIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: natGatewayTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NatGatewayTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-private-dnat-rule/README.md b/src/constructs/providers/huaweicloud/nat-private-dnat-rule/README.md new file mode 100644 index 00000000..c15d19b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-dnat-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_private_dnat_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_private_dnat_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule). diff --git a/src/constructs/providers/huaweicloud/nat-private-dnat-rule/index.ts b/src/constructs/providers/huaweicloud/nat-private-dnat-rule/index.ts new file mode 100644 index 00000000..b812c1dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-dnat-rule/index.ts @@ -0,0 +1,400 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatPrivateDnatRuleConfig extends cdktf.TerraformMetaArguments { + /** + * The network interface ID of the transit IP for private NAT. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#backend_interface_id NatPrivateDnatRule#backend_interface_id} + */ + readonly backendInterfaceId?: string; + /** + * The private IP address of the backend instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#backend_private_ip NatPrivateDnatRule#backend_private_ip} + */ + readonly backendPrivateIp?: string; + /** + * The description of the DNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#description NatPrivateDnatRule#description} + */ + readonly description?: string; + /** + * The private NAT gateway ID to which the DNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#gateway_id NatPrivateDnatRule#gateway_id} + */ + readonly gatewayId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#id NatPrivateDnatRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The port of the backend instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#internal_service_port NatPrivateDnatRule#internal_service_port} + */ + readonly internalServicePort?: number; + /** + * The protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#protocol NatPrivateDnatRule#protocol} + */ + readonly protocol?: string; + /** + * The region where the DNAT rule is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#region NatPrivateDnatRule#region} + */ + readonly region?: string; + /** + * The ID of the transit IP for private NAT. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#transit_ip_id NatPrivateDnatRule#transit_ip_id} + */ + readonly transitIpId: string; + /** + * The port of the transit IP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#transit_service_port NatPrivateDnatRule#transit_service_port} + */ + readonly transitServicePort?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule huaweicloud_nat_private_dnat_rule} +*/ +export class NatPrivateDnatRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_dnat_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatPrivateDnatRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatPrivateDnatRule to import + * @param importFromId The id of the existing NatPrivateDnatRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatPrivateDnatRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_dnat_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_dnat_rule huaweicloud_nat_private_dnat_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatPrivateDnatRuleConfig + */ + public constructor(scope: Construct, id: string, config: NatPrivateDnatRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_dnat_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backendInterfaceId = config.backendInterfaceId; + this._backendPrivateIp = config.backendPrivateIp; + this._description = config.description; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._internalServicePort = config.internalServicePort; + this._protocol = config.protocol; + this._region = config.region; + this._transitIpId = config.transitIpId; + this._transitServicePort = config.transitServicePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // backend_interface_id - computed: true, optional: true, required: false + private _backendInterfaceId?: string; + public get backendInterfaceId() { + return this.getStringAttribute('backend_interface_id'); + } + public set backendInterfaceId(value: string) { + this._backendInterfaceId = value; + } + public resetBackendInterfaceId() { + this._backendInterfaceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendInterfaceIdInput() { + return this._backendInterfaceId; + } + + // backend_private_ip - computed: true, optional: true, required: false + private _backendPrivateIp?: string; + public get backendPrivateIp() { + return this.getStringAttribute('backend_private_ip'); + } + public set backendPrivateIp(value: string) { + this._backendPrivateIp = value; + } + public resetBackendPrivateIp() { + this._backendPrivateIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get backendPrivateIpInput() { + return this._backendPrivateIp; + } + + // backend_type - computed: true, optional: false, required: false + public get backendType() { + return this.getStringAttribute('backend_type'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gateway_id - computed: false, optional: false, required: true + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_service_port - computed: false, optional: true, required: false + private _internalServicePort?: number; + public get internalServicePort() { + return this.getNumberAttribute('internal_service_port'); + } + public set internalServicePort(value: number) { + this._internalServicePort = value; + } + public resetInternalServicePort() { + this._internalServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get internalServicePortInput() { + return this._internalServicePort; + } + + // protocol - computed: true, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // transit_ip_id - computed: false, optional: false, required: true + private _transitIpId?: string; + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + public set transitIpId(value: string) { + this._transitIpId = value; + } + // Temporarily expose input value. Use with caution. + public get transitIpIdInput() { + return this._transitIpId; + } + + // transit_service_port - computed: false, optional: true, required: false + private _transitServicePort?: number; + public get transitServicePort() { + return this.getNumberAttribute('transit_service_port'); + } + public set transitServicePort(value: number) { + this._transitServicePort = value; + } + public resetTransitServicePort() { + this._transitServicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitServicePortInput() { + return this._transitServicePort; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backend_interface_id: cdktf.stringToTerraform(this._backendInterfaceId), + backend_private_ip: cdktf.stringToTerraform(this._backendPrivateIp), + description: cdktf.stringToTerraform(this._description), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + internal_service_port: cdktf.numberToTerraform(this._internalServicePort), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + transit_ip_id: cdktf.stringToTerraform(this._transitIpId), + transit_service_port: cdktf.numberToTerraform(this._transitServicePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backend_interface_id: { + value: cdktf.stringToHclTerraform(this._backendInterfaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backend_private_ip: { + value: cdktf.stringToHclTerraform(this._backendPrivateIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internal_service_port: { + value: cdktf.numberToHclTerraform(this._internalServicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_ip_id: { + value: cdktf.stringToHclTerraform(this._transitIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_service_port: { + value: cdktf.numberToHclTerraform(this._transitServicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-private-gateway/README.md b/src/constructs/providers/huaweicloud/nat-private-gateway/README.md new file mode 100644 index 00000000..dd6c073d --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-gateway/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_private_gateway` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_private_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway). diff --git a/src/constructs/providers/huaweicloud/nat-private-gateway/index.ts b/src/constructs/providers/huaweicloud/nat-private-gateway/index.ts new file mode 100644 index 00000000..800f7c5b --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-gateway/index.ts @@ -0,0 +1,338 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatPrivateGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the private NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#description NatPrivateGateway#description} + */ + readonly description?: string; + /** + * The ID of the enterprise project to which the private NAT gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#enterprise_project_id NatPrivateGateway#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#id NatPrivateGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the private NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#name NatPrivateGateway#name} + */ + readonly name: string; + /** + * The region where the private NAT gateway is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#region NatPrivateGateway#region} + */ + readonly region?: string; + /** + * The specification of the private NAT gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#spec NatPrivateGateway#spec} + */ + readonly spec?: string; + /** + * The network ID of the subnet to which the private NAT gateway belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#subnet_id NatPrivateGateway#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#tags NatPrivateGateway#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway huaweicloud_nat_private_gateway} +*/ +export class NatPrivateGateway extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatPrivateGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatPrivateGateway to import + * @param importFromId The id of the existing NatPrivateGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatPrivateGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_gateway huaweicloud_nat_private_gateway} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatPrivateGatewayConfig + */ + public constructor(scope: Construct, id: string, config: NatPrivateGatewayConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._spec = config.spec; + this._subnetId = config.subnetId; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec - computed: true, optional: true, required: false + private _spec?: string; + public get spec() { + return this.getStringAttribute('spec'); + } + public set spec(value: string) { + this._spec = value; + } + public resetSpec() { + this._spec = undefined; + } + // Temporarily expose input value. Use with caution. + public get specInput() { + return this._spec; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + spec: cdktf.stringToTerraform(this._spec), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec: { + value: cdktf.stringToHclTerraform(this._spec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-private-snat-rule/README.md b/src/constructs/providers/huaweicloud/nat-private-snat-rule/README.md new file mode 100644 index 00000000..291b472f --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-snat-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_private_snat_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_private_snat_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule). diff --git a/src/constructs/providers/huaweicloud/nat-private-snat-rule/index.ts b/src/constructs/providers/huaweicloud/nat-private-snat-rule/index.ts new file mode 100644 index 00000000..967cdced --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-snat-rule/index.ts @@ -0,0 +1,310 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatPrivateSnatRuleConfig extends cdktf.TerraformMetaArguments { + /** + * The CIDR block of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#cidr NatPrivateSnatRule#cidr} + */ + readonly cidr?: string; + /** + * The description of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#description NatPrivateSnatRule#description} + */ + readonly description?: string; + /** + * The private NAT gateway ID to which the SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#gateway_id NatPrivateSnatRule#gateway_id} + */ + readonly gatewayId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#id NatPrivateSnatRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the SNAT rule is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#region NatPrivateSnatRule#region} + */ + readonly region?: string; + /** + * The subnet ID of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#subnet_id NatPrivateSnatRule#subnet_id} + */ + readonly subnetId?: string; + /** + * The ID of the transit IP associated with SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#transit_ip_id NatPrivateSnatRule#transit_ip_id} + */ + readonly transitIpId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule huaweicloud_nat_private_snat_rule} +*/ +export class NatPrivateSnatRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_snat_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatPrivateSnatRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatPrivateSnatRule to import + * @param importFromId The id of the existing NatPrivateSnatRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatPrivateSnatRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_snat_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_snat_rule huaweicloud_nat_private_snat_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatPrivateSnatRuleConfig + */ + public constructor(scope: Construct, id: string, config: NatPrivateSnatRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_snat_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._description = config.description; + this._gatewayId = config.gatewayId; + this._id = config.id; + this._region = config.region; + this._subnetId = config.subnetId; + this._transitIpId = config.transitIpId; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: true, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // gateway_id - computed: false, optional: false, required: true + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // transit_ip_address - computed: true, optional: false, required: false + public get transitIpAddress() { + return this.getStringAttribute('transit_ip_address'); + } + + // transit_ip_id - computed: false, optional: false, required: true + private _transitIpId?: string; + public get transitIpId() { + return this.getStringAttribute('transit_ip_id'); + } + public set transitIpId(value: string) { + this._transitIpId = value; + } + // Temporarily expose input value. Use with caution. + public get transitIpIdInput() { + return this._transitIpId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + transit_ip_id: cdktf.stringToTerraform(this._transitIpId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transit_ip_id: { + value: cdktf.stringToHclTerraform(this._transitIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-private-transit-ip/README.md b/src/constructs/providers/huaweicloud/nat-private-transit-ip/README.md new file mode 100644 index 00000000..88c6e1f3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-transit-ip/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_private_transit_ip` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_private_transit_ip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip). diff --git a/src/constructs/providers/huaweicloud/nat-private-transit-ip/index.ts b/src/constructs/providers/huaweicloud/nat-private-transit-ip/index.ts new file mode 100644 index 00000000..c00bb0d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-private-transit-ip/index.ts @@ -0,0 +1,281 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatPrivateTransitIpConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the enterprise project to which the transit IP belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#enterprise_project_id NatPrivateTransitIp#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#id NatPrivateTransitIp#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The IP address of the transit subnet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#ip_address NatPrivateTransitIp#ip_address} + */ + readonly ipAddress?: string; + /** + * The region where the transit IP is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#region NatPrivateTransitIp#region} + */ + readonly region?: string; + /** + * The ID of the transit subnet to which the transit IP belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#subnet_id NatPrivateTransitIp#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#tags NatPrivateTransitIp#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip huaweicloud_nat_private_transit_ip} +*/ +export class NatPrivateTransitIp extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_private_transit_ip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatPrivateTransitIp resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatPrivateTransitIp to import + * @param importFromId The id of the existing NatPrivateTransitIp that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatPrivateTransitIp to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_private_transit_ip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_private_transit_ip huaweicloud_nat_private_transit_ip} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatPrivateTransitIpConfig + */ + public constructor(scope: Construct, id: string, config: NatPrivateTransitIpConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_private_transit_ip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._region = config.region; + this._subnetId = config.subnetId; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: true, optional: false, required: false + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // network_interface_id - computed: true, optional: false, required: false + public get networkInterfaceId() { + return this.getStringAttribute('network_interface_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-snat-rule-v2/README.md b/src/constructs/providers/huaweicloud/nat-snat-rule-v2/README.md new file mode 100644 index 00000000..7c201021 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-snat-rule-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_snat_rule_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_snat_rule_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2). diff --git a/src/constructs/providers/huaweicloud/nat-snat-rule-v2/index.ts b/src/constructs/providers/huaweicloud/nat-snat-rule-v2/index.ts new file mode 100644 index 00000000..aa7e51fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-snat-rule-v2/index.ts @@ -0,0 +1,586 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatSnatRuleV2Config extends cdktf.TerraformMetaArguments { + /** + * The CIDR block connected by SNAT rule (DC side). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#cidr NatSnatRuleV2#cidr} + */ + readonly cidr?: string; + /** + * The description of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#description NatSnatRuleV2#description} + */ + readonly description?: string; + /** + * The IDs of floating IPs connected by SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#floating_ip_id NatSnatRuleV2#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * The IDs (separated by commas) of global EIPs connected by SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#global_eip_id NatSnatRuleV2#global_eip_id} + */ + readonly globalEipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#id NatSnatRuleV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Required; The ID of the gateway to which the SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#nat_gateway_id NatSnatRuleV2#nat_gateway_id} + */ + readonly natGatewayId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#network_id NatSnatRuleV2#network_id} + */ + readonly networkId?: string; + /** + * The region where the SNAT rule is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#region NatSnatRuleV2#region} + */ + readonly region?: string; + /** + * The resource type of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#source_type NatSnatRuleV2#source_type} + */ + readonly sourceType?: number; + /** + * The network IDs of subnet connected by SNAT rule (VPC side). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#subnet_id NatSnatRuleV2#subnet_id} + */ + readonly subnetId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#timeouts NatSnatRuleV2#timeouts} + */ + readonly timeouts?: NatSnatRuleV2Timeouts; +} +export interface NatSnatRuleV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#create NatSnatRuleV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#delete NatSnatRuleV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#update NatSnatRuleV2#update} + */ + readonly update?: string; +} + +export function natSnatRuleV2TimeoutsToTerraform(struct?: NatSnatRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function natSnatRuleV2TimeoutsToHclTerraform(struct?: NatSnatRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NatSnatRuleV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NatSnatRuleV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NatSnatRuleV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2 huaweicloud_nat_snat_rule_v2} +*/ +export class NatSnatRuleV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_snat_rule_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatSnatRuleV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatSnatRuleV2 to import + * @param importFromId The id of the existing NatSnatRuleV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatSnatRuleV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_snat_rule_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule_v2 huaweicloud_nat_snat_rule_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatSnatRuleV2Config + */ + public constructor(scope: Construct, id: string, config: NatSnatRuleV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_snat_rule_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._description = config.description; + this._floatingIpId = config.floatingIpId; + this._globalEipId = config.globalEipId; + this._id = config.id; + this._natGatewayId = config.natGatewayId; + this._networkId = config.networkId; + this._region = config.region; + this._sourceType = config.sourceType; + this._subnetId = config.subnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // floating_ip_id - computed: true, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // global_eip_address - computed: true, optional: false, required: false + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + + // global_eip_id - computed: true, optional: true, required: false + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + public resetGlobalEipId() { + this._globalEipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nat_gateway_id - computed: false, optional: false, required: true + private _natGatewayId?: string; + public get natGatewayId() { + return this.getStringAttribute('nat_gateway_id'); + } + public set natGatewayId(value: string) { + this._natGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get natGatewayIdInput() { + return this._natGatewayId; + } + + // network_id - computed: false, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_type - computed: false, optional: true, required: false + private _sourceType?: number; + public get sourceType() { + return this.getNumberAttribute('source_type'); + } + public set sourceType(value: number) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NatSnatRuleV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NatSnatRuleV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + nat_gateway_id: cdktf.stringToTerraform(this._natGatewayId), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + source_type: cdktf.numberToTerraform(this._sourceType), + subnet_id: cdktf.stringToTerraform(this._subnetId), + timeouts: natSnatRuleV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nat_gateway_id: { + value: cdktf.stringToHclTerraform(this._natGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.numberToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: natSnatRuleV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NatSnatRuleV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/nat-snat-rule/README.md b/src/constructs/providers/huaweicloud/nat-snat-rule/README.md new file mode 100644 index 00000000..79945a67 --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-snat-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_nat_snat_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_nat_snat_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule). diff --git a/src/constructs/providers/huaweicloud/nat-snat-rule/index.ts b/src/constructs/providers/huaweicloud/nat-snat-rule/index.ts new file mode 100644 index 00000000..53038bbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/nat-snat-rule/index.ts @@ -0,0 +1,586 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NatSnatRuleConfig extends cdktf.TerraformMetaArguments { + /** + * The CIDR block connected by SNAT rule (DC side). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#cidr NatSnatRule#cidr} + */ + readonly cidr?: string; + /** + * The description of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#description NatSnatRule#description} + */ + readonly description?: string; + /** + * The IDs of floating IPs connected by SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#floating_ip_id NatSnatRule#floating_ip_id} + */ + readonly floatingIpId?: string; + /** + * The IDs (separated by commas) of global EIPs connected by SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#global_eip_id NatSnatRule#global_eip_id} + */ + readonly globalEipId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#id NatSnatRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * schema: Required; The ID of the gateway to which the SNAT rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#nat_gateway_id NatSnatRule#nat_gateway_id} + */ + readonly natGatewayId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#network_id NatSnatRule#network_id} + */ + readonly networkId?: string; + /** + * The region where the SNAT rule is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#region NatSnatRule#region} + */ + readonly region?: string; + /** + * The resource type of the SNAT rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#source_type NatSnatRule#source_type} + */ + readonly sourceType?: number; + /** + * The network IDs of subnet connected by SNAT rule (VPC side). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#subnet_id NatSnatRule#subnet_id} + */ + readonly subnetId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#timeouts NatSnatRule#timeouts} + */ + readonly timeouts?: NatSnatRuleTimeouts; +} +export interface NatSnatRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#create NatSnatRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#delete NatSnatRule#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#update NatSnatRule#update} + */ + readonly update?: string; +} + +export function natSnatRuleTimeoutsToTerraform(struct?: NatSnatRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function natSnatRuleTimeoutsToHclTerraform(struct?: NatSnatRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NatSnatRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NatSnatRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NatSnatRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule huaweicloud_nat_snat_rule} +*/ +export class NatSnatRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_nat_snat_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NatSnatRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NatSnatRule to import + * @param importFromId The id of the existing NatSnatRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NatSnatRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_nat_snat_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/nat_snat_rule huaweicloud_nat_snat_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NatSnatRuleConfig + */ + public constructor(scope: Construct, id: string, config: NatSnatRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_nat_snat_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._description = config.description; + this._floatingIpId = config.floatingIpId; + this._globalEipId = config.globalEipId; + this._id = config.id; + this._natGatewayId = config.natGatewayId; + this._networkId = config.networkId; + this._region = config.region; + this._sourceType = config.sourceType; + this._subnetId = config.subnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: true, required: false + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + public resetCidr() { + this._cidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // floating_ip_address - computed: true, optional: false, required: false + public get floatingIpAddress() { + return this.getStringAttribute('floating_ip_address'); + } + + // floating_ip_id - computed: true, optional: true, required: false + private _floatingIpId?: string; + public get floatingIpId() { + return this.getStringAttribute('floating_ip_id'); + } + public set floatingIpId(value: string) { + this._floatingIpId = value; + } + public resetFloatingIpId() { + this._floatingIpId = undefined; + } + // Temporarily expose input value. Use with caution. + public get floatingIpIdInput() { + return this._floatingIpId; + } + + // global_eip_address - computed: true, optional: false, required: false + public get globalEipAddress() { + return this.getStringAttribute('global_eip_address'); + } + + // global_eip_id - computed: true, optional: true, required: false + private _globalEipId?: string; + public get globalEipId() { + return this.getStringAttribute('global_eip_id'); + } + public set globalEipId(value: string) { + this._globalEipId = value; + } + public resetGlobalEipId() { + this._globalEipId = undefined; + } + // Temporarily expose input value. Use with caution. + public get globalEipIdInput() { + return this._globalEipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nat_gateway_id - computed: false, optional: false, required: true + private _natGatewayId?: string; + public get natGatewayId() { + return this.getStringAttribute('nat_gateway_id'); + } + public set natGatewayId(value: string) { + this._natGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get natGatewayIdInput() { + return this._natGatewayId; + } + + // network_id - computed: false, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_type - computed: false, optional: true, required: false + private _sourceType?: number; + public get sourceType() { + return this.getNumberAttribute('source_type'); + } + public set sourceType(value: number) { + this._sourceType = value; + } + public resetSourceType() { + this._sourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NatSnatRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NatSnatRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + floating_ip_id: cdktf.stringToTerraform(this._floatingIpId), + global_eip_id: cdktf.stringToTerraform(this._globalEipId), + id: cdktf.stringToTerraform(this._id), + nat_gateway_id: cdktf.stringToTerraform(this._natGatewayId), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + source_type: cdktf.numberToTerraform(this._sourceType), + subnet_id: cdktf.stringToTerraform(this._subnetId), + timeouts: natSnatRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + floating_ip_id: { + value: cdktf.stringToHclTerraform(this._floatingIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + global_eip_id: { + value: cdktf.stringToHclTerraform(this._globalEipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nat_gateway_id: { + value: cdktf.stringToHclTerraform(this._natGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.numberToHclTerraform(this._sourceType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: natSnatRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NatSnatRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/network-acl-rule/README.md b/src/constructs/providers/huaweicloud/network-acl-rule/README.md new file mode 100644 index 00000000..2d8c3be6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/network-acl-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_network_acl_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_network_acl_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule). diff --git a/src/constructs/providers/huaweicloud/network-acl-rule/index.ts b/src/constructs/providers/huaweicloud/network-acl-rule/index.ts new file mode 100644 index 00000000..0dbd662d --- /dev/null +++ b/src/constructs/providers/huaweicloud/network-acl-rule/index.ts @@ -0,0 +1,418 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkAclRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#action NetworkAclRule#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#description NetworkAclRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#destination_ip_address NetworkAclRule#destination_ip_address} + */ + readonly destinationIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#destination_port NetworkAclRule#destination_port} + */ + readonly destinationPort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#enabled NetworkAclRule#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#id NetworkAclRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#ip_version NetworkAclRule#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#name NetworkAclRule#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#protocol NetworkAclRule#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#region NetworkAclRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#source_ip_address NetworkAclRule#source_ip_address} + */ + readonly sourceIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#source_port NetworkAclRule#source_port} + */ + readonly sourcePort?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule huaweicloud_network_acl_rule} +*/ +export class NetworkAclRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_network_acl_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkAclRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkAclRule to import + * @param importFromId The id of the existing NetworkAclRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkAclRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_network_acl_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl_rule huaweicloud_network_acl_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkAclRuleConfig + */ + public constructor(scope: Construct, id: string, config: NetworkAclRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_network_acl_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._destinationIpAddress = config.destinationIpAddress; + this._destinationPort = config.destinationPort; + this._enabled = config.enabled; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + this._sourceIpAddress = config.sourceIpAddress; + this._sourcePort = config.sourcePort; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_ip_address - computed: false, optional: true, required: false + private _destinationIpAddress?: string; + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + public set destinationIpAddress(value: string) { + this._destinationIpAddress = value; + } + public resetDestinationIpAddress() { + this._destinationIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressInput() { + return this._destinationIpAddress; + } + + // destination_port - computed: false, optional: true, required: false + private _destinationPort?: string; + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + public set destinationPort(value: string) { + this._destinationPort = value; + } + public resetDestinationPort() { + this._destinationPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortInput() { + return this._destinationPort; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_ip_address - computed: false, optional: true, required: false + private _sourceIpAddress?: string; + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + public set sourceIpAddress(value: string) { + this._sourceIpAddress = value; + } + public resetSourceIpAddress() { + this._sourceIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressInput() { + return this._sourceIpAddress; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + destination_ip_address: cdktf.stringToTerraform(this._destinationIpAddress), + destination_port: cdktf.stringToTerraform(this._destinationPort), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + source_ip_address: cdktf.stringToTerraform(this._sourceIpAddress), + source_port: cdktf.stringToTerraform(this._sourcePort), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address: { + value: cdktf.stringToHclTerraform(this._destinationIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port: { + value: cdktf.stringToHclTerraform(this._destinationPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address: { + value: cdktf.stringToHclTerraform(this._sourceIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(this._sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/network-acl/README.md b/src/constructs/providers/huaweicloud/network-acl/README.md new file mode 100644 index 00000000..809ddacf --- /dev/null +++ b/src/constructs/providers/huaweicloud/network-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_network_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_network_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl). diff --git a/src/constructs/providers/huaweicloud/network-acl/index.ts b/src/constructs/providers/huaweicloud/network-acl/index.ts new file mode 100644 index 00000000..cb4db617 --- /dev/null +++ b/src/constructs/providers/huaweicloud/network-acl/index.ts @@ -0,0 +1,491 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkAclConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#description NetworkAcl#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#id NetworkAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#inbound_rules NetworkAcl#inbound_rules} + */ + readonly inboundRules?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#name NetworkAcl#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#outbound_rules NetworkAcl#outbound_rules} + */ + readonly outboundRules?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#region NetworkAcl#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#subnets NetworkAcl#subnets} + */ + readonly subnets?: string[]; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#timeouts NetworkAcl#timeouts} + */ + readonly timeouts?: NetworkAclTimeouts; +} +export interface NetworkAclTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#create NetworkAcl#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#delete NetworkAcl#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#update NetworkAcl#update} + */ + readonly update?: string; +} + +export function networkAclTimeoutsToTerraform(struct?: NetworkAclTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function networkAclTimeoutsToHclTerraform(struct?: NetworkAclTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkAclTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkAclTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkAclTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl huaweicloud_network_acl} +*/ +export class NetworkAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_network_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkAcl to import + * @param importFromId The id of the existing NetworkAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_network_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/network_acl huaweicloud_network_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkAclConfig + */ + public constructor(scope: Construct, id: string, config: NetworkAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_network_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._inboundRules = config.inboundRules; + this._name = config.name; + this._outboundRules = config.outboundRules; + this._region = config.region; + this._subnets = config.subnets; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inbound_policy_id - computed: true, optional: false, required: false + public get inboundPolicyId() { + return this.getStringAttribute('inbound_policy_id'); + } + + // inbound_rules - computed: false, optional: true, required: false + private _inboundRules?: string[]; + public get inboundRules() { + return this.getListAttribute('inbound_rules'); + } + public set inboundRules(value: string[]) { + this._inboundRules = value; + } + public resetInboundRules() { + this._inboundRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get inboundRulesInput() { + return this._inboundRules; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // outbound_policy_id - computed: true, optional: false, required: false + public get outboundPolicyId() { + return this.getStringAttribute('outbound_policy_id'); + } + + // outbound_rules - computed: false, optional: true, required: false + private _outboundRules?: string[]; + public get outboundRules() { + return this.getListAttribute('outbound_rules'); + } + public set outboundRules(value: string[]) { + this._outboundRules = value; + } + public resetOutboundRules() { + this._outboundRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get outboundRulesInput() { + return this._outboundRules; + } + + // ports - computed: true, optional: false, required: false + public get ports() { + return cdktf.Fn.tolist(this.getListAttribute('ports')); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnets - computed: false, optional: true, required: false + private _subnets?: string[]; + public get subnets() { + return cdktf.Fn.tolist(this.getListAttribute('subnets')); + } + public set subnets(value: string[]) { + this._subnets = value; + } + public resetSubnets() { + this._subnets = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetsInput() { + return this._subnets; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkAclTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkAclTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + inbound_rules: cdktf.listMapper(cdktf.stringToTerraform, false)(this._inboundRules), + name: cdktf.stringToTerraform(this._name), + outbound_rules: cdktf.listMapper(cdktf.stringToTerraform, false)(this._outboundRules), + region: cdktf.stringToTerraform(this._region), + subnets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._subnets), + timeouts: networkAclTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inbound_rules: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._inboundRules), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + outbound_rules: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._outboundRules), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._subnets), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + timeouts: { + value: networkAclTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkAclTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-eip-associate/README.md b/src/constructs/providers/huaweicloud/networking-eip-associate/README.md new file mode 100644 index 00000000..51a86155 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate). diff --git a/src/constructs/providers/huaweicloud/networking-eip-associate/index.ts b/src/constructs/providers/huaweicloud/networking-eip-associate/index.ts new file mode 100644 index 00000000..8303d2d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-eip-associate/index.ts @@ -0,0 +1,425 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#fixed_ip NetworkingEipAssociate#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#id NetworkingEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#network_id NetworkingEipAssociate#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#port_id NetworkingEipAssociate#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#public_ip NetworkingEipAssociate#public_ip} + */ + readonly publicIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#region NetworkingEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#timeouts NetworkingEipAssociate#timeouts} + */ + readonly timeouts?: NetworkingEipAssociateTimeouts; +} +export interface NetworkingEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#create NetworkingEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#delete NetworkingEipAssociate#delete} + */ + readonly delete?: string; +} + +export function networkingEipAssociateTimeoutsToTerraform(struct?: NetworkingEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingEipAssociateTimeoutsToHclTerraform(struct?: NetworkingEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate huaweicloud_networking_eip_associate} +*/ +export class NetworkingEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingEipAssociate to import + * @param importFromId The id of the existing NetworkingEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_eip_associate huaweicloud_networking_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: NetworkingEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fixedIp = config.fixedIp; + this._id = config.id; + this._networkId = config.networkId; + this._portId = config.portId; + this._publicIp = config.publicIp; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // public_ipv6 - computed: true, optional: false, required: false + public get publicIpv6() { + return this.getStringAttribute('public_ipv6'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + network_id: cdktf.stringToTerraform(this._networkId), + port_id: cdktf.stringToTerraform(this._portId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + timeouts: networkingEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: networkingEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-floatingip-v2/README.md b/src/constructs/providers/huaweicloud/networking-floatingip-v2/README.md new file mode 100644 index 00000000..68756b28 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-floatingip-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_floatingip_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_floatingip_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2). diff --git a/src/constructs/providers/huaweicloud/networking-floatingip-v2/index.ts b/src/constructs/providers/huaweicloud/networking-floatingip-v2/index.ts new file mode 100644 index 00000000..df7db733 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-floatingip-v2/index.ts @@ -0,0 +1,446 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingFloatingipV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#fixed_ip NetworkingFloatingipV2#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#id NetworkingFloatingipV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#pool NetworkingFloatingipV2#pool} + */ + readonly pool?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#port_id NetworkingFloatingipV2#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#region NetworkingFloatingipV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#tenant_id NetworkingFloatingipV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#value_specs NetworkingFloatingipV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#timeouts NetworkingFloatingipV2#timeouts} + */ + readonly timeouts?: NetworkingFloatingipV2Timeouts; +} +export interface NetworkingFloatingipV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#create NetworkingFloatingipV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#delete NetworkingFloatingipV2#delete} + */ + readonly delete?: string; +} + +export function networkingFloatingipV2TimeoutsToTerraform(struct?: NetworkingFloatingipV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingFloatingipV2TimeoutsToHclTerraform(struct?: NetworkingFloatingipV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingFloatingipV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingFloatingipV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingFloatingipV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2 huaweicloud_networking_floatingip_v2} +*/ +export class NetworkingFloatingipV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_floatingip_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingFloatingipV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingFloatingipV2 to import + * @param importFromId The id of the existing NetworkingFloatingipV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingFloatingipV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_floatingip_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_floatingip_v2 huaweicloud_networking_floatingip_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingFloatingipV2Config = {} + */ + public constructor(scope: Construct, id: string, config: NetworkingFloatingipV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_floatingip_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fixedIp = config.fixedIp; + this._id = config.id; + this._pool = config.pool; + this._portId = config.portId; + this._region = config.region; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // pool - computed: false, optional: true, required: false + private _pool?: string; + public get pool() { + return this.getStringAttribute('pool'); + } + public set pool(value: string) { + this._pool = value; + } + public resetPool() { + this._pool = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolInput() { + return this._pool; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingFloatingipV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingFloatingipV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + pool: cdktf.stringToTerraform(this._pool), + port_id: cdktf.stringToTerraform(this._portId), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: networkingFloatingipV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pool: { + value: cdktf.stringToHclTerraform(this._pool), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: networkingFloatingipV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingFloatingipV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-network-v2/README.md b/src/constructs/providers/huaweicloud/networking-network-v2/README.md new file mode 100644 index 00000000..ec684c49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-network-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_network_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_network_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2). diff --git a/src/constructs/providers/huaweicloud/networking-network-v2/index.ts b/src/constructs/providers/huaweicloud/networking-network-v2/index.ts new file mode 100644 index 00000000..030efe4b --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-network-v2/index.ts @@ -0,0 +1,653 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingNetworkV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#admin_state_up NetworkingNetworkV2#admin_state_up} + */ + readonly adminStateUp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#id NetworkingNetworkV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#name NetworkingNetworkV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#region NetworkingNetworkV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#shared NetworkingNetworkV2#shared} + */ + readonly shared?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#tenant_id NetworkingNetworkV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#value_specs NetworkingNetworkV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * segments block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#segments NetworkingNetworkV2#segments} + */ + readonly segments?: NetworkingNetworkV2Segments[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#timeouts NetworkingNetworkV2#timeouts} + */ + readonly timeouts?: NetworkingNetworkV2Timeouts; +} +export interface NetworkingNetworkV2Segments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#network_type NetworkingNetworkV2#network_type} + */ + readonly networkType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#physical_network NetworkingNetworkV2#physical_network} + */ + readonly physicalNetwork?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#segmentation_id NetworkingNetworkV2#segmentation_id} + */ + readonly segmentationId?: number; +} + +export function networkingNetworkV2SegmentsToTerraform(struct?: NetworkingNetworkV2Segments | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + network_type: cdktf.stringToTerraform(struct!.networkType), + physical_network: cdktf.stringToTerraform(struct!.physicalNetwork), + segmentation_id: cdktf.numberToTerraform(struct!.segmentationId), + } +} + + +export function networkingNetworkV2SegmentsToHclTerraform(struct?: NetworkingNetworkV2Segments | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + network_type: { + value: cdktf.stringToHclTerraform(struct!.networkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + physical_network: { + value: cdktf.stringToHclTerraform(struct!.physicalNetwork), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + segmentation_id: { + value: cdktf.numberToHclTerraform(struct!.segmentationId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingNetworkV2SegmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingNetworkV2Segments | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._networkType !== undefined) { + hasAnyValues = true; + internalValueResult.networkType = this._networkType; + } + if (this._physicalNetwork !== undefined) { + hasAnyValues = true; + internalValueResult.physicalNetwork = this._physicalNetwork; + } + if (this._segmentationId !== undefined) { + hasAnyValues = true; + internalValueResult.segmentationId = this._segmentationId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingNetworkV2Segments | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._networkType = undefined; + this._physicalNetwork = undefined; + this._segmentationId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._networkType = value.networkType; + this._physicalNetwork = value.physicalNetwork; + this._segmentationId = value.segmentationId; + } + } + + // network_type - computed: false, optional: true, required: false + private _networkType?: string; + public get networkType() { + return this.getStringAttribute('network_type'); + } + public set networkType(value: string) { + this._networkType = value; + } + public resetNetworkType() { + this._networkType = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkTypeInput() { + return this._networkType; + } + + // physical_network - computed: false, optional: true, required: false + private _physicalNetwork?: string; + public get physicalNetwork() { + return this.getStringAttribute('physical_network'); + } + public set physicalNetwork(value: string) { + this._physicalNetwork = value; + } + public resetPhysicalNetwork() { + this._physicalNetwork = undefined; + } + // Temporarily expose input value. Use with caution. + public get physicalNetworkInput() { + return this._physicalNetwork; + } + + // segmentation_id - computed: false, optional: true, required: false + private _segmentationId?: number; + public get segmentationId() { + return this.getNumberAttribute('segmentation_id'); + } + public set segmentationId(value: number) { + this._segmentationId = value; + } + public resetSegmentationId() { + this._segmentationId = undefined; + } + // Temporarily expose input value. Use with caution. + public get segmentationIdInput() { + return this._segmentationId; + } +} + +export class NetworkingNetworkV2SegmentsList extends cdktf.ComplexList { + public internalValue? : NetworkingNetworkV2Segments[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingNetworkV2SegmentsOutputReference { + return new NetworkingNetworkV2SegmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingNetworkV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#create NetworkingNetworkV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#delete NetworkingNetworkV2#delete} + */ + readonly delete?: string; +} + +export function networkingNetworkV2TimeoutsToTerraform(struct?: NetworkingNetworkV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingNetworkV2TimeoutsToHclTerraform(struct?: NetworkingNetworkV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingNetworkV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingNetworkV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingNetworkV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2 huaweicloud_networking_network_v2} +*/ +export class NetworkingNetworkV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_network_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingNetworkV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingNetworkV2 to import + * @param importFromId The id of the existing NetworkingNetworkV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingNetworkV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_network_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_network_v2 huaweicloud_networking_network_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingNetworkV2Config = {} + */ + public constructor(scope: Construct, id: string, config: NetworkingNetworkV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_network_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._shared = config.shared; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._segments.internalValue = config.segments; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: true, required: false + private _adminStateUp?: string; + public get adminStateUp() { + return this.getStringAttribute('admin_state_up'); + } + public set adminStateUp(value: string) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // shared - computed: true, optional: true, required: false + private _shared?: string; + public get shared() { + return this.getStringAttribute('shared'); + } + public set shared(value: string) { + this._shared = value; + } + public resetShared() { + this._shared = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharedInput() { + return this._shared; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // segments - computed: false, optional: true, required: false + private _segments = new NetworkingNetworkV2SegmentsList(this, "segments", false); + public get segments() { + return this._segments; + } + public putSegments(value: NetworkingNetworkV2Segments[] | cdktf.IResolvable) { + this._segments.internalValue = value; + } + public resetSegments() { + this._segments.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get segmentsInput() { + return this._segments.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingNetworkV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingNetworkV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.stringToTerraform(this._adminStateUp), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + shared: cdktf.stringToTerraform(this._shared), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + segments: cdktf.listMapper(networkingNetworkV2SegmentsToTerraform, true)(this._segments.internalValue), + timeouts: networkingNetworkV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.stringToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shared: { + value: cdktf.stringToHclTerraform(this._shared), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + segments: { + value: cdktf.listMapperHcl(networkingNetworkV2SegmentsToHclTerraform, true)(this._segments.internalValue), + isBlock: true, + type: "list", + storageClassType: "NetworkingNetworkV2SegmentsList", + }, + timeouts: { + value: networkingNetworkV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingNetworkV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-port-v2/README.md b/src/constructs/providers/huaweicloud/networking-port-v2/README.md new file mode 100644 index 00000000..d4c6a945 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-port-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_port_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_port_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2). diff --git a/src/constructs/providers/huaweicloud/networking-port-v2/index.ts b/src/constructs/providers/huaweicloud/networking-port-v2/index.ts new file mode 100644 index 00000000..669459d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-port-v2/index.ts @@ -0,0 +1,1146 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingPortV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#admin_state_up NetworkingPortV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#device_id NetworkingPortV2#device_id} + */ + readonly deviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#device_owner NetworkingPortV2#device_owner} + */ + readonly deviceOwner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#id NetworkingPortV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#mac_address NetworkingPortV2#mac_address} + */ + readonly macAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#name NetworkingPortV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#network_id NetworkingPortV2#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#no_security_groups NetworkingPortV2#no_security_groups} + */ + readonly noSecurityGroups?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#region NetworkingPortV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#security_group_ids NetworkingPortV2#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#tenant_id NetworkingPortV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#value_specs NetworkingPortV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * allowed_address_pairs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#allowed_address_pairs NetworkingPortV2#allowed_address_pairs} + */ + readonly allowedAddressPairs?: NetworkingPortV2AllowedAddressPairs[] | cdktf.IResolvable; + /** + * extra_dhcp_option block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#extra_dhcp_option NetworkingPortV2#extra_dhcp_option} + */ + readonly extraDhcpOption?: NetworkingPortV2ExtraDhcpOption[] | cdktf.IResolvable; + /** + * fixed_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#fixed_ip NetworkingPortV2#fixed_ip} + */ + readonly fixedIp?: NetworkingPortV2FixedIp[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#timeouts NetworkingPortV2#timeouts} + */ + readonly timeouts?: NetworkingPortV2Timeouts; +} +export interface NetworkingPortV2AllowedAddressPairs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#ip_address NetworkingPortV2#ip_address} + */ + readonly ipAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#mac_address NetworkingPortV2#mac_address} + */ + readonly macAddress?: string; +} + +export function networkingPortV2AllowedAddressPairsToTerraform(struct?: NetworkingPortV2AllowedAddressPairs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + mac_address: cdktf.stringToTerraform(struct!.macAddress), + } +} + + +export function networkingPortV2AllowedAddressPairsToHclTerraform(struct?: NetworkingPortV2AllowedAddressPairs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(struct!.macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortV2AllowedAddressPairsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingPortV2AllowedAddressPairs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._macAddress !== undefined) { + hasAnyValues = true; + internalValueResult.macAddress = this._macAddress; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortV2AllowedAddressPairs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._macAddress = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._macAddress = value.macAddress; + } + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } +} + +export class NetworkingPortV2AllowedAddressPairsList extends cdktf.ComplexList { + public internalValue? : NetworkingPortV2AllowedAddressPairs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingPortV2AllowedAddressPairsOutputReference { + return new NetworkingPortV2AllowedAddressPairsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingPortV2ExtraDhcpOption { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#ip_version NetworkingPortV2#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#name NetworkingPortV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#value NetworkingPortV2#value} + */ + readonly value: string; +} + +export function networkingPortV2ExtraDhcpOptionToTerraform(struct?: NetworkingPortV2ExtraDhcpOption | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_version: cdktf.numberToTerraform(struct!.ipVersion), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function networkingPortV2ExtraDhcpOptionToHclTerraform(struct?: NetworkingPortV2ExtraDhcpOption | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_version: { + value: cdktf.numberToHclTerraform(struct!.ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortV2ExtraDhcpOptionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingPortV2ExtraDhcpOption | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ipVersion = this._ipVersion; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortV2ExtraDhcpOption | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipVersion = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipVersion = value.ipVersion; + this._name = value.name; + this._value = value.value; + } + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class NetworkingPortV2ExtraDhcpOptionList extends cdktf.ComplexList { + public internalValue? : NetworkingPortV2ExtraDhcpOption[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingPortV2ExtraDhcpOptionOutputReference { + return new NetworkingPortV2ExtraDhcpOptionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingPortV2FixedIp { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#ip_address NetworkingPortV2#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#subnet_id NetworkingPortV2#subnet_id} + */ + readonly subnetId: string; +} + +export function networkingPortV2FixedIpToTerraform(struct?: NetworkingPortV2FixedIp | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function networkingPortV2FixedIpToHclTerraform(struct?: NetworkingPortV2FixedIp | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortV2FixedIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingPortV2FixedIp | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortV2FixedIp | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._subnetId = value.subnetId; + } + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class NetworkingPortV2FixedIpList extends cdktf.ComplexList { + public internalValue? : NetworkingPortV2FixedIp[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingPortV2FixedIpOutputReference { + return new NetworkingPortV2FixedIpOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingPortV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#create NetworkingPortV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#delete NetworkingPortV2#delete} + */ + readonly delete?: string; +} + +export function networkingPortV2TimeoutsToTerraform(struct?: NetworkingPortV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingPortV2TimeoutsToHclTerraform(struct?: NetworkingPortV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingPortV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2 huaweicloud_networking_port_v2} +*/ +export class NetworkingPortV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_port_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingPortV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingPortV2 to import + * @param importFromId The id of the existing NetworkingPortV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingPortV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_port_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port_v2 huaweicloud_networking_port_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingPortV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingPortV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_port_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._deviceId = config.deviceId; + this._deviceOwner = config.deviceOwner; + this._id = config.id; + this._macAddress = config.macAddress; + this._name = config.name; + this._networkId = config.networkId; + this._noSecurityGroups = config.noSecurityGroups; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._allowedAddressPairs.internalValue = config.allowedAddressPairs; + this._extraDhcpOption.internalValue = config.extraDhcpOption; + this._fixedIp.internalValue = config.fixedIp; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // all_fixed_ips - computed: true, optional: false, required: false + public get allFixedIps() { + return this.getListAttribute('all_fixed_ips'); + } + + // all_security_group_ids - computed: true, optional: false, required: false + public get allSecurityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('all_security_group_ids')); + } + + // device_id - computed: true, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // device_owner - computed: true, optional: true, required: false + private _deviceOwner?: string; + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + public set deviceOwner(value: string) { + this._deviceOwner = value; + } + public resetDeviceOwner() { + this._deviceOwner = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceOwnerInput() { + return this._deviceOwner; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // no_security_groups - computed: false, optional: true, required: false + private _noSecurityGroups?: boolean | cdktf.IResolvable; + public get noSecurityGroups() { + return this.getBooleanAttribute('no_security_groups'); + } + public set noSecurityGroups(value: boolean | cdktf.IResolvable) { + this._noSecurityGroups = value; + } + public resetNoSecurityGroups() { + this._noSecurityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get noSecurityGroupsInput() { + return this._noSecurityGroups; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: false, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // allowed_address_pairs - computed: false, optional: true, required: false + private _allowedAddressPairs = new NetworkingPortV2AllowedAddressPairsList(this, "allowed_address_pairs", true); + public get allowedAddressPairs() { + return this._allowedAddressPairs; + } + public putAllowedAddressPairs(value: NetworkingPortV2AllowedAddressPairs[] | cdktf.IResolvable) { + this._allowedAddressPairs.internalValue = value; + } + public resetAllowedAddressPairs() { + this._allowedAddressPairs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowedAddressPairsInput() { + return this._allowedAddressPairs.internalValue; + } + + // extra_dhcp_option - computed: false, optional: true, required: false + private _extraDhcpOption = new NetworkingPortV2ExtraDhcpOptionList(this, "extra_dhcp_option", true); + public get extraDhcpOption() { + return this._extraDhcpOption; + } + public putExtraDhcpOption(value: NetworkingPortV2ExtraDhcpOption[] | cdktf.IResolvable) { + this._extraDhcpOption.internalValue = value; + } + public resetExtraDhcpOption() { + this._extraDhcpOption.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extraDhcpOptionInput() { + return this._extraDhcpOption.internalValue; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp = new NetworkingPortV2FixedIpList(this, "fixed_ip", false); + public get fixedIp() { + return this._fixedIp; + } + public putFixedIp(value: NetworkingPortV2FixedIp[] | cdktf.IResolvable) { + this._fixedIp.internalValue = value; + } + public resetFixedIp() { + this._fixedIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingPortV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingPortV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + device_id: cdktf.stringToTerraform(this._deviceId), + device_owner: cdktf.stringToTerraform(this._deviceOwner), + id: cdktf.stringToTerraform(this._id), + mac_address: cdktf.stringToTerraform(this._macAddress), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + no_security_groups: cdktf.booleanToTerraform(this._noSecurityGroups), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + allowed_address_pairs: cdktf.listMapper(networkingPortV2AllowedAddressPairsToTerraform, true)(this._allowedAddressPairs.internalValue), + extra_dhcp_option: cdktf.listMapper(networkingPortV2ExtraDhcpOptionToTerraform, true)(this._extraDhcpOption.internalValue), + fixed_ip: cdktf.listMapper(networkingPortV2FixedIpToTerraform, true)(this._fixedIp.internalValue), + timeouts: networkingPortV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_owner: { + value: cdktf.stringToHclTerraform(this._deviceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(this._macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_security_groups: { + value: cdktf.booleanToHclTerraform(this._noSecurityGroups), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + allowed_address_pairs: { + value: cdktf.listMapperHcl(networkingPortV2AllowedAddressPairsToHclTerraform, true)(this._allowedAddressPairs.internalValue), + isBlock: true, + type: "set", + storageClassType: "NetworkingPortV2AllowedAddressPairsList", + }, + extra_dhcp_option: { + value: cdktf.listMapperHcl(networkingPortV2ExtraDhcpOptionToHclTerraform, true)(this._extraDhcpOption.internalValue), + isBlock: true, + type: "set", + storageClassType: "NetworkingPortV2ExtraDhcpOptionList", + }, + fixed_ip: { + value: cdktf.listMapperHcl(networkingPortV2FixedIpToHclTerraform, true)(this._fixedIp.internalValue), + isBlock: true, + type: "list", + storageClassType: "NetworkingPortV2FixedIpList", + }, + timeouts: { + value: networkingPortV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingPortV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-port/README.md b/src/constructs/providers/huaweicloud/networking-port/README.md new file mode 100644 index 00000000..9839aba1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-port/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_port` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_port`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port). diff --git a/src/constructs/providers/huaweicloud/networking-port/index.ts b/src/constructs/providers/huaweicloud/networking-port/index.ts new file mode 100644 index 00000000..ef71a90e --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-port/index.ts @@ -0,0 +1,1146 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingPortConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#admin_state_up NetworkingPort#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#device_id NetworkingPort#device_id} + */ + readonly deviceId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#device_owner NetworkingPort#device_owner} + */ + readonly deviceOwner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#id NetworkingPort#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#mac_address NetworkingPort#mac_address} + */ + readonly macAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#name NetworkingPort#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#network_id NetworkingPort#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#no_security_groups NetworkingPort#no_security_groups} + */ + readonly noSecurityGroups?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#region NetworkingPort#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#security_group_ids NetworkingPort#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#tenant_id NetworkingPort#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#value_specs NetworkingPort#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * allowed_address_pairs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#allowed_address_pairs NetworkingPort#allowed_address_pairs} + */ + readonly allowedAddressPairs?: NetworkingPortAllowedAddressPairs[] | cdktf.IResolvable; + /** + * extra_dhcp_option block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#extra_dhcp_option NetworkingPort#extra_dhcp_option} + */ + readonly extraDhcpOption?: NetworkingPortExtraDhcpOption[] | cdktf.IResolvable; + /** + * fixed_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#fixed_ip NetworkingPort#fixed_ip} + */ + readonly fixedIp?: NetworkingPortFixedIp[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#timeouts NetworkingPort#timeouts} + */ + readonly timeouts?: NetworkingPortTimeouts; +} +export interface NetworkingPortAllowedAddressPairs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#ip_address NetworkingPort#ip_address} + */ + readonly ipAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#mac_address NetworkingPort#mac_address} + */ + readonly macAddress?: string; +} + +export function networkingPortAllowedAddressPairsToTerraform(struct?: NetworkingPortAllowedAddressPairs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + mac_address: cdktf.stringToTerraform(struct!.macAddress), + } +} + + +export function networkingPortAllowedAddressPairsToHclTerraform(struct?: NetworkingPortAllowedAddressPairs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(struct!.macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortAllowedAddressPairsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingPortAllowedAddressPairs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._macAddress !== undefined) { + hasAnyValues = true; + internalValueResult.macAddress = this._macAddress; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortAllowedAddressPairs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._macAddress = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._macAddress = value.macAddress; + } + } + + // ip_address - computed: false, optional: false, required: true + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } +} + +export class NetworkingPortAllowedAddressPairsList extends cdktf.ComplexList { + public internalValue? : NetworkingPortAllowedAddressPairs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingPortAllowedAddressPairsOutputReference { + return new NetworkingPortAllowedAddressPairsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingPortExtraDhcpOption { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#ip_version NetworkingPort#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#name NetworkingPort#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#value NetworkingPort#value} + */ + readonly value: string; +} + +export function networkingPortExtraDhcpOptionToTerraform(struct?: NetworkingPortExtraDhcpOption | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_version: cdktf.numberToTerraform(struct!.ipVersion), + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function networkingPortExtraDhcpOptionToHclTerraform(struct?: NetworkingPortExtraDhcpOption | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_version: { + value: cdktf.numberToHclTerraform(struct!.ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortExtraDhcpOptionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingPortExtraDhcpOption | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ipVersion = this._ipVersion; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortExtraDhcpOption | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipVersion = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipVersion = value.ipVersion; + this._name = value.name; + this._value = value.value; + } + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class NetworkingPortExtraDhcpOptionList extends cdktf.ComplexList { + public internalValue? : NetworkingPortExtraDhcpOption[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingPortExtraDhcpOptionOutputReference { + return new NetworkingPortExtraDhcpOptionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingPortFixedIp { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#ip_address NetworkingPort#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#subnet_id NetworkingPort#subnet_id} + */ + readonly subnetId: string; +} + +export function networkingPortFixedIpToTerraform(struct?: NetworkingPortFixedIp | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function networkingPortFixedIpToHclTerraform(struct?: NetworkingPortFixedIp | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortFixedIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingPortFixedIp | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortFixedIp | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._subnetId = value.subnetId; + } + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class NetworkingPortFixedIpList extends cdktf.ComplexList { + public internalValue? : NetworkingPortFixedIp[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingPortFixedIpOutputReference { + return new NetworkingPortFixedIpOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingPortTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#create NetworkingPort#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#delete NetworkingPort#delete} + */ + readonly delete?: string; +} + +export function networkingPortTimeoutsToTerraform(struct?: NetworkingPortTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingPortTimeoutsToHclTerraform(struct?: NetworkingPortTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingPortTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingPortTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingPortTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port huaweicloud_networking_port} +*/ +export class NetworkingPort extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_port"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingPort resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingPort to import + * @param importFromId The id of the existing NetworkingPort that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingPort to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_port", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_port huaweicloud_networking_port} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingPortConfig + */ + public constructor(scope: Construct, id: string, config: NetworkingPortConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_port', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._deviceId = config.deviceId; + this._deviceOwner = config.deviceOwner; + this._id = config.id; + this._macAddress = config.macAddress; + this._name = config.name; + this._networkId = config.networkId; + this._noSecurityGroups = config.noSecurityGroups; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._allowedAddressPairs.internalValue = config.allowedAddressPairs; + this._extraDhcpOption.internalValue = config.extraDhcpOption; + this._fixedIp.internalValue = config.fixedIp; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // all_fixed_ips - computed: true, optional: false, required: false + public get allFixedIps() { + return this.getListAttribute('all_fixed_ips'); + } + + // all_security_group_ids - computed: true, optional: false, required: false + public get allSecurityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('all_security_group_ids')); + } + + // device_id - computed: true, optional: true, required: false + private _deviceId?: string; + public get deviceId() { + return this.getStringAttribute('device_id'); + } + public set deviceId(value: string) { + this._deviceId = value; + } + public resetDeviceId() { + this._deviceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceIdInput() { + return this._deviceId; + } + + // device_owner - computed: true, optional: true, required: false + private _deviceOwner?: string; + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + public set deviceOwner(value: string) { + this._deviceOwner = value; + } + public resetDeviceOwner() { + this._deviceOwner = undefined; + } + // Temporarily expose input value. Use with caution. + public get deviceOwnerInput() { + return this._deviceOwner; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: true, required: false + private _macAddress?: string; + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + public set macAddress(value: string) { + this._macAddress = value; + } + public resetMacAddress() { + this._macAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get macAddressInput() { + return this._macAddress; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // no_security_groups - computed: false, optional: true, required: false + private _noSecurityGroups?: boolean | cdktf.IResolvable; + public get noSecurityGroups() { + return this.getBooleanAttribute('no_security_groups'); + } + public set noSecurityGroups(value: boolean | cdktf.IResolvable) { + this._noSecurityGroups = value; + } + public resetNoSecurityGroups() { + this._noSecurityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get noSecurityGroupsInput() { + return this._noSecurityGroups; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: false, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return cdktf.Fn.tolist(this.getListAttribute('security_group_ids')); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // allowed_address_pairs - computed: false, optional: true, required: false + private _allowedAddressPairs = new NetworkingPortAllowedAddressPairsList(this, "allowed_address_pairs", true); + public get allowedAddressPairs() { + return this._allowedAddressPairs; + } + public putAllowedAddressPairs(value: NetworkingPortAllowedAddressPairs[] | cdktf.IResolvable) { + this._allowedAddressPairs.internalValue = value; + } + public resetAllowedAddressPairs() { + this._allowedAddressPairs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowedAddressPairsInput() { + return this._allowedAddressPairs.internalValue; + } + + // extra_dhcp_option - computed: false, optional: true, required: false + private _extraDhcpOption = new NetworkingPortExtraDhcpOptionList(this, "extra_dhcp_option", true); + public get extraDhcpOption() { + return this._extraDhcpOption; + } + public putExtraDhcpOption(value: NetworkingPortExtraDhcpOption[] | cdktf.IResolvable) { + this._extraDhcpOption.internalValue = value; + } + public resetExtraDhcpOption() { + this._extraDhcpOption.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extraDhcpOptionInput() { + return this._extraDhcpOption.internalValue; + } + + // fixed_ip - computed: false, optional: true, required: false + private _fixedIp = new NetworkingPortFixedIpList(this, "fixed_ip", false); + public get fixedIp() { + return this._fixedIp; + } + public putFixedIp(value: NetworkingPortFixedIp[] | cdktf.IResolvable) { + this._fixedIp.internalValue = value; + } + public resetFixedIp() { + this._fixedIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingPortTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingPortTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + device_id: cdktf.stringToTerraform(this._deviceId), + device_owner: cdktf.stringToTerraform(this._deviceOwner), + id: cdktf.stringToTerraform(this._id), + mac_address: cdktf.stringToTerraform(this._macAddress), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + no_security_groups: cdktf.booleanToTerraform(this._noSecurityGroups), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + allowed_address_pairs: cdktf.listMapper(networkingPortAllowedAddressPairsToTerraform, true)(this._allowedAddressPairs.internalValue), + extra_dhcp_option: cdktf.listMapper(networkingPortExtraDhcpOptionToTerraform, true)(this._extraDhcpOption.internalValue), + fixed_ip: cdktf.listMapper(networkingPortFixedIpToTerraform, true)(this._fixedIp.internalValue), + timeouts: networkingPortTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + device_id: { + value: cdktf.stringToHclTerraform(this._deviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + device_owner: { + value: cdktf.stringToHclTerraform(this._deviceOwner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac_address: { + value: cdktf.stringToHclTerraform(this._macAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_security_groups: { + value: cdktf.booleanToHclTerraform(this._noSecurityGroups), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + allowed_address_pairs: { + value: cdktf.listMapperHcl(networkingPortAllowedAddressPairsToHclTerraform, true)(this._allowedAddressPairs.internalValue), + isBlock: true, + type: "set", + storageClassType: "NetworkingPortAllowedAddressPairsList", + }, + extra_dhcp_option: { + value: cdktf.listMapperHcl(networkingPortExtraDhcpOptionToHclTerraform, true)(this._extraDhcpOption.internalValue), + isBlock: true, + type: "set", + storageClassType: "NetworkingPortExtraDhcpOptionList", + }, + fixed_ip: { + value: cdktf.listMapperHcl(networkingPortFixedIpToHclTerraform, true)(this._fixedIp.internalValue), + isBlock: true, + type: "list", + storageClassType: "NetworkingPortFixedIpList", + }, + timeouts: { + value: networkingPortTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingPortTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-router-interface-v2/README.md b/src/constructs/providers/huaweicloud/networking-router-interface-v2/README.md new file mode 100644 index 00000000..3f105dff --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-router-interface-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_router_interface_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_router_interface_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2). diff --git a/src/constructs/providers/huaweicloud/networking-router-interface-v2/index.ts b/src/constructs/providers/huaweicloud/networking-router-interface-v2/index.ts new file mode 100644 index 00000000..5efcceb1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-router-interface-v2/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingRouterInterfaceV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#id NetworkingRouterInterfaceV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#port_id NetworkingRouterInterfaceV2#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#region NetworkingRouterInterfaceV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#router_id NetworkingRouterInterfaceV2#router_id} + */ + readonly routerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#subnet_id NetworkingRouterInterfaceV2#subnet_id} + */ + readonly subnetId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#timeouts NetworkingRouterInterfaceV2#timeouts} + */ + readonly timeouts?: NetworkingRouterInterfaceV2Timeouts; +} +export interface NetworkingRouterInterfaceV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#create NetworkingRouterInterfaceV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#delete NetworkingRouterInterfaceV2#delete} + */ + readonly delete?: string; +} + +export function networkingRouterInterfaceV2TimeoutsToTerraform(struct?: NetworkingRouterInterfaceV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingRouterInterfaceV2TimeoutsToHclTerraform(struct?: NetworkingRouterInterfaceV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingRouterInterfaceV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingRouterInterfaceV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingRouterInterfaceV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2 huaweicloud_networking_router_interface_v2} +*/ +export class NetworkingRouterInterfaceV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_router_interface_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingRouterInterfaceV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingRouterInterfaceV2 to import + * @param importFromId The id of the existing NetworkingRouterInterfaceV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingRouterInterfaceV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_router_interface_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_interface_v2 huaweicloud_networking_router_interface_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingRouterInterfaceV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingRouterInterfaceV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_router_interface_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._portId = config.portId; + this._region = config.region; + this._routerId = config.routerId; + this._subnetId = config.subnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // router_id - computed: false, optional: false, required: true + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingRouterInterfaceV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingRouterInterfaceV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + port_id: cdktf.stringToTerraform(this._portId), + region: cdktf.stringToTerraform(this._region), + router_id: cdktf.stringToTerraform(this._routerId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + timeouts: networkingRouterInterfaceV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_id: { + value: cdktf.stringToHclTerraform(this._routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: networkingRouterInterfaceV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingRouterInterfaceV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-router-route-v2/README.md b/src/constructs/providers/huaweicloud/networking-router-route-v2/README.md new file mode 100644 index 00000000..20e59f46 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-router-route-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_router_route_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_router_route_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2). diff --git a/src/constructs/providers/huaweicloud/networking-router-route-v2/index.ts b/src/constructs/providers/huaweicloud/networking-router-route-v2/index.ts new file mode 100644 index 00000000..3a8410ff --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-router-route-v2/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingRouterRouteV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2#destination_cidr NetworkingRouterRouteV2#destination_cidr} + */ + readonly destinationCidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2#id NetworkingRouterRouteV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2#next_hop NetworkingRouterRouteV2#next_hop} + */ + readonly nextHop: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2#region NetworkingRouterRouteV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2#router_id NetworkingRouterRouteV2#router_id} + */ + readonly routerId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2 huaweicloud_networking_router_route_v2} +*/ +export class NetworkingRouterRouteV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_router_route_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingRouterRouteV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingRouterRouteV2 to import + * @param importFromId The id of the existing NetworkingRouterRouteV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingRouterRouteV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_router_route_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_route_v2 huaweicloud_networking_router_route_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingRouterRouteV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingRouterRouteV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_router_route_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destinationCidr = config.destinationCidr; + this._id = config.id; + this._nextHop = config.nextHop; + this._region = config.region; + this._routerId = config.routerId; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination_cidr - computed: false, optional: false, required: true + private _destinationCidr?: string; + public get destinationCidr() { + return this.getStringAttribute('destination_cidr'); + } + public set destinationCidr(value: string) { + this._destinationCidr = value; + } + // Temporarily expose input value. Use with caution. + public get destinationCidrInput() { + return this._destinationCidr; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // next_hop - computed: false, optional: false, required: true + private _nextHop?: string; + public get nextHop() { + return this.getStringAttribute('next_hop'); + } + public set nextHop(value: string) { + this._nextHop = value; + } + // Temporarily expose input value. Use with caution. + public get nextHopInput() { + return this._nextHop; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // router_id - computed: false, optional: false, required: true + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination_cidr: cdktf.stringToTerraform(this._destinationCidr), + id: cdktf.stringToTerraform(this._id), + next_hop: cdktf.stringToTerraform(this._nextHop), + region: cdktf.stringToTerraform(this._region), + router_id: cdktf.stringToTerraform(this._routerId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination_cidr: { + value: cdktf.stringToHclTerraform(this._destinationCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + next_hop: { + value: cdktf.stringToHclTerraform(this._nextHop), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_id: { + value: cdktf.stringToHclTerraform(this._routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-router-v2/README.md b/src/constructs/providers/huaweicloud/networking-router-v2/README.md new file mode 100644 index 00000000..2d9987a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-router-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_router_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_router_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2). diff --git a/src/constructs/providers/huaweicloud/networking-router-v2/index.ts b/src/constructs/providers/huaweicloud/networking-router-v2/index.ts new file mode 100644 index 00000000..e258f8c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-router-v2/index.ts @@ -0,0 +1,676 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingRouterV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#admin_state_up NetworkingRouterV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#distributed NetworkingRouterV2#distributed} + */ + readonly distributed?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#enable_snat NetworkingRouterV2#enable_snat} + */ + readonly enableSnat?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#external_network_id NetworkingRouterV2#external_network_id} + */ + readonly externalNetworkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#id NetworkingRouterV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#name NetworkingRouterV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#region NetworkingRouterV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#tenant_id NetworkingRouterV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#value_specs NetworkingRouterV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * external_fixed_ip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#external_fixed_ip NetworkingRouterV2#external_fixed_ip} + */ + readonly externalFixedIp?: NetworkingRouterV2ExternalFixedIp[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#timeouts NetworkingRouterV2#timeouts} + */ + readonly timeouts?: NetworkingRouterV2Timeouts; +} +export interface NetworkingRouterV2ExternalFixedIp { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#ip_address NetworkingRouterV2#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#subnet_id NetworkingRouterV2#subnet_id} + */ + readonly subnetId?: string; +} + +export function networkingRouterV2ExternalFixedIpToTerraform(struct?: NetworkingRouterV2ExternalFixedIp | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function networkingRouterV2ExternalFixedIpToHclTerraform(struct?: NetworkingRouterV2ExternalFixedIp | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingRouterV2ExternalFixedIpOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingRouterV2ExternalFixedIp | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingRouterV2ExternalFixedIp | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ipAddress = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ipAddress = value.ipAddress; + this._subnetId = value.subnetId; + } + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class NetworkingRouterV2ExternalFixedIpList extends cdktf.ComplexList { + public internalValue? : NetworkingRouterV2ExternalFixedIp[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingRouterV2ExternalFixedIpOutputReference { + return new NetworkingRouterV2ExternalFixedIpOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingRouterV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#create NetworkingRouterV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#delete NetworkingRouterV2#delete} + */ + readonly delete?: string; +} + +export function networkingRouterV2TimeoutsToTerraform(struct?: NetworkingRouterV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingRouterV2TimeoutsToHclTerraform(struct?: NetworkingRouterV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingRouterV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingRouterV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingRouterV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2 huaweicloud_networking_router_v2} +*/ +export class NetworkingRouterV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_router_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingRouterV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingRouterV2 to import + * @param importFromId The id of the existing NetworkingRouterV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingRouterV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_router_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_router_v2 huaweicloud_networking_router_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingRouterV2Config = {} + */ + public constructor(scope: Construct, id: string, config: NetworkingRouterV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_router_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._distributed = config.distributed; + this._enableSnat = config.enableSnat; + this._externalNetworkId = config.externalNetworkId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._externalFixedIp.internalValue = config.externalFixedIp; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: true, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // distributed - computed: true, optional: true, required: false + private _distributed?: boolean | cdktf.IResolvable; + public get distributed() { + return this.getBooleanAttribute('distributed'); + } + public set distributed(value: boolean | cdktf.IResolvable) { + this._distributed = value; + } + public resetDistributed() { + this._distributed = undefined; + } + // Temporarily expose input value. Use with caution. + public get distributedInput() { + return this._distributed; + } + + // enable_snat - computed: true, optional: true, required: false + private _enableSnat?: boolean | cdktf.IResolvable; + public get enableSnat() { + return this.getBooleanAttribute('enable_snat'); + } + public set enableSnat(value: boolean | cdktf.IResolvable) { + this._enableSnat = value; + } + public resetEnableSnat() { + this._enableSnat = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableSnatInput() { + return this._enableSnat; + } + + // external_network_id - computed: true, optional: true, required: false + private _externalNetworkId?: string; + public get externalNetworkId() { + return this.getStringAttribute('external_network_id'); + } + public set externalNetworkId(value: string) { + this._externalNetworkId = value; + } + public resetExternalNetworkId() { + this._externalNetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalNetworkIdInput() { + return this._externalNetworkId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // external_fixed_ip - computed: false, optional: true, required: false + private _externalFixedIp = new NetworkingRouterV2ExternalFixedIpList(this, "external_fixed_ip", false); + public get externalFixedIp() { + return this._externalFixedIp; + } + public putExternalFixedIp(value: NetworkingRouterV2ExternalFixedIp[] | cdktf.IResolvable) { + this._externalFixedIp.internalValue = value; + } + public resetExternalFixedIp() { + this._externalFixedIp.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalFixedIpInput() { + return this._externalFixedIp.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingRouterV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingRouterV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + distributed: cdktf.booleanToTerraform(this._distributed), + enable_snat: cdktf.booleanToTerraform(this._enableSnat), + external_network_id: cdktf.stringToTerraform(this._externalNetworkId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + external_fixed_ip: cdktf.listMapper(networkingRouterV2ExternalFixedIpToTerraform, true)(this._externalFixedIp.internalValue), + timeouts: networkingRouterV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + distributed: { + value: cdktf.booleanToHclTerraform(this._distributed), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_snat: { + value: cdktf.booleanToHclTerraform(this._enableSnat), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + external_network_id: { + value: cdktf.stringToHclTerraform(this._externalNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + external_fixed_ip: { + value: cdktf.listMapperHcl(networkingRouterV2ExternalFixedIpToHclTerraform, true)(this._externalFixedIp.internalValue), + isBlock: true, + type: "list", + storageClassType: "NetworkingRouterV2ExternalFixedIpList", + }, + timeouts: { + value: networkingRouterV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingRouterV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/README.md b/src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/README.md new file mode 100644 index 00000000..cc4aa450 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_secgroup_rule_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_secgroup_rule_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2). diff --git a/src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/index.ts b/src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/index.ts new file mode 100644 index 00000000..4fa95e99 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup-rule-v2/index.ts @@ -0,0 +1,623 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingSecgroupRuleV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#action NetworkingSecgroupRuleV2#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#description NetworkingSecgroupRuleV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#direction NetworkingSecgroupRuleV2#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#ethertype NetworkingSecgroupRuleV2#ethertype} + */ + readonly ethertype: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#id NetworkingSecgroupRuleV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#port_range_max NetworkingSecgroupRuleV2#port_range_max} + */ + readonly portRangeMax?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#port_range_min NetworkingSecgroupRuleV2#port_range_min} + */ + readonly portRangeMin?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#ports NetworkingSecgroupRuleV2#ports} + */ + readonly ports?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#priority NetworkingSecgroupRuleV2#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#protocol NetworkingSecgroupRuleV2#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#region NetworkingSecgroupRuleV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#remote_address_group_id NetworkingSecgroupRuleV2#remote_address_group_id} + */ + readonly remoteAddressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#remote_group_id NetworkingSecgroupRuleV2#remote_group_id} + */ + readonly remoteGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#remote_ip_prefix NetworkingSecgroupRuleV2#remote_ip_prefix} + */ + readonly remoteIpPrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#security_group_id NetworkingSecgroupRuleV2#security_group_id} + */ + readonly securityGroupId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#timeouts NetworkingSecgroupRuleV2#timeouts} + */ + readonly timeouts?: NetworkingSecgroupRuleV2Timeouts; +} +export interface NetworkingSecgroupRuleV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#delete NetworkingSecgroupRuleV2#delete} + */ + readonly delete?: string; +} + +export function networkingSecgroupRuleV2TimeoutsToTerraform(struct?: NetworkingSecgroupRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingSecgroupRuleV2TimeoutsToHclTerraform(struct?: NetworkingSecgroupRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSecgroupRuleV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingSecgroupRuleV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSecgroupRuleV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2 huaweicloud_networking_secgroup_rule_v2} +*/ +export class NetworkingSecgroupRuleV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup_rule_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingSecgroupRuleV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingSecgroupRuleV2 to import + * @param importFromId The id of the existing NetworkingSecgroupRuleV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingSecgroupRuleV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup_rule_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule_v2 huaweicloud_networking_secgroup_rule_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingSecgroupRuleV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingSecgroupRuleV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup_rule_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._direction = config.direction; + this._ethertype = config.ethertype; + this._id = config.id; + this._portRangeMax = config.portRangeMax; + this._portRangeMin = config.portRangeMin; + this._ports = config.ports; + this._priority = config.priority; + this._protocol = config.protocol; + this._region = config.region; + this._remoteAddressGroupId = config.remoteAddressGroupId; + this._remoteGroupId = config.remoteGroupId; + this._remoteIpPrefix = config.remoteIpPrefix; + this._securityGroupId = config.securityGroupId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // ethertype - computed: false, optional: false, required: true + private _ethertype?: string; + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + public set ethertype(value: string) { + this._ethertype = value; + } + // Temporarily expose input value. Use with caution. + public get ethertypeInput() { + return this._ethertype; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // port_range_max - computed: true, optional: true, required: false + private _portRangeMax?: number; + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + public set portRangeMax(value: number) { + this._portRangeMax = value; + } + public resetPortRangeMax() { + this._portRangeMax = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangeMaxInput() { + return this._portRangeMax; + } + + // port_range_min - computed: true, optional: true, required: false + private _portRangeMin?: number; + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + public set portRangeMin(value: number) { + this._portRangeMin = value; + } + public resetPortRangeMin() { + this._portRangeMin = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangeMinInput() { + return this._portRangeMin; + } + + // ports - computed: true, optional: true, required: false + private _ports?: string; + public get ports() { + return this.getStringAttribute('ports'); + } + public set ports(value: string) { + this._ports = value; + } + public resetPorts() { + this._ports = undefined; + } + // Temporarily expose input value. Use with caution. + public get portsInput() { + return this._ports; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // protocol - computed: true, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_address_group_id - computed: true, optional: true, required: false + private _remoteAddressGroupId?: string; + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + public set remoteAddressGroupId(value: string) { + this._remoteAddressGroupId = value; + } + public resetRemoteAddressGroupId() { + this._remoteAddressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAddressGroupIdInput() { + return this._remoteAddressGroupId; + } + + // remote_group_id - computed: true, optional: true, required: false + private _remoteGroupId?: string; + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + public set remoteGroupId(value: string) { + this._remoteGroupId = value; + } + public resetRemoteGroupId() { + this._remoteGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteGroupIdInput() { + return this._remoteGroupId; + } + + // remote_ip_prefix - computed: true, optional: true, required: false + private _remoteIpPrefix?: string; + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } + public set remoteIpPrefix(value: string) { + this._remoteIpPrefix = value; + } + public resetRemoteIpPrefix() { + this._remoteIpPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteIpPrefixInput() { + return this._remoteIpPrefix; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingSecgroupRuleV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingSecgroupRuleV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + direction: cdktf.stringToTerraform(this._direction), + ethertype: cdktf.stringToTerraform(this._ethertype), + id: cdktf.stringToTerraform(this._id), + port_range_max: cdktf.numberToTerraform(this._portRangeMax), + port_range_min: cdktf.numberToTerraform(this._portRangeMin), + ports: cdktf.stringToTerraform(this._ports), + priority: cdktf.numberToTerraform(this._priority), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + remote_address_group_id: cdktf.stringToTerraform(this._remoteAddressGroupId), + remote_group_id: cdktf.stringToTerraform(this._remoteGroupId), + remote_ip_prefix: cdktf.stringToTerraform(this._remoteIpPrefix), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + timeouts: networkingSecgroupRuleV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ethertype: { + value: cdktf.stringToHclTerraform(this._ethertype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_range_max: { + value: cdktf.numberToHclTerraform(this._portRangeMax), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port_range_min: { + value: cdktf.numberToHclTerraform(this._portRangeMin), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ports: { + value: cdktf.stringToHclTerraform(this._ports), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_address_group_id: { + value: cdktf.stringToHclTerraform(this._remoteAddressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_group_id: { + value: cdktf.stringToHclTerraform(this._remoteGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_ip_prefix: { + value: cdktf.stringToHclTerraform(this._remoteIpPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: networkingSecgroupRuleV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingSecgroupRuleV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-secgroup-rule/README.md b/src/constructs/providers/huaweicloud/networking-secgroup-rule/README.md new file mode 100644 index 00000000..d0590057 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_secgroup_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_secgroup_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule). diff --git a/src/constructs/providers/huaweicloud/networking-secgroup-rule/index.ts b/src/constructs/providers/huaweicloud/networking-secgroup-rule/index.ts new file mode 100644 index 00000000..a547745d --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup-rule/index.ts @@ -0,0 +1,623 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingSecgroupRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#action NetworkingSecgroupRule#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#description NetworkingSecgroupRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#direction NetworkingSecgroupRule#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#ethertype NetworkingSecgroupRule#ethertype} + */ + readonly ethertype: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#id NetworkingSecgroupRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#port_range_max NetworkingSecgroupRule#port_range_max} + */ + readonly portRangeMax?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#port_range_min NetworkingSecgroupRule#port_range_min} + */ + readonly portRangeMin?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#ports NetworkingSecgroupRule#ports} + */ + readonly ports?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#priority NetworkingSecgroupRule#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#protocol NetworkingSecgroupRule#protocol} + */ + readonly protocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#region NetworkingSecgroupRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#remote_address_group_id NetworkingSecgroupRule#remote_address_group_id} + */ + readonly remoteAddressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#remote_group_id NetworkingSecgroupRule#remote_group_id} + */ + readonly remoteGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#remote_ip_prefix NetworkingSecgroupRule#remote_ip_prefix} + */ + readonly remoteIpPrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#security_group_id NetworkingSecgroupRule#security_group_id} + */ + readonly securityGroupId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#timeouts NetworkingSecgroupRule#timeouts} + */ + readonly timeouts?: NetworkingSecgroupRuleTimeouts; +} +export interface NetworkingSecgroupRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#delete NetworkingSecgroupRule#delete} + */ + readonly delete?: string; +} + +export function networkingSecgroupRuleTimeoutsToTerraform(struct?: NetworkingSecgroupRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingSecgroupRuleTimeoutsToHclTerraform(struct?: NetworkingSecgroupRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSecgroupRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingSecgroupRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSecgroupRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule huaweicloud_networking_secgroup_rule} +*/ +export class NetworkingSecgroupRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingSecgroupRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingSecgroupRule to import + * @param importFromId The id of the existing NetworkingSecgroupRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingSecgroupRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_rule huaweicloud_networking_secgroup_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingSecgroupRuleConfig + */ + public constructor(scope: Construct, id: string, config: NetworkingSecgroupRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._direction = config.direction; + this._ethertype = config.ethertype; + this._id = config.id; + this._portRangeMax = config.portRangeMax; + this._portRangeMin = config.portRangeMin; + this._ports = config.ports; + this._priority = config.priority; + this._protocol = config.protocol; + this._region = config.region; + this._remoteAddressGroupId = config.remoteAddressGroupId; + this._remoteGroupId = config.remoteGroupId; + this._remoteIpPrefix = config.remoteIpPrefix; + this._securityGroupId = config.securityGroupId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // ethertype - computed: false, optional: false, required: true + private _ethertype?: string; + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + public set ethertype(value: string) { + this._ethertype = value; + } + // Temporarily expose input value. Use with caution. + public get ethertypeInput() { + return this._ethertype; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // port_range_max - computed: true, optional: true, required: false + private _portRangeMax?: number; + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + public set portRangeMax(value: number) { + this._portRangeMax = value; + } + public resetPortRangeMax() { + this._portRangeMax = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangeMaxInput() { + return this._portRangeMax; + } + + // port_range_min - computed: true, optional: true, required: false + private _portRangeMin?: number; + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + public set portRangeMin(value: number) { + this._portRangeMin = value; + } + public resetPortRangeMin() { + this._portRangeMin = undefined; + } + // Temporarily expose input value. Use with caution. + public get portRangeMinInput() { + return this._portRangeMin; + } + + // ports - computed: true, optional: true, required: false + private _ports?: string; + public get ports() { + return this.getStringAttribute('ports'); + } + public set ports(value: string) { + this._ports = value; + } + public resetPorts() { + this._ports = undefined; + } + // Temporarily expose input value. Use with caution. + public get portsInput() { + return this._ports; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // protocol - computed: true, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remote_address_group_id - computed: true, optional: true, required: false + private _remoteAddressGroupId?: string; + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + public set remoteAddressGroupId(value: string) { + this._remoteAddressGroupId = value; + } + public resetRemoteAddressGroupId() { + this._remoteAddressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteAddressGroupIdInput() { + return this._remoteAddressGroupId; + } + + // remote_group_id - computed: true, optional: true, required: false + private _remoteGroupId?: string; + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + public set remoteGroupId(value: string) { + this._remoteGroupId = value; + } + public resetRemoteGroupId() { + this._remoteGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteGroupIdInput() { + return this._remoteGroupId; + } + + // remote_ip_prefix - computed: true, optional: true, required: false + private _remoteIpPrefix?: string; + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } + public set remoteIpPrefix(value: string) { + this._remoteIpPrefix = value; + } + public resetRemoteIpPrefix() { + this._remoteIpPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get remoteIpPrefixInput() { + return this._remoteIpPrefix; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingSecgroupRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingSecgroupRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + direction: cdktf.stringToTerraform(this._direction), + ethertype: cdktf.stringToTerraform(this._ethertype), + id: cdktf.stringToTerraform(this._id), + port_range_max: cdktf.numberToTerraform(this._portRangeMax), + port_range_min: cdktf.numberToTerraform(this._portRangeMin), + ports: cdktf.stringToTerraform(this._ports), + priority: cdktf.numberToTerraform(this._priority), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + remote_address_group_id: cdktf.stringToTerraform(this._remoteAddressGroupId), + remote_group_id: cdktf.stringToTerraform(this._remoteGroupId), + remote_ip_prefix: cdktf.stringToTerraform(this._remoteIpPrefix), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + timeouts: networkingSecgroupRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ethertype: { + value: cdktf.stringToHclTerraform(this._ethertype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_range_max: { + value: cdktf.numberToHclTerraform(this._portRangeMax), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port_range_min: { + value: cdktf.numberToHclTerraform(this._portRangeMin), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ports: { + value: cdktf.stringToHclTerraform(this._ports), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_address_group_id: { + value: cdktf.stringToHclTerraform(this._remoteAddressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_group_id: { + value: cdktf.stringToHclTerraform(this._remoteGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remote_ip_prefix: { + value: cdktf.stringToHclTerraform(this._remoteIpPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: networkingSecgroupRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingSecgroupRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-secgroup-v2/README.md b/src/constructs/providers/huaweicloud/networking-secgroup-v2/README.md new file mode 100644 index 00000000..5957c119 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_secgroup_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_secgroup_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2). diff --git a/src/constructs/providers/huaweicloud/networking-secgroup-v2/index.ts b/src/constructs/providers/huaweicloud/networking-secgroup-v2/index.ts new file mode 100644 index 00000000..4358b085 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup-v2/index.ts @@ -0,0 +1,556 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingSecgroupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#delete_default_rules NetworkingSecgroupV2#delete_default_rules} + */ + readonly deleteDefaultRules?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#description NetworkingSecgroupV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#enterprise_project_id NetworkingSecgroupV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#id NetworkingSecgroupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#name NetworkingSecgroupV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#region NetworkingSecgroupV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#tags NetworkingSecgroupV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#timeouts NetworkingSecgroupV2#timeouts} + */ + readonly timeouts?: NetworkingSecgroupV2Timeouts; +} +export interface NetworkingSecgroupV2Rules { +} + +export function networkingSecgroupV2RulesToTerraform(struct?: NetworkingSecgroupV2Rules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function networkingSecgroupV2RulesToHclTerraform(struct?: NetworkingSecgroupV2Rules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class NetworkingSecgroupV2RulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingSecgroupV2Rules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSecgroupV2Rules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port_range_max - computed: true, optional: false, required: false + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + + // port_range_min - computed: true, optional: false, required: false + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + + // ports - computed: true, optional: false, required: false + public get ports() { + return this.getStringAttribute('ports'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_address_group_id - computed: true, optional: false, required: false + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } +} + +export class NetworkingSecgroupV2RulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingSecgroupV2RulesOutputReference { + return new NetworkingSecgroupV2RulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingSecgroupV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#delete NetworkingSecgroupV2#delete} + */ + readonly delete?: string; +} + +export function networkingSecgroupV2TimeoutsToTerraform(struct?: NetworkingSecgroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingSecgroupV2TimeoutsToHclTerraform(struct?: NetworkingSecgroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSecgroupV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingSecgroupV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSecgroupV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2 huaweicloud_networking_secgroup_v2} +*/ +export class NetworkingSecgroupV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingSecgroupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingSecgroupV2 to import + * @param importFromId The id of the existing NetworkingSecgroupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingSecgroupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup_v2 huaweicloud_networking_secgroup_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingSecgroupV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingSecgroupV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteDefaultRules = config.deleteDefaultRules; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delete_default_rules - computed: false, optional: true, required: false + private _deleteDefaultRules?: boolean | cdktf.IResolvable; + public get deleteDefaultRules() { + return this.getBooleanAttribute('delete_default_rules'); + } + public set deleteDefaultRules(value: boolean | cdktf.IResolvable) { + this._deleteDefaultRules = value; + } + public resetDeleteDefaultRules() { + this._deleteDefaultRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteDefaultRulesInput() { + return this._deleteDefaultRules; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new NetworkingSecgroupV2RulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingSecgroupV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingSecgroupV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_default_rules: cdktf.booleanToTerraform(this._deleteDefaultRules), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: networkingSecgroupV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_default_rules: { + value: cdktf.booleanToHclTerraform(this._deleteDefaultRules), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: networkingSecgroupV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingSecgroupV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-secgroup/README.md b/src/constructs/providers/huaweicloud/networking-secgroup/README.md new file mode 100644 index 00000000..360da3da --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_secgroup` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_secgroup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup). diff --git a/src/constructs/providers/huaweicloud/networking-secgroup/index.ts b/src/constructs/providers/huaweicloud/networking-secgroup/index.ts new file mode 100644 index 00000000..4b59c32b --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-secgroup/index.ts @@ -0,0 +1,556 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingSecgroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#delete_default_rules NetworkingSecgroup#delete_default_rules} + */ + readonly deleteDefaultRules?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#description NetworkingSecgroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#enterprise_project_id NetworkingSecgroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#id NetworkingSecgroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#name NetworkingSecgroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#region NetworkingSecgroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#tags NetworkingSecgroup#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#timeouts NetworkingSecgroup#timeouts} + */ + readonly timeouts?: NetworkingSecgroupTimeouts; +} +export interface NetworkingSecgroupRules { +} + +export function networkingSecgroupRulesToTerraform(struct?: NetworkingSecgroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function networkingSecgroupRulesToHclTerraform(struct?: NetworkingSecgroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class NetworkingSecgroupRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingSecgroupRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSecgroupRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // action - computed: true, optional: false, required: false + public get action() { + return this.getStringAttribute('action'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // direction - computed: true, optional: false, required: false + public get direction() { + return this.getStringAttribute('direction'); + } + + // ethertype - computed: true, optional: false, required: false + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // port_range_max - computed: true, optional: false, required: false + public get portRangeMax() { + return this.getNumberAttribute('port_range_max'); + } + + // port_range_min - computed: true, optional: false, required: false + public get portRangeMin() { + return this.getNumberAttribute('port_range_min'); + } + + // ports - computed: true, optional: false, required: false + public get ports() { + return this.getStringAttribute('ports'); + } + + // priority - computed: true, optional: false, required: false + public get priority() { + return this.getNumberAttribute('priority'); + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // remote_address_group_id - computed: true, optional: false, required: false + public get remoteAddressGroupId() { + return this.getStringAttribute('remote_address_group_id'); + } + + // remote_group_id - computed: true, optional: false, required: false + public get remoteGroupId() { + return this.getStringAttribute('remote_group_id'); + } + + // remote_ip_prefix - computed: true, optional: false, required: false + public get remoteIpPrefix() { + return this.getStringAttribute('remote_ip_prefix'); + } +} + +export class NetworkingSecgroupRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingSecgroupRulesOutputReference { + return new NetworkingSecgroupRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingSecgroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#delete NetworkingSecgroup#delete} + */ + readonly delete?: string; +} + +export function networkingSecgroupTimeoutsToTerraform(struct?: NetworkingSecgroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingSecgroupTimeoutsToHclTerraform(struct?: NetworkingSecgroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSecgroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingSecgroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSecgroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._delete = value.delete; + } + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup huaweicloud_networking_secgroup} +*/ +export class NetworkingSecgroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_secgroup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingSecgroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingSecgroup to import + * @param importFromId The id of the existing NetworkingSecgroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingSecgroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_secgroup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_secgroup huaweicloud_networking_secgroup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingSecgroupConfig + */ + public constructor(scope: Construct, id: string, config: NetworkingSecgroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_secgroup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteDefaultRules = config.deleteDefaultRules; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delete_default_rules - computed: false, optional: true, required: false + private _deleteDefaultRules?: boolean | cdktf.IResolvable; + public get deleteDefaultRules() { + return this.getBooleanAttribute('delete_default_rules'); + } + public set deleteDefaultRules(value: boolean | cdktf.IResolvable) { + this._deleteDefaultRules = value; + } + public resetDeleteDefaultRules() { + this._deleteDefaultRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteDefaultRulesInput() { + return this._deleteDefaultRules; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new NetworkingSecgroupRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingSecgroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingSecgroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_default_rules: cdktf.booleanToTerraform(this._deleteDefaultRules), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: networkingSecgroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_default_rules: { + value: cdktf.booleanToHclTerraform(this._deleteDefaultRules), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: networkingSecgroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingSecgroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-subnet-v2/README.md b/src/constructs/providers/huaweicloud/networking-subnet-v2/README.md new file mode 100644 index 00000000..939f2619 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-subnet-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_subnet_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_subnet_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2). diff --git a/src/constructs/providers/huaweicloud/networking-subnet-v2/index.ts b/src/constructs/providers/huaweicloud/networking-subnet-v2/index.ts new file mode 100644 index 00000000..44dbfc11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-subnet-v2/index.ts @@ -0,0 +1,977 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingSubnetV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#cidr NetworkingSubnetV2#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#dns_nameservers NetworkingSubnetV2#dns_nameservers} + */ + readonly dnsNameservers?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#enable_dhcp NetworkingSubnetV2#enable_dhcp} + */ + readonly enableDhcp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#gateway_ip NetworkingSubnetV2#gateway_ip} + */ + readonly gatewayIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#id NetworkingSubnetV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#ip_version NetworkingSubnetV2#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#ipv6_address_mode NetworkingSubnetV2#ipv6_address_mode} + */ + readonly ipv6AddressMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#ipv6_ra_mode NetworkingSubnetV2#ipv6_ra_mode} + */ + readonly ipv6RaMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#name NetworkingSubnetV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#network_id NetworkingSubnetV2#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#no_gateway NetworkingSubnetV2#no_gateway} + */ + readonly noGateway?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#region NetworkingSubnetV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#tenant_id NetworkingSubnetV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#value_specs NetworkingSubnetV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * allocation_pools block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#allocation_pools NetworkingSubnetV2#allocation_pools} + */ + readonly allocationPools?: NetworkingSubnetV2AllocationPools[] | cdktf.IResolvable; + /** + * host_routes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#host_routes NetworkingSubnetV2#host_routes} + */ + readonly hostRoutes?: NetworkingSubnetV2HostRoutes[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#timeouts NetworkingSubnetV2#timeouts} + */ + readonly timeouts?: NetworkingSubnetV2Timeouts; +} +export interface NetworkingSubnetV2AllocationPools { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#end NetworkingSubnetV2#end} + */ + readonly end: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#start NetworkingSubnetV2#start} + */ + readonly start: string; +} + +export function networkingSubnetV2AllocationPoolsToTerraform(struct?: NetworkingSubnetV2AllocationPools | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end: cdktf.stringToTerraform(struct!.end), + start: cdktf.stringToTerraform(struct!.start), + } +} + + +export function networkingSubnetV2AllocationPoolsToHclTerraform(struct?: NetworkingSubnetV2AllocationPools | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end: { + value: cdktf.stringToHclTerraform(struct!.end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start: { + value: cdktf.stringToHclTerraform(struct!.start), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSubnetV2AllocationPoolsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingSubnetV2AllocationPools | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._end !== undefined) { + hasAnyValues = true; + internalValueResult.end = this._end; + } + if (this._start !== undefined) { + hasAnyValues = true; + internalValueResult.start = this._start; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSubnetV2AllocationPools | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._end = undefined; + this._start = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._end = value.end; + this._start = value.start; + } + } + + // end - computed: false, optional: false, required: true + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // start - computed: false, optional: false, required: true + private _start?: string; + public get start() { + return this.getStringAttribute('start'); + } + public set start(value: string) { + this._start = value; + } + // Temporarily expose input value. Use with caution. + public get startInput() { + return this._start; + } +} + +export class NetworkingSubnetV2AllocationPoolsList extends cdktf.ComplexList { + public internalValue? : NetworkingSubnetV2AllocationPools[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingSubnetV2AllocationPoolsOutputReference { + return new NetworkingSubnetV2AllocationPoolsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingSubnetV2HostRoutes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#destination_cidr NetworkingSubnetV2#destination_cidr} + */ + readonly destinationCidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#next_hop NetworkingSubnetV2#next_hop} + */ + readonly nextHop: string; +} + +export function networkingSubnetV2HostRoutesToTerraform(struct?: NetworkingSubnetV2HostRoutes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + destination_cidr: cdktf.stringToTerraform(struct!.destinationCidr), + next_hop: cdktf.stringToTerraform(struct!.nextHop), + } +} + + +export function networkingSubnetV2HostRoutesToHclTerraform(struct?: NetworkingSubnetV2HostRoutes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + destination_cidr: { + value: cdktf.stringToHclTerraform(struct!.destinationCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + next_hop: { + value: cdktf.stringToHclTerraform(struct!.nextHop), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSubnetV2HostRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): NetworkingSubnetV2HostRoutes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destinationCidr !== undefined) { + hasAnyValues = true; + internalValueResult.destinationCidr = this._destinationCidr; + } + if (this._nextHop !== undefined) { + hasAnyValues = true; + internalValueResult.nextHop = this._nextHop; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSubnetV2HostRoutes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destinationCidr = undefined; + this._nextHop = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destinationCidr = value.destinationCidr; + this._nextHop = value.nextHop; + } + } + + // destination_cidr - computed: false, optional: false, required: true + private _destinationCidr?: string; + public get destinationCidr() { + return this.getStringAttribute('destination_cidr'); + } + public set destinationCidr(value: string) { + this._destinationCidr = value; + } + // Temporarily expose input value. Use with caution. + public get destinationCidrInput() { + return this._destinationCidr; + } + + // next_hop - computed: false, optional: false, required: true + private _nextHop?: string; + public get nextHop() { + return this.getStringAttribute('next_hop'); + } + public set nextHop(value: string) { + this._nextHop = value; + } + // Temporarily expose input value. Use with caution. + public get nextHopInput() { + return this._nextHop; + } +} + +export class NetworkingSubnetV2HostRoutesList extends cdktf.ComplexList { + public internalValue? : NetworkingSubnetV2HostRoutes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): NetworkingSubnetV2HostRoutesOutputReference { + return new NetworkingSubnetV2HostRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface NetworkingSubnetV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#create NetworkingSubnetV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#delete NetworkingSubnetV2#delete} + */ + readonly delete?: string; +} + +export function networkingSubnetV2TimeoutsToTerraform(struct?: NetworkingSubnetV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingSubnetV2TimeoutsToHclTerraform(struct?: NetworkingSubnetV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingSubnetV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingSubnetV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingSubnetV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2 huaweicloud_networking_subnet_v2} +*/ +export class NetworkingSubnetV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_subnet_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingSubnetV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingSubnetV2 to import + * @param importFromId The id of the existing NetworkingSubnetV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingSubnetV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_subnet_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_subnet_v2 huaweicloud_networking_subnet_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingSubnetV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingSubnetV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_subnet_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._dnsNameservers = config.dnsNameservers; + this._enableDhcp = config.enableDhcp; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._ipv6AddressMode = config.ipv6AddressMode; + this._ipv6RaMode = config.ipv6RaMode; + this._name = config.name; + this._networkId = config.networkId; + this._noGateway = config.noGateway; + this._region = config.region; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._allocationPools.internalValue = config.allocationPools; + this._hostRoutes.internalValue = config.hostRoutes; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // dns_nameservers - computed: false, optional: true, required: false + private _dnsNameservers?: string[]; + public get dnsNameservers() { + return cdktf.Fn.tolist(this.getListAttribute('dns_nameservers')); + } + public set dnsNameservers(value: string[]) { + this._dnsNameservers = value; + } + public resetDnsNameservers() { + this._dnsNameservers = undefined; + } + // Temporarily expose input value. Use with caution. + public get dnsNameserversInput() { + return this._dnsNameservers; + } + + // enable_dhcp - computed: false, optional: true, required: false + private _enableDhcp?: boolean | cdktf.IResolvable; + public get enableDhcp() { + return this.getBooleanAttribute('enable_dhcp'); + } + public set enableDhcp(value: boolean | cdktf.IResolvable) { + this._enableDhcp = value; + } + public resetEnableDhcp() { + this._enableDhcp = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDhcpInput() { + return this._enableDhcp; + } + + // gateway_ip - computed: true, optional: true, required: false + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + public resetGatewayIp() { + this._gatewayIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // ipv6_address_mode - computed: true, optional: true, required: false + private _ipv6AddressMode?: string; + public get ipv6AddressMode() { + return this.getStringAttribute('ipv6_address_mode'); + } + public set ipv6AddressMode(value: string) { + this._ipv6AddressMode = value; + } + public resetIpv6AddressMode() { + this._ipv6AddressMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6AddressModeInput() { + return this._ipv6AddressMode; + } + + // ipv6_ra_mode - computed: true, optional: true, required: false + private _ipv6RaMode?: string; + public get ipv6RaMode() { + return this.getStringAttribute('ipv6_ra_mode'); + } + public set ipv6RaMode(value: string) { + this._ipv6RaMode = value; + } + public resetIpv6RaMode() { + this._ipv6RaMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6RaModeInput() { + return this._ipv6RaMode; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // no_gateway - computed: false, optional: true, required: false + private _noGateway?: boolean | cdktf.IResolvable; + public get noGateway() { + return this.getBooleanAttribute('no_gateway'); + } + public set noGateway(value: boolean | cdktf.IResolvable) { + this._noGateway = value; + } + public resetNoGateway() { + this._noGateway = undefined; + } + // Temporarily expose input value. Use with caution. + public get noGatewayInput() { + return this._noGateway; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // allocation_pools - computed: false, optional: true, required: false + private _allocationPools = new NetworkingSubnetV2AllocationPoolsList(this, "allocation_pools", false); + public get allocationPools() { + return this._allocationPools; + } + public putAllocationPools(value: NetworkingSubnetV2AllocationPools[] | cdktf.IResolvable) { + this._allocationPools.internalValue = value; + } + public resetAllocationPools() { + this._allocationPools.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get allocationPoolsInput() { + return this._allocationPools.internalValue; + } + + // host_routes - computed: false, optional: true, required: false + private _hostRoutes = new NetworkingSubnetV2HostRoutesList(this, "host_routes", false); + public get hostRoutes() { + return this._hostRoutes; + } + public putHostRoutes(value: NetworkingSubnetV2HostRoutes[] | cdktf.IResolvable) { + this._hostRoutes.internalValue = value; + } + public resetHostRoutes() { + this._hostRoutes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostRoutesInput() { + return this._hostRoutes.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingSubnetV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingSubnetV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + dns_nameservers: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dnsNameservers), + enable_dhcp: cdktf.booleanToTerraform(this._enableDhcp), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + ipv6_address_mode: cdktf.stringToTerraform(this._ipv6AddressMode), + ipv6_ra_mode: cdktf.stringToTerraform(this._ipv6RaMode), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + no_gateway: cdktf.booleanToTerraform(this._noGateway), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + allocation_pools: cdktf.listMapper(networkingSubnetV2AllocationPoolsToTerraform, true)(this._allocationPools.internalValue), + host_routes: cdktf.listMapper(networkingSubnetV2HostRoutesToTerraform, true)(this._hostRoutes.internalValue), + timeouts: networkingSubnetV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dns_nameservers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dnsNameservers), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + enable_dhcp: { + value: cdktf.booleanToHclTerraform(this._enableDhcp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + ipv6_address_mode: { + value: cdktf.stringToHclTerraform(this._ipv6AddressMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_ra_mode: { + value: cdktf.stringToHclTerraform(this._ipv6RaMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + no_gateway: { + value: cdktf.booleanToHclTerraform(this._noGateway), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + allocation_pools: { + value: cdktf.listMapperHcl(networkingSubnetV2AllocationPoolsToHclTerraform, true)(this._allocationPools.internalValue), + isBlock: true, + type: "list", + storageClassType: "NetworkingSubnetV2AllocationPoolsList", + }, + host_routes: { + value: cdktf.listMapperHcl(networkingSubnetV2HostRoutesToHclTerraform, true)(this._hostRoutes.internalValue), + isBlock: true, + type: "list", + storageClassType: "NetworkingSubnetV2HostRoutesList", + }, + timeouts: { + value: networkingSubnetV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingSubnetV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-vip-associate-v2/README.md b/src/constructs/providers/huaweicloud/networking-vip-associate-v2/README.md new file mode 100644 index 00000000..6244d434 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip-associate-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_vip_associate_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_vip_associate_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2). diff --git a/src/constructs/providers/huaweicloud/networking-vip-associate-v2/index.ts b/src/constructs/providers/huaweicloud/networking-vip-associate-v2/index.ts new file mode 100644 index 00000000..2eead871 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip-associate-v2/index.ts @@ -0,0 +1,209 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingVipAssociateV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2#id NetworkingVipAssociateV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2#port_ids NetworkingVipAssociateV2#port_ids} + */ + readonly portIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2#region NetworkingVipAssociateV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2#vip_id NetworkingVipAssociateV2#vip_id} + */ + readonly vipId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2 huaweicloud_networking_vip_associate_v2} +*/ +export class NetworkingVipAssociateV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_vip_associate_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingVipAssociateV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingVipAssociateV2 to import + * @param importFromId The id of the existing NetworkingVipAssociateV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingVipAssociateV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_vip_associate_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate_v2 huaweicloud_networking_vip_associate_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingVipAssociateV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingVipAssociateV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_vip_associate_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._portIds = config.portIds; + this._region = config.region; + this._vipId = config.vipId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_addresses - computed: true, optional: false, required: false + public get ipAddresses() { + return this.getListAttribute('ip_addresses'); + } + + // port_ids - computed: false, optional: false, required: true + private _portIds?: string[]; + public get portIds() { + return cdktf.Fn.tolist(this.getListAttribute('port_ids')); + } + public set portIds(value: string[]) { + this._portIds = value; + } + // Temporarily expose input value. Use with caution. + public get portIdsInput() { + return this._portIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vip_id - computed: false, optional: false, required: true + private _vipId?: string; + public get vipId() { + return this.getStringAttribute('vip_id'); + } + public set vipId(value: string) { + this._vipId = value; + } + // Temporarily expose input value. Use with caution. + public get vipIdInput() { + return this._vipId; + } + + // vip_ip_address - computed: true, optional: false, required: false + public get vipIpAddress() { + return this.getStringAttribute('vip_ip_address'); + } + + // vip_subnet_id - computed: true, optional: false, required: false + public get vipSubnetId() { + return this.getStringAttribute('vip_subnet_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + port_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._portIds), + region: cdktf.stringToTerraform(this._region), + vip_id: cdktf.stringToTerraform(this._vipId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._portIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_id: { + value: cdktf.stringToHclTerraform(this._vipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-vip-associate/README.md b/src/constructs/providers/huaweicloud/networking-vip-associate/README.md new file mode 100644 index 00000000..6bc7cd6b --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_vip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_vip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate). diff --git a/src/constructs/providers/huaweicloud/networking-vip-associate/index.ts b/src/constructs/providers/huaweicloud/networking-vip-associate/index.ts new file mode 100644 index 00000000..3a8b2ff8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip-associate/index.ts @@ -0,0 +1,209 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingVipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate#id NetworkingVipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate#port_ids NetworkingVipAssociate#port_ids} + */ + readonly portIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate#region NetworkingVipAssociate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate#vip_id NetworkingVipAssociate#vip_id} + */ + readonly vipId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate huaweicloud_networking_vip_associate} +*/ +export class NetworkingVipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_vip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingVipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingVipAssociate to import + * @param importFromId The id of the existing NetworkingVipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingVipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_vip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_associate huaweicloud_networking_vip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingVipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: NetworkingVipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_vip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._portIds = config.portIds; + this._region = config.region; + this._vipId = config.vipId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_addresses - computed: true, optional: false, required: false + public get ipAddresses() { + return this.getListAttribute('ip_addresses'); + } + + // port_ids - computed: false, optional: false, required: true + private _portIds?: string[]; + public get portIds() { + return cdktf.Fn.tolist(this.getListAttribute('port_ids')); + } + public set portIds(value: string[]) { + this._portIds = value; + } + // Temporarily expose input value. Use with caution. + public get portIdsInput() { + return this._portIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vip_id - computed: false, optional: false, required: true + private _vipId?: string; + public get vipId() { + return this.getStringAttribute('vip_id'); + } + public set vipId(value: string) { + this._vipId = value; + } + // Temporarily expose input value. Use with caution. + public get vipIdInput() { + return this._vipId; + } + + // vip_ip_address - computed: true, optional: false, required: false + public get vipIpAddress() { + return this.getStringAttribute('vip_ip_address'); + } + + // vip_subnet_id - computed: true, optional: false, required: false + public get vipSubnetId() { + return this.getStringAttribute('vip_subnet_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + port_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._portIds), + region: cdktf.stringToTerraform(this._region), + vip_id: cdktf.stringToTerraform(this._vipId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._portIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vip_id: { + value: cdktf.stringToHclTerraform(this._vipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-vip-v2/README.md b/src/constructs/providers/huaweicloud/networking-vip-v2/README.md new file mode 100644 index 00000000..22b689ec --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_vip_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_vip_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2). diff --git a/src/constructs/providers/huaweicloud/networking-vip-v2/index.ts b/src/constructs/providers/huaweicloud/networking-vip-v2/index.ts new file mode 100644 index 00000000..f60f5c68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip-v2/index.ts @@ -0,0 +1,453 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingVipV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#id NetworkingVipV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#ip_address NetworkingVipV2#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#ip_version NetworkingVipV2#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#name NetworkingVipV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#network_id NetworkingVipV2#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#region NetworkingVipV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#subnet_id NetworkingVipV2#subnet_id} + */ + readonly subnetId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#timeouts NetworkingVipV2#timeouts} + */ + readonly timeouts?: NetworkingVipV2Timeouts; +} +export interface NetworkingVipV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#create NetworkingVipV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#delete NetworkingVipV2#delete} + */ + readonly delete?: string; +} + +export function networkingVipV2TimeoutsToTerraform(struct?: NetworkingVipV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingVipV2TimeoutsToHclTerraform(struct?: NetworkingVipV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingVipV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingVipV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingVipV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2 huaweicloud_networking_vip_v2} +*/ +export class NetworkingVipV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_vip_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingVipV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingVipV2 to import + * @param importFromId The id of the existing NetworkingVipV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingVipV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_vip_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip_v2 huaweicloud_networking_vip_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingVipV2Config + */ + public constructor(scope: Construct, id: string, config: NetworkingVipV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_vip_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ipAddress = config.ipAddress; + this._ipVersion = config.ipVersion; + this._name = config.name; + this._networkId = config.networkId; + this._region = config.region; + this._subnetId = config.subnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // device_owner - computed: true, optional: false, required: false + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingVipV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingVipV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + ip_version: cdktf.numberToTerraform(this._ipVersion), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + timeouts: networkingVipV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: networkingVipV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingVipV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/networking-vip/README.md b/src/constructs/providers/huaweicloud/networking-vip/README.md new file mode 100644 index 00000000..c8c0e77a --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_networking_vip` + +Refer to the Terraform Registry for docs: [`huaweicloud_networking_vip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip). diff --git a/src/constructs/providers/huaweicloud/networking-vip/index.ts b/src/constructs/providers/huaweicloud/networking-vip/index.ts new file mode 100644 index 00000000..2e20730b --- /dev/null +++ b/src/constructs/providers/huaweicloud/networking-vip/index.ts @@ -0,0 +1,453 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface NetworkingVipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#id NetworkingVip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#ip_address NetworkingVip#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#ip_version NetworkingVip#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#name NetworkingVip#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#network_id NetworkingVip#network_id} + */ + readonly networkId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#region NetworkingVip#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#subnet_id NetworkingVip#subnet_id} + */ + readonly subnetId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#timeouts NetworkingVip#timeouts} + */ + readonly timeouts?: NetworkingVipTimeouts; +} +export interface NetworkingVipTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#create NetworkingVip#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#delete NetworkingVip#delete} + */ + readonly delete?: string; +} + +export function networkingVipTimeoutsToTerraform(struct?: NetworkingVipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function networkingVipTimeoutsToHclTerraform(struct?: NetworkingVipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class NetworkingVipTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): NetworkingVipTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: NetworkingVipTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip huaweicloud_networking_vip} +*/ +export class NetworkingVip extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_networking_vip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a NetworkingVip resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the NetworkingVip to import + * @param importFromId The id of the existing NetworkingVip that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the NetworkingVip to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_networking_vip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/networking_vip huaweicloud_networking_vip} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options NetworkingVipConfig + */ + public constructor(scope: Construct, id: string, config: NetworkingVipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_networking_vip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ipAddress = config.ipAddress; + this._ipVersion = config.ipVersion; + this._name = config.name; + this._networkId = config.networkId; + this._region = config.region; + this._subnetId = config.subnetId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // device_owner - computed: true, optional: false, required: false + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new NetworkingVipTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: NetworkingVipTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + ip_version: cdktf.numberToTerraform(this._ipVersion), + name: cdktf.stringToTerraform(this._name), + network_id: cdktf.stringToTerraform(this._networkId), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + timeouts: networkingVipTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: networkingVipTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "NetworkingVipTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/obs-bucket-acl/README.md b/src/constructs/providers/huaweicloud/obs-bucket-acl/README.md new file mode 100644 index 00000000..0814b920 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_obs_bucket_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_obs_bucket_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl). diff --git a/src/constructs/providers/huaweicloud/obs-bucket-acl/index.ts b/src/constructs/providers/huaweicloud/obs-bucket-acl/index.ts new file mode 100644 index 00000000..774f2feb --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-acl/index.ts @@ -0,0 +1,840 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ObsBucketAclConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the bucket to which to set the acl. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#bucket ObsBucketAcl#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#id ObsBucketAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#region ObsBucketAcl#region} + */ + readonly region?: string; + /** + * account_permission block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#account_permission ObsBucketAcl#account_permission} + */ + readonly accountPermission?: ObsBucketAclAccountPermission[] | cdktf.IResolvable; + /** + * log_delivery_user_permission block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#log_delivery_user_permission ObsBucketAcl#log_delivery_user_permission} + */ + readonly logDeliveryUserPermission?: ObsBucketAclLogDeliveryUserPermission; + /** + * owner_permission block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#owner_permission ObsBucketAcl#owner_permission} + */ + readonly ownerPermission?: ObsBucketAclOwnerPermission; + /** + * public_permission block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#public_permission ObsBucketAcl#public_permission} + */ + readonly publicPermission?: ObsBucketAclPublicPermission; +} +export interface ObsBucketAclAccountPermission { + /** + * Specifies the access to acl. Valid values are **READ_ACP** and **WRITE_ACP**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_acl ObsBucketAcl#access_to_acl} + */ + readonly accessToAcl?: string[]; + /** + * Specifies the access to bucket. Valid values are **READ** and **WRITE**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_bucket ObsBucketAcl#access_to_bucket} + */ + readonly accessToBucket?: string[]; + /** + * Specifies the account id to authorize. The account id cannot be the bucket owner, + * and must be unique. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#account_id ObsBucketAcl#account_id} + */ + readonly accountId: string; +} + +export function obsBucketAclAccountPermissionToTerraform(struct?: ObsBucketAclAccountPermission | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_to_acl: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToAcl), + access_to_bucket: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToBucket), + account_id: cdktf.stringToTerraform(struct!.accountId), + } +} + + +export function obsBucketAclAccountPermissionToHclTerraform(struct?: ObsBucketAclAccountPermission | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_to_acl: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToAcl), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_to_bucket: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToBucket), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + account_id: { + value: cdktf.stringToHclTerraform(struct!.accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketAclAccountPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketAclAccountPermission | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessToAcl !== undefined) { + hasAnyValues = true; + internalValueResult.accessToAcl = this._accessToAcl; + } + if (this._accessToBucket !== undefined) { + hasAnyValues = true; + internalValueResult.accessToBucket = this._accessToBucket; + } + if (this._accountId !== undefined) { + hasAnyValues = true; + internalValueResult.accountId = this._accountId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketAclAccountPermission | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accessToAcl = undefined; + this._accessToBucket = undefined; + this._accountId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accessToAcl = value.accessToAcl; + this._accessToBucket = value.accessToBucket; + this._accountId = value.accountId; + } + } + + // access_to_acl - computed: false, optional: true, required: false + private _accessToAcl?: string[]; + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + public set accessToAcl(value: string[]) { + this._accessToAcl = value; + } + public resetAccessToAcl() { + this._accessToAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToAclInput() { + return this._accessToAcl; + } + + // access_to_bucket - computed: false, optional: true, required: false + private _accessToBucket?: string[]; + public get accessToBucket() { + return this.getListAttribute('access_to_bucket'); + } + public set accessToBucket(value: string[]) { + this._accessToBucket = value; + } + public resetAccessToBucket() { + this._accessToBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToBucketInput() { + return this._accessToBucket; + } + + // account_id - computed: false, optional: false, required: true + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } +} + +export class ObsBucketAclAccountPermissionList extends cdktf.ComplexList { + public internalValue? : ObsBucketAclAccountPermission[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketAclAccountPermissionOutputReference { + return new ObsBucketAclAccountPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketAclLogDeliveryUserPermission { + /** + * Specifies the access to acl. Valid values are **READ_ACP** and **WRITE_ACP**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_acl ObsBucketAcl#access_to_acl} + */ + readonly accessToAcl?: string[]; + /** + * Specifies the access to bucket. Valid values are **READ** and **WRITE**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_bucket ObsBucketAcl#access_to_bucket} + */ + readonly accessToBucket?: string[]; +} + +export function obsBucketAclLogDeliveryUserPermissionToTerraform(struct?: ObsBucketAclLogDeliveryUserPermissionOutputReference | ObsBucketAclLogDeliveryUserPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_to_acl: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToAcl), + access_to_bucket: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToBucket), + } +} + + +export function obsBucketAclLogDeliveryUserPermissionToHclTerraform(struct?: ObsBucketAclLogDeliveryUserPermissionOutputReference | ObsBucketAclLogDeliveryUserPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_to_acl: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToAcl), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_to_bucket: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToBucket), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketAclLogDeliveryUserPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ObsBucketAclLogDeliveryUserPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessToAcl !== undefined) { + hasAnyValues = true; + internalValueResult.accessToAcl = this._accessToAcl; + } + if (this._accessToBucket !== undefined) { + hasAnyValues = true; + internalValueResult.accessToBucket = this._accessToBucket; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketAclLogDeliveryUserPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessToAcl = undefined; + this._accessToBucket = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessToAcl = value.accessToAcl; + this._accessToBucket = value.accessToBucket; + } + } + + // access_to_acl - computed: false, optional: true, required: false + private _accessToAcl?: string[]; + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + public set accessToAcl(value: string[]) { + this._accessToAcl = value; + } + public resetAccessToAcl() { + this._accessToAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToAclInput() { + return this._accessToAcl; + } + + // access_to_bucket - computed: false, optional: true, required: false + private _accessToBucket?: string[]; + public get accessToBucket() { + return this.getListAttribute('access_to_bucket'); + } + public set accessToBucket(value: string[]) { + this._accessToBucket = value; + } + public resetAccessToBucket() { + this._accessToBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToBucketInput() { + return this._accessToBucket; + } +} +export interface ObsBucketAclOwnerPermission { + /** + * Specifies the access to acl. Valid values are **READ_ACP** and **WRITE_ACP**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_acl ObsBucketAcl#access_to_acl} + */ + readonly accessToAcl?: string[]; + /** + * Specifies the access to bucket. Valid values are **READ** and **WRITE**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_bucket ObsBucketAcl#access_to_bucket} + */ + readonly accessToBucket?: string[]; +} + +export function obsBucketAclOwnerPermissionToTerraform(struct?: ObsBucketAclOwnerPermissionOutputReference | ObsBucketAclOwnerPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_to_acl: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToAcl), + access_to_bucket: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToBucket), + } +} + + +export function obsBucketAclOwnerPermissionToHclTerraform(struct?: ObsBucketAclOwnerPermissionOutputReference | ObsBucketAclOwnerPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_to_acl: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToAcl), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_to_bucket: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToBucket), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketAclOwnerPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ObsBucketAclOwnerPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessToAcl !== undefined) { + hasAnyValues = true; + internalValueResult.accessToAcl = this._accessToAcl; + } + if (this._accessToBucket !== undefined) { + hasAnyValues = true; + internalValueResult.accessToBucket = this._accessToBucket; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketAclOwnerPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessToAcl = undefined; + this._accessToBucket = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessToAcl = value.accessToAcl; + this._accessToBucket = value.accessToBucket; + } + } + + // access_to_acl - computed: false, optional: true, required: false + private _accessToAcl?: string[]; + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + public set accessToAcl(value: string[]) { + this._accessToAcl = value; + } + public resetAccessToAcl() { + this._accessToAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToAclInput() { + return this._accessToAcl; + } + + // access_to_bucket - computed: false, optional: true, required: false + private _accessToBucket?: string[]; + public get accessToBucket() { + return this.getListAttribute('access_to_bucket'); + } + public set accessToBucket(value: string[]) { + this._accessToBucket = value; + } + public resetAccessToBucket() { + this._accessToBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToBucketInput() { + return this._accessToBucket; + } +} +export interface ObsBucketAclPublicPermission { + /** + * Specifies the access to acl. Valid values are **READ_ACP** and **WRITE_ACP**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_acl ObsBucketAcl#access_to_acl} + */ + readonly accessToAcl?: string[]; + /** + * Specifies the access to bucket. Valid values are **READ** and **WRITE**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#access_to_bucket ObsBucketAcl#access_to_bucket} + */ + readonly accessToBucket?: string[]; +} + +export function obsBucketAclPublicPermissionToTerraform(struct?: ObsBucketAclPublicPermissionOutputReference | ObsBucketAclPublicPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_to_acl: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToAcl), + access_to_bucket: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToBucket), + } +} + + +export function obsBucketAclPublicPermissionToHclTerraform(struct?: ObsBucketAclPublicPermissionOutputReference | ObsBucketAclPublicPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_to_acl: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToAcl), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_to_bucket: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToBucket), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketAclPublicPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ObsBucketAclPublicPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessToAcl !== undefined) { + hasAnyValues = true; + internalValueResult.accessToAcl = this._accessToAcl; + } + if (this._accessToBucket !== undefined) { + hasAnyValues = true; + internalValueResult.accessToBucket = this._accessToBucket; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketAclPublicPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessToAcl = undefined; + this._accessToBucket = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessToAcl = value.accessToAcl; + this._accessToBucket = value.accessToBucket; + } + } + + // access_to_acl - computed: false, optional: true, required: false + private _accessToAcl?: string[]; + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + public set accessToAcl(value: string[]) { + this._accessToAcl = value; + } + public resetAccessToAcl() { + this._accessToAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToAclInput() { + return this._accessToAcl; + } + + // access_to_bucket - computed: false, optional: true, required: false + private _accessToBucket?: string[]; + public get accessToBucket() { + return this.getListAttribute('access_to_bucket'); + } + public set accessToBucket(value: string[]) { + this._accessToBucket = value; + } + public resetAccessToBucket() { + this._accessToBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToBucketInput() { + return this._accessToBucket; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl huaweicloud_obs_bucket_acl} +*/ +export class ObsBucketAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ObsBucketAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ObsBucketAcl to import + * @param importFromId The id of the existing ObsBucketAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ObsBucketAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_acl huaweicloud_obs_bucket_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ObsBucketAclConfig + */ + public constructor(scope: Construct, id: string, config: ObsBucketAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._id = config.id; + this._region = config.region; + this._accountPermission.internalValue = config.accountPermission; + this._logDeliveryUserPermission.internalValue = config.logDeliveryUserPermission; + this._ownerPermission.internalValue = config.ownerPermission; + this._publicPermission.internalValue = config.publicPermission; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // account_permission - computed: false, optional: true, required: false + private _accountPermission = new ObsBucketAclAccountPermissionList(this, "account_permission", true); + public get accountPermission() { + return this._accountPermission; + } + public putAccountPermission(value: ObsBucketAclAccountPermission[] | cdktf.IResolvable) { + this._accountPermission.internalValue = value; + } + public resetAccountPermission() { + this._accountPermission.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountPermissionInput() { + return this._accountPermission.internalValue; + } + + // log_delivery_user_permission - computed: false, optional: true, required: false + private _logDeliveryUserPermission = new ObsBucketAclLogDeliveryUserPermissionOutputReference(this, "log_delivery_user_permission"); + public get logDeliveryUserPermission() { + return this._logDeliveryUserPermission; + } + public putLogDeliveryUserPermission(value: ObsBucketAclLogDeliveryUserPermission) { + this._logDeliveryUserPermission.internalValue = value; + } + public resetLogDeliveryUserPermission() { + this._logDeliveryUserPermission.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logDeliveryUserPermissionInput() { + return this._logDeliveryUserPermission.internalValue; + } + + // owner_permission - computed: false, optional: true, required: false + private _ownerPermission = new ObsBucketAclOwnerPermissionOutputReference(this, "owner_permission"); + public get ownerPermission() { + return this._ownerPermission; + } + public putOwnerPermission(value: ObsBucketAclOwnerPermission) { + this._ownerPermission.internalValue = value; + } + public resetOwnerPermission() { + this._ownerPermission.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerPermissionInput() { + return this._ownerPermission.internalValue; + } + + // public_permission - computed: false, optional: true, required: false + private _publicPermission = new ObsBucketAclPublicPermissionOutputReference(this, "public_permission"); + public get publicPermission() { + return this._publicPermission; + } + public putPublicPermission(value: ObsBucketAclPublicPermission) { + this._publicPermission.internalValue = value; + } + public resetPublicPermission() { + this._publicPermission.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicPermissionInput() { + return this._publicPermission.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + account_permission: cdktf.listMapper(obsBucketAclAccountPermissionToTerraform, true)(this._accountPermission.internalValue), + log_delivery_user_permission: obsBucketAclLogDeliveryUserPermissionToTerraform(this._logDeliveryUserPermission.internalValue), + owner_permission: obsBucketAclOwnerPermissionToTerraform(this._ownerPermission.internalValue), + public_permission: obsBucketAclPublicPermissionToTerraform(this._publicPermission.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_permission: { + value: cdktf.listMapperHcl(obsBucketAclAccountPermissionToHclTerraform, true)(this._accountPermission.internalValue), + isBlock: true, + type: "set", + storageClassType: "ObsBucketAclAccountPermissionList", + }, + log_delivery_user_permission: { + value: obsBucketAclLogDeliveryUserPermissionToHclTerraform(this._logDeliveryUserPermission.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketAclLogDeliveryUserPermissionList", + }, + owner_permission: { + value: obsBucketAclOwnerPermissionToHclTerraform(this._ownerPermission.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketAclOwnerPermissionList", + }, + public_permission: { + value: obsBucketAclPublicPermissionToHclTerraform(this._publicPermission.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketAclPublicPermissionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/obs-bucket-object-acl/README.md b/src/constructs/providers/huaweicloud/obs-bucket-object-acl/README.md new file mode 100644 index 00000000..a829e666 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-object-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_obs_bucket_object_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_obs_bucket_object_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl). diff --git a/src/constructs/providers/huaweicloud/obs-bucket-object-acl/index.ts b/src/constructs/providers/huaweicloud/obs-bucket-object-acl/index.ts new file mode 100644 index 00000000..3e7211e7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-object-acl/index.ts @@ -0,0 +1,651 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ObsBucketObjectAclConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the bucket which the object belongs to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#bucket ObsBucketObjectAcl#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#id ObsBucketObjectAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the object to which to set the acl. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#key ObsBucketObjectAcl#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#region ObsBucketObjectAcl#region} + */ + readonly region?: string; + /** + * account_permission block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#account_permission ObsBucketObjectAcl#account_permission} + */ + readonly accountPermission?: ObsBucketObjectAclAccountPermission[] | cdktf.IResolvable; + /** + * public_permission block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#public_permission ObsBucketObjectAcl#public_permission} + */ + readonly publicPermission?: ObsBucketObjectAclPublicPermission; +} +export interface ObsBucketObjectAclOwnerPermission { +} + +export function obsBucketObjectAclOwnerPermissionToTerraform(struct?: ObsBucketObjectAclOwnerPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function obsBucketObjectAclOwnerPermissionToHclTerraform(struct?: ObsBucketObjectAclOwnerPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ObsBucketObjectAclOwnerPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketObjectAclOwnerPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketObjectAclOwnerPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_to_acl - computed: true, optional: false, required: false + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + + // access_to_object - computed: true, optional: false, required: false + public get accessToObject() { + return this.getListAttribute('access_to_object'); + } +} + +export class ObsBucketObjectAclOwnerPermissionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketObjectAclOwnerPermissionOutputReference { + return new ObsBucketObjectAclOwnerPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketObjectAclAccountPermission { + /** + * Specifies the access to acl. Valid values are **READ_ACP** and **WRITE_ACP**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#access_to_acl ObsBucketObjectAcl#access_to_acl} + */ + readonly accessToAcl?: string[]; + /** + * Specifies the access to object. Only **READ** supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#access_to_object ObsBucketObjectAcl#access_to_object} + */ + readonly accessToObject?: string[]; + /** + * Specifies the account id to authorize. The account id cannot be the object owner, + * and must be unique. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#account_id ObsBucketObjectAcl#account_id} + */ + readonly accountId: string; +} + +export function obsBucketObjectAclAccountPermissionToTerraform(struct?: ObsBucketObjectAclAccountPermission | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_to_acl: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToAcl), + access_to_object: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToObject), + account_id: cdktf.stringToTerraform(struct!.accountId), + } +} + + +export function obsBucketObjectAclAccountPermissionToHclTerraform(struct?: ObsBucketObjectAclAccountPermission | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_to_acl: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToAcl), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_to_object: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToObject), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + account_id: { + value: cdktf.stringToHclTerraform(struct!.accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketObjectAclAccountPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketObjectAclAccountPermission | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessToAcl !== undefined) { + hasAnyValues = true; + internalValueResult.accessToAcl = this._accessToAcl; + } + if (this._accessToObject !== undefined) { + hasAnyValues = true; + internalValueResult.accessToObject = this._accessToObject; + } + if (this._accountId !== undefined) { + hasAnyValues = true; + internalValueResult.accountId = this._accountId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketObjectAclAccountPermission | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accessToAcl = undefined; + this._accessToObject = undefined; + this._accountId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accessToAcl = value.accessToAcl; + this._accessToObject = value.accessToObject; + this._accountId = value.accountId; + } + } + + // access_to_acl - computed: false, optional: true, required: false + private _accessToAcl?: string[]; + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + public set accessToAcl(value: string[]) { + this._accessToAcl = value; + } + public resetAccessToAcl() { + this._accessToAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToAclInput() { + return this._accessToAcl; + } + + // access_to_object - computed: false, optional: true, required: false + private _accessToObject?: string[]; + public get accessToObject() { + return this.getListAttribute('access_to_object'); + } + public set accessToObject(value: string[]) { + this._accessToObject = value; + } + public resetAccessToObject() { + this._accessToObject = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToObjectInput() { + return this._accessToObject; + } + + // account_id - computed: false, optional: false, required: true + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } +} + +export class ObsBucketObjectAclAccountPermissionList extends cdktf.ComplexList { + public internalValue? : ObsBucketObjectAclAccountPermission[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketObjectAclAccountPermissionOutputReference { + return new ObsBucketObjectAclAccountPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketObjectAclPublicPermission { + /** + * Specifies the access to acl. Valid values are **READ_ACP** and **WRITE_ACP**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#access_to_acl ObsBucketObjectAcl#access_to_acl} + */ + readonly accessToAcl?: string[]; + /** + * Specifies the access to object. Only **READ** supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#access_to_object ObsBucketObjectAcl#access_to_object} + */ + readonly accessToObject?: string[]; +} + +export function obsBucketObjectAclPublicPermissionToTerraform(struct?: ObsBucketObjectAclPublicPermissionOutputReference | ObsBucketObjectAclPublicPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_to_acl: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToAcl), + access_to_object: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.accessToObject), + } +} + + +export function obsBucketObjectAclPublicPermissionToHclTerraform(struct?: ObsBucketObjectAclPublicPermissionOutputReference | ObsBucketObjectAclPublicPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_to_acl: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToAcl), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + access_to_object: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.accessToObject), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketObjectAclPublicPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ObsBucketObjectAclPublicPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessToAcl !== undefined) { + hasAnyValues = true; + internalValueResult.accessToAcl = this._accessToAcl; + } + if (this._accessToObject !== undefined) { + hasAnyValues = true; + internalValueResult.accessToObject = this._accessToObject; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketObjectAclPublicPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessToAcl = undefined; + this._accessToObject = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessToAcl = value.accessToAcl; + this._accessToObject = value.accessToObject; + } + } + + // access_to_acl - computed: false, optional: true, required: false + private _accessToAcl?: string[]; + public get accessToAcl() { + return this.getListAttribute('access_to_acl'); + } + public set accessToAcl(value: string[]) { + this._accessToAcl = value; + } + public resetAccessToAcl() { + this._accessToAcl = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToAclInput() { + return this._accessToAcl; + } + + // access_to_object - computed: false, optional: true, required: false + private _accessToObject?: string[]; + public get accessToObject() { + return this.getListAttribute('access_to_object'); + } + public set accessToObject(value: string[]) { + this._accessToObject = value; + } + public resetAccessToObject() { + this._accessToObject = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToObjectInput() { + return this._accessToObject; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl huaweicloud_obs_bucket_object_acl} +*/ +export class ObsBucketObjectAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket_object_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ObsBucketObjectAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ObsBucketObjectAcl to import + * @param importFromId The id of the existing ObsBucketObjectAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ObsBucketObjectAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket_object_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object_acl huaweicloud_obs_bucket_object_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ObsBucketObjectAclConfig + */ + public constructor(scope: Construct, id: string, config: ObsBucketObjectAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket_object_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._id = config.id; + this._key = config.key; + this._region = config.region; + this._accountPermission.internalValue = config.accountPermission; + this._publicPermission.internalValue = config.publicPermission; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // owner_permission - computed: true, optional: false, required: false + private _ownerPermission = new ObsBucketObjectAclOwnerPermissionList(this, "owner_permission", false); + public get ownerPermission() { + return this._ownerPermission; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // account_permission - computed: false, optional: true, required: false + private _accountPermission = new ObsBucketObjectAclAccountPermissionList(this, "account_permission", true); + public get accountPermission() { + return this._accountPermission; + } + public putAccountPermission(value: ObsBucketObjectAclAccountPermission[] | cdktf.IResolvable) { + this._accountPermission.internalValue = value; + } + public resetAccountPermission() { + this._accountPermission.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountPermissionInput() { + return this._accountPermission.internalValue; + } + + // public_permission - computed: false, optional: true, required: false + private _publicPermission = new ObsBucketObjectAclPublicPermissionOutputReference(this, "public_permission"); + public get publicPermission() { + return this._publicPermission; + } + public putPublicPermission(value: ObsBucketObjectAclPublicPermission) { + this._publicPermission.internalValue = value; + } + public resetPublicPermission() { + this._publicPermission.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicPermissionInput() { + return this._publicPermission.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + id: cdktf.stringToTerraform(this._id), + key: cdktf.stringToTerraform(this._key), + region: cdktf.stringToTerraform(this._region), + account_permission: cdktf.listMapper(obsBucketObjectAclAccountPermissionToTerraform, true)(this._accountPermission.internalValue), + public_permission: obsBucketObjectAclPublicPermissionToTerraform(this._publicPermission.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + account_permission: { + value: cdktf.listMapperHcl(obsBucketObjectAclAccountPermissionToHclTerraform, true)(this._accountPermission.internalValue), + isBlock: true, + type: "set", + storageClassType: "ObsBucketObjectAclAccountPermissionList", + }, + public_permission: { + value: obsBucketObjectAclPublicPermissionToHclTerraform(this._publicPermission.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketObjectAclPublicPermissionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/obs-bucket-object/README.md b/src/constructs/providers/huaweicloud/obs-bucket-object/README.md new file mode 100644 index 00000000..208545f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-object/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_obs_bucket_object` + +Refer to the Terraform Registry for docs: [`huaweicloud_obs_bucket_object`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object). diff --git a/src/constructs/providers/huaweicloud/obs-bucket-object/index.ts b/src/constructs/providers/huaweicloud/obs-bucket-object/index.ts new file mode 100644 index 00000000..93863c5b --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-object/index.ts @@ -0,0 +1,428 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ObsBucketObjectConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#acl ObsBucketObject#acl} + */ + readonly acl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#bucket ObsBucketObject#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#content ObsBucketObject#content} + */ + readonly content?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#content_type ObsBucketObject#content_type} + */ + readonly contentType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#encryption ObsBucketObject#encryption} + */ + readonly encryption?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#etag ObsBucketObject#etag} + */ + readonly etag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#id ObsBucketObject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#key ObsBucketObject#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#kms_key_id ObsBucketObject#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#region ObsBucketObject#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#source ObsBucketObject#source} + */ + readonly source?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#storage_class ObsBucketObject#storage_class} + */ + readonly storageClass?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object huaweicloud_obs_bucket_object} +*/ +export class ObsBucketObject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket_object"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ObsBucketObject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ObsBucketObject to import + * @param importFromId The id of the existing ObsBucketObject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ObsBucketObject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket_object", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_object huaweicloud_obs_bucket_object} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ObsBucketObjectConfig + */ + public constructor(scope: Construct, id: string, config: ObsBucketObjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket_object', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._acl = config.acl; + this._bucket = config.bucket; + this._content = config.content; + this._contentType = config.contentType; + this._encryption = config.encryption; + this._etag = config.etag; + this._id = config.id; + this._key = config.key; + this._kmsKeyId = config.kmsKeyId; + this._region = config.region; + this._source = config.source; + this._storageClass = config.storageClass; + } + + // ========== + // ATTRIBUTES + // ========== + + // acl - computed: false, optional: true, required: false + private _acl?: string; + public get acl() { + return this.getStringAttribute('acl'); + } + public set acl(value: string) { + this._acl = value; + } + public resetAcl() { + this._acl = undefined; + } + // Temporarily expose input value. Use with caution. + public get aclInput() { + return this._acl; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // content_type - computed: true, optional: true, required: false + private _contentType?: string; + public get contentType() { + return this.getStringAttribute('content_type'); + } + public set contentType(value: string) { + this._contentType = value; + } + public resetContentType() { + this._contentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentTypeInput() { + return this._contentType; + } + + // encryption - computed: false, optional: true, required: false + private _encryption?: boolean | cdktf.IResolvable; + public get encryption() { + return this.getBooleanAttribute('encryption'); + } + public set encryption(value: boolean | cdktf.IResolvable) { + this._encryption = value; + } + public resetEncryption() { + this._encryption = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionInput() { + return this._encryption; + } + + // etag - computed: true, optional: true, required: false + private _etag?: string; + public get etag() { + return this.getStringAttribute('etag'); + } + public set etag(value: string) { + this._etag = value; + } + public resetEtag() { + this._etag = undefined; + } + // Temporarily expose input value. Use with caution. + public get etagInput() { + return this._etag; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // kms_key_id - computed: false, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // source - computed: false, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // storage_class - computed: true, optional: true, required: false + private _storageClass?: string; + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + public set storageClass(value: string) { + this._storageClass = value; + } + public resetStorageClass() { + this._storageClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageClassInput() { + return this._storageClass; + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + acl: cdktf.stringToTerraform(this._acl), + bucket: cdktf.stringToTerraform(this._bucket), + content: cdktf.stringToTerraform(this._content), + content_type: cdktf.stringToTerraform(this._contentType), + encryption: cdktf.booleanToTerraform(this._encryption), + etag: cdktf.stringToTerraform(this._etag), + id: cdktf.stringToTerraform(this._id), + key: cdktf.stringToTerraform(this._key), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + storage_class: cdktf.stringToTerraform(this._storageClass), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + acl: { + value: cdktf.stringToHclTerraform(this._acl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content_type: { + value: cdktf.stringToHclTerraform(this._contentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption: { + value: cdktf.booleanToHclTerraform(this._encryption), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + etag: { + value: cdktf.stringToHclTerraform(this._etag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_class: { + value: cdktf.stringToHclTerraform(this._storageClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/obs-bucket-policy/README.md b/src/constructs/providers/huaweicloud/obs-bucket-policy/README.md new file mode 100644 index 00000000..bb83e1cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_obs_bucket_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_obs_bucket_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy). diff --git a/src/constructs/providers/huaweicloud/obs-bucket-policy/index.ts b/src/constructs/providers/huaweicloud/obs-bucket-policy/index.ts new file mode 100644 index 00000000..f222cfe4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-policy/index.ts @@ -0,0 +1,222 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ObsBucketPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy#bucket ObsBucketPolicy#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy#id ObsBucketPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy#policy ObsBucketPolicy#policy} + */ + readonly policy: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy#policy_format ObsBucketPolicy#policy_format} + */ + readonly policyFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy#region ObsBucketPolicy#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy huaweicloud_obs_bucket_policy} +*/ +export class ObsBucketPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ObsBucketPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ObsBucketPolicy to import + * @param importFromId The id of the existing ObsBucketPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ObsBucketPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_policy huaweicloud_obs_bucket_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ObsBucketPolicyConfig + */ + public constructor(scope: Construct, id: string, config: ObsBucketPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bucket = config.bucket; + this._id = config.id; + this._policy = config.policy; + this._policyFormat = config.policyFormat; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy - computed: false, optional: false, required: true + private _policy?: string; + public get policy() { + return this.getStringAttribute('policy'); + } + public set policy(value: string) { + this._policy = value; + } + // Temporarily expose input value. Use with caution. + public get policyInput() { + return this._policy; + } + + // policy_format - computed: false, optional: true, required: false + private _policyFormat?: string; + public get policyFormat() { + return this.getStringAttribute('policy_format'); + } + public set policyFormat(value: string) { + this._policyFormat = value; + } + public resetPolicyFormat() { + this._policyFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyFormatInput() { + return this._policyFormat; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bucket: cdktf.stringToTerraform(this._bucket), + id: cdktf.stringToTerraform(this._id), + policy: cdktf.stringToTerraform(this._policy), + policy_format: cdktf.stringToTerraform(this._policyFormat), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy: { + value: cdktf.stringToHclTerraform(this._policy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_format: { + value: cdktf.stringToHclTerraform(this._policyFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/obs-bucket-replication/README.md b/src/constructs/providers/huaweicloud/obs-bucket-replication/README.md new file mode 100644 index 00000000..85501a7a --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-replication/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_obs_bucket_replication` + +Refer to the Terraform Registry for docs: [`huaweicloud_obs_bucket_replication`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication). diff --git a/src/constructs/providers/huaweicloud/obs-bucket-replication/index.ts b/src/constructs/providers/huaweicloud/obs-bucket-replication/index.ts new file mode 100644 index 00000000..a39a1d8f --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket-replication/index.ts @@ -0,0 +1,469 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ObsBucketReplicationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#agency ObsBucketReplication#agency} + */ + readonly agency: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#bucket ObsBucketReplication#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#destination_bucket ObsBucketReplication#destination_bucket} + */ + readonly destinationBucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#id ObsBucketReplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#region ObsBucketReplication#region} + */ + readonly region?: string; + /** + * rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#rule ObsBucketReplication#rule} + */ + readonly rule?: ObsBucketReplicationRule[] | cdktf.IResolvable; +} +export interface ObsBucketReplicationRule { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#enabled ObsBucketReplication#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#history_enabled ObsBucketReplication#history_enabled} + */ + readonly historyEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#prefix ObsBucketReplication#prefix} + */ + readonly prefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#storage_class ObsBucketReplication#storage_class} + */ + readonly storageClass?: string; +} + +export function obsBucketReplicationRuleToTerraform(struct?: ObsBucketReplicationRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + history_enabled: cdktf.booleanToTerraform(struct!.historyEnabled), + prefix: cdktf.stringToTerraform(struct!.prefix), + storage_class: cdktf.stringToTerraform(struct!.storageClass), + } +} + + +export function obsBucketReplicationRuleToHclTerraform(struct?: ObsBucketReplicationRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + history_enabled: { + value: cdktf.booleanToHclTerraform(struct!.historyEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + prefix: { + value: cdktf.stringToHclTerraform(struct!.prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_class: { + value: cdktf.stringToHclTerraform(struct!.storageClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketReplicationRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketReplicationRule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._historyEnabled !== undefined) { + hasAnyValues = true; + internalValueResult.historyEnabled = this._historyEnabled; + } + if (this._prefix !== undefined) { + hasAnyValues = true; + internalValueResult.prefix = this._prefix; + } + if (this._storageClass !== undefined) { + hasAnyValues = true; + internalValueResult.storageClass = this._storageClass; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketReplicationRule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._enabled = undefined; + this._historyEnabled = undefined; + this._prefix = undefined; + this._storageClass = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._enabled = value.enabled; + this._historyEnabled = value.historyEnabled; + this._prefix = value.prefix; + this._storageClass = value.storageClass; + } + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // history_enabled - computed: false, optional: true, required: false + private _historyEnabled?: boolean | cdktf.IResolvable; + public get historyEnabled() { + return this.getBooleanAttribute('history_enabled'); + } + public set historyEnabled(value: boolean | cdktf.IResolvable) { + this._historyEnabled = value; + } + public resetHistoryEnabled() { + this._historyEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get historyEnabledInput() { + return this._historyEnabled; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // prefix - computed: false, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // storage_class - computed: false, optional: true, required: false + private _storageClass?: string; + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + public set storageClass(value: string) { + this._storageClass = value; + } + public resetStorageClass() { + this._storageClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageClassInput() { + return this._storageClass; + } +} + +export class ObsBucketReplicationRuleList extends cdktf.ComplexList { + public internalValue? : ObsBucketReplicationRule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketReplicationRuleOutputReference { + return new ObsBucketReplicationRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication huaweicloud_obs_bucket_replication} +*/ +export class ObsBucketReplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket_replication"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ObsBucketReplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ObsBucketReplication to import + * @param importFromId The id of the existing ObsBucketReplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ObsBucketReplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket_replication", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket_replication huaweicloud_obs_bucket_replication} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ObsBucketReplicationConfig + */ + public constructor(scope: Construct, id: string, config: ObsBucketReplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket_replication', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agency = config.agency; + this._bucket = config.bucket; + this._destinationBucket = config.destinationBucket; + this._id = config.id; + this._region = config.region; + this._rule.internalValue = config.rule; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency - computed: false, optional: false, required: true + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // destination_bucket - computed: false, optional: false, required: true + private _destinationBucket?: string; + public get destinationBucket() { + return this.getStringAttribute('destination_bucket'); + } + public set destinationBucket(value: string) { + this._destinationBucket = value; + } + // Temporarily expose input value. Use with caution. + public get destinationBucketInput() { + return this._destinationBucket; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule - computed: false, optional: true, required: false + private _rule = new ObsBucketReplicationRuleList(this, "rule", false); + public get rule() { + return this._rule; + } + public putRule(value: ObsBucketReplicationRule[] | cdktf.IResolvable) { + this._rule.internalValue = value; + } + public resetRule() { + this._rule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleInput() { + return this._rule.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency: cdktf.stringToTerraform(this._agency), + bucket: cdktf.stringToTerraform(this._bucket), + destination_bucket: cdktf.stringToTerraform(this._destinationBucket), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + rule: cdktf.listMapper(obsBucketReplicationRuleToTerraform, true)(this._rule.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(this._agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_bucket: { + value: cdktf.stringToHclTerraform(this._destinationBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule: { + value: cdktf.listMapperHcl(obsBucketReplicationRuleToHclTerraform, true)(this._rule.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketReplicationRuleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/obs-bucket/README.md b/src/constructs/providers/huaweicloud/obs-bucket/README.md new file mode 100644 index 00000000..002d0439 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_obs_bucket` + +Refer to the Terraform Registry for docs: [`huaweicloud_obs_bucket`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket). diff --git a/src/constructs/providers/huaweicloud/obs-bucket/index.ts b/src/constructs/providers/huaweicloud/obs-bucket/index.ts new file mode 100644 index 00000000..f866dd43 --- /dev/null +++ b/src/constructs/providers/huaweicloud/obs-bucket/index.ts @@ -0,0 +1,2415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ObsBucketConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#acl ObsBucket#acl} + */ + readonly acl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#bucket ObsBucket#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#encryption ObsBucket#encryption} + */ + readonly encryption?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#enterprise_project_id ObsBucket#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#force_destroy ObsBucket#force_destroy} + */ + readonly forceDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#id ObsBucket#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#kms_key_id ObsBucket#kms_key_id} + */ + readonly kmsKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#kms_key_project_id ObsBucket#kms_key_project_id} + */ + readonly kmsKeyProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#multi_az ObsBucket#multi_az} + */ + readonly multiAz?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#parallel_fs ObsBucket#parallel_fs} + */ + readonly parallelFs?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#policy ObsBucket#policy} + */ + readonly policy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#policy_format ObsBucket#policy_format} + */ + readonly policyFormat?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#quota ObsBucket#quota} + */ + readonly quota?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#region ObsBucket#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#sse_algorithm ObsBucket#sse_algorithm} + */ + readonly sseAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#storage_class ObsBucket#storage_class} + */ + readonly storageClass?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#tags ObsBucket#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#user_domain_names ObsBucket#user_domain_names} + */ + readonly userDomainNames?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#versioning ObsBucket#versioning} + */ + readonly versioning?: boolean | cdktf.IResolvable; + /** + * cors_rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#cors_rule ObsBucket#cors_rule} + */ + readonly corsRule?: ObsBucketCorsRule[] | cdktf.IResolvable; + /** + * lifecycle_rule block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#lifecycle_rule ObsBucket#lifecycle_rule} + */ + readonly lifecycleRule?: ObsBucketLifecycleRule[] | cdktf.IResolvable; + /** + * logging block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#logging ObsBucket#logging} + */ + readonly logging?: ObsBucketLogging[] | cdktf.IResolvable; + /** + * website block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#website ObsBucket#website} + */ + readonly website?: ObsBucketWebsite; +} +export interface ObsBucketStorageInfo { +} + +export function obsBucketStorageInfoToTerraform(struct?: ObsBucketStorageInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function obsBucketStorageInfoToHclTerraform(struct?: ObsBucketStorageInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ObsBucketStorageInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketStorageInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketStorageInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // object_number - computed: true, optional: false, required: false + public get objectNumber() { + return this.getNumberAttribute('object_number'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } +} + +export class ObsBucketStorageInfoList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketStorageInfoOutputReference { + return new ObsBucketStorageInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketCorsRule { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#allowed_headers ObsBucket#allowed_headers} + */ + readonly allowedHeaders?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#allowed_methods ObsBucket#allowed_methods} + */ + readonly allowedMethods: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#allowed_origins ObsBucket#allowed_origins} + */ + readonly allowedOrigins: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#expose_headers ObsBucket#expose_headers} + */ + readonly exposeHeaders?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#max_age_seconds ObsBucket#max_age_seconds} + */ + readonly maxAgeSeconds?: number; +} + +export function obsBucketCorsRuleToTerraform(struct?: ObsBucketCorsRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + allowed_headers: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.allowedHeaders), + allowed_methods: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.allowedMethods), + allowed_origins: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.allowedOrigins), + expose_headers: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.exposeHeaders), + max_age_seconds: cdktf.numberToTerraform(struct!.maxAgeSeconds), + } +} + + +export function obsBucketCorsRuleToHclTerraform(struct?: ObsBucketCorsRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + allowed_headers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.allowedHeaders), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + allowed_methods: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.allowedMethods), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + allowed_origins: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.allowedOrigins), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + expose_headers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.exposeHeaders), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + max_age_seconds: { + value: cdktf.numberToHclTerraform(struct!.maxAgeSeconds), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketCorsRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketCorsRule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._allowedHeaders !== undefined) { + hasAnyValues = true; + internalValueResult.allowedHeaders = this._allowedHeaders; + } + if (this._allowedMethods !== undefined) { + hasAnyValues = true; + internalValueResult.allowedMethods = this._allowedMethods; + } + if (this._allowedOrigins !== undefined) { + hasAnyValues = true; + internalValueResult.allowedOrigins = this._allowedOrigins; + } + if (this._exposeHeaders !== undefined) { + hasAnyValues = true; + internalValueResult.exposeHeaders = this._exposeHeaders; + } + if (this._maxAgeSeconds !== undefined) { + hasAnyValues = true; + internalValueResult.maxAgeSeconds = this._maxAgeSeconds; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketCorsRule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._allowedHeaders = undefined; + this._allowedMethods = undefined; + this._allowedOrigins = undefined; + this._exposeHeaders = undefined; + this._maxAgeSeconds = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._allowedHeaders = value.allowedHeaders; + this._allowedMethods = value.allowedMethods; + this._allowedOrigins = value.allowedOrigins; + this._exposeHeaders = value.exposeHeaders; + this._maxAgeSeconds = value.maxAgeSeconds; + } + } + + // allowed_headers - computed: false, optional: true, required: false + private _allowedHeaders?: string[]; + public get allowedHeaders() { + return this.getListAttribute('allowed_headers'); + } + public set allowedHeaders(value: string[]) { + this._allowedHeaders = value; + } + public resetAllowedHeaders() { + this._allowedHeaders = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowedHeadersInput() { + return this._allowedHeaders; + } + + // allowed_methods - computed: false, optional: false, required: true + private _allowedMethods?: string[]; + public get allowedMethods() { + return this.getListAttribute('allowed_methods'); + } + public set allowedMethods(value: string[]) { + this._allowedMethods = value; + } + // Temporarily expose input value. Use with caution. + public get allowedMethodsInput() { + return this._allowedMethods; + } + + // allowed_origins - computed: false, optional: false, required: true + private _allowedOrigins?: string[]; + public get allowedOrigins() { + return this.getListAttribute('allowed_origins'); + } + public set allowedOrigins(value: string[]) { + this._allowedOrigins = value; + } + // Temporarily expose input value. Use with caution. + public get allowedOriginsInput() { + return this._allowedOrigins; + } + + // expose_headers - computed: false, optional: true, required: false + private _exposeHeaders?: string[]; + public get exposeHeaders() { + return this.getListAttribute('expose_headers'); + } + public set exposeHeaders(value: string[]) { + this._exposeHeaders = value; + } + public resetExposeHeaders() { + this._exposeHeaders = undefined; + } + // Temporarily expose input value. Use with caution. + public get exposeHeadersInput() { + return this._exposeHeaders; + } + + // max_age_seconds - computed: false, optional: true, required: false + private _maxAgeSeconds?: number; + public get maxAgeSeconds() { + return this.getNumberAttribute('max_age_seconds'); + } + public set maxAgeSeconds(value: number) { + this._maxAgeSeconds = value; + } + public resetMaxAgeSeconds() { + this._maxAgeSeconds = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxAgeSecondsInput() { + return this._maxAgeSeconds; + } +} + +export class ObsBucketCorsRuleList extends cdktf.ComplexList { + public internalValue? : ObsBucketCorsRule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketCorsRuleOutputReference { + return new ObsBucketCorsRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLifecycleRuleAbortIncompleteMultipartUpload { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#days ObsBucket#days} + */ + readonly days: number; +} + +export function obsBucketLifecycleRuleAbortIncompleteMultipartUploadToTerraform(struct?: ObsBucketLifecycleRuleAbortIncompleteMultipartUpload | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days: cdktf.numberToTerraform(struct!.days), + } +} + + +export function obsBucketLifecycleRuleAbortIncompleteMultipartUploadToHclTerraform(struct?: ObsBucketLifecycleRuleAbortIncompleteMultipartUpload | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days: { + value: cdktf.numberToHclTerraform(struct!.days), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLifecycleRuleAbortIncompleteMultipartUploadOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLifecycleRuleAbortIncompleteMultipartUpload | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._days !== undefined) { + hasAnyValues = true; + internalValueResult.days = this._days; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLifecycleRuleAbortIncompleteMultipartUpload | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._days = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._days = value.days; + } + } + + // days - computed: false, optional: false, required: true + private _days?: number; + public get days() { + return this.getNumberAttribute('days'); + } + public set days(value: number) { + this._days = value; + } + // Temporarily expose input value. Use with caution. + public get daysInput() { + return this._days; + } +} + +export class ObsBucketLifecycleRuleAbortIncompleteMultipartUploadList extends cdktf.ComplexList { + public internalValue? : ObsBucketLifecycleRuleAbortIncompleteMultipartUpload[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLifecycleRuleAbortIncompleteMultipartUploadOutputReference { + return new ObsBucketLifecycleRuleAbortIncompleteMultipartUploadOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLifecycleRuleExpiration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#days ObsBucket#days} + */ + readonly days: number; +} + +export function obsBucketLifecycleRuleExpirationToTerraform(struct?: ObsBucketLifecycleRuleExpiration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days: cdktf.numberToTerraform(struct!.days), + } +} + + +export function obsBucketLifecycleRuleExpirationToHclTerraform(struct?: ObsBucketLifecycleRuleExpiration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days: { + value: cdktf.numberToHclTerraform(struct!.days), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLifecycleRuleExpirationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLifecycleRuleExpiration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._days !== undefined) { + hasAnyValues = true; + internalValueResult.days = this._days; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLifecycleRuleExpiration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._days = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._days = value.days; + } + } + + // days - computed: false, optional: false, required: true + private _days?: number; + public get days() { + return this.getNumberAttribute('days'); + } + public set days(value: number) { + this._days = value; + } + // Temporarily expose input value. Use with caution. + public get daysInput() { + return this._days; + } +} + +export class ObsBucketLifecycleRuleExpirationList extends cdktf.ComplexList { + public internalValue? : ObsBucketLifecycleRuleExpiration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLifecycleRuleExpirationOutputReference { + return new ObsBucketLifecycleRuleExpirationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLifecycleRuleNoncurrentVersionExpiration { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#days ObsBucket#days} + */ + readonly days: number; +} + +export function obsBucketLifecycleRuleNoncurrentVersionExpirationToTerraform(struct?: ObsBucketLifecycleRuleNoncurrentVersionExpiration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days: cdktf.numberToTerraform(struct!.days), + } +} + + +export function obsBucketLifecycleRuleNoncurrentVersionExpirationToHclTerraform(struct?: ObsBucketLifecycleRuleNoncurrentVersionExpiration | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days: { + value: cdktf.numberToHclTerraform(struct!.days), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLifecycleRuleNoncurrentVersionExpirationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLifecycleRuleNoncurrentVersionExpiration | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._days !== undefined) { + hasAnyValues = true; + internalValueResult.days = this._days; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLifecycleRuleNoncurrentVersionExpiration | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._days = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._days = value.days; + } + } + + // days - computed: false, optional: false, required: true + private _days?: number; + public get days() { + return this.getNumberAttribute('days'); + } + public set days(value: number) { + this._days = value; + } + // Temporarily expose input value. Use with caution. + public get daysInput() { + return this._days; + } +} + +export class ObsBucketLifecycleRuleNoncurrentVersionExpirationList extends cdktf.ComplexList { + public internalValue? : ObsBucketLifecycleRuleNoncurrentVersionExpiration[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLifecycleRuleNoncurrentVersionExpirationOutputReference { + return new ObsBucketLifecycleRuleNoncurrentVersionExpirationOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLifecycleRuleNoncurrentVersionTransition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#days ObsBucket#days} + */ + readonly days: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#storage_class ObsBucket#storage_class} + */ + readonly storageClass: string; +} + +export function obsBucketLifecycleRuleNoncurrentVersionTransitionToTerraform(struct?: ObsBucketLifecycleRuleNoncurrentVersionTransition | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days: cdktf.numberToTerraform(struct!.days), + storage_class: cdktf.stringToTerraform(struct!.storageClass), + } +} + + +export function obsBucketLifecycleRuleNoncurrentVersionTransitionToHclTerraform(struct?: ObsBucketLifecycleRuleNoncurrentVersionTransition | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days: { + value: cdktf.numberToHclTerraform(struct!.days), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_class: { + value: cdktf.stringToHclTerraform(struct!.storageClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLifecycleRuleNoncurrentVersionTransitionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLifecycleRuleNoncurrentVersionTransition | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._days !== undefined) { + hasAnyValues = true; + internalValueResult.days = this._days; + } + if (this._storageClass !== undefined) { + hasAnyValues = true; + internalValueResult.storageClass = this._storageClass; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLifecycleRuleNoncurrentVersionTransition | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._days = undefined; + this._storageClass = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._days = value.days; + this._storageClass = value.storageClass; + } + } + + // days - computed: false, optional: false, required: true + private _days?: number; + public get days() { + return this.getNumberAttribute('days'); + } + public set days(value: number) { + this._days = value; + } + // Temporarily expose input value. Use with caution. + public get daysInput() { + return this._days; + } + + // storage_class - computed: false, optional: false, required: true + private _storageClass?: string; + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + public set storageClass(value: string) { + this._storageClass = value; + } + // Temporarily expose input value. Use with caution. + public get storageClassInput() { + return this._storageClass; + } +} + +export class ObsBucketLifecycleRuleNoncurrentVersionTransitionList extends cdktf.ComplexList { + public internalValue? : ObsBucketLifecycleRuleNoncurrentVersionTransition[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLifecycleRuleNoncurrentVersionTransitionOutputReference { + return new ObsBucketLifecycleRuleNoncurrentVersionTransitionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLifecycleRuleTransition { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#days ObsBucket#days} + */ + readonly days: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#storage_class ObsBucket#storage_class} + */ + readonly storageClass: string; +} + +export function obsBucketLifecycleRuleTransitionToTerraform(struct?: ObsBucketLifecycleRuleTransition | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + days: cdktf.numberToTerraform(struct!.days), + storage_class: cdktf.stringToTerraform(struct!.storageClass), + } +} + + +export function obsBucketLifecycleRuleTransitionToHclTerraform(struct?: ObsBucketLifecycleRuleTransition | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + days: { + value: cdktf.numberToHclTerraform(struct!.days), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + storage_class: { + value: cdktf.stringToHclTerraform(struct!.storageClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLifecycleRuleTransitionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLifecycleRuleTransition | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._days !== undefined) { + hasAnyValues = true; + internalValueResult.days = this._days; + } + if (this._storageClass !== undefined) { + hasAnyValues = true; + internalValueResult.storageClass = this._storageClass; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLifecycleRuleTransition | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._days = undefined; + this._storageClass = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._days = value.days; + this._storageClass = value.storageClass; + } + } + + // days - computed: false, optional: false, required: true + private _days?: number; + public get days() { + return this.getNumberAttribute('days'); + } + public set days(value: number) { + this._days = value; + } + // Temporarily expose input value. Use with caution. + public get daysInput() { + return this._days; + } + + // storage_class - computed: false, optional: false, required: true + private _storageClass?: string; + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + public set storageClass(value: string) { + this._storageClass = value; + } + // Temporarily expose input value. Use with caution. + public get storageClassInput() { + return this._storageClass; + } +} + +export class ObsBucketLifecycleRuleTransitionList extends cdktf.ComplexList { + public internalValue? : ObsBucketLifecycleRuleTransition[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLifecycleRuleTransitionOutputReference { + return new ObsBucketLifecycleRuleTransitionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLifecycleRule { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#enabled ObsBucket#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#name ObsBucket#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#prefix ObsBucket#prefix} + */ + readonly prefix?: string; + /** + * abort_incomplete_multipart_upload block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#abort_incomplete_multipart_upload ObsBucket#abort_incomplete_multipart_upload} + */ + readonly abortIncompleteMultipartUpload?: ObsBucketLifecycleRuleAbortIncompleteMultipartUpload[] | cdktf.IResolvable; + /** + * expiration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#expiration ObsBucket#expiration} + */ + readonly expiration?: ObsBucketLifecycleRuleExpiration[] | cdktf.IResolvable; + /** + * noncurrent_version_expiration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#noncurrent_version_expiration ObsBucket#noncurrent_version_expiration} + */ + readonly noncurrentVersionExpiration?: ObsBucketLifecycleRuleNoncurrentVersionExpiration[] | cdktf.IResolvable; + /** + * noncurrent_version_transition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#noncurrent_version_transition ObsBucket#noncurrent_version_transition} + */ + readonly noncurrentVersionTransition?: ObsBucketLifecycleRuleNoncurrentVersionTransition[] | cdktf.IResolvable; + /** + * transition block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#transition ObsBucket#transition} + */ + readonly transition?: ObsBucketLifecycleRuleTransition[] | cdktf.IResolvable; +} + +export function obsBucketLifecycleRuleToTerraform(struct?: ObsBucketLifecycleRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enabled: cdktf.booleanToTerraform(struct!.enabled), + name: cdktf.stringToTerraform(struct!.name), + prefix: cdktf.stringToTerraform(struct!.prefix), + abort_incomplete_multipart_upload: cdktf.listMapper(obsBucketLifecycleRuleAbortIncompleteMultipartUploadToTerraform, true)(struct!.abortIncompleteMultipartUpload), + expiration: cdktf.listMapper(obsBucketLifecycleRuleExpirationToTerraform, true)(struct!.expiration), + noncurrent_version_expiration: cdktf.listMapper(obsBucketLifecycleRuleNoncurrentVersionExpirationToTerraform, true)(struct!.noncurrentVersionExpiration), + noncurrent_version_transition: cdktf.listMapper(obsBucketLifecycleRuleNoncurrentVersionTransitionToTerraform, true)(struct!.noncurrentVersionTransition), + transition: cdktf.listMapper(obsBucketLifecycleRuleTransitionToTerraform, true)(struct!.transition), + } +} + + +export function obsBucketLifecycleRuleToHclTerraform(struct?: ObsBucketLifecycleRule | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(struct!.enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + prefix: { + value: cdktf.stringToHclTerraform(struct!.prefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + abort_incomplete_multipart_upload: { + value: cdktf.listMapperHcl(obsBucketLifecycleRuleAbortIncompleteMultipartUploadToHclTerraform, true)(struct!.abortIncompleteMultipartUpload), + isBlock: true, + type: "set", + storageClassType: "ObsBucketLifecycleRuleAbortIncompleteMultipartUploadList", + }, + expiration: { + value: cdktf.listMapperHcl(obsBucketLifecycleRuleExpirationToHclTerraform, true)(struct!.expiration), + isBlock: true, + type: "set", + storageClassType: "ObsBucketLifecycleRuleExpirationList", + }, + noncurrent_version_expiration: { + value: cdktf.listMapperHcl(obsBucketLifecycleRuleNoncurrentVersionExpirationToHclTerraform, true)(struct!.noncurrentVersionExpiration), + isBlock: true, + type: "set", + storageClassType: "ObsBucketLifecycleRuleNoncurrentVersionExpirationList", + }, + noncurrent_version_transition: { + value: cdktf.listMapperHcl(obsBucketLifecycleRuleNoncurrentVersionTransitionToHclTerraform, true)(struct!.noncurrentVersionTransition), + isBlock: true, + type: "list", + storageClassType: "ObsBucketLifecycleRuleNoncurrentVersionTransitionList", + }, + transition: { + value: cdktf.listMapperHcl(obsBucketLifecycleRuleTransitionToHclTerraform, true)(struct!.transition), + isBlock: true, + type: "list", + storageClassType: "ObsBucketLifecycleRuleTransitionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLifecycleRuleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLifecycleRule | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enabled !== undefined) { + hasAnyValues = true; + internalValueResult.enabled = this._enabled; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._prefix !== undefined) { + hasAnyValues = true; + internalValueResult.prefix = this._prefix; + } + if (this._abortIncompleteMultipartUpload?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.abortIncompleteMultipartUpload = this._abortIncompleteMultipartUpload?.internalValue; + } + if (this._expiration?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.expiration = this._expiration?.internalValue; + } + if (this._noncurrentVersionExpiration?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.noncurrentVersionExpiration = this._noncurrentVersionExpiration?.internalValue; + } + if (this._noncurrentVersionTransition?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.noncurrentVersionTransition = this._noncurrentVersionTransition?.internalValue; + } + if (this._transition?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.transition = this._transition?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLifecycleRule | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._enabled = undefined; + this._name = undefined; + this._prefix = undefined; + this._abortIncompleteMultipartUpload.internalValue = undefined; + this._expiration.internalValue = undefined; + this._noncurrentVersionExpiration.internalValue = undefined; + this._noncurrentVersionTransition.internalValue = undefined; + this._transition.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._enabled = value.enabled; + this._name = value.name; + this._prefix = value.prefix; + this._abortIncompleteMultipartUpload.internalValue = value.abortIncompleteMultipartUpload; + this._expiration.internalValue = value.expiration; + this._noncurrentVersionExpiration.internalValue = value.noncurrentVersionExpiration; + this._noncurrentVersionTransition.internalValue = value.noncurrentVersionTransition; + this._transition.internalValue = value.transition; + } + } + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // prefix - computed: false, optional: true, required: false + private _prefix?: string; + public get prefix() { + return this.getStringAttribute('prefix'); + } + public set prefix(value: string) { + this._prefix = value; + } + public resetPrefix() { + this._prefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get prefixInput() { + return this._prefix; + } + + // abort_incomplete_multipart_upload - computed: false, optional: true, required: false + private _abortIncompleteMultipartUpload = new ObsBucketLifecycleRuleAbortIncompleteMultipartUploadList(this, "abort_incomplete_multipart_upload", true); + public get abortIncompleteMultipartUpload() { + return this._abortIncompleteMultipartUpload; + } + public putAbortIncompleteMultipartUpload(value: ObsBucketLifecycleRuleAbortIncompleteMultipartUpload[] | cdktf.IResolvable) { + this._abortIncompleteMultipartUpload.internalValue = value; + } + public resetAbortIncompleteMultipartUpload() { + this._abortIncompleteMultipartUpload.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get abortIncompleteMultipartUploadInput() { + return this._abortIncompleteMultipartUpload.internalValue; + } + + // expiration - computed: false, optional: true, required: false + private _expiration = new ObsBucketLifecycleRuleExpirationList(this, "expiration", true); + public get expiration() { + return this._expiration; + } + public putExpiration(value: ObsBucketLifecycleRuleExpiration[] | cdktf.IResolvable) { + this._expiration.internalValue = value; + } + public resetExpiration() { + this._expiration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get expirationInput() { + return this._expiration.internalValue; + } + + // noncurrent_version_expiration - computed: false, optional: true, required: false + private _noncurrentVersionExpiration = new ObsBucketLifecycleRuleNoncurrentVersionExpirationList(this, "noncurrent_version_expiration", true); + public get noncurrentVersionExpiration() { + return this._noncurrentVersionExpiration; + } + public putNoncurrentVersionExpiration(value: ObsBucketLifecycleRuleNoncurrentVersionExpiration[] | cdktf.IResolvable) { + this._noncurrentVersionExpiration.internalValue = value; + } + public resetNoncurrentVersionExpiration() { + this._noncurrentVersionExpiration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get noncurrentVersionExpirationInput() { + return this._noncurrentVersionExpiration.internalValue; + } + + // noncurrent_version_transition - computed: false, optional: true, required: false + private _noncurrentVersionTransition = new ObsBucketLifecycleRuleNoncurrentVersionTransitionList(this, "noncurrent_version_transition", false); + public get noncurrentVersionTransition() { + return this._noncurrentVersionTransition; + } + public putNoncurrentVersionTransition(value: ObsBucketLifecycleRuleNoncurrentVersionTransition[] | cdktf.IResolvable) { + this._noncurrentVersionTransition.internalValue = value; + } + public resetNoncurrentVersionTransition() { + this._noncurrentVersionTransition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get noncurrentVersionTransitionInput() { + return this._noncurrentVersionTransition.internalValue; + } + + // transition - computed: false, optional: true, required: false + private _transition = new ObsBucketLifecycleRuleTransitionList(this, "transition", false); + public get transition() { + return this._transition; + } + public putTransition(value: ObsBucketLifecycleRuleTransition[] | cdktf.IResolvable) { + this._transition.internalValue = value; + } + public resetTransition() { + this._transition.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get transitionInput() { + return this._transition.internalValue; + } +} + +export class ObsBucketLifecycleRuleList extends cdktf.ComplexList { + public internalValue? : ObsBucketLifecycleRule[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLifecycleRuleOutputReference { + return new ObsBucketLifecycleRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketLogging { + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#agency ObsBucket#agency} + */ + readonly agency?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#target_bucket ObsBucket#target_bucket} + */ + readonly targetBucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#target_prefix ObsBucket#target_prefix} + */ + readonly targetPrefix?: string; +} + +export function obsBucketLoggingToTerraform(struct?: ObsBucketLogging | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency: cdktf.stringToTerraform(struct!.agency), + target_bucket: cdktf.stringToTerraform(struct!.targetBucket), + target_prefix: cdktf.stringToTerraform(struct!.targetPrefix), + } +} + + +export function obsBucketLoggingToHclTerraform(struct?: ObsBucketLogging | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency: { + value: cdktf.stringToHclTerraform(struct!.agency), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_bucket: { + value: cdktf.stringToHclTerraform(struct!.targetBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_prefix: { + value: cdktf.stringToHclTerraform(struct!.targetPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketLoggingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ObsBucketLogging | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agency !== undefined) { + hasAnyValues = true; + internalValueResult.agency = this._agency; + } + if (this._targetBucket !== undefined) { + hasAnyValues = true; + internalValueResult.targetBucket = this._targetBucket; + } + if (this._targetPrefix !== undefined) { + hasAnyValues = true; + internalValueResult.targetPrefix = this._targetPrefix; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketLogging | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._agency = undefined; + this._targetBucket = undefined; + this._targetPrefix = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._agency = value.agency; + this._targetBucket = value.targetBucket; + this._targetPrefix = value.targetPrefix; + } + } + + // agency - computed: true, optional: true, required: false + private _agency?: string; + public get agency() { + return this.getStringAttribute('agency'); + } + public set agency(value: string) { + this._agency = value; + } + public resetAgency() { + this._agency = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency; + } + + // target_bucket - computed: false, optional: false, required: true + private _targetBucket?: string; + public get targetBucket() { + return this.getStringAttribute('target_bucket'); + } + public set targetBucket(value: string) { + this._targetBucket = value; + } + // Temporarily expose input value. Use with caution. + public get targetBucketInput() { + return this._targetBucket; + } + + // target_prefix - computed: false, optional: true, required: false + private _targetPrefix?: string; + public get targetPrefix() { + return this.getStringAttribute('target_prefix'); + } + public set targetPrefix(value: string) { + this._targetPrefix = value; + } + public resetTargetPrefix() { + this._targetPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetPrefixInput() { + return this._targetPrefix; + } +} + +export class ObsBucketLoggingList extends cdktf.ComplexList { + public internalValue? : ObsBucketLogging[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ObsBucketLoggingOutputReference { + return new ObsBucketLoggingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ObsBucketWebsite { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#error_document ObsBucket#error_document} + */ + readonly errorDocument?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#index_document ObsBucket#index_document} + */ + readonly indexDocument?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#redirect_all_requests_to ObsBucket#redirect_all_requests_to} + */ + readonly redirectAllRequestsTo?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#routing_rules ObsBucket#routing_rules} + */ + readonly routingRules?: string; +} + +export function obsBucketWebsiteToTerraform(struct?: ObsBucketWebsiteOutputReference | ObsBucketWebsite): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + error_document: cdktf.stringToTerraform(struct!.errorDocument), + index_document: cdktf.stringToTerraform(struct!.indexDocument), + redirect_all_requests_to: cdktf.stringToTerraform(struct!.redirectAllRequestsTo), + routing_rules: cdktf.stringToTerraform(struct!.routingRules), + } +} + + +export function obsBucketWebsiteToHclTerraform(struct?: ObsBucketWebsiteOutputReference | ObsBucketWebsite): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + error_document: { + value: cdktf.stringToHclTerraform(struct!.errorDocument), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + index_document: { + value: cdktf.stringToHclTerraform(struct!.indexDocument), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + redirect_all_requests_to: { + value: cdktf.stringToHclTerraform(struct!.redirectAllRequestsTo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + routing_rules: { + value: cdktf.stringToHclTerraform(struct!.routingRules), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ObsBucketWebsiteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ObsBucketWebsite | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._errorDocument !== undefined) { + hasAnyValues = true; + internalValueResult.errorDocument = this._errorDocument; + } + if (this._indexDocument !== undefined) { + hasAnyValues = true; + internalValueResult.indexDocument = this._indexDocument; + } + if (this._redirectAllRequestsTo !== undefined) { + hasAnyValues = true; + internalValueResult.redirectAllRequestsTo = this._redirectAllRequestsTo; + } + if (this._routingRules !== undefined) { + hasAnyValues = true; + internalValueResult.routingRules = this._routingRules; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ObsBucketWebsite | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._errorDocument = undefined; + this._indexDocument = undefined; + this._redirectAllRequestsTo = undefined; + this._routingRules = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._errorDocument = value.errorDocument; + this._indexDocument = value.indexDocument; + this._redirectAllRequestsTo = value.redirectAllRequestsTo; + this._routingRules = value.routingRules; + } + } + + // error_document - computed: false, optional: true, required: false + private _errorDocument?: string; + public get errorDocument() { + return this.getStringAttribute('error_document'); + } + public set errorDocument(value: string) { + this._errorDocument = value; + } + public resetErrorDocument() { + this._errorDocument = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorDocumentInput() { + return this._errorDocument; + } + + // index_document - computed: false, optional: true, required: false + private _indexDocument?: string; + public get indexDocument() { + return this.getStringAttribute('index_document'); + } + public set indexDocument(value: string) { + this._indexDocument = value; + } + public resetIndexDocument() { + this._indexDocument = undefined; + } + // Temporarily expose input value. Use with caution. + public get indexDocumentInput() { + return this._indexDocument; + } + + // redirect_all_requests_to - computed: false, optional: true, required: false + private _redirectAllRequestsTo?: string; + public get redirectAllRequestsTo() { + return this.getStringAttribute('redirect_all_requests_to'); + } + public set redirectAllRequestsTo(value: string) { + this._redirectAllRequestsTo = value; + } + public resetRedirectAllRequestsTo() { + this._redirectAllRequestsTo = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectAllRequestsToInput() { + return this._redirectAllRequestsTo; + } + + // routing_rules - computed: false, optional: true, required: false + private _routingRules?: string; + public get routingRules() { + return this.getStringAttribute('routing_rules'); + } + public set routingRules(value: string) { + this._routingRules = value; + } + public resetRoutingRules() { + this._routingRules = undefined; + } + // Temporarily expose input value. Use with caution. + public get routingRulesInput() { + return this._routingRules; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket huaweicloud_obs_bucket} +*/ +export class ObsBucket extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_obs_bucket"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ObsBucket resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ObsBucket to import + * @param importFromId The id of the existing ObsBucket that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ObsBucket to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_obs_bucket", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/obs_bucket huaweicloud_obs_bucket} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ObsBucketConfig + */ + public constructor(scope: Construct, id: string, config: ObsBucketConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_obs_bucket', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._acl = config.acl; + this._bucket = config.bucket; + this._encryption = config.encryption; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forceDestroy = config.forceDestroy; + this._id = config.id; + this._kmsKeyId = config.kmsKeyId; + this._kmsKeyProjectId = config.kmsKeyProjectId; + this._multiAz = config.multiAz; + this._parallelFs = config.parallelFs; + this._policy = config.policy; + this._policyFormat = config.policyFormat; + this._quota = config.quota; + this._region = config.region; + this._sseAlgorithm = config.sseAlgorithm; + this._storageClass = config.storageClass; + this._tags = config.tags; + this._userDomainNames = config.userDomainNames; + this._versioning = config.versioning; + this._corsRule.internalValue = config.corsRule; + this._lifecycleRule.internalValue = config.lifecycleRule; + this._logging.internalValue = config.logging; + this._website.internalValue = config.website; + } + + // ========== + // ATTRIBUTES + // ========== + + // acl - computed: false, optional: true, required: false + private _acl?: string; + public get acl() { + return this.getStringAttribute('acl'); + } + public set acl(value: string) { + this._acl = value; + } + public resetAcl() { + this._acl = undefined; + } + // Temporarily expose input value. Use with caution. + public get aclInput() { + return this._acl; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // bucket_domain_name - computed: true, optional: false, required: false + public get bucketDomainName() { + return this.getStringAttribute('bucket_domain_name'); + } + + // bucket_version - computed: true, optional: false, required: false + public get bucketVersion() { + return this.getStringAttribute('bucket_version'); + } + + // encryption - computed: false, optional: true, required: false + private _encryption?: boolean | cdktf.IResolvable; + public get encryption() { + return this.getBooleanAttribute('encryption'); + } + public set encryption(value: boolean | cdktf.IResolvable) { + this._encryption = value; + } + public resetEncryption() { + this._encryption = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionInput() { + return this._encryption; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // force_destroy - computed: false, optional: true, required: false + private _forceDestroy?: boolean | cdktf.IResolvable; + public get forceDestroy() { + return this.getBooleanAttribute('force_destroy'); + } + public set forceDestroy(value: boolean | cdktf.IResolvable) { + this._forceDestroy = value; + } + public resetForceDestroy() { + this._forceDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDestroyInput() { + return this._forceDestroy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // kms_key_id - computed: false, optional: true, required: false + private _kmsKeyId?: string; + public get kmsKeyId() { + return this.getStringAttribute('kms_key_id'); + } + public set kmsKeyId(value: string) { + this._kmsKeyId = value; + } + public resetKmsKeyId() { + this._kmsKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyIdInput() { + return this._kmsKeyId; + } + + // kms_key_project_id - computed: true, optional: true, required: false + private _kmsKeyProjectId?: string; + public get kmsKeyProjectId() { + return this.getStringAttribute('kms_key_project_id'); + } + public set kmsKeyProjectId(value: string) { + this._kmsKeyProjectId = value; + } + public resetKmsKeyProjectId() { + this._kmsKeyProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get kmsKeyProjectIdInput() { + return this._kmsKeyProjectId; + } + + // multi_az - computed: true, optional: true, required: false + private _multiAz?: boolean | cdktf.IResolvable; + public get multiAz() { + return this.getBooleanAttribute('multi_az'); + } + public set multiAz(value: boolean | cdktf.IResolvable) { + this._multiAz = value; + } + public resetMultiAz() { + this._multiAz = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiAzInput() { + return this._multiAz; + } + + // parallel_fs - computed: false, optional: true, required: false + private _parallelFs?: boolean | cdktf.IResolvable; + public get parallelFs() { + return this.getBooleanAttribute('parallel_fs'); + } + public set parallelFs(value: boolean | cdktf.IResolvable) { + this._parallelFs = value; + } + public resetParallelFs() { + this._parallelFs = undefined; + } + // Temporarily expose input value. Use with caution. + public get parallelFsInput() { + return this._parallelFs; + } + + // policy - computed: true, optional: true, required: false + private _policy?: string; + public get policy() { + return this.getStringAttribute('policy'); + } + public set policy(value: string) { + this._policy = value; + } + public resetPolicy() { + this._policy = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyInput() { + return this._policy; + } + + // policy_format - computed: false, optional: true, required: false + private _policyFormat?: string; + public get policyFormat() { + return this.getStringAttribute('policy_format'); + } + public set policyFormat(value: string) { + this._policyFormat = value; + } + public resetPolicyFormat() { + this._policyFormat = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyFormatInput() { + return this._policyFormat; + } + + // quota - computed: false, optional: true, required: false + private _quota?: number; + public get quota() { + return this.getNumberAttribute('quota'); + } + public set quota(value: number) { + this._quota = value; + } + public resetQuota() { + this._quota = undefined; + } + // Temporarily expose input value. Use with caution. + public get quotaInput() { + return this._quota; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sse_algorithm - computed: true, optional: true, required: false + private _sseAlgorithm?: string; + public get sseAlgorithm() { + return this.getStringAttribute('sse_algorithm'); + } + public set sseAlgorithm(value: string) { + this._sseAlgorithm = value; + } + public resetSseAlgorithm() { + this._sseAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get sseAlgorithmInput() { + return this._sseAlgorithm; + } + + // storage_class - computed: false, optional: true, required: false + private _storageClass?: string; + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + public set storageClass(value: string) { + this._storageClass = value; + } + public resetStorageClass() { + this._storageClass = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageClassInput() { + return this._storageClass; + } + + // storage_info - computed: true, optional: false, required: false + private _storageInfo = new ObsBucketStorageInfoList(this, "storage_info", false); + public get storageInfo() { + return this._storageInfo; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // user_domain_names - computed: true, optional: true, required: false + private _userDomainNames?: string[]; + public get userDomainNames() { + return cdktf.Fn.tolist(this.getListAttribute('user_domain_names')); + } + public set userDomainNames(value: string[]) { + this._userDomainNames = value; + } + public resetUserDomainNames() { + this._userDomainNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get userDomainNamesInput() { + return this._userDomainNames; + } + + // versioning - computed: false, optional: true, required: false + private _versioning?: boolean | cdktf.IResolvable; + public get versioning() { + return this.getBooleanAttribute('versioning'); + } + public set versioning(value: boolean | cdktf.IResolvable) { + this._versioning = value; + } + public resetVersioning() { + this._versioning = undefined; + } + // Temporarily expose input value. Use with caution. + public get versioningInput() { + return this._versioning; + } + + // cors_rule - computed: false, optional: true, required: false + private _corsRule = new ObsBucketCorsRuleList(this, "cors_rule", false); + public get corsRule() { + return this._corsRule; + } + public putCorsRule(value: ObsBucketCorsRule[] | cdktf.IResolvable) { + this._corsRule.internalValue = value; + } + public resetCorsRule() { + this._corsRule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get corsRuleInput() { + return this._corsRule.internalValue; + } + + // lifecycle_rule - computed: false, optional: true, required: false + private _lifecycleRule = new ObsBucketLifecycleRuleList(this, "lifecycle_rule", false); + public get lifecycleRule() { + return this._lifecycleRule; + } + public putLifecycleRule(value: ObsBucketLifecycleRule[] | cdktf.IResolvable) { + this._lifecycleRule.internalValue = value; + } + public resetLifecycleRule() { + this._lifecycleRule.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifecycleRuleInput() { + return this._lifecycleRule.internalValue; + } + + // logging - computed: false, optional: true, required: false + private _logging = new ObsBucketLoggingList(this, "logging", true); + public get logging() { + return this._logging; + } + public putLogging(value: ObsBucketLogging[] | cdktf.IResolvable) { + this._logging.internalValue = value; + } + public resetLogging() { + this._logging.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get loggingInput() { + return this._logging.internalValue; + } + + // website - computed: false, optional: true, required: false + private _website = new ObsBucketWebsiteOutputReference(this, "website"); + public get website() { + return this._website; + } + public putWebsite(value: ObsBucketWebsite) { + this._website.internalValue = value; + } + public resetWebsite() { + this._website.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get websiteInput() { + return this._website.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + acl: cdktf.stringToTerraform(this._acl), + bucket: cdktf.stringToTerraform(this._bucket), + encryption: cdktf.booleanToTerraform(this._encryption), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + force_destroy: cdktf.booleanToTerraform(this._forceDestroy), + id: cdktf.stringToTerraform(this._id), + kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), + kms_key_project_id: cdktf.stringToTerraform(this._kmsKeyProjectId), + multi_az: cdktf.booleanToTerraform(this._multiAz), + parallel_fs: cdktf.booleanToTerraform(this._parallelFs), + policy: cdktf.stringToTerraform(this._policy), + policy_format: cdktf.stringToTerraform(this._policyFormat), + quota: cdktf.numberToTerraform(this._quota), + region: cdktf.stringToTerraform(this._region), + sse_algorithm: cdktf.stringToTerraform(this._sseAlgorithm), + storage_class: cdktf.stringToTerraform(this._storageClass), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_domain_names: cdktf.listMapper(cdktf.stringToTerraform, false)(this._userDomainNames), + versioning: cdktf.booleanToTerraform(this._versioning), + cors_rule: cdktf.listMapper(obsBucketCorsRuleToTerraform, true)(this._corsRule.internalValue), + lifecycle_rule: cdktf.listMapper(obsBucketLifecycleRuleToTerraform, true)(this._lifecycleRule.internalValue), + logging: cdktf.listMapper(obsBucketLoggingToTerraform, true)(this._logging.internalValue), + website: obsBucketWebsiteToTerraform(this._website.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + acl: { + value: cdktf.stringToHclTerraform(this._acl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(this._bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption: { + value: cdktf.booleanToHclTerraform(this._encryption), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_destroy: { + value: cdktf.booleanToHclTerraform(this._forceDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kms_key_project_id: { + value: cdktf.stringToHclTerraform(this._kmsKeyProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + multi_az: { + value: cdktf.booleanToHclTerraform(this._multiAz), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + parallel_fs: { + value: cdktf.booleanToHclTerraform(this._parallelFs), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + policy: { + value: cdktf.stringToHclTerraform(this._policy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_format: { + value: cdktf.stringToHclTerraform(this._policyFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + quota: { + value: cdktf.numberToHclTerraform(this._quota), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sse_algorithm: { + value: cdktf.stringToHclTerraform(this._sseAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_class: { + value: cdktf.stringToHclTerraform(this._storageClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_domain_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._userDomainNames), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + versioning: { + value: cdktf.booleanToHclTerraform(this._versioning), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + cors_rule: { + value: cdktf.listMapperHcl(obsBucketCorsRuleToHclTerraform, true)(this._corsRule.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketCorsRuleList", + }, + lifecycle_rule: { + value: cdktf.listMapperHcl(obsBucketLifecycleRuleToHclTerraform, true)(this._lifecycleRule.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketLifecycleRuleList", + }, + logging: { + value: cdktf.listMapperHcl(obsBucketLoggingToHclTerraform, true)(this._logging.internalValue), + isBlock: true, + type: "set", + storageClassType: "ObsBucketLoggingList", + }, + website: { + value: obsBucketWebsiteToHclTerraform(this._website.internalValue), + isBlock: true, + type: "list", + storageClassType: "ObsBucketWebsiteList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/oms-migration-sync-task/README.md b/src/constructs/providers/huaweicloud/oms-migration-sync-task/README.md new file mode 100644 index 00000000..d505f153 --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-migration-sync-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_oms_migration_sync_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_oms_migration_sync_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task). diff --git a/src/constructs/providers/huaweicloud/oms-migration-sync-task/index.ts b/src/constructs/providers/huaweicloud/oms-migration-sync-task/index.ts new file mode 100644 index 00000000..15aa68b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-migration-sync-task/index.ts @@ -0,0 +1,800 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OmsMigrationSyncTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#action OmsMigrationSyncTask#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#app_id OmsMigrationSyncTask#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#consistency_check OmsMigrationSyncTask#consistency_check} + */ + readonly consistencyCheck?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#description OmsMigrationSyncTask#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#dst_ak OmsMigrationSyncTask#dst_ak} + */ + readonly dstAk: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#dst_bucket OmsMigrationSyncTask#dst_bucket} + */ + readonly dstBucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#dst_sk OmsMigrationSyncTask#dst_sk} + */ + readonly dstSk: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#enable_kms OmsMigrationSyncTask#enable_kms} + */ + readonly enableKms?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#enable_metadata_migration OmsMigrationSyncTask#enable_metadata_migration} + */ + readonly enableMetadataMigration?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#enable_restore OmsMigrationSyncTask#enable_restore} + */ + readonly enableRestore?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#id OmsMigrationSyncTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#region OmsMigrationSyncTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#src_ak OmsMigrationSyncTask#src_ak} + */ + readonly srcAk: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#src_bucket OmsMigrationSyncTask#src_bucket} + */ + readonly srcBucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#src_cloud_type OmsMigrationSyncTask#src_cloud_type} + */ + readonly srcCloudType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#src_region OmsMigrationSyncTask#src_region} + */ + readonly srcRegion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#src_sk OmsMigrationSyncTask#src_sk} + */ + readonly srcSk: string; + /** + * source_cdn block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#source_cdn OmsMigrationSyncTask#source_cdn} + */ + readonly sourceCdn?: OmsMigrationSyncTaskSourceCdn; +} +export interface OmsMigrationSyncTaskSourceCdn { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#authentication_key OmsMigrationSyncTask#authentication_key} + */ + readonly authenticationKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#authentication_type OmsMigrationSyncTask#authentication_type} + */ + readonly authenticationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#domain OmsMigrationSyncTask#domain} + */ + readonly domain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#protocol OmsMigrationSyncTask#protocol} + */ + readonly protocol: string; +} + +export function omsMigrationSyncTaskSourceCdnToTerraform(struct?: OmsMigrationSyncTaskSourceCdnOutputReference | OmsMigrationSyncTaskSourceCdn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authentication_key: cdktf.stringToTerraform(struct!.authenticationKey), + authentication_type: cdktf.stringToTerraform(struct!.authenticationType), + domain: cdktf.stringToTerraform(struct!.domain), + protocol: cdktf.stringToTerraform(struct!.protocol), + } +} + + +export function omsMigrationSyncTaskSourceCdnToHclTerraform(struct?: OmsMigrationSyncTaskSourceCdnOutputReference | OmsMigrationSyncTaskSourceCdn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authentication_key: { + value: cdktf.stringToHclTerraform(struct!.authenticationKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication_type: { + value: cdktf.stringToHclTerraform(struct!.authenticationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(struct!.domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationSyncTaskSourceCdnOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationSyncTaskSourceCdn | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authenticationKey !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationKey = this._authenticationKey; + } + if (this._authenticationType !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationType = this._authenticationType; + } + if (this._domain !== undefined) { + hasAnyValues = true; + internalValueResult.domain = this._domain; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationSyncTaskSourceCdn | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authenticationKey = undefined; + this._authenticationType = undefined; + this._domain = undefined; + this._protocol = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authenticationKey = value.authenticationKey; + this._authenticationType = value.authenticationType; + this._domain = value.domain; + this._protocol = value.protocol; + } + } + + // authentication_key - computed: false, optional: true, required: false + private _authenticationKey?: string; + public get authenticationKey() { + return this.getStringAttribute('authentication_key'); + } + public set authenticationKey(value: string) { + this._authenticationKey = value; + } + public resetAuthenticationKey() { + this._authenticationKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationKeyInput() { + return this._authenticationKey; + } + + // authentication_type - computed: false, optional: true, required: false + private _authenticationType?: string; + public get authenticationType() { + return this.getStringAttribute('authentication_type'); + } + public set authenticationType(value: string) { + this._authenticationType = value; + } + public resetAuthenticationType() { + this._authenticationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationTypeInput() { + return this._authenticationType; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task huaweicloud_oms_migration_sync_task} +*/ +export class OmsMigrationSyncTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_oms_migration_sync_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OmsMigrationSyncTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OmsMigrationSyncTask to import + * @param importFromId The id of the existing OmsMigrationSyncTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OmsMigrationSyncTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_oms_migration_sync_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_sync_task huaweicloud_oms_migration_sync_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OmsMigrationSyncTaskConfig + */ + public constructor(scope: Construct, id: string, config: OmsMigrationSyncTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_oms_migration_sync_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._appId = config.appId; + this._consistencyCheck = config.consistencyCheck; + this._description = config.description; + this._dstAk = config.dstAk; + this._dstBucket = config.dstBucket; + this._dstSk = config.dstSk; + this._enableKms = config.enableKms; + this._enableMetadataMigration = config.enableMetadataMigration; + this._enableRestore = config.enableRestore; + this._id = config.id; + this._region = config.region; + this._srcAk = config.srcAk; + this._srcBucket = config.srcBucket; + this._srcCloudType = config.srcCloudType; + this._srcRegion = config.srcRegion; + this._srcSk = config.srcSk; + this._sourceCdn.internalValue = config.sourceCdn; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // consistency_check - computed: true, optional: true, required: false + private _consistencyCheck?: string; + public get consistencyCheck() { + return this.getStringAttribute('consistency_check'); + } + public set consistencyCheck(value: string) { + this._consistencyCheck = value; + } + public resetConsistencyCheck() { + this._consistencyCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistencyCheckInput() { + return this._consistencyCheck; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dst_ak - computed: false, optional: false, required: true + private _dstAk?: string; + public get dstAk() { + return this.getStringAttribute('dst_ak'); + } + public set dstAk(value: string) { + this._dstAk = value; + } + // Temporarily expose input value. Use with caution. + public get dstAkInput() { + return this._dstAk; + } + + // dst_bucket - computed: false, optional: false, required: true + private _dstBucket?: string; + public get dstBucket() { + return this.getStringAttribute('dst_bucket'); + } + public set dstBucket(value: string) { + this._dstBucket = value; + } + // Temporarily expose input value. Use with caution. + public get dstBucketInput() { + return this._dstBucket; + } + + // dst_sk - computed: false, optional: false, required: true + private _dstSk?: string; + public get dstSk() { + return this.getStringAttribute('dst_sk'); + } + public set dstSk(value: string) { + this._dstSk = value; + } + // Temporarily expose input value. Use with caution. + public get dstSkInput() { + return this._dstSk; + } + + // dst_storage_policy - computed: true, optional: false, required: false + public get dstStoragePolicy() { + return this.getStringAttribute('dst_storage_policy'); + } + + // enable_kms - computed: false, optional: true, required: false + private _enableKms?: boolean | cdktf.IResolvable; + public get enableKms() { + return this.getBooleanAttribute('enable_kms'); + } + public set enableKms(value: boolean | cdktf.IResolvable) { + this._enableKms = value; + } + public resetEnableKms() { + this._enableKms = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableKmsInput() { + return this._enableKms; + } + + // enable_metadata_migration - computed: false, optional: true, required: false + private _enableMetadataMigration?: boolean | cdktf.IResolvable; + public get enableMetadataMigration() { + return this.getBooleanAttribute('enable_metadata_migration'); + } + public set enableMetadataMigration(value: boolean | cdktf.IResolvable) { + this._enableMetadataMigration = value; + } + public resetEnableMetadataMigration() { + this._enableMetadataMigration = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableMetadataMigrationInput() { + return this._enableMetadataMigration; + } + + // enable_restore - computed: false, optional: true, required: false + private _enableRestore?: boolean | cdktf.IResolvable; + public get enableRestore() { + return this.getBooleanAttribute('enable_restore'); + } + public set enableRestore(value: boolean | cdktf.IResolvable) { + this._enableRestore = value; + } + public resetEnableRestore() { + this._enableRestore = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableRestoreInput() { + return this._enableRestore; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // last_start_at - computed: true, optional: false, required: false + public get lastStartAt() { + return this.getStringAttribute('last_start_at'); + } + + // monthly_acceptance_request - computed: true, optional: false, required: false + public get monthlyAcceptanceRequest() { + return this.getNumberAttribute('monthly_acceptance_request'); + } + + // monthly_failure_object - computed: true, optional: false, required: false + public get monthlyFailureObject() { + return this.getNumberAttribute('monthly_failure_object'); + } + + // monthly_size - computed: true, optional: false, required: false + public get monthlySize() { + return this.getNumberAttribute('monthly_size'); + } + + // monthly_skip_object - computed: true, optional: false, required: false + public get monthlySkipObject() { + return this.getNumberAttribute('monthly_skip_object'); + } + + // monthly_success_object - computed: true, optional: false, required: false + public get monthlySuccessObject() { + return this.getNumberAttribute('monthly_success_object'); + } + + // object_overwrite_mode - computed: true, optional: false, required: false + public get objectOverwriteMode() { + return this.getStringAttribute('object_overwrite_mode'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // src_ak - computed: false, optional: false, required: true + private _srcAk?: string; + public get srcAk() { + return this.getStringAttribute('src_ak'); + } + public set srcAk(value: string) { + this._srcAk = value; + } + // Temporarily expose input value. Use with caution. + public get srcAkInput() { + return this._srcAk; + } + + // src_bucket - computed: false, optional: false, required: true + private _srcBucket?: string; + public get srcBucket() { + return this.getStringAttribute('src_bucket'); + } + public set srcBucket(value: string) { + this._srcBucket = value; + } + // Temporarily expose input value. Use with caution. + public get srcBucketInput() { + return this._srcBucket; + } + + // src_cloud_type - computed: false, optional: true, required: false + private _srcCloudType?: string; + public get srcCloudType() { + return this.getStringAttribute('src_cloud_type'); + } + public set srcCloudType(value: string) { + this._srcCloudType = value; + } + public resetSrcCloudType() { + this._srcCloudType = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcCloudTypeInput() { + return this._srcCloudType; + } + + // src_region - computed: false, optional: false, required: true + private _srcRegion?: string; + public get srcRegion() { + return this.getStringAttribute('src_region'); + } + public set srcRegion(value: string) { + this._srcRegion = value; + } + // Temporarily expose input value. Use with caution. + public get srcRegionInput() { + return this._srcRegion; + } + + // src_sk - computed: false, optional: false, required: true + private _srcSk?: string; + public get srcSk() { + return this.getStringAttribute('src_sk'); + } + public set srcSk(value: string) { + this._srcSk = value; + } + // Temporarily expose input value. Use with caution. + public get srcSkInput() { + return this._srcSk; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // source_cdn - computed: false, optional: true, required: false + private _sourceCdn = new OmsMigrationSyncTaskSourceCdnOutputReference(this, "source_cdn"); + public get sourceCdn() { + return this._sourceCdn; + } + public putSourceCdn(value: OmsMigrationSyncTaskSourceCdn) { + this._sourceCdn.internalValue = value; + } + public resetSourceCdn() { + this._sourceCdn.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceCdnInput() { + return this._sourceCdn.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + app_id: cdktf.stringToTerraform(this._appId), + consistency_check: cdktf.stringToTerraform(this._consistencyCheck), + description: cdktf.stringToTerraform(this._description), + dst_ak: cdktf.stringToTerraform(this._dstAk), + dst_bucket: cdktf.stringToTerraform(this._dstBucket), + dst_sk: cdktf.stringToTerraform(this._dstSk), + enable_kms: cdktf.booleanToTerraform(this._enableKms), + enable_metadata_migration: cdktf.booleanToTerraform(this._enableMetadataMigration), + enable_restore: cdktf.booleanToTerraform(this._enableRestore), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + src_ak: cdktf.stringToTerraform(this._srcAk), + src_bucket: cdktf.stringToTerraform(this._srcBucket), + src_cloud_type: cdktf.stringToTerraform(this._srcCloudType), + src_region: cdktf.stringToTerraform(this._srcRegion), + src_sk: cdktf.stringToTerraform(this._srcSk), + source_cdn: omsMigrationSyncTaskSourceCdnToTerraform(this._sourceCdn.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(this._appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consistency_check: { + value: cdktf.stringToHclTerraform(this._consistencyCheck), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_ak: { + value: cdktf.stringToHclTerraform(this._dstAk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_bucket: { + value: cdktf.stringToHclTerraform(this._dstBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dst_sk: { + value: cdktf.stringToHclTerraform(this._dstSk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_kms: { + value: cdktf.booleanToHclTerraform(this._enableKms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_metadata_migration: { + value: cdktf.booleanToHclTerraform(this._enableMetadataMigration), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_restore: { + value: cdktf.booleanToHclTerraform(this._enableRestore), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_ak: { + value: cdktf.stringToHclTerraform(this._srcAk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_bucket: { + value: cdktf.stringToHclTerraform(this._srcBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_cloud_type: { + value: cdktf.stringToHclTerraform(this._srcCloudType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_region: { + value: cdktf.stringToHclTerraform(this._srcRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_sk: { + value: cdktf.stringToHclTerraform(this._srcSk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_cdn: { + value: omsMigrationSyncTaskSourceCdnToHclTerraform(this._sourceCdn.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationSyncTaskSourceCdnList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/oms-migration-task-group/README.md b/src/constructs/providers/huaweicloud/oms-migration-task-group/README.md new file mode 100644 index 00000000..b0543033 --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-migration-task-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_oms_migration_task_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_oms_migration_task_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group). diff --git a/src/constructs/providers/huaweicloud/oms-migration-task-group/index.ts b/src/constructs/providers/huaweicloud/oms-migration-task-group/index.ts new file mode 100644 index 00000000..f6f586af --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-migration-task-group/index.ts @@ -0,0 +1,1673 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OmsMigrationTaskGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#action OmsMigrationTaskGroup#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#consistency_check OmsMigrationTaskGroup#consistency_check} + */ + readonly consistencyCheck?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#description OmsMigrationTaskGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#enable_failed_object_recording OmsMigrationTaskGroup#enable_failed_object_recording} + */ + readonly enableFailedObjectRecording?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#enable_kms OmsMigrationTaskGroup#enable_kms} + */ + readonly enableKms?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#enable_requester_pays OmsMigrationTaskGroup#enable_requester_pays} + */ + readonly enableRequesterPays?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#id OmsMigrationTaskGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#migrate_since OmsMigrationTaskGroup#migrate_since} + */ + readonly migrateSince?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#object_overwrite_mode OmsMigrationTaskGroup#object_overwrite_mode} + */ + readonly objectOverwriteMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#region OmsMigrationTaskGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#type OmsMigrationTaskGroup#type} + */ + readonly type: string; + /** + * bandwidth_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#bandwidth_policy OmsMigrationTaskGroup#bandwidth_policy} + */ + readonly bandwidthPolicy?: OmsMigrationTaskGroupBandwidthPolicy[] | cdktf.IResolvable; + /** + * destination_object block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#destination_object OmsMigrationTaskGroup#destination_object} + */ + readonly destinationObject: OmsMigrationTaskGroupDestinationObject; + /** + * source_cdn block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#source_cdn OmsMigrationTaskGroup#source_cdn} + */ + readonly sourceCdn?: OmsMigrationTaskGroupSourceCdn; + /** + * source_object block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#source_object OmsMigrationTaskGroup#source_object} + */ + readonly sourceObject: OmsMigrationTaskGroupSourceObject; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#timeouts OmsMigrationTaskGroup#timeouts} + */ + readonly timeouts?: OmsMigrationTaskGroupTimeouts; +} +export interface OmsMigrationTaskGroupBandwidthPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#end OmsMigrationTaskGroup#end} + */ + readonly end: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#max_bandwidth OmsMigrationTaskGroup#max_bandwidth} + */ + readonly maxBandwidth: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#start OmsMigrationTaskGroup#start} + */ + readonly start: string; +} + +export function omsMigrationTaskGroupBandwidthPolicyToTerraform(struct?: OmsMigrationTaskGroupBandwidthPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end: cdktf.stringToTerraform(struct!.end), + max_bandwidth: cdktf.numberToTerraform(struct!.maxBandwidth), + start: cdktf.stringToTerraform(struct!.start), + } +} + + +export function omsMigrationTaskGroupBandwidthPolicyToHclTerraform(struct?: OmsMigrationTaskGroupBandwidthPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end: { + value: cdktf.stringToHclTerraform(struct!.end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_bandwidth: { + value: cdktf.numberToHclTerraform(struct!.maxBandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start: { + value: cdktf.stringToHclTerraform(struct!.start), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskGroupBandwidthPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): OmsMigrationTaskGroupBandwidthPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._end !== undefined) { + hasAnyValues = true; + internalValueResult.end = this._end; + } + if (this._maxBandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.maxBandwidth = this._maxBandwidth; + } + if (this._start !== undefined) { + hasAnyValues = true; + internalValueResult.start = this._start; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskGroupBandwidthPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._end = undefined; + this._maxBandwidth = undefined; + this._start = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._end = value.end; + this._maxBandwidth = value.maxBandwidth; + this._start = value.start; + } + } + + // end - computed: false, optional: false, required: true + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // max_bandwidth - computed: false, optional: false, required: true + private _maxBandwidth?: number; + public get maxBandwidth() { + return this.getNumberAttribute('max_bandwidth'); + } + public set maxBandwidth(value: number) { + this._maxBandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get maxBandwidthInput() { + return this._maxBandwidth; + } + + // start - computed: false, optional: false, required: true + private _start?: string; + public get start() { + return this.getStringAttribute('start'); + } + public set start(value: string) { + this._start = value; + } + // Temporarily expose input value. Use with caution. + public get startInput() { + return this._start; + } +} + +export class OmsMigrationTaskGroupBandwidthPolicyList extends cdktf.ComplexList { + public internalValue? : OmsMigrationTaskGroupBandwidthPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): OmsMigrationTaskGroupBandwidthPolicyOutputReference { + return new OmsMigrationTaskGroupBandwidthPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface OmsMigrationTaskGroupDestinationObject { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#access_key OmsMigrationTaskGroup#access_key} + */ + readonly accessKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#bucket OmsMigrationTaskGroup#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#data_source OmsMigrationTaskGroup#data_source} + */ + readonly dataSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#region OmsMigrationTaskGroup#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#save_prefix OmsMigrationTaskGroup#save_prefix} + */ + readonly savePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#secret_key OmsMigrationTaskGroup#secret_key} + */ + readonly secretKey?: string; +} + +export function omsMigrationTaskGroupDestinationObjectToTerraform(struct?: OmsMigrationTaskGroupDestinationObjectOutputReference | OmsMigrationTaskGroupDestinationObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_key: cdktf.stringToTerraform(struct!.accessKey), + bucket: cdktf.stringToTerraform(struct!.bucket), + data_source: cdktf.stringToTerraform(struct!.dataSource), + region: cdktf.stringToTerraform(struct!.region), + save_prefix: cdktf.stringToTerraform(struct!.savePrefix), + secret_key: cdktf.stringToTerraform(struct!.secretKey), + } +} + + +export function omsMigrationTaskGroupDestinationObjectToHclTerraform(struct?: OmsMigrationTaskGroupDestinationObjectOutputReference | OmsMigrationTaskGroupDestinationObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(struct!.accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source: { + value: cdktf.stringToHclTerraform(struct!.dataSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + save_prefix: { + value: cdktf.stringToHclTerraform(struct!.savePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(struct!.secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskGroupDestinationObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskGroupDestinationObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessKey !== undefined) { + hasAnyValues = true; + internalValueResult.accessKey = this._accessKey; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._dataSource !== undefined) { + hasAnyValues = true; + internalValueResult.dataSource = this._dataSource; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._savePrefix !== undefined) { + hasAnyValues = true; + internalValueResult.savePrefix = this._savePrefix; + } + if (this._secretKey !== undefined) { + hasAnyValues = true; + internalValueResult.secretKey = this._secretKey; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskGroupDestinationObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessKey = undefined; + this._bucket = undefined; + this._dataSource = undefined; + this._region = undefined; + this._savePrefix = undefined; + this._secretKey = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessKey = value.accessKey; + this._bucket = value.bucket; + this._dataSource = value.dataSource; + this._region = value.region; + this._savePrefix = value.savePrefix; + this._secretKey = value.secretKey; + } + } + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // data_source - computed: false, optional: true, required: false + private _dataSource?: string; + public get dataSource() { + return this.getStringAttribute('data_source'); + } + public set dataSource(value: string) { + this._dataSource = value; + } + public resetDataSource() { + this._dataSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // save_prefix - computed: false, optional: true, required: false + private _savePrefix?: string; + public get savePrefix() { + return this.getStringAttribute('save_prefix'); + } + public set savePrefix(value: string) { + this._savePrefix = value; + } + public resetSavePrefix() { + this._savePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get savePrefixInput() { + return this._savePrefix; + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } +} +export interface OmsMigrationTaskGroupSourceCdn { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#authentication_key OmsMigrationTaskGroup#authentication_key} + */ + readonly authenticationKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#authentication_type OmsMigrationTaskGroup#authentication_type} + */ + readonly authenticationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#domain OmsMigrationTaskGroup#domain} + */ + readonly domain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#protocol OmsMigrationTaskGroup#protocol} + */ + readonly protocol: string; +} + +export function omsMigrationTaskGroupSourceCdnToTerraform(struct?: OmsMigrationTaskGroupSourceCdnOutputReference | OmsMigrationTaskGroupSourceCdn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authentication_key: cdktf.stringToTerraform(struct!.authenticationKey), + authentication_type: cdktf.stringToTerraform(struct!.authenticationType), + domain: cdktf.stringToTerraform(struct!.domain), + protocol: cdktf.stringToTerraform(struct!.protocol), + } +} + + +export function omsMigrationTaskGroupSourceCdnToHclTerraform(struct?: OmsMigrationTaskGroupSourceCdnOutputReference | OmsMigrationTaskGroupSourceCdn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authentication_key: { + value: cdktf.stringToHclTerraform(struct!.authenticationKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication_type: { + value: cdktf.stringToHclTerraform(struct!.authenticationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(struct!.domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskGroupSourceCdnOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskGroupSourceCdn | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authenticationKey !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationKey = this._authenticationKey; + } + if (this._authenticationType !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationType = this._authenticationType; + } + if (this._domain !== undefined) { + hasAnyValues = true; + internalValueResult.domain = this._domain; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskGroupSourceCdn | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authenticationKey = undefined; + this._authenticationType = undefined; + this._domain = undefined; + this._protocol = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authenticationKey = value.authenticationKey; + this._authenticationType = value.authenticationType; + this._domain = value.domain; + this._protocol = value.protocol; + } + } + + // authentication_key - computed: false, optional: true, required: false + private _authenticationKey?: string; + public get authenticationKey() { + return this.getStringAttribute('authentication_key'); + } + public set authenticationKey(value: string) { + this._authenticationKey = value; + } + public resetAuthenticationKey() { + this._authenticationKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationKeyInput() { + return this._authenticationKey; + } + + // authentication_type - computed: false, optional: true, required: false + private _authenticationType?: string; + public get authenticationType() { + return this.getStringAttribute('authentication_type'); + } + public set authenticationType(value: string) { + this._authenticationType = value; + } + public resetAuthenticationType() { + this._authenticationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationTypeInput() { + return this._authenticationType; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } +} +export interface OmsMigrationTaskGroupSourceObject { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#access_key OmsMigrationTaskGroup#access_key} + */ + readonly accessKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#app_id OmsMigrationTaskGroup#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#bucket OmsMigrationTaskGroup#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#data_source OmsMigrationTaskGroup#data_source} + */ + readonly dataSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#list_file_bucket OmsMigrationTaskGroup#list_file_bucket} + */ + readonly listFileBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#list_file_key OmsMigrationTaskGroup#list_file_key} + */ + readonly listFileKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#object OmsMigrationTaskGroup#object} + */ + readonly object?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#region OmsMigrationTaskGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#secret_key OmsMigrationTaskGroup#secret_key} + */ + readonly secretKey?: string; +} + +export function omsMigrationTaskGroupSourceObjectToTerraform(struct?: OmsMigrationTaskGroupSourceObjectOutputReference | OmsMigrationTaskGroupSourceObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_key: cdktf.stringToTerraform(struct!.accessKey), + app_id: cdktf.stringToTerraform(struct!.appId), + bucket: cdktf.stringToTerraform(struct!.bucket), + data_source: cdktf.stringToTerraform(struct!.dataSource), + list_file_bucket: cdktf.stringToTerraform(struct!.listFileBucket), + list_file_key: cdktf.stringToTerraform(struct!.listFileKey), + object: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.object), + region: cdktf.stringToTerraform(struct!.region), + secret_key: cdktf.stringToTerraform(struct!.secretKey), + } +} + + +export function omsMigrationTaskGroupSourceObjectToHclTerraform(struct?: OmsMigrationTaskGroupSourceObjectOutputReference | OmsMigrationTaskGroupSourceObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(struct!.accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(struct!.appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source: { + value: cdktf.stringToHclTerraform(struct!.dataSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_file_bucket: { + value: cdktf.stringToHclTerraform(struct!.listFileBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_file_key: { + value: cdktf.stringToHclTerraform(struct!.listFileKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.object), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(struct!.secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskGroupSourceObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskGroupSourceObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessKey !== undefined) { + hasAnyValues = true; + internalValueResult.accessKey = this._accessKey; + } + if (this._appId !== undefined) { + hasAnyValues = true; + internalValueResult.appId = this._appId; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._dataSource !== undefined) { + hasAnyValues = true; + internalValueResult.dataSource = this._dataSource; + } + if (this._listFileBucket !== undefined) { + hasAnyValues = true; + internalValueResult.listFileBucket = this._listFileBucket; + } + if (this._listFileKey !== undefined) { + hasAnyValues = true; + internalValueResult.listFileKey = this._listFileKey; + } + if (this._object !== undefined) { + hasAnyValues = true; + internalValueResult.object = this._object; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._secretKey !== undefined) { + hasAnyValues = true; + internalValueResult.secretKey = this._secretKey; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskGroupSourceObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessKey = undefined; + this._appId = undefined; + this._bucket = undefined; + this._dataSource = undefined; + this._listFileBucket = undefined; + this._listFileKey = undefined; + this._object = undefined; + this._region = undefined; + this._secretKey = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessKey = value.accessKey; + this._appId = value.appId; + this._bucket = value.bucket; + this._dataSource = value.dataSource; + this._listFileBucket = value.listFileBucket; + this._listFileKey = value.listFileKey; + this._object = value.object; + this._region = value.region; + this._secretKey = value.secretKey; + } + } + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // bucket - computed: false, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // data_source - computed: false, optional: true, required: false + private _dataSource?: string; + public get dataSource() { + return this.getStringAttribute('data_source'); + } + public set dataSource(value: string) { + this._dataSource = value; + } + public resetDataSource() { + this._dataSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource; + } + + // list_file_bucket - computed: false, optional: true, required: false + private _listFileBucket?: string; + public get listFileBucket() { + return this.getStringAttribute('list_file_bucket'); + } + public set listFileBucket(value: string) { + this._listFileBucket = value; + } + public resetListFileBucket() { + this._listFileBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get listFileBucketInput() { + return this._listFileBucket; + } + + // list_file_key - computed: false, optional: true, required: false + private _listFileKey?: string; + public get listFileKey() { + return this.getStringAttribute('list_file_key'); + } + public set listFileKey(value: string) { + this._listFileKey = value; + } + public resetListFileKey() { + this._listFileKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get listFileKeyInput() { + return this._listFileKey; + } + + // object - computed: false, optional: true, required: false + private _object?: string[]; + public get object() { + return this.getListAttribute('object'); + } + public set object(value: string[]) { + this._object = value; + } + public resetObject() { + this._object = undefined; + } + // Temporarily expose input value. Use with caution. + public get objectInput() { + return this._object; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } +} +export interface OmsMigrationTaskGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#create OmsMigrationTaskGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#delete OmsMigrationTaskGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#update OmsMigrationTaskGroup#update} + */ + readonly update?: string; +} + +export function omsMigrationTaskGroupTimeoutsToTerraform(struct?: OmsMigrationTaskGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function omsMigrationTaskGroupTimeoutsToHclTerraform(struct?: OmsMigrationTaskGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): OmsMigrationTaskGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group huaweicloud_oms_migration_task_group} +*/ +export class OmsMigrationTaskGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_oms_migration_task_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OmsMigrationTaskGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OmsMigrationTaskGroup to import + * @param importFromId The id of the existing OmsMigrationTaskGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OmsMigrationTaskGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_oms_migration_task_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task_group huaweicloud_oms_migration_task_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OmsMigrationTaskGroupConfig + */ + public constructor(scope: Construct, id: string, config: OmsMigrationTaskGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_oms_migration_task_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._consistencyCheck = config.consistencyCheck; + this._description = config.description; + this._enableFailedObjectRecording = config.enableFailedObjectRecording; + this._enableKms = config.enableKms; + this._enableRequesterPays = config.enableRequesterPays; + this._id = config.id; + this._migrateSince = config.migrateSince; + this._objectOverwriteMode = config.objectOverwriteMode; + this._region = config.region; + this._type = config.type; + this._bandwidthPolicy.internalValue = config.bandwidthPolicy; + this._destinationObject.internalValue = config.destinationObject; + this._sourceCdn.internalValue = config.sourceCdn; + this._sourceObject.internalValue = config.sourceObject; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // complete_size - computed: true, optional: false, required: false + public get completeSize() { + return this.getNumberAttribute('complete_size'); + } + + // consistency_check - computed: true, optional: true, required: false + private _consistencyCheck?: string; + public get consistencyCheck() { + return this.getStringAttribute('consistency_check'); + } + public set consistencyCheck(value: string) { + this._consistencyCheck = value; + } + public resetConsistencyCheck() { + this._consistencyCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get consistencyCheckInput() { + return this._consistencyCheck; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_failed_object_recording - computed: false, optional: true, required: false + private _enableFailedObjectRecording?: boolean | cdktf.IResolvable; + public get enableFailedObjectRecording() { + return this.getBooleanAttribute('enable_failed_object_recording'); + } + public set enableFailedObjectRecording(value: boolean | cdktf.IResolvable) { + this._enableFailedObjectRecording = value; + } + public resetEnableFailedObjectRecording() { + this._enableFailedObjectRecording = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableFailedObjectRecordingInput() { + return this._enableFailedObjectRecording; + } + + // enable_kms - computed: true, optional: true, required: false + private _enableKms?: boolean | cdktf.IResolvable; + public get enableKms() { + return this.getBooleanAttribute('enable_kms'); + } + public set enableKms(value: boolean | cdktf.IResolvable) { + this._enableKms = value; + } + public resetEnableKms() { + this._enableKms = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableKmsInput() { + return this._enableKms; + } + + // enable_requester_pays - computed: true, optional: true, required: false + private _enableRequesterPays?: boolean | cdktf.IResolvable; + public get enableRequesterPays() { + return this.getBooleanAttribute('enable_requester_pays'); + } + public set enableRequesterPays(value: boolean | cdktf.IResolvable) { + this._enableRequesterPays = value; + } + public resetEnableRequesterPays() { + this._enableRequesterPays = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableRequesterPaysInput() { + return this._enableRequesterPays; + } + + // fail_num - computed: true, optional: false, required: false + public get failNum() { + return this.getNumberAttribute('fail_num'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // migrate_since - computed: true, optional: true, required: false + private _migrateSince?: string; + public get migrateSince() { + return this.getStringAttribute('migrate_since'); + } + public set migrateSince(value: string) { + this._migrateSince = value; + } + public resetMigrateSince() { + this._migrateSince = undefined; + } + // Temporarily expose input value. Use with caution. + public get migrateSinceInput() { + return this._migrateSince; + } + + // object_overwrite_mode - computed: true, optional: true, required: false + private _objectOverwriteMode?: string; + public get objectOverwriteMode() { + return this.getStringAttribute('object_overwrite_mode'); + } + public set objectOverwriteMode(value: string) { + this._objectOverwriteMode = value; + } + public resetObjectOverwriteMode() { + this._objectOverwriteMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get objectOverwriteModeInput() { + return this._objectOverwriteMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // success_num - computed: true, optional: false, required: false + public get successNum() { + return this.getNumberAttribute('success_num'); + } + + // total_num - computed: true, optional: false, required: false + public get totalNum() { + return this.getNumberAttribute('total_num'); + } + + // total_size - computed: true, optional: false, required: false + public get totalSize() { + return this.getNumberAttribute('total_size'); + } + + // total_time - computed: true, optional: false, required: false + public get totalTime() { + return this.getNumberAttribute('total_time'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // bandwidth_policy - computed: false, optional: true, required: false + private _bandwidthPolicy = new OmsMigrationTaskGroupBandwidthPolicyList(this, "bandwidth_policy", false); + public get bandwidthPolicy() { + return this._bandwidthPolicy; + } + public putBandwidthPolicy(value: OmsMigrationTaskGroupBandwidthPolicy[] | cdktf.IResolvable) { + this._bandwidthPolicy.internalValue = value; + } + public resetBandwidthPolicy() { + this._bandwidthPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthPolicyInput() { + return this._bandwidthPolicy.internalValue; + } + + // destination_object - computed: false, optional: false, required: true + private _destinationObject = new OmsMigrationTaskGroupDestinationObjectOutputReference(this, "destination_object"); + public get destinationObject() { + return this._destinationObject; + } + public putDestinationObject(value: OmsMigrationTaskGroupDestinationObject) { + this._destinationObject.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get destinationObjectInput() { + return this._destinationObject.internalValue; + } + + // source_cdn - computed: false, optional: true, required: false + private _sourceCdn = new OmsMigrationTaskGroupSourceCdnOutputReference(this, "source_cdn"); + public get sourceCdn() { + return this._sourceCdn; + } + public putSourceCdn(value: OmsMigrationTaskGroupSourceCdn) { + this._sourceCdn.internalValue = value; + } + public resetSourceCdn() { + this._sourceCdn.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceCdnInput() { + return this._sourceCdn.internalValue; + } + + // source_object - computed: false, optional: false, required: true + private _sourceObject = new OmsMigrationTaskGroupSourceObjectOutputReference(this, "source_object"); + public get sourceObject() { + return this._sourceObject; + } + public putSourceObject(value: OmsMigrationTaskGroupSourceObject) { + this._sourceObject.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceObjectInput() { + return this._sourceObject.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new OmsMigrationTaskGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: OmsMigrationTaskGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + consistency_check: cdktf.stringToTerraform(this._consistencyCheck), + description: cdktf.stringToTerraform(this._description), + enable_failed_object_recording: cdktf.booleanToTerraform(this._enableFailedObjectRecording), + enable_kms: cdktf.booleanToTerraform(this._enableKms), + enable_requester_pays: cdktf.booleanToTerraform(this._enableRequesterPays), + id: cdktf.stringToTerraform(this._id), + migrate_since: cdktf.stringToTerraform(this._migrateSince), + object_overwrite_mode: cdktf.stringToTerraform(this._objectOverwriteMode), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + bandwidth_policy: cdktf.listMapper(omsMigrationTaskGroupBandwidthPolicyToTerraform, true)(this._bandwidthPolicy.internalValue), + destination_object: omsMigrationTaskGroupDestinationObjectToTerraform(this._destinationObject.internalValue), + source_cdn: omsMigrationTaskGroupSourceCdnToTerraform(this._sourceCdn.internalValue), + source_object: omsMigrationTaskGroupSourceObjectToTerraform(this._sourceObject.internalValue), + timeouts: omsMigrationTaskGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + consistency_check: { + value: cdktf.stringToHclTerraform(this._consistencyCheck), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_failed_object_recording: { + value: cdktf.booleanToHclTerraform(this._enableFailedObjectRecording), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_kms: { + value: cdktf.booleanToHclTerraform(this._enableKms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_requester_pays: { + value: cdktf.booleanToHclTerraform(this._enableRequesterPays), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + migrate_since: { + value: cdktf.stringToHclTerraform(this._migrateSince), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_overwrite_mode: { + value: cdktf.stringToHclTerraform(this._objectOverwriteMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_policy: { + value: cdktf.listMapperHcl(omsMigrationTaskGroupBandwidthPolicyToHclTerraform, true)(this._bandwidthPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskGroupBandwidthPolicyList", + }, + destination_object: { + value: omsMigrationTaskGroupDestinationObjectToHclTerraform(this._destinationObject.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskGroupDestinationObjectList", + }, + source_cdn: { + value: omsMigrationTaskGroupSourceCdnToHclTerraform(this._sourceCdn.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskGroupSourceCdnList", + }, + source_object: { + value: omsMigrationTaskGroupSourceObjectToHclTerraform(this._sourceObject.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskGroupSourceObjectList", + }, + timeouts: { + value: omsMigrationTaskGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "OmsMigrationTaskGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/oms-migration-task/README.md b/src/constructs/providers/huaweicloud/oms-migration-task/README.md new file mode 100644 index 00000000..1f3884df --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-migration-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_oms_migration_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_oms_migration_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task). diff --git a/src/constructs/providers/huaweicloud/oms-migration-task/index.ts b/src/constructs/providers/huaweicloud/oms-migration-task/index.ts new file mode 100644 index 00000000..ffd752c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-migration-task/index.ts @@ -0,0 +1,1766 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OmsMigrationTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#description OmsMigrationTask#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#enable_failed_object_recording OmsMigrationTask#enable_failed_object_recording} + */ + readonly enableFailedObjectRecording?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#enable_kms OmsMigrationTask#enable_kms} + */ + readonly enableKms?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#enable_restore OmsMigrationTask#enable_restore} + */ + readonly enableRestore?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#id OmsMigrationTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#migrate_since OmsMigrationTask#migrate_since} + */ + readonly migrateSince?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#region OmsMigrationTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#start_task OmsMigrationTask#start_task} + */ + readonly startTask?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#type OmsMigrationTask#type} + */ + readonly type: string; + /** + * bandwidth_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#bandwidth_policy OmsMigrationTask#bandwidth_policy} + */ + readonly bandwidthPolicy?: OmsMigrationTaskBandwidthPolicy[] | cdktf.IResolvable; + /** + * destination_object block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#destination_object OmsMigrationTask#destination_object} + */ + readonly destinationObject: OmsMigrationTaskDestinationObject; + /** + * smn_config block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#smn_config OmsMigrationTask#smn_config} + */ + readonly smnConfig?: OmsMigrationTaskSmnConfig; + /** + * source_cdn block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#source_cdn OmsMigrationTask#source_cdn} + */ + readonly sourceCdn?: OmsMigrationTaskSourceCdn; + /** + * source_object block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#source_object OmsMigrationTask#source_object} + */ + readonly sourceObject: OmsMigrationTaskSourceObject; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#timeouts OmsMigrationTask#timeouts} + */ + readonly timeouts?: OmsMigrationTaskTimeouts; +} +export interface OmsMigrationTaskBandwidthPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#end OmsMigrationTask#end} + */ + readonly end: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#max_bandwidth OmsMigrationTask#max_bandwidth} + */ + readonly maxBandwidth: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#start OmsMigrationTask#start} + */ + readonly start: string; +} + +export function omsMigrationTaskBandwidthPolicyToTerraform(struct?: OmsMigrationTaskBandwidthPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + end: cdktf.stringToTerraform(struct!.end), + max_bandwidth: cdktf.numberToTerraform(struct!.maxBandwidth), + start: cdktf.stringToTerraform(struct!.start), + } +} + + +export function omsMigrationTaskBandwidthPolicyToHclTerraform(struct?: OmsMigrationTaskBandwidthPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + end: { + value: cdktf.stringToHclTerraform(struct!.end), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_bandwidth: { + value: cdktf.numberToHclTerraform(struct!.maxBandwidth), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start: { + value: cdktf.stringToHclTerraform(struct!.start), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskBandwidthPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): OmsMigrationTaskBandwidthPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._end !== undefined) { + hasAnyValues = true; + internalValueResult.end = this._end; + } + if (this._maxBandwidth !== undefined) { + hasAnyValues = true; + internalValueResult.maxBandwidth = this._maxBandwidth; + } + if (this._start !== undefined) { + hasAnyValues = true; + internalValueResult.start = this._start; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskBandwidthPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._end = undefined; + this._maxBandwidth = undefined; + this._start = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._end = value.end; + this._maxBandwidth = value.maxBandwidth; + this._start = value.start; + } + } + + // end - computed: false, optional: false, required: true + private _end?: string; + public get end() { + return this.getStringAttribute('end'); + } + public set end(value: string) { + this._end = value; + } + // Temporarily expose input value. Use with caution. + public get endInput() { + return this._end; + } + + // max_bandwidth - computed: false, optional: false, required: true + private _maxBandwidth?: number; + public get maxBandwidth() { + return this.getNumberAttribute('max_bandwidth'); + } + public set maxBandwidth(value: number) { + this._maxBandwidth = value; + } + // Temporarily expose input value. Use with caution. + public get maxBandwidthInput() { + return this._maxBandwidth; + } + + // start - computed: false, optional: false, required: true + private _start?: string; + public get start() { + return this.getStringAttribute('start'); + } + public set start(value: string) { + this._start = value; + } + // Temporarily expose input value. Use with caution. + public get startInput() { + return this._start; + } +} + +export class OmsMigrationTaskBandwidthPolicyList extends cdktf.ComplexList { + public internalValue? : OmsMigrationTaskBandwidthPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): OmsMigrationTaskBandwidthPolicyOutputReference { + return new OmsMigrationTaskBandwidthPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface OmsMigrationTaskDestinationObject { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#access_key OmsMigrationTask#access_key} + */ + readonly accessKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#bucket OmsMigrationTask#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#region OmsMigrationTask#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#save_prefix OmsMigrationTask#save_prefix} + */ + readonly savePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#secret_key OmsMigrationTask#secret_key} + */ + readonly secretKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#security_token OmsMigrationTask#security_token} + */ + readonly securityToken?: string; +} + +export function omsMigrationTaskDestinationObjectToTerraform(struct?: OmsMigrationTaskDestinationObjectOutputReference | OmsMigrationTaskDestinationObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_key: cdktf.stringToTerraform(struct!.accessKey), + bucket: cdktf.stringToTerraform(struct!.bucket), + region: cdktf.stringToTerraform(struct!.region), + save_prefix: cdktf.stringToTerraform(struct!.savePrefix), + secret_key: cdktf.stringToTerraform(struct!.secretKey), + security_token: cdktf.stringToTerraform(struct!.securityToken), + } +} + + +export function omsMigrationTaskDestinationObjectToHclTerraform(struct?: OmsMigrationTaskDestinationObjectOutputReference | OmsMigrationTaskDestinationObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(struct!.accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + save_prefix: { + value: cdktf.stringToHclTerraform(struct!.savePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(struct!.secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_token: { + value: cdktf.stringToHclTerraform(struct!.securityToken), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskDestinationObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskDestinationObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessKey !== undefined) { + hasAnyValues = true; + internalValueResult.accessKey = this._accessKey; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._savePrefix !== undefined) { + hasAnyValues = true; + internalValueResult.savePrefix = this._savePrefix; + } + if (this._secretKey !== undefined) { + hasAnyValues = true; + internalValueResult.secretKey = this._secretKey; + } + if (this._securityToken !== undefined) { + hasAnyValues = true; + internalValueResult.securityToken = this._securityToken; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskDestinationObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessKey = undefined; + this._bucket = undefined; + this._region = undefined; + this._savePrefix = undefined; + this._secretKey = undefined; + this._securityToken = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessKey = value.accessKey; + this._bucket = value.bucket; + this._region = value.region; + this._savePrefix = value.savePrefix; + this._secretKey = value.secretKey; + this._securityToken = value.securityToken; + } + } + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // save_prefix - computed: false, optional: true, required: false + private _savePrefix?: string; + public get savePrefix() { + return this.getStringAttribute('save_prefix'); + } + public set savePrefix(value: string) { + this._savePrefix = value; + } + public resetSavePrefix() { + this._savePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get savePrefixInput() { + return this._savePrefix; + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // security_token - computed: false, optional: true, required: false + private _securityToken?: string; + public get securityToken() { + return this.getStringAttribute('security_token'); + } + public set securityToken(value: string) { + this._securityToken = value; + } + public resetSecurityToken() { + this._securityToken = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityTokenInput() { + return this._securityToken; + } +} +export interface OmsMigrationTaskSmnConfig { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#language OmsMigrationTask#language} + */ + readonly language?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#topic_urn OmsMigrationTask#topic_urn} + */ + readonly topicUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#trigger_conditions OmsMigrationTask#trigger_conditions} + */ + readonly triggerConditions: string[]; +} + +export function omsMigrationTaskSmnConfigToTerraform(struct?: OmsMigrationTaskSmnConfigOutputReference | OmsMigrationTaskSmnConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + language: cdktf.stringToTerraform(struct!.language), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + trigger_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.triggerConditions), + } +} + + +export function omsMigrationTaskSmnConfigToHclTerraform(struct?: OmsMigrationTaskSmnConfigOutputReference | OmsMigrationTaskSmnConfig): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + language: { + value: cdktf.stringToHclTerraform(struct!.language), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.triggerConditions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskSmnConfigOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskSmnConfig | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._language !== undefined) { + hasAnyValues = true; + internalValueResult.language = this._language; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + if (this._triggerConditions !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskSmnConfig | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._language = undefined; + this._topicUrn = undefined; + this._triggerConditions = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._language = value.language; + this._topicUrn = value.topicUrn; + this._triggerConditions = value.triggerConditions; + } + } + + // language - computed: false, optional: true, required: false + private _language?: string; + public get language() { + return this.getStringAttribute('language'); + } + public set language(value: string) { + this._language = value; + } + public resetLanguage() { + this._language = undefined; + } + // Temporarily expose input value. Use with caution. + public get languageInput() { + return this._language; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // trigger_conditions - computed: false, optional: false, required: true + private _triggerConditions?: string[]; + public get triggerConditions() { + return this.getListAttribute('trigger_conditions'); + } + public set triggerConditions(value: string[]) { + this._triggerConditions = value; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions; + } +} +export interface OmsMigrationTaskSourceCdn { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#authentication_key OmsMigrationTask#authentication_key} + */ + readonly authenticationKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#authentication_type OmsMigrationTask#authentication_type} + */ + readonly authenticationType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#domain OmsMigrationTask#domain} + */ + readonly domain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#protocol OmsMigrationTask#protocol} + */ + readonly protocol: string; +} + +export function omsMigrationTaskSourceCdnToTerraform(struct?: OmsMigrationTaskSourceCdnOutputReference | OmsMigrationTaskSourceCdn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authentication_key: cdktf.stringToTerraform(struct!.authenticationKey), + authentication_type: cdktf.stringToTerraform(struct!.authenticationType), + domain: cdktf.stringToTerraform(struct!.domain), + protocol: cdktf.stringToTerraform(struct!.protocol), + } +} + + +export function omsMigrationTaskSourceCdnToHclTerraform(struct?: OmsMigrationTaskSourceCdnOutputReference | OmsMigrationTaskSourceCdn): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authentication_key: { + value: cdktf.stringToHclTerraform(struct!.authenticationKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication_type: { + value: cdktf.stringToHclTerraform(struct!.authenticationType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(struct!.domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskSourceCdnOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskSourceCdn | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authenticationKey !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationKey = this._authenticationKey; + } + if (this._authenticationType !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationType = this._authenticationType; + } + if (this._domain !== undefined) { + hasAnyValues = true; + internalValueResult.domain = this._domain; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskSourceCdn | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authenticationKey = undefined; + this._authenticationType = undefined; + this._domain = undefined; + this._protocol = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authenticationKey = value.authenticationKey; + this._authenticationType = value.authenticationType; + this._domain = value.domain; + this._protocol = value.protocol; + } + } + + // authentication_key - computed: false, optional: true, required: false + private _authenticationKey?: string; + public get authenticationKey() { + return this.getStringAttribute('authentication_key'); + } + public set authenticationKey(value: string) { + this._authenticationKey = value; + } + public resetAuthenticationKey() { + this._authenticationKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationKeyInput() { + return this._authenticationKey; + } + + // authentication_type - computed: false, optional: true, required: false + private _authenticationType?: string; + public get authenticationType() { + return this.getStringAttribute('authentication_type'); + } + public set authenticationType(value: string) { + this._authenticationType = value; + } + public resetAuthenticationType() { + this._authenticationType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationTypeInput() { + return this._authenticationType; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } +} +export interface OmsMigrationTaskSourceObject { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#access_key OmsMigrationTask#access_key} + */ + readonly accessKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#app_id OmsMigrationTask#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#bucket OmsMigrationTask#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#data_source OmsMigrationTask#data_source} + */ + readonly dataSource?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#list_file_bucket OmsMigrationTask#list_file_bucket} + */ + readonly listFileBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#list_file_key OmsMigrationTask#list_file_key} + */ + readonly listFileKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#object OmsMigrationTask#object} + */ + readonly object?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#region OmsMigrationTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#secret_key OmsMigrationTask#secret_key} + */ + readonly secretKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#security_token OmsMigrationTask#security_token} + */ + readonly securityToken?: string; +} + +export function omsMigrationTaskSourceObjectToTerraform(struct?: OmsMigrationTaskSourceObjectOutputReference | OmsMigrationTaskSourceObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_key: cdktf.stringToTerraform(struct!.accessKey), + app_id: cdktf.stringToTerraform(struct!.appId), + bucket: cdktf.stringToTerraform(struct!.bucket), + data_source: cdktf.stringToTerraform(struct!.dataSource), + list_file_bucket: cdktf.stringToTerraform(struct!.listFileBucket), + list_file_key: cdktf.stringToTerraform(struct!.listFileKey), + object: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.object), + region: cdktf.stringToTerraform(struct!.region), + secret_key: cdktf.stringToTerraform(struct!.secretKey), + security_token: cdktf.stringToTerraform(struct!.securityToken), + } +} + + +export function omsMigrationTaskSourceObjectToHclTerraform(struct?: OmsMigrationTaskSourceObjectOutputReference | OmsMigrationTaskSourceObject): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(struct!.accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_id: { + value: cdktf.stringToHclTerraform(struct!.appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source: { + value: cdktf.stringToHclTerraform(struct!.dataSource), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_file_bucket: { + value: cdktf.stringToHclTerraform(struct!.listFileBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + list_file_key: { + value: cdktf.stringToHclTerraform(struct!.listFileKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.object), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_key: { + value: cdktf.stringToHclTerraform(struct!.secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_token: { + value: cdktf.stringToHclTerraform(struct!.securityToken), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskSourceObjectOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsMigrationTaskSourceObject | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessKey !== undefined) { + hasAnyValues = true; + internalValueResult.accessKey = this._accessKey; + } + if (this._appId !== undefined) { + hasAnyValues = true; + internalValueResult.appId = this._appId; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._dataSource !== undefined) { + hasAnyValues = true; + internalValueResult.dataSource = this._dataSource; + } + if (this._listFileBucket !== undefined) { + hasAnyValues = true; + internalValueResult.listFileBucket = this._listFileBucket; + } + if (this._listFileKey !== undefined) { + hasAnyValues = true; + internalValueResult.listFileKey = this._listFileKey; + } + if (this._object !== undefined) { + hasAnyValues = true; + internalValueResult.object = this._object; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._secretKey !== undefined) { + hasAnyValues = true; + internalValueResult.secretKey = this._secretKey; + } + if (this._securityToken !== undefined) { + hasAnyValues = true; + internalValueResult.securityToken = this._securityToken; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskSourceObject | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessKey = undefined; + this._appId = undefined; + this._bucket = undefined; + this._dataSource = undefined; + this._listFileBucket = undefined; + this._listFileKey = undefined; + this._object = undefined; + this._region = undefined; + this._secretKey = undefined; + this._securityToken = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessKey = value.accessKey; + this._appId = value.appId; + this._bucket = value.bucket; + this._dataSource = value.dataSource; + this._listFileBucket = value.listFileBucket; + this._listFileKey = value.listFileKey; + this._object = value.object; + this._region = value.region; + this._secretKey = value.secretKey; + this._securityToken = value.securityToken; + } + } + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this.getStringAttribute('access_key'); + } + public set accessKey(value: string) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // bucket - computed: false, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // data_source - computed: false, optional: true, required: false + private _dataSource?: string; + public get dataSource() { + return this.getStringAttribute('data_source'); + } + public set dataSource(value: string) { + this._dataSource = value; + } + public resetDataSource() { + this._dataSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource; + } + + // list_file_bucket - computed: false, optional: true, required: false + private _listFileBucket?: string; + public get listFileBucket() { + return this.getStringAttribute('list_file_bucket'); + } + public set listFileBucket(value: string) { + this._listFileBucket = value; + } + public resetListFileBucket() { + this._listFileBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get listFileBucketInput() { + return this._listFileBucket; + } + + // list_file_key - computed: false, optional: true, required: false + private _listFileKey?: string; + public get listFileKey() { + return this.getStringAttribute('list_file_key'); + } + public set listFileKey(value: string) { + this._listFileKey = value; + } + public resetListFileKey() { + this._listFileKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get listFileKeyInput() { + return this._listFileKey; + } + + // object - computed: false, optional: true, required: false + private _object?: string[]; + public get object() { + return this.getListAttribute('object'); + } + public set object(value: string[]) { + this._object = value; + } + public resetObject() { + this._object = undefined; + } + // Temporarily expose input value. Use with caution. + public get objectInput() { + return this._object; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this.getStringAttribute('secret_key'); + } + public set secretKey(value: string) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // security_token - computed: false, optional: true, required: false + private _securityToken?: string; + public get securityToken() { + return this.getStringAttribute('security_token'); + } + public set securityToken(value: string) { + this._securityToken = value; + } + public resetSecurityToken() { + this._securityToken = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityTokenInput() { + return this._securityToken; + } +} +export interface OmsMigrationTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#create OmsMigrationTask#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#update OmsMigrationTask#update} + */ + readonly update?: string; +} + +export function omsMigrationTaskTimeoutsToTerraform(struct?: OmsMigrationTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function omsMigrationTaskTimeoutsToHclTerraform(struct?: OmsMigrationTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsMigrationTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): OmsMigrationTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsMigrationTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task huaweicloud_oms_migration_task} +*/ +export class OmsMigrationTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_oms_migration_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OmsMigrationTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OmsMigrationTask to import + * @param importFromId The id of the existing OmsMigrationTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OmsMigrationTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_oms_migration_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_migration_task huaweicloud_oms_migration_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OmsMigrationTaskConfig + */ + public constructor(scope: Construct, id: string, config: OmsMigrationTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_oms_migration_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableFailedObjectRecording = config.enableFailedObjectRecording; + this._enableKms = config.enableKms; + this._enableRestore = config.enableRestore; + this._id = config.id; + this._migrateSince = config.migrateSince; + this._region = config.region; + this._startTask = config.startTask; + this._type = config.type; + this._bandwidthPolicy.internalValue = config.bandwidthPolicy; + this._destinationObject.internalValue = config.destinationObject; + this._smnConfig.internalValue = config.smnConfig; + this._sourceCdn.internalValue = config.sourceCdn; + this._sourceObject.internalValue = config.sourceObject; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_failed_object_recording - computed: false, optional: true, required: false + private _enableFailedObjectRecording?: boolean | cdktf.IResolvable; + public get enableFailedObjectRecording() { + return this.getBooleanAttribute('enable_failed_object_recording'); + } + public set enableFailedObjectRecording(value: boolean | cdktf.IResolvable) { + this._enableFailedObjectRecording = value; + } + public resetEnableFailedObjectRecording() { + this._enableFailedObjectRecording = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableFailedObjectRecordingInput() { + return this._enableFailedObjectRecording; + } + + // enable_kms - computed: false, optional: true, required: false + private _enableKms?: boolean | cdktf.IResolvable; + public get enableKms() { + return this.getBooleanAttribute('enable_kms'); + } + public set enableKms(value: boolean | cdktf.IResolvable) { + this._enableKms = value; + } + public resetEnableKms() { + this._enableKms = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableKmsInput() { + return this._enableKms; + } + + // enable_restore - computed: false, optional: true, required: false + private _enableRestore?: boolean | cdktf.IResolvable; + public get enableRestore() { + return this.getBooleanAttribute('enable_restore'); + } + public set enableRestore(value: boolean | cdktf.IResolvable) { + this._enableRestore = value; + } + public resetEnableRestore() { + this._enableRestore = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableRestoreInput() { + return this._enableRestore; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // migrate_since - computed: true, optional: true, required: false + private _migrateSince?: string; + public get migrateSince() { + return this.getStringAttribute('migrate_since'); + } + public set migrateSince(value: string) { + this._migrateSince = value; + } + public resetMigrateSince() { + this._migrateSince = undefined; + } + // Temporarily expose input value. Use with caution. + public get migrateSinceInput() { + return this._migrateSince; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_task - computed: false, optional: true, required: false + private _startTask?: boolean | cdktf.IResolvable; + public get startTask() { + return this.getBooleanAttribute('start_task'); + } + public set startTask(value: boolean | cdktf.IResolvable) { + this._startTask = value; + } + public resetStartTask() { + this._startTask = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTaskInput() { + return this._startTask; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // bandwidth_policy - computed: false, optional: true, required: false + private _bandwidthPolicy = new OmsMigrationTaskBandwidthPolicyList(this, "bandwidth_policy", false); + public get bandwidthPolicy() { + return this._bandwidthPolicy; + } + public putBandwidthPolicy(value: OmsMigrationTaskBandwidthPolicy[] | cdktf.IResolvable) { + this._bandwidthPolicy.internalValue = value; + } + public resetBandwidthPolicy() { + this._bandwidthPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthPolicyInput() { + return this._bandwidthPolicy.internalValue; + } + + // destination_object - computed: false, optional: false, required: true + private _destinationObject = new OmsMigrationTaskDestinationObjectOutputReference(this, "destination_object"); + public get destinationObject() { + return this._destinationObject; + } + public putDestinationObject(value: OmsMigrationTaskDestinationObject) { + this._destinationObject.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get destinationObjectInput() { + return this._destinationObject.internalValue; + } + + // smn_config - computed: false, optional: true, required: false + private _smnConfig = new OmsMigrationTaskSmnConfigOutputReference(this, "smn_config"); + public get smnConfig() { + return this._smnConfig; + } + public putSmnConfig(value: OmsMigrationTaskSmnConfig) { + this._smnConfig.internalValue = value; + } + public resetSmnConfig() { + this._smnConfig.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnConfigInput() { + return this._smnConfig.internalValue; + } + + // source_cdn - computed: false, optional: true, required: false + private _sourceCdn = new OmsMigrationTaskSourceCdnOutputReference(this, "source_cdn"); + public get sourceCdn() { + return this._sourceCdn; + } + public putSourceCdn(value: OmsMigrationTaskSourceCdn) { + this._sourceCdn.internalValue = value; + } + public resetSourceCdn() { + this._sourceCdn.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceCdnInput() { + return this._sourceCdn.internalValue; + } + + // source_object - computed: false, optional: false, required: true + private _sourceObject = new OmsMigrationTaskSourceObjectOutputReference(this, "source_object"); + public get sourceObject() { + return this._sourceObject; + } + public putSourceObject(value: OmsMigrationTaskSourceObject) { + this._sourceObject.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get sourceObjectInput() { + return this._sourceObject.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new OmsMigrationTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: OmsMigrationTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_failed_object_recording: cdktf.booleanToTerraform(this._enableFailedObjectRecording), + enable_kms: cdktf.booleanToTerraform(this._enableKms), + enable_restore: cdktf.booleanToTerraform(this._enableRestore), + id: cdktf.stringToTerraform(this._id), + migrate_since: cdktf.stringToTerraform(this._migrateSince), + region: cdktf.stringToTerraform(this._region), + start_task: cdktf.booleanToTerraform(this._startTask), + type: cdktf.stringToTerraform(this._type), + bandwidth_policy: cdktf.listMapper(omsMigrationTaskBandwidthPolicyToTerraform, true)(this._bandwidthPolicy.internalValue), + destination_object: omsMigrationTaskDestinationObjectToTerraform(this._destinationObject.internalValue), + smn_config: omsMigrationTaskSmnConfigToTerraform(this._smnConfig.internalValue), + source_cdn: omsMigrationTaskSourceCdnToTerraform(this._sourceCdn.internalValue), + source_object: omsMigrationTaskSourceObjectToTerraform(this._sourceObject.internalValue), + timeouts: omsMigrationTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_failed_object_recording: { + value: cdktf.booleanToHclTerraform(this._enableFailedObjectRecording), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_kms: { + value: cdktf.booleanToHclTerraform(this._enableKms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_restore: { + value: cdktf.booleanToHclTerraform(this._enableRestore), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + migrate_since: { + value: cdktf.stringToHclTerraform(this._migrateSince), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_task: { + value: cdktf.booleanToHclTerraform(this._startTask), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_policy: { + value: cdktf.listMapperHcl(omsMigrationTaskBandwidthPolicyToHclTerraform, true)(this._bandwidthPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskBandwidthPolicyList", + }, + destination_object: { + value: omsMigrationTaskDestinationObjectToHclTerraform(this._destinationObject.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskDestinationObjectList", + }, + smn_config: { + value: omsMigrationTaskSmnConfigToHclTerraform(this._smnConfig.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskSmnConfigList", + }, + source_cdn: { + value: omsMigrationTaskSourceCdnToHclTerraform(this._sourceCdn.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskSourceCdnList", + }, + source_object: { + value: omsMigrationTaskSourceObjectToHclTerraform(this._sourceObject.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsMigrationTaskSourceObjectList", + }, + timeouts: { + value: omsMigrationTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "OmsMigrationTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/oms-task/README.md b/src/constructs/providers/huaweicloud/oms-task/README.md new file mode 100644 index 00000000..57c39371 --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_oms_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_oms_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task). diff --git a/src/constructs/providers/huaweicloud/oms-task/index.ts b/src/constructs/providers/huaweicloud/oms-task/index.ts new file mode 100644 index 00000000..8f5089d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/oms-task/index.ts @@ -0,0 +1,1019 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OmsTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#description OmsTask#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#enable_kms OmsTask#enable_kms} + */ + readonly enableKms: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#id OmsTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#region OmsTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#thread_num OmsTask#thread_num} + */ + readonly threadNum: number; + /** + * dst_node block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#dst_node OmsTask#dst_node} + */ + readonly dstNode: OmsTaskDstNode; + /** + * smn_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#smn_info OmsTask#smn_info} + */ + readonly smnInfo?: OmsTaskSmnInfo; + /** + * src_node block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#src_node OmsTask#src_node} + */ + readonly srcNode: OmsTaskSrcNode; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#timeouts OmsTask#timeouts} + */ + readonly timeouts?: OmsTaskTimeouts; +} +export interface OmsTaskDstNode { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#ak OmsTask#ak} + */ + readonly ak: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#bucket OmsTask#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#object_key OmsTask#object_key} + */ + readonly objectKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#region OmsTask#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#sk OmsTask#sk} + */ + readonly sk: string; +} + +export function omsTaskDstNodeToTerraform(struct?: OmsTaskDstNodeOutputReference | OmsTaskDstNode): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ak: cdktf.stringToTerraform(struct!.ak), + bucket: cdktf.stringToTerraform(struct!.bucket), + object_key: cdktf.stringToTerraform(struct!.objectKey), + region: cdktf.stringToTerraform(struct!.region), + sk: cdktf.stringToTerraform(struct!.sk), + } +} + + +export function omsTaskDstNodeToHclTerraform(struct?: OmsTaskDstNodeOutputReference | OmsTaskDstNode): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ak: { + value: cdktf.stringToHclTerraform(struct!.ak), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_key: { + value: cdktf.stringToHclTerraform(struct!.objectKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sk: { + value: cdktf.stringToHclTerraform(struct!.sk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsTaskDstNodeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsTaskDstNode | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ak !== undefined) { + hasAnyValues = true; + internalValueResult.ak = this._ak; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._objectKey !== undefined) { + hasAnyValues = true; + internalValueResult.objectKey = this._objectKey; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._sk !== undefined) { + hasAnyValues = true; + internalValueResult.sk = this._sk; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsTaskDstNode | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ak = undefined; + this._bucket = undefined; + this._objectKey = undefined; + this._region = undefined; + this._sk = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ak = value.ak; + this._bucket = value.bucket; + this._objectKey = value.objectKey; + this._region = value.region; + this._sk = value.sk; + } + } + + // ak - computed: false, optional: false, required: true + private _ak?: string; + public get ak() { + return this.getStringAttribute('ak'); + } + public set ak(value: string) { + this._ak = value; + } + // Temporarily expose input value. Use with caution. + public get akInput() { + return this._ak; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // object_key - computed: false, optional: false, required: true + private _objectKey?: string; + public get objectKey() { + return this.getStringAttribute('object_key'); + } + public set objectKey(value: string) { + this._objectKey = value; + } + // Temporarily expose input value. Use with caution. + public get objectKeyInput() { + return this._objectKey; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sk - computed: false, optional: false, required: true + private _sk?: string; + public get sk() { + return this.getStringAttribute('sk'); + } + public set sk(value: string) { + this._sk = value; + } + // Temporarily expose input value. Use with caution. + public get skInput() { + return this._sk; + } +} +export interface OmsTaskSmnInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#language OmsTask#language} + */ + readonly language?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#topic_urn OmsTask#topic_urn} + */ + readonly topicUrn: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#trigger_conditions OmsTask#trigger_conditions} + */ + readonly triggerConditions: string[]; +} + +export function omsTaskSmnInfoToTerraform(struct?: OmsTaskSmnInfoOutputReference | OmsTaskSmnInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + language: cdktf.stringToTerraform(struct!.language), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + trigger_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.triggerConditions), + } +} + + +export function omsTaskSmnInfoToHclTerraform(struct?: OmsTaskSmnInfoOutputReference | OmsTaskSmnInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + language: { + value: cdktf.stringToHclTerraform(struct!.language), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.triggerConditions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsTaskSmnInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsTaskSmnInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._language !== undefined) { + hasAnyValues = true; + internalValueResult.language = this._language; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + if (this._triggerConditions !== undefined) { + hasAnyValues = true; + internalValueResult.triggerConditions = this._triggerConditions; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsTaskSmnInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._language = undefined; + this._topicUrn = undefined; + this._triggerConditions = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._language = value.language; + this._topicUrn = value.topicUrn; + this._triggerConditions = value.triggerConditions; + } + } + + // language - computed: false, optional: true, required: false + private _language?: string; + public get language() { + return this.getStringAttribute('language'); + } + public set language(value: string) { + this._language = value; + } + public resetLanguage() { + this._language = undefined; + } + // Temporarily expose input value. Use with caution. + public get languageInput() { + return this._language; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // trigger_conditions - computed: false, optional: false, required: true + private _triggerConditions?: string[]; + public get triggerConditions() { + return cdktf.Fn.tolist(this.getListAttribute('trigger_conditions')); + } + public set triggerConditions(value: string[]) { + this._triggerConditions = value; + } + // Temporarily expose input value. Use with caution. + public get triggerConditionsInput() { + return this._triggerConditions; + } +} +export interface OmsTaskSrcNode { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#ak OmsTask#ak} + */ + readonly ak: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#bucket OmsTask#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#cloud_type OmsTask#cloud_type} + */ + readonly cloudType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#object_key OmsTask#object_key} + */ + readonly objectKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#region OmsTask#region} + */ + readonly region: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#sk OmsTask#sk} + */ + readonly sk: string; +} + +export function omsTaskSrcNodeToTerraform(struct?: OmsTaskSrcNodeOutputReference | OmsTaskSrcNode): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ak: cdktf.stringToTerraform(struct!.ak), + bucket: cdktf.stringToTerraform(struct!.bucket), + cloud_type: cdktf.stringToTerraform(struct!.cloudType), + object_key: cdktf.stringToTerraform(struct!.objectKey), + region: cdktf.stringToTerraform(struct!.region), + sk: cdktf.stringToTerraform(struct!.sk), + } +} + + +export function omsTaskSrcNodeToHclTerraform(struct?: OmsTaskSrcNodeOutputReference | OmsTaskSrcNode): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ak: { + value: cdktf.stringToHclTerraform(struct!.ak), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud_type: { + value: cdktf.stringToHclTerraform(struct!.cloudType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_key: { + value: cdktf.stringToHclTerraform(struct!.objectKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sk: { + value: cdktf.stringToHclTerraform(struct!.sk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsTaskSrcNodeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): OmsTaskSrcNode | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ak !== undefined) { + hasAnyValues = true; + internalValueResult.ak = this._ak; + } + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._cloudType !== undefined) { + hasAnyValues = true; + internalValueResult.cloudType = this._cloudType; + } + if (this._objectKey !== undefined) { + hasAnyValues = true; + internalValueResult.objectKey = this._objectKey; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._sk !== undefined) { + hasAnyValues = true; + internalValueResult.sk = this._sk; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsTaskSrcNode | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ak = undefined; + this._bucket = undefined; + this._cloudType = undefined; + this._objectKey = undefined; + this._region = undefined; + this._sk = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ak = value.ak; + this._bucket = value.bucket; + this._cloudType = value.cloudType; + this._objectKey = value.objectKey; + this._region = value.region; + this._sk = value.sk; + } + } + + // ak - computed: false, optional: false, required: true + private _ak?: string; + public get ak() { + return this.getStringAttribute('ak'); + } + public set ak(value: string) { + this._ak = value; + } + // Temporarily expose input value. Use with caution. + public get akInput() { + return this._ak; + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // cloud_type - computed: false, optional: true, required: false + private _cloudType?: string; + public get cloudType() { + return this.getStringAttribute('cloud_type'); + } + public set cloudType(value: string) { + this._cloudType = value; + } + public resetCloudType() { + this._cloudType = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudTypeInput() { + return this._cloudType; + } + + // object_key - computed: false, optional: false, required: true + private _objectKey?: string; + public get objectKey() { + return this.getStringAttribute('object_key'); + } + public set objectKey(value: string) { + this._objectKey = value; + } + // Temporarily expose input value. Use with caution. + public get objectKeyInput() { + return this._objectKey; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sk - computed: false, optional: false, required: true + private _sk?: string; + public get sk() { + return this.getStringAttribute('sk'); + } + public set sk(value: string) { + this._sk = value; + } + // Temporarily expose input value. Use with caution. + public get skInput() { + return this._sk; + } +} +export interface OmsTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#create OmsTask#create} + */ + readonly create?: string; +} + +export function omsTaskTimeoutsToTerraform(struct?: OmsTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function omsTaskTimeoutsToHclTerraform(struct?: OmsTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OmsTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): OmsTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OmsTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task huaweicloud_oms_task} +*/ +export class OmsTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_oms_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OmsTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OmsTask to import + * @param importFromId The id of the existing OmsTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OmsTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_oms_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/oms_task huaweicloud_oms_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OmsTaskConfig + */ + public constructor(scope: Construct, id: string, config: OmsTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_oms_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableKms = config.enableKms; + this._id = config.id; + this._region = config.region; + this._threadNum = config.threadNum; + this._dstNode.internalValue = config.dstNode; + this._smnInfo.internalValue = config.smnInfo; + this._srcNode.internalValue = config.srcNode; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_kms - computed: false, optional: false, required: true + private _enableKms?: boolean | cdktf.IResolvable; + public get enableKms() { + return this.getBooleanAttribute('enable_kms'); + } + public set enableKms(value: boolean | cdktf.IResolvable) { + this._enableKms = value; + } + // Temporarily expose input value. Use with caution. + public get enableKmsInput() { + return this._enableKms; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // thread_num - computed: false, optional: false, required: true + private _threadNum?: number; + public get threadNum() { + return this.getNumberAttribute('thread_num'); + } + public set threadNum(value: number) { + this._threadNum = value; + } + // Temporarily expose input value. Use with caution. + public get threadNumInput() { + return this._threadNum; + } + + // dst_node - computed: false, optional: false, required: true + private _dstNode = new OmsTaskDstNodeOutputReference(this, "dst_node"); + public get dstNode() { + return this._dstNode; + } + public putDstNode(value: OmsTaskDstNode) { + this._dstNode.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dstNodeInput() { + return this._dstNode.internalValue; + } + + // smn_info - computed: false, optional: true, required: false + private _smnInfo = new OmsTaskSmnInfoOutputReference(this, "smn_info"); + public get smnInfo() { + return this._smnInfo; + } + public putSmnInfo(value: OmsTaskSmnInfo) { + this._smnInfo.internalValue = value; + } + public resetSmnInfo() { + this._smnInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnInfoInput() { + return this._smnInfo.internalValue; + } + + // src_node - computed: false, optional: false, required: true + private _srcNode = new OmsTaskSrcNodeOutputReference(this, "src_node"); + public get srcNode() { + return this._srcNode; + } + public putSrcNode(value: OmsTaskSrcNode) { + this._srcNode.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get srcNodeInput() { + return this._srcNode.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new OmsTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: OmsTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_kms: cdktf.booleanToTerraform(this._enableKms), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + thread_num: cdktf.numberToTerraform(this._threadNum), + dst_node: omsTaskDstNodeToTerraform(this._dstNode.internalValue), + smn_info: omsTaskSmnInfoToTerraform(this._smnInfo.internalValue), + src_node: omsTaskSrcNodeToTerraform(this._srcNode.internalValue), + timeouts: omsTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_kms: { + value: cdktf.booleanToHclTerraform(this._enableKms), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thread_num: { + value: cdktf.numberToHclTerraform(this._threadNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dst_node: { + value: omsTaskDstNodeToHclTerraform(this._dstNode.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsTaskDstNodeList", + }, + smn_info: { + value: omsTaskSmnInfoToHclTerraform(this._smnInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsTaskSmnInfoList", + }, + src_node: { + value: omsTaskSrcNodeToHclTerraform(this._srcNode.internalValue), + isBlock: true, + type: "list", + storageClassType: "OmsTaskSrcNodeList", + }, + timeouts: { + value: omsTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "OmsTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-account-associate/README.md b/src/constructs/providers/huaweicloud/organizations-account-associate/README.md new file mode 100644 index 00000000..fdc4b79c --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_account_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_account_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate). diff --git a/src/constructs/providers/huaweicloud/organizations-account-associate/index.ts b/src/constructs/providers/huaweicloud/organizations-account-associate/index.ts new file mode 100644 index 00000000..11cd3a6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-associate/index.ts @@ -0,0 +1,190 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsAccountAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate#account_id OrganizationsAccountAssociate#account_id} + */ + readonly accountId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate#id OrganizationsAccountAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of root or organizational unit in which you want to move the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate#parent_id OrganizationsAccountAssociate#parent_id} + */ + readonly parentId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate huaweicloud_organizations_account_associate} +*/ +export class OrganizationsAccountAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_account_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsAccountAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsAccountAssociate to import + * @param importFromId The id of the existing OrganizationsAccountAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsAccountAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_account_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_associate huaweicloud_organizations_account_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsAccountAssociateConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsAccountAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_account_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountId = config.accountId; + this._id = config.id; + this._parentId = config.parentId; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: false, optional: false, required: true + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // joined_method - computed: true, optional: false, required: false + public get joinedMethod() { + return this.getStringAttribute('joined_method'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // parent_id - computed: false, optional: false, required: true + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_id: cdktf.stringToTerraform(this._accountId), + id: cdktf.stringToTerraform(this._id), + parent_id: cdktf.stringToTerraform(this._parentId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(this._accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-account-invite-accepter/README.md b/src/constructs/providers/huaweicloud/organizations-account-invite-accepter/README.md new file mode 100644 index 00000000..e0ce35b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-invite-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_account_invite_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_account_invite_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter). diff --git a/src/constructs/providers/huaweicloud/organizations-account-invite-accepter/index.ts b/src/constructs/providers/huaweicloud/organizations-account-invite-accepter/index.ts new file mode 100644 index 00000000..6d6e5aa9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-invite-accepter/index.ts @@ -0,0 +1,213 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsAccountInviteAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter#id OrganizationsAccountInviteAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the unique ID of an invitation (handshake). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter#invitation_id OrganizationsAccountInviteAccepter#invitation_id} + */ + readonly invitationId: string; + /** + * Specifies whether to leave the organization when delete the invitation (handshake). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter#leave_organization_on_destroy OrganizationsAccountInviteAccepter#leave_organization_on_destroy} + */ + readonly leaveOrganizationOnDestroy?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter huaweicloud_organizations_account_invite_accepter} +*/ +export class OrganizationsAccountInviteAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_account_invite_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsAccountInviteAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsAccountInviteAccepter to import + * @param importFromId The id of the existing OrganizationsAccountInviteAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsAccountInviteAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_account_invite_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_accepter huaweicloud_organizations_account_invite_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsAccountInviteAccepterConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsAccountInviteAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_account_invite_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._invitationId = config.invitationId; + this._leaveOrganizationOnDestroy = config.leaveOrganizationOnDestroy; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: true, optional: false, required: false + public get accountId() { + return this.getStringAttribute('account_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // invitation_id - computed: false, optional: false, required: true + private _invitationId?: string; + public get invitationId() { + return this.getStringAttribute('invitation_id'); + } + public set invitationId(value: string) { + this._invitationId = value; + } + // Temporarily expose input value. Use with caution. + public get invitationIdInput() { + return this._invitationId; + } + + // leave_organization_on_destroy - computed: false, optional: true, required: false + private _leaveOrganizationOnDestroy?: boolean | cdktf.IResolvable; + public get leaveOrganizationOnDestroy() { + return this.getBooleanAttribute('leave_organization_on_destroy'); + } + public set leaveOrganizationOnDestroy(value: boolean | cdktf.IResolvable) { + this._leaveOrganizationOnDestroy = value; + } + public resetLeaveOrganizationOnDestroy() { + this._leaveOrganizationOnDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get leaveOrganizationOnDestroyInput() { + return this._leaveOrganizationOnDestroy; + } + + // master_account_id - computed: true, optional: false, required: false + public get masterAccountId() { + return this.getStringAttribute('master_account_id'); + } + + // master_account_name - computed: true, optional: false, required: false + public get masterAccountName() { + return this.getStringAttribute('master_account_name'); + } + + // organization_id - computed: true, optional: false, required: false + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + invitation_id: cdktf.stringToTerraform(this._invitationId), + leave_organization_on_destroy: cdktf.booleanToTerraform(this._leaveOrganizationOnDestroy), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invitation_id: { + value: cdktf.stringToHclTerraform(this._invitationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + leave_organization_on_destroy: { + value: cdktf.booleanToHclTerraform(this._leaveOrganizationOnDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-account-invite-decliner/README.md b/src/constructs/providers/huaweicloud/organizations-account-invite-decliner/README.md new file mode 100644 index 00000000..6d49a165 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-invite-decliner/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_account_invite_decliner` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_account_invite_decliner`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner). diff --git a/src/constructs/providers/huaweicloud/organizations-account-invite-decliner/index.ts b/src/constructs/providers/huaweicloud/organizations-account-invite-decliner/index.ts new file mode 100644 index 00000000..60a3e728 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-invite-decliner/index.ts @@ -0,0 +1,143 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsAccountInviteDeclinerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner#id OrganizationsAccountInviteDecliner#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the unique ID of an invitation (handshake). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner#invitation_id OrganizationsAccountInviteDecliner#invitation_id} + */ + readonly invitationId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner huaweicloud_organizations_account_invite_decliner} +*/ +export class OrganizationsAccountInviteDecliner extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_account_invite_decliner"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsAccountInviteDecliner resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsAccountInviteDecliner to import + * @param importFromId The id of the existing OrganizationsAccountInviteDecliner that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsAccountInviteDecliner to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_account_invite_decliner", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite_decliner huaweicloud_organizations_account_invite_decliner} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsAccountInviteDeclinerConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsAccountInviteDeclinerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_account_invite_decliner', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._invitationId = config.invitationId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // invitation_id - computed: false, optional: false, required: true + private _invitationId?: string; + public get invitationId() { + return this.getStringAttribute('invitation_id'); + } + public set invitationId(value: string) { + this._invitationId = value; + } + // Temporarily expose input value. Use with caution. + public get invitationIdInput() { + return this._invitationId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + invitation_id: cdktf.stringToTerraform(this._invitationId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invitation_id: { + value: cdktf.stringToHclTerraform(this._invitationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-account-invite/README.md b/src/constructs/providers/huaweicloud/organizations-account-invite/README.md new file mode 100644 index 00000000..ff5900a2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-invite/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_account_invite` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_account_invite`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite). diff --git a/src/constructs/providers/huaweicloud/organizations-account-invite/index.ts b/src/constructs/providers/huaweicloud/organizations-account-invite/index.ts new file mode 100644 index 00000000..bbade460 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account-invite/index.ts @@ -0,0 +1,208 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsAccountInviteConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the target account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite#account_id OrganizationsAccountInvite#account_id} + */ + readonly accountId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite#id OrganizationsAccountInvite#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether to remove the invited account when delete the invitation (handshake). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite#remove_account_on_destroy OrganizationsAccountInvite#remove_account_on_destroy} + */ + readonly removeAccountOnDestroy?: boolean | cdktf.IResolvable; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite huaweicloud_organizations_account_invite} +*/ +export class OrganizationsAccountInvite extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_account_invite"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsAccountInvite resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsAccountInvite to import + * @param importFromId The id of the existing OrganizationsAccountInvite that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsAccountInvite to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_account_invite", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account_invite huaweicloud_organizations_account_invite} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsAccountInviteConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsAccountInviteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_account_invite', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountId = config.accountId; + this._id = config.id; + this._removeAccountOnDestroy = config.removeAccountOnDestroy; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: false, optional: false, required: true + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // master_account_id - computed: true, optional: false, required: false + public get masterAccountId() { + return this.getStringAttribute('master_account_id'); + } + + // master_account_name - computed: true, optional: false, required: false + public get masterAccountName() { + return this.getStringAttribute('master_account_name'); + } + + // organization_id - computed: true, optional: false, required: false + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + + // remove_account_on_destroy - computed: false, optional: true, required: false + private _removeAccountOnDestroy?: boolean | cdktf.IResolvable; + public get removeAccountOnDestroy() { + return this.getBooleanAttribute('remove_account_on_destroy'); + } + public set removeAccountOnDestroy(value: boolean | cdktf.IResolvable) { + this._removeAccountOnDestroy = value; + } + public resetRemoveAccountOnDestroy() { + this._removeAccountOnDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get removeAccountOnDestroyInput() { + return this._removeAccountOnDestroy; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_id: cdktf.stringToTerraform(this._accountId), + id: cdktf.stringToTerraform(this._id), + remove_account_on_destroy: cdktf.booleanToTerraform(this._removeAccountOnDestroy), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(this._accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remove_account_on_destroy: { + value: cdktf.booleanToHclTerraform(this._removeAccountOnDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-account/README.md b/src/constructs/providers/huaweicloud/organizations-account/README.md new file mode 100644 index 00000000..c108d6cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account). diff --git a/src/constructs/providers/huaweicloud/organizations-account/index.ts b/src/constructs/providers/huaweicloud/organizations-account/index.ts new file mode 100644 index 00000000..3b69db9e --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-account/index.ts @@ -0,0 +1,455 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#agency_name OrganizationsAccount#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#description OrganizationsAccount#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#email OrganizationsAccount#email} + */ + readonly email?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#id OrganizationsAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#name OrganizationsAccount#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#parent_id OrganizationsAccount#parent_id} + */ + readonly parentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#phone OrganizationsAccount#phone} + */ + readonly phone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#tags OrganizationsAccount#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#timeouts OrganizationsAccount#timeouts} + */ + readonly timeouts?: OrganizationsAccountTimeouts; +} +export interface OrganizationsAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#create OrganizationsAccount#create} + */ + readonly create?: string; +} + +export function organizationsAccountTimeoutsToTerraform(struct?: OrganizationsAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function organizationsAccountTimeoutsToHclTerraform(struct?: OrganizationsAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OrganizationsAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): OrganizationsAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OrganizationsAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account huaweicloud_organizations_account} +*/ +export class OrganizationsAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsAccount to import + * @param importFromId The id of the existing OrganizationsAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_account huaweicloud_organizations_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsAccountConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._description = config.description; + this._email = config.email; + this._id = config.id; + this._name = config.name; + this._parentId = config.parentId; + this._phone = config.phone; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // email - computed: true, optional: true, required: false + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + public resetEmail() { + this._email = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // intl_number_prefix - computed: true, optional: false, required: false + public get intlNumberPrefix() { + return this.getStringAttribute('intl_number_prefix'); + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // joined_method - computed: true, optional: false, required: false + public get joinedMethod() { + return this.getStringAttribute('joined_method'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: true, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // phone - computed: true, optional: true, required: false + private _phone?: string; + public get phone() { + return this.getStringAttribute('phone'); + } + public set phone(value: string) { + this._phone = value; + } + public resetPhone() { + this._phone = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneInput() { + return this._phone; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new OrganizationsAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: OrganizationsAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + description: cdktf.stringToTerraform(this._description), + email: cdktf.stringToTerraform(this._email), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + phone: cdktf.stringToTerraform(this._phone), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: organizationsAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone: { + value: cdktf.stringToHclTerraform(this._phone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: organizationsAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "OrganizationsAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-delegated-administrator/README.md b/src/constructs/providers/huaweicloud/organizations-delegated-administrator/README.md new file mode 100644 index 00000000..cee7f249 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-delegated-administrator/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_delegated_administrator` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_delegated_administrator`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator). diff --git a/src/constructs/providers/huaweicloud/organizations-delegated-administrator/index.ts b/src/constructs/providers/huaweicloud/organizations-delegated-administrator/index.ts new file mode 100644 index 00000000..df63999c --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-delegated-administrator/index.ts @@ -0,0 +1,170 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsDelegatedAdministratorConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the unique ID of an account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator#account_id OrganizationsDelegatedAdministrator#account_id} + */ + readonly accountId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator#id OrganizationsDelegatedAdministrator#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the service principal. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator#service_principal OrganizationsDelegatedAdministrator#service_principal} + */ + readonly servicePrincipal: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator huaweicloud_organizations_delegated_administrator} +*/ +export class OrganizationsDelegatedAdministrator extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_delegated_administrator"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsDelegatedAdministrator resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsDelegatedAdministrator to import + * @param importFromId The id of the existing OrganizationsDelegatedAdministrator that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsDelegatedAdministrator to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_delegated_administrator", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_delegated_administrator huaweicloud_organizations_delegated_administrator} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsDelegatedAdministratorConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsDelegatedAdministratorConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_delegated_administrator', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountId = config.accountId; + this._id = config.id; + this._servicePrincipal = config.servicePrincipal; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: false, optional: false, required: true + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // service_principal - computed: false, optional: false, required: true + private _servicePrincipal?: string; + public get servicePrincipal() { + return this.getStringAttribute('service_principal'); + } + public set servicePrincipal(value: string) { + this._servicePrincipal = value; + } + // Temporarily expose input value. Use with caution. + public get servicePrincipalInput() { + return this._servicePrincipal; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_id: cdktf.stringToTerraform(this._accountId), + id: cdktf.stringToTerraform(this._id), + service_principal: cdktf.stringToTerraform(this._servicePrincipal), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(this._accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_principal: { + value: cdktf.stringToHclTerraform(this._servicePrincipal), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-organization/README.md b/src/constructs/providers/huaweicloud/organizations-organization/README.md new file mode 100644 index 00000000..458bd99b --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-organization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_organization` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_organization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization). diff --git a/src/constructs/providers/huaweicloud/organizations-organization/index.ts b/src/constructs/providers/huaweicloud/organizations-organization/index.ts new file mode 100644 index 00000000..0b303892 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-organization/index.ts @@ -0,0 +1,366 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsOrganizationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the list of Organizations policy types to enable in the Organization Root. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#enabled_policy_types OrganizationsOrganization#enabled_policy_types} + */ + readonly enabledPolicyTypes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#id OrganizationsOrganization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#root_tags OrganizationsOrganization#root_tags} + */ + readonly rootTags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#timeouts OrganizationsOrganization#timeouts} + */ + readonly timeouts?: OrganizationsOrganizationTimeouts; +} +export interface OrganizationsOrganizationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#create OrganizationsOrganization#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#update OrganizationsOrganization#update} + */ + readonly update?: string; +} + +export function organizationsOrganizationTimeoutsToTerraform(struct?: OrganizationsOrganizationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function organizationsOrganizationTimeoutsToHclTerraform(struct?: OrganizationsOrganizationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class OrganizationsOrganizationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): OrganizationsOrganizationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: OrganizationsOrganizationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization huaweicloud_organizations_organization} +*/ +export class OrganizationsOrganization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_organization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsOrganization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsOrganization to import + * @param importFromId The id of the existing OrganizationsOrganization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsOrganization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_organization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organization huaweicloud_organizations_organization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsOrganizationConfig = {} + */ + public constructor(scope: Construct, id: string, config: OrganizationsOrganizationConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_organization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabledPolicyTypes = config.enabledPolicyTypes; + this._id = config.id; + this._rootTags = config.rootTags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enabled_policy_types - computed: false, optional: true, required: false + private _enabledPolicyTypes?: string[]; + public get enabledPolicyTypes() { + return cdktf.Fn.tolist(this.getListAttribute('enabled_policy_types')); + } + public set enabledPolicyTypes(value: string[]) { + this._enabledPolicyTypes = value; + } + public resetEnabledPolicyTypes() { + this._enabledPolicyTypes = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledPolicyTypesInput() { + return this._enabledPolicyTypes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // master_account_id - computed: true, optional: false, required: false + public get masterAccountId() { + return this.getStringAttribute('master_account_id'); + } + + // master_account_name - computed: true, optional: false, required: false + public get masterAccountName() { + return this.getStringAttribute('master_account_name'); + } + + // root_id - computed: true, optional: false, required: false + public get rootId() { + return this.getStringAttribute('root_id'); + } + + // root_name - computed: true, optional: false, required: false + public get rootName() { + return this.getStringAttribute('root_name'); + } + + // root_tags - computed: false, optional: true, required: false + private _rootTags?: { [key: string]: string }; + public get rootTags() { + return this.getStringMapAttribute('root_tags'); + } + public set rootTags(value: { [key: string]: string }) { + this._rootTags = value; + } + public resetRootTags() { + this._rootTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get rootTagsInput() { + return this._rootTags; + } + + // root_urn - computed: true, optional: false, required: false + public get rootUrn() { + return this.getStringAttribute('root_urn'); + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new OrganizationsOrganizationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: OrganizationsOrganizationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled_policy_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._enabledPolicyTypes), + id: cdktf.stringToTerraform(this._id), + root_tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._rootTags), + timeouts: organizationsOrganizationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled_policy_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._enabledPolicyTypes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + root_tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._rootTags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: organizationsOrganizationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "OrganizationsOrganizationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-organizational-unit/README.md b/src/constructs/providers/huaweicloud/organizations-organizational-unit/README.md new file mode 100644 index 00000000..c6a1acca --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-organizational-unit/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_organizational_unit` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_organizational_unit`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit). diff --git a/src/constructs/providers/huaweicloud/organizations-organizational-unit/index.ts b/src/constructs/providers/huaweicloud/organizations-organizational-unit/index.ts new file mode 100644 index 00000000..e5674541 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-organizational-unit/index.ts @@ -0,0 +1,209 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsOrganizationalUnitConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit#id OrganizationsOrganizationalUnit#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the organizational unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit#name OrganizationsOrganizationalUnit#name} + */ + readonly name: string; + /** + * Specifies the ID of the root or organizational unit in which you + * want to create a new organizational unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit#parent_id OrganizationsOrganizationalUnit#parent_id} + */ + readonly parentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit#tags OrganizationsOrganizationalUnit#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit huaweicloud_organizations_organizational_unit} +*/ +export class OrganizationsOrganizationalUnit extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_organizational_unit"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsOrganizationalUnit resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsOrganizationalUnit to import + * @param importFromId The id of the existing OrganizationsOrganizationalUnit that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsOrganizationalUnit to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_organizational_unit", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_organizational_unit huaweicloud_organizations_organizational_unit} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsOrganizationalUnitConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsOrganizationalUnitConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_organizational_unit', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._parentId = config.parentId; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: false, optional: false, required: true + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-policy-attach/README.md b/src/constructs/providers/huaweicloud/organizations-policy-attach/README.md new file mode 100644 index 00000000..4a8b22be --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-policy-attach/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_policy_attach` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_policy_attach`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach). diff --git a/src/constructs/providers/huaweicloud/organizations-policy-attach/index.ts b/src/constructs/providers/huaweicloud/organizations-policy-attach/index.ts new file mode 100644 index 00000000..3496fb3b --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-policy-attach/index.ts @@ -0,0 +1,180 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsPolicyAttachConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the unique ID of the root, OU, or account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach#entity_id OrganizationsPolicyAttach#entity_id} + */ + readonly entityId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach#id OrganizationsPolicyAttach#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach#policy_id OrganizationsPolicyAttach#policy_id} + */ + readonly policyId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach huaweicloud_organizations_policy_attach} +*/ +export class OrganizationsPolicyAttach extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_policy_attach"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsPolicyAttach resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsPolicyAttach to import + * @param importFromId The id of the existing OrganizationsPolicyAttach that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsPolicyAttach to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_policy_attach", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy_attach huaweicloud_organizations_policy_attach} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsPolicyAttachConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsPolicyAttachConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_policy_attach', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._entityId = config.entityId; + this._id = config.id; + this._policyId = config.policyId; + } + + // ========== + // ATTRIBUTES + // ========== + + // entity_id - computed: false, optional: false, required: true + private _entityId?: string; + public get entityId() { + return this.getStringAttribute('entity_id'); + } + public set entityId(value: string) { + this._entityId = value; + } + // Temporarily expose input value. Use with caution. + public get entityIdInput() { + return this._entityId; + } + + // entity_name - computed: true, optional: false, required: false + public get entityName() { + return this.getStringAttribute('entity_name'); + } + + // entity_type - computed: true, optional: false, required: false + public get entityType() { + return this.getStringAttribute('entity_type'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + entity_id: cdktf.stringToTerraform(this._entityId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + entity_id: { + value: cdktf.stringToHclTerraform(this._entityId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-policy/README.md b/src/constructs/providers/huaweicloud/organizations-policy/README.md new file mode 100644 index 00000000..09fe78b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy). diff --git a/src/constructs/providers/huaweicloud/organizations-policy/index.ts b/src/constructs/providers/huaweicloud/organizations-policy/index.ts new file mode 100644 index 00000000..383c1511 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-policy/index.ts @@ -0,0 +1,260 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the policy text content to be added to the new policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#content OrganizationsPolicy#content} + */ + readonly content: string; + /** + * Specifies the description to be assigned to the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#description OrganizationsPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#id OrganizationsPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name to be assigned to the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#name OrganizationsPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#tags OrganizationsPolicy#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the type of the policy to be created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#type OrganizationsPolicy#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy huaweicloud_organizations_policy} +*/ +export class OrganizationsPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsPolicy to import + * @param importFromId The id of the existing OrganizationsPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_policy huaweicloud_organizations_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsPolicyConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._tags = config.tags; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/organizations-trusted-service/README.md b/src/constructs/providers/huaweicloud/organizations-trusted-service/README.md new file mode 100644 index 00000000..ee58f531 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-trusted-service/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_organizations_trusted_service` + +Refer to the Terraform Registry for docs: [`huaweicloud_organizations_trusted_service`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service). diff --git a/src/constructs/providers/huaweicloud/organizations-trusted-service/index.ts b/src/constructs/providers/huaweicloud/organizations-trusted-service/index.ts new file mode 100644 index 00000000..8ff969c8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/organizations-trusted-service/index.ts @@ -0,0 +1,148 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface OrganizationsTrustedServiceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service#id OrganizationsTrustedService#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the trusted service principal. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service#service OrganizationsTrustedService#service} + */ + readonly service: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service huaweicloud_organizations_trusted_service} +*/ +export class OrganizationsTrustedService extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_organizations_trusted_service"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a OrganizationsTrustedService resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the OrganizationsTrustedService to import + * @param importFromId The id of the existing OrganizationsTrustedService that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the OrganizationsTrustedService to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_organizations_trusted_service", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/organizations_trusted_service huaweicloud_organizations_trusted_service} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options OrganizationsTrustedServiceConfig + */ + public constructor(scope: Construct, id: string, config: OrganizationsTrustedServiceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_organizations_trusted_service', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._service = config.service; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled_at - computed: true, optional: false, required: false + public get enabledAt() { + return this.getStringAttribute('enabled_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + service: cdktf.stringToTerraform(this._service), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service: { + value: cdktf.stringToHclTerraform(this._service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/projectman-project/README.md b/src/constructs/providers/huaweicloud/projectman-project/README.md new file mode 100644 index 00000000..b61480c9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/projectman-project/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_projectman_project` + +Refer to the Terraform Registry for docs: [`huaweicloud_projectman_project`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project). diff --git a/src/constructs/providers/huaweicloud/projectman-project/index.ts b/src/constructs/providers/huaweicloud/projectman-project/index.ts new file mode 100644 index 00000000..83ce5140 --- /dev/null +++ b/src/constructs/providers/huaweicloud/projectman-project/index.ts @@ -0,0 +1,333 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ProjectmanProjectConfig extends cdktf.TerraformMetaArguments { + /** + * The description about the project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#description ProjectmanProject#description} + */ + readonly description?: string; + /** + * The enterprise project ID of the project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#enterprise_project_id ProjectmanProject#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#id ProjectmanProject#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The project name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#name ProjectmanProject#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#region ProjectmanProject#region} + */ + readonly region?: string; + /** + * The source of project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#source ProjectmanProject#source} + */ + readonly source?: string; + /** + * The template id which used to create project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#template_id ProjectmanProject#template_id} + */ + readonly templateId?: number; + /** + * The type of project. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#type ProjectmanProject#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project huaweicloud_projectman_project} +*/ +export class ProjectmanProject extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_projectman_project"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ProjectmanProject resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ProjectmanProject to import + * @param importFromId The id of the existing ProjectmanProject that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ProjectmanProject to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_projectman_project", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/projectman_project huaweicloud_projectman_project} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ProjectmanProjectConfig + */ + public constructor(scope: Construct, id: string, config: ProjectmanProjectConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_projectman_project', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._source = config.source; + this._templateId = config.templateId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // archive - computed: true, optional: false, required: false + public get archive() { + return this.getNumberAttribute('archive'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_code - computed: true, optional: false, required: false + public get projectCode() { + return this.getStringAttribute('project_code'); + } + + // project_num_id - computed: true, optional: false, required: false + public get projectNumId() { + return this.getNumberAttribute('project_num_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source - computed: true, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // template_id - computed: true, optional: true, required: false + private _templateId?: number; + public get templateId() { + return this.getNumberAttribute('template_id'); + } + public set templateId(value: number) { + this._templateId = value; + } + public resetTemplateId() { + this._templateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateIdInput() { + return this._templateId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source: cdktf.stringToTerraform(this._source), + template_id: cdktf.numberToTerraform(this._templateId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_id: { + value: cdktf.numberToHclTerraform(this._templateId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/provider/README.md b/src/constructs/providers/huaweicloud/provider/README.md new file mode 100644 index 00000000..1688ce65 --- /dev/null +++ b/src/constructs/providers/huaweicloud/provider/README.md @@ -0,0 +1,3 @@ +# `provider` + +Refer to the Terraform Registry for docs: [`huaweicloud`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs). diff --git a/src/constructs/providers/huaweicloud/provider/index.ts b/src/constructs/providers/huaweicloud/provider/index.ts new file mode 100644 index 00000000..a43203e3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/provider/index.ts @@ -0,0 +1,1103 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface HuaweicloudProviderConfig { + /** + * The access key of the HuaweiCloud to use. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#access_key HuaweicloudProvider#access_key} + */ + readonly accessKey?: string; + /** + * The name of domain who created the agency (Identity v3). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#agency_domain_name HuaweicloudProvider#agency_domain_name} + */ + readonly agencyDomainName?: string; + /** + * The name of agency + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#agency_name HuaweicloudProvider#agency_name} + */ + readonly agencyName?: string; + /** + * The Identity authentication URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#auth_url HuaweicloudProvider#auth_url} + */ + readonly authUrl?: string; + /** + * A Custom CA certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#cacert_file HuaweicloudProvider#cacert_file} + */ + readonly cacertFile?: string; + /** + * A client certificate to authenticate with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#cert HuaweicloudProvider#cert} + */ + readonly cert?: string; + /** + * The endpoint of cloud provider, defaults to myhuaweicloud.com + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#cloud HuaweicloudProvider#cloud} + */ + readonly cloud?: string; + /** + * The name of delegated project (Identity v3). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#delegated_project HuaweicloudProvider#delegated_project} + */ + readonly delegatedProject?: string; + /** + * The ID of the Domain to scope to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#domain_id HuaweicloudProvider#domain_id} + */ + readonly domainId?: string; + /** + * The name of the Domain to scope to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#domain_name HuaweicloudProvider#domain_name} + */ + readonly domainName?: string; + /** + * Whether to enable ForceNew + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#enable_force_new HuaweicloudProvider#enable_force_new} + */ + readonly enableForceNew?: boolean | cdktf.IResolvable; + /** + * The custom endpoints used to override the default endpoint URL. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#endpoints HuaweicloudProvider#endpoints} + */ + readonly endpoints?: { [key: string]: string }; + /** + * enterprise project id + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#enterprise_project_id HuaweicloudProvider#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Trust self-signed certificates. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#insecure HuaweicloudProvider#insecure} + */ + readonly insecure?: boolean | cdktf.IResolvable; + /** + * A client private key to authenticate with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#key HuaweicloudProvider#key} + */ + readonly key?: string; + /** + * How many times HTTP connection should be retried until giving up. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#max_retries HuaweicloudProvider#max_retries} + */ + readonly maxRetries?: number; + /** + * Password to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#password HuaweicloudProvider#password} + */ + readonly password?: string; + /** + * The profile name as set in the shared config file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#profile HuaweicloudProvider#profile} + */ + readonly profile?: string; + /** + * The ID of the project to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#project_id HuaweicloudProvider#project_id} + */ + readonly projectId?: string; + /** + * The name of the project to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#project_name HuaweicloudProvider#project_name} + */ + readonly projectName?: string; + /** + * The HuaweiCloud region to connect to. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#region HuaweicloudProvider#region} + */ + readonly region?: string; + /** + * Whether the service endpoints are regional + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#regional HuaweicloudProvider#regional} + */ + readonly regional?: boolean | cdktf.IResolvable; + /** + * The secret key of the HuaweiCloud to use. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#secret_key HuaweicloudProvider#secret_key} + */ + readonly secretKey?: string; + /** + * The security token to authenticate with a temporary security credential. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#security_token HuaweicloudProvider#security_token} + */ + readonly securityToken?: string; + /** + * The path to the shared config file. If not set, the default is ~/.hcloud/config.json. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#shared_config_file HuaweicloudProvider#shared_config_file} + */ + readonly sharedConfigFile?: string; + /** + * The ID of the Tenant (Identity v2) to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#tenant_id HuaweicloudProvider#tenant_id} + */ + readonly tenantId?: string; + /** + * The name of the Tenant (Identity v2) to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#tenant_name HuaweicloudProvider#tenant_name} + */ + readonly tenantName?: string; + /** + * Authentication token to use as an alternative to username/password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#token HuaweicloudProvider#token} + */ + readonly token?: string; + /** + * User ID to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#user_id HuaweicloudProvider#user_id} + */ + readonly userId?: string; + /** + * Username to login with. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#user_name HuaweicloudProvider#user_name} + */ + readonly userName?: string; + /** + * Alias name + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#alias HuaweicloudProvider#alias} + */ + readonly alias?: string; + /** + * assume_role block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#assume_role HuaweicloudProvider#assume_role} + */ + readonly assumeRole?: HuaweicloudProviderAssumeRole; +} +export interface HuaweicloudProviderAssumeRole { + /** + * The name of agency for assume role. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#agency_name HuaweicloudProvider#agency_name} + */ + readonly agencyName: string; + /** + * The id of domain for v5 assume role. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#domain_id HuaweicloudProvider#domain_id} + */ + readonly domainId?: string; + /** + * The name of domain for assume role. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#domain_name HuaweicloudProvider#domain_name} + */ + readonly domainName: string; +} + +export function huaweicloudProviderAssumeRoleToTerraform(struct?: HuaweicloudProviderAssumeRole): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + agency_name: cdktf.stringToTerraform(struct!.agencyName), + domain_id: cdktf.stringToTerraform(struct!.domainId), + domain_name: cdktf.stringToTerraform(struct!.domainName), + } +} + + +export function huaweicloudProviderAssumeRoleToHclTerraform(struct?: HuaweicloudProviderAssumeRole): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(struct!.agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_id: { + value: cdktf.stringToHclTerraform(struct!.domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(struct!.domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs huaweicloud} +*/ +export class HuaweicloudProvider extends cdktf.TerraformProvider { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a HuaweicloudProvider resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the HuaweicloudProvider to import + * @param importFromId The id of the existing HuaweicloudProvider that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the HuaweicloudProvider to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs huaweicloud} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options HuaweicloudProviderConfig = {} + */ + public constructor(scope: Construct, id: string, config: HuaweicloudProviderConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + terraformProviderSource: 'huaweicloud/huaweicloud' + }); + this._accessKey = config.accessKey; + this._agencyDomainName = config.agencyDomainName; + this._agencyName = config.agencyName; + this._authUrl = config.authUrl; + this._cacertFile = config.cacertFile; + this._cert = config.cert; + this._cloud = config.cloud; + this._delegatedProject = config.delegatedProject; + this._domainId = config.domainId; + this._domainName = config.domainName; + this._enableForceNew = config.enableForceNew; + this._endpoints = config.endpoints; + this._enterpriseProjectId = config.enterpriseProjectId; + this._insecure = config.insecure; + this._key = config.key; + this._maxRetries = config.maxRetries; + this._password = config.password; + this._profile = config.profile; + this._projectId = config.projectId; + this._projectName = config.projectName; + this._region = config.region; + this._regional = config.regional; + this._secretKey = config.secretKey; + this._securityToken = config.securityToken; + this._sharedConfigFile = config.sharedConfigFile; + this._tenantId = config.tenantId; + this._tenantName = config.tenantName; + this._token = config.token; + this._userId = config.userId; + this._userName = config.userName; + this._alias = config.alias; + this._assumeRole = config.assumeRole; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_key - computed: false, optional: true, required: false + private _accessKey?: string; + public get accessKey() { + return this._accessKey; + } + public set accessKey(value: string | undefined) { + this._accessKey = value; + } + public resetAccessKey() { + this._accessKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessKeyInput() { + return this._accessKey; + } + + // agency_domain_name - computed: false, optional: true, required: false + private _agencyDomainName?: string; + public get agencyDomainName() { + return this._agencyDomainName; + } + public set agencyDomainName(value: string | undefined) { + this._agencyDomainName = value; + } + public resetAgencyDomainName() { + this._agencyDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyDomainNameInput() { + return this._agencyDomainName; + } + + // agency_name - computed: false, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this._agencyName; + } + public set agencyName(value: string | undefined) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // auth_url - computed: false, optional: true, required: false + private _authUrl?: string; + public get authUrl() { + return this._authUrl; + } + public set authUrl(value: string | undefined) { + this._authUrl = value; + } + public resetAuthUrl() { + this._authUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get authUrlInput() { + return this._authUrl; + } + + // cacert_file - computed: false, optional: true, required: false + private _cacertFile?: string; + public get cacertFile() { + return this._cacertFile; + } + public set cacertFile(value: string | undefined) { + this._cacertFile = value; + } + public resetCacertFile() { + this._cacertFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get cacertFileInput() { + return this._cacertFile; + } + + // cert - computed: false, optional: true, required: false + private _cert?: string; + public get cert() { + return this._cert; + } + public set cert(value: string | undefined) { + this._cert = value; + } + public resetCert() { + this._cert = undefined; + } + // Temporarily expose input value. Use with caution. + public get certInput() { + return this._cert; + } + + // cloud - computed: false, optional: true, required: false + private _cloud?: string; + public get cloud() { + return this._cloud; + } + public set cloud(value: string | undefined) { + this._cloud = value; + } + public resetCloud() { + this._cloud = undefined; + } + // Temporarily expose input value. Use with caution. + public get cloudInput() { + return this._cloud; + } + + // delegated_project - computed: false, optional: true, required: false + private _delegatedProject?: string; + public get delegatedProject() { + return this._delegatedProject; + } + public set delegatedProject(value: string | undefined) { + this._delegatedProject = value; + } + public resetDelegatedProject() { + this._delegatedProject = undefined; + } + // Temporarily expose input value. Use with caution. + public get delegatedProjectInput() { + return this._delegatedProject; + } + + // domain_id - computed: false, optional: true, required: false + private _domainId?: string; + public get domainId() { + return this._domainId; + } + public set domainId(value: string | undefined) { + this._domainId = value; + } + public resetDomainId() { + this._domainId = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // domain_name - computed: false, optional: true, required: false + private _domainName?: string; + public get domainName() { + return this._domainName; + } + public set domainName(value: string | undefined) { + this._domainName = value; + } + public resetDomainName() { + this._domainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainNameInput() { + return this._domainName; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: boolean | cdktf.IResolvable; + public get enableForceNew() { + return this._enableForceNew; + } + public set enableForceNew(value: boolean | cdktf.IResolvable | undefined) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // endpoints - computed: false, optional: true, required: false + private _endpoints?: { [key: string]: string }; + public get endpoints() { + return this._endpoints; + } + public set endpoints(value: { [key: string]: string } | undefined) { + this._endpoints = value; + } + public resetEndpoints() { + this._endpoints = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointsInput() { + return this._endpoints; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this._enterpriseProjectId; + } + public set enterpriseProjectId(value: string | undefined) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // insecure - computed: false, optional: true, required: false + private _insecure?: boolean | cdktf.IResolvable; + public get insecure() { + return this._insecure; + } + public set insecure(value: boolean | cdktf.IResolvable | undefined) { + this._insecure = value; + } + public resetInsecure() { + this._insecure = undefined; + } + // Temporarily expose input value. Use with caution. + public get insecureInput() { + return this._insecure; + } + + // key - computed: false, optional: true, required: false + private _key?: string; + public get key() { + return this._key; + } + public set key(value: string | undefined) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // max_retries - computed: false, optional: true, required: false + private _maxRetries?: number; + public get maxRetries() { + return this._maxRetries; + } + public set maxRetries(value: number | undefined) { + this._maxRetries = value; + } + public resetMaxRetries() { + this._maxRetries = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxRetriesInput() { + return this._maxRetries; + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this._password; + } + public set password(value: string | undefined) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // profile - computed: false, optional: true, required: false + private _profile?: string; + public get profile() { + return this._profile; + } + public set profile(value: string | undefined) { + this._profile = value; + } + public resetProfile() { + this._profile = undefined; + } + // Temporarily expose input value. Use with caution. + public get profileInput() { + return this._profile; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this._projectId; + } + public set projectId(value: string | undefined) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // project_name - computed: false, optional: true, required: false + private _projectName?: string; + public get projectName() { + return this._projectName; + } + public set projectName(value: string | undefined) { + this._projectName = value; + } + public resetProjectName() { + this._projectName = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectNameInput() { + return this._projectName; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this._region; + } + public set region(value: string | undefined) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // regional - computed: false, optional: true, required: false + private _regional?: boolean | cdktf.IResolvable; + public get regional() { + return this._regional; + } + public set regional(value: boolean | cdktf.IResolvable | undefined) { + this._regional = value; + } + public resetRegional() { + this._regional = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionalInput() { + return this._regional; + } + + // secret_key - computed: false, optional: true, required: false + private _secretKey?: string; + public get secretKey() { + return this._secretKey; + } + public set secretKey(value: string | undefined) { + this._secretKey = value; + } + public resetSecretKey() { + this._secretKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretKeyInput() { + return this._secretKey; + } + + // security_token - computed: false, optional: true, required: false + private _securityToken?: string; + public get securityToken() { + return this._securityToken; + } + public set securityToken(value: string | undefined) { + this._securityToken = value; + } + public resetSecurityToken() { + this._securityToken = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityTokenInput() { + return this._securityToken; + } + + // shared_config_file - computed: false, optional: true, required: false + private _sharedConfigFile?: string; + public get sharedConfigFile() { + return this._sharedConfigFile; + } + public set sharedConfigFile(value: string | undefined) { + this._sharedConfigFile = value; + } + public resetSharedConfigFile() { + this._sharedConfigFile = undefined; + } + // Temporarily expose input value. Use with caution. + public get sharedConfigFileInput() { + return this._sharedConfigFile; + } + + // tenant_id - computed: false, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this._tenantId; + } + public set tenantId(value: string | undefined) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // tenant_name - computed: false, optional: true, required: false + private _tenantName?: string; + public get tenantName() { + return this._tenantName; + } + public set tenantName(value: string | undefined) { + this._tenantName = value; + } + public resetTenantName() { + this._tenantName = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantNameInput() { + return this._tenantName; + } + + // token - computed: false, optional: true, required: false + private _token?: string; + public get token() { + return this._token; + } + public set token(value: string | undefined) { + this._token = value; + } + public resetToken() { + this._token = undefined; + } + // Temporarily expose input value. Use with caution. + public get tokenInput() { + return this._token; + } + + // user_id - computed: false, optional: true, required: false + private _userId?: string; + public get userId() { + return this._userId; + } + public set userId(value: string | undefined) { + this._userId = value; + } + public resetUserId() { + this._userId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: false, optional: true, required: false + private _userName?: string; + public get userName() { + return this._userName; + } + public set userName(value: string | undefined) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // alias - computed: false, optional: true, required: false + private _alias?: string; + public get alias() { + return this._alias; + } + public set alias(value: string | undefined) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // assume_role - computed: false, optional: true, required: false + private _assumeRole?: HuaweicloudProviderAssumeRole; + public get assumeRole() { + return this._assumeRole; + } + public set assumeRole(value: HuaweicloudProviderAssumeRole | undefined) { + this._assumeRole = value; + } + public resetAssumeRole() { + this._assumeRole = undefined; + } + // Temporarily expose input value. Use with caution. + public get assumeRoleInput() { + return this._assumeRole; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_key: cdktf.stringToTerraform(this._accessKey), + agency_domain_name: cdktf.stringToTerraform(this._agencyDomainName), + agency_name: cdktf.stringToTerraform(this._agencyName), + auth_url: cdktf.stringToTerraform(this._authUrl), + cacert_file: cdktf.stringToTerraform(this._cacertFile), + cert: cdktf.stringToTerraform(this._cert), + cloud: cdktf.stringToTerraform(this._cloud), + delegated_project: cdktf.stringToTerraform(this._delegatedProject), + domain_id: cdktf.stringToTerraform(this._domainId), + domain_name: cdktf.stringToTerraform(this._domainName), + enable_force_new: cdktf.booleanToTerraform(this._enableForceNew), + endpoints: cdktf.hashMapper(cdktf.stringToTerraform)(this._endpoints), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + insecure: cdktf.booleanToTerraform(this._insecure), + key: cdktf.stringToTerraform(this._key), + max_retries: cdktf.numberToTerraform(this._maxRetries), + password: cdktf.stringToTerraform(this._password), + profile: cdktf.stringToTerraform(this._profile), + project_id: cdktf.stringToTerraform(this._projectId), + project_name: cdktf.stringToTerraform(this._projectName), + region: cdktf.stringToTerraform(this._region), + regional: cdktf.booleanToTerraform(this._regional), + secret_key: cdktf.stringToTerraform(this._secretKey), + security_token: cdktf.stringToTerraform(this._securityToken), + shared_config_file: cdktf.stringToTerraform(this._sharedConfigFile), + tenant_id: cdktf.stringToTerraform(this._tenantId), + tenant_name: cdktf.stringToTerraform(this._tenantName), + token: cdktf.stringToTerraform(this._token), + user_id: cdktf.stringToTerraform(this._userId), + user_name: cdktf.stringToTerraform(this._userName), + alias: cdktf.stringToTerraform(this._alias), + assume_role: huaweicloudProviderAssumeRoleToTerraform(this._assumeRole), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_key: { + value: cdktf.stringToHclTerraform(this._accessKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_domain_name: { + value: cdktf.stringToHclTerraform(this._agencyDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_url: { + value: cdktf.stringToHclTerraform(this._authUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cacert_file: { + value: cdktf.stringToHclTerraform(this._cacertFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cert: { + value: cdktf.stringToHclTerraform(this._cert), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cloud: { + value: cdktf.stringToHclTerraform(this._cloud), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delegated_project: { + value: cdktf.stringToHclTerraform(this._delegatedProject), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_name: { + value: cdktf.stringToHclTerraform(this._domainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.booleanToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + endpoints: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._endpoints), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + insecure: { + value: cdktf.booleanToHclTerraform(this._insecure), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + key: { + value: cdktf.stringToHclTerraform(this._key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_retries: { + value: cdktf.numberToHclTerraform(this._maxRetries), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + profile: { + value: cdktf.stringToHclTerraform(this._profile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_name: { + value: cdktf.stringToHclTerraform(this._projectName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + regional: { + value: cdktf.booleanToHclTerraform(this._regional), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + secret_key: { + value: cdktf.stringToHclTerraform(this._secretKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_token: { + value: cdktf.stringToHclTerraform(this._securityToken), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shared_config_file: { + value: cdktf.stringToHclTerraform(this._sharedConfigFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_name: { + value: cdktf.stringToHclTerraform(this._tenantName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + token: { + value: cdktf.stringToHclTerraform(this._token), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(this._userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + alias: { + value: cdktf.stringToHclTerraform(this._alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + assume_role: { + value: huaweicloudProviderAssumeRoleToHclTerraform(this._assumeRole), + isBlock: true, + type: "list", + storageClassType: "HuaweicloudProviderAssumeRoleList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ram-organization/README.md b/src/constructs/providers/huaweicloud/ram-organization/README.md new file mode 100644 index 00000000..1af57502 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ram-organization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ram_organization` + +Refer to the Terraform Registry for docs: [`huaweicloud_ram_organization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization). diff --git a/src/constructs/providers/huaweicloud/ram-organization/index.ts b/src/constructs/providers/huaweicloud/ram-organization/index.ts new file mode 100644 index 00000000..64d9104a --- /dev/null +++ b/src/constructs/providers/huaweicloud/ram-organization/index.ts @@ -0,0 +1,143 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RamOrganizationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether sharing with organizations is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization#enabled RamOrganization#enabled} + */ + readonly enabled: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization#id RamOrganization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization huaweicloud_ram_organization} +*/ +export class RamOrganization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_organization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RamOrganization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RamOrganization to import + * @param importFromId The id of the existing RamOrganization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RamOrganization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_organization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_organization huaweicloud_ram_organization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RamOrganizationConfig + */ + public constructor(scope: Construct, id: string, config: RamOrganizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_organization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // enabled - computed: false, optional: false, required: true + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ram-resource-share-accepter/README.md b/src/constructs/providers/huaweicloud/ram-resource-share-accepter/README.md new file mode 100644 index 00000000..2357236b --- /dev/null +++ b/src/constructs/providers/huaweicloud/ram-resource-share-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ram_resource_share_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_ram_resource_share_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter). diff --git a/src/constructs/providers/huaweicloud/ram-resource-share-accepter/index.ts b/src/constructs/providers/huaweicloud/ram-resource-share-accepter/index.ts new file mode 100644 index 00000000..d03e59b4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ram-resource-share-accepter/index.ts @@ -0,0 +1,166 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RamResourceShareAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter#action RamResourceShareAccepter#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter#id RamResourceShareAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter#resource_share_invitation_id RamResourceShareAccepter#resource_share_invitation_id} + */ + readonly resourceShareInvitationId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter huaweicloud_ram_resource_share_accepter} +*/ +export class RamResourceShareAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_share_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RamResourceShareAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RamResourceShareAccepter to import + * @param importFromId The id of the existing RamResourceShareAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RamResourceShareAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_share_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share_accepter huaweicloud_ram_resource_share_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RamResourceShareAccepterConfig + */ + public constructor(scope: Construct, id: string, config: RamResourceShareAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_share_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._resourceShareInvitationId = config.resourceShareInvitationId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // resource_share_invitation_id - computed: false, optional: false, required: true + private _resourceShareInvitationId?: string; + public get resourceShareInvitationId() { + return this.getStringAttribute('resource_share_invitation_id'); + } + public set resourceShareInvitationId(value: string) { + this._resourceShareInvitationId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceShareInvitationIdInput() { + return this._resourceShareInvitationId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + resource_share_invitation_id: cdktf.stringToTerraform(this._resourceShareInvitationId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_share_invitation_id: { + value: cdktf.stringToHclTerraform(this._resourceShareInvitationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ram-resource-share/README.md b/src/constructs/providers/huaweicloud/ram-resource-share/README.md new file mode 100644 index 00000000..d48f4289 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ram-resource-share/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ram_resource_share` + +Refer to the Terraform Registry for docs: [`huaweicloud_ram_resource_share`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share). diff --git a/src/constructs/providers/huaweicloud/ram-resource-share/index.ts b/src/constructs/providers/huaweicloud/ram-resource-share/index.ts new file mode 100644 index 00000000..e9083bc5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ram-resource-share/index.ts @@ -0,0 +1,431 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RamResourceShareConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether resources can be shared with any accounts outside the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#allow_external_principals RamResourceShare#allow_external_principals} + */ + readonly allowExternalPrincipals?: boolean | cdktf.IResolvable; + /** + * Specifies the description of the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#description RamResourceShare#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#id RamResourceShare#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#name RamResourceShare#name} + */ + readonly name: string; + /** + * Specifies the list of RAM permissions associated with the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#permission_ids RamResourceShare#permission_ids} + */ + readonly permissionIds?: string[]; + /** + * Specifies the list of one or more principals associated with the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#principals RamResourceShare#principals} + */ + readonly principals: string[]; + /** + * Specifies the list of URNs of one or more resources associated with the resource share. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#resource_urns RamResourceShare#resource_urns} + */ + readonly resourceUrns: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#tags RamResourceShare#tags} + */ + readonly tags?: { [key: string]: string }; +} +export interface RamResourceShareAssociatedPermissions { +} + +export function ramResourceShareAssociatedPermissionsToTerraform(struct?: RamResourceShareAssociatedPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function ramResourceShareAssociatedPermissionsToHclTerraform(struct?: RamResourceShareAssociatedPermissions): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RamResourceShareAssociatedPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RamResourceShareAssociatedPermissions | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RamResourceShareAssociatedPermissions | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // permission_id - computed: true, optional: false, required: false + public get permissionId() { + return this.getStringAttribute('permission_id'); + } + + // permission_name - computed: true, optional: false, required: false + public get permissionName() { + return this.getStringAttribute('permission_name'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class RamResourceShareAssociatedPermissionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RamResourceShareAssociatedPermissionsOutputReference { + return new RamResourceShareAssociatedPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share huaweicloud_ram_resource_share} +*/ +export class RamResourceShare extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ram_resource_share"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RamResourceShare resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RamResourceShare to import + * @param importFromId The id of the existing RamResourceShare that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RamResourceShare to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ram_resource_share", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ram_resource_share huaweicloud_ram_resource_share} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RamResourceShareConfig + */ + public constructor(scope: Construct, id: string, config: RamResourceShareConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ram_resource_share', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allowExternalPrincipals = config.allowExternalPrincipals; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._permissionIds = config.permissionIds; + this._principals = config.principals; + this._resourceUrns = config.resourceUrns; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // allow_external_principals - computed: false, optional: true, required: false + private _allowExternalPrincipals?: boolean | cdktf.IResolvable; + public get allowExternalPrincipals() { + return this.getBooleanAttribute('allow_external_principals'); + } + public set allowExternalPrincipals(value: boolean | cdktf.IResolvable) { + this._allowExternalPrincipals = value; + } + public resetAllowExternalPrincipals() { + this._allowExternalPrincipals = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowExternalPrincipalsInput() { + return this._allowExternalPrincipals; + } + + // associated_permissions - computed: true, optional: false, required: false + private _associatedPermissions = new RamResourceShareAssociatedPermissionsList(this, "associated_permissions", false); + public get associatedPermissions() { + return this._associatedPermissions; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owning_account_id - computed: true, optional: false, required: false + public get owningAccountId() { + return this.getStringAttribute('owning_account_id'); + } + + // permission_ids - computed: false, optional: true, required: false + private _permissionIds?: string[]; + public get permissionIds() { + return cdktf.Fn.tolist(this.getListAttribute('permission_ids')); + } + public set permissionIds(value: string[]) { + this._permissionIds = value; + } + public resetPermissionIds() { + this._permissionIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionIdsInput() { + return this._permissionIds; + } + + // principals - computed: false, optional: false, required: true + private _principals?: string[]; + public get principals() { + return cdktf.Fn.tolist(this.getListAttribute('principals')); + } + public set principals(value: string[]) { + this._principals = value; + } + // Temporarily expose input value. Use with caution. + public get principalsInput() { + return this._principals; + } + + // resource_urns - computed: false, optional: false, required: true + private _resourceUrns?: string[]; + public get resourceUrns() { + return cdktf.Fn.tolist(this.getListAttribute('resource_urns')); + } + public set resourceUrns(value: string[]) { + this._resourceUrns = value; + } + // Temporarily expose input value. Use with caution. + public get resourceUrnsInput() { + return this._resourceUrns; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + allow_external_principals: cdktf.booleanToTerraform(this._allowExternalPrincipals), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + permission_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._permissionIds), + principals: cdktf.listMapper(cdktf.stringToTerraform, false)(this._principals), + resource_urns: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceUrns), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + allow_external_principals: { + value: cdktf.booleanToHclTerraform(this._allowExternalPrincipals), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._permissionIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + principals: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._principals), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + resource_urns: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceUrns), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-account/README.md b/src/constructs/providers/huaweicloud/rds-account/README.md new file mode 100644 index 00000000..46ee93d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account). diff --git a/src/constructs/providers/huaweicloud/rds-account/index.ts b/src/constructs/providers/huaweicloud/rds-account/index.ts new file mode 100644 index 00000000..7afa0889 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-account/index.ts @@ -0,0 +1,475 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies remarks of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#description RdsAccount#description} + */ + readonly description?: string; + /** + * Specifies the IP addresses that are allowed to access your DB instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#hosts RdsAccount#hosts} + */ + readonly hosts?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#id RdsAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS Mysql instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#instance_id RdsAccount#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the username of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#name RdsAccount#name} + */ + readonly name: string; + /** + * Specifies the password of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#password RdsAccount#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#region RdsAccount#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#timeouts RdsAccount#timeouts} + */ + readonly timeouts?: RdsAccountTimeouts; +} +export interface RdsAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#create RdsAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#delete RdsAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#update RdsAccount#update} + */ + readonly update?: string; +} + +export function rdsAccountTimeoutsToTerraform(struct?: RdsAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsAccountTimeoutsToHclTerraform(struct?: RdsAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account huaweicloud_rds_account} +*/ +export class RdsAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsAccount to import + * @param importFromId The id of the existing RdsAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_account huaweicloud_rds_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsAccountConfig + */ + public constructor(scope: Construct, id: string, config: RdsAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._hosts = config.hosts; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // hosts - computed: true, optional: true, required: false + private _hosts?: string[]; + public get hosts() { + return this.getListAttribute('hosts'); + } + public set hosts(value: string[]) { + this._hosts = value; + } + public resetHosts() { + this._hosts = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostsInput() { + return this._hosts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + hosts: cdktf.listMapper(cdktf.stringToTerraform, false)(this._hosts), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hosts: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._hosts), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-backup/README.md b/src/constructs/providers/huaweicloud/rds-backup/README.md new file mode 100644 index 00000000..50977a9a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup). diff --git a/src/constructs/providers/huaweicloud/rds-backup/index.ts b/src/constructs/providers/huaweicloud/rds-backup/index.ts new file mode 100644 index 00000000..8e6019d8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-backup/index.ts @@ -0,0 +1,555 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * The description about the backup. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#description RdsBackup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#id RdsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#instance_id RdsBackup#instance_id} + */ + readonly instanceId: string; + /** + * Backup name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#name RdsBackup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#region RdsBackup#region} + */ + readonly region?: string; + /** + * databases block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#databases RdsBackup#databases} + */ + readonly databases?: RdsBackupDatabases[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#timeouts RdsBackup#timeouts} + */ + readonly timeouts?: RdsBackupTimeouts; +} +export interface RdsBackupDatabases { + /** + * Database to be backed up for Microsoft SQL Server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#name RdsBackup#name} + */ + readonly name: string; +} + +export function rdsBackupDatabasesToTerraform(struct?: RdsBackupDatabases | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function rdsBackupDatabasesToHclTerraform(struct?: RdsBackupDatabases | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsBackupDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsBackupDatabases | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsBackupDatabases | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class RdsBackupDatabasesList extends cdktf.ComplexList { + public internalValue? : RdsBackupDatabases[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsBackupDatabasesOutputReference { + return new RdsBackupDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#create RdsBackup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#delete RdsBackup#delete} + */ + readonly delete?: string; +} + +export function rdsBackupTimeoutsToTerraform(struct?: RdsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsBackupTimeoutsToHclTerraform(struct?: RdsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup huaweicloud_rds_backup} +*/ +export class RdsBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsBackup to import + * @param importFromId The id of the existing RdsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_backup huaweicloud_rds_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsBackupConfig + */ + public constructor(scope: Construct, id: string, config: RdsBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._databases.internalValue = config.databases; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // associated_with_ddm - computed: true, optional: false, required: false + public get associatedWithDdm() { + return this.getBooleanAttribute('associated_with_ddm'); + } + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // databases - computed: false, optional: true, required: false + private _databases = new RdsBackupDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + public putDatabases(value: RdsBackupDatabases[] | cdktf.IResolvable) { + this._databases.internalValue = value; + } + public resetDatabases() { + this._databases.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get databasesInput() { + return this._databases.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + databases: cdktf.listMapper(rdsBackupDatabasesToTerraform, true)(this._databases.internalValue), + timeouts: rdsBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + databases: { + value: cdktf.listMapperHcl(rdsBackupDatabasesToHclTerraform, true)(this._databases.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsBackupDatabasesList", + }, + timeouts: { + value: rdsBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/README.md b/src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/README.md new file mode 100644 index 00000000..b77291ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_cross_region_backup_strategy` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_cross_region_backup_strategy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy). diff --git a/src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/index.ts b/src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/index.ts new file mode 100644 index 00000000..01ef1a64 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-cross-region-backup-strategy/index.ts @@ -0,0 +1,469 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsCrossRegionBackupStrategyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the backup type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#backup_type RdsCrossRegionBackupStrategy#backup_type} + */ + readonly backupType: string; + /** + * Specifies the target project ID for the cross-region backup policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#destination_project_id RdsCrossRegionBackupStrategy#destination_project_id} + */ + readonly destinationProjectId: string; + /** + * Specifies the target region ID for the cross-region backup policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#destination_region RdsCrossRegionBackupStrategy#destination_region} + */ + readonly destinationRegion: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#id RdsCrossRegionBackupStrategy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#instance_id RdsCrossRegionBackupStrategy#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the number of days to retain the generated backup files. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#keep_days RdsCrossRegionBackupStrategy#keep_days} + */ + readonly keepDays: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#region RdsCrossRegionBackupStrategy#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#timeouts RdsCrossRegionBackupStrategy#timeouts} + */ + readonly timeouts?: RdsCrossRegionBackupStrategyTimeouts; +} +export interface RdsCrossRegionBackupStrategyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#create RdsCrossRegionBackupStrategy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#delete RdsCrossRegionBackupStrategy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#update RdsCrossRegionBackupStrategy#update} + */ + readonly update?: string; +} + +export function rdsCrossRegionBackupStrategyTimeoutsToTerraform(struct?: RdsCrossRegionBackupStrategyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsCrossRegionBackupStrategyTimeoutsToHclTerraform(struct?: RdsCrossRegionBackupStrategyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsCrossRegionBackupStrategyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsCrossRegionBackupStrategyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsCrossRegionBackupStrategyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy huaweicloud_rds_cross_region_backup_strategy} +*/ +export class RdsCrossRegionBackupStrategy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_cross_region_backup_strategy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsCrossRegionBackupStrategy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsCrossRegionBackupStrategy to import + * @param importFromId The id of the existing RdsCrossRegionBackupStrategy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsCrossRegionBackupStrategy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_cross_region_backup_strategy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_cross_region_backup_strategy huaweicloud_rds_cross_region_backup_strategy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsCrossRegionBackupStrategyConfig + */ + public constructor(scope: Construct, id: string, config: RdsCrossRegionBackupStrategyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_cross_region_backup_strategy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupType = config.backupType; + this._destinationProjectId = config.destinationProjectId; + this._destinationRegion = config.destinationRegion; + this._id = config.id; + this._instanceId = config.instanceId; + this._keepDays = config.keepDays; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_type - computed: false, optional: false, required: true + private _backupType?: string; + public get backupType() { + return this.getStringAttribute('backup_type'); + } + public set backupType(value: string) { + this._backupType = value; + } + // Temporarily expose input value. Use with caution. + public get backupTypeInput() { + return this._backupType; + } + + // destination_project_id - computed: false, optional: false, required: true + private _destinationProjectId?: string; + public get destinationProjectId() { + return this.getStringAttribute('destination_project_id'); + } + public set destinationProjectId(value: string) { + this._destinationProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get destinationProjectIdInput() { + return this._destinationProjectId; + } + + // destination_region - computed: false, optional: false, required: true + private _destinationRegion?: string; + public get destinationRegion() { + return this.getStringAttribute('destination_region'); + } + public set destinationRegion(value: string) { + this._destinationRegion = value; + } + // Temporarily expose input value. Use with caution. + public get destinationRegionInput() { + return this._destinationRegion; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keep_days - computed: false, optional: false, required: true + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsCrossRegionBackupStrategyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsCrossRegionBackupStrategyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_type: cdktf.stringToTerraform(this._backupType), + destination_project_id: cdktf.stringToTerraform(this._destinationProjectId), + destination_region: cdktf.stringToTerraform(this._destinationRegion), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keep_days: cdktf.numberToTerraform(this._keepDays), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsCrossRegionBackupStrategyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_type: { + value: cdktf.stringToHclTerraform(this._backupType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_project_id: { + value: cdktf.stringToHclTerraform(this._destinationProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_region: { + value: cdktf.stringToHclTerraform(this._destinationRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_days: { + value: cdktf.numberToHclTerraform(this._keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsCrossRegionBackupStrategyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsCrossRegionBackupStrategyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-database-logs-shrinking/README.md b/src/constructs/providers/huaweicloud/rds-database-logs-shrinking/README.md new file mode 100644 index 00000000..4e9075a9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-database-logs-shrinking/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_database_logs_shrinking` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_database_logs_shrinking`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking). diff --git a/src/constructs/providers/huaweicloud/rds-database-logs-shrinking/index.ts b/src/constructs/providers/huaweicloud/rds-database-logs-shrinking/index.ts new file mode 100644 index 00000000..3d8a5c11 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-database-logs-shrinking/index.ts @@ -0,0 +1,198 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsDatabaseLogsShrinkingConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking#db_name RdsDatabaseLogsShrinking#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking#id RdsDatabaseLogsShrinking#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking#instance_id RdsDatabaseLogsShrinking#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking#region RdsDatabaseLogsShrinking#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking huaweicloud_rds_database_logs_shrinking} +*/ +export class RdsDatabaseLogsShrinking extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_database_logs_shrinking"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsDatabaseLogsShrinking resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsDatabaseLogsShrinking to import + * @param importFromId The id of the existing RdsDatabaseLogsShrinking that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsDatabaseLogsShrinking to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_database_logs_shrinking", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_logs_shrinking huaweicloud_rds_database_logs_shrinking} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsDatabaseLogsShrinkingConfig + */ + public constructor(scope: Construct, id: string, config: RdsDatabaseLogsShrinkingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_database_logs_shrinking', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-database-privilege/README.md b/src/constructs/providers/huaweicloud/rds-database-privilege/README.md new file mode 100644 index 00000000..5b245873 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-database-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_database_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_database_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege). diff --git a/src/constructs/providers/huaweicloud/rds-database-privilege/index.ts b/src/constructs/providers/huaweicloud/rds-database-privilege/index.ts new file mode 100644 index 00000000..bebff4b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-database-privilege/index.ts @@ -0,0 +1,565 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsDatabasePrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#db_name RdsDatabasePrivilege#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#id RdsDatabasePrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS Mysql instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#instance_id RdsDatabasePrivilege#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#region RdsDatabasePrivilege#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#timeouts RdsDatabasePrivilege#timeouts} + */ + readonly timeouts?: RdsDatabasePrivilegeTimeouts; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#users RdsDatabasePrivilege#users} + */ + readonly users: RdsDatabasePrivilegeUsers[] | cdktf.IResolvable; +} +export interface RdsDatabasePrivilegeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#create RdsDatabasePrivilege#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#delete RdsDatabasePrivilege#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#update RdsDatabasePrivilege#update} + */ + readonly update?: string; +} + +export function rdsDatabasePrivilegeTimeoutsToTerraform(struct?: RdsDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsDatabasePrivilegeTimeoutsToHclTerraform(struct?: RdsDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsDatabasePrivilegeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsDatabasePrivilegeUsers { + /** + * Specifies the username of the database account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#name RdsDatabasePrivilege#name} + */ + readonly name: string; + /** + * Specifies the read-only permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#readonly RdsDatabasePrivilege#readonly} + */ + readonly readonly?: boolean | cdktf.IResolvable; +} + +export function rdsDatabasePrivilegeUsersToTerraform(struct?: RdsDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + readonly: cdktf.booleanToTerraform(struct!.readonly), + } +} + + +export function rdsDatabasePrivilegeUsersToHclTerraform(struct?: RdsDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(struct!.readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsDatabasePrivilegeUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsDatabasePrivilegeUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._readonly !== undefined) { + hasAnyValues = true; + internalValueResult.readonly = this._readonly; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsDatabasePrivilegeUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._readonly = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._readonly = value.readonly; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // readonly - computed: true, optional: true, required: false + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + public resetReadonly() { + this._readonly = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } +} + +export class RdsDatabasePrivilegeUsersList extends cdktf.ComplexList { + public internalValue? : RdsDatabasePrivilegeUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsDatabasePrivilegeUsersOutputReference { + return new RdsDatabasePrivilegeUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege huaweicloud_rds_database_privilege} +*/ +export class RdsDatabasePrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_database_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsDatabasePrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsDatabasePrivilege to import + * @param importFromId The id of the existing RdsDatabasePrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsDatabasePrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_database_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database_privilege huaweicloud_rds_database_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsDatabasePrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: RdsDatabasePrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_database_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsDatabasePrivilegeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsDatabasePrivilegeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // users - computed: false, optional: false, required: true + private _users = new RdsDatabasePrivilegeUsersList(this, "users", true); + public get users() { + return this._users; + } + public putUsers(value: RdsDatabasePrivilegeUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsDatabasePrivilegeTimeoutsToTerraform(this._timeouts.internalValue), + users: cdktf.listMapper(rdsDatabasePrivilegeUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsDatabasePrivilegeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsDatabasePrivilegeTimeouts", + }, + users: { + value: cdktf.listMapperHcl(rdsDatabasePrivilegeUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsDatabasePrivilegeUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-database/README.md b/src/constructs/providers/huaweicloud/rds-database/README.md new file mode 100644 index 00000000..5b9a284e --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database). diff --git a/src/constructs/providers/huaweicloud/rds-database/index.ts b/src/constructs/providers/huaweicloud/rds-database/index.ts new file mode 100644 index 00000000..bf6b6e9d --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-database/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the character set used by the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#character_set RdsDatabase#character_set} + */ + readonly characterSet: string; + /** + * Specifies the database description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#description RdsDatabase#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#id RdsDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS Mysql instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#instance_id RdsDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#name RdsDatabase#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#region RdsDatabase#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#timeouts RdsDatabase#timeouts} + */ + readonly timeouts?: RdsDatabaseTimeouts; +} +export interface RdsDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#create RdsDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#delete RdsDatabase#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#update RdsDatabase#update} + */ + readonly update?: string; +} + +export function rdsDatabaseTimeoutsToTerraform(struct?: RdsDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsDatabaseTimeoutsToHclTerraform(struct?: RdsDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database huaweicloud_rds_database} +*/ +export class RdsDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsDatabase to import + * @param importFromId The id of the existing RdsDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_database huaweicloud_rds_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: RdsDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: false, required: true + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-extend-log-link/README.md b/src/constructs/providers/huaweicloud/rds-extend-log-link/README.md new file mode 100644 index 00000000..44f72270 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-extend-log-link/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_extend_log_link` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_extend_log_link`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link). diff --git a/src/constructs/providers/huaweicloud/rds-extend-log-link/index.ts b/src/constructs/providers/huaweicloud/rds-extend-log-link/index.ts new file mode 100644 index 00000000..016ce358 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-extend-log-link/index.ts @@ -0,0 +1,342 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsExtendLogLinkConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the file to be downloaded. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#file_name RdsExtendLogLink#file_name} + */ + readonly fileName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#id RdsExtendLogLink#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#instance_id RdsExtendLogLink#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#region RdsExtendLogLink#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#timeouts RdsExtendLogLink#timeouts} + */ + readonly timeouts?: RdsExtendLogLinkTimeouts; +} +export interface RdsExtendLogLinkTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#create RdsExtendLogLink#create} + */ + readonly create?: string; +} + +export function rdsExtendLogLinkTimeoutsToTerraform(struct?: RdsExtendLogLinkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function rdsExtendLogLinkTimeoutsToHclTerraform(struct?: RdsExtendLogLinkTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsExtendLogLinkTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsExtendLogLinkTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsExtendLogLinkTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link huaweicloud_rds_extend_log_link} +*/ +export class RdsExtendLogLink extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_extend_log_link"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsExtendLogLink resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsExtendLogLink to import + * @param importFromId The id of the existing RdsExtendLogLink that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsExtendLogLink to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_extend_log_link", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_extend_log_link huaweicloud_rds_extend_log_link} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsExtendLogLinkConfig + */ + public constructor(scope: Construct, id: string, config: RdsExtendLogLinkConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_extend_log_link', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fileName = config.fileName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // file_link - computed: true, optional: false, required: false + public get fileLink() { + return this.getStringAttribute('file_link'); + } + + // file_name - computed: false, optional: false, required: true + private _fileName?: string; + public get fileName() { + return this.getStringAttribute('file_name'); + } + public set fileName(value: string) { + this._fileName = value; + } + // Temporarily expose input value. Use with caution. + public get fileNameInput() { + return this._fileName; + } + + // file_size - computed: true, optional: false, required: false + public get fileSize() { + return this.getStringAttribute('file_size'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsExtendLogLinkTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsExtendLogLinkTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + file_name: cdktf.stringToTerraform(this._fileName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsExtendLogLinkTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + file_name: { + value: cdktf.stringToHclTerraform(this._fileName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsExtendLogLinkTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsExtendLogLinkTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-instance-eip-associate/README.md b/src/constructs/providers/huaweicloud/rds-instance-eip-associate/README.md new file mode 100644 index 00000000..859db59c --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-instance-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_instance_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_instance_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate). diff --git a/src/constructs/providers/huaweicloud/rds-instance-eip-associate/index.ts b/src/constructs/providers/huaweicloud/rds-instance-eip-associate/index.ts new file mode 100644 index 00000000..8a1d2af0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-instance-eip-associate/index.ts @@ -0,0 +1,376 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsInstanceEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#id RdsInstanceEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#instance_id RdsInstanceEipAssociate#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#public_ip RdsInstanceEipAssociate#public_ip} + */ + readonly publicIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#public_ip_id RdsInstanceEipAssociate#public_ip_id} + */ + readonly publicIpId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#region RdsInstanceEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#timeouts RdsInstanceEipAssociate#timeouts} + */ + readonly timeouts?: RdsInstanceEipAssociateTimeouts; +} +export interface RdsInstanceEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#create RdsInstanceEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#delete RdsInstanceEipAssociate#delete} + */ + readonly delete?: string; +} + +export function rdsInstanceEipAssociateTimeoutsToTerraform(struct?: RdsInstanceEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsInstanceEipAssociateTimeoutsToHclTerraform(struct?: RdsInstanceEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsInstanceEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate huaweicloud_rds_instance_eip_associate} +*/ +export class RdsInstanceEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_instance_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsInstanceEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsInstanceEipAssociate to import + * @param importFromId The id of the existing RdsInstanceEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsInstanceEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_instance_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_eip_associate huaweicloud_rds_instance_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsInstanceEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: RdsInstanceEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_instance_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._publicIp = config.publicIp; + this._publicIpId = config.publicIpId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // public_ip_id - computed: false, optional: false, required: true + private _publicIpId?: string; + public get publicIpId() { + return this.getStringAttribute('public_ip_id'); + } + public set publicIpId(value: string) { + this._publicIpId = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpIdInput() { + return this._publicIpId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsInstanceEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsInstanceEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + public_ip: cdktf.stringToTerraform(this._publicIp), + public_ip_id: cdktf.stringToTerraform(this._publicIpId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsInstanceEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip_id: { + value: cdktf.stringToHclTerraform(this._publicIpId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsInstanceEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsInstanceEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-instance-v3/README.md b/src/constructs/providers/huaweicloud/rds-instance-v3/README.md new file mode 100644 index 00000000..de0bff0e --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-instance-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_instance_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_instance_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3). diff --git a/src/constructs/providers/huaweicloud/rds-instance-v3/index.ts b/src/constructs/providers/huaweicloud/rds-instance-v3/index.ts new file mode 100644 index 00000000..9b5e63c4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-instance-v3/index.ts @@ -0,0 +1,2661 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsInstanceV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#auto_pay RdsInstanceV3#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#auto_renew RdsInstanceV3#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#availability_zone RdsInstanceV3#availability_zone} + */ + readonly availabilityZone: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#binlog_retention_hours RdsInstanceV3#binlog_retention_hours} + */ + readonly binlogRetentionHours?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#charging_mode RdsInstanceV3#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#collation RdsInstanceV3#collation} + */ + readonly collation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#description RdsInstanceV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#dss_pool_id RdsInstanceV3#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#enterprise_project_id RdsInstanceV3#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#fixed_ip RdsInstanceV3#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#flavor RdsInstanceV3#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#ha_replication_mode RdsInstanceV3#ha_replication_mode} + */ + readonly haReplicationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#id RdsInstanceV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#lower_case_table_names RdsInstanceV3#lower_case_table_names} + */ + readonly lowerCaseTableNames?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#maintain_begin RdsInstanceV3#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#maintain_end RdsInstanceV3#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#name RdsInstanceV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#param_group_id RdsInstanceV3#param_group_id} + */ + readonly paramGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#period RdsInstanceV3#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#period_unit RdsInstanceV3#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#power_action RdsInstanceV3#power_action} + */ + readonly powerAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#private_dns_name_prefix RdsInstanceV3#private_dns_name_prefix} + */ + readonly privateDnsNamePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#read_write_permissions RdsInstanceV3#read_write_permissions} + */ + readonly readWritePermissions?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#region RdsInstanceV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#rotate_day RdsInstanceV3#rotate_day} + */ + readonly rotateDay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#seconds_level_monitoring_enabled RdsInstanceV3#seconds_level_monitoring_enabled} + */ + readonly secondsLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#seconds_level_monitoring_interval RdsInstanceV3#seconds_level_monitoring_interval} + */ + readonly secondsLevelMonitoringInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#secret_id RdsInstanceV3#secret_id} + */ + readonly secretId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#secret_name RdsInstanceV3#secret_name} + */ + readonly secretName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#secret_version RdsInstanceV3#secret_version} + */ + readonly secretVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#security_group_id RdsInstanceV3#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#slow_log_show_original_status RdsInstanceV3#slow_log_show_original_status} + */ + readonly slowLogShowOriginalStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#ssl_enable RdsInstanceV3#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#subnet_id RdsInstanceV3#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#switch_strategy RdsInstanceV3#switch_strategy} + */ + readonly switchStrategy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#tags RdsInstanceV3#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#tde_enabled RdsInstanceV3#tde_enabled} + */ + readonly tdeEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#time_zone RdsInstanceV3#time_zone} + */ + readonly timeZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#vpc_id RdsInstanceV3#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#backup_strategy RdsInstanceV3#backup_strategy} + */ + readonly backupStrategy?: RdsInstanceV3BackupStrategy; + /** + * db block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#db RdsInstanceV3#db} + */ + readonly db: RdsInstanceV3Db; + /** + * msdtc_hosts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#msdtc_hosts RdsInstanceV3#msdtc_hosts} + */ + readonly msdtcHosts?: RdsInstanceV3MsdtcHosts[] | cdktf.IResolvable; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#parameters RdsInstanceV3#parameters} + */ + readonly parameters?: RdsInstanceV3Parameters[] | cdktf.IResolvable; + /** + * restore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#restore RdsInstanceV3#restore} + */ + readonly restore?: RdsInstanceV3Restore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#timeouts RdsInstanceV3#timeouts} + */ + readonly timeouts?: RdsInstanceV3Timeouts; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#volume RdsInstanceV3#volume} + */ + readonly volume: RdsInstanceV3Volume; +} +export interface RdsInstanceV3Nodes { +} + +export function rdsInstanceV3NodesToTerraform(struct?: RdsInstanceV3Nodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rdsInstanceV3NodesToHclTerraform(struct?: RdsInstanceV3Nodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RdsInstanceV3NodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsInstanceV3Nodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3Nodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class RdsInstanceV3NodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsInstanceV3NodesOutputReference { + return new RdsInstanceV3NodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsInstanceV3BackupStrategy { + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#keep_days RdsInstanceV3#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#period RdsInstanceV3#period} + */ + readonly period?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#start_time RdsInstanceV3#start_time} + */ + readonly startTime: string; +} + +export function rdsInstanceV3BackupStrategyToTerraform(struct?: RdsInstanceV3BackupStrategyOutputReference | RdsInstanceV3BackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + period: cdktf.stringToTerraform(struct!.period), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function rdsInstanceV3BackupStrategyToHclTerraform(struct?: RdsInstanceV3BackupStrategyOutputReference | RdsInstanceV3BackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period: { + value: cdktf.stringToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3BackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceV3BackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3BackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._period = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._period = value.period; + this._startTime = value.startTime; + } + } + + // keep_days - computed: true, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // period - computed: true, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface RdsInstanceV3Db { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#password RdsInstanceV3#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#port RdsInstanceV3#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#type RdsInstanceV3#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#version RdsInstanceV3#version} + */ + readonly version: string; +} + +export function rdsInstanceV3DbToTerraform(struct?: RdsInstanceV3DbOutputReference | RdsInstanceV3Db): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + password: cdktf.stringToTerraform(struct!.password), + port: cdktf.numberToTerraform(struct!.port), + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function rdsInstanceV3DbToHclTerraform(struct?: RdsInstanceV3DbOutputReference | RdsInstanceV3Db): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3DbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceV3Db | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3Db | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._password = undefined; + this._port = undefined; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._password = value.password; + this._port = value.port; + this._type = value.type; + this._version = value.version; + } + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface RdsInstanceV3MsdtcHosts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#host_name RdsInstanceV3#host_name} + */ + readonly hostName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#ip RdsInstanceV3#ip} + */ + readonly ip: string; +} + +export function rdsInstanceV3MsdtcHostsToTerraform(struct?: RdsInstanceV3MsdtcHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host_name: cdktf.stringToTerraform(struct!.hostName), + ip: cdktf.stringToTerraform(struct!.ip), + } +} + + +export function rdsInstanceV3MsdtcHostsToHclTerraform(struct?: RdsInstanceV3MsdtcHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host_name: { + value: cdktf.stringToHclTerraform(struct!.hostName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3MsdtcHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsInstanceV3MsdtcHosts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._hostName !== undefined) { + hasAnyValues = true; + internalValueResult.hostName = this._hostName; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3MsdtcHosts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._hostName = undefined; + this._ip = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._hostName = value.hostName; + this._ip = value.ip; + } + } + + // host_name - computed: false, optional: false, required: true + private _hostName?: string; + public get hostName() { + return this.getStringAttribute('host_name'); + } + public set hostName(value: string) { + this._hostName = value; + } + // Temporarily expose input value. Use with caution. + public get hostNameInput() { + return this._hostName; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } +} + +export class RdsInstanceV3MsdtcHostsList extends cdktf.ComplexList { + public internalValue? : RdsInstanceV3MsdtcHosts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsInstanceV3MsdtcHostsOutputReference { + return new RdsInstanceV3MsdtcHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsInstanceV3Parameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#name RdsInstanceV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#value RdsInstanceV3#value} + */ + readonly value: string; +} + +export function rdsInstanceV3ParametersToTerraform(struct?: RdsInstanceV3Parameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function rdsInstanceV3ParametersToHclTerraform(struct?: RdsInstanceV3Parameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3ParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsInstanceV3Parameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3Parameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class RdsInstanceV3ParametersList extends cdktf.ComplexList { + public internalValue? : RdsInstanceV3Parameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsInstanceV3ParametersOutputReference { + return new RdsInstanceV3ParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsInstanceV3Restore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#backup_id RdsInstanceV3#backup_id} + */ + readonly backupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#database_name RdsInstanceV3#database_name} + */ + readonly databaseName?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#instance_id RdsInstanceV3#instance_id} + */ + readonly instanceId: string; +} + +export function rdsInstanceV3RestoreToTerraform(struct?: RdsInstanceV3RestoreOutputReference | RdsInstanceV3Restore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backup_id: cdktf.stringToTerraform(struct!.backupId), + database_name: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.databaseName), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + } +} + + +export function rdsInstanceV3RestoreToHclTerraform(struct?: RdsInstanceV3RestoreOutputReference | RdsInstanceV3Restore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(struct!.backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_name: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.databaseName), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3RestoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceV3Restore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backupId !== undefined) { + hasAnyValues = true; + internalValueResult.backupId = this._backupId; + } + if (this._databaseName !== undefined) { + hasAnyValues = true; + internalValueResult.databaseName = this._databaseName; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3Restore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._backupId = undefined; + this._databaseName = undefined; + this._instanceId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._backupId = value.backupId; + this._databaseName = value.databaseName; + this._instanceId = value.instanceId; + } + } + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // database_name - computed: false, optional: true, required: false + private _databaseName?: { [key: string]: string }; + public get databaseName() { + return this.getStringMapAttribute('database_name'); + } + public set databaseName(value: { [key: string]: string }) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } +} +export interface RdsInstanceV3Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#create RdsInstanceV3#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#default RdsInstanceV3#default} + */ + readonly default?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#delete RdsInstanceV3#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#update RdsInstanceV3#update} + */ + readonly update?: string; +} + +export function rdsInstanceV3TimeoutsToTerraform(struct?: RdsInstanceV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + default: cdktf.stringToTerraform(struct!.default), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsInstanceV3TimeoutsToHclTerraform(struct?: RdsInstanceV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default: { + value: cdktf.stringToHclTerraform(struct!.default), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsInstanceV3Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._default !== undefined) { + hasAnyValues = true; + internalValueResult.default = this._default; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._default = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._default = value.default; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // default - computed: false, optional: true, required: false + private _default?: string; + public get default() { + return this.getStringAttribute('default'); + } + public set default(value: string) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsInstanceV3Volume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#disk_encryption_id RdsInstanceV3#disk_encryption_id} + */ + readonly diskEncryptionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#limit_size RdsInstanceV3#limit_size} + */ + readonly limitSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#size RdsInstanceV3#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#trigger_threshold RdsInstanceV3#trigger_threshold} + */ + readonly triggerThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#type RdsInstanceV3#type} + */ + readonly type: string; +} + +export function rdsInstanceV3VolumeToTerraform(struct?: RdsInstanceV3VolumeOutputReference | RdsInstanceV3Volume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + disk_encryption_id: cdktf.stringToTerraform(struct!.diskEncryptionId), + limit_size: cdktf.numberToTerraform(struct!.limitSize), + size: cdktf.numberToTerraform(struct!.size), + trigger_threshold: cdktf.numberToTerraform(struct!.triggerThreshold), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function rdsInstanceV3VolumeToHclTerraform(struct?: RdsInstanceV3VolumeOutputReference | RdsInstanceV3Volume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + disk_encryption_id: { + value: cdktf.stringToHclTerraform(struct!.diskEncryptionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + limit_size: { + value: cdktf.numberToHclTerraform(struct!.limitSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_threshold: { + value: cdktf.numberToHclTerraform(struct!.triggerThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceV3VolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceV3Volume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._diskEncryptionId !== undefined) { + hasAnyValues = true; + internalValueResult.diskEncryptionId = this._diskEncryptionId; + } + if (this._limitSize !== undefined) { + hasAnyValues = true; + internalValueResult.limitSize = this._limitSize; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._triggerThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.triggerThreshold = this._triggerThreshold; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceV3Volume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._diskEncryptionId = undefined; + this._limitSize = undefined; + this._size = undefined; + this._triggerThreshold = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._diskEncryptionId = value.diskEncryptionId; + this._limitSize = value.limitSize; + this._size = value.size; + this._triggerThreshold = value.triggerThreshold; + this._type = value.type; + } + } + + // disk_encryption_id - computed: true, optional: true, required: false + private _diskEncryptionId?: string; + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + public set diskEncryptionId(value: string) { + this._diskEncryptionId = value; + } + public resetDiskEncryptionId() { + this._diskEncryptionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskEncryptionIdInput() { + return this._diskEncryptionId; + } + + // limit_size - computed: false, optional: true, required: false + private _limitSize?: number; + public get limitSize() { + return this.getNumberAttribute('limit_size'); + } + public set limitSize(value: number) { + this._limitSize = value; + } + public resetLimitSize() { + this._limitSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitSizeInput() { + return this._limitSize; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // trigger_threshold - computed: false, optional: true, required: false + private _triggerThreshold?: number; + public get triggerThreshold() { + return this.getNumberAttribute('trigger_threshold'); + } + public set triggerThreshold(value: number) { + this._triggerThreshold = value; + } + public resetTriggerThreshold() { + this._triggerThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerThresholdInput() { + return this._triggerThreshold; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3 huaweicloud_rds_instance_v3} +*/ +export class RdsInstanceV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_instance_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsInstanceV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsInstanceV3 to import + * @param importFromId The id of the existing RdsInstanceV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsInstanceV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_instance_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance_v3 huaweicloud_rds_instance_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsInstanceV3Config + */ + public constructor(scope: Construct, id: string, config: RdsInstanceV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_instance_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._binlogRetentionHours = config.binlogRetentionHours; + this._chargingMode = config.chargingMode; + this._collation = config.collation; + this._description = config.description; + this._dssPoolId = config.dssPoolId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fixedIp = config.fixedIp; + this._flavor = config.flavor; + this._haReplicationMode = config.haReplicationMode; + this._id = config.id; + this._lowerCaseTableNames = config.lowerCaseTableNames; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._paramGroupId = config.paramGroupId; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._powerAction = config.powerAction; + this._privateDnsNamePrefix = config.privateDnsNamePrefix; + this._readWritePermissions = config.readWritePermissions; + this._region = config.region; + this._rotateDay = config.rotateDay; + this._secondsLevelMonitoringEnabled = config.secondsLevelMonitoringEnabled; + this._secondsLevelMonitoringInterval = config.secondsLevelMonitoringInterval; + this._secretId = config.secretId; + this._secretName = config.secretName; + this._secretVersion = config.secretVersion; + this._securityGroupId = config.securityGroupId; + this._slowLogShowOriginalStatus = config.slowLogShowOriginalStatus; + this._sslEnable = config.sslEnable; + this._subnetId = config.subnetId; + this._switchStrategy = config.switchStrategy; + this._tags = config.tags; + this._tdeEnabled = config.tdeEnabled; + this._timeZone = config.timeZone; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._db.internalValue = config.db; + this._msdtcHosts.internalValue = config.msdtcHosts; + this._parameters.internalValue = config.parameters; + this._restore.internalValue = config.restore; + this._timeouts.internalValue = config.timeouts; + this._volume.internalValue = config.volume; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string[]; + public get availabilityZone() { + return this.getListAttribute('availability_zone'); + } + public set availabilityZone(value: string[]) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // binlog_retention_hours - computed: false, optional: true, required: false + private _binlogRetentionHours?: number; + public get binlogRetentionHours() { + return this.getNumberAttribute('binlog_retention_hours'); + } + public set binlogRetentionHours(value: number) { + this._binlogRetentionHours = value; + } + public resetBinlogRetentionHours() { + this._binlogRetentionHours = undefined; + } + // Temporarily expose input value. Use with caution. + public get binlogRetentionHoursInput() { + return this._binlogRetentionHours; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // collation - computed: true, optional: true, required: false + private _collation?: string; + public get collation() { + return this.getStringAttribute('collation'); + } + public set collation(value: string) { + this._collation = value; + } + public resetCollation() { + this._collation = undefined; + } + // Temporarily expose input value. Use with caution. + public get collationInput() { + return this._collation; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dss_pool_id - computed: false, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // ha_replication_mode - computed: true, optional: true, required: false + private _haReplicationMode?: string; + public get haReplicationMode() { + return this.getStringAttribute('ha_replication_mode'); + } + public set haReplicationMode(value: string) { + this._haReplicationMode = value; + } + public resetHaReplicationMode() { + this._haReplicationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get haReplicationModeInput() { + return this._haReplicationMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lower_case_table_names - computed: false, optional: true, required: false + private _lowerCaseTableNames?: string; + public get lowerCaseTableNames() { + return this.getStringAttribute('lower_case_table_names'); + } + public set lowerCaseTableNames(value: string) { + this._lowerCaseTableNames = value; + } + public resetLowerCaseTableNames() { + this._lowerCaseTableNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get lowerCaseTableNamesInput() { + return this._lowerCaseTableNames; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new RdsInstanceV3NodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // param_group_id - computed: false, optional: true, required: false + private _paramGroupId?: string; + public get paramGroupId() { + return this.getStringAttribute('param_group_id'); + } + public set paramGroupId(value: string) { + this._paramGroupId = value; + } + public resetParamGroupId() { + this._paramGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramGroupIdInput() { + return this._paramGroupId; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // power_action - computed: false, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // private_dns_name_prefix - computed: true, optional: true, required: false + private _privateDnsNamePrefix?: string; + public get privateDnsNamePrefix() { + return this.getStringAttribute('private_dns_name_prefix'); + } + public set privateDnsNamePrefix(value: string) { + this._privateDnsNamePrefix = value; + } + public resetPrivateDnsNamePrefix() { + this._privateDnsNamePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateDnsNamePrefixInput() { + return this._privateDnsNamePrefix; + } + + // private_dns_names - computed: true, optional: false, required: false + public get privateDnsNames() { + return this.getListAttribute('private_dns_names'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // read_write_permissions - computed: false, optional: true, required: false + private _readWritePermissions?: string; + public get readWritePermissions() { + return this.getStringAttribute('read_write_permissions'); + } + public set readWritePermissions(value: string) { + this._readWritePermissions = value; + } + public resetReadWritePermissions() { + this._readWritePermissions = undefined; + } + // Temporarily expose input value. Use with caution. + public get readWritePermissionsInput() { + return this._readWritePermissions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rotate_day - computed: false, optional: true, required: false + private _rotateDay?: number; + public get rotateDay() { + return this.getNumberAttribute('rotate_day'); + } + public set rotateDay(value: number) { + this._rotateDay = value; + } + public resetRotateDay() { + this._rotateDay = undefined; + } + // Temporarily expose input value. Use with caution. + public get rotateDayInput() { + return this._rotateDay; + } + + // seconds_level_monitoring_enabled - computed: true, optional: true, required: false + private _secondsLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + public get secondsLevelMonitoringEnabled() { + return this.getBooleanAttribute('seconds_level_monitoring_enabled'); + } + public set secondsLevelMonitoringEnabled(value: boolean | cdktf.IResolvable) { + this._secondsLevelMonitoringEnabled = value; + } + public resetSecondsLevelMonitoringEnabled() { + this._secondsLevelMonitoringEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondsLevelMonitoringEnabledInput() { + return this._secondsLevelMonitoringEnabled; + } + + // seconds_level_monitoring_interval - computed: true, optional: true, required: false + private _secondsLevelMonitoringInterval?: number; + public get secondsLevelMonitoringInterval() { + return this.getNumberAttribute('seconds_level_monitoring_interval'); + } + public set secondsLevelMonitoringInterval(value: number) { + this._secondsLevelMonitoringInterval = value; + } + public resetSecondsLevelMonitoringInterval() { + this._secondsLevelMonitoringInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondsLevelMonitoringIntervalInput() { + return this._secondsLevelMonitoringInterval; + } + + // secret_id - computed: false, optional: true, required: false + private _secretId?: string; + public get secretId() { + return this.getStringAttribute('secret_id'); + } + public set secretId(value: string) { + this._secretId = value; + } + public resetSecretId() { + this._secretId = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretIdInput() { + return this._secretId; + } + + // secret_name - computed: false, optional: true, required: false + private _secretName?: string; + public get secretName() { + return this.getStringAttribute('secret_name'); + } + public set secretName(value: string) { + this._secretName = value; + } + public resetSecretName() { + this._secretName = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretNameInput() { + return this._secretName; + } + + // secret_version - computed: false, optional: true, required: false + private _secretVersion?: string; + public get secretVersion() { + return this.getStringAttribute('secret_version'); + } + public set secretVersion(value: string) { + this._secretVersion = value; + } + public resetSecretVersion() { + this._secretVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretVersionInput() { + return this._secretVersion; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // slow_log_show_original_status - computed: false, optional: true, required: false + private _slowLogShowOriginalStatus?: string; + public get slowLogShowOriginalStatus() { + return this.getStringAttribute('slow_log_show_original_status'); + } + public set slowLogShowOriginalStatus(value: string) { + this._slowLogShowOriginalStatus = value; + } + public resetSlowLogShowOriginalStatus() { + this._slowLogShowOriginalStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowLogShowOriginalStatusInput() { + return this._slowLogShowOriginalStatus; + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // switch_strategy - computed: true, optional: true, required: false + private _switchStrategy?: string; + public get switchStrategy() { + return this.getStringAttribute('switch_strategy'); + } + public set switchStrategy(value: string) { + this._switchStrategy = value; + } + public resetSwitchStrategy() { + this._switchStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get switchStrategyInput() { + return this._switchStrategy; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tde_enabled - computed: true, optional: true, required: false + private _tdeEnabled?: boolean | cdktf.IResolvable; + public get tdeEnabled() { + return this.getBooleanAttribute('tde_enabled'); + } + public set tdeEnabled(value: boolean | cdktf.IResolvable) { + this._tdeEnabled = value; + } + public resetTdeEnabled() { + this._tdeEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get tdeEnabledInput() { + return this._tdeEnabled; + } + + // time_zone - computed: true, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new RdsInstanceV3BackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: RdsInstanceV3BackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // db - computed: false, optional: false, required: true + private _db = new RdsInstanceV3DbOutputReference(this, "db"); + public get db() { + return this._db; + } + public putDb(value: RdsInstanceV3Db) { + this._db.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dbInput() { + return this._db.internalValue; + } + + // msdtc_hosts - computed: false, optional: true, required: false + private _msdtcHosts = new RdsInstanceV3MsdtcHostsList(this, "msdtc_hosts", true); + public get msdtcHosts() { + return this._msdtcHosts; + } + public putMsdtcHosts(value: RdsInstanceV3MsdtcHosts[] | cdktf.IResolvable) { + this._msdtcHosts.internalValue = value; + } + public resetMsdtcHosts() { + this._msdtcHosts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get msdtcHostsInput() { + return this._msdtcHosts.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new RdsInstanceV3ParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: RdsInstanceV3Parameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // restore - computed: false, optional: true, required: false + private _restore = new RdsInstanceV3RestoreOutputReference(this, "restore"); + public get restore() { + return this._restore; + } + public putRestore(value: RdsInstanceV3Restore) { + this._restore.internalValue = value; + } + public resetRestore() { + this._restore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreInput() { + return this._restore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsInstanceV3TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsInstanceV3Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // volume - computed: false, optional: false, required: true + private _volume = new RdsInstanceV3VolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: RdsInstanceV3Volume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZone), + binlog_retention_hours: cdktf.numberToTerraform(this._binlogRetentionHours), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + collation: cdktf.stringToTerraform(this._collation), + description: cdktf.stringToTerraform(this._description), + dss_pool_id: cdktf.stringToTerraform(this._dssPoolId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + flavor: cdktf.stringToTerraform(this._flavor), + ha_replication_mode: cdktf.stringToTerraform(this._haReplicationMode), + id: cdktf.stringToTerraform(this._id), + lower_case_table_names: cdktf.stringToTerraform(this._lowerCaseTableNames), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + param_group_id: cdktf.stringToTerraform(this._paramGroupId), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + power_action: cdktf.stringToTerraform(this._powerAction), + private_dns_name_prefix: cdktf.stringToTerraform(this._privateDnsNamePrefix), + read_write_permissions: cdktf.stringToTerraform(this._readWritePermissions), + region: cdktf.stringToTerraform(this._region), + rotate_day: cdktf.numberToTerraform(this._rotateDay), + seconds_level_monitoring_enabled: cdktf.booleanToTerraform(this._secondsLevelMonitoringEnabled), + seconds_level_monitoring_interval: cdktf.numberToTerraform(this._secondsLevelMonitoringInterval), + secret_id: cdktf.stringToTerraform(this._secretId), + secret_name: cdktf.stringToTerraform(this._secretName), + secret_version: cdktf.stringToTerraform(this._secretVersion), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + slow_log_show_original_status: cdktf.stringToTerraform(this._slowLogShowOriginalStatus), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + subnet_id: cdktf.stringToTerraform(this._subnetId), + switch_strategy: cdktf.stringToTerraform(this._switchStrategy), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tde_enabled: cdktf.booleanToTerraform(this._tdeEnabled), + time_zone: cdktf.stringToTerraform(this._timeZone), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: rdsInstanceV3BackupStrategyToTerraform(this._backupStrategy.internalValue), + db: rdsInstanceV3DbToTerraform(this._db.internalValue), + msdtc_hosts: cdktf.listMapper(rdsInstanceV3MsdtcHostsToTerraform, true)(this._msdtcHosts.internalValue), + parameters: cdktf.listMapper(rdsInstanceV3ParametersToTerraform, true)(this._parameters.internalValue), + restore: rdsInstanceV3RestoreToTerraform(this._restore.internalValue), + timeouts: rdsInstanceV3TimeoutsToTerraform(this._timeouts.internalValue), + volume: rdsInstanceV3VolumeToTerraform(this._volume.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZone), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + binlog_retention_hours: { + value: cdktf.numberToHclTerraform(this._binlogRetentionHours), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + collation: { + value: cdktf.stringToHclTerraform(this._collation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dss_pool_id: { + value: cdktf.stringToHclTerraform(this._dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ha_replication_mode: { + value: cdktf.stringToHclTerraform(this._haReplicationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lower_case_table_names: { + value: cdktf.stringToHclTerraform(this._lowerCaseTableNames), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param_group_id: { + value: cdktf.stringToHclTerraform(this._paramGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_dns_name_prefix: { + value: cdktf.stringToHclTerraform(this._privateDnsNamePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_write_permissions: { + value: cdktf.stringToHclTerraform(this._readWritePermissions), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rotate_day: { + value: cdktf.numberToHclTerraform(this._rotateDay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + seconds_level_monitoring_enabled: { + value: cdktf.booleanToHclTerraform(this._secondsLevelMonitoringEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + seconds_level_monitoring_interval: { + value: cdktf.numberToHclTerraform(this._secondsLevelMonitoringInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + secret_id: { + value: cdktf.stringToHclTerraform(this._secretId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_name: { + value: cdktf.stringToHclTerraform(this._secretName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_version: { + value: cdktf.stringToHclTerraform(this._secretVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slow_log_show_original_status: { + value: cdktf.stringToHclTerraform(this._slowLogShowOriginalStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + switch_strategy: { + value: cdktf.stringToHclTerraform(this._switchStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tde_enabled: { + value: cdktf.booleanToHclTerraform(this._tdeEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: rdsInstanceV3BackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceV3BackupStrategyList", + }, + db: { + value: rdsInstanceV3DbToHclTerraform(this._db.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceV3DbList", + }, + msdtc_hosts: { + value: cdktf.listMapperHcl(rdsInstanceV3MsdtcHostsToHclTerraform, true)(this._msdtcHosts.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsInstanceV3MsdtcHostsList", + }, + parameters: { + value: cdktf.listMapperHcl(rdsInstanceV3ParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsInstanceV3ParametersList", + }, + restore: { + value: rdsInstanceV3RestoreToHclTerraform(this._restore.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceV3RestoreList", + }, + timeouts: { + value: rdsInstanceV3TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsInstanceV3Timeouts", + }, + volume: { + value: rdsInstanceV3VolumeToHclTerraform(this._volume.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceV3VolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-instance/README.md b/src/constructs/providers/huaweicloud/rds-instance/README.md new file mode 100644 index 00000000..3d8238a2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance). diff --git a/src/constructs/providers/huaweicloud/rds-instance/index.ts b/src/constructs/providers/huaweicloud/rds-instance/index.ts new file mode 100644 index 00000000..beaebc07 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-instance/index.ts @@ -0,0 +1,2661 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#auto_pay RdsInstance#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#auto_renew RdsInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#availability_zone RdsInstance#availability_zone} + */ + readonly availabilityZone: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#binlog_retention_hours RdsInstance#binlog_retention_hours} + */ + readonly binlogRetentionHours?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#charging_mode RdsInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#collation RdsInstance#collation} + */ + readonly collation?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#description RdsInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#dss_pool_id RdsInstance#dss_pool_id} + */ + readonly dssPoolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#enterprise_project_id RdsInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#fixed_ip RdsInstance#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#flavor RdsInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#ha_replication_mode RdsInstance#ha_replication_mode} + */ + readonly haReplicationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#id RdsInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#lower_case_table_names RdsInstance#lower_case_table_names} + */ + readonly lowerCaseTableNames?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#maintain_begin RdsInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#maintain_end RdsInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#name RdsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#param_group_id RdsInstance#param_group_id} + */ + readonly paramGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#period RdsInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#period_unit RdsInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#power_action RdsInstance#power_action} + */ + readonly powerAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#private_dns_name_prefix RdsInstance#private_dns_name_prefix} + */ + readonly privateDnsNamePrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#read_write_permissions RdsInstance#read_write_permissions} + */ + readonly readWritePermissions?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#region RdsInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#rotate_day RdsInstance#rotate_day} + */ + readonly rotateDay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#seconds_level_monitoring_enabled RdsInstance#seconds_level_monitoring_enabled} + */ + readonly secondsLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#seconds_level_monitoring_interval RdsInstance#seconds_level_monitoring_interval} + */ + readonly secondsLevelMonitoringInterval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#secret_id RdsInstance#secret_id} + */ + readonly secretId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#secret_name RdsInstance#secret_name} + */ + readonly secretName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#secret_version RdsInstance#secret_version} + */ + readonly secretVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#security_group_id RdsInstance#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#slow_log_show_original_status RdsInstance#slow_log_show_original_status} + */ + readonly slowLogShowOriginalStatus?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#ssl_enable RdsInstance#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#subnet_id RdsInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#switch_strategy RdsInstance#switch_strategy} + */ + readonly switchStrategy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#tags RdsInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#tde_enabled RdsInstance#tde_enabled} + */ + readonly tdeEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#time_zone RdsInstance#time_zone} + */ + readonly timeZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#vpc_id RdsInstance#vpc_id} + */ + readonly vpcId: string; + /** + * backup_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#backup_strategy RdsInstance#backup_strategy} + */ + readonly backupStrategy?: RdsInstanceBackupStrategy; + /** + * db block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#db RdsInstance#db} + */ + readonly db: RdsInstanceDb; + /** + * msdtc_hosts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#msdtc_hosts RdsInstance#msdtc_hosts} + */ + readonly msdtcHosts?: RdsInstanceMsdtcHosts[] | cdktf.IResolvable; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#parameters RdsInstance#parameters} + */ + readonly parameters?: RdsInstanceParameters[] | cdktf.IResolvable; + /** + * restore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#restore RdsInstance#restore} + */ + readonly restore?: RdsInstanceRestore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#timeouts RdsInstance#timeouts} + */ + readonly timeouts?: RdsInstanceTimeouts; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#volume RdsInstance#volume} + */ + readonly volume: RdsInstanceVolume; +} +export interface RdsInstanceNodes { +} + +export function rdsInstanceNodesToTerraform(struct?: RdsInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rdsInstanceNodesToHclTerraform(struct?: RdsInstanceNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RdsInstanceNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsInstanceNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class RdsInstanceNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsInstanceNodesOutputReference { + return new RdsInstanceNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsInstanceBackupStrategy { + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#keep_days RdsInstance#keep_days} + */ + readonly keepDays?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#period RdsInstance#period} + */ + readonly period?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#start_time RdsInstance#start_time} + */ + readonly startTime: string; +} + +export function rdsInstanceBackupStrategyToTerraform(struct?: RdsInstanceBackupStrategyOutputReference | RdsInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + keep_days: cdktf.numberToTerraform(struct!.keepDays), + period: cdktf.stringToTerraform(struct!.period), + start_time: cdktf.stringToTerraform(struct!.startTime), + } +} + + +export function rdsInstanceBackupStrategyToHclTerraform(struct?: RdsInstanceBackupStrategyOutputReference | RdsInstanceBackupStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + keep_days: { + value: cdktf.numberToHclTerraform(struct!.keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period: { + value: cdktf.stringToHclTerraform(struct!.period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(struct!.startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceBackupStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceBackupStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._keepDays !== undefined) { + hasAnyValues = true; + internalValueResult.keepDays = this._keepDays; + } + if (this._period !== undefined) { + hasAnyValues = true; + internalValueResult.period = this._period; + } + if (this._startTime !== undefined) { + hasAnyValues = true; + internalValueResult.startTime = this._startTime; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceBackupStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._keepDays = undefined; + this._period = undefined; + this._startTime = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._keepDays = value.keepDays; + this._period = value.period; + this._startTime = value.startTime; + } + } + + // keep_days - computed: true, optional: true, required: false + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + public resetKeepDays() { + this._keepDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // period - computed: true, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } +} +export interface RdsInstanceDb { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#password RdsInstance#password} + */ + readonly password?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#port RdsInstance#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#type RdsInstance#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#version RdsInstance#version} + */ + readonly version: string; +} + +export function rdsInstanceDbToTerraform(struct?: RdsInstanceDbOutputReference | RdsInstanceDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + password: cdktf.stringToTerraform(struct!.password), + port: cdktf.numberToTerraform(struct!.port), + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function rdsInstanceDbToHclTerraform(struct?: RdsInstanceDbOutputReference | RdsInstanceDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceDbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceDb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceDb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._password = undefined; + this._port = undefined; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._password = value.password; + this._port = value.port; + this._type = value.type; + this._version = value.version; + } + } + + // password - computed: false, optional: true, required: false + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + public resetPassword() { + this._password = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface RdsInstanceMsdtcHosts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#host_name RdsInstance#host_name} + */ + readonly hostName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#ip RdsInstance#ip} + */ + readonly ip: string; +} + +export function rdsInstanceMsdtcHostsToTerraform(struct?: RdsInstanceMsdtcHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host_name: cdktf.stringToTerraform(struct!.hostName), + ip: cdktf.stringToTerraform(struct!.ip), + } +} + + +export function rdsInstanceMsdtcHostsToHclTerraform(struct?: RdsInstanceMsdtcHosts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host_name: { + value: cdktf.stringToHclTerraform(struct!.hostName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceMsdtcHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsInstanceMsdtcHosts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._hostName !== undefined) { + hasAnyValues = true; + internalValueResult.hostName = this._hostName; + } + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceMsdtcHosts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._hostName = undefined; + this._ip = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._hostName = value.hostName; + this._ip = value.ip; + } + } + + // host_name - computed: false, optional: false, required: true + private _hostName?: string; + public get hostName() { + return this.getStringAttribute('host_name'); + } + public set hostName(value: string) { + this._hostName = value; + } + // Temporarily expose input value. Use with caution. + public get hostNameInput() { + return this._hostName; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } +} + +export class RdsInstanceMsdtcHostsList extends cdktf.ComplexList { + public internalValue? : RdsInstanceMsdtcHosts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsInstanceMsdtcHostsOutputReference { + return new RdsInstanceMsdtcHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsInstanceParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#name RdsInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#value RdsInstance#value} + */ + readonly value: string; +} + +export function rdsInstanceParametersToTerraform(struct?: RdsInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function rdsInstanceParametersToHclTerraform(struct?: RdsInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsInstanceParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class RdsInstanceParametersList extends cdktf.ComplexList { + public internalValue? : RdsInstanceParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsInstanceParametersOutputReference { + return new RdsInstanceParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsInstanceRestore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#backup_id RdsInstance#backup_id} + */ + readonly backupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#database_name RdsInstance#database_name} + */ + readonly databaseName?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#instance_id RdsInstance#instance_id} + */ + readonly instanceId: string; +} + +export function rdsInstanceRestoreToTerraform(struct?: RdsInstanceRestoreOutputReference | RdsInstanceRestore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + backup_id: cdktf.stringToTerraform(struct!.backupId), + database_name: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.databaseName), + instance_id: cdktf.stringToTerraform(struct!.instanceId), + } +} + + +export function rdsInstanceRestoreToHclTerraform(struct?: RdsInstanceRestoreOutputReference | RdsInstanceRestore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(struct!.backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_name: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.databaseName), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + instance_id: { + value: cdktf.stringToHclTerraform(struct!.instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceRestoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceRestore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._backupId !== undefined) { + hasAnyValues = true; + internalValueResult.backupId = this._backupId; + } + if (this._databaseName !== undefined) { + hasAnyValues = true; + internalValueResult.databaseName = this._databaseName; + } + if (this._instanceId !== undefined) { + hasAnyValues = true; + internalValueResult.instanceId = this._instanceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceRestore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._backupId = undefined; + this._databaseName = undefined; + this._instanceId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._backupId = value.backupId; + this._databaseName = value.databaseName; + this._instanceId = value.instanceId; + } + } + + // backup_id - computed: false, optional: false, required: true + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // database_name - computed: false, optional: true, required: false + private _databaseName?: { [key: string]: string }; + public get databaseName() { + return this.getStringMapAttribute('database_name'); + } + public set databaseName(value: { [key: string]: string }) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } +} +export interface RdsInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#create RdsInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#default RdsInstance#default} + */ + readonly default?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#delete RdsInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#update RdsInstance#update} + */ + readonly update?: string; +} + +export function rdsInstanceTimeoutsToTerraform(struct?: RdsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + default: cdktf.stringToTerraform(struct!.default), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsInstanceTimeoutsToHclTerraform(struct?: RdsInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + default: { + value: cdktf.stringToHclTerraform(struct!.default), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._default !== undefined) { + hasAnyValues = true; + internalValueResult.default = this._default; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._default = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._default = value.default; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // default - computed: false, optional: true, required: false + private _default?: string; + public get default() { + return this.getStringAttribute('default'); + } + public set default(value: string) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsInstanceVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#disk_encryption_id RdsInstance#disk_encryption_id} + */ + readonly diskEncryptionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#limit_size RdsInstance#limit_size} + */ + readonly limitSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#size RdsInstance#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#trigger_threshold RdsInstance#trigger_threshold} + */ + readonly triggerThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#type RdsInstance#type} + */ + readonly type: string; +} + +export function rdsInstanceVolumeToTerraform(struct?: RdsInstanceVolumeOutputReference | RdsInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + disk_encryption_id: cdktf.stringToTerraform(struct!.diskEncryptionId), + limit_size: cdktf.numberToTerraform(struct!.limitSize), + size: cdktf.numberToTerraform(struct!.size), + trigger_threshold: cdktf.numberToTerraform(struct!.triggerThreshold), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function rdsInstanceVolumeToHclTerraform(struct?: RdsInstanceVolumeOutputReference | RdsInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + disk_encryption_id: { + value: cdktf.stringToHclTerraform(struct!.diskEncryptionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + limit_size: { + value: cdktf.numberToHclTerraform(struct!.limitSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_threshold: { + value: cdktf.numberToHclTerraform(struct!.triggerThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsInstanceVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsInstanceVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._diskEncryptionId !== undefined) { + hasAnyValues = true; + internalValueResult.diskEncryptionId = this._diskEncryptionId; + } + if (this._limitSize !== undefined) { + hasAnyValues = true; + internalValueResult.limitSize = this._limitSize; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._triggerThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.triggerThreshold = this._triggerThreshold; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsInstanceVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._diskEncryptionId = undefined; + this._limitSize = undefined; + this._size = undefined; + this._triggerThreshold = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._diskEncryptionId = value.diskEncryptionId; + this._limitSize = value.limitSize; + this._size = value.size; + this._triggerThreshold = value.triggerThreshold; + this._type = value.type; + } + } + + // disk_encryption_id - computed: true, optional: true, required: false + private _diskEncryptionId?: string; + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + public set diskEncryptionId(value: string) { + this._diskEncryptionId = value; + } + public resetDiskEncryptionId() { + this._diskEncryptionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskEncryptionIdInput() { + return this._diskEncryptionId; + } + + // limit_size - computed: false, optional: true, required: false + private _limitSize?: number; + public get limitSize() { + return this.getNumberAttribute('limit_size'); + } + public set limitSize(value: number) { + this._limitSize = value; + } + public resetLimitSize() { + this._limitSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitSizeInput() { + return this._limitSize; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // trigger_threshold - computed: false, optional: true, required: false + private _triggerThreshold?: number; + public get triggerThreshold() { + return this.getNumberAttribute('trigger_threshold'); + } + public set triggerThreshold(value: number) { + this._triggerThreshold = value; + } + public resetTriggerThreshold() { + this._triggerThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerThresholdInput() { + return this._triggerThreshold; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance huaweicloud_rds_instance} +*/ +export class RdsInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsInstance to import + * @param importFromId The id of the existing RdsInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_instance huaweicloud_rds_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsInstanceConfig + */ + public constructor(scope: Construct, id: string, config: RdsInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._binlogRetentionHours = config.binlogRetentionHours; + this._chargingMode = config.chargingMode; + this._collation = config.collation; + this._description = config.description; + this._dssPoolId = config.dssPoolId; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fixedIp = config.fixedIp; + this._flavor = config.flavor; + this._haReplicationMode = config.haReplicationMode; + this._id = config.id; + this._lowerCaseTableNames = config.lowerCaseTableNames; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._paramGroupId = config.paramGroupId; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._powerAction = config.powerAction; + this._privateDnsNamePrefix = config.privateDnsNamePrefix; + this._readWritePermissions = config.readWritePermissions; + this._region = config.region; + this._rotateDay = config.rotateDay; + this._secondsLevelMonitoringEnabled = config.secondsLevelMonitoringEnabled; + this._secondsLevelMonitoringInterval = config.secondsLevelMonitoringInterval; + this._secretId = config.secretId; + this._secretName = config.secretName; + this._secretVersion = config.secretVersion; + this._securityGroupId = config.securityGroupId; + this._slowLogShowOriginalStatus = config.slowLogShowOriginalStatus; + this._sslEnable = config.sslEnable; + this._subnetId = config.subnetId; + this._switchStrategy = config.switchStrategy; + this._tags = config.tags; + this._tdeEnabled = config.tdeEnabled; + this._timeZone = config.timeZone; + this._vpcId = config.vpcId; + this._backupStrategy.internalValue = config.backupStrategy; + this._db.internalValue = config.db; + this._msdtcHosts.internalValue = config.msdtcHosts; + this._parameters.internalValue = config.parameters; + this._restore.internalValue = config.restore; + this._timeouts.internalValue = config.timeouts; + this._volume.internalValue = config.volume; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string[]; + public get availabilityZone() { + return this.getListAttribute('availability_zone'); + } + public set availabilityZone(value: string[]) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // binlog_retention_hours - computed: false, optional: true, required: false + private _binlogRetentionHours?: number; + public get binlogRetentionHours() { + return this.getNumberAttribute('binlog_retention_hours'); + } + public set binlogRetentionHours(value: number) { + this._binlogRetentionHours = value; + } + public resetBinlogRetentionHours() { + this._binlogRetentionHours = undefined; + } + // Temporarily expose input value. Use with caution. + public get binlogRetentionHoursInput() { + return this._binlogRetentionHours; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // collation - computed: true, optional: true, required: false + private _collation?: string; + public get collation() { + return this.getStringAttribute('collation'); + } + public set collation(value: string) { + this._collation = value; + } + public resetCollation() { + this._collation = undefined; + } + // Temporarily expose input value. Use with caution. + public get collationInput() { + return this._collation; + } + + // created - computed: true, optional: false, required: false + public get created() { + return this.getStringAttribute('created'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dss_pool_id - computed: false, optional: true, required: false + private _dssPoolId?: string; + public get dssPoolId() { + return this.getStringAttribute('dss_pool_id'); + } + public set dssPoolId(value: string) { + this._dssPoolId = value; + } + public resetDssPoolId() { + this._dssPoolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dssPoolIdInput() { + return this._dssPoolId; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // ha_replication_mode - computed: true, optional: true, required: false + private _haReplicationMode?: string; + public get haReplicationMode() { + return this.getStringAttribute('ha_replication_mode'); + } + public set haReplicationMode(value: string) { + this._haReplicationMode = value; + } + public resetHaReplicationMode() { + this._haReplicationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get haReplicationModeInput() { + return this._haReplicationMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // lower_case_table_names - computed: false, optional: true, required: false + private _lowerCaseTableNames?: string; + public get lowerCaseTableNames() { + return this.getStringAttribute('lower_case_table_names'); + } + public set lowerCaseTableNames(value: string) { + this._lowerCaseTableNames = value; + } + public resetLowerCaseTableNames() { + this._lowerCaseTableNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get lowerCaseTableNamesInput() { + return this._lowerCaseTableNames; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new RdsInstanceNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // param_group_id - computed: false, optional: true, required: false + private _paramGroupId?: string; + public get paramGroupId() { + return this.getStringAttribute('param_group_id'); + } + public set paramGroupId(value: string) { + this._paramGroupId = value; + } + public resetParamGroupId() { + this._paramGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get paramGroupIdInput() { + return this._paramGroupId; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // power_action - computed: false, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // private_dns_name_prefix - computed: true, optional: true, required: false + private _privateDnsNamePrefix?: string; + public get privateDnsNamePrefix() { + return this.getStringAttribute('private_dns_name_prefix'); + } + public set privateDnsNamePrefix(value: string) { + this._privateDnsNamePrefix = value; + } + public resetPrivateDnsNamePrefix() { + this._privateDnsNamePrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateDnsNamePrefixInput() { + return this._privateDnsNamePrefix; + } + + // private_dns_names - computed: true, optional: false, required: false + public get privateDnsNames() { + return this.getListAttribute('private_dns_names'); + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // read_write_permissions - computed: false, optional: true, required: false + private _readWritePermissions?: string; + public get readWritePermissions() { + return this.getStringAttribute('read_write_permissions'); + } + public set readWritePermissions(value: string) { + this._readWritePermissions = value; + } + public resetReadWritePermissions() { + this._readWritePermissions = undefined; + } + // Temporarily expose input value. Use with caution. + public get readWritePermissionsInput() { + return this._readWritePermissions; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rotate_day - computed: false, optional: true, required: false + private _rotateDay?: number; + public get rotateDay() { + return this.getNumberAttribute('rotate_day'); + } + public set rotateDay(value: number) { + this._rotateDay = value; + } + public resetRotateDay() { + this._rotateDay = undefined; + } + // Temporarily expose input value. Use with caution. + public get rotateDayInput() { + return this._rotateDay; + } + + // seconds_level_monitoring_enabled - computed: true, optional: true, required: false + private _secondsLevelMonitoringEnabled?: boolean | cdktf.IResolvable; + public get secondsLevelMonitoringEnabled() { + return this.getBooleanAttribute('seconds_level_monitoring_enabled'); + } + public set secondsLevelMonitoringEnabled(value: boolean | cdktf.IResolvable) { + this._secondsLevelMonitoringEnabled = value; + } + public resetSecondsLevelMonitoringEnabled() { + this._secondsLevelMonitoringEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondsLevelMonitoringEnabledInput() { + return this._secondsLevelMonitoringEnabled; + } + + // seconds_level_monitoring_interval - computed: true, optional: true, required: false + private _secondsLevelMonitoringInterval?: number; + public get secondsLevelMonitoringInterval() { + return this.getNumberAttribute('seconds_level_monitoring_interval'); + } + public set secondsLevelMonitoringInterval(value: number) { + this._secondsLevelMonitoringInterval = value; + } + public resetSecondsLevelMonitoringInterval() { + this._secondsLevelMonitoringInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondsLevelMonitoringIntervalInput() { + return this._secondsLevelMonitoringInterval; + } + + // secret_id - computed: false, optional: true, required: false + private _secretId?: string; + public get secretId() { + return this.getStringAttribute('secret_id'); + } + public set secretId(value: string) { + this._secretId = value; + } + public resetSecretId() { + this._secretId = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretIdInput() { + return this._secretId; + } + + // secret_name - computed: false, optional: true, required: false + private _secretName?: string; + public get secretName() { + return this.getStringAttribute('secret_name'); + } + public set secretName(value: string) { + this._secretName = value; + } + public resetSecretName() { + this._secretName = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretNameInput() { + return this._secretName; + } + + // secret_version - computed: false, optional: true, required: false + private _secretVersion?: string; + public get secretVersion() { + return this.getStringAttribute('secret_version'); + } + public set secretVersion(value: string) { + this._secretVersion = value; + } + public resetSecretVersion() { + this._secretVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretVersionInput() { + return this._secretVersion; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // slow_log_show_original_status - computed: false, optional: true, required: false + private _slowLogShowOriginalStatus?: string; + public get slowLogShowOriginalStatus() { + return this.getStringAttribute('slow_log_show_original_status'); + } + public set slowLogShowOriginalStatus(value: string) { + this._slowLogShowOriginalStatus = value; + } + public resetSlowLogShowOriginalStatus() { + this._slowLogShowOriginalStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get slowLogShowOriginalStatusInput() { + return this._slowLogShowOriginalStatus; + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // switch_strategy - computed: true, optional: true, required: false + private _switchStrategy?: string; + public get switchStrategy() { + return this.getStringAttribute('switch_strategy'); + } + public set switchStrategy(value: string) { + this._switchStrategy = value; + } + public resetSwitchStrategy() { + this._switchStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get switchStrategyInput() { + return this._switchStrategy; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tde_enabled - computed: true, optional: true, required: false + private _tdeEnabled?: boolean | cdktf.IResolvable; + public get tdeEnabled() { + return this.getBooleanAttribute('tde_enabled'); + } + public set tdeEnabled(value: boolean | cdktf.IResolvable) { + this._tdeEnabled = value; + } + public resetTdeEnabled() { + this._tdeEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get tdeEnabledInput() { + return this._tdeEnabled; + } + + // time_zone - computed: true, optional: true, required: false + private _timeZone?: string; + public get timeZone() { + return this.getStringAttribute('time_zone'); + } + public set timeZone(value: string) { + this._timeZone = value; + } + public resetTimeZone() { + this._timeZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeZoneInput() { + return this._timeZone; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // backup_strategy - computed: false, optional: true, required: false + private _backupStrategy = new RdsInstanceBackupStrategyOutputReference(this, "backup_strategy"); + public get backupStrategy() { + return this._backupStrategy; + } + public putBackupStrategy(value: RdsInstanceBackupStrategy) { + this._backupStrategy.internalValue = value; + } + public resetBackupStrategy() { + this._backupStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupStrategyInput() { + return this._backupStrategy.internalValue; + } + + // db - computed: false, optional: false, required: true + private _db = new RdsInstanceDbOutputReference(this, "db"); + public get db() { + return this._db; + } + public putDb(value: RdsInstanceDb) { + this._db.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dbInput() { + return this._db.internalValue; + } + + // msdtc_hosts - computed: false, optional: true, required: false + private _msdtcHosts = new RdsInstanceMsdtcHostsList(this, "msdtc_hosts", true); + public get msdtcHosts() { + return this._msdtcHosts; + } + public putMsdtcHosts(value: RdsInstanceMsdtcHosts[] | cdktf.IResolvable) { + this._msdtcHosts.internalValue = value; + } + public resetMsdtcHosts() { + this._msdtcHosts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get msdtcHostsInput() { + return this._msdtcHosts.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new RdsInstanceParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: RdsInstanceParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // restore - computed: false, optional: true, required: false + private _restore = new RdsInstanceRestoreOutputReference(this, "restore"); + public get restore() { + return this._restore; + } + public putRestore(value: RdsInstanceRestore) { + this._restore.internalValue = value; + } + public resetRestore() { + this._restore.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreInput() { + return this._restore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // volume - computed: false, optional: false, required: true + private _volume = new RdsInstanceVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: RdsInstanceVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZone), + binlog_retention_hours: cdktf.numberToTerraform(this._binlogRetentionHours), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + collation: cdktf.stringToTerraform(this._collation), + description: cdktf.stringToTerraform(this._description), + dss_pool_id: cdktf.stringToTerraform(this._dssPoolId), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + flavor: cdktf.stringToTerraform(this._flavor), + ha_replication_mode: cdktf.stringToTerraform(this._haReplicationMode), + id: cdktf.stringToTerraform(this._id), + lower_case_table_names: cdktf.stringToTerraform(this._lowerCaseTableNames), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + param_group_id: cdktf.stringToTerraform(this._paramGroupId), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + power_action: cdktf.stringToTerraform(this._powerAction), + private_dns_name_prefix: cdktf.stringToTerraform(this._privateDnsNamePrefix), + read_write_permissions: cdktf.stringToTerraform(this._readWritePermissions), + region: cdktf.stringToTerraform(this._region), + rotate_day: cdktf.numberToTerraform(this._rotateDay), + seconds_level_monitoring_enabled: cdktf.booleanToTerraform(this._secondsLevelMonitoringEnabled), + seconds_level_monitoring_interval: cdktf.numberToTerraform(this._secondsLevelMonitoringInterval), + secret_id: cdktf.stringToTerraform(this._secretId), + secret_name: cdktf.stringToTerraform(this._secretName), + secret_version: cdktf.stringToTerraform(this._secretVersion), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + slow_log_show_original_status: cdktf.stringToTerraform(this._slowLogShowOriginalStatus), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + subnet_id: cdktf.stringToTerraform(this._subnetId), + switch_strategy: cdktf.stringToTerraform(this._switchStrategy), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tde_enabled: cdktf.booleanToTerraform(this._tdeEnabled), + time_zone: cdktf.stringToTerraform(this._timeZone), + vpc_id: cdktf.stringToTerraform(this._vpcId), + backup_strategy: rdsInstanceBackupStrategyToTerraform(this._backupStrategy.internalValue), + db: rdsInstanceDbToTerraform(this._db.internalValue), + msdtc_hosts: cdktf.listMapper(rdsInstanceMsdtcHostsToTerraform, true)(this._msdtcHosts.internalValue), + parameters: cdktf.listMapper(rdsInstanceParametersToTerraform, true)(this._parameters.internalValue), + restore: rdsInstanceRestoreToTerraform(this._restore.internalValue), + timeouts: rdsInstanceTimeoutsToTerraform(this._timeouts.internalValue), + volume: rdsInstanceVolumeToTerraform(this._volume.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZone), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + binlog_retention_hours: { + value: cdktf.numberToHclTerraform(this._binlogRetentionHours), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + collation: { + value: cdktf.stringToHclTerraform(this._collation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dss_pool_id: { + value: cdktf.stringToHclTerraform(this._dssPoolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ha_replication_mode: { + value: cdktf.stringToHclTerraform(this._haReplicationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lower_case_table_names: { + value: cdktf.stringToHclTerraform(this._lowerCaseTableNames), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + param_group_id: { + value: cdktf.stringToHclTerraform(this._paramGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_dns_name_prefix: { + value: cdktf.stringToHclTerraform(this._privateDnsNamePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_write_permissions: { + value: cdktf.stringToHclTerraform(this._readWritePermissions), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rotate_day: { + value: cdktf.numberToHclTerraform(this._rotateDay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + seconds_level_monitoring_enabled: { + value: cdktf.booleanToHclTerraform(this._secondsLevelMonitoringEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + seconds_level_monitoring_interval: { + value: cdktf.numberToHclTerraform(this._secondsLevelMonitoringInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + secret_id: { + value: cdktf.stringToHclTerraform(this._secretId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_name: { + value: cdktf.stringToHclTerraform(this._secretName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_version: { + value: cdktf.stringToHclTerraform(this._secretVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + slow_log_show_original_status: { + value: cdktf.stringToHclTerraform(this._slowLogShowOriginalStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + switch_strategy: { + value: cdktf.stringToHclTerraform(this._switchStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tde_enabled: { + value: cdktf.booleanToHclTerraform(this._tdeEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + time_zone: { + value: cdktf.stringToHclTerraform(this._timeZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_strategy: { + value: rdsInstanceBackupStrategyToHclTerraform(this._backupStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceBackupStrategyList", + }, + db: { + value: rdsInstanceDbToHclTerraform(this._db.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceDbList", + }, + msdtc_hosts: { + value: cdktf.listMapperHcl(rdsInstanceMsdtcHostsToHclTerraform, true)(this._msdtcHosts.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsInstanceMsdtcHostsList", + }, + parameters: { + value: cdktf.listMapperHcl(rdsInstanceParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsInstanceParametersList", + }, + restore: { + value: rdsInstanceRestoreToHclTerraform(this._restore.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceRestoreList", + }, + timeouts: { + value: rdsInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsInstanceTimeouts", + }, + volume: { + value: rdsInstanceVolumeToHclTerraform(this._volume.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsInstanceVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-lts-log/README.md b/src/constructs/providers/huaweicloud/rds-lts-log/README.md new file mode 100644 index 00000000..0f2f8d55 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-lts-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_lts_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_lts_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log). diff --git a/src/constructs/providers/huaweicloud/rds-lts-log/index.ts b/src/constructs/providers/huaweicloud/rds-lts-log/index.ts new file mode 100644 index 00000000..2561c15b --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-lts-log/index.ts @@ -0,0 +1,436 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsLtsLogConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the engine of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#engine RdsLtsLog#engine} + */ + readonly engine: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#id RdsLtsLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#instance_id RdsLtsLog#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the type of the LTS log. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#log_type RdsLtsLog#log_type} + */ + readonly logType: string; + /** + * Specifies the ID of the LTS log group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#lts_group_id RdsLtsLog#lts_group_id} + */ + readonly ltsGroupId: string; + /** + * Specifies the ID of the LTS log stream. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#lts_stream_id RdsLtsLog#lts_stream_id} + */ + readonly ltsStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#region RdsLtsLog#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#timeouts RdsLtsLog#timeouts} + */ + readonly timeouts?: RdsLtsLogTimeouts; +} +export interface RdsLtsLogTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#create RdsLtsLog#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#delete RdsLtsLog#delete} + */ + readonly delete?: string; +} + +export function rdsLtsLogTimeoutsToTerraform(struct?: RdsLtsLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsLtsLogTimeoutsToHclTerraform(struct?: RdsLtsLogTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsLtsLogTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsLtsLogTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsLtsLogTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log huaweicloud_rds_lts_log} +*/ +export class RdsLtsLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_lts_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsLtsLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsLtsLog to import + * @param importFromId The id of the existing RdsLtsLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsLtsLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_lts_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_lts_log huaweicloud_rds_lts_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsLtsLogConfig + */ + public constructor(scope: Construct, id: string, config: RdsLtsLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_lts_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._engine = config.engine; + this._id = config.id; + this._instanceId = config.instanceId; + this._logType = config.logType; + this._ltsGroupId = config.ltsGroupId; + this._ltsStreamId = config.ltsStreamId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // engine - computed: false, optional: false, required: true + private _engine?: string; + public get engine() { + return this.getStringAttribute('engine'); + } + public set engine(value: string) { + this._engine = value; + } + // Temporarily expose input value. Use with caution. + public get engineInput() { + return this._engine; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // log_type - computed: false, optional: false, required: true + private _logType?: string; + public get logType() { + return this.getStringAttribute('log_type'); + } + public set logType(value: string) { + this._logType = value; + } + // Temporarily expose input value. Use with caution. + public get logTypeInput() { + return this._logType; + } + + // lts_group_id - computed: false, optional: false, required: true + private _ltsGroupId?: string; + public get ltsGroupId() { + return this.getStringAttribute('lts_group_id'); + } + public set ltsGroupId(value: string) { + this._ltsGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsGroupIdInput() { + return this._ltsGroupId; + } + + // lts_stream_id - computed: false, optional: false, required: true + private _ltsStreamId?: string; + public get ltsStreamId() { + return this.getStringAttribute('lts_stream_id'); + } + public set ltsStreamId(value: string) { + this._ltsStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get ltsStreamIdInput() { + return this._ltsStreamId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsLtsLogTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsLtsLogTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + engine: cdktf.stringToTerraform(this._engine), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + log_type: cdktf.stringToTerraform(this._logType), + lts_group_id: cdktf.stringToTerraform(this._ltsGroupId), + lts_stream_id: cdktf.stringToTerraform(this._ltsStreamId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsLtsLogTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + engine: { + value: cdktf.stringToHclTerraform(this._engine), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_type: { + value: cdktf.stringToHclTerraform(this._logType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_group_id: { + value: cdktf.stringToHclTerraform(this._ltsGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lts_stream_id: { + value: cdktf.stringToHclTerraform(this._ltsStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsLtsLogTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsLtsLogTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-account/README.md b/src/constructs/providers/huaweicloud/rds-mysql-account/README.md new file mode 100644 index 00000000..4f32567d --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-account/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-account/index.ts new file mode 100644 index 00000000..125b8f4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-account/index.ts @@ -0,0 +1,475 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies remarks of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#description RdsMysqlAccount#description} + */ + readonly description?: string; + /** + * Specifies the IP addresses that are allowed to access your DB instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#hosts RdsMysqlAccount#hosts} + */ + readonly hosts?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#id RdsMysqlAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS Mysql instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#instance_id RdsMysqlAccount#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the username of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#name RdsMysqlAccount#name} + */ + readonly name: string; + /** + * Specifies the password of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#password RdsMysqlAccount#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#region RdsMysqlAccount#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#timeouts RdsMysqlAccount#timeouts} + */ + readonly timeouts?: RdsMysqlAccountTimeouts; +} +export interface RdsMysqlAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#create RdsMysqlAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#delete RdsMysqlAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#update RdsMysqlAccount#update} + */ + readonly update?: string; +} + +export function rdsMysqlAccountTimeoutsToTerraform(struct?: RdsMysqlAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsMysqlAccountTimeoutsToHclTerraform(struct?: RdsMysqlAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsMysqlAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account huaweicloud_rds_mysql_account} +*/ +export class RdsMysqlAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlAccount to import + * @param importFromId The id of the existing RdsMysqlAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_account huaweicloud_rds_mysql_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlAccountConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._hosts = config.hosts; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // hosts - computed: true, optional: true, required: false + private _hosts?: string[]; + public get hosts() { + return this.getListAttribute('hosts'); + } + public set hosts(value: string[]) { + this._hosts = value; + } + public resetHosts() { + this._hosts = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostsInput() { + return this._hosts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsMysqlAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsMysqlAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + hosts: cdktf.listMapper(cdktf.stringToTerraform, false)(this._hosts), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsMysqlAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hosts: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._hosts), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsMysqlAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsMysqlAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-binlog/README.md b/src/constructs/providers/huaweicloud/rds-mysql-binlog/README.md new file mode 100644 index 00000000..5a71250a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-binlog/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_binlog` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_binlog`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-binlog/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-binlog/index.ts new file mode 100644 index 00000000..23d81297 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-binlog/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlBinlogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog#binlog_retention_hours RdsMysqlBinlog#binlog_retention_hours} + */ + readonly binlogRetentionHours: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog#id RdsMysqlBinlog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog#instance_id RdsMysqlBinlog#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog#region RdsMysqlBinlog#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog huaweicloud_rds_mysql_binlog} +*/ +export class RdsMysqlBinlog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_binlog"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlBinlog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlBinlog to import + * @param importFromId The id of the existing RdsMysqlBinlog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlBinlog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_binlog", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_binlog huaweicloud_rds_mysql_binlog} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlBinlogConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlBinlogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_binlog', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._binlogRetentionHours = config.binlogRetentionHours; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // binlog_retention_hours - computed: false, optional: false, required: true + private _binlogRetentionHours?: number; + public get binlogRetentionHours() { + return this.getNumberAttribute('binlog_retention_hours'); + } + public set binlogRetentionHours(value: number) { + this._binlogRetentionHours = value; + } + // Temporarily expose input value. Use with caution. + public get binlogRetentionHoursInput() { + return this._binlogRetentionHours; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + binlog_retention_hours: cdktf.numberToTerraform(this._binlogRetentionHours), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + binlog_retention_hours: { + value: cdktf.numberToHclTerraform(this._binlogRetentionHours), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-database-privilege/README.md b/src/constructs/providers/huaweicloud/rds-mysql-database-privilege/README.md new file mode 100644 index 00000000..b94db172 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-database-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_database_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_database_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-database-privilege/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-database-privilege/index.ts new file mode 100644 index 00000000..ba0f7a64 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-database-privilege/index.ts @@ -0,0 +1,565 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlDatabasePrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#db_name RdsMysqlDatabasePrivilege#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#id RdsMysqlDatabasePrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS Mysql instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#instance_id RdsMysqlDatabasePrivilege#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#region RdsMysqlDatabasePrivilege#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#timeouts RdsMysqlDatabasePrivilege#timeouts} + */ + readonly timeouts?: RdsMysqlDatabasePrivilegeTimeouts; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#users RdsMysqlDatabasePrivilege#users} + */ + readonly users: RdsMysqlDatabasePrivilegeUsers[] | cdktf.IResolvable; +} +export interface RdsMysqlDatabasePrivilegeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#create RdsMysqlDatabasePrivilege#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#delete RdsMysqlDatabasePrivilege#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#update RdsMysqlDatabasePrivilege#update} + */ + readonly update?: string; +} + +export function rdsMysqlDatabasePrivilegeTimeoutsToTerraform(struct?: RdsMysqlDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsMysqlDatabasePrivilegeTimeoutsToHclTerraform(struct?: RdsMysqlDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabasePrivilegeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsMysqlDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsMysqlDatabasePrivilegeUsers { + /** + * Specifies the username of the database account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#name RdsMysqlDatabasePrivilege#name} + */ + readonly name: string; + /** + * Specifies the read-only permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#readonly RdsMysqlDatabasePrivilege#readonly} + */ + readonly readonly?: boolean | cdktf.IResolvable; +} + +export function rdsMysqlDatabasePrivilegeUsersToTerraform(struct?: RdsMysqlDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + readonly: cdktf.booleanToTerraform(struct!.readonly), + } +} + + +export function rdsMysqlDatabasePrivilegeUsersToHclTerraform(struct?: RdsMysqlDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(struct!.readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabasePrivilegeUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsMysqlDatabasePrivilegeUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._readonly !== undefined) { + hasAnyValues = true; + internalValueResult.readonly = this._readonly; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabasePrivilegeUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._readonly = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._readonly = value.readonly; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // readonly - computed: true, optional: true, required: false + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + public resetReadonly() { + this._readonly = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } +} + +export class RdsMysqlDatabasePrivilegeUsersList extends cdktf.ComplexList { + public internalValue? : RdsMysqlDatabasePrivilegeUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsMysqlDatabasePrivilegeUsersOutputReference { + return new RdsMysqlDatabasePrivilegeUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege huaweicloud_rds_mysql_database_privilege} +*/ +export class RdsMysqlDatabasePrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_database_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlDatabasePrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlDatabasePrivilege to import + * @param importFromId The id of the existing RdsMysqlDatabasePrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlDatabasePrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_database_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_privilege huaweicloud_rds_mysql_database_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlDatabasePrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlDatabasePrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_database_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsMysqlDatabasePrivilegeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsMysqlDatabasePrivilegeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // users - computed: false, optional: false, required: true + private _users = new RdsMysqlDatabasePrivilegeUsersList(this, "users", true); + public get users() { + return this._users; + } + public putUsers(value: RdsMysqlDatabasePrivilegeUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsMysqlDatabasePrivilegeTimeoutsToTerraform(this._timeouts.internalValue), + users: cdktf.listMapper(rdsMysqlDatabasePrivilegeUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsMysqlDatabasePrivilegeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsMysqlDatabasePrivilegeTimeouts", + }, + users: { + value: cdktf.listMapperHcl(rdsMysqlDatabasePrivilegeUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsMysqlDatabasePrivilegeUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/README.md b/src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/README.md new file mode 100644 index 00000000..2e6a897b --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_database_table_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_database_table_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/index.ts new file mode 100644 index 00000000..8d881dbf --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-database-table-restore/index.ts @@ -0,0 +1,853 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlDatabaseTableRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#id RdsMysqlDatabaseTableRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of RDS MySQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#instance_id RdsMysqlDatabaseTableRestore#instance_id} + */ + readonly instanceId: string; + /** + * Specifies whether to use fast restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#is_fast_restore RdsMysqlDatabaseTableRestore#is_fast_restore} + */ + readonly isFastRestore?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#region RdsMysqlDatabaseTableRestore#region} + */ + readonly region?: string; + /** + * Specifies the restoration time point. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#restore_time RdsMysqlDatabaseTableRestore#restore_time} + */ + readonly restoreTime: number; + /** + * databases block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#databases RdsMysqlDatabaseTableRestore#databases} + */ + readonly databases?: RdsMysqlDatabaseTableRestoreDatabases[] | cdktf.IResolvable; + /** + * restore_tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#restore_tables RdsMysqlDatabaseTableRestore#restore_tables} + */ + readonly restoreTables?: RdsMysqlDatabaseTableRestoreRestoreTables[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#timeouts RdsMysqlDatabaseTableRestore#timeouts} + */ + readonly timeouts?: RdsMysqlDatabaseTableRestoreTimeouts; +} +export interface RdsMysqlDatabaseTableRestoreDatabases { + /** + * Specifies the name of the database after restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#new_name RdsMysqlDatabaseTableRestore#new_name} + */ + readonly newName: string; + /** + * Specifies the name of the database before restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#old_name RdsMysqlDatabaseTableRestore#old_name} + */ + readonly oldName: string; +} + +export function rdsMysqlDatabaseTableRestoreDatabasesToTerraform(struct?: RdsMysqlDatabaseTableRestoreDatabases | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + new_name: cdktf.stringToTerraform(struct!.newName), + old_name: cdktf.stringToTerraform(struct!.oldName), + } +} + + +export function rdsMysqlDatabaseTableRestoreDatabasesToHclTerraform(struct?: RdsMysqlDatabaseTableRestoreDatabases | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + new_name: { + value: cdktf.stringToHclTerraform(struct!.newName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + old_name: { + value: cdktf.stringToHclTerraform(struct!.oldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabaseTableRestoreDatabasesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsMysqlDatabaseTableRestoreDatabases | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._newName !== undefined) { + hasAnyValues = true; + internalValueResult.newName = this._newName; + } + if (this._oldName !== undefined) { + hasAnyValues = true; + internalValueResult.oldName = this._oldName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabaseTableRestoreDatabases | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._newName = undefined; + this._oldName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._newName = value.newName; + this._oldName = value.oldName; + } + } + + // new_name - computed: false, optional: false, required: true + private _newName?: string; + public get newName() { + return this.getStringAttribute('new_name'); + } + public set newName(value: string) { + this._newName = value; + } + // Temporarily expose input value. Use with caution. + public get newNameInput() { + return this._newName; + } + + // old_name - computed: false, optional: false, required: true + private _oldName?: string; + public get oldName() { + return this.getStringAttribute('old_name'); + } + public set oldName(value: string) { + this._oldName = value; + } + // Temporarily expose input value. Use with caution. + public get oldNameInput() { + return this._oldName; + } +} + +export class RdsMysqlDatabaseTableRestoreDatabasesList extends cdktf.ComplexList { + public internalValue? : RdsMysqlDatabaseTableRestoreDatabases[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsMysqlDatabaseTableRestoreDatabasesOutputReference { + return new RdsMysqlDatabaseTableRestoreDatabasesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsMysqlDatabaseTableRestoreRestoreTablesTables { + /** + * Specifies the name of the table after restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#new_name RdsMysqlDatabaseTableRestore#new_name} + */ + readonly newName: string; + /** + * Specifies the name of the table before restoration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#old_name RdsMysqlDatabaseTableRestore#old_name} + */ + readonly oldName: string; +} + +export function rdsMysqlDatabaseTableRestoreRestoreTablesTablesToTerraform(struct?: RdsMysqlDatabaseTableRestoreRestoreTablesTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + new_name: cdktf.stringToTerraform(struct!.newName), + old_name: cdktf.stringToTerraform(struct!.oldName), + } +} + + +export function rdsMysqlDatabaseTableRestoreRestoreTablesTablesToHclTerraform(struct?: RdsMysqlDatabaseTableRestoreRestoreTablesTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + new_name: { + value: cdktf.stringToHclTerraform(struct!.newName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + old_name: { + value: cdktf.stringToHclTerraform(struct!.oldName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabaseTableRestoreRestoreTablesTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsMysqlDatabaseTableRestoreRestoreTablesTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._newName !== undefined) { + hasAnyValues = true; + internalValueResult.newName = this._newName; + } + if (this._oldName !== undefined) { + hasAnyValues = true; + internalValueResult.oldName = this._oldName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabaseTableRestoreRestoreTablesTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._newName = undefined; + this._oldName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._newName = value.newName; + this._oldName = value.oldName; + } + } + + // new_name - computed: false, optional: false, required: true + private _newName?: string; + public get newName() { + return this.getStringAttribute('new_name'); + } + public set newName(value: string) { + this._newName = value; + } + // Temporarily expose input value. Use with caution. + public get newNameInput() { + return this._newName; + } + + // old_name - computed: false, optional: false, required: true + private _oldName?: string; + public get oldName() { + return this.getStringAttribute('old_name'); + } + public set oldName(value: string) { + this._oldName = value; + } + // Temporarily expose input value. Use with caution. + public get oldNameInput() { + return this._oldName; + } +} + +export class RdsMysqlDatabaseTableRestoreRestoreTablesTablesList extends cdktf.ComplexList { + public internalValue? : RdsMysqlDatabaseTableRestoreRestoreTablesTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsMysqlDatabaseTableRestoreRestoreTablesTablesOutputReference { + return new RdsMysqlDatabaseTableRestoreRestoreTablesTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsMysqlDatabaseTableRestoreRestoreTables { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#database RdsMysqlDatabaseTableRestore#database} + */ + readonly database: string; + /** + * tables block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#tables RdsMysqlDatabaseTableRestore#tables} + */ + readonly tables: RdsMysqlDatabaseTableRestoreRestoreTablesTables[] | cdktf.IResolvable; +} + +export function rdsMysqlDatabaseTableRestoreRestoreTablesToTerraform(struct?: RdsMysqlDatabaseTableRestoreRestoreTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + database: cdktf.stringToTerraform(struct!.database), + tables: cdktf.listMapper(rdsMysqlDatabaseTableRestoreRestoreTablesTablesToTerraform, true)(struct!.tables), + } +} + + +export function rdsMysqlDatabaseTableRestoreRestoreTablesToHclTerraform(struct?: RdsMysqlDatabaseTableRestoreRestoreTables | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + database: { + value: cdktf.stringToHclTerraform(struct!.database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tables: { + value: cdktf.listMapperHcl(rdsMysqlDatabaseTableRestoreRestoreTablesTablesToHclTerraform, true)(struct!.tables), + isBlock: true, + type: "list", + storageClassType: "RdsMysqlDatabaseTableRestoreRestoreTablesTablesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabaseTableRestoreRestoreTablesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsMysqlDatabaseTableRestoreRestoreTables | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._database !== undefined) { + hasAnyValues = true; + internalValueResult.database = this._database; + } + if (this._tables?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.tables = this._tables?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabaseTableRestoreRestoreTables | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._database = undefined; + this._tables.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._database = value.database; + this._tables.internalValue = value.tables; + } + } + + // database - computed: false, optional: false, required: true + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // tables - computed: false, optional: false, required: true + private _tables = new RdsMysqlDatabaseTableRestoreRestoreTablesTablesList(this, "tables", false); + public get tables() { + return this._tables; + } + public putTables(value: RdsMysqlDatabaseTableRestoreRestoreTablesTables[] | cdktf.IResolvable) { + this._tables.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get tablesInput() { + return this._tables.internalValue; + } +} + +export class RdsMysqlDatabaseTableRestoreRestoreTablesList extends cdktf.ComplexList { + public internalValue? : RdsMysqlDatabaseTableRestoreRestoreTables[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsMysqlDatabaseTableRestoreRestoreTablesOutputReference { + return new RdsMysqlDatabaseTableRestoreRestoreTablesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsMysqlDatabaseTableRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#create RdsMysqlDatabaseTableRestore#create} + */ + readonly create?: string; +} + +export function rdsMysqlDatabaseTableRestoreTimeoutsToTerraform(struct?: RdsMysqlDatabaseTableRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function rdsMysqlDatabaseTableRestoreTimeoutsToHclTerraform(struct?: RdsMysqlDatabaseTableRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabaseTableRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsMysqlDatabaseTableRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabaseTableRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore huaweicloud_rds_mysql_database_table_restore} +*/ +export class RdsMysqlDatabaseTableRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_database_table_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlDatabaseTableRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlDatabaseTableRestore to import + * @param importFromId The id of the existing RdsMysqlDatabaseTableRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlDatabaseTableRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_database_table_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database_table_restore huaweicloud_rds_mysql_database_table_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlDatabaseTableRestoreConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlDatabaseTableRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_database_table_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._isFastRestore = config.isFastRestore; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._databases.internalValue = config.databases; + this._restoreTables.internalValue = config.restoreTables; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_fast_restore - computed: false, optional: true, required: false + private _isFastRestore?: boolean | cdktf.IResolvable; + public get isFastRestore() { + return this.getBooleanAttribute('is_fast_restore'); + } + public set isFastRestore(value: boolean | cdktf.IResolvable) { + this._isFastRestore = value; + } + public resetIsFastRestore() { + this._isFastRestore = undefined; + } + // Temporarily expose input value. Use with caution. + public get isFastRestoreInput() { + return this._isFastRestore; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: false, required: true + private _restoreTime?: number; + public get restoreTime() { + return this.getNumberAttribute('restore_time'); + } + public set restoreTime(value: number) { + this._restoreTime = value; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // databases - computed: false, optional: true, required: false + private _databases = new RdsMysqlDatabaseTableRestoreDatabasesList(this, "databases", false); + public get databases() { + return this._databases; + } + public putDatabases(value: RdsMysqlDatabaseTableRestoreDatabases[] | cdktf.IResolvable) { + this._databases.internalValue = value; + } + public resetDatabases() { + this._databases.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get databasesInput() { + return this._databases.internalValue; + } + + // restore_tables - computed: false, optional: true, required: false + private _restoreTables = new RdsMysqlDatabaseTableRestoreRestoreTablesList(this, "restore_tables", false); + public get restoreTables() { + return this._restoreTables; + } + public putRestoreTables(value: RdsMysqlDatabaseTableRestoreRestoreTables[] | cdktf.IResolvable) { + this._restoreTables.internalValue = value; + } + public resetRestoreTables() { + this._restoreTables.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreTablesInput() { + return this._restoreTables.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsMysqlDatabaseTableRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsMysqlDatabaseTableRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_fast_restore: cdktf.booleanToTerraform(this._isFastRestore), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.numberToTerraform(this._restoreTime), + databases: cdktf.listMapper(rdsMysqlDatabaseTableRestoreDatabasesToTerraform, true)(this._databases.internalValue), + restore_tables: cdktf.listMapper(rdsMysqlDatabaseTableRestoreRestoreTablesToTerraform, true)(this._restoreTables.internalValue), + timeouts: rdsMysqlDatabaseTableRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_fast_restore: { + value: cdktf.booleanToHclTerraform(this._isFastRestore), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.numberToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + databases: { + value: cdktf.listMapperHcl(rdsMysqlDatabaseTableRestoreDatabasesToHclTerraform, true)(this._databases.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsMysqlDatabaseTableRestoreDatabasesList", + }, + restore_tables: { + value: cdktf.listMapperHcl(rdsMysqlDatabaseTableRestoreRestoreTablesToHclTerraform, true)(this._restoreTables.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsMysqlDatabaseTableRestoreRestoreTablesList", + }, + timeouts: { + value: rdsMysqlDatabaseTableRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsMysqlDatabaseTableRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-database/README.md b/src/constructs/providers/huaweicloud/rds-mysql-database/README.md new file mode 100644 index 00000000..fbf37f59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-database/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-database/index.ts new file mode 100644 index 00000000..f9ccad3a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-database/index.ts @@ -0,0 +1,445 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the character set used by the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#character_set RdsMysqlDatabase#character_set} + */ + readonly characterSet: string; + /** + * Specifies the database description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#description RdsMysqlDatabase#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#id RdsMysqlDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS Mysql instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#instance_id RdsMysqlDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#name RdsMysqlDatabase#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#region RdsMysqlDatabase#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#timeouts RdsMysqlDatabase#timeouts} + */ + readonly timeouts?: RdsMysqlDatabaseTimeouts; +} +export interface RdsMysqlDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#create RdsMysqlDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#delete RdsMysqlDatabase#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#update RdsMysqlDatabase#update} + */ + readonly update?: string; +} + +export function rdsMysqlDatabaseTimeoutsToTerraform(struct?: RdsMysqlDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsMysqlDatabaseTimeoutsToHclTerraform(struct?: RdsMysqlDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsMysqlDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database huaweicloud_rds_mysql_database} +*/ +export class RdsMysqlDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlDatabase to import + * @param importFromId The id of the existing RdsMysqlDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_database huaweicloud_rds_mysql_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: false, optional: false, required: true + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsMysqlDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsMysqlDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsMysqlDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsMysqlDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsMysqlDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/README.md b/src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/README.md new file mode 100644 index 00000000..c97b9468 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_proxy_restart` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_proxy_restart`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/index.ts new file mode 100644 index 00000000..df5b5be5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-proxy-restart/index.ts @@ -0,0 +1,318 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlProxyRestartConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#id RdsMysqlProxyRestart#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#instance_id RdsMysqlProxyRestart#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#proxy_id RdsMysqlProxyRestart#proxy_id} + */ + readonly proxyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#region RdsMysqlProxyRestart#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#timeouts RdsMysqlProxyRestart#timeouts} + */ + readonly timeouts?: RdsMysqlProxyRestartTimeouts; +} +export interface RdsMysqlProxyRestartTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#create RdsMysqlProxyRestart#create} + */ + readonly create?: string; +} + +export function rdsMysqlProxyRestartTimeoutsToTerraform(struct?: RdsMysqlProxyRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function rdsMysqlProxyRestartTimeoutsToHclTerraform(struct?: RdsMysqlProxyRestartTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlProxyRestartTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsMysqlProxyRestartTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlProxyRestartTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart huaweicloud_rds_mysql_proxy_restart} +*/ +export class RdsMysqlProxyRestart extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_proxy_restart"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlProxyRestart resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlProxyRestart to import + * @param importFromId The id of the existing RdsMysqlProxyRestart that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlProxyRestart to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_proxy_restart", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy_restart huaweicloud_rds_mysql_proxy_restart} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlProxyRestartConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlProxyRestartConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_proxy_restart', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._proxyId = config.proxyId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // proxy_id - computed: false, optional: false, required: true + private _proxyId?: string; + public get proxyId() { + return this.getStringAttribute('proxy_id'); + } + public set proxyId(value: string) { + this._proxyId = value; + } + // Temporarily expose input value. Use with caution. + public get proxyIdInput() { + return this._proxyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsMysqlProxyRestartTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsMysqlProxyRestartTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + proxy_id: cdktf.stringToTerraform(this._proxyId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsMysqlProxyRestartTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_id: { + value: cdktf.stringToHclTerraform(this._proxyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsMysqlProxyRestartTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsMysqlProxyRestartTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-mysql-proxy/README.md b/src/constructs/providers/huaweicloud/rds-mysql-proxy/README.md new file mode 100644 index 00000000..4b29f155 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-proxy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_mysql_proxy` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_mysql_proxy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy). diff --git a/src/constructs/providers/huaweicloud/rds-mysql-proxy/index.ts b/src/constructs/providers/huaweicloud/rds-mysql-proxy/index.ts new file mode 100644 index 00000000..0a7331cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-mysql-proxy/index.ts @@ -0,0 +1,1042 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsMysqlProxyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#flavor RdsMysqlProxy#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#id RdsMysqlProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#instance_id RdsMysqlProxy#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#node_num RdsMysqlProxy#node_num} + */ + readonly nodeNum: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#proxy_mode RdsMysqlProxy#proxy_mode} + */ + readonly proxyMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#proxy_name RdsMysqlProxy#proxy_name} + */ + readonly proxyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#region RdsMysqlProxy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#route_mode RdsMysqlProxy#route_mode} + */ + readonly routeMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#subnet_id RdsMysqlProxy#subnet_id} + */ + readonly subnetId?: string; + /** + * master_node_weight block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#master_node_weight RdsMysqlProxy#master_node_weight} + */ + readonly masterNodeWeight?: RdsMysqlProxyMasterNodeWeight; + /** + * readonly_nodes_weight block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#readonly_nodes_weight RdsMysqlProxy#readonly_nodes_weight} + */ + readonly readonlyNodesWeight?: RdsMysqlProxyReadonlyNodesWeight[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#timeouts RdsMysqlProxy#timeouts} + */ + readonly timeouts?: RdsMysqlProxyTimeouts; +} +export interface RdsMysqlProxyNodes { +} + +export function rdsMysqlProxyNodesToTerraform(struct?: RdsMysqlProxyNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rdsMysqlProxyNodesToHclTerraform(struct?: RdsMysqlProxyNodes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RdsMysqlProxyNodesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsMysqlProxyNodes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlProxyNodes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // az_code - computed: true, optional: false, required: false + public get azCode() { + return this.getStringAttribute('az_code'); + } + + // frozen_flag - computed: true, optional: false, required: false + public get frozenFlag() { + return this.getNumberAttribute('frozen_flag'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // role - computed: true, optional: false, required: false + public get role() { + return this.getStringAttribute('role'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class RdsMysqlProxyNodesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsMysqlProxyNodesOutputReference { + return new RdsMysqlProxyNodesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsMysqlProxyMasterNodeWeight { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#id RdsMysqlProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#weight RdsMysqlProxy#weight} + */ + readonly weight: number; +} + +export function rdsMysqlProxyMasterNodeWeightToTerraform(struct?: RdsMysqlProxyMasterNodeWeightOutputReference | RdsMysqlProxyMasterNodeWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function rdsMysqlProxyMasterNodeWeightToHclTerraform(struct?: RdsMysqlProxyMasterNodeWeightOutputReference | RdsMysqlProxyMasterNodeWeight): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlProxyMasterNodeWeightOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsMysqlProxyMasterNodeWeight | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlProxyMasterNodeWeight | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._id = undefined; + this._weight = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._id = value.id; + this._weight = value.weight; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // weight - computed: false, optional: false, required: true + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} +export interface RdsMysqlProxyReadonlyNodesWeight { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#id RdsMysqlProxy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#weight RdsMysqlProxy#weight} + */ + readonly weight: number; +} + +export function rdsMysqlProxyReadonlyNodesWeightToTerraform(struct?: RdsMysqlProxyReadonlyNodesWeight | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function rdsMysqlProxyReadonlyNodesWeightToHclTerraform(struct?: RdsMysqlProxyReadonlyNodesWeight | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlProxyReadonlyNodesWeightOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsMysqlProxyReadonlyNodesWeight | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlProxyReadonlyNodesWeight | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._weight = value.weight; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // weight - computed: false, optional: false, required: true + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class RdsMysqlProxyReadonlyNodesWeightList extends cdktf.ComplexList { + public internalValue? : RdsMysqlProxyReadonlyNodesWeight[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsMysqlProxyReadonlyNodesWeightOutputReference { + return new RdsMysqlProxyReadonlyNodesWeightOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsMysqlProxyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#create RdsMysqlProxy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#delete RdsMysqlProxy#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#update RdsMysqlProxy#update} + */ + readonly update?: string; +} + +export function rdsMysqlProxyTimeoutsToTerraform(struct?: RdsMysqlProxyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsMysqlProxyTimeoutsToHclTerraform(struct?: RdsMysqlProxyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsMysqlProxyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsMysqlProxyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsMysqlProxyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy huaweicloud_rds_mysql_proxy} +*/ +export class RdsMysqlProxy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_mysql_proxy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsMysqlProxy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsMysqlProxy to import + * @param importFromId The id of the existing RdsMysqlProxy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsMysqlProxy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_mysql_proxy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_mysql_proxy huaweicloud_rds_mysql_proxy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsMysqlProxyConfig + */ + public constructor(scope: Construct, id: string, config: RdsMysqlProxyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_mysql_proxy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._flavor = config.flavor; + this._id = config.id; + this._instanceId = config.instanceId; + this._nodeNum = config.nodeNum; + this._proxyMode = config.proxyMode; + this._proxyName = config.proxyName; + this._region = config.region; + this._routeMode = config.routeMode; + this._subnetId = config.subnetId; + this._masterNodeWeight.internalValue = config.masterNodeWeight; + this._readonlyNodesWeight.internalValue = config.readonlyNodesWeight; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // alt_flag - computed: true, optional: false, required: false + public get altFlag() { + return this.getBooleanAttribute('alt_flag'); + } + + // connection_pool_type - computed: true, optional: false, required: false + public get connectionPoolType() { + return this.getStringAttribute('connection_pool_type'); + } + + // delay_threshold_in_seconds - computed: true, optional: false, required: false + public get delayThresholdInSeconds() { + return this.getNumberAttribute('delay_threshold_in_seconds'); + } + + // dns_name - computed: true, optional: false, required: false + public get dnsName() { + return this.getStringAttribute('dns_name'); + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // flavor_group_type - computed: true, optional: false, required: false + public get flavorGroupType() { + return this.getStringAttribute('flavor_group_type'); + } + + // force_read_only - computed: true, optional: false, required: false + public get forceReadOnly() { + return this.getBooleanAttribute('force_read_only'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // memory - computed: true, optional: false, required: false + public get memory() { + return this.getStringAttribute('memory'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // node_num - computed: false, optional: false, required: true + private _nodeNum?: number; + public get nodeNum() { + return this.getNumberAttribute('node_num'); + } + public set nodeNum(value: number) { + this._nodeNum = value; + } + // Temporarily expose input value. Use with caution. + public get nodeNumInput() { + return this._nodeNum; + } + + // nodes - computed: true, optional: false, required: false + private _nodes = new RdsMysqlProxyNodesList(this, "nodes", false); + public get nodes() { + return this._nodes; + } + + // pay_mode - computed: true, optional: false, required: false + public get payMode() { + return this.getStringAttribute('pay_mode'); + } + + // port - computed: true, optional: false, required: false + public get port() { + return this.getNumberAttribute('port'); + } + + // proxy_mode - computed: true, optional: true, required: false + private _proxyMode?: string; + public get proxyMode() { + return this.getStringAttribute('proxy_mode'); + } + public set proxyMode(value: string) { + this._proxyMode = value; + } + public resetProxyMode() { + this._proxyMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyModeInput() { + return this._proxyMode; + } + + // proxy_name - computed: true, optional: true, required: false + private _proxyName?: string; + public get proxyName() { + return this.getStringAttribute('proxy_name'); + } + public set proxyName(value: string) { + this._proxyName = value; + } + public resetProxyName() { + this._proxyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyNameInput() { + return this._proxyName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_mode - computed: true, optional: true, required: false + private _routeMode?: number; + public get routeMode() { + return this.getNumberAttribute('route_mode'); + } + public set routeMode(value: number) { + this._routeMode = value; + } + public resetRouteMode() { + this._routeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeModeInput() { + return this._routeMode; + } + + // seconds_level_monitor_fun_status - computed: true, optional: false, required: false + public get secondsLevelMonitorFunStatus() { + return this.getStringAttribute('seconds_level_monitor_fun_status'); + } + + // ssl_option - computed: true, optional: false, required: false + public get sslOption() { + return this.getBooleanAttribute('ssl_option'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // support_balance_route_mode - computed: true, optional: false, required: false + public get supportBalanceRouteMode() { + return this.getBooleanAttribute('support_balance_route_mode'); + } + + // support_proxy_ssl - computed: true, optional: false, required: false + public get supportProxySsl() { + return this.getBooleanAttribute('support_proxy_ssl'); + } + + // support_switch_connection_pool_type - computed: true, optional: false, required: false + public get supportSwitchConnectionPoolType() { + return this.getBooleanAttribute('support_switch_connection_pool_type'); + } + + // support_transaction_split - computed: true, optional: false, required: false + public get supportTransactionSplit() { + return this.getBooleanAttribute('support_transaction_split'); + } + + // transaction_split - computed: true, optional: false, required: false + public get transactionSplit() { + return this.getStringAttribute('transaction_split'); + } + + // vcpus - computed: true, optional: false, required: false + public get vcpus() { + return this.getStringAttribute('vcpus'); + } + + // master_node_weight - computed: false, optional: true, required: false + private _masterNodeWeight = new RdsMysqlProxyMasterNodeWeightOutputReference(this, "master_node_weight"); + public get masterNodeWeight() { + return this._masterNodeWeight; + } + public putMasterNodeWeight(value: RdsMysqlProxyMasterNodeWeight) { + this._masterNodeWeight.internalValue = value; + } + public resetMasterNodeWeight() { + this._masterNodeWeight.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterNodeWeightInput() { + return this._masterNodeWeight.internalValue; + } + + // readonly_nodes_weight - computed: false, optional: true, required: false + private _readonlyNodesWeight = new RdsMysqlProxyReadonlyNodesWeightList(this, "readonly_nodes_weight", true); + public get readonlyNodesWeight() { + return this._readonlyNodesWeight; + } + public putReadonlyNodesWeight(value: RdsMysqlProxyReadonlyNodesWeight[] | cdktf.IResolvable) { + this._readonlyNodesWeight.internalValue = value; + } + public resetReadonlyNodesWeight() { + this._readonlyNodesWeight.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyNodesWeightInput() { + return this._readonlyNodesWeight.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsMysqlProxyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsMysqlProxyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + node_num: cdktf.numberToTerraform(this._nodeNum), + proxy_mode: cdktf.stringToTerraform(this._proxyMode), + proxy_name: cdktf.stringToTerraform(this._proxyName), + region: cdktf.stringToTerraform(this._region), + route_mode: cdktf.numberToTerraform(this._routeMode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + master_node_weight: rdsMysqlProxyMasterNodeWeightToTerraform(this._masterNodeWeight.internalValue), + readonly_nodes_weight: cdktf.listMapper(rdsMysqlProxyReadonlyNodesWeightToTerraform, true)(this._readonlyNodesWeight.internalValue), + timeouts: rdsMysqlProxyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_num: { + value: cdktf.numberToHclTerraform(this._nodeNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + proxy_mode: { + value: cdktf.stringToHclTerraform(this._proxyMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + proxy_name: { + value: cdktf.stringToHclTerraform(this._proxyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_mode: { + value: cdktf.numberToHclTerraform(this._routeMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + master_node_weight: { + value: rdsMysqlProxyMasterNodeWeightToHclTerraform(this._masterNodeWeight.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsMysqlProxyMasterNodeWeightList", + }, + readonly_nodes_weight: { + value: cdktf.listMapperHcl(rdsMysqlProxyReadonlyNodesWeightToHclTerraform, true)(this._readonlyNodesWeight.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsMysqlProxyReadonlyNodesWeightList", + }, + timeouts: { + value: rdsMysqlProxyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsMysqlProxyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-parametergroup-v3/README.md b/src/constructs/providers/huaweicloud/rds-parametergroup-v3/README.md new file mode 100644 index 00000000..b01490f9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-parametergroup-v3/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_parametergroup_v3` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_parametergroup_v3`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3). diff --git a/src/constructs/providers/huaweicloud/rds-parametergroup-v3/index.ts b/src/constructs/providers/huaweicloud/rds-parametergroup-v3/index.ts new file mode 100644 index 00000000..b61128bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-parametergroup-v3/index.ts @@ -0,0 +1,641 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsParametergroupV3Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#description RdsParametergroupV3#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#id RdsParametergroupV3#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#name RdsParametergroupV3#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#region RdsParametergroupV3#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#values RdsParametergroupV3#values} + */ + readonly values?: { [key: string]: string }; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#datastore RdsParametergroupV3#datastore} + */ + readonly datastore: RdsParametergroupV3Datastore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#timeouts RdsParametergroupV3#timeouts} + */ + readonly timeouts?: RdsParametergroupV3Timeouts; +} +export interface RdsParametergroupV3ConfigurationParameters { +} + +export function rdsParametergroupV3ConfigurationParametersToTerraform(struct?: RdsParametergroupV3ConfigurationParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rdsParametergroupV3ConfigurationParametersToHclTerraform(struct?: RdsParametergroupV3ConfigurationParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RdsParametergroupV3ConfigurationParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsParametergroupV3ConfigurationParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsParametergroupV3ConfigurationParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + + // restart_required - computed: true, optional: false, required: false + public get restartRequired() { + return this.getBooleanAttribute('restart_required'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } + + // value_range - computed: true, optional: false, required: false + public get valueRange() { + return this.getStringAttribute('value_range'); + } +} + +export class RdsParametergroupV3ConfigurationParametersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsParametergroupV3ConfigurationParametersOutputReference { + return new RdsParametergroupV3ConfigurationParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsParametergroupV3Datastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#type RdsParametergroupV3#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#version RdsParametergroupV3#version} + */ + readonly version: string; +} + +export function rdsParametergroupV3DatastoreToTerraform(struct?: RdsParametergroupV3DatastoreOutputReference | RdsParametergroupV3Datastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function rdsParametergroupV3DatastoreToHclTerraform(struct?: RdsParametergroupV3DatastoreOutputReference | RdsParametergroupV3Datastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsParametergroupV3DatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsParametergroupV3Datastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsParametergroupV3Datastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._version = value.version; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface RdsParametergroupV3Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#create RdsParametergroupV3#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#delete RdsParametergroupV3#delete} + */ + readonly delete?: string; +} + +export function rdsParametergroupV3TimeoutsToTerraform(struct?: RdsParametergroupV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsParametergroupV3TimeoutsToHclTerraform(struct?: RdsParametergroupV3Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsParametergroupV3TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsParametergroupV3Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsParametergroupV3Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3 huaweicloud_rds_parametergroup_v3} +*/ +export class RdsParametergroupV3 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_parametergroup_v3"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsParametergroupV3 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsParametergroupV3 to import + * @param importFromId The id of the existing RdsParametergroupV3 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsParametergroupV3 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_parametergroup_v3", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup_v3 huaweicloud_rds_parametergroup_v3} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsParametergroupV3Config + */ + public constructor(scope: Construct, id: string, config: RdsParametergroupV3Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_parametergroup_v3', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._values = config.values; + this._datastore.internalValue = config.datastore; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_parameters - computed: true, optional: false, required: false + private _configurationParameters = new RdsParametergroupV3ConfigurationParametersList(this, "configuration_parameters", false); + public get configurationParameters() { + return this._configurationParameters; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // values - computed: false, optional: true, required: false + private _values?: { [key: string]: string }; + public get values() { + return this.getStringMapAttribute('values'); + } + public set values(value: { [key: string]: string }) { + this._values = value; + } + public resetValues() { + this._values = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } + + // datastore - computed: false, optional: false, required: true + private _datastore = new RdsParametergroupV3DatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: RdsParametergroupV3Datastore) { + this._datastore.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsParametergroupV3TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsParametergroupV3Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + values: cdktf.hashMapper(cdktf.stringToTerraform)(this._values), + datastore: rdsParametergroupV3DatastoreToTerraform(this._datastore.internalValue), + timeouts: rdsParametergroupV3TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._values), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + datastore: { + value: rdsParametergroupV3DatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsParametergroupV3DatastoreList", + }, + timeouts: { + value: rdsParametergroupV3TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsParametergroupV3Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-parametergroup/README.md b/src/constructs/providers/huaweicloud/rds-parametergroup/README.md new file mode 100644 index 00000000..de2021a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-parametergroup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_parametergroup` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_parametergroup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup). diff --git a/src/constructs/providers/huaweicloud/rds-parametergroup/index.ts b/src/constructs/providers/huaweicloud/rds-parametergroup/index.ts new file mode 100644 index 00000000..3e42e198 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-parametergroup/index.ts @@ -0,0 +1,641 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsParametergroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#description RdsParametergroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#id RdsParametergroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#name RdsParametergroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#region RdsParametergroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#values RdsParametergroup#values} + */ + readonly values?: { [key: string]: string }; + /** + * datastore block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#datastore RdsParametergroup#datastore} + */ + readonly datastore: RdsParametergroupDatastore; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#timeouts RdsParametergroup#timeouts} + */ + readonly timeouts?: RdsParametergroupTimeouts; +} +export interface RdsParametergroupConfigurationParameters { +} + +export function rdsParametergroupConfigurationParametersToTerraform(struct?: RdsParametergroupConfigurationParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rdsParametergroupConfigurationParametersToHclTerraform(struct?: RdsParametergroupConfigurationParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RdsParametergroupConfigurationParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsParametergroupConfigurationParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsParametergroupConfigurationParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // readonly - computed: true, optional: false, required: false + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + + // restart_required - computed: true, optional: false, required: false + public get restartRequired() { + return this.getBooleanAttribute('restart_required'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // value - computed: true, optional: false, required: false + public get value() { + return this.getStringAttribute('value'); + } + + // value_range - computed: true, optional: false, required: false + public get valueRange() { + return this.getStringAttribute('value_range'); + } +} + +export class RdsParametergroupConfigurationParametersList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsParametergroupConfigurationParametersOutputReference { + return new RdsParametergroupConfigurationParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsParametergroupDatastore { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#type RdsParametergroup#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#version RdsParametergroup#version} + */ + readonly version: string; +} + +export function rdsParametergroupDatastoreToTerraform(struct?: RdsParametergroupDatastoreOutputReference | RdsParametergroupDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function rdsParametergroupDatastoreToHclTerraform(struct?: RdsParametergroupDatastoreOutputReference | RdsParametergroupDatastore): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsParametergroupDatastoreOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsParametergroupDatastore | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsParametergroupDatastore | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._version = value.version; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface RdsParametergroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#create RdsParametergroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#delete RdsParametergroup#delete} + */ + readonly delete?: string; +} + +export function rdsParametergroupTimeoutsToTerraform(struct?: RdsParametergroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsParametergroupTimeoutsToHclTerraform(struct?: RdsParametergroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsParametergroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsParametergroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsParametergroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup huaweicloud_rds_parametergroup} +*/ +export class RdsParametergroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_parametergroup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsParametergroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsParametergroup to import + * @param importFromId The id of the existing RdsParametergroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsParametergroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_parametergroup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_parametergroup huaweicloud_rds_parametergroup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsParametergroupConfig + */ + public constructor(scope: Construct, id: string, config: RdsParametergroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_parametergroup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._values = config.values; + this._datastore.internalValue = config.datastore; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // configuration_parameters - computed: true, optional: false, required: false + private _configurationParameters = new RdsParametergroupConfigurationParametersList(this, "configuration_parameters", false); + public get configurationParameters() { + return this._configurationParameters; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // values - computed: false, optional: true, required: false + private _values?: { [key: string]: string }; + public get values() { + return this.getStringMapAttribute('values'); + } + public set values(value: { [key: string]: string }) { + this._values = value; + } + public resetValues() { + this._values = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } + + // datastore - computed: false, optional: false, required: true + private _datastore = new RdsParametergroupDatastoreOutputReference(this, "datastore"); + public get datastore() { + return this._datastore; + } + public putDatastore(value: RdsParametergroupDatastore) { + this._datastore.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get datastoreInput() { + return this._datastore.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsParametergroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsParametergroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + values: cdktf.hashMapper(cdktf.stringToTerraform)(this._values), + datastore: rdsParametergroupDatastoreToTerraform(this._datastore.internalValue), + timeouts: rdsParametergroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._values), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + datastore: { + value: rdsParametergroupDatastoreToHclTerraform(this._datastore.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsParametergroupDatastoreList", + }, + timeouts: { + value: rdsParametergroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsParametergroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-account-privileges/README.md b/src/constructs/providers/huaweicloud/rds-pg-account-privileges/README.md new file mode 100644 index 00000000..c6d19c3f --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-account-privileges/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_account_privileges` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_account_privileges`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges). diff --git a/src/constructs/providers/huaweicloud/rds-pg-account-privileges/index.ts b/src/constructs/providers/huaweicloud/rds-pg-account-privileges/index.ts new file mode 100644 index 00000000..e515484a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-account-privileges/index.ts @@ -0,0 +1,448 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgAccountPrivilegesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#id RdsPgAccountPrivileges#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#instance_id RdsPgAccountPrivileges#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#region RdsPgAccountPrivileges#region} + */ + readonly region?: string; + /** + * Specifies the list of role privileges. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#role_privileges RdsPgAccountPrivileges#role_privileges} + */ + readonly rolePrivileges?: string[]; + /** + * Specifies the list of system role privileges. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#system_role_privileges RdsPgAccountPrivileges#system_role_privileges} + */ + readonly systemRolePrivileges?: string[]; + /** + * Specifies the username of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#user_name RdsPgAccountPrivileges#user_name} + */ + readonly userName: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#timeouts RdsPgAccountPrivileges#timeouts} + */ + readonly timeouts?: RdsPgAccountPrivilegesTimeouts; +} +export interface RdsPgAccountPrivilegesTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#create RdsPgAccountPrivileges#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#delete RdsPgAccountPrivileges#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#update RdsPgAccountPrivileges#update} + */ + readonly update?: string; +} + +export function rdsPgAccountPrivilegesTimeoutsToTerraform(struct?: RdsPgAccountPrivilegesTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsPgAccountPrivilegesTimeoutsToHclTerraform(struct?: RdsPgAccountPrivilegesTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgAccountPrivilegesTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgAccountPrivilegesTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgAccountPrivilegesTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges huaweicloud_rds_pg_account_privileges} +*/ +export class RdsPgAccountPrivileges extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_account_privileges"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgAccountPrivileges resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgAccountPrivileges to import + * @param importFromId The id of the existing RdsPgAccountPrivileges that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgAccountPrivileges to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_account_privileges", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_privileges huaweicloud_rds_pg_account_privileges} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgAccountPrivilegesConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgAccountPrivilegesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_account_privileges', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._rolePrivileges = config.rolePrivileges; + this._systemRolePrivileges = config.systemRolePrivileges; + this._userName = config.userName; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // role_privileges - computed: false, optional: true, required: false + private _rolePrivileges?: string[]; + public get rolePrivileges() { + return cdktf.Fn.tolist(this.getListAttribute('role_privileges')); + } + public set rolePrivileges(value: string[]) { + this._rolePrivileges = value; + } + public resetRolePrivileges() { + this._rolePrivileges = undefined; + } + // Temporarily expose input value. Use with caution. + public get rolePrivilegesInput() { + return this._rolePrivileges; + } + + // system_role_privileges - computed: false, optional: true, required: false + private _systemRolePrivileges?: string[]; + public get systemRolePrivileges() { + return cdktf.Fn.tolist(this.getListAttribute('system_role_privileges')); + } + public set systemRolePrivileges(value: string[]) { + this._systemRolePrivileges = value; + } + public resetSystemRolePrivileges() { + this._systemRolePrivileges = undefined; + } + // Temporarily expose input value. Use with caution. + public get systemRolePrivilegesInput() { + return this._systemRolePrivileges; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgAccountPrivilegesTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgAccountPrivilegesTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + role_privileges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._rolePrivileges), + system_role_privileges: cdktf.listMapper(cdktf.stringToTerraform, false)(this._systemRolePrivileges), + user_name: cdktf.stringToTerraform(this._userName), + timeouts: rdsPgAccountPrivilegesTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + role_privileges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._rolePrivileges), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + system_role_privileges: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._systemRolePrivileges), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgAccountPrivilegesTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgAccountPrivilegesTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-account-roles/README.md b/src/constructs/providers/huaweicloud/rds-pg-account-roles/README.md new file mode 100644 index 00000000..a7a8abaa --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-account-roles/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_account_roles` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_account_roles`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles). diff --git a/src/constructs/providers/huaweicloud/rds-pg-account-roles/index.ts b/src/constructs/providers/huaweicloud/rds-pg-account-roles/index.ts new file mode 100644 index 00000000..a5659549 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-account-roles/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgAccountRolesConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#id RdsPgAccountRoles#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#instance_id RdsPgAccountRoles#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#region RdsPgAccountRoles#region} + */ + readonly region?: string; + /** + * Specifies the list of roles. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#roles RdsPgAccountRoles#roles} + */ + readonly roles: string[]; + /** + * Specifies the username of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#user RdsPgAccountRoles#user} + */ + readonly user: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#timeouts RdsPgAccountRoles#timeouts} + */ + readonly timeouts?: RdsPgAccountRolesTimeouts; +} +export interface RdsPgAccountRolesTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#create RdsPgAccountRoles#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#delete RdsPgAccountRoles#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#update RdsPgAccountRoles#update} + */ + readonly update?: string; +} + +export function rdsPgAccountRolesTimeoutsToTerraform(struct?: RdsPgAccountRolesTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsPgAccountRolesTimeoutsToHclTerraform(struct?: RdsPgAccountRolesTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgAccountRolesTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgAccountRolesTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgAccountRolesTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles huaweicloud_rds_pg_account_roles} +*/ +export class RdsPgAccountRoles extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_account_roles"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgAccountRoles resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgAccountRoles to import + * @param importFromId The id of the existing RdsPgAccountRoles that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgAccountRoles to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_account_roles", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account_roles huaweicloud_rds_pg_account_roles} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgAccountRolesConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgAccountRolesConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_account_roles', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._roles = config.roles; + this._user = config.user; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // roles - computed: false, optional: false, required: true + private _roles?: string[]; + public get roles() { + return cdktf.Fn.tolist(this.getListAttribute('roles')); + } + public set roles(value: string[]) { + this._roles = value; + } + // Temporarily expose input value. Use with caution. + public get rolesInput() { + return this._roles; + } + + // user - computed: false, optional: false, required: true + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgAccountRolesTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgAccountRolesTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + roles: cdktf.listMapper(cdktf.stringToTerraform, false)(this._roles), + user: cdktf.stringToTerraform(this._user), + timeouts: rdsPgAccountRolesTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + roles: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._roles), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + user: { + value: cdktf.stringToHclTerraform(this._user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgAccountRolesTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgAccountRolesTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-account/README.md b/src/constructs/providers/huaweicloud/rds-pg-account/README.md new file mode 100644 index 00000000..654d6b62 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account). diff --git a/src/constructs/providers/huaweicloud/rds-pg-account/index.ts b/src/constructs/providers/huaweicloud/rds-pg-account/index.ts new file mode 100644 index 00000000..78315ae9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-account/index.ts @@ -0,0 +1,591 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the remarks of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#description RdsPgAccount#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#id RdsPgAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#instance_id RdsPgAccount#instance_id} + */ + readonly instanceId: string; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#memberof RdsPgAccount#memberof} + */ + readonly memberof?: string[]; + /** + * Specifies the username of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#name RdsPgAccount#name} + */ + readonly name: string; + /** + * Specifies the password of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#password RdsPgAccount#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#region RdsPgAccount#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#timeouts RdsPgAccount#timeouts} + */ + readonly timeouts?: RdsPgAccountTimeouts; +} +export interface RdsPgAccountAttributes { +} + +export function rdsPgAccountAttributesToTerraform(struct?: RdsPgAccountAttributes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rdsPgAccountAttributesToHclTerraform(struct?: RdsPgAccountAttributes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RdsPgAccountAttributesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsPgAccountAttributes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgAccountAttributes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // rol_bypass_rls - computed: true, optional: false, required: false + public get rolBypassRls() { + return this.getBooleanAttribute('rol_bypass_rls'); + } + + // rol_can_login - computed: true, optional: false, required: false + public get rolCanLogin() { + return this.getBooleanAttribute('rol_can_login'); + } + + // rol_conn_limit - computed: true, optional: false, required: false + public get rolConnLimit() { + return this.getNumberAttribute('rol_conn_limit'); + } + + // rol_create_db - computed: true, optional: false, required: false + public get rolCreateDb() { + return this.getBooleanAttribute('rol_create_db'); + } + + // rol_create_role - computed: true, optional: false, required: false + public get rolCreateRole() { + return this.getBooleanAttribute('rol_create_role'); + } + + // rol_inherit - computed: true, optional: false, required: false + public get rolInherit() { + return this.getBooleanAttribute('rol_inherit'); + } + + // rol_replication - computed: true, optional: false, required: false + public get rolReplication() { + return this.getBooleanAttribute('rol_replication'); + } + + // rol_super - computed: true, optional: false, required: false + public get rolSuper() { + return this.getBooleanAttribute('rol_super'); + } +} + +export class RdsPgAccountAttributesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsPgAccountAttributesOutputReference { + return new RdsPgAccountAttributesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsPgAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#create RdsPgAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#delete RdsPgAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#update RdsPgAccount#update} + */ + readonly update?: string; +} + +export function rdsPgAccountTimeoutsToTerraform(struct?: RdsPgAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsPgAccountTimeoutsToHclTerraform(struct?: RdsPgAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account huaweicloud_rds_pg_account} +*/ +export class RdsPgAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgAccount to import + * @param importFromId The id of the existing RdsPgAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_account huaweicloud_rds_pg_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgAccountConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._memberof = config.memberof; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attributes - computed: true, optional: false, required: false + private _attributes = new RdsPgAccountAttributesList(this, "attributes", false); + public get attributes() { + return this._attributes; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // memberof - computed: false, optional: true, required: false + private _memberof?: string[]; + public get memberof() { + return cdktf.Fn.tolist(this.getListAttribute('memberof')); + } + public set memberof(value: string[]) { + this._memberof = value; + } + public resetMemberof() { + this._memberof = undefined; + } + // Temporarily expose input value. Use with caution. + public get memberofInput() { + return this._memberof; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + memberof: cdktf.listMapper(cdktf.stringToTerraform, false)(this._memberof), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsPgAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + memberof: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._memberof), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-database-privilege/README.md b/src/constructs/providers/huaweicloud/rds-pg-database-privilege/README.md new file mode 100644 index 00000000..6a9d8b53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-database-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_database_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_database_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege). diff --git a/src/constructs/providers/huaweicloud/rds-pg-database-privilege/index.ts b/src/constructs/providers/huaweicloud/rds-pg-database-privilege/index.ts new file mode 100644 index 00000000..d957eed8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-database-privilege/index.ts @@ -0,0 +1,561 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgDatabasePrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#db_name RdsPgDatabasePrivilege#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#id RdsPgDatabasePrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#instance_id RdsPgDatabasePrivilege#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#region RdsPgDatabasePrivilege#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#timeouts RdsPgDatabasePrivilege#timeouts} + */ + readonly timeouts?: RdsPgDatabasePrivilegeTimeouts; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#users RdsPgDatabasePrivilege#users} + */ + readonly users: RdsPgDatabasePrivilegeUsers[] | cdktf.IResolvable; +} +export interface RdsPgDatabasePrivilegeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#create RdsPgDatabasePrivilege#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#update RdsPgDatabasePrivilege#update} + */ + readonly update?: string; +} + +export function rdsPgDatabasePrivilegeTimeoutsToTerraform(struct?: RdsPgDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsPgDatabasePrivilegeTimeoutsToHclTerraform(struct?: RdsPgDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgDatabasePrivilegeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsPgDatabasePrivilegeUsers { + /** + * Specifies the username of the database account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#name RdsPgDatabasePrivilege#name} + */ + readonly name: string; + /** + * Specifies the read-only permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#readonly RdsPgDatabasePrivilege#readonly} + */ + readonly readonly: boolean | cdktf.IResolvable; + /** + * Specifies the name of the schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#schema_name RdsPgDatabasePrivilege#schema_name} + */ + readonly schemaName: string; +} + +export function rdsPgDatabasePrivilegeUsersToTerraform(struct?: RdsPgDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + readonly: cdktf.booleanToTerraform(struct!.readonly), + schema_name: cdktf.stringToTerraform(struct!.schemaName), + } +} + + +export function rdsPgDatabasePrivilegeUsersToHclTerraform(struct?: RdsPgDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(struct!.readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + schema_name: { + value: cdktf.stringToHclTerraform(struct!.schemaName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgDatabasePrivilegeUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsPgDatabasePrivilegeUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._readonly !== undefined) { + hasAnyValues = true; + internalValueResult.readonly = this._readonly; + } + if (this._schemaName !== undefined) { + hasAnyValues = true; + internalValueResult.schemaName = this._schemaName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgDatabasePrivilegeUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._readonly = undefined; + this._schemaName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._readonly = value.readonly; + this._schemaName = value.schemaName; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // readonly - computed: false, optional: false, required: true + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } + + // schema_name - computed: false, optional: false, required: true + private _schemaName?: string; + public get schemaName() { + return this.getStringAttribute('schema_name'); + } + public set schemaName(value: string) { + this._schemaName = value; + } + // Temporarily expose input value. Use with caution. + public get schemaNameInput() { + return this._schemaName; + } +} + +export class RdsPgDatabasePrivilegeUsersList extends cdktf.ComplexList { + public internalValue? : RdsPgDatabasePrivilegeUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsPgDatabasePrivilegeUsersOutputReference { + return new RdsPgDatabasePrivilegeUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege huaweicloud_rds_pg_database_privilege} +*/ +export class RdsPgDatabasePrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_database_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgDatabasePrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgDatabasePrivilege to import + * @param importFromId The id of the existing RdsPgDatabasePrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgDatabasePrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_database_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database_privilege huaweicloud_rds_pg_database_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgDatabasePrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgDatabasePrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_database_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgDatabasePrivilegeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgDatabasePrivilegeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // users - computed: false, optional: false, required: true + private _users = new RdsPgDatabasePrivilegeUsersList(this, "users", true); + public get users() { + return this._users; + } + public putUsers(value: RdsPgDatabasePrivilegeUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsPgDatabasePrivilegeTimeoutsToTerraform(this._timeouts.internalValue), + users: cdktf.listMapper(rdsPgDatabasePrivilegeUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgDatabasePrivilegeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgDatabasePrivilegeTimeouts", + }, + users: { + value: cdktf.listMapperHcl(rdsPgDatabasePrivilegeUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsPgDatabasePrivilegeUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-database/README.md b/src/constructs/providers/huaweicloud/rds-pg-database/README.md new file mode 100644 index 00000000..401858a6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database). diff --git a/src/constructs/providers/huaweicloud/rds-pg-database/index.ts b/src/constructs/providers/huaweicloud/rds-pg-database/index.ts new file mode 100644 index 00000000..e20e6221 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-database/index.ts @@ -0,0 +1,603 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database character set. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#character_set RdsPgDatabase#character_set} + */ + readonly characterSet?: string; + /** + * Specifies the database description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#description RdsPgDatabase#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#id RdsPgDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#instance_id RdsPgDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Specifies whether to revoke the PUBLIC CREATE permission of the public schema. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#is_revoke_public_privilege RdsPgDatabase#is_revoke_public_privilege} + */ + readonly isRevokePublicPrivilege?: boolean | cdktf.IResolvable; + /** + * Specifies the database collocation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#lc_collate RdsPgDatabase#lc_collate} + */ + readonly lcCollate?: string; + /** + * Specifies the database classification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#lc_ctype RdsPgDatabase#lc_ctype} + */ + readonly lcCtype?: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#name RdsPgDatabase#name} + */ + readonly name: string; + /** + * Specifies the database user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#owner RdsPgDatabase#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#region RdsPgDatabase#region} + */ + readonly region?: string; + /** + * Specifies the name of the database template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#template RdsPgDatabase#template} + */ + readonly template?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#timeouts RdsPgDatabase#timeouts} + */ + readonly timeouts?: RdsPgDatabaseTimeouts; +} +export interface RdsPgDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#create RdsPgDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#delete RdsPgDatabase#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#update RdsPgDatabase#update} + */ + readonly update?: string; +} + +export function rdsPgDatabaseTimeoutsToTerraform(struct?: RdsPgDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsPgDatabaseTimeoutsToHclTerraform(struct?: RdsPgDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database huaweicloud_rds_pg_database} +*/ +export class RdsPgDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgDatabase to import + * @param importFromId The id of the existing RdsPgDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_database huaweicloud_rds_pg_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._characterSet = config.characterSet; + this._description = config.description; + this._id = config.id; + this._instanceId = config.instanceId; + this._isRevokePublicPrivilege = config.isRevokePublicPrivilege; + this._lcCollate = config.lcCollate; + this._lcCtype = config.lcCtype; + this._name = config.name; + this._owner = config.owner; + this._region = config.region; + this._template = config.template; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: true, optional: true, required: false + private _characterSet?: string; + public get characterSet() { + return this.getStringAttribute('character_set'); + } + public set characterSet(value: string) { + this._characterSet = value; + } + public resetCharacterSet() { + this._characterSet = undefined; + } + // Temporarily expose input value. Use with caution. + public get characterSetInput() { + return this._characterSet; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_revoke_public_privilege - computed: true, optional: true, required: false + private _isRevokePublicPrivilege?: boolean | cdktf.IResolvable; + public get isRevokePublicPrivilege() { + return this.getBooleanAttribute('is_revoke_public_privilege'); + } + public set isRevokePublicPrivilege(value: boolean | cdktf.IResolvable) { + this._isRevokePublicPrivilege = value; + } + public resetIsRevokePublicPrivilege() { + this._isRevokePublicPrivilege = undefined; + } + // Temporarily expose input value. Use with caution. + public get isRevokePublicPrivilegeInput() { + return this._isRevokePublicPrivilege; + } + + // lc_collate - computed: true, optional: true, required: false + private _lcCollate?: string; + public get lcCollate() { + return this.getStringAttribute('lc_collate'); + } + public set lcCollate(value: string) { + this._lcCollate = value; + } + public resetLcCollate() { + this._lcCollate = undefined; + } + // Temporarily expose input value. Use with caution. + public get lcCollateInput() { + return this._lcCollate; + } + + // lc_ctype - computed: true, optional: true, required: false + private _lcCtype?: string; + public get lcCtype() { + return this.getStringAttribute('lc_ctype'); + } + public set lcCtype(value: string) { + this._lcCtype = value; + } + public resetLcCtype() { + this._lcCtype = undefined; + } + // Temporarily expose input value. Use with caution. + public get lcCtypeInput() { + return this._lcCtype; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // template - computed: true, optional: true, required: false + private _template?: string; + public get template() { + return this.getStringAttribute('template'); + } + public set template(value: string) { + this._template = value; + } + public resetTemplate() { + this._template = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateInput() { + return this._template; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + character_set: cdktf.stringToTerraform(this._characterSet), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + is_revoke_public_privilege: cdktf.booleanToTerraform(this._isRevokePublicPrivilege), + lc_collate: cdktf.stringToTerraform(this._lcCollate), + lc_ctype: cdktf.stringToTerraform(this._lcCtype), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + template: cdktf.stringToTerraform(this._template), + timeouts: rdsPgDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + character_set: { + value: cdktf.stringToHclTerraform(this._characterSet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_revoke_public_privilege: { + value: cdktf.booleanToHclTerraform(this._isRevokePublicPrivilege), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + lc_collate: { + value: cdktf.stringToHclTerraform(this._lcCollate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lc_ctype: { + value: cdktf.stringToHclTerraform(this._lcCtype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template: { + value: cdktf.stringToHclTerraform(this._template), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-hba/README.md b/src/constructs/providers/huaweicloud/rds-pg-hba/README.md new file mode 100644 index 00000000..5f6f3704 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-hba/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_hba` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_hba`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba). diff --git a/src/constructs/providers/huaweicloud/rds-pg-hba/index.ts b/src/constructs/providers/huaweicloud/rds-pg-hba/index.ts new file mode 100644 index 00000000..83fd8130 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-hba/index.ts @@ -0,0 +1,476 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgHbaConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#id RdsPgHba#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#instance_id RdsPgHba#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#region RdsPgHba#region} + */ + readonly region?: string; + /** + * host_based_authentications block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#host_based_authentications RdsPgHba#host_based_authentications} + */ + readonly hostBasedAuthentications: RdsPgHbaHostBasedAuthentications[] | cdktf.IResolvable; +} +export interface RdsPgHbaHostBasedAuthentications { + /** + * Specifies the client IP address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#address RdsPgHba#address} + */ + readonly address: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#database RdsPgHba#database} + */ + readonly database: string; + /** + * Specifies the subnet mask. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#mask RdsPgHba#mask} + */ + readonly mask?: string; + /** + * Specifies the authentication mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#method RdsPgHba#method} + */ + readonly method: string; + /** + * Specifies the connection type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#type RdsPgHba#type} + */ + readonly type: string; + /** + * Specifies the Name of a user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#user RdsPgHba#user} + */ + readonly user: string; +} + +export function rdsPgHbaHostBasedAuthenticationsToTerraform(struct?: RdsPgHbaHostBasedAuthentications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + database: cdktf.stringToTerraform(struct!.database), + mask: cdktf.stringToTerraform(struct!.mask), + method: cdktf.stringToTerraform(struct!.method), + type: cdktf.stringToTerraform(struct!.type), + user: cdktf.stringToTerraform(struct!.user), + } +} + + +export function rdsPgHbaHostBasedAuthenticationsToHclTerraform(struct?: RdsPgHbaHostBasedAuthentications | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database: { + value: cdktf.stringToHclTerraform(struct!.database), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mask: { + value: cdktf.stringToHclTerraform(struct!.mask), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + method: { + value: cdktf.stringToHclTerraform(struct!.method), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user: { + value: cdktf.stringToHclTerraform(struct!.user), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgHbaHostBasedAuthenticationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsPgHbaHostBasedAuthentications | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._database !== undefined) { + hasAnyValues = true; + internalValueResult.database = this._database; + } + if (this._mask !== undefined) { + hasAnyValues = true; + internalValueResult.mask = this._mask; + } + if (this._method !== undefined) { + hasAnyValues = true; + internalValueResult.method = this._method; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._user !== undefined) { + hasAnyValues = true; + internalValueResult.user = this._user; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgHbaHostBasedAuthentications | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._database = undefined; + this._mask = undefined; + this._method = undefined; + this._type = undefined; + this._user = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._database = value.database; + this._mask = value.mask; + this._method = value.method; + this._type = value.type; + this._user = value.user; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // database - computed: false, optional: false, required: true + private _database?: string; + public get database() { + return this.getStringAttribute('database'); + } + public set database(value: string) { + this._database = value; + } + // Temporarily expose input value. Use with caution. + public get databaseInput() { + return this._database; + } + + // mask - computed: true, optional: true, required: false + private _mask?: string; + public get mask() { + return this.getStringAttribute('mask'); + } + public set mask(value: string) { + this._mask = value; + } + public resetMask() { + this._mask = undefined; + } + // Temporarily expose input value. Use with caution. + public get maskInput() { + return this._mask; + } + + // method - computed: false, optional: false, required: true + private _method?: string; + public get method() { + return this.getStringAttribute('method'); + } + public set method(value: string) { + this._method = value; + } + // Temporarily expose input value. Use with caution. + public get methodInput() { + return this._method; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user - computed: false, optional: false, required: true + private _user?: string; + public get user() { + return this.getStringAttribute('user'); + } + public set user(value: string) { + this._user = value; + } + // Temporarily expose input value. Use with caution. + public get userInput() { + return this._user; + } +} + +export class RdsPgHbaHostBasedAuthenticationsList extends cdktf.ComplexList { + public internalValue? : RdsPgHbaHostBasedAuthentications[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsPgHbaHostBasedAuthenticationsOutputReference { + return new RdsPgHbaHostBasedAuthenticationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba huaweicloud_rds_pg_hba} +*/ +export class RdsPgHba extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_hba"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgHba resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgHba to import + * @param importFromId The id of the existing RdsPgHba that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgHba to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_hba", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_hba huaweicloud_rds_pg_hba} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgHbaConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgHbaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_hba', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._hostBasedAuthentications.internalValue = config.hostBasedAuthentications; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // host_based_authentications - computed: false, optional: false, required: true + private _hostBasedAuthentications = new RdsPgHbaHostBasedAuthenticationsList(this, "host_based_authentications", false); + public get hostBasedAuthentications() { + return this._hostBasedAuthentications; + } + public putHostBasedAuthentications(value: RdsPgHbaHostBasedAuthentications[] | cdktf.IResolvable) { + this._hostBasedAuthentications.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get hostBasedAuthenticationsInput() { + return this._hostBasedAuthentications.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + host_based_authentications: cdktf.listMapper(rdsPgHbaHostBasedAuthenticationsToTerraform, true)(this._hostBasedAuthentications.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_based_authentications: { + value: cdktf.listMapperHcl(rdsPgHbaHostBasedAuthenticationsToHclTerraform, true)(this._hostBasedAuthentications.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsPgHbaHostBasedAuthenticationsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/README.md b/src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/README.md new file mode 100644 index 00000000..4c65a9b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_plugin_parameter` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_plugin_parameter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter). diff --git a/src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/index.ts b/src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/index.ts new file mode 100644 index 00000000..0c8afc2f --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-plugin-parameter/index.ts @@ -0,0 +1,392 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgPluginParameterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#id RdsPgPluginParameter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#instance_id RdsPgPluginParameter#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the name of the plugin parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#name RdsPgPluginParameter#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#region RdsPgPluginParameter#region} + */ + readonly region?: string; + /** + * Specifies the list of plugin parameter values. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#values RdsPgPluginParameter#values} + */ + readonly values: string[]; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#timeouts RdsPgPluginParameter#timeouts} + */ + readonly timeouts?: RdsPgPluginParameterTimeouts; +} +export interface RdsPgPluginParameterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#create RdsPgPluginParameter#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#delete RdsPgPluginParameter#delete} + */ + readonly delete?: string; +} + +export function rdsPgPluginParameterTimeoutsToTerraform(struct?: RdsPgPluginParameterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsPgPluginParameterTimeoutsToHclTerraform(struct?: RdsPgPluginParameterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgPluginParameterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgPluginParameterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgPluginParameterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter huaweicloud_rds_pg_plugin_parameter} +*/ +export class RdsPgPluginParameter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_plugin_parameter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgPluginParameter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgPluginParameter to import + * @param importFromId The id of the existing RdsPgPluginParameter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgPluginParameter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_plugin_parameter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_parameter huaweicloud_rds_pg_plugin_parameter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgPluginParameterConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgPluginParameterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_plugin_parameter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._values = config.values; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // default_values - computed: true, optional: false, required: false + public get defaultValues() { + return this.getListAttribute('default_values'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restart_required - computed: true, optional: false, required: false + public get restartRequired() { + return this.getBooleanAttribute('restart_required'); + } + + // values - computed: false, optional: false, required: true + private _values?: string[]; + public get values() { + return cdktf.Fn.tolist(this.getListAttribute('values')); + } + public set values(value: string[]) { + this._values = value; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgPluginParameterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgPluginParameterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(this._values), + timeouts: rdsPgPluginParameterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._values), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + timeouts: { + value: rdsPgPluginParameterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgPluginParameterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-plugin-update/README.md b/src/constructs/providers/huaweicloud/rds-pg-plugin-update/README.md new file mode 100644 index 00000000..10202f17 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-plugin-update/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_plugin_update` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_plugin_update`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update). diff --git a/src/constructs/providers/huaweicloud/rds-pg-plugin-update/index.ts b/src/constructs/providers/huaweicloud/rds-pg-plugin-update/index.ts new file mode 100644 index 00000000..9176342b --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-plugin-update/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgPluginUpdateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update#database_name RdsPgPluginUpdate#database_name} + */ + readonly databaseName: string; + /** + * Specifies the extension name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update#extension_name RdsPgPluginUpdate#extension_name} + */ + readonly extensionName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update#id RdsPgPluginUpdate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update#instance_id RdsPgPluginUpdate#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update#region RdsPgPluginUpdate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update huaweicloud_rds_pg_plugin_update} +*/ +export class RdsPgPluginUpdate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_plugin_update"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgPluginUpdate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgPluginUpdate to import + * @param importFromId The id of the existing RdsPgPluginUpdate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgPluginUpdate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_plugin_update", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin_update huaweicloud_rds_pg_plugin_update} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgPluginUpdateConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgPluginUpdateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_plugin_update', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseName = config.databaseName; + this._extensionName = config.extensionName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_name - computed: false, optional: false, required: true + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // extension_name - computed: false, optional: false, required: true + private _extensionName?: string; + public get extensionName() { + return this.getStringAttribute('extension_name'); + } + public set extensionName(value: string) { + this._extensionName = value; + } + // Temporarily expose input value. Use with caution. + public get extensionNameInput() { + return this._extensionName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name: cdktf.stringToTerraform(this._databaseName), + extension_name: cdktf.stringToTerraform(this._extensionName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extension_name: { + value: cdktf.stringToHclTerraform(this._extensionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-plugin/README.md b/src/constructs/providers/huaweicloud/rds-pg-plugin/README.md new file mode 100644 index 00000000..3c9f7ba4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-plugin/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_plugin` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_plugin`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin). diff --git a/src/constructs/providers/huaweicloud/rds-pg-plugin/index.ts b/src/constructs/providers/huaweicloud/rds-pg-plugin/index.ts new file mode 100644 index 00000000..157142df --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-plugin/index.ts @@ -0,0 +1,391 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgPluginConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#database_name RdsPgPlugin#database_name} + */ + readonly databaseName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#id RdsPgPlugin#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#instance_id RdsPgPlugin#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#name RdsPgPlugin#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#region RdsPgPlugin#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#timeouts RdsPgPlugin#timeouts} + */ + readonly timeouts?: RdsPgPluginTimeouts; +} +export interface RdsPgPluginTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#create RdsPgPlugin#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#delete RdsPgPlugin#delete} + */ + readonly delete?: string; +} + +export function rdsPgPluginTimeoutsToTerraform(struct?: RdsPgPluginTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rdsPgPluginTimeoutsToHclTerraform(struct?: RdsPgPluginTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgPluginTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgPluginTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgPluginTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin huaweicloud_rds_pg_plugin} +*/ +export class RdsPgPlugin extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_plugin"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgPlugin resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgPlugin to import + * @param importFromId The id of the existing RdsPgPlugin that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgPlugin to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_plugin", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_plugin huaweicloud_rds_pg_plugin} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgPluginConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgPluginConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_plugin', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._databaseName = config.databaseName; + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // database_name - computed: false, optional: false, required: true + private _databaseName?: string; + public get databaseName() { + return this.getStringAttribute('database_name'); + } + public set databaseName(value: string) { + this._databaseName = value; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // shared_preload_libraries - computed: true, optional: false, required: false + public get sharedPreloadLibraries() { + return this.getStringAttribute('shared_preload_libraries'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgPluginTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgPluginTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + database_name: cdktf.stringToTerraform(this._databaseName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsPgPluginTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + database_name: { + value: cdktf.stringToHclTerraform(this._databaseName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgPluginTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgPluginTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-pg-sql-limit/README.md b/src/constructs/providers/huaweicloud/rds-pg-sql-limit/README.md new file mode 100644 index 00000000..1cd9601d --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-sql-limit/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_pg_sql_limit` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_pg_sql_limit`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit). diff --git a/src/constructs/providers/huaweicloud/rds-pg-sql-limit/index.ts b/src/constructs/providers/huaweicloud/rds-pg-sql-limit/index.ts new file mode 100644 index 00000000..de19fc45 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-pg-sql-limit/index.ts @@ -0,0 +1,572 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPgSqlLimitConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the database. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#db_name RdsPgSqlLimit#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#id RdsPgSqlLimit#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS PostgreSQL instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#instance_id RdsPgSqlLimit#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the number of SQL statements executed simultaneously + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#max_concurrency RdsPgSqlLimit#max_concurrency} + */ + readonly maxConcurrency: number; + /** + * Specifies the max waiting time in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#max_waiting RdsPgSqlLimit#max_waiting} + */ + readonly maxWaiting: number; + /** + * Specifies the query ID + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#query_id RdsPgSqlLimit#query_id} + */ + readonly queryId?: string; + /** + * Specifies the text form of SQL statement. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#query_string RdsPgSqlLimit#query_string} + */ + readonly queryString?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#region RdsPgSqlLimit#region} + */ + readonly region?: string; + /** + * Specifies the query order for names that are not schema qualified. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#search_path RdsPgSqlLimit#search_path} + */ + readonly searchPath?: string; + /** + * Specifies the SQL limit switch. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#switch RdsPgSqlLimit#switch} + */ + readonly switch?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#timeouts RdsPgSqlLimit#timeouts} + */ + readonly timeouts?: RdsPgSqlLimitTimeouts; +} +export interface RdsPgSqlLimitTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#create RdsPgSqlLimit#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#delete RdsPgSqlLimit#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#update RdsPgSqlLimit#update} + */ + readonly update?: string; +} + +export function rdsPgSqlLimitTimeoutsToTerraform(struct?: RdsPgSqlLimitTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsPgSqlLimitTimeoutsToHclTerraform(struct?: RdsPgSqlLimitTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPgSqlLimitTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPgSqlLimitTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPgSqlLimitTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit huaweicloud_rds_pg_sql_limit} +*/ +export class RdsPgSqlLimit extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_pg_sql_limit"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPgSqlLimit resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPgSqlLimit to import + * @param importFromId The id of the existing RdsPgSqlLimit that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPgSqlLimit to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_pg_sql_limit", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_pg_sql_limit huaweicloud_rds_pg_sql_limit} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPgSqlLimitConfig + */ + public constructor(scope: Construct, id: string, config: RdsPgSqlLimitConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_pg_sql_limit', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._maxConcurrency = config.maxConcurrency; + this._maxWaiting = config.maxWaiting; + this._queryId = config.queryId; + this._queryString = config.queryString; + this._region = config.region; + this._searchPath = config.searchPath; + this._switch = config.switch; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // is_effective - computed: true, optional: false, required: false + public get isEffective() { + return this.getBooleanAttribute('is_effective'); + } + + // max_concurrency - computed: false, optional: false, required: true + private _maxConcurrency?: number; + public get maxConcurrency() { + return this.getNumberAttribute('max_concurrency'); + } + public set maxConcurrency(value: number) { + this._maxConcurrency = value; + } + // Temporarily expose input value. Use with caution. + public get maxConcurrencyInput() { + return this._maxConcurrency; + } + + // max_waiting - computed: false, optional: false, required: true + private _maxWaiting?: number; + public get maxWaiting() { + return this.getNumberAttribute('max_waiting'); + } + public set maxWaiting(value: number) { + this._maxWaiting = value; + } + // Temporarily expose input value. Use with caution. + public get maxWaitingInput() { + return this._maxWaiting; + } + + // query_id - computed: false, optional: true, required: false + private _queryId?: string; + public get queryId() { + return this.getStringAttribute('query_id'); + } + public set queryId(value: string) { + this._queryId = value; + } + public resetQueryId() { + this._queryId = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryIdInput() { + return this._queryId; + } + + // query_string - computed: false, optional: true, required: false + private _queryString?: string; + public get queryString() { + return this.getStringAttribute('query_string'); + } + public set queryString(value: string) { + this._queryString = value; + } + public resetQueryString() { + this._queryString = undefined; + } + // Temporarily expose input value. Use with caution. + public get queryStringInput() { + return this._queryString; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // search_path - computed: false, optional: true, required: false + private _searchPath?: string; + public get searchPath() { + return this.getStringAttribute('search_path'); + } + public set searchPath(value: string) { + this._searchPath = value; + } + public resetSearchPath() { + this._searchPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get searchPathInput() { + return this._searchPath; + } + + // sql_limit_id - computed: true, optional: false, required: false + public get sqlLimitId() { + return this.getStringAttribute('sql_limit_id'); + } + + // switch - computed: true, optional: true, required: false + private _switch?: string; + public get switch() { + return this.getStringAttribute('switch'); + } + public set switch(value: string) { + this._switch = value; + } + public resetSwitch() { + this._switch = undefined; + } + // Temporarily expose input value. Use with caution. + public get switchInput() { + return this._switch; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPgSqlLimitTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPgSqlLimitTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + max_concurrency: cdktf.numberToTerraform(this._maxConcurrency), + max_waiting: cdktf.numberToTerraform(this._maxWaiting), + query_id: cdktf.stringToTerraform(this._queryId), + query_string: cdktf.stringToTerraform(this._queryString), + region: cdktf.stringToTerraform(this._region), + search_path: cdktf.stringToTerraform(this._searchPath), + switch: cdktf.stringToTerraform(this._switch), + timeouts: rdsPgSqlLimitTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + max_concurrency: { + value: cdktf.numberToHclTerraform(this._maxConcurrency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_waiting: { + value: cdktf.numberToHclTerraform(this._maxWaiting), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + query_id: { + value: cdktf.stringToHclTerraform(this._queryId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_string: { + value: cdktf.stringToHclTerraform(this._queryString), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + search_path: { + value: cdktf.stringToHclTerraform(this._searchPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + switch: { + value: cdktf.stringToHclTerraform(this._switch), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPgSqlLimitTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPgSqlLimitTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-primary-standby-switch/README.md b/src/constructs/providers/huaweicloud/rds-primary-standby-switch/README.md new file mode 100644 index 00000000..a66871da --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-primary-standby-switch/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_primary_standby_switch` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_primary_standby_switch`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch). diff --git a/src/constructs/providers/huaweicloud/rds-primary-standby-switch/index.ts b/src/constructs/providers/huaweicloud/rds-primary-standby-switch/index.ts new file mode 100644 index 00000000..9ae43254 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-primary-standby-switch/index.ts @@ -0,0 +1,325 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsPrimaryStandbySwitchConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to perform a forcible primary/standby switchover. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#force RdsPrimaryStandbySwitch#force} + */ + readonly force?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#id RdsPrimaryStandbySwitch#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#instance_id RdsPrimaryStandbySwitch#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#region RdsPrimaryStandbySwitch#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#timeouts RdsPrimaryStandbySwitch#timeouts} + */ + readonly timeouts?: RdsPrimaryStandbySwitchTimeouts; +} +export interface RdsPrimaryStandbySwitchTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#create RdsPrimaryStandbySwitch#create} + */ + readonly create?: string; +} + +export function rdsPrimaryStandbySwitchTimeoutsToTerraform(struct?: RdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function rdsPrimaryStandbySwitchTimeoutsToHclTerraform(struct?: RdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsPrimaryStandbySwitchTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsPrimaryStandbySwitchTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch huaweicloud_rds_primary_standby_switch} +*/ +export class RdsPrimaryStandbySwitch extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_primary_standby_switch"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsPrimaryStandbySwitch resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsPrimaryStandbySwitch to import + * @param importFromId The id of the existing RdsPrimaryStandbySwitch that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsPrimaryStandbySwitch to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_primary_standby_switch", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_primary_standby_switch huaweicloud_rds_primary_standby_switch} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsPrimaryStandbySwitchConfig + */ + public constructor(scope: Construct, id: string, config: RdsPrimaryStandbySwitchConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_primary_standby_switch', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._force = config.force; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // force - computed: false, optional: true, required: false + private _force?: boolean | cdktf.IResolvable; + public get force() { + return this.getBooleanAttribute('force'); + } + public set force(value: boolean | cdktf.IResolvable) { + this._force = value; + } + public resetForce() { + this._force = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceInput() { + return this._force; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsPrimaryStandbySwitchTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsPrimaryStandbySwitchTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + force: cdktf.booleanToTerraform(this._force), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsPrimaryStandbySwitchTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + force: { + value: cdktf.booleanToHclTerraform(this._force), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsPrimaryStandbySwitchTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsPrimaryStandbySwitchTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-read-replica-instance/README.md b/src/constructs/providers/huaweicloud/rds-read-replica-instance/README.md new file mode 100644 index 00000000..7b0e2346 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-read-replica-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_read_replica_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_read_replica_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance). diff --git a/src/constructs/providers/huaweicloud/rds-read-replica-instance/index.ts b/src/constructs/providers/huaweicloud/rds-read-replica-instance/index.ts new file mode 100644 index 00000000..c2f37011 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-read-replica-instance/index.ts @@ -0,0 +1,1344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsReadReplicaInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#auto_renew RdsReadReplicaInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#availability_zone RdsReadReplicaInstance#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#charging_mode RdsReadReplicaInstance#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#description RdsReadReplicaInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#enterprise_project_id RdsReadReplicaInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#fixed_ip RdsReadReplicaInstance#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#flavor RdsReadReplicaInstance#flavor} + */ + readonly flavor: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#id RdsReadReplicaInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#maintain_begin RdsReadReplicaInstance#maintain_begin} + */ + readonly maintainBegin?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#maintain_end RdsReadReplicaInstance#maintain_end} + */ + readonly maintainEnd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#name RdsReadReplicaInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#period RdsReadReplicaInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#period_unit RdsReadReplicaInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#primary_instance_id RdsReadReplicaInstance#primary_instance_id} + */ + readonly primaryInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#region RdsReadReplicaInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#security_group_id RdsReadReplicaInstance#security_group_id} + */ + readonly securityGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#ssl_enable RdsReadReplicaInstance#ssl_enable} + */ + readonly sslEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#tags RdsReadReplicaInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * db block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#db RdsReadReplicaInstance#db} + */ + readonly db?: RdsReadReplicaInstanceDb; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#parameters RdsReadReplicaInstance#parameters} + */ + readonly parameters?: RdsReadReplicaInstanceParameters[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#timeouts RdsReadReplicaInstance#timeouts} + */ + readonly timeouts?: RdsReadReplicaInstanceTimeouts; + /** + * volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#volume RdsReadReplicaInstance#volume} + */ + readonly volume: RdsReadReplicaInstanceVolume; +} +export interface RdsReadReplicaInstanceDb { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#port RdsReadReplicaInstance#port} + */ + readonly port?: number; +} + +export function rdsReadReplicaInstanceDbToTerraform(struct?: RdsReadReplicaInstanceDbOutputReference | RdsReadReplicaInstanceDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function rdsReadReplicaInstanceDbToHclTerraform(struct?: RdsReadReplicaInstanceDbOutputReference | RdsReadReplicaInstanceDb): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsReadReplicaInstanceDbOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsReadReplicaInstanceDb | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsReadReplicaInstanceDb | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._port = value.port; + } + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } +} +export interface RdsReadReplicaInstanceParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#name RdsReadReplicaInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#value RdsReadReplicaInstance#value} + */ + readonly value: string; +} + +export function rdsReadReplicaInstanceParametersToTerraform(struct?: RdsReadReplicaInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function rdsReadReplicaInstanceParametersToHclTerraform(struct?: RdsReadReplicaInstanceParameters | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsReadReplicaInstanceParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsReadReplicaInstanceParameters | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsReadReplicaInstanceParameters | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class RdsReadReplicaInstanceParametersList extends cdktf.ComplexList { + public internalValue? : RdsReadReplicaInstanceParameters[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsReadReplicaInstanceParametersOutputReference { + return new RdsReadReplicaInstanceParametersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RdsReadReplicaInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#create RdsReadReplicaInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#delete RdsReadReplicaInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#update RdsReadReplicaInstance#update} + */ + readonly update?: string; +} + +export function rdsReadReplicaInstanceTimeoutsToTerraform(struct?: RdsReadReplicaInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsReadReplicaInstanceTimeoutsToHclTerraform(struct?: RdsReadReplicaInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsReadReplicaInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsReadReplicaInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsReadReplicaInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsReadReplicaInstanceVolume { + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#disk_encryption_id RdsReadReplicaInstance#disk_encryption_id} + */ + readonly diskEncryptionId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#limit_size RdsReadReplicaInstance#limit_size} + */ + readonly limitSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#size RdsReadReplicaInstance#size} + */ + readonly size?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#trigger_threshold RdsReadReplicaInstance#trigger_threshold} + */ + readonly triggerThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#type RdsReadReplicaInstance#type} + */ + readonly type: string; +} + +export function rdsReadReplicaInstanceVolumeToTerraform(struct?: RdsReadReplicaInstanceVolumeOutputReference | RdsReadReplicaInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + disk_encryption_id: cdktf.stringToTerraform(struct!.diskEncryptionId), + limit_size: cdktf.numberToTerraform(struct!.limitSize), + size: cdktf.numberToTerraform(struct!.size), + trigger_threshold: cdktf.numberToTerraform(struct!.triggerThreshold), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function rdsReadReplicaInstanceVolumeToHclTerraform(struct?: RdsReadReplicaInstanceVolumeOutputReference | RdsReadReplicaInstanceVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + disk_encryption_id: { + value: cdktf.stringToHclTerraform(struct!.diskEncryptionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + limit_size: { + value: cdktf.numberToHclTerraform(struct!.limitSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + trigger_threshold: { + value: cdktf.numberToHclTerraform(struct!.triggerThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsReadReplicaInstanceVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RdsReadReplicaInstanceVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._diskEncryptionId !== undefined) { + hasAnyValues = true; + internalValueResult.diskEncryptionId = this._diskEncryptionId; + } + if (this._limitSize !== undefined) { + hasAnyValues = true; + internalValueResult.limitSize = this._limitSize; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._triggerThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.triggerThreshold = this._triggerThreshold; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsReadReplicaInstanceVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._diskEncryptionId = undefined; + this._limitSize = undefined; + this._size = undefined; + this._triggerThreshold = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._diskEncryptionId = value.diskEncryptionId; + this._limitSize = value.limitSize; + this._size = value.size; + this._triggerThreshold = value.triggerThreshold; + this._type = value.type; + } + } + + // disk_encryption_id - computed: true, optional: true, required: false + private _diskEncryptionId?: string; + public get diskEncryptionId() { + return this.getStringAttribute('disk_encryption_id'); + } + public set diskEncryptionId(value: string) { + this._diskEncryptionId = value; + } + public resetDiskEncryptionId() { + this._diskEncryptionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskEncryptionIdInput() { + return this._diskEncryptionId; + } + + // limit_size - computed: false, optional: true, required: false + private _limitSize?: number; + public get limitSize() { + return this.getNumberAttribute('limit_size'); + } + public set limitSize(value: number) { + this._limitSize = value; + } + public resetLimitSize() { + this._limitSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitSizeInput() { + return this._limitSize; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // trigger_threshold - computed: false, optional: true, required: false + private _triggerThreshold?: number; + public get triggerThreshold() { + return this.getNumberAttribute('trigger_threshold'); + } + public set triggerThreshold(value: number) { + this._triggerThreshold = value; + } + public resetTriggerThreshold() { + this._triggerThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerThresholdInput() { + return this._triggerThreshold; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance huaweicloud_rds_read_replica_instance} +*/ +export class RdsReadReplicaInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_read_replica_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsReadReplicaInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsReadReplicaInstance to import + * @param importFromId The id of the existing RdsReadReplicaInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsReadReplicaInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_read_replica_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_read_replica_instance huaweicloud_rds_read_replica_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsReadReplicaInstanceConfig + */ + public constructor(scope: Construct, id: string, config: RdsReadReplicaInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_read_replica_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fixedIp = config.fixedIp; + this._flavor = config.flavor; + this._id = config.id; + this._maintainBegin = config.maintainBegin; + this._maintainEnd = config.maintainEnd; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._primaryInstanceId = config.primaryInstanceId; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._sslEnable = config.sslEnable; + this._tags = config.tags; + this._db.internalValue = config.db; + this._parameters.internalValue = config.parameters; + this._timeouts.internalValue = config.timeouts; + this._volume.internalValue = config.volume; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // flavor - computed: false, optional: false, required: true + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintain_begin - computed: true, optional: true, required: false + private _maintainBegin?: string; + public get maintainBegin() { + return this.getStringAttribute('maintain_begin'); + } + public set maintainBegin(value: string) { + this._maintainBegin = value; + } + public resetMaintainBegin() { + this._maintainBegin = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainBeginInput() { + return this._maintainBegin; + } + + // maintain_end - computed: true, optional: true, required: false + private _maintainEnd?: string; + public get maintainEnd() { + return this.getStringAttribute('maintain_end'); + } + public set maintainEnd(value: string) { + this._maintainEnd = value; + } + public resetMaintainEnd() { + this._maintainEnd = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainEndInput() { + return this._maintainEnd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // primary_instance_id - computed: false, optional: false, required: true + private _primaryInstanceId?: string; + public get primaryInstanceId() { + return this.getStringAttribute('primary_instance_id'); + } + public set primaryInstanceId(value: string) { + this._primaryInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get primaryInstanceIdInput() { + return this._primaryInstanceId; + } + + // private_ips - computed: true, optional: false, required: false + public get privateIps() { + return this.getListAttribute('private_ips'); + } + + // public_ips - computed: true, optional: false, required: false + public get publicIps() { + return this.getListAttribute('public_ips'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: true, optional: true, required: false + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + public resetSecurityGroupId() { + this._securityGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // ssl_enable - computed: true, optional: true, required: false + private _sslEnable?: boolean | cdktf.IResolvable; + public get sslEnable() { + return this.getBooleanAttribute('ssl_enable'); + } + public set sslEnable(value: boolean | cdktf.IResolvable) { + this._sslEnable = value; + } + public resetSslEnable() { + this._sslEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sslEnableInput() { + return this._sslEnable; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // db - computed: false, optional: true, required: false + private _db = new RdsReadReplicaInstanceDbOutputReference(this, "db"); + public get db() { + return this._db; + } + public putDb(value: RdsReadReplicaInstanceDb) { + this._db.internalValue = value; + } + public resetDb() { + this._db.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dbInput() { + return this._db.internalValue; + } + + // parameters - computed: false, optional: true, required: false + private _parameters = new RdsReadReplicaInstanceParametersList(this, "parameters", true); + public get parameters() { + return this._parameters; + } + public putParameters(value: RdsReadReplicaInstanceParameters[] | cdktf.IResolvable) { + this._parameters.internalValue = value; + } + public resetParameters() { + this._parameters.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsReadReplicaInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsReadReplicaInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // volume - computed: false, optional: false, required: true + private _volume = new RdsReadReplicaInstanceVolumeOutputReference(this, "volume"); + public get volume() { + return this._volume; + } + public putVolume(value: RdsReadReplicaInstanceVolume) { + this._volume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get volumeInput() { + return this._volume.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + maintain_begin: cdktf.stringToTerraform(this._maintainBegin), + maintain_end: cdktf.stringToTerraform(this._maintainEnd), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + primary_instance_id: cdktf.stringToTerraform(this._primaryInstanceId), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + ssl_enable: cdktf.booleanToTerraform(this._sslEnable), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + db: rdsReadReplicaInstanceDbToTerraform(this._db.internalValue), + parameters: cdktf.listMapper(rdsReadReplicaInstanceParametersToTerraform, true)(this._parameters.internalValue), + timeouts: rdsReadReplicaInstanceTimeoutsToTerraform(this._timeouts.internalValue), + volume: rdsReadReplicaInstanceVolumeToTerraform(this._volume.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_begin: { + value: cdktf.stringToHclTerraform(this._maintainBegin), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_end: { + value: cdktf.stringToHclTerraform(this._maintainEnd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_instance_id: { + value: cdktf.stringToHclTerraform(this._primaryInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ssl_enable: { + value: cdktf.booleanToHclTerraform(this._sslEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + db: { + value: rdsReadReplicaInstanceDbToHclTerraform(this._db.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsReadReplicaInstanceDbList", + }, + parameters: { + value: cdktf.listMapperHcl(rdsReadReplicaInstanceParametersToHclTerraform, true)(this._parameters.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsReadReplicaInstanceParametersList", + }, + timeouts: { + value: rdsReadReplicaInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsReadReplicaInstanceTimeouts", + }, + volume: { + value: rdsReadReplicaInstanceVolumeToHclTerraform(this._volume.internalValue), + isBlock: true, + type: "list", + storageClassType: "RdsReadReplicaInstanceVolumeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-recycling-policy/README.md b/src/constructs/providers/huaweicloud/rds-recycling-policy/README.md new file mode 100644 index 00000000..af11427a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-recycling-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_recycling_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_recycling_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy). diff --git a/src/constructs/providers/huaweicloud/rds-recycling-policy/index.ts b/src/constructs/providers/huaweicloud/rds-recycling-policy/index.ts new file mode 100644 index 00000000..d4e9cf49 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-recycling-policy/index.ts @@ -0,0 +1,174 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsRecyclingPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy#id RdsRecyclingPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy#region RdsRecyclingPolicy#region} + */ + readonly region?: string; + /** + * Specifies the period of retaining deleted DB instances. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy#retention_period_in_days RdsRecyclingPolicy#retention_period_in_days} + */ + readonly retentionPeriodInDays?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy huaweicloud_rds_recycling_policy} +*/ +export class RdsRecyclingPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_recycling_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsRecyclingPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsRecyclingPolicy to import + * @param importFromId The id of the existing RdsRecyclingPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsRecyclingPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_recycling_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_recycling_policy huaweicloud_rds_recycling_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsRecyclingPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: RdsRecyclingPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_recycling_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._retentionPeriodInDays = config.retentionPeriodInDays; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retention_period_in_days - computed: false, optional: true, required: false + private _retentionPeriodInDays?: number; + public get retentionPeriodInDays() { + return this.getNumberAttribute('retention_period_in_days'); + } + public set retentionPeriodInDays(value: number) { + this._retentionPeriodInDays = value; + } + public resetRetentionPeriodInDays() { + this._retentionPeriodInDays = undefined; + } + // Temporarily expose input value. Use with caution. + public get retentionPeriodInDaysInput() { + return this._retentionPeriodInDays; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + retention_period_in_days: cdktf.numberToTerraform(this._retentionPeriodInDays), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retention_period_in_days: { + value: cdktf.numberToHclTerraform(this._retentionPeriodInDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-restore/README.md b/src/constructs/providers/huaweicloud/rds-restore/README.md new file mode 100644 index 00000000..c61a14c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-restore/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_restore` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_restore`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore). diff --git a/src/constructs/providers/huaweicloud/rds-restore/index.ts b/src/constructs/providers/huaweicloud/rds-restore/index.ts new file mode 100644 index 00000000..cfa67d81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-restore/index.ts @@ -0,0 +1,442 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsRestoreConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the backup to be restored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#backup_id RdsRestore#backup_id} + */ + readonly backupId?: string; + /** + * Specifies the databases that will be restored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#database_name RdsRestore#database_name} + */ + readonly databaseName?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#id RdsRestore#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#region RdsRestore#region} + */ + readonly region?: string; + /** + * Specifies the time point of data restoration in the UNIX timestamp format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#restore_time RdsRestore#restore_time} + */ + readonly restoreTime?: number; + /** + * Specifies the source instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#source_instance_id RdsRestore#source_instance_id} + */ + readonly sourceInstanceId: string; + /** + * Specifies the target instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#target_instance_id RdsRestore#target_instance_id} + */ + readonly targetInstanceId: string; + /** + * Specifies the restoration type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#type RdsRestore#type} + */ + readonly type?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#timeouts RdsRestore#timeouts} + */ + readonly timeouts?: RdsRestoreTimeouts; +} +export interface RdsRestoreTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#create RdsRestore#create} + */ + readonly create?: string; +} + +export function rdsRestoreTimeoutsToTerraform(struct?: RdsRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function rdsRestoreTimeoutsToHclTerraform(struct?: RdsRestoreTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsRestoreTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsRestoreTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsRestoreTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore huaweicloud_rds_restore} +*/ +export class RdsRestore extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_restore"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsRestore resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsRestore to import + * @param importFromId The id of the existing RdsRestore that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsRestore to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_restore", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_restore huaweicloud_rds_restore} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsRestoreConfig + */ + public constructor(scope: Construct, id: string, config: RdsRestoreConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_restore', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._backupId = config.backupId; + this._databaseName = config.databaseName; + this._id = config.id; + this._region = config.region; + this._restoreTime = config.restoreTime; + this._sourceInstanceId = config.sourceInstanceId; + this._targetInstanceId = config.targetInstanceId; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // backup_id - computed: false, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // database_name - computed: false, optional: true, required: false + private _databaseName?: { [key: string]: string }; + public get databaseName() { + return this.getStringMapAttribute('database_name'); + } + public set databaseName(value: { [key: string]: string }) { + this._databaseName = value; + } + public resetDatabaseName() { + this._databaseName = undefined; + } + // Temporarily expose input value. Use with caution. + public get databaseNameInput() { + return this._databaseName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // restore_time - computed: false, optional: true, required: false + private _restoreTime?: number; + public get restoreTime() { + return this.getNumberAttribute('restore_time'); + } + public set restoreTime(value: number) { + this._restoreTime = value; + } + public resetRestoreTime() { + this._restoreTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get restoreTimeInput() { + return this._restoreTime; + } + + // source_instance_id - computed: false, optional: false, required: true + private _sourceInstanceId?: string; + public get sourceInstanceId() { + return this.getStringAttribute('source_instance_id'); + } + public set sourceInstanceId(value: string) { + this._sourceInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInstanceIdInput() { + return this._sourceInstanceId; + } + + // target_instance_id - computed: false, optional: false, required: true + private _targetInstanceId?: string; + public get targetInstanceId() { + return this.getStringAttribute('target_instance_id'); + } + public set targetInstanceId(value: string) { + this._targetInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get targetInstanceIdInput() { + return this._targetInstanceId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsRestoreTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsRestoreTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + backup_id: cdktf.stringToTerraform(this._backupId), + database_name: cdktf.hashMapper(cdktf.stringToTerraform)(this._databaseName), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + restore_time: cdktf.numberToTerraform(this._restoreTime), + source_instance_id: cdktf.stringToTerraform(this._sourceInstanceId), + target_instance_id: cdktf.stringToTerraform(this._targetInstanceId), + type: cdktf.stringToTerraform(this._type), + timeouts: rdsRestoreTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + database_name: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._databaseName), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + restore_time: { + value: cdktf.numberToHclTerraform(this._restoreTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source_instance_id: { + value: cdktf.stringToHclTerraform(this._sourceInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_instance_id: { + value: cdktf.stringToHclTerraform(this._targetInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsRestoreTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsRestoreTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-sql-audit/README.md b/src/constructs/providers/huaweicloud/rds-sql-audit/README.md new file mode 100644 index 00000000..b0b6947a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sql-audit/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_sql_audit` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_sql_audit`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit). diff --git a/src/constructs/providers/huaweicloud/rds-sql-audit/index.ts b/src/constructs/providers/huaweicloud/rds-sql-audit/index.ts new file mode 100644 index 00000000..a56cccc8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sql-audit/index.ts @@ -0,0 +1,449 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsSqlAuditConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the list of audit types. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#audit_types RdsSqlAudit#audit_types} + */ + readonly auditTypes?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#id RdsSqlAudit#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#instance_id RdsSqlAudit#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the number of days for storing audit logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#keep_days RdsSqlAudit#keep_days} + */ + readonly keepDays: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#region RdsSqlAudit#region} + */ + readonly region?: string; + /** + * Specifies whether the historical audit logs will be reserved for some time when SQL + * audit is disabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#reserve_auditlogs RdsSqlAudit#reserve_auditlogs} + */ + readonly reserveAuditlogs?: boolean | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#timeouts RdsSqlAudit#timeouts} + */ + readonly timeouts?: RdsSqlAuditTimeouts; +} +export interface RdsSqlAuditTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#create RdsSqlAudit#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#delete RdsSqlAudit#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#update RdsSqlAudit#update} + */ + readonly update?: string; +} + +export function rdsSqlAuditTimeoutsToTerraform(struct?: RdsSqlAuditTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsSqlAuditTimeoutsToHclTerraform(struct?: RdsSqlAuditTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsSqlAuditTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsSqlAuditTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsSqlAuditTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit huaweicloud_rds_sql_audit} +*/ +export class RdsSqlAudit extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sql_audit"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsSqlAudit resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsSqlAudit to import + * @param importFromId The id of the existing RdsSqlAudit that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsSqlAudit to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sql_audit", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sql_audit huaweicloud_rds_sql_audit} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsSqlAuditConfig + */ + public constructor(scope: Construct, id: string, config: RdsSqlAuditConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sql_audit', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._auditTypes = config.auditTypes; + this._id = config.id; + this._instanceId = config.instanceId; + this._keepDays = config.keepDays; + this._region = config.region; + this._reserveAuditlogs = config.reserveAuditlogs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // audit_types - computed: true, optional: true, required: false + private _auditTypes?: string[]; + public get auditTypes() { + return cdktf.Fn.tolist(this.getListAttribute('audit_types')); + } + public set auditTypes(value: string[]) { + this._auditTypes = value; + } + public resetAuditTypes() { + this._auditTypes = undefined; + } + // Temporarily expose input value. Use with caution. + public get auditTypesInput() { + return this._auditTypes; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // keep_days - computed: false, optional: false, required: true + private _keepDays?: number; + public get keepDays() { + return this.getNumberAttribute('keep_days'); + } + public set keepDays(value: number) { + this._keepDays = value; + } + // Temporarily expose input value. Use with caution. + public get keepDaysInput() { + return this._keepDays; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reserve_auditlogs - computed: false, optional: true, required: false + private _reserveAuditlogs?: boolean | cdktf.IResolvable; + public get reserveAuditlogs() { + return this.getBooleanAttribute('reserve_auditlogs'); + } + public set reserveAuditlogs(value: boolean | cdktf.IResolvable) { + this._reserveAuditlogs = value; + } + public resetReserveAuditlogs() { + this._reserveAuditlogs = undefined; + } + // Temporarily expose input value. Use with caution. + public get reserveAuditlogsInput() { + return this._reserveAuditlogs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsSqlAuditTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsSqlAuditTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + audit_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._auditTypes), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + keep_days: cdktf.numberToTerraform(this._keepDays), + region: cdktf.stringToTerraform(this._region), + reserve_auditlogs: cdktf.booleanToTerraform(this._reserveAuditlogs), + timeouts: rdsSqlAuditTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + audit_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._auditTypes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_days: { + value: cdktf.numberToHclTerraform(this._keepDays), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reserve_auditlogs: { + value: cdktf.booleanToHclTerraform(this._reserveAuditlogs), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + timeouts: { + value: rdsSqlAuditTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsSqlAuditTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-sqlserver-account/README.md b/src/constructs/providers/huaweicloud/rds-sqlserver-account/README.md new file mode 100644 index 00000000..b60eedaf --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sqlserver-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_sqlserver_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_sqlserver_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account). diff --git a/src/constructs/providers/huaweicloud/rds-sqlserver-account/index.ts b/src/constructs/providers/huaweicloud/rds-sqlserver-account/index.ts new file mode 100644 index 00000000..69dcd42b --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sqlserver-account/index.ts @@ -0,0 +1,420 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsSqlserverAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#id RdsSqlserverAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS SQLServer instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#instance_id RdsSqlserverAccount#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the username of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#name RdsSqlserverAccount#name} + */ + readonly name: string; + /** + * Specifies the password of the DB account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#password RdsSqlserverAccount#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#region RdsSqlserverAccount#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#timeouts RdsSqlserverAccount#timeouts} + */ + readonly timeouts?: RdsSqlserverAccountTimeouts; +} +export interface RdsSqlserverAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#create RdsSqlserverAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#delete RdsSqlserverAccount#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#update RdsSqlserverAccount#update} + */ + readonly update?: string; +} + +export function rdsSqlserverAccountTimeoutsToTerraform(struct?: RdsSqlserverAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsSqlserverAccountTimeoutsToHclTerraform(struct?: RdsSqlserverAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsSqlserverAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsSqlserverAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsSqlserverAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account huaweicloud_rds_sqlserver_account} +*/ +export class RdsSqlserverAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsSqlserverAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsSqlserverAccount to import + * @param importFromId The id of the existing RdsSqlserverAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsSqlserverAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_account huaweicloud_rds_sqlserver_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsSqlserverAccountConfig + */ + public constructor(scope: Construct, id: string, config: RdsSqlserverAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsSqlserverAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsSqlserverAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsSqlserverAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsSqlserverAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsSqlserverAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/README.md b/src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/README.md new file mode 100644 index 00000000..98b29204 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_sqlserver_database_privilege` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_sqlserver_database_privilege`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege). diff --git a/src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/index.ts b/src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/index.ts new file mode 100644 index 00000000..a3ab1d8a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sqlserver-database-privilege/index.ts @@ -0,0 +1,565 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsSqlserverDatabasePrivilegeConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#db_name RdsSqlserverDatabasePrivilege#db_name} + */ + readonly dbName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#id RdsSqlserverDatabasePrivilege#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS SQL Server instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#instance_id RdsSqlserverDatabasePrivilege#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#region RdsSqlserverDatabasePrivilege#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#timeouts RdsSqlserverDatabasePrivilege#timeouts} + */ + readonly timeouts?: RdsSqlserverDatabasePrivilegeTimeouts; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#users RdsSqlserverDatabasePrivilege#users} + */ + readonly users: RdsSqlserverDatabasePrivilegeUsers[] | cdktf.IResolvable; +} +export interface RdsSqlserverDatabasePrivilegeTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#create RdsSqlserverDatabasePrivilege#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#delete RdsSqlserverDatabasePrivilege#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#update RdsSqlserverDatabasePrivilege#update} + */ + readonly update?: string; +} + +export function rdsSqlserverDatabasePrivilegeTimeoutsToTerraform(struct?: RdsSqlserverDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsSqlserverDatabasePrivilegeTimeoutsToHclTerraform(struct?: RdsSqlserverDatabasePrivilegeTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsSqlserverDatabasePrivilegeTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsSqlserverDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsSqlserverDatabasePrivilegeTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface RdsSqlserverDatabasePrivilegeUsers { + /** + * Specifies the username of the database account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#name RdsSqlserverDatabasePrivilege#name} + */ + readonly name: string; + /** + * Specifies the read-only permission. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#readonly RdsSqlserverDatabasePrivilege#readonly} + */ + readonly readonly?: boolean | cdktf.IResolvable; +} + +export function rdsSqlserverDatabasePrivilegeUsersToTerraform(struct?: RdsSqlserverDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + readonly: cdktf.booleanToTerraform(struct!.readonly), + } +} + + +export function rdsSqlserverDatabasePrivilegeUsersToHclTerraform(struct?: RdsSqlserverDatabasePrivilegeUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(struct!.readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsSqlserverDatabasePrivilegeUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RdsSqlserverDatabasePrivilegeUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._readonly !== undefined) { + hasAnyValues = true; + internalValueResult.readonly = this._readonly; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsSqlserverDatabasePrivilegeUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._readonly = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._readonly = value.readonly; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // readonly - computed: true, optional: true, required: false + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + public resetReadonly() { + this._readonly = undefined; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } +} + +export class RdsSqlserverDatabasePrivilegeUsersList extends cdktf.ComplexList { + public internalValue? : RdsSqlserverDatabasePrivilegeUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RdsSqlserverDatabasePrivilegeUsersOutputReference { + return new RdsSqlserverDatabasePrivilegeUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege huaweicloud_rds_sqlserver_database_privilege} +*/ +export class RdsSqlserverDatabasePrivilege extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_database_privilege"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsSqlserverDatabasePrivilege resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsSqlserverDatabasePrivilege to import + * @param importFromId The id of the existing RdsSqlserverDatabasePrivilege that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsSqlserverDatabasePrivilege to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_database_privilege", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database_privilege huaweicloud_rds_sqlserver_database_privilege} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsSqlserverDatabasePrivilegeConfig + */ + public constructor(scope: Construct, id: string, config: RdsSqlserverDatabasePrivilegeConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_database_privilege', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dbName = config.dbName; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // db_name - computed: false, optional: false, required: true + private _dbName?: string; + public get dbName() { + return this.getStringAttribute('db_name'); + } + public set dbName(value: string) { + this._dbName = value; + } + // Temporarily expose input value. Use with caution. + public get dbNameInput() { + return this._dbName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsSqlserverDatabasePrivilegeTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsSqlserverDatabasePrivilegeTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // users - computed: false, optional: false, required: true + private _users = new RdsSqlserverDatabasePrivilegeUsersList(this, "users", true); + public get users() { + return this._users; + } + public putUsers(value: RdsSqlserverDatabasePrivilegeUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + db_name: cdktf.stringToTerraform(this._dbName), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsSqlserverDatabasePrivilegeTimeoutsToTerraform(this._timeouts.internalValue), + users: cdktf.listMapper(rdsSqlserverDatabasePrivilegeUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + db_name: { + value: cdktf.stringToHclTerraform(this._dbName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsSqlserverDatabasePrivilegeTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsSqlserverDatabasePrivilegeTimeouts", + }, + users: { + value: cdktf.listMapperHcl(rdsSqlserverDatabasePrivilegeUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "set", + storageClassType: "RdsSqlserverDatabasePrivilegeUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rds-sqlserver-database/README.md b/src/constructs/providers/huaweicloud/rds-sqlserver-database/README.md new file mode 100644 index 00000000..702b350f --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sqlserver-database/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rds_sqlserver_database` + +Refer to the Terraform Registry for docs: [`huaweicloud_rds_sqlserver_database`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database). diff --git a/src/constructs/providers/huaweicloud/rds-sqlserver-database/index.ts b/src/constructs/providers/huaweicloud/rds-sqlserver-database/index.ts new file mode 100644 index 00000000..31ece212 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rds-sqlserver-database/index.ts @@ -0,0 +1,398 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RdsSqlserverDatabaseConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#id RdsSqlserverDatabase#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the RDS SQLServer instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#instance_id RdsSqlserverDatabase#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the database name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#name RdsSqlserverDatabase#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#region RdsSqlserverDatabase#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#timeouts RdsSqlserverDatabase#timeouts} + */ + readonly timeouts?: RdsSqlserverDatabaseTimeouts; +} +export interface RdsSqlserverDatabaseTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#create RdsSqlserverDatabase#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#delete RdsSqlserverDatabase#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#update RdsSqlserverDatabase#update} + */ + readonly update?: string; +} + +export function rdsSqlserverDatabaseTimeoutsToTerraform(struct?: RdsSqlserverDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rdsSqlserverDatabaseTimeoutsToHclTerraform(struct?: RdsSqlserverDatabaseTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RdsSqlserverDatabaseTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RdsSqlserverDatabaseTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RdsSqlserverDatabaseTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database huaweicloud_rds_sqlserver_database} +*/ +export class RdsSqlserverDatabase extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rds_sqlserver_database"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RdsSqlserverDatabase resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RdsSqlserverDatabase to import + * @param importFromId The id of the existing RdsSqlserverDatabase that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RdsSqlserverDatabase to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rds_sqlserver_database", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rds_sqlserver_database huaweicloud_rds_sqlserver_database} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RdsSqlserverDatabaseConfig + */ + public constructor(scope: Construct, id: string, config: RdsSqlserverDatabaseConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rds_sqlserver_database', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // character_set - computed: true, optional: false, required: false + public get characterSet() { + return this.getStringAttribute('character_set'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RdsSqlserverDatabaseTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RdsSqlserverDatabaseTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: rdsSqlserverDatabaseTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rdsSqlserverDatabaseTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RdsSqlserverDatabaseTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rf-stack/README.md b/src/constructs/providers/huaweicloud/rf-stack/README.md new file mode 100644 index 00000000..83bb2efd --- /dev/null +++ b/src/constructs/providers/huaweicloud/rf-stack/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rf_stack` + +Refer to the Terraform Registry for docs: [`huaweicloud_rf_stack`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack). diff --git a/src/constructs/providers/huaweicloud/rf-stack/index.ts b/src/constructs/providers/huaweicloud/rf-stack/index.ts new file mode 100644 index 00000000..10307a07 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rf-stack/index.ts @@ -0,0 +1,801 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RfStackConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the resource stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#description RfStack#description} + */ + readonly description?: string; + /** + * Whether to enable automatic rollback. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#enable_auto_rollback RfStack#enable_auto_rollback} + */ + readonly enableAutoRollback?: boolean | cdktf.IResolvable; + /** + * Whether to enable delete protection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#enable_deletion_protection RfStack#enable_deletion_protection} + */ + readonly enableDeletionProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#id RfStack#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the resource stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#name RfStack#name} + */ + readonly name: string; + /** + * The region where the RFS resource stack is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#region RfStack#region} + */ + readonly region?: string; + /** + * Whether to reserve resources when deleting the resource stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#retain_all_resources RfStack#retain_all_resources} + */ + readonly retainAllResources?: boolean | cdktf.IResolvable; + /** + * The HCL/JSON template content for deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#template_body RfStack#template_body} + */ + readonly templateBody?: string; + /** + * The OBS address where the HCL/JSON template archive (**.zip** file, which contains all resource **.tf.json** script files to be deployed) or **.tf.json** file is located, which describes the target status of the deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#template_uri RfStack#template_uri} + */ + readonly templateUri?: string; + /** + * The variable content for deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#vars_body RfStack#vars_body} + */ + readonly varsBody?: string; + /** + * The OBS address where the variable (**.tfvars**) file corresponding to the HCL/JSON template located, which describes the target status of the deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#vars_uri RfStack#vars_uri} + */ + readonly varsUri?: string; + /** + * agency block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#agency RfStack#agency} + */ + readonly agency?: RfStackAgency[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#timeouts RfStack#timeouts} + */ + readonly timeouts?: RfStackTimeouts; +} +export interface RfStackAgency { + /** + * The name of IAM agency authorized to IAC account for resources modification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#name RfStack#name} + */ + readonly name?: string; + /** + * The name of the provider corresponding to the IAM agency. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#provider_name RfStack#provider_name} + */ + readonly providerName?: string; +} + +export function rfStackAgencyToTerraform(struct?: RfStackAgency | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + provider_name: cdktf.stringToTerraform(struct!.providerName), + } +} + + +export function rfStackAgencyToHclTerraform(struct?: RfStackAgency | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_name: { + value: cdktf.stringToHclTerraform(struct!.providerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RfStackAgencyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RfStackAgency | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._providerName !== undefined) { + hasAnyValues = true; + internalValueResult.providerName = this._providerName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RfStackAgency | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._providerName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._providerName = value.providerName; + } + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_name - computed: false, optional: true, required: false + private _providerName?: string; + public get providerName() { + return this.getStringAttribute('provider_name'); + } + public set providerName(value: string) { + this._providerName = value; + } + public resetProviderName() { + this._providerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get providerNameInput() { + return this._providerName; + } +} + +export class RfStackAgencyList extends cdktf.ComplexList { + public internalValue? : RfStackAgency[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RfStackAgencyOutputReference { + return new RfStackAgencyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RfStackTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#create RfStack#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#delete RfStack#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#update RfStack#update} + */ + readonly update?: string; +} + +export function rfStackTimeoutsToTerraform(struct?: RfStackTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rfStackTimeoutsToHclTerraform(struct?: RfStackTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RfStackTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RfStackTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RfStackTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack huaweicloud_rf_stack} +*/ +export class RfStack extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rf_stack"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RfStack resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RfStack to import + * @param importFromId The id of the existing RfStack that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RfStack to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rf_stack", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rf_stack huaweicloud_rf_stack} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RfStackConfig + */ + public constructor(scope: Construct, id: string, config: RfStackConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rf_stack', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableAutoRollback = config.enableAutoRollback; + this._enableDeletionProtection = config.enableDeletionProtection; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._retainAllResources = config.retainAllResources; + this._templateBody = config.templateBody; + this._templateUri = config.templateUri; + this._varsBody = config.varsBody; + this._varsUri = config.varsUri; + this._agency.internalValue = config.agency; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_auto_rollback - computed: false, optional: true, required: false + private _enableAutoRollback?: boolean | cdktf.IResolvable; + public get enableAutoRollback() { + return this.getBooleanAttribute('enable_auto_rollback'); + } + public set enableAutoRollback(value: boolean | cdktf.IResolvable) { + this._enableAutoRollback = value; + } + public resetEnableAutoRollback() { + this._enableAutoRollback = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAutoRollbackInput() { + return this._enableAutoRollback; + } + + // enable_deletion_protection - computed: false, optional: true, required: false + private _enableDeletionProtection?: boolean | cdktf.IResolvable; + public get enableDeletionProtection() { + return this.getBooleanAttribute('enable_deletion_protection'); + } + public set enableDeletionProtection(value: boolean | cdktf.IResolvable) { + this._enableDeletionProtection = value; + } + public resetEnableDeletionProtection() { + this._enableDeletionProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDeletionProtectionInput() { + return this._enableDeletionProtection; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retain_all_resources - computed: false, optional: true, required: false + private _retainAllResources?: boolean | cdktf.IResolvable; + public get retainAllResources() { + return this.getBooleanAttribute('retain_all_resources'); + } + public set retainAllResources(value: boolean | cdktf.IResolvable) { + this._retainAllResources = value; + } + public resetRetainAllResources() { + this._retainAllResources = undefined; + } + // Temporarily expose input value. Use with caution. + public get retainAllResourcesInput() { + return this._retainAllResources; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // template_body - computed: false, optional: true, required: false + private _templateBody?: string; + public get templateBody() { + return this.getStringAttribute('template_body'); + } + public set templateBody(value: string) { + this._templateBody = value; + } + public resetTemplateBody() { + this._templateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateBodyInput() { + return this._templateBody; + } + + // template_uri - computed: false, optional: true, required: false + private _templateUri?: string; + public get templateUri() { + return this.getStringAttribute('template_uri'); + } + public set templateUri(value: string) { + this._templateUri = value; + } + public resetTemplateUri() { + this._templateUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateUriInput() { + return this._templateUri; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vars_body - computed: false, optional: true, required: false + private _varsBody?: string; + public get varsBody() { + return this.getStringAttribute('vars_body'); + } + public set varsBody(value: string) { + this._varsBody = value; + } + public resetVarsBody() { + this._varsBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsBodyInput() { + return this._varsBody; + } + + // vars_uri - computed: false, optional: true, required: false + private _varsUri?: string; + public get varsUri() { + return this.getStringAttribute('vars_uri'); + } + public set varsUri(value: string) { + this._varsUri = value; + } + public resetVarsUri() { + this._varsUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsUriInput() { + return this._varsUri; + } + + // agency - computed: false, optional: true, required: false + private _agency = new RfStackAgencyList(this, "agency", false); + public get agency() { + return this._agency; + } + public putAgency(value: RfStackAgency[] | cdktf.IResolvable) { + this._agency.internalValue = value; + } + public resetAgency() { + this._agency.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RfStackTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RfStackTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_auto_rollback: cdktf.booleanToTerraform(this._enableAutoRollback), + enable_deletion_protection: cdktf.booleanToTerraform(this._enableDeletionProtection), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + retain_all_resources: cdktf.booleanToTerraform(this._retainAllResources), + template_body: cdktf.stringToTerraform(this._templateBody), + template_uri: cdktf.stringToTerraform(this._templateUri), + vars_body: cdktf.stringToTerraform(this._varsBody), + vars_uri: cdktf.stringToTerraform(this._varsUri), + agency: cdktf.listMapper(rfStackAgencyToTerraform, true)(this._agency.internalValue), + timeouts: rfStackTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_auto_rollback: { + value: cdktf.booleanToHclTerraform(this._enableAutoRollback), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_deletion_protection: { + value: cdktf.booleanToHclTerraform(this._enableDeletionProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retain_all_resources: { + value: cdktf.booleanToHclTerraform(this._retainAllResources), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + template_body: { + value: cdktf.stringToHclTerraform(this._templateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_uri: { + value: cdktf.stringToHclTerraform(this._templateUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vars_body: { + value: cdktf.stringToHclTerraform(this._varsBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vars_uri: { + value: cdktf.stringToHclTerraform(this._varsUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency: { + value: cdktf.listMapperHcl(rfStackAgencyToHclTerraform, true)(this._agency.internalValue), + isBlock: true, + type: "list", + storageClassType: "RfStackAgencyList", + }, + timeouts: { + value: rfStackTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RfStackTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rfs-execution-plan/README.md b/src/constructs/providers/huaweicloud/rfs-execution-plan/README.md new file mode 100644 index 00000000..81d9ad50 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rfs-execution-plan/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rfs_execution_plan` + +Refer to the Terraform Registry for docs: [`huaweicloud_rfs_execution_plan`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan). diff --git a/src/constructs/providers/huaweicloud/rfs-execution-plan/index.ts b/src/constructs/providers/huaweicloud/rfs-execution-plan/index.ts new file mode 100644 index 00000000..0d0c3258 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rfs-execution-plan/index.ts @@ -0,0 +1,378 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RfsExecutionPlanConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the execution plan. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#description RfsExecutionPlan#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#id RfsExecutionPlan#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the execution plan. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#name RfsExecutionPlan#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#region RfsExecutionPlan#region} + */ + readonly region?: string; + /** + * The ID of the resource stack to which the execution plan belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#stack_id RfsExecutionPlan#stack_id} + */ + readonly stackId?: string; + /** + * The name of the resource stack to which the execution plan belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#stack_name RfsExecutionPlan#stack_name} + */ + readonly stackName: string; + /** + * The HCL/JSON template content for deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#template_body RfsExecutionPlan#template_body} + */ + readonly templateBody?: string; + /** + * The OBS address where the HCL/JSON template archive (**.zip** file, which contains all resource **.tf.json** script files to be deployed) or **.tf.json** file is located, which describes the target status of the deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#template_uri RfsExecutionPlan#template_uri} + */ + readonly templateUri?: string; + /** + * The variable content for deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#vars_body RfsExecutionPlan#vars_body} + */ + readonly varsBody?: string; + /** + * The OBS address where the variable (**.tfvars**) file corresponding to the HCL/JSON template located, which describes the target status of the deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#vars_uri RfsExecutionPlan#vars_uri} + */ + readonly varsUri?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan huaweicloud_rfs_execution_plan} +*/ +export class RfsExecutionPlan extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rfs_execution_plan"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RfsExecutionPlan resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RfsExecutionPlan to import + * @param importFromId The id of the existing RfsExecutionPlan that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RfsExecutionPlan to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rfs_execution_plan", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_execution_plan huaweicloud_rfs_execution_plan} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RfsExecutionPlanConfig + */ + public constructor(scope: Construct, id: string, config: RfsExecutionPlanConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rfs_execution_plan', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._stackId = config.stackId; + this._stackName = config.stackName; + this._templateBody = config.templateBody; + this._templateUri = config.templateUri; + this._varsBody = config.varsBody; + this._varsUri = config.varsUri; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stack_id - computed: false, optional: true, required: false + private _stackId?: string; + public get stackId() { + return this.getStringAttribute('stack_id'); + } + public set stackId(value: string) { + this._stackId = value; + } + public resetStackId() { + this._stackId = undefined; + } + // Temporarily expose input value. Use with caution. + public get stackIdInput() { + return this._stackId; + } + + // stack_name - computed: false, optional: false, required: true + private _stackName?: string; + public get stackName() { + return this.getStringAttribute('stack_name'); + } + public set stackName(value: string) { + this._stackName = value; + } + // Temporarily expose input value. Use with caution. + public get stackNameInput() { + return this._stackName; + } + + // template_body - computed: false, optional: true, required: false + private _templateBody?: string; + public get templateBody() { + return this.getStringAttribute('template_body'); + } + public set templateBody(value: string) { + this._templateBody = value; + } + public resetTemplateBody() { + this._templateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateBodyInput() { + return this._templateBody; + } + + // template_uri - computed: false, optional: true, required: false + private _templateUri?: string; + public get templateUri() { + return this.getStringAttribute('template_uri'); + } + public set templateUri(value: string) { + this._templateUri = value; + } + public resetTemplateUri() { + this._templateUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateUriInput() { + return this._templateUri; + } + + // vars_body - computed: false, optional: true, required: false + private _varsBody?: string; + public get varsBody() { + return this.getStringAttribute('vars_body'); + } + public set varsBody(value: string) { + this._varsBody = value; + } + public resetVarsBody() { + this._varsBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsBodyInput() { + return this._varsBody; + } + + // vars_uri - computed: false, optional: true, required: false + private _varsUri?: string; + public get varsUri() { + return this.getStringAttribute('vars_uri'); + } + public set varsUri(value: string) { + this._varsUri = value; + } + public resetVarsUri() { + this._varsUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsUriInput() { + return this._varsUri; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + stack_id: cdktf.stringToTerraform(this._stackId), + stack_name: cdktf.stringToTerraform(this._stackName), + template_body: cdktf.stringToTerraform(this._templateBody), + template_uri: cdktf.stringToTerraform(this._templateUri), + vars_body: cdktf.stringToTerraform(this._varsBody), + vars_uri: cdktf.stringToTerraform(this._varsUri), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stack_id: { + value: cdktf.stringToHclTerraform(this._stackId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stack_name: { + value: cdktf.stringToHclTerraform(this._stackName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_body: { + value: cdktf.stringToHclTerraform(this._templateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_uri: { + value: cdktf.stringToHclTerraform(this._templateUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vars_body: { + value: cdktf.stringToHclTerraform(this._varsBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vars_uri: { + value: cdktf.stringToHclTerraform(this._varsUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rfs-private-hook/README.md b/src/constructs/providers/huaweicloud/rfs-private-hook/README.md new file mode 100644 index 00000000..224a6b7a --- /dev/null +++ b/src/constructs/providers/huaweicloud/rfs-private-hook/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rfs_private_hook` + +Refer to the Terraform Registry for docs: [`huaweicloud_rfs_private_hook`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook). diff --git a/src/constructs/providers/huaweicloud/rfs-private-hook/index.ts b/src/constructs/providers/huaweicloud/rfs-private-hook/index.ts new file mode 100644 index 00000000..05f157a0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rfs-private-hook/index.ts @@ -0,0 +1,511 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RfsPrivateHookConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the private hook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#description RfsPrivateHook#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#id RfsPrivateHook#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether keeping old version while updating hook version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#keep_old_version RfsPrivateHook#keep_old_version} + */ + readonly keepOldVersion?: boolean | cdktf.IResolvable; + /** + * The name of the private hook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#name RfsPrivateHook#name} + */ + readonly name: string; + /** + * The policy content of the private hook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#policy_body RfsPrivateHook#policy_body} + */ + readonly policyBody?: string; + /** + * The OBS address of the policy file. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#policy_uri RfsPrivateHook#policy_uri} + */ + readonly policyUri?: string; + /** + * The region where the private hook is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#region RfsPrivateHook#region} + */ + readonly region?: string; + /** + * The version of the private hook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#version RfsPrivateHook#version} + */ + readonly version: string; + /** + * The description of the private hook version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#version_description RfsPrivateHook#version_description} + */ + readonly versionDescription?: string; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#configuration RfsPrivateHook#configuration} + */ + readonly configuration?: RfsPrivateHookConfiguration; +} +export interface RfsPrivateHookConfiguration { + /** + * The behavior after private hook verification fails. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#failure_mode RfsPrivateHook#failure_mode} + */ + readonly failureMode?: string; + /** + * The target resource stack for the private hook to take effect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#target_stacks RfsPrivateHook#target_stacks} + */ + readonly targetStacks?: string; +} + +export function rfsPrivateHookConfigurationToTerraform(struct?: RfsPrivateHookConfigurationOutputReference | RfsPrivateHookConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + failure_mode: cdktf.stringToTerraform(struct!.failureMode), + target_stacks: cdktf.stringToTerraform(struct!.targetStacks), + } +} + + +export function rfsPrivateHookConfigurationToHclTerraform(struct?: RfsPrivateHookConfigurationOutputReference | RfsPrivateHookConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + failure_mode: { + value: cdktf.stringToHclTerraform(struct!.failureMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_stacks: { + value: cdktf.stringToHclTerraform(struct!.targetStacks), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RfsPrivateHookConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RfsPrivateHookConfiguration | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._failureMode !== undefined) { + hasAnyValues = true; + internalValueResult.failureMode = this._failureMode; + } + if (this._targetStacks !== undefined) { + hasAnyValues = true; + internalValueResult.targetStacks = this._targetStacks; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RfsPrivateHookConfiguration | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._failureMode = undefined; + this._targetStacks = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._failureMode = value.failureMode; + this._targetStacks = value.targetStacks; + } + } + + // failure_mode - computed: true, optional: true, required: false + private _failureMode?: string; + public get failureMode() { + return this.getStringAttribute('failure_mode'); + } + public set failureMode(value: string) { + this._failureMode = value; + } + public resetFailureMode() { + this._failureMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get failureModeInput() { + return this._failureMode; + } + + // target_stacks - computed: true, optional: true, required: false + private _targetStacks?: string; + public get targetStacks() { + return this.getStringAttribute('target_stacks'); + } + public set targetStacks(value: string) { + this._targetStacks = value; + } + public resetTargetStacks() { + this._targetStacks = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetStacksInput() { + return this._targetStacks; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook huaweicloud_rfs_private_hook} +*/ +export class RfsPrivateHook extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rfs_private_hook"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RfsPrivateHook resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RfsPrivateHook to import + * @param importFromId The id of the existing RfsPrivateHook that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RfsPrivateHook to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rfs_private_hook", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_private_hook huaweicloud_rfs_private_hook} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RfsPrivateHookConfig + */ + public constructor(scope: Construct, id: string, config: RfsPrivateHookConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rfs_private_hook', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._keepOldVersion = config.keepOldVersion; + this._name = config.name; + this._policyBody = config.policyBody; + this._policyUri = config.policyUri; + this._region = config.region; + this._version = config.version; + this._versionDescription = config.versionDescription; + this._configuration.internalValue = config.configuration; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keep_old_version - computed: false, optional: true, required: false + private _keepOldVersion?: boolean | cdktf.IResolvable; + public get keepOldVersion() { + return this.getBooleanAttribute('keep_old_version'); + } + public set keepOldVersion(value: boolean | cdktf.IResolvable) { + this._keepOldVersion = value; + } + public resetKeepOldVersion() { + this._keepOldVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepOldVersionInput() { + return this._keepOldVersion; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_body - computed: false, optional: true, required: false + private _policyBody?: string; + public get policyBody() { + return this.getStringAttribute('policy_body'); + } + public set policyBody(value: string) { + this._policyBody = value; + } + public resetPolicyBody() { + this._policyBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyBodyInput() { + return this._policyBody; + } + + // policy_uri - computed: false, optional: true, required: false + private _policyUri?: string; + public get policyUri() { + return this.getStringAttribute('policy_uri'); + } + public set policyUri(value: string) { + this._policyUri = value; + } + public resetPolicyUri() { + this._policyUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyUriInput() { + return this._policyUri; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // version_description - computed: false, optional: true, required: false + private _versionDescription?: string; + public get versionDescription() { + return this.getStringAttribute('version_description'); + } + public set versionDescription(value: string) { + this._versionDescription = value; + } + public resetVersionDescription() { + this._versionDescription = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionDescriptionInput() { + return this._versionDescription; + } + + // configuration - computed: false, optional: true, required: false + private _configuration = new RfsPrivateHookConfigurationOutputReference(this, "configuration"); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: RfsPrivateHookConfiguration) { + this._configuration.internalValue = value; + } + public resetConfiguration() { + this._configuration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + keep_old_version: cdktf.booleanToTerraform(this._keepOldVersion), + name: cdktf.stringToTerraform(this._name), + policy_body: cdktf.stringToTerraform(this._policyBody), + policy_uri: cdktf.stringToTerraform(this._policyUri), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + version_description: cdktf.stringToTerraform(this._versionDescription), + configuration: rfsPrivateHookConfigurationToTerraform(this._configuration.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_old_version: { + value: cdktf.booleanToHclTerraform(this._keepOldVersion), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_body: { + value: cdktf.stringToHclTerraform(this._policyBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_uri: { + value: cdktf.stringToHclTerraform(this._policyUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_description: { + value: cdktf.stringToHclTerraform(this._versionDescription), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + configuration: { + value: rfsPrivateHookConfigurationToHclTerraform(this._configuration.internalValue), + isBlock: true, + type: "list", + storageClassType: "RfsPrivateHookConfigurationList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rfs-stack/README.md b/src/constructs/providers/huaweicloud/rfs-stack/README.md new file mode 100644 index 00000000..b99ba73b --- /dev/null +++ b/src/constructs/providers/huaweicloud/rfs-stack/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rfs_stack` + +Refer to the Terraform Registry for docs: [`huaweicloud_rfs_stack`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack). diff --git a/src/constructs/providers/huaweicloud/rfs-stack/index.ts b/src/constructs/providers/huaweicloud/rfs-stack/index.ts new file mode 100644 index 00000000..a56628ae --- /dev/null +++ b/src/constructs/providers/huaweicloud/rfs-stack/index.ts @@ -0,0 +1,801 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RfsStackConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the resource stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#description RfsStack#description} + */ + readonly description?: string; + /** + * Whether to enable automatic rollback. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#enable_auto_rollback RfsStack#enable_auto_rollback} + */ + readonly enableAutoRollback?: boolean | cdktf.IResolvable; + /** + * Whether to enable delete protection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#enable_deletion_protection RfsStack#enable_deletion_protection} + */ + readonly enableDeletionProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#id RfsStack#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the resource stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#name RfsStack#name} + */ + readonly name: string; + /** + * The region where the RFS resource stack is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#region RfsStack#region} + */ + readonly region?: string; + /** + * Whether to reserve resources when deleting the resource stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#retain_all_resources RfsStack#retain_all_resources} + */ + readonly retainAllResources?: boolean | cdktf.IResolvable; + /** + * The HCL/JSON template content for deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#template_body RfsStack#template_body} + */ + readonly templateBody?: string; + /** + * The OBS address where the HCL/JSON template archive (**.zip** file, which contains all resource **.tf.json** script files to be deployed) or **.tf.json** file is located, which describes the target status of the deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#template_uri RfsStack#template_uri} + */ + readonly templateUri?: string; + /** + * The variable content for deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#vars_body RfsStack#vars_body} + */ + readonly varsBody?: string; + /** + * The OBS address where the variable (**.tfvars**) file corresponding to the HCL/JSON template located, which describes the target status of the deployment resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#vars_uri RfsStack#vars_uri} + */ + readonly varsUri?: string; + /** + * agency block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#agency RfsStack#agency} + */ + readonly agency?: RfsStackAgency[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#timeouts RfsStack#timeouts} + */ + readonly timeouts?: RfsStackTimeouts; +} +export interface RfsStackAgency { + /** + * The name of IAM agency authorized to IAC account for resources modification. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#name RfsStack#name} + */ + readonly name?: string; + /** + * The name of the provider corresponding to the IAM agency. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#provider_name RfsStack#provider_name} + */ + readonly providerName?: string; +} + +export function rfsStackAgencyToTerraform(struct?: RfsStackAgency | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + provider_name: cdktf.stringToTerraform(struct!.providerName), + } +} + + +export function rfsStackAgencyToHclTerraform(struct?: RfsStackAgency | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + provider_name: { + value: cdktf.stringToHclTerraform(struct!.providerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RfsStackAgencyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RfsStackAgency | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._providerName !== undefined) { + hasAnyValues = true; + internalValueResult.providerName = this._providerName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RfsStackAgency | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._providerName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._providerName = value.providerName; + } + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // provider_name - computed: false, optional: true, required: false + private _providerName?: string; + public get providerName() { + return this.getStringAttribute('provider_name'); + } + public set providerName(value: string) { + this._providerName = value; + } + public resetProviderName() { + this._providerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get providerNameInput() { + return this._providerName; + } +} + +export class RfsStackAgencyList extends cdktf.ComplexList { + public internalValue? : RfsStackAgency[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RfsStackAgencyOutputReference { + return new RfsStackAgencyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RfsStackTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#create RfsStack#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#delete RfsStack#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#update RfsStack#update} + */ + readonly update?: string; +} + +export function rfsStackTimeoutsToTerraform(struct?: RfsStackTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rfsStackTimeoutsToHclTerraform(struct?: RfsStackTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RfsStackTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RfsStackTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RfsStackTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack huaweicloud_rfs_stack} +*/ +export class RfsStack extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rfs_stack"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RfsStack resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RfsStack to import + * @param importFromId The id of the existing RfsStack that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RfsStack to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rfs_stack", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rfs_stack huaweicloud_rfs_stack} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RfsStackConfig + */ + public constructor(scope: Construct, id: string, config: RfsStackConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rfs_stack', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableAutoRollback = config.enableAutoRollback; + this._enableDeletionProtection = config.enableDeletionProtection; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._retainAllResources = config.retainAllResources; + this._templateBody = config.templateBody; + this._templateUri = config.templateUri; + this._varsBody = config.varsBody; + this._varsUri = config.varsUri; + this._agency.internalValue = config.agency; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_auto_rollback - computed: false, optional: true, required: false + private _enableAutoRollback?: boolean | cdktf.IResolvable; + public get enableAutoRollback() { + return this.getBooleanAttribute('enable_auto_rollback'); + } + public set enableAutoRollback(value: boolean | cdktf.IResolvable) { + this._enableAutoRollback = value; + } + public resetEnableAutoRollback() { + this._enableAutoRollback = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableAutoRollbackInput() { + return this._enableAutoRollback; + } + + // enable_deletion_protection - computed: false, optional: true, required: false + private _enableDeletionProtection?: boolean | cdktf.IResolvable; + public get enableDeletionProtection() { + return this.getBooleanAttribute('enable_deletion_protection'); + } + public set enableDeletionProtection(value: boolean | cdktf.IResolvable) { + this._enableDeletionProtection = value; + } + public resetEnableDeletionProtection() { + this._enableDeletionProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDeletionProtectionInput() { + return this._enableDeletionProtection; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retain_all_resources - computed: false, optional: true, required: false + private _retainAllResources?: boolean | cdktf.IResolvable; + public get retainAllResources() { + return this.getBooleanAttribute('retain_all_resources'); + } + public set retainAllResources(value: boolean | cdktf.IResolvable) { + this._retainAllResources = value; + } + public resetRetainAllResources() { + this._retainAllResources = undefined; + } + // Temporarily expose input value. Use with caution. + public get retainAllResourcesInput() { + return this._retainAllResources; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // template_body - computed: false, optional: true, required: false + private _templateBody?: string; + public get templateBody() { + return this.getStringAttribute('template_body'); + } + public set templateBody(value: string) { + this._templateBody = value; + } + public resetTemplateBody() { + this._templateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateBodyInput() { + return this._templateBody; + } + + // template_uri - computed: false, optional: true, required: false + private _templateUri?: string; + public get templateUri() { + return this.getStringAttribute('template_uri'); + } + public set templateUri(value: string) { + this._templateUri = value; + } + public resetTemplateUri() { + this._templateUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateUriInput() { + return this._templateUri; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vars_body - computed: false, optional: true, required: false + private _varsBody?: string; + public get varsBody() { + return this.getStringAttribute('vars_body'); + } + public set varsBody(value: string) { + this._varsBody = value; + } + public resetVarsBody() { + this._varsBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsBodyInput() { + return this._varsBody; + } + + // vars_uri - computed: false, optional: true, required: false + private _varsUri?: string; + public get varsUri() { + return this.getStringAttribute('vars_uri'); + } + public set varsUri(value: string) { + this._varsUri = value; + } + public resetVarsUri() { + this._varsUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsUriInput() { + return this._varsUri; + } + + // agency - computed: false, optional: true, required: false + private _agency = new RfsStackAgencyList(this, "agency", false); + public get agency() { + return this._agency; + } + public putAgency(value: RfsStackAgency[] | cdktf.IResolvable) { + this._agency.internalValue = value; + } + public resetAgency() { + this._agency.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyInput() { + return this._agency.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RfsStackTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RfsStackTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_auto_rollback: cdktf.booleanToTerraform(this._enableAutoRollback), + enable_deletion_protection: cdktf.booleanToTerraform(this._enableDeletionProtection), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + retain_all_resources: cdktf.booleanToTerraform(this._retainAllResources), + template_body: cdktf.stringToTerraform(this._templateBody), + template_uri: cdktf.stringToTerraform(this._templateUri), + vars_body: cdktf.stringToTerraform(this._varsBody), + vars_uri: cdktf.stringToTerraform(this._varsUri), + agency: cdktf.listMapper(rfsStackAgencyToTerraform, true)(this._agency.internalValue), + timeouts: rfsStackTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_auto_rollback: { + value: cdktf.booleanToHclTerraform(this._enableAutoRollback), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_deletion_protection: { + value: cdktf.booleanToHclTerraform(this._enableDeletionProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retain_all_resources: { + value: cdktf.booleanToHclTerraform(this._retainAllResources), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + template_body: { + value: cdktf.stringToHclTerraform(this._templateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_uri: { + value: cdktf.stringToHclTerraform(this._templateUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vars_body: { + value: cdktf.stringToHclTerraform(this._varsBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vars_uri: { + value: cdktf.stringToHclTerraform(this._varsUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + agency: { + value: cdktf.listMapperHcl(rfsStackAgencyToHclTerraform, true)(this._agency.internalValue), + isBlock: true, + type: "list", + storageClassType: "RfsStackAgencyList", + }, + timeouts: { + value: rfsStackTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RfsStackTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rgc-account/README.md b/src/constructs/providers/huaweicloud/rgc-account/README.md new file mode 100644 index 00000000..6ec0e64e --- /dev/null +++ b/src/constructs/providers/huaweicloud/rgc-account/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rgc_account` + +Refer to the Terraform Registry for docs: [`huaweicloud_rgc_account`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account). diff --git a/src/constructs/providers/huaweicloud/rgc-account/index.ts b/src/constructs/providers/huaweicloud/rgc-account/index.ts new file mode 100644 index 00000000..c4f54be2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rgc-account/index.ts @@ -0,0 +1,679 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RgcAccountConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#email RgcAccount#email} + */ + readonly email: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#id RgcAccount#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#identity_store_email RgcAccount#identity_store_email} + */ + readonly identityStoreEmail: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#identity_store_user_name RgcAccount#identity_store_user_name} + */ + readonly identityStoreUserName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#name RgcAccount#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#parent_organizational_unit_id RgcAccount#parent_organizational_unit_id} + */ + readonly parentOrganizationalUnitId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#parent_organizational_unit_name RgcAccount#parent_organizational_unit_name} + */ + readonly parentOrganizationalUnitName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#phone RgcAccount#phone} + */ + readonly phone?: string; + /** + * blueprint block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#blueprint RgcAccount#blueprint} + */ + readonly blueprint?: RgcAccountBlueprint; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#timeouts RgcAccount#timeouts} + */ + readonly timeouts?: RgcAccountTimeouts; +} +export interface RgcAccountBlueprint { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#blueprint_product_id RgcAccount#blueprint_product_id} + */ + readonly blueprintProductId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#blueprint_product_version RgcAccount#blueprint_product_version} + */ + readonly blueprintProductVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#is_blueprint_has_multi_account_resource RgcAccount#is_blueprint_has_multi_account_resource} + */ + readonly isBlueprintHasMultiAccountResource?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#variables RgcAccount#variables} + */ + readonly variables?: string; +} + +export function rgcAccountBlueprintToTerraform(struct?: RgcAccountBlueprintOutputReference | RgcAccountBlueprint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + blueprint_product_id: cdktf.stringToTerraform(struct!.blueprintProductId), + blueprint_product_version: cdktf.stringToTerraform(struct!.blueprintProductVersion), + is_blueprint_has_multi_account_resource: cdktf.booleanToTerraform(struct!.isBlueprintHasMultiAccountResource), + variables: cdktf.stringToTerraform(struct!.variables), + } +} + + +export function rgcAccountBlueprintToHclTerraform(struct?: RgcAccountBlueprintOutputReference | RgcAccountBlueprint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + blueprint_product_id: { + value: cdktf.stringToHclTerraform(struct!.blueprintProductId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + blueprint_product_version: { + value: cdktf.stringToHclTerraform(struct!.blueprintProductVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_blueprint_has_multi_account_resource: { + value: cdktf.booleanToHclTerraform(struct!.isBlueprintHasMultiAccountResource), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + variables: { + value: cdktf.stringToHclTerraform(struct!.variables), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RgcAccountBlueprintOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RgcAccountBlueprint | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blueprintProductId !== undefined) { + hasAnyValues = true; + internalValueResult.blueprintProductId = this._blueprintProductId; + } + if (this._blueprintProductVersion !== undefined) { + hasAnyValues = true; + internalValueResult.blueprintProductVersion = this._blueprintProductVersion; + } + if (this._isBlueprintHasMultiAccountResource !== undefined) { + hasAnyValues = true; + internalValueResult.isBlueprintHasMultiAccountResource = this._isBlueprintHasMultiAccountResource; + } + if (this._variables !== undefined) { + hasAnyValues = true; + internalValueResult.variables = this._variables; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RgcAccountBlueprint | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blueprintProductId = undefined; + this._blueprintProductVersion = undefined; + this._isBlueprintHasMultiAccountResource = undefined; + this._variables = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blueprintProductId = value.blueprintProductId; + this._blueprintProductVersion = value.blueprintProductVersion; + this._isBlueprintHasMultiAccountResource = value.isBlueprintHasMultiAccountResource; + this._variables = value.variables; + } + } + + // blueprint_product_id - computed: false, optional: true, required: false + private _blueprintProductId?: string; + public get blueprintProductId() { + return this.getStringAttribute('blueprint_product_id'); + } + public set blueprintProductId(value: string) { + this._blueprintProductId = value; + } + public resetBlueprintProductId() { + this._blueprintProductId = undefined; + } + // Temporarily expose input value. Use with caution. + public get blueprintProductIdInput() { + return this._blueprintProductId; + } + + // blueprint_product_version - computed: false, optional: true, required: false + private _blueprintProductVersion?: string; + public get blueprintProductVersion() { + return this.getStringAttribute('blueprint_product_version'); + } + public set blueprintProductVersion(value: string) { + this._blueprintProductVersion = value; + } + public resetBlueprintProductVersion() { + this._blueprintProductVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get blueprintProductVersionInput() { + return this._blueprintProductVersion; + } + + // is_blueprint_has_multi_account_resource - computed: false, optional: true, required: false + private _isBlueprintHasMultiAccountResource?: boolean | cdktf.IResolvable; + public get isBlueprintHasMultiAccountResource() { + return this.getBooleanAttribute('is_blueprint_has_multi_account_resource'); + } + public set isBlueprintHasMultiAccountResource(value: boolean | cdktf.IResolvable) { + this._isBlueprintHasMultiAccountResource = value; + } + public resetIsBlueprintHasMultiAccountResource() { + this._isBlueprintHasMultiAccountResource = undefined; + } + // Temporarily expose input value. Use with caution. + public get isBlueprintHasMultiAccountResourceInput() { + return this._isBlueprintHasMultiAccountResource; + } + + // variables - computed: false, optional: true, required: false + private _variables?: string; + public get variables() { + return this.getStringAttribute('variables'); + } + public set variables(value: string) { + this._variables = value; + } + public resetVariables() { + this._variables = undefined; + } + // Temporarily expose input value. Use with caution. + public get variablesInput() { + return this._variables; + } +} +export interface RgcAccountTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#create RgcAccount#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#delete RgcAccount#delete} + */ + readonly delete?: string; +} + +export function rgcAccountTimeoutsToTerraform(struct?: RgcAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rgcAccountTimeoutsToHclTerraform(struct?: RgcAccountTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RgcAccountTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RgcAccountTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RgcAccountTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account huaweicloud_rgc_account} +*/ +export class RgcAccount extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rgc_account"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RgcAccount resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RgcAccount to import + * @param importFromId The id of the existing RgcAccount that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RgcAccount to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rgc_account", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rgc_account huaweicloud_rgc_account} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RgcAccountConfig + */ + public constructor(scope: Construct, id: string, config: RgcAccountConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rgc_account', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._email = config.email; + this._id = config.id; + this._identityStoreEmail = config.identityStoreEmail; + this._identityStoreUserName = config.identityStoreUserName; + this._name = config.name; + this._parentOrganizationalUnitId = config.parentOrganizationalUnitId; + this._parentOrganizationalUnitName = config.parentOrganizationalUnitName; + this._phone = config.phone; + this._blueprint.internalValue = config.blueprint; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // email - computed: false, optional: false, required: true + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // identity_store_email - computed: false, optional: false, required: true + private _identityStoreEmail?: string; + public get identityStoreEmail() { + return this.getStringAttribute('identity_store_email'); + } + public set identityStoreEmail(value: string) { + this._identityStoreEmail = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreEmailInput() { + return this._identityStoreEmail; + } + + // identity_store_user_name - computed: false, optional: false, required: true + private _identityStoreUserName?: string; + public get identityStoreUserName() { + return this.getStringAttribute('identity_store_user_name'); + } + public set identityStoreUserName(value: string) { + this._identityStoreUserName = value; + } + // Temporarily expose input value. Use with caution. + public get identityStoreUserNameInput() { + return this._identityStoreUserName; + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // joined_method - computed: true, optional: false, required: false + public get joinedMethod() { + return this.getStringAttribute('joined_method'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_organizational_unit_id - computed: false, optional: false, required: true + private _parentOrganizationalUnitId?: string; + public get parentOrganizationalUnitId() { + return this.getStringAttribute('parent_organizational_unit_id'); + } + public set parentOrganizationalUnitId(value: string) { + this._parentOrganizationalUnitId = value; + } + // Temporarily expose input value. Use with caution. + public get parentOrganizationalUnitIdInput() { + return this._parentOrganizationalUnitId; + } + + // parent_organizational_unit_name - computed: false, optional: false, required: true + private _parentOrganizationalUnitName?: string; + public get parentOrganizationalUnitName() { + return this.getStringAttribute('parent_organizational_unit_name'); + } + public set parentOrganizationalUnitName(value: string) { + this._parentOrganizationalUnitName = value; + } + // Temporarily expose input value. Use with caution. + public get parentOrganizationalUnitNameInput() { + return this._parentOrganizationalUnitName; + } + + // phone - computed: false, optional: true, required: false + private _phone?: string; + public get phone() { + return this.getStringAttribute('phone'); + } + public set phone(value: string) { + this._phone = value; + } + public resetPhone() { + this._phone = undefined; + } + // Temporarily expose input value. Use with caution. + public get phoneInput() { + return this._phone; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // blueprint - computed: false, optional: true, required: false + private _blueprint = new RgcAccountBlueprintOutputReference(this, "blueprint"); + public get blueprint() { + return this._blueprint; + } + public putBlueprint(value: RgcAccountBlueprint) { + this._blueprint.internalValue = value; + } + public resetBlueprint() { + this._blueprint.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get blueprintInput() { + return this._blueprint.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RgcAccountTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RgcAccountTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + email: cdktf.stringToTerraform(this._email), + id: cdktf.stringToTerraform(this._id), + identity_store_email: cdktf.stringToTerraform(this._identityStoreEmail), + identity_store_user_name: cdktf.stringToTerraform(this._identityStoreUserName), + name: cdktf.stringToTerraform(this._name), + parent_organizational_unit_id: cdktf.stringToTerraform(this._parentOrganizationalUnitId), + parent_organizational_unit_name: cdktf.stringToTerraform(this._parentOrganizationalUnitName), + phone: cdktf.stringToTerraform(this._phone), + blueprint: rgcAccountBlueprintToTerraform(this._blueprint.internalValue), + timeouts: rgcAccountTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_email: { + value: cdktf.stringToHclTerraform(this._identityStoreEmail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + identity_store_user_name: { + value: cdktf.stringToHclTerraform(this._identityStoreUserName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_organizational_unit_id: { + value: cdktf.stringToHclTerraform(this._parentOrganizationalUnitId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_organizational_unit_name: { + value: cdktf.stringToHclTerraform(this._parentOrganizationalUnitName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phone: { + value: cdktf.stringToHclTerraform(this._phone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + blueprint: { + value: rgcAccountBlueprintToHclTerraform(this._blueprint.internalValue), + isBlock: true, + type: "list", + storageClassType: "RgcAccountBlueprintList", + }, + timeouts: { + value: rgcAccountTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RgcAccountTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-advanced-query/README.md b/src/constructs/providers/huaweicloud/rms-advanced-query/README.md new file mode 100644 index 00000000..c4fcde40 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-advanced-query/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_advanced_query` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_advanced_query`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query). diff --git a/src/constructs/providers/huaweicloud/rms-advanced-query/index.ts b/src/constructs/providers/huaweicloud/rms-advanced-query/index.ts new file mode 100644 index 00000000..0a737ece --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-advanced-query/index.ts @@ -0,0 +1,200 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsAdvancedQueryConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ResourceQL description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query#description RmsAdvancedQuery#description} + */ + readonly description?: string; + /** + * Specifies the ResourceQL expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query#expression RmsAdvancedQuery#expression} + */ + readonly expression: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query#id RmsAdvancedQuery#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ResourceQL name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query#name RmsAdvancedQuery#name} + */ + readonly name: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query huaweicloud_rms_advanced_query} +*/ +export class RmsAdvancedQuery extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_advanced_query"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsAdvancedQuery resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsAdvancedQuery to import + * @param importFromId The id of the existing RmsAdvancedQuery that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsAdvancedQuery to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_advanced_query", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_advanced_query huaweicloud_rms_advanced_query} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsAdvancedQueryConfig + */ + public constructor(scope: Construct, id: string, config: RmsAdvancedQueryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_advanced_query', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._expression = config.expression; + this._id = config.id; + this._name = config.name; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + expression: cdktf.stringToTerraform(this._expression), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression: { + value: cdktf.stringToHclTerraform(this._expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-assignment-package/README.md b/src/constructs/providers/huaweicloud/rms-assignment-package/README.md new file mode 100644 index 00000000..eaf5a74b --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-assignment-package/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_assignment_package` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_assignment_package`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package). diff --git a/src/constructs/providers/huaweicloud/rms-assignment-package/index.ts b/src/constructs/providers/huaweicloud/rms-assignment-package/index.ts new file mode 100644 index 00000000..96897bf4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-assignment-package/index.ts @@ -0,0 +1,623 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsAssignmentPackageConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the agency name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#agency_name RmsAssignmentPackage#agency_name} + */ + readonly agencyName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#id RmsAssignmentPackage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the assignment package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#name RmsAssignmentPackage#name} + */ + readonly name: string; + /** + * Specifies the content of a custom assignment package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#template_body RmsAssignmentPackage#template_body} + */ + readonly templateBody?: string; + /** + * Specifies the name of a built-in assignment package template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#template_key RmsAssignmentPackage#template_key} + */ + readonly templateKey?: string; + /** + * Specifies the URL address of the OBS bucket where an assignment package template was stored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#template_uri RmsAssignmentPackage#template_uri} + */ + readonly templateUri?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#timeouts RmsAssignmentPackage#timeouts} + */ + readonly timeouts?: RmsAssignmentPackageTimeouts; + /** + * vars_structure block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#vars_structure RmsAssignmentPackage#vars_structure} + */ + readonly varsStructure?: RmsAssignmentPackageVarsStructure[] | cdktf.IResolvable; +} +export interface RmsAssignmentPackageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#create RmsAssignmentPackage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#delete RmsAssignmentPackage#delete} + */ + readonly delete?: string; +} + +export function rmsAssignmentPackageTimeoutsToTerraform(struct?: RmsAssignmentPackageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rmsAssignmentPackageTimeoutsToHclTerraform(struct?: RmsAssignmentPackageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsAssignmentPackageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RmsAssignmentPackageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsAssignmentPackageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} +export interface RmsAssignmentPackageVarsStructure { + /** + * Specifies the name of a parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#var_key RmsAssignmentPackage#var_key} + */ + readonly varKey?: string; + /** + * Specifies the value of a parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#var_value RmsAssignmentPackage#var_value} + */ + readonly varValue?: string; +} + +export function rmsAssignmentPackageVarsStructureToTerraform(struct?: RmsAssignmentPackageVarsStructure | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + var_key: cdktf.stringToTerraform(struct!.varKey), + var_value: cdktf.stringToTerraform(struct!.varValue), + } +} + + +export function rmsAssignmentPackageVarsStructureToHclTerraform(struct?: RmsAssignmentPackageVarsStructure | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + var_key: { + value: cdktf.stringToHclTerraform(struct!.varKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + var_value: { + value: cdktf.stringToHclTerraform(struct!.varValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsAssignmentPackageVarsStructureOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RmsAssignmentPackageVarsStructure | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._varKey !== undefined) { + hasAnyValues = true; + internalValueResult.varKey = this._varKey; + } + if (this._varValue !== undefined) { + hasAnyValues = true; + internalValueResult.varValue = this._varValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsAssignmentPackageVarsStructure | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._varKey = undefined; + this._varValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._varKey = value.varKey; + this._varValue = value.varValue; + } + } + + // var_key - computed: true, optional: true, required: false + private _varKey?: string; + public get varKey() { + return this.getStringAttribute('var_key'); + } + public set varKey(value: string) { + this._varKey = value; + } + public resetVarKey() { + this._varKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get varKeyInput() { + return this._varKey; + } + + // var_value - computed: true, optional: true, required: false + private _varValue?: string; + public get varValue() { + return this.getStringAttribute('var_value'); + } + public set varValue(value: string) { + this._varValue = value; + } + public resetVarValue() { + this._varValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get varValueInput() { + return this._varValue; + } +} + +export class RmsAssignmentPackageVarsStructureList extends cdktf.ComplexList { + public internalValue? : RmsAssignmentPackageVarsStructure[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RmsAssignmentPackageVarsStructureOutputReference { + return new RmsAssignmentPackageVarsStructureOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package huaweicloud_rms_assignment_package} +*/ +export class RmsAssignmentPackage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_assignment_package"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsAssignmentPackage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsAssignmentPackage to import + * @param importFromId The id of the existing RmsAssignmentPackage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsAssignmentPackage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_assignment_package", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_assignment_package huaweicloud_rms_assignment_package} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsAssignmentPackageConfig + */ + public constructor(scope: Construct, id: string, config: RmsAssignmentPackageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_assignment_package', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._id = config.id; + this._name = config.name; + this._templateBody = config.templateBody; + this._templateKey = config.templateKey; + this._templateUri = config.templateUri; + this._timeouts.internalValue = config.timeouts; + this._varsStructure.internalValue = config.varsStructure; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: true, optional: true, required: false + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + public resetAgencyName() { + this._agencyName = undefined; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // deployment_id - computed: true, optional: false, required: false + public get deploymentId() { + return this.getStringAttribute('deployment_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // stack_id - computed: true, optional: false, required: false + public get stackId() { + return this.getStringAttribute('stack_id'); + } + + // stack_name - computed: true, optional: false, required: false + public get stackName() { + return this.getStringAttribute('stack_name'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // template_body - computed: true, optional: true, required: false + private _templateBody?: string; + public get templateBody() { + return this.getStringAttribute('template_body'); + } + public set templateBody(value: string) { + this._templateBody = value; + } + public resetTemplateBody() { + this._templateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateBodyInput() { + return this._templateBody; + } + + // template_key - computed: true, optional: true, required: false + private _templateKey?: string; + public get templateKey() { + return this.getStringAttribute('template_key'); + } + public set templateKey(value: string) { + this._templateKey = value; + } + public resetTemplateKey() { + this._templateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateKeyInput() { + return this._templateKey; + } + + // template_uri - computed: true, optional: true, required: false + private _templateUri?: string; + public get templateUri() { + return this.getStringAttribute('template_uri'); + } + public set templateUri(value: string) { + this._templateUri = value; + } + public resetTemplateUri() { + this._templateUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateUriInput() { + return this._templateUri; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RmsAssignmentPackageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RmsAssignmentPackageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // vars_structure - computed: false, optional: true, required: false + private _varsStructure = new RmsAssignmentPackageVarsStructureList(this, "vars_structure", true); + public get varsStructure() { + return this._varsStructure; + } + public putVarsStructure(value: RmsAssignmentPackageVarsStructure[] | cdktf.IResolvable) { + this._varsStructure.internalValue = value; + } + public resetVarsStructure() { + this._varsStructure.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsStructureInput() { + return this._varsStructure.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + template_body: cdktf.stringToTerraform(this._templateBody), + template_key: cdktf.stringToTerraform(this._templateKey), + template_uri: cdktf.stringToTerraform(this._templateUri), + timeouts: rmsAssignmentPackageTimeoutsToTerraform(this._timeouts.internalValue), + vars_structure: cdktf.listMapper(rmsAssignmentPackageVarsStructureToTerraform, true)(this._varsStructure.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_body: { + value: cdktf.stringToHclTerraform(this._templateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_key: { + value: cdktf.stringToHclTerraform(this._templateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_uri: { + value: cdktf.stringToHclTerraform(this._templateUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rmsAssignmentPackageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RmsAssignmentPackageTimeouts", + }, + vars_structure: { + value: cdktf.listMapperHcl(rmsAssignmentPackageVarsStructureToHclTerraform, true)(this._varsStructure.internalValue), + isBlock: true, + type: "set", + storageClassType: "RmsAssignmentPackageVarsStructureList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-organizational-assignment-package/README.md b/src/constructs/providers/huaweicloud/rms-organizational-assignment-package/README.md new file mode 100644 index 00000000..99ef14fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-organizational-assignment-package/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_organizational_assignment_package` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_organizational_assignment_package`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package). diff --git a/src/constructs/providers/huaweicloud/rms-organizational-assignment-package/index.ts b/src/constructs/providers/huaweicloud/rms-organizational-assignment-package/index.ts new file mode 100644 index 00000000..086261cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-organizational-assignment-package/index.ts @@ -0,0 +1,650 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsOrganizationalAssignmentPackageConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the excluded accounts for conformance package deployment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#excluded_accounts RmsOrganizationalAssignmentPackage#excluded_accounts} + */ + readonly excludedAccounts?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#id RmsOrganizationalAssignmentPackage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the assignment package name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#name RmsOrganizationalAssignmentPackage#name} + */ + readonly name: string; + /** + * Specifies the ID of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#organization_id RmsOrganizationalAssignmentPackage#organization_id} + */ + readonly organizationId: string; + /** + * Specifies the content of a custom assignment package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#template_body RmsOrganizationalAssignmentPackage#template_body} + */ + readonly templateBody?: string; + /** + * Specifies the name of a predefined conformance package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#template_key RmsOrganizationalAssignmentPackage#template_key} + */ + readonly templateKey?: string; + /** + * Specifies the OBS address of a conformance package. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#template_uri RmsOrganizationalAssignmentPackage#template_uri} + */ + readonly templateUri?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#timeouts RmsOrganizationalAssignmentPackage#timeouts} + */ + readonly timeouts?: RmsOrganizationalAssignmentPackageTimeouts; + /** + * vars_structure block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#vars_structure RmsOrganizationalAssignmentPackage#vars_structure} + */ + readonly varsStructure?: RmsOrganizationalAssignmentPackageVarsStructure[] | cdktf.IResolvable; +} +export interface RmsOrganizationalAssignmentPackageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#create RmsOrganizationalAssignmentPackage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#delete RmsOrganizationalAssignmentPackage#delete} + */ + readonly delete?: string; +} + +export function rmsOrganizationalAssignmentPackageTimeoutsToTerraform(struct?: RmsOrganizationalAssignmentPackageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function rmsOrganizationalAssignmentPackageTimeoutsToHclTerraform(struct?: RmsOrganizationalAssignmentPackageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsOrganizationalAssignmentPackageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RmsOrganizationalAssignmentPackageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsOrganizationalAssignmentPackageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} +export interface RmsOrganizationalAssignmentPackageVarsStructure { + /** + * Specifies the name of a parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#var_key RmsOrganizationalAssignmentPackage#var_key} + */ + readonly varKey?: string; + /** + * Specifies the value of a parameter. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#var_value RmsOrganizationalAssignmentPackage#var_value} + */ + readonly varValue?: string; +} + +export function rmsOrganizationalAssignmentPackageVarsStructureToTerraform(struct?: RmsOrganizationalAssignmentPackageVarsStructure | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + var_key: cdktf.stringToTerraform(struct!.varKey), + var_value: cdktf.stringToTerraform(struct!.varValue), + } +} + + +export function rmsOrganizationalAssignmentPackageVarsStructureToHclTerraform(struct?: RmsOrganizationalAssignmentPackageVarsStructure | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + var_key: { + value: cdktf.stringToHclTerraform(struct!.varKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + var_value: { + value: cdktf.stringToHclTerraform(struct!.varValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsOrganizationalAssignmentPackageVarsStructureOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RmsOrganizationalAssignmentPackageVarsStructure | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._varKey !== undefined) { + hasAnyValues = true; + internalValueResult.varKey = this._varKey; + } + if (this._varValue !== undefined) { + hasAnyValues = true; + internalValueResult.varValue = this._varValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsOrganizationalAssignmentPackageVarsStructure | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._varKey = undefined; + this._varValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._varKey = value.varKey; + this._varValue = value.varValue; + } + } + + // var_key - computed: true, optional: true, required: false + private _varKey?: string; + public get varKey() { + return this.getStringAttribute('var_key'); + } + public set varKey(value: string) { + this._varKey = value; + } + public resetVarKey() { + this._varKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get varKeyInput() { + return this._varKey; + } + + // var_value - computed: true, optional: true, required: false + private _varValue?: string; + public get varValue() { + return this.getStringAttribute('var_value'); + } + public set varValue(value: string) { + this._varValue = value; + } + public resetVarValue() { + this._varValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get varValueInput() { + return this._varValue; + } +} + +export class RmsOrganizationalAssignmentPackageVarsStructureList extends cdktf.ComplexList { + public internalValue? : RmsOrganizationalAssignmentPackageVarsStructure[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RmsOrganizationalAssignmentPackageVarsStructureOutputReference { + return new RmsOrganizationalAssignmentPackageVarsStructureOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package huaweicloud_rms_organizational_assignment_package} +*/ +export class RmsOrganizationalAssignmentPackage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_organizational_assignment_package"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsOrganizationalAssignmentPackage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsOrganizationalAssignmentPackage to import + * @param importFromId The id of the existing RmsOrganizationalAssignmentPackage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsOrganizationalAssignmentPackage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_organizational_assignment_package", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_assignment_package huaweicloud_rms_organizational_assignment_package} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsOrganizationalAssignmentPackageConfig + */ + public constructor(scope: Construct, id: string, config: RmsOrganizationalAssignmentPackageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_organizational_assignment_package', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._excludedAccounts = config.excludedAccounts; + this._id = config.id; + this._name = config.name; + this._organizationId = config.organizationId; + this._templateBody = config.templateBody; + this._templateKey = config.templateKey; + this._templateUri = config.templateUri; + this._timeouts.internalValue = config.timeouts; + this._varsStructure.internalValue = config.varsStructure; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // excluded_accounts - computed: true, optional: true, required: false + private _excludedAccounts?: string[]; + public get excludedAccounts() { + return this.getListAttribute('excluded_accounts'); + } + public set excludedAccounts(value: string[]) { + this._excludedAccounts = value; + } + public resetExcludedAccounts() { + this._excludedAccounts = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludedAccountsInput() { + return this._excludedAccounts; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // org_conformance_pack_urn - computed: true, optional: false, required: false + public get orgConformancePackUrn() { + return this.getStringAttribute('org_conformance_pack_urn'); + } + + // organization_id - computed: false, optional: false, required: true + private _organizationId?: string; + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + public set organizationId(value: string) { + this._organizationId = value; + } + // Temporarily expose input value. Use with caution. + public get organizationIdInput() { + return this._organizationId; + } + + // owner_id - computed: true, optional: false, required: false + public get ownerId() { + return this.getStringAttribute('owner_id'); + } + + // template_body - computed: true, optional: true, required: false + private _templateBody?: string; + public get templateBody() { + return this.getStringAttribute('template_body'); + } + public set templateBody(value: string) { + this._templateBody = value; + } + public resetTemplateBody() { + this._templateBody = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateBodyInput() { + return this._templateBody; + } + + // template_key - computed: true, optional: true, required: false + private _templateKey?: string; + public get templateKey() { + return this.getStringAttribute('template_key'); + } + public set templateKey(value: string) { + this._templateKey = value; + } + public resetTemplateKey() { + this._templateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateKeyInput() { + return this._templateKey; + } + + // template_uri - computed: true, optional: true, required: false + private _templateUri?: string; + public get templateUri() { + return this.getStringAttribute('template_uri'); + } + public set templateUri(value: string) { + this._templateUri = value; + } + public resetTemplateUri() { + this._templateUri = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateUriInput() { + return this._templateUri; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RmsOrganizationalAssignmentPackageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RmsOrganizationalAssignmentPackageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // vars_structure - computed: false, optional: true, required: false + private _varsStructure = new RmsOrganizationalAssignmentPackageVarsStructureList(this, "vars_structure", true); + public get varsStructure() { + return this._varsStructure; + } + public putVarsStructure(value: RmsOrganizationalAssignmentPackageVarsStructure[] | cdktf.IResolvable) { + this._varsStructure.internalValue = value; + } + public resetVarsStructure() { + this._varsStructure.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get varsStructureInput() { + return this._varsStructure.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + excluded_accounts: cdktf.listMapper(cdktf.stringToTerraform, false)(this._excludedAccounts), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization_id: cdktf.stringToTerraform(this._organizationId), + template_body: cdktf.stringToTerraform(this._templateBody), + template_key: cdktf.stringToTerraform(this._templateKey), + template_uri: cdktf.stringToTerraform(this._templateUri), + timeouts: rmsOrganizationalAssignmentPackageTimeoutsToTerraform(this._timeouts.internalValue), + vars_structure: cdktf.listMapper(rmsOrganizationalAssignmentPackageVarsStructureToTerraform, true)(this._varsStructure.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + excluded_accounts: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._excludedAccounts), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_id: { + value: cdktf.stringToHclTerraform(this._organizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_body: { + value: cdktf.stringToHclTerraform(this._templateBody), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_key: { + value: cdktf.stringToHclTerraform(this._templateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + template_uri: { + value: cdktf.stringToHclTerraform(this._templateUri), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: rmsOrganizationalAssignmentPackageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RmsOrganizationalAssignmentPackageTimeouts", + }, + vars_structure: { + value: cdktf.listMapperHcl(rmsOrganizationalAssignmentPackageVarsStructureToHclTerraform, true)(this._varsStructure.internalValue), + isBlock: true, + type: "set", + storageClassType: "RmsOrganizationalAssignmentPackageVarsStructureList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/README.md b/src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/README.md new file mode 100644 index 00000000..297575d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_organizational_policy_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_organizational_policy_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment). diff --git a/src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/index.ts b/src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/index.ts new file mode 100644 index 00000000..30c9629c --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-organizational-policy-assignment/index.ts @@ -0,0 +1,851 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsOrganizationalPolicyAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the organizational policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#description RmsOrganizationalPolicyAssignment#description} + */ + readonly description?: string; + /** + * The excluded accounts of the organizational policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#excluded_accounts RmsOrganizationalPolicyAssignment#excluded_accounts} + */ + readonly excludedAccounts?: string[]; + /** + * The function URN used to create the custom policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#function_urn RmsOrganizationalPolicyAssignment#function_urn} + */ + readonly functionUrn?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#id RmsOrganizationalPolicyAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the organizational policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#name RmsOrganizationalPolicyAssignment#name} + */ + readonly name: string; + /** + * Specifies the ID of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#organization_id RmsOrganizationalPolicyAssignment#organization_id} + */ + readonly organizationId: string; + /** + * The rule definition of the organizational policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#parameters RmsOrganizationalPolicyAssignment#parameters} + */ + readonly parameters?: { [key: string]: string }; + /** + * The period of the policy rule check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#period RmsOrganizationalPolicyAssignment#period} + */ + readonly period?: string; + /** + * The ID of the policy definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#policy_definition_id RmsOrganizationalPolicyAssignment#policy_definition_id} + */ + readonly policyDefinitionId?: string; + /** + * policy_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#policy_filter RmsOrganizationalPolicyAssignment#policy_filter} + */ + readonly policyFilter?: RmsOrganizationalPolicyAssignmentPolicyFilter; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#timeouts RmsOrganizationalPolicyAssignment#timeouts} + */ + readonly timeouts?: RmsOrganizationalPolicyAssignmentTimeouts; +} +export interface RmsOrganizationalPolicyAssignmentPolicyFilter { + /** + * The name of the region to which the filtered resources belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#region RmsOrganizationalPolicyAssignment#region} + */ + readonly region?: string; + /** + * The resource ID used to filter a specified resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#resource_id RmsOrganizationalPolicyAssignment#resource_id} + */ + readonly resourceId?: string; + /** + * The service name to which the filtered resources belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#resource_provider RmsOrganizationalPolicyAssignment#resource_provider} + */ + readonly resourceProvider?: string; + /** + * The resource type of the filtered resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#resource_type RmsOrganizationalPolicyAssignment#resource_type} + */ + readonly resourceType?: string; + /** + * The tag name used to filter resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#tag_key RmsOrganizationalPolicyAssignment#tag_key} + */ + readonly tagKey?: string; + /** + * The tag value used to filter resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#tag_value RmsOrganizationalPolicyAssignment#tag_value} + */ + readonly tagValue?: string; +} + +export function rmsOrganizationalPolicyAssignmentPolicyFilterToTerraform(struct?: RmsOrganizationalPolicyAssignmentPolicyFilterOutputReference | RmsOrganizationalPolicyAssignmentPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + region: cdktf.stringToTerraform(struct!.region), + resource_id: cdktf.stringToTerraform(struct!.resourceId), + resource_provider: cdktf.stringToTerraform(struct!.resourceProvider), + resource_type: cdktf.stringToTerraform(struct!.resourceType), + tag_key: cdktf.stringToTerraform(struct!.tagKey), + tag_value: cdktf.stringToTerraform(struct!.tagValue), + } +} + + +export function rmsOrganizationalPolicyAssignmentPolicyFilterToHclTerraform(struct?: RmsOrganizationalPolicyAssignmentPolicyFilterOutputReference | RmsOrganizationalPolicyAssignmentPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_provider: { + value: cdktf.stringToHclTerraform(struct!.resourceProvider), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(struct!.resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_key: { + value: cdktf.stringToHclTerraform(struct!.tagKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_value: { + value: cdktf.stringToHclTerraform(struct!.tagValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsOrganizationalPolicyAssignmentPolicyFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsOrganizationalPolicyAssignmentPolicyFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._resourceProvider !== undefined) { + hasAnyValues = true; + internalValueResult.resourceProvider = this._resourceProvider; + } + if (this._resourceType !== undefined) { + hasAnyValues = true; + internalValueResult.resourceType = this._resourceType; + } + if (this._tagKey !== undefined) { + hasAnyValues = true; + internalValueResult.tagKey = this._tagKey; + } + if (this._tagValue !== undefined) { + hasAnyValues = true; + internalValueResult.tagValue = this._tagValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsOrganizationalPolicyAssignmentPolicyFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._region = undefined; + this._resourceId = undefined; + this._resourceProvider = undefined; + this._resourceType = undefined; + this._tagKey = undefined; + this._tagValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._region = value.region; + this._resourceId = value.resourceId; + this._resourceProvider = value.resourceProvider; + this._resourceType = value.resourceType; + this._tagKey = value.tagKey; + this._tagValue = value.tagValue; + } + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: true, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_provider - computed: true, optional: true, required: false + private _resourceProvider?: string; + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + public set resourceProvider(value: string) { + this._resourceProvider = value; + } + public resetResourceProvider() { + this._resourceProvider = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceProviderInput() { + return this._resourceProvider; + } + + // resource_type - computed: true, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // tag_key - computed: true, optional: true, required: false + private _tagKey?: string; + public get tagKey() { + return this.getStringAttribute('tag_key'); + } + public set tagKey(value: string) { + this._tagKey = value; + } + public resetTagKey() { + this._tagKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagKeyInput() { + return this._tagKey; + } + + // tag_value - computed: true, optional: true, required: false + private _tagValue?: string; + public get tagValue() { + return this.getStringAttribute('tag_value'); + } + public set tagValue(value: string) { + this._tagValue = value; + } + public resetTagValue() { + this._tagValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagValueInput() { + return this._tagValue; + } +} +export interface RmsOrganizationalPolicyAssignmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#create RmsOrganizationalPolicyAssignment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#delete RmsOrganizationalPolicyAssignment#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#update RmsOrganizationalPolicyAssignment#update} + */ + readonly update?: string; +} + +export function rmsOrganizationalPolicyAssignmentTimeoutsToTerraform(struct?: RmsOrganizationalPolicyAssignmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rmsOrganizationalPolicyAssignmentTimeoutsToHclTerraform(struct?: RmsOrganizationalPolicyAssignmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsOrganizationalPolicyAssignmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RmsOrganizationalPolicyAssignmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsOrganizationalPolicyAssignmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment huaweicloud_rms_organizational_policy_assignment} +*/ +export class RmsOrganizationalPolicyAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_organizational_policy_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsOrganizationalPolicyAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsOrganizationalPolicyAssignment to import + * @param importFromId The id of the existing RmsOrganizationalPolicyAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsOrganizationalPolicyAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_organizational_policy_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_organizational_policy_assignment huaweicloud_rms_organizational_policy_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsOrganizationalPolicyAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: RmsOrganizationalPolicyAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_organizational_policy_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._excludedAccounts = config.excludedAccounts; + this._functionUrn = config.functionUrn; + this._id = config.id; + this._name = config.name; + this._organizationId = config.organizationId; + this._parameters = config.parameters; + this._period = config.period; + this._policyDefinitionId = config.policyDefinitionId; + this._policyFilter.internalValue = config.policyFilter; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // excluded_accounts - computed: true, optional: true, required: false + private _excludedAccounts?: string[]; + public get excludedAccounts() { + return cdktf.Fn.tolist(this.getListAttribute('excluded_accounts')); + } + public set excludedAccounts(value: string[]) { + this._excludedAccounts = value; + } + public resetExcludedAccounts() { + this._excludedAccounts = undefined; + } + // Temporarily expose input value. Use with caution. + public get excludedAccountsInput() { + return this._excludedAccounts; + } + + // function_urn - computed: true, optional: true, required: false + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + public resetFunctionUrn() { + this._functionUrn = undefined; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization_id - computed: false, optional: false, required: true + private _organizationId?: string; + public get organizationId() { + return this.getStringAttribute('organization_id'); + } + public set organizationId(value: string) { + this._organizationId = value; + } + // Temporarily expose input value. Use with caution. + public get organizationIdInput() { + return this._organizationId; + } + + // organization_policy_assignment_urn - computed: true, optional: false, required: false + public get organizationPolicyAssignmentUrn() { + return this.getStringAttribute('organization_policy_assignment_urn'); + } + + // owner_id - computed: true, optional: false, required: false + public get ownerId() { + return this.getStringAttribute('owner_id'); + } + + // parameters - computed: true, optional: true, required: false + private _parameters?: { [key: string]: string }; + public get parameters() { + return this.getStringMapAttribute('parameters'); + } + public set parameters(value: { [key: string]: string }) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // period - computed: true, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // policy_definition_id - computed: true, optional: true, required: false + private _policyDefinitionId?: string; + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + public set policyDefinitionId(value: string) { + this._policyDefinitionId = value; + } + public resetPolicyDefinitionId() { + this._policyDefinitionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyDefinitionIdInput() { + return this._policyDefinitionId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // policy_filter - computed: false, optional: true, required: false + private _policyFilter = new RmsOrganizationalPolicyAssignmentPolicyFilterOutputReference(this, "policy_filter"); + public get policyFilter() { + return this._policyFilter; + } + public putPolicyFilter(value: RmsOrganizationalPolicyAssignmentPolicyFilter) { + this._policyFilter.internalValue = value; + } + public resetPolicyFilter() { + this._policyFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyFilterInput() { + return this._policyFilter.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RmsOrganizationalPolicyAssignmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RmsOrganizationalPolicyAssignmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + excluded_accounts: cdktf.listMapper(cdktf.stringToTerraform, false)(this._excludedAccounts), + function_urn: cdktf.stringToTerraform(this._functionUrn), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + organization_id: cdktf.stringToTerraform(this._organizationId), + parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameters), + period: cdktf.stringToTerraform(this._period), + policy_definition_id: cdktf.stringToTerraform(this._policyDefinitionId), + policy_filter: rmsOrganizationalPolicyAssignmentPolicyFilterToTerraform(this._policyFilter.internalValue), + timeouts: rmsOrganizationalPolicyAssignmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + excluded_accounts: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._excludedAccounts), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + function_urn: { + value: cdktf.stringToHclTerraform(this._functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_id: { + value: cdktf.stringToHclTerraform(this._organizationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._parameters), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + period: { + value: cdktf.stringToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_definition_id: { + value: cdktf.stringToHclTerraform(this._policyDefinitionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_filter: { + value: rmsOrganizationalPolicyAssignmentPolicyFilterToHclTerraform(this._policyFilter.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsOrganizationalPolicyAssignmentPolicyFilterList", + }, + timeouts: { + value: rmsOrganizationalPolicyAssignmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RmsOrganizationalPolicyAssignmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/README.md b/src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/README.md new file mode 100644 index 00000000..badc3228 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_policy_assignment_evaluate` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_policy_assignment_evaluate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate). diff --git a/src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/index.ts b/src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/index.ts new file mode 100644 index 00000000..2088faa1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-policy-assignment-evaluate/index.ts @@ -0,0 +1,143 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsPolicyAssignmentEvaluateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate#id RmsPolicyAssignmentEvaluate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ID of the policy assignment to evaluate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate#policy_assignment_id RmsPolicyAssignmentEvaluate#policy_assignment_id} + */ + readonly policyAssignmentId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate huaweicloud_rms_policy_assignment_evaluate} +*/ +export class RmsPolicyAssignmentEvaluate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_policy_assignment_evaluate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsPolicyAssignmentEvaluate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsPolicyAssignmentEvaluate to import + * @param importFromId The id of the existing RmsPolicyAssignmentEvaluate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsPolicyAssignmentEvaluate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_policy_assignment_evaluate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment_evaluate huaweicloud_rms_policy_assignment_evaluate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsPolicyAssignmentEvaluateConfig + */ + public constructor(scope: Construct, id: string, config: RmsPolicyAssignmentEvaluateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_policy_assignment_evaluate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._policyAssignmentId = config.policyAssignmentId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_assignment_id - computed: false, optional: false, required: true + private _policyAssignmentId?: string; + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + public set policyAssignmentId(value: string) { + this._policyAssignmentId = value; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentIdInput() { + return this._policyAssignmentId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + policy_assignment_id: cdktf.stringToTerraform(this._policyAssignmentId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_id: { + value: cdktf.stringToHclTerraform(this._policyAssignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-policy-assignment/README.md b/src/constructs/providers/huaweicloud/rms-policy-assignment/README.md new file mode 100644 index 00000000..d6661d38 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-policy-assignment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_policy_assignment` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_policy_assignment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment). diff --git a/src/constructs/providers/huaweicloud/rms-policy-assignment/index.ts b/src/constructs/providers/huaweicloud/rms-policy-assignment/index.ts new file mode 100644 index 00000000..64d021d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-policy-assignment/index.ts @@ -0,0 +1,964 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsPolicyAssignmentConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#description RmsPolicyAssignment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#id RmsPolicyAssignment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#name RmsPolicyAssignment#name} + */ + readonly name: string; + /** + * The rule definition of the policy assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#parameters RmsPolicyAssignment#parameters} + */ + readonly parameters?: { [key: string]: string }; + /** + * The period of the policy rule check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#period RmsPolicyAssignment#period} + */ + readonly period?: string; + /** + * The ID of the policy definition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#policy_definition_id RmsPolicyAssignment#policy_definition_id} + */ + readonly policyDefinitionId?: string; + /** + * The expect status of the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#status RmsPolicyAssignment#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#tags RmsPolicyAssignment#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * custom_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#custom_policy RmsPolicyAssignment#custom_policy} + */ + readonly customPolicy?: RmsPolicyAssignmentCustomPolicy; + /** + * policy_filter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#policy_filter RmsPolicyAssignment#policy_filter} + */ + readonly policyFilter?: RmsPolicyAssignmentPolicyFilter; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#timeouts RmsPolicyAssignment#timeouts} + */ + readonly timeouts?: RmsPolicyAssignmentTimeouts; +} +export interface RmsPolicyAssignmentCustomPolicy { + /** + * The authorization type of the custom policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#auth_type RmsPolicyAssignment#auth_type} + */ + readonly authType: string; + /** + * The authorization value of the custom policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#auth_value RmsPolicyAssignment#auth_value} + */ + readonly authValue?: { [key: string]: string }; + /** + * The function URN used to create the custom policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#function_urn RmsPolicyAssignment#function_urn} + */ + readonly functionUrn: string; +} + +export function rmsPolicyAssignmentCustomPolicyToTerraform(struct?: RmsPolicyAssignmentCustomPolicyOutputReference | RmsPolicyAssignmentCustomPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auth_type: cdktf.stringToTerraform(struct!.authType), + auth_value: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.authValue), + function_urn: cdktf.stringToTerraform(struct!.functionUrn), + } +} + + +export function rmsPolicyAssignmentCustomPolicyToHclTerraform(struct?: RmsPolicyAssignmentCustomPolicyOutputReference | RmsPolicyAssignmentCustomPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(struct!.authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_value: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.authValue), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + function_urn: { + value: cdktf.stringToHclTerraform(struct!.functionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsPolicyAssignmentCustomPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsPolicyAssignmentCustomPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authType !== undefined) { + hasAnyValues = true; + internalValueResult.authType = this._authType; + } + if (this._authValue !== undefined) { + hasAnyValues = true; + internalValueResult.authValue = this._authValue; + } + if (this._functionUrn !== undefined) { + hasAnyValues = true; + internalValueResult.functionUrn = this._functionUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsPolicyAssignmentCustomPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authType = undefined; + this._authValue = undefined; + this._functionUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authType = value.authType; + this._authValue = value.authValue; + this._functionUrn = value.functionUrn; + } + } + + // auth_type - computed: false, optional: false, required: true + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // auth_value - computed: false, optional: true, required: false + private _authValue?: { [key: string]: string }; + public get authValue() { + return this.getStringMapAttribute('auth_value'); + } + public set authValue(value: { [key: string]: string }) { + this._authValue = value; + } + public resetAuthValue() { + this._authValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get authValueInput() { + return this._authValue; + } + + // function_urn - computed: false, optional: false, required: true + private _functionUrn?: string; + public get functionUrn() { + return this.getStringAttribute('function_urn'); + } + public set functionUrn(value: string) { + this._functionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get functionUrnInput() { + return this._functionUrn; + } +} +export interface RmsPolicyAssignmentPolicyFilter { + /** + * The name of the region to which the filtered resources belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#region RmsPolicyAssignment#region} + */ + readonly region?: string; + /** + * The resource ID used to filter a specified resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#resource_id RmsPolicyAssignment#resource_id} + */ + readonly resourceId?: string; + /** + * The service name to which the filtered resources belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#resource_provider RmsPolicyAssignment#resource_provider} + */ + readonly resourceProvider?: string; + /** + * The resource type of the filtered resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#resource_type RmsPolicyAssignment#resource_type} + */ + readonly resourceType?: string; + /** + * The tag name used to filter resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#tag_key RmsPolicyAssignment#tag_key} + */ + readonly tagKey?: string; + /** + * The tag value used to filter resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#tag_value RmsPolicyAssignment#tag_value} + */ + readonly tagValue?: string; +} + +export function rmsPolicyAssignmentPolicyFilterToTerraform(struct?: RmsPolicyAssignmentPolicyFilterOutputReference | RmsPolicyAssignmentPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + region: cdktf.stringToTerraform(struct!.region), + resource_id: cdktf.stringToTerraform(struct!.resourceId), + resource_provider: cdktf.stringToTerraform(struct!.resourceProvider), + resource_type: cdktf.stringToTerraform(struct!.resourceType), + tag_key: cdktf.stringToTerraform(struct!.tagKey), + tag_value: cdktf.stringToTerraform(struct!.tagValue), + } +} + + +export function rmsPolicyAssignmentPolicyFilterToHclTerraform(struct?: RmsPolicyAssignmentPolicyFilterOutputReference | RmsPolicyAssignmentPolicyFilter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_provider: { + value: cdktf.stringToHclTerraform(struct!.resourceProvider), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(struct!.resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_key: { + value: cdktf.stringToHclTerraform(struct!.tagKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_value: { + value: cdktf.stringToHclTerraform(struct!.tagValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsPolicyAssignmentPolicyFilterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsPolicyAssignmentPolicyFilter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._resourceProvider !== undefined) { + hasAnyValues = true; + internalValueResult.resourceProvider = this._resourceProvider; + } + if (this._resourceType !== undefined) { + hasAnyValues = true; + internalValueResult.resourceType = this._resourceType; + } + if (this._tagKey !== undefined) { + hasAnyValues = true; + internalValueResult.tagKey = this._tagKey; + } + if (this._tagValue !== undefined) { + hasAnyValues = true; + internalValueResult.tagValue = this._tagValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsPolicyAssignmentPolicyFilter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._region = undefined; + this._resourceId = undefined; + this._resourceProvider = undefined; + this._resourceType = undefined; + this._tagKey = undefined; + this._tagValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._region = value.region; + this._resourceId = value.resourceId; + this._resourceProvider = value.resourceProvider; + this._resourceType = value.resourceType; + this._tagKey = value.tagKey; + this._tagValue = value.tagValue; + } + } + + // region - computed: false, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: true, required: false + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + public resetResourceId() { + this._resourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_provider - computed: false, optional: true, required: false + private _resourceProvider?: string; + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + public set resourceProvider(value: string) { + this._resourceProvider = value; + } + public resetResourceProvider() { + this._resourceProvider = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceProviderInput() { + return this._resourceProvider; + } + + // resource_type - computed: false, optional: true, required: false + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + public resetResourceType() { + this._resourceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // tag_key - computed: false, optional: true, required: false + private _tagKey?: string; + public get tagKey() { + return this.getStringAttribute('tag_key'); + } + public set tagKey(value: string) { + this._tagKey = value; + } + public resetTagKey() { + this._tagKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagKeyInput() { + return this._tagKey; + } + + // tag_value - computed: false, optional: true, required: false + private _tagValue?: string; + public get tagValue() { + return this.getStringAttribute('tag_value'); + } + public set tagValue(value: string) { + this._tagValue = value; + } + public resetTagValue() { + this._tagValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagValueInput() { + return this._tagValue; + } +} +export interface RmsPolicyAssignmentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#create RmsPolicyAssignment#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#update RmsPolicyAssignment#update} + */ + readonly update?: string; +} + +export function rmsPolicyAssignmentTimeoutsToTerraform(struct?: RmsPolicyAssignmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function rmsPolicyAssignmentTimeoutsToHclTerraform(struct?: RmsPolicyAssignmentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsPolicyAssignmentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RmsPolicyAssignmentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsPolicyAssignmentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment huaweicloud_rms_policy_assignment} +*/ +export class RmsPolicyAssignment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_policy_assignment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsPolicyAssignment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsPolicyAssignment to import + * @param importFromId The id of the existing RmsPolicyAssignment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsPolicyAssignment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_policy_assignment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_policy_assignment huaweicloud_rms_policy_assignment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsPolicyAssignmentConfig + */ + public constructor(scope: Construct, id: string, config: RmsPolicyAssignmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_policy_assignment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._parameters = config.parameters; + this._period = config.period; + this._policyDefinitionId = config.policyDefinitionId; + this._status = config.status; + this._tags = config.tags; + this._customPolicy.internalValue = config.customPolicy; + this._policyFilter.internalValue = config.policyFilter; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parameters - computed: false, optional: true, required: false + private _parameters?: { [key: string]: string }; + public get parameters() { + return this.getStringMapAttribute('parameters'); + } + public set parameters(value: { [key: string]: string }) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // period - computed: false, optional: true, required: false + private _period?: string; + public get period() { + return this.getStringAttribute('period'); + } + public set period(value: string) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // policy_definition_id - computed: false, optional: true, required: false + private _policyDefinitionId?: string; + public get policyDefinitionId() { + return this.getStringAttribute('policy_definition_id'); + } + public set policyDefinitionId(value: string) { + this._policyDefinitionId = value; + } + public resetPolicyDefinitionId() { + this._policyDefinitionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyDefinitionIdInput() { + return this._policyDefinitionId; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // custom_policy - computed: false, optional: true, required: false + private _customPolicy = new RmsPolicyAssignmentCustomPolicyOutputReference(this, "custom_policy"); + public get customPolicy() { + return this._customPolicy; + } + public putCustomPolicy(value: RmsPolicyAssignmentCustomPolicy) { + this._customPolicy.internalValue = value; + } + public resetCustomPolicy() { + this._customPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customPolicyInput() { + return this._customPolicy.internalValue; + } + + // policy_filter - computed: false, optional: true, required: false + private _policyFilter = new RmsPolicyAssignmentPolicyFilterOutputReference(this, "policy_filter"); + public get policyFilter() { + return this._policyFilter; + } + public putPolicyFilter(value: RmsPolicyAssignmentPolicyFilter) { + this._policyFilter.internalValue = value; + } + public resetPolicyFilter() { + this._policyFilter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyFilterInput() { + return this._policyFilter.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RmsPolicyAssignmentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RmsPolicyAssignmentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameters), + period: cdktf.stringToTerraform(this._period), + policy_definition_id: cdktf.stringToTerraform(this._policyDefinitionId), + status: cdktf.stringToTerraform(this._status), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + custom_policy: rmsPolicyAssignmentCustomPolicyToTerraform(this._customPolicy.internalValue), + policy_filter: rmsPolicyAssignmentPolicyFilterToTerraform(this._policyFilter.internalValue), + timeouts: rmsPolicyAssignmentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._parameters), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + period: { + value: cdktf.stringToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_definition_id: { + value: cdktf.stringToHclTerraform(this._policyDefinitionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + custom_policy: { + value: rmsPolicyAssignmentCustomPolicyToHclTerraform(this._customPolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsPolicyAssignmentCustomPolicyList", + }, + policy_filter: { + value: rmsPolicyAssignmentPolicyFilterToHclTerraform(this._policyFilter.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsPolicyAssignmentPolicyFilterList", + }, + timeouts: { + value: rmsPolicyAssignmentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RmsPolicyAssignmentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-remediation-configuration/README.md b/src/constructs/providers/huaweicloud/rms-remediation-configuration/README.md new file mode 100644 index 00000000..eae8e2c2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-remediation-configuration/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_remediation_configuration` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_remediation_configuration`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration). diff --git a/src/constructs/providers/huaweicloud/rms-remediation-configuration/index.ts b/src/constructs/providers/huaweicloud/rms-remediation-configuration/index.ts new file mode 100644 index 00000000..34621cba --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-remediation-configuration/index.ts @@ -0,0 +1,685 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsRemediationConfigurationConfig extends cdktf.TerraformMetaArguments { + /** + * The authorization type for remediation configurations. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#auth_type RmsRemediationConfiguration#auth_type} + */ + readonly authType?: string; + /** + * The information of dependent service authorization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#auth_value RmsRemediationConfiguration#auth_value} + */ + readonly authValue?: string; + /** + * Whether remediation is automatic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#automatic RmsRemediationConfiguration#automatic} + */ + readonly automatic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#id RmsRemediationConfiguration#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The maximum number of retries allowed within a specified period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#maximum_attempts RmsRemediationConfiguration#maximum_attempts} + */ + readonly maximumAttempts?: number; + /** + * The policy assignment ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#policy_assignment_id RmsRemediationConfiguration#policy_assignment_id} + */ + readonly policyAssignmentId: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#region RmsRemediationConfiguration#region} + */ + readonly region?: string; + /** + * The time period during which the number of attempts specified in the maximum_attempts can be tried. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#retry_attempt_seconds RmsRemediationConfiguration#retry_attempt_seconds} + */ + readonly retryAttemptSeconds?: number; + /** + * The ID of a remediation object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#target_id RmsRemediationConfiguration#target_id} + */ + readonly targetId: string; + /** + * The execution method of remediation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#target_type RmsRemediationConfiguration#target_type} + */ + readonly targetType: string; + /** + * resource_parameter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#resource_parameter RmsRemediationConfiguration#resource_parameter} + */ + readonly resourceParameter: RmsRemediationConfigurationResourceParameter; + /** + * static_parameter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#static_parameter RmsRemediationConfiguration#static_parameter} + */ + readonly staticParameter?: RmsRemediationConfigurationStaticParameter[] | cdktf.IResolvable; +} +export interface RmsRemediationConfigurationResourceParameter { + /** + * The parameter name for passing the resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#resource_id RmsRemediationConfiguration#resource_id} + */ + readonly resourceId: string; +} + +export function rmsRemediationConfigurationResourceParameterToTerraform(struct?: RmsRemediationConfigurationResourceParameterOutputReference | RmsRemediationConfigurationResourceParameter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_id: cdktf.stringToTerraform(struct!.resourceId), + } +} + + +export function rmsRemediationConfigurationResourceParameterToHclTerraform(struct?: RmsRemediationConfigurationResourceParameterOutputReference | RmsRemediationConfigurationResourceParameter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsRemediationConfigurationResourceParameterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsRemediationConfigurationResourceParameter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsRemediationConfigurationResourceParameter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._resourceId = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._resourceId = value.resourceId; + } + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } +} +export interface RmsRemediationConfigurationStaticParameter { + /** + * The static parameter name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#var_key RmsRemediationConfiguration#var_key} + */ + readonly varKey?: string; + /** + * The static parameter value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#var_value RmsRemediationConfiguration#var_value} + */ + readonly varValue?: string; +} + +export function rmsRemediationConfigurationStaticParameterToTerraform(struct?: RmsRemediationConfigurationStaticParameter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + var_key: cdktf.stringToTerraform(struct!.varKey), + var_value: cdktf.stringToTerraform(struct!.varValue), + } +} + + +export function rmsRemediationConfigurationStaticParameterToHclTerraform(struct?: RmsRemediationConfigurationStaticParameter | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + var_key: { + value: cdktf.stringToHclTerraform(struct!.varKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + var_value: { + value: cdktf.stringToHclTerraform(struct!.varValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsRemediationConfigurationStaticParameterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RmsRemediationConfigurationStaticParameter | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._varKey !== undefined) { + hasAnyValues = true; + internalValueResult.varKey = this._varKey; + } + if (this._varValue !== undefined) { + hasAnyValues = true; + internalValueResult.varValue = this._varValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsRemediationConfigurationStaticParameter | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._varKey = undefined; + this._varValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._varKey = value.varKey; + this._varValue = value.varValue; + } + } + + // var_key - computed: false, optional: true, required: false + private _varKey?: string; + public get varKey() { + return this.getStringAttribute('var_key'); + } + public set varKey(value: string) { + this._varKey = value; + } + public resetVarKey() { + this._varKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get varKeyInput() { + return this._varKey; + } + + // var_value - computed: false, optional: true, required: false + private _varValue?: string; + public get varValue() { + return this.getStringAttribute('var_value'); + } + public set varValue(value: string) { + this._varValue = value; + } + public resetVarValue() { + this._varValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get varValueInput() { + return this._varValue; + } +} + +export class RmsRemediationConfigurationStaticParameterList extends cdktf.ComplexList { + public internalValue? : RmsRemediationConfigurationStaticParameter[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RmsRemediationConfigurationStaticParameterOutputReference { + return new RmsRemediationConfigurationStaticParameterOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration huaweicloud_rms_remediation_configuration} +*/ +export class RmsRemediationConfiguration extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_remediation_configuration"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsRemediationConfiguration resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsRemediationConfiguration to import + * @param importFromId The id of the existing RmsRemediationConfiguration that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsRemediationConfiguration to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_remediation_configuration", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_configuration huaweicloud_rms_remediation_configuration} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsRemediationConfigurationConfig + */ + public constructor(scope: Construct, id: string, config: RmsRemediationConfigurationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_remediation_configuration', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authType = config.authType; + this._authValue = config.authValue; + this._automatic = config.automatic; + this._id = config.id; + this._maximumAttempts = config.maximumAttempts; + this._policyAssignmentId = config.policyAssignmentId; + this._region = config.region; + this._retryAttemptSeconds = config.retryAttemptSeconds; + this._targetId = config.targetId; + this._targetType = config.targetType; + this._resourceParameter.internalValue = config.resourceParameter; + this._staticParameter.internalValue = config.staticParameter; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_type - computed: false, optional: true, required: false + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + public resetAuthType() { + this._authType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // auth_value - computed: false, optional: true, required: false + private _authValue?: string; + public get authValue() { + return this.getStringAttribute('auth_value'); + } + public set authValue(value: string) { + this._authValue = value; + } + public resetAuthValue() { + this._authValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get authValueInput() { + return this._authValue; + } + + // automatic - computed: false, optional: true, required: false + private _automatic?: boolean | cdktf.IResolvable; + public get automatic() { + return this.getBooleanAttribute('automatic'); + } + public set automatic(value: boolean | cdktf.IResolvable) { + this._automatic = value; + } + public resetAutomatic() { + this._automatic = undefined; + } + // Temporarily expose input value. Use with caution. + public get automaticInput() { + return this._automatic; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maximum_attempts - computed: true, optional: true, required: false + private _maximumAttempts?: number; + public get maximumAttempts() { + return this.getNumberAttribute('maximum_attempts'); + } + public set maximumAttempts(value: number) { + this._maximumAttempts = value; + } + public resetMaximumAttempts() { + this._maximumAttempts = undefined; + } + // Temporarily expose input value. Use with caution. + public get maximumAttemptsInput() { + return this._maximumAttempts; + } + + // policy_assignment_id - computed: false, optional: false, required: true + private _policyAssignmentId?: string; + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + public set policyAssignmentId(value: string) { + this._policyAssignmentId = value; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentIdInput() { + return this._policyAssignmentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // retry_attempt_seconds - computed: true, optional: true, required: false + private _retryAttemptSeconds?: number; + public get retryAttemptSeconds() { + return this.getNumberAttribute('retry_attempt_seconds'); + } + public set retryAttemptSeconds(value: number) { + this._retryAttemptSeconds = value; + } + public resetRetryAttemptSeconds() { + this._retryAttemptSeconds = undefined; + } + // Temporarily expose input value. Use with caution. + public get retryAttemptSecondsInput() { + return this._retryAttemptSeconds; + } + + // target_id - computed: false, optional: false, required: true + private _targetId?: string; + public get targetId() { + return this.getStringAttribute('target_id'); + } + public set targetId(value: string) { + this._targetId = value; + } + // Temporarily expose input value. Use with caution. + public get targetIdInput() { + return this._targetId; + } + + // target_type - computed: false, optional: false, required: true + private _targetType?: string; + public get targetType() { + return this.getStringAttribute('target_type'); + } + public set targetType(value: string) { + this._targetType = value; + } + // Temporarily expose input value. Use with caution. + public get targetTypeInput() { + return this._targetType; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // resource_parameter - computed: false, optional: false, required: true + private _resourceParameter = new RmsRemediationConfigurationResourceParameterOutputReference(this, "resource_parameter"); + public get resourceParameter() { + return this._resourceParameter; + } + public putResourceParameter(value: RmsRemediationConfigurationResourceParameter) { + this._resourceParameter.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourceParameterInput() { + return this._resourceParameter.internalValue; + } + + // static_parameter - computed: false, optional: true, required: false + private _staticParameter = new RmsRemediationConfigurationStaticParameterList(this, "static_parameter", false); + public get staticParameter() { + return this._staticParameter; + } + public putStaticParameter(value: RmsRemediationConfigurationStaticParameter[] | cdktf.IResolvable) { + this._staticParameter.internalValue = value; + } + public resetStaticParameter() { + this._staticParameter.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get staticParameterInput() { + return this._staticParameter.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_type: cdktf.stringToTerraform(this._authType), + auth_value: cdktf.stringToTerraform(this._authValue), + automatic: cdktf.booleanToTerraform(this._automatic), + id: cdktf.stringToTerraform(this._id), + maximum_attempts: cdktf.numberToTerraform(this._maximumAttempts), + policy_assignment_id: cdktf.stringToTerraform(this._policyAssignmentId), + region: cdktf.stringToTerraform(this._region), + retry_attempt_seconds: cdktf.numberToTerraform(this._retryAttemptSeconds), + target_id: cdktf.stringToTerraform(this._targetId), + target_type: cdktf.stringToTerraform(this._targetType), + resource_parameter: rmsRemediationConfigurationResourceParameterToTerraform(this._resourceParameter.internalValue), + static_parameter: cdktf.listMapper(rmsRemediationConfigurationStaticParameterToTerraform, true)(this._staticParameter.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_value: { + value: cdktf.stringToHclTerraform(this._authValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + automatic: { + value: cdktf.booleanToHclTerraform(this._automatic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maximum_attempts: { + value: cdktf.numberToHclTerraform(this._maximumAttempts), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + policy_assignment_id: { + value: cdktf.stringToHclTerraform(this._policyAssignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + retry_attempt_seconds: { + value: cdktf.numberToHclTerraform(this._retryAttemptSeconds), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + target_id: { + value: cdktf.stringToHclTerraform(this._targetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_type: { + value: cdktf.stringToHclTerraform(this._targetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_parameter: { + value: rmsRemediationConfigurationResourceParameterToHclTerraform(this._resourceParameter.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsRemediationConfigurationResourceParameterList", + }, + static_parameter: { + value: cdktf.listMapperHcl(rmsRemediationConfigurationStaticParameterToHclTerraform, true)(this._staticParameter.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsRemediationConfigurationStaticParameterList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-remediation-exception/README.md b/src/constructs/providers/huaweicloud/rms-remediation-exception/README.md new file mode 100644 index 00000000..c6f42c7d --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-remediation-exception/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_remediation_exception` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_remediation_exception`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception). diff --git a/src/constructs/providers/huaweicloud/rms-remediation-exception/index.ts b/src/constructs/providers/huaweicloud/rms-remediation-exception/index.ts new file mode 100644 index 00000000..a34008ad --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-remediation-exception/index.ts @@ -0,0 +1,360 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsRemediationExceptionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#id RmsRemediationException#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the policy assignment ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#policy_assignment_id RmsRemediationException#policy_assignment_id} + */ + readonly policyAssignmentId: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#region RmsRemediationException#region} + */ + readonly region?: string; + /** + * exceptions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#exceptions RmsRemediationException#exceptions} + */ + readonly exceptions: RmsRemediationExceptionExceptions[] | cdktf.IResolvable; +} +export interface RmsRemediationExceptionExceptions { + /** + * Specifies the reason for adding an exception. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#message RmsRemediationException#message} + */ + readonly message?: string; + /** + * Specifies the resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#resource_id RmsRemediationException#resource_id} + */ + readonly resourceId: string; +} + +export function rmsRemediationExceptionExceptionsToTerraform(struct?: RmsRemediationExceptionExceptions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + message: cdktf.stringToTerraform(struct!.message), + resource_id: cdktf.stringToTerraform(struct!.resourceId), + } +} + + +export function rmsRemediationExceptionExceptionsToHclTerraform(struct?: RmsRemediationExceptionExceptions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + message: { + value: cdktf.stringToHclTerraform(struct!.message), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsRemediationExceptionExceptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RmsRemediationExceptionExceptions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._message !== undefined) { + hasAnyValues = true; + internalValueResult.message = this._message; + } + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsRemediationExceptionExceptions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._message = undefined; + this._resourceId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._message = value.message; + this._resourceId = value.resourceId; + } + } + + // created_by - computed: true, optional: false, required: false + public get createdBy() { + return this.getStringAttribute('created_by'); + } + + // joined_at - computed: true, optional: false, required: false + public get joinedAt() { + return this.getStringAttribute('joined_at'); + } + + // message - computed: false, optional: true, required: false + private _message?: string; + public get message() { + return this.getStringAttribute('message'); + } + public set message(value: string) { + this._message = value; + } + public resetMessage() { + this._message = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageInput() { + return this._message; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } +} + +export class RmsRemediationExceptionExceptionsList extends cdktf.ComplexList { + public internalValue? : RmsRemediationExceptionExceptions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RmsRemediationExceptionExceptionsOutputReference { + return new RmsRemediationExceptionExceptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception huaweicloud_rms_remediation_exception} +*/ +export class RmsRemediationException extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_remediation_exception"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsRemediationException resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsRemediationException to import + * @param importFromId The id of the existing RmsRemediationException that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsRemediationException to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_remediation_exception", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_exception huaweicloud_rms_remediation_exception} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsRemediationExceptionConfig + */ + public constructor(scope: Construct, id: string, config: RmsRemediationExceptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_remediation_exception', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._policyAssignmentId = config.policyAssignmentId; + this._region = config.region; + this._exceptions.internalValue = config.exceptions; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_assignment_id - computed: false, optional: false, required: true + private _policyAssignmentId?: string; + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + public set policyAssignmentId(value: string) { + this._policyAssignmentId = value; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentIdInput() { + return this._policyAssignmentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // exceptions - computed: false, optional: false, required: true + private _exceptions = new RmsRemediationExceptionExceptionsList(this, "exceptions", true); + public get exceptions() { + return this._exceptions; + } + public putExceptions(value: RmsRemediationExceptionExceptions[] | cdktf.IResolvable) { + this._exceptions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get exceptionsInput() { + return this._exceptions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + policy_assignment_id: cdktf.stringToTerraform(this._policyAssignmentId), + region: cdktf.stringToTerraform(this._region), + exceptions: cdktf.listMapper(rmsRemediationExceptionExceptionsToTerraform, true)(this._exceptions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_id: { + value: cdktf.stringToHclTerraform(this._policyAssignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + exceptions: { + value: cdktf.listMapperHcl(rmsRemediationExceptionExceptionsToHclTerraform, true)(this._exceptions.internalValue), + isBlock: true, + type: "set", + storageClassType: "RmsRemediationExceptionExceptionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-remediation-execution/README.md b/src/constructs/providers/huaweicloud/rms-remediation-execution/README.md new file mode 100644 index 00000000..8d588089 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-remediation-execution/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_remediation_execution` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_remediation_execution`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution). diff --git a/src/constructs/providers/huaweicloud/rms-remediation-execution/index.ts b/src/constructs/providers/huaweicloud/rms-remediation-execution/index.ts new file mode 100644 index 00000000..7f78398f --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-remediation-execution/index.ts @@ -0,0 +1,470 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsRemediationExecutionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to perform remediation for all non-compliant resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#all_supported RmsRemediationExecution#all_supported} + */ + readonly allSupported: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#id RmsRemediationExecution#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the policy assignment ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#policy_assignment_id RmsRemediationExecution#policy_assignment_id} + */ + readonly policyAssignmentId: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#region RmsRemediationExecution#region} + */ + readonly region?: string; + /** + * Specifies the list of resource IDs that require remediation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#resource_ids RmsRemediationExecution#resource_ids} + */ + readonly resourceIds?: string[]; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#timeouts RmsRemediationExecution#timeouts} + */ + readonly timeouts?: RmsRemediationExecutionTimeouts; +} +export interface RmsRemediationExecutionResult { +} + +export function rmsRemediationExecutionResultToTerraform(struct?: RmsRemediationExecutionResult): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function rmsRemediationExecutionResultToHclTerraform(struct?: RmsRemediationExecutionResult): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class RmsRemediationExecutionResultOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): RmsRemediationExecutionResult | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsRemediationExecutionResult | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // automatic - computed: true, optional: false, required: false + public get automatic() { + return this.getBooleanAttribute('automatic'); + } + + // invocation_time - computed: true, optional: false, required: false + public get invocationTime() { + return this.getStringAttribute('invocation_time'); + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // resource_id - computed: true, optional: false, required: false + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + + // resource_name - computed: true, optional: false, required: false + public get resourceName() { + return this.getStringAttribute('resource_name'); + } + + // resource_provider - computed: true, optional: false, required: false + public get resourceProvider() { + return this.getStringAttribute('resource_provider'); + } + + // resource_type - computed: true, optional: false, required: false + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } +} + +export class RmsRemediationExecutionResultList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): RmsRemediationExecutionResultOutputReference { + return new RmsRemediationExecutionResultOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface RmsRemediationExecutionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#create RmsRemediationExecution#create} + */ + readonly create?: string; +} + +export function rmsRemediationExecutionTimeoutsToTerraform(struct?: RmsRemediationExecutionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function rmsRemediationExecutionTimeoutsToHclTerraform(struct?: RmsRemediationExecutionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsRemediationExecutionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): RmsRemediationExecutionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsRemediationExecutionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution huaweicloud_rms_remediation_execution} +*/ +export class RmsRemediationExecution extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_remediation_execution"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsRemediationExecution resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsRemediationExecution to import + * @param importFromId The id of the existing RmsRemediationExecution that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsRemediationExecution to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_remediation_execution", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_remediation_execution huaweicloud_rms_remediation_execution} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsRemediationExecutionConfig + */ + public constructor(scope: Construct, id: string, config: RmsRemediationExecutionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_remediation_execution', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allSupported = config.allSupported; + this._id = config.id; + this._policyAssignmentId = config.policyAssignmentId; + this._region = config.region; + this._resourceIds = config.resourceIds; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // all_supported - computed: false, optional: false, required: true + private _allSupported?: boolean | cdktf.IResolvable; + public get allSupported() { + return this.getBooleanAttribute('all_supported'); + } + public set allSupported(value: boolean | cdktf.IResolvable) { + this._allSupported = value; + } + // Temporarily expose input value. Use with caution. + public get allSupportedInput() { + return this._allSupported; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_assignment_id - computed: false, optional: false, required: true + private _policyAssignmentId?: string; + public get policyAssignmentId() { + return this.getStringAttribute('policy_assignment_id'); + } + public set policyAssignmentId(value: string) { + this._policyAssignmentId = value; + } + // Temporarily expose input value. Use with caution. + public get policyAssignmentIdInput() { + return this._policyAssignmentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_ids - computed: false, optional: true, required: false + private _resourceIds?: string[]; + public get resourceIds() { + return cdktf.Fn.tolist(this.getListAttribute('resource_ids')); + } + public set resourceIds(value: string[]) { + this._resourceIds = value; + } + public resetResourceIds() { + this._resourceIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceIdsInput() { + return this._resourceIds; + } + + // result - computed: true, optional: false, required: false + private _result = new RmsRemediationExecutionResultList(this, "result", false); + public get result() { + return this._result; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new RmsRemediationExecutionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: RmsRemediationExecutionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + all_supported: cdktf.booleanToTerraform(this._allSupported), + id: cdktf.stringToTerraform(this._id), + policy_assignment_id: cdktf.stringToTerraform(this._policyAssignmentId), + region: cdktf.stringToTerraform(this._region), + resource_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resourceIds), + timeouts: rmsRemediationExecutionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + all_supported: { + value: cdktf.booleanToHclTerraform(this._allSupported), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_assignment_id: { + value: cdktf.stringToHclTerraform(this._policyAssignmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resourceIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + timeouts: { + value: rmsRemediationExecutionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "RmsRemediationExecutionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/README.md b/src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/README.md new file mode 100644 index 00000000..a08d337c --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_resource_aggregation_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_resource_aggregation_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization). diff --git a/src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/index.ts b/src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/index.ts new file mode 100644 index 00000000..d9f0f817 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-resource-aggregation-authorization/index.ts @@ -0,0 +1,153 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsResourceAggregationAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the resource aggregation account to be authorized. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization#account_id RmsResourceAggregationAuthorization#account_id} + */ + readonly accountId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization#id RmsResourceAggregationAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization huaweicloud_rms_resource_aggregation_authorization} +*/ +export class RmsResourceAggregationAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregation_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsResourceAggregationAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsResourceAggregationAuthorization to import + * @param importFromId The id of the existing RmsResourceAggregationAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsResourceAggregationAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregation_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregation_authorization huaweicloud_rms_resource_aggregation_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsResourceAggregationAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: RmsResourceAggregationAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregation_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountId = config.accountId; + this._id = config.id; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_id - computed: false, optional: false, required: true + private _accountId?: string; + public get accountId() { + return this.getStringAttribute('account_id'); + } + public set accountId(value: string) { + this._accountId = value; + } + // Temporarily expose input value. Use with caution. + public get accountIdInput() { + return this._accountId; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_id: cdktf.stringToTerraform(this._accountId), + id: cdktf.stringToTerraform(this._id), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_id: { + value: cdktf.stringToHclTerraform(this._accountId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-resource-aggregator/README.md b/src/constructs/providers/huaweicloud/rms-resource-aggregator/README.md new file mode 100644 index 00000000..46d53bad --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-resource-aggregator/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_resource_aggregator` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_resource_aggregator`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator). diff --git a/src/constructs/providers/huaweicloud/rms-resource-aggregator/index.ts b/src/constructs/providers/huaweicloud/rms-resource-aggregator/index.ts new file mode 100644 index 00000000..544bf26f --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-resource-aggregator/index.ts @@ -0,0 +1,205 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsResourceAggregatorConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the source account list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator#account_ids RmsResourceAggregator#account_ids} + */ + readonly accountIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator#id RmsResourceAggregator#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the resource aggregator name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator#name RmsResourceAggregator#name} + */ + readonly name: string; + /** + * Specifies the resource aggregator type, which can be **ACCOUNT** or **ORGANIZATION**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator#type RmsResourceAggregator#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator huaweicloud_rms_resource_aggregator} +*/ +export class RmsResourceAggregator extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_aggregator"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsResourceAggregator resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsResourceAggregator to import + * @param importFromId The id of the existing RmsResourceAggregator that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsResourceAggregator to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_aggregator", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_aggregator huaweicloud_rms_resource_aggregator} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsResourceAggregatorConfig + */ + public constructor(scope: Construct, id: string, config: RmsResourceAggregatorConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_aggregator', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountIds = config.accountIds; + this._id = config.id; + this._name = config.name; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_ids - computed: true, optional: true, required: false + private _accountIds?: string[]; + public get accountIds() { + return cdktf.Fn.tolist(this.getListAttribute('account_ids')); + } + public set accountIds(value: string[]) { + this._accountIds = value; + } + public resetAccountIds() { + this._accountIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountIdsInput() { + return this._accountIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // urn - computed: true, optional: false, required: false + public get urn() { + return this.getStringAttribute('urn'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._accountIds), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._accountIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/rms-resource-recorder/README.md b/src/constructs/providers/huaweicloud/rms-resource-recorder/README.md new file mode 100644 index 00000000..010efac5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-resource-recorder/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_rms_resource_recorder` + +Refer to the Terraform Registry for docs: [`huaweicloud_rms_resource_recorder`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder). diff --git a/src/constructs/providers/huaweicloud/rms-resource-recorder/index.ts b/src/constructs/providers/huaweicloud/rms-resource-recorder/index.ts new file mode 100644 index 00000000..9c574c53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/rms-resource-recorder/index.ts @@ -0,0 +1,616 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface RmsResourceRecorderConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the IAM agency name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#agency_name RmsResourceRecorder#agency_name} + */ + readonly agencyName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#id RmsResourceRecorder#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * obs_channel block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#obs_channel RmsResourceRecorder#obs_channel} + */ + readonly obsChannel?: RmsResourceRecorderObsChannel; + /** + * selector block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#selector RmsResourceRecorder#selector} + */ + readonly selector: RmsResourceRecorderSelector; + /** + * smn_channel block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#smn_channel RmsResourceRecorder#smn_channel} + */ + readonly smnChannel?: RmsResourceRecorderSmnChannel; +} +export interface RmsResourceRecorderObsChannel { + /** + * Specifies the OBS bucket name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#bucket RmsResourceRecorder#bucket} + */ + readonly bucket: string; + /** + * Specifies the region where this bucket is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#region RmsResourceRecorder#region} + */ + readonly region: string; +} + +export function rmsResourceRecorderObsChannelToTerraform(struct?: RmsResourceRecorderObsChannelOutputReference | RmsResourceRecorderObsChannel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket: cdktf.stringToTerraform(struct!.bucket), + region: cdktf.stringToTerraform(struct!.region), + } +} + + +export function rmsResourceRecorderObsChannelToHclTerraform(struct?: RmsResourceRecorderObsChannelOutputReference | RmsResourceRecorderObsChannel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsResourceRecorderObsChannelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsResourceRecorderObsChannel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsResourceRecorderObsChannel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucket = undefined; + this._region = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucket = value.bucket; + this._region = value.region; + } + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // region - computed: false, optional: false, required: true + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } +} +export interface RmsResourceRecorderSelector { + /** + * Specifies whether to select all supported resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#all_supported RmsResourceRecorder#all_supported} + */ + readonly allSupported: boolean | cdktf.IResolvable; + /** + * Specifies the resource type list. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#resource_types RmsResourceRecorder#resource_types} + */ + readonly resourceTypes?: string[]; +} + +export function rmsResourceRecorderSelectorToTerraform(struct?: RmsResourceRecorderSelectorOutputReference | RmsResourceRecorderSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + all_supported: cdktf.booleanToTerraform(struct!.allSupported), + resource_types: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.resourceTypes), + } +} + + +export function rmsResourceRecorderSelectorToHclTerraform(struct?: RmsResourceRecorderSelectorOutputReference | RmsResourceRecorderSelector): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + all_supported: { + value: cdktf.booleanToHclTerraform(struct!.allSupported), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + resource_types: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.resourceTypes), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsResourceRecorderSelectorOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsResourceRecorderSelector | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._allSupported !== undefined) { + hasAnyValues = true; + internalValueResult.allSupported = this._allSupported; + } + if (this._resourceTypes !== undefined) { + hasAnyValues = true; + internalValueResult.resourceTypes = this._resourceTypes; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsResourceRecorderSelector | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._allSupported = undefined; + this._resourceTypes = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._allSupported = value.allSupported; + this._resourceTypes = value.resourceTypes; + } + } + + // all_supported - computed: false, optional: false, required: true + private _allSupported?: boolean | cdktf.IResolvable; + public get allSupported() { + return this.getBooleanAttribute('all_supported'); + } + public set allSupported(value: boolean | cdktf.IResolvable) { + this._allSupported = value; + } + // Temporarily expose input value. Use with caution. + public get allSupportedInput() { + return this._allSupported; + } + + // resource_types - computed: false, optional: true, required: false + private _resourceTypes?: string[]; + public get resourceTypes() { + return cdktf.Fn.tolist(this.getListAttribute('resource_types')); + } + public set resourceTypes(value: string[]) { + this._resourceTypes = value; + } + public resetResourceTypes() { + this._resourceTypes = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceTypesInput() { + return this._resourceTypes; + } +} +export interface RmsResourceRecorderSmnChannel { + /** + * Specifies the project ID where this SMN topic is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#project_id RmsResourceRecorder#project_id} + */ + readonly projectId?: string; + /** + * Specifies the region where this SMN topic is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#region RmsResourceRecorder#region} + */ + readonly region?: string; + /** + * Specifies the SMN topic URN. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#topic_urn RmsResourceRecorder#topic_urn} + */ + readonly topicUrn: string; +} + +export function rmsResourceRecorderSmnChannelToTerraform(struct?: RmsResourceRecorderSmnChannelOutputReference | RmsResourceRecorderSmnChannel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project_id: cdktf.stringToTerraform(struct!.projectId), + region: cdktf.stringToTerraform(struct!.region), + topic_urn: cdktf.stringToTerraform(struct!.topicUrn), + } +} + + +export function rmsResourceRecorderSmnChannelToHclTerraform(struct?: RmsResourceRecorderSmnChannelOutputReference | RmsResourceRecorderSmnChannel): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project_id: { + value: cdktf.stringToHclTerraform(struct!.projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(struct!.region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(struct!.topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class RmsResourceRecorderSmnChannelOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): RmsResourceRecorderSmnChannel | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._projectId !== undefined) { + hasAnyValues = true; + internalValueResult.projectId = this._projectId; + } + if (this._region !== undefined) { + hasAnyValues = true; + internalValueResult.region = this._region; + } + if (this._topicUrn !== undefined) { + hasAnyValues = true; + internalValueResult.topicUrn = this._topicUrn; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: RmsResourceRecorderSmnChannel | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._projectId = undefined; + this._region = undefined; + this._topicUrn = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._projectId = value.projectId; + this._region = value.region; + this._topicUrn = value.topicUrn; + } + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder huaweicloud_rms_resource_recorder} +*/ +export class RmsResourceRecorder extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_rms_resource_recorder"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a RmsResourceRecorder resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the RmsResourceRecorder to import + * @param importFromId The id of the existing RmsResourceRecorder that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the RmsResourceRecorder to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_rms_resource_recorder", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/rms_resource_recorder huaweicloud_rms_resource_recorder} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options RmsResourceRecorderConfig + */ + public constructor(scope: Construct, id: string, config: RmsResourceRecorderConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_rms_resource_recorder', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._agencyName = config.agencyName; + this._id = config.id; + this._obsChannel.internalValue = config.obsChannel; + this._selector.internalValue = config.selector; + this._smnChannel.internalValue = config.smnChannel; + } + + // ========== + // ATTRIBUTES + // ========== + + // agency_name - computed: false, optional: false, required: true + private _agencyName?: string; + public get agencyName() { + return this.getStringAttribute('agency_name'); + } + public set agencyName(value: string) { + this._agencyName = value; + } + // Temporarily expose input value. Use with caution. + public get agencyNameInput() { + return this._agencyName; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // obs_channel - computed: false, optional: true, required: false + private _obsChannel = new RmsResourceRecorderObsChannelOutputReference(this, "obs_channel"); + public get obsChannel() { + return this._obsChannel; + } + public putObsChannel(value: RmsResourceRecorderObsChannel) { + this._obsChannel.internalValue = value; + } + public resetObsChannel() { + this._obsChannel.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get obsChannelInput() { + return this._obsChannel.internalValue; + } + + // selector - computed: false, optional: false, required: true + private _selector = new RmsResourceRecorderSelectorOutputReference(this, "selector"); + public get selector() { + return this._selector; + } + public putSelector(value: RmsResourceRecorderSelector) { + this._selector.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get selectorInput() { + return this._selector.internalValue; + } + + // smn_channel - computed: false, optional: true, required: false + private _smnChannel = new RmsResourceRecorderSmnChannelOutputReference(this, "smn_channel"); + public get smnChannel() { + return this._smnChannel; + } + public putSmnChannel(value: RmsResourceRecorderSmnChannel) { + this._smnChannel.internalValue = value; + } + public resetSmnChannel() { + this._smnChannel.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get smnChannelInput() { + return this._smnChannel.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + agency_name: cdktf.stringToTerraform(this._agencyName), + id: cdktf.stringToTerraform(this._id), + obs_channel: rmsResourceRecorderObsChannelToTerraform(this._obsChannel.internalValue), + selector: rmsResourceRecorderSelectorToTerraform(this._selector.internalValue), + smn_channel: rmsResourceRecorderSmnChannelToTerraform(this._smnChannel.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + agency_name: { + value: cdktf.stringToHclTerraform(this._agencyName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs_channel: { + value: rmsResourceRecorderObsChannelToHclTerraform(this._obsChannel.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsResourceRecorderObsChannelList", + }, + selector: { + value: rmsResourceRecorderSelectorToHclTerraform(this._selector.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsResourceRecorderSelectorList", + }, + smn_channel: { + value: rmsResourceRecorderSmnChannelToHclTerraform(this._smnChannel.internalValue), + isBlock: true, + type: "list", + storageClassType: "RmsResourceRecorderSmnChannelList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/scm-certificate/README.md b/src/constructs/providers/huaweicloud/scm-certificate/README.md new file mode 100644 index 00000000..ddfc0c0f --- /dev/null +++ b/src/constructs/providers/huaweicloud/scm-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_scm_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_scm_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate). diff --git a/src/constructs/providers/huaweicloud/scm-certificate/index.ts b/src/constructs/providers/huaweicloud/scm-certificate/index.ts new file mode 100644 index 00000000..82e644bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/scm-certificate/index.ts @@ -0,0 +1,633 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ScmCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#certificate ScmCertificate#certificate} + */ + readonly certificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#certificate_chain ScmCertificate#certificate_chain} + */ + readonly certificateChain?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#enc_certificate ScmCertificate#enc_certificate} + */ + readonly encCertificate?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#enc_private_key ScmCertificate#enc_private_key} + */ + readonly encPrivateKey?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#enterprise_project_id ScmCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#id ScmCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#name ScmCertificate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#private_key ScmCertificate#private_key} + */ + readonly privateKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#region ScmCertificate#region} + */ + readonly region?: string; + /** + * target block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#target ScmCertificate#target} + */ + readonly target?: ScmCertificateTarget[] | cdktf.IResolvable; +} +export interface ScmCertificateAuthentifications { +} + +export function scmCertificateAuthentificationsToTerraform(struct?: ScmCertificateAuthentifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function scmCertificateAuthentificationsToHclTerraform(struct?: ScmCertificateAuthentifications): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class ScmCertificateAuthentificationsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ScmCertificateAuthentifications | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ScmCertificateAuthentifications | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // record_name - computed: true, optional: false, required: false + public get recordName() { + return this.getStringAttribute('record_name'); + } + + // record_type - computed: true, optional: false, required: false + public get recordType() { + return this.getStringAttribute('record_type'); + } + + // record_value - computed: true, optional: false, required: false + public get recordValue() { + return this.getStringAttribute('record_value'); + } +} + +export class ScmCertificateAuthentificationsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ScmCertificateAuthentificationsOutputReference { + return new ScmCertificateAuthentificationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ScmCertificateTarget { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#project ScmCertificate#project} + */ + readonly project?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#service ScmCertificate#service} + */ + readonly service: string; +} + +export function scmCertificateTargetToTerraform(struct?: ScmCertificateTarget | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + project: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.project), + service: cdktf.stringToTerraform(struct!.service), + } +} + + +export function scmCertificateTargetToHclTerraform(struct?: ScmCertificateTarget | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + project: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.project), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + service: { + value: cdktf.stringToHclTerraform(struct!.service), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ScmCertificateTargetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ScmCertificateTarget | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._project !== undefined) { + hasAnyValues = true; + internalValueResult.project = this._project; + } + if (this._service !== undefined) { + hasAnyValues = true; + internalValueResult.service = this._service; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ScmCertificateTarget | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._project = undefined; + this._service = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._project = value.project; + this._service = value.service; + } + } + + // project - computed: false, optional: true, required: false + private _project?: string[]; + public get project() { + return this.getListAttribute('project'); + } + public set project(value: string[]) { + this._project = value; + } + public resetProject() { + this._project = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectInput() { + return this._project; + } + + // service - computed: false, optional: false, required: true + private _service?: string; + public get service() { + return this.getStringAttribute('service'); + } + public set service(value: string) { + this._service = value; + } + // Temporarily expose input value. Use with caution. + public get serviceInput() { + return this._service; + } +} + +export class ScmCertificateTargetList extends cdktf.ComplexList { + public internalValue? : ScmCertificateTarget[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ScmCertificateTargetOutputReference { + return new ScmCertificateTargetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate huaweicloud_scm_certificate} +*/ +export class ScmCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_scm_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ScmCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ScmCertificate to import + * @param importFromId The id of the existing ScmCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ScmCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_scm_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/scm_certificate huaweicloud_scm_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ScmCertificateConfig + */ + public constructor(scope: Construct, id: string, config: ScmCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_scm_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificate = config.certificate; + this._certificateChain = config.certificateChain; + this._encCertificate = config.encCertificate; + this._encPrivateKey = config.encPrivateKey; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._target.internalValue = config.target; + } + + // ========== + // ATTRIBUTES + // ========== + + // authentifications - computed: true, optional: false, required: false + private _authentifications = new ScmCertificateAuthentificationsList(this, "authentifications", false); + public get authentifications() { + return this._authentifications; + } + + // certificate - computed: false, optional: false, required: true + private _certificate?: string; + public get certificate() { + return this.getStringAttribute('certificate'); + } + public set certificate(value: string) { + this._certificate = value; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate; + } + + // certificate_chain - computed: false, optional: true, required: false + private _certificateChain?: string; + public get certificateChain() { + return this.getStringAttribute('certificate_chain'); + } + public set certificateChain(value: string) { + this._certificateChain = value; + } + public resetCertificateChain() { + this._certificateChain = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateChainInput() { + return this._certificateChain; + } + + // domain - computed: true, optional: false, required: false + public get domain() { + return this.getStringAttribute('domain'); + } + + // domain_count - computed: true, optional: false, required: false + public get domainCount() { + return this.getNumberAttribute('domain_count'); + } + + // enc_certificate - computed: false, optional: true, required: false + private _encCertificate?: string; + public get encCertificate() { + return this.getStringAttribute('enc_certificate'); + } + public set encCertificate(value: string) { + this._encCertificate = value; + } + public resetEncCertificate() { + this._encCertificate = undefined; + } + // Temporarily expose input value. Use with caution. + public get encCertificateInput() { + return this._encCertificate; + } + + // enc_private_key - computed: false, optional: true, required: false + private _encPrivateKey?: string; + public get encPrivateKey() { + return this.getStringAttribute('enc_private_key'); + } + public set encPrivateKey(value: string) { + this._encPrivateKey = value; + } + public resetEncPrivateKey() { + this._encPrivateKey = undefined; + } + // Temporarily expose input value. Use with caution. + public get encPrivateKeyInput() { + return this._encPrivateKey; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // not_after - computed: true, optional: false, required: false + public get notAfter() { + return this.getStringAttribute('not_after'); + } + + // not_before - computed: true, optional: false, required: false + public get notBefore() { + return this.getStringAttribute('not_before'); + } + + // private_key - computed: false, optional: false, required: true + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // push_support - computed: true, optional: false, required: false + public get pushSupport() { + return this.getStringAttribute('push_support'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // target - computed: false, optional: true, required: false + private _target = new ScmCertificateTargetList(this, "target", false); + public get target() { + return this._target; + } + public putTarget(value: ScmCertificateTarget[] | cdktf.IResolvable) { + this._target.internalValue = value; + } + public resetTarget() { + this._target.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetInput() { + return this._target.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate: cdktf.stringToTerraform(this._certificate), + certificate_chain: cdktf.stringToTerraform(this._certificateChain), + enc_certificate: cdktf.stringToTerraform(this._encCertificate), + enc_private_key: cdktf.stringToTerraform(this._encPrivateKey), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + target: cdktf.listMapper(scmCertificateTargetToTerraform, true)(this._target.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate: { + value: cdktf.stringToHclTerraform(this._certificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_chain: { + value: cdktf.stringToHclTerraform(this._certificateChain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enc_certificate: { + value: cdktf.stringToHclTerraform(this._encCertificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enc_private_key: { + value: cdktf.stringToHclTerraform(this._encPrivateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target: { + value: cdktf.listMapperHcl(scmCertificateTargetToHclTerraform, true)(this._target.internalValue), + isBlock: true, + type: "list", + storageClassType: "ScmCertificateTargetList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sdrs-drill/README.md b/src/constructs/providers/huaweicloud/sdrs-drill/README.md new file mode 100644 index 00000000..4ed80c97 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-drill/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sdrs_drill` + +Refer to the Terraform Registry for docs: [`huaweicloud_sdrs_drill`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill). diff --git a/src/constructs/providers/huaweicloud/sdrs-drill/index.ts b/src/constructs/providers/huaweicloud/sdrs-drill/index.ts new file mode 100644 index 00000000..6dfec5d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-drill/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SdrsDrillConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#drill_vpc_id SdrsDrill#drill_vpc_id} + */ + readonly drillVpcId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#group_id SdrsDrill#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#id SdrsDrill#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#name SdrsDrill#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#region SdrsDrill#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#timeouts SdrsDrill#timeouts} + */ + readonly timeouts?: SdrsDrillTimeouts; +} +export interface SdrsDrillTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#create SdrsDrill#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#delete SdrsDrill#delete} + */ + readonly delete?: string; +} + +export function sdrsDrillTimeoutsToTerraform(struct?: SdrsDrillTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sdrsDrillTimeoutsToHclTerraform(struct?: SdrsDrillTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SdrsDrillTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SdrsDrillTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SdrsDrillTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill huaweicloud_sdrs_drill} +*/ +export class SdrsDrill extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sdrs_drill"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SdrsDrill resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SdrsDrill to import + * @param importFromId The id of the existing SdrsDrill that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SdrsDrill to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sdrs_drill", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_drill huaweicloud_sdrs_drill} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SdrsDrillConfig + */ + public constructor(scope: Construct, id: string, config: SdrsDrillConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sdrs_drill', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._drillVpcId = config.drillVpcId; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // drill_vpc_id - computed: true, optional: true, required: false + private _drillVpcId?: string; + public get drillVpcId() { + return this.getStringAttribute('drill_vpc_id'); + } + public set drillVpcId(value: string) { + this._drillVpcId = value; + } + public resetDrillVpcId() { + this._drillVpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get drillVpcIdInput() { + return this._drillVpcId; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SdrsDrillTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SdrsDrillTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + drill_vpc_id: cdktf.stringToTerraform(this._drillVpcId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: sdrsDrillTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + drill_vpc_id: { + value: cdktf.stringToHclTerraform(this._drillVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sdrsDrillTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SdrsDrillTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sdrs-protected-instance/README.md b/src/constructs/providers/huaweicloud/sdrs-protected-instance/README.md new file mode 100644 index 00000000..8b5de44b --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-protected-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sdrs_protected_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_sdrs_protected_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance). diff --git a/src/constructs/providers/huaweicloud/sdrs-protected-instance/index.ts b/src/constructs/providers/huaweicloud/sdrs-protected-instance/index.ts new file mode 100644 index 00000000..46f3c86c --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-protected-instance/index.ts @@ -0,0 +1,577 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SdrsProtectedInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#cluster_id SdrsProtectedInstance#cluster_id} + */ + readonly clusterId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#delete_target_eip SdrsProtectedInstance#delete_target_eip} + */ + readonly deleteTargetEip?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#delete_target_server SdrsProtectedInstance#delete_target_server} + */ + readonly deleteTargetServer?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#description SdrsProtectedInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#group_id SdrsProtectedInstance#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#id SdrsProtectedInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#name SdrsProtectedInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#primary_ip_address SdrsProtectedInstance#primary_ip_address} + */ + readonly primaryIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#primary_subnet_id SdrsProtectedInstance#primary_subnet_id} + */ + readonly primarySubnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#region SdrsProtectedInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#server_id SdrsProtectedInstance#server_id} + */ + readonly serverId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#tags SdrsProtectedInstance#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#timeouts SdrsProtectedInstance#timeouts} + */ + readonly timeouts?: SdrsProtectedInstanceTimeouts; +} +export interface SdrsProtectedInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#create SdrsProtectedInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#delete SdrsProtectedInstance#delete} + */ + readonly delete?: string; +} + +export function sdrsProtectedInstanceTimeoutsToTerraform(struct?: SdrsProtectedInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sdrsProtectedInstanceTimeoutsToHclTerraform(struct?: SdrsProtectedInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SdrsProtectedInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SdrsProtectedInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SdrsProtectedInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance huaweicloud_sdrs_protected_instance} +*/ +export class SdrsProtectedInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sdrs_protected_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SdrsProtectedInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SdrsProtectedInstance to import + * @param importFromId The id of the existing SdrsProtectedInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SdrsProtectedInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sdrs_protected_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protected_instance huaweicloud_sdrs_protected_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SdrsProtectedInstanceConfig + */ + public constructor(scope: Construct, id: string, config: SdrsProtectedInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sdrs_protected_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._deleteTargetEip = config.deleteTargetEip; + this._deleteTargetServer = config.deleteTargetServer; + this._description = config.description; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._primaryIpAddress = config.primaryIpAddress; + this._primarySubnetId = config.primarySubnetId; + this._region = config.region; + this._serverId = config.serverId; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: false, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // delete_target_eip - computed: false, optional: true, required: false + private _deleteTargetEip?: boolean | cdktf.IResolvable; + public get deleteTargetEip() { + return this.getBooleanAttribute('delete_target_eip'); + } + public set deleteTargetEip(value: boolean | cdktf.IResolvable) { + this._deleteTargetEip = value; + } + public resetDeleteTargetEip() { + this._deleteTargetEip = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteTargetEipInput() { + return this._deleteTargetEip; + } + + // delete_target_server - computed: false, optional: true, required: false + private _deleteTargetServer?: boolean | cdktf.IResolvable; + public get deleteTargetServer() { + return this.getBooleanAttribute('delete_target_server'); + } + public set deleteTargetServer(value: boolean | cdktf.IResolvable) { + this._deleteTargetServer = value; + } + public resetDeleteTargetServer() { + this._deleteTargetServer = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteTargetServerInput() { + return this._deleteTargetServer; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // primary_ip_address - computed: false, optional: true, required: false + private _primaryIpAddress?: string; + public get primaryIpAddress() { + return this.getStringAttribute('primary_ip_address'); + } + public set primaryIpAddress(value: string) { + this._primaryIpAddress = value; + } + public resetPrimaryIpAddress() { + this._primaryIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryIpAddressInput() { + return this._primaryIpAddress; + } + + // primary_subnet_id - computed: false, optional: true, required: false + private _primarySubnetId?: string; + public get primarySubnetId() { + return this.getStringAttribute('primary_subnet_id'); + } + public set primarySubnetId(value: string) { + this._primarySubnetId = value; + } + public resetPrimarySubnetId() { + this._primarySubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get primarySubnetIdInput() { + return this._primarySubnetId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: false, required: true + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // target_server - computed: true, optional: false, required: false + public get targetServer() { + return this.getStringAttribute('target_server'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SdrsProtectedInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SdrsProtectedInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + delete_target_eip: cdktf.booleanToTerraform(this._deleteTargetEip), + delete_target_server: cdktf.booleanToTerraform(this._deleteTargetServer), + description: cdktf.stringToTerraform(this._description), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + primary_ip_address: cdktf.stringToTerraform(this._primaryIpAddress), + primary_subnet_id: cdktf.stringToTerraform(this._primarySubnetId), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: sdrsProtectedInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_target_eip: { + value: cdktf.booleanToHclTerraform(this._deleteTargetEip), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + delete_target_server: { + value: cdktf.booleanToHclTerraform(this._deleteTargetServer), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_ip_address: { + value: cdktf.stringToHclTerraform(this._primaryIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_subnet_id: { + value: cdktf.stringToHclTerraform(this._primarySubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: sdrsProtectedInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SdrsProtectedInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sdrs-protection-group/README.md b/src/constructs/providers/huaweicloud/sdrs-protection-group/README.md new file mode 100644 index 00000000..6102ca7d --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-protection-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sdrs_protection_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_sdrs_protection_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group). diff --git a/src/constructs/providers/huaweicloud/sdrs-protection-group/index.ts b/src/constructs/providers/huaweicloud/sdrs-protection-group/index.ts new file mode 100644 index 00000000..d517894c --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-protection-group/index.ts @@ -0,0 +1,560 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SdrsProtectionGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of a protection group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#description SdrsProtectionGroup#description} + */ + readonly description?: string; + /** + * Specifies the ID of an active-active domain. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#domain_id SdrsProtectionGroup#domain_id} + */ + readonly domainId: string; + /** + * Specifies the deployment model. The default value is **migration**, indicating migration + * within a VPC. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#dr_type SdrsProtectionGroup#dr_type} + */ + readonly drType?: string; + /** + * Specifies whether enable the protection group start protecting + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#enable SdrsProtectionGroup#enable} + */ + readonly enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#id SdrsProtectionGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of a protection group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#name SdrsProtectionGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#region SdrsProtectionGroup#region} + */ + readonly region?: string; + /** + * Specifies the production site AZ of a protection group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#source_availability_zone SdrsProtectionGroup#source_availability_zone} + */ + readonly sourceAvailabilityZone: string; + /** + * Specifies the ID of the VPC for the production site. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#source_vpc_id SdrsProtectionGroup#source_vpc_id} + */ + readonly sourceVpcId: string; + /** + * Specifies the disaster recovery site AZ of a protection group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#target_availability_zone SdrsProtectionGroup#target_availability_zone} + */ + readonly targetAvailabilityZone: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#timeouts SdrsProtectionGroup#timeouts} + */ + readonly timeouts?: SdrsProtectionGroupTimeouts; +} +export interface SdrsProtectionGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#create SdrsProtectionGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#delete SdrsProtectionGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#update SdrsProtectionGroup#update} + */ + readonly update?: string; +} + +export function sdrsProtectionGroupTimeoutsToTerraform(struct?: SdrsProtectionGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function sdrsProtectionGroupTimeoutsToHclTerraform(struct?: SdrsProtectionGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SdrsProtectionGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SdrsProtectionGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SdrsProtectionGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group huaweicloud_sdrs_protection_group} +*/ +export class SdrsProtectionGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sdrs_protection_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SdrsProtectionGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SdrsProtectionGroup to import + * @param importFromId The id of the existing SdrsProtectionGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SdrsProtectionGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sdrs_protection_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_protection_group huaweicloud_sdrs_protection_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SdrsProtectionGroupConfig + */ + public constructor(scope: Construct, id: string, config: SdrsProtectionGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sdrs_protection_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._domainId = config.domainId; + this._drType = config.drType; + this._enable = config.enable; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sourceAvailabilityZone = config.sourceAvailabilityZone; + this._sourceVpcId = config.sourceVpcId; + this._targetAvailabilityZone = config.targetAvailabilityZone; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain_id - computed: false, optional: false, required: true + private _domainId?: string; + public get domainId() { + return this.getStringAttribute('domain_id'); + } + public set domainId(value: string) { + this._domainId = value; + } + // Temporarily expose input value. Use with caution. + public get domainIdInput() { + return this._domainId; + } + + // dr_type - computed: true, optional: true, required: false + private _drType?: string; + public get drType() { + return this.getStringAttribute('dr_type'); + } + public set drType(value: string) { + this._drType = value; + } + public resetDrType() { + this._drType = undefined; + } + // Temporarily expose input value. Use with caution. + public get drTypeInput() { + return this._drType; + } + + // enable - computed: false, optional: true, required: false + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + public resetEnable() { + this._enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_availability_zone - computed: false, optional: false, required: true + private _sourceAvailabilityZone?: string; + public get sourceAvailabilityZone() { + return this.getStringAttribute('source_availability_zone'); + } + public set sourceAvailabilityZone(value: string) { + this._sourceAvailabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get sourceAvailabilityZoneInput() { + return this._sourceAvailabilityZone; + } + + // source_vpc_id - computed: false, optional: false, required: true + private _sourceVpcId?: string; + public get sourceVpcId() { + return this.getStringAttribute('source_vpc_id'); + } + public set sourceVpcId(value: string) { + this._sourceVpcId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceVpcIdInput() { + return this._sourceVpcId; + } + + // target_availability_zone - computed: false, optional: false, required: true + private _targetAvailabilityZone?: string; + public get targetAvailabilityZone() { + return this.getStringAttribute('target_availability_zone'); + } + public set targetAvailabilityZone(value: string) { + this._targetAvailabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get targetAvailabilityZoneInput() { + return this._targetAvailabilityZone; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SdrsProtectionGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SdrsProtectionGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + domain_id: cdktf.stringToTerraform(this._domainId), + dr_type: cdktf.stringToTerraform(this._drType), + enable: cdktf.booleanToTerraform(this._enable), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + source_availability_zone: cdktf.stringToTerraform(this._sourceAvailabilityZone), + source_vpc_id: cdktf.stringToTerraform(this._sourceVpcId), + target_availability_zone: cdktf.stringToTerraform(this._targetAvailabilityZone), + timeouts: sdrsProtectionGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain_id: { + value: cdktf.stringToHclTerraform(this._domainId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dr_type: { + value: cdktf.stringToHclTerraform(this._drType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.booleanToHclTerraform(this._enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_availability_zone: { + value: cdktf.stringToHclTerraform(this._sourceAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_vpc_id: { + value: cdktf.stringToHclTerraform(this._sourceVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_availability_zone: { + value: cdktf.stringToHclTerraform(this._targetAvailabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sdrsProtectionGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SdrsProtectionGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sdrs-replication-attach/README.md b/src/constructs/providers/huaweicloud/sdrs-replication-attach/README.md new file mode 100644 index 00000000..fce57b9e --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-replication-attach/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sdrs_replication_attach` + +Refer to the Terraform Registry for docs: [`huaweicloud_sdrs_replication_attach`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach). diff --git a/src/constructs/providers/huaweicloud/sdrs-replication-attach/index.ts b/src/constructs/providers/huaweicloud/sdrs-replication-attach/index.ts new file mode 100644 index 00000000..66ceabc6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-replication-attach/index.ts @@ -0,0 +1,381 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SdrsReplicationAttachConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#device SdrsReplicationAttach#device} + */ + readonly device: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#id SdrsReplicationAttach#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#instance_id SdrsReplicationAttach#instance_id} + */ + readonly instanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#region SdrsReplicationAttach#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#replication_id SdrsReplicationAttach#replication_id} + */ + readonly replicationId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#timeouts SdrsReplicationAttach#timeouts} + */ + readonly timeouts?: SdrsReplicationAttachTimeouts; +} +export interface SdrsReplicationAttachTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#create SdrsReplicationAttach#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#delete SdrsReplicationAttach#delete} + */ + readonly delete?: string; +} + +export function sdrsReplicationAttachTimeoutsToTerraform(struct?: SdrsReplicationAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sdrsReplicationAttachTimeoutsToHclTerraform(struct?: SdrsReplicationAttachTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SdrsReplicationAttachTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SdrsReplicationAttachTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SdrsReplicationAttachTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach huaweicloud_sdrs_replication_attach} +*/ +export class SdrsReplicationAttach extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sdrs_replication_attach"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SdrsReplicationAttach resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SdrsReplicationAttach to import + * @param importFromId The id of the existing SdrsReplicationAttach that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SdrsReplicationAttach to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sdrs_replication_attach", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_attach huaweicloud_sdrs_replication_attach} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SdrsReplicationAttachConfig + */ + public constructor(scope: Construct, id: string, config: SdrsReplicationAttachConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sdrs_replication_attach', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._device = config.device; + this._id = config.id; + this._instanceId = config.instanceId; + this._region = config.region; + this._replicationId = config.replicationId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // device - computed: false, optional: false, required: true + private _device?: string; + public get device() { + return this.getStringAttribute('device'); + } + public set device(value: string) { + this._device = value; + } + // Temporarily expose input value. Use with caution. + public get deviceInput() { + return this._device; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replication_id - computed: false, optional: false, required: true + private _replicationId?: string; + public get replicationId() { + return this.getStringAttribute('replication_id'); + } + public set replicationId(value: string) { + this._replicationId = value; + } + // Temporarily expose input value. Use with caution. + public get replicationIdInput() { + return this._replicationId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SdrsReplicationAttachTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SdrsReplicationAttachTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + device: cdktf.stringToTerraform(this._device), + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + region: cdktf.stringToTerraform(this._region), + replication_id: cdktf.stringToTerraform(this._replicationId), + timeouts: sdrsReplicationAttachTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + device: { + value: cdktf.stringToHclTerraform(this._device), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replication_id: { + value: cdktf.stringToHclTerraform(this._replicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sdrsReplicationAttachTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SdrsReplicationAttachTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sdrs-replication-pair/README.md b/src/constructs/providers/huaweicloud/sdrs-replication-pair/README.md new file mode 100644 index 00000000..a0b4fdbc --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-replication-pair/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sdrs_replication_pair` + +Refer to the Terraform Registry for docs: [`huaweicloud_sdrs_replication_pair`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair). diff --git a/src/constructs/providers/huaweicloud/sdrs-replication-pair/index.ts b/src/constructs/providers/huaweicloud/sdrs-replication-pair/index.ts new file mode 100644 index 00000000..6eb3fae9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sdrs-replication-pair/index.ts @@ -0,0 +1,452 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SdrsReplicationPairConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#delete_target_volume SdrsReplicationPair#delete_target_volume} + */ + readonly deleteTargetVolume?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#description SdrsReplicationPair#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#group_id SdrsReplicationPair#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#id SdrsReplicationPair#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#name SdrsReplicationPair#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#region SdrsReplicationPair#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#volume_id SdrsReplicationPair#volume_id} + */ + readonly volumeId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#timeouts SdrsReplicationPair#timeouts} + */ + readonly timeouts?: SdrsReplicationPairTimeouts; +} +export interface SdrsReplicationPairTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#create SdrsReplicationPair#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#delete SdrsReplicationPair#delete} + */ + readonly delete?: string; +} + +export function sdrsReplicationPairTimeoutsToTerraform(struct?: SdrsReplicationPairTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sdrsReplicationPairTimeoutsToHclTerraform(struct?: SdrsReplicationPairTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SdrsReplicationPairTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SdrsReplicationPairTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SdrsReplicationPairTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair huaweicloud_sdrs_replication_pair} +*/ +export class SdrsReplicationPair extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sdrs_replication_pair"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SdrsReplicationPair resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SdrsReplicationPair to import + * @param importFromId The id of the existing SdrsReplicationPair that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SdrsReplicationPair to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sdrs_replication_pair", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sdrs_replication_pair huaweicloud_sdrs_replication_pair} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SdrsReplicationPairConfig + */ + public constructor(scope: Construct, id: string, config: SdrsReplicationPairConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sdrs_replication_pair', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteTargetVolume = config.deleteTargetVolume; + this._description = config.description; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._volumeId = config.volumeId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // delete_target_volume - computed: false, optional: true, required: false + private _deleteTargetVolume?: boolean | cdktf.IResolvable; + public get deleteTargetVolume() { + return this.getBooleanAttribute('delete_target_volume'); + } + public set deleteTargetVolume(value: boolean | cdktf.IResolvable) { + this._deleteTargetVolume = value; + } + public resetDeleteTargetVolume() { + this._deleteTargetVolume = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteTargetVolumeInput() { + return this._deleteTargetVolume; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // fault_level - computed: true, optional: false, required: false + public get faultLevel() { + return this.getStringAttribute('fault_level'); + } + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replication_model - computed: true, optional: false, required: false + public get replicationModel() { + return this.getStringAttribute('replication_model'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // target_volume_id - computed: true, optional: false, required: false + public get targetVolumeId() { + return this.getStringAttribute('target_volume_id'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SdrsReplicationPairTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SdrsReplicationPairTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_target_volume: cdktf.booleanToTerraform(this._deleteTargetVolume), + description: cdktf.stringToTerraform(this._description), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + volume_id: cdktf.stringToTerraform(this._volumeId), + timeouts: sdrsReplicationPairTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_target_volume: { + value: cdktf.booleanToHclTerraform(this._deleteTargetVolume), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sdrsReplicationPairTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SdrsReplicationPairTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-alert-rule/README.md b/src/constructs/providers/huaweicloud/secmaster-alert-rule/README.md new file mode 100644 index 00000000..91bc9162 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-alert-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_alert_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_alert_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule). diff --git a/src/constructs/providers/huaweicloud/secmaster-alert-rule/index.ts b/src/constructs/providers/huaweicloud/secmaster-alert-rule/index.ts new file mode 100644 index 00000000..a4a3c0d4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-alert-rule/index.ts @@ -0,0 +1,1220 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterAlertRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the custom information of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#custom_information SecmasterAlertRule#custom_information} + */ + readonly customInformation?: { [key: string]: string }; + /** + * Specifies whether to generate debugging alarms. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#debugging_alarm SecmasterAlertRule#debugging_alarm} + */ + readonly debuggingAlarm?: boolean | cdktf.IResolvable; + /** + * Specifies the description of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#description SecmasterAlertRule#description} + */ + readonly description: string; + /** + * Specifies whether to put events in a group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#event_grouping SecmasterAlertRule#event_grouping} + */ + readonly eventGrouping?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#id SecmasterAlertRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the alert rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#name SecmasterAlertRule#name} + */ + readonly name: string; + /** + * Specifies the pipeline ID of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#pipeline_id SecmasterAlertRule#pipeline_id} + */ + readonly pipelineId: string; + /** + * Specifies the query rule of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#query_rule SecmasterAlertRule#query_rule} + */ + readonly queryRule: string; + /** + * Specifies the query type of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#query_type SecmasterAlertRule#query_type} + */ + readonly queryType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#region SecmasterAlertRule#region} + */ + readonly region?: string; + /** + * Specifies the severity of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#severity SecmasterAlertRule#severity} + */ + readonly severity: string; + /** + * Specifies the status of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#status SecmasterAlertRule#status} + */ + readonly status: string; + /** + * Specifies whether to stop the query when an alarm is generated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#suppression SecmasterAlertRule#suppression} + */ + readonly suppression?: boolean | cdktf.IResolvable; + /** + * Specifies the type of the alert rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#type SecmasterAlertRule#type} + */ + readonly type: { [key: string]: string }; + /** + * Specifies the ID of the workspace to which the alert rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#workspace_id SecmasterAlertRule#workspace_id} + */ + readonly workspaceId: string; + /** + * query_plan block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#query_plan SecmasterAlertRule#query_plan} + */ + readonly queryPlan: SecmasterAlertRuleQueryPlan; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#timeouts SecmasterAlertRule#timeouts} + */ + readonly timeouts?: SecmasterAlertRuleTimeouts; + /** + * triggers block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#triggers SecmasterAlertRule#triggers} + */ + readonly triggers: SecmasterAlertRuleTriggers[] | cdktf.IResolvable; +} +export interface SecmasterAlertRuleQueryPlan { + /** + * Specifies the execution delay in minutes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#execution_delay SecmasterAlertRule#execution_delay} + */ + readonly executionDelay?: number; + /** + * Specifies the overtime interval in minutes. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#overtime_interval SecmasterAlertRule#overtime_interval} + */ + readonly overtimeInterval?: number; + /** + * Specifies the query interval. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#query_interval SecmasterAlertRule#query_interval} + */ + readonly queryInterval: number; + /** + * Specifies the query interval unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#query_interval_unit SecmasterAlertRule#query_interval_unit} + */ + readonly queryIntervalUnit: string; + /** + * Specifies the time window. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#time_window SecmasterAlertRule#time_window} + */ + readonly timeWindow: number; + /** + * Specifies the time window unit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#time_window_unit SecmasterAlertRule#time_window_unit} + */ + readonly timeWindowUnit: string; +} + +export function secmasterAlertRuleQueryPlanToTerraform(struct?: SecmasterAlertRuleQueryPlanOutputReference | SecmasterAlertRuleQueryPlan): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + execution_delay: cdktf.numberToTerraform(struct!.executionDelay), + overtime_interval: cdktf.numberToTerraform(struct!.overtimeInterval), + query_interval: cdktf.numberToTerraform(struct!.queryInterval), + query_interval_unit: cdktf.stringToTerraform(struct!.queryIntervalUnit), + time_window: cdktf.numberToTerraform(struct!.timeWindow), + time_window_unit: cdktf.stringToTerraform(struct!.timeWindowUnit), + } +} + + +export function secmasterAlertRuleQueryPlanToHclTerraform(struct?: SecmasterAlertRuleQueryPlanOutputReference | SecmasterAlertRuleQueryPlan): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + execution_delay: { + value: cdktf.numberToHclTerraform(struct!.executionDelay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + overtime_interval: { + value: cdktf.numberToHclTerraform(struct!.overtimeInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + query_interval: { + value: cdktf.numberToHclTerraform(struct!.queryInterval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + query_interval_unit: { + value: cdktf.stringToHclTerraform(struct!.queryIntervalUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + time_window: { + value: cdktf.numberToHclTerraform(struct!.timeWindow), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time_window_unit: { + value: cdktf.stringToHclTerraform(struct!.timeWindowUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterAlertRuleQueryPlanOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterAlertRuleQueryPlan | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._executionDelay !== undefined) { + hasAnyValues = true; + internalValueResult.executionDelay = this._executionDelay; + } + if (this._overtimeInterval !== undefined) { + hasAnyValues = true; + internalValueResult.overtimeInterval = this._overtimeInterval; + } + if (this._queryInterval !== undefined) { + hasAnyValues = true; + internalValueResult.queryInterval = this._queryInterval; + } + if (this._queryIntervalUnit !== undefined) { + hasAnyValues = true; + internalValueResult.queryIntervalUnit = this._queryIntervalUnit; + } + if (this._timeWindow !== undefined) { + hasAnyValues = true; + internalValueResult.timeWindow = this._timeWindow; + } + if (this._timeWindowUnit !== undefined) { + hasAnyValues = true; + internalValueResult.timeWindowUnit = this._timeWindowUnit; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterAlertRuleQueryPlan | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._executionDelay = undefined; + this._overtimeInterval = undefined; + this._queryInterval = undefined; + this._queryIntervalUnit = undefined; + this._timeWindow = undefined; + this._timeWindowUnit = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._executionDelay = value.executionDelay; + this._overtimeInterval = value.overtimeInterval; + this._queryInterval = value.queryInterval; + this._queryIntervalUnit = value.queryIntervalUnit; + this._timeWindow = value.timeWindow; + this._timeWindowUnit = value.timeWindowUnit; + } + } + + // execution_delay - computed: true, optional: true, required: false + private _executionDelay?: number; + public get executionDelay() { + return this.getNumberAttribute('execution_delay'); + } + public set executionDelay(value: number) { + this._executionDelay = value; + } + public resetExecutionDelay() { + this._executionDelay = undefined; + } + // Temporarily expose input value. Use with caution. + public get executionDelayInput() { + return this._executionDelay; + } + + // overtime_interval - computed: true, optional: true, required: false + private _overtimeInterval?: number; + public get overtimeInterval() { + return this.getNumberAttribute('overtime_interval'); + } + public set overtimeInterval(value: number) { + this._overtimeInterval = value; + } + public resetOvertimeInterval() { + this._overtimeInterval = undefined; + } + // Temporarily expose input value. Use with caution. + public get overtimeIntervalInput() { + return this._overtimeInterval; + } + + // query_interval - computed: false, optional: false, required: true + private _queryInterval?: number; + public get queryInterval() { + return this.getNumberAttribute('query_interval'); + } + public set queryInterval(value: number) { + this._queryInterval = value; + } + // Temporarily expose input value. Use with caution. + public get queryIntervalInput() { + return this._queryInterval; + } + + // query_interval_unit - computed: false, optional: false, required: true + private _queryIntervalUnit?: string; + public get queryIntervalUnit() { + return this.getStringAttribute('query_interval_unit'); + } + public set queryIntervalUnit(value: string) { + this._queryIntervalUnit = value; + } + // Temporarily expose input value. Use with caution. + public get queryIntervalUnitInput() { + return this._queryIntervalUnit; + } + + // time_window - computed: false, optional: false, required: true + private _timeWindow?: number; + public get timeWindow() { + return this.getNumberAttribute('time_window'); + } + public set timeWindow(value: number) { + this._timeWindow = value; + } + // Temporarily expose input value. Use with caution. + public get timeWindowInput() { + return this._timeWindow; + } + + // time_window_unit - computed: false, optional: false, required: true + private _timeWindowUnit?: string; + public get timeWindowUnit() { + return this.getStringAttribute('time_window_unit'); + } + public set timeWindowUnit(value: string) { + this._timeWindowUnit = value; + } + // Temporarily expose input value. Use with caution. + public get timeWindowUnitInput() { + return this._timeWindowUnit; + } +} +export interface SecmasterAlertRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#create SecmasterAlertRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#update SecmasterAlertRule#update} + */ + readonly update?: string; +} + +export function secmasterAlertRuleTimeoutsToTerraform(struct?: SecmasterAlertRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function secmasterAlertRuleTimeoutsToHclTerraform(struct?: SecmasterAlertRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterAlertRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SecmasterAlertRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterAlertRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} +export interface SecmasterAlertRuleTriggers { + /** + * Specifies the accumulated times. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#accumulated_times SecmasterAlertRule#accumulated_times} + */ + readonly accumulatedTimes: number; + /** + * Specifies the expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#expression SecmasterAlertRule#expression} + */ + readonly expression: string; + /** + * Specifies the trigger mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#mode SecmasterAlertRule#mode} + */ + readonly mode: string; + /** + * Specifies the operator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#operator SecmasterAlertRule#operator} + */ + readonly operator: string; + /** + * Specifies the severity of the trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#severity SecmasterAlertRule#severity} + */ + readonly severity: string; +} + +export function secmasterAlertRuleTriggersToTerraform(struct?: SecmasterAlertRuleTriggers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + accumulated_times: cdktf.numberToTerraform(struct!.accumulatedTimes), + expression: cdktf.stringToTerraform(struct!.expression), + mode: cdktf.stringToTerraform(struct!.mode), + operator: cdktf.stringToTerraform(struct!.operator), + severity: cdktf.stringToTerraform(struct!.severity), + } +} + + +export function secmasterAlertRuleTriggersToHclTerraform(struct?: SecmasterAlertRuleTriggers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + accumulated_times: { + value: cdktf.numberToHclTerraform(struct!.accumulatedTimes), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + expression: { + value: cdktf.stringToHclTerraform(struct!.expression), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.stringToHclTerraform(struct!.mode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operator: { + value: cdktf.stringToHclTerraform(struct!.operator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(struct!.severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterAlertRuleTriggersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SecmasterAlertRuleTriggers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accumulatedTimes !== undefined) { + hasAnyValues = true; + internalValueResult.accumulatedTimes = this._accumulatedTimes; + } + if (this._expression !== undefined) { + hasAnyValues = true; + internalValueResult.expression = this._expression; + } + if (this._mode !== undefined) { + hasAnyValues = true; + internalValueResult.mode = this._mode; + } + if (this._operator !== undefined) { + hasAnyValues = true; + internalValueResult.operator = this._operator; + } + if (this._severity !== undefined) { + hasAnyValues = true; + internalValueResult.severity = this._severity; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterAlertRuleTriggers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._accumulatedTimes = undefined; + this._expression = undefined; + this._mode = undefined; + this._operator = undefined; + this._severity = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._accumulatedTimes = value.accumulatedTimes; + this._expression = value.expression; + this._mode = value.mode; + this._operator = value.operator; + this._severity = value.severity; + } + } + + // accumulated_times - computed: false, optional: false, required: true + private _accumulatedTimes?: number; + public get accumulatedTimes() { + return this.getNumberAttribute('accumulated_times'); + } + public set accumulatedTimes(value: number) { + this._accumulatedTimes = value; + } + // Temporarily expose input value. Use with caution. + public get accumulatedTimesInput() { + return this._accumulatedTimes; + } + + // expression - computed: false, optional: false, required: true + private _expression?: string; + public get expression() { + return this.getStringAttribute('expression'); + } + public set expression(value: string) { + this._expression = value; + } + // Temporarily expose input value. Use with caution. + public get expressionInput() { + return this._expression; + } + + // mode - computed: false, optional: false, required: true + private _mode?: string; + public get mode() { + return this.getStringAttribute('mode'); + } + public set mode(value: string) { + this._mode = value; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // operator - computed: false, optional: false, required: true + private _operator?: string; + public get operator() { + return this.getStringAttribute('operator'); + } + public set operator(value: string) { + this._operator = value; + } + // Temporarily expose input value. Use with caution. + public get operatorInput() { + return this._operator; + } + + // severity - computed: false, optional: false, required: true + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } +} + +export class SecmasterAlertRuleTriggersList extends cdktf.ComplexList { + public internalValue? : SecmasterAlertRuleTriggers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SecmasterAlertRuleTriggersOutputReference { + return new SecmasterAlertRuleTriggersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule huaweicloud_secmaster_alert_rule} +*/ +export class SecmasterAlertRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_alert_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterAlertRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterAlertRule to import + * @param importFromId The id of the existing SecmasterAlertRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterAlertRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_alert_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert_rule huaweicloud_secmaster_alert_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterAlertRuleConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterAlertRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_alert_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._customInformation = config.customInformation; + this._debuggingAlarm = config.debuggingAlarm; + this._description = config.description; + this._eventGrouping = config.eventGrouping; + this._id = config.id; + this._name = config.name; + this._pipelineId = config.pipelineId; + this._queryRule = config.queryRule; + this._queryType = config.queryType; + this._region = config.region; + this._severity = config.severity; + this._status = config.status; + this._suppression = config.suppression; + this._type = config.type; + this._workspaceId = config.workspaceId; + this._queryPlan.internalValue = config.queryPlan; + this._timeouts.internalValue = config.timeouts; + this._triggers.internalValue = config.triggers; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // custom_information - computed: true, optional: true, required: false + private _customInformation?: { [key: string]: string }; + public get customInformation() { + return this.getStringMapAttribute('custom_information'); + } + public set customInformation(value: { [key: string]: string }) { + this._customInformation = value; + } + public resetCustomInformation() { + this._customInformation = undefined; + } + // Temporarily expose input value. Use with caution. + public get customInformationInput() { + return this._customInformation; + } + + // debugging_alarm - computed: false, optional: true, required: false + private _debuggingAlarm?: boolean | cdktf.IResolvable; + public get debuggingAlarm() { + return this.getBooleanAttribute('debugging_alarm'); + } + public set debuggingAlarm(value: boolean | cdktf.IResolvable) { + this._debuggingAlarm = value; + } + public resetDebuggingAlarm() { + this._debuggingAlarm = undefined; + } + // Temporarily expose input value. Use with caution. + public get debuggingAlarmInput() { + return this._debuggingAlarm; + } + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // event_grouping - computed: false, optional: true, required: false + private _eventGrouping?: boolean | cdktf.IResolvable; + public get eventGrouping() { + return this.getBooleanAttribute('event_grouping'); + } + public set eventGrouping(value: boolean | cdktf.IResolvable) { + this._eventGrouping = value; + } + public resetEventGrouping() { + this._eventGrouping = undefined; + } + // Temporarily expose input value. Use with caution. + public get eventGroupingInput() { + return this._eventGrouping; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pipeline_id - computed: false, optional: false, required: true + private _pipelineId?: string; + public get pipelineId() { + return this.getStringAttribute('pipeline_id'); + } + public set pipelineId(value: string) { + this._pipelineId = value; + } + // Temporarily expose input value. Use with caution. + public get pipelineIdInput() { + return this._pipelineId; + } + + // query_rule - computed: false, optional: false, required: true + private _queryRule?: string; + public get queryRule() { + return this.getStringAttribute('query_rule'); + } + public set queryRule(value: string) { + this._queryRule = value; + } + // Temporarily expose input value. Use with caution. + public get queryRuleInput() { + return this._queryRule; + } + + // query_type - computed: false, optional: false, required: true + private _queryType?: string; + public get queryType() { + return this.getStringAttribute('query_type'); + } + public set queryType(value: string) { + this._queryType = value; + } + // Temporarily expose input value. Use with caution. + public get queryTypeInput() { + return this._queryType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // severity - computed: false, optional: false, required: true + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // status - computed: false, optional: false, required: true + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // suppression - computed: true, optional: true, required: false + private _suppression?: boolean | cdktf.IResolvable; + public get suppression() { + return this.getBooleanAttribute('suppression'); + } + public set suppression(value: boolean | cdktf.IResolvable) { + this._suppression = value; + } + public resetSuppression() { + this._suppression = undefined; + } + // Temporarily expose input value. Use with caution. + public get suppressionInput() { + return this._suppression; + } + + // type - computed: false, optional: false, required: true + private _type?: { [key: string]: string }; + public get type() { + return this.getStringMapAttribute('type'); + } + public set type(value: { [key: string]: string }) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // query_plan - computed: false, optional: false, required: true + private _queryPlan = new SecmasterAlertRuleQueryPlanOutputReference(this, "query_plan"); + public get queryPlan() { + return this._queryPlan; + } + public putQueryPlan(value: SecmasterAlertRuleQueryPlan) { + this._queryPlan.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get queryPlanInput() { + return this._queryPlan.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SecmasterAlertRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SecmasterAlertRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // triggers - computed: false, optional: false, required: true + private _triggers = new SecmasterAlertRuleTriggersList(this, "triggers", false); + public get triggers() { + return this._triggers; + } + public putTriggers(value: SecmasterAlertRuleTriggers[] | cdktf.IResolvable) { + this._triggers.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get triggersInput() { + return this._triggers.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + custom_information: cdktf.hashMapper(cdktf.stringToTerraform)(this._customInformation), + debugging_alarm: cdktf.booleanToTerraform(this._debuggingAlarm), + description: cdktf.stringToTerraform(this._description), + event_grouping: cdktf.booleanToTerraform(this._eventGrouping), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pipeline_id: cdktf.stringToTerraform(this._pipelineId), + query_rule: cdktf.stringToTerraform(this._queryRule), + query_type: cdktf.stringToTerraform(this._queryType), + region: cdktf.stringToTerraform(this._region), + severity: cdktf.stringToTerraform(this._severity), + status: cdktf.stringToTerraform(this._status), + suppression: cdktf.booleanToTerraform(this._suppression), + type: cdktf.hashMapper(cdktf.stringToTerraform)(this._type), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + query_plan: secmasterAlertRuleQueryPlanToTerraform(this._queryPlan.internalValue), + timeouts: secmasterAlertRuleTimeoutsToTerraform(this._timeouts.internalValue), + triggers: cdktf.listMapper(secmasterAlertRuleTriggersToTerraform, true)(this._triggers.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + custom_information: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._customInformation), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + debugging_alarm: { + value: cdktf.booleanToHclTerraform(this._debuggingAlarm), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + event_grouping: { + value: cdktf.booleanToHclTerraform(this._eventGrouping), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pipeline_id: { + value: cdktf.stringToHclTerraform(this._pipelineId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_rule: { + value: cdktf.stringToHclTerraform(this._queryRule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_type: { + value: cdktf.stringToHclTerraform(this._queryType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(this._severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + suppression: { + value: cdktf.booleanToHclTerraform(this._suppression), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + type: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._type), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + query_plan: { + value: secmasterAlertRuleQueryPlanToHclTerraform(this._queryPlan.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterAlertRuleQueryPlanList", + }, + timeouts: { + value: secmasterAlertRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SecmasterAlertRuleTimeouts", + }, + triggers: { + value: cdktf.listMapperHcl(secmasterAlertRuleTriggersToHclTerraform, true)(this._triggers.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterAlertRuleTriggersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-alert/README.md b/src/constructs/providers/huaweicloud/secmaster-alert/README.md new file mode 100644 index 00000000..4edbc6df --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-alert/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_alert` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_alert`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert). diff --git a/src/constructs/providers/huaweicloud/secmaster-alert/index.ts b/src/constructs/providers/huaweicloud/secmaster-alert/index.ts new file mode 100644 index 00000000..822484ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-alert/index.ts @@ -0,0 +1,864 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterAlertConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the close comment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#close_comment SecmasterAlert#close_comment} + */ + readonly closeComment?: string; + /** + * Specifies the close reason. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#close_reason SecmasterAlert#close_reason} + */ + readonly closeReason?: string; + /** + * Specifies whether it's debugging data. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#debugging_data SecmasterAlert#debugging_data} + */ + readonly debuggingData?: boolean | cdktf.IResolvable; + /** + * Specifies the description of the alert. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#description SecmasterAlert#description} + */ + readonly description: string; + /** + * Specifies the first occurrence time of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#first_occurrence_time SecmasterAlert#first_occurrence_time} + */ + readonly firstOccurrenceTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#id SecmasterAlert#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the labels of the alert in comma-separated string. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#labels SecmasterAlert#labels} + */ + readonly labels?: string; + /** + * Specifies the last occurrence time of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#last_occurrence_time SecmasterAlert#last_occurrence_time} + */ + readonly lastOccurrenceTime?: string; + /** + * Specifies the alert name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#name SecmasterAlert#name} + */ + readonly name: string; + /** + * Specifies the owner name of the alert. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#owner SecmasterAlert#owner} + */ + readonly owner?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#region SecmasterAlert#region} + */ + readonly region?: string; + /** + * Specifies the alert severity. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#severity SecmasterAlert#severity} + */ + readonly severity: string; + /** + * Specifies the alert stage. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#stage SecmasterAlert#stage} + */ + readonly stage: string; + /** + * Specifies the alert status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#status SecmasterAlert#status} + */ + readonly status: string; + /** + * Specifies the alert verification status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#verification_status SecmasterAlert#verification_status} + */ + readonly verificationStatus: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#workspace_id SecmasterAlert#workspace_id} + */ + readonly workspaceId: string; + /** + * data_source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#data_source SecmasterAlert#data_source} + */ + readonly dataSource: SecmasterAlertDataSource; + /** + * type block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#type SecmasterAlert#type} + */ + readonly type: SecmasterAlertType; +} +export interface SecmasterAlertDataSource { + /** + * Specifies the product feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#product_feature SecmasterAlert#product_feature} + */ + readonly productFeature: string; + /** + * Specifies the product name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#product_name SecmasterAlert#product_name} + */ + readonly productName: string; + /** + * Specifies the source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#source_type SecmasterAlert#source_type} + */ + readonly sourceType: number; +} + +export function secmasterAlertDataSourceToTerraform(struct?: SecmasterAlertDataSourceOutputReference | SecmasterAlertDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + product_feature: cdktf.stringToTerraform(struct!.productFeature), + product_name: cdktf.stringToTerraform(struct!.productName), + source_type: cdktf.numberToTerraform(struct!.sourceType), + } +} + + +export function secmasterAlertDataSourceToHclTerraform(struct?: SecmasterAlertDataSourceOutputReference | SecmasterAlertDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + product_feature: { + value: cdktf.stringToHclTerraform(struct!.productFeature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_name: { + value: cdktf.stringToHclTerraform(struct!.productName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.numberToHclTerraform(struct!.sourceType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterAlertDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterAlertDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._productFeature !== undefined) { + hasAnyValues = true; + internalValueResult.productFeature = this._productFeature; + } + if (this._productName !== undefined) { + hasAnyValues = true; + internalValueResult.productName = this._productName; + } + if (this._sourceType !== undefined) { + hasAnyValues = true; + internalValueResult.sourceType = this._sourceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterAlertDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._productFeature = undefined; + this._productName = undefined; + this._sourceType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._productFeature = value.productFeature; + this._productName = value.productName; + this._sourceType = value.sourceType; + } + } + + // product_feature - computed: false, optional: false, required: true + private _productFeature?: string; + public get productFeature() { + return this.getStringAttribute('product_feature'); + } + public set productFeature(value: string) { + this._productFeature = value; + } + // Temporarily expose input value. Use with caution. + public get productFeatureInput() { + return this._productFeature; + } + + // product_name - computed: false, optional: false, required: true + private _productName?: string; + public get productName() { + return this.getStringAttribute('product_name'); + } + public set productName(value: string) { + this._productName = value; + } + // Temporarily expose input value. Use with caution. + public get productNameInput() { + return this._productName; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: number; + public get sourceType() { + return this.getNumberAttribute('source_type'); + } + public set sourceType(value: number) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } +} +export interface SecmasterAlertType { + /** + * Specifies the alert type + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#alert_type SecmasterAlert#alert_type} + */ + readonly alertType: string; + /** + * Specifies the category. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#category SecmasterAlert#category} + */ + readonly category: string; +} + +export function secmasterAlertTypeToTerraform(struct?: SecmasterAlertTypeOutputReference | SecmasterAlertType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alert_type: cdktf.stringToTerraform(struct!.alertType), + category: cdktf.stringToTerraform(struct!.category), + } +} + + +export function secmasterAlertTypeToHclTerraform(struct?: SecmasterAlertTypeOutputReference | SecmasterAlertType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alert_type: { + value: cdktf.stringToHclTerraform(struct!.alertType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + category: { + value: cdktf.stringToHclTerraform(struct!.category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterAlertTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterAlertType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alertType !== undefined) { + hasAnyValues = true; + internalValueResult.alertType = this._alertType; + } + if (this._category !== undefined) { + hasAnyValues = true; + internalValueResult.category = this._category; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterAlertType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._alertType = undefined; + this._category = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._alertType = value.alertType; + this._category = value.category; + } + } + + // alert_type - computed: false, optional: false, required: true + private _alertType?: string; + public get alertType() { + return this.getStringAttribute('alert_type'); + } + public set alertType(value: string) { + this._alertType = value; + } + // Temporarily expose input value. Use with caution. + public get alertTypeInput() { + return this._alertType; + } + + // category - computed: false, optional: false, required: true + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert huaweicloud_secmaster_alert} +*/ +export class SecmasterAlert extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_alert"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterAlert resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterAlert to import + * @param importFromId The id of the existing SecmasterAlert that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterAlert to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_alert", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_alert huaweicloud_secmaster_alert} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterAlertConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterAlertConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_alert', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._closeComment = config.closeComment; + this._closeReason = config.closeReason; + this._debuggingData = config.debuggingData; + this._description = config.description; + this._firstOccurrenceTime = config.firstOccurrenceTime; + this._id = config.id; + this._labels = config.labels; + this._lastOccurrenceTime = config.lastOccurrenceTime; + this._name = config.name; + this._owner = config.owner; + this._region = config.region; + this._severity = config.severity; + this._stage = config.stage; + this._status = config.status; + this._verificationStatus = config.verificationStatus; + this._workspaceId = config.workspaceId; + this._dataSource.internalValue = config.dataSource; + this._type.internalValue = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // close_comment - computed: true, optional: true, required: false + private _closeComment?: string; + public get closeComment() { + return this.getStringAttribute('close_comment'); + } + public set closeComment(value: string) { + this._closeComment = value; + } + public resetCloseComment() { + this._closeComment = undefined; + } + // Temporarily expose input value. Use with caution. + public get closeCommentInput() { + return this._closeComment; + } + + // close_reason - computed: true, optional: true, required: false + private _closeReason?: string; + public get closeReason() { + return this.getStringAttribute('close_reason'); + } + public set closeReason(value: string) { + this._closeReason = value; + } + public resetCloseReason() { + this._closeReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get closeReasonInput() { + return this._closeReason; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // debugging_data - computed: true, optional: true, required: false + private _debuggingData?: boolean | cdktf.IResolvable; + public get debuggingData() { + return this.getBooleanAttribute('debugging_data'); + } + public set debuggingData(value: boolean | cdktf.IResolvable) { + this._debuggingData = value; + } + public resetDebuggingData() { + this._debuggingData = undefined; + } + // Temporarily expose input value. Use with caution. + public get debuggingDataInput() { + return this._debuggingData; + } + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // first_occurrence_time - computed: false, optional: false, required: true + private _firstOccurrenceTime?: string; + public get firstOccurrenceTime() { + return this.getStringAttribute('first_occurrence_time'); + } + public set firstOccurrenceTime(value: string) { + this._firstOccurrenceTime = value; + } + // Temporarily expose input value. Use with caution. + public get firstOccurrenceTimeInput() { + return this._firstOccurrenceTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // labels - computed: true, optional: true, required: false + private _labels?: string; + public get labels() { + return this.getStringAttribute('labels'); + } + public set labels(value: string) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // last_occurrence_time - computed: true, optional: true, required: false + private _lastOccurrenceTime?: string; + public get lastOccurrenceTime() { + return this.getStringAttribute('last_occurrence_time'); + } + public set lastOccurrenceTime(value: string) { + this._lastOccurrenceTime = value; + } + public resetLastOccurrenceTime() { + this._lastOccurrenceTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get lastOccurrenceTimeInput() { + return this._lastOccurrenceTime; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // severity - computed: false, optional: false, required: true + private _severity?: string; + public get severity() { + return this.getStringAttribute('severity'); + } + public set severity(value: string) { + this._severity = value; + } + // Temporarily expose input value. Use with caution. + public get severityInput() { + return this._severity; + } + + // stage - computed: false, optional: false, required: true + private _stage?: string; + public get stage() { + return this.getStringAttribute('stage'); + } + public set stage(value: string) { + this._stage = value; + } + // Temporarily expose input value. Use with caution. + public get stageInput() { + return this._stage; + } + + // status - computed: false, optional: false, required: true + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // verification_status - computed: false, optional: false, required: true + private _verificationStatus?: string; + public get verificationStatus() { + return this.getStringAttribute('verification_status'); + } + public set verificationStatus(value: string) { + this._verificationStatus = value; + } + // Temporarily expose input value. Use with caution. + public get verificationStatusInput() { + return this._verificationStatus; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // data_source - computed: false, optional: false, required: true + private _dataSource = new SecmasterAlertDataSourceOutputReference(this, "data_source"); + public get dataSource() { + return this._dataSource; + } + public putDataSource(value: SecmasterAlertDataSource) { + this._dataSource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource.internalValue; + } + + // type - computed: false, optional: false, required: true + private _type = new SecmasterAlertTypeOutputReference(this, "type"); + public get type() { + return this._type; + } + public putType(value: SecmasterAlertType) { + this._type.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + close_comment: cdktf.stringToTerraform(this._closeComment), + close_reason: cdktf.stringToTerraform(this._closeReason), + debugging_data: cdktf.booleanToTerraform(this._debuggingData), + description: cdktf.stringToTerraform(this._description), + first_occurrence_time: cdktf.stringToTerraform(this._firstOccurrenceTime), + id: cdktf.stringToTerraform(this._id), + labels: cdktf.stringToTerraform(this._labels), + last_occurrence_time: cdktf.stringToTerraform(this._lastOccurrenceTime), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + region: cdktf.stringToTerraform(this._region), + severity: cdktf.stringToTerraform(this._severity), + stage: cdktf.stringToTerraform(this._stage), + status: cdktf.stringToTerraform(this._status), + verification_status: cdktf.stringToTerraform(this._verificationStatus), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + data_source: secmasterAlertDataSourceToTerraform(this._dataSource.internalValue), + type: secmasterAlertTypeToTerraform(this._type.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + close_comment: { + value: cdktf.stringToHclTerraform(this._closeComment), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + close_reason: { + value: cdktf.stringToHclTerraform(this._closeReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + debugging_data: { + value: cdktf.booleanToHclTerraform(this._debuggingData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + first_occurrence_time: { + value: cdktf.stringToHclTerraform(this._firstOccurrenceTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.stringToHclTerraform(this._labels), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_occurrence_time: { + value: cdktf.stringToHclTerraform(this._lastOccurrenceTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + severity: { + value: cdktf.stringToHclTerraform(this._severity), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stage: { + value: cdktf.stringToHclTerraform(this._stage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + verification_status: { + value: cdktf.stringToHclTerraform(this._verificationStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source: { + value: secmasterAlertDataSourceToHclTerraform(this._dataSource.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterAlertDataSourceList", + }, + type: { + value: secmasterAlertTypeToHclTerraform(this._type.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterAlertTypeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-data-object-relations/README.md b/src/constructs/providers/huaweicloud/secmaster-data-object-relations/README.md new file mode 100644 index 00000000..b3a16aa5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-data-object-relations/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_data_object_relations` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_data_object_relations`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations). diff --git a/src/constructs/providers/huaweicloud/secmaster-data-object-relations/index.ts b/src/constructs/providers/huaweicloud/secmaster-data-object-relations/index.ts new file mode 100644 index 00000000..331e1849 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-data-object-relations/index.ts @@ -0,0 +1,307 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterDataObjectRelationsConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the data class to which the data object belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#data_class SecmasterDataObjectRelations#data_class} + */ + readonly dataClass: string; + /** + * Specifies the ID of the data object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#data_object_id SecmasterDataObjectRelations#data_object_id} + */ + readonly dataObjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#enable_force_new SecmasterDataObjectRelations#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#id SecmasterDataObjectRelations#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#region SecmasterDataObjectRelations#region} + */ + readonly region?: string; + /** + * Specifies the data class to which the related data object belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#related_data_class SecmasterDataObjectRelations#related_data_class} + */ + readonly relatedDataClass: string; + /** + * Specifies the IDs of the data object. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#related_data_object_ids SecmasterDataObjectRelations#related_data_object_ids} + */ + readonly relatedDataObjectIds: string[]; + /** + * Specifies the ID of the workspace to which the data object belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#workspace_id SecmasterDataObjectRelations#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations huaweicloud_secmaster_data_object_relations} +*/ +export class SecmasterDataObjectRelations extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_data_object_relations"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterDataObjectRelations resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterDataObjectRelations to import + * @param importFromId The id of the existing SecmasterDataObjectRelations that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterDataObjectRelations to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_data_object_relations", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_data_object_relations huaweicloud_secmaster_data_object_relations} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterDataObjectRelationsConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterDataObjectRelationsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_data_object_relations', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._dataClass = config.dataClass; + this._dataObjectId = config.dataObjectId; + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._region = config.region; + this._relatedDataClass = config.relatedDataClass; + this._relatedDataObjectIds = config.relatedDataObjectIds; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // data_class - computed: false, optional: false, required: true + private _dataClass?: string; + public get dataClass() { + return this.getStringAttribute('data_class'); + } + public set dataClass(value: string) { + this._dataClass = value; + } + // Temporarily expose input value. Use with caution. + public get dataClassInput() { + return this._dataClass; + } + + // data_object_id - computed: false, optional: false, required: true + private _dataObjectId?: string; + public get dataObjectId() { + return this.getStringAttribute('data_object_id'); + } + public set dataObjectId(value: string) { + this._dataObjectId = value; + } + // Temporarily expose input value. Use with caution. + public get dataObjectIdInput() { + return this._dataObjectId; + } + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // related_data_class - computed: false, optional: false, required: true + private _relatedDataClass?: string; + public get relatedDataClass() { + return this.getStringAttribute('related_data_class'); + } + public set relatedDataClass(value: string) { + this._relatedDataClass = value; + } + // Temporarily expose input value. Use with caution. + public get relatedDataClassInput() { + return this._relatedDataClass; + } + + // related_data_object_ids - computed: false, optional: false, required: true + private _relatedDataObjectIds?: string[]; + public get relatedDataObjectIds() { + return cdktf.Fn.tolist(this.getListAttribute('related_data_object_ids')); + } + public set relatedDataObjectIds(value: string[]) { + this._relatedDataObjectIds = value; + } + // Temporarily expose input value. Use with caution. + public get relatedDataObjectIdsInput() { + return this._relatedDataObjectIds; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + data_class: cdktf.stringToTerraform(this._dataClass), + data_object_id: cdktf.stringToTerraform(this._dataObjectId), + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + related_data_class: cdktf.stringToTerraform(this._relatedDataClass), + related_data_object_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._relatedDataObjectIds), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + data_class: { + value: cdktf.stringToHclTerraform(this._dataClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_object_id: { + value: cdktf.stringToHclTerraform(this._dataObjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_data_class: { + value: cdktf.stringToHclTerraform(this._relatedDataClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + related_data_object_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._relatedDataObjectIds), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-incident/README.md b/src/constructs/providers/huaweicloud/secmaster-incident/README.md new file mode 100644 index 00000000..c0509910 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-incident/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_incident` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_incident`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident). diff --git a/src/constructs/providers/huaweicloud/secmaster-incident/index.ts b/src/constructs/providers/huaweicloud/secmaster-incident/index.ts new file mode 100644 index 00000000..0a5f2308 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-incident/index.ts @@ -0,0 +1,907 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterIncidentConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the close comment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#close_comment SecmasterIncident#close_comment} + */ + readonly closeComment?: string; + /** + * Specifies the close reason. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#close_reason SecmasterIncident#close_reason} + */ + readonly closeReason?: string; + /** + * Specifies whether it's debugging data. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#debugging_data SecmasterIncident#debugging_data} + */ + readonly debuggingData?: boolean | cdktf.IResolvable; + /** + * Specifies the incident description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#description SecmasterIncident#description} + */ + readonly description: string; + /** + * Specifies the first occurrence time of the incident. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#first_occurrence_time SecmasterIncident#first_occurrence_time} + */ + readonly firstOccurrenceTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#id SecmasterIncident#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the labels. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#labels SecmasterIncident#labels} + */ + readonly labels?: string; + /** + * Specifies the last occurrence time of the incident. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#last_occurrence_time SecmasterIncident#last_occurrence_time} + */ + readonly lastOccurrenceTime?: string; + /** + * Specifies the incident level. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#level SecmasterIncident#level} + */ + readonly level: string; + /** + * Specifies the incident name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#name SecmasterIncident#name} + */ + readonly name: string; + /** + * Specifies the user name of the owner. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#owner SecmasterIncident#owner} + */ + readonly owner?: string; + /** + * Specifies the planned closure time of the incident. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#planned_closure_time SecmasterIncident#planned_closure_time} + */ + readonly plannedClosureTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#region SecmasterIncident#region} + */ + readonly region?: string; + /** + * Specifies the stage of the incident. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#stage SecmasterIncident#stage} + */ + readonly stage?: string; + /** + * Specifies the incident status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#status SecmasterIncident#status} + */ + readonly status: string; + /** + * Specifies the verification status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#verification_status SecmasterIncident#verification_status} + */ + readonly verificationStatus?: string; + /** + * Specifies the ID of the workspace to which the incident belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#workspace_id SecmasterIncident#workspace_id} + */ + readonly workspaceId: string; + /** + * data_source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#data_source SecmasterIncident#data_source} + */ + readonly dataSource: SecmasterIncidentDataSource; + /** + * type block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#type SecmasterIncident#type} + */ + readonly type: SecmasterIncidentType; +} +export interface SecmasterIncidentDataSource { + /** + * Specifies the product feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#product_feature SecmasterIncident#product_feature} + */ + readonly productFeature: string; + /** + * Specifies the product name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#product_name SecmasterIncident#product_name} + */ + readonly productName: string; + /** + * Specifies the source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#source_type SecmasterIncident#source_type} + */ + readonly sourceType: number; +} + +export function secmasterIncidentDataSourceToTerraform(struct?: SecmasterIncidentDataSourceOutputReference | SecmasterIncidentDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + product_feature: cdktf.stringToTerraform(struct!.productFeature), + product_name: cdktf.stringToTerraform(struct!.productName), + source_type: cdktf.numberToTerraform(struct!.sourceType), + } +} + + +export function secmasterIncidentDataSourceToHclTerraform(struct?: SecmasterIncidentDataSourceOutputReference | SecmasterIncidentDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + product_feature: { + value: cdktf.stringToHclTerraform(struct!.productFeature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_name: { + value: cdktf.stringToHclTerraform(struct!.productName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.numberToHclTerraform(struct!.sourceType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterIncidentDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterIncidentDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._productFeature !== undefined) { + hasAnyValues = true; + internalValueResult.productFeature = this._productFeature; + } + if (this._productName !== undefined) { + hasAnyValues = true; + internalValueResult.productName = this._productName; + } + if (this._sourceType !== undefined) { + hasAnyValues = true; + internalValueResult.sourceType = this._sourceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterIncidentDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._productFeature = undefined; + this._productName = undefined; + this._sourceType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._productFeature = value.productFeature; + this._productName = value.productName; + this._sourceType = value.sourceType; + } + } + + // product_feature - computed: false, optional: false, required: true + private _productFeature?: string; + public get productFeature() { + return this.getStringAttribute('product_feature'); + } + public set productFeature(value: string) { + this._productFeature = value; + } + // Temporarily expose input value. Use with caution. + public get productFeatureInput() { + return this._productFeature; + } + + // product_name - computed: false, optional: false, required: true + private _productName?: string; + public get productName() { + return this.getStringAttribute('product_name'); + } + public set productName(value: string) { + this._productName = value; + } + // Temporarily expose input value. Use with caution. + public get productNameInput() { + return this._productName; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: number; + public get sourceType() { + return this.getNumberAttribute('source_type'); + } + public set sourceType(value: number) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } +} +export interface SecmasterIncidentType { + /** + * Specifies the category. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#category SecmasterIncident#category} + */ + readonly category: string; + /** + * Specifies the incident type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#incident_type SecmasterIncident#incident_type} + */ + readonly incidentType: string; +} + +export function secmasterIncidentTypeToTerraform(struct?: SecmasterIncidentTypeOutputReference | SecmasterIncidentType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + category: cdktf.stringToTerraform(struct!.category), + incident_type: cdktf.stringToTerraform(struct!.incidentType), + } +} + + +export function secmasterIncidentTypeToHclTerraform(struct?: SecmasterIncidentTypeOutputReference | SecmasterIncidentType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + category: { + value: cdktf.stringToHclTerraform(struct!.category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + incident_type: { + value: cdktf.stringToHclTerraform(struct!.incidentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterIncidentTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterIncidentType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._category !== undefined) { + hasAnyValues = true; + internalValueResult.category = this._category; + } + if (this._incidentType !== undefined) { + hasAnyValues = true; + internalValueResult.incidentType = this._incidentType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterIncidentType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._category = undefined; + this._incidentType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._category = value.category; + this._incidentType = value.incidentType; + } + } + + // category - computed: false, optional: false, required: true + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // incident_type - computed: false, optional: false, required: true + private _incidentType?: string; + public get incidentType() { + return this.getStringAttribute('incident_type'); + } + public set incidentType(value: string) { + this._incidentType = value; + } + // Temporarily expose input value. Use with caution. + public get incidentTypeInput() { + return this._incidentType; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident huaweicloud_secmaster_incident} +*/ +export class SecmasterIncident extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_incident"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterIncident resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterIncident to import + * @param importFromId The id of the existing SecmasterIncident that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterIncident to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_incident", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_incident huaweicloud_secmaster_incident} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterIncidentConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterIncidentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_incident', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._closeComment = config.closeComment; + this._closeReason = config.closeReason; + this._debuggingData = config.debuggingData; + this._description = config.description; + this._firstOccurrenceTime = config.firstOccurrenceTime; + this._id = config.id; + this._labels = config.labels; + this._lastOccurrenceTime = config.lastOccurrenceTime; + this._level = config.level; + this._name = config.name; + this._owner = config.owner; + this._plannedClosureTime = config.plannedClosureTime; + this._region = config.region; + this._stage = config.stage; + this._status = config.status; + this._verificationStatus = config.verificationStatus; + this._workspaceId = config.workspaceId; + this._dataSource.internalValue = config.dataSource; + this._type.internalValue = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // close_comment - computed: true, optional: true, required: false + private _closeComment?: string; + public get closeComment() { + return this.getStringAttribute('close_comment'); + } + public set closeComment(value: string) { + this._closeComment = value; + } + public resetCloseComment() { + this._closeComment = undefined; + } + // Temporarily expose input value. Use with caution. + public get closeCommentInput() { + return this._closeComment; + } + + // close_reason - computed: true, optional: true, required: false + private _closeReason?: string; + public get closeReason() { + return this.getStringAttribute('close_reason'); + } + public set closeReason(value: string) { + this._closeReason = value; + } + public resetCloseReason() { + this._closeReason = undefined; + } + // Temporarily expose input value. Use with caution. + public get closeReasonInput() { + return this._closeReason; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // debugging_data - computed: true, optional: true, required: false + private _debuggingData?: boolean | cdktf.IResolvable; + public get debuggingData() { + return this.getBooleanAttribute('debugging_data'); + } + public set debuggingData(value: boolean | cdktf.IResolvable) { + this._debuggingData = value; + } + public resetDebuggingData() { + this._debuggingData = undefined; + } + // Temporarily expose input value. Use with caution. + public get debuggingDataInput() { + return this._debuggingData; + } + + // description - computed: false, optional: false, required: true + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // first_occurrence_time - computed: false, optional: false, required: true + private _firstOccurrenceTime?: string; + public get firstOccurrenceTime() { + return this.getStringAttribute('first_occurrence_time'); + } + public set firstOccurrenceTime(value: string) { + this._firstOccurrenceTime = value; + } + // Temporarily expose input value. Use with caution. + public get firstOccurrenceTimeInput() { + return this._firstOccurrenceTime; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // labels - computed: true, optional: true, required: false + private _labels?: string; + public get labels() { + return this.getStringAttribute('labels'); + } + public set labels(value: string) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // last_occurrence_time - computed: true, optional: true, required: false + private _lastOccurrenceTime?: string; + public get lastOccurrenceTime() { + return this.getStringAttribute('last_occurrence_time'); + } + public set lastOccurrenceTime(value: string) { + this._lastOccurrenceTime = value; + } + public resetLastOccurrenceTime() { + this._lastOccurrenceTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get lastOccurrenceTimeInput() { + return this._lastOccurrenceTime; + } + + // level - computed: false, optional: false, required: true + private _level?: string; + public get level() { + return this.getStringAttribute('level'); + } + public set level(value: string) { + this._level = value; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner - computed: true, optional: true, required: false + private _owner?: string; + public get owner() { + return this.getStringAttribute('owner'); + } + public set owner(value: string) { + this._owner = value; + } + public resetOwner() { + this._owner = undefined; + } + // Temporarily expose input value. Use with caution. + public get ownerInput() { + return this._owner; + } + + // planned_closure_time - computed: true, optional: true, required: false + private _plannedClosureTime?: string; + public get plannedClosureTime() { + return this.getStringAttribute('planned_closure_time'); + } + public set plannedClosureTime(value: string) { + this._plannedClosureTime = value; + } + public resetPlannedClosureTime() { + this._plannedClosureTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get plannedClosureTimeInput() { + return this._plannedClosureTime; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // stage - computed: true, optional: true, required: false + private _stage?: string; + public get stage() { + return this.getStringAttribute('stage'); + } + public set stage(value: string) { + this._stage = value; + } + public resetStage() { + this._stage = undefined; + } + // Temporarily expose input value. Use with caution. + public get stageInput() { + return this._stage; + } + + // status - computed: false, optional: false, required: true + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // verification_status - computed: true, optional: true, required: false + private _verificationStatus?: string; + public get verificationStatus() { + return this.getStringAttribute('verification_status'); + } + public set verificationStatus(value: string) { + this._verificationStatus = value; + } + public resetVerificationStatus() { + this._verificationStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get verificationStatusInput() { + return this._verificationStatus; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // data_source - computed: false, optional: false, required: true + private _dataSource = new SecmasterIncidentDataSourceOutputReference(this, "data_source"); + public get dataSource() { + return this._dataSource; + } + public putDataSource(value: SecmasterIncidentDataSource) { + this._dataSource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource.internalValue; + } + + // type - computed: false, optional: false, required: true + private _type = new SecmasterIncidentTypeOutputReference(this, "type"); + public get type() { + return this._type; + } + public putType(value: SecmasterIncidentType) { + this._type.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + close_comment: cdktf.stringToTerraform(this._closeComment), + close_reason: cdktf.stringToTerraform(this._closeReason), + debugging_data: cdktf.booleanToTerraform(this._debuggingData), + description: cdktf.stringToTerraform(this._description), + first_occurrence_time: cdktf.stringToTerraform(this._firstOccurrenceTime), + id: cdktf.stringToTerraform(this._id), + labels: cdktf.stringToTerraform(this._labels), + last_occurrence_time: cdktf.stringToTerraform(this._lastOccurrenceTime), + level: cdktf.stringToTerraform(this._level), + name: cdktf.stringToTerraform(this._name), + owner: cdktf.stringToTerraform(this._owner), + planned_closure_time: cdktf.stringToTerraform(this._plannedClosureTime), + region: cdktf.stringToTerraform(this._region), + stage: cdktf.stringToTerraform(this._stage), + status: cdktf.stringToTerraform(this._status), + verification_status: cdktf.stringToTerraform(this._verificationStatus), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + data_source: secmasterIncidentDataSourceToTerraform(this._dataSource.internalValue), + type: secmasterIncidentTypeToTerraform(this._type.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + close_comment: { + value: cdktf.stringToHclTerraform(this._closeComment), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + close_reason: { + value: cdktf.stringToHclTerraform(this._closeReason), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + debugging_data: { + value: cdktf.booleanToHclTerraform(this._debuggingData), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + first_occurrence_time: { + value: cdktf.stringToHclTerraform(this._firstOccurrenceTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.stringToHclTerraform(this._labels), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_occurrence_time: { + value: cdktf.stringToHclTerraform(this._lastOccurrenceTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.stringToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + owner: { + value: cdktf.stringToHclTerraform(this._owner), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + planned_closure_time: { + value: cdktf.stringToHclTerraform(this._plannedClosureTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + stage: { + value: cdktf.stringToHclTerraform(this._stage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + verification_status: { + value: cdktf.stringToHclTerraform(this._verificationStatus), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source: { + value: secmasterIncidentDataSourceToHclTerraform(this._dataSource.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterIncidentDataSourceList", + }, + type: { + value: secmasterIncidentTypeToHclTerraform(this._type.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterIncidentTypeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-indicator/README.md b/src/constructs/providers/huaweicloud/secmaster-indicator/README.md new file mode 100644 index 00000000..44afdb68 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-indicator/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_indicator` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_indicator`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator). diff --git a/src/constructs/providers/huaweicloud/secmaster-indicator/index.ts b/src/constructs/providers/huaweicloud/secmaster-indicator/index.ts new file mode 100644 index 00000000..7c875ccf --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-indicator/index.ts @@ -0,0 +1,808 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterIndicatorConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the confidence of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#confidence SecmasterIndicator#confidence} + */ + readonly confidence: number; + /** + * Specifies the first occurrence time of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#first_occurrence_time SecmasterIndicator#first_occurrence_time} + */ + readonly firstOccurrenceTime: string; + /** + * Specifies the granularity of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#granularity SecmasterIndicator#granularity} + */ + readonly granularity: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#id SecmasterIndicator#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies whether the indicator is invalid. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#invalid SecmasterIndicator#invalid} + */ + readonly invalid?: boolean | cdktf.IResolvable; + /** + * Specifies the labels of the indicator in comma-separated string. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#labels SecmasterIndicator#labels} + */ + readonly labels?: string; + /** + * Specifies the last occurrence time of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#last_occurrence_time SecmasterIndicator#last_occurrence_time} + */ + readonly lastOccurrenceTime: string; + /** + * Specifies the indicator name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#name SecmasterIndicator#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#region SecmasterIndicator#region} + */ + readonly region?: string; + /** + * Specifies the indicator status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#status SecmasterIndicator#status} + */ + readonly status: string; + /** + * Specifies the indicator type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#threat_degree SecmasterIndicator#threat_degree} + */ + readonly threatDegree: string; + /** + * Specifies the value of the indicator. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#value SecmasterIndicator#value} + */ + readonly value: string; + /** + * Specifies the ID of the workspace to which the indicator belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#workspace_id SecmasterIndicator#workspace_id} + */ + readonly workspaceId: string; + /** + * data_source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#data_source SecmasterIndicator#data_source} + */ + readonly dataSource: SecmasterIndicatorDataSource; + /** + * type block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#type SecmasterIndicator#type} + */ + readonly type: SecmasterIndicatorType; +} +export interface SecmasterIndicatorDataSource { + /** + * Specifies the product feature. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#product_feature SecmasterIndicator#product_feature} + */ + readonly productFeature: string; + /** + * Specifies the product name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#product_name SecmasterIndicator#product_name} + */ + readonly productName: string; + /** + * Specifies the data source type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#source_type SecmasterIndicator#source_type} + */ + readonly sourceType: number; +} + +export function secmasterIndicatorDataSourceToTerraform(struct?: SecmasterIndicatorDataSourceOutputReference | SecmasterIndicatorDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + product_feature: cdktf.stringToTerraform(struct!.productFeature), + product_name: cdktf.stringToTerraform(struct!.productName), + source_type: cdktf.numberToTerraform(struct!.sourceType), + } +} + + +export function secmasterIndicatorDataSourceToHclTerraform(struct?: SecmasterIndicatorDataSourceOutputReference | SecmasterIndicatorDataSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + product_feature: { + value: cdktf.stringToHclTerraform(struct!.productFeature), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + product_name: { + value: cdktf.stringToHclTerraform(struct!.productName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_type: { + value: cdktf.numberToHclTerraform(struct!.sourceType), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterIndicatorDataSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterIndicatorDataSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._productFeature !== undefined) { + hasAnyValues = true; + internalValueResult.productFeature = this._productFeature; + } + if (this._productName !== undefined) { + hasAnyValues = true; + internalValueResult.productName = this._productName; + } + if (this._sourceType !== undefined) { + hasAnyValues = true; + internalValueResult.sourceType = this._sourceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterIndicatorDataSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._productFeature = undefined; + this._productName = undefined; + this._sourceType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._productFeature = value.productFeature; + this._productName = value.productName; + this._sourceType = value.sourceType; + } + } + + // product_feature - computed: false, optional: false, required: true + private _productFeature?: string; + public get productFeature() { + return this.getStringAttribute('product_feature'); + } + public set productFeature(value: string) { + this._productFeature = value; + } + // Temporarily expose input value. Use with caution. + public get productFeatureInput() { + return this._productFeature; + } + + // product_name - computed: false, optional: false, required: true + private _productName?: string; + public get productName() { + return this.getStringAttribute('product_name'); + } + public set productName(value: string) { + this._productName = value; + } + // Temporarily expose input value. Use with caution. + public get productNameInput() { + return this._productName; + } + + // source_type - computed: false, optional: false, required: true + private _sourceType?: number; + public get sourceType() { + return this.getNumberAttribute('source_type'); + } + public set sourceType(value: number) { + this._sourceType = value; + } + // Temporarily expose input value. Use with caution. + public get sourceTypeInput() { + return this._sourceType; + } +} +export interface SecmasterIndicatorType { + /** + * Specifies the category. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#category SecmasterIndicator#category} + */ + readonly category: string; + /** + * Specifies the indicator type ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#id SecmasterIndicator#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Specifies the indicator type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#indicator_type SecmasterIndicator#indicator_type} + */ + readonly indicatorType: string; +} + +export function secmasterIndicatorTypeToTerraform(struct?: SecmasterIndicatorTypeOutputReference | SecmasterIndicatorType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + category: cdktf.stringToTerraform(struct!.category), + id: cdktf.stringToTerraform(struct!.id), + indicator_type: cdktf.stringToTerraform(struct!.indicatorType), + } +} + + +export function secmasterIndicatorTypeToHclTerraform(struct?: SecmasterIndicatorTypeOutputReference | SecmasterIndicatorType): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + category: { + value: cdktf.stringToHclTerraform(struct!.category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + indicator_type: { + value: cdktf.stringToHclTerraform(struct!.indicatorType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterIndicatorTypeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SecmasterIndicatorType | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._category !== undefined) { + hasAnyValues = true; + internalValueResult.category = this._category; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._indicatorType !== undefined) { + hasAnyValues = true; + internalValueResult.indicatorType = this._indicatorType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterIndicatorType | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._category = undefined; + this._id = undefined; + this._indicatorType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._category = value.category; + this._id = value.id; + this._indicatorType = value.indicatorType; + } + } + + // category - computed: false, optional: false, required: true + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // indicator_type - computed: false, optional: false, required: true + private _indicatorType?: string; + public get indicatorType() { + return this.getStringAttribute('indicator_type'); + } + public set indicatorType(value: string) { + this._indicatorType = value; + } + // Temporarily expose input value. Use with caution. + public get indicatorTypeInput() { + return this._indicatorType; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator huaweicloud_secmaster_indicator} +*/ +export class SecmasterIndicator extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_indicator"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterIndicator resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterIndicator to import + * @param importFromId The id of the existing SecmasterIndicator that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterIndicator to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_indicator", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_indicator huaweicloud_secmaster_indicator} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterIndicatorConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterIndicatorConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_indicator', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._confidence = config.confidence; + this._firstOccurrenceTime = config.firstOccurrenceTime; + this._granularity = config.granularity; + this._id = config.id; + this._invalid = config.invalid; + this._labels = config.labels; + this._lastOccurrenceTime = config.lastOccurrenceTime; + this._name = config.name; + this._region = config.region; + this._status = config.status; + this._threatDegree = config.threatDegree; + this._value = config.value; + this._workspaceId = config.workspaceId; + this._dataSource.internalValue = config.dataSource; + this._type.internalValue = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // confidence - computed: false, optional: false, required: true + private _confidence?: number; + public get confidence() { + return this.getNumberAttribute('confidence'); + } + public set confidence(value: number) { + this._confidence = value; + } + // Temporarily expose input value. Use with caution. + public get confidenceInput() { + return this._confidence; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // first_occurrence_time - computed: false, optional: false, required: true + private _firstOccurrenceTime?: string; + public get firstOccurrenceTime() { + return this.getStringAttribute('first_occurrence_time'); + } + public set firstOccurrenceTime(value: string) { + this._firstOccurrenceTime = value; + } + // Temporarily expose input value. Use with caution. + public get firstOccurrenceTimeInput() { + return this._firstOccurrenceTime; + } + + // granularity - computed: false, optional: false, required: true + private _granularity?: number; + public get granularity() { + return this.getNumberAttribute('granularity'); + } + public set granularity(value: number) { + this._granularity = value; + } + // Temporarily expose input value. Use with caution. + public get granularityInput() { + return this._granularity; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // invalid - computed: false, optional: true, required: false + private _invalid?: boolean | cdktf.IResolvable; + public get invalid() { + return this.getBooleanAttribute('invalid'); + } + public set invalid(value: boolean | cdktf.IResolvable) { + this._invalid = value; + } + public resetInvalid() { + this._invalid = undefined; + } + // Temporarily expose input value. Use with caution. + public get invalidInput() { + return this._invalid; + } + + // labels - computed: true, optional: true, required: false + private _labels?: string; + public get labels() { + return this.getStringAttribute('labels'); + } + public set labels(value: string) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // last_occurrence_time - computed: false, optional: false, required: true + private _lastOccurrenceTime?: string; + public get lastOccurrenceTime() { + return this.getStringAttribute('last_occurrence_time'); + } + public set lastOccurrenceTime(value: string) { + this._lastOccurrenceTime = value; + } + // Temporarily expose input value. Use with caution. + public get lastOccurrenceTimeInput() { + return this._lastOccurrenceTime; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: false, required: true + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // threat_degree - computed: false, optional: false, required: true + private _threatDegree?: string; + public get threatDegree() { + return this.getStringAttribute('threat_degree'); + } + public set threatDegree(value: string) { + this._threatDegree = value; + } + // Temporarily expose input value. Use with caution. + public get threatDegreeInput() { + return this._threatDegree; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // data_source - computed: false, optional: false, required: true + private _dataSource = new SecmasterIndicatorDataSourceOutputReference(this, "data_source"); + public get dataSource() { + return this._dataSource; + } + public putDataSource(value: SecmasterIndicatorDataSource) { + this._dataSource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get dataSourceInput() { + return this._dataSource.internalValue; + } + + // type - computed: false, optional: false, required: true + private _type = new SecmasterIndicatorTypeOutputReference(this, "type"); + public get type() { + return this._type; + } + public putType(value: SecmasterIndicatorType) { + this._type.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + confidence: cdktf.numberToTerraform(this._confidence), + first_occurrence_time: cdktf.stringToTerraform(this._firstOccurrenceTime), + granularity: cdktf.numberToTerraform(this._granularity), + id: cdktf.stringToTerraform(this._id), + invalid: cdktf.booleanToTerraform(this._invalid), + labels: cdktf.stringToTerraform(this._labels), + last_occurrence_time: cdktf.stringToTerraform(this._lastOccurrenceTime), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + threat_degree: cdktf.stringToTerraform(this._threatDegree), + value: cdktf.stringToTerraform(this._value), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + data_source: secmasterIndicatorDataSourceToTerraform(this._dataSource.internalValue), + type: secmasterIndicatorTypeToTerraform(this._type.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + confidence: { + value: cdktf.numberToHclTerraform(this._confidence), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + first_occurrence_time: { + value: cdktf.stringToHclTerraform(this._firstOccurrenceTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + granularity: { + value: cdktf.numberToHclTerraform(this._granularity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + invalid: { + value: cdktf.booleanToHclTerraform(this._invalid), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + labels: { + value: cdktf.stringToHclTerraform(this._labels), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + last_occurrence_time: { + value: cdktf.stringToHclTerraform(this._lastOccurrenceTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + threat_degree: { + value: cdktf.stringToHclTerraform(this._threatDegree), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(this._value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_source: { + value: secmasterIndicatorDataSourceToHclTerraform(this._dataSource.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterIndicatorDataSourceList", + }, + type: { + value: secmasterIndicatorTypeToHclTerraform(this._type.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterIndicatorTypeList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-action/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-action/README.md new file mode 100644 index 00000000..86297a87 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-action/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-action/index.ts new file mode 100644 index 00000000..a4bca9a2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-action/index.ts @@ -0,0 +1,360 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookActionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the workflow ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#action_id SecmasterPlaybookAction#action_id} + */ + readonly actionId: string; + /** + * Specifies the playbook action type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#action_type SecmasterPlaybookAction#action_type} + */ + readonly actionType?: string; + /** + * Specifies the description of the playbook action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#description SecmasterPlaybookAction#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#id SecmasterPlaybookAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook action name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#name SecmasterPlaybookAction#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#region SecmasterPlaybookAction#region} + */ + readonly region?: string; + /** + * Specifies the sort order of the playbook action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#sort_order SecmasterPlaybookAction#sort_order} + */ + readonly sortOrder?: number; + /** + * Specifies the playbook version ID of the action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#version_id SecmasterPlaybookAction#version_id} + */ + readonly versionId: string; + /** + * Specifies the ID of the workspace to which the playbook action belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#workspace_id SecmasterPlaybookAction#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action huaweicloud_secmaster_playbook_action} +*/ +export class SecmasterPlaybookAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookAction to import + * @param importFromId The id of the existing SecmasterPlaybookAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_action huaweicloud_secmaster_playbook_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookActionConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionId = config.actionId; + this._actionType = config.actionType; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._sortOrder = config.sortOrder; + this._versionId = config.versionId; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_id - computed: false, optional: false, required: true + private _actionId?: string; + public get actionId() { + return this.getStringAttribute('action_id'); + } + public set actionId(value: string) { + this._actionId = value; + } + // Temporarily expose input value. Use with caution. + public get actionIdInput() { + return this._actionId; + } + + // action_type - computed: true, optional: true, required: false + private _actionType?: string; + public get actionType() { + return this.getStringAttribute('action_type'); + } + public set actionType(value: string) { + this._actionType = value; + } + public resetActionType() { + this._actionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionTypeInput() { + return this._actionType; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // playbook_id - computed: true, optional: false, required: false + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sort_order - computed: true, optional: true, required: false + private _sortOrder?: number; + public get sortOrder() { + return this.getNumberAttribute('sort_order'); + } + public set sortOrder(value: number) { + this._sortOrder = value; + } + public resetSortOrder() { + this._sortOrder = undefined; + } + // Temporarily expose input value. Use with caution. + public get sortOrderInput() { + return this._sortOrder; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version_id - computed: false, optional: false, required: true + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_id: cdktf.stringToTerraform(this._actionId), + action_type: cdktf.stringToTerraform(this._actionType), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + sort_order: cdktf.numberToTerraform(this._sortOrder), + version_id: cdktf.stringToTerraform(this._versionId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_id: { + value: cdktf.stringToHclTerraform(this._actionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + action_type: { + value: cdktf.stringToHclTerraform(this._actionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sort_order: { + value: cdktf.numberToHclTerraform(this._sortOrder), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-approval/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-approval/README.md new file mode 100644 index 00000000..7aafa6d3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-approval/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_approval` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_approval`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-approval/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-approval/index.ts new file mode 100644 index 00000000..621601b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-approval/index.ts @@ -0,0 +1,258 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookApprovalConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the content of the playbook approval. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#content SecmasterPlaybookApproval#content} + */ + readonly content?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#id SecmasterPlaybookApproval#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#region SecmasterPlaybookApproval#region} + */ + readonly region?: string; + /** + * Specifies the result of playbook approval. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#result SecmasterPlaybookApproval#result} + */ + readonly result?: string; + /** + * Specifies the version ID of the playbook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#version_id SecmasterPlaybookApproval#version_id} + */ + readonly versionId: string; + /** + * Specifies the ID of the workspace to which the playbook belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#workspace_id SecmasterPlaybookApproval#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval huaweicloud_secmaster_playbook_approval} +*/ +export class SecmasterPlaybookApproval extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_approval"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookApproval resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookApproval to import + * @param importFromId The id of the existing SecmasterPlaybookApproval that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookApproval to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_approval", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_approval huaweicloud_secmaster_playbook_approval} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookApprovalConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookApprovalConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_approval', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._region = config.region; + this._result = config.result; + this._versionId = config.versionId; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // result - computed: false, optional: true, required: false + private _result?: string; + public get result() { + return this.getStringAttribute('result'); + } + public set result(value: string) { + this._result = value; + } + public resetResult() { + this._result = undefined; + } + // Temporarily expose input value. Use with caution. + public get resultInput() { + return this._result; + } + + // version_id - computed: false, optional: false, required: true + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + result: cdktf.stringToTerraform(this._result), + version_id: cdktf.stringToTerraform(this._versionId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + result: { + value: cdktf.stringToHclTerraform(this._result), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-enable/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-enable/README.md new file mode 100644 index 00000000..381db7da --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-enable/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_enable` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_enable`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-enable/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-enable/index.ts new file mode 100644 index 00000000..2bf621f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-enable/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookEnableConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the actived playbook version ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#active_version_id SecmasterPlaybookEnable#active_version_id} + */ + readonly activeVersionId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#id SecmasterPlaybookEnable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#playbook_id SecmasterPlaybookEnable#playbook_id} + */ + readonly playbookId: string; + /** + * Specifies the playbook name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#playbook_name SecmasterPlaybookEnable#playbook_name} + */ + readonly playbookName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#region SecmasterPlaybookEnable#region} + */ + readonly region?: string; + /** + * Specifies the ID of the workspace to which the playbook version belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#workspace_id SecmasterPlaybookEnable#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable huaweicloud_secmaster_playbook_enable} +*/ +export class SecmasterPlaybookEnable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_enable"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookEnable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookEnable to import + * @param importFromId The id of the existing SecmasterPlaybookEnable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookEnable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_enable", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_enable huaweicloud_secmaster_playbook_enable} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookEnableConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookEnableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_enable', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._activeVersionId = config.activeVersionId; + this._id = config.id; + this._playbookId = config.playbookId; + this._playbookName = config.playbookName; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_version_id - computed: false, optional: false, required: true + private _activeVersionId?: string; + public get activeVersionId() { + return this.getStringAttribute('active_version_id'); + } + public set activeVersionId(value: string) { + this._activeVersionId = value; + } + // Temporarily expose input value. Use with caution. + public get activeVersionIdInput() { + return this._activeVersionId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // playbook_id - computed: false, optional: false, required: true + private _playbookId?: string; + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + public set playbookId(value: string) { + this._playbookId = value; + } + // Temporarily expose input value. Use with caution. + public get playbookIdInput() { + return this._playbookId; + } + + // playbook_name - computed: false, optional: false, required: true + private _playbookName?: string; + public get playbookName() { + return this.getStringAttribute('playbook_name'); + } + public set playbookName(value: string) { + this._playbookName = value; + } + // Temporarily expose input value. Use with caution. + public get playbookNameInput() { + return this._playbookName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + active_version_id: cdktf.stringToTerraform(this._activeVersionId), + id: cdktf.stringToTerraform(this._id), + playbook_id: cdktf.stringToTerraform(this._playbookId), + playbook_name: cdktf.stringToTerraform(this._playbookName), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + active_version_id: { + value: cdktf.stringToHclTerraform(this._activeVersionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + playbook_id: { + value: cdktf.stringToHclTerraform(this._playbookId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + playbook_name: { + value: cdktf.stringToHclTerraform(this._playbookName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/README.md new file mode 100644 index 00000000..3b029b03 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_instance_operation` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_instance_operation`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/index.ts new file mode 100644 index 00000000..0a18e49c --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-instance-operation/index.ts @@ -0,0 +1,225 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookInstanceOperationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation#id SecmasterPlaybookInstanceOperation#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook instance ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation#instance_id SecmasterPlaybookInstanceOperation#instance_id} + */ + readonly instanceId: string; + /** + * Specifies the operation of the playbook instance. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation#operation SecmasterPlaybookInstanceOperation#operation} + */ + readonly operation: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation#region SecmasterPlaybookInstanceOperation#region} + */ + readonly region?: string; + /** + * Specifies the ID of the workspace to which the playbook instance belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation#workspace_id SecmasterPlaybookInstanceOperation#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation huaweicloud_secmaster_playbook_instance_operation} +*/ +export class SecmasterPlaybookInstanceOperation extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_instance_operation"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookInstanceOperation resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookInstanceOperation to import + * @param importFromId The id of the existing SecmasterPlaybookInstanceOperation that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookInstanceOperation to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_instance_operation", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_instance_operation huaweicloud_secmaster_playbook_instance_operation} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookInstanceOperationConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookInstanceOperationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_instance_operation', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._instanceId = config.instanceId; + this._operation = config.operation; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: false, optional: false, required: true + private _instanceId?: string; + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + public set instanceId(value: string) { + this._instanceId = value; + } + // Temporarily expose input value. Use with caution. + public get instanceIdInput() { + return this._instanceId; + } + + // operation - computed: false, optional: false, required: true + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + instance_id: cdktf.stringToTerraform(this._instanceId), + operation: cdktf.stringToTerraform(this._operation), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + instance_id: { + value: cdktf.stringToHclTerraform(this._instanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation: { + value: cdktf.stringToHclTerraform(this._operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-rule/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-rule/README.md new file mode 100644 index 00000000..c49aa372 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-rule/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-rule/index.ts new file mode 100644 index 00000000..158c9e4a --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-rule/index.ts @@ -0,0 +1,726 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the cron expression. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#cron SecmasterPlaybookRule#cron} + */ + readonly cron?: string; + /** + * Specifies the playbook end time. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#end_time SecmasterPlaybookRule#end_time} + */ + readonly endTime?: string; + /** + * Specifies the playbook end type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#end_type SecmasterPlaybookRule#end_type} + */ + readonly endType?: string; + /** + * Specifies the execution type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#execution_type SecmasterPlaybookRule#execution_type} + */ + readonly executionType?: string; + /** + * Specifies the expression type of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#expression_type SecmasterPlaybookRule#expression_type} + */ + readonly expressionType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#id SecmasterPlaybookRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the logics of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#logics SecmasterPlaybookRule#logics} + */ + readonly logics?: string[]; + /** + * Specifies the repeat range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#only_once SecmasterPlaybookRule#only_once} + */ + readonly onlyOnce?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#region SecmasterPlaybookRule#region} + */ + readonly region?: string; + /** + * Specifies the repeat range. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#repeat_range SecmasterPlaybookRule#repeat_range} + */ + readonly repeatRange?: string; + /** + * Specifies the schedule type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#schedule_type SecmasterPlaybookRule#schedule_type} + */ + readonly scheduleType?: string; + /** + * Specifies the playbook start type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#start_type SecmasterPlaybookRule#start_type} + */ + readonly startType?: string; + /** + * Specifies the playbook version ID of the rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#version_id SecmasterPlaybookRule#version_id} + */ + readonly versionId: string; + /** + * Specifies the ID of the workspace to which the playbook rule belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#workspace_id SecmasterPlaybookRule#workspace_id} + */ + readonly workspaceId: string; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#conditions SecmasterPlaybookRule#conditions} + */ + readonly conditions?: SecmasterPlaybookRuleConditions[] | cdktf.IResolvable; +} +export interface SecmasterPlaybookRuleConditions { + /** + * Specifies the condition data. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#data SecmasterPlaybookRule#data} + */ + readonly data?: string[]; + /** + * Specifies the condition detail. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#detail SecmasterPlaybookRule#detail} + */ + readonly detail?: string; + /** + * Specifies the condition name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#name SecmasterPlaybookRule#name} + */ + readonly name?: string; +} + +export function secmasterPlaybookRuleConditionsToTerraform(struct?: SecmasterPlaybookRuleConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + data: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.data), + detail: cdktf.stringToTerraform(struct!.detail), + name: cdktf.stringToTerraform(struct!.name), + } +} + + +export function secmasterPlaybookRuleConditionsToHclTerraform(struct?: SecmasterPlaybookRuleConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + data: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.data), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + detail: { + value: cdktf.stringToHclTerraform(struct!.detail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SecmasterPlaybookRuleConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SecmasterPlaybookRuleConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._data !== undefined) { + hasAnyValues = true; + internalValueResult.data = this._data; + } + if (this._detail !== undefined) { + hasAnyValues = true; + internalValueResult.detail = this._detail; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SecmasterPlaybookRuleConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._data = undefined; + this._detail = undefined; + this._name = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._data = value.data; + this._detail = value.detail; + this._name = value.name; + } + } + + // data - computed: true, optional: true, required: false + private _data?: string[]; + public get data() { + return this.getListAttribute('data'); + } + public set data(value: string[]) { + this._data = value; + } + public resetData() { + this._data = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataInput() { + return this._data; + } + + // detail - computed: true, optional: true, required: false + private _detail?: string; + public get detail() { + return this.getStringAttribute('detail'); + } + public set detail(value: string) { + this._detail = value; + } + public resetDetail() { + this._detail = undefined; + } + // Temporarily expose input value. Use with caution. + public get detailInput() { + return this._detail; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } +} + +export class SecmasterPlaybookRuleConditionsList extends cdktf.ComplexList { + public internalValue? : SecmasterPlaybookRuleConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SecmasterPlaybookRuleConditionsOutputReference { + return new SecmasterPlaybookRuleConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule huaweicloud_secmaster_playbook_rule} +*/ +export class SecmasterPlaybookRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookRule to import + * @param importFromId The id of the existing SecmasterPlaybookRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_rule huaweicloud_secmaster_playbook_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookRuleConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cron = config.cron; + this._endTime = config.endTime; + this._endType = config.endType; + this._executionType = config.executionType; + this._expressionType = config.expressionType; + this._id = config.id; + this._logics = config.logics; + this._onlyOnce = config.onlyOnce; + this._region = config.region; + this._repeatRange = config.repeatRange; + this._scheduleType = config.scheduleType; + this._startType = config.startType; + this._versionId = config.versionId; + this._workspaceId = config.workspaceId; + this._conditions.internalValue = config.conditions; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // cron - computed: true, optional: true, required: false + private _cron?: string; + public get cron() { + return this.getStringAttribute('cron'); + } + public set cron(value: string) { + this._cron = value; + } + public resetCron() { + this._cron = undefined; + } + // Temporarily expose input value. Use with caution. + public get cronInput() { + return this._cron; + } + + // end_time - computed: true, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // end_type - computed: true, optional: true, required: false + private _endType?: string; + public get endType() { + return this.getStringAttribute('end_type'); + } + public set endType(value: string) { + this._endType = value; + } + public resetEndType() { + this._endType = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTypeInput() { + return this._endType; + } + + // execution_type - computed: true, optional: true, required: false + private _executionType?: string; + public get executionType() { + return this.getStringAttribute('execution_type'); + } + public set executionType(value: string) { + this._executionType = value; + } + public resetExecutionType() { + this._executionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get executionTypeInput() { + return this._executionType; + } + + // expression_type - computed: true, optional: true, required: false + private _expressionType?: string; + public get expressionType() { + return this.getStringAttribute('expression_type'); + } + public set expressionType(value: string) { + this._expressionType = value; + } + public resetExpressionType() { + this._expressionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get expressionTypeInput() { + return this._expressionType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // logics - computed: true, optional: true, required: false + private _logics?: string[]; + public get logics() { + return this.getListAttribute('logics'); + } + public set logics(value: string[]) { + this._logics = value; + } + public resetLogics() { + this._logics = undefined; + } + // Temporarily expose input value. Use with caution. + public get logicsInput() { + return this._logics; + } + + // only_once - computed: true, optional: true, required: false + private _onlyOnce?: boolean | cdktf.IResolvable; + public get onlyOnce() { + return this.getBooleanAttribute('only_once'); + } + public set onlyOnce(value: boolean | cdktf.IResolvable) { + this._onlyOnce = value; + } + public resetOnlyOnce() { + this._onlyOnce = undefined; + } + // Temporarily expose input value. Use with caution. + public get onlyOnceInput() { + return this._onlyOnce; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repeat_range - computed: true, optional: true, required: false + private _repeatRange?: string; + public get repeatRange() { + return this.getStringAttribute('repeat_range'); + } + public set repeatRange(value: string) { + this._repeatRange = value; + } + public resetRepeatRange() { + this._repeatRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get repeatRangeInput() { + return this._repeatRange; + } + + // schedule_type - computed: true, optional: true, required: false + private _scheduleType?: string; + public get scheduleType() { + return this.getStringAttribute('schedule_type'); + } + public set scheduleType(value: string) { + this._scheduleType = value; + } + public resetScheduleType() { + this._scheduleType = undefined; + } + // Temporarily expose input value. Use with caution. + public get scheduleTypeInput() { + return this._scheduleType; + } + + // start_type - computed: true, optional: true, required: false + private _startType?: string; + public get startType() { + return this.getStringAttribute('start_type'); + } + public set startType(value: string) { + this._startType = value; + } + public resetStartType() { + this._startType = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTypeInput() { + return this._startType; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version_id - computed: false, optional: false, required: true + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // conditions - computed: false, optional: true, required: false + private _conditions = new SecmasterPlaybookRuleConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: SecmasterPlaybookRuleConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + public resetConditions() { + this._conditions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cron: cdktf.stringToTerraform(this._cron), + end_time: cdktf.stringToTerraform(this._endTime), + end_type: cdktf.stringToTerraform(this._endType), + execution_type: cdktf.stringToTerraform(this._executionType), + expression_type: cdktf.stringToTerraform(this._expressionType), + id: cdktf.stringToTerraform(this._id), + logics: cdktf.listMapper(cdktf.stringToTerraform, false)(this._logics), + only_once: cdktf.booleanToTerraform(this._onlyOnce), + region: cdktf.stringToTerraform(this._region), + repeat_range: cdktf.stringToTerraform(this._repeatRange), + schedule_type: cdktf.stringToTerraform(this._scheduleType), + start_type: cdktf.stringToTerraform(this._startType), + version_id: cdktf.stringToTerraform(this._versionId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + conditions: cdktf.listMapper(secmasterPlaybookRuleConditionsToTerraform, true)(this._conditions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cron: { + value: cdktf.stringToHclTerraform(this._cron), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_type: { + value: cdktf.stringToHclTerraform(this._endType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + execution_type: { + value: cdktf.stringToHclTerraform(this._executionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + expression_type: { + value: cdktf.stringToHclTerraform(this._expressionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logics: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._logics), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + only_once: { + value: cdktf.booleanToHclTerraform(this._onlyOnce), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repeat_range: { + value: cdktf.stringToHclTerraform(this._repeatRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + schedule_type: { + value: cdktf.stringToHclTerraform(this._scheduleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_type: { + value: cdktf.stringToHclTerraform(this._startType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conditions: { + value: cdktf.listMapperHcl(secmasterPlaybookRuleConditionsToHclTerraform, true)(this._conditions.internalValue), + isBlock: true, + type: "list", + storageClassType: "SecmasterPlaybookRuleConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-version-action/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-version-action/README.md new file mode 100644 index 00000000..2f95667d --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-version-action/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_version_action` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_version_action`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-version-action/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-version-action/index.ts new file mode 100644 index 00000000..db04ba2e --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-version-action/index.ts @@ -0,0 +1,353 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookVersionActionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether the playbook version is enabled. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#enabled SecmasterPlaybookVersionAction#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#id SecmasterPlaybookVersionAction#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#region SecmasterPlaybookVersionAction#region} + */ + readonly region?: string; + /** + * Specifies the playbook version status. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#status SecmasterPlaybookVersionAction#status} + */ + readonly status?: string; + /** + * Specifies the playbook version ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#version_id SecmasterPlaybookVersionAction#version_id} + */ + readonly versionId: string; + /** + * Specifies the ID of the workspace to which the playbook version belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#workspace_id SecmasterPlaybookVersionAction#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action huaweicloud_secmaster_playbook_version_action} +*/ +export class SecmasterPlaybookVersionAction extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_version_action"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookVersionAction resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookVersionAction to import + * @param importFromId The id of the existing SecmasterPlaybookVersionAction that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookVersionAction to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_version_action", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version_action huaweicloud_secmaster_playbook_version_action} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookVersionActionConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookVersionActionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_version_action', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enabled = config.enabled; + this._id = config.id; + this._region = config.region; + this._status = config.status; + this._versionId = config.versionId; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_strategy - computed: true, optional: false, required: false + public get actionStrategy() { + return this.getStringAttribute('action_strategy'); + } + + // approve_name - computed: true, optional: false, required: false + public get approveName() { + return this.getStringAttribute('approve_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator_id - computed: true, optional: false, required: false + public get creatorId() { + return this.getStringAttribute('creator_id'); + } + + // data_class_id - computed: true, optional: false, required: false + public get dataClassId() { + return this.getStringAttribute('data_class_id'); + } + + // data_class_name - computed: true, optional: false, required: false + public get dataClassName() { + return this.getStringAttribute('data_class_name'); + } + + // data_object_create - computed: true, optional: false, required: false + public get dataObjectCreate() { + return this.getBooleanAttribute('data_object_create'); + } + + // data_object_delete - computed: true, optional: false, required: false + public get dataObjectDelete() { + return this.getBooleanAttribute('data_object_delete'); + } + + // data_object_update - computed: true, optional: false, required: false + public get dataObjectUpdate() { + return this.getBooleanAttribute('data_object_update'); + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // enabled - computed: true, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // modifier_id - computed: true, optional: false, required: false + public get modifierId() { + return this.getStringAttribute('modifier_id'); + } + + // playbook_id - computed: true, optional: false, required: false + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + + // project_id - computed: true, optional: false, required: false + public get projectId() { + return this.getStringAttribute('project_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_enabled - computed: true, optional: false, required: false + public get ruleEnabled() { + return this.getBooleanAttribute('rule_enabled'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // trigger_type - computed: true, optional: false, required: false + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getNumberAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // version_id - computed: false, optional: false, required: true + private _versionId?: string; + public get versionId() { + return this.getStringAttribute('version_id'); + } + public set versionId(value: string) { + this._versionId = value; + } + // Temporarily expose input value. Use with caution. + public get versionIdInput() { + return this._versionId; + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + status: cdktf.stringToTerraform(this._status), + version_id: cdktf.stringToTerraform(this._versionId), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_id: { + value: cdktf.stringToHclTerraform(this._versionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-version/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook-version/README.md new file mode 100644 index 00000000..731b02eb --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-version/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook_version` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook_version`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook-version/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook-version/index.ts new file mode 100644 index 00000000..f64d42b0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook-version/index.ts @@ -0,0 +1,515 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookVersionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the action strategy of the playbook version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#action_strategy SecmasterPlaybookVersion#action_strategy} + */ + readonly actionStrategy?: string; + /** + * Specifies the data class ID of the playbook version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#dataclass_id SecmasterPlaybookVersion#dataclass_id} + */ + readonly dataclassId: string; + /** + * Specifies whether to trigger the playbook when data object is created. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#dataobject_create SecmasterPlaybookVersion#dataobject_create} + */ + readonly dataobjectCreate?: boolean | cdktf.IResolvable; + /** + * Specifies whether to trigger the playbook when data object is deleted. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#dataobject_delete SecmasterPlaybookVersion#dataobject_delete} + */ + readonly dataobjectDelete?: boolean | cdktf.IResolvable; + /** + * Specifies whether to trigger the playbook when data object is updated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#dataobject_update SecmasterPlaybookVersion#dataobject_update} + */ + readonly dataobjectUpdate?: boolean | cdktf.IResolvable; + /** + * Specifies the description of the playbook version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#description SecmasterPlaybookVersion#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#id SecmasterPlaybookVersion#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies playbook ID of the playbook version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#playbook_id SecmasterPlaybookVersion#playbook_id} + */ + readonly playbookId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#region SecmasterPlaybookVersion#region} + */ + readonly region?: string; + /** + * Specifies whether to enable playbook rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#rule_enable SecmasterPlaybookVersion#rule_enable} + */ + readonly ruleEnable?: boolean | cdktf.IResolvable; + /** + * Specifies the playbook rule ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#rule_id SecmasterPlaybookVersion#rule_id} + */ + readonly ruleId?: string; + /** + * Specifies the trigger type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#trigger_type SecmasterPlaybookVersion#trigger_type} + */ + readonly triggerType?: string; + /** + * Specifies the ID of the workspace to which the playbook version belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#workspace_id SecmasterPlaybookVersion#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version huaweicloud_secmaster_playbook_version} +*/ +export class SecmasterPlaybookVersion extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook_version"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybookVersion resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybookVersion to import + * @param importFromId The id of the existing SecmasterPlaybookVersion that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybookVersion to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook_version", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook_version huaweicloud_secmaster_playbook_version} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookVersionConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookVersionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook_version', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._actionStrategy = config.actionStrategy; + this._dataclassId = config.dataclassId; + this._dataobjectCreate = config.dataobjectCreate; + this._dataobjectDelete = config.dataobjectDelete; + this._dataobjectUpdate = config.dataobjectUpdate; + this._description = config.description; + this._id = config.id; + this._playbookId = config.playbookId; + this._region = config.region; + this._ruleEnable = config.ruleEnable; + this._ruleId = config.ruleId; + this._triggerType = config.triggerType; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action_strategy - computed: true, optional: true, required: false + private _actionStrategy?: string; + public get actionStrategy() { + return this.getStringAttribute('action_strategy'); + } + public set actionStrategy(value: string) { + this._actionStrategy = value; + } + public resetActionStrategy() { + this._actionStrategy = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionStrategyInput() { + return this._actionStrategy; + } + + // approve_name - computed: true, optional: false, required: false + public get approveName() { + return this.getStringAttribute('approve_name'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator_id - computed: true, optional: false, required: false + public get creatorId() { + return this.getStringAttribute('creator_id'); + } + + // dataclass_id - computed: false, optional: false, required: true + private _dataclassId?: string; + public get dataclassId() { + return this.getStringAttribute('dataclass_id'); + } + public set dataclassId(value: string) { + this._dataclassId = value; + } + // Temporarily expose input value. Use with caution. + public get dataclassIdInput() { + return this._dataclassId; + } + + // dataclass_name - computed: true, optional: false, required: false + public get dataclassName() { + return this.getStringAttribute('dataclass_name'); + } + + // dataobject_create - computed: true, optional: true, required: false + private _dataobjectCreate?: boolean | cdktf.IResolvable; + public get dataobjectCreate() { + return this.getBooleanAttribute('dataobject_create'); + } + public set dataobjectCreate(value: boolean | cdktf.IResolvable) { + this._dataobjectCreate = value; + } + public resetDataobjectCreate() { + this._dataobjectCreate = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataobjectCreateInput() { + return this._dataobjectCreate; + } + + // dataobject_delete - computed: true, optional: true, required: false + private _dataobjectDelete?: boolean | cdktf.IResolvable; + public get dataobjectDelete() { + return this.getBooleanAttribute('dataobject_delete'); + } + public set dataobjectDelete(value: boolean | cdktf.IResolvable) { + this._dataobjectDelete = value; + } + public resetDataobjectDelete() { + this._dataobjectDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataobjectDeleteInput() { + return this._dataobjectDelete; + } + + // dataobject_update - computed: true, optional: true, required: false + private _dataobjectUpdate?: boolean | cdktf.IResolvable; + public get dataobjectUpdate() { + return this.getBooleanAttribute('dataobject_update'); + } + public set dataobjectUpdate(value: boolean | cdktf.IResolvable) { + this._dataobjectUpdate = value; + } + public resetDataobjectUpdate() { + this._dataobjectUpdate = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataobjectUpdateInput() { + return this._dataobjectUpdate; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: true, optional: false, required: false + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // modifier_id - computed: true, optional: false, required: false + public get modifierId() { + return this.getStringAttribute('modifier_id'); + } + + // playbook_id - computed: false, optional: false, required: true + private _playbookId?: string; + public get playbookId() { + return this.getStringAttribute('playbook_id'); + } + public set playbookId(value: string) { + this._playbookId = value; + } + // Temporarily expose input value. Use with caution. + public get playbookIdInput() { + return this._playbookId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rule_enable - computed: true, optional: true, required: false + private _ruleEnable?: boolean | cdktf.IResolvable; + public get ruleEnable() { + return this.getBooleanAttribute('rule_enable'); + } + public set ruleEnable(value: boolean | cdktf.IResolvable) { + this._ruleEnable = value; + } + public resetRuleEnable() { + this._ruleEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleEnableInput() { + return this._ruleEnable; + } + + // rule_id - computed: true, optional: true, required: false + private _ruleId?: string; + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + public set ruleId(value: string) { + this._ruleId = value; + } + public resetRuleId() { + this._ruleId = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIdInput() { + return this._ruleId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // trigger_type - computed: true, optional: true, required: false + private _triggerType?: string; + public get triggerType() { + return this.getStringAttribute('trigger_type'); + } + public set triggerType(value: string) { + this._triggerType = value; + } + public resetTriggerType() { + this._triggerType = undefined; + } + // Temporarily expose input value. Use with caution. + public get triggerTypeInput() { + return this._triggerType; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // version_type - computed: true, optional: false, required: false + public get versionType() { + return this.getNumberAttribute('version_type'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action_strategy: cdktf.stringToTerraform(this._actionStrategy), + dataclass_id: cdktf.stringToTerraform(this._dataclassId), + dataobject_create: cdktf.booleanToTerraform(this._dataobjectCreate), + dataobject_delete: cdktf.booleanToTerraform(this._dataobjectDelete), + dataobject_update: cdktf.booleanToTerraform(this._dataobjectUpdate), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + playbook_id: cdktf.stringToTerraform(this._playbookId), + region: cdktf.stringToTerraform(this._region), + rule_enable: cdktf.booleanToTerraform(this._ruleEnable), + rule_id: cdktf.stringToTerraform(this._ruleId), + trigger_type: cdktf.stringToTerraform(this._triggerType), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action_strategy: { + value: cdktf.stringToHclTerraform(this._actionStrategy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dataclass_id: { + value: cdktf.stringToHclTerraform(this._dataclassId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dataobject_create: { + value: cdktf.booleanToHclTerraform(this._dataobjectCreate), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dataobject_delete: { + value: cdktf.booleanToHclTerraform(this._dataobjectDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dataobject_update: { + value: cdktf.booleanToHclTerraform(this._dataobjectUpdate), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + playbook_id: { + value: cdktf.stringToHclTerraform(this._playbookId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_enable: { + value: cdktf.booleanToHclTerraform(this._ruleEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + rule_id: { + value: cdktf.stringToHclTerraform(this._ruleId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + trigger_type: { + value: cdktf.stringToHclTerraform(this._triggerType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook/README.md b/src/constructs/providers/huaweicloud/secmaster-playbook/README.md new file mode 100644 index 00000000..98fa20fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_secmaster_playbook` + +Refer to the Terraform Registry for docs: [`huaweicloud_secmaster_playbook`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook). diff --git a/src/constructs/providers/huaweicloud/secmaster-playbook/index.ts b/src/constructs/providers/huaweicloud/secmaster-playbook/index.ts new file mode 100644 index 00000000..461f4a94 --- /dev/null +++ b/src/constructs/providers/huaweicloud/secmaster-playbook/index.ts @@ -0,0 +1,346 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SecmasterPlaybookConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Deprecated; Specifies the active version ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#active_version_id SecmasterPlaybook#active_version_id} + */ + readonly activeVersionId?: string; + /** + * Specifies the description of the playbook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#description SecmasterPlaybook#description} + */ + readonly description?: string; + /** + * schema: Deprecated; Specifies whether to enable the playbook. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#enabled SecmasterPlaybook#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#id SecmasterPlaybook#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the playbook name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#name SecmasterPlaybook#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#region SecmasterPlaybook#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#workspace_id SecmasterPlaybook#workspace_id} + */ + readonly workspaceId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook huaweicloud_secmaster_playbook} +*/ +export class SecmasterPlaybook extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_secmaster_playbook"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SecmasterPlaybook resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SecmasterPlaybook to import + * @param importFromId The id of the existing SecmasterPlaybook that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SecmasterPlaybook to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_secmaster_playbook", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/secmaster_playbook huaweicloud_secmaster_playbook} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SecmasterPlaybookConfig + */ + public constructor(scope: Construct, id: string, config: SecmasterPlaybookConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_secmaster_playbook', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._activeVersionId = config.activeVersionId; + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._workspaceId = config.workspaceId; + } + + // ========== + // ATTRIBUTES + // ========== + + // active_version_id - computed: true, optional: true, required: false + private _activeVersionId?: string; + public get activeVersionId() { + return this.getStringAttribute('active_version_id'); + } + public set activeVersionId(value: string) { + this._activeVersionId = value; + } + public resetActiveVersionId() { + this._activeVersionId = undefined; + } + // Temporarily expose input value. Use with caution. + public get activeVersionIdInput() { + return this._activeVersionId; + } + + // approve_role - computed: true, optional: false, required: false + public get approveRole() { + return this.getStringAttribute('approve_role'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // dataclass_id - computed: true, optional: false, required: false + public get dataclassId() { + return this.getStringAttribute('dataclass_id'); + } + + // dataclass_name - computed: true, optional: false, required: false + public get dataclassName() { + return this.getStringAttribute('dataclass_name'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // edit_role - computed: true, optional: false, required: false + public get editRole() { + return this.getStringAttribute('edit_role'); + } + + // enabled - computed: true, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // owner_id - computed: true, optional: false, required: false + public get ownerId() { + return this.getStringAttribute('owner_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // reject_version_id - computed: true, optional: false, required: false + public get rejectVersionId() { + return this.getStringAttribute('reject_version_id'); + } + + // unaudited_version_id - computed: true, optional: false, required: false + public get unauditedVersionId() { + return this.getStringAttribute('unaudited_version_id'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_role - computed: true, optional: false, required: false + public get userRole() { + return this.getStringAttribute('user_role'); + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // version_id - computed: true, optional: false, required: false + public get versionId() { + return this.getStringAttribute('version_id'); + } + + // workspace_id - computed: false, optional: false, required: true + private _workspaceId?: string; + public get workspaceId() { + return this.getStringAttribute('workspace_id'); + } + public set workspaceId(value: string) { + this._workspaceId = value; + } + // Temporarily expose input value. Use with caution. + public get workspaceIdInput() { + return this._workspaceId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + active_version_id: cdktf.stringToTerraform(this._activeVersionId), + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + workspace_id: cdktf.stringToTerraform(this._workspaceId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + active_version_id: { + value: cdktf.stringToHclTerraform(this._activeVersionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workspace_id: { + value: cdktf.stringToHclTerraform(this._workspaceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestage-application/README.md b/src/constructs/providers/huaweicloud/servicestage-application/README.md new file mode 100644 index 00000000..808052ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestage_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestage_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application). diff --git a/src/constructs/providers/huaweicloud/servicestage-application/index.ts b/src/constructs/providers/huaweicloud/servicestage-application/index.ts new file mode 100644 index 00000000..3832b99d --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-application/index.ts @@ -0,0 +1,551 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ServicestageApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#description ServicestageApplication#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#enterprise_project_id ServicestageApplication#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#id ServicestageApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#name ServicestageApplication#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#region ServicestageApplication#region} + */ + readonly region?: string; + /** + * environment block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#environment ServicestageApplication#environment} + */ + readonly environment?: ServicestageApplicationEnvironment[] | cdktf.IResolvable; +} +export interface ServicestageApplicationEnvironmentVariable { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#name ServicestageApplication#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#value ServicestageApplication#value} + */ + readonly value: string; +} + +export function servicestageApplicationEnvironmentVariableToTerraform(struct?: ServicestageApplicationEnvironmentVariable | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function servicestageApplicationEnvironmentVariableToHclTerraform(struct?: ServicestageApplicationEnvironmentVariable | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageApplicationEnvironmentVariableOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageApplicationEnvironmentVariable | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageApplicationEnvironmentVariable | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ServicestageApplicationEnvironmentVariableList extends cdktf.ComplexList { + public internalValue? : ServicestageApplicationEnvironmentVariable[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageApplicationEnvironmentVariableOutputReference { + return new ServicestageApplicationEnvironmentVariableOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageApplicationEnvironment { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#id ServicestageApplication#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * variable block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#variable ServicestageApplication#variable} + */ + readonly variable: ServicestageApplicationEnvironmentVariable[] | cdktf.IResolvable; +} + +export function servicestageApplicationEnvironmentToTerraform(struct?: ServicestageApplicationEnvironment | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + variable: cdktf.listMapper(servicestageApplicationEnvironmentVariableToTerraform, true)(struct!.variable), + } +} + + +export function servicestageApplicationEnvironmentToHclTerraform(struct?: ServicestageApplicationEnvironment | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + variable: { + value: cdktf.listMapperHcl(servicestageApplicationEnvironmentVariableToHclTerraform, true)(struct!.variable), + isBlock: true, + type: "set", + storageClassType: "ServicestageApplicationEnvironmentVariableList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageApplicationEnvironmentOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageApplicationEnvironment | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._variable?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.variable = this._variable?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageApplicationEnvironment | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._variable.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._variable.internalValue = value.variable; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // variable - computed: false, optional: false, required: true + private _variable = new ServicestageApplicationEnvironmentVariableList(this, "variable", true); + public get variable() { + return this._variable; + } + public putVariable(value: ServicestageApplicationEnvironmentVariable[] | cdktf.IResolvable) { + this._variable.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get variableInput() { + return this._variable.internalValue; + } +} + +export class ServicestageApplicationEnvironmentList extends cdktf.ComplexList { + public internalValue? : ServicestageApplicationEnvironment[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageApplicationEnvironmentOutputReference { + return new ServicestageApplicationEnvironmentOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application huaweicloud_servicestage_application} +*/ +export class ServicestageApplication extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ServicestageApplication resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ServicestageApplication to import + * @param importFromId The id of the existing ServicestageApplication that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ServicestageApplication to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_application huaweicloud_servicestage_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ServicestageApplicationConfig + */ + public constructor(scope: Construct, id: string, config: ServicestageApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._environment.internalValue = config.environment; + } + + // ========== + // ATTRIBUTES + // ========== + + // component_ids - computed: true, optional: false, required: false + public get componentIds() { + return this.getListAttribute('component_ids'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // environment - computed: false, optional: true, required: false + private _environment = new ServicestageApplicationEnvironmentList(this, "environment", true); + public get environment() { + return this._environment; + } + public putEnvironment(value: ServicestageApplicationEnvironment[] | cdktf.IResolvable) { + this._environment.internalValue = value; + } + public resetEnvironment() { + this._environment.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get environmentInput() { + return this._environment.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + environment: cdktf.listMapper(servicestageApplicationEnvironmentToTerraform, true)(this._environment.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment: { + value: cdktf.listMapperHcl(servicestageApplicationEnvironmentToHclTerraform, true)(this._environment.internalValue), + isBlock: true, + type: "set", + storageClassType: "ServicestageApplicationEnvironmentList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestage-component-instance/README.md b/src/constructs/providers/huaweicloud/servicestage-component-instance/README.md new file mode 100644 index 00000000..acb4dcea --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-component-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestage_component_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestage_component_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance). diff --git a/src/constructs/providers/huaweicloud/servicestage-component-instance/index.ts b/src/constructs/providers/huaweicloud/servicestage-component-instance/index.ts new file mode 100644 index 00000000..599a5830 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-component-instance/index.ts @@ -0,0 +1,5470 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ServicestageComponentInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#application_id ServicestageComponentInstance#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#component_id ServicestageComponentInstance#component_id} + */ + readonly componentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#description ServicestageComponentInstance#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#environment_id ServicestageComponentInstance#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#flavor_id ServicestageComponentInstance#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#id ServicestageComponentInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#name ServicestageComponentInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#region ServicestageComponentInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#replica ServicestageComponentInstance#replica} + */ + readonly replica: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#version ServicestageComponentInstance#version} + */ + readonly version: string; + /** + * artifact block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#artifact ServicestageComponentInstance#artifact} + */ + readonly artifact?: ServicestageComponentInstanceArtifact[] | cdktf.IResolvable; + /** + * configuration block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#configuration ServicestageComponentInstance#configuration} + */ + readonly configuration?: ServicestageComponentInstanceConfiguration; + /** + * external_access block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#external_access ServicestageComponentInstance#external_access} + */ + readonly externalAccess?: ServicestageComponentInstanceExternalAccess[] | cdktf.IResolvable; + /** + * refer_resource block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#refer_resource ServicestageComponentInstance#refer_resource} + */ + readonly referResource: ServicestageComponentInstanceReferResource[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#timeouts ServicestageComponentInstance#timeouts} + */ + readonly timeouts?: ServicestageComponentInstanceTimeouts; +} +export interface ServicestageComponentInstanceArtifactProperties { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#bucket ServicestageComponentInstance#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#endpoint ServicestageComponentInstance#endpoint} + */ + readonly endpoint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#key ServicestageComponentInstance#key} + */ + readonly key?: string; +} + +export function servicestageComponentInstanceArtifactPropertiesToTerraform(struct?: ServicestageComponentInstanceArtifactPropertiesOutputReference | ServicestageComponentInstanceArtifactProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket: cdktf.stringToTerraform(struct!.bucket), + endpoint: cdktf.stringToTerraform(struct!.endpoint), + key: cdktf.stringToTerraform(struct!.key), + } +} + + +export function servicestageComponentInstanceArtifactPropertiesToHclTerraform(struct?: ServicestageComponentInstanceArtifactPropertiesOutputReference | ServicestageComponentInstanceArtifactProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint: { + value: cdktf.stringToHclTerraform(struct!.endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceArtifactPropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceArtifactProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._endpoint !== undefined) { + hasAnyValues = true; + internalValueResult.endpoint = this._endpoint; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceArtifactProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucket = undefined; + this._endpoint = undefined; + this._key = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucket = value.bucket; + this._endpoint = value.endpoint; + this._key = value.key; + } + } + + // bucket - computed: true, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // endpoint - computed: true, optional: true, required: false + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + public resetEndpoint() { + this._endpoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } + + // key - computed: true, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } +} +export interface ServicestageComponentInstanceArtifact { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#auth_type ServicestageComponentInstance#auth_type} + */ + readonly authType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#name ServicestageComponentInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#storage ServicestageComponentInstance#storage} + */ + readonly storage: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#url ServicestageComponentInstance#url} + */ + readonly url: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#version ServicestageComponentInstance#version} + */ + readonly version?: string; + /** + * properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#properties ServicestageComponentInstance#properties} + */ + readonly properties?: ServicestageComponentInstanceArtifactProperties; +} + +export function servicestageComponentInstanceArtifactToTerraform(struct?: ServicestageComponentInstanceArtifact | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + auth_type: cdktf.stringToTerraform(struct!.authType), + name: cdktf.stringToTerraform(struct!.name), + storage: cdktf.stringToTerraform(struct!.storage), + type: cdktf.stringToTerraform(struct!.type), + url: cdktf.stringToTerraform(struct!.url), + version: cdktf.stringToTerraform(struct!.version), + properties: servicestageComponentInstanceArtifactPropertiesToTerraform(struct!.properties), + } +} + + +export function servicestageComponentInstanceArtifactToHclTerraform(struct?: ServicestageComponentInstanceArtifact | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + auth_type: { + value: cdktf.stringToHclTerraform(struct!.authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage: { + value: cdktf.stringToHclTerraform(struct!.storage), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(struct!.url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + properties: { + value: servicestageComponentInstanceArtifactPropertiesToHclTerraform(struct!.properties), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceArtifactPropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceArtifactOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceArtifact | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authType !== undefined) { + hasAnyValues = true; + internalValueResult.authType = this._authType; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._storage !== undefined) { + hasAnyValues = true; + internalValueResult.storage = this._storage; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._url !== undefined) { + hasAnyValues = true; + internalValueResult.url = this._url; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + if (this._properties?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.properties = this._properties?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceArtifact | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._authType = undefined; + this._name = undefined; + this._storage = undefined; + this._type = undefined; + this._url = undefined; + this._version = undefined; + this._properties.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._authType = value.authType; + this._name = value.name; + this._storage = value.storage; + this._type = value.type; + this._url = value.url; + this._version = value.version; + this._properties.internalValue = value.properties; + } + } + + // auth_type - computed: false, optional: true, required: false + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + public resetAuthType() { + this._authType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // storage - computed: false, optional: false, required: true + private _storage?: string; + public get storage() { + return this.getStringAttribute('storage'); + } + public set storage(value: string) { + this._storage = value; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // properties - computed: false, optional: true, required: false + private _properties = new ServicestageComponentInstanceArtifactPropertiesOutputReference(this, "properties"); + public get properties() { + return this._properties; + } + public putProperties(value: ServicestageComponentInstanceArtifactProperties) { + this._properties.internalValue = value; + } + public resetProperties() { + this._properties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties.internalValue; + } +} + +export class ServicestageComponentInstanceArtifactList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceArtifact[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceArtifactOutputReference { + return new ServicestageComponentInstanceArtifactOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceConfigurationEnvVariable { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#name ServicestageComponentInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#value ServicestageComponentInstance#value} + */ + readonly value: string; +} + +export function servicestageComponentInstanceConfigurationEnvVariableToTerraform(struct?: ServicestageComponentInstanceConfigurationEnvVariable | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function servicestageComponentInstanceConfigurationEnvVariableToHclTerraform(struct?: ServicestageComponentInstanceConfigurationEnvVariable | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationEnvVariableOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationEnvVariable | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationEnvVariable | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class ServicestageComponentInstanceConfigurationEnvVariableList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceConfigurationEnvVariable[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceConfigurationEnvVariableOutputReference { + return new ServicestageComponentInstanceConfigurationEnvVariableOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceConfigurationLifecycleEntrypoint { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#args ServicestageComponentInstance#args} + */ + readonly args: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#commands ServicestageComponentInstance#commands} + */ + readonly commands: string[]; +} + +export function servicestageComponentInstanceConfigurationLifecycleEntrypointToTerraform(struct?: ServicestageComponentInstanceConfigurationLifecycleEntrypointOutputReference | ServicestageComponentInstanceConfigurationLifecycleEntrypoint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + args: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.args), + commands: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.commands), + } +} + + +export function servicestageComponentInstanceConfigurationLifecycleEntrypointToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLifecycleEntrypointOutputReference | ServicestageComponentInstanceConfigurationLifecycleEntrypoint): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + args: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.args), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + commands: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.commands), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLifecycleEntrypointOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLifecycleEntrypoint | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._args !== undefined) { + hasAnyValues = true; + internalValueResult.args = this._args; + } + if (this._commands !== undefined) { + hasAnyValues = true; + internalValueResult.commands = this._commands; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLifecycleEntrypoint | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._args = undefined; + this._commands = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._args = value.args; + this._commands = value.commands; + } + } + + // args - computed: false, optional: false, required: true + private _args?: string[]; + public get args() { + return this.getListAttribute('args'); + } + public set args(value: string[]) { + this._args = value; + } + // Temporarily expose input value. Use with caution. + public get argsInput() { + return this._args; + } + + // commands - computed: false, optional: false, required: true + private _commands?: string[]; + public get commands() { + return this.getListAttribute('commands'); + } + public set commands(value: string[]) { + this._commands = value; + } + // Temporarily expose input value. Use with caution. + public get commandsInput() { + return this._commands; + } +} +export interface ServicestageComponentInstanceConfigurationLifecyclePostStartParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#commands ServicestageComponentInstance#commands} + */ + readonly commands?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#host ServicestageComponentInstance#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port?: number; +} + +export function servicestageComponentInstanceConfigurationLifecyclePostStartParametersToTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePostStartParametersOutputReference | ServicestageComponentInstanceConfigurationLifecyclePostStartParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + commands: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.commands), + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function servicestageComponentInstanceConfigurationLifecyclePostStartParametersToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePostStartParametersOutputReference | ServicestageComponentInstanceConfigurationLifecyclePostStartParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + commands: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.commands), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLifecyclePostStartParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLifecyclePostStartParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._commands !== undefined) { + hasAnyValues = true; + internalValueResult.commands = this._commands; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLifecyclePostStartParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._commands = undefined; + this._host = undefined; + this._path = undefined; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._commands = value.commands; + this._host = value.host; + this._path = value.path; + this._port = value.port; + } + } + + // commands - computed: true, optional: true, required: false + private _commands?: string[]; + public get commands() { + return this.getListAttribute('commands'); + } + public set commands(value: string[]) { + this._commands = value; + } + public resetCommands() { + this._commands = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandsInput() { + return this._commands; + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} +export interface ServicestageComponentInstanceConfigurationLifecyclePostStart { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#parameters ServicestageComponentInstance#parameters} + */ + readonly parameters: ServicestageComponentInstanceConfigurationLifecyclePostStartParameters; +} + +export function servicestageComponentInstanceConfigurationLifecyclePostStartToTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePostStartOutputReference | ServicestageComponentInstanceConfigurationLifecyclePostStart): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + parameters: servicestageComponentInstanceConfigurationLifecyclePostStartParametersToTerraform(struct!.parameters), + } +} + + +export function servicestageComponentInstanceConfigurationLifecyclePostStartToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePostStartOutputReference | ServicestageComponentInstanceConfigurationLifecyclePostStart): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: servicestageComponentInstanceConfigurationLifecyclePostStartParametersToHclTerraform(struct!.parameters), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationLifecyclePostStartParametersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLifecyclePostStartOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLifecyclePostStart | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._parameters?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLifecyclePostStart | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._parameters.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._parameters.internalValue = value.parameters; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // parameters - computed: false, optional: false, required: true + private _parameters = new ServicestageComponentInstanceConfigurationLifecyclePostStartParametersOutputReference(this, "parameters"); + public get parameters() { + return this._parameters; + } + public putParameters(value: ServicestageComponentInstanceConfigurationLifecyclePostStartParameters) { + this._parameters.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationLifecyclePreStopParameters { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#commands ServicestageComponentInstance#commands} + */ + readonly commands?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#host ServicestageComponentInstance#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port?: number; +} + +export function servicestageComponentInstanceConfigurationLifecyclePreStopParametersToTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePreStopParametersOutputReference | ServicestageComponentInstanceConfigurationLifecyclePreStopParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + commands: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.commands), + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function servicestageComponentInstanceConfigurationLifecyclePreStopParametersToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePreStopParametersOutputReference | ServicestageComponentInstanceConfigurationLifecyclePreStopParameters): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + commands: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.commands), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLifecyclePreStopParametersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLifecyclePreStopParameters | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._commands !== undefined) { + hasAnyValues = true; + internalValueResult.commands = this._commands; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLifecyclePreStopParameters | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._commands = undefined; + this._host = undefined; + this._path = undefined; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._commands = value.commands; + this._host = value.host; + this._path = value.path; + this._port = value.port; + } + } + + // commands - computed: true, optional: true, required: false + private _commands?: string[]; + public get commands() { + return this.getListAttribute('commands'); + } + public set commands(value: string[]) { + this._commands = value; + } + public resetCommands() { + this._commands = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandsInput() { + return this._commands; + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} +export interface ServicestageComponentInstanceConfigurationLifecyclePreStop { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; + /** + * parameters block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#parameters ServicestageComponentInstance#parameters} + */ + readonly parameters: ServicestageComponentInstanceConfigurationLifecyclePreStopParameters; +} + +export function servicestageComponentInstanceConfigurationLifecyclePreStopToTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePreStopOutputReference | ServicestageComponentInstanceConfigurationLifecyclePreStop): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + parameters: servicestageComponentInstanceConfigurationLifecyclePreStopParametersToTerraform(struct!.parameters), + } +} + + +export function servicestageComponentInstanceConfigurationLifecyclePreStopToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLifecyclePreStopOutputReference | ServicestageComponentInstanceConfigurationLifecyclePreStop): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: servicestageComponentInstanceConfigurationLifecyclePreStopParametersToHclTerraform(struct!.parameters), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationLifecyclePreStopParametersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLifecyclePreStopOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLifecyclePreStop | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._parameters?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLifecyclePreStop | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._type = undefined; + this._parameters.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._type = value.type; + this._parameters.internalValue = value.parameters; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // parameters - computed: false, optional: false, required: true + private _parameters = new ServicestageComponentInstanceConfigurationLifecyclePreStopParametersOutputReference(this, "parameters"); + public get parameters() { + return this._parameters; + } + public putParameters(value: ServicestageComponentInstanceConfigurationLifecyclePreStopParameters) { + this._parameters.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationLifecycle { + /** + * entrypoint block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#entrypoint ServicestageComponentInstance#entrypoint} + */ + readonly entrypoint?: ServicestageComponentInstanceConfigurationLifecycleEntrypoint; + /** + * post_start block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#post_start ServicestageComponentInstance#post_start} + */ + readonly postStart?: ServicestageComponentInstanceConfigurationLifecyclePostStart; + /** + * pre_stop block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#pre_stop ServicestageComponentInstance#pre_stop} + */ + readonly preStop?: ServicestageComponentInstanceConfigurationLifecyclePreStop; +} + +export function servicestageComponentInstanceConfigurationLifecycleToTerraform(struct?: ServicestageComponentInstanceConfigurationLifecycleOutputReference | ServicestageComponentInstanceConfigurationLifecycle): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + entrypoint: servicestageComponentInstanceConfigurationLifecycleEntrypointToTerraform(struct!.entrypoint), + post_start: servicestageComponentInstanceConfigurationLifecyclePostStartToTerraform(struct!.postStart), + pre_stop: servicestageComponentInstanceConfigurationLifecyclePreStopToTerraform(struct!.preStop), + } +} + + +export function servicestageComponentInstanceConfigurationLifecycleToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLifecycleOutputReference | ServicestageComponentInstanceConfigurationLifecycle): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + entrypoint: { + value: servicestageComponentInstanceConfigurationLifecycleEntrypointToHclTerraform(struct!.entrypoint), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationLifecycleEntrypointList", + }, + post_start: { + value: servicestageComponentInstanceConfigurationLifecyclePostStartToHclTerraform(struct!.postStart), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationLifecyclePostStartList", + }, + pre_stop: { + value: servicestageComponentInstanceConfigurationLifecyclePreStopToHclTerraform(struct!.preStop), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationLifecyclePreStopList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLifecycleOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLifecycle | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._entrypoint?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.entrypoint = this._entrypoint?.internalValue; + } + if (this._postStart?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.postStart = this._postStart?.internalValue; + } + if (this._preStop?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.preStop = this._preStop?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLifecycle | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._entrypoint.internalValue = undefined; + this._postStart.internalValue = undefined; + this._preStop.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._entrypoint.internalValue = value.entrypoint; + this._postStart.internalValue = value.postStart; + this._preStop.internalValue = value.preStop; + } + } + + // entrypoint - computed: false, optional: true, required: false + private _entrypoint = new ServicestageComponentInstanceConfigurationLifecycleEntrypointOutputReference(this, "entrypoint"); + public get entrypoint() { + return this._entrypoint; + } + public putEntrypoint(value: ServicestageComponentInstanceConfigurationLifecycleEntrypoint) { + this._entrypoint.internalValue = value; + } + public resetEntrypoint() { + this._entrypoint.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get entrypointInput() { + return this._entrypoint.internalValue; + } + + // post_start - computed: false, optional: true, required: false + private _postStart = new ServicestageComponentInstanceConfigurationLifecyclePostStartOutputReference(this, "post_start"); + public get postStart() { + return this._postStart; + } + public putPostStart(value: ServicestageComponentInstanceConfigurationLifecyclePostStart) { + this._postStart.internalValue = value; + } + public resetPostStart() { + this._postStart.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get postStartInput() { + return this._postStart.internalValue; + } + + // pre_stop - computed: false, optional: true, required: false + private _preStop = new ServicestageComponentInstanceConfigurationLifecyclePreStopOutputReference(this, "pre_stop"); + public get preStop() { + return this._preStop; + } + public putPreStop(value: ServicestageComponentInstanceConfigurationLifecyclePreStop) { + this._preStop.internalValue = value; + } + public resetPreStop() { + this._preStop.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get preStopInput() { + return this._preStop.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#aging_period ServicestageComponentInstance#aging_period} + */ + readonly agingPeriod?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#host_extend_path ServicestageComponentInstance#host_extend_path} + */ + readonly hostExtendPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path: string; +} + +export function servicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingToTerraform(struct?: ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aging_period: cdktf.stringToTerraform(struct!.agingPeriod), + host_extend_path: cdktf.stringToTerraform(struct!.hostExtendPath), + path: cdktf.stringToTerraform(struct!.path), + } +} + + +export function servicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aging_period: { + value: cdktf.stringToHclTerraform(struct!.agingPeriod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_extend_path: { + value: cdktf.stringToHclTerraform(struct!.hostExtendPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._agingPeriod !== undefined) { + hasAnyValues = true; + internalValueResult.agingPeriod = this._agingPeriod; + } + if (this._hostExtendPath !== undefined) { + hasAnyValues = true; + internalValueResult.hostExtendPath = this._hostExtendPath; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._agingPeriod = undefined; + this._hostExtendPath = undefined; + this._path = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._agingPeriod = value.agingPeriod; + this._hostExtendPath = value.hostExtendPath; + this._path = value.path; + } + } + + // aging_period - computed: false, optional: true, required: false + private _agingPeriod?: string; + public get agingPeriod() { + return this.getStringAttribute('aging_period'); + } + public set agingPeriod(value: string) { + this._agingPeriod = value; + } + public resetAgingPeriod() { + this._agingPeriod = undefined; + } + // Temporarily expose input value. Use with caution. + public get agingPeriodInput() { + return this._agingPeriod; + } + + // host_extend_path - computed: false, optional: true, required: false + private _hostExtendPath?: string; + public get hostExtendPath() { + return this.getStringAttribute('host_extend_path'); + } + public set hostExtendPath(value: string) { + this._hostExtendPath = value; + } + public resetHostExtendPath() { + this._hostExtendPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostExtendPathInput() { + return this._hostExtendPath; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } +} + +export class ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingOutputReference { + return new ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceConfigurationLogCollectionPolicy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#host_path ServicestageComponentInstance#host_path} + */ + readonly hostPath?: string; + /** + * container_mounting block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#container_mounting ServicestageComponentInstance#container_mounting} + */ + readonly containerMounting: ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting[] | cdktf.IResolvable; +} + +export function servicestageComponentInstanceConfigurationLogCollectionPolicyToTerraform(struct?: ServicestageComponentInstanceConfigurationLogCollectionPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host_path: cdktf.stringToTerraform(struct!.hostPath), + container_mounting: cdktf.listMapper(servicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingToTerraform, true)(struct!.containerMounting), + } +} + + +export function servicestageComponentInstanceConfigurationLogCollectionPolicyToHclTerraform(struct?: ServicestageComponentInstanceConfigurationLogCollectionPolicy | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host_path: { + value: cdktf.stringToHclTerraform(struct!.hostPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container_mounting: { + value: cdktf.listMapperHcl(servicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingToHclTerraform, true)(struct!.containerMounting), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationLogCollectionPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationLogCollectionPolicy | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._hostPath !== undefined) { + hasAnyValues = true; + internalValueResult.hostPath = this._hostPath; + } + if (this._containerMounting?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.containerMounting = this._containerMounting?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationLogCollectionPolicy | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._hostPath = undefined; + this._containerMounting.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._hostPath = value.hostPath; + this._containerMounting.internalValue = value.containerMounting; + } + } + + // host_path - computed: false, optional: true, required: false + private _hostPath?: string; + public get hostPath() { + return this.getStringAttribute('host_path'); + } + public set hostPath(value: string) { + this._hostPath = value; + } + public resetHostPath() { + this._hostPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostPathInput() { + return this._hostPath; + } + + // container_mounting - computed: false, optional: false, required: true + private _containerMounting = new ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMountingList(this, "container_mounting", true); + public get containerMounting() { + return this._containerMounting; + } + public putContainerMounting(value: ServicestageComponentInstanceConfigurationLogCollectionPolicyContainerMounting[] | cdktf.IResolvable) { + this._containerMounting.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get containerMountingInput() { + return this._containerMounting.internalValue; + } +} + +export class ServicestageComponentInstanceConfigurationLogCollectionPolicyList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceConfigurationLogCollectionPolicy[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceConfigurationLogCollectionPolicyOutputReference { + return new ServicestageComponentInstanceConfigurationLogCollectionPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceConfigurationProbeLivenessCommandParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#commands ServicestageComponentInstance#commands} + */ + readonly commands: string[]; +} + +export function servicestageComponentInstanceConfigurationProbeLivenessCommandParamToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessCommandParamOutputReference | ServicestageComponentInstanceConfigurationProbeLivenessCommandParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + commands: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.commands), + } +} + + +export function servicestageComponentInstanceConfigurationProbeLivenessCommandParamToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessCommandParamOutputReference | ServicestageComponentInstanceConfigurationProbeLivenessCommandParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + commands: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.commands), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeLivenessCommandParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeLivenessCommandParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._commands !== undefined) { + hasAnyValues = true; + internalValueResult.commands = this._commands; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeLivenessCommandParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._commands = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._commands = value.commands; + } + } + + // commands - computed: false, optional: false, required: true + private _commands?: string[]; + public get commands() { + return this.getListAttribute('commands'); + } + public set commands(value: string[]) { + this._commands = value; + } + // Temporarily expose input value. Use with caution. + public get commandsInput() { + return this._commands; + } +} +export interface ServicestageComponentInstanceConfigurationProbeLivenessHttpParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#host ServicestageComponentInstance#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#scheme ServicestageComponentInstance#scheme} + */ + readonly scheme: string; +} + +export function servicestageComponentInstanceConfigurationProbeLivenessHttpParamToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessHttpParamOutputReference | ServicestageComponentInstanceConfigurationProbeLivenessHttpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + scheme: cdktf.stringToTerraform(struct!.scheme), + } +} + + +export function servicestageComponentInstanceConfigurationProbeLivenessHttpParamToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessHttpParamOutputReference | ServicestageComponentInstanceConfigurationProbeLivenessHttpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheme: { + value: cdktf.stringToHclTerraform(struct!.scheme), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeLivenessHttpParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeLivenessHttpParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._scheme !== undefined) { + hasAnyValues = true; + internalValueResult.scheme = this._scheme; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeLivenessHttpParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._scheme = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._scheme = value.scheme; + } + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // scheme - computed: false, optional: false, required: true + private _scheme?: string; + public get scheme() { + return this.getStringAttribute('scheme'); + } + public set scheme(value: string) { + this._scheme = value; + } + // Temporarily expose input value. Use with caution. + public get schemeInput() { + return this._scheme; + } +} +export interface ServicestageComponentInstanceConfigurationProbeLivenessTcpParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port: number; +} + +export function servicestageComponentInstanceConfigurationProbeLivenessTcpParamToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessTcpParamOutputReference | ServicestageComponentInstanceConfigurationProbeLivenessTcpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function servicestageComponentInstanceConfigurationProbeLivenessTcpParamToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessTcpParamOutputReference | ServicestageComponentInstanceConfigurationProbeLivenessTcpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeLivenessTcpParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeLivenessTcpParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeLivenessTcpParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._port = value.port; + } + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} +export interface ServicestageComponentInstanceConfigurationProbeLiveness { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#delay ServicestageComponentInstance#delay} + */ + readonly delay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#timeout ServicestageComponentInstance#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; + /** + * command_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#command_param ServicestageComponentInstance#command_param} + */ + readonly commandParam?: ServicestageComponentInstanceConfigurationProbeLivenessCommandParam; + /** + * http_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#http_param ServicestageComponentInstance#http_param} + */ + readonly httpParam?: ServicestageComponentInstanceConfigurationProbeLivenessHttpParam; + /** + * tcp_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#tcp_param ServicestageComponentInstance#tcp_param} + */ + readonly tcpParam?: ServicestageComponentInstanceConfigurationProbeLivenessTcpParam; +} + +export function servicestageComponentInstanceConfigurationProbeLivenessToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessOutputReference | ServicestageComponentInstanceConfigurationProbeLiveness): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delay: cdktf.numberToTerraform(struct!.delay), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + command_param: servicestageComponentInstanceConfigurationProbeLivenessCommandParamToTerraform(struct!.commandParam), + http_param: servicestageComponentInstanceConfigurationProbeLivenessHttpParamToTerraform(struct!.httpParam), + tcp_param: servicestageComponentInstanceConfigurationProbeLivenessTcpParamToTerraform(struct!.tcpParam), + } +} + + +export function servicestageComponentInstanceConfigurationProbeLivenessToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeLivenessOutputReference | ServicestageComponentInstanceConfigurationProbeLiveness): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delay: { + value: cdktf.numberToHclTerraform(struct!.delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command_param: { + value: servicestageComponentInstanceConfigurationProbeLivenessCommandParamToHclTerraform(struct!.commandParam), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeLivenessCommandParamList", + }, + http_param: { + value: servicestageComponentInstanceConfigurationProbeLivenessHttpParamToHclTerraform(struct!.httpParam), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeLivenessHttpParamList", + }, + tcp_param: { + value: servicestageComponentInstanceConfigurationProbeLivenessTcpParamToHclTerraform(struct!.tcpParam), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeLivenessTcpParamList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeLivenessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeLiveness | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delay !== undefined) { + hasAnyValues = true; + internalValueResult.delay = this._delay; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._commandParam?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.commandParam = this._commandParam?.internalValue; + } + if (this._httpParam?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpParam = this._httpParam?.internalValue; + } + if (this._tcpParam?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.tcpParam = this._tcpParam?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeLiveness | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delay = undefined; + this._timeout = undefined; + this._type = undefined; + this._commandParam.internalValue = undefined; + this._httpParam.internalValue = undefined; + this._tcpParam.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delay = value.delay; + this._timeout = value.timeout; + this._type = value.type; + this._commandParam.internalValue = value.commandParam; + this._httpParam.internalValue = value.httpParam; + this._tcpParam.internalValue = value.tcpParam; + } + } + + // delay - computed: true, optional: true, required: false + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + public resetDelay() { + this._delay = undefined; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // command_param - computed: false, optional: true, required: false + private _commandParam = new ServicestageComponentInstanceConfigurationProbeLivenessCommandParamOutputReference(this, "command_param"); + public get commandParam() { + return this._commandParam; + } + public putCommandParam(value: ServicestageComponentInstanceConfigurationProbeLivenessCommandParam) { + this._commandParam.internalValue = value; + } + public resetCommandParam() { + this._commandParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandParamInput() { + return this._commandParam.internalValue; + } + + // http_param - computed: false, optional: true, required: false + private _httpParam = new ServicestageComponentInstanceConfigurationProbeLivenessHttpParamOutputReference(this, "http_param"); + public get httpParam() { + return this._httpParam; + } + public putHttpParam(value: ServicestageComponentInstanceConfigurationProbeLivenessHttpParam) { + this._httpParam.internalValue = value; + } + public resetHttpParam() { + this._httpParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpParamInput() { + return this._httpParam.internalValue; + } + + // tcp_param - computed: false, optional: true, required: false + private _tcpParam = new ServicestageComponentInstanceConfigurationProbeLivenessTcpParamOutputReference(this, "tcp_param"); + public get tcpParam() { + return this._tcpParam; + } + public putTcpParam(value: ServicestageComponentInstanceConfigurationProbeLivenessTcpParam) { + this._tcpParam.internalValue = value; + } + public resetTcpParam() { + this._tcpParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tcpParamInput() { + return this._tcpParam.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationProbeReadinessCommandParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#commands ServicestageComponentInstance#commands} + */ + readonly commands: string[]; +} + +export function servicestageComponentInstanceConfigurationProbeReadinessCommandParamToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessCommandParamOutputReference | ServicestageComponentInstanceConfigurationProbeReadinessCommandParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + commands: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.commands), + } +} + + +export function servicestageComponentInstanceConfigurationProbeReadinessCommandParamToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessCommandParamOutputReference | ServicestageComponentInstanceConfigurationProbeReadinessCommandParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + commands: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.commands), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeReadinessCommandParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeReadinessCommandParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._commands !== undefined) { + hasAnyValues = true; + internalValueResult.commands = this._commands; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeReadinessCommandParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._commands = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._commands = value.commands; + } + } + + // commands - computed: false, optional: false, required: true + private _commands?: string[]; + public get commands() { + return this.getListAttribute('commands'); + } + public set commands(value: string[]) { + this._commands = value; + } + // Temporarily expose input value. Use with caution. + public get commandsInput() { + return this._commands; + } +} +export interface ServicestageComponentInstanceConfigurationProbeReadinessHttpParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#host ServicestageComponentInstance#host} + */ + readonly host?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#scheme ServicestageComponentInstance#scheme} + */ + readonly scheme: string; +} + +export function servicestageComponentInstanceConfigurationProbeReadinessHttpParamToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessHttpParamOutputReference | ServicestageComponentInstanceConfigurationProbeReadinessHttpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + scheme: cdktf.stringToTerraform(struct!.scheme), + } +} + + +export function servicestageComponentInstanceConfigurationProbeReadinessHttpParamToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessHttpParamOutputReference | ServicestageComponentInstanceConfigurationProbeReadinessHttpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheme: { + value: cdktf.stringToHclTerraform(struct!.scheme), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeReadinessHttpParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeReadinessHttpParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._scheme !== undefined) { + hasAnyValues = true; + internalValueResult.scheme = this._scheme; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeReadinessHttpParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._scheme = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._scheme = value.scheme; + } + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // scheme - computed: false, optional: false, required: true + private _scheme?: string; + public get scheme() { + return this.getStringAttribute('scheme'); + } + public set scheme(value: string) { + this._scheme = value; + } + // Temporarily expose input value. Use with caution. + public get schemeInput() { + return this._scheme; + } +} +export interface ServicestageComponentInstanceConfigurationProbeReadinessTcpParam { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port: number; +} + +export function servicestageComponentInstanceConfigurationProbeReadinessTcpParamToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessTcpParamOutputReference | ServicestageComponentInstanceConfigurationProbeReadinessTcpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function servicestageComponentInstanceConfigurationProbeReadinessTcpParamToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessTcpParamOutputReference | ServicestageComponentInstanceConfigurationProbeReadinessTcpParam): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeReadinessTcpParamOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeReadinessTcpParam | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeReadinessTcpParam | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._port = value.port; + } + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} +export interface ServicestageComponentInstanceConfigurationProbeReadiness { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#delay ServicestageComponentInstance#delay} + */ + readonly delay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#timeout ServicestageComponentInstance#timeout} + */ + readonly timeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; + /** + * command_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#command_param ServicestageComponentInstance#command_param} + */ + readonly commandParam?: ServicestageComponentInstanceConfigurationProbeReadinessCommandParam; + /** + * http_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#http_param ServicestageComponentInstance#http_param} + */ + readonly httpParam?: ServicestageComponentInstanceConfigurationProbeReadinessHttpParam; + /** + * tcp_param block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#tcp_param ServicestageComponentInstance#tcp_param} + */ + readonly tcpParam?: ServicestageComponentInstanceConfigurationProbeReadinessTcpParam; +} + +export function servicestageComponentInstanceConfigurationProbeReadinessToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessOutputReference | ServicestageComponentInstanceConfigurationProbeReadiness): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + delay: cdktf.numberToTerraform(struct!.delay), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + command_param: servicestageComponentInstanceConfigurationProbeReadinessCommandParamToTerraform(struct!.commandParam), + http_param: servicestageComponentInstanceConfigurationProbeReadinessHttpParamToTerraform(struct!.httpParam), + tcp_param: servicestageComponentInstanceConfigurationProbeReadinessTcpParamToTerraform(struct!.tcpParam), + } +} + + +export function servicestageComponentInstanceConfigurationProbeReadinessToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeReadinessOutputReference | ServicestageComponentInstanceConfigurationProbeReadiness): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + delay: { + value: cdktf.numberToHclTerraform(struct!.delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command_param: { + value: servicestageComponentInstanceConfigurationProbeReadinessCommandParamToHclTerraform(struct!.commandParam), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeReadinessCommandParamList", + }, + http_param: { + value: servicestageComponentInstanceConfigurationProbeReadinessHttpParamToHclTerraform(struct!.httpParam), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeReadinessHttpParamList", + }, + tcp_param: { + value: servicestageComponentInstanceConfigurationProbeReadinessTcpParamToHclTerraform(struct!.tcpParam), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeReadinessTcpParamList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeReadinessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbeReadiness | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._delay !== undefined) { + hasAnyValues = true; + internalValueResult.delay = this._delay; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._commandParam?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.commandParam = this._commandParam?.internalValue; + } + if (this._httpParam?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.httpParam = this._httpParam?.internalValue; + } + if (this._tcpParam?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.tcpParam = this._tcpParam?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbeReadiness | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._delay = undefined; + this._timeout = undefined; + this._type = undefined; + this._commandParam.internalValue = undefined; + this._httpParam.internalValue = undefined; + this._tcpParam.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._delay = value.delay; + this._timeout = value.timeout; + this._type = value.type; + this._commandParam.internalValue = value.commandParam; + this._httpParam.internalValue = value.httpParam; + this._tcpParam.internalValue = value.tcpParam; + } + } + + // delay - computed: true, optional: true, required: false + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + public resetDelay() { + this._delay = undefined; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // command_param - computed: false, optional: true, required: false + private _commandParam = new ServicestageComponentInstanceConfigurationProbeReadinessCommandParamOutputReference(this, "command_param"); + public get commandParam() { + return this._commandParam; + } + public putCommandParam(value: ServicestageComponentInstanceConfigurationProbeReadinessCommandParam) { + this._commandParam.internalValue = value; + } + public resetCommandParam() { + this._commandParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandParamInput() { + return this._commandParam.internalValue; + } + + // http_param - computed: false, optional: true, required: false + private _httpParam = new ServicestageComponentInstanceConfigurationProbeReadinessHttpParamOutputReference(this, "http_param"); + public get httpParam() { + return this._httpParam; + } + public putHttpParam(value: ServicestageComponentInstanceConfigurationProbeReadinessHttpParam) { + this._httpParam.internalValue = value; + } + public resetHttpParam() { + this._httpParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get httpParamInput() { + return this._httpParam.internalValue; + } + + // tcp_param - computed: false, optional: true, required: false + private _tcpParam = new ServicestageComponentInstanceConfigurationProbeReadinessTcpParamOutputReference(this, "tcp_param"); + public get tcpParam() { + return this._tcpParam; + } + public putTcpParam(value: ServicestageComponentInstanceConfigurationProbeReadinessTcpParam) { + this._tcpParam.internalValue = value; + } + public resetTcpParam() { + this._tcpParam.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tcpParamInput() { + return this._tcpParam.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationProbe { + /** + * liveness block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#liveness ServicestageComponentInstance#liveness} + */ + readonly liveness?: ServicestageComponentInstanceConfigurationProbeLiveness; + /** + * readiness block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#readiness ServicestageComponentInstance#readiness} + */ + readonly readiness?: ServicestageComponentInstanceConfigurationProbeReadiness; +} + +export function servicestageComponentInstanceConfigurationProbeToTerraform(struct?: ServicestageComponentInstanceConfigurationProbeOutputReference | ServicestageComponentInstanceConfigurationProbe): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + liveness: servicestageComponentInstanceConfigurationProbeLivenessToTerraform(struct!.liveness), + readiness: servicestageComponentInstanceConfigurationProbeReadinessToTerraform(struct!.readiness), + } +} + + +export function servicestageComponentInstanceConfigurationProbeToHclTerraform(struct?: ServicestageComponentInstanceConfigurationProbeOutputReference | ServicestageComponentInstanceConfigurationProbe): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + liveness: { + value: servicestageComponentInstanceConfigurationProbeLivenessToHclTerraform(struct!.liveness), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeLivenessList", + }, + readiness: { + value: servicestageComponentInstanceConfigurationProbeReadinessToHclTerraform(struct!.readiness), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeReadinessList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationProbeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationProbe | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._liveness?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.liveness = this._liveness?.internalValue; + } + if (this._readiness?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.readiness = this._readiness?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationProbe | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._liveness.internalValue = undefined; + this._readiness.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._liveness.internalValue = value.liveness; + this._readiness.internalValue = value.readiness; + } + } + + // liveness - computed: false, optional: true, required: false + private _liveness = new ServicestageComponentInstanceConfigurationProbeLivenessOutputReference(this, "liveness"); + public get liveness() { + return this._liveness; + } + public putLiveness(value: ServicestageComponentInstanceConfigurationProbeLiveness) { + this._liveness.internalValue = value; + } + public resetLiveness() { + this._liveness.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get livenessInput() { + return this._liveness.internalValue; + } + + // readiness - computed: false, optional: true, required: false + private _readiness = new ServicestageComponentInstanceConfigurationProbeReadinessOutputReference(this, "readiness"); + public get readiness() { + return this._readiness; + } + public putReadiness(value: ServicestageComponentInstanceConfigurationProbeReadiness) { + this._readiness.internalValue = value; + } + public resetReadiness() { + this._readiness.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get readinessInput() { + return this._readiness.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationSchedulerAffinity { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#availability_zones ServicestageComponentInstance#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#instance_names ServicestageComponentInstance#instance_names} + */ + readonly instanceNames?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#private_ips ServicestageComponentInstance#private_ips} + */ + readonly privateIps?: string[]; +} + +export function servicestageComponentInstanceConfigurationSchedulerAffinityToTerraform(struct?: ServicestageComponentInstanceConfigurationSchedulerAffinityOutputReference | ServicestageComponentInstanceConfigurationSchedulerAffinity): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.availabilityZones), + instance_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.instanceNames), + private_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.privateIps), + } +} + + +export function servicestageComponentInstanceConfigurationSchedulerAffinityToHclTerraform(struct?: ServicestageComponentInstanceConfigurationSchedulerAffinityOutputReference | ServicestageComponentInstanceConfigurationSchedulerAffinity): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + instance_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.instanceNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + private_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.privateIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationSchedulerAffinityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationSchedulerAffinity | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZones !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZones = this._availabilityZones; + } + if (this._instanceNames !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNames = this._instanceNames; + } + if (this._privateIps !== undefined) { + hasAnyValues = true; + internalValueResult.privateIps = this._privateIps; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationSchedulerAffinity | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZones = undefined; + this._instanceNames = undefined; + this._privateIps = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZones = value.availabilityZones; + this._instanceNames = value.instanceNames; + this._privateIps = value.privateIps; + } + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // instance_names - computed: true, optional: true, required: false + private _instanceNames?: string[]; + public get instanceNames() { + return this.getListAttribute('instance_names'); + } + public set instanceNames(value: string[]) { + this._instanceNames = value; + } + public resetInstanceNames() { + this._instanceNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNamesInput() { + return this._instanceNames; + } + + // private_ips - computed: true, optional: true, required: false + private _privateIps?: string[]; + public get privateIps() { + return this.getListAttribute('private_ips'); + } + public set privateIps(value: string[]) { + this._privateIps = value; + } + public resetPrivateIps() { + this._privateIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpsInput() { + return this._privateIps; + } +} +export interface ServicestageComponentInstanceConfigurationSchedulerAntiAffinity { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#availability_zones ServicestageComponentInstance#availability_zones} + */ + readonly availabilityZones?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#instance_names ServicestageComponentInstance#instance_names} + */ + readonly instanceNames?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#private_ips ServicestageComponentInstance#private_ips} + */ + readonly privateIps?: string[]; +} + +export function servicestageComponentInstanceConfigurationSchedulerAntiAffinityToTerraform(struct?: ServicestageComponentInstanceConfigurationSchedulerAntiAffinityOutputReference | ServicestageComponentInstanceConfigurationSchedulerAntiAffinity): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.availabilityZones), + instance_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.instanceNames), + private_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.privateIps), + } +} + + +export function servicestageComponentInstanceConfigurationSchedulerAntiAffinityToHclTerraform(struct?: ServicestageComponentInstanceConfigurationSchedulerAntiAffinityOutputReference | ServicestageComponentInstanceConfigurationSchedulerAntiAffinity): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + instance_names: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.instanceNames), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + private_ips: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.privateIps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationSchedulerAntiAffinityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationSchedulerAntiAffinity | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._availabilityZones !== undefined) { + hasAnyValues = true; + internalValueResult.availabilityZones = this._availabilityZones; + } + if (this._instanceNames !== undefined) { + hasAnyValues = true; + internalValueResult.instanceNames = this._instanceNames; + } + if (this._privateIps !== undefined) { + hasAnyValues = true; + internalValueResult.privateIps = this._privateIps; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationSchedulerAntiAffinity | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._availabilityZones = undefined; + this._instanceNames = undefined; + this._privateIps = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._availabilityZones = value.availabilityZones; + this._instanceNames = value.instanceNames; + this._privateIps = value.privateIps; + } + } + + // availability_zones - computed: true, optional: true, required: false + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + public resetAvailabilityZones() { + this._availabilityZones = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // instance_names - computed: true, optional: true, required: false + private _instanceNames?: string[]; + public get instanceNames() { + return this.getListAttribute('instance_names'); + } + public set instanceNames(value: string[]) { + this._instanceNames = value; + } + public resetInstanceNames() { + this._instanceNames = undefined; + } + // Temporarily expose input value. Use with caution. + public get instanceNamesInput() { + return this._instanceNames; + } + + // private_ips - computed: true, optional: true, required: false + private _privateIps?: string[]; + public get privateIps() { + return this.getListAttribute('private_ips'); + } + public set privateIps(value: string[]) { + this._privateIps = value; + } + public resetPrivateIps() { + this._privateIps = undefined; + } + // Temporarily expose input value. Use with caution. + public get privateIpsInput() { + return this._privateIps; + } +} +export interface ServicestageComponentInstanceConfigurationScheduler { + /** + * affinity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#affinity ServicestageComponentInstance#affinity} + */ + readonly affinity?: ServicestageComponentInstanceConfigurationSchedulerAffinity; + /** + * anti_affinity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#anti_affinity ServicestageComponentInstance#anti_affinity} + */ + readonly antiAffinity?: ServicestageComponentInstanceConfigurationSchedulerAntiAffinity; +} + +export function servicestageComponentInstanceConfigurationSchedulerToTerraform(struct?: ServicestageComponentInstanceConfigurationSchedulerOutputReference | ServicestageComponentInstanceConfigurationScheduler): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + affinity: servicestageComponentInstanceConfigurationSchedulerAffinityToTerraform(struct!.affinity), + anti_affinity: servicestageComponentInstanceConfigurationSchedulerAntiAffinityToTerraform(struct!.antiAffinity), + } +} + + +export function servicestageComponentInstanceConfigurationSchedulerToHclTerraform(struct?: ServicestageComponentInstanceConfigurationSchedulerOutputReference | ServicestageComponentInstanceConfigurationScheduler): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + affinity: { + value: servicestageComponentInstanceConfigurationSchedulerAffinityToHclTerraform(struct!.affinity), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationSchedulerAffinityList", + }, + anti_affinity: { + value: servicestageComponentInstanceConfigurationSchedulerAntiAffinityToHclTerraform(struct!.antiAffinity), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationSchedulerAntiAffinityList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationSchedulerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationScheduler | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._affinity?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.affinity = this._affinity?.internalValue; + } + if (this._antiAffinity?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.antiAffinity = this._antiAffinity?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationScheduler | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._affinity.internalValue = undefined; + this._antiAffinity.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._affinity.internalValue = value.affinity; + this._antiAffinity.internalValue = value.antiAffinity; + } + } + + // affinity - computed: false, optional: true, required: false + private _affinity = new ServicestageComponentInstanceConfigurationSchedulerAffinityOutputReference(this, "affinity"); + public get affinity() { + return this._affinity; + } + public putAffinity(value: ServicestageComponentInstanceConfigurationSchedulerAffinity) { + this._affinity.internalValue = value; + } + public resetAffinity() { + this._affinity.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get affinityInput() { + return this._affinity.internalValue; + } + + // anti_affinity - computed: false, optional: true, required: false + private _antiAffinity = new ServicestageComponentInstanceConfigurationSchedulerAntiAffinityOutputReference(this, "anti_affinity"); + public get antiAffinity() { + return this._antiAffinity; + } + public putAntiAffinity(value: ServicestageComponentInstanceConfigurationSchedulerAntiAffinity) { + this._antiAffinity.internalValue = value; + } + public resetAntiAffinity() { + this._antiAffinity.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get antiAffinityInput() { + return this._antiAffinity.internalValue; + } +} +export interface ServicestageComponentInstanceConfigurationStorageMount { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#readonly ServicestageComponentInstance#readonly} + */ + readonly readonly: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#subpath ServicestageComponentInstance#subpath} + */ + readonly subpath?: string; +} + +export function servicestageComponentInstanceConfigurationStorageMountToTerraform(struct?: ServicestageComponentInstanceConfigurationStorageMount | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + path: cdktf.stringToTerraform(struct!.path), + readonly: cdktf.booleanToTerraform(struct!.readonly), + subpath: cdktf.stringToTerraform(struct!.subpath), + } +} + + +export function servicestageComponentInstanceConfigurationStorageMountToHclTerraform(struct?: ServicestageComponentInstanceConfigurationStorageMount | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + readonly: { + value: cdktf.booleanToHclTerraform(struct!.readonly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + subpath: { + value: cdktf.stringToHclTerraform(struct!.subpath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationStorageMountOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationStorageMount | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._readonly !== undefined) { + hasAnyValues = true; + internalValueResult.readonly = this._readonly; + } + if (this._subpath !== undefined) { + hasAnyValues = true; + internalValueResult.subpath = this._subpath; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationStorageMount | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._path = undefined; + this._readonly = undefined; + this._subpath = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._path = value.path; + this._readonly = value.readonly; + this._subpath = value.subpath; + } + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // readonly - computed: false, optional: false, required: true + private _readonly?: boolean | cdktf.IResolvable; + public get readonly() { + return this.getBooleanAttribute('readonly'); + } + public set readonly(value: boolean | cdktf.IResolvable) { + this._readonly = value; + } + // Temporarily expose input value. Use with caution. + public get readonlyInput() { + return this._readonly; + } + + // subpath - computed: true, optional: true, required: false + private _subpath?: string; + public get subpath() { + return this.getStringAttribute('subpath'); + } + public set subpath(value: string) { + this._subpath = value; + } + public resetSubpath() { + this._subpath = undefined; + } + // Temporarily expose input value. Use with caution. + public get subpathInput() { + return this._subpath; + } +} + +export class ServicestageComponentInstanceConfigurationStorageMountList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceConfigurationStorageMount[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceConfigurationStorageMountOutputReference { + return new ServicestageComponentInstanceConfigurationStorageMountOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceConfigurationStorageParameter { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#claim_name ServicestageComponentInstance#claim_name} + */ + readonly claimName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#name ServicestageComponentInstance#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#path ServicestageComponentInstance#path} + */ + readonly path?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#secret_name ServicestageComponentInstance#secret_name} + */ + readonly secretName?: string; +} + +export function servicestageComponentInstanceConfigurationStorageParameterToTerraform(struct?: ServicestageComponentInstanceConfigurationStorageParameterOutputReference | ServicestageComponentInstanceConfigurationStorageParameter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + claim_name: cdktf.stringToTerraform(struct!.claimName), + name: cdktf.stringToTerraform(struct!.name), + path: cdktf.stringToTerraform(struct!.path), + secret_name: cdktf.stringToTerraform(struct!.secretName), + } +} + + +export function servicestageComponentInstanceConfigurationStorageParameterToHclTerraform(struct?: ServicestageComponentInstanceConfigurationStorageParameterOutputReference | ServicestageComponentInstanceConfigurationStorageParameter): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + claim_name: { + value: cdktf.stringToHclTerraform(struct!.claimName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secret_name: { + value: cdktf.stringToHclTerraform(struct!.secretName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationStorageParameterOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationStorageParameter | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._claimName !== undefined) { + hasAnyValues = true; + internalValueResult.claimName = this._claimName; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._secretName !== undefined) { + hasAnyValues = true; + internalValueResult.secretName = this._secretName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationStorageParameter | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._claimName = undefined; + this._name = undefined; + this._path = undefined; + this._secretName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._claimName = value.claimName; + this._name = value.name; + this._path = value.path; + this._secretName = value.secretName; + } + } + + // claim_name - computed: true, optional: true, required: false + private _claimName?: string; + public get claimName() { + return this.getStringAttribute('claim_name'); + } + public set claimName(value: string) { + this._claimName = value; + } + public resetClaimName() { + this._claimName = undefined; + } + // Temporarily expose input value. Use with caution. + public get claimNameInput() { + return this._claimName; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // secret_name - computed: true, optional: true, required: false + private _secretName?: string; + public get secretName() { + return this.getStringAttribute('secret_name'); + } + public set secretName(value: string) { + this._secretName = value; + } + public resetSecretName() { + this._secretName = undefined; + } + // Temporarily expose input value. Use with caution. + public get secretNameInput() { + return this._secretName; + } +} +export interface ServicestageComponentInstanceConfigurationStorage { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; + /** + * mount block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#mount ServicestageComponentInstance#mount} + */ + readonly mount: ServicestageComponentInstanceConfigurationStorageMount[] | cdktf.IResolvable; + /** + * parameter block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#parameter ServicestageComponentInstance#parameter} + */ + readonly parameter: ServicestageComponentInstanceConfigurationStorageParameter; +} + +export function servicestageComponentInstanceConfigurationStorageToTerraform(struct?: ServicestageComponentInstanceConfigurationStorage | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + type: cdktf.stringToTerraform(struct!.type), + mount: cdktf.listMapper(servicestageComponentInstanceConfigurationStorageMountToTerraform, true)(struct!.mount), + parameter: servicestageComponentInstanceConfigurationStorageParameterToTerraform(struct!.parameter), + } +} + + +export function servicestageComponentInstanceConfigurationStorageToHclTerraform(struct?: ServicestageComponentInstanceConfigurationStorage | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mount: { + value: cdktf.listMapperHcl(servicestageComponentInstanceConfigurationStorageMountToHclTerraform, true)(struct!.mount), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceConfigurationStorageMountList", + }, + parameter: { + value: servicestageComponentInstanceConfigurationStorageParameterToHclTerraform(struct!.parameter), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationStorageParameterList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationStorageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationStorage | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._mount?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.mount = this._mount?.internalValue; + } + if (this._parameter?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.parameter = this._parameter?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationStorage | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._type = undefined; + this._mount.internalValue = undefined; + this._parameter.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._type = value.type; + this._mount.internalValue = value.mount; + this._parameter.internalValue = value.parameter; + } + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // mount - computed: false, optional: false, required: true + private _mount = new ServicestageComponentInstanceConfigurationStorageMountList(this, "mount", true); + public get mount() { + return this._mount; + } + public putMount(value: ServicestageComponentInstanceConfigurationStorageMount[] | cdktf.IResolvable) { + this._mount.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get mountInput() { + return this._mount.internalValue; + } + + // parameter - computed: false, optional: false, required: true + private _parameter = new ServicestageComponentInstanceConfigurationStorageParameterOutputReference(this, "parameter"); + public get parameter() { + return this._parameter; + } + public putParameter(value: ServicestageComponentInstanceConfigurationStorageParameter) { + this._parameter.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get parameterInput() { + return this._parameter.internalValue; + } +} + +export class ServicestageComponentInstanceConfigurationStorageList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceConfigurationStorage[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceConfigurationStorageOutputReference { + return new ServicestageComponentInstanceConfigurationStorageOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceConfigurationStrategy { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#upgrade ServicestageComponentInstance#upgrade} + */ + readonly upgrade?: string; +} + +export function servicestageComponentInstanceConfigurationStrategyToTerraform(struct?: ServicestageComponentInstanceConfigurationStrategyOutputReference | ServicestageComponentInstanceConfigurationStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + upgrade: cdktf.stringToTerraform(struct!.upgrade), + } +} + + +export function servicestageComponentInstanceConfigurationStrategyToHclTerraform(struct?: ServicestageComponentInstanceConfigurationStrategyOutputReference | ServicestageComponentInstanceConfigurationStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + upgrade: { + value: cdktf.stringToHclTerraform(struct!.upgrade), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfigurationStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._upgrade !== undefined) { + hasAnyValues = true; + internalValueResult.upgrade = this._upgrade; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfigurationStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._upgrade = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._upgrade = value.upgrade; + } + } + + // upgrade - computed: false, optional: true, required: false + private _upgrade?: string; + public get upgrade() { + return this.getStringAttribute('upgrade'); + } + public set upgrade(value: string) { + this._upgrade = value; + } + public resetUpgrade() { + this._upgrade = undefined; + } + // Temporarily expose input value. Use with caution. + public get upgradeInput() { + return this._upgrade; + } +} +export interface ServicestageComponentInstanceConfiguration { + /** + * env_variable block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#env_variable ServicestageComponentInstance#env_variable} + */ + readonly envVariable?: ServicestageComponentInstanceConfigurationEnvVariable[] | cdktf.IResolvable; + /** + * lifecycle block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#lifecycle ServicestageComponentInstance#lifecycle} + */ + readonly lifecycle?: ServicestageComponentInstanceConfigurationLifecycle; + /** + * log_collection_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#log_collection_policy ServicestageComponentInstance#log_collection_policy} + */ + readonly logCollectionPolicy?: ServicestageComponentInstanceConfigurationLogCollectionPolicy[] | cdktf.IResolvable; + /** + * probe block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#probe ServicestageComponentInstance#probe} + */ + readonly probe?: ServicestageComponentInstanceConfigurationProbe; + /** + * scheduler block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#scheduler ServicestageComponentInstance#scheduler} + */ + readonly scheduler?: ServicestageComponentInstanceConfigurationScheduler; + /** + * storage block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#storage ServicestageComponentInstance#storage} + */ + readonly storage?: ServicestageComponentInstanceConfigurationStorage[] | cdktf.IResolvable; + /** + * strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#strategy ServicestageComponentInstance#strategy} + */ + readonly strategy?: ServicestageComponentInstanceConfigurationStrategy; +} + +export function servicestageComponentInstanceConfigurationToTerraform(struct?: ServicestageComponentInstanceConfigurationOutputReference | ServicestageComponentInstanceConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + env_variable: cdktf.listMapper(servicestageComponentInstanceConfigurationEnvVariableToTerraform, true)(struct!.envVariable), + lifecycle: servicestageComponentInstanceConfigurationLifecycleToTerraform(struct!.lifecycle), + log_collection_policy: cdktf.listMapper(servicestageComponentInstanceConfigurationLogCollectionPolicyToTerraform, true)(struct!.logCollectionPolicy), + probe: servicestageComponentInstanceConfigurationProbeToTerraform(struct!.probe), + scheduler: servicestageComponentInstanceConfigurationSchedulerToTerraform(struct!.scheduler), + storage: cdktf.listMapper(servicestageComponentInstanceConfigurationStorageToTerraform, true)(struct!.storage), + strategy: servicestageComponentInstanceConfigurationStrategyToTerraform(struct!.strategy), + } +} + + +export function servicestageComponentInstanceConfigurationToHclTerraform(struct?: ServicestageComponentInstanceConfigurationOutputReference | ServicestageComponentInstanceConfiguration): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + env_variable: { + value: cdktf.listMapperHcl(servicestageComponentInstanceConfigurationEnvVariableToHclTerraform, true)(struct!.envVariable), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceConfigurationEnvVariableList", + }, + lifecycle: { + value: servicestageComponentInstanceConfigurationLifecycleToHclTerraform(struct!.lifecycle), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationLifecycleList", + }, + log_collection_policy: { + value: cdktf.listMapperHcl(servicestageComponentInstanceConfigurationLogCollectionPolicyToHclTerraform, true)(struct!.logCollectionPolicy), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceConfigurationLogCollectionPolicyList", + }, + probe: { + value: servicestageComponentInstanceConfigurationProbeToHclTerraform(struct!.probe), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationProbeList", + }, + scheduler: { + value: servicestageComponentInstanceConfigurationSchedulerToHclTerraform(struct!.scheduler), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationSchedulerList", + }, + storage: { + value: cdktf.listMapperHcl(servicestageComponentInstanceConfigurationStorageToHclTerraform, true)(struct!.storage), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceConfigurationStorageList", + }, + strategy: { + value: servicestageComponentInstanceConfigurationStrategyToHclTerraform(struct!.strategy), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationStrategyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceConfigurationOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentInstanceConfiguration | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._envVariable?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.envVariable = this._envVariable?.internalValue; + } + if (this._lifecycle?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.lifecycle = this._lifecycle?.internalValue; + } + if (this._logCollectionPolicy?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.logCollectionPolicy = this._logCollectionPolicy?.internalValue; + } + if (this._probe?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.probe = this._probe?.internalValue; + } + if (this._scheduler?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.scheduler = this._scheduler?.internalValue; + } + if (this._storage?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.storage = this._storage?.internalValue; + } + if (this._strategy?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.strategy = this._strategy?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceConfiguration | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._envVariable.internalValue = undefined; + this._lifecycle.internalValue = undefined; + this._logCollectionPolicy.internalValue = undefined; + this._probe.internalValue = undefined; + this._scheduler.internalValue = undefined; + this._storage.internalValue = undefined; + this._strategy.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._envVariable.internalValue = value.envVariable; + this._lifecycle.internalValue = value.lifecycle; + this._logCollectionPolicy.internalValue = value.logCollectionPolicy; + this._probe.internalValue = value.probe; + this._scheduler.internalValue = value.scheduler; + this._storage.internalValue = value.storage; + this._strategy.internalValue = value.strategy; + } + } + + // env_variable - computed: false, optional: true, required: false + private _envVariable = new ServicestageComponentInstanceConfigurationEnvVariableList(this, "env_variable", true); + public get envVariable() { + return this._envVariable; + } + public putEnvVariable(value: ServicestageComponentInstanceConfigurationEnvVariable[] | cdktf.IResolvable) { + this._envVariable.internalValue = value; + } + public resetEnvVariable() { + this._envVariable.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get envVariableInput() { + return this._envVariable.internalValue; + } + + // lifecycle - computed: false, optional: true, required: false + private _lifecycle = new ServicestageComponentInstanceConfigurationLifecycleOutputReference(this, "lifecycle"); + public get lifecycle() { + return this._lifecycle; + } + public putLifecycle(value: ServicestageComponentInstanceConfigurationLifecycle) { + this._lifecycle.internalValue = value; + } + public resetLifecycle() { + this._lifecycle.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifecycleInput() { + return this._lifecycle.internalValue; + } + + // log_collection_policy - computed: false, optional: true, required: false + private _logCollectionPolicy = new ServicestageComponentInstanceConfigurationLogCollectionPolicyList(this, "log_collection_policy", true); + public get logCollectionPolicy() { + return this._logCollectionPolicy; + } + public putLogCollectionPolicy(value: ServicestageComponentInstanceConfigurationLogCollectionPolicy[] | cdktf.IResolvable) { + this._logCollectionPolicy.internalValue = value; + } + public resetLogCollectionPolicy() { + this._logCollectionPolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logCollectionPolicyInput() { + return this._logCollectionPolicy.internalValue; + } + + // probe - computed: false, optional: true, required: false + private _probe = new ServicestageComponentInstanceConfigurationProbeOutputReference(this, "probe"); + public get probe() { + return this._probe; + } + public putProbe(value: ServicestageComponentInstanceConfigurationProbe) { + this._probe.internalValue = value; + } + public resetProbe() { + this._probe.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get probeInput() { + return this._probe.internalValue; + } + + // scheduler - computed: false, optional: true, required: false + private _scheduler = new ServicestageComponentInstanceConfigurationSchedulerOutputReference(this, "scheduler"); + public get scheduler() { + return this._scheduler; + } + public putScheduler(value: ServicestageComponentInstanceConfigurationScheduler) { + this._scheduler.internalValue = value; + } + public resetScheduler() { + this._scheduler.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerInput() { + return this._scheduler.internalValue; + } + + // storage - computed: false, optional: true, required: false + private _storage = new ServicestageComponentInstanceConfigurationStorageList(this, "storage", true); + public get storage() { + return this._storage; + } + public putStorage(value: ServicestageComponentInstanceConfigurationStorage[] | cdktf.IResolvable) { + this._storage.internalValue = value; + } + public resetStorage() { + this._storage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageInput() { + return this._storage.internalValue; + } + + // strategy - computed: false, optional: true, required: false + private _strategy = new ServicestageComponentInstanceConfigurationStrategyOutputReference(this, "strategy"); + public get strategy() { + return this._strategy; + } + public putStrategy(value: ServicestageComponentInstanceConfigurationStrategy) { + this._strategy.internalValue = value; + } + public resetStrategy() { + this._strategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get strategyInput() { + return this._strategy.internalValue; + } +} +export interface ServicestageComponentInstanceExternalAccess { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#address ServicestageComponentInstance#address} + */ + readonly address?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#port ServicestageComponentInstance#port} + */ + readonly port?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#protocol ServicestageComponentInstance#protocol} + */ + readonly protocol?: string; +} + +export function servicestageComponentInstanceExternalAccessToTerraform(struct?: ServicestageComponentInstanceExternalAccess | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + port: cdktf.numberToTerraform(struct!.port), + protocol: cdktf.stringToTerraform(struct!.protocol), + } +} + + +export function servicestageComponentInstanceExternalAccessToHclTerraform(struct?: ServicestageComponentInstanceExternalAccess | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceExternalAccessOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceExternalAccess | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceExternalAccess | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._port = undefined; + this._protocol = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._port = value.port; + this._protocol = value.protocol; + } + } + + // address - computed: true, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // protocol - computed: true, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } +} + +export class ServicestageComponentInstanceExternalAccessList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceExternalAccess[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceExternalAccessOutputReference { + return new ServicestageComponentInstanceExternalAccessOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceReferResource { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#alias ServicestageComponentInstance#alias} + */ + readonly alias?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#id ServicestageComponentInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#parameters ServicestageComponentInstance#parameters} + */ + readonly parameters?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#type ServicestageComponentInstance#type} + */ + readonly type: string; +} + +export function servicestageComponentInstanceReferResourceToTerraform(struct?: ServicestageComponentInstanceReferResource | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + alias: cdktf.stringToTerraform(struct!.alias), + id: cdktf.stringToTerraform(struct!.id), + parameters: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.parameters), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestageComponentInstanceReferResourceToHclTerraform(struct?: ServicestageComponentInstanceReferResource | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + alias: { + value: cdktf.stringToHclTerraform(struct!.alias), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.parameters), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceReferResourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageComponentInstanceReferResource | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._alias !== undefined) { + hasAnyValues = true; + internalValueResult.alias = this._alias; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._parameters !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceReferResource | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._alias = undefined; + this._id = undefined; + this._parameters = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._alias = value.alias; + this._id = value.id; + this._parameters = value.parameters; + this._type = value.type; + } + } + + // alias - computed: true, optional: true, required: false + private _alias?: string; + public get alias() { + return this.getStringAttribute('alias'); + } + public set alias(value: string) { + this._alias = value; + } + public resetAlias() { + this._alias = undefined; + } + // Temporarily expose input value. Use with caution. + public get aliasInput() { + return this._alias; + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // parameters - computed: true, optional: true, required: false + private _parameters?: { [key: string]: string }; + public get parameters() { + return this.getStringMapAttribute('parameters'); + } + public set parameters(value: { [key: string]: string }) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ServicestageComponentInstanceReferResourceList extends cdktf.ComplexList { + public internalValue? : ServicestageComponentInstanceReferResource[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageComponentInstanceReferResourceOutputReference { + return new ServicestageComponentInstanceReferResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageComponentInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#create ServicestageComponentInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#delete ServicestageComponentInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#update ServicestageComponentInstance#update} + */ + readonly update?: string; +} + +export function servicestageComponentInstanceTimeoutsToTerraform(struct?: ServicestageComponentInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function servicestageComponentInstanceTimeoutsToHclTerraform(struct?: ServicestageComponentInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): ServicestageComponentInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance huaweicloud_servicestage_component_instance} +*/ +export class ServicestageComponentInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_component_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ServicestageComponentInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ServicestageComponentInstance to import + * @param importFromId The id of the existing ServicestageComponentInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ServicestageComponentInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_component_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component_instance huaweicloud_servicestage_component_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ServicestageComponentInstanceConfig + */ + public constructor(scope: Construct, id: string, config: ServicestageComponentInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_component_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._componentId = config.componentId; + this._description = config.description; + this._environmentId = config.environmentId; + this._flavorId = config.flavorId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._replica = config.replica; + this._version = config.version; + this._artifact.internalValue = config.artifact; + this._configuration.internalValue = config.configuration; + this._externalAccess.internalValue = config.externalAccess; + this._referResource.internalValue = config.referResource; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // component_id - computed: false, optional: false, required: true + private _componentId?: string; + public get componentId() { + return this.getStringAttribute('component_id'); + } + public set componentId(value: string) { + this._componentId = value; + } + // Temporarily expose input value. Use with caution. + public get componentIdInput() { + return this._componentId; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replica - computed: false, optional: false, required: true + private _replica?: number; + public get replica() { + return this.getNumberAttribute('replica'); + } + public set replica(value: number) { + this._replica = value; + } + // Temporarily expose input value. Use with caution. + public get replicaInput() { + return this._replica; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // artifact - computed: false, optional: true, required: false + private _artifact = new ServicestageComponentInstanceArtifactList(this, "artifact", true); + public get artifact() { + return this._artifact; + } + public putArtifact(value: ServicestageComponentInstanceArtifact[] | cdktf.IResolvable) { + this._artifact.internalValue = value; + } + public resetArtifact() { + this._artifact.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get artifactInput() { + return this._artifact.internalValue; + } + + // configuration - computed: false, optional: true, required: false + private _configuration = new ServicestageComponentInstanceConfigurationOutputReference(this, "configuration"); + public get configuration() { + return this._configuration; + } + public putConfiguration(value: ServicestageComponentInstanceConfiguration) { + this._configuration.internalValue = value; + } + public resetConfiguration() { + this._configuration.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get configurationInput() { + return this._configuration.internalValue; + } + + // external_access - computed: false, optional: true, required: false + private _externalAccess = new ServicestageComponentInstanceExternalAccessList(this, "external_access", true); + public get externalAccess() { + return this._externalAccess; + } + public putExternalAccess(value: ServicestageComponentInstanceExternalAccess[] | cdktf.IResolvable) { + this._externalAccess.internalValue = value; + } + public resetExternalAccess() { + this._externalAccess.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalAccessInput() { + return this._externalAccess.internalValue; + } + + // refer_resource - computed: false, optional: false, required: true + private _referResource = new ServicestageComponentInstanceReferResourceList(this, "refer_resource", true); + public get referResource() { + return this._referResource; + } + public putReferResource(value: ServicestageComponentInstanceReferResource[] | cdktf.IResolvable) { + this._referResource.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get referResourceInput() { + return this._referResource.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new ServicestageComponentInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: ServicestageComponentInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + component_id: cdktf.stringToTerraform(this._componentId), + description: cdktf.stringToTerraform(this._description), + environment_id: cdktf.stringToTerraform(this._environmentId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + replica: cdktf.numberToTerraform(this._replica), + version: cdktf.stringToTerraform(this._version), + artifact: cdktf.listMapper(servicestageComponentInstanceArtifactToTerraform, true)(this._artifact.internalValue), + configuration: servicestageComponentInstanceConfigurationToTerraform(this._configuration.internalValue), + external_access: cdktf.listMapper(servicestageComponentInstanceExternalAccessToTerraform, true)(this._externalAccess.internalValue), + refer_resource: cdktf.listMapper(servicestageComponentInstanceReferResourceToTerraform, true)(this._referResource.internalValue), + timeouts: servicestageComponentInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + component_id: { + value: cdktf.stringToHclTerraform(this._componentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replica: { + value: cdktf.numberToHclTerraform(this._replica), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + artifact: { + value: cdktf.listMapperHcl(servicestageComponentInstanceArtifactToHclTerraform, true)(this._artifact.internalValue), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceArtifactList", + }, + configuration: { + value: servicestageComponentInstanceConfigurationToHclTerraform(this._configuration.internalValue), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentInstanceConfigurationList", + }, + external_access: { + value: cdktf.listMapperHcl(servicestageComponentInstanceExternalAccessToHclTerraform, true)(this._externalAccess.internalValue), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceExternalAccessList", + }, + refer_resource: { + value: cdktf.listMapperHcl(servicestageComponentInstanceReferResourceToHclTerraform, true)(this._referResource.internalValue), + isBlock: true, + type: "set", + storageClassType: "ServicestageComponentInstanceReferResourceList", + }, + timeouts: { + value: servicestageComponentInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "ServicestageComponentInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestage-component/README.md b/src/constructs/providers/huaweicloud/servicestage-component/README.md new file mode 100644 index 00000000..0e1ec664 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-component/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestage_component` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestage_component`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component). diff --git a/src/constructs/providers/huaweicloud/servicestage-component/index.ts b/src/constructs/providers/huaweicloud/servicestage-component/index.ts new file mode 100644 index 00000000..4b12d2cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-component/index.ts @@ -0,0 +1,1069 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ServicestageComponentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#application_id ServicestageComponent#application_id} + */ + readonly applicationId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#framework ServicestageComponent#framework} + */ + readonly framework?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#id ServicestageComponent#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#name ServicestageComponent#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#region ServicestageComponent#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#runtime ServicestageComponent#runtime} + */ + readonly runtime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#type ServicestageComponent#type} + */ + readonly type: string; + /** + * builder block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#builder ServicestageComponent#builder} + */ + readonly builder?: ServicestageComponentBuilder; + /** + * source block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#source ServicestageComponent#source} + */ + readonly source?: ServicestageComponentSource; +} +export interface ServicestageComponentBuilder { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#cluster_id ServicestageComponent#cluster_id} + */ + readonly clusterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#cluster_name ServicestageComponent#cluster_name} + */ + readonly clusterName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#cluster_type ServicestageComponent#cluster_type} + */ + readonly clusterType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#cmd ServicestageComponent#cmd} + */ + readonly cmd?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#dockerfile_path ServicestageComponent#dockerfile_path} + */ + readonly dockerfilePath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#node_label ServicestageComponent#node_label} + */ + readonly nodeLabel?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#organization ServicestageComponent#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#use_public_cluster ServicestageComponent#use_public_cluster} + */ + readonly usePublicCluster?: boolean | cdktf.IResolvable; +} + +export function servicestageComponentBuilderToTerraform(struct?: ServicestageComponentBuilderOutputReference | ServicestageComponentBuilder): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cluster_id: cdktf.stringToTerraform(struct!.clusterId), + cluster_name: cdktf.stringToTerraform(struct!.clusterName), + cluster_type: cdktf.stringToTerraform(struct!.clusterType), + cmd: cdktf.stringToTerraform(struct!.cmd), + dockerfile_path: cdktf.stringToTerraform(struct!.dockerfilePath), + node_label: cdktf.hashMapper(cdktf.stringToTerraform)(struct!.nodeLabel), + organization: cdktf.stringToTerraform(struct!.organization), + use_public_cluster: cdktf.booleanToTerraform(struct!.usePublicCluster), + } +} + + +export function servicestageComponentBuilderToHclTerraform(struct?: ServicestageComponentBuilderOutputReference | ServicestageComponentBuilder): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(struct!.clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(struct!.clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.stringToHclTerraform(struct!.clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cmd: { + value: cdktf.stringToHclTerraform(struct!.cmd), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dockerfile_path: { + value: cdktf.stringToHclTerraform(struct!.dockerfilePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + node_label: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct!.nodeLabel), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + organization: { + value: cdktf.stringToHclTerraform(struct!.organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + use_public_cluster: { + value: cdktf.booleanToHclTerraform(struct!.usePublicCluster), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentBuilderOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentBuilder | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clusterId !== undefined) { + hasAnyValues = true; + internalValueResult.clusterId = this._clusterId; + } + if (this._clusterName !== undefined) { + hasAnyValues = true; + internalValueResult.clusterName = this._clusterName; + } + if (this._clusterType !== undefined) { + hasAnyValues = true; + internalValueResult.clusterType = this._clusterType; + } + if (this._cmd !== undefined) { + hasAnyValues = true; + internalValueResult.cmd = this._cmd; + } + if (this._dockerfilePath !== undefined) { + hasAnyValues = true; + internalValueResult.dockerfilePath = this._dockerfilePath; + } + if (this._nodeLabel !== undefined) { + hasAnyValues = true; + internalValueResult.nodeLabel = this._nodeLabel; + } + if (this._organization !== undefined) { + hasAnyValues = true; + internalValueResult.organization = this._organization; + } + if (this._usePublicCluster !== undefined) { + hasAnyValues = true; + internalValueResult.usePublicCluster = this._usePublicCluster; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentBuilder | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._clusterId = undefined; + this._clusterName = undefined; + this._clusterType = undefined; + this._cmd = undefined; + this._dockerfilePath = undefined; + this._nodeLabel = undefined; + this._organization = undefined; + this._usePublicCluster = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._clusterId = value.clusterId; + this._clusterName = value.clusterName; + this._clusterType = value.clusterType; + this._cmd = value.cmd; + this._dockerfilePath = value.dockerfilePath; + this._nodeLabel = value.nodeLabel; + this._organization = value.organization; + this._usePublicCluster = value.usePublicCluster; + } + } + + // cluster_id - computed: false, optional: false, required: true + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: true, optional: true, required: false + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + public resetClusterName() { + this._clusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // cluster_type - computed: true, optional: true, required: false + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + public resetClusterType() { + this._clusterType = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // cmd - computed: true, optional: true, required: false + private _cmd?: string; + public get cmd() { + return this.getStringAttribute('cmd'); + } + public set cmd(value: string) { + this._cmd = value; + } + public resetCmd() { + this._cmd = undefined; + } + // Temporarily expose input value. Use with caution. + public get cmdInput() { + return this._cmd; + } + + // dockerfile_path - computed: true, optional: true, required: false + private _dockerfilePath?: string; + public get dockerfilePath() { + return this.getStringAttribute('dockerfile_path'); + } + public set dockerfilePath(value: string) { + this._dockerfilePath = value; + } + public resetDockerfilePath() { + this._dockerfilePath = undefined; + } + // Temporarily expose input value. Use with caution. + public get dockerfilePathInput() { + return this._dockerfilePath; + } + + // node_label - computed: false, optional: true, required: false + private _nodeLabel?: { [key: string]: string }; + public get nodeLabel() { + return this.getStringMapAttribute('node_label'); + } + public set nodeLabel(value: { [key: string]: string }) { + this._nodeLabel = value; + } + public resetNodeLabel() { + this._nodeLabel = undefined; + } + // Temporarily expose input value. Use with caution. + public get nodeLabelInput() { + return this._nodeLabel; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // use_public_cluster - computed: true, optional: true, required: false + private _usePublicCluster?: boolean | cdktf.IResolvable; + public get usePublicCluster() { + return this.getBooleanAttribute('use_public_cluster'); + } + public set usePublicCluster(value: boolean | cdktf.IResolvable) { + this._usePublicCluster = value; + } + public resetUsePublicCluster() { + this._usePublicCluster = undefined; + } + // Temporarily expose input value. Use with caution. + public get usePublicClusterInput() { + return this._usePublicCluster; + } +} +export interface ServicestageComponentSourceProperties { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#bucket ServicestageComponent#bucket} + */ + readonly bucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#endpoint ServicestageComponent#endpoint} + */ + readonly endpoint?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#key ServicestageComponent#key} + */ + readonly key?: string; +} + +export function servicestageComponentSourcePropertiesToTerraform(struct?: ServicestageComponentSourcePropertiesOutputReference | ServicestageComponentSourceProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket: cdktf.stringToTerraform(struct!.bucket), + endpoint: cdktf.stringToTerraform(struct!.endpoint), + key: cdktf.stringToTerraform(struct!.key), + } +} + + +export function servicestageComponentSourcePropertiesToHclTerraform(struct?: ServicestageComponentSourcePropertiesOutputReference | ServicestageComponentSourceProperties): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint: { + value: cdktf.stringToHclTerraform(struct!.endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentSourcePropertiesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentSourceProperties | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._endpoint !== undefined) { + hasAnyValues = true; + internalValueResult.endpoint = this._endpoint; + } + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentSourceProperties | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucket = undefined; + this._endpoint = undefined; + this._key = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucket = value.bucket; + this._endpoint = value.endpoint; + this._key = value.key; + } + } + + // bucket - computed: true, optional: true, required: false + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + public resetBucket() { + this._bucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // endpoint - computed: true, optional: true, required: false + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + public resetEndpoint() { + this._endpoint = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } + + // key - computed: true, optional: true, required: false + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + public resetKey() { + this._key = undefined; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } +} +export interface ServicestageComponentSource { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#authorization ServicestageComponent#authorization} + */ + readonly authorization?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#repo_namespace ServicestageComponent#repo_namespace} + */ + readonly repoNamespace?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#repo_ref ServicestageComponent#repo_ref} + */ + readonly repoRef?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#storage_type ServicestageComponent#storage_type} + */ + readonly storageType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#type ServicestageComponent#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#url ServicestageComponent#url} + */ + readonly url: string; + /** + * properties block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#properties ServicestageComponent#properties} + */ + readonly properties?: ServicestageComponentSourceProperties; +} + +export function servicestageComponentSourceToTerraform(struct?: ServicestageComponentSourceOutputReference | ServicestageComponentSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authorization: cdktf.stringToTerraform(struct!.authorization), + repo_namespace: cdktf.stringToTerraform(struct!.repoNamespace), + repo_ref: cdktf.stringToTerraform(struct!.repoRef), + storage_type: cdktf.stringToTerraform(struct!.storageType), + type: cdktf.stringToTerraform(struct!.type), + url: cdktf.stringToTerraform(struct!.url), + properties: servicestageComponentSourcePropertiesToTerraform(struct!.properties), + } +} + + +export function servicestageComponentSourceToHclTerraform(struct?: ServicestageComponentSourceOutputReference | ServicestageComponentSource): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authorization: { + value: cdktf.stringToHclTerraform(struct!.authorization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repo_namespace: { + value: cdktf.stringToHclTerraform(struct!.repoNamespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repo_ref: { + value: cdktf.stringToHclTerraform(struct!.repoRef), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_type: { + value: cdktf.stringToHclTerraform(struct!.storageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(struct!.url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + properties: { + value: servicestageComponentSourcePropertiesToHclTerraform(struct!.properties), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentSourcePropertiesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageComponentSourceOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): ServicestageComponentSource | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authorization !== undefined) { + hasAnyValues = true; + internalValueResult.authorization = this._authorization; + } + if (this._repoNamespace !== undefined) { + hasAnyValues = true; + internalValueResult.repoNamespace = this._repoNamespace; + } + if (this._repoRef !== undefined) { + hasAnyValues = true; + internalValueResult.repoRef = this._repoRef; + } + if (this._storageType !== undefined) { + hasAnyValues = true; + internalValueResult.storageType = this._storageType; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._url !== undefined) { + hasAnyValues = true; + internalValueResult.url = this._url; + } + if (this._properties?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.properties = this._properties?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageComponentSource | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authorization = undefined; + this._repoNamespace = undefined; + this._repoRef = undefined; + this._storageType = undefined; + this._type = undefined; + this._url = undefined; + this._properties.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authorization = value.authorization; + this._repoNamespace = value.repoNamespace; + this._repoRef = value.repoRef; + this._storageType = value.storageType; + this._type = value.type; + this._url = value.url; + this._properties.internalValue = value.properties; + } + } + + // authorization - computed: true, optional: true, required: false + private _authorization?: string; + public get authorization() { + return this.getStringAttribute('authorization'); + } + public set authorization(value: string) { + this._authorization = value; + } + public resetAuthorization() { + this._authorization = undefined; + } + // Temporarily expose input value. Use with caution. + public get authorizationInput() { + return this._authorization; + } + + // repo_namespace - computed: false, optional: true, required: false + private _repoNamespace?: string; + public get repoNamespace() { + return this.getStringAttribute('repo_namespace'); + } + public set repoNamespace(value: string) { + this._repoNamespace = value; + } + public resetRepoNamespace() { + this._repoNamespace = undefined; + } + // Temporarily expose input value. Use with caution. + public get repoNamespaceInput() { + return this._repoNamespace; + } + + // repo_ref - computed: false, optional: true, required: false + private _repoRef?: string; + public get repoRef() { + return this.getStringAttribute('repo_ref'); + } + public set repoRef(value: string) { + this._repoRef = value; + } + public resetRepoRef() { + this._repoRef = undefined; + } + // Temporarily expose input value. Use with caution. + public get repoRefInput() { + return this._repoRef; + } + + // storage_type - computed: true, optional: true, required: false + private _storageType?: string; + public get storageType() { + return this.getStringAttribute('storage_type'); + } + public set storageType(value: string) { + this._storageType = value; + } + public resetStorageType() { + this._storageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageTypeInput() { + return this._storageType; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // url - computed: false, optional: false, required: true + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // properties - computed: false, optional: true, required: false + private _properties = new ServicestageComponentSourcePropertiesOutputReference(this, "properties"); + public get properties() { + return this._properties; + } + public putProperties(value: ServicestageComponentSourceProperties) { + this._properties.internalValue = value; + } + public resetProperties() { + this._properties.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get propertiesInput() { + return this._properties.internalValue; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component huaweicloud_servicestage_component} +*/ +export class ServicestageComponent extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_component"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ServicestageComponent resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ServicestageComponent to import + * @param importFromId The id of the existing ServicestageComponent that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ServicestageComponent to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_component", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_component huaweicloud_servicestage_component} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ServicestageComponentConfig + */ + public constructor(scope: Construct, id: string, config: ServicestageComponentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_component', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._framework = config.framework; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._runtime = config.runtime; + this._type = config.type; + this._builder.internalValue = config.builder; + this._source.internalValue = config.source; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // framework - computed: false, optional: true, required: false + private _framework?: string; + public get framework() { + return this.getStringAttribute('framework'); + } + public set framework(value: string) { + this._framework = value; + } + public resetFramework() { + this._framework = undefined; + } + // Temporarily expose input value. Use with caution. + public get frameworkInput() { + return this._framework; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // runtime - computed: false, optional: false, required: true + private _runtime?: string; + public get runtime() { + return this.getStringAttribute('runtime'); + } + public set runtime(value: string) { + this._runtime = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeInput() { + return this._runtime; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // builder - computed: false, optional: true, required: false + private _builder = new ServicestageComponentBuilderOutputReference(this, "builder"); + public get builder() { + return this._builder; + } + public putBuilder(value: ServicestageComponentBuilder) { + this._builder.internalValue = value; + } + public resetBuilder() { + this._builder.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get builderInput() { + return this._builder.internalValue; + } + + // source - computed: false, optional: true, required: false + private _source = new ServicestageComponentSourceOutputReference(this, "source"); + public get source() { + return this._source; + } + public putSource(value: ServicestageComponentSource) { + this._source.internalValue = value; + } + public resetSource() { + this._source.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + framework: cdktf.stringToTerraform(this._framework), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + runtime: cdktf.stringToTerraform(this._runtime), + type: cdktf.stringToTerraform(this._type), + builder: servicestageComponentBuilderToTerraform(this._builder.internalValue), + source: servicestageComponentSourceToTerraform(this._source.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + framework: { + value: cdktf.stringToHclTerraform(this._framework), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + runtime: { + value: cdktf.stringToHclTerraform(this._runtime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + builder: { + value: servicestageComponentBuilderToHclTerraform(this._builder.internalValue), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentBuilderList", + }, + source: { + value: servicestageComponentSourceToHclTerraform(this._source.internalValue), + isBlock: true, + type: "list", + storageClassType: "ServicestageComponentSourceList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestage-environment/README.md b/src/constructs/providers/huaweicloud/servicestage-environment/README.md new file mode 100644 index 00000000..5a78f831 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-environment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestage_environment` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestage_environment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment). diff --git a/src/constructs/providers/huaweicloud/servicestage-environment/index.ts b/src/constructs/providers/huaweicloud/servicestage-environment/index.ts new file mode 100644 index 00000000..df58e234 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-environment/index.ts @@ -0,0 +1,599 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ServicestageEnvironmentConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#description ServicestageEnvironment#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#enterprise_project_id ServicestageEnvironment#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#id ServicestageEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#name ServicestageEnvironment#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#region ServicestageEnvironment#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#vpc_id ServicestageEnvironment#vpc_id} + */ + readonly vpcId: string; + /** + * basic_resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#basic_resources ServicestageEnvironment#basic_resources} + */ + readonly basicResources: ServicestageEnvironmentBasicResources[] | cdktf.IResolvable; + /** + * optional_resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#optional_resources ServicestageEnvironment#optional_resources} + */ + readonly optionalResources?: ServicestageEnvironmentOptionalResources[] | cdktf.IResolvable; +} +export interface ServicestageEnvironmentBasicResources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#id ServicestageEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#type ServicestageEnvironment#type} + */ + readonly type: string; +} + +export function servicestageEnvironmentBasicResourcesToTerraform(struct?: ServicestageEnvironmentBasicResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestageEnvironmentBasicResourcesToHclTerraform(struct?: ServicestageEnvironmentBasicResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageEnvironmentBasicResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageEnvironmentBasicResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageEnvironmentBasicResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ServicestageEnvironmentBasicResourcesList extends cdktf.ComplexList { + public internalValue? : ServicestageEnvironmentBasicResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageEnvironmentBasicResourcesOutputReference { + return new ServicestageEnvironmentBasicResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface ServicestageEnvironmentOptionalResources { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#id ServicestageEnvironment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#type ServicestageEnvironment#type} + */ + readonly type: string; +} + +export function servicestageEnvironmentOptionalResourcesToTerraform(struct?: ServicestageEnvironmentOptionalResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestageEnvironmentOptionalResourcesToHclTerraform(struct?: ServicestageEnvironmentOptionalResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class ServicestageEnvironmentOptionalResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): ServicestageEnvironmentOptionalResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: ServicestageEnvironmentOptionalResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class ServicestageEnvironmentOptionalResourcesList extends cdktf.ComplexList { + public internalValue? : ServicestageEnvironmentOptionalResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): ServicestageEnvironmentOptionalResourcesOutputReference { + return new ServicestageEnvironmentOptionalResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment huaweicloud_servicestage_environment} +*/ +export class ServicestageEnvironment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_environment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ServicestageEnvironment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ServicestageEnvironment to import + * @param importFromId The id of the existing ServicestageEnvironment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ServicestageEnvironment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_environment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_environment huaweicloud_servicestage_environment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ServicestageEnvironmentConfig + */ + public constructor(scope: Construct, id: string, config: ServicestageEnvironmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_environment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._vpcId = config.vpcId; + this._basicResources.internalValue = config.basicResources; + this._optionalResources.internalValue = config.optionalResources; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // basic_resources - computed: false, optional: false, required: true + private _basicResources = new ServicestageEnvironmentBasicResourcesList(this, "basic_resources", true); + public get basicResources() { + return this._basicResources; + } + public putBasicResources(value: ServicestageEnvironmentBasicResources[] | cdktf.IResolvable) { + this._basicResources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get basicResourcesInput() { + return this._basicResources.internalValue; + } + + // optional_resources - computed: false, optional: true, required: false + private _optionalResources = new ServicestageEnvironmentOptionalResourcesList(this, "optional_resources", true); + public get optionalResources() { + return this._optionalResources; + } + public putOptionalResources(value: ServicestageEnvironmentOptionalResources[] | cdktf.IResolvable) { + this._optionalResources.internalValue = value; + } + public resetOptionalResources() { + this._optionalResources.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get optionalResourcesInput() { + return this._optionalResources.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + basic_resources: cdktf.listMapper(servicestageEnvironmentBasicResourcesToTerraform, true)(this._basicResources.internalValue), + optional_resources: cdktf.listMapper(servicestageEnvironmentOptionalResourcesToTerraform, true)(this._optionalResources.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + basic_resources: { + value: cdktf.listMapperHcl(servicestageEnvironmentBasicResourcesToHclTerraform, true)(this._basicResources.internalValue), + isBlock: true, + type: "set", + storageClassType: "ServicestageEnvironmentBasicResourcesList", + }, + optional_resources: { + value: cdktf.listMapperHcl(servicestageEnvironmentOptionalResourcesToHclTerraform, true)(this._optionalResources.internalValue), + isBlock: true, + type: "set", + storageClassType: "ServicestageEnvironmentOptionalResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/README.md b/src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/README.md new file mode 100644 index 00000000..4c87929e --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestage_repo_password_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestage_repo_password_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization). diff --git a/src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/index.ts b/src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/index.ts new file mode 100644 index 00000000..e545f05d --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-repo-password-authorization/index.ts @@ -0,0 +1,244 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ServicestageRepoPasswordAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#id ServicestageRepoPasswordAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#name ServicestageRepoPasswordAuthorization#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#password ServicestageRepoPasswordAuthorization#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#region ServicestageRepoPasswordAuthorization#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#type ServicestageRepoPasswordAuthorization#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#user_name ServicestageRepoPasswordAuthorization#user_name} + */ + readonly userName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization huaweicloud_servicestage_repo_password_authorization} +*/ +export class ServicestageRepoPasswordAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_repo_password_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ServicestageRepoPasswordAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ServicestageRepoPasswordAuthorization to import + * @param importFromId The id of the existing ServicestageRepoPasswordAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ServicestageRepoPasswordAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_repo_password_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_password_authorization huaweicloud_servicestage_repo_password_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ServicestageRepoPasswordAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: ServicestageRepoPasswordAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_repo_password_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._type = config.type; + this._userName = config.userName; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + user_name: cdktf.stringToTerraform(this._userName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/README.md b/src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/README.md new file mode 100644 index 00000000..2bcbe9bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestage_repo_token_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestage_repo_token_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization). diff --git a/src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/index.ts b/src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/index.ts new file mode 100644 index 00000000..36dba29b --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestage-repo-token-authorization/index.ts @@ -0,0 +1,244 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface ServicestageRepoTokenAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#host ServicestageRepoTokenAuthorization#host} + */ + readonly host: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#id ServicestageRepoTokenAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#name ServicestageRepoTokenAuthorization#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#region ServicestageRepoTokenAuthorization#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#token ServicestageRepoTokenAuthorization#token} + */ + readonly token: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#type ServicestageRepoTokenAuthorization#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization huaweicloud_servicestage_repo_token_authorization} +*/ +export class ServicestageRepoTokenAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestage_repo_token_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a ServicestageRepoTokenAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the ServicestageRepoTokenAuthorization to import + * @param importFromId The id of the existing ServicestageRepoTokenAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the ServicestageRepoTokenAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestage_repo_token_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestage_repo_token_authorization huaweicloud_servicestage_repo_token_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options ServicestageRepoTokenAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: ServicestageRepoTokenAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestage_repo_token_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._host = config.host; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._token = config.token; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // host - computed: false, optional: false, required: true + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // token - computed: false, optional: false, required: true + private _token?: string; + public get token() { + return this.getStringAttribute('token'); + } + public set token(value: string) { + this._token = value; + } + // Temporarily expose input value. Use with caution. + public get tokenInput() { + return this._token; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + host: cdktf.stringToTerraform(this._host), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + token: cdktf.stringToTerraform(this._token), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + host: { + value: cdktf.stringToHclTerraform(this._host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + token: { + value: cdktf.stringToHclTerraform(this._token), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestagev3-application/README.md b/src/constructs/providers/huaweicloud/servicestagev3-application/README.md new file mode 100644 index 00000000..d8ff57bb --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-application/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestagev3_application` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestagev3_application`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application). diff --git a/src/constructs/providers/huaweicloud/servicestagev3-application/index.ts b/src/constructs/providers/huaweicloud/servicestagev3-application/index.ts new file mode 100644 index 00000000..763d9d33 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-application/index.ts @@ -0,0 +1,278 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface Servicestagev3ApplicationConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#description Servicestagev3Application#description} + */ + readonly description?: string; + /** + * The the enterprise project ID to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#enterprise_project_id Servicestagev3Application#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#id Servicestagev3Application#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#name Servicestagev3Application#name} + */ + readonly name: string; + /** + * The region where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#region Servicestagev3Application#region} + */ + readonly region?: string; + /** + * he key/value pairs to associate with the application that used to filter resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#tags Servicestagev3Application#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application huaweicloud_servicestagev3_application} +*/ +export class Servicestagev3Application extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_application"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a Servicestagev3Application resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the Servicestagev3Application to import + * @param importFromId The id of the existing Servicestagev3Application that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the Servicestagev3Application to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_application", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_application huaweicloud_servicestagev3_application} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options Servicestagev3ApplicationConfig + */ + public constructor(scope: Construct, id: string, config: Servicestagev3ApplicationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_application', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestagev3-component/README.md b/src/constructs/providers/huaweicloud/servicestagev3-component/README.md new file mode 100644 index 00000000..f30bc6e2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-component/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestagev3_component` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestagev3_component`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component). diff --git a/src/constructs/providers/huaweicloud/servicestagev3-component/index.ts b/src/constructs/providers/huaweicloud/servicestagev3-component/index.ts new file mode 100644 index 00000000..9c2265e4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-component/index.ts @@ -0,0 +1,4925 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface Servicestagev3ComponentConfig extends cdktf.TerraformMetaArguments { + /** + * The application ID to which the component belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#application_id Servicestagev3Component#application_id} + */ + readonly applicationId: string; + /** + * The build configuration of the component, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#build Servicestagev3Component#build} + */ + readonly buildAttribute?: string; + /** + * The start commands of the component, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#command Servicestagev3Component#command} + */ + readonly command?: string; + /** + * The description of the component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#description Servicestagev3Component#description} + */ + readonly description?: string; + /** + * The environment ID where the component is deployed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#environment_id Servicestagev3Component#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#id Servicestagev3Component#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The JVM parameters of the component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#jvm_opts Servicestagev3Component#jvm_opts} + */ + readonly jvmOpts?: string; + /** + * The maximum number of the CPU limit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#limit_cpu Servicestagev3Component#limit_cpu} + */ + readonly limitCpu?: number; + /** + * The maximum number of the memory limit. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#limit_memory Servicestagev3Component#limit_memory} + */ + readonly limitMemory?: number; + /** + * The name of the component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#name Servicestagev3Component#name} + */ + readonly name: string; + /** + * The region where the component is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#region Servicestagev3Component#region} + */ + readonly region?: string; + /** + * The replica number of the component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#replica Servicestagev3Component#replica} + */ + readonly replica: number; + /** + * The number of the CPU request resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#request_cpu Servicestagev3Component#request_cpu} + */ + readonly requestCpu?: number; + /** + * The number of the memory request resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#request_memory Servicestagev3Component#request_memory} + */ + readonly requestMemory?: number; + /** + * The source configuration of the component, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#source Servicestagev3Component#source} + */ + readonly source: string; + /** + * The key/value pairs to associate with the component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#tags Servicestagev3Component#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The time zone in which the component runs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#timezone Servicestagev3Component#timezone} + */ + readonly timezone?: string; + /** + * The configuration of the tomcat server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#tomcat_opts Servicestagev3Component#tomcat_opts} + */ + readonly tomcatOpts?: string; + /** + * The version of the component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#version Servicestagev3Component#version} + */ + readonly version: string; + /** + * affinity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#affinity Servicestagev3Component#affinity} + */ + readonly affinity?: Servicestagev3ComponentAffinity[] | cdktf.IResolvable; + /** + * anti_affinity block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#anti_affinity Servicestagev3Component#anti_affinity} + */ + readonly antiAffinity?: Servicestagev3ComponentAntiAffinity[] | cdktf.IResolvable; + /** + * custom_metric block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#custom_metric Servicestagev3Component#custom_metric} + */ + readonly customMetric?: Servicestagev3ComponentCustomMetric; + /** + * deploy_strategy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#deploy_strategy Servicestagev3Component#deploy_strategy} + */ + readonly deployStrategy?: Servicestagev3ComponentDeployStrategy; + /** + * envs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#envs Servicestagev3Component#envs} + */ + readonly envs?: Servicestagev3ComponentEnvs[] | cdktf.IResolvable; + /** + * external_accesses block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#external_accesses Servicestagev3Component#external_accesses} + */ + readonly externalAccesses?: Servicestagev3ComponentExternalAccesses[] | cdktf.IResolvable; + /** + * liveness_probe block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#liveness_probe Servicestagev3Component#liveness_probe} + */ + readonly livenessProbe?: Servicestagev3ComponentLivenessProbe; + /** + * logs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#logs Servicestagev3Component#logs} + */ + readonly logs?: Servicestagev3ComponentLogs[] | cdktf.IResolvable; + /** + * mesher block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#mesher Servicestagev3Component#mesher} + */ + readonly mesher?: Servicestagev3ComponentMesher; + /** + * post_start block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#post_start Servicestagev3Component#post_start} + */ + readonly postStart?: Servicestagev3ComponentPostStart; + /** + * pre_stop block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#pre_stop Servicestagev3Component#pre_stop} + */ + readonly preStop?: Servicestagev3ComponentPreStop; + /** + * readiness_probe block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#readiness_probe Servicestagev3Component#readiness_probe} + */ + readonly readinessProbe?: Servicestagev3ComponentReadinessProbe; + /** + * refer_resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#refer_resources Servicestagev3Component#refer_resources} + */ + readonly referResources: Servicestagev3ComponentReferResources[] | cdktf.IResolvable; + /** + * runtime_stack block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#runtime_stack Servicestagev3Component#runtime_stack} + */ + readonly runtimeStack: Servicestagev3ComponentRuntimeStack; + /** + * storages block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#storages Servicestagev3Component#storages} + */ + readonly storages?: Servicestagev3ComponentStorages[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#timeouts Servicestagev3Component#timeouts} + */ + readonly timeouts?: Servicestagev3ComponentTimeouts; +} +export interface Servicestagev3ComponentAffinityMatchExpressions { + /** + * The key of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#key Servicestagev3Component#key} + */ + readonly key: string; + /** + * The operation of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#operation Servicestagev3Component#operation} + */ + readonly operation: string; + /** + * The value of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#value Servicestagev3Component#value} + */ + readonly value?: string; +} + +export function servicestagev3ComponentAffinityMatchExpressionsToTerraform(struct?: Servicestagev3ComponentAffinityMatchExpressions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + operation: cdktf.stringToTerraform(struct!.operation), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function servicestagev3ComponentAffinityMatchExpressionsToHclTerraform(struct?: Servicestagev3ComponentAffinityMatchExpressions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation: { + value: cdktf.stringToHclTerraform(struct!.operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentAffinityMatchExpressionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentAffinityMatchExpressions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._operation !== undefined) { + hasAnyValues = true; + internalValueResult.operation = this._operation; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentAffinityMatchExpressions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._operation = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._operation = value.operation; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // operation - computed: false, optional: false, required: true + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class Servicestagev3ComponentAffinityMatchExpressionsList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentAffinityMatchExpressions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentAffinityMatchExpressionsOutputReference { + return new Servicestagev3ComponentAffinityMatchExpressionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentAffinity { + /** + * The condition type of the (anti) affinity rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#condition Servicestagev3Component#condition} + */ + readonly condition: string; + /** + * The kind of the (anti) affinity rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#kind Servicestagev3Component#kind} + */ + readonly kind: string; + /** + * The weight of the (anti) affinity rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#weight Servicestagev3Component#weight} + */ + readonly weight?: number; + /** + * match_expressions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#match_expressions Servicestagev3Component#match_expressions} + */ + readonly matchExpressions: Servicestagev3ComponentAffinityMatchExpressions[] | cdktf.IResolvable; +} + +export function servicestagev3ComponentAffinityToTerraform(struct?: Servicestagev3ComponentAffinity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + condition: cdktf.stringToTerraform(struct!.condition), + kind: cdktf.stringToTerraform(struct!.kind), + weight: cdktf.numberToTerraform(struct!.weight), + match_expressions: cdktf.listMapper(servicestagev3ComponentAffinityMatchExpressionsToTerraform, true)(struct!.matchExpressions), + } +} + + +export function servicestagev3ComponentAffinityToHclTerraform(struct?: Servicestagev3ComponentAffinity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + condition: { + value: cdktf.stringToHclTerraform(struct!.condition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kind: { + value: cdktf.stringToHclTerraform(struct!.kind), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + match_expressions: { + value: cdktf.listMapperHcl(servicestagev3ComponentAffinityMatchExpressionsToHclTerraform, true)(struct!.matchExpressions), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentAffinityMatchExpressionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentAffinityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentAffinity | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._condition !== undefined) { + hasAnyValues = true; + internalValueResult.condition = this._condition; + } + if (this._kind !== undefined) { + hasAnyValues = true; + internalValueResult.kind = this._kind; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + if (this._matchExpressions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.matchExpressions = this._matchExpressions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentAffinity | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._condition = undefined; + this._kind = undefined; + this._weight = undefined; + this._matchExpressions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._condition = value.condition; + this._kind = value.kind; + this._weight = value.weight; + this._matchExpressions.internalValue = value.matchExpressions; + } + } + + // condition - computed: false, optional: false, required: true + private _condition?: string; + public get condition() { + return this.getStringAttribute('condition'); + } + public set condition(value: string) { + this._condition = value; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // kind - computed: false, optional: false, required: true + private _kind?: string; + public get kind() { + return this.getStringAttribute('kind'); + } + public set kind(value: string) { + this._kind = value; + } + // Temporarily expose input value. Use with caution. + public get kindInput() { + return this._kind; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // match_expressions - computed: false, optional: false, required: true + private _matchExpressions = new Servicestagev3ComponentAffinityMatchExpressionsList(this, "match_expressions", true); + public get matchExpressions() { + return this._matchExpressions; + } + public putMatchExpressions(value: Servicestagev3ComponentAffinityMatchExpressions[] | cdktf.IResolvable) { + this._matchExpressions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get matchExpressionsInput() { + return this._matchExpressions.internalValue; + } +} + +export class Servicestagev3ComponentAffinityList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentAffinity[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentAffinityOutputReference { + return new Servicestagev3ComponentAffinityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentAntiAffinityMatchExpressions { + /** + * The key of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#key Servicestagev3Component#key} + */ + readonly key: string; + /** + * The operation of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#operation Servicestagev3Component#operation} + */ + readonly operation: string; + /** + * The value of the match rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#value Servicestagev3Component#value} + */ + readonly value?: string; +} + +export function servicestagev3ComponentAntiAffinityMatchExpressionsToTerraform(struct?: Servicestagev3ComponentAntiAffinityMatchExpressions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + operation: cdktf.stringToTerraform(struct!.operation), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function servicestagev3ComponentAntiAffinityMatchExpressionsToHclTerraform(struct?: Servicestagev3ComponentAntiAffinityMatchExpressions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + operation: { + value: cdktf.stringToHclTerraform(struct!.operation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentAntiAffinityMatchExpressionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentAntiAffinityMatchExpressions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._operation !== undefined) { + hasAnyValues = true; + internalValueResult.operation = this._operation; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentAntiAffinityMatchExpressions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._operation = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._operation = value.operation; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // operation - computed: false, optional: false, required: true + private _operation?: string; + public get operation() { + return this.getStringAttribute('operation'); + } + public set operation(value: string) { + this._operation = value; + } + // Temporarily expose input value. Use with caution. + public get operationInput() { + return this._operation; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class Servicestagev3ComponentAntiAffinityMatchExpressionsList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentAntiAffinityMatchExpressions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentAntiAffinityMatchExpressionsOutputReference { + return new Servicestagev3ComponentAntiAffinityMatchExpressionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentAntiAffinity { + /** + * The condition type of the (anti) affinity rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#condition Servicestagev3Component#condition} + */ + readonly condition: string; + /** + * The kind of the (anti) affinity rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#kind Servicestagev3Component#kind} + */ + readonly kind: string; + /** + * The weight of the (anti) affinity rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#weight Servicestagev3Component#weight} + */ + readonly weight?: number; + /** + * match_expressions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#match_expressions Servicestagev3Component#match_expressions} + */ + readonly matchExpressions: Servicestagev3ComponentAntiAffinityMatchExpressions[] | cdktf.IResolvable; +} + +export function servicestagev3ComponentAntiAffinityToTerraform(struct?: Servicestagev3ComponentAntiAffinity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + condition: cdktf.stringToTerraform(struct!.condition), + kind: cdktf.stringToTerraform(struct!.kind), + weight: cdktf.numberToTerraform(struct!.weight), + match_expressions: cdktf.listMapper(servicestagev3ComponentAntiAffinityMatchExpressionsToTerraform, true)(struct!.matchExpressions), + } +} + + +export function servicestagev3ComponentAntiAffinityToHclTerraform(struct?: Servicestagev3ComponentAntiAffinity | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + condition: { + value: cdktf.stringToHclTerraform(struct!.condition), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + kind: { + value: cdktf.stringToHclTerraform(struct!.kind), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + match_expressions: { + value: cdktf.listMapperHcl(servicestagev3ComponentAntiAffinityMatchExpressionsToHclTerraform, true)(struct!.matchExpressions), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentAntiAffinityMatchExpressionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentAntiAffinityOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentAntiAffinity | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._condition !== undefined) { + hasAnyValues = true; + internalValueResult.condition = this._condition; + } + if (this._kind !== undefined) { + hasAnyValues = true; + internalValueResult.kind = this._kind; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + if (this._matchExpressions?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.matchExpressions = this._matchExpressions?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentAntiAffinity | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._condition = undefined; + this._kind = undefined; + this._weight = undefined; + this._matchExpressions.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._condition = value.condition; + this._kind = value.kind; + this._weight = value.weight; + this._matchExpressions.internalValue = value.matchExpressions; + } + } + + // condition - computed: false, optional: false, required: true + private _condition?: string; + public get condition() { + return this.getStringAttribute('condition'); + } + public set condition(value: string) { + this._condition = value; + } + // Temporarily expose input value. Use with caution. + public get conditionInput() { + return this._condition; + } + + // kind - computed: false, optional: false, required: true + private _kind?: string; + public get kind() { + return this.getStringAttribute('kind'); + } + public set kind(value: string) { + this._kind = value; + } + // Temporarily expose input value. Use with caution. + public get kindInput() { + return this._kind; + } + + // weight - computed: true, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } + + // match_expressions - computed: false, optional: false, required: true + private _matchExpressions = new Servicestagev3ComponentAntiAffinityMatchExpressionsList(this, "match_expressions", true); + public get matchExpressions() { + return this._matchExpressions; + } + public putMatchExpressions(value: Servicestagev3ComponentAntiAffinityMatchExpressions[] | cdktf.IResolvable) { + this._matchExpressions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get matchExpressionsInput() { + return this._matchExpressions.internalValue; + } +} + +export class Servicestagev3ComponentAntiAffinityList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentAntiAffinity[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentAntiAffinityOutputReference { + return new Servicestagev3ComponentAntiAffinityOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentCustomMetric { + /** + * The monitoring dimension. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#dimensions Servicestagev3Component#dimensions} + */ + readonly dimensions: string; + /** + * The collection path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#path Servicestagev3Component#path} + */ + readonly path: string; + /** + * The collection port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#port Servicestagev3Component#port} + */ + readonly port: number; +} + +export function servicestagev3ComponentCustomMetricToTerraform(struct?: Servicestagev3ComponentCustomMetricOutputReference | Servicestagev3ComponentCustomMetric): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dimensions: cdktf.stringToTerraform(struct!.dimensions), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function servicestagev3ComponentCustomMetricToHclTerraform(struct?: Servicestagev3ComponentCustomMetricOutputReference | Servicestagev3ComponentCustomMetric): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dimensions: { + value: cdktf.stringToHclTerraform(struct!.dimensions), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentCustomMetricOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentCustomMetric | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dimensions !== undefined) { + hasAnyValues = true; + internalValueResult.dimensions = this._dimensions; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentCustomMetric | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dimensions = undefined; + this._path = undefined; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dimensions = value.dimensions; + this._path = value.path; + this._port = value.port; + } + } + + // dimensions - computed: false, optional: false, required: true + private _dimensions?: string; + public get dimensions() { + return this.getStringAttribute('dimensions'); + } + public set dimensions(value: string) { + this._dimensions = value; + } + // Temporarily expose input value. Use with caution. + public get dimensionsInput() { + return this._dimensions; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} +export interface Servicestagev3ComponentDeployStrategy { + /** + * The gray release parameters, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#gray_release Servicestagev3Component#gray_release} + */ + readonly grayRelease?: string; + /** + * The rolling release parameters, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#rolling_release Servicestagev3Component#rolling_release} + */ + readonly rollingRelease?: string; + /** + * The deploy type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; +} + +export function servicestagev3ComponentDeployStrategyToTerraform(struct?: Servicestagev3ComponentDeployStrategyOutputReference | Servicestagev3ComponentDeployStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + gray_release: cdktf.stringToTerraform(struct!.grayRelease), + rolling_release: cdktf.stringToTerraform(struct!.rollingRelease), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3ComponentDeployStrategyToHclTerraform(struct?: Servicestagev3ComponentDeployStrategyOutputReference | Servicestagev3ComponentDeployStrategy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + gray_release: { + value: cdktf.stringToHclTerraform(struct!.grayRelease), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rolling_release: { + value: cdktf.stringToHclTerraform(struct!.rollingRelease), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentDeployStrategyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentDeployStrategy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._grayRelease !== undefined) { + hasAnyValues = true; + internalValueResult.grayRelease = this._grayRelease; + } + if (this._rollingRelease !== undefined) { + hasAnyValues = true; + internalValueResult.rollingRelease = this._rollingRelease; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentDeployStrategy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._grayRelease = undefined; + this._rollingRelease = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._grayRelease = value.grayRelease; + this._rollingRelease = value.rollingRelease; + this._type = value.type; + } + } + + // gray_release - computed: true, optional: true, required: false + private _grayRelease?: string; + public get grayRelease() { + return this.getStringAttribute('gray_release'); + } + public set grayRelease(value: string) { + this._grayRelease = value; + } + public resetGrayRelease() { + this._grayRelease = undefined; + } + // Temporarily expose input value. Use with caution. + public get grayReleaseInput() { + return this._grayRelease; + } + + // rolling_release - computed: true, optional: true, required: false + private _rollingRelease?: string; + public get rollingRelease() { + return this.getStringAttribute('rolling_release'); + } + public set rollingRelease(value: string) { + this._rollingRelease = value; + } + public resetRollingRelease() { + this._rollingRelease = undefined; + } + // Temporarily expose input value. Use with caution. + public get rollingReleaseInput() { + return this._rollingRelease; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface Servicestagev3ComponentEnvs { + /** + * The name of the environment variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#name Servicestagev3Component#name} + */ + readonly name: string; + /** + * The value of the environment variable. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#value Servicestagev3Component#value} + */ + readonly value?: string; +} + +export function servicestagev3ComponentEnvsToTerraform(struct?: Servicestagev3ComponentEnvs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function servicestagev3ComponentEnvsToHclTerraform(struct?: Servicestagev3ComponentEnvs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentEnvsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentEnvs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentEnvs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._value = value.value; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class Servicestagev3ComponentEnvsList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentEnvs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentEnvsOutputReference { + return new Servicestagev3ComponentEnvsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentExternalAccesses { + /** + * The address of the external access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#address Servicestagev3Component#address} + */ + readonly address?: string; + /** + * The forward port of the external access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#forward_port Servicestagev3Component#forward_port} + */ + readonly forwardPort?: number; + /** + * The protocol of the external access. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#protocol Servicestagev3Component#protocol} + */ + readonly protocol: string; +} + +export function servicestagev3ComponentExternalAccessesToTerraform(struct?: Servicestagev3ComponentExternalAccesses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + forward_port: cdktf.numberToTerraform(struct!.forwardPort), + protocol: cdktf.stringToTerraform(struct!.protocol), + } +} + + +export function servicestagev3ComponentExternalAccessesToHclTerraform(struct?: Servicestagev3ComponentExternalAccesses | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + forward_port: { + value: cdktf.numberToHclTerraform(struct!.forwardPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentExternalAccessesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentExternalAccesses | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._forwardPort !== undefined) { + hasAnyValues = true; + internalValueResult.forwardPort = this._forwardPort; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentExternalAccesses | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._forwardPort = undefined; + this._protocol = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._forwardPort = value.forwardPort; + this._protocol = value.protocol; + } + } + + // address - computed: false, optional: true, required: false + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + public resetAddress() { + this._address = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // forward_port - computed: false, optional: true, required: false + private _forwardPort?: number; + public get forwardPort() { + return this.getNumberAttribute('forward_port'); + } + public set forwardPort(value: number) { + this._forwardPort = value; + } + public resetForwardPort() { + this._forwardPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardPortInput() { + return this._forwardPort; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } +} + +export class Servicestagev3ComponentExternalAccessesList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentExternalAccesses[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentExternalAccessesOutputReference { + return new Servicestagev3ComponentExternalAccessesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentLivenessProbe { + /** + * The command list of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#command Servicestagev3Component#command} + */ + readonly command?: string[]; + /** + * The delay time of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#delay Servicestagev3Component#delay} + */ + readonly delay: number; + /** + * The host of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#host Servicestagev3Component#host} + */ + readonly host?: string; + /** + * The path of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#path Servicestagev3Component#path} + */ + readonly path?: string; + /** + * The port of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#port Servicestagev3Component#port} + */ + readonly port?: number; + /** + * The scheme type of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#scheme Servicestagev3Component#scheme} + */ + readonly scheme?: string; + /** + * The timeout of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#timeout Servicestagev3Component#timeout} + */ + readonly timeout: number; + /** + * The type of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; +} + +export function servicestagev3ComponentLivenessProbeToTerraform(struct?: Servicestagev3ComponentLivenessProbeOutputReference | Servicestagev3ComponentLivenessProbe): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + command: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.command), + delay: cdktf.numberToTerraform(struct!.delay), + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + scheme: cdktf.stringToTerraform(struct!.scheme), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3ComponentLivenessProbeToHclTerraform(struct?: Servicestagev3ComponentLivenessProbeOutputReference | Servicestagev3ComponentLivenessProbe): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + command: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.command), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + delay: { + value: cdktf.numberToHclTerraform(struct!.delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheme: { + value: cdktf.stringToHclTerraform(struct!.scheme), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentLivenessProbeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentLivenessProbe | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._command !== undefined) { + hasAnyValues = true; + internalValueResult.command = this._command; + } + if (this._delay !== undefined) { + hasAnyValues = true; + internalValueResult.delay = this._delay; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._scheme !== undefined) { + hasAnyValues = true; + internalValueResult.scheme = this._scheme; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentLivenessProbe | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._command = undefined; + this._delay = undefined; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._scheme = undefined; + this._timeout = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._command = value.command; + this._delay = value.delay; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._scheme = value.scheme; + this._timeout = value.timeout; + this._type = value.type; + } + } + + // command - computed: true, optional: true, required: false + private _command?: string[]; + public get command() { + return cdktf.Fn.tolist(this.getListAttribute('command')); + } + public set command(value: string[]) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // delay - computed: false, optional: false, required: true + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // scheme - computed: true, optional: true, required: false + private _scheme?: string; + public get scheme() { + return this.getStringAttribute('scheme'); + } + public set scheme(value: string) { + this._scheme = value; + } + public resetScheme() { + this._scheme = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemeInput() { + return this._scheme; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface Servicestagev3ComponentLogs { + /** + * The extension path of the host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#host_extend_path Servicestagev3Component#host_extend_path} + */ + readonly hostExtendPath: string; + /** + * The mounted host path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#host_path Servicestagev3Component#host_path} + */ + readonly hostPath: string; + /** + * The log path of the container. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#log_path Servicestagev3Component#log_path} + */ + readonly logPath: string; + /** + * The interval for dumping logs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#rotate Servicestagev3Component#rotate} + */ + readonly rotate: string; +} + +export function servicestagev3ComponentLogsToTerraform(struct?: Servicestagev3ComponentLogs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + host_extend_path: cdktf.stringToTerraform(struct!.hostExtendPath), + host_path: cdktf.stringToTerraform(struct!.hostPath), + log_path: cdktf.stringToTerraform(struct!.logPath), + rotate: cdktf.stringToTerraform(struct!.rotate), + } +} + + +export function servicestagev3ComponentLogsToHclTerraform(struct?: Servicestagev3ComponentLogs | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + host_extend_path: { + value: cdktf.stringToHclTerraform(struct!.hostExtendPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + host_path: { + value: cdktf.stringToHclTerraform(struct!.hostPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_path: { + value: cdktf.stringToHclTerraform(struct!.logPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rotate: { + value: cdktf.stringToHclTerraform(struct!.rotate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentLogsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentLogs | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._hostExtendPath !== undefined) { + hasAnyValues = true; + internalValueResult.hostExtendPath = this._hostExtendPath; + } + if (this._hostPath !== undefined) { + hasAnyValues = true; + internalValueResult.hostPath = this._hostPath; + } + if (this._logPath !== undefined) { + hasAnyValues = true; + internalValueResult.logPath = this._logPath; + } + if (this._rotate !== undefined) { + hasAnyValues = true; + internalValueResult.rotate = this._rotate; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentLogs | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._hostExtendPath = undefined; + this._hostPath = undefined; + this._logPath = undefined; + this._rotate = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._hostExtendPath = value.hostExtendPath; + this._hostPath = value.hostPath; + this._logPath = value.logPath; + this._rotate = value.rotate; + } + } + + // host_extend_path - computed: false, optional: false, required: true + private _hostExtendPath?: string; + public get hostExtendPath() { + return this.getStringAttribute('host_extend_path'); + } + public set hostExtendPath(value: string) { + this._hostExtendPath = value; + } + // Temporarily expose input value. Use with caution. + public get hostExtendPathInput() { + return this._hostExtendPath; + } + + // host_path - computed: false, optional: false, required: true + private _hostPath?: string; + public get hostPath() { + return this.getStringAttribute('host_path'); + } + public set hostPath(value: string) { + this._hostPath = value; + } + // Temporarily expose input value. Use with caution. + public get hostPathInput() { + return this._hostPath; + } + + // log_path - computed: false, optional: false, required: true + private _logPath?: string; + public get logPath() { + return this.getStringAttribute('log_path'); + } + public set logPath(value: string) { + this._logPath = value; + } + // Temporarily expose input value. Use with caution. + public get logPathInput() { + return this._logPath; + } + + // rotate - computed: false, optional: false, required: true + private _rotate?: string; + public get rotate() { + return this.getStringAttribute('rotate'); + } + public set rotate(value: string) { + this._rotate = value; + } + // Temporarily expose input value. Use with caution. + public get rotateInput() { + return this._rotate; + } +} + +export class Servicestagev3ComponentLogsList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentLogs[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentLogsOutputReference { + return new Servicestagev3ComponentLogsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentMesher { + /** + * The process listening port. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#port Servicestagev3Component#port} + */ + readonly port: number; +} + +export function servicestagev3ComponentMesherToTerraform(struct?: Servicestagev3ComponentMesherOutputReference | Servicestagev3ComponentMesher): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + port: cdktf.numberToTerraform(struct!.port), + } +} + + +export function servicestagev3ComponentMesherToHclTerraform(struct?: Servicestagev3ComponentMesherOutputReference | Servicestagev3ComponentMesher): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentMesherOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentMesher | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentMesher | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._port = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._port = value.port; + } + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } +} +export interface Servicestagev3ComponentPostStart { + /** + * The command list of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#command Servicestagev3Component#command} + */ + readonly command?: string[]; + /** + * The host (IP) of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#host Servicestagev3Component#host} + */ + readonly host?: string; + /** + * The request path of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#path Servicestagev3Component#path} + */ + readonly path?: string; + /** + * The port number of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#port Servicestagev3Component#port} + */ + readonly port?: number; + /** + * The HTTP request type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#scheme Servicestagev3Component#scheme} + */ + readonly scheme?: string; + /** + * The processing method. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; +} + +export function servicestagev3ComponentPostStartToTerraform(struct?: Servicestagev3ComponentPostStartOutputReference | Servicestagev3ComponentPostStart): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + command: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.command), + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + scheme: cdktf.stringToTerraform(struct!.scheme), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3ComponentPostStartToHclTerraform(struct?: Servicestagev3ComponentPostStartOutputReference | Servicestagev3ComponentPostStart): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + command: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.command), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheme: { + value: cdktf.stringToHclTerraform(struct!.scheme), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentPostStartOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentPostStart | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._command !== undefined) { + hasAnyValues = true; + internalValueResult.command = this._command; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._scheme !== undefined) { + hasAnyValues = true; + internalValueResult.scheme = this._scheme; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentPostStart | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._command = undefined; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._scheme = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._command = value.command; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._scheme = value.scheme; + this._type = value.type; + } + } + + // command - computed: false, optional: true, required: false + private _command?: string[]; + public get command() { + return cdktf.Fn.tolist(this.getListAttribute('command')); + } + public set command(value: string[]) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // host - computed: false, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // scheme - computed: false, optional: true, required: false + private _scheme?: string; + public get scheme() { + return this.getStringAttribute('scheme'); + } + public set scheme(value: string) { + this._scheme = value; + } + public resetScheme() { + this._scheme = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemeInput() { + return this._scheme; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface Servicestagev3ComponentPreStop { + /** + * The command list of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#command Servicestagev3Component#command} + */ + readonly command?: string[]; + /** + * The host (IP) of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#host Servicestagev3Component#host} + */ + readonly host?: string; + /** + * The request path of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#path Servicestagev3Component#path} + */ + readonly path?: string; + /** + * The port number of the lifecycle configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#port Servicestagev3Component#port} + */ + readonly port?: number; + /** + * The HTTP request type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#scheme Servicestagev3Component#scheme} + */ + readonly scheme?: string; + /** + * The processing method. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; +} + +export function servicestagev3ComponentPreStopToTerraform(struct?: Servicestagev3ComponentPreStopOutputReference | Servicestagev3ComponentPreStop): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + command: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.command), + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + scheme: cdktf.stringToTerraform(struct!.scheme), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3ComponentPreStopToHclTerraform(struct?: Servicestagev3ComponentPreStopOutputReference | Servicestagev3ComponentPreStop): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + command: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.command), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheme: { + value: cdktf.stringToHclTerraform(struct!.scheme), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentPreStopOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentPreStop | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._command !== undefined) { + hasAnyValues = true; + internalValueResult.command = this._command; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._scheme !== undefined) { + hasAnyValues = true; + internalValueResult.scheme = this._scheme; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentPreStop | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._command = undefined; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._scheme = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._command = value.command; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._scheme = value.scheme; + this._type = value.type; + } + } + + // command - computed: false, optional: true, required: false + private _command?: string[]; + public get command() { + return cdktf.Fn.tolist(this.getListAttribute('command')); + } + public set command(value: string[]) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // host - computed: false, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: false, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: false, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // scheme - computed: false, optional: true, required: false + private _scheme?: string; + public get scheme() { + return this.getStringAttribute('scheme'); + } + public set scheme(value: string) { + this._scheme = value; + } + public resetScheme() { + this._scheme = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemeInput() { + return this._scheme; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface Servicestagev3ComponentReadinessProbe { + /** + * The command list of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#command Servicestagev3Component#command} + */ + readonly command?: string[]; + /** + * The delay time of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#delay Servicestagev3Component#delay} + */ + readonly delay: number; + /** + * The host of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#host Servicestagev3Component#host} + */ + readonly host?: string; + /** + * The path of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#path Servicestagev3Component#path} + */ + readonly path?: string; + /** + * The port of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#port Servicestagev3Component#port} + */ + readonly port?: number; + /** + * The scheme type of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#scheme Servicestagev3Component#scheme} + */ + readonly scheme?: string; + /** + * The timeout of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#timeout Servicestagev3Component#timeout} + */ + readonly timeout: number; + /** + * The type of the probe. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; +} + +export function servicestagev3ComponentReadinessProbeToTerraform(struct?: Servicestagev3ComponentReadinessProbeOutputReference | Servicestagev3ComponentReadinessProbe): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + command: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.command), + delay: cdktf.numberToTerraform(struct!.delay), + host: cdktf.stringToTerraform(struct!.host), + path: cdktf.stringToTerraform(struct!.path), + port: cdktf.numberToTerraform(struct!.port), + scheme: cdktf.stringToTerraform(struct!.scheme), + timeout: cdktf.numberToTerraform(struct!.timeout), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3ComponentReadinessProbeToHclTerraform(struct?: Servicestagev3ComponentReadinessProbeOutputReference | Servicestagev3ComponentReadinessProbe): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + command: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.command), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + delay: { + value: cdktf.numberToHclTerraform(struct!.delay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + host: { + value: cdktf.stringToHclTerraform(struct!.host), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + scheme: { + value: cdktf.stringToHclTerraform(struct!.scheme), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentReadinessProbeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentReadinessProbe | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._command !== undefined) { + hasAnyValues = true; + internalValueResult.command = this._command; + } + if (this._delay !== undefined) { + hasAnyValues = true; + internalValueResult.delay = this._delay; + } + if (this._host !== undefined) { + hasAnyValues = true; + internalValueResult.host = this._host; + } + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._scheme !== undefined) { + hasAnyValues = true; + internalValueResult.scheme = this._scheme; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentReadinessProbe | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._command = undefined; + this._delay = undefined; + this._host = undefined; + this._path = undefined; + this._port = undefined; + this._scheme = undefined; + this._timeout = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._command = value.command; + this._delay = value.delay; + this._host = value.host; + this._path = value.path; + this._port = value.port; + this._scheme = value.scheme; + this._timeout = value.timeout; + this._type = value.type; + } + } + + // command - computed: true, optional: true, required: false + private _command?: string[]; + public get command() { + return cdktf.Fn.tolist(this.getListAttribute('command')); + } + public set command(value: string[]) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // delay - computed: false, optional: false, required: true + private _delay?: number; + public get delay() { + return this.getNumberAttribute('delay'); + } + public set delay(value: number) { + this._delay = value; + } + // Temporarily expose input value. Use with caution. + public get delayInput() { + return this._delay; + } + + // host - computed: true, optional: true, required: false + private _host?: string; + public get host() { + return this.getStringAttribute('host'); + } + public set host(value: string) { + this._host = value; + } + public resetHost() { + this._host = undefined; + } + // Temporarily expose input value. Use with caution. + public get hostInput() { + return this._host; + } + + // path - computed: true, optional: true, required: false + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + public resetPath() { + this._path = undefined; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // port - computed: true, optional: true, required: false + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + public resetPort() { + this._port = undefined; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // scheme - computed: true, optional: true, required: false + private _scheme?: string; + public get scheme() { + return this.getStringAttribute('scheme'); + } + public set scheme(value: string) { + this._scheme = value; + } + public resetScheme() { + this._scheme = undefined; + } + // Temporarily expose input value. Use with caution. + public get schemeInput() { + return this._scheme; + } + + // timeout - computed: false, optional: false, required: true + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface Servicestagev3ComponentReferResources { + /** + * The resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#id Servicestagev3Component#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * The resource parameters, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#parameters Servicestagev3Component#parameters} + */ + readonly parameters?: string; + /** + * The resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; +} + +export function servicestagev3ComponentReferResourcesToTerraform(struct?: Servicestagev3ComponentReferResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + parameters: cdktf.stringToTerraform(struct!.parameters), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3ComponentReferResourcesToHclTerraform(struct?: Servicestagev3ComponentReferResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.stringToHclTerraform(struct!.parameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentReferResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentReferResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._parameters !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentReferResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._parameters = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._parameters = value.parameters; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // parameters - computed: false, optional: true, required: false + private _parameters?: string; + public get parameters() { + return this.getStringAttribute('parameters'); + } + public set parameters(value: string) { + this._parameters = value; + } + public resetParameters() { + this._parameters = undefined; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class Servicestagev3ComponentReferResourcesList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentReferResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentReferResourcesOutputReference { + return new Servicestagev3ComponentReferResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentRuntimeStack { + /** + * The deploy mode of the stack. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#deploy_mode Servicestagev3Component#deploy_mode} + */ + readonly deployMode: string; + /** + * The stack name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#name Servicestagev3Component#name} + */ + readonly name: string; + /** + * The stack type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; + /** + * The stack version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#version Servicestagev3Component#version} + */ + readonly version?: string; +} + +export function servicestagev3ComponentRuntimeStackToTerraform(struct?: Servicestagev3ComponentRuntimeStackOutputReference | Servicestagev3ComponentRuntimeStack): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + deploy_mode: cdktf.stringToTerraform(struct!.deployMode), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + version: cdktf.stringToTerraform(struct!.version), + } +} + + +export function servicestagev3ComponentRuntimeStackToHclTerraform(struct?: Servicestagev3ComponentRuntimeStackOutputReference | Servicestagev3ComponentRuntimeStack): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + deploy_mode: { + value: cdktf.stringToHclTerraform(struct!.deployMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(struct!.version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentRuntimeStackOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): Servicestagev3ComponentRuntimeStack | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._deployMode !== undefined) { + hasAnyValues = true; + internalValueResult.deployMode = this._deployMode; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._version !== undefined) { + hasAnyValues = true; + internalValueResult.version = this._version; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentRuntimeStack | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._deployMode = undefined; + this._name = undefined; + this._type = undefined; + this._version = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._deployMode = value.deployMode; + this._name = value.name; + this._type = value.type; + this._version = value.version; + } + } + + // deploy_mode - computed: false, optional: false, required: true + private _deployMode?: string; + public get deployMode() { + return this.getStringAttribute('deploy_mode'); + } + public set deployMode(value: string) { + this._deployMode = value; + } + // Temporarily expose input value. Use with caution. + public get deployModeInput() { + return this._deployMode; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: true, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } +} +export interface Servicestagev3ComponentStoragesMounts { + /** + * The mount path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#path Servicestagev3Component#path} + */ + readonly path: string; + /** + * Whether the disk mount is read-only. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#read_only Servicestagev3Component#read_only} + */ + readonly readOnly: boolean | cdktf.IResolvable; + /** + * The sub mount path. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#sub_path Servicestagev3Component#sub_path} + */ + readonly subPath: string; +} + +export function servicestagev3ComponentStoragesMountsToTerraform(struct?: Servicestagev3ComponentStoragesMounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + path: cdktf.stringToTerraform(struct!.path), + read_only: cdktf.booleanToTerraform(struct!.readOnly), + sub_path: cdktf.stringToTerraform(struct!.subPath), + } +} + + +export function servicestagev3ComponentStoragesMountsToHclTerraform(struct?: Servicestagev3ComponentStoragesMounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + path: { + value: cdktf.stringToHclTerraform(struct!.path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + read_only: { + value: cdktf.booleanToHclTerraform(struct!.readOnly), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + sub_path: { + value: cdktf.stringToHclTerraform(struct!.subPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentStoragesMountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentStoragesMounts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._path !== undefined) { + hasAnyValues = true; + internalValueResult.path = this._path; + } + if (this._readOnly !== undefined) { + hasAnyValues = true; + internalValueResult.readOnly = this._readOnly; + } + if (this._subPath !== undefined) { + hasAnyValues = true; + internalValueResult.subPath = this._subPath; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentStoragesMounts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._path = undefined; + this._readOnly = undefined; + this._subPath = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._path = value.path; + this._readOnly = value.readOnly; + this._subPath = value.subPath; + } + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // read_only - computed: false, optional: false, required: true + private _readOnly?: boolean | cdktf.IResolvable; + public get readOnly() { + return this.getBooleanAttribute('read_only'); + } + public set readOnly(value: boolean | cdktf.IResolvable) { + this._readOnly = value; + } + // Temporarily expose input value. Use with caution. + public get readOnlyInput() { + return this._readOnly; + } + + // sub_path - computed: false, optional: false, required: true + private _subPath?: string; + public get subPath() { + return this.getStringAttribute('sub_path'); + } + public set subPath(value: string) { + this._subPath = value; + } + // Temporarily expose input value. Use with caution. + public get subPathInput() { + return this._subPath; + } +} + +export class Servicestagev3ComponentStoragesMountsList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentStoragesMounts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentStoragesMountsOutputReference { + return new Servicestagev3ComponentStoragesMountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentStorages { + /** + * The name of the disk where the data is stored. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#name Servicestagev3Component#name} + */ + readonly name: string; + /** + * The information corresponding to the specific types of data storage, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#parameters Servicestagev3Component#parameters} + */ + readonly parameters: string; + /** + * The type of the data storage. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#type Servicestagev3Component#type} + */ + readonly type: string; + /** + * mounts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#mounts Servicestagev3Component#mounts} + */ + readonly mounts: Servicestagev3ComponentStoragesMounts[] | cdktf.IResolvable; +} + +export function servicestagev3ComponentStoragesToTerraform(struct?: Servicestagev3ComponentStorages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + parameters: cdktf.stringToTerraform(struct!.parameters), + type: cdktf.stringToTerraform(struct!.type), + mounts: cdktf.listMapper(servicestagev3ComponentStoragesMountsToTerraform, true)(struct!.mounts), + } +} + + +export function servicestagev3ComponentStoragesToHclTerraform(struct?: Servicestagev3ComponentStorages | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parameters: { + value: cdktf.stringToHclTerraform(struct!.parameters), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mounts: { + value: cdktf.listMapperHcl(servicestagev3ComponentStoragesMountsToHclTerraform, true)(struct!.mounts), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentStoragesMountsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentStoragesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3ComponentStorages | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._parameters !== undefined) { + hasAnyValues = true; + internalValueResult.parameters = this._parameters; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._mounts?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.mounts = this._mounts?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentStorages | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._parameters = undefined; + this._type = undefined; + this._mounts.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._parameters = value.parameters; + this._type = value.type; + this._mounts.internalValue = value.mounts; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parameters - computed: false, optional: false, required: true + private _parameters?: string; + public get parameters() { + return this.getStringAttribute('parameters'); + } + public set parameters(value: string) { + this._parameters = value; + } + // Temporarily expose input value. Use with caution. + public get parametersInput() { + return this._parameters; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // mounts - computed: false, optional: false, required: true + private _mounts = new Servicestagev3ComponentStoragesMountsList(this, "mounts", true); + public get mounts() { + return this._mounts; + } + public putMounts(value: Servicestagev3ComponentStoragesMounts[] | cdktf.IResolvable) { + this._mounts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get mountsInput() { + return this._mounts.internalValue; + } +} + +export class Servicestagev3ComponentStoragesList extends cdktf.ComplexList { + public internalValue? : Servicestagev3ComponentStorages[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3ComponentStoragesOutputReference { + return new Servicestagev3ComponentStoragesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface Servicestagev3ComponentTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#create Servicestagev3Component#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#delete Servicestagev3Component#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#update Servicestagev3Component#update} + */ + readonly update?: string; +} + +export function servicestagev3ComponentTimeoutsToTerraform(struct?: Servicestagev3ComponentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function servicestagev3ComponentTimeoutsToHclTerraform(struct?: Servicestagev3ComponentTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3ComponentTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): Servicestagev3ComponentTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3ComponentTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component huaweicloud_servicestagev3_component} +*/ +export class Servicestagev3Component extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_component"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a Servicestagev3Component resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the Servicestagev3Component to import + * @param importFromId The id of the existing Servicestagev3Component that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the Servicestagev3Component to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_component", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_component huaweicloud_servicestagev3_component} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options Servicestagev3ComponentConfig + */ + public constructor(scope: Construct, id: string, config: Servicestagev3ComponentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_component', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._applicationId = config.applicationId; + this._build = config.buildAttribute; + this._command = config.command; + this._description = config.description; + this._environmentId = config.environmentId; + this._id = config.id; + this._jvmOpts = config.jvmOpts; + this._limitCpu = config.limitCpu; + this._limitMemory = config.limitMemory; + this._name = config.name; + this._region = config.region; + this._replica = config.replica; + this._requestCpu = config.requestCpu; + this._requestMemory = config.requestMemory; + this._source = config.source; + this._tags = config.tags; + this._timezone = config.timezone; + this._tomcatOpts = config.tomcatOpts; + this._version = config.version; + this._affinity.internalValue = config.affinity; + this._antiAffinity.internalValue = config.antiAffinity; + this._customMetric.internalValue = config.customMetric; + this._deployStrategy.internalValue = config.deployStrategy; + this._envs.internalValue = config.envs; + this._externalAccesses.internalValue = config.externalAccesses; + this._livenessProbe.internalValue = config.livenessProbe; + this._logs.internalValue = config.logs; + this._mesher.internalValue = config.mesher; + this._postStart.internalValue = config.postStart; + this._preStop.internalValue = config.preStop; + this._readinessProbe.internalValue = config.readinessProbe; + this._referResources.internalValue = config.referResources; + this._runtimeStack.internalValue = config.runtimeStack; + this._storages.internalValue = config.storages; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // application_id - computed: false, optional: false, required: true + private _applicationId?: string; + public get applicationId() { + return this.getStringAttribute('application_id'); + } + public set applicationId(value: string) { + this._applicationId = value; + } + // Temporarily expose input value. Use with caution. + public get applicationIdInput() { + return this._applicationId; + } + + // build - computed: false, optional: true, required: false + private _build?: string; + public get buildAttribute() { + return this.getStringAttribute('build'); + } + public set buildAttribute(value: string) { + this._build = value; + } + public resetBuildAttribute() { + this._build = undefined; + } + // Temporarily expose input value. Use with caution. + public get buildAttributeInput() { + return this._build; + } + + // command - computed: true, optional: true, required: false + private _command?: string; + public get command() { + return this.getStringAttribute('command'); + } + public set command(value: string) { + this._command = value; + } + public resetCommand() { + this._command = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandInput() { + return this._command; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // jvm_opts - computed: true, optional: true, required: false + private _jvmOpts?: string; + public get jvmOpts() { + return this.getStringAttribute('jvm_opts'); + } + public set jvmOpts(value: string) { + this._jvmOpts = value; + } + public resetJvmOpts() { + this._jvmOpts = undefined; + } + // Temporarily expose input value. Use with caution. + public get jvmOptsInput() { + return this._jvmOpts; + } + + // limit_cpu - computed: false, optional: true, required: false + private _limitCpu?: number; + public get limitCpu() { + return this.getNumberAttribute('limit_cpu'); + } + public set limitCpu(value: number) { + this._limitCpu = value; + } + public resetLimitCpu() { + this._limitCpu = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitCpuInput() { + return this._limitCpu; + } + + // limit_memory - computed: false, optional: true, required: false + private _limitMemory?: number; + public get limitMemory() { + return this.getNumberAttribute('limit_memory'); + } + public set limitMemory(value: number) { + this._limitMemory = value; + } + public resetLimitMemory() { + this._limitMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get limitMemoryInput() { + return this._limitMemory; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // replica - computed: false, optional: false, required: true + private _replica?: number; + public get replica() { + return this.getNumberAttribute('replica'); + } + public set replica(value: number) { + this._replica = value; + } + // Temporarily expose input value. Use with caution. + public get replicaInput() { + return this._replica; + } + + // request_cpu - computed: false, optional: true, required: false + private _requestCpu?: number; + public get requestCpu() { + return this.getNumberAttribute('request_cpu'); + } + public set requestCpu(value: number) { + this._requestCpu = value; + } + public resetRequestCpu() { + this._requestCpu = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestCpuInput() { + return this._requestCpu; + } + + // request_memory - computed: false, optional: true, required: false + private _requestMemory?: number; + public get requestMemory() { + return this.getNumberAttribute('request_memory'); + } + public set requestMemory(value: number) { + this._requestMemory = value; + } + public resetRequestMemory() { + this._requestMemory = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestMemoryInput() { + return this._requestMemory; + } + + // source - computed: false, optional: false, required: true + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timezone - computed: true, optional: true, required: false + private _timezone?: string; + public get timezone() { + return this.getStringAttribute('timezone'); + } + public set timezone(value: string) { + this._timezone = value; + } + public resetTimezone() { + this._timezone = undefined; + } + // Temporarily expose input value. Use with caution. + public get timezoneInput() { + return this._timezone; + } + + // tomcat_opts - computed: true, optional: true, required: false + private _tomcatOpts?: string; + public get tomcatOpts() { + return this.getStringAttribute('tomcat_opts'); + } + public set tomcatOpts(value: string) { + this._tomcatOpts = value; + } + public resetTomcatOpts() { + this._tomcatOpts = undefined; + } + // Temporarily expose input value. Use with caution. + public get tomcatOptsInput() { + return this._tomcatOpts; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // affinity - computed: false, optional: true, required: false + private _affinity = new Servicestagev3ComponentAffinityList(this, "affinity", true); + public get affinity() { + return this._affinity; + } + public putAffinity(value: Servicestagev3ComponentAffinity[] | cdktf.IResolvable) { + this._affinity.internalValue = value; + } + public resetAffinity() { + this._affinity.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get affinityInput() { + return this._affinity.internalValue; + } + + // anti_affinity - computed: false, optional: true, required: false + private _antiAffinity = new Servicestagev3ComponentAntiAffinityList(this, "anti_affinity", true); + public get antiAffinity() { + return this._antiAffinity; + } + public putAntiAffinity(value: Servicestagev3ComponentAntiAffinity[] | cdktf.IResolvable) { + this._antiAffinity.internalValue = value; + } + public resetAntiAffinity() { + this._antiAffinity.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get antiAffinityInput() { + return this._antiAffinity.internalValue; + } + + // custom_metric - computed: false, optional: true, required: false + private _customMetric = new Servicestagev3ComponentCustomMetricOutputReference(this, "custom_metric"); + public get customMetric() { + return this._customMetric; + } + public putCustomMetric(value: Servicestagev3ComponentCustomMetric) { + this._customMetric.internalValue = value; + } + public resetCustomMetric() { + this._customMetric.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customMetricInput() { + return this._customMetric.internalValue; + } + + // deploy_strategy - computed: false, optional: true, required: false + private _deployStrategy = new Servicestagev3ComponentDeployStrategyOutputReference(this, "deploy_strategy"); + public get deployStrategy() { + return this._deployStrategy; + } + public putDeployStrategy(value: Servicestagev3ComponentDeployStrategy) { + this._deployStrategy.internalValue = value; + } + public resetDeployStrategy() { + this._deployStrategy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get deployStrategyInput() { + return this._deployStrategy.internalValue; + } + + // envs - computed: false, optional: true, required: false + private _envs = new Servicestagev3ComponentEnvsList(this, "envs", true); + public get envs() { + return this._envs; + } + public putEnvs(value: Servicestagev3ComponentEnvs[] | cdktf.IResolvable) { + this._envs.internalValue = value; + } + public resetEnvs() { + this._envs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get envsInput() { + return this._envs.internalValue; + } + + // external_accesses - computed: false, optional: true, required: false + private _externalAccesses = new Servicestagev3ComponentExternalAccessesList(this, "external_accesses", true); + public get externalAccesses() { + return this._externalAccesses; + } + public putExternalAccesses(value: Servicestagev3ComponentExternalAccesses[] | cdktf.IResolvable) { + this._externalAccesses.internalValue = value; + } + public resetExternalAccesses() { + this._externalAccesses.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get externalAccessesInput() { + return this._externalAccesses.internalValue; + } + + // liveness_probe - computed: false, optional: true, required: false + private _livenessProbe = new Servicestagev3ComponentLivenessProbeOutputReference(this, "liveness_probe"); + public get livenessProbe() { + return this._livenessProbe; + } + public putLivenessProbe(value: Servicestagev3ComponentLivenessProbe) { + this._livenessProbe.internalValue = value; + } + public resetLivenessProbe() { + this._livenessProbe.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get livenessProbeInput() { + return this._livenessProbe.internalValue; + } + + // logs - computed: false, optional: true, required: false + private _logs = new Servicestagev3ComponentLogsList(this, "logs", true); + public get logs() { + return this._logs; + } + public putLogs(value: Servicestagev3ComponentLogs[] | cdktf.IResolvable) { + this._logs.internalValue = value; + } + public resetLogs() { + this._logs.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get logsInput() { + return this._logs.internalValue; + } + + // mesher - computed: false, optional: true, required: false + private _mesher = new Servicestagev3ComponentMesherOutputReference(this, "mesher"); + public get mesher() { + return this._mesher; + } + public putMesher(value: Servicestagev3ComponentMesher) { + this._mesher.internalValue = value; + } + public resetMesher() { + this._mesher.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get mesherInput() { + return this._mesher.internalValue; + } + + // post_start - computed: false, optional: true, required: false + private _postStart = new Servicestagev3ComponentPostStartOutputReference(this, "post_start"); + public get postStart() { + return this._postStart; + } + public putPostStart(value: Servicestagev3ComponentPostStart) { + this._postStart.internalValue = value; + } + public resetPostStart() { + this._postStart.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get postStartInput() { + return this._postStart.internalValue; + } + + // pre_stop - computed: false, optional: true, required: false + private _preStop = new Servicestagev3ComponentPreStopOutputReference(this, "pre_stop"); + public get preStop() { + return this._preStop; + } + public putPreStop(value: Servicestagev3ComponentPreStop) { + this._preStop.internalValue = value; + } + public resetPreStop() { + this._preStop.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get preStopInput() { + return this._preStop.internalValue; + } + + // readiness_probe - computed: false, optional: true, required: false + private _readinessProbe = new Servicestagev3ComponentReadinessProbeOutputReference(this, "readiness_probe"); + public get readinessProbe() { + return this._readinessProbe; + } + public putReadinessProbe(value: Servicestagev3ComponentReadinessProbe) { + this._readinessProbe.internalValue = value; + } + public resetReadinessProbe() { + this._readinessProbe.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get readinessProbeInput() { + return this._readinessProbe.internalValue; + } + + // refer_resources - computed: false, optional: false, required: true + private _referResources = new Servicestagev3ComponentReferResourcesList(this, "refer_resources", true); + public get referResources() { + return this._referResources; + } + public putReferResources(value: Servicestagev3ComponentReferResources[] | cdktf.IResolvable) { + this._referResources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get referResourcesInput() { + return this._referResources.internalValue; + } + + // runtime_stack - computed: false, optional: false, required: true + private _runtimeStack = new Servicestagev3ComponentRuntimeStackOutputReference(this, "runtime_stack"); + public get runtimeStack() { + return this._runtimeStack; + } + public putRuntimeStack(value: Servicestagev3ComponentRuntimeStack) { + this._runtimeStack.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get runtimeStackInput() { + return this._runtimeStack.internalValue; + } + + // storages - computed: false, optional: true, required: false + private _storages = new Servicestagev3ComponentStoragesList(this, "storages", true); + public get storages() { + return this._storages; + } + public putStorages(value: Servicestagev3ComponentStorages[] | cdktf.IResolvable) { + this._storages.internalValue = value; + } + public resetStorages() { + this._storages.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get storagesInput() { + return this._storages.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new Servicestagev3ComponentTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: Servicestagev3ComponentTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + application_id: cdktf.stringToTerraform(this._applicationId), + build: cdktf.stringToTerraform(this._build), + command: cdktf.stringToTerraform(this._command), + description: cdktf.stringToTerraform(this._description), + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + jvm_opts: cdktf.stringToTerraform(this._jvmOpts), + limit_cpu: cdktf.numberToTerraform(this._limitCpu), + limit_memory: cdktf.numberToTerraform(this._limitMemory), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + replica: cdktf.numberToTerraform(this._replica), + request_cpu: cdktf.numberToTerraform(this._requestCpu), + request_memory: cdktf.numberToTerraform(this._requestMemory), + source: cdktf.stringToTerraform(this._source), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timezone: cdktf.stringToTerraform(this._timezone), + tomcat_opts: cdktf.stringToTerraform(this._tomcatOpts), + version: cdktf.stringToTerraform(this._version), + affinity: cdktf.listMapper(servicestagev3ComponentAffinityToTerraform, true)(this._affinity.internalValue), + anti_affinity: cdktf.listMapper(servicestagev3ComponentAntiAffinityToTerraform, true)(this._antiAffinity.internalValue), + custom_metric: servicestagev3ComponentCustomMetricToTerraform(this._customMetric.internalValue), + deploy_strategy: servicestagev3ComponentDeployStrategyToTerraform(this._deployStrategy.internalValue), + envs: cdktf.listMapper(servicestagev3ComponentEnvsToTerraform, true)(this._envs.internalValue), + external_accesses: cdktf.listMapper(servicestagev3ComponentExternalAccessesToTerraform, true)(this._externalAccesses.internalValue), + liveness_probe: servicestagev3ComponentLivenessProbeToTerraform(this._livenessProbe.internalValue), + logs: cdktf.listMapper(servicestagev3ComponentLogsToTerraform, true)(this._logs.internalValue), + mesher: servicestagev3ComponentMesherToTerraform(this._mesher.internalValue), + post_start: servicestagev3ComponentPostStartToTerraform(this._postStart.internalValue), + pre_stop: servicestagev3ComponentPreStopToTerraform(this._preStop.internalValue), + readiness_probe: servicestagev3ComponentReadinessProbeToTerraform(this._readinessProbe.internalValue), + refer_resources: cdktf.listMapper(servicestagev3ComponentReferResourcesToTerraform, true)(this._referResources.internalValue), + runtime_stack: servicestagev3ComponentRuntimeStackToTerraform(this._runtimeStack.internalValue), + storages: cdktf.listMapper(servicestagev3ComponentStoragesToTerraform, true)(this._storages.internalValue), + timeouts: servicestagev3ComponentTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + application_id: { + value: cdktf.stringToHclTerraform(this._applicationId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + build: { + value: cdktf.stringToHclTerraform(this._build), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command: { + value: cdktf.stringToHclTerraform(this._command), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + jvm_opts: { + value: cdktf.stringToHclTerraform(this._jvmOpts), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + limit_cpu: { + value: cdktf.numberToHclTerraform(this._limitCpu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + limit_memory: { + value: cdktf.numberToHclTerraform(this._limitMemory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + replica: { + value: cdktf.numberToHclTerraform(this._replica), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + request_cpu: { + value: cdktf.numberToHclTerraform(this._requestCpu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + request_memory: { + value: cdktf.numberToHclTerraform(this._requestMemory), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source: { + value: cdktf.stringToHclTerraform(this._source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timezone: { + value: cdktf.stringToHclTerraform(this._timezone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tomcat_opts: { + value: cdktf.stringToHclTerraform(this._tomcatOpts), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + affinity: { + value: cdktf.listMapperHcl(servicestagev3ComponentAffinityToHclTerraform, true)(this._affinity.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentAffinityList", + }, + anti_affinity: { + value: cdktf.listMapperHcl(servicestagev3ComponentAntiAffinityToHclTerraform, true)(this._antiAffinity.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentAntiAffinityList", + }, + custom_metric: { + value: servicestagev3ComponentCustomMetricToHclTerraform(this._customMetric.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentCustomMetricList", + }, + deploy_strategy: { + value: servicestagev3ComponentDeployStrategyToHclTerraform(this._deployStrategy.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentDeployStrategyList", + }, + envs: { + value: cdktf.listMapperHcl(servicestagev3ComponentEnvsToHclTerraform, true)(this._envs.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentEnvsList", + }, + external_accesses: { + value: cdktf.listMapperHcl(servicestagev3ComponentExternalAccessesToHclTerraform, true)(this._externalAccesses.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentExternalAccessesList", + }, + liveness_probe: { + value: servicestagev3ComponentLivenessProbeToHclTerraform(this._livenessProbe.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentLivenessProbeList", + }, + logs: { + value: cdktf.listMapperHcl(servicestagev3ComponentLogsToHclTerraform, true)(this._logs.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentLogsList", + }, + mesher: { + value: servicestagev3ComponentMesherToHclTerraform(this._mesher.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentMesherList", + }, + post_start: { + value: servicestagev3ComponentPostStartToHclTerraform(this._postStart.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentPostStartList", + }, + pre_stop: { + value: servicestagev3ComponentPreStopToHclTerraform(this._preStop.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentPreStopList", + }, + readiness_probe: { + value: servicestagev3ComponentReadinessProbeToHclTerraform(this._readinessProbe.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentReadinessProbeList", + }, + refer_resources: { + value: cdktf.listMapperHcl(servicestagev3ComponentReferResourcesToHclTerraform, true)(this._referResources.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentReferResourcesList", + }, + runtime_stack: { + value: servicestagev3ComponentRuntimeStackToHclTerraform(this._runtimeStack.internalValue), + isBlock: true, + type: "list", + storageClassType: "Servicestagev3ComponentRuntimeStackList", + }, + storages: { + value: cdktf.listMapperHcl(servicestagev3ComponentStoragesToHclTerraform, true)(this._storages.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3ComponentStoragesList", + }, + timeouts: { + value: servicestagev3ComponentTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "Servicestagev3ComponentTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestagev3-environment-associate/README.md b/src/constructs/providers/huaweicloud/servicestagev3-environment-associate/README.md new file mode 100644 index 00000000..51034e26 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-environment-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestagev3_environment_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestagev3_environment_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate). diff --git a/src/constructs/providers/huaweicloud/servicestagev3-environment-associate/index.ts b/src/constructs/providers/huaweicloud/servicestagev3-environment-associate/index.ts new file mode 100644 index 00000000..5da7c513 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-environment-associate/index.ts @@ -0,0 +1,350 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface Servicestagev3EnvironmentAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * The environment ID associated with the resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#environment_id Servicestagev3EnvironmentAssociate#environment_id} + */ + readonly environmentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#id Servicestagev3EnvironmentAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the environment and resources are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#region Servicestagev3EnvironmentAssociate#region} + */ + readonly region?: string; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#resources Servicestagev3EnvironmentAssociate#resources} + */ + readonly resources: Servicestagev3EnvironmentAssociateResources[] | cdktf.IResolvable; +} +export interface Servicestagev3EnvironmentAssociateResources { + /** + * The ID of the resource to be associated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#id Servicestagev3EnvironmentAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * The type of the resource to be associated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#type Servicestagev3EnvironmentAssociate#type} + */ + readonly type: string; +} + +export function servicestagev3EnvironmentAssociateResourcesToTerraform(struct?: Servicestagev3EnvironmentAssociateResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function servicestagev3EnvironmentAssociateResourcesToHclTerraform(struct?: Servicestagev3EnvironmentAssociateResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class Servicestagev3EnvironmentAssociateResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): Servicestagev3EnvironmentAssociateResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: Servicestagev3EnvironmentAssociateResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class Servicestagev3EnvironmentAssociateResourcesList extends cdktf.ComplexList { + public internalValue? : Servicestagev3EnvironmentAssociateResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): Servicestagev3EnvironmentAssociateResourcesOutputReference { + return new Servicestagev3EnvironmentAssociateResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate huaweicloud_servicestagev3_environment_associate} +*/ +export class Servicestagev3EnvironmentAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_environment_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a Servicestagev3EnvironmentAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the Servicestagev3EnvironmentAssociate to import + * @param importFromId The id of the existing Servicestagev3EnvironmentAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the Servicestagev3EnvironmentAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_environment_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment_associate huaweicloud_servicestagev3_environment_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options Servicestagev3EnvironmentAssociateConfig + */ + public constructor(scope: Construct, id: string, config: Servicestagev3EnvironmentAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_environment_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._environmentId = config.environmentId; + this._id = config.id; + this._region = config.region; + this._resources.internalValue = config.resources; + } + + // ========== + // ATTRIBUTES + // ========== + + // environment_id - computed: false, optional: false, required: true + private _environmentId?: string; + public get environmentId() { + return this.getStringAttribute('environment_id'); + } + public set environmentId(value: string) { + this._environmentId = value; + } + // Temporarily expose input value. Use with caution. + public get environmentIdInput() { + return this._environmentId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resources - computed: false, optional: false, required: true + private _resources = new Servicestagev3EnvironmentAssociateResourcesList(this, "resources", true); + public get resources() { + return this._resources; + } + public putResources(value: Servicestagev3EnvironmentAssociateResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + environment_id: cdktf.stringToTerraform(this._environmentId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + resources: cdktf.listMapper(servicestagev3EnvironmentAssociateResourcesToTerraform, true)(this._resources.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + environment_id: { + value: cdktf.stringToHclTerraform(this._environmentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resources: { + value: cdktf.listMapperHcl(servicestagev3EnvironmentAssociateResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "set", + storageClassType: "Servicestagev3EnvironmentAssociateResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/servicestagev3-environment/README.md b/src/constructs/providers/huaweicloud/servicestagev3-environment/README.md new file mode 100644 index 00000000..553a244b --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-environment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_servicestagev3_environment` + +Refer to the Terraform Registry for docs: [`huaweicloud_servicestagev3_environment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment). diff --git a/src/constructs/providers/huaweicloud/servicestagev3-environment/index.ts b/src/constructs/providers/huaweicloud/servicestagev3-environment/index.ts new file mode 100644 index 00000000..9a6f8686 --- /dev/null +++ b/src/constructs/providers/huaweicloud/servicestagev3-environment/index.ts @@ -0,0 +1,335 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface Servicestagev3EnvironmentConfig extends cdktf.TerraformMetaArguments { + /** + * The deploy mode of the environment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#deploy_mode Servicestagev3Environment#deploy_mode} + */ + readonly deployMode?: string; + /** + * The description of the environment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#description Servicestagev3Environment#description} + */ + readonly description?: string; + /** + * The the enterprise project ID to which the environment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#enterprise_project_id Servicestagev3Environment#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#id Servicestagev3Environment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the environment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#name Servicestagev3Environment#name} + */ + readonly name: string; + /** + * The region where the environment is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#region Servicestagev3Environment#region} + */ + readonly region?: string; + /** + * The key/value pairs to associate with the environment that used to filter resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#tags Servicestagev3Environment#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID to which the environment belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#vpc_id Servicestagev3Environment#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment huaweicloud_servicestagev3_environment} +*/ +export class Servicestagev3Environment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_servicestagev3_environment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a Servicestagev3Environment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the Servicestagev3Environment to import + * @param importFromId The id of the existing Servicestagev3Environment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the Servicestagev3Environment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_servicestagev3_environment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/servicestagev3_environment huaweicloud_servicestagev3_environment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options Servicestagev3EnvironmentConfig + */ + public constructor(scope: Construct, id: string, config: Servicestagev3EnvironmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_servicestagev3_environment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deployMode = config.deployMode; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // deploy_mode - computed: true, optional: true, required: false + private _deployMode?: string; + public get deployMode() { + return this.getStringAttribute('deploy_mode'); + } + public set deployMode(value: string) { + this._deployMode = value; + } + public resetDeployMode() { + this._deployMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get deployModeInput() { + return this._deployMode; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + deploy_mode: cdktf.stringToTerraform(this._deployMode), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + deploy_mode: { + value: cdktf.stringToHclTerraform(this._deployMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-access-rule-v2/README.md b/src/constructs/providers/huaweicloud/sfs-access-rule-v2/README.md new file mode 100644 index 00000000..e9444a90 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-access-rule-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_access_rule_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_access_rule_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2). diff --git a/src/constructs/providers/huaweicloud/sfs-access-rule-v2/index.ts b/src/constructs/providers/huaweicloud/sfs-access-rule-v2/index.ts new file mode 100644 index 00000000..46ee1aba --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-access-rule-v2/index.ts @@ -0,0 +1,412 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsAccessRuleV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#access_level SfsAccessRuleV2#access_level} + */ + readonly accessLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#access_to SfsAccessRuleV2#access_to} + */ + readonly accessTo: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#access_type SfsAccessRuleV2#access_type} + */ + readonly accessType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#id SfsAccessRuleV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#region SfsAccessRuleV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#sfs_id SfsAccessRuleV2#sfs_id} + */ + readonly sfsId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#timeouts SfsAccessRuleV2#timeouts} + */ + readonly timeouts?: SfsAccessRuleV2Timeouts; +} +export interface SfsAccessRuleV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#create SfsAccessRuleV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#delete SfsAccessRuleV2#delete} + */ + readonly delete?: string; +} + +export function sfsAccessRuleV2TimeoutsToTerraform(struct?: SfsAccessRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sfsAccessRuleV2TimeoutsToHclTerraform(struct?: SfsAccessRuleV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsAccessRuleV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsAccessRuleV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsAccessRuleV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2 huaweicloud_sfs_access_rule_v2} +*/ +export class SfsAccessRuleV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_access_rule_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsAccessRuleV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsAccessRuleV2 to import + * @param importFromId The id of the existing SfsAccessRuleV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsAccessRuleV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_access_rule_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule_v2 huaweicloud_sfs_access_rule_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsAccessRuleV2Config + */ + public constructor(scope: Construct, id: string, config: SfsAccessRuleV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_access_rule_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessLevel = config.accessLevel; + this._accessTo = config.accessTo; + this._accessType = config.accessType; + this._id = config.id; + this._region = config.region; + this._sfsId = config.sfsId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_level - computed: false, optional: true, required: false + private _accessLevel?: string; + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + public set accessLevel(value: string) { + this._accessLevel = value; + } + public resetAccessLevel() { + this._accessLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessLevelInput() { + return this._accessLevel; + } + + // access_to - computed: false, optional: false, required: true + private _accessTo?: string; + public get accessTo() { + return this.getStringAttribute('access_to'); + } + public set accessTo(value: string) { + this._accessTo = value; + } + // Temporarily expose input value. Use with caution. + public get accessToInput() { + return this._accessTo; + } + + // access_type - computed: false, optional: true, required: false + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + public resetAccessType() { + this._accessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sfs_id - computed: false, optional: false, required: true + private _sfsId?: string; + public get sfsId() { + return this.getStringAttribute('sfs_id'); + } + public set sfsId(value: string) { + this._sfsId = value; + } + // Temporarily expose input value. Use with caution. + public get sfsIdInput() { + return this._sfsId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsAccessRuleV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsAccessRuleV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_level: cdktf.stringToTerraform(this._accessLevel), + access_to: cdktf.stringToTerraform(this._accessTo), + access_type: cdktf.stringToTerraform(this._accessType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + sfs_id: cdktf.stringToTerraform(this._sfsId), + timeouts: sfsAccessRuleV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_level: { + value: cdktf.stringToHclTerraform(this._accessLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_to: { + value: cdktf.stringToHclTerraform(this._accessTo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_type: { + value: cdktf.stringToHclTerraform(this._accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sfs_id: { + value: cdktf.stringToHclTerraform(this._sfsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sfsAccessRuleV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsAccessRuleV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-access-rule/README.md b/src/constructs/providers/huaweicloud/sfs-access-rule/README.md new file mode 100644 index 00000000..209c54b2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-access-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_access_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_access_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule). diff --git a/src/constructs/providers/huaweicloud/sfs-access-rule/index.ts b/src/constructs/providers/huaweicloud/sfs-access-rule/index.ts new file mode 100644 index 00000000..71e97646 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-access-rule/index.ts @@ -0,0 +1,412 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsAccessRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#access_level SfsAccessRule#access_level} + */ + readonly accessLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#access_to SfsAccessRule#access_to} + */ + readonly accessTo: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#access_type SfsAccessRule#access_type} + */ + readonly accessType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#id SfsAccessRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#region SfsAccessRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#sfs_id SfsAccessRule#sfs_id} + */ + readonly sfsId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#timeouts SfsAccessRule#timeouts} + */ + readonly timeouts?: SfsAccessRuleTimeouts; +} +export interface SfsAccessRuleTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#create SfsAccessRule#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#delete SfsAccessRule#delete} + */ + readonly delete?: string; +} + +export function sfsAccessRuleTimeoutsToTerraform(struct?: SfsAccessRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sfsAccessRuleTimeoutsToHclTerraform(struct?: SfsAccessRuleTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsAccessRuleTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsAccessRuleTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsAccessRuleTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule huaweicloud_sfs_access_rule} +*/ +export class SfsAccessRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_access_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsAccessRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsAccessRule to import + * @param importFromId The id of the existing SfsAccessRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsAccessRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_access_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_access_rule huaweicloud_sfs_access_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsAccessRuleConfig + */ + public constructor(scope: Construct, id: string, config: SfsAccessRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_access_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessLevel = config.accessLevel; + this._accessTo = config.accessTo; + this._accessType = config.accessType; + this._id = config.id; + this._region = config.region; + this._sfsId = config.sfsId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_level - computed: false, optional: true, required: false + private _accessLevel?: string; + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + public set accessLevel(value: string) { + this._accessLevel = value; + } + public resetAccessLevel() { + this._accessLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessLevelInput() { + return this._accessLevel; + } + + // access_to - computed: false, optional: false, required: true + private _accessTo?: string; + public get accessTo() { + return this.getStringAttribute('access_to'); + } + public set accessTo(value: string) { + this._accessTo = value; + } + // Temporarily expose input value. Use with caution. + public get accessToInput() { + return this._accessTo; + } + + // access_type - computed: false, optional: true, required: false + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + public resetAccessType() { + this._accessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sfs_id - computed: false, optional: false, required: true + private _sfsId?: string; + public get sfsId() { + return this.getStringAttribute('sfs_id'); + } + public set sfsId(value: string) { + this._sfsId = value; + } + // Temporarily expose input value. Use with caution. + public get sfsIdInput() { + return this._sfsId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsAccessRuleTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsAccessRuleTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_level: cdktf.stringToTerraform(this._accessLevel), + access_to: cdktf.stringToTerraform(this._accessTo), + access_type: cdktf.stringToTerraform(this._accessType), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + sfs_id: cdktf.stringToTerraform(this._sfsId), + timeouts: sfsAccessRuleTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_level: { + value: cdktf.stringToHclTerraform(this._accessLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_to: { + value: cdktf.stringToHclTerraform(this._accessTo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_type: { + value: cdktf.stringToHclTerraform(this._accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sfs_id: { + value: cdktf.stringToHclTerraform(this._sfsId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sfsAccessRuleTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsAccessRuleTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-file-system-v2/README.md b/src/constructs/providers/huaweicloud/sfs-file-system-v2/README.md new file mode 100644 index 00000000..c0d4cfa0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-file-system-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_file_system_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_file_system_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2). diff --git a/src/constructs/providers/huaweicloud/sfs-file-system-v2/index.ts b/src/constructs/providers/huaweicloud/sfs-file-system-v2/index.ts new file mode 100644 index 00000000..189c5b92 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-file-system-v2/index.ts @@ -0,0 +1,755 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsFileSystemV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#access_level SfsFileSystemV2#access_level} + */ + readonly accessLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#access_to SfsFileSystemV2#access_to} + */ + readonly accessTo?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#access_type SfsFileSystemV2#access_type} + */ + readonly accessType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#availability_zone SfsFileSystemV2#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#description SfsFileSystemV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#enterprise_project_id SfsFileSystemV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#id SfsFileSystemV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#is_public SfsFileSystemV2#is_public} + */ + readonly isPublic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#metadata SfsFileSystemV2#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#name SfsFileSystemV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#region SfsFileSystemV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#share_proto SfsFileSystemV2#share_proto} + */ + readonly shareProto?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#size SfsFileSystemV2#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#tags SfsFileSystemV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#timeouts SfsFileSystemV2#timeouts} + */ + readonly timeouts?: SfsFileSystemV2Timeouts; +} +export interface SfsFileSystemV2AccessRules { +} + +export function sfsFileSystemV2AccessRulesToTerraform(struct?: SfsFileSystemV2AccessRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function sfsFileSystemV2AccessRulesToHclTerraform(struct?: SfsFileSystemV2AccessRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SfsFileSystemV2AccessRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SfsFileSystemV2AccessRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsFileSystemV2AccessRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_level - computed: true, optional: false, required: false + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + + // access_rule_id - computed: true, optional: false, required: false + public get accessRuleId() { + return this.getStringAttribute('access_rule_id'); + } + + // access_to - computed: true, optional: false, required: false + public get accessTo() { + return this.getStringAttribute('access_to'); + } + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class SfsFileSystemV2AccessRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SfsFileSystemV2AccessRulesOutputReference { + return new SfsFileSystemV2AccessRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SfsFileSystemV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#create SfsFileSystemV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#delete SfsFileSystemV2#delete} + */ + readonly delete?: string; +} + +export function sfsFileSystemV2TimeoutsToTerraform(struct?: SfsFileSystemV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sfsFileSystemV2TimeoutsToHclTerraform(struct?: SfsFileSystemV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsFileSystemV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsFileSystemV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsFileSystemV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2 huaweicloud_sfs_file_system_v2} +*/ +export class SfsFileSystemV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_file_system_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsFileSystemV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsFileSystemV2 to import + * @param importFromId The id of the existing SfsFileSystemV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsFileSystemV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_file_system_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system_v2 huaweicloud_sfs_file_system_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsFileSystemV2Config + */ + public constructor(scope: Construct, id: string, config: SfsFileSystemV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_file_system_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessLevel = config.accessLevel; + this._accessTo = config.accessTo; + this._accessType = config.accessType; + this._availabilityZone = config.availabilityZone; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isPublic = config.isPublic; + this._metadata = config.metadata; + this._name = config.name; + this._region = config.region; + this._shareProto = config.shareProto; + this._size = config.size; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_level - computed: true, optional: true, required: false + private _accessLevel?: string; + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + public set accessLevel(value: string) { + this._accessLevel = value; + } + public resetAccessLevel() { + this._accessLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessLevelInput() { + return this._accessLevel; + } + + // access_rule_status - computed: true, optional: false, required: false + public get accessRuleStatus() { + return this.getStringAttribute('access_rule_status'); + } + + // access_rules - computed: true, optional: false, required: false + private _accessRules = new SfsFileSystemV2AccessRulesList(this, "access_rules", false); + public get accessRules() { + return this._accessRules; + } + + // access_to - computed: false, optional: true, required: false + private _accessTo?: string; + public get accessTo() { + return this.getStringAttribute('access_to'); + } + public set accessTo(value: string) { + this._accessTo = value; + } + public resetAccessTo() { + this._accessTo = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToInput() { + return this._accessTo; + } + + // access_type - computed: true, optional: true, required: false + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + public resetAccessType() { + this._accessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_public - computed: false, optional: true, required: false + private _isPublic?: boolean | cdktf.IResolvable; + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + public set isPublic(value: boolean | cdktf.IResolvable) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_access_id - computed: true, optional: false, required: false + public get shareAccessId() { + return this.getStringAttribute('share_access_id'); + } + + // share_proto - computed: false, optional: true, required: false + private _shareProto?: string; + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + public set shareProto(value: string) { + this._shareProto = value; + } + public resetShareProto() { + this._shareProto = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareProtoInput() { + return this._shareProto; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsFileSystemV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsFileSystemV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_level: cdktf.stringToTerraform(this._accessLevel), + access_to: cdktf.stringToTerraform(this._accessTo), + access_type: cdktf.stringToTerraform(this._accessType), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_public: cdktf.booleanToTerraform(this._isPublic), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + share_proto: cdktf.stringToTerraform(this._shareProto), + size: cdktf.numberToTerraform(this._size), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: sfsFileSystemV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_level: { + value: cdktf.stringToHclTerraform(this._accessLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_to: { + value: cdktf.stringToHclTerraform(this._accessTo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_type: { + value: cdktf.stringToHclTerraform(this._accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_public: { + value: cdktf.booleanToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_proto: { + value: cdktf.stringToHclTerraform(this._shareProto), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: sfsFileSystemV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsFileSystemV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-file-system/README.md b/src/constructs/providers/huaweicloud/sfs-file-system/README.md new file mode 100644 index 00000000..2a95ede0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-file-system/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_file_system` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_file_system`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system). diff --git a/src/constructs/providers/huaweicloud/sfs-file-system/index.ts b/src/constructs/providers/huaweicloud/sfs-file-system/index.ts new file mode 100644 index 00000000..1b2cbf29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-file-system/index.ts @@ -0,0 +1,755 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsFileSystemConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#access_level SfsFileSystem#access_level} + */ + readonly accessLevel?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#access_to SfsFileSystem#access_to} + */ + readonly accessTo?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#access_type SfsFileSystem#access_type} + */ + readonly accessType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#availability_zone SfsFileSystem#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#description SfsFileSystem#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#enterprise_project_id SfsFileSystem#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#id SfsFileSystem#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#is_public SfsFileSystem#is_public} + */ + readonly isPublic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#metadata SfsFileSystem#metadata} + */ + readonly metadata?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#name SfsFileSystem#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#region SfsFileSystem#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#share_proto SfsFileSystem#share_proto} + */ + readonly shareProto?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#size SfsFileSystem#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#tags SfsFileSystem#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#timeouts SfsFileSystem#timeouts} + */ + readonly timeouts?: SfsFileSystemTimeouts; +} +export interface SfsFileSystemAccessRules { +} + +export function sfsFileSystemAccessRulesToTerraform(struct?: SfsFileSystemAccessRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function sfsFileSystemAccessRulesToHclTerraform(struct?: SfsFileSystemAccessRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SfsFileSystemAccessRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SfsFileSystemAccessRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsFileSystemAccessRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // access_level - computed: true, optional: false, required: false + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + + // access_rule_id - computed: true, optional: false, required: false + public get accessRuleId() { + return this.getStringAttribute('access_rule_id'); + } + + // access_to - computed: true, optional: false, required: false + public get accessTo() { + return this.getStringAttribute('access_to'); + } + + // access_type - computed: true, optional: false, required: false + public get accessType() { + return this.getStringAttribute('access_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class SfsFileSystemAccessRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SfsFileSystemAccessRulesOutputReference { + return new SfsFileSystemAccessRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SfsFileSystemTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#create SfsFileSystem#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#delete SfsFileSystem#delete} + */ + readonly delete?: string; +} + +export function sfsFileSystemTimeoutsToTerraform(struct?: SfsFileSystemTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sfsFileSystemTimeoutsToHclTerraform(struct?: SfsFileSystemTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsFileSystemTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsFileSystemTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsFileSystemTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system huaweicloud_sfs_file_system} +*/ +export class SfsFileSystem extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_file_system"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsFileSystem resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsFileSystem to import + * @param importFromId The id of the existing SfsFileSystem that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsFileSystem to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_file_system", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_file_system huaweicloud_sfs_file_system} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsFileSystemConfig + */ + public constructor(scope: Construct, id: string, config: SfsFileSystemConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_file_system', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessLevel = config.accessLevel; + this._accessTo = config.accessTo; + this._accessType = config.accessType; + this._availabilityZone = config.availabilityZone; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._isPublic = config.isPublic; + this._metadata = config.metadata; + this._name = config.name; + this._region = config.region; + this._shareProto = config.shareProto; + this._size = config.size; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_level - computed: true, optional: true, required: false + private _accessLevel?: string; + public get accessLevel() { + return this.getStringAttribute('access_level'); + } + public set accessLevel(value: string) { + this._accessLevel = value; + } + public resetAccessLevel() { + this._accessLevel = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessLevelInput() { + return this._accessLevel; + } + + // access_rule_status - computed: true, optional: false, required: false + public get accessRuleStatus() { + return this.getStringAttribute('access_rule_status'); + } + + // access_rules - computed: true, optional: false, required: false + private _accessRules = new SfsFileSystemAccessRulesList(this, "access_rules", false); + public get accessRules() { + return this._accessRules; + } + + // access_to - computed: false, optional: true, required: false + private _accessTo?: string; + public get accessTo() { + return this.getStringAttribute('access_to'); + } + public set accessTo(value: string) { + this._accessTo = value; + } + public resetAccessTo() { + this._accessTo = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessToInput() { + return this._accessTo; + } + + // access_type - computed: true, optional: true, required: false + private _accessType?: string; + public get accessType() { + return this.getStringAttribute('access_type'); + } + public set accessType(value: string) { + this._accessType = value; + } + public resetAccessType() { + this._accessType = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessTypeInput() { + return this._accessType; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_public - computed: false, optional: true, required: false + private _isPublic?: boolean | cdktf.IResolvable; + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + public set isPublic(value: boolean | cdktf.IResolvable) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // metadata - computed: false, optional: true, required: false + private _metadata?: { [key: string]: string }; + public get metadata() { + return this.getStringMapAttribute('metadata'); + } + public set metadata(value: { [key: string]: string }) { + this._metadata = value; + } + public resetMetadata() { + this._metadata = undefined; + } + // Temporarily expose input value. Use with caution. + public get metadataInput() { + return this._metadata; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_access_id - computed: true, optional: false, required: false + public get shareAccessId() { + return this.getStringAttribute('share_access_id'); + } + + // share_proto - computed: false, optional: true, required: false + private _shareProto?: string; + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + public set shareProto(value: string) { + this._shareProto = value; + } + public resetShareProto() { + this._shareProto = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareProtoInput() { + return this._shareProto; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsFileSystemTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsFileSystemTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_level: cdktf.stringToTerraform(this._accessLevel), + access_to: cdktf.stringToTerraform(this._accessTo), + access_type: cdktf.stringToTerraform(this._accessType), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + is_public: cdktf.booleanToTerraform(this._isPublic), + metadata: cdktf.hashMapper(cdktf.stringToTerraform)(this._metadata), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + share_proto: cdktf.stringToTerraform(this._shareProto), + size: cdktf.numberToTerraform(this._size), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: sfsFileSystemTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_level: { + value: cdktf.stringToHclTerraform(this._accessLevel), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_to: { + value: cdktf.stringToHclTerraform(this._accessTo), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_type: { + value: cdktf.stringToHclTerraform(this._accessType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_public: { + value: cdktf.booleanToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + metadata: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._metadata), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_proto: { + value: cdktf.stringToHclTerraform(this._shareProto), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: sfsFileSystemTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsFileSystemTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-data-task/README.md b/src/constructs/providers/huaweicloud/sfs-turbo-data-task/README.md new file mode 100644 index 00000000..a7066d4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-data-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo_data_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo_data_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-data-task/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo-data-task/index.ts new file mode 100644 index 00000000..3ba99f00 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-data-task/index.ts @@ -0,0 +1,444 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboDataTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#dest_prefix SfsTurboDataTask#dest_prefix} + */ + readonly destPrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#dest_target SfsTurboDataTask#dest_target} + */ + readonly destTarget: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#id SfsTurboDataTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#region SfsTurboDataTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#share_id SfsTurboDataTask#share_id} + */ + readonly shareId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#src_prefix SfsTurboDataTask#src_prefix} + */ + readonly srcPrefix?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#src_target SfsTurboDataTask#src_target} + */ + readonly srcTarget: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#type SfsTurboDataTask#type} + */ + readonly type: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#timeouts SfsTurboDataTask#timeouts} + */ + readonly timeouts?: SfsTurboDataTaskTimeouts; +} +export interface SfsTurboDataTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#create SfsTurboDataTask#create} + */ + readonly create?: string; +} + +export function sfsTurboDataTaskTimeoutsToTerraform(struct?: SfsTurboDataTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function sfsTurboDataTaskTimeoutsToHclTerraform(struct?: SfsTurboDataTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsTurboDataTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsTurboDataTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsTurboDataTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task huaweicloud_sfs_turbo_data_task} +*/ +export class SfsTurboDataTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_data_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurboDataTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurboDataTask to import + * @param importFromId The id of the existing SfsTurboDataTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurboDataTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_data_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_data_task huaweicloud_sfs_turbo_data_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboDataTaskConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboDataTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_data_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destPrefix = config.destPrefix; + this._destTarget = config.destTarget; + this._id = config.id; + this._region = config.region; + this._shareId = config.shareId; + this._srcPrefix = config.srcPrefix; + this._srcTarget = config.srcTarget; + this._type = config.type; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // dest_prefix - computed: false, optional: true, required: false + private _destPrefix?: string; + public get destPrefix() { + return this.getStringAttribute('dest_prefix'); + } + public set destPrefix(value: string) { + this._destPrefix = value; + } + public resetDestPrefix() { + this._destPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get destPrefixInput() { + return this._destPrefix; + } + + // dest_target - computed: false, optional: false, required: true + private _destTarget?: string; + public get destTarget() { + return this.getStringAttribute('dest_target'); + } + public set destTarget(value: string) { + this._destTarget = value; + } + // Temporarily expose input value. Use with caution. + public get destTargetInput() { + return this._destTarget; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // src_prefix - computed: false, optional: true, required: false + private _srcPrefix?: string; + public get srcPrefix() { + return this.getStringAttribute('src_prefix'); + } + public set srcPrefix(value: string) { + this._srcPrefix = value; + } + public resetSrcPrefix() { + this._srcPrefix = undefined; + } + // Temporarily expose input value. Use with caution. + public get srcPrefixInput() { + return this._srcPrefix; + } + + // src_target - computed: false, optional: false, required: true + private _srcTarget?: string; + public get srcTarget() { + return this.getStringAttribute('src_target'); + } + public set srcTarget(value: string) { + this._srcTarget = value; + } + // Temporarily expose input value. Use with caution. + public get srcTargetInput() { + return this._srcTarget; + } + + // start_time - computed: true, optional: false, required: false + public get startTime() { + return this.getStringAttribute('start_time'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsTurboDataTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsTurboDataTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + dest_prefix: cdktf.stringToTerraform(this._destPrefix), + dest_target: cdktf.stringToTerraform(this._destTarget), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + src_prefix: cdktf.stringToTerraform(this._srcPrefix), + src_target: cdktf.stringToTerraform(this._srcTarget), + type: cdktf.stringToTerraform(this._type), + timeouts: sfsTurboDataTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + dest_prefix: { + value: cdktf.stringToHclTerraform(this._destPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dest_target: { + value: cdktf.stringToHclTerraform(this._destTarget), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_prefix: { + value: cdktf.stringToHclTerraform(this._srcPrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + src_target: { + value: cdktf.stringToHclTerraform(this._srcTarget), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sfsTurboDataTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsTurboDataTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/README.md b/src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/README.md new file mode 100644 index 00000000..7d45ce5a --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo_dir_quota` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo_dir_quota`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/index.ts new file mode 100644 index 00000000..5dc77964 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-dir-quota/index.ts @@ -0,0 +1,268 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboDirQuotaConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the size of the directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#capacity SfsTurboDirQuota#capacity} + */ + readonly capacity?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#id SfsTurboDirQuota#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the maximum number of inodes allowed in the directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#inode SfsTurboDirQuota#inode} + */ + readonly inode?: number; + /** + * Specifies the valid full path of an existing directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#path SfsTurboDirQuota#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#region SfsTurboDirQuota#region} + */ + readonly region?: string; + /** + * Specifies the SFS Turbo ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#share_id SfsTurboDirQuota#share_id} + */ + readonly shareId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota huaweicloud_sfs_turbo_dir_quota} +*/ +export class SfsTurboDirQuota extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_dir_quota"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurboDirQuota resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurboDirQuota to import + * @param importFromId The id of the existing SfsTurboDirQuota that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurboDirQuota to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_dir_quota", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir_quota huaweicloud_sfs_turbo_dir_quota} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboDirQuotaConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboDirQuotaConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_dir_quota', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._capacity = config.capacity; + this._id = config.id; + this._inode = config.inode; + this._path = config.path; + this._region = config.region; + this._shareId = config.shareId; + } + + // ========== + // ATTRIBUTES + // ========== + + // capacity - computed: false, optional: true, required: false + private _capacity?: number; + public get capacity() { + return this.getNumberAttribute('capacity'); + } + public set capacity(value: number) { + this._capacity = value; + } + public resetCapacity() { + this._capacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get capacityInput() { + return this._capacity; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // inode - computed: false, optional: true, required: false + private _inode?: number; + public get inode() { + return this.getNumberAttribute('inode'); + } + public set inode(value: number) { + this._inode = value; + } + public resetInode() { + this._inode = undefined; + } + // Temporarily expose input value. Use with caution. + public get inodeInput() { + return this._inode; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // used_capacity - computed: true, optional: false, required: false + public get usedCapacity() { + return this.getNumberAttribute('used_capacity'); + } + + // used_inode - computed: true, optional: false, required: false + public get usedInode() { + return this.getNumberAttribute('used_inode'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + capacity: cdktf.numberToTerraform(this._capacity), + id: cdktf.stringToTerraform(this._id), + inode: cdktf.numberToTerraform(this._inode), + path: cdktf.stringToTerraform(this._path), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + capacity: { + value: cdktf.numberToHclTerraform(this._capacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + inode: { + value: cdktf.numberToHclTerraform(this._inode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-dir/README.md b/src/constructs/providers/huaweicloud/sfs-turbo-dir/README.md new file mode 100644 index 00000000..1b679b2d --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-dir/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo_dir` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo_dir`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-dir/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo-dir/index.ts new file mode 100644 index 00000000..f9d26ade --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-dir/index.ts @@ -0,0 +1,288 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboDirConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the group ID of the SFS Turbo directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#gid SfsTurboDir#gid} + */ + readonly gid?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#id SfsTurboDir#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the SFS Turbo directory permissions. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#mode SfsTurboDir#mode} + */ + readonly mode?: number; + /** + * Specifies the valid full path of SFS Turbo directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#path SfsTurboDir#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#region SfsTurboDir#region} + */ + readonly region?: string; + /** + * Specifies the SFS Turbo ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#share_id SfsTurboDir#share_id} + */ + readonly shareId: string; + /** + * Specifies the user ID of the SFS Turbo directory. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#uid SfsTurboDir#uid} + */ + readonly uid?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir huaweicloud_sfs_turbo_dir} +*/ +export class SfsTurboDir extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_dir"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurboDir resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurboDir to import + * @param importFromId The id of the existing SfsTurboDir that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurboDir to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_dir", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_dir huaweicloud_sfs_turbo_dir} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboDirConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboDirConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_dir', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._gid = config.gid; + this._id = config.id; + this._mode = config.mode; + this._path = config.path; + this._region = config.region; + this._shareId = config.shareId; + this._uid = config.uid; + } + + // ========== + // ATTRIBUTES + // ========== + + // gid - computed: false, optional: true, required: false + private _gid?: number; + public get gid() { + return this.getNumberAttribute('gid'); + } + public set gid(value: number) { + this._gid = value; + } + public resetGid() { + this._gid = undefined; + } + // Temporarily expose input value. Use with caution. + public get gidInput() { + return this._gid; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mode - computed: false, optional: true, required: false + private _mode?: number; + public get mode() { + return this.getNumberAttribute('mode'); + } + public set mode(value: number) { + this._mode = value; + } + public resetMode() { + this._mode = undefined; + } + // Temporarily expose input value. Use with caution. + public get modeInput() { + return this._mode; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // uid - computed: false, optional: true, required: false + private _uid?: number; + public get uid() { + return this.getNumberAttribute('uid'); + } + public set uid(value: number) { + this._uid = value; + } + public resetUid() { + this._uid = undefined; + } + // Temporarily expose input value. Use with caution. + public get uidInput() { + return this._uid; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + gid: cdktf.numberToTerraform(this._gid), + id: cdktf.stringToTerraform(this._id), + mode: cdktf.numberToTerraform(this._mode), + path: cdktf.stringToTerraform(this._path), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + uid: cdktf.numberToTerraform(this._uid), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + gid: { + value: cdktf.numberToHclTerraform(this._gid), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mode: { + value: cdktf.numberToHclTerraform(this._mode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + uid: { + value: cdktf.numberToHclTerraform(this._uid), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-du-task/README.md b/src/constructs/providers/huaweicloud/sfs-turbo-du-task/README.md new file mode 100644 index 00000000..2c8507ec --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-du-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo_du_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo_du_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-du-task/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo-du-task/index.ts new file mode 100644 index 00000000..57449bfc --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-du-task/index.ts @@ -0,0 +1,411 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboDuTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task#id SfsTurboDuTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task#path SfsTurboDuTask#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task#region SfsTurboDuTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task#share_id SfsTurboDuTask#share_id} + */ + readonly shareId: string; +} +export interface SfsTurboDuTaskDirUsageFileCount { +} + +export function sfsTurboDuTaskDirUsageFileCountToTerraform(struct?: SfsTurboDuTaskDirUsageFileCount): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function sfsTurboDuTaskDirUsageFileCountToHclTerraform(struct?: SfsTurboDuTaskDirUsageFileCount): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SfsTurboDuTaskDirUsageFileCountOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SfsTurboDuTaskDirUsageFileCount | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsTurboDuTaskDirUsageFileCount | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // block - computed: true, optional: false, required: false + public get block() { + return this.getNumberAttribute('block'); + } + + // char - computed: true, optional: false, required: false + public get char() { + return this.getNumberAttribute('char'); + } + + // dir - computed: true, optional: false, required: false + public get dir() { + return this.getNumberAttribute('dir'); + } + + // pipe - computed: true, optional: false, required: false + public get pipe() { + return this.getNumberAttribute('pipe'); + } + + // regular - computed: true, optional: false, required: false + public get regular() { + return this.getNumberAttribute('regular'); + } + + // socket - computed: true, optional: false, required: false + public get socket() { + return this.getNumberAttribute('socket'); + } + + // symlink - computed: true, optional: false, required: false + public get symlink() { + return this.getNumberAttribute('symlink'); + } +} + +export class SfsTurboDuTaskDirUsageFileCountList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SfsTurboDuTaskDirUsageFileCountOutputReference { + return new SfsTurboDuTaskDirUsageFileCountOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SfsTurboDuTaskDirUsage { +} + +export function sfsTurboDuTaskDirUsageToTerraform(struct?: SfsTurboDuTaskDirUsage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function sfsTurboDuTaskDirUsageToHclTerraform(struct?: SfsTurboDuTaskDirUsage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SfsTurboDuTaskDirUsageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SfsTurboDuTaskDirUsage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsTurboDuTaskDirUsage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // file_count - computed: true, optional: false, required: false + private _fileCount = new SfsTurboDuTaskDirUsageFileCountList(this, "file_count", false); + public get fileCount() { + return this._fileCount; + } + + // message - computed: true, optional: false, required: false + public get message() { + return this.getStringAttribute('message'); + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // used_capacity - computed: true, optional: false, required: false + public get usedCapacity() { + return this.getNumberAttribute('used_capacity'); + } +} + +export class SfsTurboDuTaskDirUsageList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SfsTurboDuTaskDirUsageOutputReference { + return new SfsTurboDuTaskDirUsageOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task huaweicloud_sfs_turbo_du_task} +*/ +export class SfsTurboDuTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_du_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurboDuTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurboDuTask to import + * @param importFromId The id of the existing SfsTurboDuTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurboDuTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_du_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_du_task huaweicloud_sfs_turbo_du_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboDuTaskConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboDuTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_du_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._path = config.path; + this._region = config.region; + this._shareId = config.shareId; + } + + // ========== + // ATTRIBUTES + // ========== + + // begin_time - computed: true, optional: false, required: false + public get beginTime() { + return this.getStringAttribute('begin_time'); + } + + // dir_usage - computed: true, optional: false, required: false + private _dirUsage = new SfsTurboDuTaskDirUsageList(this, "dir_usage", false); + public get dirUsage() { + return this._dirUsage; + } + + // end_time - computed: true, optional: false, required: false + public get endTime() { + return this.getStringAttribute('end_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + path: cdktf.stringToTerraform(this._path), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-obs-target/README.md b/src/constructs/providers/huaweicloud/sfs-turbo-obs-target/README.md new file mode 100644 index 00000000..09da3563 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-obs-target/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo_obs_target` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo_obs_target`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-obs-target/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo-obs-target/index.ts new file mode 100644 index 00000000..eece3d59 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-obs-target/index.ts @@ -0,0 +1,527 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboObsTargetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#delete_data_in_file_system SfsTurboObsTarget#delete_data_in_file_system} + */ + readonly deleteDataInFileSystem?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#file_system_path SfsTurboObsTarget#file_system_path} + */ + readonly fileSystemPath: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#id SfsTurboObsTarget#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#region SfsTurboObsTarget#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#share_id SfsTurboObsTarget#share_id} + */ + readonly shareId: string; + /** + * obs block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#obs SfsTurboObsTarget#obs} + */ + readonly obs: SfsTurboObsTargetObs; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#timeouts SfsTurboObsTarget#timeouts} + */ + readonly timeouts?: SfsTurboObsTargetTimeouts; +} +export interface SfsTurboObsTargetObs { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#bucket SfsTurboObsTarget#bucket} + */ + readonly bucket: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#endpoint SfsTurboObsTarget#endpoint} + */ + readonly endpoint: string; +} + +export function sfsTurboObsTargetObsToTerraform(struct?: SfsTurboObsTargetObsOutputReference | SfsTurboObsTargetObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bucket: cdktf.stringToTerraform(struct!.bucket), + endpoint: cdktf.stringToTerraform(struct!.endpoint), + } +} + + +export function sfsTurboObsTargetObsToHclTerraform(struct?: SfsTurboObsTargetObsOutputReference | SfsTurboObsTargetObs): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bucket: { + value: cdktf.stringToHclTerraform(struct!.bucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint: { + value: cdktf.stringToHclTerraform(struct!.endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsTurboObsTargetObsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SfsTurboObsTargetObs | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bucket !== undefined) { + hasAnyValues = true; + internalValueResult.bucket = this._bucket; + } + if (this._endpoint !== undefined) { + hasAnyValues = true; + internalValueResult.endpoint = this._endpoint; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsTurboObsTargetObs | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bucket = undefined; + this._endpoint = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bucket = value.bucket; + this._endpoint = value.endpoint; + } + } + + // bucket - computed: false, optional: false, required: true + private _bucket?: string; + public get bucket() { + return this.getStringAttribute('bucket'); + } + public set bucket(value: string) { + this._bucket = value; + } + // Temporarily expose input value. Use with caution. + public get bucketInput() { + return this._bucket; + } + + // endpoint - computed: false, optional: false, required: true + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } +} +export interface SfsTurboObsTargetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#create SfsTurboObsTarget#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#delete SfsTurboObsTarget#delete} + */ + readonly delete?: string; +} + +export function sfsTurboObsTargetTimeoutsToTerraform(struct?: SfsTurboObsTargetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function sfsTurboObsTargetTimeoutsToHclTerraform(struct?: SfsTurboObsTargetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsTurboObsTargetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsTurboObsTargetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsTurboObsTargetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target huaweicloud_sfs_turbo_obs_target} +*/ +export class SfsTurboObsTarget extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_obs_target"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurboObsTarget resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurboObsTarget to import + * @param importFromId The id of the existing SfsTurboObsTarget that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurboObsTarget to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_obs_target", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_obs_target huaweicloud_sfs_turbo_obs_target} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboObsTargetConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboObsTargetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_obs_target', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deleteDataInFileSystem = config.deleteDataInFileSystem; + this._fileSystemPath = config.fileSystemPath; + this._id = config.id; + this._region = config.region; + this._shareId = config.shareId; + this._obs.internalValue = config.obs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // delete_data_in_file_system - computed: false, optional: true, required: false + private _deleteDataInFileSystem?: boolean | cdktf.IResolvable; + public get deleteDataInFileSystem() { + return this.getBooleanAttribute('delete_data_in_file_system'); + } + public set deleteDataInFileSystem(value: boolean | cdktf.IResolvable) { + this._deleteDataInFileSystem = value; + } + public resetDeleteDataInFileSystem() { + this._deleteDataInFileSystem = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteDataInFileSystemInput() { + return this._deleteDataInFileSystem; + } + + // file_system_path - computed: false, optional: false, required: true + private _fileSystemPath?: string; + public get fileSystemPath() { + return this.getStringAttribute('file_system_path'); + } + public set fileSystemPath(value: string) { + this._fileSystemPath = value; + } + // Temporarily expose input value. Use with caution. + public get fileSystemPathInput() { + return this._fileSystemPath; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // obs - computed: false, optional: false, required: true + private _obs = new SfsTurboObsTargetObsOutputReference(this, "obs"); + public get obs() { + return this._obs; + } + public putObs(value: SfsTurboObsTargetObs) { + this._obs.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get obsInput() { + return this._obs.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsTurboObsTargetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsTurboObsTargetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + delete_data_in_file_system: cdktf.booleanToTerraform(this._deleteDataInFileSystem), + file_system_path: cdktf.stringToTerraform(this._fileSystemPath), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + share_id: cdktf.stringToTerraform(this._shareId), + obs: sfsTurboObsTargetObsToTerraform(this._obs.internalValue), + timeouts: sfsTurboObsTargetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + delete_data_in_file_system: { + value: cdktf.booleanToHclTerraform(this._deleteDataInFileSystem), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + file_system_path: { + value: cdktf.stringToHclTerraform(this._fileSystemPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + obs: { + value: sfsTurboObsTargetObsToHclTerraform(this._obs.internalValue), + isBlock: true, + type: "list", + storageClassType: "SfsTurboObsTargetObsList", + }, + timeouts: { + value: sfsTurboObsTargetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsTurboObsTargetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/README.md b/src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/README.md new file mode 100644 index 00000000..31925603 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo_perm_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo_perm_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/index.ts new file mode 100644 index 00000000..b480c37b --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo-perm-rule/index.ts @@ -0,0 +1,244 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboPermRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#id SfsTurboPermRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#ip_cidr SfsTurboPermRule#ip_cidr} + */ + readonly ipCidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#region SfsTurboPermRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#rw_type SfsTurboPermRule#rw_type} + */ + readonly rwType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#share_id SfsTurboPermRule#share_id} + */ + readonly shareId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#user_type SfsTurboPermRule#user_type} + */ + readonly userType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule huaweicloud_sfs_turbo_perm_rule} +*/ +export class SfsTurboPermRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo_perm_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurboPermRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurboPermRule to import + * @param importFromId The id of the existing SfsTurboPermRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurboPermRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo_perm_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo_perm_rule huaweicloud_sfs_turbo_perm_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboPermRuleConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboPermRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo_perm_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._ipCidr = config.ipCidr; + this._region = config.region; + this._rwType = config.rwType; + this._shareId = config.shareId; + this._userType = config.userType; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_cidr - computed: false, optional: false, required: true + private _ipCidr?: string; + public get ipCidr() { + return this.getStringAttribute('ip_cidr'); + } + public set ipCidr(value: string) { + this._ipCidr = value; + } + // Temporarily expose input value. Use with caution. + public get ipCidrInput() { + return this._ipCidr; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rw_type - computed: false, optional: false, required: true + private _rwType?: string; + public get rwType() { + return this.getStringAttribute('rw_type'); + } + public set rwType(value: string) { + this._rwType = value; + } + // Temporarily expose input value. Use with caution. + public get rwTypeInput() { + return this._rwType; + } + + // share_id - computed: false, optional: false, required: true + private _shareId?: string; + public get shareId() { + return this.getStringAttribute('share_id'); + } + public set shareId(value: string) { + this._shareId = value; + } + // Temporarily expose input value. Use with caution. + public get shareIdInput() { + return this._shareId; + } + + // user_type - computed: false, optional: false, required: true + private _userType?: string; + public get userType() { + return this.getStringAttribute('user_type'); + } + public set userType(value: string) { + this._userType = value; + } + // Temporarily expose input value. Use with caution. + public get userTypeInput() { + return this._userType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + ip_cidr: cdktf.stringToTerraform(this._ipCidr), + region: cdktf.stringToTerraform(this._region), + rw_type: cdktf.stringToTerraform(this._rwType), + share_id: cdktf.stringToTerraform(this._shareId), + user_type: cdktf.stringToTerraform(this._userType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_cidr: { + value: cdktf.stringToHclTerraform(this._ipCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rw_type: { + value: cdktf.stringToHclTerraform(this._rwType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_id: { + value: cdktf.stringToHclTerraform(this._shareId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_type: { + value: cdktf.stringToHclTerraform(this._userType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sfs-turbo/README.md b/src/constructs/providers/huaweicloud/sfs-turbo/README.md new file mode 100644 index 00000000..68bcb40e --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sfs_turbo` + +Refer to the Terraform Registry for docs: [`huaweicloud_sfs_turbo`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo). diff --git a/src/constructs/providers/huaweicloud/sfs-turbo/index.ts b/src/constructs/providers/huaweicloud/sfs-turbo/index.ts new file mode 100644 index 00000000..83f40a15 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sfs-turbo/index.ts @@ -0,0 +1,924 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SfsTurboConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#auto_renew SfsTurbo#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#availability_zone SfsTurbo#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#backup_id SfsTurbo#backup_id} + */ + readonly backupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#charging_mode SfsTurbo#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#crypt_key_id SfsTurbo#crypt_key_id} + */ + readonly cryptKeyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#dedicated_flavor SfsTurbo#dedicated_flavor} + */ + readonly dedicatedFlavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#dedicated_storage_id SfsTurbo#dedicated_storage_id} + */ + readonly dedicatedStorageId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#enhanced SfsTurbo#enhanced} + */ + readonly enhanced?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#enterprise_project_id SfsTurbo#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#hpc_bandwidth SfsTurbo#hpc_bandwidth} + */ + readonly hpcBandwidth?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#hpc_cache_bandwidth SfsTurbo#hpc_cache_bandwidth} + */ + readonly hpcCacheBandwidth?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#id SfsTurbo#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#name SfsTurbo#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#period SfsTurbo#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#period_unit SfsTurbo#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#region SfsTurbo#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#security_group_id SfsTurbo#security_group_id} + */ + readonly securityGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#share_proto SfsTurbo#share_proto} + */ + readonly shareProto?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#share_type SfsTurbo#share_type} + */ + readonly shareType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#size SfsTurbo#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#subnet_id SfsTurbo#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#tags SfsTurbo#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#vpc_id SfsTurbo#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#timeouts SfsTurbo#timeouts} + */ + readonly timeouts?: SfsTurboTimeouts; +} +export interface SfsTurboTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#create SfsTurbo#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#delete SfsTurbo#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#update SfsTurbo#update} + */ + readonly update?: string; +} + +export function sfsTurboTimeoutsToTerraform(struct?: SfsTurboTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function sfsTurboTimeoutsToHclTerraform(struct?: SfsTurboTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SfsTurboTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SfsTurboTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SfsTurboTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo huaweicloud_sfs_turbo} +*/ +export class SfsTurbo extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sfs_turbo"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SfsTurbo resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SfsTurbo to import + * @param importFromId The id of the existing SfsTurbo that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SfsTurbo to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sfs_turbo", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sfs_turbo huaweicloud_sfs_turbo} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SfsTurboConfig + */ + public constructor(scope: Construct, id: string, config: SfsTurboConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sfs_turbo', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._backupId = config.backupId; + this._chargingMode = config.chargingMode; + this._cryptKeyId = config.cryptKeyId; + this._dedicatedFlavor = config.dedicatedFlavor; + this._dedicatedStorageId = config.dedicatedStorageId; + this._enhanced = config.enhanced; + this._enterpriseProjectId = config.enterpriseProjectId; + this._hpcBandwidth = config.hpcBandwidth; + this._hpcCacheBandwidth = config.hpcCacheBandwidth; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._securityGroupId = config.securityGroupId; + this._shareProto = config.shareProto; + this._shareType = config.shareType; + this._size = config.size; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // available_capacity - computed: true, optional: false, required: false + public get availableCapacity() { + return this.getStringAttribute('available_capacity'); + } + + // backup_id - computed: true, optional: true, required: false + private _backupId?: string; + public get backupId() { + return this.getStringAttribute('backup_id'); + } + public set backupId(value: string) { + this._backupId = value; + } + public resetBackupId() { + this._backupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get backupIdInput() { + return this._backupId; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // crypt_key_id - computed: false, optional: true, required: false + private _cryptKeyId?: string; + public get cryptKeyId() { + return this.getStringAttribute('crypt_key_id'); + } + public set cryptKeyId(value: string) { + this._cryptKeyId = value; + } + public resetCryptKeyId() { + this._cryptKeyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get cryptKeyIdInput() { + return this._cryptKeyId; + } + + // dedicated_flavor - computed: false, optional: true, required: false + private _dedicatedFlavor?: string; + public get dedicatedFlavor() { + return this.getStringAttribute('dedicated_flavor'); + } + public set dedicatedFlavor(value: string) { + this._dedicatedFlavor = value; + } + public resetDedicatedFlavor() { + this._dedicatedFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedFlavorInput() { + return this._dedicatedFlavor; + } + + // dedicated_storage_id - computed: false, optional: true, required: false + private _dedicatedStorageId?: string; + public get dedicatedStorageId() { + return this.getStringAttribute('dedicated_storage_id'); + } + public set dedicatedStorageId(value: string) { + this._dedicatedStorageId = value; + } + public resetDedicatedStorageId() { + this._dedicatedStorageId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedStorageIdInput() { + return this._dedicatedStorageId; + } + + // enhanced - computed: true, optional: true, required: false + private _enhanced?: boolean | cdktf.IResolvable; + public get enhanced() { + return this.getBooleanAttribute('enhanced'); + } + public set enhanced(value: boolean | cdktf.IResolvable) { + this._enhanced = value; + } + public resetEnhanced() { + this._enhanced = undefined; + } + // Temporarily expose input value. Use with caution. + public get enhancedInput() { + return this._enhanced; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // hpc_bandwidth - computed: true, optional: true, required: false + private _hpcBandwidth?: string; + public get hpcBandwidth() { + return this.getStringAttribute('hpc_bandwidth'); + } + public set hpcBandwidth(value: string) { + this._hpcBandwidth = value; + } + public resetHpcBandwidth() { + this._hpcBandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get hpcBandwidthInput() { + return this._hpcBandwidth; + } + + // hpc_cache_bandwidth - computed: true, optional: true, required: false + private _hpcCacheBandwidth?: string; + public get hpcCacheBandwidth() { + return this.getStringAttribute('hpc_cache_bandwidth'); + } + public set hpcCacheBandwidth(value: string) { + this._hpcCacheBandwidth = value; + } + public resetHpcCacheBandwidth() { + this._hpcCacheBandwidth = undefined; + } + // Temporarily expose input value. Use with caution. + public get hpcCacheBandwidthInput() { + return this._hpcCacheBandwidth; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_id - computed: false, optional: false, required: true + private _securityGroupId?: string; + public get securityGroupId() { + return this.getStringAttribute('security_group_id'); + } + public set securityGroupId(value: string) { + this._securityGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdInput() { + return this._securityGroupId; + } + + // share_proto - computed: false, optional: true, required: false + private _shareProto?: string; + public get shareProto() { + return this.getStringAttribute('share_proto'); + } + public set shareProto(value: string) { + this._shareProto = value; + } + public resetShareProto() { + this._shareProto = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareProtoInput() { + return this._shareProto; + } + + // share_type - computed: false, optional: true, required: false + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + public resetShareType() { + this._shareType = undefined; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // version - computed: true, optional: false, required: false + public get version() { + return this.getStringAttribute('version'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SfsTurboTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SfsTurboTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + backup_id: cdktf.stringToTerraform(this._backupId), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + crypt_key_id: cdktf.stringToTerraform(this._cryptKeyId), + dedicated_flavor: cdktf.stringToTerraform(this._dedicatedFlavor), + dedicated_storage_id: cdktf.stringToTerraform(this._dedicatedStorageId), + enhanced: cdktf.booleanToTerraform(this._enhanced), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + hpc_bandwidth: cdktf.stringToTerraform(this._hpcBandwidth), + hpc_cache_bandwidth: cdktf.stringToTerraform(this._hpcCacheBandwidth), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + security_group_id: cdktf.stringToTerraform(this._securityGroupId), + share_proto: cdktf.stringToTerraform(this._shareProto), + share_type: cdktf.stringToTerraform(this._shareType), + size: cdktf.numberToTerraform(this._size), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: sfsTurboTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + backup_id: { + value: cdktf.stringToHclTerraform(this._backupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + crypt_key_id: { + value: cdktf.stringToHclTerraform(this._cryptKeyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_flavor: { + value: cdktf.stringToHclTerraform(this._dedicatedFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_storage_id: { + value: cdktf.stringToHclTerraform(this._dedicatedStorageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enhanced: { + value: cdktf.booleanToHclTerraform(this._enhanced), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hpc_bandwidth: { + value: cdktf.stringToHclTerraform(this._hpcBandwidth), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hpc_cache_bandwidth: { + value: cdktf.stringToHclTerraform(this._hpcCacheBandwidth), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_id: { + value: cdktf.stringToHclTerraform(this._securityGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_proto: { + value: cdktf.stringToHclTerraform(this._shareProto), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(this._shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: sfsTurboTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SfsTurboTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-logtank/README.md b/src/constructs/providers/huaweicloud/smn-logtank/README.md new file mode 100644 index 00000000..15140181 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-logtank/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_logtank` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_logtank`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank). diff --git a/src/constructs/providers/huaweicloud/smn-logtank/index.ts b/src/constructs/providers/huaweicloud/smn-logtank/index.ts new file mode 100644 index 00000000..f9252a22 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-logtank/index.ts @@ -0,0 +1,234 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnLogtankConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank#id SmnLogtank#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank#log_group_id SmnLogtank#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank#log_stream_id SmnLogtank#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank#region SmnLogtank#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank#topic_urn SmnLogtank#topic_urn} + */ + readonly topicUrn: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank huaweicloud_smn_logtank} +*/ +export class SmnLogtank extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_logtank"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnLogtank resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnLogtank to import + * @param importFromId The id of the existing SmnLogtank that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnLogtank to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_logtank", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_logtank huaweicloud_smn_logtank} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnLogtankConfig + */ + public constructor(scope: Construct, id: string, config: SmnLogtankConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_logtank', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._region = config.region; + this._topicUrn = config.topicUrn; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // logtank_id - computed: true, optional: false, required: false + public get logtankId() { + return this.getStringAttribute('logtank_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + region: cdktf.stringToTerraform(this._region), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-message-detection/README.md b/src/constructs/providers/huaweicloud/smn-message-detection/README.md new file mode 100644 index 00000000..fade8700 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-message-detection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_message_detection` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_message_detection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection). diff --git a/src/constructs/providers/huaweicloud/smn-message-detection/index.ts b/src/constructs/providers/huaweicloud/smn-message-detection/index.ts new file mode 100644 index 00000000..28e9daf8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-message-detection/index.ts @@ -0,0 +1,412 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnMessageDetectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#enable_force_new SmnMessageDetection#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Specifies the endpoint address to be detected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#endpoint SmnMessageDetection#endpoint} + */ + readonly endpoint: string; + /** + * Specifies the extended key/value for subscriptions over HTTP or HTTPS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#extension SmnMessageDetection#extension} + */ + readonly extension?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#id SmnMessageDetection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the protocol type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#protocol SmnMessageDetection#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#region SmnMessageDetection#region} + */ + readonly region?: string; + /** + * Specifies the resource identifier of a topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#topic_urn SmnMessageDetection#topic_urn} + */ + readonly topicUrn: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#timeouts SmnMessageDetection#timeouts} + */ + readonly timeouts?: SmnMessageDetectionTimeouts; +} +export interface SmnMessageDetectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#create SmnMessageDetection#create} + */ + readonly create?: string; +} + +export function smnMessageDetectionTimeoutsToTerraform(struct?: SmnMessageDetectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function smnMessageDetectionTimeoutsToHclTerraform(struct?: SmnMessageDetectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmnMessageDetectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SmnMessageDetectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnMessageDetectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection huaweicloud_smn_message_detection} +*/ +export class SmnMessageDetection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_message_detection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnMessageDetection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnMessageDetection to import + * @param importFromId The id of the existing SmnMessageDetection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnMessageDetection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_message_detection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_detection huaweicloud_smn_message_detection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnMessageDetectionConfig + */ + public constructor(scope: Construct, id: string, config: SmnMessageDetectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_message_detection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._endpoint = config.endpoint; + this._extension = config.extension; + this._id = config.id; + this._protocol = config.protocol; + this._region = config.region; + this._topicUrn = config.topicUrn; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // endpoint - computed: false, optional: false, required: true + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } + + // extension - computed: false, optional: true, required: false + private _extension?: { [key: string]: string }; + public get extension() { + return this.getStringMapAttribute('extension'); + } + public set extension(value: { [key: string]: string }) { + this._extension = value; + } + public resetExtension() { + this._extension = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionInput() { + return this._extension; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // result - computed: true, optional: false, required: false + public get result() { + return this.getStringAttribute('result'); + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SmnMessageDetectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SmnMessageDetectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + endpoint: cdktf.stringToTerraform(this._endpoint), + extension: cdktf.hashMapper(cdktf.stringToTerraform)(this._extension), + id: cdktf.stringToTerraform(this._id), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + timeouts: smnMessageDetectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoint: { + value: cdktf.stringToHclTerraform(this._endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extension: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._extension), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: smnMessageDetectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SmnMessageDetectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-message-publish/README.md b/src/constructs/providers/huaweicloud/smn-message-publish/README.md new file mode 100644 index 00000000..697b9191 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-message-publish/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_message_publish` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_message_publish`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish). diff --git a/src/constructs/providers/huaweicloud/smn-message-publish/index.ts b/src/constructs/providers/huaweicloud/smn-message-publish/index.ts new file mode 100644 index 00000000..2fbcf3b8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-message-publish/index.ts @@ -0,0 +1,626 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnMessagePublishConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#enable_force_new SmnMessagePublish#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#id SmnMessagePublish#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the message content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#message SmnMessagePublish#message} + */ + readonly message?: string; + /** + * Specifies the message structure. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#message_structure SmnMessagePublish#message_structure} + */ + readonly messageStructure?: string; + /** + * Specifies the message template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#message_template_name SmnMessagePublish#message_template_name} + */ + readonly messageTemplateName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#region SmnMessagePublish#region} + */ + readonly region?: string; + /** + * Specifies the message title. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#subject SmnMessagePublish#subject} + */ + readonly subject?: string; + /** + * Specifies a dictionary consisting of tag and parameters to replace the tag. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#tags SmnMessagePublish#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Specifies the maximum retention time of the message within the SMN system. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#time_to_live SmnMessagePublish#time_to_live} + */ + readonly timeToLive?: string; + /** + * Specifies the resource identifier of a topic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#topic_urn SmnMessagePublish#topic_urn} + */ + readonly topicUrn: string; + /** + * message_attributes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#message_attributes SmnMessagePublish#message_attributes} + */ + readonly messageAttributes?: SmnMessagePublishMessageAttributes[] | cdktf.IResolvable; +} +export interface SmnMessagePublishMessageAttributes { + /** + * Specifies the property name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#name SmnMessagePublish#name} + */ + readonly name: string; + /** + * Specifies the property type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#type SmnMessagePublish#type} + */ + readonly type: string; + /** + * Specifies the property value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#value SmnMessagePublish#value} + */ + readonly value?: string; + /** + * Specifies the property values. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#values SmnMessagePublish#values} + */ + readonly values?: string[]; +} + +export function smnMessagePublishMessageAttributesToTerraform(struct?: SmnMessagePublishMessageAttributes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + value: cdktf.stringToTerraform(struct!.value), + values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.values), + } +} + + +export function smnMessagePublishMessageAttributesToHclTerraform(struct?: SmnMessagePublishMessageAttributes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + values: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.values), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmnMessagePublishMessageAttributesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SmnMessagePublishMessageAttributes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + if (this._values !== undefined) { + hasAnyValues = true; + internalValueResult.values = this._values; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnMessagePublishMessageAttributes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._type = undefined; + this._value = undefined; + this._values = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._type = value.type; + this._value = value.value; + this._values = value.values; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value - computed: false, optional: true, required: false + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } + + // values - computed: false, optional: true, required: false + private _values?: string[]; + public get values() { + return this.getListAttribute('values'); + } + public set values(value: string[]) { + this._values = value; + } + public resetValues() { + this._values = undefined; + } + // Temporarily expose input value. Use with caution. + public get valuesInput() { + return this._values; + } +} + +export class SmnMessagePublishMessageAttributesList extends cdktf.ComplexList { + public internalValue? : SmnMessagePublishMessageAttributes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SmnMessagePublishMessageAttributesOutputReference { + return new SmnMessagePublishMessageAttributesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish huaweicloud_smn_message_publish} +*/ +export class SmnMessagePublish extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_message_publish"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnMessagePublish resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnMessagePublish to import + * @param importFromId The id of the existing SmnMessagePublish that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnMessagePublish to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_message_publish", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_publish huaweicloud_smn_message_publish} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnMessagePublishConfig + */ + public constructor(scope: Construct, id: string, config: SmnMessagePublishConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_message_publish', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._message = config.message; + this._messageStructure = config.messageStructure; + this._messageTemplateName = config.messageTemplateName; + this._region = config.region; + this._subject = config.subject; + this._tags = config.tags; + this._timeToLive = config.timeToLive; + this._topicUrn = config.topicUrn; + this._messageAttributes.internalValue = config.messageAttributes; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // message - computed: false, optional: true, required: false + private _message?: string; + public get message() { + return this.getStringAttribute('message'); + } + public set message(value: string) { + this._message = value; + } + public resetMessage() { + this._message = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageInput() { + return this._message; + } + + // message_structure - computed: false, optional: true, required: false + private _messageStructure?: string; + public get messageStructure() { + return this.getStringAttribute('message_structure'); + } + public set messageStructure(value: string) { + this._messageStructure = value; + } + public resetMessageStructure() { + this._messageStructure = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageStructureInput() { + return this._messageStructure; + } + + // message_template_name - computed: false, optional: true, required: false + private _messageTemplateName?: string; + public get messageTemplateName() { + return this.getStringAttribute('message_template_name'); + } + public set messageTemplateName(value: string) { + this._messageTemplateName = value; + } + public resetMessageTemplateName() { + this._messageTemplateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageTemplateNameInput() { + return this._messageTemplateName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subject - computed: false, optional: true, required: false + private _subject?: string; + public get subject() { + return this.getStringAttribute('subject'); + } + public set subject(value: string) { + this._subject = value; + } + public resetSubject() { + this._subject = undefined; + } + // Temporarily expose input value. Use with caution. + public get subjectInput() { + return this._subject; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // time_to_live - computed: false, optional: true, required: false + private _timeToLive?: string; + public get timeToLive() { + return this.getStringAttribute('time_to_live'); + } + public set timeToLive(value: string) { + this._timeToLive = value; + } + public resetTimeToLive() { + this._timeToLive = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeToLiveInput() { + return this._timeToLive; + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // message_attributes - computed: false, optional: true, required: false + private _messageAttributes = new SmnMessagePublishMessageAttributesList(this, "message_attributes", false); + public get messageAttributes() { + return this._messageAttributes; + } + public putMessageAttributes(value: SmnMessagePublishMessageAttributes[] | cdktf.IResolvable) { + this._messageAttributes.internalValue = value; + } + public resetMessageAttributes() { + this._messageAttributes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get messageAttributesInput() { + return this._messageAttributes.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + message: cdktf.stringToTerraform(this._message), + message_structure: cdktf.stringToTerraform(this._messageStructure), + message_template_name: cdktf.stringToTerraform(this._messageTemplateName), + region: cdktf.stringToTerraform(this._region), + subject: cdktf.stringToTerraform(this._subject), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + time_to_live: cdktf.stringToTerraform(this._timeToLive), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + message_attributes: cdktf.listMapper(smnMessagePublishMessageAttributesToTerraform, true)(this._messageAttributes.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message: { + value: cdktf.stringToHclTerraform(this._message), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_structure: { + value: cdktf.stringToHclTerraform(this._messageStructure), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_template_name: { + value: cdktf.stringToHclTerraform(this._messageTemplateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subject: { + value: cdktf.stringToHclTerraform(this._subject), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + time_to_live: { + value: cdktf.stringToHclTerraform(this._timeToLive), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + message_attributes: { + value: cdktf.listMapperHcl(smnMessagePublishMessageAttributesToHclTerraform, true)(this._messageAttributes.internalValue), + isBlock: true, + type: "list", + storageClassType: "SmnMessagePublishMessageAttributesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-message-template/README.md b/src/constructs/providers/huaweicloud/smn-message-template/README.md new file mode 100644 index 00000000..b4ac0c1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-message-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_message_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_message_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template). diff --git a/src/constructs/providers/huaweicloud/smn-message-template/index.ts b/src/constructs/providers/huaweicloud/smn-message-template/index.ts new file mode 100644 index 00000000..d3b6b3be --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-message-template/index.ts @@ -0,0 +1,230 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnMessageTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the template content, which supports plain text only. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template#content SmnMessageTemplate#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template#id SmnMessageTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the message template name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template#name SmnMessageTemplate#name} + */ + readonly name: string; + /** + * Specifies the protocol supported by the template. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template#protocol SmnMessageTemplate#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template#region SmnMessageTemplate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template huaweicloud_smn_message_template} +*/ +export class SmnMessageTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_message_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnMessageTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnMessageTemplate to import + * @param importFromId The id of the existing SmnMessageTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnMessageTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_message_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_message_template huaweicloud_smn_message_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnMessageTemplateConfig + */ + public constructor(scope: Construct, id: string, config: SmnMessageTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_message_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._name = config.name; + this._protocol = config.protocol; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tag_names - computed: true, optional: false, required: false + public get tagNames() { + return this.getListAttribute('tag_names'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-subscription-filter-policy/README.md b/src/constructs/providers/huaweicloud/smn-subscription-filter-policy/README.md new file mode 100644 index 00000000..5746f0ca --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-subscription-filter-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_subscription_filter_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_subscription_filter_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy). diff --git a/src/constructs/providers/huaweicloud/smn-subscription-filter-policy/index.ts b/src/constructs/providers/huaweicloud/smn-subscription-filter-policy/index.ts new file mode 100644 index 00000000..363ee2ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-subscription-filter-policy/index.ts @@ -0,0 +1,373 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnSubscriptionFilterPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#enable_force_new SmnSubscriptionFilterPolicy#enable_force_new} + */ + readonly enableForceNew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#id SmnSubscriptionFilterPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#region SmnSubscriptionFilterPolicy#region} + */ + readonly region?: string; + /** + * Specifies the resource identifier of the subscriber. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#subscription_urn SmnSubscriptionFilterPolicy#subscription_urn} + */ + readonly subscriptionUrn: string; + /** + * filter_policies block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#filter_policies SmnSubscriptionFilterPolicy#filter_policies} + */ + readonly filterPolicies: SmnSubscriptionFilterPolicyFilterPolicies[] | cdktf.IResolvable; +} +export interface SmnSubscriptionFilterPolicyFilterPolicies { + /** + * Specifies the filter policy name. The policy name must be unique. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#name SmnSubscriptionFilterPolicy#name} + */ + readonly name: string; + /** + * Specifies the string array for exact match. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#string_equals SmnSubscriptionFilterPolicy#string_equals} + */ + readonly stringEquals: string[]; +} + +export function smnSubscriptionFilterPolicyFilterPoliciesToTerraform(struct?: SmnSubscriptionFilterPolicyFilterPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + name: cdktf.stringToTerraform(struct!.name), + string_equals: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.stringEquals), + } +} + + +export function smnSubscriptionFilterPolicyFilterPoliciesToHclTerraform(struct?: SmnSubscriptionFilterPolicyFilterPolicies | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + string_equals: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.stringEquals), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmnSubscriptionFilterPolicyFilterPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SmnSubscriptionFilterPolicyFilterPolicies | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._stringEquals !== undefined) { + hasAnyValues = true; + internalValueResult.stringEquals = this._stringEquals; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnSubscriptionFilterPolicyFilterPolicies | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._name = undefined; + this._stringEquals = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._name = value.name; + this._stringEquals = value.stringEquals; + } + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // string_equals - computed: false, optional: false, required: true + private _stringEquals?: string[]; + public get stringEquals() { + return cdktf.Fn.tolist(this.getListAttribute('string_equals')); + } + public set stringEquals(value: string[]) { + this._stringEquals = value; + } + // Temporarily expose input value. Use with caution. + public get stringEqualsInput() { + return this._stringEquals; + } +} + +export class SmnSubscriptionFilterPolicyFilterPoliciesList extends cdktf.ComplexList { + public internalValue? : SmnSubscriptionFilterPolicyFilterPolicies[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SmnSubscriptionFilterPolicyFilterPoliciesOutputReference { + return new SmnSubscriptionFilterPolicyFilterPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy huaweicloud_smn_subscription_filter_policy} +*/ +export class SmnSubscriptionFilterPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_subscription_filter_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnSubscriptionFilterPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnSubscriptionFilterPolicy to import + * @param importFromId The id of the existing SmnSubscriptionFilterPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnSubscriptionFilterPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_subscription_filter_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_filter_policy huaweicloud_smn_subscription_filter_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnSubscriptionFilterPolicyConfig + */ + public constructor(scope: Construct, id: string, config: SmnSubscriptionFilterPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_subscription_filter_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._enableForceNew = config.enableForceNew; + this._id = config.id; + this._region = config.region; + this._subscriptionUrn = config.subscriptionUrn; + this._filterPolicies.internalValue = config.filterPolicies; + } + + // ========== + // ATTRIBUTES + // ========== + + // enable_force_new - computed: false, optional: true, required: false + private _enableForceNew?: string; + public get enableForceNew() { + return this.getStringAttribute('enable_force_new'); + } + public set enableForceNew(value: string) { + this._enableForceNew = value; + } + public resetEnableForceNew() { + this._enableForceNew = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableForceNewInput() { + return this._enableForceNew; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subscription_urn - computed: false, optional: false, required: true + private _subscriptionUrn?: string; + public get subscriptionUrn() { + return this.getStringAttribute('subscription_urn'); + } + public set subscriptionUrn(value: string) { + this._subscriptionUrn = value; + } + // Temporarily expose input value. Use with caution. + public get subscriptionUrnInput() { + return this._subscriptionUrn; + } + + // filter_policies - computed: false, optional: false, required: true + private _filterPolicies = new SmnSubscriptionFilterPolicyFilterPoliciesList(this, "filter_policies", true); + public get filterPolicies() { + return this._filterPolicies; + } + public putFilterPolicies(value: SmnSubscriptionFilterPolicyFilterPolicies[] | cdktf.IResolvable) { + this._filterPolicies.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get filterPoliciesInput() { + return this._filterPolicies.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + enable_force_new: cdktf.stringToTerraform(this._enableForceNew), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + subscription_urn: cdktf.stringToTerraform(this._subscriptionUrn), + filter_policies: cdktf.listMapper(smnSubscriptionFilterPolicyFilterPoliciesToTerraform, true)(this._filterPolicies.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + enable_force_new: { + value: cdktf.stringToHclTerraform(this._enableForceNew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subscription_urn: { + value: cdktf.stringToHclTerraform(this._subscriptionUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + filter_policies: { + value: cdktf.listMapperHcl(smnSubscriptionFilterPolicyFilterPoliciesToHclTerraform, true)(this._filterPolicies.internalValue), + isBlock: true, + type: "set", + storageClassType: "SmnSubscriptionFilterPolicyFilterPoliciesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-subscription-v2/README.md b/src/constructs/providers/huaweicloud/smn-subscription-v2/README.md new file mode 100644 index 00000000..78f84105 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-subscription-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_subscription_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_subscription_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2). diff --git a/src/constructs/providers/huaweicloud/smn-subscription-v2/index.ts b/src/constructs/providers/huaweicloud/smn-subscription-v2/index.ts new file mode 100644 index 00000000..794f209e --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-subscription-v2/index.ts @@ -0,0 +1,561 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnSubscriptionV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#endpoint SmnSubscriptionV2#endpoint} + */ + readonly endpoint: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#id SmnSubscriptionV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#protocol SmnSubscriptionV2#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#region SmnSubscriptionV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#remark SmnSubscriptionV2#remark} + */ + readonly remark?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#topic_urn SmnSubscriptionV2#topic_urn} + */ + readonly topicUrn: string; + /** + * extension block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#extension SmnSubscriptionV2#extension} + */ + readonly extension?: SmnSubscriptionV2Extension; +} +export interface SmnSubscriptionV2FilterPolicies { +} + +export function smnSubscriptionV2FilterPoliciesToTerraform(struct?: SmnSubscriptionV2FilterPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function smnSubscriptionV2FilterPoliciesToHclTerraform(struct?: SmnSubscriptionV2FilterPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SmnSubscriptionV2FilterPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SmnSubscriptionV2FilterPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnSubscriptionV2FilterPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // string_equals - computed: true, optional: false, required: false + public get stringEquals() { + return this.getListAttribute('string_equals'); + } +} + +export class SmnSubscriptionV2FilterPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SmnSubscriptionV2FilterPoliciesOutputReference { + return new SmnSubscriptionV2FilterPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SmnSubscriptionV2Extension { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#client_id SmnSubscriptionV2#client_id} + */ + readonly clientId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#client_secret SmnSubscriptionV2#client_secret} + */ + readonly clientSecret?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#keyword SmnSubscriptionV2#keyword} + */ + readonly keyword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#sign_secret SmnSubscriptionV2#sign_secret} + */ + readonly signSecret?: string; +} + +export function smnSubscriptionV2ExtensionToTerraform(struct?: SmnSubscriptionV2ExtensionOutputReference | SmnSubscriptionV2Extension): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + client_id: cdktf.stringToTerraform(struct!.clientId), + client_secret: cdktf.stringToTerraform(struct!.clientSecret), + keyword: cdktf.stringToTerraform(struct!.keyword), + sign_secret: cdktf.stringToTerraform(struct!.signSecret), + } +} + + +export function smnSubscriptionV2ExtensionToHclTerraform(struct?: SmnSubscriptionV2ExtensionOutputReference | SmnSubscriptionV2Extension): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + client_id: { + value: cdktf.stringToHclTerraform(struct!.clientId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_secret: { + value: cdktf.stringToHclTerraform(struct!.clientSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keyword: { + value: cdktf.stringToHclTerraform(struct!.keyword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign_secret: { + value: cdktf.stringToHclTerraform(struct!.signSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmnSubscriptionV2ExtensionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SmnSubscriptionV2Extension | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clientId !== undefined) { + hasAnyValues = true; + internalValueResult.clientId = this._clientId; + } + if (this._clientSecret !== undefined) { + hasAnyValues = true; + internalValueResult.clientSecret = this._clientSecret; + } + if (this._keyword !== undefined) { + hasAnyValues = true; + internalValueResult.keyword = this._keyword; + } + if (this._signSecret !== undefined) { + hasAnyValues = true; + internalValueResult.signSecret = this._signSecret; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnSubscriptionV2Extension | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._clientId = undefined; + this._clientSecret = undefined; + this._keyword = undefined; + this._signSecret = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._clientId = value.clientId; + this._clientSecret = value.clientSecret; + this._keyword = value.keyword; + this._signSecret = value.signSecret; + } + } + + // client_id - computed: false, optional: true, required: false + private _clientId?: string; + public get clientId() { + return this.getStringAttribute('client_id'); + } + public set clientId(value: string) { + this._clientId = value; + } + public resetClientId() { + this._clientId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientIdInput() { + return this._clientId; + } + + // client_secret - computed: false, optional: true, required: false + private _clientSecret?: string; + public get clientSecret() { + return this.getStringAttribute('client_secret'); + } + public set clientSecret(value: string) { + this._clientSecret = value; + } + public resetClientSecret() { + this._clientSecret = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientSecretInput() { + return this._clientSecret; + } + + // keyword - computed: false, optional: true, required: false + private _keyword?: string; + public get keyword() { + return this.getStringAttribute('keyword'); + } + public set keyword(value: string) { + this._keyword = value; + } + public resetKeyword() { + this._keyword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordInput() { + return this._keyword; + } + + // sign_secret - computed: false, optional: true, required: false + private _signSecret?: string; + public get signSecret() { + return this.getStringAttribute('sign_secret'); + } + public set signSecret(value: string) { + this._signSecret = value; + } + public resetSignSecret() { + this._signSecret = undefined; + } + // Temporarily expose input value. Use with caution. + public get signSecretInput() { + return this._signSecret; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2 huaweicloud_smn_subscription_v2} +*/ +export class SmnSubscriptionV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_subscription_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnSubscriptionV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnSubscriptionV2 to import + * @param importFromId The id of the existing SmnSubscriptionV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnSubscriptionV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_subscription_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription_v2 huaweicloud_smn_subscription_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnSubscriptionV2Config + */ + public constructor(scope: Construct, id: string, config: SmnSubscriptionV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_subscription_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpoint = config.endpoint; + this._id = config.id; + this._protocol = config.protocol; + this._region = config.region; + this._remark = config.remark; + this._topicUrn = config.topicUrn; + this._extension.internalValue = config.extension; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint - computed: false, optional: false, required: true + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } + + // filter_policies - computed: true, optional: false, required: false + private _filterPolicies = new SmnSubscriptionV2FilterPoliciesList(this, "filter_policies", false); + public get filterPolicies() { + return this._filterPolicies; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remark - computed: false, optional: true, required: false + private _remark?: string; + public get remark() { + return this.getStringAttribute('remark'); + } + public set remark(value: string) { + this._remark = value; + } + public resetRemark() { + this._remark = undefined; + } + // Temporarily expose input value. Use with caution. + public get remarkInput() { + return this._remark; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subscription_urn - computed: true, optional: false, required: false + public get subscriptionUrn() { + return this.getStringAttribute('subscription_urn'); + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // extension - computed: false, optional: true, required: false + private _extension = new SmnSubscriptionV2ExtensionOutputReference(this, "extension"); + public get extension() { + return this._extension; + } + public putExtension(value: SmnSubscriptionV2Extension) { + this._extension.internalValue = value; + } + public resetExtension() { + this._extension.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionInput() { + return this._extension.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint: cdktf.stringToTerraform(this._endpoint), + id: cdktf.stringToTerraform(this._id), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + remark: cdktf.stringToTerraform(this._remark), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + extension: smnSubscriptionV2ExtensionToTerraform(this._extension.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint: { + value: cdktf.stringToHclTerraform(this._endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remark: { + value: cdktf.stringToHclTerraform(this._remark), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extension: { + value: smnSubscriptionV2ExtensionToHclTerraform(this._extension.internalValue), + isBlock: true, + type: "list", + storageClassType: "SmnSubscriptionV2ExtensionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-subscription/README.md b/src/constructs/providers/huaweicloud/smn-subscription/README.md new file mode 100644 index 00000000..c1346ad8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-subscription/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_subscription` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_subscription`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription). diff --git a/src/constructs/providers/huaweicloud/smn-subscription/index.ts b/src/constructs/providers/huaweicloud/smn-subscription/index.ts new file mode 100644 index 00000000..a353f3df --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-subscription/index.ts @@ -0,0 +1,561 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnSubscriptionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#endpoint SmnSubscription#endpoint} + */ + readonly endpoint: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#id SmnSubscription#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#protocol SmnSubscription#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#region SmnSubscription#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#remark SmnSubscription#remark} + */ + readonly remark?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#topic_urn SmnSubscription#topic_urn} + */ + readonly topicUrn: string; + /** + * extension block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#extension SmnSubscription#extension} + */ + readonly extension?: SmnSubscriptionExtension; +} +export interface SmnSubscriptionFilterPolicies { +} + +export function smnSubscriptionFilterPoliciesToTerraform(struct?: SmnSubscriptionFilterPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function smnSubscriptionFilterPoliciesToHclTerraform(struct?: SmnSubscriptionFilterPolicies): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SmnSubscriptionFilterPoliciesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SmnSubscriptionFilterPolicies | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnSubscriptionFilterPolicies | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // string_equals - computed: true, optional: false, required: false + public get stringEquals() { + return this.getListAttribute('string_equals'); + } +} + +export class SmnSubscriptionFilterPoliciesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SmnSubscriptionFilterPoliciesOutputReference { + return new SmnSubscriptionFilterPoliciesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SmnSubscriptionExtension { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#client_id SmnSubscription#client_id} + */ + readonly clientId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#client_secret SmnSubscription#client_secret} + */ + readonly clientSecret?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#keyword SmnSubscription#keyword} + */ + readonly keyword?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#sign_secret SmnSubscription#sign_secret} + */ + readonly signSecret?: string; +} + +export function smnSubscriptionExtensionToTerraform(struct?: SmnSubscriptionExtensionOutputReference | SmnSubscriptionExtension): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + client_id: cdktf.stringToTerraform(struct!.clientId), + client_secret: cdktf.stringToTerraform(struct!.clientSecret), + keyword: cdktf.stringToTerraform(struct!.keyword), + sign_secret: cdktf.stringToTerraform(struct!.signSecret), + } +} + + +export function smnSubscriptionExtensionToHclTerraform(struct?: SmnSubscriptionExtensionOutputReference | SmnSubscriptionExtension): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + client_id: { + value: cdktf.stringToHclTerraform(struct!.clientId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_secret: { + value: cdktf.stringToHclTerraform(struct!.clientSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keyword: { + value: cdktf.stringToHclTerraform(struct!.keyword), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sign_secret: { + value: cdktf.stringToHclTerraform(struct!.signSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmnSubscriptionExtensionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): SmnSubscriptionExtension | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._clientId !== undefined) { + hasAnyValues = true; + internalValueResult.clientId = this._clientId; + } + if (this._clientSecret !== undefined) { + hasAnyValues = true; + internalValueResult.clientSecret = this._clientSecret; + } + if (this._keyword !== undefined) { + hasAnyValues = true; + internalValueResult.keyword = this._keyword; + } + if (this._signSecret !== undefined) { + hasAnyValues = true; + internalValueResult.signSecret = this._signSecret; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmnSubscriptionExtension | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._clientId = undefined; + this._clientSecret = undefined; + this._keyword = undefined; + this._signSecret = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._clientId = value.clientId; + this._clientSecret = value.clientSecret; + this._keyword = value.keyword; + this._signSecret = value.signSecret; + } + } + + // client_id - computed: false, optional: true, required: false + private _clientId?: string; + public get clientId() { + return this.getStringAttribute('client_id'); + } + public set clientId(value: string) { + this._clientId = value; + } + public resetClientId() { + this._clientId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientIdInput() { + return this._clientId; + } + + // client_secret - computed: false, optional: true, required: false + private _clientSecret?: string; + public get clientSecret() { + return this.getStringAttribute('client_secret'); + } + public set clientSecret(value: string) { + this._clientSecret = value; + } + public resetClientSecret() { + this._clientSecret = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientSecretInput() { + return this._clientSecret; + } + + // keyword - computed: false, optional: true, required: false + private _keyword?: string; + public get keyword() { + return this.getStringAttribute('keyword'); + } + public set keyword(value: string) { + this._keyword = value; + } + public resetKeyword() { + this._keyword = undefined; + } + // Temporarily expose input value. Use with caution. + public get keywordInput() { + return this._keyword; + } + + // sign_secret - computed: false, optional: true, required: false + private _signSecret?: string; + public get signSecret() { + return this.getStringAttribute('sign_secret'); + } + public set signSecret(value: string) { + this._signSecret = value; + } + public resetSignSecret() { + this._signSecret = undefined; + } + // Temporarily expose input value. Use with caution. + public get signSecretInput() { + return this._signSecret; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription huaweicloud_smn_subscription} +*/ +export class SmnSubscription extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_subscription"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnSubscription resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnSubscription to import + * @param importFromId The id of the existing SmnSubscription that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnSubscription to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_subscription", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_subscription huaweicloud_smn_subscription} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnSubscriptionConfig + */ + public constructor(scope: Construct, id: string, config: SmnSubscriptionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_subscription', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpoint = config.endpoint; + this._id = config.id; + this._protocol = config.protocol; + this._region = config.region; + this._remark = config.remark; + this._topicUrn = config.topicUrn; + this._extension.internalValue = config.extension; + } + + // ========== + // ATTRIBUTES + // ========== + + // endpoint - computed: false, optional: false, required: true + private _endpoint?: string; + public get endpoint() { + return this.getStringAttribute('endpoint'); + } + public set endpoint(value: string) { + this._endpoint = value; + } + // Temporarily expose input value. Use with caution. + public get endpointInput() { + return this._endpoint; + } + + // filter_policies - computed: true, optional: false, required: false + private _filterPolicies = new SmnSubscriptionFilterPoliciesList(this, "filter_policies", false); + public get filterPolicies() { + return this._filterPolicies; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // owner - computed: true, optional: false, required: false + public get owner() { + return this.getStringAttribute('owner'); + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // remark - computed: false, optional: true, required: false + private _remark?: string; + public get remark() { + return this.getStringAttribute('remark'); + } + public set remark(value: string) { + this._remark = value; + } + public resetRemark() { + this._remark = undefined; + } + // Temporarily expose input value. Use with caution. + public get remarkInput() { + return this._remark; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // subscription_urn - computed: true, optional: false, required: false + public get subscriptionUrn() { + return this.getStringAttribute('subscription_urn'); + } + + // topic_urn - computed: false, optional: false, required: true + private _topicUrn?: string; + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + public set topicUrn(value: string) { + this._topicUrn = value; + } + // Temporarily expose input value. Use with caution. + public get topicUrnInput() { + return this._topicUrn; + } + + // extension - computed: false, optional: true, required: false + private _extension = new SmnSubscriptionExtensionOutputReference(this, "extension"); + public get extension() { + return this._extension; + } + public putExtension(value: SmnSubscriptionExtension) { + this._extension.internalValue = value; + } + public resetExtension() { + this._extension.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get extensionInput() { + return this._extension.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoint: cdktf.stringToTerraform(this._endpoint), + id: cdktf.stringToTerraform(this._id), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + remark: cdktf.stringToTerraform(this._remark), + topic_urn: cdktf.stringToTerraform(this._topicUrn), + extension: smnSubscriptionExtensionToTerraform(this._extension.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoint: { + value: cdktf.stringToHclTerraform(this._endpoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remark: { + value: cdktf.stringToHclTerraform(this._remark), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + topic_urn: { + value: cdktf.stringToHclTerraform(this._topicUrn), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extension: { + value: smnSubscriptionExtensionToHclTerraform(this._extension.internalValue), + isBlock: true, + type: "list", + storageClassType: "SmnSubscriptionExtensionList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-topic-v2/README.md b/src/constructs/providers/huaweicloud/smn-topic-v2/README.md new file mode 100644 index 00000000..d0a7a094 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-topic-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_topic_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_topic_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2). diff --git a/src/constructs/providers/huaweicloud/smn-topic-v2/index.ts b/src/constructs/providers/huaweicloud/smn-topic-v2/index.ts new file mode 100644 index 00000000..c9099a4c --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-topic-v2/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnTopicV2Config extends cdktf.TerraformMetaArguments { + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#access_policy SmnTopicV2#access_policy} + */ + readonly accessPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#display_name SmnTopicV2#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#enterprise_project_id SmnTopicV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#id SmnTopicV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#introduction SmnTopicV2#introduction} + */ + readonly introduction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#name SmnTopicV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#region SmnTopicV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#services_publish_allowed SmnTopicV2#services_publish_allowed} + */ + readonly servicesPublishAllowed?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#tags SmnTopicV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#users_publish_allowed SmnTopicV2#users_publish_allowed} + */ + readonly usersPublishAllowed?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2 huaweicloud_smn_topic_v2} +*/ +export class SmnTopicV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_topic_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnTopicV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnTopicV2 to import + * @param importFromId The id of the existing SmnTopicV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnTopicV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_topic_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic_v2 huaweicloud_smn_topic_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnTopicV2Config + */ + public constructor(scope: Construct, id: string, config: SmnTopicV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_topic_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessPolicy = config.accessPolicy; + this._displayName = config.displayName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._introduction = config.introduction; + this._name = config.name; + this._region = config.region; + this._servicesPublishAllowed = config.servicesPublishAllowed; + this._tags = config.tags; + this._usersPublishAllowed = config.usersPublishAllowed; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_policy - computed: false, optional: true, required: false + private _accessPolicy?: string; + public get accessPolicy() { + return this.getStringAttribute('access_policy'); + } + public set accessPolicy(value: string) { + this._accessPolicy = value; + } + public resetAccessPolicy() { + this._accessPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessPolicyInput() { + return this._accessPolicy; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // display_name - computed: false, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // introduction - computed: false, optional: true, required: false + private _introduction?: string; + public get introduction() { + return this.getStringAttribute('introduction'); + } + public set introduction(value: string) { + this._introduction = value; + } + public resetIntroduction() { + this._introduction = undefined; + } + // Temporarily expose input value. Use with caution. + public get introductionInput() { + return this._introduction; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // push_policy - computed: true, optional: false, required: false + public get pushPolicy() { + return this.getNumberAttribute('push_policy'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // services_publish_allowed - computed: false, optional: true, required: false + private _servicesPublishAllowed?: string; + public get servicesPublishAllowed() { + return this.getStringAttribute('services_publish_allowed'); + } + public set servicesPublishAllowed(value: string) { + this._servicesPublishAllowed = value; + } + public resetServicesPublishAllowed() { + this._servicesPublishAllowed = undefined; + } + // Temporarily expose input value. Use with caution. + public get servicesPublishAllowedInput() { + return this._servicesPublishAllowed; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // users_publish_allowed - computed: false, optional: true, required: false + private _usersPublishAllowed?: string; + public get usersPublishAllowed() { + return this.getStringAttribute('users_publish_allowed'); + } + public set usersPublishAllowed(value: string) { + this._usersPublishAllowed = value; + } + public resetUsersPublishAllowed() { + this._usersPublishAllowed = undefined; + } + // Temporarily expose input value. Use with caution. + public get usersPublishAllowedInput() { + return this._usersPublishAllowed; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_policy: cdktf.stringToTerraform(this._accessPolicy), + display_name: cdktf.stringToTerraform(this._displayName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + introduction: cdktf.stringToTerraform(this._introduction), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + services_publish_allowed: cdktf.stringToTerraform(this._servicesPublishAllowed), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + users_publish_allowed: cdktf.stringToTerraform(this._usersPublishAllowed), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_policy: { + value: cdktf.stringToHclTerraform(this._accessPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + introduction: { + value: cdktf.stringToHclTerraform(this._introduction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + services_publish_allowed: { + value: cdktf.stringToHclTerraform(this._servicesPublishAllowed), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + users_publish_allowed: { + value: cdktf.stringToHclTerraform(this._usersPublishAllowed), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/smn-topic/README.md b/src/constructs/providers/huaweicloud/smn-topic/README.md new file mode 100644 index 00000000..a85da432 --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-topic/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_smn_topic` + +Refer to the Terraform Registry for docs: [`huaweicloud_smn_topic`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic). diff --git a/src/constructs/providers/huaweicloud/smn-topic/index.ts b/src/constructs/providers/huaweicloud/smn-topic/index.ts new file mode 100644 index 00000000..0ff3f9ee --- /dev/null +++ b/src/constructs/providers/huaweicloud/smn-topic/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmnTopicConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Internal + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#access_policy SmnTopic#access_policy} + */ + readonly accessPolicy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#display_name SmnTopic#display_name} + */ + readonly displayName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#enterprise_project_id SmnTopic#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#id SmnTopic#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#introduction SmnTopic#introduction} + */ + readonly introduction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#name SmnTopic#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#region SmnTopic#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#services_publish_allowed SmnTopic#services_publish_allowed} + */ + readonly servicesPublishAllowed?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#tags SmnTopic#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#users_publish_allowed SmnTopic#users_publish_allowed} + */ + readonly usersPublishAllowed?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic huaweicloud_smn_topic} +*/ +export class SmnTopic extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_smn_topic"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmnTopic resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmnTopic to import + * @param importFromId The id of the existing SmnTopic that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmnTopic to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_smn_topic", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/smn_topic huaweicloud_smn_topic} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmnTopicConfig + */ + public constructor(scope: Construct, id: string, config: SmnTopicConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_smn_topic', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessPolicy = config.accessPolicy; + this._displayName = config.displayName; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._introduction = config.introduction; + this._name = config.name; + this._region = config.region; + this._servicesPublishAllowed = config.servicesPublishAllowed; + this._tags = config.tags; + this._usersPublishAllowed = config.usersPublishAllowed; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_policy - computed: false, optional: true, required: false + private _accessPolicy?: string; + public get accessPolicy() { + return this.getStringAttribute('access_policy'); + } + public set accessPolicy(value: string) { + this._accessPolicy = value; + } + public resetAccessPolicy() { + this._accessPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessPolicyInput() { + return this._accessPolicy; + } + + // create_time - computed: true, optional: false, required: false + public get createTime() { + return this.getStringAttribute('create_time'); + } + + // display_name - computed: false, optional: true, required: false + private _displayName?: string; + public get displayName() { + return this.getStringAttribute('display_name'); + } + public set displayName(value: string) { + this._displayName = value; + } + public resetDisplayName() { + this._displayName = undefined; + } + // Temporarily expose input value. Use with caution. + public get displayNameInput() { + return this._displayName; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // introduction - computed: false, optional: true, required: false + private _introduction?: string; + public get introduction() { + return this.getStringAttribute('introduction'); + } + public set introduction(value: string) { + this._introduction = value; + } + public resetIntroduction() { + this._introduction = undefined; + } + // Temporarily expose input value. Use with caution. + public get introductionInput() { + return this._introduction; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // push_policy - computed: true, optional: false, required: false + public get pushPolicy() { + return this.getNumberAttribute('push_policy'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // services_publish_allowed - computed: false, optional: true, required: false + private _servicesPublishAllowed?: string; + public get servicesPublishAllowed() { + return this.getStringAttribute('services_publish_allowed'); + } + public set servicesPublishAllowed(value: string) { + this._servicesPublishAllowed = value; + } + public resetServicesPublishAllowed() { + this._servicesPublishAllowed = undefined; + } + // Temporarily expose input value. Use with caution. + public get servicesPublishAllowedInput() { + return this._servicesPublishAllowed; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // topic_urn - computed: true, optional: false, required: false + public get topicUrn() { + return this.getStringAttribute('topic_urn'); + } + + // update_time - computed: true, optional: false, required: false + public get updateTime() { + return this.getStringAttribute('update_time'); + } + + // users_publish_allowed - computed: false, optional: true, required: false + private _usersPublishAllowed?: string; + public get usersPublishAllowed() { + return this.getStringAttribute('users_publish_allowed'); + } + public set usersPublishAllowed(value: string) { + this._usersPublishAllowed = value; + } + public resetUsersPublishAllowed() { + this._usersPublishAllowed = undefined; + } + // Temporarily expose input value. Use with caution. + public get usersPublishAllowedInput() { + return this._usersPublishAllowed; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_policy: cdktf.stringToTerraform(this._accessPolicy), + display_name: cdktf.stringToTerraform(this._displayName), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + introduction: cdktf.stringToTerraform(this._introduction), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + services_publish_allowed: cdktf.stringToTerraform(this._servicesPublishAllowed), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + users_publish_allowed: cdktf.stringToTerraform(this._usersPublishAllowed), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_policy: { + value: cdktf.stringToHclTerraform(this._accessPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + display_name: { + value: cdktf.stringToHclTerraform(this._displayName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + introduction: { + value: cdktf.stringToHclTerraform(this._introduction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + services_publish_allowed: { + value: cdktf.stringToHclTerraform(this._servicesPublishAllowed), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + users_publish_allowed: { + value: cdktf.stringToHclTerraform(this._usersPublishAllowed), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sms-server-template/README.md b/src/constructs/providers/huaweicloud/sms-server-template/README.md new file mode 100644 index 00000000..27db9cea --- /dev/null +++ b/src/constructs/providers/huaweicloud/sms-server-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sms_server_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_sms_server_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template). diff --git a/src/constructs/providers/huaweicloud/sms-server-template/index.ts b/src/constructs/providers/huaweicloud/sms-server-template/index.ts new file mode 100644 index 00000000..f3e44c6b --- /dev/null +++ b/src/constructs/providers/huaweicloud/sms-server-template/index.ts @@ -0,0 +1,613 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmsServerTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#availability_zone SmsServerTemplate#availability_zone} + */ + readonly availabilityZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#bandwidth_size SmsServerTemplate#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#flavor SmsServerTemplate#flavor} + */ + readonly flavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#id SmsServerTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#name SmsServerTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#project_id SmsServerTemplate#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#region SmsServerTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#security_group_ids SmsServerTemplate#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#subnet_ids SmsServerTemplate#subnet_ids} + */ + readonly subnetIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#target_server_name SmsServerTemplate#target_server_name} + */ + readonly targetServerName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#volume_type SmsServerTemplate#volume_type} + */ + readonly volumeType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#vpc_id SmsServerTemplate#vpc_id} + */ + readonly vpcId?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#timeouts SmsServerTemplate#timeouts} + */ + readonly timeouts?: SmsServerTemplateTimeouts; +} +export interface SmsServerTemplateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#create SmsServerTemplate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#delete SmsServerTemplate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#update SmsServerTemplate#update} + */ + readonly update?: string; +} + +export function smsServerTemplateTimeoutsToTerraform(struct?: SmsServerTemplateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function smsServerTemplateTimeoutsToHclTerraform(struct?: SmsServerTemplateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmsServerTemplateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SmsServerTemplateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmsServerTemplateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template huaweicloud_sms_server_template} +*/ +export class SmsServerTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sms_server_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmsServerTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmsServerTemplate to import + * @param importFromId The id of the existing SmsServerTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmsServerTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sms_server_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_server_template huaweicloud_sms_server_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmsServerTemplateConfig + */ + public constructor(scope: Construct, id: string, config: SmsServerTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sms_server_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._bandwidthSize = config.bandwidthSize; + this._flavor = config.flavor; + this._id = config.id; + this._name = config.name; + this._projectId = config.projectId; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._subnetIds = config.subnetIds; + this._targetServerName = config.targetServerName; + this._volumeType = config.volumeType; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: false, optional: false, required: true + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // bandwidth_size - computed: false, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // flavor - computed: false, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // subnet_ids - computed: true, optional: true, required: false + private _subnetIds?: string[]; + public get subnetIds() { + return this.getListAttribute('subnet_ids'); + } + public set subnetIds(value: string[]) { + this._subnetIds = value; + } + public resetSubnetIds() { + this._subnetIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdsInput() { + return this._subnetIds; + } + + // target_server_name - computed: true, optional: true, required: false + private _targetServerName?: string; + public get targetServerName() { + return this.getStringAttribute('target_server_name'); + } + public set targetServerName(value: string) { + this._targetServerName = value; + } + public resetTargetServerName() { + this._targetServerName = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetServerNameInput() { + return this._targetServerName; + } + + // volume_type - computed: false, optional: true, required: false + private _volumeType?: string; + public get volumeType() { + return this.getStringAttribute('volume_type'); + } + public set volumeType(value: string) { + this._volumeType = value; + } + public resetVolumeType() { + this._volumeType = undefined; + } + // Temporarily expose input value. Use with caution. + public get volumeTypeInput() { + return this._volumeType; + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // vpc_name - computed: true, optional: false, required: false + public get vpcName() { + return this.getStringAttribute('vpc_name'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SmsServerTemplateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SmsServerTemplateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + flavor: cdktf.stringToTerraform(this._flavor), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + subnet_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._subnetIds), + target_server_name: cdktf.stringToTerraform(this._targetServerName), + volume_type: cdktf.stringToTerraform(this._volumeType), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: smsServerTemplateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + subnet_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._subnetIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + target_server_name: { + value: cdktf.stringToHclTerraform(this._targetServerName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_type: { + value: cdktf.stringToHclTerraform(this._volumeType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: smsServerTemplateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SmsServerTemplateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/sms-task/README.md b/src/constructs/providers/huaweicloud/sms-task/README.md new file mode 100644 index 00000000..62786186 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sms-task/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_sms_task` + +Refer to the Terraform Registry for docs: [`huaweicloud_sms_task`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task). diff --git a/src/constructs/providers/huaweicloud/sms-task/index.ts b/src/constructs/providers/huaweicloud/sms-task/index.ts new file mode 100644 index 00000000..48186e65 --- /dev/null +++ b/src/constructs/providers/huaweicloud/sms-task/index.ts @@ -0,0 +1,1288 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SmsTaskConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#action SmsTask#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#id SmsTask#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#migration_ip SmsTask#migration_ip} + */ + readonly migrationIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#os_type SmsTask#os_type} + */ + readonly osType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#project_id SmsTask#project_id} + */ + readonly projectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#region SmsTask#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#source_server_id SmsTask#source_server_id} + */ + readonly sourceServerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#start_target_server SmsTask#start_target_server} + */ + readonly startTargetServer?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#syncing SmsTask#syncing} + */ + readonly syncing?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#target_server_id SmsTask#target_server_id} + */ + readonly targetServerId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#type SmsTask#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#use_public_ip SmsTask#use_public_ip} + */ + readonly usePublicIp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#vm_template_id SmsTask#vm_template_id} + */ + readonly vmTemplateId?: string; + /** + * target_server_disks block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#target_server_disks SmsTask#target_server_disks} + */ + readonly targetServerDisks?: SmsTaskTargetServerDisks[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#timeouts SmsTask#timeouts} + */ + readonly timeouts?: SmsTaskTimeouts; +} +export interface SmsTaskTargetServerDisksPhysicalVolumes { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#device_type SmsTask#device_type} + */ + readonly deviceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#file_system SmsTask#file_system} + */ + readonly fileSystem: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#index SmsTask#index} + */ + readonly index: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#mount_point SmsTask#mount_point} + */ + readonly mountPoint: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#name SmsTask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#size SmsTask#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#used_size SmsTask#used_size} + */ + readonly usedSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#uuid SmsTask#uuid} + */ + readonly uuid?: string; +} + +export function smsTaskTargetServerDisksPhysicalVolumesToTerraform(struct?: SmsTaskTargetServerDisksPhysicalVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + device_type: cdktf.stringToTerraform(struct!.deviceType), + file_system: cdktf.stringToTerraform(struct!.fileSystem), + index: cdktf.numberToTerraform(struct!.index), + mount_point: cdktf.stringToTerraform(struct!.mountPoint), + name: cdktf.stringToTerraform(struct!.name), + size: cdktf.numberToTerraform(struct!.size), + used_size: cdktf.numberToTerraform(struct!.usedSize), + uuid: cdktf.stringToTerraform(struct!.uuid), + } +} + + +export function smsTaskTargetServerDisksPhysicalVolumesToHclTerraform(struct?: SmsTaskTargetServerDisksPhysicalVolumes | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + device_type: { + value: cdktf.stringToHclTerraform(struct!.deviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_system: { + value: cdktf.stringToHclTerraform(struct!.fileSystem), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + index: { + value: cdktf.numberToHclTerraform(struct!.index), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mount_point: { + value: cdktf.stringToHclTerraform(struct!.mountPoint), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + used_size: { + value: cdktf.numberToHclTerraform(struct!.usedSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + uuid: { + value: cdktf.stringToHclTerraform(struct!.uuid), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmsTaskTargetServerDisksPhysicalVolumesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SmsTaskTargetServerDisksPhysicalVolumes | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._deviceType !== undefined) { + hasAnyValues = true; + internalValueResult.deviceType = this._deviceType; + } + if (this._fileSystem !== undefined) { + hasAnyValues = true; + internalValueResult.fileSystem = this._fileSystem; + } + if (this._index !== undefined) { + hasAnyValues = true; + internalValueResult.index = this._index; + } + if (this._mountPoint !== undefined) { + hasAnyValues = true; + internalValueResult.mountPoint = this._mountPoint; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._usedSize !== undefined) { + hasAnyValues = true; + internalValueResult.usedSize = this._usedSize; + } + if (this._uuid !== undefined) { + hasAnyValues = true; + internalValueResult.uuid = this._uuid; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmsTaskTargetServerDisksPhysicalVolumes | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._deviceType = undefined; + this._fileSystem = undefined; + this._index = undefined; + this._mountPoint = undefined; + this._name = undefined; + this._size = undefined; + this._usedSize = undefined; + this._uuid = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._deviceType = value.deviceType; + this._fileSystem = value.fileSystem; + this._index = value.index; + this._mountPoint = value.mountPoint; + this._name = value.name; + this._size = value.size; + this._usedSize = value.usedSize; + this._uuid = value.uuid; + } + } + + // device_type - computed: false, optional: false, required: true + private _deviceType?: string; + public get deviceType() { + return this.getStringAttribute('device_type'); + } + public set deviceType(value: string) { + this._deviceType = value; + } + // Temporarily expose input value. Use with caution. + public get deviceTypeInput() { + return this._deviceType; + } + + // file_system - computed: false, optional: false, required: true + private _fileSystem?: string; + public get fileSystem() { + return this.getStringAttribute('file_system'); + } + public set fileSystem(value: string) { + this._fileSystem = value; + } + // Temporarily expose input value. Use with caution. + public get fileSystemInput() { + return this._fileSystem; + } + + // index - computed: false, optional: false, required: true + private _index?: number; + public get index() { + return this.getNumberAttribute('index'); + } + public set index(value: number) { + this._index = value; + } + // Temporarily expose input value. Use with caution. + public get indexInput() { + return this._index; + } + + // mount_point - computed: false, optional: false, required: true + private _mountPoint?: string; + public get mountPoint() { + return this.getStringAttribute('mount_point'); + } + public set mountPoint(value: string) { + this._mountPoint = value; + } + // Temporarily expose input value. Use with caution. + public get mountPointInput() { + return this._mountPoint; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // used_size - computed: true, optional: true, required: false + private _usedSize?: number; + public get usedSize() { + return this.getNumberAttribute('used_size'); + } + public set usedSize(value: number) { + this._usedSize = value; + } + public resetUsedSize() { + this._usedSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get usedSizeInput() { + return this._usedSize; + } + + // uuid - computed: true, optional: true, required: false + private _uuid?: string; + public get uuid() { + return this.getStringAttribute('uuid'); + } + public set uuid(value: string) { + this._uuid = value; + } + public resetUuid() { + this._uuid = undefined; + } + // Temporarily expose input value. Use with caution. + public get uuidInput() { + return this._uuid; + } +} + +export class SmsTaskTargetServerDisksPhysicalVolumesList extends cdktf.ComplexList { + public internalValue? : SmsTaskTargetServerDisksPhysicalVolumes[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SmsTaskTargetServerDisksPhysicalVolumesOutputReference { + return new SmsTaskTargetServerDisksPhysicalVolumesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SmsTaskTargetServerDisks { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#device_type SmsTask#device_type} + */ + readonly deviceType: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#disk_id SmsTask#disk_id} + */ + readonly diskId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#name SmsTask#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#size SmsTask#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#used_size SmsTask#used_size} + */ + readonly usedSize?: number; + /** + * physical_volumes block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#physical_volumes SmsTask#physical_volumes} + */ + readonly physicalVolumes?: SmsTaskTargetServerDisksPhysicalVolumes[] | cdktf.IResolvable; +} + +export function smsTaskTargetServerDisksToTerraform(struct?: SmsTaskTargetServerDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + device_type: cdktf.stringToTerraform(struct!.deviceType), + disk_id: cdktf.stringToTerraform(struct!.diskId), + name: cdktf.stringToTerraform(struct!.name), + size: cdktf.numberToTerraform(struct!.size), + used_size: cdktf.numberToTerraform(struct!.usedSize), + physical_volumes: cdktf.listMapper(smsTaskTargetServerDisksPhysicalVolumesToTerraform, true)(struct!.physicalVolumes), + } +} + + +export function smsTaskTargetServerDisksToHclTerraform(struct?: SmsTaskTargetServerDisks | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + device_type: { + value: cdktf.stringToHclTerraform(struct!.deviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disk_id: { + value: cdktf.stringToHclTerraform(struct!.diskId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + used_size: { + value: cdktf.numberToHclTerraform(struct!.usedSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + physical_volumes: { + value: cdktf.listMapperHcl(smsTaskTargetServerDisksPhysicalVolumesToHclTerraform, true)(struct!.physicalVolumes), + isBlock: true, + type: "list", + storageClassType: "SmsTaskTargetServerDisksPhysicalVolumesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmsTaskTargetServerDisksOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SmsTaskTargetServerDisks | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._deviceType !== undefined) { + hasAnyValues = true; + internalValueResult.deviceType = this._deviceType; + } + if (this._diskId !== undefined) { + hasAnyValues = true; + internalValueResult.diskId = this._diskId; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._usedSize !== undefined) { + hasAnyValues = true; + internalValueResult.usedSize = this._usedSize; + } + if (this._physicalVolumes?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.physicalVolumes = this._physicalVolumes?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmsTaskTargetServerDisks | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._deviceType = undefined; + this._diskId = undefined; + this._name = undefined; + this._size = undefined; + this._usedSize = undefined; + this._physicalVolumes.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._deviceType = value.deviceType; + this._diskId = value.diskId; + this._name = value.name; + this._size = value.size; + this._usedSize = value.usedSize; + this._physicalVolumes.internalValue = value.physicalVolumes; + } + } + + // device_type - computed: false, optional: false, required: true + private _deviceType?: string; + public get deviceType() { + return this.getStringAttribute('device_type'); + } + public set deviceType(value: string) { + this._deviceType = value; + } + // Temporarily expose input value. Use with caution. + public get deviceTypeInput() { + return this._deviceType; + } + + // disk_id - computed: true, optional: true, required: false + private _diskId?: string; + public get diskId() { + return this.getStringAttribute('disk_id'); + } + public set diskId(value: string) { + this._diskId = value; + } + public resetDiskId() { + this._diskId = undefined; + } + // Temporarily expose input value. Use with caution. + public get diskIdInput() { + return this._diskId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // used_size - computed: true, optional: true, required: false + private _usedSize?: number; + public get usedSize() { + return this.getNumberAttribute('used_size'); + } + public set usedSize(value: number) { + this._usedSize = value; + } + public resetUsedSize() { + this._usedSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get usedSizeInput() { + return this._usedSize; + } + + // physical_volumes - computed: false, optional: true, required: false + private _physicalVolumes = new SmsTaskTargetServerDisksPhysicalVolumesList(this, "physical_volumes", false); + public get physicalVolumes() { + return this._physicalVolumes; + } + public putPhysicalVolumes(value: SmsTaskTargetServerDisksPhysicalVolumes[] | cdktf.IResolvable) { + this._physicalVolumes.internalValue = value; + } + public resetPhysicalVolumes() { + this._physicalVolumes.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get physicalVolumesInput() { + return this._physicalVolumes.internalValue; + } +} + +export class SmsTaskTargetServerDisksList extends cdktf.ComplexList { + public internalValue? : SmsTaskTargetServerDisks[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SmsTaskTargetServerDisksOutputReference { + return new SmsTaskTargetServerDisksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SmsTaskTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#create SmsTask#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#delete SmsTask#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#update SmsTask#update} + */ + readonly update?: string; +} + +export function smsTaskTimeoutsToTerraform(struct?: SmsTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function smsTaskTimeoutsToHclTerraform(struct?: SmsTaskTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SmsTaskTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SmsTaskTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SmsTaskTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task huaweicloud_sms_task} +*/ +export class SmsTask extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_sms_task"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SmsTask resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SmsTask to import + * @param importFromId The id of the existing SmsTask that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SmsTask to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_sms_task", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/sms_task huaweicloud_sms_task} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SmsTaskConfig + */ + public constructor(scope: Construct, id: string, config: SmsTaskConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_sms_task', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._id = config.id; + this._migrationIp = config.migrationIp; + this._osType = config.osType; + this._projectId = config.projectId; + this._region = config.region; + this._sourceServerId = config.sourceServerId; + this._startTargetServer = config.startTargetServer; + this._syncing = config.syncing; + this._targetServerId = config.targetServerId; + this._type = config.type; + this._usePublicIp = config.usePublicIp; + this._vmTemplateId = config.vmTemplateId; + this._targetServerDisks.internalValue = config.targetServerDisks; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // migrate_speed - computed: true, optional: false, required: false + public get migrateSpeed() { + return this.getNumberAttribute('migrate_speed'); + } + + // migration_ip - computed: false, optional: true, required: false + private _migrationIp?: string; + public get migrationIp() { + return this.getStringAttribute('migration_ip'); + } + public set migrationIp(value: string) { + this._migrationIp = value; + } + public resetMigrationIp() { + this._migrationIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get migrationIpInput() { + return this._migrationIp; + } + + // os_type - computed: false, optional: false, required: true + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // project_id - computed: true, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_server_id - computed: false, optional: false, required: true + private _sourceServerId?: string; + public get sourceServerId() { + return this.getStringAttribute('source_server_id'); + } + public set sourceServerId(value: string) { + this._sourceServerId = value; + } + // Temporarily expose input value. Use with caution. + public get sourceServerIdInput() { + return this._sourceServerId; + } + + // start_target_server - computed: false, optional: true, required: false + private _startTargetServer?: boolean | cdktf.IResolvable; + public get startTargetServer() { + return this.getBooleanAttribute('start_target_server'); + } + public set startTargetServer(value: boolean | cdktf.IResolvable) { + this._startTargetServer = value; + } + public resetStartTargetServer() { + this._startTargetServer = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTargetServerInput() { + return this._startTargetServer; + } + + // state - computed: true, optional: false, required: false + public get state() { + return this.getStringAttribute('state'); + } + + // syncing - computed: false, optional: true, required: false + private _syncing?: boolean | cdktf.IResolvable; + public get syncing() { + return this.getBooleanAttribute('syncing'); + } + public set syncing(value: boolean | cdktf.IResolvable) { + this._syncing = value; + } + public resetSyncing() { + this._syncing = undefined; + } + // Temporarily expose input value. Use with caution. + public get syncingInput() { + return this._syncing; + } + + // target_server_id - computed: true, optional: true, required: false + private _targetServerId?: string; + public get targetServerId() { + return this.getStringAttribute('target_server_id'); + } + public set targetServerId(value: string) { + this._targetServerId = value; + } + public resetTargetServerId() { + this._targetServerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetServerIdInput() { + return this._targetServerId; + } + + // target_server_name - computed: true, optional: false, required: false + public get targetServerName() { + return this.getStringAttribute('target_server_name'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // use_public_ip - computed: false, optional: true, required: false + private _usePublicIp?: boolean | cdktf.IResolvable; + public get usePublicIp() { + return this.getBooleanAttribute('use_public_ip'); + } + public set usePublicIp(value: boolean | cdktf.IResolvable) { + this._usePublicIp = value; + } + public resetUsePublicIp() { + this._usePublicIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get usePublicIpInput() { + return this._usePublicIp; + } + + // vm_template_id - computed: false, optional: true, required: false + private _vmTemplateId?: string; + public get vmTemplateId() { + return this.getStringAttribute('vm_template_id'); + } + public set vmTemplateId(value: string) { + this._vmTemplateId = value; + } + public resetVmTemplateId() { + this._vmTemplateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vmTemplateIdInput() { + return this._vmTemplateId; + } + + // target_server_disks - computed: false, optional: true, required: false + private _targetServerDisks = new SmsTaskTargetServerDisksList(this, "target_server_disks", false); + public get targetServerDisks() { + return this._targetServerDisks; + } + public putTargetServerDisks(value: SmsTaskTargetServerDisks[] | cdktf.IResolvable) { + this._targetServerDisks.internalValue = value; + } + public resetTargetServerDisks() { + this._targetServerDisks.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetServerDisksInput() { + return this._targetServerDisks.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SmsTaskTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SmsTaskTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + id: cdktf.stringToTerraform(this._id), + migration_ip: cdktf.stringToTerraform(this._migrationIp), + os_type: cdktf.stringToTerraform(this._osType), + project_id: cdktf.stringToTerraform(this._projectId), + region: cdktf.stringToTerraform(this._region), + source_server_id: cdktf.stringToTerraform(this._sourceServerId), + start_target_server: cdktf.booleanToTerraform(this._startTargetServer), + syncing: cdktf.booleanToTerraform(this._syncing), + target_server_id: cdktf.stringToTerraform(this._targetServerId), + type: cdktf.stringToTerraform(this._type), + use_public_ip: cdktf.booleanToTerraform(this._usePublicIp), + vm_template_id: cdktf.stringToTerraform(this._vmTemplateId), + target_server_disks: cdktf.listMapper(smsTaskTargetServerDisksToTerraform, true)(this._targetServerDisks.internalValue), + timeouts: smsTaskTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + migration_ip: { + value: cdktf.stringToHclTerraform(this._migrationIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_server_id: { + value: cdktf.stringToHclTerraform(this._sourceServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_target_server: { + value: cdktf.booleanToHclTerraform(this._startTargetServer), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + syncing: { + value: cdktf.booleanToHclTerraform(this._syncing), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + target_server_id: { + value: cdktf.stringToHclTerraform(this._targetServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + use_public_ip: { + value: cdktf.booleanToHclTerraform(this._usePublicIp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + vm_template_id: { + value: cdktf.stringToHclTerraform(this._vmTemplateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_server_disks: { + value: cdktf.listMapperHcl(smsTaskTargetServerDisksToHclTerraform, true)(this._targetServerDisks.internalValue), + isBlock: true, + type: "list", + storageClassType: "SmsTaskTargetServerDisksList", + }, + timeouts: { + value: smsTaskTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SmsTaskTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-image-auto-sync/README.md b/src/constructs/providers/huaweicloud/swr-image-auto-sync/README.md new file mode 100644 index 00000000..2b8da333 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-auto-sync/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_image_auto_sync` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_image_auto_sync`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync). diff --git a/src/constructs/providers/huaweicloud/swr-image-auto-sync/index.ts b/src/constructs/providers/huaweicloud/swr-image-auto-sync/index.ts new file mode 100644 index 00000000..97d65fbb --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-auto-sync/index.ts @@ -0,0 +1,292 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrImageAutoSyncConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#id SwrImageAutoSync#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#organization SwrImageAutoSync#organization} + */ + readonly organization: string; + /** + * Specifies whether to overwrite. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#override SwrImageAutoSync#override} + */ + readonly override?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#region SwrImageAutoSync#region} + */ + readonly region?: string; + /** + * Specifies the name of the repository. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#repository SwrImageAutoSync#repository} + */ + readonly repository: string; + /** + * Specifies the target organization name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#target_organization SwrImageAutoSync#target_organization} + */ + readonly targetOrganization: string; + /** + * Specifies the target region name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#target_region SwrImageAutoSync#target_region} + */ + readonly targetRegion: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync huaweicloud_swr_image_auto_sync} +*/ +export class SwrImageAutoSync extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_auto_sync"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrImageAutoSync resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrImageAutoSync to import + * @param importFromId The id of the existing SwrImageAutoSync that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrImageAutoSync to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_auto_sync", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_auto_sync huaweicloud_swr_image_auto_sync} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrImageAutoSyncConfig + */ + public constructor(scope: Construct, id: string, config: SwrImageAutoSyncConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_auto_sync', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._organization = config.organization; + this._override = config.override; + this._region = config.region; + this._repository = config.repository; + this._targetOrganization = config.targetOrganization; + this._targetRegion = config.targetRegion; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // override - computed: true, optional: true, required: false + private _override?: boolean | cdktf.IResolvable; + public get override() { + return this.getBooleanAttribute('override'); + } + public set override(value: boolean | cdktf.IResolvable) { + this._override = value; + } + public resetOverride() { + this._override = undefined; + } + // Temporarily expose input value. Use with caution. + public get overrideInput() { + return this._override; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // target_organization - computed: false, optional: false, required: true + private _targetOrganization?: string; + public get targetOrganization() { + return this.getStringAttribute('target_organization'); + } + public set targetOrganization(value: string) { + this._targetOrganization = value; + } + // Temporarily expose input value. Use with caution. + public get targetOrganizationInput() { + return this._targetOrganization; + } + + // target_region - computed: false, optional: false, required: true + private _targetRegion?: string; + public get targetRegion() { + return this.getStringAttribute('target_region'); + } + public set targetRegion(value: string) { + this._targetRegion = value; + } + // Temporarily expose input value. Use with caution. + public get targetRegionInput() { + return this._targetRegion; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + override: cdktf.booleanToTerraform(this._override), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + target_organization: cdktf.stringToTerraform(this._targetOrganization), + target_region: cdktf.stringToTerraform(this._targetRegion), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + override: { + value: cdktf.booleanToHclTerraform(this._override), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_organization: { + value: cdktf.stringToHclTerraform(this._targetOrganization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + target_region: { + value: cdktf.stringToHclTerraform(this._targetRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-image-permissions/README.md b/src/constructs/providers/huaweicloud/swr-image-permissions/README.md new file mode 100644 index 00000000..9f7b4b04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-permissions/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_image_permissions` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_image_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions). diff --git a/src/constructs/providers/huaweicloud/swr-image-permissions/index.ts b/src/constructs/providers/huaweicloud/swr-image-permissions/index.ts new file mode 100644 index 00000000..4ceddad2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-permissions/index.ts @@ -0,0 +1,498 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrImagePermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#id SwrImagePermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#organization SwrImagePermissions#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#region SwrImagePermissions#region} + */ + readonly region?: string; + /** + * Specifies the name of the repository. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#repository SwrImagePermissions#repository} + */ + readonly repository: string; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#users SwrImagePermissions#users} + */ + readonly users: SwrImagePermissionsUsers[] | cdktf.IResolvable; +} +export interface SwrImagePermissionsSelfPermission { +} + +export function swrImagePermissionsSelfPermissionToTerraform(struct?: SwrImagePermissionsSelfPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function swrImagePermissionsSelfPermissionToHclTerraform(struct?: SwrImagePermissionsSelfPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SwrImagePermissionsSelfPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SwrImagePermissionsSelfPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrImagePermissionsSelfPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // permission - computed: true, optional: false, required: false + public get permission() { + return this.getStringAttribute('permission'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class SwrImagePermissionsSelfPermissionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SwrImagePermissionsSelfPermissionOutputReference { + return new SwrImagePermissionsSelfPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SwrImagePermissionsUsers { + /** + * Specifies the user permission of the existing HuaweiCloud user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#permission SwrImagePermissions#permission} + */ + readonly permission: string; + /** + * Specifies the ID of the existing HuaweiCloud user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#user_id SwrImagePermissions#user_id} + */ + readonly userId: string; + /** + * Specifies the name of the existing HuaweiCloud user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#user_name SwrImagePermissions#user_name} + */ + readonly userName?: string; +} + +export function swrImagePermissionsUsersToTerraform(struct?: SwrImagePermissionsUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + permission: cdktf.stringToTerraform(struct!.permission), + user_id: cdktf.stringToTerraform(struct!.userId), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function swrImagePermissionsUsersToHclTerraform(struct?: SwrImagePermissionsUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + permission: { + value: cdktf.stringToHclTerraform(struct!.permission), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(struct!.userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrImagePermissionsUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SwrImagePermissionsUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._permission !== undefined) { + hasAnyValues = true; + internalValueResult.permission = this._permission; + } + if (this._userId !== undefined) { + hasAnyValues = true; + internalValueResult.userId = this._userId; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrImagePermissionsUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._permission = undefined; + this._userId = undefined; + this._userName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._permission = value.permission; + this._userId = value.userId; + this._userName = value.userName; + } + } + + // permission - computed: false, optional: false, required: true + private _permission?: string; + public get permission() { + return this.getStringAttribute('permission'); + } + public set permission(value: string) { + this._permission = value; + } + // Temporarily expose input value. Use with caution. + public get permissionInput() { + return this._permission; + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: true, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} + +export class SwrImagePermissionsUsersList extends cdktf.ComplexList { + public internalValue? : SwrImagePermissionsUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SwrImagePermissionsUsersOutputReference { + return new SwrImagePermissionsUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions huaweicloud_swr_image_permissions} +*/ +export class SwrImagePermissions extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrImagePermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrImagePermissions to import + * @param importFromId The id of the existing SwrImagePermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrImagePermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_permissions huaweicloud_swr_image_permissions} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrImagePermissionsConfig + */ + public constructor(scope: Construct, id: string, config: SwrImagePermissionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // self_permission - computed: true, optional: false, required: false + private _selfPermission = new SwrImagePermissionsSelfPermissionList(this, "self_permission", false); + public get selfPermission() { + return this._selfPermission; + } + + // users - computed: false, optional: false, required: true + private _users = new SwrImagePermissionsUsersList(this, "users", false); + public get users() { + return this._users; + } + public putUsers(value: SwrImagePermissionsUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + users: cdktf.listMapper(swrImagePermissionsUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.listMapperHcl(swrImagePermissionsUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "list", + storageClassType: "SwrImagePermissionsUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-image-retention-policy/README.md b/src/constructs/providers/huaweicloud/swr-image-retention-policy/README.md new file mode 100644 index 00000000..2eea2f1b --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-retention-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_image_retention_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_image_retention_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy). diff --git a/src/constructs/providers/huaweicloud/swr-image-retention-policy/index.ts b/src/constructs/providers/huaweicloud/swr-image-retention-policy/index.ts new file mode 100644 index 00000000..4a2e6a1d --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-retention-policy/index.ts @@ -0,0 +1,435 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrImageRetentionPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#id SwrImageRetentionPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the number of retention. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#number SwrImageRetentionPolicy#number} + */ + readonly number: number; + /** + * Specifies the name of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#organization SwrImageRetentionPolicy#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#region SwrImageRetentionPolicy#region} + */ + readonly region?: string; + /** + * Specifies the name of the repository. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#repository SwrImageRetentionPolicy#repository} + */ + readonly repository: string; + /** + * Specifies the retention policy type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#type SwrImageRetentionPolicy#type} + */ + readonly type: string; + /** + * tag_selectors block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#tag_selectors SwrImageRetentionPolicy#tag_selectors} + */ + readonly tagSelectors?: SwrImageRetentionPolicyTagSelectors[] | cdktf.IResolvable; +} +export interface SwrImageRetentionPolicyTagSelectors { + /** + * Specifies the Matching rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#kind SwrImageRetentionPolicy#kind} + */ + readonly kind?: string; + /** + * Specifies the Matching pattern. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#pattern SwrImageRetentionPolicy#pattern} + */ + readonly pattern?: string; +} + +export function swrImageRetentionPolicyTagSelectorsToTerraform(struct?: SwrImageRetentionPolicyTagSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + kind: cdktf.stringToTerraform(struct!.kind), + pattern: cdktf.stringToTerraform(struct!.pattern), + } +} + + +export function swrImageRetentionPolicyTagSelectorsToHclTerraform(struct?: SwrImageRetentionPolicyTagSelectors | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + kind: { + value: cdktf.stringToHclTerraform(struct!.kind), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pattern: { + value: cdktf.stringToHclTerraform(struct!.pattern), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrImageRetentionPolicyTagSelectorsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SwrImageRetentionPolicyTagSelectors | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._kind !== undefined) { + hasAnyValues = true; + internalValueResult.kind = this._kind; + } + if (this._pattern !== undefined) { + hasAnyValues = true; + internalValueResult.pattern = this._pattern; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrImageRetentionPolicyTagSelectors | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._kind = undefined; + this._pattern = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._kind = value.kind; + this._pattern = value.pattern; + } + } + + // kind - computed: true, optional: true, required: false + private _kind?: string; + public get kind() { + return this.getStringAttribute('kind'); + } + public set kind(value: string) { + this._kind = value; + } + public resetKind() { + this._kind = undefined; + } + // Temporarily expose input value. Use with caution. + public get kindInput() { + return this._kind; + } + + // pattern - computed: true, optional: true, required: false + private _pattern?: string; + public get pattern() { + return this.getStringAttribute('pattern'); + } + public set pattern(value: string) { + this._pattern = value; + } + public resetPattern() { + this._pattern = undefined; + } + // Temporarily expose input value. Use with caution. + public get patternInput() { + return this._pattern; + } +} + +export class SwrImageRetentionPolicyTagSelectorsList extends cdktf.ComplexList { + public internalValue? : SwrImageRetentionPolicyTagSelectors[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SwrImageRetentionPolicyTagSelectorsOutputReference { + return new SwrImageRetentionPolicyTagSelectorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy huaweicloud_swr_image_retention_policy} +*/ +export class SwrImageRetentionPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_retention_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrImageRetentionPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrImageRetentionPolicy to import + * @param importFromId The id of the existing SwrImageRetentionPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrImageRetentionPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_retention_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_retention_policy huaweicloud_swr_image_retention_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrImageRetentionPolicyConfig + */ + public constructor(scope: Construct, id: string, config: SwrImageRetentionPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_retention_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._number = config.number; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + this._type = config.type; + this._tagSelectors.internalValue = config.tagSelectors; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // number - computed: false, optional: false, required: true + private _number?: number; + public get number() { + return this.getNumberAttribute('number'); + } + public set number(value: number) { + this._number = value; + } + // Temporarily expose input value. Use with caution. + public get numberInput() { + return this._number; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // tag_selectors - computed: false, optional: true, required: false + private _tagSelectors = new SwrImageRetentionPolicyTagSelectorsList(this, "tag_selectors", false); + public get tagSelectors() { + return this._tagSelectors; + } + public putTagSelectors(value: SwrImageRetentionPolicyTagSelectors[] | cdktf.IResolvable) { + this._tagSelectors.internalValue = value; + } + public resetTagSelectors() { + this._tagSelectors.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagSelectorsInput() { + return this._tagSelectors.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + number: cdktf.numberToTerraform(this._number), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + type: cdktf.stringToTerraform(this._type), + tag_selectors: cdktf.listMapper(swrImageRetentionPolicyTagSelectorsToTerraform, true)(this._tagSelectors.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + number: { + value: cdktf.numberToHclTerraform(this._number), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tag_selectors: { + value: cdktf.listMapperHcl(swrImageRetentionPolicyTagSelectorsToHclTerraform, true)(this._tagSelectors.internalValue), + isBlock: true, + type: "list", + storageClassType: "SwrImageRetentionPolicyTagSelectorsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-image-trigger/README.md b/src/constructs/providers/huaweicloud/swr-image-trigger/README.md new file mode 100644 index 00000000..9bb535f5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-trigger/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_image_trigger` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_image_trigger`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger). diff --git a/src/constructs/providers/huaweicloud/swr-image-trigger/index.ts b/src/constructs/providers/huaweicloud/swr-image-trigger/index.ts new file mode 100644 index 00000000..fc2025bc --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-image-trigger/index.ts @@ -0,0 +1,520 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrImageTriggerConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#cluster_id SwrImageTrigger#cluster_id} + */ + readonly clusterId?: string; + /** + * Specifies the name of the cluster. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#cluster_name SwrImageTrigger#cluster_name} + */ + readonly clusterName?: string; + /** + * Specifies the trigger condition type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#condition_type SwrImageTrigger#condition_type} + */ + readonly conditionType: string; + /** + * Specifies the trigger condition value. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#condition_value SwrImageTrigger#condition_value} + */ + readonly conditionValue: string; + /** + * Specifies the name of the container to be updated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#container SwrImageTrigger#container} + */ + readonly container?: string; + /** + * Specifies whether to enable the trigger. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#enabled SwrImageTrigger#enabled} + */ + readonly enabled?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#id SwrImageTrigger#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the trigger name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#name SwrImageTrigger#name} + */ + readonly name: string; + /** + * Specifies the namespace where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#namespace SwrImageTrigger#namespace} + */ + readonly namespace: string; + /** + * Specifies the name of the organization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#organization SwrImageTrigger#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#region SwrImageTrigger#region} + */ + readonly region?: string; + /** + * Specifies the name of the repository. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#repository SwrImageTrigger#repository} + */ + readonly repository: string; + /** + * Specifies the trigger type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#type SwrImageTrigger#type} + */ + readonly type?: string; + /** + * Specifies the name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#workload_name SwrImageTrigger#workload_name} + */ + readonly workloadName: string; + /** + * Specifies the type of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#workload_type SwrImageTrigger#workload_type} + */ + readonly workloadType: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger huaweicloud_swr_image_trigger} +*/ +export class SwrImageTrigger extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_image_trigger"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrImageTrigger resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrImageTrigger to import + * @param importFromId The id of the existing SwrImageTrigger that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrImageTrigger to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_image_trigger", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_image_trigger huaweicloud_swr_image_trigger} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrImageTriggerConfig + */ + public constructor(scope: Construct, id: string, config: SwrImageTriggerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_image_trigger', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clusterId = config.clusterId; + this._clusterName = config.clusterName; + this._conditionType = config.conditionType; + this._conditionValue = config.conditionValue; + this._container = config.container; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._namespace = config.namespace; + this._organization = config.organization; + this._region = config.region; + this._repository = config.repository; + this._type = config.type; + this._workloadName = config.workloadName; + this._workloadType = config.workloadType; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_id - computed: true, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_name - computed: true, optional: true, required: false + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + public resetClusterName() { + this._clusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // condition_type - computed: false, optional: false, required: true + private _conditionType?: string; + public get conditionType() { + return this.getStringAttribute('condition_type'); + } + public set conditionType(value: string) { + this._conditionType = value; + } + // Temporarily expose input value. Use with caution. + public get conditionTypeInput() { + return this._conditionType; + } + + // condition_value - computed: false, optional: false, required: true + private _conditionValue?: string; + public get conditionValue() { + return this.getStringAttribute('condition_value'); + } + public set conditionValue(value: string) { + this._conditionValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionValueInput() { + return this._conditionValue; + } + + // container - computed: true, optional: true, required: false + private _container?: string; + public get container() { + return this.getStringAttribute('container'); + } + public set container(value: string) { + this._container = value; + } + public resetContainer() { + this._container = undefined; + } + // Temporarily expose input value. Use with caution. + public get containerInput() { + return this._container; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // creator_name - computed: true, optional: false, required: false + public get creatorName() { + return this.getStringAttribute('creator_name'); + } + + // enabled - computed: true, optional: true, required: false + private _enabled?: string; + public get enabled() { + return this.getStringAttribute('enabled'); + } + public set enabled(value: string) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // namespace - computed: false, optional: false, required: true + private _namespace?: string; + public get namespace() { + return this.getStringAttribute('namespace'); + } + public set namespace(value: string) { + this._namespace = value; + } + // Temporarily expose input value. Use with caution. + public get namespaceInput() { + return this._namespace; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // workload_name - computed: false, optional: false, required: true + private _workloadName?: string; + public get workloadName() { + return this.getStringAttribute('workload_name'); + } + public set workloadName(value: string) { + this._workloadName = value; + } + // Temporarily expose input value. Use with caution. + public get workloadNameInput() { + return this._workloadName; + } + + // workload_type - computed: false, optional: false, required: true + private _workloadType?: string; + public get workloadType() { + return this.getStringAttribute('workload_type'); + } + public set workloadType(value: string) { + this._workloadType = value; + } + // Temporarily expose input value. Use with caution. + public get workloadTypeInput() { + return this._workloadType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_name: cdktf.stringToTerraform(this._clusterName), + condition_type: cdktf.stringToTerraform(this._conditionType), + condition_value: cdktf.stringToTerraform(this._conditionValue), + container: cdktf.stringToTerraform(this._container), + enabled: cdktf.stringToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + namespace: cdktf.stringToTerraform(this._namespace), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + type: cdktf.stringToTerraform(this._type), + workload_name: cdktf.stringToTerraform(this._workloadName), + workload_type: cdktf.stringToTerraform(this._workloadType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition_type: { + value: cdktf.stringToHclTerraform(this._conditionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + condition_value: { + value: cdktf.stringToHclTerraform(this._conditionValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + container: { + value: cdktf.stringToHclTerraform(this._container), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.stringToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + namespace: { + value: cdktf.stringToHclTerraform(this._namespace), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workload_name: { + value: cdktf.stringToHclTerraform(this._workloadName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workload_type: { + value: cdktf.stringToHclTerraform(this._workloadType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-organization-permissions/README.md b/src/constructs/providers/huaweicloud/swr-organization-permissions/README.md new file mode 100644 index 00000000..a908a466 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-organization-permissions/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_organization_permissions` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_organization_permissions`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions). diff --git a/src/constructs/providers/huaweicloud/swr-organization-permissions/index.ts b/src/constructs/providers/huaweicloud/swr-organization-permissions/index.ts new file mode 100644 index 00000000..309eec8c --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-organization-permissions/index.ts @@ -0,0 +1,625 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrOrganizationPermissionsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#id SwrOrganizationPermissions#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#organization SwrOrganizationPermissions#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#region SwrOrganizationPermissions#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#timeouts SwrOrganizationPermissions#timeouts} + */ + readonly timeouts?: SwrOrganizationPermissionsTimeouts; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#users SwrOrganizationPermissions#users} + */ + readonly users: SwrOrganizationPermissionsUsers[] | cdktf.IResolvable; +} +export interface SwrOrganizationPermissionsSelfPermission { +} + +export function swrOrganizationPermissionsSelfPermissionToTerraform(struct?: SwrOrganizationPermissionsSelfPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function swrOrganizationPermissionsSelfPermissionToHclTerraform(struct?: SwrOrganizationPermissionsSelfPermission): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class SwrOrganizationPermissionsSelfPermissionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SwrOrganizationPermissionsSelfPermission | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrOrganizationPermissionsSelfPermission | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // permission - computed: true, optional: false, required: false + public get permission() { + return this.getStringAttribute('permission'); + } + + // user_id - computed: true, optional: false, required: false + public get userId() { + return this.getStringAttribute('user_id'); + } + + // user_name - computed: true, optional: false, required: false + public get userName() { + return this.getStringAttribute('user_name'); + } +} + +export class SwrOrganizationPermissionsSelfPermissionList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SwrOrganizationPermissionsSelfPermissionOutputReference { + return new SwrOrganizationPermissionsSelfPermissionOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface SwrOrganizationPermissionsTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#create SwrOrganizationPermissions#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#delete SwrOrganizationPermissions#delete} + */ + readonly delete?: string; +} + +export function swrOrganizationPermissionsTimeoutsToTerraform(struct?: SwrOrganizationPermissionsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function swrOrganizationPermissionsTimeoutsToHclTerraform(struct?: SwrOrganizationPermissionsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrOrganizationPermissionsTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SwrOrganizationPermissionsTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrOrganizationPermissionsTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} +export interface SwrOrganizationPermissionsUsers { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#permission SwrOrganizationPermissions#permission} + */ + readonly permission: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#user_id SwrOrganizationPermissions#user_id} + */ + readonly userId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#user_name SwrOrganizationPermissions#user_name} + */ + readonly userName?: string; +} + +export function swrOrganizationPermissionsUsersToTerraform(struct?: SwrOrganizationPermissionsUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + permission: cdktf.stringToTerraform(struct!.permission), + user_id: cdktf.stringToTerraform(struct!.userId), + user_name: cdktf.stringToTerraform(struct!.userName), + } +} + + +export function swrOrganizationPermissionsUsersToHclTerraform(struct?: SwrOrganizationPermissionsUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + permission: { + value: cdktf.stringToHclTerraform(struct!.permission), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_id: { + value: cdktf.stringToHclTerraform(struct!.userId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(struct!.userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrOrganizationPermissionsUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): SwrOrganizationPermissionsUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._permission !== undefined) { + hasAnyValues = true; + internalValueResult.permission = this._permission; + } + if (this._userId !== undefined) { + hasAnyValues = true; + internalValueResult.userId = this._userId; + } + if (this._userName !== undefined) { + hasAnyValues = true; + internalValueResult.userName = this._userName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrOrganizationPermissionsUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._permission = undefined; + this._userId = undefined; + this._userName = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._permission = value.permission; + this._userId = value.userId; + this._userName = value.userName; + } + } + + // permission - computed: false, optional: false, required: true + private _permission?: string; + public get permission() { + return this.getStringAttribute('permission'); + } + public set permission(value: string) { + this._permission = value; + } + // Temporarily expose input value. Use with caution. + public get permissionInput() { + return this._permission; + } + + // user_id - computed: false, optional: false, required: true + private _userId?: string; + public get userId() { + return this.getStringAttribute('user_id'); + } + public set userId(value: string) { + this._userId = value; + } + // Temporarily expose input value. Use with caution. + public get userIdInput() { + return this._userId; + } + + // user_name - computed: true, optional: true, required: false + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + public resetUserName() { + this._userName = undefined; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } +} + +export class SwrOrganizationPermissionsUsersList extends cdktf.ComplexList { + public internalValue? : SwrOrganizationPermissionsUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): SwrOrganizationPermissionsUsersOutputReference { + return new SwrOrganizationPermissionsUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions huaweicloud_swr_organization_permissions} +*/ +export class SwrOrganizationPermissions extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_organization_permissions"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrOrganizationPermissions resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrOrganizationPermissions to import + * @param importFromId The id of the existing SwrOrganizationPermissions that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrOrganizationPermissions to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_organization_permissions", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization_permissions huaweicloud_swr_organization_permissions} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrOrganizationPermissionsConfig + */ + public constructor(scope: Construct, id: string, config: SwrOrganizationPermissionsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_organization_permissions', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._organization = config.organization; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // self_permission - computed: true, optional: false, required: false + private _selfPermission = new SwrOrganizationPermissionsSelfPermissionList(this, "self_permission", false); + public get selfPermission() { + return this._selfPermission; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SwrOrganizationPermissionsTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SwrOrganizationPermissionsTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // users - computed: false, optional: false, required: true + private _users = new SwrOrganizationPermissionsUsersList(this, "users", false); + public get users() { + return this._users; + } + public putUsers(value: SwrOrganizationPermissionsUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + timeouts: swrOrganizationPermissionsTimeoutsToTerraform(this._timeouts.internalValue), + users: cdktf.listMapper(swrOrganizationPermissionsUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: swrOrganizationPermissionsTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SwrOrganizationPermissionsTimeouts", + }, + users: { + value: cdktf.listMapperHcl(swrOrganizationPermissionsUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "list", + storageClassType: "SwrOrganizationPermissionsUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-organization/README.md b/src/constructs/providers/huaweicloud/swr-organization/README.md new file mode 100644 index 00000000..69617b69 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-organization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_organization` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_organization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization). diff --git a/src/constructs/providers/huaweicloud/swr-organization/index.ts b/src/constructs/providers/huaweicloud/swr-organization/index.ts new file mode 100644 index 00000000..b6d44fb3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-organization/index.ts @@ -0,0 +1,341 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrOrganizationConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#id SwrOrganization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#name SwrOrganization#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#region SwrOrganization#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#timeouts SwrOrganization#timeouts} + */ + readonly timeouts?: SwrOrganizationTimeouts; +} +export interface SwrOrganizationTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#create SwrOrganization#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#delete SwrOrganization#delete} + */ + readonly delete?: string; +} + +export function swrOrganizationTimeoutsToTerraform(struct?: SwrOrganizationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function swrOrganizationTimeoutsToHclTerraform(struct?: SwrOrganizationTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrOrganizationTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SwrOrganizationTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrOrganizationTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization huaweicloud_swr_organization} +*/ +export class SwrOrganization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_organization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrOrganization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrOrganization to import + * @param importFromId The id of the existing SwrOrganization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrOrganization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_organization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_organization huaweicloud_swr_organization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrOrganizationConfig + */ + public constructor(scope: Construct, id: string, config: SwrOrganizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_organization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // creator - computed: true, optional: false, required: false + public get creator() { + return this.getStringAttribute('creator'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // login_server - computed: true, optional: false, required: false + public get loginServer() { + return this.getStringAttribute('login_server'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permission - computed: true, optional: false, required: false + public get permission() { + return this.getStringAttribute('permission'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SwrOrganizationTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SwrOrganizationTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + timeouts: swrOrganizationTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: swrOrganizationTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SwrOrganizationTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-repository-sharing/README.md b/src/constructs/providers/huaweicloud/swr-repository-sharing/README.md new file mode 100644 index 00000000..ea31e2f8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-repository-sharing/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_repository_sharing` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_repository_sharing`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing). diff --git a/src/constructs/providers/huaweicloud/swr-repository-sharing/index.ts b/src/constructs/providers/huaweicloud/swr-repository-sharing/index.ts new file mode 100644 index 00000000..74e92049 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-repository-sharing/index.ts @@ -0,0 +1,429 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrRepositorySharingConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#deadline SwrRepositorySharing#deadline} + */ + readonly deadline: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#description SwrRepositorySharing#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#id SwrRepositorySharing#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#organization SwrRepositorySharing#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#permission SwrRepositorySharing#permission} + */ + readonly permission?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#region SwrRepositorySharing#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#repository SwrRepositorySharing#repository} + */ + readonly repository: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#sharing_account SwrRepositorySharing#sharing_account} + */ + readonly sharingAccount: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#timeouts SwrRepositorySharing#timeouts} + */ + readonly timeouts?: SwrRepositorySharingTimeouts; +} +export interface SwrRepositorySharingTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#default SwrRepositorySharing#default} + */ + readonly default?: string; +} + +export function swrRepositorySharingTimeoutsToTerraform(struct?: SwrRepositorySharingTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + default: cdktf.stringToTerraform(struct!.default), + } +} + + +export function swrRepositorySharingTimeoutsToHclTerraform(struct?: SwrRepositorySharingTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + default: { + value: cdktf.stringToHclTerraform(struct!.default), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrRepositorySharingTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SwrRepositorySharingTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._default !== undefined) { + hasAnyValues = true; + internalValueResult.default = this._default; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrRepositorySharingTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._default = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._default = value.default; + } + } + + // default - computed: false, optional: true, required: false + private _default?: string; + public get default() { + return this.getStringAttribute('default'); + } + public set default(value: string) { + this._default = value; + } + public resetDefault() { + this._default = undefined; + } + // Temporarily expose input value. Use with caution. + public get defaultInput() { + return this._default; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing huaweicloud_swr_repository_sharing} +*/ +export class SwrRepositorySharing extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_repository_sharing"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrRepositorySharing resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrRepositorySharing to import + * @param importFromId The id of the existing SwrRepositorySharing that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrRepositorySharing to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_repository_sharing", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository_sharing huaweicloud_swr_repository_sharing} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrRepositorySharingConfig + */ + public constructor(scope: Construct, id: string, config: SwrRepositorySharingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_repository_sharing', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deadline = config.deadline; + this._description = config.description; + this._id = config.id; + this._organization = config.organization; + this._permission = config.permission; + this._region = config.region; + this._repository = config.repository; + this._sharingAccount = config.sharingAccount; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // deadline - computed: false, optional: false, required: true + private _deadline?: string; + public get deadline() { + return this.getStringAttribute('deadline'); + } + public set deadline(value: string) { + this._deadline = value; + } + // Temporarily expose input value. Use with caution. + public get deadlineInput() { + return this._deadline; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // permission - computed: false, optional: true, required: false + private _permission?: string; + public get permission() { + return this.getStringAttribute('permission'); + } + public set permission(value: string) { + this._permission = value; + } + public resetPermission() { + this._permission = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionInput() { + return this._permission; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository - computed: false, optional: false, required: true + private _repository?: string; + public get repository() { + return this.getStringAttribute('repository'); + } + public set repository(value: string) { + this._repository = value; + } + // Temporarily expose input value. Use with caution. + public get repositoryInput() { + return this._repository; + } + + // sharing_account - computed: false, optional: false, required: true + private _sharingAccount?: string; + public get sharingAccount() { + return this.getStringAttribute('sharing_account'); + } + public set sharingAccount(value: string) { + this._sharingAccount = value; + } + // Temporarily expose input value. Use with caution. + public get sharingAccountInput() { + return this._sharingAccount; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getBooleanAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SwrRepositorySharingTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SwrRepositorySharingTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + deadline: cdktf.stringToTerraform(this._deadline), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + organization: cdktf.stringToTerraform(this._organization), + permission: cdktf.stringToTerraform(this._permission), + region: cdktf.stringToTerraform(this._region), + repository: cdktf.stringToTerraform(this._repository), + sharing_account: cdktf.stringToTerraform(this._sharingAccount), + timeouts: swrRepositorySharingTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + deadline: { + value: cdktf.stringToHclTerraform(this._deadline), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permission: { + value: cdktf.stringToHclTerraform(this._permission), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + repository: { + value: cdktf.stringToHclTerraform(this._repository), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sharing_account: { + value: cdktf.stringToHclTerraform(this._sharingAccount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: swrRepositorySharingTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SwrRepositorySharingTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/swr-repository/README.md b/src/constructs/providers/huaweicloud/swr-repository/README.md new file mode 100644 index 00000000..44f7f07b --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-repository/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_swr_repository` + +Refer to the Terraform Registry for docs: [`huaweicloud_swr_repository`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository). diff --git a/src/constructs/providers/huaweicloud/swr-repository/index.ts b/src/constructs/providers/huaweicloud/swr-repository/index.ts new file mode 100644 index 00000000..05228c25 --- /dev/null +++ b/src/constructs/providers/huaweicloud/swr-repository/index.ts @@ -0,0 +1,493 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface SwrRepositoryConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#category SwrRepository#category} + */ + readonly category?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#description SwrRepository#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#id SwrRepository#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#is_public SwrRepository#is_public} + */ + readonly isPublic?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#name SwrRepository#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#organization SwrRepository#organization} + */ + readonly organization: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#region SwrRepository#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#timeouts SwrRepository#timeouts} + */ + readonly timeouts?: SwrRepositoryTimeouts; +} +export interface SwrRepositoryTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#create SwrRepository#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#delete SwrRepository#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#update SwrRepository#update} + */ + readonly update?: string; +} + +export function swrRepositoryTimeoutsToTerraform(struct?: SwrRepositoryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function swrRepositoryTimeoutsToHclTerraform(struct?: SwrRepositoryTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class SwrRepositoryTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): SwrRepositoryTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: SwrRepositoryTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository huaweicloud_swr_repository} +*/ +export class SwrRepository extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_swr_repository"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a SwrRepository resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the SwrRepository to import + * @param importFromId The id of the existing SwrRepository that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the SwrRepository to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_swr_repository", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/swr_repository huaweicloud_swr_repository} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options SwrRepositoryConfig + */ + public constructor(scope: Construct, id: string, config: SwrRepositoryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_swr_repository', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._description = config.description; + this._id = config.id; + this._isPublic = config.isPublic; + this._name = config.name; + this._organization = config.organization; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: true, required: false + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + public resetCategory() { + this._category = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // internal_path - computed: true, optional: false, required: false + public get internalPath() { + return this.getStringAttribute('internal_path'); + } + + // is_public - computed: false, optional: true, required: false + private _isPublic?: boolean | cdktf.IResolvable; + public get isPublic() { + return this.getBooleanAttribute('is_public'); + } + public set isPublic(value: boolean | cdktf.IResolvable) { + this._isPublic = value; + } + public resetIsPublic() { + this._isPublic = undefined; + } + // Temporarily expose input value. Use with caution. + public get isPublicInput() { + return this._isPublic; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // num_images - computed: true, optional: false, required: false + public get numImages() { + return this.getNumberAttribute('num_images'); + } + + // organization - computed: false, optional: false, required: true + private _organization?: string; + public get organization() { + return this.getStringAttribute('organization'); + } + public set organization(value: string) { + this._organization = value; + } + // Temporarily expose input value. Use with caution. + public get organizationInput() { + return this._organization; + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // repository_id - computed: true, optional: false, required: false + public get repositoryId() { + return this.getNumberAttribute('repository_id'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new SwrRepositoryTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: SwrRepositoryTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + is_public: cdktf.booleanToTerraform(this._isPublic), + name: cdktf.stringToTerraform(this._name), + organization: cdktf.stringToTerraform(this._organization), + region: cdktf.stringToTerraform(this._region), + timeouts: swrRepositoryTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_public: { + value: cdktf.booleanToHclTerraform(this._isPublic), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization: { + value: cdktf.stringToHclTerraform(this._organization), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: swrRepositoryTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "SwrRepositoryTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/tms-resource-tags/README.md b/src/constructs/providers/huaweicloud/tms-resource-tags/README.md new file mode 100644 index 00000000..106eb5d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/tms-resource-tags/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_tms_resource_tags` + +Refer to the Terraform Registry for docs: [`huaweicloud_tms_resource_tags`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags). diff --git a/src/constructs/providers/huaweicloud/tms-resource-tags/index.ts b/src/constructs/providers/huaweicloud/tms-resource-tags/index.ts new file mode 100644 index 00000000..d9da3ea6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/tms-resource-tags/index.ts @@ -0,0 +1,347 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface TmsResourceTagsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#id TmsResourceTags#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The project ID of the resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#project_id TmsResourceTags#project_id} + */ + readonly projectId?: string; + /** + * The resource tags for batch management. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#tags TmsResourceTags#tags} + */ + readonly tags: { [key: string]: string }; + /** + * resources block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#resources TmsResourceTags#resources} + */ + readonly resources: TmsResourceTagsResources[] | cdktf.IResolvable; +} +export interface TmsResourceTagsResources { + /** + * The resource ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#resource_id TmsResourceTags#resource_id} + */ + readonly resourceId: string; + /** + * The resource type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#resource_type TmsResourceTags#resource_type} + */ + readonly resourceType: string; +} + +export function tmsResourceTagsResourcesToTerraform(struct?: TmsResourceTagsResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_id: cdktf.stringToTerraform(struct!.resourceId), + resource_type: cdktf.stringToTerraform(struct!.resourceType), + } +} + + +export function tmsResourceTagsResourcesToHclTerraform(struct?: TmsResourceTagsResources | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_id: { + value: cdktf.stringToHclTerraform(struct!.resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(struct!.resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class TmsResourceTagsResourcesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): TmsResourceTagsResources | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceId !== undefined) { + hasAnyValues = true; + internalValueResult.resourceId = this._resourceId; + } + if (this._resourceType !== undefined) { + hasAnyValues = true; + internalValueResult.resourceType = this._resourceType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: TmsResourceTagsResources | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._resourceId = undefined; + this._resourceType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._resourceId = value.resourceId; + this._resourceType = value.resourceType; + } + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } +} + +export class TmsResourceTagsResourcesList extends cdktf.ComplexList { + public internalValue? : TmsResourceTagsResources[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): TmsResourceTagsResourcesOutputReference { + return new TmsResourceTagsResourcesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags huaweicloud_tms_resource_tags} +*/ +export class TmsResourceTags extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_tms_resource_tags"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a TmsResourceTags resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the TmsResourceTags to import + * @param importFromId The id of the existing TmsResourceTags that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the TmsResourceTags to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_tms_resource_tags", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_resource_tags huaweicloud_tms_resource_tags} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options TmsResourceTagsConfig + */ + public constructor(scope: Construct, id: string, config: TmsResourceTagsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_tms_resource_tags', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._projectId = config.projectId; + this._tags = config.tags; + this._resources.internalValue = config.resources; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // project_id - computed: false, optional: true, required: false + private _projectId?: string; + public get projectId() { + return this.getStringAttribute('project_id'); + } + public set projectId(value: string) { + this._projectId = value; + } + public resetProjectId() { + this._projectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get projectIdInput() { + return this._projectId; + } + + // tags - computed: false, optional: false, required: true + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // resources - computed: false, optional: false, required: true + private _resources = new TmsResourceTagsResourcesList(this, "resources", false); + public get resources() { + return this._resources; + } + public putResources(value: TmsResourceTagsResources[] | cdktf.IResolvable) { + this._resources.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + project_id: cdktf.stringToTerraform(this._projectId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + resources: cdktf.listMapper(tmsResourceTagsResourcesToTerraform, true)(this._resources.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + project_id: { + value: cdktf.stringToHclTerraform(this._projectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + resources: { + value: cdktf.listMapperHcl(tmsResourceTagsResourcesToHclTerraform, true)(this._resources.internalValue), + isBlock: true, + type: "list", + storageClassType: "TmsResourceTagsResourcesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/tms-tags/README.md b/src/constructs/providers/huaweicloud/tms-tags/README.md new file mode 100644 index 00000000..83ed12d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/tms-tags/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_tms_tags` + +Refer to the Terraform Registry for docs: [`huaweicloud_tms_tags`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags). diff --git a/src/constructs/providers/huaweicloud/tms-tags/index.ts b/src/constructs/providers/huaweicloud/tms-tags/index.ts new file mode 100644 index 00000000..a068b344 --- /dev/null +++ b/src/constructs/providers/huaweicloud/tms-tags/index.ts @@ -0,0 +1,443 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface TmsTagsConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#id TmsTags#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#tags TmsTags#tags} + */ + readonly tags: TmsTagsTags[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#timeouts TmsTags#timeouts} + */ + readonly timeouts?: TmsTagsTimeouts; +} +export interface TmsTagsTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#key TmsTags#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#value TmsTags#value} + */ + readonly value: string; +} + +export function tmsTagsTagsToTerraform(struct?: TmsTagsTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function tmsTagsTagsToHclTerraform(struct?: TmsTagsTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class TmsTagsTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): TmsTagsTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: TmsTagsTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class TmsTagsTagsList extends cdktf.ComplexList { + public internalValue? : TmsTagsTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): TmsTagsTagsOutputReference { + return new TmsTagsTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface TmsTagsTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#create TmsTags#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#delete TmsTags#delete} + */ + readonly delete?: string; +} + +export function tmsTagsTimeoutsToTerraform(struct?: TmsTagsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function tmsTagsTimeoutsToHclTerraform(struct?: TmsTagsTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class TmsTagsTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): TmsTagsTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: TmsTagsTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags huaweicloud_tms_tags} +*/ +export class TmsTags extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_tms_tags"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a TmsTags resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the TmsTags to import + * @param importFromId The id of the existing TmsTags that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the TmsTags to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_tms_tags", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/tms_tags huaweicloud_tms_tags} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options TmsTagsConfig + */ + public constructor(scope: Construct, id: string, config: TmsTagsConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_tms_tags', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._tags.internalValue = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // tags - computed: false, optional: false, required: true + private _tags = new TmsTagsTagsList(this, "tags", false); + public get tags() { + return this._tags; + } + public putTags(value: TmsTagsTags[] | cdktf.IResolvable) { + this._tags.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new TmsTagsTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: TmsTagsTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + tags: cdktf.listMapper(tmsTagsTagsToTerraform, true)(this._tags.internalValue), + timeouts: tmsTagsTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.listMapperHcl(tmsTagsTagsToHclTerraform, true)(this._tags.internalValue), + isBlock: true, + type: "list", + storageClassType: "TmsTagsTagsList", + }, + timeouts: { + value: tmsTagsTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "TmsTagsTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ucs-cluster/README.md b/src/constructs/providers/huaweicloud/ucs-cluster/README.md new file mode 100644 index 00000000..b6c9805a --- /dev/null +++ b/src/constructs/providers/huaweicloud/ucs-cluster/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ucs_cluster` + +Refer to the Terraform Registry for docs: [`huaweicloud_ucs_cluster`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster). diff --git a/src/constructs/providers/huaweicloud/ucs-cluster/index.ts b/src/constructs/providers/huaweicloud/ucs-cluster/index.ts new file mode 100644 index 00000000..0f7334bf --- /dev/null +++ b/src/constructs/providers/huaweicloud/ucs-cluster/index.ts @@ -0,0 +1,475 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface UcsClusterConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the name of the cluster to register. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#annotations UcsCluster#annotations} + */ + readonly annotations?: { [key: string]: string }; + /** + * Specifies the category of the cloud. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#category UcsCluster#category} + */ + readonly category: string; + /** + * Specifies the city name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#city UcsCluster#city} + */ + readonly city?: string; + /** + * Specifies the cluster id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#cluster_id UcsCluster#cluster_id} + */ + readonly clusterId?: string; + /** + * Specifies the labels of the cluster to register. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#cluster_labels UcsCluster#cluster_labels} + */ + readonly clusterLabels?: { [key: string]: string }; + /** + * Specifies the name of the cluster to register. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#cluster_name UcsCluster#cluster_name} + */ + readonly clusterName?: string; + /** + * Specifies the cluster project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#cluster_project_id UcsCluster#cluster_project_id} + */ + readonly clusterProjectId?: string; + /** + * Specifies the cluster region. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#cluster_region UcsCluster#cluster_region} + */ + readonly clusterRegion?: string; + /** + * Specifies the cluster type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#cluster_type UcsCluster#cluster_type} + */ + readonly clusterType: string; + /** + * Specifies the country name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#country UcsCluster#country} + */ + readonly country?: string; + /** + * Specifies ID of the fleet to add the cluster into. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#fleet_id UcsCluster#fleet_id} + */ + readonly fleetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#id UcsCluster#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the cloud service provider. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#service_provider UcsCluster#service_provider} + */ + readonly serviceProvider?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster huaweicloud_ucs_cluster} +*/ +export class UcsCluster extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ucs_cluster"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a UcsCluster resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the UcsCluster to import + * @param importFromId The id of the existing UcsCluster that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the UcsCluster to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ucs_cluster", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_cluster huaweicloud_ucs_cluster} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options UcsClusterConfig + */ + public constructor(scope: Construct, id: string, config: UcsClusterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ucs_cluster', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._annotations = config.annotations; + this._category = config.category; + this._city = config.city; + this._clusterId = config.clusterId; + this._clusterLabels = config.clusterLabels; + this._clusterName = config.clusterName; + this._clusterProjectId = config.clusterProjectId; + this._clusterRegion = config.clusterRegion; + this._clusterType = config.clusterType; + this._country = config.country; + this._fleetId = config.fleetId; + this._id = config.id; + this._serviceProvider = config.serviceProvider; + } + + // ========== + // ATTRIBUTES + // ========== + + // annotations - computed: false, optional: true, required: false + private _annotations?: { [key: string]: string }; + public get annotations() { + return this.getStringMapAttribute('annotations'); + } + public set annotations(value: { [key: string]: string }) { + this._annotations = value; + } + public resetAnnotations() { + this._annotations = undefined; + } + // Temporarily expose input value. Use with caution. + public get annotationsInput() { + return this._annotations; + } + + // category - computed: false, optional: false, required: true + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // city - computed: true, optional: true, required: false + private _city?: string; + public get city() { + return this.getStringAttribute('city'); + } + public set city(value: string) { + this._city = value; + } + public resetCity() { + this._city = undefined; + } + // Temporarily expose input value. Use with caution. + public get cityInput() { + return this._city; + } + + // cluster_id - computed: true, optional: true, required: false + private _clusterId?: string; + public get clusterId() { + return this.getStringAttribute('cluster_id'); + } + public set clusterId(value: string) { + this._clusterId = value; + } + public resetClusterId() { + this._clusterId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterIdInput() { + return this._clusterId; + } + + // cluster_labels - computed: true, optional: true, required: false + private _clusterLabels?: { [key: string]: string }; + public get clusterLabels() { + return this.getStringMapAttribute('cluster_labels'); + } + public set clusterLabels(value: { [key: string]: string }) { + this._clusterLabels = value; + } + public resetClusterLabels() { + this._clusterLabels = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterLabelsInput() { + return this._clusterLabels; + } + + // cluster_name - computed: true, optional: true, required: false + private _clusterName?: string; + public get clusterName() { + return this.getStringAttribute('cluster_name'); + } + public set clusterName(value: string) { + this._clusterName = value; + } + public resetClusterName() { + this._clusterName = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterNameInput() { + return this._clusterName; + } + + // cluster_project_id - computed: true, optional: true, required: false + private _clusterProjectId?: string; + public get clusterProjectId() { + return this.getStringAttribute('cluster_project_id'); + } + public set clusterProjectId(value: string) { + this._clusterProjectId = value; + } + public resetClusterProjectId() { + this._clusterProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterProjectIdInput() { + return this._clusterProjectId; + } + + // cluster_region - computed: true, optional: true, required: false + private _clusterRegion?: string; + public get clusterRegion() { + return this.getStringAttribute('cluster_region'); + } + public set clusterRegion(value: string) { + this._clusterRegion = value; + } + public resetClusterRegion() { + this._clusterRegion = undefined; + } + // Temporarily expose input value. Use with caution. + public get clusterRegionInput() { + return this._clusterRegion; + } + + // cluster_type - computed: false, optional: false, required: true + private _clusterType?: string; + public get clusterType() { + return this.getStringAttribute('cluster_type'); + } + public set clusterType(value: string) { + this._clusterType = value; + } + // Temporarily expose input value. Use with caution. + public get clusterTypeInput() { + return this._clusterType; + } + + // country - computed: true, optional: true, required: false + private _country?: string; + public get country() { + return this.getStringAttribute('country'); + } + public set country(value: string) { + this._country = value; + } + public resetCountry() { + this._country = undefined; + } + // Temporarily expose input value. Use with caution. + public get countryInput() { + return this._country; + } + + // fleet_id - computed: false, optional: true, required: false + private _fleetId?: string; + public get fleetId() { + return this.getStringAttribute('fleet_id'); + } + public set fleetId(value: string) { + this._fleetId = value; + } + public resetFleetId() { + this._fleetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get fleetIdInput() { + return this._fleetId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // manage_type - computed: true, optional: false, required: false + public get manageType() { + return this.getStringAttribute('manage_type'); + } + + // service_provider - computed: true, optional: true, required: false + private _serviceProvider?: string; + public get serviceProvider() { + return this.getStringAttribute('service_provider'); + } + public set serviceProvider(value: string) { + this._serviceProvider = value; + } + public resetServiceProvider() { + this._serviceProvider = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceProviderInput() { + return this._serviceProvider; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations), + category: cdktf.stringToTerraform(this._category), + city: cdktf.stringToTerraform(this._city), + cluster_id: cdktf.stringToTerraform(this._clusterId), + cluster_labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._clusterLabels), + cluster_name: cdktf.stringToTerraform(this._clusterName), + cluster_project_id: cdktf.stringToTerraform(this._clusterProjectId), + cluster_region: cdktf.stringToTerraform(this._clusterRegion), + cluster_type: cdktf.stringToTerraform(this._clusterType), + country: cdktf.stringToTerraform(this._country), + fleet_id: cdktf.stringToTerraform(this._fleetId), + id: cdktf.stringToTerraform(this._id), + service_provider: cdktf.stringToTerraform(this._serviceProvider), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + annotations: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + city: { + value: cdktf.stringToHclTerraform(this._city), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_id: { + value: cdktf.stringToHclTerraform(this._clusterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_labels: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._clusterLabels), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + cluster_name: { + value: cdktf.stringToHclTerraform(this._clusterName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_project_id: { + value: cdktf.stringToHclTerraform(this._clusterProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_region: { + value: cdktf.stringToHclTerraform(this._clusterRegion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cluster_type: { + value: cdktf.stringToHclTerraform(this._clusterType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + country: { + value: cdktf.stringToHclTerraform(this._country), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fleet_id: { + value: cdktf.stringToHclTerraform(this._fleetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_provider: { + value: cdktf.stringToHclTerraform(this._serviceProvider), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ucs-fleet/README.md b/src/constructs/providers/huaweicloud/ucs-fleet/README.md new file mode 100644 index 00000000..2e460521 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ucs-fleet/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ucs_fleet` + +Refer to the Terraform Registry for docs: [`huaweicloud_ucs_fleet`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet). diff --git a/src/constructs/providers/huaweicloud/ucs-fleet/index.ts b/src/constructs/providers/huaweicloud/ucs-fleet/index.ts new file mode 100644 index 00000000..0c6a034f --- /dev/null +++ b/src/constructs/providers/huaweicloud/ucs-fleet/index.ts @@ -0,0 +1,361 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface UcsFleetConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the UCS fleet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#description UcsFleet#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#id UcsFleet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the UCS fleet. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#name UcsFleet#name} + */ + readonly name: string; + /** + * permissions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#permissions UcsFleet#permissions} + */ + readonly permissions?: UcsFleetPermissions[] | cdktf.IResolvable; +} +export interface UcsFleetPermissions { + /** + * Specifies the namespaces. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#namespaces UcsFleet#namespaces} + */ + readonly namespaces?: string[]; + /** + * Specifies the policy IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#policy_ids UcsFleet#policy_ids} + */ + readonly policyIds?: string[]; +} + +export function ucsFleetPermissionsToTerraform(struct?: UcsFleetPermissions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + namespaces: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.namespaces), + policy_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.policyIds), + } +} + + +export function ucsFleetPermissionsToHclTerraform(struct?: UcsFleetPermissions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + namespaces: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.namespaces), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + policy_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.policyIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class UcsFleetPermissionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): UcsFleetPermissions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._namespaces !== undefined) { + hasAnyValues = true; + internalValueResult.namespaces = this._namespaces; + } + if (this._policyIds !== undefined) { + hasAnyValues = true; + internalValueResult.policyIds = this._policyIds; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: UcsFleetPermissions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._namespaces = undefined; + this._policyIds = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._namespaces = value.namespaces; + this._policyIds = value.policyIds; + } + } + + // namespaces - computed: false, optional: true, required: false + private _namespaces?: string[]; + public get namespaces() { + return this.getListAttribute('namespaces'); + } + public set namespaces(value: string[]) { + this._namespaces = value; + } + public resetNamespaces() { + this._namespaces = undefined; + } + // Temporarily expose input value. Use with caution. + public get namespacesInput() { + return this._namespaces; + } + + // policy_ids - computed: false, optional: true, required: false + private _policyIds?: string[]; + public get policyIds() { + return this.getListAttribute('policy_ids'); + } + public set policyIds(value: string[]) { + this._policyIds = value; + } + public resetPolicyIds() { + this._policyIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdsInput() { + return this._policyIds; + } +} + +export class UcsFleetPermissionsList extends cdktf.ComplexList { + public internalValue? : UcsFleetPermissions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): UcsFleetPermissionsOutputReference { + return new UcsFleetPermissionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet huaweicloud_ucs_fleet} +*/ +export class UcsFleet extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ucs_fleet"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a UcsFleet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the UcsFleet to import + * @param importFromId The id of the existing UcsFleet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the UcsFleet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ucs_fleet", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_fleet huaweicloud_ucs_fleet} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options UcsFleetConfig + */ + public constructor(scope: Construct, id: string, config: UcsFleetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ucs_fleet', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._permissions.internalValue = config.permissions; + } + + // ========== + // ATTRIBUTES + // ========== + + // cluster_ids - computed: true, optional: false, required: false + public get clusterIds() { + return this.getListAttribute('cluster_ids'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // permissions - computed: false, optional: true, required: false + private _permissions = new UcsFleetPermissionsList(this, "permissions", false); + public get permissions() { + return this._permissions; + } + public putPermissions(value: UcsFleetPermissions[] | cdktf.IResolvable) { + this._permissions.internalValue = value; + } + public resetPermissions() { + this._permissions.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionsInput() { + return this._permissions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + permissions: cdktf.listMapper(ucsFleetPermissionsToTerraform, true)(this._permissions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + permissions: { + value: cdktf.listMapperHcl(ucsFleetPermissionsToHclTerraform, true)(this._permissions.internalValue), + isBlock: true, + type: "list", + storageClassType: "UcsFleetPermissionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/ucs-policy/README.md b/src/constructs/providers/huaweicloud/ucs-policy/README.md new file mode 100644 index 00000000..f03911c0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/ucs-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_ucs_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_ucs_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy). diff --git a/src/constructs/providers/huaweicloud/ucs-policy/index.ts b/src/constructs/providers/huaweicloud/ucs-policy/index.ts new file mode 100644 index 00000000..ca9cd43c --- /dev/null +++ b/src/constructs/providers/huaweicloud/ucs-policy/index.ts @@ -0,0 +1,420 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface UcsPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the UCS policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#description UcsPolicy#description} + */ + readonly description?: string; + /** + * Specifies the list of iam user IDs to associate to the policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#iam_user_ids UcsPolicy#iam_user_ids} + */ + readonly iamUserIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#id UcsPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the UCS policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#name UcsPolicy#name} + */ + readonly name: string; + /** + * Specifies the type of the UCS policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#type UcsPolicy#type} + */ + readonly type: string; + /** + * details block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#details UcsPolicy#details} + */ + readonly details?: UcsPolicyDetails[] | cdktf.IResolvable; +} +export interface UcsPolicyDetails { + /** + * Specifies the list of operations. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#operations UcsPolicy#operations} + */ + readonly operations?: string[]; + /** + * Specifies the list of resources. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#resources UcsPolicy#resources} + */ + readonly resources?: string[]; +} + +export function ucsPolicyDetailsToTerraform(struct?: UcsPolicyDetails | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + operations: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.operations), + resources: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.resources), + } +} + + +export function ucsPolicyDetailsToHclTerraform(struct?: UcsPolicyDetails | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + operations: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.operations), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + resources: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.resources), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class UcsPolicyDetailsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): UcsPolicyDetails | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._operations !== undefined) { + hasAnyValues = true; + internalValueResult.operations = this._operations; + } + if (this._resources !== undefined) { + hasAnyValues = true; + internalValueResult.resources = this._resources; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: UcsPolicyDetails | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._operations = undefined; + this._resources = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._operations = value.operations; + this._resources = value.resources; + } + } + + // operations - computed: true, optional: true, required: false + private _operations?: string[]; + public get operations() { + return this.getListAttribute('operations'); + } + public set operations(value: string[]) { + this._operations = value; + } + public resetOperations() { + this._operations = undefined; + } + // Temporarily expose input value. Use with caution. + public get operationsInput() { + return this._operations; + } + + // resources - computed: true, optional: true, required: false + private _resources?: string[]; + public get resources() { + return this.getListAttribute('resources'); + } + public set resources(value: string[]) { + this._resources = value; + } + public resetResources() { + this._resources = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources; + } +} + +export class UcsPolicyDetailsList extends cdktf.ComplexList { + public internalValue? : UcsPolicyDetails[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): UcsPolicyDetailsOutputReference { + return new UcsPolicyDetailsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy huaweicloud_ucs_policy} +*/ +export class UcsPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_ucs_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a UcsPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the UcsPolicy to import + * @param importFromId The id of the existing UcsPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the UcsPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_ucs_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/ucs_policy huaweicloud_ucs_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options UcsPolicyConfig + */ + public constructor(scope: Construct, id: string, config: UcsPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_ucs_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._iamUserIds = config.iamUserIds; + this._id = config.id; + this._name = config.name; + this._type = config.type; + this._details.internalValue = config.details; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // iam_user_ids - computed: false, optional: false, required: true + private _iamUserIds?: string[]; + public get iamUserIds() { + return this.getListAttribute('iam_user_ids'); + } + public set iamUserIds(value: string[]) { + this._iamUserIds = value; + } + // Temporarily expose input value. Use with caution. + public get iamUserIdsInput() { + return this._iamUserIds; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // details - computed: false, optional: true, required: false + private _details = new UcsPolicyDetailsList(this, "details", false); + public get details() { + return this._details; + } + public putDetails(value: UcsPolicyDetails[] | cdktf.IResolvable) { + this._details.internalValue = value; + } + public resetDetails() { + this._details.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get detailsInput() { + return this._details.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + iam_user_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._iamUserIds), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + type: cdktf.stringToTerraform(this._type), + details: cdktf.listMapper(ucsPolicyDetailsToTerraform, true)(this._details.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + iam_user_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._iamUserIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + details: { + value: cdktf.listMapperHcl(ucsPolicyDetailsToHclTerraform, true)(this._details.internalValue), + isBlock: true, + type: "list", + storageClassType: "UcsPolicyDetailsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vbs-backup-policy-v2/README.md b/src/constructs/providers/huaweicloud/vbs-backup-policy-v2/README.md new file mode 100644 index 00000000..82990a53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup-policy-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vbs_backup_policy_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vbs_backup_policy_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2). diff --git a/src/constructs/providers/huaweicloud/vbs-backup-policy-v2/index.ts b/src/constructs/providers/huaweicloud/vbs-backup-policy-v2/index.ts new file mode 100644 index 00000000..8c3ad7cd --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup-policy-v2/index.ts @@ -0,0 +1,722 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VbsBackupPolicyV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#frequency VbsBackupPolicyV2#frequency} + */ + readonly frequency?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#id VbsBackupPolicyV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#name VbsBackupPolicyV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#region VbsBackupPolicyV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#rentention_day VbsBackupPolicyV2#rentention_day} + */ + readonly rententionDay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#rentention_num VbsBackupPolicyV2#rentention_num} + */ + readonly rententionNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#resources VbsBackupPolicyV2#resources} + */ + readonly resources?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#retain_first_backup VbsBackupPolicyV2#retain_first_backup} + */ + readonly retainFirstBackup: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#start_time VbsBackupPolicyV2#start_time} + */ + readonly startTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#status VbsBackupPolicyV2#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#week_frequency VbsBackupPolicyV2#week_frequency} + */ + readonly weekFrequency?: string[]; + /** + * tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#tags VbsBackupPolicyV2#tags} + */ + readonly tags?: VbsBackupPolicyV2Tags[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#timeouts VbsBackupPolicyV2#timeouts} + */ + readonly timeouts?: VbsBackupPolicyV2Timeouts; +} +export interface VbsBackupPolicyV2Tags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#key VbsBackupPolicyV2#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#value VbsBackupPolicyV2#value} + */ + readonly value: string; +} + +export function vbsBackupPolicyV2TagsToTerraform(struct?: VbsBackupPolicyV2Tags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function vbsBackupPolicyV2TagsToHclTerraform(struct?: VbsBackupPolicyV2Tags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupPolicyV2TagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VbsBackupPolicyV2Tags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupPolicyV2Tags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VbsBackupPolicyV2TagsList extends cdktf.ComplexList { + public internalValue? : VbsBackupPolicyV2Tags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VbsBackupPolicyV2TagsOutputReference { + return new VbsBackupPolicyV2TagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VbsBackupPolicyV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#create VbsBackupPolicyV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#delete VbsBackupPolicyV2#delete} + */ + readonly delete?: string; +} + +export function vbsBackupPolicyV2TimeoutsToTerraform(struct?: VbsBackupPolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vbsBackupPolicyV2TimeoutsToHclTerraform(struct?: VbsBackupPolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupPolicyV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VbsBackupPolicyV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupPolicyV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2 huaweicloud_vbs_backup_policy_v2} +*/ +export class VbsBackupPolicyV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup_policy_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VbsBackupPolicyV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VbsBackupPolicyV2 to import + * @param importFromId The id of the existing VbsBackupPolicyV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VbsBackupPolicyV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup_policy_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy_v2 huaweicloud_vbs_backup_policy_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VbsBackupPolicyV2Config + */ + public constructor(scope: Construct, id: string, config: VbsBackupPolicyV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup_policy_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._frequency = config.frequency; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._rententionDay = config.rententionDay; + this._rententionNum = config.rententionNum; + this._resources = config.resources; + this._retainFirstBackup = config.retainFirstBackup; + this._startTime = config.startTime; + this._status = config.status; + this._weekFrequency = config.weekFrequency; + this._tags.internalValue = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // frequency - computed: false, optional: true, required: false + private _frequency?: number; + public get frequency() { + return this.getNumberAttribute('frequency'); + } + public set frequency(value: number) { + this._frequency = value; + } + public resetFrequency() { + this._frequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_resource_count - computed: true, optional: false, required: false + public get policyResourceCount() { + return this.getNumberAttribute('policy_resource_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rentention_day - computed: false, optional: true, required: false + private _rententionDay?: number; + public get rententionDay() { + return this.getNumberAttribute('rentention_day'); + } + public set rententionDay(value: number) { + this._rententionDay = value; + } + public resetRententionDay() { + this._rententionDay = undefined; + } + // Temporarily expose input value. Use with caution. + public get rententionDayInput() { + return this._rententionDay; + } + + // rentention_num - computed: false, optional: true, required: false + private _rententionNum?: number; + public get rententionNum() { + return this.getNumberAttribute('rentention_num'); + } + public set rententionNum(value: number) { + this._rententionNum = value; + } + public resetRententionNum() { + this._rententionNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get rententionNumInput() { + return this._rententionNum; + } + + // resources - computed: false, optional: true, required: false + private _resources?: string[]; + public get resources() { + return this.getListAttribute('resources'); + } + public set resources(value: string[]) { + this._resources = value; + } + public resetResources() { + this._resources = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources; + } + + // retain_first_backup - computed: false, optional: false, required: true + private _retainFirstBackup?: string; + public get retainFirstBackup() { + return this.getStringAttribute('retain_first_backup'); + } + public set retainFirstBackup(value: string) { + this._retainFirstBackup = value; + } + // Temporarily expose input value. Use with caution. + public get retainFirstBackupInput() { + return this._retainFirstBackup; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // week_frequency - computed: false, optional: true, required: false + private _weekFrequency?: string[]; + public get weekFrequency() { + return this.getListAttribute('week_frequency'); + } + public set weekFrequency(value: string[]) { + this._weekFrequency = value; + } + public resetWeekFrequency() { + this._weekFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get weekFrequencyInput() { + return this._weekFrequency; + } + + // tags - computed: false, optional: true, required: false + private _tags = new VbsBackupPolicyV2TagsList(this, "tags", true); + public get tags() { + return this._tags; + } + public putTags(value: VbsBackupPolicyV2Tags[] | cdktf.IResolvable) { + this._tags.internalValue = value; + } + public resetTags() { + this._tags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VbsBackupPolicyV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VbsBackupPolicyV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + frequency: cdktf.numberToTerraform(this._frequency), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rentention_day: cdktf.numberToTerraform(this._rententionDay), + rentention_num: cdktf.numberToTerraform(this._rententionNum), + resources: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resources), + retain_first_backup: cdktf.stringToTerraform(this._retainFirstBackup), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + week_frequency: cdktf.listMapper(cdktf.stringToTerraform, false)(this._weekFrequency), + tags: cdktf.listMapper(vbsBackupPolicyV2TagsToTerraform, true)(this._tags.internalValue), + timeouts: vbsBackupPolicyV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + frequency: { + value: cdktf.numberToHclTerraform(this._frequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rentention_day: { + value: cdktf.numberToHclTerraform(this._rententionDay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rentention_num: { + value: cdktf.numberToHclTerraform(this._rententionNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + resources: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resources), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + retain_first_backup: { + value: cdktf.stringToHclTerraform(this._retainFirstBackup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + week_frequency: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._weekFrequency), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tags: { + value: cdktf.listMapperHcl(vbsBackupPolicyV2TagsToHclTerraform, true)(this._tags.internalValue), + isBlock: true, + type: "set", + storageClassType: "VbsBackupPolicyV2TagsList", + }, + timeouts: { + value: vbsBackupPolicyV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VbsBackupPolicyV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vbs-backup-policy/README.md b/src/constructs/providers/huaweicloud/vbs-backup-policy/README.md new file mode 100644 index 00000000..c9c80ec8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vbs_backup_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_vbs_backup_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy). diff --git a/src/constructs/providers/huaweicloud/vbs-backup-policy/index.ts b/src/constructs/providers/huaweicloud/vbs-backup-policy/index.ts new file mode 100644 index 00000000..c04df15a --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup-policy/index.ts @@ -0,0 +1,722 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VbsBackupPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#frequency VbsBackupPolicy#frequency} + */ + readonly frequency?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#id VbsBackupPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#name VbsBackupPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#region VbsBackupPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#rentention_day VbsBackupPolicy#rentention_day} + */ + readonly rententionDay?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#rentention_num VbsBackupPolicy#rentention_num} + */ + readonly rententionNum?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#resources VbsBackupPolicy#resources} + */ + readonly resources?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#retain_first_backup VbsBackupPolicy#retain_first_backup} + */ + readonly retainFirstBackup: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#start_time VbsBackupPolicy#start_time} + */ + readonly startTime: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#status VbsBackupPolicy#status} + */ + readonly status?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#week_frequency VbsBackupPolicy#week_frequency} + */ + readonly weekFrequency?: string[]; + /** + * tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#tags VbsBackupPolicy#tags} + */ + readonly tags?: VbsBackupPolicyTags[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#timeouts VbsBackupPolicy#timeouts} + */ + readonly timeouts?: VbsBackupPolicyTimeouts; +} +export interface VbsBackupPolicyTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#key VbsBackupPolicy#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#value VbsBackupPolicy#value} + */ + readonly value: string; +} + +export function vbsBackupPolicyTagsToTerraform(struct?: VbsBackupPolicyTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function vbsBackupPolicyTagsToHclTerraform(struct?: VbsBackupPolicyTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupPolicyTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VbsBackupPolicyTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupPolicyTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VbsBackupPolicyTagsList extends cdktf.ComplexList { + public internalValue? : VbsBackupPolicyTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VbsBackupPolicyTagsOutputReference { + return new VbsBackupPolicyTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VbsBackupPolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#create VbsBackupPolicy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#delete VbsBackupPolicy#delete} + */ + readonly delete?: string; +} + +export function vbsBackupPolicyTimeoutsToTerraform(struct?: VbsBackupPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vbsBackupPolicyTimeoutsToHclTerraform(struct?: VbsBackupPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupPolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VbsBackupPolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupPolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy huaweicloud_vbs_backup_policy} +*/ +export class VbsBackupPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VbsBackupPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VbsBackupPolicy to import + * @param importFromId The id of the existing VbsBackupPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VbsBackupPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_policy huaweicloud_vbs_backup_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VbsBackupPolicyConfig + */ + public constructor(scope: Construct, id: string, config: VbsBackupPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._frequency = config.frequency; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._rententionDay = config.rententionDay; + this._rententionNum = config.rententionNum; + this._resources = config.resources; + this._retainFirstBackup = config.retainFirstBackup; + this._startTime = config.startTime; + this._status = config.status; + this._weekFrequency = config.weekFrequency; + this._tags.internalValue = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // frequency - computed: false, optional: true, required: false + private _frequency?: number; + public get frequency() { + return this.getNumberAttribute('frequency'); + } + public set frequency(value: number) { + this._frequency = value; + } + public resetFrequency() { + this._frequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get frequencyInput() { + return this._frequency; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_resource_count - computed: true, optional: false, required: false + public get policyResourceCount() { + return this.getNumberAttribute('policy_resource_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rentention_day - computed: false, optional: true, required: false + private _rententionDay?: number; + public get rententionDay() { + return this.getNumberAttribute('rentention_day'); + } + public set rententionDay(value: number) { + this._rententionDay = value; + } + public resetRententionDay() { + this._rententionDay = undefined; + } + // Temporarily expose input value. Use with caution. + public get rententionDayInput() { + return this._rententionDay; + } + + // rentention_num - computed: false, optional: true, required: false + private _rententionNum?: number; + public get rententionNum() { + return this.getNumberAttribute('rentention_num'); + } + public set rententionNum(value: number) { + this._rententionNum = value; + } + public resetRententionNum() { + this._rententionNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get rententionNumInput() { + return this._rententionNum; + } + + // resources - computed: false, optional: true, required: false + private _resources?: string[]; + public get resources() { + return this.getListAttribute('resources'); + } + public set resources(value: string[]) { + this._resources = value; + } + public resetResources() { + this._resources = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourcesInput() { + return this._resources; + } + + // retain_first_backup - computed: false, optional: false, required: true + private _retainFirstBackup?: string; + public get retainFirstBackup() { + return this.getStringAttribute('retain_first_backup'); + } + public set retainFirstBackup(value: string) { + this._retainFirstBackup = value; + } + // Temporarily expose input value. Use with caution. + public get retainFirstBackupInput() { + return this._retainFirstBackup; + } + + // start_time - computed: false, optional: false, required: true + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // week_frequency - computed: false, optional: true, required: false + private _weekFrequency?: string[]; + public get weekFrequency() { + return this.getListAttribute('week_frequency'); + } + public set weekFrequency(value: string[]) { + this._weekFrequency = value; + } + public resetWeekFrequency() { + this._weekFrequency = undefined; + } + // Temporarily expose input value. Use with caution. + public get weekFrequencyInput() { + return this._weekFrequency; + } + + // tags - computed: false, optional: true, required: false + private _tags = new VbsBackupPolicyTagsList(this, "tags", true); + public get tags() { + return this._tags; + } + public putTags(value: VbsBackupPolicyTags[] | cdktf.IResolvable) { + this._tags.internalValue = value; + } + public resetTags() { + this._tags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VbsBackupPolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VbsBackupPolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + frequency: cdktf.numberToTerraform(this._frequency), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + rentention_day: cdktf.numberToTerraform(this._rententionDay), + rentention_num: cdktf.numberToTerraform(this._rententionNum), + resources: cdktf.listMapper(cdktf.stringToTerraform, false)(this._resources), + retain_first_backup: cdktf.stringToTerraform(this._retainFirstBackup), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.stringToTerraform(this._status), + week_frequency: cdktf.listMapper(cdktf.stringToTerraform, false)(this._weekFrequency), + tags: cdktf.listMapper(vbsBackupPolicyTagsToTerraform, true)(this._tags.internalValue), + timeouts: vbsBackupPolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + frequency: { + value: cdktf.numberToHclTerraform(this._frequency), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rentention_day: { + value: cdktf.numberToHclTerraform(this._rententionDay), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + rentention_num: { + value: cdktf.numberToHclTerraform(this._rententionNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + resources: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._resources), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + retain_first_backup: { + value: cdktf.stringToHclTerraform(this._retainFirstBackup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + week_frequency: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._weekFrequency), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + tags: { + value: cdktf.listMapperHcl(vbsBackupPolicyTagsToHclTerraform, true)(this._tags.internalValue), + isBlock: true, + type: "set", + storageClassType: "VbsBackupPolicyTagsList", + }, + timeouts: { + value: vbsBackupPolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VbsBackupPolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vbs-backup-v2/README.md b/src/constructs/providers/huaweicloud/vbs-backup-v2/README.md new file mode 100644 index 00000000..483c3842 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vbs_backup_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vbs_backup_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2). diff --git a/src/constructs/providers/huaweicloud/vbs-backup-v2/index.ts b/src/constructs/providers/huaweicloud/vbs-backup-v2/index.ts new file mode 100644 index 00000000..687499d2 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup-v2/index.ts @@ -0,0 +1,615 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VbsBackupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#description VbsBackupV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#id VbsBackupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#name VbsBackupV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#region VbsBackupV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#snapshot_id VbsBackupV2#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#volume_id VbsBackupV2#volume_id} + */ + readonly volumeId: string; + /** + * tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#tags VbsBackupV2#tags} + */ + readonly tags?: VbsBackupV2Tags[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#timeouts VbsBackupV2#timeouts} + */ + readonly timeouts?: VbsBackupV2Timeouts; +} +export interface VbsBackupV2Tags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#key VbsBackupV2#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#value VbsBackupV2#value} + */ + readonly value: string; +} + +export function vbsBackupV2TagsToTerraform(struct?: VbsBackupV2Tags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function vbsBackupV2TagsToHclTerraform(struct?: VbsBackupV2Tags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupV2TagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VbsBackupV2Tags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupV2Tags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VbsBackupV2TagsList extends cdktf.ComplexList { + public internalValue? : VbsBackupV2Tags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VbsBackupV2TagsOutputReference { + return new VbsBackupV2TagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VbsBackupV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#create VbsBackupV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#delete VbsBackupV2#delete} + */ + readonly delete?: string; +} + +export function vbsBackupV2TimeoutsToTerraform(struct?: VbsBackupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vbsBackupV2TimeoutsToHclTerraform(struct?: VbsBackupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VbsBackupV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2 huaweicloud_vbs_backup_v2} +*/ +export class VbsBackupV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VbsBackupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VbsBackupV2 to import + * @param importFromId The id of the existing VbsBackupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VbsBackupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup_v2 huaweicloud_vbs_backup_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VbsBackupV2Config + */ + public constructor(scope: Construct, id: string, config: VbsBackupV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._snapshotId = config.snapshotId; + this._volumeId = config.volumeId; + this._tags.internalValue = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // container - computed: true, optional: false, required: false + public get container() { + return this.getStringAttribute('container'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_count - computed: true, optional: false, required: false + public get objectCount() { + return this.getNumberAttribute('object_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_metadata - computed: true, optional: false, required: false + public get serviceMetadata() { + return this.getStringAttribute('service_metadata'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // tags - computed: false, optional: true, required: false + private _tags = new VbsBackupV2TagsList(this, "tags", true); + public get tags() { + return this._tags; + } + public putTags(value: VbsBackupV2Tags[] | cdktf.IResolvable) { + this._tags.internalValue = value; + } + public resetTags() { + this._tags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VbsBackupV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VbsBackupV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + volume_id: cdktf.stringToTerraform(this._volumeId), + tags: cdktf.listMapper(vbsBackupV2TagsToTerraform, true)(this._tags.internalValue), + timeouts: vbsBackupV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.listMapperHcl(vbsBackupV2TagsToHclTerraform, true)(this._tags.internalValue), + isBlock: true, + type: "set", + storageClassType: "VbsBackupV2TagsList", + }, + timeouts: { + value: vbsBackupV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VbsBackupV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vbs-backup/README.md b/src/constructs/providers/huaweicloud/vbs-backup/README.md new file mode 100644 index 00000000..69415940 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vbs_backup` + +Refer to the Terraform Registry for docs: [`huaweicloud_vbs_backup`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup). diff --git a/src/constructs/providers/huaweicloud/vbs-backup/index.ts b/src/constructs/providers/huaweicloud/vbs-backup/index.ts new file mode 100644 index 00000000..5ac27fe9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vbs-backup/index.ts @@ -0,0 +1,615 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VbsBackupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#description VbsBackup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#id VbsBackup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#name VbsBackup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#region VbsBackup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#snapshot_id VbsBackup#snapshot_id} + */ + readonly snapshotId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#volume_id VbsBackup#volume_id} + */ + readonly volumeId: string; + /** + * tags block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#tags VbsBackup#tags} + */ + readonly tags?: VbsBackupTags[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#timeouts VbsBackup#timeouts} + */ + readonly timeouts?: VbsBackupTimeouts; +} +export interface VbsBackupTags { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#key VbsBackup#key} + */ + readonly key: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#value VbsBackup#value} + */ + readonly value: string; +} + +export function vbsBackupTagsToTerraform(struct?: VbsBackupTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + key: cdktf.stringToTerraform(struct!.key), + value: cdktf.stringToTerraform(struct!.value), + } +} + + +export function vbsBackupTagsToHclTerraform(struct?: VbsBackupTags | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + key: { + value: cdktf.stringToHclTerraform(struct!.key), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.stringToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupTagsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VbsBackupTags | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._key !== undefined) { + hasAnyValues = true; + internalValueResult.key = this._key; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupTags | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._key = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._key = value.key; + this._value = value.value; + } + } + + // key - computed: false, optional: false, required: true + private _key?: string; + public get key() { + return this.getStringAttribute('key'); + } + public set key(value: string) { + this._key = value; + } + // Temporarily expose input value. Use with caution. + public get keyInput() { + return this._key; + } + + // value - computed: false, optional: false, required: true + private _value?: string; + public get value() { + return this.getStringAttribute('value'); + } + public set value(value: string) { + this._value = value; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VbsBackupTagsList extends cdktf.ComplexList { + public internalValue? : VbsBackupTags[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VbsBackupTagsOutputReference { + return new VbsBackupTagsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VbsBackupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#create VbsBackup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#delete VbsBackup#delete} + */ + readonly delete?: string; +} + +export function vbsBackupTimeoutsToTerraform(struct?: VbsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vbsBackupTimeoutsToHclTerraform(struct?: VbsBackupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VbsBackupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VbsBackupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VbsBackupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup huaweicloud_vbs_backup} +*/ +export class VbsBackup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vbs_backup"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VbsBackup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VbsBackup to import + * @param importFromId The id of the existing VbsBackup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VbsBackup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vbs_backup", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vbs_backup huaweicloud_vbs_backup} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VbsBackupConfig + */ + public constructor(scope: Construct, id: string, config: VbsBackupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vbs_backup', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._snapshotId = config.snapshotId; + this._volumeId = config.volumeId; + this._tags.internalValue = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // container - computed: true, optional: false, required: false + public get container() { + return this.getStringAttribute('container'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // object_count - computed: true, optional: false, required: false + public get objectCount() { + return this.getNumberAttribute('object_count'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_metadata - computed: true, optional: false, required: false + public get serviceMetadata() { + return this.getStringAttribute('service_metadata'); + } + + // size - computed: true, optional: false, required: false + public get size() { + return this.getNumberAttribute('size'); + } + + // snapshot_id - computed: true, optional: true, required: false + private _snapshotId?: string; + public get snapshotId() { + return this.getStringAttribute('snapshot_id'); + } + public set snapshotId(value: string) { + this._snapshotId = value; + } + public resetSnapshotId() { + this._snapshotId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snapshotIdInput() { + return this._snapshotId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // volume_id - computed: false, optional: false, required: true + private _volumeId?: string; + public get volumeId() { + return this.getStringAttribute('volume_id'); + } + public set volumeId(value: string) { + this._volumeId = value; + } + // Temporarily expose input value. Use with caution. + public get volumeIdInput() { + return this._volumeId; + } + + // tags - computed: false, optional: true, required: false + private _tags = new VbsBackupTagsList(this, "tags", true); + public get tags() { + return this._tags; + } + public putTags(value: VbsBackupTags[] | cdktf.IResolvable) { + this._tags.internalValue = value; + } + public resetTags() { + this._tags.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VbsBackupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VbsBackupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + snapshot_id: cdktf.stringToTerraform(this._snapshotId), + volume_id: cdktf.stringToTerraform(this._volumeId), + tags: cdktf.listMapper(vbsBackupTagsToTerraform, true)(this._tags.internalValue), + timeouts: vbsBackupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snapshot_id: { + value: cdktf.stringToHclTerraform(this._snapshotId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + volume_id: { + value: cdktf.stringToHclTerraform(this._volumeId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.listMapperHcl(vbsBackupTagsToHclTerraform, true)(this._tags.internalValue), + isBlock: true, + type: "set", + storageClassType: "VbsBackupTagsList", + }, + timeouts: { + value: vbsBackupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VbsBackupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vod-media-asset/README.md b/src/constructs/providers/huaweicloud/vod-media-asset/README.md new file mode 100644 index 00000000..766b7cba --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-media-asset/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vod_media_asset` + +Refer to the Terraform Registry for docs: [`huaweicloud_vod_media_asset`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset). diff --git a/src/constructs/providers/huaweicloud/vod-media-asset/index.ts b/src/constructs/providers/huaweicloud/vod-media-asset/index.ts new file mode 100644 index 00000000..c19d4ccd --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-media-asset/index.ts @@ -0,0 +1,938 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VodMediaAssetConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#auto_encrypt VodMediaAsset#auto_encrypt} + */ + readonly autoEncrypt?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#auto_preload VodMediaAsset#auto_preload} + */ + readonly autoPreload?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#category_id VodMediaAsset#category_id} + */ + readonly categoryId?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#description VodMediaAsset#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#id VodMediaAsset#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#input_bucket VodMediaAsset#input_bucket} + */ + readonly inputBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#input_path VodMediaAsset#input_path} + */ + readonly inputPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#labels VodMediaAsset#labels} + */ + readonly labels?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#media_type VodMediaAsset#media_type} + */ + readonly mediaType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#name VodMediaAsset#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#output_bucket VodMediaAsset#output_bucket} + */ + readonly outputBucket?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#output_path VodMediaAsset#output_path} + */ + readonly outputPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#publish VodMediaAsset#publish} + */ + readonly publish?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#region VodMediaAsset#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#review_template_id VodMediaAsset#review_template_id} + */ + readonly reviewTemplateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#storage_mode VodMediaAsset#storage_mode} + */ + readonly storageMode?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#template_group_name VodMediaAsset#template_group_name} + */ + readonly templateGroupName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#url VodMediaAsset#url} + */ + readonly url?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#workflow_name VodMediaAsset#workflow_name} + */ + readonly workflowName?: string; + /** + * thumbnail block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#thumbnail VodMediaAsset#thumbnail} + */ + readonly thumbnail?: VodMediaAssetThumbnail; +} +export interface VodMediaAssetThumbnail { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#aspect_ratio VodMediaAsset#aspect_ratio} + */ + readonly aspectRatio?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#cover_position VodMediaAsset#cover_position} + */ + readonly coverPosition?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#dots VodMediaAsset#dots} + */ + readonly dots?: number[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#format VodMediaAsset#format} + */ + readonly format?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#max_length VodMediaAsset#max_length} + */ + readonly maxLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#time VodMediaAsset#time} + */ + readonly time?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#type VodMediaAsset#type} + */ + readonly type: string; +} + +export function vodMediaAssetThumbnailToTerraform(struct?: VodMediaAssetThumbnailOutputReference | VodMediaAssetThumbnail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + aspect_ratio: cdktf.numberToTerraform(struct!.aspectRatio), + cover_position: cdktf.numberToTerraform(struct!.coverPosition), + dots: cdktf.listMapper(cdktf.numberToTerraform, false)(struct!.dots), + format: cdktf.numberToTerraform(struct!.format), + max_length: cdktf.numberToTerraform(struct!.maxLength), + time: cdktf.numberToTerraform(struct!.time), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vodMediaAssetThumbnailToHclTerraform(struct?: VodMediaAssetThumbnailOutputReference | VodMediaAssetThumbnail): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + aspect_ratio: { + value: cdktf.numberToHclTerraform(struct!.aspectRatio), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + cover_position: { + value: cdktf.numberToHclTerraform(struct!.coverPosition), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + dots: { + value: cdktf.listMapperHcl(cdktf.numberToHclTerraform, false)(struct!.dots), + isBlock: false, + type: "list", + storageClassType: "numberList", + }, + format: { + value: cdktf.numberToHclTerraform(struct!.format), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_length: { + value: cdktf.numberToHclTerraform(struct!.maxLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + time: { + value: cdktf.numberToHclTerraform(struct!.time), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VodMediaAssetThumbnailOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VodMediaAssetThumbnail | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._aspectRatio !== undefined) { + hasAnyValues = true; + internalValueResult.aspectRatio = this._aspectRatio; + } + if (this._coverPosition !== undefined) { + hasAnyValues = true; + internalValueResult.coverPosition = this._coverPosition; + } + if (this._dots !== undefined) { + hasAnyValues = true; + internalValueResult.dots = this._dots; + } + if (this._format !== undefined) { + hasAnyValues = true; + internalValueResult.format = this._format; + } + if (this._maxLength !== undefined) { + hasAnyValues = true; + internalValueResult.maxLength = this._maxLength; + } + if (this._time !== undefined) { + hasAnyValues = true; + internalValueResult.time = this._time; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VodMediaAssetThumbnail | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._aspectRatio = undefined; + this._coverPosition = undefined; + this._dots = undefined; + this._format = undefined; + this._maxLength = undefined; + this._time = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._aspectRatio = value.aspectRatio; + this._coverPosition = value.coverPosition; + this._dots = value.dots; + this._format = value.format; + this._maxLength = value.maxLength; + this._time = value.time; + this._type = value.type; + } + } + + // aspect_ratio - computed: false, optional: true, required: false + private _aspectRatio?: number; + public get aspectRatio() { + return this.getNumberAttribute('aspect_ratio'); + } + public set aspectRatio(value: number) { + this._aspectRatio = value; + } + public resetAspectRatio() { + this._aspectRatio = undefined; + } + // Temporarily expose input value. Use with caution. + public get aspectRatioInput() { + return this._aspectRatio; + } + + // cover_position - computed: false, optional: true, required: false + private _coverPosition?: number; + public get coverPosition() { + return this.getNumberAttribute('cover_position'); + } + public set coverPosition(value: number) { + this._coverPosition = value; + } + public resetCoverPosition() { + this._coverPosition = undefined; + } + // Temporarily expose input value. Use with caution. + public get coverPositionInput() { + return this._coverPosition; + } + + // dots - computed: false, optional: true, required: false + private _dots?: number[]; + public get dots() { + return this.getNumberListAttribute('dots'); + } + public set dots(value: number[]) { + this._dots = value; + } + public resetDots() { + this._dots = undefined; + } + // Temporarily expose input value. Use with caution. + public get dotsInput() { + return this._dots; + } + + // format - computed: false, optional: true, required: false + private _format?: number; + public get format() { + return this.getNumberAttribute('format'); + } + public set format(value: number) { + this._format = value; + } + public resetFormat() { + this._format = undefined; + } + // Temporarily expose input value. Use with caution. + public get formatInput() { + return this._format; + } + + // max_length - computed: false, optional: true, required: false + private _maxLength?: number; + public get maxLength() { + return this.getNumberAttribute('max_length'); + } + public set maxLength(value: number) { + this._maxLength = value; + } + public resetMaxLength() { + this._maxLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxLengthInput() { + return this._maxLength; + } + + // time - computed: false, optional: true, required: false + private _time?: number; + public get time() { + return this.getNumberAttribute('time'); + } + public set time(value: number) { + this._time = value; + } + public resetTime() { + this._time = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeInput() { + return this._time; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset huaweicloud_vod_media_asset} +*/ +export class VodMediaAsset extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vod_media_asset"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VodMediaAsset resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VodMediaAsset to import + * @param importFromId The id of the existing VodMediaAsset that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VodMediaAsset to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vod_media_asset", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_asset huaweicloud_vod_media_asset} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VodMediaAssetConfig + */ + public constructor(scope: Construct, id: string, config: VodMediaAssetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vod_media_asset', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoEncrypt = config.autoEncrypt; + this._autoPreload = config.autoPreload; + this._categoryId = config.categoryId; + this._description = config.description; + this._id = config.id; + this._inputBucket = config.inputBucket; + this._inputPath = config.inputPath; + this._labels = config.labels; + this._mediaType = config.mediaType; + this._name = config.name; + this._outputBucket = config.outputBucket; + this._outputPath = config.outputPath; + this._publish = config.publish; + this._region = config.region; + this._reviewTemplateId = config.reviewTemplateId; + this._storageMode = config.storageMode; + this._templateGroupName = config.templateGroupName; + this._url = config.url; + this._workflowName = config.workflowName; + this._thumbnail.internalValue = config.thumbnail; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_encrypt - computed: false, optional: true, required: false + private _autoEncrypt?: boolean | cdktf.IResolvable; + public get autoEncrypt() { + return this.getBooleanAttribute('auto_encrypt'); + } + public set autoEncrypt(value: boolean | cdktf.IResolvable) { + this._autoEncrypt = value; + } + public resetAutoEncrypt() { + this._autoEncrypt = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoEncryptInput() { + return this._autoEncrypt; + } + + // auto_preload - computed: false, optional: true, required: false + private _autoPreload?: boolean | cdktf.IResolvable; + public get autoPreload() { + return this.getBooleanAttribute('auto_preload'); + } + public set autoPreload(value: boolean | cdktf.IResolvable) { + this._autoPreload = value; + } + public resetAutoPreload() { + this._autoPreload = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPreloadInput() { + return this._autoPreload; + } + + // category_id - computed: true, optional: true, required: false + private _categoryId?: number; + public get categoryId() { + return this.getNumberAttribute('category_id'); + } + public set categoryId(value: number) { + this._categoryId = value; + } + public resetCategoryId() { + this._categoryId = undefined; + } + // Temporarily expose input value. Use with caution. + public get categoryIdInput() { + return this._categoryId; + } + + // category_name - computed: true, optional: false, required: false + public get categoryName() { + return this.getStringAttribute('category_name'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // input_bucket - computed: false, optional: true, required: false + private _inputBucket?: string; + public get inputBucket() { + return this.getStringAttribute('input_bucket'); + } + public set inputBucket(value: string) { + this._inputBucket = value; + } + public resetInputBucket() { + this._inputBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputBucketInput() { + return this._inputBucket; + } + + // input_path - computed: false, optional: true, required: false + private _inputPath?: string; + public get inputPath() { + return this.getStringAttribute('input_path'); + } + public set inputPath(value: string) { + this._inputPath = value; + } + public resetInputPath() { + this._inputPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get inputPathInput() { + return this._inputPath; + } + + // labels - computed: false, optional: true, required: false + private _labels?: string; + public get labels() { + return this.getStringAttribute('labels'); + } + public set labels(value: string) { + this._labels = value; + } + public resetLabels() { + this._labels = undefined; + } + // Temporarily expose input value. Use with caution. + public get labelsInput() { + return this._labels; + } + + // media_name - computed: true, optional: false, required: false + public get mediaName() { + return this.getStringAttribute('media_name'); + } + + // media_type - computed: false, optional: false, required: true + private _mediaType?: string; + public get mediaType() { + return this.getStringAttribute('media_type'); + } + public set mediaType(value: string) { + this._mediaType = value; + } + // Temporarily expose input value. Use with caution. + public get mediaTypeInput() { + return this._mediaType; + } + + // media_url - computed: true, optional: false, required: false + public get mediaUrl() { + return this.getStringAttribute('media_url'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // output_bucket - computed: false, optional: true, required: false + private _outputBucket?: string; + public get outputBucket() { + return this.getStringAttribute('output_bucket'); + } + public set outputBucket(value: string) { + this._outputBucket = value; + } + public resetOutputBucket() { + this._outputBucket = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputBucketInput() { + return this._outputBucket; + } + + // output_path - computed: false, optional: true, required: false + private _outputPath?: string; + public get outputPath() { + return this.getStringAttribute('output_path'); + } + public set outputPath(value: string) { + this._outputPath = value; + } + public resetOutputPath() { + this._outputPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get outputPathInput() { + return this._outputPath; + } + + // publish - computed: false, optional: true, required: false + private _publish?: boolean | cdktf.IResolvable; + public get publish() { + return this.getBooleanAttribute('publish'); + } + public set publish(value: boolean | cdktf.IResolvable) { + this._publish = value; + } + public resetPublish() { + this._publish = undefined; + } + // Temporarily expose input value. Use with caution. + public get publishInput() { + return this._publish; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // review_template_id - computed: false, optional: true, required: false + private _reviewTemplateId?: string; + public get reviewTemplateId() { + return this.getStringAttribute('review_template_id'); + } + public set reviewTemplateId(value: string) { + this._reviewTemplateId = value; + } + public resetReviewTemplateId() { + this._reviewTemplateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get reviewTemplateIdInput() { + return this._reviewTemplateId; + } + + // storage_mode - computed: false, optional: true, required: false + private _storageMode?: number; + public get storageMode() { + return this.getNumberAttribute('storage_mode'); + } + public set storageMode(value: number) { + this._storageMode = value; + } + public resetStorageMode() { + this._storageMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageModeInput() { + return this._storageMode; + } + + // template_group_name - computed: false, optional: true, required: false + private _templateGroupName?: string; + public get templateGroupName() { + return this.getStringAttribute('template_group_name'); + } + public set templateGroupName(value: string) { + this._templateGroupName = value; + } + public resetTemplateGroupName() { + this._templateGroupName = undefined; + } + // Temporarily expose input value. Use with caution. + public get templateGroupNameInput() { + return this._templateGroupName; + } + + // url - computed: false, optional: true, required: false + private _url?: string; + public get url() { + return this.getStringAttribute('url'); + } + public set url(value: string) { + this._url = value; + } + public resetUrl() { + this._url = undefined; + } + // Temporarily expose input value. Use with caution. + public get urlInput() { + return this._url; + } + + // workflow_name - computed: false, optional: true, required: false + private _workflowName?: string; + public get workflowName() { + return this.getStringAttribute('workflow_name'); + } + public set workflowName(value: string) { + this._workflowName = value; + } + public resetWorkflowName() { + this._workflowName = undefined; + } + // Temporarily expose input value. Use with caution. + public get workflowNameInput() { + return this._workflowName; + } + + // thumbnail - computed: false, optional: true, required: false + private _thumbnail = new VodMediaAssetThumbnailOutputReference(this, "thumbnail"); + public get thumbnail() { + return this._thumbnail; + } + public putThumbnail(value: VodMediaAssetThumbnail) { + this._thumbnail.internalValue = value; + } + public resetThumbnail() { + this._thumbnail.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get thumbnailInput() { + return this._thumbnail.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_encrypt: cdktf.booleanToTerraform(this._autoEncrypt), + auto_preload: cdktf.booleanToTerraform(this._autoPreload), + category_id: cdktf.numberToTerraform(this._categoryId), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + input_bucket: cdktf.stringToTerraform(this._inputBucket), + input_path: cdktf.stringToTerraform(this._inputPath), + labels: cdktf.stringToTerraform(this._labels), + media_type: cdktf.stringToTerraform(this._mediaType), + name: cdktf.stringToTerraform(this._name), + output_bucket: cdktf.stringToTerraform(this._outputBucket), + output_path: cdktf.stringToTerraform(this._outputPath), + publish: cdktf.booleanToTerraform(this._publish), + region: cdktf.stringToTerraform(this._region), + review_template_id: cdktf.stringToTerraform(this._reviewTemplateId), + storage_mode: cdktf.numberToTerraform(this._storageMode), + template_group_name: cdktf.stringToTerraform(this._templateGroupName), + url: cdktf.stringToTerraform(this._url), + workflow_name: cdktf.stringToTerraform(this._workflowName), + thumbnail: vodMediaAssetThumbnailToTerraform(this._thumbnail.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_encrypt: { + value: cdktf.booleanToHclTerraform(this._autoEncrypt), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + auto_preload: { + value: cdktf.booleanToHclTerraform(this._autoPreload), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + category_id: { + value: cdktf.numberToHclTerraform(this._categoryId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input_bucket: { + value: cdktf.stringToHclTerraform(this._inputBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + input_path: { + value: cdktf.stringToHclTerraform(this._inputPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + labels: { + value: cdktf.stringToHclTerraform(this._labels), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + media_type: { + value: cdktf.stringToHclTerraform(this._mediaType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + output_bucket: { + value: cdktf.stringToHclTerraform(this._outputBucket), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + output_path: { + value: cdktf.stringToHclTerraform(this._outputPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publish: { + value: cdktf.booleanToHclTerraform(this._publish), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + review_template_id: { + value: cdktf.stringToHclTerraform(this._reviewTemplateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_mode: { + value: cdktf.numberToHclTerraform(this._storageMode), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + template_group_name: { + value: cdktf.stringToHclTerraform(this._templateGroupName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + url: { + value: cdktf.stringToHclTerraform(this._url), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + workflow_name: { + value: cdktf.stringToHclTerraform(this._workflowName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + thumbnail: { + value: vodMediaAssetThumbnailToHclTerraform(this._thumbnail.internalValue), + isBlock: true, + type: "list", + storageClassType: "VodMediaAssetThumbnailList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vod-media-category/README.md b/src/constructs/providers/huaweicloud/vod-media-category/README.md new file mode 100644 index 00000000..f68c209f --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-media-category/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vod_media_category` + +Refer to the Terraform Registry for docs: [`huaweicloud_vod_media_category`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category). diff --git a/src/constructs/providers/huaweicloud/vod-media-category/index.ts b/src/constructs/providers/huaweicloud/vod-media-category/index.ts new file mode 100644 index 00000000..faa93f2c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-media-category/index.ts @@ -0,0 +1,202 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VodMediaCategoryConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category#id VodMediaCategory#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category#name VodMediaCategory#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category#parent_id VodMediaCategory#parent_id} + */ + readonly parentId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category#region VodMediaCategory#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category huaweicloud_vod_media_category} +*/ +export class VodMediaCategory extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vod_media_category"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VodMediaCategory resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VodMediaCategory to import + * @param importFromId The id of the existing VodMediaCategory that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VodMediaCategory to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vod_media_category", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_media_category huaweicloud_vod_media_category} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VodMediaCategoryConfig + */ + public constructor(scope: Construct, id: string, config: VodMediaCategoryConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vod_media_category', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._parentId = config.parentId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // children - computed: true, optional: false, required: false + public get children() { + return this.getStringAttribute('children'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // parent_id - computed: false, optional: true, required: false + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + public resetParentId() { + this._parentId = undefined; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vod-transcoding-template-group/README.md b/src/constructs/providers/huaweicloud/vod-transcoding-template-group/README.md new file mode 100644 index 00000000..bee16e67 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-transcoding-template-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vod_transcoding_template_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_vod_transcoding_template_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group). diff --git a/src/constructs/providers/huaweicloud/vod-transcoding-template-group/index.ts b/src/constructs/providers/huaweicloud/vod-transcoding-template-group/index.ts new file mode 100644 index 00000000..5982f53d --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-transcoding-template-group/index.ts @@ -0,0 +1,965 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VodTranscodingTemplateGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#audio_codec VodTranscodingTemplateGroup#audio_codec} + */ + readonly audioCodec?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#auto_encrypt VodTranscodingTemplateGroup#auto_encrypt} + */ + readonly autoEncrypt?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#description VodTranscodingTemplateGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#hls_segment_duration VodTranscodingTemplateGroup#hls_segment_duration} + */ + readonly hlsSegmentDuration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#id VodTranscodingTemplateGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#is_default VodTranscodingTemplateGroup#is_default} + */ + readonly isDefault?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#low_bitrate_hd VodTranscodingTemplateGroup#low_bitrate_hd} + */ + readonly lowBitrateHd?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#name VodTranscodingTemplateGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#region VodTranscodingTemplateGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#video_codec VodTranscodingTemplateGroup#video_codec} + */ + readonly videoCodec?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#watermark_template_ids VodTranscodingTemplateGroup#watermark_template_ids} + */ + readonly watermarkTemplateIds?: string[]; + /** + * quality_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#quality_info VodTranscodingTemplateGroup#quality_info} + */ + readonly qualityInfo: VodTranscodingTemplateGroupQualityInfo[] | cdktf.IResolvable; +} +export interface VodTranscodingTemplateGroupQualityInfoAudio { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#bitrate VodTranscodingTemplateGroup#bitrate} + */ + readonly bitrate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#channels VodTranscodingTemplateGroup#channels} + */ + readonly channels: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#sample_rate VodTranscodingTemplateGroup#sample_rate} + */ + readonly sampleRate: number; +} + +export function vodTranscodingTemplateGroupQualityInfoAudioToTerraform(struct?: VodTranscodingTemplateGroupQualityInfoAudioOutputReference | VodTranscodingTemplateGroupQualityInfoAudio): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + channels: cdktf.numberToTerraform(struct!.channels), + sample_rate: cdktf.numberToTerraform(struct!.sampleRate), + } +} + + +export function vodTranscodingTemplateGroupQualityInfoAudioToHclTerraform(struct?: VodTranscodingTemplateGroupQualityInfoAudioOutputReference | VodTranscodingTemplateGroupQualityInfoAudio): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + channels: { + value: cdktf.numberToHclTerraform(struct!.channels), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + sample_rate: { + value: cdktf.numberToHclTerraform(struct!.sampleRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VodTranscodingTemplateGroupQualityInfoAudioOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VodTranscodingTemplateGroupQualityInfoAudio | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._channels !== undefined) { + hasAnyValues = true; + internalValueResult.channels = this._channels; + } + if (this._sampleRate !== undefined) { + hasAnyValues = true; + internalValueResult.sampleRate = this._sampleRate; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VodTranscodingTemplateGroupQualityInfoAudio | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bitrate = undefined; + this._channels = undefined; + this._sampleRate = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bitrate = value.bitrate; + this._channels = value.channels; + this._sampleRate = value.sampleRate; + } + } + + // bitrate - computed: false, optional: true, required: false + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + public resetBitrate() { + this._bitrate = undefined; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // channels - computed: false, optional: false, required: true + private _channels?: number; + public get channels() { + return this.getNumberAttribute('channels'); + } + public set channels(value: number) { + this._channels = value; + } + // Temporarily expose input value. Use with caution. + public get channelsInput() { + return this._channels; + } + + // sample_rate - computed: false, optional: false, required: true + private _sampleRate?: number; + public get sampleRate() { + return this.getNumberAttribute('sample_rate'); + } + public set sampleRate(value: number) { + this._sampleRate = value; + } + // Temporarily expose input value. Use with caution. + public get sampleRateInput() { + return this._sampleRate; + } +} +export interface VodTranscodingTemplateGroupQualityInfoVideo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#bitrate VodTranscodingTemplateGroup#bitrate} + */ + readonly bitrate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#frame_rate VodTranscodingTemplateGroup#frame_rate} + */ + readonly frameRate?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#height VodTranscodingTemplateGroup#height} + */ + readonly height?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#quality VodTranscodingTemplateGroup#quality} + */ + readonly quality: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#width VodTranscodingTemplateGroup#width} + */ + readonly width?: number; +} + +export function vodTranscodingTemplateGroupQualityInfoVideoToTerraform(struct?: VodTranscodingTemplateGroupQualityInfoVideoOutputReference | VodTranscodingTemplateGroupQualityInfoVideo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bitrate: cdktf.numberToTerraform(struct!.bitrate), + frame_rate: cdktf.numberToTerraform(struct!.frameRate), + height: cdktf.numberToTerraform(struct!.height), + quality: cdktf.stringToTerraform(struct!.quality), + width: cdktf.numberToTerraform(struct!.width), + } +} + + +export function vodTranscodingTemplateGroupQualityInfoVideoToHclTerraform(struct?: VodTranscodingTemplateGroupQualityInfoVideoOutputReference | VodTranscodingTemplateGroupQualityInfoVideo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bitrate: { + value: cdktf.numberToHclTerraform(struct!.bitrate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + frame_rate: { + value: cdktf.numberToHclTerraform(struct!.frameRate), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + height: { + value: cdktf.numberToHclTerraform(struct!.height), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + quality: { + value: cdktf.stringToHclTerraform(struct!.quality), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + width: { + value: cdktf.numberToHclTerraform(struct!.width), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VodTranscodingTemplateGroupQualityInfoVideoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VodTranscodingTemplateGroupQualityInfoVideo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bitrate !== undefined) { + hasAnyValues = true; + internalValueResult.bitrate = this._bitrate; + } + if (this._frameRate !== undefined) { + hasAnyValues = true; + internalValueResult.frameRate = this._frameRate; + } + if (this._height !== undefined) { + hasAnyValues = true; + internalValueResult.height = this._height; + } + if (this._quality !== undefined) { + hasAnyValues = true; + internalValueResult.quality = this._quality; + } + if (this._width !== undefined) { + hasAnyValues = true; + internalValueResult.width = this._width; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VodTranscodingTemplateGroupQualityInfoVideo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bitrate = undefined; + this._frameRate = undefined; + this._height = undefined; + this._quality = undefined; + this._width = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bitrate = value.bitrate; + this._frameRate = value.frameRate; + this._height = value.height; + this._quality = value.quality; + this._width = value.width; + } + } + + // bitrate - computed: false, optional: true, required: false + private _bitrate?: number; + public get bitrate() { + return this.getNumberAttribute('bitrate'); + } + public set bitrate(value: number) { + this._bitrate = value; + } + public resetBitrate() { + this._bitrate = undefined; + } + // Temporarily expose input value. Use with caution. + public get bitrateInput() { + return this._bitrate; + } + + // frame_rate - computed: false, optional: true, required: false + private _frameRate?: number; + public get frameRate() { + return this.getNumberAttribute('frame_rate'); + } + public set frameRate(value: number) { + this._frameRate = value; + } + public resetFrameRate() { + this._frameRate = undefined; + } + // Temporarily expose input value. Use with caution. + public get frameRateInput() { + return this._frameRate; + } + + // height - computed: false, optional: true, required: false + private _height?: number; + public get height() { + return this.getNumberAttribute('height'); + } + public set height(value: number) { + this._height = value; + } + public resetHeight() { + this._height = undefined; + } + // Temporarily expose input value. Use with caution. + public get heightInput() { + return this._height; + } + + // quality - computed: false, optional: false, required: true + private _quality?: string; + public get quality() { + return this.getStringAttribute('quality'); + } + public set quality(value: string) { + this._quality = value; + } + // Temporarily expose input value. Use with caution. + public get qualityInput() { + return this._quality; + } + + // width - computed: false, optional: true, required: false + private _width?: number; + public get width() { + return this.getNumberAttribute('width'); + } + public set width(value: number) { + this._width = value; + } + public resetWidth() { + this._width = undefined; + } + // Temporarily expose input value. Use with caution. + public get widthInput() { + return this._width; + } +} +export interface VodTranscodingTemplateGroupQualityInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#output_format VodTranscodingTemplateGroup#output_format} + */ + readonly outputFormat: string; + /** + * audio block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#audio VodTranscodingTemplateGroup#audio} + */ + readonly audio?: VodTranscodingTemplateGroupQualityInfoAudio; + /** + * video block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#video VodTranscodingTemplateGroup#video} + */ + readonly video?: VodTranscodingTemplateGroupQualityInfoVideo; +} + +export function vodTranscodingTemplateGroupQualityInfoToTerraform(struct?: VodTranscodingTemplateGroupQualityInfo | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + output_format: cdktf.stringToTerraform(struct!.outputFormat), + audio: vodTranscodingTemplateGroupQualityInfoAudioToTerraform(struct!.audio), + video: vodTranscodingTemplateGroupQualityInfoVideoToTerraform(struct!.video), + } +} + + +export function vodTranscodingTemplateGroupQualityInfoToHclTerraform(struct?: VodTranscodingTemplateGroupQualityInfo | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + output_format: { + value: cdktf.stringToHclTerraform(struct!.outputFormat), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + audio: { + value: vodTranscodingTemplateGroupQualityInfoAudioToHclTerraform(struct!.audio), + isBlock: true, + type: "list", + storageClassType: "VodTranscodingTemplateGroupQualityInfoAudioList", + }, + video: { + value: vodTranscodingTemplateGroupQualityInfoVideoToHclTerraform(struct!.video), + isBlock: true, + type: "list", + storageClassType: "VodTranscodingTemplateGroupQualityInfoVideoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VodTranscodingTemplateGroupQualityInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VodTranscodingTemplateGroupQualityInfo | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._outputFormat !== undefined) { + hasAnyValues = true; + internalValueResult.outputFormat = this._outputFormat; + } + if (this._audio?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.audio = this._audio?.internalValue; + } + if (this._video?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.video = this._video?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VodTranscodingTemplateGroupQualityInfo | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._outputFormat = undefined; + this._audio.internalValue = undefined; + this._video.internalValue = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._outputFormat = value.outputFormat; + this._audio.internalValue = value.audio; + this._video.internalValue = value.video; + } + } + + // output_format - computed: false, optional: false, required: true + private _outputFormat?: string; + public get outputFormat() { + return this.getStringAttribute('output_format'); + } + public set outputFormat(value: string) { + this._outputFormat = value; + } + // Temporarily expose input value. Use with caution. + public get outputFormatInput() { + return this._outputFormat; + } + + // audio - computed: false, optional: true, required: false + private _audio = new VodTranscodingTemplateGroupQualityInfoAudioOutputReference(this, "audio"); + public get audio() { + return this._audio; + } + public putAudio(value: VodTranscodingTemplateGroupQualityInfoAudio) { + this._audio.internalValue = value; + } + public resetAudio() { + this._audio.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get audioInput() { + return this._audio.internalValue; + } + + // video - computed: false, optional: true, required: false + private _video = new VodTranscodingTemplateGroupQualityInfoVideoOutputReference(this, "video"); + public get video() { + return this._video; + } + public putVideo(value: VodTranscodingTemplateGroupQualityInfoVideo) { + this._video.internalValue = value; + } + public resetVideo() { + this._video.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get videoInput() { + return this._video.internalValue; + } +} + +export class VodTranscodingTemplateGroupQualityInfoList extends cdktf.ComplexList { + public internalValue? : VodTranscodingTemplateGroupQualityInfo[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VodTranscodingTemplateGroupQualityInfoOutputReference { + return new VodTranscodingTemplateGroupQualityInfoOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group huaweicloud_vod_transcoding_template_group} +*/ +export class VodTranscodingTemplateGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vod_transcoding_template_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VodTranscodingTemplateGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VodTranscodingTemplateGroup to import + * @param importFromId The id of the existing VodTranscodingTemplateGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VodTranscodingTemplateGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vod_transcoding_template_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_transcoding_template_group huaweicloud_vod_transcoding_template_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VodTranscodingTemplateGroupConfig + */ + public constructor(scope: Construct, id: string, config: VodTranscodingTemplateGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vod_transcoding_template_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._audioCodec = config.audioCodec; + this._autoEncrypt = config.autoEncrypt; + this._description = config.description; + this._hlsSegmentDuration = config.hlsSegmentDuration; + this._id = config.id; + this._isDefault = config.isDefault; + this._lowBitrateHd = config.lowBitrateHd; + this._name = config.name; + this._region = config.region; + this._videoCodec = config.videoCodec; + this._watermarkTemplateIds = config.watermarkTemplateIds; + this._qualityInfo.internalValue = config.qualityInfo; + } + + // ========== + // ATTRIBUTES + // ========== + + // audio_codec - computed: true, optional: true, required: false + private _audioCodec?: string; + public get audioCodec() { + return this.getStringAttribute('audio_codec'); + } + public set audioCodec(value: string) { + this._audioCodec = value; + } + public resetAudioCodec() { + this._audioCodec = undefined; + } + // Temporarily expose input value. Use with caution. + public get audioCodecInput() { + return this._audioCodec; + } + + // auto_encrypt - computed: false, optional: true, required: false + private _autoEncrypt?: boolean | cdktf.IResolvable; + public get autoEncrypt() { + return this.getBooleanAttribute('auto_encrypt'); + } + public set autoEncrypt(value: boolean | cdktf.IResolvable) { + this._autoEncrypt = value; + } + public resetAutoEncrypt() { + this._autoEncrypt = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoEncryptInput() { + return this._autoEncrypt; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // hls_segment_duration - computed: true, optional: true, required: false + private _hlsSegmentDuration?: number; + public get hlsSegmentDuration() { + return this.getNumberAttribute('hls_segment_duration'); + } + public set hlsSegmentDuration(value: number) { + this._hlsSegmentDuration = value; + } + public resetHlsSegmentDuration() { + this._hlsSegmentDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get hlsSegmentDurationInput() { + return this._hlsSegmentDuration; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_default - computed: false, optional: true, required: false + private _isDefault?: boolean | cdktf.IResolvable; + public get isDefault() { + return this.getBooleanAttribute('is_default'); + } + public set isDefault(value: boolean | cdktf.IResolvable) { + this._isDefault = value; + } + public resetIsDefault() { + this._isDefault = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDefaultInput() { + return this._isDefault; + } + + // low_bitrate_hd - computed: false, optional: true, required: false + private _lowBitrateHd?: boolean | cdktf.IResolvable; + public get lowBitrateHd() { + return this.getBooleanAttribute('low_bitrate_hd'); + } + public set lowBitrateHd(value: boolean | cdktf.IResolvable) { + this._lowBitrateHd = value; + } + public resetLowBitrateHd() { + this._lowBitrateHd = undefined; + } + // Temporarily expose input value. Use with caution. + public get lowBitrateHdInput() { + return this._lowBitrateHd; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // video_codec - computed: true, optional: true, required: false + private _videoCodec?: string; + public get videoCodec() { + return this.getStringAttribute('video_codec'); + } + public set videoCodec(value: string) { + this._videoCodec = value; + } + public resetVideoCodec() { + this._videoCodec = undefined; + } + // Temporarily expose input value. Use with caution. + public get videoCodecInput() { + return this._videoCodec; + } + + // watermark_template_ids - computed: false, optional: true, required: false + private _watermarkTemplateIds?: string[]; + public get watermarkTemplateIds() { + return this.getListAttribute('watermark_template_ids'); + } + public set watermarkTemplateIds(value: string[]) { + this._watermarkTemplateIds = value; + } + public resetWatermarkTemplateIds() { + this._watermarkTemplateIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get watermarkTemplateIdsInput() { + return this._watermarkTemplateIds; + } + + // quality_info - computed: false, optional: false, required: true + private _qualityInfo = new VodTranscodingTemplateGroupQualityInfoList(this, "quality_info", false); + public get qualityInfo() { + return this._qualityInfo; + } + public putQualityInfo(value: VodTranscodingTemplateGroupQualityInfo[] | cdktf.IResolvable) { + this._qualityInfo.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get qualityInfoInput() { + return this._qualityInfo.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + audio_codec: cdktf.stringToTerraform(this._audioCodec), + auto_encrypt: cdktf.booleanToTerraform(this._autoEncrypt), + description: cdktf.stringToTerraform(this._description), + hls_segment_duration: cdktf.numberToTerraform(this._hlsSegmentDuration), + id: cdktf.stringToTerraform(this._id), + is_default: cdktf.booleanToTerraform(this._isDefault), + low_bitrate_hd: cdktf.booleanToTerraform(this._lowBitrateHd), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + video_codec: cdktf.stringToTerraform(this._videoCodec), + watermark_template_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._watermarkTemplateIds), + quality_info: cdktf.listMapper(vodTranscodingTemplateGroupQualityInfoToTerraform, true)(this._qualityInfo.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + audio_codec: { + value: cdktf.stringToHclTerraform(this._audioCodec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_encrypt: { + value: cdktf.booleanToHclTerraform(this._autoEncrypt), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + hls_segment_duration: { + value: cdktf.numberToHclTerraform(this._hlsSegmentDuration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_default: { + value: cdktf.booleanToHclTerraform(this._isDefault), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + low_bitrate_hd: { + value: cdktf.booleanToHclTerraform(this._lowBitrateHd), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + video_codec: { + value: cdktf.stringToHclTerraform(this._videoCodec), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + watermark_template_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._watermarkTemplateIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + quality_info: { + value: cdktf.listMapperHcl(vodTranscodingTemplateGroupQualityInfoToHclTerraform, true)(this._qualityInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "VodTranscodingTemplateGroupQualityInfoList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vod-watermark-template/README.md b/src/constructs/providers/huaweicloud/vod-watermark-template/README.md new file mode 100644 index 00000000..b7cbee7e --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-watermark-template/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vod_watermark_template` + +Refer to the Terraform Registry for docs: [`huaweicloud_vod_watermark_template`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template). diff --git a/src/constructs/providers/huaweicloud/vod-watermark-template/index.ts b/src/constructs/providers/huaweicloud/vod-watermark-template/index.ts new file mode 100644 index 00000000..7ecde364 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vod-watermark-template/index.ts @@ -0,0 +1,577 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VodWatermarkTemplateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#height VodWatermarkTemplate#height} + */ + readonly height?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#horizontal_offset VodWatermarkTemplate#horizontal_offset} + */ + readonly horizontalOffset?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#id VodWatermarkTemplate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#image_file VodWatermarkTemplate#image_file} + */ + readonly imageFile: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#image_process VodWatermarkTemplate#image_process} + */ + readonly imageProcess?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#image_type VodWatermarkTemplate#image_type} + */ + readonly imageType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#name VodWatermarkTemplate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#position VodWatermarkTemplate#position} + */ + readonly position?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#region VodWatermarkTemplate#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#timeline_duration VodWatermarkTemplate#timeline_duration} + */ + readonly timelineDuration?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#timeline_start VodWatermarkTemplate#timeline_start} + */ + readonly timelineStart?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#vertical_offset VodWatermarkTemplate#vertical_offset} + */ + readonly verticalOffset?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#width VodWatermarkTemplate#width} + */ + readonly width?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#timeouts VodWatermarkTemplate#timeouts} + */ + readonly timeouts?: VodWatermarkTemplateTimeouts; +} +export interface VodWatermarkTemplateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#create VodWatermarkTemplate#create} + */ + readonly create?: string; +} + +export function vodWatermarkTemplateTimeoutsToTerraform(struct?: VodWatermarkTemplateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function vodWatermarkTemplateTimeoutsToHclTerraform(struct?: VodWatermarkTemplateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VodWatermarkTemplateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VodWatermarkTemplateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VodWatermarkTemplateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template huaweicloud_vod_watermark_template} +*/ +export class VodWatermarkTemplate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vod_watermark_template"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VodWatermarkTemplate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VodWatermarkTemplate to import + * @param importFromId The id of the existing VodWatermarkTemplate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VodWatermarkTemplate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vod_watermark_template", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vod_watermark_template huaweicloud_vod_watermark_template} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VodWatermarkTemplateConfig + */ + public constructor(scope: Construct, id: string, config: VodWatermarkTemplateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vod_watermark_template', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._height = config.height; + this._horizontalOffset = config.horizontalOffset; + this._id = config.id; + this._imageFile = config.imageFile; + this._imageProcess = config.imageProcess; + this._imageType = config.imageType; + this._name = config.name; + this._position = config.position; + this._region = config.region; + this._timelineDuration = config.timelineDuration; + this._timelineStart = config.timelineStart; + this._verticalOffset = config.verticalOffset; + this._width = config.width; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // height - computed: false, optional: true, required: false + private _height?: string; + public get height() { + return this.getStringAttribute('height'); + } + public set height(value: string) { + this._height = value; + } + public resetHeight() { + this._height = undefined; + } + // Temporarily expose input value. Use with caution. + public get heightInput() { + return this._height; + } + + // horizontal_offset - computed: false, optional: true, required: false + private _horizontalOffset?: string; + public get horizontalOffset() { + return this.getStringAttribute('horizontal_offset'); + } + public set horizontalOffset(value: string) { + this._horizontalOffset = value; + } + public resetHorizontalOffset() { + this._horizontalOffset = undefined; + } + // Temporarily expose input value. Use with caution. + public get horizontalOffsetInput() { + return this._horizontalOffset; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_file - computed: false, optional: false, required: true + private _imageFile?: string; + public get imageFile() { + return this.getStringAttribute('image_file'); + } + public set imageFile(value: string) { + this._imageFile = value; + } + // Temporarily expose input value. Use with caution. + public get imageFileInput() { + return this._imageFile; + } + + // image_process - computed: false, optional: true, required: false + private _imageProcess?: string; + public get imageProcess() { + return this.getStringAttribute('image_process'); + } + public set imageProcess(value: string) { + this._imageProcess = value; + } + public resetImageProcess() { + this._imageProcess = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageProcessInput() { + return this._imageProcess; + } + + // image_type - computed: false, optional: false, required: true + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // image_url - computed: true, optional: false, required: false + public get imageUrl() { + return this.getStringAttribute('image_url'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // position - computed: false, optional: true, required: false + private _position?: string; + public get position() { + return this.getStringAttribute('position'); + } + public set position(value: string) { + this._position = value; + } + public resetPosition() { + this._position = undefined; + } + // Temporarily expose input value. Use with caution. + public get positionInput() { + return this._position; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeline_duration - computed: false, optional: true, required: false + private _timelineDuration?: string; + public get timelineDuration() { + return this.getStringAttribute('timeline_duration'); + } + public set timelineDuration(value: string) { + this._timelineDuration = value; + } + public resetTimelineDuration() { + this._timelineDuration = undefined; + } + // Temporarily expose input value. Use with caution. + public get timelineDurationInput() { + return this._timelineDuration; + } + + // timeline_start - computed: false, optional: true, required: false + private _timelineStart?: string; + public get timelineStart() { + return this.getStringAttribute('timeline_start'); + } + public set timelineStart(value: string) { + this._timelineStart = value; + } + public resetTimelineStart() { + this._timelineStart = undefined; + } + // Temporarily expose input value. Use with caution. + public get timelineStartInput() { + return this._timelineStart; + } + + // vertical_offset - computed: false, optional: true, required: false + private _verticalOffset?: string; + public get verticalOffset() { + return this.getStringAttribute('vertical_offset'); + } + public set verticalOffset(value: string) { + this._verticalOffset = value; + } + public resetVerticalOffset() { + this._verticalOffset = undefined; + } + // Temporarily expose input value. Use with caution. + public get verticalOffsetInput() { + return this._verticalOffset; + } + + // watermark_type - computed: true, optional: false, required: false + public get watermarkType() { + return this.getStringAttribute('watermark_type'); + } + + // width - computed: false, optional: true, required: false + private _width?: string; + public get width() { + return this.getStringAttribute('width'); + } + public set width(value: string) { + this._width = value; + } + public resetWidth() { + this._width = undefined; + } + // Temporarily expose input value. Use with caution. + public get widthInput() { + return this._width; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VodWatermarkTemplateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VodWatermarkTemplateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + height: cdktf.stringToTerraform(this._height), + horizontal_offset: cdktf.stringToTerraform(this._horizontalOffset), + id: cdktf.stringToTerraform(this._id), + image_file: cdktf.stringToTerraform(this._imageFile), + image_process: cdktf.stringToTerraform(this._imageProcess), + image_type: cdktf.stringToTerraform(this._imageType), + name: cdktf.stringToTerraform(this._name), + position: cdktf.stringToTerraform(this._position), + region: cdktf.stringToTerraform(this._region), + timeline_duration: cdktf.stringToTerraform(this._timelineDuration), + timeline_start: cdktf.stringToTerraform(this._timelineStart), + vertical_offset: cdktf.stringToTerraform(this._verticalOffset), + width: cdktf.stringToTerraform(this._width), + timeouts: vodWatermarkTemplateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + height: { + value: cdktf.stringToHclTerraform(this._height), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + horizontal_offset: { + value: cdktf.stringToHclTerraform(this._horizontalOffset), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_file: { + value: cdktf.stringToHclTerraform(this._imageFile), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_process: { + value: cdktf.stringToHclTerraform(this._imageProcess), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + position: { + value: cdktf.stringToHclTerraform(this._position), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeline_duration: { + value: cdktf.stringToHclTerraform(this._timelineDuration), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeline_start: { + value: cdktf.stringToHclTerraform(this._timelineStart), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vertical_offset: { + value: cdktf.stringToHclTerraform(this._verticalOffset), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + width: { + value: cdktf.stringToHclTerraform(this._width), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vodWatermarkTemplateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VodWatermarkTemplateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-address-group/README.md b/src/constructs/providers/huaweicloud/vpc-address-group/README.md new file mode 100644 index 00000000..b499acaa --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-address-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_address_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_address_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group). diff --git a/src/constructs/providers/huaweicloud/vpc-address-group/index.ts b/src/constructs/providers/huaweicloud/vpc-address-group/index.ts new file mode 100644 index 00000000..ba32aabd --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-address-group/index.ts @@ -0,0 +1,703 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcAddressGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#addresses VpcAddressGroup#addresses} + */ + readonly addresses?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#description VpcAddressGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#enterprise_project_id VpcAddressGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#force_destroy VpcAddressGroup#force_destroy} + */ + readonly forceDestroy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#id VpcAddressGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#ip_version VpcAddressGroup#ip_version} + */ + readonly ipVersion?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#max_capacity VpcAddressGroup#max_capacity} + */ + readonly maxCapacity?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#name VpcAddressGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#region VpcAddressGroup#region} + */ + readonly region?: string; + /** + * ip_extra_set block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#ip_extra_set VpcAddressGroup#ip_extra_set} + */ + readonly ipExtraSet?: VpcAddressGroupIpExtraSet[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#timeouts VpcAddressGroup#timeouts} + */ + readonly timeouts?: VpcAddressGroupTimeouts; +} +export interface VpcAddressGroupIpExtraSet { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#ip VpcAddressGroup#ip} + */ + readonly ip: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#remarks VpcAddressGroup#remarks} + */ + readonly remarks?: string; +} + +export function vpcAddressGroupIpExtraSetToTerraform(struct?: VpcAddressGroupIpExtraSet | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip: cdktf.stringToTerraform(struct!.ip), + remarks: cdktf.stringToTerraform(struct!.remarks), + } +} + + +export function vpcAddressGroupIpExtraSetToHclTerraform(struct?: VpcAddressGroupIpExtraSet | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip: { + value: cdktf.stringToHclTerraform(struct!.ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + remarks: { + value: cdktf.stringToHclTerraform(struct!.remarks), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcAddressGroupIpExtraSetOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcAddressGroupIpExtraSet | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ip !== undefined) { + hasAnyValues = true; + internalValueResult.ip = this._ip; + } + if (this._remarks !== undefined) { + hasAnyValues = true; + internalValueResult.remarks = this._remarks; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcAddressGroupIpExtraSet | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._ip = undefined; + this._remarks = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._ip = value.ip; + this._remarks = value.remarks; + } + } + + // ip - computed: false, optional: false, required: true + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // remarks - computed: false, optional: true, required: false + private _remarks?: string; + public get remarks() { + return this.getStringAttribute('remarks'); + } + public set remarks(value: string) { + this._remarks = value; + } + public resetRemarks() { + this._remarks = undefined; + } + // Temporarily expose input value. Use with caution. + public get remarksInput() { + return this._remarks; + } +} + +export class VpcAddressGroupIpExtraSetList extends cdktf.ComplexList { + public internalValue? : VpcAddressGroupIpExtraSet[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcAddressGroupIpExtraSetOutputReference { + return new VpcAddressGroupIpExtraSetOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcAddressGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#create VpcAddressGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#delete VpcAddressGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#update VpcAddressGroup#update} + */ + readonly update?: string; +} + +export function vpcAddressGroupTimeoutsToTerraform(struct?: VpcAddressGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpcAddressGroupTimeoutsToHclTerraform(struct?: VpcAddressGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcAddressGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcAddressGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcAddressGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group huaweicloud_vpc_address_group} +*/ +export class VpcAddressGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_address_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcAddressGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcAddressGroup to import + * @param importFromId The id of the existing VpcAddressGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcAddressGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_address_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_address_group huaweicloud_vpc_address_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcAddressGroupConfig + */ + public constructor(scope: Construct, id: string, config: VpcAddressGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_address_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._addresses = config.addresses; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forceDestroy = config.forceDestroy; + this._id = config.id; + this._ipVersion = config.ipVersion; + this._maxCapacity = config.maxCapacity; + this._name = config.name; + this._region = config.region; + this._ipExtraSet.internalValue = config.ipExtraSet; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // addresses - computed: true, optional: true, required: false + private _addresses?: string[]; + public get addresses() { + return cdktf.Fn.tolist(this.getListAttribute('addresses')); + } + public set addresses(value: string[]) { + this._addresses = value; + } + public resetAddresses() { + this._addresses = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressesInput() { + return this._addresses; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // force_destroy - computed: false, optional: true, required: false + private _forceDestroy?: boolean | cdktf.IResolvable; + public get forceDestroy() { + return this.getBooleanAttribute('force_destroy'); + } + public set forceDestroy(value: boolean | cdktf.IResolvable) { + this._forceDestroy = value; + } + public resetForceDestroy() { + this._forceDestroy = undefined; + } + // Temporarily expose input value. Use with caution. + public get forceDestroyInput() { + return this._forceDestroy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_version - computed: false, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // max_capacity - computed: true, optional: true, required: false + private _maxCapacity?: number; + public get maxCapacity() { + return this.getNumberAttribute('max_capacity'); + } + public set maxCapacity(value: number) { + this._maxCapacity = value; + } + public resetMaxCapacity() { + this._maxCapacity = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxCapacityInput() { + return this._maxCapacity; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ip_extra_set - computed: false, optional: true, required: false + private _ipExtraSet = new VpcAddressGroupIpExtraSetList(this, "ip_extra_set", true); + public get ipExtraSet() { + return this._ipExtraSet; + } + public putIpExtraSet(value: VpcAddressGroupIpExtraSet[] | cdktf.IResolvable) { + this._ipExtraSet.internalValue = value; + } + public resetIpExtraSet() { + this._ipExtraSet.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipExtraSetInput() { + return this._ipExtraSet.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcAddressGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcAddressGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + addresses: cdktf.listMapper(cdktf.stringToTerraform, false)(this._addresses), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + force_destroy: cdktf.booleanToTerraform(this._forceDestroy), + id: cdktf.stringToTerraform(this._id), + ip_version: cdktf.numberToTerraform(this._ipVersion), + max_capacity: cdktf.numberToTerraform(this._maxCapacity), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + ip_extra_set: cdktf.listMapper(vpcAddressGroupIpExtraSetToTerraform, true)(this._ipExtraSet.internalValue), + timeouts: vpcAddressGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + addresses: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._addresses), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + force_destroy: { + value: cdktf.booleanToHclTerraform(this._forceDestroy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_capacity: { + value: cdktf.numberToHclTerraform(this._maxCapacity), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_extra_set: { + value: cdktf.listMapperHcl(vpcAddressGroupIpExtraSetToHclTerraform, true)(this._ipExtraSet.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpcAddressGroupIpExtraSetList", + }, + timeouts: { + value: vpcAddressGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcAddressGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-bandwidth-associate/README.md b/src/constructs/providers/huaweicloud/vpc-bandwidth-associate/README.md new file mode 100644 index 00000000..6bf8d38b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-bandwidth-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_bandwidth_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_bandwidth_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate). diff --git a/src/constructs/providers/huaweicloud/vpc-bandwidth-associate/index.ts b/src/constructs/providers/huaweicloud/vpc-bandwidth-associate/index.ts new file mode 100644 index 00000000..e7b1e07b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-bandwidth-associate/index.ts @@ -0,0 +1,264 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcBandwidthAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * The charge mode after removal bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#bandwidth_charge_mode VpcBandwidthAssociate#bandwidth_charge_mode} + */ + readonly bandwidthChargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#bandwidth_id VpcBandwidthAssociate#bandwidth_id} + */ + readonly bandwidthId: string; + /** + * The size (Mbits/s) after removal bandwidth. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#bandwidth_size VpcBandwidthAssociate#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#eip_id VpcBandwidthAssociate#eip_id} + */ + readonly eipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#id VpcBandwidthAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#region VpcBandwidthAssociate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate huaweicloud_vpc_bandwidth_associate} +*/ +export class VpcBandwidthAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_bandwidth_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcBandwidthAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcBandwidthAssociate to import + * @param importFromId The id of the existing VpcBandwidthAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcBandwidthAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_bandwidth_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_associate huaweicloud_vpc_bandwidth_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcBandwidthAssociateConfig + */ + public constructor(scope: Construct, id: string, config: VpcBandwidthAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_bandwidth_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._bandwidthChargeMode = config.bandwidthChargeMode; + this._bandwidthId = config.bandwidthId; + this._bandwidthSize = config.bandwidthSize; + this._eipId = config.eipId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // bandwidth_charge_mode - computed: false, optional: true, required: false + private _bandwidthChargeMode?: string; + public get bandwidthChargeMode() { + return this.getStringAttribute('bandwidth_charge_mode'); + } + public set bandwidthChargeMode(value: string) { + this._bandwidthChargeMode = value; + } + public resetBandwidthChargeMode() { + this._bandwidthChargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthChargeModeInput() { + return this._bandwidthChargeMode; + } + + // bandwidth_id - computed: false, optional: false, required: true + private _bandwidthId?: string; + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + public set bandwidthId(value: string) { + this._bandwidthId = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthIdInput() { + return this._bandwidthId; + } + + // bandwidth_name - computed: true, optional: false, required: false + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + + // bandwidth_size - computed: false, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // eip_id - computed: false, optional: false, required: true + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + bandwidth_charge_mode: cdktf.stringToTerraform(this._bandwidthChargeMode), + bandwidth_id: cdktf.stringToTerraform(this._bandwidthId), + bandwidth_size: cdktf.numberToTerraform(this._bandwidthSize), + eip_id: cdktf.stringToTerraform(this._eipId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + bandwidth_charge_mode: { + value: cdktf.stringToHclTerraform(this._bandwidthChargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_id: { + value: cdktf.stringToHclTerraform(this._bandwidthId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(this._bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-bandwidth-v2/README.md b/src/constructs/providers/huaweicloud/vpc-bandwidth-v2/README.md new file mode 100644 index 00000000..36852e76 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-bandwidth-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_bandwidth_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_bandwidth_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2). diff --git a/src/constructs/providers/huaweicloud/vpc-bandwidth-v2/index.ts b/src/constructs/providers/huaweicloud/vpc-bandwidth-v2/index.ts new file mode 100644 index 00000000..fe312a86 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-bandwidth-v2/index.ts @@ -0,0 +1,724 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcBandwidthV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#auto_renew VpcBandwidthV2#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#bandwidth_type VpcBandwidthV2#bandwidth_type} + */ + readonly bandwidthType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#charge_mode VpcBandwidthV2#charge_mode} + */ + readonly chargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#charging_mode VpcBandwidthV2#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#enterprise_project_id VpcBandwidthV2#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#id VpcBandwidthV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#name VpcBandwidthV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#period VpcBandwidthV2#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#period_unit VpcBandwidthV2#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#public_border_group VpcBandwidthV2#public_border_group} + */ + readonly publicBorderGroup?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#region VpcBandwidthV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#size VpcBandwidthV2#size} + */ + readonly size: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#timeouts VpcBandwidthV2#timeouts} + */ + readonly timeouts?: VpcBandwidthV2Timeouts; +} +export interface VpcBandwidthV2Publicips { +} + +export function vpcBandwidthV2PublicipsToTerraform(struct?: VpcBandwidthV2Publicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function vpcBandwidthV2PublicipsToHclTerraform(struct?: VpcBandwidthV2Publicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class VpcBandwidthV2PublicipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcBandwidthV2Publicips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcBandwidthV2Publicips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class VpcBandwidthV2PublicipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcBandwidthV2PublicipsOutputReference { + return new VpcBandwidthV2PublicipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcBandwidthV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#create VpcBandwidthV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#delete VpcBandwidthV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#update VpcBandwidthV2#update} + */ + readonly update?: string; +} + +export function vpcBandwidthV2TimeoutsToTerraform(struct?: VpcBandwidthV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpcBandwidthV2TimeoutsToHclTerraform(struct?: VpcBandwidthV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcBandwidthV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcBandwidthV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcBandwidthV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2 huaweicloud_vpc_bandwidth_v2} +*/ +export class VpcBandwidthV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_bandwidth_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcBandwidthV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcBandwidthV2 to import + * @param importFromId The id of the existing VpcBandwidthV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcBandwidthV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_bandwidth_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth_v2 huaweicloud_vpc_bandwidth_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcBandwidthV2Config + */ + public constructor(scope: Construct, id: string, config: VpcBandwidthV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_bandwidth_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._bandwidthType = config.bandwidthType; + this._chargeMode = config.chargeMode; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._publicBorderGroup = config.publicBorderGroup; + this._region = config.region; + this._size = config.size; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // bandwidth_type - computed: true, optional: true, required: false + private _bandwidthType?: string; + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + public set bandwidthType(value: string) { + this._bandwidthType = value; + } + public resetBandwidthType() { + this._bandwidthType = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthTypeInput() { + return this._bandwidthType; + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // public_border_group - computed: true, optional: true, required: false + private _publicBorderGroup?: string; + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + public set publicBorderGroup(value: string) { + this._publicBorderGroup = value; + } + public resetPublicBorderGroup() { + this._publicBorderGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicBorderGroupInput() { + return this._publicBorderGroup; + } + + // publicips - computed: true, optional: false, required: false + private _publicips = new VpcBandwidthV2PublicipsList(this, "publicips", false); + public get publicips() { + return this._publicips; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcBandwidthV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcBandwidthV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + bandwidth_type: cdktf.stringToTerraform(this._bandwidthType), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + public_border_group: cdktf.stringToTerraform(this._publicBorderGroup), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + timeouts: vpcBandwidthV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_type: { + value: cdktf.stringToHclTerraform(this._bandwidthType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_border_group: { + value: cdktf.stringToHclTerraform(this._publicBorderGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: vpcBandwidthV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcBandwidthV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-bandwidth/README.md b/src/constructs/providers/huaweicloud/vpc-bandwidth/README.md new file mode 100644 index 00000000..75c498cb --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-bandwidth/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_bandwidth` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_bandwidth`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth). diff --git a/src/constructs/providers/huaweicloud/vpc-bandwidth/index.ts b/src/constructs/providers/huaweicloud/vpc-bandwidth/index.ts new file mode 100644 index 00000000..aae98bcf --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-bandwidth/index.ts @@ -0,0 +1,724 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcBandwidthConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#auto_renew VpcBandwidth#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#bandwidth_type VpcBandwidth#bandwidth_type} + */ + readonly bandwidthType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#charge_mode VpcBandwidth#charge_mode} + */ + readonly chargeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#charging_mode VpcBandwidth#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#enterprise_project_id VpcBandwidth#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#id VpcBandwidth#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#name VpcBandwidth#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#period VpcBandwidth#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#period_unit VpcBandwidth#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#public_border_group VpcBandwidth#public_border_group} + */ + readonly publicBorderGroup?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#region VpcBandwidth#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#size VpcBandwidth#size} + */ + readonly size: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#timeouts VpcBandwidth#timeouts} + */ + readonly timeouts?: VpcBandwidthTimeouts; +} +export interface VpcBandwidthPublicips { +} + +export function vpcBandwidthPublicipsToTerraform(struct?: VpcBandwidthPublicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function vpcBandwidthPublicipsToHclTerraform(struct?: VpcBandwidthPublicips): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class VpcBandwidthPublicipsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcBandwidthPublicips | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcBandwidthPublicips | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } +} + +export class VpcBandwidthPublicipsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcBandwidthPublicipsOutputReference { + return new VpcBandwidthPublicipsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcBandwidthTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#create VpcBandwidth#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#delete VpcBandwidth#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#update VpcBandwidth#update} + */ + readonly update?: string; +} + +export function vpcBandwidthTimeoutsToTerraform(struct?: VpcBandwidthTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpcBandwidthTimeoutsToHclTerraform(struct?: VpcBandwidthTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcBandwidthTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcBandwidthTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcBandwidthTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth huaweicloud_vpc_bandwidth} +*/ +export class VpcBandwidth extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_bandwidth"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcBandwidth resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcBandwidth to import + * @param importFromId The id of the existing VpcBandwidth that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcBandwidth to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_bandwidth", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_bandwidth huaweicloud_vpc_bandwidth} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcBandwidthConfig + */ + public constructor(scope: Construct, id: string, config: VpcBandwidthConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_bandwidth', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._bandwidthType = config.bandwidthType; + this._chargeMode = config.chargeMode; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._publicBorderGroup = config.publicBorderGroup; + this._region = config.region; + this._size = config.size; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // bandwidth_type - computed: true, optional: true, required: false + private _bandwidthType?: string; + public get bandwidthType() { + return this.getStringAttribute('bandwidth_type'); + } + public set bandwidthType(value: string) { + this._bandwidthType = value; + } + public resetBandwidthType() { + this._bandwidthType = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthTypeInput() { + return this._bandwidthType; + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // public_border_group - computed: true, optional: true, required: false + private _publicBorderGroup?: string; + public get publicBorderGroup() { + return this.getStringAttribute('public_border_group'); + } + public set publicBorderGroup(value: string) { + this._publicBorderGroup = value; + } + public resetPublicBorderGroup() { + this._publicBorderGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get publicBorderGroupInput() { + return this._publicBorderGroup; + } + + // publicips - computed: true, optional: false, required: false + private _publicips = new VpcBandwidthPublicipsList(this, "publicips", false); + public get publicips() { + return this._publicips; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // share_type - computed: true, optional: false, required: false + public get shareType() { + return this.getStringAttribute('share_type'); + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcBandwidthTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcBandwidthTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + bandwidth_type: cdktf.stringToTerraform(this._bandwidthType), + charge_mode: cdktf.stringToTerraform(this._chargeMode), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + public_border_group: cdktf.stringToTerraform(this._publicBorderGroup), + region: cdktf.stringToTerraform(this._region), + size: cdktf.numberToTerraform(this._size), + timeouts: vpcBandwidthTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_type: { + value: cdktf.stringToHclTerraform(this._bandwidthType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(this._chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_border_group: { + value: cdktf.stringToHclTerraform(this._publicBorderGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(this._size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: vpcBandwidthTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcBandwidthTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-eip-associate/README.md b/src/constructs/providers/huaweicloud/vpc-eip-associate/README.md new file mode 100644 index 00000000..81330175 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate). diff --git a/src/constructs/providers/huaweicloud/vpc-eip-associate/index.ts b/src/constructs/providers/huaweicloud/vpc-eip-associate/index.ts new file mode 100644 index 00000000..f2a3b78d --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eip-associate/index.ts @@ -0,0 +1,425 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#fixed_ip VpcEipAssociate#fixed_ip} + */ + readonly fixedIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#id VpcEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#network_id VpcEipAssociate#network_id} + */ + readonly networkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#port_id VpcEipAssociate#port_id} + */ + readonly portId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#public_ip VpcEipAssociate#public_ip} + */ + readonly publicIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#region VpcEipAssociate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#timeouts VpcEipAssociate#timeouts} + */ + readonly timeouts?: VpcEipAssociateTimeouts; +} +export interface VpcEipAssociateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#create VpcEipAssociate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#delete VpcEipAssociate#delete} + */ + readonly delete?: string; +} + +export function vpcEipAssociateTimeoutsToTerraform(struct?: VpcEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcEipAssociateTimeoutsToHclTerraform(struct?: VpcEipAssociateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipAssociateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcEipAssociateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipAssociateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate huaweicloud_vpc_eip_associate} +*/ +export class VpcEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcEipAssociate to import + * @param importFromId The id of the existing VpcEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_associate huaweicloud_vpc_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: VpcEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._fixedIp = config.fixedIp; + this._id = config.id; + this._networkId = config.networkId; + this._portId = config.portId; + this._publicIp = config.publicIp; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // fixed_ip - computed: true, optional: true, required: false + private _fixedIp?: string; + public get fixedIp() { + return this.getStringAttribute('fixed_ip'); + } + public set fixedIp(value: string) { + this._fixedIp = value; + } + public resetFixedIp() { + this._fixedIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpInput() { + return this._fixedIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // public_ip - computed: false, optional: false, required: true + private _publicIp?: string; + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + public set publicIp(value: string) { + this._publicIp = value; + } + // Temporarily expose input value. Use with caution. + public get publicIpInput() { + return this._publicIp; + } + + // public_ipv6 - computed: true, optional: false, required: false + public get publicIpv6() { + return this.getStringAttribute('public_ipv6'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcEipAssociateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcEipAssociateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + fixed_ip: cdktf.stringToTerraform(this._fixedIp), + id: cdktf.stringToTerraform(this._id), + network_id: cdktf.stringToTerraform(this._networkId), + port_id: cdktf.stringToTerraform(this._portId), + public_ip: cdktf.stringToTerraform(this._publicIp), + region: cdktf.stringToTerraform(this._region), + timeouts: vpcEipAssociateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + fixed_ip: { + value: cdktf.stringToHclTerraform(this._fixedIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + public_ip: { + value: cdktf.stringToHclTerraform(this._publicIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcEipAssociateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcEipAssociateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-eip-v1/README.md b/src/constructs/providers/huaweicloud/vpc-eip-v1/README.md new file mode 100644 index 00000000..c4e0b3cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eip-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_eip_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_eip_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1). diff --git a/src/constructs/providers/huaweicloud/vpc-eip-v1/index.ts b/src/constructs/providers/huaweicloud/vpc-eip-v1/index.ts new file mode 100644 index 00000000..2832c788 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eip-v1/index.ts @@ -0,0 +1,1090 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcEipV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#auto_pay VpcEipV1#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#auto_renew VpcEipV1#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#charging_mode VpcEipV1#charging_mode} + */ + readonly chargingMode?: string; + /** + * The enterprise project ID to which the EIP belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#enterprise_project_id VpcEipV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#id VpcEipV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the EIP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#name VpcEipV1#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#period VpcEipV1#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#period_unit VpcEipV1#period_unit} + */ + readonly periodUnit?: string; + /** + * The region in which to create the EIP resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#region VpcEipV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#tags VpcEipV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#bandwidth VpcEipV1#bandwidth} + */ + readonly bandwidth: VpcEipV1Bandwidth; + /** + * publicip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#publicip VpcEipV1#publicip} + */ + readonly publicip: VpcEipV1Publicip; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#timeouts VpcEipV1#timeouts} + */ + readonly timeouts?: VpcEipV1Timeouts; +} +export interface VpcEipV1Bandwidth { + /** + * Whether the bandwidth is billed by traffic or by bandwidth size. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#charge_mode VpcEipV1#charge_mode} + */ + readonly chargeMode?: string; + /** + * The shared bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#id VpcEipV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The dedicated bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#name VpcEipV1#name} + */ + readonly name?: string; + /** + * Whether the bandwidth is dedicated or shared. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#share_type VpcEipV1#share_type} + */ + readonly shareType: string; + /** + * The dedicated bandwidth size. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#size VpcEipV1#size} + */ + readonly size?: number; +} + +export function vpcEipV1BandwidthToTerraform(struct?: VpcEipV1BandwidthOutputReference | VpcEipV1Bandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function vpcEipV1BandwidthToHclTerraform(struct?: VpcEipV1BandwidthOutputReference | VpcEipV1Bandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipV1BandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpcEipV1Bandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipV1Bandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargeMode = undefined; + this._id = undefined; + this._name = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._name = value.name; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface VpcEipV1Publicip { + /** + * The EIP address to be assigned. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#ip_address VpcEipV1#ip_address} + */ + readonly ipAddress?: string; + /** + * The IP version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#ip_version VpcEipV1#ip_version} + */ + readonly ipVersion?: number; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#port_id VpcEipV1#port_id} + */ + readonly portId?: string; + /** + * The EIP type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#type VpcEipV1#type} + */ + readonly type?: string; +} + +export function vpcEipV1PublicipToTerraform(struct?: VpcEipV1PublicipOutputReference | VpcEipV1Publicip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + ip_version: cdktf.numberToTerraform(struct!.ipVersion), + port_id: cdktf.stringToTerraform(struct!.portId), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpcEipV1PublicipToHclTerraform(struct?: VpcEipV1PublicipOutputReference | VpcEipV1Publicip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(struct!.ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port_id: { + value: cdktf.stringToHclTerraform(struct!.portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipV1PublicipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpcEipV1Publicip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._ipVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ipVersion = this._ipVersion; + } + if (this._portId !== undefined) { + hasAnyValues = true; + internalValueResult.portId = this._portId; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipV1Publicip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipAddress = undefined; + this._ipVersion = undefined; + this._portId = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipAddress = value.ipAddress; + this._ipVersion = value.ipVersion; + this._portId = value.portId; + this._type = value.type; + } + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface VpcEipV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#create VpcEipV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#delete VpcEipV1#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#update VpcEipV1#update} + */ + readonly update?: string; +} + +export function vpcEipV1TimeoutsToTerraform(struct?: VpcEipV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpcEipV1TimeoutsToHclTerraform(struct?: VpcEipV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcEipV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1 huaweicloud_vpc_eip_v1} +*/ +export class VpcEipV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_eip_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcEipV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcEipV1 to import + * @param importFromId The id of the existing VpcEipV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcEipV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_eip_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip_v1 huaweicloud_vpc_eip_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcEipV1Config + */ + public constructor(scope: Construct, id: string, config: VpcEipV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_eip_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._tags = config.tags; + this._bandwidth.internalValue = config.bandwidth; + this._publicip.internalValue = config.publicip; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // associate_id - computed: true, optional: false, required: false + public get associateId() { + return this.getStringAttribute('associate_id'); + } + + // associate_type - computed: true, optional: false, required: false + public get associateType() { + return this.getStringAttribute('associate_type'); + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // ipv6_address - computed: true, optional: false, required: false + public get ipv6Address() { + return this.getStringAttribute('ipv6_address'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth = new VpcEipV1BandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: VpcEipV1Bandwidth) { + this._bandwidth.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } + + // publicip - computed: false, optional: false, required: true + private _publicip = new VpcEipV1PublicipOutputReference(this, "publicip"); + public get publicip() { + return this._publicip; + } + public putPublicip(value: VpcEipV1Publicip) { + this._publicip.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get publicipInput() { + return this._publicip.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcEipV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcEipV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + bandwidth: vpcEipV1BandwidthToTerraform(this._bandwidth.internalValue), + publicip: vpcEipV1PublicipToTerraform(this._publicip.internalValue), + timeouts: vpcEipV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + bandwidth: { + value: vpcEipV1BandwidthToHclTerraform(this._bandwidth.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcEipV1BandwidthList", + }, + publicip: { + value: vpcEipV1PublicipToHclTerraform(this._publicip.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcEipV1PublicipList", + }, + timeouts: { + value: vpcEipV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcEipV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-eip/README.md b/src/constructs/providers/huaweicloud/vpc-eip/README.md new file mode 100644 index 00000000..d9bc5ed0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eip/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_eip` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_eip`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip). diff --git a/src/constructs/providers/huaweicloud/vpc-eip/index.ts b/src/constructs/providers/huaweicloud/vpc-eip/index.ts new file mode 100644 index 00000000..d359b064 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eip/index.ts @@ -0,0 +1,1090 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcEipConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#auto_pay VpcEip#auto_pay} + */ + readonly autoPay?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#auto_renew VpcEip#auto_renew} + */ + readonly autoRenew?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#charging_mode VpcEip#charging_mode} + */ + readonly chargingMode?: string; + /** + * The enterprise project ID to which the EIP belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#enterprise_project_id VpcEip#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#id VpcEip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the EIP. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#name VpcEip#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#period VpcEip#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#period_unit VpcEip#period_unit} + */ + readonly periodUnit?: string; + /** + * The region in which to create the EIP resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#region VpcEip#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#tags VpcEip#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * bandwidth block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#bandwidth VpcEip#bandwidth} + */ + readonly bandwidth: VpcEipBandwidth; + /** + * publicip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#publicip VpcEip#publicip} + */ + readonly publicip: VpcEipPublicip; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#timeouts VpcEip#timeouts} + */ + readonly timeouts?: VpcEipTimeouts; +} +export interface VpcEipBandwidth { + /** + * Whether the bandwidth is billed by traffic or by bandwidth size. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#charge_mode VpcEip#charge_mode} + */ + readonly chargeMode?: string; + /** + * The shared bandwidth ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#id VpcEip#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The dedicated bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#name VpcEip#name} + */ + readonly name?: string; + /** + * Whether the bandwidth is dedicated or shared. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#share_type VpcEip#share_type} + */ + readonly shareType: string; + /** + * The dedicated bandwidth size. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#size VpcEip#size} + */ + readonly size?: number; +} + +export function vpcEipBandwidthToTerraform(struct?: VpcEipBandwidthOutputReference | VpcEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + share_type: cdktf.stringToTerraform(struct!.shareType), + size: cdktf.numberToTerraform(struct!.size), + } +} + + +export function vpcEipBandwidthToHclTerraform(struct?: VpcEipBandwidthOutputReference | VpcEipBandwidth): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + share_type: { + value: cdktf.stringToHclTerraform(struct!.shareType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipBandwidthOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpcEipBandwidth | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._shareType !== undefined) { + hasAnyValues = true; + internalValueResult.shareType = this._shareType; + } + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipBandwidth | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._chargeMode = undefined; + this._id = undefined; + this._name = undefined; + this._shareType = undefined; + this._size = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._name = value.name; + this._shareType = value.shareType; + this._size = value.size; + } + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // share_type - computed: false, optional: false, required: true + private _shareType?: string; + public get shareType() { + return this.getStringAttribute('share_type'); + } + public set shareType(value: string) { + this._shareType = value; + } + // Temporarily expose input value. Use with caution. + public get shareTypeInput() { + return this._shareType; + } + + // size - computed: true, optional: true, required: false + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + public resetSize() { + this._size = undefined; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } +} +export interface VpcEipPublicip { + /** + * The EIP address to be assigned. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#ip_address VpcEip#ip_address} + */ + readonly ipAddress?: string; + /** + * The IP version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#ip_version VpcEip#ip_version} + */ + readonly ipVersion?: number; + /** + * schema: Deprecated + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#port_id VpcEip#port_id} + */ + readonly portId?: string; + /** + * The EIP type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#type VpcEip#type} + */ + readonly type?: string; +} + +export function vpcEipPublicipToTerraform(struct?: VpcEipPublicipOutputReference | VpcEipPublicip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_address: cdktf.stringToTerraform(struct!.ipAddress), + ip_version: cdktf.numberToTerraform(struct!.ipVersion), + port_id: cdktf.stringToTerraform(struct!.portId), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpcEipPublicipToHclTerraform(struct?: VpcEipPublicipOutputReference | VpcEipPublicip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_address: { + value: cdktf.stringToHclTerraform(struct!.ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(struct!.ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + port_id: { + value: cdktf.stringToHclTerraform(struct!.portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipPublicipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpcEipPublicip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAddress !== undefined) { + hasAnyValues = true; + internalValueResult.ipAddress = this._ipAddress; + } + if (this._ipVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ipVersion = this._ipVersion; + } + if (this._portId !== undefined) { + hasAnyValues = true; + internalValueResult.portId = this._portId; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipPublicip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipAddress = undefined; + this._ipVersion = undefined; + this._portId = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipAddress = value.ipAddress; + this._ipVersion = value.ipVersion; + this._portId = value.portId; + this._type = value.type; + } + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // port_id - computed: true, optional: true, required: false + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + public resetPortId() { + this._portId = undefined; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface VpcEipTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#create VpcEip#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#delete VpcEip#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#update VpcEip#update} + */ + readonly update?: string; +} + +export function vpcEipTimeoutsToTerraform(struct?: VpcEipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpcEipTimeoutsToHclTerraform(struct?: VpcEipTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcEipTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcEipTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcEipTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip huaweicloud_vpc_eip} +*/ +export class VpcEip extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_eip"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcEip resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcEip to import + * @param importFromId The id of the existing VpcEip that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcEip to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_eip", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eip huaweicloud_vpc_eip} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcEipConfig + */ + public constructor(scope: Construct, id: string, config: VpcEipConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_eip', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoPay = config.autoPay; + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._tags = config.tags; + this._bandwidth.internalValue = config.bandwidth; + this._publicip.internalValue = config.publicip; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // address - computed: true, optional: false, required: false + public get address() { + return this.getStringAttribute('address'); + } + + // associate_id - computed: true, optional: false, required: false + public get associateId() { + return this.getStringAttribute('associate_id'); + } + + // associate_type - computed: true, optional: false, required: false + public get associateType() { + return this.getStringAttribute('associate_type'); + } + + // auto_pay - computed: false, optional: true, required: false + private _autoPay?: string; + public get autoPay() { + return this.getStringAttribute('auto_pay'); + } + public set autoPay(value: string) { + this._autoPay = value; + } + public resetAutoPay() { + this._autoPay = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoPayInput() { + return this._autoPay; + } + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // ipv6_address - computed: true, optional: false, required: false + public get ipv6Address() { + return this.getStringAttribute('ipv6_address'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // port_id - computed: true, optional: false, required: false + public get portId() { + return this.getStringAttribute('port_id'); + } + + // private_ip - computed: true, optional: false, required: false + public get privateIp() { + return this.getStringAttribute('private_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // bandwidth - computed: false, optional: false, required: true + private _bandwidth = new VpcEipBandwidthOutputReference(this, "bandwidth"); + public get bandwidth() { + return this._bandwidth; + } + public putBandwidth(value: VpcEipBandwidth) { + this._bandwidth.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bandwidthInput() { + return this._bandwidth.internalValue; + } + + // publicip - computed: false, optional: false, required: true + private _publicip = new VpcEipPublicipOutputReference(this, "publicip"); + public get publicip() { + return this._publicip; + } + public putPublicip(value: VpcEipPublicip) { + this._publicip.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get publicipInput() { + return this._publicip.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcEipTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcEipTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_pay: cdktf.stringToTerraform(this._autoPay), + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + bandwidth: vpcEipBandwidthToTerraform(this._bandwidth.internalValue), + publicip: vpcEipPublicipToTerraform(this._publicip.internalValue), + timeouts: vpcEipTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_pay: { + value: cdktf.stringToHclTerraform(this._autoPay), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + bandwidth: { + value: vpcEipBandwidthToHclTerraform(this._bandwidth.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcEipBandwidthList", + }, + publicip: { + value: vpcEipPublicipToHclTerraform(this._publicip.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcEipPublicipList", + }, + timeouts: { + value: vpcEipTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcEipTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-eipv3-associate/README.md b/src/constructs/providers/huaweicloud/vpc-eipv3-associate/README.md new file mode 100644 index 00000000..f621de19 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eipv3-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_eipv3_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_eipv3_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate). diff --git a/src/constructs/providers/huaweicloud/vpc-eipv3-associate/index.ts b/src/constructs/providers/huaweicloud/vpc-eipv3-associate/index.ts new file mode 100644 index 00000000..2057900e --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-eipv3-associate/index.ts @@ -0,0 +1,219 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcEipv3AssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate#associate_instance_id VpcEipv3Associate#associate_instance_id} + */ + readonly associateInstanceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate#associate_instance_type VpcEipv3Associate#associate_instance_type} + */ + readonly associateInstanceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate#id VpcEipv3Associate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate#publicip_id VpcEipv3Associate#publicip_id} + */ + readonly publicipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate#region VpcEipv3Associate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate huaweicloud_vpc_eipv3_associate} +*/ +export class VpcEipv3Associate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_eipv3_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcEipv3Associate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcEipv3Associate to import + * @param importFromId The id of the existing VpcEipv3Associate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcEipv3Associate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_eipv3_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_eipv3_associate huaweicloud_vpc_eipv3_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcEipv3AssociateConfig + */ + public constructor(scope: Construct, id: string, config: VpcEipv3AssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_eipv3_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._associateInstanceId = config.associateInstanceId; + this._associateInstanceType = config.associateInstanceType; + this._id = config.id; + this._publicipId = config.publicipId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // associate_instance_id - computed: false, optional: false, required: true + private _associateInstanceId?: string; + public get associateInstanceId() { + return this.getStringAttribute('associate_instance_id'); + } + public set associateInstanceId(value: string) { + this._associateInstanceId = value; + } + // Temporarily expose input value. Use with caution. + public get associateInstanceIdInput() { + return this._associateInstanceId; + } + + // associate_instance_type - computed: false, optional: false, required: true + private _associateInstanceType?: string; + public get associateInstanceType() { + return this.getStringAttribute('associate_instance_type'); + } + public set associateInstanceType(value: string) { + this._associateInstanceType = value; + } + // Temporarily expose input value. Use with caution. + public get associateInstanceTypeInput() { + return this._associateInstanceType; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // publicip_id - computed: false, optional: false, required: true + private _publicipId?: string; + public get publicipId() { + return this.getStringAttribute('publicip_id'); + } + public set publicipId(value: string) { + this._publicipId = value; + } + // Temporarily expose input value. Use with caution. + public get publicipIdInput() { + return this._publicipId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + associate_instance_id: cdktf.stringToTerraform(this._associateInstanceId), + associate_instance_type: cdktf.stringToTerraform(this._associateInstanceType), + id: cdktf.stringToTerraform(this._id), + publicip_id: cdktf.stringToTerraform(this._publicipId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + associate_instance_id: { + value: cdktf.stringToHclTerraform(this._associateInstanceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + associate_instance_type: { + value: cdktf.stringToHclTerraform(this._associateInstanceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publicip_id: { + value: cdktf.stringToHclTerraform(this._publicipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-flow-log/README.md b/src/constructs/providers/huaweicloud/vpc-flow-log/README.md new file mode 100644 index 00000000..0c89b48b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-flow-log/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_flow_log` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_flow_log`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log). diff --git a/src/constructs/providers/huaweicloud/vpc-flow-log/index.ts b/src/constructs/providers/huaweicloud/vpc-flow-log/index.ts new file mode 100644 index 00000000..0b7f0000 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-flow-log/index.ts @@ -0,0 +1,358 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcFlowLogConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#description VpcFlowLog#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#enabled VpcFlowLog#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#id VpcFlowLog#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#log_group_id VpcFlowLog#log_group_id} + */ + readonly logGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#log_stream_id VpcFlowLog#log_stream_id} + */ + readonly logStreamId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#name VpcFlowLog#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#region VpcFlowLog#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#resource_id VpcFlowLog#resource_id} + */ + readonly resourceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#resource_type VpcFlowLog#resource_type} + */ + readonly resourceType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#traffic_type VpcFlowLog#traffic_type} + */ + readonly trafficType?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log huaweicloud_vpc_flow_log} +*/ +export class VpcFlowLog extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_flow_log"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcFlowLog resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcFlowLog to import + * @param importFromId The id of the existing VpcFlowLog that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcFlowLog to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_flow_log", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_flow_log huaweicloud_vpc_flow_log} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcFlowLogConfig + */ + public constructor(scope: Construct, id: string, config: VpcFlowLogConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_flow_log', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._logGroupId = config.logGroupId; + this._logStreamId = config.logStreamId; + this._name = config.name; + this._region = config.region; + this._resourceId = config.resourceId; + this._resourceType = config.resourceType; + this._trafficType = config.trafficType; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // log_group_id - computed: false, optional: false, required: true + private _logGroupId?: string; + public get logGroupId() { + return this.getStringAttribute('log_group_id'); + } + public set logGroupId(value: string) { + this._logGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get logGroupIdInput() { + return this._logGroupId; + } + + // log_stream_id - computed: false, optional: false, required: true + private _logStreamId?: string; + public get logStreamId() { + return this.getStringAttribute('log_stream_id'); + } + public set logStreamId(value: string) { + this._logStreamId = value; + } + // Temporarily expose input value. Use with caution. + public get logStreamIdInput() { + return this._logStreamId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_id - computed: false, optional: false, required: true + private _resourceId?: string; + public get resourceId() { + return this.getStringAttribute('resource_id'); + } + public set resourceId(value: string) { + this._resourceId = value; + } + // Temporarily expose input value. Use with caution. + public get resourceIdInput() { + return this._resourceId; + } + + // resource_type - computed: false, optional: false, required: true + private _resourceType?: string; + public get resourceType() { + return this.getStringAttribute('resource_type'); + } + public set resourceType(value: string) { + this._resourceType = value; + } + // Temporarily expose input value. Use with caution. + public get resourceTypeInput() { + return this._resourceType; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // traffic_type - computed: false, optional: true, required: false + private _trafficType?: string; + public get trafficType() { + return this.getStringAttribute('traffic_type'); + } + public set trafficType(value: string) { + this._trafficType = value; + } + public resetTrafficType() { + this._trafficType = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficTypeInput() { + return this._trafficType; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + log_group_id: cdktf.stringToTerraform(this._logGroupId), + log_stream_id: cdktf.stringToTerraform(this._logStreamId), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + resource_id: cdktf.stringToTerraform(this._resourceId), + resource_type: cdktf.stringToTerraform(this._resourceType), + traffic_type: cdktf.stringToTerraform(this._trafficType), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_group_id: { + value: cdktf.stringToHclTerraform(this._logGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + log_stream_id: { + value: cdktf.stringToHclTerraform(this._logStreamId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_id: { + value: cdktf.stringToHclTerraform(this._resourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_type: { + value: cdktf.stringToHclTerraform(this._resourceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_type: { + value: cdktf.stringToHclTerraform(this._trafficType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-internet-gateway/README.md b/src/constructs/providers/huaweicloud/vpc-internet-gateway/README.md new file mode 100644 index 00000000..e9097886 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-internet-gateway/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_internet_gateway` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_internet_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway). diff --git a/src/constructs/providers/huaweicloud/vpc-internet-gateway/index.ts b/src/constructs/providers/huaweicloud/vpc-internet-gateway/index.ts new file mode 100644 index 00000000..95914b1e --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-internet-gateway/index.ts @@ -0,0 +1,291 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcInternetGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#add_route VpcInternetGateway#add_route} + */ + readonly addRoute?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#enable_ipv6 VpcInternetGateway#enable_ipv6} + */ + readonly enableIpv6?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#id VpcInternetGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#name VpcInternetGateway#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#region VpcInternetGateway#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#subnet_id VpcInternetGateway#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#vpc_id VpcInternetGateway#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway huaweicloud_vpc_internet_gateway} +*/ +export class VpcInternetGateway extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_internet_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcInternetGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcInternetGateway to import + * @param importFromId The id of the existing VpcInternetGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcInternetGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_internet_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_internet_gateway huaweicloud_vpc_internet_gateway} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcInternetGatewayConfig + */ + public constructor(scope: Construct, id: string, config: VpcInternetGatewayConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_internet_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._addRoute = config.addRoute; + this._enableIpv6 = config.enableIpv6; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // add_route - computed: true, optional: true, required: false + private _addRoute?: boolean | cdktf.IResolvable; + public get addRoute() { + return this.getBooleanAttribute('add_route'); + } + public set addRoute(value: boolean | cdktf.IResolvable) { + this._addRoute = value; + } + public resetAddRoute() { + this._addRoute = undefined; + } + // Temporarily expose input value. Use with caution. + public get addRouteInput() { + return this._addRoute; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enable_ipv6 - computed: true, optional: true, required: false + private _enableIpv6?: boolean | cdktf.IResolvable; + public get enableIpv6() { + return this.getBooleanAttribute('enable_ipv6'); + } + public set enableIpv6(value: boolean | cdktf.IResolvable) { + this._enableIpv6 = value; + } + public resetEnableIpv6() { + this._enableIpv6 = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableIpv6Input() { + return this._enableIpv6; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnet_id - computed: true, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + add_route: cdktf.booleanToTerraform(this._addRoute), + enable_ipv6: cdktf.booleanToTerraform(this._enableIpv6), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + add_route: { + value: cdktf.booleanToHclTerraform(this._addRoute), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_ipv6: { + value: cdktf.booleanToHclTerraform(this._enableIpv6), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-network-acl/README.md b/src/constructs/providers/huaweicloud/vpc-network-acl/README.md new file mode 100644 index 00000000..2c7428ba --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-network-acl/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_network_acl` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_network_acl`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl). diff --git a/src/constructs/providers/huaweicloud/vpc-network-acl/index.ts b/src/constructs/providers/huaweicloud/vpc-network-acl/index.ts new file mode 100644 index 00000000..13d85d2b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-network-acl/index.ts @@ -0,0 +1,1380 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcNetworkAclConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#description VpcNetworkAcl#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#enabled VpcNetworkAcl#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#enterprise_project_id VpcNetworkAcl#enterprise_project_id} + */ + readonly enterpriseProjectId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#id VpcNetworkAcl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#name VpcNetworkAcl#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#region VpcNetworkAcl#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#tags VpcNetworkAcl#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * associated_subnets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#associated_subnets VpcNetworkAcl#associated_subnets} + */ + readonly associatedSubnets?: VpcNetworkAclAssociatedSubnets[] | cdktf.IResolvable; + /** + * egress_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#egress_rules VpcNetworkAcl#egress_rules} + */ + readonly egressRules?: VpcNetworkAclEgressRules[] | cdktf.IResolvable; + /** + * ingress_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#ingress_rules VpcNetworkAcl#ingress_rules} + */ + readonly ingressRules?: VpcNetworkAclIngressRules[] | cdktf.IResolvable; +} +export interface VpcNetworkAclAssociatedSubnets { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#subnet_id VpcNetworkAcl#subnet_id} + */ + readonly subnetId: string; +} + +export function vpcNetworkAclAssociatedSubnetsToTerraform(struct?: VpcNetworkAclAssociatedSubnets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + subnet_id: cdktf.stringToTerraform(struct!.subnetId), + } +} + + +export function vpcNetworkAclAssociatedSubnetsToHclTerraform(struct?: VpcNetworkAclAssociatedSubnets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + subnet_id: { + value: cdktf.stringToHclTerraform(struct!.subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcNetworkAclAssociatedSubnetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcNetworkAclAssociatedSubnets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._subnetId !== undefined) { + hasAnyValues = true; + internalValueResult.subnetId = this._subnetId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcNetworkAclAssociatedSubnets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._subnetId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._subnetId = value.subnetId; + } + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } +} + +export class VpcNetworkAclAssociatedSubnetsList extends cdktf.ComplexList { + public internalValue? : VpcNetworkAclAssociatedSubnets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcNetworkAclAssociatedSubnetsOutputReference { + return new VpcNetworkAclAssociatedSubnetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcNetworkAclEgressRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#action VpcNetworkAcl#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#description VpcNetworkAcl#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#destination_ip_address VpcNetworkAcl#destination_ip_address} + */ + readonly destinationIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#destination_ip_address_group_id VpcNetworkAcl#destination_ip_address_group_id} + */ + readonly destinationIpAddressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#destination_port VpcNetworkAcl#destination_port} + */ + readonly destinationPort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#ip_version VpcNetworkAcl#ip_version} + */ + readonly ipVersion: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#name VpcNetworkAcl#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#protocol VpcNetworkAcl#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#source_ip_address VpcNetworkAcl#source_ip_address} + */ + readonly sourceIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#source_ip_address_group_id VpcNetworkAcl#source_ip_address_group_id} + */ + readonly sourceIpAddressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#source_port VpcNetworkAcl#source_port} + */ + readonly sourcePort?: string; +} + +export function vpcNetworkAclEgressRulesToTerraform(struct?: VpcNetworkAclEgressRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + description: cdktf.stringToTerraform(struct!.description), + destination_ip_address: cdktf.stringToTerraform(struct!.destinationIpAddress), + destination_ip_address_group_id: cdktf.stringToTerraform(struct!.destinationIpAddressGroupId), + destination_port: cdktf.stringToTerraform(struct!.destinationPort), + ip_version: cdktf.numberToTerraform(struct!.ipVersion), + name: cdktf.stringToTerraform(struct!.name), + protocol: cdktf.stringToTerraform(struct!.protocol), + source_ip_address: cdktf.stringToTerraform(struct!.sourceIpAddress), + source_ip_address_group_id: cdktf.stringToTerraform(struct!.sourceIpAddressGroupId), + source_port: cdktf.stringToTerraform(struct!.sourcePort), + } +} + + +export function vpcNetworkAclEgressRulesToHclTerraform(struct?: VpcNetworkAclEgressRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address: { + value: cdktf.stringToHclTerraform(struct!.destinationIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address_group_id: { + value: cdktf.stringToHclTerraform(struct!.destinationIpAddressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port: { + value: cdktf.stringToHclTerraform(struct!.destinationPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(struct!.ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address: { + value: cdktf.stringToHclTerraform(struct!.sourceIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address_group_id: { + value: cdktf.stringToHclTerraform(struct!.sourceIpAddressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(struct!.sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcNetworkAclEgressRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcNetworkAclEgressRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._destinationIpAddress !== undefined) { + hasAnyValues = true; + internalValueResult.destinationIpAddress = this._destinationIpAddress; + } + if (this._destinationIpAddressGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.destinationIpAddressGroupId = this._destinationIpAddressGroupId; + } + if (this._destinationPort !== undefined) { + hasAnyValues = true; + internalValueResult.destinationPort = this._destinationPort; + } + if (this._ipVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ipVersion = this._ipVersion; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._sourceIpAddress !== undefined) { + hasAnyValues = true; + internalValueResult.sourceIpAddress = this._sourceIpAddress; + } + if (this._sourceIpAddressGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.sourceIpAddressGroupId = this._sourceIpAddressGroupId; + } + if (this._sourcePort !== undefined) { + hasAnyValues = true; + internalValueResult.sourcePort = this._sourcePort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcNetworkAclEgressRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._description = undefined; + this._destinationIpAddress = undefined; + this._destinationIpAddressGroupId = undefined; + this._destinationPort = undefined; + this._ipVersion = undefined; + this._name = undefined; + this._protocol = undefined; + this._sourceIpAddress = undefined; + this._sourceIpAddressGroupId = undefined; + this._sourcePort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._description = value.description; + this._destinationIpAddress = value.destinationIpAddress; + this._destinationIpAddressGroupId = value.destinationIpAddressGroupId; + this._destinationPort = value.destinationPort; + this._ipVersion = value.ipVersion; + this._name = value.name; + this._protocol = value.protocol; + this._sourceIpAddress = value.sourceIpAddress; + this._sourceIpAddressGroupId = value.sourceIpAddressGroupId; + this._sourcePort = value.sourcePort; + } + } + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_ip_address - computed: false, optional: true, required: false + private _destinationIpAddress?: string; + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + public set destinationIpAddress(value: string) { + this._destinationIpAddress = value; + } + public resetDestinationIpAddress() { + this._destinationIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressInput() { + return this._destinationIpAddress; + } + + // destination_ip_address_group_id - computed: false, optional: true, required: false + private _destinationIpAddressGroupId?: string; + public get destinationIpAddressGroupId() { + return this.getStringAttribute('destination_ip_address_group_id'); + } + public set destinationIpAddressGroupId(value: string) { + this._destinationIpAddressGroupId = value; + } + public resetDestinationIpAddressGroupId() { + this._destinationIpAddressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressGroupIdInput() { + return this._destinationIpAddressGroupId; + } + + // destination_port - computed: false, optional: true, required: false + private _destinationPort?: string; + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + public set destinationPort(value: string) { + this._destinationPort = value; + } + public resetDestinationPort() { + this._destinationPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortInput() { + return this._destinationPort; + } + + // ip_version - computed: false, optional: false, required: true + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // source_ip_address - computed: false, optional: true, required: false + private _sourceIpAddress?: string; + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + public set sourceIpAddress(value: string) { + this._sourceIpAddress = value; + } + public resetSourceIpAddress() { + this._sourceIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressInput() { + return this._sourceIpAddress; + } + + // source_ip_address_group_id - computed: false, optional: true, required: false + private _sourceIpAddressGroupId?: string; + public get sourceIpAddressGroupId() { + return this.getStringAttribute('source_ip_address_group_id'); + } + public set sourceIpAddressGroupId(value: string) { + this._sourceIpAddressGroupId = value; + } + public resetSourceIpAddressGroupId() { + this._sourceIpAddressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressGroupIdInput() { + return this._sourceIpAddressGroupId; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } +} + +export class VpcNetworkAclEgressRulesList extends cdktf.ComplexList { + public internalValue? : VpcNetworkAclEgressRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcNetworkAclEgressRulesOutputReference { + return new VpcNetworkAclEgressRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcNetworkAclIngressRules { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#action VpcNetworkAcl#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#description VpcNetworkAcl#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#destination_ip_address VpcNetworkAcl#destination_ip_address} + */ + readonly destinationIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#destination_ip_address_group_id VpcNetworkAcl#destination_ip_address_group_id} + */ + readonly destinationIpAddressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#destination_port VpcNetworkAcl#destination_port} + */ + readonly destinationPort?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#ip_version VpcNetworkAcl#ip_version} + */ + readonly ipVersion: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#name VpcNetworkAcl#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#protocol VpcNetworkAcl#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#source_ip_address VpcNetworkAcl#source_ip_address} + */ + readonly sourceIpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#source_ip_address_group_id VpcNetworkAcl#source_ip_address_group_id} + */ + readonly sourceIpAddressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#source_port VpcNetworkAcl#source_port} + */ + readonly sourcePort?: string; +} + +export function vpcNetworkAclIngressRulesToTerraform(struct?: VpcNetworkAclIngressRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + description: cdktf.stringToTerraform(struct!.description), + destination_ip_address: cdktf.stringToTerraform(struct!.destinationIpAddress), + destination_ip_address_group_id: cdktf.stringToTerraform(struct!.destinationIpAddressGroupId), + destination_port: cdktf.stringToTerraform(struct!.destinationPort), + ip_version: cdktf.numberToTerraform(struct!.ipVersion), + name: cdktf.stringToTerraform(struct!.name), + protocol: cdktf.stringToTerraform(struct!.protocol), + source_ip_address: cdktf.stringToTerraform(struct!.sourceIpAddress), + source_ip_address_group_id: cdktf.stringToTerraform(struct!.sourceIpAddressGroupId), + source_port: cdktf.stringToTerraform(struct!.sourcePort), + } +} + + +export function vpcNetworkAclIngressRulesToHclTerraform(struct?: VpcNetworkAclIngressRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address: { + value: cdktf.stringToHclTerraform(struct!.destinationIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_ip_address_group_id: { + value: cdktf.stringToHclTerraform(struct!.destinationIpAddressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port: { + value: cdktf.stringToHclTerraform(struct!.destinationPort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.numberToHclTerraform(struct!.ipVersion), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address: { + value: cdktf.stringToHclTerraform(struct!.sourceIpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_ip_address_group_id: { + value: cdktf.stringToHclTerraform(struct!.sourceIpAddressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port: { + value: cdktf.stringToHclTerraform(struct!.sourcePort), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcNetworkAclIngressRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcNetworkAclIngressRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._destinationIpAddress !== undefined) { + hasAnyValues = true; + internalValueResult.destinationIpAddress = this._destinationIpAddress; + } + if (this._destinationIpAddressGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.destinationIpAddressGroupId = this._destinationIpAddressGroupId; + } + if (this._destinationPort !== undefined) { + hasAnyValues = true; + internalValueResult.destinationPort = this._destinationPort; + } + if (this._ipVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ipVersion = this._ipVersion; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._sourceIpAddress !== undefined) { + hasAnyValues = true; + internalValueResult.sourceIpAddress = this._sourceIpAddress; + } + if (this._sourceIpAddressGroupId !== undefined) { + hasAnyValues = true; + internalValueResult.sourceIpAddressGroupId = this._sourceIpAddressGroupId; + } + if (this._sourcePort !== undefined) { + hasAnyValues = true; + internalValueResult.sourcePort = this._sourcePort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcNetworkAclIngressRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._description = undefined; + this._destinationIpAddress = undefined; + this._destinationIpAddressGroupId = undefined; + this._destinationPort = undefined; + this._ipVersion = undefined; + this._name = undefined; + this._protocol = undefined; + this._sourceIpAddress = undefined; + this._sourceIpAddressGroupId = undefined; + this._sourcePort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._description = value.description; + this._destinationIpAddress = value.destinationIpAddress; + this._destinationIpAddressGroupId = value.destinationIpAddressGroupId; + this._destinationPort = value.destinationPort; + this._ipVersion = value.ipVersion; + this._name = value.name; + this._protocol = value.protocol; + this._sourceIpAddress = value.sourceIpAddress; + this._sourceIpAddressGroupId = value.sourceIpAddressGroupId; + this._sourcePort = value.sourcePort; + } + } + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_ip_address - computed: false, optional: true, required: false + private _destinationIpAddress?: string; + public get destinationIpAddress() { + return this.getStringAttribute('destination_ip_address'); + } + public set destinationIpAddress(value: string) { + this._destinationIpAddress = value; + } + public resetDestinationIpAddress() { + this._destinationIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressInput() { + return this._destinationIpAddress; + } + + // destination_ip_address_group_id - computed: false, optional: true, required: false + private _destinationIpAddressGroupId?: string; + public get destinationIpAddressGroupId() { + return this.getStringAttribute('destination_ip_address_group_id'); + } + public set destinationIpAddressGroupId(value: string) { + this._destinationIpAddressGroupId = value; + } + public resetDestinationIpAddressGroupId() { + this._destinationIpAddressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationIpAddressGroupIdInput() { + return this._destinationIpAddressGroupId; + } + + // destination_port - computed: false, optional: true, required: false + private _destinationPort?: string; + public get destinationPort() { + return this.getStringAttribute('destination_port'); + } + public set destinationPort(value: string) { + this._destinationPort = value; + } + public resetDestinationPort() { + this._destinationPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortInput() { + return this._destinationPort; + } + + // ip_version - computed: false, optional: false, required: true + private _ipVersion?: number; + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + public set ipVersion(value: number) { + this._ipVersion = value; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // source_ip_address - computed: false, optional: true, required: false + private _sourceIpAddress?: string; + public get sourceIpAddress() { + return this.getStringAttribute('source_ip_address'); + } + public set sourceIpAddress(value: string) { + this._sourceIpAddress = value; + } + public resetSourceIpAddress() { + this._sourceIpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressInput() { + return this._sourceIpAddress; + } + + // source_ip_address_group_id - computed: false, optional: true, required: false + private _sourceIpAddressGroupId?: string; + public get sourceIpAddressGroupId() { + return this.getStringAttribute('source_ip_address_group_id'); + } + public set sourceIpAddressGroupId(value: string) { + this._sourceIpAddressGroupId = value; + } + public resetSourceIpAddressGroupId() { + this._sourceIpAddressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceIpAddressGroupIdInput() { + return this._sourceIpAddressGroupId; + } + + // source_port - computed: false, optional: true, required: false + private _sourcePort?: string; + public get sourcePort() { + return this.getStringAttribute('source_port'); + } + public set sourcePort(value: string) { + this._sourcePort = value; + } + public resetSourcePort() { + this._sourcePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortInput() { + return this._sourcePort; + } +} + +export class VpcNetworkAclIngressRulesList extends cdktf.ComplexList { + public internalValue? : VpcNetworkAclIngressRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcNetworkAclIngressRulesOutputReference { + return new VpcNetworkAclIngressRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl huaweicloud_vpc_network_acl} +*/ +export class VpcNetworkAcl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_network_acl"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcNetworkAcl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcNetworkAcl to import + * @param importFromId The id of the existing VpcNetworkAcl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcNetworkAcl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_network_acl", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_acl huaweicloud_vpc_network_acl} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcNetworkAclConfig + */ + public constructor(scope: Construct, id: string, config: VpcNetworkAclConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_network_acl', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enabled = config.enabled; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tags = config.tags; + this._associatedSubnets.internalValue = config.associatedSubnets; + this._egressRules.internalValue = config.egressRules; + this._ingressRules.internalValue = config.ingressRules; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // enterprise_project_id - computed: false, optional: false, required: true + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // associated_subnets - computed: false, optional: true, required: false + private _associatedSubnets = new VpcNetworkAclAssociatedSubnetsList(this, "associated_subnets", true); + public get associatedSubnets() { + return this._associatedSubnets; + } + public putAssociatedSubnets(value: VpcNetworkAclAssociatedSubnets[] | cdktf.IResolvable) { + this._associatedSubnets.internalValue = value; + } + public resetAssociatedSubnets() { + this._associatedSubnets.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get associatedSubnetsInput() { + return this._associatedSubnets.internalValue; + } + + // egress_rules - computed: false, optional: true, required: false + private _egressRules = new VpcNetworkAclEgressRulesList(this, "egress_rules", false); + public get egressRules() { + return this._egressRules; + } + public putEgressRules(value: VpcNetworkAclEgressRules[] | cdktf.IResolvable) { + this._egressRules.internalValue = value; + } + public resetEgressRules() { + this._egressRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get egressRulesInput() { + return this._egressRules.internalValue; + } + + // ingress_rules - computed: false, optional: true, required: false + private _ingressRules = new VpcNetworkAclIngressRulesList(this, "ingress_rules", false); + public get ingressRules() { + return this._ingressRules; + } + public putIngressRules(value: VpcNetworkAclIngressRules[] | cdktf.IResolvable) { + this._ingressRules.internalValue = value; + } + public resetIngressRules() { + this._ingressRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ingressRulesInput() { + return this._ingressRules.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + associated_subnets: cdktf.listMapper(vpcNetworkAclAssociatedSubnetsToTerraform, true)(this._associatedSubnets.internalValue), + egress_rules: cdktf.listMapper(vpcNetworkAclEgressRulesToTerraform, true)(this._egressRules.internalValue), + ingress_rules: cdktf.listMapper(vpcNetworkAclIngressRulesToTerraform, true)(this._ingressRules.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + associated_subnets: { + value: cdktf.listMapperHcl(vpcNetworkAclAssociatedSubnetsToHclTerraform, true)(this._associatedSubnets.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpcNetworkAclAssociatedSubnetsList", + }, + egress_rules: { + value: cdktf.listMapperHcl(vpcNetworkAclEgressRulesToHclTerraform, true)(this._egressRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcNetworkAclEgressRulesList", + }, + ingress_rules: { + value: cdktf.listMapperHcl(vpcNetworkAclIngressRulesToHclTerraform, true)(this._ingressRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcNetworkAclIngressRulesList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-network-interface/README.md b/src/constructs/providers/huaweicloud/vpc-network-interface/README.md new file mode 100644 index 00000000..08f0425f --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-network-interface/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_network_interface` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_network_interface`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface). diff --git a/src/constructs/providers/huaweicloud/vpc-network-interface/index.ts b/src/constructs/providers/huaweicloud/vpc-network-interface/index.ts new file mode 100644 index 00000000..6f949cfe --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-network-interface/index.ts @@ -0,0 +1,364 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcNetworkInterfaceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#allowed_addresses VpcNetworkInterface#allowed_addresses} + */ + readonly allowedAddresses?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#dhcp_lease_time VpcNetworkInterface#dhcp_lease_time} + */ + readonly dhcpLeaseTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#fixed_ip_v4 VpcNetworkInterface#fixed_ip_v4} + */ + readonly fixedIpV4?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#id VpcNetworkInterface#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#name VpcNetworkInterface#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#region VpcNetworkInterface#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#security_group_ids VpcNetworkInterface#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#subnet_id VpcNetworkInterface#subnet_id} + */ + readonly subnetId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface huaweicloud_vpc_network_interface} +*/ +export class VpcNetworkInterface extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_network_interface"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcNetworkInterface resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcNetworkInterface to import + * @param importFromId The id of the existing VpcNetworkInterface that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcNetworkInterface to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_network_interface", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_network_interface huaweicloud_vpc_network_interface} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcNetworkInterfaceConfig + */ + public constructor(scope: Construct, id: string, config: VpcNetworkInterfaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_network_interface', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allowedAddresses = config.allowedAddresses; + this._dhcpLeaseTime = config.dhcpLeaseTime; + this._fixedIpV4 = config.fixedIpV4; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._subnetId = config.subnetId; + } + + // ========== + // ATTRIBUTES + // ========== + + // allowed_addresses - computed: false, optional: true, required: false + private _allowedAddresses?: string[]; + public get allowedAddresses() { + return this.getListAttribute('allowed_addresses'); + } + public set allowedAddresses(value: string[]) { + this._allowedAddresses = value; + } + public resetAllowedAddresses() { + this._allowedAddresses = undefined; + } + // Temporarily expose input value. Use with caution. + public get allowedAddressesInput() { + return this._allowedAddresses; + } + + // availability_zone - computed: true, optional: false, required: false + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + + // device_id - computed: true, optional: false, required: false + public get deviceId() { + return this.getStringAttribute('device_id'); + } + + // device_owner - computed: true, optional: false, required: false + public get deviceOwner() { + return this.getStringAttribute('device_owner'); + } + + // dhcp_lease_time - computed: true, optional: true, required: false + private _dhcpLeaseTime?: string; + public get dhcpLeaseTime() { + return this.getStringAttribute('dhcp_lease_time'); + } + public set dhcpLeaseTime(value: string) { + this._dhcpLeaseTime = value; + } + public resetDhcpLeaseTime() { + this._dhcpLeaseTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpLeaseTimeInput() { + return this._dhcpLeaseTime; + } + + // dns_name - computed: true, optional: false, required: false + public get dnsName() { + return this.getStringAttribute('dns_name'); + } + + // enable_efi - computed: true, optional: false, required: false + public get enableEfi() { + return this.getBooleanAttribute('enable_efi'); + } + + // fixed_ip_v4 - computed: true, optional: true, required: false + private _fixedIpV4?: string; + public get fixedIpV4() { + return this.getStringAttribute('fixed_ip_v4'); + } + public set fixedIpV4(value: string) { + this._fixedIpV4 = value; + } + public resetFixedIpV4() { + this._fixedIpV4 = undefined; + } + // Temporarily expose input value. Use with caution. + public get fixedIpV4Input() { + return this._fixedIpV4; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // instance_id - computed: true, optional: false, required: false + public get instanceId() { + return this.getStringAttribute('instance_id'); + } + + // instance_type - computed: true, optional: false, required: false + public get instanceType() { + return this.getStringAttribute('instance_type'); + } + + // ipv6_bandwidth_id - computed: true, optional: false, required: false + public get ipv6BandwidthId() { + return this.getStringAttribute('ipv6_bandwidth_id'); + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // port_security_enabled - computed: true, optional: false, required: false + public get portSecurityEnabled() { + return this.getBooleanAttribute('port_security_enabled'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + allowed_addresses: cdktf.listMapper(cdktf.stringToTerraform, false)(this._allowedAddresses), + dhcp_lease_time: cdktf.stringToTerraform(this._dhcpLeaseTime), + fixed_ip_v4: cdktf.stringToTerraform(this._fixedIpV4), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + subnet_id: cdktf.stringToTerraform(this._subnetId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + allowed_addresses: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._allowedAddresses), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + dhcp_lease_time: { + value: cdktf.stringToHclTerraform(this._dhcpLeaseTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + fixed_ip_v4: { + value: cdktf.stringToHclTerraform(this._fixedIpV4), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/README.md b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/README.md new file mode 100644 index 00000000..33e7b20a --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_peering_connection_accepter_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_peering_connection_accepter_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2). diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/index.ts b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/index.ts new file mode 100644 index 00000000..b666f1d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter-v2/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcPeeringConnectionAccepterV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#accept VpcPeeringConnectionAccepterV2#accept} + */ + readonly accept?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#id VpcPeeringConnectionAccepterV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#region VpcPeeringConnectionAccepterV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#vpc_peering_connection_id VpcPeeringConnectionAccepterV2#vpc_peering_connection_id} + */ + readonly vpcPeeringConnectionId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#timeouts VpcPeeringConnectionAccepterV2#timeouts} + */ + readonly timeouts?: VpcPeeringConnectionAccepterV2Timeouts; +} +export interface VpcPeeringConnectionAccepterV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#create VpcPeeringConnectionAccepterV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#delete VpcPeeringConnectionAccepterV2#delete} + */ + readonly delete?: string; +} + +export function vpcPeeringConnectionAccepterV2TimeoutsToTerraform(struct?: VpcPeeringConnectionAccepterV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcPeeringConnectionAccepterV2TimeoutsToHclTerraform(struct?: VpcPeeringConnectionAccepterV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcPeeringConnectionAccepterV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcPeeringConnectionAccepterV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcPeeringConnectionAccepterV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2 huaweicloud_vpc_peering_connection_accepter_v2} +*/ +export class VpcPeeringConnectionAccepterV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_peering_connection_accepter_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcPeeringConnectionAccepterV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcPeeringConnectionAccepterV2 to import + * @param importFromId The id of the existing VpcPeeringConnectionAccepterV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcPeeringConnectionAccepterV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_peering_connection_accepter_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter_v2 huaweicloud_vpc_peering_connection_accepter_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcPeeringConnectionAccepterV2Config + */ + public constructor(scope: Construct, id: string, config: VpcPeeringConnectionAccepterV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_peering_connection_accepter_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accept = config.accept; + this._id = config.id; + this._region = config.region; + this._vpcPeeringConnectionId = config.vpcPeeringConnectionId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // accept - computed: false, optional: true, required: false + private _accept?: boolean | cdktf.IResolvable; + public get accept() { + return this.getBooleanAttribute('accept'); + } + public set accept(value: boolean | cdktf.IResolvable) { + this._accept = value; + } + public resetAccept() { + this._accept = undefined; + } + // Temporarily expose input value. Use with caution. + public get acceptInput() { + return this._accept; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // peer_tenant_id - computed: true, optional: false, required: false + public get peerTenantId() { + return this.getStringAttribute('peer_tenant_id'); + } + + // peer_vpc_id - computed: true, optional: false, required: false + public get peerVpcId() { + return this.getStringAttribute('peer_vpc_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // vpc_peering_connection_id - computed: false, optional: false, required: true + private _vpcPeeringConnectionId?: string; + public get vpcPeeringConnectionId() { + return this.getStringAttribute('vpc_peering_connection_id'); + } + public set vpcPeeringConnectionId(value: string) { + this._vpcPeeringConnectionId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcPeeringConnectionIdInput() { + return this._vpcPeeringConnectionId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcPeeringConnectionAccepterV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcPeeringConnectionAccepterV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + accept: cdktf.booleanToTerraform(this._accept), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpc_peering_connection_id: cdktf.stringToTerraform(this._vpcPeeringConnectionId), + timeouts: vpcPeeringConnectionAccepterV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + accept: { + value: cdktf.booleanToHclTerraform(this._accept), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_peering_connection_id: { + value: cdktf.stringToHclTerraform(this._vpcPeeringConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcPeeringConnectionAccepterV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcPeeringConnectionAccepterV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/README.md b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/README.md new file mode 100644 index 00000000..ccfc4fe4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_peering_connection_accepter` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_peering_connection_accepter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter). diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/index.ts b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/index.ts new file mode 100644 index 00000000..6fb998d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection-accepter/index.ts @@ -0,0 +1,384 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcPeeringConnectionAccepterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#accept VpcPeeringConnectionAccepter#accept} + */ + readonly accept?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#id VpcPeeringConnectionAccepter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#region VpcPeeringConnectionAccepter#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#vpc_peering_connection_id VpcPeeringConnectionAccepter#vpc_peering_connection_id} + */ + readonly vpcPeeringConnectionId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#timeouts VpcPeeringConnectionAccepter#timeouts} + */ + readonly timeouts?: VpcPeeringConnectionAccepterTimeouts; +} +export interface VpcPeeringConnectionAccepterTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#create VpcPeeringConnectionAccepter#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#delete VpcPeeringConnectionAccepter#delete} + */ + readonly delete?: string; +} + +export function vpcPeeringConnectionAccepterTimeoutsToTerraform(struct?: VpcPeeringConnectionAccepterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcPeeringConnectionAccepterTimeoutsToHclTerraform(struct?: VpcPeeringConnectionAccepterTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcPeeringConnectionAccepterTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcPeeringConnectionAccepterTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcPeeringConnectionAccepterTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter huaweicloud_vpc_peering_connection_accepter} +*/ +export class VpcPeeringConnectionAccepter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_peering_connection_accepter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcPeeringConnectionAccepter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcPeeringConnectionAccepter to import + * @param importFromId The id of the existing VpcPeeringConnectionAccepter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcPeeringConnectionAccepter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_peering_connection_accepter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_accepter huaweicloud_vpc_peering_connection_accepter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcPeeringConnectionAccepterConfig + */ + public constructor(scope: Construct, id: string, config: VpcPeeringConnectionAccepterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_peering_connection_accepter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accept = config.accept; + this._id = config.id; + this._region = config.region; + this._vpcPeeringConnectionId = config.vpcPeeringConnectionId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // accept - computed: false, optional: true, required: false + private _accept?: boolean | cdktf.IResolvable; + public get accept() { + return this.getBooleanAttribute('accept'); + } + public set accept(value: boolean | cdktf.IResolvable) { + this._accept = value; + } + public resetAccept() { + this._accept = undefined; + } + // Temporarily expose input value. Use with caution. + public get acceptInput() { + return this._accept; + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // peer_tenant_id - computed: true, optional: false, required: false + public get peerTenantId() { + return this.getStringAttribute('peer_tenant_id'); + } + + // peer_vpc_id - computed: true, optional: false, required: false + public get peerVpcId() { + return this.getStringAttribute('peer_vpc_id'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // vpc_peering_connection_id - computed: false, optional: false, required: true + private _vpcPeeringConnectionId?: string; + public get vpcPeeringConnectionId() { + return this.getStringAttribute('vpc_peering_connection_id'); + } + public set vpcPeeringConnectionId(value: string) { + this._vpcPeeringConnectionId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcPeeringConnectionIdInput() { + return this._vpcPeeringConnectionId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcPeeringConnectionAccepterTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcPeeringConnectionAccepterTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + accept: cdktf.booleanToTerraform(this._accept), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + vpc_peering_connection_id: cdktf.stringToTerraform(this._vpcPeeringConnectionId), + timeouts: vpcPeeringConnectionAccepterTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + accept: { + value: cdktf.booleanToHclTerraform(this._accept), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_peering_connection_id: { + value: cdktf.stringToHclTerraform(this._vpcPeeringConnectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcPeeringConnectionAccepterTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcPeeringConnectionAccepterTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection-v2/README.md b/src/constructs/providers/huaweicloud/vpc-peering-connection-v2/README.md new file mode 100644 index 00000000..0b34ebb7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_peering_connection_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_peering_connection_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2). diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection-v2/index.ts b/src/constructs/providers/huaweicloud/vpc-peering-connection-v2/index.ts new file mode 100644 index 00000000..e8f64753 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection-v2/index.ts @@ -0,0 +1,437 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcPeeringConnectionV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#description VpcPeeringConnectionV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#id VpcPeeringConnectionV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#name VpcPeeringConnectionV2#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#peer_tenant_id VpcPeeringConnectionV2#peer_tenant_id} + */ + readonly peerTenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#peer_vpc_id VpcPeeringConnectionV2#peer_vpc_id} + */ + readonly peerVpcId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#region VpcPeeringConnectionV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#vpc_id VpcPeeringConnectionV2#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#timeouts VpcPeeringConnectionV2#timeouts} + */ + readonly timeouts?: VpcPeeringConnectionV2Timeouts; +} +export interface VpcPeeringConnectionV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#create VpcPeeringConnectionV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#delete VpcPeeringConnectionV2#delete} + */ + readonly delete?: string; +} + +export function vpcPeeringConnectionV2TimeoutsToTerraform(struct?: VpcPeeringConnectionV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcPeeringConnectionV2TimeoutsToHclTerraform(struct?: VpcPeeringConnectionV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcPeeringConnectionV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcPeeringConnectionV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcPeeringConnectionV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2 huaweicloud_vpc_peering_connection_v2} +*/ +export class VpcPeeringConnectionV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_peering_connection_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcPeeringConnectionV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcPeeringConnectionV2 to import + * @param importFromId The id of the existing VpcPeeringConnectionV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcPeeringConnectionV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_peering_connection_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection_v2 huaweicloud_vpc_peering_connection_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcPeeringConnectionV2Config + */ + public constructor(scope: Construct, id: string, config: VpcPeeringConnectionV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_peering_connection_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._peerTenantId = config.peerTenantId; + this._peerVpcId = config.peerVpcId; + this._region = config.region; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_tenant_id - computed: true, optional: true, required: false + private _peerTenantId?: string; + public get peerTenantId() { + return this.getStringAttribute('peer_tenant_id'); + } + public set peerTenantId(value: string) { + this._peerTenantId = value; + } + public resetPeerTenantId() { + this._peerTenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerTenantIdInput() { + return this._peerTenantId; + } + + // peer_vpc_id - computed: false, optional: false, required: true + private _peerVpcId?: string; + public get peerVpcId() { + return this.getStringAttribute('peer_vpc_id'); + } + public set peerVpcId(value: string) { + this._peerVpcId = value; + } + // Temporarily expose input value. Use with caution. + public get peerVpcIdInput() { + return this._peerVpcId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcPeeringConnectionV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcPeeringConnectionV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + peer_tenant_id: cdktf.stringToTerraform(this._peerTenantId), + peer_vpc_id: cdktf.stringToTerraform(this._peerVpcId), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: vpcPeeringConnectionV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_tenant_id: { + value: cdktf.stringToHclTerraform(this._peerTenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_vpc_id: { + value: cdktf.stringToHclTerraform(this._peerVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcPeeringConnectionV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcPeeringConnectionV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection/README.md b/src/constructs/providers/huaweicloud/vpc-peering-connection/README.md new file mode 100644 index 00000000..29f8cc96 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_peering_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_peering_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection). diff --git a/src/constructs/providers/huaweicloud/vpc-peering-connection/index.ts b/src/constructs/providers/huaweicloud/vpc-peering-connection/index.ts new file mode 100644 index 00000000..0db57e37 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-peering-connection/index.ts @@ -0,0 +1,437 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcPeeringConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#description VpcPeeringConnection#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#id VpcPeeringConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#name VpcPeeringConnection#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#peer_tenant_id VpcPeeringConnection#peer_tenant_id} + */ + readonly peerTenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#peer_vpc_id VpcPeeringConnection#peer_vpc_id} + */ + readonly peerVpcId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#region VpcPeeringConnection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#vpc_id VpcPeeringConnection#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#timeouts VpcPeeringConnection#timeouts} + */ + readonly timeouts?: VpcPeeringConnectionTimeouts; +} +export interface VpcPeeringConnectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#create VpcPeeringConnection#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#delete VpcPeeringConnection#delete} + */ + readonly delete?: string; +} + +export function vpcPeeringConnectionTimeoutsToTerraform(struct?: VpcPeeringConnectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcPeeringConnectionTimeoutsToHclTerraform(struct?: VpcPeeringConnectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcPeeringConnectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcPeeringConnectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcPeeringConnectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection huaweicloud_vpc_peering_connection} +*/ +export class VpcPeeringConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_peering_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcPeeringConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcPeeringConnection to import + * @param importFromId The id of the existing VpcPeeringConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcPeeringConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_peering_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_peering_connection huaweicloud_vpc_peering_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcPeeringConnectionConfig + */ + public constructor(scope: Construct, id: string, config: VpcPeeringConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_peering_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._peerTenantId = config.peerTenantId; + this._peerVpcId = config.peerVpcId; + this._region = config.region; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_tenant_id - computed: true, optional: true, required: false + private _peerTenantId?: string; + public get peerTenantId() { + return this.getStringAttribute('peer_tenant_id'); + } + public set peerTenantId(value: string) { + this._peerTenantId = value; + } + public resetPeerTenantId() { + this._peerTenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerTenantIdInput() { + return this._peerTenantId; + } + + // peer_vpc_id - computed: false, optional: false, required: true + private _peerVpcId?: string; + public get peerVpcId() { + return this.getStringAttribute('peer_vpc_id'); + } + public set peerVpcId(value: string) { + this._peerVpcId = value; + } + // Temporarily expose input value. Use with caution. + public get peerVpcIdInput() { + return this._peerVpcId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcPeeringConnectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcPeeringConnectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + peer_tenant_id: cdktf.stringToTerraform(this._peerTenantId), + peer_vpc_id: cdktf.stringToTerraform(this._peerVpcId), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: vpcPeeringConnectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_tenant_id: { + value: cdktf.stringToHclTerraform(this._peerTenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_vpc_id: { + value: cdktf.stringToHclTerraform(this._peerVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcPeeringConnectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcPeeringConnectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-route-table/README.md b/src/constructs/providers/huaweicloud/vpc-route-table/README.md new file mode 100644 index 00000000..9837002d --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-route-table/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_route_table` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_route_table`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table). diff --git a/src/constructs/providers/huaweicloud/vpc-route-table/index.ts b/src/constructs/providers/huaweicloud/vpc-route-table/index.ts new file mode 100644 index 00000000..4c88aa1b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-route-table/index.ts @@ -0,0 +1,643 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcRouteTableConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#description VpcRouteTable#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#id VpcRouteTable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#name VpcRouteTable#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#region VpcRouteTable#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#subnets VpcRouteTable#subnets} + */ + readonly subnets?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#vpc_id VpcRouteTable#vpc_id} + */ + readonly vpcId: string; + /** + * route block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#route VpcRouteTable#route} + */ + readonly route?: VpcRouteTableRoute[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#timeouts VpcRouteTable#timeouts} + */ + readonly timeouts?: VpcRouteTableTimeouts; +} +export interface VpcRouteTableRoute { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#description VpcRouteTable#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#destination VpcRouteTable#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#nexthop VpcRouteTable#nexthop} + */ + readonly nexthop: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#type VpcRouteTable#type} + */ + readonly type: string; +} + +export function vpcRouteTableRouteToTerraform(struct?: VpcRouteTableRoute | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + destination: cdktf.stringToTerraform(struct!.destination), + nexthop: cdktf.stringToTerraform(struct!.nexthop), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpcRouteTableRouteToHclTerraform(struct?: VpcRouteTableRoute | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(struct!.destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nexthop: { + value: cdktf.stringToHclTerraform(struct!.nexthop), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcRouteTableRouteOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcRouteTableRoute | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._destination !== undefined) { + hasAnyValues = true; + internalValueResult.destination = this._destination; + } + if (this._nexthop !== undefined) { + hasAnyValues = true; + internalValueResult.nexthop = this._nexthop; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcRouteTableRoute | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._destination = undefined; + this._nexthop = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._destination = value.destination; + this._nexthop = value.nexthop; + this._type = value.type; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // nexthop - computed: false, optional: false, required: true + private _nexthop?: string; + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + public set nexthop(value: string) { + this._nexthop = value; + } + // Temporarily expose input value. Use with caution. + public get nexthopInput() { + return this._nexthop; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class VpcRouteTableRouteList extends cdktf.ComplexList { + public internalValue? : VpcRouteTableRoute[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcRouteTableRouteOutputReference { + return new VpcRouteTableRouteOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcRouteTableTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#create VpcRouteTable#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#delete VpcRouteTable#delete} + */ + readonly delete?: string; +} + +export function vpcRouteTableTimeoutsToTerraform(struct?: VpcRouteTableTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcRouteTableTimeoutsToHclTerraform(struct?: VpcRouteTableTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcRouteTableTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcRouteTableTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcRouteTableTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table huaweicloud_vpc_route_table} +*/ +export class VpcRouteTable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route_table"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcRouteTable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcRouteTable to import + * @param importFromId The id of the existing VpcRouteTable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcRouteTable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route_table", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_table huaweicloud_vpc_route_table} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcRouteTableConfig + */ + public constructor(scope: Construct, id: string, config: VpcRouteTableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route_table', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._subnets = config.subnets; + this._vpcId = config.vpcId; + this._route.internalValue = config.route; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // subnets - computed: false, optional: true, required: false + private _subnets?: string[]; + public get subnets() { + return cdktf.Fn.tolist(this.getListAttribute('subnets')); + } + public set subnets(value: string[]) { + this._subnets = value; + } + public resetSubnets() { + this._subnets = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetsInput() { + return this._subnets; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // route - computed: false, optional: true, required: false + private _route = new VpcRouteTableRouteList(this, "route", true); + public get route() { + return this._route; + } + public putRoute(value: VpcRouteTableRoute[] | cdktf.IResolvable) { + this._route.internalValue = value; + } + public resetRoute() { + this._route.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeInput() { + return this._route.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcRouteTableTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcRouteTableTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + subnets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._subnets), + vpc_id: cdktf.stringToTerraform(this._vpcId), + route: cdktf.listMapper(vpcRouteTableRouteToTerraform, true)(this._route.internalValue), + timeouts: vpcRouteTableTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._subnets), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route: { + value: cdktf.listMapperHcl(vpcRouteTableRouteToHclTerraform, true)(this._route.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpcRouteTableRouteList", + }, + timeouts: { + value: vpcRouteTableTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcRouteTableTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-route-v2/README.md b/src/constructs/providers/huaweicloud/vpc-route-v2/README.md new file mode 100644 index 00000000..0b7a17c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-route-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_route_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_route_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2). diff --git a/src/constructs/providers/huaweicloud/vpc-route-v2/index.ts b/src/constructs/providers/huaweicloud/vpc-route-v2/index.ts new file mode 100644 index 00000000..c685f1fa --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-route-v2/index.ts @@ -0,0 +1,401 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcRouteV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#destination VpcRouteV2#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#id VpcRouteV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#nexthop VpcRouteV2#nexthop} + */ + readonly nexthop: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#region VpcRouteV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#type VpcRouteV2#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#vpc_id VpcRouteV2#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#timeouts VpcRouteV2#timeouts} + */ + readonly timeouts?: VpcRouteV2Timeouts; +} +export interface VpcRouteV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#create VpcRouteV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#delete VpcRouteV2#delete} + */ + readonly delete?: string; +} + +export function vpcRouteV2TimeoutsToTerraform(struct?: VpcRouteV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcRouteV2TimeoutsToHclTerraform(struct?: VpcRouteV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcRouteV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcRouteV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcRouteV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2 huaweicloud_vpc_route_v2} +*/ +export class VpcRouteV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcRouteV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcRouteV2 to import + * @param importFromId The id of the existing VpcRouteV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcRouteV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route_v2 huaweicloud_vpc_route_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcRouteV2Config + */ + public constructor(scope: Construct, id: string, config: VpcRouteV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._destination = config.destination; + this._id = config.id; + this._nexthop = config.nexthop; + this._region = config.region; + this._type = config.type; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nexthop - computed: false, optional: false, required: true + private _nexthop?: string; + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + public set nexthop(value: string) { + this._nexthop = value; + } + // Temporarily expose input value. Use with caution. + public get nexthopInput() { + return this._nexthop; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcRouteV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcRouteV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + nexthop: cdktf.stringToTerraform(this._nexthop), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: vpcRouteV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nexthop: { + value: cdktf.stringToHclTerraform(this._nexthop), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcRouteV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcRouteV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-route/README.md b/src/constructs/providers/huaweicloud/vpc-route/README.md new file mode 100644 index 00000000..3a0cf3de --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-route/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_route` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_route`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route). diff --git a/src/constructs/providers/huaweicloud/vpc-route/index.ts b/src/constructs/providers/huaweicloud/vpc-route/index.ts new file mode 100644 index 00000000..f41548a5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-route/index.ts @@ -0,0 +1,462 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcRouteConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#description VpcRoute#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#destination VpcRoute#destination} + */ + readonly destination: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#id VpcRoute#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#nexthop VpcRoute#nexthop} + */ + readonly nexthop: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#region VpcRoute#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#route_table_id VpcRoute#route_table_id} + */ + readonly routeTableId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#type VpcRoute#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#vpc_id VpcRoute#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#timeouts VpcRoute#timeouts} + */ + readonly timeouts?: VpcRouteTimeouts; +} +export interface VpcRouteTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#create VpcRoute#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#delete VpcRoute#delete} + */ + readonly delete?: string; +} + +export function vpcRouteTimeoutsToTerraform(struct?: VpcRouteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcRouteTimeoutsToHclTerraform(struct?: VpcRouteTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcRouteTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcRouteTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcRouteTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route huaweicloud_vpc_route} +*/ +export class VpcRoute extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_route"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcRoute resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcRoute to import + * @param importFromId The id of the existing VpcRoute that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcRoute to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_route", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_route huaweicloud_vpc_route} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcRouteConfig + */ + public constructor(scope: Construct, id: string, config: VpcRouteConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_route', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._destination = config.destination; + this._id = config.id; + this._nexthop = config.nexthop; + this._region = config.region; + this._routeTableId = config.routeTableId; + this._type = config.type; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination - computed: false, optional: false, required: true + private _destination?: string; + public get destination() { + return this.getStringAttribute('destination'); + } + public set destination(value: string) { + this._destination = value; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // nexthop - computed: false, optional: false, required: true + private _nexthop?: string; + public get nexthop() { + return this.getStringAttribute('nexthop'); + } + public set nexthop(value: string) { + this._nexthop = value; + } + // Temporarily expose input value. Use with caution. + public get nexthopInput() { + return this._nexthop; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_table_id - computed: true, optional: true, required: false + private _routeTableId?: string; + public get routeTableId() { + return this.getStringAttribute('route_table_id'); + } + public set routeTableId(value: string) { + this._routeTableId = value; + } + public resetRouteTableId() { + this._routeTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeTableIdInput() { + return this._routeTableId; + } + + // route_table_name - computed: true, optional: false, required: false + public get routeTableName() { + return this.getStringAttribute('route_table_name'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcRouteTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcRouteTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + destination: cdktf.stringToTerraform(this._destination), + id: cdktf.stringToTerraform(this._id), + nexthop: cdktf.stringToTerraform(this._nexthop), + region: cdktf.stringToTerraform(this._region), + route_table_id: cdktf.stringToTerraform(this._routeTableId), + type: cdktf.stringToTerraform(this._type), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: vpcRouteTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination: { + value: cdktf.stringToHclTerraform(this._destination), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + nexthop: { + value: cdktf.stringToHclTerraform(this._nexthop), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_table_id: { + value: cdktf.stringToHclTerraform(this._routeTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcRouteTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcRouteTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-sub-network-interface/README.md b/src/constructs/providers/huaweicloud/vpc-sub-network-interface/README.md new file mode 100644 index 00000000..1129aeff --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-sub-network-interface/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_sub_network_interface` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_sub_network_interface`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface). diff --git a/src/constructs/providers/huaweicloud/vpc-sub-network-interface/index.ts b/src/constructs/providers/huaweicloud/vpc-sub-network-interface/index.ts new file mode 100644 index 00000000..ed8cbe9b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-sub-network-interface/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcSubNetworkInterfaceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#description VpcSubNetworkInterface#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#id VpcSubNetworkInterface#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#ip_address VpcSubNetworkInterface#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#ipv6_enable VpcSubNetworkInterface#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#ipv6_ip_address VpcSubNetworkInterface#ipv6_ip_address} + */ + readonly ipv6IpAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#parent_id VpcSubNetworkInterface#parent_id} + */ + readonly parentId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#region VpcSubNetworkInterface#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#security_group_ids VpcSubNetworkInterface#security_group_ids} + */ + readonly securityGroupIds?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#subnet_id VpcSubNetworkInterface#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#vlan_id VpcSubNetworkInterface#vlan_id} + */ + readonly vlanId?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface huaweicloud_vpc_sub_network_interface} +*/ +export class VpcSubNetworkInterface extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_sub_network_interface"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcSubNetworkInterface resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcSubNetworkInterface to import + * @param importFromId The id of the existing VpcSubNetworkInterface that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcSubNetworkInterface to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_sub_network_interface", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_sub_network_interface huaweicloud_vpc_sub_network_interface} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcSubNetworkInterfaceConfig + */ + public constructor(scope: Construct, id: string, config: VpcSubNetworkInterfaceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_sub_network_interface', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._ipv6Enable = config.ipv6Enable; + this._ipv6IpAddress = config.ipv6IpAddress; + this._parentId = config.parentId; + this._region = config.region; + this._securityGroupIds = config.securityGroupIds; + this._subnetId = config.subnetId; + this._vlanId = config.vlanId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // ipv6_ip_address - computed: true, optional: true, required: false + private _ipv6IpAddress?: string; + public get ipv6IpAddress() { + return this.getStringAttribute('ipv6_ip_address'); + } + public set ipv6IpAddress(value: string) { + this._ipv6IpAddress = value; + } + public resetIpv6IpAddress() { + this._ipv6IpAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6IpAddressInput() { + return this._ipv6IpAddress; + } + + // mac_address - computed: true, optional: false, required: false + public get macAddress() { + return this.getStringAttribute('mac_address'); + } + + // parent_device_id - computed: true, optional: false, required: false + public get parentDeviceId() { + return this.getStringAttribute('parent_device_id'); + } + + // parent_id - computed: false, optional: false, required: true + private _parentId?: string; + public get parentId() { + return this.getStringAttribute('parent_id'); + } + public set parentId(value: string) { + this._parentId = value; + } + // Temporarily expose input value. Use with caution. + public get parentIdInput() { + return this._parentId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_group_ids - computed: true, optional: true, required: false + private _securityGroupIds?: string[]; + public get securityGroupIds() { + return this.getListAttribute('security_group_ids'); + } + public set securityGroupIds(value: string[]) { + this._securityGroupIds = value; + } + public resetSecurityGroupIds() { + this._securityGroupIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupIdsInput() { + return this._securityGroupIds; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // vlan_id - computed: true, optional: true, required: false + private _vlanId?: string; + public get vlanId() { + return this.getStringAttribute('vlan_id'); + } + public set vlanId(value: string) { + this._vlanId = value; + } + public resetVlanId() { + this._vlanId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vlanIdInput() { + return this._vlanId; + } + + // vpc_id - computed: true, optional: false, required: false + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + ipv6_ip_address: cdktf.stringToTerraform(this._ipv6IpAddress), + parent_id: cdktf.stringToTerraform(this._parentId), + region: cdktf.stringToTerraform(this._region), + security_group_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroupIds), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vlan_id: cdktf.stringToTerraform(this._vlanId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + ipv6_ip_address: { + value: cdktf.stringToHclTerraform(this._ipv6IpAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + parent_id: { + value: cdktf.stringToHclTerraform(this._parentId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_group_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroupIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vlan_id: { + value: cdktf.stringToHclTerraform(this._vlanId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-subnet-v1/README.md b/src/constructs/providers/huaweicloud/vpc-subnet-v1/README.md new file mode 100644 index 00000000..1e443840 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-subnet-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_subnet_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_subnet_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1). diff --git a/src/constructs/providers/huaweicloud/vpc-subnet-v1/index.ts b/src/constructs/providers/huaweicloud/vpc-subnet-v1/index.ts new file mode 100644 index 00000000..c050d683 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-subnet-v1/index.ts @@ -0,0 +1,708 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcSubnetV1Config extends cdktf.TerraformMetaArguments { + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#availability_zone VpcSubnetV1#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#cidr VpcSubnetV1#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#description VpcSubnetV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#dhcp_enable VpcSubnetV1#dhcp_enable} + */ + readonly dhcpEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#dhcp_lease_time VpcSubnetV1#dhcp_lease_time} + */ + readonly dhcpLeaseTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#dns_list VpcSubnetV1#dns_list} + */ + readonly dnsList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#gateway_ip VpcSubnetV1#gateway_ip} + */ + readonly gatewayIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#id VpcSubnetV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#ipv6_enable VpcSubnetV1#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#name VpcSubnetV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#ntp_server_address VpcSubnetV1#ntp_server_address} + */ + readonly ntpServerAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#primary_dns VpcSubnetV1#primary_dns} + */ + readonly primaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#region VpcSubnetV1#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#secondary_dns VpcSubnetV1#secondary_dns} + */ + readonly secondaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#tags VpcSubnetV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#vpc_id VpcSubnetV1#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#timeouts VpcSubnetV1#timeouts} + */ + readonly timeouts?: VpcSubnetV1Timeouts; +} +export interface VpcSubnetV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#create VpcSubnetV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#delete VpcSubnetV1#delete} + */ + readonly delete?: string; +} + +export function vpcSubnetV1TimeoutsToTerraform(struct?: VpcSubnetV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcSubnetV1TimeoutsToHclTerraform(struct?: VpcSubnetV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcSubnetV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcSubnetV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcSubnetV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1 huaweicloud_vpc_subnet_v1} +*/ +export class VpcSubnetV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnet_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcSubnetV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcSubnetV1 to import + * @param importFromId The id of the existing VpcSubnetV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcSubnetV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnet_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet_v1 huaweicloud_vpc_subnet_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcSubnetV1Config + */ + public constructor(scope: Construct, id: string, config: VpcSubnetV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnet_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cidr = config.cidr; + this._description = config.description; + this._dhcpEnable = config.dhcpEnable; + this._dhcpLeaseTime = config.dhcpLeaseTime; + this._dnsList = config.dnsList; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._name = config.name; + this._ntpServerAddress = config.ntpServerAddress; + this._primaryDns = config.primaryDns; + this._region = config.region; + this._secondaryDns = config.secondaryDns; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dhcp_enable - computed: false, optional: true, required: false + private _dhcpEnable?: boolean | cdktf.IResolvable; + public get dhcpEnable() { + return this.getBooleanAttribute('dhcp_enable'); + } + public set dhcpEnable(value: boolean | cdktf.IResolvable) { + this._dhcpEnable = value; + } + public resetDhcpEnable() { + this._dhcpEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpEnableInput() { + return this._dhcpEnable; + } + + // dhcp_lease_time - computed: true, optional: true, required: false + private _dhcpLeaseTime?: string; + public get dhcpLeaseTime() { + return this.getStringAttribute('dhcp_lease_time'); + } + public set dhcpLeaseTime(value: string) { + this._dhcpLeaseTime = value; + } + public resetDhcpLeaseTime() { + this._dhcpLeaseTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpLeaseTimeInput() { + return this._dhcpLeaseTime; + } + + // dns_list - computed: true, optional: true, required: false + private _dnsList?: string[]; + public get dnsList() { + return this.getListAttribute('dns_list'); + } + public set dnsList(value: string[]) { + this._dnsList = value; + } + public resetDnsList() { + this._dnsList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dnsListInput() { + return this._dnsList; + } + + // gateway_ip - computed: false, optional: false, required: true + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv4_subnet_id - computed: true, optional: false, required: false + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + + // ipv6_cidr - computed: true, optional: false, required: false + public get ipv6Cidr() { + return this.getStringAttribute('ipv6_cidr'); + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // ipv6_gateway - computed: true, optional: false, required: false + public get ipv6Gateway() { + return this.getStringAttribute('ipv6_gateway'); + } + + // ipv6_subnet_id - computed: true, optional: false, required: false + public get ipv6SubnetId() { + return this.getStringAttribute('ipv6_subnet_id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ntp_server_address - computed: false, optional: true, required: false + private _ntpServerAddress?: string; + public get ntpServerAddress() { + return this.getStringAttribute('ntp_server_address'); + } + public set ntpServerAddress(value: string) { + this._ntpServerAddress = value; + } + public resetNtpServerAddress() { + this._ntpServerAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ntpServerAddressInput() { + return this._ntpServerAddress; + } + + // primary_dns - computed: true, optional: true, required: false + private _primaryDns?: string; + public get primaryDns() { + return this.getStringAttribute('primary_dns'); + } + public set primaryDns(value: string) { + this._primaryDns = value; + } + public resetPrimaryDns() { + this._primaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryDnsInput() { + return this._primaryDns; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secondary_dns - computed: true, optional: true, required: false + private _secondaryDns?: string; + public get secondaryDns() { + return this.getStringAttribute('secondary_dns'); + } + public set secondaryDns(value: string) { + this._secondaryDns = value; + } + public resetSecondaryDns() { + this._secondaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryDnsInput() { + return this._secondaryDns; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcSubnetV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcSubnetV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + dhcp_enable: cdktf.booleanToTerraform(this._dhcpEnable), + dhcp_lease_time: cdktf.stringToTerraform(this._dhcpLeaseTime), + dns_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dnsList), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + name: cdktf.stringToTerraform(this._name), + ntp_server_address: cdktf.stringToTerraform(this._ntpServerAddress), + primary_dns: cdktf.stringToTerraform(this._primaryDns), + region: cdktf.stringToTerraform(this._region), + secondary_dns: cdktf.stringToTerraform(this._secondaryDns), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: vpcSubnetV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dhcp_enable: { + value: cdktf.booleanToHclTerraform(this._dhcpEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dhcp_lease_time: { + value: cdktf.stringToHclTerraform(this._dhcpLeaseTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dns_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dnsList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ntp_server_address: { + value: cdktf.stringToHclTerraform(this._ntpServerAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_dns: { + value: cdktf.stringToHclTerraform(this._primaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_dns: { + value: cdktf.stringToHclTerraform(this._secondaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcSubnetV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcSubnetV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-subnet/README.md b/src/constructs/providers/huaweicloud/vpc-subnet/README.md new file mode 100644 index 00000000..e0942efb --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-subnet/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_subnet` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_subnet`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet). diff --git a/src/constructs/providers/huaweicloud/vpc-subnet/index.ts b/src/constructs/providers/huaweicloud/vpc-subnet/index.ts new file mode 100644 index 00000000..288ca782 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-subnet/index.ts @@ -0,0 +1,708 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcSubnetConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#availability_zone VpcSubnet#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#cidr VpcSubnet#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#description VpcSubnet#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#dhcp_enable VpcSubnet#dhcp_enable} + */ + readonly dhcpEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#dhcp_lease_time VpcSubnet#dhcp_lease_time} + */ + readonly dhcpLeaseTime?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#dns_list VpcSubnet#dns_list} + */ + readonly dnsList?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#gateway_ip VpcSubnet#gateway_ip} + */ + readonly gatewayIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#id VpcSubnet#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#ipv6_enable VpcSubnet#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#name VpcSubnet#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#ntp_server_address VpcSubnet#ntp_server_address} + */ + readonly ntpServerAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#primary_dns VpcSubnet#primary_dns} + */ + readonly primaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#region VpcSubnet#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#secondary_dns VpcSubnet#secondary_dns} + */ + readonly secondaryDns?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#tags VpcSubnet#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#vpc_id VpcSubnet#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#timeouts VpcSubnet#timeouts} + */ + readonly timeouts?: VpcSubnetTimeouts; +} +export interface VpcSubnetTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#create VpcSubnet#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#delete VpcSubnet#delete} + */ + readonly delete?: string; +} + +export function vpcSubnetTimeoutsToTerraform(struct?: VpcSubnetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcSubnetTimeoutsToHclTerraform(struct?: VpcSubnetTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcSubnetTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcSubnetTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcSubnetTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet huaweicloud_vpc_subnet} +*/ +export class VpcSubnet extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_subnet"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcSubnet resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcSubnet to import + * @param importFromId The id of the existing VpcSubnet that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcSubnet to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_subnet", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_subnet huaweicloud_vpc_subnet} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcSubnetConfig + */ + public constructor(scope: Construct, id: string, config: VpcSubnetConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_subnet', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._cidr = config.cidr; + this._description = config.description; + this._dhcpEnable = config.dhcpEnable; + this._dhcpLeaseTime = config.dhcpLeaseTime; + this._dnsList = config.dnsList; + this._gatewayIp = config.gatewayIp; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._name = config.name; + this._ntpServerAddress = config.ntpServerAddress; + this._primaryDns = config.primaryDns; + this._region = config.region; + this._secondaryDns = config.secondaryDns; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dhcp_enable - computed: false, optional: true, required: false + private _dhcpEnable?: boolean | cdktf.IResolvable; + public get dhcpEnable() { + return this.getBooleanAttribute('dhcp_enable'); + } + public set dhcpEnable(value: boolean | cdktf.IResolvable) { + this._dhcpEnable = value; + } + public resetDhcpEnable() { + this._dhcpEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpEnableInput() { + return this._dhcpEnable; + } + + // dhcp_lease_time - computed: true, optional: true, required: false + private _dhcpLeaseTime?: string; + public get dhcpLeaseTime() { + return this.getStringAttribute('dhcp_lease_time'); + } + public set dhcpLeaseTime(value: string) { + this._dhcpLeaseTime = value; + } + public resetDhcpLeaseTime() { + this._dhcpLeaseTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhcpLeaseTimeInput() { + return this._dhcpLeaseTime; + } + + // dns_list - computed: true, optional: true, required: false + private _dnsList?: string[]; + public get dnsList() { + return this.getListAttribute('dns_list'); + } + public set dnsList(value: string[]) { + this._dnsList = value; + } + public resetDnsList() { + this._dnsList = undefined; + } + // Temporarily expose input value. Use with caution. + public get dnsListInput() { + return this._dnsList; + } + + // gateway_ip - computed: false, optional: false, required: true + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv4_subnet_id - computed: true, optional: false, required: false + public get ipv4SubnetId() { + return this.getStringAttribute('ipv4_subnet_id'); + } + + // ipv6_cidr - computed: true, optional: false, required: false + public get ipv6Cidr() { + return this.getStringAttribute('ipv6_cidr'); + } + + // ipv6_enable - computed: false, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // ipv6_gateway - computed: true, optional: false, required: false + public get ipv6Gateway() { + return this.getStringAttribute('ipv6_gateway'); + } + + // ipv6_subnet_id - computed: true, optional: false, required: false + public get ipv6SubnetId() { + return this.getStringAttribute('ipv6_subnet_id'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ntp_server_address - computed: false, optional: true, required: false + private _ntpServerAddress?: string; + public get ntpServerAddress() { + return this.getStringAttribute('ntp_server_address'); + } + public set ntpServerAddress(value: string) { + this._ntpServerAddress = value; + } + public resetNtpServerAddress() { + this._ntpServerAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ntpServerAddressInput() { + return this._ntpServerAddress; + } + + // primary_dns - computed: true, optional: true, required: false + private _primaryDns?: string; + public get primaryDns() { + return this.getStringAttribute('primary_dns'); + } + public set primaryDns(value: string) { + this._primaryDns = value; + } + public resetPrimaryDns() { + this._primaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryDnsInput() { + return this._primaryDns; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // secondary_dns - computed: true, optional: true, required: false + private _secondaryDns?: string; + public get secondaryDns() { + return this.getStringAttribute('secondary_dns'); + } + public set secondaryDns(value: string) { + this._secondaryDns = value; + } + public resetSecondaryDns() { + this._secondaryDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryDnsInput() { + return this._secondaryDns; + } + + // subnet_id - computed: true, optional: false, required: false + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcSubnetTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcSubnetTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + dhcp_enable: cdktf.booleanToTerraform(this._dhcpEnable), + dhcp_lease_time: cdktf.stringToTerraform(this._dhcpLeaseTime), + dns_list: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dnsList), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + name: cdktf.stringToTerraform(this._name), + ntp_server_address: cdktf.stringToTerraform(this._ntpServerAddress), + primary_dns: cdktf.stringToTerraform(this._primaryDns), + region: cdktf.stringToTerraform(this._region), + secondary_dns: cdktf.stringToTerraform(this._secondaryDns), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: vpcSubnetTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dhcp_enable: { + value: cdktf.booleanToHclTerraform(this._dhcpEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + dhcp_lease_time: { + value: cdktf.stringToHclTerraform(this._dhcpLeaseTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dns_list: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dnsList), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ntp_server_address: { + value: cdktf.stringToHclTerraform(this._ntpServerAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_dns: { + value: cdktf.stringToHclTerraform(this._primaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_dns: { + value: cdktf.stringToHclTerraform(this._secondaryDns), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcSubnetTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcSubnetTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/README.md b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/README.md new file mode 100644 index 00000000..fef7e649 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_traffic_mirror_filter_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_traffic_mirror_filter_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule). diff --git a/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/index.ts b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/index.ts new file mode 100644 index 00000000..96ca7fce --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter-rule/index.ts @@ -0,0 +1,444 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcTrafficMirrorFilterRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#action VpcTrafficMirrorFilterRule#action} + */ + readonly action: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#description VpcTrafficMirrorFilterRule#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#destination_cidr_block VpcTrafficMirrorFilterRule#destination_cidr_block} + */ + readonly destinationCidrBlock?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#destination_port_range VpcTrafficMirrorFilterRule#destination_port_range} + */ + readonly destinationPortRange?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#direction VpcTrafficMirrorFilterRule#direction} + */ + readonly direction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#ethertype VpcTrafficMirrorFilterRule#ethertype} + */ + readonly ethertype: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#id VpcTrafficMirrorFilterRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#priority VpcTrafficMirrorFilterRule#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#protocol VpcTrafficMirrorFilterRule#protocol} + */ + readonly protocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#region VpcTrafficMirrorFilterRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#source_cidr_block VpcTrafficMirrorFilterRule#source_cidr_block} + */ + readonly sourceCidrBlock?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#source_port_range VpcTrafficMirrorFilterRule#source_port_range} + */ + readonly sourcePortRange?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#traffic_mirror_filter_id VpcTrafficMirrorFilterRule#traffic_mirror_filter_id} + */ + readonly trafficMirrorFilterId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule huaweicloud_vpc_traffic_mirror_filter_rule} +*/ +export class VpcTrafficMirrorFilterRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_traffic_mirror_filter_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcTrafficMirrorFilterRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcTrafficMirrorFilterRule to import + * @param importFromId The id of the existing VpcTrafficMirrorFilterRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcTrafficMirrorFilterRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_traffic_mirror_filter_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter_rule huaweicloud_vpc_traffic_mirror_filter_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcTrafficMirrorFilterRuleConfig + */ + public constructor(scope: Construct, id: string, config: VpcTrafficMirrorFilterRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_traffic_mirror_filter_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._destinationCidrBlock = config.destinationCidrBlock; + this._destinationPortRange = config.destinationPortRange; + this._direction = config.direction; + this._ethertype = config.ethertype; + this._id = config.id; + this._priority = config.priority; + this._protocol = config.protocol; + this._region = config.region; + this._sourceCidrBlock = config.sourceCidrBlock; + this._sourcePortRange = config.sourcePortRange; + this._trafficMirrorFilterId = config.trafficMirrorFilterId; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // destination_cidr_block - computed: false, optional: true, required: false + private _destinationCidrBlock?: string; + public get destinationCidrBlock() { + return this.getStringAttribute('destination_cidr_block'); + } + public set destinationCidrBlock(value: string) { + this._destinationCidrBlock = value; + } + public resetDestinationCidrBlock() { + this._destinationCidrBlock = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationCidrBlockInput() { + return this._destinationCidrBlock; + } + + // destination_port_range - computed: false, optional: true, required: false + private _destinationPortRange?: string; + public get destinationPortRange() { + return this.getStringAttribute('destination_port_range'); + } + public set destinationPortRange(value: string) { + this._destinationPortRange = value; + } + public resetDestinationPortRange() { + this._destinationPortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationPortRangeInput() { + return this._destinationPortRange; + } + + // direction - computed: false, optional: false, required: true + private _direction?: string; + public get direction() { + return this.getStringAttribute('direction'); + } + public set direction(value: string) { + this._direction = value; + } + // Temporarily expose input value. Use with caution. + public get directionInput() { + return this._direction; + } + + // ethertype - computed: false, optional: false, required: true + private _ethertype?: string; + public get ethertype() { + return this.getStringAttribute('ethertype'); + } + public set ethertype(value: string) { + this._ethertype = value; + } + // Temporarily expose input value. Use with caution. + public get ethertypeInput() { + return this._ethertype; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // protocol - computed: false, optional: false, required: true + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_cidr_block - computed: false, optional: true, required: false + private _sourceCidrBlock?: string; + public get sourceCidrBlock() { + return this.getStringAttribute('source_cidr_block'); + } + public set sourceCidrBlock(value: string) { + this._sourceCidrBlock = value; + } + public resetSourceCidrBlock() { + this._sourceCidrBlock = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceCidrBlockInput() { + return this._sourceCidrBlock; + } + + // source_port_range - computed: false, optional: true, required: false + private _sourcePortRange?: string; + public get sourcePortRange() { + return this.getStringAttribute('source_port_range'); + } + public set sourcePortRange(value: string) { + this._sourcePortRange = value; + } + public resetSourcePortRange() { + this._sourcePortRange = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourcePortRangeInput() { + return this._sourcePortRange; + } + + // traffic_mirror_filter_id - computed: false, optional: false, required: true + private _trafficMirrorFilterId?: string; + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + public set trafficMirrorFilterId(value: string) { + this._trafficMirrorFilterId = value; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorFilterIdInput() { + return this._trafficMirrorFilterId; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + destination_cidr_block: cdktf.stringToTerraform(this._destinationCidrBlock), + destination_port_range: cdktf.stringToTerraform(this._destinationPortRange), + direction: cdktf.stringToTerraform(this._direction), + ethertype: cdktf.stringToTerraform(this._ethertype), + id: cdktf.stringToTerraform(this._id), + priority: cdktf.numberToTerraform(this._priority), + protocol: cdktf.stringToTerraform(this._protocol), + region: cdktf.stringToTerraform(this._region), + source_cidr_block: cdktf.stringToTerraform(this._sourceCidrBlock), + source_port_range: cdktf.stringToTerraform(this._sourcePortRange), + traffic_mirror_filter_id: cdktf.stringToTerraform(this._trafficMirrorFilterId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_cidr_block: { + value: cdktf.stringToHclTerraform(this._destinationCidrBlock), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + destination_port_range: { + value: cdktf.stringToHclTerraform(this._destinationPortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + direction: { + value: cdktf.stringToHclTerraform(this._direction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ethertype: { + value: cdktf.stringToHclTerraform(this._ethertype), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protocol: { + value: cdktf.stringToHclTerraform(this._protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_cidr_block: { + value: cdktf.stringToHclTerraform(this._sourceCidrBlock), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + source_port_range: { + value: cdktf.stringToHclTerraform(this._sourcePortRange), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_filter_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorFilterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/README.md b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/README.md new file mode 100644 index 00000000..7dd057cf --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_traffic_mirror_filter` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_traffic_mirror_filter`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter). diff --git a/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/index.ts b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/index.ts new file mode 100644 index 00000000..57456ea9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-filter/index.ts @@ -0,0 +1,207 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcTrafficMirrorFilterConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter#description VpcTrafficMirrorFilter#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter#id VpcTrafficMirrorFilter#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter#name VpcTrafficMirrorFilter#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter#region VpcTrafficMirrorFilter#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter huaweicloud_vpc_traffic_mirror_filter} +*/ +export class VpcTrafficMirrorFilter extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_traffic_mirror_filter"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcTrafficMirrorFilter resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcTrafficMirrorFilter to import + * @param importFromId The id of the existing VpcTrafficMirrorFilter that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcTrafficMirrorFilter to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_traffic_mirror_filter", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_filter huaweicloud_vpc_traffic_mirror_filter} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcTrafficMirrorFilterConfig + */ + public constructor(scope: Construct, id: string, config: VpcTrafficMirrorFilterConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_traffic_mirror_filter', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/README.md b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/README.md new file mode 100644 index 00000000..7158c597 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_traffic_mirror_session` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_traffic_mirror_session`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session). diff --git a/src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/index.ts b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/index.ts new file mode 100644 index 00000000..9c518e0d --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-traffic-mirror-session/index.ts @@ -0,0 +1,444 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcTrafficMirrorSessionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#description VpcTrafficMirrorSession#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#enabled VpcTrafficMirrorSession#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#id VpcTrafficMirrorSession#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#name VpcTrafficMirrorSession#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#packet_length VpcTrafficMirrorSession#packet_length} + */ + readonly packetLength?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#priority VpcTrafficMirrorSession#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#region VpcTrafficMirrorSession#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#traffic_mirror_filter_id VpcTrafficMirrorSession#traffic_mirror_filter_id} + */ + readonly trafficMirrorFilterId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#traffic_mirror_sources VpcTrafficMirrorSession#traffic_mirror_sources} + */ + readonly trafficMirrorSources: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#traffic_mirror_target_id VpcTrafficMirrorSession#traffic_mirror_target_id} + */ + readonly trafficMirrorTargetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#traffic_mirror_target_type VpcTrafficMirrorSession#traffic_mirror_target_type} + */ + readonly trafficMirrorTargetType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#type VpcTrafficMirrorSession#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#virtual_network_id VpcTrafficMirrorSession#virtual_network_id} + */ + readonly virtualNetworkId?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session huaweicloud_vpc_traffic_mirror_session} +*/ +export class VpcTrafficMirrorSession extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_traffic_mirror_session"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcTrafficMirrorSession resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcTrafficMirrorSession to import + * @param importFromId The id of the existing VpcTrafficMirrorSession that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcTrafficMirrorSession to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_traffic_mirror_session", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_traffic_mirror_session huaweicloud_vpc_traffic_mirror_session} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcTrafficMirrorSessionConfig + */ + public constructor(scope: Construct, id: string, config: VpcTrafficMirrorSessionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_traffic_mirror_session', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enabled = config.enabled; + this._id = config.id; + this._name = config.name; + this._packetLength = config.packetLength; + this._priority = config.priority; + this._region = config.region; + this._trafficMirrorFilterId = config.trafficMirrorFilterId; + this._trafficMirrorSources = config.trafficMirrorSources; + this._trafficMirrorTargetId = config.trafficMirrorTargetId; + this._trafficMirrorTargetType = config.trafficMirrorTargetType; + this._type = config.type; + this._virtualNetworkId = config.virtualNetworkId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // packet_length - computed: true, optional: true, required: false + private _packetLength?: number; + public get packetLength() { + return this.getNumberAttribute('packet_length'); + } + public set packetLength(value: number) { + this._packetLength = value; + } + public resetPacketLength() { + this._packetLength = undefined; + } + // Temporarily expose input value. Use with caution. + public get packetLengthInput() { + return this._packetLength; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // traffic_mirror_filter_id - computed: false, optional: false, required: true + private _trafficMirrorFilterId?: string; + public get trafficMirrorFilterId() { + return this.getStringAttribute('traffic_mirror_filter_id'); + } + public set trafficMirrorFilterId(value: string) { + this._trafficMirrorFilterId = value; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorFilterIdInput() { + return this._trafficMirrorFilterId; + } + + // traffic_mirror_sources - computed: false, optional: false, required: true + private _trafficMirrorSources?: string[]; + public get trafficMirrorSources() { + return this.getListAttribute('traffic_mirror_sources'); + } + public set trafficMirrorSources(value: string[]) { + this._trafficMirrorSources = value; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorSourcesInput() { + return this._trafficMirrorSources; + } + + // traffic_mirror_target_id - computed: false, optional: false, required: true + private _trafficMirrorTargetId?: string; + public get trafficMirrorTargetId() { + return this.getStringAttribute('traffic_mirror_target_id'); + } + public set trafficMirrorTargetId(value: string) { + this._trafficMirrorTargetId = value; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorTargetIdInput() { + return this._trafficMirrorTargetId; + } + + // traffic_mirror_target_type - computed: false, optional: false, required: true + private _trafficMirrorTargetType?: string; + public get trafficMirrorTargetType() { + return this.getStringAttribute('traffic_mirror_target_type'); + } + public set trafficMirrorTargetType(value: string) { + this._trafficMirrorTargetType = value; + } + // Temporarily expose input value. Use with caution. + public get trafficMirrorTargetTypeInput() { + return this._trafficMirrorTargetType; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // virtual_network_id - computed: true, optional: true, required: false + private _virtualNetworkId?: number; + public get virtualNetworkId() { + return this.getNumberAttribute('virtual_network_id'); + } + public set virtualNetworkId(value: number) { + this._virtualNetworkId = value; + } + public resetVirtualNetworkId() { + this._virtualNetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get virtualNetworkIdInput() { + return this._virtualNetworkId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + packet_length: cdktf.numberToTerraform(this._packetLength), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + traffic_mirror_filter_id: cdktf.stringToTerraform(this._trafficMirrorFilterId), + traffic_mirror_sources: cdktf.listMapper(cdktf.stringToTerraform, false)(this._trafficMirrorSources), + traffic_mirror_target_id: cdktf.stringToTerraform(this._trafficMirrorTargetId), + traffic_mirror_target_type: cdktf.stringToTerraform(this._trafficMirrorTargetType), + type: cdktf.stringToTerraform(this._type), + virtual_network_id: cdktf.numberToTerraform(this._virtualNetworkId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + packet_length: { + value: cdktf.numberToHclTerraform(this._packetLength), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_filter_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorFilterId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_sources: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._trafficMirrorSources), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + traffic_mirror_target_id: { + value: cdktf.stringToHclTerraform(this._trafficMirrorTargetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + traffic_mirror_target_type: { + value: cdktf.stringToHclTerraform(this._trafficMirrorTargetType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + virtual_network_id: { + value: cdktf.numberToHclTerraform(this._virtualNetworkId), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc-v1/README.md b/src/constructs/providers/huaweicloud/vpc-v1/README.md new file mode 100644 index 00000000..c9ab4e1f --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-v1/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc_v1` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc_v1`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1). diff --git a/src/constructs/providers/huaweicloud/vpc-v1/index.ts b/src/constructs/providers/huaweicloud/vpc-v1/index.ts new file mode 100644 index 00000000..a0b5a06c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc-v1/index.ts @@ -0,0 +1,584 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcV1Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#cidr VpcV1#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#description VpcV1#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#enterprise_project_id VpcV1#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#id VpcV1#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#name VpcV1#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#region VpcV1#region} + */ + readonly region?: string; + /** + * schema: Deprecated; use secondary_cidrs instead + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#secondary_cidr VpcV1#secondary_cidr} + */ + readonly secondaryCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#secondary_cidrs VpcV1#secondary_cidrs} + */ + readonly secondaryCidrs?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#tags VpcV1#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#timeouts VpcV1#timeouts} + */ + readonly timeouts?: VpcV1Timeouts; +} +export interface VpcV1Routes { +} + +export function vpcV1RoutesToTerraform(struct?: VpcV1Routes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function vpcV1RoutesToHclTerraform(struct?: VpcV1Routes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class VpcV1RoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcV1Routes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcV1Routes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } +} + +export class VpcV1RoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcV1RoutesOutputReference { + return new VpcV1RoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcV1Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#create VpcV1#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#delete VpcV1#delete} + */ + readonly delete?: string; +} + +export function vpcV1TimeoutsToTerraform(struct?: VpcV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcV1TimeoutsToHclTerraform(struct?: VpcV1Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcV1TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcV1Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcV1Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1 huaweicloud_vpc_v1} +*/ +export class VpcV1 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc_v1"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcV1 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcV1 to import + * @param importFromId The id of the existing VpcV1 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcV1 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc_v1", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc_v1 huaweicloud_vpc_v1} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcV1Config + */ + public constructor(scope: Construct, id: string, config: VpcV1Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc_v1', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._secondaryCidr = config.secondaryCidr; + this._secondaryCidrs = config.secondaryCidrs; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routes - computed: true, optional: false, required: false + private _routes = new VpcV1RoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // secondary_cidr - computed: false, optional: true, required: false + private _secondaryCidr?: string; + public get secondaryCidr() { + return this.getStringAttribute('secondary_cidr'); + } + public set secondaryCidr(value: string) { + this._secondaryCidr = value; + } + public resetSecondaryCidr() { + this._secondaryCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryCidrInput() { + return this._secondaryCidr; + } + + // secondary_cidrs - computed: true, optional: true, required: false + private _secondaryCidrs?: string[]; + public get secondaryCidrs() { + return cdktf.Fn.tolist(this.getListAttribute('secondary_cidrs')); + } + public set secondaryCidrs(value: string[]) { + this._secondaryCidrs = value; + } + public resetSecondaryCidrs() { + this._secondaryCidrs = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryCidrsInput() { + return this._secondaryCidrs; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcV1TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcV1Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secondary_cidr: cdktf.stringToTerraform(this._secondaryCidr), + secondary_cidrs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._secondaryCidrs), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: vpcV1TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_cidr: { + value: cdktf.stringToHclTerraform(this._secondaryCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_cidrs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._secondaryCidrs), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: vpcV1TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcV1Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpc/README.md b/src/constructs/providers/huaweicloud/vpc/README.md new file mode 100644 index 00000000..dcdfa255 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpc` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpc`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc). diff --git a/src/constructs/providers/huaweicloud/vpc/index.ts b/src/constructs/providers/huaweicloud/vpc/index.ts new file mode 100644 index 00000000..3203fa1c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpc/index.ts @@ -0,0 +1,584 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#cidr Vpc#cidr} + */ + readonly cidr: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#description Vpc#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#enterprise_project_id Vpc#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#id Vpc#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#name Vpc#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#region Vpc#region} + */ + readonly region?: string; + /** + * schema: Deprecated; use secondary_cidrs instead + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#secondary_cidr Vpc#secondary_cidr} + */ + readonly secondaryCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#secondary_cidrs Vpc#secondary_cidrs} + */ + readonly secondaryCidrs?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#tags Vpc#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#timeouts Vpc#timeouts} + */ + readonly timeouts?: VpcTimeouts; +} +export interface VpcRoutes { +} + +export function vpcRoutesToTerraform(struct?: VpcRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function vpcRoutesToHclTerraform(struct?: VpcRoutes): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class VpcRoutesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcRoutes | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcRoutes | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // destination - computed: true, optional: false, required: false + public get destination() { + return this.getStringAttribute('destination'); + } + + // nexthop - computed: true, optional: false, required: false + public get nexthop() { + return this.getStringAttribute('nexthop'); + } +} + +export class VpcRoutesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcRoutesOutputReference { + return new VpcRoutesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#create Vpc#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#delete Vpc#delete} + */ + readonly delete?: string; +} + +export function vpcTimeoutsToTerraform(struct?: VpcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcTimeoutsToHclTerraform(struct?: VpcTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc huaweicloud_vpc} +*/ +export class Vpc extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpc"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a Vpc resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the Vpc to import + * @param importFromId The id of the existing Vpc that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the Vpc to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpc", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpc huaweicloud_vpc} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcConfig + */ + public constructor(scope: Construct, id: string, config: VpcConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpc', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._cidr = config.cidr; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._secondaryCidr = config.secondaryCidr; + this._secondaryCidrs = config.secondaryCidrs; + this._tags = config.tags; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // cidr - computed: false, optional: false, required: true + private _cidr?: string; + public get cidr() { + return this.getStringAttribute('cidr'); + } + public set cidr(value: string) { + this._cidr = value; + } + // Temporarily expose input value. Use with caution. + public get cidrInput() { + return this._cidr; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routes - computed: true, optional: false, required: false + private _routes = new VpcRoutesList(this, "routes", false); + public get routes() { + return this._routes; + } + + // secondary_cidr - computed: false, optional: true, required: false + private _secondaryCidr?: string; + public get secondaryCidr() { + return this.getStringAttribute('secondary_cidr'); + } + public set secondaryCidr(value: string) { + this._secondaryCidr = value; + } + public resetSecondaryCidr() { + this._secondaryCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryCidrInput() { + return this._secondaryCidr; + } + + // secondary_cidrs - computed: true, optional: true, required: false + private _secondaryCidrs?: string[]; + public get secondaryCidrs() { + return cdktf.Fn.tolist(this.getListAttribute('secondary_cidrs')); + } + public set secondaryCidrs(value: string[]) { + this._secondaryCidrs = value; + } + public resetSecondaryCidrs() { + this._secondaryCidrs = undefined; + } + // Temporarily expose input value. Use with caution. + public get secondaryCidrsInput() { + return this._secondaryCidrs; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + cidr: cdktf.stringToTerraform(this._cidr), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + secondary_cidr: cdktf.stringToTerraform(this._secondaryCidr), + secondary_cidrs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._secondaryCidrs), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + timeouts: vpcTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + cidr: { + value: cdktf.stringToHclTerraform(this._cidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_cidr: { + value: cdktf.stringToHclTerraform(this._secondaryCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + secondary_cidrs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._secondaryCidrs), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: vpcTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpcep-approval/README.md b/src/constructs/providers/huaweicloud/vpcep-approval/README.md new file mode 100644 index 00000000..066782e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpcep-approval/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpcep_approval` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpcep_approval`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval). diff --git a/src/constructs/providers/huaweicloud/vpcep-approval/index.ts b/src/constructs/providers/huaweicloud/vpcep-approval/index.ts new file mode 100644 index 00000000..89171aff --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpcep-approval/index.ts @@ -0,0 +1,452 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcepApprovalConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#endpoints VpcepApproval#endpoints} + */ + readonly endpoints: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#id VpcepApproval#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#region VpcepApproval#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#service_id VpcepApproval#service_id} + */ + readonly serviceId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#timeouts VpcepApproval#timeouts} + */ + readonly timeouts?: VpcepApprovalTimeouts; +} +export interface VpcepApprovalConnections { +} + +export function vpcepApprovalConnectionsToTerraform(struct?: VpcepApprovalConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function vpcepApprovalConnectionsToHclTerraform(struct?: VpcepApprovalConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class VpcepApprovalConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcepApprovalConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcepApprovalConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // endpoint_id - computed: true, optional: false, required: false + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + + // packet_id - computed: true, optional: false, required: false + public get packetId() { + return this.getNumberAttribute('packet_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class VpcepApprovalConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcepApprovalConnectionsOutputReference { + return new VpcepApprovalConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcepApprovalTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#create VpcepApproval#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#delete VpcepApproval#delete} + */ + readonly delete?: string; +} + +export function vpcepApprovalTimeoutsToTerraform(struct?: VpcepApprovalTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcepApprovalTimeoutsToHclTerraform(struct?: VpcepApprovalTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcepApprovalTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcepApprovalTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcepApprovalTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval huaweicloud_vpcep_approval} +*/ +export class VpcepApproval extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_approval"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcepApproval resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcepApproval to import + * @param importFromId The id of the existing VpcepApproval that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcepApproval to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_approval", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_approval huaweicloud_vpcep_approval} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcepApprovalConfig + */ + public constructor(scope: Construct, id: string, config: VpcepApprovalConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_approval', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._endpoints = config.endpoints; + this._id = config.id; + this._region = config.region; + this._serviceId = config.serviceId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // connections - computed: true, optional: false, required: false + private _connections = new VpcepApprovalConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // endpoints - computed: false, optional: false, required: true + private _endpoints?: string[]; + public get endpoints() { + return cdktf.Fn.tolist(this.getListAttribute('endpoints')); + } + public set endpoints(value: string[]) { + this._endpoints = value; + } + // Temporarily expose input value. Use with caution. + public get endpointsInput() { + return this._endpoints; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcepApprovalTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcepApprovalTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + endpoints: cdktf.listMapper(cdktf.stringToTerraform, false)(this._endpoints), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + service_id: cdktf.stringToTerraform(this._serviceId), + timeouts: vpcepApprovalTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + endpoints: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._endpoints), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpcepApprovalTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcepApprovalTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpcep-endpoint/README.md b/src/constructs/providers/huaweicloud/vpcep-endpoint/README.md new file mode 100644 index 00000000..5c8bfa7c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpcep-endpoint/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpcep_endpoint` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpcep_endpoint`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint). diff --git a/src/constructs/providers/huaweicloud/vpcep-endpoint/index.ts b/src/constructs/providers/huaweicloud/vpcep-endpoint/index.ts new file mode 100644 index 00000000..406461d7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpcep-endpoint/index.ts @@ -0,0 +1,714 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcepEndpointConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#description VpcepEndpoint#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#enable_dns VpcepEndpoint#enable_dns} + */ + readonly enableDns?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#enable_whitelist VpcepEndpoint#enable_whitelist} + */ + readonly enableWhitelist?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#id VpcepEndpoint#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#ip_address VpcepEndpoint#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#ip_version VpcepEndpoint#ip_version} + */ + readonly ipVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#ipv6_address VpcepEndpoint#ipv6_address} + */ + readonly ipv6Address?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#network_id VpcepEndpoint#network_id} + */ + readonly networkId?: string; + /** + * Specifies the endpoint policy information + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#policy_document VpcepEndpoint#policy_document} + */ + readonly policyDocument?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#policy_statement VpcepEndpoint#policy_statement} + */ + readonly policyStatement?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#region VpcepEndpoint#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#routetables VpcepEndpoint#routetables} + */ + readonly routetables?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#service_id VpcepEndpoint#service_id} + */ + readonly serviceId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#tags VpcepEndpoint#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#vpc_id VpcepEndpoint#vpc_id} + */ + readonly vpcId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#whitelist VpcepEndpoint#whitelist} + */ + readonly whitelist?: string[]; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#timeouts VpcepEndpoint#timeouts} + */ + readonly timeouts?: VpcepEndpointTimeouts; +} +export interface VpcepEndpointTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#create VpcepEndpoint#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#delete VpcepEndpoint#delete} + */ + readonly delete?: string; +} + +export function vpcepEndpointTimeoutsToTerraform(struct?: VpcepEndpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcepEndpointTimeoutsToHclTerraform(struct?: VpcepEndpointTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcepEndpointTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcepEndpointTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcepEndpointTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint huaweicloud_vpcep_endpoint} +*/ +export class VpcepEndpoint extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_endpoint"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcepEndpoint resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcepEndpoint to import + * @param importFromId The id of the existing VpcepEndpoint that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcepEndpoint to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_endpoint", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_endpoint huaweicloud_vpcep_endpoint} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcepEndpointConfig + */ + public constructor(scope: Construct, id: string, config: VpcepEndpointConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_endpoint', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enableDns = config.enableDns; + this._enableWhitelist = config.enableWhitelist; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._ipVersion = config.ipVersion; + this._ipv6Address = config.ipv6Address; + this._networkId = config.networkId; + this._policyDocument = config.policyDocument; + this._policyStatement = config.policyStatement; + this._region = config.region; + this._routetables = config.routetables; + this._serviceId = config.serviceId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._whitelist = config.whitelist; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_dns - computed: false, optional: true, required: false + private _enableDns?: boolean | cdktf.IResolvable; + public get enableDns() { + return this.getBooleanAttribute('enable_dns'); + } + public set enableDns(value: boolean | cdktf.IResolvable) { + this._enableDns = value; + } + public resetEnableDns() { + this._enableDns = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableDnsInput() { + return this._enableDns; + } + + // enable_whitelist - computed: false, optional: true, required: false + private _enableWhitelist?: boolean | cdktf.IResolvable; + public get enableWhitelist() { + return this.getBooleanAttribute('enable_whitelist'); + } + public set enableWhitelist(value: boolean | cdktf.IResolvable) { + this._enableWhitelist = value; + } + public resetEnableWhitelist() { + this._enableWhitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableWhitelistInput() { + return this._enableWhitelist; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: string; + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + public set ipVersion(value: string) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // ipv6_address - computed: true, optional: true, required: false + private _ipv6Address?: string; + public get ipv6Address() { + return this.getStringAttribute('ipv6_address'); + } + public set ipv6Address(value: string) { + this._ipv6Address = value; + } + public resetIpv6Address() { + this._ipv6Address = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6AddressInput() { + return this._ipv6Address; + } + + // network_id - computed: true, optional: true, required: false + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + public resetNetworkId() { + this._networkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } + + // packet_id - computed: true, optional: false, required: false + public get packetId() { + return this.getNumberAttribute('packet_id'); + } + + // policy_document - computed: true, optional: true, required: false + private _policyDocument?: string; + public get policyDocument() { + return this.getStringAttribute('policy_document'); + } + public set policyDocument(value: string) { + this._policyDocument = value; + } + public resetPolicyDocument() { + this._policyDocument = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyDocumentInput() { + return this._policyDocument; + } + + // policy_statement - computed: true, optional: true, required: false + private _policyStatement?: string; + public get policyStatement() { + return this.getStringAttribute('policy_statement'); + } + public set policyStatement(value: string) { + this._policyStatement = value; + } + public resetPolicyStatement() { + this._policyStatement = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyStatementInput() { + return this._policyStatement; + } + + // private_domain_name - computed: true, optional: false, required: false + public get privateDomainName() { + return this.getStringAttribute('private_domain_name'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // routetables - computed: true, optional: true, required: false + private _routetables?: string[]; + public get routetables() { + return cdktf.Fn.tolist(this.getListAttribute('routetables')); + } + public set routetables(value: string[]) { + this._routetables = value; + } + public resetRoutetables() { + this._routetables = undefined; + } + // Temporarily expose input value. Use with caution. + public get routetablesInput() { + return this._routetables; + } + + // service_id - computed: false, optional: false, required: true + private _serviceId?: string; + public get serviceId() { + return this.getStringAttribute('service_id'); + } + public set serviceId(value: string) { + this._serviceId = value; + } + // Temporarily expose input value. Use with caution. + public get serviceIdInput() { + return this._serviceId; + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // service_type - computed: true, optional: false, required: false + public get serviceType() { + return this.getStringAttribute('service_type'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // whitelist - computed: false, optional: true, required: false + private _whitelist?: string[]; + public get whitelist() { + return cdktf.Fn.tolist(this.getListAttribute('whitelist')); + } + public set whitelist(value: string[]) { + this._whitelist = value; + } + public resetWhitelist() { + this._whitelist = undefined; + } + // Temporarily expose input value. Use with caution. + public get whitelistInput() { + return this._whitelist; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcepEndpointTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcepEndpointTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enable_dns: cdktf.booleanToTerraform(this._enableDns), + enable_whitelist: cdktf.booleanToTerraform(this._enableWhitelist), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + ip_version: cdktf.stringToTerraform(this._ipVersion), + ipv6_address: cdktf.stringToTerraform(this._ipv6Address), + network_id: cdktf.stringToTerraform(this._networkId), + policy_document: cdktf.stringToTerraform(this._policyDocument), + policy_statement: cdktf.stringToTerraform(this._policyStatement), + region: cdktf.stringToTerraform(this._region), + routetables: cdktf.listMapper(cdktf.stringToTerraform, false)(this._routetables), + service_id: cdktf.stringToTerraform(this._serviceId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + whitelist: cdktf.listMapper(cdktf.stringToTerraform, false)(this._whitelist), + timeouts: vpcepEndpointTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_dns: { + value: cdktf.booleanToHclTerraform(this._enableDns), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enable_whitelist: { + value: cdktf.booleanToHclTerraform(this._enableWhitelist), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.stringToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_address: { + value: cdktf.stringToHclTerraform(this._ipv6Address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_id: { + value: cdktf.stringToHclTerraform(this._networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_document: { + value: cdktf.stringToHclTerraform(this._policyDocument), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_statement: { + value: cdktf.stringToHclTerraform(this._policyStatement), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + routetables: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._routetables), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + service_id: { + value: cdktf.stringToHclTerraform(this._serviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + whitelist: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._whitelist), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + timeouts: { + value: vpcepEndpointTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcepEndpointTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpcep-service/README.md b/src/constructs/providers/huaweicloud/vpcep-service/README.md new file mode 100644 index 00000000..bb71e9f7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpcep-service/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpcep_service` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpcep_service`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service). diff --git a/src/constructs/providers/huaweicloud/vpcep-service/index.ts b/src/constructs/providers/huaweicloud/vpcep-service/index.ts new file mode 100644 index 00000000..bc59508d --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpcep-service/index.ts @@ -0,0 +1,1070 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpcepServiceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#approval VpcepService#approval} + */ + readonly approval?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#description VpcepService#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#enable_policy VpcepService#enable_policy} + */ + readonly enablePolicy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#id VpcepService#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The IPv4 address or domain name of the server in the interface type VLAN scenario. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#ip_address VpcepService#ip_address} + */ + readonly ipAddress?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#ip_version VpcepService#ip_version} + */ + readonly ipVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#name VpcepService#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#organization_permissions VpcepService#organization_permissions} + */ + readonly organizationPermissions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#permissions VpcepService#permissions} + */ + readonly permissions?: string[]; + /** + * The dedicated cluster ID associated with the VPC endpoint service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#pool_id VpcepService#pool_id} + */ + readonly poolId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#port_id VpcepService#port_id} + */ + readonly portId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#region VpcepService#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#server_type VpcepService#server_type} + */ + readonly serverType: string; + /** + * schema: Computed + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#service_type VpcepService#service_type} + */ + readonly serviceType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#snat_network_id VpcepService#snat_network_id} + */ + readonly snatNetworkId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#tags VpcepService#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#tcp_proxy VpcepService#tcp_proxy} + */ + readonly tcpProxy?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#vpc_id VpcepService#vpc_id} + */ + readonly vpcId: string; + /** + * port_mapping block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#port_mapping VpcepService#port_mapping} + */ + readonly portMapping: VpcepServicePortMapping[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#timeouts VpcepService#timeouts} + */ + readonly timeouts?: VpcepServiceTimeouts; +} +export interface VpcepServiceConnections { +} + +export function vpcepServiceConnectionsToTerraform(struct?: VpcepServiceConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function vpcepServiceConnectionsToHclTerraform(struct?: VpcepServiceConnections): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class VpcepServiceConnectionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcepServiceConnections | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcepServiceConnections | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // domain_id - computed: true, optional: false, required: false + public get domainId() { + return this.getStringAttribute('domain_id'); + } + + // endpoint_id - computed: true, optional: false, required: false + public get endpointId() { + return this.getStringAttribute('endpoint_id'); + } + + // packet_id - computed: true, optional: false, required: false + public get packetId() { + return this.getNumberAttribute('packet_id'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } +} + +export class VpcepServiceConnectionsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcepServiceConnectionsOutputReference { + return new VpcepServiceConnectionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcepServicePortMapping { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#protocol VpcepService#protocol} + */ + readonly protocol?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#service_port VpcepService#service_port} + */ + readonly servicePort?: number; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#terminal_port VpcepService#terminal_port} + */ + readonly terminalPort?: number; +} + +export function vpcepServicePortMappingToTerraform(struct?: VpcepServicePortMapping | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + protocol: cdktf.stringToTerraform(struct!.protocol), + service_port: cdktf.numberToTerraform(struct!.servicePort), + terminal_port: cdktf.numberToTerraform(struct!.terminalPort), + } +} + + +export function vpcepServicePortMappingToHclTerraform(struct?: VpcepServicePortMapping | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + protocol: { + value: cdktf.stringToHclTerraform(struct!.protocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_port: { + value: cdktf.numberToHclTerraform(struct!.servicePort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + terminal_port: { + value: cdktf.numberToHclTerraform(struct!.terminalPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcepServicePortMappingOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpcepServicePortMapping | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._protocol !== undefined) { + hasAnyValues = true; + internalValueResult.protocol = this._protocol; + } + if (this._servicePort !== undefined) { + hasAnyValues = true; + internalValueResult.servicePort = this._servicePort; + } + if (this._terminalPort !== undefined) { + hasAnyValues = true; + internalValueResult.terminalPort = this._terminalPort; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcepServicePortMapping | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._protocol = undefined; + this._servicePort = undefined; + this._terminalPort = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._protocol = value.protocol; + this._servicePort = value.servicePort; + this._terminalPort = value.terminalPort; + } + } + + // protocol - computed: false, optional: true, required: false + private _protocol?: string; + public get protocol() { + return this.getStringAttribute('protocol'); + } + public set protocol(value: string) { + this._protocol = value; + } + public resetProtocol() { + this._protocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get protocolInput() { + return this._protocol; + } + + // service_port - computed: false, optional: true, required: false + private _servicePort?: number; + public get servicePort() { + return this.getNumberAttribute('service_port'); + } + public set servicePort(value: number) { + this._servicePort = value; + } + public resetServicePort() { + this._servicePort = undefined; + } + // Temporarily expose input value. Use with caution. + public get servicePortInput() { + return this._servicePort; + } + + // terminal_port - computed: false, optional: true, required: false + private _terminalPort?: number; + public get terminalPort() { + return this.getNumberAttribute('terminal_port'); + } + public set terminalPort(value: number) { + this._terminalPort = value; + } + public resetTerminalPort() { + this._terminalPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get terminalPortInput() { + return this._terminalPort; + } +} + +export class VpcepServicePortMappingList extends cdktf.ComplexList { + public internalValue? : VpcepServicePortMapping[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpcepServicePortMappingOutputReference { + return new VpcepServicePortMappingOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpcepServiceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#create VpcepService#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#delete VpcepService#delete} + */ + readonly delete?: string; +} + +export function vpcepServiceTimeoutsToTerraform(struct?: VpcepServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function vpcepServiceTimeoutsToHclTerraform(struct?: VpcepServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpcepServiceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpcepServiceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpcepServiceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service huaweicloud_vpcep_service} +*/ +export class VpcepService extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpcep_service"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpcepService resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpcepService to import + * @param importFromId The id of the existing VpcepService that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpcepService to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpcep_service", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpcep_service huaweicloud_vpcep_service} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpcepServiceConfig + */ + public constructor(scope: Construct, id: string, config: VpcepServiceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpcep_service', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._approval = config.approval; + this._description = config.description; + this._enablePolicy = config.enablePolicy; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._ipVersion = config.ipVersion; + this._name = config.name; + this._organizationPermissions = config.organizationPermissions; + this._permissions = config.permissions; + this._poolId = config.poolId; + this._portId = config.portId; + this._region = config.region; + this._serverType = config.serverType; + this._serviceType = config.serviceType; + this._snatNetworkId = config.snatNetworkId; + this._tags = config.tags; + this._tcpProxy = config.tcpProxy; + this._vpcId = config.vpcId; + this._portMapping.internalValue = config.portMapping; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // approval - computed: true, optional: true, required: false + private _approval?: boolean | cdktf.IResolvable; + public get approval() { + return this.getBooleanAttribute('approval'); + } + public set approval(value: boolean | cdktf.IResolvable) { + this._approval = value; + } + public resetApproval() { + this._approval = undefined; + } + // Temporarily expose input value. Use with caution. + public get approvalInput() { + return this._approval; + } + + // connections - computed: true, optional: false, required: false + private _connections = new VpcepServiceConnectionsList(this, "connections", false); + public get connections() { + return this._connections; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enable_policy - computed: true, optional: true, required: false + private _enablePolicy?: boolean | cdktf.IResolvable; + public get enablePolicy() { + return this.getBooleanAttribute('enable_policy'); + } + public set enablePolicy(value: boolean | cdktf.IResolvable) { + this._enablePolicy = value; + } + public resetEnablePolicy() { + this._enablePolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get enablePolicyInput() { + return this._enablePolicy; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // ip_version - computed: true, optional: true, required: false + private _ipVersion?: string; + public get ipVersion() { + return this.getStringAttribute('ip_version'); + } + public set ipVersion(value: string) { + this._ipVersion = value; + } + public resetIpVersion() { + this._ipVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVersionInput() { + return this._ipVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // organization_permissions - computed: true, optional: true, required: false + private _organizationPermissions?: string[]; + public get organizationPermissions() { + return cdktf.Fn.tolist(this.getListAttribute('organization_permissions')); + } + public set organizationPermissions(value: string[]) { + this._organizationPermissions = value; + } + public resetOrganizationPermissions() { + this._organizationPermissions = undefined; + } + // Temporarily expose input value. Use with caution. + public get organizationPermissionsInput() { + return this._organizationPermissions; + } + + // permissions - computed: false, optional: true, required: false + private _permissions?: string[]; + public get permissions() { + return cdktf.Fn.tolist(this.getListAttribute('permissions')); + } + public set permissions(value: string[]) { + this._permissions = value; + } + public resetPermissions() { + this._permissions = undefined; + } + // Temporarily expose input value. Use with caution. + public get permissionsInput() { + return this._permissions; + } + + // pool_id - computed: true, optional: true, required: false + private _poolId?: string; + public get poolId() { + return this.getStringAttribute('pool_id'); + } + public set poolId(value: string) { + this._poolId = value; + } + public resetPoolId() { + this._poolId = undefined; + } + // Temporarily expose input value. Use with caution. + public get poolIdInput() { + return this._poolId; + } + + // port_id - computed: false, optional: false, required: true + private _portId?: string; + public get portId() { + return this.getStringAttribute('port_id'); + } + public set portId(value: string) { + this._portId = value; + } + // Temporarily expose input value. Use with caution. + public get portIdInput() { + return this._portId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_type - computed: false, optional: false, required: true + private _serverType?: string; + public get serverType() { + return this.getStringAttribute('server_type'); + } + public set serverType(value: string) { + this._serverType = value; + } + // Temporarily expose input value. Use with caution. + public get serverTypeInput() { + return this._serverType; + } + + // service_name - computed: true, optional: false, required: false + public get serviceName() { + return this.getStringAttribute('service_name'); + } + + // service_type - computed: false, optional: true, required: false + private _serviceType?: string; + public get serviceType() { + return this.getStringAttribute('service_type'); + } + public set serviceType(value: string) { + this._serviceType = value; + } + public resetServiceType() { + this._serviceType = undefined; + } + // Temporarily expose input value. Use with caution. + public get serviceTypeInput() { + return this._serviceType; + } + + // snat_network_id - computed: true, optional: true, required: false + private _snatNetworkId?: string; + public get snatNetworkId() { + return this.getStringAttribute('snat_network_id'); + } + public set snatNetworkId(value: string) { + this._snatNetworkId = value; + } + public resetSnatNetworkId() { + this._snatNetworkId = undefined; + } + // Temporarily expose input value. Use with caution. + public get snatNetworkIdInput() { + return this._snatNetworkId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tcp_proxy - computed: true, optional: true, required: false + private _tcpProxy?: string; + public get tcpProxy() { + return this.getStringAttribute('tcp_proxy'); + } + public set tcpProxy(value: string) { + this._tcpProxy = value; + } + public resetTcpProxy() { + this._tcpProxy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tcpProxyInput() { + return this._tcpProxy; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // port_mapping - computed: false, optional: false, required: true + private _portMapping = new VpcepServicePortMappingList(this, "port_mapping", false); + public get portMapping() { + return this._portMapping; + } + public putPortMapping(value: VpcepServicePortMapping[] | cdktf.IResolvable) { + this._portMapping.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get portMappingInput() { + return this._portMapping.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpcepServiceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpcepServiceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + approval: cdktf.booleanToTerraform(this._approval), + description: cdktf.stringToTerraform(this._description), + enable_policy: cdktf.booleanToTerraform(this._enablePolicy), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + ip_version: cdktf.stringToTerraform(this._ipVersion), + name: cdktf.stringToTerraform(this._name), + organization_permissions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._organizationPermissions), + permissions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._permissions), + pool_id: cdktf.stringToTerraform(this._poolId), + port_id: cdktf.stringToTerraform(this._portId), + region: cdktf.stringToTerraform(this._region), + server_type: cdktf.stringToTerraform(this._serverType), + service_type: cdktf.stringToTerraform(this._serviceType), + snat_network_id: cdktf.stringToTerraform(this._snatNetworkId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tcp_proxy: cdktf.stringToTerraform(this._tcpProxy), + vpc_id: cdktf.stringToTerraform(this._vpcId), + port_mapping: cdktf.listMapper(vpcepServicePortMappingToTerraform, true)(this._portMapping.internalValue), + timeouts: vpcepServiceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + approval: { + value: cdktf.booleanToHclTerraform(this._approval), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_policy: { + value: cdktf.booleanToHclTerraform(this._enablePolicy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_version: { + value: cdktf.stringToHclTerraform(this._ipVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + organization_permissions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._organizationPermissions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + permissions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._permissions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + pool_id: { + value: cdktf.stringToHclTerraform(this._poolId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_id: { + value: cdktf.stringToHclTerraform(this._portId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_type: { + value: cdktf.stringToHclTerraform(this._serverType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + service_type: { + value: cdktf.stringToHclTerraform(this._serviceType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + snat_network_id: { + value: cdktf.stringToHclTerraform(this._snatNetworkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tcp_proxy: { + value: cdktf.stringToHclTerraform(this._tcpProxy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port_mapping: { + value: cdktf.listMapperHcl(vpcepServicePortMappingToHclTerraform, true)(this._portMapping.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpcepServicePortMappingList", + }, + timeouts: { + value: vpcepServiceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpcepServiceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-access-policy/README.md b/src/constructs/providers/huaweicloud/vpn-access-policy/README.md new file mode 100644 index 00000000..43302fe0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-access-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_access_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_access_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy). diff --git a/src/constructs/providers/huaweicloud/vpn-access-policy/index.ts b/src/constructs/providers/huaweicloud/vpn-access-policy/index.ts new file mode 100644 index 00000000..5675650a --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-access-policy/index.ts @@ -0,0 +1,297 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnAccessPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the access policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#description VpnAccessPolicy#description} + */ + readonly description?: string; + /** + * The list of destination IP CIDRs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#dest_ip_cidrs VpnAccessPolicy#dest_ip_cidrs} + */ + readonly destIpCidrs: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#id VpnAccessPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The access policy name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#name VpnAccessPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#region VpnAccessPolicy#region} + */ + readonly region?: string; + /** + * The user group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#user_group_id VpnAccessPolicy#user_group_id} + */ + readonly userGroupId: string; + /** + * The VPN server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#vpn_server_id VpnAccessPolicy#vpn_server_id} + */ + readonly vpnServerId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy huaweicloud_vpn_access_policy} +*/ +export class VpnAccessPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_access_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnAccessPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnAccessPolicy to import + * @param importFromId The id of the existing VpnAccessPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnAccessPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_access_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_access_policy huaweicloud_vpn_access_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnAccessPolicyConfig + */ + public constructor(scope: Construct, id: string, config: VpnAccessPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_access_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._destIpCidrs = config.destIpCidrs; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._userGroupId = config.userGroupId; + this._vpnServerId = config.vpnServerId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // dest_ip_cidrs - computed: false, optional: false, required: true + private _destIpCidrs?: string[]; + public get destIpCidrs() { + return cdktf.Fn.tolist(this.getListAttribute('dest_ip_cidrs')); + } + public set destIpCidrs(value: string[]) { + this._destIpCidrs = value; + } + // Temporarily expose input value. Use with caution. + public get destIpCidrsInput() { + return this._destIpCidrs; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_group_id - computed: false, optional: false, required: true + private _userGroupId?: string; + public get userGroupId() { + return this.getStringAttribute('user_group_id'); + } + public set userGroupId(value: string) { + this._userGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get userGroupIdInput() { + return this._userGroupId; + } + + // user_group_name - computed: true, optional: false, required: false + public get userGroupName() { + return this.getStringAttribute('user_group_name'); + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + dest_ip_cidrs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._destIpCidrs), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + user_group_id: cdktf.stringToTerraform(this._userGroupId), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dest_ip_cidrs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._destIpCidrs), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_group_id: { + value: cdktf.stringToHclTerraform(this._userGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-client-ca-certificate/README.md b/src/constructs/providers/huaweicloud/vpn-client-ca-certificate/README.md new file mode 100644 index 00000000..b1482a6c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-client-ca-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_client_ca_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_client_ca_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate). diff --git a/src/constructs/providers/huaweicloud/vpn-client-ca-certificate/index.ts b/src/constructs/providers/huaweicloud/vpn-client-ca-certificate/index.ts new file mode 100644 index 00000000..ca25a653 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-client-ca-certificate/index.ts @@ -0,0 +1,450 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnClientCaCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * The content of client CA certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#content VpnClientCaCertificate#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#id VpnClientCaCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of client CA certificate. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#name VpnClientCaCertificate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#region VpnClientCaCertificate#region} + */ + readonly region?: string; + /** + * The VPN server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#vpn_server_id VpnClientCaCertificate#vpn_server_id} + */ + readonly vpnServerId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#timeouts VpnClientCaCertificate#timeouts} + */ + readonly timeouts?: VpnClientCaCertificateTimeouts; +} +export interface VpnClientCaCertificateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#create VpnClientCaCertificate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#delete VpnClientCaCertificate#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#update VpnClientCaCertificate#update} + */ + readonly update?: string; +} + +export function vpnClientCaCertificateTimeoutsToTerraform(struct?: VpnClientCaCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnClientCaCertificateTimeoutsToHclTerraform(struct?: VpnClientCaCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnClientCaCertificateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnClientCaCertificateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnClientCaCertificateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate huaweicloud_vpn_client_ca_certificate} +*/ +export class VpnClientCaCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_client_ca_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnClientCaCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnClientCaCertificate to import + * @param importFromId The id of the existing VpnClientCaCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnClientCaCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_client_ca_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_client_ca_certificate huaweicloud_vpn_client_ca_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnClientCaCertificateConfig + */ + public constructor(scope: Construct, id: string, config: VpnClientCaCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_client_ca_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._content = config.content; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._vpnServerId = config.vpnServerId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // expiration_time - computed: true, optional: false, required: false + public get expirationTime() { + return this.getStringAttribute('expiration_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // issuer - computed: true, optional: false, required: false + public get issuer() { + return this.getStringAttribute('issuer'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // subject - computed: true, optional: false, required: false + public get subject() { + return this.getStringAttribute('subject'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnClientCaCertificateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnClientCaCertificateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + content: cdktf.stringToTerraform(this._content), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + timeouts: vpnClientCaCertificateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + content: { + value: cdktf.stringToHclTerraform(this._content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: vpnClientCaCertificateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnClientCaCertificateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-connection-health-check/README.md b/src/constructs/providers/huaweicloud/vpn-connection-health-check/README.md new file mode 100644 index 00000000..e27baffb --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-connection-health-check/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_connection_health_check` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_connection_health_check`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check). diff --git a/src/constructs/providers/huaweicloud/vpn-connection-health-check/index.ts b/src/constructs/providers/huaweicloud/vpn-connection-health-check/index.ts new file mode 100644 index 00000000..3b379b50 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-connection-health-check/index.ts @@ -0,0 +1,186 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnConnectionHealthCheckConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the ID of the VPN connection to monitor. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check#connection_id VpnConnectionHealthCheck#connection_id} + */ + readonly connectionId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check#id VpnConnectionHealthCheck#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check#region VpnConnectionHealthCheck#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check huaweicloud_vpn_connection_health_check} +*/ +export class VpnConnectionHealthCheck extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_connection_health_check"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnConnectionHealthCheck resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnConnectionHealthCheck to import + * @param importFromId The id of the existing VpnConnectionHealthCheck that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnConnectionHealthCheck to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_connection_health_check", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection_health_check huaweicloud_vpn_connection_health_check} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnConnectionHealthCheckConfig + */ + public constructor(scope: Construct, id: string, config: VpnConnectionHealthCheckConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_connection_health_check', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._connectionId = config.connectionId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // connection_id - computed: false, optional: false, required: true + private _connectionId?: string; + public get connectionId() { + return this.getStringAttribute('connection_id'); + } + public set connectionId(value: string) { + this._connectionId = value; + } + // Temporarily expose input value. Use with caution. + public get connectionIdInput() { + return this._connectionId; + } + + // destination_ip - computed: true, optional: false, required: false + public get destinationIp() { + return this.getStringAttribute('destination_ip'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // source_ip - computed: true, optional: false, required: false + public get sourceIp() { + return this.getStringAttribute('source_ip'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + connection_id: cdktf.stringToTerraform(this._connectionId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + connection_id: { + value: cdktf.stringToHclTerraform(this._connectionId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-connection/README.md b/src/constructs/providers/huaweicloud/vpn-connection/README.md new file mode 100644 index 00000000..4edcd15c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection). diff --git a/src/constructs/providers/huaweicloud/vpn-connection/index.ts b/src/constructs/providers/huaweicloud/vpn-connection/index.ts new file mode 100644 index 00000000..3340b5d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-connection/index.ts @@ -0,0 +1,1918 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * The customer gateway ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#customer_gateway_id VpnConnection#customer_gateway_id} + */ + readonly customerGatewayId: string; + /** + * Whether to enable NQA check. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#enable_nqa VpnConnection#enable_nqa} + */ + readonly enableNqa?: boolean | cdktf.IResolvable; + /** + * The enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#enterprise_project_id VpnConnection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The VPN gateway ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#gateway_id VpnConnection#gateway_id} + */ + readonly gatewayId: string; + /** + * The VPN gateway IP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#gateway_ip VpnConnection#gateway_ip} + */ + readonly gatewayIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#ha_role VpnConnection#ha_role} + */ + readonly haRole?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#id VpnConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the VPN connection. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#name VpnConnection#name} + */ + readonly name: string; + /** + * The customer subnets. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#peer_subnets VpnConnection#peer_subnets} + */ + readonly peerSubnets?: string[]; + /** + * The pre-shared key. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#psk VpnConnection#psk} + */ + readonly psk: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#region VpnConnection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#tags VpnConnection#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The local tunnel address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#tunnel_local_address VpnConnection#tunnel_local_address} + */ + readonly tunnelLocalAddress?: string; + /** + * The peer tunnel address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#tunnel_peer_address VpnConnection#tunnel_peer_address} + */ + readonly tunnelPeerAddress?: string; + /** + * The connection type. The value can be **policy**, **static** or **bgp**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#vpn_type VpnConnection#vpn_type} + */ + readonly vpnType: string; + /** + * ikepolicy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#ikepolicy VpnConnection#ikepolicy} + */ + readonly ikepolicy?: VpnConnectionIkepolicy; + /** + * ipsecpolicy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#ipsecpolicy VpnConnection#ipsecpolicy} + */ + readonly ipsecpolicy?: VpnConnectionIpsecpolicy; + /** + * policy_rules block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#policy_rules VpnConnection#policy_rules} + */ + readonly policyRules?: VpnConnectionPolicyRules[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#timeouts VpnConnection#timeouts} + */ + readonly timeouts?: VpnConnectionTimeouts; +} +export interface VpnConnectionIkepolicyDpd { + /** + * Specifies the DPD idle timeout period. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#interval VpnConnection#interval} + */ + readonly interval?: number; + /** + * Specifies the format of DPD packets. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#msg VpnConnection#msg} + */ + readonly msg?: string; + /** + * Specifies the interval for retransmitting DPD packets. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#timeout VpnConnection#timeout} + */ + readonly timeout?: number; +} + +export function vpnConnectionIkepolicyDpdToTerraform(struct?: VpnConnectionIkepolicyDpdOutputReference | VpnConnectionIkepolicyDpd): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + interval: cdktf.numberToTerraform(struct!.interval), + msg: cdktf.stringToTerraform(struct!.msg), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function vpnConnectionIkepolicyDpdToHclTerraform(struct?: VpnConnectionIkepolicyDpdOutputReference | VpnConnectionIkepolicyDpd): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + msg: { + value: cdktf.stringToHclTerraform(struct!.msg), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnConnectionIkepolicyDpdOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnConnectionIkepolicyDpd | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._msg !== undefined) { + hasAnyValues = true; + internalValueResult.msg = this._msg; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnConnectionIkepolicyDpd | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._interval = undefined; + this._msg = undefined; + this._timeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._interval = value.interval; + this._msg = value.msg; + this._timeout = value.timeout; + } + } + + // interval - computed: true, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // msg - computed: true, optional: true, required: false + private _msg?: string; + public get msg() { + return this.getStringAttribute('msg'); + } + public set msg(value: string) { + this._msg = value; + } + public resetMsg() { + this._msg = undefined; + } + // Temporarily expose input value. Use with caution. + public get msgInput() { + return this._msg; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} +export interface VpnConnectionIkepolicy { + /** + * The authentication algorithm, SHA1 and MD5 are less secure, please use them with caution. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#authentication_algorithm VpnConnection#authentication_algorithm} + */ + readonly authenticationAlgorithm?: string; + /** + * The authentication method during IKE negotiation. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#authentication_method VpnConnection#authentication_method} + */ + readonly authenticationMethod?: string; + /** + * Specifies the DH group used for key exchange in phase 1. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#dh_group VpnConnection#dh_group} + */ + readonly dhGroup?: string; + /** + * The encryption algorithm, 3DES is less secure, please use them with caution. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#encryption_algorithm VpnConnection#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * The IKE negotiation version. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#ike_version VpnConnection#ike_version} + */ + readonly ikeVersion?: string; + /** + * The life cycle of SA in seconds, when the life cycle expires, IKE SA will be automatically updated. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#lifetime_seconds VpnConnection#lifetime_seconds} + */ + readonly lifetimeSeconds?: number; + /** + * The local ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#local_id VpnConnection#local_id} + */ + readonly localId?: string; + /** + * The local ID type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#local_id_type VpnConnection#local_id_type} + */ + readonly localIdType?: string; + /** + * The peer ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#peer_id VpnConnection#peer_id} + */ + readonly peerId?: string; + /** + * The peer ID type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#peer_id_type VpnConnection#peer_id_type} + */ + readonly peerIdType?: string; + /** + * The DH key group used by PFS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#pfs VpnConnection#pfs} + */ + readonly pfs?: string; + /** + * The negotiation mode, only works when the ike_version is v1. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#phase1_negotiation_mode VpnConnection#phase1_negotiation_mode} + */ + readonly phase1NegotiationMode?: string; + /** + * dpd block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#dpd VpnConnection#dpd} + */ + readonly dpd?: VpnConnectionIkepolicyDpd; +} + +export function vpnConnectionIkepolicyToTerraform(struct?: VpnConnectionIkepolicyOutputReference | VpnConnectionIkepolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authentication_algorithm: cdktf.stringToTerraform(struct!.authenticationAlgorithm), + authentication_method: cdktf.stringToTerraform(struct!.authenticationMethod), + dh_group: cdktf.stringToTerraform(struct!.dhGroup), + encryption_algorithm: cdktf.stringToTerraform(struct!.encryptionAlgorithm), + ike_version: cdktf.stringToTerraform(struct!.ikeVersion), + lifetime_seconds: cdktf.numberToTerraform(struct!.lifetimeSeconds), + local_id: cdktf.stringToTerraform(struct!.localId), + local_id_type: cdktf.stringToTerraform(struct!.localIdType), + peer_id: cdktf.stringToTerraform(struct!.peerId), + peer_id_type: cdktf.stringToTerraform(struct!.peerIdType), + pfs: cdktf.stringToTerraform(struct!.pfs), + phase1_negotiation_mode: cdktf.stringToTerraform(struct!.phase1NegotiationMode), + dpd: vpnConnectionIkepolicyDpdToTerraform(struct!.dpd), + } +} + + +export function vpnConnectionIkepolicyToHclTerraform(struct?: VpnConnectionIkepolicyOutputReference | VpnConnectionIkepolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authentication_algorithm: { + value: cdktf.stringToHclTerraform(struct!.authenticationAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authentication_method: { + value: cdktf.stringToHclTerraform(struct!.authenticationMethod), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dh_group: { + value: cdktf.stringToHclTerraform(struct!.dhGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(struct!.encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ike_version: { + value: cdktf.stringToHclTerraform(struct!.ikeVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifetime_seconds: { + value: cdktf.numberToHclTerraform(struct!.lifetimeSeconds), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + local_id: { + value: cdktf.stringToHclTerraform(struct!.localId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_id_type: { + value: cdktf.stringToHclTerraform(struct!.localIdType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_id: { + value: cdktf.stringToHclTerraform(struct!.peerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_id_type: { + value: cdktf.stringToHclTerraform(struct!.peerIdType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pfs: { + value: cdktf.stringToHclTerraform(struct!.pfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phase1_negotiation_mode: { + value: cdktf.stringToHclTerraform(struct!.phase1NegotiationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dpd: { + value: vpnConnectionIkepolicyDpdToHclTerraform(struct!.dpd), + isBlock: true, + type: "list", + storageClassType: "VpnConnectionIkepolicyDpdList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnConnectionIkepolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnConnectionIkepolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authenticationAlgorithm !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationAlgorithm = this._authenticationAlgorithm; + } + if (this._authenticationMethod !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationMethod = this._authenticationMethod; + } + if (this._dhGroup !== undefined) { + hasAnyValues = true; + internalValueResult.dhGroup = this._dhGroup; + } + if (this._encryptionAlgorithm !== undefined) { + hasAnyValues = true; + internalValueResult.encryptionAlgorithm = this._encryptionAlgorithm; + } + if (this._ikeVersion !== undefined) { + hasAnyValues = true; + internalValueResult.ikeVersion = this._ikeVersion; + } + if (this._lifetimeSeconds !== undefined) { + hasAnyValues = true; + internalValueResult.lifetimeSeconds = this._lifetimeSeconds; + } + if (this._localId !== undefined) { + hasAnyValues = true; + internalValueResult.localId = this._localId; + } + if (this._localIdType !== undefined) { + hasAnyValues = true; + internalValueResult.localIdType = this._localIdType; + } + if (this._peerId !== undefined) { + hasAnyValues = true; + internalValueResult.peerId = this._peerId; + } + if (this._peerIdType !== undefined) { + hasAnyValues = true; + internalValueResult.peerIdType = this._peerIdType; + } + if (this._pfs !== undefined) { + hasAnyValues = true; + internalValueResult.pfs = this._pfs; + } + if (this._phase1NegotiationMode !== undefined) { + hasAnyValues = true; + internalValueResult.phase1NegotiationMode = this._phase1NegotiationMode; + } + if (this._dpd?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.dpd = this._dpd?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnConnectionIkepolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authenticationAlgorithm = undefined; + this._authenticationMethod = undefined; + this._dhGroup = undefined; + this._encryptionAlgorithm = undefined; + this._ikeVersion = undefined; + this._lifetimeSeconds = undefined; + this._localId = undefined; + this._localIdType = undefined; + this._peerId = undefined; + this._peerIdType = undefined; + this._pfs = undefined; + this._phase1NegotiationMode = undefined; + this._dpd.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authenticationAlgorithm = value.authenticationAlgorithm; + this._authenticationMethod = value.authenticationMethod; + this._dhGroup = value.dhGroup; + this._encryptionAlgorithm = value.encryptionAlgorithm; + this._ikeVersion = value.ikeVersion; + this._lifetimeSeconds = value.lifetimeSeconds; + this._localId = value.localId; + this._localIdType = value.localIdType; + this._peerId = value.peerId; + this._peerIdType = value.peerIdType; + this._pfs = value.pfs; + this._phase1NegotiationMode = value.phase1NegotiationMode; + this._dpd.internalValue = value.dpd; + } + } + + // authentication_algorithm - computed: true, optional: true, required: false + private _authenticationAlgorithm?: string; + public get authenticationAlgorithm() { + return this.getStringAttribute('authentication_algorithm'); + } + public set authenticationAlgorithm(value: string) { + this._authenticationAlgorithm = value; + } + public resetAuthenticationAlgorithm() { + this._authenticationAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationAlgorithmInput() { + return this._authenticationAlgorithm; + } + + // authentication_method - computed: true, optional: true, required: false + private _authenticationMethod?: string; + public get authenticationMethod() { + return this.getStringAttribute('authentication_method'); + } + public set authenticationMethod(value: string) { + this._authenticationMethod = value; + } + public resetAuthenticationMethod() { + this._authenticationMethod = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationMethodInput() { + return this._authenticationMethod; + } + + // dh_group - computed: true, optional: true, required: false + private _dhGroup?: string; + public get dhGroup() { + return this.getStringAttribute('dh_group'); + } + public set dhGroup(value: string) { + this._dhGroup = value; + } + public resetDhGroup() { + this._dhGroup = undefined; + } + // Temporarily expose input value. Use with caution. + public get dhGroupInput() { + return this._dhGroup; + } + + // encryption_algorithm - computed: true, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // ike_version - computed: true, optional: true, required: false + private _ikeVersion?: string; + public get ikeVersion() { + return this.getStringAttribute('ike_version'); + } + public set ikeVersion(value: string) { + this._ikeVersion = value; + } + public resetIkeVersion() { + this._ikeVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ikeVersionInput() { + return this._ikeVersion; + } + + // lifetime_seconds - computed: true, optional: true, required: false + private _lifetimeSeconds?: number; + public get lifetimeSeconds() { + return this.getNumberAttribute('lifetime_seconds'); + } + public set lifetimeSeconds(value: number) { + this._lifetimeSeconds = value; + } + public resetLifetimeSeconds() { + this._lifetimeSeconds = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifetimeSecondsInput() { + return this._lifetimeSeconds; + } + + // local_id - computed: true, optional: true, required: false + private _localId?: string; + public get localId() { + return this.getStringAttribute('local_id'); + } + public set localId(value: string) { + this._localId = value; + } + public resetLocalId() { + this._localId = undefined; + } + // Temporarily expose input value. Use with caution. + public get localIdInput() { + return this._localId; + } + + // local_id_type - computed: true, optional: true, required: false + private _localIdType?: string; + public get localIdType() { + return this.getStringAttribute('local_id_type'); + } + public set localIdType(value: string) { + this._localIdType = value; + } + public resetLocalIdType() { + this._localIdType = undefined; + } + // Temporarily expose input value. Use with caution. + public get localIdTypeInput() { + return this._localIdType; + } + + // peer_id - computed: true, optional: true, required: false + private _peerId?: string; + public get peerId() { + return this.getStringAttribute('peer_id'); + } + public set peerId(value: string) { + this._peerId = value; + } + public resetPeerId() { + this._peerId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerIdInput() { + return this._peerId; + } + + // peer_id_type - computed: true, optional: true, required: false + private _peerIdType?: string; + public get peerIdType() { + return this.getStringAttribute('peer_id_type'); + } + public set peerIdType(value: string) { + this._peerIdType = value; + } + public resetPeerIdType() { + this._peerIdType = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerIdTypeInput() { + return this._peerIdType; + } + + // pfs - computed: true, optional: true, required: false + private _pfs?: string; + public get pfs() { + return this.getStringAttribute('pfs'); + } + public set pfs(value: string) { + this._pfs = value; + } + public resetPfs() { + this._pfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get pfsInput() { + return this._pfs; + } + + // phase1_negotiation_mode - computed: true, optional: true, required: false + private _phase1NegotiationMode?: string; + public get phase1NegotiationMode() { + return this.getStringAttribute('phase1_negotiation_mode'); + } + public set phase1NegotiationMode(value: string) { + this._phase1NegotiationMode = value; + } + public resetPhase1NegotiationMode() { + this._phase1NegotiationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get phase1NegotiationModeInput() { + return this._phase1NegotiationMode; + } + + // dpd - computed: false, optional: true, required: false + private _dpd = new VpnConnectionIkepolicyDpdOutputReference(this, "dpd"); + public get dpd() { + return this._dpd; + } + public putDpd(value: VpnConnectionIkepolicyDpd) { + this._dpd.internalValue = value; + } + public resetDpd() { + this._dpd.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dpdInput() { + return this._dpd.internalValue; + } +} +export interface VpnConnectionIpsecpolicy { + /** + * The authentication algorithm, SHA1 and MD5 are less secure, please use them with caution. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#authentication_algorithm VpnConnection#authentication_algorithm} + */ + readonly authenticationAlgorithm?: string; + /** + * The encapsulation mode, only **tunnel** supported for now. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#encapsulation_mode VpnConnection#encapsulation_mode} + */ + readonly encapsulationMode?: string; + /** + * The encryption algorithm, 3DES is less secure, please use them with caution. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#encryption_algorithm VpnConnection#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * The lifecycle time of Ipsec tunnel in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#lifetime_seconds VpnConnection#lifetime_seconds} + */ + readonly lifetimeSeconds?: number; + /** + * The DH key group used by PFS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#pfs VpnConnection#pfs} + */ + readonly pfs?: string; + /** + * The transform protocol. Only **esp** supported for now. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#transform_protocol VpnConnection#transform_protocol} + */ + readonly transformProtocol?: string; +} + +export function vpnConnectionIpsecpolicyToTerraform(struct?: VpnConnectionIpsecpolicyOutputReference | VpnConnectionIpsecpolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + authentication_algorithm: cdktf.stringToTerraform(struct!.authenticationAlgorithm), + encapsulation_mode: cdktf.stringToTerraform(struct!.encapsulationMode), + encryption_algorithm: cdktf.stringToTerraform(struct!.encryptionAlgorithm), + lifetime_seconds: cdktf.numberToTerraform(struct!.lifetimeSeconds), + pfs: cdktf.stringToTerraform(struct!.pfs), + transform_protocol: cdktf.stringToTerraform(struct!.transformProtocol), + } +} + + +export function vpnConnectionIpsecpolicyToHclTerraform(struct?: VpnConnectionIpsecpolicyOutputReference | VpnConnectionIpsecpolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + authentication_algorithm: { + value: cdktf.stringToHclTerraform(struct!.authenticationAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encapsulation_mode: { + value: cdktf.stringToHclTerraform(struct!.encapsulationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(struct!.encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + lifetime_seconds: { + value: cdktf.numberToHclTerraform(struct!.lifetimeSeconds), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + pfs: { + value: cdktf.stringToHclTerraform(struct!.pfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transform_protocol: { + value: cdktf.stringToHclTerraform(struct!.transformProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnConnectionIpsecpolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnConnectionIpsecpolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._authenticationAlgorithm !== undefined) { + hasAnyValues = true; + internalValueResult.authenticationAlgorithm = this._authenticationAlgorithm; + } + if (this._encapsulationMode !== undefined) { + hasAnyValues = true; + internalValueResult.encapsulationMode = this._encapsulationMode; + } + if (this._encryptionAlgorithm !== undefined) { + hasAnyValues = true; + internalValueResult.encryptionAlgorithm = this._encryptionAlgorithm; + } + if (this._lifetimeSeconds !== undefined) { + hasAnyValues = true; + internalValueResult.lifetimeSeconds = this._lifetimeSeconds; + } + if (this._pfs !== undefined) { + hasAnyValues = true; + internalValueResult.pfs = this._pfs; + } + if (this._transformProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.transformProtocol = this._transformProtocol; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnConnectionIpsecpolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._authenticationAlgorithm = undefined; + this._encapsulationMode = undefined; + this._encryptionAlgorithm = undefined; + this._lifetimeSeconds = undefined; + this._pfs = undefined; + this._transformProtocol = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._authenticationAlgorithm = value.authenticationAlgorithm; + this._encapsulationMode = value.encapsulationMode; + this._encryptionAlgorithm = value.encryptionAlgorithm; + this._lifetimeSeconds = value.lifetimeSeconds; + this._pfs = value.pfs; + this._transformProtocol = value.transformProtocol; + } + } + + // authentication_algorithm - computed: true, optional: true, required: false + private _authenticationAlgorithm?: string; + public get authenticationAlgorithm() { + return this.getStringAttribute('authentication_algorithm'); + } + public set authenticationAlgorithm(value: string) { + this._authenticationAlgorithm = value; + } + public resetAuthenticationAlgorithm() { + this._authenticationAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get authenticationAlgorithmInput() { + return this._authenticationAlgorithm; + } + + // encapsulation_mode - computed: true, optional: true, required: false + private _encapsulationMode?: string; + public get encapsulationMode() { + return this.getStringAttribute('encapsulation_mode'); + } + public set encapsulationMode(value: string) { + this._encapsulationMode = value; + } + public resetEncapsulationMode() { + this._encapsulationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get encapsulationModeInput() { + return this._encapsulationMode; + } + + // encryption_algorithm - computed: true, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // lifetime_seconds - computed: true, optional: true, required: false + private _lifetimeSeconds?: number; + public get lifetimeSeconds() { + return this.getNumberAttribute('lifetime_seconds'); + } + public set lifetimeSeconds(value: number) { + this._lifetimeSeconds = value; + } + public resetLifetimeSeconds() { + this._lifetimeSeconds = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifetimeSecondsInput() { + return this._lifetimeSeconds; + } + + // pfs - computed: true, optional: true, required: false + private _pfs?: string; + public get pfs() { + return this.getStringAttribute('pfs'); + } + public set pfs(value: string) { + this._pfs = value; + } + public resetPfs() { + this._pfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get pfsInput() { + return this._pfs; + } + + // transform_protocol - computed: true, optional: true, required: false + private _transformProtocol?: string; + public get transformProtocol() { + return this.getStringAttribute('transform_protocol'); + } + public set transformProtocol(value: string) { + this._transformProtocol = value; + } + public resetTransformProtocol() { + this._transformProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get transformProtocolInput() { + return this._transformProtocol; + } +} +export interface VpnConnectionPolicyRules { + /** + * The list of destination CIDRs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#destination VpnConnection#destination} + */ + readonly destination?: string[]; + /** + * The rule index. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#rule_index VpnConnection#rule_index} + */ + readonly ruleIndex?: number; + /** + * The source CIDR. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#source VpnConnection#source} + */ + readonly source?: string; +} + +export function vpnConnectionPolicyRulesToTerraform(struct?: VpnConnectionPolicyRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + destination: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.destination), + rule_index: cdktf.numberToTerraform(struct!.ruleIndex), + source: cdktf.stringToTerraform(struct!.source), + } +} + + +export function vpnConnectionPolicyRulesToHclTerraform(struct?: VpnConnectionPolicyRules | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + destination: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.destination), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + rule_index: { + value: cdktf.numberToHclTerraform(struct!.ruleIndex), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + source: { + value: cdktf.stringToHclTerraform(struct!.source), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnConnectionPolicyRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnConnectionPolicyRules | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._destination !== undefined) { + hasAnyValues = true; + internalValueResult.destination = this._destination; + } + if (this._ruleIndex !== undefined) { + hasAnyValues = true; + internalValueResult.ruleIndex = this._ruleIndex; + } + if (this._source !== undefined) { + hasAnyValues = true; + internalValueResult.source = this._source; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnConnectionPolicyRules | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._destination = undefined; + this._ruleIndex = undefined; + this._source = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._destination = value.destination; + this._ruleIndex = value.ruleIndex; + this._source = value.source; + } + } + + // destination - computed: true, optional: true, required: false + private _destination?: string[]; + public get destination() { + return this.getListAttribute('destination'); + } + public set destination(value: string[]) { + this._destination = value; + } + public resetDestination() { + this._destination = undefined; + } + // Temporarily expose input value. Use with caution. + public get destinationInput() { + return this._destination; + } + + // rule_index - computed: true, optional: true, required: false + private _ruleIndex?: number; + public get ruleIndex() { + return this.getNumberAttribute('rule_index'); + } + public set ruleIndex(value: number) { + this._ruleIndex = value; + } + public resetRuleIndex() { + this._ruleIndex = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleIndexInput() { + return this._ruleIndex; + } + + // source - computed: true, optional: true, required: false + private _source?: string; + public get source() { + return this.getStringAttribute('source'); + } + public set source(value: string) { + this._source = value; + } + public resetSource() { + this._source = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceInput() { + return this._source; + } +} + +export class VpnConnectionPolicyRulesList extends cdktf.ComplexList { + public internalValue? : VpnConnectionPolicyRules[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnConnectionPolicyRulesOutputReference { + return new VpnConnectionPolicyRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnConnectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#create VpnConnection#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#delete VpnConnection#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#update VpnConnection#update} + */ + readonly update?: string; +} + +export function vpnConnectionTimeoutsToTerraform(struct?: VpnConnectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnConnectionTimeoutsToHclTerraform(struct?: VpnConnectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnConnectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnConnectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnConnectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection huaweicloud_vpn_connection} +*/ +export class VpnConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnConnection to import + * @param importFromId The id of the existing VpnConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_connection huaweicloud_vpn_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnConnectionConfig + */ + public constructor(scope: Construct, id: string, config: VpnConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._customerGatewayId = config.customerGatewayId; + this._enableNqa = config.enableNqa; + this._enterpriseProjectId = config.enterpriseProjectId; + this._gatewayId = config.gatewayId; + this._gatewayIp = config.gatewayIp; + this._haRole = config.haRole; + this._id = config.id; + this._name = config.name; + this._peerSubnets = config.peerSubnets; + this._psk = config.psk; + this._region = config.region; + this._tags = config.tags; + this._tunnelLocalAddress = config.tunnelLocalAddress; + this._tunnelPeerAddress = config.tunnelPeerAddress; + this._vpnType = config.vpnType; + this._ikepolicy.internalValue = config.ikepolicy; + this._ipsecpolicy.internalValue = config.ipsecpolicy; + this._policyRules.internalValue = config.policyRules; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // customer_gateway_id - computed: false, optional: false, required: true + private _customerGatewayId?: string; + public get customerGatewayId() { + return this.getStringAttribute('customer_gateway_id'); + } + public set customerGatewayId(value: string) { + this._customerGatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get customerGatewayIdInput() { + return this._customerGatewayId; + } + + // enable_nqa - computed: true, optional: true, required: false + private _enableNqa?: boolean | cdktf.IResolvable; + public get enableNqa() { + return this.getBooleanAttribute('enable_nqa'); + } + public set enableNqa(value: boolean | cdktf.IResolvable) { + this._enableNqa = value; + } + public resetEnableNqa() { + this._enableNqa = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableNqaInput() { + return this._enableNqa; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // gateway_id - computed: false, optional: false, required: true + private _gatewayId?: string; + public get gatewayId() { + return this.getStringAttribute('gateway_id'); + } + public set gatewayId(value: string) { + this._gatewayId = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIdInput() { + return this._gatewayId; + } + + // gateway_ip - computed: false, optional: false, required: true + private _gatewayIp?: string; + public get gatewayIp() { + return this.getStringAttribute('gateway_ip'); + } + public set gatewayIp(value: string) { + this._gatewayIp = value; + } + // Temporarily expose input value. Use with caution. + public get gatewayIpInput() { + return this._gatewayIp; + } + + // ha_role - computed: true, optional: true, required: false + private _haRole?: string; + public get haRole() { + return this.getStringAttribute('ha_role'); + } + public set haRole(value: string) { + this._haRole = value; + } + public resetHaRole() { + this._haRole = undefined; + } + // Temporarily expose input value. Use with caution. + public get haRoleInput() { + return this._haRole; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_subnets - computed: true, optional: true, required: false + private _peerSubnets?: string[]; + public get peerSubnets() { + return this.getListAttribute('peer_subnets'); + } + public set peerSubnets(value: string[]) { + this._peerSubnets = value; + } + public resetPeerSubnets() { + this._peerSubnets = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerSubnetsInput() { + return this._peerSubnets; + } + + // psk - computed: false, optional: false, required: true + private _psk?: string; + public get psk() { + return this.getStringAttribute('psk'); + } + public set psk(value: string) { + this._psk = value; + } + // Temporarily expose input value. Use with caution. + public get pskInput() { + return this._psk; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tunnel_local_address - computed: true, optional: true, required: false + private _tunnelLocalAddress?: string; + public get tunnelLocalAddress() { + return this.getStringAttribute('tunnel_local_address'); + } + public set tunnelLocalAddress(value: string) { + this._tunnelLocalAddress = value; + } + public resetTunnelLocalAddress() { + this._tunnelLocalAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get tunnelLocalAddressInput() { + return this._tunnelLocalAddress; + } + + // tunnel_peer_address - computed: true, optional: true, required: false + private _tunnelPeerAddress?: string; + public get tunnelPeerAddress() { + return this.getStringAttribute('tunnel_peer_address'); + } + public set tunnelPeerAddress(value: string) { + this._tunnelPeerAddress = value; + } + public resetTunnelPeerAddress() { + this._tunnelPeerAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get tunnelPeerAddressInput() { + return this._tunnelPeerAddress; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // vpn_type - computed: false, optional: false, required: true + private _vpnType?: string; + public get vpnType() { + return this.getStringAttribute('vpn_type'); + } + public set vpnType(value: string) { + this._vpnType = value; + } + // Temporarily expose input value. Use with caution. + public get vpnTypeInput() { + return this._vpnType; + } + + // ikepolicy - computed: false, optional: true, required: false + private _ikepolicy = new VpnConnectionIkepolicyOutputReference(this, "ikepolicy"); + public get ikepolicy() { + return this._ikepolicy; + } + public putIkepolicy(value: VpnConnectionIkepolicy) { + this._ikepolicy.internalValue = value; + } + public resetIkepolicy() { + this._ikepolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ikepolicyInput() { + return this._ikepolicy.internalValue; + } + + // ipsecpolicy - computed: false, optional: true, required: false + private _ipsecpolicy = new VpnConnectionIpsecpolicyOutputReference(this, "ipsecpolicy"); + public get ipsecpolicy() { + return this._ipsecpolicy; + } + public putIpsecpolicy(value: VpnConnectionIpsecpolicy) { + this._ipsecpolicy.internalValue = value; + } + public resetIpsecpolicy() { + this._ipsecpolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipsecpolicyInput() { + return this._ipsecpolicy.internalValue; + } + + // policy_rules - computed: false, optional: true, required: false + private _policyRules = new VpnConnectionPolicyRulesList(this, "policy_rules", false); + public get policyRules() { + return this._policyRules; + } + public putPolicyRules(value: VpnConnectionPolicyRules[] | cdktf.IResolvable) { + this._policyRules.internalValue = value; + } + public resetPolicyRules() { + this._policyRules.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyRulesInput() { + return this._policyRules.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnConnectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnConnectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + customer_gateway_id: cdktf.stringToTerraform(this._customerGatewayId), + enable_nqa: cdktf.booleanToTerraform(this._enableNqa), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + gateway_id: cdktf.stringToTerraform(this._gatewayId), + gateway_ip: cdktf.stringToTerraform(this._gatewayIp), + ha_role: cdktf.stringToTerraform(this._haRole), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + peer_subnets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._peerSubnets), + psk: cdktf.stringToTerraform(this._psk), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tunnel_local_address: cdktf.stringToTerraform(this._tunnelLocalAddress), + tunnel_peer_address: cdktf.stringToTerraform(this._tunnelPeerAddress), + vpn_type: cdktf.stringToTerraform(this._vpnType), + ikepolicy: vpnConnectionIkepolicyToTerraform(this._ikepolicy.internalValue), + ipsecpolicy: vpnConnectionIpsecpolicyToTerraform(this._ipsecpolicy.internalValue), + policy_rules: cdktf.listMapper(vpnConnectionPolicyRulesToTerraform, true)(this._policyRules.internalValue), + timeouts: vpnConnectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + customer_gateway_id: { + value: cdktf.stringToHclTerraform(this._customerGatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_nqa: { + value: cdktf.booleanToHclTerraform(this._enableNqa), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_id: { + value: cdktf.stringToHclTerraform(this._gatewayId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + gateway_ip: { + value: cdktf.stringToHclTerraform(this._gatewayIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ha_role: { + value: cdktf.stringToHclTerraform(this._haRole), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_subnets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._peerSubnets), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + psk: { + value: cdktf.stringToHclTerraform(this._psk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tunnel_local_address: { + value: cdktf.stringToHclTerraform(this._tunnelLocalAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tunnel_peer_address: { + value: cdktf.stringToHclTerraform(this._tunnelPeerAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_type: { + value: cdktf.stringToHclTerraform(this._vpnType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ikepolicy: { + value: vpnConnectionIkepolicyToHclTerraform(this._ikepolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnConnectionIkepolicyList", + }, + ipsecpolicy: { + value: vpnConnectionIpsecpolicyToHclTerraform(this._ipsecpolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnConnectionIpsecpolicyList", + }, + policy_rules: { + value: cdktf.listMapperHcl(vpnConnectionPolicyRulesToHclTerraform, true)(this._policyRules.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnConnectionPolicyRulesList", + }, + timeouts: { + value: vpnConnectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnConnectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-customer-gateway/README.md b/src/constructs/providers/huaweicloud/vpn-customer-gateway/README.md new file mode 100644 index 00000000..9ee475b5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-customer-gateway/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_customer_gateway` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_customer_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway). diff --git a/src/constructs/providers/huaweicloud/vpn-customer-gateway/index.ts b/src/constructs/providers/huaweicloud/vpn-customer-gateway/index.ts new file mode 100644 index 00000000..21871c56 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-customer-gateway/index.ts @@ -0,0 +1,422 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnCustomerGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * The BGP ASN number of the customer gateway, the default value is 65000. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#asn VpnCustomerGateway#asn} + */ + readonly asn?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#certificate_content VpnCustomerGateway#certificate_content} + */ + readonly certificateContent?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#id VpnCustomerGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The identifier type of a customer gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#id_type VpnCustomerGateway#id_type} + */ + readonly idType?: string; + /** + * The identifier of a customer gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#id_value VpnCustomerGateway#id_value} + */ + readonly idValue?: string; + /** + * The IP address of the customer gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#ip VpnCustomerGateway#ip} + */ + readonly ip?: string; + /** + * The customer gateway name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#name VpnCustomerGateway#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#region VpnCustomerGateway#region} + */ + readonly region?: string; + /** + * The route mode of the customer gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#route_mode VpnCustomerGateway#route_mode} + */ + readonly routeMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#tags VpnCustomerGateway#tags} + */ + readonly tags?: { [key: string]: string }; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway huaweicloud_vpn_customer_gateway} +*/ +export class VpnCustomerGateway extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_customer_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnCustomerGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnCustomerGateway to import + * @param importFromId The id of the existing VpnCustomerGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnCustomerGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_customer_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_customer_gateway huaweicloud_vpn_customer_gateway} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnCustomerGatewayConfig + */ + public constructor(scope: Construct, id: string, config: VpnCustomerGatewayConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_customer_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._asn = config.asn; + this._certificateContent = config.certificateContent; + this._id = config.id; + this._idType = config.idType; + this._idValue = config.idValue; + this._ip = config.ip; + this._name = config.name; + this._region = config.region; + this._routeMode = config.routeMode; + this._tags = config.tags; + } + + // ========== + // ATTRIBUTES + // ========== + + // asn - computed: false, optional: true, required: false + private _asn?: number; + public get asn() { + return this.getNumberAttribute('asn'); + } + public set asn(value: number) { + this._asn = value; + } + public resetAsn() { + this._asn = undefined; + } + // Temporarily expose input value. Use with caution. + public get asnInput() { + return this._asn; + } + + // certificate_content - computed: false, optional: true, required: false + private _certificateContent?: string; + public get certificateContent() { + return this.getStringAttribute('certificate_content'); + } + public set certificateContent(value: string) { + this._certificateContent = value; + } + public resetCertificateContent() { + this._certificateContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateContentInput() { + return this._certificateContent; + } + + // certificate_id - computed: true, optional: false, required: false + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // expire_time - computed: true, optional: false, required: false + public get expireTime() { + return this.getStringAttribute('expire_time'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // id_type - computed: false, optional: true, required: false + private _idType?: string; + public get idType() { + return this.getStringAttribute('id_type'); + } + public set idType(value: string) { + this._idType = value; + } + public resetIdType() { + this._idType = undefined; + } + // Temporarily expose input value. Use with caution. + public get idTypeInput() { + return this._idType; + } + + // id_value - computed: true, optional: true, required: false + private _idValue?: string; + public get idValue() { + return this.getStringAttribute('id_value'); + } + public set idValue(value: string) { + this._idValue = value; + } + public resetIdValue() { + this._idValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get idValueInput() { + return this._idValue; + } + + // ip - computed: false, optional: true, required: false + private _ip?: string; + public get ip() { + return this.getStringAttribute('ip'); + } + public set ip(value: string) { + this._ip = value; + } + public resetIp() { + this._ip = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipInput() { + return this._ip; + } + + // is_updatable - computed: true, optional: false, required: false + public get isUpdatable() { + return this.getBooleanAttribute('is_updatable'); + } + + // issuer - computed: true, optional: false, required: false + public get issuer() { + return this.getStringAttribute('issuer'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // route_mode - computed: false, optional: true, required: false + private _routeMode?: string; + public get routeMode() { + return this.getStringAttribute('route_mode'); + } + public set routeMode(value: string) { + this._routeMode = value; + } + public resetRouteMode() { + this._routeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get routeModeInput() { + return this._routeMode; + } + + // serial_number - computed: true, optional: false, required: false + public get serialNumber() { + return this.getStringAttribute('serial_number'); + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // subject - computed: true, optional: false, required: false + public get subject() { + return this.getStringAttribute('subject'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + asn: cdktf.numberToTerraform(this._asn), + certificate_content: cdktf.stringToTerraform(this._certificateContent), + id: cdktf.stringToTerraform(this._id), + id_type: cdktf.stringToTerraform(this._idType), + id_value: cdktf.stringToTerraform(this._idValue), + ip: cdktf.stringToTerraform(this._ip), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + route_mode: cdktf.stringToTerraform(this._routeMode), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + asn: { + value: cdktf.numberToHclTerraform(this._asn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + certificate_content: { + value: cdktf.stringToHclTerraform(this._certificateContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id_type: { + value: cdktf.stringToHclTerraform(this._idType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id_value: { + value: cdktf.stringToHclTerraform(this._idValue), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip: { + value: cdktf.stringToHclTerraform(this._ip), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + route_mode: { + value: cdktf.stringToHclTerraform(this._routeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-gateway/README.md b/src/constructs/providers/huaweicloud/vpn-gateway/README.md new file mode 100644 index 00000000..fea15920 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-gateway/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_gateway` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_gateway`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway). diff --git a/src/constructs/providers/huaweicloud/vpn-gateway/index.ts b/src/constructs/providers/huaweicloud/vpn-gateway/index.ts new file mode 100644 index 00000000..79eb9133 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-gateway/index.ts @@ -0,0 +1,2298 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnGatewayConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#access_private_ip_1 VpnGateway#access_private_ip_1} + */ + readonly accessPrivateIp1?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#access_private_ip_2 VpnGateway#access_private_ip_2} + */ + readonly accessPrivateIp2?: string; + /** + * The access subnet ID of the VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#access_subnet_id VpnGateway#access_subnet_id} + */ + readonly accessSubnetId?: string; + /** + * The access VPC ID of the VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#access_vpc_id VpnGateway#access_vpc_id} + */ + readonly accessVpcId?: string; + /** + * The ASN number of BGP + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#asn VpnGateway#asn} + */ + readonly asn?: number; + /** + * The attachment type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#attachment_type VpnGateway#attachment_type} + */ + readonly attachmentType?: string; + /** + * The availability zone IDs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#availability_zones VpnGateway#availability_zones} + */ + readonly availabilityZones: string[]; + /** + * The Network ID of the VPC subnet used by the VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#connect_subnet VpnGateway#connect_subnet} + */ + readonly connectSubnet?: string; + /** + * The enterprise project ID + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#enterprise_project_id VpnGateway#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The enterprise router ID to attach with to VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#er_id VpnGateway#er_id} + */ + readonly erId?: string; + /** + * The flavor of the VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#flavor VpnGateway#flavor} + */ + readonly flavor?: string; + /** + * The HA mode of the VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#ha_mode VpnGateway#ha_mode} + */ + readonly haMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#id VpnGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The local subnets. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#local_subnets VpnGateway#local_subnets} + */ + readonly localSubnets?: string[]; + /** + * The name of the VPN gateway. Only letters, digits, underscores(_) and hypens(-) are supported. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#name VpnGateway#name} + */ + readonly name: string; + /** + * The network type of the VPN gateway. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#network_type VpnGateway#network_type} + */ + readonly networkType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#region VpnGateway#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#tags VpnGateway#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The ID of the VPC to which the VPN gateway is connected. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#vpc_id VpnGateway#vpc_id} + */ + readonly vpcId?: string; + /** + * certificate block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#certificate VpnGateway#certificate} + */ + readonly certificate?: VpnGatewayCertificate; + /** + * eip1 block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#eip1 VpnGateway#eip1} + */ + readonly eip1?: VpnGatewayEip1; + /** + * eip2 block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#eip2 VpnGateway#eip2} + */ + readonly eip2?: VpnGatewayEip2; + /** + * master_eip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#master_eip VpnGateway#master_eip} + */ + readonly masterEip?: VpnGatewayMasterEip; + /** + * slave_eip block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#slave_eip VpnGateway#slave_eip} + */ + readonly slaveEip?: VpnGatewaySlaveEip; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#timeouts VpnGateway#timeouts} + */ + readonly timeouts?: VpnGatewayTimeouts; +} +export interface VpnGatewayCertificate { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#certificate_chain VpnGateway#certificate_chain} + */ + readonly certificateChain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#content VpnGateway#content} + */ + readonly content: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#enc_certificate VpnGateway#enc_certificate} + */ + readonly encCertificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#enc_private_key VpnGateway#enc_private_key} + */ + readonly encPrivateKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#name VpnGateway#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#private_key VpnGateway#private_key} + */ + readonly privateKey: string; +} + +export function vpnGatewayCertificateToTerraform(struct?: VpnGatewayCertificateOutputReference | VpnGatewayCertificate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + certificate_chain: cdktf.stringToTerraform(struct!.certificateChain), + content: cdktf.stringToTerraform(struct!.content), + enc_certificate: cdktf.stringToTerraform(struct!.encCertificate), + enc_private_key: cdktf.stringToTerraform(struct!.encPrivateKey), + name: cdktf.stringToTerraform(struct!.name), + private_key: cdktf.stringToTerraform(struct!.privateKey), + } +} + + +export function vpnGatewayCertificateToHclTerraform(struct?: VpnGatewayCertificateOutputReference | VpnGatewayCertificate): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + certificate_chain: { + value: cdktf.stringToHclTerraform(struct!.certificateChain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enc_certificate: { + value: cdktf.stringToHclTerraform(struct!.encCertificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enc_private_key: { + value: cdktf.stringToHclTerraform(struct!.encPrivateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(struct!.privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnGatewayCertificateOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnGatewayCertificate | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._certificateChain !== undefined) { + hasAnyValues = true; + internalValueResult.certificateChain = this._certificateChain; + } + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._encCertificate !== undefined) { + hasAnyValues = true; + internalValueResult.encCertificate = this._encCertificate; + } + if (this._encPrivateKey !== undefined) { + hasAnyValues = true; + internalValueResult.encPrivateKey = this._encPrivateKey; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._privateKey !== undefined) { + hasAnyValues = true; + internalValueResult.privateKey = this._privateKey; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnGatewayCertificate | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._certificateChain = undefined; + this._content = undefined; + this._encCertificate = undefined; + this._encPrivateKey = undefined; + this._name = undefined; + this._privateKey = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._certificateChain = value.certificateChain; + this._content = value.content; + this._encCertificate = value.encCertificate; + this._encPrivateKey = value.encPrivateKey; + this._name = value.name; + this._privateKey = value.privateKey; + } + } + + // certificate_chain - computed: false, optional: false, required: true + private _certificateChain?: string; + public get certificateChain() { + return this.getStringAttribute('certificate_chain'); + } + public set certificateChain(value: string) { + this._certificateChain = value; + } + // Temporarily expose input value. Use with caution. + public get certificateChainInput() { + return this._certificateChain; + } + + // certificate_chain_expire_time - computed: true, optional: false, required: false + public get certificateChainExpireTime() { + return this.getStringAttribute('certificate_chain_expire_time'); + } + + // certificate_chain_serial_number - computed: true, optional: false, required: false + public get certificateChainSerialNumber() { + return this.getStringAttribute('certificate_chain_serial_number'); + } + + // certificate_chain_subject - computed: true, optional: false, required: false + public get certificateChainSubject() { + return this.getStringAttribute('certificate_chain_subject'); + } + + // certificate_expire_time - computed: true, optional: false, required: false + public get certificateExpireTime() { + return this.getStringAttribute('certificate_expire_time'); + } + + // certificate_id - computed: true, optional: false, required: false + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + + // certificate_serial_number - computed: true, optional: false, required: false + public get certificateSerialNumber() { + return this.getStringAttribute('certificate_serial_number'); + } + + // certificate_subject - computed: true, optional: false, required: false + public get certificateSubject() { + return this.getStringAttribute('certificate_subject'); + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enc_certificate - computed: false, optional: false, required: true + private _encCertificate?: string; + public get encCertificate() { + return this.getStringAttribute('enc_certificate'); + } + public set encCertificate(value: string) { + this._encCertificate = value; + } + // Temporarily expose input value. Use with caution. + public get encCertificateInput() { + return this._encCertificate; + } + + // enc_certificate_expire_time - computed: true, optional: false, required: false + public get encCertificateExpireTime() { + return this.getStringAttribute('enc_certificate_expire_time'); + } + + // enc_certificate_serial_number - computed: true, optional: false, required: false + public get encCertificateSerialNumber() { + return this.getStringAttribute('enc_certificate_serial_number'); + } + + // enc_certificate_subject - computed: true, optional: false, required: false + public get encCertificateSubject() { + return this.getStringAttribute('enc_certificate_subject'); + } + + // enc_private_key - computed: false, optional: false, required: true + private _encPrivateKey?: string; + public get encPrivateKey() { + return this.getStringAttribute('enc_private_key'); + } + public set encPrivateKey(value: string) { + this._encPrivateKey = value; + } + // Temporarily expose input value. Use with caution. + public get encPrivateKeyInput() { + return this._encPrivateKey; + } + + // issuer - computed: true, optional: false, required: false + public get issuer() { + return this.getStringAttribute('issuer'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: false, required: true + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // signature_algorithm - computed: true, optional: false, required: false + public get signatureAlgorithm() { + return this.getStringAttribute('signature_algorithm'); + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } +} +export interface VpnGatewayEip1 { + /** + * The bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_name VpnGateway#bandwidth_name} + */ + readonly bandwidthName?: string; + /** + * Bandwidth size in Mbit/s. When the flavor is **V300**, the value cannot be greater than **300**. + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_size VpnGateway#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * The charge mode of the bandwidth. The value can be **bandwidth** and **traffic**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#charge_mode VpnGateway#charge_mode} + */ + readonly chargeMode?: string; + /** + * The public IP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#id VpnGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The EIP type. The value can be **5_bgp** and **5_sbgp**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#type VpnGateway#type} + */ + readonly type?: string; +} + +export function vpnGatewayEip1ToTerraform(struct?: VpnGatewayEip1OutputReference | VpnGatewayEip1): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth_name: cdktf.stringToTerraform(struct!.bandwidthName), + bandwidth_size: cdktf.numberToTerraform(struct!.bandwidthSize), + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpnGatewayEip1ToHclTerraform(struct?: VpnGatewayEip1OutputReference | VpnGatewayEip1): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth_name: { + value: cdktf.stringToHclTerraform(struct!.bandwidthName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(struct!.bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnGatewayEip1OutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnGatewayEip1 | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidthName !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthName = this._bandwidthName; + } + if (this._bandwidthSize !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthSize = this._bandwidthSize; + } + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnGatewayEip1 | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidthName = undefined; + this._bandwidthSize = undefined; + this._chargeMode = undefined; + this._id = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidthName = value.bandwidthName; + this._bandwidthSize = value.bandwidthSize; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._type = value.type; + } + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: true, required: false + private _bandwidthName?: string; + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + public set bandwidthName(value: string) { + this._bandwidthName = value; + } + public resetBandwidthName() { + this._bandwidthName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthNameInput() { + return this._bandwidthName; + } + + // bandwidth_size - computed: true, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface VpnGatewayEip2 { + /** + * The bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_name VpnGateway#bandwidth_name} + */ + readonly bandwidthName?: string; + /** + * Bandwidth size in Mbit/s. When the flavor is **V300**, the value cannot be greater than **300**. + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_size VpnGateway#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * The charge mode of the bandwidth. The value can be **bandwidth** and **traffic**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#charge_mode VpnGateway#charge_mode} + */ + readonly chargeMode?: string; + /** + * The public IP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#id VpnGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The EIP type. The value can be **5_bgp** and **5_sbgp**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#type VpnGateway#type} + */ + readonly type?: string; +} + +export function vpnGatewayEip2ToTerraform(struct?: VpnGatewayEip2OutputReference | VpnGatewayEip2): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth_name: cdktf.stringToTerraform(struct!.bandwidthName), + bandwidth_size: cdktf.numberToTerraform(struct!.bandwidthSize), + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpnGatewayEip2ToHclTerraform(struct?: VpnGatewayEip2OutputReference | VpnGatewayEip2): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth_name: { + value: cdktf.stringToHclTerraform(struct!.bandwidthName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(struct!.bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnGatewayEip2OutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnGatewayEip2 | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidthName !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthName = this._bandwidthName; + } + if (this._bandwidthSize !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthSize = this._bandwidthSize; + } + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnGatewayEip2 | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidthName = undefined; + this._bandwidthSize = undefined; + this._chargeMode = undefined; + this._id = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidthName = value.bandwidthName; + this._bandwidthSize = value.bandwidthSize; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._type = value.type; + } + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: true, required: false + private _bandwidthName?: string; + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + public set bandwidthName(value: string) { + this._bandwidthName = value; + } + public resetBandwidthName() { + this._bandwidthName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthNameInput() { + return this._bandwidthName; + } + + // bandwidth_size - computed: true, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface VpnGatewayMasterEip { + /** + * The bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_name VpnGateway#bandwidth_name} + */ + readonly bandwidthName?: string; + /** + * Bandwidth size in Mbit/s. When the flavor is **V300**, the value cannot be greater than **300**. + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_size VpnGateway#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * The charge mode of the bandwidth. The value can be **bandwidth** and **traffic**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#charge_mode VpnGateway#charge_mode} + */ + readonly chargeMode?: string; + /** + * The public IP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#id VpnGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The EIP type. The value can be **5_bgp** and **5_sbgp**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#type VpnGateway#type} + */ + readonly type?: string; +} + +export function vpnGatewayMasterEipToTerraform(struct?: VpnGatewayMasterEipOutputReference | VpnGatewayMasterEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth_name: cdktf.stringToTerraform(struct!.bandwidthName), + bandwidth_size: cdktf.numberToTerraform(struct!.bandwidthSize), + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpnGatewayMasterEipToHclTerraform(struct?: VpnGatewayMasterEipOutputReference | VpnGatewayMasterEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth_name: { + value: cdktf.stringToHclTerraform(struct!.bandwidthName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(struct!.bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnGatewayMasterEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnGatewayMasterEip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidthName !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthName = this._bandwidthName; + } + if (this._bandwidthSize !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthSize = this._bandwidthSize; + } + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnGatewayMasterEip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidthName = undefined; + this._bandwidthSize = undefined; + this._chargeMode = undefined; + this._id = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidthName = value.bandwidthName; + this._bandwidthSize = value.bandwidthSize; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._type = value.type; + } + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: true, required: false + private _bandwidthName?: string; + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + public set bandwidthName(value: string) { + this._bandwidthName = value; + } + public resetBandwidthName() { + this._bandwidthName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthNameInput() { + return this._bandwidthName; + } + + // bandwidth_size - computed: true, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface VpnGatewaySlaveEip { + /** + * The bandwidth name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_name VpnGateway#bandwidth_name} + */ + readonly bandwidthName?: string; + /** + * Bandwidth size in Mbit/s. When the flavor is **V300**, the value cannot be greater than **300**. + * + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#bandwidth_size VpnGateway#bandwidth_size} + */ + readonly bandwidthSize?: number; + /** + * The charge mode of the bandwidth. The value can be **bandwidth** and **traffic**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#charge_mode VpnGateway#charge_mode} + */ + readonly chargeMode?: string; + /** + * The public IP ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#id VpnGateway#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The EIP type. The value can be **5_bgp** and **5_sbgp**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#type VpnGateway#type} + */ + readonly type?: string; +} + +export function vpnGatewaySlaveEipToTerraform(struct?: VpnGatewaySlaveEipOutputReference | VpnGatewaySlaveEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + bandwidth_name: cdktf.stringToTerraform(struct!.bandwidthName), + bandwidth_size: cdktf.numberToTerraform(struct!.bandwidthSize), + charge_mode: cdktf.stringToTerraform(struct!.chargeMode), + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function vpnGatewaySlaveEipToHclTerraform(struct?: VpnGatewaySlaveEipOutputReference | VpnGatewaySlaveEip): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + bandwidth_name: { + value: cdktf.stringToHclTerraform(struct!.bandwidthName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_size: { + value: cdktf.numberToHclTerraform(struct!.bandwidthSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + charge_mode: { + value: cdktf.stringToHclTerraform(struct!.chargeMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnGatewaySlaveEipOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): VpnGatewaySlaveEip | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._bandwidthName !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthName = this._bandwidthName; + } + if (this._bandwidthSize !== undefined) { + hasAnyValues = true; + internalValueResult.bandwidthSize = this._bandwidthSize; + } + if (this._chargeMode !== undefined) { + hasAnyValues = true; + internalValueResult.chargeMode = this._chargeMode; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnGatewaySlaveEip | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._bandwidthName = undefined; + this._bandwidthSize = undefined; + this._chargeMode = undefined; + this._id = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._bandwidthName = value.bandwidthName; + this._bandwidthSize = value.bandwidthSize; + this._chargeMode = value.chargeMode; + this._id = value.id; + this._type = value.type; + } + } + + // bandwidth_id - computed: true, optional: false, required: false + public get bandwidthId() { + return this.getStringAttribute('bandwidth_id'); + } + + // bandwidth_name - computed: true, optional: true, required: false + private _bandwidthName?: string; + public get bandwidthName() { + return this.getStringAttribute('bandwidth_name'); + } + public set bandwidthName(value: string) { + this._bandwidthName = value; + } + public resetBandwidthName() { + this._bandwidthName = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthNameInput() { + return this._bandwidthName; + } + + // bandwidth_size - computed: true, optional: true, required: false + private _bandwidthSize?: number; + public get bandwidthSize() { + return this.getNumberAttribute('bandwidth_size'); + } + public set bandwidthSize(value: number) { + this._bandwidthSize = value; + } + public resetBandwidthSize() { + this._bandwidthSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthSizeInput() { + return this._bandwidthSize; + } + + // charge_mode - computed: true, optional: true, required: false + private _chargeMode?: string; + public get chargeMode() { + return this.getStringAttribute('charge_mode'); + } + public set chargeMode(value: string) { + this._chargeMode = value; + } + public resetChargeMode() { + this._chargeMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargeModeInput() { + return this._chargeMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: true, optional: false, required: false + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + + // ip_version - computed: true, optional: false, required: false + public get ipVersion() { + return this.getNumberAttribute('ip_version'); + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface VpnGatewayTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#create VpnGateway#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#delete VpnGateway#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#update VpnGateway#update} + */ + readonly update?: string; +} + +export function vpnGatewayTimeoutsToTerraform(struct?: VpnGatewayTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnGatewayTimeoutsToHclTerraform(struct?: VpnGatewayTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnGatewayTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnGatewayTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnGatewayTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway huaweicloud_vpn_gateway} +*/ +export class VpnGateway extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_gateway"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnGateway resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnGateway to import + * @param importFromId The id of the existing VpnGateway that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnGateway to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_gateway", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_gateway huaweicloud_vpn_gateway} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnGatewayConfig + */ + public constructor(scope: Construct, id: string, config: VpnGatewayConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_gateway', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessPrivateIp1 = config.accessPrivateIp1; + this._accessPrivateIp2 = config.accessPrivateIp2; + this._accessSubnetId = config.accessSubnetId; + this._accessVpcId = config.accessVpcId; + this._asn = config.asn; + this._attachmentType = config.attachmentType; + this._availabilityZones = config.availabilityZones; + this._connectSubnet = config.connectSubnet; + this._enterpriseProjectId = config.enterpriseProjectId; + this._erId = config.erId; + this._flavor = config.flavor; + this._haMode = config.haMode; + this._id = config.id; + this._localSubnets = config.localSubnets; + this._name = config.name; + this._networkType = config.networkType; + this._region = config.region; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._certificate.internalValue = config.certificate; + this._eip1.internalValue = config.eip1; + this._eip2.internalValue = config.eip2; + this._masterEip.internalValue = config.masterEip; + this._slaveEip.internalValue = config.slaveEip; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_private_ip_1 - computed: true, optional: true, required: false + private _accessPrivateIp1?: string; + public get accessPrivateIp1() { + return this.getStringAttribute('access_private_ip_1'); + } + public set accessPrivateIp1(value: string) { + this._accessPrivateIp1 = value; + } + public resetAccessPrivateIp1() { + this._accessPrivateIp1 = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessPrivateIp1Input() { + return this._accessPrivateIp1; + } + + // access_private_ip_2 - computed: true, optional: true, required: false + private _accessPrivateIp2?: string; + public get accessPrivateIp2() { + return this.getStringAttribute('access_private_ip_2'); + } + public set accessPrivateIp2(value: string) { + this._accessPrivateIp2 = value; + } + public resetAccessPrivateIp2() { + this._accessPrivateIp2 = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessPrivateIp2Input() { + return this._accessPrivateIp2; + } + + // access_subnet_id - computed: true, optional: true, required: false + private _accessSubnetId?: string; + public get accessSubnetId() { + return this.getStringAttribute('access_subnet_id'); + } + public set accessSubnetId(value: string) { + this._accessSubnetId = value; + } + public resetAccessSubnetId() { + this._accessSubnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessSubnetIdInput() { + return this._accessSubnetId; + } + + // access_vpc_id - computed: true, optional: true, required: false + private _accessVpcId?: string; + public get accessVpcId() { + return this.getStringAttribute('access_vpc_id'); + } + public set accessVpcId(value: string) { + this._accessVpcId = value; + } + public resetAccessVpcId() { + this._accessVpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get accessVpcIdInput() { + return this._accessVpcId; + } + + // asn - computed: false, optional: true, required: false + private _asn?: number; + public get asn() { + return this.getNumberAttribute('asn'); + } + public set asn(value: number) { + this._asn = value; + } + public resetAsn() { + this._asn = undefined; + } + // Temporarily expose input value. Use with caution. + public get asnInput() { + return this._asn; + } + + // attachment_type - computed: false, optional: true, required: false + private _attachmentType?: string; + public get attachmentType() { + return this.getStringAttribute('attachment_type'); + } + public set attachmentType(value: string) { + this._attachmentType = value; + } + public resetAttachmentType() { + this._attachmentType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachmentTypeInput() { + return this._attachmentType; + } + + // availability_zones - computed: false, optional: false, required: true + private _availabilityZones?: string[]; + public get availabilityZones() { + return this.getListAttribute('availability_zones'); + } + public set availabilityZones(value: string[]) { + this._availabilityZones = value; + } + // Temporarily expose input value. Use with caution. + public get availabilityZonesInput() { + return this._availabilityZones; + } + + // connect_subnet - computed: true, optional: true, required: false + private _connectSubnet?: string; + public get connectSubnet() { + return this.getStringAttribute('connect_subnet'); + } + public set connectSubnet(value: string) { + this._connectSubnet = value; + } + public resetConnectSubnet() { + this._connectSubnet = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectSubnetInput() { + return this._connectSubnet; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // er_attachment_id - computed: true, optional: false, required: false + public get erAttachmentId() { + return this.getStringAttribute('er_attachment_id'); + } + + // er_id - computed: true, optional: true, required: false + private _erId?: string; + public get erId() { + return this.getStringAttribute('er_id'); + } + public set erId(value: string) { + this._erId = value; + } + public resetErId() { + this._erId = undefined; + } + // Temporarily expose input value. Use with caution. + public get erIdInput() { + return this._erId; + } + + // flavor - computed: true, optional: true, required: false + private _flavor?: string; + public get flavor() { + return this.getStringAttribute('flavor'); + } + public set flavor(value: string) { + this._flavor = value; + } + public resetFlavor() { + this._flavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get flavorInput() { + return this._flavor; + } + + // ha_mode - computed: true, optional: true, required: false + private _haMode?: string; + public get haMode() { + return this.getStringAttribute('ha_mode'); + } + public set haMode(value: string) { + this._haMode = value; + } + public resetHaMode() { + this._haMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get haModeInput() { + return this._haMode; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // local_subnets - computed: true, optional: true, required: false + private _localSubnets?: string[]; + public get localSubnets() { + return this.getListAttribute('local_subnets'); + } + public set localSubnets(value: string[]) { + this._localSubnets = value; + } + public resetLocalSubnets() { + this._localSubnets = undefined; + } + // Temporarily expose input value. Use with caution. + public get localSubnetsInput() { + return this._localSubnets; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // network_type - computed: true, optional: true, required: false + private _networkType?: string; + public get networkType() { + return this.getStringAttribute('network_type'); + } + public set networkType(value: string) { + this._networkType = value; + } + public resetNetworkType() { + this._networkType = undefined; + } + // Temporarily expose input value. Use with caution. + public get networkTypeInput() { + return this._networkType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // used_connection_group - computed: true, optional: false, required: false + public get usedConnectionGroup() { + return this.getNumberAttribute('used_connection_group'); + } + + // used_connection_number - computed: true, optional: false, required: false + public get usedConnectionNumber() { + return this.getNumberAttribute('used_connection_number'); + } + + // vpc_id - computed: true, optional: true, required: false + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + public resetVpcId() { + this._vpcId = undefined; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // certificate - computed: false, optional: true, required: false + private _certificate = new VpnGatewayCertificateOutputReference(this, "certificate"); + public get certificate() { + return this._certificate; + } + public putCertificate(value: VpnGatewayCertificate) { + this._certificate.internalValue = value; + } + public resetCertificate() { + this._certificate.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate.internalValue; + } + + // eip1 - computed: false, optional: true, required: false + private _eip1 = new VpnGatewayEip1OutputReference(this, "eip1"); + public get eip1() { + return this._eip1; + } + public putEip1(value: VpnGatewayEip1) { + this._eip1.internalValue = value; + } + public resetEip1() { + this._eip1.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eip1Input() { + return this._eip1.internalValue; + } + + // eip2 - computed: false, optional: true, required: false + private _eip2 = new VpnGatewayEip2OutputReference(this, "eip2"); + public get eip2() { + return this._eip2; + } + public putEip2(value: VpnGatewayEip2) { + this._eip2.internalValue = value; + } + public resetEip2() { + this._eip2.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get eip2Input() { + return this._eip2.internalValue; + } + + // master_eip - computed: false, optional: true, required: false + private _masterEip = new VpnGatewayMasterEipOutputReference(this, "master_eip"); + public get masterEip() { + return this._masterEip; + } + public putMasterEip(value: VpnGatewayMasterEip) { + this._masterEip.internalValue = value; + } + public resetMasterEip() { + this._masterEip.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get masterEipInput() { + return this._masterEip.internalValue; + } + + // slave_eip - computed: false, optional: true, required: false + private _slaveEip = new VpnGatewaySlaveEipOutputReference(this, "slave_eip"); + public get slaveEip() { + return this._slaveEip; + } + public putSlaveEip(value: VpnGatewaySlaveEip) { + this._slaveEip.internalValue = value; + } + public resetSlaveEip() { + this._slaveEip.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get slaveEipInput() { + return this._slaveEip.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnGatewayTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnGatewayTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_private_ip_1: cdktf.stringToTerraform(this._accessPrivateIp1), + access_private_ip_2: cdktf.stringToTerraform(this._accessPrivateIp2), + access_subnet_id: cdktf.stringToTerraform(this._accessSubnetId), + access_vpc_id: cdktf.stringToTerraform(this._accessVpcId), + asn: cdktf.numberToTerraform(this._asn), + attachment_type: cdktf.stringToTerraform(this._attachmentType), + availability_zones: cdktf.listMapper(cdktf.stringToTerraform, false)(this._availabilityZones), + connect_subnet: cdktf.stringToTerraform(this._connectSubnet), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + er_id: cdktf.stringToTerraform(this._erId), + flavor: cdktf.stringToTerraform(this._flavor), + ha_mode: cdktf.stringToTerraform(this._haMode), + id: cdktf.stringToTerraform(this._id), + local_subnets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._localSubnets), + name: cdktf.stringToTerraform(this._name), + network_type: cdktf.stringToTerraform(this._networkType), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + certificate: vpnGatewayCertificateToTerraform(this._certificate.internalValue), + eip1: vpnGatewayEip1ToTerraform(this._eip1.internalValue), + eip2: vpnGatewayEip2ToTerraform(this._eip2.internalValue), + master_eip: vpnGatewayMasterEipToTerraform(this._masterEip.internalValue), + slave_eip: vpnGatewaySlaveEipToTerraform(this._slaveEip.internalValue), + timeouts: vpnGatewayTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_private_ip_1: { + value: cdktf.stringToHclTerraform(this._accessPrivateIp1), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_private_ip_2: { + value: cdktf.stringToHclTerraform(this._accessPrivateIp2), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_subnet_id: { + value: cdktf.stringToHclTerraform(this._accessSubnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + access_vpc_id: { + value: cdktf.stringToHclTerraform(this._accessVpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + asn: { + value: cdktf.numberToHclTerraform(this._asn), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + attachment_type: { + value: cdktf.stringToHclTerraform(this._attachmentType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zones: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._availabilityZones), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + connect_subnet: { + value: cdktf.stringToHclTerraform(this._connectSubnet), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + er_id: { + value: cdktf.stringToHclTerraform(this._erId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor: { + value: cdktf.stringToHclTerraform(this._flavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ha_mode: { + value: cdktf.stringToHclTerraform(this._haMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_subnets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._localSubnets), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_type: { + value: cdktf.stringToHclTerraform(this._networkType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate: { + value: vpnGatewayCertificateToHclTerraform(this._certificate.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnGatewayCertificateList", + }, + eip1: { + value: vpnGatewayEip1ToHclTerraform(this._eip1.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnGatewayEip1List", + }, + eip2: { + value: vpnGatewayEip2ToHclTerraform(this._eip2.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnGatewayEip2List", + }, + master_eip: { + value: vpnGatewayMasterEipToHclTerraform(this._masterEip.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnGatewayMasterEipList", + }, + slave_eip: { + value: vpnGatewaySlaveEipToHclTerraform(this._slaveEip.internalValue), + isBlock: true, + type: "list", + storageClassType: "VpnGatewaySlaveEipList", + }, + timeouts: { + value: vpnGatewayTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnGatewayTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-user-group/README.md b/src/constructs/providers/huaweicloud/vpn-user-group/README.md new file mode 100644 index 00000000..e122b09f --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-user-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_user_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_user_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group). diff --git a/src/constructs/providers/huaweicloud/vpn-user-group/index.ts b/src/constructs/providers/huaweicloud/vpn-user-group/index.ts new file mode 100644 index 00000000..5f841265 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-user-group/index.ts @@ -0,0 +1,406 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnUserGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#description VpnUserGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#id VpnUserGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#name VpnUserGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#region VpnUserGroup#region} + */ + readonly region?: string; + /** + * The VPN server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#vpn_server_id VpnUserGroup#vpn_server_id} + */ + readonly vpnServerId: string; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#users VpnUserGroup#users} + */ + readonly users?: VpnUserGroupUsers[] | cdktf.IResolvable; +} +export interface VpnUserGroupUsers { + /** + * The user ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#id VpnUserGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function vpnUserGroupUsersToTerraform(struct?: VpnUserGroupUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function vpnUserGroupUsersToHclTerraform(struct?: VpnUserGroupUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnUserGroupUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnUserGroupUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnUserGroupUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class VpnUserGroupUsersList extends cdktf.ComplexList { + public internalValue? : VpnUserGroupUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnUserGroupUsersOutputReference { + return new VpnUserGroupUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group huaweicloud_vpn_user_group} +*/ +export class VpnUserGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_user_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnUserGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnUserGroup to import + * @param importFromId The id of the existing VpnUserGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnUserGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_user_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user_group huaweicloud_vpn_user_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnUserGroupConfig + */ + public constructor(scope: Construct, id: string, config: VpnUserGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_user_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._vpnServerId = config.vpnServerId; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: true, optional: false, required: false + public get type() { + return this.getStringAttribute('type'); + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_number - computed: true, optional: false, required: false + public get userNumber() { + return this.getNumberAttribute('user_number'); + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // users - computed: false, optional: true, required: false + private _users = new VpnUserGroupUsersList(this, "users", true); + public get users() { + return this._users; + } + public putUsers(value: VpnUserGroupUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + public resetUsers() { + this._users.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + users: cdktf.listMapper(vpnUserGroupUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.listMapperHcl(vpnUserGroupUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnUserGroupUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpn-user/README.md b/src/constructs/providers/huaweicloud/vpn-user/README.md new file mode 100644 index 00000000..c67a55dc --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpn_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpn_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user). diff --git a/src/constructs/providers/huaweicloud/vpn-user/index.ts b/src/constructs/providers/huaweicloud/vpn-user/index.ts new file mode 100644 index 00000000..348d53b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpn-user/index.ts @@ -0,0 +1,300 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnUserConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#description VpnUser#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#id VpnUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The user name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#name VpnUser#name} + */ + readonly name: string; + /** + * The user password. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#password VpnUser#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#region VpnUser#region} + */ + readonly region?: string; + /** + * The user group ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#user_group_id VpnUser#user_group_id} + */ + readonly userGroupId?: string; + /** + * The VPN server ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#vpn_server_id VpnUser#vpn_server_id} + */ + readonly vpnServerId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user huaweicloud_vpn_user} +*/ +export class VpnUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpn_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnUser to import + * @param importFromId The id of the existing VpnUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpn_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpn_user huaweicloud_vpn_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnUserConfig + */ + public constructor(scope: Construct, id: string, config: VpnUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpn_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._password = config.password; + this._region = config.region; + this._userGroupId = config.userGroupId; + this._vpnServerId = config.vpnServerId; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // user_group_id - computed: true, optional: true, required: false + private _userGroupId?: string; + public get userGroupId() { + return this.getStringAttribute('user_group_id'); + } + public set userGroupId(value: string) { + this._userGroupId = value; + } + public resetUserGroupId() { + this._userGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get userGroupIdInput() { + return this._userGroupId; + } + + // user_group_name - computed: true, optional: false, required: false + public get userGroupName() { + return this.getStringAttribute('user_group_name'); + } + + // vpn_server_id - computed: false, optional: false, required: true + private _vpnServerId?: string; + public get vpnServerId() { + return this.getStringAttribute('vpn_server_id'); + } + public set vpnServerId(value: string) { + this._vpnServerId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnServerIdInput() { + return this._vpnServerId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + password: cdktf.stringToTerraform(this._password), + region: cdktf.stringToTerraform(this._region), + user_group_id: cdktf.stringToTerraform(this._userGroupId), + vpn_server_id: cdktf.stringToTerraform(this._vpnServerId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(this._password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_group_id: { + value: cdktf.stringToHclTerraform(this._userGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpn_server_id: { + value: cdktf.stringToHclTerraform(this._vpnServerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/README.md b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/README.md new file mode 100644 index 00000000..2112606c --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_endpoint_group_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_endpoint_group_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2). diff --git a/src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/index.ts b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/index.ts new file mode 100644 index 00000000..b73c0a70 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group-v2/index.ts @@ -0,0 +1,502 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasEndpointGroupV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#description VpnaasEndpointGroupV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#endpoints VpnaasEndpointGroupV2#endpoints} + */ + readonly endpoints?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#id VpnaasEndpointGroupV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#name VpnaasEndpointGroupV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#region VpnaasEndpointGroupV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#tenant_id VpnaasEndpointGroupV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#type VpnaasEndpointGroupV2#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#value_specs VpnaasEndpointGroupV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#timeouts VpnaasEndpointGroupV2#timeouts} + */ + readonly timeouts?: VpnaasEndpointGroupV2Timeouts; +} +export interface VpnaasEndpointGroupV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#create VpnaasEndpointGroupV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#delete VpnaasEndpointGroupV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#update VpnaasEndpointGroupV2#update} + */ + readonly update?: string; +} + +export function vpnaasEndpointGroupV2TimeoutsToTerraform(struct?: VpnaasEndpointGroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnaasEndpointGroupV2TimeoutsToHclTerraform(struct?: VpnaasEndpointGroupV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasEndpointGroupV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasEndpointGroupV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasEndpointGroupV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2 huaweicloud_vpnaas_endpoint_group_v2} +*/ +export class VpnaasEndpointGroupV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_endpoint_group_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasEndpointGroupV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasEndpointGroupV2 to import + * @param importFromId The id of the existing VpnaasEndpointGroupV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasEndpointGroupV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_endpoint_group_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group_v2 huaweicloud_vpnaas_endpoint_group_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasEndpointGroupV2Config = {} + */ + public constructor(scope: Construct, id: string, config: VpnaasEndpointGroupV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_endpoint_group_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._endpoints = config.endpoints; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tenantId = config.tenantId; + this._type = config.type; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // endpoints - computed: false, optional: true, required: false + private _endpoints?: string[]; + public get endpoints() { + return this.getListAttribute('endpoints'); + } + public set endpoints(value: string[]) { + this._endpoints = value; + } + public resetEndpoints() { + this._endpoints = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointsInput() { + return this._endpoints; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasEndpointGroupV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasEndpointGroupV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + endpoints: cdktf.listMapper(cdktf.stringToTerraform, false)(this._endpoints), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + type: cdktf.stringToTerraform(this._type), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: vpnaasEndpointGroupV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoints: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._endpoints), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: vpnaasEndpointGroupV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasEndpointGroupV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-endpoint-group/README.md b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group/README.md new file mode 100644 index 00000000..cebff675 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_endpoint_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_endpoint_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group). diff --git a/src/constructs/providers/huaweicloud/vpnaas-endpoint-group/index.ts b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group/index.ts new file mode 100644 index 00000000..093f1adf --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-endpoint-group/index.ts @@ -0,0 +1,502 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasEndpointGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#description VpnaasEndpointGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#endpoints VpnaasEndpointGroup#endpoints} + */ + readonly endpoints?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#id VpnaasEndpointGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#name VpnaasEndpointGroup#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#region VpnaasEndpointGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#tenant_id VpnaasEndpointGroup#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#type VpnaasEndpointGroup#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#value_specs VpnaasEndpointGroup#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#timeouts VpnaasEndpointGroup#timeouts} + */ + readonly timeouts?: VpnaasEndpointGroupTimeouts; +} +export interface VpnaasEndpointGroupTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#create VpnaasEndpointGroup#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#delete VpnaasEndpointGroup#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#update VpnaasEndpointGroup#update} + */ + readonly update?: string; +} + +export function vpnaasEndpointGroupTimeoutsToTerraform(struct?: VpnaasEndpointGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnaasEndpointGroupTimeoutsToHclTerraform(struct?: VpnaasEndpointGroupTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasEndpointGroupTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasEndpointGroupTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasEndpointGroupTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group huaweicloud_vpnaas_endpoint_group} +*/ +export class VpnaasEndpointGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_endpoint_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasEndpointGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasEndpointGroup to import + * @param importFromId The id of the existing VpnaasEndpointGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasEndpointGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_endpoint_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_endpoint_group huaweicloud_vpnaas_endpoint_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasEndpointGroupConfig = {} + */ + public constructor(scope: Construct, id: string, config: VpnaasEndpointGroupConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_endpoint_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._endpoints = config.endpoints; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._tenantId = config.tenantId; + this._type = config.type; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // endpoints - computed: false, optional: true, required: false + private _endpoints?: string[]; + public get endpoints() { + return this.getListAttribute('endpoints'); + } + public set endpoints(value: string[]) { + this._endpoints = value; + } + public resetEndpoints() { + this._endpoints = undefined; + } + // Temporarily expose input value. Use with caution. + public get endpointsInput() { + return this._endpoints; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasEndpointGroupTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasEndpointGroupTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + endpoints: cdktf.listMapper(cdktf.stringToTerraform, false)(this._endpoints), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + type: cdktf.stringToTerraform(this._type), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: vpnaasEndpointGroupTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + endpoints: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._endpoints), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: vpnaasEndpointGroupTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasEndpointGroupTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/README.md b/src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/README.md new file mode 100644 index 00000000..316a542a --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_ike_policy_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_ike_policy_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2). diff --git a/src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/index.ts b/src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/index.ts new file mode 100644 index 00000000..e326b705 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ike-policy-v2/index.ts @@ -0,0 +1,699 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasIkePolicyV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#auth_algorithm VpnaasIkePolicyV2#auth_algorithm} + */ + readonly authAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#description VpnaasIkePolicyV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#encryption_algorithm VpnaasIkePolicyV2#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#id VpnaasIkePolicyV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#ike_version VpnaasIkePolicyV2#ike_version} + */ + readonly ikeVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#name VpnaasIkePolicyV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#pfs VpnaasIkePolicyV2#pfs} + */ + readonly pfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#phase1_negotiation_mode VpnaasIkePolicyV2#phase1_negotiation_mode} + */ + readonly phase1NegotiationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#region VpnaasIkePolicyV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#tenant_id VpnaasIkePolicyV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#value_specs VpnaasIkePolicyV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * lifetime block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#lifetime VpnaasIkePolicyV2#lifetime} + */ + readonly lifetime?: VpnaasIkePolicyV2Lifetime[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#timeouts VpnaasIkePolicyV2#timeouts} + */ + readonly timeouts?: VpnaasIkePolicyV2Timeouts; +} +export interface VpnaasIkePolicyV2Lifetime { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#units VpnaasIkePolicyV2#units} + */ + readonly units?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#value VpnaasIkePolicyV2#value} + */ + readonly value?: number; +} + +export function vpnaasIkePolicyV2LifetimeToTerraform(struct?: VpnaasIkePolicyV2Lifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + units: cdktf.stringToTerraform(struct!.units), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function vpnaasIkePolicyV2LifetimeToHclTerraform(struct?: VpnaasIkePolicyV2Lifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + units: { + value: cdktf.stringToHclTerraform(struct!.units), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIkePolicyV2LifetimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnaasIkePolicyV2Lifetime | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._units !== undefined) { + hasAnyValues = true; + internalValueResult.units = this._units; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIkePolicyV2Lifetime | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._units = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._units = value.units; + this._value = value.value; + } + } + + // units - computed: true, optional: true, required: false + private _units?: string; + public get units() { + return this.getStringAttribute('units'); + } + public set units(value: string) { + this._units = value; + } + public resetUnits() { + this._units = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitsInput() { + return this._units; + } + + // value - computed: true, optional: true, required: false + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VpnaasIkePolicyV2LifetimeList extends cdktf.ComplexList { + public internalValue? : VpnaasIkePolicyV2Lifetime[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnaasIkePolicyV2LifetimeOutputReference { + return new VpnaasIkePolicyV2LifetimeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnaasIkePolicyV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#create VpnaasIkePolicyV2#create} + */ + readonly create?: string; +} + +export function vpnaasIkePolicyV2TimeoutsToTerraform(struct?: VpnaasIkePolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function vpnaasIkePolicyV2TimeoutsToHclTerraform(struct?: VpnaasIkePolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIkePolicyV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasIkePolicyV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIkePolicyV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2 huaweicloud_vpnaas_ike_policy_v2} +*/ +export class VpnaasIkePolicyV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_ike_policy_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasIkePolicyV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasIkePolicyV2 to import + * @param importFromId The id of the existing VpnaasIkePolicyV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasIkePolicyV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_ike_policy_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy_v2 huaweicloud_vpnaas_ike_policy_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasIkePolicyV2Config = {} + */ + public constructor(scope: Construct, id: string, config: VpnaasIkePolicyV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_ike_policy_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authAlgorithm = config.authAlgorithm; + this._description = config.description; + this._encryptionAlgorithm = config.encryptionAlgorithm; + this._id = config.id; + this._ikeVersion = config.ikeVersion; + this._name = config.name; + this._pfs = config.pfs; + this._phase1NegotiationMode = config.phase1NegotiationMode; + this._region = config.region; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._lifetime.internalValue = config.lifetime; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_algorithm - computed: false, optional: true, required: false + private _authAlgorithm?: string; + public get authAlgorithm() { + return this.getStringAttribute('auth_algorithm'); + } + public set authAlgorithm(value: string) { + this._authAlgorithm = value; + } + public resetAuthAlgorithm() { + this._authAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get authAlgorithmInput() { + return this._authAlgorithm; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encryption_algorithm - computed: false, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ike_version - computed: false, optional: true, required: false + private _ikeVersion?: string; + public get ikeVersion() { + return this.getStringAttribute('ike_version'); + } + public set ikeVersion(value: string) { + this._ikeVersion = value; + } + public resetIkeVersion() { + this._ikeVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ikeVersionInput() { + return this._ikeVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pfs - computed: false, optional: true, required: false + private _pfs?: string; + public get pfs() { + return this.getStringAttribute('pfs'); + } + public set pfs(value: string) { + this._pfs = value; + } + public resetPfs() { + this._pfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get pfsInput() { + return this._pfs; + } + + // phase1_negotiation_mode - computed: false, optional: true, required: false + private _phase1NegotiationMode?: string; + public get phase1NegotiationMode() { + return this.getStringAttribute('phase1_negotiation_mode'); + } + public set phase1NegotiationMode(value: string) { + this._phase1NegotiationMode = value; + } + public resetPhase1NegotiationMode() { + this._phase1NegotiationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get phase1NegotiationModeInput() { + return this._phase1NegotiationMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // lifetime - computed: false, optional: true, required: false + private _lifetime = new VpnaasIkePolicyV2LifetimeList(this, "lifetime", true); + public get lifetime() { + return this._lifetime; + } + public putLifetime(value: VpnaasIkePolicyV2Lifetime[] | cdktf.IResolvable) { + this._lifetime.internalValue = value; + } + public resetLifetime() { + this._lifetime.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifetimeInput() { + return this._lifetime.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasIkePolicyV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasIkePolicyV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_algorithm: cdktf.stringToTerraform(this._authAlgorithm), + description: cdktf.stringToTerraform(this._description), + encryption_algorithm: cdktf.stringToTerraform(this._encryptionAlgorithm), + id: cdktf.stringToTerraform(this._id), + ike_version: cdktf.stringToTerraform(this._ikeVersion), + name: cdktf.stringToTerraform(this._name), + pfs: cdktf.stringToTerraform(this._pfs), + phase1_negotiation_mode: cdktf.stringToTerraform(this._phase1NegotiationMode), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + lifetime: cdktf.listMapper(vpnaasIkePolicyV2LifetimeToTerraform, true)(this._lifetime.internalValue), + timeouts: vpnaasIkePolicyV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_algorithm: { + value: cdktf.stringToHclTerraform(this._authAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(this._encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ike_version: { + value: cdktf.stringToHclTerraform(this._ikeVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pfs: { + value: cdktf.stringToHclTerraform(this._pfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phase1_negotiation_mode: { + value: cdktf.stringToHclTerraform(this._phase1NegotiationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lifetime: { + value: cdktf.listMapperHcl(vpnaasIkePolicyV2LifetimeToHclTerraform, true)(this._lifetime.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnaasIkePolicyV2LifetimeList", + }, + timeouts: { + value: vpnaasIkePolicyV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasIkePolicyV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-ike-policy/README.md b/src/constructs/providers/huaweicloud/vpnaas-ike-policy/README.md new file mode 100644 index 00000000..af09e85b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ike-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_ike_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_ike_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy). diff --git a/src/constructs/providers/huaweicloud/vpnaas-ike-policy/index.ts b/src/constructs/providers/huaweicloud/vpnaas-ike-policy/index.ts new file mode 100644 index 00000000..6c410540 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ike-policy/index.ts @@ -0,0 +1,699 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasIkePolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#auth_algorithm VpnaasIkePolicy#auth_algorithm} + */ + readonly authAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#description VpnaasIkePolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#encryption_algorithm VpnaasIkePolicy#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#id VpnaasIkePolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#ike_version VpnaasIkePolicy#ike_version} + */ + readonly ikeVersion?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#name VpnaasIkePolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#pfs VpnaasIkePolicy#pfs} + */ + readonly pfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#phase1_negotiation_mode VpnaasIkePolicy#phase1_negotiation_mode} + */ + readonly phase1NegotiationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#region VpnaasIkePolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#tenant_id VpnaasIkePolicy#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#value_specs VpnaasIkePolicy#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * lifetime block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#lifetime VpnaasIkePolicy#lifetime} + */ + readonly lifetime?: VpnaasIkePolicyLifetime[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#timeouts VpnaasIkePolicy#timeouts} + */ + readonly timeouts?: VpnaasIkePolicyTimeouts; +} +export interface VpnaasIkePolicyLifetime { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#units VpnaasIkePolicy#units} + */ + readonly units?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#value VpnaasIkePolicy#value} + */ + readonly value?: number; +} + +export function vpnaasIkePolicyLifetimeToTerraform(struct?: VpnaasIkePolicyLifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + units: cdktf.stringToTerraform(struct!.units), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function vpnaasIkePolicyLifetimeToHclTerraform(struct?: VpnaasIkePolicyLifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + units: { + value: cdktf.stringToHclTerraform(struct!.units), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIkePolicyLifetimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnaasIkePolicyLifetime | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._units !== undefined) { + hasAnyValues = true; + internalValueResult.units = this._units; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIkePolicyLifetime | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._units = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._units = value.units; + this._value = value.value; + } + } + + // units - computed: true, optional: true, required: false + private _units?: string; + public get units() { + return this.getStringAttribute('units'); + } + public set units(value: string) { + this._units = value; + } + public resetUnits() { + this._units = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitsInput() { + return this._units; + } + + // value - computed: true, optional: true, required: false + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VpnaasIkePolicyLifetimeList extends cdktf.ComplexList { + public internalValue? : VpnaasIkePolicyLifetime[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnaasIkePolicyLifetimeOutputReference { + return new VpnaasIkePolicyLifetimeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnaasIkePolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#create VpnaasIkePolicy#create} + */ + readonly create?: string; +} + +export function vpnaasIkePolicyTimeoutsToTerraform(struct?: VpnaasIkePolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function vpnaasIkePolicyTimeoutsToHclTerraform(struct?: VpnaasIkePolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIkePolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasIkePolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIkePolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy huaweicloud_vpnaas_ike_policy} +*/ +export class VpnaasIkePolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_ike_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasIkePolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasIkePolicy to import + * @param importFromId The id of the existing VpnaasIkePolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasIkePolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_ike_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ike_policy huaweicloud_vpnaas_ike_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasIkePolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: VpnaasIkePolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_ike_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authAlgorithm = config.authAlgorithm; + this._description = config.description; + this._encryptionAlgorithm = config.encryptionAlgorithm; + this._id = config.id; + this._ikeVersion = config.ikeVersion; + this._name = config.name; + this._pfs = config.pfs; + this._phase1NegotiationMode = config.phase1NegotiationMode; + this._region = config.region; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._lifetime.internalValue = config.lifetime; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_algorithm - computed: false, optional: true, required: false + private _authAlgorithm?: string; + public get authAlgorithm() { + return this.getStringAttribute('auth_algorithm'); + } + public set authAlgorithm(value: string) { + this._authAlgorithm = value; + } + public resetAuthAlgorithm() { + this._authAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get authAlgorithmInput() { + return this._authAlgorithm; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encryption_algorithm - computed: false, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ike_version - computed: false, optional: true, required: false + private _ikeVersion?: string; + public get ikeVersion() { + return this.getStringAttribute('ike_version'); + } + public set ikeVersion(value: string) { + this._ikeVersion = value; + } + public resetIkeVersion() { + this._ikeVersion = undefined; + } + // Temporarily expose input value. Use with caution. + public get ikeVersionInput() { + return this._ikeVersion; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pfs - computed: false, optional: true, required: false + private _pfs?: string; + public get pfs() { + return this.getStringAttribute('pfs'); + } + public set pfs(value: string) { + this._pfs = value; + } + public resetPfs() { + this._pfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get pfsInput() { + return this._pfs; + } + + // phase1_negotiation_mode - computed: false, optional: true, required: false + private _phase1NegotiationMode?: string; + public get phase1NegotiationMode() { + return this.getStringAttribute('phase1_negotiation_mode'); + } + public set phase1NegotiationMode(value: string) { + this._phase1NegotiationMode = value; + } + public resetPhase1NegotiationMode() { + this._phase1NegotiationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get phase1NegotiationModeInput() { + return this._phase1NegotiationMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // lifetime - computed: false, optional: true, required: false + private _lifetime = new VpnaasIkePolicyLifetimeList(this, "lifetime", true); + public get lifetime() { + return this._lifetime; + } + public putLifetime(value: VpnaasIkePolicyLifetime[] | cdktf.IResolvable) { + this._lifetime.internalValue = value; + } + public resetLifetime() { + this._lifetime.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifetimeInput() { + return this._lifetime.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasIkePolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasIkePolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_algorithm: cdktf.stringToTerraform(this._authAlgorithm), + description: cdktf.stringToTerraform(this._description), + encryption_algorithm: cdktf.stringToTerraform(this._encryptionAlgorithm), + id: cdktf.stringToTerraform(this._id), + ike_version: cdktf.stringToTerraform(this._ikeVersion), + name: cdktf.stringToTerraform(this._name), + pfs: cdktf.stringToTerraform(this._pfs), + phase1_negotiation_mode: cdktf.stringToTerraform(this._phase1NegotiationMode), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + lifetime: cdktf.listMapper(vpnaasIkePolicyLifetimeToTerraform, true)(this._lifetime.internalValue), + timeouts: vpnaasIkePolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_algorithm: { + value: cdktf.stringToHclTerraform(this._authAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(this._encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ike_version: { + value: cdktf.stringToHclTerraform(this._ikeVersion), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pfs: { + value: cdktf.stringToHclTerraform(this._pfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + phase1_negotiation_mode: { + value: cdktf.stringToHclTerraform(this._phase1NegotiationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lifetime: { + value: cdktf.listMapperHcl(vpnaasIkePolicyLifetimeToHclTerraform, true)(this._lifetime.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnaasIkePolicyLifetimeList", + }, + timeouts: { + value: vpnaasIkePolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasIkePolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/README.md b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/README.md new file mode 100644 index 00000000..0ecfb065 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_ipsec_policy_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_ipsec_policy_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2). diff --git a/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/index.ts b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/index.ts new file mode 100644 index 00000000..d35b485b --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy-v2/index.ts @@ -0,0 +1,699 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasIpsecPolicyV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#auth_algorithm VpnaasIpsecPolicyV2#auth_algorithm} + */ + readonly authAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#description VpnaasIpsecPolicyV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#encapsulation_mode VpnaasIpsecPolicyV2#encapsulation_mode} + */ + readonly encapsulationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#encryption_algorithm VpnaasIpsecPolicyV2#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#id VpnaasIpsecPolicyV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#name VpnaasIpsecPolicyV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#pfs VpnaasIpsecPolicyV2#pfs} + */ + readonly pfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#region VpnaasIpsecPolicyV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#tenant_id VpnaasIpsecPolicyV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#transform_protocol VpnaasIpsecPolicyV2#transform_protocol} + */ + readonly transformProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#value_specs VpnaasIpsecPolicyV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * lifetime block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#lifetime VpnaasIpsecPolicyV2#lifetime} + */ + readonly lifetime?: VpnaasIpsecPolicyV2Lifetime[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#timeouts VpnaasIpsecPolicyV2#timeouts} + */ + readonly timeouts?: VpnaasIpsecPolicyV2Timeouts; +} +export interface VpnaasIpsecPolicyV2Lifetime { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#units VpnaasIpsecPolicyV2#units} + */ + readonly units?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#value VpnaasIpsecPolicyV2#value} + */ + readonly value?: number; +} + +export function vpnaasIpsecPolicyV2LifetimeToTerraform(struct?: VpnaasIpsecPolicyV2Lifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + units: cdktf.stringToTerraform(struct!.units), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function vpnaasIpsecPolicyV2LifetimeToHclTerraform(struct?: VpnaasIpsecPolicyV2Lifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + units: { + value: cdktf.stringToHclTerraform(struct!.units), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIpsecPolicyV2LifetimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnaasIpsecPolicyV2Lifetime | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._units !== undefined) { + hasAnyValues = true; + internalValueResult.units = this._units; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIpsecPolicyV2Lifetime | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._units = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._units = value.units; + this._value = value.value; + } + } + + // units - computed: true, optional: true, required: false + private _units?: string; + public get units() { + return this.getStringAttribute('units'); + } + public set units(value: string) { + this._units = value; + } + public resetUnits() { + this._units = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitsInput() { + return this._units; + } + + // value - computed: true, optional: true, required: false + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VpnaasIpsecPolicyV2LifetimeList extends cdktf.ComplexList { + public internalValue? : VpnaasIpsecPolicyV2Lifetime[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnaasIpsecPolicyV2LifetimeOutputReference { + return new VpnaasIpsecPolicyV2LifetimeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnaasIpsecPolicyV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#create VpnaasIpsecPolicyV2#create} + */ + readonly create?: string; +} + +export function vpnaasIpsecPolicyV2TimeoutsToTerraform(struct?: VpnaasIpsecPolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function vpnaasIpsecPolicyV2TimeoutsToHclTerraform(struct?: VpnaasIpsecPolicyV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIpsecPolicyV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasIpsecPolicyV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIpsecPolicyV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2 huaweicloud_vpnaas_ipsec_policy_v2} +*/ +export class VpnaasIpsecPolicyV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_ipsec_policy_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasIpsecPolicyV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasIpsecPolicyV2 to import + * @param importFromId The id of the existing VpnaasIpsecPolicyV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasIpsecPolicyV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_ipsec_policy_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy_v2 huaweicloud_vpnaas_ipsec_policy_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasIpsecPolicyV2Config = {} + */ + public constructor(scope: Construct, id: string, config: VpnaasIpsecPolicyV2Config = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_ipsec_policy_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authAlgorithm = config.authAlgorithm; + this._description = config.description; + this._encapsulationMode = config.encapsulationMode; + this._encryptionAlgorithm = config.encryptionAlgorithm; + this._id = config.id; + this._name = config.name; + this._pfs = config.pfs; + this._region = config.region; + this._tenantId = config.tenantId; + this._transformProtocol = config.transformProtocol; + this._valueSpecs = config.valueSpecs; + this._lifetime.internalValue = config.lifetime; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_algorithm - computed: true, optional: true, required: false + private _authAlgorithm?: string; + public get authAlgorithm() { + return this.getStringAttribute('auth_algorithm'); + } + public set authAlgorithm(value: string) { + this._authAlgorithm = value; + } + public resetAuthAlgorithm() { + this._authAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get authAlgorithmInput() { + return this._authAlgorithm; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encapsulation_mode - computed: true, optional: true, required: false + private _encapsulationMode?: string; + public get encapsulationMode() { + return this.getStringAttribute('encapsulation_mode'); + } + public set encapsulationMode(value: string) { + this._encapsulationMode = value; + } + public resetEncapsulationMode() { + this._encapsulationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get encapsulationModeInput() { + return this._encapsulationMode; + } + + // encryption_algorithm - computed: true, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pfs - computed: true, optional: true, required: false + private _pfs?: string; + public get pfs() { + return this.getStringAttribute('pfs'); + } + public set pfs(value: string) { + this._pfs = value; + } + public resetPfs() { + this._pfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get pfsInput() { + return this._pfs; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // transform_protocol - computed: true, optional: true, required: false + private _transformProtocol?: string; + public get transformProtocol() { + return this.getStringAttribute('transform_protocol'); + } + public set transformProtocol(value: string) { + this._transformProtocol = value; + } + public resetTransformProtocol() { + this._transformProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get transformProtocolInput() { + return this._transformProtocol; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // lifetime - computed: false, optional: true, required: false + private _lifetime = new VpnaasIpsecPolicyV2LifetimeList(this, "lifetime", true); + public get lifetime() { + return this._lifetime; + } + public putLifetime(value: VpnaasIpsecPolicyV2Lifetime[] | cdktf.IResolvable) { + this._lifetime.internalValue = value; + } + public resetLifetime() { + this._lifetime.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifetimeInput() { + return this._lifetime.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasIpsecPolicyV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasIpsecPolicyV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_algorithm: cdktf.stringToTerraform(this._authAlgorithm), + description: cdktf.stringToTerraform(this._description), + encapsulation_mode: cdktf.stringToTerraform(this._encapsulationMode), + encryption_algorithm: cdktf.stringToTerraform(this._encryptionAlgorithm), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pfs: cdktf.stringToTerraform(this._pfs), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + transform_protocol: cdktf.stringToTerraform(this._transformProtocol), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + lifetime: cdktf.listMapper(vpnaasIpsecPolicyV2LifetimeToTerraform, true)(this._lifetime.internalValue), + timeouts: vpnaasIpsecPolicyV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_algorithm: { + value: cdktf.stringToHclTerraform(this._authAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encapsulation_mode: { + value: cdktf.stringToHclTerraform(this._encapsulationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(this._encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pfs: { + value: cdktf.stringToHclTerraform(this._pfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transform_protocol: { + value: cdktf.stringToHclTerraform(this._transformProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lifetime: { + value: cdktf.listMapperHcl(vpnaasIpsecPolicyV2LifetimeToHclTerraform, true)(this._lifetime.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnaasIpsecPolicyV2LifetimeList", + }, + timeouts: { + value: vpnaasIpsecPolicyV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasIpsecPolicyV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/README.md b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/README.md new file mode 100644 index 00000000..3e435f29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_ipsec_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_ipsec_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy). diff --git a/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/index.ts b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/index.ts new file mode 100644 index 00000000..874b1167 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-ipsec-policy/index.ts @@ -0,0 +1,699 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasIpsecPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#auth_algorithm VpnaasIpsecPolicy#auth_algorithm} + */ + readonly authAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#description VpnaasIpsecPolicy#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#encapsulation_mode VpnaasIpsecPolicy#encapsulation_mode} + */ + readonly encapsulationMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#encryption_algorithm VpnaasIpsecPolicy#encryption_algorithm} + */ + readonly encryptionAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#id VpnaasIpsecPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#name VpnaasIpsecPolicy#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#pfs VpnaasIpsecPolicy#pfs} + */ + readonly pfs?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#region VpnaasIpsecPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#tenant_id VpnaasIpsecPolicy#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#transform_protocol VpnaasIpsecPolicy#transform_protocol} + */ + readonly transformProtocol?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#value_specs VpnaasIpsecPolicy#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * lifetime block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#lifetime VpnaasIpsecPolicy#lifetime} + */ + readonly lifetime?: VpnaasIpsecPolicyLifetime[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#timeouts VpnaasIpsecPolicy#timeouts} + */ + readonly timeouts?: VpnaasIpsecPolicyTimeouts; +} +export interface VpnaasIpsecPolicyLifetime { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#units VpnaasIpsecPolicy#units} + */ + readonly units?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#value VpnaasIpsecPolicy#value} + */ + readonly value?: number; +} + +export function vpnaasIpsecPolicyLifetimeToTerraform(struct?: VpnaasIpsecPolicyLifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + units: cdktf.stringToTerraform(struct!.units), + value: cdktf.numberToTerraform(struct!.value), + } +} + + +export function vpnaasIpsecPolicyLifetimeToHclTerraform(struct?: VpnaasIpsecPolicyLifetime | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + units: { + value: cdktf.stringToHclTerraform(struct!.units), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value: { + value: cdktf.numberToHclTerraform(struct!.value), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIpsecPolicyLifetimeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnaasIpsecPolicyLifetime | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._units !== undefined) { + hasAnyValues = true; + internalValueResult.units = this._units; + } + if (this._value !== undefined) { + hasAnyValues = true; + internalValueResult.value = this._value; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIpsecPolicyLifetime | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._units = undefined; + this._value = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._units = value.units; + this._value = value.value; + } + } + + // units - computed: true, optional: true, required: false + private _units?: string; + public get units() { + return this.getStringAttribute('units'); + } + public set units(value: string) { + this._units = value; + } + public resetUnits() { + this._units = undefined; + } + // Temporarily expose input value. Use with caution. + public get unitsInput() { + return this._units; + } + + // value - computed: true, optional: true, required: false + private _value?: number; + public get value() { + return this.getNumberAttribute('value'); + } + public set value(value: number) { + this._value = value; + } + public resetValue() { + this._value = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueInput() { + return this._value; + } +} + +export class VpnaasIpsecPolicyLifetimeList extends cdktf.ComplexList { + public internalValue? : VpnaasIpsecPolicyLifetime[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnaasIpsecPolicyLifetimeOutputReference { + return new VpnaasIpsecPolicyLifetimeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnaasIpsecPolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#create VpnaasIpsecPolicy#create} + */ + readonly create?: string; +} + +export function vpnaasIpsecPolicyTimeoutsToTerraform(struct?: VpnaasIpsecPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + } +} + + +export function vpnaasIpsecPolicyTimeoutsToHclTerraform(struct?: VpnaasIpsecPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasIpsecPolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasIpsecPolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasIpsecPolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy huaweicloud_vpnaas_ipsec_policy} +*/ +export class VpnaasIpsecPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_ipsec_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasIpsecPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasIpsecPolicy to import + * @param importFromId The id of the existing VpnaasIpsecPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasIpsecPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_ipsec_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_ipsec_policy huaweicloud_vpnaas_ipsec_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasIpsecPolicyConfig = {} + */ + public constructor(scope: Construct, id: string, config: VpnaasIpsecPolicyConfig = {}) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_ipsec_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._authAlgorithm = config.authAlgorithm; + this._description = config.description; + this._encapsulationMode = config.encapsulationMode; + this._encryptionAlgorithm = config.encryptionAlgorithm; + this._id = config.id; + this._name = config.name; + this._pfs = config.pfs; + this._region = config.region; + this._tenantId = config.tenantId; + this._transformProtocol = config.transformProtocol; + this._valueSpecs = config.valueSpecs; + this._lifetime.internalValue = config.lifetime; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auth_algorithm - computed: true, optional: true, required: false + private _authAlgorithm?: string; + public get authAlgorithm() { + return this.getStringAttribute('auth_algorithm'); + } + public set authAlgorithm(value: string) { + this._authAlgorithm = value; + } + public resetAuthAlgorithm() { + this._authAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get authAlgorithmInput() { + return this._authAlgorithm; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // encapsulation_mode - computed: true, optional: true, required: false + private _encapsulationMode?: string; + public get encapsulationMode() { + return this.getStringAttribute('encapsulation_mode'); + } + public set encapsulationMode(value: string) { + this._encapsulationMode = value; + } + public resetEncapsulationMode() { + this._encapsulationMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get encapsulationModeInput() { + return this._encapsulationMode; + } + + // encryption_algorithm - computed: true, optional: true, required: false + private _encryptionAlgorithm?: string; + public get encryptionAlgorithm() { + return this.getStringAttribute('encryption_algorithm'); + } + public set encryptionAlgorithm(value: string) { + this._encryptionAlgorithm = value; + } + public resetEncryptionAlgorithm() { + this._encryptionAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get encryptionAlgorithmInput() { + return this._encryptionAlgorithm; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // pfs - computed: true, optional: true, required: false + private _pfs?: string; + public get pfs() { + return this.getStringAttribute('pfs'); + } + public set pfs(value: string) { + this._pfs = value; + } + public resetPfs() { + this._pfs = undefined; + } + // Temporarily expose input value. Use with caution. + public get pfsInput() { + return this._pfs; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // transform_protocol - computed: true, optional: true, required: false + private _transformProtocol?: string; + public get transformProtocol() { + return this.getStringAttribute('transform_protocol'); + } + public set transformProtocol(value: string) { + this._transformProtocol = value; + } + public resetTransformProtocol() { + this._transformProtocol = undefined; + } + // Temporarily expose input value. Use with caution. + public get transformProtocolInput() { + return this._transformProtocol; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // lifetime - computed: false, optional: true, required: false + private _lifetime = new VpnaasIpsecPolicyLifetimeList(this, "lifetime", true); + public get lifetime() { + return this._lifetime; + } + public putLifetime(value: VpnaasIpsecPolicyLifetime[] | cdktf.IResolvable) { + this._lifetime.internalValue = value; + } + public resetLifetime() { + this._lifetime.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get lifetimeInput() { + return this._lifetime.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasIpsecPolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasIpsecPolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auth_algorithm: cdktf.stringToTerraform(this._authAlgorithm), + description: cdktf.stringToTerraform(this._description), + encapsulation_mode: cdktf.stringToTerraform(this._encapsulationMode), + encryption_algorithm: cdktf.stringToTerraform(this._encryptionAlgorithm), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + pfs: cdktf.stringToTerraform(this._pfs), + region: cdktf.stringToTerraform(this._region), + tenant_id: cdktf.stringToTerraform(this._tenantId), + transform_protocol: cdktf.stringToTerraform(this._transformProtocol), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + lifetime: cdktf.listMapper(vpnaasIpsecPolicyLifetimeToTerraform, true)(this._lifetime.internalValue), + timeouts: vpnaasIpsecPolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auth_algorithm: { + value: cdktf.stringToHclTerraform(this._authAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encapsulation_mode: { + value: cdktf.stringToHclTerraform(this._encapsulationMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + encryption_algorithm: { + value: cdktf.stringToHclTerraform(this._encryptionAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pfs: { + value: cdktf.stringToHclTerraform(this._pfs), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + transform_protocol: { + value: cdktf.stringToHclTerraform(this._transformProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + lifetime: { + value: cdktf.listMapperHcl(vpnaasIpsecPolicyLifetimeToHclTerraform, true)(this._lifetime.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnaasIpsecPolicyLifetimeList", + }, + timeouts: { + value: vpnaasIpsecPolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasIpsecPolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-service-v2/README.md b/src/constructs/providers/huaweicloud/vpnaas-service-v2/README.md new file mode 100644 index 00000000..440baa4d --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-service-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_service_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_service_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2). diff --git a/src/constructs/providers/huaweicloud/vpnaas-service-v2/index.ts b/src/constructs/providers/huaweicloud/vpnaas-service-v2/index.ts new file mode 100644 index 00000000..ea2ba513 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-service-v2/index.ts @@ -0,0 +1,542 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasServiceV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#admin_state_up VpnaasServiceV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#description VpnaasServiceV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#id VpnaasServiceV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#name VpnaasServiceV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#region VpnaasServiceV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#router_id VpnaasServiceV2#router_id} + */ + readonly routerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#subnet_id VpnaasServiceV2#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#tenant_id VpnaasServiceV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#value_specs VpnaasServiceV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#timeouts VpnaasServiceV2#timeouts} + */ + readonly timeouts?: VpnaasServiceV2Timeouts; +} +export interface VpnaasServiceV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#create VpnaasServiceV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#delete VpnaasServiceV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#update VpnaasServiceV2#update} + */ + readonly update?: string; +} + +export function vpnaasServiceV2TimeoutsToTerraform(struct?: VpnaasServiceV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnaasServiceV2TimeoutsToHclTerraform(struct?: VpnaasServiceV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasServiceV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasServiceV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasServiceV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2 huaweicloud_vpnaas_service_v2} +*/ +export class VpnaasServiceV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_service_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasServiceV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasServiceV2 to import + * @param importFromId The id of the existing VpnaasServiceV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasServiceV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_service_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service_v2 huaweicloud_vpnaas_service_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasServiceV2Config + */ + public constructor(scope: Construct, id: string, config: VpnaasServiceV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_service_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._routerId = config.routerId; + this._subnetId = config.subnetId; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // external_v4_ip - computed: true, optional: false, required: false + public get externalV4Ip() { + return this.getStringAttribute('external_v4_ip'); + } + + // external_v6_ip - computed: true, optional: false, required: false + public get externalV6Ip() { + return this.getStringAttribute('external_v6_ip'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // router_id - computed: false, optional: false, required: true + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasServiceV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasServiceV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + router_id: cdktf.stringToTerraform(this._routerId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: vpnaasServiceV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_id: { + value: cdktf.stringToHclTerraform(this._routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: vpnaasServiceV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasServiceV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-service/README.md b/src/constructs/providers/huaweicloud/vpnaas-service/README.md new file mode 100644 index 00000000..d0efc9e5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-service/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_service` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_service`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service). diff --git a/src/constructs/providers/huaweicloud/vpnaas-service/index.ts b/src/constructs/providers/huaweicloud/vpnaas-service/index.ts new file mode 100644 index 00000000..9166dc91 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-service/index.ts @@ -0,0 +1,542 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasServiceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#admin_state_up VpnaasService#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#description VpnaasService#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#id VpnaasService#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#name VpnaasService#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#region VpnaasService#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#router_id VpnaasService#router_id} + */ + readonly routerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#subnet_id VpnaasService#subnet_id} + */ + readonly subnetId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#tenant_id VpnaasService#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#value_specs VpnaasService#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#timeouts VpnaasService#timeouts} + */ + readonly timeouts?: VpnaasServiceTimeouts; +} +export interface VpnaasServiceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#create VpnaasService#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#delete VpnaasService#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#update VpnaasService#update} + */ + readonly update?: string; +} + +export function vpnaasServiceTimeoutsToTerraform(struct?: VpnaasServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnaasServiceTimeoutsToHclTerraform(struct?: VpnaasServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasServiceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasServiceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasServiceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service huaweicloud_vpnaas_service} +*/ +export class VpnaasService extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_service"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasService resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasService to import + * @param importFromId The id of the existing VpnaasService that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasService to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_service", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_service huaweicloud_vpnaas_service} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasServiceConfig + */ + public constructor(scope: Construct, id: string, config: VpnaasServiceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_service', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._routerId = config.routerId; + this._subnetId = config.subnetId; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // external_v4_ip - computed: true, optional: false, required: false + public get externalV4Ip() { + return this.getStringAttribute('external_v4_ip'); + } + + // external_v6_ip - computed: true, optional: false, required: false + public get externalV6Ip() { + return this.getStringAttribute('external_v6_ip'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // router_id - computed: false, optional: false, required: true + private _routerId?: string; + public get routerId() { + return this.getStringAttribute('router_id'); + } + public set routerId(value: string) { + this._routerId = value; + } + // Temporarily expose input value. Use with caution. + public get routerIdInput() { + return this._routerId; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // subnet_id - computed: false, optional: true, required: false + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + public resetSubnetId() { + this._subnetId = undefined; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasServiceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasServiceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + router_id: cdktf.stringToTerraform(this._routerId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + timeouts: vpnaasServiceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + router_id: { + value: cdktf.stringToHclTerraform(this._routerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + timeouts: { + value: vpnaasServiceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasServiceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/README.md b/src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/README.md new file mode 100644 index 00000000..9e566e85 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_site_connection_v2` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_site_connection_v2`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2). diff --git a/src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/index.ts b/src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/index.ts new file mode 100644 index 00000000..0cfb4bdf --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-site-connection-v2/index.ts @@ -0,0 +1,1032 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2 +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasSiteConnectionV2Config extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#admin_state_up VpnaasSiteConnectionV2#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#description VpnaasSiteConnectionV2#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#id VpnaasSiteConnectionV2#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#ikepolicy_id VpnaasSiteConnectionV2#ikepolicy_id} + */ + readonly ikepolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#initiator VpnaasSiteConnectionV2#initiator} + */ + readonly initiator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#ipsecpolicy_id VpnaasSiteConnectionV2#ipsecpolicy_id} + */ + readonly ipsecpolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#local_ep_group_id VpnaasSiteConnectionV2#local_ep_group_id} + */ + readonly localEpGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#local_id VpnaasSiteConnectionV2#local_id} + */ + readonly localId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#mtu VpnaasSiteConnectionV2#mtu} + */ + readonly mtu?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#name VpnaasSiteConnectionV2#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#peer_address VpnaasSiteConnectionV2#peer_address} + */ + readonly peerAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#peer_cidrs VpnaasSiteConnectionV2#peer_cidrs} + */ + readonly peerCidrs?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#peer_ep_group_id VpnaasSiteConnectionV2#peer_ep_group_id} + */ + readonly peerEpGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#peer_id VpnaasSiteConnectionV2#peer_id} + */ + readonly peerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#psk VpnaasSiteConnectionV2#psk} + */ + readonly psk: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#region VpnaasSiteConnectionV2#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#tags VpnaasSiteConnectionV2#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#tenant_id VpnaasSiteConnectionV2#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#value_specs VpnaasSiteConnectionV2#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#vpnservice_id VpnaasSiteConnectionV2#vpnservice_id} + */ + readonly vpnserviceId: string; + /** + * dpd block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#dpd VpnaasSiteConnectionV2#dpd} + */ + readonly dpd?: VpnaasSiteConnectionV2Dpd[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#timeouts VpnaasSiteConnectionV2#timeouts} + */ + readonly timeouts?: VpnaasSiteConnectionV2Timeouts; +} +export interface VpnaasSiteConnectionV2Dpd { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#action VpnaasSiteConnectionV2#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#interval VpnaasSiteConnectionV2#interval} + */ + readonly interval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#timeout VpnaasSiteConnectionV2#timeout} + */ + readonly timeout?: number; +} + +export function vpnaasSiteConnectionV2DpdToTerraform(struct?: VpnaasSiteConnectionV2Dpd | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + interval: cdktf.numberToTerraform(struct!.interval), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function vpnaasSiteConnectionV2DpdToHclTerraform(struct?: VpnaasSiteConnectionV2Dpd | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasSiteConnectionV2DpdOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnaasSiteConnectionV2Dpd | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasSiteConnectionV2Dpd | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._interval = undefined; + this._timeout = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._interval = value.interval; + this._timeout = value.timeout; + } + } + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // interval - computed: true, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} + +export class VpnaasSiteConnectionV2DpdList extends cdktf.ComplexList { + public internalValue? : VpnaasSiteConnectionV2Dpd[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnaasSiteConnectionV2DpdOutputReference { + return new VpnaasSiteConnectionV2DpdOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnaasSiteConnectionV2Timeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#create VpnaasSiteConnectionV2#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#delete VpnaasSiteConnectionV2#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#update VpnaasSiteConnectionV2#update} + */ + readonly update?: string; +} + +export function vpnaasSiteConnectionV2TimeoutsToTerraform(struct?: VpnaasSiteConnectionV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnaasSiteConnectionV2TimeoutsToHclTerraform(struct?: VpnaasSiteConnectionV2Timeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasSiteConnectionV2TimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasSiteConnectionV2Timeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasSiteConnectionV2Timeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2 huaweicloud_vpnaas_site_connection_v2} +*/ +export class VpnaasSiteConnectionV2 extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_site_connection_v2"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasSiteConnectionV2 resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasSiteConnectionV2 to import + * @param importFromId The id of the existing VpnaasSiteConnectionV2 that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasSiteConnectionV2 to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_site_connection_v2", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection_v2 huaweicloud_vpnaas_site_connection_v2} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasSiteConnectionV2Config + */ + public constructor(scope: Construct, id: string, config: VpnaasSiteConnectionV2Config) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_site_connection_v2', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._ikepolicyId = config.ikepolicyId; + this._initiator = config.initiator; + this._ipsecpolicyId = config.ipsecpolicyId; + this._localEpGroupId = config.localEpGroupId; + this._localId = config.localId; + this._mtu = config.mtu; + this._name = config.name; + this._peerAddress = config.peerAddress; + this._peerCidrs = config.peerCidrs; + this._peerEpGroupId = config.peerEpGroupId; + this._peerId = config.peerId; + this._psk = config.psk; + this._region = config.region; + this._tags = config.tags; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._vpnserviceId = config.vpnserviceId; + this._dpd.internalValue = config.dpd; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ikepolicy_id - computed: false, optional: false, required: true + private _ikepolicyId?: string; + public get ikepolicyId() { + return this.getStringAttribute('ikepolicy_id'); + } + public set ikepolicyId(value: string) { + this._ikepolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get ikepolicyIdInput() { + return this._ikepolicyId; + } + + // initiator - computed: true, optional: true, required: false + private _initiator?: string; + public get initiator() { + return this.getStringAttribute('initiator'); + } + public set initiator(value: string) { + this._initiator = value; + } + public resetInitiator() { + this._initiator = undefined; + } + // Temporarily expose input value. Use with caution. + public get initiatorInput() { + return this._initiator; + } + + // ipsecpolicy_id - computed: false, optional: false, required: true + private _ipsecpolicyId?: string; + public get ipsecpolicyId() { + return this.getStringAttribute('ipsecpolicy_id'); + } + public set ipsecpolicyId(value: string) { + this._ipsecpolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get ipsecpolicyIdInput() { + return this._ipsecpolicyId; + } + + // local_ep_group_id - computed: false, optional: true, required: false + private _localEpGroupId?: string; + public get localEpGroupId() { + return this.getStringAttribute('local_ep_group_id'); + } + public set localEpGroupId(value: string) { + this._localEpGroupId = value; + } + public resetLocalEpGroupId() { + this._localEpGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get localEpGroupIdInput() { + return this._localEpGroupId; + } + + // local_id - computed: false, optional: true, required: false + private _localId?: string; + public get localId() { + return this.getStringAttribute('local_id'); + } + public set localId(value: string) { + this._localId = value; + } + public resetLocalId() { + this._localId = undefined; + } + // Temporarily expose input value. Use with caution. + public get localIdInput() { + return this._localId; + } + + // mtu - computed: true, optional: true, required: false + private _mtu?: number; + public get mtu() { + return this.getNumberAttribute('mtu'); + } + public set mtu(value: number) { + this._mtu = value; + } + public resetMtu() { + this._mtu = undefined; + } + // Temporarily expose input value. Use with caution. + public get mtuInput() { + return this._mtu; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_address - computed: false, optional: false, required: true + private _peerAddress?: string; + public get peerAddress() { + return this.getStringAttribute('peer_address'); + } + public set peerAddress(value: string) { + this._peerAddress = value; + } + // Temporarily expose input value. Use with caution. + public get peerAddressInput() { + return this._peerAddress; + } + + // peer_cidrs - computed: false, optional: true, required: false + private _peerCidrs?: string[]; + public get peerCidrs() { + return this.getListAttribute('peer_cidrs'); + } + public set peerCidrs(value: string[]) { + this._peerCidrs = value; + } + public resetPeerCidrs() { + this._peerCidrs = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerCidrsInput() { + return this._peerCidrs; + } + + // peer_ep_group_id - computed: false, optional: true, required: false + private _peerEpGroupId?: string; + public get peerEpGroupId() { + return this.getStringAttribute('peer_ep_group_id'); + } + public set peerEpGroupId(value: string) { + this._peerEpGroupId = value; + } + public resetPeerEpGroupId() { + this._peerEpGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerEpGroupIdInput() { + return this._peerEpGroupId; + } + + // peer_id - computed: false, optional: false, required: true + private _peerId?: string; + public get peerId() { + return this.getStringAttribute('peer_id'); + } + public set peerId(value: string) { + this._peerId = value; + } + // Temporarily expose input value. Use with caution. + public get peerIdInput() { + return this._peerId; + } + + // psk - computed: false, optional: false, required: true + private _psk?: string; + public get psk() { + return this.getStringAttribute('psk'); + } + public set psk(value: string) { + this._psk = value; + } + // Temporarily expose input value. Use with caution. + public get pskInput() { + return this._psk; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // vpnservice_id - computed: false, optional: false, required: true + private _vpnserviceId?: string; + public get vpnserviceId() { + return this.getStringAttribute('vpnservice_id'); + } + public set vpnserviceId(value: string) { + this._vpnserviceId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnserviceIdInput() { + return this._vpnserviceId; + } + + // dpd - computed: false, optional: true, required: false + private _dpd = new VpnaasSiteConnectionV2DpdList(this, "dpd", true); + public get dpd() { + return this._dpd; + } + public putDpd(value: VpnaasSiteConnectionV2Dpd[] | cdktf.IResolvable) { + this._dpd.internalValue = value; + } + public resetDpd() { + this._dpd.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dpdInput() { + return this._dpd.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasSiteConnectionV2TimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasSiteConnectionV2Timeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ikepolicy_id: cdktf.stringToTerraform(this._ikepolicyId), + initiator: cdktf.stringToTerraform(this._initiator), + ipsecpolicy_id: cdktf.stringToTerraform(this._ipsecpolicyId), + local_ep_group_id: cdktf.stringToTerraform(this._localEpGroupId), + local_id: cdktf.stringToTerraform(this._localId), + mtu: cdktf.numberToTerraform(this._mtu), + name: cdktf.stringToTerraform(this._name), + peer_address: cdktf.stringToTerraform(this._peerAddress), + peer_cidrs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._peerCidrs), + peer_ep_group_id: cdktf.stringToTerraform(this._peerEpGroupId), + peer_id: cdktf.stringToTerraform(this._peerId), + psk: cdktf.stringToTerraform(this._psk), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + vpnservice_id: cdktf.stringToTerraform(this._vpnserviceId), + dpd: cdktf.listMapper(vpnaasSiteConnectionV2DpdToTerraform, true)(this._dpd.internalValue), + timeouts: vpnaasSiteConnectionV2TimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ikepolicy_id: { + value: cdktf.stringToHclTerraform(this._ikepolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initiator: { + value: cdktf.stringToHclTerraform(this._initiator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipsecpolicy_id: { + value: cdktf.stringToHclTerraform(this._ipsecpolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_ep_group_id: { + value: cdktf.stringToHclTerraform(this._localEpGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_id: { + value: cdktf.stringToHclTerraform(this._localId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mtu: { + value: cdktf.numberToHclTerraform(this._mtu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_address: { + value: cdktf.stringToHclTerraform(this._peerAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_cidrs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._peerCidrs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + peer_ep_group_id: { + value: cdktf.stringToHclTerraform(this._peerEpGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_id: { + value: cdktf.stringToHclTerraform(this._peerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + psk: { + value: cdktf.stringToHclTerraform(this._psk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpnservice_id: { + value: cdktf.stringToHclTerraform(this._vpnserviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dpd: { + value: cdktf.listMapperHcl(vpnaasSiteConnectionV2DpdToHclTerraform, true)(this._dpd.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnaasSiteConnectionV2DpdList", + }, + timeouts: { + value: vpnaasSiteConnectionV2TimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasSiteConnectionV2Timeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/vpnaas-site-connection/README.md b/src/constructs/providers/huaweicloud/vpnaas-site-connection/README.md new file mode 100644 index 00000000..8a16dd58 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-site-connection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_vpnaas_site_connection` + +Refer to the Terraform Registry for docs: [`huaweicloud_vpnaas_site_connection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection). diff --git a/src/constructs/providers/huaweicloud/vpnaas-site-connection/index.ts b/src/constructs/providers/huaweicloud/vpnaas-site-connection/index.ts new file mode 100644 index 00000000..fa9a04a3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/vpnaas-site-connection/index.ts @@ -0,0 +1,1032 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface VpnaasSiteConnectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#admin_state_up VpnaasSiteConnection#admin_state_up} + */ + readonly adminStateUp?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#description VpnaasSiteConnection#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#id VpnaasSiteConnection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#ikepolicy_id VpnaasSiteConnection#ikepolicy_id} + */ + readonly ikepolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#initiator VpnaasSiteConnection#initiator} + */ + readonly initiator?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#ipsecpolicy_id VpnaasSiteConnection#ipsecpolicy_id} + */ + readonly ipsecpolicyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#local_ep_group_id VpnaasSiteConnection#local_ep_group_id} + */ + readonly localEpGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#local_id VpnaasSiteConnection#local_id} + */ + readonly localId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#mtu VpnaasSiteConnection#mtu} + */ + readonly mtu?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#name VpnaasSiteConnection#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#peer_address VpnaasSiteConnection#peer_address} + */ + readonly peerAddress: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#peer_cidrs VpnaasSiteConnection#peer_cidrs} + */ + readonly peerCidrs?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#peer_ep_group_id VpnaasSiteConnection#peer_ep_group_id} + */ + readonly peerEpGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#peer_id VpnaasSiteConnection#peer_id} + */ + readonly peerId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#psk VpnaasSiteConnection#psk} + */ + readonly psk: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#region VpnaasSiteConnection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#tags VpnaasSiteConnection#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#tenant_id VpnaasSiteConnection#tenant_id} + */ + readonly tenantId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#value_specs VpnaasSiteConnection#value_specs} + */ + readonly valueSpecs?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#vpnservice_id VpnaasSiteConnection#vpnservice_id} + */ + readonly vpnserviceId: string; + /** + * dpd block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#dpd VpnaasSiteConnection#dpd} + */ + readonly dpd?: VpnaasSiteConnectionDpd[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#timeouts VpnaasSiteConnection#timeouts} + */ + readonly timeouts?: VpnaasSiteConnectionTimeouts; +} +export interface VpnaasSiteConnectionDpd { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#action VpnaasSiteConnection#action} + */ + readonly action?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#interval VpnaasSiteConnection#interval} + */ + readonly interval?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#timeout VpnaasSiteConnection#timeout} + */ + readonly timeout?: number; +} + +export function vpnaasSiteConnectionDpdToTerraform(struct?: VpnaasSiteConnectionDpd | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + action: cdktf.stringToTerraform(struct!.action), + interval: cdktf.numberToTerraform(struct!.interval), + timeout: cdktf.numberToTerraform(struct!.timeout), + } +} + + +export function vpnaasSiteConnectionDpdToHclTerraform(struct?: VpnaasSiteConnectionDpd | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + action: { + value: cdktf.stringToHclTerraform(struct!.action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + interval: { + value: cdktf.numberToHclTerraform(struct!.interval), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeout: { + value: cdktf.numberToHclTerraform(struct!.timeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasSiteConnectionDpdOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): VpnaasSiteConnectionDpd | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._action !== undefined) { + hasAnyValues = true; + internalValueResult.action = this._action; + } + if (this._interval !== undefined) { + hasAnyValues = true; + internalValueResult.interval = this._interval; + } + if (this._timeout !== undefined) { + hasAnyValues = true; + internalValueResult.timeout = this._timeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasSiteConnectionDpd | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._action = undefined; + this._interval = undefined; + this._timeout = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._action = value.action; + this._interval = value.interval; + this._timeout = value.timeout; + } + } + + // action - computed: true, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // interval - computed: true, optional: true, required: false + private _interval?: number; + public get interval() { + return this.getNumberAttribute('interval'); + } + public set interval(value: number) { + this._interval = value; + } + public resetInterval() { + this._interval = undefined; + } + // Temporarily expose input value. Use with caution. + public get intervalInput() { + return this._interval; + } + + // timeout - computed: true, optional: true, required: false + private _timeout?: number; + public get timeout() { + return this.getNumberAttribute('timeout'); + } + public set timeout(value: number) { + this._timeout = value; + } + public resetTimeout() { + this._timeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutInput() { + return this._timeout; + } +} + +export class VpnaasSiteConnectionDpdList extends cdktf.ComplexList { + public internalValue? : VpnaasSiteConnectionDpd[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): VpnaasSiteConnectionDpdOutputReference { + return new VpnaasSiteConnectionDpdOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface VpnaasSiteConnectionTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#create VpnaasSiteConnection#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#delete VpnaasSiteConnection#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#update VpnaasSiteConnection#update} + */ + readonly update?: string; +} + +export function vpnaasSiteConnectionTimeoutsToTerraform(struct?: VpnaasSiteConnectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function vpnaasSiteConnectionTimeoutsToHclTerraform(struct?: VpnaasSiteConnectionTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class VpnaasSiteConnectionTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): VpnaasSiteConnectionTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: VpnaasSiteConnectionTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection huaweicloud_vpnaas_site_connection} +*/ +export class VpnaasSiteConnection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_vpnaas_site_connection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a VpnaasSiteConnection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the VpnaasSiteConnection to import + * @param importFromId The id of the existing VpnaasSiteConnection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the VpnaasSiteConnection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_vpnaas_site_connection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/vpnaas_site_connection huaweicloud_vpnaas_site_connection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options VpnaasSiteConnectionConfig + */ + public constructor(scope: Construct, id: string, config: VpnaasSiteConnectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_vpnaas_site_connection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._adminStateUp = config.adminStateUp; + this._description = config.description; + this._id = config.id; + this._ikepolicyId = config.ikepolicyId; + this._initiator = config.initiator; + this._ipsecpolicyId = config.ipsecpolicyId; + this._localEpGroupId = config.localEpGroupId; + this._localId = config.localId; + this._mtu = config.mtu; + this._name = config.name; + this._peerAddress = config.peerAddress; + this._peerCidrs = config.peerCidrs; + this._peerEpGroupId = config.peerEpGroupId; + this._peerId = config.peerId; + this._psk = config.psk; + this._region = config.region; + this._tags = config.tags; + this._tenantId = config.tenantId; + this._valueSpecs = config.valueSpecs; + this._vpnserviceId = config.vpnserviceId; + this._dpd.internalValue = config.dpd; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // admin_state_up - computed: false, optional: true, required: false + private _adminStateUp?: boolean | cdktf.IResolvable; + public get adminStateUp() { + return this.getBooleanAttribute('admin_state_up'); + } + public set adminStateUp(value: boolean | cdktf.IResolvable) { + this._adminStateUp = value; + } + public resetAdminStateUp() { + this._adminStateUp = undefined; + } + // Temporarily expose input value. Use with caution. + public get adminStateUpInput() { + return this._adminStateUp; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ikepolicy_id - computed: false, optional: false, required: true + private _ikepolicyId?: string; + public get ikepolicyId() { + return this.getStringAttribute('ikepolicy_id'); + } + public set ikepolicyId(value: string) { + this._ikepolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get ikepolicyIdInput() { + return this._ikepolicyId; + } + + // initiator - computed: true, optional: true, required: false + private _initiator?: string; + public get initiator() { + return this.getStringAttribute('initiator'); + } + public set initiator(value: string) { + this._initiator = value; + } + public resetInitiator() { + this._initiator = undefined; + } + // Temporarily expose input value. Use with caution. + public get initiatorInput() { + return this._initiator; + } + + // ipsecpolicy_id - computed: false, optional: false, required: true + private _ipsecpolicyId?: string; + public get ipsecpolicyId() { + return this.getStringAttribute('ipsecpolicy_id'); + } + public set ipsecpolicyId(value: string) { + this._ipsecpolicyId = value; + } + // Temporarily expose input value. Use with caution. + public get ipsecpolicyIdInput() { + return this._ipsecpolicyId; + } + + // local_ep_group_id - computed: false, optional: true, required: false + private _localEpGroupId?: string; + public get localEpGroupId() { + return this.getStringAttribute('local_ep_group_id'); + } + public set localEpGroupId(value: string) { + this._localEpGroupId = value; + } + public resetLocalEpGroupId() { + this._localEpGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get localEpGroupIdInput() { + return this._localEpGroupId; + } + + // local_id - computed: false, optional: true, required: false + private _localId?: string; + public get localId() { + return this.getStringAttribute('local_id'); + } + public set localId(value: string) { + this._localId = value; + } + public resetLocalId() { + this._localId = undefined; + } + // Temporarily expose input value. Use with caution. + public get localIdInput() { + return this._localId; + } + + // mtu - computed: true, optional: true, required: false + private _mtu?: number; + public get mtu() { + return this.getNumberAttribute('mtu'); + } + public set mtu(value: number) { + this._mtu = value; + } + public resetMtu() { + this._mtu = undefined; + } + // Temporarily expose input value. Use with caution. + public get mtuInput() { + return this._mtu; + } + + // name - computed: false, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // peer_address - computed: false, optional: false, required: true + private _peerAddress?: string; + public get peerAddress() { + return this.getStringAttribute('peer_address'); + } + public set peerAddress(value: string) { + this._peerAddress = value; + } + // Temporarily expose input value. Use with caution. + public get peerAddressInput() { + return this._peerAddress; + } + + // peer_cidrs - computed: false, optional: true, required: false + private _peerCidrs?: string[]; + public get peerCidrs() { + return this.getListAttribute('peer_cidrs'); + } + public set peerCidrs(value: string[]) { + this._peerCidrs = value; + } + public resetPeerCidrs() { + this._peerCidrs = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerCidrsInput() { + return this._peerCidrs; + } + + // peer_ep_group_id - computed: false, optional: true, required: false + private _peerEpGroupId?: string; + public get peerEpGroupId() { + return this.getStringAttribute('peer_ep_group_id'); + } + public set peerEpGroupId(value: string) { + this._peerEpGroupId = value; + } + public resetPeerEpGroupId() { + this._peerEpGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get peerEpGroupIdInput() { + return this._peerEpGroupId; + } + + // peer_id - computed: false, optional: false, required: true + private _peerId?: string; + public get peerId() { + return this.getStringAttribute('peer_id'); + } + public set peerId(value: string) { + this._peerId = value; + } + // Temporarily expose input value. Use with caution. + public get peerIdInput() { + return this._peerId; + } + + // psk - computed: false, optional: false, required: true + private _psk?: string; + public get psk() { + return this.getStringAttribute('psk'); + } + public set psk(value: string) { + this._psk = value; + } + // Temporarily expose input value. Use with caution. + public get pskInput() { + return this._psk; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // tenant_id - computed: true, optional: true, required: false + private _tenantId?: string; + public get tenantId() { + return this.getStringAttribute('tenant_id'); + } + public set tenantId(value: string) { + this._tenantId = value; + } + public resetTenantId() { + this._tenantId = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenantIdInput() { + return this._tenantId; + } + + // value_specs - computed: false, optional: true, required: false + private _valueSpecs?: { [key: string]: string }; + public get valueSpecs() { + return this.getStringMapAttribute('value_specs'); + } + public set valueSpecs(value: { [key: string]: string }) { + this._valueSpecs = value; + } + public resetValueSpecs() { + this._valueSpecs = undefined; + } + // Temporarily expose input value. Use with caution. + public get valueSpecsInput() { + return this._valueSpecs; + } + + // vpnservice_id - computed: false, optional: false, required: true + private _vpnserviceId?: string; + public get vpnserviceId() { + return this.getStringAttribute('vpnservice_id'); + } + public set vpnserviceId(value: string) { + this._vpnserviceId = value; + } + // Temporarily expose input value. Use with caution. + public get vpnserviceIdInput() { + return this._vpnserviceId; + } + + // dpd - computed: false, optional: true, required: false + private _dpd = new VpnaasSiteConnectionDpdList(this, "dpd", true); + public get dpd() { + return this._dpd; + } + public putDpd(value: VpnaasSiteConnectionDpd[] | cdktf.IResolvable) { + this._dpd.internalValue = value; + } + public resetDpd() { + this._dpd.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dpdInput() { + return this._dpd.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new VpnaasSiteConnectionTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: VpnaasSiteConnectionTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + admin_state_up: cdktf.booleanToTerraform(this._adminStateUp), + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + ikepolicy_id: cdktf.stringToTerraform(this._ikepolicyId), + initiator: cdktf.stringToTerraform(this._initiator), + ipsecpolicy_id: cdktf.stringToTerraform(this._ipsecpolicyId), + local_ep_group_id: cdktf.stringToTerraform(this._localEpGroupId), + local_id: cdktf.stringToTerraform(this._localId), + mtu: cdktf.numberToTerraform(this._mtu), + name: cdktf.stringToTerraform(this._name), + peer_address: cdktf.stringToTerraform(this._peerAddress), + peer_cidrs: cdktf.listMapper(cdktf.stringToTerraform, false)(this._peerCidrs), + peer_ep_group_id: cdktf.stringToTerraform(this._peerEpGroupId), + peer_id: cdktf.stringToTerraform(this._peerId), + psk: cdktf.stringToTerraform(this._psk), + region: cdktf.stringToTerraform(this._region), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + tenant_id: cdktf.stringToTerraform(this._tenantId), + value_specs: cdktf.hashMapper(cdktf.stringToTerraform)(this._valueSpecs), + vpnservice_id: cdktf.stringToTerraform(this._vpnserviceId), + dpd: cdktf.listMapper(vpnaasSiteConnectionDpdToTerraform, true)(this._dpd.internalValue), + timeouts: vpnaasSiteConnectionTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + admin_state_up: { + value: cdktf.booleanToHclTerraform(this._adminStateUp), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ikepolicy_id: { + value: cdktf.stringToHclTerraform(this._ikepolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + initiator: { + value: cdktf.stringToHclTerraform(this._initiator), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipsecpolicy_id: { + value: cdktf.stringToHclTerraform(this._ipsecpolicyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_ep_group_id: { + value: cdktf.stringToHclTerraform(this._localEpGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + local_id: { + value: cdktf.stringToHclTerraform(this._localId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mtu: { + value: cdktf.numberToHclTerraform(this._mtu), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_address: { + value: cdktf.stringToHclTerraform(this._peerAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_cidrs: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._peerCidrs), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + peer_ep_group_id: { + value: cdktf.stringToHclTerraform(this._peerEpGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + peer_id: { + value: cdktf.stringToHclTerraform(this._peerId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + psk: { + value: cdktf.stringToHclTerraform(this._psk), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + tenant_id: { + value: cdktf.stringToHclTerraform(this._tenantId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + value_specs: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._valueSpecs), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpnservice_id: { + value: cdktf.stringToHclTerraform(this._vpnserviceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dpd: { + value: cdktf.listMapperHcl(vpnaasSiteConnectionDpdToHclTerraform, true)(this._dpd.internalValue), + isBlock: true, + type: "set", + storageClassType: "VpnaasSiteConnectionDpdList", + }, + timeouts: { + value: vpnaasSiteConnectionTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "VpnaasSiteConnectionTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-address-group/README.md b/src/constructs/providers/huaweicloud/waf-address-group/README.md new file mode 100644 index 00000000..aaccec3b --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-address-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_address_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_address_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group). diff --git a/src/constructs/providers/huaweicloud/waf-address-group/index.ts b/src/constructs/providers/huaweicloud/waf-address-group/index.ts new file mode 100644 index 00000000..ab91e768 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-address-group/index.ts @@ -0,0 +1,354 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafAddressGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#description WafAddressGroup#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID of WAF address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#enterprise_project_id WafAddressGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#id WafAddressGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the IP addresses or IP address ranges. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#ip_addresses WafAddressGroup#ip_addresses} + */ + readonly ipAddresses: string[]; + /** + * Specifies the name of the address group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#name WafAddressGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#region WafAddressGroup#region} + */ + readonly region?: string; +} +export interface WafAddressGroupRules { +} + +export function wafAddressGroupRulesToTerraform(struct?: WafAddressGroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function wafAddressGroupRulesToHclTerraform(struct?: WafAddressGroupRules): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class WafAddressGroupRulesOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafAddressGroupRules | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafAddressGroupRules | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // policy_id - computed: true, optional: false, required: false + public get policyId() { + return this.getStringAttribute('policy_id'); + } + + // policy_name - computed: true, optional: false, required: false + public get policyName() { + return this.getStringAttribute('policy_name'); + } + + // rule_id - computed: true, optional: false, required: false + public get ruleId() { + return this.getStringAttribute('rule_id'); + } + + // rule_name - computed: true, optional: false, required: false + public get ruleName() { + return this.getStringAttribute('rule_name'); + } +} + +export class WafAddressGroupRulesList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafAddressGroupRulesOutputReference { + return new WafAddressGroupRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group huaweicloud_waf_address_group} +*/ +export class WafAddressGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_address_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafAddressGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafAddressGroup to import + * @param importFromId The id of the existing WafAddressGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafAddressGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_address_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_address_group huaweicloud_waf_address_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafAddressGroupConfig + */ + public constructor(scope: Construct, id: string, config: WafAddressGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_address_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ipAddresses = config.ipAddresses; + this._name = config.name; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_addresses - computed: false, optional: false, required: true + private _ipAddresses?: string[]; + public get ipAddresses() { + return this.getListAttribute('ip_addresses'); + } + public set ipAddresses(value: string[]) { + this._ipAddresses = value; + } + // Temporarily expose input value. Use with caution. + public get ipAddressesInput() { + return this._ipAddresses; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // rules - computed: true, optional: false, required: false + private _rules = new WafAddressGroupRulesList(this, "rules", false); + public get rules() { + return this._rules; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ip_addresses: cdktf.listMapper(cdktf.stringToTerraform, false)(this._ipAddresses), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_addresses: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._ipAddresses), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-certificate/README.md b/src/constructs/providers/huaweicloud/waf-certificate/README.md new file mode 100644 index 00000000..a059f25e --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-certificate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_certificate` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_certificate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate). diff --git a/src/constructs/providers/huaweicloud/waf-certificate/index.ts b/src/constructs/providers/huaweicloud/waf-certificate/index.ts new file mode 100644 index 00000000..57396b2e --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-certificate/index.ts @@ -0,0 +1,419 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafCertificateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#certificate WafCertificate#certificate} + */ + readonly certificate: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#enterprise_project_id WafCertificate#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#id WafCertificate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#name WafCertificate#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#private_key WafCertificate#private_key} + */ + readonly privateKey: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#region WafCertificate#region} + */ + readonly region?: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#timeouts WafCertificate#timeouts} + */ + readonly timeouts?: WafCertificateTimeouts; +} +export interface WafCertificateTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#create WafCertificate#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#delete WafCertificate#delete} + */ + readonly delete?: string; +} + +export function wafCertificateTimeoutsToTerraform(struct?: WafCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function wafCertificateTimeoutsToHclTerraform(struct?: WafCertificateTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafCertificateTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WafCertificateTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafCertificateTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate huaweicloud_waf_certificate} +*/ +export class WafCertificate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_certificate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafCertificate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafCertificate to import + * @param importFromId The id of the existing WafCertificate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafCertificate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_certificate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_certificate huaweicloud_waf_certificate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafCertificateConfig + */ + public constructor(scope: Construct, id: string, config: WafCertificateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_certificate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificate = config.certificate; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._privateKey = config.privateKey; + this._region = config.region; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // certificate - computed: false, optional: false, required: true + private _certificate?: string; + public get certificate() { + return this.getStringAttribute('certificate'); + } + public set certificate(value: string) { + this._certificate = value; + } + // Temporarily expose input value. Use with caution. + public get certificateInput() { + return this._certificate; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // expiration - computed: true, optional: false, required: false + public get expiration() { + return this.getStringAttribute('expiration'); + } + + // expired_at - computed: true, optional: false, required: false + public get expiredAt() { + return this.getStringAttribute('expired_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // private_key - computed: false, optional: false, required: true + private _privateKey?: string; + public get privateKey() { + return this.getStringAttribute('private_key'); + } + public set privateKey(value: string) { + this._privateKey = value; + } + // Temporarily expose input value. Use with caution. + public get privateKeyInput() { + return this._privateKey; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WafCertificateTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WafCertificateTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate: cdktf.stringToTerraform(this._certificate), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + private_key: cdktf.stringToTerraform(this._privateKey), + region: cdktf.stringToTerraform(this._region), + timeouts: wafCertificateTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate: { + value: cdktf.stringToHclTerraform(this._certificate), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + private_key: { + value: cdktf.stringToHclTerraform(this._privateKey), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: wafCertificateTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WafCertificateTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-cloud-instance/README.md b/src/constructs/providers/huaweicloud/waf-cloud-instance/README.md new file mode 100644 index 00000000..98c9b5b0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-cloud-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_cloud_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_cloud_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance). diff --git a/src/constructs/providers/huaweicloud/waf-cloud-instance/index.ts b/src/constructs/providers/huaweicloud/waf-cloud-instance/index.ts new file mode 100644 index 00000000..62885dfe --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-cloud-instance/index.ts @@ -0,0 +1,890 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafCloudInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#auto_renew WafCloudInstance#auto_renew} + */ + readonly autoRenew?: string; + /** + * Specifies the charging mode of the cloud WAF. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#charging_mode WafCloudInstance#charging_mode} + */ + readonly chargingMode: string; + /** + * Specifies the ID of the enterprise project to which the cloud WAF belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#enterprise_project_id WafCloudInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#id WafCloudInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#period WafCloudInstance#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#period_unit WafCloudInstance#period_unit} + */ + readonly periodUnit?: string; + /** + * Specifies the region where the cloud WAF is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#region WafCloudInstance#region} + */ + readonly region?: string; + /** + * Specifies the specification of the cloud WAF. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#resource_spec_code WafCloudInstance#resource_spec_code} + */ + readonly resourceSpecCode?: string; + /** + * Specifies the website to which the account belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#website WafCloudInstance#website} + */ + readonly website?: string; + /** + * bandwidth_expack_product block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#bandwidth_expack_product WafCloudInstance#bandwidth_expack_product} + */ + readonly bandwidthExpackProduct?: WafCloudInstanceBandwidthExpackProduct; + /** + * domain_expack_product block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#domain_expack_product WafCloudInstance#domain_expack_product} + */ + readonly domainExpackProduct?: WafCloudInstanceDomainExpackProduct; + /** + * rule_expack_product block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#rule_expack_product WafCloudInstance#rule_expack_product} + */ + readonly ruleExpackProduct?: WafCloudInstanceRuleExpackProduct; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#timeouts WafCloudInstance#timeouts} + */ + readonly timeouts?: WafCloudInstanceTimeouts; +} +export interface WafCloudInstanceBandwidthExpackProduct { + /** + * Specifies the number of extended packages. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#resource_size WafCloudInstance#resource_size} + */ + readonly resourceSize?: number; +} + +export function wafCloudInstanceBandwidthExpackProductToTerraform(struct?: WafCloudInstanceBandwidthExpackProductOutputReference | WafCloudInstanceBandwidthExpackProduct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_size: cdktf.numberToTerraform(struct!.resourceSize), + } +} + + +export function wafCloudInstanceBandwidthExpackProductToHclTerraform(struct?: WafCloudInstanceBandwidthExpackProductOutputReference | WafCloudInstanceBandwidthExpackProduct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_size: { + value: cdktf.numberToHclTerraform(struct!.resourceSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafCloudInstanceBandwidthExpackProductOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafCloudInstanceBandwidthExpackProduct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceSize !== undefined) { + hasAnyValues = true; + internalValueResult.resourceSize = this._resourceSize; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafCloudInstanceBandwidthExpackProduct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._resourceSize = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._resourceSize = value.resourceSize; + } + } + + // resource_size - computed: true, optional: true, required: false + private _resourceSize?: number; + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + public set resourceSize(value: number) { + this._resourceSize = value; + } + public resetResourceSize() { + this._resourceSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceSizeInput() { + return this._resourceSize; + } +} +export interface WafCloudInstanceDomainExpackProduct { + /** + * Specifies the number of extended packages. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#resource_size WafCloudInstance#resource_size} + */ + readonly resourceSize?: number; +} + +export function wafCloudInstanceDomainExpackProductToTerraform(struct?: WafCloudInstanceDomainExpackProductOutputReference | WafCloudInstanceDomainExpackProduct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_size: cdktf.numberToTerraform(struct!.resourceSize), + } +} + + +export function wafCloudInstanceDomainExpackProductToHclTerraform(struct?: WafCloudInstanceDomainExpackProductOutputReference | WafCloudInstanceDomainExpackProduct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_size: { + value: cdktf.numberToHclTerraform(struct!.resourceSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafCloudInstanceDomainExpackProductOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafCloudInstanceDomainExpackProduct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceSize !== undefined) { + hasAnyValues = true; + internalValueResult.resourceSize = this._resourceSize; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafCloudInstanceDomainExpackProduct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._resourceSize = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._resourceSize = value.resourceSize; + } + } + + // resource_size - computed: true, optional: true, required: false + private _resourceSize?: number; + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + public set resourceSize(value: number) { + this._resourceSize = value; + } + public resetResourceSize() { + this._resourceSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceSizeInput() { + return this._resourceSize; + } +} +export interface WafCloudInstanceRuleExpackProduct { + /** + * Specifies the number of extended packages. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#resource_size WafCloudInstance#resource_size} + */ + readonly resourceSize?: number; +} + +export function wafCloudInstanceRuleExpackProductToTerraform(struct?: WafCloudInstanceRuleExpackProductOutputReference | WafCloudInstanceRuleExpackProduct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + resource_size: cdktf.numberToTerraform(struct!.resourceSize), + } +} + + +export function wafCloudInstanceRuleExpackProductToHclTerraform(struct?: WafCloudInstanceRuleExpackProductOutputReference | WafCloudInstanceRuleExpackProduct): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + resource_size: { + value: cdktf.numberToHclTerraform(struct!.resourceSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafCloudInstanceRuleExpackProductOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafCloudInstanceRuleExpackProduct | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._resourceSize !== undefined) { + hasAnyValues = true; + internalValueResult.resourceSize = this._resourceSize; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafCloudInstanceRuleExpackProduct | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._resourceSize = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._resourceSize = value.resourceSize; + } + } + + // resource_size - computed: true, optional: true, required: false + private _resourceSize?: number; + public get resourceSize() { + return this.getNumberAttribute('resource_size'); + } + public set resourceSize(value: number) { + this._resourceSize = value; + } + public resetResourceSize() { + this._resourceSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceSizeInput() { + return this._resourceSize; + } +} +export interface WafCloudInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#create WafCloudInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#delete WafCloudInstance#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#update WafCloudInstance#update} + */ + readonly update?: string; +} + +export function wafCloudInstanceTimeoutsToTerraform(struct?: WafCloudInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function wafCloudInstanceTimeoutsToHclTerraform(struct?: WafCloudInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafCloudInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WafCloudInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafCloudInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance huaweicloud_waf_cloud_instance} +*/ +export class WafCloudInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_cloud_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafCloudInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafCloudInstance to import + * @param importFromId The id of the existing WafCloudInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafCloudInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_cloud_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_cloud_instance huaweicloud_waf_cloud_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafCloudInstanceConfig + */ + public constructor(scope: Construct, id: string, config: WafCloudInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_cloud_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._chargingMode = config.chargingMode; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._resourceSpecCode = config.resourceSpecCode; + this._website = config.website; + this._bandwidthExpackProduct.internalValue = config.bandwidthExpackProduct; + this._domainExpackProduct.internalValue = config.domainExpackProduct; + this._ruleExpackProduct.internalValue = config.ruleExpackProduct; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // charging_mode - computed: false, optional: false, required: true + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // resource_spec_code - computed: false, optional: true, required: false + private _resourceSpecCode?: string; + public get resourceSpecCode() { + return this.getStringAttribute('resource_spec_code'); + } + public set resourceSpecCode(value: string) { + this._resourceSpecCode = value; + } + public resetResourceSpecCode() { + this._resourceSpecCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get resourceSpecCodeInput() { + return this._resourceSpecCode; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // website - computed: false, optional: true, required: false + private _website?: string; + public get website() { + return this.getStringAttribute('website'); + } + public set website(value: string) { + this._website = value; + } + public resetWebsite() { + this._website = undefined; + } + // Temporarily expose input value. Use with caution. + public get websiteInput() { + return this._website; + } + + // bandwidth_expack_product - computed: false, optional: true, required: false + private _bandwidthExpackProduct = new WafCloudInstanceBandwidthExpackProductOutputReference(this, "bandwidth_expack_product"); + public get bandwidthExpackProduct() { + return this._bandwidthExpackProduct; + } + public putBandwidthExpackProduct(value: WafCloudInstanceBandwidthExpackProduct) { + this._bandwidthExpackProduct.internalValue = value; + } + public resetBandwidthExpackProduct() { + this._bandwidthExpackProduct.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get bandwidthExpackProductInput() { + return this._bandwidthExpackProduct.internalValue; + } + + // domain_expack_product - computed: false, optional: true, required: false + private _domainExpackProduct = new WafCloudInstanceDomainExpackProductOutputReference(this, "domain_expack_product"); + public get domainExpackProduct() { + return this._domainExpackProduct; + } + public putDomainExpackProduct(value: WafCloudInstanceDomainExpackProduct) { + this._domainExpackProduct.internalValue = value; + } + public resetDomainExpackProduct() { + this._domainExpackProduct.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainExpackProductInput() { + return this._domainExpackProduct.internalValue; + } + + // rule_expack_product - computed: false, optional: true, required: false + private _ruleExpackProduct = new WafCloudInstanceRuleExpackProductOutputReference(this, "rule_expack_product"); + public get ruleExpackProduct() { + return this._ruleExpackProduct; + } + public putRuleExpackProduct(value: WafCloudInstanceRuleExpackProduct) { + this._ruleExpackProduct.internalValue = value; + } + public resetRuleExpackProduct() { + this._ruleExpackProduct.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleExpackProductInput() { + return this._ruleExpackProduct.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WafCloudInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WafCloudInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + resource_spec_code: cdktf.stringToTerraform(this._resourceSpecCode), + website: cdktf.stringToTerraform(this._website), + bandwidth_expack_product: wafCloudInstanceBandwidthExpackProductToTerraform(this._bandwidthExpackProduct.internalValue), + domain_expack_product: wafCloudInstanceDomainExpackProductToTerraform(this._domainExpackProduct.internalValue), + rule_expack_product: wafCloudInstanceRuleExpackProductToTerraform(this._ruleExpackProduct.internalValue), + timeouts: wafCloudInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + resource_spec_code: { + value: cdktf.stringToHclTerraform(this._resourceSpecCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + website: { + value: cdktf.stringToHclTerraform(this._website), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bandwidth_expack_product: { + value: wafCloudInstanceBandwidthExpackProductToHclTerraform(this._bandwidthExpackProduct.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafCloudInstanceBandwidthExpackProductList", + }, + domain_expack_product: { + value: wafCloudInstanceDomainExpackProductToHclTerraform(this._domainExpackProduct.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafCloudInstanceDomainExpackProductList", + }, + rule_expack_product: { + value: wafCloudInstanceRuleExpackProductToHclTerraform(this._ruleExpackProduct.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafCloudInstanceRuleExpackProductList", + }, + timeouts: { + value: wafCloudInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WafCloudInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-dedicated-domain/README.md b/src/constructs/providers/huaweicloud/waf-dedicated-domain/README.md new file mode 100644 index 00000000..62882f41 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-dedicated-domain/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_dedicated_domain` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_dedicated_domain`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain). diff --git a/src/constructs/providers/huaweicloud/waf-dedicated-domain/index.ts b/src/constructs/providers/huaweicloud/waf-dedicated-domain/index.ts new file mode 100644 index 00000000..ae90affa --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-dedicated-domain/index.ts @@ -0,0 +1,1727 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafDedicatedDomainConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#certificate_id WafDedicatedDomain#certificate_id} + */ + readonly certificateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#cipher WafDedicatedDomain#cipher} + */ + readonly cipher?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#description WafDedicatedDomain#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#domain WafDedicatedDomain#domain} + */ + readonly domain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#enterprise_project_id WafDedicatedDomain#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#forward_header_map WafDedicatedDomain#forward_header_map} + */ + readonly forwardHeaderMap?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#id WafDedicatedDomain#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#keep_policy WafDedicatedDomain#keep_policy} + */ + readonly keepPolicy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#pci_3ds WafDedicatedDomain#pci_3ds} + */ + readonly pci3Ds?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#pci_dss WafDedicatedDomain#pci_dss} + */ + readonly pciDss?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#policy_id WafDedicatedDomain#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#protect_status WafDedicatedDomain#protect_status} + */ + readonly protectStatus?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#proxy WafDedicatedDomain#proxy} + */ + readonly proxy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#redirect_url WafDedicatedDomain#redirect_url} + */ + readonly redirectUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#region WafDedicatedDomain#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#tls WafDedicatedDomain#tls} + */ + readonly tls?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#website_name WafDedicatedDomain#website_name} + */ + readonly websiteName?: string; + /** + * connection_protection block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#connection_protection WafDedicatedDomain#connection_protection} + */ + readonly connectionProtection?: WafDedicatedDomainConnectionProtection; + /** + * custom_page block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#custom_page WafDedicatedDomain#custom_page} + */ + readonly customPage?: WafDedicatedDomainCustomPage; + /** + * server block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#server WafDedicatedDomain#server} + */ + readonly server: WafDedicatedDomainServer[] | cdktf.IResolvable; + /** + * timeout_settings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#timeout_settings WafDedicatedDomain#timeout_settings} + */ + readonly timeoutSettings?: WafDedicatedDomainTimeoutSettings; + /** + * traffic_mark block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#traffic_mark WafDedicatedDomain#traffic_mark} + */ + readonly trafficMark?: WafDedicatedDomainTrafficMark; +} +export interface WafDedicatedDomainConnectionProtection { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#duration WafDedicatedDomain#duration} + */ + readonly duration?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#error_percentage WafDedicatedDomain#error_percentage} + */ + readonly errorPercentage?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#error_threshold WafDedicatedDomain#error_threshold} + */ + readonly errorThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#initial_downtime WafDedicatedDomain#initial_downtime} + */ + readonly initialDowntime?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#multiplier_for_consecutive_breakdowns WafDedicatedDomain#multiplier_for_consecutive_breakdowns} + */ + readonly multiplierForConsecutiveBreakdowns?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#pending_url_request_threshold WafDedicatedDomain#pending_url_request_threshold} + */ + readonly pendingUrlRequestThreshold?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#status WafDedicatedDomain#status} + */ + readonly status?: boolean | cdktf.IResolvable; +} + +export function wafDedicatedDomainConnectionProtectionToTerraform(struct?: WafDedicatedDomainConnectionProtectionOutputReference | WafDedicatedDomainConnectionProtection): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + duration: cdktf.numberToTerraform(struct!.duration), + error_percentage: cdktf.numberToTerraform(struct!.errorPercentage), + error_threshold: cdktf.numberToTerraform(struct!.errorThreshold), + initial_downtime: cdktf.numberToTerraform(struct!.initialDowntime), + multiplier_for_consecutive_breakdowns: cdktf.numberToTerraform(struct!.multiplierForConsecutiveBreakdowns), + pending_url_request_threshold: cdktf.numberToTerraform(struct!.pendingUrlRequestThreshold), + status: cdktf.booleanToTerraform(struct!.status), + } +} + + +export function wafDedicatedDomainConnectionProtectionToHclTerraform(struct?: WafDedicatedDomainConnectionProtectionOutputReference | WafDedicatedDomainConnectionProtection): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + duration: { + value: cdktf.numberToHclTerraform(struct!.duration), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + error_percentage: { + value: cdktf.numberToHclTerraform(struct!.errorPercentage), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + error_threshold: { + value: cdktf.numberToHclTerraform(struct!.errorThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + initial_downtime: { + value: cdktf.numberToHclTerraform(struct!.initialDowntime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + multiplier_for_consecutive_breakdowns: { + value: cdktf.numberToHclTerraform(struct!.multiplierForConsecutiveBreakdowns), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + pending_url_request_threshold: { + value: cdktf.numberToHclTerraform(struct!.pendingUrlRequestThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + status: { + value: cdktf.booleanToHclTerraform(struct!.status), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDedicatedDomainConnectionProtectionOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDedicatedDomainConnectionProtection | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._duration !== undefined) { + hasAnyValues = true; + internalValueResult.duration = this._duration; + } + if (this._errorPercentage !== undefined) { + hasAnyValues = true; + internalValueResult.errorPercentage = this._errorPercentage; + } + if (this._errorThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.errorThreshold = this._errorThreshold; + } + if (this._initialDowntime !== undefined) { + hasAnyValues = true; + internalValueResult.initialDowntime = this._initialDowntime; + } + if (this._multiplierForConsecutiveBreakdowns !== undefined) { + hasAnyValues = true; + internalValueResult.multiplierForConsecutiveBreakdowns = this._multiplierForConsecutiveBreakdowns; + } + if (this._pendingUrlRequestThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.pendingUrlRequestThreshold = this._pendingUrlRequestThreshold; + } + if (this._status !== undefined) { + hasAnyValues = true; + internalValueResult.status = this._status; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDedicatedDomainConnectionProtection | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._duration = undefined; + this._errorPercentage = undefined; + this._errorThreshold = undefined; + this._initialDowntime = undefined; + this._multiplierForConsecutiveBreakdowns = undefined; + this._pendingUrlRequestThreshold = undefined; + this._status = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._duration = value.duration; + this._errorPercentage = value.errorPercentage; + this._errorThreshold = value.errorThreshold; + this._initialDowntime = value.initialDowntime; + this._multiplierForConsecutiveBreakdowns = value.multiplierForConsecutiveBreakdowns; + this._pendingUrlRequestThreshold = value.pendingUrlRequestThreshold; + this._status = value.status; + } + } + + // duration - computed: true, optional: true, required: false + private _duration?: number; + public get duration() { + return this.getNumberAttribute('duration'); + } + public set duration(value: number) { + this._duration = value; + } + public resetDuration() { + this._duration = undefined; + } + // Temporarily expose input value. Use with caution. + public get durationInput() { + return this._duration; + } + + // error_percentage - computed: true, optional: true, required: false + private _errorPercentage?: number; + public get errorPercentage() { + return this.getNumberAttribute('error_percentage'); + } + public set errorPercentage(value: number) { + this._errorPercentage = value; + } + public resetErrorPercentage() { + this._errorPercentage = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorPercentageInput() { + return this._errorPercentage; + } + + // error_threshold - computed: true, optional: true, required: false + private _errorThreshold?: number; + public get errorThreshold() { + return this.getNumberAttribute('error_threshold'); + } + public set errorThreshold(value: number) { + this._errorThreshold = value; + } + public resetErrorThreshold() { + this._errorThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get errorThresholdInput() { + return this._errorThreshold; + } + + // initial_downtime - computed: true, optional: true, required: false + private _initialDowntime?: number; + public get initialDowntime() { + return this.getNumberAttribute('initial_downtime'); + } + public set initialDowntime(value: number) { + this._initialDowntime = value; + } + public resetInitialDowntime() { + this._initialDowntime = undefined; + } + // Temporarily expose input value. Use with caution. + public get initialDowntimeInput() { + return this._initialDowntime; + } + + // multiplier_for_consecutive_breakdowns - computed: true, optional: true, required: false + private _multiplierForConsecutiveBreakdowns?: number; + public get multiplierForConsecutiveBreakdowns() { + return this.getNumberAttribute('multiplier_for_consecutive_breakdowns'); + } + public set multiplierForConsecutiveBreakdowns(value: number) { + this._multiplierForConsecutiveBreakdowns = value; + } + public resetMultiplierForConsecutiveBreakdowns() { + this._multiplierForConsecutiveBreakdowns = undefined; + } + // Temporarily expose input value. Use with caution. + public get multiplierForConsecutiveBreakdownsInput() { + return this._multiplierForConsecutiveBreakdowns; + } + + // pending_url_request_threshold - computed: true, optional: true, required: false + private _pendingUrlRequestThreshold?: number; + public get pendingUrlRequestThreshold() { + return this.getNumberAttribute('pending_url_request_threshold'); + } + public set pendingUrlRequestThreshold(value: number) { + this._pendingUrlRequestThreshold = value; + } + public resetPendingUrlRequestThreshold() { + this._pendingUrlRequestThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get pendingUrlRequestThresholdInput() { + return this._pendingUrlRequestThreshold; + } + + // status - computed: true, optional: true, required: false + private _status?: boolean | cdktf.IResolvable; + public get status() { + return this.getBooleanAttribute('status'); + } + public set status(value: boolean | cdktf.IResolvable) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } +} +export interface WafDedicatedDomainCustomPage { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#block_page_type WafDedicatedDomain#block_page_type} + */ + readonly blockPageType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#http_return_code WafDedicatedDomain#http_return_code} + */ + readonly httpReturnCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#page_content WafDedicatedDomain#page_content} + */ + readonly pageContent: string; +} + +export function wafDedicatedDomainCustomPageToTerraform(struct?: WafDedicatedDomainCustomPageOutputReference | WafDedicatedDomainCustomPage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + block_page_type: cdktf.stringToTerraform(struct!.blockPageType), + http_return_code: cdktf.stringToTerraform(struct!.httpReturnCode), + page_content: cdktf.stringToTerraform(struct!.pageContent), + } +} + + +export function wafDedicatedDomainCustomPageToHclTerraform(struct?: WafDedicatedDomainCustomPageOutputReference | WafDedicatedDomainCustomPage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + block_page_type: { + value: cdktf.stringToHclTerraform(struct!.blockPageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_return_code: { + value: cdktf.stringToHclTerraform(struct!.httpReturnCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + page_content: { + value: cdktf.stringToHclTerraform(struct!.pageContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDedicatedDomainCustomPageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDedicatedDomainCustomPage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blockPageType !== undefined) { + hasAnyValues = true; + internalValueResult.blockPageType = this._blockPageType; + } + if (this._httpReturnCode !== undefined) { + hasAnyValues = true; + internalValueResult.httpReturnCode = this._httpReturnCode; + } + if (this._pageContent !== undefined) { + hasAnyValues = true; + internalValueResult.pageContent = this._pageContent; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDedicatedDomainCustomPage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blockPageType = undefined; + this._httpReturnCode = undefined; + this._pageContent = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blockPageType = value.blockPageType; + this._httpReturnCode = value.httpReturnCode; + this._pageContent = value.pageContent; + } + } + + // block_page_type - computed: false, optional: false, required: true + private _blockPageType?: string; + public get blockPageType() { + return this.getStringAttribute('block_page_type'); + } + public set blockPageType(value: string) { + this._blockPageType = value; + } + // Temporarily expose input value. Use with caution. + public get blockPageTypeInput() { + return this._blockPageType; + } + + // http_return_code - computed: false, optional: false, required: true + private _httpReturnCode?: string; + public get httpReturnCode() { + return this.getStringAttribute('http_return_code'); + } + public set httpReturnCode(value: string) { + this._httpReturnCode = value; + } + // Temporarily expose input value. Use with caution. + public get httpReturnCodeInput() { + return this._httpReturnCode; + } + + // page_content - computed: false, optional: false, required: true + private _pageContent?: string; + public get pageContent() { + return this.getStringAttribute('page_content'); + } + public set pageContent(value: string) { + this._pageContent = value; + } + // Temporarily expose input value. Use with caution. + public get pageContentInput() { + return this._pageContent; + } +} +export interface WafDedicatedDomainServer { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#address WafDedicatedDomain#address} + */ + readonly address: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#client_protocol WafDedicatedDomain#client_protocol} + */ + readonly clientProtocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#port WafDedicatedDomain#port} + */ + readonly port: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#server_protocol WafDedicatedDomain#server_protocol} + */ + readonly serverProtocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#type WafDedicatedDomain#type} + */ + readonly type: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#vpc_id WafDedicatedDomain#vpc_id} + */ + readonly vpcId: string; +} + +export function wafDedicatedDomainServerToTerraform(struct?: WafDedicatedDomainServer | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + client_protocol: cdktf.stringToTerraform(struct!.clientProtocol), + port: cdktf.numberToTerraform(struct!.port), + server_protocol: cdktf.stringToTerraform(struct!.serverProtocol), + type: cdktf.stringToTerraform(struct!.type), + vpc_id: cdktf.stringToTerraform(struct!.vpcId), + } +} + + +export function wafDedicatedDomainServerToHclTerraform(struct?: WafDedicatedDomainServer | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_protocol: { + value: cdktf.stringToHclTerraform(struct!.clientProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + server_protocol: { + value: cdktf.stringToHclTerraform(struct!.serverProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(struct!.vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDedicatedDomainServerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafDedicatedDomainServer | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._clientProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.clientProtocol = this._clientProtocol; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._serverProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.serverProtocol = this._serverProtocol; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._vpcId !== undefined) { + hasAnyValues = true; + internalValueResult.vpcId = this._vpcId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDedicatedDomainServer | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._clientProtocol = undefined; + this._port = undefined; + this._serverProtocol = undefined; + this._type = undefined; + this._vpcId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._clientProtocol = value.clientProtocol; + this._port = value.port; + this._serverProtocol = value.serverProtocol; + this._type = value.type; + this._vpcId = value.vpcId; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // client_protocol - computed: false, optional: false, required: true + private _clientProtocol?: string; + public get clientProtocol() { + return this.getStringAttribute('client_protocol'); + } + public set clientProtocol(value: string) { + this._clientProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get clientProtocolInput() { + return this._clientProtocol; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // server_protocol - computed: false, optional: false, required: true + private _serverProtocol?: string; + public get serverProtocol() { + return this.getStringAttribute('server_protocol'); + } + public set serverProtocol(value: string) { + this._serverProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get serverProtocolInput() { + return this._serverProtocol; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } +} + +export class WafDedicatedDomainServerList extends cdktf.ComplexList { + public internalValue? : WafDedicatedDomainServer[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafDedicatedDomainServerOutputReference { + return new WafDedicatedDomainServerOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WafDedicatedDomainTimeoutSettings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#connection_timeout WafDedicatedDomain#connection_timeout} + */ + readonly connectionTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#read_timeout WafDedicatedDomain#read_timeout} + */ + readonly readTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#write_timeout WafDedicatedDomain#write_timeout} + */ + readonly writeTimeout?: number; +} + +export function wafDedicatedDomainTimeoutSettingsToTerraform(struct?: WafDedicatedDomainTimeoutSettingsOutputReference | WafDedicatedDomainTimeoutSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + connection_timeout: cdktf.numberToTerraform(struct!.connectionTimeout), + read_timeout: cdktf.numberToTerraform(struct!.readTimeout), + write_timeout: cdktf.numberToTerraform(struct!.writeTimeout), + } +} + + +export function wafDedicatedDomainTimeoutSettingsToHclTerraform(struct?: WafDedicatedDomainTimeoutSettingsOutputReference | WafDedicatedDomainTimeoutSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + connection_timeout: { + value: cdktf.numberToHclTerraform(struct!.connectionTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + read_timeout: { + value: cdktf.numberToHclTerraform(struct!.readTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + write_timeout: { + value: cdktf.numberToHclTerraform(struct!.writeTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDedicatedDomainTimeoutSettingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDedicatedDomainTimeoutSettings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._connectionTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.connectionTimeout = this._connectionTimeout; + } + if (this._readTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.readTimeout = this._readTimeout; + } + if (this._writeTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.writeTimeout = this._writeTimeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDedicatedDomainTimeoutSettings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._connectionTimeout = undefined; + this._readTimeout = undefined; + this._writeTimeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._connectionTimeout = value.connectionTimeout; + this._readTimeout = value.readTimeout; + this._writeTimeout = value.writeTimeout; + } + } + + // connection_timeout - computed: true, optional: true, required: false + private _connectionTimeout?: number; + public get connectionTimeout() { + return this.getNumberAttribute('connection_timeout'); + } + public set connectionTimeout(value: number) { + this._connectionTimeout = value; + } + public resetConnectionTimeout() { + this._connectionTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionTimeoutInput() { + return this._connectionTimeout; + } + + // read_timeout - computed: true, optional: true, required: false + private _readTimeout?: number; + public get readTimeout() { + return this.getNumberAttribute('read_timeout'); + } + public set readTimeout(value: number) { + this._readTimeout = value; + } + public resetReadTimeout() { + this._readTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get readTimeoutInput() { + return this._readTimeout; + } + + // write_timeout - computed: true, optional: true, required: false + private _writeTimeout?: number; + public get writeTimeout() { + return this.getNumberAttribute('write_timeout'); + } + public set writeTimeout(value: number) { + this._writeTimeout = value; + } + public resetWriteTimeout() { + this._writeTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get writeTimeoutInput() { + return this._writeTimeout; + } +} +export interface WafDedicatedDomainTrafficMark { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#ip_tags WafDedicatedDomain#ip_tags} + */ + readonly ipTags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#session_tag WafDedicatedDomain#session_tag} + */ + readonly sessionTag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#user_tag WafDedicatedDomain#user_tag} + */ + readonly userTag?: string; +} + +export function wafDedicatedDomainTrafficMarkToTerraform(struct?: WafDedicatedDomainTrafficMarkOutputReference | WafDedicatedDomainTrafficMark): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.ipTags), + session_tag: cdktf.stringToTerraform(struct!.sessionTag), + user_tag: cdktf.stringToTerraform(struct!.userTag), + } +} + + +export function wafDedicatedDomainTrafficMarkToHclTerraform(struct?: WafDedicatedDomainTrafficMarkOutputReference | WafDedicatedDomainTrafficMark): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.ipTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + session_tag: { + value: cdktf.stringToHclTerraform(struct!.sessionTag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_tag: { + value: cdktf.stringToHclTerraform(struct!.userTag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDedicatedDomainTrafficMarkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDedicatedDomainTrafficMark | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipTags !== undefined) { + hasAnyValues = true; + internalValueResult.ipTags = this._ipTags; + } + if (this._sessionTag !== undefined) { + hasAnyValues = true; + internalValueResult.sessionTag = this._sessionTag; + } + if (this._userTag !== undefined) { + hasAnyValues = true; + internalValueResult.userTag = this._userTag; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDedicatedDomainTrafficMark | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipTags = undefined; + this._sessionTag = undefined; + this._userTag = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipTags = value.ipTags; + this._sessionTag = value.sessionTag; + this._userTag = value.userTag; + } + } + + // ip_tags - computed: true, optional: true, required: false + private _ipTags?: string[]; + public get ipTags() { + return this.getListAttribute('ip_tags'); + } + public set ipTags(value: string[]) { + this._ipTags = value; + } + public resetIpTags() { + this._ipTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipTagsInput() { + return this._ipTags; + } + + // session_tag - computed: true, optional: true, required: false + private _sessionTag?: string; + public get sessionTag() { + return this.getStringAttribute('session_tag'); + } + public set sessionTag(value: string) { + this._sessionTag = value; + } + public resetSessionTag() { + this._sessionTag = undefined; + } + // Temporarily expose input value. Use with caution. + public get sessionTagInput() { + return this._sessionTag; + } + + // user_tag - computed: true, optional: true, required: false + private _userTag?: string; + public get userTag() { + return this.getStringAttribute('user_tag'); + } + public set userTag(value: string) { + this._userTag = value; + } + public resetUserTag() { + this._userTag = undefined; + } + // Temporarily expose input value. Use with caution. + public get userTagInput() { + return this._userTag; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain huaweicloud_waf_dedicated_domain} +*/ +export class WafDedicatedDomain extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_dedicated_domain"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafDedicatedDomain resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafDedicatedDomain to import + * @param importFromId The id of the existing WafDedicatedDomain that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafDedicatedDomain to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_dedicated_domain", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_domain huaweicloud_waf_dedicated_domain} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafDedicatedDomainConfig + */ + public constructor(scope: Construct, id: string, config: WafDedicatedDomainConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_dedicated_domain', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._cipher = config.cipher; + this._description = config.description; + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forwardHeaderMap = config.forwardHeaderMap; + this._id = config.id; + this._keepPolicy = config.keepPolicy; + this._pci3Ds = config.pci3Ds; + this._pciDss = config.pciDss; + this._policyId = config.policyId; + this._protectStatus = config.protectStatus; + this._proxy = config.proxy; + this._redirectUrl = config.redirectUrl; + this._region = config.region; + this._tls = config.tls; + this._websiteName = config.websiteName; + this._connectionProtection.internalValue = config.connectionProtection; + this._customPage.internalValue = config.customPage; + this._server.internalValue = config.server; + this._timeoutSettings.internalValue = config.timeoutSettings; + this._trafficMark.internalValue = config.trafficMark; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_status - computed: true, optional: false, required: false + public get accessStatus() { + return this.getNumberAttribute('access_status'); + } + + // alarm_page - computed: true, optional: false, required: false + private _alarmPage = new cdktf.StringMap(this, "alarm_page"); + public get alarmPage() { + return this._alarmPage; + } + + // certificate_id - computed: false, optional: true, required: false + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + public resetCertificateId() { + this._certificateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // certificate_name - computed: true, optional: false, required: false + public get certificateName() { + return this.getStringAttribute('certificate_name'); + } + + // cipher - computed: true, optional: true, required: false + private _cipher?: string; + public get cipher() { + return this.getStringAttribute('cipher'); + } + public set cipher(value: string) { + this._cipher = value; + } + public resetCipher() { + this._cipher = undefined; + } + // Temporarily expose input value. Use with caution. + public get cipherInput() { + return this._cipher; + } + + // compliance_certification - computed: true, optional: false, required: false + private _complianceCertification = new cdktf.BooleanMap(this, "compliance_certification"); + public get complianceCertification() { + return this._complianceCertification; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // forward_header_map - computed: true, optional: true, required: false + private _forwardHeaderMap?: { [key: string]: string }; + public get forwardHeaderMap() { + return this.getStringMapAttribute('forward_header_map'); + } + public set forwardHeaderMap(value: { [key: string]: string }) { + this._forwardHeaderMap = value; + } + public resetForwardHeaderMap() { + this._forwardHeaderMap = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardHeaderMapInput() { + return this._forwardHeaderMap; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // keep_policy - computed: false, optional: true, required: false + private _keepPolicy?: boolean | cdktf.IResolvable; + public get keepPolicy() { + return this.getBooleanAttribute('keep_policy'); + } + public set keepPolicy(value: boolean | cdktf.IResolvable) { + this._keepPolicy = value; + } + public resetKeepPolicy() { + this._keepPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepPolicyInput() { + return this._keepPolicy; + } + + // pci_3ds - computed: true, optional: true, required: false + private _pci3Ds?: boolean | cdktf.IResolvable; + public get pci3Ds() { + return this.getBooleanAttribute('pci_3ds'); + } + public set pci3Ds(value: boolean | cdktf.IResolvable) { + this._pci3Ds = value; + } + public resetPci3Ds() { + this._pci3Ds = undefined; + } + // Temporarily expose input value. Use with caution. + public get pci3DsInput() { + return this._pci3Ds; + } + + // pci_dss - computed: true, optional: true, required: false + private _pciDss?: boolean | cdktf.IResolvable; + public get pciDss() { + return this.getBooleanAttribute('pci_dss'); + } + public set pciDss(value: boolean | cdktf.IResolvable) { + this._pciDss = value; + } + public resetPciDss() { + this._pciDss = undefined; + } + // Temporarily expose input value. Use with caution. + public get pciDssInput() { + return this._pciDss; + } + + // policy_id - computed: true, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protect_status - computed: true, optional: true, required: false + private _protectStatus?: number; + public get protectStatus() { + return this.getNumberAttribute('protect_status'); + } + public set protectStatus(value: number) { + this._protectStatus = value; + } + public resetProtectStatus() { + this._protectStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectStatusInput() { + return this._protectStatus; + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // proxy - computed: false, optional: true, required: false + private _proxy?: boolean | cdktf.IResolvable; + public get proxy() { + return this.getBooleanAttribute('proxy'); + } + public set proxy(value: boolean | cdktf.IResolvable) { + this._proxy = value; + } + public resetProxy() { + this._proxy = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyInput() { + return this._proxy; + } + + // redirect_url - computed: false, optional: true, required: false + private _redirectUrl?: string; + public get redirectUrl() { + return this.getStringAttribute('redirect_url'); + } + public set redirectUrl(value: string) { + this._redirectUrl = value; + } + public resetRedirectUrl() { + this._redirectUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectUrlInput() { + return this._redirectUrl; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tls - computed: true, optional: true, required: false + private _tls?: string; + public get tls() { + return this.getStringAttribute('tls'); + } + public set tls(value: string) { + this._tls = value; + } + public resetTls() { + this._tls = undefined; + } + // Temporarily expose input value. Use with caution. + public get tlsInput() { + return this._tls; + } + + // traffic_identifier - computed: true, optional: false, required: false + private _trafficIdentifier = new cdktf.StringMap(this, "traffic_identifier"); + public get trafficIdentifier() { + return this._trafficIdentifier; + } + + // website_name - computed: true, optional: true, required: false + private _websiteName?: string; + public get websiteName() { + return this.getStringAttribute('website_name'); + } + public set websiteName(value: string) { + this._websiteName = value; + } + public resetWebsiteName() { + this._websiteName = undefined; + } + // Temporarily expose input value. Use with caution. + public get websiteNameInput() { + return this._websiteName; + } + + // connection_protection - computed: false, optional: true, required: false + private _connectionProtection = new WafDedicatedDomainConnectionProtectionOutputReference(this, "connection_protection"); + public get connectionProtection() { + return this._connectionProtection; + } + public putConnectionProtection(value: WafDedicatedDomainConnectionProtection) { + this._connectionProtection.internalValue = value; + } + public resetConnectionProtection() { + this._connectionProtection.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionProtectionInput() { + return this._connectionProtection.internalValue; + } + + // custom_page - computed: false, optional: true, required: false + private _customPage = new WafDedicatedDomainCustomPageOutputReference(this, "custom_page"); + public get customPage() { + return this._customPage; + } + public putCustomPage(value: WafDedicatedDomainCustomPage) { + this._customPage.internalValue = value; + } + public resetCustomPage() { + this._customPage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customPageInput() { + return this._customPage.internalValue; + } + + // server - computed: false, optional: false, required: true + private _server = new WafDedicatedDomainServerList(this, "server", false); + public get server() { + return this._server; + } + public putServer(value: WafDedicatedDomainServer[] | cdktf.IResolvable) { + this._server.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get serverInput() { + return this._server.internalValue; + } + + // timeout_settings - computed: false, optional: true, required: false + private _timeoutSettings = new WafDedicatedDomainTimeoutSettingsOutputReference(this, "timeout_settings"); + public get timeoutSettings() { + return this._timeoutSettings; + } + public putTimeoutSettings(value: WafDedicatedDomainTimeoutSettings) { + this._timeoutSettings.internalValue = value; + } + public resetTimeoutSettings() { + this._timeoutSettings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutSettingsInput() { + return this._timeoutSettings.internalValue; + } + + // traffic_mark - computed: false, optional: true, required: false + private _trafficMark = new WafDedicatedDomainTrafficMarkOutputReference(this, "traffic_mark"); + public get trafficMark() { + return this._trafficMark; + } + public putTrafficMark(value: WafDedicatedDomainTrafficMark) { + this._trafficMark.internalValue = value; + } + public resetTrafficMark() { + this._trafficMark.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMarkInput() { + return this._trafficMark.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + cipher: cdktf.stringToTerraform(this._cipher), + description: cdktf.stringToTerraform(this._description), + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + forward_header_map: cdktf.hashMapper(cdktf.stringToTerraform)(this._forwardHeaderMap), + id: cdktf.stringToTerraform(this._id), + keep_policy: cdktf.booleanToTerraform(this._keepPolicy), + pci_3ds: cdktf.booleanToTerraform(this._pci3Ds), + pci_dss: cdktf.booleanToTerraform(this._pciDss), + policy_id: cdktf.stringToTerraform(this._policyId), + protect_status: cdktf.numberToTerraform(this._protectStatus), + proxy: cdktf.booleanToTerraform(this._proxy), + redirect_url: cdktf.stringToTerraform(this._redirectUrl), + region: cdktf.stringToTerraform(this._region), + tls: cdktf.stringToTerraform(this._tls), + website_name: cdktf.stringToTerraform(this._websiteName), + connection_protection: wafDedicatedDomainConnectionProtectionToTerraform(this._connectionProtection.internalValue), + custom_page: wafDedicatedDomainCustomPageToTerraform(this._customPage.internalValue), + server: cdktf.listMapper(wafDedicatedDomainServerToTerraform, true)(this._server.internalValue), + timeout_settings: wafDedicatedDomainTimeoutSettingsToTerraform(this._timeoutSettings.internalValue), + traffic_mark: wafDedicatedDomainTrafficMarkToTerraform(this._trafficMark.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cipher: { + value: cdktf.stringToHclTerraform(this._cipher), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + forward_header_map: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._forwardHeaderMap), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + keep_policy: { + value: cdktf.booleanToHclTerraform(this._keepPolicy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + pci_3ds: { + value: cdktf.booleanToHclTerraform(this._pci3Ds), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + pci_dss: { + value: cdktf.booleanToHclTerraform(this._pciDss), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_status: { + value: cdktf.numberToHclTerraform(this._protectStatus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + proxy: { + value: cdktf.booleanToHclTerraform(this._proxy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + redirect_url: { + value: cdktf.stringToHclTerraform(this._redirectUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tls: { + value: cdktf.stringToHclTerraform(this._tls), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + website_name: { + value: cdktf.stringToHclTerraform(this._websiteName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + connection_protection: { + value: wafDedicatedDomainConnectionProtectionToHclTerraform(this._connectionProtection.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDedicatedDomainConnectionProtectionList", + }, + custom_page: { + value: wafDedicatedDomainCustomPageToHclTerraform(this._customPage.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDedicatedDomainCustomPageList", + }, + server: { + value: cdktf.listMapperHcl(wafDedicatedDomainServerToHclTerraform, true)(this._server.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDedicatedDomainServerList", + }, + timeout_settings: { + value: wafDedicatedDomainTimeoutSettingsToHclTerraform(this._timeoutSettings.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDedicatedDomainTimeoutSettingsList", + }, + traffic_mark: { + value: wafDedicatedDomainTrafficMarkToHclTerraform(this._trafficMark.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDedicatedDomainTrafficMarkList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-dedicated-instance/README.md b/src/constructs/providers/huaweicloud/waf-dedicated-instance/README.md new file mode 100644 index 00000000..a0a7d268 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-dedicated-instance/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_dedicated_instance` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_dedicated_instance`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance). diff --git a/src/constructs/providers/huaweicloud/waf-dedicated-instance/index.ts b/src/constructs/providers/huaweicloud/waf-dedicated-instance/index.ts new file mode 100644 index 00000000..4cdddb53 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-dedicated-instance/index.ts @@ -0,0 +1,646 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafDedicatedInstanceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#anti_affinity WafDedicatedInstance#anti_affinity} + */ + readonly antiAffinity?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#available_zone WafDedicatedInstance#available_zone} + */ + readonly availableZone: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#cpu_architecture WafDedicatedInstance#cpu_architecture} + */ + readonly cpuArchitecture?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#ecs_flavor WafDedicatedInstance#ecs_flavor} + */ + readonly ecsFlavor?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#enterprise_project_id WafDedicatedInstance#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * schema: Deprecated; + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#group_id WafDedicatedInstance#group_id} + */ + readonly groupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#id WafDedicatedInstance#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#name WafDedicatedInstance#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#region WafDedicatedInstance#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#res_tenant WafDedicatedInstance#res_tenant} + */ + readonly resTenant?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#security_group WafDedicatedInstance#security_group} + */ + readonly securityGroup: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#specification_code WafDedicatedInstance#specification_code} + */ + readonly specificationCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#subnet_id WafDedicatedInstance#subnet_id} + */ + readonly subnetId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#vpc_id WafDedicatedInstance#vpc_id} + */ + readonly vpcId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#timeouts WafDedicatedInstance#timeouts} + */ + readonly timeouts?: WafDedicatedInstanceTimeouts; +} +export interface WafDedicatedInstanceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#create WafDedicatedInstance#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#delete WafDedicatedInstance#delete} + */ + readonly delete?: string; +} + +export function wafDedicatedInstanceTimeoutsToTerraform(struct?: WafDedicatedInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function wafDedicatedInstanceTimeoutsToHclTerraform(struct?: WafDedicatedInstanceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDedicatedInstanceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WafDedicatedInstanceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDedicatedInstanceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance huaweicloud_waf_dedicated_instance} +*/ +export class WafDedicatedInstance extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_dedicated_instance"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafDedicatedInstance resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafDedicatedInstance to import + * @param importFromId The id of the existing WafDedicatedInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafDedicatedInstance to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_dedicated_instance", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_dedicated_instance huaweicloud_waf_dedicated_instance} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafDedicatedInstanceConfig + */ + public constructor(scope: Construct, id: string, config: WafDedicatedInstanceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_dedicated_instance', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._antiAffinity = config.antiAffinity; + this._availableZone = config.availableZone; + this._cpuArchitecture = config.cpuArchitecture; + this._ecsFlavor = config.ecsFlavor; + this._enterpriseProjectId = config.enterpriseProjectId; + this._groupId = config.groupId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._resTenant = config.resTenant; + this._securityGroup = config.securityGroup; + this._specificationCode = config.specificationCode; + this._subnetId = config.subnetId; + this._vpcId = config.vpcId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_status - computed: true, optional: false, required: false + public get accessStatus() { + return this.getNumberAttribute('access_status'); + } + + // anti_affinity - computed: false, optional: true, required: false + private _antiAffinity?: boolean | cdktf.IResolvable; + public get antiAffinity() { + return this.getBooleanAttribute('anti_affinity'); + } + public set antiAffinity(value: boolean | cdktf.IResolvable) { + this._antiAffinity = value; + } + public resetAntiAffinity() { + this._antiAffinity = undefined; + } + // Temporarily expose input value. Use with caution. + public get antiAffinityInput() { + return this._antiAffinity; + } + + // available_zone - computed: false, optional: false, required: true + private _availableZone?: string; + public get availableZone() { + return this.getStringAttribute('available_zone'); + } + public set availableZone(value: string) { + this._availableZone = value; + } + // Temporarily expose input value. Use with caution. + public get availableZoneInput() { + return this._availableZone; + } + + // cpu_architecture - computed: false, optional: true, required: false + private _cpuArchitecture?: string; + public get cpuArchitecture() { + return this.getStringAttribute('cpu_architecture'); + } + public set cpuArchitecture(value: string) { + this._cpuArchitecture = value; + } + public resetCpuArchitecture() { + this._cpuArchitecture = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuArchitectureInput() { + return this._cpuArchitecture; + } + + // ecs_flavor - computed: true, optional: true, required: false + private _ecsFlavor?: string; + public get ecsFlavor() { + return this.getStringAttribute('ecs_flavor'); + } + public set ecsFlavor(value: string) { + this._ecsFlavor = value; + } + public resetEcsFlavor() { + this._ecsFlavor = undefined; + } + // Temporarily expose input value. Use with caution. + public get ecsFlavorInput() { + return this._ecsFlavor; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // group_id - computed: false, optional: true, required: false + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + public resetGroupId() { + this._groupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // res_tenant - computed: false, optional: true, required: false + private _resTenant?: boolean | cdktf.IResolvable; + public get resTenant() { + return this.getBooleanAttribute('res_tenant'); + } + public set resTenant(value: boolean | cdktf.IResolvable) { + this._resTenant = value; + } + public resetResTenant() { + this._resTenant = undefined; + } + // Temporarily expose input value. Use with caution. + public get resTenantInput() { + return this._resTenant; + } + + // run_status - computed: true, optional: false, required: false + public get runStatus() { + return this.getNumberAttribute('run_status'); + } + + // security_group - computed: false, optional: false, required: true + private _securityGroup?: string[]; + public get securityGroup() { + return this.getListAttribute('security_group'); + } + public set securityGroup(value: string[]) { + this._securityGroup = value; + } + // Temporarily expose input value. Use with caution. + public get securityGroupInput() { + return this._securityGroup; + } + + // server_id - computed: true, optional: false, required: false + public get serverId() { + return this.getStringAttribute('server_id'); + } + + // service_ip - computed: true, optional: false, required: false + public get serviceIp() { + return this.getStringAttribute('service_ip'); + } + + // specification_code - computed: false, optional: false, required: true + private _specificationCode?: string; + public get specificationCode() { + return this.getStringAttribute('specification_code'); + } + public set specificationCode(value: string) { + this._specificationCode = value; + } + // Temporarily expose input value. Use with caution. + public get specificationCodeInput() { + return this._specificationCode; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // upgradable - computed: true, optional: false, required: false + public get upgradable() { + return this.getNumberAttribute('upgradable'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WafDedicatedInstanceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WafDedicatedInstanceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + anti_affinity: cdktf.booleanToTerraform(this._antiAffinity), + available_zone: cdktf.stringToTerraform(this._availableZone), + cpu_architecture: cdktf.stringToTerraform(this._cpuArchitecture), + ecs_flavor: cdktf.stringToTerraform(this._ecsFlavor), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + res_tenant: cdktf.booleanToTerraform(this._resTenant), + security_group: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroup), + specification_code: cdktf.stringToTerraform(this._specificationCode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + vpc_id: cdktf.stringToTerraform(this._vpcId), + timeouts: wafDedicatedInstanceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + anti_affinity: { + value: cdktf.booleanToHclTerraform(this._antiAffinity), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + available_zone: { + value: cdktf.stringToHclTerraform(this._availableZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cpu_architecture: { + value: cdktf.stringToHclTerraform(this._cpuArchitecture), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ecs_flavor: { + value: cdktf.stringToHclTerraform(this._ecsFlavor), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + res_tenant: { + value: cdktf.booleanToHclTerraform(this._resTenant), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + security_group: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroup), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + specification_code: { + value: cdktf.stringToHclTerraform(this._specificationCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: wafDedicatedInstanceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WafDedicatedInstanceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-domain/README.md b/src/constructs/providers/huaweicloud/waf-domain/README.md new file mode 100644 index 00000000..583487ef --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-domain/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_domain` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_domain`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain). diff --git a/src/constructs/providers/huaweicloud/waf-domain/index.ts b/src/constructs/providers/huaweicloud/waf-domain/index.ts new file mode 100644 index 00000000..2e339486 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-domain/index.ts @@ -0,0 +1,1545 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafDomainConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#certificate_id WafDomain#certificate_id} + */ + readonly certificateId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#certificate_name WafDomain#certificate_name} + */ + readonly certificateName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#charging_mode WafDomain#charging_mode} + */ + readonly chargingMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#cipher WafDomain#cipher} + */ + readonly cipher?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#description WafDomain#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#domain WafDomain#domain} + */ + readonly domain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#enterprise_project_id WafDomain#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#forward_header_map WafDomain#forward_header_map} + */ + readonly forwardHeaderMap?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#http2_enable WafDomain#http2_enable} + */ + readonly http2Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#id WafDomain#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#ipv6_enable WafDomain#ipv6_enable} + */ + readonly ipv6Enable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#keep_policy WafDomain#keep_policy} + */ + readonly keepPolicy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#lb_algorithm WafDomain#lb_algorithm} + */ + readonly lbAlgorithm?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#pci_3ds WafDomain#pci_3ds} + */ + readonly pci3Ds?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#pci_dss WafDomain#pci_dss} + */ + readonly pciDss?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#policy_id WafDomain#policy_id} + */ + readonly policyId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#protect_status WafDomain#protect_status} + */ + readonly protectStatus?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#proxy WafDomain#proxy} + */ + readonly proxy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#redirect_url WafDomain#redirect_url} + */ + readonly redirectUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#region WafDomain#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#tls WafDomain#tls} + */ + readonly tls?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#website_name WafDomain#website_name} + */ + readonly websiteName?: string; + /** + * custom_page block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#custom_page WafDomain#custom_page} + */ + readonly customPage?: WafDomainCustomPage; + /** + * server block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#server WafDomain#server} + */ + readonly server: WafDomainServer[] | cdktf.IResolvable; + /** + * timeout_settings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#timeout_settings WafDomain#timeout_settings} + */ + readonly timeoutSettings?: WafDomainTimeoutSettings; + /** + * traffic_mark block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#traffic_mark WafDomain#traffic_mark} + */ + readonly trafficMark?: WafDomainTrafficMark; +} +export interface WafDomainCustomPage { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#block_page_type WafDomain#block_page_type} + */ + readonly blockPageType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#http_return_code WafDomain#http_return_code} + */ + readonly httpReturnCode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#page_content WafDomain#page_content} + */ + readonly pageContent: string; +} + +export function wafDomainCustomPageToTerraform(struct?: WafDomainCustomPageOutputReference | WafDomainCustomPage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + block_page_type: cdktf.stringToTerraform(struct!.blockPageType), + http_return_code: cdktf.stringToTerraform(struct!.httpReturnCode), + page_content: cdktf.stringToTerraform(struct!.pageContent), + } +} + + +export function wafDomainCustomPageToHclTerraform(struct?: WafDomainCustomPageOutputReference | WafDomainCustomPage): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + block_page_type: { + value: cdktf.stringToHclTerraform(struct!.blockPageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + http_return_code: { + value: cdktf.stringToHclTerraform(struct!.httpReturnCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + page_content: { + value: cdktf.stringToHclTerraform(struct!.pageContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDomainCustomPageOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDomainCustomPage | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._blockPageType !== undefined) { + hasAnyValues = true; + internalValueResult.blockPageType = this._blockPageType; + } + if (this._httpReturnCode !== undefined) { + hasAnyValues = true; + internalValueResult.httpReturnCode = this._httpReturnCode; + } + if (this._pageContent !== undefined) { + hasAnyValues = true; + internalValueResult.pageContent = this._pageContent; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDomainCustomPage | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._blockPageType = undefined; + this._httpReturnCode = undefined; + this._pageContent = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._blockPageType = value.blockPageType; + this._httpReturnCode = value.httpReturnCode; + this._pageContent = value.pageContent; + } + } + + // block_page_type - computed: false, optional: false, required: true + private _blockPageType?: string; + public get blockPageType() { + return this.getStringAttribute('block_page_type'); + } + public set blockPageType(value: string) { + this._blockPageType = value; + } + // Temporarily expose input value. Use with caution. + public get blockPageTypeInput() { + return this._blockPageType; + } + + // http_return_code - computed: false, optional: false, required: true + private _httpReturnCode?: string; + public get httpReturnCode() { + return this.getStringAttribute('http_return_code'); + } + public set httpReturnCode(value: string) { + this._httpReturnCode = value; + } + // Temporarily expose input value. Use with caution. + public get httpReturnCodeInput() { + return this._httpReturnCode; + } + + // page_content - computed: false, optional: false, required: true + private _pageContent?: string; + public get pageContent() { + return this.getStringAttribute('page_content'); + } + public set pageContent(value: string) { + this._pageContent = value; + } + // Temporarily expose input value. Use with caution. + public get pageContentInput() { + return this._pageContent; + } +} +export interface WafDomainServer { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#address WafDomain#address} + */ + readonly address: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#client_protocol WafDomain#client_protocol} + */ + readonly clientProtocol: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#port WafDomain#port} + */ + readonly port: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#server_protocol WafDomain#server_protocol} + */ + readonly serverProtocol: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#type WafDomain#type} + */ + readonly type?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#weight WafDomain#weight} + */ + readonly weight?: number; +} + +export function wafDomainServerToTerraform(struct?: WafDomainServer | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + address: cdktf.stringToTerraform(struct!.address), + client_protocol: cdktf.stringToTerraform(struct!.clientProtocol), + port: cdktf.numberToTerraform(struct!.port), + server_protocol: cdktf.stringToTerraform(struct!.serverProtocol), + type: cdktf.stringToTerraform(struct!.type), + weight: cdktf.numberToTerraform(struct!.weight), + } +} + + +export function wafDomainServerToHclTerraform(struct?: WafDomainServer | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + address: { + value: cdktf.stringToHclTerraform(struct!.address), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + client_protocol: { + value: cdktf.stringToHclTerraform(struct!.clientProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + port: { + value: cdktf.numberToHclTerraform(struct!.port), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + server_protocol: { + value: cdktf.stringToHclTerraform(struct!.serverProtocol), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + weight: { + value: cdktf.numberToHclTerraform(struct!.weight), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDomainServerOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafDomainServer | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._address !== undefined) { + hasAnyValues = true; + internalValueResult.address = this._address; + } + if (this._clientProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.clientProtocol = this._clientProtocol; + } + if (this._port !== undefined) { + hasAnyValues = true; + internalValueResult.port = this._port; + } + if (this._serverProtocol !== undefined) { + hasAnyValues = true; + internalValueResult.serverProtocol = this._serverProtocol; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + if (this._weight !== undefined) { + hasAnyValues = true; + internalValueResult.weight = this._weight; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDomainServer | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._address = undefined; + this._clientProtocol = undefined; + this._port = undefined; + this._serverProtocol = undefined; + this._type = undefined; + this._weight = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._address = value.address; + this._clientProtocol = value.clientProtocol; + this._port = value.port; + this._serverProtocol = value.serverProtocol; + this._type = value.type; + this._weight = value.weight; + } + } + + // address - computed: false, optional: false, required: true + private _address?: string; + public get address() { + return this.getStringAttribute('address'); + } + public set address(value: string) { + this._address = value; + } + // Temporarily expose input value. Use with caution. + public get addressInput() { + return this._address; + } + + // client_protocol - computed: false, optional: false, required: true + private _clientProtocol?: string; + public get clientProtocol() { + return this.getStringAttribute('client_protocol'); + } + public set clientProtocol(value: string) { + this._clientProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get clientProtocolInput() { + return this._clientProtocol; + } + + // port - computed: false, optional: false, required: true + private _port?: number; + public get port() { + return this.getNumberAttribute('port'); + } + public set port(value: number) { + this._port = value; + } + // Temporarily expose input value. Use with caution. + public get portInput() { + return this._port; + } + + // server_protocol - computed: false, optional: false, required: true + private _serverProtocol?: string; + public get serverProtocol() { + return this.getStringAttribute('server_protocol'); + } + public set serverProtocol(value: string) { + this._serverProtocol = value; + } + // Temporarily expose input value. Use with caution. + public get serverProtocolInput() { + return this._serverProtocol; + } + + // type - computed: false, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // weight - computed: false, optional: true, required: false + private _weight?: number; + public get weight() { + return this.getNumberAttribute('weight'); + } + public set weight(value: number) { + this._weight = value; + } + public resetWeight() { + this._weight = undefined; + } + // Temporarily expose input value. Use with caution. + public get weightInput() { + return this._weight; + } +} + +export class WafDomainServerList extends cdktf.ComplexList { + public internalValue? : WafDomainServer[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafDomainServerOutputReference { + return new WafDomainServerOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WafDomainTimeoutSettings { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#connection_timeout WafDomain#connection_timeout} + */ + readonly connectionTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#read_timeout WafDomain#read_timeout} + */ + readonly readTimeout?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#write_timeout WafDomain#write_timeout} + */ + readonly writeTimeout?: number; +} + +export function wafDomainTimeoutSettingsToTerraform(struct?: WafDomainTimeoutSettingsOutputReference | WafDomainTimeoutSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + connection_timeout: cdktf.numberToTerraform(struct!.connectionTimeout), + read_timeout: cdktf.numberToTerraform(struct!.readTimeout), + write_timeout: cdktf.numberToTerraform(struct!.writeTimeout), + } +} + + +export function wafDomainTimeoutSettingsToHclTerraform(struct?: WafDomainTimeoutSettingsOutputReference | WafDomainTimeoutSettings): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + connection_timeout: { + value: cdktf.numberToHclTerraform(struct!.connectionTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + read_timeout: { + value: cdktf.numberToHclTerraform(struct!.readTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + write_timeout: { + value: cdktf.numberToHclTerraform(struct!.writeTimeout), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDomainTimeoutSettingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDomainTimeoutSettings | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._connectionTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.connectionTimeout = this._connectionTimeout; + } + if (this._readTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.readTimeout = this._readTimeout; + } + if (this._writeTimeout !== undefined) { + hasAnyValues = true; + internalValueResult.writeTimeout = this._writeTimeout; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDomainTimeoutSettings | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._connectionTimeout = undefined; + this._readTimeout = undefined; + this._writeTimeout = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._connectionTimeout = value.connectionTimeout; + this._readTimeout = value.readTimeout; + this._writeTimeout = value.writeTimeout; + } + } + + // connection_timeout - computed: true, optional: true, required: false + private _connectionTimeout?: number; + public get connectionTimeout() { + return this.getNumberAttribute('connection_timeout'); + } + public set connectionTimeout(value: number) { + this._connectionTimeout = value; + } + public resetConnectionTimeout() { + this._connectionTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get connectionTimeoutInput() { + return this._connectionTimeout; + } + + // read_timeout - computed: true, optional: true, required: false + private _readTimeout?: number; + public get readTimeout() { + return this.getNumberAttribute('read_timeout'); + } + public set readTimeout(value: number) { + this._readTimeout = value; + } + public resetReadTimeout() { + this._readTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get readTimeoutInput() { + return this._readTimeout; + } + + // write_timeout - computed: true, optional: true, required: false + private _writeTimeout?: number; + public get writeTimeout() { + return this.getNumberAttribute('write_timeout'); + } + public set writeTimeout(value: number) { + this._writeTimeout = value; + } + public resetWriteTimeout() { + this._writeTimeout = undefined; + } + // Temporarily expose input value. Use with caution. + public get writeTimeoutInput() { + return this._writeTimeout; + } +} +export interface WafDomainTrafficMark { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#ip_tags WafDomain#ip_tags} + */ + readonly ipTags?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#session_tag WafDomain#session_tag} + */ + readonly sessionTag?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#user_tag WafDomain#user_tag} + */ + readonly userTag?: string; +} + +export function wafDomainTrafficMarkToTerraform(struct?: WafDomainTrafficMarkOutputReference | WafDomainTrafficMark): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_tags: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.ipTags), + session_tag: cdktf.stringToTerraform(struct!.sessionTag), + user_tag: cdktf.stringToTerraform(struct!.userTag), + } +} + + +export function wafDomainTrafficMarkToHclTerraform(struct?: WafDomainTrafficMarkOutputReference | WafDomainTrafficMark): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_tags: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct!.ipTags), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + session_tag: { + value: cdktf.stringToHclTerraform(struct!.sessionTag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_tag: { + value: cdktf.stringToHclTerraform(struct!.userTag), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafDomainTrafficMarkOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WafDomainTrafficMark | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipTags !== undefined) { + hasAnyValues = true; + internalValueResult.ipTags = this._ipTags; + } + if (this._sessionTag !== undefined) { + hasAnyValues = true; + internalValueResult.sessionTag = this._sessionTag; + } + if (this._userTag !== undefined) { + hasAnyValues = true; + internalValueResult.userTag = this._userTag; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafDomainTrafficMark | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipTags = undefined; + this._sessionTag = undefined; + this._userTag = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipTags = value.ipTags; + this._sessionTag = value.sessionTag; + this._userTag = value.userTag; + } + } + + // ip_tags - computed: true, optional: true, required: false + private _ipTags?: string[]; + public get ipTags() { + return this.getListAttribute('ip_tags'); + } + public set ipTags(value: string[]) { + this._ipTags = value; + } + public resetIpTags() { + this._ipTags = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipTagsInput() { + return this._ipTags; + } + + // session_tag - computed: true, optional: true, required: false + private _sessionTag?: string; + public get sessionTag() { + return this.getStringAttribute('session_tag'); + } + public set sessionTag(value: string) { + this._sessionTag = value; + } + public resetSessionTag() { + this._sessionTag = undefined; + } + // Temporarily expose input value. Use with caution. + public get sessionTagInput() { + return this._sessionTag; + } + + // user_tag - computed: true, optional: true, required: false + private _userTag?: string; + public get userTag() { + return this.getStringAttribute('user_tag'); + } + public set userTag(value: string) { + this._userTag = value; + } + public resetUserTag() { + this._userTag = undefined; + } + // Temporarily expose input value. Use with caution. + public get userTagInput() { + return this._userTag; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain huaweicloud_waf_domain} +*/ +export class WafDomain extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_domain"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafDomain resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafDomain to import + * @param importFromId The id of the existing WafDomain that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafDomain to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_domain", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_domain huaweicloud_waf_domain} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafDomainConfig + */ + public constructor(scope: Construct, id: string, config: WafDomainConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_domain', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._certificateId = config.certificateId; + this._certificateName = config.certificateName; + this._chargingMode = config.chargingMode; + this._cipher = config.cipher; + this._description = config.description; + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._forwardHeaderMap = config.forwardHeaderMap; + this._http2Enable = config.http2Enable; + this._id = config.id; + this._ipv6Enable = config.ipv6Enable; + this._keepPolicy = config.keepPolicy; + this._lbAlgorithm = config.lbAlgorithm; + this._pci3Ds = config.pci3Ds; + this._pciDss = config.pciDss; + this._policyId = config.policyId; + this._protectStatus = config.protectStatus; + this._proxy = config.proxy; + this._redirectUrl = config.redirectUrl; + this._region = config.region; + this._tls = config.tls; + this._websiteName = config.websiteName; + this._customPage.internalValue = config.customPage; + this._server.internalValue = config.server; + this._timeoutSettings.internalValue = config.timeoutSettings; + this._trafficMark.internalValue = config.trafficMark; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_code - computed: true, optional: false, required: false + public get accessCode() { + return this.getStringAttribute('access_code'); + } + + // access_status - computed: true, optional: false, required: false + public get accessStatus() { + return this.getNumberAttribute('access_status'); + } + + // certificate_id - computed: false, optional: true, required: false + private _certificateId?: string; + public get certificateId() { + return this.getStringAttribute('certificate_id'); + } + public set certificateId(value: string) { + this._certificateId = value; + } + public resetCertificateId() { + this._certificateId = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateIdInput() { + return this._certificateId; + } + + // certificate_name - computed: false, optional: true, required: false + private _certificateName?: string; + public get certificateName() { + return this.getStringAttribute('certificate_name'); + } + public set certificateName(value: string) { + this._certificateName = value; + } + public resetCertificateName() { + this._certificateName = undefined; + } + // Temporarily expose input value. Use with caution. + public get certificateNameInput() { + return this._certificateName; + } + + // charging_mode - computed: false, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // cipher - computed: true, optional: true, required: false + private _cipher?: string; + public get cipher() { + return this.getStringAttribute('cipher'); + } + public set cipher(value: string) { + this._cipher = value; + } + public resetCipher() { + this._cipher = undefined; + } + // Temporarily expose input value. Use with caution. + public get cipherInput() { + return this._cipher; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // forward_header_map - computed: true, optional: true, required: false + private _forwardHeaderMap?: { [key: string]: string }; + public get forwardHeaderMap() { + return this.getStringMapAttribute('forward_header_map'); + } + public set forwardHeaderMap(value: { [key: string]: string }) { + this._forwardHeaderMap = value; + } + public resetForwardHeaderMap() { + this._forwardHeaderMap = undefined; + } + // Temporarily expose input value. Use with caution. + public get forwardHeaderMapInput() { + return this._forwardHeaderMap; + } + + // http2_enable - computed: true, optional: true, required: false + private _http2Enable?: boolean | cdktf.IResolvable; + public get http2Enable() { + return this.getBooleanAttribute('http2_enable'); + } + public set http2Enable(value: boolean | cdktf.IResolvable) { + this._http2Enable = value; + } + public resetHttp2Enable() { + this._http2Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get http2EnableInput() { + return this._http2Enable; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ipv6_enable - computed: true, optional: true, required: false + private _ipv6Enable?: boolean | cdktf.IResolvable; + public get ipv6Enable() { + return this.getBooleanAttribute('ipv6_enable'); + } + public set ipv6Enable(value: boolean | cdktf.IResolvable) { + this._ipv6Enable = value; + } + public resetIpv6Enable() { + this._ipv6Enable = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipv6EnableInput() { + return this._ipv6Enable; + } + + // keep_policy - computed: false, optional: true, required: false + private _keepPolicy?: boolean | cdktf.IResolvable; + public get keepPolicy() { + return this.getBooleanAttribute('keep_policy'); + } + public set keepPolicy(value: boolean | cdktf.IResolvable) { + this._keepPolicy = value; + } + public resetKeepPolicy() { + this._keepPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get keepPolicyInput() { + return this._keepPolicy; + } + + // lb_algorithm - computed: true, optional: true, required: false + private _lbAlgorithm?: string; + public get lbAlgorithm() { + return this.getStringAttribute('lb_algorithm'); + } + public set lbAlgorithm(value: string) { + this._lbAlgorithm = value; + } + public resetLbAlgorithm() { + this._lbAlgorithm = undefined; + } + // Temporarily expose input value. Use with caution. + public get lbAlgorithmInput() { + return this._lbAlgorithm; + } + + // pci_3ds - computed: true, optional: true, required: false + private _pci3Ds?: boolean | cdktf.IResolvable; + public get pci3Ds() { + return this.getBooleanAttribute('pci_3ds'); + } + public set pci3Ds(value: boolean | cdktf.IResolvable) { + this._pci3Ds = value; + } + public resetPci3Ds() { + this._pci3Ds = undefined; + } + // Temporarily expose input value. Use with caution. + public get pci3DsInput() { + return this._pci3Ds; + } + + // pci_dss - computed: true, optional: true, required: false + private _pciDss?: boolean | cdktf.IResolvable; + public get pciDss() { + return this.getBooleanAttribute('pci_dss'); + } + public set pciDss(value: boolean | cdktf.IResolvable) { + this._pciDss = value; + } + public resetPciDss() { + this._pciDss = undefined; + } + // Temporarily expose input value. Use with caution. + public get pciDssInput() { + return this._pciDss; + } + + // policy_id - computed: true, optional: true, required: false + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + public resetPolicyId() { + this._policyId = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protect_status - computed: true, optional: true, required: false + private _protectStatus?: number; + public get protectStatus() { + return this.getNumberAttribute('protect_status'); + } + public set protectStatus(value: number) { + this._protectStatus = value; + } + public resetProtectStatus() { + this._protectStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectStatusInput() { + return this._protectStatus; + } + + // protocol - computed: true, optional: false, required: false + public get protocol() { + return this.getStringAttribute('protocol'); + } + + // proxy - computed: false, optional: true, required: false + private _proxy?: boolean | cdktf.IResolvable; + public get proxy() { + return this.getBooleanAttribute('proxy'); + } + public set proxy(value: boolean | cdktf.IResolvable) { + this._proxy = value; + } + public resetProxy() { + this._proxy = undefined; + } + // Temporarily expose input value. Use with caution. + public get proxyInput() { + return this._proxy; + } + + // redirect_url - computed: false, optional: true, required: false + private _redirectUrl?: string; + public get redirectUrl() { + return this.getStringAttribute('redirect_url'); + } + public set redirectUrl(value: string) { + this._redirectUrl = value; + } + public resetRedirectUrl() { + this._redirectUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get redirectUrlInput() { + return this._redirectUrl; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // tls - computed: true, optional: true, required: false + private _tls?: string; + public get tls() { + return this.getStringAttribute('tls'); + } + public set tls(value: string) { + this._tls = value; + } + public resetTls() { + this._tls = undefined; + } + // Temporarily expose input value. Use with caution. + public get tlsInput() { + return this._tls; + } + + // website_name - computed: true, optional: true, required: false + private _websiteName?: string; + public get websiteName() { + return this.getStringAttribute('website_name'); + } + public set websiteName(value: string) { + this._websiteName = value; + } + public resetWebsiteName() { + this._websiteName = undefined; + } + // Temporarily expose input value. Use with caution. + public get websiteNameInput() { + return this._websiteName; + } + + // custom_page - computed: false, optional: true, required: false + private _customPage = new WafDomainCustomPageOutputReference(this, "custom_page"); + public get customPage() { + return this._customPage; + } + public putCustomPage(value: WafDomainCustomPage) { + this._customPage.internalValue = value; + } + public resetCustomPage() { + this._customPage.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get customPageInput() { + return this._customPage.internalValue; + } + + // server - computed: false, optional: false, required: true + private _server = new WafDomainServerList(this, "server", false); + public get server() { + return this._server; + } + public putServer(value: WafDomainServer[] | cdktf.IResolvable) { + this._server.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get serverInput() { + return this._server.internalValue; + } + + // timeout_settings - computed: false, optional: true, required: false + private _timeoutSettings = new WafDomainTimeoutSettingsOutputReference(this, "timeout_settings"); + public get timeoutSettings() { + return this._timeoutSettings; + } + public putTimeoutSettings(value: WafDomainTimeoutSettings) { + this._timeoutSettings.internalValue = value; + } + public resetTimeoutSettings() { + this._timeoutSettings.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutSettingsInput() { + return this._timeoutSettings.internalValue; + } + + // traffic_mark - computed: false, optional: true, required: false + private _trafficMark = new WafDomainTrafficMarkOutputReference(this, "traffic_mark"); + public get trafficMark() { + return this._trafficMark; + } + public putTrafficMark(value: WafDomainTrafficMark) { + this._trafficMark.internalValue = value; + } + public resetTrafficMark() { + this._trafficMark.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get trafficMarkInput() { + return this._trafficMark.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + certificate_id: cdktf.stringToTerraform(this._certificateId), + certificate_name: cdktf.stringToTerraform(this._certificateName), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + cipher: cdktf.stringToTerraform(this._cipher), + description: cdktf.stringToTerraform(this._description), + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + forward_header_map: cdktf.hashMapper(cdktf.stringToTerraform)(this._forwardHeaderMap), + http2_enable: cdktf.booleanToTerraform(this._http2Enable), + id: cdktf.stringToTerraform(this._id), + ipv6_enable: cdktf.booleanToTerraform(this._ipv6Enable), + keep_policy: cdktf.booleanToTerraform(this._keepPolicy), + lb_algorithm: cdktf.stringToTerraform(this._lbAlgorithm), + pci_3ds: cdktf.booleanToTerraform(this._pci3Ds), + pci_dss: cdktf.booleanToTerraform(this._pciDss), + policy_id: cdktf.stringToTerraform(this._policyId), + protect_status: cdktf.numberToTerraform(this._protectStatus), + proxy: cdktf.booleanToTerraform(this._proxy), + redirect_url: cdktf.stringToTerraform(this._redirectUrl), + region: cdktf.stringToTerraform(this._region), + tls: cdktf.stringToTerraform(this._tls), + website_name: cdktf.stringToTerraform(this._websiteName), + custom_page: wafDomainCustomPageToTerraform(this._customPage.internalValue), + server: cdktf.listMapper(wafDomainServerToTerraform, true)(this._server.internalValue), + timeout_settings: wafDomainTimeoutSettingsToTerraform(this._timeoutSettings.internalValue), + traffic_mark: wafDomainTrafficMarkToTerraform(this._trafficMark.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + certificate_id: { + value: cdktf.stringToHclTerraform(this._certificateId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + certificate_name: { + value: cdktf.stringToHclTerraform(this._certificateName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cipher: { + value: cdktf.stringToHclTerraform(this._cipher), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + forward_header_map: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._forwardHeaderMap), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + http2_enable: { + value: cdktf.booleanToHclTerraform(this._http2Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ipv6_enable: { + value: cdktf.booleanToHclTerraform(this._ipv6Enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + keep_policy: { + value: cdktf.booleanToHclTerraform(this._keepPolicy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + lb_algorithm: { + value: cdktf.stringToHclTerraform(this._lbAlgorithm), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + pci_3ds: { + value: cdktf.booleanToHclTerraform(this._pci3Ds), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + pci_dss: { + value: cdktf.booleanToHclTerraform(this._pciDss), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protect_status: { + value: cdktf.numberToHclTerraform(this._protectStatus), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + proxy: { + value: cdktf.booleanToHclTerraform(this._proxy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + redirect_url: { + value: cdktf.stringToHclTerraform(this._redirectUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tls: { + value: cdktf.stringToHclTerraform(this._tls), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + website_name: { + value: cdktf.stringToHclTerraform(this._websiteName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + custom_page: { + value: wafDomainCustomPageToHclTerraform(this._customPage.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDomainCustomPageList", + }, + server: { + value: cdktf.listMapperHcl(wafDomainServerToHclTerraform, true)(this._server.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDomainServerList", + }, + timeout_settings: { + value: wafDomainTimeoutSettingsToHclTerraform(this._timeoutSettings.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDomainTimeoutSettingsList", + }, + traffic_mark: { + value: wafDomainTrafficMarkToHclTerraform(this._trafficMark.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafDomainTrafficMarkList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-instance-group-associate/README.md b/src/constructs/providers/huaweicloud/waf-instance-group-associate/README.md new file mode 100644 index 00000000..faed6cda --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-instance-group-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_instance_group_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_instance_group_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate). diff --git a/src/constructs/providers/huaweicloud/waf-instance-group-associate/index.ts b/src/constructs/providers/huaweicloud/waf-instance-group-associate/index.ts new file mode 100644 index 00000000..5f393c84 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-instance-group-associate/index.ts @@ -0,0 +1,194 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafInstanceGroupAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate#group_id WafInstanceGroupAssociate#group_id} + */ + readonly groupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate#id WafInstanceGroupAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate#load_balancers WafInstanceGroupAssociate#load_balancers} + */ + readonly loadBalancers: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate#region WafInstanceGroupAssociate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate huaweicloud_waf_instance_group_associate} +*/ +export class WafInstanceGroupAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_instance_group_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafInstanceGroupAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafInstanceGroupAssociate to import + * @param importFromId The id of the existing WafInstanceGroupAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafInstanceGroupAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_instance_group_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group_associate huaweicloud_waf_instance_group_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafInstanceGroupAssociateConfig + */ + public constructor(scope: Construct, id: string, config: WafInstanceGroupAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_instance_group_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._groupId = config.groupId; + this._id = config.id; + this._loadBalancers = config.loadBalancers; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // group_id - computed: false, optional: false, required: true + private _groupId?: string; + public get groupId() { + return this.getStringAttribute('group_id'); + } + public set groupId(value: string) { + this._groupId = value; + } + // Temporarily expose input value. Use with caution. + public get groupIdInput() { + return this._groupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // load_balancers - computed: false, optional: false, required: true + private _loadBalancers?: string[]; + public get loadBalancers() { + return cdktf.Fn.tolist(this.getListAttribute('load_balancers')); + } + public set loadBalancers(value: string[]) { + this._loadBalancers = value; + } + // Temporarily expose input value. Use with caution. + public get loadBalancersInput() { + return this._loadBalancers; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + group_id: cdktf.stringToTerraform(this._groupId), + id: cdktf.stringToTerraform(this._id), + load_balancers: cdktf.listMapper(cdktf.stringToTerraform, false)(this._loadBalancers), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + group_id: { + value: cdktf.stringToHclTerraform(this._groupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + load_balancers: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._loadBalancers), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-instance-group/README.md b/src/constructs/providers/huaweicloud/waf-instance-group/README.md new file mode 100644 index 00000000..ad1a092d --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-instance-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_instance_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_instance_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group). diff --git a/src/constructs/providers/huaweicloud/waf-instance-group/index.ts b/src/constructs/providers/huaweicloud/waf-instance-group/index.ts new file mode 100644 index 00000000..4343d863 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-instance-group/index.ts @@ -0,0 +1,252 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafInstanceGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group#description WafInstanceGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group#id WafInstanceGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group#name WafInstanceGroup#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group#region WafInstanceGroup#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group#vpc_id WafInstanceGroup#vpc_id} + */ + readonly vpcId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group huaweicloud_waf_instance_group} +*/ +export class WafInstanceGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_instance_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafInstanceGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafInstanceGroup to import + * @param importFromId The id of the existing WafInstanceGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafInstanceGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_instance_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_instance_group huaweicloud_waf_instance_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafInstanceGroupConfig + */ + public constructor(scope: Construct, id: string, config: WafInstanceGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_instance_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._vpcId = config.vpcId; + } + + // ========== + // ATTRIBUTES + // ========== + + // body_limit - computed: true, optional: false, required: false + public get bodyLimit() { + return this.getNumberAttribute('body_limit'); + } + + // connection_timeout - computed: true, optional: false, required: false + public get connectionTimeout() { + return this.getNumberAttribute('connection_timeout'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // header_limit - computed: true, optional: false, required: false + public get headerLimit() { + return this.getNumberAttribute('header_limit'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // load_balancers - computed: true, optional: false, required: false + public get loadBalancers() { + return this.getListAttribute('load_balancers'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // read_timeout - computed: true, optional: false, required: false + public get readTimeout() { + return this.getNumberAttribute('read_timeout'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // write_timeout - computed: true, optional: false, required: false + public get writeTimeout() { + return this.getNumberAttribute('write_timeout'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-policy/README.md b/src/constructs/providers/huaweicloud/waf-policy/README.md new file mode 100644 index 00000000..f5b4b212 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy). diff --git a/src/constructs/providers/huaweicloud/waf-policy/index.ts b/src/constructs/providers/huaweicloud/waf-policy/index.ts new file mode 100644 index 00000000..c2b736ac --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-policy/index.ts @@ -0,0 +1,1358 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#deep_inspection WafPolicy#deep_inspection} + */ + readonly deepInspection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#enterprise_project_id WafPolicy#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#full_detection WafPolicy#full_detection} + */ + readonly fullDetection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#header_inspection WafPolicy#header_inspection} + */ + readonly headerInspection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#id WafPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#level WafPolicy#level} + */ + readonly level?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#name WafPolicy#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#protection_mode WafPolicy#protection_mode} + */ + readonly protectionMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#region WafPolicy#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#robot_action WafPolicy#robot_action} + */ + readonly robotAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#shiro_decryption_check WafPolicy#shiro_decryption_check} + */ + readonly shiroDecryptionCheck?: boolean | cdktf.IResolvable; + /** + * options block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#options WafPolicy#options} + */ + readonly options?: WafPolicyOptions[] | cdktf.IResolvable; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#timeouts WafPolicy#timeouts} + */ + readonly timeouts?: WafPolicyTimeouts; +} +export interface WafPolicyBindHosts { +} + +export function wafPolicyBindHostsToTerraform(struct?: WafPolicyBindHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function wafPolicyBindHostsToHclTerraform(struct?: WafPolicyBindHosts): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class WafPolicyBindHostsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafPolicyBindHosts | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafPolicyBindHosts | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // hostname - computed: true, optional: false, required: false + public get hostname() { + return this.getStringAttribute('hostname'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mode - computed: true, optional: false, required: false + public get mode() { + return this.getStringAttribute('mode'); + } + + // waf_type - computed: true, optional: false, required: false + public get wafType() { + return this.getStringAttribute('waf_type'); + } +} + +export class WafPolicyBindHostsList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafPolicyBindHostsOutputReference { + return new WafPolicyBindHostsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WafPolicyOptions { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#anti_crawler WafPolicy#anti_crawler} + */ + readonly antiCrawler?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#basic_web_protection WafPolicy#basic_web_protection} + */ + readonly basicWebProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#blacklist WafPolicy#blacklist} + */ + readonly blacklist?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#bot_enable WafPolicy#bot_enable} + */ + readonly botEnable?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#cc_attack_protection WafPolicy#cc_attack_protection} + */ + readonly ccAttackProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#crawler_engine WafPolicy#crawler_engine} + */ + readonly crawlerEngine?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#crawler_other WafPolicy#crawler_other} + */ + readonly crawlerOther?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#crawler_scanner WafPolicy#crawler_scanner} + */ + readonly crawlerScanner?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#crawler_script WafPolicy#crawler_script} + */ + readonly crawlerScript?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#data_masking WafPolicy#data_masking} + */ + readonly dataMasking?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#false_alarm_masking WafPolicy#false_alarm_masking} + */ + readonly falseAlarmMasking?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#general_check WafPolicy#general_check} + */ + readonly generalCheck?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#geolocation_access_control WafPolicy#geolocation_access_control} + */ + readonly geolocationAccessControl?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#information_leakage_prevention WafPolicy#information_leakage_prevention} + */ + readonly informationLeakagePrevention?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#known_attack_source WafPolicy#known_attack_source} + */ + readonly knownAttackSource?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#precise_protection WafPolicy#precise_protection} + */ + readonly preciseProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#web_tamper_protection WafPolicy#web_tamper_protection} + */ + readonly webTamperProtection?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#webshell WafPolicy#webshell} + */ + readonly webshell?: boolean | cdktf.IResolvable; +} + +export function wafPolicyOptionsToTerraform(struct?: WafPolicyOptions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + anti_crawler: cdktf.booleanToTerraform(struct!.antiCrawler), + basic_web_protection: cdktf.booleanToTerraform(struct!.basicWebProtection), + blacklist: cdktf.booleanToTerraform(struct!.blacklist), + bot_enable: cdktf.booleanToTerraform(struct!.botEnable), + cc_attack_protection: cdktf.booleanToTerraform(struct!.ccAttackProtection), + crawler_engine: cdktf.booleanToTerraform(struct!.crawlerEngine), + crawler_other: cdktf.booleanToTerraform(struct!.crawlerOther), + crawler_scanner: cdktf.booleanToTerraform(struct!.crawlerScanner), + crawler_script: cdktf.booleanToTerraform(struct!.crawlerScript), + data_masking: cdktf.booleanToTerraform(struct!.dataMasking), + false_alarm_masking: cdktf.booleanToTerraform(struct!.falseAlarmMasking), + general_check: cdktf.booleanToTerraform(struct!.generalCheck), + geolocation_access_control: cdktf.booleanToTerraform(struct!.geolocationAccessControl), + information_leakage_prevention: cdktf.booleanToTerraform(struct!.informationLeakagePrevention), + known_attack_source: cdktf.booleanToTerraform(struct!.knownAttackSource), + precise_protection: cdktf.booleanToTerraform(struct!.preciseProtection), + web_tamper_protection: cdktf.booleanToTerraform(struct!.webTamperProtection), + webshell: cdktf.booleanToTerraform(struct!.webshell), + } +} + + +export function wafPolicyOptionsToHclTerraform(struct?: WafPolicyOptions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + anti_crawler: { + value: cdktf.booleanToHclTerraform(struct!.antiCrawler), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + basic_web_protection: { + value: cdktf.booleanToHclTerraform(struct!.basicWebProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + blacklist: { + value: cdktf.booleanToHclTerraform(struct!.blacklist), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + bot_enable: { + value: cdktf.booleanToHclTerraform(struct!.botEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + cc_attack_protection: { + value: cdktf.booleanToHclTerraform(struct!.ccAttackProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + crawler_engine: { + value: cdktf.booleanToHclTerraform(struct!.crawlerEngine), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + crawler_other: { + value: cdktf.booleanToHclTerraform(struct!.crawlerOther), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + crawler_scanner: { + value: cdktf.booleanToHclTerraform(struct!.crawlerScanner), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + crawler_script: { + value: cdktf.booleanToHclTerraform(struct!.crawlerScript), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + data_masking: { + value: cdktf.booleanToHclTerraform(struct!.dataMasking), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + false_alarm_masking: { + value: cdktf.booleanToHclTerraform(struct!.falseAlarmMasking), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + general_check: { + value: cdktf.booleanToHclTerraform(struct!.generalCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + geolocation_access_control: { + value: cdktf.booleanToHclTerraform(struct!.geolocationAccessControl), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + information_leakage_prevention: { + value: cdktf.booleanToHclTerraform(struct!.informationLeakagePrevention), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + known_attack_source: { + value: cdktf.booleanToHclTerraform(struct!.knownAttackSource), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + precise_protection: { + value: cdktf.booleanToHclTerraform(struct!.preciseProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + web_tamper_protection: { + value: cdktf.booleanToHclTerraform(struct!.webTamperProtection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + webshell: { + value: cdktf.booleanToHclTerraform(struct!.webshell), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafPolicyOptionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafPolicyOptions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._antiCrawler !== undefined) { + hasAnyValues = true; + internalValueResult.antiCrawler = this._antiCrawler; + } + if (this._basicWebProtection !== undefined) { + hasAnyValues = true; + internalValueResult.basicWebProtection = this._basicWebProtection; + } + if (this._blacklist !== undefined) { + hasAnyValues = true; + internalValueResult.blacklist = this._blacklist; + } + if (this._botEnable !== undefined) { + hasAnyValues = true; + internalValueResult.botEnable = this._botEnable; + } + if (this._ccAttackProtection !== undefined) { + hasAnyValues = true; + internalValueResult.ccAttackProtection = this._ccAttackProtection; + } + if (this._crawlerEngine !== undefined) { + hasAnyValues = true; + internalValueResult.crawlerEngine = this._crawlerEngine; + } + if (this._crawlerOther !== undefined) { + hasAnyValues = true; + internalValueResult.crawlerOther = this._crawlerOther; + } + if (this._crawlerScanner !== undefined) { + hasAnyValues = true; + internalValueResult.crawlerScanner = this._crawlerScanner; + } + if (this._crawlerScript !== undefined) { + hasAnyValues = true; + internalValueResult.crawlerScript = this._crawlerScript; + } + if (this._dataMasking !== undefined) { + hasAnyValues = true; + internalValueResult.dataMasking = this._dataMasking; + } + if (this._falseAlarmMasking !== undefined) { + hasAnyValues = true; + internalValueResult.falseAlarmMasking = this._falseAlarmMasking; + } + if (this._generalCheck !== undefined) { + hasAnyValues = true; + internalValueResult.generalCheck = this._generalCheck; + } + if (this._geolocationAccessControl !== undefined) { + hasAnyValues = true; + internalValueResult.geolocationAccessControl = this._geolocationAccessControl; + } + if (this._informationLeakagePrevention !== undefined) { + hasAnyValues = true; + internalValueResult.informationLeakagePrevention = this._informationLeakagePrevention; + } + if (this._knownAttackSource !== undefined) { + hasAnyValues = true; + internalValueResult.knownAttackSource = this._knownAttackSource; + } + if (this._preciseProtection !== undefined) { + hasAnyValues = true; + internalValueResult.preciseProtection = this._preciseProtection; + } + if (this._webTamperProtection !== undefined) { + hasAnyValues = true; + internalValueResult.webTamperProtection = this._webTamperProtection; + } + if (this._webshell !== undefined) { + hasAnyValues = true; + internalValueResult.webshell = this._webshell; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafPolicyOptions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._antiCrawler = undefined; + this._basicWebProtection = undefined; + this._blacklist = undefined; + this._botEnable = undefined; + this._ccAttackProtection = undefined; + this._crawlerEngine = undefined; + this._crawlerOther = undefined; + this._crawlerScanner = undefined; + this._crawlerScript = undefined; + this._dataMasking = undefined; + this._falseAlarmMasking = undefined; + this._generalCheck = undefined; + this._geolocationAccessControl = undefined; + this._informationLeakagePrevention = undefined; + this._knownAttackSource = undefined; + this._preciseProtection = undefined; + this._webTamperProtection = undefined; + this._webshell = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._antiCrawler = value.antiCrawler; + this._basicWebProtection = value.basicWebProtection; + this._blacklist = value.blacklist; + this._botEnable = value.botEnable; + this._ccAttackProtection = value.ccAttackProtection; + this._crawlerEngine = value.crawlerEngine; + this._crawlerOther = value.crawlerOther; + this._crawlerScanner = value.crawlerScanner; + this._crawlerScript = value.crawlerScript; + this._dataMasking = value.dataMasking; + this._falseAlarmMasking = value.falseAlarmMasking; + this._generalCheck = value.generalCheck; + this._geolocationAccessControl = value.geolocationAccessControl; + this._informationLeakagePrevention = value.informationLeakagePrevention; + this._knownAttackSource = value.knownAttackSource; + this._preciseProtection = value.preciseProtection; + this._webTamperProtection = value.webTamperProtection; + this._webshell = value.webshell; + } + } + + // anti_crawler - computed: false, optional: true, required: false + private _antiCrawler?: boolean | cdktf.IResolvable; + public get antiCrawler() { + return this.getBooleanAttribute('anti_crawler'); + } + public set antiCrawler(value: boolean | cdktf.IResolvable) { + this._antiCrawler = value; + } + public resetAntiCrawler() { + this._antiCrawler = undefined; + } + // Temporarily expose input value. Use with caution. + public get antiCrawlerInput() { + return this._antiCrawler; + } + + // basic_web_protection - computed: false, optional: true, required: false + private _basicWebProtection?: boolean | cdktf.IResolvable; + public get basicWebProtection() { + return this.getBooleanAttribute('basic_web_protection'); + } + public set basicWebProtection(value: boolean | cdktf.IResolvable) { + this._basicWebProtection = value; + } + public resetBasicWebProtection() { + this._basicWebProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get basicWebProtectionInput() { + return this._basicWebProtection; + } + + // blacklist - computed: false, optional: true, required: false + private _blacklist?: boolean | cdktf.IResolvable; + public get blacklist() { + return this.getBooleanAttribute('blacklist'); + } + public set blacklist(value: boolean | cdktf.IResolvable) { + this._blacklist = value; + } + public resetBlacklist() { + this._blacklist = undefined; + } + // Temporarily expose input value. Use with caution. + public get blacklistInput() { + return this._blacklist; + } + + // bot_enable - computed: false, optional: true, required: false + private _botEnable?: boolean | cdktf.IResolvable; + public get botEnable() { + return this.getBooleanAttribute('bot_enable'); + } + public set botEnable(value: boolean | cdktf.IResolvable) { + this._botEnable = value; + } + public resetBotEnable() { + this._botEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get botEnableInput() { + return this._botEnable; + } + + // cc_attack_protection - computed: false, optional: true, required: false + private _ccAttackProtection?: boolean | cdktf.IResolvable; + public get ccAttackProtection() { + return this.getBooleanAttribute('cc_attack_protection'); + } + public set ccAttackProtection(value: boolean | cdktf.IResolvable) { + this._ccAttackProtection = value; + } + public resetCcAttackProtection() { + this._ccAttackProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get ccAttackProtectionInput() { + return this._ccAttackProtection; + } + + // crawler - computed: true, optional: false, required: false + public get crawler() { + return this.getBooleanAttribute('crawler'); + } + + // crawler_engine - computed: false, optional: true, required: false + private _crawlerEngine?: boolean | cdktf.IResolvable; + public get crawlerEngine() { + return this.getBooleanAttribute('crawler_engine'); + } + public set crawlerEngine(value: boolean | cdktf.IResolvable) { + this._crawlerEngine = value; + } + public resetCrawlerEngine() { + this._crawlerEngine = undefined; + } + // Temporarily expose input value. Use with caution. + public get crawlerEngineInput() { + return this._crawlerEngine; + } + + // crawler_other - computed: false, optional: true, required: false + private _crawlerOther?: boolean | cdktf.IResolvable; + public get crawlerOther() { + return this.getBooleanAttribute('crawler_other'); + } + public set crawlerOther(value: boolean | cdktf.IResolvable) { + this._crawlerOther = value; + } + public resetCrawlerOther() { + this._crawlerOther = undefined; + } + // Temporarily expose input value. Use with caution. + public get crawlerOtherInput() { + return this._crawlerOther; + } + + // crawler_scanner - computed: false, optional: true, required: false + private _crawlerScanner?: boolean | cdktf.IResolvable; + public get crawlerScanner() { + return this.getBooleanAttribute('crawler_scanner'); + } + public set crawlerScanner(value: boolean | cdktf.IResolvable) { + this._crawlerScanner = value; + } + public resetCrawlerScanner() { + this._crawlerScanner = undefined; + } + // Temporarily expose input value. Use with caution. + public get crawlerScannerInput() { + return this._crawlerScanner; + } + + // crawler_script - computed: false, optional: true, required: false + private _crawlerScript?: boolean | cdktf.IResolvable; + public get crawlerScript() { + return this.getBooleanAttribute('crawler_script'); + } + public set crawlerScript(value: boolean | cdktf.IResolvable) { + this._crawlerScript = value; + } + public resetCrawlerScript() { + this._crawlerScript = undefined; + } + // Temporarily expose input value. Use with caution. + public get crawlerScriptInput() { + return this._crawlerScript; + } + + // data_masking - computed: false, optional: true, required: false + private _dataMasking?: boolean | cdktf.IResolvable; + public get dataMasking() { + return this.getBooleanAttribute('data_masking'); + } + public set dataMasking(value: boolean | cdktf.IResolvable) { + this._dataMasking = value; + } + public resetDataMasking() { + this._dataMasking = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataMaskingInput() { + return this._dataMasking; + } + + // false_alarm_masking - computed: false, optional: true, required: false + private _falseAlarmMasking?: boolean | cdktf.IResolvable; + public get falseAlarmMasking() { + return this.getBooleanAttribute('false_alarm_masking'); + } + public set falseAlarmMasking(value: boolean | cdktf.IResolvable) { + this._falseAlarmMasking = value; + } + public resetFalseAlarmMasking() { + this._falseAlarmMasking = undefined; + } + // Temporarily expose input value. Use with caution. + public get falseAlarmMaskingInput() { + return this._falseAlarmMasking; + } + + // general_check - computed: false, optional: true, required: false + private _generalCheck?: boolean | cdktf.IResolvable; + public get generalCheck() { + return this.getBooleanAttribute('general_check'); + } + public set generalCheck(value: boolean | cdktf.IResolvable) { + this._generalCheck = value; + } + public resetGeneralCheck() { + this._generalCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get generalCheckInput() { + return this._generalCheck; + } + + // geolocation_access_control - computed: false, optional: true, required: false + private _geolocationAccessControl?: boolean | cdktf.IResolvable; + public get geolocationAccessControl() { + return this.getBooleanAttribute('geolocation_access_control'); + } + public set geolocationAccessControl(value: boolean | cdktf.IResolvable) { + this._geolocationAccessControl = value; + } + public resetGeolocationAccessControl() { + this._geolocationAccessControl = undefined; + } + // Temporarily expose input value. Use with caution. + public get geolocationAccessControlInput() { + return this._geolocationAccessControl; + } + + // information_leakage_prevention - computed: false, optional: true, required: false + private _informationLeakagePrevention?: boolean | cdktf.IResolvable; + public get informationLeakagePrevention() { + return this.getBooleanAttribute('information_leakage_prevention'); + } + public set informationLeakagePrevention(value: boolean | cdktf.IResolvable) { + this._informationLeakagePrevention = value; + } + public resetInformationLeakagePrevention() { + this._informationLeakagePrevention = undefined; + } + // Temporarily expose input value. Use with caution. + public get informationLeakagePreventionInput() { + return this._informationLeakagePrevention; + } + + // known_attack_source - computed: false, optional: true, required: false + private _knownAttackSource?: boolean | cdktf.IResolvable; + public get knownAttackSource() { + return this.getBooleanAttribute('known_attack_source'); + } + public set knownAttackSource(value: boolean | cdktf.IResolvable) { + this._knownAttackSource = value; + } + public resetKnownAttackSource() { + this._knownAttackSource = undefined; + } + // Temporarily expose input value. Use with caution. + public get knownAttackSourceInput() { + return this._knownAttackSource; + } + + // precise_protection - computed: false, optional: true, required: false + private _preciseProtection?: boolean | cdktf.IResolvable; + public get preciseProtection() { + return this.getBooleanAttribute('precise_protection'); + } + public set preciseProtection(value: boolean | cdktf.IResolvable) { + this._preciseProtection = value; + } + public resetPreciseProtection() { + this._preciseProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get preciseProtectionInput() { + return this._preciseProtection; + } + + // web_tamper_protection - computed: false, optional: true, required: false + private _webTamperProtection?: boolean | cdktf.IResolvable; + public get webTamperProtection() { + return this.getBooleanAttribute('web_tamper_protection'); + } + public set webTamperProtection(value: boolean | cdktf.IResolvable) { + this._webTamperProtection = value; + } + public resetWebTamperProtection() { + this._webTamperProtection = undefined; + } + // Temporarily expose input value. Use with caution. + public get webTamperProtectionInput() { + return this._webTamperProtection; + } + + // webshell - computed: false, optional: true, required: false + private _webshell?: boolean | cdktf.IResolvable; + public get webshell() { + return this.getBooleanAttribute('webshell'); + } + public set webshell(value: boolean | cdktf.IResolvable) { + this._webshell = value; + } + public resetWebshell() { + this._webshell = undefined; + } + // Temporarily expose input value. Use with caution. + public get webshellInput() { + return this._webshell; + } +} + +export class WafPolicyOptionsList extends cdktf.ComplexList { + public internalValue? : WafPolicyOptions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafPolicyOptionsOutputReference { + return new WafPolicyOptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WafPolicyTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#create WafPolicy#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#delete WafPolicy#delete} + */ + readonly delete?: string; +} + +export function wafPolicyTimeoutsToTerraform(struct?: WafPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function wafPolicyTimeoutsToHclTerraform(struct?: WafPolicyTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafPolicyTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WafPolicyTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafPolicyTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy huaweicloud_waf_policy} +*/ +export class WafPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafPolicy to import + * @param importFromId The id of the existing WafPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_policy huaweicloud_waf_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafPolicyConfig + */ + public constructor(scope: Construct, id: string, config: WafPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._deepInspection = config.deepInspection; + this._enterpriseProjectId = config.enterpriseProjectId; + this._fullDetection = config.fullDetection; + this._headerInspection = config.headerInspection; + this._id = config.id; + this._level = config.level; + this._name = config.name; + this._protectionMode = config.protectionMode; + this._region = config.region; + this._robotAction = config.robotAction; + this._shiroDecryptionCheck = config.shiroDecryptionCheck; + this._options.internalValue = config.options; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // bind_hosts - computed: true, optional: false, required: false + private _bindHosts = new WafPolicyBindHostsList(this, "bind_hosts", false); + public get bindHosts() { + return this._bindHosts; + } + + // deep_inspection - computed: true, optional: true, required: false + private _deepInspection?: boolean | cdktf.IResolvable; + public get deepInspection() { + return this.getBooleanAttribute('deep_inspection'); + } + public set deepInspection(value: boolean | cdktf.IResolvable) { + this._deepInspection = value; + } + public resetDeepInspection() { + this._deepInspection = undefined; + } + // Temporarily expose input value. Use with caution. + public get deepInspectionInput() { + return this._deepInspection; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // full_detection - computed: false, optional: true, required: false + private _fullDetection?: boolean | cdktf.IResolvable; + public get fullDetection() { + return this.getBooleanAttribute('full_detection'); + } + public set fullDetection(value: boolean | cdktf.IResolvable) { + this._fullDetection = value; + } + public resetFullDetection() { + this._fullDetection = undefined; + } + // Temporarily expose input value. Use with caution. + public get fullDetectionInput() { + return this._fullDetection; + } + + // header_inspection - computed: true, optional: true, required: false + private _headerInspection?: boolean | cdktf.IResolvable; + public get headerInspection() { + return this.getBooleanAttribute('header_inspection'); + } + public set headerInspection(value: boolean | cdktf.IResolvable) { + this._headerInspection = value; + } + public resetHeaderInspection() { + this._headerInspection = undefined; + } + // Temporarily expose input value. Use with caution. + public get headerInspectionInput() { + return this._headerInspection; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // level - computed: true, optional: true, required: false + private _level?: number; + public get level() { + return this.getNumberAttribute('level'); + } + public set level(value: number) { + this._level = value; + } + public resetLevel() { + this._level = undefined; + } + // Temporarily expose input value. Use with caution. + public get levelInput() { + return this._level; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // protection_mode - computed: true, optional: true, required: false + private _protectionMode?: string; + public get protectionMode() { + return this.getStringAttribute('protection_mode'); + } + public set protectionMode(value: string) { + this._protectionMode = value; + } + public resetProtectionMode() { + this._protectionMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get protectionModeInput() { + return this._protectionMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // robot_action - computed: true, optional: true, required: false + private _robotAction?: string; + public get robotAction() { + return this.getStringAttribute('robot_action'); + } + public set robotAction(value: string) { + this._robotAction = value; + } + public resetRobotAction() { + this._robotAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get robotActionInput() { + return this._robotAction; + } + + // shiro_decryption_check - computed: true, optional: true, required: false + private _shiroDecryptionCheck?: boolean | cdktf.IResolvable; + public get shiroDecryptionCheck() { + return this.getBooleanAttribute('shiro_decryption_check'); + } + public set shiroDecryptionCheck(value: boolean | cdktf.IResolvable) { + this._shiroDecryptionCheck = value; + } + public resetShiroDecryptionCheck() { + this._shiroDecryptionCheck = undefined; + } + // Temporarily expose input value. Use with caution. + public get shiroDecryptionCheckInput() { + return this._shiroDecryptionCheck; + } + + // options - computed: false, optional: true, required: false + private _options = new WafPolicyOptionsList(this, "options", false); + public get options() { + return this._options; + } + public putOptions(value: WafPolicyOptions[] | cdktf.IResolvable) { + this._options.internalValue = value; + } + public resetOptions() { + this._options.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get optionsInput() { + return this._options.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WafPolicyTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WafPolicyTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + deep_inspection: cdktf.booleanToTerraform(this._deepInspection), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + full_detection: cdktf.booleanToTerraform(this._fullDetection), + header_inspection: cdktf.booleanToTerraform(this._headerInspection), + id: cdktf.stringToTerraform(this._id), + level: cdktf.numberToTerraform(this._level), + name: cdktf.stringToTerraform(this._name), + protection_mode: cdktf.stringToTerraform(this._protectionMode), + region: cdktf.stringToTerraform(this._region), + robot_action: cdktf.stringToTerraform(this._robotAction), + shiro_decryption_check: cdktf.booleanToTerraform(this._shiroDecryptionCheck), + options: cdktf.listMapper(wafPolicyOptionsToTerraform, true)(this._options.internalValue), + timeouts: wafPolicyTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + deep_inspection: { + value: cdktf.booleanToHclTerraform(this._deepInspection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + full_detection: { + value: cdktf.booleanToHclTerraform(this._fullDetection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + header_inspection: { + value: cdktf.booleanToHclTerraform(this._headerInspection), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + level: { + value: cdktf.numberToHclTerraform(this._level), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protection_mode: { + value: cdktf.stringToHclTerraform(this._protectionMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + robot_action: { + value: cdktf.stringToHclTerraform(this._robotAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + shiro_decryption_check: { + value: cdktf.booleanToHclTerraform(this._shiroDecryptionCheck), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + options: { + value: cdktf.listMapperHcl(wafPolicyOptionsToHclTerraform, true)(this._options.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafPolicyOptionsList", + }, + timeouts: { + value: wafPolicyTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WafPolicyTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-reference-table/README.md b/src/constructs/providers/huaweicloud/waf-reference-table/README.md new file mode 100644 index 00000000..4d671ad9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-reference-table/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_reference_table` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_reference_table`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table). diff --git a/src/constructs/providers/huaweicloud/waf-reference-table/index.ts b/src/constructs/providers/huaweicloud/waf-reference-table/index.ts new file mode 100644 index 00000000..bff394be --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-reference-table/index.ts @@ -0,0 +1,285 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafReferenceTableConfig extends cdktf.TerraformMetaArguments { + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#conditions WafReferenceTable#conditions} + */ + readonly conditions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#description WafReferenceTable#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#enterprise_project_id WafReferenceTable#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#id WafReferenceTable#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#name WafReferenceTable#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#region WafReferenceTable#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#type WafReferenceTable#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table huaweicloud_waf_reference_table} +*/ +export class WafReferenceTable extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_reference_table"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafReferenceTable resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafReferenceTable to import + * @param importFromId The id of the existing WafReferenceTable that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafReferenceTable to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_reference_table", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_reference_table huaweicloud_waf_reference_table} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafReferenceTableConfig + */ + public constructor(scope: Construct, id: string, config: WafReferenceTableConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_reference_table', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._conditions = config.conditions; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // conditions - computed: false, optional: true, required: false + private _conditions?: string[]; + public get conditions() { + return this.getListAttribute('conditions'); + } + public set conditions(value: string[]) { + this._conditions = value; + } + public resetConditions() { + this._conditions = undefined; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions; + } + + // creation_time - computed: true, optional: false, required: false + public get creationTime() { + return this.getStringAttribute('creation_time'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._conditions), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + conditions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._conditions), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-anti-crawler/README.md b/src/constructs/providers/huaweicloud/waf-rule-anti-crawler/README.md new file mode 100644 index 00000000..33dc51cc --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-anti-crawler/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_anti_crawler` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_anti_crawler`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler). diff --git a/src/constructs/providers/huaweicloud/waf-rule-anti-crawler/index.ts b/src/constructs/providers/huaweicloud/waf-rule-anti-crawler/index.ts new file mode 100644 index 00000000..e0343a29 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-anti-crawler/index.ts @@ -0,0 +1,561 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleAntiCrawlerConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the rule description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#description WafRuleAntiCrawler#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#enterprise_project_id WafRuleAntiCrawler#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#id WafRuleAntiCrawler#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the rule name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#name WafRuleAntiCrawler#name} + */ + readonly name: string; + /** + * Specifies the policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#policy_id WafRuleAntiCrawler#policy_id} + */ + readonly policyId: string; + /** + * Specifies the priority. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#priority WafRuleAntiCrawler#priority} + */ + readonly priority: number; + /** + * Specifies the protection mode of WAF anti crawler rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#protection_mode WafRuleAntiCrawler#protection_mode} + */ + readonly protectionMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#region WafRuleAntiCrawler#region} + */ + readonly region?: string; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#conditions WafRuleAntiCrawler#conditions} + */ + readonly conditions: WafRuleAntiCrawlerConditions[] | cdktf.IResolvable; +} +export interface WafRuleAntiCrawlerConditions { + /** + * Specifies the content of the condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#content WafRuleAntiCrawler#content} + */ + readonly content?: string; + /** + * Specifies the field type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#field WafRuleAntiCrawler#field} + */ + readonly field: string; + /** + * Specifies the logic for matching the condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#logic WafRuleAntiCrawler#logic} + */ + readonly logic: string; + /** + * Specifies the reference table ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#reference_table_id WafRuleAntiCrawler#reference_table_id} + */ + readonly referenceTableId?: string; +} + +export function wafRuleAntiCrawlerConditionsToTerraform(struct?: WafRuleAntiCrawlerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field: cdktf.stringToTerraform(struct!.field), + logic: cdktf.stringToTerraform(struct!.logic), + reference_table_id: cdktf.stringToTerraform(struct!.referenceTableId), + } +} + + +export function wafRuleAntiCrawlerConditionsToHclTerraform(struct?: WafRuleAntiCrawlerConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field: { + value: cdktf.stringToHclTerraform(struct!.field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logic: { + value: cdktf.stringToHclTerraform(struct!.logic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reference_table_id: { + value: cdktf.stringToHclTerraform(struct!.referenceTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafRuleAntiCrawlerConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafRuleAntiCrawlerConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._field !== undefined) { + hasAnyValues = true; + internalValueResult.field = this._field; + } + if (this._logic !== undefined) { + hasAnyValues = true; + internalValueResult.logic = this._logic; + } + if (this._referenceTableId !== undefined) { + hasAnyValues = true; + internalValueResult.referenceTableId = this._referenceTableId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafRuleAntiCrawlerConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._field = undefined; + this._logic = undefined; + this._referenceTableId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._field = value.field; + this._logic = value.logic; + this._referenceTableId = value.referenceTableId; + } + } + + // content - computed: false, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // logic - computed: false, optional: false, required: true + private _logic?: string; + public get logic() { + return this.getStringAttribute('logic'); + } + public set logic(value: string) { + this._logic = value; + } + // Temporarily expose input value. Use with caution. + public get logicInput() { + return this._logic; + } + + // reference_table_id - computed: false, optional: true, required: false + private _referenceTableId?: string; + public get referenceTableId() { + return this.getStringAttribute('reference_table_id'); + } + public set referenceTableId(value: string) { + this._referenceTableId = value; + } + public resetReferenceTableId() { + this._referenceTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get referenceTableIdInput() { + return this._referenceTableId; + } +} + +export class WafRuleAntiCrawlerConditionsList extends cdktf.ComplexList { + public internalValue? : WafRuleAntiCrawlerConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafRuleAntiCrawlerConditionsOutputReference { + return new WafRuleAntiCrawlerConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler huaweicloud_waf_rule_anti_crawler} +*/ +export class WafRuleAntiCrawler extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_anti_crawler"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleAntiCrawler resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleAntiCrawler to import + * @param importFromId The id of the existing WafRuleAntiCrawler that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleAntiCrawler to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_anti_crawler", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_anti_crawler huaweicloud_waf_rule_anti_crawler} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleAntiCrawlerConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleAntiCrawlerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_anti_crawler', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._priority = config.priority; + this._protectionMode = config.protectionMode; + this._region = config.region; + this._conditions.internalValue = config.conditions; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // protection_mode - computed: false, optional: false, required: true + private _protectionMode?: string; + public get protectionMode() { + return this.getStringAttribute('protection_mode'); + } + public set protectionMode(value: string) { + this._protectionMode = value; + } + // Temporarily expose input value. Use with caution. + public get protectionModeInput() { + return this._protectionMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new WafRuleAntiCrawlerConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: WafRuleAntiCrawlerConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + priority: cdktf.numberToTerraform(this._priority), + protection_mode: cdktf.stringToTerraform(this._protectionMode), + region: cdktf.stringToTerraform(this._region), + conditions: cdktf.listMapper(wafRuleAntiCrawlerConditionsToTerraform, true)(this._conditions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + protection_mode: { + value: cdktf.stringToHclTerraform(this._protectionMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conditions: { + value: cdktf.listMapperHcl(wafRuleAntiCrawlerConditionsToHclTerraform, true)(this._conditions.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafRuleAntiCrawlerConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-blacklist/README.md b/src/constructs/providers/huaweicloud/waf-rule-blacklist/README.md new file mode 100644 index 00000000..9f97bdb9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-blacklist/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_blacklist` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_blacklist`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist). diff --git a/src/constructs/providers/huaweicloud/waf-rule-blacklist/index.ts b/src/constructs/providers/huaweicloud/waf-rule-blacklist/index.ts new file mode 100644 index 00000000..330ab52f --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-blacklist/index.ts @@ -0,0 +1,534 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleBlacklistConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#action WafRuleBlacklist#action} + */ + readonly action?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#address_group_id WafRuleBlacklist#address_group_id} + */ + readonly addressGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#description WafRuleBlacklist#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#enterprise_project_id WafRuleBlacklist#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#id WafRuleBlacklist#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#ip_address WafRuleBlacklist#ip_address} + */ + readonly ipAddress?: string; + /** + * schema: Required + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#name WafRuleBlacklist#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#policy_id WafRuleBlacklist#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#region WafRuleBlacklist#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#status WafRuleBlacklist#status} + */ + readonly status?: number; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#timeouts WafRuleBlacklist#timeouts} + */ + readonly timeouts?: WafRuleBlacklistTimeouts; +} +export interface WafRuleBlacklistTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#create WafRuleBlacklist#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#delete WafRuleBlacklist#delete} + */ + readonly delete?: string; +} + +export function wafRuleBlacklistTimeoutsToTerraform(struct?: WafRuleBlacklistTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function wafRuleBlacklistTimeoutsToHclTerraform(struct?: WafRuleBlacklistTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafRuleBlacklistTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WafRuleBlacklistTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafRuleBlacklistTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist huaweicloud_waf_rule_blacklist} +*/ +export class WafRuleBlacklist extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_blacklist"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleBlacklist resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleBlacklist to import + * @param importFromId The id of the existing WafRuleBlacklist that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleBlacklist to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_blacklist", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_blacklist huaweicloud_waf_rule_blacklist} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleBlacklistConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleBlacklistConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_blacklist', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._addressGroupId = config.addressGroupId; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ipAddress = config.ipAddress; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._status = config.status; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: number; + public get action() { + return this.getNumberAttribute('action'); + } + public set action(value: number) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // address_group_id - computed: false, optional: true, required: false + private _addressGroupId?: string; + public get addressGroupId() { + return this.getStringAttribute('address_group_id'); + } + public set addressGroupId(value: string) { + this._addressGroupId = value; + } + public resetAddressGroupId() { + this._addressGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get addressGroupIdInput() { + return this._addressGroupId; + } + + // address_group_name - computed: true, optional: false, required: false + public get addressGroupName() { + return this.getStringAttribute('address_group_name'); + } + + // address_group_size - computed: true, optional: false, required: false + public get addressGroupSize() { + return this.getNumberAttribute('address_group_size'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ip_address - computed: false, optional: true, required: false + private _ipAddress?: string; + public get ipAddress() { + return this.getStringAttribute('ip_address'); + } + public set ipAddress(value: string) { + this._ipAddress = value; + } + public resetIpAddress() { + this._ipAddress = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipAddressInput() { + return this._ipAddress; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WafRuleBlacklistTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WafRuleBlacklistTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.numberToTerraform(this._action), + address_group_id: cdktf.stringToTerraform(this._addressGroupId), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ip_address: cdktf.stringToTerraform(this._ipAddress), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.numberToTerraform(this._status), + timeouts: wafRuleBlacklistTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.numberToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + address_group_id: { + value: cdktf.stringToHclTerraform(this._addressGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_address: { + value: cdktf.stringToHclTerraform(this._ipAddress), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + timeouts: { + value: wafRuleBlacklistTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WafRuleBlacklistTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-cc-protection/README.md b/src/constructs/providers/huaweicloud/waf-rule-cc-protection/README.md new file mode 100644 index 00000000..bd235ce4 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-cc-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_cc_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_cc_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection). diff --git a/src/constructs/providers/huaweicloud/waf-rule-cc-protection/index.ts b/src/constructs/providers/huaweicloud/waf-rule-cc-protection/index.ts new file mode 100644 index 00000000..270a07b9 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-cc-protection/index.ts @@ -0,0 +1,921 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleCcProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies whether to enable global counting. Default to false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#all_waf_instances WafRuleCcProtection#all_waf_instances} + */ + readonly allWafInstances?: boolean | cdktf.IResolvable; + /** + * Specifies the type of the returned page. + * The options are **application/json**, **text/html** and **text/xml**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#block_page_type WafRuleCcProtection#block_page_type} + */ + readonly blockPageType?: string; + /** + * Specifies the description of WAF cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#description WafRuleCcProtection#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID of WAF cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#enterprise_project_id WafRuleCcProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#id WafRuleCcProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the number of requests allowed from a web visitor in a rate limiting period. + * The value ranges from 1 to 2,147,483,647. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#limit_num WafRuleCcProtection#limit_num} + */ + readonly limitNum: number; + /** + * Specifies the rate limiting period. The value ranges from 1 to 3,600 in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#limit_period WafRuleCcProtection#limit_period} + */ + readonly limitPeriod: number; + /** + * Specifies the lock time for resuming normal page access after blocking can be set. + * The value ranges from 0 to 65,535 in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#lock_time WafRuleCcProtection#lock_time} + */ + readonly lockTime?: number; + /** + * Specifies the rule name of WAF cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#name WafRuleCcProtection#name} + */ + readonly name: string; + /** + * Specifies the other user identifier. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#other_user_identifier WafRuleCcProtection#other_user_identifier} + */ + readonly otherUserIdentifier?: string; + /** + * Specifies the content of the returned page. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#page_content WafRuleCcProtection#page_content} + */ + readonly pageContent?: string; + /** + * Specifies the policy ID of WAF cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#policy_id WafRuleCcProtection#policy_id} + */ + readonly policyId: string; + /** + * Specifies the protective action taken when the number of requests reaches the upper limit. + * The value can be **captcha**, **block**, **log** or **dynamic_block**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#protective_action WafRuleCcProtection#protective_action} + */ + readonly protectiveAction: string; + /** + * Specifies the rate limit mode. + * Valid values are **ip**, **cookie**, **header**, **other**, **policy**, **domain**, **url**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#rate_limit_mode WafRuleCcProtection#rate_limit_mode} + */ + readonly rateLimitMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#region WafRuleCcProtection#region} + */ + readonly region?: string; + /** + * Specifies whether to enable domain aggregation statistics. Default to false. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#request_aggregation WafRuleCcProtection#request_aggregation} + */ + readonly requestAggregation?: boolean | cdktf.IResolvable; + /** + * The status of a cc protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#status WafRuleCcProtection#status} + */ + readonly status?: number; + /** + * Specifies the allowable frequency. The value ranges from 0 to 2,147,483,647. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#unlock_num WafRuleCcProtection#unlock_num} + */ + readonly unlockNum?: number; + /** + * Specifies the user identifier. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#user_identifier WafRuleCcProtection#user_identifier} + */ + readonly userIdentifier?: string; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#conditions WafRuleCcProtection#conditions} + */ + readonly conditions: WafRuleCcProtectionConditions[] | cdktf.IResolvable; +} +export interface WafRuleCcProtectionConditions { + /** + * Specifies the content of the match condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#content WafRuleCcProtection#content} + */ + readonly content?: string; + /** + * Specifies the field type. + * The value can be **url**, **ip**, **ipv6**, **params**, **cookie**, **header** or **response_code**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#field WafRuleCcProtection#field} + */ + readonly field: string; + /** + * Specifies the condition matching logic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#logic WafRuleCcProtection#logic} + */ + readonly logic: string; + /** + * Specifies the reference table id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#reference_table_id WafRuleCcProtection#reference_table_id} + */ + readonly referenceTableId?: string; + /** + * Specifies the subfield of the condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#subfield WafRuleCcProtection#subfield} + */ + readonly subfield?: string; +} + +export function wafRuleCcProtectionConditionsToTerraform(struct?: WafRuleCcProtectionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field: cdktf.stringToTerraform(struct!.field), + logic: cdktf.stringToTerraform(struct!.logic), + reference_table_id: cdktf.stringToTerraform(struct!.referenceTableId), + subfield: cdktf.stringToTerraform(struct!.subfield), + } +} + + +export function wafRuleCcProtectionConditionsToHclTerraform(struct?: WafRuleCcProtectionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field: { + value: cdktf.stringToHclTerraform(struct!.field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logic: { + value: cdktf.stringToHclTerraform(struct!.logic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reference_table_id: { + value: cdktf.stringToHclTerraform(struct!.referenceTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subfield: { + value: cdktf.stringToHclTerraform(struct!.subfield), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafRuleCcProtectionConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafRuleCcProtectionConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._field !== undefined) { + hasAnyValues = true; + internalValueResult.field = this._field; + } + if (this._logic !== undefined) { + hasAnyValues = true; + internalValueResult.logic = this._logic; + } + if (this._referenceTableId !== undefined) { + hasAnyValues = true; + internalValueResult.referenceTableId = this._referenceTableId; + } + if (this._subfield !== undefined) { + hasAnyValues = true; + internalValueResult.subfield = this._subfield; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafRuleCcProtectionConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._field = undefined; + this._logic = undefined; + this._referenceTableId = undefined; + this._subfield = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._field = value.field; + this._logic = value.logic; + this._referenceTableId = value.referenceTableId; + this._subfield = value.subfield; + } + } + + // content - computed: true, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // logic - computed: false, optional: false, required: true + private _logic?: string; + public get logic() { + return this.getStringAttribute('logic'); + } + public set logic(value: string) { + this._logic = value; + } + // Temporarily expose input value. Use with caution. + public get logicInput() { + return this._logic; + } + + // reference_table_id - computed: false, optional: true, required: false + private _referenceTableId?: string; + public get referenceTableId() { + return this.getStringAttribute('reference_table_id'); + } + public set referenceTableId(value: string) { + this._referenceTableId = value; + } + public resetReferenceTableId() { + this._referenceTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get referenceTableIdInput() { + return this._referenceTableId; + } + + // subfield - computed: false, optional: true, required: false + private _subfield?: string; + public get subfield() { + return this.getStringAttribute('subfield'); + } + public set subfield(value: string) { + this._subfield = value; + } + public resetSubfield() { + this._subfield = undefined; + } + // Temporarily expose input value. Use with caution. + public get subfieldInput() { + return this._subfield; + } +} + +export class WafRuleCcProtectionConditionsList extends cdktf.ComplexList { + public internalValue? : WafRuleCcProtectionConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafRuleCcProtectionConditionsOutputReference { + return new WafRuleCcProtectionConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection huaweicloud_waf_rule_cc_protection} +*/ +export class WafRuleCcProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_cc_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleCcProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleCcProtection to import + * @param importFromId The id of the existing WafRuleCcProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleCcProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_cc_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_cc_protection huaweicloud_waf_rule_cc_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleCcProtectionConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleCcProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_cc_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._allWafInstances = config.allWafInstances; + this._blockPageType = config.blockPageType; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._limitNum = config.limitNum; + this._limitPeriod = config.limitPeriod; + this._lockTime = config.lockTime; + this._name = config.name; + this._otherUserIdentifier = config.otherUserIdentifier; + this._pageContent = config.pageContent; + this._policyId = config.policyId; + this._protectiveAction = config.protectiveAction; + this._rateLimitMode = config.rateLimitMode; + this._region = config.region; + this._requestAggregation = config.requestAggregation; + this._status = config.status; + this._unlockNum = config.unlockNum; + this._userIdentifier = config.userIdentifier; + this._conditions.internalValue = config.conditions; + } + + // ========== + // ATTRIBUTES + // ========== + + // all_waf_instances - computed: true, optional: true, required: false + private _allWafInstances?: boolean | cdktf.IResolvable; + public get allWafInstances() { + return this.getBooleanAttribute('all_waf_instances'); + } + public set allWafInstances(value: boolean | cdktf.IResolvable) { + this._allWafInstances = value; + } + public resetAllWafInstances() { + this._allWafInstances = undefined; + } + // Temporarily expose input value. Use with caution. + public get allWafInstancesInput() { + return this._allWafInstances; + } + + // block_page_type - computed: false, optional: true, required: false + private _blockPageType?: string; + public get blockPageType() { + return this.getStringAttribute('block_page_type'); + } + public set blockPageType(value: string) { + this._blockPageType = value; + } + public resetBlockPageType() { + this._blockPageType = undefined; + } + // Temporarily expose input value. Use with caution. + public get blockPageTypeInput() { + return this._blockPageType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // limit_num - computed: false, optional: false, required: true + private _limitNum?: number; + public get limitNum() { + return this.getNumberAttribute('limit_num'); + } + public set limitNum(value: number) { + this._limitNum = value; + } + // Temporarily expose input value. Use with caution. + public get limitNumInput() { + return this._limitNum; + } + + // limit_period - computed: false, optional: false, required: true + private _limitPeriod?: number; + public get limitPeriod() { + return this.getNumberAttribute('limit_period'); + } + public set limitPeriod(value: number) { + this._limitPeriod = value; + } + // Temporarily expose input value. Use with caution. + public get limitPeriodInput() { + return this._limitPeriod; + } + + // lock_time - computed: false, optional: true, required: false + private _lockTime?: number; + public get lockTime() { + return this.getNumberAttribute('lock_time'); + } + public set lockTime(value: number) { + this._lockTime = value; + } + public resetLockTime() { + this._lockTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get lockTimeInput() { + return this._lockTime; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // other_user_identifier - computed: false, optional: true, required: false + private _otherUserIdentifier?: string; + public get otherUserIdentifier() { + return this.getStringAttribute('other_user_identifier'); + } + public set otherUserIdentifier(value: string) { + this._otherUserIdentifier = value; + } + public resetOtherUserIdentifier() { + this._otherUserIdentifier = undefined; + } + // Temporarily expose input value. Use with caution. + public get otherUserIdentifierInput() { + return this._otherUserIdentifier; + } + + // page_content - computed: false, optional: true, required: false + private _pageContent?: string; + public get pageContent() { + return this.getStringAttribute('page_content'); + } + public set pageContent(value: string) { + this._pageContent = value; + } + public resetPageContent() { + this._pageContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get pageContentInput() { + return this._pageContent; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protective_action - computed: false, optional: false, required: true + private _protectiveAction?: string; + public get protectiveAction() { + return this.getStringAttribute('protective_action'); + } + public set protectiveAction(value: string) { + this._protectiveAction = value; + } + // Temporarily expose input value. Use with caution. + public get protectiveActionInput() { + return this._protectiveAction; + } + + // rate_limit_mode - computed: false, optional: false, required: true + private _rateLimitMode?: string; + public get rateLimitMode() { + return this.getStringAttribute('rate_limit_mode'); + } + public set rateLimitMode(value: string) { + this._rateLimitMode = value; + } + // Temporarily expose input value. Use with caution. + public get rateLimitModeInput() { + return this._rateLimitMode; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // request_aggregation - computed: true, optional: true, required: false + private _requestAggregation?: boolean | cdktf.IResolvable; + public get requestAggregation() { + return this.getBooleanAttribute('request_aggregation'); + } + public set requestAggregation(value: boolean | cdktf.IResolvable) { + this._requestAggregation = value; + } + public resetRequestAggregation() { + this._requestAggregation = undefined; + } + // Temporarily expose input value. Use with caution. + public get requestAggregationInput() { + return this._requestAggregation; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // unlock_num - computed: false, optional: true, required: false + private _unlockNum?: number; + public get unlockNum() { + return this.getNumberAttribute('unlock_num'); + } + public set unlockNum(value: number) { + this._unlockNum = value; + } + public resetUnlockNum() { + this._unlockNum = undefined; + } + // Temporarily expose input value. Use with caution. + public get unlockNumInput() { + return this._unlockNum; + } + + // user_identifier - computed: false, optional: true, required: false + private _userIdentifier?: string; + public get userIdentifier() { + return this.getStringAttribute('user_identifier'); + } + public set userIdentifier(value: string) { + this._userIdentifier = value; + } + public resetUserIdentifier() { + this._userIdentifier = undefined; + } + // Temporarily expose input value. Use with caution. + public get userIdentifierInput() { + return this._userIdentifier; + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new WafRuleCcProtectionConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: WafRuleCcProtectionConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + all_waf_instances: cdktf.booleanToTerraform(this._allWafInstances), + block_page_type: cdktf.stringToTerraform(this._blockPageType), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + limit_num: cdktf.numberToTerraform(this._limitNum), + limit_period: cdktf.numberToTerraform(this._limitPeriod), + lock_time: cdktf.numberToTerraform(this._lockTime), + name: cdktf.stringToTerraform(this._name), + other_user_identifier: cdktf.stringToTerraform(this._otherUserIdentifier), + page_content: cdktf.stringToTerraform(this._pageContent), + policy_id: cdktf.stringToTerraform(this._policyId), + protective_action: cdktf.stringToTerraform(this._protectiveAction), + rate_limit_mode: cdktf.stringToTerraform(this._rateLimitMode), + region: cdktf.stringToTerraform(this._region), + request_aggregation: cdktf.booleanToTerraform(this._requestAggregation), + status: cdktf.numberToTerraform(this._status), + unlock_num: cdktf.numberToTerraform(this._unlockNum), + user_identifier: cdktf.stringToTerraform(this._userIdentifier), + conditions: cdktf.listMapper(wafRuleCcProtectionConditionsToTerraform, true)(this._conditions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + all_waf_instances: { + value: cdktf.booleanToHclTerraform(this._allWafInstances), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + block_page_type: { + value: cdktf.stringToHclTerraform(this._blockPageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + limit_num: { + value: cdktf.numberToHclTerraform(this._limitNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + limit_period: { + value: cdktf.numberToHclTerraform(this._limitPeriod), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + lock_time: { + value: cdktf.numberToHclTerraform(this._lockTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + other_user_identifier: { + value: cdktf.stringToHclTerraform(this._otherUserIdentifier), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + page_content: { + value: cdktf.stringToHclTerraform(this._pageContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protective_action: { + value: cdktf.stringToHclTerraform(this._protectiveAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rate_limit_mode: { + value: cdktf.stringToHclTerraform(this._rateLimitMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + request_aggregation: { + value: cdktf.booleanToHclTerraform(this._requestAggregation), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + unlock_num: { + value: cdktf.numberToHclTerraform(this._unlockNum), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + user_identifier: { + value: cdktf.stringToHclTerraform(this._userIdentifier), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + conditions: { + value: cdktf.listMapperHcl(wafRuleCcProtectionConditionsToHclTerraform, true)(this._conditions.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafRuleCcProtectionConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-data-masking/README.md b/src/constructs/providers/huaweicloud/waf-rule-data-masking/README.md new file mode 100644 index 00000000..ea16ccce --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-data-masking/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_data_masking` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_data_masking`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking). diff --git a/src/constructs/providers/huaweicloud/waf-rule-data-masking/index.ts b/src/constructs/providers/huaweicloud/waf-rule-data-masking/index.ts new file mode 100644 index 00000000..bb35a6d5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-data-masking/index.ts @@ -0,0 +1,328 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleDataMaskingConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#description WafRuleDataMasking#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#enterprise_project_id WafRuleDataMasking#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#field WafRuleDataMasking#field} + */ + readonly field: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#id WafRuleDataMasking#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#path WafRuleDataMasking#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#policy_id WafRuleDataMasking#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#region WafRuleDataMasking#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#status WafRuleDataMasking#status} + */ + readonly status?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#subfield WafRuleDataMasking#subfield} + */ + readonly subfield: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking huaweicloud_waf_rule_data_masking} +*/ +export class WafRuleDataMasking extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_data_masking"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleDataMasking resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleDataMasking to import + * @param importFromId The id of the existing WafRuleDataMasking that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleDataMasking to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_data_masking", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_data_masking huaweicloud_waf_rule_data_masking} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleDataMaskingConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleDataMaskingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_data_masking', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._field = config.field; + this._id = config.id; + this._path = config.path; + this._policyId = config.policyId; + this._region = config.region; + this._status = config.status; + this._subfield = config.subfield; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // subfield - computed: false, optional: false, required: true + private _subfield?: string; + public get subfield() { + return this.getStringAttribute('subfield'); + } + public set subfield(value: string) { + this._subfield = value; + } + // Temporarily expose input value. Use with caution. + public get subfieldInput() { + return this._subfield; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + field: cdktf.stringToTerraform(this._field), + id: cdktf.stringToTerraform(this._id), + path: cdktf.stringToTerraform(this._path), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.numberToTerraform(this._status), + subfield: cdktf.stringToTerraform(this._subfield), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field: { + value: cdktf.stringToHclTerraform(this._field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + subfield: { + value: cdktf.stringToHclTerraform(this._subfield), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/README.md b/src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/README.md new file mode 100644 index 00000000..cd18d3d0 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_geolocation_access_control` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_geolocation_access_control`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control). diff --git a/src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/index.ts b/src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/index.ts new file mode 100644 index 00000000..cabb8b55 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-geolocation-access-control/index.ts @@ -0,0 +1,342 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleGeolocationAccessControlConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the protective action of WAF geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#action WafRuleGeolocationAccessControl#action} + */ + readonly action: number; + /** + * Specifies the description of WAF geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#description WafRuleGeolocationAccessControl#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID of WAF geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#enterprise_project_id WafRuleGeolocationAccessControl#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Specifies the locations that can be configured in the geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#geolocation WafRuleGeolocationAccessControl#geolocation} + */ + readonly geolocation: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#id WafRuleGeolocationAccessControl#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of WAF geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#name WafRuleGeolocationAccessControl#name} + */ + readonly name: string; + /** + * Specifies the policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#policy_id WafRuleGeolocationAccessControl#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#region WafRuleGeolocationAccessControl#region} + */ + readonly region?: string; + /** + * Specifies the status of WAF geolocation access control rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#status WafRuleGeolocationAccessControl#status} + */ + readonly status?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control huaweicloud_waf_rule_geolocation_access_control} +*/ +export class WafRuleGeolocationAccessControl extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_geolocation_access_control"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleGeolocationAccessControl resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleGeolocationAccessControl to import + * @param importFromId The id of the existing WafRuleGeolocationAccessControl that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleGeolocationAccessControl to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_geolocation_access_control", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_geolocation_access_control huaweicloud_waf_rule_geolocation_access_control} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleGeolocationAccessControlConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleGeolocationAccessControlConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_geolocation_access_control', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._geolocation = config.geolocation; + this._id = config.id; + this._name = config.name; + this._policyId = config.policyId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: false, required: true + private _action?: number; + public get action() { + return this.getNumberAttribute('action'); + } + public set action(value: number) { + this._action = value; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // geolocation - computed: false, optional: false, required: true + private _geolocation?: string; + public get geolocation() { + return this.getStringAttribute('geolocation'); + } + public set geolocation(value: string) { + this._geolocation = value; + } + // Temporarily expose input value. Use with caution. + public get geolocationInput() { + return this._geolocation; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.numberToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + geolocation: cdktf.stringToTerraform(this._geolocation), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.numberToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.numberToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + geolocation: { + value: cdktf.stringToHclTerraform(this._geolocation), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/README.md b/src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/README.md new file mode 100644 index 00000000..12c258c5 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_global_protection_whitelist` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_global_protection_whitelist`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist). diff --git a/src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/index.ts b/src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/index.ts new file mode 100644 index 00000000..5eda8a81 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-global-protection-whitelist/index.ts @@ -0,0 +1,619 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleGlobalProtectionWhitelistConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the advanced content. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#advanced_content WafRuleGlobalProtectionWhitelist#advanced_content} + */ + readonly advancedContent?: string; + /** + * Specifies the advanced field. The following fields are supported: + * **params**, **cookie**, **header**, **body** and **multipart**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#advanced_field WafRuleGlobalProtectionWhitelist#advanced_field} + */ + readonly advancedField?: string; + /** + * Specifies the description of WAF global protection whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#description WafRuleGlobalProtectionWhitelist#description} + */ + readonly description?: string; + /** + * Specifies the protected domain name bound with the policy or manually enter a single + * domain name corresponding to the wildcard domain name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#domains WafRuleGlobalProtectionWhitelist#domains} + */ + readonly domains: string[]; + /** + * Specifies the enterprise project ID of WAF global protection whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#enterprise_project_id WafRuleGlobalProtectionWhitelist#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#id WafRuleGlobalProtectionWhitelist#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the ignore waf protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#ignore_waf_protection WafRuleGlobalProtectionWhitelist#ignore_waf_protection} + */ + readonly ignoreWafProtection: string; + /** + * Specifies the policy ID of WAF global protection whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#policy_id WafRuleGlobalProtectionWhitelist#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#region WafRuleGlobalProtectionWhitelist#region} + */ + readonly region?: string; + /** + * Specifies the status of WAF global protection whitelist rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#status WafRuleGlobalProtectionWhitelist#status} + */ + readonly status?: number; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#conditions WafRuleGlobalProtectionWhitelist#conditions} + */ + readonly conditions: WafRuleGlobalProtectionWhitelistConditions[] | cdktf.IResolvable; +} +export interface WafRuleGlobalProtectionWhitelistConditions { + /** + * Specifies the content of the match condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#content WafRuleGlobalProtectionWhitelist#content} + */ + readonly content: string; + /** + * Specifies the field type. The value can be **ip**, **url**, **params**, **cookie** + * or **header**. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#field WafRuleGlobalProtectionWhitelist#field} + */ + readonly field: string; + /** + * Specifies the condition matching logic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#logic WafRuleGlobalProtectionWhitelist#logic} + */ + readonly logic: string; + /** + * Specifies the subfield of the condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#subfield WafRuleGlobalProtectionWhitelist#subfield} + */ + readonly subfield?: string; +} + +export function wafRuleGlobalProtectionWhitelistConditionsToTerraform(struct?: WafRuleGlobalProtectionWhitelistConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field: cdktf.stringToTerraform(struct!.field), + logic: cdktf.stringToTerraform(struct!.logic), + subfield: cdktf.stringToTerraform(struct!.subfield), + } +} + + +export function wafRuleGlobalProtectionWhitelistConditionsToHclTerraform(struct?: WafRuleGlobalProtectionWhitelistConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field: { + value: cdktf.stringToHclTerraform(struct!.field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logic: { + value: cdktf.stringToHclTerraform(struct!.logic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subfield: { + value: cdktf.stringToHclTerraform(struct!.subfield), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafRuleGlobalProtectionWhitelistConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafRuleGlobalProtectionWhitelistConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._field !== undefined) { + hasAnyValues = true; + internalValueResult.field = this._field; + } + if (this._logic !== undefined) { + hasAnyValues = true; + internalValueResult.logic = this._logic; + } + if (this._subfield !== undefined) { + hasAnyValues = true; + internalValueResult.subfield = this._subfield; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafRuleGlobalProtectionWhitelistConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._field = undefined; + this._logic = undefined; + this._subfield = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._field = value.field; + this._logic = value.logic; + this._subfield = value.subfield; + } + } + + // content - computed: false, optional: false, required: true + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // logic - computed: false, optional: false, required: true + private _logic?: string; + public get logic() { + return this.getStringAttribute('logic'); + } + public set logic(value: string) { + this._logic = value; + } + // Temporarily expose input value. Use with caution. + public get logicInput() { + return this._logic; + } + + // subfield - computed: true, optional: true, required: false + private _subfield?: string; + public get subfield() { + return this.getStringAttribute('subfield'); + } + public set subfield(value: string) { + this._subfield = value; + } + public resetSubfield() { + this._subfield = undefined; + } + // Temporarily expose input value. Use with caution. + public get subfieldInput() { + return this._subfield; + } +} + +export class WafRuleGlobalProtectionWhitelistConditionsList extends cdktf.ComplexList { + public internalValue? : WafRuleGlobalProtectionWhitelistConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafRuleGlobalProtectionWhitelistConditionsOutputReference { + return new WafRuleGlobalProtectionWhitelistConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist huaweicloud_waf_rule_global_protection_whitelist} +*/ +export class WafRuleGlobalProtectionWhitelist extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_global_protection_whitelist"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleGlobalProtectionWhitelist resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleGlobalProtectionWhitelist to import + * @param importFromId The id of the existing WafRuleGlobalProtectionWhitelist that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleGlobalProtectionWhitelist to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_global_protection_whitelist", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_global_protection_whitelist huaweicloud_waf_rule_global_protection_whitelist} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleGlobalProtectionWhitelistConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleGlobalProtectionWhitelistConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_global_protection_whitelist', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._advancedContent = config.advancedContent; + this._advancedField = config.advancedField; + this._description = config.description; + this._domains = config.domains; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._ignoreWafProtection = config.ignoreWafProtection; + this._policyId = config.policyId; + this._region = config.region; + this._status = config.status; + this._conditions.internalValue = config.conditions; + } + + // ========== + // ATTRIBUTES + // ========== + + // advanced_content - computed: false, optional: true, required: false + private _advancedContent?: string; + public get advancedContent() { + return this.getStringAttribute('advanced_content'); + } + public set advancedContent(value: string) { + this._advancedContent = value; + } + public resetAdvancedContent() { + this._advancedContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get advancedContentInput() { + return this._advancedContent; + } + + // advanced_field - computed: false, optional: true, required: false + private _advancedField?: string; + public get advancedField() { + return this.getStringAttribute('advanced_field'); + } + public set advancedField(value: string) { + this._advancedField = value; + } + public resetAdvancedField() { + this._advancedField = undefined; + } + // Temporarily expose input value. Use with caution. + public get advancedFieldInput() { + return this._advancedField; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domains - computed: false, optional: false, required: true + private _domains?: string[]; + public get domains() { + return this.getListAttribute('domains'); + } + public set domains(value: string[]) { + this._domains = value; + } + // Temporarily expose input value. Use with caution. + public get domainsInput() { + return this._domains; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // ignore_waf_protection - computed: false, optional: false, required: true + private _ignoreWafProtection?: string; + public get ignoreWafProtection() { + return this.getStringAttribute('ignore_waf_protection'); + } + public set ignoreWafProtection(value: string) { + this._ignoreWafProtection = value; + } + // Temporarily expose input value. Use with caution. + public get ignoreWafProtectionInput() { + return this._ignoreWafProtection; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new WafRuleGlobalProtectionWhitelistConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: WafRuleGlobalProtectionWhitelistConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + advanced_content: cdktf.stringToTerraform(this._advancedContent), + advanced_field: cdktf.stringToTerraform(this._advancedField), + description: cdktf.stringToTerraform(this._description), + domains: cdktf.listMapper(cdktf.stringToTerraform, false)(this._domains), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + ignore_waf_protection: cdktf.stringToTerraform(this._ignoreWafProtection), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.numberToTerraform(this._status), + conditions: cdktf.listMapper(wafRuleGlobalProtectionWhitelistConditionsToTerraform, true)(this._conditions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + advanced_content: { + value: cdktf.stringToHclTerraform(this._advancedContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + advanced_field: { + value: cdktf.stringToHclTerraform(this._advancedField), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domains: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._domains), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ignore_waf_protection: { + value: cdktf.stringToHclTerraform(this._ignoreWafProtection), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + conditions: { + value: cdktf.listMapperHcl(wafRuleGlobalProtectionWhitelistConditionsToHclTerraform, true)(this._conditions.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafRuleGlobalProtectionWhitelistConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/README.md b/src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/README.md new file mode 100644 index 00000000..33ac5e1a --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_information_leakage_prevention` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_information_leakage_prevention`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention). diff --git a/src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/index.ts b/src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/index.ts new file mode 100644 index 00000000..2ca8bf8b --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-information-leakage-prevention/index.ts @@ -0,0 +1,344 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleInformationLeakagePreventionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the rule contents. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#contents WafRuleInformationLeakagePrevention#contents} + */ + readonly contents: string[]; + /** + * Specifies the rule description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#description WafRuleInformationLeakagePrevention#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#enterprise_project_id WafRuleInformationLeakagePrevention#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#id WafRuleInformationLeakagePrevention#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the path to which the rule applies. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#path WafRuleInformationLeakagePrevention#path} + */ + readonly path: string; + /** + * Specifies the policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#policy_id WafRuleInformationLeakagePrevention#policy_id} + */ + readonly policyId: string; + /** + * Specifies the protective action. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#protective_action WafRuleInformationLeakagePrevention#protective_action} + */ + readonly protectiveAction: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#region WafRuleInformationLeakagePrevention#region} + */ + readonly region?: string; + /** + * Specifies the type of WAF information leakage prevention rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#type WafRuleInformationLeakagePrevention#type} + */ + readonly type: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention huaweicloud_waf_rule_information_leakage_prevention} +*/ +export class WafRuleInformationLeakagePrevention extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_information_leakage_prevention"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleInformationLeakagePrevention resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleInformationLeakagePrevention to import + * @param importFromId The id of the existing WafRuleInformationLeakagePrevention that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleInformationLeakagePrevention to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_information_leakage_prevention", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_information_leakage_prevention huaweicloud_waf_rule_information_leakage_prevention} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleInformationLeakagePreventionConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleInformationLeakagePreventionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_information_leakage_prevention', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._contents = config.contents; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._path = config.path; + this._policyId = config.policyId; + this._protectiveAction = config.protectiveAction; + this._region = config.region; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // contents - computed: false, optional: false, required: true + private _contents?: string[]; + public get contents() { + return cdktf.Fn.tolist(this.getListAttribute('contents')); + } + public set contents(value: string[]) { + this._contents = value; + } + // Temporarily expose input value. Use with caution. + public get contentsInput() { + return this._contents; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // protective_action - computed: false, optional: false, required: true + private _protectiveAction?: string; + public get protectiveAction() { + return this.getStringAttribute('protective_action'); + } + public set protectiveAction(value: string) { + this._protectiveAction = value; + } + // Temporarily expose input value. Use with caution. + public get protectiveActionInput() { + return this._protectiveAction; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getNumberAttribute('status'); + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + contents: cdktf.listMapper(cdktf.stringToTerraform, false)(this._contents), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + path: cdktf.stringToTerraform(this._path), + policy_id: cdktf.stringToTerraform(this._policyId), + protective_action: cdktf.stringToTerraform(this._protectiveAction), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + contents: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._contents), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + protective_action: { + value: cdktf.stringToHclTerraform(this._protectiveAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-known-attack-source/README.md b/src/constructs/providers/huaweicloud/waf-rule-known-attack-source/README.md new file mode 100644 index 00000000..84489522 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-known-attack-source/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_known_attack_source` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_known_attack_source`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source). diff --git a/src/constructs/providers/huaweicloud/waf-rule-known-attack-source/index.ts b/src/constructs/providers/huaweicloud/waf-rule-known-attack-source/index.ts new file mode 100644 index 00000000..0018fc6d --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-known-attack-source/index.ts @@ -0,0 +1,285 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleKnownAttackSourceConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the blocking time in seconds. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#block_time WafRuleKnownAttackSource#block_time} + */ + readonly blockTime: number; + /** + * Specifies the type of WAF known attack source rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#block_type WafRuleKnownAttackSource#block_type} + */ + readonly blockType: string; + /** + * Specifies the description of WAF known attack source rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#description WafRuleKnownAttackSource#description} + */ + readonly description?: string; + /** + * Specifies the enterprise project ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#enterprise_project_id WafRuleKnownAttackSource#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#id WafRuleKnownAttackSource#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the policy ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#policy_id WafRuleKnownAttackSource#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#region WafRuleKnownAttackSource#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source huaweicloud_waf_rule_known_attack_source} +*/ +export class WafRuleKnownAttackSource extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_known_attack_source"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleKnownAttackSource resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleKnownAttackSource to import + * @param importFromId The id of the existing WafRuleKnownAttackSource that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleKnownAttackSource to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_known_attack_source", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_known_attack_source huaweicloud_waf_rule_known_attack_source} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleKnownAttackSourceConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleKnownAttackSourceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_known_attack_source', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._blockTime = config.blockTime; + this._blockType = config.blockType; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._policyId = config.policyId; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // block_time - computed: false, optional: false, required: true + private _blockTime?: number; + public get blockTime() { + return this.getNumberAttribute('block_time'); + } + public set blockTime(value: number) { + this._blockTime = value; + } + // Temporarily expose input value. Use with caution. + public get blockTimeInput() { + return this._blockTime; + } + + // block_type - computed: false, optional: false, required: true + private _blockType?: string; + public get blockType() { + return this.getStringAttribute('block_type'); + } + public set blockType(value: string) { + this._blockType = value; + } + // Temporarily expose input value. Use with caution. + public get blockTypeInput() { + return this._blockType; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + block_time: cdktf.numberToTerraform(this._blockTime), + block_type: cdktf.stringToTerraform(this._blockType), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + block_time: { + value: cdktf.numberToHclTerraform(this._blockTime), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + block_type: { + value: cdktf.stringToHclTerraform(this._blockType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-precise-protection/README.md b/src/constructs/providers/huaweicloud/waf-rule-precise-protection/README.md new file mode 100644 index 00000000..3240b210 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-precise-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_precise_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_precise_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection). diff --git a/src/constructs/providers/huaweicloud/waf-rule-precise-protection/index.ts b/src/constructs/providers/huaweicloud/waf-rule-precise-protection/index.ts new file mode 100644 index 00000000..5f23d166 --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-precise-protection/index.ts @@ -0,0 +1,714 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRulePreciseProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the protective action of the precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#action WafRulePreciseProtection#action} + */ + readonly action?: string; + /** + * Specifies the description of WAF precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#description WafRulePreciseProtection#description} + */ + readonly description?: string; + /** + * Specifies the time when the precise protection rule expires. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#end_time WafRulePreciseProtection#end_time} + */ + readonly endTime?: string; + /** + * Specifies the enterprise project ID of WAF precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#enterprise_project_id WafRulePreciseProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#id WafRulePreciseProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the known attack source ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#known_attack_source_id WafRulePreciseProtection#known_attack_source_id} + */ + readonly knownAttackSourceId?: string; + /** + * Specifies the name of WAF precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#name WafRulePreciseProtection#name} + */ + readonly name: string; + /** + * Specifies the policy ID of WAF precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#policy_id WafRulePreciseProtection#policy_id} + */ + readonly policyId: string; + /** + * Specifies the priority of a rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#priority WafRulePreciseProtection#priority} + */ + readonly priority: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#region WafRulePreciseProtection#region} + */ + readonly region?: string; + /** + * Specifies the time when the precise protection rule takes effect. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#start_time WafRulePreciseProtection#start_time} + */ + readonly startTime?: string; + /** + * Specifies the status of WAF precise protection rule. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#status WafRulePreciseProtection#status} + */ + readonly status?: number; + /** + * conditions block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#conditions WafRulePreciseProtection#conditions} + */ + readonly conditions: WafRulePreciseProtectionConditions[] | cdktf.IResolvable; +} +export interface WafRulePreciseProtectionConditions { + /** + * Specifies the content of the match condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#content WafRulePreciseProtection#content} + */ + readonly content?: string; + /** + * Specifies the field of the condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#field WafRulePreciseProtection#field} + */ + readonly field: string; + /** + * Specifies the condition matching logic. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#logic WafRulePreciseProtection#logic} + */ + readonly logic: string; + /** + * Specifies the reference table id. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#reference_table_id WafRulePreciseProtection#reference_table_id} + */ + readonly referenceTableId?: string; + /** + * Specifies the subfield of the condition. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#subfield WafRulePreciseProtection#subfield} + */ + readonly subfield?: string; +} + +export function wafRulePreciseProtectionConditionsToTerraform(struct?: WafRulePreciseProtectionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + content: cdktf.stringToTerraform(struct!.content), + field: cdktf.stringToTerraform(struct!.field), + logic: cdktf.stringToTerraform(struct!.logic), + reference_table_id: cdktf.stringToTerraform(struct!.referenceTableId), + subfield: cdktf.stringToTerraform(struct!.subfield), + } +} + + +export function wafRulePreciseProtectionConditionsToHclTerraform(struct?: WafRulePreciseProtectionConditions | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + content: { + value: cdktf.stringToHclTerraform(struct!.content), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + field: { + value: cdktf.stringToHclTerraform(struct!.field), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + logic: { + value: cdktf.stringToHclTerraform(struct!.logic), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + reference_table_id: { + value: cdktf.stringToHclTerraform(struct!.referenceTableId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subfield: { + value: cdktf.stringToHclTerraform(struct!.subfield), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WafRulePreciseProtectionConditionsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WafRulePreciseProtectionConditions | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._content !== undefined) { + hasAnyValues = true; + internalValueResult.content = this._content; + } + if (this._field !== undefined) { + hasAnyValues = true; + internalValueResult.field = this._field; + } + if (this._logic !== undefined) { + hasAnyValues = true; + internalValueResult.logic = this._logic; + } + if (this._referenceTableId !== undefined) { + hasAnyValues = true; + internalValueResult.referenceTableId = this._referenceTableId; + } + if (this._subfield !== undefined) { + hasAnyValues = true; + internalValueResult.subfield = this._subfield; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WafRulePreciseProtectionConditions | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._content = undefined; + this._field = undefined; + this._logic = undefined; + this._referenceTableId = undefined; + this._subfield = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._content = value.content; + this._field = value.field; + this._logic = value.logic; + this._referenceTableId = value.referenceTableId; + this._subfield = value.subfield; + } + } + + // content - computed: true, optional: true, required: false + private _content?: string; + public get content() { + return this.getStringAttribute('content'); + } + public set content(value: string) { + this._content = value; + } + public resetContent() { + this._content = undefined; + } + // Temporarily expose input value. Use with caution. + public get contentInput() { + return this._content; + } + + // field - computed: false, optional: false, required: true + private _field?: string; + public get field() { + return this.getStringAttribute('field'); + } + public set field(value: string) { + this._field = value; + } + // Temporarily expose input value. Use with caution. + public get fieldInput() { + return this._field; + } + + // logic - computed: false, optional: false, required: true + private _logic?: string; + public get logic() { + return this.getStringAttribute('logic'); + } + public set logic(value: string) { + this._logic = value; + } + // Temporarily expose input value. Use with caution. + public get logicInput() { + return this._logic; + } + + // reference_table_id - computed: true, optional: true, required: false + private _referenceTableId?: string; + public get referenceTableId() { + return this.getStringAttribute('reference_table_id'); + } + public set referenceTableId(value: string) { + this._referenceTableId = value; + } + public resetReferenceTableId() { + this._referenceTableId = undefined; + } + // Temporarily expose input value. Use with caution. + public get referenceTableIdInput() { + return this._referenceTableId; + } + + // subfield - computed: true, optional: true, required: false + private _subfield?: string; + public get subfield() { + return this.getStringAttribute('subfield'); + } + public set subfield(value: string) { + this._subfield = value; + } + public resetSubfield() { + this._subfield = undefined; + } + // Temporarily expose input value. Use with caution. + public get subfieldInput() { + return this._subfield; + } +} + +export class WafRulePreciseProtectionConditionsList extends cdktf.ComplexList { + public internalValue? : WafRulePreciseProtectionConditions[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WafRulePreciseProtectionConditionsOutputReference { + return new WafRulePreciseProtectionConditionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection huaweicloud_waf_rule_precise_protection} +*/ +export class WafRulePreciseProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_precise_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRulePreciseProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRulePreciseProtection to import + * @param importFromId The id of the existing WafRulePreciseProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRulePreciseProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_precise_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_precise_protection huaweicloud_waf_rule_precise_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRulePreciseProtectionConfig + */ + public constructor(scope: Construct, id: string, config: WafRulePreciseProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_precise_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._action = config.action; + this._description = config.description; + this._endTime = config.endTime; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._knownAttackSourceId = config.knownAttackSourceId; + this._name = config.name; + this._policyId = config.policyId; + this._priority = config.priority; + this._region = config.region; + this._startTime = config.startTime; + this._status = config.status; + this._conditions.internalValue = config.conditions; + } + + // ========== + // ATTRIBUTES + // ========== + + // action - computed: false, optional: true, required: false + private _action?: string; + public get action() { + return this.getStringAttribute('action'); + } + public set action(value: string) { + this._action = value; + } + public resetAction() { + this._action = undefined; + } + // Temporarily expose input value. Use with caution. + public get actionInput() { + return this._action; + } + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // end_time - computed: false, optional: true, required: false + private _endTime?: string; + public get endTime() { + return this.getStringAttribute('end_time'); + } + public set endTime(value: string) { + this._endTime = value; + } + public resetEndTime() { + this._endTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get endTimeInput() { + return this._endTime; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // known_attack_source_id - computed: false, optional: true, required: false + private _knownAttackSourceId?: string; + public get knownAttackSourceId() { + return this.getStringAttribute('known_attack_source_id'); + } + public set knownAttackSourceId(value: string) { + this._knownAttackSourceId = value; + } + public resetKnownAttackSourceId() { + this._knownAttackSourceId = undefined; + } + // Temporarily expose input value. Use with caution. + public get knownAttackSourceIdInput() { + return this._knownAttackSourceId; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // priority - computed: false, optional: false, required: true + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // start_time - computed: false, optional: true, required: false + private _startTime?: string; + public get startTime() { + return this.getStringAttribute('start_time'); + } + public set startTime(value: string) { + this._startTime = value; + } + public resetStartTime() { + this._startTime = undefined; + } + // Temporarily expose input value. Use with caution. + public get startTimeInput() { + return this._startTime; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // conditions - computed: false, optional: false, required: true + private _conditions = new WafRulePreciseProtectionConditionsList(this, "conditions", false); + public get conditions() { + return this._conditions; + } + public putConditions(value: WafRulePreciseProtectionConditions[] | cdktf.IResolvable) { + this._conditions.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get conditionsInput() { + return this._conditions.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + action: cdktf.stringToTerraform(this._action), + description: cdktf.stringToTerraform(this._description), + end_time: cdktf.stringToTerraform(this._endTime), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + known_attack_source_id: cdktf.stringToTerraform(this._knownAttackSourceId), + name: cdktf.stringToTerraform(this._name), + policy_id: cdktf.stringToTerraform(this._policyId), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + start_time: cdktf.stringToTerraform(this._startTime), + status: cdktf.numberToTerraform(this._status), + conditions: cdktf.listMapper(wafRulePreciseProtectionConditionsToTerraform, true)(this._conditions.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + action: { + value: cdktf.stringToHclTerraform(this._action), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + end_time: { + value: cdktf.stringToHclTerraform(this._endTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + known_attack_source_id: { + value: cdktf.stringToHclTerraform(this._knownAttackSourceId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + start_time: { + value: cdktf.stringToHclTerraform(this._startTime), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + conditions: { + value: cdktf.listMapperHcl(wafRulePreciseProtectionConditionsToHclTerraform, true)(this._conditions.internalValue), + isBlock: true, + type: "list", + storageClassType: "WafRulePreciseProtectionConditionsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/README.md b/src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/README.md new file mode 100644 index 00000000..dcb785fe --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_waf_rule_web_tamper_protection` + +Refer to the Terraform Registry for docs: [`huaweicloud_waf_rule_web_tamper_protection`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection). diff --git a/src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/index.ts b/src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/index.ts new file mode 100644 index 00000000..462accab --- /dev/null +++ b/src/constructs/providers/huaweicloud/waf-rule-web-tamper-protection/index.ts @@ -0,0 +1,303 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WafRuleWebTamperProtectionConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#description WafRuleWebTamperProtection#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#domain WafRuleWebTamperProtection#domain} + */ + readonly domain: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#enterprise_project_id WafRuleWebTamperProtection#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#id WafRuleWebTamperProtection#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#path WafRuleWebTamperProtection#path} + */ + readonly path: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#policy_id WafRuleWebTamperProtection#policy_id} + */ + readonly policyId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#region WafRuleWebTamperProtection#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#status WafRuleWebTamperProtection#status} + */ + readonly status?: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection huaweicloud_waf_rule_web_tamper_protection} +*/ +export class WafRuleWebTamperProtection extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_waf_rule_web_tamper_protection"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WafRuleWebTamperProtection resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WafRuleWebTamperProtection to import + * @param importFromId The id of the existing WafRuleWebTamperProtection that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WafRuleWebTamperProtection to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_waf_rule_web_tamper_protection", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/waf_rule_web_tamper_protection huaweicloud_waf_rule_web_tamper_protection} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WafRuleWebTamperProtectionConfig + */ + public constructor(scope: Construct, id: string, config: WafRuleWebTamperProtectionConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_waf_rule_web_tamper_protection', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._domain = config.domain; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._path = config.path; + this._policyId = config.policyId; + this._region = config.region; + this._status = config.status; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: true, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // domain - computed: false, optional: false, required: true + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // path - computed: false, optional: false, required: true + private _path?: string; + public get path() { + return this.getStringAttribute('path'); + } + public set path(value: string) { + this._path = value; + } + // Temporarily expose input value. Use with caution. + public get pathInput() { + return this._path; + } + + // policy_id - computed: false, optional: false, required: true + private _policyId?: string; + public get policyId() { + return this.getStringAttribute('policy_id'); + } + public set policyId(value: string) { + this._policyId = value; + } + // Temporarily expose input value. Use with caution. + public get policyIdInput() { + return this._policyId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: false, optional: true, required: false + private _status?: number; + public get status() { + return this.getNumberAttribute('status'); + } + public set status(value: number) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + domain: cdktf.stringToTerraform(this._domain), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + path: cdktf.stringToTerraform(this._path), + policy_id: cdktf.stringToTerraform(this._policyId), + region: cdktf.stringToTerraform(this._region), + status: cdktf.numberToTerraform(this._status), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(this._domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + path: { + value: cdktf.stringToHclTerraform(this._path), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_id: { + value: cdktf.stringToHclTerraform(this._policyId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + status: { + value: cdktf.numberToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-access-policy/README.md b/src/constructs/providers/huaweicloud/workspace-access-policy/README.md new file mode 100644 index 00000000..342cbbca --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-access-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_access_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_access_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy). diff --git a/src/constructs/providers/huaweicloud/workspace-access-policy/index.ts b/src/constructs/providers/huaweicloud/workspace-access-policy/index.ts new file mode 100644 index 00000000..cc9a3883 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-access-policy/index.ts @@ -0,0 +1,387 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAccessPolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The type of access policy blacklist. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#blacklist_type WorkspaceAccessPolicy#blacklist_type} + */ + readonly blacklistType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#id WorkspaceAccessPolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the access policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#name WorkspaceAccessPolicy#name} + */ + readonly name: string; + /** + * The region where the access policy is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#region WorkspaceAccessPolicy#region} + */ + readonly region?: string; + /** + * blacklist block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#blacklist WorkspaceAccessPolicy#blacklist} + */ + readonly blacklist?: WorkspaceAccessPolicyBlacklistStruct[] | cdktf.IResolvable; +} +export interface WorkspaceAccessPolicyBlacklistStruct { + /** + * The object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#object_id WorkspaceAccessPolicy#object_id} + */ + readonly objectId: string; + /** + * The object type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#object_type WorkspaceAccessPolicy#object_type} + */ + readonly objectType: string; +} + +export function workspaceAccessPolicyBlacklistStructToTerraform(struct?: WorkspaceAccessPolicyBlacklistStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + object_id: cdktf.stringToTerraform(struct!.objectId), + object_type: cdktf.stringToTerraform(struct!.objectType), + } +} + + +export function workspaceAccessPolicyBlacklistStructToHclTerraform(struct?: WorkspaceAccessPolicyBlacklistStruct | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + object_id: { + value: cdktf.stringToHclTerraform(struct!.objectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + object_type: { + value: cdktf.stringToHclTerraform(struct!.objectType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAccessPolicyBlacklistStructOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceAccessPolicyBlacklistStruct | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._objectId !== undefined) { + hasAnyValues = true; + internalValueResult.objectId = this._objectId; + } + if (this._objectType !== undefined) { + hasAnyValues = true; + internalValueResult.objectType = this._objectType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAccessPolicyBlacklistStruct | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._objectId = undefined; + this._objectType = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._objectId = value.objectId; + this._objectType = value.objectType; + } + } + + // object_id - computed: false, optional: false, required: true + private _objectId?: string; + public get objectId() { + return this.getStringAttribute('object_id'); + } + public set objectId(value: string) { + this._objectId = value; + } + // Temporarily expose input value. Use with caution. + public get objectIdInput() { + return this._objectId; + } + + // object_name - computed: true, optional: false, required: false + public get objectName() { + return this.getStringAttribute('object_name'); + } + + // object_type - computed: false, optional: false, required: true + private _objectType?: string; + public get objectType() { + return this.getStringAttribute('object_type'); + } + public set objectType(value: string) { + this._objectType = value; + } + // Temporarily expose input value. Use with caution. + public get objectTypeInput() { + return this._objectType; + } +} + +export class WorkspaceAccessPolicyBlacklistStructList extends cdktf.ComplexList { + public internalValue? : WorkspaceAccessPolicyBlacklistStruct[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceAccessPolicyBlacklistStructOutputReference { + return new WorkspaceAccessPolicyBlacklistStructOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy huaweicloud_workspace_access_policy} +*/ +export class WorkspaceAccessPolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_access_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAccessPolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAccessPolicy to import + * @param importFromId The id of the existing WorkspaceAccessPolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAccessPolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_access_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_access_policy huaweicloud_workspace_access_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAccessPolicyConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAccessPolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_access_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._blacklistType = config.blacklistType; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._blacklist.internalValue = config.blacklist; + } + + // ========== + // ATTRIBUTES + // ========== + + // blacklist_type - computed: false, optional: false, required: true + private _blacklistType?: string; + public get blacklistType() { + return this.getStringAttribute('blacklist_type'); + } + public set blacklistType(value: string) { + this._blacklistType = value; + } + // Temporarily expose input value. Use with caution. + public get blacklistTypeInput() { + return this._blacklistType; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // blacklist - computed: false, optional: true, required: false + private _blacklist = new WorkspaceAccessPolicyBlacklistStructList(this, "blacklist", true); + public get blacklist() { + return this._blacklist; + } + public putBlacklist(value: WorkspaceAccessPolicyBlacklistStruct[] | cdktf.IResolvable) { + this._blacklist.internalValue = value; + } + public resetBlacklist() { + this._blacklist.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get blacklistInput() { + return this._blacklist.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + blacklist_type: cdktf.stringToTerraform(this._blacklistType), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + blacklist: cdktf.listMapper(workspaceAccessPolicyBlacklistStructToTerraform, true)(this._blacklist.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + blacklist_type: { + value: cdktf.stringToHclTerraform(this._blacklistType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + blacklist: { + value: cdktf.listMapperHcl(workspaceAccessPolicyBlacklistStructToHclTerraform, true)(this._blacklist.internalValue), + isBlock: true, + type: "set", + storageClassType: "WorkspaceAccessPolicyBlacklistStructList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-group-authorization/README.md b/src/constructs/providers/huaweicloud/workspace-app-group-authorization/README.md new file mode 100644 index 00000000..aee0430c --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-group-authorization/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_group_authorization` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_group_authorization`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization). diff --git a/src/constructs/providers/huaweicloud/workspace-app-group-authorization/index.ts b/src/constructs/providers/huaweicloud/workspace-app-group-authorization/index.ts new file mode 100644 index 00000000..db7a08c6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-group-authorization/index.ts @@ -0,0 +1,383 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppGroupAuthorizationConfig extends cdktf.TerraformMetaArguments { + /** + * The ID of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#app_group_id WorkspaceAppGroupAuthorization#app_group_id} + */ + readonly appGroupId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#id WorkspaceAppGroupAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#region WorkspaceAppGroupAuthorization#region} + */ + readonly region?: string; + /** + * accounts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#accounts WorkspaceAppGroupAuthorization#accounts} + */ + readonly accounts: WorkspaceAppGroupAuthorizationAccounts[] | cdktf.IResolvable; +} +export interface WorkspaceAppGroupAuthorizationAccounts { + /** + * The name of the user (group). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#account WorkspaceAppGroupAuthorization#account} + */ + readonly account: string; + /** + * The ID of the user (group). + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#id WorkspaceAppGroupAuthorization#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The type of the object to be authorized. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#type WorkspaceAppGroupAuthorization#type} + */ + readonly type: string; +} + +export function workspaceAppGroupAuthorizationAccountsToTerraform(struct?: WorkspaceAppGroupAuthorizationAccounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + account: cdktf.stringToTerraform(struct!.account), + id: cdktf.stringToTerraform(struct!.id), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceAppGroupAuthorizationAccountsToHclTerraform(struct?: WorkspaceAppGroupAuthorizationAccounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + account: { + value: cdktf.stringToHclTerraform(struct!.account), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppGroupAuthorizationAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceAppGroupAuthorizationAccounts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._account !== undefined) { + hasAnyValues = true; + internalValueResult.account = this._account; + } + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppGroupAuthorizationAccounts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._account = undefined; + this._id = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._account = value.account; + this._id = value.id; + this._type = value.type; + } + } + + // account - computed: false, optional: false, required: true + private _account?: string; + public get account() { + return this.getStringAttribute('account'); + } + public set account(value: string) { + this._account = value; + } + // Temporarily expose input value. Use with caution. + public get accountInput() { + return this._account; + } + + // id - computed: false, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class WorkspaceAppGroupAuthorizationAccountsList extends cdktf.ComplexList { + public internalValue? : WorkspaceAppGroupAuthorizationAccounts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceAppGroupAuthorizationAccountsOutputReference { + return new WorkspaceAppGroupAuthorizationAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization huaweicloud_workspace_app_group_authorization} +*/ +export class WorkspaceAppGroupAuthorization extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_group_authorization"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppGroupAuthorization resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppGroupAuthorization to import + * @param importFromId The id of the existing WorkspaceAppGroupAuthorization that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppGroupAuthorization to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_group_authorization", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group_authorization huaweicloud_workspace_app_group_authorization} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppGroupAuthorizationConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppGroupAuthorizationConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_group_authorization', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appGroupId = config.appGroupId; + this._id = config.id; + this._region = config.region; + this._accounts.internalValue = config.accounts; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_group_id - computed: false, optional: false, required: true + private _appGroupId?: string; + public get appGroupId() { + return this.getStringAttribute('app_group_id'); + } + public set appGroupId(value: string) { + this._appGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get appGroupIdInput() { + return this._appGroupId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // accounts - computed: false, optional: false, required: true + private _accounts = new WorkspaceAppGroupAuthorizationAccountsList(this, "accounts", false); + public get accounts() { + return this._accounts; + } + public putAccounts(value: WorkspaceAppGroupAuthorizationAccounts[] | cdktf.IResolvable) { + this._accounts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get accountsInput() { + return this._accounts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_group_id: cdktf.stringToTerraform(this._appGroupId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + accounts: cdktf.listMapper(workspaceAppGroupAuthorizationAccountsToTerraform, true)(this._accounts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_group_id: { + value: cdktf.stringToHclTerraform(this._appGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + accounts: { + value: cdktf.listMapperHcl(workspaceAppGroupAuthorizationAccountsToHclTerraform, true)(this._accounts.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppGroupAuthorizationAccountsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-group/README.md b/src/constructs/providers/huaweicloud/workspace-app-group/README.md new file mode 100644 index 00000000..2220fca8 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group). diff --git a/src/constructs/providers/huaweicloud/workspace-app-group/index.ts b/src/constructs/providers/huaweicloud/workspace-app-group/index.ts new file mode 100644 index 00000000..e86e83d6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-group/index.ts @@ -0,0 +1,268 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppGroupConfig extends cdktf.TerraformMetaArguments { + /** + * Specifies the description of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#description WorkspaceAppGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#id WorkspaceAppGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Specifies the name of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#name WorkspaceAppGroup#name} + */ + readonly name: string; + /** + * The region in which to create the resource. If omitted, the provider-level region will be used. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#region WorkspaceAppGroup#region} + */ + readonly region?: string; + /** + * Specifies the server group ID associated with the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#server_group_id WorkspaceAppGroup#server_group_id} + */ + readonly serverGroupId?: string; + /** + * Specifies the type of the application group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#type WorkspaceAppGroup#type} + */ + readonly type?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group huaweicloud_workspace_app_group} +*/ +export class WorkspaceAppGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppGroup to import + * @param importFromId The id of the existing WorkspaceAppGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_group huaweicloud_workspace_app_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppGroupConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._serverGroupId = config.serverGroupId; + this._type = config.type; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_group_id - computed: false, optional: true, required: false + private _serverGroupId?: string; + public get serverGroupId() { + return this.getStringAttribute('server_group_id'); + } + public set serverGroupId(value: string) { + this._serverGroupId = value; + } + public resetServerGroupId() { + this._serverGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get serverGroupIdInput() { + return this._serverGroupId; + } + + // type - computed: true, optional: true, required: false + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + public resetType() { + this._type = undefined; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + server_group_id: cdktf.stringToTerraform(this._serverGroupId), + type: cdktf.stringToTerraform(this._type), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_group_id: { + value: cdktf.stringToHclTerraform(this._serverGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-image-server/README.md b/src/constructs/providers/huaweicloud/workspace-app-image-server/README.md new file mode 100644 index 00000000..eb78c382 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-image-server/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_image_server` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_image_server`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server). diff --git a/src/constructs/providers/huaweicloud/workspace-app-image-server/index.ts b/src/constructs/providers/huaweicloud/workspace-app-image-server/index.ts new file mode 100644 index 00000000..76448d44 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-image-server/index.ts @@ -0,0 +1,1516 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppImageServerConfig extends cdktf.TerraformMetaArguments { + /** + * The list of the warehouse apps. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#attach_apps WorkspaceAppImageServer#attach_apps} + */ + readonly attachApps?: string[]; + /** + * The availability zone of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#availability_zone WorkspaceAppImageServer#availability_zone} + */ + readonly availabilityZone?: string; + /** + * The description of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#description WorkspaceAppImageServer#description} + */ + readonly description?: string; + /** + * The ID of the enterprise project to which the image server belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#enterprise_project_id WorkspaceAppImageServer#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The number of additional sessions for a single server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#extra_session_size WorkspaceAppImageServer#extra_session_size} + */ + readonly extraSessionSize?: number; + /** + * The additional session type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#extra_session_type WorkspaceAppImageServer#extra_session_type} + */ + readonly extraSessionType?: string; + /** + * The flavor ID of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#flavor_id WorkspaceAppImageServer#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#id WorkspaceAppImageServer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The basic image ID of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#image_id WorkspaceAppImageServer#image_id} + */ + readonly imageId: string; + /** + * The basic image product ID of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#image_source_product_id WorkspaceAppImageServer#image_source_product_id} + */ + readonly imageSourceProductId?: string; + /** + * The basic image type of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#image_type WorkspaceAppImageServer#image_type} + */ + readonly imageType: string; + /** + * Whether to delete resources associated with this image server after deleting it. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#is_delete_associated_resources WorkspaceAppImageServer#is_delete_associated_resources} + */ + readonly isDeleteAssociatedResources?: boolean | cdktf.IResolvable; + /** + * The session mode of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#is_vdi WorkspaceAppImageServer#is_vdi} + */ + readonly isVdi?: boolean | cdktf.IResolvable; + /** + * The name of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#name WorkspaceAppImageServer#name} + */ + readonly name: string; + /** + * The OU name corresponding to the AD server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#ou_name WorkspaceAppImageServer#ou_name} + */ + readonly ouName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#region WorkspaceAppImageServer#region} + */ + readonly region?: string; + /** + * The specification code of the basic image to which the image server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#spec_code WorkspaceAppImageServer#spec_code} + */ + readonly specCode?: string; + /** + * The subnet ID to which the image server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#subnet_id WorkspaceAppImageServer#subnet_id} + */ + readonly subnetId: string; + /** + * The key/value pairs to associate with the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#tags WorkspaceAppImageServer#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID to which the image server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#vpc_id WorkspaceAppImageServer#vpc_id} + */ + readonly vpcId: string; + /** + * authorize_accounts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#authorize_accounts WorkspaceAppImageServer#authorize_accounts} + */ + readonly authorizeAccounts: WorkspaceAppImageServerAuthorizeAccounts[] | cdktf.IResolvable; + /** + * root_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#root_volume WorkspaceAppImageServer#root_volume} + */ + readonly rootVolume: WorkspaceAppImageServerRootVolume; + /** + * route_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#route_policy WorkspaceAppImageServer#route_policy} + */ + readonly routePolicy?: WorkspaceAppImageServerRoutePolicy; + /** + * scheduler_hints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#scheduler_hints WorkspaceAppImageServer#scheduler_hints} + */ + readonly schedulerHints?: WorkspaceAppImageServerSchedulerHints; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#timeouts WorkspaceAppImageServer#timeouts} + */ + readonly timeouts?: WorkspaceAppImageServerTimeouts; +} +export interface WorkspaceAppImageServerAuthorizeAccounts { + /** + * The name of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#account WorkspaceAppImageServer#account} + */ + readonly account: string; + /** + * The domain name of the Workspace service. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#domain WorkspaceAppImageServer#domain} + */ + readonly domain?: string; + /** + * The type of the account. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#type WorkspaceAppImageServer#type} + */ + readonly type: string; +} + +export function workspaceAppImageServerAuthorizeAccountsToTerraform(struct?: WorkspaceAppImageServerAuthorizeAccounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + account: cdktf.stringToTerraform(struct!.account), + domain: cdktf.stringToTerraform(struct!.domain), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceAppImageServerAuthorizeAccountsToHclTerraform(struct?: WorkspaceAppImageServerAuthorizeAccounts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + account: { + value: cdktf.stringToHclTerraform(struct!.account), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + domain: { + value: cdktf.stringToHclTerraform(struct!.domain), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppImageServerAuthorizeAccountsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceAppImageServerAuthorizeAccounts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._account !== undefined) { + hasAnyValues = true; + internalValueResult.account = this._account; + } + if (this._domain !== undefined) { + hasAnyValues = true; + internalValueResult.domain = this._domain; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppImageServerAuthorizeAccounts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._account = undefined; + this._domain = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._account = value.account; + this._domain = value.domain; + this._type = value.type; + } + } + + // account - computed: false, optional: false, required: true + private _account?: string; + public get account() { + return this.getStringAttribute('account'); + } + public set account(value: string) { + this._account = value; + } + // Temporarily expose input value. Use with caution. + public get accountInput() { + return this._account; + } + + // domain - computed: false, optional: true, required: false + private _domain?: string; + public get domain() { + return this.getStringAttribute('domain'); + } + public set domain(value: string) { + this._domain = value; + } + public resetDomain() { + this._domain = undefined; + } + // Temporarily expose input value. Use with caution. + public get domainInput() { + return this._domain; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class WorkspaceAppImageServerAuthorizeAccountsList extends cdktf.ComplexList { + public internalValue? : WorkspaceAppImageServerAuthorizeAccounts[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceAppImageServerAuthorizeAccountsOutputReference { + return new WorkspaceAppImageServerAuthorizeAccountsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WorkspaceAppImageServerRootVolume { + /** + * The disk size of the image server, in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#size WorkspaceAppImageServer#size} + */ + readonly size: number; + /** + * The disk type of the image server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#type WorkspaceAppImageServer#type} + */ + readonly type: string; +} + +export function workspaceAppImageServerRootVolumeToTerraform(struct?: WorkspaceAppImageServerRootVolumeOutputReference | WorkspaceAppImageServerRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceAppImageServerRootVolumeToHclTerraform(struct?: WorkspaceAppImageServerRootVolumeOutputReference | WorkspaceAppImageServerRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppImageServerRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppImageServerRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppImageServerRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._type = value.type; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface WorkspaceAppImageServerRoutePolicy { + /** + * The CPU usage of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#cpu_threshold WorkspaceAppImageServer#cpu_threshold} + */ + readonly cpuThreshold?: number; + /** + * The number of session connections of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#max_session WorkspaceAppImageServer#max_session} + */ + readonly maxSession?: number; + /** + * The memory usage of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#mem_threshold WorkspaceAppImageServer#mem_threshold} + */ + readonly memThreshold?: number; +} + +export function workspaceAppImageServerRoutePolicyToTerraform(struct?: WorkspaceAppImageServerRoutePolicyOutputReference | WorkspaceAppImageServerRoutePolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cpu_threshold: cdktf.numberToTerraform(struct!.cpuThreshold), + max_session: cdktf.numberToTerraform(struct!.maxSession), + mem_threshold: cdktf.numberToTerraform(struct!.memThreshold), + } +} + + +export function workspaceAppImageServerRoutePolicyToHclTerraform(struct?: WorkspaceAppImageServerRoutePolicyOutputReference | WorkspaceAppImageServerRoutePolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cpu_threshold: { + value: cdktf.numberToHclTerraform(struct!.cpuThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_session: { + value: cdktf.numberToHclTerraform(struct!.maxSession), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mem_threshold: { + value: cdktf.numberToHclTerraform(struct!.memThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppImageServerRoutePolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppImageServerRoutePolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cpuThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.cpuThreshold = this._cpuThreshold; + } + if (this._maxSession !== undefined) { + hasAnyValues = true; + internalValueResult.maxSession = this._maxSession; + } + if (this._memThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.memThreshold = this._memThreshold; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppImageServerRoutePolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cpuThreshold = undefined; + this._maxSession = undefined; + this._memThreshold = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cpuThreshold = value.cpuThreshold; + this._maxSession = value.maxSession; + this._memThreshold = value.memThreshold; + } + } + + // cpu_threshold - computed: false, optional: true, required: false + private _cpuThreshold?: number; + public get cpuThreshold() { + return this.getNumberAttribute('cpu_threshold'); + } + public set cpuThreshold(value: number) { + this._cpuThreshold = value; + } + public resetCpuThreshold() { + this._cpuThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuThresholdInput() { + return this._cpuThreshold; + } + + // max_session - computed: false, optional: true, required: false + private _maxSession?: number; + public get maxSession() { + return this.getNumberAttribute('max_session'); + } + public set maxSession(value: number) { + this._maxSession = value; + } + public resetMaxSession() { + this._maxSession = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxSessionInput() { + return this._maxSession; + } + + // mem_threshold - computed: false, optional: true, required: false + private _memThreshold?: number; + public get memThreshold() { + return this.getNumberAttribute('mem_threshold'); + } + public set memThreshold(value: number) { + this._memThreshold = value; + } + public resetMemThreshold() { + this._memThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get memThresholdInput() { + return this._memThreshold; + } +} +export interface WorkspaceAppImageServerSchedulerHints { + /** + * The ID of the dedicate host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#dedicated_host_id WorkspaceAppImageServer#dedicated_host_id} + */ + readonly dedicatedHostId?: string; + /** + * The type of the dedicate host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#tenancy WorkspaceAppImageServer#tenancy} + */ + readonly tenancy?: string; +} + +export function workspaceAppImageServerSchedulerHintsToTerraform(struct?: WorkspaceAppImageServerSchedulerHintsOutputReference | WorkspaceAppImageServerSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dedicated_host_id: cdktf.stringToTerraform(struct!.dedicatedHostId), + tenancy: cdktf.stringToTerraform(struct!.tenancy), + } +} + + +export function workspaceAppImageServerSchedulerHintsToHclTerraform(struct?: WorkspaceAppImageServerSchedulerHintsOutputReference | WorkspaceAppImageServerSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dedicated_host_id: { + value: cdktf.stringToHclTerraform(struct!.dedicatedHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenancy: { + value: cdktf.stringToHclTerraform(struct!.tenancy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppImageServerSchedulerHintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppImageServerSchedulerHints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dedicatedHostId !== undefined) { + hasAnyValues = true; + internalValueResult.dedicatedHostId = this._dedicatedHostId; + } + if (this._tenancy !== undefined) { + hasAnyValues = true; + internalValueResult.tenancy = this._tenancy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppImageServerSchedulerHints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dedicatedHostId = undefined; + this._tenancy = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dedicatedHostId = value.dedicatedHostId; + this._tenancy = value.tenancy; + } + } + + // dedicated_host_id - computed: false, optional: true, required: false + private _dedicatedHostId?: string; + public get dedicatedHostId() { + return this.getStringAttribute('dedicated_host_id'); + } + public set dedicatedHostId(value: string) { + this._dedicatedHostId = value; + } + public resetDedicatedHostId() { + this._dedicatedHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedHostIdInput() { + return this._dedicatedHostId; + } + + // tenancy - computed: false, optional: true, required: false + private _tenancy?: string; + public get tenancy() { + return this.getStringAttribute('tenancy'); + } + public set tenancy(value: string) { + this._tenancy = value; + } + public resetTenancy() { + this._tenancy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenancyInput() { + return this._tenancy; + } +} +export interface WorkspaceAppImageServerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#create WorkspaceAppImageServer#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#delete WorkspaceAppImageServer#delete} + */ + readonly delete?: string; +} + +export function workspaceAppImageServerTimeoutsToTerraform(struct?: WorkspaceAppImageServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function workspaceAppImageServerTimeoutsToHclTerraform(struct?: WorkspaceAppImageServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppImageServerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WorkspaceAppImageServerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppImageServerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server huaweicloud_workspace_app_image_server} +*/ +export class WorkspaceAppImageServer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_image_server"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppImageServer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppImageServer to import + * @param importFromId The id of the existing WorkspaceAppImageServer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppImageServer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_image_server", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image_server huaweicloud_workspace_app_image_server} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppImageServerConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppImageServerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_image_server', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._attachApps = config.attachApps; + this._availabilityZone = config.availabilityZone; + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extraSessionSize = config.extraSessionSize; + this._extraSessionType = config.extraSessionType; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._imageSourceProductId = config.imageSourceProductId; + this._imageType = config.imageType; + this._isDeleteAssociatedResources = config.isDeleteAssociatedResources; + this._isVdi = config.isVdi; + this._name = config.name; + this._ouName = config.ouName; + this._region = config.region; + this._specCode = config.specCode; + this._subnetId = config.subnetId; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._authorizeAccounts.internalValue = config.authorizeAccounts; + this._rootVolume.internalValue = config.rootVolume; + this._routePolicy.internalValue = config.routePolicy; + this._schedulerHints.internalValue = config.schedulerHints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // attach_apps - computed: false, optional: true, required: false + private _attachApps?: string[]; + public get attachApps() { + return this.getListAttribute('attach_apps'); + } + public set attachApps(value: string[]) { + this._attachApps = value; + } + public resetAttachApps() { + this._attachApps = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachAppsInput() { + return this._attachApps; + } + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extra_session_size - computed: false, optional: true, required: false + private _extraSessionSize?: number; + public get extraSessionSize() { + return this.getNumberAttribute('extra_session_size'); + } + public set extraSessionSize(value: number) { + this._extraSessionSize = value; + } + public resetExtraSessionSize() { + this._extraSessionSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get extraSessionSizeInput() { + return this._extraSessionSize; + } + + // extra_session_type - computed: false, optional: true, required: false + private _extraSessionType?: string; + public get extraSessionType() { + return this.getStringAttribute('extra_session_type'); + } + public set extraSessionType(value: string) { + this._extraSessionType = value; + } + public resetExtraSessionType() { + this._extraSessionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get extraSessionTypeInput() { + return this._extraSessionType; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_source_product_id - computed: false, optional: true, required: false + private _imageSourceProductId?: string; + public get imageSourceProductId() { + return this.getStringAttribute('image_source_product_id'); + } + public set imageSourceProductId(value: string) { + this._imageSourceProductId = value; + } + public resetImageSourceProductId() { + this._imageSourceProductId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageSourceProductIdInput() { + return this._imageSourceProductId; + } + + // image_type - computed: false, optional: false, required: true + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // is_delete_associated_resources - computed: false, optional: true, required: false + private _isDeleteAssociatedResources?: boolean | cdktf.IResolvable; + public get isDeleteAssociatedResources() { + return this.getBooleanAttribute('is_delete_associated_resources'); + } + public set isDeleteAssociatedResources(value: boolean | cdktf.IResolvable) { + this._isDeleteAssociatedResources = value; + } + public resetIsDeleteAssociatedResources() { + this._isDeleteAssociatedResources = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDeleteAssociatedResourcesInput() { + return this._isDeleteAssociatedResources; + } + + // is_vdi - computed: false, optional: true, required: false + private _isVdi?: boolean | cdktf.IResolvable; + public get isVdi() { + return this.getBooleanAttribute('is_vdi'); + } + public set isVdi(value: boolean | cdktf.IResolvable) { + this._isVdi = value; + } + public resetIsVdi() { + this._isVdi = undefined; + } + // Temporarily expose input value. Use with caution. + public get isVdiInput() { + return this._isVdi; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // ou_name - computed: false, optional: true, required: false + private _ouName?: string; + public get ouName() { + return this.getStringAttribute('ou_name'); + } + public set ouName(value: string) { + this._ouName = value; + } + public resetOuName() { + this._ouName = undefined; + } + // Temporarily expose input value. Use with caution. + public get ouNameInput() { + return this._ouName; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // spec_code - computed: true, optional: true, required: false + private _specCode?: string; + public get specCode() { + return this.getStringAttribute('spec_code'); + } + public set specCode(value: string) { + this._specCode = value; + } + public resetSpecCode() { + this._specCode = undefined; + } + // Temporarily expose input value. Use with caution. + public get specCodeInput() { + return this._specCode; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // authorize_accounts - computed: false, optional: false, required: true + private _authorizeAccounts = new WorkspaceAppImageServerAuthorizeAccountsList(this, "authorize_accounts", true); + public get authorizeAccounts() { + return this._authorizeAccounts; + } + public putAuthorizeAccounts(value: WorkspaceAppImageServerAuthorizeAccounts[] | cdktf.IResolvable) { + this._authorizeAccounts.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get authorizeAccountsInput() { + return this._authorizeAccounts.internalValue; + } + + // root_volume - computed: false, optional: false, required: true + private _rootVolume = new WorkspaceAppImageServerRootVolumeOutputReference(this, "root_volume"); + public get rootVolume() { + return this._rootVolume; + } + public putRootVolume(value: WorkspaceAppImageServerRootVolume) { + this._rootVolume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeInput() { + return this._rootVolume.internalValue; + } + + // route_policy - computed: false, optional: true, required: false + private _routePolicy = new WorkspaceAppImageServerRoutePolicyOutputReference(this, "route_policy"); + public get routePolicy() { + return this._routePolicy; + } + public putRoutePolicy(value: WorkspaceAppImageServerRoutePolicy) { + this._routePolicy.internalValue = value; + } + public resetRoutePolicy() { + this._routePolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routePolicyInput() { + return this._routePolicy.internalValue; + } + + // scheduler_hints - computed: false, optional: true, required: false + private _schedulerHints = new WorkspaceAppImageServerSchedulerHintsOutputReference(this, "scheduler_hints"); + public get schedulerHints() { + return this._schedulerHints; + } + public putSchedulerHints(value: WorkspaceAppImageServerSchedulerHints) { + this._schedulerHints.internalValue = value; + } + public resetSchedulerHints() { + this._schedulerHints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerHintsInput() { + return this._schedulerHints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WorkspaceAppImageServerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WorkspaceAppImageServerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + attach_apps: cdktf.listMapper(cdktf.stringToTerraform, false)(this._attachApps), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extra_session_size: cdktf.numberToTerraform(this._extraSessionSize), + extra_session_type: cdktf.stringToTerraform(this._extraSessionType), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_source_product_id: cdktf.stringToTerraform(this._imageSourceProductId), + image_type: cdktf.stringToTerraform(this._imageType), + is_delete_associated_resources: cdktf.booleanToTerraform(this._isDeleteAssociatedResources), + is_vdi: cdktf.booleanToTerraform(this._isVdi), + name: cdktf.stringToTerraform(this._name), + ou_name: cdktf.stringToTerraform(this._ouName), + region: cdktf.stringToTerraform(this._region), + spec_code: cdktf.stringToTerraform(this._specCode), + subnet_id: cdktf.stringToTerraform(this._subnetId), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + authorize_accounts: cdktf.listMapper(workspaceAppImageServerAuthorizeAccountsToTerraform, true)(this._authorizeAccounts.internalValue), + root_volume: workspaceAppImageServerRootVolumeToTerraform(this._rootVolume.internalValue), + route_policy: workspaceAppImageServerRoutePolicyToTerraform(this._routePolicy.internalValue), + scheduler_hints: workspaceAppImageServerSchedulerHintsToTerraform(this._schedulerHints.internalValue), + timeouts: workspaceAppImageServerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + attach_apps: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._attachApps), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extra_session_size: { + value: cdktf.numberToHclTerraform(this._extraSessionSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + extra_session_type: { + value: cdktf.stringToHclTerraform(this._extraSessionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_source_product_id: { + value: cdktf.stringToHclTerraform(this._imageSourceProductId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_delete_associated_resources: { + value: cdktf.booleanToHclTerraform(this._isDeleteAssociatedResources), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + is_vdi: { + value: cdktf.booleanToHclTerraform(this._isVdi), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ou_name: { + value: cdktf.stringToHclTerraform(this._ouName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + spec_code: { + value: cdktf.stringToHclTerraform(this._specCode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + authorize_accounts: { + value: cdktf.listMapperHcl(workspaceAppImageServerAuthorizeAccountsToHclTerraform, true)(this._authorizeAccounts.internalValue), + isBlock: true, + type: "set", + storageClassType: "WorkspaceAppImageServerAuthorizeAccountsList", + }, + root_volume: { + value: workspaceAppImageServerRootVolumeToHclTerraform(this._rootVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppImageServerRootVolumeList", + }, + route_policy: { + value: workspaceAppImageServerRoutePolicyToHclTerraform(this._routePolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppImageServerRoutePolicyList", + }, + scheduler_hints: { + value: workspaceAppImageServerSchedulerHintsToHclTerraform(this._schedulerHints.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppImageServerSchedulerHintsList", + }, + timeouts: { + value: workspaceAppImageServerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WorkspaceAppImageServerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-image/README.md b/src/constructs/providers/huaweicloud/workspace-app-image/README.md new file mode 100644 index 00000000..d2870979 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-image/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_image` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_image`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image). diff --git a/src/constructs/providers/huaweicloud/workspace-app-image/index.ts b/src/constructs/providers/huaweicloud/workspace-app-image/index.ts new file mode 100644 index 00000000..d176649e --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-image/index.ts @@ -0,0 +1,415 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppImageConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#description WorkspaceAppImage#description} + */ + readonly description?: string; + /** + * The enterprise project ID to which the image belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#enterprise_project_id WorkspaceAppImage#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#id WorkspaceAppImage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#name WorkspaceAppImage#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#region WorkspaceAppImage#region} + */ + readonly region?: string; + /** + * The image server ID for generating a private image. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#server_id WorkspaceAppImage#server_id} + */ + readonly serverId: string; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#timeouts WorkspaceAppImage#timeouts} + */ + readonly timeouts?: WorkspaceAppImageTimeouts; +} +export interface WorkspaceAppImageTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#create WorkspaceAppImage#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#delete WorkspaceAppImage#delete} + */ + readonly delete?: string; +} + +export function workspaceAppImageTimeoutsToTerraform(struct?: WorkspaceAppImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function workspaceAppImageTimeoutsToHclTerraform(struct?: WorkspaceAppImageTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppImageTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WorkspaceAppImageTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppImageTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image huaweicloud_workspace_app_image} +*/ +export class WorkspaceAppImage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_image"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppImage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppImage to import + * @param importFromId The id of the existing WorkspaceAppImage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppImage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_image", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_image huaweicloud_workspace_app_image} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppImageConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppImageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_image', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._enterpriseProjectId = config.enterpriseProjectId; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._serverId = config.serverId; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enterprise_project_id - computed: false, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_id - computed: false, optional: false, required: true + private _serverId?: string; + public get serverId() { + return this.getStringAttribute('server_id'); + } + public set serverId(value: string) { + this._serverId = value; + } + // Temporarily expose input value. Use with caution. + public get serverIdInput() { + return this._serverId; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WorkspaceAppImageTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WorkspaceAppImageTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + server_id: cdktf.stringToTerraform(this._serverId), + timeouts: workspaceAppImageTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_id: { + value: cdktf.stringToHclTerraform(this._serverId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + timeouts: { + value: workspaceAppImageTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WorkspaceAppImageTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-nas-storage/README.md b/src/constructs/providers/huaweicloud/workspace-app-nas-storage/README.md new file mode 100644 index 00000000..0744f1ea --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-nas-storage/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_nas_storage` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_nas_storage`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage). diff --git a/src/constructs/providers/huaweicloud/workspace-app-nas-storage/index.ts b/src/constructs/providers/huaweicloud/workspace-app-nas-storage/index.ts new file mode 100644 index 00000000..1533b16f --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-nas-storage/index.ts @@ -0,0 +1,325 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppNasStorageConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#id WorkspaceAppNasStorage#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the NAS storage. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#name WorkspaceAppNasStorage#name} + */ + readonly name: string; + /** + * The region where the NAS storage is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#region WorkspaceAppNasStorage#region} + */ + readonly region?: string; + /** + * storage_metadata block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#storage_metadata WorkspaceAppNasStorage#storage_metadata} + */ + readonly storageMetadata: WorkspaceAppNasStorageStorageMetadata; +} +export interface WorkspaceAppNasStorageStorageMetadata { + /** + * The storage type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#storage_class WorkspaceAppNasStorage#storage_class} + */ + readonly storageClass: string; + /** + * The storage name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#storage_handle WorkspaceAppNasStorage#storage_handle} + */ + readonly storageHandle: string; +} + +export function workspaceAppNasStorageStorageMetadataToTerraform(struct?: WorkspaceAppNasStorageStorageMetadataOutputReference | WorkspaceAppNasStorageStorageMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + storage_class: cdktf.stringToTerraform(struct!.storageClass), + storage_handle: cdktf.stringToTerraform(struct!.storageHandle), + } +} + + +export function workspaceAppNasStorageStorageMetadataToHclTerraform(struct?: WorkspaceAppNasStorageStorageMetadataOutputReference | WorkspaceAppNasStorageStorageMetadata): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + storage_class: { + value: cdktf.stringToHclTerraform(struct!.storageClass), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_handle: { + value: cdktf.stringToHclTerraform(struct!.storageHandle), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppNasStorageStorageMetadataOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppNasStorageStorageMetadata | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._storageClass !== undefined) { + hasAnyValues = true; + internalValueResult.storageClass = this._storageClass; + } + if (this._storageHandle !== undefined) { + hasAnyValues = true; + internalValueResult.storageHandle = this._storageHandle; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppNasStorageStorageMetadata | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._storageClass = undefined; + this._storageHandle = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._storageClass = value.storageClass; + this._storageHandle = value.storageHandle; + } + } + + // export_location - computed: true, optional: false, required: false + public get exportLocation() { + return this.getStringAttribute('export_location'); + } + + // storage_class - computed: false, optional: false, required: true + private _storageClass?: string; + public get storageClass() { + return this.getStringAttribute('storage_class'); + } + public set storageClass(value: string) { + this._storageClass = value; + } + // Temporarily expose input value. Use with caution. + public get storageClassInput() { + return this._storageClass; + } + + // storage_handle - computed: false, optional: false, required: true + private _storageHandle?: string; + public get storageHandle() { + return this.getStringAttribute('storage_handle'); + } + public set storageHandle(value: string) { + this._storageHandle = value; + } + // Temporarily expose input value. Use with caution. + public get storageHandleInput() { + return this._storageHandle; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage huaweicloud_workspace_app_nas_storage} +*/ +export class WorkspaceAppNasStorage extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_nas_storage"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppNasStorage resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppNasStorage to import + * @param importFromId The id of the existing WorkspaceAppNasStorage that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppNasStorage to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_nas_storage", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_nas_storage huaweicloud_workspace_app_nas_storage} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppNasStorageConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppNasStorageConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_nas_storage', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._storageMetadata.internalValue = config.storageMetadata; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_metadata - computed: false, optional: false, required: true + private _storageMetadata = new WorkspaceAppNasStorageStorageMetadataOutputReference(this, "storage_metadata"); + public get storageMetadata() { + return this._storageMetadata; + } + public putStorageMetadata(value: WorkspaceAppNasStorageStorageMetadata) { + this._storageMetadata.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get storageMetadataInput() { + return this._storageMetadata.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + storage_metadata: workspaceAppNasStorageStorageMetadataToTerraform(this._storageMetadata.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_metadata: { + value: workspaceAppNasStorageStorageMetadataToHclTerraform(this._storageMetadata.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppNasStorageStorageMetadataList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-personal-folders/README.md b/src/constructs/providers/huaweicloud/workspace-app-personal-folders/README.md new file mode 100644 index 00000000..a99f883a --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-personal-folders/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_personal_folders` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_personal_folders`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders). diff --git a/src/constructs/providers/huaweicloud/workspace-app-personal-folders/index.ts b/src/constructs/providers/huaweicloud/workspace-app-personal-folders/index.ts new file mode 100644 index 00000000..a12dcccd --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-personal-folders/index.ts @@ -0,0 +1,382 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppPersonalFoldersConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#id WorkspaceAppPersonalFolders#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the personal folders are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#region WorkspaceAppPersonalFolders#region} + */ + readonly region?: string; + /** + * The NAS storage ID to which the personal folders belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#storage_id WorkspaceAppPersonalFolders#storage_id} + */ + readonly storageId: string; + /** + * assignments block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#assignments WorkspaceAppPersonalFolders#assignments} + */ + readonly assignments: WorkspaceAppPersonalFoldersAssignments[] | cdktf.IResolvable; +} +export interface WorkspaceAppPersonalFoldersAssignments { + /** + * The object name of personal folder assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#attach WorkspaceAppPersonalFolders#attach} + */ + readonly attach: string; + /** + * The type of personal folder assignment. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#attach_type WorkspaceAppPersonalFolders#attach_type} + */ + readonly attachType?: string; + /** + * The ID of the storage permission policy. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#policy_statement_id WorkspaceAppPersonalFolders#policy_statement_id} + */ + readonly policyStatementId: string; +} + +export function workspaceAppPersonalFoldersAssignmentsToTerraform(struct?: WorkspaceAppPersonalFoldersAssignments | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + attach: cdktf.stringToTerraform(struct!.attach), + attach_type: cdktf.stringToTerraform(struct!.attachType), + policy_statement_id: cdktf.stringToTerraform(struct!.policyStatementId), + } +} + + +export function workspaceAppPersonalFoldersAssignmentsToHclTerraform(struct?: WorkspaceAppPersonalFoldersAssignments | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + attach: { + value: cdktf.stringToHclTerraform(struct!.attach), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + attach_type: { + value: cdktf.stringToHclTerraform(struct!.attachType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy_statement_id: { + value: cdktf.stringToHclTerraform(struct!.policyStatementId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppPersonalFoldersAssignmentsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceAppPersonalFoldersAssignments | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._attach !== undefined) { + hasAnyValues = true; + internalValueResult.attach = this._attach; + } + if (this._attachType !== undefined) { + hasAnyValues = true; + internalValueResult.attachType = this._attachType; + } + if (this._policyStatementId !== undefined) { + hasAnyValues = true; + internalValueResult.policyStatementId = this._policyStatementId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppPersonalFoldersAssignments | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._attach = undefined; + this._attachType = undefined; + this._policyStatementId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._attach = value.attach; + this._attachType = value.attachType; + this._policyStatementId = value.policyStatementId; + } + } + + // attach - computed: false, optional: false, required: true + private _attach?: string; + public get attach() { + return this.getStringAttribute('attach'); + } + public set attach(value: string) { + this._attach = value; + } + // Temporarily expose input value. Use with caution. + public get attachInput() { + return this._attach; + } + + // attach_type - computed: true, optional: true, required: false + private _attachType?: string; + public get attachType() { + return this.getStringAttribute('attach_type'); + } + public set attachType(value: string) { + this._attachType = value; + } + public resetAttachType() { + this._attachType = undefined; + } + // Temporarily expose input value. Use with caution. + public get attachTypeInput() { + return this._attachType; + } + + // policy_statement_id - computed: false, optional: false, required: true + private _policyStatementId?: string; + public get policyStatementId() { + return this.getStringAttribute('policy_statement_id'); + } + public set policyStatementId(value: string) { + this._policyStatementId = value; + } + // Temporarily expose input value. Use with caution. + public get policyStatementIdInput() { + return this._policyStatementId; + } +} + +export class WorkspaceAppPersonalFoldersAssignmentsList extends cdktf.ComplexList { + public internalValue? : WorkspaceAppPersonalFoldersAssignments[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceAppPersonalFoldersAssignmentsOutputReference { + return new WorkspaceAppPersonalFoldersAssignmentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders huaweicloud_workspace_app_personal_folders} +*/ +export class WorkspaceAppPersonalFolders extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_personal_folders"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppPersonalFolders resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppPersonalFolders to import + * @param importFromId The id of the existing WorkspaceAppPersonalFolders that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppPersonalFolders to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_personal_folders", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_personal_folders huaweicloud_workspace_app_personal_folders} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppPersonalFoldersConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppPersonalFoldersConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_personal_folders', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._region = config.region; + this._storageId = config.storageId; + this._assignments.internalValue = config.assignments; + } + + // ========== + // ATTRIBUTES + // ========== + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_id - computed: false, optional: false, required: true + private _storageId?: string; + public get storageId() { + return this.getStringAttribute('storage_id'); + } + public set storageId(value: string) { + this._storageId = value; + } + // Temporarily expose input value. Use with caution. + public get storageIdInput() { + return this._storageId; + } + + // assignments - computed: false, optional: false, required: true + private _assignments = new WorkspaceAppPersonalFoldersAssignmentsList(this, "assignments", true); + public get assignments() { + return this._assignments; + } + public putAssignments(value: WorkspaceAppPersonalFoldersAssignments[] | cdktf.IResolvable) { + this._assignments.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get assignmentsInput() { + return this._assignments.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + storage_id: cdktf.stringToTerraform(this._storageId), + assignments: cdktf.listMapper(workspaceAppPersonalFoldersAssignmentsToTerraform, true)(this._assignments.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_id: { + value: cdktf.stringToHclTerraform(this._storageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + assignments: { + value: cdktf.listMapperHcl(workspaceAppPersonalFoldersAssignmentsToHclTerraform, true)(this._assignments.internalValue), + isBlock: true, + type: "set", + storageClassType: "WorkspaceAppPersonalFoldersAssignmentsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-policy-group/README.md b/src/constructs/providers/huaweicloud/workspace-app-policy-group/README.md new file mode 100644 index 00000000..02c7c08b --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-policy-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_policy_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_policy_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group). diff --git a/src/constructs/providers/huaweicloud/workspace-app-policy-group/index.ts b/src/constructs/providers/huaweicloud/workspace-app-policy-group/index.ts new file mode 100644 index 00000000..98d3bc8e --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-policy-group/index.ts @@ -0,0 +1,473 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppPolicyGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the policy group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#description WorkspaceAppPolicyGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#id WorkspaceAppPolicyGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the policy group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#name WorkspaceAppPolicyGroup#name} + */ + readonly name: string; + /** + * The policies of the policy group, in JSON format. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#policies WorkspaceAppPolicyGroup#policies} + */ + readonly policies?: string; + /** + * The priority of the policy group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#priority WorkspaceAppPolicyGroup#priority} + */ + readonly priority?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#region WorkspaceAppPolicyGroup#region} + */ + readonly region?: string; + /** + * targets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#targets WorkspaceAppPolicyGroup#targets} + */ + readonly targets?: WorkspaceAppPolicyGroupTargets[] | cdktf.IResolvable; +} +export interface WorkspaceAppPolicyGroupTargets { + /** + * The object ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#id WorkspaceAppPolicyGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * The object name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#name WorkspaceAppPolicyGroup#name} + */ + readonly name: string; + /** + * The object type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#type WorkspaceAppPolicyGroup#type} + */ + readonly type: string; +} + +export function workspaceAppPolicyGroupTargetsToTerraform(struct?: WorkspaceAppPolicyGroupTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceAppPolicyGroupTargetsToHclTerraform(struct?: WorkspaceAppPolicyGroupTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppPolicyGroupTargetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceAppPolicyGroupTargets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppPolicyGroupTargets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._name = value.name; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class WorkspaceAppPolicyGroupTargetsList extends cdktf.ComplexList { + public internalValue? : WorkspaceAppPolicyGroupTargets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceAppPolicyGroupTargetsOutputReference { + return new WorkspaceAppPolicyGroupTargetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group huaweicloud_workspace_app_policy_group} +*/ +export class WorkspaceAppPolicyGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_policy_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppPolicyGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppPolicyGroup to import + * @param importFromId The id of the existing WorkspaceAppPolicyGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppPolicyGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_policy_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_policy_group huaweicloud_workspace_app_policy_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppPolicyGroupConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppPolicyGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_policy_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._policies = config.policies; + this._priority = config.priority; + this._region = config.region; + this._targets.internalValue = config.targets; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // policies - computed: false, optional: true, required: false + private _policies?: string; + public get policies() { + return this.getStringAttribute('policies'); + } + public set policies(value: string) { + this._policies = value; + } + public resetPolicies() { + this._policies = undefined; + } + // Temporarily expose input value. Use with caution. + public get policiesInput() { + return this._policies; + } + + // priority - computed: false, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // targets - computed: false, optional: true, required: false + private _targets = new WorkspaceAppPolicyGroupTargetsList(this, "targets", true); + public get targets() { + return this._targets; + } + public putTargets(value: WorkspaceAppPolicyGroupTargets[] | cdktf.IResolvable) { + this._targets.internalValue = value; + } + public resetTargets() { + this._targets.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetsInput() { + return this._targets.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + policies: cdktf.stringToTerraform(this._policies), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + targets: cdktf.listMapper(workspaceAppPolicyGroupTargetsToTerraform, true)(this._targets.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policies: { + value: cdktf.stringToHclTerraform(this._policies), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + targets: { + value: cdktf.listMapperHcl(workspaceAppPolicyGroupTargetsToHclTerraform, true)(this._targets.internalValue), + isBlock: true, + type: "set", + storageClassType: "WorkspaceAppPolicyGroupTargetsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-publishment/README.md b/src/constructs/providers/huaweicloud/workspace-app-publishment/README.md new file mode 100644 index 00000000..ffcbd28e --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-publishment/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_publishment` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_publishment`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment). diff --git a/src/constructs/providers/huaweicloud/workspace-app-publishment/index.ts b/src/constructs/providers/huaweicloud/workspace-app-publishment/index.ts new file mode 100644 index 00000000..31c04a98 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-publishment/index.ts @@ -0,0 +1,557 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppPublishmentConfig extends cdktf.TerraformMetaArguments { + /** + * The APP group ID to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#app_group_id WorkspaceAppPublishment#app_group_id} + */ + readonly appGroupId: string; + /** + * The command line parameter used to start the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#command_param WorkspaceAppPublishment#command_param} + */ + readonly commandParam?: string; + /** + * The description of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#description WorkspaceAppPublishment#description} + */ + readonly description?: string; + /** + * The location where the application file is installed. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#execute_path WorkspaceAppPublishment#execute_path} + */ + readonly executePath: string; + /** + * The icon index of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#icon_index WorkspaceAppPublishment#icon_index} + */ + readonly iconIndex?: number; + /** + * The path where the application icon is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#icon_path WorkspaceAppPublishment#icon_path} + */ + readonly iconPath?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#id WorkspaceAppPublishment#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#name WorkspaceAppPublishment#name} + */ + readonly name: string; + /** + * The publisher of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#publisher WorkspaceAppPublishment#publisher} + */ + readonly publisher?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#region WorkspaceAppPublishment#region} + */ + readonly region?: string; + /** + * Whether to run in sandbox mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#sandbox_enable WorkspaceAppPublishment#sandbox_enable} + */ + readonly sandboxEnable?: boolean | cdktf.IResolvable; + /** + * The list of image IDs corresponding to the server instance to which the application belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#source_image_ids WorkspaceAppPublishment#source_image_ids} + */ + readonly sourceImageIds?: string[]; + /** + * The current status of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#status WorkspaceAppPublishment#status} + */ + readonly status?: string; + /** + * The type of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#type WorkspaceAppPublishment#type} + */ + readonly type: number; + /** + * The version of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#version WorkspaceAppPublishment#version} + */ + readonly version?: string; + /** + * The publisher of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#work_path WorkspaceAppPublishment#work_path} + */ + readonly workPath?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment huaweicloud_workspace_app_publishment} +*/ +export class WorkspaceAppPublishment extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_publishment"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppPublishment resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppPublishment to import + * @param importFromId The id of the existing WorkspaceAppPublishment that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppPublishment to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_publishment", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_publishment huaweicloud_workspace_app_publishment} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppPublishmentConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppPublishmentConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_publishment', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appGroupId = config.appGroupId; + this._commandParam = config.commandParam; + this._description = config.description; + this._executePath = config.executePath; + this._iconIndex = config.iconIndex; + this._iconPath = config.iconPath; + this._id = config.id; + this._name = config.name; + this._publisher = config.publisher; + this._region = config.region; + this._sandboxEnable = config.sandboxEnable; + this._sourceImageIds = config.sourceImageIds; + this._status = config.status; + this._type = config.type; + this._version = config.version; + this._workPath = config.workPath; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_group_id - computed: false, optional: false, required: true + private _appGroupId?: string; + public get appGroupId() { + return this.getStringAttribute('app_group_id'); + } + public set appGroupId(value: string) { + this._appGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get appGroupIdInput() { + return this._appGroupId; + } + + // command_param - computed: false, optional: true, required: false + private _commandParam?: string; + public get commandParam() { + return this.getStringAttribute('command_param'); + } + public set commandParam(value: string) { + this._commandParam = value; + } + public resetCommandParam() { + this._commandParam = undefined; + } + // Temporarily expose input value. Use with caution. + public get commandParamInput() { + return this._commandParam; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // execute_path - computed: false, optional: false, required: true + private _executePath?: string; + public get executePath() { + return this.getStringAttribute('execute_path'); + } + public set executePath(value: string) { + this._executePath = value; + } + // Temporarily expose input value. Use with caution. + public get executePathInput() { + return this._executePath; + } + + // icon_index - computed: false, optional: true, required: false + private _iconIndex?: number; + public get iconIndex() { + return this.getNumberAttribute('icon_index'); + } + public set iconIndex(value: number) { + this._iconIndex = value; + } + public resetIconIndex() { + this._iconIndex = undefined; + } + // Temporarily expose input value. Use with caution. + public get iconIndexInput() { + return this._iconIndex; + } + + // icon_path - computed: false, optional: true, required: false + private _iconPath?: string; + public get iconPath() { + return this.getStringAttribute('icon_path'); + } + public set iconPath(value: string) { + this._iconPath = value; + } + public resetIconPath() { + this._iconPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get iconPathInput() { + return this._iconPath; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // published_at - computed: true, optional: false, required: false + public get publishedAt() { + return this.getStringAttribute('published_at'); + } + + // publisher - computed: false, optional: true, required: false + private _publisher?: string; + public get publisher() { + return this.getStringAttribute('publisher'); + } + public set publisher(value: string) { + this._publisher = value; + } + public resetPublisher() { + this._publisher = undefined; + } + // Temporarily expose input value. Use with caution. + public get publisherInput() { + return this._publisher; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // sandbox_enable - computed: false, optional: true, required: false + private _sandboxEnable?: boolean | cdktf.IResolvable; + public get sandboxEnable() { + return this.getBooleanAttribute('sandbox_enable'); + } + public set sandboxEnable(value: boolean | cdktf.IResolvable) { + this._sandboxEnable = value; + } + public resetSandboxEnable() { + this._sandboxEnable = undefined; + } + // Temporarily expose input value. Use with caution. + public get sandboxEnableInput() { + return this._sandboxEnable; + } + + // source_image_ids - computed: false, optional: true, required: false + private _sourceImageIds?: string[]; + public get sourceImageIds() { + return this.getListAttribute('source_image_ids'); + } + public set sourceImageIds(value: string[]) { + this._sourceImageIds = value; + } + public resetSourceImageIds() { + this._sourceImageIds = undefined; + } + // Temporarily expose input value. Use with caution. + public get sourceImageIdsInput() { + return this._sourceImageIds; + } + + // status - computed: true, optional: true, required: false + private _status?: string; + public get status() { + return this.getStringAttribute('status'); + } + public set status(value: string) { + this._status = value; + } + public resetStatus() { + this._status = undefined; + } + // Temporarily expose input value. Use with caution. + public get statusInput() { + return this._status; + } + + // type - computed: false, optional: false, required: true + private _type?: number; + public get type() { + return this.getNumberAttribute('type'); + } + public set type(value: number) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // version - computed: false, optional: true, required: false + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + public resetVersion() { + this._version = undefined; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // work_path - computed: false, optional: true, required: false + private _workPath?: string; + public get workPath() { + return this.getStringAttribute('work_path'); + } + public set workPath(value: string) { + this._workPath = value; + } + public resetWorkPath() { + this._workPath = undefined; + } + // Temporarily expose input value. Use with caution. + public get workPathInput() { + return this._workPath; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_group_id: cdktf.stringToTerraform(this._appGroupId), + command_param: cdktf.stringToTerraform(this._commandParam), + description: cdktf.stringToTerraform(this._description), + execute_path: cdktf.stringToTerraform(this._executePath), + icon_index: cdktf.numberToTerraform(this._iconIndex), + icon_path: cdktf.stringToTerraform(this._iconPath), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + publisher: cdktf.stringToTerraform(this._publisher), + region: cdktf.stringToTerraform(this._region), + sandbox_enable: cdktf.booleanToTerraform(this._sandboxEnable), + source_image_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sourceImageIds), + status: cdktf.stringToTerraform(this._status), + type: cdktf.numberToTerraform(this._type), + version: cdktf.stringToTerraform(this._version), + work_path: cdktf.stringToTerraform(this._workPath), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_group_id: { + value: cdktf.stringToHclTerraform(this._appGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + command_param: { + value: cdktf.stringToHclTerraform(this._commandParam), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + execute_path: { + value: cdktf.stringToHclTerraform(this._executePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + icon_index: { + value: cdktf.numberToHclTerraform(this._iconIndex), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + icon_path: { + value: cdktf.stringToHclTerraform(this._iconPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + publisher: { + value: cdktf.stringToHclTerraform(this._publisher), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + sandbox_enable: { + value: cdktf.booleanToHclTerraform(this._sandboxEnable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + source_image_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sourceImageIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + status: { + value: cdktf.stringToHclTerraform(this._status), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.numberToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + work_path: { + value: cdktf.stringToHclTerraform(this._workPath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-server-group/README.md b/src/constructs/providers/huaweicloud/workspace-app-server-group/README.md new file mode 100644 index 00000000..89b0c921 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-server-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_server_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_server_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group). diff --git a/src/constructs/providers/huaweicloud/workspace-app-server-group/index.ts b/src/constructs/providers/huaweicloud/workspace-app-server-group/index.ts new file mode 100644 index 00000000..05ef079b --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-server-group/index.ts @@ -0,0 +1,1076 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppServerGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The type of application group associated with the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#app_type WorkspaceAppServerGroup#app_type} + */ + readonly appType?: string; + /** + * The availability zone of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#availability_zone WorkspaceAppServerGroup#availability_zone} + */ + readonly availabilityZone?: string; + /** + * The description of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#description WorkspaceAppServerGroup#description} + */ + readonly description?: string; + /** + * Whether to enable server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#enabled WorkspaceAppServerGroup#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * The ID of the enterprise project to which the server group belong. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#enterprise_project_id WorkspaceAppServerGroup#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * The number of additional sessions for a single server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#extra_session_size WorkspaceAppServerGroup#extra_session_size} + */ + readonly extraSessionSize?: number; + /** + * The additional session type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#extra_session_type WorkspaceAppServerGroup#extra_session_type} + */ + readonly extraSessionType?: string; + /** + * The flavor ID of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#flavor_id WorkspaceAppServerGroup#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#id WorkspaceAppServerGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The image ID of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#image_id WorkspaceAppServerGroup#image_id} + */ + readonly imageId: string; + /** + * The image product ID of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#image_product_id WorkspaceAppServerGroup#image_product_id} + */ + readonly imageProductId?: string; + /** + * The image type of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#image_type WorkspaceAppServerGroup#image_type} + */ + readonly imageType: string; + /** + * The session mode of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#is_vdi WorkspaceAppServerGroup#is_vdi} + */ + readonly isVdi?: boolean | cdktf.IResolvable; + /** + * The name of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#name WorkspaceAppServerGroup#name} + */ + readonly name: string; + /** + * The operating system type of the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#os_type WorkspaceAppServerGroup#os_type} + */ + readonly osType: string; + /** + * The OU name corresponding to the AD server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#ou_name WorkspaceAppServerGroup#ou_name} + */ + readonly ouName?: string; + /** + * The ID of the primary server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#primary_server_group_id WorkspaceAppServerGroup#primary_server_group_id} + */ + readonly primaryServerGroupId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#region WorkspaceAppServerGroup#region} + */ + readonly region?: string; + /** + * The NAS storage directory mounting policy on the APS. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#storage_mount_policy WorkspaceAppServerGroup#storage_mount_policy} + */ + readonly storageMountPolicy?: string; + /** + * The subnet ID to which the server group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#subnet_id WorkspaceAppServerGroup#subnet_id} + */ + readonly subnetId: string; + /** + * The size of system disk, in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#system_disk_size WorkspaceAppServerGroup#system_disk_size} + */ + readonly systemDiskSize: number; + /** + * The type of system disk. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#system_disk_type WorkspaceAppServerGroup#system_disk_type} + */ + readonly systemDiskType: string; + /** + * The key/value pairs to associate with the server group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#tags WorkspaceAppServerGroup#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * The VPC ID to which the server group belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#vpc_id WorkspaceAppServerGroup#vpc_id} + */ + readonly vpcId: string; + /** + * ip_virtual block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#ip_virtual WorkspaceAppServerGroup#ip_virtual} + */ + readonly ipVirtual?: WorkspaceAppServerGroupIpVirtual; + /** + * route_policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#route_policy WorkspaceAppServerGroup#route_policy} + */ + readonly routePolicy?: WorkspaceAppServerGroupRoutePolicy; +} +export interface WorkspaceAppServerGroupIpVirtual { + /** + * Whether to enable IP virtualization. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#enable WorkspaceAppServerGroup#enable} + */ + readonly enable: boolean | cdktf.IResolvable; +} + +export function workspaceAppServerGroupIpVirtualToTerraform(struct?: WorkspaceAppServerGroupIpVirtualOutputReference | WorkspaceAppServerGroupIpVirtual): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + enable: cdktf.booleanToTerraform(struct!.enable), + } +} + + +export function workspaceAppServerGroupIpVirtualToHclTerraform(struct?: WorkspaceAppServerGroupIpVirtualOutputReference | WorkspaceAppServerGroupIpVirtual): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppServerGroupIpVirtualOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppServerGroupIpVirtual | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppServerGroupIpVirtual | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._enable = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._enable = value.enable; + } + } + + // enable - computed: false, optional: false, required: true + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } +} +export interface WorkspaceAppServerGroupRoutePolicy { + /** + * The CPU usage of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#cpu_threshold WorkspaceAppServerGroup#cpu_threshold} + */ + readonly cpuThreshold?: number; + /** + * The number of session connections of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#max_session WorkspaceAppServerGroup#max_session} + */ + readonly maxSession?: number; + /** + * The memory usage of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#mem_threshold WorkspaceAppServerGroup#mem_threshold} + */ + readonly memThreshold?: number; +} + +export function workspaceAppServerGroupRoutePolicyToTerraform(struct?: WorkspaceAppServerGroupRoutePolicyOutputReference | WorkspaceAppServerGroupRoutePolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + cpu_threshold: cdktf.numberToTerraform(struct!.cpuThreshold), + max_session: cdktf.numberToTerraform(struct!.maxSession), + mem_threshold: cdktf.numberToTerraform(struct!.memThreshold), + } +} + + +export function workspaceAppServerGroupRoutePolicyToHclTerraform(struct?: WorkspaceAppServerGroupRoutePolicyOutputReference | WorkspaceAppServerGroupRoutePolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + cpu_threshold: { + value: cdktf.numberToHclTerraform(struct!.cpuThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + max_session: { + value: cdktf.numberToHclTerraform(struct!.maxSession), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + mem_threshold: { + value: cdktf.numberToHclTerraform(struct!.memThreshold), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppServerGroupRoutePolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppServerGroupRoutePolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._cpuThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.cpuThreshold = this._cpuThreshold; + } + if (this._maxSession !== undefined) { + hasAnyValues = true; + internalValueResult.maxSession = this._maxSession; + } + if (this._memThreshold !== undefined) { + hasAnyValues = true; + internalValueResult.memThreshold = this._memThreshold; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppServerGroupRoutePolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._cpuThreshold = undefined; + this._maxSession = undefined; + this._memThreshold = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._cpuThreshold = value.cpuThreshold; + this._maxSession = value.maxSession; + this._memThreshold = value.memThreshold; + } + } + + // cpu_threshold - computed: false, optional: true, required: false + private _cpuThreshold?: number; + public get cpuThreshold() { + return this.getNumberAttribute('cpu_threshold'); + } + public set cpuThreshold(value: number) { + this._cpuThreshold = value; + } + public resetCpuThreshold() { + this._cpuThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get cpuThresholdInput() { + return this._cpuThreshold; + } + + // max_session - computed: false, optional: true, required: false + private _maxSession?: number; + public get maxSession() { + return this.getNumberAttribute('max_session'); + } + public set maxSession(value: number) { + this._maxSession = value; + } + public resetMaxSession() { + this._maxSession = undefined; + } + // Temporarily expose input value. Use with caution. + public get maxSessionInput() { + return this._maxSession; + } + + // mem_threshold - computed: false, optional: true, required: false + private _memThreshold?: number; + public get memThreshold() { + return this.getNumberAttribute('mem_threshold'); + } + public set memThreshold(value: number) { + this._memThreshold = value; + } + public resetMemThreshold() { + this._memThreshold = undefined; + } + // Temporarily expose input value. Use with caution. + public get memThresholdInput() { + return this._memThreshold; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group huaweicloud_workspace_app_server_group} +*/ +export class WorkspaceAppServerGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_server_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppServerGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppServerGroup to import + * @param importFromId The id of the existing WorkspaceAppServerGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppServerGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_server_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server_group huaweicloud_workspace_app_server_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppServerGroupConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppServerGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_server_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._appType = config.appType; + this._availabilityZone = config.availabilityZone; + this._description = config.description; + this._enabled = config.enabled; + this._enterpriseProjectId = config.enterpriseProjectId; + this._extraSessionSize = config.extraSessionSize; + this._extraSessionType = config.extraSessionType; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._imageProductId = config.imageProductId; + this._imageType = config.imageType; + this._isVdi = config.isVdi; + this._name = config.name; + this._osType = config.osType; + this._ouName = config.ouName; + this._primaryServerGroupId = config.primaryServerGroupId; + this._region = config.region; + this._storageMountPolicy = config.storageMountPolicy; + this._subnetId = config.subnetId; + this._systemDiskSize = config.systemDiskSize; + this._systemDiskType = config.systemDiskType; + this._tags = config.tags; + this._vpcId = config.vpcId; + this._ipVirtual.internalValue = config.ipVirtual; + this._routePolicy.internalValue = config.routePolicy; + } + + // ========== + // ATTRIBUTES + // ========== + + // app_type - computed: true, optional: true, required: false + private _appType?: string; + public get appType() { + return this.getStringAttribute('app_type'); + } + public set appType(value: string) { + this._appType = value; + } + public resetAppType() { + this._appType = undefined; + } + // Temporarily expose input value. Use with caution. + public get appTypeInput() { + return this._appType; + } + + // availability_zone - computed: false, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // enabled - computed: false, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // extra_session_size - computed: false, optional: true, required: false + private _extraSessionSize?: number; + public get extraSessionSize() { + return this.getNumberAttribute('extra_session_size'); + } + public set extraSessionSize(value: number) { + this._extraSessionSize = value; + } + public resetExtraSessionSize() { + this._extraSessionSize = undefined; + } + // Temporarily expose input value. Use with caution. + public get extraSessionSizeInput() { + return this._extraSessionSize; + } + + // extra_session_type - computed: false, optional: true, required: false + private _extraSessionType?: string; + public get extraSessionType() { + return this.getStringAttribute('extra_session_type'); + } + public set extraSessionType(value: string) { + this._extraSessionType = value; + } + public resetExtraSessionType() { + this._extraSessionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get extraSessionTypeInput() { + return this._extraSessionType; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_product_id - computed: true, optional: true, required: false + private _imageProductId?: string; + public get imageProductId() { + return this.getStringAttribute('image_product_id'); + } + public set imageProductId(value: string) { + this._imageProductId = value; + } + public resetImageProductId() { + this._imageProductId = undefined; + } + // Temporarily expose input value. Use with caution. + public get imageProductIdInput() { + return this._imageProductId; + } + + // image_type - computed: false, optional: false, required: true + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // is_vdi - computed: false, optional: true, required: false + private _isVdi?: boolean | cdktf.IResolvable; + public get isVdi() { + return this.getBooleanAttribute('is_vdi'); + } + public set isVdi(value: boolean | cdktf.IResolvable) { + this._isVdi = value; + } + public resetIsVdi() { + this._isVdi = undefined; + } + // Temporarily expose input value. Use with caution. + public get isVdiInput() { + return this._isVdi; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: false, required: true + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // ou_name - computed: false, optional: true, required: false + private _ouName?: string; + public get ouName() { + return this.getStringAttribute('ou_name'); + } + public set ouName(value: string) { + this._ouName = value; + } + public resetOuName() { + this._ouName = undefined; + } + // Temporarily expose input value. Use with caution. + public get ouNameInput() { + return this._ouName; + } + + // primary_server_group_id - computed: false, optional: true, required: false + private _primaryServerGroupId?: string; + public get primaryServerGroupId() { + return this.getStringAttribute('primary_server_group_id'); + } + public set primaryServerGroupId(value: string) { + this._primaryServerGroupId = value; + } + public resetPrimaryServerGroupId() { + this._primaryServerGroupId = undefined; + } + // Temporarily expose input value. Use with caution. + public get primaryServerGroupIdInput() { + return this._primaryServerGroupId; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_mount_policy - computed: true, optional: true, required: false + private _storageMountPolicy?: string; + public get storageMountPolicy() { + return this.getStringAttribute('storage_mount_policy'); + } + public set storageMountPolicy(value: string) { + this._storageMountPolicy = value; + } + public resetStorageMountPolicy() { + this._storageMountPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get storageMountPolicyInput() { + return this._storageMountPolicy; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // system_disk_size - computed: false, optional: false, required: true + private _systemDiskSize?: number; + public get systemDiskSize() { + return this.getNumberAttribute('system_disk_size'); + } + public set systemDiskSize(value: number) { + this._systemDiskSize = value; + } + // Temporarily expose input value. Use with caution. + public get systemDiskSizeInput() { + return this._systemDiskSize; + } + + // system_disk_type - computed: false, optional: false, required: true + private _systemDiskType?: string; + public get systemDiskType() { + return this.getStringAttribute('system_disk_type'); + } + public set systemDiskType(value: string) { + this._systemDiskType = value; + } + // Temporarily expose input value. Use with caution. + public get systemDiskTypeInput() { + return this._systemDiskType; + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ip_virtual - computed: false, optional: true, required: false + private _ipVirtual = new WorkspaceAppServerGroupIpVirtualOutputReference(this, "ip_virtual"); + public get ipVirtual() { + return this._ipVirtual; + } + public putIpVirtual(value: WorkspaceAppServerGroupIpVirtual) { + this._ipVirtual.internalValue = value; + } + public resetIpVirtual() { + this._ipVirtual.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get ipVirtualInput() { + return this._ipVirtual.internalValue; + } + + // route_policy - computed: false, optional: true, required: false + private _routePolicy = new WorkspaceAppServerGroupRoutePolicyOutputReference(this, "route_policy"); + public get routePolicy() { + return this._routePolicy; + } + public putRoutePolicy(value: WorkspaceAppServerGroupRoutePolicy) { + this._routePolicy.internalValue = value; + } + public resetRoutePolicy() { + this._routePolicy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get routePolicyInput() { + return this._routePolicy.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + app_type: cdktf.stringToTerraform(this._appType), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + description: cdktf.stringToTerraform(this._description), + enabled: cdktf.booleanToTerraform(this._enabled), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + extra_session_size: cdktf.numberToTerraform(this._extraSessionSize), + extra_session_type: cdktf.stringToTerraform(this._extraSessionType), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_product_id: cdktf.stringToTerraform(this._imageProductId), + image_type: cdktf.stringToTerraform(this._imageType), + is_vdi: cdktf.booleanToTerraform(this._isVdi), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + ou_name: cdktf.stringToTerraform(this._ouName), + primary_server_group_id: cdktf.stringToTerraform(this._primaryServerGroupId), + region: cdktf.stringToTerraform(this._region), + storage_mount_policy: cdktf.stringToTerraform(this._storageMountPolicy), + subnet_id: cdktf.stringToTerraform(this._subnetId), + system_disk_size: cdktf.numberToTerraform(this._systemDiskSize), + system_disk_type: cdktf.stringToTerraform(this._systemDiskType), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + vpc_id: cdktf.stringToTerraform(this._vpcId), + ip_virtual: workspaceAppServerGroupIpVirtualToTerraform(this._ipVirtual.internalValue), + route_policy: workspaceAppServerGroupRoutePolicyToTerraform(this._routePolicy.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + app_type: { + value: cdktf.stringToHclTerraform(this._appType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + extra_session_size: { + value: cdktf.numberToHclTerraform(this._extraSessionSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + extra_session_type: { + value: cdktf.stringToHclTerraform(this._extraSessionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_product_id: { + value: cdktf.stringToHclTerraform(this._imageProductId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_vdi: { + value: cdktf.booleanToHclTerraform(this._isVdi), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ou_name: { + value: cdktf.stringToHclTerraform(this._ouName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + primary_server_group_id: { + value: cdktf.stringToHclTerraform(this._primaryServerGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_mount_policy: { + value: cdktf.stringToHclTerraform(this._storageMountPolicy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + system_disk_size: { + value: cdktf.numberToHclTerraform(this._systemDiskSize), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + system_disk_type: { + value: cdktf.stringToHclTerraform(this._systemDiskType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ip_virtual: { + value: workspaceAppServerGroupIpVirtualToHclTerraform(this._ipVirtual.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppServerGroupIpVirtualList", + }, + route_policy: { + value: workspaceAppServerGroupRoutePolicyToHclTerraform(this._routePolicy.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppServerGroupRoutePolicyList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-server/README.md b/src/constructs/providers/huaweicloud/workspace-app-server/README.md new file mode 100644 index 00000000..9f0d70fc --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-server/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_server` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_server`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server). diff --git a/src/constructs/providers/huaweicloud/workspace-app-server/index.ts b/src/constructs/providers/huaweicloud/workspace-app-server/index.ts new file mode 100644 index 00000000..1e0b4688 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-server/index.ts @@ -0,0 +1,1051 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppServerConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#auto_renew WorkspaceAppServer#auto_renew} + */ + readonly autoRenew?: string; + /** + * The availability zone of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#availability_zone WorkspaceAppServer#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#charging_mode WorkspaceAppServer#charging_mode} + */ + readonly chargingMode?: string; + /** + * The description of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#description WorkspaceAppServer#description} + */ + readonly description?: string; + /** + * The flavor ID of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#flavor_id WorkspaceAppServer#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#id WorkspaceAppServer#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Whether to enable maintenance mode. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#maintain_status WorkspaceAppServer#maintain_status} + */ + readonly maintainStatus?: boolean | cdktf.IResolvable; + /** + * The name of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#name WorkspaceAppServer#name} + */ + readonly name?: string; + /** + * The operating system type of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#os_type WorkspaceAppServer#os_type} + */ + readonly osType?: string; + /** + * The OU name corresponding to the AD server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#ou_name WorkspaceAppServer#ou_name} + */ + readonly ouName?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#period WorkspaceAppServer#period} + */ + readonly period?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#period_unit WorkspaceAppServer#period_unit} + */ + readonly periodUnit?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#region WorkspaceAppServer#region} + */ + readonly region?: string; + /** + * The server group ID to which the server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#server_group_id WorkspaceAppServer#server_group_id} + */ + readonly serverGroupId: string; + /** + * The subnet ID to which the server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#subnet_id WorkspaceAppServer#subnet_id} + */ + readonly subnetId: string; + /** + * The type of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#type WorkspaceAppServer#type} + */ + readonly type: string; + /** + * Whether to automatically upgrade protocol component. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#update_access_agent WorkspaceAppServer#update_access_agent} + */ + readonly updateAccessAgent?: boolean | cdktf.IResolvable; + /** + * The VPC ID to which the server belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#vpc_id WorkspaceAppServer#vpc_id} + */ + readonly vpcId: string; + /** + * root_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#root_volume WorkspaceAppServer#root_volume} + */ + readonly rootVolume: WorkspaceAppServerRootVolume; + /** + * scheduler_hints block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#scheduler_hints WorkspaceAppServer#scheduler_hints} + */ + readonly schedulerHints?: WorkspaceAppServerSchedulerHints; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#timeouts WorkspaceAppServer#timeouts} + */ + readonly timeouts?: WorkspaceAppServerTimeouts; +} +export interface WorkspaceAppServerRootVolume { + /** + * The disk size of the server, in GB. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#size WorkspaceAppServer#size} + */ + readonly size: number; + /** + * The disk type of the server. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#type WorkspaceAppServer#type} + */ + readonly type: string; +} + +export function workspaceAppServerRootVolumeToTerraform(struct?: WorkspaceAppServerRootVolumeOutputReference | WorkspaceAppServerRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceAppServerRootVolumeToHclTerraform(struct?: WorkspaceAppServerRootVolumeOutputReference | WorkspaceAppServerRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppServerRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppServerRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppServerRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._type = value.type; + } + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface WorkspaceAppServerSchedulerHints { + /** + * The ID of the dedicate host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#dedicated_host_id WorkspaceAppServer#dedicated_host_id} + */ + readonly dedicatedHostId?: string; + /** + * The type of the dedicate host. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#tenancy WorkspaceAppServer#tenancy} + */ + readonly tenancy?: string; +} + +export function workspaceAppServerSchedulerHintsToTerraform(struct?: WorkspaceAppServerSchedulerHintsOutputReference | WorkspaceAppServerSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + dedicated_host_id: cdktf.stringToTerraform(struct!.dedicatedHostId), + tenancy: cdktf.stringToTerraform(struct!.tenancy), + } +} + + +export function workspaceAppServerSchedulerHintsToHclTerraform(struct?: WorkspaceAppServerSchedulerHintsOutputReference | WorkspaceAppServerSchedulerHints): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + dedicated_host_id: { + value: cdktf.stringToHclTerraform(struct!.dedicatedHostId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + tenancy: { + value: cdktf.stringToHclTerraform(struct!.tenancy), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppServerSchedulerHintsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceAppServerSchedulerHints | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._dedicatedHostId !== undefined) { + hasAnyValues = true; + internalValueResult.dedicatedHostId = this._dedicatedHostId; + } + if (this._tenancy !== undefined) { + hasAnyValues = true; + internalValueResult.tenancy = this._tenancy; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppServerSchedulerHints | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._dedicatedHostId = undefined; + this._tenancy = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._dedicatedHostId = value.dedicatedHostId; + this._tenancy = value.tenancy; + } + } + + // dedicated_host_id - computed: false, optional: true, required: false + private _dedicatedHostId?: string; + public get dedicatedHostId() { + return this.getStringAttribute('dedicated_host_id'); + } + public set dedicatedHostId(value: string) { + this._dedicatedHostId = value; + } + public resetDedicatedHostId() { + this._dedicatedHostId = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedHostIdInput() { + return this._dedicatedHostId; + } + + // tenancy - computed: false, optional: true, required: false + private _tenancy?: string; + public get tenancy() { + return this.getStringAttribute('tenancy'); + } + public set tenancy(value: string) { + this._tenancy = value; + } + public resetTenancy() { + this._tenancy = undefined; + } + // Temporarily expose input value. Use with caution. + public get tenancyInput() { + return this._tenancy; + } +} +export interface WorkspaceAppServerTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#create WorkspaceAppServer#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#delete WorkspaceAppServer#delete} + */ + readonly delete?: string; +} + +export function workspaceAppServerTimeoutsToTerraform(struct?: WorkspaceAppServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + } +} + + +export function workspaceAppServerTimeoutsToHclTerraform(struct?: WorkspaceAppServerTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceAppServerTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WorkspaceAppServerTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceAppServerTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server huaweicloud_workspace_app_server} +*/ +export class WorkspaceAppServer extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_server"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppServer resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppServer to import + * @param importFromId The id of the existing WorkspaceAppServer that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppServer to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_server", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_server huaweicloud_workspace_app_server} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppServerConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppServerConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_server', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._autoRenew = config.autoRenew; + this._availabilityZone = config.availabilityZone; + this._chargingMode = config.chargingMode; + this._description = config.description; + this._flavorId = config.flavorId; + this._id = config.id; + this._maintainStatus = config.maintainStatus; + this._name = config.name; + this._osType = config.osType; + this._ouName = config.ouName; + this._period = config.period; + this._periodUnit = config.periodUnit; + this._region = config.region; + this._serverGroupId = config.serverGroupId; + this._subnetId = config.subnetId; + this._type = config.type; + this._updateAccessAgent = config.updateAccessAgent; + this._vpcId = config.vpcId; + this._rootVolume.internalValue = config.rootVolume; + this._schedulerHints.internalValue = config.schedulerHints; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // auto_renew - computed: false, optional: true, required: false + private _autoRenew?: string; + public get autoRenew() { + return this.getStringAttribute('auto_renew'); + } + public set autoRenew(value: string) { + this._autoRenew = value; + } + public resetAutoRenew() { + this._autoRenew = undefined; + } + // Temporarily expose input value. Use with caution. + public get autoRenewInput() { + return this._autoRenew; + } + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // charging_mode - computed: true, optional: true, required: false + private _chargingMode?: string; + public get chargingMode() { + return this.getStringAttribute('charging_mode'); + } + public set chargingMode(value: string) { + this._chargingMode = value; + } + public resetChargingMode() { + this._chargingMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get chargingModeInput() { + return this._chargingMode; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // maintain_status - computed: false, optional: true, required: false + private _maintainStatus?: boolean | cdktf.IResolvable; + public get maintainStatus() { + return this.getBooleanAttribute('maintain_status'); + } + public set maintainStatus(value: boolean | cdktf.IResolvable) { + this._maintainStatus = value; + } + public resetMaintainStatus() { + this._maintainStatus = undefined; + } + // Temporarily expose input value. Use with caution. + public get maintainStatusInput() { + return this._maintainStatus; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: true, optional: true, required: false + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + public resetOsType() { + this._osType = undefined; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // ou_name - computed: false, optional: true, required: false + private _ouName?: string; + public get ouName() { + return this.getStringAttribute('ou_name'); + } + public set ouName(value: string) { + this._ouName = value; + } + public resetOuName() { + this._ouName = undefined; + } + // Temporarily expose input value. Use with caution. + public get ouNameInput() { + return this._ouName; + } + + // period - computed: false, optional: true, required: false + private _period?: number; + public get period() { + return this.getNumberAttribute('period'); + } + public set period(value: number) { + this._period = value; + } + public resetPeriod() { + this._period = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodInput() { + return this._period; + } + + // period_unit - computed: false, optional: true, required: false + private _periodUnit?: string; + public get periodUnit() { + return this.getStringAttribute('period_unit'); + } + public set periodUnit(value: string) { + this._periodUnit = value; + } + public resetPeriodUnit() { + this._periodUnit = undefined; + } + // Temporarily expose input value. Use with caution. + public get periodUnitInput() { + return this._periodUnit; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_group_id - computed: false, optional: false, required: true + private _serverGroupId?: string; + public get serverGroupId() { + return this.getStringAttribute('server_group_id'); + } + public set serverGroupId(value: string) { + this._serverGroupId = value; + } + // Temporarily expose input value. Use with caution. + public get serverGroupIdInput() { + return this._serverGroupId; + } + + // subnet_id - computed: false, optional: false, required: true + private _subnetId?: string; + public get subnetId() { + return this.getStringAttribute('subnet_id'); + } + public set subnetId(value: string) { + this._subnetId = value; + } + // Temporarily expose input value. Use with caution. + public get subnetIdInput() { + return this._subnetId; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // update_access_agent - computed: false, optional: true, required: false + private _updateAccessAgent?: boolean | cdktf.IResolvable; + public get updateAccessAgent() { + return this.getBooleanAttribute('update_access_agent'); + } + public set updateAccessAgent(value: boolean | cdktf.IResolvable) { + this._updateAccessAgent = value; + } + public resetUpdateAccessAgent() { + this._updateAccessAgent = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateAccessAgentInput() { + return this._updateAccessAgent; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // root_volume - computed: false, optional: false, required: true + private _rootVolume = new WorkspaceAppServerRootVolumeOutputReference(this, "root_volume"); + public get rootVolume() { + return this._rootVolume; + } + public putRootVolume(value: WorkspaceAppServerRootVolume) { + this._rootVolume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeInput() { + return this._rootVolume.internalValue; + } + + // scheduler_hints - computed: false, optional: true, required: false + private _schedulerHints = new WorkspaceAppServerSchedulerHintsOutputReference(this, "scheduler_hints"); + public get schedulerHints() { + return this._schedulerHints; + } + public putSchedulerHints(value: WorkspaceAppServerSchedulerHints) { + this._schedulerHints.internalValue = value; + } + public resetSchedulerHints() { + this._schedulerHints.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get schedulerHintsInput() { + return this._schedulerHints.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WorkspaceAppServerTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WorkspaceAppServerTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + auto_renew: cdktf.stringToTerraform(this._autoRenew), + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + charging_mode: cdktf.stringToTerraform(this._chargingMode), + description: cdktf.stringToTerraform(this._description), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + maintain_status: cdktf.booleanToTerraform(this._maintainStatus), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + ou_name: cdktf.stringToTerraform(this._ouName), + period: cdktf.numberToTerraform(this._period), + period_unit: cdktf.stringToTerraform(this._periodUnit), + region: cdktf.stringToTerraform(this._region), + server_group_id: cdktf.stringToTerraform(this._serverGroupId), + subnet_id: cdktf.stringToTerraform(this._subnetId), + type: cdktf.stringToTerraform(this._type), + update_access_agent: cdktf.booleanToTerraform(this._updateAccessAgent), + vpc_id: cdktf.stringToTerraform(this._vpcId), + root_volume: workspaceAppServerRootVolumeToTerraform(this._rootVolume.internalValue), + scheduler_hints: workspaceAppServerSchedulerHintsToTerraform(this._schedulerHints.internalValue), + timeouts: workspaceAppServerTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + auto_renew: { + value: cdktf.stringToHclTerraform(this._autoRenew), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + charging_mode: { + value: cdktf.stringToHclTerraform(this._chargingMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + maintain_status: { + value: cdktf.booleanToHclTerraform(this._maintainStatus), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ou_name: { + value: cdktf.stringToHclTerraform(this._ouName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + period: { + value: cdktf.numberToHclTerraform(this._period), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + period_unit: { + value: cdktf.stringToHclTerraform(this._periodUnit), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_group_id: { + value: cdktf.stringToHclTerraform(this._serverGroupId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + subnet_id: { + value: cdktf.stringToHclTerraform(this._subnetId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update_access_agent: { + value: cdktf.booleanToHclTerraform(this._updateAccessAgent), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + root_volume: { + value: workspaceAppServerRootVolumeToHclTerraform(this._rootVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppServerRootVolumeList", + }, + scheduler_hints: { + value: workspaceAppServerSchedulerHintsToHclTerraform(this._schedulerHints.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceAppServerSchedulerHintsList", + }, + timeouts: { + value: workspaceAppServerTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WorkspaceAppServerTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-shared-folder/README.md b/src/constructs/providers/huaweicloud/workspace-app-shared-folder/README.md new file mode 100644 index 00000000..55796180 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-shared-folder/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_shared_folder` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_shared_folder`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder). diff --git a/src/constructs/providers/huaweicloud/workspace-app-shared-folder/index.ts b/src/constructs/providers/huaweicloud/workspace-app-shared-folder/index.ts new file mode 100644 index 00000000..e1a9473a --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-shared-folder/index.ts @@ -0,0 +1,210 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppSharedFolderConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder#id WorkspaceAppSharedFolder#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the shared folder. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder#name WorkspaceAppSharedFolder#name} + */ + readonly name: string; + /** + * The region where the shared folder is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder#region WorkspaceAppSharedFolder#region} + */ + readonly region?: string; + /** + * The NAS storage ID to which the shared folder belongs. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder#storage_id WorkspaceAppSharedFolder#storage_id} + */ + readonly storageId: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder huaweicloud_workspace_app_shared_folder} +*/ +export class WorkspaceAppSharedFolder extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_shared_folder"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppSharedFolder resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppSharedFolder to import + * @param importFromId The id of the existing WorkspaceAppSharedFolder that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppSharedFolder to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_shared_folder", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_shared_folder huaweicloud_workspace_app_shared_folder} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppSharedFolderConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppSharedFolderConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_shared_folder', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._storageId = config.storageId; + } + + // ========== + // ATTRIBUTES + // ========== + + // delimiter - computed: true, optional: false, required: false + public get delimiter() { + return this.getStringAttribute('delimiter'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // path - computed: true, optional: false, required: false + public get path() { + return this.getStringAttribute('path'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // storage_id - computed: false, optional: false, required: true + private _storageId?: string; + public get storageId() { + return this.getStringAttribute('storage_id'); + } + public set storageId(value: string) { + this._storageId = value; + } + // Temporarily expose input value. Use with caution. + public get storageIdInput() { + return this._storageId; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + storage_id: cdktf.stringToTerraform(this._storageId), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + storage_id: { + value: cdktf.stringToHclTerraform(this._storageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-storage-policy/README.md b/src/constructs/providers/huaweicloud/workspace-app-storage-policy/README.md new file mode 100644 index 00000000..dd4746e6 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-storage-policy/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_storage_policy` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_storage_policy`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy). diff --git a/src/constructs/providers/huaweicloud/workspace-app-storage-policy/index.ts b/src/constructs/providers/huaweicloud/workspace-app-storage-policy/index.ts new file mode 100644 index 00000000..24e7b9c3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-storage-policy/index.ts @@ -0,0 +1,203 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppStoragePolicyConfig extends cdktf.TerraformMetaArguments { + /** + * The collection of permissions that client can use to access storage. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy#client_actions WorkspaceAppStoragePolicy#client_actions} + */ + readonly clientActions?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy#id WorkspaceAppStoragePolicy#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the custom storage permission policy is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy#region WorkspaceAppStoragePolicy#region} + */ + readonly region?: string; + /** + * The collection of permissions that server can use to access storage. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy#server_actions WorkspaceAppStoragePolicy#server_actions} + */ + readonly serverActions: string[]; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy huaweicloud_workspace_app_storage_policy} +*/ +export class WorkspaceAppStoragePolicy extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_storage_policy"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppStoragePolicy resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppStoragePolicy to import + * @param importFromId The id of the existing WorkspaceAppStoragePolicy that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppStoragePolicy to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_storage_policy", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_storage_policy huaweicloud_workspace_app_storage_policy} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppStoragePolicyConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppStoragePolicyConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_storage_policy', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._clientActions = config.clientActions; + this._id = config.id; + this._region = config.region; + this._serverActions = config.serverActions; + } + + // ========== + // ATTRIBUTES + // ========== + + // client_actions - computed: false, optional: true, required: false + private _clientActions?: string[]; + public get clientActions() { + return cdktf.Fn.tolist(this.getListAttribute('client_actions')); + } + public set clientActions(value: string[]) { + this._clientActions = value; + } + public resetClientActions() { + this._clientActions = undefined; + } + // Temporarily expose input value. Use with caution. + public get clientActionsInput() { + return this._clientActions; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // server_actions - computed: false, optional: false, required: true + private _serverActions?: string[]; + public get serverActions() { + return cdktf.Fn.tolist(this.getListAttribute('server_actions')); + } + public set serverActions(value: string[]) { + this._serverActions = value; + } + // Temporarily expose input value. Use with caution. + public get serverActionsInput() { + return this._serverActions; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + client_actions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._clientActions), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + server_actions: cdktf.listMapper(cdktf.stringToTerraform, false)(this._serverActions), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + client_actions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._clientActions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + server_actions: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._serverActions), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-app-warehouse-app/README.md b/src/constructs/providers/huaweicloud/workspace-app-warehouse-app/README.md new file mode 100644 index 00000000..fb8172c1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-warehouse-app/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_app_warehouse_app` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_app_warehouse_app`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app). diff --git a/src/constructs/providers/huaweicloud/workspace-app-warehouse-app/index.ts b/src/constructs/providers/huaweicloud/workspace-app-warehouse-app/index.ts new file mode 100644 index 00000000..50f9fc67 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-app-warehouse-app/index.ts @@ -0,0 +1,366 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceAppWarehouseAppConfig extends cdktf.TerraformMetaArguments { + /** + * The category of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#category WorkspaceAppWarehouseApp#category} + */ + readonly category: string; + /** + * The description of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#description WorkspaceAppWarehouseApp#description} + */ + readonly description?: string; + /** + * The storage path of the OBS bucket where the application is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#file_store_path WorkspaceAppWarehouseApp#file_store_path} + */ + readonly fileStorePath: string; + /** + * The icon of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#icon WorkspaceAppWarehouseApp#icon} + */ + readonly icon?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#id WorkspaceAppWarehouseApp#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#name WorkspaceAppWarehouseApp#name} + */ + readonly name: string; + /** + * The operating system type of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#os_type WorkspaceAppWarehouseApp#os_type} + */ + readonly osType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#region WorkspaceAppWarehouseApp#region} + */ + readonly region?: string; + /** + * The version of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#version WorkspaceAppWarehouseApp#version} + */ + readonly version: string; + /** + * The version name of the application. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#version_name WorkspaceAppWarehouseApp#version_name} + */ + readonly versionName: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app huaweicloud_workspace_app_warehouse_app} +*/ +export class WorkspaceAppWarehouseApp extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_app_warehouse_app"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceAppWarehouseApp resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceAppWarehouseApp to import + * @param importFromId The id of the existing WorkspaceAppWarehouseApp that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceAppWarehouseApp to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_app_warehouse_app", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_app_warehouse_app huaweicloud_workspace_app_warehouse_app} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceAppWarehouseAppConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceAppWarehouseAppConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_app_warehouse_app', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._category = config.category; + this._description = config.description; + this._fileStorePath = config.fileStorePath; + this._icon = config.icon; + this._id = config.id; + this._name = config.name; + this._osType = config.osType; + this._region = config.region; + this._version = config.version; + this._versionName = config.versionName; + } + + // ========== + // ATTRIBUTES + // ========== + + // category - computed: false, optional: false, required: true + private _category?: string; + public get category() { + return this.getStringAttribute('category'); + } + public set category(value: string) { + this._category = value; + } + // Temporarily expose input value. Use with caution. + public get categoryInput() { + return this._category; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // file_store_path - computed: false, optional: false, required: true + private _fileStorePath?: string; + public get fileStorePath() { + return this.getStringAttribute('file_store_path'); + } + public set fileStorePath(value: string) { + this._fileStorePath = value; + } + // Temporarily expose input value. Use with caution. + public get fileStorePathInput() { + return this._fileStorePath; + } + + // icon - computed: false, optional: true, required: false + private _icon?: string; + public get icon() { + return this.getStringAttribute('icon'); + } + public set icon(value: string) { + this._icon = value; + } + public resetIcon() { + this._icon = undefined; + } + // Temporarily expose input value. Use with caution. + public get iconInput() { + return this._icon; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // os_type - computed: false, optional: false, required: true + private _osType?: string; + public get osType() { + return this.getStringAttribute('os_type'); + } + public set osType(value: string) { + this._osType = value; + } + // Temporarily expose input value. Use with caution. + public get osTypeInput() { + return this._osType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // version - computed: false, optional: false, required: true + private _version?: string; + public get version() { + return this.getStringAttribute('version'); + } + public set version(value: string) { + this._version = value; + } + // Temporarily expose input value. Use with caution. + public get versionInput() { + return this._version; + } + + // version_name - computed: false, optional: false, required: true + private _versionName?: string; + public get versionName() { + return this.getStringAttribute('version_name'); + } + public set versionName(value: string) { + this._versionName = value; + } + // Temporarily expose input value. Use with caution. + public get versionNameInput() { + return this._versionName; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + category: cdktf.stringToTerraform(this._category), + description: cdktf.stringToTerraform(this._description), + file_store_path: cdktf.stringToTerraform(this._fileStorePath), + icon: cdktf.stringToTerraform(this._icon), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + os_type: cdktf.stringToTerraform(this._osType), + region: cdktf.stringToTerraform(this._region), + version: cdktf.stringToTerraform(this._version), + version_name: cdktf.stringToTerraform(this._versionName), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + category: { + value: cdktf.stringToHclTerraform(this._category), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + file_store_path: { + value: cdktf.stringToHclTerraform(this._fileStorePath), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + icon: { + value: cdktf.stringToHclTerraform(this._icon), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + os_type: { + value: cdktf.stringToHclTerraform(this._osType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version: { + value: cdktf.stringToHclTerraform(this._version), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + version_name: { + value: cdktf.stringToHclTerraform(this._versionName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-desktop-name-rule/README.md b/src/constructs/providers/huaweicloud/workspace-desktop-name-rule/README.md new file mode 100644 index 00000000..33dae623 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-desktop-name-rule/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_desktop_name_rule` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_desktop_name_rule`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule). diff --git a/src/constructs/providers/huaweicloud/workspace-desktop-name-rule/index.ts b/src/constructs/providers/huaweicloud/workspace-desktop-name-rule/index.ts new file mode 100644 index 00000000..84c76771 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-desktop-name-rule/index.ts @@ -0,0 +1,302 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceDesktopNameRuleConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#digit_number WorkspaceDesktopNameRule#digit_number} + */ + readonly digitNumber: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#id WorkspaceDesktopNameRule#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#is_default_policy WorkspaceDesktopNameRule#is_default_policy} + */ + readonly isDefaultPolicy?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#name WorkspaceDesktopNameRule#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#name_prefix WorkspaceDesktopNameRule#name_prefix} + */ + readonly namePrefix: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#region WorkspaceDesktopNameRule#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#single_domain_user_increment WorkspaceDesktopNameRule#single_domain_user_increment} + */ + readonly singleDomainUserIncrement: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#start_number WorkspaceDesktopNameRule#start_number} + */ + readonly startNumber: number; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule huaweicloud_workspace_desktop_name_rule} +*/ +export class WorkspaceDesktopNameRule extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_desktop_name_rule"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceDesktopNameRule resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceDesktopNameRule to import + * @param importFromId The id of the existing WorkspaceDesktopNameRule that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceDesktopNameRule to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_desktop_name_rule", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop_name_rule huaweicloud_workspace_desktop_name_rule} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceDesktopNameRuleConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceDesktopNameRuleConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_desktop_name_rule', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._digitNumber = config.digitNumber; + this._id = config.id; + this._isDefaultPolicy = config.isDefaultPolicy; + this._name = config.name; + this._namePrefix = config.namePrefix; + this._region = config.region; + this._singleDomainUserIncrement = config.singleDomainUserIncrement; + this._startNumber = config.startNumber; + } + + // ========== + // ATTRIBUTES + // ========== + + // digit_number - computed: false, optional: false, required: true + private _digitNumber?: number; + public get digitNumber() { + return this.getNumberAttribute('digit_number'); + } + public set digitNumber(value: number) { + this._digitNumber = value; + } + // Temporarily expose input value. Use with caution. + public get digitNumberInput() { + return this._digitNumber; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // is_contain_user - computed: true, optional: false, required: false + public get isContainUser() { + return this.getBooleanAttribute('is_contain_user'); + } + + // is_default_policy - computed: true, optional: true, required: false + private _isDefaultPolicy?: boolean | cdktf.IResolvable; + public get isDefaultPolicy() { + return this.getBooleanAttribute('is_default_policy'); + } + public set isDefaultPolicy(value: boolean | cdktf.IResolvable) { + this._isDefaultPolicy = value; + } + public resetIsDefaultPolicy() { + this._isDefaultPolicy = undefined; + } + // Temporarily expose input value. Use with caution. + public get isDefaultPolicyInput() { + return this._isDefaultPolicy; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // name_prefix - computed: false, optional: false, required: true + private _namePrefix?: string; + public get namePrefix() { + return this.getStringAttribute('name_prefix'); + } + public set namePrefix(value: string) { + this._namePrefix = value; + } + // Temporarily expose input value. Use with caution. + public get namePrefixInput() { + return this._namePrefix; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // single_domain_user_increment - computed: false, optional: false, required: true + private _singleDomainUserIncrement?: number; + public get singleDomainUserIncrement() { + return this.getNumberAttribute('single_domain_user_increment'); + } + public set singleDomainUserIncrement(value: number) { + this._singleDomainUserIncrement = value; + } + // Temporarily expose input value. Use with caution. + public get singleDomainUserIncrementInput() { + return this._singleDomainUserIncrement; + } + + // start_number - computed: false, optional: false, required: true + private _startNumber?: number; + public get startNumber() { + return this.getNumberAttribute('start_number'); + } + public set startNumber(value: number) { + this._startNumber = value; + } + // Temporarily expose input value. Use with caution. + public get startNumberInput() { + return this._startNumber; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + digit_number: cdktf.numberToTerraform(this._digitNumber), + id: cdktf.stringToTerraform(this._id), + is_default_policy: cdktf.booleanToTerraform(this._isDefaultPolicy), + name: cdktf.stringToTerraform(this._name), + name_prefix: cdktf.stringToTerraform(this._namePrefix), + region: cdktf.stringToTerraform(this._region), + single_domain_user_increment: cdktf.numberToTerraform(this._singleDomainUserIncrement), + start_number: cdktf.numberToTerraform(this._startNumber), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + digit_number: { + value: cdktf.numberToHclTerraform(this._digitNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + is_default_policy: { + value: cdktf.booleanToHclTerraform(this._isDefaultPolicy), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name_prefix: { + value: cdktf.stringToHclTerraform(this._namePrefix), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + single_domain_user_increment: { + value: cdktf.numberToHclTerraform(this._singleDomainUserIncrement), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + start_number: { + value: cdktf.numberToHclTerraform(this._startNumber), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-desktop/README.md b/src/constructs/providers/huaweicloud/workspace-desktop/README.md new file mode 100644 index 00000000..05ac2fbb --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-desktop/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_desktop` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_desktop`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop). diff --git a/src/constructs/providers/huaweicloud/workspace-desktop/index.ts b/src/constructs/providers/huaweicloud/workspace-desktop/index.ts new file mode 100644 index 00000000..5cd6e145 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-desktop/index.ts @@ -0,0 +1,1260 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceDesktopConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#availability_zone WorkspaceDesktop#availability_zone} + */ + readonly availabilityZone?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#delete_user WorkspaceDesktop#delete_user} + */ + readonly deleteUser?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#email_notification WorkspaceDesktop#email_notification} + */ + readonly emailNotification?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#enterprise_project_id WorkspaceDesktop#enterprise_project_id} + */ + readonly enterpriseProjectId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#flavor_id WorkspaceDesktop#flavor_id} + */ + readonly flavorId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#id WorkspaceDesktop#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#image_id WorkspaceDesktop#image_id} + */ + readonly imageId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#image_type WorkspaceDesktop#image_type} + */ + readonly imageType: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#name WorkspaceDesktop#name} + */ + readonly name?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#power_action WorkspaceDesktop#power_action} + */ + readonly powerAction?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#power_action_type WorkspaceDesktop#power_action_type} + */ + readonly powerActionType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#region WorkspaceDesktop#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#security_groups WorkspaceDesktop#security_groups} + */ + readonly securityGroups?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#tags WorkspaceDesktop#tags} + */ + readonly tags?: { [key: string]: string }; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#user_email WorkspaceDesktop#user_email} + */ + readonly userEmail: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#user_group WorkspaceDesktop#user_group} + */ + readonly userGroup: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#user_name WorkspaceDesktop#user_name} + */ + readonly userName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#vpc_id WorkspaceDesktop#vpc_id} + */ + readonly vpcId: string; + /** + * data_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#data_volume WorkspaceDesktop#data_volume} + */ + readonly dataVolume?: WorkspaceDesktopDataVolume[] | cdktf.IResolvable; + /** + * nic block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#nic WorkspaceDesktop#nic} + */ + readonly nic?: WorkspaceDesktopNic[] | cdktf.IResolvable; + /** + * root_volume block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#root_volume WorkspaceDesktop#root_volume} + */ + readonly rootVolume: WorkspaceDesktopRootVolume; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#timeouts WorkspaceDesktop#timeouts} + */ + readonly timeouts?: WorkspaceDesktopTimeouts; +} +export interface WorkspaceDesktopDataVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#size WorkspaceDesktop#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#type WorkspaceDesktop#type} + */ + readonly type: string; +} + +export function workspaceDesktopDataVolumeToTerraform(struct?: WorkspaceDesktopDataVolume | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceDesktopDataVolumeToHclTerraform(struct?: WorkspaceDesktopDataVolume | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceDesktopDataVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceDesktopDataVolume | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceDesktopDataVolume | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._size = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._size = value.size; + this._type = value.type; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class WorkspaceDesktopDataVolumeList extends cdktf.ComplexList { + public internalValue? : WorkspaceDesktopDataVolume[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceDesktopDataVolumeOutputReference { + return new WorkspaceDesktopDataVolumeOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WorkspaceDesktopNic { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#network_id WorkspaceDesktop#network_id} + */ + readonly networkId: string; +} + +export function workspaceDesktopNicToTerraform(struct?: WorkspaceDesktopNic | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + network_id: cdktf.stringToTerraform(struct!.networkId), + } +} + + +export function workspaceDesktopNicToHclTerraform(struct?: WorkspaceDesktopNic | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + network_id: { + value: cdktf.stringToHclTerraform(struct!.networkId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceDesktopNicOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceDesktopNic | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._networkId !== undefined) { + hasAnyValues = true; + internalValueResult.networkId = this._networkId; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceDesktopNic | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._networkId = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._networkId = value.networkId; + } + } + + // network_id - computed: false, optional: false, required: true + private _networkId?: string; + public get networkId() { + return this.getStringAttribute('network_id'); + } + public set networkId(value: string) { + this._networkId = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdInput() { + return this._networkId; + } +} + +export class WorkspaceDesktopNicList extends cdktf.ComplexList { + public internalValue? : WorkspaceDesktopNic[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceDesktopNicOutputReference { + return new WorkspaceDesktopNicOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WorkspaceDesktopRootVolume { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#size WorkspaceDesktop#size} + */ + readonly size: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#type WorkspaceDesktop#type} + */ + readonly type: string; +} + +export function workspaceDesktopRootVolumeToTerraform(struct?: WorkspaceDesktopRootVolumeOutputReference | WorkspaceDesktopRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + size: cdktf.numberToTerraform(struct!.size), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspaceDesktopRootVolumeToHclTerraform(struct?: WorkspaceDesktopRootVolumeOutputReference | WorkspaceDesktopRootVolume): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + size: { + value: cdktf.numberToHclTerraform(struct!.size), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceDesktopRootVolumeOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceDesktopRootVolume | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._size !== undefined) { + hasAnyValues = true; + internalValueResult.size = this._size; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceDesktopRootVolume | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._size = undefined; + this._type = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._size = value.size; + this._type = value.type; + } + } + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // device - computed: true, optional: false, required: false + public get device() { + return this.getStringAttribute('device'); + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // size - computed: false, optional: false, required: true + private _size?: number; + public get size() { + return this.getNumberAttribute('size'); + } + public set size(value: number) { + this._size = value; + } + // Temporarily expose input value. Use with caution. + public get sizeInput() { + return this._size; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} +export interface WorkspaceDesktopTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#create WorkspaceDesktop#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#delete WorkspaceDesktop#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#update WorkspaceDesktop#update} + */ + readonly update?: string; +} + +export function workspaceDesktopTimeoutsToTerraform(struct?: WorkspaceDesktopTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function workspaceDesktopTimeoutsToHclTerraform(struct?: WorkspaceDesktopTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceDesktopTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WorkspaceDesktopTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceDesktopTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop huaweicloud_workspace_desktop} +*/ +export class WorkspaceDesktop extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_desktop"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceDesktop resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceDesktop to import + * @param importFromId The id of the existing WorkspaceDesktop that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceDesktop to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_desktop", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_desktop huaweicloud_workspace_desktop} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceDesktopConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceDesktopConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_desktop', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._availabilityZone = config.availabilityZone; + this._deleteUser = config.deleteUser; + this._emailNotification = config.emailNotification; + this._enterpriseProjectId = config.enterpriseProjectId; + this._flavorId = config.flavorId; + this._id = config.id; + this._imageId = config.imageId; + this._imageType = config.imageType; + this._name = config.name; + this._powerAction = config.powerAction; + this._powerActionType = config.powerActionType; + this._region = config.region; + this._securityGroups = config.securityGroups; + this._tags = config.tags; + this._userEmail = config.userEmail; + this._userGroup = config.userGroup; + this._userName = config.userName; + this._vpcId = config.vpcId; + this._dataVolume.internalValue = config.dataVolume; + this._nic.internalValue = config.nic; + this._rootVolume.internalValue = config.rootVolume; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // availability_zone - computed: true, optional: true, required: false + private _availabilityZone?: string; + public get availabilityZone() { + return this.getStringAttribute('availability_zone'); + } + public set availabilityZone(value: string) { + this._availabilityZone = value; + } + public resetAvailabilityZone() { + this._availabilityZone = undefined; + } + // Temporarily expose input value. Use with caution. + public get availabilityZoneInput() { + return this._availabilityZone; + } + + // delete_user - computed: false, optional: true, required: false + private _deleteUser?: boolean | cdktf.IResolvable; + public get deleteUser() { + return this.getBooleanAttribute('delete_user'); + } + public set deleteUser(value: boolean | cdktf.IResolvable) { + this._deleteUser = value; + } + public resetDeleteUser() { + this._deleteUser = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteUserInput() { + return this._deleteUser; + } + + // email_notification - computed: false, optional: true, required: false + private _emailNotification?: boolean | cdktf.IResolvable; + public get emailNotification() { + return this.getBooleanAttribute('email_notification'); + } + public set emailNotification(value: boolean | cdktf.IResolvable) { + this._emailNotification = value; + } + public resetEmailNotification() { + this._emailNotification = undefined; + } + // Temporarily expose input value. Use with caution. + public get emailNotificationInput() { + return this._emailNotification; + } + + // enterprise_project_id - computed: true, optional: true, required: false + private _enterpriseProjectId?: string; + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + public set enterpriseProjectId(value: string) { + this._enterpriseProjectId = value; + } + public resetEnterpriseProjectId() { + this._enterpriseProjectId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseProjectIdInput() { + return this._enterpriseProjectId; + } + + // flavor_id - computed: false, optional: false, required: true + private _flavorId?: string; + public get flavorId() { + return this.getStringAttribute('flavor_id'); + } + public set flavorId(value: string) { + this._flavorId = value; + } + // Temporarily expose input value. Use with caution. + public get flavorIdInput() { + return this._flavorId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // image_id - computed: false, optional: false, required: true + private _imageId?: string; + public get imageId() { + return this.getStringAttribute('image_id'); + } + public set imageId(value: string) { + this._imageId = value; + } + // Temporarily expose input value. Use with caution. + public get imageIdInput() { + return this._imageId; + } + + // image_type - computed: false, optional: false, required: true + private _imageType?: string; + public get imageType() { + return this.getStringAttribute('image_type'); + } + public set imageType(value: string) { + this._imageType = value; + } + // Temporarily expose input value. Use with caution. + public get imageTypeInput() { + return this._imageType; + } + + // name - computed: true, optional: true, required: false + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + public resetName() { + this._name = undefined; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // power_action - computed: true, optional: true, required: false + private _powerAction?: string; + public get powerAction() { + return this.getStringAttribute('power_action'); + } + public set powerAction(value: string) { + this._powerAction = value; + } + public resetPowerAction() { + this._powerAction = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionInput() { + return this._powerAction; + } + + // power_action_type - computed: false, optional: true, required: false + private _powerActionType?: string; + public get powerActionType() { + return this.getStringAttribute('power_action_type'); + } + public set powerActionType(value: string) { + this._powerActionType = value; + } + public resetPowerActionType() { + this._powerActionType = undefined; + } + // Temporarily expose input value. Use with caution. + public get powerActionTypeInput() { + return this._powerActionType; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // security_groups - computed: true, optional: true, required: false + private _securityGroups?: string[]; + public get securityGroups() { + return cdktf.Fn.tolist(this.getListAttribute('security_groups')); + } + public set securityGroups(value: string[]) { + this._securityGroups = value; + } + public resetSecurityGroups() { + this._securityGroups = undefined; + } + // Temporarily expose input value. Use with caution. + public get securityGroupsInput() { + return this._securityGroups; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // tags - computed: false, optional: true, required: false + private _tags?: { [key: string]: string }; + public get tags() { + return this.getStringMapAttribute('tags'); + } + public set tags(value: { [key: string]: string }) { + this._tags = value; + } + public resetTags() { + this._tags = undefined; + } + // Temporarily expose input value. Use with caution. + public get tagsInput() { + return this._tags; + } + + // user_email - computed: false, optional: false, required: true + private _userEmail?: string; + public get userEmail() { + return this.getStringAttribute('user_email'); + } + public set userEmail(value: string) { + this._userEmail = value; + } + // Temporarily expose input value. Use with caution. + public get userEmailInput() { + return this._userEmail; + } + + // user_group - computed: false, optional: false, required: true + private _userGroup?: string; + public get userGroup() { + return this.getStringAttribute('user_group'); + } + public set userGroup(value: string) { + this._userGroup = value; + } + // Temporarily expose input value. Use with caution. + public get userGroupInput() { + return this._userGroup; + } + + // user_name - computed: false, optional: false, required: true + private _userName?: string; + public get userName() { + return this.getStringAttribute('user_name'); + } + public set userName(value: string) { + this._userName = value; + } + // Temporarily expose input value. Use with caution. + public get userNameInput() { + return this._userName; + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // data_volume - computed: false, optional: true, required: false + private _dataVolume = new WorkspaceDesktopDataVolumeList(this, "data_volume", false); + public get dataVolume() { + return this._dataVolume; + } + public putDataVolume(value: WorkspaceDesktopDataVolume[] | cdktf.IResolvable) { + this._dataVolume.internalValue = value; + } + public resetDataVolume() { + this._dataVolume.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get dataVolumeInput() { + return this._dataVolume.internalValue; + } + + // nic - computed: false, optional: true, required: false + private _nic = new WorkspaceDesktopNicList(this, "nic", false); + public get nic() { + return this._nic; + } + public putNic(value: WorkspaceDesktopNic[] | cdktf.IResolvable) { + this._nic.internalValue = value; + } + public resetNic() { + this._nic.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get nicInput() { + return this._nic.internalValue; + } + + // root_volume - computed: false, optional: false, required: true + private _rootVolume = new WorkspaceDesktopRootVolumeOutputReference(this, "root_volume"); + public get rootVolume() { + return this._rootVolume; + } + public putRootVolume(value: WorkspaceDesktopRootVolume) { + this._rootVolume.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get rootVolumeInput() { + return this._rootVolume.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WorkspaceDesktopTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WorkspaceDesktopTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + availability_zone: cdktf.stringToTerraform(this._availabilityZone), + delete_user: cdktf.booleanToTerraform(this._deleteUser), + email_notification: cdktf.booleanToTerraform(this._emailNotification), + enterprise_project_id: cdktf.stringToTerraform(this._enterpriseProjectId), + flavor_id: cdktf.stringToTerraform(this._flavorId), + id: cdktf.stringToTerraform(this._id), + image_id: cdktf.stringToTerraform(this._imageId), + image_type: cdktf.stringToTerraform(this._imageType), + name: cdktf.stringToTerraform(this._name), + power_action: cdktf.stringToTerraform(this._powerAction), + power_action_type: cdktf.stringToTerraform(this._powerActionType), + region: cdktf.stringToTerraform(this._region), + security_groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._securityGroups), + tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), + user_email: cdktf.stringToTerraform(this._userEmail), + user_group: cdktf.stringToTerraform(this._userGroup), + user_name: cdktf.stringToTerraform(this._userName), + vpc_id: cdktf.stringToTerraform(this._vpcId), + data_volume: cdktf.listMapper(workspaceDesktopDataVolumeToTerraform, true)(this._dataVolume.internalValue), + nic: cdktf.listMapper(workspaceDesktopNicToTerraform, true)(this._nic.internalValue), + root_volume: workspaceDesktopRootVolumeToTerraform(this._rootVolume.internalValue), + timeouts: workspaceDesktopTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + availability_zone: { + value: cdktf.stringToHclTerraform(this._availabilityZone), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_user: { + value: cdktf.booleanToHclTerraform(this._deleteUser), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + email_notification: { + value: cdktf.booleanToHclTerraform(this._emailNotification), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enterprise_project_id: { + value: cdktf.stringToHclTerraform(this._enterpriseProjectId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + flavor_id: { + value: cdktf.stringToHclTerraform(this._flavorId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_id: { + value: cdktf.stringToHclTerraform(this._imageId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + image_type: { + value: cdktf.stringToHclTerraform(this._imageType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action: { + value: cdktf.stringToHclTerraform(this._powerAction), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + power_action_type: { + value: cdktf.stringToHclTerraform(this._powerActionType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + security_groups: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._securityGroups), + isBlock: false, + type: "set", + storageClassType: "stringList", + }, + tags: { + value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._tags), + isBlock: false, + type: "map", + storageClassType: "stringMap", + }, + user_email: { + value: cdktf.stringToHclTerraform(this._userEmail), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_group: { + value: cdktf.stringToHclTerraform(this._userGroup), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + user_name: { + value: cdktf.stringToHclTerraform(this._userName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + data_volume: { + value: cdktf.listMapperHcl(workspaceDesktopDataVolumeToHclTerraform, true)(this._dataVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceDesktopDataVolumeList", + }, + nic: { + value: cdktf.listMapperHcl(workspaceDesktopNicToHclTerraform, true)(this._nic.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceDesktopNicList", + }, + root_volume: { + value: workspaceDesktopRootVolumeToHclTerraform(this._rootVolume.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceDesktopRootVolumeList", + }, + timeouts: { + value: workspaceDesktopTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WorkspaceDesktopTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-eip-associate/README.md b/src/constructs/providers/huaweicloud/workspace-eip-associate/README.md new file mode 100644 index 00000000..f7c5dab7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-eip-associate/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_eip_associate` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_eip_associate`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate). diff --git a/src/constructs/providers/huaweicloud/workspace-eip-associate/index.ts b/src/constructs/providers/huaweicloud/workspace-eip-associate/index.ts new file mode 100644 index 00000000..9d5d55b1 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-eip-associate/index.ts @@ -0,0 +1,204 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceEipAssociateConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate#desktop_id WorkspaceEipAssociate#desktop_id} + */ + readonly desktopId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate#eip_id WorkspaceEipAssociate#eip_id} + */ + readonly eipId: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate#id WorkspaceEipAssociate#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate#region WorkspaceEipAssociate#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate huaweicloud_workspace_eip_associate} +*/ +export class WorkspaceEipAssociate extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_eip_associate"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceEipAssociate resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceEipAssociate to import + * @param importFromId The id of the existing WorkspaceEipAssociate that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceEipAssociate to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_eip_associate", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_eip_associate huaweicloud_workspace_eip_associate} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceEipAssociateConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceEipAssociateConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_eip_associate', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._desktopId = config.desktopId; + this._eipId = config.eipId; + this._id = config.id; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // desktop_id - computed: false, optional: false, required: true + private _desktopId?: string; + public get desktopId() { + return this.getStringAttribute('desktop_id'); + } + public set desktopId(value: string) { + this._desktopId = value; + } + // Temporarily expose input value. Use with caution. + public get desktopIdInput() { + return this._desktopId; + } + + // eip_id - computed: false, optional: false, required: true + private _eipId?: string; + public get eipId() { + return this.getStringAttribute('eip_id'); + } + public set eipId(value: string) { + this._eipId = value; + } + // Temporarily expose input value. Use with caution. + public get eipIdInput() { + return this._eipId; + } + + // enterprise_project_id - computed: true, optional: false, required: false + public get enterpriseProjectId() { + return this.getStringAttribute('enterprise_project_id'); + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // public_ip - computed: true, optional: false, required: false + public get publicIp() { + return this.getStringAttribute('public_ip'); + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + desktop_id: cdktf.stringToTerraform(this._desktopId), + eip_id: cdktf.stringToTerraform(this._eipId), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + desktop_id: { + value: cdktf.stringToHclTerraform(this._desktopId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + eip_id: { + value: cdktf.stringToHclTerraform(this._eipId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-policy-group/README.md b/src/constructs/providers/huaweicloud/workspace-policy-group/README.md new file mode 100644 index 00000000..28db783f --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-policy-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_policy_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_policy_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group). diff --git a/src/constructs/providers/huaweicloud/workspace-policy-group/index.ts b/src/constructs/providers/huaweicloud/workspace-policy-group/index.ts new file mode 100644 index 00000000..92ce71cb --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-policy-group/index.ts @@ -0,0 +1,646 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspacePolicyGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the policy group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#description WorkspacePolicyGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#id WorkspacePolicyGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the policy group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#name WorkspacePolicyGroup#name} + */ + readonly name: string; + /** + * The priority of the policy group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#priority WorkspacePolicyGroup#priority} + */ + readonly priority?: number; + /** + * The region where the policy group is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#region WorkspacePolicyGroup#region} + */ + readonly region?: string; + /** + * policy block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#policy WorkspacePolicyGroup#policy} + */ + readonly policy?: WorkspacePolicyGroupPolicy; + /** + * targets block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#targets WorkspacePolicyGroup#targets} + */ + readonly targets?: WorkspacePolicyGroupTargets[] | cdktf.IResolvable; +} +export interface WorkspacePolicyGroupPolicyAccessControl { + /** + * The IP access configuration. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#ip_access_control WorkspacePolicyGroup#ip_access_control} + */ + readonly ipAccessControl: string; +} + +export function workspacePolicyGroupPolicyAccessControlToTerraform(struct?: WorkspacePolicyGroupPolicyAccessControlOutputReference | WorkspacePolicyGroupPolicyAccessControl): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + ip_access_control: cdktf.stringToTerraform(struct!.ipAccessControl), + } +} + + +export function workspacePolicyGroupPolicyAccessControlToHclTerraform(struct?: WorkspacePolicyGroupPolicyAccessControlOutputReference | WorkspacePolicyGroupPolicyAccessControl): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + ip_access_control: { + value: cdktf.stringToHclTerraform(struct!.ipAccessControl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspacePolicyGroupPolicyAccessControlOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspacePolicyGroupPolicyAccessControl | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._ipAccessControl !== undefined) { + hasAnyValues = true; + internalValueResult.ipAccessControl = this._ipAccessControl; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspacePolicyGroupPolicyAccessControl | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._ipAccessControl = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._ipAccessControl = value.ipAccessControl; + } + } + + // ip_access_control - computed: false, optional: false, required: true + private _ipAccessControl?: string; + public get ipAccessControl() { + return this.getStringAttribute('ip_access_control'); + } + public set ipAccessControl(value: string) { + this._ipAccessControl = value; + } + // Temporarily expose input value. Use with caution. + public get ipAccessControlInput() { + return this._ipAccessControl; + } +} +export interface WorkspacePolicyGroupPolicy { + /** + * access_control block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#access_control WorkspacePolicyGroup#access_control} + */ + readonly accessControl: WorkspacePolicyGroupPolicyAccessControl; +} + +export function workspacePolicyGroupPolicyToTerraform(struct?: WorkspacePolicyGroupPolicyOutputReference | WorkspacePolicyGroupPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + access_control: workspacePolicyGroupPolicyAccessControlToTerraform(struct!.accessControl), + } +} + + +export function workspacePolicyGroupPolicyToHclTerraform(struct?: WorkspacePolicyGroupPolicyOutputReference | WorkspacePolicyGroupPolicy): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + access_control: { + value: workspacePolicyGroupPolicyAccessControlToHclTerraform(struct!.accessControl), + isBlock: true, + type: "list", + storageClassType: "WorkspacePolicyGroupPolicyAccessControlList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspacePolicyGroupPolicyOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspacePolicyGroupPolicy | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._accessControl?.internalValue !== undefined) { + hasAnyValues = true; + internalValueResult.accessControl = this._accessControl?.internalValue; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspacePolicyGroupPolicy | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._accessControl.internalValue = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._accessControl.internalValue = value.accessControl; + } + } + + // access_control - computed: false, optional: false, required: true + private _accessControl = new WorkspacePolicyGroupPolicyAccessControlOutputReference(this, "access_control"); + public get accessControl() { + return this._accessControl; + } + public putAccessControl(value: WorkspacePolicyGroupPolicyAccessControl) { + this._accessControl.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get accessControlInput() { + return this._accessControl.internalValue; + } +} +export interface WorkspacePolicyGroupTargets { + /** + * The target ID. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#id WorkspacePolicyGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; + /** + * The target name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#name WorkspacePolicyGroup#name} + */ + readonly name: string; + /** + * The target type. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#type WorkspacePolicyGroup#type} + */ + readonly type: string; +} + +export function workspacePolicyGroupTargetsToTerraform(struct?: WorkspacePolicyGroupTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + name: cdktf.stringToTerraform(struct!.name), + type: cdktf.stringToTerraform(struct!.type), + } +} + + +export function workspacePolicyGroupTargetsToHclTerraform(struct?: WorkspacePolicyGroupTargets | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(struct!.type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspacePolicyGroupTargetsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspacePolicyGroupTargets | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._type !== undefined) { + hasAnyValues = true; + internalValueResult.type = this._type; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspacePolicyGroupTargets | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + this._name = undefined; + this._type = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + this._name = value.name; + this._type = value.type; + } + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } +} + +export class WorkspacePolicyGroupTargetsList extends cdktf.ComplexList { + public internalValue? : WorkspacePolicyGroupTargets[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspacePolicyGroupTargetsOutputReference { + return new WorkspacePolicyGroupTargetsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group huaweicloud_workspace_policy_group} +*/ +export class WorkspacePolicyGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_policy_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspacePolicyGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspacePolicyGroup to import + * @param importFromId The id of the existing WorkspacePolicyGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspacePolicyGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_policy_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_policy_group huaweicloud_workspace_policy_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspacePolicyGroupConfig + */ + public constructor(scope: Construct, id: string, config: WorkspacePolicyGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_policy_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._priority = config.priority; + this._region = config.region; + this._policy.internalValue = config.policy; + this._targets.internalValue = config.targets; + } + + // ========== + // ATTRIBUTES + // ========== + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // priority - computed: true, optional: true, required: false + private _priority?: number; + public get priority() { + return this.getNumberAttribute('priority'); + } + public set priority(value: number) { + this._priority = value; + } + public resetPriority() { + this._priority = undefined; + } + // Temporarily expose input value. Use with caution. + public get priorityInput() { + return this._priority; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // updated_at - computed: true, optional: false, required: false + public get updatedAt() { + return this.getStringAttribute('updated_at'); + } + + // policy - computed: false, optional: true, required: false + private _policy = new WorkspacePolicyGroupPolicyOutputReference(this, "policy"); + public get policy() { + return this._policy; + } + public putPolicy(value: WorkspacePolicyGroupPolicy) { + this._policy.internalValue = value; + } + public resetPolicy() { + this._policy.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get policyInput() { + return this._policy.internalValue; + } + + // targets - computed: false, optional: true, required: false + private _targets = new WorkspacePolicyGroupTargetsList(this, "targets", true); + public get targets() { + return this._targets; + } + public putTargets(value: WorkspacePolicyGroupTargets[] | cdktf.IResolvable) { + this._targets.internalValue = value; + } + public resetTargets() { + this._targets.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get targetsInput() { + return this._targets.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + priority: cdktf.numberToTerraform(this._priority), + region: cdktf.stringToTerraform(this._region), + policy: workspacePolicyGroupPolicyToTerraform(this._policy.internalValue), + targets: cdktf.listMapper(workspacePolicyGroupTargetsToTerraform, true)(this._targets.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + priority: { + value: cdktf.numberToHclTerraform(this._priority), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + policy: { + value: workspacePolicyGroupPolicyToHclTerraform(this._policy.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspacePolicyGroupPolicyList", + }, + targets: { + value: cdktf.listMapperHcl(workspacePolicyGroupTargetsToHclTerraform, true)(this._targets.internalValue), + isBlock: true, + type: "set", + storageClassType: "WorkspacePolicyGroupTargetsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-service/README.md b/src/constructs/providers/huaweicloud/workspace-service/README.md new file mode 100644 index 00000000..685f5e9a --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-service/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_service` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_service`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service). diff --git a/src/constructs/providers/huaweicloud/workspace-service/index.ts b/src/constructs/providers/huaweicloud/workspace-service/index.ts new file mode 100644 index 00000000..69758d04 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-service/index.ts @@ -0,0 +1,1542 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceServiceConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#access_mode WorkspaceService#access_mode} + */ + readonly accessMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#auth_type WorkspaceService#auth_type} + */ + readonly authType?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#dedicated_subnets WorkspaceService#dedicated_subnets} + */ + readonly dedicatedSubnets?: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#enterprise_id WorkspaceService#enterprise_id} + */ + readonly enterpriseId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#id WorkspaceService#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#internet_access_port WorkspaceService#internet_access_port} + */ + readonly internetAccessPort?: number; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#lock_enabled WorkspaceService#lock_enabled} + */ + readonly lockEnabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#management_subnet_cidr WorkspaceService#management_subnet_cidr} + */ + readonly managementSubnetCidr?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#network_ids WorkspaceService#network_ids} + */ + readonly networkIds: string[]; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#region WorkspaceService#region} + */ + readonly region?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#vpc_id WorkspaceService#vpc_id} + */ + readonly vpcId: string; + /** + * ad_domain block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#ad_domain WorkspaceService#ad_domain} + */ + readonly adDomain?: WorkspaceServiceAdDomain; + /** + * otp_config_info block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#otp_config_info WorkspaceService#otp_config_info} + */ + readonly otpConfigInfo?: WorkspaceServiceOtpConfigInfo; + /** + * timeouts block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#timeouts WorkspaceService#timeouts} + */ + readonly timeouts?: WorkspaceServiceTimeouts; +} +export interface WorkspaceServiceDesktopSecurityGroup { +} + +export function workspaceServiceDesktopSecurityGroupToTerraform(struct?: WorkspaceServiceDesktopSecurityGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function workspaceServiceDesktopSecurityGroupToHclTerraform(struct?: WorkspaceServiceDesktopSecurityGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class WorkspaceServiceDesktopSecurityGroupOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceServiceDesktopSecurityGroup | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceServiceDesktopSecurityGroup | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class WorkspaceServiceDesktopSecurityGroupList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceServiceDesktopSecurityGroupOutputReference { + return new WorkspaceServiceDesktopSecurityGroupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WorkspaceServiceInfrastructureSecurityGroup { +} + +export function workspaceServiceInfrastructureSecurityGroupToTerraform(struct?: WorkspaceServiceInfrastructureSecurityGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + } +} + + +export function workspaceServiceInfrastructureSecurityGroupToHclTerraform(struct?: WorkspaceServiceInfrastructureSecurityGroup): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + }; + return attrs; +} + +export class WorkspaceServiceInfrastructureSecurityGroupOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceServiceInfrastructureSecurityGroup | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceServiceInfrastructureSecurityGroup | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + } + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } +} + +export class WorkspaceServiceInfrastructureSecurityGroupList extends cdktf.ComplexList { + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceServiceInfrastructureSecurityGroupOutputReference { + return new WorkspaceServiceInfrastructureSecurityGroupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} +export interface WorkspaceServiceAdDomain { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#active_dns_ip WorkspaceService#active_dns_ip} + */ + readonly activeDnsIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#active_domain_ip WorkspaceService#active_domain_ip} + */ + readonly activeDomainIp: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#active_domain_name WorkspaceService#active_domain_name} + */ + readonly activeDomainName: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#admin_account WorkspaceService#admin_account} + */ + readonly adminAccount: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#delete_computer_object WorkspaceService#delete_computer_object} + */ + readonly deleteComputerObject?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#name WorkspaceService#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#password WorkspaceService#password} + */ + readonly password: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#standby_dns_ip WorkspaceService#standby_dns_ip} + */ + readonly standbyDnsIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#standby_domain_ip WorkspaceService#standby_domain_ip} + */ + readonly standbyDomainIp?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#standby_domain_name WorkspaceService#standby_domain_name} + */ + readonly standbyDomainName?: string; +} + +export function workspaceServiceAdDomainToTerraform(struct?: WorkspaceServiceAdDomainOutputReference | WorkspaceServiceAdDomain): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + active_dns_ip: cdktf.stringToTerraform(struct!.activeDnsIp), + active_domain_ip: cdktf.stringToTerraform(struct!.activeDomainIp), + active_domain_name: cdktf.stringToTerraform(struct!.activeDomainName), + admin_account: cdktf.stringToTerraform(struct!.adminAccount), + delete_computer_object: cdktf.booleanToTerraform(struct!.deleteComputerObject), + name: cdktf.stringToTerraform(struct!.name), + password: cdktf.stringToTerraform(struct!.password), + standby_dns_ip: cdktf.stringToTerraform(struct!.standbyDnsIp), + standby_domain_ip: cdktf.stringToTerraform(struct!.standbyDomainIp), + standby_domain_name: cdktf.stringToTerraform(struct!.standbyDomainName), + } +} + + +export function workspaceServiceAdDomainToHclTerraform(struct?: WorkspaceServiceAdDomainOutputReference | WorkspaceServiceAdDomain): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + active_dns_ip: { + value: cdktf.stringToHclTerraform(struct!.activeDnsIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + active_domain_ip: { + value: cdktf.stringToHclTerraform(struct!.activeDomainIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + active_domain_name: { + value: cdktf.stringToHclTerraform(struct!.activeDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + admin_account: { + value: cdktf.stringToHclTerraform(struct!.adminAccount), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete_computer_object: { + value: cdktf.booleanToHclTerraform(struct!.deleteComputerObject), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + name: { + value: cdktf.stringToHclTerraform(struct!.name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + password: { + value: cdktf.stringToHclTerraform(struct!.password), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby_dns_ip: { + value: cdktf.stringToHclTerraform(struct!.standbyDnsIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby_domain_ip: { + value: cdktf.stringToHclTerraform(struct!.standbyDomainIp), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + standby_domain_name: { + value: cdktf.stringToHclTerraform(struct!.standbyDomainName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceServiceAdDomainOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceServiceAdDomain | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._activeDnsIp !== undefined) { + hasAnyValues = true; + internalValueResult.activeDnsIp = this._activeDnsIp; + } + if (this._activeDomainIp !== undefined) { + hasAnyValues = true; + internalValueResult.activeDomainIp = this._activeDomainIp; + } + if (this._activeDomainName !== undefined) { + hasAnyValues = true; + internalValueResult.activeDomainName = this._activeDomainName; + } + if (this._adminAccount !== undefined) { + hasAnyValues = true; + internalValueResult.adminAccount = this._adminAccount; + } + if (this._deleteComputerObject !== undefined) { + hasAnyValues = true; + internalValueResult.deleteComputerObject = this._deleteComputerObject; + } + if (this._name !== undefined) { + hasAnyValues = true; + internalValueResult.name = this._name; + } + if (this._password !== undefined) { + hasAnyValues = true; + internalValueResult.password = this._password; + } + if (this._standbyDnsIp !== undefined) { + hasAnyValues = true; + internalValueResult.standbyDnsIp = this._standbyDnsIp; + } + if (this._standbyDomainIp !== undefined) { + hasAnyValues = true; + internalValueResult.standbyDomainIp = this._standbyDomainIp; + } + if (this._standbyDomainName !== undefined) { + hasAnyValues = true; + internalValueResult.standbyDomainName = this._standbyDomainName; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceServiceAdDomain | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._activeDnsIp = undefined; + this._activeDomainIp = undefined; + this._activeDomainName = undefined; + this._adminAccount = undefined; + this._deleteComputerObject = undefined; + this._name = undefined; + this._password = undefined; + this._standbyDnsIp = undefined; + this._standbyDomainIp = undefined; + this._standbyDomainName = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._activeDnsIp = value.activeDnsIp; + this._activeDomainIp = value.activeDomainIp; + this._activeDomainName = value.activeDomainName; + this._adminAccount = value.adminAccount; + this._deleteComputerObject = value.deleteComputerObject; + this._name = value.name; + this._password = value.password; + this._standbyDnsIp = value.standbyDnsIp; + this._standbyDomainIp = value.standbyDomainIp; + this._standbyDomainName = value.standbyDomainName; + } + } + + // active_dns_ip - computed: false, optional: true, required: false + private _activeDnsIp?: string; + public get activeDnsIp() { + return this.getStringAttribute('active_dns_ip'); + } + public set activeDnsIp(value: string) { + this._activeDnsIp = value; + } + public resetActiveDnsIp() { + this._activeDnsIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get activeDnsIpInput() { + return this._activeDnsIp; + } + + // active_domain_ip - computed: false, optional: false, required: true + private _activeDomainIp?: string; + public get activeDomainIp() { + return this.getStringAttribute('active_domain_ip'); + } + public set activeDomainIp(value: string) { + this._activeDomainIp = value; + } + // Temporarily expose input value. Use with caution. + public get activeDomainIpInput() { + return this._activeDomainIp; + } + + // active_domain_name - computed: false, optional: false, required: true + private _activeDomainName?: string; + public get activeDomainName() { + return this.getStringAttribute('active_domain_name'); + } + public set activeDomainName(value: string) { + this._activeDomainName = value; + } + // Temporarily expose input value. Use with caution. + public get activeDomainNameInput() { + return this._activeDomainName; + } + + // admin_account - computed: false, optional: false, required: true + private _adminAccount?: string; + public get adminAccount() { + return this.getStringAttribute('admin_account'); + } + public set adminAccount(value: string) { + this._adminAccount = value; + } + // Temporarily expose input value. Use with caution. + public get adminAccountInput() { + return this._adminAccount; + } + + // delete_computer_object - computed: true, optional: true, required: false + private _deleteComputerObject?: boolean | cdktf.IResolvable; + public get deleteComputerObject() { + return this.getBooleanAttribute('delete_computer_object'); + } + public set deleteComputerObject(value: boolean | cdktf.IResolvable) { + this._deleteComputerObject = value; + } + public resetDeleteComputerObject() { + this._deleteComputerObject = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteComputerObjectInput() { + return this._deleteComputerObject; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // password - computed: false, optional: false, required: true + private _password?: string; + public get password() { + return this.getStringAttribute('password'); + } + public set password(value: string) { + this._password = value; + } + // Temporarily expose input value. Use with caution. + public get passwordInput() { + return this._password; + } + + // standby_dns_ip - computed: false, optional: true, required: false + private _standbyDnsIp?: string; + public get standbyDnsIp() { + return this.getStringAttribute('standby_dns_ip'); + } + public set standbyDnsIp(value: string) { + this._standbyDnsIp = value; + } + public resetStandbyDnsIp() { + this._standbyDnsIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get standbyDnsIpInput() { + return this._standbyDnsIp; + } + + // standby_domain_ip - computed: false, optional: true, required: false + private _standbyDomainIp?: string; + public get standbyDomainIp() { + return this.getStringAttribute('standby_domain_ip'); + } + public set standbyDomainIp(value: string) { + this._standbyDomainIp = value; + } + public resetStandbyDomainIp() { + this._standbyDomainIp = undefined; + } + // Temporarily expose input value. Use with caution. + public get standbyDomainIpInput() { + return this._standbyDomainIp; + } + + // standby_domain_name - computed: false, optional: true, required: false + private _standbyDomainName?: string; + public get standbyDomainName() { + return this.getStringAttribute('standby_domain_name'); + } + public set standbyDomainName(value: string) { + this._standbyDomainName = value; + } + public resetStandbyDomainName() { + this._standbyDomainName = undefined; + } + // Temporarily expose input value. Use with caution. + public get standbyDomainNameInput() { + return this._standbyDomainName; + } +} +export interface WorkspaceServiceOtpConfigInfo { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#app_id WorkspaceService#app_id} + */ + readonly appId?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#app_secret WorkspaceService#app_secret} + */ + readonly appSecret?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#auth_server_access_mode WorkspaceService#auth_server_access_mode} + */ + readonly authServerAccessMode?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#auth_url WorkspaceService#auth_url} + */ + readonly authUrl?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#cert_content WorkspaceService#cert_content} + */ + readonly certContent?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#enable WorkspaceService#enable} + */ + readonly enable: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#receive_mode WorkspaceService#receive_mode} + */ + readonly receiveMode: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#rule WorkspaceService#rule} + */ + readonly rule?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#rule_type WorkspaceService#rule_type} + */ + readonly ruleType?: string; +} + +export function workspaceServiceOtpConfigInfoToTerraform(struct?: WorkspaceServiceOtpConfigInfoOutputReference | WorkspaceServiceOtpConfigInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + app_id: cdktf.stringToTerraform(struct!.appId), + app_secret: cdktf.stringToTerraform(struct!.appSecret), + auth_server_access_mode: cdktf.stringToTerraform(struct!.authServerAccessMode), + auth_url: cdktf.stringToTerraform(struct!.authUrl), + cert_content: cdktf.stringToTerraform(struct!.certContent), + enable: cdktf.booleanToTerraform(struct!.enable), + receive_mode: cdktf.stringToTerraform(struct!.receiveMode), + rule: cdktf.stringToTerraform(struct!.rule), + rule_type: cdktf.stringToTerraform(struct!.ruleType), + } +} + + +export function workspaceServiceOtpConfigInfoToHclTerraform(struct?: WorkspaceServiceOtpConfigInfoOutputReference | WorkspaceServiceOtpConfigInfo): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + app_id: { + value: cdktf.stringToHclTerraform(struct!.appId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + app_secret: { + value: cdktf.stringToHclTerraform(struct!.appSecret), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_server_access_mode: { + value: cdktf.stringToHclTerraform(struct!.authServerAccessMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_url: { + value: cdktf.stringToHclTerraform(struct!.authUrl), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + cert_content: { + value: cdktf.stringToHclTerraform(struct!.certContent), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable: { + value: cdktf.booleanToHclTerraform(struct!.enable), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + receive_mode: { + value: cdktf.stringToHclTerraform(struct!.receiveMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule: { + value: cdktf.stringToHclTerraform(struct!.rule), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + rule_type: { + value: cdktf.stringToHclTerraform(struct!.ruleType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceServiceOtpConfigInfoOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false, 0); + } + + public get internalValue(): WorkspaceServiceOtpConfigInfo | undefined { + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._appId !== undefined) { + hasAnyValues = true; + internalValueResult.appId = this._appId; + } + if (this._appSecret !== undefined) { + hasAnyValues = true; + internalValueResult.appSecret = this._appSecret; + } + if (this._authServerAccessMode !== undefined) { + hasAnyValues = true; + internalValueResult.authServerAccessMode = this._authServerAccessMode; + } + if (this._authUrl !== undefined) { + hasAnyValues = true; + internalValueResult.authUrl = this._authUrl; + } + if (this._certContent !== undefined) { + hasAnyValues = true; + internalValueResult.certContent = this._certContent; + } + if (this._enable !== undefined) { + hasAnyValues = true; + internalValueResult.enable = this._enable; + } + if (this._receiveMode !== undefined) { + hasAnyValues = true; + internalValueResult.receiveMode = this._receiveMode; + } + if (this._rule !== undefined) { + hasAnyValues = true; + internalValueResult.rule = this._rule; + } + if (this._ruleType !== undefined) { + hasAnyValues = true; + internalValueResult.ruleType = this._ruleType; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceServiceOtpConfigInfo | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this._appId = undefined; + this._appSecret = undefined; + this._authServerAccessMode = undefined; + this._authUrl = undefined; + this._certContent = undefined; + this._enable = undefined; + this._receiveMode = undefined; + this._rule = undefined; + this._ruleType = undefined; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this._appId = value.appId; + this._appSecret = value.appSecret; + this._authServerAccessMode = value.authServerAccessMode; + this._authUrl = value.authUrl; + this._certContent = value.certContent; + this._enable = value.enable; + this._receiveMode = value.receiveMode; + this._rule = value.rule; + this._ruleType = value.ruleType; + } + } + + // app_id - computed: false, optional: true, required: false + private _appId?: string; + public get appId() { + return this.getStringAttribute('app_id'); + } + public set appId(value: string) { + this._appId = value; + } + public resetAppId() { + this._appId = undefined; + } + // Temporarily expose input value. Use with caution. + public get appIdInput() { + return this._appId; + } + + // app_secret - computed: false, optional: true, required: false + private _appSecret?: string; + public get appSecret() { + return this.getStringAttribute('app_secret'); + } + public set appSecret(value: string) { + this._appSecret = value; + } + public resetAppSecret() { + this._appSecret = undefined; + } + // Temporarily expose input value. Use with caution. + public get appSecretInput() { + return this._appSecret; + } + + // auth_server_access_mode - computed: false, optional: true, required: false + private _authServerAccessMode?: string; + public get authServerAccessMode() { + return this.getStringAttribute('auth_server_access_mode'); + } + public set authServerAccessMode(value: string) { + this._authServerAccessMode = value; + } + public resetAuthServerAccessMode() { + this._authServerAccessMode = undefined; + } + // Temporarily expose input value. Use with caution. + public get authServerAccessModeInput() { + return this._authServerAccessMode; + } + + // auth_url - computed: false, optional: true, required: false + private _authUrl?: string; + public get authUrl() { + return this.getStringAttribute('auth_url'); + } + public set authUrl(value: string) { + this._authUrl = value; + } + public resetAuthUrl() { + this._authUrl = undefined; + } + // Temporarily expose input value. Use with caution. + public get authUrlInput() { + return this._authUrl; + } + + // cert_content - computed: false, optional: true, required: false + private _certContent?: string; + public get certContent() { + return this.getStringAttribute('cert_content'); + } + public set certContent(value: string) { + this._certContent = value; + } + public resetCertContent() { + this._certContent = undefined; + } + // Temporarily expose input value. Use with caution. + public get certContentInput() { + return this._certContent; + } + + // enable - computed: false, optional: false, required: true + private _enable?: boolean | cdktf.IResolvable; + public get enable() { + return this.getBooleanAttribute('enable'); + } + public set enable(value: boolean | cdktf.IResolvable) { + this._enable = value; + } + // Temporarily expose input value. Use with caution. + public get enableInput() { + return this._enable; + } + + // receive_mode - computed: false, optional: false, required: true + private _receiveMode?: string; + public get receiveMode() { + return this.getStringAttribute('receive_mode'); + } + public set receiveMode(value: string) { + this._receiveMode = value; + } + // Temporarily expose input value. Use with caution. + public get receiveModeInput() { + return this._receiveMode; + } + + // rule - computed: false, optional: true, required: false + private _rule?: string; + public get rule() { + return this.getStringAttribute('rule'); + } + public set rule(value: string) { + this._rule = value; + } + public resetRule() { + this._rule = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleInput() { + return this._rule; + } + + // rule_type - computed: false, optional: true, required: false + private _ruleType?: string; + public get ruleType() { + return this.getStringAttribute('rule_type'); + } + public set ruleType(value: string) { + this._ruleType = value; + } + public resetRuleType() { + this._ruleType = undefined; + } + // Temporarily expose input value. Use with caution. + public get ruleTypeInput() { + return this._ruleType; + } +} +export interface WorkspaceServiceTimeouts { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#create WorkspaceService#create} + */ + readonly create?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#delete WorkspaceService#delete} + */ + readonly delete?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#update WorkspaceService#update} + */ + readonly update?: string; +} + +export function workspaceServiceTimeoutsToTerraform(struct?: WorkspaceServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + create: cdktf.stringToTerraform(struct!.create), + delete: cdktf.stringToTerraform(struct!.delete), + update: cdktf.stringToTerraform(struct!.update), + } +} + + +export function workspaceServiceTimeoutsToHclTerraform(struct?: WorkspaceServiceTimeouts | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + create: { + value: cdktf.stringToHclTerraform(struct!.create), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + delete: { + value: cdktf.stringToHclTerraform(struct!.delete), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + update: { + value: cdktf.stringToHclTerraform(struct!.update), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceServiceTimeoutsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) { + super(terraformResource, terraformAttribute, false); + } + + public get internalValue(): WorkspaceServiceTimeouts | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._create !== undefined) { + hasAnyValues = true; + internalValueResult.create = this._create; + } + if (this._delete !== undefined) { + hasAnyValues = true; + internalValueResult.delete = this._delete; + } + if (this._update !== undefined) { + hasAnyValues = true; + internalValueResult.update = this._update; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceServiceTimeouts | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._create = undefined; + this._delete = undefined; + this._update = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._create = value.create; + this._delete = value.delete; + this._update = value.update; + } + } + + // create - computed: false, optional: true, required: false + private _create?: string; + public get create() { + return this.getStringAttribute('create'); + } + public set create(value: string) { + this._create = value; + } + public resetCreate() { + this._create = undefined; + } + // Temporarily expose input value. Use with caution. + public get createInput() { + return this._create; + } + + // delete - computed: false, optional: true, required: false + private _delete?: string; + public get delete() { + return this.getStringAttribute('delete'); + } + public set delete(value: string) { + this._delete = value; + } + public resetDelete() { + this._delete = undefined; + } + // Temporarily expose input value. Use with caution. + public get deleteInput() { + return this._delete; + } + + // update - computed: false, optional: true, required: false + private _update?: string; + public get update() { + return this.getStringAttribute('update'); + } + public set update(value: string) { + this._update = value; + } + public resetUpdate() { + this._update = undefined; + } + // Temporarily expose input value. Use with caution. + public get updateInput() { + return this._update; + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service huaweicloud_workspace_service} +*/ +export class WorkspaceService extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_service"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceService resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceService to import + * @param importFromId The id of the existing WorkspaceService that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceService to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_service", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_service huaweicloud_workspace_service} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceServiceConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceServiceConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_service', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accessMode = config.accessMode; + this._authType = config.authType; + this._dedicatedSubnets = config.dedicatedSubnets; + this._enterpriseId = config.enterpriseId; + this._id = config.id; + this._internetAccessPort = config.internetAccessPort; + this._lockEnabled = config.lockEnabled; + this._managementSubnetCidr = config.managementSubnetCidr; + this._networkIds = config.networkIds; + this._region = config.region; + this._vpcId = config.vpcId; + this._adDomain.internalValue = config.adDomain; + this._otpConfigInfo.internalValue = config.otpConfigInfo; + this._timeouts.internalValue = config.timeouts; + } + + // ========== + // ATTRIBUTES + // ========== + + // access_mode - computed: false, optional: false, required: true + private _accessMode?: string; + public get accessMode() { + return this.getStringAttribute('access_mode'); + } + public set accessMode(value: string) { + this._accessMode = value; + } + // Temporarily expose input value. Use with caution. + public get accessModeInput() { + return this._accessMode; + } + + // auth_type - computed: false, optional: true, required: false + private _authType?: string; + public get authType() { + return this.getStringAttribute('auth_type'); + } + public set authType(value: string) { + this._authType = value; + } + public resetAuthType() { + this._authType = undefined; + } + // Temporarily expose input value. Use with caution. + public get authTypeInput() { + return this._authType; + } + + // dedicated_subnets - computed: true, optional: true, required: false + private _dedicatedSubnets?: string[]; + public get dedicatedSubnets() { + return this.getListAttribute('dedicated_subnets'); + } + public set dedicatedSubnets(value: string[]) { + this._dedicatedSubnets = value; + } + public resetDedicatedSubnets() { + this._dedicatedSubnets = undefined; + } + // Temporarily expose input value. Use with caution. + public get dedicatedSubnetsInput() { + return this._dedicatedSubnets; + } + + // desktop_security_group - computed: true, optional: false, required: false + private _desktopSecurityGroup = new WorkspaceServiceDesktopSecurityGroupList(this, "desktop_security_group", false); + public get desktopSecurityGroup() { + return this._desktopSecurityGroup; + } + + // enterprise_id - computed: true, optional: true, required: false + private _enterpriseId?: string; + public get enterpriseId() { + return this.getStringAttribute('enterprise_id'); + } + public set enterpriseId(value: string) { + this._enterpriseId = value; + } + public resetEnterpriseId() { + this._enterpriseId = undefined; + } + // Temporarily expose input value. Use with caution. + public get enterpriseIdInput() { + return this._enterpriseId; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // infrastructure_security_group - computed: true, optional: false, required: false + private _infrastructureSecurityGroup = new WorkspaceServiceInfrastructureSecurityGroupList(this, "infrastructure_security_group", false); + public get infrastructureSecurityGroup() { + return this._infrastructureSecurityGroup; + } + + // internet_access_address - computed: true, optional: false, required: false + public get internetAccessAddress() { + return this.getStringAttribute('internet_access_address'); + } + + // internet_access_port - computed: true, optional: true, required: false + private _internetAccessPort?: number; + public get internetAccessPort() { + return this.getNumberAttribute('internet_access_port'); + } + public set internetAccessPort(value: number) { + this._internetAccessPort = value; + } + public resetInternetAccessPort() { + this._internetAccessPort = undefined; + } + // Temporarily expose input value. Use with caution. + public get internetAccessPortInput() { + return this._internetAccessPort; + } + + // is_locked - computed: true, optional: false, required: false + public get isLocked() { + return this.getNumberAttribute('is_locked'); + } + + // lock_enabled - computed: false, optional: true, required: false + private _lockEnabled?: boolean | cdktf.IResolvable; + public get lockEnabled() { + return this.getBooleanAttribute('lock_enabled'); + } + public set lockEnabled(value: boolean | cdktf.IResolvable) { + this._lockEnabled = value; + } + public resetLockEnabled() { + this._lockEnabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get lockEnabledInput() { + return this._lockEnabled; + } + + // lock_reason - computed: true, optional: false, required: false + public get lockReason() { + return this.getStringAttribute('lock_reason'); + } + + // lock_time - computed: true, optional: false, required: false + public get lockTime() { + return this.getStringAttribute('lock_time'); + } + + // management_subnet_cidr - computed: true, optional: true, required: false + private _managementSubnetCidr?: string; + public get managementSubnetCidr() { + return this.getStringAttribute('management_subnet_cidr'); + } + public set managementSubnetCidr(value: string) { + this._managementSubnetCidr = value; + } + public resetManagementSubnetCidr() { + this._managementSubnetCidr = undefined; + } + // Temporarily expose input value. Use with caution. + public get managementSubnetCidrInput() { + return this._managementSubnetCidr; + } + + // network_ids - computed: false, optional: false, required: true + private _networkIds?: string[]; + public get networkIds() { + return this.getListAttribute('network_ids'); + } + public set networkIds(value: string[]) { + this._networkIds = value; + } + // Temporarily expose input value. Use with caution. + public get networkIdsInput() { + return this._networkIds; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // status - computed: true, optional: false, required: false + public get status() { + return this.getStringAttribute('status'); + } + + // vpc_id - computed: false, optional: false, required: true + private _vpcId?: string; + public get vpcId() { + return this.getStringAttribute('vpc_id'); + } + public set vpcId(value: string) { + this._vpcId = value; + } + // Temporarily expose input value. Use with caution. + public get vpcIdInput() { + return this._vpcId; + } + + // ad_domain - computed: false, optional: true, required: false + private _adDomain = new WorkspaceServiceAdDomainOutputReference(this, "ad_domain"); + public get adDomain() { + return this._adDomain; + } + public putAdDomain(value: WorkspaceServiceAdDomain) { + this._adDomain.internalValue = value; + } + public resetAdDomain() { + this._adDomain.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get adDomainInput() { + return this._adDomain.internalValue; + } + + // otp_config_info - computed: false, optional: true, required: false + private _otpConfigInfo = new WorkspaceServiceOtpConfigInfoOutputReference(this, "otp_config_info"); + public get otpConfigInfo() { + return this._otpConfigInfo; + } + public putOtpConfigInfo(value: WorkspaceServiceOtpConfigInfo) { + this._otpConfigInfo.internalValue = value; + } + public resetOtpConfigInfo() { + this._otpConfigInfo.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get otpConfigInfoInput() { + return this._otpConfigInfo.internalValue; + } + + // timeouts - computed: false, optional: true, required: false + private _timeouts = new WorkspaceServiceTimeoutsOutputReference(this, "timeouts"); + public get timeouts() { + return this._timeouts; + } + public putTimeouts(value: WorkspaceServiceTimeouts) { + this._timeouts.internalValue = value; + } + public resetTimeouts() { + this._timeouts.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get timeoutsInput() { + return this._timeouts.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + access_mode: cdktf.stringToTerraform(this._accessMode), + auth_type: cdktf.stringToTerraform(this._authType), + dedicated_subnets: cdktf.listMapper(cdktf.stringToTerraform, false)(this._dedicatedSubnets), + enterprise_id: cdktf.stringToTerraform(this._enterpriseId), + id: cdktf.stringToTerraform(this._id), + internet_access_port: cdktf.numberToTerraform(this._internetAccessPort), + lock_enabled: cdktf.booleanToTerraform(this._lockEnabled), + management_subnet_cidr: cdktf.stringToTerraform(this._managementSubnetCidr), + network_ids: cdktf.listMapper(cdktf.stringToTerraform, false)(this._networkIds), + region: cdktf.stringToTerraform(this._region), + vpc_id: cdktf.stringToTerraform(this._vpcId), + ad_domain: workspaceServiceAdDomainToTerraform(this._adDomain.internalValue), + otp_config_info: workspaceServiceOtpConfigInfoToTerraform(this._otpConfigInfo.internalValue), + timeouts: workspaceServiceTimeoutsToTerraform(this._timeouts.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + access_mode: { + value: cdktf.stringToHclTerraform(this._accessMode), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + auth_type: { + value: cdktf.stringToHclTerraform(this._authType), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + dedicated_subnets: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._dedicatedSubnets), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + enterprise_id: { + value: cdktf.stringToHclTerraform(this._enterpriseId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + internet_access_port: { + value: cdktf.numberToHclTerraform(this._internetAccessPort), + isBlock: false, + type: "simple", + storageClassType: "number", + }, + lock_enabled: { + value: cdktf.booleanToHclTerraform(this._lockEnabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + management_subnet_cidr: { + value: cdktf.stringToHclTerraform(this._managementSubnetCidr), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + network_ids: { + value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._networkIds), + isBlock: false, + type: "list", + storageClassType: "stringList", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + vpc_id: { + value: cdktf.stringToHclTerraform(this._vpcId), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + ad_domain: { + value: workspaceServiceAdDomainToHclTerraform(this._adDomain.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceServiceAdDomainList", + }, + otp_config_info: { + value: workspaceServiceOtpConfigInfoToHclTerraform(this._otpConfigInfo.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceServiceOtpConfigInfoList", + }, + timeouts: { + value: workspaceServiceTimeoutsToHclTerraform(this._timeouts.internalValue), + isBlock: true, + type: "struct", + storageClassType: "WorkspaceServiceTimeouts", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-terminal-binding/README.md b/src/constructs/providers/huaweicloud/workspace-terminal-binding/README.md new file mode 100644 index 00000000..dae33526 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-terminal-binding/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_terminal_binding` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_terminal_binding`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding). diff --git a/src/constructs/providers/huaweicloud/workspace-terminal-binding/index.ts b/src/constructs/providers/huaweicloud/workspace-terminal-binding/index.ts new file mode 100644 index 00000000..f5bcb6c7 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-terminal-binding/index.ts @@ -0,0 +1,420 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceTerminalBindingConfig extends cdktf.TerraformMetaArguments { + /** + * Whether disabled the binding function before destroy resource. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#disabled_after_delete WorkspaceTerminalBinding#disabled_after_delete} + */ + readonly disabledAfterDelete?: boolean | cdktf.IResolvable; + /** + * Whether bindings are available. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#enabled WorkspaceTerminalBinding#enabled} + */ + readonly enabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#id WorkspaceTerminalBinding#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The region where the desktops (to be bound to the MAC address) are located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#region WorkspaceTerminalBinding#region} + */ + readonly region?: string; + /** + * bindings block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#bindings WorkspaceTerminalBinding#bindings} + */ + readonly bindings: WorkspaceTerminalBindingBindings[] | cdktf.IResolvable; +} +export interface WorkspaceTerminalBindingBindings { + /** + * The binding description. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#description WorkspaceTerminalBinding#description} + */ + readonly description?: string; + /** + * The desktop name. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#desktop_name WorkspaceTerminalBinding#desktop_name} + */ + readonly desktopName: string; + /** + * The MAC address. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#mac WorkspaceTerminalBinding#mac} + */ + readonly mac: string; +} + +export function workspaceTerminalBindingBindingsToTerraform(struct?: WorkspaceTerminalBindingBindings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + description: cdktf.stringToTerraform(struct!.description), + desktop_name: cdktf.stringToTerraform(struct!.desktopName), + mac: cdktf.stringToTerraform(struct!.mac), + } +} + + +export function workspaceTerminalBindingBindingsToHclTerraform(struct?: WorkspaceTerminalBindingBindings | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + description: { + value: cdktf.stringToHclTerraform(struct!.description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + desktop_name: { + value: cdktf.stringToHclTerraform(struct!.desktopName), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + mac: { + value: cdktf.stringToHclTerraform(struct!.mac), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceTerminalBindingBindingsOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceTerminalBindingBindings | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._description !== undefined) { + hasAnyValues = true; + internalValueResult.description = this._description; + } + if (this._desktopName !== undefined) { + hasAnyValues = true; + internalValueResult.desktopName = this._desktopName; + } + if (this._mac !== undefined) { + hasAnyValues = true; + internalValueResult.mac = this._mac; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceTerminalBindingBindings | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._description = undefined; + this._desktopName = undefined; + this._mac = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._description = value.description; + this._desktopName = value.desktopName; + this._mac = value.mac; + } + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // desktop_name - computed: false, optional: false, required: true + private _desktopName?: string; + public get desktopName() { + return this.getStringAttribute('desktop_name'); + } + public set desktopName(value: string) { + this._desktopName = value; + } + // Temporarily expose input value. Use with caution. + public get desktopNameInput() { + return this._desktopName; + } + + // id - computed: true, optional: false, required: false + public get id() { + return this.getStringAttribute('id'); + } + + // mac - computed: false, optional: false, required: true + private _mac?: string; + public get mac() { + return this.getStringAttribute('mac'); + } + public set mac(value: string) { + this._mac = value; + } + // Temporarily expose input value. Use with caution. + public get macInput() { + return this._mac; + } +} + +export class WorkspaceTerminalBindingBindingsList extends cdktf.ComplexList { + public internalValue? : WorkspaceTerminalBindingBindings[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceTerminalBindingBindingsOutputReference { + return new WorkspaceTerminalBindingBindingsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding huaweicloud_workspace_terminal_binding} +*/ +export class WorkspaceTerminalBinding extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_terminal_binding"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceTerminalBinding resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceTerminalBinding to import + * @param importFromId The id of the existing WorkspaceTerminalBinding that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceTerminalBinding to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_terminal_binding", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_terminal_binding huaweicloud_workspace_terminal_binding} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceTerminalBindingConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceTerminalBindingConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_terminal_binding', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._disabledAfterDelete = config.disabledAfterDelete; + this._enabled = config.enabled; + this._id = config.id; + this._region = config.region; + this._bindings.internalValue = config.bindings; + } + + // ========== + // ATTRIBUTES + // ========== + + // disabled_after_delete - computed: false, optional: true, required: false + private _disabledAfterDelete?: boolean | cdktf.IResolvable; + public get disabledAfterDelete() { + return this.getBooleanAttribute('disabled_after_delete'); + } + public set disabledAfterDelete(value: boolean | cdktf.IResolvable) { + this._disabledAfterDelete = value; + } + public resetDisabledAfterDelete() { + this._disabledAfterDelete = undefined; + } + // Temporarily expose input value. Use with caution. + public get disabledAfterDeleteInput() { + return this._disabledAfterDelete; + } + + // enabled - computed: true, optional: true, required: false + private _enabled?: boolean | cdktf.IResolvable; + public get enabled() { + return this.getBooleanAttribute('enabled'); + } + public set enabled(value: boolean | cdktf.IResolvable) { + this._enabled = value; + } + public resetEnabled() { + this._enabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get enabledInput() { + return this._enabled; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // bindings - computed: false, optional: false, required: true + private _bindings = new WorkspaceTerminalBindingBindingsList(this, "bindings", true); + public get bindings() { + return this._bindings; + } + public putBindings(value: WorkspaceTerminalBindingBindings[] | cdktf.IResolvable) { + this._bindings.internalValue = value; + } + // Temporarily expose input value. Use with caution. + public get bindingsInput() { + return this._bindings.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + disabled_after_delete: cdktf.booleanToTerraform(this._disabledAfterDelete), + enabled: cdktf.booleanToTerraform(this._enabled), + id: cdktf.stringToTerraform(this._id), + region: cdktf.stringToTerraform(this._region), + bindings: cdktf.listMapper(workspaceTerminalBindingBindingsToTerraform, true)(this._bindings.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + disabled_after_delete: { + value: cdktf.booleanToHclTerraform(this._disabledAfterDelete), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + enabled: { + value: cdktf.booleanToHclTerraform(this._enabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + bindings: { + value: cdktf.listMapperHcl(workspaceTerminalBindingBindingsToHclTerraform, true)(this._bindings.internalValue), + isBlock: true, + type: "set", + storageClassType: "WorkspaceTerminalBindingBindingsList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-user-group/README.md b/src/constructs/providers/huaweicloud/workspace-user-group/README.md new file mode 100644 index 00000000..dc97f190 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-user-group/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_user_group` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_user_group`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group). diff --git a/src/constructs/providers/huaweicloud/workspace-user-group/index.ts b/src/constructs/providers/huaweicloud/workspace-user-group/index.ts new file mode 100644 index 00000000..aa8dd5ec --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-user-group/index.ts @@ -0,0 +1,408 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceUserGroupConfig extends cdktf.TerraformMetaArguments { + /** + * The description of the user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#description WorkspaceUserGroup#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#id WorkspaceUserGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * The name of the user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#name WorkspaceUserGroup#name} + */ + readonly name: string; + /** + * The region where the user group is located. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#region WorkspaceUserGroup#region} + */ + readonly region?: string; + /** + * The type of the user group. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#type WorkspaceUserGroup#type} + */ + readonly type: string; + /** + * users block + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#users WorkspaceUserGroup#users} + */ + readonly users?: WorkspaceUserGroupUsers[] | cdktf.IResolvable; +} +export interface WorkspaceUserGroupUsers { + /** + * The ID of user. + * + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#id WorkspaceUserGroup#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id: string; +} + +export function workspaceUserGroupUsersToTerraform(struct?: WorkspaceUserGroupUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + return { + id: cdktf.stringToTerraform(struct!.id), + } +} + + +export function workspaceUserGroupUsersToHclTerraform(struct?: WorkspaceUserGroupUsers | cdktf.IResolvable): any { + if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } + if (cdktf.isComplexElement(struct)) { + throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); + } + const attrs = { + id: { + value: cdktf.stringToHclTerraform(struct!.id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); +} + +export class WorkspaceUserGroupUsersOutputReference extends cdktf.ComplexObject { + private isEmptyObject = false; + private resolvableValue?: cdktf.IResolvable; + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param complexObjectIndex the index of this item in the list + * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean) { + super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); + } + + public get internalValue(): WorkspaceUserGroupUsers | cdktf.IResolvable | undefined { + if (this.resolvableValue) { + return this.resolvableValue; + } + let hasAnyValues = this.isEmptyObject; + const internalValueResult: any = {}; + if (this._id !== undefined) { + hasAnyValues = true; + internalValueResult.id = this._id; + } + return hasAnyValues ? internalValueResult : undefined; + } + + public set internalValue(value: WorkspaceUserGroupUsers | cdktf.IResolvable | undefined) { + if (value === undefined) { + this.isEmptyObject = false; + this.resolvableValue = undefined; + this._id = undefined; + } + else if (cdktf.Tokenization.isResolvable(value)) { + this.isEmptyObject = false; + this.resolvableValue = value; + } + else { + this.isEmptyObject = Object.keys(value).length === 0; + this.resolvableValue = undefined; + this._id = value.id; + } + } + + // description - computed: true, optional: false, required: false + public get description() { + return this.getStringAttribute('description'); + } + + // email - computed: true, optional: false, required: false + public get email() { + return this.getStringAttribute('email'); + } + + // id - computed: false, optional: false, required: true + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: true, optional: false, required: false + public get name() { + return this.getStringAttribute('name'); + } + + // phone - computed: true, optional: false, required: false + public get phone() { + return this.getStringAttribute('phone'); + } + + // total_desktops - computed: true, optional: false, required: false + public get totalDesktops() { + return this.getNumberAttribute('total_desktops'); + } +} + +export class WorkspaceUserGroupUsersList extends cdktf.ComplexList { + public internalValue? : WorkspaceUserGroupUsers[] | cdktf.IResolvable + + /** + * @param terraformResource The parent resource + * @param terraformAttribute The attribute on the parent resource this class is referencing + * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) + */ + constructor(protected terraformResource: cdktf.IInterpolatingParent, protected terraformAttribute: string, protected wrapsSet: boolean) { + super(terraformResource, terraformAttribute, wrapsSet) + } + + /** + * @param index the index of the item to return + */ + public get(index: number): WorkspaceUserGroupUsersOutputReference { + return new WorkspaceUserGroupUsersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); + } +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group huaweicloud_workspace_user_group} +*/ +export class WorkspaceUserGroup extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_user_group"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceUserGroup resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceUserGroup to import + * @param importFromId The id of the existing WorkspaceUserGroup that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceUserGroup to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_user_group", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user_group huaweicloud_workspace_user_group} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceUserGroupConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceUserGroupConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_user_group', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._description = config.description; + this._id = config.id; + this._name = config.name; + this._region = config.region; + this._type = config.type; + this._users.internalValue = config.users; + } + + // ========== + // ATTRIBUTES + // ========== + + // created_at - computed: true, optional: false, required: false + public get createdAt() { + return this.getStringAttribute('created_at'); + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // type - computed: false, optional: false, required: true + private _type?: string; + public get type() { + return this.getStringAttribute('type'); + } + public set type(value: string) { + this._type = value; + } + // Temporarily expose input value. Use with caution. + public get typeInput() { + return this._type; + } + + // users - computed: false, optional: true, required: false + private _users = new WorkspaceUserGroupUsersList(this, "users", false); + public get users() { + return this._users; + } + public putUsers(value: WorkspaceUserGroupUsers[] | cdktf.IResolvable) { + this._users.internalValue = value; + } + public resetUsers() { + this._users.internalValue = undefined; + } + // Temporarily expose input value. Use with caution. + public get usersInput() { + return this._users.internalValue; + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + description: cdktf.stringToTerraform(this._description), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + region: cdktf.stringToTerraform(this._region), + type: cdktf.stringToTerraform(this._type), + users: cdktf.listMapper(workspaceUserGroupUsersToTerraform, true)(this._users.internalValue), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + type: { + value: cdktf.stringToHclTerraform(this._type), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + users: { + value: cdktf.listMapperHcl(workspaceUserGroupUsersToHclTerraform, true)(this._users.internalValue), + isBlock: true, + type: "list", + storageClassType: "WorkspaceUserGroupUsersList", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/providers/huaweicloud/workspace-user/README.md b/src/constructs/providers/huaweicloud/workspace-user/README.md new file mode 100644 index 00000000..ea16b63c --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-user/README.md @@ -0,0 +1,3 @@ +# `huaweicloud_workspace_user` + +Refer to the Terraform Registry for docs: [`huaweicloud_workspace_user`](https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user). diff --git a/src/constructs/providers/huaweicloud/workspace-user/index.ts b/src/constructs/providers/huaweicloud/workspace-user/index.ts new file mode 100644 index 00000000..40167bd3 --- /dev/null +++ b/src/constructs/providers/huaweicloud/workspace-user/index.ts @@ -0,0 +1,372 @@ +// https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user +// generated from terraform resource schema + +import { Construct } from 'constructs'; +import * as cdktf from 'cdktf'; + +// Configuration + +export interface WorkspaceUserConfig extends cdktf.TerraformMetaArguments { + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#account_expires WorkspaceUser#account_expires} + */ + readonly accountExpires?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#description WorkspaceUser#description} + */ + readonly description?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#disabled WorkspaceUser#disabled} + */ + readonly disabled?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#email WorkspaceUser#email} + */ + readonly email: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#enable_change_password WorkspaceUser#enable_change_password} + */ + readonly enableChangePassword?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#id WorkspaceUser#id} + * + * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. + * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. + */ + readonly id?: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#name WorkspaceUser#name} + */ + readonly name: string; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#next_login_change_password WorkspaceUser#next_login_change_password} + */ + readonly nextLoginChangePassword?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#password_never_expires WorkspaceUser#password_never_expires} + */ + readonly passwordNeverExpires?: boolean | cdktf.IResolvable; + /** + * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#region WorkspaceUser#region} + */ + readonly region?: string; +} + +/** +* Represents a {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user huaweicloud_workspace_user} +*/ +export class WorkspaceUser extends cdktf.TerraformResource { + + // ================= + // STATIC PROPERTIES + // ================= + public static readonly tfResourceType = "huaweicloud_workspace_user"; + + // ============== + // STATIC Methods + // ============== + /** + * Generates CDKTF code for importing a WorkspaceUser resource upon running "cdktf plan " + * @param scope The scope in which to define this construct + * @param importToId The construct id used in the generated config for the WorkspaceUser to import + * @param importFromId The id of the existing WorkspaceUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user#import import section} in the documentation of this resource for the id to use + * @param provider? Optional instance of the provider where the WorkspaceUser to import is found + */ + public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktf.TerraformProvider) { + return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "huaweicloud_workspace_user", importId: importFromId, provider }); + } + + // =========== + // INITIALIZER + // =========== + + /** + * Create a new {@link https://registry.terraform.io/providers/huaweicloud/huaweicloud/1.71.1/docs/resources/workspace_user huaweicloud_workspace_user} Resource + * + * @param scope The scope in which to define this construct + * @param id The scoped construct ID. Must be unique amongst siblings in the same scope + * @param options WorkspaceUserConfig + */ + public constructor(scope: Construct, id: string, config: WorkspaceUserConfig) { + super(scope, id, { + terraformResourceType: 'huaweicloud_workspace_user', + terraformGeneratorMetadata: { + providerName: 'huaweicloud', + providerVersion: '1.71.1', + providerVersionConstraint: '~> 1.71' + }, + provider: config.provider, + dependsOn: config.dependsOn, + count: config.count, + lifecycle: config.lifecycle, + provisioners: config.provisioners, + connection: config.connection, + forEach: config.forEach + }); + this._accountExpires = config.accountExpires; + this._description = config.description; + this._disabled = config.disabled; + this._email = config.email; + this._enableChangePassword = config.enableChangePassword; + this._id = config.id; + this._name = config.name; + this._nextLoginChangePassword = config.nextLoginChangePassword; + this._passwordNeverExpires = config.passwordNeverExpires; + this._region = config.region; + } + + // ========== + // ATTRIBUTES + // ========== + + // account_expires - computed: false, optional: true, required: false + private _accountExpires?: string; + public get accountExpires() { + return this.getStringAttribute('account_expires'); + } + public set accountExpires(value: string) { + this._accountExpires = value; + } + public resetAccountExpires() { + this._accountExpires = undefined; + } + // Temporarily expose input value. Use with caution. + public get accountExpiresInput() { + return this._accountExpires; + } + + // description - computed: false, optional: true, required: false + private _description?: string; + public get description() { + return this.getStringAttribute('description'); + } + public set description(value: string) { + this._description = value; + } + public resetDescription() { + this._description = undefined; + } + // Temporarily expose input value. Use with caution. + public get descriptionInput() { + return this._description; + } + + // disabled - computed: false, optional: true, required: false + private _disabled?: boolean | cdktf.IResolvable; + public get disabled() { + return this.getBooleanAttribute('disabled'); + } + public set disabled(value: boolean | cdktf.IResolvable) { + this._disabled = value; + } + public resetDisabled() { + this._disabled = undefined; + } + // Temporarily expose input value. Use with caution. + public get disabledInput() { + return this._disabled; + } + + // email - computed: false, optional: false, required: true + private _email?: string; + public get email() { + return this.getStringAttribute('email'); + } + public set email(value: string) { + this._email = value; + } + // Temporarily expose input value. Use with caution. + public get emailInput() { + return this._email; + } + + // enable_change_password - computed: false, optional: true, required: false + private _enableChangePassword?: boolean | cdktf.IResolvable; + public get enableChangePassword() { + return this.getBooleanAttribute('enable_change_password'); + } + public set enableChangePassword(value: boolean | cdktf.IResolvable) { + this._enableChangePassword = value; + } + public resetEnableChangePassword() { + this._enableChangePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get enableChangePasswordInput() { + return this._enableChangePassword; + } + + // id - computed: true, optional: true, required: false + private _id?: string; + public get id() { + return this.getStringAttribute('id'); + } + public set id(value: string) { + this._id = value; + } + public resetId() { + this._id = undefined; + } + // Temporarily expose input value. Use with caution. + public get idInput() { + return this._id; + } + + // locked - computed: true, optional: false, required: false + public get locked() { + return this.getBooleanAttribute('locked'); + } + + // name - computed: false, optional: false, required: true + private _name?: string; + public get name() { + return this.getStringAttribute('name'); + } + public set name(value: string) { + this._name = value; + } + // Temporarily expose input value. Use with caution. + public get nameInput() { + return this._name; + } + + // next_login_change_password - computed: false, optional: true, required: false + private _nextLoginChangePassword?: boolean | cdktf.IResolvable; + public get nextLoginChangePassword() { + return this.getBooleanAttribute('next_login_change_password'); + } + public set nextLoginChangePassword(value: boolean | cdktf.IResolvable) { + this._nextLoginChangePassword = value; + } + public resetNextLoginChangePassword() { + this._nextLoginChangePassword = undefined; + } + // Temporarily expose input value. Use with caution. + public get nextLoginChangePasswordInput() { + return this._nextLoginChangePassword; + } + + // password_never_expires - computed: false, optional: true, required: false + private _passwordNeverExpires?: boolean | cdktf.IResolvable; + public get passwordNeverExpires() { + return this.getBooleanAttribute('password_never_expires'); + } + public set passwordNeverExpires(value: boolean | cdktf.IResolvable) { + this._passwordNeverExpires = value; + } + public resetPasswordNeverExpires() { + this._passwordNeverExpires = undefined; + } + // Temporarily expose input value. Use with caution. + public get passwordNeverExpiresInput() { + return this._passwordNeverExpires; + } + + // region - computed: true, optional: true, required: false + private _region?: string; + public get region() { + return this.getStringAttribute('region'); + } + public set region(value: string) { + this._region = value; + } + public resetRegion() { + this._region = undefined; + } + // Temporarily expose input value. Use with caution. + public get regionInput() { + return this._region; + } + + // total_desktops - computed: true, optional: false, required: false + public get totalDesktops() { + return this.getNumberAttribute('total_desktops'); + } + + // ========= + // SYNTHESIS + // ========= + + protected synthesizeAttributes(): { [name: string]: any } { + return { + account_expires: cdktf.stringToTerraform(this._accountExpires), + description: cdktf.stringToTerraform(this._description), + disabled: cdktf.booleanToTerraform(this._disabled), + email: cdktf.stringToTerraform(this._email), + enable_change_password: cdktf.booleanToTerraform(this._enableChangePassword), + id: cdktf.stringToTerraform(this._id), + name: cdktf.stringToTerraform(this._name), + next_login_change_password: cdktf.booleanToTerraform(this._nextLoginChangePassword), + password_never_expires: cdktf.booleanToTerraform(this._passwordNeverExpires), + region: cdktf.stringToTerraform(this._region), + }; + } + + protected synthesizeHclAttributes(): { [name: string]: any } { + const attrs = { + account_expires: { + value: cdktf.stringToHclTerraform(this._accountExpires), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + description: { + value: cdktf.stringToHclTerraform(this._description), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + disabled: { + value: cdktf.booleanToHclTerraform(this._disabled), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + email: { + value: cdktf.stringToHclTerraform(this._email), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + enable_change_password: { + value: cdktf.booleanToHclTerraform(this._enableChangePassword), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + id: { + value: cdktf.stringToHclTerraform(this._id), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + name: { + value: cdktf.stringToHclTerraform(this._name), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + next_login_change_password: { + value: cdktf.booleanToHclTerraform(this._nextLoginChangePassword), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + password_never_expires: { + value: cdktf.booleanToHclTerraform(this._passwordNeverExpires), + isBlock: false, + type: "simple", + storageClassType: "boolean", + }, + region: { + value: cdktf.stringToHclTerraform(this._region), + isBlock: false, + type: "simple", + storageClassType: "string", + }, + }; + + // remove undefined attributes + return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined )) + } +} diff --git a/src/constructs/versions.json b/src/constructs/versions.json new file mode 100644 index 00000000..e9aa2f6a --- /dev/null +++ b/src/constructs/versions.json @@ -0,0 +1,3 @@ +{ + "registry.terraform.io/huaweicloud/huaweicloud": "1.71.1" +} diff --git a/src/stack/deploy.ts b/src/stack/deploy.ts index 359c3748..e88c8760 100644 --- a/src/stack/deploy.ts +++ b/src/stack/deploy.ts @@ -1,7 +1,7 @@ import * as ros from '@alicloud/ros-cdk-core'; import { ActionContext, ServerlessIac } from '../types'; import { logger, rosStackDeploy } from '../common'; -import { RosStack } from './rosStack/rosStack'; +import { RosStack } from './rosStack'; export const generateStackTemplate = ( stackName: string, diff --git a/src/stack/rfsStack/index.ts b/src/stack/rfsStack/index.ts new file mode 100644 index 00000000..2b7d6b73 --- /dev/null +++ b/src/stack/rfsStack/index.ts @@ -0,0 +1,15 @@ +import { TerraformStack } from 'cdktf'; +import { Construct } from 'constructs'; +import { HuaweicloudProvider } from '../../constructs/huaweiCloud/providers/huaweicloud/provider'; +import { ActionContext, ServerlessIac } from '../../types'; + +export class RfsStack extends TerraformStack { + constructor(scope: Construct, iac: ServerlessIac, context: ActionContext) { + super(scope, context.stackName); + new HuaweicloudProvider(scope, 'huaweicloud', { + region: context.region, + accessKey: context.accessKeyId, + secretKey: context.accessKeySecret, + }); + } +} diff --git a/src/stack/rosStack/index.ts b/src/stack/rosStack/index.ts new file mode 100644 index 00000000..3d5de167 --- /dev/null +++ b/src/stack/rosStack/index.ts @@ -0,0 +1,34 @@ +import * as ros from '@alicloud/ros-cdk-core'; +import { ActionContext, ServerlessIac } from '../../types'; +import { replaceReference } from '../../common'; +import { resolveTags } from './tag'; +import { resolveFunctions } from './function'; +import { resolveStages } from './stage'; +import { resloveVars } from './vars'; +import { resolveDatabases } from './database'; +import { resolveEvents } from './event'; + +export class RosStack extends ros.Stack { + private readonly service: string; + + constructor(scope: ros.Construct, iac: ServerlessIac, context: ActionContext) { + super(scope, replaceReference(iac.service, context), { + stackName: context.stackName, + tags: resolveTags(iac.tags, context), + }); + + this.service = replaceReference(iac.service, context); + new ros.RosInfo(this, ros.RosInfo.description, `${this.service} stack`); + + // Define Parameters + resloveVars(this, iac.vars); + // Define Mappings + resolveStages(this, iac.stages, context); + // Define functions + resolveFunctions(this, iac.functions, context, this.service); + // Define Events + resolveEvents(this, iac.events, iac.tags, context, this.service); + // Define Databases + resolveDatabases(this, iac.databases, context); + } +} diff --git a/src/stack/rosStack/rosStack.ts b/src/stack/rosStack/rosStack.ts index 3d5de167..e69de29b 100644 --- a/src/stack/rosStack/rosStack.ts +++ b/src/stack/rosStack/rosStack.ts @@ -1,34 +0,0 @@ -import * as ros from '@alicloud/ros-cdk-core'; -import { ActionContext, ServerlessIac } from '../../types'; -import { replaceReference } from '../../common'; -import { resolveTags } from './tag'; -import { resolveFunctions } from './function'; -import { resolveStages } from './stage'; -import { resloveVars } from './vars'; -import { resolveDatabases } from './database'; -import { resolveEvents } from './event'; - -export class RosStack extends ros.Stack { - private readonly service: string; - - constructor(scope: ros.Construct, iac: ServerlessIac, context: ActionContext) { - super(scope, replaceReference(iac.service, context), { - stackName: context.stackName, - tags: resolveTags(iac.tags, context), - }); - - this.service = replaceReference(iac.service, context); - new ros.RosInfo(this, ros.RosInfo.description, `${this.service} stack`); - - // Define Parameters - resloveVars(this, iac.vars); - // Define Mappings - resolveStages(this, iac.stages, context); - // Define functions - resolveFunctions(this, iac.functions, context, this.service); - // Define Events - resolveEvents(this, iac.events, iac.tags, context, this.service); - // Define Databases - resolveDatabases(this, iac.databases, context); - } -}